1 line
378 KiB
JavaScript
1 line
378 KiB
JavaScript
!function(){"use strict";var N=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},g=function(n,o){return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n(o.apply(null,t))}},U=function(t){return function(){return t}},d=function(t){return t};function f(o){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=r.concat(t);return o.apply(null,n)}}var t,e,n,o,r,s,i,m=function(n){return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return!n.apply(null,t)}},a=function(t){return function(){throw new Error(t)}},u=U(!1),c=U(!0),l=u,h=c,v=function(){return p},p=(o={fold:function(t,e){return t()},is:l,isSome:l,isNone:h,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:n,orThunk:e,map:v,ap:v,each:function(){},bind:v,flatten:v,exists:l,forall:h,filter:v,equals:t=function(t){return t.isNone()},equals_:t,toArray:function(){return[]},toString:U("none()")},Object.freeze&&Object.freeze(o),o),b=function(n){var t=function(){return n},e=function(){return r},o=function(t){return t(n)},r={fold:function(t,e){return e(n)},is:function(t){return n===t},isSome:h,isNone:l,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:e,orThunk:e,map:function(t){return b(t(n))},ap:function(t){return t.fold(v,function(t){return b(t(n))})},each:function(t){t(n)},bind:o,flatten:t,exists:o,forall:o,filter:function(t){return t(n)?r:p},equals:function(t){return t.is(n)},equals_:function(t,e){return t.fold(l,function(t){return e(n,t)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return r},P={some:b,none:v,from:function(t){return null===t||t===undefined?p:b(t)}},y=function(e){return function(t){return function(t){if(null===t)return"null";var e=typeof t;return"object"===e&&Array.prototype.isPrototypeOf(t)?"array":"object"===e&&String.prototype.isPrototypeOf(t)?"string":e}(t)===e}},x=y("string"),w=y("object"),C=y("array"),k=y("boolean"),z=y("function"),S=y("number"),O=(r=Array.prototype.indexOf)===undefined?function(t,e){return R(t,e)}:function(t,e){return r.call(t,e)},M=function(t,e){return-1<O(t,e)},H=function(t,e){return F(t,e).isSome()},V=function(t,e){for(var n=[],o=0;o<t.length;o+=e){var r=t.slice(o,o+e);n.push(r)}return n},E=function(t,e){for(var n=t.length,o=new Array(n),r=0;r<n;r++){var i=t[r];o[r]=e(i,r,t)}return o},T=function(t,e){for(var n=0,o=t.length;n<o;n++)e(t[n],n,t)},A=function(t,e){for(var n=[],o=0,r=t.length;o<r;o++){var i=t[o];e(i,o,t)&&n.push(i)}return n},B=function(t,e,n){return function(t,e){for(var n=t.length-1;0<=n;n--)e(t[n],n,t)}(t,function(t){n=e(n,t)}),n},D=function(t,e,n){return T(t,function(t){n=e(n,t)}),n},_=function(t,e){for(var n=0,o=t.length;n<o;n++){var r=t[n];if(e(r,n,t))return P.some(r)}return P.none()},F=function(t,e){for(var n=0,o=t.length;n<o;n++)if(e(t[n],n,t))return P.some(n);return P.none()},R=function(t,e){for(var n=0,o=t.length;n<o;++n)if(t[n]===e)return n;return-1},L=Array.prototype.push,I=function(t){for(var e=[],n=0,o=t.length;n<o;++n){if(!Array.prototype.isPrototypeOf(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);L.apply(e,t[n])}return e},j=function(t,e){var n=E(t,e);return I(n)},W=function(t,e){for(var n=0,o=t.length;n<o;++n)if(!0!==e(t[n],n,t))return!1;return!0},G=Array.prototype.slice,X=function(t){var e=G.call(t,0);return e.reverse(),e},Y=function(t,e){return A(t,function(t){return!M(e,t)})},q=function(t){return[t]},K=function(t){return 0===t.length?P.none():P.some(t[0])},J=function(t){return 0===t.length?P.none():P.some(t[t.length-1])},$=z(Array.from)?Array.from:function(t){return G.call(t)},Q=Object.keys,Z=Object.hasOwnProperty,tt=function(t,e){for(var n=Q(t),o=0,r=n.length;o<r;o++){var i=n[o];e(t[i],i,t)}},et=function(t,o){return nt(t,function(t,e,n){return{k:e,v:o(t,e,n)}})},nt=function(o,r){var i={};return tt(o,function(t,e){var n=r(t,e,o);i[n.k]=n.v}),i},ot=function(t,n){var o=[];return tt(t,function(t,e){o.push(n(t,e))}),o},rt=function(t){return ot(t,function(t){return t})},it=function(t,e){return Z.call(t,e)},at=function(e){return function(t){return it(t,e)?P.from(t[e]):P.none()}},ut=function(t,e){return at(e)(t)},ct=function(t,e){var n={};return n[t]=e,n},st=function(n){return{is:function(t){return n===t},isValue:c,isError:u,getOr:U(n),getOrThunk:U(n),getOrDie:U(n),or:function(t){return st(n)},orThunk:function(t){return st(n)},fold:function(t,e){return e(n)},map:function(t){return st(t(n))},each:function(t){t(n)},bind:function(t){return t(n)},exists:function(t){return t(n)},forall:function(t){return t(n)},toOption:function(){return P.some(n)}}},lt=function(n){return{is:u,isValue:u,isError:c,getOr:d,getOrThunk:function(t){return t()},getOrDie:function(){return a(String(n))()},or:function(t){return t},orThunk:function(t){return t()},fold:function(t,e){return t(n)},map:function(t){return lt(n)},each:N,bind:function(t){return lt(n)},exists:u,forall:c,toOption:P.none}},ft={value:st,error:lt},dt=function(a){if(!C(a))throw new Error("cases must be an array");if(0===a.length)throw new Error("there must be at least one case");var u=[],n={};return T(a,function(t,o){var e=Q(t);if(1!==e.length)throw new Error("one and only one name per case");var r=e[0],i=t[r];if(n[r]!==undefined)throw new Error("duplicate key detected:"+r);if("cata"===r)throw new Error("cannot have a case named cata (sorry)");if(!C(i))throw new Error("case arguments must be an array");u.push(r),n[r]=function(){var t=arguments.length;if(t!==i.length)throw new Error("Wrong number of arguments to case "+r+". Expected "+i.length+" ("+i+"), got "+t);for(var n=new Array(t),e=0;e<n.length;e++)n[e]=arguments[e];return{fold:function(){if(arguments.length!==a.length)throw new Error("Wrong number of arguments to fold. Expected "+a.length+", got "+arguments.length);return arguments[o].apply(null,n)},match:function(t){var e=Q(t);if(u.length!==e.length)throw new Error("Wrong number of arguments to match. Expected: "+u.join(",")+"\nActual: "+e.join(","));if(!W(u,function(t){return M(e,t)}))throw new Error("Not all branches were specified when using match. Specified: "+e.join(", ")+"\nRequired: "+u.join(", "));return t[r].apply(null,n)},log:function(t){console.log(t,{constructors:u,constructor:r,params:n})}}}}),n},mt=(dt([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),Object.prototype.hasOwnProperty),ht=function(a){return function(){for(var t=new Array(arguments.length),e=0;e<t.length;e++)t[e]=arguments[e];if(0===t.length)throw new Error("Can't merge zero objects");for(var n={},o=0;o<t.length;o++){var r=t[o];for(var i in r)mt.call(r,i)&&(n[i]=a(n[i],r[i]))}return n}},gt=ht(function(t,e){return w(t)&&w(e)?gt(t,e):e}),vt=ht(function(t,e){return e}),pt=function(t,e){return n=e,o={},tt(t,function(t,e){M(n,e)||(o[e]=t)}),o;var n,o},bt=function(t){return at(t)},yt=function(t,e){return n=t,o=e,function(t){return it(t,n)?t[n]:o};var n,o},xt=function(t,e){return ut(t,e)},wt=function(t,e){return ct(t,e)},kt=function(t){return e={},T(t,function(t){e[t.key]=t.value}),e;var e},zt=function(t,e){var n,o,r,i,a,u=(n=[],o=[],T(t,function(t){t.fold(function(t){n.push(t)},function(t){o.push(t)})}),{errors:n,values:o});return 0<u.errors.length?(a=u.errors,g(ft.error,I)(a)):(i=e,0===(r=u.values).length?ft.value(i):ft.value(gt(i,vt.apply(undefined,r))))},St=function(t,e){return it(n=t,o=e)&&n[o]!==undefined&&null!==n[o];var n,o},Ct=function(t){var e=t,n=function(){return e};return{get:n,set:function(t){e=t},clone:function(){return Ct(n())}}},Ot=function(t){for(var e=[],n=function(t){e.push(t)},o=0;o<t.length;o++)t[o].each(n);return e},Mt=function(t,e){for(var n=0;n<t.length;n++){var o=e(t[n],n);if(o.isSome())return o}return P.none()},Ht=U("touchstart"),Vt=U("touchmove"),Et=U("touchend"),Tt=U("mousedown"),At=U("mousemove"),Bt=U("mouseout"),Dt=U("mouseup"),_t=U("mouseover"),Ft=U("focusin"),Rt=U("focusout"),Lt=U("keydown"),It=U("keyup"),Nt=U("input"),Pt=U("change"),jt=U("click"),Ut=U("transitionend"),Wt=U("selectstart"),Gt=U("paste"),Xt=function(n){var o,r=!1;return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return r||(r=!0,o=n.apply(null,t)),o}},Yt=function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var o=t[n];if(o.test(e))return o}return undefined}(t,e);if(!n)return{major:0,minor:0};var o=function(t){return Number(e.replace(n,"$"+t))};return Kt(o(1),o(2))},qt=function(){return Kt(0,0)},Kt=function(t,e){return{major:t,minor:e}},Jt={nu:Kt,detect:function(t,e){var n=String(e).toLowerCase();return 0===t.length?qt():Yt(t,n)},unknown:qt},$t="Firefox",Qt=function(t,e){return function(){return e===t}},Zt=function(t){var e=t.current;return{current:e,version:t.version,isEdge:Qt("Edge",e),isChrome:Qt("Chrome",e),isIE:Qt("IE",e),isOpera:Qt("Opera",e),isFirefox:Qt($t,e),isSafari:Qt("Safari",e)}},te={unknown:function(){return Zt({current:undefined,version:Jt.unknown()})},nu:Zt,edge:U("Edge"),chrome:U("Chrome"),ie:U("IE"),opera:U("Opera"),firefox:U($t),safari:U("Safari")},ee="Windows",ne="Android",oe="Solaris",re="FreeBSD",ie=function(t,e){return function(){return e===t}},ae=function(t){var e=t.current;return{current:e,version:t.version,isWindows:ie(ee,e),isiOS:ie("iOS",e),isAndroid:ie(ne,e),isOSX:ie("OSX",e),isLinux:ie("Linux",e),isSolaris:ie(oe,e),isFreeBSD:ie(re,e)}},ue={unknown:function(){return ae({current:undefined,version:Jt.unknown()})},nu:ae,windows:U(ee),ios:U("iOS"),android:U(ne),linux:U("Linux"),osx:U("OSX"),solaris:U(oe),freebsd:U(re)},ce=function(t,e){var n=String(e).toLowerCase();return _(t,function(t){return t.search(n)})},se=function(t,n){return ce(t,n).map(function(t){var e=Jt.detect(t.versionRegexes,n);return{current:t.name,version:e}})},le=function(t,n){return ce(t,n).map(function(t){var e=Jt.detect(t.versionRegexes,n);return{current:t.name,version:e}})},fe=function(t,e){return-1!==t.indexOf(e)},de=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,me=function(e){return function(t){return fe(t,e)}},he=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return fe(t,"edge/")&&fe(t,"chrome")&&fe(t,"safari")&&fe(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,de],search:function(t){return fe(t,"chrome")&&!fe(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return fe(t,"msie")||fe(t,"trident")}},{name:"Opera",versionRegexes:[de,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:me("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:me("firefox")},{name:"Safari",versionRegexes:[de,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(fe(t,"safari")||fe(t,"mobile/"))&&fe(t,"applewebkit")}}],ge=[{name:"Windows",search:me("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return fe(t,"iphone")||fe(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:me("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:me("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:me("linux"),versionRegexes:[]},{name:"Solaris",search:me("sunos"),versionRegexes:[]},{name:"FreeBSD",search:me("freebsd"),versionRegexes:[]}],ve={browsers:U(he),oses:U(ge)},pe=function(t){var e,n,o,r,i,a,u,c,s,l,f,d=ve.browsers(),m=ve.oses(),h=se(d,t).fold(te.unknown,te.nu),g=le(m,t).fold(ue.unknown,ue.nu);return{browser:h,os:g,deviceType:(n=h,o=t,r=(e=g).isiOS()&&!0===/ipad/i.test(o),i=e.isiOS()&&!r,a=e.isAndroid()&&3===e.version.major,u=e.isAndroid()&&4===e.version.major,c=r||a||u&&!0===/mobile/i.test(o),s=e.isiOS()||e.isAndroid(),l=s&&!c,f=n.isSafari()&&e.isiOS()&&!1===/safari/i.test(o),{isiPad:U(r),isiPhone:U(i),isTablet:U(c),isPhone:U(l),isTouch:U(s),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:U(f)})}},be={detect:Xt(function(){var t=navigator.userAgent;return pe(t)})},ye={tap:U("alloy.tap")},xe=U("alloy.focus"),we=U("alloy.blur.post"),ke=U("alloy.receive"),ze=U("alloy.execute"),Se=U("alloy.focus.item"),Ce=ye.tap,Oe=be.detect().deviceType.isTouch()?ye.tap:jt,Me=U("alloy.longpress"),He=U("alloy.sandbox.close"),Ve=U("alloy.typeahead.cancel"),Ee=U("alloy.system.init"),Te=U("alloy.system.scroll"),Ae=U("alloy.system.attached"),Be=U("alloy.system.detached"),De=U("alloy.system.dismissRequested"),_e=U("alloy.focusmanager.shifted"),Fe=U("alloy.slotcontainer.visibility"),Re=U("alloy.change.tab"),Le=U("alloy.dismiss.tab"),Ie=function(t){if(null===t||t===undefined)throw new Error("Node cannot be null or undefined");return{dom:U(t)}},Ne={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",t),"HTML must have a single root node";return Ie(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return Ie(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return Ie(n)},fromDom:Ie,fromPoint:function(t,e,n){var o=t.dom();return P.from(o.elementFromPoint(e,n)).map(Ie)}},Pe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];if(e.length!==n.length)throw new Error('Wrong number of arguments to struct. Expected "['+e.length+']", got '+n.length+" arguments");var o={};return T(e,function(t,e){o[t]=U(n[e])}),o}},je=function(t){return t.slice(0).sort()},Ue=function(e,t){if(!C(t))throw new Error("The "+e+" fields must be an array. Was: "+t+".");T(t,function(t){if(!x(t))throw new Error("The value "+t+" in the "+e+" fields was not a string.")})},We=function(r,i){var n,a=r.concat(i);if(0===a.length)throw new Error("You must specify at least one required or optional field.");return Ue("required",r),Ue("optional",i),n=je(a),_(n,function(t,e){return e<n.length-1&&t===n[e+1]}).each(function(t){throw new Error("The field: "+t+" occurs more than once in the combined fields: ["+n.join(", ")+"].")}),function(e){var n=Q(e);W(r,function(t){return M(n,t)})||function(t,e){throw new Error("All required keys ("+je(t).join(", ")+") were not specified. Specified keys were: "+je(e).join(", ")+".")}(r,n);var t=A(n,function(t){return!M(a,t)});0<t.length&&function(t){throw new Error("Unsupported keys for object: "+je(t).join(", "))}(t);var o={};return T(r,function(t){o[t]=U(e[t])}),T(i,function(t){o[t]=U(Object.prototype.hasOwnProperty.call(e,t)?P.some(e[t]):P.none())}),o}},Ge="undefined"!=typeof window?window:Function("return this;")(),Xe=function(t,e){return function(t,e){for(var n=e!==undefined&&null!==e?e:Ge,o=0;o<t.length&&n!==undefined&&null!==n;++o)n=n[t[o]];return n}(t.split("."),e)},Ye={getOrDie:function(t,e){var n=Xe(t,e);if(n===undefined||null===n)throw t+" not available on this browser";return n}},qe=(Node.ATTRIBUTE_NODE,Node.CDATA_SECTION_NODE,Node.COMMENT_NODE,Node.DOCUMENT_NODE),Ke=(Node.DOCUMENT_TYPE_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE),Je=Node.TEXT_NODE,$e=(Node.PROCESSING_INSTRUCTION_NODE,Node.ENTITY_REFERENCE_NODE,Node.ENTITY_NODE,Node.NOTATION_NODE,Ke),Qe=qe,Ze=function(t,e){var n=t.dom();if(n.nodeType!==$e)return!1;if(n.matches!==undefined)return n.matches(e);if(n.msMatchesSelector!==undefined)return n.msMatchesSelector(e);if(n.webkitMatchesSelector!==undefined)return n.webkitMatchesSelector(e);if(n.mozMatchesSelector!==undefined)return n.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},tn=function(t){return t.nodeType!==$e&&t.nodeType!==Qe||0===t.childElementCount},en=function(t,e){return t.dom()===e.dom()},nn=(be.detect().browser.isIE(),function(t){return Ne.fromDom(t.dom().ownerDocument)}),on=function(t){var e=t.dom().ownerDocument.defaultView;return Ne.fromDom(e)},rn=function(t){var e=t.dom();return P.from(e.parentNode).map(Ne.fromDom)},an=function(t){var e=t.dom();return P.from(e.offsetParent).map(Ne.fromDom)},un=function(t){var e=t.dom();return E(e.childNodes,Ne.fromDom)},cn=function(t,e){var n=t.dom().childNodes;return P.from(n[e]).map(Ne.fromDom)},sn=(Pe("element","offset"),function(e,n){rn(e).each(function(t){t.dom().insertBefore(n.dom(),e.dom())})}),ln=function(t,e){var n;(n=t.dom(),P.from(n.nextSibling).map(Ne.fromDom)).fold(function(){rn(t).each(function(t){dn(t,e)})},function(t){sn(t,e)})},fn=function(e,n){cn(e,0).fold(function(){dn(e,n)},function(t){e.dom().insertBefore(n.dom(),t.dom())})},dn=function(t,e){t.dom().appendChild(e.dom())},mn=function(e,t){T(t,function(t){dn(e,t)})},hn=function(t){t.dom().textContent="",T(un(t),function(t){gn(t)})},gn=function(t){var e=t.dom();null!==e.parentNode&&e.parentNode.removeChild(e)},vn=function(t){return t.dom().innerHTML},pn=function(t,e){var n,o,r=nn(t).dom(),i=Ne.fromDom(r.createDocumentFragment()),a=(n=e,(o=(r||document).createElement("div")).innerHTML=n,un(Ne.fromDom(o)));mn(i,a),hn(t),dn(t,i)},bn=function(t){return t.dom().nodeName.toLowerCase()},yn=function(e){return function(t){return t.dom().nodeType===e}},xn=yn(Ke),wn=yn(Je),kn=yn(qe),zn=function(t,e,n){if(!(x(n)||k(n)||S(n)))throw console.error("Invalid call to Attr.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")},Sn=function(t,e,n){zn(t.dom(),e,n)},Cn=function(t,e){var n=t.dom();tt(e,function(t,e){zn(n,e,t)})},On=function(t,e){var n=t.dom().getAttribute(e);return null===n?undefined:n},Mn=function(t,e){var n=t.dom();return!(!n||!n.hasAttribute)&&n.hasAttribute(e)},Hn=function(t,e){t.dom().removeAttribute(e)},Vn=function(t){return e=t,n=!1,Ne.fromDom(e.dom().cloneNode(n));var e,n},En=function(t){var e,n,o,r=Vn(t);return e=r,n=Ne.fromTag("div"),o=Ne.fromDom(e.dom().cloneNode(!0)),dn(n,o),vn(n)},Tn=function(t){return En(t)},An="unknown",Bn="__CHROME_INSPECTOR_CONNECTION_TO_ALLOY__";(i=s||(s={}))[i.STOP=0]="STOP",i[i.NORMAL=1]="NORMAL",i[i.LOGGING=2]="LOGGING";var Dn=Ct({}),_n=function(e,t,n){var o,r,i,a;switch(xt(Dn.get(),e).orThunk(function(){var t=Q(Dn.get());return Mt(t,function(t){return-1<e.indexOf(t)?P.some(Dn.get()[t]):P.none()})}).getOr(s.NORMAL)){case s.NORMAL:return n(Nn());case s.LOGGING:var u=(o=e,r=t,i=[],a=(new Date).getTime(),{logEventCut:function(t,e,n){i.push({outcome:"cut",target:e,purpose:n})},logEventStopped:function(t,e,n){i.push({outcome:"stopped",target:e,purpose:n})},logNoParent:function(t,e,n){i.push({outcome:"no-parent",target:e,purpose:n})},logEventNoHandlers:function(t,e){i.push({outcome:"no-handlers-left",target:e})},logEventResponse:function(t,e,n){i.push({outcome:"response",purpose:n,target:e})},write:function(){var t=(new Date).getTime();M(["mousemove","mouseover","mouseout",Ee()],o)||console.log(o,{event:o,time:t-a,target:r.dom(),sequence:E(i,function(t){return M(["cut","stopped","response"],t.outcome)?"{"+t.purpose+"} "+t.outcome+" at ("+Tn(t.target)+")":t.outcome})})}}),c=n(u);return u.write(),c;case s.STOP:return!0}},Fn=["alloy/data/Fields","alloy/debugging/Debugging"],Rn=function(t,e,n){return _n(t,e,n)},Ln=function(){if(window[Bn]!==undefined)return window[Bn];var e=function(t,e){var n=Dn.get();n[t]=e,Dn.set(n)};return window[Bn]={systems:{},lookup:function(e){var n=window[Bn].systems,t=Q(n);return Mt(t,function(t){return n[t].getByUid(e).toOption().map(function(t){return wt(Tn(t.element()),(e=function(n){var t=n.spec();return{"(original.spec)":t,"(dom.ref)":n.element().dom(),"(element)":Tn(n.element()),"(initComponents)":E(t.components!==undefined?t.components:[],e),"(components)":E(n.components(),e),"(bound.events)":ot(n.events(),function(t,e){return[e]}).join(", "),"(behaviours)":t.behaviours!==undefined?et(t.behaviours,function(t,e){return t===undefined?"--revoked--":{config:t.configAsRaw(),"original-config":t.initialConfig,state:n.readState(e)}}):"none"}})(t));var e})}).orThunk(function(){return P.some({error:"Systems ("+t.join(", ")+") did not contain uid: "+e})})},events:{setToNormal:function(t){e(t,s.NORMAL)},setToLogging:function(t){e(t,s.LOGGING)},setToStop:function(t){e(t,s.STOP)}}},window[Bn]},In=function(t,e){Ln().systems[t]=e},Nn=U({logEventCut:N,logEventStopped:N,logNoParent:N,logEventNoHandlers:N,logEventResponse:N,write:N}),Pn=0,jn=function(t){var e=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++Pn+String(e)},Un=tinymce.util.Tools.resolve("tinymce.ThemeManager"),Wn=function(){return(Wn=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function Gn(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&(n[o[r]]=t[o[r]])}return n}var Xn,Yn,qn=dt([{strict:[]},{defaultedThunk:["fallbackThunk"]},{asOption:[]},{asDefaultedOptionThunk:["fallbackThunk"]},{mergeWithThunk:["baseThunk"]}]),Kn=function(t){return qn.defaultedThunk(U(t))},Jn=qn.strict,$n=qn.asOption,Qn=qn.defaultedThunk,Zn=qn.mergeWithThunk;(Yn=Xn||(Xn={}))[Yn.Error=0]="Error",Yn[Yn.Value=1]="Value";var to=function(t,e,n){return t.stype===Xn.Error?e(t.serror):n(t.svalue)},eo=function(t){return{stype:Xn.Value,svalue:t}},no=function(t){return{stype:Xn.Error,serror:t}},oo=function(t){return t.fold(no,eo)},ro=function(t){return to(t,ft.error,ft.value)},io=eo,ao=function(t){var e=[],n=[];return T(t,function(t){to(t,function(t){return n.push(t)},function(t){return e.push(t)})}),{values:e,errors:n}},uo=no,co=function(t,e){return t.stype===Xn.Value?e(t.svalue):t},so=function(t,e){return t.stype===Xn.Error?e(t.serror):t},lo=function(t,e){return t.stype===Xn.Value?{stype:Xn.Value,svalue:e(t.svalue)}:t},fo=function(t,e){return t.stype===Xn.Error?{stype:Xn.Error,serror:e(t.serror)}:t},mo=function(t){return g(uo,I)(t)},ho=function(t,e){var n,o,r=ao(t);return 0<r.errors.length?mo(r.errors):(n=r.values,o=e,0<n.length?io(gt(o,vt.apply(undefined,n))):io(o))},go=function(t){var e=ao(t);return 0<e.errors.length?mo(e.errors):io(e.values)},vo=dt([{setOf:["validator","valueType"]},{arrOf:["valueType"]},{objOf:["fields"]},{itemOf:["validator"]},{choiceOf:["key","branches"]},{thunk:["description"]},{func:["args","outputSchema"]}]),po=dt([{field:["name","presence","type"]},{state:["name"]}]),bo=function(){return Ye.getOrDie("JSON")},yo=function(t,e,n){return bo().stringify(t,e,n)},xo=function(t){return w(t)&&100<Q(t).length?" removed due to size":yo(t,null,2)},wo=function(t,e){return uo([{path:t,getErrorInfo:e}])},ko=dt([{field:["key","okey","presence","prop"]},{state:["okey","instantiator"]}]),zo=function(n,o,r){return ut(o,r).fold(function(){return t=r,e=o,wo(n,function(){return'Could not find valid *strict* value for "'+t+'" in '+xo(e)});var t,e},io)},So=function(t,e,n){var o=ut(t,e).fold(function(){return n(t)},d);return io(o)},Co=function(u,c,t,s){return t.fold(function(r,n,t,o){var i=function(t){var e=o.extract(u.concat([r]),s,t);return lo(e,function(t){return ct(n,s(t))})},a=function(t){return t.fold(function(){var t=ct(n,s(P.none()));return io(t)},function(t){var e=o.extract(u.concat([r]),s,t);return lo(e,function(t){return ct(n,s(P.some(t)))})})};return t.fold(function(){return co(zo(u,c,r),i)},function(t){return co(So(c,r,t),i)},function(){return co(io(ut(c,r)),a)},function(t){return co((n=t,o=ut(e=c,r).map(function(t){return!0===t?n(e):t}),io(o)),a);var e,n,o},function(t){var e=t(c),n=lo(So(c,r,U({})),function(t){return gt(e,t)});return co(n,i)})},function(t,e){var n=e(c);return io(ct(t,s(n)))})},Oo=function(o){return{extract:function(n,t,e){return so(o(e,t),function(t){return e=t,wo(n,function(){return e});var e})},toString:function(){return"val"},toDsl:function(){return vo.itemOf(o)}}},Mo=function(t){var c=Ho(t),s=B(t,function(e,t){return t.fold(function(t){return gt(e,wt(t,!0))},U(e))},{});return{extract:function(t,e,n){var o,r,i,a=k(n)?[]:(r=Q(o=n),A(r,function(t){return St(o,t)})),u=A(a,function(t){return!St(s,t)});return 0===u.length?c.extract(t,e,n):(i=u,wo(t,function(){return"There are unsupported fields: ["+i.join(", ")+"] specified"}))},toString:c.toString,toDsl:c.toDsl}},Ho=function(u){return{extract:function(t,e,n){return o=t,r=n,i=e,a=E(u,function(t){return Co(o,r,t,i)}),ho(a,{});var o,r,i,a},toString:function(){return"obj{\n"+E(u,function(t){return t.fold(function(t,e,n,o){return t+" -> "+o.toString()},function(t,e){return"state("+t+")"})}).join("\n")+"}"},toDsl:function(){return vo.objOf(E(u,function(t){return t.fold(function(t,e,n,o){return po.field(t,n,o)},function(t,e){return po.state(t)})}))}}},Vo=function(r){return{extract:function(n,o,t){var e=E(t,function(t,e){return r.extract(n.concat(["["+e+"]"]),o,t)});return go(e)},toString:function(){return"array("+r.toString()+")"},toDsl:function(){return vo.arrOf(r)}}},Eo=function(u,c){return{extract:function(n,o,r){var t,e,i=Q(r),a=(t=n,e=i,Vo(Oo(u)).extract(t,d,e));return co(a,function(t){var e=E(t,function(t){return ko.field(t,t,Jn(),c)});return Ho(e).extract(n,o,r)})},toString:function(){return"setOf("+c.toString()+")"},toDsl:function(){return vo.setOf(u,c)}}},To=U(Oo(io)),Ao=g(Vo,Ho),Bo=ko.state,Do=ko.field,_o=function(n,e,o,r,i){return xt(r,i).fold(function(){return t=r,e=i,wo(n,function(){return'The chosen schema: "'+e+'" did not exist in branches: '+xo(t)});var t,e},function(t){return Ho(t).extract(n.concat(["branch: "+i]),e,o)})},Fo=function(r,i){return{extract:function(e,n,o){return xt(o,r).fold(function(){return t=r,wo(e,function(){return'Choice schema did not contain choice key: "'+t+'"'});var t},function(t){return _o(e,n,o,i,t)})},toString:function(){return"chooseOn("+r+"). Possible values: "+Q(i)},toDsl:function(){return vo.choiceOf(r,i)}}},Ro=Oo(io),Lo=function(e){return Oo(function(t){return e(t).fold(uo,io)})},Io=function(e,t){return Eo(function(t){return oo(e(t))},t)},No=function(t,e,n){return ro((o=t,r=d,i=n,a=e.extract([o],r,i),fo(a,function(t){return{input:i,errors:t}})));var o,r,i,a},Po=function(t){return t.fold(function(t){throw new Error(Uo(t))},d)},jo=function(t,e,n){return Po(No(t,e,n))},Uo=function(t){return"Errors: \n"+(e=t.errors,n=10<e.length?e.slice(0,10).concat([{path:[],getErrorInfo:function(){return"... (only showing first ten failures)"}}]):e,E(n,function(t){return"Failed path: ("+t.path.join(" > ")+")\n"+t.getErrorInfo()}))+"\n\nInput object: "+xo(t.input);var e,n},Wo=function(t,e){return Fo(t,e)},Go=U(Ro),Xo=function(n,o){return Oo(function(t){var e=typeof t;return n(t)?io(t):uo("Expected type: "+o+" but got: "+e)})},Yo=Xo(S,"number"),qo=Xo(x,"string"),Ko=Xo(k,"boolean"),Jo=Xo(z,"function"),$o=function(t){return Do(t,t,Jn(),To())},Qo=function(t,e){return Do(t,t,Jn(),e)},Zo=function(t){return Qo(t,qo)},tr=function(t){return Qo(t,Jo)},er=function(t,e){return Do(t,t,Jn(),Ho(e))},nr=function(t,e){return Do(t,t,Jn(),Ao(e))},or=function(t,e){return Do(t,t,Jn(),Vo(e))},rr=function(t){return Do(t,t,$n(),To())},ir=function(t,e){return Do(t,t,$n(),e)},ar=function(t){return ir(t,qo)},ur=function(t,e){return Do(t,t,$n(),Ho(e))},cr=function(t,e){return Do(t,t,Kn(e),To())},sr=function(t,e,n){return Do(t,t,Kn(e),n)},lr=function(t,e){return sr(t,e,Yo)},fr=function(t,e){return sr(t,e,qo)},dr=function(t,e){return sr(t,e,Ko)},mr=function(t,e){return sr(t,e,Jo)},hr=function(t,e,n){return Do(t,t,Kn(e),Ho(n))},gr=function(t,e){return Bo(t,e)},vr=function(t){if(!St(t,"can")&&!St(t,"abort")&&!St(t,"run"))throw new Error("EventHandler defined by: "+yo(t,null,2)+" does not have can, abort, or run!");return jo("Extracting event.handler",Mo([cr("can",U(!0)),cr("abort",U(!1)),cr("run",N)]),t)},pr=function(n){var e,o,r,i,t=(e=n,o=function(t){return t.can},function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return D(e,function(t,e){return t&&o(e).apply(undefined,n)},!0)}),a=(r=n,i=function(t){return t.abort},function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return D(r,function(t,e){return t||i(e).apply(undefined,n)},!1)});return vr({can:t,abort:a,run:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];T(n,function(t){t.run.apply(undefined,e)})}})},br=function(t,e){kr(t,t.element(),e,{})},yr=function(t,e,n){kr(t,t.element(),e,n)},xr=function(t){br(t,ze())},wr=function(t,e,n){kr(t,e,n,{})},kr=function(t,e,n,o){var r=Wn({target:e},o);t.getSystem().triggerEvent(n,e,et(r,U))},zr=function(t,e,n,o){t.getSystem().triggerEvent(n,e,o.event())},Sr=function(t){var e=wn(t)?t.dom().parentNode:t.dom();return e!==undefined&&null!==e&&e.ownerDocument.body.contains(e)},Cr=Xt(function(){return Or(Ne.fromDom(document))}),Or=function(t){var e=t.dom().body;if(null===e||e===undefined)throw"Body is not available yet";return Ne.fromDom(e)};function Mr(t,e,n,o,r){return t(n,o)?P.some(n):z(r)&&r(n)?P.none():e(n,o,r)}var Hr,Vr,Er,Tr,Ar=function(t,e,n){for(var o=t.dom(),r=z(n)?n:U(!1);o.parentNode;){o=o.parentNode;var i=Ne.fromDom(o);if(e(i))return P.some(i);if(r(i))break}return P.none()},Br=function(t,e,n){return Mr(function(t){return e(t)},Ar,t,e,n)},Dr=function(t,o){var r=function(t){for(var e=0;e<t.childNodes.length;e++){if(o(Ne.fromDom(t.childNodes[e])))return P.some(Ne.fromDom(t.childNodes[e]));var n=r(t.childNodes[e]);if(n.isSome())return n}return P.none()};return r(t.dom())},_r=function(t,e,n){return Br(t,function(t){return e(t).isSome()},n).bind(e)},Fr=function(t){return kt(t)},Rr=function(t,e){return{key:t,value:vr({abort:e})}},Lr=function(t){return{key:t,value:vr({run:function(t,e){e.event().prevent()}})}},Ir=function(t,e){return{key:t,value:vr({run:e})}},Nr=function(t,e,n){return{key:t,value:vr({run:function(t){e.apply(undefined,[t].concat(n))}})}},Pr=function(t){return function(o){return{key:t,value:vr({run:function(t,e){var n;n=e,en(t.element(),n.event().target())&&o(t,e)}})}}},jr=function(t,e,n){var o,r,i=e.partUids[n];return r=i,Ir(o=t,function(t,e){t.getSystem().getByUid(r).each(function(t){zr(t,t.element(),o,e)})})},Ur=function(t,r){return Ir(t,function(e,t){var n=t.event(),o=e.getSystem().getByDom(n.target()).fold(function(){return _r(n.target(),function(t){return e.getSystem().getByDom(t).toOption()},U(!1)).getOr(e)},function(t){return t});r(e,o,t)})},Wr=function(t){return Ir(t,function(t,e){e.cut()})},Gr=function(t){return Ir(t,function(t,e){e.stop()})},Xr=function(t,e){return Pr(t)(e)},Yr=Pr(Ae()),qr=Pr(Be()),Kr=Pr(Ee()),Jr=(Hr=ze(),function(t){return Ir(Hr,t)}),$r=Fr([(Vr=xe(),Er=function(t,e){var n,o,r=e.event().originator(),i=e.event().target();return o=i,!(en(n=r,t.element())&&!en(n,o)&&(console.warn(xe()+" did not get interpreted by the desired target. \nOriginator: "+Tn(r)+"\nTarget: "+Tn(i)+"\nCheck the "+xe()+" event handlers"),1))},{key:Vr,value:vr({can:Er})})]),Qr=Object.freeze({events:$r}),Zr=U("alloy-id-"),ti=U("data-alloy-id"),ei=Zr(),ni=ti(),oi=function(t,e){Object.defineProperty(t.dom(),ni,{value:e,writable:!0})},ri=function(t){var e=xn(t)?t.dom()[ni]:null;return P.from(e)},ii=function(t){return jn(t)},ai=d,ui=function(e){var t=function(t){return function(){throw new Error("The component must be in a context to send: "+t+"\n"+Tn(e().element())+" is not in context.")}};return{debugInfo:U("fake"),triggerEvent:t("triggerEvent"),triggerFocus:t("triggerFocus"),triggerEscape:t("triggerEscape"),build:t("build"),addToWorld:t("addToWorld"),removeFromWorld:t("removeFromWorld"),addToGui:t("addToGui"),removeFromGui:t("removeFromGui"),getByUid:t("getByUid"),getByDom:t("getByDom"),broadcast:t("broadcast"),broadcastOn:t("broadcastOn"),broadcastEvent:t("broadcastEvent"),isConnected:U(!1)}},ci=ui(),si=function(t){return E(t,function(t){return o=e="/*",r=(n=t).length-e.length,""!==o&&(n.length<o.length||n.substr(r,r+o.length)!==o)?t:t.substring(0,t.length-"/*".length);var e,n,o,r})},li=function(t,e){var n=t.toString(),o=n.indexOf(")")+1,r=n.indexOf("("),i=n.substring(r+1,o-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:si(i)}},t},fi=jn("alloy-premade"),di=function(t){return wt(fi,t)},mi=function(o){return t=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return o.apply(undefined,[t.getApis()].concat([t].concat(e)))},e=o.toString(),n=e.indexOf(")")+1,r=e.indexOf("("),i=e.substring(r+1,n-1).split(/,\s*/),t.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:si(i.slice(1))}},t;var t,e,n,r,i},hi={init:function(){return gi({readState:function(){return"No State required"}})}},gi=function(t){return t},vi=function(t,r){var i={};return tt(t,function(t,o){tt(t,function(t,e){var n=yt(e,[])(i);i[e]=n.concat([r(o,t)])})}),i},pi=function(t){return{classes:t.classes!==undefined?t.classes:[],attributes:t.attributes!==undefined?t.attributes:{},styles:t.styles!==undefined?t.styles:{}}},bi=function(t,e){return n=f.apply(undefined,[t.handler].concat(e)),o=t.purpose(),{cHandler:n,purpose:U(o)};var n,o},yi=function(t){return t.cHandler},xi=function(t,e){return{name:U(t),handler:U(e)}},wi=function(t,e,n){var o,r,i=Wn({},n,(o=t,r={},T(e,function(t){r[t.name()]=t.handlers(o)}),r));return vi(i,xi)},ki=function(t){var e,i=z(e=t)?{can:U(!0),abort:U(!1),run:e}:e;return function(t,e){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];var r=[t,e].concat(n);i.abort.apply(undefined,r)?e.stop():i.can.apply(undefined,r)&&i.run.apply(undefined,r)}},zi=function(t,e,n){var o,r,i=e[n];return i?function(a,u,t,c){var e=t.slice(0);try{var n=e.sort(function(t,e){var n=t[u](),o=e[u](),r=c.indexOf(n),i=c.indexOf(o);if(-1===r)throw new Error("The ordering for "+a+" does not have an entry for "+n+".\nOrder specified: "+yo(c,null,2));if(-1===i)throw new Error("The ordering for "+a+" does not have an entry for "+o+".\nOrder specified: "+yo(c,null,2));return r<i?-1:i<r?1:0});return ft.value(n)}catch(o){return ft.error([o])}}("Event: "+n,"name",t,i).map(function(t){var e=E(t,function(t){return t.handler()});return pr(e)}):(o=n,r=t,ft.error(["The event ("+o+') has more than one behaviour that listens to it.\nWhen this occurs, you must specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).\nThe behaviours that can trigger it are: '+yo(E(r,function(t){return t.name()}),null,2)]))},Si=function(t,i){var e=ot(t,function(o,r){return(1===o.length?ft.value(o[0].handler()):zi(o,i,r)).map(function(t){var e=ki(t),n=1<o.length?A(i,function(e){return M(o,function(t){return t.name()===e})}).join(" > "):o[0].name();return wt(r,{handler:e,purpose:U(n)})})});return zt(e,{})},Ci=function(t){return No("custom.definition",Ho([Do("dom","dom",Jn(),Ho([$o("tag"),cr("styles",{}),cr("classes",[]),cr("attributes",{}),rr("value"),rr("innerHtml")])),$o("components"),$o("uid"),cr("events",{}),cr("apis",{}),Do("eventOrder","eventOrder",(e={"alloy.execute":["disabling","alloy.base.behaviour","toggling","typeaheadevents"],"alloy.focus":["alloy.base.behaviour","focusing","keying"],"alloy.system.init":["alloy.base.behaviour","disabling","toggling","representing"],input:["alloy.base.behaviour","representing","streaming","invalidating"],"alloy.system.detached":["alloy.base.behaviour","representing"],mousedown:["focusing","alloy.base.behaviour","item-type-events"]},qn.mergeWithThunk(U(e))),Go()),rr("domModification")]),t);var e},Oi=function(t,e){var n=On(t,e);return n===undefined||""===n?[]:n.split(" ")},Mi=function(t){return t.dom().classList!==undefined},Hi=function(t){return Oi(t,"class")},Vi=function(t,e){return r=e,i=Oi(n=t,o="class").concat([r]),Sn(n,o,i.join(" ")),!0;var n,o,r,i},Ei=function(t,e){return r=e,0<(i=A(Oi(n=t,o="class"),function(t){return t!==r})).length?Sn(n,o,i.join(" ")):Hn(n,o),!1;var n,o,r,i},Ti=function(t,e){Mi(t)?t.dom().classList.add(e):Vi(t,e)},Ai=function(t,e){var n;Mi(t)?t.dom().classList.remove(e):Ei(t,e),0===(Mi(n=t)?n.dom().classList:Hi(n)).length&&Hn(n,"class")},Bi=function(t,e){return Mi(t)?t.dom().classList.toggle(e):(o=e,M(Hi(n=t),o)?Ei(n,o):Vi(n,o));var n,o},Di=function(t,e){return Mi(t)&&t.dom().classList.contains(e)},_i=function(e,t){T(t,function(t){Ti(e,t)})},Fi=function(e,t){T(t,function(t){Ai(e,t)})},Ri=function(t){return t.style!==undefined},Li=function(t,e,n){if(!x(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);Ri(t)&&t.style.setProperty(e,n)},Ii=function(t,e){Ri(t)&&t.style.removeProperty(e)},Ni=function(t,e,n){var o=t.dom();Li(o,e,n)},Pi=function(t,e){var n=t.dom();tt(e,function(t,e){Li(n,e,t)})},ji=function(t,e){var n=t.dom(),o=window.getComputedStyle(n).getPropertyValue(e),r=""!==o||Sr(t)?o:Ui(n,e);return null===r?undefined:r},Ui=function(t,e){return Ri(t)?t.style.getPropertyValue(e):""},Wi=function(t,e){var n=t.dom(),o=Ui(n,e);return P.from(o).filter(function(t){return 0<t.length})},Gi=function(t,e){var n=t.dom();Ii(n,e),Mn(t,"style")&&""===On(t,"style").replace(/^\s+|\s+$/g,"")&&Hn(t,"style")},Xi=function(t){return t.dom().offsetWidth},Yi=function(t){return t.dom().value},qi=function(t,e){if(e===undefined)throw new Error("Value.set was undefined");t.dom().value=e},Ki=function(t,e){return n=t,r=E(o=e,function(t){return ur(t.name(),[$o("config"),cr("state",hi)])}),i=No("component.behaviours",Ho(r),n.behaviours).fold(function(t){throw new Error(Uo(t)+"\nComplete spec:\n"+yo(n,null,2))},function(t){return t}),{list:o,data:et(i,function(t){var e=t.map(function(t){return{config:t.config,state:t.state.init(t.config)}});return function(){return e}})};var n,o,r,i},Ji=function(t){var e,n,o,r=(e=t,n=yt("behaviours",{})(e),o=A(Q(n),function(t){return n[t]!==undefined}),E(o,function(t){return n[t].me}));return Ki(t,r)},$i=function(t,e,n){var o,r,i,a=Wn({},(o=t).dom,{uid:o.uid,domChildren:E(o.components,function(t){return t.element()})}),u=t.domModification.fold(function(){return pi({})},pi),c={"alloy.base.modification":u},s=0<e.length?function(e,t,n,o){var r=Wn({},t);T(n,function(t){r[t.name()]=t.exhibit(e,o)});var i=vi(r,function(t,e){return{name:t,modification:e}}),a=function(t){return B(t,function(t,e){return Wn({},e.modification,t)},{})},u=B(i.classes,function(t,e){return e.modification.concat(t)},[]),c=a(i.attributes),s=a(i.styles);return pi({classes:u,attributes:c,styles:s})}(n,c,e,a):u;return i=s,Wn({},r=a,{attributes:Wn({},r.attributes,i.attributes),styles:Wn({},r.styles,i.styles),classes:r.classes.concat(i.classes)})},Qi=function(t,e,n){var o,r,i,a,u,c,s={"alloy.base.behaviour":(o=t,o.events)};return(r=n,i=t.eventOrder,a=e,u=s,c=wi(r,a,u),Si(c,i)).getOrDie()},Zi=function(n){var t=function(){return l},o=Ct(ci),e=Po(Ci(n)),r=Ji(n),i=r.list,a=r.data,u=function(t){var e=Ne.fromTag(t.tag);Cn(e,t.attributes),_i(e,t.classes),Pi(e,t.styles),t.innerHtml.each(function(t){return pn(e,t)});var n=t.domChildren;return mn(e,n),t.value.each(function(t){qi(e,t)}),t.uid,oi(e,t.uid),e}($i(e,i,a)),c=Qi(e,i,a),s=Ct(e.components),l={getSystem:o.get,config:function(t){var e=a;return(z(e[t.name()])?e[t.name()]:function(){throw new Error("Could not find "+t.name()+" in "+yo(n,null,2))})()},hasConfigured:function(t){return z(a[t.name()])},spec:U(n),readState:function(t){return a[t]().map(function(t){return t.state.readState()}).getOr("not enabled")},getApis:function(){return e.apis},connect:function(t){o.set(t)},disconnect:function(){o.set(ui(t))},element:U(u),syncComponents:function(){var t=un(u),e=j(t,function(t){return o.get().getByDom(t).fold(function(){return[]},function(t){return[t]})});s.set(e)},components:s.get,events:U(c)};return l},ta=function(t){var e,n,o=ai(t),r=o.events,i=Gn(o,["events"]),a=(e=i,n=yt("components",[])(e),E(n,ra)),u=Wn({},i,{events:Wn({},Qr,r),components:a});return ft.value(Zi(u))},ea=function(t){var e=Ne.fromText(t);return na({element:e})},na=function(t){var e=jo("external.component",Mo([$o("element"),rr("uid")]),t),n=Ct(ui());e.uid.each(function(t){oi(e.element,t)});var o={getSystem:n.get,config:P.none,hasConfigured:U(!1),connect:function(t){n.set(t)},disconnect:function(){n.set(ui(function(){return o}))},getApis:function(){return{}},element:U(e.element),spec:U(t),readState:U("No state"),syncComponents:N,components:U([]),events:U({})};return di(o)},oa=(Tr=0,function(t){return t+"_"+ ++Tr}),ra=function(e){return(t=e,xt(t,fi)).fold(function(){var t=e.hasOwnProperty("uid")?e:Wn({uid:oa("")},e);return ta(t).getOrDie()},function(t){return t});var t},ia=di,aa=function(t,e,n){return Ar(t,function(t){return Ze(t,e)},n)},ua=function(t,e){return n=e,r=(o=t)===undefined?document:o.dom(),tn(r)?P.none():P.from(r.querySelector(n)).map(Ne.fromDom);var n,o,r},ca=function(t,e,n){return Mr(Ze,aa,t,e,n)},sa=function(e,t){return(n=t,Br(n,function(t){if(!xn(t))return!1;var e=On(t,"id");return e!==undefined&&-1<e.indexOf("aria-owns")}).bind(function(t){var e=On(t,"id"),n=nn(t);return ua(n,'[aria-owns="'+e+'"]')})).exists(function(t){return la(e,t)});var n},la=function(e,t){return n=t,r=U(!(o=function(t){return en(t,e.element())})),Br(n,o,r).isSome()||sa(e,t);var n,o,r},fa=U([$o("menu"),$o("selectedMenu")]),da=U([$o("item"),$o("selectedItem")]),ma=(U(Ho(da().concat(fa()))),U(Ho(da()))),ha=er("initSize",[$o("numColumns"),$o("numRows")]),ga=function(){return er("markers",[$o("backgroundMenu")].concat(fa()).concat(da()))},va=function(t){return er("markers",E(t,$o))},pa=function(t,e,n){return function(){var t=new Error;if(t.stack!==undefined){var e=t.stack.split("\n");_(e,function(e){return 0<e.indexOf("alloy")&&!H(Fn,function(t){return-1<e.indexOf(t)})}).getOr(An)}}(),Do(e,e,n,Lo(function(n){return ft.value(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n.apply(undefined,t)})}))},ba=function(t){return pa(0,t,Kn(N))},ya=function(t){return pa(0,t,Kn(P.none))},xa=function(t){return pa(0,t,Jn())},wa=function(t){return pa(0,t,Jn())},ka=function(t,e){return gr(t,U(e))},za=function(t){return gr(t,d)},Sa=U(ha),Ca=function(n,o,r){return Kr(function(t,e){r(t,n,o)})},Oa=function(t,e,n,o,r,i){var a,u,c=Mo(t),s=ur(e,[(a="config",u=t,Do(a,a,$n(),Mo(u)))]);return Va(c,s,e,n,o,r,i)},Ma=function(r,i,a){var t,e,n,o,u,c;return t=function(n){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];var o=[n].concat(t);return n.config({name:U(r)}).fold(function(){throw new Error("We could not find any behaviour configuration for: "+r+". Using API: "+a)},function(t){var e=Array.prototype.slice.call(o,1);return i.apply(undefined,[n,t.config,t.state].concat(e))})},e=a,n=i.toString(),o=n.indexOf(")")+1,u=n.indexOf("("),c=n.substring(u+1,o-1).split(/,\s*/),t.toFunctionAnnotation=function(){return{name:e,parameters:si(c.slice(0,1).concat(c.slice(3)))}},t},Ha=function(t){return{key:t,value:undefined}},Va=function(n,t,o,r,e,i,a){var u=function(t){return St(t,o)?t[o]():P.none()},c=et(e,function(t,e){return Ma(o,t,e)}),s=et(i,function(t,e){return li(t,e)}),l=Wn({},s,c,{revoke:f(Ha,o),config:function(t){var e=jo(o+"-config",n,t);return{key:o,value:{config:e,me:l,configAsRaw:Xt(function(){return jo(o+"-config",n,t)}),initialConfig:t,state:a}}},schema:function(){return t},exhibit:function(t,n){return u(t).bind(function(e){return xt(r,"exhibit").map(function(t){return t(n,e.config,e.state)})}).getOr(pi({}))},name:function(){return o},handlers:function(t){return u(t).map(function(t){return yt("events",function(t,e){return{}})(r)(t.config,t.state)}).getOr({})}});return l},Ea=function(t){return kt(t)},Ta=Mo([$o("fields"),$o("name"),cr("active",{}),cr("apis",{}),cr("state",hi),cr("extra",{})]),Aa=function(t){var e=jo("Creating behaviour: "+t.name,Ta,t);return Oa(e.fields,e.name,e.active,e.apis,e.extra,e.state)},Ba=Mo([$o("branchKey"),$o("branches"),$o("name"),cr("active",{}),cr("apis",{}),cr("state",hi),cr("extra",{})]),Da=function(t){var e,n,o,r,i,a,u,c,s=jo("Creating behaviour: "+t.name,Ba,t);return e=Wo(s.branchKey,s.branches),n=s.name,o=s.active,r=s.apis,i=s.extra,a=s.state,c=ur(n,[ir("config",u=e)]),Va(u,c,n,o,r,i,a)},_a=U(undefined),Fa=Object.freeze({events:function(u){return Fr([Ir(ke(),function(r,i){var t,e,a=u.channels,n=Q(a),o=(t=n,(e=i).universal()?t:A(t,function(t){return M(e.channels(),t)}));T(o,function(t){var e=a[t],n=e.schema,o=jo("channel["+t+"] data\nReceiver: "+Tn(r.element()),n,i.data());e.onReceive(r,o)})})])}}),Ra=[Qo("channels",Io(ft.value,Mo([xa("onReceive"),cr("schema",Go())])))],La=Aa({fields:Ra,name:"receiving",active:Fa}),Ia=Object.freeze({exhibit:function(t,e){return pi({classes:[],styles:e.useFixed?{}:{position:"relative"}})}}),Na=function(n,o){return{left:U(n),top:U(o),translate:function(t,e){return Na(n+t,o+e)}}},Pa=Na,ja=function(t,e){return t!==undefined?t:e!==undefined?e:0},Ua=function(t){var e,n,o=t.dom().ownerDocument,r=o.body,i=(e=Ne.fromDom(o),(n=e.dom())===n.window&&e instanceof Window?e:kn(e)?n.defaultView||n.parentWindow:null),a=o.documentElement,u=ja(i.pageYOffset,a.scrollTop),c=ja(i.pageXOffset,a.scrollLeft),s=ja(a.clientTop,r.clientTop),l=ja(a.clientLeft,r.clientLeft);return Wa(t).translate(c-l,u-s)},Wa=function(t){var e,n,o,r=t.dom(),i=r.ownerDocument,a=i.body,u=Ne.fromDom(i.documentElement);return a===r?Pa(a.offsetLeft,a.offsetTop):(e=t,n=u||Ne.fromDom(document.documentElement),Ar(e,f(en,n)).isSome()?(o=r.getBoundingClientRect(),Pa(o.left,o.top)):Pa(0,0))},Ga=(be.detect().browser.isSafari(),function(t){var e=t!==undefined?t.dom():document,n=e.body.scrollLeft||e.documentElement.scrollLeft,o=e.body.scrollTop||e.documentElement.scrollTop;return Pa(n,o)});function Xa(o,r){var t=function(t){var e=r(t);if(e<=0||null===e){var n=ji(t,o);return parseFloat(n)||0}return e},i=function(r,t){return D(t,function(t,e){var n=ji(r,e),o=n===undefined?0:parseInt(n,10);return isNaN(o)?t:t+o},0)};return{set:function(t,e){if(!S(e)&&!e.match(/^[0-9]+$/))throw o+".set accepts only positive integer values. Value was "+e;var n=t.dom();Ri(n)&&(n.style[o]=e+"px")},get:t,getOuter:t,aggregate:i,max:function(t,e,n){var o=i(t,n);return o<e?e-o:0}}}var Ya=Xa("width",function(t){return t.dom().offsetWidth}),qa=function(t){return Ya.get(t)},Ka=function(t){return Ya.getOuter(t)},Ja=Xa("height",function(t){var e=t.dom();return Sr(t)?e.getBoundingClientRect().height:e.offsetHeight}),$a=function(t){return Ja.get(t)},Qa=function(t){return Ja.getOuter(t)},Za=We(["x","y","width","height","maxHeight","direction","classes","label","candidateYforTest"],[]),tu=Pe("position","left","top","right","bottom"),eu=dt([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),nu=eu.southeast,ou=eu.southwest,ru=eu.northeast,iu=eu.northwest,au=eu.south,uu=eu.north,cu=eu.east,su=eu.west,lu=Pe("point","width","height"),fu=Pe("x","y","width","height"),du=function(t,e,n,o){return{x:U(t),y:U(e),width:U(n),height:U(o),right:U(t+n),bottom:U(e+o)}},mu=function(t){var e=Ua(t),n=Ka(t),o=Qa(t);return du(e.left(),e.top(),n,o)},hu=function(o,t){return o.view(t).fold(U([]),function(t){var e=o.owner(t),n=hu(o,e);return[t].concat(n)})},gu=Object.freeze({view:function(t){return(t.dom()===document?P.none():P.from(t.dom().defaultView.frameElement)).map(Ne.fromDom)},owner:function(t){return nn(t)}}),vu=function(o){var t,e,n,r,i=Ne.fromDom(document),a=Ga(i);return(t=o,n=(e=gu).owner(t),r=hu(e,n),P.some(r)).fold(f(Ua,o),function(t){var e=Wa(o),n=B(t,function(t,e){var n=Wa(e);return{left:t.left+n.left(),top:t.top+n.top()}},{left:0,top:0});return Pa(n.left+e.left()+a.left(),n.top+e.top()+a.top())})},pu=function(){var t=window.innerWidth,e=window.innerHeight,n=Ne.fromDom(document),o=Ga(n);return du(o.left(),o.top(),t,e)},bu=dt([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),yu=function(t,e,n,o,r,i){var a,u,c,s,l,f,d,m,h,g=e.x()-n,v=e.y()-o,p=r-(g+e.width()),b=i-(v+e.height()),y=P.some(g),x=P.some(v),w=P.some(p),k=P.some(b),z=P.none();return a=e.direction(),u=function(){return tu(t,y,x,z,z)},c=function(){return tu(t,z,x,w,z)},s=function(){return tu(t,y,z,z,k)},l=function(){return tu(t,z,z,w,k)},f=function(){return tu(t,y,x,z,z)},d=function(){return tu(t,y,z,z,k)},m=function(){return tu(t,y,x,z,z)},h=function(){return tu(t,z,x,w,z)},a.fold(u,c,s,l,f,d,m,h)},xu=function(t,e){var n=f(vu,e),o=t.fold(n,n,function(){var t=Ga();return vu(e).translate(-t.left(),-t.top())}),r=Ka(e),i=Qa(e);return du(o.left(),o.top(),r,i)},wu=bu.relative,ku=bu.fixed,zu=Pe("anchorBox","origin"),Su=dt([{fit:["reposition"]},{nofit:["reposition","deltaW","deltaH"]}]),Cu=function(t,R,L,I,N){var P=L.width(),j=L.height(),o=function(t,o,r,i){var e,n,a,u,c,s,l,f,d,m,h,g,v,p,b,y,x,w,k,z,S,C,O,M,H,V,E,T,A,B,D,_,F=t(R,L,I);return(n=P,a=j,u=N,d=(e=F).x(),m=e.y(),h=e.bubble().offset().left(),g=e.bubble().offset().top(),v=u.x(),p=u.y(),b=u.width(),y=u.height(),z=p<=(w=m+g),S=(k=v<=(x=d+h))&&z,C=x+n<=v+b&&w+a<=p+y,O=k?Math.min(n,v+b-x):Math.abs(v-(x+n)),M=z?Math.min(a,p+y-w):Math.abs(p-(w+a)),H=u.width()-n,V=Math.max(0,x),E=Math.min(V,H),A=U((T=z?w:w+(a-M))+M-p),B=U(p+y-T),c=e.direction(),l=s=B,f=A,D=c.fold(s,s,f,f,s,f,l,l),_=Za({x:E,y:T,width:O,height:M,maxHeight:D,direction:e.direction(),classes:{on:e.bubble().classesOn(),off:e.bubble().classesOff()},label:e.label(),candidateYforTest:w}),S&&C?Su.fit(_):Su.nofit(_,O,M)).fold(Su.fit,function(t,e,n){return i<n||r<e?Su.nofit(t,e,n):Su.nofit(o,r,i)})};return D(t,function(t,e){var n=f(o,e);return t.fold(Su.fit,n)},Su.nofit(Za({x:R.x(),y:R.y(),width:L.width(),height:L.height(),maxHeight:L.height(),direction:nu(),classes:[],label:"none",candidateYforTest:R.y()}),-1,-1)).fold(d,d)},Ou=function(t,e,n,o){Gi(e,"max-height");var r,i={width:U(Ka(r=e)),height:U(Qa(r))};return Cu(o.preference(),t,i,n,o.bounds())},Mu=function(t,e,n){var o,r,i,a,u,c=function(t){return t+"px"},s=(o=n.origin(),r=e,o.fold(function(){return tu("absolute",P.some(r.x()),P.some(r.y()),P.none(),P.none())},function(t,e,n,o){return yu("absolute",r,t,e,n,o)},function(t,e,n,o){return yu("fixed",r,t,e,n,o)}));i=t,a={position:P.some(s.position()),left:s.left().map(c),top:s.top().map(c),right:s.right().map(c),bottom:s.bottom().map(c)},u=i.dom(),tt(a,function(t,e){t.fold(function(){Ii(u,e)},function(t){Li(u,e,t)})})},Hu=function(t,e){var n,o,r;n=t,o=Math.floor(e),r=Ja.max(n,o,["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"]),Ni(n,"max-height",r+"px")},Vu=U(function(t,e){Hu(t,e),Pi(t,{"overflow-x":"hidden","overflow-y":"auto"})}),Eu=U(function(t,e){Hu(t,e)}),Tu=We(["bounds","origin","preference","maxHeightFunction"],[]),Au=function(t,e,n,o,r,i){var a,u,c,s,l,f=(a=i,u="maxHeightFunction",c=Vu(),a[u]===undefined?c:a[u]),d=t.anchorBox(),m=t.origin(),h=Tu({bounds:(s=m,l=r,l.fold(function(){return s.fold(pu,pu,du)},function(t){return s.fold(t,t,du)})),origin:m,preference:o,maxHeightFunction:f});Bu(d,e,n,h)},Bu=function(t,e,n,o){var r,i,a,u,c=Ou(t,e,n,o);Mu(e,c,o),r=e,i=c.classes(),Fi(r,i.off),_i(r,i.on),a=e,u=c,o.maxHeightFunction()(a,u.maxHeight())},Du=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right"],_u=function(t,e,n){var r=function(t){return xt(n,t).getOr([])},o=function(t,e,n){var o=Y(Du,n);return{offset:function(){return Pa(t,e)},classesOn:function(){return j(n,r)},classesOff:function(){return j(o,r)}}};return{southeast:function(){return o(-t,e,["top","alignLeft"])},southwest:function(){return o(t,e,["top","alignRight"])},south:function(){return o(-t/2,e,["top","alignCentre"])},northeast:function(){return o(-t,-e,["bottom","alignLeft"])},northwest:function(){return o(t,-e,["bottom","alignRight"])},north:function(){return o(-t/2,-e,["bottom","alignCentre"])},east:function(){return o(t,-e/2,["valignCentre","left"])},west:function(){return o(-t,-e/2,["valignCentre","right"])}}},Fu=function(){return _u(0,0,{})},Ru=Pe("x","y","bubble","direction","label"),Lu=function(t){return t.x()},Iu=function(t,e){return t.x()+t.width()/2-e.width()/2},Nu=function(t,e){return t.x()+t.width()-e.width()},Pu=function(t,e){return t.y()-e.height()},ju=function(t){return t.y()+t.height()},Uu=function(t,e){return t.y()+t.height()/2-e.height()/2},Wu=function(t,e,n){return Ru(Lu(t),ju(t),n.southeast(),nu(),"layout-se")},Gu=function(t,e,n){return Ru(Nu(t,e),ju(t),n.southwest(),ou(),"layout-sw")},Xu=function(t,e,n){return Ru(Lu(t),Pu(t,e),n.northeast(),ru(),"layout-ne")},Yu=function(t,e,n){return Ru(Nu(t,e),Pu(t,e),n.northwest(),iu(),"layout-nw")},qu=function(t,e,n){return Ru(Iu(t,e),Pu(t,e),n.north(),uu(),"layout-n")},Ku=function(t,e,n){return Ru(Iu(t,e),ju(t),n.south(),au(),"layout-s")},Ju=function(t,e,n){return Ru((o=t).x()+o.width(),Uu(t,e),n.east(),cu(),"layout-e");var o},$u=function(t,e,n){return Ru((o=e,t.x()-o.width()),Uu(t,e),n.west(),su(),"layout-w");var o},Qu=function(){return[Wu,Gu,Xu,Yu,Ku,qu,Ju,$u]},Zu=function(){return[Gu,Wu,Yu,Xu,Ku,qu,Ju,$u]},tc=function(t){return t},ec=function(e,n){return function(t){return"rtl"===nc(t)?n:e}},nc=function(t){return"rtl"===ji(t,"direction")?"rtl":"ltr"},oc=function(){return ur("layouts",[$o("onLtr"),$o("onRtl")])},rc=function(e,t,n,o){var r=t.layouts.map(function(t){return t.onLtr(e)}).getOr(n),i=t.layouts.map(function(t){return t.onRtl(e)}).getOr(o);return ec(r,i)(e)},ic=[$o("hotspot"),oc(),ka("placement",function(t,e,n){var o=e.hotspot,r=xu(n,o.element()),i=rc(t.element(),e,Qu(),Zu());return P.some(tc({anchorBox:r,bubble:Fu(),overrides:{},layouts:i,placer:P.none()}))})],ac=[$o("x"),$o("y"),cr("height",0),cr("width",0),cr("bubble",Fu()),oc(),ka("placement",function(t,e,n){var o=du(e.x,e.y,e.width,e.height),r=rc(t.element(),e,Qu(),Zu());return P.some(tc({anchorBox:o,bubble:e.bubble,overrides:{},layouts:r,placer:P.none()}))})],uc=(dt([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),dt([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}])),cc=Pe("start","soffset","finish","foffset"),sc=uc.exact,lc=function(t,e,n,o){var r,i,a,u,c,s=(i=e,a=n,u=o,(c=nn(r=t).dom().createRange()).setStart(r.dom(),i),c.setEnd(a.dom(),u),c),l=en(t,n)&&e===o;return s.collapsed&&!l},fc=function(t,e,n){var o,r,i=t.document.createRange();return o=i,e.fold(function(t){o.setStartBefore(t.dom())},function(t,e){o.setStart(t.dom(),e)},function(t){o.setStartAfter(t.dom())}),r=i,n.fold(function(t){r.setEndBefore(t.dom())},function(t,e){r.setEnd(t.dom(),e)},function(t){r.setEndAfter(t.dom())}),i},dc=function(t,e,n,o,r){var i=t.document.createRange();return i.setStart(e.dom(),n),i.setEnd(o.dom(),r),i},mc=function(t){return{left:U(t.left),top:U(t.top),right:U(t.right),bottom:U(t.bottom),width:U(t.width),height:U(t.height)}},hc=dt([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),gc=function(t,e,n){return e(Ne.fromDom(n.startContainer),n.startOffset,Ne.fromDom(n.endContainer),n.endOffset)},vc=function(t,e){var r,n,o,i=(r=t,e.match({domRange:function(t){return{ltr:U(t),rtl:P.none}},relative:function(t,e){return{ltr:Xt(function(){return fc(r,t,e)}),rtl:Xt(function(){return P.some(fc(r,e,t))})}},exact:function(t,e,n,o){return{ltr:Xt(function(){return dc(r,t,e,n,o)}),rtl:Xt(function(){return P.some(dc(r,n,o,t,e))})}}}));return(o=(n=i).ltr()).collapsed?n.rtl().filter(function(t){return!1===t.collapsed}).map(function(t){return hc.rtl(Ne.fromDom(t.endContainer),t.endOffset,Ne.fromDom(t.startContainer),t.startOffset)}).getOrThunk(function(){return gc(0,hc.ltr,o)}):gc(0,hc.ltr,o)},pc=function EH(n,o){var r=function(t){return n(t)?P.from(t.dom().nodeValue):P.none()},t=be.detect().browser,e=t.isIE()&&10===t.version.major?function(t){try{return r(t)}catch(e){return P.none()}}:r;return{get:function(t){if(!n(t))throw new Error("Can only get "+o+" value of a "+o+" node");return e(t).getOr("")},getOption:e,set:function(t,e){if(!n(t))throw new Error("Can only set raw "+o+" value of a "+o+" node");t.dom().nodeValue=e}}}(wn,"text"),bc=function(t){return pc.get(t)},yc=(document.caretPositionFromPoint||document.caretRangeFromPoint,function(t,e){return n=e,r=(o=t)===undefined?document:o.dom(),tn(r)?[]:E(r.querySelectorAll(n),Ne.fromDom);var n,o,r}),xc=function(t){var e=Ne.fromDom(t.anchorNode),n=Ne.fromDom(t.focusNode);return lc(e,t.anchorOffset,n,t.focusOffset)?P.some(cc(Ne.fromDom(t.anchorNode),t.anchorOffset,Ne.fromDom(t.focusNode),t.focusOffset)):function(t){if(0<t.rangeCount){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return P.some(cc(Ne.fromDom(e.startContainer),e.startOffset,Ne.fromDom(n.endContainer),n.endOffset))}return P.none()}(t)},wc=function(t,e){var i,n,o,r,a=vc(i=t,e).match({ltr:function(t,e,n,o){var r=i.document.createRange();return r.setStart(t.dom(),e),r.setEnd(n.dom(),o),r},rtl:function(t,e,n,o){var r=i.document.createRange();return r.setStart(n.dom(),o),r.setEnd(t.dom(),e),r}});return o=(n=a).getClientRects(),0<(r=0<o.length?o[0]:n.getBoundingClientRect()).width||0<r.height?P.some(r).map(mc):P.none()},kc=Pe("element","offset"),zc=dt([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),Sc=function(t){return t.fold(function(t){return t},function(t,e,n){return t.translate(-e,-n)})},Cc=function(t){return t.fold(function(t){return t},function(t,e,n){return t})},Oc=function(t){return D(t,function(t,e){return t.translate(e.left(),e.top())},Pa(0,0))},Mc=function(t){var e=E(t,Cc);return Oc(e)},Hc=zc.screen,Vc=zc.absolute,Ec=function(t,e,n){var o,r,i,a=nn(t.element()),u=Ga(a),c=(o=t,r=n,i=on(r.root).dom(),P.from(i.frameElement).map(Ne.fromDom).filter(function(t){var e=nn(t),n=nn(o.element());return en(e,n)}).map(Ua)).getOr(u);return Vc(c,u.left(),u.top())},Tc=function(t,e,n,o){var r=t,i=e,a=n,u=o;t<0&&(r=0,a=n+t),e<0&&(i=0,u=o+e);var c=Hc(Pa(r,i));return P.some(lu(c,a,u))},Ac=function(t,c,s,l,f){return t.map(function(t){var e,n,o,r=[c,t.point()],i=(e=function(){return Mc(r)},n=function(){return Mc(r)},o=function(){return t=E(r,Sc),Oc(t);var t},l.fold(e,n,o)),a=fu(i.left(),i.top(),t.width(),t.height()),u=rc(f,s,s.showAbove?[Xu,Yu,Wu,Gu,qu,Ku]:[Wu,Gu,Xu,Yu,Ku,Ku],s.showAbove?[Yu,Xu,Gu,Wu,qu,Ku]:[Gu,Wu,Yu,Xu,Ku,qu]);return tc({anchorBox:a,bubble:s.bubble.getOr(Fu()),overrides:s.overrides,layouts:u,placer:P.none()})})},Bc=Pe("element","offset"),Dc=function(t,e){return wn(t)?Bc(t,e):function(t,e){var n=un(t);if(0===n.length)return kc(t,e);if(e<n.length)return kc(n[e],0);var o=n[n.length-1],r=wn(o)?bc(o).length:un(o).length;return kc(o,r)}(t,e)},_c=function(e,t){return t.getSelection.getOrThunk(function(){return function(){return t=e,P.from(t.getSelection()).filter(function(t){return 0<t.rangeCount}).bind(xc);var t}})().map(function(t){var e=Dc(t.start(),t.soffset()),n=Dc(t.finish(),t.foffset());return cc(e.element(),e.offset(),n.element(),n.offset())})},Fc=[rr("getSelection"),$o("root"),rr("bubble"),oc(),cr("overrides",{}),cr("showAbove",!1),ka("placement",function(t,e,n){var o=on(e.root).dom(),r=Ec(t,0,e),i=_c(o,e).bind(function(t){var e;return wc(o,(e=t,uc.exact(e.start(),e.soffset(),e.finish(),e.foffset()))).orThunk(function(){var e=Ne.fromText("\ufeff");return sn(t.start(),e),wc(o,sc(e,0,e,1)).map(function(t){return gn(e),t})}).bind(function(t){return Tc(t.left(),t.top(),t.width(),t.height())})}),a=_c(o,e).bind(function(t){return xn(t.start())?P.some(t.start()):rn(t.start())}).getOr(t.element());return Ac(i,r,e,n,a)})],Rc=[$o("node"),$o("root"),rr("bubble"),oc(),cr("overrides",{}),cr("showAbove",!1),ka("placement",function(r,i,a){var u=Ec(r,0,i);return i.node.bind(function(t){var e=t.dom().getBoundingClientRect(),n=Tc(e.left,e.top,e.width,e.height),o=i.node.getOr(r.element());return Ac(n,u,i,a,o)})})],Lc=function(t){return t.x()+t.width()},Ic=function(t,e){return t.x()-e.width()},Nc=function(t,e){return t.y()-e.height()+t.height()},Pc=function(t){return t.y()},jc=function(t,e,n){return Ru(Lc(t),Pc(t),n.southeast(),nu(),"link-layout-se")},Uc=function(t,e,n){return Ru(Ic(t,e),Pc(t),n.southwest(),ou(),"link-layout-sw")},Wc=function(t,e,n){return Ru(Lc(t),Nc(t,e),n.northeast(),ru(),"link-layout-ne")},Gc=function(t,e,n){return Ru(Ic(t,e),Nc(t,e),n.northwest(),iu(),"link-layout-nw")},Xc=[$o("item"),oc(),ka("placement",function(t,e,n){var o=xu(n,e.item.element()),r=rc(t.element(),e,[jc,Uc,Wc,Gc],[Uc,jc,Gc,Wc]);return P.some(tc({anchorBox:o,bubble:Fu(),overrides:{},layouts:r,placer:P.none()}))})],Yc=Wo("anchor",{selection:Fc,node:Rc,hotspot:ic,submenu:Xc,makeshift:ac}),qc=function(t,e,n,o,r){var i,a=(i=n.anchorBox,zu(i,e));Au(a,r.element(),n.bubble,n.layouts,o,n.overrides)},Kc=function(e,t,n,o,r,i){var a=jo("positioning anchor.info",Yc,o);Ni(r.element(),"position","fixed");var u=Wi(r.element(),"visibility");Ni(r.element(),"visibility","hidden");var c,s,l,f=t.useFixed?ku(0,0,window.innerWidth,window.innerHeight):(s=Ua((c=e).element()),l=c.element().dom().getBoundingClientRect(),wu(s.left(),s.top(),l.width,l.height)),d=a.placement,m=i.map(function(t){return function(){return mu(t)}}).or(t.getBounds);d(e,a,f).each(function(t){t.placer.getOr(qc)(e,f,t,m,r)}),u.fold(function(){Gi(r.element(),"visibility")},function(t){Ni(r.element(),"visibility",t)}),Wi(r.element(),"left").isNone()&&Wi(r.element(),"top").isNone()&&Wi(r.element(),"right").isNone()&&Wi(r.element(),"bottom").isNone()&&Wi(r.element(),"position").is("fixed")&&Gi(r.element(),"position")},Jc=Object.freeze({position:function(t,e,n,o,r){var i=P.none();Kc(t,e,n,o,r,i)},positionWithin:Kc,getMode:function(t,e,n){return e.useFixed?"fixed":"absolute"}}),$c=[cr("useFixed",!1),rr("getBounds")],Qc=Aa({fields:$c,name:"positioning",active:Ia,apis:Jc}),Zc=function(t){br(t,Be());var e=t.components();T(e,Zc)},ts=function(t){var e=t.components();T(e,ts),br(t,Ae())},es=function(t,e){ns(t,e,dn)},ns=function(t,e,n){t.getSystem().addToWorld(e),n(t.element(),e.element()),Sr(t.element())&&ts(e),t.syncComponents()},os=function(t){Zc(t),gn(t.element()),t.getSystem().removeFromWorld(t)},rs=function(e){var t=rn(e.element()).bind(function(t){return e.getSystem().getByDom(t).fold(P.none,P.some)});os(e),t.each(function(t){t.syncComponents()})},is=function(t){var e=t.components();T(e,os),hn(t.element()),t.syncComponents()},as=function(t,e){us(t,e,dn)},us=function(t,e,n){n(t,e.element());var o=un(e.element());T(o,function(t){e.getByDom(t).each(ts)})},cs=function(e){var t=un(e.element());T(t,function(t){e.getByDom(t).each(Zc)}),gn(e.element())},ss=function(t,e,n,o){var r=function(e,t,n,o){n.get().each(function(t){is(e)});var r=t.getAttachPoint(e);es(r,e);var i=e.getSystem().build(o);return es(e,i),n.set(i),i}(t,e,n,o);return e.onOpen(t,r),r},ls=function(e,n,o){o.get().each(function(t){is(e),rs(e),n.onClose(e,t),o.clear()})},fs=function(t,e,n){return n.isOpen()},ds=function(t,e,n){var o,r,i,a,u=e.getAttachPoint(t);Ni(t.element(),"position",Qc.getMode(u)),o=t,r="visibility",i=e.cloakVisibilityAttr,a="hidden",Wi(o.element(),r).fold(function(){Hn(o.element(),i)},function(t){Sn(o.element(),i,t)}),Ni(o.element(),r,a)},ms=function(t,e,n){var o;o=t.element(),H(["top","left","right","bottom"],function(t){return Wi(o,t).isSome()})||Gi(t.element(),"position"),function(t,e,n){if(Mn(t.element(),n)){var o=On(t.element(),n);Ni(t.element(),e,o)}else Gi(t.element(),e)}(t,"visibility",e.cloakVisibilityAttr)},hs=Object.freeze({cloak:ds,decloak:ms,open:ss,openWhileCloaked:function(t,e,n,o,r){ds(t,e,n),ss(t,e,n,o),r(),ms(t,e,n)},close:ls,isOpen:fs,isPartOf:function(e,n,t,o){return fs(0,0,t)&&t.get().exists(function(t){return n.isPartOf(e,t,o)})},getState:function(t,e,n){return n.get()}}),gs=Object.freeze({events:function(n,o){return Fr([Ir(He(),function(t,e){ls(t,n,o)})])}}),vs=[ba("onOpen"),ba("onClose"),$o("isPartOf"),$o("getAttachPoint"),cr("cloakVisibilityAttr","data-precloak-visibility")],ps=Aa({fields:vs,name:"sandboxing",active:gs,apis:hs,state:Object.freeze({init:function(){var e=Ct(P.none()),t=U("not-implemented");return gi({readState:t,isOpen:function(){return e.get().isSome()},clear:function(){e.set(P.none())},set:function(t){e.set(P.some(t))},get:function(t){return e.get()}})}})}),bs=U("dismiss.popups"),ys=U("mouse.released"),xs=Mo([cr("isExtraPart",U(!1)),ur("fireEventInstead",[cr("event",De())])]),ws=function(t){var e=ks(t);return La.config(e)},ks=function(t){var n=jo("Dismissal",xs,t);return{channels:wt(bs(),{schema:Mo([$o("target")]),onReceive:function(e,t){ps.isOpen(e)&&(ps.isPartOf(e,t.target)||n.isExtraPart(e,t.target)||n.fireEventInstead.fold(function(){return ps.close(e)},function(t){return br(e,t.event)}))}})}},zs=function(o,t){return hr(o,{},E(t,function(t){return e=t.name(),n="Cannot configure "+t.name()+" for "+o,Do(e,e,$n(),Oo(function(t){return uo("The field: "+e+" is forbidden. "+n)}));var e,n}).concat([gr("dump",d)]))},Ss=function(t){return t.dump},Cs=function(t,e){return Wn({},t.dump,Ea(e))},Os=zs,Ms=Cs,Hs="placeholder",Vs=dt([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),Es=function(t,e,n,o){return n.uiType===Hs?(i=n,a=o,(r=t).exists(function(t){return t!==i.owner})?Vs.single(!0,U(i)):xt(a,i.name).fold(function(){throw new Error("Unknown placeholder component: "+i.name+"\nKnown: ["+Q(a)+"]\nNamespace: "+r.getOr("none")+"\nSpec: "+yo(i,null,2))},function(t){return t.replace()})):Vs.single(!1,U(n));var r,i,a},Ts=function(i,a,u,c){return Es(i,0,u,c).fold(function(t,e){var n=e(a,u.config,u.validated),o=xt(n,"components").getOr([]),r=j(o,function(t){return Ts(i,a,t,c)});return[Wn({},n,{components:r})]},function(t,e){var n=e(a,u.config,u.validated);return u.validated.preprocess.getOr(d)(n)})},As=function(e,n,t,o){var r,i,a,u=et(o,function(t,e){return o=t,r=!1,{name:U(n=e),required:function(){return o.fold(function(t,e){return t},function(t,e){return t})},used:function(){return r},replace:function(){if(!0===r)throw new Error("Trying to use the same placeholder more than once: "+n);return r=!0,o}};var n,o,r}),c=(r=e,i=n,a=u,j(t,function(t){return Ts(r,i,t,a)}));return tt(u,function(t){if(!1===t.used()&&t.required())throw new Error("Placeholder: "+t.name()+" was not found in components list\nNamespace: "+e.getOr("none")+"\nComponents: "+yo(n.components,null,2))}),c},Bs=Vs.single,Ds=Vs.multiple,_s=U(Hs),Fs=dt([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),Rs=cr("factory",{sketch:d}),Ls=cr("schema",[]),Is=$o("name"),Ns=Do("pname","pname",Qn(function(t){return"<alloy."+jn(t.name)+">"}),Go()),Ps=gr("schema",function(){return[rr("preprocess")]}),js=cr("defaults",U({})),Us=cr("overrides",U({})),Ws=Ho([Rs,Ls,Is,Ns,js,Us]),Gs=Ho([Rs,Ls,Is,js,Us]),Xs=Ho([Rs,Ls,Is,Ns,js,Us]),Ys=Ho([Rs,Ps,Is,$o("unit"),Ns,js,Us]),qs=function(t){return t.fold(P.some,P.none,P.some,P.some)},Ks=function(t){var e=function(t){return t.name};return t.fold(e,e,e,e)},Js=function(n,o){return function(t){var e=jo("Converting part type",o,t);return n(e)}},$s=Js(Fs.required,Ws),Qs=Js(Fs.external,Gs),Zs=Js(Fs.optional,Xs),tl=Js(Fs.group,Ys),el=U("entirety"),nl=Object.freeze({required:$s,external:Qs,optional:Zs,group:tl,asNamedPart:qs,name:Ks,asCommon:function(t){return t.fold(d,d,d,d)},original:el}),ol=function(t,e,n,o){return gt(e.defaults(t,n,o),n,{uid:t.partUids[e.name]},e.overrides(t,n,o))},rl=function(r,t){var e={};return T(t,function(t){qs(t).each(function(n){var o=il(r,n.pname);e[n.name]=function(t){var e=jo("Part: "+n.name+" in "+r,Ho(n.schema),t);return Wn({},o,{config:t,validated:e})}})}),e},il=function(t,e){return{uiType:_s(),owner:t,name:e}},al=function(t,e,n){return{uiType:_s(),owner:t,name:e,config:n,validated:{}}},ul=function(t){return j(t,function(t){return t.fold(P.none,P.some,P.none,P.none).map(function(t){return er(t.name,t.schema.concat([za(el())]))}).toArray()})},cl=function(t){return E(t,Ks)},sl=function(t,e,n){return o=e,i={},r={},T(n,function(t){t.fold(function(o){i[o.pname]=Bs(!0,function(t,e,n){return o.factory.sketch(ol(t,o,e,n))})},function(t){var e=o.parts[t.name];r[t.name]=U(t.factory.sketch(ol(o,t,e[el()]),e))},function(o){i[o.pname]=Bs(!1,function(t,e,n){return o.factory.sketch(ol(t,o,e,n))})},function(r){i[r.pname]=Ds(!0,function(e,t,n){var o=e[r.name];return E(o,function(t){return r.factory.sketch(gt(r.defaults(e,t,n),t,r.overrides(e,t)))})})})}),{internals:U(i),externals:U(r)};var o,i,r},ll=function(t,e,n){return As(P.some(t),e,e.components,n)},fl=function(t,e,n){var o=e.partUids[n];return t.getSystem().getByUid(o).toOption()},dl=function(t,e,n){return fl(t,e,n).getOrDie("Could not find part: "+n)},ml=function(t,e,n){var o={},r=e.partUids,i=t.getSystem();return T(n,function(t){o[t]=i.getByUid(r[t])}),et(o,U)},hl=function(t,e){var n=t.getSystem();return et(e.partUids,function(t,e){return U(n.getByUid(t))})},gl=function(t){return Q(t.partUids)},vl=function(t,e,n){var o={},r=e.partUids,i=t.getSystem();return T(n,function(t){o[t]=i.getByUid(r[t]).getOrDie()}),et(o,U)},pl=function(e,t){var n=cl(t);return kt(E(n,function(t){return{key:t,value:e+"-"+t}}))},bl=function(e){return Do("partUids","partUids",Zn(function(t){return pl(t.uid,e)}),Go())},yl=Object.freeze({generate:rl,generateOne:al,schemas:ul,names:cl,substitutes:sl,components:ll,defaultUids:pl,defaultUidsSchema:bl,getAllParts:hl,getAllPartNames:gl,getPart:fl,getPartOrDie:dl,getParts:ml,getPartsOrDie:vl}),xl=function(t,e,n,o,r){var i,a,u=(a=r,(0<(i=o).length?[er("parts",i)]:[]).concat([$o("uid"),cr("dom",{}),cr("components",[]),za("originalSpec"),cr("debug.sketcher",{})]).concat(a));return jo(t+" [SpecSchema]",Mo(u.concat(e)),n)},wl=function(t,e,n,o,r){var i=kl(r),a=ul(n),u=bl(n),c=xl(t,e,i,a,[u]),s=sl(0,c,n);return o(c,ll(t,c,s.internals()),i,s.externals())},kl=function(t){return t.hasOwnProperty("uid")?t:Wn({},t,{uid:ii("uid")})},zl=Mo([$o("name"),$o("factory"),$o("configFields"),cr("apis",{}),cr("extraApis",{})]),Sl=Mo([$o("name"),$o("factory"),$o("configFields"),$o("partFields"),cr("apis",{}),cr("extraApis",{})]),Cl=function(t){var i=jo("Sketcher for "+t.name,zl,t),e=et(i.apis,mi),n=et(i.extraApis,function(t,e){return li(t,e)});return Wn({name:U(i.name),partFields:U([]),configFields:U(i.configFields),sketch:function(t){return e=i.name,n=i.configFields,o=i.factory,r=kl(t),o(xl(e,n,r,[],[]),r);var e,n,o,r}},e,n)},Ol=function(t){var e=jo("Sketcher for "+t.name,Sl,t),n=rl(e.name,e.partFields),o=et(e.apis,mi),r=et(e.extraApis,function(t,e){return li(t,e)});return Wn({name:U(e.name),partFields:U(e.partFields),configFields:U(e.configFields),sketch:function(t){return wl(e.name,e.configFields,e.partFields,e.factory,t)},parts:U(n)},o,r)},Ml=function(t){return"input"===bn(t)&&"radio"!==On(t,"type")||"textarea"===bn(t)},Hl=Object.freeze({getCurrent:function(t,e,n){return e.find(t)}}),Vl=[$o("find")],El=Aa({fields:Vl,name:"composing",apis:Hl}),Tl=function(t,e,n,o){var r=t+e;return o<r?n:r<n?o:r},Al=function(t,e,n){return t<=e?e:n<=t?n:t},Bl=function(e,n,t){var o=yc(e.element(),"."+n.highlightClass);T(o,function(t){Ai(t,n.highlightClass),e.getSystem().getByDom(t).each(function(t){n.onDehighlight(e,t)})})},Dl=function(t,e,n,o){var r=_l(t,e,n,o);Bl(t,e),Ti(o.element(),e.highlightClass),r||e.onHighlight(t,o)},_l=function(t,e,n,o){return Di(o.element(),e.highlightClass)},Fl=function(t,e,n,o){var r=yc(t.element(),"."+e.itemClass);return P.from(r[o]).fold(function(){return ft.error("No element found with index "+o)},t.getSystem().getByDom)},Rl=function(e,t,n){return ua(e.element(),"."+t.itemClass).bind(function(t){return e.getSystem().getByDom(t).toOption()})},Ll=function(e,t,n){var o=yc(e.element(),"."+t.itemClass);return(0<o.length?P.some(o[o.length-1]):P.none()).bind(function(t){return e.getSystem().getByDom(t).toOption()})},Il=function(n,e,t,o){var r=yc(n.element(),"."+e.itemClass);return F(r,function(t){return Di(t,e.highlightClass)}).bind(function(t){var e=Tl(t,o,0,r.length-1);return n.getSystem().getByDom(r[e]).toOption()})},Nl=function(e,t,n){var o=yc(e.element(),"."+t.itemClass);return Ot(E(o,function(t){return e.getSystem().getByDom(t).toOption()}))},Pl=Object.freeze({dehighlightAll:Bl,dehighlight:function(t,e,n,o){var r=_l(t,e,n,o);Ai(o.element(),e.highlightClass),r&&e.onDehighlight(t,o)},highlight:Dl,highlightFirst:function(e,n,o){Rl(e,n,o).each(function(t){Dl(e,n,o,t)})},highlightLast:function(e,n,o){Ll(e,n,o).each(function(t){Dl(e,n,o,t)})},highlightAt:function(e,n,o,t){Fl(e,n,o,t).fold(function(t){throw new Error(t)},function(t){Dl(e,n,o,t)})},highlightBy:function(e,n,o,t){var r=Nl(e,n,o);_(r,t).each(function(t){Dl(e,n,o,t)})},isHighlighted:_l,getHighlighted:function(e,t,n){return ua(e.element(),"."+t.highlightClass).bind(function(t){return e.getSystem().getByDom(t).toOption()})},getFirst:Rl,getLast:Ll,getPrevious:function(t,e,n){return Il(t,e,0,-1)},getNext:function(t,e,n){return Il(t,e,0,1)},getCandidates:Nl}),jl=[$o("highlightClass"),$o("itemClass"),ba("onHighlight"),ba("onDehighlight")],Ul=Aa({fields:jl,name:"highlighting",apis:Pl}),Wl=function(t,e,n){var o=X(t.slice(0,e)),r=X(t.slice(e+1));return _(o.concat(r),n)},Gl=function(t,e,n){var o=X(t.slice(0,e));return _(o,n)},Xl=function(t,e,n){var o=t.slice(0,e),r=t.slice(e+1);return _(r.concat(o),n)},Yl=function(t,e,n){var o=t.slice(e+1);return _(o,n)},ql=function(n){return function(t){var e=t.raw();return M(n,e.which)}},Kl=function(t){return function(e){return W(t,function(t){return t(e)})}},Jl=function(t){return!0===t.raw().shiftKey},$l=function(t){return!0===t.raw().ctrlKey},Ql=m(Jl),Zl=function(t,e){return{matches:t,classification:e}},tf=function(t){t.dom().focus()},ef=function(t){var e=t!==undefined?t.dom():document;return P.from(e.activeElement).map(Ne.fromDom)},nf=function(e){return ef(nn(e)).filter(function(t){return e.dom().contains(t.dom())})},of=function(t,e,n){e.exists(function(e){return n.exists(function(t){return en(t,e)})})||yr(t,_e(),{prevFocus:e,newFocus:n})},rf=function(){var r=function(t){return nf(t.element())};return{get:r,set:function(t,e){var n=r(t);t.getSystem().triggerFocus(e,t.element());var o=r(t);of(t,n,o)}}},af=function(){var r=function(t){return Ul.getHighlighted(t).map(function(t){return t.element()})};return{get:r,set:function(e,t){var n=r(e);e.getSystem().getByDom(t).fold(N,function(t){Ul.highlight(e,t)});var o=r(e);of(e,n,o)}}},uf=function(t,e,n,i,a){var u=function(e,n,t,o,r){var i,a,u=t(e,n,o,r);return(i=u,a=n.event(),_(i,function(t){return t.matches(a)}).map(function(t){return t.classification})).bind(function(t){return t(e,n,o,r)})},o={schema:function(){return t.concat([cr("focusManager",rf()),ka("handler",o),ka("state",e)])},processKey:u,toEvents:function(o,r){return Fr(a.map(function(n){return Ir(xe(),function(t,e){n(t,o,r,e),e.stop()})}).toArray().concat([Ir(Lt(),function(t,e){u(t,e,n,o,r).each(function(t){e.stop()})}),Ir(It(),function(t,e){u(t,e,i,o,r).each(function(t){e.stop()})})]))}};return o},cf=function(t){var e=[rr("onEscape"),rr("onEnter"),cr("selector",'[data-alloy-tabstop="true"]'),cr("firstTabstop",0),cr("useTabstopAt",U(!0)),rr("visibilitySelector")].concat([t]),a=function(t,e){var n=t.visibilitySelector.bind(function(t){return ca(e,t)}).getOr(e);return 0<$a(n)},u=function(e,t,n,o,r){return r(t,n,function(t){return a(e=o,n=t)&&e.useTabstopAt(n);var e,n}).fold(function(){return o.cyclic?P.some(!0):P.none()},function(t){return o.focusManager.set(e,t),P.some(!0)})},i=function(e,t,n,o){var r,i,a=yc(e.element(),n.selector);return(r=e,i=n,i.focusManager.get(r).bind(function(t){return ca(t,i.selector)})).bind(function(t){return F(a,f(en,t)).bind(function(t){return u(e,a,t,n,o)})})},n=U([Zl(Kl([Jl,ql([9])]),function(t,e,n,o){var r=n.cyclic?Wl:Gl;return i(t,0,n,r)}),Zl(ql([9]),function(t,e,n,o){var r=n.cyclic?Xl:Yl;return i(t,0,n,r)}),Zl(ql([27]),function(e,n,t,o){return t.onEscape.bind(function(t){return t(e,n)})}),Zl(Kl([Ql,ql([13])]),function(e,n,t,o){return t.onEnter.bind(function(t){return t(e,n)})})]),o=U([]);return uf(e,hi.init,n,o,P.some(function(e,n){var t,o,r,i;(t=e,o=n,r=yc(t.element(),o.selector),i=A(r,function(t){return a(o,t)}),P.from(i[o.firstTabstop])).each(function(t){n.focusManager.set(e,t)})}))},sf=cf(gr("cyclic",U(!1))),lf=cf(gr("cyclic",U(!0))),ff=function(t,e,n){return Ml(n)&&ql([32])(e.event())?P.none():(wr(t,n,ze()),P.some(!0))},df=function(t,e){return P.some(!0)},mf=[cr("execute",ff),cr("useSpace",!1),cr("useEnter",!0),cr("useControlEnter",!1),cr("useDown",!1)],hf=function(t,e,n){return n.execute(t,e,t.element())},gf=uf(mf,hi.init,function(t,e,n,o){var r=n.useSpace&&!Ml(t.element())?[32]:[],i=n.useEnter?[13]:[],a=n.useDown?[40]:[],u=r.concat(i).concat(a);return[Zl(ql(u),hf)].concat(n.useControlEnter?[Zl(Kl([$l,ql([13])]),hf)]:[])},function(t,e,n,o){return n.useSpace&&!Ml(t.element())?[Zl(ql([32]),df)]:[]},P.none()),vf=function(t){var n=Ct(P.none());return gi({readState:function(){return n.get().map(function(t){return{numRows:t.numRows(),numColumns:t.numColumns()}}).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(t,e){n.set(P.some({numRows:U(t),numColumns:U(e)}))},getNumRows:function(){return n.get().map(function(t){return t.numRows()})},getNumColumns:function(){return n.get().map(function(t){return t.numColumns()})}})},pf=Object.freeze({flatgrid:vf,init:function(t){return t.state(t)}}),bf=function(i){return function(t,e,n,o){var r=i(t.element());return kf(r,t,e,n,o)}},yf=function(t,e){var n=ec(t,e);return bf(n)},xf=function(t,e){var n=ec(e,t);return bf(n)},wf=function(r){return function(t,e,n,o){return kf(r,t,e,n,o)}},kf=function(e,n,t,o,r){return o.focusManager.get(n).bind(function(t){return e(n.element(),t,o,r)}).map(function(t){return o.focusManager.set(n,t),!0})},zf=wf,Sf=wf,Cf=wf,Of=function(t){var e,n=t.dom();return!((e=n).offsetWidth<=0&&e.offsetHeight<=0)},Mf=We(["index","candidates"],[]),Hf=function(t,e,n){return Vf(t,e,n,Of)},Vf=function(t,e,n,o){var r,i=f(en,e),a=yc(t,n),u=A(a,Of);return F(r=u,i).map(function(t){return Mf({index:t,candidates:r})})},Ef=function(t,e){return F(t,function(t){return en(e,t)})},Tf=function(n,t,o,e){return e(Math.floor(t/o),t%o).bind(function(t){var e=t.row()*o+t.column();return 0<=e&&e<n.length?P.some(n[e]):P.none()})},Af=function(r,t,i,a,u){return Tf(r,t,a,function(t,e){var n=t===i-1?r.length-t*a:a,o=Tl(e,u,0,n-1);return P.some({row:U(t),column:U(o)})})},Bf=function(i,t,a,u,c){return Tf(i,t,u,function(t,e){var n=Tl(t,c,0,a-1),o=n===a-1?i.length-n*u:u,r=Al(e,0,o-1);return P.some({row:U(n),column:U(r)})})},Df=[$o("selector"),cr("execute",ff),ya("onEscape"),cr("captureTab",!1),Sa()],_f=function(r){return function(t,e,n,o){return Hf(t,e,n.selector).bind(function(t){return r(t.candidates(),t.index(),o.getNumRows().getOr(n.initSize.numRows),o.getNumColumns().getOr(n.initSize.numColumns))})}},Ff=function(t,e,n,o){return n.captureTab?P.some(!0):P.none()},Rf=_f(function(t,e,n,o){return Af(t,e,n,o,-1)}),Lf=_f(function(t,e,n,o){return Af(t,e,n,o,1)}),If=_f(function(t,e,n,o){return Bf(t,e,n,o,-1)}),Nf=_f(function(t,e,n,o){return Bf(t,e,n,o,1)}),Pf=U([Zl(ql([37]),yf(Rf,Lf)),Zl(ql([39]),xf(Rf,Lf)),Zl(ql([38]),zf(If)),Zl(ql([40]),Sf(Nf)),Zl(Kl([Jl,ql([9])]),Ff),Zl(Kl([Ql,ql([9])]),Ff),Zl(ql([27]),function(t,e,n,o){return n.onEscape(t,e)}),Zl(ql([32].concat([13])),function(e,n,o,t){return(r=e,i=o,i.focusManager.get(r).bind(function(t){return ca(t,i.selector)})).bind(function(t){return o.execute(e,n,t)});var r,i})]),jf=U([Zl(ql([32]),df)]),Uf=uf(Df,vf,Pf,jf,P.some(function(e,n,t){ua(e.element(),n.selector).each(function(t){n.focusManager.set(e,t)})})),Wf=function(t,e,n,i){var a=function(t,e,n){var o,r=Tl(e,i,0,n.length-1);return r===t?P.none():(o=n[r],"button"===bn(o)&&"disabled"===On(o,"disabled")?a(t,r,n):P.from(n[r]))};return Hf(t,n,e).bind(function(t){var e=t.index(),n=t.candidates();return a(e,e,n)})},Gf=[$o("selector"),cr("getInitial",P.none),cr("execute",ff),ya("onEscape"),cr("executeOnMove",!1),cr("allowVertical",!0)],Xf=function(e,n,o){return(t=e,r=o,r.focusManager.get(t).bind(function(t){return ca(t,r.selector)})).bind(function(t){return o.execute(e,n,t)});var t,r},Yf=function(t,e,n){return Wf(t,n.selector,e,-1)},qf=function(t,e,n){return Wf(t,n.selector,e,1)},Kf=function(o){return function(t,e,n){return o(t,e,n).bind(function(){return n.executeOnMove?Xf(t,e,n):P.some(!0)})}},Jf=function(t,e,n,o){return n.onEscape(t,e)},$f=U([Zl(ql([32]),df)]),Qf=uf(Gf,hi.init,function(t,e,n,o){var r=[37].concat(n.allowVertical?[38]:[]),i=[39].concat(n.allowVertical?[40]:[]);return[Zl(ql(r),Kf(yf(Yf,qf))),Zl(ql(i),Kf(xf(Yf,qf))),Zl(ql([13]),Xf),Zl(ql([32]),Xf),Zl(ql([27]),Jf)]},$f,P.some(function(e,n){n.getInitial(e).orThunk(function(){return ua(e.element(),n.selector)}).each(function(t){n.focusManager.set(e,t)})})),Zf=We(["rowIndex","columnIndex","cell"],[]),td=function(t,e,n){return P.from(t[e]).bind(function(t){return P.from(t[n]).map(function(t){return Zf({rowIndex:e,columnIndex:n,cell:t})})})},ed=function(t,e,n,o){var r=t[e].length,i=Tl(n,o,0,r-1);return td(t,e,i)},nd=function(t,e,n,o){var r=Tl(n,o,0,t.length-1),i=t[r].length,a=Al(e,0,i-1);return td(t,r,a)},od=function(t,e,n,o){var r=t[e].length,i=Al(n+o,0,r-1);return td(t,e,i)},rd=function(t,e,n,o){var r=Al(n+o,0,t.length-1),i=t[r].length,a=Al(e,0,i-1);return td(t,r,a)},id=[er("selectors",[$o("row"),$o("cell")]),cr("cycles",!0),cr("previousSelector",P.none),cr("execute",ff)],ad=function(t,e){return function(n,o,i){var a=i.cycles?t:e;return ca(o,i.selectors.row).bind(function(t){var e=yc(t,i.selectors.cell);return Ef(e,o).bind(function(o){var r=yc(n,i.selectors.row);return Ef(r,t).bind(function(t){var e,n=(e=i,E(r,function(t){return yc(t,e.selectors.cell)}));return a(n,t,o).map(function(t){return t.cell()})})})})}},ud=ad(function(t,e,n){return ed(t,e,n,-1)},function(t,e,n){return od(t,e,n,-1)}),cd=ad(function(t,e,n){return ed(t,e,n,1)},function(t,e,n){return od(t,e,n,1)}),sd=ad(function(t,e,n){return nd(t,n,e,-1)},function(t,e,n){return rd(t,n,e,-1)}),ld=ad(function(t,e,n){return nd(t,n,e,1)},function(t,e,n){return rd(t,n,e,1)}),fd=U([Zl(ql([37]),yf(ud,cd)),Zl(ql([39]),xf(ud,cd)),Zl(ql([38]),zf(sd)),Zl(ql([40]),Sf(ld)),Zl(ql([32].concat([13])),function(e,n,o){return nf(e.element()).bind(function(t){return o.execute(e,n,t)})})]),dd=U([Zl(ql([32]),df)]),md=uf(id,hi.init,fd,dd,P.some(function(e,n){n.previousSelector(e).orThunk(function(){var t=n.selectors;return ua(e.element(),t.cell)}).each(function(t){n.focusManager.set(e,t)})})),hd=[$o("selector"),cr("execute",ff),cr("moveOnTab",!1)],gd=function(e,n,o){return o.focusManager.get(e).bind(function(t){return o.execute(e,n,t)})},vd=function(t,e,n){return Wf(t,n.selector,e,-1)},pd=function(t,e,n){return Wf(t,n.selector,e,1)},bd=U([Zl(ql([38]),Cf(vd)),Zl(ql([40]),Cf(pd)),Zl(Kl([Jl,ql([9])]),function(t,e,n){return n.moveOnTab?Cf(vd)(t,e,n):P.none()}),Zl(Kl([Ql,ql([9])]),function(t,e,n){return n.moveOnTab?Cf(pd)(t,e,n):P.none()}),Zl(ql([13]),gd),Zl(ql([32]),gd)]),yd=U([Zl(ql([32]),df)]),xd=uf(hd,hi.init,bd,yd,P.some(function(e,n){ua(e.element(),n.selector).each(function(t){n.focusManager.set(e,t)})})),wd=[ya("onSpace"),ya("onEnter"),ya("onShiftEnter"),ya("onLeft"),ya("onRight"),ya("onTab"),ya("onShiftTab"),ya("onUp"),ya("onDown"),ya("onEscape"),cr("stopSpaceKeyup",!1),rr("focusIn")],kd=uf(wd,hi.init,function(t,e,n){return[Zl(ql([32]),n.onSpace),Zl(Kl([Ql,ql([13])]),n.onEnter),Zl(Kl([Jl,ql([13])]),n.onShiftEnter),Zl(Kl([Jl,ql([9])]),n.onShiftTab),Zl(Kl([Ql,ql([9])]),n.onTab),Zl(ql([38]),n.onUp),Zl(ql([40]),n.onDown),Zl(ql([37]),n.onLeft),Zl(ql([39]),n.onRight),Zl(ql([32]),n.onSpace),Zl(ql([27]),n.onEscape)]},function(t,e,n){return n.stopSpaceKeyup?[Zl(ql([32]),df)]:[]},P.some(function(e,n){return n.focusIn.bind(function(t){return t(e,n)})})),zd=sf.schema(),Sd=lf.schema(),Cd=Qf.schema(),Od=Uf.schema(),Md=md.schema(),Hd=gf.schema(),Vd=xd.schema(),Ed=kd.schema(),Td=Da({branchKey:"mode",branches:Object.freeze({acyclic:zd,cyclic:Sd,flow:Cd,flatgrid:Od,matrix:Md,execution:Hd,menu:Vd,special:Ed}),name:"keying",active:{events:function(t,e){return t.handler.toEvents(t,e)}},apis:{focusIn:function(t){t.getSystem().triggerFocus(t.element(),t.element())},setGridSize:function(t,e,n,o,r){St(n,"setGridSize")?n.setGridSize(o,r):console.error("Layout does not support setGridSize")}},state:pf}),Ad=function(t,e,n,o){var r=t.getSystem().build(o);ns(t,r,n)},Bd=function(t,e,n,o){var r=Dd(t,e);_(r,function(t){return en(o.element(),t.element())}).each(rs)},Dd=function(t,e){return t.components()},_d=function(e,n,t,r,o){var i=Dd(e,n);return P.from(i[r]).map(function(t){return Bd(e,n,0,t),o.each(function(t){Ad(e,0,function(t,e){var n,o;o=e,cn(n=t,r).fold(function(){dn(n,o)},function(t){sn(t,o)})},t)}),t})},Fd=Aa({fields:[],name:"replacing",apis:Object.freeze({append:function(t,e,n,o){Ad(t,0,dn,o)},prepend:function(t,e,n,o){Ad(t,0,fn,o)},remove:Bd,replaceAt:_d,replaceBy:function(e,n,t,o,r){var i=Dd(e,n);return F(i,o).bind(function(t){return _d(e,n,0,t,r)})},set:function(e,t,n,o){var r,i,a,u;is(e),r=function(){var t=E(o,e.getSystem().build);T(t,function(t){es(e,t)})},i=e.element(),a=nn(i),u=ef(a).bind(function(e){var t=function(t){return en(e,t)};return t(i)?P.some(i):Dr(i,t)}),r(i),u.each(function(e){ef(a).filter(function(t){return en(t,e)}).fold(function(){tf(e)},N)})},contents:Dd})}),Rd=function(t,e,n){e.store.manager.onLoad(t,e,n)},Ld=function(t,e,n){e.store.manager.onUnload(t,e,n)},Id=Object.freeze({onLoad:Rd,onUnload:Ld,setValue:function(t,e,n,o){e.store.manager.setValue(t,e,n,o)},getValue:function(t,e,n){return e.store.manager.getValue(t,e,n)},getState:function(t,e,n){return n}}),Nd=Object.freeze({events:function(n,o){var t=n.resetOnDom?[Yr(function(t,e){Rd(t,n,o)}),qr(function(t,e){Ld(t,n,o)})]:[Ca(n,o,Rd)];return Fr(t)}}),Pd=function(){var t=Ct(null);return gi({set:t.set,get:t.get,isNotSet:function(){return null===t.get()},clear:function(){t.set(null)},readState:function(){return{mode:"memory",value:t.get()}}})},jd=function(){var i=Ct({}),a=Ct({});return gi({readState:function(){return{mode:"dataset",dataByValue:i.get(),dataByText:a.get()}},lookup:function(t){return xt(i.get(),t).orThunk(function(){return xt(a.get(),t)})},update:function(t){var e=i.get(),n=a.get(),o={},r={};T(t,function(e){o[e.value]=e,xt(e,"meta").each(function(t){xt(t,"text").each(function(t){r[t]=e})})}),i.set(Wn({},e,o)),a.set(Wn({},n,r))},clear:function(){i.set({}),a.set({})}})},Ud=Object.freeze({memory:Pd,dataset:jd,manual:function(){return gi({readState:function(){}})},init:function(t){return t.store.manager.state(t)}}),Wd=function(t,e,n,o){var r=e.store;n.update([o]),r.setValue(t,o),e.onSetValue(t,o)},Gd=[rr("initialValue"),$o("getFallbackEntry"),$o("getDataKey"),$o("setValue"),ka("manager",{setValue:Wd,getValue:function(t,e,n){var o=e.store,r=o.getDataKey(t);return n.lookup(r).fold(function(){return o.getFallbackEntry(r)},function(t){return t})},onLoad:function(e,n,o){n.store.initialValue.each(function(t){Wd(e,n,o,t)})},onUnload:function(t,e,n){n.clear()},state:jd})],Xd=[$o("getValue"),cr("setValue",N),rr("initialValue"),ka("manager",{setValue:function(t,e,n,o){e.store.setValue(t,o),e.onSetValue(t,o)},getValue:function(t,e,n){return e.store.getValue(t)},onLoad:function(e,n,t){n.store.initialValue.each(function(t){n.store.setValue(e,t)})},onUnload:N,state:hi.init})],Yd=[rr("initialValue"),ka("manager",{setValue:function(t,e,n,o){n.set(o),e.onSetValue(t,o)},getValue:function(t,e,n){return n.get()},onLoad:function(t,e,n){e.store.initialValue.each(function(t){n.isNotSet()&&n.set(t)})},onUnload:function(t,e,n){n.clear()},state:Pd})],qd=[sr("store",{mode:"memory"},Wo("mode",{memory:Yd,manual:Xd,dataset:Gd})),ba("onSetValue"),cr("resetOnDom",!1)],Kd=Aa({fields:qd,name:"representing",active:Nd,apis:Id,extra:{setValueFrom:function(t,e){var n=Kd.getValue(e);Kd.setValue(t,n)}},state:Ud}),Jd=function(t,e){e.ignore||(tf(t.element()),e.onFocus(t))},$d=Object.freeze({focus:Jd,blur:function(t,e){e.ignore||t.element().dom().blur()},isFocused:function(t){return e=t.element(),n=nn(e).dom(),e.dom()===n.activeElement;var e,n}}),Qd=Object.freeze({exhibit:function(t,e){var n=e.ignore?{}:{attributes:{tabindex:"-1"}};return pi(n)},events:function(n){return Fr([Ir(xe(),function(t,e){Jd(t,n),e.stop()})].concat(n.stopMousedown?[Ir(Tt(),function(t,e){e.event().prevent()})]:[]))}}),Zd=[ba("onFocus"),cr("stopMousedown",!1),cr("ignore",!1)],tm=Aa({fields:Zd,name:"focusing",active:Qd,apis:$d}),em=function(t,e){var n=am(t,e),o=e.aria;o.update(t,o,n)},nm=function(t,e,n){Bi(t.element(),e.toggleClass),em(t,e)},om=function(t,e,n){Ti(t.element(),e.toggleClass),em(t,e)},rm=function(t,e,n){Ai(t.element(),e.toggleClass),em(t,e)},im=function(t,e,n,o){(o?om:rm)(t,e,n)},am=function(t,e){return Di(t.element(),e.toggleClass)},um=function(t,e,n){im(t,e,n,e.selected)},cm=Object.freeze({onLoad:um,toggle:nm,isOn:am,on:om,off:rm,set:im}),sm=Object.freeze({exhibit:function(t,e,n){return pi({})},events:function(t,e){var n,o,r,i=(n=t,o=e,r=nm,Jr(function(t){r(t,n,o)})),a=Ca(t,e,um);return Fr(I([t.toggleOnExecute?[i]:[],[a]]))}}),lm=function(t,e,n){Sn(t.element(),"aria-expanded",n)},fm=[cr("selected",!1),$o("toggleClass"),cr("toggleOnExecute",!0),sr("aria",{mode:"none"},Wo("mode",{pressed:[cr("syncWithExpanded",!1),ka("update",function(t,e,n){Sn(t.element(),"aria-pressed",n),e.syncWithExpanded&&lm(t,e,n)})],checked:[ka("update",function(t,e,n){Sn(t.element(),"aria-checked",n)})],expanded:[ka("update",lm)],selected:[ka("update",function(t,e,n){Sn(t.element(),"aria-selected",n)})],none:[ka("update",N)]}))],dm=Aa({fields:fm,name:"toggling",active:sm,apis:cm}),mm="alloy.item-hover",hm="alloy.item-focus",gm=function(t){(nf(t.element()).isNone()||tm.isFocused(t))&&(tm.isFocused(t)||tm.focus(t),yr(t,mm,{item:t}))},vm=function(t){yr(t,hm,{item:t})},pm=U(mm),bm=U(hm),ym=function(t,e){var n,o;return{key:t,value:{config:{},me:(n=t,o=Fr(e),Aa({fields:[$o("enabled")],name:n,active:{events:U(o)}})),configAsRaw:U({}),initialConfig:{},state:hi}}},xm=[$o("data"),$o("components"),$o("dom"),rr("toggling"),Os("itemBehaviours",[dm,tm,Td,Kd]),cr("ignoreFocus",!1),cr("domModification",{}),ka("builder",function(t){return{dom:t.dom,domModification:Wn({},t.domModification,{attributes:Wn({role:t.toggling.isSome()?"menuitemcheckbox":"menuitem"},t.domModification.attributes)}),behaviours:Ms(t.itemBehaviours,[t.toggling.fold(dm.revoke,function(t){return dm.config(Wn({aria:{mode:"checked"}},t))}),tm.config({ignore:t.ignoreFocus,stopMousedown:t.ignoreFocus,onFocus:function(t){vm(t)}}),Td.config({mode:"execution"}),Kd.config({store:{mode:"memory",initialValue:t.data}}),ym("item-type-events",[Ir(Oe(),xr),Wr(Tt()),Ir(_t(),gm),Ir(Se(),tm.focus)])]),components:t.components,eventOrder:t.eventOrder}}),cr("eventOrder",{})],wm=[$o("dom"),$o("components"),ka("builder",function(t){return{dom:t.dom,components:t.components,events:Fr([Gr(Se())])}})],km=U([$s({name:"widget",overrides:function(e){return{behaviours:Ea([Kd.config({store:{mode:"manual",getValue:function(t){return e.data},setValue:function(){}}})])}}})]),zm=[$o("uid"),$o("data"),$o("components"),$o("dom"),cr("autofocus",!1),cr("ignoreFocus",!1),Os("widgetBehaviours",[Kd,tm,Td]),cr("domModification",{}),bl(km()),ka("builder",function(n){var t=sl(0,n,km()),e=ll("item-widget",n,t.internals()),o=function(t){return fl(t,n,"widget").map(function(t){return Td.focusIn(t),t})},r=function(t,e){return Ml(e.event().target())||n.autofocus&&e.setSource(t.element()),P.none()};return{dom:n.dom,components:e,domModification:n.domModification,events:Fr([Jr(function(t,e){o(t).each(function(t){e.stop()})}),Ir(_t(),gm),Ir(Se(),function(t,e){n.autofocus?o(t):tm.focus(t)})]),behaviours:Ms(n.widgetBehaviours,[Kd.config({store:{mode:"memory",initialValue:n.data}}),tm.config({ignore:n.ignoreFocus,onFocus:function(t){vm(t)}}),Td.config({mode:"special",focusIn:n.autofocus?function(t){o(t)}:_a(),onLeft:r,onRight:r,onEscape:function(t,e){return tm.isFocused(t)||n.autofocus?(n.autofocus&&e.setSource(t.element()),P.none()):(tm.focus(t),P.some(!0))}})])}})],Sm=Wo("type",{widget:zm,item:xm,separator:wm}),Cm=U([tl({factory:{sketch:function(t){var e=jo("menu.spec item",Sm,t);return e.builder(e)}},name:"items",unit:"item",defaults:function(t,e){return e.hasOwnProperty("uid")?e:Wn({},e,{uid:ii("item")})},overrides:function(t,e){return{type:e.type,ignoreFocus:t.fakeFocus,domModification:{classes:[t.markers.item]}}}})]),Om=U([$o("value"),$o("items"),$o("dom"),$o("components"),cr("eventOrder",{}),zs("menuBehaviours",[Ul,Kd,El,Td]),sr("movement",{mode:"menu",moveOnTab:!0},Wo("mode",{grid:[Sa(),ka("config",function(t,e){return{mode:"flatgrid",selector:"."+t.markers.item,initSize:{numColumns:e.initSize.numColumns,numRows:e.initSize.numRows},focusManager:t.focusManager}})],matrix:[ka("config",function(t,e){return{mode:"matrix",selectors:{row:e.rowSelector,cell:"."+t.markers.item},focusManager:t.focusManager}}),$o("rowSelector")],menu:[cr("moveOnTab",!0),ka("config",function(t,e){return{mode:"menu",selector:"."+t.markers.item,moveOnTab:e.moveOnTab,focusManager:t.focusManager}})]})),Qo("markers",ma()),cr("fakeFocus",!1),cr("focusManager",rf()),ba("onHighlight")]),Mm=U("alloy.menu-focus"),Hm=Ol({name:"Menu",configFields:Om(),partFields:Cm(),factory:function(t,e,n,o){return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:Cs(t.menuBehaviours,[Ul.config({highlightClass:t.markers.selectedItem,itemClass:t.markers.item,onHighlight:t.onHighlight}),Kd.config({store:{mode:"memory",initialValue:t.value}}),El.config({find:P.some}),Td.config(t.movement.config(t,t.movement))]),events:Fr([Ir(bm(),function(e,n){var t=n.event();e.getSystem().getByDom(t.target()).each(function(t){Ul.highlight(e,t),n.stop(),yr(e,Mm(),{menu:e,item:t})})}),Ir(pm(),function(t,e){var n=e.event().item();Ul.highlight(t,n)})]),components:e,eventOrder:t.eventOrder,domModification:{attributes:{role:"menu"}}}}}),Vm=function(n,o,r,t){return xt(r,t).bind(function(t){return xt(n,t).bind(function(t){var e=Vm(n,o,r,t);return P.some([t].concat(e))})}).getOr([])},Em=function(t,e){var n={};tt(t,function(t,e){T(t,function(t){n[t]=e})});var o=e,r=nt(e,function(t,e){return{k:t,v:e}}),i=et(r,function(t,e){return[e].concat(Vm(n,o,r,e))});return et(n,function(t){return xt(i,t).getOr([t])})},Tm=function(){var i=Ct({}),a=Ct({}),u=Ct({}),c=Ct(P.none()),s=Ct({}),e=function(t){return xt(a.get(),t)};return{setMenuBuilt:function(t,e){var n;a.set(Wn({},a.get(),((n={})[t]={type:"prepared",menu:e},n)))},setContents:function(t,e,n,o){c.set(P.some(t)),i.set(n),a.set(e),s.set(o);var r=Em(o,n);u.set(r)},expand:function(n){return xt(i.get(),n).map(function(t){var e=xt(u.get(),n).getOr([]);return[t].concat(e)})},refresh:function(t){return xt(u.get(),t)},collapse:function(t){return xt(u.get(),t).bind(function(t){return 1<t.length?P.some(t.slice(1)):P.none()})},lookupMenu:e,otherMenus:function(t){var e=s.get();return Y(Q(e),t)},getPrimary:function(){return c.get().bind(function(t){return e(t).bind(function(t){return"prepared"===t.type?P.some(t.menu):P.none()})})},getMenus:function(){return a.get()},clear:function(){i.set({}),a.set({}),u.set({}),c.set(P.none())},isClear:function(){return c.get().isNone()}}},Am=U("collapse-item"),Bm=Cl({name:"TieredMenu",configFields:[wa("onExecute"),wa("onEscape"),xa("onOpenMenu"),xa("onOpenSubmenu"),ba("onCollapseMenu"),cr("highlightImmediately",!0),er("data",[$o("primary"),$o("menus"),$o("expansions")]),cr("fakeFocus",!1),ba("onHighlight"),ba("onHover"),ga(),$o("dom"),cr("navigateOnHover",!0),cr("stayInDom",!1),zs("tmenuBehaviours",[Td,Ul,El,Fd]),cr("eventOrder",{})],apis:{collapseMenu:function(t,e){t.collapseMenu(e)},highlightPrimary:function(t,e){t.highlightPrimary(e)}},factory:function(u,t){var c,e,s=Tm(),n=function(t){var o,r,e,n=(o=t,r=u.data.primary,e=u.data.menus,et(e,function(t,e){var n=function(){return Hm.sketch(Wn({dom:t.dom},t,{value:e,items:t.items,markers:u.markers,fakeFocus:u.fakeFocus,onHighlight:u.onHighlight,focusManager:u.fakeFocus?af():rf()}))};return e===r?{type:"prepared",menu:o.getSystem().build(n())}:{type:"notbuilt",nbMenu:n}})),i=a(t);return s.setContents(u.data.primary,n,u.data.expansions,i),s.getPrimary()},l=function(t){return Kd.getValue(t).value},a=function(t){return et(u.data.menus,function(t,e){return j(t.items,function(t){return"separator"===t.type?[]:[t.data.value]})})},f=function(e,t){Ul.highlight(e,t),Ul.getHighlighted(t).orThunk(function(){return Ul.getFirst(t)}).each(function(t){wr(e,t.element(),Se())})},d=function(e,t){return Ot(E(t,function(t){return e.lookupMenu(t).bind(function(t){return"prepared"===t.type?P.some(t.menu):P.none()})}))},m=function(e,t,n){var o=d(t,t.otherMenus(n));T(o,function(t){Fi(t.element(),[u.markers.backgroundMenu]),u.stayInDom||Fd.remove(e,t)})},h=function(o,r,i){return P.from(i[0]).bind(function(t){return r.lookupMenu(t).bind(function(t){if("notbuilt"===t.type)return P.none();var e=t.menu,n=d(r,i.slice(1));return T(n,function(t){Ti(t.element(),u.markers.backgroundMenu)}),Sr(e.element())||Fd.append(o,ia(e)),Fi(e.element(),[u.markers.backgroundMenu]),f(o,e),m(o,r,i),P.some(e)})})};(e=c||(c={}))[e.HighlightSubmenu=0]="HighlightSubmenu",e[e.HighlightParent=1]="HighlightParent";var i=function(r,i,a){void 0===a&&(a=c.HighlightSubmenu);var t=l(i);return s.expand(t).bind(function(o){return P.from(o[0]).bind(function(n){return s.lookupMenu(n).bind(function(t){var e=function(t,e,n){if("notbuilt"!==n.type)return n.menu;var o=t.getSystem().build(n.nbMenu());return s.setMenuBuilt(e,o),o}(r,n,t);return Sr(e.element())||Fd.append(r,ia(e)),u.onOpenSubmenu(r,i,e),a===c.HighlightSubmenu?(Ul.highlightFirst(e),h(r,s,o)):(Ul.dehighlightAll(e),P.some(i))})})})},o=function(e,n){var t=l(n);return s.collapse(t).bind(function(t){return h(e,s,t).map(function(t){return u.onCollapseMenu(e,n,t),t})})},r=function(n){return function(e,t){return ca(t.getSource(),"."+u.markers.item).bind(function(t){return e.getSystem().getByDom(t).toOption().bind(function(t){return n(e,t).map(function(){return!0})})})}},g=Fr([Ir(Mm(),function(e,t){var n=t.event().menu();Ul.highlight(e,n);var o=l(t.event().item());s.refresh(o).each(function(t){return m(e,s,t)})}),Jr(function(e,t){var n=t.event().target();e.getSystem().getByDom(n).each(function(t){0===l(t).indexOf("collapse-item")&&o(e,t),i(e,t,c.HighlightSubmenu).fold(function(){u.onExecute(e,t)},function(){})})}),Yr(function(e,t){n(e).each(function(t){Fd.append(e,ia(t)),u.onOpenMenu(e,t),u.highlightImmediately&&f(e,t)})})].concat(u.navigateOnHover?[Ir(pm(),function(t,e){var n,o,r=e.event().item();n=t,o=l(r),s.refresh(o).bind(function(t){return h(n,s,t)}),i(t,r,c.HighlightParent),u.onHover(t,r)})]:[])),v={collapseMenu:function(e){Ul.getHighlighted(e).each(function(t){Ul.getHighlighted(t).each(function(t){o(e,t)})})},highlightPrimary:function(e){s.getPrimary().each(function(t){f(e,t)})}};return{uid:u.uid,dom:u.dom,markers:u.markers,behaviours:Cs(u.tmenuBehaviours,[Td.config({mode:"special",onRight:r(function(t,e){return Ml(e.element())?P.none():i(t,e,c.HighlightSubmenu)}),onLeft:r(function(t,e){return Ml(e.element())?P.none():o(t,e)}),onEscape:r(function(t,e){return o(t,e).orThunk(function(){return u.onEscape(t,e).map(function(){return t})})}),focusIn:function(e,t){s.getPrimary().each(function(t){wr(e,t.element(),Se())})}}),Ul.config({highlightClass:u.markers.selectedMenu,itemClass:u.markers.menu}),El.config({find:function(t){return Ul.getHighlighted(t)}}),Fd.config({})]),eventOrder:u.eventOrder,apis:v,events:g}},extraApis:{tieredData:function(t,e,n){return{primary:t,menus:e,expansions:n}},singleData:function(t,e){return{primary:t,menus:wt(t,e),expansions:{}}},collapseItem:function(t){return{value:jn(Am()),meta:{text:t}}}}}),Dm=Cl({name:"InlineView",configFields:[$o("lazySink"),ba("onShow"),ba("onHide"),zs("inlineBehaviours",[ps,La]),ur("fireDismissalEventInstead",[cr("event",De())]),cr("getRelated",P.none),cr("eventOrder",P.none)],factory:function(u,t){var r=function(t,e,n,o){var r=u.lazySink(t).getOrDie();ps.openWhileCloaked(t,n,function(){return Qc.positionWithin(r,e,t,o)}),u.onShow(t)},e={setContent:function(t,e){ps.open(t,e)},showAt:function(t,e,n){var o=P.none();r(t,e,n,o)},showWithin:r,showMenuAt:function(t,e,n){var r,o,i,a=(r=function(){return u.lazySink(t)},o=e,i=n,Bm.sketch({dom:{tag:"div"},data:i.data,markers:i.menu.markers,onEscape:function(){return P.some(!0)},onExecute:function(){return P.some(!0)},onOpenMenu:function(t,e){Qc.position(r().getOrDie(),o,e)},onOpenSubmenu:function(t,e,n){var o=r().getOrDie();Qc.position(o,{anchor:"submenu",item:e},n)}}));ps.open(t,a),u.onShow(t)},hide:function(t){ps.close(t),u.onHide(t)},getContent:function(t){return ps.getState(t)},isOpen:ps.isOpen};return{uid:u.uid,dom:u.dom,behaviours:Cs(u.inlineBehaviours,[ps.config({isPartOf:function(t,e,n){return la(e,n)||(o=t,r=n,u.getRelated(o).exists(function(t){return la(t,r)}));var o,r},getAttachPoint:function(t){return u.lazySink(t).getOrDie()}}),ws(Wn({isExtraPart:U(!1)},u.fireDismissalEventInstead.map(function(t){return{fireEventInstead:{event:t.event}}}).getOr({})))]),eventOrder:u.eventOrder,apis:e}},apis:{showAt:function(t,e,n,o){t.showAt(e,n,o)},showWithin:function(t,e,n,o,r){t.showWithin(e,n,o,r)},showMenuAt:function(t,e,n,o){t.showMenuAt(e,n,o)},hide:function(t,e){t.hide(e)},isOpen:function(t,e){return t.isOpen(e)},getContent:function(t,e){return t.getContent(e)},setContent:function(t,e,n){t.setContent(e,n)}}}),_m=function(t){var e=function(t,e){e.stop(),xr(t)},n=be.detect().deviceType.isTouch()?[Ir(Ce(),e)]:[Ir(jt(),e),Ir(Tt(),function(t,e){e.cut()})];return Fr(I([t.map(function(n){return Ir(ze(),function(t,e){n(t),e.stop()})}).toArray(),n]))},Fm=Cl({name:"Button",factory:function(t){var e=_m(t.action),n=t.dom.tag,o=function(e){return xt(t.dom,"attributes").bind(function(t){return xt(t,e)})};return{uid:t.uid,dom:t.dom,components:t.components,events:e,behaviours:Ms(t.buttonBehaviours,[tm.config({}),Td.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"!==n)return{role:o("role").getOr("button")};var t=o("type").getOr("button"),e=o("role").map(function(t){return{role:t}}).getOr({});return Wn({type:t},e)}()},eventOrder:t.eventOrder}},configFields:[cr("uid",undefined),$o("dom"),cr("components",[]),Os("buttonBehaviours",[tm,Td]),rr("action"),rr("role"),cr("eventOrder",{})]}),Rm=function(t){var e=function n(t){return t.uid!==undefined}(t)&&St(t,"uid")?t.uid:ii("memento");return{get:function(t){return t.getSystem().getByUid(e).getOrDie()},getOpt:function(t){return t.getSystem().getByUid(e).fold(P.none,P.some)},asSpec:function(){return Wn({},t,{uid:e})}}},Lm={"icon-accessibility-check":'<svg width="24" height="24"><g id="icon-accessibility-check" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M12 2a2 2 0 0 1 2 2 2 2 0 0 1-2 2 2 2 0 0 1-2-2c0-1.1.9-2 2-2zm8 7h-5v12c0 .6-.4 1-1 1a1 1 0 0 1-1-1v-5c0-.6-.4-1-1-1a1 1 0 0 0-1 1v5c0 .6-.4 1-1 1a1 1 0 0 1-1-1V9H4a1 1 0 1 1 0-2h16c.6 0 1 .4 1 1s-.4 1-1 1z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-align-center":'<svg width="24" height="24"><g id="icon-align-center" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2zm3 4h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 1 1 0-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2zm-3-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2z" id="shape"/></g></svg>',"icon-align-justify":'<svg width="24" height="24"><g id="icon-align-justify" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2z" id="shape"/></g></svg>',"icon-align-left":'<svg width="24" height="24"><g id="icon-align-left" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2zm0 4h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2zm0-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2z" id="shape"/></g></svg>',"icon-align-none":'<svg width="24" height="24"><g id="icon-align-none" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M14.2 5L13 7H5a1 1 0 1 1 0-2h9.2zm4 0h.8a1 1 0 0 1 0 2h-2l1.2-2zm-6.4 4l-1.2 2H5a1 1 0 0 1 0-2h6.8zm4 0H19a1 1 0 0 1 0 2h-4.4l1.2-2zm-6.4 4l-1.2 2H5a1 1 0 0 1 0-2h4.4zm4 0H19a1 1 0 0 1 0 2h-6.8l1.2-2zM7 17l-1.2 2H5a1 1 0 0 1 0-2h2zm4 0h8a1 1 0 0 1 0 2H9.8l1.2-2zm5.2-13.5l1.3.7-9.7 16.3-1.3-.7 9.7-16.3z" id="shape"/></g></svg>',"icon-align-right":'<svg width="24" height="24"><g id="icon-align-right" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2zm6 4h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm-6-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2z" id="shape"/></g></svg>',"icon-background-color":'<svg width="24" height="24"><g id="icon-background-color" stroke="none" stroke-width="1" fill-rule="evenodd"><path id="Rectangle" opacity=".1" d="M3 3h18v16H3z"/><path id="color" d="M3 19h18v3H3z"/><path d="M8.7 17h-.8a.5.5 0 0 1-.5-.6l2.7-9c.1-.3.3-.4.5-.4h2.8c.2 0 .4.1.5.4l2.7 9a.5.5 0 0 1-.5.6h-.8a.5.5 0 0 1-.4-.4l-.7-2.2c0-.3-.3-.4-.5-.4h-3.4c-.2 0-.4.1-.5.4l-.7 2.2c0 .3-.2.4-.4.4zm2.6-7.6l-.6 2a.5.5 0 0 0 .5.6h1.6a.5.5 0 0 0 .5-.6l-.6-2c0-.3-.3-.4-.5-.4h-.4c-.2 0-.4.1-.5.4z" id="shape"/></g></svg>',"icon-bold":'<svg width="24" height="24"><g id="icon-bold" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M7.8 19c-.3 0-.5 0-.6-.2l-.2-.5V5.7c0-.2 0-.4.2-.5l.6-.2h5c1.5 0 2.7.3 3.5 1 .7.6 1.1 1.4 1.1 2.5a3 3 0 0 1-.6 1.9c-.4.6-1 1-1.6 1.2.4.1.9.3 1.3.6s.8.7 1 1.2c.4.4.5 1 .5 1.6 0 1.3-.4 2.3-1.3 3-.8.7-2.1 1-3.8 1H7.8zm5-8.3c.6 0 1.2-.1 1.6-.5.4-.3.6-.7.6-1.3 0-1.1-.8-1.7-2.3-1.7H9.3v3.5h3.4zm.5 6c.7 0 1.3-.1 1.7-.4.4-.4.6-.9.6-1.5s-.2-1-.7-1.4c-.4-.3-1-.4-2-.4H9.4v3.8h4z" id="B"/></g></svg>',"icon-bookmark":'<svg width="24" height="24"><g id="icon-bookmark" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M6 4v17l6-4 6 4V4c0-.6-.4-1-1-1H7a1 1 0 0 0-1 1z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-border-width":'<svg width="24" height="24"><g id="icon-border-width" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M5 14.8h14a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2zm-.5 3.7h15c.3 0 .5.2.5.5s-.2.5-.5.5h-15a.5.5 0 1 1 0-1zm.5-8.3h14c.6 0 1 .4 1 1v1c0 .5-.4 1-1 1H5a1 1 0 0 1-1-1v-1c0-.6.4-1 1-1zm0-5.7h14c.6 0 1 .4 1 1v2c0 .6-.4 1-1 1H5a1 1 0 0 1-1-1v-2c0-.6.4-1 1-1z" id="shape"/></g></svg>',"icon-brightness":'<svg width="24" height="24"><g id="icon-brightness" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M12 17c.3 0 .5.1.7.3.2.2.3.4.3.7v1c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3 1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7v-1c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3zm0-10a1 1 0 0 1-.7-.3A1 1 0 0 1 11 6V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3.3 0 .5.1.7.3.2.2.3.4.3.7v1c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3zm7 4c.3 0 .5.1.7.3.2.2.3.4.3.7 0 .3-.1.5-.3.7a1 1 0 0 1-.7.3h-1a1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h1zM7 12c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3H5a1 1 0 0 1-.7-.3A1 1 0 0 1 4 12c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h1c.3 0 .5.1.7.3.2.2.3.4.3.7zm10 3.5l.7.8c.2.1.3.4.3.6 0 .3-.1.6-.3.8a1 1 0 0 1-.8.3 1 1 0 0 1-.6-.3l-.8-.7a1 1 0 0 1-.3-.8c0-.2.1-.5.3-.7a1 1 0 0 1 1.4 0zm-10-7l-.7-.8a1 1 0 0 1-.3-.6c0-.3.1-.6.3-.8.2-.2.5-.3.8-.3.2 0 .5.1.7.3l.7.7c.2.2.3.5.3.8 0 .2-.1.5-.3.7a1 1 0 0 1-.7.3 1 1 0 0 1-.8-.3zm10 0a1 1 0 0 1-.8.3 1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7c0-.3.1-.6.3-.8l.8-.7c.1-.2.4-.3.6-.3.3 0 .6.1.8.3.2.2.3.5.3.8 0 .2-.1.5-.3.7l-.7.7zm-10 7c.2-.2.5-.3.8-.3.2 0 .5.1.7.3a1 1 0 0 1 0 1.4l-.8.8a1 1 0 0 1-.6.3 1 1 0 0 1-.8-.3 1 1 0 0 1-.3-.8c0-.2.1-.5.3-.6l.7-.8zM12 8a4 4 0 0 1 3.7 2.4 4 4 0 0 1 0 3.2A4 4 0 0 1 12 16a4 4 0 0 1-3.7-2.4 4 4 0 0 1 0-3.2A4 4 0 0 1 12 8zm0 6.5c.7 0 1.3-.2 1.8-.7.5-.5.7-1.1.7-1.8s-.2-1.3-.7-1.8c-.5-.5-1.1-.7-1.8-.7s-1.3.2-1.8.7c-.5.5-.7 1.1-.7 1.8s.2 1.3.7 1.8c.5.5 1.1.7 1.8.7z" id="shape"/></g></svg>',"icon-browse":'<svg width="24" height="24"><g id="icon-browse" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-4v-2h4V8H5v10h4v2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14zm-8 9.4l-2.3 2.3a1 1 0 1 1-1.4-1.4l4-4a1 1 0 0 1 1.4 0l4 4a1 1 0 0 1-1.4 1.4L13 13.4V20a1 1 0 0 1-2 0v-6.6z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-cancel":'<svg width="24" height="24"><g id="icon-cancel" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M12 4.6a7.4 7.4 0 1 1 0 14.8 7.4 7.4 0 0 1 0-14.8zM12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zm0 8L14.8 8l1 1.1-2.7 2.8 2.7 2.7-1.1 1.1-2.7-2.7-2.7 2.7-1-1.1 2.6-2.7-2.7-2.7 1-1.1 2.8 2.7z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>',"icon-character-count":'<svg width="24" height="24"><g id="icon-character-count" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M4 11.5h16v1H4v-1zm4.8-6.8V10H7.7V5.8h-1v-1h2zM11 8.3V9h2v1h-3V7.7l2-1v-.9h-2v-1h3v2.4l-2 1zm6.3-3.4V10h-3.1V9h2.1V8h-2.1V6.8h2.1v-1h-2.1v-1h3.1zM5.8 16.4c0-.5.2-.8.5-1 .2-.2.6-.3 1.2-.3l.8.1c.2 0 .4.2.5.3l.4.4v2.8l.2.3H8.2v-.1-.2l-.6.3H7c-.4 0-.7 0-1-.2a1 1 0 0 1-.3-.9c0-.3 0-.6.3-.8.3-.2.7-.4 1.2-.4l.6-.2h.3v-.2l-.1-.2a.8.8 0 0 0-.5-.1 1 1 0 0 0-.4 0l-.3.4h-1zm2.3.8h-.2l-.2.1-.4.1a1 1 0 0 0-.4.2l-.2.2.1.3.5.1h.4l.4-.4v-.6zm2-3.4h1.2v1.7l.5-.3h.5c.5 0 .9.1 1.2.5.3.4.5.8.5 1.4 0 .6-.2 1.1-.5 1.5-.3.4-.7.6-1.3.6l-.6-.1-.4-.4v.4h-1.1v-5.4zm1.1 3.3c0 .3 0 .6.2.8a.7.7 0 0 0 1.2 0l.2-.8c0-.4 0-.6-.2-.8a.7.7 0 0 0-.6-.3l-.6.3-.2.8zm6.1-.5c0-.2 0-.3-.2-.4a.8.8 0 0 0-.5-.2c-.3 0-.5.1-.6.3l-.2.9c0 .3 0 .6.2.8.1.2.3.3.6.3.2 0 .4 0 .5-.2l.2-.4h1.1c0 .5-.3.8-.6 1.1a2 2 0 0 1-1.3.4c-.5 0-1-.2-1.3-.6a2 2 0 0 1-.5-1.4c0-.6.1-1.1.5-1.5.3-.4.8-.5 1.4-.5.5 0 1 0 1.2.3.4.3.5.7.5 1.2h-1v-.1z" id="shape"/></g></svg>',"icon-checkmark":'<svg width="24" height="24"><g id="icon-checkmark" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M18.2 5.4a1 1 0 0 1 1.6 1.2l-8 12a1 1 0 0 1-1.5.1l-5-5a1 1 0 1 1 1.4-1.4l4.1 4.1 7.4-11z" id="Shape-Copy" fill-rule="nonzero"/></g></svg>',"icon-chevron-down":'<svg width="10" height="10"><g id="icon-chevron-down" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M8.7 2.2c.3-.3.8-.3 1 0 .4.4.4.9 0 1.2L5.7 7.8c-.3.3-.9.3-1.2 0L.2 3.4a.8.8 0 0 1 0-1.2c.3-.3.8-.3 1.1 0L5 6l3.7-3.8z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-chevron-left":'<svg width="10" height="10"><g id="icon-chevron-left" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M7.8 1.3L4 5l3.8 3.7c.3.3.3.8 0 1-.4.4-.9.4-1.2 0L2.2 5.7a.8.8 0 0 1 0-1.2L6.6.2C7 0 7.4 0 7.8.2c.3.3.3.8 0 1.1z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-chevron-right":'<svg width="10" height="10"><g id="icon-chevron-right" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M2.2 1.3a.8.8 0 0 1 0-1c.4-.4.9-.4 1.2 0l4.4 4.1c.3.4.3.9 0 1.2L3.4 9.8c-.3.3-.8.3-1.2 0a.8.8 0 0 1 0-1.1L6 5 2.2 1.3z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-chevron-up":'<svg width="10" height="10"><g id="icon-chevron-up" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M8.7 7.8L5 4 1.3 7.8c-.3.3-.8.3-1 0a.8.8 0 0 1 0-1.2l4.1-4.4c.3-.3.9-.3 1.2 0l4.2 4.4c.3.3.3.9 0 1.2-.3.3-.8.3-1.1 0z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-close":'<svg width="24" height="24"><g id="icon-close" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M17.3 8.2L13.4 12l3.9 3.8a1 1 0 0 1-1.5 1.5L12 13.4l-3.8 3.9a1 1 0 0 1-1.5-1.5l3.9-3.8-3.9-3.8a1 1 0 0 1 1.5-1.5l3.8 3.9 3.8-3.9a1 1 0 0 1 1.5 1.5z" id="shape"/></g></svg>',"icon-code-sample":'<svg width="24" height="26"><g id="icon-code-sample" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M7.1 11a2.8 2.8 0 0 1-.8 2 2.8 2.8 0 0 1 .8 2v1.7c0 .3.1.6.4.8.2.3.5.4.8.4.3 0 .4.2.4.4v.8c0 .2-.1.4-.4.4-.7 0-1.4-.3-2-.8-.5-.6-.8-1.3-.8-2V15c0-.3-.1-.6-.4-.8-.2-.3-.5-.4-.8-.4a.4.4 0 0 1-.4-.4v-.8c0-.2.2-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V9.3c0-.7.3-1.4.8-2 .6-.5 1.3-.8 2-.8.3 0 .4.2.4.4v.8c0 .2-.1.4-.4.4-.3 0-.6.1-.8.4-.3.2-.4.5-.4.8V11zm9.8 0V9.3c0-.3-.1-.6-.4-.8-.2-.3-.5-.4-.8-.4a.4.4 0 0 1-.4-.4V7c0-.2.1-.4.4-.4.7 0 1.4.3 2 .8.5.6.8 1.3.8 2V11c0 .3.1.6.4.8.2.3.5.4.8.4.2 0 .4.2.4.4v.8c0 .2-.2.4-.4.4-.3 0-.6.1-.8.4-.3.2-.4.5-.4.8v1.7c0 .7-.3 1.4-.8 2-.6.5-1.3.8-2 .8a.4.4 0 0 1-.4-.4v-.8c0-.2.1-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V15a2.8 2.8 0 0 1 .8-2 2.8 2.8 0 0 1-.8-2zm-3.3-.4c0 .4-.1.8-.5 1.1-.3.3-.7.5-1.1.5-.4 0-.8-.2-1.1-.5-.4-.3-.5-.7-.5-1.1 0-.5.1-.9.5-1.2.3-.3.7-.4 1.1-.4.4 0 .8.1 1.1.4.4.3.5.7.5 1.2zM12 13c.4 0 .8.1 1.1.5.4.3.5.7.5 1.1 0 1-.1 1.6-.5 2a3 3 0 0 1-1.1 1c-.4.3-.8.4-1.1.4a.5.5 0 0 1-.5-.5V17a3 3 0 0 0 1-.2l.6-.6c-.6 0-1-.2-1.3-.5-.2-.3-.3-.7-.3-1 0-.5.1-1 .5-1.2.3-.4.7-.5 1.1-.5z" id="shape"/></g></svg>',"icon-color-levels":'<svg width="24" height="24"><g id="icon-color-levels" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M17.5 11.4A9 9 0 0 1 18 14c0 .5 0 1-.2 1.4 0 .4-.3.9-.5 1.3a6.2 6.2 0 0 1-3.7 3 5.7 5.7 0 0 1-3.2 0A5.9 5.9 0 0 1 7.6 18a6.2 6.2 0 0 1-1.4-2.6 6.7 6.7 0 0 1 0-2.8c0-.4.1-.9.3-1.3a13.6 13.6 0 0 1 2.3-4A20 20 0 0 1 12 4a26.4 26.4 0 0 1 3.2 3.4 18.2 18.2 0 0 1 2.3 4zm-2 4.5c.4-.7.5-1.4.5-2a7.3 7.3 0 0 0-1-3.2c.2.6.2 1.2.2 1.9a4.5 4.5 0 0 1-1.3 3 5.3 5.3 0 0 1-2.3 1.5 4.9 4.9 0 0 1-2 .1 4.3 4.3 0 0 0 2.4.8 4 4 0 0 0 2-.6 4 4 0 0 0 1.5-1.5z" id="shape"/></g></svg>',"icon-color-picker":'<svg width="24" height="24"><g id="icon-color-picker" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M12 3a9 9 0 0 0 0 18 1.5 1.5 0 0 0 1.1-2.5c-.2-.3-.4-.6-.4-1 0-.8.7-1.5 1.5-1.5H16a5 5 0 0 0 5-5c0-4.4-4-8-9-8zm-5.5 9a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm3-4a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm3 4a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-color-swatch":'<svg width="24" height="24"><g id="icon-color-swatch" stroke="none" stroke-width="1" fill-rule="evenodd"><rect id="Rectangle" x="3" y="3" width="18" height="18" rx="1"/></g></svg>',"icon-comment":'<svg width="24" height="24"><g id="icon-comment" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M9 19l3-2h7c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H5a1 1 0 0 0-1 1v10c0 .6.4 1 1 1h4v2zm-2 4v-4H5a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h14a3 3 0 0 1 3 3v10a3 3 0 0 1-3 3h-6.4L7 23z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-contrast":'<svg width="24" height="24"><g id="icon-contrast" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M12 4a7.8 7.8 0 0 1 5.7 2.3A8 8 0 1 1 12 4zm-6 8a6 6 0 0 0 6 6V6a6 6 0 0 0-6 6z" id="shape"/></g></svg>',"icon-copy":'<svg width="24" height="24"><g id="icon-copy" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M16 3H6a2 2 0 0 0-2 2v11h2V5h10V3zm1 4a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2V9c0-1.2.9-2 2-2h7zm0 12V9h-7v10h7z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>',"icon-crop":'<svg width="24" height="24"><g id="icon-crop" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M17 8v7h2c.6 0 1 .4 1 1s-.4 1-1 1h-2v2c0 .6-.4 1-1 1a1 1 0 0 1-1-1v-2H7V9H5a1 1 0 1 1 0-2h2V5c0-.6.4-1 1-1s1 .4 1 1v2h7l3-3 1 1-3 3zM9 9v5l5-5H9zm1 6h5v-5l-5 5z" id="shape"/></g></svg>',"icon-cut":'<svg width="24" height="24"><g id="icon-cut" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M18 15c.6.7 1 1.4 1 2.3 0 .8-.2 1.5-.7 2l-.8.5-1 .2c-.4 0-.8 0-1.2-.3a3.9 3.9 0 0 1-2.1-2.2c-.2-.5-.3-1-.2-1.5l-1-1-1 1c0 .5 0 1-.2 1.5-.1.5-.4 1-.9 1.4-.3.4-.7.6-1.2.8l-1.2.3c-.4 0-.7 0-1-.2-.3 0-.6-.3-.8-.5-.5-.5-.8-1.2-.7-2 0-.9.4-1.6 1-2.2A3.7 3.7 0 0 1 8.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 0 1 0-2c0-.4.3-.7.5-1l6 6 6-6 .5 1a3.3 3.3 0 0 1 0 2c0 .4-.3.7-.5 1l-4 4 1 1h.5c.4 0 .8 0 1.2.3.5.2.9.4 1.2.8zm-8.5 2.2l.1-.4v-.3-.4a1 1 0 0 0-.2-.5 1 1 0 0 0-.4-.2 1.6 1.6 0 0 0-.8 0 2.6 2.6 0 0 0-.8.3 2.5 2.5 0 0 0-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 0 0 .8-.3 2.8 2.8 0 0 0 1-1zm2.5-2.8c.4 0 .7-.1 1-.4.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4s-.7.1-1 .4c-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4zm5.4 4l.2-.5v-.4-.3a2.6 2.6 0 0 0-.3-.8 2.4 2.4 0 0 0-.7-.7 2.5 2.5 0 0 0-.8-.3 1.5 1.5 0 0 0-.8 0 1 1 0 0 0-.4.2 1 1 0 0 0-.2.5 1.5 1.5 0 0 0 0 .7v.4l.3.4.3.4a2.8 2.8 0 0 0 .8.5l.4.1h.7l.5-.2z" id="shape"/></g></svg>',"icon-document-properties":'<svg width="24" height="24"><g id="icon-document-properties" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M14.4 3H7a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h10a2 2 0 0 0 2-2V7.6L14.4 3zM17 19H7V5h6v4h4v10z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-drag":'<svg width="24" height="24"><g id="icon-drag" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M13 5h2v2h-2V5zm0 4h2v2h-2V9zM9 9h2v2H9V9zm4 4h2v2h-2v-2zm-4 0h2v2H9v-2zm0 4h2v2H9v-2zm4 0h2v2h-2v-2zM9 5h2v2H9V5z" id="shape"/></g></svg>',"icon-duplicate":'<svg width="24" height="24"><g id="icon-duplicate" stroke="none" stroke-width="1" fill-rule="nonzero"><path d="M16 3v2H6v11H4V5c0-1.1.9-2 2-2h10zm3 8h-2V9h-7v10h9a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2V9c0-1.2.9-2 2-2h7a2 2 0 0 1 2 2v2z" id="Combined-Shape"/><path d="M17 14h1a1 1 0 0 1 0 2h-1v1a1 1 0 0 1-2 0v-1h-1a1 1 0 0 1 0-2h1v-1a1 1 0 0 1 2 0v1z" id="Combined-Shape"/></g></svg>',"icon-edit-image":'<svg width="24" height="24"><g id="icon-edit-image" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M18 16h2V7a2 2 0 0 0-2-2H7v2h11v9zM6 17h15a1 1 0 0 1 0 2h-1v1a1 1 0 0 1-2 0v-1H6a2 2 0 0 1-2-2V7H3a1 1 0 1 1 0-2h1V4a1 1 0 1 1 2 0v13zm3-5.3l1.3 2 3-4.7 3.7 6H7l2-3.3z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-embed":'<svg width="24" height="24"><g id="icon-embed" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1zm1 2v14h14V5H5zm4.8 2.6l5.6 4a.5.5 0 0 1 0 .8l-5.6 4A.5.5 0 0 1 9 16V8a.5.5 0 0 1 .8-.4z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>',"icon-emoji":'<svg width="24" height="24"><g id="icon-emoji" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M9 11c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 0 0-1 1c0 .6.4 1 1 1zm6 0c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 0 0-1 1c0 .6.4 1 1 1zm-3 5.5c2.1 0 4-1.5 4.4-3.5H7.6c.5 2 2.3 3.5 4.4 3.5zM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16zm0 14.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-fill":'<svg width="24" height="26"><g id="icon-fill" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M16.6 12l-9-9-1.4 1.4 2.4 2.4-5.2 5.1c-.5.6-.5 1.6 0 2.2L9 19.6a1.5 1.5 0 0 0 2.2 0l5.5-5.5c.5-.6.5-1.6 0-2.2zM5.2 13L10 8.2l4.8 4.8H5.2zM19 14.5s-2 2.2-2 3.5c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.3-2-3.5-2-3.5z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-flip-horizontally":'<svg width="24" height="24"><g id="icon-flip-horizontally" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M14 19h2v-2h-2v2zm4-8h2V9h-2v2zM4 7v10c0 1.1.9 2 2 2h3v-2H6V7h3V5H6a2 2 0 0 0-2 2zm14-2v2h2a2 2 0 0 0-2-2zm-7 16h2V3h-2v18zm7-6h2v-2h-2v2zm-4-8h2V5h-2v2zm4 12a2 2 0 0 0 2-2h-2v2z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-flip-vertically":'<svg width="24" height="24"><g id="icon-flip-vertically" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M14 19h2v-2h-2v2zm4-8h2V9h-2v2zM4 7v10c0 1.1.9 2 2 2h3v-2H6V7h3V5H6a2 2 0 0 0-2 2zm14-2v2h2a2 2 0 0 0-2-2zm-7 16h2V3h-2v18zm7-6h2v-2h-2v2zm-4-8h2V5h-2v2zm4 12a2 2 0 0 0 2-2h-2v2z" id="Shape" fill-rule="nonzero" transform="rotate(90 12 12)"/></g></svg>',"icon-format-painter-cursor":'<svg width="24" height="24"><g id="icon-format-painter-cursor" stroke="none" stroke-width="1" fill-rule="nonzero"><path d="M15 6c0-.5-.4-1-1-1H6a1 1 0 0 0-1 1v4c0 .6.5 1 1 1h8c.6 0 1-.4 1-1V9h1v3H9v7c0 .6.4 1 1 1h1c.6 0 1-.4 1-1v-5h6V7h-3V6z" id="Shape"/><path d="M1 1h7.3c.4 0 .7.3.7.8 0 .4-.3.7-.8.7H2.5v5.8c0 .4-.3.7-.8.7a.8.8 0 0 1-.7-.8V1z" id="Path"/></g></svg>',"icon-format-painter":'<svg width="24" height="24"><g id="icon-format-painter" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M18 5V4c0-.5-.4-1-1-1H5a1 1 0 0 0-1 1v4c0 .6.5 1 1 1h12c.6 0 1-.4 1-1V7h1v4H9v9c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-7h8V5h-3z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-fullscreen":'<svg width="24" height="24"><g id="icon-fullscreen" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M15.3 10l-1.2-1.3 2.9-3h-2.3a.9.9 0 1 1 0-1.7H19c.5 0 .9.4.9.9v4.4a.9.9 0 1 1-1.8 0V7l-2.9 3zm0 4l3 3v-2.3a.9.9 0 1 1 1.7 0V19c0 .5-.4.9-.9.9h-4.4a.9.9 0 1 1 0-1.8H17l-3-2.9 1.3-1.2zM10 15.4l-2.9 3h2.3a.9.9 0 1 1 0 1.7H5a.9.9 0 0 1-.9-.9v-4.4a.9.9 0 1 1 1.8 0V17l2.9-3 1.2 1.3zM8.7 10L5.7 7v2.3a.9.9 0 0 1-1.7 0V5c0-.5.4-.9.9-.9h4.4a.9.9 0 0 1 0 1.8H7l3 2.9-1.3 1.2z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-gamma":'<svg width="24" height="24"><g id="icon-gamma" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1zm1 2v14h14V5H5zm6.5 11.8V14L9.2 8.7a5.1 5.1 0 0 0-.4-.8l-.1-.2H8 8v-1l.3-.1.3-.1h.7a1 1 0 0 1 .6.5l.1.3a8.5 8.5 0 0 1 .3.6l1.9 4.6 2-5.2a1 1 0 0 1 1-.6.5.5 0 0 1 .5.6L13 14v2.8a.7.7 0 0 1-1.4 0z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>',"icon-help":'<svg width="24" height="24"><g id="icon-help" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M12 5.5a6.5 6.5 0 0 0-6 9 6.3 6.3 0 0 0 1.4 2l1 1a6.3 6.3 0 0 0 3.6 1 6.5 6.5 0 0 0 6-9 6.3 6.3 0 0 0-1.4-2l-1-1a6.3 6.3 0 0 0-3.6-1zM12 4a7.8 7.8 0 0 1 5.7 2.3A8 8 0 1 1 12 4z" id="shape"/><path d="M9.6 9.7a.7.7 0 0 1-.7-.8c0-1.1 1.5-1.8 3.2-1.8 1.8 0 3.2.8 3.2 2.4 0 1.4-.4 2.1-1.5 2.8-.2 0-.3.1-.3.2a2 2 0 0 0-.8.8.8.8 0 0 1-1.4-.6c.3-.7.8-1 1.3-1.5l.4-.2c.7-.4.8-.6.8-1.5 0-.5-.6-.9-1.7-.9-.5 0-1 .1-1.4.3-.2 0-.3.1-.3.2v-.2c0 .4-.4.8-.8.8z" id="Path-2" fill-rule="nonzero"/><circle id="Oval" cx="12" cy="16" r="1"/></g></svg>',"icon-highlight-bg-color":'<svg width="24" height="24"><g id="icon-highlight-bg-color" stroke="none" stroke-width="1" fill-rule="evenodd"><path id="color" d="M3 18h18v3H3z"/><path d="M7.7 16.7H3l3.3-3.3-.7-.8L10.2 8l4 4.1-4 4.2c-.2.2-.6.2-.8 0l-.6-.7-1.1 1.1zM12.8 9.2L11 7.4l3-2.9a2 2 0 0 1 2.6 0L18 6c.7.7.7 2 0 2.7l-2.9 2.9-1.8-1.8-.5-.6" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-home":'<svg width="24" height="24"><g id="icon-home" stroke="none" stroke-width="1" fill-rule="evenodd"><path id="Shape" fill-rule="nonzero" d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></g></svg>',"icon-horizontal-rule":'<svg width="24" height="24"><g id="icon-horizontal-rule" stroke="none" stroke-width="1" fill-rule="evenodd"><path id="shape" d="M4 11h16v2H4z"/></g></svg>',"icon-image-options":'<svg width="24" height="24"><g id="icon-image-options" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M6 10a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2zm12 0a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2zm-6 0a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-image":'<svg width="24" height="24"><g id="icon-image" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M5 15.7l3.3-3.2c.3-.3.7-.3 1 0L12 15l4.1-4c.3-.4.8-.4 1 0l2 1.9V5H5v10.7zM5 18V19h3l2.8-2.9-2-2L5 17.9zm14-3l-2.5-2.4-6.4 6.5H19v-4zM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1zm6 8a2 2 0 1 0 0-4 2 2 0 0 0 0 4z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>',"icon-indent":'<svg width="24" height="24"><g id="icon-indent" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M7 5h12c.6 0 1 .4 1 1s-.4 1-1 1H7a1 1 0 1 1 0-2zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2zm-5 4h12a1 1 0 0 1 0 2H7a1 1 0 0 1 0-2zm-2.6-3.8L6.2 12l-1.8-1.2a1 1 0 0 1 1.2-1.6l3 2a1 1 0 0 1 0 1.6l-3 2a1 1 0 1 1-1.2-1.6z" id="Combined-Shape"/></g></svg>',"icon-indeterminate":'<svg width="24" height="24"><g id="icon-indeterminate" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM9 11a1 1 0 0 0 0 2h6a1 1 0 0 0 0-2H9z" id="Combined-Shape"/></g></svg>',"icon-info":'<svg width="24" height="24"><g id="icon-info" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M12 4a7.8 7.8 0 0 1 5.7 2.3A8 8 0 1 1 12 4zm-1 3v2h2V7h-2zm3 10v-1h-1v-5h-3v1h1v4h-1v1h4z" id="shape"/></g></svg>',"icon-insert-character":'<svg width="24" height="24"><g id="icon-insert-character" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M15 18h4l1-2v4h-6v-3.3l1.4-1a6 6 0 0 0 1.8-2.9 6.3 6.3 0 0 0-.1-4.1 5.8 5.8 0 0 0-3-3.2c-.6-.3-1.3-.5-2.1-.5a5.1 5.1 0 0 0-3.9 1.8 6.3 6.3 0 0 0-1.3 6 6.2 6.2 0 0 0 1.8 3l1.4.9V20H4v-4l1 2h4v-.5l-2-1L5.4 15A6.5 6.5 0 0 1 4 11c0-1 .2-1.9.6-2.7A7 7 0 0 1 6.3 6C7.1 5.4 8 5 9 4.5c1-.3 2-.5 3.1-.5a8.8 8.8 0 0 1 5.7 2 7 7 0 0 1 1.7 2.3 6 6 0 0 1 .2 4.8c-.2.7-.6 1.3-1 1.9a7.6 7.6 0 0 1-3.6 2.5v.5z" id="shape"/></g></svg>',"icon-insert-time":'<svg width="24" height="24"><g id="icon-insert-time" stroke="none" stroke-width="1" fill-rule="evenodd"><g id="clock" transform="translate(2 2)" fill-rule="nonzero"><path d="M17 0H3a3 3 0 0 0-3 3v14a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V3a3 3 0 0 0-3-3zm-7 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16z" id="Shape"/><path d="M13 10h-3V5a.5.5 0 0 0-1 0v6h4a.5.5 0 0 0 0-1z" id="Shape"/></g></g></svg>',"icon-invert":'<svg width="24" height="24"><g id="icon-invert" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M18 19.3L16.5 18a5.8 5.8 0 0 1-3.1 1.9 6.1 6.1 0 0 1-5.5-1.6A5.8 5.8 0 0 1 6 14v-.3l.1-1.2A13.9 13.9 0 0 1 7.7 9l-3-3 .7-.8 2.8 2.9 9 8.9 1.5 1.6-.7.6zm0-5.5v.3l-.1 1.1-.4 1-1.2-1.2a4.3 4.3 0 0 0 .2-1v-.2c0-.4 0-.8-.2-1.3l-.5-1.4a14.8 14.8 0 0 0-3-4.2L12 6a26.1 26.1 0 0 0-2.2 2.5l-1-1a20.9 20.9 0 0 1 2.9-3.3L12 4l1 .8a22.2 22.2 0 0 1 4 5.4c.6 1.2 1 2.4 1 3.6z" id="shape"/></g></svg>',"icon-italic":'<svg width="24" height="24"><g id="icon-italic" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M16.7 4.7l-.1.9h-.3c-.6 0-1 0-1.4.3-.3.3-.4.6-.5 1.1l-2.1 9.8v.6c0 .5.4.8 1.4.8h.2l-.2.8H8l.2-.8h.2c1.1 0 1.8-.5 2-1.5l2-9.8.1-.5c0-.6-.4-.8-1.4-.8h-.3l.2-.9h5.8z" id="I"/></g></svg>',"icon-line":'<svg width="24" height="24"><g id="icon-line" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M15 9l-8 8H4v-3l8-8 3 3zm1-1l-3-3 1-1h1c-.2 0 0 0 0 0l2 2s0 .2 0 0v1l-1 1zM4 18h16v2H4v-2z" id="shape"/></g></svg>',"icon-link":'<svg width="24" height="24"><g id="icon-link" stroke="none" stroke-width="1" fill-rule="evenodd"><g id="link" transform="translate(3 3)" fill-rule="nonzero"><path d="M3.2 9.3a1 1 0 0 1 1.4 1.4l-2 2a2 2 0 1 0 2.6 2.8l4.8-4.8a1 1 0 0 0 0-1.4A1 1 0 1 1 11.4 8a2.9 2.9 0 0 1 0 4L6.6 17a3.9 3.9 0 0 1-5.5-5.5l2-2zm11.6-.6a1 1 0 0 1-1.4-1.4l2-2a2 2 0 1 0-2.6-2.8L8 7.3a1 1 0 0 0 0 1.4A1 1 0 1 1 6.6 10a2.9 2.9 0 0 1 0-4L11.4 1a3.9 3.9 0 0 1 5.5 5.5l-2 2z" id="Shape"/></g></g></svg>',"icon-list-bull-circle":'<svg width="48" height="48"><g id="icon-list-bull-circle" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M11 16a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm0 1a3 3 0 1 1 0-6 3 3 0 0 1 0 6z" id="Oval" fill-rule="nonzero"/><path d="M11 26a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm0 1a3 3 0 1 1 0-6 3 3 0 0 1 0 6z" id="Oval-Copy" fill-rule="nonzero"/><path d="M11 36a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm0 1a3 3 0 1 1 0-6 3 3 0 0 1 0 6z" id="Oval-Copy-2" fill-rule="nonzero"/><path id="Rectangle-2" opacity=".2" d="M18 12h22v4H18z"/><path id="Rectangle-2-Copy" opacity=".2" d="M18 22h22v4H18z"/><path id="Rectangle-2-Copy-2" opacity=".2" d="M18 32h22v4H18z"/></g></svg>',"icon-list-bull-default":'<svg width="48" height="48"><g id="icon-list-bull-default" stroke="none" stroke-width="1" fill-rule="evenodd"><circle id="Oval" cx="11" cy="14" r="3"/><circle id="Oval-Copy" cx="11" cy="24" r="3"/><circle id="Oval-Copy-2" cx="11" cy="34" r="3"/><path id="Rectangle-2" opacity=".2" d="M18 12h22v4H18z"/><path id="Rectangle-2-Copy" opacity=".2" d="M18 22h22v4H18z"/><path id="Rectangle-2-Copy-2" opacity=".2" d="M18 32h22v4H18z"/></g></svg>',"icon-list-bull-square":'<svg width="48" height="48"><g id="icon-list-bull-square" stroke="none" stroke-width="1" fill-rule="evenodd"><path id="Rectangle" d="M8 11h6v6H8z"/><path id="Rectangle-Copy" d="M8 21h6v6H8z"/><path id="Rectangle-Copy-2" d="M8 31h6v6H8z"/><path id="Rectangle-2" opacity=".2" d="M18 12h22v4H18z"/><path id="Rectangle-2-Copy" opacity=".2" d="M18 22h22v4H18z"/><path id="Rectangle-2-Copy-2" opacity=".2" d="M18 32h22v4H18z"/></g></svg>',"icon-list-num-default":'<svg width="48" height="48"><g id="icon-list-num-default" stroke="none" stroke-width="1" fill-rule="evenodd"><path id="Rectangle-2" opacity=".2" d="M18 12h22v4H18z"/><path id="Rectangle-2-Copy" opacity=".2" d="M18 22h22v4H18z"/><path id="Rectangle-2-Copy-2" opacity=".2" d="M18 32h22v4H18z"/><path d="M10 17v-4.8l-1.5 1v-1.1l1.6-1h1.2V17h-1.2zm3.6.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zm-5 5.7c0-1.2.8-2 2.1-2s2.1.8 2.1 1.8c0 .7-.3 1.2-1.4 2.2l-1.1 1v.2h2.6v1H8.6v-.9l2-1.9c.8-.8 1-1.1 1-1.5 0-.5-.4-.8-1-.8-.5 0-.9.3-.9.9H8.5zm6.3 4.3c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zM10 34.4v-1h.7c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7s-1 .3-1 .8H8.6c0-1.1 1-1.8 2.2-1.8 1.3 0 2.1.6 2.1 1.6 0 .7-.4 1.2-1 1.3v.1c.8.1 1.3.7 1.3 1.4 0 1-1 1.9-2.4 1.9-1.3 0-2.2-.8-2.3-2h1.2c0 .6.5 1 1.1 1 .7 0 1-.4 1-1 0-.5-.3-.8-1-.8h-.7zm4.7 2.7c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7z" id="1.-2.-3."/></g></svg>',"icon-list-num-lower-alpha":'<svg width="48" height="48"><g id="icon-list-num-lower-alpha" stroke="none" stroke-width="1" fill-rule="evenodd"><path id="Rectangle-2" opacity=".2" d="M18 12h22v4H18z"/><path id="Rectangle-2-Copy" opacity=".2" d="M18 22h22v4H18z"/><path id="Rectangle-2-Copy-2" opacity=".2" d="M18 32h22v4H18z"/><path d="M10.3 15.2c.5 0 1-.4 1-.9V14h-1c-.5.1-.8.3-.8.6 0 .4.3.6.8.6zm-.4.9c-1 0-1.5-.6-1.5-1.4 0-.8.6-1.3 1.7-1.4h1.1v-.4c0-.4-.2-.6-.7-.6-.5 0-.8.1-.9.4h-1c0-.8.8-1.4 2-1.4 1.1 0 1.8.6 1.8 1.6V16h-1.1v-.6h-.1c-.2.4-.7.7-1.3.7zm4.6 0c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm-3.2 10c-.6 0-1.2-.3-1.4-.8v.7H8.5v-6.3H10v2.5c.3-.5.8-.9 1.4-.9 1.2 0 1.9 1 1.9 2.4 0 1.5-.7 2.4-1.9 2.4zm-.4-3.7c-.7 0-1 .5-1 1.3s.3 1.4 1 1.4c.6 0 1-.6 1-1.4 0-.8-.4-1.3-1-1.3zm4 3.7c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm-2.2 7h-1.2c0-.5-.4-.8-.9-.8-.6 0-1 .5-1 1.4 0 1 .4 1.4 1 1.4.5 0 .8-.2 1-.7h1c0 1-.8 1.7-2 1.7-1.4 0-2.2-.9-2.2-2.4s.8-2.4 2.2-2.4c1.2 0 2 .7 2 1.7zm1.8 3c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z" id="a.-b.-c."/></g></svg>',"icon-list-num-lower-greek":'<svg width="48" height="48"><g id="icon-list-num-lower-greek" stroke="none" stroke-width="1" fill-rule="evenodd"><path id="Rectangle-2" opacity=".2" d="M18 12h22v4H18z"/><path id="Rectangle-2-Copy" opacity=".2" d="M18 22h22v4H18z"/><path id="Rectangle-2-Copy-2" opacity=".2" d="M18 32h22v4H18z"/><path d="M10.5 15c.7 0 1-.5 1-1.3s-.3-1.3-1-1.3c-.5 0-.9.5-.9 1.3s.4 1.4 1 1.4zm-.3 1c-1.1 0-1.8-.8-1.8-2.3 0-1.5.7-2.4 1.8-2.4.7 0 1.1.4 1.3 1h.1v-.9h1.2v3.2c0 .4.1.5.4.5h.2v.9h-.6c-.6 0-1-.2-1.1-.7h-.1c-.2.4-.7.8-1.4.8zm5 .1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7zm-4.9 7v-1h.3c.6 0 1-.2 1-.7 0-.5-.4-.8-1-.8-.5 0-.8.3-.8 1v2.2c0 .8.4 1.3 1.1 1.3.6 0 1-.4 1-1s-.5-1-1.3-1h-.3zM8.6 22c0-1.5.7-2.3 2-2.3 1.2 0 2 .6 2 1.6 0 .6-.3 1-.8 1.3.8.3 1.3.8 1.3 1.7 0 1.2-.8 1.9-1.9 1.9-.6 0-1.1-.3-1.3-.8v2.2H8.5V22zm6.2 4.2c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zm-4.5 8.5L8 30h1.4l1.7 3.5 1.7-3.5h1.1l-2.2 4.6v.1c.5.8.7 1.4.7 1.8 0 .4-.1.8-.4 1-.2.2-.6.3-1 .3-.9 0-1.3-.4-1.3-1.2 0-.5.2-1 .5-1.7l.1-.2zm.7 1a2 2 0 0 0-.4.9c0 .3.1.4.4.4.3 0 .4-.1.4-.4 0-.2-.1-.6-.4-1zm4.5.5c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z" id="\u03b1.-\u03b2.-\u0194."/></g></svg>',"icon-list-num-lower-roman":'<svg width="48" height="48"><g id="icon-list-num-lower-roman" stroke="none" stroke-width="1" fill-rule="evenodd"><path id="Rectangle-2" opacity=".2" d="M18 12h22v4H18z"/><path id="Rectangle-2-Copy" opacity=".2" d="M18 22h22v4H18z"/><path id="Rectangle-2-Copy-2" opacity=".2" d="M18 32h22v4H18z"/><path d="M15.1 16v-1.2h1.3V16H15zm0 10v-1.2h1.3V26H15zm0 10v-1.2h1.3V36H15z" id=".-.-."/><path id="Rectangle" fill-rule="nonzero" d="M12 21h1.5v5H12z"/><path id="Rectangle-Copy-6" fill-rule="nonzero" d="M12 31h1.5v5H12z"/><path id="Rectangle-Copy-2" fill-rule="nonzero" d="M9 21h1.5v5H9z"/><path id="Rectangle-Copy-7" fill-rule="nonzero" d="M9 31h1.5v5H9z"/><path id="Rectangle-Copy-10" fill-rule="nonzero" d="M6 31h1.5v5H6z"/><path id="Rectangle-Copy-4" fill-rule="nonzero" d="M12 11h1.5v5H12z"/><path id="Rectangle-Copy" fill-rule="nonzero" d="M12 19h1.5v1H12z"/><path id="Rectangle-Copy-8" fill-rule="nonzero" d="M12 29h1.5v1H12z"/><path id="Rectangle-Copy-3" fill-rule="nonzero" d="M9 19h1.5v1H9z"/><path id="Rectangle-Copy-9" fill-rule="nonzero" d="M9 29h1.5v1H9z"/><path id="Rectangle-Copy-11" fill-rule="nonzero" d="M6 29h1.5v1H6z"/><path id="Rectangle-Copy-5" fill-rule="nonzero" d="M12 9h1.5v1H12z"/></g></svg>',"icon-list-num-upper-alpha":'<svg width="48" height="48"><g id="icon-list-num-upper-alpha" stroke="none" stroke-width="1" fill-rule="evenodd"><path id="Rectangle-2" opacity=".2" d="M18 12h22v4H18z"/><path id="Rectangle-2-Copy" opacity=".2" d="M18 22h22v4H18z"/><path id="Rectangle-2-Copy-2" opacity=".2" d="M18 32h22v4H18z"/><path d="M12.6 17l-.5-1.4h-2L9.5 17H8.3l2-6H12l2 6h-1.3zM11 12.3l-.7 2.3h1.6l-.8-2.3zm4.7 4.8c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zM11.4 27H8.7v-6h2.6c1.2 0 1.9.6 1.9 1.5 0 .6-.5 1.2-1 1.3.7.1 1.3.7 1.3 1.5 0 1-.8 1.7-2 1.7zM10 22v1.5h1c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7h-1zm0 4H11c.7 0 1.1-.3 1.1-.8 0-.6-.4-.9-1.1-.9H10V26zm5.4 1.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm-4.1 10c-1.8 0-2.8-1.1-2.8-3.1s1-3.1 2.8-3.1c1.4 0 2.5.9 2.6 2.2h-1.3c0-.7-.6-1.1-1.3-1.1-1 0-1.6.7-1.6 2s.6 2 1.6 2c.7 0 1.2-.4 1.4-1h1.2c-.1 1.3-1.2 2.2-2.6 2.2zm4.5 0c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z" id="A.-B.-C."/></g></svg>',"icon-list-num-upper-roman":'<svg width="48" height="48"><g id="icon-list-num-upper-roman" stroke="none" stroke-width="1" fill-rule="evenodd"><path id="Rectangle-2" opacity=".2" d="M18 12h22v4H18z"/><path id="Rectangle-2-Copy" opacity=".2" d="M18 22h22v4H18z"/><path id="Rectangle-2-Copy-2" opacity=".2" d="M18 32h22v4H18z"/><path d="M15.1 17v-1.2h1.3V17H15zm0 10v-1.2h1.3V27H15zm0 10v-1.2h1.3V37H15z" id=".-.-."/><path id="Rectangle" fill-rule="nonzero" d="M12 20h1.5v7H12z"/><path id="Rectangle-Copy-6" fill-rule="nonzero" d="M12 30h1.5v7H12z"/><path id="Rectangle-Copy-2" fill-rule="nonzero" d="M9 20h1.5v7H9z"/><path id="Rectangle-Copy-7" fill-rule="nonzero" d="M9 30h1.5v7H9z"/><path id="Rectangle-Copy-10" fill-rule="nonzero" d="M6 30h1.5v7H6z"/><path id="Rectangle-Copy-4" fill-rule="nonzero" d="M12 10h1.5v7H12z"/></g></svg>',"icon-lock":'<svg width="24" height="24"><g id="icon-lock" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M16.3 11c.2 0 .3 0 .5.2l.2.6v7.4c0 .3 0 .4-.2.6l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6v-7.4c0-.3 0-.4.2-.6l.5-.2H8V8c0-.8.3-1.5.9-2.1.6-.6 1.3-.9 2.1-.9h2c.8 0 1.5.3 2.1.9.6.6.9 1.3.9 2.1v3h.3zM10 8v3h4V8a1 1 0 0 0-.3-.7A1 1 0 0 0 13 7h-2a1 1 0 0 0-.7.3 1 1 0 0 0-.3.7z" id="shape"/></g></svg>',"icon-ltr":'<svg width="24" height="24"><g id="icon-ltr" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M11 5h7a1 1 0 0 1 0 2h-1v11a1 1 0 0 1-2 0V7h-2v11a1 1 0 0 1-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 0 1 7.8 10a3.3 3.3 0 0 1 0-2.8 3.4 3.4 0 0 1 1.8-1.8L11 5zM4.4 16.2L6.2 15l-1.8-1.2a1 1 0 0 1 1.2-1.6l3 2a1 1 0 0 1 0 1.6l-3 2a1 1 0 1 1-1.2-1.6z" id="shape"/></g></svg>',"icon-new-document":'<svg width="24" height="24"><g id="icon-new-document" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M14.4 3H7a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h10a2 2 0 0 0 2-2V7.6L14.4 3zM17 19H7V5h6v4h4v10z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-new-tab":'<svg width="24" height="24"><g id="icon-new-tab" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M15 13l2-2v8H5V7h8l-2 2H7v8h8v-4zm4-8v5.5l-2-2-5.6 5.5H10v-1.4L15.5 7l-2-2H19z" id="shape"/></g></svg>',"icon-non-breaking":'<svg width="24" height="24"><g id="icon-non-breaking" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M11 11H8a1 1 0 1 1 0-2h3V6c0-.6.4-1 1-1s1 .4 1 1v3h3c.6 0 1 .4 1 1s-.4 1-1 1h-3v3c0 .6-.4 1-1 1a1 1 0 0 1-1-1v-3zm10 4v5H3v-5c0-.6.4-1 1-1s1 .4 1 1v3h14v-3c0-.6.4-1 1-1s1 .4 1 1z" id="shape"/></g></svg>',"icon-notice":'<svg width="24" height="24"><g id="icon-notice" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M17.8 9.8L15.4 4 20 8.5v7L15.5 20h-7L4 15.5v-7L8.5 4h7l2.3 5.8zm0 0l2.2 5.7-2.3-5.8zM13 17v-2h-2v2h2zm0-4V7h-2v6h2z" id="shape"/></g></svg>',"icon-ordered-list":'<svg width="24" height="24"><g id="icon-ordered-list" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M10 17h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 1 1 0-2zM6 4v3.5c0 .3-.2.5-.5.5a.5.5 0 0 1-.5-.5V5h-.5a.5.5 0 0 1 0-1H6zm-1 8.8l.2.2h1.3c.3 0 .5.2.5.5s-.2.5-.5.5H4.9a1 1 0 0 1-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 0 0-.2-.2H4.5a.5.5 0 0 1-.5-.5c0-.3.2-.5.5-.5h1.6c.5 0 .9.4.9 1v.1c0 .4-.3.8-.6 1l-1.2.4-.2.3zM7 17v2c0 .6-.4 1-1 1H4.5a.5.5 0 0 1 0-1h1.2c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.4a.4.4 0 1 1 0-.8h1.3c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.5a.5.5 0 1 1 0-1H6c.6 0 1 .4 1 1z" id="shape"/></g></svg>',"icon-orientation":'<svg width="24" height="24"><g id="icon-orientation" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M7.3 6.4L1 13l6.4 6.5 6.5-6.5-6.5-6.5zM3.7 13l3.6-3.7L11 13l-3.7 3.7-3.6-3.7zM12 6l2.8 2.7c.3.3.3.8 0 1-.3.4-.9.4-1.2 0L9.2 5.7a.8.8 0 0 1 0-1.2L13.6.2c.3-.3.9-.3 1.2 0 .3.3.3.8 0 1.1L12 4h1a9 9 0 1 1-4.3 16.9l1.5-1.5A7 7 0 1 0 13 6h-1z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-outdent":'<svg width="24" height="24"><g id="icon-outdent" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M7 5h12c.6 0 1 .4 1 1s-.4 1-1 1H7a1 1 0 1 1 0-2zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2zm-5 4h12a1 1 0 0 1 0 2H7a1 1 0 0 1 0-2zm1.6-3.8a1 1 0 0 1-1.2 1.6l-3-2a1 1 0 0 1 0-1.6l3-2a1 1 0 0 1 1.2 1.6L6.8 12l1.8 1.2z" id="Combined-Shape"/></g></svg>',"icon-page-break":'<svg width="24" height="24"><g id="icon-page-break" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M5 11c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1h-1a1 1 0 0 1 0-2zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2z" id="shape"/><path d="M7 3v5h10V3c0-.6.4-1 1-1s1 .4 1 1v7H5V3c0-.6.4-1 1-1s1 .4 1 1z" id="Combined-Shape"/><path d="M6 22a1 1 0 0 1-1-1v-7h14v7c0 .6-.4 1-1 1a1 1 0 0 1-1-1v-5H7v5c0 .6-.4 1-1 1z" id="Combined-Shape-Copy"/></g></svg>',"icon-paragraph":'<svg width="24" height="24"><g id="icon-paragraph" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M10 5h7a1 1 0 0 1 0 2h-1v11a1 1 0 0 1-2 0V7h-2v11a1 1 0 0 1-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 0 1 6.8 10a3.3 3.3 0 0 1 0-2.8 3.4 3.4 0 0 1 1.8-1.8L10 5z" id="shape"/></g></svg>',"icon-paste-text":'<svg width="24" height="24"><g id="icon-paste-text" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M18 9V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h3V9h9zM9 20H6a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0 1 12 1a3 3 0 0 1 2.8 2H18a2 2 0 0 1 2 2v4h1v12H9v-1zm1.5-9.5v9h9v-9h-9zM12 3a1 1 0 0 0-1 1c0 .5.4 1 1 1s1-.5 1-1-.4-1-1-1zm0 9h6v2h-.5l-.5-1h-1v4h.8v1h-3.6v-1h.8v-4h-1l-.5 1H12v-2z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>',"icon-paste":'<svg width="24" height="24"><g id="icon-paste" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M18 9V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h3V9h9zM9 20H6a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0 1 12 1a3 3 0 0 1 2.8 2H18a2 2 0 0 1 2 2v4h1v12H9v-1zm1.5-9.5v9h9v-9h-9zM12 3a1 1 0 0 0-1 1c0 .5.4 1 1 1s1-.5 1-1-.4-1-1-1z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>',"icon-plus":'<svg width="24" height="24"><g id="icon-plus" stroke="#000" stroke-width="2" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"><path d="M12 5v14M5 12h14" id="Shape"/></g></svg>',"icon-preferences":'<svg width="24" height="24"><g id="icon-preferences" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M20.1 13.5l-1.9.2a5.8 5.8 0 0 1-.6 1.5l1.2 1.5c.4.4.3 1 0 1.4l-.7.7a1 1 0 0 1-1.4 0l-1.5-1.2a6.2 6.2 0 0 1-1.5.6l-.2 1.9c0 .5-.5.9-1 .9h-1a1 1 0 0 1-1-.9l-.2-1.9a5.8 5.8 0 0 1-1.5-.6l-1.5 1.2a1 1 0 0 1-1.4 0l-.7-.7a1 1 0 0 1 0-1.4l1.2-1.5a6.2 6.2 0 0 1-.6-1.5l-1.9-.2a1 1 0 0 1-.9-1v-1c0-.5.4-1 .9-1l1.9-.2a5.8 5.8 0 0 1 .6-1.5L5.2 7.3a1 1 0 0 1 0-1.4l.7-.7a1 1 0 0 1 1.4 0l1.5 1.2a6.2 6.2 0 0 1 1.5-.6l.2-1.9c0-.5.5-.9 1-.9h1c.5 0 1 .4 1 .9l.2 1.9a5.8 5.8 0 0 1 1.5.6l1.5-1.2a1 1 0 0 1 1.4 0l.7.7c.3.4.4 1 0 1.4l-1.2 1.5a6.2 6.2 0 0 1 .6 1.5l1.9.2c.5 0 .9.5.9 1v1c0 .5-.4 1-.9 1zM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z" id="Combined-Shape"/></g></svg>',"icon-preview":'<svg width="24" height="24"><g id="icon-preview" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M3.5 12.5c.5.8 1.1 1.6 1.8 2.3 2 2 4.2 3.2 6.7 3.2s4.7-1.2 6.7-3.2a16.2 16.2 0 0 0 2.1-2.8 15.7 15.7 0 0 0-2.1-2.8c-2-2-4.2-3.2-6.7-3.2a9.3 9.3 0 0 0-6.7 3.2A16.2 16.2 0 0 0 3.2 12c0 .2.2.3.3.5zm-2.4-1l.7-1.2L4 7.8C6.2 5.4 8.9 4 12 4c3 0 5.8 1.4 8.1 3.8a18.2 18.2 0 0 1 2.8 3.7v1l-.7 1.2-2.1 2.5c-2.3 2.4-5 3.8-8.1 3.8-3 0-5.8-1.4-8.1-3.8a18.2 18.2 0 0 1-2.8-3.7 1 1 0 0 1 0-1zm12-3.3a2 2 0 1 0 2.7 2.6 4 4 0 1 1-2.6-2.6z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>',"icon-print":'<svg width="24" height="24"><g id="icon-print" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M18 8H6a3 3 0 0 0-3 3v6h2v3h14v-3h2v-6a3 3 0 0 0-3-3zm-1 10H7v-4h10v4zm.5-5c-.8 0-1.5-.7-1.5-1.5s.7-1.5 1.5-1.5 1.5.7 1.5 1.5-.7 1.5-1.5 1.5zm.5-8H6v2h12V5z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-quote":'<svg width="24" height="24"><g id="icon-quote" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M7.5 17h.9c.4 0 .7-.2.9-.6L11 13V8c0-.6-.4-1-1-1H6a1 1 0 0 0-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 0 0 .8 1.3zm8 0h.9c.4 0 .7-.2.9-.6L19 13V8c0-.6-.4-1-1-1h-4a1 1 0 0 0-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 0 0 .8 1.3z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-redo":'<svg width="24" height="24"><g id="icon-redo" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M17.6 10H12c-2.8 0-4.4 1.4-4.9 3.5-.4 2 .3 4 1.4 4.6a1 1 0 1 1-1 1.8c-2-1.2-2.9-4.1-2.3-6.8.6-3 3-5.1 6.8-5.1h5.6l-3.3-3.3a1 1 0 1 1 1.4-1.4l5 5a1 1 0 0 1 0 1.4l-5 5a1 1 0 0 1-1.4-1.4l3.3-3.3z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>',"icon-reload":'<svg width="24" height="24"><g id="icon-reload" stroke="none" stroke-width="1" fill-rule="evenodd"><g id="Group" transform="rotate(-45 13.2 13.2)" fill-rule="nonzero"><path d="M19.8 13.7l-2.4-4.2-.2-.2a1 1 0 0 0-1.5 0l-3.2 4a1 1 0 1 0 1.5 1.2l1.5-1.7a7.8 7.8 0 0 1-5.8 6c-2.5.6-5.1-.1-7-2a1 1 0 1 0-1.4 1.4 9.5 9.5 0 0 0 8.9 2.5 9.9 9.9 0 0 0 7.2-7.2l.7 1.2a1 1 0 1 0 1.7-1z" id="Shape" transform="matrix(-1 0 0 1 21 0)"/><path d="M13 9.4a1 1 0 0 0-1.4.1l-1.8 2a8 8 0 0 1 6-7.4c2.8-.5 5.6.4 7.5 2.4a1 1 0 0 0 1.5-1.3 9.5 9.5 0 0 0-9.3-3 10 10 0 0 0-7.5 8l-.6-1a1 1 0 0 0-1.7 1l2.6 4.3a1 1 0 0 0 1.6.1l3.2-3.8c.4-.4.3-1-.1-1.4z" id="Shape" transform="matrix(-1 0 0 1 30.6 0)"/></g></g></svg>',"icon-remove-formatting":'<svg width="24" height="24"><g id="icon-remove-formatting" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M13.2 6a1 1 0 0 1 0 .2l-2.6 10a1 1 0 0 1-1 .8h-.2a.8.8 0 0 1-.8-1l2.6-10H8a1 1 0 1 1 0-2h9a1 1 0 0 1 0 2h-3.8zM5 18h7a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2zm13 1.5L16.5 18 15 19.5a.7.7 0 0 1-1-1l1.5-1.5-1.5-1.5a.7.7 0 0 1 1-1l1.5 1.5 1.5-1.5a.7.7 0 0 1 1 1L17.5 17l1.5 1.5a.7.7 0 0 1-1 1z" id="shape"/></g></svg>',"icon-remove":'<svg width="24" height="24"><g id="icon-remove" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M16 7h3a1 1 0 0 1 0 2h-1v9a3 3 0 0 1-3 3H9a3 3 0 0 1-3-3V9H5a1 1 0 1 1 0-2h3V6a3 3 0 0 1 3-3h2a3 3 0 0 1 3 3v1zm-2 0V6c0-.6-.4-1-1-1h-2a1 1 0 0 0-1 1v1h4zm2 2H8v9c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V9zm-7 3a1 1 0 0 1 2 0v4a1 1 0 0 1-2 0v-4zm4 0a1 1 0 0 1 2 0v4a1 1 0 0 1-2 0v-4z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>',"icon-resize-handle":'<svg width="10" height="10"><g id="icon-resize-handle" stroke="none" stroke-width="1" fill-rule="nonzero"><path d="M8.1 1.1A.5.5 0 1 1 9 2l-7 7A.5.5 0 1 1 1 8l7-7z" id="Line"/><path d="M8.1 5.1A.5.5 0 1 1 9 6l-3 3A.5.5 0 1 1 5 8l3-3z" id="Line-2"/></g></svg>',"icon-resize":'<svg width="24" height="24"><g id="icon-resize" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M4 5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h6c.3 0 .5.1.7.3.2.2.3.4.3.7 0 .3-.1.5-.3.7a1 1 0 0 1-.7.3H7.4L18 16.6V13c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3.3 0 .5.1.7.3.2.2.3.4.3.7v6c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3h-6a1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3.6L6 7.4V11c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3 1 1 0 0 1-.7-.3A1 1 0 0 1 4 11V5z" id="shape"/></g></svg>',"icon-restore-draft":'<svg width="24" height="24"><g id="icon-restore-draft" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M17 13c0 .6-.4 1-1 1h-4V8c0-.6.4-1 1-1s1 .4 1 1v4h2c.6 0 1 .4 1 1z" id="shape"/><path d="M4.7 10H9a1 1 0 0 1 0 2H3a1 1 0 0 1-1-1V5a1 1 0 1 1 2 0v3l2.5-2.4a9.2 9.2 0 0 1 10.8-1.5A9 9 0 0 1 13.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 1 1 1.3-1.5 7.2 7.2 0 0 0 11.6-3.7 7 7 0 0 0-3.5-7.7A7.2 7.2 0 0 0 8 7L4.7 10z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>',"icon-rotate-left":'<svg width="24" height="24"><g id="icon-rotate-left" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M4.7 10H9a1 1 0 0 1 0 2H3a1 1 0 0 1-1-1V5a1 1 0 1 1 2 0v3l2.5-2.4a9.2 9.2 0 0 1 10.8-1.5A9 9 0 0 1 13.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 1 1 1.3-1.5 7.2 7.2 0 0 0 11.6-3.7 7 7 0 0 0-3.5-7.7A7.2 7.2 0 0 0 8 7L4.7 10z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>',"icon-rotate-right":'<svg width="24" height="24"><g id="icon-rotate-right" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M20 8V5a1 1 0 0 1 2 0v6c0 .6-.4 1-1 1h-6a1 1 0 0 1 0-2h4.3L16 7A7.2 7.2 0 0 0 7.7 6a7 7 0 0 0 3 13.1c1.9.1 3.7-.5 5-1.7a1 1 0 0 1 1.4 1.5A9.2 9.2 0 0 1 2.2 14c-.9-3.9 1-8 4.5-9.9 3.5-1.9 8-1.3 10.8 1.5L20 8z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>',"icon-rtl":'<svg width="24" height="24"><g id="icon-rtl" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M8 5h8v2h-2v12h-2V7h-2v12H8v-7c-.5 0-1 0-1.4-.3A3.4 3.4 0 0 1 4.8 10a3.3 3.3 0 0 1 0-2.8 3.4 3.4 0 0 1 1.8-1.8L8 5zm12 11.2a1 1 0 1 1-1 1.6l-3-2a1 1 0 0 1 0-1.6l3-2a1 1 0 1 1 1 1.6L18.4 15l1.8 1.2z" id="shape"/></g></svg>',"icon-save":'<svg width="24" height="24"><g id="icon-save" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M5 16h14a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-2c0-1.1.9-2 2-2zm0 2v2h14v-2H5zm10 0h2v2h-2v-2zm-4-6.4L8.7 9.3a1 1 0 1 0-1.4 1.4l4 4c.4.4 1 .4 1.4 0l4-4a1 1 0 1 0-1.4-1.4L13 11.6V4a1 1 0 0 0-2 0v7.6z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>',"icon-search":'<svg width="24" height="24"><g id="icon-search" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M16 17.3a8 8 0 1 1 1.4-1.4l4.3 4.4a1 1 0 0 1-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 1 0 0-12 6 6 0 0 0 0 12z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>',"icon-select-all":'<svg width="24" height="24"><g id="icon-select-all" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M3 5h2V3a2 2 0 0 0-2 2zm0 8h2v-2H3v2zm4 8h2v-2H7v2zM3 9h2V7H3v2zm10-6h-2v2h2V3zm6 0v2h2a2 2 0 0 0-2-2zM5 21v-2H3c0 1.1.9 2 2 2zm-2-4h2v-2H3v2zM9 3H7v2h2V3zm2 18h2v-2h-2v2zm8-8h2v-2h-2v2zm0 8a2 2 0 0 0 2-2h-2v2zm0-12h2V7h-2v2zm0 8h2v-2h-2v2zm-4 4h2v-2h-2v2zm0-16h2V3h-2v2zM7 17h10V7H7v10zm2-8h6v6H9V9z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-selected":'<svg width="24" height="24"><g id="icon-selected" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zm-2.4-6.1L7 12.3a.7.7 0 0 0-1 1L9.6 17 18 8.6a.7.7 0 0 0 0-1 .7.7 0 0 0-1 0l-7.4 7.3z" id="Combined-Shape"/></g></svg>',"icon-settings":'<svg width="24" height="24"><g id="icon-settings" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M11 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8v.3c0 .2 0 .3-.2.5l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6V8H5a1 1 0 1 1 0-2h2v-.3c0-.2 0-.3.2-.5l.5-.2h2.5c.3 0 .4 0 .6.2l.2.5V6zM8 8h2V6H8v2zm9 2.8v.2h2c.6 0 1 .4 1 1s-.4 1-1 1h-2v.3c0 .2 0 .3-.2.5l-.6.2h-2.4c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6V13H5a1 1 0 0 1 0-2h8v-.3c0-.2 0-.3.2-.5l.6-.2h2.4c.3 0 .4 0 .6.2l.2.6zM14 13h2v-2h-2v2zm-3 2.8v.2h8c.6 0 1 .4 1 1s-.4 1-1 1h-8v.3c0 .2 0 .3-.2.5l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6V18H5a1 1 0 0 1 0-2h2v-.3c0-.2 0-.3.2-.5l.5-.2h2.5c.3 0 .4 0 .6.2l.2.6zM8 18h2v-2H8v2z" id="shape"/></g></svg>',"icon-sharpen":'<svg width="24" height="24"><g id="icon-sharpen" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M16 6l4 4-8 9-8-9 4-4h8zm-4 10.2l5.5-6.2-.1-.1H12v-.3h5.1l-.2-.2H12V9h4.6l-.2-.2H12v-.3h4.1l-.2-.2H12V8h3.6l-.2-.2H8.7L6.5 10l.1.1H12v.3H6.9l.2.2H12v.3H7.3l.2.2H12v.3H7.7l.3.2h4v.3H8.2l.2.2H12v.3H8.6l.3.2H12v.3H9l.3.2H12v.3H9.5l.2.2H12v.3h-2l.2.2H12v.3h-1.6l.2.2H12v.3h-1.1l.2.2h.9v.3h-.7l.2.2h.5v.3h-.3l.3.2z" id="shape"/></g></svg>',"icon-sourcecode":'<svg width="24" height="24"><g id="icon-sourcecode" stroke="none" stroke-width="1" fill-rule="nonzero"><path d="M10.7 9.2c.3-.3.8-.3 1 0 .4.4.4.9 0 1.2l-4.1 4.4c-.3.3-.8.3-1.2 0l-4.2-4.4a.8.8 0 0 1 0-1.2c.3-.3.8-.3 1.1 0L7 13l3.7-3.8z" id="Shape" transform="rotate(90 7 12)"/><path d="M20.7 9.2c.3-.3.8-.3 1 0 .4.4.4.9 0 1.2l-4.1 4.4c-.3.3-.8.3-1.2 0l-4.2-4.4a.8.8 0 0 1 0-1.2c.3-.3.8-.3 1.1 0L17 13l3.7-3.8z" id="Shape-Copy" transform="matrix(0 1 1 0 5 -5)"/></g></svg>',"icon-spell-check":'<svg width="24" height="24"><g id="icon-spell-check" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M6 8v3H5V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h2c.3 0 .5.1.7.3.2.2.3.4.3.7v6H8V8H6zm0-3v2h2V5H6zm13 0h-3v5h3v1h-3a1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3v1zm-5 1.5l-.1.7c-.1.2-.3.3-.6.3.3 0 .5.1.6.3l.1.7V10c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3h-3V4h3c.3 0 .5.1.7.3.2.2.3.4.3.7v1.5zM13 10V8h-2v2h2zm0-3V5h-2v2h2zm3 5l1 1-6.5 7L7 15.5l1.3-1 2.2 2.2L16 12z" id="shape"/></g></svg>',"icon-strike-through":'<svg width="24" height="24"><g id="icon-strike-through" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M15.6 8.5c-.5-.7-1-1.1-1.3-1.3-.6-.4-1.3-.6-2-.6-2.7 0-2.8 1.7-2.8 2.1 0 1.6 1.8 2 3.2 2.3 4.4.9 4.6 2.8 4.6 3.9 0 1.4-.7 4.1-5 4.1A6.2 6.2 0 0 1 7 16.4l1.5-1.1c.4.6 1.6 2 3.7 2 1.6 0 2.5-.4 3-1.2.4-.8.3-2-.8-2.6-.7-.4-1.6-.7-2.9-1-1-.2-3.9-.8-3.9-3.6C7.6 6 10.3 5 12.4 5c2.9 0 4.2 1.6 4.7 2.4l-1.5 1.1z" id="s"/><path d="M5 11h14a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2z" id="Rectangle" fill-rule="nonzero"/></g></svg>',"icon-subscript":'<svg width="24" height="24"><g id="icon-subscript" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M10.4 10l4.6 4.6-1.4 1.4L9 11.4 4.4 16 3 14.6 7.6 10 3 5.4 4.4 4 9 8.6 13.6 4 15 5.4 10.4 10zM21 19h-5v-1l1-.8 1.7-1.6c.3-.4.5-.8.5-1.2 0-.3 0-.6-.2-.7-.2-.2-.5-.3-.9-.3a2 2 0 0 0-.8.2l-.7.3-.4-1.1 1-.6 1.2-.2c.8 0 1.4.3 1.8.7.4.4.6.9.6 1.5s-.2 1.1-.5 1.6a8 8 0 0 1-1.3 1.3l-.6.6h2.6V19z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-superscript":'<svg width="24" height="24"><g id="icon-superscript" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M15 9.4L10.4 14l4.6 4.6-1.4 1.4L9 15.4 4.4 20 3 18.6 7.6 14 3 9.4 4.4 8 9 12.6 13.6 8 15 9.4zm5.9 1.6h-5v-1l1-.8 1.7-1.6c.3-.5.5-.9.5-1.3 0-.3 0-.5-.2-.7-.2-.2-.5-.3-.9-.3l-.8.2-.7.4-.4-1.2c.2-.2.5-.4 1-.5.3-.2.8-.2 1.2-.2.8 0 1.4.2 1.8.6.4.4.6 1 .6 1.6 0 .5-.2 1-.5 1.5l-1.3 1.4-.6.5h2.6V11z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-table-cell-properties":'<svg width="24" height="24"><g id="icon-table-cell-properties" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M4 5h16v14H4V5zm10 10h-4v3h4v-3zm0-8h-4v3h4V7zM9 7H5v3h4V7zm-4 4v3h4v-3H5zm10 0v3h4v-3h-4zm0-1h4V7h-4v3zM5 15v3h4v-3H5zm10 3h4v-3h-4v3z" id="shape"/></g></svg>',"icon-table-cell-select-all":'<svg width="24" height="24"><g id="icon-table-cell-select-all" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M12.5 5.5v6h6v-6h-6zm-1 0h-6v6h6v-6zm1 13h6v-6h-6v6zm-1 0v-6h-6v6h6zm-7-14h15v15h-15v-15z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>',"icon-table-cell-select-inner":'<svg width="24" height="24"><g id="icon-table-cell-select-inner" stroke="none" stroke-width="1" fill-rule="nonzero"><path d="M5.5 5.5v13h13v-13h-13zm-1-1h15v15h-15v-15z" id="Rectangle-5-Copy" opacity=".2"/><path d="M11.5 11.5v-7h1v7h7v1h-7v7h-1v-7h-7v-1h7z" id="Combined-Shape"/></g></svg>',"icon-table-delete-column":'<svg width="24" height="24"><g id="icon-table-delete-column" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M9 11.2l1 1v.2l-1 1v-2.2zm5 1l1-1v2.2l-1-1v-.2zM20 5v14H4V5h16zm-1 2h-4v.8l-.2-.2-.8.8V7h-4v1.4l-.8-.8-.2.2V7H5v11h4v-1.8l.5.5.5-.4V18h4v-1.8l.8.8.2-.3V18h4V7zm-3.9 3.4l-1.8 1.9 1.8 1.9c.4.3.4.9 0 1.2-.3.3-.8.3-1.2 0L12 13.5l-1.8 1.9a.8.8 0 0 1-1.2 0 .9.9 0 0 1 0-1.2l1.8-1.9-1.9-2a.9.9 0 0 1 1.2-1.2l2 2 1.8-1.8c.3-.4.9-.4 1.2 0a.8.8 0 0 1 0 1.1z" id="shape"/></g></svg>',"icon-table-delete-row":'<svg width="24" height="24"><g id="icon-table-delete-row" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M16.7 8.8l1.1 1.2-2.4 2.5L18 15l-1.2 1.2-2.5-2.5-2.4 2.5-1.3-1.2 2.5-2.5-2.5-2.5 1.2-1.3 2.6 2.6 2.4-2.5zM4 5h16v14H4V5zm15 5V7H5v3h4.8l1 1H5v3h5.8l-1 1H5v3h14v-3h-.4l-1-1H19v-3h-1.3l1-1h.3z" id="shape"/></g></svg>',"icon-table-delete-table":'<svg width="24" height="26"><g id="icon-table-delete-table" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M4 6h16v14H4V6zm1 2v11h14V8H5zm11.7 8.7l-1.5 1.5L12 15l-3.3 3.2-1.4-1.5 3.2-3.2-3.3-3.2 1.5-1.5L12 12l3.2-3.2 1.5 1.5-3.2 3.2 3.2 3.2z" id="shape"/></g></svg>',"icon-table-insert-column-after":'<svg width="24" height="24"><g id="icon-table-insert-column-after" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M14.3 9c.4 0 .7.3.7.6v2.2h2.1c.4 0 .7.3.7.7 0 .4-.3.7-.7.7H15v2.2c0 .3-.3.6-.7.6a.7.7 0 0 1-.6-.6v-2.2h-2.2a.7.7 0 0 1 0-1.4h2.2V9.6c0-.3.3-.6.6-.6zM4 5h16v14H4V5zm5 13v-3H5v3h4zm0-4v-3H5v3h4zm0-4V7H5v3h4zm10 8V7h-9v11h9z" id="shape"/></g></svg>',"icon-table-insert-column-before":'<svg width="24" height="24"><g id="icon-table-insert-column-before" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M9.7 16a.7.7 0 0 1-.7-.6v-2.2H6.9a.7.7 0 0 1 0-1.4H9V9.6c0-.3.3-.6.7-.6.3 0 .6.3.6.6v2.2h2.2c.4 0 .8.3.8.7 0 .4-.4.7-.8.7h-2.2v2.2c0 .3-.3.6-.6.6zM4 5h16v14H4V5zm10 13V7H5v11h9zm5 0v-3h-4v3h4zm0-4v-3h-4v3h4zm0-4V7h-4v3h4z" id="shape"/></g></svg>',"icon-table-insert-row-above":'<svg width="24" height="24"><g id="icon-table-insert-row-above" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M14.8 10.5c0 .3-.2.5-.5.5h-1.8v1.8c0 .3-.2.5-.5.5a.5.5 0 0 1-.5-.6V11H9.7a.5.5 0 0 1 0-1h1.8V8.3c0-.3.2-.6.5-.6s.5.3.5.6V10h1.8c.3 0 .5.2.5.5zM4 5h16v14H4V5zm5 13v-3H5v3h4zm5 0v-3h-4v3h4zm5 0v-3h-4v3h4zm0-4V7H5v7h14z" id="shape"/></g></svg>',"icon-table-insert-row-after":'<svg width="24" height="24"><g id="icon-table-insert-row-after" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M9.2 14.5c0-.3.2-.5.5-.5h1.8v-1.8c0-.3.2-.5.5-.5s.5.2.5.6V14h1.8c.3 0 .5.2.5.5s-.2.5-.5.5h-1.8v1.7c0 .3-.2.6-.5.6a.5.5 0 0 1-.5-.6V15H9.7a.5.5 0 0 1-.5-.5zM4 5h16v14H4V5zm6 2v3h4V7h-4zM5 7v3h4V7H5zm14 11v-7H5v7h14zm0-8V7h-4v3h4z" id="shape"/></g></svg>',"icon-table-left-header":'<svg width="24" height="24"><g id="icon-table-left-header" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M4 5h16v13H4V5zm10 12v-3h-4v3h4zm0-4v-3h-4v3h4zm0-4V6h-4v3h4zm5 8v-3h-4v3h4zm0-4v-3h-4v3h4zm0-4V6h-4v3h4z" id="shape"/></g></svg>',"icon-table-merge-cells":'<svg width="24" height="24"><g id="icon-table-merge-cells" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M4 5h16v14H4V5zm6 13h9v-7h-9v7zm4-11h-4v3h4V7zM9 7H5v3h4V7zm-4 4v3h4v-3H5zm10-1h4V7h-4v3zM5 15v3h4v-3H5z" id="shape"/></g></svg>',"icon-table-row-properties":'<svg width="24" height="24"><g id="icon-table-row-properties" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M4 5h16v14H4V5zm10 10h-4v3h4v-3zm0-8h-4v3h4V7zM9 7H5v3h4V7zm6 3h4V7h-4v3zM5 15v3h4v-3H5zm10 3h4v-3h-4v3z" id="shape"/></g></svg>',"icon-table-split-cells":'<svg width="24" height="24"><g id="icon-table-split-cells" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M4 5h16v14H4V5zm6 2v3h4V7h-4zM9 18v-3H5v3h4zm0-4v-3H5v3h4zm0-4V7H5v3h4zm10 8v-7h-9v7h9zm0-8V7h-4v3h4zm-3.5 4.5l1.5 1.6c.3.2.3.7 0 1-.2.2-.7.2-1 0l-1.5-1.6-1.6 1.5c-.2.3-.7.3-1 0a.7.7 0 0 1 0-1l1.6-1.5-1.5-1.6a.7.7 0 0 1 1-1l1.5 1.6 1.6-1.5c.2-.3.7-.3 1 0 .2.2.2.7 0 1l-1.6 1.5z" id="shape"/></g></svg>',"icon-table-top-header":'<svg width="24" height="24"><g id="icon-table-top-header" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M4 5h16v13H4V5zm5 12v-3H5v3h4zm0-4v-3H5v3h4zm5 4v-3h-4v3h4zm0-4v-3h-4v3h4zm5 4v-3h-4v3h4zm0-4v-3h-4v3h4z" id="shape"/></g></svg>',"icon-table":'<svg width="24" height="24"><g id="icon-table" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M4 5h16v14H4V5zm6 9h4v-3h-4v3zm4 1h-4v3h4v-3zm0-8h-4v3h4V7zM9 7H5v3h4V7zm-4 4v3h4v-3H5zm10 0v3h4v-3h-4zm0-1h4V7h-4v3zM5 15v3h4v-3H5zm10 3h4v-3h-4v3z" id="shape"/></g></svg>',"icon-template":'<svg width="24" height="24"><g id="icon-template" stroke="none" stroke-width="1" fill-rule="evenodd"><g id="stamp" transform="translate(3 3)" fill-rule="nonzero"><path d="M16 16v-1H2v1h14zM6 13V9a5 5 0 1 1 6 0v4h4a2 2 0 0 1 2 2v3H0v-3c0-1.1.9-2 2-2h4zm4 0V8l.8-.6a3 3 0 1 0-3.6 0L8 8v5h2z" id="Shape"/></g></g></svg>',"icon-temporary-placeholder":'<svg width="24" height="24"><g id="icon-temporary-placeholder" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M20.5 2.5c-.8 0-1.5.7-1.5 1.5a1.5 1.5 0 0 1-3 0 3 3 0 0 0-6 0v2H8.5c-.3 0-.5.2-.5.5v1a8 8 0 1 0 6 0v-1c0-.3-.2-.5-.5-.5H11V4a2 2 0 0 1 4 0 2.5 2.5 0 0 0 5 0c0-.3.2-.5.5-.5a.5.5 0 0 0 0-1zM8.1 10.9a5 5 0 0 0-1.2 7 .5.5 0 0 1-.8.5 6 6 0 0 1 1.5-8.3.5.5 0 1 1 .5.8z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-text-color":'<svg width="24" height="24"><g id="icon-text-color" stroke="none" stroke-width="1" fill-rule="evenodd"><path id="color" d="M3 18h18v3H3z"/><path d="M8.7 16h-.8a.5.5 0 0 1-.5-.6l2.7-9c.1-.3.3-.4.5-.4h2.8c.2 0 .4.1.5.4l2.7 9a.5.5 0 0 1-.5.6h-.8a.5.5 0 0 1-.4-.4l-.7-2.2c0-.3-.3-.4-.5-.4h-3.4c-.2 0-.4.1-.5.4l-.7 2.2c0 .3-.2.4-.4.4zm2.6-7.6l-.6 2a.5.5 0 0 0 .5.6h1.6a.5.5 0 0 0 .5-.6l-.6-2c0-.3-.3-.4-.5-.4h-.4c-.2 0-.4.1-.5.4z" id="shape"/></g></svg>',"icon-toc":'<svg width="24" height="24"><g id="icon-toc" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M5 5c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 1 1 0-2zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 1 1 0-2zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2zm0-4c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 1 1 0-2zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2z" id="shape"/></g></svg>',"icon-translate":'<svg width="24" height="24"><g id="icon-translate" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M12.7 14.3l-.3.7-.4.7-2.2-2.2-3.1 3c-.3.4-.8.4-1 0a.7.7 0 0 1 0-1l3.1-3A12.4 12.4 0 0 1 6.7 9H8a10.1 10.1 0 0 0 1.7 2.4c.5-.5 1-1.1 1.4-1.8l.9-2H4.7a.7.7 0 1 1 0-1.5h4.4v-.7c0-.4.3-.8.7-.8.4 0 .7.4.7.8v.7H15c.4 0 .8.3.8.7 0 .4-.4.8-.8.8h-1.4a12.3 12.3 0 0 1-1 2.4 13.5 13.5 0 0 1-1.7 2.3l1.9 1.8zm4.3-3l2.7 7.3a.5.5 0 0 1-.4.7 1 1 0 0 1-1-.7l-.6-1.5h-3.4l-.6 1.5a1 1 0 0 1-1 .7.5.5 0 0 1-.4-.7l2.7-7.4a1 1 0 1 1 2 0zm-2.2 4.4h2.4L16 12.5l-1.2 3.2z" id="shape"/></g></svg>',"icon-underline":'<svg width="24" height="24"><g id="icon-underline" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M16 5c.6 0 1 .4 1 1v5.5a4 4 0 0 1-.4 1.8l-1 1.4a5.3 5.3 0 0 1-5.5 1 5 5 0 0 1-1.6-1c-.5-.4-.8-.9-1.1-1.4a4 4 0 0 1-.4-1.8V6c0-.6.4-1 1-1s1 .4 1 1v5.5c0 .3 0 .6.2 1l.6.7a3.3 3.3 0 0 0 2.2.8 3.4 3.4 0 0 0 2.2-.8c.3-.2.4-.5.6-.8l.2-.9V6c0-.6.4-1 1-1zM8 17h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2z" id="shape"/></g></svg>',"icon-undo":'<svg width="24" height="24"><g id="icon-undo" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M6.4 8H12c3.7 0 6.2 2 6.8 5.1.6 2.7-.4 5.6-2.3 6.8a1 1 0 0 1-1-1.8c1.1-.6 1.8-2.7 1.4-4.6-.5-2.1-2.1-3.5-4.9-3.5H6.4l3.3 3.3a1 1 0 1 1-1.4 1.4l-5-5a1 1 0 0 1 0-1.4l5-5a1 1 0 0 1 1.4 1.4L6.4 8z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>',"icon-unlink":'<svg width="24" height="24"><g id="icon-unlink" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M6.2 12.3a1 1 0 0 1 1.4 1.4l-2 2a2 2 0 1 0 2.6 2.8l4.8-4.8a1 1 0 0 0 0-1.4 1 1 0 1 1 1.4-1.3 2.9 2.9 0 0 1 0 4L9.6 20a3.9 3.9 0 0 1-5.5-5.5l2-2zm11.6-.6a1 1 0 0 1-1.4-1.4l2.1-2a2 2 0 1 0-2.7-2.8L11 10.3a1 1 0 0 0 0 1.4A1 1 0 1 1 9.6 13a2.9 2.9 0 0 1 0-4L14.4 4a3.9 3.9 0 0 1 5.5 5.5l-2 2zM7.6 6.3a.8.8 0 0 1-1 1.1L3.3 4.2a.7.7 0 1 1 1-1l3.2 3.1zM5.1 8.6a.8.8 0 0 1 0 1.5H3a.8.8 0 0 1 0-1.5H5zm5-3.5a.8.8 0 0 1-1.5 0V3a.8.8 0 0 1 1.5 0V5zm6 11.8a.8.8 0 0 1 1-1l3.2 3.2a.8.8 0 0 1-1 1L16 17zm-2.2 2a.8.8 0 0 1 1.5 0V21a.8.8 0 0 1-1.5 0V19zm5-3.5a.7.7 0 1 1 0-1.5H21a.8.8 0 0 1 0 1.5H19z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>',"icon-unlock":'<svg width="24" height="24"><g id="icon-unlock" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M16 5c.8 0 1.5.3 2.1.9.6.6.9 1.3.9 2.1v3h-2V8a1 1 0 0 0-.3-.7A1 1 0 0 0 16 7h-2a1 1 0 0 0-.7.3 1 1 0 0 0-.3.7v3h.3c.2 0 .3 0 .5.2l.2.6v7.4c0 .3 0 .4-.2.6l-.6.2H4.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6v-7.4c0-.3 0-.4.2-.6l.5-.2H11V8c0-.8.3-1.5.9-2.1.6-.6 1.3-.9 2.1-.9h2z" id="shape"/></g></svg>',"icon-unordered-list":'<svg width="24" height="24"><g id="icon-unordered-list" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M11 5h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zM4.5 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1zm0 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1zm0 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1z" id="shape"/></g></svg>',"icon-unselected":'<svg width="24" height="24"><g id="icon-unselected" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zm0-1a8 8 0 1 0 0-16 8 8 0 0 0 0 16z" id="Combined-Shape"/></g></svg>',"icon-upload":'<svg width="24" height="24"><g id="icon-upload" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M18 19v-2a1 1 0 0 1 2 0v3c0 .6-.4 1-1 1H5a1 1 0 0 1-1-1v-3a1 1 0 0 1 2 0v2h12zM11 6.4L8.7 8.7a1 1 0 0 1-1.4-1.4l4-4a1 1 0 0 1 1.4 0l4 4a1 1 0 1 1-1.4 1.4L13 6.4V16a1 1 0 0 1-2 0V6.4z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>',"icon-user":'<svg width="24" height="24"><g id="icon-user" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M12 24a12 12 0 1 1 0-24 12 12 0 0 1 0 24zm-8.7-5.3a11 11 0 0 0 17.4 0C19.4 16.3 14.6 15 12 15c-2.6 0-7.4 1.3-8.7 3.7zM12 13c2.2 0 4-2 4-4.5S14.2 4 12 4 8 6 8 8.5 9.8 13 12 13z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-warning":'<svg width="24" height="24"><g id="icon-warning" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M19.8 18.3c.2.5.3.9 0 1.2-.1.3-.5.5-1 .5H5.2c-.5 0-.9-.2-1-.5-.3-.3-.2-.7 0-1.2L11 4.7l.5-.5.5-.2c.2 0 .3 0 .5.2.2 0 .3.3.5.5l6.8 13.6zM12 18c.3 0 .5-.1.7-.3.2-.2.3-.4.3-.7a1 1 0 0 0-.3-.7 1 1 0 0 0-.7-.3 1 1 0 0 0-.7.3 1 1 0 0 0-.3.7c0 .3.1.5.3.7.2.2.4.3.7.3zm.7-3l.3-4a1 1 0 0 0-.3-.7 1 1 0 0 0-.7-.3 1 1 0 0 0-.7.3 1 1 0 0 0-.3.7l.3 4h1.4z" id="shape"/></g></svg>',"icon-zoom-in":'<svg width="24" height="24"><g id="icon-zoom-in" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M16 17.3a8 8 0 1 1 1.4-1.4l4.3 4.4a1 1 0 0 1-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 1 0 0-12 6 6 0 0 0 0 12zm-1-9a1 1 0 0 1 2 0v6a1 1 0 0 1-2 0V8zm-2 4a1 1 0 0 1 0-2h6a1 1 0 0 1 0 2H8z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>',"icon-zoom-out":'<svg width="24" height="24"><g id="icon-zoom-out" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M16 17.3a8 8 0 1 1 1.4-1.4l4.3 4.4a1 1 0 0 1-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 1 0 0-12 6 6 0 0 0 0 12zm-3-5a1 1 0 0 1 0-2h6a1 1 0 0 1 0 2H8z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>'},Im=function(t,e){return P.from(Lm[t]).getOrThunk(e)},Nm=function(t,e){return P.from(e()[t]).getOrThunk(function(){return Im(t,function(){return"!not found!"})})},Pm=function(t,e,n){return P.from(e()[t]).getOrThunk(function(){return Im(t,n)})},jm={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},Um=Cl({name:"Notification",factory:function(e){var t,n,o,r=Rm({dom:{tag:"p",innerHtml:e.translationProvider(e.text)},behaviours:Ea([Fd.config({})])}),i=function(t){return{dom:{tag:"div",classes:["tox-bar"],attributes:{style:"width: "+t+"%"}}}},a=function(t){return{dom:{tag:"div",classes:["tox-text"],innerHtml:t+"%"}}},u=Rm({dom:{tag:"div",classes:e.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[i(0)]},a(0)],behaviours:Ea([Fd.config({})])}),c={updateProgress:function(t,e){t.getSystem().isConnected()&&u.getOpt(t).each(function(t){Fd.set(t,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[i(e)]},a(e)])})},updateText:function(t,e){if(t.getSystem().isConnected()){var n=r.get(t);Fd.set(n,[ea(e)])}}},s=E(I([e.icon.toArray(),e.level.toArray(),e.level.bind(function(t){return P.from(jm[t])}).toArray()]),function(t){return"icon-"+t});return{uid:e.uid,dom:{tag:"div",attributes:{role:"alert"},classes:e.level.map(function(t){return["tox-notification","tox-notification--in","tox-notification--"+t]}).getOr(["tox-notification","tox-notification--in"])},components:[{dom:{tag:"div",classes:["tox-notification__icon"],innerHtml:(t=s,n=e.iconProvider,o=function(){return t=function(){return""},Mt(s,function(t){return P.from(Lm[t])}).getOrThunk(t);var t},Mt(t,function(t){return P.from(n()[t])}).getOrThunk(o))}},{dom:{tag:"div",classes:["tox-notification__body"]},components:[r.asSpec()],behaviours:Ea([Fd.config({})])}].concat(e.progress?[u.asSpec()]:[]).concat(Fm.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:Nm("icon-close",e.iconProvider)}}],action:function(t){e.onAction(t)}})),apis:c}},configFields:[rr("level"),$o("progress"),$o("icon"),$o("onAction"),$o("text"),$o("iconProvider"),$o("translationProvider")],apis:{updateProgress:function(t,e,n){t.updateProgress(e,n)},updateText:function(t,e,n){t.updateText(e,n)}}});function Wm(r,i,a){var u=i.backstage;return{open:function(t,e){var n=function(){e(),Dm.hide(r)},o=ra(Um.sketch({text:t.text,level:M(["success","error","warning","info"],t.type)?t.type:undefined,progress:!0===t.progressBar,icon:P.from(t.icon),onAction:n,iconProvider:u.shared.providers.icons,translationProvider:u.shared.providers.translate})),r=ra(Dm.sketch({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:i.backstage.shared.getSink,fireDismissalEventInstead:{}}));return a.add(r),t.timeout&&setTimeout(function(){n()},t.timeout),{close:n,moveTo:function(t,e){Dm.showAt(r,{anchor:"makeshift",x:t,y:e},ia(o))},moveRel:function(t,e){Dm.showAt(r,i.backstage.shared.anchors.banner(),ia(o))},text:function(t){Um.updateText(o,t)},settings:t,getEl:function(){},progressBar:{value:function(t){Um.updateProgress(o,t)}}}},close:function(t){t.close()},reposition:function(t){T(t,function(t){t.moveTo(0,0)}),function(n){if(0<n.length){var t=n.slice(0,1)[0],e=(o=r).inline?o.getElement():o.getContentAreaContainer();t.moveRel(e,"tc-tc"),T(n,function(t,e){0<e&&t.moveRel(n[e-1].getEl(),"bc-tc")})}var o}(t)},getArgs:function(t){return t.settings}}}var Gm,Xm,Ym,qm,Km=function(n,o){var r=null;return{cancel:function(){null!==r&&(clearTimeout(r),r=null)},throttle:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];null!==r&&clearTimeout(r),r=setTimeout(function(){n.apply(null,t),r=null},o)}}},Jm=/[\u00a0 \t\r\n]/,$m=function(n,t,e,o,r){return void 0===r&&(r=0),(i=n).collapsed&&3===i.startContainer.nodeType?function(t,e,n,o){var r;for(r=e-1;0<=r;r--){if(Jm.test(t.charAt(r)))return P.none();if(t.charAt(r)===n)break}return-1===r||e-r<o?P.none():P.some(t.substring(r+1,e))}(e,o,t,r).map(function(t){var e=n.cloneRange();return e.setStart(n.startContainer,n.startOffset-t.length-1),e.setEnd(n.startContainer,n.startOffset),{text:t,rng:e}}):P.none();var i},Qm=function(n,t){t.on("keypress",n.onKeypressThrottle);var o=function(t,e){yr(t,Lt(),{raw:e})};t.on("keydown",function(e){var t=function(){return n.getView().bind(Ul.getHighlighted)};n.isActive()&&(8===e.which&&n.onKeypressThrottle(e),27===e.which?n.closeIfNecessary():32===e.which?n.closeIfNecessary():13===e.which?(t().each(xr),e.preventDefault()):40===e.which?(t().fold(function(){n.getView().each(Ul.highlightFirst)},function(t){o(t,e)}),e.preventDefault()):37!==e.which&&38!==e.which&&39!==e.which||t().each(function(t){o(t,e),e.preventDefault()}))})},Zm=tinymce.util.Tools.resolve("tinymce.util.Promise"),th=function(t,e){var n,o,r,i=e(),a=t.selection.getRng(),u=a.startContainer.nodeValue;return(n=a,o=u,r=i,Mt(r.triggerChars,function(e){return $m(n,e,o,n.startOffset).map(function(t){return{range:t.rng,text:t.text,triggerChar:e}})})).map(function(n){var t=A(i.lookupByChar(n.triggerChar),function(t){return n.text.length>=t.minChars&&t.matches(n.range,u,n.text)});return{lookupData:Zm.all(E(t,function(e){return e.fetch(n.text,e.maxResults).then(function(t){return{items:t,columns:e.columns,onAction:e.onAction}})})),triggerChar:n.triggerChar,range:n.range}})},eh=Ho([gr("type",function(){return"autocompleteitem"}),gr("active",function(){return!1}),gr("disabled",function(){return!1}),cr("meta",{}),Zo("value"),ar("text"),ar("icon")]),nh=Ho([Zo("type"),Zo("ch"),lr("minChars",0),cr("columns",1),lr("maxResults",10),mr("matches",function(){return!0}),tr("fetch"),tr("onAction")]),oh=function(t){var e,n,o=t.ui.registry.getAll().popups,r=et(o,function(t){return(e=t,No("Autocompleter",nh,e)).fold(function(t){throw new Error(Uo(t))},function(t){return t});var e}),i=(e=ot(r,function(t){return t.ch}),n={},T(e,function(t){n[t]={}}),Q(n)),a=rt(r);return{dataset:r,triggerChars:i,lookupByChar:function(e){return A(a,function(t){return t.ch===e})}}},rh=[dr("disabled",!1),ar("text"),ar("shortcut"),Do("value","value",Qn(function(){return jn("menuitem-value")}),Go()),cr("meta",{})],ih=Ho([Zo("type"),gr("hasSubmenu",function(t){return St(t,"getSubmenuItems")}),mr("onSetup",function(){return N}),mr("onAction",N),ar("icon")].concat(rh)),ah=function(t){return No("menuitem",ih,t)},uh=Ho([Zo("type"),dr("active",!1),mr("onSetup",function(){return N}),tr("onAction")].concat(rh)),ch=function(t){return No("togglemenuitem",uh,t)},sh=Ho([Zo("type"),dr("active",!1),ar("icon")].concat(rh)),lh=Ho([Zo("type"),ar("text")]),fh=Ho([Zo("type"),(Gm="fancytype",Xm=["inserttable"],Do(Gm,Gm,Jn(),Lo(function(t){return M(Xm,t)?ft.value(t):ft.error('Value was: "'+t+'". Must be one of ['+E(Xm,function(t){return'"'+t+'"'}).join(", ")+"]")}))),mr("onAction",N)]),dh=function(t,o,e){var r=yc(t.element(),"."+e);if(0<r.length){var n=F(r,function(t){var e=t.dom().getBoundingClientRect().top,n=r[0].dom().getBoundingClientRect().top;return Math.abs(e-n)>o}).getOr(r.length);return P.some({numColumns:n,numRows:Math.ceil(r.length/n)})}return P.none()},mh=function(t,e){return Ea([ym(t,e)])},hh=function(t){return mh(jn("unnamed-events"),t)},gh="tox-menu-nav__js",vh="tox-collection__item",ph="tox-swatch",bh={normal:gh,color:ph},yh="tox-collection__item--enabled",xh="tox-collection__item-icon",wh="tox-collection__item-label",kh="tox-collection__item--active",zh=function(t){return xt(bh,t).getOr(gh)},Sh=function(t){var e,n,o,r=Ne.fromHtml(t),i=un(r),a=(n=(e=r).dom().attributes!==undefined?e.dom().attributes:[],D(n,function(t,e){var n;return"class"===e.name?t:Wn({},t,((n={})[e.name]=e.value,n))},{})),u=(o=r,Array.prototype.slice.call(o.dom().classList,0)),c=0===i.length?{}:{innerHtml:vn(r)};return Wn({tag:bn(r),classes:u,attributes:a},c)},Ch=tinymce.util.Tools.resolve("tinymce.util.I18n"),Oh=tinymce.util.Tools.resolve("tinymce.Env"),Mh=function(t){var n=Oh.mac?{alt:"⌥",ctrl:"⌘",shift:"⇧",meta:"⌘"}:{meta:"Ctrl"},e=t.split("+");return E(e,function(t){var e=t.toLowerCase().trim();return it(n,e)?n[e]:t}).join("+")},Hh=function(t){return{dom:{tag:"span",classes:[xh],innerHtml:t}}},Vh=function(t){return{dom:{tag:"span",classes:[wh]},components:[ea(Ch.translate(t))]}},Eh=function(t){return{dom:{tag:"span",classes:["tox-collection__item-accessory"],innerHtml:Mh(t)}}},Th=function(t){return{dom:{tag:"span",classes:[xh,"tox-collection__item-checkmark"],innerHtml:Nm("icon-checkmark",t)}}},Ah=function(t,e){var n,o,r,i,a,u,c,s=t.iconContent.map(function(t){return Pm("icon-"+t,e.icons,U(t))});return"color"===t.presets?(a=t.value,{dom:(u=ph,c=s.getOr(""),Sh("custom"===a?'<button class="'+u+' tox-swatches__picker-btn">'+c+"</button>":"remove"===a?'<div class="'+u+' tox-swatch--remove">'+c+"</div>":'<div class="'+u+'" style="background-color: '+a+'" data-mce-color="'+a+'"></div>')),optComponents:[]}):(o=s,r=(n=t).checkMark.orThunk(function(){return o.or(P.some("")).map(Hh)}),i=n.ariaLabel.map(function(t){return{attributes:{title:Ch.translate(t)}}}).getOr({}),{dom:vt({tag:"div",classes:[gh,vh]},i),optComponents:[r,n.textContent.map(Vh),n.shortcutContent.map(Eh),n.caret]})},Bh=["input","button","textarea"],Dh=function(t,e,n){e.disabled&&Nh(t,e,n)},_h=function(t){return M(Bh,bn(t.element()))},Fh=function(t){Sn(t.element(),"disabled","disabled")},Rh=function(t){Hn(t.element(),"disabled")},Lh=function(t){Sn(t.element(),"aria-disabled","true")},Ih=function(t){Sn(t.element(),"aria-disabled","false")},Nh=function(e,t,n){t.disableClass.each(function(t){Ti(e.element(),t)}),(_h(e)?Fh:Lh)(e)},Ph=function(t){return _h(t)?Mn(t.element(),"disabled"):"true"===On(t.element(),"aria-disabled")},jh=Object.freeze({enable:function(e,t,n){t.disableClass.each(function(t){Ai(e.element(),t)}),(_h(e)?Rh:Ih)(e)},disable:Nh,isDisabled:Ph,onLoad:Dh}),Uh=Object.freeze({exhibit:function(t,e,n){return pi({classes:e.disabled?e.disableClass.map(q).getOr([]):[]})},events:function(t,e){return Fr([Rr(ze(),function(t,e){return Ph(t)}),Ca(t,e,Dh)])}}),Wh=[cr("disabled",!1),rr("disableClass")],Gh=Aa({fields:Wh,name:"disabling",active:Uh,apis:jh}),Xh=function(t){return Gh.config({disabled:t,disableClass:"tox-collection__item--state-disabled"})},Yh=function(t){return Gh.config({disabled:t})},qh=function(t,e){var n=t.getApi(e);return function(t){t(n)}},Kh=function(n,o){return Yr(function(t){qh(n,t)(function(t){var e=n.onSetup(t);null!==e&&e!==undefined&&o.set(e)})})},Jh=function(e,n){return qr(function(t){return qh(e,t)(n.get())})};(qm=Ym||(Ym={}))[qm.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",qm[qm.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX";var $h,Qh,Zh=Ym,tg={"alloy.execute":["disabling","alloy.base.behaviour","toggling","item-events"]},eg=function(t){return j(t,function(t){return t.toArray()})},ng=function(t,e,n){var o,r,i=Ct(N);return{type:"item",dom:e.dom,components:eg(e.optComponents),data:t.data,eventOrder:tg,itemBehaviours:Ea([ym("item-events",[(o=t,r=n,Jr(function(t,e){qh(o,t)(o.onAction),o.triggersSubmenu||r!==Zh.CLOSE_ON_EXECUTE||(br(t,He()),e.stop())})),Kh(t,i),Jh(t,i)]),Xh(t.disabled),Fd.config({})].concat(t.itemBehaviours))}},og=function(t){return{value:t.value,meta:vt({text:t.text.getOr("")},t.meta)}},rg=U(rl("item-widget",km())),ig=jn("cell-over"),ag=jn("cell-execute"),ug=function(e,n,t){var o,r=function(t){return yr(t,ag,{row:e,col:n})};return ra({dom:{tag:"div",attributes:(o={role:"button"},o["aria-labelledby"]=t,o)},behaviours:Ea([ym("insert-table-picker-cell",[Ir(_t(),tm.focus),Ir(ze(),r),Ir(Oe(),r)]),dm.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),tm.config({onFocus:function(t){return yr(t,ig,{row:e,col:n})}})])})},cg={inserttable:function TH(o){var t,e=jn("size-label"),u=function(t,e,n){for(var o=[],r=0;r<e;r++){for(var i=[],a=0;a<n;a++)i.push(ug(r,a,t));o.push(i)}return o}(e,10,10),c=Rm({dom:{tag:"span",classes:["tox-insert-table-picker__label"],attributes:{id:e}},components:[ea("0x0")],behaviours:Ea([Fd.config({})])});return{type:"widget",data:{value:jn("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[rg().widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:(t=u,j(t,function(t){return E(t,ia)})).concat(c.asSpec()),behaviours:Ea([ym("insert-table-picker",[Ur(ig,function(t,e,n){var o,r,i=n.event().row(),a=n.event().col();!function(t,e,n,o,r){for(var i=0;i<o;i++)for(var a=0;a<r;a++)dm.set(t[i][a],i<=e&&a<=n)}(u,i,a,10,10),Fd.set(c.get(t),[(o=i,r=a,ea(r+1+"x"+(o+1)))])}),Ur(ag,function(t,e,n){o.onAction({numRows:n.event().row()+1,numColumns:n.event().col()+1}),br(t,He())})]),Td.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}}},sg=function(t,a,e){return{dom:{tag:"div",classes:[gh,vh]},optComponents:[P.some(e),t.map(function(t){return e=a.tag,n=a.styleAttr,o="span",r=[wh],i=[{dom:{tag:e,attributes:{style:n}},components:[ea(t)]}],{dom:{tag:o,classes:r},components:i};var e,n,o,r,i})]}},lg=function(e,t,n,o,r,i,a){var u=Ah({presets:n,textContent:t?e.text:P.none(),ariaLabel:e.text,iconContent:e.icon,shortcutContent:t?e.shortcut:P.none(),checkMark:P.none(),caret:P.none(),value:e.value},a);return gt(ng({data:og(e),disabled:e.disabled,getApi:function(e){return{setActive:function(t){dm.set(e,t)},isActive:function(){return dm.isOn(e)},isDisabled:function(){return Gh.isDisabled(e)},setDisabled:function(t){return t?Gh.disable(e):Gh.enable(e)}}},onAction:function(t){return o(e.value)},onSetup:function(t){return t.setActive(r),function(){}},triggersSubmenu:!1,itemBehaviours:[]},u,i),{toggling:{toggleClass:yh,toggleOnExecute:!1,selected:e.active}})},fg=function(e,t,n,o,r,i){var a=Ah({presets:n,textContent:t?e.text:P.none(),ariaLabel:e.text,iconContent:e.icon,shortcutContent:P.none(),checkMark:P.none(),caret:P.none(),value:e.value},i);return ng({data:og(e),disabled:e.disabled,getApi:function(){return{}},onAction:function(t){return o(e.value,e.meta)},onSetup:function(){return function(){}},triggersSubmenu:!1,itemBehaviours:[]},a,r)},dg=function(t){return{type:"separator",dom:{tag:"div",classes:["tox-collection__separator"],innerHtml:t.text.getOr("")},components:[]}},mg=function(t,e,n){var o="togglemenuitem"===t.type&&t.active?Th(n.icons):Hh(""),r=sg(t.text,t.meta,o);return gt(ng({data:og(t),disabled:t.disabled,getApi:function(){return 10},onAction:t.onAction,onSetup:function(){return function(){}},triggersSubmenu:!1,itemBehaviours:[]},r,e),"togglemenuitem"===t.type?{toggling:{toggleClass:yh,toggleOnExecute:!1,selected:t.active}}:{})},hg=function(t,e,n){var o,r=t.hasSubmenu?P.some((o=n.icons,{dom:{tag:"span",classes:["tox-collection__item-caret"],innerHtml:Nm("icon-chevron-right",o)}})):P.none(),i=Ah({presets:"normal",iconContent:t.icon,textContent:t.text,ariaLabel:t.text,caret:r,checkMark:P.none(),shortcutContent:t.shortcut},n);return ng({data:og(t),getApi:function(e){return{isDisabled:function(){return Gh.isDisabled(e)},setDisabled:function(t){return t?Gh.disable(e):Gh.enable(e)}}},disabled:t.disabled,onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:t.hasSubmenu,itemBehaviours:[]},i,e)},gg=function(t,e,n){var o=Ah({iconContent:P.none(),textContent:t.text,ariaLabel:t.text,checkMark:P.some(Th(n.icons)),caret:P.none(),shortcutContent:t.shortcut,presets:"normal"},n);return gt(ng({data:og(t),disabled:t.disabled,getApi:function(e){return{setActive:function(t){dm.set(e,t)},isActive:function(){return dm.isOn(e)},isDisabled:function(){return Gh.isDisabled(e)},setDisabled:function(t){return t?Gh.disable(e):Gh.enable(e)}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},o,e),{toggling:{toggleClass:yh,toggleOnExecute:!1,selected:t.active}})},vg=function(e){return(t=cg,n=e.fancytype,Object.prototype.hasOwnProperty.call(t,n)?P.some(t[n]):P.none()).map(function(t){return t(e)});var t,n},pg=function(t){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:(e=t,"color"===e?"tox-swatches":"tox-menu"),tieredMenu:"tox-tiered-menu"};var e},bg=function(t){var e=pg(t);return{backgroundMenu:e.backgroundMenu,selectedMenu:e.selectedMenu,menu:e.menu,selectedItem:e.selectedItem,item:zh(t)}},yg=[Hm.parts().items({})],xg=function(t,e,n){var o=pg(n);return{dom:{tag:"div",classes:I([[o.tieredMenu]])},markers:bg(n)}},wg=function(t,e){var n=bg(e);return 1===t?{mode:"menu",moveOnTab:!0}:"auto"===t?{mode:"grid",selector:"."+n.item,initSize:{numColumns:1,numRows:1}}:{mode:"matrix",rowSelector:"."+("color"===e?"tox-swatches__row":"tox-collection__group")}},kg=function(n,o){return function(t){var e=V(t,o);return E(e,function(t){return{dom:n,components:t}})}},zg=function(e,i){return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===e?["tox-collection--list"]:["tox-collection--grid"])},components:[Hm.parts().items({preprocess:function(t){return"auto"!==e&&1<e?kg({tag:"div",classes:["tox-collection__group"]},e)(t):(n=function(t,e){return"separator"===i[e].type},o=[],r=[],T(t,function(t,e){n(t,e)?(0<r.length&&o.push(r),r=[]):r.push(t)}),0<r.length&&o.push(r),E(o,function(t){return{dom:{tag:"div",classes:["tox-collection__group"]},components:t}}));var n,o,r}})]}};(Qh=$h||($h={}))[Qh.ContentFocus=0]="ContentFocus",Qh[Qh.UiFocus=1]="UiFocus";var Sg=function(t){return console.error(Uo(t)),console.log(t),P.none()},Cg=function(t){return t.icon!==undefined},Og=function(t){return H(t,Cg)},Mg=function(t,e,n){switch(t.type){case"menuitem":return ah(t).fold(Sg,function(t){return P.some(hg(t,e,n))});case"styleitem":return"menuitem"===t.item.type?ah(t.item).fold(Sg,function(t){return P.some(mg(t,e,n))}):"togglemenuitem"===t.item.type?ch(t.item).fold(Sg,function(t){return P.some(mg(t,e,n))}):(console.error("Unsupported style item delegate",t.item),P.none());case"togglemenuitem":return ch(t).fold(Sg,function(t){return P.some(gg(t,e,n))});case"separator":return(r=t,No("separatormenuitem",lh,r)).fold(Sg,function(t){return P.some(dg(t))});case"fancymenuitem":return(o=t,No("fancymenuitem",fh,o)).fold(Sg,function(t){return vg(t)});default:return console.error("Unknown item in general menu",t),P.none()}var o,r},Hg=function(t,e,n,o,r){var i,a,u,c,s,l,f;return"color"===r?{value:t,dom:(i=o,f={dom:{tag:"div",classes:["tox-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[Hm.parts().items({preprocess:"auto"!==i?kg({tag:"div",classes:["tox-swatches__row"]},i):d})]}]}).dom,components:f.components,items:n}:"normal"===r&&"auto"===o?{value:t,dom:(f=zg(o,n)).dom,components:f.components,items:n}:"normal"===r&&1===o?{value:t,dom:(f=zg(1,n)).dom,components:f.components,items:n}:"normal"===r?{value:t,dom:(f=zg(o,n)).dom,components:f.components,items:n}:"toolbar"!==r||"auto"===o?{value:t,dom:(u=e,c=o,s=r,l=pg(s),{tag:"div",classes:I([[l.menu,"tox-menu-"+c+"-column"],u?[l.hasIcons]:[]])}),components:yg,items:n}:{value:t,dom:(a=o,f={dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[Hm.parts().items({preprocess:kg({tag:"div",classes:["tox-collection__group"]},a)})]}).dom,components:f.components,items:n}},Vg=function(t,n,o,r,i,a,u){return Ot(E(t,function(e){return"choiceitem"===e.type?(t=e,No("choicemenuitem",sh,t)).fold(Sg,function(t){return P.some(lg(t,1===o,r,n,a(e.value),i,u))}):P.none();var t}))},Eg=function(t,n,o,r,i){return Ot(E(t,function(t){return(e=t,No("Autocompleter.Item",eh,e)).fold(Sg,function(t){return P.some(fg(t,1===o,"normal",n,r,i))});var e}))},Tg=function(t,e,n,o,r,i,a,u){var c=Og(e),s=Vg(e,n,o,"color"!==r?"normal":"color",i,a,u);return Hg(t,c,s,o,r)},Ag=function(t,e,n,o){var r=Og(e),i=Ot(E(e,function(t){return Mg(t,n,o)}));return Hg(t,r,i,1,"normal")},Bg=function(t){return Bm.singleData(t.value,t)},Dg=function(h,g){var v=ra(Dm.sketch({dom:{tag:"div",classes:["tox-autocompleter"]},components:[],lazySink:g.getSink})),t=function(){return Dm.isOpen(v)},p=function(){t()&&Dm.hide(v)},e=Xt(function(){return oh(h)}),n={onKeypressThrottle:Km(function(t){(" "===t.key?P.none():th(h,e)).fold(p,function(m){m.lookupData.then(function(t){var e,n,o,r,i,a,u,c,s,l,f=(e=m.triggerChar,o=Mt(n=t,function(t){return P.from(t.columns)}).getOr(1),j(n,function(i){var t=i.items;return Eg(t,function(o,r){var t=h.selection.getRng();$m(t,e,t.startContainer.data,t.startOffset).fold(function(){return console.error("Lost context. Cursor probably moved")},function(t){var e=t.rng,n={hide:p};i.onAction(n,e,o,r)})},o,Zh.BUBBLE_TO_SANDBOX,g.providers)})),d=Mt(t,function(t){return P.from(t.columns)}).getOr(1);Dm.showAt(v,{anchor:"selection",root:Ne.fromDom(h.getBody()),getSelection:function(){return P.some({start:function(){return Ne.fromDom(m.range.startContainer)},soffset:function(){return m.range.startOffset},finish:function(){return Ne.fromDom(m.range.endContainer)},foffset:function(){return m.range.endOffset}})}},Hm.sketch((r=Hg("autocompleter-value",!0,f,d,"normal"),i=d,a=$h.ContentFocus,u="normal",c=a===$h.ContentFocus?af():rf(),s=wg(i,u),l=bg(u),{dom:r.dom,components:r.components,items:r.items,value:r.value,markers:{selectedItem:l.selectedItem,item:l.item},movement:s,fakeFocus:a===$h.ContentFocus,focusManager:c,menuBehaviours:hh("auto"!==i?[]:[Yr(function(o,t){dh(o,4,l.item).each(function(t){var e=t.numColumns,n=t.numRows;Td.setGridSize(o,n,e)})})])}))),Dm.getContent(v).each(Ul.highlightFirst)})})},50).throttle,closeIfNecessary:p,isActive:t,getView:function(){return Dm.getContent(v)}};Qm(n,h)},_g=function(m,h){return function(t){if(m(t)){var e,n,o,r,i,a,u,c=Ne.fromDom(t.target),s=function(){t.stopPropagation()},l=function(){t.preventDefault()},f=g(l,s),d=(e=c,n=t.clientX,o=t.clientY,r=s,i=l,a=f,u=t,{target:U(e),x:U(n),y:U(o),stop:r,prevent:i,kill:a,raw:U(u)});h(d)}}},Fg=function(t,e,n,o,r){var i=_g(n,o);return t.dom().addEventListener(e,i,r),{unbind:f(Rg,t,e,i,r)}},Rg=function(t,e,n,o){t.dom().removeEventListener(e,n,o)},Lg=U(!0),Ig=function(t,e,n){return Fg(t,e,Lg,n,!1)},Ng=function(t,e,n){return Fg(t,e,Lg,n,!0)},Pg=function(t,e,n){return ca(t,e,n).isSome()};function jg(n,o){var r=null;return{cancel:function(){null!==r&&(clearTimeout(r),r=null)},schedule:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];r=setTimeout(function(){n.apply(null,t),r=null},o)}}}var Ug=function(t){var e=t.raw();return e.touches===undefined||1!==e.touches.length?P.none():P.some(e.touches[0])},Wg=function(n){var a=Ct(P.none()),o=jg(function(t){a.set(P.none()),n.triggerEvent(Me(),t)},400),r=kt([{key:Ht(),value:function(n){return Ug(n).each(function(t){o.cancel();var e={x:U(t.clientX),y:U(t.clientY),target:n.target};o.schedule(n),a.set(P.some(e))}),P.none()}},{key:Vt(),value:function(t){return o.cancel(),Ug(t).each(function(i){a.get().each(function(t){var e,n,o,r;e=i,n=t,o=Math.abs(e.clientX-n.x()),r=Math.abs(e.clientY-n.y()),(5<o||5<r)&&a.set(P.none())})}),P.none()}},{key:Et(),value:function(e){return o.cancel(),a.get().filter(function(t){return en(t.target(),e.target())}).map(function(t){return n.triggerEvent(Ce(),e)})}}]);return{fireIfReady:function(e,t){return xt(r,t).bind(function(t){return t(e)})}}},Gg=be.detect().browser.isFirefox(),Xg=Mo([tr("triggerEvent"),cr("stopBackspace",!0)]),Yg=function(e,t){var n,o,r,i,a=jo("Getting GUI events settings",Xg,t),u=be.detect().deviceType.isTouch()?["touchstart","touchmove","touchend","gesturestart"]:["mousedown","mouseup","mouseover","mousemove","mouseout","click"],c=Wg(a),s=E(u.concat(["selectstart","input","contextmenu","change","paste","transitionend","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),function(t){return Ig(e,t,function(e){c.fireIfReady(e,t).each(function(t){t&&e.kill()}),a.triggerEvent(t,e)&&e.kill()})}),l=Ig(e,"keydown",function(t){var e;a.triggerEvent("keydown",t)?t.kill():!0!==a.stopBackspace||8!==(e=t).raw().which||M(["input","textarea"],bn(e.target()))||Pg(e.target(),'[contenteditable="true"]')||t.prevent()}),f=(n=e,o=function(t){a.triggerEvent("focusin",t)&&t.kill()},Gg?Ng(n,"focus",o):Ig(n,"focusin",o)),d=(r=e,i=function(t){a.triggerEvent("focusout",t)&&t.kill(),setTimeout(function(){a.triggerEvent(we(),t)},0)},Gg?Ng(r,"blur",i):Ig(r,"focusout",i));return{unbind:function(){T(s,function(t){t.unbind()}),l.unbind(),f.unbind(),d.unbind()}}},qg=function(t,e){var n=xt(t,"target").map(function(t){return t()}).getOr(e);return Ct(n)},Kg=dt([{stopped:[]},{resume:["element"]},{complete:[]}]),Jg=function(t,o,e,n,r,i){var a,u,c,s,l=t(o,n),f=(a=e,u=r,c=Ct(!1),s=Ct(!1),{stop:function(){c.set(!0)},cut:function(){s.set(!0)},isStopped:c.get,isCut:s.get,event:U(a),setSource:u.set,getSource:u.get});return l.fold(function(){return i.logEventNoHandlers(o,n),Kg.complete()},function(e){var n=e.descHandler();return yi(n)(f),f.isStopped()?(i.logEventStopped(o,e.element(),n.purpose()),Kg.stopped()):f.isCut()?(i.logEventCut(o,e.element(),n.purpose()),Kg.complete()):rn(e.element()).fold(function(){return i.logNoParent(o,e.element(),n.purpose()),Kg.complete()},function(t){return i.logEventResponse(o,e.element(),n.purpose()),Kg.resume(t)})})},$g=function(e,n,o,t,r,i){return Jg(e,n,o,t,r,i).fold(function(){return!0},function(t){return $g(e,n,o,t,r,i)},function(){return!1})},Qg=function(t,e,n){var o,r,i=(o=e,r=Ct(!1),{stop:function(){r.set(!0)},cut:N,isStopped:r.get,isCut:U(!1),event:U(o),setSource:a("Cannot set source of a broadcasted event"),getSource:a("Cannot get source of a broadcasted event")});return T(t,function(t){var e=t.descHandler();yi(e)(i)}),i.isStopped()},Zg=function(t,e,n,o,r){var i=qg(n,o);return $g(t,e,n,o,i,r)},tv=Pe("element","descHandler"),ev=function(t,e){return{id:U(t),descHandler:U(e)}};function nv(){var i={};return{registerId:function(o,r,t){tt(t,function(t,e){var n=i[e]!==undefined?i[e]:{};n[r]=bi(t,o),i[e]=n})},unregisterId:function(n){tt(i,function(t,e){t.hasOwnProperty(n)&&delete t[n]})},filterByType:function(t){return xt(i,t).map(function(t){return ot(t,function(t,e){return ev(e,t)})}).getOr([])},find:function(t,e,n){var r=bt(e)(i);return _r(n,function(t){return n=r,ri(o=t).fold(function(){return P.none()},function(t){var e=bt(t);return n.bind(e).map(function(t){return tv(o,t)})});var n,o},t)}}}function ov(){var o=nv(),r={},i=function(o){var t=o.element();return ri(t).fold(function(){return t="uid-",e=o.element(),n=jn(ei+t),oi(e,n),n;var t,e,n},function(t){return t})},a=function(t){ri(t.element()).each(function(t){r[t]=undefined,o.unregisterId(t)})};return{find:function(t,e,n){return o.find(t,e,n)},filter:function(t){return o.filterByType(t)},register:function(t){var e=i(t);St(r,e)&&function(t,e){var n=r[e];if(n!==t)throw new Error('The tagId "'+e+'" is already used by: '+Tn(n.element())+"\nCannot use it for: "+Tn(t.element())+"\nThe conflicting element is"+(Sr(n.element())?" ":" not ")+"already in the DOM");a(t)}(t,e);var n=[t];o.registerId(n,e,t.events()),r[e]=t},unregister:a,getById:function(t){return bt(t)(r)}}}var rv,iv,av=Cl({name:"Container",factory:function(t){var e=t.dom,n=e.attributes,o=Gn(e,["attributes"]);return{uid:t.uid,dom:Wn({tag:"div",attributes:Wn({role:"presentation"},n)},o),components:t.components,behaviours:Ss(t.containerBehaviours),events:t.events,domModification:t.domModification,eventOrder:t.eventOrder}},configFields:[cr("components",[]),zs("containerBehaviours",[]),cr("events",{}),cr("domModification",{}),cr("eventOrder",{})]}),uv=function(n){var o=function(e){return rn(n.element()).fold(function(){return!0},function(t){return en(e,t)})},r=ov(),s=function(t,e){return r.find(o,t,e)},t=Yg(n.element(),{triggerEvent:function(a,u){return Rn(a,u.target(),function(t){return e=s,n=a,r=t,i=(o=u).target(),Zg(e,n,o,i,r);var e,n,o,r,i})}}),i={debugInfo:U("real"),triggerEvent:function(e,n,o){Rn(e,n,function(t){Zg(s,e,o,n,t)})},triggerFocus:function(u,c){ri(u).fold(function(){tf(u)},function(t){Rn(xe(),u,function(t){var e,n,o,r,i,a;e=s,n=xe(),o={originator:U(c),kill:N,prevent:N,target:U(u)},i=t,a=qg(o,r=u),Jg(e,n,o,r,a,i)})})},triggerEscape:function(t,e){i.triggerEvent("keydown",t.element(),e.event())},getByUid:function(t){return h(t)},getByDom:function(t){return g(t)},build:ra,addToGui:function(t){u(t)},removeFromGui:function(t){c(t)},addToWorld:function(t){e(t)},removeFromWorld:function(t){a(t)},broadcast:function(t){f(t)},broadcastOn:function(t,e){d(t,e)},broadcastEvent:function(t,e){m(t,e)},isConnected:U(!0)},e=function(t){t.connect(i),wn(t.element())||(r.register(t),T(t.components(),e),i.triggerEvent(Ee(),t.element(),{target:U(t.element())}))},a=function(t){wn(t.element())||(T(t.components(),a),r.unregister(t)),t.disconnect()},u=function(t){es(n,t)},c=function(t){rs(t)},l=function(n){var t=r.filter(ke());T(t,function(t){var e=t.descHandler();yi(e)(n)})},f=function(t){l({universal:U(!0),data:U(t)})},d=function(t,e){l({universal:U(!1),channels:U(t),data:U(e)})},m=function(t,e){var n=r.filter(t);return Qg(n,e)},h=function(t){return r.getById(t).fold(function(){return ft.error(new Error('Could not find component with uid: "'+t+'" in system.'))},ft.value)},g=function(t){var e=ri(t).getOr("not found");return h(e)};return e(n),{root:U(n),element:n.element,destroy:function(){t.unbind(),gn(n.element())},add:u,remove:c,getByUid:h,getByDom:g,addToWorld:e,removeFromWorld:a,broadcast:f,broadcastOn:d,broadcastEvent:m}},cv=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),sv=tinymce.util.Tools.resolve("tinymce.EditorManager"),lv=function(t){return P.from(t.settings.min_width).filter(S)},fv=function(t){return P.from(t.settings.min_height).filter(S)},dv=function(e){var t=Q(e.settings),n=A(t,function(t){return/^toolbar([1-9])$/.test(t)}),o=E(n,function(t){return e.getParam(t,!1,"string")}),r=A(o,function(t){return"string"==typeof t});return 0<r.length?P.some(r):P.none()},mv=jn("form-component-change"),hv=jn("form-close"),gv=jn("form-cancel"),vv=jn("form-action"),pv=jn("form-submit"),bv=jn("form-block"),yv=jn("form-unblock"),xv=jn("form-tabchange"),wv=jn("form-resize"),kv=U([cr("prefix","form-field"),zs("fieldBehaviours",[El,Kd])]),zv=U([Zs({schema:[$o("dom")],name:"label"}),Zs({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[$o("text")],name:"aria-descriptor"}),$s({factory:{sketch:function(t){var e=pt(t,["factory"]);return t.factory.sketch(e)}},schema:[$o("factory")],name:"field"})]),Sv=Ol({name:"FormField",configFields:kv(),partFields:zv(),factory:function(r,t,e,n){var o=Cs(r.fieldBehaviours,[El.config({find:function(t){return fl(t,r,"field")}}),Kd.config({store:{mode:"manual",getValue:function(t){return El.getCurrent(t).bind(Kd.getValue)},setValue:function(t,e){El.getCurrent(t).each(function(t){Kd.setValue(t,e)})}}})]),i=Fr([Yr(function(t,e){var o=ml(t,r,["label","field","aria-descriptor"]);o.field().each(function(n){var e=jn(r.prefix);o.label().each(function(t){Sn(t.element(),"for",e),Sn(n.element(),"id",e)}),o["aria-descriptor"]().each(function(t){var e=jn(r.prefix);Sn(t.element(),"id",e),Sn(n.element(),"aria-labelledby",e)})})})]),a={getField:function(t){return fl(t,r,"field")},getLabel:function(t){return fl(t,r,"label")}};return{uid:r.uid,dom:r.dom,components:t,behaviours:o,events:i,apis:a}},apis:{getField:function(t,e){return t.getField(e)},getLabel:function(t,e){return t.getLabel(e)}}}),Cv=Object.freeze({getCoupled:function(t,e,n,o){return n.getOrCreate(t,e,o)}}),Ov=[Qo("others",Io(ft.value,Go()))],Mv=Aa({fields:Ov,name:"coupling",apis:Cv,state:Object.freeze({init:function(t){var i={},e=U({});return gi({readState:e,getOrCreate:function(n,o,r){var t=Q(o.others);if(t)return xt(i,r).getOrThunk(function(){var t=xt(o.others,r).getOrDie("No information found for coupled component: "+r)(n),e=n.getSystem().build(t);return i[r]=e});throw new Error("Cannot find coupled component: "+r+". Known coupled components: "+yo(t,null,2))}})}})}),Hv=Object.freeze({events:function(t,e){var n=t.stream.streams.setup(t,e);return Fr([Ir(t.event,n),qr(function(){return e.cancel()})].concat(t.cancelEvent.map(function(t){return[Ir(t,function(){return e.cancel()})]}).getOr([])))}}),Vv=function(t){var e=Ct(null);return gi({readState:function(){return{timer:null!==e.get()?"set":"unset"}},setTimer:function(t){e.set(t)},cancel:function(){var t=e.get();null!==t&&t.cancel()}})},Ev=Object.freeze({throttle:Vv,init:function(t){return t.stream.streams.state(t)}}),Tv=[Qo("stream",Wo("mode",{throttle:[$o("delay"),cr("stopEvent",!0),ka("streams",{setup:function(t,e){var n=t.stream,o=Km(t.onStream,n.delay);return e.setTimer(o),function(t,e){o.throttle(t,e),n.stopEvent&&e.stop()}},state:Vv})]})),cr("event","input"),rr("cancelEvent"),xa("onStream")],Av=Aa({fields:Tv,name:"streaming",active:Hv,state:Ev}),Bv=function(t){var n=P.none(),e=[],o=function(t){r()?a(t):e.push(t)},r=function(){return n.isSome()},i=function(t){T(t,a)},a=function(e){n.each(function(t){setTimeout(function(){e(t)},0)})};return t(function(t){n=P.some(t),i(e),e=[]}),{get:o,map:function(n){return Bv(function(e){o(function(t){e(n(t))})})},isReady:r}},Dv={nu:Bv,pure:function(e){return Bv(function(t){t(e)})}},_v=function(e){var t=function(t){var o;e((o=t,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this;setTimeout(function(){o.apply(n,t)},0)}))},n=function(){return Dv.nu(t)};return{map:function(o){return _v(function(n){t(function(t){var e=o(t);n(e)})})},bind:function(n){return _v(function(e){t(function(t){n(t).get(e)})})},anonBind:function(n){return _v(function(e){t(function(t){n.get(e)})})},toLazy:n,toCached:function(){var e=null;return _v(function(t){null===e&&(e=n()),e.get(t)})},get:t}},Fv={nu:_v,pure:function(e){return _v(function(t){t(e)})}},Rv=U("sink"),Lv=U(Zs({name:Rv(),overrides:U({dom:{tag:"div"},behaviours:Ea([Qc.config({useFixed:!0})]),events:Fr([Wr(Lt()),Wr(Tt()),Wr(jt())])})}));(iv=rv||(rv={}))[iv.HighlightFirst=0]="HighlightFirst",iv[iv.HighlightNone=1]="HighlightNone";var Iv=function(t,e){var n=t.getHotspot(e).getOr(e);return t.layouts.fold(function(){return{anchor:"hotspot",hotspot:n}},function(t){return{anchor:"hotspot",hotspot:n,layouts:t}})},Nv=function(t,e,n,o,r,i,a){var u,c,s,l,f,d,m,h,g,v,p=Iv(t,n);return(c=p,l=o,f=r,d=a,m=e,h=s=n,g=(0,(u=t).fetch)(h).map(m),v=Wv(s,u),g.map(function(t){return Bm.sketch(Wn({},f.menu(),{uid:ii(""),data:t,highlightImmediately:d===rv.HighlightFirst,onOpenMenu:function(t,e){var n=v().getOrDie();Qc.position(n,c,e),ps.decloak(l)},onOpenSubmenu:function(t,e,n){var o=v().getOrDie();Qc.position(o,{anchor:"submenu",item:e},n),ps.decloak(l)},onEscape:function(){return tm.focus(s),ps.close(l),P.some(!0)}}))})).map(function(t){return ps.cloak(o),ps.open(o,t),i(o),o})},Pv=function(t,e,n,o,r,i,a){return ps.close(o),Fv.pure(o)},jv=function(t,e,n,o,r,i){var a=Mv.getCoupled(n,"sandbox");return(ps.isOpen(a)?Pv:Nv)(t,e,n,a,o,r,i)},Uv=function(t,e,n){var o,r,i=El.getCurrent(e).getOr(e),a=qa(t.element());n?Ni(i.element(),"min-width",a+"px"):(o=i.element(),r=a,Ya.set(o,r))},Wv=function(e,t){return e.getSystem().getByUid(t.uid+"-"+Rv()).map(function(t){return function(){return ft.value(t)}}).getOrThunk(function(){return t.lazySink.fold(function(){return function(){return ft.error(new Error("No internal sink is specified, nor could an external sink be found"))}},function(t){return function(){return t(e)}})})},Gv=function(o,r,i){var e,a=(e=jn("aria-owns"),{id:U(e),link:function(t){Sn(t,"aria-owns",e)},unlink:function(t){Hn(t,"aria-owns")}}),t=Wv(r,o);return{dom:{tag:"div",classes:o.sandboxClasses,attributes:{id:a.id()}},behaviours:Ms(o.sandboxBehaviours,[Kd.config({store:{mode:"memory",initialValue:r}}),ps.config({onOpen:function(t,e){var n=Iv(o,r);a.link(r.element()),o.matchWidth&&Uv(n.hotspot,e,o.useMinWidth),o.onOpen(n,t,e),i!==undefined&&i.onOpen!==undefined&&i.onOpen(t,e)},onClose:function(t,e){a.unlink(r.element()),i!==undefined&&i.onClose!==undefined&&i.onClose(t,e)},isPartOf:function(t,e,n){return la(e,n)||la(r,n)},getAttachPoint:function(){return t().getOrDie()}}),El.config({find:function(t){return ps.getState(t).bind(function(t){return El.getCurrent(t)})}}),ws({isExtraPart:U(!1)})])}},Xv=function(t,e,n){var o=Kd.getValue(n);Kd.setValue(e,o),qv(e)},Yv=function(t,e){var n=t.element(),o=Yi(n),r=n.dom();"number"!==On(n,"type")&&e(r,o)},qv=function(t){Yv(t,function(t,e){return t.setSelectionRange(e.length,e.length)})},Kv=function(t,e,o){if(t.selectsOver){var n=Kd.getValue(e),r=t.getDisplayText(n),i=Kd.getValue(o);return 0===t.getDisplayText(i).indexOf(r)?P.some(function(){var t,n;Xv(0,e,o),t=e,n=r.length,Yv(t,function(t,e){return t.setSelectionRange(n,e.length)})}):P.none()}return P.none()},Jv=U([rr("data"),cr("inputAttributes",{}),cr("inputStyles",{}),cr("tag","input"),cr("inputClasses",[]),ba("onSetValue"),cr("styles",{}),cr("eventOrder",{}),zs("inputBehaviours",[Kd,tm]),cr("selectOnFocus",!0)]),$v=function(t){return Ea([tm.config({onFocus:!1===t.selectOnFocus?N:function(t){var e=t.element(),n=Yi(e);e.dom().setSelectionRange(0,n.length)}})])},Qv=function(t){return{tag:t.tag,attributes:Wn({type:"input"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}},Zv=U("alloy.typeahead.itemexecute"),tp=function(){return[cr("sandboxClasses",[]),Os("sandboxBehaviours",[El,La,ps,Kd])]},ep=U([rr("lazySink"),$o("fetch"),cr("minChars",5),cr("responseTime",1e3),ba("onOpen"),cr("getHotspot",P.some),cr("layouts",P.none()),cr("eventOrder",{}),hr("model",{},[cr("getDisplayText",function(t){return t.meta!==undefined&&t.meta.text!==undefined?t.meta.text:t.value}),cr("selectsOver",!0),cr("populateFromBrowse",!0)]),ba("onSetValue"),ya("onExecute"),ba("onItemExecute"),cr("inputClasses",[]),cr("inputAttributes",{}),cr("inputStyles",{}),cr("matchWidth",!0),cr("useMinWidth",!1),cr("dismissOnBlur",!0),va(["openClass"]),rr("initialData"),zs("typeaheadBehaviours",[tm,Kd,Av,Td,dm,Mv]),gr("previewing",function(){return Ct(!0)})].concat(Jv()).concat(tp())),np=U([Qs({schema:[ga()],name:"menu",overrides:function(o){return{fakeFocus:!0,onHighlight:function(e,n){o.previewing.get()?e.getSystem().getByUid(o.uid).each(function(t){Kv(o.model,t,n).fold(function(){return Ul.dehighlight(e,n)},function(t){return t()})}):e.getSystem().getByUid(o.uid).each(function(t){o.model.populateFromBrowse&&Xv(o.model,t,n)}),o.previewing.set(!1)},onExecute:function(t,e){return t.getSystem().getByUid(o.uid).toOption().map(function(t){return yr(t,Zv(),{item:e}),!0})},onHover:function(t,e){o.previewing.set(!1),t.getSystem().getByUid(o.uid).each(function(t){o.model.populateFromBrowse&&Xv(o.model,t,e)})}}}})]),op=Ol({name:"Typeahead",configFields:ep(),partFields:np(),factory:function(r,t,e,i){var n=function(t,e,n){r.previewing.set(!1);var o=Mv.getCoupled(t,"sandbox");ps.isOpen(o)?El.getCurrent(o).each(function(t){Ul.getHighlighted(t).fold(function(){n(t)},function(){zr(o,t.element(),"keydown",e)})}):Nv(r,a(t),t,o,i,function(t){El.getCurrent(t).each(n)},rv.HighlightFirst).get(N)},o=$v(r),a=function(o){return function(t){var e=rt(t.menus),n=j(e,function(t){return A(t.items,function(t){return"item"===t.type})});return Kd.getState(o).update(E(n,function(t){return t.data})),t}},u=[tm.config({}),Kd.config({onSetValue:r.onSetValue,store:Wn({mode:"dataset",getDataKey:function(t){return Yi(t.element())},getFallbackEntry:function(t){return{value:t,meta:{}}},setValue:function(t,e){qi(t.element(),r.model.getDisplayText(e))}},r.initialData.map(function(t){return wt("initialValue",t)}).getOr({}))}),Av.config({stream:{mode:"throttle",delay:r.responseTime,stopEvent:!1},onStream:function(t,e){var n=Mv.getCoupled(t,"sandbox");if(tm.isFocused(t)&&Yi(t.element()).length>=r.minChars){var o=El.getCurrent(n).bind(function(t){return Ul.getHighlighted(t).map(Kd.getValue)});r.previewing.set(!0),Nv(r,a(t),t,n,i,function(t){El.getCurrent(n).each(function(t){o.fold(function(){r.model.selectsOver&&Ul.highlightFirst(t)},function(e){Ul.highlightBy(t,function(t){return Kd.getValue(t).value===e.value}),Ul.getHighlighted(t).orThunk(function(){return Ul.highlightFirst(t),P.none()})})})},rv.HighlightFirst).get(N)}},cancelEvent:Ve()}),Td.config({mode:"special",onDown:function(t,e){return n(t,e,Ul.highlightFirst),P.some(!0)},onEscape:function(t){var e=Mv.getCoupled(t,"sandbox");return ps.isOpen(e)?(ps.close(e),P.some(!0)):P.none()},onUp:function(t,e){return n(t,e,Ul.highlightLast),P.some(!0)},onEnter:function(e){var t=Mv.getCoupled(e,"sandbox"),n=ps.isOpen(t);if(n&&!r.previewing.get())return El.getCurrent(t).bind(function(t){return Ul.getHighlighted(t)}).map(function(t){return yr(e,Zv(),{item:t}),!0});var o=Kd.getValue(e);return br(e,Ve()),r.onExecute(t,e,o),n&&ps.close(t),P.some(!0)}}),dm.config({toggleClass:r.markers.openClass,aria:{mode:"pressed",syncWithExpanded:!0}}),Mv.config({others:{sandbox:function(t){return Gv(r,t,{onOpen:d,onClose:d})}}}),ym("typeaheadevents",[Jr(function(t){var e=N;jv(r,a(t),t,i,e,rv.HighlightFirst).get(N)}),Ir(Zv(),function(t,e){var n=Mv.getCoupled(t,"sandbox");Xv(r.model,t,e.event().item()),br(t,Ve()),r.onItemExecute(t,n,e.event().item(),Kd.getValue(t)),ps.close(n),qv(t)})].concat(r.dismissOnBlur?[Ir(we(),function(t){var e=Mv.getCoupled(t,"sandbox");nf(e.element()).isNone()&&ps.close(e)})]:[]))];return{uid:r.uid,dom:Qv(r),behaviours:Wn({},o,Cs(r.typeaheadBehaviours,u)),eventOrder:r.eventOrder}}}),rp=function(t,e,n){var o=ap(t,e,n);return Sv.sketch(o)},ip=function(t,e){return rp(t,e,[])},ap=function(t,e,n){return{dom:up(n),components:t.toArray().concat([e])}},up=function(t){return{tag:"div",classes:["tox-form__group"].concat(t)}},cp=function(t,e){return Sv.parts().label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}})},sp=function(t){return St(t,"getSubmenuItems")?(n=(e=t).getSubmenuItems(),o=lp(n),{item:e,menus:gt(o.menus,wt(e.value,o.items)),expansions:gt(o.expansions,wt(e.value,e.value))}):{item:t,menus:{},expansions:{}};var e,n,o},lp=function(t){return B(t,function(t,e){var n=xt(e,"value").getOrThunk(function(){return jn("generated-menu-item")}),o=gt({value:n},e),r=sp(o);return{menus:gt(t.menus,r.menus),items:[r.item].concat(t.items),expansions:gt(t.expansions,r.expansions)}},{menus:{},expansions:{},items:[]})},fp=function(t,n,o){var e=jn("primary-menu"),r=lp(t),i=Ag(e,r.items,n,o),a=et(r.menus,function(t,e){return Ag(e,t,n,o)}),u=gt(a,wt(e,i));return Bm.tieredData(e,u,r.expansions)},dp=Cl({name:"Input",configFields:Jv(),factory:function(t,e){return{uid:t.uid,dom:Qv(t),components:[],behaviours:(n=t,Wn({},$v(n),Cs(n.inputBehaviours,[Kd.config({store:{mode:"manual",initialValue:n.data.getOr(undefined),getValue:function(t){return Yi(t.element())},setValue:function(t,e){Yi(t.element())!==e&&qi(t.element(),e)}},onSetValue:n.onSetValue})]))),eventOrder:t.eventOrder};var n}}),mp=be.detect().browser.isFirefox(),hp={position:"absolute",left:"-9999px"},gp=function(t,e,n){var o,r,i,a=function(t,e){var n=Ne.fromTag("span",t.dom());Sn(n,"role","presentation");var o=Ne.fromText(e,t.dom());return dn(n,o),n}(nn(e),n);mp&&(o=e,r=a,i=jn("ephox-alloy-aria-voice"),Sn(r,"id",i),Sn(o,"aria-describedby",i)),Cn(a,t(n)),Pi(a,hp),dn(e,a),setTimeout(function(){Hn(a,"aria-live"),gn(a)},1e3)},vp=function(t){return{"aria-live":"assertive","aria-atomic":"true",role:"alert"}},pp=["input","textarea"],bp=function(t){var e=bn(t);return M(pp,e)},yp=function(t,e){var n=e.getRoot(t).getOr(t.element());Ai(n,e.invalidClass),e.notify.each(function(e){bp(t.element())&&Hn(n,"title"),e.getContainer(t).each(function(t){pn(t,e.validHtml)}),e.onValid(t)})},xp=function(n,t,e,o){var r=t.getRoot(n).getOr(n.element());Ti(r,t.invalidClass),t.notify.each(function(t){var e;bp(n.element())&&Sn(n.element(),"title",o),e=Cr(),gp(vp,e,o),t.getContainer(n).each(function(t){pn(t,o)}),t.onInvalid(n,o)})},wp=function(e,t,n){return t.validator.fold(function(){return Fv.pure(ft.value(!0))},function(t){return t.validate(e)})},kp=function(e,n,t){return n.notify.each(function(t){t.onValidate(e)}),wp(e,n).map(function(t){return e.getSystem().isConnected()?t.fold(function(t){return xp(e,n,0,t),ft.error(t)},function(t){return yp(e,n),ft.value(t)}):ft.error("No longer in system")})},zp=Object.freeze({markValid:yp,markInvalid:xp,query:wp,run:kp,isInvalid:function(t,e){var n=e.getRoot(t).getOr(t.element());return Di(n,e.invalidClass)}}),Sp=Object.freeze({events:function(e,t){return e.validator.map(function(t){return Fr([Ir(t.onEvent,function(t){kp(t,e).get(d)})].concat(t.validateOnLoad?[Yr(function(t){kp(t,e).get(N)})]:[]))}).getOr({})}}),Cp=[$o("invalidClass"),cr("getRoot",P.none),ur("notify",[cr("aria","alert"),cr("getContainer",P.none),cr("validHtml",""),ba("onValid"),ba("onInvalid"),ba("onValidate")]),ur("validator",[$o("validate"),cr("onEvent","input"),cr("validateOnLoad",!0)])],Op=Aa({fields:Cp,name:"invalidating",active:Sp,apis:zp,extra:{validation:function(n){return function(t){var e=Kd.getValue(t);return Fv.pure(n(e))}}}}),Mp=Object.freeze({exhibit:function(t,e){return pi({attributes:kt([{key:e.tabAttr,value:"true"}])})}}),Hp=[cr("tabAttr","data-alloy-tabstop")],Vp=Aa({fields:Hp,name:"tabstopping",active:Mp}),Ep="choiceitem",Tp=Ct([{type:Ep,text:"Turquoise",value:"#18BC9B"},{type:Ep,text:"Green",value:"#2FCC71"},{type:Ep,text:"Blue",value:"#3598DB"},{type:Ep,text:"Purple",value:"#9B59B6"},{type:Ep,text:"Navy Blue",value:"#34495E"},{type:Ep,text:"Dark Turquoise",value:"#18A085"},{type:Ep,text:"Dark Green",value:"#27AE60"},{type:Ep,text:"Medium Blue",value:"#2880B9"},{type:Ep,text:"Medium Purple",value:"#8E44AD"},{type:Ep,text:"Midnight Blue",value:"#2B3E50"},{type:Ep,text:"Yellow",value:"#F1C40F"},{type:Ep,text:"Orange",value:"#E67E23"},{type:Ep,text:"Red",value:"#E74C3C"},{type:Ep,text:"Light Gray",value:"#ECF0F1"},{type:Ep,text:"Gray",value:"#95A5A6"},{type:Ep,text:"Dark Yellow",value:"#F29D12"},{type:Ep,text:"Dark Orange",value:"#D35400"},{type:Ep,text:"Dark Red",value:"#E74C3C"},{type:Ep,text:"Medium Gray",value:"#BDC3C7"},{type:Ep,text:"Dark Gray",value:"#7E8C8D"},{type:Ep,text:"Black",value:"#000000"},{type:Ep,text:"White",value:"#ffffff"}]),Ap=function(t){var e,n=[];for(e=0;e<t.length;e+=2)n.push({text:t[e+1],value:"#"+t[e],type:"choiceitem"});return n},Bp=function(t){return t.getParam("color_map")},Dp=function(t){var e,n;e=Fp,(n=Bp(t))!==undefined&&e(Ap(n))},_p=function(){return Tp.get()},Fp=function(t){Tp.set(t)},Rp=function(t,e){return t.getParam("color_cols",e,"number")},Lp=function(t){return!1!==t.getParam("custom_colors")},Ip=function(t){Dp(t)},Np=_p,Pp=function(t){Fp(_p().concat([{type:"choiceitem",text:t,value:t}]))},jp=function(t){return Math.ceil(Math.sqrt(t))},Up=function(t){var e=Np(),n=jp(e.length);return Rp(t,n)},Wp=function(t){return"remove"===t?'<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg"><path d="M25 5L5 25" stroke-width="1.5" fill="none"></path></svg>':"custom"===t?"color-picker":'<div style="width: 24px; height: 24px; background-color: '+t+';"></div>'},Gp=function(e,n,t,o,r){"custom"===o?qp(e)(function(t){Pp(t),e.execCommand("mceApplyTextcolor",n,t),r(t)},"#000000"):"remove"===o?(r(""),e.execCommand("mceRemoveTextcolor",n)):(r(o),e.execCommand("mceApplyTextcolor",n,o))},Xp=function(i){return function(t){var e,n,o,r;t(Np().concat((e=i,o={type:n="choiceitem",text:"Remove",icon:Wp("remove"),value:"remove"},r={type:n,text:"Custom",icon:Wp("custom"),value:"custom"},e?[o,r]:[o])))}},Yp=function(e,r,n,t){var i;e.ui.registry.addSplitButton(r,(i=Ct(null),{type:"splitbutton",tooltip:t,presets:"color",icon:"forecolor"===r?"text-color":"background-color",select:function(){return!1},columns:Up(e),fetch:Xp(Lp(e)),onAction:function(t){null!==i.get()&&Gp(e,n,0,i.get(),function(){})},onItemAction:function(o,t){Gp(e,n,0,t,function(t){var e,n;i.set(t),e="forecolor"===r?"color":"Rectangle",n=t,o.setIconFill(e,n),o.setIconStroke(e,n)})}}))},qp=function(r){return function(t,e){var n,o=(n=t,function(t){var e=t.getData();n(e.colorpicker),t.close()});r.windowManager.open({title:"Color Picker",size:"normal",body:{type:"panel",items:[{type:"colorpicker",name:"colorpicker",label:"Color"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{colorpicker:e},onAction:function(t,e){"hex-valid"===e.name&&(e.value?t.enable("ok"):t.disable("ok"))},onSubmit:o,onClose:function(){r.focus()}})}},Kp={register:function(t){var i;Ip(t),(i=t).addCommand("mceApplyTextcolor",function(t,e){var n,o,r;o=t,r=e,(n=i).undoManager.transact(function(){n.focus(),n.formatter.apply(o,{value:r}),n.nodeChanged()})}),i.addCommand("mceRemoveTextcolor",function(t){var e,n;n=t,(e=i).undoManager.transact(function(){e.focus(),e.formatter.remove(n,{value:null},null,!0),e.nodeChanged()})}),Yp(t,"forecolor","forecolor","Color"),Yp(t,"backcolor","hilitecolor","Background color")},getFetch:Xp,colorPickerDialog:qp,getCurrentColor:function(t,n){var o;return t.dom.getParents(t.selection.getStart(),function(t){var e;(e=t.style["forecolor"===n?"color":"background-color"])&&(o=o||e)}),o},getColorCols:Up,calcCols:jp},Jp=U([$o("dom"),$o("fetch"),ba("onOpen"),ya("onExecute"),cr("getHotspot",P.some),cr("layouts",P.none()),zs("dropdownBehaviours",[dm,Mv,Td,tm]),$o("toggleClass"),cr("eventOrder",{}),rr("lazySink"),cr("matchWidth",!1),cr("useMinWidth",!1),rr("role")].concat(tp())),$p=U([Qs({schema:[ga()],name:"menu",defaults:function(t){return{onExecute:t.onExecute}}}),Lv()]),Qp=Ol({name:"Dropdown",configFields:Jp(),partFields:$p(),factory:function(e,t,n,o){var r,i=function(t){ps.getState(t).each(function(t){Bm.highlightPrimary(t)})},a={expand:function(t){dm.isOn(t)||jv(e,function(t){return t},t,o,N,rv.HighlightNone).get(N)},open:function(t){dm.isOn(t)||jv(e,function(t){return t},t,o,N,rv.HighlightFirst).get(N)},isOpen:dm.isOn,close:function(t){dm.isOn(t)&&jv(e,function(t){return t},t,o,N,rv.HighlightFirst).get(N)}},u=function(t,e){return xr(t),P.some(!0)};return{uid:e.uid,dom:e.dom,components:t,behaviours:Cs(e.dropdownBehaviours,[dm.config({toggleClass:e.toggleClass,aria:{mode:"pressed",syncWithExpanded:!0}}),Mv.config({others:{sandbox:function(t){return Gv(e,t,{onOpen:function(){dm.on(t)},onClose:function(){dm.off(t)}})}}}),Td.config({mode:"special",onSpace:u,onEnter:u,onDown:function(t,e){if(Qp.isOpen(t)){var n=Mv.getCoupled(t,"sandbox");i(n)}else Qp.open(t);return P.some(!0)},onEscape:function(t,e){return Qp.isOpen(t)?(Qp.close(t),P.some(!0)):P.none()}}),tm.config({})]),events:_m(P.some(function(t){jv(e,function(t){return t},t,o,i,rv.HighlightFirst).get(N)})),eventOrder:Wn({},e.eventOrder,(r={},r[ze()]=["toggling","alloy.base.behaviour"],r)),apis:a,domModification:{attributes:{role:e.role.getOr("button"),"aria-haspopup":"true"}}}},apis:{open:function(t,e){return t.open(e)},expand:function(t,e){return t.expand(e)},close:function(t,e){return t.close(e)},isOpen:function(t,e){return t.isOpen(e)}}}),Zp=Aa({fields:[],name:"unselecting",active:Object.freeze({events:function(t){return Fr([Rr(Wt(),U(!0))])},exhibit:function(t,e){return pi({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}})}),tb=jn("color-change"),eb=jn("hex-change"),nb=function(t,e,o){var n,r,i=Sv.parts().field({factory:dp,inputClasses:["tox-textfield"],onSetValue:function(t){return Op.run(t).get(function(){})},inputBehaviours:Ea([Vp.config({}),Op.config({invalidClass:"tox-textbox-field-invalid",getRoot:function(t){return rn(t.element())},notify:{onValid:function(t){var e=Kd.getValue(t);yr(t,tb,{color:e})}},validator:{validateOnLoad:!1,validate:function(t){var e=Kd.getValue(t);if(0===e.length)return Fv.pure(ft.value(!0));var n=Ne.fromTag("span");Ni(n,"background-color",e);var o=Wi(n,"background-color").fold(function(){return ft.error("blah")},function(t){return ft.value(e)});return Fv.pure(o)}}})]),selectOnFocus:!1}),a=t.label.map(function(t){return cp(t,e.providers)}),u=function(t,e){yr(t,eb,{value:e})},c=Rm((n={dom:{tag:"span"},layouts:P.some({onRtl:function(){return[Wu]},onLtr:function(){return[Gu]}}),components:[],fetch:Kp.getFetch(o.hasCustomColors()),onItemAction:function(n){e.getSink().each(function(t){c.getOpt(t).each(function(e){"custom"===n?o.colorPicker(function(t){u(e,t),Pp(t)},"#ffffff"):u(e,"remove"===n?"":n)})})}},r=e,Qp.sketch({dom:n.dom,components:n.components,toggleClass:"mce-active",dropdownBehaviours:Ea([Zp.config({}),Vp.config({})]),layouts:n.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:r.getSink,fetch:function(){return Fv.nu(function(t){return n.fetch(t)}).map(function(t){return Bg(gt(Tg(jn("menu-value"),t,function(t){n.onItemAction(t)},5,"color",Zh.CLOSE_ON_EXECUTE,function(){return!1},r.providers),{movement:wg(5,"color")}))})},parts:{menu:xg(0,0,"color")}})));return Sv.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:a.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[i,c.asSpec()]}]),fieldBehaviours:Ea([ym("form-field-events",[Ir(tb,function(t,e){c.getOpt(t).each(function(t){Ni(t.element(),"background-color",e.event().color())})}),Ir(eb,function(e,n){Sv.getField(e).each(function(t){Kd.setValue(t,n.event().value()),El.getCurrent(e).each(tm.focus)})})])])})},ob=be.detect().deviceType.isTouch(),rb=Zs({schema:[$o("dom")],name:"label"}),ib=function(t){return Zs({name:t+"-edge",overrides:function(o){return o.model.manager.edgeActions[t].fold(function(){return{}},function(n){var t=Fr([Nr(Ht(),n,[o])]),e=Fr([Nr(Tt(),n,[o]),Nr(At(),function(t,e){e.mouseIsDown.get()&&n(t,e)},[o])]);return{events:ob?t:e}})}})},ab=ib("top-left"),ub=ib("top"),cb=ib("top-right"),sb=ib("right"),lb=ib("bottom-right"),fb=ib("bottom"),db=ib("bottom-left"),mb=[rb,ib("left"),sb,ub,fb,ab,cb,db,lb,$s({name:"thumb",defaults:U({dom:{styles:{position:"absolute"}}}),overrides:function(t){return{events:Fr([jr(Ht(),t,"spectrum"),jr(Vt(),t,"spectrum"),jr(Et(),t,"spectrum"),jr(Tt(),t,"spectrum"),jr(At(),t,"spectrum"),jr(Dt(),t,"spectrum")])}}}),$s({schema:[gr("mouseIsDown",function(){return Ct(!1)})],name:"spectrum",overrides:function(n){var o=n.model.manager,r=function(e,t){return o.getValueFromEvent(t).map(function(t){return o.setValueFrom(e,n,t)})},t=Fr([Ir(Ht(),r),Ir(Vt(),r)]),e=Fr([Ir(Tt(),r),Ir(At(),function(t,e){n.mouseIsDown.get()&&r(t,e)})]);return{behaviours:Ea(ob?[]:[Td.config({mode:"special",onLeft:function(t){return o.onLeft(t,n)},onRight:function(t){return o.onRight(t,n)},onUp:function(t){return o.onUp(t,n)},onDown:function(t){return o.onDown(t,n)}}),tm.config({})]),events:ob?t:e}}})],hb=be.detect().deviceType.isTouch(),gb=U("slider.change.value"),vb=function(t){var e=t.event().raw();if(hb){var n=e;return n.touches!==undefined&&1===n.touches.length?P.some(n.touches[0]).map(function(t){return Pa(t.clientX,t.clientY)}):P.none()}var o=e;return o.clientX!==undefined?P.some(o).map(function(t){return Pa(t.clientX,t.clientY)}):P.none()},pb=function(t,e,n,o){return t<e?t:n<t?n:t===e?e-1:Math.max(e,t-o)},bb=function(t,e,n,o){return n<t?t:t<e?e:t===n?n+1:Math.min(n,t+o)},yb=function(t,e,n){return Math.max(e,Math.min(n,t))},xb=function(t){var e=t.min,n=t.max,o=t.range,r=t.value,i=t.step,a=t.snap,u=t.snapStart,c=t.rounded,s=t.hasMinEdge,l=t.hasMaxEdge,f=t.minBound,d=t.maxBound,m=t.screenRange,h=s?e-1:e,g=l?n+1:n;if(r<f)return h;if(d<r)return g;var v,p,b,y,x,w,k,z=(x=r,w=f,k=d,Math.min(k,Math.max(x,w))-w),S=yb(z/m*o+e,h,g);return a&&e<=S&&S<=n?(v=S,p=e,b=n,y=i,u.fold(function(){var t=v-p,e=Math.round(t/y)*y;return yb(p+e,p-1,b+1)},function(t){var e=(v-t)%y,n=Math.round(e/y),o=Math.floor((v-t)/y),r=Math.floor((b-t)/y),i=t+Math.min(r,o+n)*y;return Math.max(t,i)})):c?Math.round(S):S},wb=function(t){var e=t.min,n=t.max,o=t.range,r=t.value,i=t.hasMinEdge,a=t.hasMaxEdge,u=t.maxBound,c=t.maxOffset,s=t.centerMinEdge,l=t.centerMaxEdge;return r<e?i?0:s:n<r?a?u:l:(r-e)/o*c},kb=function(t){return t.model.minX},zb=function(t){return t.model.minY},Sb=function(t){return t.model.minX-1},Cb=function(t){return t.model.minY-1},Ob=function(t){return t.model.maxX},Mb=function(t){return t.model.maxY},Hb=function(t){return t.model.maxX+1},Vb=function(t){return t.model.maxY+1},Eb=function(t,e,n){return e(t)-n(t)},Tb=function(t){return Eb(t,Ob,kb)},Ab=function(t){return Eb(t,Mb,zb)},Bb=function(t){return Tb(t)/2},Db=function(t){return Ab(t)/2},_b=function(t){return t.stepSize},Fb=function(t){return t.snapToGrid},Rb=function(t){return t.snapStart},Lb=function(t){return t.rounded},Ib=function(t,e){return t[e+"-edge"]!==undefined},Nb=function(t){return Ib(t,"left")},Pb=function(t){return Ib(t,"right")},jb=function(t){return Ib(t,"top")},Ub=function(t){return Ib(t,"bottom")},Wb=function(t){return t.model.value.get()},Gb=function(t){return{x:U(t)}},Xb=function(t){return{y:U(t)}},Yb=function(t,e){return{x:U(t),y:U(e)}},qb=function(t,e){yr(t,gb(),{value:e})},Kb="left",Jb=function(t){return t.element().dom().getBoundingClientRect()},$b=function(t,e){return t[e]},Qb=function(t){var e=Jb(t);return $b(e,Kb)},Zb=function(t){var e=Jb(t);return $b(e,"right")},ty=function(t){var e=Jb(t);return $b(e,"top")},ey=function(t){var e=Jb(t);return $b(e,"bottom")},ny=function(t){var e=Jb(t);return $b(e,"width")},oy=function(t){var e=Jb(t);return $b(e,"height")},ry=function(t,e,n){return(t+e)/2-n},iy=function(t,e){var n=Jb(t),o=Jb(e),r=$b(n,Kb),i=$b(n,"right"),a=$b(o,Kb);return ry(r,i,a)},ay=function(t,e){var n=Jb(t),o=Jb(e),r=$b(n,"top"),i=$b(n,"bottom"),a=$b(o,"top");return ry(r,i,a)},uy=function(t,e){yr(t,gb(),{value:e})},cy=function(t){return{x:U(t)}},sy=function(t,e,n){var o={min:kb(e),max:Ob(e),range:Tb(e),value:n,step:_b(e),snap:Fb(e),snapStart:Rb(e),rounded:Lb(e),hasMinEdge:Nb(e),hasMaxEdge:Pb(e),minBound:Qb(t),maxBound:Zb(t),screenRange:ny(t)};return xb(o)},ly=function(a){return function(t,e){return(n=a,o=t,r=e,i=(0<n?bb:pb)(Wb(r).x(),kb(r),Ob(r),_b(r)),uy(o,cy(i)),P.some(i)).map(function(){return!0});var n,o,r,i}},fy=function(t,e,n,o,r,i){var a,u,c,s,l,f,d,m,h,g=(u=i,c=n,s=o,l=r,f=ny(a=e),d=s.bind(function(t){return P.some(iy(t,a))}).getOr(0),m=l.bind(function(t){return P.some(iy(t,a))}).getOr(f),h={min:kb(u),max:Ob(u),range:Tb(u),value:c,hasMinEdge:Nb(u),hasMaxEdge:Pb(u),minBound:Qb(a),minOffset:0,maxBound:Zb(a),maxOffset:f,centerMinEdge:d,centerMaxEdge:m},wb(h));return Qb(e)-Qb(t)+g},dy=ly(-1),my=ly(1),hy=P.none,gy=P.none,vy={"top-left":P.none(),top:P.none(),"top-right":P.none(),right:P.some(function(t,e){qb(t,Gb(Hb(e)))}),"bottom-right":P.none(),bottom:P.none(),"bottom-left":P.none(),left:P.some(function(t,e){qb(t,Gb(Sb(e)))})},py=Object.freeze({setValueFrom:function(t,e,n){var o=sy(t,e,n),r=cy(o);return uy(t,r),o},setToMin:function(t,e){var n=kb(e);uy(t,cy(n))},setToMax:function(t,e){var n=Ob(e);uy(t,cy(n))},findValueOfOffset:sy,getValueFromEvent:function(t){return vb(t).map(function(t){return t.left()})},findPositionOfValue:fy,setPositionFromValue:function(t,e,n,o){var r=Wb(n),i=fy(t,o.getSpectrum(t),r.x(),o.getLeftEdge(t),o.getRightEdge(t),n),a=qa(e.element())/2;Ni(e.element(),"left",i-a+"px")},onLeft:dy,onRight:my,onUp:hy,onDown:gy,edgeActions:vy}),by=function(t,e){yr(t,gb(),{value:e})},yy=function(t){return{y:U(t)}},xy=function(t,e,n){var o={min:zb(e),max:Mb(e),range:Ab(e),value:n,step:_b(e),snap:Fb(e),snapStart:Rb(e),rounded:Lb(e),hasMinEdge:jb(e),hasMaxEdge:Ub(e),minBound:ty(t),maxBound:ey(t),screenRange:oy(t)};return xb(o)},wy=function(a){return function(t,e){return(n=a,o=t,r=e,i=(0<n?bb:pb)(Wb(r).y(),zb(r),Mb(r),_b(r)),by(o,yy(i)),P.some(i)).map(function(){return!0});var n,o,r,i}},ky=function(t,e,n,o,r,i){var a,u,c,s,l,f,d,m,h,g=(u=i,c=n,s=o,l=r,f=oy(a=e),d=s.bind(function(t){return P.some(ay(t,a))}).getOr(0),m=l.bind(function(t){return P.some(ay(t,a))}).getOr(f),h={min:zb(u),max:Mb(u),range:Ab(u),value:c,hasMinEdge:jb(u),hasMaxEdge:Ub(u),minBound:ty(a),minOffset:0,maxBound:ey(a),maxOffset:f,centerMinEdge:d,centerMaxEdge:m},wb(h));return ty(e)-ty(t)+g},zy=P.none,Sy=P.none,Cy=wy(-1),Oy=wy(1),My={"top-left":P.none(),top:P.some(function(t,e){qb(t,Xb(Cb(e)))}),"top-right":P.none(),right:P.none(),"bottom-right":P.none(),bottom:P.some(function(t,e){qb(t,Xb(Vb(e)))}),"bottom-left":P.none(),left:P.none()},Hy=Object.freeze({setValueFrom:function(t,e,n){var o=xy(t,e,n),r=yy(o);return by(t,r),o},setToMin:function(t,e){var n=zb(e);by(t,yy(n))},setToMax:function(t,e){var n=Mb(e);by(t,yy(n))},findValueOfOffset:xy,getValueFromEvent:function(t){return vb(t).map(function(t){return t.top()})},findPositionOfValue:ky,setPositionFromValue:function(t,e,n,o){var r=Wb(n),i=ky(t,o.getSpectrum(t),r.y(),o.getTopEdge(t),o.getBottomEdge(t),n),a=$a(e.element())/2;Ni(e.element(),"top",i-a+"px")},onLeft:zy,onRight:Sy,onUp:Cy,onDown:Oy,edgeActions:My}),Vy=function(t,e){yr(t,gb(),{value:e})},Ey=function(t,e){return{x:U(t),y:U(e)}},Ty=function(s,l){return function(t,e){return(n=s,o=l,r=t,i=e,a=0<n?bb:pb,u=o?Wb(i).x():a(Wb(i).x(),kb(i),Ob(i),_b(i)),c=o?a(Wb(i).y(),zb(i),Mb(i),_b(i)):Wb(i).y(),Vy(r,Ey(u,c)),P.some(u)).map(function(){return!0});var n,o,r,i,a,u,c}},Ay=Ty(-1,!1),By=Ty(1,!1),Dy=Ty(-1,!0),_y=Ty(1,!0),Fy={"top-left":P.some(function(t,e){qb(t,Yb(Sb(e),Cb(e)))}),top:P.some(function(t,e){qb(t,Yb(Bb(e),Cb(e)))}),"top-right":P.some(function(t,e){qb(t,Yb(Hb(e),Cb(e)))}),right:P.some(function(t,e){qb(t,Yb(Hb(e),Db(e)))}),"bottom-right":P.some(function(t,e){qb(t,Yb(Hb(e),Vb(e)))}),bottom:P.some(function(t,e){qb(t,Yb(Bb(e),Vb(e)))}),"bottom-left":P.some(function(t,e){qb(t,Yb(Sb(e),Vb(e)))}),left:P.some(function(t,e){qb(t,Yb(Sb(e),Db(e)))})},Ry=Object.freeze({setValueFrom:function(t,e,n){var o=sy(t,e,n.left()),r=xy(t,e,n.top()),i=Ey(o,r);return Vy(t,i),i},setToMin:function(t,e){var n=kb(e),o=zb(e);Vy(t,Ey(n,o))},setToMax:function(t,e){var n=Ob(e),o=Mb(e);Vy(t,Ey(n,o))},getValueFromEvent:function(t){return vb(t)},setPositionFromValue:function(t,e,n,o){var r=Wb(n),i=fy(t,o.getSpectrum(t),r.x(),o.getLeftEdge(t),o.getRightEdge(t),n),a=ky(t,o.getSpectrum(t),r.y(),o.getTopEdge(t),o.getBottomEdge(t),n),u=qa(e.element())/2,c=$a(e.element())/2;Ni(e.element(),"left",i-u+"px"),Ni(e.element(),"top",a-c+"px")},onLeft:Ay,onRight:By,onUp:Dy,onDown:_y,edgeActions:Fy}),Ly=be.detect().deviceType.isTouch(),Iy=[cr("stepSize",1),cr("onChange",N),cr("onChoose",N),cr("onInit",N),cr("onDragStart",N),cr("onDragEnd",N),cr("snapToGrid",!1),cr("rounded",!0),rr("snapStart"),Qo("model",Wo("mode",{x:[cr("minX",0),cr("maxX",100),gr("value",function(t){return Ct(t.mode.minX)}),$o("getInitialValue"),ka("manager",py)],y:[cr("minY",0),cr("maxY",100),gr("value",function(t){return Ct(t.mode.minY)}),$o("getInitialValue"),ka("manager",Hy)],xy:[cr("minX",0),cr("maxX",100),cr("minY",0),cr("maxY",100),gr("value",function(t){return Ct({x:U(t.mode.minX),y:U(t.mode.minY)})}),$o("getInitialValue"),ka("manager",Ry)]})),zs("sliderBehaviours",[Td,Kd])].concat(Ly?[]:[gr("mouseIsDown",function(){return Ct(!1)})]),Ny=be.detect().deviceType.isTouch(),Py=Ol({name:"Slider",configFields:Iy,partFields:mb,factory:function(i,t,e,n){var a=function(t){return dl(t,i,"thumb")},u=function(t){return dl(t,i,"spectrum")},o=function(t){return fl(t,i,"left-edge")},r=function(t){return fl(t,i,"right-edge")},c=function(t){return fl(t,i,"top-edge")},s=function(t){return fl(t,i,"bottom-edge")},l=i.model,f=l.manager,d=function(t,e){f.setPositionFromValue(t,e,i,{getLeftEdge:o,getRightEdge:r,getTopEdge:c,getBottomEdge:s,getSpectrum:u})},m=function(t,e){l.value.set(e);var n=a(t);return d(t,n),i.onChange(t,n,e),P.some(!0)},h=[Ir(Ht(),function(t,e){i.onDragStart(t,a(t))}),Ir(Et(),function(t,e){i.onDragEnd(t,a(t))})],g=[Ir(Tt(),function(t,e){e.stop(),i.onDragStart(t,a(t)),i.mouseIsDown.set(!0)}),Ir(Dt(),function(t,e){i.onDragEnd(t,a(t))})],v=Ny?h:g;return{uid:i.uid,dom:i.dom,components:t,behaviours:Cs(i.sliderBehaviours,I([Ny?[]:[Td.config({mode:"special",focusIn:function(t){return fl(t,i,"spectrum").map(Td.focusIn).map(U(!0))}})],[Kd.config({store:{mode:"manual",getValue:function(t){return l.value.get()}}}),La.config({channels:{"mouse.released":{onReceive:function(n,t){var e=i.mouseIsDown.get();i.mouseIsDown.set(!1),e&&fl(n,i,"thumb").each(function(t){var e=l.value.get();i.onChoose(n,t,e)})}}}})]])),events:Fr([Ir(gb(),function(t,e){m(t,e.event().value())}),Yr(function(t,e){var n=l.getInitialValue();l.value.set(n);var o=a(t);d(t,o);var r=u(t);i.onInit(t,o,r,l.value.get())})].concat(v)),apis:{resetToMin:function(t){f.setToMin(t,i)},resetToMax:function(t){f.setToMax(t,i)},changeValue:m,refresh:d},domModification:{styles:{position:"relative"}}}},apis:{resetToMin:function(t,e){t.resetToMin(e)},resetToMax:function(t,e){t.resetToMax(e)},refresh:function(t,e){t.refresh(e)}}}),jy=function(t){return{value:U(t)}},Uy=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Wy=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Gy=function(t){return Uy.test(t)||Wy.test(t)},Xy=function(t){var e,n=(e=t.value().replace(Uy,function(t,e,n,o){return e+e+n+n+o+o}),{value:U(e)});return Wy.exec(n.value())},Yy=function(t){var e=t.toString(16);return 1==e.length?"0"+e:e},qy=function(t){var e=Yy(t.red())+Yy(t.green())+Yy(t.blue());return jy(e)},Ky=Math.min,Jy=Math.max,$y=Math.round,Qy=function(t,e,n,o){return{red:U(t),green:U(e),blue:U(n),alpha:U(o)}},Zy=function(t){var e=parseInt(t,10);return e.toString()===t&&0<=e&&e<=255},tx=function(t){var e,n,o,r,i,a,u,c,s,l;if(i=(t.hue()||0)%360,a=t.saturation()/100,u=t.value()/100,a=Jy(0,Ky(a,1)),u=Jy(0,Ky(u,1)),0===a)return c=s=l=$y(255*u),Qy(c,s,l,1);switch(e=i/60,o=(n=u*a)*(1-Math.abs(e%2-1)),r=u-n,Math.floor(e)){case 0:c=n,s=o,l=0;break;case 1:c=o,s=n,l=0;break;case 2:c=0,s=n,l=o;break;case 3:c=0,s=o,l=n;break;case 4:c=o,s=0,l=n;break;case 5:c=n,s=0,l=o;break;default:c=s=l=0}return c=$y(255*(c+r)),s=$y(255*(s+r)),l=$y(255*(l+r)),Qy(c,s,l,1)},ex=function(t){var e=Xy(t),n=parseInt(e[1],16),o=parseInt(e[2],16),r=parseInt(e[3],16);return Qy(n,o,r,1)},nx=function(t){return"rgba("+t.red()+","+t.green()+","+t.blue()+","+t.alpha()+")"},ox=U(Qy(255,0,0,1)),rx=U(jn("rgb-hex-update")),ix=U(jn("slider-update")),ax=U(jn("palette-update")),ux=function(t,o){var r=Py.parts().spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[o("sv-palette-spectrum")]}}),i=Py.parts().thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[o("sv-palette-thumb")],innerHtml:"<div class="+o("sv-palette-inner-thumb")+' role="presentation"></div>'}}),a=function(t,e){var n=t.width,o=t.height,r=t.getContext("2d");r.fillStyle=e,r.fillRect(0,0,n,o);var i=r.createLinearGradient(0,0,n,0);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(1,"rgba(255,255,255,0)"),r.fillStyle=i,r.fillRect(0,0,n,o);var a=r.createLinearGradient(0,0,0,o);a.addColorStop(0,"rgba(0,0,0,0)"),a.addColorStop(1,"rgba(0,0,0,1)"),r.fillStyle=a,r.fillRect(0,0,n,o)};return Cl({factory:function(t){var e=U({x:U(0),y:U(0)}),n=Ea([El.config({find:P.some}),tm.config({})]);return Py.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[o("sv-palette")]},model:{mode:"xy",getInitialValue:e},rounded:!1,components:[r,i],onChange:function(t,e,n){yr(t,ax(),{value:n})},onInit:function(t,e,n,o){a(n.element().dom(),nx(ox()))},sliderBehaviours:n})},name:"SaturationBrightnessPalette",configFields:[],apis:{setRgba:function(t,e,n){var o,r;o=n,r=e.components()[0].element().dom(),a(r,nx(o))}},extraApis:{}})},cx=function(t,e){var n=Py.parts().spectrum({dom:{tag:"div",classes:[e("hue-slider-spectrum")],attributes:{role:"presentation"}}}),o=Py.parts().thumb({dom:{tag:"div",classes:[e("hue-slider-thumb")],attributes:{role:"presentation"}}});return Py.sketch({dom:{tag:"div",classes:[e("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:U({y:U(0)})},components:[n,o],sliderBehaviours:Ea([tm.config({})]),onChange:function(t,e,n){yr(t,ix(),{value:n})}})},sx=[zs("formBehaviours",[Kd])],lx=function(t){return"<alloy.field."+t+">"},fx=function(o,t,e){return{uid:o.uid,dom:o.dom,components:t,behaviours:Cs(o.formBehaviours,[Kd.config({store:{mode:"manual",getValue:function(t){var e=hl(t,o);return et(e,function(t,e){return t().bind(function(t){var e,n=El.getCurrent(t);return e="missing current",n.fold(function(){return ft.error(e)},ft.value)}).map(Kd.getValue)})},setValue:function(n,t){tt(t,function(e,t){fl(n,o,t).each(function(t){El.getCurrent(t).each(function(t){Kd.setValue(t,e)})})})}}})]),apis:{getField:function(t,e){return fl(t,o,e).bind(El.getCurrent)}}}},dx={getField:mi(function(t,e,n){return t.getField(e,n)}),sketch:function(t){var n,e=(n=[],{field:function(t,e){return n.push(t),al("form",lx(t),e)},record:function(){return n}}),o=t(e),r=e.record(),i=E(r,function(t){return $s({name:t,pname:lx(t)})});return wl("form",sx,i,fx,o)}},mx=jn("valid-input"),hx=jn("invalid-input"),gx=jn("validating-input"),vx="colorcustom.rgb.",px=function(m,h,g,v){var p=function(t,e,n,o,r){var i,a,u=m(vx+"range"),c=[Sv.parts().label({dom:{tag:"label",innerHtml:n,attributes:{"aria-label":o}}}),Sv.parts().field({data:r,factory:dp,inputAttributes:{type:"text"},inputClasses:[h("textfield")],inputBehaviours:Ea([(i=e,a=t,Op.config({invalidClass:h("invalid"),notify:{onValidate:function(t){yr(t,gx,{type:i})},onValid:function(t){yr(t,mx,{type:i,value:Kd.getValue(t)})},onInvalid:function(t){yr(t,hx,{type:i,value:Kd.getValue(t)})}},validator:{validate:function(t){var e=Kd.getValue(t),n=a(e)?ft.value(!0):ft.error(m("aria.input.invalid"));return Fv.pure(n)},validateOnLoad:!1}})),Vp.config({})]),onSetValue:function(t){Op.isInvalid(t)&&Op.run(t).get(N)}})],s="hex"!==e?[Sv.parts()["aria-descriptor"]({text:u})]:[];return{dom:{tag:"div",attributes:{role:"presentation"}},components:c.concat(s)}},b=function(t,e){var n=e.red(),o=e.green(),r=e.blue();Kd.setValue(t,{red:n,green:o,blue:r})},y=Rm({dom:{tag:"div",classes:[h("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),x=function(t,e){y.getOpt(t).each(function(t){Ni(t.element(),"background-color","#"+e.value())})};return Cl({factory:function(t){var n={red:U(Ct(P.some(255))),green:U(Ct(P.some(255))),blue:U(Ct(P.some(255))),hex:U(Ct(P.some("ffffff")))},o=function(t){return n[t]().get()},i=function(t,e){n[t]().set(e)},r=function(t){var e=t.red(),n=t.green(),o=t.blue();i("red",P.some(e)),i("green",P.some(n)),i("blue",P.some(o))},e=function(t,e){var n=e.event();"hex"!==n.type()?i(n.type(),P.none()):v(t)},a=function(r,t,e){var n=parseInt(e,10);i(t,P.some(n)),o("red").bind(function(n){return o("green").bind(function(e){return o("blue").map(function(t){return Qy(n,e,t,1)})})}).each(function(t){var e,n,o=(e=r,n=qy(t),dx.getField(e,"hex").each(function(t){tm.isFocused(t)||Kd.setValue(e,{hex:n.value()})}),n);x(r,o)})},u=function(t,e){var n=e.event();"hex"===n.type()?function(t,e){g(t);var n=jy(e);i("hex",P.some(e));var o=ex(n);b(t,o),r(o),yr(t,rx(),{hex:n}),x(t,n)}(t,n.value()):a(t,n.type(),n.value())},c=function(t){return{label:m(vx+t+".label"),description:m(vx+t+".description")}},s=c("red"),l=c("green"),f=c("blue"),d=c("hex");return gt(dx.sketch(function(t){return{dom:{tag:"form",classes:[h("rgb-form")],attributes:{"aria-label":m("aria.color.picker")}},components:[t.field("red",Sv.sketch(p(Zy,"red",s.label,s.description,255))),t.field("green",Sv.sketch(p(Zy,"green",l.label,l.description,255))),t.field("blue",Sv.sketch(p(Zy,"blue",f.label,f.description,255))),t.field("hex",Sv.sketch(p(Gy,"hex",d.label,d.description,"ffffff"))),y.asSpec()],formBehaviours:Ea([Op.config({invalidClass:h("form-invalid")}),ym("rgb-form-events",[Ir(mx,u),Ir(hx,e),Ir(gx,e)])])}}),{apis:{updateHex:function(t,e){var n,o;Kd.setValue(t,{hex:e.value()}),n=t,o=ex(e),b(n,o),r(o),x(t,e)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(t,e,n){t.updateHex(e,n)}},extraApis:{}})},bx=function(t,e,n){return{hue:U(t),saturation:U(e),value:U(n)}},yx=function(c,s){return Cl({name:"ColourPicker",configFields:[cr("onValidHex",N),cr("onInvalidHex",N),ar("formChangeEvent")],factory:function(t){var u,p,n=px(c,s,t.onValidHex,t.onInvalidHex),o=ux(c,s),b={paletteRgba:U(Ct(ox()))},e=Rm(o.sketch({})),r=Rm(n.sketch({})),i=function(t,n){e.getOpt(t).each(function(t){var e=ex(n);b.paletteRgba().set(e),o.setRgba(t,e)})},a=function(t,e){r.getOpt(t).each(function(t){n.updateHex(t,e)})},y=function(e,n,t){T(t,function(t){t(e,n)})};return{uid:t.uid,dom:t.dom,components:[e.asSpec(),cx(c,s),r.asSpec()],behaviours:Ea([ym("colour-picker-events",[Ir(ax(),(p=[a],function(t,e){var n,o,r,i,a,u,c,s,l,f=e.event().value(),d=b.paletteRgba().get(),m=(c=a=0,o=(n=d).red()/255,r=n.green()/255,i=n.blue()/255,(s=Math.min(o,Math.min(r,i)))===(l=Math.max(o,Math.max(r,i)))?bx(0,0,100*(c=s)):(a=60*((a=o===s?3:i===s?1:5)-(o===s?r-i:i===s?o-r:i-o)/(l-s)),u=(l-s)/l,c=l,bx(Math.round(a),Math.round(100*u),Math.round(100*c)))),h=bx(m.hue(),f.x(),100-f.y()),g=tx(h),v=qy(g);y(t,v,p)})),Ir(ix(),(u=[i,a],function(t,e){var n,o,r,i=e.event().value(),a=(n=i.y(),o=bx(360*(100-n/100),100,100),r=tx(o),qy(r));y(t,a,u)}))]),El.config({find:function(t){return r.getOpt(t)}}),Td.config({mode:"acyclic"})])}}})},xx=function(){return El.config({find:P.some})},wx=function(t){return El.config({find:t.getOpt})},kx=function(t){return El.config({find:function(e){return cn(e.element(),t).bind(function(t){return e.getSystem().getByDom(t).toOption()})}})},zx={"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"},Sx=function(t){return zx[t]},Cx=Ho([cr("preprocess",d),cr("postprocess",d)]),Ox=function(t,e,n){return Kd.config(gt({store:{mode:"manual",getValue:e,setValue:n}},t.map(function(t){return{store:{initialValue:t}}}).getOr({})))},Mx=function(t,e,n){return Ox(t,function(t){return e(t.element())},function(t,e){return n(t.element(),e)})},Hx=function(r,t){var i=jo("RepresentingConfigs.memento processors",Cx,t);return Kd.config({store:{mode:"manual",getValue:function(t){var e=r.get(t),n=Kd.getValue(e);return i.postprocess(n)},setValue:function(t,e){var n=i.preprocess(e),o=r.get(t);Kd.setValue(o,n)}}})},Vx=Ox,Ex=function(t){return Mx(t,vn,pn)},Tx=function(t){return Kd.config({store:{mode:"memory",initialValue:t}})},Ax=function(r,e){var n=function(t,e){e.stop()},o=function(t){return function(e,n){T(t,function(t){t(e,n)})}},i=function(t,e){if(!Gh.isDisabled(t)){var n=e.event().raw();u(t,n.dataTransfer.files)}},a=function(t,e){var n=e.event().raw().target.files;u(t,n)},u=function(t,e){var n,o;Kd.setValue(t,(n=e,o=new RegExp("("+".jpg,.jpeg,.png,.gif".split(/\s*,\s*/).join("|")+")$","i"),A($(n),function(t){return o.test(t.name)}))),yr(t,mv,{name:r.name})},c=Rm({dom:{tag:"input",attributes:{type:"file",multiple:"multiple"},styles:{display:"none"}},behaviours:Ea([ym("input-file-events",[Wr(jt())])])}),t=r.label.map(function(t){return cp(t,e)}),s=Sv.parts().field({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:Ea([Tx([]),xx(),Gh.config({}),dm.config({toggleClass:"dragenter",toggleOnExecute:!1}),ym("dropzone-events",[Ir("dragenter",o([n,dm.toggle])),Ir("dragleave",o([n,dm.toggle])),Ir("dragover",n),Ir("drop",o([n,i])),Ir(Pt(),a)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:e.translate("Drop an image here")}},Fm.sketch({dom:{tag:"button",innerHtml:e.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[c.asSpec()],action:function(t){c.get(t).element().dom().click()},buttonBehaviours:Ea([Vp.config({})])})]}]}}}}),l=r.flex?["tox-form__group--stretched"]:[];return rp(t,s,l)},Bx=jn("alloy-fake-before-tabstop"),Dx=jn("alloy-fake-after-tabstop"),_x=function(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:Ea([tm.config({ignore:!0}),Vp.config({})])}},Fx=function(t,e){yr(t,Lt(),{raw:{which:9,shiftKey:e}})},Rx=function(t){return Pg(t,["."+Bx,"."+Dx].join(","),U(!1))},Lx=function(t,e){var n=e.element();Di(n,Bx)?Fx(t,!0):Di(n,Dx)&&Fx(t,!1)},Ix=function(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[_x([Bx]),t,_x([Dx])],behaviours:Ea([kx(1)])}},Nx=!be.detect().browser.isIE(),Px=function(t,e){var o,r,n=Nx&&t.sandboxed,i=n?{sandbox:"allow-scripts"}:{},a=(o=n,r=Ct(""),{getValue:function(t){return r.get()},setValue:function(t,e){if(o)Sn(t.element(),"src","data:text/html;charset=utf-8,"+encodeURIComponent(e));else{Sn(t.element(),"src","javascript:''");var n=t.element().dom().contentWindow.document;n.open(),n.write(e),n.close()}r.set(e)}}),u=t.label.map(function(t){return cp(t,e)}),c=Sv.parts().field({factory:{sketch:function(t){return Ix({uid:t.uid,dom:{tag:"iframe",attributes:gt(i)},behaviours:Ea([Vp.config({}),tm.config({}),Vx(P.none(),a.getValue,a.setValue)])})}}}),s=t.flex?["tox-form__group--stretched"]:[];return rp(u,c,s)};function jx(t,e){return Wx(document.createElement("canvas"),t,e)}function Ux(t){return t.getContext("2d")}function Wx(t,e,n){return t.width=e,t.height=n,t}var Gx={create:jx,clone:function AH(t){var e;return Ux(e=jx(t.width,t.height)).drawImage(t,0,0),e},resize:Wx,get2dContext:Ux,get3dContext:function BH(t){var e=null;try{e=t.getContext("webgl")||t.getContext("experimental-webgl")}catch(n){}return e||(e=null),e}},Xx={getWidth:function DH(t){return t.naturalWidth||t.width},getHeight:function _H(t){return t.naturalHeight||t.height}},Yx=window.Promise?window.Promise:function(){var t=function(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],s(t,o(r,this),o(a,this))},e=t.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(t){setTimeout(t,1)};function o(t,e){return function(){t.apply(e,arguments)}}var n=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function i(o){var r=this;null!==this._state?e(function(){var t=r._state?o.onFulfilled:o.onRejected;if(null!==t){var e;try{e=t(r._value)}catch(n){return void o.reject(n)}o.resolve(e)}else(r._state?o.resolve:o.reject)(r._value)}):this._deferreds.push(o)}function r(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void s(o(e,t),o(r,this),o(a,this))}this._state=!0,this._value=t,u.call(this)}catch(n){a.call(this,n)}}function a(t){this._state=!1,this._value=t,u.call(this)}function u(){for(var t=0,e=this._deferreds.length;t<e;t++)i.call(this,this._deferreds[t]);this._deferreds=null}function c(t,e,n,o){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=o}function s(t,e,n){var o=!1;try{t(function(t){o||(o=!0,e(t))},function(t){o||(o=!0,n(t))})}catch(r){if(o)return;o=!0,n(r)}}return t.prototype["catch"]=function(t){return this.then(null,t)},t.prototype.then=function(n,o){var r=this;return new t(function(t,e){i.call(r,new c(n,o,t,e))})},t.all=function(){var c=Array.prototype.slice.call(1===arguments.length&&n(arguments[0])?arguments[0]:arguments);return new t(function(r,i){if(0===c.length)return r([]);var a=c.length;function u(e,t){try{if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void n.call(t,function(t){u(e,t)},i)}c[e]=t,0==--a&&r(c)}catch(o){i(o)}}for(var t=0;t<c.length;t++)u(t,c[t])})},t.resolve=function(e){return e&&"object"==typeof e&&e.constructor===t?e:new t(function(t){t(e)})},t.reject=function(n){return new t(function(t,e){e(n)})},t.race=function(r){return new t(function(t,e){for(var n=0,o=r.length;n<o;n++)r[n].then(t,e)})},t}();function qx(){return new(Ye.getOrDie("FileReader"))}var Kx={atob:function(t){return Ye.getOrDie("atob")(t)},requestAnimationFrame:function(t){Ye.getOrDie("requestAnimationFrame")(t)}};function Jx(u){return new Yx(function(t,e){var n=URL.createObjectURL(u),o=new Image,r=function(){o.removeEventListener("load",i),o.removeEventListener("error",a)};function i(){r(),t(o)}function a(){r(),e("Unable to load data of type "+u.type+": "+n)}o.addEventListener("load",i),o.addEventListener("error",a),o.src=n,o.complete&&i()})}function $x(o){return new Yx(function(t,n){var e=new XMLHttpRequest;e.open("GET",o,!0),e.responseType="blob",e.onload=function(){200==this.status&&t(this.response)},e.onerror=function(){var t,e=this;n(0===this.status?((t=new Error("No access to download image")).code=18,t.name="SecurityError",t):new Error("Error "+e.status+" downloading image"))},e.send()})}function Qx(t){var e=t.split(","),n=/data:([^;]+)/.exec(e[0]);if(!n)return P.none();for(var o,r=n[1],i=e[1],a=Kx.atob(i),u=a.length,c=Math.ceil(u/1024),s=new Array(c),l=0;l<c;++l){for(var f=1024*l,d=Math.min(f+1024,u),m=new Array(d-f),h=f,g=0;h<d;++g,++h)m[g]=a[h].charCodeAt(0);s[l]=(o=m,new(Ye.getOrDie("Uint8Array"))(o))}return P.some(function v(t,e){return new(Ye.getOrDie("Blob"))(t,e)}(s,{type:r}))}function Zx(n){return new Yx(function(t,e){Qx(n).fold(function(){e("uri is not base64: "+n)},t)})}function tw(n){return new Yx(function(t){var e=qx();e.onloadend=function(){t(e.result)},e.readAsDataURL(n)})}var ew={blobToImage:Jx,imageToBlob:function FH(t){var e=t.src;return 0===e.indexOf("data:")?Zx(e):$x(e)},blobToArrayBuffer:function RH(n){return new Yx(function(t){var e=qx();e.onloadend=function(){t(e.result)},e.readAsArrayBuffer(n)})},blobToDataUri:tw,blobToBase64:function LH(t){return tw(t).then(function(t){return t.split(",")[1]})},dataUriToBlobSync:Qx,canvasToBlob:function IH(t,n,o){return n=n||"image/png",HTMLCanvasElement.prototype.toBlob?new Yx(function(e){t.toBlob(function(t){e(t)},n,o)}):Zx(t.toDataURL(n,o))},canvasToDataURL:function NH(t,e,n){return e=e||"image/png",t.then(function(t){return t.toDataURL(e,n)})},blobToCanvas:function PH(t){return Jx(t).then(function(t){var e;return function n(t){URL.revokeObjectURL(t.src)}(t),e=Gx.create(Xx.getWidth(t),Xx.getHeight(t)),Gx.get2dContext(e).drawImage(t,0,0),e})},uriToBlob:function jH(t){return 0===t.indexOf("blob:")?$x(t):0===t.indexOf("data:")?Zx(t):null}};function nw(t,e,n){var o=e.type;function r(e,n){return t.then(function(t){return ew.canvasToDataURL(t,e,n)})}return{getType:U(o),toBlob:function i(){return Yx.resolve(e)},toDataURL:function a(){return n},toBase64:function u(){return n.split(",")[1]},toAdjustedBlob:function c(e,n){return t.then(function(t){return ew.canvasToBlob(t,e,n)})},toAdjustedDataURL:r,toAdjustedBase64:function s(t,e){return r(t,e).then(function(t){return t.split(",")[1]})},toCanvas:function l(){return t.then(Gx.clone)}}}function ow(e){return ew.blobToDataUri(e).then(function(t){return nw(ew.blobToCanvas(e),e,t)})}var rw={fromBlob:ow,fromCanvas:function UH(e,t){return ew.canvasToBlob(e,t).then(function(t){return nw(Yx.resolve(e),t,e.toDataURL())})},fromImage:function WH(t){return ew.imageToBlob(t).then(function(t){return ow(t)})},fromBlobAndUrlSync:function(t,e){return nw(ew.blobToCanvas(t),t,e)}},iw=function(t){return rw.fromBlob(t)};function aw(t,e,n){return n<(t=parseFloat(t))?t=n:t<e&&(t=e),t}var uw=[0,.01,.02,.04,.05,.06,.07,.08,.1,.11,.12,.14,.15,.16,.17,.18,.2,.21,.22,.24,.25,.27,.28,.3,.32,.34,.36,.38,.4,.42,.44,.46,.48,.5,.53,.56,.59,.62,.65,.68,.71,.74,.77,.8,.83,.86,.89,.92,.95,.98,1,1.06,1.12,1.18,1.24,1.3,1.36,1.42,1.48,1.54,1.6,1.66,1.72,1.78,1.84,1.9,1.96,2,2.12,2.25,2.37,2.5,2.62,2.75,2.87,3,3.2,3.4,3.6,3.8,4,4.3,4.7,4.9,5,5.5,6,6.5,6.8,7,7.3,7.5,7.8,8,8.4,8.7,9,9.4,9.6,9.8,10];function cw(t,e){var n,o,r,i,a=[],u=new Array(10);for(n=0;n<5;n++){for(o=0;o<5;o++)a[o]=e[o+5*n];for(o=0;o<5;o++){for(r=i=0;r<5;r++)i+=t[o+5*r]*a[r];u[o+5*n]=i}}return u}function sw(t,n){return n=aw(n,0,1),t.map(function(t,e){return e%6==0?t=1-(1-t)*n:t*=n,aw(t,0,1)})}var lw={identity:function GH(){return[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1]},adjust:sw,multiply:cw,adjustContrast:function XH(t,e){var n;return e=aw(e,-1,1),cw(t,[(n=(e*=100)<0?127+e/100*127:127*(n=0==(n=e%1)?uw[e]:uw[Math.floor(e)]*(1-n)+uw[Math.floor(e)+1]*n)+127)/127,0,0,0,.5*(127-n),0,n/127,0,0,.5*(127-n),0,0,n/127,0,.5*(127-n),0,0,0,1,0,0,0,0,0,1])},adjustBrightness:function YH(t,e){return cw(t,[1,0,0,0,e=aw(255*e,-255,255),0,1,0,0,e,0,0,1,0,e,0,0,0,1,0,0,0,0,0,1])},adjustSaturation:function qH(t,e){var n;return cw(t,[.3086*(1-(n=1+(0<(e=aw(e,-1,1))?3*e:e)))+n,.6094*(1-n),.082*(1-n),0,0,.3086*(1-n),.6094*(1-n)+n,.082*(1-n),0,0,.3086*(1-n),.6094*(1-n),.082*(1-n)+n,0,0,0,0,0,1,0,0,0,0,0,1])},adjustHue:function KH(t,e){var n,o;return e=aw(e,-180,180)/180*Math.PI,cw(t,[.213+.787*(n=Math.cos(e))+-.213*(o=Math.sin(e)),.715+-.715*n+-.715*o,.072+-.072*n+.928*o,0,0,.213+-.213*n+.143*o,.715+n*(1-.715)+.14*o,.072+-.072*n+-.283*o,0,0,.213+-.213*n+-.787*o,.715+-.715*n+.715*o,.072+.928*n+.072*o,0,0,0,0,0,1,0,0,0,0,0,1])},adjustColors:function JH(t,e,n,o){return cw(t,[e=aw(e,0,2),0,0,0,0,0,n=aw(n,0,2),0,0,0,0,0,o=aw(o,0,2),0,0,0,0,0,1,0,0,0,0,0,1])},adjustSepia:function $H(t,e){return cw(t,sw([.393,.769,.189,0,0,.349,.686,.168,0,0,.272,.534,.131,0,0,0,0,0,1,0,0,0,0,0,1],e=aw(e,0,1)))},adjustGrayscale:function QH(t,e){return cw(t,sw([.33,.34,.33,0,0,.33,.34,.33,0,0,.33,.34,.33,0,0,0,0,0,1,0,0,0,0,0,1],e=aw(e,0,1)))}};function fw(e,n){return e.toCanvas().then(function(t){return function i(t,e,n){var o,r=Gx.get2dContext(t);return o=function H(t,e){var n,o,r,i,a,u=t.data,c=e[0],s=e[1],l=e[2],f=e[3],d=e[4],m=e[5],h=e[6],g=e[7],v=e[8],p=e[9],b=e[10],y=e[11],x=e[12],w=e[13],k=e[14],z=e[15],S=e[16],C=e[17],O=e[18],M=e[19];for(a=0;a<u.length;a+=4)n=u[a],o=u[a+1],r=u[a+2],i=u[a+3],u[a]=n*c+o*s+r*l+i*f+d,u[a+1]=n*m+o*h+r*g+i*v+p,u[a+2]=n*b+o*y+r*x+i*w+k,u[a+3]=n*z+o*S+r*C+i*O+M;return t}(r.getImageData(0,0,t.width,t.height),n),r.putImageData(o,0,0),rw.fromCanvas(t,e)}(t,e.getType(),n)})}function dw(e,n){return e.toCanvas().then(function(t){return function a(t,e,n){var o,r,i=Gx.get2dContext(t);return o=i.getImageData(0,0,t.width,t.height),r=i.getImageData(0,0,t.width,t.height),r=function w(t,e,n){var o,r,i,a,u,c,s,l,f,d,m,h,g,v,p,b,y;function x(t,e,n){return n<t?t=n:t<e&&(t=e),t}for(i=Math.round(Math.sqrt(n.length)),a=Math.floor(i/2),o=t.data,r=e.data,b=t.width,y=t.height,c=0;c<y;c++)for(u=0;u<b;u++){for(s=l=f=0,m=0;m<i;m++)for(d=0;d<i;d++)h=x(u+d-a,0,b-1),g=x(c+m-a,0,y-1),v=4*(g*b+h),p=n[m*i+d],s+=o[v]*p,l+=o[v+1]*p,f+=o[v+2]*p;r[v=4*(c*b+u)]=x(s,0,255),r[v+1]=x(l,0,255),r[v+2]=x(f,0,255)}return e}(o,r,n),i.putImageData(r,0,0),rw.fromCanvas(t,e)}(t,e.getType(),n)})}function mw(c){return function(e,n){return e.toCanvas().then(function(t){return function(t,e,n){var o,r,i=Gx.get2dContext(t),a=new Array(256);for(r=0;r<a.length;r++)a[r]=c(r,n);return o=function u(t,e){var n,o=t.data;for(n=0;n<o.length;n+=4)o[n]=e[o[n]],o[n+1]=e[o[n+1]],o[n+2]=e[o[n+2]];return t}(i.getImageData(0,0,t.width,t.height),a),i.putImageData(o,0,0),rw.fromCanvas(t,e)}(t,e.getType(),n)})}}function hw(n){return function(t,e){return fw(t,n(lw.identity(),e))}}function gw(e){return function(t){return dw(t,e)}}var vw={invert:function ZH(e){return function(t){return fw(t,e)}}([-1,0,0,0,255,0,-1,0,0,255,0,0,-1,0,255,0,0,0,1,0]),brightness:hw(lw.adjustBrightness),hue:hw(lw.adjustHue),saturate:hw(lw.adjustSaturation),contrast:hw(lw.adjustContrast),grayscale:hw(lw.adjustGrayscale),sepia:hw(lw.adjustSepia),colorize:function(t,e,n,o){return fw(t,lw.adjustColors(lw.identity(),e,n,o))},sharpen:gw([0,-1,0,-1,5,-1,0,-1,0]),emboss:gw([-2,-1,0,-1,1,1,0,1,2]),gamma:mw(function(t,e){return 255*Math.pow(t/255,1-e)}),exposure:mw(function(t,e){return 255*(1-Math.exp(-t/255*e))}),colorFilter:fw,convoluteFilter:dw},pw={scale:function tV(t,e,n){var o=Xx.getWidth(t),r=Xx.getHeight(t),i=e/o,a=n/r,u=!1;(i<.5||2<i)&&(i=i<.5?.5:2,u=!0),(a<.5||2<a)&&(a=a<.5?.5:2,u=!0);var c=function l(u,c,s){return new Yx(function(t){var e=Xx.getWidth(u),n=Xx.getHeight(u),o=Math.floor(e*c),r=Math.floor(n*s),i=Gx.create(o,r),a=Gx.get2dContext(i);a.drawImage(u,0,0,e,n,0,0,o,r),t(i)})}(t,i,a);return u?c.then(function(t){return tV(t,e,n)}):c}},bw={rotate:function eV(e,n){return e.toCanvas().then(function(t){return function u(t,e,n){var o=Gx.create(t.width,t.height),r=Gx.get2dContext(o),i=0,a=0;return 90!=(n=n<0?360+n:n)&&270!=n||Gx.resize(o,o.height,o.width),90!=n&&180!=n||(i=o.width),270!=n&&180!=n||(a=o.height),r.translate(i,a),r.rotate(n*Math.PI/180),r.drawImage(t,0,0),rw.fromCanvas(o,e)}(t,e.getType(),n)})},flip:function nV(e,n){return e.toCanvas().then(function(t){return function i(t,e,n){var o=Gx.create(t.width,t.height),r=Gx.get2dContext(o);return"v"==n?(r.scale(1,-1),r.drawImage(t,0,-o.height)):(r.scale(-1,1),r.drawImage(t,-o.width,0)),rw.fromCanvas(o,e)}(t,e.getType(),n)})},crop:function oV(e,n,o,r,i){return e.toCanvas().then(function(t){return function u(t,e,n,o,r,i){var a=Gx.create(r,i);return Gx.get2dContext(a).drawImage(t,-n,-o),rw.fromCanvas(a,e)}(t,e.getType(),n,o,r,i)})},resize:function rV(e,n,o){return e.toCanvas().then(function(t){return pw.scale(t,n,o).then(function(t){return rw.fromCanvas(t,e.getType())})})}},yw=(function(){function t(t){this.littleEndian=!1,this._dv=new DataView(t)}t.prototype.readByteAt=function(t){return this._dv.getUint8(t)},t.prototype.read=function(t,e){if(t+e>this.length())return null;for(var n=this.littleEndian?0:-8*(e-1),o=0,r=0;o<e;o++)r|=this.readByteAt(t+o)<<Math.abs(n+8*o);return r},t.prototype.BYTE=function(t){return this.read(t,1)},t.prototype.SHORT=function(t){return this.read(t,2)},t.prototype.LONG=function(t){return this.read(t,4)},t.prototype.SLONG=function(t){var e=this.read(t,4);return 2147483647<e?e-4294967296:e},t.prototype.CHAR=function(t){return String.fromCharCode(this.read(t,1))},t.prototype.STRING=function(t,e){return this.asArray("CHAR",t,e).join("")},t.prototype.SEGMENT=function(t,e){var n=this._dv.buffer;switch(arguments.length){case 2:return n.slice(t,t+e);case 1:return n.slice(t);default:return n}},t.prototype.asArray=function(t,e,n){for(var o=[],r=0;r<n;r++)o[r]=this[t](e+r);return o},t.prototype.length=function(){return this._dv?this._dv.byteLength:0}}(),function(t,e){return bw.rotate(t,e)}),xw=function(t){return vw.invert(t)},ww=function(t){return vw.sharpen(t)},kw=function(t,e){return vw.brightness(t,e)},zw=function(t,e){return vw.contrast(t,e)},Sw=function(t,e,n,o){return vw.colorize(t,e,n,o)},Cw=function(t,e){return vw.gamma(t,e)},Ow=function(t,e){return bw.flip(t,e)},Mw=function(t,e,n,o,r){return bw.crop(t,e,n,o,r)},Hw=function(t,e,n){return bw.resize(t,e,n)},Vw=yw,Ew=function(t,e){return{dom:{tag:"span",innerHtml:Pm("icon-"+t,e,U(t)),classes:["tox-tbtn__icon-wrap"]}}},Tw=function(t,e,n){return{dom:{tag:"span",innerHtml:n.translate(t),classes:[e+"__select-label"]},behaviours:Ea([Fd.config({})])}},Aw=function(t,e,n,o,r){void 0===n&&(n=[]);var i={buttonBehaviours:Ea([Yh(t.disabled),Vp.config({}),ym("button press",[Lr("click"),Lr("mousedown")])].concat(n)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]},action:e},a=gt(i,{dom:o}),u=gt(a,{components:r});return Fm.sketch(u)},Bw=function(t,e,n,o){void 0===o&&(o=[]);var r={tag:"button",classes:["tox-tbtn"],attributes:t.tooltip.map(function(t){return{"aria-label":n.translate(t),title:n.translate(t)}}).getOr({})},i=t.icon.map(function(t){return Ew(t,n.icons)}),a=eg([i]);return Aw(t,e,o,r,a)},Dw=function(t,e,n,o){void 0===o&&(o=[]);var r=n.translate(t.text),i={tag:"button",classes:t.primary?["tox-button"]:["tox-button","tox-button--secondary"],innerHtml:r,attributes:{title:r}};return Aw(t,e,o,i,[])},_w=function(e,n){return function(t){"custom"===n?yr(t,vv,{name:e,value:{}}):"submit"===n?br(t,pv):"cancel"===n?br(t,gv):console.error("Unknown button type: ",n)}},Fw=function(t,e,n){var o=_w(t.name,e);return Dw(t,o,n,[])},Rw=U([cr("field1Name","field1"),cr("field2Name","field2"),xa("onLockedChange"),va(["lockClass"]),cr("locked",!1),Os("coupledFieldBehaviours",[El,Kd])]),Lw=function(t,i){return $s({factory:Sv,name:t,overrides:function(r){return{fieldBehaviours:Ea([ym("coupled-input-behaviour",[Ir(Nt(),function(n){var t,e,o;(t=n,e=r,o=i,fl(t,e,o).bind(El.getCurrent)).each(function(e){fl(n,r,"lock").each(function(t){dm.isOn(t)&&r.onLockedChange(n,e,t)})})})])])}}})},Iw=U([Lw("field1","field2"),Lw("field2","field1"),$s({factory:Fm,schema:[$o("dom")],name:"lock",overrides:function(t){return{buttonBehaviours:Ea([dm.config({selected:t.locked,toggleClass:t.markers.lockClass,aria:{mode:"pressed"}})])}}})]),Nw=Ol({name:"FormCoupledInputs",configFields:Rw(),partFields:Iw(),factory:function(o,t,e,n){return{uid:o.uid,dom:o.dom,components:t,behaviours:Ms(o.coupledFieldBehaviours,[El.config({find:P.some}),Kd.config({store:{mode:"manual",getValue:function(t){var e,n=vl(t,o,["field1","field2"]);return(e={})[o.field1Name]=Kd.getValue(n.field1()),e[o.field2Name]=Kd.getValue(n.field2()),e},setValue:function(t,e){var n=vl(t,o,["field1","field2"]);St(e,o.field1Name)&&Kd.setValue(n.field1(),e[o.field1Name]),St(e,o.field2Name)&&Kd.setValue(n.field2(),e[o.field2Name])}}})]),apis:{getField1:function(t){return fl(t,o,"field1")},getField2:function(t){return fl(t,o,"field2")},getLock:function(t){return fl(t,o,"lock")}}}},apis:{getField1:function(t,e){return t.getField1(e)},getField2:function(t,e){return t.getField2(e)},getLock:function(t,e){return t.getLock(e)}}}),Pw=function(t){var e=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(t);if(null===e)return ft.error(t);var n=parseFloat(e[1]),o=e[2];return ft.value({value:n,unit:o})},jw=function(t,e){var n={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,"in":1},o=function(t){return Object.prototype.hasOwnProperty.call(n,t)};return t.unit===e?P.some(t.value):o(t.unit)&&o(e)?n[t.unit]===n[e]?P.some(t.value):P.some(t.value/n[t.unit]*n[e]):P.none()},Uw=function(t){return P.none()},Ww=function(t,e){return function(t,e){for(var n=[],o=0;o<t.length;o++){var r=t[o];if(!r.isSome())return P.none();n.push(r.getOrDie())}return P.some(e.apply(null,n))}([Pw(t).toOption(),Pw(e).toOption()],function(t,o){return jw(t,o.unit).map(function(t){return o.value/t}).map(function(t){return e=t,n=o.unit,function(t){return jw(t,n).map(function(t){return{value:t*e,unit:n}})};var e,n}).getOr(Uw)}).getOr(Uw)},Gw=function(o,r){var u=Uw,i=jn("ratio-event"),t=function(n){var t=Sv.parts().field({factory:dp,inputClasses:["tox-textfield"],inputBehaviours:Ea([Vp.config({}),ym("size-input-events",[Ir(Ft(),function(t,e){yr(t,i,{isField1:n.isField1})}),Ir(Pt(),function(t,e){yr(t,mv,{name:o.name})})])]),inputAttributes:{placeholder:r.translate(n.placeholderText)},selectOnFocus:!1}),e=Sv.parts()["aria-descriptor"]({text:n.label});return{dom:{tag:"div"},components:[e,t]}},e=Nw.parts().field1(t({label:"Width",isField1:!0,placeholderText:"Width"})),n=Nw.parts().field2(t({label:"Height",isField1:!1,placeholderText:"Height"})),a=Nw.parts().lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:r.translate(o.label.getOr("Constrain proportions"))}},components:[{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__lock"],innerHtml:Nm("icon-lock",r.icons)}},{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__unlock"],innerHtml:Nm("icon-unlock",r.icons)}}],buttonBehaviours:Ea([Vp.config({})])});return Nw.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"label",classes:["tox-label"],innerHtml:r.translate("Dimensions")}},{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[e,{dom:{tag:"span",innerHtml:"\xd7"}},n,a]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(t,i,e){Pw(Kd.getValue(t)).each(function(t){u(t).each(function(t){var e,n,o,r;Kd.setValue(i,(o={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,"in":4,"%":4},-1!==(r=(e=t).value.toFixed((n=e.unit)in o?o[n]:1)).indexOf(".")&&(r=r.replace(/\.?0*$/,"")),r+e.unit))})})},coupledFieldBehaviours:Ea([ym("size-input-events2",[Ir(i,function(t,e){var n=e.event().isField1(),o=n?Nw.getField1(t):Nw.getField2(t),r=n?Nw.getField2(t):Nw.getField1(t),i=o.map(Kd.getValue).getOr(""),a=r.map(Kd.getValue).getOr("");u=Ww(i,a)})])])})},Xw={undo:U(jn("undo")),redo:U(jn("redo")),zoom:U(jn("zoom")),back:U(jn("back")),apply:U(jn("apply")),swap:U(jn("swap")),transform:U(jn("transform")),tempTransform:U(jn("temp-transform")),transformApply:U(jn("transform-apply"))},Yw=U("save-state"),qw=U("disable"),Kw=U("enable"),Jw={formActionEvent:vv,saveState:Yw,disable:qw,enable:Kw},$w=function(r,c){var t=function(t,e,n,o){return Dw({name:t,text:t,disabled:n,primary:o},e,c)},e=function(t,e,n,o){return Bw({name:t,icon:P.some(t),tooltip:P.some(e),disabled:o},n,c)},l={tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools-edit-panel"]},n=P.none(),o=N,i=function(t,e,n){yr(t,e,n)},f=function(t,e){i(t,Xw.transform(),{transform:e})},a=function(t,e){i(t,Xw.tempTransform(),{transform:e})},u=function(t){return function(){I.getOpt(t).each(function(t){Fd.set(t,[R])})}},s=function(t,e){i(t,Xw.transformApply(),{transform:e,swap:u(t)})},d=function(){return t("Back",function(t){return i(t,Xw.back(),{swap:u(t)})},!1,!1)},m=function(){return t("Apply",function(t){return i(t,Xw.apply(),{swap:u(t)})},!0,!0)},h=av.sketch({dom:l,components:[d(),{dom:{tag:"div",classes:["tox-spacer"]}},t("Apply",function(t){s(t,function(t){var e=r.getRect();return Mw(t,e.x,e.y,e.w,e.h)}),r.hideCrop()},!1,!0)]}),g=Rm(Gw({name:"size",label:n,colspan:n,type:"sizeinput",constrain:!0},c)),v=av.sketch({dom:l,components:[d(),{dom:{tag:"div",classes:["tox-spacer"]}},g.asSpec(),{dom:{tag:"div",classes:["tox-spacer"]}},t("Apply",function(u){g.getOpt(u).each(function(t){var e,n,o=Kd.getValue(t),r=parseInt(o.width,10),i=parseInt(o.height,10),a=(e=r,n=i,function(t){return Hw(t,e,n)});s(u,a)})},!1,!0)]}),p=function(e,n){return function(t){return e(t,n)}},b=p(Ow,"h"),y=p(Ow,"v"),x=p(Vw,-90),w=p(Vw,90),k=av.sketch({dom:l,components:[d(),{dom:{tag:"div",classes:["tox-spacer"]}},e("flip-horizontally","Flip horizontally",function(t){a(t,b)},!1),e("flip-vertically","Flip vertically",function(t){a(t,y)},!1),e("rotate-left","Rotate counterclockwise",function(t){a(t,x)},!1),e("rotate-right","Rotate clockwise",function(t){a(t,w)},!1),{dom:{tag:"div",classes:["tox-spacer"]}},m()]}),z=function(t,e,n,o,r){var i=Py.parts().label({dom:{tag:"label",innerHtml:c.translate(t)}}),a=Py.parts().spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),u=Py.parts().thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return Py.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:n,maxX:r,getInitialValue:U({x:U(o)})},components:[i,a,u],sliderBehaviours:Ea([tm.config({})]),onChoose:e})},S=function(t,e,n,o,r){return av.sketch({dom:l,components:[d(),(i=t,a=e,u=n,c=o,s=r,z(i,function(t,e,n){var o=p(a,n.x()/100);f(t,o)},u,c,s)),m()]});var i,a,u,c,s},C=av.sketch({dom:l,components:[d(),{dom:{tag:"div",classes:["tox-spacer"]}},m()]}),O=S("Brightness",kw,-100,0,100),M=S("Contrast",zw,-100,0,100),H=S("Gamma",Cw,-100,0,100),V=function(t){return z(t,function(l,t,e){var n=E.getOpt(l),o=A.getOpt(l),r=T.getOpt(l);n.each(function(s){o.each(function(c){r.each(function(t){var e,n,o,r=Kd.getValue(s).x()/100,i=Kd.getValue(t).x()/100,a=Kd.getValue(c).x()/100,u=(e=r,n=i,o=a,function(t){return Sw(t,e,n,o)});f(l,u)})})})},0,100,200)},E=Rm(V("R")),T=Rm(V("G")),A=Rm(V("B")),B=av.sketch({dom:l,components:[d(),E.asSpec(),T.asSpec(),A.asSpec(),m()]}),D=function(e,n,o){return function(t){i(t,Xw.swap(),{transform:n,swap:function(){I.getOpt(t).each(function(t){Fd.set(t,[e]),o(t)})}})}},_=P.some(ww),F=P.some(xw),R=av.sketch({dom:l,components:[e("crop","Crop",D(h,n,function(t){r.showCrop()}),!1),e("resize","Resize",D(v,n,function(t){g.getOpt(t).each(function(t){var e=r.getMeasurements(),n=e.width,o=e.height;Kd.setValue(t,{width:n,height:o})})}),!1),e("orientation","Orientation",D(k,n,o),!1),e("brightness","Brightness",D(O,n,o),!1),e("sharpen","Sharpen",D(C,_,o),!1),e("contrast","Contrast",D(M,n,o),!1),e("color-levels","Color levels",D(B,n,o),!1),e("gamma","Gamma",D(H,n,o),!1),e("invert","Invert",D(C,F,o),!1)]}),L=av.sketch({dom:{tag:"div"},components:[R],containerBehaviours:Ea([Fd.config({})])}),I=Rm(L);return{memContainer:I,getApplyButton:function(t){return I.getOpt(t).map(function(t){var e=t.components()[0];return e.components()[e.components().length-1]})}}},Qw=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),Zw=tinymce.util.Tools.resolve("tinymce.geom.Rect"),tk=tinymce.util.Tools.resolve("tinymce.util.Observable"),ek=tinymce.util.Tools.resolve("tinymce.util.Tools"),nk=tinymce.util.Tools.resolve("tinymce.util.VK");function ok(t){var e,n;if(t.changedTouches)for(e="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n<e.length;n++)t[e[n]]=t.changedTouches[0][e[n]]}function rk(t,r){var i,a,e,u,c,l,f,d=r.document||document;r=r||{};var m=d.getElementById(r.handle||t);e=function(t){var e,n,o=function s(t){var e,n,o,r,i,a,u,c=Math.max;return e=t.documentElement,n=t.body,o=c(e.scrollWidth,n.scrollWidth),r=c(e.clientWidth,n.clientWidth),i=c(e.offsetWidth,n.offsetWidth),a=c(e.scrollHeight,n.scrollHeight),u=c(e.clientHeight,n.clientHeight),{width:o<i?r:o,height:a<c(e.offsetHeight,n.offsetHeight)?u:a}}(d);ok(t),t.preventDefault(),a=t.button,e=m,l=t.screenX,f=t.screenY,n=window.getComputedStyle?window.getComputedStyle(e,null).getPropertyValue("cursor"):e.runtimeStyle.cursor,i=Qw("<div></div>").css({position:"absolute",top:0,left:0,width:o.width,height:o.height,zIndex:2147483647,opacity:1e-4,cursor:n}).appendTo(d.body),Qw(d).on("mousemove touchmove",c).on("mouseup touchend",u),r.start(t)},c=function(t){if(ok(t),t.button!==a)return u(t);t.deltaX=t.screenX-l,t.deltaY=t.screenY-f,t.preventDefault(),r.drag(t)},u=function(t){ok(t),Qw(d).off("mousemove touchmove",c).off("mouseup touchend",u),i.remove(),r.stop&&r.stop(t)},this.destroy=function(){Qw(m).off()},Qw(m).on("mousedown touchstart",e)}var ik,ak,uk,ck,sk=0,lk=function(e){var l=Rm({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),f=Ct(1),d=Ct(P.none()),m=Ct({x:0,y:0,w:1,h:1}),c=Ct({x:0,y:0,w:1,h:1}),s=function(t,s){h.getOpt(t).each(function(t){var n=f.get(),o=qa(t.element()),r=$a(t.element()),i=s.dom().naturalWidth*n,a=s.dom().naturalHeight*n,u=Math.max(0,o/2-i/2),c=Math.max(0,r/2-a/2),e={left:u.toString()+"px",top:c.toString()+"px",width:i.toString()+"px",height:a.toString()+"px",position:"absolute"};Pi(s,e),l.getOpt(t).each(function(t){Pi(t.element(),e)}),d.get().each(function(t){var e=m.get();t.setRect({x:e.x*n+u,y:e.y*n+c,w:e.w*n,h:e.h*n}),t.setClampRect({x:u,y:c,w:i,h:a}),t.setViewPortRect({x:0,y:0,w:o,h:r})})})},n=function(t,e){var n,u=Ne.fromTag("img");return Sn(u,"src",e),(n=u.dom(),new Zm(function(t){var e=function(){n.removeEventListener("load",e),t(n)};n.complete?t(n):n.addEventListener("load",e)})).then(function(){return h.getOpt(t).map(function(t){var e=na({element:u});Fd.replaceAt(t,1,P.some(e));var n=c.get(),o={x:0,y:0,w:u.dom().naturalWidth,h:u.dom().naturalHeight};c.set(o);var r,a,i=Zw.inflate(o,-20,-20);return m.set(i),n.w===o.w&&n.h===o.h||(r=t,a=u,h.getOpt(r).each(function(t){var e=qa(t.element()),n=$a(t.element()),o=a.dom().naturalWidth,r=a.dom().naturalHeight,i=Math.min(e/o,n/r);1<=i?f.set(1):f.set(i)})),s(t,u),u})})},t=av.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[l.asSpec(),{dom:{tag:"img",attributes:{src:e}}},{dom:{tag:"div"},behaviours:Ea([ym("image-panel-crop-events",[Yr(function(t){h.getOpt(t).each(function(t){var e=function k(s,n,l,o,r){var f,a,e,i,u="tox-",c="tox-crid-"+sk++;function d(t,e){return{x:e.x-t.x,y:e.y-t.y,w:e.w,h:e.h}}function m(t,e,n,o){var r,i,a,u,c;r=e.x,i=e.y,a=e.w,u=e.h,r+=n*t.deltaX,i+=o*t.deltaY,(a+=n*t.deltaW)<20&&(a=20),(u+=o*t.deltaH)<20&&(u=20),c=s=Zw.clamp({x:r,y:i,w:a,h:u},l,"move"===t.name),c=d(l,c),f.fire("updateRect",{rect:c}),v(c)}function h(e){function t(t,e){e.h<0&&(e.h=0),e.w<0&&(e.w=0),Qw("#"+c+"-"+t,o).css({left:e.x,top:e.y,width:e.w,height:e.h})}ek.each(a,function(t){Qw("#"+c+"-"+t.name,o).css({left:e.w*t.xMul+e.x,top:e.h*t.yMul+e.y})}),t("top",{x:n.x,y:n.y,w:n.w,h:e.y-n.y}),t("right",{x:e.x+e.w,y:e.y,w:n.w-e.x-e.w+n.x,h:e.h}),t("bottom",{x:n.x,y:e.y+e.h,w:n.w,h:n.h-e.y-e.h+n.y}),t("left",{x:n.x,y:e.y,w:e.x-n.x,h:e.h}),t("move",e)}function g(t){h(s=t)}function v(t){g(function n(t,e){return{x:e.x+t.x,y:e.y+t.y,w:e.w,h:e.h}}(l,t))}return a=[{name:"move",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:0,deltaH:0,label:"Crop Mask"},{name:"nw",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:-1,deltaH:-1,label:"Top Left Crop Handle"},{name:"ne",xMul:1,yMul:0,deltaX:0,deltaY:1,deltaW:1,deltaH:-1,label:"Top Right Crop Handle"},{name:"sw",xMul:0,yMul:1,deltaX:1,deltaY:0,deltaW:-1,deltaH:1,label:"Bottom Left Crop Handle"},{name:"se",xMul:1,yMul:1,deltaX:0,deltaY:0,deltaW:1,deltaH:1,label:"Bottom Right Crop Handle"}],i=["top","right","bottom","left"],function p(){Qw('<div id="'+c+'" class="'+u+'croprect-container" role="grid" aria-dropeffect="execute">').appendTo(o),ek.each(i,function(t){Qw("#"+c,o).append('<div id="'+c+"-"+t+'"class="'+u+'croprect-block" style="display: none" data-mce-bogus="all">')}),ek.each(a,function(t){Qw("#"+c,o).append('<div id="'+c+"-"+t.name+'" class="'+u+"croprect-handle "+u+"croprect-handle-"+t.name+'"style="display: none" data-mce-bogus="all" role="gridcell" tabindex="-1" aria-label="'+t.label+'" aria-grabbed="false" title="'+t.label+'">')}),e=ek.map(a,function t(e){var n;return new rk(c,{document:o.ownerDocument,handle:c+"-"+e.name,start:function(){n=s},drag:function(t){m(e,n,t.deltaX,t.deltaY)}})}),h(s),Qw(o).on("focusin focusout",function(t){Qw(t.target).attr("aria-grabbed","focus"===t.type)}),Qw(o).on("keydown",function(e){var i;function t(t,e,n,o,r){t.stopPropagation(),t.preventDefault(),m(i,n,o,r)}switch(ek.each(a,function(t){if(e.target.id===c+"-"+t.name)return i=t,!1}),e.keyCode){case nk.LEFT:t(e,0,s,-10,0);break;case nk.RIGHT:t(e,0,s,10,0);break;case nk.UP:t(e,0,s,0,-10);break;case nk.DOWN:t(e,0,s,0,10);break;case nk.ENTER:case nk.SPACEBAR:e.preventDefault(),r()}})}(),f=ek.extend({toggleVisibility:function b(t){var e;e=ek.map(a,function(t){return"#"+c+"-"+t.name}).concat(ek.map(i,function(t){return"#"+c+"-"+t})).join(","),t?Qw(e,o).show():Qw(e,o).hide()},setClampRect:function y(t){l=t,h(s)},setRect:g,getInnerRect:function t(){return d(l,s)},setInnerRect:v,setViewPortRect:function x(t){n=t,h(s)},destroy:function w(){ek.each(e,function(t){t.destroy()}),e=[]}},tk)}({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.element().dom(),function(){});e.toggleVisibility(!1),e.on("updateRect",function(t){var e=t.rect,n=f.get(),o={x:Math.round(e.x/n),y:Math.round(e.y/n),w:Math.round(e.w/n),h:Math.round(e.h/n)};m.set(o)}),d.set(P.some(e))})})])])}],containerBehaviours:Ea([Fd.config({}),ym("image-panel-events",[Yr(function(t){n(t,e)})])])}),h=Rm(t);return{memContainer:h,updateSrc:n,zoom:function(t,e){var n=f.get(),o=0<e?Math.min(2,n+.1):Math.max(.1,n-.1);f.set(o),h.getOpt(t).each(function(t){var e=t.components()[1].element();s(t,e)})},showCrop:function(){d.get().each(function(t){t.toggleVisibility(!0)})},hideCrop:function(){d.get().each(function(t){t.toggleVisibility(!1)})},getRect:function(){return m.get()},getMeasurements:function(){var t=c.get();return{width:t.w,height:t.h}}}},fk=function(t,e,n,o,r){return Bw({name:t,icon:P.some(e),disabled:n,tooltip:P.some(t)},o,r)},dk=function(t,e){e?Gh.enable(t):Gh.disable(t)},mk=function(){return Ye.getOrDie("URL")},hk=function(t){return mk().createObjectURL(t)},gk=function(t){mk().revokeObjectURL(t)},vk=function(t){var e=Ct(t),n=Ct(P.none()),r=function s(){var n=[],o=-1;function t(){return 0<o}function e(){return-1!==o&&o<n.length-1}return{data:n,add:function r(t){var e;return e=n.splice(++o),n.push(t),{state:t,removed:e}},undo:function i(){if(t())return n[--o]},redo:function a(){if(e())return n[++o]},canUndo:t,canRedo:e}}();r.add(t);var i=function(t){e.set(t)},a=function(t){return{blob:t,url:hk(t)}},u=function(t){gk(t.url)},o=function(){n.get().each(u),n.set(P.none())},c=function(t){var e=a(t);i(e);var n,o=r.add(e).removed;return n=o,ek.each(n,u),e.url};return{getBlobState:function(){return e.get()},setBlobState:i,addBlobState:c,getTempState:function(){return n.get().fold(function(){return e.get()},function(t){return t})},updateTempState:function(t){var e=a(t);return o(),n.set(P.some(e)),e.url},addTempState:function(t){var e=a(t);return n.set(P.some(e)),e.url},applyTempState:function(e){return n.get().fold(function(){},function(t){c(t.blob),e()})},destroyTempState:o,undo:function(){var t=r.undo();return i(t),t.url},redo:function(){var t=r.redo();return i(t),t.url},getHistoryStates:function(){return{undoEnabled:r.canUndo(),redoEnabled:r.canRedo()}}}},pk=function(t,e){var n,o,r,a=vk(t.currentState),i=function(t){var e=a.getHistoryStates();g.updateButtonUndoStates(t,e.undoEnabled,e.redoEnabled),yr(t,Jw.formActionEvent,{name:Jw.saveState(),value:e.undoEnabled})},u=function(t){return t.toBlob()},c=function(t){yr(t,Jw.formActionEvent,{name:Jw.disable(),value:{}})},s=function(t){v.getApplyButton(t).each(function(t){Gh.enable(t)}),yr(t,Jw.formActionEvent,{name:Jw.enable(),value:{}})},l=function(t,e){return c(t),h.updateSrc(t,e)},f=function(e,t,n,o,r){return c(e),iw(t).then(n).then(u).then(o).then(function(t){return l(e,t).then(function(t){return i(e),r(),s(e),t})})["catch"](function(t){console.log(t),s(e)})},d=function(t,e,n){var o=a.getBlobState().blob;f(t,o,e,function(t){return a.updateTempState(t)},n)},m=function(t){var e=a.getBlobState().url;return a.destroyTempState(),i(t),e},h=lk(t.currentState.url),g=(o=Rm(fk("Undo","undo",!0,function(t){yr(t,Xw.undo(),{direction:1})},n=e)),r=Rm(fk("Redo","redo",!0,function(t){yr(t,Xw.redo(),{direction:1})},n)),{container:av.sketch({dom:{tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools__sidebar"]},components:[o.asSpec(),r.asSpec(),fk("Zoom in","zoom-in",!1,function(t){yr(t,Xw.zoom(),{direction:1})},n),fk("Zoom out","zoom-out",!1,function(t){yr(t,Xw.zoom(),{direction:-1})},n)]}),updateButtonUndoStates:function(t,e,n){o.getOpt(t).each(function(t){dk(t,e)}),r.getOpt(t).each(function(t){dk(t,n)})}}),v=$w(h,e);return{dom:{tag:"div",attributes:{role:"presentation"}},components:[v.memContainer.asSpec(),h.memContainer.asSpec(),g.container],behaviours:Ea([Kd.config({store:{mode:"manual",getValue:function(){return a.getBlobState()}}}),ym("image-tools-events",[Ir(Xw.undo(),function(e,t){var n=a.undo();l(e,n).then(function(t){s(e),i(e)})}),Ir(Xw.redo(),function(e,t){var n=a.redo();l(e,n).then(function(t){s(e),i(e)})}),Ir(Xw.zoom(),function(t,e){var n=e.event().direction();h.zoom(t,n)}),Ir(Xw.back(),function(t,e){var n,o;o=m(n=t),l(n,o).then(function(t){s(n)}),e.event().swap()(),h.hideCrop()}),Ir(Xw.apply(),function(t,e){a.applyTempState(function(){m(t),e.event().swap()()})}),Ir(Xw.transform(),function(t,e){return d(t,e.event().transform(),N)}),Ir(Xw.tempTransform(),function(t,e){return n=t,o=e.event().transform(),r=a.getTempState().blob,void f(n,r,o,function(t){return a.addTempState(t)},N);var n,o,r}),Ir(Xw.transformApply(),function(t,e){return n=t,o=e.event().transform(),r=e.event().swap(),i=a.getBlobState().blob,void f(n,i,o,function(t){var e=a.addBlobState(t);return m(n),e},r);var n,o,r,i}),Ir(Xw.swap(),function(e,t){var n;n=e,g.updateButtonUndoStates(n,!1,!1);var o=t.event().transform(),r=t.event().swap();o.fold(function(){r()},function(t){d(e,t,r)})})]),xx()])}},bk=Cl({name:"HtmlSelect",configFields:[$o("options"),zs("selectBehaviours",[tm,Kd]),cr("selectClasses",[]),cr("selectAttributes",{}),rr("data")],factory:function(n,t){var e=E(n.options,function(t){return{dom:{tag:"option",value:t.value,innerHtml:t.text}}}),o=n.data.map(function(t){return wt("initialValue",t)}).getOr({});return{uid:n.uid,dom:{tag:"select",classes:n.selectClasses,attributes:n.selectAttributes},components:e,behaviours:Cs(n.selectBehaviours,[tm.config({}),Kd.config({store:Wn({mode:"manual",getValue:function(t){return Yi(t.element())},setValue:function(t,e){_(n.options,function(t){return t.value===e}).isSome()&&qi(t.element(),e)}},o)})])}}}),yk=function(n,e){var t=n.label.map(function(t){return cp(t,e)}),o=[Td.config({mode:"execution",useEnter:!0!==n.multiline,useControlEnter:!0===n.multiline,execute:function(t){return br(t,pv),P.some(!0)}}),ym("textfield-change",[Ir(Nt(),function(t,e){yr(t,mv,{name:n.name})}),Ir(Gt(),function(t,e){yr(t,mv,{name:n.name})})]),Vp.config({})],r=n.validation.map(function(o){return Op.config({getRoot:function(t){return rn(t.element())},invalidClass:"tox-invalid",validator:{validate:function(t){var e=Kd.getValue(t),n=o.validator(e);return Fv.pure(!0===n?ft.value(e):ft.error(n))},validateOnLoad:o.validateOnLoad}})}).toArray(),i=Sv.parts().field({tag:!0===n.multiline?"textarea":"input",inputAttributes:n.placeholder.fold(function(){},function(t){return{placeholder:e.translate(t)}}),inputClasses:[n.classname],inputBehaviours:Ea(I([o,r])),selectOnFocus:!1,factory:dp}),a=n.flex?["tox-form__group--stretched"]:[];return rp(t,i,a)},xk=function(i){return Wn({},i,{toCached:function(){return xk(i.toCached())},bindFuture:function(e){return xk(i.bind(function(t){return t.fold(function(t){return Fv.pure(ft.error(t))},function(t){return e(t)})}))},bindResult:function(e){return xk(i.map(function(t){return t.bind(e)}))},mapResult:function(e){return xk(i.map(function(t){return t.map(e)}))},foldResult:function(e,n){return i.map(function(t){return t.fold(e,n)})},withTimeout:function(t,r){return xk(Fv.nu(function(e){var n=!1,o=window.setTimeout(function(){n=!0,e(ft.error(r()))},t);i.get(function(t){n||(window.clearTimeout(o),e(t))})}))}})},wk=function(t){return xk(Fv.nu(t))},kk=wk,zk={type:"separator"},Sk=function(t){return{type:"menuitem",value:t.url,text:t.title,meta:{attach:t.attach},onAction:function(){}}},Ck=function(t,e){return{type:"menuitem",value:e,text:t,meta:{attach:N},onAction:function(){}}},Ok=function(t,e){return o=t,n=A(e,function(t){return t.type===o}),E(n,Sk);var n,o},Mk=function(t,e){var n=t.toLowerCase();return A(e,function(t){var e=t.meta!==undefined&&t.meta.text!==undefined?t.meta.text:t.text;return fe(e.toLowerCase(),n)||fe(t.value.toLowerCase(),n)})},Hk=function(c,t,s){var e=Kd.getValue(t),l=e.meta.text!==undefined?e.meta.text:e.value;return s.getLinkInformation().fold(function(){return[]},function(t){var e,n,o,r,i,a,u=Mk(l,(e=s.getHistory(c),E(e,function(t){return Ck(t,t)})));return"file"===c?(n=[u,Mk(l,(a=t,Ok("header",a.targets))),Mk(l,I([(i=t,i.anchorTop.map(function(t){return Ck("<top>",t)}).toArray()),(r=t,Ok("anchor",r.targets)),(o=t,o.anchorBottom.map(function(t){return Ck("<bottom>",t)}).toArray())]))],D(n,function(t,e){return 0===t.length||0===e.length?t.concat(e):t.concat(zk,e)},[])):u})},Vk=function(i,a,o){var t,r=function(t){var e=Kd.getValue(t);o.addToHistory(e.value,i.filetype)},e=Sv.parts().field({factory:op,dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],minChars:0,responseTime:0,fetch:function(t){var e=Hk(i.filetype,t,o),n=fp(e,Zh.BUBBLE_TO_SANDBOX,a.providers);return Fv.pure(n)},getHotspot:function(t){return f.getOpt(t)},onSetValue:function(t,e){t.hasConfigured(Op)&&Op.run(t).get(N)},typeaheadBehaviours:Ea(I([o.getValidationHandler().map(function(o){return Op.config({getRoot:function(t){return rn(t.element())},invalidClass:"tox-status-invalid",notify:{},validator:{validate:function(e){var n=Kd.getValue(e);return kk(function(t){o({type:i.filetype,url:n.value},function(n){f.getOpt(e).each(function(t){var e=function(t,e,n){(n?Ti:Ai)(t.element(),e)};e(t,"tox-status-valid","valid"===n.status),e(t,"tox-status-unknown","unknown"===n.status)}),t(("invalid"===n.status?ft.error:ft.value)(n.message))})})},validateOnLoad:!1}})}).toArray(),[Vp.config({}),ym("urlinput-events",I(["file"===i.filetype?[Ir(Nt(),function(t){yr(t,mv,{name:i.name})})]:[],[Ir(Pt(),function(t){yr(t,mv,{name:i.name}),r(t)}),Ir(Gt(),function(t){yr(t,mv,{name:i.name}),r(t)})]]))]])),eventOrder:(t={},t[Nt()]=["streaming","urlinput-events","invalidating"],t),model:{getDisplayText:function(t){return t.value},selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"dog"},lazySink:a.getSink,parts:{menu:xg(0,0,"normal")},onExecute:function(t,e,n){yr(e,pv,{})},onItemExecute:function(t,e,n,o){r(t),yr(t,mv,{name:i.name})}}),n=i.label.map(function(t){return cp(t,a.providers)}),u=function(t,e,n){return void 0===e&&(e=t),void 0===n&&(n=t),{dom:{tag:"span",classes:["tox-icon","tox-status-icon__"+t],innerHtml:Nm("icon-"+e,a.providers.icons),attributes:{title:a.providers.translate(n)}}}},c=Rm({dom:{tag:"span",classes:["tox-status"]},components:[u("checkmark","checkmark","valid"),u("warning"),u("error","warning")]}),s=o.getUrlPicker(i.filetype),l=jn("browser.url.event"),f=Rm({dom:{tag:"div",classes:["tox-input-wrap"]},components:[e,c.asSpec()]});return Sv.sketch({dom:up([]),components:n.toArray().concat([{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:I([[f.asSpec()],s.map(function(){return t=i.label,e=l,n="tox-browse-url",o="icon-browse",r=a.providers,Fm.sketch({dom:{tag:"button",classes:["tox-tbtn",n],innerHtml:Nm(o,r.icons),attributes:{title:r.translate(t.getOr(""))}},action:function(t){br(t,e)}});var t,e,n,o,r}).toArray()])}]),fieldBehaviours:Ea([ym("url-input-events",[Ir(l,function(o){El.getCurrent(o).each(function(e){var n=Kd.getValue(e);s.each(function(t){t(n).get(function(t){Kd.setValue(e,t),yr(o,mv,{name:i.name})})})})})])])})},Ek=function(a,e){var t,n,o=a.label.map(function(t){return cp(t,e)}),r=function(n){return function(e,t){ca(t.event().target(),"[data-collection-item-value]").each(function(t){n(e,t,On(t,"data-collection-item-value"))})}},i=[Ir(_t(),r(function(t,e){tf(e)})),Ir(jt(),r(function(t,e,n){yr(t,vv,{name:a.name,value:n})})),Ir(Ft(),r(function(t,e,n){ua(t.element(),"."+kh).each(function(t){Ai(t,kh)}),Ti(e,kh)})),Ir(Rt(),r(function(t,e,n){ua(t.element(),"."+kh).each(function(t){Ai(t,kh)})})),Jr(r(function(t,e,n){yr(t,vv,{name:a.name,value:n})}))],u=Sv.parts().field({dom:{tag:"div",classes:["tox-collection"].concat(1!==a.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:d},behaviours:Ea([Fd.config({}),Kd.config({store:{mode:"memory",initialValue:[]},onSetValue:function(o,t){var e,n,r,i;e=o,n=E(t,function(t){var e,n=1===a.columns?t.text.map(function(t){return'<span class="tox-collection__item-label">'+t+"</span>"}).getOr(""):"",o=t.icon.map(function(t){return'<span class="tox-collection__item-icon">'+t+"</span>"}).getOr("");return'<div class="tox-collection__item" tabindex="-1" data-collection-item-value="'+('"'===(e=t.value)?""":e)+'">'+o+n+"</div>"}),r=1<a.columns&&"auto"!==a.columns?V(n,a.columns):[n],i=E(r,function(t){return'<div class="tox-collection__group">'+t.join("")+"</div>"}),pn(e.element(),i.join("")),"auto"===a.columns&&dh(o,5,"tox-collection__item").each(function(t){var e=t.numRows,n=t.numColumns;Td.setGridSize(o,e,n)}),br(o,wv)}}),Vp.config({}),Td.config((t=a.columns,n="normal",1===t?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===t?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:"color"===n?".tox-swatches__row":".tox-collection__group",cell:"color"===n?"."+ph:"."+vh}})),ym("collection-events",i)])});return rp(o,u,["tox-form__group--collection"])},Tk=function(r){return function(e,n,o){return xt(n,"name").fold(function(){return r(n,o)},function(t){return e.field(t,r(n,o))})}},Ak={bar:Tk(function(t,e){return n=t,o=e.shared,{dom:{tag:"div",classes:["tox-bar"]},components:E(n.items,o.interpreter)};var n,o}),collection:Tk(function(t,e){return Ek(t,e.shared.providers)}),alloy:Tk(d),alertbanner:Tk(function(t,e){return n=t,o=e.shared.providers,av.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in","tox-notification--"+n.level]},components:[{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:o.translate(n.text)}},Fm.sketch({dom:{tag:"button",classes:["tox-notification__right-icon","tox-button","tox-button--naked","tox-button--icon"],innerHtml:Nm("icon-"+n.icon,o.icons),attributes:{title:o.translate(n.actionLabel)}},action:function(t){yr(t,vv,{name:"alert-banner",value:n.url})}})]});var n,o}),input:Tk(function(t,e){return n=t,o=e.shared.providers,yk({name:n.name,multiline:!1,label:n.label,placeholder:n.placeholder,flex:!1,classname:"tox-textfield",validation:P.none()},o);var n,o}),textarea:Tk(function(t,e){return n=t,o=e.shared.providers,yk({name:n.name,multiline:!0,label:n.label,placeholder:n.placeholder,flex:n.flex,classname:"tox-textarea",validation:P.none()},o);var n,o}),listbox:Tk(function(t,e){return n=t,o=e.shared.providers,r=cp(n.label,o),i=Sv.parts().field({factory:bk,dom:{classes:["mce-select-field"]},selectBehaviours:Ea([Vp.config({})]),options:n.values,data:n.initialValue.getOr(undefined)}),ip(P.some(r),i);var n,o,r,i}),label:Tk(function(t,e){return n=t,o=e.shared,r={dom:{tag:"label",innerHtml:o.providers.translate(n.label),classes:["tox-label"]}},i=E(n.items,o.interpreter),{dom:{tag:"div",classes:["tox-form__group"]},components:[r].concat(i),behaviours:Ea([xx(),Fd.config({}),Ex(P.none()),Td.config({mode:"acyclic"})])};var n,o,r,i}),iframe:(ik=function(t,e){return Px(t,e.shared.providers)},function(t,e,n){var o=gt(e,{source:"dynamic"});return Tk(ik)(t,o,n)}),autocomplete:Tk(function(t,e){return r=t,i=e.shared,n=cp(r.label.getOr("?"),i.providers),o=Sv.parts().field({factory:op,dismissOnBlur:!1,inputClasses:["tox-textfield"],minChars:1,fetch:function(t){var e=Kd.getValue(t),n=r.getItems(e),o=fp(n,Zh.BUBBLE_TO_SANDBOX,i.providers);return Fv.pure(o)},markers:{openClass:"dog"},lazySink:i.getSink,parts:{menu:xg(0,0,"normal")}}),ip(P.some(n),o);var r,i,n,o}),button:Tk(function(t,e){return n=t,o=e.shared.providers,r=_w(n.name,"custom"),Dw(n,r,o,[Tx(""),xx()]);var n,o,r}),checkbox:Tk(function(t,e){return n=t,o=e.shared.providers,r=Kd.config({store:{mode:"manual",getValue:function(t){var e=t.element().dom();return e.indeterminate?"indeterminate":e.checked?"checked":"unchecked"},setValue:function(t,e){var n=t.element().dom();switch(e){case"indeterminate":n.indeterminate=!0;break;case"checked":n.checked=!0,n.indeterminate=!1;break;default:n.checked=!1,n.indeterminate=!1}}}}),i=function(t){return t.element().dom().click(),P.some(!0)},a=Sv.parts().field({factory:{sketch:d},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:Ea([xx(),Vp.config({}),tm.config({}),r,Td.config({mode:"special",onEnter:i,onSpace:i}),ym("checkbox-events",[Ir(Pt(),function(t,e){yr(t,mv,{name:n.name})})])])}),u=Sv.parts().label({dom:{tag:"span",classes:["tox-checkbox__label"],innerHtml:o.translate(n.label)},behaviours:Ea([Zp.config({})])}),s=Rm({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[(c=function(t){return{dom:{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+t],innerHtml:Nm("icon-"+("checked"===t?"selected":"unchecked"===t?"unselected":"indeterminate"),o.icons)}}})("checked"),c("unchecked"),c("indeterminate")]}),Sv.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[a,s.asSpec(),u]});var n,o,r,i,a,u,c,s}),colorinput:Tk(function(t,e){return nb(t,e.shared,e.colorinput)}),colorpicker:Tk(function(t){var e=function(t){return"tox-"+t},n=yx(Sx,e),r=Rm(n.sketch({dom:{tag:"div",classes:[e("color-picker-container")],attributes:{role:"presentation"}},onValidHex:function(t){yr(t,vv,{name:"hex-valid",value:!0})},onInvalidHex:function(t){yr(t,vv,{name:"hex-valid",value:!1})}}));return{dom:{tag:"div"},components:[r.asSpec()],behaviours:Ea([Kd.config({store:{mode:"manual",getValue:function(t){var e=r.get(t);return El.getCurrent(e).bind(function(t){return Kd.getValue(t).hex}).map(function(t){return"#"+t}).getOr("")},setValue:function(t,e){var n=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/.exec(e),o=r.get(t);El.getCurrent(o).fold(function(){console.log("Can not find form")},function(t){Kd.setValue(t,{hex:P.from(n[1]).getOr("")}),dx.getField(t,"hex").each(function(t){br(t,Nt())})})}}}),xx()])}}),dropzone:Tk(function(t,e){return Ax(t,e.shared.providers)}),grid:Tk(function(t,e){return n=t,o=e.shared,{dom:{tag:"div",classes:["tox-form","tox-form--"+n.columns+"col"]},components:E(n.items,o.interpreter)};var n,o}),selectbox:Tk(function(t,e){return n=t,o=e.shared.providers,r=n.label.map(function(t){return cp(t,o)}),i=Sv.parts().field({dom:{},selectAttributes:{size:n.size},options:n.items,factory:bk,selectBehaviours:Ea([Vp.config({}),ym("selectbox-change",[Ir(Pt(),function(t,e){yr(t,mv,{name:n.name})})])])}),a=1<n.size?P.none():P.some({dom:{tag:"div",classes:["tox-selectfield__icon-js"],innerHtml:Nm("icon-chevron-down",o.icons)}}),u={dom:{tag:"div",classes:["tox-selectfield"]},components:I([[i],a.toArray()])},Sv.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:I([r.toArray(),[u]])});var n,o,r,i,a,u}),sizeinput:Tk(function(t,e){return Gw(t,e.shared.providers)}),urlinput:Tk(function(t,e){return Vk(t,e.shared,e.urlinput)}),customeditor:Tk(function(e){var n=Ct(P.none()),o=Rm({dom:{tag:e.tag}}),r=Ct(P.none());return{dom:{tag:"div",classes:["tox-well","tox-well--no-padding"]},behaviours:Ea([ym("editor-foo-events",[Yr(function(t){o.getOpt(t).each(function(t){e.init(t.element().dom()).then(function(e){r.get().each(function(t){e.setValue(t)}),r.set(P.none()),n.set(P.some(e))})})})]),Kd.config({store:{mode:"manual",getValue:function(){return n.get().fold(function(){return r.get().getOr("")},function(t){return t.getValue()})},setValue:function(t,e){n.get().fold(function(){r.set(P.some(e))},function(t){return t.setValue(e)})}}}),xx()]),components:[o.asSpec()]}}),htmlpanel:Tk(function(t){return av.sketch({dom:{tag:"div",innerHtml:t.html}})}),imagetools:Tk(function(t,e){return pk(t,e.shared.providers)}),table:Tk(function(t,e){return n=t,o=e.shared.providers,a=function(t){return{dom:{tag:"th",innerHtml:o.translate(t)}}},u=function(t){return{dom:{tag:"td",innerHtml:o.translate(t)}}},c=function(t){return{dom:{tag:"tr"},components:E(t,u)}},{dom:{tag:"table",classes:["tox-dialog__table"]},components:[(i=n.header,{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:E(i,a)}]}),(r=n.cells,{dom:{tag:"tbody"},components:E(r,c)})]};var n,o,r,i,a,u,c})},Bk={field:function(t,e){return e}},Dk=function(e,t,n){var o=gt(n,{shared:{interpreter:function(t){return _k(e,t,o)}}});return _k(e,t,o)},_k=function(e,n,o){return xt(Ak,n.type).fold(function(){return console.error('Unknown factory type "'+n.type+'", defaulting to container: ',n),n},function(t){return t(e,n,o)})},Fk=function(t){return{colorPicker:(n=t,function(t,e){Kp.colorPickerDialog(n)(t,e)}),hasCustomColors:(e=t,function(){return Lp(e)})};var e,n},Rk=[{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:"strike-through",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:"align-left",format:"alignleft"},{title:"Center",icon:"align-center",format:"aligncenter"},{title:"Right",icon:"align-right",format:"alignright"},{title:"Justify",icon:"align-justify",format:"alignjustify"}]}],Lk=function(t){return D(t,function(t,e){if(it(e,"items")){var n=Lk(e.items);return{customFormats:t.customFormats.concat(n.customFormats),formats:t.formats.concat([{title:e.title,items:n.formats}])}}if(it(e,"inline")||it(e,"block")||it(e,"selector")){var o="custom-"+e.title.toLowerCase();return{customFormats:t.customFormats.concat([{name:o,format:e}]),formats:t.formats.concat([{title:e.title,format:o,icon:e.icon}])}}return Wn({},t,{formats:t.formats.concat(e)})},{customFormats:[],formats:[]})},Ik=function(i){return(t=i,P.from(t.getParam("style_formats")).filter(C)).map(function(t){var e,n,o,r=(e=i,n=Lk(t),o=function(t){T(t,function(t){e.formatter.has(t.name)||e.formatter.register(t.name,t.format)})},e.formatter?o(n.customFormats):e.on("init",function(){o(n.customFormats)}),n.formats);return i.getParam("style_formats_merge",!1,"boolean")?Rk.concat(r):r}).getOr(Rk);var t},Nk=function(t,e,n){var o={type:"formatter",isSelected:e(t.format),getStylePreview:n(t.format)};return gt(t,o)},Pk=function(s,t,l,f){var d=function(t){return E(t,function(t){var e,n,o,r,i,a,u=Q(t);if(St(t,"items")){var c=d(t.items);return gt((i=t,a={type:"submenu",isSelected:U(!1),getStylePreview:function(){return P.none()}},gt(i,a)),{getStyleItems:function(){return c}})}return St(t,"format")?Nk(t,l,f):1===u.length&&M(u,"title")?gt(t,{type:"separator"}):(n=jn((e=t).title),o={type:"formatter",format:n,isSelected:l(n),getStylePreview:f(n)},r=gt(e,o),s.formatter.register(n,r),r)})};return d(t)},jk=ek.trim,Uk=function(e){return function(t){if(t&&1===t.nodeType){if(t.contentEditable===e)return!0;if(t.getAttribute("data-mce-contenteditable")===e)return!0}return!1}},Wk=Uk("true"),Gk=Uk("false"),Xk=function(t,e,n,o,r){return{type:t,title:e,url:n,level:o,attach:r}},Yk=function(t){return t.innerText||t.textContent},qk=function(t){return(e=t)&&"A"===e.nodeName&&(e.id||e.name)!==undefined&&Jk(t);var e},Kk=function(t){return t&&/^(H[1-6])$/.test(t.nodeName)},Jk=function(t){return function(t){for(;t=t.parentNode;){var e=t.contentEditable;if(e&&"inherit"!==e)return Wk(t)}return!1}(t)&&!Gk(t)},$k=function(t){return Kk(t)&&Jk(t)},Qk=function(t){var e,n,o=(e=t).id?e.id:jn("h");return Xk("header",Yk(t),"#"+o,Kk(n=t)?parseInt(n.nodeName.substr(1),10):0,function(){t.id=o})},Zk=function(t){var e=t.id||t.name,n=Yk(t);return Xk("anchor",n||"#"+e,"#"+e,0,N)},tz=function(t){var e,n;return e="h1,h2,h3,h4,h5,h6,a:not([href])",n=t,E(yc(Ne.fromDom(n),e),function(t){return t.dom()})},ez=function(t){return 0<jk(t.title).length},nz=function(t){var e,n=tz(t);return A((e=n,E(A(e,$k),Qk)).concat(E(A(n,qk),Zk)),ez)},oz="tinymce-url-history",rz=function(t){return x(t)&&/^https?/.test(t)},iz=function(t){return w(t)&&function(t,e){for(var n=Q(t),o=0,r=n.length;o<r;o++){var i=n[o],a=t[i];if(e(a,i,t))return P.some(a)}return P.none()}(t,function(t){return!(C(e=t)&&e.length<=5&&W(e,rz));var e}).isNone()},az=function(){var t,e=localStorage.getItem(oz);if(null===e)return{};try{t=JSON.parse(e)}catch(n){if(n instanceof SyntaxError)return console.log("Local storage "+oz+" was not valid JSON",n),{};throw n}return iz(t)?t:(console.log("Local storage "+oz+" was not valid format",t),{})},uz=function(t){var e=az();return Object.prototype.hasOwnProperty.call(e,t)?e[t]:[]},cz=function(e,t){if(rz(e)){var n=az(),o=Object.prototype.hasOwnProperty.call(n,t)?n[t]:[],r=A(o,function(t){return t!==e});n[t]=[e].concat(r).slice(0,5),function(t){if(!iz(t))throw new Error("Bad format for history:\n"+JSON.stringify(t));localStorage.setItem(oz,JSON.stringify(t))}(n)}},sz=Object.prototype.hasOwnProperty,lz=function(t){return!!t},fz=function(t){return et(ek.makeMap(t,/[, ]/),lz)},dz=function(t,e){return sz.call(t,e)?P.some(t[e]):P.none()},mz=function(t,e,n){var o=dz(t,e).getOr(n);return x(o)?P.some(o):P.none()},hz=function(u){return function(r){return(t=u.settings,e=r,n=P.some(t.file_picker_types).filter(lz),o=P.some(t.file_browser_callback_types).filter(lz),i=n.or(o).map(fz).fold(function(){return!0},function(t){return dz(t,e).getOr(!1)}),a=P.some(t.file_picker_callback).filter(z),i?a:P.none()).map(function(o){return function(e){return Fv.nu(function(n){var t=ek.extend({filetype:r},P.from(e.meta).getOr({}));o.call(u,function(t,e){if(!x(t))throw new Error("Expected value to be string");if(e!==undefined&&!w(e))throw new Error("Expected meta to be a object");n({value:t,meta:e})},e.value,t)})}});var t,e,n,o,i,a}},gz=function(t){return{getHistory:uz,addToHistory:cz,getLinkInformation:(n=t,function(){return!1===n.settings.typeahead_urls?P.none():P.some({targets:nz(n.getBody()),anchorTop:mz(n.settings,"anchor_top","#top"),anchorBottom:mz(n.settings,"anchor_bottom","#bottom")})}),getValidationHandler:(e=t,function(){var t=e.settings.filepicker_validator_handler;return z(t)?P.some(t):P.none()}),getUrlPicker:hz(t)};var e,n},vz=function(t,e,n){var o,r,i,a,u,c,s,l,f,d={shared:{providers:{icons:function(){return e.ui.registry.getAll().icons},translate:Ch.translate},interpreter:function(t){return _k(Bk,t,d)},anchors:{toolbar:function(){return{anchor:"hotspot",hotspot:n(),layouts:{onRtl:function(){return[Wu]},onLtr:function(){return[Gu]}}}},banner:function(){return{anchor:"hotspot",hotspot:n(),layouts:{onRtl:function(){return[Ku]},onLtr:function(){return[Ku]}}}},cursor:function(){return{anchor:"selection",root:Ne.fromDom(e.getBody()),getSelection:function(){var t=e.selection.getRng();return P.some(cc(Ne.fromDom(t.startContainer),t.startOffset,Ne.fromDom(t.endContainer),t.endOffset))}}},node:function(t){return{anchor:"node",root:Ne.fromDom(e.getBody()),node:t}}},getSink:function(){return ft.value(t)}},urlinput:gz(e),styleselect:(o=e,r=function(t){return function(){return o.formatter.match(t)}},i=function(e){return function(){var t=o.formatter.get(e);return t!==undefined?P.some({tag:0<t.length&&(t[0].inline||t[0].block)||"div",styleAttr:o.formatter.getCssText(e)}):P.none()}},a=function(t){var e=t.items;return e!==undefined&&0<e.length?j(e,a):[t.format]},u=Ct([]),c=Ct([]),s=Ct([]),l=Ct([]),f=Ct(!1),o.on("init",function(){var t=Ik(o),e=Pk(o,t,r,i);u.set(e),c.set(j(e,a))}),o.on("addStyleModifications",function(t){var e=Pk(o,t.items,r,i);s.set(e),f.set(t.replace),l.set(j(e,a))}),{getData:function(){var t=f.get()?[]:u.get(),e=s.get();return t.concat(e)},getFlattenedKeys:function(){var t=f.get()?[]:c.get(),e=l.get();return t.concat(e)}}),colorinput:Fk(e)};return d},pz=tinymce.util.Tools.resolve("tinymce.util.Delay"),bz=U([cr("shell",!0),zs("toolbarBehaviours",[Fd])]),yz=U([Zs({name:"groups",overrides:function(t){return{behaviours:Ea([Fd.config({})])}}})]),xz=Ol({name:"Toolbar",configFields:bz(),partFields:yz(),factory:function(e,t,n,o){var r=function(t){return e.shell?P.some(t):fl(t,e,"groups")},i=e.shell?{behaviours:[Fd.config({})],components:[]}:{behaviours:[],components:t};return{uid:e.uid,dom:e.dom,components:i.components,behaviours:Cs(e.toolbarBehaviours,i.behaviours),apis:{setGroups:function(t,e){r(t).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(t){Fd.set(t,e)})}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)}}}),wz=U([$o("items"),va(["itemSelector"]),zs("tgroupBehaviours",[Td])]),kz=U([tl({name:"items",unit:"item"})]),zz=Ol({name:"ToolbarGroup",configFields:wz(),partFields:kz(),factory:function(t,e,n,o){return{uid:t.uid,dom:t.dom,components:e,behaviours:Cs(t.tgroupBehaviours,[Td.config({mode:"flow",selector:t.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),Sz=function(t){return zz.sketch({dom:{tag:"div",classes:["tox-toolbar__group"]},components:[zz.parts().items({})],items:t.items,markers:{itemSelector:".tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-js:not([disabled])"},tgroupBehaviours:Ea([Vp.config({}),tm.config({})])})},Cz=function(n){var t=n.cyclicKeying?"cyclic":"acyclic";return xz.sketch({uid:n.uid,dom:{tag:"div",classes:["tox-toolbar"]},components:[xz.parts().groups({})],toolbarBehaviours:Ea([Td.config({mode:t,onEscape:n.onEscape,selector:".tox-toolbar__group"}),ym("toolbar-events",[Yr(function(t){var e=E(n.initGroups,Sz);xz.setGroups(t,e)})])])})},Oz=[dr("disabled",!1),ar("tooltip"),ar("icon"),ar("text"),mr("onSetup",function(){return N})],Mz=Ho([Zo("type"),tr("onAction")].concat(Oz)),Hz=function(t){return No("toolbarbutton",Mz,t)},Vz=Ho([Zo("type"),ar("tooltip"),ar("icon"),ar("text"),tr("fetch"),mr("onSetup",function(){return N})]),Ez=Ho([Zo("type"),ar("tooltip"),ar("icon"),ar("text"),(ak="select",ir(ak,Jo)),tr("fetch"),mr("onSetup",function(){return N}),fr("presets","normal"),cr("columns",1),tr("onAction"),tr("onItemAction")]),Tz=[dr("active",!1)].concat(Oz),Az=Ho(Tz.concat([Zo("type"),tr("onAction")])),Bz=function(t){return No("ToggleButton",Az,t)},Dz=[mr("predicate",function(){return!1}),cr("scope","node"),cr("position","selection")],_z=Oz.concat([cr("type","contextformbutton"),cr("primary",!1),tr("onAction"),gr("original",d)]),Fz=Tz.concat([cr("type","contextformbutton"),cr("primary",!1),tr("onAction"),gr("original",d)]),Rz=Oz.concat([cr("type","contextformbutton")]),Lz=Tz.concat([cr("type","contextformtogglebutton")]),Iz=Wo("type",{contextformbutton:_z,contextformtogglebutton:Fz}),Nz=Ho([cr("type","contextform"),mr("initValue",function(){return""}),ar("label"),or("commands",Iz),ir("launch",Wo("type",{contextformbutton:Rz,contextformtogglebutton:Lz}))].concat(Dz)),Pz=Ho([cr("type","contexttoolbar"),Zo("items")].concat(Dz)),jz=jn("toolbar.button.execute"),Uz={"alloy.execute":["disabling","alloy.base.behaviour","toggling","toolbar-button-events"]},Wz=Object.freeze({getState:function(t,e,n){return n}}),Gz=Object.freeze({events:function(r,i){var o=function(n,o){r.updateState.each(function(t){var e=t(n,o);i.set(e)}),r.renderComponents.each(function(t){var e=t(o,i.get());is(n),T(e,function(t){es(n,n.getSystem().build(t))})})};return Fr([Ir(ke(),function(t,e){var n=r.channel;M(e.channels(),n)&&o(t,e.data())}),Yr(function(e,t){r.initialData.each(function(t){o(e,t)})})])}}),Xz=Object.freeze({init:function(t){var e=Ct(P.none());return{readState:function(){return e.get().getOr("none")},get:function(){return e.get()},set:function(t){return e.set(t)},clear:function(){return e.set(P.none())}}}}),Yz=[$o("channel"),rr("renderComponents"),rr("updateState"),rr("initialData")],qz=Aa({fields:Yz,name:"reflecting",active:Gz,apis:Wz,state:Xz}),Kz=U([$o("toggleClass"),$o("fetch"),xa("onExecute"),cr("getHotspot",P.some),cr("layouts",P.none()),xa("onItemExecute"),rr("lazySink"),$o("dom"),ba("onOpen"),zs("splitDropdownBehaviours",[Mv,Td,tm]),cr("matchWidth",!1),cr("useMinWidth",!1)].concat(tp())),Jz=$s({factory:Fm,schema:[$o("dom")],name:"arrow",defaults:function(t){return{dom:{attributes:{role:"button","aria-haspopup":!0}},buttonBehaviours:Ea([tm.revoke()])}},overrides:function(e){return{action:function(t){t.getSystem().getByUid(e.uid).each(xr)},buttonBehaviours:Ea([dm.config({toggleOnExecute:!1,toggleClass:e.toggleClass,aria:{mode:"pressed"}})])}}}),$z=$s({factory:Fm,schema:[$o("dom")],name:"button",defaults:function(t){return{dom:{attributes:{role:"button"}},buttonBehaviours:Ea([tm.revoke()])}},overrides:function(n){return{action:function(e){e.getSystem().getByUid(n.uid).each(function(t){n.onExecute(t,e)})}}}}),Qz=U([Jz,$z,Qs({schema:[ga()],name:"menu",defaults:function(o){return{onExecute:function(e,n){e.getSystem().getByUid(o.uid).each(function(t){o.onItemExecute(t,e,n)})}}}}),Lv()]),Zz=Ol({name:"SplitDropdown",configFields:Kz(),partFields:Qz(),factory:function(n,t,e,o){var r=function(t){El.getCurrent(t).each(function(t){Ul.highlightFirst(t),Td.focusIn(t)})},i=function(t){jv(n,function(t){return t},t,o,r,rv.HighlightFirst).get(N)},a=function(t){var e=dl(t,n,"button");return xr(e),P.some(!0)},u=_m(P.some(i));return{uid:n.uid,dom:n.dom,components:t,eventOrder:{"alloy.execute":["toggling","alloy.base.behaviour"]},events:u,behaviours:Cs(n.splitDropdownBehaviours,[Mv.config({others:{sandbox:function(t){var e=dl(t,n,"arrow");return Gv(n,t,{onOpen:function(){dm.on(e)},onClose:function(){dm.off(e)}})}}}),Td.config({mode:"special",onSpace:a,onEnter:a,onDown:function(t){return i(t),P.some(!0)}}),tm.config({})]),domModification:{attributes:{role:"presentation"}}}}}),tS=function(e){return{isDisabled:function(){return Gh.isDisabled(e)},setDisabled:function(t){return t?Gh.disable(e):Gh.enable(e)}}},eS=function(e){return{setActive:function(t){dm.set(e,t)},isActive:function(){return dm.isOn(e)},isDisabled:function(){return Gh.isDisabled(e)},setDisabled:function(t){return t?Gh.disable(e):Gh.enable(e)}}},nS=jn("focus-button"),oS=function(e,n,t,o,r){var i,a=t.map(function(t){return{"aria-label":r.translate(t),title:r.translate(t)}}).getOr({});return{dom:{tag:"button",classes:["tox-tbtn"].concat(n.isSome()?["tox-tbtn--select"]:[]),attributes:a},components:eg([e.map(function(t){return Ew(t,r.icons)}),n.map(function(t){return Tw(t,"tox-tbtn",r)})]),eventOrder:(i={},i[Tt()]=["focusing","alloy.base.behaviour","common-button-display-events"],i),buttonBehaviours:Ea([ym("common-button-display-events",[Ir(Tt(),function(t,e){e.event().prevent(),br(t,nS)})])].concat(o.map(function(t){return qz.config({channel:t,initialData:{icon:e,text:n},renderComponents:function(t,e){return eg([t.icon.map(function(t){return Ew(t,r.icons)}),t.text.map(function(t){return Tw(t,"tox-tbtn",r)})])}})}).toArray()))}},rS=function(t,e,n){var o,r=Ct(N),i=oS(t.icon,t.text,t.tooltip,P.none(),n);return Fm.sketch({dom:i.dom,components:i.components,eventOrder:Uz,buttonBehaviours:Ea([ym("toolbar-button-events",[(o={onAction:t.onAction,getApi:e.getApi},Jr(function(e,t){qh(o,e)(function(t){yr(e,jz,{buttonApi:t}),o.onAction(t)})})),Kh(e,r),Jh(e,r)]),Yh(t.disabled)].concat(e.toolbarButtonBehaviours))})},iS=function(t,e,n){return rS(t,{toolbarButtonBehaviours:[].concat(0<n.length?[ym("toolbarButtonWith",n)]:[]),getApi:tS,onSetup:t.onSetup},e)},aS=function(t,e,n){return gt(rS(t,{toolbarButtonBehaviours:[Fd.config({}),dm.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(0<n.length?[ym("toolbarToggleButtonWith",n)]:[]),getApi:eS,onSetup:t.onSetup},e))},uS=function(e,t){var n,r,o,i=jn("channel-update-split-dropdown-display"),a=function(n){return{isDisabled:function(){return!0},setDisabled:function(){},setIconFill:function(t,e){ua(n.element(),'svg path[id="'+t+'"], rect[id="'+t+'"]').each(function(t){Sn(t,"fill",e)})},setIconStroke:function(t,e){ua(n.element(),'svg path[id="'+t+'"], rect[id="'+t+'"]').each(function(t){Sn(t,"stroke",e)})},setActive:function(t){dm.set(n,t)},isActive:function(){return dm.isOn(n)}}},u=Ct(N),c={getApi:a,onSetup:e.onSetup};return Zz.sketch({dom:{tag:"div",classes:["tox-split-button"]},onExecute:function(t){e.onAction(a(t))},onItemExecute:function(t,e,n){},splitDropdownBehaviours:Ea([dm.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1}),ym("split-dropdown-events",[Ir(nS,tm.focus),Kh(c,u),Jh(c,u)])]),toggleClass:"mce-active",lazySink:t.getSink,fetch:(n=a,r=e,o=t.providers,function(e){return Fv.nu(function(t){return r.fetch(t)}).map(function(t){return Bg(gt(Tg(jn("menu-value"),t,function(t){r.onItemAction(n(e),t)},r.columns,r.presets,Zh.CLOSE_ON_EXECUTE,r.select.getOr(function(){return!1}),o),{movement:wg(r.columns,r.presets),menuBehaviours:hh("auto"!==r.columns?[]:[Yr(function(o,t){dh(o,4,zh(r.presets)).each(function(t){var e=t.numRows,n=t.numColumns;Td.setGridSize(o,e,n)})})])}))})}),parts:{menu:xg(0,e.columns,e.presets)},components:[Zz.parts().button(oS(e.icon,e.text,e.tooltip,P.some(i),t.providers)),Zz.parts().arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:Pm("icon-chevron-down",t.providers.icons,U(""))}})]})},cS=function(i,a){return Ir(jz,function(t,e){var n,o=i.get(t),r=(n=o,{hide:function(){return br(n,He())},getValue:function(){return Kd.getValue(n)}});a.onAction(r,e.event().buttonApi())})},sS=function(t,e,n){var o,r,i,a,u,c,s,l,f,d,m,h,g={backstage:{shared:{providers:n}}};return"contextformtogglebutton"===e.type?(s=t,f=g,(d=(l=e).original).primary,m=Gn(d,["primary"]),h=Po(Bz(Wn({},m,{type:"togglebutton",onAction:function(){}}))),aS(h,f.backstage.shared.providers,[cS(s,l)])):(o=t,i=g,(a=(r=e).original).primary,u=Gn(a,["primary"]),c=Po(Hz(Wn({},u,{type:"button",onAction:function(){}}))),iS(c,i.backstage.shared.providers,[cS(o,r)]))},lS=function(t,e){var n,o,r,i,a=jn("context-form-field"),u=t.label.map(function(t){return{dom:{tag:"label",classes:["tox-toolbar-label"],attributes:{"for":a},innerHtml:e.translate(t)}}}),c=t.label.fold(function(){return{}},function(t){return{id:a}}),s=Rm(dp.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:t.initValue(),inputAttributes:c,selectOnFocus:!0,inputBehaviours:Ea([Td.config({mode:"special",onEnter:function(t){return l.findPrimary(t).map(function(t){return xr(t),!0})},onLeft:function(t,e){return e.cut(),P.none()},onRight:function(t,e){return e.cut(),P.none()}})])})),l=(n=s,o=t.commands,r=e,i=E(o,function(t){return Rm(sS(n,t,r))}),{asSpecs:function(){return E(i,function(t){return t.asSpec()})},findPrimary:function(n){return Mt(o,function(t,e){return t.primary?P.from(i[e]).bind(function(t){return t.getOpt(n)}).filter(m(Gh.isDisabled)):P.none()})}});return Cz({uid:jn("context-toolbar"),initGroups:[{items:u.toArray().concat([s.asSpec()])},{items:l.asSpecs()}],onEscape:P.none,cyclicKeying:!0})},fS=jn("forward-slide"),dS=jn("backward-slide"),mS=jn("change-slide-event"),hS="tox-pop--resizing",gS=function(e,t){return Mt(t,function(t){return t.predicate(e.dom())?P.some({toolbarApi:t,elem:e}):P.none()})},vS=function(e,n){var t=function(t){return t.dom()===n.getBody()},o=Ne.fromDom(n.selection.getNode());return gS(o,e.inNodeScope).orThunk(function(){return gS(o,e.inEditorScope).orThunk(function(){return function(t,e,n){for(var o=t.dom(),r=z(n)?n:U(!1);o.parentNode;){o=o.parentNode;var i=Ne.fromDom(o),a=e(i);if(a.isSome())return a;if(r(i))break}return P.none()}(o,function(t){return gS(t,e.inNodeScope)},t)})})},pS=function(n,r){var t={},i=[],a=[],u={},c={},o=function(e,n){var o=Po(No("ContextForm",Nz,n));(t[e]=o).launch.map(function(t){u["form:"+e]=Wn({},n.launch,{type:"contextformtogglebutton"===t.type?"togglebutton":"button",onAction:function(){r(o)}})}),"editor"===o.scope?a.push(o):i.push(o),c[e]=o},s=function(e,n){var t;(t=n,No("ContextToolbar",Pz,t)).each(function(t){"editor"===n.scope?a.push(t):i.push(t),c[e]=t})},e=Q(n);return T(e,function(t){var e=n[t];"contextform"===e.type?o(t,e):"contexttoolbar"===e.type&&s(t,e)}),{forms:t,inNodeScope:i,inEditorScope:a,lookupTable:c,formNavigators:u}},bS=jn("update-menu-text"),yS=function(t,e,o){var r=t.text.map(function(t){return Rm(Tw(t,e,o.providers))}),n=function(t,e){var n=Kd.getValue(t);return tm.focus(n),yr(n,"keydown",{raw:e.event().raw()}),P.some(!0)};return Rm(Qp.sketch({role:t.role,dom:{tag:"button",classes:[e,e+"--select"].concat(E(t.classes,function(t){return e+"--"+t}))},components:eg([t.icon.map(function(t){return Ew(t,o.providers.icons)}),r.map(function(t){return t.asSpec()}),P.some({dom:{tag:"div",classes:[e+"__select-chevron"],innerHtml:Nm("icon-chevron-down",o.providers.icons)}})]),matchWidth:!0,useMinWidth:!0,dropdownBehaviours:Ea([Zp.config({}),Fd.config({}),ym("menubutton-update-display-text",[Yr(t.onAttach),qr(t.onDetach),Ir(bS,function(e,n){r.bind(function(t){return t.getOpt(e)}).each(function(t){Fd.set(t,[ea(o.providers.translate(n.event().text()))])})})])]),eventOrder:gt(Uz,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:Ea([Td.config({mode:"special",onLeft:n,onRight:n})]),lazySink:o.getSink,toggleClass:e+"--active",parts:{menu:xg(0,t.columns,t.presets)},fetch:function(){return Fv.nu(t.fetch)}})).asSpec()},xS=function(t,e,n,o){var i,a,r,u,c,s="basic"===n.type?function(){return E(n.data,function(t){return Nk(t,o.isSelectedFor,o.getPreviewFor)})}:n.getData;return{items:(i=e,a=o,r=function(e,n,o){var r=i.shared.providers.translate(e.title);return"separator"===e.type?{type:"separator",text:r}:"submenu"===e.type?{type:"menuitem",text:r,disabled:o,getSubmenuItems:function(){return j(e.getStyleItems(),function(t){return u(t,n)})}}:e.getStylePreview().fold(function(){return{type:"togglemenuitem",text:r,active:e.isSelected(),disabled:o,onAction:a.onAction(e)}},function(t){return{type:"styleitem",item:{type:"togglemenuitem",text:r,disabled:o,active:e.isSelected(),onAction:a.onAction(e),meta:t}}})},u=function(t,e){var n="formatter"===t.type&&a.isInvalid(t);return 0===e?n?[]:[r(t,e,!1)]:[r(t,e,n)]},c=function(t){var e=a.shouldHide?0:1;return j(t,function(t){return u(t,e)})},{validateItems:c,getFetch:function(o,r){return function(t){var e=r(),n=c(e);t(fp(n,Zh.CLOSE_ON_EXECUTE,o.shared.providers))}}}),getStyleItems:s}},wS=function(n,t,e,o){var r=xS(0,t,e,o),i=r.items,a=r.getStyleItems;return yS({text:P.some(""),icon:P.none(),role:"button",fetch:i.getFetch(t,a),onAttach:o.nodeChangeHandler.map(function(e){return function(t){return n.on("nodeChange",e(t))}}).getOr(function(){}),onDetach:o.nodeChangeHandler.map(function(e){return function(t){return n.off("nodeChange",e(t))}}).getOr(function(){}),columns:1,presets:"normal",classes:["bespoke"]},"tox-tbtn",t.shared)};(ck=uk||(uk={}))[ck.SemiColon=0]="SemiColon",ck[ck.Space=1]="Space";var kS,zS,SS=function(t,e,n,o){var r,i,a=xt(t.settings,e).getOr(n);return{type:"basic",data:(i=a,r=o===uk.SemiColon?i.replace(/;$/,"").split(";"):i.split(" "),E(r,function(t){var e=t,n=t,o=t.split("=");return 1<o.length&&(e=o[0],n=o[1]),{title:e,format:n}}))}},CS=[{title:"Left",icon:"align-left",format:"alignleft"},{title:"Center",icon:"align-center",format:"aligncenter"},{title:"Right",icon:"align-right",format:"alignright"},{title:"Justify",icon:"align-justify",format:"alignjustify"}],OS=function(n,o){var t=P.some(function(e){return function(){var t=_(CS,function(t){return n.formatter.match(t.format)}).fold(function(){return"Align"},function(t){return t.title});yr(e,bS,{text:o.shared.providers.translate(t)})}}),e={type:"basic",data:CS};return wS(n,o,e,{isSelectedFor:function(t){return function(){return n.formatter.match(t)}},getPreviewFor:function(t){return function(){return P.none()}},onAction:function(t){return function(){n.undoManager.transact(function(){n.focus(),n.formatter.match(t.format)?n.formatter.remove(t.format):n.formatter.apply(t.format)})}},nodeChangeHandler:t,shouldHide:!1,isInvalid:function(t){return!n.formatter.canApply(t.format)}})},MS=function(r){var o=function(){var n=function(t){return t?t.split(",")[0]:""},t=r.queryCommandValue("FontName"),e=i.data,o=t?t.toLowerCase():"";return _(e,function(t){var e=t.format;return e.toLowerCase()===o||n(e).toLowerCase()===n(o).toLowerCase()})},t=P.some(function(n){return function(){var t=r.queryCommandValue("FontName"),e=o().fold(function(){return t},function(t){return t.title});yr(n,bS,{text:e})}}),i=SS(r,"font_formats","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",uk.SemiColon);return{isSelectedFor:function(e){return function(){return o().exists(function(t){return t.format===e})}},getPreviewFor:function(t){return function(){return P.some({tag:"div",styleAttr:-1===t.indexOf("dings")?"font-family:"+t:""})}},onAction:function(t){return function(){r.undoManager.transact(function(){r.focus(),r.execCommand("FontName",!1,t.format)})}},nodeChangeHandler:t,dataset:i,shouldHide:!1,isInvalid:function(){return!1}}},HS=function(t,e){return/[0-9.]+px$/.test(t)?(n=72*parseInt(t,10)/96,o=e||0,r=Math.pow(10,o),Math.round(n*r)/r+"pt"):t;var n,o,r},VS=function(i){var a=function(){var n=P.none(),o=u.data,r=i.queryCommandValue("FontSize");if(r)for(var t=function(t){var e=HS(r,t);n=_(o,function(t){return t.format===r||t.format===e})},e=3;n.isNone()&&0<=e;e--)t(e);return{matchOpt:n,px:r}},t=P.some(function(r){return function(){var t=a(),e=t.matchOpt,n=t.px,o=e.fold(function(){return n},function(t){return t.title});yr(r,bS,{text:o})}}),u=SS(i,"fontsize_formats","8pt 10pt 12pt 14pt 18pt 24pt 36pt",uk.Space);return{isSelectedFor:function(e){return function(){return a().matchOpt.exists(function(t){return t.format===e})}},getPreviewFor:function(){return function(){return P.none()}},onAction:function(t){return function(){i.undoManager.transact(function(){i.focus(),i.execCommand("FontSize",!1,t.format)})}},nodeChangeHandler:t,dataset:u,shouldHide:!1,isInvalid:function(){return!1}}},ES=function(n,t,e){var o=e.parents,r=t();return Mt(o,function(e){return _(r,function(t){return n.formatter.matchNode(e,t.format)})}).orThunk(function(){return n.formatter.match("p")?P.some({title:"Paragraph",format:"p"}):P.none()})},TS=function(o){var t=P.some(function(n){return function(t){var e=ES(o,function(){return r.data},t).fold(function(){return"Paragraph"},function(t){return t.title});yr(n,bS,{text:e})}}),r=SS(o,"block_formats","Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre",uk.SemiColon);return{isSelectedFor:function(t){return function(){return o.formatter.match(t)}},getPreviewFor:function(e){return function(){var t=o.formatter.get(e);return P.some({tag:0<t.length&&(t[0].inline||t[0].block)||"div",styleAttr:o.formatter.getCssText(e)})}},onAction:function(t){return function(){o.undoManager.transact(function(){o.focus(),o.formatter.match(t.format)?o.formatter.remove(t.format):o.formatter.apply(t.format)})}},nodeChangeHandler:t,dataset:r,shouldHide:!1,isInvalid:function(t){return!o.formatter.canApply(t.format)}}},AS=function(i){return{isSelectedFor:function(t){return function(){return i.formatter.match(t)}},getPreviewFor:function(e){return function(){var t=i.formatter.get(e);return t!==undefined?P.some({tag:0<t.length&&(t[0].inline||t[0].block)||"div",styleAttr:i.formatter.getCssText(e)}):P.none()}},onAction:function(t){return function(){i.undoManager.transact(function(){i.focus(),i.formatter.match(t.format)?i.formatter.remove(t.format):i.formatter.apply(t.format)})}},nodeChangeHandler:P.some(function(n){var o=function(t){var e=t.items;return e!==undefined&&0<e.length?j(e,o):[{title:t.title,format:t.format}]},r=j(Ik(i),o);return function(t){var e=ES(i,function(){return r},t).fold(function(){return"Paragraph"},function(t){return t.title});yr(n,bS,{text:e})}}),shouldHide:i.getParam("style_formats_autohide",!1,"boolean"),isInvalid:function(t){return!i.formatter.canApply(t.format)}}},BS={file:{title:"File",items:"newdocument restoredraft | preview | print"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall"},view:{title:"View",items:"code | visualaid visualchars visualblocks | spellchecker | preview fullscreen"},insert:{title:"Insert",items:"image link media 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 | removeformat"},tools:{title:"Tools",items:"spellchecker spellcheckerlanguage | a11ycheck code"},table:{title:"Table",items:"inserttable tableprops deletetable row column cell"},help:{title:"Help",items:"help"}},DS=function(t,e,n,o){return yS({text:t.text,icon:t.icon,role:o,fetch:function(e){t.fetch(function(t){e(fp(t,Zh.CLOSE_ON_EXECUTE,n.providers))})},onAttach:function(){},onDetach:function(){},columns:1,presets:"normal",classes:[]},e,n)},_S={formats:function(t,e){var n=e.styleselect,o=xS(0,e,n,AS(t));return{type:"menuitem",text:"Formats",getSubmenuItems:function(){return o.items.validateItems(o.getStyleItems())}}},blockformats:function(t,e){var n=TS(t),o=xS(0,e,n.dataset,n);return{type:"menuitem",text:"Blocks",getSubmenuItems:function(){return o.items.validateItems(o.getStyleItems())}}},fontformats:function(t,e){var n=MS(t),o=xS(0,e,n.dataset,n);return{type:"menuitem",text:e.shared.providers.translate("Fonts"),getSubmenuItems:function(){return o.items.validateItems(o.getStyleItems())}}},fontsizes:function(t,e){var n=VS(t),o=xS(0,e,n.dataset,n);return{type:"menuitem",text:"Font Sizes",getSubmenuItems:function(){return o.items.validateItems(o.getStyleItems())}}}},FS=function(t){return"string"==typeof t?t.split(" "):t},RS=function(c,s,l){var f=vt(BS,s.menus),e=0<Q(s.menus).length,t=s.menubar===undefined||!0===s.menubar?FS("file edit view insert format tools table help"):FS(!1===s.menubar?"":s.menubar),n=A(t,function(t){return e&&s.menus.hasOwnProperty(t)&&s.menus[t].hasOwnProperty("items")||BS.hasOwnProperty(t)}),o=E(n,function(t){var e,n,o,r,i,a,u=f[t];return e={title:u.title,items:FS(u.items)},n=s,r=l,a=(i=o=c,i.getParam("removed_menuitems","")).split(/[ ,]/),{text:e.title,getItems:function(){return j(e.items,function(e){return 0===e.trim().length?[]:H(a,function(t){return t===e})?[]:"separator"===e||"|"===e?[{type:"separator"}]:n.menuItems[e]?[n.menuItems[e]]:_S[e]?[_S[e](o,r)]:[]})}}});return A(o,function(t){return 0<t.getItems().length})},LS=function(o,r){return function(t,e){var n=o(t).fold(g(ft.error,Uo),ft.value).getOrDie();return r(n,e)}},IS={button:LS(Hz,function(t,e){return n=t,o=e.backstage.shared.providers,iS(n,o,[]);var n,o}),togglebutton:LS(Bz,function(t,e){return n=t,o=e.backstage.shared.providers,aS(n,o,[]);var n,o}),menubutton:LS(function(t){return No("menubutton",Vz,t)},function(t,e){return DS(t,"tox-tbtn",e.backstage.shared,"button")}),splitbutton:LS(function(t){return No("SplitButton",Ez,t)},function(t,e){return uS(t,e.backstage.shared)}),styleSelectButton:function(t,e){return n=t,o=e.backstage,r=o.styleselect,wS(n,o,r,AS(n));var n,o,r},fontsizeSelectButton:function(t,e){return n=t,o=e.backstage,r=VS(n),wS(n,o,r.dataset,r);var n,o,r},fontSelectButton:function(t,e){return n=t,o=e.backstage,r=MS(n),wS(n,o,r.dataset,r);var n,o,r},formatButton:function(t,e){return n=t,o=e.backstage,r=TS(n),wS(n,o,r.dataset,r);var n,o,r},alignMenuButton:function(t,e){return OS(t,e.backstage)}},NS={styleselect:IS.styleSelectButton,fontsizeselect:IS.fontsizeSelectButton,fontselect:IS.fontSelectButton,formatselect:IS.formatButton,align:IS.alignMenuButton},PS=function(e,n,o){var t,r,i=(t=n,(C((r=function(){return!1===t.toolbar?"":t.toolbar===undefined||!0===t.toolbar?"undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image":t.toolbar})())?r():[r()]).join(" | ")).split("|"),a=E(i,function(t){return t.trim().split(" ")}),u=E(a,function(t){return j(t,function(t){return 0===t.trim().length?[]:xt(n.buttons,t.toLowerCase()).fold(function(){return xt(NS,t.toLowerCase()).map(function(t){return t(e,o)}).orThunk(function(){return console.error("No representation for toolbarItem: "+t),P.none()})},function(t){return n=o,xt(IS,(e=t).type).fold(function(){return console.error("skipping button defined by",e),P.none()},function(t){return P.some(t(e,n))});var e,n}).toArray()})});return A(u,function(t){return 0<t.length})},jS=function(i,t,a,c){var n,o,s=ra((n={sink:a,onEscape:function(){return i.focus(),P.some(!0)}},o=Ct([]),Dm.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:function(t){o.set([]),Dm.getContent(t).each(function(t){Gi(t.element(),"visibility")}),Ai(t.element(),hS),Gi(t.element(),"width")},inlineBehaviours:Ea([ym("context-toolbar-events",[Xr(Ut(),function(t,e){Dm.getContent(t).each(function(t){}),Ai(t.element(),hS),Gi(t.element(),"width")}),Ir(mS,function(e,n){Gi(e.element(),"width");var t=qa(e.element());Dm.setContent(e,n.event().contents()),Ti(e.element(),hS);var o=qa(e.element());Ni(e.element(),"width",t+"px"),Dm.getContent(e).each(function(t){n.event().focus().bind(function(t){return tf(t),nf(e.element())}).orThunk(function(){return Td.focusIn(t),ef()})}),setTimeout(function(){Ni(e.element(),"width",o+"px")},0)}),Ir(fS,function(t,e){Dm.getContent(t).each(function(t){o.set(o.get().concat([{bar:t,focus:ef()}]))}),yr(t,mS,{contents:e.event().forwardContents(),focus:P.none()})}),Ir(dS,function(e,t){J(o.get()).each(function(t){o.set(o.get().slice(0,o.get().length-1)),yr(e,mS,{contents:ia(t.bar),focus:t.focus})})})]),Td.config({mode:"special",onEscape:function(e){return J(o.get()).fold(function(){return n.onEscape()},function(t){return br(e,dS),P.some(!0)})}})]),lazySink:function(){return ft.value(n.sink)}}))),l=function(){return P.some(Ne.fromDom(i.contentAreaContainer))};i.on("init",function(){var t=i.getBody().ownerDocument.defaultView;Ig(Ne.fromDom(t),"scroll",function(){f.get().each(function(t){var e=d.get().getOr(i.selection.getNode()).getBoundingClientRect(),n=i.contentAreaContainer.getBoundingClientRect(),o=e.bottom<0,r=e.top>n.height;o||r?Ni(s.element(),"display","none"):(Gi(s.element(),"display"),Qc.positionWithin(a,t,s,l()))})})});var f=Ct(P.none()),d=Ct(P.none()),r=Ct(null),m=function(t){return{dom:{tag:"div",classes:["tox-pop__dialog"]},components:[t],behaviours:Ea([Td.config({mode:"acyclic"}),ym("pop-dialog-wrap-events",[Yr(function(t){i.shortcuts.add("ctrl+F9","focus statusbar",function(){return Td.focusIn(t)})}),qr(function(t){i.shortcuts.remove("ctrl+F9")})])])}},u=Xt(function(){return pS(t,function(t){var e=h(t);yr(s,fS,{forwardContents:m(e)})})}),h=function(t){var e,n,o=i.ui.registry.getAll().buttons,r=u();return"contexttoolbar"===t.type?(e=vt(o,r.formNavigators),n=PS(i,{buttons:e,toolbar:t.items},c),Cz({uid:jn("context-toolbar"),initGroups:E(n,function(t){return{items:t}}),onEscape:P.none,cyclicKeying:!0})):lS(t,c.backstage.shared.providers)};i.on("contexttoolbar-show",function(e){var t=u();xt(t.lookupTable,e.toolbarKey).each(function(t){b(t,e.target===i?P.none():P.some(e)),Dm.getContent(s).each(Td.focusIn)})});var e={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"]},g={maxHeightFunction:Eu()},v={bubble:_u(12,0,e),layouts:{onLtr:function(){return[Ju]},onRtl:function(){return[$u]}},overrides:g},p={bubble:_u(0,12,e),layouts:{onLtr:function(){return[qu,Ku,Xu,Wu,Yu,Gu]},onRtl:function(){return[qu,Ku,Yu,Gu,Xu,Wu]}},overrides:g},b=function(t,e){x();var n,o,r,i=h(t),a=e.map(Ne.fromDom),u=(n=t.position,o=a,r="node"===n?c.backstage.shared.anchors.node(o):c.backstage.shared.anchors.cursor(),gt(r,"line"===n?v:p));f.set(P.some(u)),d.set(e),Dm.showWithin(s,u,m(i),l()),Gi(s.element(),"display")},y=function(){var t=u();vS(t,i).fold(function(){f.set(P.none()),Dm.hide(s)},function(t){b(t.toolbarApi,P.some(t.elem.dom()))})},x=function(){var t=r.get();null!==t&&(clearTimeout(t),r.set(null))};i.on("click keyup setContent ObjectResized nodeChange ResizeEditor",function(t){var e;e=pz.setEditorTimeout(i,y,0),x(),r.set(e)})},US=function(t,n,o){var e=Ig(Ne.fromDom(document),"mousedown",function(e){T([n,o],function(t){t.broadcastOn([bs()],{target:e.target()})})}),r=Ig(Ne.fromDom(document),"touchstart",function(e){T([n,o],function(t){t.broadcastOn([bs()],{target:e.target()})})}),i=Ig(Ne.fromDom(document),"mouseup",function(e){0===e.raw().button&&T([n,o],function(t){t.broadcastOn([ys()],{target:e.target()})})}),a=function(e){T([n,o],function(t){t.broadcastOn([bs()],{target:Ne.fromDom(e.target)})})};t.on("mousedown",a),t.on("touchstart",a);var u=function(e){0===e.button&&T([n,o],function(t){t.broadcastOn([ys()],{target:Ne.fromDom(e.target)})})};t.on("mouseup",u);var c=Ig(Ne.fromDom(window),"scroll",function(e){T([n,o],function(t){t.broadcastEvent(Te(),e)})});t.on("remove",function(){t.off("mousedown",a),t.off("touchstart",a),t.off("mouseup",u),cs(n),cs(o),n.destroy(),o.destroy(),e.unbind(),r.unbind(),i.unbind(),c.unbind()})},WS=yl,GS=nl,XS=Cl({factory:function(o,t){var e={focus:Td.focusIn,setMenus:function(t,e){var n=E(e,function(e){var t={text:P.some(e.text),icon:P.none(),fetch:function(t){t(e.getItems())}};return DS(t,"tox-mbtn",{getSink:o.getSink,providers:o.providers},"menuitem")});Fd.set(t,n)}};return{uid:o.uid,dom:o.dom,components:[],behaviours:Ea([Fd.config({}),ym("menubar-events",[Yr(function(t){o.onSetup(t)}),Ir(_t(),function(n,t){ua(n.element(),".tox-mbtn--active").each(function(e){ca(t.event().target(),".tox-mbtn").each(function(t){en(e,t)||n.getSystem().getByDom(e).each(function(e){n.getSystem().getByDom(t).each(function(t){Qp.expand(t),Qp.close(e),tm.focus(t)})})})})}),Ir(_e(),function(n,t){t.event().prevFocus().bind(function(t){return n.getSystem().getByDom(t).toOption()}).each(function(e){t.event().newFocus().bind(function(t){return n.getSystem().getByDom(t).toOption()}).each(function(t){Qp.isOpen(e)&&(Qp.expand(t),Qp.close(e))})})})]),Td.config({mode:"flow",selector:".tox-mbtn",onEscape:function(t){return o.onEscape(t),P.some(!0)}}),Vp.config({})]),apis:e,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[$o("dom"),$o("uid"),$o("onEscape"),$o("getSink"),$o("providers"),cr("onSetup",N)],apis:{focus:function(t,e){t.focus(e)},setMenus:function(t,e,n){t.setMenus(e,n)}}}),YS=function(e,t){return t.getAnimationRoot.fold(function(){return e.element()},function(t){return t(e)})},qS=function(t){return t.dimension.property},KS=function(t,e){return t.dimension.getDimension(e)},JS=function(t,e){var n=YS(t,e);Fi(n,[e.shrinkingClass,e.growingClass])},$S=function(t,e){Ai(t.element(),e.openClass),Ti(t.element(),e.closedClass),Ni(t.element(),qS(e),"0px"),Xi(t.element())},QS=function(t,e){Ai(t.element(),e.closedClass),Ti(t.element(),e.openClass),Gi(t.element(),qS(e))},ZS=function(t,e,n,o){n.setCollapsed(),Ni(t.element(),qS(e),KS(e,t.element())),Xi(t.element()),JS(t,e),$S(t,e),e.onStartShrink(t),e.onShrunk(t)},tC=function(t,e,n,o){var r=o.getOrThunk(function(){return KS(e,t.element())});n.setCollapsed(),Ni(t.element(),qS(e),r),Xi(t.element());var i=YS(t,e);Ti(i,e.shrinkingClass),$S(t,e),e.onStartShrink(t)},eC=function(t,e,n){var o=KS(e,t.element());("0px"===o?ZS:tC)(t,e,n,P.some(o))},nC=function(t,e,n){QS(t,e);var o=KS(e,t.element());$S(t,e);var r=YS(t,e);Ti(r,e.growingClass),QS(t,e),Ni(t.element(),qS(e),o),n.setExpanded(),e.onStartGrow(t)},oC=function(t,e,n){var o=YS(t,e);return!0===Di(o,e.growingClass)},rC=function(t,e,n){var o=YS(t,e);return!0===Di(o,e.shrinkingClass)},iC=Object.freeze({grow:function(t,e,n){n.isExpanded()||nC(t,e,n)},shrink:function(t,e,n){n.isExpanded()&&eC(t,e,n)},immediateShrink:function(t,e,n){n.isExpanded()&&ZS(t,e,n,P.none())},hasGrown:function(t,e,n){return n.isExpanded()},hasShrunk:function(t,e,n){return n.isCollapsed()},isGrowing:oC,isShrinking:rC,isTransitioning:function(t,e,n){return!0===oC(t,e)||!0===rC(t,e)},toggleGrow:function(t,e,n){(n.isExpanded()?eC:nC)(t,e,n)},disableTransitions:JS}),aC=Object.freeze({exhibit:function(t,e){var n=e.expanded;return pi(n?{classes:[e.openClass],styles:{}}:{classes:[e.closedClass],styles:wt(e.dimension.property,"0px")})},events:function(n,o){return Fr([Xr(Ut(),function(t,e){e.event().raw().propertyName===n.dimension.property&&(JS(t,n),o.isExpanded()&&Gi(t.element(),n.dimension.property),(o.isExpanded()?n.onGrown:n.onShrunk)(t))})])}}),uC=[$o("closedClass"),$o("openClass"),$o("shrinkingClass"),$o("growingClass"),rr("getAnimationRoot"),ba("onShrunk"),ba("onStartShrink"),ba("onGrown"),ba("onStartGrow"),cr("expanded",!1),Qo("dimension",Wo("property",{width:[ka("property","width"),ka("getDimension",function(t){return qa(t)+"px"})],height:[ka("property","height"),ka("getDimension",function(t){return $a(t)+"px"})]}))],cC=Aa({fields:uC,name:"sliding",active:aC,apis:iC,state:Object.freeze({init:function(t){var e=Ct(t.expanded);return gi({isExpanded:function(){return!0===e.get()},isCollapsed:function(){return!1===e.get()},setCollapsed:f(e.set,!1),setExpanded:f(e.set,!0),readState:function(){return"expanded: "+e.get()}})}})}),sC="container",lC=[zs("slotBehaviours",[])],fC=function(t){return"<alloy.field."+t+">"},dC=function(r,t,e){var n,o=function(t){return gl(r)},i=function(n,o){return void 0===o&&(o=undefined),function(t,e){return fl(t,r,e).map(function(t){return n(t,e)}).getOr(o)}},a=function(t,e){return"true"!==On(t.element(),"aria-hidden")},u=i(a,!1),c=i(function(t,e){if(a(t)){var n=t.element();Ni(n,"display","none"),Sn(n,"aria-hidden","true"),yr(t,Fe(),{name:e,visible:!1})}}),s=(n=c,function(e,t){T(t,function(t){return n(e,t)})}),l=i(function(t,e){if(!a(t)){var n=t.element();Gi(n,"display"),Hn(n,"aria-hidden"),yr(t,Fe(),{name:e,visible:!0})}}),f={getSlotNames:o,getSlot:function(t,e){return fl(t,r,e)},isShowing:u,hideSlot:c,hideAllSlots:function(t){return s(t,o())},showSlot:l};return{uid:r.uid,dom:r.dom,components:t,behaviours:Ss(r.slotBehaviours),apis:f}},mC=et({getSlotNames:function(t,e){return t.getSlotNames(e)},getSlot:function(t,e,n){return t.getSlot(e,n)},isShowing:function(t,e,n){return t.isShowing(e,n)},hideSlot:function(t,e,n){return t.hideSlot(e,n)},hideAllSlots:function(t,e){return t.hideAllSlots(e)},showSlot:function(t,e,n){return t.showSlot(e,n)}},mi),hC=Wn({},mC,{sketch:function(t){var n,e=(n=[],{slot:function(t,e){return n.push(t),al(sC,fC(t),e)},record:function(){return n}}),o=t(e),r=e.record(),i=E(r,function(t){return $s({name:t,pname:fC(t)})});return wl(sC,lC,i,dC,o)}}),gC=function(t){return{element:function(){return t.element().dom()}}},vC=function(e){return hC.sketch(function(t){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:(o=t,i=e,E(i,function(t){var e=t.name,n=t.settings;return o.slot(e,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:hh([Yr(function(t){n.onrender&&n.onrender(gC(t))}),Ir(Fe(),function(o,t){var r=t.event();_(i,function(t){return t.name===r.name()}).each(function(t){var e=t.settings,n=r.visible()?e.onshow:e.onhide;n&&n(gC(o))})})])})})),slotBehaviours:hh([Yr(function(t){return hC.hideAllSlots(t)})])};var o,i})},pC=jn("FixSizeEvent"),bC=jn("AutoSizeEvent"),yC={setSidebar:function(t,e){El.getCurrent(t).each(function(t){return Fd.set(t,[vC(e)])})},toggleSidebar:function(t,n){El.getCurrent(t).each(function(e){El.getCurrent(e).each(function(t){cC.hasGrown(e)?hC.isShowing(t,n)?cC.shrink(e):(hC.hideAllSlots(t),hC.showSlot(t,n)):(hC.hideAllSlots(t),hC.showSlot(t,n),cC.grow(e))})})},whichSidebar:function(t){return El.getCurrent(t).bind(function(t){return cC.isGrowing(t)||cC.hasGrown(t)?El.getCurrent(t).bind(function(e){return _(hC.getSlotNames(e),function(t){return hC.isShowing(e,t)})}):P.none()})},renderSidebar:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-sidebar"]},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:Ea([Vp.config({}),tm.config({}),cC.config({dimension:{property:"width"},closedClass:"tox-sidebar--sliding-closed",openClass:"tox-sidebar--sliding-open",shrinkingClass:"tox-sidebar--sliding-shrinking",growingClass:"tox-sidebar--sliding-growing",onShrunk:function(t){El.getCurrent(t).each(hC.hideAllSlots),br(t,bC)},onGrown:function(t){br(t,bC)},onStartGrow:function(t){yr(t,pC,{width:Wi(t.element(),"width").getOr("")})},onStartShrink:function(t){yr(t,pC,{width:qa(t.element())+"px"})}}),Fd.config({}),El.config({find:function(t){var e=Fd.contents(t);return K(e)}})])}],behaviours:Ea([kx(0),ym("sidebar-sliding-events",[Ir(pC,function(t,e){Ni(t.element(),"width",e.event().width())}),Ir(bC,function(t,e){Gi(t.element(),"width")})])])}}},xC=GS.optional({factory:XS,name:"menubar",schema:[$o("dom"),$o("getSink")]}),wC=GS.optional({factory:{sketch:function(t){return Cz({uid:t.uid,onEscape:function(){return t.onEscape(),P.some(!0)},cyclicKeying:!1,initGroups:[]})}},name:"toolbar",schema:[$o("dom"),$o("onEscape")]}),kC=GS.optional({name:"socket",schema:[$o("dom")]}),zC=GS.optional({factory:{sketch:yC.renderSidebar},name:"sidebar",schema:[$o("dom")]}),SC=Ol({name:"OuterContainer",factory:function(n,t,e){var o={getSocket:function(t){return WS.getPart(t,n,"socket")},setSidebar:function(t,e){WS.getPart(t,n,"sidebar").each(function(t){return yC.setSidebar(t,e)})},toggleSidebar:function(t,e){WS.getPart(t,n,"sidebar").each(function(t){return yC.toggleSidebar(t,e)})},whichSidebar:function(t){return WS.getPart(t,n,"sidebar").bind(yC.whichSidebar).getOrNull()},getToolbar:function(t){return WS.getPart(t,n,"toolbar")},setToolbar:function(t,e){WS.getPart(t,n,"toolbar").each(function(t){xz.setGroups(t,e)})},focusToolbar:function(t){WS.getPart(t,n,"toolbar").each(function(t){Td.focusIn(t)})},setMenubar:function(t,e){WS.getPart(t,n,"menubar").each(function(t){XS.setMenus(t,e)})},focusMenubar:function(t){WS.getPart(t,n,"menubar").each(function(t){XS.focus(t)})}};return{uid:n.uid,dom:n.dom,components:t,apis:o,behaviours:n.behaviours}},configFields:[$o("dom"),$o("behaviours")],partFields:[xC,wC,kC,zC],apis:{getSocket:function(t,e){return t.getSocket(e)},setSidebar:function(t,e,n){t.setSidebar(e,n)},toggleSidebar:function(t,e,n){t.toggleSidebar(e,n)},whichSidebar:function(t,e){return t.whichSidebar(e)},getToolbar:function(t,e){return t.getToolbar(e)},setToolbar:function(t,e,n){var o=E(n,function(t){return Sz({items:t})});t.setToolbar(e,o)},setMenubar:function(t,e,n){t.setMenubar(e,n)},focusMenubar:function(t,e){t.focusMenubar(e)},focusToolbar:function(t,e){t.focusToolbar(e)}}}),CC=function(t){return t.fire("SkinLoaded")},OC=function(t){return t.fire("ResizeEditor")},MC=function(t){var e=function(){t._skinLoaded=!0,CC(t)};return function(){t.initialized?e():t.on("init",e)}},HC=function(t,e){var n,o=function(t){var e=t.settings,n=e.skin,o=e.skin_url;if(!1!==n){var r=n||"oxide";o=o?t.documentBaseURI.toAbsolute(o):sv.baseURL+"/skins/"+r}return o}(e);o&&(n=o+"/skin.min.css",e.contentCSS.push(o+(t?"/content.inline":"/content")+".min.css")),0==(!1===e.settings.skin)&&n?cv.DOM.styleSheetLoader.load(n,MC(e)):MC(e)()},VC=f(HC,!1),EC=f(HC,!0),TC={render:function(n,o,t,e,r){var i,a;VC(n),i=Ne.fromDom(r.targetNode),a=o.mothership,us(i,a,ln),as(Cr(),o.uiMothership),n.on("init",function(){SC.setToolbar(o.outerContainer,PS(n,t,{backstage:e})),SC.setMenubar(o.outerContainer,RS(n,t,e)),SC.setSidebar(o.outerContainer,n.sidebars||[])});var u=SC.getSocket(o.outerContainer).getOrDie("Could not find expected socket element");return n.addCommand("ToggleSidebar",function(t,e){SC.toggleSidebar(o.outerContainer,e),n.fire("ToggleSidebar")}),n.addQueryValueHandler("ToggleSidebar",function(){return SC.whichSidebar(o.outerContainer)}),{iframeContainer:u.element().dom(),editorContainer:o.outerContainer.element().dom()}},getBehaviours:function(t){return[]}},AC=function(n,e){return an(n).orThunk(function(){var t=Ne.fromTag("span");sn(n,t);var e=an(t);return gn(t),e}).map(function(t){return Ua(t).translate(-e.left(),-e.top())}).getOrThunk(function(){return Pa(0,0)})},BC=dt([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),DC=function(e){return function(t){return t.translate(-e.left(),-e.top())}},_C=function(e){return function(t){return t.translate(e.left(),e.top())}},FC=function(n){return function(t,e){return D(n,function(t,e){return e(t)},Pa(t,e))}},RC=function(t,e,n){return t.fold(FC([_C(n),DC(e)]),FC([DC(e)]),FC([]))},LC=function(t,e,n){return t.fold(FC([_C(n)]),FC([]),FC([_C(e)]))},IC=function(t,e,n){return t.fold(FC([]),FC([DC(n)]),FC([_C(e),DC(n)]))},NC=function(t,e,n){return t.fold(function(t,e){return{position:"absolute",left:t+"px",top:e+"px"}},function(t,e){return{position:"absolute",left:t-n.left()+"px",top:e-n.top()+"px"}},function(t,e){return{position:"fixed",left:t+"px",top:e+"px"}})},PC=BC.offset,jC=BC.absolute,UC=BC.fixed,WC=function(t,e){Ti(t.element(),e.transitionClass),Ai(t.element(),e.fadeOutClass),Ti(t.element(),e.fadeInClass)},GC=function(t,e){Ti(t.element(),e.transitionClass),Ai(t.element(),e.fadeInClass),Ti(t.element(),e.fadeOutClass)},XC=function(t,e){return t.y()>=e.y()&&t.bottom()<=e.bottom()},YC=function(t,e){return Mn(t,e)?P.some(parseInt(On(t,e),10)):P.none()},qC=function(o,r,i){return(a=o,t=r,e=a.element(),YC(e,t.leftAttr).bind(function(o){return YC(e,t.topAttr).map(function(t){var e=qa(a.element()),n=$a(a.element());return du(o,t,e,n)})})).bind(function(t){return XC(t,i)?(e=r,n=o.element(),Hn(n,e.leftAttr),Hn(n,e.topAttr),P.some(jC(t.x(),t.y()))):P.none();var e,n});var a,t,e},KC=function(t,e,n,o,r){var i=Ua(t.element()),a=du(i.left(),i.top(),qa(t.element()),$a(t.element()));if(XC(a,n))return P.none();u=t,c=e,s=i.left(),l=i.top(),f=u.element(),Sn(f,c.leftAttr,s),Sn(f,c.topAttr,l);var u,c,s,l,f,d=jC(i.left(),i.top()),m=RC(d,o,r),h=jC(n.x(),n.y()),g=RC(h,o,r),v=a.y()<=n.y()?g.top():g.top()+n.height()-a.height();return P.some(UC(m.left(),v))},JC=function(i,t,e){var a=t.lazyViewport(i);t.contextual.each(function(r){r.lazyContext(i).each(function(t){var e,n,o=mu(t);n=a,((e=o).y()<n.bottom()&&e.bottom()>n.y()?WC:GC)(i,r)})});var n,o,r,u,c,s=nn(i.element()),l=Ga(s),f=AC(i.element(),l);(n=i,o=t,r=a,u=l,c=f,Wi(n.element(),"position").is("fixed")?qC(n,o,r):KC(n,o,r,u,c)).each(function(t){var e=NC(t,0,f);Pi(i.element(),e)})},$C=Object.freeze({refresh:JC}),QC=Object.freeze({events:function(o,t){return Fr([Ir(Ut(),function(e,n){o.contextual.each(function(t){en(e.element(),n.event().target())&&(Ai(e.element(),t.transitionClass),n.stop())})}),Ir(Te(),function(t,e){JC(t,o)})])}}),ZC=[ur("contextual",[$o("fadeInClass"),$o("fadeOutClass"),$o("transitionClass"),$o("lazyContext")]),cr("lazyViewport",function(t){var e=Ga();return du(e.left(),e.top(),window.innerWidth,window.innerHeight)}),$o("leftAttr"),$o("topAttr")],tO=Aa({fields:ZC,name:"docking",active:QC,apis:$C}),eO={render:function(t,e,n,o,r){var i,a=cv.DOM;EC(t);var u=function(){Pi(i.element(),{position:"absolute",top:Ua(Ne.fromDom(t.getBody())).top()-$a(i.element())+"px",left:Ua(Ne.fromDom(t.getBody())).left()+"px"})},c=function(){Ni(e.outerContainer.element(),"display","flex"),a.addClass(t.getBody(),"mce-edit-focus"),u(),tO.refresh(i)},s=function(){e.outerContainer&&(Ni(e.outerContainer.element(),"display","none"),a.removeClass(t.getBody(),"mce-edit-focus"))};return t.on("focus",function(){i?c():(i=e.outerContainer,as(Cr(),e.mothership),as(Cr(),e.uiMothership),SC.setToolbar(e.outerContainer,PS(t,n,{backstage:o})),SC.setMenubar(e.outerContainer,RS(t,n,o)),u(),c(),t.on("nodeChange ResizeWindow",u),t.on("activate",c),t.on("deactivate",s),t.nodeChanged())}),t.on("blur hide",s),{editorContainer:e.outerContainer.element().dom()}},getBehaviours:function(e){return[tO.config({leftAttr:"data-dock-left",topAttr:"data-dock-top",contextual:{lazyContext:function(t){return P.from(e).map(function(t){return Ne.fromDom(t.getBody())})},fadeInClass:"tox-toolbar-dock-fadein",fadeOutClass:"tox-toolbar-dock-fadeout",transitionClass:"tox-toolbar-dock-transition"}}),tm.config({})]}},nO=function(t,e){return{anchor:"makeshift",x:t,y:e}},oO=function(t,e){var n,o,r,i=cv.DOM.getPos(t);return n=e,o=i.x,r=i.y,nO(n.x+o,n.y+r)},rO=function(t,e){return"contextmenu"===e.type?t.inline?nO((o=e).pageX,o.pageY):oO(t.getContentAreaContainer(),nO((n=e).clientX,n.clientY)):iO(t);var n,o},iO=function(t){return{anchor:"selection",root:Ne.fromDom(t.selection.getNode())}},aO=function(t){return t.settings.contextmenu_never_use_native||!1},uO=function(t){var e,n=t.getParam("contextmenu","link image imagetools table spellchecker");return"string"==typeof(e=n)?e.split(/[ ,]/):e},cO={type:"separator"},sO=function(t){switch(t.type){case"separator":return cO;case"submenu":return{type:"menuitem",text:t.text,icon:t.icon,getSubmenuItems:function(){return E(t.getSubmenuItems(),sO)}};default:return{type:"menuitem",text:t.text,icon:t.icon,onAction:(n=t.onAction,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n()})}}var n},lO=function(l,t,f){var d=ra(Dm.sketch({dom:{tag:"div"},lazySink:t}));l.on("contextmenu",function(t){if(e=l,!t.ctrlKey||aO(e)){var e,n,o=2!==t.button||t.target===l.getBody(),r=o?(n=l,{anchor:"node",node:P.some(Ne.fromDom(n.selection.getNode())),root:Ne.fromDom(n.getBody())}):rO(l,t),i=l.ui.registry.getAll(),a=uO(l),u=o?l.selection.getStart(!0):t.target,c=function s(r,n,t,i){var e=j(t,function(t){if(r.hasOwnProperty(t)){var e=r[t].update(i);if(0<e.length){var n=E(e,function(t){return x(t)?t:sO(t)}),o=["|"];return o.concat(n).concat(o)}return[]}return[t]}),o=D(e,function(t,e){return x(e)?n.hasOwnProperty(e)?t.concat([n[e]]):"|"===e&&0<t.length&&"separator"!==t[t.length-1].type?t.concat([cO]):t:t.concat([e])},[]);return 0<o.length&&"separator"===o[o.length-1].type&&o.pop(),o}(i.contextMenus,i.menuItems,a,u);0<c.length&&(t.preventDefault(),Dm.showMenuAt(d,r,{menu:{markers:bg("normal")},data:fp(c,Zh.CLOSE_ON_EXECUTE,f.providers)}))}})},fO=function(t){return/^[0-9\.]+(|px)$/i.test(""+t)?P.some(parseInt(t,10)):P.none()},dO=function(t){return S(t)?t+"px":t},mO="data-initial-z-index",hO=function(t,e){var n;t.getSystem().addToGui(e),rn((n=e).element()).each(function(e){Wi(e,"z-index").each(function(t){Sn(e,mO,t)}),Ni(e,"z-index",ji(n.element(),"z-index"))})},gO=function(t){rn(t.element()).each(function(t){var e=On(t,mO);Mn(t,mO)?Ni(t,"z-index",e):Gi(t,"z-index"),Hn(t,mO)}),t.getSystem().removeFromGui(t)},vO=function(t,e,n,o){return(r=t,i=e,a=r.element(),u=parseInt(On(a,i.leftAttr),10),c=parseInt(On(a,i.topAttr),10),isNaN(u)||isNaN(c)?P.none():P.some(Pa(u,c))).fold(function(){return n},function(t){return UC(t.left()+o.left(),t.top()+o.top())});var r,i,a,u,c},pO=function(t,e,n,o,r,i){var a,u,c,s=vO(t,e,n,o),l=yO(t,e,s,r,i),f=RC(s,r,i);return a=e,u=f,c=t.element(),Sn(c,a.leftAttr,u.left()+"px"),Sn(c,a.topAttr,u.top()+"px"),l.fold(function(){return{coord:UC(f.left(),f.top()),extra:P.none()}},function(t){return{coord:t.output(),extra:t.extra()}})},bO=function(t,e){var n,o;n=e,o=t.element(),Hn(o,n.leftAttr),Hn(o,n.topAttr)},yO=function(t,e,g,v,p){var n=e.getSnapPoints(t);return Mt(n,function(t){var e,n,o,r,i,a,u,c,s,l,f,d,m,h=t.sensor();return e=g,n=h,o=t.range().left(),r=t.range().top(),u=LC(e,i=v,a=p),c=LC(n,i,a),Math.abs(u.left()-c.left())<=o&&Math.abs(u.top()-c.top())<=r?P.some({output:U((s=t.output(),l=g,f=v,d=p,m=function(o,r){return function(t,e){var n=o(l,f,d);return r(t.getOr(n.left()),e.getOr(n.top()))}},s.fold(m(IC,BC.offset),m(LC,BC.absolute),m(RC,BC.fixed)))),extra:t.extra}):P.none()})},xO=function(n,t,i,a,u,c){return t.fold(function(){var t,n,o,e=(t=i,n=c.left(),o=c.top(),t.fold(function(t,e){return BC.offset(t+n,e+o)},function(t,e){return BC.absolute(t+n,e+o)},function(t,e){return BC.fixed(t+n,e+o)})),r=RC(e,a,u);return UC(r.left(),r.top())},function(e){var t=pO(n,e,i,c,a,u);return t.extra.each(function(t){e.onSensor(n,t)}),t.coord})},wO=function(t,e,n){var o,r=e.getTarget(t.element());if(e.repositionTarget){var i=nn(t.element()),a=Ga(i),u=AC(r,a),c=Wi(o=r,"left").bind(function(n){return Wi(o,"top").bind(function(e){return Wi(o,"position").map(function(t){return("fixed"===t?UC:PC)(parseInt(n,10),parseInt(e,10))})})}).getOrThunk(function(){var t=Ua(o);return jC(t.left(),t.top())}),s=xO(t,e.snaps,c,a,u,n),l=NC(s,0,u);Pi(r,l)}e.onDrag(t,r,n)},kO=ur("snaps",[$o("getSnapPoints"),ba("onSensor"),$o("leftAttr"),$o("topAttr"),cr("lazyViewport",function(){var t=Ga();return{x:t.left,y:t.top,width:U(window.innerWidth),height:U(window.innerHeight),bottom:U(t.top()+window.innerHeight),right:U(t.left()+window.innerWidth)}})]),zO=Object.freeze({getData:function(t){return P.from(Pa(t.x(),t.y()))},getDelta:function(t,e){return Pa(e.left()-t.left(),e.top()-t.top())}}),SO=[cr("useFixed",!1),$o("blockerClass"),cr("getTarget",d),cr("onDrag",N),cr("repositionTarget",!0),ba("onDrop"),kO,ka("dragger",{handlers:function(u,c){return Fr([Ir(Tt(),function(e,t){if(0===t.event().raw().button){t.stop();var n,o={drop:function(){i()},delayDrop:function(){a.schedule()},forceDrop:function(){i()},move:function(t){a.cancel(),c.update(zO,t).each(function(t){wO(e,u,t)})}},r=e.getSystem().build(av.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[u.blockerClass]},events:(n=o,Fr([Ir(Tt(),n.forceDrop),Ir(Dt(),n.drop),Ir(At(),function(t,e){n.move(e.event())}),Ir(Bt(),n.delayDrop)]))})),i=function(){gO(r),u.snaps.each(function(t){bO(e,t)});var t=u.getTarget(e.element());u.onDrop(e,t)},a=jg(i,200);c.reset(),hO(e,r)}})])}})],CO=Object.freeze({getData:function(t){var e,n=t.raw().touches;return 1===n.length?(e=n[0],P.some(Pa(e.clientX,e.clientY))):P.none()},getDelta:function(t,e){return Pa(e.left()-t.left(),e.top()-t.top())}}),OO=SO,MO=[cr("useFixed",!1),cr("getTarget",d),cr("onDrag",N),cr("repositionTarget",!0),cr("onDrop",N),kO,ka("dragger",{handlers:function(o,r){return Fr([Gr(Ht()),Ir(Vt(),function(e,t){t.stop(),r.update(CO,t.event()).each(function(t){wO(e,o,t)})}),Ir(Et(),function(e,t){o.snaps.each(function(t){bO(e,t)});var n=o.getTarget(e.element());r.reset(),o.onDrop(e,n)})])}})],HO=Object.freeze({mouse:OO,touch:MO}),VO=Object.freeze({init:function(){var i=P.none(),t=U({});return gi({readState:t,reset:function(){i=P.none()},update:function(r,t){return r.getData(t).bind(function(t){return e=r,n=t,o=i.map(function(t){return e.getDelta(t,n)}),i=P.some(n),o;var e,n,o})}})}}),EO=Da({branchKey:"mode",branches:HO,name:"dragging",active:{events:function(t,e){return t.dragger.handlers(t,e)}},extra:{snap:We(["sensor","range","output"],["extra"])},state:VO});(zS=kS||(kS={}))[zS.None=0]="None",zS[zS.Both=1]="Both",zS[zS.Vertical=2]="Vertical";var TO,AO,BO,DO,_O,FO=function(t,e,n,o){var r=t+e,i=n.filter(function(t){return r<t}),a=o.filter(function(t){return t<r});return i.or(a).getOr(r)},RO=function(t,e,n,o,r){var i,a,u={};return u.height=FO(o,e.top(),fv(t),(i=t,P.from(i.getParam("max_height")).filter(S))),n===kS.Both&&(u.width=FO(r,e.left(),lv(t),(a=t,P.from(a.getParam("max_width")).filter(S)))),u},LO=function(t){if(1===t.nodeType){if("BR"===t.nodeName||t.getAttribute("data-mce-bogus"))return!0;if("bookmark"===t.getAttribute("data-mce-type"))return!0}return!1},IO=function(i,a){return a.delimiter||(a.delimiter="\xbb"),{dom:{tag:"div",classes:["tox-statusbar__path"]},behaviours:Ea([Td.config({mode:"flow",selector:"div[role=button]"}),Vp.config({}),Fd.config({}),ym("elementPathEvents",[Yr(function(r,t){i.shortcuts.add("alt+F11","focus statusbar elementpath",function(){return Td.focusIn(r)}),i.on("nodeChange",function(t){var e,o,n=function(t){for(var e=[],n=t.length;0<n--;){var o=t[n];if(1===o.nodeType&&!LO(o)){var r=i.fire("ResolveName",{name:o.nodeName.toLowerCase(),target:o});if(r.isDefaultPrevented()||e.push({name:r.name,element:o}),r.isPropagationStopped())break}}return e}(t.parents);0<n.length&&Fd.set(r,(e=E(n||[],function(e,t){return Fm.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{role:"button","data-index":t,"tab-index":-1,"aria-level":t+1},innerHtml:e.name},action:function(t){i.focus(),i.selection.select(e.element),i.nodeChanged()}})}),o={dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0},innerHtml:" "+a.delimiter+" "}},D(e.slice(1),function(t,e){var n=t;return n.push(o),n.push(e),n},[e[0]])))})})])]),components:[]}},NO=function(s,t){var e,n,o,r,i,a,u,c,l,f=function(c){return{dom:{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:t.translate("Resize")},innerHtml:Im("icon-resize-handle",function(){return""})},behaviours:Ea([EO.config({mode:"mouse",repositionTarget:!1,onDrag:function(t,e,n){var o,r,i,a,u;o=s,r=n,i=c,a=Ne.fromDom(o.getContainer()),u=RO(o,r,i,o.getContainer().scrollHeight,qa(a)),tt(u,function(t,e){return Ni(a,e,t+"px")}),OC(o)},blockerClass:"tox-blocker"})])}};return{dom:{tag:"div",classes:["tox-statusbar"]},components:(l=[],s.getParam("elementpath",!0,"boolean")&&l.push(IO(s,{})),fe(s.settings.plugins,"wordcount")&&l.push((a=s,u=t,c=function(t,e,n){return Fd.set(t,[ea(u.translate(["{0} "+n,e[n]]))])},{dom:{tag:"span",classes:["tox-statusbar__wordcount"]},components:[],behaviours:Ea([Fd.config({}),Kd.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),ym("wordcount-events",[Ir(jt(),function(t){var e=Kd.getValue(t),n="words"===e.mode?"characters":"words";Kd.setValue(t,{mode:n,count:e.count}),c(t,e.count,n)}),Yr(function(n){a.on("wordCountUpdate",function(t){var e=Kd.getValue(n).mode;Kd.setValue(n,{mode:e,count:t.wordCount}),c(n,t.wordCount,e)})})])])})),s.getParam("branding",!0,"boolean")&&l.push({dom:{tag:"span",classes:["tox-statusbar__branding"],innerHtml:Ch.translate(["Powered by {0}",'<a href="https://www.tiny.cloud/?utm_campaign=editor_referral&utm_medium=poweredby&utm_source=tinymce&utm_content=v5" rel="noopener" target="_blank" role="presentation" tabindex="-1">Tiny</a>'])}}),r=0<l.length?[{dom:{tag:"div",classes:["tox-statusbar__text-container"]},components:l}]:[],n=!fe((e=s).settings.plugins,"autoresize"),i=!1===(o=e.getParam("resize",n))?kS.None:"both"===o?kS.Both:kS.Vertical,i!==kS.None&&r.push(f(i)),r)}},PO=function(h){var t,e,n=h.getParam("inline",!1,"boolean"),s=n?eO:TC,o=P.none(),r=Ch.isRtl()?{attributes:{dir:"rtl"}}:{},l=ra({dom:Wn({tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"]},r),behaviours:Ea([Qc.config({useFixed:!1})])}),i=Rm({dom:{tag:"div",classes:["tox-anchorbar"]}}),f=vz(l,h,function(){return o.bind(function(t){return i.getOpt(t)}).getOrDie("Could not find a toolbar element")}),d=function(){return ft.value(l)},a=SC.parts().menubar({dom:{tag:"div",classes:["tox-menubar"]},getSink:d,providers:{icons:function(){return h.ui.registry.getAll().icons},translate:Ch.translate},onEscape:function(){h.focus()}}),u=SC.parts().toolbar({dom:{tag:"div",classes:["tox-toolbar"]},onEscape:function(){h.focus()}}),c=SC.parts().socket({dom:{tag:"div",classes:["tox-edit-area"]}}),m=SC.parts().sidebar({dom:{tag:"div",classes:["tox-sidebar"]}}),g=h.getParam("statusbar",!0,"boolean")&&!n?P.some(NO(h,f.shared.providers)):P.none(),v={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[c,m]},p=(e=(t=h).getParam("toolbar"),(C(e)?0<e.length:!1!==t.getParam("toolbar",!0,"boolean"))||dv(h).isSome()),b=!1!==h.getParam("menubar",!0,"boolean"),y=I([b?[a]:[],p?[u]:[],[i.asSpec()],n?[]:[v]]),x=I([[{dom:{tag:"div",classes:["tox-editor-container"]},components:y}],n?[]:g.toArray()]),w=ra(SC.sketch({dom:Wn({tag:"div",classes:["tox","tox-tinymce"].concat(n?["tox-tinymce-inline"]:[]),styles:{visibility:"hidden"}},r),components:x,behaviours:Ea(s.getBehaviours(h).concat([Td.config({mode:"cyclic",selector:".tox-menubar, .tox-toolbar, .tox-sidebar--sliding-open, .tox-statusbar__path"})]))}));o=P.some(w),h.shortcuts.add("alt+F9","focus menubar",function(){SC.focusMenubar(w)}),h.shortcuts.add("alt+F10","focus toolbar",function(){SC.focusToolbar(w)});var k=uv(w),z=uv(l);US(h,k,z);var S=function(t){var e,n,o,r,i,a=cv.DOM,u=h.getParam("width",a.getStyle(t,"width")),c=(e=h).getParam("height",Math.max(e.getElement().offsetHeight,200)),s=lv(h),l=fv(h),f=fO(u).bind(function(e){return dO(s.map(function(t){return Math.max(e,t)}))}).getOr(dO(u)),d=fO(c).bind(function(e){return l.map(function(t){return Math.max(e,t)})}).getOr(c);if("string"==typeof f&&Ni(w.element(),"width",f),!h.inline){var m=dO(d);n="div",o="height",r=m,i=Ne.fromTag(n),Ni(i,o,r),Wi(i,o).isSome()?Ni(w.element(),"height",m):Ni(w.element(),"height","200px")}return d};return{mothership:k,uiMothership:z,backstage:f,renderUI:function(){lO(h,d,f.shared);var t=h.ui.registry.getAll(),e=t.buttons,n=t.menuItems,o=t.contextToolbars,r={menuItems:n,buttons:e,menus:h.settings.menu?et(h.settings.menu,function(t){return vt(t,{items:t.items})}):{},menubar:h.settings.menubar,toolbar:dv(h).getOr(h.getParam("toolbar",!0)),sidebar:h.sidebars?h.sidebars:[]};jS(h,o,l,{backstage:f});var i=h.getElement(),a=S(i),u={mothership:k,uiMothership:z,outerContainer:w},c={targetNode:i,height:a};return s.render(h,u,r,f,c)},getUi:function(){return{channels:{broadcastAll:z.broadcast,broadcastOn:z.broadcastOn,register:function(){}}}}}},jO=function(t,e){return function(){t.execCommand("mceToggleFormat",!1,e)}},UO=function(n){var t=[{type:"menuitem",text:"Left",icon:"align-left",onAction:jO(n,"alignleft")},{type:"menuitem",text:"Center",icon:"align-center",onAction:jO(n,"aligncenter")},{type:"menuitem",text:"Right",icon:"align-right",onAction:jO(n,"alignright")},{type:"menuitem",text:"Justify",icon:"align-justify",onAction:jO(n,"alignjustify")}];n.ui.registry.addMenuItem("align",{text:"Align",icon:"align-left",hasSubmenu:!0,getSubmenuItems:function(){return t}});var e=function(e){return function(t){n.formatter?n.formatter.formatChanged(e.name,t.setActive):n.on("init",function(){n.formatter.formatChanged(e.name,t.setActive)})}};ek.each([{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"}],function(t){n.ui.registry.addToggleButton(t.name,{tooltip:t.text,onAction:function(){return n.execCommand(t.cmd)},icon:t.icon,onSetup:e(t)})});var o={name:"alignnone",text:"No alignment",cmd:"JustifyNone",icon:"align-justify"};n.ui.registry.addButton(o.name,{tooltip:o.text,onAction:function(){return n.execCommand(o.cmd)},icon:o.icon,onSetup:e(o)})},WO=function(t,e){return function(){t.execCommand("mceToggleFormat",!1,e)}},GO=function(i,a){return function(e){var t,n,o,r;return n=a,o=function(t){e.setActive(t)},r=function(t){o(t,n)},(t=i).formatter?t.formatter.formatChanged(n,r):t.on("init",function(){t.formatter.formatChanged(n,r)}),function(){}}},XO=function(t){var e,n,o;e=t,ek.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){e.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onSetup:GO(e,t.name),onAction:WO(e,t.name)})}),n=t,ek.each([{name:"outdent",text:"Decrease indent",action:"Outdent",icon:"outdent"},{name:"indent",text:"Increase indent",action:"Indent",icon:"indent"},{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){n.ui.registry.addButton(t.name,{tooltip:t.text,icon:t.icon,onAction:function(){return n.execCommand(t.action)}})}),o=t,ek.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],function(t){o.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onAction:function(){return o.execCommand(t.action)},onSetup:GO(o,t.name)})})},YO=function(t){var e;XO(t),e=t,ek.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:function(){return e.execCommand(t.action)}})}),e.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onAction:WO(e,"code")})},qO=function(t,e,n){var o=function(){return!!e.undoManager&&e.undoManager[n]()},r=function(){t.setDisabled(e.readonly||!o())};return t.setDisabled(!o()),e.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",r),function(){return e.off("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",r)}},KO=function(t){var e,n;(e=t).ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:function(t){return qO(t,e,"hasUndo")},onAction:function(){return e.execCommand("undo")}}),e.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:function(t){return qO(t,e,"hasRedo")},onAction:function(){return e.execCommand("redo")}}),(n=t).ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",onSetup:function(t){return qO(t,n,"hasUndo")},onAction:function(){return n.execCommand("undo")}}),n.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",onSetup:function(t){return qO(t,n,"hasRedo")},onAction:function(){return n.execCommand("redo")}})},JO=function(t){var e,n;(e=t).ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:function(){return e.execCommand("mceToggleVisualAid")}}),(n=t).ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:function(t){return function(e,t){e.setActive(t.hasVisual);var n=function(t){e.setActive(t.hasVisual)};return t.on("VisualAid",n),function(){return t.off("VisualAid",n)}}(t,n)},onAction:function(){n.execCommand("mceToggleVisualAid")}})},$O=function(t){UO(t),YO(t),KO(t),Kp.register(t),JO(t)},QO=function(t,e){var n=P.from(On(t,"id")).fold(function(){var t=jn("dialog-label");return Sn(e,"id",t),t},d);Sn(t,"aria-labelledby",n)},ZO=U([$o("lazySink"),rr("dragBlockClass"),cr("useTabstopAt",U(!0)),cr("eventOrder",{}),zs("modalBehaviours",[Td]),ya("onExecute"),wa("onEscape")]),tM={sketch:d},eM=U([Zs({name:"draghandle",overrides:function(t,e){return{behaviours:Ea([EO.config({mode:"mouse",getTarget:function(t){return aa(t,'[role="dialog"]').getOr(t)},blockerClass:t.dragBlockClass.getOrDie(new Error("The drag blocker class was not specified for a dialog with a drag handle: \n"+yo(e,null,2)).message)})])}}}),$s({schema:[$o("dom")],name:"title"}),$s({factory:tM,schema:[$o("dom")],name:"close"}),$s({factory:tM,schema:[$o("dom")],name:"body"}),$s({factory:tM,schema:[$o("dom")],name:"footer"}),Qs({factory:{sketch:function(t,e){return Wn({},t,{dom:e.dom,components:e.components})}},schema:[cr("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),cr("components",[])],name:"blocker"})]),nM=Ol({name:"ModalDialog",configFields:ZO(),partFields:eM(),factory:function(o,t,e,r){var u=jn("alloy.dialog.busy"),c=jn("alloy.dialog.idle"),s=Ea([Td.config({mode:"special",focusIn:P.some,onTab:function(){return P.some(!0)},onShiftTab:function(){return P.some(!0)}}),tm.config({})]),n=jn("modal-events"),i=Wn({},o.eventOrder,{"alloy.system.attached":[n].concat(o.eventOrder["alloy.system.attached"]||[])});return{uid:o.uid,dom:o.dom,components:t,apis:{show:function(i){var t=o.lazySink(i).getOrDie(),a=Ct(P.none()),e=r.blocker(),n=t.getSystem().build(Wn({},e,{components:e.components.concat([ia(i)]),behaviours:Ea([ym("dialog-blocker-events",[Ir(c,function(t,e){Mn(i.element(),"aria-busy")&&(Hn(i.element(),"aria-busy"),a.get().each(function(t){return Fd.remove(i,t)}))}),Ir(u,function(t,e){Sn(i.element(),"aria-busy","true");var n=e.event().getBusySpec();a.get().each(function(t){Fd.remove(i,t)});var o=n(i,s),r=t.getSystem().build(o);a.set(P.some(r)),Fd.append(i,ia(r)),r.hasConfigured(Td)&&Td.focusIn(r)})])])}));es(t,n),Td.focusIn(i)},hide:function(e){rn(e.element()).each(function(t){e.getSystem().getByDom(t).each(function(t){rs(t)})})},getBody:function(t){return dl(t,o,"body")},getFooter:function(t){return dl(t,o,"footer")},setIdle:function(t){br(t,c)},setBusy:function(t,e){yr(t,u,{getBusySpec:e})}},eventOrder:i,domModification:{attributes:{role:"dialog"}},behaviours:Cs(o.modalBehaviours,[Fd.config({}),Td.config({mode:"cyclic",onEnter:o.onExecute,onEscape:o.onEscape,useTabstopAt:o.useTabstopAt}),ym(n,[Yr(function(t){QO(t.element(),dl(t,o,"title").element())})])])}},apis:{show:function(t,e){t.show(e)},hide:function(t,e){t.hide(e)},getBody:function(t,e){return t.getBody(e)},getFooter:function(t,e){return t.getFooter(e)},setBusy:function(t,e,n){t.setBusy(e,n)},setIdle:function(t,e){t.setIdle(e)}}}),oM=[Zo("type"),Zo("text"),Do("level","level",Jn(),Lo(function(t){return M(["info","warn","error","success"],t)?ft.value(t):ft.error('Unsupported level: "'+t+'", choose one of "info", "warn", "error", "success".')})),Zo("icon"),cr("url","")],rM=[Zo("type"),Zo("text"),dr("primary",!1),Do("name","name",Qn(function(){return jn("button-name")}),qo)],iM=[Zo("type"),Zo("name"),Zo("label")],aM=["checked","unchecked","indeterminate"],uM=Lo(function(t){return M(aM,t)?ft.value(t):ft.error('Checkbox data: can only be a string of either "'+aM.join('" | "')+'" ')}),cM=[Zo("type"),Zo("name"),ar("label")],sM=cM,lM=qo,fM=cM,dM=qo,mM=cM.concat([cr("flex",!1)]),hM=Vo(Ro),gM=cM.concat([dr("sandboxed",!0),dr("flex",!1)]),vM=qo,pM=cM.concat([ar("placeholder")]),bM=qo,yM=cM.concat([nr("items",[Zo("text"),Zo("value")]),lr("size",1)]),xM=qo,wM=cM.concat([dr("constrain",!0)]),kM=Ho([Zo("width"),Zo("height")]),zM=cM.concat([cr("flex",!1),ar("placeholder")]),SM=qo,CM=cM.concat([cr("filetype","file")]),OM=Ho([Zo("value"),cr("meta",{})]),MM=cM.concat([Zo("type"),fr("tag","textarea"),tr("init")]),HM=qo,VM=[Zo("type"),Zo("html")],EM=cM.concat([$o("currentState")]),TM=cM.concat([cr("columns",1)]),AM=(TO=[Zo("value"),ar("text"),ar("icon")],Ao(TO)),BM=[Zo("type"),or("header",qo),or("cells",Vo(qo))],DM=function(e){return Do("items","items",Jn(),Vo(Lo(function(t){return No("Checking item of "+e,_M,t).fold(function(t){return ft.error(Uo(t))},function(t){return ft.value(t)})})))},_M=Wo("type",{alertbanner:oM,bar:(_O=DM("bar"),[Zo("type"),_O]),button:rM,checkbox:iM,colorinput:sM,colorpicker:fM,dropzone:mM,grid:(BO=DM("grid"),[Zo("type"),(DO="columns",Qo(DO,Yo)),BO]),iframe:gM,input:pM,selectbox:yM,sizeinput:wM,textarea:zM,urlinput:CM,customeditor:MM,htmlpanel:VM,imagetools:EM,collection:TM,label:(AO=DM("label"),[Zo("type"),Zo("label"),AO]),table:BM}),FM=[Zo("type"),or("items",_M)],RM=[Zo("title"),or("items",_M)],LM=[Zo("type"),nr("tabs",RM)],IM=Ho([Zo("type"),Do("name","name",Qn(function(){return jn("button-name")}),qo),Zo("text"),fr("align","end"),dr("primary",!1),dr("disabled",!1)]),NM=Ho([Zo("title"),Qo("body",Wo("type",{panel:FM,tabpanel:LM})),fr("size","normal"),or("buttons",IM),cr("initialData",{}),mr("onAction",N),mr("onChange",N),mr("onSubmit",N),mr("onClose",N),mr("onCancel",N),cr("onTabChange",N),rr("readyWhen")]),PM=function(t){return w(t)?[t].concat(j(rt(t),PM)):C(t)?j(t,PM):[]},jM=function(t){return x(t.type)&&x(t.name)},UM={checkbox:uM,colorinput:lM,colorpicker:dM,dropzone:hM,input:bM,iframe:vM,sizeinput:kM,selectbox:xM,size:kM,textarea:SM,urlinput:OM,customeditor:HM,collection:AM},WM=function(t){var e=j(A(PM(t),jM),function(e){return(t=e,P.from(UM[t.type])).fold(function(){return[]},function(t){return[Qo(e.name,t)]});var t});return Ho(e)},GM=function(t){return{internalDialog:Po(No("dialog",NM,t)),dataValidator:WM(t),initialData:t.initialData}},XM={open:function(t,e){var n=GM(e);return t(n.internalDialog,n.initialData,n.dataValidator)},redial:function(t){return GM(t)}},YM=jn("update-dialog"),qM=jn("update-title"),KM=jn("update-body"),JM=jn("update-footer"),$M=function(t){var n=[],o={};return tt(t,function(t,e){t.fold(function(){n.push(e)},function(t){o[e]=t})}),0<n.length?ft.error(n):ft.value(o)},QM=Cl({name:"TabButton",configFields:[cr("uid",undefined),$o("value"),Do("dom","dom",Zn(function(t){return{attributes:{role:"tab",id:jn("aria"),"aria-selected":"false"}}}),Go()),rr("action"),cr("domModification",{}),zs("tabButtonBehaviours",[tm,Td,Kd]),$o("view")],factory:function(t,e){return{uid:t.uid,dom:t.dom,components:t.components,events:_m(t.action),behaviours:Cs(t.tabButtonBehaviours,[tm.config({}),Td.config({mode:"execution",useSpace:!0,useEnter:!0}),Kd.config({store:{mode:"memory",initialValue:t.value}})]),domModification:t.domModification}}}),ZM=U([$o("tabs"),$o("dom"),cr("clickToDismiss",!1),zs("tabbarBehaviours",[Ul,Td]),va(["tabClass","selectedClass"])]),tH=tl({factory:QM,name:"tabs",unit:"tab",overrides:function(o,t){var r=function(t,e){Ul.dehighlight(t,e),yr(t,Le(),{tabbar:t,button:e})},i=function(t,e){Ul.highlight(t,e),yr(t,Re(),{tabbar:t,button:e})};return{action:function(t){var e=t.getSystem().getByUid(o.uid).getOrDie(),n=Ul.isHighlighted(e,t);(n&&o.clickToDismiss?r:n?N:i)(e,t)},domModification:{classes:[o.markers.tabClass]}}}}),eH=U([tH]),nH=Ol({name:"Tabbar",configFields:ZM(),partFields:eH(),factory:function(t,e,n,o){return{uid:t.uid,dom:t.dom,components:e,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:Cs(t.tabbarBehaviours,[Ul.config({highlightClass:t.markers.selectedClass,itemClass:t.markers.tabClass,onHighlight:function(t,e){Sn(e.element(),"aria-selected","true")},onDehighlight:function(t,e){Sn(e.element(),"aria-selected","false")}}),Td.config({mode:"flow",getInitial:function(t){return Ul.getHighlighted(t).map(function(t){return t.element()})},selector:"."+t.markers.tabClass,executeOnMove:!0})])}}}),oH=Cl({name:"Tabview",configFields:[zs("tabviewBehaviours",[Fd])],factory:function(t,e){return{uid:t.uid,dom:t.dom,behaviours:Cs(t.tabviewBehaviours,[Fd.config({})]),domModification:{attributes:{role:"tabpanel"}}}}}),rH=U([cr("selectFirst",!0),ba("onChangeTab"),ba("onDismissTab"),cr("tabs",[]),zs("tabSectionBehaviours",[])]),iH=$s({factory:nH,schema:[$o("dom"),er("markers",[$o("tabClass"),$o("selectedClass")])],name:"tabbar",defaults:function(t){return{tabs:t.tabs}}}),aH=$s({factory:oH,name:"tabview"}),uH=U([iH,aH]),cH=Ol({name:"TabSection",configFields:rH(),partFields:uH(),factory:function(i,t,e,n){var o=function(t,e){fl(t,i,"tabbar").each(function(t){e(t).each(xr)})};return{uid:i.uid,dom:i.dom,components:t,behaviours:Ss(i.tabSectionBehaviours),events:Fr(I([i.selectFirst?[Yr(function(t,e){o(t,Ul.getFirst)})]:[],[Ir(Re(),function(t,e){var o,r,n=e.event().button();o=n,r=Kd.getValue(o),fl(o,i,"tabview").each(function(n){_(i.tabs,function(t){return t.value===r}).each(function(t){var e=t.view();Sn(n.element(),"aria-labelledby",On(o.element(),"id")),Fd.set(n,e),i.onChangeTab(n,o,e)})})}),Ir(Le(),function(t,e){var n=e.event().button();i.onDismissTab(t,n)})]])),apis:{getViewItems:function(t){return fl(t,i,"tabview").map(function(t){return Fd.contents(t)}).getOr([])},showTab:function(t,n){o(t,function(e){var t=Ul.getCandidates(e);return _(t,function(t){return Kd.getValue(t)===n}).filter(function(t){return!Ul.isHighlighted(e,t)})})}}}},apis:{getViewItems:function(t,e){return t.getViewItems(e)},showTab:function(t,e,n){t.showTab(e,n)}}}),sH=function(t){return K((e=t,n=function(t,e){return e<t?-1:t<e?1:0},(o=G.call(e,0)).sort(n),o));var e,n,o},lH=function(a){return{smartTabHeight:{extraEvents:[Yr(function(t){ua(t.element(),'[role="tabpanel"]').each(function(n){var e;Ni(n,"visibility","hidden"),t.getSystem().getByDom(n).toOption().bind(function(t){var o,r,i,e=(r=n,i=t,E(o=a,function(t,e){Fd.set(i,o[e].view());var n=r.dom().getBoundingClientRect();return Fd.set(i,[]),n.height}));return sH(e)}).each(function(t){Ni(n,"height",t+"px")}),Gi(n,"visibility"),e=t,K(a).each(function(t){return cH.showTab(e,t.value)})})}),Ir(wv,function(t,e){ua(t.element(),'[role="tabpanel"]').each(function(e){Ni(e,"visibility","hidden");var t=Wi(e,"height").map(function(t){return parseInt(t,10)});Gi(e,"height");var n=e.dom().getBoundingClientRect().height;t.forall(function(t){return t<n})?Ni(e,"height",n+"px"):t.each(function(t){Ni(e,"height",t+"px")}),Gi(e,"visibility")})})],selectFirst:!1},naiveTabHeight:{extraEvents:[],selectFirst:!0}}},fH="send-data-to-section",dH="send-data-to-view",mH=function(t,d){return{dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[],behaviours:Ea([kx(0),qz.config({channel:KM,updateState:function(t,e){return P.some({isTabPanel:function(){return"tabpanel"===e.body.type}})},renderComponents:function(t){switch(t.body.type){case"tabpanel":return[(r={tabs:t.body.tabs},i=d,a=Ct({}),u=function(t){var e=Kd.getValue(t),n=$M(e).getOr({}),o=a.get(),r=gt(o,n);a.set(r)},c=function(t){var e=a.get();Kd.setValue(t,e)},s=Ct(null),l=E(r.tabs,function(t){return{value:t.title,dom:{tag:"div",classes:["tox-dialog__body-nav-item"],innerHtml:i.shared.providers.translate(t.title)},view:function(){return[dx.sketch(function(e){return{dom:{tag:"div",classes:["tox-form"]},components:E(t.items,function(t){return Dk(e,t,i)}),formBehaviours:Ea([Td.config({mode:"acyclic",useTabstopAt:m(Rx)}),ym("TabView.form.events",[Yr(c),qr(u)]),La.config({channels:kt([{key:fH,value:{onReceive:u}},{key:dH,value:{onReceive:c}}])})])}})]}}}),f=lH(l).smartTabHeight,cH.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:function(t,e,n){var o=Kd.getValue(e);yr(t,xv,{title:o,oldTitle:s.get()}),s.set(o)},tabs:l,components:[cH.parts().tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[nH.parts().tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:Ea([Vp.config({})])}),cH.parts().tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:f.selectFirst,tabSectionBehaviours:Ea([ym("tabpanel",f.extraEvents),Td.config({mode:"acyclic"}),El.config({find:function(t){return K(cH.getViewItems(t))}}),Kd.config({store:{mode:"manual",getValue:function(t){return t.getSystem().broadcastOn([fH],{}),a.get()},setValue:function(t,e){a.set(e),t.getSystem().broadcastOn([dH],{})}}})])}))];default:return[(n={items:t.body.items},o=d,e=Rm(dx.sketch(function(e){return{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:E(n.items,function(t){return Dk(e,t,o)})}})),{dom:{tag:"div",classes:["tox-dialog__body"]},components:[e.asSpec()],behaviours:Ea([Td.config({mode:"acyclic",useTabstopAt:m(Rx)}),wx(e),Hx(e,{postprocess:function(t){return $M(t).fold(function(t){return console.error(t),{}},function(t){return t})}})])})]}var n,o,e,r,i,a,u,c,s,l,f},initialData:t})])}},hH=function(o,n){var t=function(t,r){return Ir(t,function(n,o){e(n,function(t,e){r(t,o.event(),n)})})},e=function(e,n){qz.getState(e).get().each(function(t){n(t.internalDialog,e)})};return[Ur(Ft(),Lx),t(pv,function(t){return t.onSubmit(o())}),t(mv,function(t,e){t.onChange(o(),{name:e.name()})}),t(vv,function(t,e){t.onAction(o(),{name:e.name(),value:e.value()})}),t(xv,function(t,e){t.onTabChange(o(),e.title())}),t(hv,function(t){n.onClose(),t.onClose()}),t(gv,function(t,e,n){t.onCancel(o()),br(n,hv)}),qr(function(t){var e=o();Kd.setValue(t,e.getData())}),Ir(yv,function(t,e){return n.onUnblock()}),Ir(bv,function(t,e){return n.onBlock(e.event())})]},gH=function(t,e){var n=function(t,e){for(var n=[],o=[],r=0,i=t.length;r<i;r++){var a=t[r];(e(a,r,t)?n:o).push(a)}return{pass:n,fail:o}}(e.map(function(t){return t.footerButtons}).getOr([]),function(t){return"start"===t.align}),o=function(t,e){return av.sketch({dom:{tag:"div",classes:["tox-dialog__footer-"+t]},components:E(e,function(t){return t.memento.asSpec()})})};return[o("start",n.pass),o("end",n.fail)]},vH=function(t,i){return{dom:Sh('<div class="tox-dialog__footer"></div>'),components:[],behaviours:Ea([qz.config({channel:JM,initialData:t,updateState:function(t,e){var r=E(e.buttons,function(t){var e,n,o=Rm((n=i,Fw(e=t,e.type,n)));return{name:t.name,align:t.align,memento:o}});return P.some({lookupByName:function(t,e){return n=t,o=e,_(r,function(t){return t.name===o}).bind(function(t){return t.memento.getOpt(n)});var n,o},footerButtons:r})},renderComponents:gH})])}},pH=function(t){return Fm.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close"),title:t.translate("Close")}},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:'<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg"><path d="M17.953 7.453L13.422 12l4.531 4.547-1.406 1.406L12 13.422l-4.547 4.531-1.406-1.406L10.578 12 6.047 7.453l1.406-1.406L12 10.578l4.547-4.531z" fill-rule="evenodd"></path></svg>'}}],action:function(t){br(t,gv)}})},bH=function(t,e,n){var o=function(t){return[ea(n.translate(t.title))]};return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:Wn({},e.map(function(t){return{id:t}}).getOr({}))},components:o(t),behaviours:Ea([qz.config({channel:qM,renderComponents:o})])}},yH=function(e,n){if(e.getRoot().getSystem().isConnected()){var o=El.getCurrent(e.getFormWrapper()).getOr(e.getFormWrapper());return dx.getField(o,n).fold(function(){var t=e.getFooter();return qz.getState(t).get().bind(function(t){return t.lookupByName(o,n)})},function(t){return P.some(t)})}return P.none()},xH=function(c,o){var t=function(t){var e=c.getRoot();e.getSystem().isConnected()&&t(e)},s={getData:function(){var t=c.getRoot(),e=t.getSystem().isConnected()?c.getFormWrapper():t;return Kd.getValue(e)},setData:function(u){t(function(t){var e,n,o=s.getData(),r=vt(o,u),i=(e=r,n=c.getRoot(),qz.getState(n).get().map(function(t){return Po(No("data",t.dataValidator,e))}).getOr(e)),a=c.getFormWrapper();Kd.setValue(a,i)})},disable:function(t){yH(c,t).each(Gh.disable)},enable:function(t){yH(c,t).each(Gh.enable)},focus:function(t){yH(c,t).each(tm.focus)},block:function(e){t(function(t){yr(t,bv,{message:e})})},unblock:function(){t(function(t){br(t,yv)})},showTab:function(n){t(function(t){var e=c.getBody();qz.getState(e).get().exists(function(t){return t.isTabPanel()})&&El.getCurrent(e).each(function(t){cH.showTab(t,n)})})},redial:function(n){t(function(t){var e=o(n);t.getSystem().broadcastOn([YM],e),t.getSystem().broadcastOn([qM],e.internalDialog),t.getSystem().broadcastOn([KM],e.internalDialog),t.getSystem().broadcastOn([JM],e.internalDialog),s.setData(e.initialData)})},close:function(){t(function(t){br(t,hv)})}};return s},wH=function(t,e,n){var o,r,i,a,u,c,s,l,f,d,m,h=(r={title:n.shared.providers.translate(t.internalDialog.title),draggable:!0},i=n.shared.providers,a=nM.parts().title(bH(r,P.none(),i)),u=nM.parts().draghandle({dom:Sh('<div class="tox-dialog__draghandle"></div>')}),c=nM.parts().close(pH(i)),s=[a].concat(r.draggable?[u]:[]).concat([c]),av.sketch({dom:Sh('<div class="tox-dialog__header"></div>'),components:s})),g=(l={body:t.internalDialog.body},f=n,nM.parts().body(mH(l,f))),v=(d={buttons:t.internalDialog.buttons},m=n.shared.providers,nM.parts().footer(vH(d,m))),p=hH(function(){return x},{onClose:function(){return e.closeWindow()},onBlock:function(n){nM.setBusy(y,function(t,e){return{dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":n.message()},styles:{left:"0px",right:"0px",bottom:"0px",top:"0px",position:"absolute"}},behaviours:e,components:[{dom:Sh('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}})},onUnblock:function(){nM.setIdle(y)}}),b="normal"!==t.internalDialog.size?"large"===t.internalDialog.size?"tox-dialog--width-lg":"tox-dialog--width-md":[],y=ra(nM.sketch({lazySink:n.shared.getSink,onEscape:function(t){return br(t,gv),P.some(!0)},useTabstopAt:function(t){return!Rx(t)&&("button"!==bn(t)||"disabled"!==On(t,"disabled"))},modalBehaviours:Ea([qz.config({channel:YM,updateState:function(t,e){return P.some(e)},initialData:t}),tm.config({}),ym("execute-on-form",p.concat([Xr(Ft(),function(t,e){Td.focusIn(t)})])),Tx({})]),eventOrder:(o={},o[ze()]=["execute-on-form"],o[Ae()]=["reflecting","execute-on-form"],o),dom:{tag:"div",classes:["tox-dialog"].concat(b),styles:{position:"relative"}},components:[h,g,v],dragBlockClass:"tox-dialog-wrap",parts:{blocker:{dom:Sh('<div class="tox-dialog-wrap"></div>'),components:[{dom:{tag:"div",classes:["tox-dialog-wrap__backdrop"]}}]}}})),x=xH({getRoot:function(){return y},getBody:function(){return nM.getBody(y)},getFooter:function(){return nM.getFooter(y)},getFormWrapper:function(){var t=nM.getBody(y);return El.getCurrent(t).getOr(t)}},e.redial);return{dialog:y,instanceApi:x}},kH=function(t,e,n){var o,r,i,a,u,c,s,l,f=jn("dialog-label"),d=Rm((i={title:t.internalDialog.title,draggable:!0},a=f,u=n.shared.providers,av.sketch({dom:Sh('<div class="tox-dialog__header"></div>'),components:[bH(i,P.some(a),u),pH(u)],containerBehaviours:Ea([EO.config({mode:"mouse",blockerClass:"blocker",getTarget:function(t){return ca(t,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}))),m=Rm((c={body:t.internalDialog.body},mH(c,n))),h=Rm((s={buttons:t.internalDialog.buttons},l=n.shared.providers,vH(s,l))),g=hH(function(){return p},{onBlock:function(){},onUnblock:function(){},onClose:function(){return e.closeWindow()}}),v=ra({dom:{tag:"div",classes:["tox-dialog"],attributes:(o={role:"dialog"},o["aria-labelledby"]=f,o)},eventOrder:(r={},r[ke()]=[qz.name(),La.name()],r[ze()]=["execute-on-form"],r[Ae()]=["reflecting","execute-on-form"],r),behaviours:Ea([Td.config({mode:"cyclic",onEscape:function(t){return br(t,hv),P.some(!0)},useTabstopAt:function(t){return!Rx(t)&&("button"!==bn(t)||"disabled"!==On(t,"disabled"))}}),qz.config({channel:YM,updateState:function(t,e){return P.some(e)},initialData:t}),ym("execute-on-form",g),Tx({})]),components:[d.asSpec(),m.asSpec(),h.asSpec()]}),p=xH({getRoot:function(){return v},getFooter:function(){return h.get(v)},getBody:function(){return m.get(v)},getFormWrapper:function(){var t=m.get(v);return El.getCurrent(t).getOr(t)}},e.redial);return{dialog:v,instanceApi:p}},zH=function(t){return nM.parts().close(Fm.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":"Close"}},action:t,buttonBehaviours:Ea([Vp.config({})])}))},SH=function(){return nM.parts().title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})},CH=function(t,e){return nM.parts().body({dom:{tag:"div",classes:["tox-dialog__body","todo-tox-fit"]},components:[{dom:Sh("<p>"+e.translate(t)+"</p>")}]})},OH=function(t){return nM.parts().footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:t})},MH=function(t,e){return[av.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:t}),av.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:e})]},HH=function(n){return nM.sketch({lazySink:n.lazySink,onEscape:function(){return n.onCancel(),P.some(!0)},dom:{tag:"div",classes:["tox-dialog"].concat(n.extraClasses)},components:[{dom:{tag:"div",classes:["tox-dialog__header"]},components:[n.partSpecs.title,n.partSpecs.close]},n.partSpecs.body,n.partSpecs.footer],parts:{blocker:{dom:Sh('<div class="tox-dialog-wrap"></div>'),components:[{dom:{tag:"div",classes:["tox-dialog-wrap__backdrop"]}}]}},modalBehaviours:Ea([ym("basic-dialog-events",[Ir(gv,function(t,e){n.onCancel()}),Ir(pv,function(t,e){n.onSubmit()})])])})},VH=function(c){var a,u,o=(a=c.backstage.shared,{open:function(t,e){var n=function(t){nM.hide(t),e()},o=Rm(Fw({name:"close-alert",text:"OK",primary:!0},"cancel",a.providers)),r=ra(HH({lazySink:function(){return a.getSink()},partSpecs:{title:SH(),close:zH(function(){n(r)}),body:CH(t,a.providers),footer:OH(MH([],[o.asSpec()]))},onCancel:function(){return n(r)},onSubmit:N,extraClasses:["tox-alert-dialog"]}));nM.show(r);var i=o.get(r);tm.focus(i)}}),r=(u=c.backstage.shared,{open:function(t,n){var e=function(t,e){nM.hide(t),n(e)},o=Rm(Fw({name:"yes",text:"Yes",primary:!0},"submit",u.providers)),r=Fw({name:"no",text:"No",primary:!0},"cancel",u.providers),i=ra(HH({lazySink:function(){return u.getSink()},partSpecs:{title:SH(),close:zH(function(){e(i,!1)}),body:CH(t,u.providers),footer:OH(MH([],[r,o.asSpec()]))},onCancel:function(){return e(i,!1)},onSubmit:function(){return e(i,!0)},extraClasses:["tox-confirm-dialog"]}));nM.show(i);var a=o.get(i);tm.focus(a)}}),i=function(t,i){return XM.open(function(t,e,n){var o=e,r=wH({dataValidator:n,initialData:o,internalDialog:t},{redial:XM.redial,closeWindow:function(){nM.hide(r.dialog),i(r.instanceApi)}},c.backstage);return nM.show(r.dialog),r.instanceApi.setData(o),r.instanceApi},t)},s=function(t,a,u){return XM.open(function(t,e,n){var o=Po(No("data",n,e)),r=kH({dataValidator:n,initialData:o,internalDialog:t},{redial:XM.redial,closeWindow:function(){Dm.hide(i),u(r.instanceApi)}},c.backstage),i=ra(Dm.sketch({lazySink:c.backstage.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{},inlineBehaviours:Ea([ym("window-manager-inline-events",[Ir(De(),function(t,e){br(r.dialog,gv)})])])}));return Dm.showAt(i,a,ia(r.dialog)),r.instanceApi.setData(o),Td.focusIn(r.dialog),r.instanceApi},t)};return{open:function(t,e,n){return e!==undefined&&"toolbar"===e.inline?s(t,c.backstage.shared.anchors.toolbar(),n):e!==undefined&&"cursor"===e.inline?s(t,c.backstage.shared.anchors.cursor(),n):i(t,n)},openInlineDialog:s,alert:function(t,e,n){o.open(t,function(){n(),e()})},close:function(t){t.close()},confirm:function(t,e,n){r.open(t,function(t){n(),e(t)})}}};Un.add("silver",function(o){var t=PO(o),e=t.mothership,n=t.uiMothership,r=t.backstage,i=t.renderUI,a=t.getUi;$O(o),In(jn("silver-demo"),e),In(jn("silver-ui-demo"),n),Dg(o,r.shared);var u=VH({backstage:r});return{renderUI:i,getWindowManagerImpl:function(){var t,e=(t=o.windowManager.windows,P.from(t[t.length-1])).fold(function(){return{getParams:N,setParams:N}},function(t){return{getParams:t.getData,setParams:t.setData}}),n={getWindows:function(){return o.windowManager.windows},windows:o.windowManager.windows};return vt(u,e,n)},getNotificationManagerImpl:function(){return Wm(o,{backstage:r},n)},ui:a()}}),function iV(){}}(); |