PageSourceSearch

https://web.roapp.io/static/dist/js/4934.933b0ad6b35ba63db7e2.js

js roapp.io collected 2026-09-24 12:52:28 UTC 446,204 bytes, 35 lines download raw bytes

1(self.webpackChunkorderry=self.webpackChunkorderry||[]).push([[4934],{4934:function(){(function(){"use strict";const cA=Object.getPrototypeOf,Rf=(t,e,o)=>{var n;return o(t,e.prototype)?!0:((n=t.constructor)===null||n===void 0?void 0:n.name)===e.name},iA=t=>{const e=typeof t;return t===null?"null":e==="object"&&Array.isArray(t)?"array":e==="object"&&Rf(t,String,(o,n)=>n.isPrototypeOf(o))?"string":e},yd=t=>e=>iA(e)===t,xd=t=>e=>typeof e===t,Pf=t=>e=>t===e,lA=(t,e)=>Ys(t)&&Rf(t,e,(o,n)=>cA(o)===n),Et=yd("string"),Ys=yd("object"),Lf=t=>lA(t,Object),vs=yd("array"),ma=Pf(null),ys=xd("boolean"),os=Pf(void 0),Bi=t=>t==null,$e=t=>!Bi(t),Xo=xd("function"),ns=xd("number"),ga=(t,e)=>{if(vs(t)){for(let o=0,n=t.length;o<n;++o)if(!e(t[o]))return!1;return!0}return!1},$=()=>{},uA=t=>()=>t(),Sd=(t,e)=>(...o)=>t(e.apply(null,o)),dA=(t,e)=>o=>t(e(o)),w=t=>()=>t,xt=t=>t,Vf=(t,e)=>t===e;function mo(t,...e){return(...o)=>{const n=e.concat(o);return t.apply(null,n)}}const pc=t=>e=>!t(e),wd=t=>()=>{throw new Error(t)},Td=t=>t(),Pt=w(!1),ve=w(!0);class d{constructor(e,o){this.tag=e,this.value=o}static some(e){return new d(!0,e)}static none(){return d.singletonNone}fold(e,o){return this.tag?o(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?d.some(e(this.value)):d.none()}bind(e){return this.tag?e(this.value):d.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:d.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(e!=null?e:"Called getOrDie on None")}static from(e){return $e(e)?d.some(e):d.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()"}}d.singletonNone=new d(!1);const Ri=Array.prototype.slice,mA=Array.prototype.indexOf,gA=Array.prototype.push,Hf=(t,e)=>mA.call(t,e),pA=(t,e)=>{const o=Hf(t,e);return o===-1?d.none():d.some(o)},le=(t,e)=>Hf(t,e)>-1,Ko=(t,e)=>{for(let o=0,n=t.length;o<n;o++){const s=t[o];if(e(s,o))return!0}return!1},Cd=(t,e)=>{const o=[];for(let n=0;n<t;n++)o.push(e(n));return o},Nf=(t,e)=>{const o=[];for(let n=0;n<t.length;n+=e){const s=Ri.call(t,n,n+e);o.push(s)}return o},L=(t,e)=>{const o=t.length,n=new Array(o);for(let s=0;s<o;s++){const r=t[s];n[s]=e(r,s)}return n},q=(t,e)=>{for(let o=0,n=t.length;o<n;o++){const s=t[o];e(s,o)}},hA=(t,e)=>{for(let o=t.length-1;o>=0;o--){const n=t[o];e(n,o)}},_d=(t,e)=>{const o=[],n=[];for(let s=0,r=t.length;s<r;s++){const a=t[s];(e(a,s)?o:n).push(a)}return{pass:o,fail:n}},Wt=(t,e)=>{const o=[];for(let n=0,s=t.length;n<s;n++){const r=t[n];e(r,n)&&o.push(r)}return o},pa=(t,e,o)=>(hA(t,(n,s)=>{o=e(o,n,s)}),o),Ge=(t,e,o)=>(q(t,(n,s)=>{o=e(o,n,s)}),o),fA=(t,e,o)=>{for(let n=0,s=t.length;n<s;n++){const r=t[n];if(e(r,n))return d.some(r);if(o(r,n))break}return d.none()},ee=(t,e)=>fA(t,e,Pt),ha=(t,e)=>{for(let o=0,n=t.length;o<n;o++){const s=t[o];if(e(s,o))return d.some(o)}return d.none()},Ie=t=>{const e=[];for(let o=0,n=t.length;o<n;++o){if(!vs(t[o]))throw new Error("Arr.flatten item "+o+" was not an array, input: "+t);gA.apply(e,t[o])}return e},ye=(t,e)=>Ie(L(t,e)),fa=(t,e)=>{for(let o=0,n=t.length;o<n;++o){const s=t[o];if(e(s,o)!==!0)return!1}return!0},hc=t=>{const e=Ri.call(t,0);return e.reverse(),e},Sr=(t,e)=>Wt(t,o=>!le(e,o)),zf=(t,e)=>{const o={};for(let n=0,s=t.length;n<s;n++){const r=t[n];o[String(r)]=e(r,n)}return o},bA=t=>[t],Uf=(t,e)=>{const o=Ri.call(t,0);return o.sort(e),o},Pi=(t,e)=>e>=0&&e<t.length?d.some(t[e]):d.none(),$n=t=>Pi(t,0),Od=t=>Pi(t,t.length-1),vA=Xo(Array.from)?Array.from:t=>Ri.call(t),In=(t,e)=>{for(let o=0;o<t.length;o++){const n=e(t[o],o);if(n.isSome())return n}return d.none()},xe=Object.keys,yA=Object.hasOwnProperty,Ze=(t,e)=>{const o=xe(t);for(let n=0,s=o.length;n<s;n++){const r=o[n],a=t[r];e(a,r)}},we=(t,e)=>Wf(t,(o,n)=>({k:n,v:e(o,n)})),Wf=(t,e)=>{const o={};return Ze(t,(n,s)=>{const r=e(n,s);o[r.k]=r.v}),o},Ed=t=>(e,o)=>{t[o]=e},Gf=(t,e,o,n)=>{Ze(t,(s,r)=>{(e(s,r)?o:n)(s,r)})},xA=(t,e)=>{const o={},n={};
1return Gf(t,e,Ed(o),Ed(n)),{t:o,f:n}},jf=(t,e)=>{const o={};return Gf(t,e,Ed(o),$),o},Li=(t,e)=>{const o=[];return Ze(t,(n,s)=>{o.push(e(n,s))}),o},kd=(t,e)=>{const o=xe(t);for(let n=0,s=o.length;n<s;n++){const r=o[n],a=t[r];if(e(a,r,t))return d.some(a)}return d.none()},Ad=t=>Li(t,xt),tt=(t,e)=>At(t,e)?d.from(t[e]):d.none(),At=(t,e)=>yA.call(t,e),an=(t,e)=>At(t,e)&&t[e]!==void 0&&t[e]!==null,cn={generate:t=>{if(!vs(t))throw new Error("cases must be an array");if(t.length===0)throw new Error("there must be at least one case");const e=[],o={};return q(t,(n,s)=>{const r=xe(n);if(r.length!==1)throw new Error("one and only one name per case");const a=r[0],c=n[a];if(o[a]!==void 0)throw new Error("duplicate key detected:"+a);if(a==="cata")throw new Error("cannot have a case named cata (sorry)");if(!vs(c))throw new Error("case arguments must be an array");e.push(a),o[a]=(...i)=>{const l=i.length;if(l!==c.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+c.length+" ("+c+"), got "+l);return{fold:(...m)=>{if(m.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+m.length);return m[s].apply(null,i)},match:m=>{const g=xe(m);if(e.length!==g.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+`
2Actual: `+g.join(","));if(!fa(e,h=>le(g,h)))throw new Error("Not all branches were specified when using match. Specified: "+g.join(", ")+`
3Required: `+e.join(", "));return m[a].apply(null,i)},log:m=>{console.log(m,{constructors:e,constructor:a,params:i})}}}}),o}},X=t=>{let e=t;return{get:()=>e,set:s=>{e=s}}},Dd=t=>{let e=d.none(),o=[];const n=l=>Dd(u=>{s(m=>{u(l(m))})}),s=l=>{a()?i(l):o.push(l)},r=l=>{a()||(e=d.some(l),c(o),o=[])},a=()=>e.isSome(),c=l=>{q(l,i)},i=l=>{e.each(u=>{setTimeout(()=>{l(u)},0)})};return t(r),{get:s,map:n,isReady:a}},SA={nu:Dd,pure:t=>Dd(e=>{e(t)})},wA=t=>{setTimeout(()=>{throw t},0)},ba=t=>{const e=i=>{t().then(i,wA)};return{map:i=>ba(()=>t().then(i)),bind:i=>ba(()=>t().then(l=>i(l).toPromise())),anonBind:i=>ba(()=>t().then(()=>i.toPromise())),toLazy:()=>SA.nu(e),toCached:()=>{let i=null;return ba(()=>(i===null&&(i=t()),i))},toPromise:t,get:e}},Be={nu:t=>ba(()=>new Promise(t)),pure:t=>ba(()=>Promise.resolve(t))},Yf=t=>{const e=r=>r(t),o=w(t),n=()=>s,s={tag:!0,inner:t,fold:(r,a)=>a(t),isValue:ve,isError:Pt,map:r=>mt.value(r(t)),mapError:n,bind:e,exists:e,forall:e,getOr:o,or:n,getOrThunk:o,orThunk:n,getOrDie:o,each:r=>{r(t)},toOptional:()=>d.some(t)};return s},Xf=t=>{const e=()=>o,o={tag:!1,inner:t,fold:(n,s)=>n(t),isValue:Pt,isError:ve,map:e,mapError:n=>mt.error(n(t)),bind:e,exists:Pt,forall:ve,getOr:xt,or:xt,getOrThunk:Td,orThunk:Td,getOrDie:wd(String(t)),each:$,toOptional:d.none};return o},mt={value:Yf,error:Xf,fromOption:(t,e)=>t.fold(()=>Xf(e),Yf)},ln=t=>({...t,toCached:()=>ln(t.toCached()),bindFuture:i=>ln(t.bind(l=>l.fold(u=>Be.pure(mt.error(u)),u=>i(u)))),bindResult:i=>ln(t.map(l=>l.bind(i))),mapResult:i=>ln(t.map(l=>l.map(i))),mapError:i=>ln(t.map(l=>l.mapError(i))),foldResult:(i,l)=>t.map(u=>u.fold(i,l)),withTimeout:(i,l)=>ln(Be.nu(u=>{let m=!1;const g=setTimeout(()=>{m=!0,u(mt.error(l()))},i);t.get(p=>{m||(clearTimeout(g),u(p))})}))}),Kf=t=>ln(Be.nu(t)),qf=t=>ln(Be.pure(mt.value(t))),TA={nu:Kf,wrap:ln,pure:qf,value:qf,error:t=>ln(Be.pure(mt.error(t))),fromResult:t=>ln(Be.pure(t)),fromFuture:t=>ln(t.map(mt.value)),fromPromise:t=>Kf(e=>{t.then(o=>{e(mt.value(o))},o=>{e(mt.error(o))})})},CA=typeof window<"u"?window:Function("return this;")(),va=(t,e,o,n)=>{const s=t+e;return s>n?o:s<o?n:s},un=(t,e,o)=>Math.min(Math.max(t,e),o),_A=()=>window.crypto.getRandomValues(new Uint32Array(1))[0]/4294967295;let Jf=0;const V=t=>{const o=new Date().getTime(),n=Math.floor(_A()*1e9);return Jf++,t+"_"+n+Jf+String(o)},OA=(t,e)=>e,EA=(t,e)=>Lf(t)&&Lf(e)?Jt(t,e):e,Zf=t=>(...e)=>{if(e.length===0)throw new Error("Can't merge zero objects");const o={};for(let n=0;n<e.length;n++){const s=e[n];for(const r in s)At(s,r)&&(o[r]=t(o[r],s[r]))}return o},Jt=Zf(EA),Qf=Zf(OA),Bn=(t,e,o=Vf)=>t.exists(n=>o(n,e)),kA=(t,e,o=Vf)=>ya(t,e,o).getOr(t.isNone()&&e.isNone()),wr=t=>{const e=[],o=n=>
3{e.push(n)};for(let n=0;n<t.length;n++)t[n].each(o);return e},AA=t=>{const e=[];for(let o=0;o<t.length;o++){const n=t[o];if(n.isSome())e.push(n.getOrDie());else return d.none()}return d.some(e)},ya=(t,e,o)=>t.isSome()&&e.isSome()?d.some(o(t.getOrDie(),e.getOrDie())):d.none(),DA=(t,e,o,n)=>t.isSome()&&e.isSome()&&o.isSome()?d.some(n(t.getOrDie(),e.getOrDie(),o.getOrDie())):d.none(),tb=(t,e)=>t!=null?d.some(e(t)):d.none(),dn=(t,e)=>t?d.some(e):d.none(),MA=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),FA=(t,e)=>{let o=e!=null?e:CA;for(let n=0;n<t.length&&o!==void 0&&o!==null;++n)o=o[t[n]];return o},eb=(t,e)=>{const o=t.split(".");return FA(o,e)};cn.generate([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);const $A=t=>{const e=[],o=[];return q(t,n=>{n.fold(s=>{e.push(s)},s=>{o.push(s)})}),{errors:e,values:o}},Md=t=>{const e=X(d.none()),o=()=>e.get().each(t);return{clear:()=>{o(),e.set(d.none())},isSet:()=>e.get().isSome(),get:()=>e.get(),set:c=>{o(),e.set(d.some(c))}}},IA=()=>Md(t=>t.destroy()),xa=()=>Md(t=>t.unbind()),Rt=()=>{const t=Md($);return{...t,on:o=>t.get().each(o)}},BA=(t,e)=>t+e,RA=(t,e)=>t.substring(e),ob=(t,e,o)=>e===""||t.length>=e.length&&t.substr(o,o+e.length)===e,nb=(t,e)=>LA(t,e)?RA(t,e.length):t,PA=(t,e)=>Vi(t,e)?t:BA(t,e),go=(t,e,o=0,n)=>{const s=t.indexOf(e,o);return s!==-1?os(n)?!0:s+e.length<=n:!1},LA=(t,e)=>ob(t,e,0),Vi=(t,e)=>ob(t,e,t.length-e.length),Fd=(t=>e=>e.replace(t,""))(/^\s+|\s+$/g),Hi=t=>t.length>0,Ni=t=>!Hi(t),VA=t=>{const e=parseFloat(t);return isNaN(e)?d.none():d.some(e)},HA=(t,e)=>{let o=null,n=null;return{cancel:()=>{ma(o)||(clearTimeout(o),o=null,n=null)},throttle:(...a)=>{n=a,ma(o)&&(o=setTimeout(()=>{const c=n;o=null,n=null,t.apply(null,c)},e))}}},NA=(t,e)=>{let o=null;return{cancel:()=>{ma(o)||(clearTimeout(o),o=null)},throttle:(...r)=>{ma(o)&&(o=setTimeout(()=>{o=null,t.apply(null,r)},e))}}},$d=(t,e)=>{let o=null;const n=()=>{ma(o)||(clearTimeout(o),o=null)};return{cancel:n,throttle:(...r)=>{n(),o=setTimeout(()=>{o=null,t.apply(null,r)},e)}}},Xs=t=>{let e=!1,o;return(...n)=>(e||(e=!0,o=t.apply(null,n)),o)},zA="\uFEFF",UA="\xA0",WA=(t,e)=>{const n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1){const s="HTML does not have a single root node";throw console.error(s,t),new Error(s)}return fc(n.childNodes[0])},GA=(t,e)=>{const n=(e||document).createElement(t);return fc(n)},jA=(t,e)=>{const n=(e||document).createTextNode(t);return fc(n)},fc=t=>{if(t==null)throw new Error("Node cannot be null or undefined");return{dom:t}},I={fromHtml:WA,fromTag:GA,fromText:jA,fromDom:fc,fromPoint:(t,e,o)=>d.from(t.dom.elementFromPoint(e,o)).map(fc)},YA=(t,e)=>{e.fold(o=>{t.setStartBefore(o.dom)},(o,n)=>{t.setStart(o.dom,n)},o=>{t.setStartAfter(o.dom)})},XA=(t,e)=>{e.fold(o=>{t.setEndBefore(o.dom)},(o,n)=>{t.setEnd(o.dom,n)},o=>{t.setEndAfter(o.dom)})},sb=(t,e,o)=>{const n=t.document.createRange();return YA(n,e),XA(n,o),n},rb=(t,e,o,n,s)=>{const r=t.document.createRange();return r.setStart(e.dom,o),r.setEnd(n.dom,s),r},ab=t=>({left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}),KA=t=>{const e=t.getClientRects(),o=e.length>0?e[0]:t.getBoundingClientRect();return o.width>0||o.height>0?d.some(o).map(ab):d.none()},qA=t=>{const e=t.getBoundingClientRect();return e.width>0||e.height>0?d.some(e).map(ab):d.none()},bc=cn.generate([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),cb=(t,e,o)=>e(I.fromDom(o.startContainer),o.startOffset,I.fromDom(o.endContainer),o.endOffset),JA=(t,e)=>e.match({domRange:o=>({ltr:w(o),rtl:d.none}),relative:(o,n)=>({ltr:Xs(()=>sb(t,o,n)),rtl:Xs(()=>d.some(sb(t,n,o)))}),exact:(o,n,s,r)=>({ltr:Xs(()=>rb(t,o,n,s,r)),rtl:Xs(()=>d.some(rb(t,s,r,o,n)))})}),ZA=(t,e)=>{const o=e.ltr();return o.collapsed?e.rtl().filter(s=>s.collapsed===!1).map(s=>bc.rtl(I.fromDom(s.endContainer),s.endOffset,I.fromDom(s.startContainer),s.startOffset)).getOrThunk(()=>cb(t,bc.ltr,o)):cb(t,bc.ltr,o)},QA=(t,e)=>{const o=JA(t,e);return ZA(t,o)},ib=(t,e)=>QA(t,e).match({ltr:(n,s,r,a)=>{const c=t.document.createRange();return c.setStart(n.dom,s),c.setEnd(r.dom,a),c},rtl:(n,s,r,a)=>{const c=t.document.createRange();return c.setStart(r.dom,a),c.setEnd(n.dom,s),c}});bc.ltr,bc.rtl;const lb=9,ub=11,Id=1,tD=3,Sa=(t,e)=>{const o=t.dom;if(o.nodeType!==Id)return!1;{const n=o;if(n.matches!==void 0)return n.matches(e);if(n.msMatchesSelector!==void 0)return n.msMatchesSelector(e);
3if(n.webkitMatchesSelector!==void 0)return n.webkitMatchesSelector(e);if(n.mozMatchesSelector!==void 0)return n.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")}},db=t=>t.nodeType!==Id&&t.nodeType!==lb&&t.nodeType!==ub||t.childElementCount===0,eD=(t,e)=>{const o=e===void 0?document:e.dom;return db(o)?[]:L(o.querySelectorAll(t),I.fromDom)},mb=(t,e)=>{const o=e===void 0?document:e.dom;return db(o)?d.none():d.from(o.querySelector(t)).map(I.fromDom)},Ft=(t,e)=>t.dom===e.dom,zi=(t,e)=>{const o=t.dom,n=e.dom;return o===n?!1:o.contains(n)},oD=(t,e,o,n)=>{const s=t.isiOS()&&/ipad/i.test(o)===!0,r=t.isiOS()&&!s,a=t.isiOS()||t.isAndroid(),c=a||n("(pointer:coarse)"),i=s||!r&&a&&n("(min-device-width:768px)"),l=r||a&&!i,u=e.isSafari()&&t.isiOS()&&/safari/i.test(o)===!1,m=!l&&!i&&!u;return{isiPad:w(s),isiPhone:w(r),isTablet:w(i),isPhone:w(l),isTouch:w(c),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:w(u),isDesktop:w(m)}},nD=(t,e)=>{for(let o=0;o<t.length;o++){const n=t[o];if(n.test(e))return n}},sD=(t,e)=>{const o=nD(t,e);if(!o)return{major:0,minor:0};const n=s=>Number(e.replace(o,"$"+s));return Bd(n(1),n(2))},rD=(t,e)=>{const o=String(e).toLowerCase();return t.length===0?gb():sD(t,o)},gb=()=>Bd(0,0),Bd=(t,e)=>({major:t,minor:e}),vc={nu:Bd,detect:rD,unknown:gb},aD=(t,e)=>In(e.brands,o=>{const n=o.brand.toLowerCase();return ee(t,s=>{var r;return n===((r=s.brand)===null||r===void 0?void 0:r.toLowerCase())}).map(s=>({current:s.name,version:vc.nu(parseInt(o.version,10),0)}))}),pb=(t,e)=>{const o=String(e).toLowerCase();return ee(t,n=>n.search(o))},cD=(t,e)=>pb(t,e).map(o=>{const n=vc.detect(o.versionRegexes,e);return{current:o.name,version:n}}),iD=(t,e)=>pb(t,e).map(o=>{const n=vc.detect(o.versionRegexes,e);return{current:o.name,version:n}}),Rd=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,xs=t=>e=>go(e,t),lD=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:t=>go(t,"edge/")&&go(t,"chrome")&&go(t,"safari")&&go(t,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Rd],search:t=>go(t,"chrome")&&!go(t,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:t=>go(t,"msie")||go(t,"trident")},{name:"Opera",versionRegexes:[Rd,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:xs("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:xs("firefox")},{name:"Safari",versionRegexes:[Rd,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:t=>(go(t,"safari")||go(t,"mobile/"))&&go(t,"applewebkit")}],uD=[{name:"Windows",search:xs("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:t=>go(t,"iphone")||go(t,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:xs("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:xs("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:xs("linux"),versionRegexes:[]},{name:"Solaris",search:xs("sunos"),versionRegexes:[]},{name:"FreeBSD",search:xs("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:xs("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],hb={browsers:w(lD),oses:w(uD)},fb="Edge",bb="Chromium",vb="IE",yb="Opera",xb="Firefox",Sb="Safari",dD=()=>wb({current:void 0,version:vc.unknown()}),wb=t=>{const e=t.current,o=t.version,n=s=>()=>e===s;return{current:e,version:o,isEdge:n(fb),isChromium:n(bb),isIE:n(vb),isOpera:n(yb),isFirefox:n(xb),isSafari:n(Sb)}},Tb={unknown:dD,nu:wb,edge:w(fb),chromium:w(bb),ie:w(vb),opera:w(yb),firefox:w(xb),safari:w(Sb)},Cb="Windows",_b="iOS",Ob="Android",Eb="Linux",kb="macOS",Ab="Solaris",Db="FreeBSD",Mb="ChromeOS",mD=()=>Fb({current:void 0,version:vc.unknown()}),Fb=t=>{const e=t.current,o=t.version,n=s=>()=>e===s;return{current:e,version:o,isWindows:n(Cb),isiOS:n(_b),isAndroid:n(Ob),isMacOS:n(kb),isLinux:n(Eb),isSolaris:n(Ab),isFreeBSD:n(Db),isChromeOS:n(Mb)}},$b={unknown:mD,nu:Fb,windows:w(Cb),ios:w(_b),android:w(Ob),linux:w(Eb),macos:w(kb),solaris:w(Ab),freebsd:w(Db),chromeos:w(Mb)},gD={detect:(t,e,o)=>{const n=hb.browsers(),s=hb.oses(),r=e.bind(i=>aD(n,i)).orThunk(()=>cD(n,t)).fold(Tb.unknown,Tb.nu),a=iD(s,t).fold($b.unknown,$b.nu),c=oD(a,r,t,o);return{browser:r,os:a,deviceType:c}}},pD=t=>window.matchMedia(t).matches;let hD=Xs(()=>gD.detect(window.navigator.userAgent,d.from(window.navigator.userAgentData),pD));const Rn=()=>hD(),fD=(t,e)=>eb(t,e),bD=(t,e)=>{const o=fD(t,e);if(o==null)throw new Error(t+" not available on this browser");return o},vD=Object.getPrototypeOf,yD=t=>bD("HTMLElement",t),xD=t=>{const e=eb("ownerDocument.defaultView",t);return Ys(t)&&(yD(e).prototype.isPrototypeOf(t)||/^HTML\w*Element$/.test(vD(t).constructor.name))},Ss=t=>t.dom.nodeName.toLowerCase(),SD=t=>t.dom.nodeType,Ui=t=>e=>SD(e)===t,Ib=t=>Bo(t)&&xD(t.dom),Bo=Ui(Id),Tr=Ui(tD),wD=Ui(lb),TD=Ui(ub),Bb=t=>e=>Bo(e)&&Ss(e)===t,Pn=t=>I.fromDom(t.dom.ownerDocument),Pd=t=>wD(t)?t:Pn(t),Ld=t=>I.fromDom(Pd(t).dom.documentElement),yc=t=>I.fromDom(Pd(t).dom.defaultView),Ln=t=>d.from(t.dom.parentNode).map(I.fromDom),CD=t=>Ln(t),ws=t=>d.from(t.dom.parentElement).map(I.fromDom),_D=(t,e)=>{const o=Xo(e)?e:Pt;let n=t.dom;const s=[];for(;n.parentNode!==null&&n.parentNode!==void 0;){const r=n.parentNode,a=I.fromDom(r);if(s.push(a),o(a)===!0)break;n=r}return s},Rb=t=>d.from(t.dom.offsetParent).map(I.fromDom),OD=t=>d.from(t.dom.nextSibling).map(I.fromDom),Vn=t=>L(t.dom.childNodes,I.fromDom),Cr=(t,e)=>{const o=t.dom.childNodes;return d.from(o[e]).map(I.fromDom)},Vd=t=>Cr(t,0),Pb=(t,e)=>({element:t,offset:e}),Lb=(t,e)=>{const o=Vn(t);return o.length>0&&e<o.length?Pb(o[e],0):Pb(t,e)},ED=(t,e,o,n)=>{const r=Pn(t).dom.createRange();return r.setStart(t.dom,e),r.setEnd(o.dom,n),r},kD=(t,e,o,n)=>{const s=ED(t,e,o,n),r=Ft(t,o)&&e===n;return s.collapsed&&!r},Hd=t=>TD(t)&&$e(t.dom.host),ao=t=>I.fromDom(t.dom.getRootNode()),wa=t=>Hd(t)?t:I.fromDom(Pd(t).dom.body),AD=t=>Nd(t).isSome(),Nd=t=>{const e=ao(t);return Hd(e)?d.some(e):d.none()},Vb=t=>I.fromDom(t.dom.host),DD=t=>{if($e(t.target)){const e=I.fromDom(t.target);if(Bo(e)&&MD(e)&&t.composed&&t.composedPath){const o=t.composedPath();if(o)return $n(o)}}return d.from(t.target)},MD=t=>$e(t.dom.shadowRoot),FD=(t,e,o,n,s,r,a)=>({target:t,x:e,y:o,stop:n,prevent:s,kill:r,raw:a}),Hb=t=>{const e=I.fromDom(DD(t).getOr(t.target)),o=()=>t.stopPropagation(),n=()=>t.preventDefault(),s=Sd(n,o);return FD(e,t.clientX,t.clientY,o,n,s,t)},$D=(t,e)=>o=>{t(o)&&e(Hb(o))},Nb=(t,e,o,n,s)=>{const r=$D(o,n);return t.dom.addEventListener(e,r,s),{unbind:mo(RD,t,e,r,s)}},ID=(t,e,o,n)=>Nb(t,e,o,n,!1),BD=(t,e,o,n)=>Nb(t,e,o,n,!0),RD=(t,e,o,n)=>{t.dom.removeEventListener(e,o,n)},zb=ve,co=(t,e,o)=>ID(t,e,zb,o),zd=(t,e,o)=>BD(t,e,zb,o),Ub=Hb,Ud=()=>I.fromDom(document),Re=(t,e=!1)=>t.dom.focus({preventScroll:e}),Wi=t=>t.dom.blur(),Ta=t=>{const e=ao(t).dom;return t.dom===e.activeElement},ss=(t=Ud())=>d.from(t.dom.activeElement).map(I.fromDom),Qe=t=>ss(ao(t)).filter(e=>t.dom.contains(e.dom)),xc=(t,e)=>
3{Ln(t).each(n=>{n.dom.insertBefore(e.dom,t.dom)})},PD=(t,e)=>{OD(t).fold(()=>{Ln(t).each(s=>{qo(s,e)})},n=>{xc(n,e)})},LD=(t,e)=>{Vd(t).fold(()=>{qo(t,e)},n=>{t.dom.insertBefore(e.dom,n.dom)})},qo=(t,e)=>{t.dom.appendChild(e.dom)},VD=(t,e,o)=>{Cr(t,o).fold(()=>{qo(t,e)},n=>{xc(n,e)})},Wb=(t,e)=>{q(e,o=>{qo(t,o)})},Gb=(t,e,o)=>{if(Et(o)||ys(o)||ns(o))t.setAttribute(e,o+"");else throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",o,":: Element ",t),new Error("Attribute value was not simple")},nt=(t,e,o)=>{Gb(t.dom,e,o)},jb=(t,e)=>{const o=t.dom;Ze(e,(n,s)=>{Gb(o,s,n)})},Ee=(t,e)=>{const o=t.dom.getAttribute(e);return o===null?void 0:o},Pe=(t,e)=>d.from(Ee(t,e)),Yb=(t,e)=>{const o=t.dom;return o&&o.hasAttribute?o.hasAttribute(e):!1},oe=(t,e)=>{t.dom.removeAttribute(e)},HD=t=>Ge(t.dom.attributes,(e,o)=>(e[o.name]=o.value,e),{}),Wd=t=>{t.dom.textContent="",q(Vn(t),e=>{rs(e)})},rs=t=>{const e=t.dom;e.parentNode!==null&&e.parentNode.removeChild(e)},Xb=(t,e)=>I.fromDom(t.dom.cloneNode(e)),ND=t=>Xb(t,!1),zD=t=>Xb(t,!0),UD=(t,e)=>{const n=(e||document).createElement("div");return n.innerHTML=t,Vn(I.fromDom(n))},Gd=t=>t.dom.innerHTML,Ca=(t,e)=>{const n=Pn(t).dom,s=I.fromDom(n.createDocumentFragment()),r=UD(e,n);Wb(s,r),Wd(t),qo(t,s)},WD=t=>{const e=I.fromTag("div"),o=I.fromDom(t.dom.cloneNode(!0));return qo(e,o),Gd(e)},GD=t=>{if(Hd(t))return"#shadow-root";{const e=ND(t);return WD(e)}},Kb=t=>new Promise((e,o)=>{const n=()=>{r(),e(t)},s=[co(t,"load",n),co(t,"error",()=>{r(),o("Unable to load data from image: "+t.dom.src)})],r=()=>q(s,a=>a.unbind());t.dom.complete&&n()}),Sc=t=>t.style!==void 0&&Xo(t.style.getPropertyValue),Jo=t=>{const e=Tr(t)?t.dom.parentNode:t.dom;if(e==null||e.ownerDocument===null)return!1;const o=e.ownerDocument;return Nd(I.fromDom(e)).fold(()=>o.body.contains(e),dA(Jo,Vb))},Ks=()=>jD(I.fromDom(document)),jD=t=>{const e=t.dom.body;if(e==null)throw new Error("Body is not available yet");return I.fromDom(e)},jd=(t,e,o)=>{if(!Et(o))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",o,":: Element ",t),new Error("CSS value must be a string: "+o);Sc(t)&&t.style.setProperty(e,o)},qb=(t,e)=>{Sc(t)&&t.style.removeProperty(e)},ct=(t,e,o)=>{const n=t.dom;jd(n,e,o)},_r=(t,e)=>{const o=t.dom;Ze(e,(n,s)=>{jd(o,s,n)})},Gi=(t,e)=>{const o=t.dom;Ze(e,(n,s)=>{n.fold(()=>{qb(o,s)},r=>{jd(o,s,r)})})},to=(t,e)=>{const o=t.dom,s=window.getComputedStyle(o).getPropertyValue(e);return s===""&&!Jo(t)?Jb(o,e):s},Jb=(t,e)=>Sc(t)?t.style.getPropertyValue(e):"",Le=(t,e)=>{const o=t.dom,n=Jb(o,e);return d.from(n).filter(s=>s.length>0)},Zb=t=>{const e={},o=t.dom;if(Sc(o))for(let n=0;n<o.style.length;n++){const s=o.style.item(n);e[s]=o.style[s]}return e},Qb=(t,e,o)=>{const n=I.fromTag(t);return ct(n,e,o),Le(n,e).isSome()},wt=(t,e)=>{const o=t.dom;qb(o,e),Bn(Pe(t,"style").map(Fd),"")&&oe(t,"style")},wc=t=>t.dom.offsetWidth,Yd=(t,e)=>{const o=(c,i)=>{if(!ns(i)&&!i.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+i);const l=c.dom;Sc(l)&&(l.style[t]=i+"px")},n=c=>{const i=e(c);if(i<=0||i===null){const l=to(c,t);return parseFloat(l)||0}return i},s=n,r=(c,i)=>Ge(i,(l,u)=>{const m=to(c,u),g=m===void 0?0:parseInt(m,10);return isNaN(g)?l:l+g},0);return{set:o,get:n,getOuter:s,aggregate:r,max:(c,i,l)=>{const u=r(c,l);return i>u?i-u:0}}},Xd=Yd("height",t=>{const e=t.dom;return Jo(t)?e.getBoundingClientRect().height:e.offsetHeight}),Te=t=>Xd.get(t),qs=t=>Xd.getOuter(t),YD=(t,e)=>{const o=["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"],n=Xd.max(t,e,o);ct(t,"max-height",n+"px")},XD=t=>t.offsetWidth<=0&&t.offsetHeight<=0,tv=t=>!XD(t.dom),ji=Yd("width",t=>t.dom.offsetWidth),KD=Yd("width",t=>{const e=t.dom;return Jo(t)?e.getBoundingClientRect().width:e.offsetWidth}),qD=(t,e)=>ji.set(t,e),Co=t=>ji.get(t),Tc=t=>ji.getOuter(t),JD=t=>KD.getOuter(t),ZD=(t,e)=>{const o=["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"],n=ji.max(t,e,o);ct(t,"max-width",n+"px")},ev=(t,e)=>({left:t,top:e,translate:(n,s)=>ev(t+n,e+s)}),Zt=ev,QD=t=>{const e=t.getBoundingClientRect();return Zt(e.left,e.top)},Yi=(t,e)=>t!==void 0?t:e!==void 0?e:0,mn=t=>{const e=t.dom.ownerDocument,o=e.body,n=e.defaultView,s=e.documentElement;if(o===t.dom)return Zt(o.offsetLeft,o.offsetTop);const r=Yi(n==null?void 0:n.pageYOffset,s.scrollTop),a=Yi(n==null?void 0:n.pageXOffset,s.scrollLeft),c=Yi(s.clientTop,o.clientTop),i=Yi(s.clientLeft,o.clientLeft);return Xi(t).translate(a-i,r-c)},Xi=t=>{const e=t.dom,n=e.ownerDocument.body;return n===e?Zt(n.offsetLeft,n.offsetTop):Jo(t)?QD(e):Zt(0,0)},Ro=t=>{const e=t!==void 0?t.dom:document,o=e.body.scrollLeft||e.documentElement.scrollLeft,n=e.body.scrollTop||e.documentElement.scrollTop;return Zt(o,n)},Kd=(t,e,o)=>{const s=(o!==void 0?o.dom:document).defaultView;s&&s.scrollTo(t,e)},tM=((t,e)=>{const o=r=>{if(!t(r))throw new Error("Can only get "+e+" value of a "+e+" node");return n(r).getOr("")},n=r=>t(r)?d.from(r.dom.nodeValue):d.none();return{get:o,getOption:n,set:(r,a)=>{if(!t(r))throw new Error("Can only set raw "+e+" value of a "+e+" node");r.dom.nodeValue=a}}})(Tr,"text"),eM=t=>tM.get(t),qd=(t,e)=>o=>oM(o)==="rtl"?e:t,oM=t=>to(t,"direction")==="rtl"?"rtl":"ltr",Jd=(t,e)=>{const o=Ee(t,e);return o===void 0||o===""?[]:o.split(" ")},nM=(t,e,o)=>{const s=Jd(t,e).concat([o]);return nt(t,e,s.join(" ")),!0},sM=(t,e,o)=>{const n=Wt(Jd(t,e),s=>s!==o);return n.length>0?nt(t,e,n.join(" ")):oe(t,e),!1};var ov=(t,e,o,n,s)=>t(o,n)?d.some(o):Xo(s)&&s(o)?d.none():e(o,n,s);const nv=(t,e,o)=>{let n=t.dom;const s=Xo(o)?o:Pt;for(;n.parentNode;){n=n.parentNode;const r=I.fromDom(n);if(e(r))return d.some(r);if(s(r))break}return d.none()},sv=(t,e,o)=>ov((s,r)=>r(s),nv,t,e,o),rM=(t,e)=>{const o=t.dom;return o.parentNode?rv(I.fromDom(o.parentNode),n=>!Ft(t,n)&&e(n)):d.none()},rv=(t,e)=>{const o=s=>e(I.fromDom(s));return ee(t.dom.childNodes,o).map(I.fromDom)},aM=(t,e)=>{const o=n=>{for(let s=0;s<n.childNodes.length;s++){const r=I.fromDom(n.childNodes[s]);if(e(r))return d.some(r);const a=o(n.childNodes[s]);if(a.isSome())return a}return d.none()};return o(t.dom)},cM=t=>mb(t),Hn=(t,e,o)=>nv(t,n=>
3Sa(n,e),o),iM=(t,e)=>rM(t,o=>Sa(o,e)),Zd=(t,e)=>rv(t,o=>Sa(o,e)),Dt=(t,e)=>mb(e,t),as=(t,e,o)=>ov((s,r)=>Sa(s,r),Hn,t,e,o),lM=(t,e)=>{t.dom.checked=e},uM=t=>t.dom.checked,_a=t=>t.dom.classList!==void 0,Qd=t=>Jd(t,"class"),av=(t,e)=>nM(t,"class",e),cv=(t,e)=>sM(t,"class",e),dM=(t,e)=>le(Qd(t),e)?cv(t,e):av(t,e),ne=(t,e)=>{_a(t)?t.dom.classList.add(e):av(t,e)},iv=t=>{(_a(t)?t.dom.classList:Qd(t)).length===0&&oe(t,"class")},Qt=(t,e)=>{_a(t)?t.dom.classList.remove(e):cv(t,e),iv(t)},mM=(t,e)=>{const o=_a(t)?t.dom.classList.toggle(e):dM(t,e);return iv(t),o},po=(t,e)=>_a(t)&&t.dom.classList.contains(e),Or=(t,e)=>{q(e,o=>{ne(t,o)})},gn=(t,e)=>{q(e,o=>{Qt(t,o)})},gM=(t,e)=>{q(e,o=>{mM(t,o)})},pM=(t,e)=>fa(e,o=>po(t,o)),hM=t=>{const e=t.dom.classList,o=new Array(e.length);for(let n=0;n<e.length;n++){const s=e.item(n);s!==null&&(o[n]=s)}return o},lv=t=>_a(t)?hM(t):Qd(t),fM=t=>t.dom.textContent,Ts=t=>t.dom.value,Er=(t,e)=>{if(e===void 0)throw new Error("Value.set was undefined");t.dom.value=e},uv=(t,e,o)=>Wt(_D(t,o),e),io=(t,e)=>eD(e,t),dv=(t,e,o)=>sv(t,e,o).isSome(),Cc=(t,e,o)=>as(t,e,o).isSome(),mv=t=>Xo(t)?t:Pt,gv=(t,e,o)=>{let n=t.dom;const s=mv(o);for(;n.parentNode;){n=n.parentNode;const r=I.fromDom(n),a=e(r);if(a.isSome())return a;if(s(r))break}return d.none()},Ki=(t,e,o)=>{const n=e(t),s=mv(o);return n.orThunk(()=>s(t)?d.none():gv(t,e,s))},qi={create:(t,e,o,n)=>({start:t,soffset:e,finish:o,foffset:n})},tm=cn.generate([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),bM=(t,e,o,n)=>t.fold(e,o,n),vM=t=>t.fold(xt,xt,xt),yM=tm.before,xM=tm.on,SM=tm.after,wM={before:yM,on:xM,after:SM,cata:bM,getStart:vM},Ji=cn.generate([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),TM=t=>Ji.exact(t.start,t.soffset,t.finish,t.foffset),CM=t=>t.match({domRange:e=>I.fromDom(e.startContainer),relative:(e,o)=>wM.getStart(e),exact:(e,o,n,s)=>e}),_M=Ji.domRange,OM=Ji.relative,EM=Ji.exact,kM=t=>{const e=CM(t);return yc(e)},AM=qi.create,_c={domRange:_M,relative:OM,exact:EM,exactFromRange:TM,getWin:kM,range:AM},DM=t=>d.from(t.getSelection()),pv=t=>{if(t.rangeCount>0){const e=t.getRangeAt(0),o=t.getRangeAt(t.rangeCount-1);return d.some(qi.create(I.fromDom(e.startContainer),e.startOffset,I.fromDom(o.endContainer),o.endOffset))}else return d.none()},MM=t=>{if(t.anchorNode===null||t.focusNode===null)return pv(t);{const e=I.fromDom(t.anchorNode),o=I.fromDom(t.focusNode);return kD(e,t.anchorOffset,o,t.focusOffset)?d.some(qi.create(e,t.anchorOffset,o,t.focusOffset)):pv(t)}},FM=t=>DM(t).filter(e=>e.rangeCount>0).bind(MM),hv=(t,e)=>{const o=ib(t,e);return KA(o)},$M=(t,e)=>{const o=ib(t,e);return qA(o)},IM={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]},BM=(()=>{const t="[0-9]+",o="[eE]"+("[+-]?"+t),n="\\.",s=c=>`(?:${c})?`,a=`[+-]?(?:${["Infinity",t+n+s(t)+s(o),n+t+s(o),t+s(o)].join("|")})`;return new RegExp(`^(${a})(.*)$`)})(),RM=(t,e)=>Ko(e,o=>Ko(IM[o],n=>t===n)),Zi=(t,e)=>d.from(BM.exec(t)).bind(n=>{const s=Number(n[1]),r=n[2];return RM(r,e)?d.some({value:s,unit:r}):d.none()}),PM=(t,e)=>Zi(t,e).map(({value:o,unit:n})=>o+n),LM=t=>{const e=t===void 0?window:t;return Rn().browser.isFirefox()?d.none():d.from(e.visualViewport)},fv=(t,e,o,n)=>({x:t,y:e,width:o,height:n,right:t+o,bottom:e+n}),em=t=>{const e=t===void 0?window:t,o=e.document,n=Ro(I.fromDom(o));return LM(e).fold(()=>{const s=e.document.documentElement,r=s.clientWidth,a=s.clientHeight;return fv(n.left,n.top,r,a)},s=>fv(Math.max(s.pageLeft,n.left),Math.max(s.pageTop,n.top),s.width,s.height))},bv=(t,e)=>t.view(e).fold(w([]),n=>{const s=t.owner(n),r=bv(t,s);return[n].concat(r)}),VM=(t,e)=>{const o=e.owner(t),n=bv(e,o);return d.some(n)};var HM=Object.freeze({__proto__:null,view:t=>{var e;return(t.dom===document?d.none():d.from((e=t.dom.defaultView)===null||e===void 0?void 0:e.frameElement)).map(I.fromDom)},owner:t=>Pn(t)});const om=t=>{const e=Ud(),o=Ro(e);return VM(t,HM).fold(mo(mn,t),s=>{const r=Xi(t),a=pa(s,(c,i)=>{const l=Xi(i);return{left:c.left+l.left,top:c.top+l.top}},{left:0,top:0});return Zt(a.left+r.left+o.left,a.top+r.top+o.top)})},NM=(t,e,o)=>({point:t,width:e,height:o}),zM=(t,e,o,n)=>({x:t,y:e,width:o,height:n}),ke=(t,e,o,n)=>({x:t,y:e,width:o,height:n,right:t+o,bottom:e+n}),Ae=t=>{const e=mn(t),o=Tc(t),n=qs(t);return ke(e.left,e.top,o,n)},kr=t=>{const e=om(t),o=Tc(t),n=qs(t);return ke(e.left,e.top,o,n)},nm=(t,e)=>{const o=Math.max(t.x,e.x),n=Math.max(t.y,e.y),s=Math.min(t.right,e.right),r=Math.min(t.bottom,e.bottom),a=s-o,c=r-n;return ke(o,n,a,c)},UM=(t,e)=>Ge(e,(o,n)=>nm(o,n),t),eo=()=>em(window),vv=(t,e)=>Ft(t.element,e.event.target),sm=t=>(Bn(Le(t,"position"),"fixed")?d.none():Rb(t)).orThunk(()=>{const n=I.fromTag("span");return Ln(t).bind(s=>{qo(s,n);const r=Rb(n);return rs(n),r})}),yv=t=>sm(t).map(mn).getOrThunk(()=>Zt(0,0)),WM=(t,e)=>{const o=d.from(Ee(t,"id")).getOrThunk(()=>{const n=V("aria");return nt(e,"id",n),n});nt(t,"aria-describedby",o)},GM=t=>{oe(t,"aria-describedby")};var Zo;(function(t){t[t.Error=0]="Error",t[t.Value=1]="Value"})(Zo||(Zo={}));const rm=(t,e,o)=>t.stype===Zo.Error?e(t.serror):o(t.svalue),jM=t=>{const e=[],o=[];return q(t,n=>{rm(n,s=>o.push(s),s=>e.push(s))}),{values:e,errors:o}},YM=(t,e)=>t.stype===Zo.Error?{stype:Zo.Error,serror:e(t.serror)}:t,XM=(t,e)=>t.stype===Zo.Value?{stype:Zo.Value,svalue:e(t.svalue)}:t,KM=(t,e)=>t.stype===Zo.Value?e(t.svalue):t,qM=(t,e)=>t.stype===Zo.Error?e(t.serror):t,xv=t=>({stype:Zo.Value,svalue:t}),Sv=t=>({stype:Zo.Error,serror:t}),ie={fromResult:t=>t.fold(Sv,xv),toResult:t=>rm(t,mt.error,mt.value),svalue:xv,partition:jM,serror:Sv,bind:KM,bindError:qM,map:XM,mapError:YM,fold:rm},am=t=>Ys(t)&&xe(t).length>100?" removed due to size":JSON.stringify(t,null,2),JM=t=>{const e=t.length>10?t.slice(0,10).concat([{path:[],getErrorInfo:w("... (only showing first ten failures)")}]):t;return L(e,o=>"Failed path: ("+o.path.join(" > ")+`)
4`+o.getErrorInfo())},Oc=(t,e)=>ie.serror([{path:t,getErrorInfo:e}]),ZM=(t,e,o)=>Oc(t,()=>'Could not find valid *required* value for "'+e+'" in '+am(o)),QM=(t,e)=>Oc(t,()=>'Choice schema did not contain choice key: "'+e+'"'),t1=(t,e,o)=>Oc(t,()=>'The chosen schema: "'+o+'" did not exist in branches: '+am(e)),e1=(t,e)=>Oc(t,()=>"There are unsupported fields: ["+e.join(", ")+"] specified"),o1=(t,e)=>Oc(t,w(e)),Oa=t=>{const e=(n,s)=>ie.bindError(t(s),r=>o1(n,r)),o=w("val");return{extract:e,toString:o}},wv=Oa(ie.svalue),pn=w(wv),Qi=(t,e)=>Oa(o=>{const n=typeof o;return t(o)?ie.svalue(o):ie.serror(`Expected type: ${e} but got: ${n}`)}),tl=Qi(ns,"number"),ue=Qi(Et,"string"),el=Qi(ys,"boolean"),cm=Qi(Xo,"function"),Tv=t=>{if(Object(t)!==t)return!0;switch({}.toString.call(t).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(t).every(e=>Tv(t[e]));default:return!1}},n1=Oa(t=>Tv(t)?ie.svalue(t):ie.serror("Expected value to be acceptable for sending via postMessage")),Nn=()=>({tag:"required",process:{}}),ol=t=>({tag:"defaultedThunk",process:t}),nl=t=>ol(w(t)),im=()=>({tag:"option",process:{}}),lm=t=>({tag:"mergeWithThunk",process:t}),s1=t=>lm(w(t)),Cv=(t,e,o,n)=>({tag:"field",key:t,newKey:e,presence:o,prop:n}),r1=(t,e)=>({tag:"custom",newKey:t,instantiator:e}),um=(t,e,o)=>{switch(t.tag){case"field":return e(t.key,t.newKey,t.presence,t.prop);
4case"custom":return o(t.newKey,t.instantiator)}},a1=(t,e)=>t.length>0?ie.svalue(Jt(e,Qf.apply(void 0,t))):ie.svalue(e),_v=t=>Sd(ie.serror,Ie)(t),Ov={consolidateObj:(t,e)=>{const o=ie.partition(t);return o.errors.length>0?_v(o.errors):a1(o.values,e)},consolidateArr:t=>{const e=ie.partition(t);return e.errors.length>0?_v(e.errors):ie.svalue(e.values)}},c1=(t,e,o,n)=>tt(e,o).fold(()=>ZM(t,o,e),n),Ev=(t,e,o,n)=>{const s=tt(t,e).getOrThunk(()=>o(t));return n(s)},i1=(t,e,o)=>o(tt(t,e)),l1=(t,e,o,n)=>{const s=tt(t,e).map(r=>r===!0?o(t):r);return n(s)},u1=(t,e,o,n,s)=>{const r=c=>s.extract(e.concat([n]),c),a=c=>c.fold(()=>ie.svalue(d.none()),i=>{const l=s.extract(e.concat([n]),i);return ie.map(l,d.some)});switch(t.tag){case"required":return c1(e,o,n,r);case"defaultedThunk":return Ev(o,n,t.process,r);case"option":return i1(o,n,a);case"defaultedOptionThunk":return l1(o,n,t.process,a);case"mergeWithThunk":return Ev(o,n,w({}),c=>{const i=Jt(t.process(o),c);return r(i)})}},d1=(t,e,o)=>{const n={},s=[];for(const r of o)um(r,(a,c,i,l)=>{const u=u1(i,t,e,a,l);ie.fold(u,m=>{s.push(...m)},m=>{n[c]=m})},(a,c)=>{n[a]=c(e)});return s.length>0?ie.serror(s):ie.svalue(n)},kv=t=>({extract:(n,s)=>t().extract(n,s),toString:()=>t().toString()}),m1=t=>xe(jf(t,$e)),Po=t=>{const e=J(t),o=pa(t,(s,r)=>um(r,a=>Jt(s,{[a]:!0}),w(s)),{});return{extract:(s,r)=>{const a=ys(r)?[]:m1(r),c=Wt(a,i=>!an(o,i));return c.length===0?e.extract(s,r):e1(s,c)},toString:e.toString}},J=t=>({extract:(n,s)=>d1(n,s,t),toString:()=>`obj{
5`+L(t,s=>um(s,(r,a,c,i)=>r+" -> "+i.toString(),(r,a)=>"state("+r+")")).join(`
6`)+"}"}),Js=t=>({extract:(n,s)=>{const r=L(s,(a,c)=>t.extract(n.concat(["["+c+"]"]),a));return Ov.consolidateArr(r)},toString:()=>"array("+t.toString()+")"}),sl=(t,e)=>{const o=e!==void 0?e:xt;return{extract:(r,a)=>{const c=[];for(const i of t){const l=i.extract(r,a);if(l.stype===Zo.Value)return{stype:Zo.Value,svalue:o(l.svalue)};c.push(l)}return Ov.consolidateArr(c)},toString:()=>"oneOf("+L(t,r=>r.toString()).join(", ")+")"}},g1=(t,e)=>{const o=(r,a)=>Js(Oa(t)).extract(r,a);return{extract:(r,a)=>{const c=xe(a),i=o(r,c);return ie.bind(i,l=>{const u=L(l,m=>Cv(m,m,Nn(),e));return J(u).extract(r,a)})},toString:()=>"setOf("+e.toString()+")"}},p1=(t,e)=>{const o=Xs(e);return{extract:(r,a)=>o().extract(r,a),toString:()=>o().toString()}},rl=Sd(Js,J),h1=(t,e,o,n)=>tt(o,n).fold(()=>t1(t,o,n),r=>r.extract(t.concat(["branch: "+n]),e)),Ea=(t,e)=>({extract:(s,r)=>tt(r,t).fold(()=>QM(s,t),c=>h1(s,r,e,c)),toString:()=>"chooseOn("+t+"). Possible values: "+xe(e)}),f1=()=>Js(wv),Ec=t=>Oa(e=>t(e).fold(ie.serror,ie.svalue)),Av=(t,e)=>g1(o=>ie.fromResult(t(o)),e),b1=(t,e,o)=>{const n=e.extract([t],o);return ie.mapError(n,s=>({input:o,errors:s}))},Xt=(t,e,o)=>ie.toResult(b1(t,e,o)),hn=t=>t.fold(e=>{throw new Error(ka(e))},xt),ho=(t,e,o)=>hn(Xt(t,e,o)),ka=t=>`Errors: 
7`+JM(t.errors).join(`
8`)+`
9
10Input object: `+am(t.input),fo=(t,e)=>Ea(t,we(e,J)),Dv=(t,e)=>p1(t,e),Ve=Cv,lo=r1,dm=t=>Ec(e=>le(t,e)?mt.value(e):mt.error(`Unsupported value: "${e}", choose one of "${t.join(", ")}".`)),A=t=>Ve(t,t,Nn(),pn()),Lo=(t,e)=>Ve(t,t,Nn(),e),Mv=t=>Lo(t,tl),de=t=>Lo(t,ue),fn=(t,e)=>Ve(t,t,Nn(),dm(e)),bn=t=>Lo(t,cm),v1=(t,e)=>Ve(t,t,im(),Oa(o=>ie.serror("The field: "+t+" is forbidden. "+e))),Cs=(t,e)=>Ve(t,t,Nn(),J(e)),Fv=(t,e)=>Ve(t,t,Nn(),rl(e)),_o=(t,e)=>Ve(t,t,Nn(),Js(e)),Tt=t=>Ve(t,t,im(),pn()),cs=(t,e)=>Ve(t,t,im(),e),kc=t=>cs(t,tl),ae=t=>cs(t,ue),$v=(t,e)=>cs(t,dm(e)),is=t=>cs(t,cm),Iv=(t,e)=>cs(t,Js(e)),Oo=(t,e)=>cs(t,J(e)),y1=(t,e)=>cs(t,Po(e)),T=(t,e)=>Ve(t,t,nl(e),pn()),Qo=(t,e,o)=>Ve(t,t,nl(e),o),Ac=(t,e)=>Qo(t,e,tl),Kt=(t,e)=>Qo(t,e,ue),zn=(t,e,o)=>Qo(t,e,dm(o)),je=(t,e)=>Qo(t,e,el),Lt=(t,e)=>Qo(t,e,cm),x1=(t,e)=>Qo(t,e,n1),_s=(t,e,o)=>Qo(t,e,Js(o)),mm=(t,e,o)=>Qo(t,e,J(o)),S1=(t,e)=>{const o={};return Ze(t,(n,s)=>{le(e,s)||(o[s]=n)}),o},w1=(t,e)=>({[t]:e}),T1=t=>{const e={};return q(t,o=>{e[o.key]=o.value}),e},C1=(t,e)=>S1(t,e),Ar=(t,e)=>w1(t,e),Aa=t=>T1(t),_1=(t,e)=>t.length===0?mt.value(e):mt.value(Jt(e,Qf.apply(void 0,t))),O1=t=>mt.error(Ie(t)),E1=(t,e)=>{const o=$A(t);return o.errors.length>0?O1(o.errors):_1(o.values,e)},He=w,Os=He("touchstart"),Dc=He("touchmove"),Dr=He("touchend"),Bv=He("touchcancel"),Vo=He("mou
10sedown"),al=He("mousemove"),cl=He("mouseout"),gm=He("mouseup"),ls=He("mouseover"),vn=He("focusin"),Rv=He("focusout"),Un=He("keydown"),k1=He("keyup"),Es=He("input"),Da=He("change"),Mr=He("click"),A1=He("transitioncancel"),Mc=He("transitionend"),D1=He("transitionstart"),M1=He("selectstart"),ce=t=>w("alloy."+t),F1={tap:ce("tap")},Zs=ce("focus"),Fc=ce("blur.post"),pm=ce("paste.post"),Fr=ce("receive"),Ho=ce("execute"),$c=ce("focus.item"),Ic=F1.tap,$1=ce("longpress"),il=ce("sandbox.close"),hm=ce("typeahead.cancel"),ll=ce("system.init"),I1=ce("system.touchmove"),B1=ce("system.touchend"),fm=ce("system.scroll"),Bc=ce("system.resize"),Wn=ce("system.attached"),us=ce("system.detached"),$r=ce("system.dismissRequested"),Pv=ce("system.repositionRequested"),ul=ce("focusmanager.shifted"),bm=ce("slotcontainer.visibility"),Lv=ce("system.external.element.scroll"),Vv=ce("change.tab"),Hv=ce("dismiss.tab"),vm=ce("highlight"),ym=ce("dehighlight"),Qs=t=>GD(t),xm="unknown",R1=!0;var Ma;(function(t){t[t.STOP=0]="STOP",t[t.NORMAL=1]="NORMAL",t[t.LOGGING=2]="LOGGING"})(Ma||(Ma={}));const Sm=X({}),P1=(t,e)=>{const o=[],n=new Date().getTime();return{logEventCut:(s,r,a)=>{o.push({outcome:"cut",target:r,purpose:a})},logEventStopped:(s,r,a)=>{o.push({outcome:"stopped",target:r,purpose:a})},logNoParent:(s,r,a)=>{o.push({outcome:"no-parent",target:r,purpose:a})},logEventNoHandlers:(s,r)=>{o.push({outcome:"no-handlers-left",target:r})},logEventResponse:(s,r,a)=>{o.push({outcome:"response",purpose:a,target:r})},write:()=>{const s=new Date().getTime();le(["mousemove","mouseover","mouseout",ll()],t)||console.log(t,{event:t,time:s-n,target:e.dom,sequence:L(o,r=>le(["cut","stopped","response"],r.outcome)?"{"+r.purpose+"} "+r.outcome+" at ("+Qs(r.target)+")":r.outcome)})}}},L1=(t,e,o)=>{switch(tt(Sm.get(),t).orThunk(()=>{const s=xe(Sm.get());return In(s,r=>t.indexOf(r)>-1?d.some(Sm.get()[r]):d.none())}).getOr(Ma.NORMAL)){case Ma.NORMAL:return o(z1());case Ma.LOGGING:{const s=P1(t,e),r=o(s);return s.write(),r}case Ma.STOP:return!0}},V1=["alloy/data/Fields","alloy/debugging/Debugging"],H1=()=>{if(R1===!1)return xm;const t=new Error;if(t.stack!==void 0){const e=t.stack.split(`
11`);return ee(e,o=>o.indexOf("alloy")>0&&!Ko(V1,n=>o.indexOf(n)>-1)).getOr(xm)}else return xm},N1={logEventCut:$,logEventStopped:$,logNoParent:$,logEventNoHandlers:$,logEventResponse:$,write:$},wm=(t,e,o)=>L1(t,e,o),z1=w(N1),Nv=w([A("menu"),A("selectedMenu")]),Tm=w([A("item"),A("selectedItem")]);w(J(Tm().concat(Nv())));const U1=w(J(Tm())),W1=Cs("initSize",[A("numColumns"),A("numRows")]),G1=()=>Lo("markers",U1()),dl=()=>Cs("markers",[A("backgroundMenu")].concat(Nv()).concat(Tm())),Ir=t=>Cs("markers",L(t,A)),ml=(t,e,o)=>(H1(),Ve(e,e,o,Ec(n=>mt.value((...s)=>n.apply(void 0,s))))),bt=t=>ml("onHandler",t,nl($)),Eo=t=>ml("onKeyboardHandler",t,nl(d.none)),Br=t=>ml("onHandler",t,Nn()),Cm=t=>ml("onKeyboardHandler",t,Nn()),Gt=(t,e)=>lo(t,w(e)),zv=t=>lo(t,xt),Uv=w(W1),j1=(t,e,o)=>{const n=o.toString(),s=n.indexOf(")")+1,r=n.indexOf("("),a=n.substring(r+1,s-1).split(/,\s*/);return t.toFunctionAnnotation=()=>({name:e,parameters:_m(a.slice(0,1).concat(a.slice(3)))}),t},_m=t=>L(t,e=>Vi(e,"/*")?e.substring(0,e.length-2):e),Om=(t,e)=>{const o=t.toString(),n=o.indexOf(")")+1,s=o.indexOf("("),r=o.substring(s+1,n-1).split(/,\s*/);return t.toFunctionAnnotation=()=>({name:e,parameters:_m(r)}),t},Y1=(t,e)=>{const o=e.toString(),n=o.indexOf(")")+1,s=o.indexOf("("),r=o.substring(s+1,n-1).split(/,\s*/);return t.toFunctionAnnotation=()=>({name:"OVERRIDE",parameters:_m(r.slice(1))}),t},Wv=(t,e)=>{let o=null;return{cancel:()=>{o!==null&&(clearTimeout(o),o=null)},schedule:(...r)=>{o=setTimeout(()=>{t.apply(null,r),o=null},e)}}},Gv=5,X1=400,jv=t=>{const e=t.raw;return e.touches===void 0||e.touches.length!==1?d.none():d.some(e.touches[0])},K1=(t,e)=>{const o=Math.abs(t.clientX-e.x),n=Math.abs(t.clientY-e.y);return o>Gv||n>Gv},q1=t=>{const e=Rt(),o=X(!1),n=Wv(l=>{t.triggerEvent($1(),l),o.set(!0)},X1),s=l=>(jv(l).each(u=>{n.cancel();const m={x:u.clientX,y:u.clientY,target:l.target};n.schedule(l),o.set(!1),e.set(m)}),d.none()),r=l=>(n.cancel(),jv(l).each(u=>{e.on(m=>{K1(u,m)&&e.clear()})}),d.none()),a=l=>
11{n.cancel();const u=m=>Ft(m.target,l.target);return e.get().filter(u).map(m=>o.get()?(l.prevent(),!1):t.triggerEvent(Ic(),l))},c=Aa([{key:Os(),value:s},{key:Dc(),value:r},{key:Dr(),value:a}]);return{fireIfReady:(l,u)=>tt(c,u).bind(m=>m(l))}};var tr;(function(t){t.OnFocusMode="onFocus",t.OnEnterOrSpaceMode="onEnterOrSpace",t.OnApiMode="onApi"})(tr||(tr={}));const Yv="placeholder",gl=cn.generate([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),Em=t=>At(t,"uiType"),J1=(t,e,o,n)=>t.exists(s=>s!==o.owner)?gl.single(!0,w(o)):tt(n,o.name).fold(()=>{throw new Error("Unknown placeholder component: "+o.name+`
12Known: [`+xe(n)+`]
13Namespace: `+t.getOr("none")+`
14Spec: `+JSON.stringify(o,null,2))},s=>s.replace()),Z1=(t,e,o,n)=>Em(o)&&o.uiType===Yv?J1(t,e,o,n):gl.single(!1,w(o)),Xv=(t,e,o,n)=>Z1(t,e,o,n).fold((r,a)=>{const c=Em(o)?a(e,o.config,o.validated):a(e),i=tt(c,"components").getOr([]),l=ye(i,u=>Xv(t,e,u,n));return[{...c,components:l}]},(r,a)=>{if(Em(o)){const c=a(e,o.config,o.validated);return o.validated.preprocess.getOr(xt)(c)}else return a(e)}),Q1=(t,e,o,n)=>ye(o,s=>Xv(t,e,s,n)),tF=(t,e)=>{let o=!1;const n=()=>o,s=()=>{if(o)throw new Error("Trying to use the same placeholder more than once: "+t);return o=!0,e},r=()=>e.fold((a,c)=>a,(a,c)=>a);return{name:w(t),required:r,used:n,replace:s}},eF=(t,e,o,n)=>{const s=we(n,(a,c)=>tF(c,a)),r=Q1(t,e,o,s);return Ze(s,a=>{if(a.used()===!1&&a.required())throw new Error("Placeholder: "+a.name()+` was not found in components list
15Namespace: `+t.getOr("none")+`
16Components: `+JSON.stringify(e.components,null,2))}),r},Kv=gl.single,oF=gl.multiple,qv=w(Yv),pl=cn.generate([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),hl=T("factory",{sketch:xt}),km=T("schema",[]),fl=A("name"),Am=Ve("pname","pname",ol(t=>"<alloy."+V(t.name)+">"),pn()),nF=lo("schema",()=>[Tt("preprocess")]),bl=T("defaults",w({})),vl=T("overrides",w({})),sF=J([hl,km,fl,Am,bl,vl]),rF=J([hl,km,fl,bl,vl]),aF=J([hl,km,fl,Am,bl,vl]),cF=J([hl,nF,fl,A("unit"),Am,bl,vl]),Jv=t=>t.fold(d.some,d.none,d.some,d.some),Zv=t=>{const e=o=>o.name;return t.fold(e,e,e,e)},iF=t=>t.fold(xt,xt,xt,xt),yl=(t,e)=>o=>{const n=ho("Converting part type",e,o);return t(n)},Ye=yl(pl.required,sF),yn=yl(pl.external,rF),tn=yl(pl.optional,aF),xl=yl(pl.group,cF),Dm=w("entirety");var lF=Object.freeze({__proto__:null,required:Ye,external:yn,optional:tn,group:xl,asNamedPart:Jv,name:Zv,asCommon:iF,original:Dm});const Mm=(t,e,o,n)=>Jt(e.defaults(t,o,n),o,{uid:t.partUids[e.name]},e.overrides(t,o,n)),uF=(t,e,o)=>{const n={},s={};return q(o,r=>{r.fold(a=>{n[a.pname]=Kv(!0,(c,i,l)=>a.factory.sketch(Mm(c,a,i,l)))},a=>{const c=e.parts[a.name];s[a.name]=w(a.factory.sketch(Mm(e,a,c[Dm()]),c))},a=>{n[a.pname]=Kv(!1,(c,i,l)=>a.factory.sketch(Mm(c,a,i,l)))},a=>{n[a.pname]=oF(!0,(c,i,l)=>{const u=c[a.name];return L(u,m=>a.factory.sketch(Jt(a.defaults(c,m,l),m,a.overrides(c,m))))})})}),{internals:w(n),externals:w(s)}},Fm=(t,e)=>{const o={};return q(e,n=>{Jv(n).each(s=>{const r=dF(t,s.pname);o[s.name]=a=>{const c=ho("Part: "+s.name+" in "+t,J(s.schema),a);return{...r,config:a,validated:c}}})}),o},dF=(t,e)=>({uiType:qv(),owner:t,name:e}),$m=(t,e,o)=>({uiType:qv(),owner:t,name:e,config:o,validated:{}}),Qv=t=>ye(t,e=>e.fold(d.none,d.some,d.none,d.none).map(o=>Cs(o.name,o.schema.concat([zv(Dm())]))).toArray()),ty=t=>L(t,Zv),Im=(t,e,o)=>uF(t,e,o),Bm=(t,e,o)=>eF(d.some(t),e,e.components,o),$t=(t,e,o)=>{const n=e.partUids[o];return t.getSystem().getByUid(n).toOptional()},er=(t,e,o)=>$t(t,e,o).getOrDie("Could not find part: "+o),ey=(t,e,o)=>{const n={},s=e.partUids,r=t.getSystem();return q(o,a=>{n[a]=w(r.getByUid(s[a]))}),n},oy=(t,e)=>{const o=t.getSystem();return we(e.partUids,(n,s)=>w(o.getByUid(n)))},ny=t=>xe(t.partUids),Rm=(t,e,o)=>{const n={},s=e.partUids,r=t.getSystem();return q(o,a=>{n[a]=w(r.getByUid(s[a]).getOrDie())}),n},sy=(t,e)=>{const o=ty(e);return Aa(L(o,n=>({key:n,value:t+"-"+n})))},Pm=t=>Ve("partUids","partUids",lm(e=>sy(e.uid,t)),pn());var mF=Object.freeze({__proto__:null,generate:Fm,generateOne:$m,schemas:Qv,names:ty,substitutes:Im,components:Bm,defaultUids:sy,defaultUidsSchema:Pm,getAllParts:oy,getAllPartNames:ny,getPart:$t,getPartOrDie:er,getParts:ey,getPartsOrDie:Rm});const gF=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right","inset"],xn=(t,e,o,n=1)=>{const s=t*n,r=e*n,a=i=>tt(o,i).getOr([]),c=(i,l,u)=>{const m=Sr(gF,u);return{offset:Zt(i,l),classesOn:ye(u,a),classesOff:ye(m,a)}};return{southeast:()=>c(-t,e,["top","alignLeft"]),southwest:()=>c(t,e,["top","alignRight"]),south:()=>c(-t/2,e,["top","alignCentre"]),northeast:()=>c(-t,-e,["bottom","alignLeft"]),northwest:()=>c(t,-e,["bottom","alignRight"]),north:()=>c(-t/2,-e,["bottom","alignCentre"]),east:()=>c(t,-e/2,["valignCentre","left"]),west:()=>c(-t,-e/2,["valignCentre","right"]),insetNortheast:()=>c(s,r,["top","alignLeft","inset"]),insetNorthwest:()=>c(-s,r,["top","alignRight","inset"]),insetNorth:()=>c(-s/2,r,["top","alignCentre","inset"]),insetSoutheast:()=>c(s,-r,["bottom","alignLeft","inset"]),insetSouthwest:()=>c(-s,-r,["bottom","alignRight","inset"]),insetSouth:()=>c(-s/2,-r,["bottom","alignCentre","inset"]),insetEast:()=>c(-s,-r/2,["valignCentre","right","inset"]),insetWest:()=>c(s,-r/2,["valignCentre","left","inset"])}},Sl=()=>xn(0,0,{}),Ne=(t,e,o,n,s,r,a,c=!1)=>({x:t,y:e,bubble:o,direction:n,placement:s,restriction:r,label:`${a}-${s}`,alwaysFit:c}),or=cn.generate([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),pF=(t,e,o,n,s,r,a,c,i)=>t.fold(e,o,n,s,r,a,c,i),hF=(t,e,o,n)=>t.fold(e,e,n,n,e,n,o,o),fF=(t,e,o,n)=>
16t.fold(e,n,e,n,o,o,e,n),wl=or.southeast,Lm=or.southwest,Vm=or.northeast,Hm=or.northwest,ry=or.south,ay=or.north,cy=or.east,iy=or.west,bF=(t,e)=>{switch(e){case 1:return t.x;case 0:return t.x+t.width;case 2:return t.y;case 3:return t.y+t.height}},ze=(t,e)=>zf(["left","right","top","bottom"],o=>tt(e,o).map(n=>bF(t,n))),vF=(t,e,o)=>{const n=(i,l)=>e[i].map(u=>{const m=i==="top"||i==="bottom",g=m?o.top:o.left,h=(i==="left"||i==="top"?Math.max:Math.min)(u,l)+g;return m?un(h,t.y,t.bottom):un(h,t.x,t.right)}).getOr(l),s=n("left",t.x),r=n("top",t.y),a=n("right",t.right),c=n("bottom",t.bottom);return ke(s,r,a-s,c-r)},nr="layout",ly=t=>t.x,uy=(t,e)=>t.x+t.width/2-e.width/2,dy=(t,e)=>t.x+t.width-e.width,Nm=(t,e)=>t.y-e.height,zm=t=>t.y+t.height,my=(t,e)=>t.y+t.height/2-e.height/2,yF=t=>t.x+t.width,xF=(t,e)=>t.x-e.width,me=(t,e,o)=>Ne(ly(t),zm(t),o.southeast(),wl(),"southeast",ze(t,{left:1,top:3}),nr),ge=(t,e,o)=>Ne(dy(t,e),zm(t),o.southwest(),Lm(),"southwest",ze(t,{right:0,top:3}),nr),Ue=(t,e,o)=>Ne(ly(t),Nm(t,e),o.northeast(),Vm(),"northeast",ze(t,{left:1,bottom:2}),nr),We=(t,e,o)=>Ne(dy(t,e),Nm(t,e),o.northwest(),Hm(),"northwest",ze(t,{right:0,bottom:2}),nr),Ce=(t,e,o)=>Ne(uy(t,e),Nm(t,e),o.north(),ay(),"north",ze(t,{bottom:2}),nr),pe=(t,e,o)=>Ne(uy(t,e),zm(t),o.south(),ry(),"south",ze(t,{top:3}),nr),Um=(t,e,o)=>Ne(yF(t),my(t,e),o.east(),cy(),"east",ze(t,{left:0}),nr),Wm=(t,e,o)=>Ne(xF(t,e),my(t,e),o.west(),iy(),"west",ze(t,{right:1}),nr),gy=()=>[me,ge,Ue,We,pe,Ce,Um,Wm],py=()=>[ge,me,We,Ue,pe,Ce,Um,Wm],hy=()=>[Ue,We,me,ge,Ce,pe],fy=()=>[We,Ue,ge,me,Ce,pe],Gm=()=>[me,ge,Ue,We,pe,Ce],jm=()=>[ge,me,We,Ue,pe,Ce],Ym="data-alloy-placement",SF=(t,e)=>{nt(t,Ym,e)},by=t=>Pe(t,Ym),wF=t=>oe(t,Ym),sr="layout-inset",Xm=t=>t.x,vy=(t,e)=>t.x+t.width/2-e.width/2,Km=(t,e)=>t.x+t.width-e.width,qm=t=>t.y,Jm=(t,e)=>t.y+t.height-e.height,yy=(t,e)=>t.y+t.height/2-e.height/2,Tl=(t,e,o)=>Ne(Km(t,e),Jm(t,e),o.insetSouthwest(),Hm(),"southwest",ze(t,{right:0,bottom:3}),sr),Cl=(t,e,o)=>Ne(Xm(t),Jm(t,e),o.insetSoutheast(),Vm(),"southeast",ze(t,{left:1,bottom:3}),sr),Rc=(t,e,o)=>Ne(Km(t,e),qm(t),o.insetNorthwest(),Lm(),"northwest",ze(t,{right:0,top:2}),sr),Pc=(t,e,o)=>Ne(Xm(t),qm(t),o.insetNortheast(),wl(),"northeast",ze(t,{left:1,top:2}),sr),Sn=(t,e,o)=>Ne(vy(t,e),qm(t),o.insetNorth(),ry(),"north",ze(t,{top:2}),sr),Lc=(t,e,o)=>Ne(vy(t,e),Jm(t,e),o.insetSouth(),ay(),"south",ze(t,{bottom:3}),sr),xy=(t,e,o)=>Ne(Km(t,e),yy(t,e),o.insetEast(),iy(),"east",ze(t,{right:0}),sr),Sy=(t,e,o)=>Ne(Xm(t),yy(t,e),o.insetWest(),cy(),"west",ze(t,{left:1}),sr),TF=t=>{switch(t){case"north":return Sn;case"northeast":return Pc;case"northwest":return Rc;case"south":return Lc;case"southeast":return Cl;case"southwest":return Tl;case"east":return xy;case"west":return Sy}},wy=(t,e,o,n,s)=>by(n).map(TF).getOr(Sn)(t,e,o,n,s),CF=t=>{switch(t){case"north":return Lc;case"northeast":return Cl;case"northwest":return Tl;case"south":return Sn;case"southeast":return Pc;case"southwest":return Rc;case"east":return Sy;case"west":return xy}},_F=(t,e,o,n,s)=>by(n).map(CF).getOr(Sn)(t,e,o,n,s),Ty=(t,e)=>{YD(t,Math.floor(e))},Cy=w((t,e)=>{Ty(t,e),_r(t,{"overflow-x":"hidden","overflow-y":"auto"})}),Fa=w((t,e)=>{Ty(t,e)}),Zm=w((t,e)=>{ZD(t,Math.floor(e))});var ks;(function(t){t.TopToBottom="toptobottom",t.BottomToTop="bottomtotop"})(ks||(ks={}));const Qm="data-alloy-vertical-dir",OF=t=>dv(t,e=>Bo(e)&&Ee(e,"data-alloy-vertical-dir")===ks.BottomToTop);var uo;(function(t){t[t.HighlightMenuAndItem=0]="HighlightMenuAndItem",t[t.HighlightJustMenu=1]="HighlightJustMenu",t[t.HighlightNone=2]="HighlightNone"})(uo||(uo={}));const Gn={init:()=>No({readState:w("No State required")})},No=t=>t,EF={can:ve,abort:Pt,run:$},$a=t=>{if(!an(t,"can")&&!an(t,"abort")&&!an(t,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(t,null,2)+" does not have can, abort, or run!");return{...EF,...t}},kF=(t,e)=>(...o)=>Ge(t,(n,s)=>n&&e(s).apply(void 0,o),!0),AF=(t,e)=>(...o)=>Ge(t,(n,s)=>n||e(s).apply(void 0,o),!1),DF=t=>Xo(t)?{can:ve,abort:Pt,run:t}:t,MF=t=>{const e=kF(t,s=>s.can),o=AF(t,s=>s.abort);return{can:e,abort:o,run:(...s)=>{q(t,r=>{r.run.apply(void 0,s)})}}},pt=(t,e)=>{eg(t,t.element,e,{})},Y=(t,e,o)=>{eg(t,t.element,e,o)},Rr=t=>{pt(t,Ho())},tg=(t,e,o)=>{eg(t,e,o,{})},eg=(t,e,o,n)=>{const s={target:e,...n};t.getSystem().triggerEvent(o,e,s)},FF=(t,e,o,n)=>{const s={...n,target:e};t.getSystem().triggerEvent(o,e,s)},_y=(t,e,o,n)=>{t.getSystem().triggerEvent(o,e,n.event)},Ht=t=>Aa(t),Oy=(t,e)=>
vendor: 5,698 bytes, line 16
16({key:t,value:$a({abort:e})}),$F=(t,e)=>({key:t,value:$a({can:e})}),IF=t=>({key:t,value:$a({run:(e,o)=>{o.event.prevent()}})}),E=(t,e)=>({key:t,value:$a({run:e})}),og=(t,e,o)=>({key:t,value:$a({run:(n,s)=>{e.apply(void 0,[n,s].concat(o))}})}),BF=t=>e=>E(t,e),_l=t=>e=>({key:t,value:$a({run:(o,n)=>{vv(o,n)&&e(o,n)}})}),RF=(t,e)=>E(t,(o,n)=>{o.getSystem().getByUid(e).each(s=>{_y(s,s.element,t,n)})}),Ia=(t,e,o)=>{const n=e.partUids[o];return RF(t,n)},ng=(t,e)=>E(t,(o,n)=>{const s=n.event,r=o.getSystem().getByDom(s.target).getOrThunk(()=>Ki(s.target,c=>o.getSystem().getByDom(c).toOptional(),Pt).getOr(o));e(o,r,n)}),Pr=t=>E(t,(e,o)=>{o.cut()}),PF=t=>E(t,(e,o)=>{o.stop()}),Ba=(t,e)=>_l(t)(e),Vt=_l(Wn()),jn=_l(us()),Ey=_l(ll()),As=BF(Ho()),wn=t=>({classes:os(t.classes)?[]:t.classes,attributes:os(t.attributes)?{}:t.attributes,styles:os(t.styles)?{}:t.styles}),LF=(t,e)=>({...t,attributes:{...t.attributes,...e.attributes},styles:{...t.styles,...e.styles},classes:t.classes.concat(e.classes)}),VF=(t,e,o)=>As(n=>{o(n,t,e)}),sg=(t,e,o)=>Ey((n,s)=>{o(n,t,e)}),HF=(t,e,o,n,s,r)=>{const a=Po(t),c=Oo(e,[y1("config",t)]);return ky(a,c,e,o,n,s,r)},NF=(t,e,o,n,s,r)=>{const a=t,c=Oo(e,[cs("config",t)]);return ky(a,c,e,o,n,s,r)},zF=(t,e,o)=>j1((s,...r)=>{const a=[s].concat(r);return s.config({name:w(t)}).fold(()=>{throw new Error("We could not find any behaviour configuration for: "+t+". Using API: "+o)},c=>{const i=Array.prototype.slice.call(a,1);return e.apply(void 0,[s,c.config,c.state].concat(i))})},o,e),UF=t=>({key:t,value:void 0}),ky=(t,e,o,n,s,r,a)=>{const c=m=>an(m,o)?m[o]():d.none(),i=we(s,(m,g)=>zF(o,m,g)),u={...we(r,(m,g)=>Om(m,g)),...i,revoke:mo(UF,o),config:m=>{const g=ho(o+"-config",t,m);return{key:o,value:{config:g,me:u,configAsRaw:Xs(()=>ho(o+"-config",t,m)),initialConfig:m,state:a}}},schema:w(e),exhibit:(m,g)=>ya(c(m),tt(n,"exhibit"),(p,h)=>h(g,p.config,p.state)).getOrThunk(()=>wn({})),name:w(o),handlers:m=>c(m).map(g=>tt(n,"events").getOr(()=>({}))(g.config,g.state)).getOr({})};return u},D=t=>Aa(t),WF=Po([A("fields"),A("name"),T("active",{}),T("apis",{}),T("state",Gn),T("extra",{})]),De=t=>{const e=ho("Creating behaviour: "+t.name,WF,t);return HF(e.fields,e.name,e.active,e.apis,e.extra,e.state)},GF=Po([A("branchKey"),A("branches"),A("name"),T("active",{}),T("apis",{}),T("state",Gn),T("extra",{})]),Ay=t=>{const e=ho("Creating behaviour: "+t.name,GF,t);return NF(fo(e.branchKey,e.branches),e.name,e.active,e.apis,e.extra,e.state)},jF=w(void 0),YF=(t,e)=>{const o=Ht(e);return De({fields:[A("enabled")],name:t,active:{events:w(o)}})},et=(t,e)=>{const o=YF(t,e);return{key:t,value:{config:{},me:o,configAsRaw:w({}),initialConfig:{},state:Gn}}},XF=t=>({init:()=>{const o=X(t);return{get:()=>o.get(),set:c=>o.set(c),clear:()=>o.set(t),readState:()=>o.get()}}}),Dy=(t,e)=>{e.ignore||(Re(t.element),e.onFocus(t))};var KF=Object.freeze({__proto__:null,focus:Dy,blur:(t,e)=>{e.ignore||Wi(t.element)},isFocused:t=>Ta(t.element)}),qF=Object.freeze({__proto__:null,exhibit:(t,e)=>{const o=e.ignore?{}:{attributes:{tabindex:"-1"}};return wn(o)},events:t=>Ht([E(Zs(),(e,o)=>{Dy(e,t),o.stop()})].concat(t.stopMousedown?[E(Vo(),(e,o)=>{o.event.prevent()})]:[]))}),JF=[bt("onFocus"),T("stopMousedown",!1),T("ignore",!1)];const Z=De({fields:JF,name:"focusing",active:qF,apis:KF}),ZF=[8],Ds=[9],ds=[13],Ol=[27],ko=[32],El=[37],Vc=[38],kl=[39],Ra=[40],QF=(t,e,o)=>{const n=hc(t.slice(0,e)),s=hc(t.slice(e+1));return ee(n.concat(s),o)},t$=(t,e,o)=>{const n=hc(t.slice(0,e));return ee(n,o)},e$=(t,e,o)=>{const n=t.slice(0,e),s=t.slice(e+1);return ee(s.concat(n),o)},o$=(t,e,o)=>{const n=t.slice(e+1);return ee(n,o)},ft=t=>e=>{const o=e.raw;return le(t,o.which)},Yn=t=>e=>fa(t,o=>o(e)),Lr=t=>t.raw.shiftKey===!0,n$=t=>t.raw.ctrlKey===!0,Hc=pc(Lr),yt=(t,e)=>({matches:t,classification:e}),s$=(t,e)=>ee(t,n=>n.matches(e)).map(n=>n.classification),My=(t,e,o,n)=>{const s=io(t.element,"."+e.highlightClass);q(s,r=>{Ko(n,c=>Ft(c.element,r))||(Qt(r,e.highlightClass),t.getSystem().getByDom(r).each(c=>{e.onDehighlight(t,c),pt(c,ym())}))})},r$=(t,e,o)=>My(t,e,o,[]),a$=(t,e,o,n)=>{rg(t,e,o,n)&&(Qt(n.element,e.highlightClass),e.onDehighlight(t,n),pt(n,ym()))},Nc=(t,e,o,n)=>{My(t,e,o,[n]),rg(t,e,o,n)||(ne(n.element,e.highlightClass),e.onHighlight(t,n),pt(n,vm()))},c$=(t,e,o)=>{Fy(t,e).each(n=>{Nc(t,e,o,n)})},i$=(t,e,o)=>{$y(t,e).each(n=>{Nc(t,e,o,n)})},l$=(t,e,o,n)=>{m$(t,e,o,n).fold(s=>{throw s},s=>{Nc(t,e,o,s)})},u$=(t,e,o,n)=>{const s=By(t,e);ee(s,n).each(a=>{Nc(t,e,o,a)})},rg=(t,e,o,n)=>po(n.element,e.highlightClass),d$=(t,e,o)=>Dt(t.element,"."+e.highlightClass).bind(n=>t.getSystem().getByDom(n).toOptional()),m$=(t,e,o,n)=>{const s=io(t.element,"."+e.itemClass);return d.from(s[n]).fold(()=>mt.error(new Error("No element found with index "+n)),t.getSystem().getByDom)},Fy=(t,e,o)=>Dt(t.element,"."+e.itemClass).bind(n=>t.getSystem().getByDom(n).toOptional()),$y=(t,e,o)=>{const n=io(t.element,"."+e.itemClass);return(n.length>0?d.some(n[n.length-1]):d.none()).bind(r=>t.getSystem().getByDom(r).toOptional())},Iy=(t,e,o,n)=>{const s=io(t.element,"."+e.itemClass);return ha(s,a=>po(a,e.highlightClass)).bind(a=>{const c=va(a,n,0,s.length-1);return t.getSystem().getByDom(s[c]).toOptional()})},g$=(t,e,o)=>Iy(t,e,o,-1),p$=(t,e,o)=>Iy(t,e,o,1),By=(t,e,o)=>{const n=io(t.element,"."+e.itemClass);return wr(L(n,s=>t.getSystem().getByDom(s).toOptional()))};var h$=Object.freeze({__proto__:null,dehighlightAll:r$,dehighlight:a$,highlight:Nc,highlightFirst:c$,highlightLast:i$,highlightAt:l$,highlightBy:u$,isHighlighted:rg,getHighlighted:d$,getFirst:Fy,getLast:$y,getPrevious:g$,getNext:p$,getCandidates:By}),f$=[A("highlightClass"),A("itemClass"),bt("onHighlight"),bt("onDehighlight")];
16const Ct=De({fields:f$,name:"highlighting",apis:h$}),Ry=(t,e,o)=>{e.exists(s=>o.exists(r=>Ft(r,s)))||Y(t,ul(),{prevFocus:e,newFocus:o})},ag=()=>{const t=o=>Qe(o.element);return{get:t,set:(o,n)=>{const s=t(o);o.getSystem().triggerFocus(n,o.element);const r=t(o);Ry(o,s,r)}}},b$=()=>{const t=o=>Ct.getHighlighted(o).map(n=>n.element);return{get:t,set:(o,n)=>{const s=t(o);o.getSystem().getByDom(n).fold($,a=>{Ct.highlight(o,a)});const r=t(o);Ry(o,s,r)}}},Vr=(t,e,o,n,s)=>{const r=()=>t.concat([T("focusManager",ag()),Qo("focusInside","onFocus",Ec(l=>le(["onFocus","onEnterOrSpace","onApi"],l)?mt.value(l):mt.error("Invalid value for focusInside"))),Gt("handler",i),Gt("state",e),Gt("sendFocusIn",s)]),a=(l,u,m,g,p)=>{const h=m(l,u,g,p);return s$(h,u.event).bind(b=>b(l,u,g,p))},i={schema:r,processKey:a,toEvents:(l,u)=>{const m=l.focusInside!==tr.OnFocusMode?d.none():s(l).map(h=>E(Zs(),(b,v)=>{h(b,l,u),v.stop()})),g=(h,b)=>{const v=ft(ko.concat(ds))(b.event);l.focusInside===tr.OnEnterOrSpaceMode&&v&&vv(h,b)&&s(l).each(f=>{f(h,l,u),b.stop()})},p=[E(Un(),(h,b)=>{a(h,b,o,l,u).fold(()=>{g(h,b)},v=>{b.stop()})}),E(k1(),(h,b)=>{a(h,b,n,l,u).each(v=>{b.stop()})})];return Ht(m.toArray().concat(p))}};return i},Py=t=>{const e=[Tt("onEscape"),Tt("onEnter"),T("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),T("firstTabstop",0),T("useTabstopAt",ve),Tt("visibilitySelector")].concat([t]),o=(f,y)=>{const x=f.visibilitySelector.bind(C=>as(y,C)).getOr(y);return Te(x)>0},n=(f,y)=>{const x=io(f.element,y.selector),C=Wt(x,O=>o(y,O));return d.from(C[y.firstTabstop])},s=(f,y)=>y.focusManager.get(f).bind(x=>as(x,y.selector)),r=(f,y)=>o(f,y)&&f.useTabstopAt(y),a=(f,y,x)=>{n(f,y).each(C=>{y.focusManager.set(f,C)})},c=(f,y,x,C,O)=>O(y,x,F=>r(C,F)).fold(()=>C.cyclic?d.some(!0):d.none(),F=>(C.focusManager.set(f,F),d.some(!0))),i=(f,y,x,C)=>{const O=Wt(io(f.element,x.selector),F=>o(x,F));return s(f,x).bind(F=>ha(O,mo(Ft,F)).bind(S=>c(f,O,S,x,C)))},l=(f,y,x)=>{const C=x.cyclic?QF:t$;return i(f,y,x,C)},u=(f,y,x)=>{const C=x.cyclic?e$:o$;return i(f,y,x,C)},m=f=>CD(f).bind(Vd).exists(y=>Ft(y,f)),g=(f,y,x)=>s(f,x).filter(C=>!x.useTabstopAt(C)).bind(C=>(m(C)?l:u)(f,y,x)),p=(f,y,x)=>x.onEnter.bind(C=>C(f,y)),h=(f,y,x)=>x.onEscape.bind(C=>C(f,y)),b=w([yt(Yn([Lr,ft(Ds)]),l),yt(ft(Ds),u),yt(Yn([Hc,ft(ds)]),p)]),v=w([yt(ft(Ol),h),yt(ft(Ds),g)]);return Vr(e,Gn.init,b,v,()=>d.some(a))};var v$=Py(lo("cyclic",Pt)),y$=Py(lo("cyclic",ve));const Pa=t=>Bb("input")(t)&&Ee(t,"type")!=="radio"||Bb("textarea")(t),x$=(t,e,o)=>(tg(t,o,Ho()),d.some(!0)),zc=(t,e,o)=>Pa(o)&&ft(ko)(e.event)?d.none():x$(t,e,o),La=(t,e)=>d.some(!0),S$=[T("execute",zc),T("useSpace",!1),T("useEnter",!0),T("useControlEnter",!1),T("useDown",!1)],Ly=(t,e,o)=>o.execute(t,e,t.element),w$=(t,e,o,n)=>{const s=o.useSpace&&!Pa(t.element)?ko:[],r=o.useEnter?ds:[],a=o.useDown?Ra:[],c=s.concat(r).concat(a);return[yt(ft(c),Ly)].concat(o.useControlEnter?[yt(Yn([n$,ft(ds)]),Ly)]:[])},T$=(t,e,o,n)=>o.useSpace&&!Pa(t.element)?[yt(ft(ko),La)]:[];var C$=Vr(S$,Gn.init,w$,T$,()=>d.none());const Vy=()=>{const t=Rt();return No({readState:()=>t.get().map(s=>({numRows:String(s.numRows),numColumns:String(s.numColumns)})).getOr({numRows:"?",numColumns:"?"}),setGridSize:(s,r)=>{t.set({numRows:s,numColumns:r})},getNumRows:()=>t.get().map(s=>s.numRows),getNumColumns:()=>t.get().map(s=>s.numColumns)})};var _$=Object.freeze({__proto__:null,flatgrid:Vy,init:t=>t.state(t)});const Hy=t=>(e,o,n,s)=>{const r=t(e.element);return Ny(r,e,o,n,s)},cg=(t,e)=>{const o=qd(t,e);return Hy(o)},ig=(t,e)=>{const o=qd(e,t);return Hy(o)},lg=t=>(e,o,n,s)=>Ny(t,e,o,n,s),Ny=(t,e,o,n,s)=>n.focusManager.get(e).bind(a=>t(e.element,a,n,s)).map(a=>(n.focusManager.set(e,a),!0)),zy=lg,Uy=lg,Al=lg,O$=(t,e)=>ha(t,e).map(o=>({index:o,candidates:t})),Wy=(t,e,o)=>{const n=a=>Ft(a,e),s=io(t,o),r=Wt(s,tv);return O$(r,n)},Gy=(t,e)=>ha(t,o=>Ft(e,o)),jy=(t,e,o,n)=>{const s=Math.floor(e/o),r=e%o;return n(s,r).bind(a=>{const c=a.row*o+a.column;return c>=0&&c<t.length?d.some(t[c]):d.none()})},Yy=(t,e,o,n,s)=>jy(t,e,n,(r,a)=>{const i=r===o-1?t.length-r*n:n,l=va(a,s,0,i-1);return d.some({row:r,column:l})}),Xy=(t,e,o,n,s)=>jy(t,e,n,(r,a)=>{const c=va(r,s,0,o-1),l=c===o-1?t.length-c*n:n,u=un(a,0,l-1);return d.some({row:c,column:u})}),E$=(t,e,o,n)=>Yy(t,e,o,n,1),k$=(t,e,o,n)=>Yy(t,e,o,n,-1),A$=(t,e,o,n)=>Xy(t,e,o,n,-1),D$=(t,e,o,n)=>Xy(t,e,o,n,1),M$=[A("selector"),T("execute",zc),Eo("onEscape"),T("captureTab",!1),Uv()],F$=(t,e,o)=>{Dt(t.element,e.selector).each(n=>{e.focusManager.set(t,n)})},$$=(t,e)=>e.focusManager.get(t).bind(o=>as(o,e.selector)),I$=(t,e,o,n)=>$$(t,o).bind(s=>o.execute(t,e,s)),Dl=t=>(e,o,n,s)=>Wy(e,o,n.selector).bind(r=>t(r.candidates,r.index,s.getNumRows().getOr(n.initSize.numRows),s.getNumC
vendor: 6,926 bytes, line 16
16olumns().getOr(n.initSize.numColumns))),Ky=(t,e,o)=>o.captureTab?d.some(!0):d.none(),B$=(t,e,o)=>o.onEscape(t,e),qy=Dl(k$),Jy=Dl(E$),R$=Dl(A$),P$=Dl(D$),L$=w([yt(ft(El),cg(qy,Jy)),yt(ft(kl),ig(qy,Jy)),yt(ft(Vc),zy(R$)),yt(ft(Ra),Uy(P$)),yt(Yn([Lr,ft(Ds)]),Ky),yt(Yn([Hc,ft(Ds)]),Ky),yt(ft(ko.concat(ds)),I$)]),V$=w([yt(ft(Ol),B$),yt(ft(ko),La)]);var H$=Vr(M$,Vy,L$,V$,()=>d.some(F$));const Zy=(t,e,o,n,s)=>{const r=c=>Ss(c)==="button"&&Ee(c,"disabled")==="disabled",a=(c,i,l)=>s(c,i,n,0,l.length-1,l[i],u=>r(l[u])?a(c,u,l):d.from(l[u]));return Wy(t,o,e).bind(c=>{const i=c.index,l=c.candidates;return a(i,i,l)})},Qy=(t,e,o,n)=>Zy(t,e,o,n,(s,r,a,c,i,l,u)=>{const m=un(r+a,c,i);return m===s?d.from(l):u(m)}),Ml=(t,e,o,n)=>Zy(t,e,o,n,(s,r,a,c,i,l,u)=>{const m=va(r,a,c,i);return m===s?d.none():u(m)}),N$=[A("selector"),T("getInitial",d.none),T("execute",zc),Eo("onEscape"),T("executeOnMove",!1),T("allowVertical",!0),T("allowHorizontal",!0),T("cycles",!0)],z$=(t,e)=>e.focusManager.get(t).bind(o=>as(o,e.selector)),ug=(t,e,o)=>z$(t,o).bind(n=>o.execute(t,e,n)),U$=(t,e,o)=>{e.getInitial(t).orThunk(()=>Dt(t.element,e.selector)).each(n=>{e.focusManager.set(t,n)})},tx=(t,e,o)=>(o.cycles?Ml:Qy)(t,o.selector,e,-1),ex=(t,e,o)=>(o.cycles?Ml:Qy)(t,o.selector,e,1),ox=t=>(e,o,n,s)=>t(e,o,n,s).bind(()=>n.executeOnMove?ug(e,o,n):d.some(!0)),W$=(t,e,o)=>o.onEscape(t,e),G$=(t,e,o,n)=>{const s=[...o.allowHorizontal?El:[]].concat(o.allowVertical?Vc:[]),r=[...o.allowHorizontal?kl:[]].concat(o.allowVertical?Ra:[]);return[yt(ft(s),ox(cg(tx,ex))),yt(ft(r),ox(ig(tx,ex))),yt(ft(ds),ug),yt(ft(ko),ug)]},j$=w([yt(ft(ko),La),yt(ft(Ol),W$)]);var Y$=Vr(N$,Gn.init,G$,j$,()=>d.some(U$));const Fl=(t,e,o)=>d.from(t[e]).bind(n=>d.from(n[o]).map(s=>({rowIndex:e,columnIndex:o,cell:s}))),nx=(t,e,o,n)=>{const r=t[e].length,a=va(o,n,0,r-1);return Fl(t,e,a)},sx=(t,e,o,n)=>{const s=va(o,n,0,t.length-1),r=t[s].length,a=un(e,0,r-1);return Fl(t,s,a)},rx=(t,e,o,n)=>{const r=t[e].length,a=un(o+n,0,r-1);return Fl(t,e,a)},ax=(t,e,o,n)=>{const s=un(o+n,0,t.length-1),r=t[s].length,a=un(e,0,r-1);return Fl(t,s,a)},X$=(t,e,o)=>nx(t,e,o,1),K$=(t,e,o)=>nx(t,e,o,-1),q$=(t,e,o)=>sx(t,o,e,-1),J$=(t,e,o)=>sx(t,o,e,1),Z$=(t,e,o)=>rx(t,e,o,-1),Q$=(t,e,o)=>rx(t,e,o,1),t0=(t,e,o)=>ax(t,o,e,-1),e0=(t,e,o)=>ax(t,o,e,1),o0=[Cs("selectors",[A("row"),A("cell")]),T("cycles",!0),T("previousSelector",d.none),T("execute",zc)],n0=(t,e,o)=>{e.previousSelector(t).orThunk(()=>{const s=e.selectors;return Dt(t.element,s.cell)}).each(s=>{e.focusManager.set(t,s)})},s0=(t,e,o)=>Qe(t.element).bind(n=>o.execute(t,e,n)),r0=(t,e)=>L(t,o=>io(o,e.selectors.cell)),$l=(t,e)=>(o,n,s)=>{const r=s.cycles?t:e;return as(n,s.selectors.row).bind(a=>{const c=io(a,s.selectors.cell);return Gy(c,n).bind(i=>{const l=io(o,s.selectors.row);return Gy(l,a).bind(u=>{const m=r0(l,s);return r(m,u,i).map(g=>g.cell)})})})},cx=$l(K$,Z$),ix=$l(X$,Q$),a0=$l(q$,t0),c0=$l(J$,e0),i0=w([yt(ft(El),cg(cx,ix)),yt(ft(kl),ig(cx,ix)),yt(ft(Vc),zy(a0)),yt(ft(Ra),Uy(c0)),yt(ft(ko.concat(ds)),s0)]),l0=w([yt(ft(ko),La)]);var u0=Vr(o0,Gn.init,i0,l0,()=>d.some(n0));const d0=[A("selector"),T("execute",zc),T("moveOnTab",!1)],lx=(t,e,o)=>o.focusManager.get(t).bind(n=>o.execute(t,e,n)),m0=(t,e,o)=>{Dt(t.element,e.selector).each(n=>{e.focusManager.set(t,n)})},ux=(t,e,o)=>Ml(t,o.selector,e,-1),dx=(t,e,o)=>Ml(t,o.selector,e,1),g0=(t,e,o,n)=>o.moveOnTab?Al(ux)(t,e,o,n):d.none(),p0=(t,e,o,n)=>o.moveOnTab?Al(dx)(t,e,o,n):d.none(),h0=w([yt(ft(Vc),Al(ux)),yt(ft(Ra),Al(dx)),yt(Yn([Lr,ft(Ds)]),g0),yt(Yn([Hc,ft(Ds)]),p0),yt(ft(ds),lx),yt(ft(ko),lx)]),f0=w([yt(ft(ko),La)]);var b0=Vr(d0,Gn.init,h0,f0,()=>d.some(m0));const v0=[Eo("onSpace"),Eo("onEnter"),Eo("onShiftEnter"),Eo("onLeft"),Eo("onRight"),Eo("onTab"),Eo("onShiftTab"),Eo("onUp"),Eo("onDown"),Eo("onEscape"),T("stopSpaceKeyup",!1),Tt("focusIn")],y0=(t,e,o)=>[yt(ft(ko),o.onSpace),yt(Yn([Hc,ft(ds)]),o.onEnter),yt(Yn([Lr,ft(ds)]),o.onShiftEnter),yt(Yn([Lr,ft(Ds)]),o.onShiftTab),yt(Yn([Hc,ft(Ds)]),o.onTab),yt(ft(Vc),o.onUp),yt(ft(Ra),o.onDown),yt(ft(El),o.onLeft),yt(ft(kl),o.onRight),yt(ft(ko),o.onSpace)],x0=(t,e,o)=>[...o.stopSpaceKeyup?[yt(ft(ko),La)]:[],yt(ft(Ol),o.onEscape)];var S0=Vr(v0,Gn.init,y0,x0,t=>t.focusIn);const w0=v$.schema(),T0=y$.schema(),C0=Y$.schema(),_0=H$.schema(),O0=u0.schema(),E0=C$.schema(),k0=b0.schema(),A0=S0.schema();var D0=Object.freeze({__proto__:null,acyclic:w0,cyclic:T0,flow:C0,flatgrid:_0,matrix:O0,execution:E0,menu:k0,special:A0});const M0=t=>an(t,"setGridSize"),U=Ay({branchKey:"mode",branches:D0,name:"keying",active:{events:(t,e)=>t.handler.toEvents(t,e)},apis:{focusIn:(t,e,o)=>{e.sendFocusIn(e).fold(()=>{t.getSystem().triggerFocus(t.element,t.element)},n=>{n(t,e,o)})},setGridSize:(t,e,o,n,s)=>{M0(o)?o.setGridSize(n,s):console.error("Layout does not support setGridSize")}},state:_$}),Il=V("alloy-premade"),mx=t=>(Object.defineProperty(t.element.dom,Il,{value:t.uid,writable:!0}),Ar(Il,t)),F0=t=>At(t.dom,Il),gx=t=>tt(t,Il),Bl=t=>Y1((e,...o)=>t(e.getApis(),e,...o),t),dg=t=>t.getSystem().isConnected(),Uc=t=>{pt(t,us());const e=t.components();q(e,Uc)},Wc=t=>{const e=t.components();q(e,Wc),pt(t,Wn())},px=(t,e)=>{t.getSystem().addToWorld(e),Jo(t.element)&&Wc(e)},mg=t=>{Uc(t),t.getSystem().removeFromWorld(t)},hx=(t,e)=>{qo(t.element,e.element)},$0=t=>{q(t.components(),e=>rs(e.element)),Wd(t.element),t.syncComponents()},I0=(t,e,o)=>{const n=t.components();$0(t);const s=o(e),r=Sr(n,s);q(r,a=>{Uc(a),t.getSystem().removeFromWorld(a)}),q(s,a=>{dg(a)?hx(t,a):(t.getSystem().addToWorld(a),hx(t,a),Jo(t.element)&&Wc(a))}),t.syncComponents()},B0=(t,e,o)=>{const n=t.components(),s=ye(e,c=>gx(c).toArray());q(n,c=>{le(s,c)||mg(c)});const r=o(e),a=Sr(n,r);q(a,c=>{dg(c)&&mg(c)}),q(r,c=>{dg(c)||px(t,c)}),t.syncComponents()},Hr=(t,e)=>{fx(t,e,qo)},fx=(t,e,o)=>{t.getSystem().addToWorld(e),o(t.element,e.element),Jo(t.element)&&Wc(e),t.syncComponents()},bx=t=>{Uc(t),rs(t.element),t.getSystem().removeFromWorld(t)},Ms=t=>{const e=Ln(t.element).bind(o=>t.getSystem().getByDom(o).toOptional());bx(t),e.each(o=>{o.syncComponents()})},vx=t=>{const e=t.components();q(e,bx),Wd(t.element),t.syncComponents()},gg=(t,e)=>{yx(t,e,qo)},Rl=(t,e)=>{yx(t,e,PD)},yx=(t,e,o)=>{o(t,e.element);const n=Vn(e.element);q(n,s=>{e.getByDom(s).each(Wc)})},R0=t=>{const e=Vn(t.element);q(e,o=>{t.getByDom(o).each(Uc)}),rs(t.element)},P0=(t,e,o)=>Cr(t,e).map(s=>{if(o.exists(a=>!Ft(a,s))){const a=o.map(Ss).getOr("span"),c=I.fromTag(a);return xc(s,c),c}else return s}),xx=(t,e,o)=>{o.fold(()=>qo(t,e),n=>{Ft(n,e)||(xc(n,e),rs(n))})},Sx=(t,e,o)=>{const n=L(e,o),s=Vn(t);return q(s.slice(n.length),rs),n},wx=(t,e,o,n)=>{const s=Cr(t,e),r=n(o,s),a=P0(t,e,s);return xx(t,r.element,a),r},L0=(t,e,o)=>Sx(t,e,(n,s)=>wx(t,s,n,o)),V0=(t,e)=>Sx(t,e,(o,n)=>{const s=Cr(t,n);return xx(t,o,s),o}),pg=(t,e)=>{const o=ao(e),n=ss(o).bind(r=>{const a=c=>Ft(r,c);return a(e)?d.some(e):aM(e,a)}),s=t(e);return n.each(r=>{ss(o).filter(a=>Ft(a,r)).fold(()=>{Re(r)},$)}
16),s},Tx=(t,e)=>{pg(()=>{I0(t,e,()=>L(e,t.getSystem().build))},t.element)},Cx=(t,e)=>{pg(()=>{B0(t,e,()=>L0(t.element,e,t.getSystem().buildOrPatch))},t.element)},H0=(t,e,o,n)=>{mg(e);const s=wx(t.element,o,n,t.getSystem().buildOrPatch);px(t,s),t.syncComponents()},hg=(t,e,o)=>{const n=t.getSystem().build(o);fx(t,n,e)},N0=(t,e,o,n)=>{Ms(e),hg(t,(s,r)=>VD(s,r,o),n)},z0=(t,e,o,n)=>(e.reuseDom?Cx:Tx)(t,n),U0=(t,e,o,n)=>{hg(t,qo,n)},W0=(t,e,o,n)=>{hg(t,LD,n)},G0=(t,e,o,n)=>{const s=Pl(t);ee(s,a=>Ft(n.element,a.element)).each(Ms)},Pl=(t,e)=>t.components(),_x=(t,e,o,n,s)=>{const r=Pl(t);return d.from(r[n]).map(a=>(s.fold(()=>Ms(a),c=>{(e.reuseDom?H0:N0)(t,a,n,c)}),a))};var j0=Object.freeze({__proto__:null,append:U0,prepend:W0,remove:G0,replaceAt:_x,replaceBy:(t,e,o,n,s)=>{const r=Pl(t);return ha(r,n).bind(a=>_x(t,e,o,a,s))},set:z0,contents:Pl});const st=De({fields:[je("reuseDom",!0)],name:"replacing",apis:j0}),Y0=(t,e,o)=>Ft(e,t.element)&&!Ft(e,o),X0=Ht([$F(Zs(),(t,e)=>{const o=e.event,n=o.originator,s=o.target;return Y0(t,n,s)?(console.warn(Zs()+` did not get interpreted by the desired target. 
17Originator: `+Qs(n)+`
18Target: `+Qs(s)+`
19Check the `+Zs()+" event handlers"),!1):!0})]);var K0=Object.freeze({__proto__:null,events:X0});const q0=w("alloy-id-"),J0=w("data-alloy-id"),Z0=q0(),Ox=J0(),Q0=(t,e)=>{const o=V(Z0+t);return fg(e,o),o},fg=(t,e)=>{Object.defineProperty(t.dom,Ox,{value:e,writable:!0})},Gc=t=>{const e=Bo(t)?t.dom[Ox]:null;return d.from(e)},Va=t=>V(t),tI=xt,Ll=t=>{const e=s=>`The component must be in a context to execute: ${s}`+(t?`
20`+Qs(t().element)+" is not in context.":""),o=s=>()=>{throw new Error(e(s))},n=s=>()=>{console.warn(e(s))};return{debugInfo:w("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:Pt}},eI=Ll(),oI=(t,e)=>{const o=L(e,s=>Oo(s.name(),[A("config"),T("state",Gn)])),n=Xt("component.behaviours",J(o),t.behaviours).fold(s=>{throw new Error(ka(s)+`
21Complete spec:
22`+JSON.stringify(t,null,2))},xt);return{list:e,data:we(n,s=>{const r=s.map(a=>({config:a.config,state:a.state.init(a.config)}));return w(r)})}},nI=t=>t.list,sI=t=>t.data,Ex=(t,e)=>{const o={};return Ze(t,(n,s)=>{Ze(n,(r,a)=>{const c=tt(o,a).getOr([]);o[a]=c.concat([e(s,r)])})}),o},rI=(t,e,o,n)=>{const s={...e};q(o,u=>{s[u.name()]=u.exhibit(t,n)});const r=Ex(s,(u,m)=>({name:u,modification:m})),a=u=>pa(u,(m,g)=>({...g.modification,...m}),{}),c=pa(r.classes,(u,m)=>m.modification.concat(u),[]),i=a(r.attributes),l=a(r.styles);return wn({classes:c,attributes:i,styles:l})},aI=(t,e,o,n)=>{try{const s=Uf(o,(r,a)=>{const c=r[e],i=a[e],l=n.indexOf(c),u=n.indexOf(i);if(l===-1)throw new Error("The ordering for "+t+" does not have an entry for "+c+`.
23Order specified: `+JSON.stringify(n,null,2));if(u===-1)throw new Error("The ordering for "+t+" does not have an entry for "+i+`.
24Order specified: `+JSON.stringify(n,null,2));return l<u?-1:u<l?1:0});return mt.value(s)}catch(s){return mt.error([s])}},cI=(t,e)=>({handler:t,purpose:e}),iI=(t,e)=>({cHandler:t,purpose:e}),lI=(t,e)=>iI(mo.apply(void 0,[t.handler].concat(e)),t.purpose),bg=t=>t.cHandler,uI=(t,e)=>({name:t,handler:e}),dI=(t,e)=>{const o={};return q(t,n=>{o[n.name()]=n.handlers(e)}),o},mI=(t,e,o)=>{const n={...o,...dI(e,t)};return Ex(n,uI)},gI=(t,e,o,n)=>{const s=mI(t,o,n);return bI(s,e)},pI=t=>{const e=DF(t);return(o,n,...s)=>{const r=[o,n].concat(s);e.abort.apply(void 0,r)?n.stop():e.can.apply(void 0,r)&&e.run.apply(void 0,r)}},hI=(t,e)=>mt.error(["The event ("+t+`) has more than one behaviour that listens to it.
25When this occurs, you must specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).
26The behaviours that can trigger it are: `+JSON.stringify(L(e,o=>o.name),null,2)]),fI=(t,e,o)=>{const n=e[o];return n?aI("Event: "+o,"name",t,n).map(s=>{const r=L(s,a=>a.handler);return MF(r)}):hI(o,t)},bI=(t,e)=>{const o=Li(t,(n,s)=>(n.length===1?mt.value(n[0].handler):fI(n,e,s)).map(a=>{const c=pI(a),i=n.length>1?Wt(e[s],l=>Ko(n,u=>u.name===l)).join(" > "):n[0].name;return Ar(s,cI(c,i))}));return E1(o,{})},Nr="alloy.base.behaviour",vI=J([Ve("dom","dom",Nn(),J([A("tag"),T("styles",{}),T("classes",[]),T("attributes",{}),Tt("value"),Tt("innerHtml")])),A("components"),A("uid"),T("events",{}),T("apis",{}),Ve("eventOrder","eventOrder",s1({[Ho()]:["disabling",Nr,"toggling","typeaheadevents"],[Zs()]:[Nr,"focusing","keying"],[ll()]:[Nr,"disabling","toggling","representing","tooltipping"],[Es()]:[Nr,"representing","streaming","invali
26dating"],[us()]:[Nr,"representing","item-events","toolbar-button-events","tooltipping"],[Vo()]:["focusing",Nr,"item-type-events"],[Os()]:["focusing",Nr,"item-type-events"],[ls()]:["item-type-events","tooltipping"],[Fr()]:["receiving","reflecting","tooltipping"]}),pn()),Tt("domModification")]),yI=t=>Xt("custom.definition",vI,t),xI=t=>({...t.dom,uid:t.uid,domChildren:L(t.components,e=>e.element)}),SI=t=>t.domModification.fold(()=>wn({}),wn),wI=t=>t.events,kx=(t,e)=>{const o=xe(t),n=xe(e),s=Sr(n,o),r=xA(t,(a,c)=>!At(e,c)||a!==e[c]).t;return{toRemove:s,toSet:r}},TI=(t,e)=>{const{class:o,style:n,...s}=HD(e),{toSet:r,toRemove:a}=kx(t.attributes,s),c=()=>{q(a,x=>oe(e,x)),jb(e,r)},i=Zb(e),{toSet:l,toRemove:u}=kx(t.styles,i),m=()=>{q(u,x=>wt(e,x)),_r(e,l)},g=lv(e),p=Sr(g,t.classes),h=Sr(t.classes,g),b=()=>{Or(e,h),gn(e,p)},v=x=>{Ca(e,x)},f=()=>{const x=t.domChildren;V0(e,x)},y=()=>{const x=e,C=t.value.getOrUndefined();C!==Ts(x)&&Er(x,C!=null?C:"")};return c(),b(),m(),t.innerHtml.fold(f,v),y(),e},CI=t=>{const e=I.fromTag(t.tag);jb(e,t.attributes),Or(e,t.classes),_r(e,t.styles),t.innerHtml.each(n=>Ca(e,n));const o=t.domChildren;return Wb(e,o),t.value.each(n=>{Er(e,n)}),e},_I=(t,e)=>{try{const o=TI(t,e);return d.some(o)}catch{return d.none()}},OI=t=>t.innerHtml.isSome()&&t.domChildren.length>0,EI=(t,e)=>{const o=s=>Ss(s)===t.tag&&!OI(t)&&!F0(s),n=e.filter(o).bind(s=>_I(t,s)).getOrThunk(()=>CI(t));return fg(n,t.uid),n},kI=t=>{const e=tt(t,"behaviours").getOr({});return ye(xe(e),o=>{const n=e[o];return $e(n)?[n.me]:[]})},AI=(t,e)=>oI(t,e),DI=t=>{const e=kI(t);return AI(t,e)},MI=(t,e,o)=>{const n=xI(t),s=SI(t),r={"alloy.base.modification":s},a=e.length>0?rI(o,r,e,n):s;return LF(n,a)},FI=(t,e,o)=>{const n={"alloy.base.behaviour":wI(t)};return gI(o,t.eventOrder,e,n).getOrDie()},$I=(t,e)=>{const o=()=>x,n=X(eI),s=hn(yI(t)),r=DI(t),a=nI(r),c=sI(r),i=MI(s,a,c),l=EI(i,e),u=FI(s,a,c),m=X(s.components),g=C=>{n.set(C)},p=()=>{n.set(Ll(o))},h=()=>{const C=Vn(l),O=ye(C,F=>n.get().getByDom(F).fold(()=>[],bA));m.set(O)},b=C=>{const O=c;return(Xo(O[C.name()])?O[C.name()]:()=>{throw new Error("Could not find "+C.name()+" in "+JSON.stringify(t,null,2))})()},v=C=>Xo(c[C.name()]),f=()=>s.apis,y=C=>c[C]().map(O=>O.state.readState()).getOr("not enabled"),x={uid:t.uid,getSystem:n.get,config:b,hasConfigured:v,spec:t,readState:y,getApis:f,connect:g,disconnect:p,element:l,syncComponents:h,components:m.get,events:u};return x},II=(t,e)=>{const o=tt(t,"components").getOr([]);return e.fold(()=>L(o,Xe),n=>L(o,(s,r)=>vg(s,Cr(n,r))))},BI=(t,e)=>{const{events:o,...n}=tI(t),s=II(n,e),r={...n,events:{...K0,...o},components:s};return mt.value($I(r,e))},Nt=t=>{const e=I.fromText(t);return Ax({element:e})},Ax=t=>{const e=ho("external.component",Po([A("element"),Tt("uid")]),t),o=X(Ll()),n=c=>{o.set(c)},s=()=>{o.set(Ll(()=>a))},r=e.uid.getOrThunk(()=>Va("external"));fg(e.element,r);const a={uid:r,getSystem:o.get,config:d.none,hasConfigured:Pt,connect:n,disconnect:s,getApis:()=>({}),element:e.element,spec:t,readState:w("No state"),syncComponents:$,components:w([]),events:{}};return mx(a)},RI=Va,PI=t=>At(t,"uid"),vg=(t,e)=>gx(t).getOrThunk(()=>{const o=PI(t)?t:{uid:RI(""),...t};return BI(o,e).getOrDie()}),Xe=t=>vg(t,d.none()),zo=mx;var LI=Object.freeze({__proto__:null,block:(t,e,o,n)=>{nt(t.element,"aria-busy",!0);const s=e.getRoot(t).getOr(t),r=D([U.config({mode:"special",onTab:()=>d.some(!0),onShiftTab:()=>d.some(!0)}),Z.config({})]),a=n(s,r),c=s.getSystem().build(a);st.append(s,zo(c)),c.hasConfigured(U)&&e.focus&&U.focusIn(c),o.isBlocked()||e.onBlock(t),o.blockWith(()=>st.remove(s,c))},unblock:(t,e,o)=>{oe(t.element,"aria-busy"),o.isBlocked()&&e.onUnblock(t),o.clear()},isBlocked:(t,e,o)=>o.isBlocked()}),VI=[Lt("getRoot",d.none),je("focus",!0),bt("onBlock"),bt("onUnblock")],HI=Object.freeze({__proto__:null,init:()=>{const t=IA(),e=o=>{t.set({destroy:o})};return No({readState:t.isSet,blockWith:e,clear:t.clear,isBlocked:t.isSet})}});const Xn=De({fields:VI,name:"blocking",apis:LI,state:HI});var NI=Object.freeze({__proto__:null,getCurrent:(t,e,o)=>e.find(t)});const zI=[A("find")],ht=De({fields:zI,name:"composing",apis:NI});var UI=Object.freeze({__proto__:null,getCoupled:(t,e,o,n)=>o.getOrCreate(t,e,n),getExistingCoupled:(t,e,o,n)=>o.getExisting(t,e,n)}),WI=[Lo("others",Av(mt.value,pn()))],GI=Object.freeze({__proto__:null,init:()=>{const t={},e=(r,a)=>
26{if(xe(r.others).length===0)throw new Error("Cannot find any known coupled components");return tt(t,a)},o=(r,a,c)=>e(a,c).getOrThunk(()=>{const l=tt(a.others,c).getOrDie("No information found for coupled component: "+c)(r),u=r.getSystem().build(l);return t[c]=u,u}),n=(r,a,c)=>e(a,c).orThunk(()=>(tt(a.others,c).getOrDie("No information found for coupled component: "+c),d.none())),s=w({});return No({readState:s,getExisting:n,getOrCreate:o})}});const te=De({fields:WI,name:"coupling",apis:UI,state:GI}),jI=["input","button","textarea","select"],Dx=(t,e,o)=>{(e.disabled()?xg:Sg)(t,e)},yg=(t,e)=>e.useNative===!0&&le(jI,Ss(t.element)),YI=t=>Yb(t.element,"disabled"),XI=t=>{nt(t.element,"disabled","disabled")},KI=t=>{oe(t.element,"disabled")},qI=t=>Ee(t.element,"aria-disabled")==="true",JI=t=>{nt(t.element,"aria-disabled","true")},ZI=t=>{nt(t.element,"aria-disabled","false")},xg=(t,e,o)=>{e.disableClass.each(s=>{ne(t.element,s)}),(yg(t,e)?XI:JI)(t),e.onDisabled(t)},Sg=(t,e,o)=>{e.disableClass.each(s=>{Qt(t.element,s)}),(yg(t,e)?KI:ZI)(t),e.onEnabled(t)},Mx=(t,e)=>yg(t,e)?YI(t):qI(t);var QI=Object.freeze({__proto__:null,enable:Sg,disable:xg,isDisabled:Mx,onLoad:Dx,set:(t,e,o,n)=>{(n?xg:Sg)(t,e)}}),tB=Object.freeze({__proto__:null,exhibit:(t,e)=>wn({classes:e.disabled()?e.disableClass.toArray():[]}),events:(t,e)=>Ht([Oy(Ho(),(o,n)=>Mx(o,t)),sg(t,e,Dx)])}),eB=[Lt("disabled",Pt),T("useNative",!0),Tt("disableClass"),bt("onDisabled"),bt("onEnabled")];const z=De({fields:eB,name:"disabling",active:tB,apis:QI}),Tn=(t,e,o,n,s)=>{const r=a=>a+"px";return{position:t,left:e.map(r),top:o.map(r),right:n.map(r),bottom:s.map(r)}},oB=t=>({...t,position:d.some(t.position)}),Fx=(t,e)=>{Gi(t,oB(e))},nB=(t,e)=>{const o=t.element;ne(o,e.transitionClass),Qt(o,e.fadeOutClass),ne(o,e.fadeInClass),e.onShow(t)},sB=(t,e)=>{const o=t.element;ne(o,e.transitionClass),Qt(o,e.fadeInClass),ne(o,e.fadeOutClass),e.onHide(t)},rB=(t,e)=>t.y<e.bottom&&t.bottom>e.y,$x=(t,e)=>t.y>=e.y,Ix=(t,e)=>t.bottom<=e.bottom,wg=(t,e,o)=>({location:"top",leftX:e,topY:o.bounds.y-t.y}),Tg=(t,e,o)=>({location:"bottom",leftX:e,bottomY:t.bottom-o.bounds.bottom}),Cg=t=>t.box.x-t.win.x,aB=(t,e,o)=>{const n=e.win,s=e.box,r=Cg(e);return In(t,a=>{switch(a){case"bottom":return Ix(s,o.bounds)?d.none():d.some(Tg(n,r,o));case"top":return $x(s,o.bounds)?d.none():d.some(wg(n,r,o));default:return d.none()}}).getOr({location:"no-dock"})},cB=(t,e,o)=>fa(t,n=>{switch(n){case"bottom":return Ix(e,o.bounds);case"top":return $x(e,o.bounds)}}),iB=(t,e)=>{const o=e.optScrollEnv.fold(w(t.bounds.y),n=>n.scrollElmTop+(t.bounds.y-n.currentScrollTop));return Zt(t.bounds.x,o)},lB=(t,e)=>{const o=e.optScrollEnv.fold(w(t.y),n=>t.y+n.currentScrollTop-n.scrollElmTop);return Zt(t.x,o)},_g=(t,e,o)=>o.getInitialPos().map(n=>{const s=iB(n,e);return{box:ke(s.left,s.top,Co(t),Te(t)),location:n.location}}),Bx=(t,e,o,n,s)=>{const r=lB(e,o),a=ke(r.left,r.top,e.width,e.height);n.setInitialPos({style:Zb(t),position:to(t,"position")||"static",bounds:a,location:s.location})},uB=(t,e,o,n,s)=>{n.getInitialPos().fold(()=>Bx(t,e,o,n,s),()=>$)},Rx=(t,e,o)=>o.getInitialPos().bind(n=>{var s;switch(o.clearInitialPos(),n.position){case"static":return d.some({morph:"static"});case"absolute":const r=sm(t).getOr(Ks()),a=Ae(r),c=(s=r.dom.scrollTop)!==null&&s!==void 0?s:0;return d.some({morph:"absolute",positionCss:Tn("absolute",tt(n.style,"left").map(i=>e.x-a.x),tt(n.style,"top").map(i=>e.y-a.y+c),tt(n.style,"right").map(i=>a.right-e.right),tt(n.style,"bottom").map(i=>a.bottom-e.bottom))});default:return d.none()}}),dB=(t,e,o)=>_g(t,e,o).filter(({box:n})=>cB(o.getModes(),n,e)).bind(({box:n})=>Rx(t,n,o)),Og=t=>{switch(t.location){case"top":return d.some({morph:"fixed",positionCss:Tn("fixed",d.some(t.leftX),d.some(t.topY),d.none(),d.none())});case"bottom":return d.some({morph:"fixed",positionCss:Tn("fixed",d.some(t.leftX),d.none(),d.none(),d.some(t.bottomY))});default:return d.none()}},mB=(t,e,o)=>{const n=Ae(t),s=eo(),r=aB(o.getModes(),{win:s,box:n},e);return r.location==="top"||r.location==="bottom"?(Bx(t,n,e,o,r),Og(r)):d.none()},gB=(t,e,o)=>dB(t,e,o).orThunk(()=>e.optScrollEnv.bind(n=>_g(t,e,o)).bind(({box:n,location:s})=>{const r=eo(),a=Cg({win:r,box:n}),c=s==="top"?wg(r,a,e):Tg(r,a,e);return Og(c)})),pB=(t,e,o)=>{const n=t.element;return Bn(Le(n,"position"),"fixed")?gB(n,e,o):mB(n,e,o)},hB=(t,e,o)=>{const n=t.element;return _g(n,e,o).bind(({box:s})=>Rx(n,s,o))},fB=(t,e,o,n)=>{const s=Ae(t),r=eo(),a=Cg({win:r,box:s}
26),c=n(r,a,e);return c.location==="bottom"||c.location==="top"?(uB(t,s,e,o,c),Og(c)):d.none()},Px=(t,e,o)=>{o.setDocked(!1),q(["left","right","top","bottom","position"],n=>wt(t.element,n)),e.onUndocked(t)},Eg=(t,e,o,n)=>{const s=n.position==="fixed";o.setDocked(s),Fx(t.element,n),(s?e.onDocked:e.onUndocked)(t)},Lx=(t,e,o,n,s=!1)=>{e.contextual.each(r=>{r.lazyContext(t).each(a=>{const c=rB(a,n.bounds);c!==o.isVisible()&&(o.setVisible(c),s&&!c?(Or(t.element,[r.fadeOutClass]),r.onHide(t)):(c?nB:sB)(t,r))})})},Vx=(t,e,o,n,s)=>{Lx(t,e,o,n,!0),Eg(t,e,o,s.positionCss)},bB=(t,e,o,n,s)=>{switch(s.morph){case"static":return Px(t,e,o);case"absolute":return Eg(t,e,o,s.positionCss);case"fixed":return Vx(t,e,o,n,s)}},vB=(t,e,o)=>{const n=e.lazyViewport(t);Lx(t,e,o,n),pB(t,n,o).each(s=>{bB(t,e,o,n,s)})},yB=(t,e,o)=>{const n=t.element;o.setDocked(!1);const s=e.lazyViewport(t);hB(t,s,o).each(r=>{switch(r.morph){case"static":{Px(t,e,o);break}case"absolute":{Eg(t,e,o,r.positionCss);break}}}),o.setVisible(!0),e.contextual.each(r=>{gn(n,[r.fadeInClass,r.fadeOutClass,r.transitionClass]),r.onShow(t)}),Vl(t,e,o)},Vl=(t,e,o)=>{t.getSystem().isConnected()&&vB(t,e,o)},Hx=(t,e,o)=>{o.isDocked()&&yB(t,e,o)},Nx=t=>(e,o,n)=>{const s=o.lazyViewport(e);fB(e.element,s,n,t).each(a=>{Vx(e,o,n,s,a)})},xB=Nx(wg),SB=Nx(Tg);var wB=Object.freeze({__proto__:null,refresh:Vl,reset:Hx,isDocked:(t,e,o)=>o.isDocked(),getModes:(t,e,o)=>o.getModes(),setModes:(t,e,o,n)=>o.setModes(n),forceDockToTop:xB,forceDockToBottom:SB}),TB=Object.freeze({__proto__:null,events:(t,e)=>Ht([Ba(Mc(),(o,n)=>{t.contextual.each(s=>{po(o.element,s.transitionClass)&&(gn(o.element,[s.transitionClass,s.fadeInClass]),(e.isVisible()?s.onShown:s.onHidden)(o)),n.stop()})}),E(fm(),(o,n)=>{Vl(o,t,e)}),E(Lv(),(o,n)=>{Vl(o,t,e)}),E(Bc(),(o,n)=>{Hx(o,t,e)})])}),CB=[Oo("contextual",[de("fadeInClass"),de("fadeOutClass"),de("transitionClass"),bn("lazyContext"),bt("onShow"),bt("onShown"),bt("onHide"),bt("onHidden")]),Lt("lazyViewport",()=>({bounds:eo(),optScrollEnv:d.none()})),_s("modes",["top","bottom"],ue),bt("onDocked"),bt("onUndocked")],_B=Object.freeze({__proto__:null,init:t=>{const e=X(!1),o=X(!0),n=Rt(),s=X(t.modes),r=()=>`docked:  ${e.get()}, visible: ${o.get()}, modes: ${s.get().join(",")}`;return No({isDocked:e.get,setDocked:e.set,getInitialPos:n.get,setInitialPos:n.set,clearInitialPos:n.clear,isVisible:o.get,setVisible:o.set,getModes:s.get,setModes:s.set,readState:r})}});const jt=De({fields:CB,name:"docking",active:TB,apis:wB,state:_B}),kg=cn.generate([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),Hl=t=>e=>e.translate(-t.left,-t.top),Nl=t=>e=>e.translate(t.left,t.top),Fs=t=>(e,o)=>Ge(t,(n,s)=>s(n),Zt(e,o)),zl=(t,e,o)=>t.fold(Fs([Nl(o),Hl(e)]),Fs([Hl(e)]),Fs([])),Ha=(t,e,o)=>t.fold(Fs([Nl(o)]),Fs([]),Fs([Nl(e)])),zx=(t,e,o)=>t.fold(Fs([]),Fs([Hl(o)]),Fs([Nl(e),Hl(o)])),OB=(t,e,o,n,s,r)=>{const a=Ha(t,s,r),c=Ha(e,s,r);return Math.abs(a.left-c.left)<=o&&Math.abs(a.top-c.top)<=n},EB=(t,e,o,n,s,r)=>{const a=Ha(t,s,r),c=Ha(e,s,r),i=Math.abs(a.left-c.left),l=Math.abs(a.top-c.top);return Zt(i,l)},Ux=(t,e,o)=>{const n=t.fold((s,r)=>({position:d.some("absolute"),left:d.some(s+"px"),top:d.some(r+"px")}),(s,r)=>({position:d.some("absolute"),left:d.some(s-o.left+"px"),top:d.some(r-o.top+"px")}),(s,r)=>({position:d.some("fixed"),left:d.some(s+"px"),top:d.some(r+"px")}));return{right:d.none(),bottom:d.none(),...n}},kB=(t,e,o)=>t.fold((n,s)=>Ul(n+e,s+o),(n,s)=>rr(n+e,s+o),(n,s)=>zr(n+e,s+o)),Ag=(t,e,o,n)=>{const s=(r,a)=>(c,i)=>{const l=r(e,o,n);return a(c.getOr(l.left),i.getOr(l.top))};return t.fold(s(zx,Ul),s(Ha,rr),s(zl,zr))},Ul=kg.offset,rr=kg.absolute,zr=kg.fixed,Wx=(t,e)=>{const o=Ee(t,e);return os(o)?NaN:parseInt(o,10)},AB=(t,e)=>{const o=t.element,n=Wx(o,e.leftAttr),s=Wx(o,e.topAttr);return isNaN(n)||isNaN(s)?d.none():d.some(Zt(n,s))},DB=(t,e,o)=>{const n=t.element;nt(n,e.leftAttr,o.left+"px"),nt(n,e.topAttr,o.top+"px")},MB=(t,e)=>{const o=t.element;oe(o,e.leftAttr),oe(o,e.topAttr)},FB=(t,e,o,n)=>AB(t,e).fold(()=>o,s=>zr(s.left+n.left,s.top+n.top)),$B=(t,e,o,n,s,r)=>{const a=FB(t,e,o,n),c=e.mustSnap?BB(t,e,a,s,r):RB(t,e,a,s,r),i=zl(a,s,r);return DB(t,e,i),c.fold(()=>({coord:zr(i.left,i.top),extra:d.none()}),l=>({coord:l.output,extra:l.extra}))},IB=(t,e)=>{MB(t,e)},Gx=(t,e,o,n)=>In(t,s=>{const r=s.sensor;return OB(e,r,s.range.left,s.range.top,o,n)?d.some({output:Ag(s.output,e,o,n),extra:s.extra}):d.none()}),BB=(t,e,o,n,s)=>{const r=e.getSnapPoints(t);return Gx(r,o,n,s).orThunk(()=>Ge(r,(i,l)=>{const u=l.sensor,m=EB(o,u,l.range.left,l.range.top,n,s);return i.deltas.fold(()=>({deltas:d.some(m),snap:d.some(l)}),g=>{const p=(m.left+m.top)/2,h=(g.left+g.top)/2;return p<=h?{deltas:d.some(m),snap:d.some(l)}:i})},{deltas:d.none(),snap:d.none()}).snap.map(i=>({output:Ag(i.output,o,n,s),extra:i.extra})))},RB=(t,e,o,n,s)=>{const r=e.getSnapPoints(t);return Gx(r,o,n,s)},PB=(t,e,o)=>({coord:Ag(t.output,t.output,e,o),extra:t.extra});var LB=Object.freeze({__proto__:null,snapTo:(t,e,o,n)=>{const s=e.getTarget(t.element);if(e.repositionTarget){const r=Pn(t.element),a=Ro(r),c=yv(s),i=PB(n,a,c),l=Ux(i.coord,a,c);Gi(s,l)}}});const _e=(t,e)=>mm(t,{},L(e,o=>v1(o.name(),"Cannot configure "+o.name()+" for "+t)).concat([lo("dump",xt)])),Wl=t=>t.dump,Me=(t,e)=>({...D(e),...t.dump}),Cn={field:_e,augment:Me,get:Wl},VB=(t,e)=>(t.length>0?[Cs("parts",t)]:[]).concat([A("uid"),T("dom",{}),T("components",[]),zv("originalSpec"),T("debug.sketcher",{})]).concat(e),jx=(t,e,o,n,s)=>{const r=VB(n,s);return ho(t+" [SpecSchema]",Po(r.concat(e)),o)},HB=(t,e,o,n)=>{const s=Yx(n),r=jx(t,e,s,[],[]);return o(r,s)},Dg=(t,e,o,n,s)=>{const r=Yx(s),a=Qv(o),c=Pm(o),i=jx(t,e,r,a,[c]),l=Im(t,i,o),u=Bm(t,i,l.internals());return n(i,u,r,l.externals())},NB=t=>At(t,"uid"),Yx=t=>NB(t)?t:{...t,uid:Va("uid")},zB=t=>t.uid!==void 0,UB=Po([A("name"),A("factory"),A("configFields"),T("apis",{}),T("extraApis",{})]),WB=Po([A("name"),A("factory"),A("configFields"),A("partFields"),T("apis",{}),T("extraApis",{})]),Uo=t=>{const e=ho("Sketcher for "+t.name,UB,t),o=r=>HB(e.name,e.configFields,e.factory,r),n=we(e.apis,Bl),s=we(e.extraApis,(r,a)=>Om(r,a));return{name:e.name,configFields:e.configFields,sketch:o,...n,...s}},oo=t=>{const e=ho("Sketcher for "+t.name,WB,t),o=a=>Dg(e.name,e.configFields,e.partFields,e.factory,a),n=Fm(e.name,e.partFields),s=we(e.apis,Bl),r=we(e.extraApis,(a,c)=>Om(a,c));return{name:e.name,partFields:e.partFields,configFields:e.configFields,sketch:o,parts:n,...s,...r}},Kn=Uo({name:"Container",factory:t=>{const{attributes:e,...o}=t.dom;return{uid:t.uid,dom:{tag:"div",attributes:{role:"presentation",...e},...o},components:t.components,behaviours:Wl(t.containerBehaviours),events:t.events,domModification:t.domModification,eventOrder:t.eventOrder}},configFields:[T("components",[]),_e("containerBehaviours",[]),T("events",{}),T("domModification",{}),T("eventOrder",{})]}),Mg="data-initial-z-index",GB=t=>
26{Ln(t.element).filter(Bo).each(e=>{Pe(e,Mg).fold(()=>wt(e,"z-index"),o=>ct(e,"z-index",o)),oe(e,Mg)})},jB=t=>{Ln(t.element).filter(Bo).each(e=>{Le(e,"z-index").each(o=>{nt(e,Mg,o)}),ct(e,"z-index",to(t.element,"z-index"))})},Xx=(t,e)=>{t.getSystem().addToGui(e),jB(e)},YB=t=>{GB(t),t.getSystem().removeFromGui(t)},Kx=(t,e,o)=>t.getSystem().build(Kn.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[e]},events:o}));var XB=Oo("snaps",[A("getSnapPoints"),bt("onSensor"),A("leftAttr"),A("topAttr"),T("lazyViewport",eo),T("mustSnap",!1)]);const Fg=[T("useFixed",Pt),A("blockerClass"),T("getTarget",xt),T("onDrag",$),T("repositionTarget",!0),T("onDrop",$),Lt("getBounds",eo),XB],KB=t=>DA(Le(t,"left"),Le(t,"top"),Le(t,"position"),(e,o,n)=>(n==="fixed"?zr:Ul)(parseInt(e,10),parseInt(o,10))).getOrThunk(()=>{const e=mn(t);return rr(e.left,e.top)}),qB=(t,e,o,n,s)=>{const r=s.bounds,a=Ha(e,o,n),c=un(a.left,r.x,r.x+r.width-s.width),i=un(a.top,r.y,r.y+r.height-s.height),l=rr(c,i);return e.fold(()=>{const u=zx(l,o,n);return Ul(u.left,u.top)},w(l),()=>{const u=zl(l,o,n);return zr(u.left,u.top)})},JB=(t,e,o,n,s,r,a)=>{const c=e.fold(()=>{const i=kB(o,r.left,r.top),l=zl(i,n,s);return zr(l.left,l.top)},i=>{const l=$B(t,i,o,r,n,s);return l.extra.each(u=>{i.onSensor(t,u)}),l.coord});return qB(t,c,n,s,a)},ZB=(t,e,o,n)=>{const s=e.getTarget(t.element);if(e.repositionTarget){const r=Pn(t.element),a=Ro(r),c=yv(s),i=KB(s),l=JB(t,e.snaps,i,a,c,n,o),u=Ux(l,a,c);Gi(s,u)}e.onDrag(t,s,n)},qx=(t,e)=>({bounds:t.getBounds(),height:qs(e.element),width:Tc(e.element)}),$g=(t,e,o,n,s)=>{const r=o.update(n,s),a=o.getStartData().getOrThunk(()=>qx(e,t));r.each(c=>{ZB(t,e,a,c)})},Jx=(t,e,o,n)=>{e.each(YB),o.snaps.each(r=>{IB(t,r)});const s=o.getTarget(t.element);n.reset(),o.onDrop(t,s)},Ig=t=>(e,o)=>{const n=s=>{o.setStartData(qx(e,s))};return Ht([E(fm(),s=>{o.getStartData().each(()=>n(s))}),...t(e,o,n)])},QB=t=>Ht([E(Vo(),t.forceDrop),E(gm(),t.drop),E(al(),(e,o)=>{t.move(o.event)}),E(cl(),t.delayDrop)]);var tR=Object.freeze({__proto__:null,getData:t=>d.from(Zt(t.x,t.y)),getDelta:(t,e)=>Zt(e.left-t.left,e.top-t.top)});const Zx=(t,e,o)=>[E(Vo(),(n,s)=>{if(s.event.raw.button!==0)return;s.stop();const a=()=>Jx(n,d.some(l),t,e),c=Wv(a,200),i={drop:a,delayDrop:c.schedule,forceDrop:a,move:m=>{c.cancel(),$g(n,t,e,tR,m)}},l=Kx(n,t.blockerClass,QB(i));(()=>{o(n),Xx(n,l)})()})],eR=[...Fg,Gt("dragger",{handlers:Ig(Zx)})],oR=t=>Ht([E(Os(),t.forceDrop),E(Dr(),t.drop),E(Bv(),t.drop),E(Dc(),(e,o)=>{t.move(o.event)})]),nR=t=>{const e=t[0];return d.some(Zt(e.clientX,e.clientY))};var Qx=Object.freeze({__proto__:null,getData:t=>{const o=t.raw.touches;return o.length===1?nR(o):d.none()},getDelta:(t,e)=>Zt(e.left-t.left,e.top-t.top)});const tS=(t,e,o)=>{const n=Rt(),s=r=>{Jx(r,n.get(),t,e),n.clear()};return[E(Os(),(r,a)=>{a.stop();const c=()=>s(r),i={drop:c,delayDrop:$,forceDrop:c,move:m=>{$g(r,t,e,Qx,m)}},l=Kx(r,t.blockerClass,oR(i));n.set(l),(()=>{o(r),Xx(r,l)})()}),E(Dc(),(r,a)=>{a.stop(),$g(r,t,e,Qx,a.event)}),E(Dr(),(r,a)=>{a.stop(),s(r)}),E(Bv(),s)]},sR=[...Fg,Gt("dragger",{handlers:Ig(tS)})],rR=(t,e,o)=>[...Zx(t,e,o),...tS(t,e,o)],aR=[...Fg,Gt("dragger",{handlers:Ig(rR)})];var cR=Object.freeze({__proto__:null,mouse:eR,touch:sR,mouseOrTouch:aR}),iR=Object.freeze({__proto__:null,init:()=>{let t=d.none(),e=d.none();const o=()=>{t=d.none(),e=d.none()},n=(i,l)=>{const u=t.map(m=>i.getDelta(m,l));return t=d.some(l),u},s=(i,l)=>i.getData(l).bind(u=>n(i,u)),r=i=>{e=d.some(i)},a=()=>e,c=w({});return No({readState:c,reset:o,update:s,getStartData:a,setStartData:r})}});const Ur=Ay({branchKey:"mode",branches:cR,name:"dragging",active:{events:(t,e)=>t.dragger.handlers(t,e)},extra:{snap:t=>({sensor:t.sensor,range:t.range,output:t.output,extra:d.from(t.extra)})},state:iR,apis:LB}),lR=["input","textarea"],eS=t=>{const e=Ss(t);return le(lR,e)},oS=(t,e)=>{const o=e.getRoot(t).getOr(t.element);Qt(o,e.invalidClass),e.notify.each(n=>{eS(t.element)&&nt(t.element,"aria-invalid",!1),n.getContainer(t).each(s=>{Ca(s,n.validHtml)}),n.onValid(t)})},nS=(t,e,o,n)=>{const s=e.getRoot(t).getOr(t.element);
26ne(s,e.invalidClass),e.notify.each(r=>{eS(t.element)&&nt(t.element,"aria-invalid",!0),r.getContainer(t).each(a=>{Ca(a,n)}),r.onInvalid(t,n)})},sS=(t,e,o)=>e.validator.fold(()=>Be.pure(mt.value(!0)),n=>n.validate(t)),Bg=(t,e,o)=>(e.notify.each(n=>{n.onValidate(t)}),sS(t,e).map(n=>t.getSystem().isConnected()?n.fold(s=>(nS(t,e,o,s),mt.error(s)),s=>(oS(t,e),mt.value(s))):mt.error("No longer in system")));var uR=Object.freeze({__proto__:null,markValid:oS,markInvalid:nS,query:sS,run:Bg,isInvalid:(t,e)=>{const o=e.getRoot(t).getOr(t.element);return po(o,e.invalidClass)}}),dR=Object.freeze({__proto__:null,events:(t,e)=>t.validator.map(o=>Ht([E(o.onEvent,n=>{Bg(n,t,e).get(xt)})].concat(o.validateOnLoad?[Vt(n=>{Bg(n,t,e).get($)})]:[]))).getOr({})}),mR=[A("invalidClass"),T("getRoot",d.none),Oo("notify",[T("aria","alert"),T("getContainer",d.none),T("validHtml",""),bt("onValid"),bt("onInvalid"),bt("onValidate")]),Oo("validator",[A("validate"),T("onEvent","input"),T("validateOnLoad",!0)])];const Rg=(t,e,o)=>{e.store.manager.onLoad(t,e,o)},rS=(t,e,o)=>{e.store.manager.onUnload(t,e,o)};var gR=Object.freeze({__proto__:null,onLoad:Rg,onUnload:rS,setValue:(t,e,o,n)=>{e.store.manager.setValue(t,e,o,n)},getValue:(t,e,o)=>e.store.manager.getValue(t,e,o),getState:(t,e,o)=>o}),pR=Object.freeze({__proto__:null,events:(t,e)=>{const o=t.resetOnDom?[Vt((n,s)=>{Rg(n,t,e)}),jn((n,s)=>{rS(n,t,e)})]:[sg(t,e,Rg)];return Ht(o)}});const aS=()=>{const t=X(null),e=()=>({mode:"memory",value:t.get()}),o=()=>t.get()===null,n=()=>{t.set(null)};return No({set:t.set,get:t.get,isNotSet:o,clear:n,readState:e})},hR=()=>No({readState:$}),cS=()=>{const t=X({}),e=X({});return No({readState:()=>({mode:"dataset",dataByValue:t.get(),dataByText:e.get()}),lookup:a=>tt(t.get(),a).orThunk(()=>tt(e.get(),a)),update:a=>{const c=t.get(),i=e.get(),l={},u={};q(a,m=>{l[m.value]=m,tt(m,"meta").each(g=>{tt(g,"text").each(p=>{u[p]=m})})}),t.set({...c,...l}),e.set({...i,...u})},clear:()=>{t.set({}),e.set({})}})};var fR=Object.freeze({__proto__:null,memory:aS,dataset:cS,manual:hR,init:t=>t.store.manager.state(t)});const iS=(t,e,o,n)=>{const s=e.store;o.update([n]),s.setValue(t,n),e.onSetValue(t,n)},bR=(t,e,o)=>{const n=e.store,s=n.getDataKey(t);return o.lookup(s).getOrThunk(()=>n.getFallbackEntry(s))},vR=(t,e,o)=>{e.store.initialValue.each(s=>{iS(t,e,o,s)})},yR=(t,e,o)=>{o.clear()};var xR=[Tt("initialValue"),A("getFallbackEntry"),A("getDataKey"),A("setValue"),Gt("manager",{setValue:iS,getValue:bR,onLoad:vR,onUnload:yR,state:cS})];const SR=(t,e,o)=>e.store.getValue(t),wR=(t,e,o,n)=>{e.store.setValue(t,n),e.onSetValue(t,n)},TR=(t,e,o)=>{e.store.initialValue.each(n=>{e.store.setValue(t,n)})};var CR=[A("getValue"),T("setValue",$),Tt("initialValue"),Gt("manager",{setValue:wR,getValue:SR,onLoad:TR,onUnload:$,state:Gn.init})];const _R=(t,e,o,n)=>{o.set(n),e.onSetValue(t,n)},OR=(t,e,o)=>o.get(),ER=(t,e,o)=>{e.store.initialValue.each(n=>{o.isNotSet()&&o.set(n)})},kR=(t,e,o)=>{o.clear()};var AR=[Tt("initialValue"),Gt("manager",{setValue:_R,getValue:OR,onLoad:ER,onUnload:kR,state:aS})],DR=[Qo("store",{mode:"memory"},fo("mode",{memory:AR,manual:CR,dataset:xR})),bt("onSetValue"),T("resetOnDom",!1)];const P=De({fields:DR,name:"representing",active:pR,apis:gR,extra:{setValueFrom:(t,e)=>{const o=P.getValue(e);P.setValue(t,o)}},state:fR}),ms=De({fields:mR,name:"invalidating",active:dR,apis:uR,extra:{validation:t=>e=>{const o=P.getValue(e);return Be.pure(t(o))}}});var MR=Object.freeze({__proto__:null,exhibit:(t,e)=>wn({classes:[],styles:e.useFixed()?{}:{position:"relative"}})});const Pg=cn.generate([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),lS=(t,e,o,n,s,r)=>{const a=e.rect,c=a.x-o,i=a.y-n,l=a.width,u=a.height,m=s-(c+l),g=r-(i+u),p=d.some(c),h=d.some(i),b=d.some(m),v=d.some(g),f=d.none();return pF(e.direction,()=>Tn(t,p,h,f,f),()=>Tn(t,f,h,b,f),()=>Tn(t,p,f,f,v),()=>Tn(t,f,f,b,v),()=>Tn(t,p,h,f,f),()=>Tn(t,p,f,f,v),()=>Tn(t,p,h,f,f),()=>Tn(t,f,h,b,f))},uS=(t,e)=>t.fold(()=>{const o=e.rect;return Tn("absolute",d.some(o.x),d.some(o.y),d.none(),d.none())},(o,n,s,r)=>lS("absolute",e,o,n,s,r),(o,n,s,r)=>lS("fixed",e,o,n,s,r)),Lg=(t,e)=>{const o=mo(om,e),n=t.fold(o,o,()=>{const a=Ro();return om(e).translate(-a.left,-a.top)}),s=Tc(e),r=qs(e);return ke(n.left,n.top,s,r)},FR=(t,e)=>e.fold(()=>t.fold(eo,eo,ke),o=>t.fold(w(o),w(o),()=>{const n=dS(t,o.x,o.y);return ke(n.left,n.top,o.width,o.height)})),dS=(t,e,o)=>{const n=Zt(e,o),s=()=>{const r=Ro();return n.translate(-r.left,-r.top)};return t.fold(w(n),w(n),s)},$R=(t,e,o,n)=>t.fold(e,o,n);Pg.none;const IR=Pg.relative,BR=Pg.fixed,RR=(t,e)=>({anchorBox:t,origin:e}),PR=(t,e)=>RR(t,e),Gl=cn.generate([{fit:["reposition"]},{nofit:["reposition","visibleW","visibleH","isVisible"]}]),LR=(t,e)=>{const{x:o,y:n,right:s,bottom:r}=e,{x:a,y:c,right:i,bottom:l,width:u,height:m}=t,g=a>=o&&a<=s,p=c>=n&&c<=r,h=g&&p,b=i<=s&&i>=o,v=l<=r&&l>=n,f=b&&v,y=Math.min(u,a>=o?s-a:i-o),x=Math.min(m,c>=n?r-c:l-n);return{originInBounds:h,sizeInBounds:f,visibleW:y,visibleH:x}},VR=(t,e)=>{const{x:o,y:n,right:s,bottom:r}=e,{x:a,y:c,width:i,height:l}=t,u=Math.max(o,s-i),m=Math.max(n,r-l),g=un(a,o,u),p=un(c,n,m),h=Math.min(g+i,s)-g,b=Math.min(p+l,r)-p;return ke(g,p,h,b)},HR=(t,e,o)=>{const n=w(e.bottom-o.y),s=w(o.bottom-e.y),r=hF(t,s,s,n),a=w(e.right-o.x),c=w(o.right-e.x);return{maxWidth:fF(t,c,c,a),maxHeight:r}},NR=(t,e,o,n)=>{const s=t.bubble,r=s.offset,a=vF(n,t.restriction,r),c=t.x+r.left,i=t.y+r.top,l=ke(c,i,e,o),{originInBounds:u,sizeInBounds:m,visibleW:g,visibleH:p}=LR(l,a),h=u&&m,b=h?l:VR(l,a),v=b.width>0&&b.height>0,{maxWidth:f,maxHeight:y}=HR(t.direction,b,n),x={rect:b,maxHeight:y,maxWidth:f,direction:t.direction,placement:t.placement,classes:{on:s.classesOn,off:s.classesOff},layout:t.label,testY:i};return h||t.alwaysFit?Gl.fit(x):Gl.nofit(x,g,p,v)},zR=(t,e,o,n,s,r)=>{const a=n.width,c=n.height,i=(u,m,g,p,h)=>{const b=u(o,n,s,t,r),v=NR(b,a,c,r);return v.fold(w(v),(f,y,x,C)=>(h===C?x>p||y>g:!h&&C)?v:Gl.nofit(m,g,p,h))};return Ge(e,(u,m)=>{const g=mo(i,m);return u.fold(w(u),g)},Gl.nofit({rect:o,maxHeight:n.height,maxWidth:n.width,direction:wl(),placement:"southeast",classes:{on:[],off:[]},layout:"none",testY:o.y},-1,-1,!1)).fold(xt,xt)},mS=["top","bottom","right","left"],jl="data-alloy-transition-timer",UR=(t,e)=>pM(t,e.classes),WR=(t,e,o)=>o.exists(n=>{const s=t.mode;return s==="all"?!0:n[s]!==e[s]}),GR=(t,e)=>{const o=n=>parseFloat(n).toFixed(3);return kd(e,(n,s)=>{const r=t[s].map(o),a=n.map(o);return!kA(r,a)}).isSome()},jR=t=>{const e=r=>{const c=to(t,r).split(/\s*,\s*/);return Wt(c,Hi)},o=r=>{if(Et(r)&&/^[\d.]+/.test(r)){const a=parseFloat(r);return Vi(r,"ms")?a:a*1e3}else return 0},n=e("transition-delay"),s=e("transition-duration");return Ge(s,(r,a,c)=>{const i=o(n[c])+o(a);
26return Math.max(r,i)},0)},YR=(t,e)=>{const o=xa(),n=xa();let s;const r=l=>{var u;const m=(u=l.raw.pseudoElement)!==null&&u!==void 0?u:"";return Ft(l.target,t)&&Ni(m)&&le(mS,l.raw.propertyName)},a=l=>{if(Bi(l)||r(l)){o.clear(),n.clear();const u=l==null?void 0:l.raw.type;(Bi(u)||u===Mc())&&(clearTimeout(s),oe(t,jl),gn(t,e.classes))}},c=co(t,D1(),l=>{r(l)&&(c.unbind(),o.set(co(t,Mc(),a)),n.set(co(t,A1(),a)))}),i=jR(t);requestAnimationFrame(()=>{s=setTimeout(a,i+17),nt(t,jl,s)})},XR=(t,e)=>{Or(t,e.classes),Pe(t,jl).each(o=>{clearTimeout(parseInt(o,10)),oe(t,jl)}),YR(t,e)},KR=(t,e,o,n,s,r)=>{const a=WR(n,s,r);if(a||UR(t,n)){ct(t,"position",o.position);const c=Lg(e,t),i=uS(e,{...s,rect:c}),l=zf(mS,u=>i[u]);GR(o,l)&&(Gi(t,l),a&&XR(t,n),wc(t))}else gn(t,n.classes)},qR=t=>({width:Math.ceil(JD(t)),height:qs(t)}),JR=(t,e,o,n)=>{wt(e,"max-height"),wt(e,"max-width");const s=qR(e);return zR(e,n.preference,t,s,o,n.bounds)},ZR=(t,e)=>{const o=e.classes;gn(t,o.off),Or(t,o.on)},QR=(t,e,o)=>{const n=o.maxHeightFunction;n(t,e.maxHeight)},tP=(t,e,o)=>{const n=o.maxWidthFunction;n(t,e.maxWidth)},eP=(t,e,o)=>{const n=uS(o.origin,e);o.transition.each(s=>{KR(t,o.origin,n,s,e,o.lastPlacement)}),Fx(t,n)},oP=(t,e)=>{SF(t,e.placement)},gS=(t,e,o)=>t[e]===void 0?o:t[e],nP=(t,e,o,n,s,r,a,c)=>{const i=gS(a,"maxHeightFunction",Cy()),l=gS(a,"maxWidthFunction",$),u=t.anchorBox,m=t.origin,g={bounds:FR(m,r),origin:m,preference:n,maxHeightFunction:i,maxWidthFunction:l,lastPlacement:s,transition:c};return sP(u,e,o,g)},sP=(t,e,o,n)=>{const s=JR(t,e,o,n);return eP(e,s,n),oP(e,s),ZR(e,s),QR(e,s,n),tP(e,s,n),{layout:s.layout,placement:s.placement}},Yl=xt,ar=()=>Oo("layouts",[A("onLtr"),A("onRtl"),Tt("onBottomLtr"),Tt("onBottomRtl")]),Xl=(t,e,o,n,s,r,a)=>{const c=a.map(OF).getOr(!1),i=e.layouts.map(p=>p.onLtr(t)),l=e.layouts.map(p=>p.onRtl(t)),u=c?e.layouts.bind(p=>p.onBottomLtr.map(h=>h(t))).or(i).getOr(s):i.getOr(o),m=c?e.layouts.bind(p=>p.onBottomRtl.map(h=>h(t))).or(l).getOr(r):l.getOr(n);return qd(u,m)(t)},rP=(t,e,o)=>{const n=e.hotspot,s=Lg(o,n.element),r=Xl(t.element,e,Gm(),jm(),hy(),fy(),d.some(e.hotspot.element));return d.some(Yl({anchorBox:s,bubble:e.bubble.getOr(Sl()),overrides:e.overrides,layouts:r}))};var aP=[A("hotspot"),Tt("bubble"),T("overrides",{}),ar(),Gt("placement",rP)];const cP=(t,e,o)=>{const n=dS(o,e.x,e.y),s=ke(n.left,n.top,e.width,e.height),r=Xl(t.element,e,gy(),py(),gy(),py(),d.none());return d.some(Yl({anchorBox:s,bubble:e.bubble,overrides:e.overrides,layouts:r}))};var iP=[A("x"),A("y"),T("height",0),T("width",0),T("bubble",Sl()),T("overrides",{}),ar(),Gt("placement",cP)];const pS=cn.generate([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),lP=t=>t.fold(xt,(e,o,n)=>e.translate(-o,-n)),uP=t=>t.fold(xt,xt),hS=t=>Ge(t,(e,o)=>e.translate(o.left,o.top),Zt(0,0)),dP=t=>{const e=L(t,lP);return hS(e)},fS=t=>{const e=L(t,uP);return hS(e)},mP=pS.screen,gP=pS.absolute,pP=(t,e,o)=>{const n=yc(o.root).dom,s=r=>{const a=Pn(r),c=Pn(t.element);return Ft(a,c)};return d.from(n.frameElement).map(I.fromDom).filter(s).map(mn)},bS=(t,e,o)=>{const n=Pn(t.element),s=Ro(n),r=pP(t,e,o).getOr(s);return gP(r,s.left,s.top)},Vg=(t,e,o,n)=>{const s=mP(Zt(t,e));return d.some(NM(s,o,n))},vS=(t,e,o,n,s)=>t.map(r=>{const a=[e,r.point],c=$R(n,()=>fS(a),()=>fS(a),()=>dP(a)),i=zM(c.left,c.top,r.width,r.height),l=o.showAbove?hy():Gm(),u=o.showAbove?fy():jm(),m=Xl(s,o,l,u,l,u,d.none());return Yl({anchorBox:i,bubble:o.bubble.getOr(Sl()),overrides:o.overrides,layouts:m})}),hP=(t,e,o)=>{const n=bS(t,o,e);return e.node.filter(Jo).bind(s=>{const r=s.dom.getBoundingClientRect(),a=Vg(r.left,r.top,r.width,r.height),c=e.node.getOr(t.element);return vS(a,n,e,o,c)})};var fP=[A("node"),A("root"),Tt("bubble"),ar(),T("overrides",{}),T("showAbove",!1),Gt("placement",hP)];const Kl=(t,e)=>({element:t,offset:e}),bP=(t,e)=>{const o=Vn(t);if(o.length===0)return Kl(t,e);if(e<o.length)return Kl(o[e],0);{const n=o[o.length-1],s=Tr(n)?eM(n).length:Vn(n).length;return Kl(n,s)}},yS=(t,e)=>Tr(t)?Kl(t,e):bP(t,e),Hg=t=>t.foffset!==void 0,xS=(t,e)=>e.getSelection.getOrThunk(()=>()=>FM(t))().map(n=>{if(Hg(n)){const s=yS(n.start,n.soffset),r=yS(n.finish,n.foffset);return _c.range(s.element,s.offset,r.element,r.offset)}else return n}),vP=(t,e,o)=>{const n=yc(e.root).dom,s=bS(t,o,e),r=xS(n,e).bind(i=>{if(Hg(i))return $M(n,_c.exactFromRange(i)).orThunk(()=>{const u=I.fromText(zA);xc(i.start,u);const m=hv(n,_c.exact(u,0,u,1));return rs(u),m}).bind(u=>Vg(u.left,u.top,u.width,u.height));{const l=we(i,m=>m.dom.getBoundingClientRect()),u={left:Math.min(l.firstCell.left,l.lastCell.left),right:Math.max(l.firstCell.right,l.lastCell.right),top:Math.min(l.firstCell.top,l.lastCell.top),bottom:Math.max(l.firstCell.bottom,l.lastCell.bottom)};return Vg(u.left,u.top,u.right-u.left,u.bottom-u.top)}}),c=xS(n,e).bind(i=>Hg(i)?Bo(i.start)?d.some(i.start):ws(i.start):d.some(i.firstCell)).getOr(t.element);return vS(r,s,e,o,c)};var yP=[Tt("getSelection"),A("root"),Tt("bubble"),ar(),T("overrides",{}),T("showAbove",!1),Gt("placement",vP)];const ql="link-layout",SS=t=>t.x+t.width,wS=(t,e)=>t.x-e.width,TS=(t,e)=>
26t.y-e.height+t.height,CS=t=>t.y,_S=(t,e,o)=>Ne(SS(t),CS(t),o.southeast(),wl(),"southeast",ze(t,{left:0,top:2}),ql),OS=(t,e,o)=>Ne(wS(t,e),CS(t),o.southwest(),Lm(),"southwest",ze(t,{right:1,top:2}),ql),ES=(t,e,o)=>Ne(SS(t),TS(t,e),o.northeast(),Vm(),"northeast",ze(t,{left:0,bottom:3}),ql),kS=(t,e,o)=>Ne(wS(t,e),TS(t,e),o.northwest(),Hm(),"northwest",ze(t,{right:1,bottom:3}),ql),AS=()=>[_S,OS,ES,kS],DS=()=>[OS,_S,kS,ES],xP=(t,e,o)=>{const n=Lg(o,e.item.element),s=Xl(t.element,e,AS(),DS(),AS(),DS(),d.none());return d.some(Yl({anchorBox:n,bubble:Sl(),overrides:e.overrides,layouts:s}))};var SP=[A("item"),ar(),T("overrides",{}),Gt("placement",xP)],wP=fo("type",{selection:yP,node:fP,hotspot:aP,submenu:SP,makeshift:iP});const TP=[_o("classes",ue),zn("mode","all",["all","layout","placement"])],CP=[T("useFixed",Pt),Tt("getBounds")],_P=[Lo("anchor",wP),Oo("transition",TP)],OP=()=>{const t=document.documentElement;return BR(0,0,t.clientWidth,t.clientHeight)},EP=t=>{const e=mn(t.element),o=t.element.dom.getBoundingClientRect();return IR(e.left,e.top,o.width,o.height)},kP=(t,e,o,n,s,r)=>{const a=PR(e.anchorBox,t);return nP(a,n.element,e.bubble,e.layouts,s,o,e.overrides,r)},AP=(t,e,o,n,s)=>{const r=d.none();MS(t,e,o,n,s,r)},MS=(t,e,o,n,s,r)=>{const a=ho("placement.info",J(_P),s),c=a.anchor,i=n.element,l=o.get(n.uid);pg(()=>{ct(i,"position","fixed");const u=Le(i,"visibility");ct(i,"visibility","hidden");const m=e.useFixed()?OP():EP(t);c.placement(t,c,m).each(g=>{const p=r.orThunk(()=>e.getBounds.map(Td)),h=kP(m,g,p,n,l,a.transition);o.set(n.uid,h)}),u.fold(()=>{wt(i,"visibility")},g=>{ct(i,"visibility",g)}),Le(i,"left").isNone()&&Le(i,"top").isNone()&&Le(i,"right").isNone()&&Le(i,"bottom").isNone()&&Bn(Le(i,"position"),"fixed")&&wt(i,"position")},i)};var DP=Object.freeze({__proto__:null,position:AP,positionWithinBounds:MS,getMode:(t,e,o)=>e.useFixed()?"fixed":"absolute",reset:(t,e,o,n)=>{const s=n.element;q(["position","left","right","top","bottom"],r=>wt(s,r)),wF(s),o.clear(n.uid)}}),MP=Object.freeze({__proto__:null,init:()=>{let t={};return No({readState:()=>t,clear:s=>{$e(s)?delete t[s]:t={}},set:(s,r)=>{t[s]=r},get:s=>tt(t,s)})}});const Ke=De({fields:CP,name:"positioning",active:MR,apis:DP,state:MP}),FP=(t,e)=>e.universal?t:Wt(t,o=>le(e.channels,o));var $P=Object.freeze({__proto__:null,events:t=>Ht([E(Fr(),(e,o)=>{const n=t.channels,s=xe(n),r=o,a=FP(s,r);q(a,c=>{const i=n[c],l=i.schema,u=ho("channel["+c+`] data
27Receiver: `+Qs(e.element),l,r.data);i.onReceive(e,u)})})])}),IP=[Lo("channels",Av(mt.value,Po([Br("onReceive"),T("schema",pn())])))];const Ao=De({fields:IP,name:"receiving",active:$P});var BP=Object.freeze({__proto__:null,events:(t,e)=>{const o=(n,s)=>{t.updateState.each(r=>{const a=r(n,s);e.set(a)}),t.renderComponents.each(r=>{const a=r(s,e.get());(t.reuseDom?Cx:Tx)(n,a)})};return Ht([E(Fr(),(n,s)=>{const r=s;if(!r.universal){const a=t.channel;le(r.channels,a)&&o(n,r.data)}}),Vt((n,s)=>{t.initialData.each(r=>{o(n,r)})})])}}),RP=Object.freeze({__proto__:null,getState:(t,e,o)=>o}),PP=[A("channel"),Tt("renderComponents"),Tt("updateState"),Tt("initialData"),je("reuseDom",!0)],LP=Object.freeze({__proto__:null,init:()=>{const t=X(d.none()),e=()=>t.set(d.none());return{readState:()=>t.get().getOr("none"),get:t.get,set:t.set,clear:e}}});const Do=De({fields:PP,name:"reflecting",active:BP,apis:RP,state:LP}),FS=(t,e,o,n)=>{o.get().each(a=>{vx(t)});const s=e.getAttachPoint(t);Hr(s,t);const r=t.getSystem().build(n);return Hr(t,r),o.set(r),r},$S=(t,e,o,n)=>{const s=FS(t,e,o,n);return e.onOpen(t,s),s},VP=(t,e,o,n)=>o.get().map(()=>FS(t,e,o,n)),HP=(t,e,o,n,s)=>{RS(t,e),$S(t,e,o,n),s(),PS(t,e)},IS=(t,e,o)=>{o.get().each(n=>{vx(t),Ms(t),e.onClose(t,n),o.clear()})},BS=(t,e,o)=>o.isOpen(),NP=(t,e,o,n)=>BS(t,e,o)&&o.get().exists(s=>e.isPartOf(t,s,n)),zP=(t,e,o)=>o.get(),UP=(t,e,o,n)=>{Le(t.element,e).fold(()=>{oe(t.element,o)},s=>{nt(t.element,o,s)}),ct(t.element,e,n)},WP=(t,e,o)=>{Pe(t.element,o).fold(()=>wt(t.element,e),n=>ct(t.element,e,n))},RS=(t,e,o)=>{const n=e.getAttachPoint(t);ct(t.element,"position",Ke.getMode(n)),UP(t,"visibility",e.cloakVisibilityAttr,"hidden")},GP=t=>Ko(["top","left","right","bottom"],e=>Le(t,e).isSome()),PS=(t,e,o)=>{GP(t.element)||wt(t.element,"position"),WP(t,"visibility",e.cloakVisibilityAttr)};var jP=Object.freeze({__proto__:null,cloak:RS,decloak:PS,open:$S,openWhileCloaked:HP,close:IS,isOpen:BS,isPartOf:NP,getState:zP,setContent:VP}),YP=Object.freeze({__proto__:null,events:(t,e)=>Ht([E(il(),(o,n)=>{IS(o,t,e)})])}),XP=[bt("onOpen"),bt("onClose"),A("isPartOf"),A("getAttachPoint"),T("cloakVisibilityAttr","data-precloak-visibility")],KP=Object.freeze({__proto__:null,init:()=>{const t=Rt(),e=w("not-implemented");
vendor: 1,795 bytes, line 27
27return No({readState:e,isOpen:t.isSet,clear:t.clear,set:t.set,get:t.get})}});const vt=De({fields:XP,name:"sandboxing",active:YP,apis:jP,state:KP}),jc=(t,e)=>e.getAnimationRoot.fold(()=>t.element,o=>o(t)),$s=t=>t.dimension.property,Wr=(t,e)=>t.dimension.getDimension(e),Jl=(t,e)=>{const o=jc(t,e);gn(o,[e.shrinkingClass,e.growingClass])},Ng=(t,e)=>{Qt(t.element,e.openClass),ne(t.element,e.closedClass),ct(t.element,$s(e),"0px"),wc(t.element)},zg=(t,e)=>{Qt(t.element,e.closedClass),ne(t.element,e.openClass),wt(t.element,$s(e))},LS=(t,e,o,n)=>{o.setCollapsed(),ct(t.element,$s(e),Wr(e,t.element)),Jl(t,e),Ng(t,e),e.onStartShrink(t),e.onShrunk(t)},qP=(t,e,o,n)=>{const s=n.getOrThunk(()=>Wr(e,t.element));o.setCollapsed(),ct(t.element,$s(e),s),wc(t.element);const r=jc(t,e);Qt(r,e.growingClass),ne(r,e.shrinkingClass),Ng(t,e),e.onStartShrink(t)},VS=(t,e,o)=>{const n=Wr(e,t.element);(n==="0px"?LS:qP)(t,e,o,d.some(n))},HS=(t,e,o)=>{const n=jc(t,e),s=po(n,e.shrinkingClass),r=Wr(e,t.element);zg(t,e);const a=Wr(e,t.element);(s?()=>{ct(t.element,$s(e),r),wc(t.element)}:()=>{Ng(t,e)})(),Qt(n,e.shrinkingClass),ne(n,e.growingClass),zg(t,e),ct(t.element,$s(e),a),o.setExpanded(),e.onStartGrow(t)},JP=(t,e,o)=>{if(o.isExpanded()){wt(t.element,$s(e));const n=Wr(e,t.element);ct(t.element,$s(e),n)}},ZP=(t,e,o)=>{o.isExpanded()||HS(t,e,o)},QP=(t,e,o)=>{o.isExpanded()&&VS(t,e,o)},tL=(t,e,o)=>{o.isExpanded()&&LS(t,e,o)},eL=(t,e,o)=>o.isExpanded(),oL=(t,e,o)=>o.isCollapsed(),NS=(t,e,o)=>{const n=jc(t,e);return po(n,e.growingClass)===!0},zS=(t,e,o)=>{const n=jc(t,e);return po(n,e.shrinkingClass)===!0};var nL=Object.freeze({__proto__:null,refresh:JP,grow:ZP,shrink:QP,immediateShrink:tL,hasGrown:eL,hasShrunk:oL,isGrowing:NS,isShrinking:zS,isTransitioning:(t,e,o)=>NS(t,e)||zS(t,e),toggleGrow:(t,e,o)=>
27{(o.isExpanded()?VS:HS)(t,e,o)},disableTransitions:Jl,immediateGrow:(t,e,o)=>{o.isExpanded()||(zg(t,e),ct(t.element,$s(e),Wr(e,t.element)),Jl(t,e),o.setExpanded(),e.onStartGrow(t),e.onGrown(t))}}),sL=Object.freeze({__proto__:null,exhibit:(t,e,o)=>{const n=e.expanded;return wn(n?{classes:[e.openClass],styles:{}}:{classes:[e.closedClass],styles:Ar(e.dimension.property,"0px")})},events:(t,e)=>Ht([Ba(Mc(),(o,n)=>{n.event.raw.propertyName===t.dimension.property&&(Jl(o,t),e.isExpanded()&&wt(o.element,t.dimension.property),(e.isExpanded()?t.onGrown:t.onShrunk)(o))})])}),rL=[A("closedClass"),A("openClass"),A("shrinkingClass"),A("growingClass"),Tt("getAnimationRoot"),bt("onShrunk"),bt("onStartShrink"),bt("onGrown"),bt("onStartGrow"),T("expanded",!1),Lo("dimension",fo("property",{width:[Gt("property","width"),Gt("getDimension",t=>Co(t)+"px")],height:[Gt("property","height"),Gt("getDimension",t=>Te(t)+"px")]}))],aL=Object.freeze({__proto__:null,init:t=>{const e=X(t.expanded),o=()=>"expanded: "+e.get();return No({isExpanded:()=>e.get()===!0,isCollapsed:()=>e.get()===!1,setCollapsed:mo(e.set,!1),setExpanded:mo(e.set,!0),readState:o})}});const bo=De({fields:rL,name:"sliding",active:sL,apis:nL,state:aL});var cL=Object.freeze({__proto__:null,events:(t,e)=>{const n=t.stream.streams.setup(t,e);return Ht([E(t.event,n),jn(()=>e.cancel())].concat(t.cancelEvent.map(s=>[E(s,()=>e.cancel())]).getOr([])))}});const US=t=>{const e=X(null);return No({readState:()=>({timer:e.get()!==null?"set":"unset"}),setTimer:r=>{e.set(r)},cancel:()=>{const r=e.get();r!==null&&r.cancel()}})};var iL=Object.freeze({__proto__:null,throttle:US,init:t=>t.stream.streams.state(t)});const lL=(t,e)=>{const o=t.stream,n=$d(t.onStream,o.delay);return e.setTimer(n),(s,r)=>{n.throttle(s,r),o.stopEvent&&r.stop()}};var uL=[Lo("stream",fo("mode",{throttle:[A("delay"),T("stopEvent",!0),Gt("streams",{setup:lL,state:US})]})),T("event","input"),Tt("cancelEvent"),Br("onStream")];const Ug=De({fields:uL,name:"streaming",active:cL,state:iL});var dL=Object.freeze({__proto__:null,exhibit:(t,e)=>wn({attributes:Aa([{key:e.tabAttr,value:"true"}])})}),mL=[T("tabAttr","data-alloy-tabstop")];const Mt=De({fields:mL,name:"tabstopping",active:dL}),gL=(t,e,o)=>{const n=e.aria;n.update(t,n,o.get())},pL=(t,e,o)=>{e.toggleClass.each(n=>{o.get()?ne(t.element,n):Qt(t.element,n)})},Yc=(t,e,o,n)=>{const s=o.get();o.set(n),pL(t,e,o),gL(t,e,o),s!==n&&e.onToggled(t,n)},WS=(t,e,o)=>{Yc(t,e,o,!o.get())},hL=(t,e,o)=>{Yc(t,e,o,!0)},fL=(t,e,o)=>{Yc(t,e,o,!1)},bL=(t,e,o)=>o.get(),GS=(t,e,o)=>{Yc(t,e,o,e.selected)};var vL=Object.freeze({__proto__:null,onLoad:GS,toggle:WS,isOn:bL,on:hL,off:fL,set:Yc}),yL=Object.freeze({__proto__:null,exhibit:()=>wn({}),events:(t,e)=>{const o=VF(t,e,WS),n=sg(t,e,GS);return Ht(Ie([t.toggleOnExecute?[o]:[],[n]]))}});const xL=(t,e,o)=>{nt(t.element,"aria-pressed",o),e.syncWithExpanded&&jS(t,e,o)},SL=(t,e,o)=>{nt(t.element,"aria-selected",o)},wL=(t,e,o)=>{nt(t.element,"aria-checked",o)},jS=(t,e,o)=>{nt(t.element,"aria-expanded",o)};var TL=[T("selected",!1),Tt("toggleClass"),T("toggleOnExecute",!0),bt("onToggled"),Qo("aria",{mode:"none"},fo("mode",{pressed:[T("syncWithExpanded",!1),Gt("update",xL)],checked:[Gt("update",wL)],expanded:[Gt("update",jS)],selected:[Gt("update",SL)],none:[Gt("update",$)]}))];const it=De({fields:TL,name:"toggling",active:yL,apis:vL,state:XF(!1)}),YS=V("tooltip.exclusive"),Xc=V("tooltip.show"),Kc=V("tooltip.hide"),qc=V("tooltip.immediateHide"),Jc=V("tooltip.immediateShow"),XS=(t,e,o)=>{t.getSystem().broadcastOn([YS],{})};var CL=Object.freeze({__proto__:null,hideAllExclusive:XS,immediateOpenClose:(t,e,o,n)=>pt(t,n?Jc:qc),isEnabled:(t,e,o)=>o.isEnabled(),setComponents:(t,e,o,n)=>{o.getTooltip().each(s=>{s.getSystem().isConnected()&&st.set(s,n)})},setEnabled:(t,e,o,n)=>o.setEnabled(n)}),_L=Object.freeze({__proto__:null,events:(t,e)=>{const o=a=>{e.getTooltip().each(c=>{c.getSystem().isConnected()&&(Ms(c),t.onHide(a,c),e.clearTooltip())}),e.clearTimer()},n=a=>{if(!e.isShowing()&&e.isEnabled()){XS(a);const c=t.lazySink(a).getOrDie(),i=a.getSystem().build({dom:t.tooltipDom,components:t.tooltipComponents,events:Ht(t.mode==="normal"?[E(ls(),l=>{pt(a,Xc)}),E(cl(),l=>{pt(a,Kc)})]:[]),behaviours:D([st.config({})])});e.setTooltip(i),Hr(c,i),t.onShow(a,i),Ke.position(c,i,{anchor:t.anchor(a)})}},s=a=>{e.getTooltip().each(c=>{const i=t.lazySink(a).getOrDie();Ke.position(i,c,{anchor:t.anchor(a)})})},r=()=>{switch(t.mode){case"normal":return[E(vn(),a=>{pt(a,Jc)}),E(Fc(),a=>{pt(a,qc)}),E(ls(),a=>{pt(a,Xc)}),E(cl(),a=>{pt(a,Kc)})];case"follow-highlight":return[E(vm(),(a,c)=>{pt(a,Xc)}),E(ym(),a=>{pt(a,Kc)})];case"children-normal":return[E(vn(),(a,c)=>{Qe(a.element).each(i=>{Sa(c.event.target,"[data-mce-tooltip]")&&e.getTooltip().fold(()=>{pt(a,Jc)},l=>{e.isShowing()&&(t.onShow(a,l),s(a))})})}),E(Fc(),a=>{Qe(a.element).fold(()=>{pt(a,qc)},$)}),E(ls(),a=>{Dt(a.element,"[data-mce-tooltip]:hover").each(c=>{e.getTooltip().fold(()=>{pt(a,Xc)},i=>
vendor: 1,505 bytes, line 27
27{e.isShowing()&&(t.onShow(a,i),s(a))})})}),E(cl(),a=>{Dt(a.element,"[data-mce-tooltip]:hover").fold(()=>{pt(a,Kc)},$)})];default:return[E(vn(),(a,c)=>{Qe(a.element).each(i=>{Sa(c.event.target,"[data-mce-tooltip]")&&e.getTooltip().fold(()=>{pt(a,Jc)},l=>{e.isShowing()&&(t.onShow(a,l),s(a))})})}),E(Fc(),a=>{Qe(a.element).fold(()=>{pt(a,qc)},$)})]}};return Ht(Ie([[Ey(a=>{t.onSetup(a)}),E(Xc,a=>{e.resetTimer(()=>{n(a)},t.delayForShow())}),E(Kc,a=>{e.resetTimer(()=>{o(a)},t.delayForHide())}),E(Jc,a=>{e.resetTimer(()=>{n(a)},0)}),E(qc,a=>{e.resetTimer(()=>{o(a)},0)}),E(Fr(),(a,c)=>{const i=c;i.universal||le(i.channels,YS)&&o(a)}),jn(a=>{o(a)})],r()]))}}),OL=[A("lazySink"),A("tooltipDom"),T("exclusive",!0),T("tooltipComponents",[]),Lt("delayForShow",w(300)),Lt("delayForHide",w(100)),Lt("onSetup",$),zn("mode","normal",["normal","follow-highlight","children-keyboard-focus","children-normal"]),T("anchor",t=>({type:"hotspot",hotspot:t,layouts:{onLtr:w([pe,Ce,me,Ue,ge,We]),onRtl:w([pe,Ce,me,Ue,ge,We])},bubble:xn(0,-2,{})})),bt("onHide"),bt("onShow")],EL=Object.freeze({__proto__:null,init:()=>{const t=X(!0),e=Rt(),o=Rt(),n=()=>{e.on(clearTimeout)},s=(a,c)=>{n(),e.set(setTimeout(a,c))},r=w("not-implemented");return No({getTooltip:o.get,isShowing:o.isSet,setTooltip:o.set,clearTooltip:o.clear,clearTimer:n,resetTimer:s,readState:r,isEnabled:()=>t.get(),setEnabled:a=>t.set(a)})}});const zt=De({fields:OL,name:"tooltipping",active:_L,state:EL,apis:CL});var kL=Object.freeze({__proto__:null,events:()=>
27Ht([Oy(M1(),ve)]),exhibit:()=>wn({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})});const Zc=De({fields:[],name:"unselecting",active:kL}),AL=t=>{const e=t.dom.attributes!==void 0?t.dom.attributes:[];return Ge(e,(o,n)=>n.name==="class"?o:{...o,[n.name]:n.value},{})},DL=t=>Array.prototype.slice.call(t.dom.classList,0),Is=t=>{const e=I.fromHtml(t),o=Vn(e),n=AL(e),s=DL(e),r=o.length===0?{}:{innerHtml:Gd(e)};return{tag:Ss(e),classes:s,attributes:n,...r}},St=t=>{const e=zB(t)&&an(t,"uid")?t.uid:Va("memento");return{get:r=>r.getSystem().getByUid(e).getOrDie(),getOpt:r=>r.getSystem().getByUid(e).toOptional(),asSpec:()=>({...t,uid:e})}},Se=mF,gs=lF,Bs=w("dismiss.popups"),cr=w("reposition.popups"),Wg=w("mouse.released"),ML=(t,e)=>{const o=X(!1),n=X(!1);return{stop:()=>{o.set(!0)},cut:()=>{n.set(!0)},isStopped:o.get,isCut:n.get,event:t,setSource:e.set,getSource:e.get}},FL=t=>{const e=X(!1);return{stop:()=>{e.set(!0)},cut:$,isStopped:e.get,isCut:Pt,event:t,setSource:wd("Cannot set source of a broadcasted event"),getSource:wd("Cannot get source of a broadcasted event")}},$L=t=>t.raw.which===ZF[0]&&!le(["input","textarea"],Ss(t.target))&&!Cc(t.target,'[contenteditable="true"]'),IL=(t,e)=>{const o={stopBackspace:!0,...e},n=["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"],s=q1(o),r=L(n.concat(["selectstart","input","contextmenu","change","transitionend","transitioncancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),p=>co(t,p,h=>{s.fireIfReady(h,p).each(v=>{v&&h.kill()}),o.triggerEvent(p,h)&&h.kill()})),a=Rt(),c=co(t,"paste",p=>{s.fireIfReady(p,"paste").each(b=>{b&&p.kill()}),o.triggerEvent("paste",p)&&p.kill(),a.set(setTimeout(()=>{o.triggerEvent(pm(),p)},0))}),i=co(t,"keydown",p=>{o.triggerEvent("keydown",p)?p.kill():o.stopBackspace&&$L(p)&&p.prevent()}),l=co(t,"focusin",p=>{o.triggerEvent("focusin",p)&&p.kill()}),u=Rt(),m=co(t,"focusout",p=>{o.triggerEvent("focusout",p)&&p.kill(),u.set(setTimeout(()=>{o.triggerEvent(Fc(),p)},0))});return{unbind:()=>{q(r,p=>{p.unbind()}),i.unbind(),l.unbind(),m.unbind(),c.unbind(),a.on(clearTimeout),u.on(clearTimeout)}}},KS=(t,e)=>{const o=tt(t,"target").getOr(e);return X(o)},Qc=cn.generate([{stopped:[]},{resume:["element"]},{complete:[]}]),qS=(t,e,o,n,s,r)=>{const a=t(e,n),c=ML(o,s);return a.fold(()=>(r.logEventNoHandlers(e,n),Qc.complete()),i=>{const l=i.descHandler;return bg(l)(c),c.isStopped()?(r.logEventStopped(e,i.element,l.purpose),Qc.stopped()):c.isCut()?(r.logEventCut(e,i.element,l.purpose),Qc.complete()):Ln(i.element).fold(()=>(r.logNoParent(e,i.element,l.purpose),Qc.complete()),m=>(r.logEventResponse(e,i.element,l.purpose),Qc.resume(m)))})},JS=(t,e,o,n,s,r)=>qS(t,e,o,n,s,r).fold(ve,a=>JS(t,e,o,a,s,r),Pt),BL=(t,e,o,n,s)=>{const r=KS(o,n);return qS(t,e,o,n,r,s)},RL=(t,e,o)=>{const n=FL(e);return q(t,s=>{const r=s.descHandler;bg(r)(n)}),n.isStopped()},PL=(t,e,o,n)=>ZS(t,e,o,o.target,n),ZS=(t,e,o,n,s)=>{const r=KS(o,n);return JS(t,e,o,n,r,s)},LL=(t,e)=>({element:t,descHandler:e}),VL=(t,e)=>({id:t,descHandler:e}),HL=()=>{const t={},e=(a,c,i)=>{Ze(i,(l,u)=>{const m=t[u]!==void 0?t[u]:{};m[c]=lI(l,a),t[u]=m})},o=(a,c)=>Gc(c).bind(i=>tt(a,i)).map(i=>LL(c,i));return{registerId:e,unregisterId:a=>{Ze(t,(c,i)=>{At(c,a)&&delete c[a]})},filterByType:a=>tt(t,a).map(c=>Li(c,(i,l)=>VL(l,i))).getOr([]),find:(a,c,i)=>tt(t,c).bind(l=>Ki(i,u=>o(l,u),a))}},NL=()=>{const t=HL(),e={},o=l=>{const u=l.element;return Gc(u).getOrThunk(()=>Q0("uid-",l.element))},n=(l,u)=>{const m=e[u];if(m===l)r(l);else throw new Error('The tagId "'+u+'" is already used by: '+Qs(m.element)+`
28Cannot use it for: `+Qs(l.element)+`
29The conflicting element is`+(Jo(m.element)?" ":" not ")+"already in the DOM")},s=l=>{const u=o(l);an(e,u)&&n(l,u);const m=[l];t.registerId(m,u,l.events),e[u]=l},r=l=>{Gc(l.element).each(u=>{delete e[u],t.unregisterId(u)})};return{find:(l,u,m)=>t.find(l,u,m),filter:l=>t.filterByType(l),register:s,unregister:r,getById:l=>tt(e,l)}},Gg=t=>{const e=f=>Ln(t.element).fold(ve,y=>Ft(f,y)),o=NL(),n=(f,y)=>o.find(e,f,y),s=IL(t.element,{triggerEvent:(f,y)=>wm(f,y.target,x=>PL(n,f,y,x))}),r={debugInfo:w("real"),triggerEvent:(f,y,x)=>{wm(f,y,C=>ZS(n,f,x,y,C))},triggerFocus:(f,y)=>{Gc(f).fold(()=>{Re(f)},x=>{wm(Zs(),f,C=>(BL(n,Zs(),{originator:y,kill:$,prevent:$,target:f},f,C),!1))})},triggerEscape:(f,y)=>{r.triggerEvent("keydown",f.element,y.event)},getByUid:f=>b(f),getByDom:f=>v(f),build:Xe,buildOrPatch:vg,addToGui:f=>{i(f)},removeFromGui:f=>{l(f)},addToWorld:f=>{a(f)},removeFromWorld:f=>{c(f)},broadcast:f=>{g(f)},broadcastOn:(f,y)=>{p(f,y)},broadcastEvent:(f,y)=>{h(f,y)},isConnected:ve},a=f=>{f.connect(r),Tr(f.element)||(o.register(f),q(f.components(),a),r.triggerEvent(ll(),f.element,{target:f.element}))},c=f=>{Tr(f.element)||(q(f.components(),c),o.unregister(f)),f.disconnect()},i=f=>{Hr(t,f)},l=f=>{Ms(f)},u=()=>{s.unbind(),rs(t.element)},m=f=>{const y=o.filter(Fr());q(y,x=>{const C=x.descHandler;bg(C)(f)})},g=f=>{m({universal:!0,data:f})},p=(f,y)=>{m({universal:!1,channels:f,data:y})},h=(f,y)=>{const x=o.filter(f);return RL(x,y)},b=f=>o.getById(f).fold(()=>mt.error(new Error('Could not find component with uid: "'+f+'" in system.')),mt.value),v=f=>{const y=Gc(f).getOr("not found");return b(y)};return a(t),{root:t,element:t.element,destroy:u,add:i,remove:l,getByUid:b,getByDom:v,addToWorld:a,removeFromWorld:c,broadcast:g,broadcastOn:p,broadcastEvent:h}},QS=()=>{const t=(e,o)=>{o.stop(),Rr(e)};return[E(Mr(),t),E(Ic(),t),Pr(Os()),Pr(Vo())]},Zl=t=>{const e=o=>As((n,s)=>{o(n),s.stop()});return Ht(Ie([t.map(e).toArray(),QS()]))},Fe=Uo({name:"Button",factory:t=>{const e=Zl(t.action),o=t.dom.tag,n=r=>tt(t.dom,"attributes").bind(a=>tt(a,r)),s=()=>
29{if(o==="button"){const r=n("type").getOr("button"),a=n("role").map(c=>({role:c})).getOr({});return{type:r,...a}}else return{role:t.role.getOr(n("role").getOr("button"))}};return{uid:t.uid,dom:t.dom,components:t.components,events:e,behaviours:Cn.augment(t.buttonBehaviours,[Z.config({}),U.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:s()},eventOrder:t.eventOrder}},configFields:[T("uid",void 0),A("dom"),T("components",[]),Cn.field("buttonBehaviours",[Z,U]),Tt("action"),Tt("role"),T("eventOrder",{})]}),zL=w([T("shell",!1),A("makeItem"),T("setupItem",$),Cn.field("listBehaviours",[st])]),UL=tn({name:"items",overrides:()=>({behaviours:D([st.config({})])})}),WL=w([UL]),GL=w("CustomList"),jL=(t,e,o,n)=>{const s=(c,i)=>{a(c).fold(()=>{throw console.error("Custom List was defined to not be a shell, but no item container was specified in components"),new Error("Custom List was defined to not be a shell, but no item container was specified in components")},l=>{const u=st.contents(l),m=i.length,g=m-u.length,p=g>0?Cd(g,()=>t.makeItem()):[],h=u.slice(m);q(h,v=>st.remove(l,v)),q(p,v=>st.append(l,v));const b=st.contents(l);q(b,(v,f)=>{t.setupItem(c,v,i[f],f)})})},r=t.shell?{behaviours:[st.config({})],components:[]}:{behaviours:[],components:e},a=c=>t.shell?d.some(c):$t(c,t,"items");return{uid:t.uid,dom:t.dom,components:r.components,behaviours:Me(t.listBehaviours,r.behaviours),apis:{setItems:s}}},tw=oo({name:GL(),configFields:zL(),partFields:WL(),factory:jL,apis:{setItems:(t,e,o)=>{t.setItems(e,o)}}}),ti="aria-controls",YL=t=>sv(t,o=>{if(!Bo(o))return!1;const n=Ee(o,"id");return n!==void 0&&n.indexOf(ti)>-1}).bind(o=>{const n=Ee(o,"id"),s=ao(o);return Dt(s,`[${ti}="${n}"]`)}),ew=()=>{const t=V(ti);return{id:t,link:n=>{nt(n,ti,t)},unlink:n=>{oe(n,ti)}}},XL=(t,e)=>YL(e).exists(o=>Gr(t,o)),Gr=(t,e)=>dv(e,o=>Ft(o,t.element),Pt)||XL(t,e),ow="alloy.item-hover",nw="alloy.item-focus",sw="alloy.item-toggled",rw=t=>{(Qe(t.element).isNone()||Z.isFocused(t))&&(Z.isFocused(t)||Z.focus(t),Y(t,ow,{item:t}))},aw=t=>{Y(t,nw,{item:t})},KL=(t,e)=>{Y(t,sw,{item:t,state:e})},cw=w(ow),qL=w(nw),JL=w(sw),ZL=t=>t.role.fold(()=>t.toggling.map(e=>e.exclusive?"menuitemradio":"menuitemcheckbox").getOr("menuitem"),xt),QL=(t,e)=>({aria:{mode:e?"selected":"checked"},...jf(t,(o,n)=>n!=="exclusive"),onToggled:(o,n)=>{Xo(t.onToggled)&&t.onToggled(o,n),KL(o,n)}}),tV=t=>({dom:t.dom,domModification:{...t.domModification,attributes:{role:ZL(t),...t.domModification.attributes,"aria-haspopup":t.hasSubmenu,...t.hasSubmenu?{"aria-expanded":!1}:{}}},behaviours:Cn.augment(t.itemBehaviours,[t.toggling.fold(it.revoke,e=>it.config(QL(e,t.role.exists(o=>o==="option")))),Z.config({ignore:t.ignoreFocus,stopMousedown:t.ignoreFocus,onFocus:e=>{aw(e)}}),U.config({mode:"execution"}),P.config({store:{mode:"memory",initialValue:t.data}}),et("item-type-events",[...QS(),E(ls(),rw),E($c(),Z.focus)])]),components:t.components,eventOrder:t.eventOrder});var eV=[A("data"),A("components"),A("dom"),T("hasSubmenu",!1),Tt("toggling"),Tt("role"),Cn.field("itemBehaviours",[it,Z,U,P]),T("ignoreFocus",!1),T("domModification",{}),Gt("builder",tV),T("eventOrder",{})];const oV=t=>({dom:t.dom,components:t.components,events:Ht([PF($c())])});var nV=[A("dom"),A("components"),Gt("builder",oV)];const jg=w("item-widget"),Yg=w([Ye({name:"widget",overrides:t=>({behaviours:D([P.config({store:{mode:"manual",getValue:e=>t.data,setValue:$}})])})})]),sV=t=>{const e=Im(jg(),t,Yg()),o=Bm(jg(),t,e.internals()),n=r=>$t(r,t,"widget").map(a=>(U.focusIn(a),a)),s=(r,a)=>Pa(a.event.target)?d.none():(t.autofocus&&a.setSource(r.element),d.none());return{dom:t.dom,components:o,domModification:t.domModification,events:Ht([As((r,a)=>{n(r).each(c=>{a.stop()})}),E(ls(),rw),E($c(),(r,a)=>{t.autofocus?n(r):Z.focus(r)})]),behaviours:Cn.augment(t.widgetBehaviours,[P.config({store:{mode:"memory",initialValue:t.data}}),Z.config({ignore:t.ignoreFocus,onFocus:r=>{aw(r)}}),U.config({mode:"special",focusIn:t.autofocus?r=>{n(r)}:jF(),onLeft:s,onRight:s,onEscape:(r,a)=>!Z.isFocused(r)&&!t.autofocus?(Z.focus(r),d.some(!0)):(t.autofocus&&a.setSource(r.element),d.none())})])}};var rV=[A("uid"),A("data"),A("components"),A("dom"),T("autofocus",!1),T("ignoreFocus",!1),Cn.field("widgetBehaviours",[P,Z,U]),T("domModification",{}
29),Pm(Yg()),Gt("builder",sV)];const aV=fo("type",{widget:rV,item:eV,separator:nV}),cV=(t,e)=>({mode:"flatgrid",selector:"."+t.markers.item,initSize:{numColumns:e.initSize.numColumns,numRows:e.initSize.numRows},focusManager:t.focusManager}),iV=(t,e)=>({mode:"matrix",selectors:{row:e.rowSelector,cell:"."+t.markers.item},previousSelector:e.previousSelector,focusManager:t.focusManager}),lV=(t,e)=>({mode:"menu",selector:"."+t.markers.item,moveOnTab:e.moveOnTab,focusManager:t.focusManager}),uV=w([xl({factory:{sketch:t=>{const e=ho("menu.spec item",aV,t);return e.builder(e)}},name:"items",unit:"item",defaults:(t,e)=>At(e,"uid")?e:{...e,uid:Va("item")},overrides:(t,e)=>({type:e.type,ignoreFocus:t.fakeFocus,domModification:{classes:[t.markers.item]}})})]),dV=w([ae("role"),A("value"),A("items"),A("dom"),A("components"),T("eventOrder",{}),_e("menuBehaviours",[Ct,P,ht,U]),Qo("movement",{mode:"menu",moveOnTab:!0},fo("mode",{grid:[Uv(),Gt("config",cV)],matrix:[Gt("config",iV),A("rowSelector"),T("previousSelector",d.none)],menu:[T("moveOnTab",!0),Gt("config",lV)]})),G1(),T("fakeFocus",!1),T("focusManager",ag()),bt("onHighlight"),bt("onDehighlight"),T("showMenuRole",!0)]),iw=w("alloy.menu-focus"),mV=(t,e)=>{const o=io(t.element,'[role="menuitemradio"][aria-checked="true"]');q(o,n=>{Ft(n,e.element)||t.getSystem().getByDom(n).each(s=>{it.off(s)})})},gV=(t,e,o,n)=>({uid:t.uid,dom:t.dom,markers:t.markers,behaviours:Me(t.menuBehaviours,[Ct.config({highlightClass:t.markers.selectedItem,itemClass:t.markers.item,onHighlight:t.onHighlight,onDehighlight:t.onDehighlight}),P.config({store:{mode:"memory",initialValue:t.value}}),ht.config({find:d.some}),U.config(t.movement.config(t,t.movement))]),events:Ht([E(qL(),(s,r)=>{const a=r.event;s.getSystem().getByDom(a.target).each(c=>{Ct.highlight(s,c),r.stop(),Y(s,iw(),{menu:s,item:c})})}),E(cw(),(s,r)=>{const a=r.event.item;Ct.highlight(s,a)}),E(JL(),(s,r)=>{const{item:a,state:c}=r.event;c&&Ee(a.element,"role")==="menuitemradio"&&mV(s,a)})]),components:e,eventOrder:t.eventOrder,...t.showMenuRole?{domModification:{attributes:{role:t.role.getOr("menu")}}}:{}}),Rs=oo({name:"Menu",configFields:dV(),partFields:uV(),factory:gV}),pV=t=>Wf(t,(e,o)=>({k:e,v:o})),lw=(t,e,o,n)=>tt(o,n).bind(s=>tt(t,s).bind(r=>{const a=lw(t,e,o,r);return d.some([r].concat(a))})).getOr([]),hV=(t,e)=>{const o={};Ze(t,(a,c)=>{q(a,i=>{o[i]=c})});const n=e,s=pV(e),r=we(s,(a,c)=>[c].concat(lw(o,n,s,c)));return we(o,a=>tt(r,a).getOr([a]))},fV=()=>{const t=X({}),e=X({}),o=X({}),n=Rt(),s=X({}),r=()=>{t.set({}),e.set({}),o.set({}),n.clear()},a=()=>n.get().isNone(),c=(O,F)=>{e.set({...e.get(),[O]:{type:"prepared",menu:F}})},i=(O,F,R,S)=>{n.set(O),t.set(R),e.set(F),s.set(S);const B=hV(S,R);o.set(B)},l=O=>kd(t.get(),(F,R)=>F===O),u=(O,F,R)=>b(O).bind(S=>l(O).bind(B=>F(B).map(G=>({triggeredMenu:S,triggeringItem:G,triggeringPath:R})))),m=(O,F)=>{const R=Wt(f(O).toArray(),S=>b(S).isSome());return tt(o.get(),O).bind(S=>{const B=hc(R.concat(S)),G=ye(B,(N,lt)=>u(N,F,B.slice(0,lt+1)).fold(()=>Bn(n.get(),N)?[]:[d.none()],Q=>[d.some(Q)]));return AA(G)})},g=O=>tt(t.get(),O).map(F=>{const R=tt(o.get(),O).getOr([]);return[F].concat(R)}),p=O=>tt(o.get(),O).bind(F=>F.length>1?d.some(F.slice(1)):d.none()),h=O=>tt(o.get(),O),b=O=>v(O).bind(uw),v=O=>tt(e.get(),O),f=O=>tt(t.get(),O);return{setMenuBuilt:c,setContents:i,expand:g,refresh:h,collapse:p,lookupMenu:v,lookupItem:f,otherMenus:O=>{const F=s.get();return Sr(xe(F),O)},getPrimary:()=>n.get().bind(b),getMenus:()=>e.get(),clear:r,isClear:a,getTriggeringPath:m}},uw=t=>t.type==="prepared"?d.some(t.menu):d.none(),dw={init:fV,extractPreparedMenu:uw},mw=V("tiered-menu-item-highlight"),gw=V("tiered-menu-item-dehighlight"),bV=(t,e)=>{const o=Rt(),n=(k,M,K)=>we(K,(at,W)=>{const rt=()=>Rs.sketch({...at,value:W,markers:t.markers,fakeFocus:t.fakeFocus,onHighlight:(Ot,_t)=>{Y(Ot,mw,{menuComp:Ot,itemComp:_t})},onDehighlight:(Ot,_t)=>{Y(Ot,gw,{menuComp:Ot,itemComp:_t})},focusManager:t.fakeFocus?b$():ag()});return W===M?{type:"prepared",menu:k.getSystem().build(rt())}:{type:"notbuilt",nbMenu:rt}}),s=dw.init(),r=k=>{const M=n(k,t.data.primary,t.data.menus),K=i();return s.setContents(t.data.primary,M,t.data.expansions,K),s.getPrimary()},a=k=>P.getValue(k).value,c=(k,M,K)=>In(M,at=>{if(!at.getSystem().isConnected())return d.none();const W=Ct.getCandidates(at);return ee(W,rt=>a(rt)===K)}),i=k=>we(t.data.menus,(M,K)=>ye(M.items,at=>at.type==="separator"?[]:[at.data.value])),l=Ct.highlight,u=(k,M)=>{l(k,M),Ct.getHighlighted(M).orThunk(()=>Ct.getFirst(M)).each(K=>{t.fakeFocus?Ct.highlight(M,K):tg(k,K.element,$c())})},m=(k,M)=>wr(L(M,K=>k.lookupMenu(K).bind(at=>at.type==="prepared"?d.some(at.menu):d.none()))),g=(k,M,K)=>{const at=m(M,M.otherMenus(K));q(at,W=>{gn(W.element,[t.markers.backgroundMenu]),t.stayInDom||st.remove(k,W)})},p=k=>o.get().getOrThunk(()=>{const M={},K=io(k.element,`.${t.markers.item}`),at=Wt(K,W=>Ee(W,"aria-haspopup")==="true");return q(at,W=>{k.getSystem().getByDom(W).each(rt=>{const Ot=a(rt);M[Ot]=rt})}),o.set(M),M}),h=(k,M)=>{const K=p(k);Ze(K,(at,W)=>
vendor: 4,921 bytes, line 29
29{const rt=le(M,W);nt(at.element,"aria-expanded",rt)})},b=(k,M,K)=>d.from(K[0]).bind(at=>M.lookupMenu(at).bind(W=>{if(W.type==="notbuilt")return d.none();{const rt=W.menu,Ot=m(M,K.slice(1));return q(Ot,_t=>{ne(_t.element,t.markers.backgroundMenu)}),Jo(rt.element)||st.append(k,zo(rt)),gn(rt.element,[t.markers.backgroundMenu]),u(k,rt),g(k,M,K),d.some(rt)}}));let v;(function(k){k[k.HighlightSubmenu=0]="HighlightSubmenu",k[k.HighlightParent=1]="HighlightParent"})(v||(v={}));const f=(k,M,K)=>{if(K.type==="notbuilt"){const at=k.getSystem().build(K.nbMenu());return s.setMenuBuilt(M,at),at}else return K.menu},y=(k,M,K=v.HighlightSubmenu)=>{if(M.hasConfigured(z)&&z.isDisabled(M))return d.some(M);{const at=a(M);return s.expand(at).bind(W=>(h(k,W),d.from(W[0]).bind(rt=>s.lookupMenu(rt).bind(Ot=>{const _t=f(k,rt,Ot);return Jo(_t.element)||st.append(k,zo(_t)),t.onOpenSubmenu(k,M,_t,hc(W)),K===v.HighlightSubmenu?(Ct.highlightFirst(_t),b(k,s,W)):(Ct.dehighlightAll(_t),d.some(M))}))))}},x=(k,M)=>{const K=a(M);return s.collapse(K).bind(at=>(h(k,at),b(k,s,at).map(W=>(t.onCollapseMenu(k,M,W),W))))},C=(k,M)=>{const K=a(M);return s.refresh(K).bind(at=>(h(k,at),b(k,s,at)))},O=(k,M)=>Pa(M.element)?d.none():y(k,M,v.HighlightSubmenu),F=(k,M)=>Pa(M.element)?d.none():x(k,M),R=(k,M)=>x(k,M).orThunk(()=>t.onEscape(k,M).map(()=>k)),S=k=>(M,K)=>as(K.getSource(),`.${t.markers.item}`).bind(at=>M.getSystem().getByDom(at).toOptional().bind(W=>k(M,W).map(ve))),B=Ht([E(iw(),(k,M)=>{const K=M.event.item;s.lookupItem(a(K)).each(()=>{const at=M.event.menu;Ct.highlight(k,at);const W=a(M.event.item);s.refresh(W).each(rt=>g(k,s,rt))})}),As((k,M)=>{const K=M.event.target;k.getSystem().getByDom(K).each(at=>{a(at).indexOf("collapse-item")===0&&x(k,at),y(k,at,v.HighlightSubmenu).fold(()=>{t.onExecute(k,at)},$)})}),Vt((k,M)=>{r(k).each(K=>{st.append(k,zo(K)),t.onOpenMenu(k,K),t.highlightOnOpen===uo.HighlightMenuAndItem?u(k,K):t.highlightOnOpen===uo.HighlightJustMenu&&l(k,K)})}),E(mw,(k,M)=>{t.onHighlightItem(k,M.event.menuComp,M.event.itemComp)}),E(gw,(k,M)=>{t.onDehighlightItem(k,M.event.menuComp,M.event.itemComp)}),...t.navigateOnHover?[E(cw(),(k,M)=>{const K=M.event.item;C(k,K),y(k,K,v.HighlightParent),t.onHover(k,K)})]:[]]),G=k=>Ct.getHighlighted(k).bind(Ct.getHighlighted),N=k=>{G(k).each(M=>{x(k,M)})},lt=k=>{s.getPrimary().each(M=>{u(k,M)})},Q=k=>d.from(k.components()[0]).filter(M=>Ee(M.element,"role")==="menu"),H={collapseMenu:N,highlightPrimary:lt,repositionMenus:k=>{s.getPrimary().bind(K=>G(k).bind(at=>{const W=a(at),rt=Ad(s.getMenus()),Ot=wr(L(rt,dw.extractPreparedMenu));return s.getTriggeringPath(W,_t=>c(k,Ot,_t))}).map(at=>({primary:K,triggeringPath:at}))).fold(()=>{Q(k).each(K=>{t.onRepositionMenu(k,K,[])})},({primary:K,triggeringPath:at})=>{t.onRepositionMenu(k,K,at)})}};return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:Me(t.tmenuBehaviours,[U.config({mode:"special",onRight:S(O),onLeft:S(F),onEscape:S(R),focusIn:(k,M)=>{s.getPrimary().each(K=>{tg(k,K.element,$c())})}}),Ct.config({highlightClass:t.markers.selectedMenu,itemClass:t.markers.menu}),ht.config({find:k=>Ct.getHighlighted(k)}),st.config({})]),eventOrder:t.eventOrder,apis:H,events:B}},vV=w("collapse-item"),yV=(t,e,o)=>({primary:t,menus:e,expansions:o}),xV=(t,e)=>({primary:t,menus:Ar(t,e),expansions:{}}),SV=t=>({value:V(vV()),meta:{text:t}}),jr=Uo({name:"TieredMenu",configFields:[Cm("onExecute"),Cm("onEscape"),Br("onOpenMenu"),Br("onOpenSubmenu"),bt("onRepositionMenu"),bt("onCollapseMenu"),T("highlightOnOpen",uo.HighlightMenuAndItem),Cs("data",[A("primary"),A("menus"),A("expansions")]),T("fakeFocus",!1),bt("onHighlightItem"),bt("onDehighlightItem"),bt("onHover"),dl(),A("dom"),T("navigateOnHover",!0),T("stayInDom",!1),_e("tmenuBehaviours",[U,Ct,ht,st]),T("eventOrder",{})],apis:{collapseMenu:(t,e)=>{t.collapseMenu(e)},highlightPrimary:(t,e)=>{t.highlightPrimary(e)},repositionMenus:(t,e)=>{t.repositionMenus(e)}},factory:bV,extraApis:{tieredData:yV,singleData:xV,collapseItem:SV}}),pw=w("sink"),hw=w(tn({name:pw(),overrides:w({dom:{tag:"div"},behaviours:D([Ke.config({useFixed:ve})]),events:Ht([Pr(Un()),Pr(Vo()),Pr(Mr())])})})),wV=Po([T("isExtraPart",Pt),Oo("fireEventInstead",[T("event",$r())])]),Xg=t=>{const e=ho("Dismissal",wV,t);return{[Bs()]:{schema:Po([A("target")]),onReceive:(o,n)=>{vt.isOpen(o)&&(vt.isPartOf(o,n.target)||e.isExtraPart(o,n.target)||e.fireEventInstead.fold(()=>vt.close(o),r=>pt(o,r.event)))}}}},TV=Po([Oo("fireEventInstead",[T("event",Pv())]),bn("doReposition")]),Kg=t=>{const e=ho("Reposition",TV,t);return{[cr()]:{onReceive:o=>{vt.isOpen(o)&&e.fireEventInstead.fold(()=>e.doReposition(o),n=>pt(o,n.event))}}}},fw=(t,e)=>{const o=t.getHotspot(e).getOr(e),n="hotspot",s=t.getAnchorOverrides();return t.layouts.fold(()=>({type:n,hotspot:o,overrides:s}),r=>({type:n,hotspot:o,overrides:s,layouts:r}))},CV=(t,e,o)=>{const n=t.fetch;return n(o).map(e)},_V=(t,e,o,n,s,r,a)=>{const c=CV(t,e,n),i=bw(n,t);
29return c.map(l=>l.bind(u=>{const m=u.menus[u.primary];return d.from(m).each(g=>{t.listRole.each(p=>{g.role=p})}),d.from(jr.sketch({...r.menu(),uid:Va(""),data:u,highlightOnOpen:a,onOpenMenu:(g,p)=>{const h=i().getOrDie();Ke.position(h,p,{anchor:o}),vt.decloak(s)},onOpenSubmenu:(g,p,h)=>{const b=i().getOrDie();Ke.position(b,h,{anchor:{type:"submenu",item:p}}),vt.decloak(s)},onRepositionMenu:(g,p,h)=>{const b=i().getOrDie();Ke.position(b,p,{anchor:o}),q(h,v=>{Ke.position(b,v.triggeredMenu,{anchor:{type:"submenu",item:v.triggeringItem}})})},onEscape:()=>(Z.focus(n),vt.close(s),d.some(!0))}))}))},Ql=(t,e,o,n,s,r,a)=>{const c=fw(t,o);return _V(t,e,c,o,n,s,a).map(l=>(l.fold(()=>{vt.isOpen(n)&&vt.close(n)},u=>{vt.cloak(n),vt.open(n,u),r(n)}),n))},OV=(t,e,o,n,s,r,a)=>(vt.close(n),Be.pure(n)),qg=(t,e,o,n,s,r)=>{const a=te.getCoupled(o,"sandbox");return(vt.isOpen(a)?OV:Ql)(t,e,o,a,n,s,r)},EV=(t,e,o)=>{const n=ht.getCurrent(e).getOr(e),s=Co(t.element);o?ct(n.element,"min-width",s+"px"):qD(n.element,s)},bw=(t,e)=>t.getSystem().getByUid(e.uid+"-"+pw()).map(o=>()=>mt.value(o)).getOrThunk(()=>e.lazySink.fold(()=>()=>mt.error(new Error("No internal sink is specified, nor could an external sink be found")),o=>()=>o(t))),vw=t=>{vt.getState(t).each(e=>{jr.repositionMenus(e)})},Jg=(t,e,o)=>{const n=ew(),s=(c,i)=>{const l=fw(t,e);n.link(e.element),t.matchWidth&&EV(l.hotspot,i,t.useMinWidth),t.onOpen(l,c,i),o!==void 0&&o.onOpen!==void 0&&o.onOpen(c,i)},r=(c,i)=>{n.unlink(e.element),a().getOr(i).element.dom.dispatchEvent(new window.FocusEvent("focusout")),o!==void 0&&o.onClose!==void 0&&o.onClose(c,i)},a=bw(e,t);return{dom:{tag:"div",classes:t.sandboxClasses,attributes:{id:n.id}},behaviours:Cn.augment(t.sandboxBehaviours,[P.config({store:{mode:"memory",initialValue:e}}),vt.config({onOpen:s,onClose:r,isPartOf:(c,i,l)=>Gr(i,l)||Gr(e,l),getAttachPoint:()=>a().getOrDie()}),ht.config({find:c=>vt.getState(c).bind(i=>ht.getCurrent(i))}),Ao.config({channels:{...Xg({isExtraPart:Pt}),...Kg({doReposition:vw})}})])}},yw=t=>{const e=te.getCoupled(t,"sandbox");vw(e)},Zg=()=>[T("sandboxClasses",[]),Cn.field("sandboxBehaviours",[ht,Ao,vt,P])],kV=w([A("dom"),A("fetch"),bt("onOpen"),Eo("onExecute"),T("getHotspot",d.some),T("getAnchorOverrides",w({})),ar(),_e("dropdownBehaviours",[it,te,U,Z]),A("toggleClass"),T("eventOrder",{}),Tt("lazySink"),T("matchWidth",!1),T("useMinWidth",!1),Tt("role"),Tt("listRole")].concat(Zg())),AV=w([yn({schema:[dl(),T("fakeFocus",!1)],name:"menu",defaults:t=>({onExecute:t.onExecute})}),hw()]),DV=(t,e,o,n)=>{const s=u=>tt(t.dom,"attributes").bind(m=>tt(m,u)),r=u=>{vt.getState(u).each(m=>{jr.highlightPrimary(m)})},a=(u,m,g)=>qg(t,xt,u,n,m,g),c=u=>{a(u,r,uo.HighlightMenuAndItem).get($)},i={expand:u=>{it.isOn(u)||a(u,$,uo.HighlightNone).get($)},open:u=>{it.isOn(u)||a(u,$,uo.HighlightMenuAndItem).get($)},refetch:u=>te.getExistingCoupled(u,"sandbox").fold(()=>a(u,$,uo.HighlightMenuAndItem).map($),g=>Ql(t,xt,u,g,n,$,uo.HighlightMenuAndItem).map($)),isOpen:it.isOn,close:u=>{it.isOn(u)&&a(u,$,uo.HighlightMenuAndItem).get($)},repositionMenus:u=>{it.isOn(u)&&yw(u)}},l=(u,m)=>(Rr(u),d.some(!0));return{uid:t.uid,dom:t.dom,components:e,behaviours:Me(t.dropdownBehaviours,[it.config({toggleClass:t.toggleClass,aria:{mode:"expanded"}}),te.config({others:{sandbox:u=>Jg(t,u,{onOpen:()=>it.on(u),onClose:()=>it.off(u)})}}),U.config({mode:"special",onSpace:l,onEnter:l,onDown:(u,m)=>{if(Wo.isOpen(u)){const g=te.getCoupled(u,"sandbox");r(g)}else Wo.open(u);return d.some(!0)},onEscape:(u,m)=>Wo.isOpen(u)?(Wo.close(u),d.some(!0)):d.none()}),Z.config({})]),events:Zl(d.some(c)),eventOrder:{...t.eventOrder,[Ho()]:["disabling","toggling","alloy.base.behaviour"]},apis:i,domModification:{attributes:{"aria-haspopup":t.listRole.getOr("true"),...t.role.fold(()=>({}),u=>({role:u})),...t.dom.tag==="button"?{type:s("type").getOr("button")}:{}}}}},Wo=oo({name:"Dropdown",configFields:kV(),partFields:AV(),factory:DV,apis:{open:(t,e)=>t.open(e),refetch:(t,e)=>t.refetch(e),expand:(t,e)=>t.expand(e),close:(t,e)=>t.close(e),isOpen:(t,e)=>t.isOpen(e),repositionMenus:(t,e)=>t.repositionMenus(e)}}),xw="form",MV=[_e("formBehaviours",[P])],Sw=t=>"<alloy.field."+t+">",FV=t=>{const e=(()=>{const r=[];return{field:(c,i)=>(r.push(c),$m(xw,Sw(c),i)),record:w(r)}})(),o=t(e),n=e.record(),s=L(n,r=>Ye({name:r,pname:Sw(r)}));return Dg(xw,MV,s,IV,o)},$V=(t,e)=>t.fold(()=>mt.error(e),mt.value),IV=(t,e)=>({uid:t.uid,dom:t.dom,components:e,behaviours:Me(t.formBehaviours,[P.config({store:{mode:"manual",getValue:o=>{const n=oy(o,t);return we(n,(s,r)=>s().bind(a=>{const c=ht.getCurrent(a);return $V(c,new Error(`Cannot find a current component to extract the value from for form part '${r}': `+Qs(a.element)))}).map(P.getValue))},setValue:(o,n)=>{Ze(n,(s,r)=>{$t(o,t,r).each(a=>{ht.getCurrent(a).each(c=>{P.setValue(c,s)})})})}}})]),apis:{getField:(o,n)=>$t(o,t,n).bind(ht.getCurrent)}}),Na={getField:Bl((t,e,o)=>t.getField(e,o)),sketch:FV},za=w([A("dom"),T("shell",!0),_e("toolbarBehaviours",[st])]),BV=w([tn({name:"groups",overrides:()=>({behaviours:D([st.config({})])})})]),RV=(t,e,o,n)=>{const s=(c,i)=>{r(c).fold(()=>{throw console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")},l=>{st.set(l,i)})},r=c=>t.shell?d.some(c):$t(c,t,"groups"),a=t.shell?{behaviours:[st.config({})],components:[]}:{behaviours:[],components:e};return{uid:t.uid,dom:t.dom,components:a.components,behaviours:Me(t.toolbarBehaviours,a.behaviours),apis:{setGroups:s,refresh:$},domModification:{attributes:{role:"group"}}}},qn=oo({name:"Toolbar",configFields:za(),partFields:BV(),factory:RV,apis:{setGroups:(t,e,o)=>{t.setGroups(e,o)}}}),PV=w([Ir(["toggledClass"]),A("lazySink"),bn("fetch"),is("getBounds"),Oo("fireDismissalEventInstead",[T("event",$r())]),ar(),bt("onToggled")]),LV=w([yn({name:"button",overrides:t=>({dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:D([it.config({toggleClass:t.markers.toggledClass,aria:{mode:"exp
29anded"},toggleOnExecute:!1,onToggled:t.onToggled})])})}),yn({factory:qn,schema:za(),name:"toolbar",overrides:t=>({toolbarBehaviours:D([U.config({mode:"cyclic",onEscape:e=>($t(e,t,"button").each(Z.focus),d.none())})])})})]),tu=Rt(),VV=(t,e)=>{tu.set(!0),Qg(t,e),tu.clear()},Qg=(t,e)=>{const o=te.getCoupled(t,"toolbarSandbox");vt.isOpen(o)?vt.close(o):vt.open(o,e.toolbar())},tp=(t,e,o,n)=>{const s=o.getBounds.map(a=>a()),r=o.lazySink(t).getOrDie();Ke.positionWithinBounds(r,e,{anchor:{type:"hotspot",hotspot:t,layouts:n,overrides:{maxWidthFunction:Zm()}}},s)},ww=(t,e,o,n,s)=>{qn.setGroups(e,s),tp(t,e,o,n),it.on(t)},HV=(t,e,o)=>{const n=ew(),s=(a,c)=>{const i=tu.get().getOr(!1);o.fetch().get(l=>{ww(t,c,o,e.layouts,l),n.link(t.element),i||U.focusIn(c)})},r=()=>{it.off(t),tu.get().getOr(!1)||Z.focus(t),n.unlink(t.element)};return{dom:{tag:"div",attributes:{id:n.id}},behaviours:D([U.config({mode:"special",onEscape:a=>(vt.close(a),d.some(!0))}),vt.config({onOpen:s,onClose:r,isPartOf:(a,c,i)=>Gr(c,i)||Gr(t,i),getAttachPoint:()=>
vendor: 8,506 bytes, line 29
29o.lazySink(t).getOrDie()}),Ao.config({channels:{...Xg({isExtraPart:Pt,...o.fireDismissalEventInstead.map(a=>({fireEventInstead:{event:a.event}})).getOr({})}),...Kg({doReposition:()=>{vt.getState(te.getCoupled(t,"toolbarSandbox")).each(a=>{tp(t,a,o,e.layouts)})}})}})])}},ir=oo({name:"FloatingToolbarButton",factory:(t,e,o,n)=>({...Fe.sketch({...n.button(),action:s=>{Qg(s,n)},buttonBehaviours:Cn.augment({dump:n.button().buttonBehaviours},[te.config({others:{toolbarSandbox:s=>HV(s,o,t)}})])}),apis:{setGroups:(s,r)=>{vt.getState(te.getCoupled(s,"toolbarSandbox")).each(a=>{ww(s,a,t,o.layouts,r)})},reposition:s=>{vt.getState(te.getCoupled(s,"toolbarSandbox")).each(r=>{tp(s,r,t,o.layouts)})},toggle:s=>{Qg(s,n)},toggleWithoutFocusing:s=>{VV(s,n)},getToolbar:s=>vt.getState(te.getCoupled(s,"toolbarSandbox")),isOpen:s=>vt.isOpen(te.getCoupled(s,"toolbarSandbox"))}}),configFields:PV(),partFields:LV(),apis:{setGroups:(t,e,o)=>{t.setGroups(e,o)},reposition:(t,e)=>{t.reposition(e)},toggle:(t,e)=>{t.toggle(e)},toggleWithoutFocusing:(t,e)=>{t.toggleWithoutFocusing(e)},getToolbar:(t,e)=>t.getToolbar(e),isOpen:(t,e)=>t.isOpen(e)}}),NV=w([T("prefix","form-field"),_e("fieldBehaviours",[ht,P])]),zV=w([tn({schema:[A("dom")],name:"label"}),tn({factory:{sketch:t=>({uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}})},schema:[A("text")],name:"aria-descriptor"}),Ye({factory:{sketch:t=>{const e=C1(t,["factory"]);return t.factory.sketch(e)}},schema:[A("factory")],name:"field"})]),UV=(t,e,o,n)=>{const s=Me(t.fieldBehaviours,[ht.config({find:c=>$t(c,t,"field")}),P.config({store:{mode:"manual",getValue:c=>ht.getCurrent(c).bind(P.getValue),setValue:(c,i)=>{ht.getCurrent(c).each(l=>{P.setValue(l,i)})}}})]),r=Ht([Vt((c,i)=>{const l=ey(c,t,["label","field","aria-descriptor"]);l.field().each(u=>{const m=V(t.prefix);l.label().each(g=>{nt(g.element,"for",m),nt(u.element,"id",m)}),l["aria-descriptor"]().each(g=>{const p=V(t.prefix);nt(g.element,"id",p),nt(u.element,"aria-describedby",p)})})})]),a={getField:c=>$t(c,t,"field"),getLabel:c=>$t(c,t,"label")};return{uid:t.uid,dom:t.dom,components:e,behaviours:s,events:r,apis:a}},dt=oo({name:"FormField",configFields:NV(),partFields:zV(),factory:UV,apis:{getField:(t,e)=>t.getField(e),getLabel:(t,e)=>t.getLabel(e)}}),WV=w([T("field1Name","field1"),T("field2Name","field2"),Br("onLockedChange"),Ir(["lockClass"]),T("locked",!1),Cn.field("coupledFieldBehaviours",[ht,P]),Lt("onInput",$)]),GV=(t,e,o)=>$t(t,e,o).bind(ht.getCurrent),Tw=(t,e)=>Ye({factory:dt,name:t,overrides:o=>({fieldBehaviours:D([et("coupled-input-behaviour",[E(Es(),n=>{GV(n,o,e).each(s=>{$t(n,o,"lock").each(r=>{it.isOn(r)&&o.onLockedChange(n,s,r),o.onInput(n)})})})])])})}),jV=w([Tw("field1","field2"),Tw("field2","field1"),Ye({factory:Fe,schema:[A("dom")],name:"lock",overrides:t=>({buttonBehaviours:D([it.config({selected:t.locked,toggleClass:t.markers.lockClass,aria:{mode:"pressed"}})])})})]),YV=(t,e,o,n)=>({uid:t.uid,dom:t.dom,components:e,behaviours:Cn.augment(t.coupledFieldBehaviours,[ht.config({find:d.some}),P.config({store:{mode:"manual",getValue:s=>{const r=Rm(s,t,["field1","field2"]);return{[t.field1Name]:P.getValue(r.field1()),[t.field2Name]:P.getValue(r.field2())}},setValue:(s,r)=>{const a=Rm(s,t,["field1","field2"]);an(r,t.field1Name)&&P.setValue(a.field1(),r[t.field1Name]),an(r,t.field2Name)&&P.setValue(a.field2(),r[t.field2Name])}}})]),apis:{getField1:s=>$t(s,t,"field1"),getField2:s=>$t(s,t,"field2"),getLock:s=>$t(s,t,"lock")}}),se=oo({name:"FormCoupledInputs",configFields:WV(),partFields:jV(),factory:YV,apis:{getField1:(t,e)=>t.getField1(e),getField2:(t,e)=>t.getField2(e),getLock:(t,e)=>t.getLock(e)}}),XV=(t,e)=>{const o=L(t.options,s=>({dom:{tag:"option",value:s.value,innerHtml:s.text}})),n=t.data.map(s=>Ar("initialValue",s)).getOr({});return{uid:t.uid,dom:{tag:"select",classes:t.selectClasses,attributes:t.selectAttributes},components:o,behaviours:Me(t.selectBehaviours,[Z.config({}),P.config({store:{mode:"manual",getValue:s=>Ts(s.element),setValue:(s,r)=>{const a=$n(t.options);ee(t.options,i=>i.value===r).isSome()?Er(s.element,r):s.element.dom.selectedIndex===-1&&r===""&&a.each(i=>Er(s.element,i.value))},...n}})])}},KV=Uo({name:"HtmlSelect",configFields:[A("options"),_e("selectBehaviours",[Z,P]),T("selectClasses",[]),T("selectAttributes",{}),Tt("data")],factory:XV}),qV=(t,e,o,n,s)=>{const r=()=>t.lazySink(e),a=n.type==="horizontal"?{layouts:{onLtr:()=>Gm(),onRtl:()=>jm()}}:{},c=l=>l.length===2,i=l=>c(l)?a:{};return jr.sketch({dom:{tag:"div"},data:n.data,markers:n.menu.markers,highlightOnOpen:n.menu.highlightOnOpen,fakeFocus:n.menu.fakeFocus,onEscape:()=>(vt.close(e),t.onEscape.map(l=>l(e)),d.some(!0)),onExecute:()=>d.some(!0),onOpenMenu:(l,u)=>{Ke.positionWithinBounds(r().getOrDie(),u,o,s())},onOpenSubmenu:(l,u,m,g)=>{const p=r().getOrDie();Ke.position(p,m,{anchor:{type:"submenu",item:u,...i(g)}})},onRepositionMenu:(l,u,m)=>{const g=r().getOrDie();Ke.positionWithinBounds(g,u,o,s()),q(m,p=>{const h=i(p.triggeringPath);Ke.position(g,p.triggeredMenu,{anchor:{type:"submenu",item:p.triggeringItem,...h}})})}})},JV=(t,e)=>{const o=(g,p)=>t.getRelated(g).exists(b=>Gr(b,p)),n=(g,p)=>{vt.setContent(g,p)},s=(g,p,h)=>{const b=d.none;r(g,p,h,b)},r=(g,p,h,b)=>{const v=t.lazySink(g).getOrDie();vt.openWhileCloaked(g,p,()=>Ke.positionWithinBounds(v,g,h,b())),P.setValue(g,d.some({mode:"position",config:h,getBounds:b}))},a=(g,p,h)=>{c(g,p,h,d.none)},c=(g,p,h,b)=>{const v=qV(t,g,p,h,b);vt.open(g,v),P.setValue(g,d.some({mode:"menu",menu:v}))},i=g=>{vt.isOpen(g)&&(P.setValue(g,d.none()),vt.close(g))},l=g=>vt.getState(g),u=g=>{vt.isOpen(g)&&P.getValue(g).each(p=>{switch(p.mode){case"menu":vt.getState(g).each(jr.repositionMenus);break;case"position":const h=t.lazySink(g).getOrDie();Ke.positionWithinBounds(h,g,p.config,p.getBounds());break}})},m={setContent:n,showAt:s,showWithinBounds:r,showMenuAt:a,showMenuWithinBounds:c,hide:i,getContent:l,reposition:u,isOpen:vt.isOpen};return{uid:t.uid,dom:t.dom,behaviours:Me(t.inlineBehaviours,[vt.config({isPartOf:(g,p,h)=>Gr(p,h)||o(g,h),getAttachPoint:g=>t.lazySink(g).getOrDie(),onOpen:g=>{t.onShow(g)},onClose:g=>{t.onHide(g)}}),P.config({store:{mode:"memory",initialValue:d.none()}}),Ao.config({channels:{...Xg({isExtraPart:e.isExtraPart,...t.fireDismissalEventInstead.map(g=>({fireEventInstead:{event:g.event}})).getOr({})}),...Kg({...t.fireRepositionEventInstead.map(g=>({fireEventInstead:{event:g.event}})).getOr({}),doReposition:u})}})]),eventOrder:t.eventOrder,apis:m}},Yt=Uo({name:"InlineView",configFields:[A("lazySink"),bt("onShow"),bt("onHide"),is("onEscape"),_e("inlineBehaviours",[vt,P,Ao]),Oo("fireDismissalEventInstead",[T("event",$r())]),Oo("fireRepositionEventInstead",[T("event",Pv())]),T("getRelated",d.none),T("isExtraPart",Pt),T("eventOrder",d.none)],factory:JV,apis:{showAt:(t,e,o,n)=>{t.showAt(e,o,n)},showWithinBounds:(t,e,o,n,s)=>{t.showWithinBounds(e,o,n,s)},showMenuAt:(t,e,o,n)=>{t.showMenuAt(e,o,n)},showMenuWithinBounds:(t,e,o,n,s)=>{t.showMenuWithinBounds(e,o,n,s)},hide:(t,e)=>{t.hide(e)},isOpen:(t,e)=>t.isOpen(e),getContent:(t,e)=>t.getContent(e),setContent:(t,e,o)=>{t.setContent(e,o)},reposition:(t,e)=>{t.reposition(e)}}}),Cw=w([Kt("type","text"),Tt("data"),T("inputAttributes",{}),T("inputStyles",{}),T("tag","input"),T("inputClasses",[]),bt("onSetValue"),Lt("fromInputValue",xt),Lt("toInputValue",xt),T("styles",{}),T("eventOrder",{}),_e("inputBehaviours",[P,Z]),T("selectOnFocus",!0)]),_w=t=>D([Z.config({onFocus:t.selectOnFocus?e=>{const o=e.element,n=Ts(o);t.type!=="range"&&o.dom.setSelectionRange(0,n.length)}:$})]),ZV=t=>({..._w(t),...Me(t.inputBehaviours,[P.config({store:{mode:"manual",...t.data.map(e=>({initialValue:e})).getOr({}),getValue:e=>t.fromInputValue(Ts(e.element)),setValue:(e,o)=>{Ts(e.element)!==o&&Er(e.element,t.toInputValue(o))}},onSetValue:t.onSetValue})])}),Ow=t=>({tag:t.tag,attributes:{type:t.type,...t.inputAttributes},styles:t.inputStyles,classes:t.inputClasses}),QV=(t,e)=>({uid:t.uid,dom:Ow(t),components:[],behaviours:ZV(t),eventOrder:t.eventOrder}),Ps=Uo({name:"Input",configFields:Cw(),factory:QV}),ep=Fm(jg(),Yg()),tH=(t,e)=>{const o=Pe(t,"id").fold(()=>{const n=V("dialog-label");return nt(e,"id",n),n},xt);nt(t,"aria-labelledby",o)},eH=w([A("lazySink"),Tt("dragBlockClass"),Lt("getBounds",eo),T("useTabstopAt",ve),T("firstTabstop",0),T("eventOrder",{}),_e("modalBehaviours",[U]),Eo("onExecute"),Cm("onEscape")]),op={sketch:xt},oH=w([tn({name:"draghandle",overrides:(t,e)=>
29({behaviours:D([Ur.config({mode:"mouse",getTarget:o=>Hn(o,'[role="dialog"]').getOr(o),blockerClass:t.dragBlockClass.getOrDie(new Error(`The drag blocker class was not specified for a dialog with a drag handle: 
30`+JSON.stringify(e,null,2)).message),getBounds:t.getDragBounds})])})}),Ye({schema:[A("dom")],name:"title"}),Ye({factory:op,schema:[A("dom")],name:"close"}),Ye({factory:op,schema:[A("dom")],name:"body"}),tn({factory:op,schema:[A("dom")],name:"footer"}),yn({factory:{sketch:(t,e)=>({...t,dom:e.dom,components:e.components})},schema:[T("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),T("components",[])],name:"blocker"})]),nH=(t,e,o,n)=>{const s=Rt(),r=h=>{s.set(h);const b=t.lazySink(h).getOrDie(),v=n.blocker(),f=b.getSystem().build({...v,components:v.components.concat([zo(h)]),behaviours:D([Z.config({}),et("dialog-blocker-events",[Ba(vn(),()=>{Xn.isBlocked(h)?$():U.focusIn(h)})])])});Hr(b,f),U.focusIn(h)},a=h=>{s.clear(),Ln(h.element).each(b=>{h.getSystem().getByDom(b).each(v=>{Ms(v)})})},c=h=>er(h,t,"body"),i=h=>$t(h,t,"footer"),l=(h,b)=>{Xn.block(h,b)},u=h=>
30{Xn.unblock(h)},m=V("modal-events"),g={...t.eventOrder,[Wn()]:[m].concat(t.eventOrder["alloy.system.attached"]||[])},p=Rn();return{uid:t.uid,dom:t.dom,components:e,apis:{show:r,hide:a,getBody:c,getFooter:i,setIdle:u,setBusy:l},eventOrder:g,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:Me(t.modalBehaviours,[st.config({}),U.config({mode:"cyclic",onEnter:t.onExecute,onEscape:t.onEscape,useTabstopAt:t.useTabstopAt,firstTabstop:t.firstTabstop}),Xn.config({getRoot:s.get}),et(m,[Vt(h=>{const b=er(h,t,"title").element,v=fM(b);p.os.isMacOS()&&$e(v)?nt(h.element,"aria-label",v):tH(h.element,b)})])])}},he=oo({name:"ModalDialog",configFields:eH(),partFields:oH(),factory:nH,apis:{show:(t,e)=>{t.show(e)},hide:(t,e)=>{t.hide(e)},getBody:(t,e)=>t.getBody(e),getFooter:(t,e)=>t.getFooter(e),setBusy:(t,e,o)=>{t.setBusy(e,o)},setIdle:(t,e)=>{t.setIdle(e)}}}),sH=tn({schema:[A("dom")],name:"label"}),lr=t=>tn({name:""+t+"-edge",overrides:e=>e.model.manager.edgeActions[t].fold(()=>({}),n=>({events:Ht([og(Os(),(s,r,a)=>n(s,a),[e]),og(Vo(),(s,r,a)=>n(s,a),[e]),og(al(),(s,r,a)=>{a.mouseIsDown.get()&&n(s,a)},[e])])}))}),rH=lr("top-left"),aH=lr("top"),cH=lr("top-right"),iH=lr("right"),lH=lr("bottom-right"),uH=lr("bottom"),dH=lr("bottom-left"),mH=lr("left"),gH=Ye({name:"thumb",defaults:w({dom:{styles:{position:"absolute"}}}),overrides:t=>({events:Ht([Ia(Os(),t,"spectrum"),Ia(Dc(),t,"spectrum"),Ia(Dr(),t,"spectrum"),Ia(Vo(),t,"spectrum"),Ia(al(),t,"spectrum"),Ia(gm(),t,"spectrum")])})}),eu=t=>Lr(t.event),pH=Ye({schema:[lo("mouseIsDown",()=>X(!1))],name:"spectrum",overrides:t=>{const o=t.model.manager,n=(s,r)=>o.getValueFromEvent(r).map(a=>o.setValueFrom(s,t,a));return{behaviours:D([U.config({mode:"special",onLeft:(s,r)=>o.onLeft(s,t,eu(r)),onRight:(s,r)=>o.onRight(s,t,eu(r)),onUp:(s,r)=>o.onUp(s,t,eu(r)),onDown:(s,r)=>o.onDown(s,t,eu(r))}),Mt.config({}),Z.config({})]),events:Ht([E(Os(),n),E(Dc(),n),E(Vo(),n),E(al(),(s,r)=>{t.mouseIsDown.get()&&n(s,r)})])}}});var hH=[sH,mH,iH,aH,uH,rH,cH,dH,lH,gH,pH];const ei=w("slider.change.value"),fH=t=>t.type.indexOf("touch")!==-1,np=t=>{const e=t.event.raw;if(fH(e)){const o=e;return o.touches!==void 0&&o.touches.length===1?d.some(o.touches[0]).map(n=>Zt(n.clientX,n.clientY)):d.none()}else{const o=e;return o.clientX!==void 0?d.some(o).map(n=>Zt(n.clientX,n.clientY)):d.none()}},bH="top",vH="right",yH="bottom",xH="left",Yr=t=>t.model.minX,Xr=t=>t.model.minY,ou=t=>t.model.minX-1,nu=t=>t.model.minY-1,Kr=t=>t.model.maxX,qr=t=>t.model.maxY,su=t=>t.model.maxX+1,ru=t=>t.model.maxY+1,Ew=(t,e,o)=>e(t)-o(t),sp=t=>Ew(t,Kr,Yr),rp=t=>Ew(t,qr,Xr),kw=t=>sp(t)/2,Aw=t=>rp(t)/2,Ua=(t,e)=>e?t.stepSize*t.speedMultiplier:t.stepSize,Dw=t=>t.snapToGrid,Mw=t=>t.snapStart,Fw=t=>t.rounded,au=(t,e)=>t[e+"-edge"]!==void 0,$w=t=>au(t,xH),Iw=t=>au(t,vH),Bw=t=>au(t,bH),Rw=t=>au(t,yH),Ls=t=>t.model.value.get(),ur=(t,e)=>({x:t,y:e}),_n=(t,e)=>{Y(t,ei(),{value:e})},SH=(t,e)=>{_n(t,ur(ou(e),nu(e)))},wH=(t,e)=>{_n(t,nu(e))},TH=(t,e)=>{_n(t,ur(kw(e),nu(e)))},CH=(t,e)=>{_n(t,ur(su(e),nu(e)))},_H=(t,e)=>{_n(t,su(e))},OH=(t,e)=>{_n(t,ur(su(e),Aw(e)))},EH=(t,e)=>{_n(t,ur(su(e),ru(e)))},kH=(t,e)=>{_n(t,ru(e))},AH=(t,e)=>{_n(t,ur(kw(e),ru(e)))},DH=(t,e)=>{_n(t,ur(ou(e),ru(e)))},MH=(t,e)=>{_n(t,ou(e))},FH=(t,e)=>{_n(t,ur(ou(e),Aw(e)))},ap=(t,e,o,n)=>t<e?t:t>o?o:t===e?e-1:Math.max(e,t-n),cp=(t,e,o,n)=>t>o?t:t<e?e:t===o?o+1:Math.min(o,t+n),Pw=(t,e,o)=>Math.max(e,Math.min(o,t)),$H=(t,e,o,n,s)=>s.fold(()=>{const r=t-e,a=Math.round(r/n)*n;return Pw(e+a,e-1,o+1)},r=>{const a=(t-r)%n,c=Math.round(a/n),i=Math.floor((t-r)/n),l=Math.floor((o-r)/n),u=Math.min(l,i+c),m=r+u*n;return Math.max(r,m)}),IH=(t,e,o)=>Math.min(o,Math.max(t,e))-e,Lw=t=>{const{min:e,max:o,range:n,value:s,step:r,snap:a,snapStart:c,rounded:i,hasMinEdge:l,hasMaxEdge:u,minBound:m,maxBound:g,screenRange:p}=t,h=l?e-1:e,b=u?o+1:o;if(s<m)return h;if(s>g)return b;{const v=IH(s,m,g),f=Pw(v/p*n+e,h,b);return a&&f>=e&&f<=o?$H(f,e,o,r,c):i?Math.round(f):f}},Vw=t=>{const{min:e,max:o,range:n,value:s,hasMinEdge:r,hasMaxEdge:a,maxBound:c,maxOffset:i,centerMinEdge:l,centerMaxEdge:u}=t;return s<e?r?0:l:s>o?a?c:u:(s-e)/n*i},ip="top",Hw="right",Nw="bottom",lp="left",BH="width",RH="height",ps=t=>t.element.dom.getBoundingClientRect(),On=(t,e)=>t[e],cu=t=>{const e=ps(t);return On(e,lp)},zw=t=>{const e=ps(t);return On(e,Hw)},iu=t=>{const e=ps(t);return On(e,ip)},Uw=t=>{const e=ps(t);return On(e,Nw)},Ww=t=>{const e=ps(t);return On(e,BH)},Gw=t=>{const e=ps(t);return On(e,RH)},jw=(t,e,o)=>(t+e)/2-o,Yw=(t,e)=>{const o=ps(t),n=ps(e),s=On(o,lp),r=On(o,Hw),a=On(n,lp);return jw(s,r,a)},Xw=(t,e)=>{const o=ps(t),n=ps(e),s=On(o,ip),r=On(o,Nw),a=On(n,ip);return jw(s,r,a)},lu=(t,e)=>{Y(t,ei(),{value:e})},up=(t,e,o)=>{const n={min:Yr(e),max:Kr(e),range:sp(e),value:o,step:Ua(e),snap:Dw(e),snapStart:Mw(e),rounded:Fw(e),hasMinEdge:$w(e),hasMaxEdge:Iw(e),minBound:cu(t),maxBound:zw(t),screenRange:Ww(t)};return Lw(n)},PH=(t,e,o)=>{const n=up(t,e,o);return lu(t,n),n},LH=(t,e)=>{const o=Yr(e);lu(t,o)},VH=(t,e)=>{const o=Kr(e);lu(t,o)},HH=(t,e,o,n)=>{const r=(t>
300?cp:ap)(Ls(o),Yr(o),Kr(o),Ua(o,n));return lu(e,r),d.some(r)},Kw=t=>(e,o,n)=>HH(t,e,o,n).map(ve),NH=t=>np(t).map(o=>o.left),zH=(t,e,o,n,s)=>{const a=Ww(t),c=n.bind(u=>d.some(Yw(u,t))).getOr(0),i=s.bind(u=>d.some(Yw(u,t))).getOr(a),l={min:Yr(e),max:Kr(e),range:sp(e),value:o,hasMinEdge:$w(e),hasMaxEdge:Iw(e),minBound:cu(t),minOffset:0,maxBound:zw(t),maxOffset:a,centerMinEdge:c,centerMaxEdge:i};return Vw(l)},dp=(t,e,o,n,s,r)=>{const a=zH(e,r,o,n,s);return cu(e)-cu(t)+a},UH=(t,e,o,n)=>{const s=Ls(o),r=dp(t,n.getSpectrum(t),s,n.getLeftEdge(t),n.getRightEdge(t),o),a=Co(e.element)/2;ct(e.element,"left",r-a+"px")},WH=Kw(-1),GH=Kw(1),jH=d.none,YH=d.none,XH={"top-left":d.none(),top:d.none(),"top-right":d.none(),right:d.some(_H),"bottom-right":d.none(),bottom:d.none(),"bottom-left":d.none(),left:d.some(MH)};var KH=Object.freeze({__proto__:null,setValueFrom:PH,setToMin:LH,setToMax:VH,findValueOfOffset:up,getValueFromEvent:NH,findPositionOfValue:dp,setPositionFromValue:UH,onLeft:WH,onRight:GH,onUp:jH,onDown:YH,edgeActions:XH});const uu=(t,e)=>{Y(t,ei(),{value:e})},mp=(t,e,o)=>{const n={min:Xr(e),max:qr(e),range:rp(e),value:o,step:Ua(e),snap:Dw(e),snapStart:Mw(e),rounded:Fw(e),hasMinEdge:Bw(e),hasMaxEdge:Rw(e),minBound:iu(t),maxBound:Uw(t),screenRange:Gw(t)};return Lw(n)},qH=(t,e,o)=>{const n=mp(t,e,o);return uu(t,n),n},JH=(t,e)=>{const o=Xr(e);uu(t,o)},ZH=(t,e)=>{const o=qr(e);uu(t,o)},QH=(t,e,o,n)=>{const r=(t>0?cp:ap)(Ls(o),Xr(o),qr(o),Ua(o,n));return uu(e,r),d.some(r)},qw=t=>(e,o,n)=>QH(t,e,o,n).map(ve),t2=t=>np(t).map(o=>o.top),e2=(t,e,o,n,s)=>{const a=Gw(t),c=n.bind(u=>d.some(Xw(u,t))).getOr(0),i=s.bind(u=>d.some(Xw(u,t))).getOr(a),l={min:Xr(e),max:qr(e),range:rp(e),value:o,hasMinEdge:Bw(e),hasMaxEdge:Rw(e),minBound:iu(t),minOffset:0,maxBound:Uw(t),maxOffset:a,centerMinEdge:c,centerMaxEdge:i};return Vw(l)},gp=(t,e,o,n,s,r)=>{const a=e2(e,r,o,n,s);return iu(e)-iu(t)+a},o2=(t,e,o,n)=>{const s=Ls(o),r=gp(t,n.getSpectrum(t),s,n.getTopEdge(t),n.getBottomEdge(t),o),a=Te(e.element)/2;ct(e.element,"top",r-a+"px")},n2=d.none,s2=d.none,r2=qw(-1),a2=qw(1),c2={"top-left":d.none(),top:d.some(wH),"top-right":d.none(),right:d.none(),"bottom-right":d.none(),bottom:d.some(kH),"bottom-left":d.none(),left:d.none()};var i2=Object.freeze({__proto__:null,setValueFrom:qH,setToMin:JH,setToMax:ZH,findValueOfOffset:mp,getValueFromEvent:t2,findPositionOfValue:gp,setPositionFromValue:o2,onLeft:n2,onRight:s2,onUp:r2,onDown:a2,edgeActions:c2});const du=(t,e)=>{Y(t,ei(),{value:e})},mu=(t,e)=>({x:t,y:e}),l2=(t,e,o)=>{const n=up(t,e,o.left),s=mp(t,e,o.top),r=mu(n,s);return du(t,r),r},u2=(t,e,o,n,s)=>{const r=t>0?cp:ap,a=e?Ls(n).x:r(Ls(n).x,Yr(n),Kr(n),Ua(n,s)),c=e?r(Ls(n).y,Xr(n),qr(n),Ua(n,s)):Ls(n).y;return du(o,mu(a,c)),d.some(a)},gu=(t,e)=>(o,n,s)=>u2(t,e,o,n,s).map(ve),d2=(t,e)=>{const o=Yr(e),n=Xr(e);du(t,mu(o,n))},m2=(t,e)=>{const o=Kr(e),n=qr(e);du(t,mu(o,n))},g2=t=>np(t),p2=(t,e,o,n)=>{const s=Ls(o),r=dp(t,n.getSpectrum(t),s.x,n.getLeftEdge(t),n.getRightEdge(t),o),a=gp(t,n.getSpectrum(t),s.y,n.getTopEdge(t),n.getBottomEdge(t),o),c=Co(e.element)/2,i=Te(e.element)/2;ct(e.element,"left",r-c+"px"),ct(e.element,"top",a-i+"px")},h2=gu(-1,!1),f2=gu(1,!1),b2=gu(-1,!0),v2=gu(1,!0),y2={"top-left":d.some(SH),top:d.some(TH),"top-right":d.some(CH),right:d.some(OH),"bottom-right":d.some(EH),bottom:d.some(AH),"bottom-left":d.some(DH),left:d.some(FH)};var x2=Object.freeze({__proto__:null,setValueFrom:l2,setToMin:d2,setToMax:m2,getValueFromEvent:g2,setPositionFromValue:p2,onLeft:h2,onRight:f2,onUp:b2,onDown:v2,edgeActions:y2});const S2=[T("stepSize",1),T("speedMultiplier",10),T("onChange",$),T("onChoose",$),T("onInit",$),T("onDragStart",$),T("onDragEnd",$),T("snapToGri
30d",!1),T("rounded",!0),Tt("snapStart"),Lo("model",fo("mode",{x:[T("minX",0),T("maxX",100),lo("value",t=>X(t.mode.minX)),A("getInitialValue"),Gt("manager",KH)],y:[T("minY",0),T("maxY",100),lo("value",t=>X(t.mode.minY)),A("getInitialValue"),Gt("manager",i2)],xy:[T("minX",0),T("maxX",100),T("minY",0),T("maxY",100),lo("value",t=>X({x:t.mode.minX,y:t.mode.minY})),A("getInitialValue"),Gt("manager",x2)]})),_e("sliderBehaviours",[U,P]),lo("mouseIsDown",()=>X(!1))],En=oo({name:"Slider",configFields:S2,partFields:hH,factory:(t,e,o,n)=>{const s=O=>er(O,t,"thumb"),r=O=>er(O,t,"spectrum"),a=O=>$t(O,t,"left-edge"),c=O=>$t(O,t,"right-edge"),i=O=>$t(O,t,"top-edge"),l=O=>$t(O,t,"bottom-edge"),u=t.model,m=u.manager,g=(O,F)=>{m.setPositionFromValue(O,F,t,{getLeftEdge:a,getRightEdge:c,getTopEdge:i,getBottomEdge:l,getSpectrum:r})},p=(O,F)=>{u.value.set(F);const R=s(O);g(O,R)},h=(O,F)=>{p(O,F);const R=s(O);return t.onChange(O,R,F),d.some(!0)},b=O=>{m.setToMin(O,t)},v=O=>{m.setToMax(O,t)},f=O=>{const F=()=>{$t(O,t,"thumb").each(S=>{const B=u.value.get();t.onChoose(O,S,B)})},R=t.mouseIsDown.get();t.mouseIsDown.set(!1),R&&F()},y=(O,F)=>{F.stop(),t.mouseIsDown.set(!0),t.onDragStart(O,s(O))},x=(O,F)=>{F.stop(),t.onDragEnd(O,s(O)),f(O)},C=O=>{$t(O,t,"spectrum").map(U.focusIn)};return{uid:t.uid,dom:t.dom,components:e,behaviours:Me(t.sliderBehaviours,[U.config({mode:"special",focusIn:C}),P.config({store:{mode:"manual",getValue:O=>u.value.get(),setValue:p}}),Ao.config({channels:{[Wg()]:{onReceive:f}}})]),events:Ht([E(ei(),(O,F)=>{h(O,F.event.value)}),Vt((O,F)=>{const R=u.getInitialValue();u.value.set(R);const S=s(O);g(O,S);const B=r(O);t.onInit(O,S,B,u.value.get())}),E(Os(),y),E(Dr(),x),E(Vo(),(O,F)=>{C(O),y(O,F)}),E(gm(),x)]),apis:{resetToMin:b,resetToMax:v,setValue:p,refresh:g},domModification:{styles:{position:"relative"}}}},apis:{setValue:(t,e,o)=>{t.setValue(e,o)},resetToMin:(t,e)=>{t.resetToMin(e)},resetToMax:(t,e)=>{t.resetToMax(e)},refresh:(t,e)=>{t.refresh(e)}}}),Jw="container",w2=[_e("slotBehaviours",[])],Zw=t=>"<alloy.field."+t+">",T2=t=>{const e=(()=>{const r=[];return{slot:(c,i)=>(r.push(c),$m(Jw,Zw(c),i)),record:w(r)}})(),o=t(e),n=e.record(),s=L(n,r=>Ye({name:r,pname:Zw(r)}));return Dg(Jw,w2,s,C2,o)},C2=(t,e)=>{const o=b=>ny(t),n=(b,v)=>$t(b,t,v),s=(b,v)=>(f,y)=>$t(f,t,y).map(x=>b(x,y)).getOr(v),r=b=>(v,f)=>{q(f,y=>b(v,y))},a=(b,v)=>Ee(b.element,"aria-hidden")!=="true",c=(b,v)=>{if(!a(b)){const f=b.element;wt(f,"display"),oe(f,"aria-hidden"),Y(b,bm(),{name:v,visible:!0})}},i=(b,v)=>{if(a(b)){const f=b.element;ct(f,"display","none"),nt(f,"aria-hidden","true"),Y(b,bm(),{name:v,visible:!1})}},l=s(a,!1),u=s(i),m=r(u),g=b=>m(b,o()),p=s(c),h={getSlotNames:o,getSlot:n,isShowing:l,hideSlot:u,hideAllSlots:g,showSlot:p};return{uid:t.uid,dom:t.dom,components:e,behaviours:Wl(t.slotBehaviours),apis:h}},qe={...we({getSlotNames:(t,e)=>t.getSlotNames(e),getSlot:(t,e,o)=>t.getSlot(e,o),isShowing:(t,e,o)=>t.isShowing(e,o),hideSlot:(t,e,o)=>t.hideSlot(e,o),hideAllSlots:(t,e)=>t.hideAllSlots(e),showSlot:(t,e,o)=>t.showSlot(e,o)},t=>Bl(t)),sketch:T2},_2=w([A("toggleClass"),A("fetch"),Br("onExecute"),T("getHotspot",d.some),T("getAnchorOverrides",w({})),ar(),Br("onItemExecute"),Tt("lazySink"),A("dom"),bt("onOpen"),_e("splitDropdownBehaviours",[te,U,Z]),T("matchWidth",!1),T("useMinWidth",!1),T("eventOrder",{}),Tt("role"),Tt("listRole")].concat(Zg())),O2=Ye({factory:Fe,schema:[A("dom")],name:"arrow",defaults:()=>({buttonBehaviours:D([Z.revoke()])}),overrides:t=>({dom:{tag:"span",attributes:{role:"presentation"}},action:e=>{e.getSystem().getByUid(t.uid).each(Rr)},buttonBehaviours:D([it.config({toggleOnExecute:!1,toggleClass:t.toggleClass})])})}),E2=Ye({factory:Fe,schema:[A("dom")],name:"button",defaults:()=>({buttonBehaviours:D([Z.revoke()])}),overrides:t=>({dom:{tag:"span",attributes:{role:"presentation"}},action:e=>{e.getSystem().getByUid(t.uid).each(o=>{t.onExecute(o,e)})}})}),k2=w([O2,E2,tn({factory:{sketch:t=>({uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}})},schema:[A("text")],name:"aria-descriptor"}),yn({schema:[dl()],name:"menu",defaults:t=>({onExecute:(e,o)=>{e.getSystem().getByUid(t.uid).each(n=>{t.onItemExecute(n,e,o)})}})}),hw()]),A2=(t,e,o,n)=>{const s=u=>{ht.getCurrent(u).each(m=>{Ct.highlightFirst(m),U.focusIn(m)})},r=u=>{qg(t,xt,u,n,s,uo.HighlightMenuAndItem).get($)},a=u=>(r(u),d.some(!0)),c=u=>{const m=er(u,t,"button");return Rr(m),d.some(!0)},i={...Ht([Vt((u,m)=>{$t(u,t,"aria-descriptor").each(p=>{const h=V("aria");nt(p.element,"id",h),nt(u.element,"aria-describedby",h)})})]),...Zl(d.some(r))},l={repositionMenus:u=>{it.isOn(u)&&yw(u)}};return{uid:t.uid,dom:t.dom,components:e,apis:l,eventOrder:{...t.eventOrder,[Ho()]:["disabling","toggling","alloy.base.behaviour"]},events:i,behaviours:Me(t.splitDropdownBehaviours,[te.config({others:{sandbox:u=>{const m=er(u,t,"arrow");return Jg(t,u,{onOpen:()=>{it.on(m),it.on(u)},onClose:()=>{it.off(m),it.off(u)}})}}}),U.config({mode:"special",onSpace:c,onEnter:c,onDown:a}),Z.config({}
30),it.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:t.role.getOr("button"),"aria-haspopup":!0}}}},pu=oo({name:"SplitDropdown",configFields:_2(),partFields:k2(),factory:A2,apis:{repositionMenus:(t,e)=>t.repositionMenus(e)}}),D2=(t,e)=>Ge(t,(s,r)=>e(r,s.len).fold(w(s),c=>({len:c.finish,list:s.list.concat([c])})),{len:0,list:[]}).list,pp=(t,e,o)=>({within:t,extra:e,withinWidth:o}),Qw=(t,e,o)=>{const n=D2(t,(c,i)=>{const l=o(c);return d.some({element:c,start:i,finish:i+l,width:l})}),s=Wt(n,c=>c.finish<=e),r=pa(s,(c,i)=>c+i.width,0),a=n.slice(s.length);return{within:s,extra:a,withinWidth:r}},hu=t=>L(t,e=>e.element),M2=(t,e,o)=>{const n=hu(t.concat(e));return pp(n,[],o)},F2=(t,e,o,n)=>{const s=hu(t).concat([o]);return pp(s,hu(e),n)},$2=(t,e,o)=>pp(hu(t),[],o),I2=(t,e,o)=>{const n=Qw(e,t,o);return n.extra.length===0?d.some(n):d.none()},B2=(t,e,o,n)=>{const s=I2(t,e,o).getOrThunk(()=>Qw(e,t-o(n),o)),r=s.within,a=s.extra,c=s.withinWidth;return a.length===1&&a[0].width<=o(n)?M2(r,a,c):a.length>=1?F2(r,a,n,c):$2(r,a,c)},tT=(t,e)=>{const o=L(e,n=>zo(n));qn.setGroups(t,o)},R2=t=>In(t,e=>Qe(e.element).bind(o=>e.getSystem().getByDom(o).toOptional())),eT=(t,e,o)=>{const n=e.builtGroups.get();if(n.length===0)return;const s=er(t,e,"primary"),r=te.getCoupled(t,"overflowGroup");ct(s.element,"visibility","hidden");const a=n.concat([r]),c=R2(a);o([]),tT(s,a);const i=Co(s.element),l=B2(i,e.builtGroups.get(),u=>Math.ceil(u.element.dom.getBoundingClientRect().width),r);l.extra.length===0?(st.remove(s,r),o([])):(tT(s,l.within),o(l.extra)),wt(s.element,"visibility"),wc(s.element),c.each(Z.focus)},oT=w([_e("splitToolbarBehaviours",[te]),lo("builtGroups",()=>X([]))]),P2=w([Ir(["overflowToggledClass"]),is("getOverflowBounds"),A("lazySink"),lo("overflowGroups",()=>X([])),bt("onOpened"),bt("onClosed")].concat(oT())),L2=w([Ye({factory:qn,schema:za(),name:"primary"}),yn({schema:za(),name:"overflow"}),yn({name:"overflow-button"}),yn({name:"overflow-group"})]),V2=w([A("items"),Ir(["itemSelector"]),_e("tgroupBehaviours",[U])]),H2=w([xl({name:"items",unit:"item"})]),N2=(t,e,o,n)=>({uid:t.uid,dom:t.dom,components:e,behaviours:Me(t.tgroupBehaviours,[U.config({mode:"flow",selector:t.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}),fu=oo({name:"ToolbarGroup",configFields:V2(),partFields:H2(),factory:N2}),nT=t=>L(t,e=>zo(e)),sT=(t,e,o)=>{eT(t,o,n=>{o.overflowGroups.set(n),e.getOpt(t).each(s=>{ir.setGroups(s,nT(n))})})},z2=(t,e,o,n)=>{const s=St(ir.sketch({fetch:()=>Be.nu(r=>{r(nT(t.overflowGroups.get()))}),layouts:{onLtr:()=>[ge,me],onRtl:()=>[me,ge],onBottomLtr:()=>[We,Ue],onBottomRtl:()=>[Ue,We]},getBounds:o.getOverflowBounds,lazySink:t.lazySink,fireDismissalEventInstead:{},markers:{toggledClass:t.markers.overflowToggledClass},parts:{button:n["overflow-button"](),toolbar:n.overflow()},onToggled:(r,a)=>t[a?"onOpened":"onClosed"](r)}));return{uid:t.uid,dom:t.dom,components:e,behaviours:Me(t.splitToolbarBehaviours,[te.config({others:{overflowGroup:()=>fu.sketch({...n["overflow-group"](),items:[s.asSpec()]})}})]),apis:{setGroups:(r,a)=>{t.builtGroups.set(L(a,r.getSystem().build)),sT(r,s,t)},refresh:r=>sT(r,s,t),toggle:r=>{s.getOpt(r).each(a=>{ir.toggle(a)})},toggleWithoutFocusing:r=>{s.getOpt(r).each(ir.toggleWithoutFocusing)},isOpen:r=>s.getOpt(r).map(ir.isOpen).getOr(!1),reposition:r=>{s.getOpt(r).each(a=>{ir.reposition(a)})},getOverflow:r=>s.getOpt(r).bind(ir.getToolbar)},domModification:{attributes:{role:"group"}}}},rT=oo({name:"SplitFloatingToolbar",configFields:P2(),partFields:L2(),factory:z2,apis:{setGroups:(t,e,o)=>{t.setGroups(e,o)},refresh:(t,e)=>{t.refresh(e)},reposition:(t,e)=>{t.reposition(e)},toggle:(t,e)=>{t.toggle(e)},toggleWithoutFocusing:(t,e)=>{t.toggle(e)},isOpen:(t,e)=>t.isOpen(e),getOverflow:(t,e)=>t.getOverflow(e)}}),U2=w([Ir(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),bt("onOpened"),bt("onClosed")].concat(oT())),W2=w([Ye({factory:qn,schema:za(),name:"primary"}),Ye({factory:qn,schema:za(),name:"overflow",overrides:t=>({toolbarBehaviours:D([bo.config({dimension:{property:"height"},closedClass:t.markers.closedClass,openClass:t.markers.openClass,shrinkingClass:t.markers.shrinkingClass,growingClass:t.markers.growingClass,onShrunk:e=>{$t(e,t,"overflow-button").each(o=>{it.off(o)}),t.onClosed(e)},onGrown:e=>{t.onOpened(e)},onStartGrow:e=>{$t(e,t,"overflow-button").each(it.on)}}),U.config({mode:"acyclic",onEscape:e=>($t(e,t,"overflow-button").each(Z.focus),d.some(!0))})])})}),yn({name:"overflow-button",overrides:t=>({buttonBehaviours:D([it.config({toggleClass:t.markers.overflowToggledClass,aria:{mode:"exp
30anded"},toggleOnExecute:!1})])})}),yn({name:"overflow-group"})]),G2=(t,e)=>$t(t,e,"overflow").map(bo.hasGrown).getOr(!1),hp=(t,e,o)=>{$t(t,e,"overflow-button").each(n=>{$t(t,e,"overflow").each(s=>{if(fp(t,e),bo.hasShrunk(s)){const r=e.onOpened;e.onOpened=a=>{o||U.focusIn(s),r(a),e.onOpened=r}}else{const r=e.onClosed;e.onClosed=a=>{o||Z.focus(n),r(a),e.onClosed=r}}bo.toggleGrow(s)})})},fp=(t,e)=>{$t(t,e,"overflow").each(o=>{eT(t,e,n=>{const s=L(n,r=>zo(r));qn.setGroups(o,s)}),$t(t,e,"overflow-button").each(n=>{bo.hasGrown(o)&&it.on(n)}),bo.refresh(o)})},j2=(t,e,o,n)=>{const s="alloy.toolbar.toggle",r=(a,c)=>{const i=L(c,a.getSystem().build);t.builtGroups.set(i)};return{uid:t.uid,dom:t.dom,components:e,behaviours:Me(t.splitToolbarBehaviours,[te.config({others:{overflowGroup:a=>fu.sketch({...n["overflow-group"](),items:[Fe.sketch({...n["overflow-button"](),action:c=>{pt(a,s)}})]})}}),et("toolbar-toggle-events",[E(s,a=>{hp(a,t,!1)})])]),apis:{setGroups:(a,c)=>{r(a,c),fp(a,t)},refresh:a=>fp(a,t),toggle:a=>{hp(a,t,!1)},toggleWithoutFocusing:a=>{hp(a,t,!0)},isOpen:a=>G2(a,t)},domModification:{attributes:{role:"group"}}}},bp=oo({name:"SplitSlidingToolbar",configFields:U2(),partFields:W2(),factory:j2,apis:{setGroups:(t,e,o)=>{t.setGroups(e,o)},refresh:(t,e)=>{t.refresh(e)},toggle:(t,e)=>{t.toggle(e)},isOpen:(t,e)=>t.isOpen(e)}}),Y2=(t,e)=>({uid:t.uid,dom:t.dom,components:t.components,events:Zl(t.action),behaviours:Me(t.tabButtonBehaviours,[Z.config({}),U.config({mode:"execution",useSpace:!0,useEnter:!0}),P.config({store:{mode:"memory",initialValue:t.value}})]),domModification:t.domModification}),X2=Uo({name:"TabButton",configFields:[T("uid",void 0),A("value"),Ve("dom","dom",lm(()=>({attributes:{role:"tab",id:V("aria"),"aria-selected":"false"}})),pn()),Tt("action"),T("domModification",{}),_e("tabButtonBehaviours",[Z,U,P]),A("view")],factory:Y2}),K2=w([A("tabs"),A("dom"),T("clickToDismiss",!1),_e("tabbarBehaviours",[Ct,U]),Ir(["tabClass","selectedClass"])]),q2=xl({factory:X2,name:"tabs",unit:"tab",overrides:t=>{const e=(n,s)=>{Ct.dehighlight(n,s),Y(n,Hv(),{tabbar:n,button:s})},o=(n,s)=>{Ct.highlight(n,s),Y(n,Vv(),{tabbar:n,button:s})};return{action:n=>{const s=n.getSystem().getByUid(t.uid).getOrDie(),r=Ct.isHighlighted(s,n);(r&&t.clickToDismiss?e:r?$:o)(s,n)},domModification:{classes:[t.markers.tabClass]}}}}),J2=w([q2]),Z2=(t,e,o,n)=>({uid:t.uid,dom:t.dom,components:e,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:Me(t.tabbarBehaviours,[Ct.config({highlightClass:t.markers.selectedClass,itemClass:t.markers.tabClass,onHighlight:(s,r)=>{nt(r.element,"aria-selected","true")},onDehighlight:(s,r)=>{nt(r.element,"aria-selected","false")}}),U.config({mode:"flow",getInitial:s=>Ct.getHighlighted(s).map(r=>r.element),selector:"."+t.markers.tabClass,executeOnMove:!0})])}),aT=oo({name:"Tabbar",configFields:K2(),partFields:J2(),factory:Z2}),Q2=(t,e)=>({uid:t.uid,dom:t.dom,behaviours:Me(t.tabviewBehaviours,[st.config({})]),domModification:{attributes:{role:"tabpanel"}}}),tN=Uo({name:"Tabview",configFields:[_e("tabviewBehaviours",[st])],factory:Q2}),eN=w([T("selectFirst",!0),bt("onChangeTab"),bt("onDismissTab"),T("tabs",[]),_e("tabSectionBehaviours",[])]),oN=Ye({factory:aT,schema:[A("dom"),Cs("markers",[A("tabClass"),A("selectedClass")])],name:"tabbar",defaults:t=>({tabs:t.tabs})}),nN=Ye({factory:tN,name:"tabview"}),sN=w([oN,nN]),rN=(t,e,o,n)=>{const s=a=>{const c=P.getValue(a);$t(a,t,"tabview").each(i=>{ee(t.tabs,u=>u.value===c).each(u=>{const m=u.view();Pe(a.element,"id").each(g=>{nt(i.element,"aria-labelledby",g)}),st.set(i,m),t.onChangeTab(i,a,m)})})},r=(a,c)=>{$t(a,t,"tabbar").each(i=>{c(i).each(Rr)})};return{uid:t.uid,dom:t.dom,components:e,behaviours:Wl(t.tabSectionBehaviours),events:Ht(Ie([t.selectFirst?[Vt((a,c)=>{r(a,Ct.getFirst)})]:[],[E(Vv(),(a,c)=>{const i=c.event.button;s(i)}),E(Hv(),(a,c)=>{const i=c.event.button;t.onDismissTab(a,i)})]])),apis:{getViewItems:a=>$t(a,t,"tabview").map(c=>st.contents(c)).getOr([]),showTab:(a,c)=>{r(a,l=>{const u=Ct.getCandidates(l);return ee(u,g=>P.getValue(g)===c).filter(g=>
vendor: 9,335 bytes, line 30
30!Ct.isHighlighted(l,g))})}}}},Wa=oo({name:"TabSection",configFields:eN(),partFields:sN(),factory:rN,apis:{getViewItems:(t,e)=>t.getViewItems(e),showTab:(t,e,o)=>{t.showTab(e,o)}}}),bu=(t,e,o)=>{const n=P.getValue(o);P.setValue(e,n),iT(e)},cT=(t,e)=>{const o=t.element,n=Ts(o),s=o.dom;Ee(o,"type")!=="number"&&e(s,n)},iT=t=>{cT(t,(e,o)=>e.setSelectionRange(o.length,o.length))},aN=(t,e)=>{cT(t,(o,n)=>o.setSelectionRange(e,n.length))},cN=(t,e,o)=>{if(t.selectsOver){const n=P.getValue(e),s=t.getDisplayText(n),r=P.getValue(o);return t.getDisplayText(r).indexOf(s)===0?d.some(()=>{bu(t,e,o),aN(e,s.length)}):d.none()}else return d.none()},vp=w("alloy.typeahead.itemexecute"),iN=(t,e,o,n)=>{const s=(m,g,p)=>{t.previewing.set(!1);const h=te.getCoupled(m,"sandbox");if(vt.isOpen(h))ht.getCurrent(h).each(b=>{Ct.getHighlighted(b).fold(()=>{p(b)},()=>{_y(h,b.element,"keydown",g)})});else{const b=v=>{ht.getCurrent(v).each(p)};Ql(t,a(m),m,h,n,b,uo.HighlightMenuAndItem).get($)}},r=_w(t),a=m=>g=>g.map(p=>{const h=Ad(p.menus),b=ye(h,f=>Wt(f.items,y=>y.type==="item"));return P.getState(m).update(L(b,f=>f.data)),p}),c=m=>ht.getCurrent(m),i="typeaheadevents",l=[Z.config({}),P.config({onSetValue:t.onSetValue,store:{mode:"dataset",getDataKey:m=>Ts(m.element),getFallbackEntry:m=>({value:m,meta:{}}),setValue:(m,g)=>{Er(m.element,t.model.getDisplayText(g))},...t.initialData.map(m=>Ar("initialValue",m)).getOr({})}}),Ug.config({stream:{mode:"throttle",delay:t.responseTime,stopEvent:!1},onStream:(m,g)=>{const p=te.getCoupled(m,"sandbox");if(Z.isFocused(m)&&Ts(m.element).length>=t.minChars){const b=c(p).bind(f=>Ct.getHighlighted(f).map(P.getValue));t.previewing.set(!0);const v=f=>{c(p).each(y=>{b.fold(()=>{t.model.selectsOver&&Ct.highlightFirst(y)},x=>{Ct.highlightBy(y,C=>P.getValue(C).value===x.value),Ct.getHighlighted(y).orThunk(()=>(Ct.highlightFirst(y),d.none()))})})};Ql(t,a(m),m,p,n,v,uo.HighlightJustMenu).get($)}},cancelEvent:hm()}),U.config({mode:"special",onDown:(m,g)=>(s(m,g,Ct.highlightFirst),d.some(!0)),onEscape:m=>{const g=te.getCoupled(m,"sandbox");return vt.isOpen(g)?(vt.close(g),d.some(!0)):d.none()},onUp:(m,g)=>(s(m,g,Ct.highlightLast),d.some(!0)),onEnter:m=>{const g=te.getCoupled(m,"sandbox"),p=vt.isOpen(g);if(p&&!t.previewing.get())return c(g).bind(h=>Ct.getHighlighted(h)).map(h=>(Y(m,vp(),{item:h}),!0));{const h=P.getValue(m);return pt(m,hm()),t.onExecute(g,m,h),p&&vt.close(g),d.some(!0)}}}),it.config({toggleClass:t.markers.openClass,aria:{mode:"expanded"}}),te.config({others:{sandbox:m=>Jg(t,m,{onOpen:()=>it.on(m),onClose:()=>{t.lazyTypeaheadComp.get().each(g=>oe(g.element,"aria-activedescendant")),it.off(m)}})}}),et(i,[Vt(m=>{t.lazyTypeaheadComp.set(d.some(m))}),jn(m=>{t.lazyTypeaheadComp.set(d.none())}),As(m=>{const g=$;qg(t,a(m),m,n,g,uo.HighlightMenuAndItem).get($)}),E(vp(),(m,g)=>{const p=te.getCoupled(m,"sandbox");bu(t.model,m,g.event.item),pt(m,hm()),t.onItemExecute(m,p,g.event.item,P.getValue(m)),vt.close(p),iT(m)})].concat(t.dismissOnBlur?[E(Fc(),m=>{const g=te.getCoupled(m,"sandbox");Qe(g.element).isNone()&&vt.close(g)})]:[]))],u={[us()]:[P.name(),Ug.name(),i],...t.eventOrder};return{uid:t.uid,dom:Ow(Jt(t,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:{...r,...Me(t.typeaheadBehaviours,l)},eventOrder:u}},lN=w([Tt("lazySink"),A("fetch"),T("minChars",5),T("responseTime",1e3),bt("onOpen"),T("getHotspot",d.some),T("getAnchorOverrides",w({})),T("layouts",d.none()),T("eventOrder",{}),mm("model",{},[T("getDisplayText",t=>t.meta!==void 0&&t.meta.text!==void 0?t.meta.text:t.value),T("selectsOver",!0),T("populateFromBrowse",!0)]),bt("onSetValue"),Eo("onExecute"),bt("onItemExecute"),T("inputClasses",[]),T("inputAttributes",{}),T("inputStyles",{}),T("matchWidth",!0),T("useMinWidth",!1),T("dismissOnBlur",!0),Ir(["openClass"]),Tt("initialData"),Tt("listRole"),_e("typeaheadBehaviours",[Z,P,Ug,U,it,te]),lo("lazyTypeaheadComp",()=>X(d.none)),lo("previewing",()=>X(!0))].concat(Cw()).concat(Zg())),uN=w([yn({schema:[dl()],name:"menu",overrides:t=>({fakeFocus:!0,onHighlightItem:(e,o,n)=>{t.previewing.get()?t.lazyTypeaheadComp.get().each(s=>{cN(t.model,s,n).fold(()=>{t.model.selectsOver?(Ct.dehighlight(o,n),t.previewing.set(!0)):t.previewing.set(!1)},r=>{r(),t.previewing.set(!1)})}):t.lazyTypeaheadComp.get().each(s=>{t.model.populateFromBrowse&&bu(t.model,s,n),Pe(n.element,"id").each(r=>nt(s.element,"aria-activedescendant",r))})},onExecute:(e,o)=>t.lazyTypeaheadComp.get().map(n=>(Y(n,vp(),{item:o}),!0)),onHover:(e,o)=>{t.previewing.set(!1),t.lazyTypeaheadComp.get().each(n=>{t.model.populateFromBrowse&&bu(t.model,n,o)})}})})]),dN=oo({name:"Typeahead",configFields:lN(),partFields:uN(),factory:iN});var mN=tinymce.util.Tools.resolve("tinymce.ThemeManager"),vu=tinymce.util.Tools.resolve("tinymce.util.Delay"),oi=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),gN=tinymce.util.Tools.resolve("tinymce.EditorManager"),Ga=tinymce.util.Tools.resolve("tinymce.Env"),en;(function(t){t.default="wrap",t.floating="floating",t.sliding="sliding",t.scrolling="scrolling"})(en||(en={}));var ni;(function(t){t.auto="auto",t.top="top",t.bottom="bottom"})(ni||(ni={}));const kt=t=>e=>e.options.get(t),si=t=>e=>d.from(t(e)),lT=t=>{const e=Ga.deviceType.isPhone(),o=Ga.deviceType.isTablet()||e,n=t.options.register,s=a=>Et(a)||a===!1,r=a=>Et(a)||ns(a);n("skin",{processor:a=>Et(a)||a===!1,default:"oxide"}),n("skin_url",{processor:"string"}),n("height",{processor:r,default:Math.max(t.getElement().offsetHeight,400)}),n("width",{processor:r,default:oi.DOM.getStyle(t.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:a=>Et(a)||ys(a),default:!e}),n("menu",{processor:"object",default:{}}),n("toolbar",{processor:a=>ys(a)||Et(a)||vs(a)?{value:a,valid:!0}:{valid:!1,message:"Must be a boolean, string or array."},default:!0}),Cd(9,a=>{n("toolbar"+(a+1),{processor:"string"})}),n("toolbar_mode",{processor:"string",default:o?"scrolling":"floating"}),n("toolbar_groups",{processor:"object",default:{}}),n("toolbar_location",{processor:"string",default:ni.auto}),n("toolbar_persist",{processor:"boolean",default:!1}),n("toolbar_sticky",{processor:"boolean",default:t.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:a=>a==="both"||ys(a),default:!Ga.deviceType.isTouch()}),n("sidebar_show",{processor:"string"}),n("help_accessibility",{processor:"boolean",default:t.hasPlugin("help")}),n("default_font_stack",{processor:"string[]",default:[]})},uT=kt("readonly"),yu=kt("disabled"),yp=kt("height"),xp=kt("width"),Sp=si(kt("min_width")),wp=si(kt("min_height")),xu=si(kt("max_width")),Tp=si(kt("max_height")),dT=si(kt("style_formats")),mT=kt("style_formats_merge"),gT=kt("style_formats_autohide"),pT=kt("content_langs"),hT=kt("removed_menuitems"),ja=kt("toolbar_mode"),fT=kt("toolbar_groups"),Cp=kt("toolbar_location"),pN=kt("fixed_toolbar_container"),hN=kt("fixed_toolbar_container_target"),bT=kt("toolbar_persist"),vT=kt("toolbar_sticky_offset"),yT=kt("menubar"),Su=kt("toolbar"),xT=kt("file_picker_callback"),ST=kt("file_picker_validator_handler"),wT=kt("font_size_input_default_unit"),TT=kt("file_picker_types"),CT=kt("typeahead_urls"),_T=kt("anch
30or_top"),OT=kt("anchor_bottom"),ET=kt("draggable_modal"),kT=kt("statusbar"),AT=kt("elementpath"),_p=kt("branding"),DT=kt("resize"),MT=kt("paste_as_text"),FT=kt("sidebar_show"),$T=kt("promotion"),IT=kt("help_accessibility"),BT=kt("default_font_stack"),RT=kt("skin"),Op=t=>t.options.get("skin")===!1,wu=t=>t.options.get("menubar")!==!1,PT=t=>{const e=t.options.get("skin_url");if(Op(t))return e;if(e)return t.documentBaseURI.toAbsolute(e);{const o=t.options.get("skin");return gN.baseURL+"/skins/ui/"+o}},fN=t=>d.from(t.options.get("skin_url")),LT=t=>t.options.get("line_height_formats").split(" "),Tu=t=>{const e=Su(t),o=Et(e),n=vs(e)&&e.length>0;return!ri(t)&&(n||o||e===!0)},Ep=t=>{const e=Cd(9,n=>t.options.get("toolbar"+(n+1))),o=Wt(e,Et);return dn(o.length>0,o)},ri=t=>Ep(t).fold(()=>{const e=Su(t);return ga(e,Et)&&e.length>0},ve),kp=t=>Cp(t)===ni.bottom,VT=t=>{var e;if(!t.inline)return d.none();const o=(e=pN(t))!==null&&e!==void 0?e:"";if(o.length>0)return Dt(Ks(),o);const n=hN(t);return $e(n)?d.some(I.fromDom(n)):d.none()},Ya=t=>t.inline&&VT(t).isSome(),Ap=t=>VT(t).getOrThunk(()=>wa(ao(I.fromDom(t.getElement())))),Dp=t=>t.inline&&!wu(t)&&!Tu(t)&&!ri(t),Xa=t=>(t.options.get("toolbar_sticky")||t.inline)&&!Ya(t)&&!Dp(t),dr=t=>!Ya(t)&&t.options.get("ui_mode")==="split",HT=t=>{const e=t.options.get("menu");return we(e,o=>({...o,items:o.items}))};var bN=Object.freeze({__proto__:null,get ToolbarMode(){return en},get ToolbarLocation(){return ni},register:lT,getSkinUrl:PT,getSkinUrlOption:fN,isReadOnly:uT,isDisabled:yu,getSkin:RT,isSkinDisabled:Op,getHeightOption:yp,getWidthOption:xp,getMinWidthOption:Sp,getMinHeightOption:wp,getMaxWidthOption:xu,getMaxHeightOption:Tp,getUserStyleFormats:dT,shouldMergeStyleFormats:mT,shouldAutoHideStyleFormats:gT,getLineHeightFormats:LT,getContentLanguages:pT,getRemovedMenuItems:hT,isMenubarEnabled:wu,isMultipleToolbars:ri,isToolbarEnabled:Tu,isToolbarPersist:bT,getMultipleToolbarsOption:Ep,getUiContainer:Ap,useFixedContainer:Ya,isSplitUiMode:dr,getToolbarMode:ja,isDraggableModal:ET,isDistractionFree:Dp,isStickyToolbar:Xa,getStickyToolbarOffset:vT,getToolbarLocation:Cp,isToolbarLocationBottom:kp,getToolbarGroups:fT,getMenus:HT,getMenubar:yT,getToolbar:Su,getFilePickerCallback:xT,getFilePickerTypes:TT,useTypeaheadUrls:CT,getAnchorTop:_T,getAnchorBottom:OT,getFilePickerValidatorHandler:ST,getFontSizeInputDefaultUnit:wT,useStatusBar:kT,useElementPath:AT,promotionEnabled:$T,useBranding:_p,getResize:DT,getPasteAsText:MT,getSidebarShow:FT,useHelpAccessibility:IT,getDefaultFontStack:BT});const vN=["visible","hidden","clip"],NT=t=>Fd(t).length>0&&!le(vN,t),zT=t=>{if(Ib(t)){const e=to(t,"overflow-x"),o=to(t,"overflow-y");return NT(e)||NT(o)}else return!1},UT=t=>t.plugins.fullscreen&&t.plugins.fullscreen.isFullscreen(),yN=(t,e)=>{const o=uv(e,zT),n=o.length===0?Nd(e).map(Vb).map(s=>uv(s,zT)).getOr([]):o;return $n(n).map(s=>({element:s,others:n.slice(1),isFullscreen:()=>UT(t)}))},mr=(t,e)=>dr(t)?yN(t,e):d.none(),Jr=t=>{const e=[...L(t.others,Ae),eo()];return t.isFullscreen()?eo():UM(Ae(t.element),e)};const{entries:WT,setPrototypeOf:GT,isFrozen:xN,getPrototypeOf:SN,getOwnPropertyDescriptor:wN}=Object;let{freeze:Mo,seal:kn,create:jT}=Object,{apply:Mp,construct:Fp}=typeof Reflect<"u"&&Reflect;Mo||(Mo=function(e){return e}),kn||(kn=function(e){return e}),Mp||(Mp=function(e,o,n){return e.apply(o,n)}),Fp||(Fp=function(e,o){return new e(...o)});const Cu=$o(Array.prototype.forEach),TN=$o(Array.prototype.lastIndexOf),YT=$o(Array.prototype.pop),ai=$o(Array.prototype.push),CN=$o(Array.prototype.splice),_u=$o(String.prototype.toLowerCase),$p=$o(String.prototype.toString),XT=$o(String.prototype.match),ci=$o(String.prototype.replace),_N=$o(String.prototype.indexOf),ON=$o(String.prototype.trim),Jn=$o(Object.prototype.hasOwnProperty),Fo=$o(RegExp.prototype.test),ii=EN(TypeError);function $o(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var o=arguments.length,n=new Array(o>1?o-1:0),s=1;s<o;s++)n[s-1]=arguments[s];return Mp(t,e,n)}}function EN(t){return function(){for(var e=arguments.length,o=new Array(e),n=0;n<e;n++)o[n]=arguments[n];return Fp(t,o)}}function It(t,e){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_u;GT&&GT(t,null);let n=e.length;for(;n--;){let s=e[n];if(typeof s=="string"){const r=o(s);r!==s&&(xN(e)||(e[n]=r),s=r)}t[s]=!0}return t}function kN(t){for(let e=0;e<t.length;e++)Jn(t,e)||(t[e]=null);return t}function Vs(t){const e=jT(null);for(const[o,n]of WT(t))Jn(t,o)&&(Array.isArray(n)?e[o]=kN(n):n&&typeof n=="object"&&n.constructor===Object?e[o]=Vs(n):e[o]=n);return e}function li(t,e){for(;t!==null;){const n=wN(t,e);if(n){if(n.get)return $o(n.get);if(typeof n.value=="function")return $o(n.value)}t=SN(t)}function o(){return null}return o}const KT=Mo(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ip=Mo(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Bp=Mo(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),AN=Mo(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Rp=Mo(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),DN=Mo(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),qT=Mo(["#text"]),JT=Mo(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","
30spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Pp=Mo(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),ZT=Mo(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Ou=Mo(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),MN=kn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),FN=kn(/<%[\w\W]*|[\w\W]*%>/gm),$N=kn(/\$\{[\w\W]*/gm),IN=kn(/^data-[\-\w.\u00B7-\uFFFF]+$/),BN=kn(/^aria-[\-\w]+$/),QT=kn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),RN=kn(/^(?:\w+script|data):/i),PN=kn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),tC=kn(/^html$/i),LN=kn(/^[a-z][.\w]*(-[.\w]+)+$/i);var eC=Object.freeze({__proto__:null,ARIA_ATTR:BN,ATTR_WHITESPACE:PN,CUSTOM_ELEMENT:LN,DATA_ATTR:IN,DOCTYPE_NAME:tC,ERB_EXPR:FN,IS_ALLOWED_URI:QT,IS_SCRIPT_OR_DATA:RN,MUSTACHE_EXPR:MN,TMPLIT_EXPR:$N});const ui={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},VN=function(){return typeof window>"u"?null:window},HN=function(e,o){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;
30const s="data-tt-policy-suffix";o&&o.hasAttribute(s)&&(n=o.getAttribute(s));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},oC=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function nC(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:VN();const e=gt=>nC(gt);if(e.version="3.2.6",e.removed=[],!t||!t.document||t.document.nodeType!==ui.document||!t.Element)return e.isSupported=!1,e;let{document:o}=t;const n=o,s=n.currentScript,{DocumentFragment:r,HTMLTemplateElement:a,Node:c,Element:i,NodeFilter:l,NamedNodeMap:u=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:m,DOMParser:g,trustedTypes:p}=t,h=i.prototype,b=li(h,"cloneNode"),v=li(h,"remove"),f=li(h,"nextSibling"),y=li(h,"childNodes"),x=li(h,"parentNode");if(typeof a=="function"){const gt=o.createElement("template");gt.content&&gt.content.ownerDocument&&(o=gt.content.ownerDocument)}let C,O="";const{implementation:F,createNodeIterator:R,createDocumentFragment:S,getElementsByTagName:B}=o,{importNode:G}=n;let N=oC();e.isSupported=typeof WT=="function"&&typeof x=="function"&&F&&F.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:lt,ERB_EXPR:Q,TMPLIT_EXPR:ot,DATA_ATTR:H,ARIA_ATTR:k,IS_SCRIPT_OR_DATA:M,ATTR_WHITESPACE:K,CUSTOM_ELEMENT:at}=eC;let{IS_ALLOWED_URI:W}=eC,rt=null;const Ot=It({},[...KT,...Ip,...Bp,...Rp,...qT]);let _t=null;const so=It({},[...JT,...Pp,...ZT,...Ou]);let Ut=Object.seal(jT(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),yo=null,Oe=null,xo=!0,So=!0,jo=!1,da=!0,Fn=!1,cc=!0,Us=!1,Mi=!1,kf=!1,ic=!1,gd=!1,pd=!1,Uk=!0,Wk=!1;const Q7="user-content-";let Af=!0,Fi=!1,lc={},uc=null;const Gk=It({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let jk=null;const Yk=It({},["audio","video","img","source","image","track"]);let Df=null;const Xk=It({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),hd="http://www.w3.org/1998/Math/MathML",fd="http://www.w3.org/2000/svg",Ws="http://www.w3.org/1999/xhtml";let dc=Ws,Mf=!1,Ff=null;const tY=It({},[hd,fd,Ws],$p);let bd=It({},["mi","mo","mn","ms","mtext"]),vd=It({},["annotation-xml"]);const eY=It({},["title","style","font","a","script"]);let $i=null;const oY=["application/xhtml+xml","text/html"],nY="text/html";let ro=null,mc=null;const sY=o.createElement("form"),Kk=function(_){return _ instanceof RegExp||_ instanceof Function},$f=function(){let _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(mc&&mc===_)){if((!_||typeof _!="object")&&(_={}),_=Vs(_),$i=oY.indexOf(_.PARSER_MEDIA_TYPE)===-1?nY:_.PARSER_MEDIA_TYPE,ro=$i==="application/xhtml+xml"?$p:_u,rt=Jn(_,"ALLOWED_TAGS")?It({},_.ALLOWED_TAGS,ro):Ot,_t=Jn(_,"ALLOWED_ATTR")?It({},_.ALLOWED_ATTR,ro):so,Ff=Jn(_,"ALLOWED_NAMESPACES")?It({},_.ALLOWED_NAMESPACES,$p):tY,Df=Jn(_,"ADD_URI_SAFE_ATTR")?It(Vs(Xk),_.ADD_URI_SAFE_ATTR,ro):Xk,jk=Jn(_,"ADD_DATA_URI_TAGS")?It(Vs(Yk),_.ADD_DATA_URI_TAGS,ro):Yk,uc=Jn(_,"FORBID_CONTENTS")?It({},_.FORBID_CONTENTS,ro):Gk,yo=Jn(_,"FORBID_TAGS")?It({},_.FORBID_TAGS,ro):Vs({}),Oe=Jn(_,"FORBID_ATTR")?It({},_.FORBID_ATTR,ro):Vs({}),lc=Jn(_,"USE_PROFILES")?_.USE_PROFILES:!1,xo=_.ALLOW_ARIA_ATTR!==!1,So=_.ALLOW_DATA_ATTR!==!1,jo=_.ALLOW_UNKNOWN_PROTOCOLS||!1,da=_.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Fn=_.SAFE_FOR_TEMPLATES||!1,cc=_.SAFE_FOR_XML!==!1,Us=_.WHOLE_DOCUMENT||!1,ic=_.RETURN_DOM||!1,gd=_.RETURN_DOM_FRAGMENT||!1,pd=_.RETURN_TRUSTED_TYPE||!1,kf=_.FORCE_BODY||!1,Uk=_.SANITIZE_DOM!==!1,Wk=_.SANITIZE_NAMED_PROPS||!1,Af=_.KEEP_CONTENT!==!1,Fi=_.IN_PLACE||!1,W=_.ALLOWED_URI_REGEXP||QT,dc=_.NAMESPACE||Ws,bd=_.MATHML_TEXT_INTEGRATION_POINTS||bd,vd=_.HTML_INTEGRATION_POINTS||vd,Ut=_.CUSTOM_ELEMENT_HANDLING||{},_.CUSTOM_ELEMENT_HANDLING&&Kk(_.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ut.tagNameCheck=_.CUSTOM_ELEMENT_HANDLING.tagNameCheck),_.CUSTOM_ELEMENT_HANDLING&&Kk(_.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ut.attributeNameCheck=_.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),_.CUSTOM_ELEMENT_HANDLING&&typeof _.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Ut.allowCustomizedBuiltInElements=_.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Fn&&(So=!1),gd&&(ic=!0),lc&&(rt=It({},qT),_t=[],lc.html===!0&&(It(rt,KT),It(_t,JT)),lc.svg===!0&&(It(rt,Ip),It(_t,Pp),It(_t,Ou)),lc.svgFilters===!0&&(It(rt,Bp),It(_t,Pp),It(_t,Ou)),lc.mathMl===!0&&(It(rt,Rp),It(_t,ZT),It(_t,Ou))),_.ADD_TAGS&&(rt===Ot&&(rt=Vs(rt)),It(rt,_.ADD_TAGS,ro)),_.ADD_ATTR&&(_t===so&&(_t=Vs(_t)),It(_t,_.ADD_ATTR,ro)),_.ADD_URI_SAFE_ATTR&&It(Df,_.ADD_URI_SAFE_ATTR,ro),_.FORBID_CONTENTS&&(uc===Gk&&
vendor: 3,032 bytes, line 30
30(uc=Vs(uc)),It(uc,_.FORBID_CONTENTS,ro)),Af&&(rt["#text"]=!0),Us&&It(rt,["html","head","body"]),rt.table&&(It(rt,["tbody"]),delete yo.tbody),_.TRUSTED_TYPES_POLICY){if(typeof _.TRUSTED_TYPES_POLICY.createHTML!="function")throw ii('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof _.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ii('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');C=_.TRUSTED_TYPES_POLICY,O=C.createHTML("")}else C===void 0&&(C=HN(p,s)),C!==null&&typeof O=="string"&&(O=C.createHTML(""));Mo&&Mo(_),mc=_}},qk=It({},[...Ip,...Bp,...AN]),Jk=It({},[...Rp,...DN]),rY=function(_){let j=x(_);(!j||!j.tagName)&&(j={namespaceURI:dc,tagName:"template"});const ut=_u(_.tagName),be=_u(j.tagName);return Ff[_.namespaceURI]?_.namespaceURI===fd?j.namespaceURI===Ws?ut==="svg":j.namespaceURI===hd?ut==="svg"&&(be==="annotation-xml"||bd[be]):!!qk[ut]:_.namespaceURI===hd?j.namespaceURI===Ws?ut==="math":j.namespaceURI===fd?ut==="math"&&vd[be]:!!Jk[ut]:_.namespaceURI===Ws?j.namespaceURI===fd&&!vd[be]||j.namespaceURI===hd&&!bd[be]?!1:!Jk[ut]&&(eY[ut]||!qk[ut]):!!($i==="application/xhtml+xml"&&Ff[_.namespaceURI]):!1},bs=function(_){ai(e.removed,{element:_});try{x(_).removeChild(_)}catch{v(_)}},gc=function(_,j){try{ai(e.removed,{attribute:j.getAttributeNode(_),from:j})}catch{ai(e.removed,{attribute:null,from:j})}if(j.removeAttribute(_),_==="is")if(ic||gd)try{bs(j)}catch{}else try{j.setAttribute(_,"")}catch{}},Zk=function(_){let j=null,ut=null;if(kf)_="<remove></remove>"+_;else{const Je=XT(_,/^[\r\n\t ]+/);ut=Je&&Je[0]}$i==="application/xhtml+xml"&&dc===Ws&&(_='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+_+"</body></html>");const be=C?C.createHTML(_):_;if(dc===Ws)try{j=new g().parseFromString(be,$i)}catch{}if(!j||!j.documentElement){j=F.createDocument(dc,"template",null);try{j.documentElement.innerHTML=Mf?O:be}catch{}}const wo=j.body||j.documentElement;return _&&ut&&wo.insertBefore(o.createTextNode(ut),wo.childNodes[0]||null),dc===Ws?B.call(j,Us?"html":"body")[0]:Us?j.documentElement:wo},Qk=function(_){return R.call(_.ownerDocument||_,_,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},If=function(_){return _ instanceof m&&(typeof _.nodeName!="string"||typeof _.textContent!="string"||typeof _.removeChild!="function"||!(_.attributes instanceof u)||typeof _.removeAttribute!="function"||typeof _.setAttribute!="function"||typeof _.namespaceURI!="string"||typeof _.insertBefore!="function"||typeof _.hasChildNodes!="function")},tA=function(_){return typeof c=="function"&&_ instanceof c};function Gs(gt,_,j){Cu(gt,ut=>{ut.call(e,_,j,mc)})}const eA=function(_){let j=null;if(Gs(N.beforeSanitizeElements,_,null),If(_))return bs(_),!0;const ut=ro(_.nodeName);if(Gs(N.uponSanitizeElement,_,{tagName:ut,allowedTags:rt}),cc&&_.hasChildNodes()&&!tA(_.firstElementChild)&&Fo(/<[/\w!]/g,_.innerHTML)&&Fo(/<[/\w!]/g,_.textContent)||_.nodeType===ui.progressingInstruction||
30cc&&_.nodeType===ui.comment&&Fo(/<[/\w]/g,_.data))return bs(_),!0;if(!rt[ut]||yo[ut]){if(!yo[ut]&&nA(ut)&&(Ut.tagNameCheck instanceof RegExp&&Fo(Ut.tagNameCheck,ut)||Ut.tagNameCheck instanceof Function&&Ut.tagNameCheck(ut)))return!1;if(Af&&!uc[ut]){const be=x(_)||_.parentNode,wo=y(_)||_.childNodes;if(wo&&be){const Je=wo.length;for(let Yo=Je-1;Yo>=0;--Yo){const js=b(wo[Yo],!0);js.__removalCount=(_.__removalCount||0)+1,be.insertBefore(js,f(_))}}}return bs(_),!0}return _ instanceof i&&!rY(_)||(ut==="noscript"||ut==="noembed"||ut==="noframes")&&Fo(/<\/no(script|embed|frames)/i,_.innerHTML)?(bs(_),!0):(Fn&&_.nodeType===ui.text&&(j=_.textContent,Cu([lt,Q,ot],be=>{j=ci(j,be," ")}),_.textContent!==j&&(ai(e.removed,{element:_.cloneNode()}),_.textContent=j)),Gs(N.afterSanitizeElements,_,null),!1)},oA=function(_,j,ut){if(Uk&&(j==="id"||j==="name")&&(ut in o||ut in sY))return!1;if(!(So&&!Oe[j]&&Fo(H,j))){if(!(xo&&Fo(k,j))){if(!_t[j]||Oe[j]){if(!(nA(_)&&(Ut.tagNameCheck instanceof RegExp&&Fo(Ut.tagNameCheck,_)||Ut.tagNameCheck instanceof Function&&Ut.tagNameCheck(_))&&(Ut.attributeNameCheck instanceof RegExp&&Fo(Ut.attributeNameCheck,j)||Ut.attributeNameCheck instanceof Function&&Ut.attributeNameCheck(j))||j==="is"&&Ut.allowCustomizedBuiltInElements&&(Ut.tagNameCheck instanceof RegExp&&Fo(Ut.tagNameCheck,ut)||Ut.tagNameCheck instanceof Function&&Ut.tagNameCheck(ut))))return!1}else if(!Df[j]){if(!Fo(W,ci(ut,K,""))){if(!((j==="src"||j==="xlink:href"||j==="href")&&_!=="script"&&_N(ut,"data:")===0&&jk[_])){if(!(jo&&!Fo(M,ci(ut,K,"")))){if(ut)return!1}}}}}}return!0},nA=function(_){return _!=="annotation-xml"&&XT(_,at)},sA=function(_){Gs(N.beforeSanitizeAttributes,_,null);const{attributes:j}=_;if(!j||If(_))return;const ut={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:_t,forceKeepAttr:void 0};let be=j.length;for(;be--;){const wo=j[be],{name:Je,namespaceURI:Yo,value:js}=wo,Ii=ro(Je),Bf=js;let To=Je==="value"?Bf:ON(Bf);if(ut.attrName=Ii,ut.attrValue=To,ut.keepAttr=!0,ut.forceKeepAttr=void 0,Gs(N.uponSanitizeAttribute,_,ut),To=ut.attrValue,Wk&&(Ii==="id"||Ii==="name")&&(gc(Je,_),To=Q7+To),cc&&Fo(/((--!?|])>)|<\/(style|title)/i,To)){gc(Je,_);continue}if(ut.forceKeepAttr)continue;if(!ut.keepAttr){gc(Je,_);continue}if(!da&&Fo(/\/>/i,To)){gc(Je,_);continue}Fn&&Cu([lt,Q,ot],aA=>{To=ci(To,aA," ")});const rA=ro(_.nodeName);if(!oA(rA,Ii,To)){gc(Je,_);continue}if(C&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!Yo)switch(p.getAttributeType(rA,Ii)){case"TrustedHTML":{To=C.createHTML(To);break}case"TrustedScriptURL":{To=C.createScriptURL(To);break}}if(To!==Bf)try{Yo?_.setAttributeNS(Yo,Je,To):_.setAttribute(Je,To),If(_)?bs(_):YT(e.removed)}catch{gc(Je,_)}}Gs(N.afterSanitizeAttributes,_,null)},aY=function gt(_){let j=null;const ut=Qk(_);for(Gs(N.beforeSanitizeShadowDOM,_,null);j=ut.nextNode();)Gs(N.uponSanitizeShadowNode,j,null),eA(j),sA(j),j.content instanceof r&&gt(j.content);Gs(N.afterSanitizeShadowDOM,_,null)};return e.sanitize=function(gt){let _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},j=null,ut=null,be=null,wo=null;if(Mf=!gt,Mf&&(gt="<!-->"),typeof gt!="string"&&!tA(gt))if(typeof gt.toString=="function"){if(gt=gt.toString(),typeof gt!="string")throw ii("dirty is not a string, aborting")}else throw ii("toString is not a function");if(!e.isSupported)return gt;if(Mi||$f(_),e.removed=[],typeof gt=="string"&&(Fi=!1),Fi){if(gt.nodeName){const js=ro(gt.nodeName);if(!rt[js]||yo[js])throw ii("root node is forbidden and cannot be sanitized in-place")}}else if(gt instanceof c)j=Zk("<!---->"),ut=j.ownerDocument.importNode(gt,!0),ut.nodeType===ui.element&&ut.nodeName==="BODY"||ut.nodeName==="HTML"?j=ut:j.appendChild(ut);else{if(!ic&&!Fn&&!Us&&gt.indexOf("<")===-1)return C&&pd?C.createHTML(gt):gt;if(j=Zk(gt),!j)return ic?null:pd?O:""}j&&kf&&bs(j.firstChild);const Je=Qk(Fi?gt:j);for(;be=Je.nextNode();)eA(be),sA(be),be.content instanceof r&&aY(be.content);if(Fi)return gt;if(ic){if(gd)for(wo=S.call(j.ownerDocument);j.firstChild;)wo.appendChild(j.firstChild);else wo=j;return(_t.shadowroot||_t.shadowrootmode)&&(wo=G.call(n,wo,!0)),wo}let Yo=Us?j.outerHTML:j.innerHTML;return Us&&rt["!doctype"]&&j.ownerDocument&&j.ownerDocument.doctype&&j.ownerDocument.doctype.name&&Fo(tC,j.ownerDocument.doctype.name)&&(Yo="<!DOCTYPE "+j.ownerDocument.doctype.name+`>
31`+Yo),Fn&&Cu([lt,Q,ot],js=>{Yo=ci(Yo,js," ")}),C&&pd?C.createHTML(Yo):Yo},e.setConfig=function(){let gt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};$f(gt),Mi=!0},e.clearConfig=function(){mc=null,Mi=!1}
31,e.isValidAttribute=function(gt,_,j){mc||$f({});const ut=ro(gt),be=ro(_);return oA(ut,be,j)},e.addHook=function(gt,_){typeof _=="function"&&ai(N[gt],_)},e.removeHook=function(gt,_){if(_!==void 0){const j=TN(N[gt],_);return j===-1?void 0:CN(N[gt],j,1)[0]}return YT(N[gt])},e.removeHooks=function(gt){N[gt]=[]},e.removeAllHooks=function(){N=oC()},e}var NN=nC();const sC=t=>NN().sanitize(t);var on=tinymce.util.Tools.resolve("tinymce.util.I18n");const zN={indent:!0,outdent:!0,"table-insert-column-after":!0,"table-insert-column-before":!0,"paste-column-after":!0,"paste-column-before":!0,"unordered-list":!0,"list-bull-circle":!0,"list-bull-disc":!0,"list-bull-default":!0,"list-bull-square":!0},rC="temporary-placeholder",Lp=t=>()=>tt(t,rC).getOr("!not found!"),Vp=(t,e)=>{const o=t.toLowerCase();if(on.isRtl()){const n=PA(o,"-rtl");return At(e,n)?n:o}else return o},aC=(t,e)=>tt(e,Vp(t,e)),cC=(t,e)=>{const o=e();return aC(t,o).getOrThunk(Lp(o))},UN=(t,e,o)=>{const n=e();return aC(t,n).or(o).getOrThunk(Lp(n))},WN=t=>on.isRtl()?At(zN,t):!1,iC=()=>et("add-focusable",[Vt(t=>{Zd(t.element,"svg").each(e=>nt(e,"focusable","false"))})]),lC=(t,e,o,n)=>{var s,r;const a=WN(e)?["tox-icon--flip"]:[],c=tt(o,Vp(e,o)).or(n).getOrThunk(Lp(o));return{dom:{tag:t.tag,attributes:(s=t.attributes)!==null&&s!==void 0?s:{},classes:t.classes.concat(a),innerHtml:c},behaviours:D([...(r=t.behaviours)!==null&&r!==void 0?r:[],iC()])}},Go=(t,e,o,n=d.none())=>lC(e,t,o(),n),GN=(t,e,o)=>{const n=o(),s=ee(t,r=>At(n,Vp(r,n)));return lC(e,s.getOr(rC),n,d.none())},jN={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},Hp=Uo({name:"Notification",factory:t=>{const e=V("notification-text"),o=St({dom:Is(`<p id=${e}>${sC(t.backstageProvider.translate(t.text))}</p>`),behaviours:D([st.config({})])}),n=h=>({dom:{tag:"div",classes:["tox-bar"],styles:{width:`${h}%`}}}),s=h=>({dom:{tag:"div",classes:["tox-text"],innerHtml:`${h}%`}}),r=St({dom:{tag:"div",classes:t.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[n(0)]},s(0)],behaviours:D([st.config({})])}),i={updateProgress:(h,b)=>{h.getSystem().isConnected()&&r.getOpt(h).each(v=>{st.set(v,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[n(b)]},s(b)])})},updateText:(h,b)=>{if(h.getSystem().isConnected()){const v=o.get(h);st.set(v,[Nt(b)])}}},l=Ie([t.icon.toArray(),[t.level],d.from(jN[t.level]).toArray()]),u=St(Fe.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"],attributes:{"aria-label":t.backstageProvider.translate("Close")}},components:[Go("close",{tag:"span",classes:["tox-icon"]},t.iconProvider)],buttonBehaviours:D([Mt.config({}),zt.config({...t.backstageProvider.tooltips.getConfig({tooltipText:t.backstageProvider.translate("Close")})})]),action:h=>{t.onAction(h)}})),m=GN(l,{tag:"div",classes:["tox-notification__icon"]},t.iconProvider),g={dom:{tag:"div",classes:["tox-notification__body"]},components:[o.asSpec()],behaviours:D([st.config({})])},p=[m,g];return{uid:t.uid,dom:{tag:"div",attributes:{role:"alert","aria-labelledby":e},classes:["tox-notification","tox-notification--in",`tox-notification--${t.level}`]},behaviours:D([Mt.config({}),Z.config({}),U.config({mode:"special",onEscape:h=>(t.onAction(h),d.some(!0))})]),components:p.concat(t.progress?[r.asSpec()]:[]).concat([u.asSpec()]),apis:i}},configFields:[zn("level","info",["success","error","warning","warn","info"]),A("progress"),Tt("icon"),A("onAction"),A("text"),A("iconProvider"),A("backstageProvider")],apis:{updateProgress:(t,e,o)=>{t.updateProgress(e,o)},updateText:(t,e,o)=>{t.updateText(e,o)}}});var YN=(t,e,o,n)=>{const s=e.backstage.shared,r=()=>I.fromDom(t.queryCommandValue("ToggleView")===""?t.getContentAreaContainer():t.getContainer()),a=()=>{const m=Ae(r());return d.some(m)},c=m=>{a().each(g=>{q(m,p=>{wt(p.element,"width"),Co(p.element)>g.width&&ct(p.element,"width",g.width+"px")})})};return{open:(m,g,p)=>{const h=()=>{const x=R=>{st.remove(R,v),f()},C=(R,S)=>{Vn(R.element).length===0?O(R,S):F(R,S)},O=(R,S)=>
31{Yt.hide(R),n.clear(),S&&t.focus()},F=(R,S)=>{S&&U.focusIn(R)};n.on(R=>{g();const S=p();x(R),C(R,S)})},b=()=>!Xa(t)||!s.header.isPositionedAtTop(),v=Xe(Hp.sketch({text:m.text,level:le(["success","error","warning","warn","info"],m.type)?m.type:void 0,progress:m.progressBar===!0,icon:m.icon,onAction:h,iconProvider:s.providers.icons,backstageProvider:s.providers}));if(n.isSet()){const x=zo(v);n.on(C=>{st.append(C,x),Yt.reposition(C),v.hasConfigured(jt)&&jt.refresh(C),c(C.components())})}else{const x=Xe(Yt.sketch({dom:{tag:"div",classes:["tox-notifications-container"],attributes:{"aria-label":"Notifications",role:"region"}},lazySink:s.getSink,fireDismissalEventInstead:{},...s.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}},inlineBehaviours:D([U.config({mode:"cyclic",selector:".tox-notification, .tox-notification a, .tox-notification button"}),st.config({}),...b()?[jt.config({contextual:{lazyContext:()=>d.some(Ae(r())),fadeInClass:"tox-notification-container-dock-fadein",fadeOutClass:"tox-notification-container-dock-fadeout",transitionClass:"tox-notification-container-dock-transition"},modes:["top"],lazyViewport:R=>mr(t,R.element).map(B=>({bounds:Jr(B),optScrollEnv:d.some({currentScrollTop:B.element.dom.scrollTop,scrollElmTop:mn(B.element).top})})).getOrThunk(()=>({bounds:eo(),optScrollEnv:d.none()}))})]:[]])})),C=zo(v),O={maxHeightFunction:Fa()},F={...s.anchors.banner(),overrides:O};n.set(x),o.add(x),Yt.showWithinBounds(x,C,{anchor:F},a)}ns(m.timeout)&&m.timeout>0&&vu.setEditorTimeout(t,()=>{h()},m.timeout);const f=()=>{n.on(x=>{Yt.reposition(x),x.hasConfigured(jt)&&jt.refresh(x),c(x.components())})};return{close:h,reposition:f,text:x=>{Hp.updateText(v,x)},settings:m,getEl:()=>v.element.dom,progressBar:{value:x=>{Hp.updateProgress(v,x)}}}},close:m=>{m.close()},getArgs:m=>m.settings}};const XN={setup:(t,e)=>{const o=(s,r)=>{Y(s,Un(),{raw:r})},n=()=>t.getMenu().bind(Ct.getHighlighted);e.on("keydown",s=>{const r=s.which;t.isActive()&&(t.isMenuOpen()?r===13?(n().each(Rr),s.preventDefault()):r===40?(n().fold(()=>{t.getMenu().each(Ct.highlightFirst)},a=>{o(a,s)}),s.preventDefault(),s.stopImmediatePropagation()):(r===37||r===38||r===39)&&n().each(a=>{o(a,s),s.preventDefault(),s.stopImmediatePropagation()}):(r===13||r===38||r===40)&&t.cancelIfNecessary())}),e.on("NodeChange",()=>{t.isActive()&&!t.isProcessingAction()&&!e.queryCommandState("mceAutoCompleterInRange")&&t.cancelIfNecessary()})}};var Np;(function(t){t[t.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",t[t.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX"})(Np||(Np={}));var An=Np;const zp="tox-menu-nav__js",Eu="tox-collection__item",Up="tox-swatch",KN={normal:zp,color:Up},Wp="tox-collection__item--enabled",qN="tox-collection__group-heading",uC="tox-collection__item-icon",JN="tox-collection__item-image",ZN="tox-collection__item-image-selector",Gp="tox-collection__item-label",QN="tox-collection__item-accessory",dC="tox-collection__item-caret",tz="tox-collection__item-checkmark",Zr="tox-collection__item--active",mC="tox-collection__item-container",ez="tox-collection__item-container--column",gC="tox-collection__item-container--row",oz="tox-collection__item-container--align-right",nz="tox-collection__item-container--align-left",sz="tox-collection__item-container--valign-top",rz="tox-collection__item-container--valign-middle",az="tox-collection__item-container--valign-bottom",pC=t=>tt(KN,t).getOr(zp),cz=t=>t==="color"?"tox-swatches":"tox-menu",jp=t=>({backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:cz(t),tieredMenu:"tox-tiered-menu"}),gr=t=>{const e=jp(t);return{backgroundMenu:e.backgroundMenu,selectedMenu:e.selectedMenu,menu:e.menu,selectedItem:e.selectedItem,item:pC(t)}},iz=(t,e,o)=>{const n=jp(o);return{tag:"div",classes:Ie([[n.menu,`tox-menu-${e}-column`],t?[n.hasIcons]:[]])}},lz=[Rs.parts.items({})],ku=(t,e,o)=>{const n=jp(o);return{dom:{tag:"div",classes:Ie([[n.tieredMenu]])},markers:gr(o)}},hC=V("refetch-trigger-event"),fC=V("redirect-menu-item-interaction"),bC="tox-menu__searcher",Au=t=>Dt(t.element,`.${bC}`).bind(e=>t.getSystem().getByDom(e).toOptional()),vC=Au,uz=(t,e)=>{P.setValue(t,e.fetchPattern),t.element.dom.selectionStart=e.selectionStart,t.element.dom.selectionEnd=e.selectionEnd},yC=t=>{const e=P.getValue(t),o=t.element.dom.selectionStart,n=t.element.dom.selectionEnd;return{fetchPattern:e,selectionStart:o,selectionEnd:n}},dz=(t,e)=>{Pe(e.element,"id").each(o=>nt(t.element,"aria-activedescendant",o))},mz=t=>{const e=(s,r)=>(r.cut(),d.none()),o=(s,r)=>
31{const a={interactionEvent:r.event,eventType:r.event.raw.type};return Y(s,fC,a),d.some(!0)},n="searcher-events";return{dom:{tag:"div",classes:[Eu]},components:[Ps.sketch({inputClasses:[bC,"tox-textfield"],inputAttributes:{...t.placeholder.map(s=>({placeholder:t.i18n(s)})).getOr({}),type:"search","aria-autocomplete":"list"},inputBehaviours:D([et(n,[E(Es(),s=>{pt(s,hC)}),E(Un(),(s,r)=>{r.event.raw.key==="Escape"&&r.stop()})]),U.config({mode:"special",onLeft:e,onRight:e,onSpace:e,onEnter:o,onEscape:o,onUp:o,onDown:o})]),eventOrder:{keydown:[n,U.name()]}})]}},Du="tox-collection--results__js",xC=t=>{var e;return t.dom?{...t,dom:{...t.dom,attributes:{...(e=t.dom.attributes)!==null&&e!==void 0?e:{},id:V("aria-item-search-result-id"),"aria-selected":"false"}}}:t},Mu=(t,e)=>o=>{const n=Nf(o,e);return L(n,s=>({dom:t,components:s}))},gz=t=>({dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[Rs.parts.items({preprocess:t!=="auto"?Mu({tag:"div",classes:["tox-swatches__row"]},t):xt})]}]}),pz=t=>({dom:{tag:"div",classes:["tox-menu","tox-image-selector-menu"]},components:[{dom:{tag:"div",classes:["tox-image-selector"]},components:[Rs.parts.items({preprocess:t!=="auto"?Mu({tag:"div",classes:["tox-image-selector__row"]},t):xt})]}]}),hz=t=>({dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[Rs.parts.items({preprocess:Mu({tag:"div",classes:["tox-collection__group"]},t)})]}),SC=(t,e)=>{const o=[];let n=[];return q(t,(s,r)=>{e(s,r)?(n.length>0&&o.push(n),n=[],(At(s.dom,"innerHtml")||s.components&&s.components.length>0)&&n.push(s)):n.push(s)}),n.length>0&&o.push(n),L(o,s=>({dom:{tag:"div",classes:["tox-collection__group"]},components:s}))},Yp=(t,e,o)=>Rs.parts.items({preprocess:n=>{const s=L(n,o);return t!=="auto"&&t>1?Mu({tag:"div",classes:["tox-collection__group"]},t)(s):SC(s,(r,a)=>e[a].type==="separator")}}),wC=(t,e,o=!0)=>({dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(t===1?["tox-collection--list"]:["tox-collection--grid"])},components:[Yp(t,e,xt)]}),fz=(t,e,o=!0)=>{const n=V("aria-controls-search-results");return{dom:{tag:"div",classes:["tox-menu","tox-collection",Du].concat(t===1?["tox-collection--list"]:["tox-collection--grid"]),attributes:{id:n}},components:[Yp(t,e,xC)]}},bz=(t,e,o)=>{const n=V("aria-controls-search-results");return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(t===1?["tox-collection--list"]:["tox-collection--grid"])},components:[mz({i18n:on.translate,placeholder:o.placeholder}),{dom:{tag:"div",classes:[...t===1?["tox-collection--list"]:["tox-collection--grid"],Du],attributes:{id:n}},components:[Yp(t,e,xC)]}]}},vz=(t,e=!0)=>({dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[Rs.parts.items({preprocess:o=>SC(o,(n,s)=>t[s].type==="separator")})]}),di=t=>Ko(t,e=>"icon"in e&&e.icon!==void 0),Zn=t=>(console.error(ka(t)),console.log(t),d.none()),yz=(t,e,o,n,s)=>{const r=vz(o);return{value:t,dom:r.dom,components:r.components,items:o}},Xp=(t,e,o,n,s)=>{const r=()=>s.menuType!=="searchable"?wC(n,o):s.searchMode.searchMode==="search-with-field"?bz(n,o,s.searchMode):fz(n,o);if(s.menuType==="color"){const a=gz(n);return{value:t,dom:a.dom,components:a.components,items:o}}else if(s.menuType==="imageselector"&&n!=="auto"){const a=pz(n);return{value:t,dom:a.dom,components:a.components,items:o}}else if(s.menuType==="normal"&&n==="auto"){const a=wC(n,o);return{value:t,dom:a.dom,components:a.components,items:o}}else if(s.menuType==="normal"||s.menuType==="searchable"){const a=r();return{value:t,dom:a.dom,components:a.components,items:o}}else if(s.menuType==="listpreview"&&n!=="auto"){const a=hz(n);return{value:t,dom:a.dom,components:a.components,items:o}}else return{value:t,dom:iz(e,n,s.menuType),components:lz,items:o}},qt=de("type"),Kp=de("name"),Fu=de("label"),Hs=de("text"),TC=de("title"),qp=de("icon"),xz=de("url"),Ka=de("value"),CC=bn("fetch"),Sz=bn("getSubmenuItems"),Qr=bn("onAction"),wz=bn("onItemAction"),ta=Lt("onSetup",()=>$),Tz=ae("name"),pr=ae("text"),Cz=ae("role"),nn=ae("icon"),ea=ae("tooltip"),mi=ae("label"),Jp=ae("shortcut"),_z=is("select"),qa=je("active",!1),Oz=je("borderless",!1),Dn=je("enabled",!0),$u=je("primary",!1),Zp=t=>T("columns",t),Qp=T("meta",{}),th=Lt("onAction",$),oa=t=>Kt("type",t),eh=t=>Ve("name","name",ol(()=>V(`${t}-name`)),ue),Ez=t=>Ve("value","value",ol(()=>V(`${t}-value`)),pn()),kz=[qt,Hs,fn("level",["info","warn","error","success"]),qp,T("url","")],Az=J(kz),Dz=t=>[qt,t],Mz=[qt,Hs,Dn,eh("button"),nn,Oz,$v("buttonType",["primary","secondary","toolbar"]),$u,Kt("context","mode:design")],Fz=J(Mz),Ja=[qt,Kp],Qn=Ja.concat([mi]),$z=Ja.concat([Fu,Dn,Kt("context","mode:design")]),Iz=J($z),Bz=el,Rz=Qn.concat([Zp("auto"),Kt("context","mode:design")]),Pz=J(Rz),Lz=rl([Ka,Hs,qp]),Vz=Qn.concat([Kt("storageKey","default"),Kt("context","mode:design")]),Hz=J(Vz),Nz=ue,zz=J(Qn),Uz=ue,Wz=Ja.concat([Kt("tag","textarea"),de("scriptId"),de("scriptUrl"),is("onFocus"),x1("settings",void 0)]),Gz=Ja.concat([Kt("tag","textarea"),bn("init")]),jz=Ec(t=>Xt("customeditor.old",Po(Gz),t).orThunk(()=>Xt("customeditor.new",Po(Wz),t))),Yz=ue,hr=[Dn,pr,Cz,Jp,Ez("menuitem"),Qp,Kt("context","mode:design")],Xz=J([qt,Kp].concat(hr)),Kz=el,oh=[eh("button"),nn,zn("align","end",["start","end"]),$u,Dn,$v("buttonType",["primary","secondary"]),Kt("context","mode:design")],_C=[...oh,Hs],nh=[fn("type",["
31submit","cancel","custom"]),..._C],qz=[fn("type",["menu"]),pr,ea,nn,_o("items",Xz),...oh],Jz=[...oh,fn("type",["togglebutton"]),ea,nn,pr,je("active",!1)],Zz=fo("type",{submit:nh,cancel:nh,custom:nh,menu:qz,togglebutton:Jz}),Qz=Qn.concat([Kt("context","mode:design")]),tU=J(Qz),eU=f1(),oU=t=>[qt,Mv("columns"),t],nU=[qt,de("html"),zn("presets","presentation",["presentation","document"]),Lt("onInit",$),je("stretched",!1)],sU=J(nU),rU=Qn.concat([je("border",!1),je("sandboxed",!0),je("streamContent",!1),je("transparent",!0)]),aU=J(rU),cU=ue,iU=J(Ja.concat([ae("height")])),lU=J([de("url"),kc("zoom"),kc("cachedWidth"),kc("cachedHeight")]),uU=Qn.concat([ae("inputMode"),ae("placeholder"),je("maximized",!1),Dn,Kt("context","mode:design")]),dU=J(uU),mU=ue,gU=t=>[qt,Fu,t,zn("align","start",["start","center","end"]),ae("for")],pU=[Hs,Ka],hU=[Hs,_o("items",Dv("items",()=>OC))],OC=sl([J(pU),J(hU)]),fU=Qn.concat([_o("items",OC),Dn,Kt("context","mode:design")]),bU=J(fU),vU=ue,yU=Qn.concat([Fv("items",[Hs,Ka]),Ac("size",1),Dn,Kt("context","mode:design")]),xU=J(yU),SU=ue,wU=Qn.concat([je("constrain",!0),Dn,Kt("context","mode:design")]),TU=J(wU),EC=J([de("width"),de("height")]),CU=Ja.concat([Fu,Ac("min",0),Ac("max",0)]),_U=J(CU),OU=tl,EU=[qt,_o("header",ue),_o("cells",Js(ue))],kU=J(EU),AU=Qn.concat([ae("placeholder"),je("maximized",!1),Dn,Kt("context","mode:design")]),DU=J(AU),MU=ue,FU=[Kt("buttonType","default"),ae("text"),ae("tooltip"),ae("icon"),Qo("search",!1,sl([el,J([ae("placeholder")])],t=>ys(t)?t?d.some({placeholder:d.none()}):d.none():d.some(t))),bn("fetch"),Lt("onSetup",()=>$),Kt("context","mode:design")],kC=J([qt,...FU]),AC=t=>Xt("menubutton",kC,t),DC=[fn("type",["directory","leaf"]),TC,de("id"),cs("menu",kC),ae("customStateIcon"),ae("customStateIconTooltip")],MC=J(DC),$U=DC.concat([_o("children",Dv("children",()=>Ea("type",{directory:FC,leaf:MC})))]),FC=J($U),IU=Ea("type",{directory:FC,leaf:MC}),BU=[qt,_o("items",IU),is("onLeafAction"),is("onToggleExpand"),_s("defaultExpandedIds",[],ue),ae("defaultSelectedId")],RU=J(BU),PU=Qn.concat([zn("filetype","file",["image","media","file"]),Dn,ae("picker_text"),Kt("context","mode:design")]),LU=J(PU),VU=J([Ka,Qp]),sh=t=>Ve("items","items",Nn(),Js(Ec(e=>Xt(`Checking item of ${t}`,rh,e).fold(o=>mt.error(ka(o)),o=>mt.value(o))))),rh=kv(()=>Ea("type",{alertbanner:Az,bar:J(Dz(sh("bar"))),button:Fz,checkbox:Iz,colorinput:Hz,colorpicker:zz,dropzone:tU,grid:J(oU(sh("grid"))),iframe:aU,input:dU,listbox:bU,selectbox:xU,sizeinput:TU,slider:_U,textarea:DU,urlinput:LU,customeditor:jz,htmlpanel:sU,imagepreview:iU,collection:Pz,label:J(gU(sh("label"))),table:kU,tree:RU,panel:$C})),HU=[qt,T("classes",[]),_o("items",rh)],$C=J(HU),NU=[eh("tab"),TC,_o("items",rh)],zU=[qt,Fv("tabs",NU)],UU=J(zU),WU=_C,GU=Zz,jU=J([de("title"),Lo("body",Ea("type",{panel:$C,tabpanel:UU})),Kt("size","normal"),_s("buttons",[],GU),T("initialData",{}),Lt("onAction",$),Lt("onChange",$),Lt("onSubmit",$),Lt("onClose",$),Lt("onCancel",$),Lt("onTabChange",$)]),YU=t=>Xt("dialog",jU,t),XU=J([fn("type",["cancel","custom"]),...WU]),KU=J([de("title"),de("url"),kc("height"),kc("width"),Iv("buttons",XU),Lt("onAction",$),Lt("onCancel",$),Lt("onClose",$),Lt("onMessage",$)]),qU=t=>Xt("dialog",KU,t),ah=t=>Ys(t)?[t].concat(ye(Ad(t),ah)):vs(t)?ye(t,ah):[],JU=t=>Et(t.type)&&Et(t.name),ZU={checkbox:Bz,colorinput:Nz,colorpicker:Uz,dropzone:eU,input:mU,iframe:cU,imagepreview:lU,selectbox:SU,sizeinput:EC,slider:OU,listbox:vU,size:EC,textarea:MU,urlinput:VU,customeditor:Yz,collection:Lz,togglemenuitem:Kz},QU=t=>d.from(ZU[t.type]),tW=t=>Wt(ah(t),JU),eW=t=>{const e=tW(t),o=ye(e,n=>QU(n).fold(()=>[],s=>[Lo(n.name,s)]));return J(o)},IC=t=>{var e;const o=hn(YU(t)),n=eW(t),s=(e=t.initialData)!==null&&e!==void 0?e:{};return{internalDialog:o,dataValidator:n,initialData:s}},na={open:(t,e)=>{const o=IC(e);return t(o.internalDialog,o.initialData,o.dataValidator)},openUrl:(t,e)=>{const o=hn(qU(e));return t(o)},redial:t=>IC(t)},BC=J([qt,pr]),oW=t=>Xt("separatormenuitem",BC,t),nW=J([oa("autocompleteitem"),qa,Dn,Qp,Ka,pr,nn]);J([qt,de("trigger"),Ac("minChars",1),Zp(1),Ac("maxResults",10),is("matches"),CC,Qr,_s("highlightOn",[],ue)]
31);const sW=t=>Xt("Autocompleter.Separator",BC,t),rW=t=>Xt("Autocompleter.Item",nW,t),Za=[Dn,ea,nn,pr,ta,Kt("context","mode:design")],aW=J([qt,Qr,Jp].concat(Za)),ch=t=>Xt("toolbarbutton",aW,t),ih=[qa].concat(Za),cW=J(ih.concat([qt,Qr,Jp])),RC=t=>Xt("ToggleButton",cW,t),Iu=[Lt("predicate",Pt),zn("scope","node",["node","editor"]),zn("position","selection",["node","selection","line"])],iW=Za.concat([oa("contextformbutton"),Kt("align","end"),$u,Qr,lo("original",xt)]),lW=ih.concat([oa("contextformbutton"),Kt("align","end"),$u,Qr,lo("original",xt)]),uW=Za.concat([oa("contextformbutton")]),dW=ih.concat([oa("contextformtogglebutton")]),mW=fo("type",{contextformbutton:iW,contextformtogglebutton:lW}),lh=[mi,_o("commands",mW),cs("launch",fo("type",{contextformbutton:uW,contextformtogglebutton:dW})),Lt("onInput",$),Lt("onSetup",$)],gW=[...Iu,...lh,fn("type",["contextform"]),Lt("initValue",w("")),ae("placeholder")],pW=[...Iu,...lh,fn("type",["contextsliderform"]),Lt("initValue",w(0)),Lt("min",w(0)),Lt("max",w(100))],hW=[...Iu,...lh,fn("type",["contextsizeinputform"]),Lt("initValue",w({width:"",height:""}))],fW=fo("type",{contextform:gW,contextsliderform:pW,contextsizeinputform:hW}),bW=t=>Xt("ContextForm",fW,t),vW=Za.concat([oa("contexttoolbarbutton")]),yW=J([oa("contexttoolbar"),Oo("launch",vW),Lo("items",sl([ue,rl([ae("name"),ae("label"),_o("items",ue)])]))].concat(Iu)),xW=t=>({name:t.name.getOrUndefined(),label:t.label.getOrUndefined(),items:t.items}),SW=t=>({...t,launch:t.launch.getOrUndefined(),items:Et(t.items)?t.items:L(t.items,xW)}),wW=t=>Xt("ContextToolbar",yW,t),TW=[qt,de("src"),ae("alt"),_s("classes",[],ue)],CW=J(TW),_W=[qt,Hs,Tz,_s("classes",["tox-collection__item-label"],ue)],OW=J(_W),PC=kv(()=>Ea("type",{cardimage:CW,cardtext:OW,cardcontainer:EW})),EW=J([qt,Kt("direction","horizontal"),Kt("align","left"),Kt("valign","middle"),_o("items",PC)]),kW=J([qt,mi,_o("items",PC),ta,th].concat(hr)),AW=t=>Xt("cardmenuitem",kW,t),DW=J([qt,qa,nn,mi].concat(hr)),MW=t=>Xt("choicemenuitem",DW,t),uh=[qt,de("fancytype"),th],FW=[T("initData",{})].concat(uh),$W=[is("select"),mm("initData",{},[je("allowCustomColors",!0),Kt("storageKey","default"),Iv("colors",pn())])].concat(uh),IW=[is("select"),Cs("initData",[Mv("columns"),_s("items",[],pn())])].concat(uh),BW=fo("fancytype",{inserttable:FW,colorswatch:$W,imageselect:IW}),RW=t=>Xt("fancymenuitem",BW,t),PW=J([qt,qa,xz,mi,ea].concat(hr)),LW=J([qt,qa,qp,Fu,ea,Ka].concat(hr)),VW=t=>Xt("imagemenuitem",PW,t),HW=t=>Xt("resetimageitem",LW,t),NW=J([qt,ta,th,nn].concat(hr)),zW=t=>Xt("menuitem",NW,t),UW=J([qt,Sz,ta,nn].concat(hr)),WW=t=>Xt("nestedmenuitem",UW,t),GW=J([qt,nn,qa,ta,Qr].concat(hr)),jW=t=>Xt("togglemenuitem",GW,t),YW=J([nn,ea,Lt("onShow",$),Lt("onHide",$),ta]),XW=t=>Xt("sidebar",YW,t),KW=J([qt,Lo("items",sl([rl([Kp,_o("items",ue)]),ue]))].concat(Za)),qW=t=>Xt("GroupToolbarButton",KW,t),JW=J([qt,ea,nn,pr,_z,CC,ta,zn("presets","normal",["normal","color","listpreview"]),Zp(1),Qr,wz,Kt("context","mode:design")]),ZW=t=>Xt("SplitButton",JW,t),LC=[pr,nn,ae("tooltip"),zn("buttonType","secondary",["primary","secondary"]),je("borderless",!1),bn("onAction"),Kt("context","mode:design")],QW=[...LC,Hs,fn("type",["button"])],t3=[...LC,je("active",!1),fn("type",["togglebutton"])],VC={button:QW,togglebutton:t3},e3=[fn("type",["group"]),_s("buttons",[],fo("type",VC))],o3=fo("type",{...VC,group:e3}),n3=J([_s("buttons",[],o3),bn("onShow"),bn("onHide")]),s3=t=>Xt("view",n3,t),dh=(t,e,o)=>{const n=io(t.element,"."+o);if(n.length>0){const s=ha(n,r=>{const a=r.dom.getBoundingClientRect().top,c=n[0].dom.getBoundingClientRect().top;return Math.abs(a-c)>e}).getOr(n.length);return d.some({numColumns:s,numRows:Math.ceil(n.length/s)})}else return d.none()},HC=(t,e)=>D([et(t,e)]),gi={namedEvents:HC,unnamedEvents:t=>HC(V("unnamed-events"),t)},sn={item:t=>z.config({disabled:t,disableClass:"tox-collection__item--state-disabled"}),button:t=>z.config({disabled:t}),splitButton:t=>z.config({disabled:t,disableClass:"tox-tbtn--disabled"}),toolbarButton:t=>z.config({disabled:t,disableClass:"tox-tbtn--disabled",useNative:!1})},pi=(t,e)=>{const o=t.getApi(e);return n=>{n(o)}},ts=(t,e)=>Vt(o=>{Xo(t.onBeforeSetup)&&t.onBeforeSetup(o),pi(t,o)(s=>{const r=t.onSetup(s);Xo(r)&&e.set(r)})}),fr=(t,e)=>jn(o=>pi(t,o)(e.get())),mh=(t,e,o)=>jn(n=>(o.set(P.getValue(n)),pi(t,n)(e.get()))),NC="silver.uistate",hi="setDisabled",r3="setEnabled",zC="init",a3=["switchmode",zC],fi=(t,e)=>{const o=t.mainUi.outerContainer,n=[t.mainUi.mothership,...t.uiMotherships];e===hi&&q(n,s=>{s.broadcastOn([Bs()],{target:o.element})}),q(n,s=>{s.broadcastOn([NC],e)})},UC=(t,e)=>{t.on("init SwitchMode",o=>{fi(e,o.type)}),t.on("DisabledStateChange",o=>{if(!o.isDefaultPrevented()){const n=o.state?hi:zC;fi(e,n),o.state||t.nodeChanged()}}),t.on("NodeChange",o=>{const n=t.ui.isEnabled()?o.type:hi;fi(e,n)}),uT(t)&&t.mode.set("readonly")},re=t=>Ao.config({channels:{[NC]:{onReceive:(e,o)=>{if(o===hi||o===r3){z.set(e,o===hi);return}const{contextType:n,shouldDisable:s}=t();n==="mode"&&!le(a3,o)||z.set(e,s)}}}}),c3=(t,e)=>As((o,n)=>{pi(t,o)(t.onAction),!t.triggersSubmenu&&e===An.CLOSE_ON_EXECUTE&&(o.getSystem().isConnected()&&pt(o,il()),n.stop())}),i3={[Ho()]:["disabling","alloy.base.behaviour","toggling","item-events"]},Qa=wr,sa=(t,e,o,n)=>{const s=X($);return{type:"item",dom:e.dom,components:Qa(e.optComponents),data:t.data,eventOrder:i3,hasSubmenu:t.triggersSubmenu,itemBehaviours:D([et("item-events",[c3(t,o),ts(t,s),fr(t,s)]),sn.item(()=>!t.enabled||n.checkUiComponentContext(t.context).shouldDisable),re(()=>n.checkUiComponentContext(t.context)),st.config({})].concat(t.itemBehaviours))}},ra=t=>({value:t.value,meta:{text:t.text.getOr(""),...t.meta}}),l3=(t,e)=>{var o,n;const s=I.fromTag("div");ne(s,"tox-image-selector-loading-spinner");const r=c=>{ne(c,"tox-image-selector-loading-spinner-wrapper"),qo(c,s)},a=c=>{Qt(c,"tox-image-selector-loading-spinner-wrapper"),rs(s)};return{dom:{tag:t.tag,attributes:(o=t.attributes)!==null&&o!==void 0?o:{},classes:t.classes},components:[{dom:{tag:"div",classes:["tox-image-selector-image-wrapper"]},components:[{dom:{tag:"img",attributes:{src:e},classes:["tox-image-selector-image-img"]}}]},...t.checkMark.toArray()],behaviours:D([...(n=t.behaviours)!==null&&n!==void 0?n:[],et("render-image-events",[Vt(c=>{r(c.element),Dt(c.element,"img").each(i=>{Kb(i).catch(l=>{console.error(l)}).finally(()=>{a(c.element)})})})])])}},u3=(t,e)=>l3(e,t),gh=t=>{const e=Ga.os.isMacOS()||Ga.os.isiOS(),s=e?{alt:"\u2325",ctrl:"\u2303",shift:"\u21E7",meta:"\u2318",access:"\u2303\u2325"}:{meta:"Ctrl",access:"Shift+Alt"},r=t.split("+"),a=L(r,c=>{const i=c.toLowerCase().trim();return At(s,i)?s[i]:c});return e?a.join(""):a.join("+")}
31,ph=(t,e,o=[uC])=>Go(t,{tag:"div",classes:o},e),WC=t=>({dom:{tag:"div",classes:[Gp]},components:[Nt(on.translate(t))]}),GC=(t,e)=>({dom:{tag:"div",classes:e,innerHtml:t}}),d3=(t,e)=>({dom:{tag:"div",classes:[Gp]},components:[{dom:{tag:t.tag,styles:t.styles},components:[Nt(on.translate(e))]}]}),m3=t=>({dom:{tag:"div",classes:[QN]},components:[Nt(gh(t))]}),hh=t=>ph("checkmark",t,[tz]),g3=t=>ph("chevron-right",t,[dC]),p3=t=>ph("chevron-down",t,[dC]),h3=(t,e)=>{const o=t.direction==="vertical"?ez:gC,n=t.align==="left"?nz:oz;return{dom:{tag:"div",classes:[mC,o,n,(()=>{switch(t.valign){case"top":return sz;case"middle":return rz;case"bottom":return az}})()]},components:e}},f3=(t,e,o)=>({dom:{tag:"img",classes:e,attributes:{src:t,alt:o.getOr("")}}}),b3=(t,e,o)=>{const n="custom",s="remove",r=t.value,a=t.iconContent.map(l=>UN(l,e.icons,o)),c=t.ariaLabel.map(l=>({"aria-label":e.translate(l),"data-mce-name":l})).getOr({});return{dom:(()=>{const l=Up,u=a.getOr(""),m={tag:"div",attributes:c,classes:[l]};return r===n?{...m,tag:"button",classes:[...m.classes,"tox-swatches__picker-btn"],innerHtml:u}:r===s?{...m,classes:[...m.classes,"tox-swatch--remove"],innerHtml:u}:$e(r)?{...m,attributes:{...m.attributes,"data-mce-color":r},styles:{"background-color":r},innerHtml:u}:m})(),optComponents:[]}},fh=(t,e)=>{const o=t.map(n=>({attributes:{id:V("menu-item"),"aria-label":on.translate(n)}})).getOr({});return{tag:"div",classes:[zp,Eu].concat(e),...o}},jC=t=>({dom:{tag:"label"},components:[Nt(t)]}),v3=(t,e,o,n)=>{const s={tag:"div",classes:[uC]},r=g=>Go(g,s,e.icons,n),a=()=>d.some({dom:s}),c=o?t.iconContent.map(r).orThunk(a):d.none(),i=t.checkMark,l=d.from(t.meta).fold(()=>WC,g=>At(g,"style")?mo(d3,g.style):WC),u=t.htmlContent.fold(()=>t.textContent.map(l),g=>d.some(GC(g,[Gp])));return{dom:fh(t.ariaLabel,[]),optComponents:[c,u,t.shortcutContent.map(m3),i,t.caret,t.labelContent.map(jC)]}},y3=t=>({dom:fh(t.ariaLabel,[ZN]),optComponents:[d.some(u3(t.iconContent.getOrDie(),{tag:"div",classes:[JN],checkMark:t.checkMark})),t.labelContent.map(jC)]}),tc=(t,e,o,n=d.none())=>t.presets==="color"?b3(t,e,n):t.presets==="img"?y3(t):v3(t,e,o,n),YC=(t,e,o)=>tt(t,"tooltipWorker").map(n=>[zt.config({lazySink:e.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:s=>({type:"submenu",item:s,overrides:{maxHeightFunction:Fa}}),mode:"follow-highlight",onShow:(s,r)=>{n(a=>{zt.setComponents(s,[Ax({element:I.fromDom(a)})])})}})]).getOrThunk(()=>o.map(n=>[zt.config({...e.providers.tooltips.getConfig({tooltipText:n}),mode:"follow-highlight"})]).getOr([])),x3=t=>oi.DOM.encode(t),XC=(t,e)=>{const o=on.translate(t),n=x3(o);if(e.length>0){const s=new RegExp(MA(e),"gi");return n.replace(s,r=>`<span class="tox-autocompleter-highlight">${r}</span>`)}else return n},S3=(t,e,o,n,s,r,a,c=!0)=>{const i=tc({presets:n,textContent:d.none(),htmlContent:o?t.text.map(u=>XC(u,e)):d.none(),ariaLabel:t.text,labelContent:d.none(),iconContent:t.icon,shortcutContent:d.none(),checkMark:d.none(),caret:d.none(),value:t.value},a.providers,c,t.icon),l=t.text.filter(u=>!o&&u!=="");return sa({context:"mode:design",data:ra(t),enabled:t.enabled,getApi:w({}),onAction:u=>s(t.value,t.meta),onSetup:w($),triggersSubmenu:!1,itemBehaviours:YC(t,a,l)},i,r,a.providers)},KC=(t,e)=>L(t,o=>{switch(o.type){case"cardcontainer":return h3(o,KC(o.items,e));case"cardimage":return f3(o.src,o.classes,o.alt);case"cardtext":const s=o.name.exists(r=>le(e.cardText.highlightOn,r))?d.from(e.cardText.matchText).getOr(""):"";return GC(XC(o.text,s),o.classes)}}),w3=(t,e,o,n)=>{const s=a=>({isEnabled:()=>!z.isDisabled(a),setEnabled:c=>{z.set(a,!c),q(io(a.element,"*"),i=>{a.getSystem().getByDom(i).each(l=>{l.hasConfigured(z)&&z.set(l,!c)})})}}),r={dom:fh(t.label,[]),optComponents:[d.some({dom:{tag:"div",classes:[mC,gC]},components:KC(t.items,n)})]};return sa({context:"mode:design",data:ra({text:d.none(),...t}),enabled:t.enabled,getApi:s,onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:d.from(n.itemBehaviours).getOr([])},r,e,o.providers)},qC=(t,e,o,n,s,r,a,c=!0)=>{const i=m=>({setActive:g=>{it.set(m,g)},isActive:()=>it.isOn(m),isEnabled:()=>!z.isDisabled(m),setEnabled:g=>z.set(m,!g)}),l=tc({presets:o,textContent:e?t.text:d.none(),htmlContent:d.none(),labelContent:t.label,ariaLabel:t.text,iconContent:t.icon,shortcutContent:e?t.shortcut:d.none(),checkMark:e?d.some(hh(a.icons)):d.none(),caret:d.none(),value:t.value},a,c),u=t.text.filter(w(!e)).map(m=>zt.config(a.tooltips.getConfig({tooltipText:a.translate(m)})));return Jt(sa({context:t.context,data:ra(t),enabled:t.enabled,getApi:i,onAction:m=>n(t.value),onSetup:m=>(m.setActive(s),$),triggersSubmenu:!1,itemBehaviours:[...u.toArray()]},l,r,a),{toggling:{toggleClass:Wp,toggleOnExecute:!1,selected:t.active,exclusive:!0}})},JC=t=>({value:e_(t)}),ZC=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,QC=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,t_=t=>ZC.test(t)||QC.test(t),e_=t=>nb(t,"#").toUpperCase(),T3=t=>t_(t)?d.some({value:e_(t)}):d.none(),C3=t=>({value:t.value.replace(ZC,(o,n,s,r)=>n+n+s+s+r+r)}),_3=t=>{const e=C3(t),o=QC.exec(e.value);return o===null?["FFFFFF","FF","FF","FF"]:o},bh=t=>{const e=t.toString(16);return(e.length===1?"0"+e:e).toUpperCase()},bi=t=>{const e=bh(t.red)+bh(t.green)+bh(t.blue);return JC(e)},vi=(t,e,o)=>({hue:t,saturation:e,value:o}),vh=t=>{let e=0,o=0,n=0;const s=t.red/255,r=t.green/255,a=t.blue/255,c=Math.min(s,Math.min(r,a)),i=Math.max(s,Math.max(r,a));if(c===i)return n=c,vi(0,0,n*100);const l=s===c?r-a:a===c?s-r:a-s;return e=s===c?3:a===c?1:5,e=60*(e-l/(i-c)),o=(i-c)/i,n=i,vi(Math.round(e),Math.round(o*100),Math.round(n*100))}
31,o_=Math.min,n_=Math.max,Bu=Math.round,O3=/^\s*rgb\s*\(\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*(\d+)\s*\)\s*$/i,E3=/^\s*rgba\s*\(\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*((?:\d?\.\d+|\d+)%?)\s*\)\s*$/i,aa=(t,e,o,n)=>({red:t,green:e,blue:o,alpha:n}),yh=t=>{const e=parseInt(t,10);return e.toString()===t&&e>=0&&e<=255},s_=t=>{let e,o,n;const s=(t.hue||0)%360;let r=t.saturation/100,a=t.value/100;if(r=n_(0,o_(r,1)),a=n_(0,o_(a,1)),r===0)return e=o=n=Bu(255*a),aa(e,o,n,1);const c=s/60,i=a*r,l=i*(1-Math.abs(c%2-1)),u=a-i;switch(Math.floor(c)){case 0:e=i,o=l,n=0;break;case 1:e=l,o=i,n=0;break;case 2:e=0,o=i,n=l;break;case 3:e=0,o=l,n=i;break;case 4:e=l,o=0,n=i;break;case 5:e=i,o=0,n=l;break;default:e=o=n=0}return e=Bu(255*(e+u)),o=Bu(255*(o+u)),n=Bu(255*(n+u)),aa(e,o,n,1)},yi=t=>{const e=_3(t),o=parseInt(e[1],16),n=parseInt(e[2],16),s=parseInt(e[3],16);return aa(o,n,s,1)},r_=(t,e,o,n)=>{const s=parseInt(t,10),r=parseInt(e,10),a=parseInt(o,10),c=parseFloat(n);return aa(s,r,a,c)},xh=t=>{const e=O3.exec(t);if(e!==null)return d.some(r_(e[1],e[2],e[3],"1"));const o=E3.exec(t);return o!==null?d.some(r_(o[1],o[2],o[3],o[4])):d.none()},a_=t=>`rgba(${t.red},${t.green},${t.blue},${t.alpha})`,c_=aa(255,0,0,1),k3=t=>vh(yi(t)),i_=t=>bi(s_(t)),A3=t=>T3(t).orThunk(()=>xh(t).map(bi)).getOrThunk(()=>{const e=document.createElement("canvas");e.height=1,e.width=1;const o=e.getContext("2d");o.clearRect(0,0,e.width,e.height),o.fillStyle="#FFFFFF",o.fillStyle=t,o.fillRect(0,0,1,1);const n=o.getImageData(0,0,1,1).data,s=n[0],r=n[1],a=n[2],c=n[3];return bi(aa(s,r,a,c))}),D3=t=>{t.dispatch("SkinLoaded")},M3=(t,e)=>{t.dispatch("SkinLoadError",e)},F3=t=>{t.dispatch("ResizeEditor")},Sh=(t,e)=>{t.dispatch("ResizeContent",e)},$3=(t,e)=>{t.dispatch("ScrollContent",e)},l_=(t,e)=>{t.dispatch("TextColorChange",e)},I3=(t,e)=>{t.dispatch("AfterProgressState",{state:e})},B3=(t,e)=>t.dispatch("ResolveName",{name:e.nodeName.toLowerCase(),target:e}),R3=(t,e)=>{t.dispatch("ToggleToolbarDrawer",{state:e})},P3=(t,e)=>{t.dispatch("StylesTextUpdate",e)},L3=(t,e)=>{t.dispatch("AlignTextUpdate",e)},V3=(t,e)=>{t.dispatch("FontSizeTextUpdate",e)},H3=(t,e)=>{t.dispatch("FontSizeInputTextUpdate",e)},N3=(t,e)=>{t.dispatch("BlocksTextUpdate",e)},z3=(t,e)=>{t.dispatch("FontFamilyTextUpdate",e)},U3=t=>{t.dispatch("ToggleSidebar")},W3=t=>{t.dispatch("ToggleView")},u_=t=>{t.dispatch("ContextToolbarClose")},G3=t=>{t.dispatch("ContextFormSlideBack")},Ru=(t,e)=>()=>{t(),e()},no=(t,e=ve)=>ca(t,"NodeChange",o=>{o.setEnabled(t.selection.isEditable()&&e())}),j3=(t,e)=>o=>{const n=xa(),s=()=>{o.setActive(t.formatter.match(e));const r=t.formatter.formatChanged(e,o.setActive);n.set(r)};return t.initialized?s():t.once("init",s),()=>{t.off("init",s),n.clear()}},Pu=(t,e)=>o=>{const n=no(t)(o),s=j3(t,e)(o);return()=>{n(),s()}},ca=(t,e,o)=>n=>{const s=()=>o(n),r=()=>{o(n),t.on(e,s)};return t.initialized?r():t.once("init",r),()=>{t.off("init",r),t.off(e,s)}},d_=t=>e=>()=>{t.undoManager.transact(()=>{t.focus(),t.execCommand("mceToggleFormat",!1,e.format)})},Io=(t,e)=>()=>t.execCommand(e);var ia=tinymce.util.Tools.resolve("tinymce.util.LocalStorage");const m_={},Y3=(t,e=10)=>{const o=ia.getItem(t),n=Et(o)?JSON.parse(o):[],r=(l=>e-l.length<0?l.slice(0,e):l)(n),a=l=>{pA(r,l).each(c),r.unshift(l),r.length>e&&r.pop(),ia.setItem(t,JSON.stringify(r))},c=l=>{r.splice(l,1)};return{add:a,state:()=>r.slice(0)}},g_=t=>tt(m_,t).getOrThunk(()=>{const e=`tinymce-custom-colors-${t}`,o=ia.getItem(e);if(Bi(o)){const s=ia.getItem("tinymce-custom-colors");ia.setItem(e,$e(s)?s:"[]")}const n=Y3(e,10);return m_[t]=n,n}),X3=t=>L(g_(t).state(),e=>({type:"choiceitem",text:e,icon:"checkmark",value:e})),p_=(t,e)=>{g_(t).add(e)},wh="forecolor",Th="hilitecolor",K3=5,q3=t=>h_(t.map((e,o)=>o%2===0?"#"+A3(e).value:e)),h_=t=>{const e=[];for(let o=0;o<t.length;o+=2)e.push({text:t[o+1],value:t[o],icon:"checkmark",type:"choiceitem"});return e},es=t=>e=>e.options.get(t),Ch="#000000",J3=t=>{const e=t.options.register,o=r=>ga(r,Et)?{value:q3(r),valid:!0}:{valid:!1,message:"Must be an array of strings."},n=r=>ga(r,Et)?{value:h_(r),valid:!0}
31:{valid:!1,message:"Must be an array of strings."},s=r=>ns(r)&&r>0?{value:r,valid:!0}:{valid:!1,message:"Must be a positive number."};e("color_map",{processor:o,default:["#BFEDD2","Light Green","#FBEEB8","Light Yellow","#F8CAC6","Light Red","#ECCAFA","Light Purple","#C2E0F4","Light Blue","#2DC26B","Green","#F1C40F","Yellow","#E03E2D","Red","#B96AD9","Purple","#3598DB","Blue","#169179","Dark Turquoise","#E67E23","Orange","#BA372A","Dark Red","#843FA1","Dark Purple","#236FA1","Dark Blue","#ECF0F1","Light Gray","#CED4D9","Medium Gray","#95A5A6","Gray","#7E8C8D","Dark Gray","#34495E","Navy Blue","#000000","Black","#ffffff","White"]}),e("color_map_raw",{processor:n}),e("color_map_background",{processor:o}),e("color_map_foreground",{processor:o}),e("color_cols",{processor:s,default:_h(t)}),e("color_cols_foreground",{processor:s,default:f_(t,wh)}),e("color_cols_background",{processor:s,default:f_(t,Th)}),e("custom_colors",{processor:"boolean",default:!0}),e("color_default_foreground",{processor:"string",default:Ch}),e("color_default_background",{processor:"string",default:Ch})},Lu=(t,e)=>e===wh&&t.options.isSet("color_map_foreground")?es("color_map_foreground")(t):e===Th&&t.options.isSet("color_map_background")?es("color_map_background")(t):t.options.isSet("color_map_raw")?es("color_map_raw")(t):es("color_map")(t),_h=(t,e="default")=>Math.max(K3,Math.ceil(Math.sqrt(Lu(t,e).length))),f_=(t,e)=>{const o=es("color_cols")(t),n=_h(t,e);return o===_h(t)?n:o},b_=(t,e="default")=>Math.round(e===wh?es("color_cols_foreground")(t):e===Th?es("color_cols_background")(t):es("color_cols")(t)),v_=es("custom_colors"),Z3=es("color_default_foreground"),Q3=es("color_default_background"),t4="rgba(0, 0, 0, 0)",e4=t=>xh(t).exists(e=>e.alpha!==0),o4=t=>Ki(t,e=>{if(Bo(e)){const o=to(e,"background-color");return dn(e4(o),o)}else return d.none()}).getOr(t4),y_=(t,e)=>{const o=I.fromDom(t.selection.getStart()),n=e==="hilitecolor"?o4(o):to(o,"color");return xh(n).map(s=>"#"+bi(s).value)},n4=(t,e,o)=>{t.undoManager.transact(()=>{t.focus(),t.formatter.apply(e,{value:o}),t.nodeChanged()})},s4=(t,e)=>{t.undoManager.transact(()=>{t.focus(),t.formatter.remove(e,{value:null},void 0,!0),t.nodeChanged()})},r4=t=>{t.addCommand("mceApplyTextcolor",(e,o)=>{n4(t,e,o)}),t.addCommand("mceRemoveTextcolor",e=>{s4(t,e)})},x_=t=>{const e="choiceitem",o={type:e,text:"Remove color",icon:"color-swatch-remove-color",value:"remove"};return t?[o,{type:e,text:"Custom color",icon:"color-picker",value:"custom"}]:[o]},Oh=(t,e,o,n)=>{o==="custom"?O_(t)(r=>{r.each(a=>{p_(e,a),t.execCommand("mceApplyTextcolor",e,a),n(a)})},y_(t,e).getOr(Ch)):o==="remove"?(n(""),t.execCommand("mceRemoveTextcolor",e)):(n(o),t.execCommand("mceApplyTextcolor",e,o))},Eh=(t,e,o)=>t.concat(X3(e).concat(x_(o))),S_=(t,e,o)=>n=>{n(Eh(t,e,o))},kh=(t,e,o)=>{const n=e==="forecolor"?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color";t.setIconFill(n,o)},w_=(t,e)=>{t.setTooltip(e)},T_=(t,e)=>o=>{const n=y_(t,e);return Bn(n,o.toUpperCase())},Ah=(t,e,o)=>{if(Ni(o))return e==="forecolor"?"Text color":"Background color";const n=e==="forecolor"?"Text color {0}":"Background color {0}",s=Eh(Lu(t,e),e,!1),r=ee(s,a=>a.value===o).getOr({text:""}).text;return t.translate([n,t.translate(r)])},C_=(t,e,o,n)=>{t.ui.registry.addSplitButton(e,{tooltip:Ah(t,o,n.get()),presets:"color",icon:e==="forecolor"?"text-color":"highlight-bg-color",select:T_(t,o),columns:b_(t,o),fetch:S_(Lu(t,o),o,v_(t)),onAction:s=>{Oh(t,o,n.get(),$)},onItemAction:(s,r)=>{Oh(t,o,r,a=>{n.set(a),l_(t,{name:e,color:a})})},onSetup:s=>{kh(s,e,n.get());const r=a=>{a.name===e&&(kh(s,a.name,a.color),w_(s,Ah(t,o,a.color)))};return t.on("TextColorChange",r),Ru(no(t)(s),()=>{t.off("TextColorChange",r)})}})},__=(t,e,o,n,s)=>{t.ui.registry.addNestedMenuItem(e,{text:n,icon:e==="forecolor"?"text-color":"highlight-bg-color",onSetup:r=>(w_(r,Ah(t,o,s.get())),kh(r,e,s.get()),no(t)(r)),getSubmenuItems:()=>[{type:"fancymenuitem",fancytype:"colorswatch",select:T_(t,o),initData:{storageKey:o},onAction:r=>{Oh(t,o,r.value,a=>{s.set(a),l_(t,{name:e,color:a})})}}]})},O_=t=>(e,o)=>{let n=!1;const s=c=>{const l=c.getData().colorpicker;n?(e(d.from(l)),c.close()):t.windowManager.alert(t.translate(["Invalid hex color code: {0}",l]))},r=(c,i)=>{i.name==="hex-valid"&&(n=i.value)},a={colorpicker:o};t.windowManager.open({title:"Color Picker",size:"normal",body:{type:"panel",items:[{type:"colorpicker",name:"colorpicker",label:"Color"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:a,onAction:r,onSubmit:s,onClose:$,onCancel:()=>{e(d.none())}})},a4=t=>{r4(t);const e=Z3(t),o=Q3(t),n=X(e),s=X(o);C_(t,"forecolor","forecolor",n),C_(t,"backcolor","hilitecolor",s),__(t,"forecolor","forecolor","Text color",n),__(t,"backcolor","hilitecolor","Backgroun
31d color",s)},c4=(t,e,o,n,s)=>{const r=i=>({setActive:l=>{it.set(i,l)},isActive:()=>it.isOn(i),isEnabled:()=>!z.isDisabled(i),setEnabled:l=>z.set(i,!l)}),a=tc({presets:"img",textContent:d.none(),htmlContent:d.none(),ariaLabel:t.tooltip,iconContent:d.some(t.url),labelContent:t.label,shortcutContent:d.none(),checkMark:d.some(hh(s.icons)),caret:d.none(),value:t.value},s,!0),c=t.tooltip.map(i=>zt.config(s.tooltips.getConfig({tooltipText:s.translate(i)})));return Jt(sa({context:t.context,data:ra(t),enabled:t.enabled,getApi:r,onAction:i=>{e(t.value),i.setActive(!0)},onSetup:i=>(i.setActive(o),$),triggersSubmenu:!1,itemBehaviours:[...c.toArray()]},a,n,s),{toggling:{toggleClass:Wp,toggleOnExecute:!1,selected:t.active,exclusive:!0}})},Vu=(t,e,o,n,s,r,a,c)=>{const i=di(e),u=i4(e,o,n,s!=="color"?"normal":"color",r,a,c);return Xp(t,i,u,n,{menuType:s})},i4=(t,e,o,n,s,r,a)=>wr(L(t,c=>c.type==="choiceitem"?MW(c).fold(Zn,i=>d.some(qC(i,o===1,n,e,r(i.value),s,a,di(t)))):c.type==="imageitem"?VW(c).fold(Zn,i=>d.some(c4(i,e,r(i.value),s,a))):c.type==="resetimage"?HW(c).fold(Zn,i=>d.some(qC({...i,type:"choiceitem",text:i.tooltip,icon:d.some(i.icon),label:d.some(i.label)},o===1,n,e,r(i.value),s,a,di(t)))):d.none())),xi=(t,e)=>{const o=gr(e);return t===1?{mode:"menu",moveOnTab:!0}:t==="auto"?{mode:"grid",selector:"."+o.item,initSize:{numColumns:1,numRows:1}}:{mode:"matrix",rowSelector:"."+{color:"tox-swatches__row",imageselector:"tox-image-selector__row",listpreview:"tox-collection__group",normal:"tox-collection__group"}[e],previousSelector:s=>e==="color"?Dt(s.element,"[aria-checked=true]"):d.none()}},l4=(t,e)=>t===1?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:t==="auto"?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:e==="color"?".tox-swatches__row":".tox-collection__group",cell:e==="color"?`.${Up}`:`.${Eu}`}},u4=(t,e)=>{const o=d4(t,e),n=e.colorinput.getColorCols(t.initData.storageKey),s="color",a={...Vu(V("menu-value"),o,c=>{t.onAction({value:c})},n,s,An.CLOSE_ON_EXECUTE,t.select.getOr(Pt),e.shared.providers),markers:gr(s),movement:xi(n,s),showMenuRole:!1};return{type:"widget",data:{value:V("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[ep.widget(Rs.sketch(a))]}},d4=(t,e)=>{const o=t.initData.allowCustomColors&&e.colorinput.hasCustomColors();return t.initData.colors.fold(()=>Eh(e.colorinput.getColors(t.initData.storageKey),t.initData.storageKey,o),n=>n.concat(x_(o)))},m4=(t,e)=>{const o="imageselector",n=t.initData.columns,r={...Vu(V("menu-value"),t.initData.items,a=>{t.onAction({value:a})},n,o,An.CLOSE_ON_EXECUTE,t.select.getOr(Pt),e.shared.providers),markers:gr(o),movement:xi(n,o),showMenuRole:!1};return{type:"widget",data:{value:V("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem","tox-collection--toolbar"]},autofocus:!0,components:[ep.widget(Rs.sketch(r))]}},E_=V("cell-over"),k_=V("cell-execute"),g4=t=>(e,o)=>t.shared.providers.translate(["{0} columns, {1} rows",o,e]),p4=(t,e,o)=>{const n=a=>Y(a,E_,{row:t,col:e}),s=a=>Y(a,k_,{row:t,col:e}),r=(a,c)=>{c.stop(),s(a)};return Xe({dom:{tag:"div",attributes:{role:"button","aria-label":o}},behaviours:D([et("insert-table-picker-cell",[E(ls(),Z.focus),E(Ho(),s),E(Mr(),r),E(Ic(),r)]),it.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),Z.config({onFocus:n})])})},h4=(t,e,o)=>{const n=[];for(let s=0;s<e;s++){const r=[];for(let a=0;a<o;a++){const c=t(s+1,a+1);r.push(p4(s,a,c))}n.push(r)}return n},f4=(t,e,o,n,s)=>{for(let r=0;r<n;r++)for(let a=0;a<s;a++)it.set(t[r][a],r<=e&&a<=o)},b4=t=>ye(t,e=>L(e,zo)),A_=(t,e)=>Nt(`${e}x${t}`),v4={inserttable:(t,e)=>{const s=g4(e),r=h4(s,10,10),a=A_(0,0),c=St({dom:{tag:"span",classes:["tox-insert-table-picker__label"]},components:[a],behaviours:D([st.config({})])});return{type:"widget",data:{value:V("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[ep.widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:b4(r).concat(c.asSpec()),behaviours:D([et("insert-table-picker",[Vt(i=>{st.set(c.get(i),[a])}),ng(E_,(i,l,u)=>{const{row:m,col:g}=u.event;f4(r,m,g,10,10),st.set(c.get(i),[A_(m+1,g+1)])}),ng(k_,(i,l,u)=>{const{row:m,col:g}=u.event;pt(i,il()),t.onAction({numRows:m+1,numColumns:g+1})})]),U.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}},colorswatch:u4,imageselect:m4},y4=(t,e)=>tt(v4,t.fancytype).map(o=>o(t,e)),x4=(t,e,o,n=!0,s=!1)=>{const r=s?p3(o.icons):g3(o.icons),a=i=>({isEnabled:()=>!z.isDisabled(i),setEnabled:l=>z.set(i,!l),setIconFill:(l,u)=>{Dt(i.element,`svg path[class="${l}"], rect[class="${l}"]`).each(m=>{nt(m,"fill",u)})},setTooltip:l=>{const u=o.translate(l);nt(i.element,"aria-label",u)}}),c=tc({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:d.none(),ariaLabel:t.text,labelContent:d.none(),caret:d.some(r),checkMark:d.none(),shortcutContent:t.shortcut},o,n);return sa({context:t.context,data:ra(t),getApi:a,enabled:t.enabled,onAction:$,onSetup:t.onSetup,triggersSubmenu:!0,itemBehaviours:[]},c,e,o)},S4=(t,e,o,n=!0)=>{const s=a=>({isEnabled:()=>!z.isDisabled(a),setEnabled:c=>z.set(a,!c)}
31),r=tc({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:d.none(),labelContent:d.none(),ariaLabel:t.text,caret:d.none(),checkMark:d.none(),shortcutContent:t.shortcut},o,n);return sa({context:t.context,data:ra(t),getApi:s,enabled:t.enabled,onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},r,e,o)},w4=t=>({type:"separator",dom:{tag:"div",classes:[Eu,qN]},components:t.text.map(Nt).toArray()}),T4=(t,e,o,n=!0)=>{const s=a=>({setActive:c=>{it.set(a,c)},isActive:()=>it.isOn(a),isEnabled:()=>!z.isDisabled(a),setEnabled:c=>z.set(a,!c)}),r=tc({iconContent:t.icon,textContent:t.text,htmlContent:d.none(),labelContent:d.none(),ariaLabel:t.text,checkMark:d.some(hh(o.icons)),caret:d.none(),shortcutContent:t.shortcut,presets:"normal",meta:t.meta},o,n);return Jt(sa({context:t.context,data:ra(t),enabled:t.enabled,getApi:s,onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},r,e,o),{toggling:{toggleClass:Wp,toggleOnExecute:!1,selected:t.active},role:t.role.getOrUndefined()})},C4=S3,D_=w4,_4=S4,O4=x4,E4=T4,k4=y4,A4=w3,D4=t=>{switch(t.searchMode){case"no-search":return{menuType:"normal"};default:return{menuType:"searchable",searchMode:t}}},M4=t=>{const e=P.getValue(t),o=Au(t).map(yC);Wo.refetch(e).get(()=>{const n=te.getCoupled(e,"sandbox");o.each(s=>Au(n).each(r=>uz(r,s)))})},F4=(t,e)=>{$4(t).each(o=>{FF(t,o.element,e.event.eventType,e.event.interactionEvent)})},$4=t=>vt.getState(t).bind(Ct.getHighlighted).bind(Ct.getHighlighted),I4=t=>po(t.element,Du)?d.some(t.element):Dt(t.element,"."+Du),M_=(t,e,o)=>{vC(t).each(n=>{dz(n,o),I4(e).each(r=>{Pe(r,"id").each(a=>nt(n.element,"aria-controls",a))})}),nt(o.element,"aria-selected","true")},B4=(t,e,o)=>{nt(o.element,"aria-selected","false")},R4=t=>{vC(t).each(e=>Z.focus(e))},P4=t=>te.getExistingCoupled(t,"sandbox").bind(Au).map(yC).map(o=>o.fetchPattern).getOr("");var Hu;(function(t){t[t.ContentFocus=0]="ContentFocus",t[t.UiFocus=1]="UiFocus"})(Hu||(Hu={}));const L4=(t,e,o,n,s)=>{const r=o.shared.providers,a=c=>s?{...c,shortcut:d.none(),icon:c.text.isSome()?d.none():c.icon}:c;switch(t.type){case"menuitem":return zW(t).fold(Zn,c=>d.some(_4(a(c),e,r,n)));case"nestedmenuitem":return WW(t).fold(Zn,c=>d.some(O4(a(c),e,r,n,s)));case"togglemenuitem":return jW(t).fold(Zn,c=>d.some(E4(a(c),e,r,n)));case"separator":return oW(t).fold(Zn,c=>d.some(D_(c)));case"fancymenuitem":return RW(t).fold(Zn,c=>k4(c,o));default:return console.error("Unknown item in general menu",t),d.none()}},V4=(t,e,o,n,s,r,a)=>{const c=n===1,i=!c||di(t);return wr(L(t,l=>{switch(l.type){case"separator":return sW(l).fold(Zn,u=>d.some(D_(u)));case"cardmenuitem":return AW(l).fold(Zn,u=>d.some(A4({...u,onAction:m=>{u.onAction(m),o(u.value,u.meta)}},s,r,{itemBehaviours:YC(u.meta,r,d.none()),cardText:{matchText:e,highlightOn:a}})));case"autocompleteitem":default:return rW(l).fold(Zn,u=>d.some(C4(u,e,c,"normal",o,s,r,i)))}}))},F_=(t,e,o,n,s,r)=>{const a=di(e),c=wr(L(e,u=>{const m=p=>s?!At(p,"text"):a,g=p=>L4(p,o,n,m(p),s);return u.type==="nestedmenuitem"&&u.getSubmenuItems().length<=0?g({...u,enabled:!1}):g(u)})),i=D4(r);return(s?yz:Xp)(t,a,c,1,i)},Dh=t=>jr.singleData(t.value,t),H4=(t,e,o,n)=>{const s=xi(e,n),r=gr(n);return{data:Dh({...t,movement:s,menuBehaviours:gi.unnamedEvents(e!=="auto"?[]:[Vt((a,c)=>{dh(a,4,r.item).each(({numColumns:i,numRows:l})=>{U.setGridSize(a,l,i)})})])}),menu:{markers:gr(n),fakeFocus:o===Hu.ContentFocus}}},N4=t=>qi.create(I.fromDom(t.startContainer),t.startOffset,I.fromDom(t.endContainer),t.endOffset),z4={register:(t,e)=>{const o=V("autocompleter"),n=X(!1),s=X(!1),r=Rt(),a=Xe(Yt.sketch({dom:{tag:"div",classes:["tox-autocompleter"],attributes:{id:o}},components:[],fireDismissalEventInstead:{},inlineBehaviours:D([et("dismissAutocompleter",[E($r(),()=>m()),E(vm(),(f,y)=>{Pe(y.event.target,"id").each(x=>nt(I.fromDom(t.getBody()),"aria-activedescendant",x))})])]),lazySink:e.getSink})),c=()=>Yt.isOpen(a),i=s.get,l=()=>{if(c()){Yt.hide(a),t.dom.remove(o,!1);const f=I.fromDom(t.getBody());Pe(f,"aria-owns").filter(y=>y===o).each(()=>{oe(f,"aria-owns"),oe(f,"aria-activedescendant")})}},u=()=>Yt.getContent(a).bind(f=>Pi(f.components(),0)),m=()=>t.execCommand("mceAutocompleterClose"),g=f=>{const y=In(f,x=>d.from(x.columns)).getOr(1);return ye(f,x=>{const C=x.items;return V4(C,x.matchText,(O,F)=>{const R={hide:()=>m(),reload:S=>{l(),t.execCommand("mceAutocompleterReload",!1,{fetchOptions:S})}};t.execCommand("mceAutocompleterRefreshActiveRange"),r.get().each(S=>{n.set(!0),x.onAction(R,S,O,F),n.set(!1)})},y,An.BUBBLE_TO_SANDBOX,e,x.highlightOn)})},p=(f,y)=>{const x=In(f,C=>d.from(C.columns)).getOr(1);Yt.showMenuAt(a,{anchor:{type:"selection",getSelection:()=>r.get().map(N4),root:I.fromDom(t.getBody())}},H4(Xp("autocompleter-value",!0,y,x,{menuType:"normal"}),x,Hu.ContentFocus,"normal")),u().each(Ct.highlightFirst)},h=f=>{const y=g(f);y.length>0?(p(f,y),nt(I.fromDom(t.getBody()),"aria-owns",o),t.inline||b()):l()},b=()=>{t.dom.get(o)&&t.dom.remove(o,!1);const f=t.getDoc().documentElement,y=t.selection.getNode(),x=zD(a.element);_r(x,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px",top:`${y.offsetTop}px`,left:`${y.offsetLeft}px`}),t.dom.add(f,x.dom),Dt(x,'[role="menu"]').each(C=>{wt(C,"position"),wt(C,"max-height")})};t.on("AutocompleterStart",({lookupData:f})=>{s.set(!0),n.set(!1),h(f)}),t.on("AutocompleterUpdate",({lookupData:f})=>h(f)),t.on("AutocompleterUpdateActiveRange",({range:f})=>r.set(f)),t.on("AutocompleterEnd",()=>{l(),s.set(!1),n.set(!1),r.clear()});const v={cancelIfNecessary:m,isMenuOpen:c,isActive:i,isProcessingAction:n.get,getMenu:u};XN.setup(v,t)}},U4=(t,e)=>({dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:L(t.items,e.interpreter)});var W4=tinymce.util.Tools.resolve("tinymce.html.Entities");const Si=(t,e,o,n)=>{const s=j4(t,e,o,n);return dt.sketch(s)},G4=(t,e)=>Si(t,e,[],[]),j4=(t,e,o,n)=>({dom:$_(o),components:t.toArray().concat([e]),fieldBehaviours:D(n)}),Y4=()=>$_([]),$_=t=>({tag:"div",classes:["tox-form__group"].concat(t)}),br=(t,e)=>dt.parts.label({dom:{tag:"label",classes:["tox-label"]},components:[Nt(e.translate(t))]}),vo=V("form-component-change"),I_=V("form-component-input"),wi=V("form-close"),vr=V("form-cancel"),hs=V("form-action"),Ti=V("form-submit"),Mh=V("form-block"),Fh=V("form-unblock"),B_=V("form-tabchange"),R_=V("form-resize"),X4=(t,e,o)=>{const n=t.label.map(p=>br(p,e)),s=e.icons(),r=p=>{var h;
31return(h=s[p])!==null&&h!==void 0?h:p},a=p=>(h,b)=>{as(b.event.target,"[data-collection-item-value]").each(v=>{p(h,b,v,Ee(v,"data-collection-item-value"))})},c=(p,h)=>{const v=e.checkUiComponentContext("mode:design").shouldDisable||e.isDisabled()?" tox-collection__item--state-disabled":"",f=L(h,C=>{const O=on.translate(C.text),F=t.columns===1?`<div class="tox-collection__item-label">${O}</div>`:"",R=`<div class="tox-collection__item-icon">${r(C.icon)}</div>`,S={_:" "," - ":" ","-":" "},B=O.replace(/\_| \- |\-/g,G=>S[G]);return`<div data-mce-tooltip="${B}" class="tox-collection__item${v}" tabindex="-1" data-collection-item-value="${W4.encodeAllRaw(C.value)}" aria-label="${B}">${R}${F}</div>`}),y=t.columns!=="auto"&&t.columns>1?Nf(f,t.columns):[f],x=L(y,C=>`<div class="tox-collection__group">${C.join("")}</div>`);Ca(p.element,x.join(""))},i=a((p,h,b,v)=>{h.stop(),e.checkUiComponentContext("mode:design").shouldDisable||e.isDisabled()||Y(p,hs,{name:t.name,value:v})}),l=[E(ls(),a((p,h,b)=>{Re(b,!0)})),E(Mr(),i),E(Ic(),i),E(vn(),a((p,h,b)=>{Dt(p.element,"."+Zr).each(v=>{Qt(v,Zr)}),ne(b,Zr)})),E(Rv(),a(p=>{Dt(p.element,"."+Zr).each(h=>{Qt(h,Zr),Wi(h)})})),As(a((p,h,b,v)=>{Y(p,hs,{name:t.name,value:v})}))],u=(p,h)=>L(io(p.element,".tox-collection__item"),h),m=dt.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(t.columns!==1?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:xt},behaviours:D([z.config({disabled:()=>e.checkUiComponentContext(t.context).shouldDisable,onDisabled:p=>{u(p,h=>{ne(h,"tox-collection__item--state-disabled"),nt(h,"aria-disabled",!0)})},onEnabled:p=>{u(p,h=>{Qt(h,"tox-collection__item--state-disabled"),oe(h,"aria-disabled")})}}),re(()=>e.checkUiComponentContext(t.context)),st.config({}),zt.config({...e.tooltips.getConfig({tooltipText:"",onShow:p=>{Dt(p.element,"."+Zr+"[data-mce-tooltip]").each(h=>{Pe(h,"data-mce-tooltip").each(b=>{zt.setComponents(p,e.tooltips.getComponents({tooltipText:b}))})})}}),mode:"children-keyboard-focus",anchor:p=>({type:"node",node:Dt(p.element,"."+Zr).orThunk(()=>cM(".tox-collection__item")),root:p.element,layouts:{onLtr:w([pe,Ce,me,Ue,ge,We]),onRtl:w([pe,Ce,me,Ue,ge,We])},bubble:xn(0,-2,{})})}),P.config({store:{mode:"memory",initialValue:o.getOr([])},onSetValue:(p,h)=>{c(p,h),t.columns==="auto"&&dh(p,5,"tox-collection__item").each(({numRows:b,numColumns:v})=>{U.setGridSize(p,b,v)}),pt(p,R_)}}),Mt.config({}),U.config(l4(t.columns,"normal")),et("collection-events",l)]),eventOrder:{[Ho()]:["disabling","alloy.base.behaviour","collection-events"],[vn()]:["collection-events","tooltipping"]}});return Si(n,m,["tox-form__group--collection"],[])},K4=(t,e)=>Wo.sketch({dom:t.dom,components:t.components,toggleClass:"mce-active",dropdownBehaviours:D([sn.button(()=>e.providers.isDisabled()||e.providers.checkUiComponentContext(t.context).shouldDisable),re(()=>e.providers.checkUiComponentContext(t.context)),Zc.config({}),Mt.config({})]),layouts:t.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:e.getSink,fetch:o=>Be.nu(n=>t.fetch(n)).map(n=>d.from(Dh(Jt(Vu(V("menu-value"),n,s=>{t.onItemAction(o,s)},t.columns,t.presets,An.CLOSE_ON_EXECUTE,Pt,e.providers),{movement:xi(t.columns,t.presets)})))),parts:{menu:ku(!1,1,t.presets)}}),P_=V("color-input-change"),L_=V("color-swatch-change"),V_=V("color-picker-cancel"),q4=(t,e,o,n)=>{const s=dt.parts.field({factory:Ps,inputClasses:["tox-textfield"],data:n,onSetValue:l=>ms.run(l).get($),inputBehaviours:D([z.config({disabled:()=>e.providers.isDisabled()||e.providers.checkUiComponentContext(t.context).shouldDisable}),re(()=>e.providers.checkUiComponentContext(t.context)),Mt.config({}),ms.config({invalidClass:"tox-textbox-field-invalid",getRoot:l=>ws(l.element),notify:{onValid:l=>{const u=P.getValue(l);Y(l,P_,{color:u})}},validator:{validateOnLoad:!1,validate:l=>{const u=P.getValue(l);if(u.length===0)return Be.pure(mt.value(!0));{const m=I.fromTag("span");ct(m,"background-color",u);const g=Le(m,"background-color").fold(()=>mt.error("blah"),p=>mt.value(u));return Be.pure(g)}}}})]),selectOnFocus:!1}),r=t.label.map(l=>br(l,e.providers)),a=(l,u)=>{Y(l,L_,{value:u})},c=(l,u)=>{i.getOpt(l).each(m=>{u==="custom"?o.colorPicker(g=>{g.fold(()=>pt(m,V_),p=>{a(m,p),p_(t.storageKey,p)})},"#ffffff"):u==="remove"?a(m,""):a(m,u)})},i=St(K4({dom:{tag:"span",attributes:{"aria-label":e.providers.translate("C
31olor swatch")}},layouts:{onRtl:()=>[ge,me,pe],onLtr:()=>[me,ge,pe]},components:[],fetch:S_(o.getColors(t.storageKey),t.storageKey,o.hasCustomColors()),columns:o.getColorCols(t.storageKey),presets:"color",onItemAction:c,context:t.context},e));return dt.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:r.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[s,i.asSpec()]}]),fieldBehaviours:D([et("form-field-events",[E(P_,(l,u)=>{i.getOpt(l).each(m=>{ct(m.element,"background-color",u.event.color)}),Y(l,vo,{name:t.name})}),E(L_,(l,u)=>{dt.getField(l).each(m=>{P.setValue(m,u.event.value),ht.getCurrent(l).each(Z.focus)})}),E(V_,(l,u)=>{dt.getField(l).each(m=>{ht.getCurrent(l).each(Z.focus)})})])])})},Mn={self:()=>ht.config({find:d.some}),memento:t=>ht.config({find:t.getOpt}),childAt:t=>ht.config({find:e=>Cr(e.element,t).bind(o=>e.getSystem().getByDom(o).toOptional())})},J4=J([T("preprocess",xt),T("postprocess",xt)]),Z4=(t,e)=>{const o=ho("RepresentingConfigs.memento processors",J4,e);return P.config({store:{mode:"manual",getValue:n=>{const s=t.get(n),r=P.getValue(s);return o.postprocess(r)},setValue:(n,s)=>{const r=o.preprocess(s),a=t.get(n);P.setValue(a,r)}}})},la=(t,e,o)=>P.config({store:{mode:"manual",...t.map(n=>({initialValue:n})).getOr({}),getValue:e,setValue:o}}),H_=(t,e,o)=>la(t,n=>e(n.element),(n,s)=>o(n.element,s)),Q4=t=>H_(t,Gd,Ca),Nu=t=>P.config({store:{mode:"memory",initialValue:t}}),$h=V("rgb-hex-update"),N_=V("slider-update"),z_=V("palette-update"),t5=(t,e)=>{const o=En.parts.spectrum({dom:{tag:"div",classes:[e("hue-slider-spectrum")],attributes:{role:"presentation"}}}),n=En.parts.thumb({dom:{tag:"div",classes:[e("hue-slider-thumb")],attributes:{role:"presentation"}}});return En.sketch({dom:{tag:"div",classes:[e("hue-slider")],attributes:{role:"slider","aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":120}},rounded:!1,model:{mode:"y",getInitialValue:w(0)},components:[o,n],sliderBehaviours:D([Z.config({})]),onChange:(s,r,a)=>{nt(s.element,"aria-valuenow",Math.floor(360-a*3.6)),Y(s,N_,{value:a})}})},U_=V("valid-input"),W_=V("invalid-input"),G_=V("validating-input"),Ih="colorcustom.rgb.",e5={isEnabled:ve,setEnabled:$,immediatelyShow:$,immediatelyHide:$},o5=(t,e,o,n,s,r)=>{const a=(b,v)=>{const f=v.get();b!==f.isEnabled()&&(f.setEnabled(b),b?f.immediatelyShow():f.immediatelyHide())},c=(b,v,f)=>ms.config({invalidClass:e("invalid"),notify:{onValidate:y=>{Y(y,G_,{type:b})},onValid:y=>{a(!1,f),Y(y,U_,{type:b,value:P.getValue(y)})},onInvalid:y=>{a(!0,f),Y(y,W_,{type:b,value:P.getValue(y)})}},validator:{validate:y=>{const x=P.getValue(y),C=v(x)?mt.value(!0):mt.error(t("aria.input.invalid"));return Be.pure(C)},validateOnLoad:!1}}),i=(b,v,f,y,x)=>{const C=X(e5),O=t(Ih+"range"),F=dt.parts.label({dom:{tag:"label"},components:[Nt(f)]}),R=dt.parts.field({data:x,factory:Ps,inputAttributes:{type:"text","aria-label":y,...v==="hex"?{"aria-live":"polite"}:{}},inputClasses:[e("textfield")],inputBehaviours:D([c(v,b,C),Mt.config({}),zt.config({...s({tooltipText:"",onSetup:ot=>{C.set({isEnabled:()=>zt.isEnabled(ot),setEnabled:H=>zt.setEnabled(ot,H),immediatelyShow:()=>zt.immediateOpenClose(ot,!0),immediatelyHide:()=>zt.immediateOpenClose(ot,!1)}),zt.setEnabled(ot,!1)},onShow:(ot,H)=>{zt.setComponents(ot,[{dom:{tag:"p",classes:[e("rgb-warning-note")]},components:[Nt(t(v==="hex"?"colorcustom.rgb.invalidHex":"colorcustom.rgb.invalid"))]}])}})})]),onSetValue:ot=>{ms.isInvalid(ot)&&ms.run(ot).get($)}}),S=V("aria-invalid"),B=St(r("invalid",d.some(S),"warning")),G=St({dom:{tag:"div",classes:[e("invalid-icon")]},components:[B.asSpec()]}),N=[F,R,G.asSpec()],lt=v!=="hex"?[dt.parts["aria-descriptor"]({text:O})]:[],Q=N.concat(lt);return{dom:{tag:"div",attributes:{role:"presentation"},classes:[e("rgb-container")]},components:Q}},l=(b,v)=>{const f=bi(v);return Na.getField(b,"hex").each(y=>{Z.isFocused(y)||P.setValue(b,{hex:f.value})}),f},u=(b,v)=>{const f=v.red,y=v.green,x=v.blue;P.setValue(b,{red:f,green:y,blue:x})},m=St({dom:{tag:"div",classes:[e("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),g=(b,v)=>{m.getOpt(b).each(f=>{ct(f.element,"background-color","#"+v.value)})};return Uo({factory:()=>{const b={red:X(d.some(255)),green:X(d.some(255)),blue:X(d.some(255)),hex:X(d.some("ffffff"))},v=(H,k)=>{const M=yi(k);u(H,M),C(M)},f=H=>b[H].get(),y=(H,k)=>{b[H].set(k)},x=()=>f("red").bind(H=>f("green").bind(k=>f("blue").map(M=>aa(H,k,M,1)))),C=H=>{const k=H.red,M=H.green,K=H.blue;y("red",d.some(k)),y("green",d.some(M)),y("blue",d.some(K))},O=(H,k)=>{const M=k.event;M.type!=="hex"?y(M.type,d.none()):n(H)},F=(H,k)=>
31{o(H);const M=JC(k);y("hex",d.some(M.value));const K=yi(M);u(H,K),C(K),Y(H,$h,{hex:M}),g(H,M)},R=(H,k,M)=>{const K=parseInt(M,10);y(k,d.some(K)),x().each(at=>{const W=l(H,at);Y(H,$h,{hex:W}),g(H,W)})},S=H=>H.type==="hex",B=(H,k)=>{const M=k.event;S(M)?F(H,M.value):R(H,M.type,M.value)},G=H=>({label:t(Ih+H+".label"),description:t(Ih+H+".description")}),N=G("red"),lt=G("green"),Q=G("blue"),ot=G("hex");return Jt(Na.sketch(H=>({dom:{tag:"form",classes:[e("rgb-form")],attributes:{"aria-label":t("aria.color.picker")}},components:[H.field("red",dt.sketch(i(yh,"red",N.label,N.description,255))),H.field("green",dt.sketch(i(yh,"green",lt.label,lt.description,255))),H.field("blue",dt.sketch(i(yh,"blue",Q.label,Q.description,255))),H.field("hex",dt.sketch(i(t_,"hex",ot.label,ot.description,"ffffff"))),m.asSpec()],formBehaviours:D([ms.config({invalidClass:e("form-invalid")}),et("rgb-form-events",[E(U_,B),E(W_,O),E(G_,O)])])})),{apis:{updateHex:(H,k)=>{P.setValue(H,{hex:k.value}),v(H,k),g(H,k)}}})},name:"RgbForm",configFields:[],apis:{updateHex:(b,v,f)=>{b.updateHex(v,f)}},extraApis:{}})},n5=(t,e)=>{const o=En.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[e("sv-palette-spectrum")]}}),n=En.parts.thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette-thumb")],innerHtml:`<div class=${e("sv-palette-inner-thumb")} role="presentation"></div>`}}),s=(l,u)=>{const{width:m,height:g}=l,p=l.getContext("2d");if(p===null)return;p.fillStyle=u,p.fillRect(0,0,m,g);const h=p.createLinearGradient(0,0,m,0);h.addColorStop(0,"rgba(255,255,255,1)"),h.addColorStop(1,"rgba(255,255,255,0)"),p.fillStyle=h,p.fillRect(0,0,m,g);const b=p.createLinearGradient(0,0,0,g);b.addColorStop(0,"rgba(0,0,0,0)"),b.addColorStop(1,"rgba(0,0,0,1)"),p.fillStyle=b,p.fillRect(0,0,m,g)},r=(l,u)=>{const m=l.components()[0].element.dom,g=vi(u,100,100),p=s_(g);s(m,a_(p))},a=(l,u)=>{const m=vh(yi(u));En.setValue(l,{x:m.saturation,y:100-m.value}),nt(l.element,"aria-valuetext",t(["Saturation {0}%, Brightness {1}%",m.saturation,m.value]))};return Uo({factory:l=>{const u=w({x:0,y:0}),m=(h,b,v)=>{ns(v)||nt(h.element,"aria-valuetext",t(["Saturation {0}%, Brightness {1}%",Math.floor(v.x),Math.floor(100-v.y)])),Y(h,z_,{value:v})},g=(h,b,v,f)=>{s(v.element.dom,a_(c_))},p=D([ht.config({find:d.some}),Z.config({})]);return En.sketch({dom:{tag:"div",attributes:{role:"slider","aria-valuetext":t(["Saturation {0}%, Brightness {1}%",0,0])},classes:[e("sv-palette")]},model:{mode:"xy",getInitialValue:u},rounded:!1,components:[o,n],onChange:m,onInit:g,sliderBehaviours:p})},name:"SaturationBrightnessPalette",configFields:[],apis:{setHue:(l,u,m)=>{r(u,m)},setThumb:(l,u,m)=>{a(u,m)}},extraApis:{}})},s5=(t,e,o,n)=>{const s=a=>{const c=o5(t,e,a.onValidHex,a.onInvalidHex,o,n),i=n5(t,e),l=S=>(100-S)/100*360,u=S=>100-S/360*100,m={paletteRgba:X(c_),paletteHue:X(0)},g=St(t5(t,e)),p=St(i.sketch({})),h=St(c.sketch({})),b=(S,B,G)=>{p.getOpt(S).each(N=>{i.setHue(N,G)})},v=(S,B)=>{h.getOpt(S).each(G=>{c.updateHex(G,B)})},f=(S,B,G)=>{g.getOpt(S).each(N=>{En.setValue(N,u(G))})},y=(S,B)=>{p.getOpt(S).each(G=>{i.setThumb(G,B)})},x=(S,B)=>{const G=yi(S);m.paletteRgba.set(G),m.paletteHue.set(B)},C=(S,B,G,N)=>{x(B,G),q(N,lt=>{lt(S,B,G)})},O=()=>{const S=[v];return(B,G)=>{const N=G.event.value,lt=m.paletteHue.get(),Q=vi(lt,N.x,100-N.y),ot=i_(Q);C(B,ot,lt,S)}},F=()=>{const S=[b,v];return(B,G)=>{const N=l(G.event.value),lt=m.paletteRgba.get(),Q=vh(lt),ot=vi(N,Q.saturation,Q.value),H=i_(ot);C(B,H,N,S)}},R=()=>{const S=[b,f,y];return(B,G)=>{const N=G.event.hex,lt=k3(N);C(B,N,lt.hue,S)}};return{uid:a.uid,dom:a.dom,components:[p.asSpec(),g.asSpec(),h.asSpec()],behaviours:D([et("colour-picker-events",[E($h,R()),E(z_,O()),E(N_,F())]),ht.config({find:S=>h.getOpt(S)}),U.config({mode:"acyclic"})])}};return Uo({name:"ColourPicker",configFields:[A("dom"),T("onValidHex",$),T("onInvalidHex",$)],factory:s})},r5={"colorcustom.rgb.red.label":"R","colorcustom.rgb.red.description":"Red channel","colorcustom.rgb.green.label":"G","colorcustom.rgb.green.description":"Green channel","colorcustom.rgb.blue.label":"B","colorcustom.rgb.blue.description":"Blue channel","colorcustom.rgb.hex.label":"#","colorcustom.rgb.hex.description":"Hex color code","colorcustom.rgb.range":"Range 0 to 255","colorcustom.rgb.invalid":"Numbers only, 0 to 255","colorcustom.rgb.invalidHex":"Hexadecimal only, 000000 to FFFFFF","aria.color.picker":"Color Picker","aria.input.invalid":"Invalid input"},a5=t=>e=>Et(e)?t.translate(r5[e]):t.translate(e),c5=(t,e,o)=>{const n=l=>"tox-"+l,s=(l,u,m=l,g=l)=>Go(m,{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+l],attributes:{title:e.translate(g),"aria-live":"polite",...u.fold(()=>({}),p=>({id:p}))}},e.icons),r=s5(a5(e),n,e.tooltips.getConfig,s),a=l=>{Y(l,hs,{name:"hex-valid",value:!0})},c=l=>{Y(l,hs,{name:"hex-valid",value:!1})},i=St(r.sketch({dom:{tag:"div",classes:[n("color-picker-container")],attributes:{role:"presentation"}},onValidHex:a,onInvalidHex:c}));return{dom:{tag:"div"},components:[i.asSpec()],behaviours:D([la(o,l=>{const u=i.get(l);return ht.getCurrent(u).bind(p=>P.getValue(p).hex).map(p=>"#"+nb(p,"#")).getOr("")},(l,u)=>{const m=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/,g=d.from(m.exec(u)).bind(b=>Pi(b,1)),p=i.get(l);ht.getCurrent(p).fold(()=>{console.log("Can not find form")},b=>{P.setValue(b,{hex:g.getOr("")}),Na.getField(b,"hex").each(v=>{pt(v,Es())})})}),Mn.self()])}};var i5=tinymce.util.Tools.resolve("tinymce.Resource");const j_=t=>At(t,"init"),l5=t=>{const e=Rt(),o=St({dom:{tag:t.tag}}),n=Rt(),s=!j_(t)&&t.onFocus.isSome()?[Z.config({onFocus:r=>{t.onFocus.each(a=>{a(r.element.dom)}
31)}}),Mt.config({})]:[];return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:D([et("custom-editor-events",[Vt(r=>{o.getOpt(r).each(a=>{(j_(t)?t.init(a.element.dom):i5.load(t.scriptId,t.scriptUrl).then(c=>c(a.element.dom,t.settings))).then(c=>{n.on(i=>{c.setValue(i)}),n.clear(),e.set(c)})})})]),la(d.none(),()=>e.get().fold(()=>n.get().getOr(""),r=>r.getValue()),(r,a)=>{e.get().fold(()=>n.set(a),c=>c.setValue(a))}),Mn.self()].concat(s)),components:[o.asSpec()]}};var Ns=tinymce.util.Tools.resolve("tinymce.util.Tools");const Bh=V("browse.files.event"),u5=(t,e)=>{const o=Ns.explode(e.getOption("images_file_types")),n=s=>Ko(o,r=>Vi(s.name.toLowerCase(),`.${r.toLowerCase()}`));return Wt(vA(t),n)},d5=(t,e,o)=>{const n=(g,p)=>{p.stop()},s=g=>(p,h)=>{q(g,b=>{b(p,h)})},r=(g,p)=>{var h;if(!z.isDisabled(g)){const b=p.event.raw;Y(g,Bh,{files:(h=b.dataTransfer)===null||h===void 0?void 0:h.files})}},a=(g,p)=>{const h=p.event.raw.target;Y(g,Bh,{files:h.files})},c=(g,p)=>{p&&(P.setValue(g,u5(p,e)),Y(g,vo,{name:t.name}))},i=St({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:D([et("input-file-events",[Pr(Mr()),Pr(Ic())])])}),l=t.label.map(g=>br(g,e)),u=dt.parts.field({factory:Fe,dom:{tag:"button",styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[Nt(e.translate("Browse for an image")),i.asSpec()],action:g=>{i.get(g).element.dom.click()},buttonBehaviours:D([Mn.self(),Nu(o.getOr([])),Mt.config({}),sn.button(()=>e.checkUiComponentContext(t.context).shouldDisable),re(()=>e.checkUiComponentContext(t.context))])}),m={dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:D([z.config({disabled:()=>e.checkUiComponentContext(t.context).shouldDisable}),re(()=>e.checkUiComponentContext(t.context)),it.config({toggleClass:"dragenter",toggleOnExecute:!1}),et("dropzone-events",[E("dragenter",s([n,it.toggle])),E("dragleave",s([n,it.toggle])),E("dragover",n),E("drop",s([n,r])),E(Da(),a)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p"},components:[Nt(e.translate("Drop an image here"))]},u]}]};return Si(l,m,["tox-form__group--stretched"],[et("handle-files",[E(Bh,(g,p)=>{dt.getField(g).each(h=>{c(h,p.event.files)})})])])},m5=(t,e)=>({dom:{tag:"div",classes:["tox-form__grid",`tox-form__grid--${t.columns}col`]},components:L(t.items,e.interpreter)}),Rh=V("alloy-fake-before-tabstop"),Ph=V("alloy-fake-after-tabstop"),Y_=t=>({dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:D([Z.config({ignore:!0}),Mt.config({})])}),X_=(t,e)=>({dom:{tag:"div",classes:["tox-navobj",...t.getOr([])]},components:[Y_([Rh]),e,Y_([Ph])],behaviours:D([Mn.childAt(1)])}),K_=(t,e)=>{Y(t,Un(),{raw:{which:9,shiftKey:e}})},g5=(t,e)=>{const o=e.element;po(o,Rh)?K_(t,!0):po(o,Ph)&&K_(t,!1)},Ci=t=>Cc(t,["."+Rh,"."+Ph].join(","),Pt),zu=V("update-dialog"),q_=V("update-title"),J_=V("update-body"),Z_=V("update-footer"),Q_=V("body-send-message"),Uu=V("dialog-focus-shifted"),Lh=Rn().browser,_i=Lh.isSafari(),p5=Lh.isFirefox(),tO=_i||p5,h5=Lh.isChromium(),f5=({scrollTop:t,scrollHeight:e,clientHeight:o})=>Math.ceil(t)+o>=e,eO=(t,e)=>t.scrollTo(0,e==="bottom"?99999999:e),b5=(t,e)=>{const o=t.body;return d.from(!/^<!DOCTYPE (html|HTML)/.test(e)&&(!h5&&!_i||$e(o)&&(o.scrollTop!==0||Math.abs(o.scrollHeight-o.clientHeight)>1))?o:t.documentElement)},oO=(t,e,o)=>{const n=t.dom;d.from(n.contentDocument).fold(o,s=>{let r=0;const a=b5(s,e).map(i=>
31(r=i.scrollTop,i)).forall(f5),c=()=>{const i=n.contentWindow;$e(i)&&(a?eO(i,"bottom"):!a&&tO&&r!==0&&eO(i,r))};_i&&n.addEventListener("load",c,{once:!0}),s.open(),s.write(e),s.close(),_i||c()})},v5=dn(tO,_i?500:200).map(t=>HA(oO,t)),y5=(t,e)=>{const o=X(t.getOr(""));return{getValue:n=>o.get(),setValue:(n,s)=>{if(o.get()!==s){const r=n.element,a=()=>nt(r,"srcdoc",s);e?v5.fold(w(oO),c=>c.throttle)(r,s,a):a()}o.set(s)}}},x5=(t,e,o)=>{const n="tox-dialog__iframe",s=t.transparent?[]:[`${n}--opaque`],r=t.border?["tox-navobj-bordered"]:[],a={...t.label.map(m=>({title:m})).getOr({}),...o.map(m=>({srcdoc:m})).getOr({}),...t.sandboxed?{sandbox:"allow-scripts allow-same-origin"}:{}},c=y5(o,t.streamContent),i=t.label.map(m=>br(m,e)),l=m=>X_(d.from(r),{uid:m.uid,dom:{tag:"iframe",attributes:a,classes:[n,...s]},behaviours:D([Mt.config({}),Z.config({}),la(o,c.getValue,c.setValue),Ao.config({channels:{[Uu]:{onReceive:(g,p)=>{p.newFocus.each(h=>{ws(g.element).each(b=>{(Ft(g.element,h)?ne:Qt)(b,"tox-navobj-bordered-focus")})})}}}})])}),u=dt.parts.field({factory:{sketch:l}});return Si(i,u,["tox-form__group--stretched"],[])},S5=(t,e,o,n,s)=>{const r=o*s,a=n*s,c=Math.max(0,t/2-r/2),i=Math.max(0,e/2-a/2);return{left:c.toString()+"px",top:i.toString()+"px",width:r.toString()+"px",height:a.toString()+"px"}},w5=(t,e,o)=>{const n=Co(t),s=Te(t);return Math.min(n/e,s/o,1)},T5=(t,e)=>{const o=X(e.getOr({url:""})),n=St({dom:{tag:"img",classes:["tox-imagepreview__image"],attributes:e.map(i=>({src:i.url})).getOr({})}}),s=St({dom:{tag:"div",classes:["tox-imagepreview__container"],attributes:{role:"presentation"}},components:[n.asSpec()]}),r=(i,l)=>{const u={url:l.url};l.zoom.each(g=>u.zoom=g),l.cachedWidth.each(g=>u.cachedWidth=g),l.cachedHeight.each(g=>u.cachedHeight=g),o.set(u);const m=()=>{const{cachedWidth:g,cachedHeight:p,zoom:h}=u;if(!os(g)&&!os(p)){if(os(h)){const v=w5(i.element,g,p);u.zoom=v}const b=S5(Co(i.element),Te(i.element),g,p,u.zoom);s.getOpt(i).each(v=>{_r(v.element,b)})}};n.getOpt(i).each(g=>{const p=g.element;l.url!==Ee(p,"src")&&(nt(p,"src",l.url),Qt(i.element,"tox-imagepreview__loaded")),m(),Kb(p).then(h=>{i.getSystem().isConnected()&&(ne(i.element,"tox-imagepreview__loaded"),u.cachedWidth=h.dom.naturalWidth,u.cachedHeight=h.dom.naturalHeight,m())})})},a={};t.height.each(i=>a.height=i);const c=e.map(i=>({url:i.url,zoom:d.from(i.zoom),cachedWidth:d.from(i.cachedWidth),cachedHeight:d.from(i.cachedHeight)}));return{dom:{tag:"div",classes:["tox-imagepreview"],styles:a,attributes:{role:"presentation"}},components:[s.asSpec()],behaviours:D([Mn.self(),la(c,()=>o.get(),r)])}},C5=(t,e,o)=>{const n="tox-label",s=t.align==="center"?[`${n}--center`]:[],r=t.align==="end"?[`${n}--end`]:[],a=St({dom:{tag:"label",classes:[n,...s,...r]},components:[Nt(e.providers.translate(t.label))]}),c=L(t.items,e.interpreter);return{dom:{tag:"div",classes:["tox-form__group"]},components:[a.asSpec(),...c],behaviours:D([Mn.self(),st.config({}),Q4(d.none()),U.config({mode:"acyclic"}),et("label",[Vt(i=>{t.for.each(l=>{o(l).each(u=>{a.getOpt(i).each(m=>{var g;const p=(g=Ee(u.element,"id"))!==null&&g!==void 0?g:V("form-field");nt(u.element,"id",p),nt(m.element,"for",p)})})})})])])}},Vh=V("toolbar.button.execute"),_5=t=>As((e,o)=>{pi(t,e)(n=>{Y(e,Vh,{buttonApi:n}),t.onAction(n)})}),yr=V("common-button-display-events"),nO={[Ho()]:["disabling","alloy.base.behaviour","toggling","toolbar-button-events","tooltipping"],[Wn()]:["toolbar-button-events",yr],[us()]:["toolbar-button-events","dropdown-events","tooltipping"],[Vo()]:["focusing","alloy.base.behaviour",yr]},Hh=t=>ct(t.element,"width",to(t.element,"width")),sO=(t,e,o)=>Go(t,{tag:"span",classes:["tox-icon","tox-tbtn__icon-wrap"],behaviours:o},e),Nh=(t,e)=>sO(t,e,[]),xr=(t,e)=>sO(t,e,[st.config({})]),rO=(t,e,o)=>({dom:{tag:"span",classes:[`${e}__select-label`]},components:[Nt(o.translate(t))],behaviours:D([st.config({})])}),rn=V("update-menu-text"),ua=V("update-menu-icon"),aO=V("update-tooltip-text"),zh=(t,e,o,n)=>{const s=X($),r=X(t.tooltip),a=t.text.map(v=>St(rO(v,e,o.providers))),c=t.icon.map(v=>St(xr(v,o.providers.icons))),i=(v,f)=>{const y=P.getValue(v);return Z.focus(y),Y(y,"keydown",{raw:f.event.raw}),Wo.close(y),d.some(!0)},l=t.role.fold(()=>({}),v=>({role:v}
vendor: 18,911 bytes, line 31
31)),u=d.from(t.listRole).map(v=>({listRole:v})).getOr({}),m=t.ariaLabel.fold(()=>({}),v=>({"aria-label":o.providers.translate(v)})),g=Go("chevron-down",{tag:"div",classes:[`${e}__select-chevron`]},o.providers.icons),p=V("common-button-display-events"),h="dropdown-events";return St(Wo.sketch({...t.uid?{uid:t.uid}:{},...l,...u,dom:{tag:"button",classes:[e,`${e}--select`].concat(L(t.classes,v=>`${e}--${v}`)),attributes:{...m,...$e(n)?{"data-mce-name":n}:{}}},components:Qa([c.map(v=>v.asSpec()),a.map(v=>v.asSpec()),d.some(g)]),matchWidth:!0,useMinWidth:!0,onOpen:(v,f,y)=>{t.searchable&&R4(y)},dropdownBehaviours:D([...t.dropdownBehaviours,sn.button(()=>t.disabled||o.providers.checkUiComponentContext(t.context).shouldDisable),re(()=>o.providers.checkUiComponentContext(t.context)),Zc.config({}),st.config({}),...t.tooltip.map(v=>zt.config(o.providers.tooltips.getConfig({tooltipText:o.providers.translate(v),onShow:f=>{if(ya(r.get(),t.tooltip,(y,x)=>x!==y).getOr(!1)){const y=o.providers.translate(r.get().getOr(""));zt.setComponents(f,o.providers.tooltips.getComponents({tooltipText:y}))}}}))).toArray(),et(h,[ts(t,s),fr(t,s)]),et(p,[Vt((v,f)=>{t.listRole!=="listbox"&&Hh(v)})]),et("update-dropdown-width-variable",[E(Bc(),(v,f)=>Wo.close(v))]),et("menubutton-update-display-text",[E(rn,(v,f)=>{a.bind(y=>y.getOpt(v)).each(y=>{st.set(y,[Nt(o.providers.translate(f.event.text))])})}),E(ua,(v,f)=>{c.bind(y=>y.getOpt(v)).each(y=>{st.set(y,[xr(f.event.icon,o.providers.icons)])})}),E(aO,(v,f)=>{const y=o.providers.translate(f.event.text);nt(v.element,"aria-label",y),r.set(d.some(f.event.text))})])]),eventOrder:Jt(nO,{[Vo()]:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"],[Wn()]:["toolbar-button-events",zt.name(),h,p]}),sandboxBehaviours:D([U.config({mode:"special",onLeft:i,onRight:i}),et("dropdown-sandbox-events",[E(hC,(v,f)=>{M4(v),f.stop()}),E(fC,(v,f)=>{F4(v,f),f.stop()})])]),lazySink:o.getSink,toggleClass:`${e}--active`,parts:{menu:{...ku(!1,t.columns,t.presets),fakeFocus:t.searchable,...t.listRole==="listbox"?{}:{onHighlightItem:M_,onCollapseMenu:(v,f,y)=>{Ct.getHighlighted(y).each(x=>{M_(v,y,x)})},onDehighlightItem:B4}}},getAnchorOverrides:()=>({maxHeightFunction:(v,f)=>{Cy()(v,f-10)}}),fetch:v=>Be.nu(mo(t.fetch,v))})).asSpec()},O5=t=>Et(t),cO=t=>t.type==="separator",E5=t=>At(t,"getSubmenuItems"),k5={type:"separator"},A5=(t,e)=>{const o=Ge(t,(n,s)=>O5(s)?s===""?n:s==="|"?n.length>0&&!cO(n[n.length-1])?n.concat([k5]):n:At(e,s.toLowerCase())?n.concat([e[s.toLowerCase()]]):n:n.concat([s]),[]);return o.length>0&&cO(o[o.length-1])&&o.pop(),o},D5=(t,e)=>{const o=t.getSubmenuItems(),n=iO(o,e),s=Jt(n.menus,{[t.value]:n.items}),r=Jt(n.expansions,{[t.value]:t.value});return{item:t,menus:s,expansions:r}},M5=t=>{const e=tt(t,"value").getOrThunk(()=>V("generated-menu-item"));return Jt({value:e},t)},iO=(t,e)=>{const o=A5(Et(t)?t.split(" "):t,e);return pa(o,(n,s)=>{if(E5(s)){const r=M5(s),a=D5(r,e);return{menus:Jt(n.menus,a.menus),items:[a.item,...n.items],expansions:Jt(n.expansions,a.expansions)}}else return{...n,items:[s,...n.items]}},{menus:{},expansions:{},items:[]})},F5=t=>t.search.fold(()=>({searchMode:"no-search"}),e=>({searchMode:"search-with-field",placeholder:e.placeholder})),$5=t=>t.search.fold(()=>({searchMode:"no-search"}),e=>({searchMode:"search-with-results"})),ec=(t,e,o,n)=>{const s=V("primary-menu"),r=iO(t,o.shared.providers.menuItems());if(r.items.length===0)return d.none();const a=F5(n),c=F_(s,r.items,e,o,n.isHorizontalMenu,a),i=$5(n),l=we(r.menus,(m,g)=>F_(g,m,e,o,!1,i)),u=Jt(l,Ar(s,c));return d.from(jr.tieredData(s,u,r.expansions))},Wu=t=>!At(t,"items"),lO="data-value",uO=(t,e,o,n,s)=>L(o,r=>Wu(r)?{type:"togglemenuitem",...s?{}:{role:"option"},text:r.text,value:r.value,active:r.value===n,onAction:()=>{P.setValue(t,r.value),Y(t,vo,{name:e}),Z.focus(t)}}:{type:"nestedmenuitem",text:r.text,getSubmenuItems:()=>uO(t,e,r.items,n,s)}),Uh=(t,e)=>In(t,o=>Wu(o)?dn(o.value===e,o):Uh(o.items,e)),I5=(t,e,o)=>{const n=Ko(t.items,l=>!Wu(l)),s=e.shared.providers,r=o.bind(l=>Uh(t.items,l)).orThunk(()=>$n(t.items).filter(Wu)),a=t.label.map(l=>br(l,s)),c=dt.parts.field({dom:{},factory:{sketch:l=>zh({context:t.context,uid:l.uid,text:r.map(u=>u.text),icon:d.none(),tooltip:d.none(),role:dn(!n,"combobox"),...n?{}:{listRole:"listbox"},ariaLabel:t.label,fetch:(u,m)=>{const g=uO(u,t.name,t.items,P.getValue(u),n);m(ec(g,An.CLOSE_ON_EXECUTE,e,{isHorizontalMenu:!1,search:d.none()}))},onSetup:w($),getApi:w({}),columns:1,presets:"normal",classes:[],dropdownBehaviours:[Mt.config({}),la(r.map(u=>u.value),u=>Ee(u.element,lO),(u,m)=>{Uh(t.items,m).each(g=>{nt(u.element,lO,g.value),Y(u,rn,{text:g.text})})})]},"tox-listbox",e.shared)}}),i={dom:{tag:"div",classes:["tox-listboxfield"]},components:[c]};return dt.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:Ie([a.toArray(),[i]]),fieldBehaviours:D([z.config({disabled:()=>!t.enabled||s.checkUiComponentContext(t.context).shouldDisable,onDisabled:l=>{dt.getField(l).each(z.disable)},onEnabled:l=>{dt.getField(l).each(z.enable)}})])})},B5=(t,e)=>({dom:{tag:"div",classes:t.classes},components:L(t.items,e.shared.interpreter)}),R5=(t,e,o)=>{const n=L(t.items,i=>({text:e.translate(i.text),value:i.value})),s=t.label.map(i=>br(i,e)),r=dt.parts.field({dom:{},...o.map(i=>({data:i})).getOr({}),selectAttributes:{size:t.size},options:n,factory:KV,selectBehaviours:D([z.config({disabled:()=>!t.enabled||e.checkUiComponentContext(t.context).shouldDisable}),Mt.config({}),et("selectbox-change",[E(Da(),(i,l)=>{Y(i,vo,{name:t.name})})])])}),a=t.size>1?d.none():d.some(Go("chevron-down",{tag:"div",classes:["tox-selectfield__icon-js"]},e.icons)),c={dom:{tag:"div",classes:["tox-selectfield"]},components:Ie([[r],a.toArray()])};return dt.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:Ie([s.toArray(),[c]]),fieldBehaviours:D([z.config({disabled:()=>!t.enabled||e.checkUiComponentContext(t.context).shouldDisable,onDisabled:i=>{dt.getField(i).each(z.disable)},onEnabled:i=>{dt.getField(i).each(z.enable)}}),re(()=>e.checkUiComponentContext(t.context))])})},dO=t=>{const e={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,in:4,"%":4},o=s=>s in e?e[s]:1;let n=t.value.toFixed(o(t.unit));return n.indexOf(".")!==-1&&(n=n.replace(/\.?0*$/,"")),n+t.unit},Gu=t=>{const o=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(t);if(o!==null){const n=parseFloat(o[1]),s=o[2];return mt.value({value:n,unit:s})}else return mt.error(t)},mO=(t,e)=>{const o={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1},n=s=>At(o,s);return t.unit===e?d.some(t.value):n(t.unit)&&n(e)?o[t.unit]===o[e]?d.some(t.value):d.some(t.value/o[t.unit]*o[e]):d.none()},ju=t=>d.none(),P5=(t,e)=>o=>mO(o,e).map(n=>({value:n*t,unit:e})),gO=(t,e)=>{const o=Gu(t).toOptional(),n=Gu(e).toOptional();return ya(o,n,(s,r)=>mO(s,r.unit).map(a=>r.value/a).map(a=>P5(a,r.unit)).getOr(ju)).getOr(ju)},L5=(t,e)=>{let o=ju;const n=V("ratio-event"),s=b=>Go(b,{tag:"span",classes:["tox-icon","tox-lock-icon__"+b]},e.icons),r=()=>!t.enabled||e.checkUiComponentContext(t.context).shouldDisable,a=re(()=>e.checkUiComponentContext(t.context)),c=t.label.getOr("Constrain proportions"),i=e.translate(c),l=se.parts.lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{"aria-label":i,"data-mce-name":c}},components:[s("lock"),s("unlock")],buttonBehaviours:D([z.config({disabled:r}),a,Mt.config({}),zt.config(e.tooltips.getConfig({tooltipText:i}))])}),u=b=>({dom:{tag:"div",classes:["tox-form__group"]},components:b}),m=b=>dt.parts.field({factory:Ps,inputClasses:["tox-textfield"],inputBehaviours:D([z.config({disabled:r}),a,Mt.config({}),et("size-input-events",[E(vn(),(v,f)=>{Y(v,n,{isField1:b})}),E(Da(),(v,f)=>{Y(v,vo,{name:t.name})})])]),selectOnFocus:!1}),g=b=>({dom:{tag:"label",classes:["tox-label"]},components:[Nt(e.translate(b))]}),p=se.parts.field1(u([dt.parts.label(g("Width")),m(!0)])),h=se.parts.field2(u([dt.parts.label(g("Height")),m(!1)]));return se.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[p,h,u([g(UA),l])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:(b,v,f)=>{Gu(P.getValue(b)).each(y=>{o(y).each(x=>{P.setValue(v,dO(x))})})},coupledFieldBehaviours:D([z.config({disabled:r,onDisabled:b=>{se.getField1(b).bind(dt.getField).each(z.disable),se.getField2(b).bind(dt.getField).each(z.disable),se.getLock(b).each(z.disable)},onEnabled:b=>{se.getField1(b).bind(dt.getField).each(z.enable),se.getField2(b).bind(dt.getField).each(z.enable),se.getLock(b).each(z.enable)}}),re(()=>e.checkUiComponentContext("mode:design")),et("size-input-events2",[E(n,(b,v)=>{const f=v.event.isField1,y=f?se.getField1(b):se.getField2(b),x=f?se.getField2(b):se.getField1(b),C=y.map(P.getValue).getOr(""),O=x.map(P.getValue).getOr("");o=gO(C,O)})])])})},V5=(t,e,o)=>{const n=En.parts.label({dom:{tag:"label",classes:["tox-label"]},components:[Nt(e.translate(t.label))]}),s=En.parts.spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),r=En.parts.thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return En.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:t.min,maxX:t.max,getInitialValue:w(o.getOrThunk(()=>(Math.abs(t.max)-Math.abs(t.min))/2))},components:[n,s,r],sliderBehaviours:D([Mn.self(),Z.config({})]),onChoose:(a,c,i)=>{Y(a,vo,{name:t.name,value:i})},onChange:(a,c,i)=>{Y(a,vo,{name:t.name,value:i})}})},H5=(t,e)=>{const o=c=>({dom:{tag:"th",innerHtml:e.translate(c)}}),n=c=>({dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:L(c,o)}]}),s=c=>({dom:{tag:"td",innerHtml:e.translate(c)}}),r=c=>({dom:{tag:"tr"},components:L(c,s)}),a=c=>({dom:{tag:"tbody"},components:L(c,r)});return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[n(t.header),a(t.cells)],behaviours:D([Mt.config({}),Z.config({})])}},pO=(t,e)=>{const o=t.label.map(p=>br(p,e)),n=[z.config({disabled:()=>t.disabled||e.checkUiComponentContext(t.context).shouldDisable}),re(()=>e.checkUiComponentContext(t.context)),U.config({mode:"execution",useEnter:t.multiline!==!0,useControlEnter:t.multiline===!0,execute:p=>(pt(p,Ti),d.some(!0))}),et("textfield-change",[E(Es(),(p,h)=>{Y(p,vo,{name:t.name})}),E(pm(),(p,h)=>{Y(p,vo,{name:t.name})})]),Mt.config({})],s=t.validation.map(p=>ms.config({getRoot:h=>ws(h.element),invalidClass:"tox-invalid",validator:{validate:h=>{const b=P.getValue(h),v=p.validator(b);return Be.pure(v===!0?mt.value(b):mt.error(v))},validateOnLoad:p.validateOnLoad}})).toArray(),r=t.placeholder.fold(w({}),p=>({placeholder:e.translate(p)})),a=t.inputMode.fold(w({}),p=>({inputmode:p})),c={...r,...a,"data-mce-name":t.name},i=dt.parts.field({tag:t.multiline===!0?"textarea":"input",...t.data.map(p=>({data:p})).getOr({}),inputAttributes:c,inputClasses:[t.classname],inputBehaviours:D(Ie([n,s])),selectOnFocus:!1,factory:Ps}),l=t.multiline?{dom:{tag:"div",classes:["tox-textarea-wrap"]},components:[i]}:i,m=(t.flex?["tox-form__group--stretched"]:[]).concat(t.maximized?["tox-form-group--maximize"]:[]),g=[z.config({disabled:()=>t.disabled||e.checkUiComponentContext(t.context).shouldDisable,onDisabled:p=>{dt.getField(p).each(z.disable)},onEnabled:p=>{dt.getField(p).each(z.enable)}}),re(()=>e.checkUiComponentContext(t.context))];return Si(o,l,m,g)},N5=(t,e,o)=>pO({name:t.name,multiline:!1,label:t.label,inputMode:t.inputMode,placeholder:t.placeholder,flex:!1,disabled:!t.enabled,classname:"tox-textfield",validation:d.none(),maximized:t.maximized,data:o,context:t.context},e),z5=(t,e,o)=>pO({name:t.name,multiline:!0,label:t.label,inputMode:d.none(),placeholder:t.placeholder,flex:!0,disabled:!t.enabled,classname:"tox-textarea",validation:d.none(),maximized:t.maximized,data:o,context:t.context},e),hO=t=>({isEnabled:()=>!z.isDisabled(t),setEnabled:e=>z.set(t,!e),setActive:e=>{const o=t.element;e?(ne(o,"tox-tbtn--enabled"),nt(o,"aria-pressed",!0)):(Qt(o,"tox-tbtn--enabled"),oe(o,"aria-pressed"))},isActive:()=>po(t.element,"tox-tbtn--enabled"),setTooltip:e=>{Y(t,aO,{text:e})},setText:e=>{Y(t,rn,{text:e})},setIcon:e=>Y(t,ua,{icon:e})}),Oi=(t,e,o,n,s=!0,r)=>{const a=t.buttonType==="bordered"?["bordered"]:[];return zh({text:t.text,icon:t.icon,tooltip:t.tooltip,ariaLabel:t.tooltip,searchable:t.search.isSome(),role:n,fetch:(c,i)=>{const l={pattern:t.search.isSome()?P4(c):""};t.fetch(u=>{i(ec(u,An.CLOSE_ON_EXECUTE,o,{isHorizontalMenu:!1,search:t.search}))},l,hO(c))},onSetup:t.onSetup,getApi:c=>hO(c),columns:1,presets:"normal",classes:a,dropdownBehaviours:[...s?[Mt.config({})]:[]],context:t.context},e,o.shared,r)},U5=(t,e,o)=>{const n=r=>a=>{const c=!a.isActive();a.setActive(c),r.storage.set(c),o.shared.getSink().each(i=>{e().getOpt(i).each(l=>{Re(l.element),Y(l,hs,{name:r.name,value:r.storage.get()})})})},s=r=>a=>{a.setActive(r.storage.get())};return r=>{r(L(t,a=>{const c=a.text.fold(()=>({}),i=>({text:i}));return{type:a.type,active:!1,...c,context:a.context,onAction:n(a),onSetup:s(a)}}))}},fO=t=>({dom:{tag:"span",classes:["tox-tree__label"],attributes:{"aria-label":t}},components:[Nt(t)]}),bO=(t,e,o)=>{t.customStateIcon.each(n=>e.push(yO(n,o.shared.providers.icons,t.customStateIconTooltip.fold(()=>[],s=>[zt.config(o.shared.providers.tooltips.getConfig({tooltipText:s}))]),["tox-icon-custom-state"])))},vO=V("leaf-label-event-id"),Wh=({leaf:t,onLeafAction:e,visible:o,treeId:n,selectedId:s,backstage:r})=>{const a=t.menu.map(i=>Oi(i,"tox-mbtn",r,d.none(),o)),c=[fO(t.title)];return bO(t,c,r),a.each(i=>c.push(i)),Fe.sketch({dom:{tag:"div",classes:["tox-tree--leaf__label","tox-trbtn"].concat(o?["tox-tree--leaf__label--visible"]:[])},components:c,role:"treeitem",action:i=>{e(t.id),i.getSystem().broadcastOn([`update-active-item-${n}`],{value:t.id})},eventOrder:{[Un()]:[vO,"keying"]},buttonBehaviours:D([...o?[Mt.config({})]:[],it.config({toggleClass:"tox-trbtn--enabled",toggleOnExecute:!1,aria:{mode:"selected"}}),Ao.config({channels:{[`update-active-item-${n}`]:{onReceive:(i,l)=>{(l.value===t.id?it.on:it.off)(i)}}}}),et(vO,[Vt((i,l)=>{s.each(u=>{(u===t.id?it.on:it.off)(i)})}),E(Un(),(i,l)=>{const u=l.event.raw.code==="ArrowLeft",m=l.event.raw.code==="ArrowRight";u?(Hn(i.element,".tox-tree--directory").each(g=>{i.getSystem().getByDom(g).each(p=>{Zd(g,".tox-tree--directory__label").each(h=>{p.getSystem().getByDom(h).each(Z.focus)})})}),l.stop()):m&&l.stop()})])])})},yO=(t,e,o,n,s)=>Go(t,{tag:"span",classes:["tox-tree__icon-wrap","tox-icon"].concat(n||[]),behaviours:o,attributes:s},e),W5=(t,e)=>yO(t,e,[]),xO=V("directory-label-event-id"),G5=({directory:t,visible:e,noChildren:o,backstage:n})=>{const s=t.menu.map(c=>Oi(c,"tox-mbtn",n,d.none())),r=[{dom:{tag:"div",classes:["tox-chevron"]},components:[W5("chevron-right",n.shared.providers.icons)]},fO(t.title)];bO(t,r,n),s.each(c=>{r.push(c)});const a=c=>{Hn(c.element,".tox-tree--directory").each(i=>{c.getSystem().getByDom(i).each(l=>{const u=!it.isOn(l);it.toggle(l),Y(c,"expand-tree-node",{expanded:u,node:t.id})})})};return Fe.sketch({dom:{tag:"div",classes:["tox-tree--directory__label","tox-trbtn"].concat(e?["tox-tree--directory__label--visible"]:[])},components:r,action:a,eventOrder:{[Un()]:[xO,"keying"]},buttonBehaviours:D([...e?[Mt.config({})]:[],et(xO,[E(Un(),(c,i)=>{const l=i.event.raw.code==="ArrowRight",u=i.event.raw.code==="ArrowLeft";l&&o&&i.stop(),(l||u)&&Hn(c.element,".tox-tree--directory").each(m=>{c.getSystem().getByDom(m).each(g=>{!it.isOn(g)&&l||it.isOn(g)&&u?(a(c),i.stop()):u&&!it.isOn(g)&&(Hn(g.element,".tox-tree--directory").each(p=>{Zd(p,".tox-tree--directory__label").each(h=>{g.getSystem().getByDom(h).each(Z.focus)})}),i.stop())})})})])])})},j5=({children:t,onLeafAction:e,visible:o,treeId:n,expandedIds:s,selectedId:r,backstage:a})=>({dom:{tag:"div",classes:["tox-tree--directory__children"]},components:t.map(c=>c.type==="leaf"?Wh({leaf:c,selectedId:r,onLeafAction:e,visible:o,treeId:n,backstage:a}):Gh({directory:c,expandedIds:s,selectedId:r,onLeafAction:e,labelTabstopping:o,treeId:n,backstage:a})),behaviours:D([bo.config({dimension:{property:"height"},closedClass:"tox-tree--directory__children--closed",openClass:"tox-tree--directory__children--open",growingClass:"tox-tree--directory__children--growing",shrinkingClass:"tox-tree--directory__children--shrinking",expanded:o}),st.config({})])}),Y5=V("directory-event-id"),Gh=({directory:t,onLeafAction:e,labelTabstopping:o,treeId:n,backstage:s,expandedIds:r,selectedId:a})=>{const{children:c}=t,i=X(r),l=m=>c.map(g=>g.type==="leaf"?Wh({leaf:g,selectedId:a,onLeafAction:e,visible:m,treeId:n,backstage:s}):Gh({directory:g,expandedIds:i.get(),selectedId:a,onLeafAction:e,labelTabstopping:m,treeId:n,backstage:s})),u=r.includes(t.id);return{dom:{tag:"div",classes:["tox-tree--directory"],attributes:{role:"treeitem"}},components:[G5({directory:t,visible:o,noChildren:t.children.length===0,backstage:s}),j5({children:c,expandedIds:r,selectedId:a,onLeafAction:e,visible:u,treeId:n,backstage:s})],behaviours:D([et(Y5,[Vt((m,g)=>{it.set(m,u)}),E("expand-tree-node",(m,g)=>{const{expanded:p,node:h}=g.event;i.set(p?[...i.get(),h]:i.get().filter(b=>b!==h))})]),it.config({...t.children.length>0?{aria:{mode:"expanded"}}:{},toggleClass:"tox-tree--directory--expanded",onToggled:(m,g)=>{const p=m.components()[1],h=l(g);g?bo.grow(p):bo.shrink(p),st.set(p,h)}})])}},X5=V("tree-event-id"),K5=(t,e)=>{const o=t.onLeafAction.getOr($),n=t.onToggleExpand.getOr($),s=t.defaultExpandedIds,r=X(s),a=X(t.defaultSelectedId),c=V("tree-id"),i=(l,u)=>t.items.map(m=>m.type==="leaf"?Wh({leaf:m,selectedId:l,onLeafAction:o,visible:!0,treeId:c,backstage:e}):Gh({directory:m,selectedId:l,onLeafAction:o,expandedIds:u,labelTabstopping:!0,treeId:c,backstage:e}));return{dom:{tag:"div",classes:["tox-tree"],attributes:{role:"tree"}},components:i(a.get(),r.get()),behaviours:D([U.config({mode:"flow",selector:".tox-tree--leaf__label--visible, .tox-tree--directory__label--visible",cycles:!1}),et(X5,[E("expand-tree-node",(l,u)=>{const{expanded:m,node:g}=u.event;r.set(m?[...r.get(),g]:r.get().filter(p=>p!==g)),n(r.get(),{expanded:m,node:g})})]),Ao.config({channels:{[`update-active-item-${c}`]:{onReceive:(l,u)=>{a.set(d.some(u.value)),st.set(l,i(d.some(u.value),r.get()))}}}}),st.config({})])}},Yu=(t,e,o=[],n,s,r,a)=>{const c=e.fold(()=>({}),u=>({action:u})),i={buttonBehaviours:D([sn.item(()=>!t.enabled||a.checkUiComponentContext(t.context).shouldDisable),re(()=>a.checkUiComponentContext(t.context)),Mt.config({}),...r.map(u=>zt.config(a.tooltips.getConfig({tooltipText:a.translate(u)}))).toArray(),et("button press",[IF("click")])].concat(o)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]},...c},l=Jt(i,{dom:n});return Jt(l,{components:s})},q5=(t,e,o,n=[],s)=>
31{const r=t.tooltip.map(l=>({"aria-label":o.translate(l)})).getOr({}),a={tag:"button",classes:["tox-tbtn"],attributes:{...r,"data-mce-name":s}},c=t.icon.map(l=>Nh(l,o.icons)),i=Qa([c]);return Yu(t,e,n,a,i,t.tooltip,o)},jh=t=>{switch(t){case"primary":return["tox-button"];case"toolbar":return["tox-tbtn"];case"secondary":default:return["tox-button","tox-button--secondary"]}},SO=(t,e,o,n=[],s=[])=>{const r=o.translate(t.text),a=t.icon.map(p=>Nh(p,o.icons)),c=[a.getOrThunk(()=>Nt(r))],i=t.buttonType.getOr(!t.primary&&!t.borderless?"secondary":"primary"),m={tag:"button",classes:[...jh(i),...a.isSome()?["tox-button--icon"]:[],...t.borderless?["tox-button--naked"]:[],...s],attributes:{"aria-label":r,"data-mce-name":t.text}},g=t.icon.map(w(r));return Yu(t,e,n,m,c,g,o)},wO=(t,e,o,n=[],s=[])=>{const r=SO(t,d.some(e),o,n,s);return Fe.sketch(r)},TO=(t,e)=>o=>{e==="custom"?Y(o,hs,{name:t,value:{}}):e==="submit"?pt(o,Ti):e==="cancel"?pt(o,vr):console.error("Unknown button type: ",e)},J5=(t,e)=>e==="menu",Z5=(t,e)=>e==="custom"||e==="cancel"||e==="submit",Q5=(t,e)=>e==="togglebutton",tG=(t,e,o)=>{var n,s;const r=t.icon.map(x=>xr(x,e.icons)).map(St),a=x=>{Y(x,hs,{name:t.name,value:{setIcon:C=>{r.map(O=>O.getOpt(x).each(F=>{st.set(F,[xr(C,e.icons)])}))}}})},c=t.buttonType.getOr(t.primary?"primary":"secondary"),i={...t,name:(n=t.name)!==null&&n!==void 0?n:"",primary:c==="primary",tooltip:t.tooltip,enabled:(s=t.enabled)!==null&&s!==void 0?s:!1,borderless:!1},l=i.tooltip.or(t.text).map(x=>({"aria-label":e.translate(x)})).getOr({}),u=jh(c!=null?c:"secondary"),m=t.icon.isSome()&&t.text.isSome(),g={tag:"button",classes:[...u.concat(t.icon.isSome()?["tox-button--icon"]:[]),...t.active?["tox-button--enabled"]:[],...m?["tox-button--icon-and-text"]:[]],attributes:{...l,...$e(o)?{"data-mce-name":o}:{}}},p=[],h=e.translate(t.text.getOr("")),b=Nt(h),f=[...Qa([r.map(x=>x.asSpec())]),...t.text.isSome()?[b]:[]],y=Yu(i,d.some(a),p,g,f,t.tooltip,e);return Fe.sketch(y)},Xu=(t,e,o)=>{if(J5(t,e)){const n=()=>a,s=t,r={...t,buttonType:"default",type:"menubutton",search:d.none(),onSetup:c=>(c.setEnabled(t.enabled),$),fetch:U5(s.items,n,o)},a=St(Oi(r,"tox-tbtn",o,d.none(),!0,t.text.or(t.tooltip).getOrUndefined()));return a.asSpec()}else if(Z5(t,e)){const n=TO(t.name,e),s={...t,context:e==="cancel"?"any":t.context,borderless:!1};return wO(s,n,o.shared.providers,[])}else{if(Q5(t,e))return tG(t,o.shared.providers,t.text.or(t.tooltip).getOrUndefined());throw console.error("Unknown footer button type: ",e),new Error("Unknown footer button type")}},eG=(t,e)=>{const o=TO(t.name,"custom");return G4(d.none(),dt.parts.field({factory:Fe,...SO(t,d.some(o),e,[Nu(""),Mn.self()])}))},oG={type:"separator"},nG=t=>({type:"menuitem",value:t.url,text:t.title,meta:{attach:t.attach},onAction:$}),Yh=(t,e)=>({type:"menuitem",value:e,text:t,meta:{attach:void 0},onAction:$}),sG=t=>L(t,nG),rG=(t,e)=>Wt(e,o=>o.type===t),CO=(t,e)=>sG(rG(t,e)),aG=t=>CO("header",t.targets),cG=t=>CO("anchor",t.targets),iG=t=>d.from(t.anchorTop).map(e=>Yh("<top>",e)).toArray(),lG=t=>d.from(t.anchorBottom).map(e=>Yh("<bottom>",e)).toArray(),uG=t=>L(t,e=>Yh(e,e)),dG=t=>Ge(t,(e,o)=>e.length===0||o.length===0?e.concat(o):e.concat(oG,o),[]),Xh=(t,e)=>{const o=t.toLowerCase();return Wt(e,n=>{var s;const r=n.meta!==void 0&&n.meta.text!==void 0?n.meta.text:n.text,a=(s=n.value)!==null&&s!==void 0?s:"";return go(r.toLowerCase(),o)||go(a.toLowerCase(),o)})},mG=(t,e,o)=>{var n,s;const r=P.getValue(e),a=(s=(n=r==null?void 0:r.meta)===null||n===void 0?void 0:n.text)!==null&&s!==void 0?s:r.value;return o.getLinkInformation().fold(()=>[],i=>{const l=Xh(a,uG(o.getHistory(t)));return t==="file"?dG([l,Xh(a,aG(i)),Xh(a,Ie([iG(i),cG(i),lG(i)]))]):l})},_O=V("aria-invalid"),gG=(t,e,o,n)=>{const s=e.shared.providers,r=y=>{const x=P.getValue(y);o.addToHistory(x.value,t.filetype)},a={...n.map(y=>({initialData:y})).getOr({}),dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":_O,type:"url"},minChars:0,responseTime:0,fetch:y=>{const x=mG(t.filetype,y,o),C=ec(x,An.BUBBLE_TO_SANDBOX,e,{isHorizontalMenu:!1,search:d.none()});return Be.pure(C)},getHotspot:y=>h.getOpt(y),onSetValue:(y,x)=>{y.hasConfigured(ms)&&ms.run(y).get($)},typeaheadBehaviours:D([...o.getValidationHandler().map(y=>ms.config({getRoot:x=>ws(x.element),invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:(x,C)=>{u.getOpt(x).each(O=>{nt(O.element,"title",s.translate(C))})}},validator:{validate:x=>{const C=P.getValue(x);return TA.nu(O=>{y({type:t.filetype,url:C.value},F=>{if(F.status==="invalid"){const R=mt.error(F.message);O(R)}else{const R=mt.value(F.message);O(R)}})})},validateOnLoad:!1}})).toArray(),z.config({disabled:()=>!t.enabled||s.checkUiComponentContext(t.context).shouldDisable}),Mt.config({}),et("urlinput-events",[E(Es(),y=>{const x=Ts(y.element),C=x.trim();C!==x&&Er(y.element,C),t.filetype==="file"&&Y(y,vo,{name:t.name})}),E(Da(),y=>{Y(y,vo,{name:t.name}),r(y)}),E(pm(),y=>{Y(y,vo,{name:t.name}),r(y)}
vendor: 4,327 bytes, line 31
31)])]),eventOrder:{[Es()]:["streaming","urlinput-events","invalidating"]},model:{getDisplayText:y=>y.value,selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:e.shared.getSink,parts:{menu:ku(!1,1,"normal")},onExecute:(y,x,C)=>{Y(x,Ti,{})},onItemExecute:(y,x,C,O)=>{r(y),Y(y,vo,{name:t.name})}},c=dt.parts.field({...a,factory:dN}),i=t.label.map(y=>br(y,s)),u=St(((y,x,C=y,O=y)=>Go(C,{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+y],attributes:{title:s.translate(O),"aria-live":"polite",...x.fold(()=>({}),F=>({id:F}))}},s.icons))("invalid",d.some(_O),"warning")),m=St({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[u.asSpec()]}),g=o.getUrlPicker(t.filetype),p=V("browser.url.event"),h=St({dom:{tag:"div",classes:["tox-control-wrap"]},components:[c,m.asSpec()],behaviours:D([z.config({disabled:()=>!t.enabled||s.checkUiComponentContext(t.context).shouldDisable})])}),b=St(wO({context:t.context,name:t.name,icon:d.some("browse"),text:t.picker_text.or(t.label).getOr(""),enabled:t.enabled,primary:!1,buttonType:d.none(),borderless:!0},y=>pt(y,p),s,[],["tox-browse-url"])),v=()=>({dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:Ie([[h.asSpec()],g.map(()=>b.asSpec()).toArray()])}),f=y=>{ht.getCurrent(y).each(x=>{const C=P.getValue(x),O={fieldname:t.name,...C};g.each(F=>{F(O).get(R=>{P.setValue(x,R),Y(y,vo,{name:t.name})})})})};return dt.sketch({dom:Y4(),components:i.toArray().concat([v()]),fieldBehaviours:D([z.config({disabled:()=>!t.enabled||s.checkUiComponentContext(t.context).shouldDisable,onDisabled:y=>{dt.getField(y).each(z.disable),b.getOpt(y).each(z.disable)},onEnabled:y=>{dt.getField(y).each(z.enable),b.getOpt(y).each(z.enable)}}),re(()=>s.checkUiComponentContext(t.context)),et("url-input-events",[E(p,f)])])})},pG=(t,e)=>{const o=cC(t.icon,e.icons);return Kn.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in",`tox-notification--${t.level}`]},components:[{dom:{tag:"div",classes:["tox-notification__icon"],innerHtml:t.url?void 0:o},components:t.url?[Fe.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:o,attributes:{title:e.translate(t.iconTooltip)}},action:n=>Y(n,hs,{name:"alert-banner",value:t.url}),buttonBehaviours:D([iC()])})]:void 0},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:e.translate(t.text)}}]})},hG=(t,e,o)=>{const n=i=>(i.element.dom.click(),d.some(!0)),s=dt.parts.field({factory:{sketch:xt},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:D([Mn.self(),z.config({disabled:()=>!t.enabled||e.checkUiComponentContext(t.context).shouldDisable,onDisabled:i=>{ws(i.element).each(l=>ne(l,"tox-checkbox--disabled"))},onEnabled:i=>{ws(i.element).each(l=>Qt(l,"tox-checkbox--disabled"))}}),Mt.config({}),Z.config({}),H_(o,uM,lM),U.config({mode:"special",onEnter:n,onSpace:n,stopSpaceKeyup:!0}),et("checkbox-events",[E(Da(),(i,l)=>{Y(i,vo,{name:t.name})})])])}),r=dt.parts.label({dom:{tag:"span",classes:["tox-checkbox__label"]},components:[Nt(e.translate(t.label))],behaviours:D([Zc.config({})])}),a=i=>Go(i==="checked"?"selected":"unselected",{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+i]},e.icons),c=St({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[a("checked"),a("unchecked")]});return dt.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[s,c.asSpec(),r],fieldBehaviours:D([z.config({disabled:()=>!t.enabled||e.checkUiComponentContext(t.context).shouldDisable}),re(()=>e.checkUiComponentContext(t.context))])})},fG=(t,e)=>{const o=["tox-form__group",...t.stretched?["tox-form__group--stretched"]:[]],n=et("htmlpanel",[Vt(s=>{t.onInit(s.element.dom)})]);return t.presets==="presentation"?Kn.sketch({dom:{tag:"div",classes:o,innerHtml:t.html},containerBehaviours:D([zt.config({...e.tooltips.getConfig({tooltipText:"",onShow:s=>{Dt(s.element,"[data-mce-tooltip]:hover").orThunk(()=>Qe(s.element)).each(r=>{Pe(r,"data-mce-tooltip").each(a=>{zt.setComponents(s,e.tooltips.getComponents({tooltipText:a}))})})}}),mode:"children-normal",anchor:s=>({type:"node",node:Dt(s.element,"[data-mce-tooltip]:hover").orThunk(()=>Qe(s.element).filter(r=>Pe(r,"data-mce-tooltip").isSome())),root:s.element,layouts:{onLtr
31:w([pe,Ce,me,Ue,ge,We]),onRtl:w([pe,Ce,me,Ue,ge,We])},bubble:xn(0,-2,{})})}),n])}):Kn.sketch({dom:{tag:"div",classes:o,innerHtml:t.html,attributes:{role:"document"}},containerBehaviours:D([Mt.config({}),Z.config({}),n])})},fe=t=>(e,o,n,s,r)=>tt(o,"name").fold(()=>t(o,s,d.none(),r),a=>e.field(a,t(o,s,tt(n,a),r))),bG=t=>(e,o,n,s,r)=>{const a=Jt(o,{source:"dynamic"});return fe(t)(e,a,n,s,r)},vG={bar:fe((t,e)=>U4(t,e.shared)),collection:fe((t,e,o)=>X4(t,e.shared.providers,o)),alertbanner:fe((t,e)=>pG(t,e.shared.providers)),input:fe((t,e,o)=>N5(t,e.shared.providers,o)),textarea:fe((t,e,o)=>z5(t,e.shared.providers,o)),label:fe((t,e,o,n)=>C5(t,e.shared,n)),iframe:bG((t,e,o)=>x5(t,e.shared.providers,o)),button:fe((t,e)=>eG(t,e.shared.providers)),checkbox:fe((t,e,o)=>hG(t,e.shared.providers,o)),colorinput:fe((t,e,o)=>q4(t,e.shared,e.colorinput,o)),colorpicker:fe((t,e,o)=>c5(t,e.shared.providers,o)),dropzone:fe((t,e,o)=>d5(t,e.shared.providers,o)),grid:fe((t,e)=>m5(t,e.shared)),listbox:fe((t,e,o)=>I5(t,e,o)),selectbox:fe((t,e,o)=>R5(t,e.shared.providers,o)),sizeinput:fe((t,e)=>L5(t,e.shared.providers)),slider:fe((t,e,o)=>V5(t,e.shared.providers,o)),urlinput:fe((t,e,o)=>gG(t,e,e.urlinput,o)),customeditor:fe(l5),htmlpanel:fe((t,e)=>fG(t,e.shared.providers)),imagepreview:fe((t,e,o)=>T5(t,o)),table:fe((t,e)=>H5(t,e.shared.providers)),tree:fe((t,e)=>K5(t,e)),panel:fe((t,e)=>B5(t,e))},yG={field:(t,e)=>e,record:w([])},OO=(t,e,o,n,s)=>{const r=Jt(n,{shared:{interpreter:a=>Kh(t,a,o,r,s)}});return Kh(t,e,o,r,s)},Kh=(t,e,o,n,s)=>tt(vG,e.type).fold(()=>(console.error(`Unknown factory type "${e.type}", defaulting to container: `,e),e),r=>r(t,e,o,n,s)),EO=(t,e,o,n)=>Kh(yG,t,e,o,n),Ei={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},xG=(t,e,o)=>{const s={maxHeightFunction:Fa()},r=()=>({type:"node",root:wa(ao(t())),node:d.from(t()),bubble:xn(12,12,Ei),layouts:{onRtl:()=>[Pc],onLtr:()=>[Rc]},overrides:s}),a=()=>({type:"hotspot",hotspot:e(),bubble:xn(-12,12,Ei),layouts:{onRtl:()=>[me,ge,pe],onLtr:()=>[ge,me,pe]},overrides:s});return()=>o()?r():a()},SG=(t,e,o,n)=>{const r={maxHeightFunction:Fa()},a=()=>({type:"node",root:wa(ao(e())),node:d.from(e()),bubble:xn(12,12,Ei),layouts:{onRtl:()=>[Sn],onLtr:()=>[Sn]},overrides:r}),c=()=>t?{type:"node",root:wa(ao(e())),node:d.from(e()),bubble:xn(0,-qs(e()),Ei),layouts:{onRtl:()=>[Ce],onLtr:()=>[Ce]},overrides:r}:{type:"hotspot",hotspot:o(),bubble:xn(0,0,Ei),layouts:{onRtl:()=>[Ce],onLtr:()=>[Ce]},overrides:r};return()=>n()?a():c()},wG=(t,e,o)=>{const n=()=>({type:"node",root:wa(ao(t())),node:d.from(t()),layouts:{onRtl:()=>[Sn],onLtr:()=>[Sn]}}),s=()=>({type:"hotspot",hotspot:e(),layouts:{onRtl:()=>[pe],onLtr:()=>[pe]}});return()=>o()?n():s()},TG=(t,e)=>()=>({type:"selection",root:e(),getSelection:()=>{const o=t.selection.getRng(),n=t.model.table.getSelectedCells();if(n.length>1){const s=n[0],r=n[n.length-1],a={firstCell:I.fromDom(s),lastCell:I.fromDom(r)};return d.some(a)}return d.some(_c.range(I.fromDom(o.startContainer),o.startOffset,I.fromDom(o.endContainer),o.endOffset))}}),CG=t=>e=>({type:"node",root:t(),node:e}),_G=(t,e,o,n)=>{const s=Ya(t),r=()=>I.fromDom(t.getBody()),a=()=>I.fromDom(t.getContentAreaContainer()),c=()=>s||!n();return{inlineDialog:xG(a,e,c),inlineBottomDialog:SG(t.inline,a,o,c),banner:wG(a,e,c),cursor:TG(t,r),node:CG(r)}},OG=t=>(e,o)=>{O_(t)(e,o)},EG=t=>()=>v_(t),kG=t=>e=>Lu(t,e),AG=t=>e=>b_(t,e),DG=t=>({colorPicker:OG(t),hasCustomColors:EG(t),getColors:kG(t),getColorCols:AG(t)}),MG=t=>()=>ET(t),FG=t=>({isDraggableModal:MG(t)}),$G=t=>{const e=X(kp(t)?"bottom":"top");return{isPositionedAtTop:()=>e.get()==="top",getDockingMode:e.get,setDockingMode:e.set}},kO=t=>an(t,"items"),AO=t=>an(t,"format"),DO=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",format:"bold"},{title:"Italic",format:"italic"},{title:"Underline",format:"underline"}
31,{title:"Strikethrough",format:"strikethrough"},{title:"Superscript",format:"superscript"},{title:"Subscript",format:"subscript"},{title:"Code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Align",items:[{title:"Left",format:"alignleft"},{title:"Center",format:"aligncenter"},{title:"Right",format:"alignright"},{title:"Justify",format:"alignjustify"}]}],IG=t=>At(t,"items"),BG=t=>At(t,"block"),RG=t=>At(t,"inline"),PG=t=>At(t,"selector"),MO=t=>Ge(t,(e,o)=>{if(IG(o)){const n=MO(o.items);return{customFormats:e.customFormats.concat(n.customFormats),formats:e.formats.concat([{title:o.title,items:n.formats}])}}else if(RG(o)||BG(o)||PG(o)){const s=`custom-${Et(o.name)?o.name:o.title.toLowerCase()}`;return{customFormats:e.customFormats.concat([{name:s,format:o}]),formats:e.formats.concat([{title:o.title,format:s,icon:o.icon}])}}else return{...e,formats:e.formats.concat(o)}},{customFormats:[],formats:[]}),LG=(t,e)=>{const o=MO(e),n=s=>{q(s,r=>{t.formatter.has(r.name)||t.formatter.register(r.name,r.format)})};return t.formatter?n(o.customFormats):t.on("init",()=>{n(o.customFormats)}),o.formats},FO=t=>dT(t).map(e=>{const o=LG(t,e);return mT(t)?DO.concat(o):o}).getOr(DO),VG=t=>{const e=xe(t);return e.length===1&&le(e,"title")},$O=(t,e,o)=>({...t,type:"formatter",isSelected:e(t.format),getStylePreview:o(t.format)}),IO=(t,e,o,n)=>{const s=i=>$O(i,o,n),r=i=>{const l=c(i.items);return{...i,type:"submenu",getStyleItems:w(l)}},a=i=>{const l=Et(i.name)?i.name:V(i.title),u=`custom-${l}`,m={...i,type:"formatter",format:u,isSelected:o(u),getStylePreview:n(u)};return t.formatter.register(l,m),m},c=i=>L(i,l=>kO(l)?r(l):AO(l)?s(l):VG(l)?{...l,type:"separator"}:a(l));return c(e)},HG=t=>{const e=c=>()=>t.formatter.match(c),o=c=>()=>{const i=t.formatter.get(c);return i!==void 0?d.some({tag:i.length>0&&(i[0].inline||i[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(c))}):d.none()},n=X([]),s=X([]),r=X(!1);return t.on("PreInit",c=>{const i=FO(t),l=IO(t,i,e,o);n.set(l)}),t.on("addStyleModifications",c=>{const i=IO(t,c.items,e,o);s.set(i),r.set(c.replace)}),{getData:()=>{const c=r.get()?[]:n.get(),i=s.get();return c.concat(i)}}},NG=t=>{let n=0;const s=()=>n>0,r=c=>[{dom:{tag:"div",classes:["tox-tooltip__body"]},components:[Nt(c.tooltipText)]}];return{getConfig:c=>({delayForShow:()=>s()?60:300,delayForHide:w(300),exclusive:!0,lazySink:t,tooltipDom:{tag:"div",classes:["tox-tooltip","tox-tooltip--up"]},tooltipComponents:r(c),onShow:(i,l)=>{n++,c.onShow&&c.onShow(i,l)},onHide:(i,l)=>{n--,c.onHide&&c.onHide(i,l)},onSetup:c.onSetup}),getComponents:r}},zG=t=>$e(t)&&t.nodeType===1,UG=Ns.trim,BO=t=>e=>!!(zG(e)&&(e.contentEditable===t||e.getAttribute("data-mce-contenteditable")===t)),WG=BO("true"),GG=BO("false"),RO=(t,e,o,n,s)=>({type:t,title:e,url:o,level:n,attach:s}),jG=t=>{let e=t;for(;e=e.parentNode;){const o=e.contentEditable;if(o&&o!=="inherit")return WG(e)}return!1},YG=(t,e)=>L(io(I.fromDom(e),t),o=>o.dom),PO=t=>t.innerText||t.textContent,XG=t=>t.id?t.id:V("h"),KG=t=>t&&t.nodeName==="A"&&(t.id||t.name)!==void 0,qG=t=>KG(t)&&VO(t),LO=t=>t&&/^(H[1-6])$/.test(t.nodeName),VO=t=>jG(t)&&!GG(t),JG=t=>LO(t)&&VO(t),ZG=t=>LO(t)?parseInt(t.nodeName.substr(1),10):0,QG=t=>{var e;const o=XG(t),n=()=>{t.id=o};return RO("header",(e=PO(t))!==null&&e!==void 0?e:"","#"+o,ZG(t),n)},t9=t=>{const e=t.id||t.name,o=PO(t);return RO("anchor",o||"#"+e,"#"+e,0,$)},e9=t=>L(Wt(t,JG),QG),o9=t=>L(Wt(t,qG),t9),n9=t=>YG("h1,h2,h3,h4,h5,h6,a:not([href])",t),s9=t=>UG(t.title).length>0,r9={find:t=>{const e=n9(t);return Wt(e9(e).concat(o9(e)),s9)}},Ku="tinymce-url-history",HO=5,NO=t=>Et(t)&&/^https?/.test(t),a9=t=>vs(t)&&t.length<=HO&&fa(t,NO),zO=t=>Ys(t)&&kd(t,e=>!a9(e)).isNone(),UO=()=>{const t=ia.getItem(Ku);if(t===null)return{};let e;try{e=JSON.parse(t)}catch(o){if(o instanceof SyntaxError)return console.log("Local storage "+Ku+" was not valid JSON",o),{};throw o}return zO(e)?e:(console.log("Local storage "+Ku+" was not valid format",e),{})},c9=t=>{if(!zO(t))throw new Error(`Bad format for history:
32`+JSON.stringify(t));ia.setItem(Ku,JSON.stringify(t))},i9=t=>{const e=UO();return tt(e,t).getOr([])},l9=(t,e)=>{if(!NO(t))return;const o=UO(),n=tt(o,e).getOr([]),s=Wt(n,r=>r!==t);o[e]=[t].concat(s).slice(0,HO),c9(o)},WO=t=>!!t,u9=t=>we(Ns.makeMap(t,/[, ]/),WO),qh=t=>d.from(xT(t)),d9=t=>{const e=d.from(TT(t)).filter(WO).map(u9);return qh(t).fold(Pt,o=>e.fold(ve,n=>xe(n).length>0?n:!1))},m9=(t,e)=>{const o=d9(t);return ys(o)?o?qh(t):d.none():o[e]?qh(t):d.none()},g9=(t,e)=>m9(t,e).map(o=>n=>Be.nu(s=>{const r=(c,i)=>{if(!Et(c))throw new Error("Expected value to be string");if(i!==void 0&&!Ys(i))throw new Error("Expected meta to be a object");s({value:c,meta:i})},a={filetype:e,fieldname:n.fieldname,...d.from(n.meta).getOr({})};o.call(t,r,n.value,a)})),GO=t=>d.from(t).filter(Et).getOrUndefined(),p9=t=>CT(t)?d.some({targets:r9.find(t.getBody()),anchorTop:GO(_T(t)),anchorBottom:GO(OT(t))}):d.none(),h9=t=>d.from(ST(t)),f9=t=>({getHistory:i9,addToHistory:l9,getLinkInformation:()=>p9(t),getValidationHandler:()=>h9(t),getUrlPicker:e=>g9(t,e)}),b9=(t,e,o,n)=>{const s=X(!1),r=$G(e),a={icons:()=>e.ui.registry.getAll().icons,menuItems:()=>e.ui.registry.getAll().menuItems,translate:on.translate,isDisabled:()=>!e.ui.isEnabled(),getOption:e.options.get,tooltips:NG(t.dialog),checkUiComponentContext:f=>
32{if(yu(e))return{contextType:"disabled",shouldDisable:!0};const[y,x=""]=f.split(":"),C=e.ui.registry.getAll().contexts,O=tt(C,y).fold(()=>tt(C,"mode").map(F=>F("design")).getOr(!1),F=>x.charAt(0)==="!"?!F(x.slice(1)):F(x));return{contextType:y,shouldDisable:!O}}},c=f9(e),i=HG(e),l=DG(e),u=FG(e),m=()=>s.get(),g=f=>s.set(f),p={shared:{providers:a,anchors:_G(e,o,n,r.isPositionedAtTop),header:r},urlinput:c,styles:i,colorinput:l,dialog:u,isContextMenuOpen:m,setContextMenuState:g},h=f=>d.none(),b={...p,shared:{...p.shared,interpreter:f=>EO(f,{},b,h),getSink:t.popup}},v={...p,shared:{...p.shared,interpreter:f=>EO(f,{},v,h),getSink:t.dialog}};return{popup:b,dialog:v}},v9=(t,e,o)=>{const n=(S,B)=>{q([e,...o],G=>{G.broadcastEvent(S,B)})},s=(S,B)=>{q([e,...o],G=>{G.broadcastOn([S],B)})},r=S=>s(Bs(),{target:S.target}),a=Ud(),c=co(a,"touchstart",r),i=co(a,"touchmove",S=>n(I1(),S)),l=co(a,"touchend",S=>n(B1(),S)),u=co(a,"mousedown",r),m=co(a,"mouseup",S=>{S.raw.button===0&&s(Wg(),{target:S.target})}),g=S=>s(Bs(),{target:I.fromDom(S.target)}),p=S=>{S.button===0&&s(Wg(),{target:I.fromDom(S.target)})},h=()=>{q(t.editorManager.get(),S=>{t!==S&&S.dispatch("DismissPopups",{relatedTarget:t})})},b=S=>n(fm(),Ub(S)),v=S=>{s(cr(),{}),n(Bc(),Ub(S))},f=ao(I.fromDom(t.getElement())),y=zd(f,"scroll",S=>{requestAnimationFrame(()=>{const B=t.getContainer();if(B!=null){const N=mr(t,e.element).map(lt=>[lt.element,...lt.others]).getOr([]);Ko(N,lt=>Ft(lt,S.target))&&(t.dispatch("ElementScroll",{target:S.target.dom}),n(Lv(),S))}})}),x=()=>s(cr(),{}),C=S=>{S.state&&s(Bs(),{target:I.fromDom(t.getContainer())})},O=S=>{s(Bs(),{target:I.fromDom(S.relatedTarget.getContainer())})},F=S=>t.dispatch("focusin",S),R=S=>t.dispatch("focusout",S);t.on("PostRender",()=>{t.on("click",g),t.on("tap",g),t.on("mouseup",p),t.on("mousedown",h),t.on("ScrollWindow",b),t.on("ResizeWindow",v),t.on("ResizeEditor",x),t.on("AfterProgressState",C),t.on("DismissPopups",O),q([e,...o],S=>{S.element.dom.addEventListener("focusin",F),S.element.dom.addEventListener("focusout",R)})}),t.on("remove",()=>{t.off("click",g),t.off("tap",g),t.off("mouseup",p),t.off("mousedown",h),t.off("ScrollWindow",b),t.off("ResizeWindow",v),t.off("ResizeEditor",x),t.off("AfterProgressState",C),t.off("DismissPopups",O),q([e,...o],S=>{S.element.dom.removeEventListener("focusin",F),S.element.dom.removeEventListener("focusout",R)}),u.unbind(),c.unbind(),i.unbind(),l.unbind(),m.unbind(),y.unbind()}),t.on("detach",()=>{q([e,...o],R0),q([e,...o],S=>S.destroy())})},y9=$,x9=Pt,jO=w([]);var S9=Object.freeze({__proto__:null,setup:y9,isDocked:x9,getBehaviours:jO});const Jh=w(V("toolbar-height-change")),fs={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},YO="tox-tinymce--toolbar-sticky-on",XO="tox-tinymce--toolbar-sticky-off",w9=(t,e)=>{const o=Pn(e),s=yc(e).dom.innerHeight,r=Ro(o),a=I.fromDom(t.elm),c=kr(a),i=Te(a),l=c.y,u=l+i,m=mn(e),g=Te(e),p=m.top,h=p+g,b=Math.abs(p-r.top)<2,v=Math.abs(h-(r.top+s))<2;if(b&&l<h)Kd(r.left,l-g,o);else if(v&&u>p){const f=l-s+i+g;Kd(r.left,f,o)}},qu=(t,e)=>le(jt.getModes(t),e),Zh=t=>{const e=n=>qs(n)+(parseInt(to(n,"margin-top"),10)||0)+(parseInt(to(n,"margin-bottom"),10)||0),o=t.element;ws(o).each(n=>{const s="padding-"+jt.getModes(t)[0];if(jt.isDocked(t)){const r=Co(n);ct(o,"width",r+"px"),ct(n,s,e(o)+"px")}else wt(o,"width"),wt(n,s)})},KO=(t,e)=>{e?(Qt(t,fs.fadeOutClass),Or(t,[fs.transitionClass,fs.fadeInClass])):(Qt(t,fs.fadeInClass),Or(t,[fs.fadeOutClass,fs.transitionClass]))},qO=(t,e)=>{const o=I.fromDom(t.getContainer());e?(ne(o,YO),Qt(o,XO)):(ne(o,XO),Qt(o,YO))},T9=(t,e)=>{const o=Pn(e);ss(o).filter(n=>!Ft(e,n)).filter(n=>Ft(n,I.fromDom(o.dom.body))||zi(t,n)).each(()=>Re(e))},C9=(t,e)=>Qe(t).orThunk(()=>e().toOptional().bind(o=>Qe(o.element))),_9=(t,e,o)=>{t.inline||(e.header.isPositionedAtTop()||t.on("ResizeEditor",()=>{o().each(jt.reset)}),t.on("ResizeWindow ResizeEditor",()=>{o().each(Zh)}),t.on("SkinLoaded",()=>{o().each(n=>{jt.isDocked(n)?jt.reset(n):jt.refresh(n)})}),t.on("FullscreenStateChanged",()=>{o().each(jt.reset)})),t.on("AfterScrollIntoView",n=>{o().each(s=>{jt.refresh(s);const r=s.element;tv(r)&&w9(n,r)})}),t.on("PostRender",()=>{qO(t,!1)})},O9=t=>t().map(jt.isDocked).getOr(!1),E9=()=>[Ao.config({channels:{[Jh()]:{onReceive:Zh}}})],JO=(t,e)=>{const o=Rt(),n=e.getSink,s=c=>{n().each(i=>c(i.element))},r=c=>{t.inline||Zh(c),qO(t,jt.isDocked(c)),c.getSystem().broadcastOn([cr()],{}),n().each(i=>i.getSystem().broadcastOn([cr()],{}))},a=t.inline?[]:E9();return[Z.config({}),jt.config({contextual:{lazyContext:c=>{const i=qs(c.element),l=t.inline?t.getContentAreaContainer():t.getContainer();return d.from(l).map(u=>{const m=Ae(I.fromDom(u));return mr(t,c.element).fold(()=>
32{const p=m.height-i,h=m.y+(qu(c,"top")?0:i);return ke(m.x,h,m.width,p)},p=>{const h=nm(m,Jr(p)),b=qu(c,"top")?h.y:h.y+i;return ke(h.x,b,h.width,h.height-i)})})},onShow:()=>{s(c=>KO(c,!0))},onShown:c=>{s(i=>gn(i,[fs.transitionClass,fs.fadeInClass])),o.get().each(i=>{T9(c.element,i),o.clear()})},onHide:c=>{C9(c.element,n).fold(o.clear,o.set),s(i=>KO(i,!1))},onHidden:()=>{s(c=>gn(c,[fs.transitionClass]))},...fs},lazyViewport:c=>mr(t,c.element).fold(()=>{const l=eo(),u=vT(t),m=l.y+(qu(c,"top")&&!UT(t)?u:0),g=l.height-(qu(c,"bottom")?u:0);return{bounds:ke(l.x,m,l.width,g),optScrollEnv:d.none()}},l=>({bounds:Jr(l),optScrollEnv:d.some({currentScrollTop:l.element.dom.scrollTop,scrollElmTop:mn(l.element).top})})),modes:[e.header.getDockingMode()],onDocked:r,onUndocked:r}),...a]};var k9=Object.freeze({__proto__:null,setup:_9,isDocked:O9,getBehaviours:JO});const A9=t=>{const e=t.editor,o=t.sticky?JO:jO;return{uid:t.uid,dom:t.dom,components:t.components,behaviours:D(o(e,t.sharedBackstage))}};var Qh=Uo({factory:(t,e)=>{const o=(s,r)=>{const a=L(r,c=>{const i={type:"menubutton",text:c.text,fetch:u=>{u(c.getItems())},context:"any"},l=AC(i).mapError(u=>ka(u)).getOrDie();return Oi(l,"tox-mbtn",e.backstage,d.some("menuitem"))});st.set(s,a)},n={focus:U.focusIn,setMenus:o};return{uid:t.uid,dom:t.dom,components:[],behaviours:D([st.config({}),et("menubar-events",[Vt(s=>{t.onSetup(s)}),E(ls(),(s,r)=>{Dt(s.element,".tox-mbtn--active").each(a=>{as(r.event.target,".tox-mbtn").each(c=>{Ft(a,c)||s.getSystem().getByDom(a).each(i=>{s.getSystem().getByDom(c).each(l=>{Wo.expand(l),Wo.close(i),Z.focus(l)})})})})}),E(ul(),(s,r)=>{r.event.prevFocus.bind(a=>s.getSystem().getByDom(a).toOptional()).each(a=>{r.event.newFocus.bind(c=>s.getSystem().getByDom(c).toOptional()).each(c=>{Wo.isOpen(a)&&(Wo.expand(c),Wo.close(a))})})})]),U.config({mode:"flow",selector:".tox-mbtn",onEscape:s=>(t.onEscape(s),d.some(!0))}),Mt.config({})]),apis:n,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[A("dom"),A("uid"),A("onEscape"),A("backstage"),T("onSetup",$)],apis:{focus:(t,e)=>{t.focus(e)},setMenus:(t,e,o)=>{t.setMenus(e,o)}}});const D9="\u{1F49D}Get all features",M9="https://www.tiny.cloud/tinymce-upgrade-to-cloud/?utm_campaign=self_hosted_upgrade_promo&utm_source=tiny&utm_medium=referral",F9=t=>{const e=t.promotionLink?[{dom:{tag:"a",attributes:{href:M9,rel:"noopener",target:"_blank","aria-hidden":"true"},classes:["tox-promotion-link"],innerHtml:D9}}]:[];return{uid:t.uid,dom:t.dom,components:e}},$9=t=>{const{sidebars:e}=t.ui.registry.getAll();q(xe(e),o=>{const n=e[o],s=()=>Bn(d.from(t.queryCommandValue("ToggleSidebar")),o);t.ui.registry.addToggleButton(o,{icon:n.icon,tooltip:n.tooltip,onAction:r=>{t.execCommand("ToggleSidebar",!1,o),r.setActive(s())},onSetup:r=>{r.setActive(s());const a=()=>r.setActive(s());return t.on("ToggleSidebar",a),()=>{t.off("ToggleSidebar",a)}},context:"any"})})},I9=t=>({element:()=>t.element.dom}),B9=(t,e)=>{const o=L(xe(e),n=>{const s=e[n],r=hn(XW(s));return{name:n,getApi:I9,onSetup:r.onSetup,onShow:r.onShow,onHide:r.onHide}});return L(o,n=>{const s=X($);return t.slot(n.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:gi.unnamedEvents([ts(n,s),fr(n,s),E(bm(),(r,a)=>{const c=a.event;ee(o,l=>l.name===c.name).each(l=>{(c.visible?l.onShow:l.onHide)(l.getApi(r))})})])})})},R9=t=>
32qe.sketch(e=>({dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:B9(e,t),slotBehaviours:gi.unnamedEvents([Vt(o=>qe.hideAllSlots(o))])})),P9=(t,e,o)=>{ht.getCurrent(t).each(s=>{st.set(s,[R9(e)]);const r=o==null?void 0:o.toLowerCase();Et(r)&&At(e,r)&&ht.getCurrent(s).each(a=>{qe.showSlot(a,r),bo.immediateGrow(s),wt(s.element,"width"),Ju(t.element,"region")})})},Ju=(t,e)=>{nt(t,"role",e)},L9=(t,e)=>{ht.getCurrent(t).each(n=>{ht.getCurrent(n).each(r=>{bo.hasGrown(n)?qe.isShowing(r,e)?(bo.shrink(n),Ju(t.element,"presentation")):(qe.hideAllSlots(r),qe.showSlot(r,e),Ju(t.element,"region")):(qe.hideAllSlots(r),qe.showSlot(r,e),bo.grow(n),Ju(t.element,"region"))})})},V9=t=>ht.getCurrent(t).bind(o=>bo.isGrowing(o)||bo.hasGrown(o)?ht.getCurrent(o).bind(r=>ee(qe.getSlotNames(r),a=>qe.isShowing(r,a))):d.none()),tf=V("FixSizeEvent"),ef=V("AutoSizeEvent"),H9=t=>({uid:t.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"presentation"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:D([Mt.config({}),Z.config({}),bo.config({dimension:{property:"width"},closedClass:"tox-sidebar--sliding-closed",openClass:"tox-sidebar--sliding-open",shrinkingClass:"tox-sidebar--sliding-shrinking",growingClass:"tox-sidebar--sliding-growing",onShrunk:e=>{ht.getCurrent(e).each(qe.hideAllSlots),pt(e,ef)},onGrown:e=>{pt(e,ef)},onStartGrow:e=>{Y(e,tf,{width:Le(e.element,"width").getOr("")})},onStartShrink:e=>{Y(e,tf,{width:Co(e.element)+"px"})}}),st.config({}),ht.config({find:e=>{const o=st.contents(e);return $n(o)}})])}],behaviours:D([Mn.childAt(0),et("sidebar-sliding-events",[E(tf,(e,o)=>{ct(e.element,"width",o.event.width)}),E(ef,(e,o)=>{wt(e.element,"width")})])])}),N9=t=>(e,o)=>({dom:{tag:"div",attributes:{"aria-label":t.translate("Loading..."),tabindex:"0"},classes:["tox-throbber__busy-spinner"]},components:[{dom:Is('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}),ZO=t=>ht.getCurrent(t).each(e=>Re(e.element,!0)),z9=(t,e)=>{const o="tabindex",n=`data-mce-${o}`;d.from(t.iframeElement).map(I.fromDom).each(s=>{e?(Pe(s,o).each(r=>nt(s,n,r)),nt(s,o,-1)):(oe(s,o),Pe(s,n).each(r=>{nt(s,o,r),oe(s,n)}))})},U9=(t,e,o,n)=>{const s=e.element;
32if(z9(t,o),o)Xn.block(e,N9(n)),wt(s,"display"),oe(s,"aria-hidden"),t.hasFocus()&&ZO(e);else{const r=ht.getCurrent(e).exists(a=>Ta(a.element));Xn.unblock(e),ct(s,"display","none"),nt(s,"aria-hidden","true"),r&&t.focus()}},W9=t=>({uid:t.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:D([st.config({}),Xn.config({focus:!1}),ht.config({find:e=>$n(e.components())})]),components:[]}),G9=t=>t.type==="focusin",j9=t=>G9(t)?(t.composed?$n(t.composedPath()):d.from(t.target)).map(I.fromDom).filter(Bo).exists(o=>po(o,"mce-pastebin")):!1,Y9=(t,e,o)=>{const n=X(!1),s=Rt(),r=c=>{n.get()&&!j9(c)&&(c.preventDefault(),ZO(e()),t.editorManager.setActive(t))};t.inline||t.on("PreInit",()=>{t.dom.bind(t.getWin(),"focusin",r),t.on("BeforeExecCommand",c=>{c.command.toLowerCase()==="mcefocus"&&c.value!==!0&&r(c)})});const a=c=>{c!==n.get()&&(n.set(c),U9(t,e(),c,o.providers),I3(t,c))};t.on("ProgressState",c=>{if(s.on(clearTimeout),ns(c.time)){const i=vu.setEditorTimeout(t,()=>a(c.state),c.time);s.set(i)}else a(c.state),s.clear()})},QO=t=>{const e=t.label.isNone()?t.title.fold(()=>({}),o=>({attributes:{"aria-label":o}})):t.label.fold(()=>({}),o=>({attributes:{"aria-label":o}}));return{dom:{tag:"div",classes:["tox-toolbar__group"].concat(t.label.isSome()?["tox-toolbar__group_with_label"]:[]),...e},components:[...t.label.map(o=>({dom:{tag:"span",classes:["tox-label","tox-label--context-toolbar"]},components:[Nt(o)]})).toArray(),fu.parts.items({})],items:t.items,markers:{itemSelector:"*:not(.tox-split-button) > .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-item:not([disabled]), .tox-number-input:not([disabled])"},tgroupBehaviours:D([Mt.config({}),Z.config({ignore:!0})])}},Zu=t=>fu.sketch(QO(t)),tE=(t,e)=>{const o=Vt(n=>{const s=L(t.initGroups,Zu);qn.setGroups(n,s)});return D([sn.toolbarButton(()=>t.providers.checkUiComponentContext("any").shouldDisable),re(()=>t.providers.checkUiComponentContext("any")),U.config({mode:e,onEscape:t.onEscape,visibilitySelector:".tox-toolbar__overflow",selector:".tox-toolbar__group"}),et("toolbar-events",[o])])},eE=t=>{const e=t.cyclicKeying?"cyclic":"acyclic";return{uid:t.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":QO({title:d.none(),label:d.none(),items:[]}),"overflow-button":q5({context:"any",name:"more",icon:d.some("more-drawer"),enabled:!0,tooltip:d.some("Reveal or hide additional toolbar items"),primary:!1,buttonType:d.none(),borderless:!1},d.none(),t.providers,[],"overflow-button")},splitToolbarBehaviours:tE(t,e)}},X9=t=>{const e=eE(t),o=4,n=rT.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return rT.sketch({...e,lazySink:t.getSink,getOverflowBounds:()=>{const s=t.moreDrawerData.lazyHeader().element,r=kr(s),a=Ld(s),c=kr(a),i=Math.max(a.dom.scrollHeight,c.height);return ke(r.x+o,c.y,r.width-o*2,i)},parts:{...e.parts,overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:t.attributes}}},components:[n],markers:{overflowToggledClass:"tox-tbtn--enabled"},onOpened:s=>t.onToggled(s,!0),onClosed:s=>t.onToggled(s,!1)})},K9=t=>{const e=bp.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),o=bp.parts.overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),n=eE(t);return bp.sketch({...n,components:[e,o],markers:{openClass:"tox-toolbar__overflow--open",closedClass:"tox-toolbar__overflow--closed",growingClass:"tox-toolbar__overflow--growing",shrinkingClass:"tox-toolbar__overflow--shrinking",overflowToggledClass:"tox-tbtn--enabled"},onOpened:s=>{s.getSystem().broadcastOn([Jh()],{type:"opened"}),t.onToggled(s,!0)},onClosed:s=>{s.getSystem().broadcastOn([Jh()],{type:"closed"}),t.onToggled(s,!1)}})},Qu=t=>{const e=t.cyclicKeying?"cyclic":"acyclic";return qn.sketch({uid:t.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(t.type===en.scrolling?["tox-toolbar--scrolling"]:[])},components:[qn.parts.groups({})],toolbarBehaviours:tE(t,e)})},q9=(t,e)=>{var o,n;const s=t.type==="togglebutton",r=t.icon.map(x=>xr(x,e.icons)).map(St),c=x=>{const C=S=>{r.map(B=>B.getOpt(x).each(G=>{st.set(G,[xr(S,e.icons)])}))},O=S=>{const B=x.element;S?(ne(B,"tox-button--enabled"),nt(B,"aria-pressed",!0)):(Qt(B,"tox-button--enabled"),oe(B,"aria-pressed"))},F=()=>po(x.element,"tox-button--enabled"),R=()=>Re(x.element);if(s)return t.onAction({setIcon:C,setActive:O,isActive:F,focus:R});if(t.type==="button")return t.onAction({setIcon:C})},i={...t,name:s?t.text.getOr(t.icon.getOr("")):(o=t.text)!==null&&o!==void 0?o:t.icon.getOr(""),primary:t.buttonType==="primary",buttonType:d.from(t.buttonType),tooltip:t.tooltip,icon:t.icon,enabled:!0,borderless:t.borderless},l=jh((n=t.buttonType)!==null&&n!==void 0?n:"secondary"),u=s?t.text.map(e.translate):d.some(e.translate(t.text)),m=u.map(Nt),g=i.tooltip.or(u).map(x=>({"aria-label":e.translate(x)})).getOr({}),p=r.map(x=>x.asSpec()),h=Qa([p,m]),b=t.icon.isSome()&&m.isSome(),v={tag:"button",classes:l.concat(...t.icon.isSome()&&!b?["tox-button--icon"]:[]).concat(...b?["tox-button--icon-and-text"]:[]).concat(...t.borderless?["tox-button--naked"]:[]).concat(...t.type==="togglebutton"&&t.active?["tox-button--enabled"]:[]),attributes:g},f=[],y=Yu(i,d.some(c),f,v,h,t.tooltip,e);return Fe.sketch(y)},oE=(t,e)=>q9(t,e),J9=(t,e)=>({dom:{tag:"div",classes:["tox-view__toolbar__group"]},components:L(t.buttons,o=>oE(o,e))}),nE=Rn().deviceType,Z9=nE.isPhone(),Q9=nE.isTablet(),t6=t=>{let e=!1;const o=L(t.buttons,n=>n.type==="group"?(e=!0,J9(n,t.providers)):oE(n,t.providers));return{uid:t.uid,dom:{tag:"div",classes:[e?"tox-view__toolbar":"tox-view__header",...Z9||Q9?["tox-view--mobile","tox-view--scrolling"]:[]]},behaviours:D([Z.config({}),U.config({mode:"flow",selector:"button, .tox-button",focusInside:tr.OnEnterOrSpaceMode})]),components:e?o:[Kn.sketch({dom:{tag:"div",classes:["tox-view__header-start"]},components:[]}),Kn.sketch({dom:{tag:"div",classes:["tox-view__header-end"]}
32,components:o})]}},e6=t=>({uid:t.uid,behaviours:D([Z.config({}),Mt.config({})]),dom:{tag:"div",classes:["tox-view__pane"]}}),o6=(t,e,o,n)=>{const s={getPane:r=>Se.getPart(r,t,"pane"),getOnShow:r=>t.viewConfig.onShow,getOnHide:r=>t.viewConfig.onHide};return{uid:t.uid,dom:t.dom,components:e,behaviours:D([Z.config({}),U.config({mode:"cyclic",focusInside:tr.OnEnterOrSpaceMode})]),apis:s}};var oc=oo({name:"silver.View",configFields:[A("viewConfig")],partFields:[tn({factory:{sketch:t6},schema:[A("buttons"),A("providers")],name:"header"}),tn({factory:{sketch:e6},schema:[],name:"pane"})],factory:o6,apis:{getPane:(t,e)=>t.getPane(e),getOnShow:(t,e)=>t.getOnShow(e),getOnHide:(t,e)=>t.getOnHide(e)}});const n6=(t,e,o)=>Li(e,(n,s)=>{const r=hn(s3(n));return t.slot(s,oc.sketch({dom:{tag:"div",classes:["tox-view"]},viewConfig:r,components:[...r.buttons.length>0?[oc.parts.header({buttons:r.buttons,providers:o})]:[],oc.parts.pane({})]}))}),s6=(t,e)=>qe.sketch(o=>({dom:{tag:"div",classes:["tox-view-wrap__slot-container"]},components:n6(o,t,e),slotBehaviours:gi.unnamedEvents([Vt(n=>qe.hideAllSlots(n))])})),sE=t=>ee(qe.getSlotNames(t),e=>qe.isShowing(t,e)),r6=t=>{const e=t.element;ct(e,"display","none"),nt(e,"aria-hidden","true")},a6=t=>{const e=t.element;wt(e,"display"),oe(e,"aria-hidden")},c6=t=>({getContainer:w(t)}),rE=(t,e,o)=>{qe.getSlot(t,e).each(n=>{oc.getPane(n).each(s=>{o(n)(c6(s.element.dom))})})},i6=(t,e)=>rE(t,e,oc.getOnShow),l6=(t,e)=>rE(t,e,oc.getOnHide);var td=Uo({factory:(t,e)=>{const r={setViews:(a,c)=>{st.set(a,[s6(c,e.backstage.shared.providers)])},whichView:a=>ht.getCurrent(a).bind(sE),toggleView:(a,c,i,l)=>ht.getCurrent(a).exists(u=>{const m=sE(u),g=m.exists(h=>l===h),p=qe.getSlot(u,l).isSome();return p&&(qe.hideAllSlots(u),g?(r6(a),c()):(i(),a6(a),qe.showSlot(u,l),i6(u,l)),m.each(h=>l6(u,h))),p})};return{uid:t.uid,dom:{tag:"div",classes:["tox-view-wrap"],attributes:{"aria-hidden":"true"},styles:{display:"none"}},components:[],behaviours:D([st.config({}),ht.config({find:a=>{const c=st.contents(a);return $n(c)}})]),apis:r}},name:"silver.ViewWrapper",configFields:[A("backstage")],apis:{setViews:(t,e,o)=>t.setViews(e,o),toggleView:(t,e,o,n,s)=>t.toggleView(e,o,n,s),whichView:(t,e)=>t.whichView(e)}});const u6=(t,e,o)=>{let n=!1;const s=a=>{iM(a,".tox-statusbar").each(c=>{to(c,"display")==="none"&&Ee(c,"aria-hidden")==="true"?(wt(c,"display"),oe(c,"aria-hidden")):(ct(c,"display","none"),nt(c,"aria-hidden","true"))})},r={getSocket:a=>Se.getPart(a,t,"socket"),setSidebar:(a,c,i)=>{Se.getPart(a,t,"sidebar").each(l=>P9(l,c,i))},toggleSidebar:(a,c)=>{Se.getPart(a,t,"sidebar").each(i=>L9(i,c))},whichSidebar:a=>Se.getPart(a,t,"sidebar").bind(V9).getOrNull(),getHeader:a=>Se.getPart(a,t,"header"),getToolbar:a=>Se.getPart(a,t,"toolbar"),setToolbar:(a,c)=>{Se.getPart(a,t,"toolbar").each(i=>{const l=L(c,Zu);i.getApis().setGroups(i,l)})},setToolbars:(a,c)=>{Se.getPart(a,t,"multiple-toolbar").each(i=>{const l=L(c,u=>L(u,Zu));tw.setItems(i,l)})},refreshToolbar:a=>{Se.getPart(a,t,"toolbar").each(i=>i.getApis().refresh(i))},toggleToolbarDrawer:a=>{Se.getPart(a,t,"toolbar").each(c=>{tb(c.getApis().toggle,i=>i(c))})},toggleToolbarDrawerWithoutFocusing:a=>{Se.getPart(a,t,"toolbar").each(c=>{tb(c.getApis().toggleWithoutFocusing,i=>i(c))})},isToolbarDrawerToggled:a=>Se.getPart(a,t,"toolbar").bind(c=>d.from(c.getApis().isOpen).map(i=>i(c))).getOr(!1),getThrobber:a=>Se.getPart(a,t,"throbber"),focusToolbar:a=>{Se.getPart(a,t,"toolbar").orThunk(()=>Se.getPart(a,t,"multiple-toolbar")).each(i=>{U.focusIn(i)})},setMenubar:(a,c)=>{Se.getPart(a,t,"menubar").each(i=>{Qh.setMenus(i,c)})},focusMenubar:a=>{Se.getPart(a,t,"menubar").each(c=>{Qh.focus(c)})},setViews:(a,c)=>{Se.getPart(a,t,"viewWrapper").each(i=>{td.setViews(i,c)})},toggleView:(a,c)=>Se.getPart(a,t,"viewWrapper").exists(i=>td.toggleView(i,()=>r.showMainView(a),()=>r.hideMainView(a),c)),whichView:a=>Se.getPart(a,t,"viewWrapper").bind(td.whichView).getOrNull(),hideMainView:a=>{n=r.isToolbarDrawerToggled(a),n&&r.toggleToolbarDrawer(a),Se.getPart(a,t,"editorContainer").each(c=>{const i=c.element;s(i),ct(i,"display","none"),nt(i,"aria-hidden","true")})},showMainView:a=>{n&&r.toggleToolbarDrawer(a),Se.getPart(a,t,"editorContainer").each(c=>{const i=c.element;s(i),wt(i,"display"),oe(i,"aria-hidden")})}};return{uid:t.uid,dom:t.dom,components:e,apis:r,behaviours:t.behaviours}},d6=gs.optional({factory:Qh,name:"menubar",schema:[A("backstage")]}),m6=t=>t.type===en.sliding?K9:t.type===en.floating?X9:Qu,g6=gs.optional({factory:{sketch:t=>tw.sketch({uid:t.uid,dom:t.dom,listBehaviours:D([U.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:()=>Qu({type:t.type,uid:V("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:t.providers,onEscape:()=>(t.onEscape(),d.some(!0))}),setupItem:(e,o,n,s)=>{qn.setGroups(o,n)},shell:!0})},name:"multiple-toolbar",schema:[A("dom"),A("onEscape")]}),p6=gs.optional({factory:{sketch:t=>{const e=m6(t),o={type:t.type,uid:t.uid,onEscape:()=>(t.onEscape(),d.some(!0)),onToggled:(n,s)=>t.onToolbarToggled(s),cyclicKeying:!1,initGroups:[],getSink:t.getSink,providers:t.providers,moreDrawerData:{lazyToolbar:t.lazyToolbar,lazyMoreButton:t.lazyMoreButton,lazyHeader:t.lazyHeader},attributes:t.attributes};return e(o)}},name:"toolbar",schema:[A("dom"),A("onEscape"),A("getSink")]}),h6=gs.optional({factory:{sketch:A9},name:"header",schema:[A("dom")]}),f6=gs.optional({factory:{sketch:F9},name:"promotion",schema:[A("dom"),A("promotionLink")]}),b6=gs.optional({name:"socket",schema:[A("dom")]}),v6=gs.optional({factory:{sketch:H9},name:"sidebar",schema:[A("dom")]}),y6=gs.optional({factory:{sketch:W9},name:"throbber",schema:[A("dom")]}),x6=gs.optional({factory:td,name:"viewWrapper",schema:[A("backstage")]}),S6=t=>({uid:t.uid,dom:{tag:"div",classes:["tox-editor-container"]},components:t.components}),w6=gs.optional({factory:{sketch:S6},name:"editorContainer",schema:[]});var Bt=oo({name:"OuterContainer",factory:u6,configFields:[A("dom"),A("behaviours")],partFields:[h6,d6,p6,g6,b6,v6,f6,y6,x6,w6],apis:{getSocket:(t,e)=>t.getSocket(e),setSidebar:(t,e,o,n)=>{t.setSidebar(e,o,n)},toggleSidebar:(t,e,o)=>{t.toggleSidebar(e,o)},whichSidebar:(t,e)=>t.whichSidebar(e),getHeader:(t,e)=>t.getHeader(e),getToolbar:(t,e)=>t.getToolbar(e),setToolbar:(t,e,o)=>{t.setToolbar(e,o)},setToolbars:(t,e,o)=>{t.setToolbars(e,o)},refreshToolbar:(t,e)=>t.refreshToolbar(e),toggleToolbarDrawer:(t,e)=>{t.toggleToolbarDrawer(e)},toggleToolbarDrawerWithoutFocusing:(t,e)=>{t.toggleToolbarDrawerWithoutFocusing(e)},isToolbarDrawerToggled:(t,e)=>t.isToolbarDrawerToggled(e),getThrobber:(t,e)=>t.getThrobber(e),setMenubar:(t,e,o)=>{t.setMenubar(e,o)},focusMenubar:(t,e)=>{t.focusMenubar(e)},focusToolbar:(t,e)=>{t.focusToolbar(e)}
32,setViews:(t,e,o)=>{t.setViews(e,o)},toggleView:(t,e,o)=>t.toggleView(e,o),whichView:(t,e)=>t.whichView(e)}});const T6="file edit view insert format tools table help",aE={file:{title:"File",items:"newdocument restoredraft | preview | importword exportpdf exportword | export print | deleteallconversations"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall | searchreplace"},view:{title:"View",items:"code revisionhistory | visualaid visualchars visualblocks | spellchecker | preview fullscreen | showcomments"},insert:{title:"Insert",items:"image link media addcomment pageembed inserttemplate codesample inserttable accordion math | charmap emoticons hr | pagebreak nonbreaking anchor tableofcontents footnotes | mergetags | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | styles blocks fontfamily fontsize align lineheight | forecolor backcolor | language | removeformat"},tools:{title:"Tools",items:"aidialog aishortcuts | spellchecker spellcheckerlanguage | autocorrect capitalization | a11ycheck code typography wordcount addtemplate"},table:{title:"Table",items:"inserttable | cell row column | advtablesort | tableprops deletetable"},help:{title:"Help",items:"help"}},C6=(t,e,o)=>{const n=hT(o).split(/[ ,]/);return{text:t.title,getItems:()=>ye(t.items,s=>{const r=s.toLowerCase();return r.trim().length===0?[]:Ko(n,a=>a===r)?[]:r==="separator"||r==="|"?[{type:"separator"}]:e.menuItems[r]?[e.menuItems[r]]:[]})}},of=t=>t.split(" "),cE=(t,e)=>{const o={...aE,...e.menus},n=xe(e.menus).length>0,s=e.menubar===void 0||e.menubar===!0?of(T6):of(e.menubar===!1?"":e.menubar),r=Wt(s,c=>{const i=At(aE,c);return n?i||tt(e.menus,c).exists(l=>At(l,"items")):i}),a=L(r,c=>{const i=o[c];return C6({title:i.title,items:of(i.items)},e,t)});return Wt(a,c=>{const i=l=>Et(l)||l.type!=="separator";return c.getItems().length>0&&Ko(c.getItems(),i)})},_6=t=>{const e=()=>{t._skinLoaded=!0,D3(t)};return()=>{t.initialized?e():t.on("init",e)}},O6=(t,e)=>()=>M3(t,{message:e}),E6=t=>{const e=RT(t);return e?d.from(e):d.none()},iE=(t,e,o)=>(t.on("remove",()=>o.unload(e)),o.load(e)),ed=(t,e,o,n)=>(t.on("remove",()=>n.unloadRawCss(e)),n.loadRawCss(e,o)),k6=(t,e)=>"ui/"+t+"/"+e,A6=t=>d.from(tinymce.Resource.get(t)).filter(Et),nf=(t,e,o="")=>{const n=E6(t).map(r=>k6(r,`${e}.css`)),s=n.bind(A6);return ya(n,s,(r,a)=>({_kind:"load-raw",key:r,css:a})).getOrThunk(()=>{const r=t.editorManager.suffix;return{_kind:"load-stylesheet",url:o+`/${e}${r}.css`}})},D6=(t,e)=>{const o=t.ui.styleSheetLoader,n=nf(t,"skin",e);switch(n._kind){case"load-raw":const{key:s,css:r}=n;return ed(t,s,r,o),Promise.resolve();case"load-stylesheet":const{url:a}=n;return iE(t,a,o);default:return Promise.resolve()}},M6=(t,e)=>{if(AD(I.fromDom(t.getElement()))){const n=oi.DOM.styleSheetLoader,s=nf(t,"skin.shadowdom",e);switch(s._kind){case"load-raw":const{key:r,css:a}=s;return ed(t,r,a,n),Promise.resolve();case"load-stylesheet":const{url:c}=s;return iE(t,c,n);default:return Promise.resolve()}}else return Promise.resolve()},F6=(t,e,o)=>{const s=nf(t,e?"content.inline":"content",o);switch(s._kind){case"load-raw":const{key:r,css:a}=s;return e?ed(t,r,a,t.ui.styleSheetLoader):t.on("PostRender",()=>{ed(t,r,a,t.dom.styleSheetLoader)}),Promise.resolve();case"load-stylesheet":const{url:c}=s;return o&&t.contentCSS.push(c),Promise.resolve();default:return Promise.resolve()}},$6=async(t,e)=>{const o=PT(e);if(await F6(e,t,o),!Op(e)&&Et(o))return Promise.all([D6(e,o),M6(e,o)]).then()},lE=(t,e)=>$6(t,e).then(_6(e),O6(e,"Skin could not be loaded")),I6=mo(lE,!1),B6=mo(lE,!0),uE=t=>({isEnabled:()=>!z.isDisabled(t),setEnabled:e=>z.set(t,!e),setText:e=>Y(t,rn,{text:e}),setIcon:e=>Y(t,ua,{icon:e})}),R6=t=>({setActive:e=>{it.set(t,e)},isActive:()=>it.isOn(t),isEnabled:()=>!z.isDisabled(t),setEnabled:e=>z.set(t,!e),setText:e=>Y(t,rn,{text:e}),setIcon:e=>Y(t,ua,{icon:e})}),dE=(t,e)=>t.map(o=>({"aria-label":e.translate(o)})).getOr({}),mE=V("focus-button"),sf=(t,e,o,n,s,r,a)=>{const c=e.map(l=>St(rO(l,"tox-tbtn",s))),i=t.map(l=>St(xr(l,s.icons)));return{dom:{tag:"button",classes:["tox-tbtn"].concat(e.isSome()?["tox-tbtn--select"]:[]),attributes:{...dE(o,s),...$e(a)?{"data-mce-name":a}:{}}}
32,components:Qa([i.map(l=>l.asSpec()),c.map(l=>l.asSpec())]),eventOrder:{[Vo()]:["focusing","alloy.base.behaviour",yr],[Wn()]:[yr,"toolbar-group-button-events"],[us()]:[yr,"toolbar-group-button-events","tooltipping"]},buttonBehaviours:D([sn.toolbarButton(()=>s.checkUiComponentContext(r).shouldDisable),re(()=>s.checkUiComponentContext(r)),et(yr,[Vt((l,u)=>Hh(l)),E(rn,(l,u)=>{c.bind(m=>m.getOpt(l)).each(m=>{st.set(m,[Nt(s.translate(u.event.text))])})}),E(ua,(l,u)=>{i.bind(m=>m.getOpt(l)).each(m=>{st.set(m,[xr(u.event.icon,s.icons)])})}),E(Vo(),(l,u)=>{u.event.prevent(),pt(l,mE)})])].concat(n.getOr([])))}},P6=(t,e,o,n,s)=>{const r=e.shared,a=X($),c={toolbarButtonBehaviours:[],getApi:uE,onSetup:t.onSetup},i=[et("toolbar-group-button-events",[ts(c,a),fr(c,a)]),...t.tooltip.map(l=>zt.config(e.shared.providers.tooltips.getConfig({tooltipText:e.shared.providers.translate(l)}))).toArray()];return ir.sketch({lazySink:r.getSink,fetch:()=>Be.nu(l=>{l(L(o(t.items),Zu))}),markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:sf(t.icon,t.text,t.tooltip,d.some(i),r.providers,t.context,s),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:n}}}})},gE=(t,e,o,n)=>{var s;const r=X($),a=sf(t.icon,t.text,t.tooltip,d.none(),o,t.context,n);return Fe.sketch({dom:a.dom,components:a.components,eventOrder:nO,buttonBehaviours:{...D([et("toolbar-button-events",[_5({onAction:t.onAction,getApi:e.getApi}),ts(e,r),fr(e,r)]),...t.tooltip.map(c=>zt.config(o.tooltips.getConfig({tooltipText:o.translate(c)+t.shortcut.map(i=>` (${gh(i)})`).getOr("")}))).toArray(),sn.toolbarButton(()=>!t.enabled||o.checkUiComponentContext(t.context).shouldDisable),re(()=>o.checkUiComponentContext(t.context))].concat(e.toolbarButtonBehaviours)),[yr]:(s=a.buttonBehaviours)===null||s===void 0?void 0:s[yr]}})},L6=(t,e,o)=>rf(t,e,[],o),rf=(t,e,o,n)=>gE(t,{toolbarButtonBehaviours:o.length>0?[et("toolbarButtonWith",o)]:[],getApi:uE,onSetup:t.onSetup},e,n),V6=(t,e,o)=>pE(t,e,[],o),pE=(t,e,o,n)=>gE(t,{toolbarButtonBehaviours:[st.config({}),it.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(o.length>0?[et("toolbarToggleButtonWith",o)]:[]),getApi:R6,onSetup:t.onSetup},e,n),H6=(t,e,o)=>n=>Be.nu(s=>e.fetch(s)).map(s=>d.from(Dh(Jt(Vu(V("menu-value"),s,r=>{e.onItemAction(t(n),r)},e.columns,e.presets,An.CLOSE_ON_EXECUTE,e.select.getOr(Pt),o),{movement:xi(e.columns,e.presets),menuBehaviours:gi.unnamedEvents(e.columns!=="auto"?[]:[Vt((r,a)=>{dh(r,4,pC(e.presets)).each(({numRows:c,numColumns:i})=>{U.setGridSize(r,c,i)})})])})))),N6=(t,e,o)=>{const n=X(t.tooltip.getOr("")),s=c=>({isEnabled:()=>!z.isDisabled(c),setEnabled:i=>z.set(c,!i),setIconFill:(i,l)=>{Dt(c.element,`svg path[class="${i}"], rect[class="${i}"]`).each(u=>{nt(u,"fill",l)})},setActive:i=>{nt(c.element,"aria-pressed",i),Dt(c.element,"span").each(l=>{c.getSystem().getByDom(l).each(u=>it.set(u,i))})},isActive:()=>Dt(c.element,"span").exists(i=>c.getSystem().getByDom(i).exists(it.isOn)),setText:i=>Dt(c.element,"span").each(l=>c.getSystem().getByDom(l).each(u=>Y(u,rn,{text:i}))),setIcon:i=>Dt(c.element,"span").each(l=>c.getSystem().getByDom(l).each(u=>Y(u,ua,{icon:i}))),setTooltip:i=>{const l=e.providers.translate(i);nt(c.element,"aria-label",l),n.set(i)}}),r=X($),a={getApi:s,onSetup:t.onSetup};return pu.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:{"aria-pressed":!1,...dE(t.tooltip,e.providers),...$e(o)?{"data-mce-name":o}:{}}},onExecute:c=>{const i=s(c);i.isEnabled()&&t.onAction(i)},onItemExecute:(c,i,l)=>{},splitDropdownBehaviours:D([et("split-dropdown-events",[Vt((c,i)=>Hh(c)),E(mE,Z.focus),ts(a,r),fr(a,r)]),sn.splitButton(()=>e.providers.isDisabled()||e.providers.checkUiComponentContext(t.context).shouldDisable),re(()=>e.providers.checkUiComponentContext(t.context)),Zc.config({}),...t.tooltip.map(c=>zt.config({...e.providers.tooltips.getConfig({tooltipText:e.providers.translate(c),onShow:i=>{if(n.get()!==c){const l=e.providers.translate(n.get());zt.setComponents(i,e.providers.tooltips.getComponents({tooltipText:l}))}}})})).toArray()]),eventOrder:{[Wn()]:["alloy.base.behaviour","split-dropdown-events","tooltipping"],[us()]:["split-dropdown-events","tooltipping"]},toggleClass:"tox-tbtn--enabled",lazySink:e.getSink,fetch:H6(s,t,e.providers),parts:{menu:ku(!1,t.columns,t.presets)},components:[pu.parts.button(sf(t.icon,t.text,d.none(),d.some([it.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1}),sn.toolbarButton(Pt),re(w({contextType:"any",shouldDisable:!1}))]),e.providers,t.context)),pu.parts.arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:cC("chevron-down",e.providers.icons)},buttonBehaviours:D([sn.splitButton(Pt),re(w({contextType:"any",shouldDisable:!1}))])}),pu.parts["aria-descriptor"]({text:e.providers.translate("To open the popup, press Shift+Enter")})]})},z6=".tox-toolbar-slider__input,.tox-toolbar-textfield",hE=t=>{Yt.getContent(t).each(e=>{Dt(e.element,z6).fold(()=>U.focusIn(e),Re)})},U6=t=>Qe(t.element).each(e=>{Hn(e,'[tabindex="-1"]').each(o=>{Re(o)})}),fE=V("forward-slide"),od=V("backward-slide"),af=V("change-slide-event"),cf="tox-pop--resizing",W6=t=>{const e=X([]);return{sketch:Yt.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:n=>{e.set([]),Yt.getContent(n).each(s=>{wt(s.element,"visibility")}),Qt(n.element,cf),wt(n.element,"width")},onHide:()=>{e.set([]),t.onHide()},inlineBehaviours:D([et("context-toolbar-events",[Ba(Mc(),(n,s)=>{s.event.raw.propertyName==="width"&&(Qt(n.element,cf),wt(n.element,"width"))}),E(af,(n,s)=>{const r=n.element;wt(r,"width");const a=Co(r),c=Qe(n.element).isSome();wt(r,"left"),wt(r,"right"),wt(r,"max-width"),Yt.setContent(n,s.event.contents),ne(r,cf);const i=Co(r);ct(r,"transition","none"),Yt.reposition(n),wt(r,"transition"),ct(r,"width",a+"px"),s.event.focus.fold(()=>{c&&hE(n)},l=>{ss(ao(n.element)).fold(()=>Re(l),u=>{Ft(u,l)||Re(l)})}),setTimeout(()=>{ct(n.element,"width",i+"px")},0)}),E(fE,(n,s)=>{Yt.getContent(n).each(r=>{e.set(e.get().concat([{bar:r,focus:ss(ao(n.element))}]))}),Y(n,af,{contents:s.event.forwardContents,focus:d.none()})}),E(od,(n,s)=>{t.onBack(),Od(e.get()).each(r=>{e.set(e.get().slice(0,e.get().length-1)),Y(n,af,{contents:zo(r.bar),focus:r.focus})})})]),U.config({mode:"special",onEscape:n=>Od(e.get()).fold(()=>t.onEscape(),s=>(pt(n,od),d.some(!0)))})]),lazySink:()=>mt.value(t.sink)}),inSubtoolbar:()=>e.get().length>0}},G6=(t,e)=>{const o=hn(ch({type:"button",icon:"chevron-left",tooltip:"Back",onAction:$}));return rf(o,e.shared.providers,[E(Vh,n=>{pt(n,od)})])},nc=(t,e,o)=>Ni(o)?t.translate(e):t.translate([e,t.translate(o)]),j6=(t,e)=>{const o=(a,c,i,l)=>{const u=t.shared.providers.translate(a.title);if(a.type==="separator")return d.some({type:"separator",text:u});if(a.type==="submenu"){const m=ye(a.getStyleItems(),g=>n(g,c,l));return c===0&&m.length<=0?d.none():d.some({type:"nestedmenuitem",text:u,enabled:m.length>0,getSubmenuItems:()=>ye(a.getStyleItems(),g=>n(g,c,l))})}else return d.some({type:"togglemenuitem",text:u,icon:a.icon,active:a.isSelected(l),enabled:!i,onAction:e.onAction(a),...a.getStylePreview().fold(()=>({}),m=>({meta:{style:m}}))})},n=(a,c,i)=>{const l=a.type==="formatter"&&e.isInvalid(a);return c===0?l?[]:o(a,c,!1,i).toArray():o(a,c,l,i).toArray()},s=a=>{const c=e.getCurrentValue(),i=e.shouldHide?0:1;return ye(a,l=>n(l,i,c))};
32return{validateItems:s,getFetch:(a,c)=>(i,l)=>{const u=c(),m=s(u),g=ec(m,An.CLOSE_ON_EXECUTE,a,{isHorizontalMenu:!1,search:d.none()});l(g)}}},sc=(t,e)=>{const o=e.dataset,n=o.type==="basic"?()=>L(o.data,s=>$O(s,e.isSelectedFor,e.getPreviewFor)):o.getData;return{items:j6(t,e),getStyleItems:n}},ki=(t,e,o,n,s,r)=>{const{items:a,getStyleItems:c}=sc(e,o),i=X(o.tooltip),l=m=>({getComponent:w(m),setTooltip:g=>{const p=e.shared.providers.translate(g);nt(m.element,"aria-label",p),i.set(g)}}),u=m=>{const g=p=>m.setTooltip(nc(t,n(p.value),p.value));return t.on(s,g),Ru(ca(t,"NodeChange",p=>{const h=p.getComponent();o.updateText(h),z.set(p.getComponent(),!t.selection.isEditable()||c().length===0)})(m),()=>t.off(s,g))};return zh({context:"mode:design",text:o.icon.isSome()?d.none():o.text,icon:o.icon,ariaLabel:d.some(o.tooltip),tooltip:d.none(),role:d.none(),fetch:a.getFetch(e,c),onSetup:u,getApi:l,columns:1,presets:"normal",classes:o.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[zt.config({...e.shared.providers.tooltips.getConfig({tooltipText:e.shared.providers.translate(o.tooltip),onShow:m=>{if(o.tooltip!==i.get()){const g=e.shared.providers.translate(i.get());zt.setComponents(m,e.shared.providers.tooltips.getComponents({tooltipText:g}))}}})})]},"tox-tbtn",e.shared,r)},Y6=t=>L(t,e=>{let o=e,n=e;const s=e.split("=");return s.length>1&&(o=s[0],n=s[1]),{title:o,format:n}}),X6=t=>({type:"basic",data:t});var rc;(function(t){t[t.SemiColon=0]="SemiColon",t[t.Space=1]="Space"})(rc||(rc={}));const K6=(t,e)=>e===rc.SemiColon?t.replace(/;$/,"").split(";"):t.split(" "),lf=(t,e,o)=>{const n=t.options.get(e);return{type:"basic",data:Y6(K6(n,o))}},q6="Align",bE=w("Alignment {0}"),vE="left",uf=[{title:"Left",icon:"align-left",format:"alignleft",command:"JustifyLeft"},{title:"Center",icon:"align-center",format:"aligncenter",command:"JustifyCenter"},{title:"Right",icon:"align-right",format:"alignright",command:"JustifyRight"},{title:"Justify",icon:"align-justify",format:"alignjustify",command:"JustifyFull"}],yE=t=>{const e=()=>ee(uf,c=>t.formatter.match(c.format)),o=c=>()=>t.formatter.match(c),n=c=>d.none,s=c=>{const l=e().fold(w(vE),u=>u.title.toLowerCase());Y(c,ua,{icon:`align-${l}`}),L3(t,{value:l})},r=X6(uf),a=c=>()=>ee(uf,i=>i.format===c.format).each(i=>t.execCommand(i.command));return{tooltip:nc(t,bE(),vE),text:d.none(),icon:d.some("align-left"),isSelectedFor:o,getCurrentValue:d.none,getPreviewFor:n,onAction:a,updateText:s,dataset:r,shouldHide:!1,isInvalid:c=>!t.formatter.canApply(c.format)}},J6=(t,e)=>ki(t,e,yE(t),bE,"AlignTextUpdate","align"),Z6=(t,e)=>{const o=sc(e,yE(t));t.ui.registry.addNestedMenuItem("align",{text:e.shared.providers.translate(q6),onSetup:no(t),getSubmenuItems:()=>o.items.validateItems(o.getStyleItems())})},xE=(t,e)=>{const o=e(),n=L(o,s=>s.format);return d.from(t.formatter.closest(n)).bind(s=>ee(o,r=>r.format===s))},Q6="Blocks",SE=w("Block {0}"),df="Paragraph",wE=t=>{const e=r=>()=>t.formatter.match(r),o=r=>()=>{const a=t.formatter.get(r);return a?d.some({tag:a.length>0&&(a[0].inline||a[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(r))}):d.none()},n=r=>{const c=xE(t,()=>s.data).fold(w(df),i=>i.title);Y(r,rn,{text:c}),N3(t,{value:c})},s=lf(t,"block_formats",rc.SemiColon);return{tooltip:nc(t,SE(),df),text:d.some(df),icon:d.none(),isSelectedFor:e,getCurrentValue:d.none,getPreviewFor:o,onAction:d_(t),updateText:n,dataset:s,shouldHide:!1,isInvalid:r=>!t.formatter.canApply(r.format)}},t8=(t,e)=>ki(t,e,wE(t),SE,"BlocksTextUpdate","blocks"),e8=(t,e)=>{const o=sc(e,wE(t));t.ui.registry.addNestedMenuItem("blocks",{text:Q6,onSetup:no(t),getSubmenuItems:()=>o.items.validateItems(o.getStyleItems())})},o8="Fonts",TE=w("Font {0}"),mf="System Font",n8=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],CE=t=>{const e=t.split(/\s*,\s*/);return L(e,o=>o.replace(/^['"]+|['"]+$/g,""))},_E=(t,e)=>e.length>0&&fa(e,o=>t.indexOf(o.toLowerCase())>-1),s8=(t,e)=>{if(t.indexOf("-apple-system")===0||e.length>0){const o=CE(t.toLowerCase());return _E(o,n8)||_E(o,e)}else return!1},OE=t=>{const e=()=>{const i=h=>h?CE(h)[0]:"",l=t.queryCommandValue("FontName"),u=c.data,m=l?l.toLowerCase():"",g=BT(t);return{matchOpt:ee(u,h=>{const b=h.format;return b.toLowerCase()===m||i(b).toLowerCase()===i(m).toLowerCase()}).orThunk(()=>dn(s8(m,g),{title:mf,format:m})),font:l}},o=i=>l=>l.exists(u=>u.format===i),n=()=>{const{matchOpt:i}=e();return i},s=i=>()=>d.some({tag:"div",styles:i.indexOf("dings")===-1?{"font-family":i}:{}}),r=i=>()=>
32{t.undoManager.transact(()=>{t.focus(),t.execCommand("FontName",!1,i.format)})},a=i=>{const{matchOpt:l,font:u}=e(),m=l.fold(w(u),g=>g.title);Y(i,rn,{text:m}),z3(t,{value:m})},c=lf(t,"font_family_formats",rc.SemiColon);return{tooltip:nc(t,TE(),mf),text:d.some(mf),icon:d.none(),isSelectedFor:o,getCurrentValue:n,getPreviewFor:s,onAction:r,updateText:a,dataset:c,shouldHide:!1,isInvalid:Pt}},r8=(t,e)=>ki(t,e,OE(t),TE,"FontFamilyTextUpdate","fontfamily"),a8=(t,e)=>{const o=sc(e,OE(t));t.ui.registry.addNestedMenuItem("fontfamily",{text:e.shared.providers.translate(o8),onSetup:no(t),getSubmenuItems:()=>o.items.validateItems(o.getStyleItems())})};var nd=tinymce.util.Tools.resolve("tinymce.util.VK");const c8=(t,e,o,n)=>{let s=d.none();const r=x=>x.map(C=>P.getValue(C)).getOr(""),a=ca(t,"NodeChange SwitchMode DisabledStateChange",x=>{const C=x.getComponent();s=d.some(C),o.updateInputValue(C),z.set(C,!t.selection.isEditable()||yu(t))}),c=x=>({getComponent:w(x)}),i=X($),l=V("custom-number-input-events"),u=(x,C,O)=>{const F=r(s),R=o.getNewValue(F,x),S=F.length-`${R}`.length,B=s.map(N=>N.element.dom.selectionStart-S),G=s.map(N=>N.element.dom.selectionEnd-S);o.onAction(R,O),s.each(N=>{P.setValue(N,R),C&&(B.each(lt=>N.element.dom.selectionStart=lt),G.each(lt=>N.element.dom.selectionEnd=lt))})},m=(x,C)=>u((O,F)=>O-F,x,C),g=(x,C)=>u((O,F)=>O+F,x,C),p=x=>ws(x.element).fold(d.none,C=>(Re(C),d.some(!0))),h=x=>Ta(x.element)?(Vd(x.element).each(C=>Re(C)),d.some(!0)):d.none(),b=(x,C,O,F)=>{const R=X($),S=e.shared.providers.translate(O),B=V("altExecuting"),G=ca(t,"NodeChange SwitchMode DisabledStateChange",lt=>{z.set(lt.getComponent(),!t.selection.isEditable()||yu(t))}),N=lt=>{z.isDisabled(lt)||x(!0)};return Fe.sketch({dom:{tag:"button",attributes:{"aria-label":S,"data-mce-name":C},classes:F.concat(C)},components:[Nh(C,e.shared.providers.icons)],buttonBehaviours:D([z.config({}),zt.config(e.shared.providers.tooltips.getConfig({tooltipText:S})),et(B,[ts({onSetup:G,getApi:c},R),fr({getApi:c},R),E(Un(),(lt,Q)=>{(Q.event.raw.keyCode===nd.SPACEBAR||Q.event.raw.keyCode===nd.ENTER)&&(z.isDisabled(lt)||x(!1))}),E(Mr(),N),E(Dr(),N)])]),eventOrder:{[Un()]:[B,"keying"],[Mr()]:[B,"alloy.base.behaviour"],[Dr()]:[B,"alloy.base.behaviour"],[Wn()]:["alloy.base.behaviour",B,"tooltipping"],[us()]:[B,"tooltipping"]}})},v=St(b(x=>m(!1,x),"minus","Decrease font size",[])),f=St(b(x=>g(!1,x),"plus","Increase font size",[])),y=St({dom:{tag:"div",classes:["tox-input-wrapper"]},components:[Ps.sketch({inputBehaviours:D([z.config({}),et(l,[ts({onSetup:a,getApi:c},i),fr({getApi:c},i)]),et("input-update-display-text",[E(rn,(x,C)=>{P.setValue(x,C.event.text)}),E(Rv(),x=>{o.onAction(P.getValue(x))}),E(Da(),x=>{o.onAction(P.getValue(x))})]),U.config({mode:"special",onEnter:x=>(u(xt,!0,!0),d.some(!0)),onEscape:p,onUp:x=>(g(!0,!1),d.some(!0)),onDown:x=>(m(!0,!1),d.some(!0)),onLeft:(x,C)=>(C.cut(),d.none()),onRight:(x,C)=>(C.cut(),d.none())})])})],behaviours:D([Z.config({}),U.config({mode:"special",onEnter:h,onSpace:h,onEscape:p}),et("input-wrapper-events",[E(ls(),x=>{q([v,f],C=>{const O=I.fromDom(C.get(x).element.dom);Ta(O)&&Wi(O)})})])])});return{dom:{tag:"div",classes:["tox-number-input"],attributes:{...$e(n)?{"data-mce-name":n}:{}}},components:[v.asSpec(),y.asSpec(),f.asSpec()],behaviours:D([Z.config({}),U.config({mode:"flow",focusInside:tr.OnEnterOrSpaceMode,cycles:!1,selector:"button, .tox-input-wrapper",onEscape:x=>Ta(x.element)?d.none():(Re(x.element),d.some(!0))})])}},i8="Font sizes",EE=w("Font size {0}"),kE="12pt",l8={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},u8={"xx-small":"7pt","x-small":"8pt",small:"10pt",medium:"12pt",large:"14pt","x-large":"18pt","xx-large":"24pt"},d8=(t,e)=>{const o=Math.pow(10,e);return Math.round(t*o)/o},m8=(t,e)=>/[0-9.]+px$/.test(t)?d8(parseInt(t,10)*72/96,e||0)+"pt":tt(u8,t).getOr(t),g8=t=>tt(l8,t).getOr(""),AE=t=>{const e=()=>{let i=d.none();const l=c.data,u=t.queryCommandValue("FontSize");if(u)for(let m=3;i.isNone()&&m>=0;m--){const g=m8(u,m),p=g8(g);i=ee(l,h=>h.format===u||h.format===g||h.format===p)}return{matchOpt:i,size:u}},o=i=>l=>l.exists(u=>u.format===i),n=()=>{const{matchOpt:i}=e();return i},s=w(d.none),r=i=>()=>
32{t.undoManager.transact(()=>{t.focus(),t.execCommand("FontSize",!1,i.format)})},a=i=>{const{matchOpt:l,size:u}=e(),m=l.fold(w(u),g=>g.title);Y(i,rn,{text:m}),V3(t,{value:m})},c=lf(t,"font_size_formats",rc.Space);return{tooltip:nc(t,EE(),kE),text:d.some(kE),icon:d.none(),isSelectedFor:o,getPreviewFor:s,getCurrentValue:n,onAction:r,updateText:a,dataset:c,shouldHide:!1,isInvalid:Pt}},p8=(t,e)=>ki(t,e,AE(t),EE,"FontSizeTextUpdate","fontsize"),h8=t=>{var e;const o={step:1};return(e={em:{step:.1},cm:{step:.1},in:{step:.1},pc:{step:.1},ch:{step:.1},rem:{step:.1}}[t])!==null&&e!==void 0?e:o},f8=16,b8=t=>t>=0,v8=t=>{const e=()=>t.queryCommandValue("FontSize");return{updateInputValue:n=>Y(n,rn,{text:e()}),onAction:(n,s)=>t.execCommand("FontSize",!1,n,{skip_focus:!s}),getNewValue:(n,s)=>{Zi(n,["unsupportedLength","empty"]);const r=e(),a=Zi(n,["unsupportedLength","empty"]).or(Zi(r,["unsupportedLength","empty"])),c=a.map(g=>g.value).getOr(f8),i=wT(t),l=a.map(g=>g.unit).filter(g=>g!=="").getOr(i),u=s(c,h8(l).step),m=`${b8(u)?u:c}${l}`;return m!==r&&H3(t,{value:m}),m}}},y8=(t,e)=>c8(t,e,v8(t),"fontsizeinput"),x8=(t,e)=>{const o=sc(e,AE(t));t.ui.registry.addNestedMenuItem("fontsize",{text:i8,onSetup:no(t),getSubmenuItems:()=>o.items.validateItems(o.getStyleItems())})},S8="Formats",DE=t=>Ni(t)?"Formats":"Format {0}",ME=(t,e)=>{const o="Formats",n=a=>()=>t.formatter.match(a),s=a=>()=>{const c=t.formatter.get(a);return c!==void 0?d.some({tag:c.length>0&&(c[0].inline||c[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(a))}):d.none()},r=a=>{const c=m=>kO(m)?ye(m.items,c):AO(m)?[{title:m.title,format:m.format}]:[],i=ye(FO(t),c),u=xE(t,w(i)).fold(w({title:o,tooltipLabel:""}),m=>({title:m.title,tooltipLabel:m.title}));Y(a,rn,{text:u.title}),P3(t,{value:u.tooltipLabel})};return{tooltip:nc(t,DE(""),""),text:d.some(o),icon:d.none(),isSelectedFor:n,getCurrentValue:d.none,getPreviewFor:s,onAction:d_(t),updateText:r,shouldHide:gT(t),isInvalid:a=>!t.formatter.canApply(a.format),dataset:e}},w8=(t,e)=>{const o={type:"advanced",...e.styles};return ki(t,e,ME(t,o),DE,"StylesTextUpdate","styles")},T8=(t,e)=>{const o={type:"advanced",...e.styles},n=sc(e,ME(t,o));t.ui.registry.addNestedMenuItem("styles",{text:S8,onSetup:no(t,()=>n.getStyleItems().length>0),getSubmenuItems:()=>n.items.validateItems(n.getStyleItems())})},C8=[{name:"history",items:["undo","redo"]},{name:"ai",items:["aidialog","aishortcuts"]},{name:"styles",items:["styles"]},{name:"formatting",items:["bold","italic"]},{name:"alignment",items:["alignleft","aligncenter","alignright","alignjustify"]},{name:"indentation",items:["outdent","indent"]},{name:"permanent pen",items:["permanentpen"]},{name:"comments",items:["addcomment"]}],Ai=(t,e)=>(o,n,s,r)=>{const a=t(o).mapError(c=>ka(c)).getOrDie();return e(a,n,s,r)},_8={button:Ai(ch,(t,e,o,n)=>L6(t,e.shared.providers,n)),togglebutton:Ai(RC,(t,e,o,n)=>V6(t,e.shared.providers,n)),menubutton:Ai(AC,(t,e,o,n)=>Oi(t,"tox-tbtn",e,d.none(),!1,n)),splitbutton:Ai(ZW,(t,e,o,n)=>N6(t,e.shared,n)),grouptoolbarbutton:Ai(qW,(t,e,o,n)=>{const s=o.ui.registry.getAll().buttons,r=c=>sd(o,{buttons:s,toolbar:c,allowToolbarGroups:!1},e,d.none()),a={[Qm]:e.shared.header.isPositionedAtTop()?ks.TopToBottom:ks.BottomToTop};switch(ja(o)){case en.floating:return P6(t,e,r,a,n);default:throw new Error("Toolbar groups are only supported when using floating toolbar mode")}})},O8=(t,e,o,n)=>tt(_8,t.type).fold(()=>(console.error("skipping button defined by",t),d.none()),s=>d.some(s(t,e,o,n))),FE={styles:w8,fontsize:p8,fontsizeinput:y8,fontfamily:r8,blocks:t8,align:J6,navigateback:G6},E8=t=>{const e=L(C8,o=>{const n=Wt(o.items,s=>At(t,s)||At(FE,s));return{name:o.name,items:n}});return Wt(e,o=>o.items.length>0)},k8=t=>{const e=t.split("|");return L(e,o=>({items:o.trim().split(" ")}))},A8=t=>ga(t,e=>(At(e,"name")||At(e,"label"))&&At(e,"items")),D8=t=>{const e=t.toolbar,o=t.buttons;return e===!1?[]:e===void 0||e===!0?E8(o):Et(e)?k8(e):A8(e)?e:(console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[])},M8=(t,e,o,n,s,r)=>tt(e,o.toLowerCase()).orThunk(()=>r.bind(a=>In(a,c=>tt(e,c+o.toLowerCase())))).fold(()=>tt(FE,o.toLowerCase()).map(a=>a(t,s)),a=>a.type==="grouptoolbarbutton"&&!n?(console.warn(`Ignoring the '${o}' toolbar button. Group toolbar buttons are only supported when using floating toolbar mode and cannot be nested.`),d.none()):O8(a,s,t,o.toLowerCase())),sd=(t,e,o,n)=>{const s=D8(e),r=L(s,a=>{const c=ye(a.items,i=>i.trim().length===0?[]:M8(t,e.buttons,i,e.allowToolbarGroups,o,n).toArray());return{title:d.from(t.translate(a.name)),label:dn(a.label!==void 0,t.translate(a.label)),items:c}});return Wt(r,a=>a.items.length>0)},$E=(t,e,o,n)=>{const s=e.mainUi.outerContainer,r=o.toolbar,a=o.buttons;if(ga(r,Et)){const c=r.map(i=>{const l={toolbar:i,buttons:a,allowToolbarGroups:o.allowToolbarGroups};return sd(t,l,n,d.none())});Bt.setToolbars(s,c)}else Bt.setToolbar(s,sd(t,o,n,d.none()))},IE=Rn(),F8=IE.os.isiOS()&&IE.os.version.major<=12,$8=(t,e)=>{const{uiMotherships:o}=e,n=t.dom;let s=t.getWin();const r=t.getDoc().documentElement,a=X(Zt(s.innerWidth,s.innerHeight)),c=X(Zt(r.offsetWidth,r.offsetHeight)),i=()=>{const g=a.get();(g.left!==s.innerWidth||g.top!==s.innerHeight)&&(a.set(Zt(s.innerWidth,s.innerHeight)),Sh(t))},l=()=>{const g=t.getDoc().documentElement,p=c.get();(p.left!==g.offsetWidth||p.top!==g.offsetHeight)&&(c.set(Zt(g.offsetWidth,g.offsetHeight)),Sh(t))},u=g=>{$3(t,g)};n.bind(s,"resize",i),n.bind(s,"scroll",u);const m=zd(I.fromDom(t.getBody()),"load",l);t.on("hide",()=>{q(o,g=>{ct(g.element,"display","none")})}),t.on("show",()=>{q(o,g=>{wt(g.element,"display")})}),t.on("NodeChange",l),t.on("remove",()=>{m.unbind(),n.unbind(s,"resize",i),n.unbind(s,"scroll",u),s=null})},I8=(t,e,o)=>{dr(t)&&Rl(o.mainUi.mothership.element,o.popupUi.mothership),gg(e,o.dialogUi.mothership)};var B8=Object.freeze({__proto__:null,render:(t,e,o,n,s)=>{const{mainUi:r,uiMotherships:a}=e,c=X(0),i=r.outerContainer;I6(t);const l=I.fromDom(s.targetNode),u=wa(ao(l));Rl(l,r.mothership),I8(t,u,e),t.on("PostRender",()=>{Bt.setSidebar(i,o.sidebar,FT(t))}),t.on("SkinLoaded",()=>{$E(t,e,o,n),c.set(t.getWin().innerWidth),Bt.setMenubar(i,cE(t,o)),Bt.setViews(i,o.views),$8(t,e)});
32const m=Bt.getSocket(i).getOrDie("Could not find expected socket element");if(F8){_r(m.element,{overflow:"scroll","-webkit-overflow-scrolling":"touch"});const b=NA(()=>{t.dispatch("ScrollContent")},20),v=co(m.element,"scroll",b.throttle);t.on("remove",v.unbind)}UC(t,e),t.addCommand("ToggleSidebar",(b,v)=>{Bt.toggleSidebar(i,v),U3(t)}),t.addQueryValueHandler("ToggleSidebar",()=>{var b;return(b=Bt.whichSidebar(i))!==null&&b!==void 0?b:""}),t.addCommand("ToggleView",(b,v)=>{if(Bt.toggleView(i,v)){const f=i.element;r.mothership.broadcastOn([Bs()],{target:f}),q(a,y=>{y.broadcastOn([Bs()],{target:f})}),ma(Bt.whichView(i))&&(t.focus(),t.nodeChanged(),Bt.refreshToolbar(i)),W3(t)}}),t.addQueryValueHandler("ToggleView",()=>{var b;return(b=Bt.whichView(i))!==null&&b!==void 0?b:""});const g=ja(t),p=()=>{Bt.refreshToolbar(e.mainUi.outerContainer)};(g===en.sliding||g===en.floating)&&t.on("ResizeWindow ResizeEditor ResizeContent",()=>{const b=t.getWin().innerWidth;b!==c.get()&&(p(),c.set(b))});const h={setEnabled:b=>{fi(e,b?"setEnabled":"setDisabled")},isEnabled:()=>!z.isDisabled(i)};return{iframeContainer:m.element.dom,editorContainer:i.element.dom,api:h}}});const R8=t=>/^[0-9\.]+(|px)$/i.test(""+t)?d.some(parseInt(""+t,10)):d.none(),gf=t=>ns(t)?t+"px":t,rd=(t,e,o)=>{const n=e.filter(r=>t<r),s=o.filter(r=>t>r);return n.or(s).getOr(t)},P8=(t,e)=>{if(typeof e=="number")return d.from(e);const o=/^([0-9.]+)(pt|em|px)$/.exec(e.trim());if(o){const n=o[2],s=Number.parseFloat(o[1]);if(Number.isNaN(s)||s<0)return d.none();if(n==="em")return d.from(s*Number.parseFloat(window.getComputedStyle(t.dom).fontSize));if(n==="pt")return d.from(s*(72/96));if(n==="px")return d.from(s)}return d.none()},L8=t=>{const e=P8(I.fromDom(t.targetElm),yp(t)),o=wp(t),n=Tp(t);return e.map(s=>rd(s,o,n))},V8=t=>L8(t).getOr(yp(t)),BE=t=>{const e=xp(t),o=Sp(t),n=xu(t);return R8(e).map(s=>rd(s,o,n))},H8=t=>BE(t).getOr(xp(t)),{ToolbarLocation:pf,ToolbarMode:RE}=bN,N8=40,z8=(t,e,o,n,s)=>{const{mainUi:r,uiMotherships:a}=o,c=oi.DOM,i=Ya(t),l=Xa(t),u=xu(t).or(BE(t)),m=n.shared.header,g=m.isPositionedAtTop,p=150,h=ja(t),b=h===RE.sliding||h===RE.floating,v=X(!1),f=()=>v.get()&&!t.removed,y=H=>b?H.fold(w(0),k=>k.components().length>1?Te(k.components()[1].element):0):0,x=H=>{switch(Cp(t)){case pf.auto:const k=Bt.getToolbar(r.outerContainer),M=y(k),K=Te(H.element)-M,at=Ae(e);if(at.y>K)return"top";{const rt=Ld(e),Ot=Math.max(rt.dom.scrollHeight,Te(rt));return at.bottom<Ot-K||eo().bottom<at.bottom-K?"bottom":"top"}case pf.bottom:return"bottom";case pf.top:default:return"top"}},C=H=>{s.on(k=>{jt.setModes(k,[H]),m.setDockingMode(H);const M=g()?ks.TopToBottom:ks.BottomToTop;nt(k.element,Qm,M)})},O=()=>{s.on(H=>{const k=u.getOrThunk(()=>em().width-Xi(e).left-10);ct(H.element,"max-width",k+"px")})},F=(H,k)=>{s.on(M=>{const K=Bt.getToolbar(r.outerContainer),at=y(K),W=Ae(e),rt=R(t,r.outerContainer.element),Ot=()=>rt.fold(()=>W.x,Oe=>{const xo=Ae(Oe);return Ft(Oe,Ks())?W.x:W.x-xo.x}),_t=()=>rt.fold(()=>g()?Math.max(W.y-Te(M.element)+at,0):W.bottom,Oe=>{var xo;const So=Ae(Oe),jo=(xo=Oe.dom.scrollTop)!==null&&xo!==void 0?xo:0,Fn=Ft(Oe,Ks())?Math.max(W.y-Te(M.element)+at,0):W.y-So.y+jo-Te(M.element)+at;return g()?Fn:W.bottom}),so=Ot(),Ut=dn(H,Math.ceil(r.outerContainer.element.dom.getBoundingClientRect().width)).filter(Oe=>Oe>
32p).map(Oe=>{const xo=k.getOr(Ro()),So=window.innerWidth-(so-xo.left),jo=Math.max(Math.min(Oe,So),p);return So<Oe&&ct(r.outerContainer.element,"width",jo+"px"),{width:jo+"px"}}).getOr({width:"max-content"}),yo={position:"absolute",left:Math.round(so)+"px",top:_t()+"px"};_r(r.outerContainer.element,{...yo,...Ut})})},R=(H,k)=>dr(H)?sm(k):d.none(),S=()=>{q(a,H=>{H.broadcastOn([cr()],{})})},B=()=>!i&&(mn(r.outerContainer.element).left+Tc(r.outerContainer.element)>=window.innerWidth-N8||Le(r.outerContainer.element,"width").isSome())?(ct(r.outerContainer.element,"position","absolute"),ct(r.outerContainer.element,"left","0px"),wt(r.outerContainer.element,"width"),!0):!1,G=H=>{if(!f())return;i||O();const k=Ro(),M=i?!1:B();if(b&&Bt.refreshToolbar(r.outerContainer),!i){const K=Ro(),at=dn(k.left!==K.left,k);F(M,at),at.each(W=>{Kd(W.left,K.top)})}l&&s.on(H),S()},N=()=>i||!l||!f()?!1:s.get().exists(H=>{const k=m.getDockingMode(),M=x(H);return M!==k?(C(M),!0):!1});return{isVisible:f,isPositionedAtTop:g,show:()=>{v.set(!0),ct(r.outerContainer.element,"display","flex"),c.addClass(t.getBody(),"mce-edit-focus"),q(a,H=>{wt(H.element,"display")}),N(),dr(t)?G(H=>jt.isDocked(H)?jt.reset(H):jt.refresh(H)):G(jt.refresh)},hide:()=>{v.set(!1),ct(r.outerContainer.element,"display","none"),c.removeClass(t.getBody(),"mce-edit-focus"),q(a,H=>{ct(H.element,"display","none")})},update:G,updateMode:()=>{N()&&G(jt.reset)},repositionPopups:S}},PE=(t,e)=>{const o=Ae(t);return{pos:e?o.y:o.bottom,bounds:o}},U8=(t,e,o,n)=>{const s=X(PE(e,o.isPositionedAtTop())),r=l=>{const{pos:u,bounds:m}=PE(e,o.isPositionedAtTop()),{pos:g,bounds:p}=s.get(),h=m.height!==p.height||m.width!==p.width;s.set({pos:u,bounds:m}),h&&Sh(t,l),o.isVisible()&&(g!==u?o.update(jt.reset):h&&(o.updateMode(),o.repositionPopups()))};n||(t.on("activate",o.show),t.on("deactivate",o.hide)),t.on("SkinLoaded ResizeWindow",()=>o.update(jt.reset)),t.on("NodeChange keydown",l=>{requestAnimationFrame(()=>r(l))});let a=0;const c=$d(()=>o.update(jt.refresh),33);t.on("ScrollWindow",()=>{const l=Ro().left;l!==a&&(a=l,c.throttle()),o.updateMode()}),dr(t)&&t.on("ElementScroll",l=>{o.update(jt.refresh)});const i=xa();i.set(zd(I.fromDom(t.getBody()),"load",l=>r(l.raw))),t.on("remove",()=>{i.clear()})};var W8=Object.freeze({__proto__:null,render:(t,e,o,n,s)=>{const{mainUi:r}=e,a=Rt(),c=I.fromDom(s.targetNode),i=z8(t,c,e,n,a),l=bT(t);B6(t);const u=()=>{if(a.isSet()){i.show();return}a.set(Bt.getHeader(r.outerContainer).getOrDie());const g=Ap(t);dr(t)?(Rl(c,r.mothership),Rl(c,e.popupUi.mothership)):gg(g,r.mothership),gg(g,e.dialogUi.mothership);const p=()=>{$E(t,e,o,n),Bt.setMenubar(r.outerContainer,cE(t,o)),i.show(),U8(t,c,i,l),t.nodeChanged()};l?t.once("SkinLoaded",p):p()};t.on("show",u),t.on("hide",i.hide),l||(t.on("focus",u),t.on("blur",i.hide)),t.on("init",()=>{(t.hasFocus()||l)&&u()}),UC(t,e);const m={show:u,hide:i.hide,setEnabled:g=>{fi(e,g?"setEnabled":"setDisabled")},isEnabled:()=>!z.isDisabled(r.outerContainer)};return{editorContainer:r.outerContainer.element.dom,api:m}}});const G8=()=>{const t=Rt(),e=Rt(),o=Rt();return{dialogUi:t,popupUi:e,mainUi:o,getUiMotherships:()=>{const r=t.get().map(c=>c.mothership),a=e.get().map(c=>c.mothership);return r.fold(()=>a.toArray(),c=>a.fold(()=>[c],i=>Ft(c.element,i.element)?[c]:[c,i]))},lazyGetInOuterOrDie:(r,a)=>()=>o.get().bind(c=>a(c.outerContainer)).getOrDie(`Could not find ${r} element in OuterContainer`)}},j8="contexttoolbar-show",LE="contexttoolbar-hide",ac=(t,e,o)=>({setInputEnabled:n=>{!n&&o&&Re(o),z.set(t,!n)},isInputEnabled:()=>!z.isDisabled(t),hide:()=>{pt(t,il())},back:()=>{pt(t,od)},getValue:()=>e.get().getOrThunk(()=>P.getValue(t)),setValue:n=>{t.getSystem().isConnected()?P.setValue(t,n):e.set(n)}}),VE=(t,e,o)=>E(Vh,(n,s)=>{const r=t.get(n),a=ac(r,o,n.element);e.onAction(a,s.event.buttonApi)}),Y8=(t,e,o,n)=>{const{primary:s,...r}=e.original,a=hn(ch({...r,type:"button",onAction:$}));return rf(a,o,[VE(t,e,n)])},X8=(t,e,o,n)=>{const{primary:s,...r}=e.original,a=hn(RC({...r,type:"togglebutton",onAction:$}));return pE(a,o,[VE(t,e,n)])},K8=t=>t.type==="contextformtogglebutton",q8=(t,e,o,n)=>K8(e)?X8(t,e,o,n):Y8(t,e,o,n),HE=(t,e,o,n)=>{const s=L(e,c=>St(q8(t,c,o,n)));return{asSpecs:()=>L(s,c=>c.asSpec()),findPrimary:c=>In(e,(i,l)=>i.primary?d.from(s[l]).bind(u=>u.getOpt(c)).filter(pc(z.isDisabled)):d.none())}},J8=(t,e,o,n)=>{const{width:s,height:r}=t.initValue();let a=ju;const c=!0,i=V("ratio-event"),l=S=>ac(S,n),u=S=>Go(S,{tag:"span",classes:["tox-icon","tox-lock-icon__"+S]},e.icons),m=()=>!c,g=t.label.getOr("Constrain proportions"),p=e.translate(g),h=se.parts.lock({dom:{tag:"button",classes:["tox-lock","tox-lock-context-form-size-input","tox-button","tox-button--naked","tox-button--icon"],attributes:{"aria-label":p,"data-mce-name":g}},components:[u("lock"),u("unlock")],buttonBehaviours:D([z.config({disabled:m}),Mt.config({}),zt.config(e.tooltips.getConfig({tooltipText:p}))])}),b=S=>({dom:{tag:"div",classes:["tox-context-form__group"]},components:S}),v=S=>Hn(S.element,"div.tox-focusable-wrapper").fold(d.none,G=>(Re(G),d.some(!0))),f=S=>dt.parts.field({factory:Ps,inputClasses:["tox-textfield","tox-toolbar-textfield","tox-textfield-size"],data:S?s:r,inputBehaviours:D([z.config({disabled:m}),Mt.config({}),et("size-input-toolbar-events",[E(vn(),(B,G)=>{Y(B,i,{isField1:S})})]),U.config({mode:"special",onEnter:o,onEscape:v})]),selectOnFocus:!1}),y=S=>({dom:{tag:"label",classes:["tox-label"]},components:[Nt(e.translate(S))]}),x=S=>({dom:{tag:"div",classes:["tox-focusable-wrapper","tox-toolbar-nav-item"]},components:[S],behaviours:D([Mt.config({}),Z.config({}),U.config({mode:"special",onEnter:B=>Dt(B.element,"input").fold(d.none,N=>(Re(N),d.some(!0)))})])}),C=x(se.parts.field1(b([dt.parts.label(y("Width:")),f(!0)]))),O=x(se.parts.field2(b([dt.parts.label(y("Height:")),f(!1)])
32)),F=X($),R=[ts({onBeforeSetup:S=>Dt(S.element,"input").each(Re),onSetup:t.onSetup,getApi:l},F),mh({getApi:l},F,n)];return se.sketch({dom:{tag:"div",classes:["tox-context-form__group"]},components:[C,b([h]),O],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:(S,B,G)=>{Gu(P.getValue(S)).each(N=>{a(N).each(lt=>{P.setValue(B,dO(lt))})})},onInput:S=>pt(S,I_),coupledFieldBehaviours:D([Z.config({}),U.config({mode:"flow",focusInside:tr.OnEnterOrSpaceMode,cycles:!1,selector:"button, .tox-focusable-wrapper"}),z.config({disabled:m,onDisabled:S=>{se.getField1(S).bind(dt.getField).each(z.disable),se.getField2(S).bind(dt.getField).each(z.disable),se.getLock(S).each(z.disable)},onEnabled:S=>{se.getField1(S).bind(dt.getField).each(z.enable),se.getField2(S).bind(dt.getField).each(z.enable),se.getLock(S).each(z.enable)}}),re(()=>e.checkUiComponentContext("mode:design")),et("size-input-toolbar-events2",[E(i,(S,B)=>{const G=B.event.isField1,N=G?se.getField1(S):se.getField2(S),lt=G?se.getField2(S):se.getField1(S),Q=N.map(P.getValue).getOr(""),ot=lt.map(P.getValue).getOr("");a=gO(Q,ot)}),E(I_,S=>t.onInput(l(S))),...R])])})},NE=(t,e,o)=>dt.sketch({dom:{tag:"div",classes:["tox-context-form__group"]},components:[...t.toArray(),e],fieldBehaviours:D([z.config({disabled:()=>o.checkUiComponentContext("mode:design").shouldDisable,onDisabled:n=>{U6(n),dt.getField(n).each(z.disable)},onEnabled:n=>{dt.getField(n).each(z.enable)}})])}),Z8=(t,e,o,n)=>{const s=X($),r=i=>ac(i,n),a=t.label.map(i=>dt.parts.label({dom:{tag:"label",classes:["tox-label"]},components:[Nt(e.translate(i))]})),c=dt.parts.field({factory:Ps,type:"range",inputClasses:["tox-toolbar-slider__input","tox-toolbar-nav-item"],inputAttributes:{min:String(t.min()),max:String(t.max())},data:t.initValue().toString(),fromInputValue:i=>VA(i).getOr(t.min()),toInputValue:i=>String(i),inputBehaviours:D([z.config({disabled:()=>e.checkUiComponentContext("mode:design").shouldDisable}),re(()=>e.checkUiComponentContext("mode:design")),U.config({mode:"special",onEnter:o,onLeft:(i,l)=>(l.cut(),d.none()),onRight:(i,l)=>(l.cut(),d.none())}),et("slider-events",[ts({onSetup:t.onSetup,getApi:r,onBeforeSetup:U.focusIn},s),mh({getApi:r},s,n),E(Es(),i=>{t.onInput(r(i))})])])});return NE(a,c,e)},Q8=(t,e,o,n)=>{const s=X($),r=u=>ac(u,n),a=t.label.map(u=>dt.parts.label({dom:{tag:"label",classes:["tox-label"]},components:[Nt(e.translate(u))]})),i={...t.placeholder.map(u=>({placeholder:e.translate(u)})).getOr({})},l=dt.parts.field({factory:Ps,inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-item"],inputAttributes:i,data:t.initValue(),selectOnFocus:!0,inputBehaviours:D([z.config({disabled:()=>e.checkUiComponentContext("mode:design").shouldDisable}),re(()=>e.checkUiComponentContext("mode:design")),U.config({mode:"special",onEnter:o,onLeft:(u,m)=>(m.cut(),d.none()),onRight:(u,m)=>(m.cut(),d.none())}),et("input-events",[ts({onSetup:t.onSetup,getApi:u=>Hn(u.element,".tox-toolbar").bind(g=>Dt(g,"button:enabled")).fold(()=>ac(u,n),g=>ac(u,n,g)),onBeforeSetup:U.focusIn},s),mh({getApi:r},s,n),E(Es(),u=>{t.onInput(r(u))})])])});return NE(a,l,e)},hf=(t,e,o)=>{const n=Rt(),r=St(t(o,l=>c.findPrimary(l).orThunk(()=>i.findPrimary(l)).map(u=>(Rr(u),!0)),n)),a=_d(e.commands,l=>l.align==="start"),c=HE(r,a.pass,o,n),i=HE(r,a.fail,o,n);return Wt([{title:d.none(),label:d.none(),items:c.asSpecs()},{title:d.none(),label:d.none(),items:[r.asSpec()]},{title:d.none(),label:d.none(),items:i.asSpecs()}],l=>l.items.length>0)},zE=(t,e)=>{switch(t.type){case"contextform":return hf(mo(Q8,t),t,e);case"contextsliderform":return hf(mo(Z8,t),t,e);case"contextsizeinputform":return hf(mo(J8,t),t,e)}},tj={renderContextForm:(t,e,o)=>Qu({type:t,uid:V("context-toolbar"),initGroups:zE(e,o),onEscape:d.none,cyclicKeying:!0,providers:o}),buildInitGroups:zE},UE=(t,e,o)=>e.bottom-t.y>=o&&t.bottom-e.y>=o,ej=t=>{const e=t.getBoundingClientRect();if(e.height<=0&&e.width<=0){const o=Lb(I.fromDom(t.startContainer),t.startOffset).element;return(Tr(o)?Ln(o):d.some(o)).filter(Bo).map(s=>s.dom.getBoundingClientRect()).getOr(e)}else return e},ff=t=>{const e=t.selection.getRng(),o=ej(e);if(t.inline){const n=Ro();return ke(n.left+o.left,n.top+o.top,o.width,o.height)}else{const n=kr(I.fromDom(t.getBody()));return ke(n.x+o.left,n.y+o.top,o.width,o.height)}},oj=(t,e)=>e.filter(o=>Jo(o)&&Ib(o)).map(kr).getOrThunk(()=>ff(t)),nj=(t,e,o)=>{const n=Math.max(t.x+o,e.x),s=Math.min(t.right-o,e.right);return{x:n,width:s-n}},sj=(t,e,o,n,s,r)=>{const a=I.fromDom(t.getContainer()),c=Dt(a,".tox-editor-header").getOr(a),i=Ae
32(c),l=i.y>=e.bottom,u=n&&!l;if(t.inline&&u)return{y:Math.max(i.bottom+r,o.y),bottom:o.bottom};if(t.inline&&!u)return{y:o.y,bottom:Math.min(i.y-r,o.bottom)};const m=s==="line"?Ae(a):e;return u?{y:Math.max(i.bottom+r,o.y),bottom:Math.min(m.bottom-r,o.bottom)}:{y:Math.max(m.y+r,o.y),bottom:Math.min(i.y-r,o.bottom)}},WE=(t,e,o,n=0)=>{const s=em(window),r=Ae(I.fromDom(t.getContentAreaContainer())),a=wu(t)||Tu(t)||ri(t),{x:c,width:i}=nj(r,s,n);if(t.inline&&!a)return ke(c,s.y,i,s.height);{const l=e.header.isPositionedAtTop(),{y:u,bottom:m}=sj(t,r,s,l,o,n);return ke(c,u,i,m-u)}},ad=12,GE={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"],inset:["tox-pop--inset"]},jE={maxHeightFunction:Fa(),maxWidthFunction:Zm()},rj=(t,e)=>{const o=t.selection.getRng(),n=Lb(I.fromDom(o.startContainer),o.startOffset);return o.startContainer===o.endContainer&&o.startOffset===o.endOffset-1&&Ft(n.element,e)},aj=(t,e,o)=>{const n=Le(t,"position");ct(t,"position",e);const s=o(t);return n.each(r=>ct(t,"position",r)),s},YE=t=>t==="node",cj=(t,e,o,n,s)=>{const r=ff(t),a=n.lastElement().exists(c=>Ft(o,c));if(rj(t,o))return a?wy:Sn;if(a)return aj(e,n.getMode(),()=>UE(r,Ae(e),-20)&&!n.isReposition()?_F:wy);{const c=n.getMode()==="fixed"?s.y+Ro().top:s.y,i=Te(e)+ad;return c+i<=r.y?Sn:Lc}},ij=(t,e,o,n)=>{const s=i=>(l,u,m,g,p)=>{const h=cj(t,g,i,o,p),b={...l,y:p.y,height:p.height};return{...h(b,u,m,g,p),alwaysFit:!0}},r=i=>YE(n)?[s(i)]:[];return e?{onLtr:i=>[pe,me,ge,Ue,We,Ce].concat(r(i)),onRtl:i=>[pe,ge,me,We,Ue,Ce].concat(r(i))}:{onLtr:i=>
32[Ce,pe,Ue,me,We,ge].concat(r(i)),onRtl:i=>[Ce,pe,We,ge,Ue,me].concat(r(i))}},lj=(t,e,o,n)=>e==="line"?{bubble:xn(ad,0,GE),layouts:{onLtr:()=>[Um],onRtl:()=>[Wm]},overrides:jE}:{bubble:xn(0,ad,GE,1/ad),layouts:ij(t,o,n,e),overrides:jE},bf=(t,e)=>{const o=Wt(e,r=>r.predicate(t.dom)),{pass:n,fail:s}=_d(o,r=>r.type==="contexttoolbar");return{contextToolbars:n,contextForms:s}},uj=t=>{if(t.length<=1)return t;{const e=r=>Ko(t,a=>a.position===r),o=r=>Wt(t,a=>a.position===r),n=e("selection"),s=e("node");if(n||s)if(s&&n){const r=o("node"),a=L(o("selection"),c=>({...c,position:"node"}));return r.concat(a)}else return o(n?"selection":"node");else return o("line")}},dj=t=>{if(t.length<=1)return t;{const e=n=>ee(t,s=>s.position===n);return e("selection").orThunk(()=>e("node")).orThunk(()=>e("line")).map(n=>n.position).fold(()=>[],n=>Wt(t,s=>s.position===n))}},mj=(t,e,o)=>{const n=bf(t,e);if(n.contextForms.length>0)return d.some({elem:t,toolbars:[n.contextForms[0]]});{const s=bf(t,o);if(s.contextForms.length>0)return d.some({elem:t,toolbars:[s.contextForms[0]]});if(n.contextToolbars.length>0||s.contextToolbars.length>0){const r=uj(n.contextToolbars.concat(s.contextToolbars));return d.some({elem:t,toolbars:r})}else return d.none()}},gj=(t,e,o)=>t(e)?d.none():gv(e,n=>{if(Bo(n)){const{contextToolbars:s,contextForms:r}=bf(n,o.inNodeScope),a=r.length>0?r:dj(s);return a.length>0?d.some({elem:n,toolbars:a}):d.none()}else return d.none()},t),pj=(t,e)=>{const o=I.fromDom(e.getBody()),n=a=>Ft(a,o),s=a=>!n(a)&&!zi(o,a),r=I.fromDom(e.selection.getNode());return s(r)?d.none():mj(r,t.inNodeScope,t.inEditorScope).orThunk(()=>gj(n,r,t))},hj=(t,e)=>{const o={},n=[],s=[],r={},a={},c=(u,m)=>{const g=hn(bW(m));o[u]=g,g.launch.map(p=>{r["form:"+u]={...m.launch,type:p.type==="contextformtogglebutton"?"togglebutton":"button",onAction:()=>{e(g)}}}),g.scope==="editor"?s.push(g):n.push(g),a[u]=g},i=(u,m)=>{wW(m).each(g=>{g.launch.isSome()&&(r["toolbar:"+u]={...m.launch,type:"button",onAction:()=>{e(g)}}),m.scope==="editor"?s.push(g):n.push(g),a[u]=g})},l=xe(t);return q(l,u=>{const m=t[u];m.type==="contextform"||m.type==="contextsliderform"||m.type==="contextsizeinputform"?c(u,m):m.type==="contexttoolbar"&&i(u,m)}),{forms:o,inNodeScope:n,inEditorScope:s,lookupTable:a,formNavigators:r}},vf="tox-pop--transition",fj=t=>t===nd.ENTER||t===nd.SPACEBAR,bj=(t,e,o,n)=>{const s=n.backstage,r=s.shared,a=Rn().deviceType.isTouch,c=Rt(),i=Rt(),l=Rt(),u=W6({sink:o,onEscape:()=>(t.focus(),u_(t),d.some(!0)),onHide:()=>{u_(t)},onBack:()=>{G3(t)}}),m=Xe(u.sketch),g=()=>{const Q=l.get().getOr("node"),ot=YE(Q)?1:0;return WE(t,r,Q,ot)},p=()=>!t.removed&&!(a()&&s.isContextMenuOpen()),h=Q=>Bn(ya(Q,c.get(),Ft),!0),b=()=>{if(p()){const Q=g(),ot=Bn(l.get(),"node")?oj(t,c.get()):ff(t);return Q.height<=0||!UE(ot,Q,.01)}else return!0},v=()=>{c.clear(),i.clear(),l.clear(),Yt.hide(m)},f=()=>{if(Yt.isOpen(m)){const Q=m.element;wt(Q,"display"),b()?ct(Q,"display","none"):(i.set(0),Yt.reposition(m))}},y=Q=>({dom:{tag:"div",classes:["tox-pop__dialog"]},components:[Q],behaviours:D([U.config({mode:"acyclic"}),et("pop-dialog-wrap-events",[Vt(ot=>{t.shortcuts.add("ctrl+F9","focus statusbar",()=>U.focusIn(ot))}),jn(ot=>{t.shortcuts.remove("ctrl+F9")})])])}),x=Q=>{const ot=R([Q]);Y(m,fE,{forwardContents:y(ot)})},C=Xs(()=>hj(e,x)),O=(Q,ot)=>sd(t,{buttons:Q,toolbar:ot.items,allowToolbarGroups:!1},n.backstage,d.some(["form:","toolbar:"])),F=(Q,ot)=>tj.buildInitGroups(Q,ot),R=Q=>{const{buttons:ot}=t.ui.registry.getAll(),H=C(),k={...ot,...H.formNavigators},M=ja(t)===en.scrolling?en.scrolling:en.default,K=Ie(L(Q,at=>at.type==="contexttoolbar"?O(k,SW(at)):F(at,r.providers)));return Qu({type:M,uid:V("context-toolbar"),initGroups:K,onEscape:d.none,cyclicKeying:!0,providers:r.providers})},S=(Q,ot)=>{const H=Q==="node"?r.anchors.node(ot):r.anchors.cursor(),k=lj(t,Q,a(),{lastElement:c.get,isReposition:()=>Bn(i.get(),0),getMode:()=>Ke.getMode(o)});return Jt(H,k)},B=(Q,ot)=>{if(lt.cancel(),!p())return;const H=R(Q),k=Q[0].position,M=S(k,ot);l.set(k),i.set(1);const K=m.element;wt(K,"display"),h(ot)||(Qt(K,vf),Ke.reset(o,m)),Yt.showWithinBounds(m,y(H),{anchor:M,transition:{classes:[vf],mode:"placement"}},()=>d.some(g())),ot.fold(c.clear,c.set),b()&&ct(K,"display","none")},G=()=>
32{ct(m.element,"transition","none"),f(),wt(m.element,"transition")};let N=!1;const lt=$d(()=>{if(!(!t.hasFocus()||t.removed||N))if(po(m.element,vf))lt.throttle();else{const Q=C();pj(Q,t).fold(v,ot=>{B(ot.toolbars,d.some(ot.elem))})}},17);t.on("init",()=>{t.on("remove",v),t.on("ScrollContent ScrollWindow ObjectResized ResizeEditor longpress",f),t.on("click focus SetContent",lt.throttle),t.on("keyup",Q=>{(!fj(Q.keyCode)||!u.inSubtoolbar())&&lt.throttle()}),t.on(LE,v),t.on(j8,Q=>{const ot=C();tt(ot.lookupTable,Q.toolbarKey).each(H=>{B([H],dn(Q.target!==t,Q.target)),hE(m)})}),t.on("focusout",Q=>{vu.setEditorTimeout(t,()=>{Qe(o.element).isNone()&&Qe(m.element).isNone()&&!t.hasFocus()&&v()},0)}),t.on("SwitchMode",()=>{t.mode.isReadOnly()&&v()}),t.on("DisabledStateChange",Q=>{Q.state&&v()}),t.on("ExecCommand",({command:Q})=>{Q.toLowerCase()==="toggleview"&&v()}),t.on("AfterProgressState",Q=>{Q.state?v():t.hasFocus()&&lt.throttle()}),t.on("dragstart",()=>{N=!0}),t.on("dragend drop",()=>{N=!1}),t.on("NodeChange",Q=>{u.inSubtoolbar()?G():Qe(m.element).fold(lt.throttle,$)})})},vj=t=>{q([{name:"alignleft",text:"Align left",cmd:"JustifyLeft",icon:"align-left"},{name:"aligncenter",text:"Align center",cmd:"JustifyCenter",icon:"align-center"},{name:"alignright",text:"Align right",cmd:"JustifyRight",icon:"align-right"},{name:"alignjustify",text:"Justify",cmd:"JustifyFull",icon:"align-justify"}],o=>{t.ui.registry.addToggleButton(o.name,{tooltip:o.text,icon:o.icon,onAction:Io(t,o.cmd),onSetup:Pu(t,o.name)})}),t.ui.registry.addButton("alignnone",{tooltip:"No alignment",icon:"align-none",onSetup:no(t),onAction:Io(t,"JustifyNone")})},XE=(t,e)=>{const o=()=>{const n=e.getOptions(t),s=e.getCurrent(t).map(e.hash),r=Rt();return L(n,a=>({type:"togglemenuitem",text:e.display(a),onSetup:c=>{const i=u=>{u&&(r.on(m=>m.setActive(!1)),r.set(c)),c.setActive(u)};i(Bn(s,e.hash(a)));const l=e.watcher(t,a,i);return()=>{r.clear(),l()}},onAction:()=>e.setCurrent(t,a)}))};t.ui.registry.addMenuButton(e.name,{tooltip:e.text,icon:e.icon,fetch:n=>n(o()),onSetup:e.onToolbarSetup}),t.ui.registry.addNestedMenuItem(e.name,{type:"nestedmenuitem",text:e.text,getSubmenuItems:o,onSetup:e.onMenuSetup})},yj=t=>({name:"lineheight",text:"Line height",icon:"line-height",getOptions:LT,hash:e=>PM(e,["fixed","relative","empty"]).getOr(e),display:xt,watcher:(e,o,n)=>e.formatter.formatChanged("lineheight",n,!1,{value:o}).unbind,getCurrent:e=>d.from(e.queryCommandValue("LineHeight")),setCurrent:(e,o)=>e.execCommand("LineHeight",!1,o),onToolbarSetup:no(t),onMenuSetup:no(t)}),xj=t=>d.from(pT(t)).map(o=>({name:"language",text:"Language",icon:"language",getOptions:w(o),hash:n=>os(n.customCode)?n.code:`${n.code}/${n.customCode}`,display:n=>n.title,watcher:(n,s,r)=>{var a;return n.formatter.formatChanged("lang",r,!1,{value:s.code,customValue:(a=s.customCode)!==null&&a!==void 0?a:null}).unbind},getCurrent:n=>{const s=I.fromDom(n.selection.getNode());return Ki(s,r=>d.some(r).filter(Bo).bind(a=>Pe(a,"lang").map(i=>{const l=Pe(a,"data-mce-lang").getOrUndefined();return{code:i,customCode:l,title:""}})))},setCurrent:(n,s)=>n.execCommand("Lang",!1,s),onToolbarSetup:n=>{const s=xa();return n.setActive(t.formatter.match("lang",{},void 0,!0)),s.set(t.formatter.formatChanged("lang",n.setActive,!0)),Ru(s.clear,no(t)(n))},onMenuSetup:no(t)})),Sj=t=>{XE(t,yj(t)),xj(t).each(e=>XE(t,e))},wj=(t,e)=>{Z6(t,e),a8(t,e),T8(t,e),e8(t,e),x8(t,e)},Tj=t=>{t.ui.registry.addContext("editable",()=>t.selection.isEditable()),t.ui.registry.addContext("mode",e=>t.mode.get()===e),t.ui.registry.addContext("any",ve),t.ui.registry.addContext("formatting",e=>t.formatter.canApply(e)),t.ui.registry.addContext("insert",e=>t.schema.isValidChild(t.selection.getNode().tagName,e))},Cj=t=>ca(t,"NodeChange",e=>{e.setEnabled(t.queryCommandState("outdent")&&t.selection.isEditable())}),_j=t=>{t.ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:Cj(t),onAction:Io(t,"outdent")}),t.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onSetup:no(t),onAction:Io(t,"indent")})},Oj=t=>{_j(t)},KE=(t,e)=>o=>{o.setActive(e.get());const n=s=>{e.set(s.state),o.setActive(s.state)};return t.on("PastePlainTextToggle",n),Ru(()=>t.off("PastePlainTextToggle",n),no(t)(o))},Ej=t=>{const e=X(MT(t)),o=()=>t.execCommand("mceTogglePlainTextPaste");t.ui.registry.addToggleButton("pastetext",{active:!1,icon:"paste-text",tooltip:"Paste as text",onAction:o,onSetup:KE(t,e)}),t.ui.registry.addToggleMenuItem("pastetext",{text:"Paste as text",icon:"paste-text",onAction:o,onSetup:KE(t,e)})},yf=(t,e)=>()=>{t.execCommand("mceToggleFormat",!1,e)},kj=t=>{Ns.each([{name:"bold",text:"Bold",icon:"bold",shortcut:"Meta+B"},{name:"italic",text:"Italic",icon:"italic",shortcut:"Meta+I"},{name:"underline",text:"Underline",icon:"underline",shortcut:"Meta+U"}
32,{name:"strikethrough",text:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",icon:"superscript"}],(e,o)=>{t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onSetup:Pu(t,e.name),onAction:yf(t,e.name),shortcut:e.shortcut})});for(let e=1;e<=6;e++){const o="h"+e,n=`Access+${e}`;t.ui.registry.addToggleButton(o,{text:o.toUpperCase(),tooltip:"Heading "+e,onSetup:Pu(t,o),onAction:yf(t,o),shortcut:n})}},Aj=t=>{Ns.each([{name:"copy",text:"Copy",action:"Copy",icon:"copy",context:"any"},{name:"help",text:"Help",action:"mceHelp",icon:"help",shortcut:"Alt+0",context:"any"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A",context:"any"},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"print",text:"Print",action:"mcePrint",icon:"print",shortcut:"Meta+P",context:"any"}],e=>{t.ui.registry.addButton(e.name,{tooltip:e.text,icon:e.icon,onAction:Io(t,e.action),shortcut:e.shortcut,context:e.context})}),Ns.each([{name:"cut",text:"Cut",action:"Cut",icon:"cut"},{name:"paste",text:"Paste",action:"Paste",icon:"paste"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"remove",text:"Remove",action:"Delete",icon:"remove"},{name:"hr",text:"Horizontal line",action:"InsertHorizontalRule",icon:"horizontal-rule"}],e=>{t.ui.registry.addButton(e.name,{tooltip:e.text,icon:e.icon,onSetup:no(t),onAction:Io(t,e.action)})})},Dj=t=>{Ns.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],e=>{t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onAction:Io(t,e.action),onSetup:Pu(t,e.name)})})},Mj=t=>{kj(t),Aj(t),Dj(t)},Fj=t=>{Ns.each([{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"copy",text:"Copy",action:"Copy",icon:"copy",shortcut:"Meta+C",context:"any"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A",context:"any"},{name:"print",text:"Print...",action:"mcePrint",icon:"print",shortcut:"Meta+P",context:"any"}],e=>{t.ui.registry.addMenuItem(e.name,{text:e.text,icon:e.icon,shortcut:e.shortcut,onAction:Io(t,e.action),context:e.context})}),Ns.each([{name:"bold",text:"Bold",action:"Bold",icon:"bold",shortcut:"Meta+B"},{name:"italic",text:"Italic",action:"Italic",icon:"italic",shortcut:"Meta+I"},{name:"underline",text:"Underline",action:"Underline",icon:"underline",shortcut:"Meta+U"},{name:"strikethrough",text:"Strikethrough",action:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",action:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",action:"Superscript",icon:"superscript"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"cut",text:"Cut",action:"Cut",icon:"cut",shortcut:"Meta+X"},{name:"paste",text:"Paste",action:"Paste",icon:"paste",shortcut:"Meta+V"},{name:"hr",text:"Horizontal line",action:"InsertHorizontalRule",icon:"horizontal-rule"}],e=>{t.ui.registry.addMenuItem(e.name,{text:e.text,icon:e.icon,shortcut:e.shortcut,onSetup:no(t),onAction:Io(t,e.action)})}),t.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onSetup:no(t),onAction:yf(t,"code")})},$j=t=>{Mj(t),Fj(t)},cd=(t,e)=>ca(t,"Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",o=>{o.setEnabled(!t.mode.isReadOnly()&&t.undoManager[e]())}),Ij=t=>{t.ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:cd(t,"hasUndo"),onAction:Io(t,"undo")}),t.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:cd(t,"hasRedo"),onAction:Io(t,"redo")})},Bj=t=>{t.ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",enabled:!1,onSetup:cd(t,"hasUndo"),onAction:Io(t,"undo"),shortcut:"Meta+Z"}),t.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",enabled:!1,onSetup:cd(t,"hasRedo"),onAction:Io(t,"redo"),shortcut:"Meta+Y"})},Rj=t=>{Ij(t),Bj(t)},Pj=t=>ca(t,"VisualAid",e=>{e.setActive(t.hasVisual)}),Lj=t=>{t.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:Pj(t),onAction:Io(t,"mceToggleVisualAid"),context:"any"})},Vj=t=>{t.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:Io(t,"mceToggleVisualAid"),context:"any"})},Hj=t=>{Vj(t),Lj(t)},Nj=(t,e)=>{vj(t),$j(t),wj(t,e),Rj(t),a4(t),Hj(t),Oj(t),Sj(t),Ej(t),Tj(t)},zj=t=>Et(t)?t.split(/[ ,]/):t,qE=t=>e=>e.options.get(t),Uj=t=>{const e=t.options.register;e("contextmenu_avoid_overlap",{processor:"string",default:""}),e("contextmenu_never_use_native",{processor:"boolean",default:!1}),e("contextmenu",{processor:o=>o===!1?{value:[],valid:!0}:Et(o)||ga(o,Et)?{value:zj(o),valid:!0}:{valid:!1,message:"Must be false or a string."},default:"link linkchecker image editimage table spellchecker configurepermanentpen"})},JE=qE("contextmenu_never_use_native"),Wj=qE("contextmenu_avoid_overlap"),Gj=t=>ZE(t).length===0,ZE=t=>{const e=t.ui.registry.getAll().contextMenus,o=t.options.get("contextmenu");return t.options.isSet("contextmenu")?o:Wt(o,n=>At(e,n))},Di=(t,e)=>({type:"makeshift",x:t,y:e}),jj=(t,e,o)=>Di(t.x+e,t.y+o),QE=t=>t.type==="longpress"||t.type.indexOf("touch")===0,Yj=t=>{if(QE(t)){const e=t.touches[0];return Di(e.pageX,e.pageY)}else return Di(t.pageX,t.pageY)},Xj=t=>{if(QE(t)){const e=t.touches[0];return Di(e.clientX,e.clientY)}else return Di(t.clientX,t.clientY)},Kj=(t,e)=>{const o=oi.DOM.getPos(t);return jj(e,o.x,o.y)},qj=(t,e)=>e.type==="contextmenu"||e.type==="longpress"?t.inline?Yj(e):Kj(t.getContentAreaContainer(),Xj(e)):tk(t),tk=t=>({type:"selection",root:I.fromDom(t.selection.getNode())}),Jj=t=>({type:"node",node:d.some(I.fromDom(t.selection.getNode())),root:I.fromDom(t.getBody())}),ek=(t,e,o)=>{switch(o){case"node":return Jj(t);case"point":return qj(t,e);case"selection":return tk(t)}},Zj=(t,e,o,n,s,r)=>{const a=o(),c=ek(t,e,r);ec(a,An.CLOSE_ON_EXECUTE,n,{isHorizontalMenu:!1,search:d.none()}).map(i=>
32{e.preventDefault(),Yt.showMenuAt(s,{anchor:c},{menu:{markers:gr("normal")},data:i})})},Qj={onLtr:()=>[pe,me,ge,Ue,We,Ce,Sn,Lc,Pc,Cl,Rc,Tl],onRtl:()=>[pe,ge,me,We,Ue,Ce,Sn,Lc,Rc,Tl,Pc,Cl]},t7=12,e7={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"]},o7=(t,e)=>{const o=t.selection;if(o.isCollapsed()||e.touches.length<1)return!1;{const n=e.touches[0],s=o.getRng();return hv(t.getWin(),_c.domRange(s)).exists(a=>a.left<=n.clientX&&a.right>=n.clientX&&a.top<=n.clientY&&a.bottom>=n.clientY)}},n7=t=>{const e=t.selection.getRng(),o=()=>{vu.setEditorTimeout(t,()=>{t.selection.setRng(e)},10),r()};t.once("touchend",o);const n=a=>{a.preventDefault(),a.stopImmediatePropagation()};t.on("mousedown",n,!0);const s=()=>r();t.once("longpresscancel",s);const r=()=>{t.off("touchend",o),t.off("longpresscancel",s),t.off("mousedown",n)}},s7=(t,e,o)=>{const n=ek(t,e,o);return{bubble:xn(0,o==="point"?t7:0,e7),layouts:Qj,overrides:{maxWidthFunction:Zm(),maxHeightFunction:Fa()},...n}},r7=(t,e,o,n,s,r,a)=>{const c=s7(t,e,r);ec(o,An.CLOSE_ON_EXECUTE,n,{isHorizontalMenu:!0,search:d.none()}).map(i=>{e.preventDefault();const l=a?uo.HighlightMenuAndItem:uo.HighlightNone;Yt.showMenuWithinBounds(s,{anchor:c},{menu:{markers:gr("normal"),highlightOnOpen:l},data:i,type:"horizontal"},()=>d.some(WE(t,n.shared,r==="node"?"node":"selection"))),t.dispatch(LE)})},a7=(t,e,o,n,s,r)=>{const a=Rn(),c=a.os.isiOS(),i=a.os.isMacOS(),l=a.os.isAndroid(),u=a.deviceType.isTouch(),m=()=>!(l||c||i&&u),g=()=>{const p=o();r7(t,e,p,n,s,r,m())};if((i||c)&&r!=="node"){const p=()=>{n7(t),g()};o7(t,e)?p():(t.once("selectionchange",p),t.once("touchend",()=>t.off("selectionchange",p)))}else g()},ok=t=>Et(t)?t==="|":t.type==="separator",xf={type:"separator"},nk=t=>{const e=o=>({text:o.text,icon:o.icon,enabled:o.enabled,shortcut:o.shortcut});if(Et(t))return t;switch(t.type){case"separator":return xf;case"submenu":return{type:"nestedmenuitem",...e(t),getSubmenuItems:()=>{const n=t.getSubmenuItems();return Et(n)?n:L(n,nk)}};default:const o=t;return{type:"menuitem",...e(o),onAction:uA(o.onAction)}}},sk=(t,e)=>{if(e.length===0)return t;const n=Od(t).filter(s=>!ok(s)).fold(()=>[],s=>[xf]);return t.concat(n).concat(e).concat([xf])},c7=(t,e,o)=>{const n=Ge(e,(s,r)=>tt(t,r.toLowerCase()).map(a=>{const c=a.update(o);if(Et(c)&&Hi(Fd(c)))return sk(s,c.split(" "));if(vs(c)&&c.length>0){const i=L(c,nk);return sk(s,i)}else return s}).getOrThunk(()=>s.concat([r])),[]);return n.length>0&&ok(n[n.length-1])&&n.pop(),n},i7=(t,e)=>e.ctrlKey&&!JE(t),l7=t=>t.type==="longpress"||At(t,"touches"),rk=(t,e)=>!l7(e)&&(e.button!==2||e.target===t.getBody()&&e.pointerType===""),ak=(t,e)=>rk(t,e)?t.selection.getStart(!0):e.target,u7=(t,e)=>{const o=Wj(t),n=rk(t,e)?"selection":"point";if(Hi(o)){const s=ak(t,e);return Cc(I.fromDom(s),o)?"node":n}else return n},d7=(t,e,o)=>{const s=Rn().deviceType.isTouch,r=Xe(Yt.sketch({dom:{tag:"div"},lazySink:e,onEscape:()=>t.focus(),onShow:()=>o.setContextMenuState(!0),onHide:()=>o.setContextMenuState(!1),fireDismissalEventInstead:{},inlineBehaviours:D([et("dismissContextMenu",[E($r(),(i,l)=>{vt.close(i),t.focus()})])])})),a=()=>Yt.hide(r),c=i=>{if(JE(t)&&i.preventDefault(),i7(t,i)||Gj(t))return;const l=u7(t,i),u=()=>{const g=ak(t,i),p=t.ui.registry.getAll(),h=ZE(t);return c7(p.contextMenus,h,g)};(s()?a7:Zj)(t,i,u,o,r,l)};t.on("init",()=>{const i="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(s()?"":" ResizeWindow");t.on(i,a),t.on("longpress contextmenu",c)})},Sf=40,id=Sf/2,ck=(t,e,o,n,s,r)=>t.fold(()=>Ur.snap({sensor:rr(o-id,n-id),range:Zt(s,r),output:rr(d.some(o),d.some(n)),extra:{td:e}}),a=>{const c=o-id,i=n-id,l=Sf,u=Sf,m=a.element.dom.getBoundingClientRect();return Ur.snap({sensor:rr(c,i),range:Zt(l,u),output:rr(d.some(o-m.width/2),d.some(n-m.height/2)),extra:{td:e}})}),ik=(t,e,o)=>{const n=(s,r)=>s.exists(a=>Ft(a,r));return{getSnapPoints:t,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:(s,r)=>{const a=r.td;n(e.get(),a)||(e.set(a),o(a))},mustSnap:!0}},lk=t=>St(Fe.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:D([Ur.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:t}),Zc.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}})),m7=(t,e)=>{const o=X([]),n=X([]),s=X(!1),r=Rt(),a=Rt(),c=R=>{const S=kr(R);return ck(p.getOpt(e),R,S.x,S.y,S.width,S.height)},i=()=>L(o.get(),R=>c(R)),l=R=>{const S=kr(R);return ck(h.getOpt(e),R,S.right,S.bottom,S.width,S.height)},u=()=>L(n.get(),R=>l(R)),m=ik(i,r,R=>{a.get().each(S=>{t.dispatch("TableSelectorChange",{start:R,finish:S})})}),g=ik(u,a,R=>{r.get().each(S=>{t.dispatch("TableSelectorChange",{start:S,finish:R})})}),p=lk(m),h=lk(g),b=Xe(p.asSpec()),v=Xe(h.asSpec()),f=(R,S,B,G)=>{const N=S.dom.getBoundingClientRect();wt(R.element,"display");
32const lt=yc(I.fromDom(t.getBody())).dom.innerHeight,Q=B(N),ot=G(N,lt);(Q||ot)&&ct(R.element,"display","none")},y=(R,S,B,G)=>{const N=B(S);Ur.snapTo(R,N),f(R,S,ot=>ot[G]<0,(ot,H)=>ot[G]>H)},x=R=>y(b,R,c,"top"),C=()=>r.get().each(x),O=R=>y(v,R,l,"bottom"),F=()=>a.get().each(O);if(Rn().deviceType.isTouch()){const R=S=>L(S,I.fromDom);t.on("TableSelectionChange",S=>{s.get()||(Hr(e,b),Hr(e,v),s.set(!0));const B=I.fromDom(S.start),G=I.fromDom(S.finish);r.set(B),a.set(G),d.from(S.otherCells).each(N=>{o.set(R(N.upOrLeftCells)),n.set(R(N.downOrRightCells)),x(B),O(G)})}),t.on("ResizeEditor ResizeWindow ScrollContent",()=>{C(),F()}),t.on("TableSelectionClear",()=>{s.get()&&(Ms(b),Ms(v),s.set(!1)),r.clear(),a.clear()})}};var g7=`<svg height="16" viewBox="0 0 80 16" width="80" xmlns="http://www.w3.org/2000/svg"><g opacity=".8"><path d="m80 3.537v-2.202h-7.976v11.585h7.976v-2.25h-5.474v-2.621h4.812v-2.069h-4.812v-2.443zm-10.647 6.929c-.493.217-1.13.337-1.864.337s-1.276-.156-1.805-.47a3.732 3.732 0 0 1 -1.3-1.298c-.324-.554-.48-1.191-.48-1.877s.156-1.335.48-1.877a3.635 3.635 0 0 1 1.3-1.299 3.466 3.466 0 0 1 1.805-.481c.65 0 .914.06 1.263.18.36.12.698.277.986.47.289.192.578.384.842.6l.12.085v-2.586l-.023-.024c-.385-.35-.855-.614-1.384-.818-.53-.205-1.155-.313-1.877-.313-.721 0-1.6.144-2.333.445a5.773 5.773 0 0 0 -1.937 1.251 5.929 5.929 0 0 0 -1.324 1.9c-.324.735-.48 1.565-.48 2.455s.156 1.72.48 2.454c.325.734.758 1.383 1.324 1.913.553.53 1.215.938 1.937 1.25a6.286 6.286 0 0 0 2.333.434c.819 0 1.384-.108 1.961-.313.59-.216 1.083-.505 1.468-.866l.024-.024v-2.49l-.12.096c-.41.337-.878.626-1.396.866zm-14.869-4.15-4.8-5.04-.024-.025h-.902v11.67h2.502v-6.847l2.827 3.08.385.409.397-.41 2.791-3.067v6.845h2.502v-11.679h-.902l-4.788 5.052z"/><path clip-rule="evenodd" d="m15.543 5.137c0-3.032-2.466-5.113-4.957-5.137-.36 0-.745.024-1.094.096-.157.024-3.85.758-3.85.758-3.032.602-4.62 2.466-4.704 4.788-.024.89-.024 4.27-.024 4.27.036 3.165 2.406 5.138 5.017 5.126.337 0 1.119-.109 1.287-.145.144-.024.385-.084.746-.144.661-.12 1.684-.325 3.067-.602 2.37-.409 4.103-2.009 4.44-4.33.156-1.023.084-4.692.084-4.692zm-3.213 3.308-2.346.457v2.31l-5.859 1.143v-5.75l2.346-.458v3.441l3.513-.686v-3.44l-3.513.685v-2.297l5.859-1.143v5.75zm20.09-3.296-.083-1.023h-2.13v8.794h2.346v-4.884c0-1.107.95-1.985 2.057-1.997 1.095 0 1.901.89 1.901 1.997v4.884h2.346v-5.245c-.012-2.105-1.588-3.777-3.67-3.765a3.764 3.764 0 0 0 -2.778 1.25l.012-.011zm-6.014-4.102 2.346-.458v2.298l-2.346.457z" fill-rule="evenodd"/><path d="m28.752 4.126h-2.346v8.794h2.346z"/><path clip-rule="evenodd" d="m43.777 15.483 4.043-11.357h-2.418l-1.54 4.355-.445 1.324-.36-1.324-1.54-4.355h-2.418l3.151 8.794-1.083 3.08zm-21.028-5.51c0 .722.541 1.034.878 1.034s.638-.048.95-.144l.518 1.708c-.217.145-.879.518-2.13.518a2.565 2.565 0 0 1 -2.562-2.587c-.024-1.082-.024-2.49 0-4.21h-1.54v-2.142h1.54v-1.912l2.346-.458v2.37h2.201v2.142h-2.2v3.693-.012z" fill-rule="evenodd"/></g></svg>
33`;const p7=t=>t.nodeName==="BR"||!!t.getAttribute("data-mce-bogus")||t.getAttribute("data-mce-type")==="bookmark",h7=(t,e,o)=>{var n;const s=(n=e.delimiter)!==null&&n!==void 0?n:"\u203A",r=(l,u,m)=>Fe.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{"data-index":m}},components:[Nt(l)],action:g=>{t.focus(),t.selection.select(u),t.nodeChanged()},buttonBehaviours:D([zt.config({...o.tooltips.getConfig({tooltipText:o.translate(["Select the {0} element",u.nodeName.toLowerCase()]),onShow:(g,p)=>{WM(g.element,p.element)},onHide:g=>{GM(g.element)}})}),sn.button(o.isDisabled),re(()=>o.checkUiComponentContext("any"))])}),a=()=>({dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0}},components:[Nt(` ${s} `)]}),c=l=>Ge(l,(u,m,g)=>{const p=r(m.name,m.element,g);return g===0?u.concat([p]):u.concat([a(),p])},[]),i=l=>{const u=[];let m=l.length;for(;m-- >0;){const g=l[m];if(g.nodeType===1&&!p7(g)){const p=B3(t,g);if(p.isDefaultPrevented()||u.push({name:p.name,element:g}),p.isPropagationStopped())break}}return u};return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:D([U.config({mode:"flow",selector:"div[role=button]"}),z.config({disabled:o.isDisabled}),re(()=>o.checkUiComponentContext("any")),Mt.config({}),st.config({}),et("elementPathEvents",[Vt((l,u)=>{t.shortcuts.add("alt+F11","focus statusbar elementpath",()=>U.focusIn(l)),t.on("NodeChange",m=>{const g=i(m.parents),p=g.length>0?c(g):[];st.set(l,p)})})])]),components:[]}};var zs;(function(t){t[t.None=0]="None",t[t.Both=1]="Both",t[t.Vertical=2]="Vertical"})(zs||(zs={}));const f7=(t,e,o,n,s)=>{const r={height:rd(n+e.top,wp(t),Tp(t))};return o===zs.Both&&(r.width=rd(s+e.left,Sp(t),xu(t))),r},uk=(t,e,o)=>{const n=I.fromDom(t.getContainer()),s=f7(t,e,o,Te(n),Co(n));Ze(s,(r,a)=>{ns(r)&&ct(n,a,gf(r))}),F3(t)},b7=t=>{const e=DT(t);return e===!1?zs.None:e==="both"?zs.Both:zs.Vertical},ld=(t,e,o,n)=>{const r=Zt(o*20,n*20);return uk(t,r,e),d.some(!0)},v7=(t,e)=>{const o=b7(t);if(o===zs.None)return d.none();const n=o===zs.Both?"Press the arrow keys to resize the editor.":"Press the Up and Down arrow keys to resize the editor.",s=o===zs.Both?"tox-statusbar__resize-cursor-both":"tox-statusbar__resize-cursor-default";return d.some(Go("resize-handle",{tag:"div",classes:["tox-statusbar__resize-handle",s],attributes:{"aria-label":e.translate(n),"data-mce-name":"resize-handle"},behaviours:[Ur.config({mode:"mouse",repositionTarget:!1,onDrag:(r,a,c)=>uk(t,c,o),blockerClass:"tox-blocker"}),U.config({mode:"special",onLeft:()=>ld(t,o,-1,0),onRight:()=>ld(t,o,1,0),onUp:()=>ld(t,o,0,-1),onDown:()=>ld(t,o,0,1)}),Mt.config({}),Z.config({}),zt.config(e.tooltips.getConfig({tooltipText:e.translate("Resize")}))]},e.icons))},y7=(t,e)=>{const o=(n,s,r)=>
33st.set(n,[Nt(e.translate(["{0} "+r,s[r]]))]);return Fe.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:D([sn.button(e.isDisabled),re(()=>e.checkUiComponentContext("any")),Mt.config({}),st.config({}),P.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),et("wordcount-events",[As(n=>{const s=P.getValue(n),r=s.mode==="words"?"characters":"words";P.setValue(n,{mode:r,count:s.count}),o(n,s.count,r)}),Vt(n=>{t.on("wordCountUpdate",s=>{const{mode:r}=P.getValue(n);P.setValue(n,{mode:r,count:s.wordCount}),o(n,s.wordCount,r)})})])]),eventOrder:{[Ho()]:["disabling","alloy.base.behaviour","wordcount-events"]}})},x7=(t,e)=>{const o=()=>({dom:{tag:"span",classes:["tox-statusbar__branding"]},components:[{dom:{tag:"a",attributes:{href:"https://www.tiny.cloud/powered-by-tiny?utm_campaign=poweredby&utm_source=tiny&utm_medium=referral&utm_content=v7",rel:"noopener",target:"_blank","aria-label":t.translate(["Build with {0}","TinyMCE"])},innerHtml:t.translate(["Build with {0}",g7.trim()])},behaviours:D([Z.config({})])}]}),n=()=>{const c=gh("Alt+0");return{dom:{tag:"div",classes:["tox-statusbar__help-text"]},components:[Nt(on.translate(["Press {0} for help",c]))]}},s=()=>{const c=[];return t.hasPlugin("wordcount")&&c.push(y7(t,e)),_p(t)&&c.push(o()),{dom:{tag:"div",classes:["tox-statusbar__right-container"]},components:c}},r=()=>{const c=[],i=IT(t),l=AT(t),u=_p(t)||t.hasPlugin("wordcount"),m=()=>{const g="tox-statusbar__text-container--flex-start",p="tox-statusbar__text-container--flex-end",h="tox-statusbar__text-container--space-around";if(i){const b="tox-statusbar__text-container-3-cols";return!u&&!l?[b,h]:u&&!l?[b,p]:[b,g]}return[u&&!l?p:g]};return l&&c.push(h7(t,{},e)),i&&c.push(n()),u&&c.push(s()),c.length>0?[{dom:{tag:"div",classes:["tox-statusbar__text-container",...m()]},components:c}]:[]};return{dom:{tag:"div",classes:["tox-statusbar"]},components:(()=>{const c=r(),i=v7(t,e);return c.concat(i.toArray())})()}},dk=(t,e)=>e.get().getOrDie(`UI for ${t} has not been rendered`),S7=(t,e)=>{const o=t.inline,n=o?W8:B8,s=Xa(t)?k9:S9,r=G8(),a=Rt(),c=Rt(),i=Rt(),g=Rn().deviceType.isTouch()?["tox-platform-touch"]:[],p=kp(t),h=ja(t),b=St({dom:{tag:"div",classes:["tox-anchorbar"]}}),v=St({dom:{tag:"div",classes:["tox-bottom-anchorbar"]}}),f=()=>r.mainUi.get().map(W=>W.outerContainer).bind(Bt.getHeader),y=()=>mt.fromOption(r.dialogUi.get().map(W=>W.sink),"UI has not been rendered"),x=()=>mt.fromOption(r.popupUi.get().map(W=>W.sink),"(popup) UI has not been rendered"),C=r.lazyGetInOuterOrDie("anchor bar",b.getOpt),O=r.lazyGetInOuterOrDie("bottom anchor bar",v.getOpt),F=r.lazyGetInOuterOrDie("toolbar",Bt.getToolbar),R=r.lazyGetInOuterOrDie("throbber",Bt.getThrobber),S=b9({popup:x,dialog:y},t,C,O),B=()=>{const W={attributes:{[Qm]:p?ks.BottomToTop:ks.TopToBottom}},rt=Bt.parts.menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:S.popup,onEscape:()=>{t.focus()}}),Ot=Bt.parts.toolbar({dom:{tag:"div",classes:["tox-toolbar"]},getSink:S.popup.shared.getSink,providers:S.popup.shared.providers,onEscape:()=>{t.focus()},onToolbarToggled:Fn=>{R3(t,Fn)},type:h,lazyToolbar:F,lazyHeader:()=>f().getOrDie("Could not find header element"),...W}),_t=Bt.parts["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:S.popup.shared.providers,onEscape:()=>{t.focus()},type:h}),so=ri(t),Ut=Tu(t),yo=wu(t),Oe=$T(t),xo=G(Oe),So=so||Ut||yo,jo=()=>so?[_t]:Ut?[Ot]:[],da=[xo,rt];return Bt.parts.header({dom:{tag:"div",classes:["tox-editor-header"].concat(So?[]:["tox-editor-header--empty"]),...W},components:Ie([yo?da:[],jo(),Ya(t)?[]:[b.asSpec()]]),sticky:Xa(t),editor:t,sharedBackstage:S.popup.shared})},G=W=>Bt.parts.promotion({dom:{tag:"div",classes:["tox-promotion"]},promotionLink:W}),N=()=>{const W=Bt.parts.socket({dom:{tag:"div",classes:["tox-edit-area"]}}),rt=Bt.parts.sidebar({dom:{tag:"div",classes:["tox-sidebar"]}});return{dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[W,rt]}},lt=()=>{const W=Ap(t),rt=Ft(Ks(),W)&&to(W,"display")==="grid",Ot={dom:{tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(g),attributes:{...on.isRtl()?{dir:"rtl"}:{}}},behaviours:D([Ke.config({useFixed:()=>s.isDocked(f)})])},_t={dom:{styles:{width:document.body.clientWidth+"px"}},events:Ht([E(Bc(),yo=>{ct(yo.element,"width",document.body.clientWidth+"px")})])},so=Xe(Jt(Ot,rt?_t:{})),Ut=Gg(so);return c.set(Ut),{sink:so,mothership:Ut}},Q=()=>{const W={dom:{tag:"div",classes:["tox","tox-silver-sink","tox-silver-popup-sink","tox-tinymce-aux"].concat(g),attributes:{...on.isRtl()?{dir:"rtl"}:{}}},behaviours:D([Ke.config({useFixed:()=>s.isDocked(f),getBounds:()=>e.getPopupSinkBounds()})])},rt=Xe(W),Ot=Gg(rt);return i.set(Ot),{sink:rt,mothership:Ot}},ot=()=>{const W=B(),rt=N(),Ot=Bt.parts.throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:S.popup}),_t=Bt.parts.viewWrapper({backstage:S.popup}),so=kT(t)&&!o?d.some(x7(t,S.popup.shared.providers)):d.none(),Ut=Ie([p?[]:[W],o?[]:[rt],p?[W]:[]]),yo=Bt.parts.editorContainer({components:Ie([Ut,o?[]:[v.asSpec()]])}),Oe=Dp(t),xo={role:"application",...on.isRtl()?{dir:"rtl"}:{},...Oe?{"aria-hidden":"true"}:{}},So=Xe(Bt.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(o?["tox-tinymce-inline"]:[]).concat(p?["tox-tinymce--toolbar-bottom"]:[]).concat(g),styles:{visibility:"hidden",...Oe?{opacity:"0",border:"0"}:{}},attributes:xo},components:[yo,...o?[]:[_t,...so.toArray()],Ot],behaviours:D([re(()=>S.popup.shared.providers.checkUiComponentContext("any")),z.config({disableClass:"tox-tinymce--disabled"}),U.config({mode:"cyclic",selector:".tox-menubar, .tox-toolbar, .tox-toolbar__primary, .tox-toolbar__overflow--open, .tox-sidebar__overflow--open, .tox-statusbar__path, .tox-statusbar__wordcount, .tox-statusbar__branding a, .tox-statusbar__resize-handle"})])})),jo=Gg(So);return a.set(jo),{mothership:jo,outerContainer:So}},H=W=>{const rt=gf(V8(t)),Ot=gf(H8(t));return t.inline||(Qb("div","width",Ot)&&ct(W.element,"width",Ot),Qb("div","height",rt)?ct(W.element,"height",rt):ct(W.element,"height","400px")),rt},k=W=>{t.addShortcut("alt+F9","focus menubar",()=>{Bt.focusMenubar(W)}),t.addShortcut("alt+F10","focus toolbar",()=>{Bt.focusToolbar(W)}),t.addCommand("ToggleToolbarDrawer",(rt,Ot)=>
33{Ot!=null&&Ot.skipFocus?Bt.toggleToolbarDrawerWithoutFocusing(W):Bt.toggleToolbarDrawer(W)}),t.addQueryStateHandler("ToggleToolbarDrawer",()=>Bt.isToolbarDrawerToggled(W))},M=W=>{const{mainUi:rt,popupUi:Ot,uiMotherships:_t}=W;we(fT(t),(Us,Mi)=>{t.ui.registry.addGroupToolbarButton(Mi,Us)});const{buttons:so,menuItems:Ut,contextToolbars:yo,sidebars:Oe,views:xo}=t.ui.registry.getAll(),So=Ep(t),jo={menuItems:Ut,menus:HT(t),menubar:yT(t),toolbar:So.getOrThunk(()=>Su(t)),allowToolbarGroups:h===en.floating,buttons:so,sidebar:Oe,views:xo};k(rt.outerContainer),v9(t,rt.mothership,_t),s.setup(t,S.popup.shared,f),Nj(t,S.popup),d7(t,S.popup.shared.getSink,S.popup),$9(t),Y9(t,R,S.popup.shared),bj(t,yo,Ot.sink,{backstage:S.popup}),m7(t,Ot.sink);const da=t.getElement(),Fn=H(rt.outerContainer),cc={targetNode:da,height:Fn};return n.render(t,W,jo,S.popup,cc)},K=W=>(i.set(W.mothership),W),at=()=>{const W=ot(),rt=lt(),Ot=dr(t)?Q():K(rt);r.dialogUi.set(rt),r.popupUi.set(Ot),r.mainUi.set(W);const _t={popupUi:Ot,dialogUi:rt,mainUi:W,uiMotherships:r.getUiMotherships()};return M(_t)};return{popups:{backstage:S.popup,getMothership:()=>dk("popups",i)},dialogs:{backstage:S.dialog,getMothership:()=>dk("dialogs",c)},renderUI:at}},mk=t=>{const e=[],o={};return Ze(t,(n,s)=>{n.fold(()=>{e.push(s)},r=>{o[s]=r})}),e.length>0?mt.error(e):mt.value(o)},w7=(t,e,o,n)=>{const s=St(Na.sketch(r=>({dom:{tag:"div",classes:["tox-form"].concat(t.classes)},components:L(t.items,a=>OO(r,a,e,o,n))})));return{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[s.asSpec()]}],behaviours:D([U.config({mode:"acyclic",useTabstopAt:pc(Ci)}),Mn.memento(s),Z4(s,{postprocess:r=>mk(r).fold(a=>(console.error(a),{}),xt)}
33),et("dialog-body-panel",[E(vn(),(r,a)=>{r.getSystem().broadcastOn([Uu],{newFocus:d.some(a.event.target)})})])])}},T7=(t,e,o)=>L(t,(n,s)=>{st.set(o,t[s].view());const r=e.dom.getBoundingClientRect();return st.set(o,[]),r.height}),C7=t=>$n(Uf(t,(e,o)=>e>o?-1:e<o?1:0)),_7=(t,e,o)=>{const n=Ld(t).dom,s=Hn(t,".tox-dialog-wrap").getOr(t),r=to(s,"position")==="fixed";let a;r?a=Math.max(n.clientHeight,window.innerHeight):a=Math.max(n.offsetHeight,n.scrollHeight);const c=Te(e),l=e.dom.offsetLeft>=o.dom.offsetLeft+Co(o)?Math.max(Te(o),c):c,u=parseInt(to(t,"margin-top"),10)||0,m=parseInt(to(t,"margin-bottom"),10)||0,p=Te(t)+u+m-l;return a-p},O7=(t,e)=>{$n(t).each(o=>Wa.showTab(e,o.value))},gk=(t,e)=>{ct(t,"height",e+"px"),ct(t,"flex-basis",e+"px")},ud=(t,e,o)=>{Hn(t,'[role="dialog"]').each(n=>{Dt(n,'[role="tablist"]').each(s=>{o.get().map(r=>(ct(e,"height","0"),ct(e,"flex-basis","0"),Math.min(r,_7(n,e,s)))).each(r=>{gk(e,r)})})})},wf=t=>Dt(t,'[role="tabpanel"]'),E7=t=>{const e=Rt();return{extraEvents:[Vt(s=>{const r=s.element;wf(r).each(a=>{ct(a,"visibility","hidden"),s.getSystem().getByDom(a).toOptional().each(c=>{const i=T7(t,a,c);C7(i).fold(e.clear,e.set)}),ud(r,a,e),wt(a,"visibility"),O7(t,s),requestAnimationFrame(()=>{ud(r,a,e)})})}),E(Bc(),s=>{const r=s.element;wf(r).each(a=>{ud(r,a,e)})}),E(R_,(s,r)=>{const a=s.element;wf(a).each(c=>{const i=ss(ao(c));ct(c,"visibility","hidden");const l=Le(c,"height").map(g=>parseInt(g,10));wt(c,"height"),wt(c,"flex-basis");const u=c.dom.getBoundingClientRect().height;l.forall(g=>u>g)?(e.set(u),ud(a,c,e)):l.each(g=>{gk(c,g)}),wt(c,"visibility"),i.each(Re)})})],selectFirst:!1}},pk="send-data-to-section",hk="send-data-to-view",k7=(t,e,o,n)=>{const s=X({}),r=u=>{const m=P.getValue(u),g=mk(m).getOr({}),p=s.get(),h=Jt(p,g);s.set(h)},a=u=>{const m=s.get();P.setValue(u,m)},c=X(null),i=L(t.tabs,u=>({value:u.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"]},components:[Nt(o.shared.providers.translate(u.title))],view:()=>[Na.sketch(m=>({dom:{tag:"div",classes:["tox-form"]},components:L(u.items,g=>OO(m,g,e,o,n)),formBehaviours:D([U.config({mode:"acyclic",useTabstopAt:pc(Ci)}),et("TabView.form.events",[Vt(a),jn(r)]),Ao.config({channels:Aa([{key:pk,value:{onReceive:r}},{key:hk,value:{onReceive:a}}])})])}))]})),l=E7(i);return Wa.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:(u,m,g)=>{const p=P.getValue(m);Y(u,B_,{name:p,oldName:c.get()}),c.set(p)},tabs:i,components:[Wa.parts.tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[aT.parts.tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:D([Mt.config({})])}),Wa.parts.tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:l.selectFirst,tabSectionBehaviours:D([et("tabpanel",l.extraEvents),U.config({mode:"acyclic"}),ht.config({find:u=>$n(Wa.getViewItems(u))}),la(d.none(),u=>(u.getSystem().broadcastOn([pk],{}),s.get()),(u,m)=>{s.set(m),u.getSystem().broadcastOn([hk],{})})])})},fk=(t,e,o,n,s,r)=>{const a=l=>{const u=l.body;switch(u.type){case"tabpanel":return[k7(u,l.initialData,n,r)];default:return[w7(u,l.initialData,n,r)]}},c=(l,u)=>d.some({isTabPanel:()=>u.body.type==="tabpanel"}),i={"aria-live":"polite"};return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:{...o.map(l=>({id:l})).getOr({}),...s?i:{}}},components:[],behaviours:D([Mn.childAt(0),Do.config({channel:`${J_}-${e}`,updateState:c,renderComponents:a,initialData:t})])}},A7=(t,e,o,n,s,r)=>fk(t,e,d.some(o),n,s,r),D7=(t,e,o,n)=>{const s=fk(t,e,d.none(),o,!1,n);return he.parts.body(s)},M7=t=>{const e={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[X_(d.none(),{dom:{tag:"iframe",attributes:{src:t.url}},behaviours:D([Mt.config({}),Z.config({})])})]}],behaviours:D([U.config({mode:"acyclic",useTabstopAt:pc(Ci)})])};return he.parts.body(e)},F7=Ga.deviceType.isTouch(),bk=(t,e)=>({dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[t,e]}),vk=(t,e)=>he.parts.close(Fe.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":e.translate("Close")}},action:t,buttonBehaviours:D([Mt.config({})])})),yk=()=>he.parts.title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}}),xk=(t,e)=>he.parts.body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:Is(`<p>${sC(e.translate(t))}</p>`)}]}]}),Sk=t=>he.parts.footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:t}),wk=(t,e)=>[Kn.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:t}),Kn.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]}
vendor: 4,930 bytes, line 33
33,components:e})],Tf=t=>{const e="tox-dialog",o=e+"-wrap",n=o+"__backdrop",s=e+"__disable-scroll";return he.sketch({lazySink:t.lazySink,onEscape:r=>(t.onEscape(r),d.some(!0)),useTabstopAt:r=>!Ci(r),firstTabstop:t.firstTabstop,dom:{tag:"div",classes:[e].concat(t.extraClasses),styles:{position:"relative",...t.extraStyles}},components:[t.header,t.body,...t.footer.toArray()],parts:{blocker:{dom:Is(`<div class="${o}"></div>`),components:[{dom:{tag:"div",classes:F7?[n,n+"--opaque"]:[n]}}]}},dragBlockClass:o,modalBehaviours:D([Z.config({}),et("dialog-events",t.dialogEvents.concat([Ba(vn(),(r,a)=>{Xn.isBlocked(r)?$():U.focusIn(r)}),E(ul(),(r,a)=>{r.getSystem().broadcastOn([Uu],{newFocus:a.event.newFocus})})])),et("scroll-lock",[Vt(()=>{ne(Ks(),s)}),jn(()=>{Qt(Ks(),s)})]),...t.extraBehaviours]),eventOrder:{[Ho()]:["dialog-events"],[Wn()]:["scroll-lock","dialog-events","alloy.base.behaviour"],[us()]:["alloy.base.behaviour","dialog-events","scroll-lock"],...t.eventOrder}})},Tk=t=>Fe.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close"),"data-mce-name":"close"}},buttonBehaviours:D([Mt.config({}),zt.config(t.tooltips.getConfig({tooltipText:t.translate("Close")}))]),components:[Go("close",{tag:"span",classes:["tox-icon"]},t.icons)],action:e=>{pt(e,vr)}}),Ck=(t,e,o,n)=>{const s=r=>[Nt(n.translate(r.title))];return{dom:{tag:"h1",classes:["tox-dialog__title"],attributes:{...o.map(r=>({id:r})).getOr({})}},components:[],behaviours:D([Do.config({channel:`${q_}-${e}`,initialData:t,renderComponents:s})])}},_k=()=>({dom:Is('<div class="tox-dialog__draghandle"></div>')}),$7=(t,e,o,n)=>Kn.sketch({dom:Is('<div class="tox-dialog__header"></div>'),components:[Ck(t,e,d.some(o),n),_k(),Tk(n)],containerBehaviours:D([Ur.config({mode:"mouse",blockerClass:"blocker",getTarget:s=>as(s,'[role="dialog"]').getOrDie(),snaps:{getSnapPoints:()=>[],leftAttr:"data-drag-left",topAttr:"data-drag-top"},onDrag:(s,r)=>{s.getSystem().broadcastOn([cr()],{target:r})}})])}),I7=(t,e,o)=>{const n=he.parts.title(Ck(t,e,d.none(),o)),s=he.parts.draghandle(_k()),r=he.parts.close(Tk(o)),a=[n].concat(t.draggable?[s]:[]).concat([r]);return Kn.sketch({dom:Is('<div class="tox-dialog__header"></div>'),components:a})},Ok=(t,e,o)=>I7({title:o.shared.providers.translate(t),draggable:o.dialog.isDraggableModal()},e,o.shared.providers),Ek=(t,e,o,n)=>({dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":o.translate(t)},styles:{left:"0px",right:"0px",bottom:"0px",top:`${n.getOr(0)}px`,position:"absolute"}},behaviours:e,components:[{dom:Is('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}),kk=(t,e,o)=>({onClose:()=>o.closeWindow(),onBlock:n=>{const s=Dt(t().element,".tox-dialog__header").map(r=>Te(r));he.setBusy(t(),(r,a)=>Ek(n.message,a,e,s))},onUnblock:()=>{he.setIdle(t())}}),Ak="tox-dialog--fullscreen",Cf="tox-dialog--width-lg",_f="tox-dialog--width-md",dd=t=>{switch(t){case"large":return d.some(Cf);case"medium":return d.some(_f);default:return d.none()}},Dk=(t,e)=>{const o=I.fromDom(e.element.dom);po(o,Ak)||(gn(o,[Cf,_f]),dd(t).each(n=>ne(o,n)))},Mk=(t,e)=>{const o=I.fromDom(t.element.dom),n=lv(o),s=ee(n,r=>r===Cf||r===_f).or(dd(e));gM(o,[Ak,...s.toArray()])},Fk=(t,e,o)=>Xe(Tf({...t,firstTabstop:1,lazySink:o.shared.getSink,extraBehaviours:[Nu({}),...t.extraBehaviours],onEscape:n=>{pt(n,vr)},dialogEvents:e,eventOrder:{[Fr()]:[Do.name(),Ao.name()],[Wn()]:["scroll-lock",Do.name(),"messages","dialog-events","alloy.base.behaviour"],[us()]:["alloy.base.behaviour","dialog-events","messages",Do.name(),"scroll-lock"]}})),Of=(t,e={})=>{const o=n=>{const s=L(n.items,r=>{const a=tt(e,r.name).getOr(X(!1));return{...r,storage:a}});return{...n,items:s}};return L(t,n=>n.type==="menu"?o(n):n)},$k=t=>Ge(t,(e,o)=>o.type==="menu"?Ge(o.items,(s,r)=>(s[r.name]=r.storage,s),e):e,{}),Ik=(t,e)=>[ng(vn(),g5),t(wi,(o,n,s,r)=>{Ta(r.element)&&ss(ao(r.element)).each(Wi),e.onClose(),n.onClose()}),t(vr,(o,n,s,r)=>{n.onCancel(o),pt(r,wi)}),E(Fh,(o,n)=>e.onUnblock()),E(Mh,(o,n)=>e.onBlock(n.event))],B7=(t,e)=>{const o=(s,r)=>E(s,(a,c)=>{n(a,(i,l)=>{r(t(),i,c.event,a)})}),n=(s,r)=>{Do.getState(s).get().each(a=>{r(a,s)})};return[...Ik(o,e),o(hs,(s,r,a)=>{r.onAction(s,{name:a.name})})]},Bk=(t,e,o)=>{const n=(r,a)=>E(r,(c,i)=>{s(c,(l,u)=>{a(t(),l,i.event,c)})}),s=(r,a)=>{Do.getState(r).get().each(c=>{a(c.internalDialog,r)})};return[...Ik(n,e),n(Ti,(r,a)=>a.onSubmit(r)),n(vo,(r,a,c)=>{a.onChange(r,{name:c.name})}),n(hs,(r,a,c,i)=>{const l=()=>i.getSystem().isConnected()?U.focusIn(i):void 0,u=p=>Yb(p,"disabled")||Pe(p,"aria-disabled").exists(h=>h==="true"),m=ao(i.element),g=ss(m);a.onAction(r,{name:c.name,value:c.value}),ss(m).fold(l,p=>{u(p)||g.exists(h=>zi(p,h)&&u(h))?l():o().toOptional().filter(h=>!zi(h.element,p)).each(l)})}),n(B_,(r,a,c)=>{a.onTabChange(r,{newTabName:c.name,oldTabName:c.oldName})}),jn(r=>
33{const a=t();P.setValue(r,a.getData())})]},R7=(t,e)=>Xu(t,t.type,e),P7=(t,e,o)=>ee(e,n=>n.name===o).bind(n=>n.memento.getOpt(t)),L7=(t,e)=>{const o=e.map(c=>c.footerButtons).getOr([]),n=_d(o,c=>c.align==="start"),s=(c,i)=>Kn.sketch({dom:{tag:"div",classes:[`tox-dialog__footer-${c}`]},components:L(i,l=>l.memento.asSpec())}),r=s("start",n.pass),a=s("end",n.fail);return[r,a]},Rk=(t,e,o)=>{const n=(s,r)=>{const a=L(r.buttons,i=>{const l=St(R7(i,o));return{name:i.name,align:i.align,memento:l}}),c=i=>P7(s,a,i);return d.some({lookupByName:c,footerButtons:a})};return{dom:Is('<div class="tox-dialog__footer"></div>'),components:[],behaviours:D([Do.config({channel:`${Z_}-${e}`,initialData:t,updateState:n,renderComponents:L7})])}},V7=(t,e,o)=>Rk(t,e,o),Pk=(t,e,o)=>he.parts.footer(Rk(t,e,o)),md=(t,e)=>{if(t.getRoot().getSystem().isConnected()){const n=ht.getCurrent(t.getFormWrapper()).getOr(t.getFormWrapper());return Na.getField(n,e).orThunk(()=>t.getFooter().bind(a=>Do.getState(a).get()).bind(a=>a.lookupByName(e)))}else return d.none()},H7=(t,e)=>{const o=t.getRoot();return Do.getState(o).get().map(n=>hn(Xt("data",n.dataValidator,e))).getOr(e)},Lk=(t,e,o)=>{const n=h=>{const b=t.getRoot();b.getSystem().isConnected()&&h(b)},p={getData:()=>{const h=t.getRoot(),b=h.getSystem().isConnected()?t.getFormWrapper():h,v=P.getValue(b),f=we(o,y=>y.get());return{...v,...f}},setData:h=>{n(b=>{const v=p.getData(),f=Jt(v,h),y=H7(t,f),x=t.getFormWrapper();P.setValue(x,y),Ze(o,(C,O)=>{At(f,O)&&C.set(f[O])})})},setEnabled:(h,b)=>{md(t,h).each(b?z.enable:z.disable)},focus:h=>{md(t,h).each(Z.focus)},block:h=>{if(!Et(h))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");n(b=>{Y(b,Mh,{message:h})})},unblock:()=>{n(h=>{pt(h,Fh)})},showTab:h=>{n(b=>{const v=t.getBody();Do.getState(v).get().exists(y=>y.isTabPanel())&&ht.getCurrent(v).each(y=>{Wa.showTab(y,h)})})},redial:h=>{n(b=>{const v=t.getId(),f=e(h),y=Of(f.internalDialog.buttons,o);b.getSystem().broadcastOn([`${zu}-${v}`],f),b.getSystem().broadcastOn([`${q_}-${v}`],f.internalDialog),b.getSystem().broadcastOn([`${J_}-${v}`],f.internalDialog),b.getSystem().broadcastOn([`${Z_}-${v}`],{...f.internalDialog,buttons:y}),p.setData(f.initialData)})},close:()=>{n(h=>{pt(h,wi)})},toggleFullscreen:t.toggleFullscreen};return p},N7=(t,e,o)=>{const n=V("dialog"),s=t.internalDialog,r=Ok(s.title,n,o),a=X(s.size),c=x=>md(f,x),i=dd(a.get()).toArray(),l=(x,C)=>(a.set(C.internalDialog.size),Dk(C.internalDialog.size,x),d.some(C)),u=D7({body:s.body,initialData:s.initialData},n,o,c),m=Of(s.buttons),g=$k(m),p=dn(m.length!==0,Pk({buttons:m},n,o)),h=Bk(()=>y,kk(()=>v,o.shared.providers,e),o.shared.getSink),b={id:n,header:r,body:u,footer:p,extraClasses:i,extraBehaviours:[Do.config({channel:`${zu}-${n}`,updateState:l,initialData:t})],extraStyles:{}},v=Fk(b,h,o),f=(()=>{const x=()=>{const O=he.getBody(v);return ht.getCurrent(O).getOr(O)},C=()=>{Mk(v,a.get())};return{getId:w(n),getRoot:w(v),getBody:()=>he.getBody(v),getFooter:()=>he.getFooter(v),getFormWrapper:x,toggleFullscreen:C}})(),y=Lk(f,e.redial,g);return{dialog:v,instanceApi:y}},Vk=(t,e,o,n=!1,s)=>{const r=V("dialog"),a=V("dialog-label"),c=V("dialog-content"),i=t.internalDialog,l=B=>md(R,B),u=X(i.size),m=dd(u.get()).toArray(),g=(B,G)=>(u.set(G.internalDialog.size),Dk(G.internalDialog.size,B),s(),d.some(G)),p=St($7({title:i.title,draggable:!0},r,a,o.shared.providers)),h=St(A7({body:i.body,initialData:i.initialData},r,c,o,n,l)),b=Of(i.buttons),v=$k(b),f=dn(b.length!==0,St(V7({buttons:b},r,o))),y=Bk(()=>S,{onBlock:B=>{Xn.block(O,(G,N)=>{const lt=p.getOpt(O).map(Q=>Te(Q.element));return Ek(B.message,N,o.shared.providers,lt)})},onUnblock:()=>{Xn.unblock(O)},onClose:()=>e.closeWindow()},o.shared.getSink),x="tox-dialog-inline",C=Rn().os,O=Xe({dom:{tag:"div",classes:["tox-dialog",x,...m],attributes:{role:"dialog",...C.isMacOS()?{"aria-label":i.title}:{"aria-labelledby":a}}},eventOrder:{[Fr()]:[Do.name(),Ao.name()],[Ho()]:["execute-on-form"],[Wn()]:["reflecting","execute-on-form"]},behaviours:D([U.config({mode:"cyclic",onEscape:B=>(pt(B,wi),d.some(!0)),useTabstopAt:B=>!Ci(B)&&(Ss(B)!=="button"||Ee(B,"disabled")!=="disabled"),firstTabstop:1}),Do.config({channel:`${zu}-${r}`,updateState:g,initialData:t}),Z.config({}),et("execute-on-form",y.concat([Ba(vn(),(B,G)=>{U.focusIn(B)}),E(ul(),(B,G)=>{B.getSystem().broadcastOn([Uu],{newFocus:G.event.newFocus})})])),Xn.config({getRoot:()=>d.some(O)}),st.config({}),Nu({}
33)]),components:[p.asSpec(),h.asSpec(),...f.map(B=>B.asSpec()).toArray()]}),F=()=>{Mk(O,u.get())},R={getId:w(r),getRoot:w(O),getFooter:()=>f.map(B=>B.get(O)),getBody:()=>h.get(O),getFormWrapper:()=>{const B=h.get(O);return ht.getCurrent(B).getOr(B)},toggleFullscreen:F},S=Lk(R,e.redial,v);return{dialog:O,instanceApi:S}};var Ef=tinymce.util.Tools.resolve("tinymce.util.URI");const z7=t=>{const e=a=>{t.getSystem().isConnected()&&a(t)};return{block:a=>{if(!Et(a))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");e(c=>{Y(c,Mh,{message:a})})},unblock:()=>{e(a=>{pt(a,Fh)})},close:()=>{e(a=>{pt(a,wi)})},sendMessage:a=>{e(c=>{c.getSystem().broadcastOn([Q_],a)})}}},U7=["insertContent","setContent","execCommand","close","block","unblock"],Hk=t=>Ys(t)&&U7.indexOf(t.mceAction)!==-1,W7=t=>!Hk(t)&&Ys(t)&&At(t,"mceAction"),G7=(t,e,o)=>{switch(o.mceAction){case"insertContent":t.insertContent(o.content);break;case"setContent":t.setContent(o.content);break;case"execCommand":const n=ys(o.ui)?o.ui:!1;t.execCommand(o.cmd,n,o.value);break;case"close":e.close();break;case"block":e.block(o.message);break;case"unblock":e.unblock();break}},j7=(t,e,o,n)=>{const s=V("dialog"),r=Ok(t.title,s,n),a=M7(t),c=t.buttons.bind(x=>x.length===0?d.none():d.some(Pk({buttons:x},s,n))),i=B7(()=>y,kk(()=>f,n.shared.providers,e)),l={...t.height.fold(()=>({}),x=>({height:x+"px","max-height":x+"px"})),...t.width.fold(()=>({}),x=>({width:x+"px","max-width":x+"px"}))},u=t.width.isNone()&&t.height.isNone()?["tox-dialog--width-lg"]:[],m=new Ef(t.url,{base_uri:new Ef(window.location.href)}),g=`${m.protocol}://${m.host}${m.port?":"+m.port:""}`,p=xa(),h=(x,C)=>d.some(C),b=[Do.config({channel:`${zu}-${s}`,updateState:h,initialData:t}),et("messages",[Vt(()=>{const x=co(I.fromDom(window),"message",C=>{if(m.isSameOrigin(new Ef(C.raw.origin))){const O=C.raw.data;Hk(O)?G7(o,y,O):W7(O)&&t.onMessage(y,O)}});p.set(x)}),jn(p.clear)]),Ao.config({channels:{[Q_]:{onReceive:(x,C)=>{Dt(x.element,"iframe").each(O=>{const F=O.dom.contentWindow;$e(F)&&F.postMessage(C,g)})}}}})],f=Fk({id:s,header:r,body:a,footer:c,extraClasses:u,extraBehaviours:b,extraStyles:l},i,n),y=z7(f);return{dialog:f,instanceApi:y}},Y7=t=>{const e=t.shared;return{open:(n,s)=>{const r=()=>{he.hide(l),s()},a=St(Xu({context:"any",name:"close-alert",text:"OK",primary:!0,buttonType:d.some("primary"),align:"end",enabled:!0,icon:d.none()},"cancel",t)),c=yk(),i=vk(r,e.providers),l=Xe(Tf({lazySink:()=>e.getSink(),header:bk(c,i),body:xk(n,e.providers),footer:d.some(Sk(wk([],[a.asSpec()]))),onEscape:r,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[E(vr,r)],eventOrder:{}}));he.show(l);const u=a.get(l);Z.focus(u)}}},X7=t=>{const e=t.shared;return{open:(n,s)=>{const r=g=>{he.hide(u),s(g)},a=St(Xu({context:"any",name:"yes",text:"Yes",primary:!0,buttonType:d.some("primary"),align:"end",enabled:!0,icon:d.none()},"submit",t)),c=Xu({context:"any",name:"no",text:"No",primary:!1,buttonType:d.some("secondary"),align:"end",enabled:!0,icon:d.none()},"cancel",t),i=yk(),l=vk(()=>r(!1),e.providers),u=Xe(Tf({lazySink:()=>e.getSink(),header:bk(i,l),body:xk(n,e.providers),footer:d.some(Sk(wk([],[c,a.asSpec()]))),onEscape:()=>r(!1),extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[E(vr,()=>r(!1)),E(Ti,()=>r(!0))],eventOrder:{}}));he.show(u);const m=a.get(u);Z.focus(m)}}},Nk=(t,e)=>hn(Xt("data",e,t)),zk=t=>Cc(t,".tox-alert-dialog")||Cc(t,".tox-confirm-dialog"),K7=(t,e,o,n)=>e&&o?[]:[jt.config({contextual:{lazyContext:()=>d.some(Ae(I.fromDom(t.getContentAreaContainer()))),fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition",onHide:n},modes:["top"],lazyViewport:s=>mr(t,s.element).map(a=>({bounds:Jr(a),optScrollEnv:d.some({currentScrollTop:a.element.dom.scrollTop,scrollElmTop:mn(a.element).top})})).getOrThunk(()=>({bounds:eo(),optScrollEnv:d.none()}))})],q7=t=>{const e=t.editor,o=Xa(e),n=Y7(t.backstages.dialog),s=X7(t.backstages.dialog),r=(h,b,v)=>{if(!os(b)){if(b.inline==="toolbar")return l(h,t.backstages.popup.shared.anch
33ors.inlineDialog(),v,b);if(b.inline==="bottom")return u(h,t.backstages.popup.shared.anchors.inlineBottomDialog(),v,b);if(b.inline==="cursor")return l(h,t.backstages.popup.shared.anchors.cursor(),v,b)}return i(h,v)},a=(h,b)=>c(h,b),c=(h,b)=>{const v=f=>{const y=j7(f,{closeWindow:()=>{he.hide(y.dialog),b(y.instanceApi)}},e,t.backstages.dialog);return he.show(y.dialog),y.instanceApi};return na.openUrl(v,h)},i=(h,b)=>{const v=(f,y,x)=>{const C=y,F=N7({dataValidator:x,initialData:C,internalDialog:f},{redial:na.redial,closeWindow:()=>{he.hide(F.dialog),b(F.instanceApi)}},t.backstages.dialog);return he.show(F.dialog),F.instanceApi.setData(C),F.instanceApi};return na.open(v,h)},l=(h,b,v,f)=>{const y=(x,C,O)=>{const F=Nk(C,O),R=Rt(),S=t.backstages.popup.shared.header.isPositionedAtTop(),B={dataValidator:O,initialData:F,internalDialog:x},G=()=>R.on(k=>{Yt.reposition(k),(!o||!S)&&jt.refresh(k)}),N=Vk(B,{redial:na.redial,closeWindow:()=>{R.on(Yt.hide),e.off("ResizeEditor",G),e.off("ScrollWindow",lt),R.clear(),v(N.instanceApi)}},t.backstages.popup,f.ariaAttrs,G),lt=()=>N.dialog.getSystem().broadcastOn([cr()],{target:N.dialog.element}),Q=()=>N.dialog.getSystem().broadcastOn([Bs()],{target:N.dialog.element}),ot=Xe(Yt.sketch({lazySink:t.backstages.popup.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:f.persistent?{event:"doNotDismissYet"}:{},...S?{}:{fireRepositionEventInstead:{}},inlineBehaviours:D([et("window-manager-inline-events",[E($r(),(k,M)=>{pt(N.dialog,vr)})]),...K7(e,o,S,Q)]),isExtraPart:(k,M)=>zk(M)}));R.set(ot);const H=()=>{const k=e.inline?Ks():I.fromDom(e.getContainer()),M=Ae(k);return d.some(M)};return Yt.showWithinBounds(ot,zo(N.dialog),{anchor:b},H),(!o||!S)&&(jt.refresh(ot),e.on("ResizeEditor",G)),e.on("ScrollWindow",lt),N.instanceApi.setData(F),U.focusIn(N.dialog),N.instanceApi};return na.open(y,h)},u=(h,b,v,f)=>{const y=(x,C,O)=>{const F=Nk(C,O),R=Rt(),S=t.backstages.popup.shared.header.isPositionedAtTop(),B={dataValidator:O,initialData:F,internalDialog:x},G=()=>R.on(ot=>{Yt.reposition(ot),jt.refresh(ot)}),N=Vk(B,{redial:na.redial,closeWindow:()=>{R.on(Yt.hide),e.off("ResizeEditor ScrollWindow ElementScroll",G),R.clear(),v(N.instanceApi)}},t.backstages.popup,f.ariaAttrs,G),lt=Xe(Yt.sketch({lazySink:t.backstages.popup.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:f.persistent?{event:"doNotDismissYet"}:{},...S?{}:{fireRepositionEventInstead:{}},inlineBehaviours:D([et("window-manager-inline-events",[E($r(),(ot,H)=>{pt(N.dialog,vr)})]),jt.config({contextual:{lazyContext:()=>d.some(Ae(I.fromDom(e.getContentAreaContainer()))),fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top","bottom"],lazyViewport:ot=>mr(e,ot.element).map(k=>({bounds:Jr(k),optScrollEnv:d.some({currentScrollTop:k.element.dom.scrollTop,scrollElmTop:mn(k.element).top})})).getOrThunk(()=>({bounds:eo(),optScrollEnv:d.none()}))})]),isExtraPart:(ot,H)=>zk(H)}));R.set(lt);const Q=()=>t.backstages.popup.shared.getSink().toOptional().bind(ot=>{const H=mr(e,ot.element),k=15,M=H.map(W=>Jr(W)).getOr(eo()),K=Ae(I.fromDom(e.getContentAreaContainer())),at=nm(K,M);return d.some(ke(at.x,at.y,at.width,at.height-k))});return Yt.showWithinBounds(lt,zo(N.dialog),{anchor:b},Q),jt.refresh(lt),e.on("ResizeEditor ScrollWindow ElementScroll ResizeWindow",G),N.instanceApi.setData(F),U.focusIn(N.dialog),N.instanceApi};return na.open(y,h)};return{open:r,openUrl:a,alert:(h,b)=>{n.open(h,b)},close:h=>{h.close()},confirm:(h,b)=>{s.open(h,b)}}},J7=t=>{lT(t),J3(t),Uj(t)};var Z7=()=>{mN.add("silver",t=>{J7(t);let e=()=>eo();const{dialogs:o,popups:n,renderUI:s}=S7(t,{getPopupSinkBounds:()=>e()}),r=()=>{const u=s();return mr(t,n.getMothership().element).each(g=>{e=()=>Jr(g)}),u};z4.register(t,n.backstage.shared);const a=q7({editor:t,backstages:{popup:n.backstage,dialog:o.backstage}}),c=Rt(),i=()=>YN(t,{backstage:n.backstage},n.getMothership(),c),l=()=>Dt(I.fromDom(t.getContainer()),".tox-promotion").map(u=>u.dom).getOrNull();return{renderUI:r,getWindowManagerImpl:w(a),getNotificationManagerImpl:i,getPromotionElement:l}})};Z7()})()}}]);
34
35//# sourceMappingURL=4934.933b0ad6b35ba63db7e2.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.