tinymce-rails 7.5.0 → 7.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/source/tinymce/tinymce.js +3 -3
- data/lib/tinymce/rails/version.rb +2 -2
- data/vendor/assets/javascripts/tinymce/models/dom/model.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/accordion/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/advlist/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/anchor/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/autolink/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/autoresize/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/autosave/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/charmap/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/code/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/codesample/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/directionality/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/fullscreen/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/image/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/importcss/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/insertdatetime/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/link/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/lists/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/media/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/nonbreaking/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/pagebreak/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/preview/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/quickbars/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/save/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/searchreplace/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/table/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/visualblocks/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/visualchars/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/wordcount/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/themes/silver/theme.js +1 -1
- data/vendor/assets/javascripts/tinymce/tinymce.js +2 -2
- metadata +2 -2
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* TinyMCE version 7.5.
|
2
|
+
* TinyMCE version 7.5.1 (TBD)
|
3
3
|
*/
|
4
4
|
!function(){"use strict";const e=Object.getPrototypeOf,t=(e,t,o)=>{var n;return!!o(e,t.prototype)||(null===(n=e.constructor)||void 0===n?void 0:n.name)===t.name},o=e=>o=>(e=>{const o=typeof e;return null===e?"null":"object"===o&&Array.isArray(e)?"array":"object"===o&&t(e,String,((e,t)=>t.isPrototypeOf(e)))?"string":o})(o)===e,n=e=>t=>typeof t===e,s=e=>t=>e===t,r=o("string"),a=o("object"),i=o=>((o,n)=>a(o)&&t(o,n,((t,o)=>e(t)===o)))(o,Object),l=o("array"),c=s(null),d=n("boolean"),u=s(void 0),m=e=>null==e,g=e=>!m(e),p=n("function"),h=n("number"),f=(e,t)=>{if(l(e)){for(let o=0,n=e.length;o<n;++o)if(!t(e[o]))return!1;return!0}return!1},b=()=>{},v=e=>()=>e(),x=(e,t)=>(...o)=>e(t.apply(null,o)),y=e=>()=>e,w=e=>e,S=(e,t)=>e===t;function C(e,...t){return(...o)=>{const n=t.concat(o);return e.apply(null,n)}}const k=e=>t=>!e(t),O=e=>()=>{throw new Error(e)},_=e=>e(),T=y(!1),E=y(!0);class A{constructor(e,t){this.tag=e,this.value=t}static some(e){return new A(!0,e)}static none(){return A.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?A.some(e(this.value)):A.none()}bind(e){return this.tag?e(this.value):A.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:A.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return g(e)?A.some(e):A.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}A.singletonNone=new A(!1);const M=Array.prototype.slice,D=Array.prototype.indexOf,B=Array.prototype.push,I=(e,t)=>D.call(e,t),F=(e,t)=>I(e,t)>-1,R=(e,t)=>{for(let o=0,n=e.length;o<n;o++)if(t(e[o],o))return!0;return!1},N=(e,t)=>{const o=[];for(let n=0;n<e;n++)o.push(t(n));return o},z=(e,t)=>{const o=[];for(let n=0;n<e.length;n+=t){const s=M.call(e,n,n+t);o.push(s)}return o},L=(e,t)=>{const o=e.length,n=new Array(o);for(let s=0;s<o;s++){const o=e[s];n[s]=t(o,s)}return n},V=(e,t)=>{for(let o=0,n=e.length;o<n;o++)t(e[o],o)},H=(e,t)=>{const o=[],n=[];for(let s=0,r=e.length;s<r;s++){const r=e[s];(t(r,s)?o:n).push(r)}return{pass:o,fail:n}},P=(e,t)=>{const o=[];for(let n=0,s=e.length;n<s;n++){const s=e[n];t(s,n)&&o.push(s)}return o},U=(e,t,o)=>(((e,t)=>{for(let o=e.length-1;o>=0;o--)t(e[o],o)})(e,((e,n)=>{o=t(o,e,n)})),o),W=(e,t,o)=>(V(e,((e,n)=>{o=t(o,e,n)})),o),j=(e,t)=>((e,t,o)=>{for(let n=0,s=e.length;n<s;n++){const s=e[n];if(t(s,n))return A.some(s);if(o(s,n))break}return A.none()})(e,t,T),$=(e,t)=>{for(let o=0,n=e.length;o<n;o++)if(t(e[o],o))return A.some(o);return A.none()},G=e=>{const t=[];for(let o=0,n=e.length;o<n;++o){if(!l(e[o]))throw new Error("Arr.flatten item "+o+" was not an array, input: "+e);B.apply(t,e[o])}return t},q=(e,t)=>G(L(e,t)),Y=(e,t)=>{for(let o=0,n=e.length;o<n;++o)if(!0!==t(e[o],o))return!1;return!0},X=e=>{const t=M.call(e,0);return t.reverse(),t},K=(e,t)=>P(e,(e=>!F(t,e))),J=(e,t)=>{const o={};for(let n=0,s=e.length;n<s;n++){const s=e[n];o[String(s)]=t(s,n)}return o},Q=e=>[e],Z=(e,t)=>{const o=M.call(e,0);return o.sort(t),o},ee=(e,t)=>t>=0&&t<e.length?A.some(e[t]):A.none(),te=e=>ee(e,0),oe=e=>ee(e,e.length-1),ne=p(Array.from)?Array.from:e=>M.call(e),se=(e,t)=>{for(let o=0;o<e.length;o++){const n=t(e[o],o);if(n.isSome())return n}return A.none()},re=Object.keys,ae=Object.hasOwnProperty,ie=(e,t)=>{const o=re(e);for(let n=0,s=o.length;n<s;n++){const s=o[n];t(e[s],s)}},le=(e,t)=>ce(e,((e,o)=>({k:o,v:t(e,o)}))),ce=(e,t)=>{const o={};return ie(e,((e,n)=>{const s=t(e,n);o[s.k]=s.v})),o},de=e=>(t,o)=>{e[o]=t},ue=(e,t,o,n)=>{ie(e,((e,s)=>{(t(e,s)?o:n)(e,s)}))},me=(e,t)=>{const o={};return ue(e,t,de(o),b),o},ge=(e,t)=>{const o=[];return ie(e,((e,n)=>{o.push(t(e,n))})),o},pe=(e,t)=>{const o=re(e);for(let n=0,s=o.length;n<s;n++){const s=o[n],r=e[s];if(t(r,s,e))return A.some(r)}return A.none()},he=e=>ge(e,w),fe=(e,t)=>be(e,t)?A.from(e[t]):A.none(),be=(e,t)=>ae.call(e,t),ve=(e,t)=>be(e,t)&&void 0!==e[t]&&null!==e[t],xe=(e,t,o=S)=>e.exists((e=>o(e,t))),ye=e=>{const t=[],o=e=>{t.push(e)};for(let t=0;t<e.length;t++)e[t].each(o);return t},we=(e,t,o)=>e.isSome()&&t.isSome()?A.some(o(e.getOrDie(),t.getOrDie())):A.none(),Se=(e,t)=>null!=e?A.some(t(e)):A.none(),Ce=(e,t)=>e?A.some(t):A.none(),ke=(e,t,o)=>""===t||e.length>=t.length&&e.substr(o,o+t.length)===t,Oe=(e,t)=>Te(e,t)?((e,t)=>e.substring(t))(e,t.length):e,_e=(e,t,o=0,n)=>{const s=e.indexOf(t,o);return-1!==s&&(!!u(n)||s+t.length<=n)},Te=(e,t)=>ke(e,t,0),Ee=(e,t)=>ke(e,t,e.length-t.length),Ae=(Eo=/^\s+|\s+$/g,e=>e.replace(Eo,"")),Me=e=>e.length>0,De=e=>!Me(e),Be=e=>void 0!==e.style&&p(e.style.getPropertyValue),Ie=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},Fe=(e,t)=>{const o=(t||document).createElement("div");if(o.innerHTML=e,!o.hasChildNodes()||o.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return Ie(o.childNodes[0])},Re=(e,t)=>{const o=(t||document).createElement(e);return Ie(o)},Ne=(e,t)=>{const o=(t||document).createTextNode(e);return Ie(o)},ze=Ie,Le="undefined"!=typeof window?window:Function("return this;")(),Ve=(e,t)=>((e,t)=>{let o=null!=t?t:Le;for(let t=0;t<e.length&&null!=o;++t)o=o[e[t]];return o})(e.split("."),t),He=Object.getPrototypeOf,Pe=e=>{const t=Ve("ownerDocument.defaultView",e);return a(e)&&((e=>((e,t)=>{const o=((e,t)=>Ve(e,t))(e,t);if(null==o)throw new Error(e+" not available on this browser");return o})("HTMLElement",e))(t).prototype.isPrototypeOf(e)||/^HTML\w*Element$/.test(He(e).constructor.name))},Ue=e=>e.dom.nodeName.toLowerCase(),We=e=>t=>(e=>e.dom.nodeType)(t)===e,je=e=>$e(e)&&Pe(e.dom),$e=We(1),Ge=We(3),qe=We(9),Ye=We(11),Xe=e=>t=>$e(t)&&Ue(t)===e,Ke=(e,t)=>{const o=e.dom;if(1!==o.nodeType)return!1;{const e=o;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}},Je=e=>1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount,Qe=(e,t)=>{const o=void 0===t?document:t.dom;return Je(o)?A.none():A.from(o.querySelector(e)).map(ze)},Ze=(e,t)=>e.dom===t.dom,et=(e,t)=>{const o=e.dom,n=t.dom;return o!==n&&o.contains(n)},tt=e=>ze(e.dom.ownerDocument),ot=e=>qe(e)?e:tt(e),nt=e=>ze(ot(e).dom.documentElement),st=e=>ze(ot(e).dom.defaultView),rt=e=>A.from(e.dom.parentNode).map(ze),at=e=>A.from(e.dom.parentElement).map(ze),it=e=>A.from(e.dom.offsetParent).map(ze),lt=e=>L(e.dom.childNodes,ze),ct=(e,t)=>{const o=e.dom.childNodes;return A.from(o[t]).map(ze)},dt=e=>ct(e,0),ut=(e,t)=>({element:e,offset:t}),mt=(e,t)=>{const o=lt(e);return o.length>0&&t<o.length?ut(o[t],0):ut(e,t)},gt=e=>Ye(e)&&g(e.dom.host),pt=e=>ze(e.dom.getRootNode()),ht=e=>gt(e)?e:ze(ot(e).dom.body),ft=e=>{const t=pt(e);return gt(t)?A.some(t):A.none()},bt=e=>ze(e.dom.host),vt=e=>{const t=Ge(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;const o=t.ownerDocument;return ft(ze(t)).fold((()=>o.body.contains(t)),(n=vt,s=bt,e=>n(s(e))));var n,s},xt=()=>yt(ze(document)),yt=e=>{const t=e.dom.body;if(null==t)throw new Error("Body is not available yet");return ze(t)},wt=(e,t,o)=>{if(!(r(o)||d(o)||h(o)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",o,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,o+"")},St=(e,t,o)=>{wt(e.dom,t,o)},Ct=(e,t)=>{const o=e.dom;ie(t,((e,t)=>{wt(o,t,e)}))},kt=(e,t)=>{const o=e.dom.getAttribute(t);return null===o?void 0:o},Ot=(e,t)=>A.from(kt(e,t)),_t=(e,t)=>{const o=e.dom;return!(!o||!o.hasAttribute)&&o.hasAttribute(t)},Tt=(e,t)=>{e.dom.removeAttribute(t)},Et=(e,t,o)=>{if(!r(o))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",o,":: Element ",e),new Error("CSS value must be a string: "+o);Be(e)&&e.style.setProperty(t,o)},At=(e,t)=>{Be(e)&&e.style.removeProperty(t)},Mt=(e,t,o)=>{const n=e.dom;Et(n,t,o)},Dt=(e,t)=>{const o=e.dom;ie(t,((e,t)=>{Et(o,t,e)}))},Bt=(e,t)=>{const o=e.dom;ie(t,((e,t)=>{e.fold((()=>{At(o,t)}),(e=>{Et(o,t,e)}))}))},It=(e,t)=>{const o=e.dom,n=window.getComputedStyle(o).getPropertyValue(t);return""!==n||vt(e)?n:Ft(o,t)},Ft=(e,t)=>Be(e)?e.style.getPropertyValue(t):"",Rt=(e,t)=>{const o=e.dom,n=Ft(o,t);return A.from(n).filter((e=>e.length>0))},Nt=e=>{const t={},o=e.dom;if(Be(o))for(let e=0;e<o.style.length;e++){const n=o.style.item(e);t[n]=o.style[n]}return t},zt=(e,t,o)=>{const n=Re(e);return Mt(n,t,o),Rt(n,t).isSome()},Lt=(e,t)=>{const o=e.dom;At(o,t),xe(Ot(e,"style").map(Ae),"")&&Tt(e,"style")},Vt=e=>e.dom.offsetWidth,Ht=(e,t)=>{const o=o=>{const n=t(o);if(n<=0||null===n){const t=It(o,e);return parseFloat(t)||0}return n},n=(e,t)=>W(t,((t,o)=>{const n=It(e,o),s=void 0===n?0:parseInt(n,10);return isNaN(s)?t:t+s}),0);return{set:(t,o)=>{if(!h(o)&&!o.match(/^[0-9]+$/))throw new Error(e+".set accepts only positive integer values. Value was "+o);const n=t.dom;Be(n)&&(n.style[e]=o+"px")},get:o,getOuter:o,aggregate:n,max:(e,t,o)=>{const s=n(e,o);return t>s?t-s:0}}},Pt=Ht("height",(e=>{const t=e.dom;return vt(e)?t.getBoundingClientRect().height:t.offsetHeight})),Ut=e=>Pt.get(e),Wt=e=>Pt.getOuter(e),jt=(e,t)=>({left:e,top:t,translate:(o,n)=>jt(e+o,t+n)}),$t=jt,Gt=(e,t)=>void 0!==e?e:void 0!==t?t:0,qt=e=>{const t=e.dom.ownerDocument,o=t.body,n=t.defaultView,s=t.documentElement;if(o===e.dom)return $t(o.offsetLeft,o.offsetTop);const r=Gt(null==n?void 0:n.pageYOffset,s.scrollTop),a=Gt(null==n?void 0:n.pageXOffset,s.scrollLeft),i=Gt(s.clientTop,o.clientTop),l=Gt(s.clientLeft,o.clientLeft);return Yt(e).translate(a-l,r-i)},Yt=e=>{const t=e.dom,o=t.ownerDocument.body;return o===t?$t(o.offsetLeft,o.offsetTop):vt(e)?(e=>{const t=e.getBoundingClientRect();return $t(t.left,t.top)})(t):$t(0,0)},Xt=Ht("width",(e=>e.dom.offsetWidth)),Kt=e=>Xt.get(e),Jt=e=>Xt.getOuter(e),Qt=e=>{let t,o=!1;return(...n)=>(o||(o=!0,t=e.apply(null,n)),t)},Zt=()=>eo(0,0),eo=(e,t)=>({major:e,minor:t}),to={nu:eo,detect:(e,t)=>{const o=String(t).toLowerCase();return 0===e.length?Zt():((e,t)=>{const o=((e,t)=>{for(let o=0;o<e.length;o++){const n=e[o];if(n.test(t))return n}})(e,t);if(!o)return{major:0,minor:0};const n=e=>Number(t.replace(o,"$"+e));return eo(n(1),n(2))})(e,o)},unknown:Zt},oo=(e,t)=>{const o=String(t).toLowerCase();return j(e,(e=>e.search(o)))},no=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,so=e=>t=>_e(t,e),ro=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:e=>_e(e,"edge/")&&_e(e,"chrome")&&_e(e,"safari")&&_e(e,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,no],search:e=>_e(e,"chrome")&&!_e(e,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:e=>_e(e,"msie")||_e(e,"trident")},{name:"Opera",versionRegexes:[no,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:so("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:so("firefox")},{name:"Safari",versionRegexes:[no,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:e=>(_e(e,"safari")||_e(e,"mobile/"))&&_e(e,"applewebkit")}],ao=[{name:"Windows",search:so("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:e=>_e(e,"iphone")||_e(e,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:so("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:so("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:so("linux"),versionRegexes:[]},{name:"Solaris",search:so("sunos"),versionRegexes:[]},{name:"FreeBSD",search:so("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:so("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],io={browsers:y(ro),oses:y(ao)},lo="Edge",co="Chromium",uo="Opera",mo="Firefox",go="Safari",po=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isEdge:n(lo),isChromium:n(co),isIE:n("IE"),isOpera:n(uo),isFirefox:n(mo),isSafari:n(go)}},ho=()=>po({current:void 0,version:to.unknown()}),fo=po,bo=(y(lo),y(co),y("IE"),y(uo),y(mo),y(go),"Windows"),vo="Android",xo="Linux",yo="macOS",wo="Solaris",So="FreeBSD",Co="ChromeOS",ko=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isWindows:n(bo),isiOS:n("iOS"),isAndroid:n(vo),isMacOS:n(yo),isLinux:n(xo),isSolaris:n(wo),isFreeBSD:n(So),isChromeOS:n(Co)}},Oo=()=>ko({current:void 0,version:to.unknown()}),_o=ko,To=(y(bo),y("iOS"),y(vo),y(xo),y(yo),y(wo),y(So),y(Co),e=>window.matchMedia(e).matches);var Eo;let Ao=Qt((()=>((e,t,o)=>{const n=io.browsers(),s=io.oses(),r=t.bind((e=>((e,t)=>se(t.brands,(t=>{const o=t.brand.toLowerCase();return j(e,(e=>{var t;return o===(null===(t=e.brand)||void 0===t?void 0:t.toLowerCase())})).map((e=>({current:e.name,version:to.nu(parseInt(t.version,10),0)})))})))(n,e))).orThunk((()=>((e,t)=>oo(e,t).map((e=>{const o=to.detect(e.versionRegexes,t);return{current:e.name,version:o}})))(n,e))).fold(ho,fo),a=((e,t)=>oo(e,t).map((e=>{const o=to.detect(e.versionRegexes,t);return{current:e.name,version:o}})))(s,e).fold(Oo,_o),i=((e,t,o,n)=>{const s=e.isiOS()&&!0===/ipad/i.test(o),r=e.isiOS()&&!s,a=e.isiOS()||e.isAndroid(),i=a||n("(pointer:coarse)"),l=s||!r&&a&&n("(min-device-width:768px)"),c=r||a&&!l,d=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(o),u=!c&&!l&&!d;return{isiPad:y(s),isiPhone:y(r),isTablet:y(l),isPhone:y(c),isTouch:y(i),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:y(d),isDesktop:y(u)}})(a,r,e,o);return{browser:r,os:a,deviceType:i}})(window.navigator.userAgent,A.from(window.navigator.userAgentData),To)));const Mo=()=>Ao(),Do=e=>{const t=ze((e=>{if(g(e.target)){const t=ze(e.target);if($e(t)&&(e=>g(e.dom.shadowRoot))(t)&&e.composed&&e.composedPath){const t=e.composedPath();if(t)return te(t)}}return A.from(e.target)})(e).getOr(e.target)),o=()=>e.stopPropagation(),n=()=>e.preventDefault(),s=x(n,o);return((e,t,o,n,s,r,a)=>({target:e,x:t,y:o,stop:n,prevent:s,kill:r,raw:a}))(t,e.clientX,e.clientY,o,n,s,e)},Bo=(e,t,o,n,s)=>{const r=((e,t)=>o=>{e(o)&&t(Do(o))})(o,n);return e.dom.addEventListener(t,r,s),{unbind:C(Io,e,t,r,s)}},Io=(e,t,o,n)=>{e.dom.removeEventListener(t,o,n)},Fo=(e,t)=>{rt(e).each((o=>{o.dom.insertBefore(t.dom,e.dom)}))},Ro=(e,t)=>{const o=(e=>A.from(e.dom.nextSibling).map(ze))(e);o.fold((()=>{rt(e).each((e=>{zo(e,t)}))}),(e=>{Fo(e,t)}))},No=(e,t)=>{dt(e).fold((()=>{zo(e,t)}),(o=>{e.dom.insertBefore(t.dom,o.dom)}))},zo=(e,t)=>{e.dom.appendChild(t.dom)},Lo=(e,t)=>{V(t,(t=>{zo(e,t)}))},Vo=e=>{e.dom.textContent="",V(lt(e),(e=>{Ho(e)}))},Ho=e=>{const t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},Po=e=>{const t=void 0!==e?e.dom:document,o=t.body.scrollLeft||t.documentElement.scrollLeft,n=t.body.scrollTop||t.documentElement.scrollTop;return $t(o,n)},Uo=(e,t,o)=>{const n=(void 0!==o?o.dom:document).defaultView;n&&n.scrollTo(e,t)},Wo=(e,t,o,n)=>({x:e,y:t,width:o,height:n,right:e+o,bottom:t+n}),jo=e=>{const t=void 0===e?window:e,o=t.document,n=Po(ze(o));return(e=>{const t=void 0===e?window:e;return Mo().browser.isFirefox()?A.none():A.from(t.visualViewport)})(t).fold((()=>{const e=t.document.documentElement,o=e.clientWidth,s=e.clientHeight;return Wo(n.left,n.top,o,s)}),(e=>Wo(Math.max(e.pageLeft,n.left),Math.max(e.pageTop,n.top),e.width,e.height)))},$o=()=>ze(document),Go=(e,t)=>e.view(t).fold(y([]),(t=>{const o=e.owner(t),n=Go(e,o);return[t].concat(n)}));var qo=Object.freeze({__proto__:null,view:e=>{var t;return(e.dom===document?A.none():A.from(null===(t=e.dom.defaultView)||void 0===t?void 0:t.frameElement)).map(ze)},owner:e=>tt(e)});const Yo=e=>{const t=$o(),o=Po(t),n=((e,t)=>{const o=t.owner(e),n=Go(t,o);return A.some(n)})(e,qo);return n.fold(C(qt,e),(t=>{const n=Yt(e),s=U(t,((e,t)=>{const o=Yt(t);return{left:e.left+o.left,top:e.top+o.top}}),{left:0,top:0});return $t(s.left+n.left+o.left,s.top+n.top+o.top)}))},Xo=(e,t,o,n)=>({x:e,y:t,width:o,height:n,right:e+o,bottom:t+n}),Ko=e=>{const t=qt(e),o=Jt(e),n=Wt(e);return Xo(t.left,t.top,o,n)},Jo=e=>{const t=Yo(e),o=Jt(e),n=Wt(e);return Xo(t.left,t.top,o,n)},Qo=(e,t)=>{const o=Math.max(e.x,t.x),n=Math.max(e.y,t.y),s=Math.min(e.right,t.right),r=Math.min(e.bottom,t.bottom);return Xo(o,n,s-o,r-n)},Zo=()=>jo(window),en=e=>{let t=e;return{get:()=>t,set:e=>{t=e}}},tn=e=>{const t=en(A.none()),o=()=>t.get().each(e);return{clear:()=>{o(),t.set(A.none())},isSet:()=>t.get().isSome(),get:()=>t.get(),set:e=>{o(),t.set(A.some(e))}}},on=()=>tn((e=>e.unbind())),nn=()=>{const e=tn(b);return{...e,on:t=>e.get().each(t)}};var sn=tinymce.util.Tools.resolve("tinymce.ThemeManager");const rn=e=>{const t=t=>t(e),o=y(e),n=()=>s,s={tag:!0,inner:e,fold:(t,o)=>o(e),isValue:E,isError:T,map:t=>ln.value(t(e)),mapError:n,bind:t,exists:t,forall:t,getOr:o,or:n,getOrThunk:o,orThunk:n,getOrDie:o,each:t=>{t(e)},toOptional:()=>A.some(e)};return s},an=e=>{const t=()=>o,o={tag:!1,inner:e,fold:(t,o)=>t(e),isValue:T,isError:E,map:t,mapError:t=>ln.error(t(e)),bind:t,exists:T,forall:E,getOr:w,or:w,getOrThunk:_,orThunk:_,getOrDie:O(String(e)),each:b,toOptional:A.none};return o},ln={value:rn,error:an,fromOption:(e,t)=>e.fold((()=>an(t)),rn)};var cn;!function(e){e[e.Error=0]="Error",e[e.Value=1]="Value"}(cn||(cn={}));const dn=(e,t,o)=>e.stype===cn.Error?t(e.serror):o(e.svalue),un=e=>({stype:cn.Value,svalue:e}),mn=e=>({stype:cn.Error,serror:e}),gn=un,pn=mn,hn=dn,fn=(e,t,o,n)=>({tag:"field",key:e,newKey:t,presence:o,prop:n}),bn=(e,t,o)=>{switch(e.tag){case"field":return t(e.key,e.newKey,e.presence,e.prop);case"custom":return o(e.newKey,e.instantiator)}},vn=e=>(...t)=>{if(0===t.length)throw new Error("Can't merge zero objects");const o={};for(let n=0;n<t.length;n++){const s=t[n];for(const t in s)be(s,t)&&(o[t]=e(o[t],s[t]))}return o},xn=vn(((e,t)=>i(e)&&i(t)?xn(e,t):t)),yn=vn(((e,t)=>t)),wn=e=>({tag:"defaultedThunk",process:e}),Sn=e=>wn(y(e)),Cn=e=>({tag:"mergeWithThunk",process:e}),kn=e=>{const t=(e=>{const t=[],o=[];return V(e,(e=>{dn(e,(e=>o.push(e)),(e=>t.push(e)))})),{values:t,errors:o}})(e);return t.errors.length>0?(o=t.errors,x(pn,G)(o)):gn(t.values);var o},On=e=>a(e)&&re(e).length>100?" removed due to size":JSON.stringify(e,null,2),_n=(e,t)=>pn([{path:e,getErrorInfo:t}]),Tn=e=>({extract:(t,o)=>((e,t)=>e.stype===cn.Error?t(e.serror):e)(e(o),(e=>((e,t)=>_n(e,y(t)))(t,e))),toString:y("val")}),En=Tn(gn),An=(e,t,o,n)=>n(fe(e,t).getOrThunk((()=>o(e)))),Mn=(e,t,o,n,s)=>{const r=e=>s.extract(t.concat([n]),e),a=e=>e.fold((()=>gn(A.none())),(e=>((e,t)=>e.stype===cn.Value?{stype:cn.Value,svalue:t(e.svalue)}:e)(s.extract(t.concat([n]),e),A.some)));switch(e.tag){case"required":return((e,t,o,n)=>fe(t,o).fold((()=>((e,t,o)=>_n(e,(()=>'Could not find valid *required* value for "'+t+'" in '+On(o))))(e,o,t)),n))(t,o,n,r);case"defaultedThunk":return An(o,n,e.process,r);case"option":return((e,t,o)=>o(fe(e,t)))(o,n,a);case"defaultedOptionThunk":return((e,t,o,n)=>n(fe(e,t).map((t=>!0===t?o(e):t))))(o,n,e.process,a);case"mergeWithThunk":return An(o,n,y({}),(t=>{const n=xn(e.process(o),t);return r(n)}))}},Dn=e=>({extract:(t,o)=>e().extract(t,o),toString:()=>e().toString()}),Bn=e=>re(me(e,g)),In=e=>{const t=Fn(e),o=U(e,((e,t)=>bn(t,(t=>xn(e,{[t]:!0})),y(e))),{});return{extract:(e,n)=>{const s=d(n)?[]:Bn(n),r=P(s,(e=>!ve(o,e)));return 0===r.length?t.extract(e,n):((e,t)=>_n(e,(()=>"There are unsupported fields: ["+t.join(", ")+"] specified")))(e,r)},toString:t.toString}},Fn=e=>({extract:(t,o)=>((e,t,o)=>{const n={},s=[];for(const r of o)bn(r,((o,r,a,i)=>{const l=Mn(a,e,t,o,i);hn(l,(e=>{s.push(...e)}),(e=>{n[r]=e}))}),((e,o)=>{n[e]=o(t)}));return s.length>0?pn(s):gn(n)})(t,o,e),toString:()=>"obj{\n"+L(e,(e=>bn(e,((e,t,o,n)=>e+" -> "+n.toString()),((e,t)=>"state("+e+")")))).join("\n")+"}"}),Rn=e=>({extract:(t,o)=>{const n=L(o,((o,n)=>e.extract(t.concat(["["+n+"]"]),o)));return kn(n)},toString:()=>"array("+e.toString()+")"}),Nn=(e,t)=>{const o=void 0!==t?t:w;return{extract:(t,n)=>{const s=[];for(const r of e){const e=r.extract(t,n);if(e.stype===cn.Value)return{stype:cn.Value,svalue:o(e.svalue)};s.push(e)}return kn(s)},toString:()=>"oneOf("+L(e,(e=>e.toString())).join(", ")+")"}},zn=(e,t)=>({extract:(o,n)=>{const s=re(n),r=((t,o)=>Rn(Tn(e)).extract(t,o))(o,s);return((e,t)=>e.stype===cn.Value?t(e.svalue):e)(r,(e=>{const s=L(e,(e=>fn(e,e,{tag:"required",process:{}},t)));return Fn(s).extract(o,n)}))},toString:()=>"setOf("+t.toString()+")"}),Ln=x(Rn,Fn),Vn=y(En),Hn=(e,t)=>Tn((o=>{const n=typeof o;return e(o)?gn(o):pn(`Expected type: ${t} but got: ${n}`)})),Pn=Hn(h,"number"),Un=Hn(r,"string"),Wn=Hn(d,"boolean"),jn=Hn(p,"function"),$n=e=>{if(Object(e)!==e)return!0;switch({}.toString.call(e).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(e).every((t=>$n(e[t])));default:return!1}},Gn=Tn((e=>$n(e)?gn(e):pn("Expected value to be acceptable for sending via postMessage"))),qn=(e,t)=>({extract:(o,n)=>fe(n,e).fold((()=>((e,t)=>_n(e,(()=>'Choice schema did not contain choice key: "'+t+'"')))(o,e)),(e=>((e,t,o,n)=>fe(o,n).fold((()=>((e,t,o)=>_n(e,(()=>'The chosen schema: "'+o+'" did not exist in branches: '+On(t))))(e,o,n)),(o=>o.extract(e.concat(["branch: "+n]),t))))(o,n,t,e))),toString:()=>"chooseOn("+e+"). Possible values: "+re(t)}),Yn=e=>Tn((t=>e(t).fold(pn,gn))),Xn=(e,t)=>zn((t=>e(t).fold(mn,un)),t),Kn=(e,t,o)=>{return n=((e,t,o)=>((e,t)=>e.stype===cn.Error?{stype:cn.Error,serror:t(e.serror)}:e)(t.extract([e],o),(e=>({input:o,errors:e}))))(e,t,o),dn(n,ln.error,ln.value);var n},Jn=e=>e.fold((e=>{throw new Error(Zn(e))}),w),Qn=(e,t,o)=>Jn(Kn(e,t,o)),Zn=e=>"Errors: \n"+(e=>{const t=e.length>10?e.slice(0,10).concat([{path:[],getErrorInfo:y("... (only showing first ten failures)")}]):e;return L(t,(e=>"Failed path: ("+e.path.join(" > ")+")\n"+e.getErrorInfo()))})(e.errors).join("\n")+"\n\nInput object: "+On(e.input),es=(e,t)=>qn(e,le(t,Fn)),ts=(e,t)=>((e,t)=>{const o=Qt(t);return{extract:(e,t)=>o().extract(e,t),toString:()=>o().toString()}})(0,t),os=fn,ns=(e,t)=>({tag:"custom",newKey:e,instantiator:t}),ss=e=>Yn((t=>F(e,t)?ln.value(t):ln.error(`Unsupported value: "${t}", choose one of "${e.join(", ")}".`))),rs=e=>os(e,e,{tag:"required",process:{}},Vn()),as=(e,t)=>os(e,e,{tag:"required",process:{}},t),is=e=>as(e,Un),ls=(e,t)=>os(e,e,{tag:"required",process:{}},ss(t)),cs=e=>as(e,jn),ds=(e,t)=>os(e,e,{tag:"required",process:{}},Fn(t)),us=(e,t)=>os(e,e,{tag:"required",process:{}},Ln(t)),ms=(e,t)=>os(e,e,{tag:"required",process:{}},Rn(t)),gs=e=>os(e,e,{tag:"option",process:{}},Vn()),ps=(e,t)=>os(e,e,{tag:"option",process:{}},t),hs=e=>ps(e,Pn),fs=e=>ps(e,Un),bs=(e,t)=>ps(e,ss(t)),vs=e=>ps(e,jn),xs=(e,t)=>ps(e,Rn(t)),ys=(e,t)=>ps(e,Fn(t)),ws=(e,t)=>os(e,e,Sn(t),Vn()),Ss=(e,t,o)=>os(e,e,Sn(t),o),Cs=(e,t)=>Ss(e,t,Pn),ks=(e,t)=>Ss(e,t,Un),Os=(e,t,o)=>Ss(e,t,ss(o)),_s=(e,t)=>Ss(e,t,Wn),Ts=(e,t)=>Ss(e,t,jn),Es=(e,t,o)=>Ss(e,t,Rn(o)),As=(e,t,o)=>Ss(e,t,Fn(o)),Ms=e=>{if(!l(e))throw new Error("cases must be an array");if(0===e.length)throw new Error("there must be at least one case");const t=[],o={};return V(e,((n,s)=>{const r=re(n);if(1!==r.length)throw new Error("one and only one name per case");const a=r[0],i=n[a];if(void 0!==o[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!l(i))throw new Error("case arguments must be an array");t.push(a),o[a]=(...o)=>{const n=o.length;if(n!==i.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+i.length+" ("+i+"), got "+n);return{fold:(...t)=>{if(t.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+t.length);return t[s].apply(null,o)},match:e=>{const n=re(e);if(t.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+n.join(","));if(!Y(t,(e=>F(n,e))))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+t.join(", "));return e[a].apply(null,o)},log:e=>{console.log(e,{constructors:t,constructor:a,params:o})}}}})),o};Ms([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);const Ds=(e,t)=>((e,t)=>({[e]:t}))(e,t),Bs=e=>(e=>{const t={};return V(e,(e=>{t[e.key]=e.value})),t})(e),Is=e=>p(e)?e:T,Fs=(e,t,o)=>{let n=e.dom;const s=Is(o);for(;n.parentNode;){n=n.parentNode;const e=ze(n),o=t(e);if(o.isSome())return o;if(s(e))break}return A.none()},Rs=(e,t,o)=>{const n=t(e),s=Is(o);return n.orThunk((()=>s(e)?A.none():Fs(e,t,s)))},Ns=(e,t)=>Ze(e.element,t.event.target),zs={can:E,abort:T,run:b},Ls=e=>{if(!ve(e,"can")&&!ve(e,"abort")&&!ve(e,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(e,null,2)+" does not have can, abort, or run!");return{...zs,...e}},Vs=y,Hs=Vs("touchstart"),Ps=Vs("touchmove"),Us=Vs("touchend"),Ws=Vs("touchcancel"),js=Vs("mousedown"),$s=Vs("mousemove"),Gs=Vs("mouseout"),qs=Vs("mouseup"),Ys=Vs("mouseover"),Xs=Vs("focusin"),Ks=Vs("focusout"),Js=Vs("keydown"),Qs=Vs("keyup"),Zs=Vs("input"),er=Vs("change"),tr=Vs("click"),or=Vs("transitioncancel"),nr=Vs("transitionend"),sr=Vs("transitionstart"),rr=Vs("selectstart"),ar=e=>y("alloy."+e),ir={tap:ar("tap")},lr=ar("focus"),cr=ar("blur.post"),dr=ar("paste.post"),ur=ar("receive"),mr=ar("execute"),gr=ar("focus.item"),pr=ir.tap,hr=ar("longpress"),fr=ar("sandbox.close"),br=ar("typeahead.cancel"),vr=ar("system.init"),xr=ar("system.touchmove"),yr=ar("system.touchend"),wr=ar("system.scroll"),Sr=ar("system.resize"),Cr=ar("system.attached"),kr=ar("system.detached"),Or=ar("system.dismissRequested"),_r=ar("system.repositionRequested"),Tr=ar("focusmanager.shifted"),Er=ar("slotcontainer.visibility"),Ar=ar("system.external.element.scroll"),Mr=ar("change.tab"),Dr=ar("dismiss.tab"),Br=ar("highlight"),Ir=ar("dehighlight"),Fr=(e,t)=>{Lr(e,e.element,t,{})},Rr=(e,t,o)=>{Lr(e,e.element,t,o)},Nr=e=>{Fr(e,mr())},zr=(e,t,o)=>{Lr(e,t,o,{})},Lr=(e,t,o,n)=>{const s={target:t,...n};e.getSystem().triggerEvent(o,t,s)},Vr=(e,t,o,n)=>{e.getSystem().triggerEvent(o,t,n.event)},Hr=e=>Bs(e),Pr=(e,t)=>({key:e,value:Ls({abort:t})}),Ur=e=>({key:e,value:Ls({run:(e,t)=>{t.event.prevent()}})}),Wr=(e,t)=>({key:e,value:Ls({run:t})}),jr=(e,t,o)=>({key:e,value:Ls({run:(e,n)=>{t.apply(void 0,[e,n].concat(o))}})}),$r=e=>t=>({key:e,value:Ls({run:(e,o)=>{Ns(e,o)&&t(e,o)}})}),Gr=(e,t,o)=>((e,t)=>Wr(e,((o,n)=>{o.getSystem().getByUid(t).each((t=>{Vr(t,t.element,e,n)}))})))(e,t.partUids[o]),qr=(e,t)=>Wr(e,((e,o)=>{const n=o.event,s=e.getSystem().getByDom(n.target).getOrThunk((()=>Rs(n.target,(t=>e.getSystem().getByDom(t).toOptional()),T).getOr(e)));t(e,s,o)})),Yr=e=>Wr(e,((e,t)=>{t.cut()})),Xr=e=>Wr(e,((e,t)=>{t.stop()})),Kr=(e,t)=>$r(e)(t),Jr=$r(Cr()),Qr=$r(kr()),Zr=$r(vr()),ea=(Qa=mr(),e=>Wr(Qa,e)),ta=e=>L(e,(e=>Ee(e,"/*")?e.substring(0,e.length-2):e)),oa=(e,t)=>{const o=e.toString(),n=o.indexOf(")")+1,s=o.indexOf("("),r=o.substring(s+1,n-1).split(/,\s*/);return e.toFunctionAnnotation=()=>({name:t,parameters:ta(r)}),e},na=e=>({classes:u(e.classes)?[]:e.classes,attributes:u(e.attributes)?{}:e.attributes,styles:u(e.styles)?{}:e.styles}),sa=(e,t,o)=>Zr(((n,s)=>{o(n,e,t)})),ra=e=>({key:e,value:void 0}),aa=(e,t,o,n,s,r,a)=>{const i=e=>ve(e,o)?e[o]():A.none(),l=le(s,((e,t)=>((e,t,o)=>((e,t,o)=>{const n=o.toString(),s=n.indexOf(")")+1,r=n.indexOf("("),a=n.substring(r+1,s-1).split(/,\s*/);return e.toFunctionAnnotation=()=>({name:t,parameters:ta(a.slice(0,1).concat(a.slice(3)))}),e})(((n,...s)=>{const r=[n].concat(s);return n.config({name:y(e)}).fold((()=>{throw new Error("We could not find any behaviour configuration for: "+e+". Using API: "+o)}),(e=>{const o=Array.prototype.slice.call(r,1);return t.apply(void 0,[n,e.config,e.state].concat(o))}))}),o,t))(o,e,t))),c={...le(r,((e,t)=>oa(e,t))),...l,revoke:C(ra,o),config:t=>{const n=Qn(o+"-config",e,t);return{key:o,value:{config:n,me:c,configAsRaw:Qt((()=>Qn(o+"-config",e,t))),initialConfig:t,state:a}}},schema:y(t),exhibit:(e,t)=>we(i(e),fe(n,"exhibit"),((e,o)=>o(t,e.config,e.state))).getOrThunk((()=>na({}))),name:y(o),handlers:e=>i(e).map((e=>fe(n,"events").getOr((()=>({})))(e.config,e.state))).getOr({})};return c},ia={init:()=>la({readState:y("No State required")})},la=e=>e,ca=e=>Bs(e),da=In([rs("fields"),rs("name"),ws("active",{}),ws("apis",{}),ws("state",ia),ws("extra",{})]),ua=e=>{const t=Qn("Creating behaviour: "+e.name,da,e);return((e,t,o,n,s,r)=>{const a=In(e),i=ys(t,[("config",l=e,ps("config",In(l)))]);var l;return aa(a,i,t,o,n,s,r)})(t.fields,t.name,t.active,t.apis,t.extra,t.state)},ma=In([rs("branchKey"),rs("branches"),rs("name"),ws("active",{}),ws("apis",{}),ws("state",ia),ws("extra",{})]),ga=e=>{const t=Qn("Creating behaviour: "+e.name,ma,e);return((e,t,o,n,s,r)=>{const a=e,i=ys(t,[ps("config",e)]);return aa(a,i,t,o,n,s,r)})(es(t.branchKey,t.branches),t.name,t.active,t.apis,t.extra,t.state)},pa=y(void 0),ha=(e,t)=>{const o=kt(e,t);return void 0===o||""===o?[]:o.split(" ")},fa=e=>void 0!==e.dom.classList,ba=e=>ha(e,"class"),va=(e,t)=>((e,t,o)=>{const n=ha(e,t).concat([o]);return St(e,t,n.join(" ")),!0})(e,"class",t),xa=(e,t)=>((e,t,o)=>{const n=P(ha(e,t),(e=>e!==o));return n.length>0?St(e,t,n.join(" ")):Tt(e,t),!1})(e,"class",t),ya=(e,t)=>{fa(e)?e.dom.classList.add(t):va(e,t)},wa=e=>{0===(fa(e)?e.dom.classList:ba(e)).length&&Tt(e,"class")},Sa=(e,t)=>{fa(e)?e.dom.classList.remove(t):xa(e,t),wa(e)},Ca=(e,t)=>fa(e)&&e.dom.classList.contains(t),ka=(e,t)=>{V(t,(t=>{ya(e,t)}))},Oa=(e,t)=>{V(t,(t=>{Sa(e,t)}))},_a=e=>fa(e)?(e=>{const t=e.dom.classList,o=new Array(t.length);for(let e=0;e<t.length;e++){const n=t.item(e);null!==n&&(o[e]=n)}return o})(e):ba(e),Ta=(e,t,o,n,s)=>{const r=e=>e+"px";return{position:e,left:t.map(r),top:o.map(r),right:n.map(r),bottom:s.map(r)}},Ea=(e,t)=>{Bt(e,(e=>({...e,position:A.some(e.position)}))(t))},Aa=e=>(xe(Rt(e,"position"),"fixed")?A.none():it(e)).orThunk((()=>{const t=Re("span");return rt(e).bind((e=>{zo(e,t);const o=it(t);return Ho(t),o}))})),Ma=e=>Aa(e).map(qt).getOrThunk((()=>$t(0,0))),Da=(e,t)=>{const o=e.element;ya(o,t.transitionClass),Sa(o,t.fadeOutClass),ya(o,t.fadeInClass),t.onShow(e)},Ba=(e,t)=>{const o=e.element;ya(o,t.transitionClass),Sa(o,t.fadeInClass),ya(o,t.fadeOutClass),t.onHide(e)},Ia=(e,t)=>e.y>=t.y,Fa=(e,t)=>e.bottom<=t.bottom,Ra=(e,t,o)=>({location:"top",leftX:t,topY:o.bounds.y-e.y}),Na=(e,t,o)=>({location:"bottom",leftX:t,bottomY:e.bottom-o.bounds.bottom}),za=e=>e.box.x-e.win.x,La=(e,t,o)=>o.getInitialPos().map((o=>{const n=((e,t)=>{const o=t.optScrollEnv.fold(y(e.bounds.y),(t=>t.scrollElmTop+(e.bounds.y-t.currentScrollTop)));return $t(e.bounds.x,o)})(o,t);return{box:Xo(n.left,n.top,Kt(e),Ut(e)),location:o.location}})),Va=(e,t,o,n,s)=>{const r=((e,t)=>{const o=t.optScrollEnv.fold(y(e.y),(t=>e.y+t.currentScrollTop-t.scrollElmTop));return $t(e.x,o)})(t,o),a=Xo(r.left,r.top,t.width,t.height);n.setInitialPos({style:Nt(e),position:It(e,"position")||"static",bounds:a,location:s.location})},Ha=(e,t,o)=>o.getInitialPos().bind((n=>{var s;switch(o.clearInitialPos(),n.position){case"static":return A.some({morph:"static"});case"absolute":const o=Aa(e).getOr(xt()),r=Ko(o),a=null!==(s=o.dom.scrollTop)&&void 0!==s?s:0;return A.some({morph:"absolute",positionCss:Ta("absolute",fe(n.style,"left").map((e=>t.x-r.x)),fe(n.style,"top").map((e=>t.y-r.y+a)),fe(n.style,"right").map((e=>r.right-t.right)),fe(n.style,"bottom").map((e=>r.bottom-t.bottom)))});default:return A.none()}})),Pa=e=>{switch(e.location){case"top":return A.some({morph:"fixed",positionCss:Ta("fixed",A.some(e.leftX),A.some(e.topY),A.none(),A.none())});case"bottom":return A.some({morph:"fixed",positionCss:Ta("fixed",A.some(e.leftX),A.none(),A.none(),A.some(e.bottomY))});default:return A.none()}},Ua=(e,t,o)=>{const n=e.element;return xe(Rt(n,"position"),"fixed")?((e,t,o)=>((e,t,o)=>La(e,t,o).filter((({box:e})=>((e,t,o)=>Y(e,(e=>{switch(e){case"bottom":return Fa(t,o.bounds);case"top":return Ia(t,o.bounds)}})))(o.getModes(),e,t))).bind((({box:t})=>Ha(e,t,o))))(e,t,o).orThunk((()=>t.optScrollEnv.bind((n=>La(e,t,o))).bind((({box:e,location:o})=>{const n=Zo(),s=za({win:n,box:e}),r="top"===o?Ra(n,s,t):Na(n,s,t);return Pa(r)})))))(n,t,o):((e,t,o)=>{const n=Ko(e),s=Zo(),r=((e,t,o)=>{const n=t.win,s=t.box,r=za(t);return se(e,(e=>{switch(e){case"bottom":return Fa(s,o.bounds)?A.none():A.some(Na(n,r,o));case"top":return Ia(s,o.bounds)?A.none():A.some(Ra(n,r,o));default:return A.none()}})).getOr({location:"no-dock"})})(o.getModes(),{win:s,box:n},t);return"top"===r.location||"bottom"===r.location?(Va(e,n,t,o,r),Pa(r)):A.none()})(n,t,o)},Wa=(e,t,o)=>{o.setDocked(!1),V(["left","right","top","bottom","position"],(t=>Lt(e.element,t))),t.onUndocked(e)},ja=(e,t,o,n)=>{const s="fixed"===n.position;o.setDocked(s),Ea(e.element,n),(s?t.onDocked:t.onUndocked)(e)},$a=(e,t,o,n,s=!1)=>{t.contextual.each((t=>{t.lazyContext(e).each((r=>{const a=((e,t)=>e.y<t.bottom&&e.bottom>t.y)(r,n.bounds);a!==o.isVisible()&&(o.setVisible(a),s&&!a?(ka(e.element,[t.fadeOutClass]),t.onHide(e)):(a?Da:Ba)(e,t))}))}))},Ga=(e,t,o,n,s)=>{$a(e,t,o,n,!0),ja(e,t,o,s.positionCss)},qa=(e,t,o)=>{e.getSystem().isConnected()&&((e,t,o)=>{const n=t.lazyViewport(e);$a(e,t,o,n),Ua(e,n,o).each((s=>{((e,t,o,n,s)=>{switch(s.morph){case"static":return Wa(e,t,o);case"absolute":return ja(e,t,o,s.positionCss);case"fixed":Ga(e,t,o,n,s)}})(e,t,o,n,s)}))})(e,t,o)},Ya=(e,t,o)=>{o.isDocked()&&((e,t,o)=>{const n=e.element;o.setDocked(!1);const s=t.lazyViewport(e);((e,t,o)=>{const n=e.element;return La(n,t,o).bind((({box:e})=>Ha(n,e,o)))})(e,s,o).each((n=>{switch(n.morph){case"static":Wa(e,t,o);break;case"absolute":ja(e,t,o,n.positionCss)}})),o.setVisible(!0),t.contextual.each((t=>{Oa(n,[t.fadeInClass,t.fadeOutClass,t.transitionClass]),t.onShow(e)})),qa(e,t,o)})(e,t,o)},Xa=e=>(t,o,n)=>{const s=o.lazyViewport(t);((e,t,o,n)=>{const s=Ko(e),r=Zo(),a=n(r,za({win:r,box:s}),t);return"bottom"===a.location||"top"===a.location?(((e,t,o,n,s)=>{n.getInitialPos().fold((()=>Va(e,t,o,n,s)),(()=>b))})(e,s,t,o,a),Pa(a)):A.none()})(t.element,s,n,e).each((e=>{Ga(t,o,n,s,e)}))},Ka=Xa(Ra),Ja=Xa(Na);var Qa,Za=Object.freeze({__proto__:null,refresh:qa,reset:Ya,isDocked:(e,t,o)=>o.isDocked(),getModes:(e,t,o)=>o.getModes(),setModes:(e,t,o,n)=>o.setModes(n),forceDockToTop:Ka,forceDockToBottom:Ja}),ei=Object.freeze({__proto__:null,events:(e,t)=>Hr([Kr(nr(),((o,n)=>{e.contextual.each((e=>{Ca(o.element,e.transitionClass)&&(Oa(o.element,[e.transitionClass,e.fadeInClass]),(t.isVisible()?e.onShown:e.onHidden)(o)),n.stop()}))})),Wr(wr(),((o,n)=>{qa(o,e,t)})),Wr(Ar(),((o,n)=>{qa(o,e,t)})),Wr(Sr(),((o,n)=>{Ya(o,e,t)}))])});const ti=e=>e.dom.innerHTML,oi=(e,t)=>{const o=tt(e).dom,n=ze(o.createDocumentFragment()),s=((e,t)=>{const o=(t||document).createElement("div");return o.innerHTML=e,lt(ze(o))})(t,o);Lo(n,s),Vo(e),zo(e,n)},ni=(e,t)=>ze(e.dom.cloneNode(t)),si=e=>(e=>{if(gt(e))return"#shadow-root";{const t=(e=>ni(e,!1))(e);return(e=>{const t=Re("div"),o=ze(e.dom.cloneNode(!0));return zo(t,o),ti(t)})(t)}})(e);var ri;!function(e){e[e.STOP=0]="STOP",e[e.NORMAL=1]="NORMAL",e[e.LOGGING=2]="LOGGING"}(ri||(ri={}));const ai=en({}),ii=["alloy/data/Fields","alloy/debugging/Debugging"],li=(e,t,o)=>((e,t,o)=>{switch(fe(ai.get(),e).orThunk((()=>{const t=re(ai.get());return se(t,(t=>e.indexOf(t)>-1?A.some(ai.get()[t]):A.none()))})).getOr(ri.NORMAL)){case ri.NORMAL:return o(ci());case ri.LOGGING:{const n=((e,t)=>{const o=[],n=(new Date).getTime();return{logEventCut:(e,t,n)=>{o.push({outcome:"cut",target:t,purpose:n})},logEventStopped:(e,t,n)=>{o.push({outcome:"stopped",target:t,purpose:n})},logNoParent:(e,t,n)=>{o.push({outcome:"no-parent",target:t,purpose:n})},logEventNoHandlers:(e,t)=>{o.push({outcome:"no-handlers-left",target:t})},logEventResponse:(e,t,n)=>{o.push({outcome:"response",purpose:n,target:t})},write:()=>{const s=(new Date).getTime();F(["mousemove","mouseover","mouseout",vr()],e)||console.log(e,{event:e,time:s-n,target:t.dom,sequence:L(o,(e=>F(["cut","stopped","response"],e.outcome)?"{"+e.purpose+"} "+e.outcome+" at ("+si(e.target)+")":e.outcome))})}}})(e,t),s=o(n);return n.write(),s}case ri.STOP:return!0}})(e,t,o),ci=y({logEventCut:b,logEventStopped:b,logNoParent:b,logEventNoHandlers:b,logEventResponse:b,write:b}),di=y([rs("menu"),rs("selectedMenu")]),ui=y([rs("item"),rs("selectedItem")]);y(Fn(ui().concat(di())));const mi=y(Fn(ui())),gi=ds("initSize",[rs("numColumns"),rs("numRows")]),pi=()=>ds("markers",[rs("backgroundMenu")].concat(di()).concat(ui())),hi=e=>ds("markers",L(e,rs)),fi=(e,t,o)=>((()=>{const e=new Error;if(void 0!==e.stack){const t=e.stack.split("\n");j(t,(e=>e.indexOf("alloy")>0&&!R(ii,(t=>e.indexOf(t)>-1)))).getOr("unknown")}})(),os(t,t,o,Yn((e=>ln.value(((...t)=>e.apply(void 0,t))))))),bi=e=>fi(0,e,Sn(b)),vi=e=>fi(0,e,Sn(A.none)),xi=e=>fi(0,e,{tag:"required",process:{}}),yi=e=>fi(0,e,{tag:"required",process:{}}),wi=(e,t)=>ns(e,y(t)),Si=e=>ns(e,w),Ci=y(gi);var ki=[ys("contextual",[is("fadeInClass"),is("fadeOutClass"),is("transitionClass"),cs("lazyContext"),bi("onShow"),bi("onShown"),bi("onHide"),bi("onHidden")]),Ts("lazyViewport",(()=>({bounds:Zo(),optScrollEnv:A.none()}))),Es("modes",["top","bottom"],Un),bi("onDocked"),bi("onUndocked")];const Oi=ua({fields:ki,name:"docking",active:ei,apis:Za,state:Object.freeze({__proto__:null,init:e=>{const t=en(!1),o=en(!0),n=nn(),s=en(e.modes);return la({isDocked:t.get,setDocked:t.set,getInitialPos:n.get,setInitialPos:n.set,clearInitialPos:n.clear,isVisible:o.get,setVisible:o.set,getModes:s.get,setModes:s.set,readState:()=>`docked: ${t.get()}, visible: ${o.get()}, modes: ${s.get().join(",")}`})}})}),_i=Hr([((e,t)=>({key:e,value:Ls({can:(e,t)=>{const o=t.event,n=o.originator,s=o.target;return!((e,t,o)=>Ze(t,e.element)&&!Ze(t,o))(e,n,s)||(console.warn(lr()+" did not get interpreted by the desired target. \nOriginator: "+si(n)+"\nTarget: "+si(s)+"\nCheck the "+lr()+" event handlers"),!1)}})}))(lr())]);var Ti=Object.freeze({__proto__:null,events:_i});const Ei=(e,t,o,n)=>{const s=e+t;return s>n?o:s<o?n:s},Ai=(e,t,o)=>Math.min(Math.max(e,t),o);let Mi=0;const Di=e=>{const t=(new Date).getTime(),o=Math.floor(window.crypto.getRandomValues(new Uint32Array(1))[0]/4294967295*1e9);return Mi++,e+"_"+o+Mi+String(t)},Bi=y("alloy-id-"),Ii=y("data-alloy-id"),Fi=Bi(),Ri=Ii(),Ni=(e,t)=>{Object.defineProperty(e.dom,Ri,{value:t,writable:!0})},zi=e=>{const t=$e(e)?e.dom[Ri]:null;return A.from(t)},Li=e=>Di(e),Vi=w,Hi=e=>{const t=t=>`The component must be in a context to execute: ${t}`+(e?"\n"+si(e().element)+" is not in context.":""),o=e=>()=>{throw new Error(t(e))},n=e=>()=>{console.warn(t(e))};return{debugInfo:y("fake"),triggerEvent:n("triggerEvent"),triggerFocus:n("triggerFocus"),triggerEscape:n("triggerEscape"),broadcast:n("broadcast"),broadcastOn:n("broadcastOn"),broadcastEvent:n("broadcastEvent"),build:o("build"),buildOrPatch:o("buildOrPatch"),addToWorld:o("addToWorld"),removeFromWorld:o("removeFromWorld"),addToGui:o("addToGui"),removeFromGui:o("removeFromGui"),getByUid:o("getByUid"),getByDom:o("getByDom"),isConnected:T}},Pi=Hi(),Ui=Di("alloy-premade"),Wi=e=>(Object.defineProperty(e.element.dom,Ui,{value:e.uid,writable:!0}),Ds(Ui,e)),ji=e=>fe(e,Ui),$i=e=>((e,t)=>{const o=t.toString(),n=o.indexOf(")")+1,s=o.indexOf("("),r=o.substring(s+1,n-1).split(/,\s*/);return e.toFunctionAnnotation=()=>({name:"OVERRIDE",parameters:ta(r.slice(1))}),e})(((t,...o)=>e(t.getApis(),t,...o)),e),Gi=(e,t)=>{const o={};return ie(e,((e,n)=>{ie(e,((e,s)=>{const r=fe(o,s).getOr([]);o[s]=r.concat([t(n,e)])}))})),o},qi=e=>e.cHandler,Yi=(e,t)=>({name:e,handler:t}),Xi=(e,t)=>{const o={};return V(e,(e=>{o[e.name()]=e.handlers(t)})),o},Ki=(e,t,o)=>{const n=t[o];return n?((e,t,o,n)=>{try{const s=Z(o,((o,s)=>{const r=o[t],a=s[t],i=n.indexOf(r),l=n.indexOf(a);if(-1===i)throw new Error("The ordering for "+e+" does not have an entry for "+r+".\nOrder specified: "+JSON.stringify(n,null,2));if(-1===l)throw new Error("The ordering for "+e+" does not have an entry for "+a+".\nOrder specified: "+JSON.stringify(n,null,2));return i<l?-1:l<i?1:0}));return ln.value(s)}catch(e){return ln.error([e])}})("Event: "+o,"name",e,n).map((e=>(e=>{const t=((e,t)=>(...t)=>W(e,((e,o)=>e&&(e=>e.can)(o).apply(void 0,t)),!0))(e),o=((e,t)=>(...t)=>W(e,((e,o)=>e||(e=>e.abort)(o).apply(void 0,t)),!1))(e);return{can:t,abort:o,run:(...t)=>{V(e,(e=>{e.run.apply(void 0,t)}))}}})(L(e,(e=>e.handler))))):((e,t)=>ln.error(["The event ("+e+') 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: '+JSON.stringify(L(t,(e=>e.name)),null,2)]))(o,e)},Ji=(e,t)=>((e,t)=>{const o=(e=>{const t=[],o=[];return V(e,(e=>{e.fold((e=>{t.push(e)}),(e=>{o.push(e)}))})),{errors:t,values:o}})(e);return o.errors.length>0?(n=o.errors,ln.error(G(n))):((e,t)=>0===e.length?ln.value(t):ln.value(xn(t,yn.apply(void 0,e))))(o.values,t);var n})(ge(e,((e,o)=>(1===e.length?ln.value(e[0].handler):Ki(e,t,o)).map((n=>{const s=(e=>{const t=(e=>p(e)?{can:E,abort:T,run:e}:e)(e);return(e,o,...n)=>{const s=[e,o].concat(n);t.abort.apply(void 0,s)?o.stop():t.can.apply(void 0,s)&&t.run.apply(void 0,s)}})(n),r=e.length>1?P(t[o],(t=>R(e,(e=>e.name===t)))).join(" > "):e[0].name;return Ds(o,((e,t)=>({handler:e,purpose:t}))(s,r))})))),{}),Qi="alloy.base.behaviour",Zi=Fn([os("dom","dom",{tag:"required",process:{}},Fn([rs("tag"),ws("styles",{}),ws("classes",[]),ws("attributes",{}),gs("value"),gs("innerHtml")])),rs("components"),rs("uid"),ws("events",{}),ws("apis",{}),os("eventOrder","eventOrder",(fl={[mr()]:["disabling",Qi,"toggling","typeaheadevents"],[lr()]:[Qi,"focusing","keying"],[vr()]:[Qi,"disabling","toggling","representing","tooltipping"],[Zs()]:[Qi,"representing","streaming","invalidating"],[kr()]:[Qi,"representing","item-events","toolbar-button-events","tooltipping"],[js()]:["focusing",Qi,"item-type-events"],[Hs()]:["focusing",Qi,"item-type-events"],[Ys()]:["item-type-events","tooltipping"],[ur()]:["receiving","reflecting","tooltipping"]},Cn(y(fl))),Vn()),gs("domModification")]),el=e=>e.events,tl=e=>e.dom.value,ol=(e,t)=>{if(void 0===t)throw new Error("Value.set was undefined");e.dom.value=t},nl=(e,t,o)=>{o.fold((()=>zo(e,t)),(e=>{Ze(e,t)||(Fo(e,t),Ho(e))}))},sl=(e,t,o)=>{const n=L(t,o),s=lt(e);return V(s.slice(n.length),Ho),n},rl=(e,t,o,n)=>{const s=ct(e,t),r=n(o,s),a=((e,t,o)=>ct(e,t).map((e=>{if(o.exists((t=>!Ze(t,e)))){const t=o.map(Ue).getOr("span"),n=Re(t);return Fo(e,n),n}return e})))(e,t,s);return nl(e,r.element,a),r},al=(e,t)=>{const o=re(e),n=re(t),s=K(n,o),r=((e,o)=>{const n={},s={};return ue(e,((e,o)=>!be(t,o)||e!==t[o]),de(n),de(s)),{t:n,f:s}})(e).t;return{toRemove:s,toSet:r}},il=(e,t)=>{const o=t.filter((t=>Ue(t)===e.tag&&!(e=>e.innerHtml.isSome()&&e.domChildren.length>0)(e)&&!(e=>be(e.dom,Ui))(t))).bind((t=>((e,t)=>{try{const o=((e,t)=>{const{class:o,style:n,...s}=(e=>W(e.dom.attributes,((e,t)=>(e[t.name]=t.value,e)),{}))(t),{toSet:r,toRemove:a}=al(e.attributes,s),i=Nt(t),{toSet:l,toRemove:c}=al(e.styles,i),d=_a(t),u=K(d,e.classes),m=K(e.classes,d);return V(a,(e=>Tt(t,e))),Ct(t,r),ka(t,m),Oa(t,u),V(c,(e=>Lt(t,e))),Dt(t,l),e.innerHtml.fold((()=>{const o=e.domChildren;((e,t)=>{sl(e,t,((t,o)=>{const n=ct(e,o);return nl(e,t,n),t}))})(t,o)}),(e=>{oi(t,e)})),(()=>{const o=t,n=e.value.getOrUndefined();n!==tl(o)&&ol(o,null!=n?n:"")})(),t})(e,t);return A.some(o)}catch(e){return A.none()}})(e,t))).getOrThunk((()=>(e=>{const t=Re(e.tag);Ct(t,e.attributes),ka(t,e.classes),Dt(t,e.styles),e.innerHtml.each((e=>oi(t,e)));const o=e.domChildren;return Lo(t,o),e.value.each((e=>{ol(t,e)})),t})(e)));return Ni(o,e.uid),o},ll=e=>{const t=(e=>{const t=fe(e,"behaviours").getOr({});return q(re(t),(e=>{const o=t[e];return g(o)?[o.me]:[]}))})(e);return((e,t)=>((e,t)=>{const o=L(t,(e=>ys(e.name(),[rs("config"),ws("state",ia)]))),n=Kn("component.behaviours",Fn(o),e.behaviours).fold((t=>{throw new Error(Zn(t)+"\nComplete spec:\n"+JSON.stringify(e,null,2))}),w);return{list:t,data:le(n,(e=>{const t=e.map((e=>({config:e.config,state:e.state.init(e.config)})));return y(t)}))}})(e,t))(e,t)},cl=(e,t)=>{const o=()=>m,n=en(Pi),s=Jn((e=>Kn("custom.definition",Zi,e))(e)),r=ll(e),a=(e=>e.list)(r),i=(e=>e.data)(r),l=((e,t,o)=>{const n={...(s=e).dom,uid:s.uid,domChildren:L(s.components,(e=>e.element))};var s;const r=(e=>e.domModification.fold((()=>na({})),na))(e),a={"alloy.base.modification":r},i=t.length>0?((e,t,o,n)=>{const s={...t};V(o,(t=>{s[t.name()]=t.exhibit(e,n)}));const r=Gi(s,((e,t)=>({name:e,modification:t}))),a=e=>U(e,((e,t)=>({...t.modification,...e})),{}),i=U(r.classes,((e,t)=>t.modification.concat(e)),[]),l=a(r.attributes),c=a(r.styles);return na({classes:i,attributes:l,styles:c})})(o,a,t,n):r;return l=n,c=i,{...l,attributes:{...l.attributes,...c.attributes},styles:{...l.styles,...c.styles},classes:l.classes.concat(c.classes)};var l,c})(s,a,i),c=il(l,t),d=((e,t,o)=>{const n={"alloy.base.behaviour":el(e)};return((e,t,o,n)=>{const s=((e,t,o)=>{const n={...o,...Xi(t,e)};return Gi(n,Yi)})(e,o,n);return Ji(s,t)})(o,e.eventOrder,t,n).getOrDie()})(s,a,i),u=en(s.components),m={uid:e.uid,getSystem:n.get,config:t=>{const o=i;return(p(o[t.name()])?o[t.name()]:()=>{throw new Error("Could not find "+t.name()+" in "+JSON.stringify(e,null,2))})()},hasConfigured:e=>p(i[e.name()]),spec:e,readState:e=>i[e]().map((e=>e.state.readState())).getOr("not enabled"),getApis:()=>s.apis,connect:e=>{n.set(e)},disconnect:()=>{n.set(Hi(o))},element:c,syncComponents:()=>{const e=lt(c),t=q(e,(e=>n.get().getByDom(e).fold((()=>[]),Q)));u.set(t)},components:u.get,events:d};return m},dl=e=>{const t=Ne(e);return ul({element:t})},ul=e=>{const t=Qn("external.component",In([rs("element"),gs("uid")]),e),o=en(Hi()),n=t.uid.getOrThunk((()=>Li("external")));Ni(t.element,n);const s={uid:n,getSystem:o.get,config:A.none,hasConfigured:T,connect:e=>{o.set(e)},disconnect:()=>{o.set(Hi((()=>s)))},getApis:()=>({}),element:t.element,spec:e,readState:y("No state"),syncComponents:b,components:y([]),events:{}};return Wi(s)},ml=Li,gl=(e,t)=>ji(e).getOrThunk((()=>((e,t)=>{const{events:o,...n}=Vi(e),s=((e,t)=>{const o=fe(e,"components").getOr([]);return t.fold((()=>L(o,pl)),(e=>L(o,((t,o)=>gl(t,ct(e,o))))))})(n,t),r={...n,events:{...Ti,...o},components:s};return ln.value(cl(r,t))})((e=>be(e,"uid"))(e)?e:{uid:ml(""),...e},t).getOrDie())),pl=e=>gl(e,A.none()),hl=Wi;var fl,bl=(e,t,o,n,s)=>e(o,n)?A.some(o):p(s)&&s(o)?A.none():t(o,n,s);const vl=(e,t,o)=>{let n=e.dom;const s=p(o)?o:T;for(;n.parentNode;){n=n.parentNode;const e=ze(n);if(t(e))return A.some(e);if(s(e))break}return A.none()},xl=(e,t,o)=>bl(((e,t)=>t(e)),vl,e,t,o),yl=(e,t)=>j(e.dom.childNodes,(e=>t(ze(e)))).map(ze),wl=(e,t,o)=>xl(e,t,o).isSome(),Sl=(e,t,o)=>vl(e,(e=>Ke(e,t)),o),Cl=(e,t)=>((e,o)=>{const n=e.dom;return n.parentNode?yl(ze(n.parentNode),(o=>!Ze(e,o)&&Ke(o,t))):A.none()})(e),kl=(e,t)=>yl(e,(e=>Ke(e,t))),Ol=(e,t)=>Qe(t,e),_l=(e,t,o)=>bl(((e,t)=>Ke(e,t)),Sl,e,t,o),Tl="aria-controls",El=()=>{const e=Di(Tl);return{id:e,link:t=>{St(t,Tl,e)},unlink:e=>{Tt(e,Tl)}}},Al=(e,t)=>wl(t,(t=>Ze(t,e.element)),T)||((e,t)=>(e=>xl(e,(e=>{if(!$e(e))return!1;const t=kt(e,"id");return void 0!==t&&t.indexOf(Tl)>-1})).bind((e=>{const t=kt(e,"id"),o=pt(e);return Ol(o,`[${Tl}="${t}"]`)})))(t).exists((t=>Al(e,t))))(e,t),Ml=(e,t,o,n,s,r,a,i=!1)=>({x:e,y:t,bubble:o,direction:n,placement:s,restriction:r,label:`${a}-${s}`,alwaysFit:i}),Dl=Ms([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),Bl=Dl.southeast,Il=Dl.southwest,Fl=Dl.northeast,Rl=Dl.northwest,Nl=Dl.south,zl=Dl.north,Ll=Dl.east,Vl=Dl.west,Hl=(e,t)=>J(["left","right","top","bottom"],(o=>fe(t,o).map((t=>((e,t)=>{switch(t){case 1:return e.x;case 0:return e.x+e.width;case 2:return e.y;case 3:return e.y+e.height}})(e,t))))),Pl="layout",Ul=e=>e.x,Wl=(e,t)=>e.x+e.width/2-t.width/2,jl=(e,t)=>e.x+e.width-t.width,$l=(e,t)=>e.y-t.height,Gl=e=>e.y+e.height,ql=(e,t)=>e.y+e.height/2-t.height/2,Yl=(e,t,o)=>Ml(Ul(e),Gl(e),o.southeast(),Bl(),"southeast",Hl(e,{left:1,top:3}),Pl),Xl=(e,t,o)=>Ml(jl(e,t),Gl(e),o.southwest(),Il(),"southwest",Hl(e,{right:0,top:3}),Pl),Kl=(e,t,o)=>Ml(Ul(e),$l(e,t),o.northeast(),Fl(),"northeast",Hl(e,{left:1,bottom:2}),Pl),Jl=(e,t,o)=>Ml(jl(e,t),$l(e,t),o.northwest(),Rl(),"northwest",Hl(e,{right:0,bottom:2}),Pl),Ql=(e,t,o)=>Ml(Wl(e,t),$l(e,t),o.north(),zl(),"north",Hl(e,{bottom:2}),Pl),Zl=(e,t,o)=>Ml(Wl(e,t),Gl(e),o.south(),Nl(),"south",Hl(e,{top:3}),Pl),ec=(e,t,o)=>Ml((e=>e.x+e.width)(e),ql(e,t),o.east(),Ll(),"east",Hl(e,{left:0}),Pl),tc=(e,t,o)=>Ml(((e,t)=>e.x-t.width)(e,t),ql(e,t),o.west(),Vl(),"west",Hl(e,{right:1}),Pl),oc=()=>[Yl,Xl,Kl,Jl,Zl,Ql,ec,tc],nc=()=>[Xl,Yl,Jl,Kl,Zl,Ql,ec,tc],sc=()=>[Kl,Jl,Yl,Xl,Ql,Zl],rc=()=>[Jl,Kl,Xl,Yl,Ql,Zl],ac=()=>[Yl,Xl,Kl,Jl,Zl,Ql],ic=()=>[Xl,Yl,Jl,Kl,Zl,Ql];var lc=Object.freeze({__proto__:null,events:e=>Hr([Wr(ur(),((t,o)=>{const n=e.channels,s=re(n),r=o,a=((e,t)=>t.universal?e:P(e,(e=>F(t.channels,e))))(s,r);V(a,(e=>{const o=n[e],s=o.schema,a=Qn("channel["+e+"] data\nReceiver: "+si(t.element),s,r.data);o.onReceive(t,a)}))}))])}),cc=[as("channels",Xn(ln.value,In([xi("onReceive"),ws("schema",Vn())])))];const dc=ua({fields:cc,name:"receiving",active:lc});var uc=Object.freeze({__proto__:null,exhibit:(e,t)=>na({classes:[],styles:t.useFixed()?{}:{position:"relative"}})});const mc=(e,t=!1)=>e.dom.focus({preventScroll:t}),gc=e=>e.dom.blur(),pc=e=>{const t=pt(e).dom;return e.dom===t.activeElement},hc=(e=$o())=>A.from(e.dom.activeElement).map(ze),fc=e=>hc(pt(e)).filter((t=>e.dom.contains(t.dom))),bc=(e,t)=>{const o=pt(t),n=hc(o).bind((e=>{const o=t=>Ze(e,t);return o(t)?A.some(t):((e,t)=>{const o=e=>{for(let n=0;n<e.childNodes.length;n++){const s=ze(e.childNodes[n]);if(t(s))return A.some(s);const r=o(e.childNodes[n]);if(r.isSome())return r}return A.none()};return o(e.dom)})(t,o)})),s=e(t);return n.each((e=>{hc(o).filter((t=>Ze(t,e))).fold((()=>{mc(e)}),b)})),s},vc=Ms([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),xc=(e,t,o,n,s,r)=>{const a=t.rect,i=a.x-o,l=a.y-n,c=s-(i+a.width),d=r-(l+a.height),u=A.some(i),m=A.some(l),g=A.some(c),p=A.some(d),h=A.none();return t.direction.fold((()=>Ta(e,u,m,h,h)),(()=>Ta(e,h,m,g,h)),(()=>Ta(e,u,h,h,p)),(()=>Ta(e,h,h,g,p)),(()=>Ta(e,u,m,h,h)),(()=>Ta(e,u,h,h,p)),(()=>Ta(e,u,m,h,h)),(()=>Ta(e,h,m,g,h)))},yc=(e,t)=>e.fold((()=>{const e=t.rect;return Ta("absolute",A.some(e.x),A.some(e.y),A.none(),A.none())}),((e,o,n,s)=>xc("absolute",t,e,o,n,s)),((e,o,n,s)=>xc("fixed",t,e,o,n,s))),wc=(e,t)=>{const o=C(Yo,t),n=e.fold(o,o,(()=>{const e=Po();return Yo(t).translate(-e.left,-e.top)})),s=Jt(t),r=Wt(t);return Xo(n.left,n.top,s,r)},Sc=(e,t)=>t.fold((()=>e.fold(Zo,Zo,Xo)),(t=>e.fold(y(t),y(t),(()=>{const o=Cc(e,t.x,t.y);return Xo(o.left,o.top,t.width,t.height)})))),Cc=(e,t,o)=>{const n=$t(t,o);return e.fold(y(n),y(n),(()=>{const e=Po();return n.translate(-e.left,-e.top)}))};vc.none;const kc=vc.relative,Oc=vc.fixed,_c="data-alloy-placement",Tc=e=>Ot(e,_c),Ec=Ms([{fit:["reposition"]},{nofit:["reposition","visibleW","visibleH","isVisible"]}]),Ac=(e,t,o,n)=>{const s=e.bubble,r=s.offset,a=((e,t,o)=>{const n=(n,s)=>t[n].map((t=>{const r="top"===n||"bottom"===n,a=r?o.top:o.left,i=("left"===n||"top"===n?Math.max:Math.min)(t,s)+a;return r?Ai(i,e.y,e.bottom):Ai(i,e.x,e.right)})).getOr(s),s=n("left",e.x),r=n("top",e.y),a=n("right",e.right),i=n("bottom",e.bottom);return Xo(s,r,a-s,i-r)})(n,e.restriction,r),i=e.x+r.left,l=e.y+r.top,c=Xo(i,l,t,o),{originInBounds:d,sizeInBounds:u,visibleW:m,visibleH:g}=((e,t)=>{const{x:o,y:n,right:s,bottom:r}=t,{x:a,y:i,right:l,bottom:c,width:d,height:u}=e;return{originInBounds:a>=o&&a<=s&&i>=n&&i<=r,sizeInBounds:l<=s&&l>=o&&c<=r&&c>=n,visibleW:Math.min(d,a>=o?s-a:l-o),visibleH:Math.min(u,i>=n?r-i:c-n)}})(c,a),p=d&&u,h=p?c:((e,t)=>{const{x:o,y:n,right:s,bottom:r}=t,{x:a,y:i,width:l,height:c}=e,d=Math.max(o,s-l),u=Math.max(n,r-c),m=Ai(a,o,d),g=Ai(i,n,u),p=Math.min(m+l,s)-m,h=Math.min(g+c,r)-g;return Xo(m,g,p,h)})(c,a),f=h.width>0&&h.height>0,{maxWidth:b,maxHeight:v}=((e,t,o)=>{const n=y(t.bottom-o.y),s=y(o.bottom-t.y),r=((e,t,o,n)=>e.fold(t,t,n,n,t,n,o,o))(e,s,s,n),a=y(t.right-o.x),i=y(o.right-t.x),l=((e,t,o,n)=>e.fold(t,n,t,n,o,o,t,n))(e,i,i,a);return{maxWidth:l,maxHeight:r}})(e.direction,h,n),x={rect:h,maxHeight:v,maxWidth:b,direction:e.direction,placement:e.placement,classes:{on:s.classesOn,off:s.classesOff},layout:e.label,testY:l};return p||e.alwaysFit?Ec.fit(x):Ec.nofit(x,m,g,f)},Mc=E,Dc=(e,t,o)=>((e,t,o,n)=>Bo(e,t,o,n,!1))(e,t,Mc,o),Bc=(e,t,o)=>((e,t,o,n)=>Bo(e,t,o,n,!0))(e,t,Mc,o),Ic=Do,Fc=["top","bottom","right","left"],Rc="data-alloy-transition-timer",Nc=(e,t,o,n,s,a)=>{const i=((e,t,o)=>o.exists((o=>{const n=e.mode;return"all"===n||o[n]!==t[n]})))(n,s,a);if(i||((e,t)=>((e,t)=>Y(t,(t=>Ca(e,t))))(e,t.classes))(e,n)){Mt(e,"position",o.position);const a=wc(t,e),l=yc(t,{...s,rect:a}),c=J(Fc,(e=>l[e]));((e,t)=>{const o=e=>parseFloat(e).toFixed(3);return pe(t,((t,n)=>!((e,t,o=S)=>we(e,t,o).getOr(e.isNone()&&t.isNone()))(e[n].map(o),t.map(o)))).isSome()})(o,c)&&(Bt(e,c),i&&((e,t)=>{ka(e,t.classes),Ot(e,Rc).each((t=>{clearTimeout(parseInt(t,10)),Tt(e,Rc)})),((e,t)=>{const o=on(),n=on();let s;const a=t=>{var o;const n=null!==(o=t.raw.pseudoElement)&&void 0!==o?o:"";return Ze(t.target,e)&&De(n)&&F(Fc,t.raw.propertyName)},i=r=>{if(m(r)||a(r)){o.clear(),n.clear();const a=null==r?void 0:r.raw.type;(m(a)||a===nr())&&(clearTimeout(s),Tt(e,Rc),Oa(e,t.classes))}},l=Dc(e,sr(),(t=>{a(t)&&(l.unbind(),o.set(Dc(e,nr(),i)),n.set(Dc(e,or(),i)))})),c=(e=>{const t=t=>{const o=It(e,t).split(/\s*,\s*/);return P(o,Me)},o=e=>{if(r(e)&&/^[\d.]+/.test(e)){const t=parseFloat(e);return Ee(e,"ms")?t:1e3*t}return 0},n=t("transition-delay"),s=t("transition-duration");return W(s,((e,t,s)=>{const r=o(n[s])+o(t);return Math.max(e,r)}),0)})(e);requestAnimationFrame((()=>{s=setTimeout(i,c+17),St(e,Rc,s)}))})(e,t)})(e,n),Vt(e))}else Oa(e,n.classes)},zc=(e,t)=>{((e,t)=>{const o=Pt.max(e,t,["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"]);Mt(e,"max-height",o+"px")})(e,Math.floor(t))},Lc=y(((e,t)=>{zc(e,t),Dt(e,{"overflow-x":"hidden","overflow-y":"auto"})})),Vc=y(((e,t)=>{zc(e,t)})),Hc=(e,t,o)=>void 0===e[t]?o:e[t],Pc=(e,t,o,n)=>{const s=((e,t,o,n)=>{Lt(t,"max-height"),Lt(t,"max-width");const s={width:Jt(r=t),height:Wt(r)};var r;return((e,t,o,n,s,r)=>{const a=n.width,i=n.height,l=(t,l,c,d,u)=>{const m=t(o,n,s,e,r),g=Ac(m,a,i,r);return g.fold(y(g),((e,t,o,n)=>(u===n?o>d||t>c:!u&&n)?g:Ec.nofit(l,c,d,u)))};return W(t,((e,t)=>{const o=C(l,t);return e.fold(y(e),o)}),Ec.nofit({rect:o,maxHeight:n.height,maxWidth:n.width,direction:Bl(),placement:"southeast",classes:{on:[],off:[]},layout:"none",testY:o.y},-1,-1,!1)).fold(w,w)})(t,n.preference,e,s,o,n.bounds)})(e,t,o,n);return((e,t,o)=>{const n=yc(o.origin,t);o.transition.each((s=>{Nc(e,o.origin,n,s,t,o.lastPlacement)})),Ea(e,n)})(t,s,n),((e,t)=>{((e,t)=>{St(e,_c,t)})(e,t.placement)})(t,s),((e,t)=>{const o=t.classes;Oa(e,o.off),ka(e,o.on)})(t,s),((e,t,o)=>{(0,o.maxHeightFunction)(e,t.maxHeight)})(t,s,n),((e,t,o)=>{(0,o.maxWidthFunction)(e,t.maxWidth)})(t,s,n),{layout:s.layout,placement:s.placement}},Uc=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right","inset"],Wc=(e,t,o,n=1)=>{const s=e*n,r=t*n,a=e=>fe(o,e).getOr([]),i=(e,t,o)=>{const n=K(Uc,o);return{offset:$t(e,t),classesOn:q(o,a),classesOff:q(n,a)}};return{southeast:()=>i(-e,t,["top","alignLeft"]),southwest:()=>i(e,t,["top","alignRight"]),south:()=>i(-e/2,t,["top","alignCentre"]),northeast:()=>i(-e,-t,["bottom","alignLeft"]),northwest:()=>i(e,-t,["bottom","alignRight"]),north:()=>i(-e/2,-t,["bottom","alignCentre"]),east:()=>i(e,-t/2,["valignCentre","left"]),west:()=>i(-e,-t/2,["valignCentre","right"]),insetNortheast:()=>i(s,r,["top","alignLeft","inset"]),insetNorthwest:()=>i(-s,r,["top","alignRight","inset"]),insetNorth:()=>i(-s/2,r,["top","alignCentre","inset"]),insetSoutheast:()=>i(s,-r,["bottom","alignLeft","inset"]),insetSouthwest:()=>i(-s,-r,["bottom","alignRight","inset"]),insetSouth:()=>i(-s/2,-r,["bottom","alignCentre","inset"]),insetEast:()=>i(-s,-r/2,["valignCentre","right","inset"]),insetWest:()=>i(s,-r/2,["valignCentre","left","inset"])}},jc=()=>Wc(0,0,{}),$c=w,Gc=(e,t)=>o=>"rtl"===qc(o)?t:e,qc=e=>"rtl"===It(e,"direction")?"rtl":"ltr";var Yc;!function(e){e.TopToBottom="toptobottom",e.BottomToTop="bottomtotop"}(Yc||(Yc={}));const Xc="data-alloy-vertical-dir",Kc=e=>wl(e,(e=>$e(e)&&kt(e,"data-alloy-vertical-dir")===Yc.BottomToTop)),Jc=()=>ys("layouts",[rs("onLtr"),rs("onRtl"),gs("onBottomLtr"),gs("onBottomRtl")]),Qc=(e,t,o,n,s,r,a)=>{const i=a.map(Kc).getOr(!1),l=t.layouts.map((t=>t.onLtr(e))),c=t.layouts.map((t=>t.onRtl(e))),d=i?t.layouts.bind((t=>t.onBottomLtr.map((t=>t(e))))).or(l).getOr(s):l.getOr(o),u=i?t.layouts.bind((t=>t.onBottomRtl.map((t=>t(e))))).or(c).getOr(r):c.getOr(n);return Gc(d,u)(e)};var Zc=[rs("hotspot"),gs("bubble"),ws("overrides",{}),Jc(),wi("placement",((e,t,o)=>{const n=t.hotspot,s=wc(o,n.element),r=Qc(e.element,t,ac(),ic(),sc(),rc(),A.some(t.hotspot.element));return A.some($c({anchorBox:s,bubble:t.bubble.getOr(jc()),overrides:t.overrides,layouts:r}))}))],ed=[rs("x"),rs("y"),ws("height",0),ws("width",0),ws("bubble",jc()),ws("overrides",{}),Jc(),wi("placement",((e,t,o)=>{const n=Cc(o,t.x,t.y),s=Xo(n.left,n.top,t.width,t.height),r=Qc(e.element,t,oc(),nc(),oc(),nc(),A.none());return A.some($c({anchorBox:s,bubble:t.bubble,overrides:t.overrides,layouts:r}))}))];const td=Ms([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),od=e=>e.fold(w,((e,t,o)=>e.translate(-t,-o))),nd=e=>e.fold(w,w),sd=e=>W(e,((e,t)=>e.translate(t.left,t.top)),$t(0,0)),rd=e=>{const t=L(e,nd);return sd(t)},ad=td.screen,id=td.absolute,ld=(e,t,o)=>{const n=tt(e.element),s=Po(n),r=((e,t,o)=>{const n=st(o.root).dom;return A.from(n.frameElement).map(ze).filter((t=>{const o=tt(t),n=tt(e.element);return Ze(o,n)})).map(qt)})(e,0,o).getOr(s);return id(r,s.left,s.top)},cd=(e,t,o,n)=>{const s=ad($t(e,t));return A.some(((e,t,o)=>({point:e,width:t,height:o}))(s,o,n))},dd=(e,t,o,n,s)=>e.map((e=>{const r=[t,e.point],a=(i=()=>rd(r),l=()=>rd(r),c=()=>(e=>{const t=L(e,od);return sd(t)})(r),n.fold(i,l,c));var i,l,c;const d=(p=a.left,h=a.top,f=e.width,b=e.height,{x:p,y:h,width:f,height:b}),u=o.showAbove?sc():ac(),m=o.showAbove?rc():ic(),g=Qc(s,o,u,m,u,m,A.none());var p,h,f,b;return $c({anchorBox:d,bubble:o.bubble.getOr(jc()),overrides:o.overrides,layouts:g})}));var ud=[rs("node"),rs("root"),gs("bubble"),Jc(),ws("overrides",{}),ws("showAbove",!1),wi("placement",((e,t,o)=>{const n=ld(e,0,t);return t.node.filter(vt).bind((s=>{const r=s.dom.getBoundingClientRect(),a=cd(r.left,r.top,r.width,r.height),i=t.node.getOr(e.element);return dd(a,n,t,o,i)}))}))];const md=(e,t,o,n)=>({start:e,soffset:t,finish:o,foffset:n}),gd=Ms([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),pd=(gd.before,gd.on,gd.after,e=>e.fold(w,w,w)),hd=Ms([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),fd={domRange:hd.domRange,relative:hd.relative,exact:hd.exact,exactFromRange:e=>hd.exact(e.start,e.soffset,e.finish,e.foffset),getWin:e=>{const t=(e=>e.match({domRange:e=>ze(e.startContainer),relative:(e,t)=>pd(e),exact:(e,t,o,n)=>e}))(e);return st(t)},range:md},bd=(e,t,o)=>{const n=e.document.createRange();var s;return s=n,t.fold((e=>{s.setStartBefore(e.dom)}),((e,t)=>{s.setStart(e.dom,t)}),(e=>{s.setStartAfter(e.dom)})),((e,t)=>{t.fold((t=>{e.setEndBefore(t.dom)}),((t,o)=>{e.setEnd(t.dom,o)}),(t=>{e.setEndAfter(t.dom)}))})(n,o),n},vd=(e,t,o,n,s)=>{const r=e.document.createRange();return r.setStart(t.dom,o),r.setEnd(n.dom,s),r},xd=e=>({left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:e.width,height:e.height}),yd=Ms([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),wd=(e,t,o)=>t(ze(o.startContainer),o.startOffset,ze(o.endContainer),o.endOffset),Sd=(e,t)=>((e,t)=>{const o=((e,t)=>t.match({domRange:e=>({ltr:y(e),rtl:A.none}),relative:(t,o)=>({ltr:Qt((()=>bd(e,t,o))),rtl:Qt((()=>A.some(bd(e,o,t))))}),exact:(t,o,n,s)=>({ltr:Qt((()=>vd(e,t,o,n,s))),rtl:Qt((()=>A.some(vd(e,n,s,t,o))))})}))(e,t);return((e,t)=>{const o=t.ltr();return o.collapsed?t.rtl().filter((e=>!1===e.collapsed)).map((e=>yd.rtl(ze(e.endContainer),e.endOffset,ze(e.startContainer),e.startOffset))).getOrThunk((()=>wd(0,yd.ltr,o))):wd(0,yd.ltr,o)})(0,o)})(e,t).match({ltr:(t,o,n,s)=>{const r=e.document.createRange();return r.setStart(t.dom,o),r.setEnd(n.dom,s),r},rtl:(t,o,n,s)=>{const r=e.document.createRange();return r.setStart(n.dom,s),r.setEnd(t.dom,o),r}});yd.ltr,yd.rtl;const Cd=(e,t,o)=>P(((e,t)=>{const o=p(t)?t:T;let n=e.dom;const s=[];for(;null!==n.parentNode&&void 0!==n.parentNode;){const e=n.parentNode,t=ze(e);if(s.push(t),!0===o(t))break;n=e}return s})(e,o),t),kd=(e,t)=>((e,t)=>{const o=void 0===t?document:t.dom;return Je(o)?[]:L(o.querySelectorAll(e),ze)})(t,e),Od=e=>{if(e.rangeCount>0){const t=e.getRangeAt(0),o=e.getRangeAt(e.rangeCount-1);return A.some(md(ze(t.startContainer),t.startOffset,ze(o.endContainer),o.endOffset))}return A.none()},_d=e=>{if(null===e.anchorNode||null===e.focusNode)return Od(e);{const t=ze(e.anchorNode),o=ze(e.focusNode);return((e,t,o,n)=>{const s=((e,t,o,n)=>{const s=tt(e).dom.createRange();return s.setStart(e.dom,t),s.setEnd(o.dom,n),s})(e,t,o,n),r=Ze(e,o)&&t===n;return s.collapsed&&!r})(t,e.anchorOffset,o,e.focusOffset)?A.some(md(t,e.anchorOffset,o,e.focusOffset)):Od(e)}},Td=(e,t)=>(e=>{const t=e.getClientRects(),o=t.length>0?t[0]:e.getBoundingClientRect();return o.width>0||o.height>0?A.some(o).map(xd):A.none()})(Sd(e,t)),Ed=((e,t)=>{const o=t=>e(t)?A.from(t.dom.nodeValue):A.none();return{get:t=>{if(!e(t))throw new Error("Can only get text value of a text node");return o(t).getOr("")},getOption:o,set:(t,o)=>{if(!e(t))throw new Error("Can only set raw text value of a text node");t.dom.nodeValue=o}}})(Ge),Ad=(e,t)=>({element:e,offset:t}),Md=(e,t)=>Ge(e)?Ad(e,t):((e,t)=>{const o=lt(e);if(0===o.length)return Ad(e,t);if(t<o.length)return Ad(o[t],0);{const e=o[o.length-1],t=Ge(e)?(e=>Ed.get(e))(e).length:lt(e).length;return Ad(e,t)}})(e,t),Dd=e=>void 0!==e.foffset,Bd=(e,t)=>t.getSelection.getOrThunk((()=>()=>(e=>(e=>A.from(e.getSelection()))(e).filter((e=>e.rangeCount>0)).bind(_d))(e)))().map((e=>{if(Dd(e)){const t=Md(e.start,e.soffset),o=Md(e.finish,e.foffset);return fd.range(t.element,t.offset,o.element,o.offset)}return e}));var Id=[gs("getSelection"),rs("root"),gs("bubble"),Jc(),ws("overrides",{}),ws("showAbove",!1),wi("placement",((e,t,o)=>{const n=st(t.root).dom,s=ld(e,0,t),r=Bd(n,t).bind((e=>{if(Dd(e)){const t=((e,t)=>(e=>{const t=e.getBoundingClientRect();return t.width>0||t.height>0?A.some(t).map(xd):A.none()})(Sd(e,t)))(n,fd.exactFromRange(e)).orThunk((()=>{const t=Ne("\ufeff");Fo(e.start,t);const o=Td(n,fd.exact(t,0,t,1));return Ho(t),o}));return t.bind((e=>cd(e.left,e.top,e.width,e.height)))}{const t=le(e,(e=>e.dom.getBoundingClientRect())),o={left:Math.min(t.firstCell.left,t.lastCell.left),right:Math.max(t.firstCell.right,t.lastCell.right),top:Math.min(t.firstCell.top,t.lastCell.top),bottom:Math.max(t.firstCell.bottom,t.lastCell.bottom)};return cd(o.left,o.top,o.right-o.left,o.bottom-o.top)}})),a=Bd(n,t).bind((e=>Dd(e)?$e(e.start)?A.some(e.start):at(e.start):A.some(e.firstCell))).getOr(e.element);return dd(r,s,t,o,a)}))];const Fd="link-layout",Rd=e=>e.x+e.width,Nd=(e,t)=>e.x-t.width,zd=(e,t)=>e.y-t.height+e.height,Ld=e=>e.y,Vd=(e,t,o)=>Ml(Rd(e),Ld(e),o.southeast(),Bl(),"southeast",Hl(e,{left:0,top:2}),Fd),Hd=(e,t,o)=>Ml(Nd(e,t),Ld(e),o.southwest(),Il(),"southwest",Hl(e,{right:1,top:2}),Fd),Pd=(e,t,o)=>Ml(Rd(e),zd(e,t),o.northeast(),Fl(),"northeast",Hl(e,{left:0,bottom:3}),Fd),Ud=(e,t,o)=>Ml(Nd(e,t),zd(e,t),o.northwest(),Rl(),"northwest",Hl(e,{right:1,bottom:3}),Fd),Wd=()=>[Vd,Hd,Pd,Ud],jd=()=>[Hd,Vd,Ud,Pd];var $d=[rs("item"),Jc(),ws("overrides",{}),wi("placement",((e,t,o)=>{const n=wc(o,t.item.element),s=Qc(e.element,t,Wd(),jd(),Wd(),jd(),A.none());return A.some($c({anchorBox:n,bubble:jc(),overrides:t.overrides,layouts:s}))}))],Gd=es("type",{selection:Id,node:ud,hotspot:Zc,submenu:$d,makeshift:ed});const qd=[ms("classes",Un),Os("mode","all",["all","layout","placement"])],Yd=[ws("useFixed",T),gs("getBounds")],Xd=[as("anchor",Gd),ys("transition",qd)],Kd=(e,t,o,n,s,r)=>{const a=Qn("placement.info",Fn(Xd),s),i=a.anchor,l=n.element,c=o.get(n.uid);bc((()=>{Mt(l,"position","fixed");const s=Rt(l,"visibility");Mt(l,"visibility","hidden");const d=t.useFixed()?(()=>{const e=document.documentElement;return Oc(0,0,e.clientWidth,e.clientHeight)})():(e=>{const t=qt(e.element),o=e.element.dom.getBoundingClientRect();return kc(t.left,t.top,o.width,o.height)})(e);i.placement(e,i,d).each((e=>{const s=r.orThunk((()=>t.getBounds.map(_))),i=((e,t,o,n,s,r)=>((e,t,o,n,s,r,a,i)=>{const l=Hc(a,"maxHeightFunction",Lc()),c=Hc(a,"maxWidthFunction",b),d=e.anchorBox,u=e.origin,m={bounds:Sc(u,r),origin:u,preference:n,maxHeightFunction:l,maxWidthFunction:c,lastPlacement:s,transition:i};return Pc(d,t,o,m)})(((e,t)=>((e,t)=>({anchorBox:e,origin:t}))(e,t))(t.anchorBox,e),n.element,t.bubble,t.layouts,s,o,t.overrides,r))(d,e,s,n,c,a.transition);o.set(n.uid,i)})),s.fold((()=>{Lt(l,"visibility")}),(e=>{Mt(l,"visibility",e)})),Rt(l,"left").isNone()&&Rt(l,"top").isNone()&&Rt(l,"right").isNone()&&Rt(l,"bottom").isNone()&&xe(Rt(l,"position"),"fixed")&&Lt(l,"position")}),l)};var Jd=Object.freeze({__proto__:null,position:(e,t,o,n,s)=>{const r=A.none();Kd(e,t,o,n,s,r)},positionWithinBounds:Kd,getMode:(e,t,o)=>t.useFixed()?"fixed":"absolute",reset:(e,t,o,n)=>{const s=n.element;V(["position","left","right","top","bottom"],(e=>Lt(s,e))),(e=>{Tt(e,_c)})(s),o.clear(n.uid)}});const Qd=ua({fields:Yd,name:"positioning",active:uc,apis:Jd,state:Object.freeze({__proto__:null,init:()=>{let e={};return la({readState:()=>e,clear:t=>{g(t)?delete e[t]:e={}},set:(t,o)=>{e[t]=o},get:t=>fe(e,t)})}})}),Zd=e=>e.getSystem().isConnected(),eu=e=>{Fr(e,kr());const t=e.components();V(t,eu)},tu=e=>{const t=e.components();V(t,tu),Fr(e,Cr())},ou=(e,t)=>{e.getSystem().addToWorld(t),vt(e.element)&&tu(t)},nu=e=>{eu(e),e.getSystem().removeFromWorld(e)},su=(e,t)=>{zo(e.element,t.element)},ru=(e,t)=>{au(e,t,zo)},au=(e,t,o)=>{e.getSystem().addToWorld(t),o(e.element,t.element),vt(e.element)&&tu(t),e.syncComponents()},iu=e=>{eu(e),Ho(e.element),e.getSystem().removeFromWorld(e)},lu=e=>{const t=rt(e.element).bind((t=>e.getSystem().getByDom(t).toOptional()));iu(e),t.each((e=>{e.syncComponents()}))},cu=e=>{const t=e.components();V(t,iu),Vo(e.element),e.syncComponents()},du=(e,t)=>{mu(e,t,zo)},uu=(e,t)=>{mu(e,t,Ro)},mu=(e,t,o)=>{o(e,t.element);const n=lt(t.element);V(n,(e=>{t.getByDom(e).each(tu)}))},gu=e=>{const t=lt(e.element);V(t,(t=>{e.getByDom(t).each(eu)})),Ho(e.element)},pu=(e,t,o,n)=>{o.get().each((t=>{cu(e)}));const s=t.getAttachPoint(e);ru(s,e);const r=e.getSystem().build(n);return ru(e,r),o.set(r),r},hu=(e,t,o,n)=>{const s=pu(e,t,o,n);return t.onOpen(e,s),s},fu=(e,t,o)=>{o.get().each((n=>{cu(e),lu(e),t.onClose(e,n),o.clear()}))},bu=(e,t,o)=>o.isOpen(),vu=(e,t,o)=>{const n=t.getAttachPoint(e);Mt(e.element,"position",Qd.getMode(n)),((e,t,o,n)=>{Rt(e.element,t).fold((()=>{Tt(e.element,o)}),(t=>{St(e.element,o,t)})),Mt(e.element,t,"hidden")})(e,"visibility",t.cloakVisibilityAttr)},xu=(e,t,o)=>{(e=>R(["top","left","right","bottom"],(t=>Rt(e,t).isSome())))(e.element)||Lt(e.element,"position"),((e,t,o)=>{Ot(e.element,o).fold((()=>Lt(e.element,t)),(o=>Mt(e.element,t,o)))})(e,"visibility",t.cloakVisibilityAttr)};var yu=Object.freeze({__proto__:null,cloak:vu,decloak:xu,open:hu,openWhileCloaked:(e,t,o,n,s)=>{vu(e,t),hu(e,t,o,n),s(),xu(e,t)},close:fu,isOpen:bu,isPartOf:(e,t,o,n)=>bu(0,0,o)&&o.get().exists((o=>t.isPartOf(e,o,n))),getState:(e,t,o)=>o.get(),setContent:(e,t,o,n)=>o.get().map((()=>pu(e,t,o,n)))}),wu=Object.freeze({__proto__:null,events:(e,t)=>Hr([Wr(fr(),((o,n)=>{fu(o,e,t)}))])}),Su=[bi("onOpen"),bi("onClose"),rs("isPartOf"),rs("getAttachPoint"),ws("cloakVisibilityAttr","data-precloak-visibility")],Cu=Object.freeze({__proto__:null,init:()=>{const e=nn(),t=y("not-implemented");return la({readState:t,isOpen:e.isSet,clear:e.clear,set:e.set,get:e.get})}});const ku=ua({fields:Su,name:"sandboxing",active:wu,apis:yu,state:Cu}),Ou=y("dismiss.popups"),_u=y("reposition.popups"),Tu=y("mouse.released"),Eu=In([ws("isExtraPart",T),ys("fireEventInstead",[ws("event",Or())])]),Au=e=>{const t=Qn("Dismissal",Eu,e);return{[Ou()]:{schema:In([rs("target")]),onReceive:(e,o)=>{ku.isOpen(e)&&(ku.isPartOf(e,o.target)||t.isExtraPart(e,o.target)||t.fireEventInstead.fold((()=>ku.close(e)),(t=>Fr(e,t.event))))}}}},Mu=In([ys("fireEventInstead",[ws("event",_r())]),cs("doReposition")]),Du=e=>{const t=Qn("Reposition",Mu,e);return{[_u()]:{onReceive:e=>{ku.isOpen(e)&&t.fireEventInstead.fold((()=>t.doReposition(e)),(t=>Fr(e,t.event)))}}}},Bu=(e,t,o)=>{t.store.manager.onLoad(e,t,o)},Iu=(e,t,o)=>{t.store.manager.onUnload(e,t,o)};var Fu=Object.freeze({__proto__:null,onLoad:Bu,onUnload:Iu,setValue:(e,t,o,n)=>{t.store.manager.setValue(e,t,o,n)},getValue:(e,t,o)=>t.store.manager.getValue(e,t,o),getState:(e,t,o)=>o}),Ru=Object.freeze({__proto__:null,events:(e,t)=>{const o=e.resetOnDom?[Jr(((o,n)=>{Bu(o,e,t)})),Qr(((o,n)=>{Iu(o,e,t)}))]:[sa(e,t,Bu)];return Hr(o)}});const Nu=()=>{const e=en(null);return la({set:e.set,get:e.get,isNotSet:()=>null===e.get(),clear:()=>{e.set(null)},readState:()=>({mode:"memory",value:e.get()})})},zu=()=>{const e=en({}),t=en({});return la({readState:()=>({mode:"dataset",dataByValue:e.get(),dataByText:t.get()}),lookup:o=>fe(e.get(),o).orThunk((()=>fe(t.get(),o))),update:o=>{const n=e.get(),s=t.get(),r={},a={};V(o,(e=>{r[e.value]=e,fe(e,"meta").each((t=>{fe(t,"text").each((t=>{a[t]=e}))}))})),e.set({...n,...r}),t.set({...s,...a})},clear:()=>{e.set({}),t.set({})}})};var Lu=Object.freeze({__proto__:null,memory:Nu,dataset:zu,manual:()=>la({readState:b}),init:e=>e.store.manager.state(e)});const Vu=(e,t,o,n)=>{const s=t.store;o.update([n]),s.setValue(e,n),t.onSetValue(e,n)};var Hu=[gs("initialValue"),rs("getFallbackEntry"),rs("getDataKey"),rs("setValue"),wi("manager",{setValue:Vu,getValue:(e,t,o)=>{const n=t.store,s=n.getDataKey(e);return o.lookup(s).getOrThunk((()=>n.getFallbackEntry(s)))},onLoad:(e,t,o)=>{t.store.initialValue.each((n=>{Vu(e,t,o,n)}))},onUnload:(e,t,o)=>{o.clear()},state:zu})],Pu=[rs("getValue"),ws("setValue",b),gs("initialValue"),wi("manager",{setValue:(e,t,o,n)=>{t.store.setValue(e,n),t.onSetValue(e,n)},getValue:(e,t,o)=>t.store.getValue(e),onLoad:(e,t,o)=>{t.store.initialValue.each((o=>{t.store.setValue(e,o)}))},onUnload:b,state:ia.init})],Uu=[gs("initialValue"),wi("manager",{setValue:(e,t,o,n)=>{o.set(n),t.onSetValue(e,n)},getValue:(e,t,o)=>o.get(),onLoad:(e,t,o)=>{t.store.initialValue.each((e=>{o.isNotSet()&&o.set(e)}))},onUnload:(e,t,o)=>{o.clear()},state:Nu})],Wu=[Ss("store",{mode:"memory"},es("mode",{memory:Uu,manual:Pu,dataset:Hu})),bi("onSetValue"),ws("resetOnDom",!1)];const ju=ua({fields:Wu,name:"representing",active:Ru,apis:Fu,extra:{setValueFrom:(e,t)=>{const o=ju.getValue(t);ju.setValue(e,o)}},state:Lu}),$u=(e,t)=>As(e,{},L(t,(t=>{return o=t.name(),n="Cannot configure "+t.name()+" for "+e,os(o,o,{tag:"option",process:{}},Tn((e=>pn("The field: "+o+" is forbidden. "+n))));var o,n})).concat([ns("dump",w)])),Gu=e=>e.dump,qu=(e,t)=>({...ca(t),...e.dump}),Yu=$u,Xu=qu,Ku="placeholder",Ju=Ms([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),Qu=e=>be(e,"uiType"),Zu=(e,t,o,n)=>((e,t,o,n)=>Qu(o)&&o.uiType===Ku?((e,t,o,n)=>e.exists((e=>e!==o.owner))?Ju.single(!0,y(o)):fe(n,o.name).fold((()=>{throw new Error("Unknown placeholder component: "+o.name+"\nKnown: ["+re(n)+"]\nNamespace: "+e.getOr("none")+"\nSpec: "+JSON.stringify(o,null,2))}),(e=>e.replace())))(e,0,o,n):Ju.single(!1,y(o)))(e,0,o,n).fold(((s,r)=>{const a=Qu(o)?r(t,o.config,o.validated):r(t),i=fe(a,"components").getOr([]),l=q(i,(o=>Zu(e,t,o,n)));return[{...a,components:l}]}),((e,n)=>{if(Qu(o)){const e=n(t,o.config,o.validated);return o.validated.preprocess.getOr(w)(e)}return n(t)})),em=Ju.single,tm=Ju.multiple,om=y(Ku),nm=Ms([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),sm=ws("factory",{sketch:w}),rm=ws("schema",[]),am=rs("name"),im=os("pname","pname",wn((e=>"<alloy."+Di(e.name)+">")),Vn()),lm=ns("schema",(()=>[gs("preprocess")])),cm=ws("defaults",y({})),dm=ws("overrides",y({})),um=Fn([sm,rm,am,im,cm,dm]),mm=Fn([sm,rm,am,cm,dm]),gm=Fn([sm,rm,am,im,cm,dm]),pm=Fn([sm,lm,am,rs("unit"),im,cm,dm]),hm=e=>e.fold(A.some,A.none,A.some,A.some),fm=e=>{const t=e=>e.name;return e.fold(t,t,t,t)},bm=(e,t)=>o=>{const n=Qn("Converting part type",t,o);return e(n)},vm=bm(nm.required,um),xm=bm(nm.external,mm),ym=bm(nm.optional,gm),wm=bm(nm.group,pm),Sm=y("entirety");var Cm=Object.freeze({__proto__:null,required:vm,external:xm,optional:ym,group:wm,asNamedPart:hm,name:fm,asCommon:e=>e.fold(w,w,w,w),original:Sm});const km=(e,t,o,n)=>xn(t.defaults(e,o,n),o,{uid:e.partUids[t.name]},t.overrides(e,o,n)),Om=(e,t)=>{const o={};return V(t,(t=>{hm(t).each((t=>{const n=_m(e,t.pname);o[t.name]=o=>{const s=Qn("Part: "+t.name+" in "+e,Fn(t.schema),o);return{...n,config:o,validated:s}}}))})),o},_m=(e,t)=>({uiType:om(),owner:e,name:t}),Tm=(e,t,o)=>({uiType:om(),owner:e,name:t,config:o,validated:{}}),Em=e=>q(e,(e=>e.fold(A.none,A.some,A.none,A.none).map((e=>ds(e.name,e.schema.concat([Si(Sm())])))).toArray())),Am=e=>L(e,fm),Mm=(e,t,o)=>((e,t,o)=>{const n={},s={};return V(o,(e=>{e.fold((e=>{n[e.pname]=em(!0,((t,o,n)=>e.factory.sketch(km(t,e,o,n))))}),(e=>{const o=t.parts[e.name];s[e.name]=y(e.factory.sketch(km(t,e,o[Sm()]),o))}),(e=>{n[e.pname]=em(!1,((t,o,n)=>e.factory.sketch(km(t,e,o,n))))}),(e=>{n[e.pname]=tm(!0,((t,o,n)=>{const s=t[e.name];return L(s,(o=>e.factory.sketch(xn(e.defaults(t,o,n),o,e.overrides(t,o)))))}))}))})),{internals:y(n),externals:y(s)}})(0,t,o),Dm=(e,t,o)=>((e,t,o,n)=>{const s=le(n,((e,t)=>((e,t)=>{let o=!1;return{name:y(e),required:()=>t.fold(((e,t)=>e),((e,t)=>e)),used:()=>o,replace:()=>{if(o)throw new Error("Trying to use the same placeholder more than once: "+e);return o=!0,t}}})(t,e))),r=((e,t,o,n)=>q(o,(o=>Zu(e,t,o,n))))(e,t,o,s);return ie(s,(o=>{if(!1===o.used()&&o.required())throw new Error("Placeholder: "+o.name()+" was not found in components list\nNamespace: "+e.getOr("none")+"\nComponents: "+JSON.stringify(t.components,null,2))})),r})(A.some(e),t,t.components,o),Bm=(e,t,o)=>{const n=t.partUids[o];return e.getSystem().getByUid(n).toOptional()},Im=(e,t,o)=>Bm(e,t,o).getOrDie("Could not find part: "+o),Fm=(e,t,o)=>{const n={},s=t.partUids,r=e.getSystem();return V(o,(e=>{n[e]=y(r.getByUid(s[e]))})),n},Rm=(e,t)=>{const o=e.getSystem();return le(t.partUids,((e,t)=>y(o.getByUid(e))))},Nm=e=>re(e.partUids),zm=(e,t,o)=>{const n={},s=t.partUids,r=e.getSystem();return V(o,(e=>{n[e]=y(r.getByUid(s[e]).getOrDie())})),n},Lm=(e,t)=>{const o=Am(t);return Bs(L(o,(t=>({key:t,value:e+"-"+t}))))},Vm=e=>os("partUids","partUids",Cn((t=>Lm(t.uid,e))),Vn());var Hm=Object.freeze({__proto__:null,generate:Om,generateOne:Tm,schemas:Em,names:Am,substitutes:Mm,components:Dm,defaultUids:Lm,defaultUidsSchema:Vm,getAllParts:Rm,getAllPartNames:Nm,getPart:Bm,getPartOrDie:Im,getParts:Fm,getPartsOrDie:zm});const Pm=(e,t,o,n,s)=>{const r=((e,t)=>(e.length>0?[ds("parts",e)]:[]).concat([rs("uid"),ws("dom",{}),ws("components",[]),Si("originalSpec"),ws("debug.sketcher",{})]).concat(t))(n,s);return Qn(e+" [SpecSchema]",In(r.concat(t)),o)},Um=(e,t,o,n,s)=>{const r=Wm(s),a=Em(o),i=Vm(o),l=Pm(e,t,r,a,[i]),c=Mm(0,l,o);return n(l,Dm(e,l,c.internals()),r,c.externals())},Wm=e=>(e=>be(e,"uid"))(e)?e:{...e,uid:Li("uid")},jm=In([rs("name"),rs("factory"),rs("configFields"),ws("apis",{}),ws("extraApis",{})]),$m=In([rs("name"),rs("factory"),rs("configFields"),rs("partFields"),ws("apis",{}),ws("extraApis",{})]),Gm=e=>{const t=Qn("Sketcher for "+e.name,jm,e),o=le(t.apis,$i),n=le(t.extraApis,((e,t)=>oa(e,t)));return{name:t.name,configFields:t.configFields,sketch:e=>((e,t,o,n)=>{const s=Wm(n);return o(Pm(e,t,s,[],[]),s)})(t.name,t.configFields,t.factory,e),...o,...n}},qm=e=>{const t=Qn("Sketcher for "+e.name,$m,e),o=Om(t.name,t.partFields),n=le(t.apis,$i),s=le(t.extraApis,((e,t)=>oa(e,t)));return{name:t.name,partFields:t.partFields,configFields:t.configFields,sketch:e=>Um(t.name,t.configFields,t.partFields,t.factory,e),parts:o,...n,...s}},Ym=e=>Xe("input")(e)&&"radio"!==kt(e,"type")||Xe("textarea")(e);var Xm=Object.freeze({__proto__:null,getCurrent:(e,t,o)=>t.find(e)});const Km=[rs("find")],Jm=ua({fields:Km,name:"composing",apis:Xm}),Qm=["input","button","textarea","select"],Zm=(e,t,o)=>{(t.disabled()?rg:ag)(e,t)},eg=(e,t)=>!0===t.useNative&&F(Qm,Ue(e.element)),tg=e=>{St(e.element,"disabled","disabled")},og=e=>{Tt(e.element,"disabled")},ng=e=>{St(e.element,"aria-disabled","true")},sg=e=>{St(e.element,"aria-disabled","false")},rg=(e,t,o)=>{t.disableClass.each((t=>{ya(e.element,t)})),(eg(e,t)?tg:ng)(e),t.onDisabled(e)},ag=(e,t,o)=>{t.disableClass.each((t=>{Sa(e.element,t)})),(eg(e,t)?og:sg)(e),t.onEnabled(e)},ig=(e,t)=>eg(e,t)?(e=>_t(e.element,"disabled"))(e):(e=>"true"===kt(e.element,"aria-disabled"))(e);var lg=Object.freeze({__proto__:null,enable:ag,disable:rg,isDisabled:ig,onLoad:Zm,set:(e,t,o,n)=>{(n?rg:ag)(e,t)}}),cg=Object.freeze({__proto__:null,exhibit:(e,t)=>na({classes:t.disabled()?t.disableClass.toArray():[]}),events:(e,t)=>Hr([Pr(mr(),((t,o)=>ig(t,e))),sa(e,t,Zm)])}),dg=[Ts("disabled",T),ws("useNative",!0),gs("disableClass"),bi("onDisabled"),bi("onEnabled")];const ug=ua({fields:dg,name:"disabling",active:cg,apis:lg}),mg=(e,t,o,n)=>{const s=kd(e.element,"."+t.highlightClass);V(s,(o=>{R(n,(e=>Ze(e.element,o)))||(Sa(o,t.highlightClass),e.getSystem().getByDom(o).each((o=>{t.onDehighlight(e,o),Fr(o,Ir())})))}))},gg=(e,t,o,n)=>{mg(e,t,0,[n]),pg(e,t,o,n)||(ya(n.element,t.highlightClass),t.onHighlight(e,n),Fr(n,Br()))},pg=(e,t,o,n)=>Ca(n.element,t.highlightClass),hg=(e,t,o)=>Ol(e.element,"."+t.itemClass).bind((t=>e.getSystem().getByDom(t).toOptional())),fg=(e,t,o)=>{const n=kd(e.element,"."+t.itemClass);return(n.length>0?A.some(n[n.length-1]):A.none()).bind((t=>e.getSystem().getByDom(t).toOptional()))},bg=(e,t,o,n)=>{const s=kd(e.element,"."+t.itemClass);return $(s,(e=>Ca(e,t.highlightClass))).bind((t=>{const o=Ei(t,n,0,s.length-1);return e.getSystem().getByDom(s[o]).toOptional()}))},vg=(e,t,o)=>{const n=kd(e.element,"."+t.itemClass);return ye(L(n,(t=>e.getSystem().getByDom(t).toOptional())))};var xg=Object.freeze({__proto__:null,dehighlightAll:(e,t,o)=>mg(e,t,0,[]),dehighlight:(e,t,o,n)=>{pg(e,t,o,n)&&(Sa(n.element,t.highlightClass),t.onDehighlight(e,n),Fr(n,Ir()))},highlight:gg,highlightFirst:(e,t,o)=>{hg(e,t).each((n=>{gg(e,t,o,n)}))},highlightLast:(e,t,o)=>{fg(e,t).each((n=>{gg(e,t,o,n)}))},highlightAt:(e,t,o,n)=>{((e,t,o,n)=>{const s=kd(e.element,"."+t.itemClass);return A.from(s[n]).fold((()=>ln.error(new Error("No element found with index "+n))),e.getSystem().getByDom)})(e,t,0,n).fold((e=>{throw e}),(n=>{gg(e,t,o,n)}))},highlightBy:(e,t,o,n)=>{const s=vg(e,t);j(s,n).each((n=>{gg(e,t,o,n)}))},isHighlighted:pg,getHighlighted:(e,t,o)=>Ol(e.element,"."+t.highlightClass).bind((t=>e.getSystem().getByDom(t).toOptional())),getFirst:hg,getLast:fg,getPrevious:(e,t,o)=>bg(e,t,0,-1),getNext:(e,t,o)=>bg(e,t,0,1),getCandidates:vg}),yg=[rs("highlightClass"),rs("itemClass"),bi("onHighlight"),bi("onDehighlight")];const wg=ua({fields:yg,name:"highlighting",apis:xg}),Sg=[8],Cg=[9],kg=[13],Og=[27],_g=[32],Tg=[37],Eg=[38],Ag=[39],Mg=[40],Dg=(e,t,o)=>{const n=X(e.slice(0,t)),s=X(e.slice(t+1));return j(n.concat(s),o)},Bg=(e,t,o)=>{const n=X(e.slice(0,t));return j(n,o)},Ig=(e,t,o)=>{const n=e.slice(0,t),s=e.slice(t+1);return j(s.concat(n),o)},Fg=(e,t,o)=>{const n=e.slice(t+1);return j(n,o)},Rg=e=>t=>{const o=t.raw;return F(e,o.which)},Ng=e=>t=>Y(e,(e=>e(t))),zg=e=>!0===e.raw.shiftKey,Lg=e=>!0===e.raw.ctrlKey,Vg=k(zg),Hg=(e,t)=>({matches:e,classification:t}),Pg=(e,t,o)=>{t.exists((e=>o.exists((t=>Ze(t,e)))))||Rr(e,Tr(),{prevFocus:t,newFocus:o})},Ug=()=>{const e=e=>fc(e.element);return{get:e,set:(t,o)=>{const n=e(t);t.getSystem().triggerFocus(o,t.element);const s=e(t);Pg(t,n,s)}}},Wg=()=>{const e=e=>wg.getHighlighted(e).map((e=>e.element));return{get:e,set:(t,o)=>{const n=e(t);t.getSystem().getByDom(o).fold(b,(e=>{wg.highlight(t,e)}));const s=e(t);Pg(t,n,s)}}};var jg;!function(e){e.OnFocusMode="onFocus",e.OnEnterOrSpaceMode="onEnterOrSpace",e.OnApiMode="onApi"}(jg||(jg={}));const $g=(e,t,o,n,s)=>{const r=(e,t,o,n,s)=>{return(r=o(e,t,n,s),a=t.event,j(r,(e=>e.matches(a))).map((e=>e.classification))).bind((o=>o(e,t,n,s)));var r,a},a={schema:()=>e.concat([ws("focusManager",Ug()),Ss("focusInside","onFocus",Yn((e=>F(["onFocus","onEnterOrSpace","onApi"],e)?ln.value(e):ln.error("Invalid value for focusInside")))),wi("handler",a),wi("state",t),wi("sendFocusIn",s)]),processKey:r,toEvents:(e,t)=>{const a=e.focusInside!==jg.OnFocusMode?A.none():s(e).map((o=>Wr(lr(),((n,s)=>{o(n,e,t),s.stop()})))),i=[Wr(Js(),((n,a)=>{r(n,a,o,e,t).fold((()=>{((o,n)=>{const r=Rg(_g.concat(kg))(n.event);e.focusInside===jg.OnEnterOrSpaceMode&&r&&Ns(o,n)&&s(e).each((s=>{s(o,e,t),n.stop()}))})(n,a)}),(e=>{a.stop()}))})),Wr(Qs(),((o,s)=>{r(o,s,n,e,t).each((e=>{s.stop()}))}))];return Hr(a.toArray().concat(i))}};return a},Gg=e=>{const t=[gs("onEscape"),gs("onEnter"),ws("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),ws("firstTabstop",0),ws("useTabstopAt",E),gs("visibilitySelector")].concat([e]),o=(e,t)=>{const o=e.visibilitySelector.bind((e=>_l(t,e))).getOr(t);return Ut(o)>0},n=(e,t)=>t.focusManager.get(e).bind((e=>_l(e,t.selector))),s=(e,t,n)=>{((e,t)=>{const n=kd(e.element,t.selector),s=P(n,(e=>o(t,e)));return A.from(s[t.firstTabstop])})(e,t).each((o=>{t.focusManager.set(e,o)}))},r=(e,t,s,r)=>{const a=kd(e.element,s.selector);return n(e,s).bind((t=>$(a,C(Ze,t)).bind((t=>((e,t,n,s,r)=>r(t,n,(e=>((e,t)=>o(e,t)&&e.useTabstopAt(t))(s,e))).fold((()=>s.cyclic?A.some(!0):A.none()),(t=>(s.focusManager.set(e,t),A.some(!0)))))(e,a,t,s,r)))))},a=(e,t,o)=>{const n=o.cyclic?Dg:Bg;return r(e,0,o,n)},i=(e,t,o)=>{const n=o.cyclic?Ig:Fg;return r(e,0,o,n)},l=y([Hg(Ng([zg,Rg(Cg)]),a),Hg(Rg(Cg),i),Hg(Ng([Vg,Rg(kg)]),((e,t,o)=>o.onEnter.bind((o=>o(e,t)))))]),c=y([Hg(Rg(Og),((e,t,o)=>o.onEscape.bind((o=>o(e,t))))),Hg(Rg(Cg),((e,t,o)=>n(e,o).filter((e=>!o.useTabstopAt(e))).bind((n=>((e=>(e=>rt(e))(e).bind(dt).exists((t=>Ze(t,e))))(n)?a:i)(e,t,o)))))]);return $g(t,ia.init,l,c,(()=>A.some(s)))};var qg=Gg(ns("cyclic",T)),Yg=Gg(ns("cyclic",E));const Xg=(e,t,o)=>Ym(o)&&Rg(_g)(t.event)?A.none():((e,t,o)=>(zr(e,o,mr()),A.some(!0)))(e,0,o),Kg=(e,t)=>A.some(!0),Jg=[ws("execute",Xg),ws("useSpace",!1),ws("useEnter",!0),ws("useControlEnter",!1),ws("useDown",!1)],Qg=(e,t,o)=>o.execute(e,t,e.element);var Zg=$g(Jg,ia.init,((e,t,o,n)=>{const s=o.useSpace&&!Ym(e.element)?_g:[],r=o.useEnter?kg:[],a=o.useDown?Mg:[],i=s.concat(r).concat(a);return[Hg(Rg(i),Qg)].concat(o.useControlEnter?[Hg(Ng([Lg,Rg(kg)]),Qg)]:[])}),((e,t,o,n)=>o.useSpace&&!Ym(e.element)?[Hg(Rg(_g),Kg)]:[]),(()=>A.none()));const ep=()=>{const e=nn();return la({readState:()=>e.get().map((e=>({numRows:String(e.numRows),numColumns:String(e.numColumns)}))).getOr({numRows:"?",numColumns:"?"}),setGridSize:(t,o)=>{e.set({numRows:t,numColumns:o})},getNumRows:()=>e.get().map((e=>e.numRows)),getNumColumns:()=>e.get().map((e=>e.numColumns))})};var tp=Object.freeze({__proto__:null,flatgrid:ep,init:e=>e.state(e)});const op=e=>(t,o,n,s)=>{const r=e(t.element);return ap(r,t,o,n,s)},np=(e,t)=>{const o=Gc(e,t);return op(o)},sp=(e,t)=>{const o=Gc(t,e);return op(o)},rp=e=>(t,o,n,s)=>ap(e,t,o,n,s),ap=(e,t,o,n,s)=>n.focusManager.get(t).bind((o=>e(t.element,o,n,s))).map((e=>(n.focusManager.set(t,e),!0))),ip=rp,lp=rp,cp=rp,dp=e=>!(e=>e.offsetWidth<=0&&e.offsetHeight<=0)(e.dom),up=(e,t,o)=>{const n=kd(e,o);return((e,o)=>$(e,(e=>Ze(e,t))).map((t=>({index:t,candidates:e}))))(P(n,dp))},mp=(e,t)=>$(e,(e=>Ze(t,e))),gp=(e,t,o,n)=>n(Math.floor(t/o),t%o).bind((t=>{const n=t.row*o+t.column;return n>=0&&n<e.length?A.some(e[n]):A.none()})),pp=(e,t,o,n,s)=>gp(e,t,n,((t,r)=>{const a=t===o-1?e.length-t*n:n,i=Ei(r,s,0,a-1);return A.some({row:t,column:i})})),hp=(e,t,o,n,s)=>gp(e,t,n,((t,r)=>{const a=Ei(t,s,0,o-1),i=a===o-1?e.length-a*n:n,l=Ai(r,0,i-1);return A.some({row:a,column:l})})),fp=[rs("selector"),ws("execute",Xg),vi("onEscape"),ws("captureTab",!1),Ci()],bp=(e,t,o)=>{Ol(e.element,t.selector).each((o=>{t.focusManager.set(e,o)}))},vp=e=>(t,o,n,s)=>up(t,o,n.selector).bind((t=>e(t.candidates,t.index,s.getNumRows().getOr(n.initSize.numRows),s.getNumColumns().getOr(n.initSize.numColumns)))),xp=(e,t,o)=>o.captureTab?A.some(!0):A.none(),yp=vp(((e,t,o,n)=>pp(e,t,o,n,-1))),wp=vp(((e,t,o,n)=>pp(e,t,o,n,1))),Sp=vp(((e,t,o,n)=>hp(e,t,o,n,-1))),Cp=vp(((e,t,o,n)=>hp(e,t,o,n,1))),kp=y([Hg(Rg(Tg),np(yp,wp)),Hg(Rg(Ag),sp(yp,wp)),Hg(Rg(Eg),ip(Sp)),Hg(Rg(Mg),lp(Cp)),Hg(Ng([zg,Rg(Cg)]),xp),Hg(Ng([Vg,Rg(Cg)]),xp),Hg(Rg(_g.concat(kg)),((e,t,o,n)=>((e,t)=>t.focusManager.get(e).bind((e=>_l(e,t.selector))))(e,o).bind((n=>o.execute(e,t,n)))))]),Op=y([Hg(Rg(Og),((e,t,o)=>o.onEscape(e,t))),Hg(Rg(_g),Kg)]);var _p=$g(fp,ep,kp,Op,(()=>A.some(bp)));const Tp=(e,t,o,n,s)=>{const r=(e,t,o)=>s(e,t,n,0,o.length-1,o[t],(t=>{return n=o[t],"button"===Ue(n)&&"disabled"===kt(n,"disabled")?r(e,t,o):A.from(o[t]);var n}));return up(e,o,t).bind((e=>{const t=e.index,o=e.candidates;return r(t,t,o)}))},Ep=(e,t,o,n)=>Tp(e,t,o,n,((e,t,o,n,s,r,a)=>{const i=Ai(t+o,n,s);return i===e?A.from(r):a(i)})),Ap=(e,t,o,n)=>Tp(e,t,o,n,((e,t,o,n,s,r,a)=>{const i=Ei(t,o,n,s);return i===e?A.none():a(i)})),Mp=[rs("selector"),ws("getInitial",A.none),ws("execute",Xg),vi("onEscape"),ws("executeOnMove",!1),ws("allowVertical",!0),ws("allowHorizontal",!0),ws("cycles",!0)],Dp=(e,t,o)=>((e,t)=>t.focusManager.get(e).bind((e=>_l(e,t.selector))))(e,o).bind((n=>o.execute(e,t,n))),Bp=(e,t,o)=>{t.getInitial(e).orThunk((()=>Ol(e.element,t.selector))).each((o=>{t.focusManager.set(e,o)}))},Ip=(e,t,o)=>(o.cycles?Ap:Ep)(e,o.selector,t,-1),Fp=(e,t,o)=>(o.cycles?Ap:Ep)(e,o.selector,t,1),Rp=e=>(t,o,n,s)=>e(t,o,n,s).bind((()=>n.executeOnMove?Dp(t,o,n):A.some(!0))),Np=y([Hg(Rg(_g),Kg),Hg(Rg(Og),((e,t,o)=>o.onEscape(e,t)))]);var zp=$g(Mp,ia.init,((e,t,o,n)=>{const s=[...o.allowHorizontal?Tg:[]].concat(o.allowVertical?Eg:[]),r=[...o.allowHorizontal?Ag:[]].concat(o.allowVertical?Mg:[]);return[Hg(Rg(s),Rp(np(Ip,Fp))),Hg(Rg(r),Rp(sp(Ip,Fp))),Hg(Rg(kg),Dp),Hg(Rg(_g),Dp)]}),Np,(()=>A.some(Bp)));const Lp=(e,t,o)=>A.from(e[t]).bind((e=>A.from(e[o]).map((e=>({rowIndex:t,columnIndex:o,cell:e}))))),Vp=(e,t,o,n)=>{const s=e[t].length,r=Ei(o,n,0,s-1);return Lp(e,t,r)},Hp=(e,t,o,n)=>{const s=Ei(o,n,0,e.length-1),r=e[s].length,a=Ai(t,0,r-1);return Lp(e,s,a)},Pp=(e,t,o,n)=>{const s=e[t].length,r=Ai(o+n,0,s-1);return Lp(e,t,r)},Up=(e,t,o,n)=>{const s=Ai(o+n,0,e.length-1),r=e[s].length,a=Ai(t,0,r-1);return Lp(e,s,a)},Wp=[ds("selectors",[rs("row"),rs("cell")]),ws("cycles",!0),ws("previousSelector",A.none),ws("execute",Xg)],jp=(e,t,o)=>{t.previousSelector(e).orThunk((()=>{const o=t.selectors;return Ol(e.element,o.cell)})).each((o=>{t.focusManager.set(e,o)}))},$p=(e,t)=>(o,n,s)=>{const r=s.cycles?e:t;return _l(n,s.selectors.row).bind((e=>{const t=kd(e,s.selectors.cell);return mp(t,n).bind((t=>{const n=kd(o,s.selectors.row);return mp(n,e).bind((e=>{const o=((e,t)=>L(e,(e=>kd(e,t.selectors.cell))))(n,s);return r(o,e,t).map((e=>e.cell))}))}))}))},Gp=$p(((e,t,o)=>Vp(e,t,o,-1)),((e,t,o)=>Pp(e,t,o,-1))),qp=$p(((e,t,o)=>Vp(e,t,o,1)),((e,t,o)=>Pp(e,t,o,1))),Yp=$p(((e,t,o)=>Hp(e,o,t,-1)),((e,t,o)=>Up(e,o,t,-1))),Xp=$p(((e,t,o)=>Hp(e,o,t,1)),((e,t,o)=>Up(e,o,t,1))),Kp=y([Hg(Rg(Tg),np(Gp,qp)),Hg(Rg(Ag),sp(Gp,qp)),Hg(Rg(Eg),ip(Yp)),Hg(Rg(Mg),lp(Xp)),Hg(Rg(_g.concat(kg)),((e,t,o)=>fc(e.element).bind((n=>o.execute(e,t,n)))))]),Jp=y([Hg(Rg(_g),Kg)]);var Qp=$g(Wp,ia.init,Kp,Jp,(()=>A.some(jp)));const Zp=[rs("selector"),ws("execute",Xg),ws("moveOnTab",!1)],eh=(e,t,o)=>o.focusManager.get(e).bind((n=>o.execute(e,t,n))),th=(e,t,o)=>{Ol(e.element,t.selector).each((o=>{t.focusManager.set(e,o)}))},oh=(e,t,o)=>Ap(e,o.selector,t,-1),nh=(e,t,o)=>Ap(e,o.selector,t,1),sh=y([Hg(Rg(Eg),cp(oh)),Hg(Rg(Mg),cp(nh)),Hg(Ng([zg,Rg(Cg)]),((e,t,o,n)=>o.moveOnTab?cp(oh)(e,t,o,n):A.none())),Hg(Ng([Vg,Rg(Cg)]),((e,t,o,n)=>o.moveOnTab?cp(nh)(e,t,o,n):A.none())),Hg(Rg(kg),eh),Hg(Rg(_g),eh)]),rh=y([Hg(Rg(_g),Kg)]);var ah=$g(Zp,ia.init,sh,rh,(()=>A.some(th)));const ih=[vi("onSpace"),vi("onEnter"),vi("onShiftEnter"),vi("onLeft"),vi("onRight"),vi("onTab"),vi("onShiftTab"),vi("onUp"),vi("onDown"),vi("onEscape"),ws("stopSpaceKeyup",!1),gs("focusIn")];var lh=$g(ih,ia.init,((e,t,o)=>[Hg(Rg(_g),o.onSpace),Hg(Ng([Vg,Rg(kg)]),o.onEnter),Hg(Ng([zg,Rg(kg)]),o.onShiftEnter),Hg(Ng([zg,Rg(Cg)]),o.onShiftTab),Hg(Ng([Vg,Rg(Cg)]),o.onTab),Hg(Rg(Eg),o.onUp),Hg(Rg(Mg),o.onDown),Hg(Rg(Tg),o.onLeft),Hg(Rg(Ag),o.onRight),Hg(Rg(_g),o.onSpace)]),((e,t,o)=>[...o.stopSpaceKeyup?[Hg(Rg(_g),Kg)]:[],Hg(Rg(Og),o.onEscape)]),(e=>e.focusIn));const ch=qg.schema(),dh=Yg.schema(),uh=zp.schema(),mh=_p.schema(),gh=Qp.schema(),ph=Zg.schema(),hh=ah.schema(),fh=lh.schema(),bh=ga({branchKey:"mode",branches:Object.freeze({__proto__:null,acyclic:ch,cyclic:dh,flow:uh,flatgrid:mh,matrix:gh,execution:ph,menu:hh,special:fh}),name:"keying",active:{events:(e,t)=>e.handler.toEvents(e,t)},apis:{focusIn:(e,t,o)=>{t.sendFocusIn(t).fold((()=>{e.getSystem().triggerFocus(e.element,e.element)}),(n=>{n(e,t,o)}))},setGridSize:(e,t,o,n,s)=>{(e=>ve(e,"setGridSize"))(o)?o.setGridSize(n,s):console.error("Layout does not support setGridSize")}},state:tp}),vh=(e,t)=>{bc((()=>{((e,t,o)=>{const n=e.components();(e=>{V(e.components(),(e=>Ho(e.element))),Vo(e.element),e.syncComponents()})(e);const s=o(t),r=K(n,s);V(r,(t=>{eu(t),e.getSystem().removeFromWorld(t)})),V(s,(t=>{Zd(t)?su(e,t):(e.getSystem().addToWorld(t),su(e,t),vt(e.element)&&tu(t))})),e.syncComponents()})(e,t,(()=>L(t,e.getSystem().build)))}),e.element)},xh=(e,t)=>{bc((()=>{((o,n,s)=>{const r=o.components(),a=q(n,(e=>ji(e).toArray()));V(r,(e=>{F(a,e)||nu(e)}));const i=((e,t,o)=>sl(e,t,((t,n)=>rl(e,n,t,o))))(e.element,t,e.getSystem().buildOrPatch),l=K(r,i);V(l,(e=>{Zd(e)&&nu(e)})),V(i,(e=>{Zd(e)||ou(o,e)})),o.syncComponents()})(e,t)}),e.element)},yh=(e,t,o,n)=>{nu(t);const s=rl(e.element,o,n,e.getSystem().buildOrPatch);ou(e,s),e.syncComponents()},wh=(e,t,o)=>{const n=e.getSystem().build(o);au(e,n,t)},Sh=(e,t,o,n)=>{lu(t),wh(e,((e,t)=>((e,t,o)=>{ct(e,o).fold((()=>{zo(e,t)}),(e=>{Fo(e,t)}))})(e,t,o)),n)},Ch=(e,t)=>e.components(),kh=(e,t,o,n,s)=>{const r=Ch(e);return A.from(r[n]).map((o=>(s.fold((()=>lu(o)),(s=>{(t.reuseDom?yh:Sh)(e,o,n,s)})),o)))};var Oh=Object.freeze({__proto__:null,append:(e,t,o,n)=>{wh(e,zo,n)},prepend:(e,t,o,n)=>{wh(e,No,n)},remove:(e,t,o,n)=>{const s=Ch(e),r=j(s,(e=>Ze(n.element,e.element)));r.each(lu)},replaceAt:kh,replaceBy:(e,t,o,n,s)=>{const r=Ch(e);return $(r,n).bind((o=>kh(e,t,0,o,s)))},set:(e,t,o,n)=>(t.reuseDom?xh:vh)(e,n),contents:Ch});const _h=ua({fields:[_s("reuseDom",!0)],name:"replacing",apis:Oh}),Th=(e,t)=>{const o=((e,t)=>{const o=Hr(t);return ua({fields:[rs("enabled")],name:e,active:{events:y(o)}})})(e,t);return{key:e,value:{config:{},me:o,configAsRaw:y({}),initialConfig:{},state:ia}}},Eh=(e,t)=>{t.ignore||(mc(e.element),t.onFocus(e))};var Ah=Object.freeze({__proto__:null,focus:Eh,blur:(e,t)=>{t.ignore||gc(e.element)},isFocused:e=>pc(e.element)}),Mh=Object.freeze({__proto__:null,exhibit:(e,t)=>{const o=t.ignore?{}:{attributes:{tabindex:"-1"}};return na(o)},events:e=>Hr([Wr(lr(),((t,o)=>{Eh(t,e),o.stop()}))].concat(e.stopMousedown?[Wr(js(),((e,t)=>{t.event.prevent()}))]:[]))}),Dh=[bi("onFocus"),ws("stopMousedown",!1),ws("ignore",!1)];const Bh=ua({fields:Dh,name:"focusing",active:Mh,apis:Ah}),Ih=(e,t,o,n)=>{const s=o.get();o.set(n),((e,t,o)=>{t.toggleClass.each((t=>{o.get()?ya(e.element,t):Sa(e.element,t)}))})(e,t,o),((e,t,o)=>{const n=t.aria;n.update(e,n,o.get())})(e,t,o),s!==n&&t.onToggled(e,n)},Fh=(e,t,o)=>{Ih(e,t,o,!o.get())},Rh=(e,t,o)=>{Ih(e,t,o,t.selected)};var Nh=Object.freeze({__proto__:null,onLoad:Rh,toggle:Fh,isOn:(e,t,o)=>o.get(),on:(e,t,o)=>{Ih(e,t,o,!0)},off:(e,t,o)=>{Ih(e,t,o,!1)},set:Ih}),zh=Object.freeze({__proto__:null,exhibit:()=>na({}),events:(e,t)=>{const o=(n=e,s=t,r=Fh,ea((e=>{r(e,n,s)})));var n,s,r;const a=sa(e,t,Rh);return Hr(G([e.toggleOnExecute?[o]:[],[a]]))}});const Lh=(e,t,o)=>{St(e.element,"aria-expanded",o)};var Vh=[ws("selected",!1),gs("toggleClass"),ws("toggleOnExecute",!0),bi("onToggled"),Ss("aria",{mode:"none"},es("mode",{pressed:[ws("syncWithExpanded",!1),wi("update",((e,t,o)=>{St(e.element,"aria-pressed",o),t.syncWithExpanded&&Lh(e,0,o)}))],checked:[wi("update",((e,t,o)=>{St(e.element,"aria-checked",o)}))],expanded:[wi("update",Lh)],selected:[wi("update",((e,t,o)=>{St(e.element,"aria-selected",o)}))],none:[wi("update",b)]}))];const Hh=ua({fields:Vh,name:"toggling",active:zh,apis:Nh,state:(!1,{init:()=>{const e=en(false);return{get:()=>e.get(),set:t=>e.set(t),clear:()=>e.set(false),readState:()=>e.get()}}})});const Ph=()=>{const e=(e,t)=>{t.stop(),Nr(e)};return[Wr(tr(),e),Wr(pr(),e),Yr(Hs()),Yr(js())]},Uh=e=>Hr(G([e.map((e=>ea(((t,o)=>{e(t),o.stop()})))).toArray(),Ph()])),Wh="alloy.item-hover",jh="alloy.item-focus",$h="alloy.item-toggled",Gh=e=>{(fc(e.element).isNone()||Bh.isFocused(e))&&(Bh.isFocused(e)||Bh.focus(e),Rr(e,Wh,{item:e}))},qh=e=>{Rr(e,jh,{item:e})},Yh=y(Wh),Xh=y(jh),Kh=y($h),Jh=e=>e.role.fold((()=>e.toggling.map((e=>e.exclusive?"menuitemradio":"menuitemcheckbox")).getOr("menuitem")),w),Qh=[rs("data"),rs("components"),rs("dom"),ws("hasSubmenu",!1),gs("toggling"),gs("role"),Yu("itemBehaviours",[Hh,Bh,bh,ju]),ws("ignoreFocus",!1),ws("domModification",{}),wi("builder",(e=>({dom:e.dom,domModification:{...e.domModification,attributes:{role:Jh(e),...e.domModification.attributes,"aria-haspopup":e.hasSubmenu,...e.hasSubmenu?{"aria-expanded":!1}:{}}},behaviours:Xu(e.itemBehaviours,[e.toggling.fold(Hh.revoke,(t=>Hh.config(((e,t)=>({aria:{mode:t?"selected":"checked"},...me(e,((e,t)=>"exclusive"!==t)),onToggled:(t,o)=>{p(e.onToggled)&&e.onToggled(t,o),((e,t)=>{Rr(e,$h,{item:e,state:t})})(t,o)}}))(t,e.role.exists((e=>"option"===e)))))),Bh.config({ignore:e.ignoreFocus,stopMousedown:e.ignoreFocus,onFocus:e=>{qh(e)}}),bh.config({mode:"execution"}),ju.config({store:{mode:"memory",initialValue:e.data}}),Th("item-type-events",[...Ph(),Wr(Ys(),Gh),Wr(gr(),Bh.focus)])]),components:e.components,eventOrder:e.eventOrder}))),ws("eventOrder",{})],Zh=[rs("dom"),rs("components"),wi("builder",(e=>({dom:e.dom,components:e.components,events:Hr([Xr(gr())])})))],ef=y("item-widget"),tf=y([vm({name:"widget",overrides:e=>({behaviours:ca([ju.config({store:{mode:"manual",getValue:t=>e.data,setValue:b}})])})})]),of=[rs("uid"),rs("data"),rs("components"),rs("dom"),ws("autofocus",!1),ws("ignoreFocus",!1),Yu("widgetBehaviours",[ju,Bh,bh]),ws("domModification",{}),Vm(tf()),wi("builder",(e=>{const t=Mm(ef(),e,tf()),o=Dm(ef(),e,t.internals()),n=t=>Bm(t,e,"widget").map((e=>(bh.focusIn(e),e))),s=(t,o)=>Ym(o.event.target)?A.none():e.autofocus?(o.setSource(t.element),A.none()):A.none();return{dom:e.dom,components:o,domModification:e.domModification,events:Hr([ea(((e,t)=>{n(e).each((e=>{t.stop()}))})),Wr(Ys(),Gh),Wr(gr(),((t,o)=>{e.autofocus?n(t):Bh.focus(t)}))]),behaviours:Xu(e.widgetBehaviours,[ju.config({store:{mode:"memory",initialValue:e.data}}),Bh.config({ignore:e.ignoreFocus,onFocus:e=>{qh(e)}}),bh.config({mode:"special",focusIn:e.autofocus?e=>{n(e)}:pa(),onLeft:s,onRight:s,onEscape:(t,o)=>Bh.isFocused(t)||e.autofocus?e.autofocus?(o.setSource(t.element),A.none()):A.none():(Bh.focus(t),A.some(!0))})])}}))],nf=es("type",{widget:of,item:Qh,separator:Zh}),sf=y([wm({factory:{sketch:e=>{const t=Qn("menu.spec item",nf,e);return t.builder(t)}},name:"items",unit:"item",defaults:(e,t)=>be(t,"uid")?t:{...t,uid:Li("item")},overrides:(e,t)=>({type:t.type,ignoreFocus:e.fakeFocus,domModification:{classes:[e.markers.item]}})})]),rf=y([fs("role"),rs("value"),rs("items"),rs("dom"),rs("components"),ws("eventOrder",{}),$u("menuBehaviours",[wg,ju,Jm,bh]),Ss("movement",{mode:"menu",moveOnTab:!0},es("mode",{grid:[Ci(),wi("config",((e,t)=>({mode:"flatgrid",selector:"."+e.markers.item,initSize:{numColumns:t.initSize.numColumns,numRows:t.initSize.numRows},focusManager:e.focusManager})))],matrix:[wi("config",((e,t)=>({mode:"matrix",selectors:{row:t.rowSelector,cell:"."+e.markers.item},previousSelector:t.previousSelector,focusManager:e.focusManager}))),rs("rowSelector"),ws("previousSelector",A.none)],menu:[ws("moveOnTab",!0),wi("config",((e,t)=>({mode:"menu",selector:"."+e.markers.item,moveOnTab:t.moveOnTab,focusManager:e.focusManager})))]})),as("markers",mi()),ws("fakeFocus",!1),ws("focusManager",Ug()),bi("onHighlight"),bi("onDehighlight"),ws("showMenuRole",!0)]),af=y("alloy.menu-focus"),lf=qm({name:"Menu",configFields:rf(),partFields:sf(),factory:(e,t,o,n)=>({uid:e.uid,dom:e.dom,markers:e.markers,behaviours:qu(e.menuBehaviours,[wg.config({highlightClass:e.markers.selectedItem,itemClass:e.markers.item,onHighlight:e.onHighlight,onDehighlight:e.onDehighlight}),ju.config({store:{mode:"memory",initialValue:e.value}}),Jm.config({find:A.some}),bh.config(e.movement.config(e,e.movement))]),events:Hr([Wr(Xh(),((e,t)=>{const o=t.event;e.getSystem().getByDom(o.target).each((o=>{wg.highlight(e,o),t.stop(),Rr(e,af(),{menu:e,item:o})}))})),Wr(Yh(),((e,t)=>{const o=t.event.item;wg.highlight(e,o)})),Wr(Kh(),((e,t)=>{const{item:o,state:n}=t.event;n&&"menuitemradio"===kt(o.element,"role")&&((e,t)=>{const o=kd(e.element,'[role="menuitemradio"][aria-checked="true"]');V(o,(o=>{Ze(o,t.element)||e.getSystem().getByDom(o).each((e=>{Hh.off(e)}))}))})(e,o)}))]),components:t,eventOrder:e.eventOrder,...e.showMenuRole?{domModification:{attributes:{role:e.role.getOr("menu")}}}:{}})}),cf=(e,t,o,n)=>fe(o,n).bind((n=>fe(e,n).bind((n=>{const s=cf(e,t,o,n);return A.some([n].concat(s))})))).getOr([]),df=e=>"prepared"===e.type?A.some(e.menu):A.none(),uf=()=>{const e=en({}),t=en({}),o=en({}),n=nn(),s=en({}),r=e=>a(e).bind(df),a=e=>fe(t.get(),e),i=t=>fe(e.get(),t);return{setMenuBuilt:(e,o)=>{t.set({...t.get(),[e]:{type:"prepared",menu:o}})},setContents:(r,a,i,l)=>{n.set(r),e.set(i),t.set(a),s.set(l);const c=((e,t)=>{const o={};ie(e,((e,t)=>{V(e,(e=>{o[e]=t}))}));const n=t,s=ce(t,((e,t)=>({k:e,v:t}))),r=le(s,((e,t)=>[t].concat(cf(o,n,s,t))));return le(o,(e=>fe(r,e).getOr([e])))})(l,i);o.set(c)},expand:t=>fe(e.get(),t).map((e=>{const n=fe(o.get(),t).getOr([]);return[e].concat(n)})),refresh:e=>fe(o.get(),e),collapse:e=>fe(o.get(),e).bind((e=>e.length>1?A.some(e.slice(1)):A.none())),lookupMenu:a,lookupItem:i,otherMenus:e=>{const t=s.get();return K(re(t),e)},getPrimary:()=>n.get().bind(r),getMenus:()=>t.get(),clear:()=>{e.set({}),t.set({}),o.set({}),n.clear()},isClear:()=>n.get().isNone(),getTriggeringPath:(t,s)=>{const a=P(i(t).toArray(),(e=>r(e).isSome()));return fe(o.get(),t).bind((t=>{const o=X(a.concat(t));return(e=>{const t=[];for(let o=0;o<e.length;o++){const n=e[o];if(!n.isSome())return A.none();t.push(n.getOrDie())}return A.some(t)})(q(o,((t,a)=>((t,o,n)=>r(t).bind((s=>(t=>pe(e.get(),((e,o)=>e===t)))(t).bind((e=>o(e).map((e=>({triggeredMenu:s,triggeringItem:e,triggeringPath:n}))))))))(t,s,o.slice(0,a+1)).fold((()=>xe(n.get(),t)?[]:[A.none()]),(e=>[A.some(e)])))))}))}}},mf=df,gf=Di("tiered-menu-item-highlight"),pf=Di("tiered-menu-item-dehighlight");var hf;!function(e){e[e.HighlightMenuAndItem=0]="HighlightMenuAndItem",e[e.HighlightJustMenu=1]="HighlightJustMenu",e[e.HighlightNone=2]="HighlightNone"}(hf||(hf={}));const ff=y("collapse-item"),bf=Gm({name:"TieredMenu",configFields:[yi("onExecute"),yi("onEscape"),xi("onOpenMenu"),xi("onOpenSubmenu"),bi("onRepositionMenu"),bi("onCollapseMenu"),ws("highlightOnOpen",hf.HighlightMenuAndItem),ds("data",[rs("primary"),rs("menus"),rs("expansions")]),ws("fakeFocus",!1),bi("onHighlightItem"),bi("onDehighlightItem"),bi("onHover"),pi(),rs("dom"),ws("navigateOnHover",!0),ws("stayInDom",!1),$u("tmenuBehaviours",[bh,wg,Jm,_h]),ws("eventOrder",{})],apis:{collapseMenu:(e,t)=>{e.collapseMenu(t)},highlightPrimary:(e,t)=>{e.highlightPrimary(t)},repositionMenus:(e,t)=>{e.repositionMenus(t)}},factory:(e,t)=>{const o=nn(),n=uf(),s=e=>ju.getValue(e).value,r=t=>le(e.data.menus,((e,t)=>q(e.items,(e=>"separator"===e.type?[]:[e.data.value])))),a=wg.highlight,i=(t,o)=>{a(t,o),wg.getHighlighted(o).orThunk((()=>wg.getFirst(o))).each((n=>{e.fakeFocus?wg.highlight(o,n):zr(t,n.element,gr())}))},l=(e,t)=>ye(L(t,(t=>e.lookupMenu(t).bind((e=>"prepared"===e.type?A.some(e.menu):A.none()))))),c=(t,o,n)=>{const s=l(o,o.otherMenus(n));V(s,(o=>{Oa(o.element,[e.markers.backgroundMenu]),e.stayInDom||_h.remove(t,o)}))},d=(t,n)=>{const r=(t=>o.get().getOrThunk((()=>{const n={},r=kd(t.element,`.${e.markers.item}`),a=P(r,(e=>"true"===kt(e,"aria-haspopup")));return V(a,(e=>{t.getSystem().getByDom(e).each((e=>{const t=s(e);n[t]=e}))})),o.set(n),n})))(t);ie(r,((e,t)=>{const o=F(n,t);St(e.element,"aria-expanded",o)}))},u=(t,o,n)=>A.from(n[0]).bind((s=>o.lookupMenu(s).bind((s=>{if("notbuilt"===s.type)return A.none();{const r=s.menu,a=l(o,n.slice(1));return V(a,(t=>{ya(t.element,e.markers.backgroundMenu)})),vt(r.element)||_h.append(t,hl(r)),Oa(r.element,[e.markers.backgroundMenu]),i(t,r),c(t,o,n),A.some(r)}}))));let m;!function(e){e[e.HighlightSubmenu=0]="HighlightSubmenu",e[e.HighlightParent=1]="HighlightParent"}(m||(m={}));const g=(t,o,r=m.HighlightSubmenu)=>{if(o.hasConfigured(ug)&&ug.isDisabled(o))return A.some(o);{const a=s(o);return n.expand(a).bind((s=>(d(t,s),A.from(s[0]).bind((a=>n.lookupMenu(a).bind((i=>{const l=((e,t,o)=>{if("notbuilt"===o.type){const s=e.getSystem().build(o.nbMenu());return n.setMenuBuilt(t,s),s}return o.menu})(t,a,i);return vt(l.element)||_h.append(t,hl(l)),e.onOpenSubmenu(t,o,l,X(s)),r===m.HighlightSubmenu?(wg.highlightFirst(l),u(t,n,s)):(wg.dehighlightAll(l),A.some(o))})))))))}},p=(t,o)=>{const r=s(o);return n.collapse(r).bind((s=>(d(t,s),u(t,n,s).map((n=>(e.onCollapseMenu(t,o,n),n))))))},h=t=>(o,n)=>_l(n.getSource(),`.${e.markers.item}`).bind((e=>o.getSystem().getByDom(e).toOptional().bind((e=>t(o,e).map(E))))),f=Hr([Wr(af(),((e,t)=>{const o=t.event.item;n.lookupItem(s(o)).each((()=>{const o=t.event.menu;wg.highlight(e,o);const r=s(t.event.item);n.refresh(r).each((t=>c(e,n,t)))}))})),ea(((t,o)=>{const n=o.event.target;t.getSystem().getByDom(n).each((o=>{0===s(o).indexOf("collapse-item")&&p(t,o),g(t,o,m.HighlightSubmenu).fold((()=>{e.onExecute(t,o)}),b)}))})),Jr(((t,o)=>{(t=>{const o=((t,o,n)=>le(n,((n,s)=>{const r=()=>lf.sketch({...n,value:s,markers:e.markers,fakeFocus:e.fakeFocus,onHighlight:(e,t)=>{Rr(e,gf,{menuComp:e,itemComp:t})},onDehighlight:(e,t)=>{Rr(e,pf,{menuComp:e,itemComp:t})},focusManager:e.fakeFocus?Wg():Ug()});return s===o?{type:"prepared",menu:t.getSystem().build(r())}:{type:"notbuilt",nbMenu:r}})))(t,e.data.primary,e.data.menus),s=r();return n.setContents(e.data.primary,o,e.data.expansions,s),n.getPrimary()})(t).each((o=>{_h.append(t,hl(o)),e.onOpenMenu(t,o),e.highlightOnOpen===hf.HighlightMenuAndItem?i(t,o):e.highlightOnOpen===hf.HighlightJustMenu&&a(t,o)}))})),Wr(gf,((t,o)=>{e.onHighlightItem(t,o.event.menuComp,o.event.itemComp)})),Wr(pf,((t,o)=>{e.onDehighlightItem(t,o.event.menuComp,o.event.itemComp)})),...e.navigateOnHover?[Wr(Yh(),((t,o)=>{const r=o.event.item;((e,t)=>{const o=s(t);n.refresh(o).bind((t=>(d(e,t),u(e,n,t))))})(t,r),g(t,r,m.HighlightParent),e.onHover(t,r)}))]:[]]),v=e=>wg.getHighlighted(e).bind(wg.getHighlighted),x={collapseMenu:e=>{v(e).each((t=>{p(e,t)}))},highlightPrimary:e=>{n.getPrimary().each((t=>{i(e,t)}))},repositionMenus:t=>{const o=n.getPrimary().bind((e=>v(t).bind((e=>{const t=s(e),o=he(n.getMenus()),r=ye(L(o,mf));return n.getTriggeringPath(t,(e=>((e,t,o)=>se(t,(e=>{if(!e.getSystem().isConnected())return A.none();const t=wg.getCandidates(e);return j(t,(e=>s(e)===o))})))(0,r,e)))})).map((t=>({primary:e,triggeringPath:t})))));o.fold((()=>{(e=>A.from(e.components()[0]).filter((e=>"menu"===kt(e.element,"role"))))(t).each((o=>{e.onRepositionMenu(t,o,[])}))}),(({primary:o,triggeringPath:n})=>{e.onRepositionMenu(t,o,n)}))}};return{uid:e.uid,dom:e.dom,markers:e.markers,behaviours:qu(e.tmenuBehaviours,[bh.config({mode:"special",onRight:h(((e,t)=>Ym(t.element)?A.none():g(e,t,m.HighlightSubmenu))),onLeft:h(((e,t)=>Ym(t.element)?A.none():p(e,t))),onEscape:h(((t,o)=>p(t,o).orThunk((()=>e.onEscape(t,o).map((()=>t)))))),focusIn:(e,t)=>{n.getPrimary().each((t=>{zr(e,t.element,gr())}))}}),wg.config({highlightClass:e.markers.selectedMenu,itemClass:e.markers.menu}),Jm.config({find:e=>wg.getHighlighted(e)}),_h.config({})]),eventOrder:e.eventOrder,apis:x,events:f}},extraApis:{tieredData:(e,t,o)=>({primary:e,menus:t,expansions:o}),singleData:(e,t)=>({primary:e,menus:Ds(e,t),expansions:{}}),collapseItem:e=>({value:Di(ff()),meta:{text:e}})}}),vf=Gm({name:"InlineView",configFields:[rs("lazySink"),bi("onShow"),bi("onHide"),vs("onEscape"),$u("inlineBehaviours",[ku,ju,dc]),ys("fireDismissalEventInstead",[ws("event",Or())]),ys("fireRepositionEventInstead",[ws("event",_r())]),ws("getRelated",A.none),ws("isExtraPart",T),ws("eventOrder",A.none)],factory:(e,t)=>{const o=(t,o,n,s)=>{const r=e.lazySink(t).getOrDie();ku.openWhileCloaked(t,o,(()=>Qd.positionWithinBounds(r,t,n,s()))),ju.setValue(t,A.some({mode:"position",config:n,getBounds:s}))},n=(t,o,n,s)=>{const r=((e,t,o,n,s)=>{const r=()=>e.lazySink(t),a="horizontal"===n.type?{layouts:{onLtr:()=>ac(),onRtl:()=>ic()}}:{},i=e=>(e=>2===e.length)(e)?a:{};return bf.sketch({dom:{tag:"div"},data:n.data,markers:n.menu.markers,highlightOnOpen:n.menu.highlightOnOpen,fakeFocus:n.menu.fakeFocus,onEscape:()=>(ku.close(t),e.onEscape.map((e=>e(t))),A.some(!0)),onExecute:()=>A.some(!0),onOpenMenu:(e,t)=>{Qd.positionWithinBounds(r().getOrDie(),t,o,s())},onOpenSubmenu:(e,t,o,n)=>{const s=r().getOrDie();Qd.position(s,o,{anchor:{type:"submenu",item:t,...i(n)}})},onRepositionMenu:(e,t,n)=>{const a=r().getOrDie();Qd.positionWithinBounds(a,t,o,s()),V(n,(e=>{const t=i(e.triggeringPath);Qd.position(a,e.triggeredMenu,{anchor:{type:"submenu",item:e.triggeringItem,...t}})}))}})})(e,t,o,n,s);ku.open(t,r),ju.setValue(t,A.some({mode:"menu",menu:r}))},s=t=>{ku.isOpen(t)&&ju.getValue(t).each((o=>{switch(o.mode){case"menu":ku.getState(t).each(bf.repositionMenus);break;case"position":const n=e.lazySink(t).getOrDie();Qd.positionWithinBounds(n,t,o.config,o.getBounds())}}))},r={setContent:(e,t)=>{ku.setContent(e,t)},showAt:(e,t,n)=>{const s=A.none;o(e,t,n,s)},showWithinBounds:o,showMenuAt:(e,t,o)=>{n(e,t,o,A.none)},showMenuWithinBounds:n,hide:e=>{ku.isOpen(e)&&(ju.setValue(e,A.none()),ku.close(e))},getContent:e=>ku.getState(e),reposition:s,isOpen:ku.isOpen};return{uid:e.uid,dom:e.dom,behaviours:qu(e.inlineBehaviours,[ku.config({isPartOf:(t,o,n)=>Al(o,n)||((t,o)=>e.getRelated(t).exists((e=>Al(e,o))))(t,n),getAttachPoint:t=>e.lazySink(t).getOrDie(),onOpen:t=>{e.onShow(t)},onClose:t=>{e.onHide(t)}}),ju.config({store:{mode:"memory",initialValue:A.none()}}),dc.config({channels:{...Au({isExtraPart:t.isExtraPart,...e.fireDismissalEventInstead.map((e=>({fireEventInstead:{event:e.event}}))).getOr({})}),...Du({...e.fireRepositionEventInstead.map((e=>({fireEventInstead:{event:e.event}}))).getOr({}),doReposition:s})}})]),eventOrder:e.eventOrder,apis:r}},apis:{showAt:(e,t,o,n)=>{e.showAt(t,o,n)},showWithinBounds:(e,t,o,n,s)=>{e.showWithinBounds(t,o,n,s)},showMenuAt:(e,t,o,n)=>{e.showMenuAt(t,o,n)},showMenuWithinBounds:(e,t,o,n,s)=>{e.showMenuWithinBounds(t,o,n,s)},hide:(e,t)=>{e.hide(t)},isOpen:(e,t)=>e.isOpen(t),getContent:(e,t)=>e.getContent(t),setContent:(e,t,o)=>{e.setContent(t,o)},reposition:(e,t)=>{e.reposition(t)}}});var xf,yf,wf=tinymce.util.Tools.resolve("tinymce.util.Delay"),Sf=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Cf=tinymce.util.Tools.resolve("tinymce.EditorManager"),kf=tinymce.util.Tools.resolve("tinymce.Env");!function(e){e.default="wrap",e.floating="floating",e.sliding="sliding",e.scrolling="scrolling"}(xf||(xf={})),function(e){e.auto="auto",e.top="top",e.bottom="bottom"}(yf||(yf={}));const Of=e=>t=>t.options.get(e),_f=e=>t=>A.from(e(t)),Tf=e=>{const t=kf.deviceType.isPhone(),o=kf.deviceType.isTablet()||t,n=e.options.register,s=e=>r(e)||!1===e,a=e=>r(e)||h(e);n("skin",{processor:e=>r(e)||!1===e,default:"oxide"}),n("skin_url",{processor:"string"}),n("height",{processor:a,default:Math.max(e.getElement().offsetHeight,400)}),n("width",{processor:a,default:Sf.DOM.getStyle(e.getElement(),"width")}),n("min_height",{processor:"number",default:100}),n("min_width",{processor:"number"}),n("max_height",{processor:"number"}),n("max_width",{processor:"number"}),n("style_formats",{processor:"object[]"}),n("style_formats_merge",{processor:"boolean",default:!1}),n("style_formats_autohide",{processor:"boolean",default:!1}),n("line_height_formats",{processor:"string",default:"1 1.1 1.2 1.3 1.4 1.5 2"}),n("font_family_formats",{processor:"string",default:"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"}),n("font_size_formats",{processor:"string",default:"8pt 10pt 12pt 14pt 18pt 24pt 36pt"}),n("font_size_input_default_unit",{processor:"string",default:"pt"}),n("block_formats",{processor:"string",default:"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre"}),n("content_langs",{processor:"object[]"}),n("removed_menuitems",{processor:"string",default:""}),n("menubar",{processor:e=>r(e)||d(e),default:!t}),n("menu",{processor:"object",default:{}}),n("toolbar",{processor:e=>d(e)||r(e)||l(e)?{value:e,valid:!0}:{valid:!1,message:"Must be a boolean, string or array."},default:!0}),N(9,(e=>{n("toolbar"+(e+1),{processor:"string"})})),n("toolbar_mode",{processor:"string",default:o?"scrolling":"floating"}),n("toolbar_groups",{processor:"object",default:{}}),n("toolbar_location",{processor:"string",default:yf.auto}),n("toolbar_persist",{processor:"boolean",default:!1}),n("toolbar_sticky",{processor:"boolean",default:e.inline}),n("toolbar_sticky_offset",{processor:"number",default:0}),n("fixed_toolbar_container",{processor:"string",default:""}),n("fixed_toolbar_container_target",{processor:"object"}),n("ui_mode",{processor:"string",default:"combined"}),n("file_picker_callback",{processor:"function"}),n("file_picker_validator_handler",{processor:"function"}),n("file_picker_types",{processor:"string"}),n("typeahead_urls",{processor:"boolean",default:!0}),n("anchor_top",{processor:s,default:"#top"}),n("anchor_bottom",{processor:s,default:"#bottom"}),n("draggable_modal",{processor:"boolean",default:!1}),n("statusbar",{processor:"boolean",default:!0}),n("elementpath",{processor:"boolean",default:!0}),n("branding",{processor:"boolean",default:!0}),n("promotion",{processor:"boolean",default:!0}),n("resize",{processor:e=>"both"===e||d(e),default:!kf.deviceType.isTouch()}),n("sidebar_show",{processor:"string"}),n("help_accessibility",{processor:"boolean",default:e.hasPlugin("help")}),n("default_font_stack",{processor:"string[]",default:[]})},Ef=Of("readonly"),Af=Of("height"),Mf=Of("width"),Df=_f(Of("min_width")),Bf=_f(Of("min_height")),If=_f(Of("max_width")),Ff=_f(Of("max_height")),Rf=_f(Of("style_formats")),Nf=Of("style_formats_merge"),zf=Of("style_formats_autohide"),Lf=Of("content_langs"),Vf=Of("removed_menuitems"),Hf=Of("toolbar_mode"),Pf=Of("toolbar_groups"),Uf=Of("toolbar_location"),Wf=Of("fixed_toolbar_container"),jf=Of("fixed_toolbar_container_target"),$f=Of("toolbar_persist"),Gf=Of("toolbar_sticky_offset"),qf=Of("menubar"),Yf=Of("toolbar"),Xf=Of("file_picker_callback"),Kf=Of("file_picker_validator_handler"),Jf=Of("font_size_input_default_unit"),Qf=Of("file_picker_types"),Zf=Of("typeahead_urls"),eb=Of("anchor_top"),tb=Of("anchor_bottom"),ob=Of("draggable_modal"),nb=Of("statusbar"),sb=Of("elementpath"),rb=Of("branding"),ab=Of("resize"),ib=Of("paste_as_text"),lb=Of("sidebar_show"),cb=Of("promotion"),db=Of("help_accessibility"),ub=Of("default_font_stack"),mb=e=>!1===e.options.get("skin"),gb=e=>!1!==e.options.get("menubar"),pb=e=>{const t=e.options.get("skin_url");if(mb(e))return t;if(t)return e.documentBaseURI.toAbsolute(t);{const t=e.options.get("skin");return Cf.baseURL+"/skins/ui/"+t}},hb=e=>A.from(e.options.get("skin_url")),fb=e=>e.options.get("line_height_formats").split(" "),bb=e=>{const t=Yf(e),o=r(t),n=l(t)&&t.length>0;return!xb(e)&&(n||o||!0===t)},vb=e=>{const t=N(9,(t=>e.options.get("toolbar"+(t+1)))),o=P(t,r);return Ce(o.length>0,o)},xb=e=>vb(e).fold((()=>{const t=Yf(e);return f(t,r)&&t.length>0}),E),yb=e=>Uf(e)===yf.bottom,wb=e=>{var t;if(!e.inline)return A.none();const o=null!==(t=Wf(e))&&void 0!==t?t:"";if(o.length>0)return Ol(xt(),o);const n=jf(e);return g(n)?A.some(ze(n)):A.none()},Sb=e=>e.inline&&wb(e).isSome(),Cb=e=>wb(e).getOrThunk((()=>ht(pt(ze(e.getElement()))))),kb=e=>e.inline&&!gb(e)&&!bb(e)&&!xb(e),Ob=e=>(e.options.get("toolbar_sticky")||e.inline)&&!Sb(e)&&!kb(e),_b=e=>!Sb(e)&&"split"===e.options.get("ui_mode"),Tb=e=>{const t=e.options.get("menu");return le(t,(e=>({...e,items:e.items})))};var Eb=Object.freeze({__proto__:null,get ToolbarMode(){return xf},get ToolbarLocation(){return yf},register:Tf,getSkinUrl:pb,getSkinUrlOption:hb,isReadOnly:Ef,isSkinDisabled:mb,getHeightOption:Af,getWidthOption:Mf,getMinWidthOption:Df,getMinHeightOption:Bf,getMaxWidthOption:If,getMaxHeightOption:Ff,getUserStyleFormats:Rf,shouldMergeStyleFormats:Nf,shouldAutoHideStyleFormats:zf,getLineHeightFormats:fb,getContentLanguages:Lf,getRemovedMenuItems:Vf,isMenubarEnabled:gb,isMultipleToolbars:xb,isToolbarEnabled:bb,isToolbarPersist:$f,getMultipleToolbarsOption:vb,getUiContainer:Cb,useFixedContainer:Sb,isSplitUiMode:_b,getToolbarMode:Hf,isDraggableModal:ob,isDistractionFree:kb,isStickyToolbar:Ob,getStickyToolbarOffset:Gf,getToolbarLocation:Uf,isToolbarLocationBottom:yb,getToolbarGroups:Pf,getMenus:Tb,getMenubar:qf,getToolbar:Yf,getFilePickerCallback:Xf,getFilePickerTypes:Qf,useTypeaheadUrls:Zf,getAnchorTop:eb,getAnchorBottom:tb,getFilePickerValidatorHandler:Kf,getFontSizeInputDefaultUnit:Jf,useStatusBar:nb,useElementPath:sb,promotionEnabled:cb,useBranding:rb,getResize:ab,getPasteAsText:ib,getSidebarShow:lb,useHelpAccessibility:db,getDefaultFontStack:ub});const Ab=["visible","hidden","clip"],Mb=e=>Ae(e).length>0&&!F(Ab,e),Db=e=>{if(je(e)){const t=It(e,"overflow-x"),o=It(e,"overflow-y");return Mb(t)||Mb(o)}return!1},Bb=e=>e.plugins.fullscreen&&e.plugins.fullscreen.isFullscreen(),Ib=(e,t)=>_b(e)?((e,t)=>{const o=Cd(t,Db),n=0===o.length?ft(t).map(bt).map((e=>Cd(e,Db))).getOr([]):o;return te(n).map((t=>({element:t,others:n.slice(1),isFullscreen:()=>Bb(e)})))})(e,t):A.none(),Fb=e=>{const t=[...L(e.others,Ko),Zo()];return e.isFullscreen()?Zo():((e,t)=>W(t,((e,t)=>Qo(e,t)),e))(Ko(e.element),t)},Rb=Gm({name:"Button",factory:e=>{const t=Uh(e.action),o=e.dom.tag,n=t=>fe(e.dom,"attributes").bind((e=>fe(e,t)));return{uid:e.uid,dom:e.dom,components:e.components,events:t,behaviours:Xu(e.buttonBehaviours,[Bh.config({}),bh.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:"button"===o?{type:n("type").getOr("button"),...n("role").map((e=>({role:e}))).getOr({})}:{role:e.role.getOr(n("role").getOr("button"))}},eventOrder:e.eventOrder}},configFields:[ws("uid",void 0),rs("dom"),ws("components",[]),Yu("buttonBehaviours",[Bh,bh]),gs("action"),gs("role"),ws("eventOrder",{})]}),Nb=e=>{const t=Fe(e),o=lt(t),n=(e=>{const t=void 0!==e.dom.attributes?e.dom.attributes:[];return W(t,((e,t)=>"class"===t.name?e:{...e,[t.name]:t.value}),{})})(t),s=(e=>Array.prototype.slice.call(e.dom.classList,0))(t),r=0===o.length?{}:{innerHtml:ti(t)};return{tag:Ue(t),classes:s,attributes:n,...r}},zb=e=>{const t=(e=>void 0!==e.uid)(e)&&ve(e,"uid")?e.uid:Li("memento");return{get:e=>e.getSystem().getByUid(t).getOrDie(),getOpt:e=>e.getSystem().getByUid(t).toOptional(),asSpec:()=>({...e,uid:t})}};var Lb=Object.freeze({__proto__:null,exhibit:(e,t)=>na({attributes:Bs([{key:t.tabAttr,value:"true"}])})}),Vb=[ws("tabAttr","data-alloy-tabstop")];const Hb=ua({fields:Vb,name:"tabstopping",active:Lb}),Pb=Di("tooltip.exclusive"),Ub=Di("tooltip.show"),Wb=Di("tooltip.hide"),jb=Di("tooltip.immediateHide"),$b=Di("tooltip.immediateShow"),Gb=(e,t,o)=>{e.getSystem().broadcastOn([Pb],{})};var qb=Object.freeze({__proto__:null,hideAllExclusive:Gb,immediateOpenClose:(e,t,o,n)=>Fr(e,n?$b:jb),isEnabled:(e,t,o)=>o.isEnabled(),setComponents:(e,t,o,n)=>{o.getTooltip().each((e=>{e.getSystem().isConnected()&&_h.set(e,n)}))},setEnabled:(e,t,o,n)=>o.setEnabled(n)}),Yb=Object.freeze({__proto__:null,events:(e,t)=>{const o=o=>{t.getTooltip().each((n=>{n.getSystem().isConnected()&&(lu(n),e.onHide(o,n),t.clearTooltip())})),t.clearTimer()},n=o=>{if(!t.isShowing()&&t.isEnabled()){Gb(o);const n=e.lazySink(o).getOrDie(),s=o.getSystem().build({dom:e.tooltipDom,components:e.tooltipComponents,events:Hr("normal"===e.mode?[Wr(Ys(),(e=>{Fr(o,Ub)})),Wr(Gs(),(e=>{Fr(o,Wb)}))]:[]),behaviours:ca([_h.config({})])});t.setTooltip(s),ru(n,s),e.onShow(o,s),Qd.position(n,s,{anchor:e.anchor(o)})}},s=o=>{t.getTooltip().each((t=>{const n=e.lazySink(o).getOrDie();Qd.position(n,t,{anchor:e.anchor(o)})}))};return Hr(G([[Zr((t=>{e.onSetup(t)})),Wr(Ub,(o=>{t.resetTimer((()=>{n(o)}),e.delayForShow())})),Wr(Wb,(n=>{t.resetTimer((()=>{o(n)}),e.delayForHide())})),Wr($b,(e=>{t.resetTimer((()=>{n(e)}),0)})),Wr(jb,(e=>{t.resetTimer((()=>{o(e)}),0)})),Wr(ur(),((e,t)=>{const n=t;n.universal||F(n.channels,Pb)&&o(e)})),Qr((e=>{o(e)}))],(()=>{switch(e.mode){case"normal":return[Wr(Xs(),(e=>{Fr(e,$b)})),Wr(cr(),(e=>{Fr(e,jb)})),Wr(Ys(),(e=>{Fr(e,Ub)})),Wr(Gs(),(e=>{Fr(e,Wb)}))];case"follow-highlight":return[Wr(Br(),((e,t)=>{Fr(e,Ub)})),Wr(Ir(),(e=>{Fr(e,Wb)}))];case"children-normal":return[Wr(Xs(),((o,n)=>{fc(o.element).each((r=>{Ke(n.event.target,"[data-mce-tooltip]")&&t.getTooltip().fold((()=>{Fr(o,$b)}),(n=>{t.isShowing()&&(e.onShow(o,n),s(o))}))}))})),Wr(cr(),(e=>{fc(e.element).fold((()=>{Fr(e,jb)}),b)})),Wr(Ys(),(o=>{Ol(o.element,"[data-mce-tooltip]:hover").each((n=>{t.getTooltip().fold((()=>{Fr(o,Ub)}),(n=>{t.isShowing()&&(e.onShow(o,n),s(o))}))}))})),Wr(Gs(),(e=>{Ol(e.element,"[data-mce-tooltip]:hover").fold((()=>{Fr(e,Wb)}),b)}))];default:return[Wr(Xs(),((o,n)=>{fc(o.element).each((r=>{Ke(n.event.target,"[data-mce-tooltip]")&&t.getTooltip().fold((()=>{Fr(o,$b)}),(n=>{t.isShowing()&&(e.onShow(o,n),s(o))}))}))})),Wr(cr(),(e=>{fc(e.element).fold((()=>{Fr(e,jb)}),b)}))]}})()]))}}),Xb=[rs("lazySink"),rs("tooltipDom"),ws("exclusive",!0),ws("tooltipComponents",[]),Ts("delayForShow",y(300)),Ts("delayForHide",y(300)),Ts("onSetup",b),Os("mode","normal",["normal","follow-highlight","children-keyboard-focus","children-normal"]),ws("anchor",(e=>({type:"hotspot",hotspot:e,layouts:{onLtr:y([Zl,Ql,Yl,Kl,Xl,Jl]),onRtl:y([Zl,Ql,Yl,Kl,Xl,Jl])},bubble:Wc(0,-2,{})}))),bi("onHide"),bi("onShow")],Kb=Object.freeze({__proto__:null,init:()=>{const e=en(!0),t=nn(),o=nn(),n=()=>{t.on(clearTimeout)},s=y("not-implemented");return la({getTooltip:o.get,isShowing:o.isSet,setTooltip:o.set,clearTooltip:o.clear,clearTimer:n,resetTimer:(e,o)=>{n(),t.set(setTimeout(e,o))},readState:s,isEnabled:()=>e.get(),setEnabled:t=>e.set(t)})}});const Jb=ua({fields:Xb,name:"tooltipping",active:Yb,state:Kb,apis:qb}),{entries:Qb,setPrototypeOf:Zb,isFrozen:ev,getPrototypeOf:tv,getOwnPropertyDescriptor:ov}=Object;
|
5
5
|
/*! @license DOMPurify 3.1.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.7/LICENSE */let{freeze:nv,seal:sv,create:rv}=Object,{apply:av,construct:iv}="undefined"!=typeof Reflect&&Reflect;// eslint-disable-line import/no-mutable-exports
|