File: //home/workzeni/stream-flix.workzenix.com/vendor/livewire/flux/dist/flux-lite.min.js
(()=>{var ht=class extends Event{oldState;newState;constructor(t,{oldState:e="",newState:i="",...s}={}){super(t,s),this.oldState=String(e||""),this.newState=String(i||"")}},Fi=new WeakMap;function qi(t,e,i){Fi.set(t,setTimeout(()=>{Fi.has(t)&&t.dispatchEvent(new ht("toggle",{cancelable:!1,oldState:e,newState:i}))},0))}var Bt=globalThis.ShadowRoot||function(){},Vs=globalThis.HTMLDialogElement||function(){},rt=new WeakMap,te=new WeakMap,$e=new WeakMap;function lt(t){return $e.get(t)||"hidden"}var at=new WeakMap;function qs(t){let e=t.popoverTargetElement;if(!(e instanceof HTMLElement))return;let i=lt(e);t.popoverTargetAction==="show"&&i==="showing"||t.popoverTargetAction==="hide"&&i==="hidden"||(i==="showing"?qe(e,!0,!0):be(e,!1)&&(at.set(e,t),Wt(e)))}function be(t,e){return!(t.popover!=="auto"&&t.popover!=="manual"||!t.isConnected||e&<(t)!=="showing"||!e&<(t)!=="hidden"||t instanceof Vs&&t.hasAttribute("open")||document.fullscreenElement===t)}function Hi(t){return t?Array.from(te.get(t.ownerDocument)||[]).indexOf(t)+1:0}function $s(t){let e=$i(t),i=zs(t);return Hi(e)>Hi(i)?e:i}function ct(t){let e=te.get(t);for(let i of e||[])if(!i.isConnected)e.delete(i);else return i;return null}function Ce(t){return typeof t.getRootNode=="function"?t.getRootNode():t.parentNode?Ce(t.parentNode):t}function $i(t){for(;t;){if(t instanceof HTMLElement&&t.popover==="auto"&&$e.get(t)==="showing")return t;if(t=t instanceof Element&&t.assignedSlot||t.parentElement||Ce(t),t instanceof Bt&&(t=t.host),t instanceof Document)return}}function zs(t){for(;t;){let e=t.popoverTargetElement;if(e instanceof HTMLElement)return e;if(t=t.parentElement||Ce(t),t instanceof Bt&&(t=t.host),t instanceof Document)return}}function js(t){let e=new Map,i=0;for(let n of te.get(t.ownerDocument)||[])e.set(n,i),i+=1;e.set(t,i),i+=1;let s=null;function o(n){let r=$i(n);if(r===null)return null;let c=e.get(r);(s===null||e.get(s)<c)&&(s=r)}return o(t.parentElement||Ce(t)),s}function Ks(t){return t.hidden||t instanceof Bt||(t instanceof HTMLButtonElement||t instanceof HTMLInputElement||t instanceof HTMLSelectElement||t instanceof HTMLTextAreaElement||t instanceof HTMLOptGroupElement||t instanceof HTMLOptionElement||t instanceof HTMLFieldSetElement)&&t.disabled||t instanceof HTMLInputElement&&t.type==="hidden"||t instanceof HTMLAnchorElement&&t.href===""?!1:typeof t.tabIndex=="number"&&t.tabIndex!==-1}function Gs(t){if(t.shadowRoot&&t.shadowRoot.delegatesFocus!==!0)return null;let e=t;e.shadowRoot&&(e=e.shadowRoot);let i=e.querySelector("[autofocus]");if(i)return i;{let n=e.querySelectorAll("slot");for(let r of n){let c=r.assignedElements({flatten:!0});for(let l of c){if(l.hasAttribute("autofocus"))return l;if(i=l.querySelector("[autofocus]"),i)return i}}}let s=t.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),o=s.currentNode;for(;o;){if(Ks(o))return o;o=s.nextNode()}}function Us(t){Gs(t)?.focus()}var ut=new WeakMap;function Wt(t){if(!be(t,!1))return;let e=t.ownerDocument;if(!t.dispatchEvent(new ht("beforetoggle",{cancelable:!0,oldState:"closed",newState:"open"}))||!be(t,!1))return;let i=!1;if(t.popover==="auto"){let o=t.getAttribute("popover"),n=js(t)||e;if(dt(n,!1,!0),o!==t.getAttribute("popover")||!be(t,!1))return}ct(e)||(i=!0),ut.delete(t);let s=e.activeElement;t.classList.add(":popover-open"),$e.set(t,"showing"),rt.has(e)||rt.set(e,new Set),rt.get(e).add(t),Us(t),t.popover==="auto"&&(te.has(e)||te.set(e,new Set),te.get(e).add(t),zi(at.get(t),!0)),i&&s&&t.popover==="auto"&&ut.set(t,s),qi(t,"closed","open")}function qe(t,e=!1,i=!1){if(!be(t,!0))return;let s=t.ownerDocument;if(t.popover==="auto"&&(dt(t,e,i),!be(t,!0))||(zi(at.get(t),!1),at.delete(t),i&&(t.dispatchEvent(new ht("beforetoggle",{oldState:"open",newState:"closed"})),!be(t,!0))))return;rt.get(s)?.delete(t),te.get(s)?.delete(t),t.classList.remove(":popover-open"),$e.set(t,"hidden"),i&&qi(t,"open","closed");let o=ut.get(t);o&&(ut.delete(t),e&&o.focus())}function Wi(t,e=!1,i=!1){let s=ct(t);for(;s;)qe(s,e,i),s=ct(t)}function dt(t,e,i){let s=t.ownerDocument||t;if(t instanceof Document)return Wi(s,e,i);let o=null,n=!1;for(let r of te.get(s)||[])if(r===t)n=!0;else if(n){o=r;break}if(!n)return Wi(s,e,i);for(;o&<(o)==="showing"&&te.get(s)?.size;)qe(o,e,i)}var Nt=new WeakMap;function Bi(t){if(!t.isTrusted)return;let e=t.composedPath()[0];if(!e)return;let i=e.ownerDocument;if(!ct(i))return;let o=$s(e);if(o&&t.type==="pointerdown")Nt.set(i,o);else if(t.type==="pointerup"){let n=Nt.get(i)===o;Nt.delete(i),n&&dt(o||i,!1,!0)}}var Ft=new WeakMap;function zi(t,e=!1){if(!t)return;Ft.has(t)||Ft.set(t,t.getAttribute("aria-expanded"));let i=t.popoverTargetElement;if(i instanceof HTMLElement&&i.popover==="auto")t.setAttribute("aria-expanded",String(e));else{let s=Ft.get(t);s?t.setAttribute("aria-expanded",s):t.removeAttribute("aria-expanded")}}var Vi=globalThis.ShadowRoot||function(){};function Ys(){return typeof HTMLElement<"u"&&typeof HTMLElement.prototype=="object"&&"popover"in HTMLElement.prototype}function pe(t,e,i){let s=t[e];Object.defineProperty(t,e,{value(o){return s.call(this,i(o))}})}var Xs=/(^|[^\\]):popover-open\b/g;function Js(){return typeof globalThis.CSSLayerBlockRule=="function"}function Qs(){let t=Js();return`
${t?"@layer popover-polyfill {":""}
:where([popover]) {
position: fixed;
z-index: 2147483647;
inset: 0;
padding: 0.25em;
width: fit-content;
height: fit-content;
border-width: initial;
border-color: initial;
border-image: initial;
border-style: solid;
background-color: canvas;
color: canvastext;
overflow: auto;
margin: auto;
}
:where([popover]:not(.\\:popover-open)) {
display: none;
}
:where(dialog[popover].\\:popover-open) {
display: block;
}
:where(dialog[popover][open]) {
display: revert;
}
:where([anchor].\\:popover-open) {
inset: auto;
}
:where([anchor]:popover-open) {
inset: auto;
}
@supports not (background-color: canvas) {
:where([popover]) {
background-color: white;
color: black;
}
}
@supports (width: -moz-fit-content) {
:where([popover]) {
width: -moz-fit-content;
height: -moz-fit-content;
}
}
@supports not (inset: 0) {
:where([popover]) {
top: 0;
left: 0;
right: 0;
bottom: 0;
}
}
${t?"}":""}
`}var ke=null;function Ht(t){let e=Qs();if(ke===null)try{ke=new CSSStyleSheet,ke.replaceSync(e)}catch{ke=!1}if(ke===!1){let i=document.createElement("style");i.textContent=e,t instanceof Document?t.head.prepend(i):t.prepend(i)}else t.adoptedStyleSheets=[ke,...t.adoptedStyleSheets]}function Zs(){if(typeof window>"u")return;window.ToggleEvent=window.ToggleEvent||ht;function t(l){return l?.includes(":popover-open")&&(l=l.replace(Xs,"$1.\\:popover-open")),l}pe(Document.prototype,"querySelector",t),pe(Document.prototype,"querySelectorAll",t),pe(Element.prototype,"querySelector",t),pe(Element.prototype,"querySelectorAll",t),pe(Element.prototype,"matches",t),pe(Element.prototype,"closest",t),pe(DocumentFragment.prototype,"querySelectorAll",t),Object.defineProperties(HTMLElement.prototype,{popover:{enumerable:!0,configurable:!0,get(){if(!this.hasAttribute("popover"))return null;let l=(this.getAttribute("popover")||"").toLowerCase();return l===""||l=="auto"?"auto":"manual"},set(l){l===null?this.removeAttribute("popover"):this.setAttribute("popover",l)}},showPopover:{enumerable:!0,configurable:!0,value(){Wt(this)}},hidePopover:{enumerable:!0,configurable:!0,value(){qe(this,!0,!0)}},togglePopover:{enumerable:!0,configurable:!0,value(l){$e.get(this)==="showing"&&l===void 0||l===!1?qe(this,!0,!0):(l===void 0||l===!0)&&Wt(this)}}});let e=Element.prototype.attachShadow;e&&Object.defineProperties(Element.prototype,{attachShadow:{enumerable:!0,configurable:!0,writable:!0,value(l){let a=e.call(this,l);return Ht(a),a}}});let i=HTMLElement.prototype.attachInternals;i&&Object.defineProperties(HTMLElement.prototype,{attachInternals:{enumerable:!0,configurable:!0,writable:!0,value(){let l=i.call(this);return l.shadowRoot&&Ht(l.shadowRoot),l}}});let s=new WeakMap;function o(l){Object.defineProperties(l.prototype,{popoverTargetElement:{enumerable:!0,configurable:!0,set(a){if(a===null)this.removeAttribute("popovertarget"),s.delete(this);else if(a instanceof Element)this.setAttribute("popovertarget",""),s.set(this,a);else throw new TypeError("popoverTargetElement must be an element or null")},get(){if(this.localName!=="button"&&this.localName!=="input"||this.localName==="input"&&this.type!=="reset"&&this.type!=="image"&&this.type!=="button"||this.disabled||this.form&&this.type==="submit")return null;let a=s.get(this);if(a&&a.isConnected)return a;if(a&&!a.isConnected)return s.delete(this),null;let f=Ce(this),d=this.getAttribute("popovertarget");return(f instanceof Document||f instanceof Vi)&&d&&f.getElementById(d)||null}},popoverTargetAction:{enumerable:!0,configurable:!0,get(){let a=(this.getAttribute("popovertargetaction")||"").toLowerCase();return a==="show"||a==="hide"?a:"toggle"},set(a){this.setAttribute("popovertargetaction",a)}}})}o(HTMLButtonElement),o(HTMLInputElement);let n=l=>{let a=l.composedPath(),f=a[0];if(!(f instanceof Element)||f?.shadowRoot)return;let d=Ce(f);if(!(d instanceof Vi||d instanceof Document))return;let m=a.find(g=>g.matches?.("[popovertargetaction],[popovertarget]"));if(m){qs(m),l.preventDefault();return}},r=l=>{let a=l.key,f=l.target;!l.defaultPrevented&&f&&(a==="Escape"||a==="Esc")&&dt(f.ownerDocument,!0,!0)};(l=>{l.addEventListener("click",n),l.addEventListener("keydown",r),l.addEventListener("pointerdown",Bi),l.addEventListener("pointerup",Bi)})(document),Ht(document)}Ys()||Zs();var vt=class extends Event{oldState;newState;constructor(t,{oldState:e="",newState:i="",...s}={}){super(t,s),this.oldState=String(e||""),this.newState=String(i||"")}},ji=new WeakMap;function Xi(t,e,i){ji.set(t,setTimeout(()=>{ji.has(t)&&t.dispatchEvent(new vt("toggle",{cancelable:!1,oldState:e,newState:i}))},0))}var jt=globalThis.ShadowRoot||function(){},eo=globalThis.HTMLDialogElement||function(){},ft=new WeakMap,ie=new WeakMap,je=new WeakMap;function pt(t){return je.get(t)||"hidden"}var bt=new WeakMap;function to(t){let e=t.popoverTargetElement;if(!(e instanceof HTMLElement))return;let i=pt(e);t.popoverTargetAction==="show"&&i==="showing"||t.popoverTargetAction==="hide"&&i==="hidden"||(i==="showing"?ze(e,!0,!0):ge(e,!1)&&(bt.set(e,t),zt(e)))}function ge(t,e){return!(t.popover!=="auto"&&t.popover!=="manual"||!t.isConnected||e&&pt(t)!=="showing"||!e&&pt(t)!=="hidden"||t instanceof eo&&t.hasAttribute("open")||document.fullscreenElement===t)}function Ki(t){return t?Array.from(ie.get(t.ownerDocument)||[]).indexOf(t)+1:0}function io(t){let e=Ji(t),i=so(t);return Ki(e)>Ki(i)?e:i}function mt(t){let e=ie.get(t);for(let i of e||[])if(!i.isConnected)e.delete(i);else return i;return null}function Oe(t){return typeof t.getRootNode=="function"?t.getRootNode():t.parentNode?Oe(t.parentNode):t}function Ji(t){for(;t;){if(t instanceof HTMLElement&&t.popover==="auto"&&je.get(t)==="showing")return t;if(t=t instanceof Element&&t.assignedSlot||t.parentElement||Oe(t),t instanceof jt&&(t=t.host),t instanceof Document)return}}function so(t){for(;t;){let e=t.popoverTargetElement;if(e instanceof HTMLElement)return e;if(t=t.parentElement||Oe(t),t instanceof jt&&(t=t.host),t instanceof Document)return}}function oo(t){let e=new Map,i=0;for(let n of ie.get(t.ownerDocument)||[])e.set(n,i),i+=1;e.set(t,i),i+=1;let s=null;function o(n){let r=Ji(n);if(r===null)return null;let c=e.get(r);(s===null||e.get(s)<c)&&(s=r)}return o(t.parentElement||Oe(t)),s}function no(t){return t.hidden||t instanceof jt||(t instanceof HTMLButtonElement||t instanceof HTMLInputElement||t instanceof HTMLSelectElement||t instanceof HTMLTextAreaElement||t instanceof HTMLOptGroupElement||t instanceof HTMLOptionElement||t instanceof HTMLFieldSetElement)&&t.disabled||t instanceof HTMLInputElement&&t.type==="hidden"||t instanceof HTMLAnchorElement&&t.href===""?!1:typeof t.tabIndex=="number"&&t.tabIndex!==-1}function ro(t){if(t.shadowRoot&&t.shadowRoot.delegatesFocus!==!0)return null;let e=t;e.shadowRoot&&(e=e.shadowRoot);let i=e.querySelector("[autofocus]");if(i)return i;{let n=e.querySelectorAll("slot");for(let r of n){let c=r.assignedElements({flatten:!0});for(let l of c){if(l.hasAttribute("autofocus"))return l;if(i=l.querySelector("[autofocus]"),i)return i}}}let s=t.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),o=s.currentNode;for(;o;){if(no(o))return o;o=s.nextNode()}}function lo(t){ro(t)?.focus()}var gt=new WeakMap;function zt(t){if(!ge(t,!1))return;let e=t.ownerDocument;if(!t.dispatchEvent(new vt("beforetoggle",{cancelable:!0,oldState:"closed",newState:"open"}))||!ge(t,!1))return;let i=!1;if(t.popover==="auto"){let o=t.getAttribute("popover"),n=oo(t)||e;if(wt(n,!1,!0),o!==t.getAttribute("popover")||!ge(t,!1))return}mt(e)||(i=!0),gt.delete(t);let s=e.activeElement;t.classList.add(":popover-open"),je.set(t,"showing"),ft.has(e)||ft.set(e,new Set),ft.get(e).add(t),lo(t),t.popover==="auto"&&(ie.has(e)||ie.set(e,new Set),ie.get(e).add(t),Qi(bt.get(t),!0)),i&&s&&t.popover==="auto"&>.set(t,s),Xi(t,"closed","open")}function ze(t,e=!1,i=!1){if(!ge(t,!0))return;let s=t.ownerDocument;if(t.popover==="auto"&&(wt(t,e,i),!ge(t,!0))||(Qi(bt.get(t),!1),bt.delete(t),i&&(t.dispatchEvent(new vt("beforetoggle",{oldState:"open",newState:"closed"})),!ge(t,!0))))return;ft.get(s)?.delete(t),ie.get(s)?.delete(t),t.classList.remove(":popover-open"),je.set(t,"hidden"),i&&Xi(t,"open","closed");let o=gt.get(t);o&&(gt.delete(t),e&&o.focus())}function Gi(t,e=!1,i=!1){let s=mt(t);for(;s;)ze(s,e,i),s=mt(t)}function wt(t,e,i){let s=t.ownerDocument||t;if(t instanceof Document)return Gi(s,e,i);let o=null,n=!1;for(let r of ie.get(s)||[])if(r===t)n=!0;else if(n){o=r;break}if(!n)return Gi(s,e,i);for(;o&&pt(o)==="showing"&&ie.get(s)?.size;)ze(o,e,i)}var Vt=new WeakMap;function Ui(t){if(!t.isTrusted)return;let e=t.composedPath()[0];if(!e)return;let i=e.ownerDocument;if(!mt(i))return;let o=io(e);if(o&&t.type==="pointerdown")Vt.set(i,o);else if(t.type==="pointerup"){let n=Vt.get(i)===o;Vt.delete(i),n&&wt(o||i,!1,!0)}}var qt=new WeakMap;function Qi(t,e=!1){if(!t)return;qt.has(t)||qt.set(t,t.getAttribute("aria-expanded"));let i=t.popoverTargetElement;if(i instanceof HTMLElement&&i.popover==="auto")t.setAttribute("aria-expanded",String(e));else{let s=qt.get(t);s?t.setAttribute("aria-expanded",s):t.removeAttribute("aria-expanded")}}var Yi=globalThis.ShadowRoot||function(){};function Zi(){return typeof HTMLElement<"u"&&typeof HTMLElement.prototype=="object"&&"popover"in HTMLElement.prototype}function es(){return!!(document.body?.showPopover&&!/native code/i.test(document.body.showPopover.toString()))}function me(t,e,i){let s=t[e];Object.defineProperty(t,e,{value(o){return s.call(this,i(o))}})}var ao=/(^|[^\\]):popover-open\b/g;function co(){return typeof globalThis.CSSLayerBlockRule=="function"}function uo(){let t=co();return`
${t?"@layer popover-polyfill {":""}
:where([popover]) {
position: fixed;
z-index: 2147483647;
inset: 0;
padding: 0.25em;
width: fit-content;
height: fit-content;
border-width: initial;
border-color: initial;
border-image: initial;
border-style: solid;
background-color: canvas;
color: canvastext;
overflow: auto;
margin: auto;
}
:where([popover]:not(.\\:popover-open)) {
display: none;
}
:where(dialog[popover].\\:popover-open) {
display: block;
}
:where(dialog[popover][open]) {
display: revert;
}
:where([anchor].\\:popover-open) {
inset: auto;
}
:where([anchor]:popover-open) {
inset: auto;
}
@supports not (background-color: canvas) {
:where([popover]) {
background-color: white;
color: black;
}
}
@supports (width: -moz-fit-content) {
:where([popover]) {
width: -moz-fit-content;
height: -moz-fit-content;
}
}
@supports not (inset: 0) {
:where([popover]) {
top: 0;
left: 0;
right: 0;
bottom: 0;
}
}
${t?"}":""}
`}var Te=null;function $t(t){let e=uo();if(Te===null)try{Te=new CSSStyleSheet,Te.replaceSync(e)}catch{Te=!1}if(Te===!1){let i=document.createElement("style");i.textContent=e,t instanceof Document?t.head.prepend(i):t.prepend(i)}else t.adoptedStyleSheets=[Te,...t.adoptedStyleSheets]}function ts(){if(typeof window>"u")return;window.ToggleEvent=window.ToggleEvent||vt;function t(l){return l?.includes(":popover-open")&&(l=l.replace(ao,"$1.\\:popover-open")),l}me(Document.prototype,"querySelector",t),me(Document.prototype,"querySelectorAll",t),me(Element.prototype,"querySelector",t),me(Element.prototype,"querySelectorAll",t),me(Element.prototype,"matches",t),me(Element.prototype,"closest",t),me(DocumentFragment.prototype,"querySelectorAll",t),Object.defineProperties(HTMLElement.prototype,{popover:{enumerable:!0,configurable:!0,get(){if(!this.hasAttribute("popover"))return null;let l=(this.getAttribute("popover")||"").toLowerCase();return l===""||l=="auto"?"auto":"manual"},set(l){l===null?this.removeAttribute("popover"):this.setAttribute("popover",l)}},showPopover:{enumerable:!0,configurable:!0,value(){zt(this)}},hidePopover:{enumerable:!0,configurable:!0,value(){ze(this,!0,!0)}},togglePopover:{enumerable:!0,configurable:!0,value(l){je.get(this)==="showing"&&l===void 0||l===!1?ze(this,!0,!0):(l===void 0||l===!0)&&zt(this)}}});let e=Element.prototype.attachShadow;e&&Object.defineProperties(Element.prototype,{attachShadow:{enumerable:!0,configurable:!0,writable:!0,value(l){let a=e.call(this,l);return $t(a),a}}});let i=HTMLElement.prototype.attachInternals;i&&Object.defineProperties(HTMLElement.prototype,{attachInternals:{enumerable:!0,configurable:!0,writable:!0,value(){let l=i.call(this);return l.shadowRoot&&$t(l.shadowRoot),l}}});let s=new WeakMap;function o(l){Object.defineProperties(l.prototype,{popoverTargetElement:{enumerable:!0,configurable:!0,set(a){if(a===null)this.removeAttribute("popovertarget"),s.delete(this);else if(a instanceof Element)this.setAttribute("popovertarget",""),s.set(this,a);else throw new TypeError("popoverTargetElement must be an element or null")},get(){if(this.localName!=="button"&&this.localName!=="input"||this.localName==="input"&&this.type!=="reset"&&this.type!=="image"&&this.type!=="button"||this.disabled||this.form&&this.type==="submit")return null;let a=s.get(this);if(a&&a.isConnected)return a;if(a&&!a.isConnected)return s.delete(this),null;let f=Oe(this),d=this.getAttribute("popovertarget");return(f instanceof Document||f instanceof Yi)&&d&&f.getElementById(d)||null}},popoverTargetAction:{enumerable:!0,configurable:!0,get(){let a=(this.getAttribute("popovertargetaction")||"").toLowerCase();return a==="show"||a==="hide"?a:"toggle"},set(a){this.setAttribute("popovertargetaction",a)}}})}o(HTMLButtonElement),o(HTMLInputElement);let n=l=>{let a=l.composedPath(),f=a[0];if(!(f instanceof Element)||f?.shadowRoot)return;let d=Oe(f);if(!(d instanceof Yi||d instanceof Document))return;let m=a.find(g=>g.matches?.("[popovertargetaction],[popovertarget]"));if(m){to(m),l.preventDefault();return}},r=l=>{let a=l.key,f=l.target;!l.defaultPrevented&&f&&(a==="Escape"||a==="Esc")&&wt(f.ownerDocument,!0,!0)};(l=>{l.addEventListener("click",n),l.addEventListener("keydown",r),l.addEventListener("pointerdown",Ui),l.addEventListener("pointerup",Ui)})(document),$t(document)}function O(t){let e=t({css:(s,...o)=>`@layer base { ${s.raw[0]+o.join("")} }`});if(document.adoptedStyleSheets===void 0){let s=document.createElement("style");s.textContent=e,document.head.appendChild(s);return}let i=new CSSStyleSheet;i.replaceSync(e),document.adoptedStyleSheets=[...document.adoptedStyleSheets,i]}function At(t,e){let i=t;for(;i;){if(e(i))return i;i=i.parentElement}}function L(t,e){let i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,e?{acceptNode:s=>{let o,n;return e(s,{skip:()=>o=!0,reject:()=>n=!0}),o?NodeFilter.FILTER_SKIP:n?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}:{});return new Kt(i)}var Kt=class{constructor(e){this.walker=e}from(e){return this.walker.currentNode=e,this}first(){return this.walker.firstChild()}last(){return this.walker.lastChild()}next(e){return this.walker.currentNode=e,this.walker.nextSibling()}nextOrFirst(e){let i=this.next(e);return i||(this.walker.currentNode=this.walker.root,this.first())}prev(e){return this.walker.currentNode=e,this.walker.previousSibling()}prevOrLast(e){let i=this.prev(e);return i||(this.walker.currentNode=this.walker.root,this.last())}closest(e,i){let s=this.from(e).walker;for(;s.currentNode;){if(i(s.currentNode))return s.currentNode;s.parentNode()}}contains(e){return this.find(i=>i===e)}find(e){return this.walk((i,s)=>{e(i)&&s(i)})}findOrFirst(e){return this.find(e)||(this.walker.currentNode=this.walker.root),this.first()}each(e){this.walk(i=>e(i))}some(e){return!!this.find(e)}every(e){let i=!0;return this.walk(s=>{e(s)||(i=!1)}),i}map(e){let i=[];return this.walk(s=>i.push(e(s))),i}filter(e){let i=[];return this.walk(s=>e(s)&&i.push(s)),i}walk(e){let i,s=this.walker,o;for(;s.nextNode()&&(i=s.currentNode,e(i,n=>o=n),o===void 0););return o}};function A(t,e){customElements.define(`ui-${t}`,e)}function b(t,e,i,s={}){return t.addEventListener(e,i,s),{off:()=>t.removeEventListener(e,i),pause:o=>{t.removeEventListener(e,i),o(),t.addEventListener(e,i)}}}function ss(t){return["a[href]","area[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","iframe","object","embed","[tabindex]","[contenteditable]"].some(i=>t.matches(i))&&t.tabIndex>=0}function ho(t,e){let i;return function(){let s=this,o=arguments;i||(t.apply(s,o),i=!0,setTimeout(()=>i=!1,e))}}var Ke="pointer";document.addEventListener("keydown",()=>Ke="keyboard",{capture:!0});document.addEventListener("pointerdown",t=>{Ke=t.pointerType==="mouse"?"mouse":"touch"},{capture:!0});document.addEventListener("pointermove",t=>{Ke=t.pointerType==="mouse"?"mouse":"touch"},{capture:!0});function ve(){return Ke==="keyboard"}function fo(){return Ke==="touch"}function xt(t,e){let i="",s=Ao(()=>{i=""},300);t.addEventListener("keydown",o=>{o.key.length===1&&/[a-zA-Z]/.test(o.key)&&(i+=o.key,e(i),o.stopPropagation()),s()})}function po(t,e){return"lofi-"+(e?e+"-":"")+Math.random().toString(16).slice(2)}function H(t,e){let i=t.hasAttribute("id")?t.getAttribute("id"):po(t,e);return h(t,"id",i),t._x_bindings||(t._x_bindings={}),t._x_bindings.id||(t._x_bindings.id=i),i}function D(){let t=!1;return e=>(...i)=>{t||(t=!0,e(...i),t=!1)}}function De(t,e,{gain:i,lose:s,focusable:o,useSafeArea:n}){let r=!1,c=v=>{ve()&&(t.contains(v.target)||e.contains(v.target)?(r=!0,i()):(r=!1,s()))};o&&document.addEventListener("focusin",c);let l=()=>{document.removeEventListener("focusin",c)},a=()=>{},f=()=>{},d=()=>{r=!1,s(),a(),f()},m=()=>{r=!1,a(),f()},g=v=>{fo()||r||(r=!0,i(),setTimeout(()=>{let{safeArea:w,redraw:E,remove:_}=n?bo(t,e,v.clientX,v.clientY):yo();a=_;let P,T=ho(I=>{let $=e.getBoundingClientRect(),ee=t.getBoundingClientRect(),q;switch(w.contains(I.target)&&mo(ee,$,I.clientX,I.clientY)?q="safeArea":e.contains(I.target)?q="panel":t.contains(I.target)?q="trigger":q="outside",P&&clearTimeout(P),q){case"outside":d();break;case"trigger":E(I.clientX,I.clientY);break;case"panel":a();break;case"safeArea":E(I.clientX,I.clientY),P=setTimeout(()=>{d()},300);break;default:break}},100);document.addEventListener("pointermove",T),f=()=>document.removeEventListener("pointermove",T)}))};t.addEventListener("pointerenter",g);let u=()=>{t.removeEventListener("pointerenter",g)};return{clear:m,remove:()=>{m(),u(),l()}}}function bo(t,e,i,s){let o=document.createElement("div"),n=e.getBoundingClientRect(),r=t.getBoundingClientRect();o.style.position="fixed",h(o,"data-safe-area","");let c=(l,a)=>{if(n.top===0&&n.bottom===0)return;let f;n.left<r.left&&(f="left"),n.right>r.right&&(f="right"),n.top<r.top&&n.bottom<a&&(f="up"),n.bottom>r.bottom&&n.top>a&&(f="down"),f===void 0&&(f="right");let d,m,g,u,p,v,w,E,_=10;switch(f){case"left":d=n.right,m=Math.max(n.right,l)+5,g=m-d,u=Math.min(r.top,n.top)-_,p=Math.max(r.bottom,n.bottom)+_,v=p-u,w=a-u,E=`polygon(0% 0%, 100% ${w}px, 0% 100%)`;break;case"right":d=Math.min(n.left,l)-5,m=n.left,g=m-d,u=Math.min(r.top,n.top)-_,p=Math.max(r.bottom,n.bottom)+_,v=p-u,w=a-u,E=`polygon(0% ${w}px, 100% 0%, 100% 100%)`;break;case"up":d=Math.min(l,n.left)-_,m=Math.max(l,n.right)+_,g=m-d,u=n.bottom,p=Math.max(n.bottom,a)+5,v=p-u,w=l-d,E=`polygon(0% 0%, 100% 0%, ${w}px 100%)`;break;case"down":d=Math.min(l,n.left)-_,m=Math.max(l,n.right)+_,g=m-d,u=Math.min(n.top,a)-5,p=n.top,v=p-u,w=l-d,E=`polygon(${w}px 0%, 100% 100%, 0% 100%)`;break}o.style.left=`${d}px`,o.style.top=`${u}px`,o.style.width=`${g}px`,o.style.height=`${v}px`,o.style.clipPath=E};return{safeArea:o,redraw:(l,a)=>{o.isConnected||t.appendChild(o),c(l,a)},remove:()=>{o.remove()}}}function mo(t,e,i,s){return!go(t,i,s)&&!vo(e,i,s)}function go(t,e,i){return t.left<=e&&e<=t.right&&t.top<=i&&i<=t.bottom}function vo(t,e,i){return t.left<=e&&e<=t.right&&t.top<=i&&i<=t.bottom}function h(t,e,i){t._durableAttributeObserver===void 0&&(t._durableAttributeObserver=os(t,[e])),t._durableAttributeObserver.hasAttribute(e)||t._durableAttributeObserver.addAttribute(e),t._durableAttributeObserver.pause(()=>{t.setAttribute(e,i)})}function se(t,e){y(t,e),wo(t,e)}function y(t,e){t._durableAttributeObserver===void 0&&(t._durableAttributeObserver=os(t,[e])),t._durableAttributeObserver.hasAttribute(e)||t._durableAttributeObserver.addAttribute(e),t._durableAttributeObserver.pause(()=>{t.removeAttribute(e)})}function wo(t,e){t?._durableAttributeObserver?.hasAttribute(e)&&t._durableAttributeObserver.releaseAttribute(e)}function os(t,e){let i=o=>{o.forEach(n=>{n.oldValue===null?t._durableAttributeObserver.pause(()=>y(t,n.attributeName)):t._durableAttributeObserver.pause(()=>h(t,n.attributeName,n.oldValue))})},s=new MutationObserver(o=>i(o));return s.observe(t,{attributeFilter:e,attributeOldValue:!0}),{attributes:e,hasAttribute(o){return this.attributes.includes(o)},addAttribute(o){this.attributes.includes(o)||this.attributes.push(o),s.observe(t,{attributeFilter:this.attributes,attributeOldValue:!0})},releaseAttribute(o){this.hasAttribute(o)&&s.observe(t,{attributeFilter:this.attributes,attributeOldValue:!0})},pause(o){i(s.takeRecords()),s.disconnect(),o(),s.observe(t,{attributeFilter:this.attributes,attributeOldValue:!0})}}}function yo(){return{safeArea:{contains:()=>!1},redraw:()=>{},remove:()=>{}}}function Ao(t,e){let i;return(...s)=>{clearTimeout(i),i=setTimeout(()=>{t(...s)},e)}}var Pe=0,Le=!1;O(({css:t})=>t`[data-flux-allow-scroll] { pointer-events: auto; }`);function oe(t=null,e=!1,i=[]){if(e)return{lock:()=>{},unlock:()=>{}};let s=(n=!1)=>{is(document.documentElement),xo(document.documentElement,{paddingRight:`calc(${window.innerWidth-document.documentElement.clientWidth}px + ${window.getComputedStyle(document.documentElement).paddingRight})`,overflow:"hidden",...n?{pointerEvents:"none"}:{}}),n&&(h(t,"data-flux-allow-scroll",""),i.forEach(r=>{h(r,"data-flux-allow-scroll","")}),Le=!0)},o=(n=!1)=>{is(document.documentElement),n&&(se(t,"data-flux-allow-scroll"),i.forEach(r=>{y(r,"data-flux-allow-scroll")}),Le=!1)};return{lock(){Pe++,!(Pe>1&&t!==null&&Le)&&s(t!==null&&!Le)},unlock(){Pe=Math.max(0,Pe-1),!(Pe>0&&t!==null&&!Le)&&(o(t!==null&&Le),Pe>0&&s(!1))}}}function xo(t,e){let i=JSON.parse(t.getAttribute("data-flux-scroll-unlock")||"{}");Object.entries(e).forEach(([s,o])=>{i[s]===void 0&&(i[s]=t.style[s],t.style[s]=o)}),t.setAttribute("data-flux-scroll-unlock",JSON.stringify(i))}function is(t){let e=JSON.parse(t.getAttribute("data-flux-scroll-unlock")||"{}");Object.entries(e).forEach(([i,s])=>{t.style[i]=s}),t.removeAttribute("data-flux-scroll-unlock")}function Ge(){return document.documentElement.dir==="rtl"}function ns(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!navigator.userAgent.includes("CriOS")&&!navigator.userAgent.includes("FxiOS")}var yt=class{constructor(){this.subscribers=[]}subscribe(e,i){this.subscribers.push({reason:e,callback:i})}notify(e,i){this.subscribers.forEach(({reason:s,callback:o})=>{e===s&&o(i)})}};var x=class extends HTMLElement{wasDisconnected=!1;constructor(){super(),this.boot?.()}connectedCallback(){if(this.wasDisconnected){this.wasDisconnected=!1;return}queueMicrotask(()=>{this.mount?.()})}disconnectedCallback(){this.wasDisconnected=!0,queueMicrotask(()=>{this.wasDisconnected&&this.unmount?.(),this.wasDisconnected=!1})}mixin(e,i={}){return new e(this,i)}appendMixin(e,i={}){return new e(this,i)}use(e){let i;return this.mixins.forEach(s=>{s instanceof e&&(i=s)}),i}uses(e){let i;return this.mixins.forEach(s=>{s instanceof e&&(i=!0)}),!!i}on(e,i){return b(this,e,i)}root(e,i={}){if(e===void 0)return this.__root;let s=document.createElement(e);for(let n in i)setAttribute(s,n,i[n]);let o=this.attachShadow({mode:"open"});return s.appendChild(document.createElement("slot")),o.appendChild(s),this.__root=s,this.__root}},W=class extends x{};var S=class{constructor(e,i={}){this.el=e,this.grouped=i.grouped===void 0,this.el.mixins=this.el.mixins?this.el.mixins:new Map,this.el.mixins.set(this.constructor.name,this),this.el[this.constructor.name]=!0,this.el.use||(this.el.use=x.prototype.use.bind(this.el)),this.opts=i,this.boot?.({options:s=>{let o=s;Object.entries(this.opts).forEach(([n,r])=>{r!==void 0&&(o[n]=r)}),this.opts=o}}),queueMicrotask(()=>{this.mount?.()})}options(){return this.opts}hasGroup(){return!!this.group()}group(){if(this.grouped!==!1)return At(this.el,e=>e[this.groupedByType.name])?.use(this.groupedByType)}on(e,i){return b(this.el,e,i)}},Z=class extends S{constructor(e,i={}){super(e,i)}walker(){return L(this.el,(e,{skip:i,reject:s})=>{if(e[this.constructor.name]&&e!==this.el)return s();if(!e[this.groupOfType.name]||!e.mixins.get(this.groupOfType.name).grouped)return i()})}};var M=class extends S{boot({options:e}){e({bubbles:!1}),this.initialState=this.el.value,this.getterFunc=()=>{},this.setterFunc=i=>this.initialState=i,Object.defineProperty(this.el,"value",{get:()=>this.getterFunc(),set:i=>{this.setterFunc(i)}})}initial(e){e(this.initialState)}getter(e){this.getterFunc=e}setter(e){this.setterFunc=e}dispatch(){this.el.dispatchEvent(new Event("input",{bubbles:this.options().bubbles,cancelable:!0})),this.el.dispatchEvent(new Event("change",{bubbles:this.options().bubbles,cancelable:!0}))}};var Ue=null;document.addEventListener("mousedown",t=>Ue=t);var Et=class extends S{boot({options:e}){e({clickOutside:!0,triggers:[]}),this.onChanges=[],this.state=!1,this.stopDialogFromFocusingTheFirstElement();let i=this.options().triggers;new MutationObserver(o=>{o.forEach(n=>{n.attributeName==="open"&&(this.el.hasAttribute("open")?this.state=!0:this.state=!1)}),this.onChanges.forEach(n=>n())}).observe(this.el,{attributeFilter:["open"]}),this.options().clickOutside&&this.el.addEventListener("click",o=>{if(o.target!==this.el){Ue=null;return}Ue&&rs(this.el,Ue)&&rs(this.el,o)&&(this.cancel(),o.preventDefault(),o.stopPropagation()),Ue=null}),this.el.hasAttribute("open")&&(this.state=!0,this.hide(),this.show())}onChange(e){this.onChanges.push(e)}show(){this.el.isConnected&&this.el.showModal()}hide(){this.el.close()}toggle(){this.state?this.hide():this.show()}cancel(){let e=new Event("cancel",{bubbles:!1,cancelable:!0});this.el.dispatchEvent(e),e.defaultPrevented||this.hide()}getState(){return this.state}setState(e){e?this.show():this.hide()}stopDialogFromFocusingTheFirstElement(){let e=document.createElement("div");e.setAttribute("data-flux-focus-placeholder",""),e.setAttribute("data-appended",""),e.setAttribute("tabindex","0"),this.el.prepend(e),this.onChange(()=>{h(e,"style",this.state?"display: none":"display: block"),this.state&&ns()&&!this.el.hasAttribute("autofocus")&&this.el.querySelectorAll("[autofocus]").length===0&&setTimeout(()=>{this.el.setAttribute("tabindex","-1"),this.el.focus(),this.el.blur()})})}};function rs(t,e){let i=t.getBoundingClientRect(),s=e.clientX,o=e.clientY;return!(s>=i.left&&s<=i.right&&o>=i.top&&o<=i.bottom)}var _t=class extends S{boot(){this.onCloses=[]}onClose(e){this.onCloses.push(e)}close(){this.onCloses.forEach(e=>e())}};var Gt=class extends x{boot(){this.querySelectorAll("[data-appended]").forEach(c=>c.remove()),this._controllable=new M(this,{disabled:this.hasAttribute("disabled")});let e=this.button(),i=this.dialog();if(!i)return;i._dialogable=new Et(i,{clickOutside:!this.hasAttribute("disable-click-outside")}),i._closeable=new _t(i),i._closeable.onClose(()=>i._dialogable.hide()),this._controllable.initial(c=>c&&i._dialogable.show()),this._controllable.getter(()=>i._dialogable.getState());let s=D();this._controllable.setter(s(c=>{i._dialogable.setState(c)})),i._dialogable.onChange(s(()=>{this._controllable.dispatch()}));let o=()=>{i._dialogable.getState()?(h(this,"data-open",""),e?.setAttribute("data-open",""),h(i,"data-open","")):(y(this,"data-open"),e?.removeAttribute("data-open"),y(i,"data-open"))};i._dialogable.onChange(()=>o()),o();let{lock:n,unlock:r}=oe();i._dialogable.onChange(()=>{i._dialogable.getState()?n():r()}),e&&b(e,"click",c=>{i._dialogable.show()})}unmount(){if(this.dialog()?._dialogable?.getState()){let{unlock:e}=oe();e()}}button(){let e=this.querySelector("button");if(!this.dialog()?.contains(e))return e}dialog(){return this.querySelector("dialog")}showModal(){let e=this.dialog();e&&e.showModal()}};O(({css:t})=>t`dialog, ::backdrop { margin: auto; }`);A("modal",Gt);var St=class extends S{boot({options:e}){this.onChanges=[],this.state=!1}onChange(e){this.onChanges.push(e)}getState(){return this.state}setState(e){let i=this.state;this.state=!!e,this.state!==i&&this.onChanges.forEach(s=>s())}};var Ut=class extends x{boot(){let e=this.button(),i=this.details();if(e){if(!i)return console.warn("ui-disclosure: no panel element found",this)}else return console.warn("ui-disclosure: no trigger element found",this);this._disabled=this.hasAttribute("disabled"),this._controllable=new M(this,{disabled:this._disabled}),i._disclosable=new St(i),this._controllable.initial(n=>n&&i._disclosable.setState(!0)),this._controllable.getter(()=>i._disclosable.getState()),this._controllable.setter(n=>i._disclosable.setState(n)),i._disclosable.onChange(()=>{this.dispatchEvent(new CustomEvent("lofi-disclosable-change",{bubbles:!0})),this._controllable.dispatch()});let s=()=>{i._disclosable.getState()?(h(this,"data-open",""),h(e,"data-open",""),h(i,"data-open","")):(y(this,"data-open"),y(e,"data-open"),y(i,"data-open"))};i._disclosable.onChange(()=>s()),s(),this._disabled||b(e,"click",n=>{i._disclosable.setState(!i._disclosable.getState())});let o=H(i,"disclosure");h(e,"aria-controls",o),h(e,"aria-expanded","false"),i._disclosable.onChange(()=>{i._disclosable.getState()?h(e,"aria-expanded","true"):h(e,"aria-expanded","false")}),this.hasAttribute("open")&&i._disclosable.setState(!0)}button(){return this.querySelector("button")}details(){return this.lastElementChild}},Yt=class t extends x{boot(){this.exclusive=this.hasAttribute("exclusive"),this.exclusive&&b(this,"lofi-disclosable-change",e=>{e.stopPropagation(),e.target.localName==="ui-disclosure"&&e.target.value&&this.disclosureWalker().each(i=>{i!==e.target&&(i.value=!1)})})}disclosureWalker(){return L(this,(e,{skip:i,reject:s})=>{if(e instanceof t&&e!==this||e.localName!=="ui-disclosure")return s()})}};O(({css:t})=>t`ui-disclosure { display: block; }`);A("disclosure",Ut);A("disclosure-group",Yt);var z=class extends Z{groupOfType=k;boot({options:e}){e({multiple:!1}),this.state=this.options().multiple?new Set:null,this.onChanges=[]}onInitAndChange(e){e(),this.onChanges.push(e)}onChange(e){this.onChanges.push(e)}changed(e,i=!1){if(e.ungrouped)return;let s=e.value,o=e.isSelected(),n=this.options().multiple;o?n?this.state.add(s):this.state=s:n?this.state.delete(s):this.state=null,i||this.onChanges.forEach(r=>r(e))}deselectByValue(e,i=!1){this.options().multiple?this.state.delete(e):this.state=null,i||this.onChanges.forEach(s=>s())}getState(){return this.options().multiple?Array.from(this.state):this.state}hasValue(e){return this.options().multiple?this.state.has(e):this.state===e}setState(e){(e===null||e==="")&&(e=this.options().multiple?[]:""),this.options().multiple?(Array.isArray(e)||(e=[e]),e=e.map(s=>s+"")):e=e+"",this.state=this.options().multiple?new Set(e):e;let i=this.options().multiple?e:[e];this.walker().each(s=>{let o=s.use(k);if(o.ungrouped)return;let n=i.includes(o.value);n&&!o.isSelected()?o.surgicallySelect():!n&&o.isSelected()&&o.surgicallyDeselect()}),this.onChanges.forEach(s=>s())}selected(){return this.walker().find(e=>e.use(k).isSelected()).use(k)}selecteds(){return this.walker().filter(e=>e.use(k).isSelected()).map(e=>e.use(k))}selectFirst(){this.walker().first()?.use(k).select()}selectAll(){this.walker().filter(e=>!e.use(k).isSelected()).map(e=>e.use(k).select())}deselectAll(){this.walker().filter(e=>e.use(k).isSelected()).map(e=>e.use(k).deselect())}allAreSelected(){let e=this.walker().filter(i=>!0);return e.length>0&&this.walker().filter(i=>i.use(k).isSelected()).length===e.length}noneAreSelected(){return this.state===null||this.state?.size===0}selectableByValue(e){return this.walker().find(i=>i.use(k).value===e)?.use(k)}deselectOthers(e){this.walker().each(i=>{i!==e&&i.use(k).surgicallyDeselect()})}selectedTextValue(){return this.options().multiple?Array.from(this.state).map(e=>this.convertValueStringToElementText(e)).join(", "):this.convertValueStringToElementText(this.state)}convertValueStringToElementText(e){let i=this.findByValue(e);return i?i.label||i.value:e}findByValue(e){return this.selecteds().find(i=>i.value===e)}walker(){return L(this.el,(e,{skip:i,reject:s})=>{if(e[this.constructor.name]&&e!==this.el)return s();if(!e[this.groupOfType.name]||e.mixins.get(this.groupOfType.name).ungrouped)return i()})}},k=class extends S{boot({options:e}){this.groupedByType=z,e({ungrouped:!1,togglable:!1,value:void 0,label:void 0,selectedInitially:!1,dataAttr:"data-selected",ariaAttr:"aria-selected"}),this.ungrouped=this.options().ungrouped,this.value=this.options().value===void 0?this.el.value:this.options().value,this.value=this.value+"",this.label=this.options().label;let i=this.options().selectedInitially;this.onSelects=[],this.onUnselects=[],this.onChanges=[];let s=()=>{this.group()&&this.group().hasValue(this.value)&&(i=!0),this.multiple=this.hasGroup()?this.group().options().multiple:!1,this.toggleable=this.options().toggleable||this.multiple,i?this.select(!0):(this.state=i,this.surgicallyDeselect(!0))};s(),!this.hasGroup()&&!this.el.isConnected&&queueMicrotask(()=>{this.hasGroup()&&s()})}mount(){this.el.hasAttribute(this.options().ariaAttr)||h(this.el,this.options().ariaAttr,"false")}onInitAndChange(e){e(),this.onChanges.push(e)}onChange(e){this.onChanges.push(e)}onSelect(e){this.onSelects.push(e)}onUnselect(e){this.onUnselects.push(e)}setState(e){e?this.select():this.deselect()}getState(){return this.state}press(){this.toggleable?this.toggle():this.select()}trigger(){this.toggleable?this.toggle():this.select()}toggle(){this.isSelected()?this.deselect():this.select()}isSelected(){return this.state}select(e=!1){let i=!this.isSelected();this.toggleable||this.group()?.deselectOthers(this.el),this.state=!0,h(this.el,this.options().ariaAttr,"true"),h(this.el,this.options().dataAttr,""),i&&(e||(this.onSelects.forEach(s=>s()),this.onChanges.forEach(s=>s())),this.group()?.changed(this,e))}surgicallySelect(){let e=!this.isSelected();this.state=!0,h(this.el,this.options().ariaAttr,"true"),h(this.el,this.options().dataAttr,""),e&&(this.onSelects.forEach(i=>i()),this.onChanges.forEach(i=>i()))}deselect(e=!0){let i=this.isSelected();this.state=!1,h(this.el,this.options().ariaAttr,"false"),y(this.el,this.options().dataAttr),i&&(this.onUnselects.forEach(s=>s()),this.onChanges.forEach(s=>s()),e&&this.group()?.changed(this))}surgicallyDeselect(e=!1){let i=this.isSelected();this.state=!1,h(this.el,this.options().ariaAttr,"false"),y(this.el,this.options().dataAttr),i&&!e&&(this.onUnselects.forEach(s=>s()),this.onChanges.forEach(s=>s()))}getValue(){return this.value}getLabel(){return this.label}};var R=class extends S{boot({options:e}){e({disableWithParent:!0}),this.onChanges=[],Object.defineProperty(this.el,"disabled",{get:()=>this.el.hasAttribute("disabled"),set:s=>{s?this.el.setAttribute("disabled",""):this.el.removeAttribute("disabled")}}),this.el.hasAttribute("disabled")?this.el.disabled=!0:this.options().disableWithParent&&this.el.parentElement?.closest("[disabled]")&&(this.el.disabled=!0),new MutationObserver(s=>{this.onChanges.forEach(o=>o(this.el.disabled))}).observe(this.el,{attributeFilter:["disabled"]})}onChange(e){this.onChanges.push(e)}onInitAndChange(e){e(this.el.disabled),this.onChanges.push(e)}enabled(e){return(...i)=>{if(!this.el.disabled)return e(...i)}}disabled(e){return(...i)=>{if(this.el.disabled)return e(...i)}}isDisabled(){return this.el.disabled}};var Y=class extends S{boot({options:e}){e({name:void 0,value:void 0,includeWhenEmpty:!0,shouldUpdateValue:!0}),this.name=this.options().name,this.value=this.options().value===void 0?this.el.value:this.options().value,this.state=!1,this.observer=new MutationObserver(()=>{this.renderHiddenInputs()}),this.observer.observe(this.el,{childList:!0})}mount(){this.renderHiddenInputs()}update(e){this.options().shouldUpdateValue?this.value=e:this.state=!!e,this.renderHiddenInputs()}valueIsEmpty(){return this.value===void 0||this.value===null||this.value===""}renderHiddenInputs(){if(this.observer.disconnect(),!this.name)return;let e=this.el.children,i=[];for(let o=0;o<e.length;o++){let n=e[o];n.hasAttribute("data-flux-hidden")&&i.push(n)}i.forEach(o=>o.remove());let s;this.options().shouldUpdateValue?s=!this.valueIsEmpty()||this.options().includeWhenEmpty?this.generateInputs(this.name,this.value):[]:s=this.state||this.options().includeWhenEmpty?this.generateInputs(this.name,this.value):[],s.forEach(o=>{this.el.append(o)}),this.observer.observe(this.el,{childList:!0})}generateInputs(e,i,s=[]){if(this.isObjectOrArray(i))for(let o in i)s=s.concat(this.generateInputs(`${e}[${o}]`,i[o]));else{let o=document.createElement("input");return o.setAttribute("type","hidden"),o.setAttribute("name",e),o.setAttribute("value",i===null?"":""+i),o.setAttribute("data-flux-hidden",""),o.setAttribute("data-appended",""),[o]}return s}isObjectOrArray(e){return typeof e=="object"&&e!==null}};var Xt=class t extends W{boot(){this._disableable=new R(this);let e=[];this._disableable.onInitAndChange(i=>{i?this.walker().each(s=>{s.hasAttribute("disabled")||(s.setAttribute("disabled",""),e.push(()=>s.removeAttribute("disabled")))}):(e.forEach(s=>s()),e=[])}),this._selectable=new z(this,{multiple:!0}),this._controllable=new M(this,{disabled:this._disabled,bubbles:!0}),this.walker().each(i=>{i.addEventListener("input",s=>s.stopPropagation()),i.addEventListener("change",s=>s.stopPropagation())}),this._submittable=new Y(this,{name:this.getAttribute("name"),value:this.getAttribute("value"),includeWhenEmpty:!1}),this._controllable.initial(i=>i&&this._selectable.setState(i)),this._controllable.getter(()=>this._selectable.getState()),this._detangled=D(),this._controllable.setter(this._detangled(i=>{this._selectable.setState(i)})),this._selectable.onChange(this._detangled(()=>{this._controllable.dispatch()})),this._selectable.onInitAndChange(()=>{this._submittable.update(this._selectable.getState())}),h(this,"role","group"),queueMicrotask(()=>{this._submittable.update(this._selectable.getState())})}initCheckAll(e){let i=D();e._selectable.onChange(i(()=>{e.indeterminate?(this._selectable.selectAll(),e.checked=!0,e.indeterminate=!1):e.checked?(this._selectable.selectAll(),e.checked=!0,e.indeterminate=!1):(this._selectable.deselectAll(),e.checked=!1,e.indeterminate=!1)}));let s=()=>{this._selectable.allAreSelected()?(e.indeterminate=!1,e._selectable.select()):this._selectable.noneAreSelected()?(e.indeterminate=!1,e._selectable.deselect()):e.indeterminate=!0};this._selectable.onChange(i(()=>{s()})),s()}walker(){return L(this,(e,{skip:i,reject:s})=>{if(e instanceof t)return s();if(e.localName!=="ui-checkbox")return i()})}},Jt=class extends W{boot(){let e=this;this.isIndeterminate=!1,this._disableable=new R(this),this.hasAttribute("all")?(this._selectable=new k(e,{ungrouped:!0,toggleable:!0,value:this.hasAttribute("value")?this.getAttribute("value"):Math.random().toString(36).substring(2,10),label:this.hasAttribute("label")?this.getAttribute("label"):null,selectedInitially:this.hasAttribute("checked"),dataAttr:"data-checked",ariaAttr:"aria-checked"}),queueMicrotask(()=>{this.closest("ui-checkbox-group")?.initCheckAll(this)})):(this._selectable=new k(e,{toggleable:!0,dataAttr:"data-checked",ariaAttr:"aria-checked",value:this.hasAttribute("value")?this.getAttribute("value"):Math.random().toString(36).substring(2,10),label:this.hasAttribute("label")?this.getAttribute("label"):null,selectedInitially:this.hasAttribute("checked")}),this._submittable=new Y(this,{name:this.getAttribute("name"),value:this.getAttribute("value")??"on",includeWhenEmpty:!1,shouldUpdateValue:!1}),this._selectable.onChange(()=>{this.indeterminate&&(this.indeterminate=!1)}),this._selectable.onInitAndChange(()=>{this._submittable.update(this._selectable.isSelected())}),this.value=this._selectable.getValue(),queueMicrotask(()=>{this._submittable.update(this._selectable.isSelected())})),this._detangled=D(),this._selectable.onChange(this._detangled(()=>{this.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))})),h(e,"role","checkbox"),this._disableable.onInitAndChange(i=>{i?y(e,"tabindex","0"):h(e,"tabindex","0")}),b(e,"click",this._disableable.disabled(i=>{i.preventDefault(),i.stopPropagation()}),{capture:!0}),b(e,"click",this._disableable.enabled(i=>{this._selectable.press()})),b(e,"keydown",this._disableable.enabled(i=>{i.key==="Enter"&&this.closest("form")?.requestSubmit()})),b(e,"keydown",this._disableable.enabled(i=>{i.key===" "&&(i.preventDefault(),i.stopPropagation())})),b(e,"keyup",this._disableable.enabled(i=>{i.key===" "&&(this._selectable.press(),i.preventDefault(),i.stopPropagation())})),Eo(e)}get checked(){return this._selectable.isSelected()}set checked(e){let i=this.closest("ui-checkbox-group")?._detangled||(s=>s);this._detangled(i(()=>{e?this._selectable.select():this._selectable.deselect()}))()}get indeterminate(){return this.isIndeterminate}set indeterminate(e){this.isIndeterminate=!!e,this.isIndeterminate?h(this,"data-indeterminate",""):y(this,"data-indeterminate")}};A("checkbox-group",Xt);A("checkbox",Jt);O(({css:t})=>t`ui-checkbox-group { display: block; }`);O(({css:t})=>t`ui-checkbox { display: inline-block; user-select: none; }`);function Eo(t){t.closest("label")?.addEventListener("click",e=>{t.contains(e.target)||t._selectable.press()})}var ne=new Map,j=class extends S{boot({options:e}){e({triggers:[],scope:null});let i=this.options().scope||"global";h(this.el,"popover","manual"),this.triggers=this.options().triggers,this.onChanges=[],this.state=!1,b(this.el,"beforetoggle",s=>{let o=this.state;if(this.state=s.newState==="open",this.state){_o(this.el,i);let n=new AbortController,r=document.activeElement,c=[...this.triggers,r];setTimeout(()=>{So(this.el,c,n),ko(this.el,c,n),Co(this.el,c,n)}),this.el.addEventListener("beforetoggle",l=>{l.newState==="closed"&&(n.abort(),r?.focus())},{signal:n.signal})}o!==this.state&&this.onChanges.forEach(n=>n(this.state,o))}),b(this.el,"toggle",s=>{if(s.newState==="open")ne.has(i)||ne.set(i,new Set),ne.get(i).add(this.el);else if(s.newState==="closed"){if(!ne.has(i))return;ne.get(i).delete(this.el),ne.get(i).size===0&&ne.delete(i)}})}onChange(e){this.onChanges.push(e)}setState(e){e?this.show():this.hide()}getState(){return this.state}toggle(){this.el.togglePopover()}show(){this.el.showPopover()}hide(){this.el.hidePopover()}};function _o(t,e){ne.has(e)&&ne.get(e).forEach(i=>{t.contains(i)||i.contains(t)||i.hidePopover()})}function So(t,e,i){document.addEventListener("click",s=>{t.contains(s.target)||e.includes(s.target)||t.hidePopover()},{signal:i.signal})}function ko(t,e,i){document.addEventListener("focusin",s=>{t.contains(s.target)||e.includes(s.target)||(i.abort(),t.hidePopover())},{capture:!0,signal:i.signal})}function Co(t,e,i){document.addEventListener("keydown",s=>{s.key==="Escape"&&t.hidePopover()},{signal:i.signal})}var he=Math.min,B=Math.max,Xe=Math.round,Je=Math.floor,X=t=>({x:t,y:t}),To={left:"right",right:"left",bottom:"top",top:"bottom"},Oo={start:"end",end:"start"};function Qt(t,e,i){return B(t,he(e,i))}function Me(t,e){return typeof t=="function"?t(e):t}function re(t){return t.split("-")[0]}function Re(t){return t.split("-")[1]}function Zt(t){return t==="x"?"y":"x"}function ei(t){return t==="y"?"height":"width"}function de(t){return["top","bottom"].includes(re(t))?"y":"x"}function ti(t){return Zt(de(t))}function ls(t,e,i){i===void 0&&(i=!1);let s=Re(t),o=ti(t),n=ei(o),r=o==="x"?s===(i?"end":"start")?"right":"left":s==="start"?"bottom":"top";return e.reference[n]>e.floating[n]&&(r=Ye(r)),[r,Ye(r)]}function as(t){let e=Ye(t);return[kt(t),e,kt(e)]}function kt(t){return t.replace(/start|end/g,e=>Oo[e])}function Po(t,e,i){let s=["left","right"],o=["right","left"],n=["top","bottom"],r=["bottom","top"];switch(t){case"top":case"bottom":return i?e?o:s:e?s:o;case"left":case"right":return e?n:r;default:return[]}}function cs(t,e,i,s){let o=Re(t),n=Po(re(t),i==="start",s);return o&&(n=n.map(r=>r+"-"+o),e&&(n=n.concat(n.map(kt)))),n}function Ye(t){return t.replace(/left|right|bottom|top/g,e=>To[e])}function Lo(t){return{top:0,right:0,bottom:0,left:0,...t}}function us(t){return typeof t!="number"?Lo(t):{top:t,right:t,bottom:t,left:t}}function we(t){let{x:e,y:i,width:s,height:o}=t;return{width:s,height:o,top:i,left:e,right:e+s,bottom:i+o,x:e,y:i}}function hs(t,e,i){let{reference:s,floating:o}=t,n=de(e),r=ti(e),c=ei(r),l=re(e),a=n==="y",f=s.x+s.width/2-o.width/2,d=s.y+s.height/2-o.height/2,m=s[c]/2-o[c]/2,g;switch(l){case"top":g={x:f,y:s.y-o.height};break;case"bottom":g={x:f,y:s.y+s.height};break;case"right":g={x:s.x+s.width,y:d};break;case"left":g={x:s.x-o.width,y:d};break;default:g={x:s.x,y:s.y}}switch(Re(e)){case"start":g[r]-=m*(i&&a?-1:1);break;case"end":g[r]+=m*(i&&a?-1:1);break}return g}var ds=async(t,e,i)=>{let{placement:s="bottom",strategy:o="absolute",middleware:n=[],platform:r}=i,c=n.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(e)),a=await r.getElementRects({reference:t,floating:e,strategy:o}),{x:f,y:d}=hs(a,s,l),m=s,g={},u=0;for(let p=0;p<c.length;p++){let{name:v,fn:w}=c[p],{x:E,y:_,data:P,reset:T}=await w({x:f,y:d,initialPlacement:s,placement:m,strategy:o,middlewareData:g,rects:a,platform:r,elements:{reference:t,floating:e}});f=E??f,d=_??d,g={...g,[v]:{...g[v],...P}},T&&u<=50&&(u++,typeof T=="object"&&(T.placement&&(m=T.placement),T.rects&&(a=T.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:o}):T.rects),{x:f,y:d}=hs(a,m,l)),p=-1)}return{x:f,y:d,placement:m,strategy:o,middlewareData:g}};async function Ct(t,e){var i;e===void 0&&(e={});let{x:s,y:o,platform:n,rects:r,elements:c,strategy:l}=t,{boundary:a="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:m=!1,padding:g=0}=Me(e,t),u=us(g),v=c[m?d==="floating"?"reference":"floating":d],w=we(await n.getClippingRect({element:(i=await(n.isElement==null?void 0:n.isElement(v)))==null||i?v:v.contextElement||await(n.getDocumentElement==null?void 0:n.getDocumentElement(c.floating)),boundary:a,rootBoundary:f,strategy:l})),E=d==="floating"?{x:s,y:o,width:r.floating.width,height:r.floating.height}:r.reference,_=await(n.getOffsetParent==null?void 0:n.getOffsetParent(c.floating)),P=await(n.isElement==null?void 0:n.isElement(_))?await(n.getScale==null?void 0:n.getScale(_))||{x:1,y:1}:{x:1,y:1},T=we(n.convertOffsetParentRelativeRectToViewportRelativeRect?await n.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:E,offsetParent:_,strategy:l}):E);return{top:(w.top-T.top+u.top)/P.y,bottom:(T.bottom-w.bottom+u.bottom)/P.y,left:(w.left-T.left+u.left)/P.x,right:(T.right-w.right+u.right)/P.x}}var fs=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var i,s;let{placement:o,middlewareData:n,rects:r,initialPlacement:c,platform:l,elements:a}=e,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:u="none",flipAlignment:p=!0,...v}=Me(t,e);if((i=n.arrow)!=null&&i.alignmentOffset)return{};let w=re(o),E=de(c),_=re(c)===c,P=await(l.isRTL==null?void 0:l.isRTL(a.floating)),T=m||(_||!p?[Ye(c)]:as(c)),I=u!=="none";!m&&I&&T.push(...cs(c,p,u,P));let $=[c,...T],ee=await Ct(e,v),q=[],ae=((s=n.flip)==null?void 0:s.overflows)||[];if(f&&q.push(ee[w]),d){let fe=ls(o,r,P);q.push(ee[fe[0]],ee[fe[1]])}if(ae=[...ae,{placement:o,overflows:q}],!q.every(fe=>fe<=0)){var He,We;let fe=(((He=n.flip)==null?void 0:He.index)||0)+1,Ni=$[fe];if(Ni)return{data:{index:fe,overflows:ae},reset:{placement:Ni}};let Ve=(We=ae.filter(Se=>Se.overflows[0]<=0).sort((Se,ce)=>Se.overflows[1]-ce.overflows[1])[0])==null?void 0:We.placement;if(!Ve)switch(g){case"bestFit":{var Be;let Se=(Be=ae.filter(ce=>{if(I){let ue=de(ce.placement);return ue===E||ue==="y"}return!0}).map(ce=>[ce.placement,ce.overflows.filter(ue=>ue>0).reduce((ue,Bs)=>ue+Bs,0)]).sort((ce,ue)=>ce[1]-ue[1])[0])==null?void 0:Be[0];Se&&(Ve=Se);break}case"initialPlacement":Ve=c;break}if(o!==Ve)return{reset:{placement:Ve}}}return{}}}};async function Do(t,e){let{placement:i,platform:s,elements:o}=t,n=await(s.isRTL==null?void 0:s.isRTL(o.floating)),r=re(i),c=Re(i),l=de(i)==="y",a=["left","top"].includes(r)?-1:1,f=n&&l?-1:1,d=Me(e,t),{mainAxis:m,crossAxis:g,alignmentAxis:u}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return c&&typeof u=="number"&&(g=c==="end"?u*-1:u),l?{x:g*f,y:m*a}:{x:m*a,y:g*f}}var ps=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var i,s;let{x:o,y:n,placement:r,middlewareData:c}=e,l=await Do(e,t);return r===((i=c.offset)==null?void 0:i.placement)&&(s=c.arrow)!=null&&s.alignmentOffset?{}:{x:o+l.x,y:n+l.y,data:{...l,placement:r}}}}},bs=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:i,y:s,placement:o}=e,{mainAxis:n=!0,crossAxis:r=!1,limiter:c={fn:v=>{let{x:w,y:E}=v;return{x:w,y:E}}},...l}=Me(t,e),a={x:i,y:s},f=await Ct(e,l),d=de(re(o)),m=Zt(d),g=a[m],u=a[d];if(n){let v=m==="y"?"top":"left",w=m==="y"?"bottom":"right",E=g+f[v],_=g-f[w];g=Qt(E,g,_)}if(r){let v=d==="y"?"top":"left",w=d==="y"?"bottom":"right",E=u+f[v],_=u-f[w];u=Qt(E,u,_)}let p=c.fn({...e,[m]:g,[d]:u});return{...p,data:{x:p.x-i,y:p.y-s,enabled:{[m]:n,[d]:r}}}}}};var ms=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var i,s;let{placement:o,rects:n,platform:r,elements:c}=e,{apply:l=()=>{},...a}=Me(t,e),f=await Ct(e,a),d=re(o),m=Re(o),g=de(o)==="y",{width:u,height:p}=n.floating,v,w;d==="top"||d==="bottom"?(v=d,w=m===(await(r.isRTL==null?void 0:r.isRTL(c.floating))?"start":"end")?"left":"right"):(w=d,v=m==="end"?"top":"bottom");let E=p-f.top-f.bottom,_=u-f.left-f.right,P=he(p-f[v],E),T=he(u-f[w],_),I=!e.middlewareData.shift,$=P,ee=T;if((i=e.middlewareData.shift)!=null&&i.enabled.x&&(ee=_),(s=e.middlewareData.shift)!=null&&s.enabled.y&&($=E),I&&!m){let ae=B(f.left,0),He=B(f.right,0),We=B(f.top,0),Be=B(f.bottom,0);g?ee=u-2*(ae!==0||He!==0?ae+He:B(f.left,f.right)):$=p-2*(We!==0||Be!==0?We+Be:B(f.top,f.bottom))}await l({...e,availableWidth:ee,availableHeight:$});let q=await r.getDimensions(c.floating);return u!==q.width||p!==q.height?{reset:{rects:!0}}:{}}}};function Tt(){return typeof window<"u"}function ye(t){return vs(t)?(t.nodeName||"").toLowerCase():"#document"}function V(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function J(t){var e;return(e=(vs(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function vs(t){return Tt()?t instanceof Node||t instanceof V(t).Node:!1}function K(t){return Tt()?t instanceof Element||t instanceof V(t).Element:!1}function Q(t){return Tt()?t instanceof HTMLElement||t instanceof V(t).HTMLElement:!1}function gs(t){return!Tt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof V(t).ShadowRoot}function Ne(t){let{overflow:e,overflowX:i,overflowY:s,display:o}=G(t);return/auto|scroll|overlay|hidden|clip/.test(e+s+i)&&!["inline","contents"].includes(o)}function ws(t){return["table","td","th"].includes(ye(t))}function Qe(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function Ot(t){let e=Pt(),i=K(t)?G(t):t;return["transform","translate","scale","rotate","perspective"].some(s=>i[s]?i[s]!=="none":!1)||(i.containerType?i.containerType!=="normal":!1)||!e&&(i.backdropFilter?i.backdropFilter!=="none":!1)||!e&&(i.filter?i.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(s=>(i.willChange||"").includes(s))||["paint","layout","strict","content"].some(s=>(i.contain||"").includes(s))}function ys(t){let e=le(t);for(;Q(e)&&!Ae(e);){if(Ot(e))return e;if(Qe(e))return null;e=le(e)}return null}function Pt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ae(t){return["html","body","#document"].includes(ye(t))}function G(t){return V(t).getComputedStyle(t)}function Ze(t){return K(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function le(t){if(ye(t)==="html")return t;let e=t.assignedSlot||t.parentNode||gs(t)&&t.host||J(t);return gs(e)?e.host:e}function As(t){let e=le(t);return Ae(e)?t.ownerDocument?t.ownerDocument.body:t.body:Q(e)&&Ne(e)?e:As(e)}function Ie(t,e,i){var s;e===void 0&&(e=[]),i===void 0&&(i=!0);let o=As(t),n=o===((s=t.ownerDocument)==null?void 0:s.body),r=V(o);if(n){let c=Lt(r);return e.concat(r,r.visualViewport||[],Ne(o)?o:[],c&&i?Ie(c):[])}return e.concat(o,Ie(o,[],i))}function Lt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function _s(t){let e=G(t),i=parseFloat(e.width)||0,s=parseFloat(e.height)||0,o=Q(t),n=o?t.offsetWidth:i,r=o?t.offsetHeight:s,c=Xe(i)!==n||Xe(s)!==r;return c&&(i=n,s=r),{width:i,height:s,$:c}}function si(t){return K(t)?t:t.contextElement}function Fe(t){let e=si(t);if(!Q(e))return X(1);let i=e.getBoundingClientRect(),{width:s,height:o,$:n}=_s(e),r=(n?Xe(i.width):i.width)/s,c=(n?Xe(i.height):i.height)/o;return(!r||!Number.isFinite(r))&&(r=1),(!c||!Number.isFinite(c))&&(c=1),{x:r,y:c}}var Mo=X(0);function Ss(t){let e=V(t);return!Pt()||!e.visualViewport?Mo:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Ro(t,e,i){return e===void 0&&(e=!1),!i||e&&i!==V(t)?!1:e}function xe(t,e,i,s){e===void 0&&(e=!1),i===void 0&&(i=!1);let o=t.getBoundingClientRect(),n=si(t),r=X(1);e&&(s?K(s)&&(r=Fe(s)):r=Fe(t));let c=Ro(n,i,s)?Ss(n):X(0),l=(o.left+c.x)/r.x,a=(o.top+c.y)/r.y,f=o.width/r.x,d=o.height/r.y;if(n){let m=V(n),g=s&&K(s)?V(s):s,u=m,p=Lt(u);for(;p&&s&&g!==u;){let v=Fe(p),w=p.getBoundingClientRect(),E=G(p),_=w.left+(p.clientLeft+parseFloat(E.paddingLeft))*v.x,P=w.top+(p.clientTop+parseFloat(E.paddingTop))*v.y;l*=v.x,a*=v.y,f*=v.x,d*=v.y,l+=_,a+=P,u=V(p),p=Lt(u)}}return we({width:f,height:d,x:l,y:a})}function oi(t,e){let i=Ze(t).scrollLeft;return e?e.left+i:xe(J(t)).left+i}function ks(t,e,i){i===void 0&&(i=!1);let s=t.getBoundingClientRect(),o=s.left+e.scrollLeft-(i?0:oi(t,s)),n=s.top+e.scrollTop;return{x:o,y:n}}function Io(t){let{elements:e,rect:i,offsetParent:s,strategy:o}=t,n=o==="fixed",r=J(s),c=e?Qe(e.floating):!1;if(s===r||c&&n)return i;let l={scrollLeft:0,scrollTop:0},a=X(1),f=X(0),d=Q(s);if((d||!d&&!n)&&((ye(s)!=="body"||Ne(r))&&(l=Ze(s)),Q(s))){let g=xe(s);a=Fe(s),f.x=g.x+s.clientLeft,f.y=g.y+s.clientTop}let m=r&&!d&&!n?ks(r,l,!0):X(0);return{width:i.width*a.x,height:i.height*a.y,x:i.x*a.x-l.scrollLeft*a.x+f.x+m.x,y:i.y*a.y-l.scrollTop*a.y+f.y+m.y}}function No(t){return Array.from(t.getClientRects())}function Fo(t){let e=J(t),i=Ze(t),s=t.ownerDocument.body,o=B(e.scrollWidth,e.clientWidth,s.scrollWidth,s.clientWidth),n=B(e.scrollHeight,e.clientHeight,s.scrollHeight,s.clientHeight),r=-i.scrollLeft+oi(t),c=-i.scrollTop;return G(s).direction==="rtl"&&(r+=B(e.clientWidth,s.clientWidth)-o),{width:o,height:n,x:r,y:c}}function Ho(t,e){let i=V(t),s=J(t),o=i.visualViewport,n=s.clientWidth,r=s.clientHeight,c=0,l=0;if(o){n=o.width,r=o.height;let a=Pt();(!a||a&&e==="fixed")&&(c=o.offsetLeft,l=o.offsetTop)}return{width:n,height:r,x:c,y:l}}function Wo(t,e){let i=xe(t,!0,e==="fixed"),s=i.top+t.clientTop,o=i.left+t.clientLeft,n=Q(t)?Fe(t):X(1),r=t.clientWidth*n.x,c=t.clientHeight*n.y,l=o*n.x,a=s*n.y;return{width:r,height:c,x:l,y:a}}function xs(t,e,i){let s;if(e==="viewport")s=Ho(t,i);else if(e==="document")s=Fo(J(t));else if(K(e))s=Wo(e,i);else{let o=Ss(t);s={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return we(s)}function Cs(t,e){let i=le(t);return i===e||!K(i)||Ae(i)?!1:G(i).position==="fixed"||Cs(i,e)}function Bo(t,e){let i=e.get(t);if(i)return i;let s=Ie(t,[],!1).filter(c=>K(c)&&ye(c)!=="body"),o=null,n=G(t).position==="fixed",r=n?le(t):t;for(;K(r)&&!Ae(r);){let c=G(r),l=Ot(r);!l&&c.position==="fixed"&&(o=null),(n?!l&&!o:!l&&c.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Ne(r)&&!l&&Cs(t,r))?s=s.filter(f=>f!==r):o=c,r=le(r)}return e.set(t,s),s}function Vo(t){let{element:e,boundary:i,rootBoundary:s,strategy:o}=t,r=[...i==="clippingAncestors"?Qe(e)?[]:Bo(e,this._c):[].concat(i),s],c=r[0],l=r.reduce((a,f)=>{let d=xs(e,f,o);return a.top=B(d.top,a.top),a.right=he(d.right,a.right),a.bottom=he(d.bottom,a.bottom),a.left=B(d.left,a.left),a},xs(e,c,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function qo(t){let{width:e,height:i}=_s(t);return{width:e,height:i}}function $o(t,e,i){let s=Q(e),o=J(e),n=i==="fixed",r=xe(t,!0,n,e),c={scrollLeft:0,scrollTop:0},l=X(0);if(s||!s&&!n)if((ye(e)!=="body"||Ne(o))&&(c=Ze(e)),s){let m=xe(e,!0,n,e);l.x=m.x+e.clientLeft,l.y=m.y+e.clientTop}else o&&(l.x=oi(o));let a=o&&!s&&!n?ks(o,c):X(0),f=r.left+c.scrollLeft-l.x-a.x,d=r.top+c.scrollTop-l.y-a.y;return{x:f,y:d,width:r.width,height:r.height}}function ii(t){return G(t).position==="static"}function Es(t,e){if(!Q(t)||G(t).position==="fixed")return null;if(e)return e(t);let i=t.offsetParent;return J(t)===i&&(i=i.ownerDocument.body),i}function Ts(t,e){let i=V(t);if(Qe(t))return i;if(!Q(t)){let o=le(t);for(;o&&!Ae(o);){if(K(o)&&!ii(o))return o;o=le(o)}return i}let s=Es(t,e);for(;s&&ws(s)&&ii(s);)s=Es(s,e);return s&&Ae(s)&&ii(s)&&!Ot(s)?i:s||ys(t)||i}var zo=async function(t){let e=this.getOffsetParent||Ts,i=this.getDimensions,s=await i(t.floating);return{reference:$o(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function jo(t){return G(t).direction==="rtl"}var Ko={convertOffsetParentRelativeRectToViewportRelativeRect:Io,getDocumentElement:J,getClippingRect:Vo,getOffsetParent:Ts,getElementRects:zo,getClientRects:No,getDimensions:qo,getScale:Fe,isElement:K,isRTL:jo};function Os(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Go(t,e){let i=null,s,o=J(t);function n(){var c;clearTimeout(s),(c=i)==null||c.disconnect(),i=null}function r(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),n();let a=t.getBoundingClientRect(),{left:f,top:d,width:m,height:g}=a;if(c||e(),!m||!g)return;let u=Je(d),p=Je(o.clientWidth-(f+m)),v=Je(o.clientHeight-(d+g)),w=Je(f),_={rootMargin:-u+"px "+-p+"px "+-v+"px "+-w+"px",threshold:B(0,he(1,l))||1},P=!0;function T(I){let $=I[0].intersectionRatio;if($!==l){if(!P)return r();$?r(!1,$):s=setTimeout(()=>{r(!1,1e-7)},1e3)}$===1&&!Os(a,t.getBoundingClientRect())&&r(),P=!1}try{i=new IntersectionObserver(T,{..._,root:o.ownerDocument})}catch{i=new IntersectionObserver(T,_)}i.observe(t)}return r(!0),n}function Ps(t,e,i,s){s===void 0&&(s={});let{ancestorScroll:o=!0,ancestorResize:n=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=s,a=si(t),f=o||n?[...a?Ie(a):[],...Ie(e)]:[];f.forEach(w=>{o&&w.addEventListener("scroll",i,{passive:!0}),n&&w.addEventListener("resize",i)});let d=a&&c?Go(a,i):null,m=-1,g=null;r&&(g=new ResizeObserver(w=>{let[E]=w;E&&E.target===a&&g&&(g.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var _;(_=g)==null||_.observe(e)})),i()}),a&&!l&&g.observe(a),g.observe(e));let u,p=l?xe(t):null;l&&v();function v(){let w=xe(t);p&&!Os(p,w)&&i(),p=w,u=requestAnimationFrame(v)}return i(),()=>{var w;f.forEach(E=>{o&&E.removeEventListener("scroll",i),n&&E.removeEventListener("resize",i)}),d?.(),(w=g)==null||w.disconnect(),g=null,l&&cancelAnimationFrame(u)}}var Ls=ps;var Ds=bs,Ms=fs,Rs=ms;var Is=(t,e,i)=>{let s=new Map,o={platform:Ko,...i},n={...o.platform,_c:s};return ds(t,e,{...o,platform:n})};var U=class extends S{boot({options:e}){if(e({reference:null,auto:!0,position:"bottom start",gap:"5",offset:"0",matchWidth:!1,crossAxis:!1,scrollY:!0}),this.options().reference===null||this.options().position===null)return;let[i,s]=Xo(this.el,{scrollY:this.options().scrollY}),o=Uo(this.el,this.options().reference,i,{position:this.options().position,gap:this.options().gap,offset:this.options().offset,matchWidth:this.options().matchWidth,crossAxis:this.options().crossAxis,scrollY:this.options().scrollY}),n=()=>{};this.reposition=(...r)=>{this.options().auto?n=Ps(this.options().reference,this.el,o):o(null,...r)},this.cleanup=()=>{n(),s()}}};function Uo(t,e,i,{position:s,offset:o,gap:n,matchWidth:r,crossAxis:c,scrollY:l}){let a=window.getComputedStyle(t).maxHeight;return a=a==="none"?null:parseFloat(a),(f,d,m)=>{Is(e,t,{placement:Yo(s),middleware:[Ls({mainAxis:Number(n),alignmentAxis:Number(o)}),Ms(),Ds({padding:5,crossAxis:c}),Rs({padding:5,apply({rects:g,elements:u,availableHeight:p}){r&&Object.assign(u.floating.style,{width:`${g.reference.width}px`});let v=a;v===null&&(v=l?u.floating.scrollHeight:u.floating.offsetHeight),u.floating.style.maxHeight=p>v?"":`${p}px`}})]}).then(({x:g,y:u})=>{i(d||g,m||u)})}}function Yo(t){let e=t.split(" ");switch(e[0]){case"start":e[0]=Ge()?"right":"left";break;case"end":e[0]=Ge()?"left":"right";break}return e.join("-")}function Xo(t,{scrollY:e=!0}){let i=(r,c)=>{Object.assign(t.style,{position:"absolute",overflowY:e?"auto":"hidden",left:`${r}px`,top:`${c}px`,right:"auto",bottom:"auto"})},s,o,n=new MutationObserver(()=>i(s,o));return[(r,c)=>{s=r,o=c,n.disconnect(),i(s,o),n.observe(t,{attributeFilter:["style"]})},()=>{n.disconnect()}]}var ni=class extends x{boot(){let e=this.trigger(),i=this.overlay();if(e){if(!i)return console.warn("ui-dropdown: no [popover] overlay found",this)}else return console.warn("ui-dropdown: no trigger element found",this);if(this._disabled=this.hasAttribute("disabled"),this._controllable=new M(this),i._popoverable=new j(i),i._anchorable=new U(i,{reference:e,position:this.hasAttribute("position")?this.getAttribute("position"):void 0,gap:this.hasAttribute("gap")?this.getAttribute("gap"):void 0,offset:this.hasAttribute("offset")?this.getAttribute("offset"):void 0}),i._popoverable.onChange(()=>{i._popoverable.getState()?i._anchorable.reposition():i._anchorable.cleanup()}),!this.hasAttribute("hover")){let{lock:n,unlock:r}=oe(i._popoverable.el);i._popoverable.onChange(()=>{i._popoverable.getState()?n():r()})}this._controllable.initial(n=>i._popoverable.setState(n)),this._controllable.getter(()=>i._popoverable.getState());let s=D();if(this._controllable.setter(n=>i._popoverable.setState(n)),i._popoverable.onChange(s(()=>this._controllable.dispatch())),this.hasAttribute("hover")){let n=()=>{};De(e,i,{gain(){i._popoverable.setState(!0),n=b(document,"scroll",()=>{i._popoverable.getState()&&(i._popoverable.setState(!1),n())}).off},lose(){i._popoverable.setState(!1),n()},focusable:!1})}b(e,"click",()=>i._popoverable.toggle()),i._popoverable.getState()?(h(this,"data-open",""),h(e,"data-open",""),h(i,"data-open","")):(y(this,"data-open"),y(e,"data-open"),y(i,"data-open")),i._popoverable.onChange(()=>{i._popoverable.getState()?(h(this,"data-open",""),h(e,"data-open",""),h(i,"data-open","")):(y(this,"data-open"),y(e,"data-open"),y(i,"data-open"))});let o=H(i,"dropdown");h(e,"aria-haspopup","true"),h(e,"aria-controls",o),h(e,"aria-expanded",i._popoverable.getState()?"true":"false"),i._popoverable.onChange(()=>{h(e,"aria-expanded",i._popoverable.getState()?"true":"false")}),i._popoverable.onChange(()=>{setTimeout(()=>i._popoverable.getState()?i.onPopoverShow?.():i.onPopoverHide?.())})}unmount(){if(this.overlay()?._popoverable?.getState()&&!this.hasAttribute("hover")){let{unlock:e}=oe();e()}}trigger(){return this.querySelector("button, a")}overlay(){return this.lastElementChild?.matches("[popover]")&&this.lastElementChild}};A("dropdown",ni);var ri=class extends x{boot(){let e=this.hasAttribute("label")?"label":"description",i=this.button(),s=this.overlay();if(i){if(!s)return}else return console.warn("ui-tooltip: no trigger element found",this);s._popoverable=new j(s,{scope:"tooltip"}),s._anchorable=new U(s,{reference:i,position:this.hasAttribute("position")?this.getAttribute("position"):void 0,gap:this.hasAttribute("gap")?this.getAttribute("gap"):void 0,offset:this.hasAttribute("offset")?this.getAttribute("offset"):void 0}),s._popoverable.onChange(()=>{s._popoverable.getState()?s._anchorable.reposition():s._anchorable.cleanup()}),this._disableable=new R(this);let o;this._disableable.onInitAndChange(l=>{o&&(o(),o=null),l||(o=De(i,s,{gain(){s._popoverable.setState(!0)},lose(){s._popoverable.setState(!1)},focusable:!0,useSafeArea:!1}).remove)});let n=H(s,"tooltip"),r=this.hasAttribute("interactive"),c=this.hasAttribute("label")||i.textContent.trim()==="";r?(h(i,"aria-controls",n),h(i,"aria-expanded","false"),s._popoverable.onChange(()=>{s._popoverable.getState()?h(i,"aria-expanded","true"):h(i,"aria-expanded","false")})):(c?h(i,"aria-labelledby",n):h(i,"aria-describedby",n),h(s,"aria-hidden","true")),h(s,"role","tooltip")}button(){return this.firstElementChild}overlay(){return this.lastElementChild!==this.button()&&this.lastElementChild.tagName!=="TEMPLATE"&&this.lastElementChild}};A("tooltip",ri);var C={STATE_CHANGED:"stateChanged",DESKTOP_COLLAPSED:"desktopCollapsed",DESKTOP_EXPANDED:"desktopExpanded",MOBILE_COLLAPSED:"mobileCollapsed",MOBILE_EXPANDED:"mobileExpanded",VIEWPORT_ENTER_MOBILE:"viewportEnterMobile",VIEWPORT_ENTER_DESKTOP:"viewportEnterDesktop"},li=class extends x{boot(){if(this.config={breakpoint:this.hasAttribute("breakpoint")?this.getAttribute("breakpoint"):1024,collapsible:!1,persist:this.hasAttribute("persist")?!["false","none"].includes(this.getAttribute("persist")):!0,sticky:!!this.hasAttribute("sticky")},this.observable=new yt,this.state={active:!1,viewportDesktop:!0,viewportMobile:!1,collapsedMobile:!0,collapsedDesktop:!1},this.config.sticky&&this.setStickyPositionStyles(),this.hasAttribute("collapsible")){let e=this.getAttribute("collapsible");e==="true"?this.config.collapsible=!0:e==="false"?this.config.collapsible=!1:e==="mobile"&&(this.config.collapsible="mobile")}this.config.persist&&this.config.collapsible&&(this.state.collapsedDesktop=JSON.parse(localStorage.getItem("flux-sidebar-collapsed-desktop"))),this.removeAttribute("data-flux-sidebar-cloak"),this.observable.subscribe(C.VIEWPORT_ENTER_DESKTOP,()=>{this.state.viewportDesktop=!0,this.state.viewportMobile=!1,this.observable.notify(C.STATE_CHANGED)}),this.observable.subscribe(C.VIEWPORT_ENTER_MOBILE,()=>{this.state.viewportDesktop=!1,this.state.viewportMobile=!0,this.observable.notify(C.STATE_CHANGED)}),this.observable.subscribe(C.DESKTOP_COLLAPSED,()=>{this.state.collapsedDesktop=!0,this.observable.notify(C.STATE_CHANGED)}),this.observable.subscribe(C.DESKTOP_EXPANDED,()=>{this.state.collapsedDesktop=!1,this.observable.notify(C.STATE_CHANGED)}),this.observable.subscribe(C.MOBILE_COLLAPSED,()=>{this.state.collapsedMobile=!0,this.observable.notify(C.STATE_CHANGED)}),this.observable.subscribe(C.MOBILE_EXPANDED,()=>{this.state.collapsedMobile=!1,this.observable.notify(C.STATE_CHANGED)}),this.observable.subscribe(C.STATE_CHANGED,()=>{this.config.persist&&localStorage.setItem("flux-sidebar-collapsed-desktop",JSON.stringify(this.state.collapsedDesktop)),this.updateDataAttributes(this)}),new ai(this.observable,this.config),document.addEventListener("flux-sidebar-toggle",()=>{this.state.viewportDesktop?this.state.collapsedDesktop?this.observable.notify(C.DESKTOP_EXPANDED):this.observable.notify(C.DESKTOP_COLLAPSED):this.state.collapsedMobile?this.observable.notify(C.MOBILE_EXPANDED):this.observable.notify(C.MOBILE_COLLAPSED)}),this.addEventListener("click",e=>{e.target===this&&this.state.collapsedDesktop&&this.observable.notify(C.DESKTOP_EXPANDED)}),this.addEventListener("mouseenter",e=>{this.state.active=!0,this.observable.notify(C.STATE_CHANGED)}),this.addEventListener("mouseleave",e=>{this.state.active=!1,this.observable.notify(C.STATE_CHANGED)}),this.addEventListener("focusin",e=>{this.state.active=!0,this.observable.notify(C.STATE_CHANGED)}),this.addEventListener("focusout",e=>{this.state.active=!1,this.observable.notify(C.STATE_CHANGED)})}setStickyPositionStyles(){let e=this.offsetTop;this.style.position="sticky",this.style.top=e+"px",this.style.maxHeight=`calc(100dvh - ${e}px)`}updateDataAttributes(e){let i=this.config.collapsible===!0;i&&(this.state.active?h(e,"data-flux-sidebar-active",""):se(e,"data-flux-sidebar-active")),this.state.viewportDesktop?(se(e,"data-flux-sidebar-on-mobile"),h(e,"data-flux-sidebar-on-desktop",""),se(e,"data-flux-sidebar-collapsed-mobile"),this.state.collapsedDesktop?i&&h(e,"data-flux-sidebar-collapsed-desktop",""):se(e,"data-flux-sidebar-collapsed-desktop")):(se(e,"data-flux-sidebar-on-desktop"),h(e,"data-flux-sidebar-on-mobile",""),se(e,"data-flux-sidebar-collapsed-desktop"),this.state.collapsedMobile?h(e,"data-flux-sidebar-collapsed-mobile",""):se(e,"data-flux-sidebar-collapsed-mobile"))}},ai=class{constructor(e,{breakpoint:i}){this.observable=e,this.breakpoint=i,this.watchForViewportChanges()}watchForViewportChanges(){let e=typeof this.breakpoint=="number"?`${this.breakpoint}px`:this.breakpoint,i=matchMedia(`(min-width: ${e})`);i.matches?this.observable.notify(C.VIEWPORT_ENTER_DESKTOP):this.observable.notify(C.VIEWPORT_ENTER_MOBILE),i.addEventListener("change",()=>{i.matches?this.observable.notify(C.VIEWPORT_ENTER_DESKTOP):this.observable.notify(C.VIEWPORT_ENTER_MOBILE)})}},ci=class extends x{mount(){let e=this.querySelector("button");b(e||this,"click",()=>{this.dispatchEvent(new CustomEvent("flux-sidebar-toggle",{bubbles:!0}))}),queueMicrotask(()=>{let i=document.querySelector("ui-sidebar");i.updateDataAttributes(this),i.observable.subscribe(C.STATE_CHANGED,()=>{i.updateDataAttributes(this)})})}};A("sidebar",li);A("sidebar-toggle",ci);var Ee=class extends Z{groupOfType=N;boot({options:e}){e({wrap:!1,ensureTabbable:!0})}mount(){this.options().ensureTabbable&&this.ensureTabbable()}focusFirst(){let e;e=e||this.walker().find(i=>i.hasAttribute("autofocus")),e=e||this.walker().find(i=>i.getAttribute("tabindex")==="0"),e=e||this.walker().find(i=>i.getAttribute("tabindex")==="-1"),e=e||this.walker().find(i=>ss(i)),e?.focus()}focusPrev(){this.moveFocus(e=>this.options().wrap?this.walker().prevOrLast(e):this.walker().prev(e))}focusNext(){this.moveFocus(e=>this.options().wrap?this.walker().nextOrFirst(e):this.walker().next(e))}focusBySearch(e){let i=this.walker().find(s=>s.textContent.toLowerCase().trim().startsWith(e.toLowerCase()));i?.use(N).tabbable(),i?.use(N).focus()}moveFocus(e){let i=this.walker().find(o=>o.use(N).isTabbable());e(i)?.use(N).focus()}ensureTabbable(){this.walker().findOrFirst(e=>{e.use(N).isTabbable()})?.use(N).tabbable()}wipeTabbables(){this.walker().each(e=>{e.use(N).untabbable()})}untabbleOthers(e){this.walker().each(i=>{i!==e&&i.use(N).untabbable()})}walker(){return L(this.el,(e,{skip:i,reject:s})=>{if(e[this.constructor.name]&&e!==this.el)return s();if(!e[this.groupOfType.name])return i();if(e.hasAttribute("disabled"))return s()})}},N=class extends S{groupedByType=Ee;boot({options:e}){e({hover:!1,disableable:null,tabbable:!1,tabbableAttr:null})}mount(){let e=this.options().disableable;if(!e)throw"Focusable requires a Disableable instance...";this.el.hasAttribute("tabindex")||(this.options().tabbable?this.tabbable():this.untabbable()),this.pauseFocusListener=this.on("focus",e.enabled(()=>{this.focus(!1)})).pause,this.on("focus",e.enabled(()=>{ve()&&h(this.el,"data-focus","")})),this.on("blur",e.enabled(()=>{y(this.el,"data-focus")})),this.options().hover&&this.on("pointerenter",e.enabled(()=>{this.group()?.untabbleOthers(this.el),this.tabbable()})),this.options().hover&&this.on("pointerleave",e.enabled(i=>{this.untabbable()}))}focus(e=!0){this.group()?.untabbleOthers(this.el),this.tabbable(),e&&this.pauseFocusListener(()=>{this.el.focus({focusVisible:!1})})}tabbable(){h(this.el,"tabindex","0"),this.options().tabbableAttr&&h(this.el,this.options().tabbableAttr,"")}untabbable(){h(this.el,"tabindex","-1"),this.options().tabbableAttr&&y(this.el,this.options().tabbableAttr)}isTabbable(){return this.el.getAttribute("tabindex")==="0"}};var ui=class extends W{boot(){let e=this;this._disableable=new R(this),this._selectable=new k(e,{toggleable:!0,dataAttr:"data-checked",ariaAttr:"aria-checked",value:this.hasAttribute("value")?this.getAttribute("value"):null,label:this.hasAttribute("label")?this.getAttribute("label"):null,selectedInitially:this.hasAttribute("checked")}),this._submittable=new Y(this,{name:this.getAttribute("name"),value:this.getAttribute("value")??"on",includeWhenEmpty:!1,shouldUpdateValue:!1}),this.value=this._selectable.getValue(),this._detangled=D(),this._selectable.onChange(this._detangled(()=>{this.dispatchEvent(new Event("input",{bubbles:!1,cancelable:!0})),this.dispatchEvent(new Event("change",{bubbles:!1,cancelable:!0}))})),h(e,"role","switch"),this._selectable.onInitAndChange(()=>{this._submittable.update(this._selectable.getState())}),this._disableable.onInitAndChange(i=>{i?y(e,"tabindex","0"):h(e,"tabindex","0")}),b(e,"click",this._disableable.disabled(i=>{i.preventDefault(),i.stopPropagation()}),{capture:!0}),b(e,"click",this._disableable.enabled(i=>{this._selectable.press()})),b(e,"keydown",this._disableable.enabled(i=>{i.key==="Enter"&&(this._selectable.press(),i.preventDefault(),i.stopPropagation())})),b(e,"keydown",this._disableable.enabled(i=>{i.key===" "&&(i.preventDefault(),i.stopPropagation())})),b(e,"keyup",this._disableable.enabled(i=>{i.key===" "&&(this._selectable.press(),i.preventDefault(),i.stopPropagation())})),Jo(e)}get checked(){return this._selectable.isSelected()}set checked(e){this._detangled(()=>{e?this._selectable.select():this._selectable.deselect()})()}};function Jo(t){t.closest("label")?.addEventListener("click",e=>{t.contains(e.target)||t.click()})}O(({css:t})=>t`ui-switch { display: inline-block; user-select: none; }`);A("switch",ui);var hi=class extends x{mount(){let e=this.querySelector("button");b(e,"click",()=>{At(this,s=>!!s._closeable)?._closeable?.close()})}};A("close",hi);var di=class t extends x{mount(){this.control=this.fieldWalker().find(e=>this.isControl(e)),this.control}associateLabelWithControl(e){e&&this.label&&(this.control=e,!this.control.hasAttribute("aria-labelledby")&&(h(this.elOrButton(this.control),"aria-labelledby",this.label.id),this.control&&!(this.control instanceof W)&&this.hasAttribute("disabled")&&this.control.setAttribute("disabled","")))}associateDescriptionWithControl(e){e&&this.description&&(this.control=e,!this.control.hasAttribute("aria-describedby")&&h(this.elOrButton(this.control),"aria-describedby",this.description.id))}associateLabel(e){this.label=e,b(e,"click",i=>{["a","button"].includes(i.target.localName)||this.focusOrTogggle(this.control)}),this.control&&this.associateLabelWithControl(this.control)}associateDescription(e){this.description=e,this.control&&this.associateDescriptionWithControl(this.control)}fieldWalker(){return L(this,(e,{skip:i,reject:s})=>{if(e instanceof t&&e!==this||e.parentElement.localName==="ui-editor"&&e!==this)return s()})}isControl(e){return!!(e instanceof W||e.matches("input, textarea, select"))}focusOrTogggle(e){if(!e||e.disabled||e.hasAttribute("disabled"))return;e.localName==="input"&&["checkbox","radio"].includes(e.type)||["ui-switch","ui-radio","ui-checkbox"].includes(e.localName)?(e.click(),e.focus()):e.localName==="input"&&["file"].includes(e.type)?e.click():["ui-select","ui-date-picker","ui-time-picker"].includes(e.localName)?e.trigger()?.focus():(["ui-editor"].includes(e.localName),e.focus())}elOrButton(e){return e instanceof x&&e.firstElementChild instanceof HTMLButtonElement?e.firstElementChild:e}},fi=class extends x{mount(){H(this,"label"),h(this,"aria-hidden","true"),this.closest("ui-field")?.associateLabel(this)}},pi=class extends x{mount(){H(this,"description"),h(this,"aria-hidden","true"),this.closest("ui-field")?.associateDescription(this)}};O(({css:t})=>t`
ui-label { display: inline-block; cursor: default; }
ui-description { display: block; }
`);A("field",di);A("label",fi);A("description",pi);var bi=class t extends W{boot(){this._disableable=new R(this),this._disableable.onInitAndChange(e=>{this.walker().each(i=>{i.disabled=e})}),this._selectable=new z(this),this._controllable=new M(this,{disabled:this._disabled,bubbles:!0}),this._focusable=new Ee(this,{wrap:!0}),this._submittable=new Y(this,{name:this.getAttribute("name"),value:this._selectable.getState(),includeWhenEmpty:!1}),this._controllable.initial(e=>e&&this._selectable.setState(e)),this._controllable.getter(()=>this._selectable.getState()),this._detangled=D(),this._controllable.setter(this._detangled(e=>{this._selectable.setState(e)})),this._selectable.onChange(this._detangled(()=>{this._controllable.dispatch()})),this._selectable.onInitAndChange(()=>{this._submittable.update(this._selectable.getState())}),b(this,"keydown",e=>{["ArrowDown","ArrowRight"].includes(e.key)?(this._focusable.focusNext(),e.preventDefault(),e.stopPropagation()):["ArrowUp","ArrowLeft"].includes(e.key)&&(this._focusable.focusPrev(),e.preventDefault(),e.stopPropagation())}),h(this,"role","radiogroup"),queueMicrotask(()=>{this._submittable.update(this._selectable.getState())})}walker(){return L(this,(e,{skip:i,reject:s})=>{if(e instanceof t)return s();if(e.localName!=="ui-radio")return i()})}},mi=class extends W{boot(){let e=this;this._disableable=new R(this),this._selectable=new k(e,{value:this.hasAttribute("value")?this.getAttribute("value"):Math.random().toString(36).substring(2,10),label:this.hasAttribute("label")?this.getAttribute("label"):null,selectedInitially:this.hasAttribute("checked"),dataAttr:"data-checked",ariaAttr:"aria-checked"}),this.value=this._selectable.getValue(),this._selectable.onChange(()=>{this._selectable.isSelected()&&this._focusable.focus(!1)}),this._disableable.onChange(i=>{i?this._focusable.untabbable():this._selectable.isSelected()&&this._focusable.tabbable()}),h(e,"role","radio"),this._focusable=new N(e,{disableable:this._disableable,tabbableAttr:"data-active"}),b(e,"click",this._disableable.disabled(i=>{i.preventDefault(),i.stopPropagation()}),{capture:!0}),b(e,"click",this._disableable.enabled(i=>{this._selectable.press()})),b(e,"keydown",this._disableable.enabled(i=>{i.key==="Enter"&&this.closest("form")?.requestSubmit()})),b(e,"keydown",this._disableable.enabled(i=>{i.key===" "&&(i.preventDefault(),i.stopPropagation())})),b(e,"keyup",this._disableable.enabled(i=>{i.key===" "&&(this._selectable.press(),i.preventDefault(),i.stopPropagation())})),Qo(e),b(e,"focus",i=>{ve()&&this._selectable.select()})}get checked(){return this._selectable.isSelected()}set checked(e){(this.closest("ui-radio-group")?._detangled||(()=>{}))(()=>{e&&this._selectable.select()})()}};function Qo(t){t.closest("label")?.addEventListener("click",e=>{t.contains(e.target)||t.click()})}O(({css:t})=>t`ui-radio-group { display: block; }`);O(({css:t})=>t`ui-radio { display: inline-block; user-select: none; }`);A("radio-group",bi);A("radio",mi);var Dt=class extends x{boot(){if(this.querySelectorAll("[data-appended]").forEach(e=>e.remove()),!this.querySelector("template")){let e=document.createElement("template");e.setAttribute("name","placeholder"),e.innerHTML="<span>"+this.innerHTML+"</span>",this.innerHTML="",this.appendChild(e)}if(!this.querySelector('template[name="options"]')){let e=document.createElement("template");e.setAttribute("name","options"),e.innerHTML="<div><slot></slot></div>",this.appendChild(e)}if(!this.querySelector('template[name="option"]')){let e=document.createElement("template");e.setAttribute("name","option"),e.innerHTML="<div><slot></slot></div>",this.appendChild(e)}this.templates={placeholder:this.querySelector('template[name="placeholder"]'),overflow:this.querySelector('template[name="overflow"]'),options:this.querySelector('template[name="options"]'),option:this.querySelector('template[name="option"]')},this.templates.options.elsByValue=new Map,this.max=this.templates.overflow?.getAttribute("max")?this.templates.overflow.getAttribute("max"):1/0,this.selecteds=new Map,this.picker=this.closest("ui-select,ui-pillbox"),this.multiple=this.picker.hasAttribute("multiple")}mount(){queueMicrotask(()=>{this.picker._selectable.onInitAndChange(()=>{this.render(!0)});let e=this.picker.list();e&&new MutationObserver(i=>{queueMicrotask(()=>this.render())}).observe(e,{childList:!0})})}render(e){if(this.multiple){let i=this.picker.value,s=Array.from(this.selecteds.keys()).filter(r=>!i.includes(r)),o=i.filter(r=>!this.selecteds.has(r));s.forEach(r=>this.selecteds.delete(r));let n=new Map;for(let r of o){let c=this.picker._selectable.findByValue(r);if(!c){if(e)return setTimeout(()=>this.render());throw`Could not find option for value "${r}"`}n.set(r,c)}n.forEach((r,c)=>this.selecteds.set(c,r)),this.templates.placeholder?.clearPlaceholder?.(),this.templates.overflow?.clearOverflow?.(),this.templates.options?.clearOptions?.(),this.selecteds.size>0?this.renderOptions({hasOverflowed:r=>{if(this.max==="auto"){let c=!1;if(this.renderOverflow(this.selecteds.size,this.selecteds.size-r),this.clientWidth<this.scrollWidth&&(c=!0),this.templates.overflow?.clearOverflow?.(),c)return!0}return r>parseInt(this.max)},renderOverflow:r=>{this.templates?.overflow?.getAttribute("mode")!=="append"&&this.templates.options?.clearOptions?.(),this.renderOverflow(this.selecteds.size,r)}}):this.renderPlaceholder()}else{let i=this.picker.value;if(Array.from(this.selecteds.keys()).includes(i))return;this.selecteds.clear();let s=this.picker._selectable.findByValue(i);if(s)this.selecteds.set(i,s);else if(!["",null,void 0].includes(i)){if(e)return setTimeout(()=>{console.log("retrying..."),this.render()});throw`Could not find option for value "${i}"`}this.templates.placeholder?.clearPlaceholder?.(),this.templates.option?.clearOption?.(),this.selecteds.size>0?this.renderOption():this.renderPlaceholder()}}renderOptions({hasOverflowed:e,renderOverflow:i}){let s=document.createElement("div");s.style.display="contents";let o=et(this.templates.options,{default:s});this.templates.options.after(o),this.templates.options.clearOptions=()=>{o.remove(),this.templates.options.clearOptions=()=>{}};let n=0,r=!1;for(let[l,a]of this.selecteds){let f=new DocumentFragment;f.append(...a.el.cloneNode(!0).childNodes);let d=et(this.templates.option,{text:a.el.textContent.trim(),default:f,value:l});if(d.setAttribute("data-value",l),d.setAttribute("data-appended",""),d.deselect=()=>a.deselect(),s.appendChild(d),n++,e(n)){r=!0,s.removeChild(d),n--;break}}let c=new DocumentFragment;c.append(...s.childNodes),s.replaceWith(c),r&&i(this.selecteds.size-n)}renderOption(){for(let[e,i]of this.selecteds){let s=new DocumentFragment;s.append(...i.el.cloneNode(!0).childNodes);let o=et(this.templates.option,{text:i.el.textContent.trim(),default:s,value:e});o.setAttribute("data-value",e),o.setAttribute("data-appended",e),o.deselect=()=>i.deselect(),this.templates.option.after(o),this.templates.option.clearOption=()=>{o.remove(),this.templates.option.clearOption=()=>{}}}}renderPlaceholder(){if(!this.templates.placeholder)return;let e=et(this.templates.placeholder);e.setAttribute("data-appended",""),this.templates.placeholder.after(e),this.templates.placeholder.clearPlaceholder=()=>{e.remove(),this.templates.placeholder.clearPlaceholder=()=>{}}}renderOverflow(e,i){if(!this.templates.overflow)return;let s=et(this.templates.overflow,{remainder:i,count:this.selecteds.size});s.setAttribute("data-appended",""),this.templates.overflow.after(s),this.templates.overflow.clearOverflow=()=>{s.remove(),this.templates.placeholder.clearOverflow=()=>{}}}},Mt=class extends x{boot(){this.addEventListener("click",e=>{e.stopPropagation();let i=this.closest("[data-value]")?.getAttribute("data-value");if(i===void 0)return;let s=this.closest("ui-pillbox")._selectable,o=s.selectableByValue(i);o?o.deselect():s.deselectByValue(i)})}};function et(t,e={}){let i=t.content.cloneNode(!0);return Object.entries(e).forEach(([s,o])=>{(s==="default"?i.querySelectorAll("slot:not([name])"):i.querySelectorAll(`slot[name="${s}"]`)).forEach(r=>r.replaceWith(typeof o=="string"?document.createTextNode(o):o))}),i.firstElementChild}var tt=class extends Z{groupOfType=F;boot({options:e}){e({wrap:!1,filter:!1}),this.onChanges=[]}onChange(e){this.onChanges.push(e)}activated(e){this.onChanges.forEach(i=>i())}activateFirst(){this.filterAwareWalker().first()?.use(F).activate()}activateBySearch(e){this.filterAwareWalker().find(s=>s.textContent.toLowerCase().trim().startsWith(e.toLowerCase()))?.use(F).activate()}activateSelectedOrFirst(e){if(!e||(s=>s.matches("ui-option")?getComputedStyle(s).display==="none":!1)(e)){this.filterAwareWalker().first()?.use(F).activate();return}e?.use(F).activate()}activateActiveOrFirst(){let e=this.getActive();if(!e){this.filterAwareWalker().first()?.use(F).activate();return}e?.use(F).activate()}activateActiveOrLast(){let e=this.getActive();if(!e){this.filterAwareWalker().last()?.use(F).activate();return}e?.use(F).activate()}activatePrev(){let e=this.getActive();if(!e){this.filterAwareWalker().last()?.use(F).activate();return}let i;this.options.wrap?i=this.filterAwareWalker().prevOrLast(e):i=this.filterAwareWalker().prev(e),i?.use(F).activate()}activateNext(){let e=this.getActive();if(!e){this.filterAwareWalker().first()?.use(F).activate();return}let i;this.options.wrap?i=this.filterAwareWalker().nextOrFirst(e):i=this.filterAwareWalker().next(e),i?.use(F).activate()}getActive(){return this.walker().find(e=>e.use(F).isActive())}clearActive(){this.getActive()?.use(F).deactivate()}filterAwareWalker(){let e=i=>i.matches("ui-option")?getComputedStyle(i).display==="none":!1;return L(this.el,(i,{skip:s,reject:o})=>{if(i[this.constructor.name]&&i!==this.el)return o();if(!i[this.groupOfType.name])return s();if(i.hasAttribute("disabled")||e(i))return o()})}},F=class t extends S{groupedByType=tt;mount(){this.el.addEventListener("mouseenter",()=>{this.activate()}),this.el.addEventListener("mouseleave",()=>{this.deactivate()})}activate(){this.group()&&this.group().walker().each(e=>e.use(t).deactivate(!1)),!this.el.hasAttribute("disabled")&&(h(this.el,"data-active",""),ve()&&this.el.scrollIntoView({block:"nearest"}),this.group()&&this.group().activated(this.el))}deactivate(e=!0){y(this.el,"data-active"),e&&this.group()&&this.group().activated(this.el)}isActive(){return this.el.hasAttribute("data-active")}};var it=class extends Z{groupOfType=_e;boot({options:e}){e({}),this.onChanges=[],this.lastSearch=""}onChange(e){this.onChanges.push(e)}filter(e){e===""?this.walker().each(i=>{i.use(_e).unfilter()}):this.walker().each(i=>{this.matches(i,e)?i.use(_e).unfilter():i.use(_e).filter()}),this.lastSearch!==e&&this.onChanges.forEach(i=>i()),this.lastSearch=e}matches(e,i){return e.textContent.toLowerCase().trim().includes(i.toLowerCase().trim())}hasResults(){return this.walker().some(e=>!e.use(_e).isFiltered())}},_e=class extends S{groupedByType=it;boot({options:e}){e({mirror:null,keep:!1}),this.onChanges=[]}filter(){this.options().keep||(h(this.el,"data-hidden",""),this.options().mirror&&h(this.options().mirror,"data-hidden",""))}unfilter(){y(this.el,"data-hidden"),this.options().mirror&&y(this.options().mirror,"data-hidden","")}isFiltered(){return this.el.hasAttribute("data-hidden")}};var nt=class extends W{boot(){let e=this.list();this._controllable=new M(this,{bubbles:!0}),this._selectable=new z(e,{multiple:this.hasAttribute("multiple")}),this._submittable=new Y(this,{name:this.getAttribute("name"),value:this._selectable.getState()}),this._controllable.initial(s=>s&&this._selectable.setState(s)),this._controllable.getter(()=>this._selectable.getState());let i=D();this._controllable.setter(i(s=>{this._selectable.setState(s)})),this._selectable.onChange(i(()=>{this._controllable.dispatch(),this.dispatchEvent(new CustomEvent("select",{bubbles:!1}))})),this._selectable.onInitAndChange(()=>{this._submittable.update(this._selectable.getState())}),queueMicrotask(()=>{this._submittable.update(this._selectable.getState())})}mount(){this._disableable=new R(this);let e=this.input(),i=this.button(),s=this.list(),o=this.hasAttribute("multiple"),n=this.hasAttribute("autocomplete"),r=this.hasAttribute("autocomplete")&&this.getAttribute("autocomplete").trim().split(" ").includes("strict"),c=this.querySelector("ui-options")||this,l=Zo(c,"options",o);this._activatable=new tt(c,{filter:"data-hidden"}),!e&&!i&&this._disableable.onInitAndChange(u=>{u?this.removeAttribute("tabindex"):this.setAttribute("tabindex","0")}),this.hasAttribute("filter")&&this.getAttribute("filter")!=="manual"&&(this._filterable=new it(s),this._filterable.onChange(()=>{this._activatable.clearActive(),this._filterable.hasResults()&&this._activatable.activateFirst()}),this.addEventListener("close",()=>{this._filterable&&this._filterable.filter("")}));let a=this.querySelector("[popover]:not(ui-tooltip > [popover])"),f=a?.querySelector('input:not([type="hidden"])'),d=this.querySelector('input:not([type="hidden"])');d=a?.contains(d)?null:d;let m=this.querySelector("button");if(m=a?.contains(m)?null:m,!(a||d))st(this,this._activatable),ot(this,this,this._activatable),Fs(this,this._activatable,this._selectable);else if(!a&&d){let u=d;this._disableable.onInitAndChange(p=>{p?u&&h(u,"disabled",""):u&&y(u,"disabled")}),_i(this,u,this._selectable,this._popoverable),Fs(u,this._activatable,this._selectable),Ws(n,r,this,u,this._selectable,this._popoverable),Ei(u),xi(u),this._filterable&&Ai(u,this._filterable),ki(u,this._activatable,this._selectable),st(u,this._activatable),ot(this,u,this._activatable),Rt(this,this._activatable)}else if(a&&d){let u=d;h(u,"role","combobox"),h(u,"aria-controls",l);let p=a;this._popoverable=new j(p),this._anchorable=new U(p,{reference:u,matchWidth:!0,position:this.hasAttribute("position")?this.getAttribute("position"):void 0,gap:this.hasAttribute("gap")?this.getAttribute("gap"):void 0,offset:this.hasAttribute("offset")?this.getAttribute("offset"):void 0}),Ws(n,r,this,u,this._selectable,this._popoverable),this._disableable.onInitAndChange(v=>{v?u&&h(u,"disabled",""):u&&y(u,"disabled")}),this.querySelectorAll("button").forEach(v=>{p.contains(v)||(h(v,"tabindex","-1"),h(v,"aria-controls",l),h(v,"aria-haspopup","listbox"),It(v,this._popoverable),b(v,"click",()=>{this._popoverable.toggle(),u.focus()}))}),_i(this,u,this._selectable,this._popoverable),gi(this,u,p,this._popoverable,this._anchorable),Ci(this,this._popoverable,[u]),It(u,this._popoverable),Ei(u),xi(u),this._filterable&&Ai(u,this._filterable),ki(u,this._activatable,this._selectable),sn(u,this._popoverable),yi(u,this._popoverable,this._activatable,this._selectable),en(u,this._popoverable),wi(this,this._popoverable),st(u,this._activatable),ot(this,u,this._activatable),Rt(this,this._activatable),vi(this._popoverable,this._activatable,this._selectable),Si(this,this._selectable,this._popoverable,o)}else if(a&&f){let u=m,p=f,v=a;h(u,"role","combobox"),h(p,"role","combobox"),h(u,"aria-controls",l),this._disableable.onInitAndChange(w=>{w?(u&&h(u,"disabled",""),p&&h(p,"disabled","")):(u&&y(u,"disabled"),p&&y(p,"disabled"))}),this._popoverable=new j(v),this._anchorable=new U(v,{reference:u,matchWidth:!0,position:this.hasAttribute("position")?this.getAttribute("position"):void 0,gap:this.hasAttribute("gap")?this.getAttribute("gap"):void 0,offset:this.hasAttribute("offset")?this.getAttribute("offset"):void 0,scrollY:!1}),Ei(p),xi(p),this._filterable&&Ai(p,this._filterable),tn(p,this._popoverable),gi(this,u,v,this._popoverable,this._anchorable),Ci(this,this._popoverable,[p]),It(u,this._popoverable),_i(this,p,this._selectable,this._popoverable),yi(u,this._popoverable,this._activatable,this._selectable),Hs(u,this._popoverable),wi(this,this._popoverable),st(p,this._activatable),Ns(u,this._activatable,this._popoverable),ot(this,p,this._activatable),Rt(this,this._activatable),vi(this._popoverable,this._activatable,this._selectable),Si(this,this._selectable,this._popoverable,o)}else if(a){let u=m,p=a;h(u,"role","combobox"),h(u,"aria-controls",l),this._disableable.onInitAndChange(v=>{v?(u&&h(u,"disabled",""),e&&h(e,"disabled","")):(u&&y(u,"disabled"),e&&y(e,"disabled"))}),this._popoverable=new j(p),this._anchorable=new U(p,{reference:u,matchWidth:!0,position:this.hasAttribute("position")?this.getAttribute("position"):void 0,gap:this.hasAttribute("gap")?this.getAttribute("gap"):void 0,offset:this.hasAttribute("offset")?this.getAttribute("offset"):void 0}),gi(this,u,p,this._popoverable,this._anchorable),Ci(this,this._popoverable),It(u,this._popoverable),yi(u,this._popoverable,this._activatable,this._selectable),Hs(u,this._popoverable),ki(u,this._activatable,this._selectable),wi(this,this._popoverable),st(u,this._activatable),Ns(u,this._activatable,this._popoverable),ot(this,u,this._activatable),Rt(this,this._activatable),vi(this._popoverable,this._activatable,this._selectable),Si(this,this._selectable,this._popoverable,o)}new MutationObserver(()=>{setTimeout(()=>{if(!this._popoverable||this._popoverable.getState()){let u=this._selectable.selecteds().find(p=>!p.el._disableable.isDisabled())?.el;setTimeout(()=>{this._activatable.activateSelectedOrFirst(u)})}else this._activatable.clearActive()})}).observe(s,{childList:!0})}unmount(){if(this._popoverable?.getState()){let{unlock:e}=oe();e()}}trigger(){return this.button()||this.input()}button(){return Array.from(this.querySelectorAll("button")).find(e=>e.nextElementSibling?.matches("[popover]"))||null}input(){return this.querySelector('input:not([type="hidden"])')}list(){return this.querySelector("ui-options")||this}clear(){this.input()&&(this.input().value="",this.input().dispatchEvent(new Event("input",{bubbles:!1})))}open(){this._popoverable.setState(!0)}close(){this._popoverable.setState(!1)}deselectLast(){!this.hasAttribute("multiple")&&this.value!==null&&(this.value=null,this.dispatchEvent(new Event("input",{bubbles:!1})),this.dispatchEvent(new Event("change",{bubbles:!1}))),this.hasAttribute("multiple")&&this.value.length!==0&&(this.value=this.value.slice(0,-1),this.dispatchEvent(new Event("input",{bubbles:!1})),this.dispatchEvent(new Event("change",{bubbles:!1})))}},Ti=class extends x{boot(){h(this,"data-hidden","")}mount(){queueMicrotask(()=>{let e=this.closest("ui-autocomplete, ui-combobox, ui-select, ui-pillbox"),i=this.closest("ui-options");if(!i)return;let s=c=>c.hasAttribute("data-hidden"),o=()=>{let c;CSS.supports("selector(&)")?c=Array.from(i.querySelectorAll("& > ui-option")).filter(l=>!s(l)).length===0:c=Array.from(i.querySelectorAll(":scope > ui-option")).filter(l=>!s(l)).length===0,c?y(this,"data-hidden"):h(this,"data-hidden","")};o();let n=e._filterable;n&&n.onChange(o),new MutationObserver(c=>{setTimeout(()=>o())}).observe(i,{childList:!0})})}};A("selected-remove",Mt);A("selected",Dt);A("select",nt);A("empty",Ti);O(({css:t})=>t`ui-select { display: block; }`);O(({css:t})=>t`ui-selected-option { display: contents; }`);O(({css:t})=>t`ui-empty { display: block; cursor: default; }`);function st(t,e){b(t,"keydown",i=>{["ArrowDown","ArrowUp"].includes(i.key)&&(i.key==="ArrowDown"?(e.activateNext(),i.preventDefault(),i.stopPropagation()):i.key==="ArrowUp"&&(e.activatePrev(),i.preventDefault(),i.stopPropagation()))})}function Ns(t,e,i){xt(t,s=>{e.activateBySearch(s),i.getState()||e.getActive()?.click()})}function ot(t,e,i){b(e,"keydown",s=>{if(s.key==="Enter"){let o=i.getActive();if(s.preventDefault(),s.stopPropagation(),!o)return;o.click(),t.dispatchEvent(new CustomEvent("action",{bubbles:!1,cancelable:!1}))}})}function Rt(t,e,i=!1){b(t,i?"pointerdown":"click",s=>{if(s.target.closest("ui-option")){let o=s.target.closest("ui-option");if(o._disableable.isDisabled())return;o._selectable?.trigger(),t.dispatchEvent(new CustomEvent("action",{bubbles:!1,cancelable:!1})),s.preventDefault(),s.stopPropagation()}})}function Fs(t,e,i){b(t,"focus",()=>{let s=i.selecteds().find(o=>!o.el._disableable.isDisabled())?.el;e.activateSelectedOrFirst(s)}),b(t,"blur",()=>{e.clearActive()})}function Zo(t,e){let i=H(t,"options");return h(t,"role","listbox"),h(t,"aria-multiselectable",e?"true":"false"),i}function It(t,e){h(t,"aria-haspopup","listbox");let i=()=>{h(t,"aria-expanded",e.getState()?"true":"false"),e.getState()?h(t,"data-open",""):y(t,"data-open","")};e.onChange(()=>{i()}),i()}function gi(t,e,i,s,o){let n=()=>{Array.from([t,i]).forEach(r=>{s.getState()?h(r,"data-open",""):y(r,"data-open","")}),s.getState()?o.reposition():o.cleanup()};s.onChange(()=>n()),n(),s.onChange(()=>{s.getState()?t.dispatchEvent(new Event("open",{bubbles:!1,cancelable:!1})):t.dispatchEvent(new Event("close",{bubbles:!1,cancelable:!1}))})}function vi(t,e,i){t.onChange(()=>{if(t.getState()){let s=i.selecteds().find(o=>!o.el._disableable.isDisabled())?.el;setTimeout(()=>{e.activateSelectedOrFirst(s)})}else e.clearActive()})}function wi(t,e){b(t,"keydown",i=>{i.key==="Escape"&&e.getState()&&(e.setState(!1),i.preventDefault(),i.stopImmediatePropagation())})}function yi(t,e){b(t,"keydown",i=>{["ArrowDown","ArrowUp"].includes(i.key)&&(i.key==="ArrowDown"||i.key==="ArrowUp")&&(e.getState()||(e.setState(!0),i.preventDefault(),i.stopImmediatePropagation()))})}function en(t,e){b(t,"click",()=>{e.getState()||(e.setState(!0),t.focus())})}function Hs(t,e){b(t,"click",()=>{e.setState(!e.getState()),t.focus()})}function tn(t,e){e.onChange(()=>{e.getState()&&setTimeout(()=>t.focus())})}function Ai(t,e){e&&b(t,"input",i=>{e.filter(i.target.value)})}function xi(t){b(t,"focus",()=>t.select())}function Ei(t){b(t,"change",e=>e.stopPropagation()),b(t,"input",e=>e.stopPropagation())}function sn(t,e){b(t,"keydown",i=>{(/^[a-zA-Z0-9]$/.test(i.key)||i.key==="Backspace")&&(e.getState()||e.setState(!0))})}function _i(t,e,i,s){if(!t.hasAttribute("clear"))return;let n=d=>{e.value!==d&&(e.value=d,e.dispatchEvent(new Event("input",{bubbles:!1})))},r=t.getAttribute("clear"),c=r===""||r.split(" ").includes("action"),l=r===""||r.split(" ").includes("select"),a=r===""||r.split(" ").includes("close"),f=r===""||r.split(" ").includes("esc");r==="none"&&(c=l=a=f=!1),c?t.addEventListener("action",d=>{n("")}):l&&i.onChange(()=>{queueMicrotask(()=>n(""))}),a&&s.onChange(()=>{s.getState()||n("")}),f&&b(e,"keydown",d=>{d.key==="Escape"&&n("")})}function Si(t,e,i,s){let o=!s,n=!s;if(t.hasAttribute("close")){let r=t.getAttribute("close");o=r===""||r.split(" ").includes("action"),n=r.split(" ").includes("select"),r==="none"&&(o=n=!1)}o?t.addEventListener("action",r=>{i.setState(!1)}):n&&e.onChange(()=>{i.setState(!1)})}function ki(t,e,i){e.onChange(()=>{let s=e.getActive();s?h(t,"aria-activedescendant",s.id):y(t,"aria-activedescendant")}),i.onChange(s=>{if(!s)return;let o=s.el;o&&h(t,"aria-activedescendant",o.id)})}function Ws(t,e,i,s,o,n){if(!t){h(s,"autocomplete","off"),h(s,"aria-autocomplete","none");return}let r=c=>{s.value=c,s.dispatchEvent(new Event("input",{bubbles:!1}))};h(s,"autocomplete","off"),h(s,"aria-autocomplete","list"),s.value!==""&&o.setState(s.value),queueMicrotask(()=>{o.onInitAndChange(()=>{s.value=o.selectedTextValue()})}),i.addEventListener("action",c=>{r(o.selectedTextValue())}),e&&n.onChange(()=>{n.getState()||r(o.selectedTextValue())})}function Ci(t,e,i=[]){let{lock:s,unlock:o}=oe(e.el,!1,i);e.onChange(()=>{e.getState()?s():o()})}var Oi=class t extends x{boot(){if(this._focusable=new Ee(this,{wrap:!1,ensureTabbable:!1}),b(this,"keydown",e=>{["ArrowDown"].includes(e.key)?(e.target===this?this._focusable.focusFirst():this._focusable.focusNext(),e.preventDefault(),e.stopPropagation()):["ArrowUp"].includes(e.key)&&(e.target===this?this._focusable.focusFirst():this._focusable.focusPrev(),e.preventDefault(),e.stopPropagation())}),xt(this,e=>this._focusable.focusBySearch(e)),this.hasAttribute("popover")&&this.addEventListener("lofi-close-popovers",()=>{this.hasAttribute("keep-open")||setTimeout(()=>this.hidePopover(),50)}),this.parentElement.localName==="ui-dropdown"){let e=this.parentElement;b(e.trigger(),"keydown",i=>{i.key==="ArrowDown"&&(this.fromArrowDown=!0,this.showPopover(),i.preventDefault(),i.stopPropagation())})}h(this,"role","menu"),h(this,"tabindex","-1")}mount(){this.initializeMenuItems(),new MutationObserver(i=>{this.initializeMenuItems()}).observe(this,{childList:!0,subtree:!0})}onPopoverShow(){queueMicrotask(()=>{this.fromArrowDown?(this._focusable.focusFirst(),this.fromArrowDown=!1):this.focus()})}onPopoverHide(){this._focusable.wipeTabbables()}initializeMenuItems(){this.walker().each(e=>{e._disableable||on(e)})}walker(){return L(this,(e,{skip:i,reject:s})=>{if(e instanceof t||e instanceof nt)return s();if(!["a","button"].includes(e.localName))return i()})}},Pi=class extends x{boot(){}},Li=class extends x{boot(){this._disabled=this.hasAttribute("disabled"),this._disableable=new R(this);let e=this;if(this._disabled&&(h(e,"disabled",""),h(e,"aria-disabled","true")),H(e,"menu-checkbox"),h(e,"role","menuitemcheckbox"),this._disabled)return;e._focusable=new N(e,{disableable:this._disableable,hover:!0,tabbableAttr:"data-active"}),e._selectable=new k(e,{toggleable:!0,value:this.hasAttribute("value")?this.getAttribute("value"):e.textContent.trim(),label:this.hasAttribute("label")?this.getAttribute("label"):e.textContent.trim(),dataAttr:"data-checked",ariaAttr:"aria-checked",selectedInitially:this.hasAttribute("checked")}),this._controllable=new M(this),this._controllable.initial(s=>s&&e._selectable.setState(s)),this._controllable.getter(()=>e._selectable.getState());let i=D();this._controllable.setter(i(s=>{this._selectable.setState(s)})),this._selectable.onChange(i(()=>{this._controllable.dispatch()})),b(e,"click",()=>{this.hasAttribute("keep-open")||this.dispatchEvent(new CustomEvent("lofi-close-popovers",{bubbles:!0})),e._selectable.press()}),Ii(e)}},Di=class extends x{boot(){this._disabled=this.hasAttribute("disabled"),this._disableable=new R(this);let e=this;this._disabled&&(h(e,"disabled",""),h(e,"aria-disabled","true")),H(e,"menu-radio"),h(e,"role","menuitemradio"),!this._disabled&&(e._focusable=new N(e,{disableable:this._disableable,hover:!0,tabbableAttr:"data-active"}),e._selectable=new k(e,{toggleable:!1,value:this.hasAttribute("value")?this.getAttribute("value"):e.textContent.trim(),label:this.hasAttribute("label")?this.getAttribute("label"):e.textContent.trim(),dataAttr:"data-checked",ariaAttr:"aria-checked",selectedInitially:this.hasAttribute("checked")}),b(e,"click",()=>{this.hasAttribute("keep-open")||this.dispatchEvent(new CustomEvent("lofi-close-popovers",{bubbles:!0})),e._selectable.press()}),Ii(e))}},Mi=class extends x{boot(){this._selectable=new z(this),this._controllable=new M(this),h(this,"role","group"),this._controllable.initial(i=>i&&this._selectable.setState(i)),this._controllable.getter(()=>this._selectable.getState());let e=D();this._controllable.setter(e(i=>{this._selectable.setState(i)})),this._selectable.onChange(e(()=>{this._controllable.dispatch()})),b(this,"lofi-close-popovers",i=>{this.hasAttribute("keep-open")&&(i.preventDefault(),i.stopPropagation())})}},Ri=class extends x{boot(){this._selectable=new z(this,{multiple:!0}),this._controllable=new M(this),h(this,"role","group"),this._controllable.initial(i=>i&&this._selectable.setState(i)),this._controllable.getter(()=>this._selectable.getState());let e=D();this._controllable.setter(e(i=>{this._selectable.setState(i)})),this._selectable.onChange(e(()=>{this._controllable.dispatch()}))}};O(({css:t})=>t`ui-menu[popover]:popover-open { display: block; }`);O(({css:t})=>t`ui-menu[popover].\:popover-open { display: block; }`);O(({css:t})=>t`ui-menu-checkbox, ui-menu-radio { cursor: default; display: contents; }`);A("menu",Oi);A("submenu",Pi);A("menu-checkbox",Li);A("menu-radio",Di);A("menu-radio-group",Mi);A("menu-checkbox-group",Ri);function Ii(t){b(t,"keydown",e=>{e.key==="Enter"&&(t.click(),e.preventDefault(),e.stopPropagation())}),b(t,"keydown",e=>{e.key===" "&&(e.preventDefault(),e.stopPropagation())}),b(t,"keyup",e=>{e.key===" "&&(t.click(),e.preventDefault(),e.stopPropagation())})}function on(t){t._disableable=new R(t),t._disabled=t.hasAttribute("disabled");let e=t.querySelector("a"),i=t,s=t.parentElement.matches("ui-submenu")&&t.parentElement.querySelector("ui-menu[popover]"),o=e||i;if(t._disabled&&(h(o,"disabled",""),h(o,"aria-disabled","true")),H(o,"menu-item"),h(o,"role","menuitem"),!t._disabled)if(o._focusable=new N(o,{disableable:t._disableable,hover:!0,tabbableAttr:"data-active"}),!s)t.hasAttribute("disabled")||b(t,"click",()=>{t.hasAttribute("keep-open")||t.dispatchEvent(new CustomEvent("lofi-close-popovers",{bubbles:!0}))}),Ii(i);else{s._popoverable=new j(s,{triggers:[i]}),s._anchorable=new U(s,{reference:i,position:s.hasAttribute("position")?s.getAttribute("position"):Ge()?"left start":"right start",gap:s.hasAttribute("gap")?s.getAttribute("gap"):"-5",crossAxis:!0}),i.addEventListener("click",r=>{s._popoverable.setState(!0)});let{clear:n}=De(i,s,{gain(){s._popoverable.setState(!0)},lose(){s._popoverable.setState(!1)},focusable:!1,useSafeArea:!0});s._popoverable.onChange(()=>{s._popoverable.getState()||(n(),s._focusable.wipeTabbables()),s._popoverable.getState()?s._anchorable.reposition():s._anchorable.cleanup()}),b(i,"keydown",r=>{r.key==="Enter"&&(s._popoverable.setState(!0),setTimeout(()=>s._focusable.focusFirst()))}),b(i,"keydown",r=>{r.key==="ArrowRight"&&(s._popoverable.setState(!0),setTimeout(()=>s._focusable.focusFirst()))}),b(s,"keydown",r=>{r.key==="ArrowLeft"&&(s._popoverable.setState(!1),i.focus(),r.stopPropagation())})}}document.addEventListener("alpine:init",()=>{let t=window.Flux?.applyAppearance;t||(t=()=>{window.Flux.appearance=null,window.localStorage.removeItem("flux.appearance")});let e=Alpine.reactive({toast(...s){let o={slots:{},dataset:{}};typeof s[0]=="string"&&(o.slots.text=s.shift()),typeof s[0]=="string"&&(o.slots.heading=o.slots.text,o.slots.text=s.shift());let n=s.shift()||{};n.text&&(o.slots.text=n.text),n.heading&&(o.slots.heading=n.heading),n.variant&&(o.dataset.variant=n.variant),n.position&&(o.dataset.position=n.position),n.duration!==void 0&&(o.duration=n.duration),document.dispatchEvent(new CustomEvent("toast-show",{detail:o}))},modal(s){return{show(){document.dispatchEvent(new CustomEvent("modal-show",{detail:{name:s}}))},close(){document.dispatchEvent(new CustomEvent("modal-close",{detail:{name:s}}))}}},modals(){return{close(){document.dispatchEvent(new CustomEvent("modal-close",{detail:{}}))}}},appearance:window.localStorage.getItem("flux.appearance")||"system",systemAppearanceChanged:1,get dark(){return JSON.stringify(e.systemAppearanceChanged),e.appearance==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches:e.appearance==="dark"},set dark(s){let o=this.dark;s!==o&&(s?e.appearance="dark":e.appearance="light")}});window.Flux=e,Alpine.magic("flux",()=>e),Alpine.effect(()=>{t(e.appearance)}),document.addEventListener("livewire:navigated",()=>{t(e.appearance)}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{e.systemAppearanceChanged++,t(e.appearance)})});!Zi()&&!es()&&ts();})();