@wpmoo/ui 1.4.2 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ASSET_LICENSE.md +1 -1
- package/README.md +12 -5
- package/certification.json +1 -1
- package/dist/assets/css/moo-ui.css +1 -1
- package/dist/assets/css/moo-ui.min.css +1 -1
- package/dist/assets/css/moo.css +1 -1
- package/dist/assets/css/moo.min.css +1 -1
- package/dist/js/chart.js +1 -1
- package/dist/js/chart.min.js +1 -1
- package/dist/js/combobox.js +1 -1
- package/dist/js/context-menu.js +1 -1
- package/dist/js/datatable.js +1 -1
- package/dist/js/datepicker.js +1 -1
- package/dist/js/datepicker.min.js +1 -1
- package/dist/js/moo-ui.js +2 -2
- package/dist/js/moo-ui.min.js +2 -2
- package/dist/js/overlay-scrollbar.js +2 -2
- package/dist/js/sheet.js +1 -1
- package/dist/js/sidebar.js +1 -1
- package/dist/js/slider.js +1 -1
- package/dist/js/state.js +6 -1
- package/dist/js/table-of-contents.js +1 -1
- package/dist/js/toc.js +1 -1
- package/dist/release-manifest.json +4 -4
- package/package.json +3 -6
- package/scss/mixins/_banner.scss +1 -1
package/ASSET_LICENSE.md
CHANGED
|
@@ -14,6 +14,6 @@ product, site, template, library, training dataset, or marketing asset without
|
|
|
14
14
|
prior written permission from WPMoo.
|
|
15
15
|
|
|
16
16
|
Third-party assets remain under their own licenses. See the
|
|
17
|
-
[version-pinned third-party notices](https://github.com/wpmoo-org/ui/blob/v1.4.
|
|
17
|
+
[version-pinned third-party notices](https://github.com/wpmoo-org/ui/blob/v1.4.3/THIRD_PARTY_NOTICES.md).
|
|
18
18
|
Those notices are repository-only and are intentionally not shipped in the npm
|
|
19
19
|
package.
|
package/README.md
CHANGED
|
@@ -184,7 +184,13 @@ const scrollbar = OverlayScrollbar.getOrCreateInstance(document.querySelector(".
|
|
|
184
184
|
The module preserves native document/touch/wheel scrolling. Its thin thumb
|
|
185
185
|
appears while scrolling, near the trailing mouse edge or on keyboard focus;
|
|
186
186
|
show/hide never reserves a layout gutter. Initial activation removes any native
|
|
187
|
-
gutter.
|
|
187
|
+
gutter. The shared `state.js` bootstrap hides the native document scrollbar
|
|
188
|
+
before first paint for the explicit `data-moo-document-owner="true"` owner.
|
|
189
|
+
This default also applies when the optional overlay is not initialized; native
|
|
190
|
+
touch, wheel and keyboard scrolling remain available. Embedded owners do not
|
|
191
|
+
affect document scrollbars. Overlay initialization takes
|
|
192
|
+
over that initial state; disposal restores the host's original native visibility.
|
|
193
|
+
By default it controls the standards-mode document. Pass
|
|
188
194
|
`scrollElement: element` for an existing native scrolling region belonging to
|
|
189
195
|
the same theme owner; the catalog uses this for its Page main region. There is
|
|
190
196
|
one instance per scroll target, without replacing or wrapping that target.
|
|
@@ -217,9 +223,10 @@ calm.
|
|
|
217
223
|
|
|
218
224
|
## Status And Support
|
|
219
225
|
|
|
220
|
-
The `1.4.
|
|
221
|
-
|
|
222
|
-
|
|
226
|
+
The `1.4.3` patch release target prepares native-hidden document scrolling
|
|
227
|
+
before first paint and preserves the original visibility for explicit overlay
|
|
228
|
+
native mode and disposal. Public exports and Bootstrap compatibility remain
|
|
229
|
+
unchanged from 1.4.2.
|
|
223
230
|
Component certification remains
|
|
224
231
|
`preview`, with its documented manual and browser/device limits. Public exports, package boundaries, browser support, and release evidence live in [Support & Evidence](https://ui.wpmoo.org/support/).
|
|
225
232
|
Complete release notes are on
|
|
@@ -246,4 +253,4 @@ The published `LICENSE` also retains the full MIT notices for bundled
|
|
|
246
253
|
Chart.js and `@kurkle/color`.
|
|
247
254
|
Asset terms live in [ASSET_LICENSE.md](ASSET_LICENSE.md); dependency notices
|
|
248
255
|
live in the
|
|
249
|
-
[version-pinned third-party notices](https://github.com/wpmoo-org/ui/blob/v1.4.
|
|
256
|
+
[version-pinned third-party notices](https://github.com/wpmoo-org/ui/blob/v1.4.3/THIRD_PARTY_NOTICES.md).
|
package/certification.json
CHANGED
package/dist/assets/css/moo.css
CHANGED
package/dist/js/chart.js
CHANGED
package/dist/js/chart.min.js
CHANGED
package/dist/js/combobox.js
CHANGED
package/dist/js/context-menu.js
CHANGED
package/dist/js/datatable.js
CHANGED
package/dist/js/datepicker.js
CHANGED
package/dist/js/moo-ui.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Moo UI moo-ui.js v1.4.
|
|
2
|
+
* Moo UI moo-ui.js v1.4.3 (https://wpmoo.org/)
|
|
3
3
|
* Copyright 2026 WPMoo Authors
|
|
4
4
|
* Licensed under MIT (https://github.com/wpmoo-org/ui/blob/main/LICENSE)
|
|
5
5
|
*/
|
|
@@ -4112,7 +4112,7 @@ var OverlayScrollbar = class _OverlayScrollbar {
|
|
|
4112
4112
|
this._frame = 0;
|
|
4113
4113
|
this._timer = 0;
|
|
4114
4114
|
this._disposed = false;
|
|
4115
|
-
this._originalNativeClass = this._root.classList.contains("scrollbar-overlay-native");
|
|
4115
|
+
this._originalNativeClass = isDocument && typeof owner.__mooNativeScrollbarBaseline === "boolean" ? owner.__mooNativeScrollbarBaseline : this._root.classList.contains("scrollbar-overlay-native");
|
|
4116
4116
|
this._originalId = this._root.getAttribute("id");
|
|
4117
4117
|
this._forcedColors = this._window.matchMedia("(forced-colors: active)");
|
|
4118
4118
|
this._bar = document2.createElement("div");
|
package/dist/js/moo-ui.min.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Moo UI moo-ui.min.js v1.4.
|
|
2
|
+
* Moo UI moo-ui.min.js v1.4.3 (https://wpmoo.org/)
|
|
3
3
|
* Copyright 2026 WPMoo Authors
|
|
4
4
|
* Licensed under MIT (https://github.com/wpmoo-org/ui/blob/main/LICENSE)
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
var st=new WeakMap,rt=a=>a.trim().toLowerCase(),V=class a{static getInstance(t){return t?.nodeType===1&&st.get(t)||null}static getOrCreateInstance(t,e={}){return a.getInstance(t)||new a(t,e)}constructor(t,e={}){if(t?.nodeType!==1||!t.matches(".combobox"))throw new TypeError("Combobox requires a .combobox root element.");let i=st.get(t);if(i)return i;if(this._element=t,this._document=t.ownerDocument,this._window=this._document.defaultView,this._config={noResultsText:"No results found.",...e},this._input=t.querySelector(".combobox-input"),this._menu=t.querySelector(".combobox-menu"),this._options=Array.from(t.querySelectorAll(".combobox-option")),!this._input||!this._menu||this._options.length===0)throw new TypeError("Combobox requires an input, menu, and at least one option.");this._isMultiple=t.dataset.comboboxMultiple==="true",this._hidden=this._isMultiple?null:t.querySelector('input[type="hidden"]'),this._chipValue=t.querySelector(".combobox-value"),this._valueStore=t.querySelector("[data-combobox-value-store]"),this._chipIconTemplate=t.querySelector("[data-combobox-chip-icon]"),this._clearTrigger=t.querySelector("[data-combobox-clear]"),this._indicator=t.querySelector(".combobox-indicator"),this._groups=Array.from(t.querySelectorAll("[data-combobox-group]")),this._separators=Array.from(t.querySelectorAll("[data-combobox-separator]")),this._listeners=[],this._generated=[],this._startsOpen=this._menu.classList.contains("show"),this._empty=this._menu.querySelector("[data-combobox-empty]"),this._empty||(this._empty=this._document.createElement("li"),this._empty.className="combobox-empty",this._empty.hidden=!0,this._empty.dataset.comboboxEmpty="true",this._empty.textContent=this._config.noResultsText,this._menu.appendChild(this._empty),this._generated.push(this._empty)),this._liveRegion=t.querySelector("[data-combobox-live]"),this._liveRegion||(this._liveRegion=this._document.createElement("span"),this._liveRegion.className="visually-hidden",this._liveRegion.setAttribute("aria-live","polite"),this._liveRegion.dataset.comboboxLive="true",t.appendChild(this._liveRegion),this._generated.push(this._liveRegion)),st.set(t,this),this._bindEvents(),this._toggleClear(this._input.dataset.comboboxSelected==="true"||t.dataset.comboboxSelected==="true"),this._syncMultipleValue(),this._filterOptions({open:this._startsOpen,activate:this._startsOpen}),this._startsOpen||this._closeMenu(!1)}dispose(){this._listeners.forEach(({target:t,type:e,handler:i,options:s})=>{t.removeEventListener(e,i,s)}),this._listeners=[],this._closeMenu(!1),this._generated.forEach(t=>t.remove()),this._generated=[],this._chipValue?.querySelectorAll("[data-combobox-generated]").forEach(t=>t.remove()),this._valueStore?.querySelectorAll("[data-combobox-generated]").forEach(t=>t.remove()),st.delete(this._element)}_listen(t,e,i,s){t?.addEventListener(e,i,s),t&&this._listeners.push({target:t,type:e,handler:i,options:s})}_trigger(t,e={}){return this._element.dispatchEvent(new this._window.CustomEvent("".concat(t,".moo.combobox"),{bubbles:!0,cancelable:t==="show"||t==="hide",detail:e}))}_optionGroupIsHidden(t){return t.closest("[data-combobox-group]")?.hidden||!1}_visibleOptions(){return this._options.filter(t=>!t.hidden&&!t.disabled&&!this._optionGroupIsHidden(t))}_syncGroupVisibility(){if(this._groups.length===0)return;let t=0;this._groups.forEach(e=>{let i=Array.from(e.querySelectorAll(".combobox-option")).some(s=>!s.hidden);e.hidden=!i,t+=i?1:0}),this._separators.forEach(e=>{e.hidden=t<2})}_openMenu(t=!0){if(this._menu.classList.contains("show")){this._input.setAttribute("aria-expanded","true");return}t&&!this._trigger("show")||(this._menu.classList.add("show"),this._input.setAttribute("aria-expanded","true"),t&&this._trigger("shown"))}_closeMenu(t=!0){let e=this._menu.classList.contains("show");e&&t&&!this._trigger("hide")||(this._menu.classList.remove("show"),this._input.setAttribute("aria-expanded","false"),this._input.removeAttribute("aria-activedescendant"),this._options.forEach(i=>{i.removeAttribute("aria-current"),i.classList.remove("active")}),e&&t&&this._trigger("hidden"))}_optionLabel(t){return t?.querySelector(".combobox-option__label")?.textContent?.trim()||""}_selectedOptions(){return this._options.filter(t=>t.getAttribute("aria-selected")==="true")}_toggleClear(t){let e=t?"true":"false";this._element.dataset.comboboxSelected=e,this._input.dataset.comboboxSelected=e,this._clearTrigger&&(this._clearTrigger.hidden=!t,this._indicator&&(this._indicator.hidden=t))}_createChip(t){let e=t.dataset.value||"",i=this._optionLabel(t),s=this._document.createElement("span");s.className="badge text-bg-secondary combobox-chip",s.dataset.value=e,s.dataset.comboboxGenerated="true";let r=this._document.createElement("span");r.className="combobox-chip__label",r.textContent=i,s.appendChild(r);let n=this._document.createElement("button");return n.className="combobox-chip__remove",n.type="button",n.dataset.value=e,n.dataset.comboboxChipRemove="true",n.setAttribute("aria-label","Remove ".concat(i)),n.append(this._chipIconTemplate?.content.cloneNode(!0)||"x"),s.appendChild(n),s}_syncMultipleValue(){if(!this._isMultiple)return;let t=this._selectedOptions();if(this._chipValue&&this._chipValue.replaceChildren(...t.map(e=>this._createChip(e))),this._valueStore){this._valueStore.replaceChildren();let e=this._valueStore.dataset.comboboxName||"";t.forEach(i=>{let s=this._document.createElement("input");s.type="hidden",s.name=e,s.value=i.dataset.value||"",s.dataset.comboboxGenerated="true",this._valueStore.appendChild(s)})}this._toggleClear(t.length>0)}_emitChange(){let t=this._selectedOptions();this._trigger("change",{values:t.map(e=>e.dataset.value||"")})}_removeChip(t){let e=this._options.find(i=>i.dataset.value===t);e&&(e.setAttribute("aria-selected","false"),this._syncMultipleValue(),this._emitChange())}_clearSelection(t=!0){this._hidden&&(this._hidden.value=""),this._options.forEach(e=>e.setAttribute("aria-selected","false")),this._isMultiple?this._syncMultipleValue():this._toggleClear(!1),t&&this._emitChange()}_clearStaleSelection(){if(this._isMultiple){this._input.value="",this._options.forEach(i=>{i.hidden=!1}),this._syncGroupVisibility(),this._empty.hidden=!0;return}let t=this._selectedOptions()[0]||null,e=this._optionLabel(t);!this._input.value||e&&rt(this._input.value)===rt(e)||(this._clearSelection(),this._input.value="")}_activeOption(){let t=this._input.getAttribute("aria-activedescendant");return t&&this._visibleOptions().find(e=>e.id===t)||null}_selectedOption(){return this._isMultiple?null:this._visibleOptions().find(t=>t.getAttribute("aria-selected")==="true")||null}_preferredActiveOption(){return this._selectedOption()||this._visibleOptions()[0]||null}_activatePreferredOptionIfNeeded(){this._activeOption()||this._setActiveOption(this._preferredActiveOption())}_setActiveOption(t,{scroll:e=!0}={}){if(this._options.forEach(i=>{let s=i===t;s?i.setAttribute("aria-current","true"):i.removeAttribute("aria-current"),i.classList.toggle("active",s)}),!t){this._input.removeAttribute("aria-activedescendant");return}if(this._input.setAttribute("aria-activedescendant",t.id),e){let i=t.getBoundingClientRect(),s=this._menu.getBoundingClientRect();i.top<s.top?this._menu.scrollTop-=s.top-i.top:i.bottom>s.bottom&&(this._menu.scrollTop+=i.bottom-s.bottom)}}_activateOptionFromPointer(t,e){e.pointerType==="touch"||t.disabled||t.getAttribute("aria-disabled")==="true"||t===this._activeOption()||this._setActiveOption(t,{scroll:!1})}_restoreSelectedActiveOption(){if(!this._menu.classList.contains("show"))return;let t=this._selectedOption();t&&this._setActiveOption(t,{scroll:!1})}_chooseOption(t){if(!(!t||t.disabled)){if(this._isMultiple){t.setAttribute("aria-selected",t.getAttribute("aria-selected")==="true"?"false":"true"),this._input.value="",this._syncMultipleValue(),this._filterOptions(),this._setActiveOption(t),this._emitChange();return}this._options.forEach(e=>{e.setAttribute("aria-selected",e===t?"true":"false")}),this._input.value=this._optionLabel(t),this._hidden&&(this._hidden.value=t.dataset.value||""),this._toggleClear(!0),this._setActiveOption(t),this._emitChange()}}_filterOptions({open:t=!0,activate:e=!0,resetActive:i=!1}={}){t&&this._openMenu();let s=rt(this._input.value),r=0;this._options.forEach(n=>{let o=!s||rt(n.textContent).includes(s);n.hidden=!o,r+=o?1:0}),this._syncGroupVisibility(),this._empty.hidden=r!==0,this._liveRegion.textContent=r===0?"No results":"".concat(r," result").concat(r===1?"":"s"),i&&this._setActiveOption(null,{scroll:!1}),e&&this._activatePreferredOptionIfNeeded()}_bindEvents(){this._listen(this._input,"focus",()=>{this._openMenu(),!this._isMultiple&&this._input.dataset.comboboxSelected==="true"&&this._input.select(),this._activatePreferredOptionIfNeeded()}),this._listen(this._input,"input",()=>{this._isMultiple||this._clearSelection(),this._filterOptions({resetActive:!0})}),this._listen(this._input,"blur",t=>{let e=t.relatedTarget;e instanceof this._window.Node&&this._element.contains(e)||this._clearStaleSelection()}),this._listen(this._input,"click",()=>{this._openMenu(),this._setActiveOption(this._preferredActiveOption())}),this._listen(this._input,"keydown",t=>this._handleKeydown(t)),this._options.forEach(t=>{this._listen(t,"keydown",e=>this._handleKeydown(e)),this._listen(t,"pointerenter",e=>{this._activateOptionFromPointer(t,e)}),this._listen(t,"click",()=>{this._chooseOption(t),this._isMultiple?this._input.focus():this._closeMenu()})}),this._listen(this._clearTrigger,"click",t=>{t.preventDefault(),this._clearSelection(),this._input.value="",this._input.focus(),this._filterOptions({resetActive:!0})}),this._listen(this._menu,"pointerleave",()=>this._restoreSelectedActiveOption()),this._listen(this._element,"click",t=>this._handleRootClick(t)),this._listen(this._document,"click",t=>{t.target instanceof this._window.Node&&!this._element.contains(t.target)&&this._closeMenu()})}_handleRootClick(t){let e=t.target,i=e instanceof this._window.Element?e.closest("[data-combobox-chip-remove]"):null;i?(t.preventDefault(),this._removeChip(i.dataset.value||""),this._input.focus()):this._isMultiple&&e instanceof this._window.Element&&e.closest(".combobox-chips")&&this._input.focus()}_handleKeydown(t){let e=this._visibleOptions(),i=e.findIndex(n=>n.id===this._input.getAttribute("aria-activedescendant")),s=t.key==="ArrowDown"||t.key==="Down",r=t.key==="ArrowUp"||t.key==="Up";if(this._isMultiple&&t.key==="Backspace"&&this._input.value===""){let n=this._selectedOptions(),o=n[n.length-1];o&&(t.preventDefault(),this._removeChip(o.dataset.value||""))}else if((s||r)&&e.length){t.preventDefault(),this._openMenu();let o=i===-1?0:(i+(s?1:-1)+e.length)%e.length;this._setActiveOption(e[o]),t.target!==this._input&&this._input.focus({preventScroll:!0})}else if(t.key==="Enter"){let n=e[i];n&&(t.preventDefault(),this._chooseOption(n),this._isMultiple||this._closeMenu())}else t.key==="Escape"?(this._closeMenu(),this._input.focus()):t.key==="Tab"&&this._closeMenu()}};var at=new WeakMap;function Rt(a){let{clientX:t,clientY:e}=a;return{top:e,left:t,right:t,bottom:e,width:0,height:0,x:t,y:e}}function _t(a){return!!(a?.disabled||a?.getAttribute?.("aria-disabled")==="true")}function Vt(a){let t=a.target,e=t.closest?.(".dropdown-item");return e||t.closest?.("li")?.querySelector(":scope > .dropdown-item")||null}var N=class a{static getInstance(t){return t?.nodeType===1&&at.get(t)||null}static getOrCreateInstance(t,e={}){return a.getInstance(t)||new a(t,e)}constructor(t,e={}){if(t?.nodeType!==1||!t.matches(".context-menu"))throw new TypeError("ContextMenu requires a .context-menu root element.");let i=at.get(t);if(i)return i;if(this._element=t,this._document=t.ownerDocument,this._window=this._document.defaultView,this._menu=t.querySelector(":scope > .context-menu-menu"),this._fallback=t.querySelector(":scope > [data-context-menu-fallback]"),!this._menu)throw new TypeError("ContextMenu requires a .context-menu-menu element.");if(!this._fallback)throw new TypeError("ContextMenu requires an explicit fallback trigger.");let s=this._bootstrap("Dropdown");if(!s)throw new TypeError("ContextMenu requires bootstrap.Dropdown (bootstrap.bundle.js).");this._config={...e},this._listeners=[],this._invoker=null,this._pointerRect=null,this._openMethod=null,this._reference={getBoundingClientRect:()=>this._currentRect(),contextElement:this._fallback},this._dropdown=new s(this._fallback,{reference:this._reference,autoClose:"outside"}),at.set(t,this),this._bindEvents()}dispose(){this._listeners.forEach(({target:t,type:e,handler:i,options:s})=>{t.removeEventListener(e,i,s)}),this._listeners=[],this._dropdown.dispose(),this._syncExpanded(!1),this._invoker=null,this._pointerRect=null,at.delete(this._element)}show(t=this._fallback){this._open(t,null)}hide(){this._dropdown.hide()}_listen(t,e,i,s){t.addEventListener(e,i,s),this._listeners.push({target:t,type:e,handler:i,options:s})}_bootstrap(t){return this._window.bootstrap?.[t]||null}_currentRect(){return this._pointerRect?this._pointerRect:(this._invoker||this._fallback).getBoundingClientRect()}_trigger(t,e=!1){return this._element.dispatchEvent(new this._window.CustomEvent("".concat(t,".moo.context-menu"),{bubbles:!0,cancelable:e}))}_triggers(){return Array.from(this._element.querySelectorAll(":scope > .context-menu-trigger"))}_syncExpanded(t){this._triggers().forEach(e=>{e.setAttribute("aria-expanded",String(t))})}_menuItems(){return Array.from(this._menu.querySelectorAll(".dropdown-item")).filter(t=>!_t(t)&&!t.classList.contains("disabled"))}_open(t,e,i){_t(t)||(this._menu.classList.contains("show")&&this._dropdown.hide(),this._invoker=t,this._pointerRect=e?Rt(e):null,this._openMethod=i,this._dropdown.show())}_handleContextMenu(t){let e=t.target.closest(".context-menu-trigger");!e||!this._element.contains(e)||(t.preventDefault(),this._open(e,t,"pointer"))}_handleKeydown(t){let e=t.target.closest(".context-menu-trigger");if(!e||!this._element.contains(e))return;let i=t.shiftKey&&t.key==="F10",s=t.key==="ContextMenu";!i&&!s||(t.preventDefault(),this._open(e,null,"keyboard"))}_handleFallbackClick(){this._invoker=this._fallback,this._pointerRect=null,this._openMethod="pointer"}_handleFallbackKeydown(t){if(!(t.key!==" "&&t.key!=="Spacebar")){if(t.preventDefault(),t.stopPropagation(),this._menu.classList.contains("show")){this._dropdown.hide();return}this._open(this._fallback,null,"fallback-keyboard")}}_handleMenuClick(t){let e=Vt(t);if(!e)return;let i=e.matches(".dropdown-item-check, [data-context-menu-persistent]");if(e.matches('.dropdown-item.disabled, .dropdown-item[aria-disabled="true"], .dropdown-item:disabled')||_t(e)){t.preventDefault(),t.stopPropagation();return}let r=e.matches("[data-context-menu-radio-group]")?e:null;if(r){t.preventDefault(),t.stopPropagation();let n=r.dataset.contextMenuRadioGroup;this._menu.querySelectorAll('[data-context-menu-radio-group="'.concat(n,'"]')).forEach(o=>{let c=o===r;o.classList.toggle("active",c),o.setAttribute("aria-pressed",String(c))});return}i||this._dropdown.hide()}_bindEvents(){this._listen(this._element,"contextmenu",t=>this._handleContextMenu(t)),this._listen(this._element,"keydown",t=>this._handleKeydown(t)),this._listen(this._fallback,"click",()=>this._handleFallbackClick()),this._listen(this._fallback,"keydown",t=>this._handleFallbackKeydown(t)),this._listen(this._menu,"click",t=>this._handleMenuClick(t)),this._listen(this._fallback,"show.bs.dropdown",t=>{this._trigger("show",!0)||t.preventDefault()}),this._listen(this._fallback,"shown.bs.dropdown",()=>{this._syncExpanded(!0),this._openMethod==="fallback-keyboard"?this._fallback.focus():this._openMethod==="keyboard"?this._menuItems()[0]?.focus():this._menu.focus(),this._trigger("shown")}),this._listen(this._fallback,"hide.bs.dropdown",t=>{this._trigger("hide",!0)||t.preventDefault()}),this._listen(this._fallback,"hidden.bs.dropdown",()=>{this._syncExpanded(!1);let t=this._invoker;this._pointerRect=null,this._invoker=null,this._openMethod=null,this._trigger("hidden"),queueMicrotask(()=>{t&&t!==this._fallback&&this._document.activeElement===this._fallback&&t.focus()})})}};var kt='.moo-ui[data-bs-theme="light"], .moo-ui[data-bs-theme="dark"]',Nt="[data-moo-overlay-host]";function Bt(a){return a?.nodeType===9?a:a?.ownerDocument?a.ownerDocument:typeof document>"u"?null:document}function $t(a){return!!a?.matches?.(kt)}function zt(a){let t=Bt(a);return a?.nodeType===9||a===t?.body?t?.body?.firstElementChild||null:a}function E(a=typeof document>"u"?null:document){let t=zt(a);return t?$t(t)?t:t.closest?.(kt)||null:null}function P(a){return a?Array.from(a.children||[]).find(t=>t.matches?.(Nt))||a:null}var nt=new WeakMap;function M(a){return(a??"").toString().trim().toLowerCase()}var B=class a{static getInstance(t){return t?.nodeType===1&&nt.get(t)||null}static getOrCreateInstance(t,e={}){return a.getInstance(t)||new a(t,e)}constructor(t,e={}){if(t?.nodeType!==1||!t.matches(".datatable"))throw new TypeError("DataTable requires a .datatable root element.");let i=nt.get(t);if(i)return i;if(this._element=t,this._document=t.ownerDocument,this._window=this._document.defaultView,this._table=t.querySelector(":scope .datatable-table"),this._tbody=this._table?.querySelector(":scope > tbody"),!this._table||!this._tbody)throw new TypeError("DataTable requires a .datatable-table with a tbody.");this._cards=t.querySelector("[data-datatable-cards]");let s=new Map(Array.from(t.querySelectorAll("[data-datatable-card]")).map(r=>[r.dataset.datatableCardFor,r]));this._config={...e},this._listeners=[],this._pageSize=Number(t.dataset.datatablePageSize)||10,this._currentPage=1,this._sortKey=null,this._sortDirection=null,this._selectedIds=new Set,this._facetSelections=new Map,this._visibleFacets=new Map,this._searchTerm="",this._tooltips=[],this._filterMode=t.dataset.datatableFilterMode||"inline",this._reparentedRowMenus=new Map,this._reparentedRowMenuByTrigger=new WeakMap,this._reparentedSortMenus=new Map,this._reparentedSortMenuByTrigger=new WeakMap,this._rows=Array.from(this._tbody.querySelectorAll(":scope > tr[data-datatable-row]")).map((r,n)=>({element:r,cardElement:s.get(r.id)||null,index:n,search:M(r.dataset.datatableSearch),facets:this._readFacets(r)})),this._readInitialFacetVisibility(),this._readInitialSort(),nt.set(t,this),this._bindEvents(),this._render(),this._initBulkTooltips(),this._initViewToggle(),this._initRowActionDropdowns(),this._initSortDropdowns()}dispose(){this._disposeRowActionDropdowns(),this._disposeSortDropdowns(),this._restoreRowActionMenus(),this._restoreSortMenus(),this._listeners.forEach(({target:t,type:e,handler:i,options:s})=>{t.removeEventListener(e,i,s)}),this._listeners=[],this._tooltips.forEach(t=>t.dispose()),this._tooltips=[],nt.delete(this._element)}getSelectedIds(){return Array.from(this._selectedIds)}_listen(t,e,i,s){t&&(t.addEventListener(e,i,s),this._listeners.push({target:t,type:e,handler:i,options:s}))}_rowActionTriggers(){return this._element.querySelectorAll('tr[data-datatable-row] .dropdown [data-bs-toggle="dropdown"], [data-datatable-card] .dropdown [data-bs-toggle="dropdown"]')}_initRowActionDropdowns(){let t=this._bootstrap("Dropdown");t&&this._rowActionTriggers().forEach(e=>{t.getOrCreateInstance(e,{popperConfig:i=>this._clippingSafePopperConfig(i)})})}_sortTriggers(){return this._element.querySelectorAll('.datatable-sort [data-bs-toggle="dropdown"]')}_initSortDropdowns(){let t=this._bootstrap("Dropdown");t&&this._sortTriggers().forEach(e=>{t.getOrCreateInstance(e,{popperConfig:i=>this._clippingSafePopperConfig(i)})})}_clippingSafePopperConfig(t){return{...t,strategy:"fixed",modifiers:[...t.modifiers||[],{name:"flip",options:{fallbackPlacements:["top-end","top-start","bottom-end","bottom-start"]}},{name:"preventOverflow",options:{boundary:"viewport",padding:8}}]}}_disposeRowActionDropdowns(){let t=this._bootstrap("Dropdown");t&&this._rowActionTriggers().forEach(e=>{let i=t.getInstance(e);i&&(i.hide(),i.dispose())})}_disposeSortDropdowns(){let t=this._bootstrap("Dropdown");t&&this._sortTriggers().forEach(e=>{let i=t.getInstance(e);i&&(i.hide(),i.dispose())})}_rowActionMenuForTrigger(t){return t?.closest?.("tr[data-datatable-row], [data-datatable-card]")&&t.closest(".dropdown")?.querySelector(":scope > .dropdown-menu")||null}_rowActionOwnerIdForTrigger(t){let e=t?.closest?.("tr[data-datatable-row]")?.id;return e||t?.closest?.("[data-datatable-card]")?.getAttribute("data-datatable-card-for")||""}_reparentRowActionMenu(t){let e=this._rowActionMenuForTrigger(t);if(!e||this._reparentedRowMenus.has(e))return;let i=this._rowActionOwnerIdForTrigger(t);i&&e.setAttribute("data-datatable-row-action-owner",i),t.id&&e.setAttribute("data-datatable-row-action-trigger",t.id),this._reparentedRowMenus.set(e,{parent:e.parentNode,nextSibling:e.nextSibling,trigger:t,owner:E(t)}),this._reparentedRowMenuByTrigger.set(t,e),this._portalRoot(t).appendChild(e)}_restoreRowActionMenuForTrigger(t){let e=this._reparentedRowMenuByTrigger.get(t)||this._rowActionMenuForTrigger(t);e&&this._restoreRowActionMenu(e)}_restoreRowActionMenu(t){let e=this._reparentedRowMenus.get(t);if(!e)return;let{parent:i,nextSibling:s,trigger:r,owner:n}=e;n?.isConnected===!1?t.remove():i?.isConnected?s?.parentNode===i?i.insertBefore(t,s):i.appendChild(t):t.remove(),r&&this._reparentedRowMenuByTrigger.delete(r),t.removeAttribute("data-datatable-row-action-owner"),t.removeAttribute("data-datatable-row-action-trigger"),this._reparentedRowMenus.delete(t)}_restoreRowActionMenus(){Array.from(this._reparentedRowMenus.keys()).forEach(t=>{this._restoreRowActionMenu(t)})}_sortMenuForTrigger(t){return t?.closest?.(".datatable-sort")&&(this._reparentedSortMenuByTrigger.get(t)||t?.closest?.(".dropdown")?.querySelector(":scope > .dropdown-menu"))||null}_reparentSortMenu(t){let e=this._sortMenuForTrigger(t);!e||this._reparentedSortMenus.has(e)||(this._reparentedSortMenus.set(e,{parent:e.parentNode,nextSibling:e.nextSibling,trigger:t,owner:t.closest(".datatable-sort"),themeOwner:E(t)}),this._reparentedSortMenuByTrigger.set(t,e),this._portalRoot(t).appendChild(e))}_restoreSortMenuForTrigger(t){let e=this._reparentedSortMenuByTrigger.get(t)||this._sortMenuForTrigger(t);e&&this._restoreSortMenu(e)}_restoreSortMenu(t){let e=this._reparentedSortMenus.get(t);if(!e)return;let{parent:i,nextSibling:s,trigger:r,themeOwner:n}=e;n?.isConnected===!1?t.remove():i?.isConnected?s?.parentNode===i?i.insertBefore(t,s):i.appendChild(t):t.remove(),r&&this._reparentedSortMenuByTrigger.delete(r),this._reparentedSortMenus.delete(t)}_restoreSortMenus(){Array.from(this._reparentedSortMenus.keys()).forEach(t=>{this._restoreSortMenu(t)})}_bootstrap(t){return this._window.bootstrap?.[t]||null}_portalRoot(t=this._element){return P(E(t))||this._document.body||this._document.documentElement}_initBulkTooltips(){let t=this._bootstrap("Tooltip");t&&this._element.querySelectorAll('[data-datatable-bulk-actions] [data-bs-title]:not([data-bs-toggle="dropdown"])').forEach(e=>{this._tooltips.push(t.getOrCreateInstance(e,{animation:!1,container:this._portalRoot(e)}))})}_hideBulkTooltips({blur:t=!1}={}){if(this._tooltips.forEach(i=>{i.hide()}),!t)return;let e=this._document.activeElement;e?.closest?.("[data-datatable-bulk-actions]")&&e.blur()}_initViewToggle(){let t=Array.from(this._element.querySelectorAll(".datatable-view-toggle"));if(!t.length)return;let e=t.flatMap(h=>Array.from(h.querySelectorAll("input"))),i=this._window.getComputedStyle(this._element).getPropertyValue("--moo-datatable-responsive-breakpoint").trim(),s=this._element.hasAttribute("data-datatable-responsive-breakpoint"),r=s&&i?this._window.matchMedia("(min-width: ".concat(i,")")):null,n=new Map,o=()=>"moo-datatable-view:".concat(this._element.id).concat(r?r.matches?":wide":":narrow":""),c=(h,{persist:_=!1}={})=>{if(this._element.dataset.datatableView!==h){let m=this._bootstrap("Dropdown");[...this._rowActionTriggers(),...this._sortTriggers()].forEach(p=>{m?.getInstance(p)?.hide()})}if(this._element.dataset.datatableView=h,e.forEach(m=>{m.checked=m.value===h}),_){n.set(o(),h);try{this._window.localStorage.setItem(o(),h)}catch{}}},l=()=>{let h=n.get(o());try{h??(h=this._window.localStorage.getItem(o()))}catch{}c(h==="table"||h==="cards"?h:r?r.matches?"table":"cards":this._element.dataset.datatableView)};!s||r?l():e.forEach(h=>{h.checked=!1}),r&&this._listen(r,"change",l),t.forEach(h=>{this._listen(h,"change",_=>{let m=_.target.value;m!=="table"&&m!=="cards"||c(m,{persist:!0})})})}_readFacets(t){let e={};return Array.from(t.attributes).forEach(i=>{let s=/^data-datatable-facet-(.+)$/.exec(i.name);s&&(e[s[1]]=i.value)}),e}_readInitialFacetVisibility(){this._element.querySelectorAll("[data-datatable-facet]").forEach(t=>{let e=t.dataset.datatableFacet;e&&this._visibleFacets.set(e,!t.hidden)}),this._element.querySelectorAll("[data-datatable-filter-group]").forEach(t=>{let e=t.dataset.datatableFilterGroup;e&&!this._visibleFacets.has(e)&&this._visibleFacets.set(e,!1)}),this._element.querySelectorAll("[data-datatable-filter-option-key]").forEach(t=>{let e=t.dataset.datatableFilterOptionKey;e&&!this._visibleFacets.has(e)&&this._visibleFacets.set(e,!1)})}_readInitialSort(){let t=this._element.querySelector("th[data-datatable-initial-sort][data-datatable-column]"),e=t?.dataset.datatableInitialSort;e!=="asc"&&e!=="desc"||(this._sortKey=t.dataset.datatableColumn||null,this._sortDirection=this._sortKey?e:null)}_trigger(t,e={}){this._element.dispatchEvent(new this._window.CustomEvent("".concat(t,".moo.datatable"),{bubbles:!0,detail:e}))}_sortValue(t,e){let i=t.element.querySelector(':scope > [data-datatable-column="'.concat(e,'"]'));return i?M(i.dataset.datatableSortValue??i.textContent):""}_matchesFilters(t){if(this._searchTerm&&!t.search.includes(this._searchTerm))return!1;for(let[e,i]of this._facetSelections)if(i.size!==0&&!i.has(t.facets[e]))return!1;return!0}_visibleRows(){let t=this._rows.filter(e=>this._matchesFilters(e));if(this._sortKey){let e=this._sortDirection==="desc"?-1:1;t.sort((i,s)=>{let r=this._sortValue(i,this._sortKey),n=this._sortValue(s,this._sortKey);return r===n?i.index-s.index:r>n?e:-e})}else t.sort((e,i)=>e.index-i.index);return t}_pageCount(t){return Math.max(1,Math.ceil(t/this._pageSize))}_render(){let t=this._visibleRows(),e=this._pageCount(t.length);this._currentPage=Math.min(Math.max(1,this._currentPage),e);let i=(this._currentPage-1)*this._pageSize,s=t.slice(i,i+this._pageSize),r=new Set(s.map(l=>l.element.id));this._rows.forEach(l=>{let h=r.has(l.element.id);l.element.hidden=!h,l.cardElement&&(l.cardElement.hidden=!h)});let n=Array.from(this._tbody.children).filter(l=>r.has(l.id)).map(l=>l.id),o=s.map(l=>l.element.id);(n.length!==o.length||n.some((l,h)=>l!==o[h]))&&s.forEach(l=>{this._tbody.appendChild(l.element),this._cards&&l.cardElement&&this._cards.appendChild(l.cardElement)}),this._renderToolbarState(),this._renderSortHeaders(),this._renderSelection(s),this._renderFrameState(t.length),this._renderEmptyState(t.length),this._renderPagination(t.length,e),this._renderPageSize(),this._renderBulkActions()}_renderToolbarState(){let t=!!this._searchTerm,e=Array.from(this._facetSelections.values()).some(s=>s.size>0),i=this._element.querySelector("[data-datatable-reset]");i&&(i.hidden=!(t||e)),this._element.querySelectorAll("[data-datatable-facet]").forEach(s=>{let r=s.dataset.datatableFacet,n=this._facetSelections.get(r)||new Set;this._visibleFacets.has(r)&&(s.hidden=!this._visibleFacets.get(r)),s.querySelector(".datatable-facet-trigger")?.classList.toggle("datatable-facet-trigger-active",n.size>0);let c=s.querySelector("[data-datatable-facet-summary]");c&&(c.hidden=n.size===0,c.replaceChildren(),n.size>2?c.appendChild(this._createFacetBadge("".concat(n.size," selected"))):n.forEach(l=>{let _=s.querySelector('[data-datatable-facet-option="'.concat(l,'"]'))?.querySelector("[data-datatable-facet-option-label]")?.textContent??l;c.appendChild(this._createFacetBadge(_))})),s.querySelectorAll("[data-datatable-facet-option]").forEach(l=>{let h=n.has(l.dataset.datatableFacetOption);l.classList.toggle("active",h),l.setAttribute("aria-pressed",String(h))})}),this._element.querySelectorAll("[data-datatable-filter-toggle]").forEach(s=>{let r=s.dataset.datatableFilterToggle,n=this._visibleFacets.get(r)??!0;s.classList.toggle("active",n),s.setAttribute("aria-pressed",n?"true":"false")}),this._element.querySelectorAll("[data-datatable-filter-option]").forEach(s=>{let r=s.dataset.datatableFilterOptionKey,o=(this._facetSelections.get(r)||new Set).has(s.dataset.datatableFilterOption);s.classList.toggle("active",o),s.setAttribute("aria-pressed",o?"true":"false")}),this._element.querySelectorAll("[data-datatable-filter-group-summary]").forEach(s=>{let r=this._facetSelections.get(s.dataset.datatableFilterGroupSummary)||new Set;s.hidden=r.size===0,s.textContent=r.size>0?"".concat(r.size," selected"):""})}_createFacetBadge(t){let e=this._document.createElement("span");return e.className="datatable-facet-badge",e.textContent=t,e}_renderSelection(t){let e=Array.from(this._element.querySelectorAll("[data-datatable-select-all]"));t.forEach(r=>{[r.element,r.cardElement].forEach(n=>{let o=n?.querySelector("[data-datatable-select-row]");o&&(o.checked=this._selectedIds.has(r.element.id)),n?.classList.toggle("datatable-row-selected",this._selectedIds.has(r.element.id))})});let i=t.length,s=t.filter(r=>this._selectedIds.has(r.element.id)).length;e.forEach(r=>{r.checked=i>0&&s===i,r.indeterminate=s>0&&s<i})}_renderBulkActions(){let t=this._element.querySelector("[data-datatable-bulk-actions]");if(!t)return;t.hidden=this._selectedIds.size===0;let e=t.querySelector("[data-datatable-bulk-count]");e&&(e.textContent=String(this._selectedIds.size))}_renderFrameState(t){let e=t===0;this._element.querySelectorAll(".datatable-frame, .datatable-card-frame").forEach(i=>{i.hidden=e})}_renderEmptyState(t){let e=this._element.querySelector("[data-datatable-empty]");if(!e)return;let i=this._rows.length>0;e.hidden=t!==0,e.querySelector(".empty-state-title, .datatable-empty-title")?.replaceChildren(this._document.createTextNode(i?"No matching results":"No rows to display"));let s=e.querySelector(".empty-state-description, .datatable-empty-copy");s&&(s.hidden=!i);let r=e.querySelector("[data-datatable-empty-reset]");if(r){r.hidden=!i;let n=r.closest(".empty-state-actions");n&&(n.hidden=!i)}}_sortAriaValue(t){return t==="asc"?"ascending":t==="desc"?"descending":"none"}_renderSortHeaders(){this._element.querySelectorAll("th[data-datatable-column]").forEach(t=>{if(!t.querySelector("[data-datatable-sort-key]")){delete t.dataset.datatableSortState,delete t.dataset.datatableSortDirection,t.removeAttribute("aria-sort");return}let i=t.dataset.datatableColumn,s=i&&i===this._sortKey?this._sortDirection:"none";t.dataset.datatableSortState=s||"none",t.setAttribute("aria-sort",this._sortAriaValue(s)),s==="asc"||s==="desc"?t.dataset.datatableSortDirection=s:delete t.dataset.datatableSortDirection})}_renderPagination(t,e){let i=this._element.querySelector("[data-datatable-page-first]"),s=this._element.querySelector("[data-datatable-page-prev]"),r=this._element.querySelector("[data-datatable-page-next]"),n=this._element.querySelector("[data-datatable-page-last]"),o=this._currentPage<=1,c=this._currentPage>=e;[i,s].forEach(u=>this._setPageItemDisabled(u,o)),[r,n].forEach(u=>this._setPageItemDisabled(u,c));let l=this._element.querySelector("[data-datatable-results-summary]");if(l)if(t===0)l.textContent="No results";else{let u=(this._currentPage-1)*this._pageSize+1,d=Math.min(this._currentPage*this._pageSize,t);l.textContent="Showing ".concat(u,"-").concat(d," of ").concat(t)}let h=this._element.querySelector("template[data-datatable-page-numbers]");if(!h)return;let _=this._pageWindow(this._currentPage,e),m=Array.from(h.parentNode.querySelectorAll("[data-datatable-page-number], [data-datatable-page-ellipsis]")),p=m.map(u=>u.dataset.datatablePageEllipsis===void 0?Number(u.dataset.datatablePageNumber):"\u2026");if(p.length!==_.length||p.some((u,d)=>u!==_[d])){m.forEach(d=>d.remove());let u=this._document.createDocumentFragment();_.forEach(d=>{let D=this._document.createElement("li");if(D.className="page-item",d==="\u2026")D.dataset.datatablePageEllipsis="",D.innerHTML='<span class="page-link">\u2026</span>';else{D.dataset.datatablePageNumber=String(d);let w=this._document.createElement("button");w.type="button",w.className="page-link",w.textContent=String(d),w.setAttribute("aria-label","Go to page ".concat(d)),w.dataset.datatablePageGo=String(d),D.appendChild(w)}u.appendChild(D)}),h.parentNode.insertBefore(u,h)}h.parentNode.querySelectorAll("[data-datatable-page-number]").forEach(u=>{let d=Number(u.dataset.datatablePageNumber)===this._currentPage;u.classList.toggle("active",d),d?u.setAttribute("aria-current","page"):u.removeAttribute("aria-current")})}_renderPageSize(){let t=String(this._pageSize),e=this._element.querySelector("[data-datatable-page-size-value]");e&&(e.textContent=t);let i=this._element.querySelector("[data-datatable-page-size-select]");i&&(i.value=t),this._element.querySelectorAll("[data-datatable-page-size-option]").forEach(s=>{let r=s.dataset.datatablePageSizeOption===t;s.classList.toggle("active",r),s.setAttribute("aria-pressed",r?"true":"false")})}_setPageItemDisabled(t,e){t&&(t.disabled=e,t.closest(".page-item")?.classList.toggle("disabled",e))}_pageWindow(t,e){if(e<=7)return Array.from({length:e},(n,o)=>o+1);let i=new Set([1,e,t-1,t,t+1]),s=Array.from(i).filter(n=>n>=1&&n<=e).sort((n,o)=>n-o),r=[];return s.forEach((n,o)=>{o>0&&n-s[o-1]>1&&r.push("\u2026"),r.push(n)}),r}_isColumnFixed(t){return this._element.querySelector('th[data-datatable-column="'.concat(t,'"]'))?.hasAttribute("data-datatable-column-fixed")||!1}_setColumnVisible(t,e,{syncViewToggle:i=!0}={}){!e&&this._isColumnFixed(t)||(this._element.querySelectorAll('[data-datatable-column="'.concat(t,'"], [data-datatable-detail-column="').concat(t,'"]')).forEach(s=>{s.classList.toggle("datatable-col-hidden",!e)}),i&&this._element.querySelectorAll('[data-datatable-column-toggle="'.concat(t,'"]')).forEach(s=>{s.classList.toggle("active",e),s.setAttribute("aria-pressed",String(e))}))}_setSort(t,e){let i=e==="asc"||e==="desc"?e:null;this._sortKey=i?t:null,this._sortDirection=i,this._render(),this._trigger("sort",{key:this._sortKey,direction:this._sortDirection})}_handleSortAction(t){let e=t.target.closest("[data-datatable-sort-action]");if(!e)return;let i=e.closest(".dropdown-menu"),s=i?.closest(".datatable-sort")||this._reparentedSortMenus.get(i)?.owner;if(!s||!this._element.contains(s))return;let r=s.querySelector("[data-datatable-sort-key]")?.dataset.datatableSortKey;if(!r)return;let n=e.dataset.datatableSortAction;if(n==="hide"){this._setColumnVisible(r,!1);return}this._setSort(r,n)}_handleFacetClick(t){let e=t.target.closest("[data-datatable-facet-option]"),i=t.target.closest("[data-datatable-facet-clear]");if(!e&&!i)return;let r=t.target.closest("[data-datatable-facet]")?.dataset.datatableFacet;if(!r)return;let n=this._facetSelections.get(r)||new Set;if(i)n.clear();else{let o=e.dataset.datatableFacetOption;n.has(o)?n.delete(o):n.add(o)}this._facetSelections.set(r,n),this._filterMode==="picker"&&n.size===0&&this._visibleFacets.set(r,!1),this._currentPage=1,this._render(),this._trigger("filter")}_handleFacetSearch(t){let e=t.target.closest("[data-datatable-facet-search]");if(!e)return;let i=e.closest("[data-datatable-facet]"),s=M(e.value);i?.querySelectorAll("[data-datatable-facet-option]").forEach(r=>{let n=M(r.querySelector("[data-datatable-facet-option-label]")?.textContent||r.textContent);r.closest("li")?.classList.toggle("datatable-facet-search-hidden",s.length>0&&!n.includes(s))})}_handleFacetSearchKeydown(t){if(t.key!=="ArrowDown")return;let e=t.target.closest("[data-datatable-facet-search]");if(!e)return;let i=e.closest("[data-datatable-facet]"),r=Array.from(i?.querySelectorAll("[data-datatable-facet-option]")||[]).find(n=>!n.closest("li")?.classList.contains("datatable-facet-search-hidden"));r&&(t.preventDefault(),r.focus())}_handleFilterOptionClick(t){let e=t.target.closest("[data-datatable-filter-option]");if(!e)return;let i=e.dataset.datatableFilterOptionKey,s=e.dataset.datatableFilterOption;if(!i||!this._visibleFacets.has(i))return;this._visibleFacets.set(i,!0);let r=this._facetSelections.get(i)||new Set;r.has(s)?r.delete(s):r.add(s),this._facetSelections.set(i,r),r.size===0&&this._visibleFacets.set(i,!1),this._currentPage=1,this._render(),this._trigger("filter")}_showFilterPickerPanel(t=null){this._element.querySelectorAll("[data-datatable-filter-panel]").forEach(e=>{let i=e.dataset.datatableFilterPanel==="facets",s=e.dataset.datatableFilterPanelKey===t;e.hidden=t?!s:!i}),this._element.querySelector(".datatable-search-filter-menu")?.setAttribute("data-datatable-filter-menu-panel",t?"options":"facets")}_handleFilterPickerClick(t){let e=t.target.closest("[data-datatable-filter-group]");if(e){let i=e.dataset.datatableFilterGroup;this._showFilterPickerPanel(i);let s=this._element.querySelector('[data-datatable-filter-option-search="'.concat(i,'"]')),r=this._element.querySelector('[data-datatable-filter-option-key="'.concat(i,'"]'));(s||r)?.focus({preventScroll:!0});return}t.target.closest("[data-datatable-filter-back]")&&this._showFilterPickerPanel()}_handleFilterOptionSearch(t){let e=t.target.closest("[data-datatable-filter-option-search]");if(!e)return;let i=e.dataset.datatableFilterOptionSearch,s=M(e.value);this._element.querySelectorAll('[data-datatable-filter-option-key="'.concat(i,'"]')).forEach(r=>{let n=M(r.querySelector("[data-datatable-filter-option-label]")?.textContent||r.textContent);r.closest("li")?.classList.toggle("datatable-filter-option-search-hidden",s.length>0&&!n.includes(s))})}_handleFilterOptionSearchKeydown(t){if(t.key!=="ArrowDown")return;let e=t.target.closest("[data-datatable-filter-option-search]");if(!e)return;let i=e.dataset.datatableFilterOptionSearch,r=Array.from(this._element.querySelectorAll('[data-datatable-filter-option-key="'.concat(i,'"]'))).find(n=>!n.closest("li")?.classList.contains("datatable-filter-option-search-hidden"));r&&(t.preventDefault(),r.focus())}_handleFilterToggleClick(t){let e=t.target.closest("[data-datatable-filter-toggle]");if(!e)return;let i=e.dataset.datatableFilterToggle;if(!i||!this._visibleFacets.has(i))return;let s=!this._visibleFacets.get(i);this._visibleFacets.set(i,s),s||(this._facetSelections.get(i)?.clear(),this._currentPage=1,this._trigger("filter")),this._render()}_handleColumnToggleClick(t){let e=t.target.closest("[data-datatable-column-toggle]");if(!e)return;let i=e.dataset.datatableColumnToggle,s=e.getAttribute("aria-pressed")==="true";this._setColumnVisible(i,s,{syncViewToggle:!1})}_handleReset(){let t=this._element.querySelector("[data-datatable-search]");t&&(t.value=""),this._searchTerm="",this._facetSelections.forEach(e=>e.clear()),this._filterMode==="picker"&&this._visibleFacets.forEach((e,i)=>{this._visibleFacets.set(i,!1)}),this._currentPage=1,this._render(),this._trigger("filter")}_handleSelectAll(t){let e=t.target.checked,i=this._visibleRows(),s=(this._currentPage-1)*this._pageSize;i.slice(s,s+this._pageSize).forEach(n=>{e?this._selectedIds.add(n.element.id):this._selectedIds.delete(n.element.id)}),this._render(),this._trigger("select")}_handleSelectRow(t){let e=t.target.closest("[data-datatable-select-row]");if(!e)return;let i=e.closest("[data-datatable-row]"),s=e.closest("[data-datatable-card]"),r=i?.id||s?.dataset.datatableCardFor;r&&(e.checked?this._selectedIds.add(r):this._selectedIds.delete(r),this._render(),this._trigger("select"))}_handleBulkClick(t){if(t.target.closest("[data-datatable-bulk-clear]")){this._clearSelection();return}let e=t.target.closest("[data-datatable-bulk-update]");if(e){let s=e.dataset.datatableBulkUpdate,r=e.dataset.datatableBulkUpdateValue;this._applyBulkUpdate(s,r,e);return}let i=t.target.closest("[data-datatable-bulk-action]");if(i){let s=i.dataset.datatableBulkAction;if(s==="delete"){this._applyBulkDelete();return}this._trigger("bulk-".concat(s),{ids:this.getSelectedIds()})}}_clearSelection(){this._hideBulkTooltips({blur:!0}),this._selectedIds.clear(),this._render(),this._trigger("select")}_applyBulkUpdate(t,e,i){let s=i.querySelector("svg")?.cloneNode(!0),r=i.querySelector("span")?.textContent?.trim()??e;this._selectedIds.forEach(n=>{let o=this._rows.find(m=>m.element.id===n);if(!o)return;o.element.setAttribute("data-datatable-facet-".concat(t),e),o.facets[t]=e;let c=o.element.querySelector('[data-datatable-column="'.concat(t,'"]'));if(!c)return;let l=c.querySelector("[data-datatable-cell-label]");l?l.textContent=r:c.textContent=r;let h=c.querySelector("svg");h&&s&&h.replaceWith(s.cloneNode(!0));let _=o.cardElement?.querySelector('[data-datatable-detail-column="'.concat(t,'"] .datatable-card-value'));_&&(_.innerHTML=c.innerHTML)}),this._render(),this._trigger("bulk-update",{key:t,value:e,ids:this.getSelectedIds()})}_applyBulkDelete(){let t=this.getSelectedIds();t.forEach(e=>{let i=this._rows.findIndex(s=>s.element.id===e);i!==-1&&(this._rows[i].element.remove(),this._rows[i].cardElement?.remove(),this._rows.splice(i,1))}),this._selectedIds.clear(),this._render(),this._trigger("bulk-delete",{ids:t})}_handlePageClick(t){let e=t.target.closest("[data-datatable-page-go]");if(e){this._currentPage=Number(e.dataset.datatablePageGo),this._render();return}if(t.target.closest("[data-datatable-page-first]")){this._currentPage=1,this._render();return}if(t.target.closest("[data-datatable-page-prev]")){this._currentPage-=1,this._render();return}if(t.target.closest("[data-datatable-page-next]")){this._currentPage+=1,this._render();return}t.target.closest("[data-datatable-page-last]")&&(this._currentPage=this._pageCount(this._visibleRows().length),this._render())}_setPageSize(t){let e=Number(t);!Number.isFinite(e)||e<=0||(this._pageSize=e,this._element.dataset.datatablePageSize=String(e),this._currentPage=1,this._render())}_bindEvents(){let t=this._element.querySelector("[data-datatable-search]");this._listen(t,"input",s=>{this._searchTerm=M(s.target.value),this._currentPage=1,this._render(),this._trigger("filter")}),this._listen(t,"keydown",s=>{if(s.key!=="Enter")return;s.preventDefault();let r=this._element.querySelector("[data-datatable-filter-menu-trigger]"),n=this._bootstrap("Dropdown");r&&n&&n.getOrCreateInstance(r).hide()}),this._listen(this._element,"click",s=>{this._handleFilterPickerClick(s),this._handleFilterOptionClick(s),this._handleFilterToggleClick(s),this._handleFacetClick(s),this._handleColumnToggleClick(s),this._handlePageClick(s),this._handleBulkClick(s),s.target.closest("[data-datatable-empty-reset]")&&this._handleReset(),s.target.closest("[data-datatable-select-row]")&&this._handleSelectRow(s)}),this._listen(this._document,"click",s=>this._handleSortAction(s)),this._listen(this._document,"keydown",s=>{s.key==="Escape"&&this._selectedIds.size>0&&this._clearSelection()}),this._listen(this._element,"show.bs.dropdown",s=>{this._reparentRowActionMenu(s.target),this._reparentSortMenu(s.target);let r=this._bootstrap("Tooltip")?.getInstance(s.target);r?.hide(),r?.disable()}),this._listen(this._element,"hidden.bs.dropdown",s=>{this._restoreRowActionMenuForTrigger(s.target),this._restoreSortMenuForTrigger(s.target),this._bootstrap("Tooltip")?.getInstance(s.target)?.enable(),s.target.matches("[data-datatable-filter-menu-trigger]")&&this._showFilterPickerPanel()}),this._element.querySelectorAll("[data-datatable-filter-option-search]").forEach(s=>{this._listen(s,"input",r=>this._handleFilterOptionSearch(r)),this._listen(s,"keydown",r=>this._handleFilterOptionSearchKeydown(r))}),this._element.querySelectorAll("[data-datatable-facet-search]").forEach(s=>{this._listen(s,"input",r=>this._handleFacetSearch(r)),this._listen(s,"keydown",r=>this._handleFacetSearchKeydown(r))});let e=this._element.querySelector("[data-datatable-reset]");this._listen(e,"click",()=>this._handleReset()),this._element.querySelectorAll("[data-datatable-select-all]").forEach(s=>{this._listen(s,"change",r=>this._handleSelectAll(r))});let i=this._element.querySelector("[data-datatable-page-size-select]");this._listen(i,"change",s=>this._setPageSize(s.target.value)),this._element.querySelectorAll("[data-datatable-page-size-option]").forEach(s=>{this._listen(s,"click",()=>{this._setPageSize(s.dataset.datatablePageSizeOption)})})}};var $=new WeakMap,z=new WeakMap,K=new WeakMap,A="en",he=1440*60*1e3,Kt=new Date(2026,7,16),F=8;function bt(a,t){return a?.nodeType===1&&!!a.matches?.(t)}function b(a,t,e,i,s){t&&(t.addEventListener(e,i,s),a.push({target:t,type:e,handler:i,options:s}))}function I(a){a.forEach(({target:t,type:e,handler:i,options:s})=>{t.removeEventListener(e,i,s)}),a.length=0}function g(a){if(!a)return null;if(a instanceof Date)return Number.isNaN(a.getTime())?null:new Date(a.getFullYear(),a.getMonth(),a.getDate());if(typeof a=="number")return g(new Date(a));let t=String(a).trim(),e=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t);if(e){let i=new Date(Number(e[1]),Number(e[2])-1,Number(e[3]));return i.getFullYear()===Number(e[1])&&i.getMonth()===Number(e[2])-1&&i.getDate()===Number(e[3])?i:null}return null}function Et(a){return String(a).padStart(2,"0")}function y(a){return"".concat(a.getFullYear(),"-").concat(Et(a.getMonth()+1),"-").concat(Et(a.getDate()))}function S(a,t){return!a||!t?0:a.getTime()-t.getTime()}function T(a,t){return!!(a&&t&&y(a)===y(t))}function x(a,t){return new Date(a.getFullYear(),a.getMonth(),a.getDate()+t)}function pt(a,t){let e=new Date(a.getFullYear(),a.getMonth()+t,1),i=Math.min(a.getDate(),mt(e.getFullYear(),e.getMonth()));return new Date(e.getFullYear(),e.getMonth(),i)}function ot(a=A){try{if(typeof Intl<"u"&&typeof Intl.Locale=="function"){let t=new Intl.Locale(a||A),e=t.weekInfo||t.getWeekInfo?.();if(Number.isInteger(e?.firstDay))return e.firstDay%7}}catch{}return 0}function Ht(a=A){let t=ot(a);return Array.from({length:7},(e,i)=>x(Kt,(t+i)%7))}function C(a){return new Date(a.getFullYear(),a.getMonth(),1)}function mt(a,t){return new Date(a,t+1,0).getDate()}function Wt(a,t,e){return t&&S(a,t)<0?new Date(t):e&&S(a,e)>0?new Date(e):a}function Yt(a){if(Array.isArray(a))return a.map(g).filter(Boolean).map(y);if(!a)return[];let t=String(a).trim();if(!t)return[];try{let e=JSON.parse(t);if(Array.isArray(e))return e.map(g).filter(Boolean).map(y)}catch{}return t.split(",").map(g).filter(Boolean).map(y)}function q(a,t=A){return a?new Intl.DateTimeFormat(t||A,{month:"short",day:"numeric",year:"numeric"}).format(a):""}function At(a,t=A){return new Intl.DateTimeFormat(t||A,{month:"long",year:"numeric"}).format(a)}function ft(a,t,e=A){if(a)return t==="yyyy-mm-dd"?y(a):t?q(a,e):new Date(a)}function yt(a,t={}){let e=a.dataset||{},i=t.locale||e.datepickerLocale||e.calendarLocale||A,s=g(t.minDate||e.calendarMinDate||e.datepickerMinDate),r=g(t.maxDate||e.calendarMaxDate||e.datepickerMaxDate);return{locale:i,mode:t.mode||e.calendarMode||e.datepickerMode||"single",placeholder:t.placeholder||e.datepickerPlaceholder||"Pick a date",value:t.value||e.calendarValue||e.datepickerValue||"",startValue:t.startValue||e.calendarStartValue||e.datepickerStartValue||"",endValue:t.endValue||e.calendarEndValue||e.datepickerEndValue||"",minDate:s,maxDate:r,disabledDates:Yt(t.disabledDates||e.calendarDisabledDates||e.datepickerDisabledDates),captionLayout:t.captionLayout||e.calendarCaptionLayout||"",showPresets:t.showPresets??(e.calendarShowPresets==="true"||e.datepickerShowPresets==="true")}}function k(a,t,e,i={},s=!1){return a.dispatchEvent(new t.CustomEvent(e,{bubbles:!0,cancelable:s,detail:i}))}function gt(a,t){a&&(a.value=t||"")}function Tt(a,t){a&&(a.value=t||"")}function wt(a,t,e){if(e){a.dataset.invalid="true",t.classList.add("is-invalid"),t.setAttribute("aria-invalid","true");return}delete a.dataset.invalid,t.classList.remove("is-invalid"),t.removeAttribute("aria-invalid")}function It(a,t,e){e?.required&&e.checkValidity()&&wt(a,t,!1)}function Ct(a,t,e){return e<t?t:Math.min(Math.max(a,t),e)}function Ut(a,t,e){let i=a?.ownerDocument?.defaultView||window,s=a?i.getComputedStyle(a).getPropertyValue(t).trim():"",r=Number.parseFloat(s);if(!Number.isFinite(r))return e;if(s.endsWith("rem")){let n=a.ownerDocument.documentElement,o=Number.parseFloat(i.getComputedStyle(n).fontSize);return Number.isFinite(o)?r*o:e}if(s.endsWith("em")){let n=Number.parseFloat(i.getComputedStyle(a).fontSize);return Number.isFinite(n)?r*n:e}return Number.isFinite(r)?r:e}function H(a,t){return!!(t&&(a._element.contains(t)||a._popover.contains(t)))}function xt(a){let e=E(a._trigger)?.getAttribute("data-bs-theme")||null,i=a._document.defaultView?.getComputedStyle(a._trigger).direction;e?a._popover.setAttribute("data-bs-theme",e):a._popover.removeAttribute("data-bs-theme"),i==="ltr"||i==="rtl"?a._popover.setAttribute("dir",i):a._popover.removeAttribute("dir")}function Gt(a){let t=a._popover,e=E(a._trigger),i=P(e)||a._document.body||a._document.documentElement;if(i){if(a._popoverPortal?.portal===i&&t.parentElement===i){xt(a);return}ht(a),a._popoverPortal={parent:t.parentNode,nextSibling:t.nextSibling,owner:e,portal:i,hadTheme:t.hasAttribute("data-bs-theme"),theme:t.getAttribute("data-bs-theme"),hadDirection:t.hasAttribute("dir"),direction:t.getAttribute("dir")},i.appendChild(t),xt(a)}}function ht(a){let t=a._popoverPortal;if(!t)return;let e=a._popover;t.owner?.isConnected===!1?e.remove():t.parent?.isConnected?t.nextSibling?.parentNode===t.parent?t.parent.insertBefore(e,t.nextSibling):t.parent.appendChild(e):e.remove(),t.hadTheme?e.setAttribute("data-bs-theme",t.theme):e.removeAttribute("data-bs-theme"),t.hadDirection?e.setAttribute("dir",t.direction):e.removeAttribute("dir"),a._popoverPortal=null}function jt(a,t,e,i){let s=Ut(e,"--moo-datepicker-popover-offset",6),r=getComputedStyle(a).direction;t.style.position="fixed",t.style.inset="auto",t.style.right="auto",t.style.bottom="auto",t.style.maxHeight="",t.style.overflowY="";let n=a.getBoundingClientRect(),o=t.getBoundingClientRect(),c=i.innerWidth,l=i.innerHeight,h=r==="rtl"?n.right-o.width:n.left,_=Ct(h,F,c-o.width-F),m=n.bottom+s<=l?l-n.bottom-s-F:0,p=n.top-s-F,f=o.height>m&&p>m,u=f?"top":"bottom",d=Math.max(0,f?p:m),D=Math.min(o.height,d),w=f?n.top-s-D:n.bottom+s;t.style.left="".concat(Math.round(_),"px"),t.style.top="".concat(Math.round(Ct(w,F,l-D-F)),"px"),d>0&&(t.style.maxHeight="".concat(Math.floor(d),"px"),t.style.overflowY="auto"),t.dataset.datepickerPlacement=u}function Xt(a){a.style.position="",a.style.inset="",a.style.right="",a.style.bottom="",a.style.left="",a.style.top="",a.style.maxHeight="",a.style.overflowY="",delete a.dataset.datepickerPlacement}function Pt(a){I(a._floatingListeners),Gt(a);let t=()=>{a.isOpen()&&jt(a._trigger,a._popover,a._element,a._window)};a._positionPopover=t,t(),b(a._floatingListeners,a._window,"resize",t),b(a._floatingListeners,a._window,"scroll",t,!0),b(a._floatingListeners,a._document,"scroll",t,!0)}function lt(a){I(a._floatingListeners),a._positionPopover=null,Xt(a._popover),ht(a)}function Jt(a,t){return new Intl.DateTimeFormat(t||A,{month:"short"}).format(new Date(2026,a,1))}function Qt(a,t,e){let i=a?a.getFullYear():e.getFullYear()-100,s=t?t.getFullYear():e.getFullYear()+20,r=[];for(let n=i;n<=s;n+=1)r.push(n);return r}function Mt(a,t,e=""){let i=a.createElement("span");return i.className=e,i.setAttribute("aria-hidden","true"),i.textContent=t,i}var O=class a{static getInstance(t){return t?.nodeType===1&&z.get(t)||null}static getOrCreateInstance(t,e={}){return a.getInstance(t)||new a(t,e)}constructor(t,e={}){if(!bt(t,"[data-calendar]"))throw new TypeError("MooCalendar requires a [data-calendar] root element.");let i=z.get(t);if(i)return i;this._element=t,this._document=t.ownerDocument,this._window=this._document.defaultView||window,this._listeners=[],this._disposed=!1,this._config=yt(t,e),this._mode=this._config.mode==="range"?"range":"single",this._disabledDates=new Set(this._config.disabledDates),this._selectedDate=g(this._config.value),this._rangeStart=g(this._config.startValue),this._rangeEnd=g(this._config.endValue),this._activeDate=this._nearestEnabledDate(this._rangeStart||this._selectedDate||new Date),this._viewDate=C(this._activeDate),this._captionId=this._element.id?"".concat(this._element.id,"-caption"):"moo-calendar-caption-".concat(Math.random().toString(36).slice(2)),this._labelId=this._element.id?"".concat(this._element.id,"-label"):"moo-calendar-label-".concat(Math.random().toString(36).slice(2)),z.set(t,this),this._bindEvents(),this._render()}dispose(){this._disposed||(this._disposed=!0,I(this._listeners),this._element.replaceChildren(),z.get(this._element)===this&&z.delete(this._element))}getDate(t=void 0){return this._mode==="range"?this.getDates(t):ft(this._selectedDate,t,this._config.locale)}getDates(t=void 0){return[ft(this._rangeStart,t,this._config.locale),ft(this._rangeEnd,t,this._config.locale)]}setDate(t,e={}){if(this._mode!=="single")return!1;let i=g(t);return!i||this._isDisabled(i)?!1:(this._selectedDate=i,this._activeDate=i,this._viewDate=C(i),this._render(),e.emit!==!1&&this._emitChange(!0),!0)}setDates(t,e,i={}){if(this._mode!=="range")return!1;let s=g(t),r=g(e);return s&&this._isDisabled(s)||r&&this._isDisabled(r)?!1:(this._rangeStart=s,this._rangeEnd=r,this._rangeStart&&this._rangeEnd&&S(this._rangeStart,this._rangeEnd)>0&&([this._rangeStart,this._rangeEnd]=[this._rangeEnd,this._rangeStart]),this._activeDate=this._rangeEnd||this._rangeStart||this._activeDate,this._viewDate=C(this._activeDate),this._render(),i.emit!==!1&&this._emitChange(!!(this._rangeStart&&this._rangeEnd)),!0)}clear(t={}){this._selectedDate=null,this._rangeStart=null,this._rangeEnd=null,this._render(),t.emit!==!1&&this._emitChange(!1)}focusActiveDay(){this._dayButton(this._activeDate)?.focus()}_bindEvents(){b(this._listeners,this._element,"click",t=>{let e=t.target,i=e.closest?.("[data-calendar-day]"),s=e.closest?.("[data-calendar-prev]"),r=e.closest?.("[data-calendar-next]"),n=e.closest?.("[data-calendar-preset]");s?this._changeMonth(-1,!0):r?this._changeMonth(1,!0):n?this._selectPreset(n.dataset.calendarPreset):i&&this._selectDate(g(i.dataset.calendarDay),!0)}),b(this._listeners,this._element,"keydown",t=>{t.target.closest?.("[data-calendar-day]")&&this._handleDayKeydown(t)}),b(this._listeners,this._element,"change",t=>{t.target.matches?.("[data-calendar-month]")&&this._setActiveMonth(this._viewDate.getFullYear(),Number(t.target.value),!0),t.target.matches?.("[data-calendar-year]")&&this._setActiveMonth(Number(t.target.value),this._viewDate.getMonth(),!0)})}_emitChange(t){k(this._element,this._window,"change.moo.calendar",{date:this._selectedDate?new Date(this._selectedDate):void 0,value:this._selectedDate?y(this._selectedDate):"",startDate:this._rangeStart?new Date(this._rangeStart):void 0,endDate:this._rangeEnd?new Date(this._rangeEnd):void 0,startValue:this._rangeStart?y(this._rangeStart):"",endValue:this._rangeEnd?y(this._rangeEnd):"",complete:t})}_changeMonth(t,e){let i=C(pt(this._viewDate,t));this._setActiveMonth(i.getFullYear(),i.getMonth(),e)}_setActiveMonth(t,e,i=!1){let s=Math.min(this._activeDate.getDate(),mt(t,e));this._activeDate=this._nearestEnabledDate(new Date(t,e,s)),this._viewDate=C(this._activeDate),this._render(),i&&this.focusActiveDay()}_selectPreset(t){if(!t)return;let e=new Date,i={today:0,tomorrow:1,"in-3-days":3,"in-a-week":7,"in-2-weeks":14};t in i&&this._selectDate(x(e,i[t]),!0)}_handleDayKeydown(t){let e=t.target.closest?.("[data-calendar-day]"),i=g(e?.dataset?.calendarDay);i&&S(i,this._activeDate)!==0&&(this._activeDate=i);let s={ArrowRight:1,ArrowLeft:-1,ArrowDown:7,ArrowUp:-7},r=null;if(t.key in s)r=x(this._activeDate,s[t.key]);else if(t.key==="Home"){let n=ot(this._config.locale),o=(this._activeDate.getDay()-n+7)%7;r=x(this._activeDate,-o)}else if(t.key==="End"){let n=ot(this._config.locale),o=(this._activeDate.getDay()-n+7)%7;r=x(this._activeDate,6-o)}else if(t.key==="PageUp")r=pt(this._activeDate,-1);else if(t.key==="PageDown")r=pt(this._activeDate,1);else if(t.key==="Enter"||t.key===" "||t.key==="Spacebar"){t.preventDefault(),this._selectDate(this._activeDate,!0);return}else return;t.preventDefault(),this._setActiveDate(r,!0,S(r,this._activeDate)<0?-1:1)}_setActiveDate(t,e=!1,i=0){let s=i===0?this._nearestEnabledDate(t):this._nextEnabledDate(t,i);this._activeDate=s,this._viewDate=C(s),this._render(),e&&this.focusActiveDay()}_nextEnabledDate(t,e){let i=g(t);if(!i)return this._activeDate;let s=e<0?-1:1;for(let r=0;r<366&&!(this._config.minDate&&S(i,this._config.minDate)<0||this._config.maxDate&&S(i,this._config.maxDate)>0);r+=1){if(!this._isDisabled(i))return i;i=x(i,s)}return this._activeDate}_nearestEnabledDate(t){let e=Wt(g(t)||new Date,this._config.minDate,this._config.maxDate);if(!this._isDisabled(e))return e;let i=C(e),s=mt(i.getFullYear(),i.getMonth());for(let r=1;r<=s;r+=1){let n=new Date(i.getFullYear(),i.getMonth(),r);if(!this._isDisabled(n))return n}return e}_selectDate(t,e){if(!(!t||this._isDisabled(t))){if(this._activeDate=t,this._viewDate=C(t),this._mode==="range"){!this._rangeStart||this._rangeEnd||S(t,this._rangeStart)<0?(this._rangeStart=t,this._rangeEnd=null):this._rangeEnd=t,this._render(),e&&this._emitChange(!!(this._rangeStart&&this._rangeEnd));return}this._selectedDate=t,this._render(),e&&this._emitChange(!0)}}_isDisabled(t){return!t||this._config.minDate&&S(t,this._config.minDate)<0||this._config.maxDate&&S(t,this._config.maxDate)>0?!0:this._disabledDates.has(y(t))}_isSelected(t){return this._mode==="range"?T(t,this._rangeStart)||T(t,this._rangeEnd):T(t,this._selectedDate)}_rangeState(t){return this._mode!=="range"||!this._rangeStart?"":T(t,this._rangeStart)?"start":T(t,this._rangeEnd)?"end":this._rangeStart&&this._rangeEnd&&S(t,this._rangeStart)>0&&S(t,this._rangeEnd)<0?"middle":""}_dayButton(t){return this._element.querySelector('[data-calendar-day="'.concat(y(t),'"]'))}_render(){let t=this._document,e=t.createDocumentFragment(),i=t.createElement("div");i.className="moo-calendar__header";let s=t.createElement("button");s.className="btn btn-ghost btn-icon-sm moo-calendar__nav",s.type="button",s.dataset.calendarPrev="true",s.setAttribute("aria-label","Previous month"),s.appendChild(Mt(t,"\u2039","moo-calendar__nav-icon"));let r=t.createElement("button");r.className="btn btn-ghost btn-icon-sm moo-calendar__nav",r.type="button",r.dataset.calendarNext="true",r.setAttribute("aria-label","Next month"),r.appendChild(Mt(t,"\u203A","moo-calendar__nav-icon"));let n=t.createElement("div");if(n.className="moo-calendar__caption",n.id=this._captionId,n.setAttribute("aria-live","polite"),this._config.captionLayout==="dropdown"){let p=t.createElement("select");p.className="moo-calendar__select",p.dataset.calendarMonth="true",p.setAttribute("aria-label","Month");for(let u=0;u<12;u+=1){let d=t.createElement("option");d.value=String(u),d.textContent=Jt(u,this._config.locale),d.selected=u===this._viewDate.getMonth(),p.appendChild(d)}let f=t.createElement("select");f.className="moo-calendar__select",f.dataset.calendarYear="true",f.setAttribute("aria-label","Year"),Qt(this._config.minDate,this._config.maxDate,this._viewDate).forEach(u=>{let d=t.createElement("option");d.value=String(u),d.textContent=String(u),d.selected=u===this._viewDate.getFullYear(),f.appendChild(d)}),n.append(p,f)}else n.textContent=At(this._viewDate,this._config.locale);i.append(s,n,r),e.appendChild(i);let o=t.createElement("div");o.id=this._labelId,o.className="visually-hidden",o.textContent=this._element.getAttribute("aria-label")||At(this._viewDate,this._config.locale),e.appendChild(o);let c=t.createElement("div");c.className="moo-calendar__weekdays",c.setAttribute("role","row"),Ht(this._config.locale).forEach(p=>{let f=t.createElement("span");f.className="moo-calendar__weekday",f.setAttribute("role","columnheader"),f.textContent=new Intl.DateTimeFormat(this._config.locale,{weekday:"narrow"}).format(p),c.appendChild(f)});let l=t.createElement("div");l.className="moo-calendar__grid",l.setAttribute("role","grid"),l.setAttribute("aria-labelledby",this._labelId),l.appendChild(c);let h=C(this._viewDate),_=ot(this._config.locale),m=x(h,-((h.getDay()-_+7)%7));for(let p=0;p<6;p+=1){let f=t.createElement("div");f.className="moo-calendar__week",f.setAttribute("role","row");for(let u=0;u<7;u+=1){let d=x(m,p*7+u),D=y(d),w=t.createElement("div");w.className="moo-calendar__cell",w.setAttribute("role","gridcell");let v=t.createElement("button");v.className="moo-calendar__day",v.type="button",v.dataset.calendarDay=D,v.textContent=String(d.getDate()),v.tabIndex=T(d,this._activeDate)?0:-1,v.setAttribute("aria-label",q(d,this._config.locale));let St=this._isSelected(d);v.dataset.calendarSelected=String(St),w.setAttribute("aria-selected",St?"true":"false"),d.getMonth()!==this._viewDate.getMonth()&&(v.dataset.calendarOutside="true"),T(d,new Date)&&(v.dataset.calendarToday="true",v.setAttribute("aria-current","date"));let Dt=this._rangeState(d);Dt&&(v.dataset.calendarRange=Dt),this._isDisabled(d)&&(v.disabled=!0,v.setAttribute("aria-disabled","true")),w.appendChild(v),f.appendChild(w)}l.appendChild(f)}if(e.appendChild(l),this._config.showPresets){let p=t.createElement("div");p.className="moo-calendar__presets",[["today","Today"],["tomorrow","Tomorrow"],["in-3-days","In 3 days"],["in-a-week","In a week"],["in-2-weeks","In 2 weeks"]].forEach(([f,u])=>{let d=t.createElement("button");d.className="btn btn-outline-secondary btn-sm moo-calendar__preset",d.type="button",d.dataset.calendarPreset=f,d.textContent=u,p.appendChild(d)}),e.appendChild(p)}this._element.classList.add("moo-calendar"),this._element.dataset.calendar=this._element.dataset.calendar||"",this._element.dataset.calendarMode=this._mode,this._element.dataset.calendarActiveDate=y(this._activeDate),this._mode==="single"&&this._selectedDate?this._element.dataset.calendarValue=y(this._selectedDate):delete this._element.dataset.calendarValue,this._mode==="range"?(this._element.dataset.calendarStartValue=this._rangeStart?y(this._rangeStart):"",this._element.dataset.calendarEndValue=this._rangeEnd?y(this._rangeEnd):""):(delete this._element.dataset.calendarStartValue,delete this._element.dataset.calendarEndValue),this._element.replaceChildren(e)}},W=class a{static getInstance(t){return t?.nodeType===1&&$.get(t)||null}static getOrCreateInstance(t,e={}){return a.getInstance(t)||new a(t,e)}constructor(t,e={}){if(!bt(t,"[data-datepicker]"))throw new TypeError("MooDatepicker requires a [data-datepicker] root element.");let i=$.get(t);if(i)return i;if(this._element=t,this._document=t.ownerDocument,this._window=this._document.defaultView||window,this._listeners=[],this._floatingListeners=[],this._disposed=!1,this._positionPopover=null,this._popoverPortal=null,this._trigger=t.querySelector("[data-datepicker-trigger]"),this._popover=t.querySelector("[data-datepicker-popover]"),this._label=t.querySelector("[data-datepicker-label]"),this._input=t.querySelector("[data-datepicker-input]")||t.querySelector('input[type="hidden"]'),this._validationInput=t.querySelector("[data-datepicker-validation]"),this._calendarRoot=t.querySelector("[data-calendar]"),!this._trigger||!this._popover||!this._label||!this._input||!this._calendarRoot)throw new TypeError("MooDatepicker requires a trigger, popover, calendar, and hidden input.");this._config=yt(t,{...e,value:e.value||this._input.value||t.dataset.datepickerValue}),this._placeholder=this._config.placeholder,this._defaultValue=this._input.defaultValue||this._input.getAttribute("value")||"",this.calendar=O.getOrCreateInstance(this._calendarRoot,{...this._config,mode:"single",value:this._input.value||this._config.value}),$.set(t,this),this._syncFromCalendar(),this._bindEvents()}dispose(){this._disposed||(this._disposed=!0,I(this._listeners),this.hide(!1),lt(this),ht(this),I(this._floatingListeners),this.calendar?.dispose(),$.get(this._element)===this&&$.delete(this._element))}show(){this._trigger.disabled||this._element.dataset.datepickerDisabled==="true"||this.isOpen()||k(this._element,this._window,"show.moo.datepicker",{},!0)&&(this._popover.hidden=!1,this._popover.classList.add("show"),Pt(this),this._trigger.setAttribute("aria-expanded","true"),this.calendar.focusActiveDay(),k(this._element,this._window,"shown.moo.datepicker"))}hide(t=!0){this.isOpen()&&k(this._element,this._window,"hide.moo.datepicker",{},!0)&&(this._popover.hidden=!0,this._popover.classList.remove("show"),lt(this),this._trigger.setAttribute("aria-expanded","false"),t&&this._trigger.focus({preventScroll:!0}),k(this._element,this._window,"hidden.moo.datepicker"))}toggle(){this.isOpen()?this.hide():this.show()}isOpen(){return!this._popover.hidden}getDate(t=void 0){return this.calendar.getDate(t)}setDate(t,e={}){let i=this.calendar.setDate(t,{emit:!1});return i&&(this._syncFromCalendar(),e.emit!==!1&&this._emitChange()),i}clear(t={}){this.calendar.clear({emit:!1}),this._syncFromCalendar(),t.emit!==!1&&this._emitChange()}_bindEvents(){b(this._listeners,this._trigger,"click",()=>this.toggle()),b(this._listeners,this._popover,"keydown",e=>{e.key==="Escape"&&(e.preventDefault(),this.hide())}),b(this._listeners,this._document,"pointerdown",e=>{this.isOpen()&&!H(this,e.target)&&this._window.setTimeout(()=>{this.isOpen()&&!H(this,e.target)&&this.hide()},0)}),b(this._listeners,this._calendarRoot,"change.moo.calendar",e=>{this._syncFromCalendar(),this._emitChange(),e.detail.complete&&this.hide()});let t=this._input.form||this._element.closest("form");b(this._listeners,this._validationInput,"invalid",e=>{e.preventDefault(),wt(this._element,this._trigger,!0),this._trigger.focus({preventScroll:!0})}),b(this._listeners,t,"reset",()=>{this._window.setTimeout(()=>{this._defaultValue?this.setDate(this._defaultValue,{emit:!1}):this.clear({emit:!1})},0)})}_syncFromCalendar(){let t=this.calendar.getDate("yyyy-mm-dd")||"";gt(this._input,t),Tt(this._validationInput,t),It(this._element,this._trigger,this._validationInput),this._element.dataset.datepickerValue=t,this._label.dataset.datepickerEmpty=t?"false":"true",this._label.textContent=t?q(g(t),this._config.locale):this._placeholder}_emitChange(){k(this._element,this._window,"change.moo.datepicker",{date:this.getDate(),value:this.getDate("yyyy-mm-dd")||""})}},ct=class a{static getInstance(t){return t?.nodeType===1&&K.get(t)||null}static getOrCreateInstance(t,e={}){return a.getInstance(t)||new a(t,e)}constructor(t,e={}){if(!bt(t,"[data-datepicker-range]"))throw new TypeError("MooDateRangePicker requires a [data-datepicker-range] root element.");let i=K.get(t);if(i)return i;if(this._element=t,this._document=t.ownerDocument,this._window=this._document.defaultView||window,this._listeners=[],this._floatingListeners=[],this._disposed=!1,this._positionPopover=null,this._popoverPortal=null,this._trigger=t.querySelector("[data-datepicker-trigger]"),this._popover=t.querySelector("[data-datepicker-popover]"),this._label=t.querySelector("[data-datepicker-label]"),this._startInput=t.querySelector("[data-datepicker-range-start]"),this._endInput=t.querySelector("[data-datepicker-range-end]"),this._validationInput=t.querySelector("[data-datepicker-validation]"),this._calendarRoot=t.querySelector("[data-calendar]"),!this._trigger||!this._popover||!this._label||!this._startInput||!this._endInput||!this._calendarRoot)throw new TypeError("MooDateRangePicker requires a trigger, popover, calendar, and start/end hidden inputs.");this._config=yt(t,{...e,mode:"range",startValue:e.startValue||this._startInput.value||t.dataset.datepickerStartValue,endValue:e.endValue||this._endInput.value||t.dataset.datepickerEndValue}),this._placeholder=this._config.placeholder,this._defaultStartValue=this._startInput.defaultValue||this._startInput.getAttribute("value")||"",this._defaultEndValue=this._endInput.defaultValue||this._endInput.getAttribute("value")||"",this.calendar=O.getOrCreateInstance(this._calendarRoot,this._config),K.set(t,this),this._syncFromCalendar(),this._bindEvents()}dispose(){this._disposed||(this._disposed=!0,I(this._listeners),this.hide(!1),lt(this),ht(this),I(this._floatingListeners),this.calendar?.dispose(),K.get(this._element)===this&&K.delete(this._element))}show(){this._trigger.disabled||this._element.dataset.datepickerDisabled==="true"||this.isOpen()||k(this._element,this._window,"show.moo.datepicker",{},!0)&&(this._popover.hidden=!1,this._popover.classList.add("show"),Pt(this),this._trigger.setAttribute("aria-expanded","true"),this.calendar.focusActiveDay(),k(this._element,this._window,"shown.moo.datepicker"))}hide(t=!0){this.isOpen()&&k(this._element,this._window,"hide.moo.datepicker",{},!0)&&(this._popover.hidden=!0,this._popover.classList.remove("show"),lt(this),this._trigger.setAttribute("aria-expanded","false"),t&&this._trigger.focus({preventScroll:!0}),k(this._element,this._window,"hidden.moo.datepicker"))}toggle(){this.isOpen()?this.hide():this.show()}isOpen(){return!this._popover.hidden}getDates(t=void 0){return this.calendar.getDates(t)}setDates(t,e,i={}){let s=this.calendar.setDates(t,e,{emit:!1});return s&&(this._syncFromCalendar(),i.emit!==!1&&this._emitChange()),s}clear(t={}){this.calendar.clear({emit:!1}),this._syncFromCalendar(),t.emit!==!1&&this._emitChange()}_bindEvents(){b(this._listeners,this._trigger,"click",()=>this.toggle()),b(this._listeners,this._popover,"keydown",i=>{i.key==="Escape"&&(i.preventDefault(),this.hide())}),b(this._listeners,this._document,"pointerdown",i=>{this.isOpen()&&!H(this,i.target)&&this._window.setTimeout(()=>{this.isOpen()&&!H(this,i.target)&&this.hide()},0)});let t=()=>{this._window.setTimeout(()=>{this.isOpen()&&!H(this,this._document.activeElement)&&this.hide(!1)},0)};b(this._listeners,this._element,"focusout",t),b(this._listeners,this._popover,"focusout",t),b(this._listeners,this._calendarRoot,"change.moo.calendar",i=>{this._syncFromCalendar(),this._emitChange(),i.detail.complete?this.hide():this.calendar.focusActiveDay()});let e=this._startInput.form||this._element.closest("form");b(this._listeners,this._validationInput,"invalid",i=>{i.preventDefault(),wt(this._element,this._trigger,!0),this._trigger.focus({preventScroll:!0})}),b(this._listeners,e,"reset",()=>{this._window.setTimeout(()=>{this.setDates(this._defaultStartValue,this._defaultEndValue,{emit:!1})},0)})}_syncFromCalendar(){let[t="",e=""]=this.calendar.getDates("yyyy-mm-dd");gt(this._startInput,t||""),gt(this._endInput,e||""),Tt(this._validationInput,t&&e?"".concat(t," - ").concat(e):""),It(this._element,this._trigger,this._validationInput),this._element.dataset.datepickerStartValue=t||"",this._element.dataset.datepickerEndValue=e||"",this._label.dataset.datepickerEmpty=t?"false":"true",t&&e?this._label.textContent="".concat(q(g(t),this._config.locale)," - ").concat(q(g(e),this._config.locale)):t?this._label.textContent=q(g(t),this._config.locale):this._label.textContent=this._placeholder}_emitChange(){let[t,e]=this.getDates(),[i="",s=""]=this.getDates("yyyy-mm-dd");k(this._element,this._window,"change.moo.datepicker",{startDate:t,endDate:e,startValue:i,endValue:s})}};var dt=new WeakMap,Y=class a{static getInstance(t){return t?.nodeType===1&&dt.get(t)||null}static getOrCreateInstance(t,e={}){return a.getInstance(t)||new a(t,e)}constructor(t,e={}){if(t?.nodeType!==1||!t.matches('[data-slot="sidebar-wrapper"]'))throw new TypeError("Sidebar requires a [data-slot=sidebar-wrapper] root.");let i=dt.get(t);if(i)return i;this._element=t,this._document=t.ownerDocument,this._window=this._document.defaultView,this._documentElement=this._document.documentElement,this._root=E(t)||this._document.body||this._documentElement,this._sidebar=t.querySelector('[data-slot="sidebar"]'),this._config={breakpoint:"(min-width: 992px)",storagePrefix:"moo-sidebar:",keyboard:!0,...e},this._listeners=[],this._tooltipAnchors=new Set,this._flyout=null,this._flyoutOwner=null,this._offcanvas=null,this._offcanvasTrigger=null,dt.set(t,this),this._bindEvents(),this._restoreState(),this._scrollActiveItemIntoView(),this._element.setAttribute("data-sidebar-ready",""),this._observeDirection()}dispose(){this._listeners.forEach(({target:t,type:e,handler:i,options:s})=>{t.removeEventListener(e,i,s)}),this._listeners=[],this._directionObserver?.disconnect(),this._closeFlyouts(),this._element.querySelectorAll("[data-sidebar-dropdown-positioned]").forEach(t=>this._clearDropdownPosition(t)),this._element.querySelectorAll("[data-sidebar-tooltip]").forEach(t=>this._disposeTooltip(t)),this._offcanvas?.dispose(),this._offcanvas=null,this._offcanvasTrigger=null,this._element.removeAttribute("data-sidebar-ready"),dt.delete(this._element)}_listen(t,e,i,s){t?.addEventListener(e,i,s),t&&this._listeners.push({target:t,type:e,handler:i,options:s})}_bootstrap(t){return this._window.bootstrap?.[t]||null}_portalRoot(t=this._element){return P(E(t))||this._document.body||this._documentElement}_isDesktop(){return this._window.matchMedia(this._config.breakpoint).matches}_isCollapsed(){return this._isDesktop()&&this._sidebar?.dataset?.collapsible==="icon"&&this._element.dataset.sidebarState==="collapsed"}_trigger(t,e={}){return this._element.dispatchEvent(new this._window.CustomEvent("".concat(t,".moo.sidebar"),{bubbles:!0,cancelable:t==="show"||t==="hide",detail:e}))}_observeDirection(){let t=this._window.MutationObserver;t&&(this._directionObserver=new t(()=>{this._closeFlyouts(),this._syncTooltips()}),this._directionObserver.observe(this._documentElement,{attributes:!0,attributeFilter:["dir"]}))}_restoreState(){let t=this._element.dataset.sidebarKey,e=null;if(t)try{e=this._window.localStorage.getItem(this._config.storagePrefix+t)}catch{e=null}let i=e==="collapsed"||e==="expanded"?e:this._element.dataset.sidebarState==="collapsed"?"collapsed":"expanded";this._setState(i,!1,!1)}_scrollActiveItemIntoView(){let e=this._element.querySelector('[data-slot="sidebar-content"] a[data-slot="sidebar-menu-button"][aria-current="page"], [data-slot="sidebar-content"] a.sidebar-menu-button[aria-current="page"], [data-slot="sidebar-content"] a.sidebar-menu-button.active')||this._element.querySelector('[data-slot="sidebar-content"] [data-slot="sidebar-menu-button"][aria-current="page"], [data-slot="sidebar-content"] .sidebar-menu-button[aria-current="page"], [data-slot="sidebar-content"] .sidebar-menu-button.active'),i=e?.closest?.('[data-slot="sidebar-content"]');if(!e||!i||i.clientHeight<=0)return;let s=i.scrollHeight-i.clientHeight;if(s<=0)return;let r=i.getBoundingClientRect(),n=e.getBoundingClientRect();if(r.height<=0||n.height<=0)return;let o=i.scrollTop+n.top-r.top-(i.clientHeight-n.height)/2;i.scrollTop=Math.round(Math.min(Math.max(o,0),s))}_setState(t,e=!0,i=!0){let s=t==="collapsed"?"collapsed":"expanded",r=this._element.dataset.sidebarState;this._element.dataset.sidebarState=s;let n=this._element.dataset.sidebarKey;if(n==="catalog-shell"&&(this._root.dataset.sidebarCatalogState=s),e&&n)try{this._window.localStorage.setItem(this._config.storagePrefix+n,s)}catch{}this._syncControls(),s==="expanded"&&this._element.querySelectorAll(".sidebar-menu-item").forEach(o=>this._resetFlyoutTrigger(o)),this._syncTooltips(),i&&r!==s&&this._trigger("change",{state:s,previousState:r||null})}_toggle(){this._setState(this._element.dataset.sidebarState==="collapsed"?"expanded":"collapsed")}_syncControls(){let t=this._isDesktop()?this._element.dataset.sidebarState==="expanded":this._sidebar?.classList.contains("show")||!1;this._element.querySelectorAll("[data-sidebar-trigger], [data-sidebar-rail]").forEach(e=>e.setAttribute("aria-expanded",String(t)))}_resetFlyoutTrigger(t,e=null){let i=t?.querySelector(":scope > .sidebar-menu-sub-trigger"),s=t?.querySelector(":scope > .sidebar-menu-sub");i&&s&&i.setAttribute("aria-expanded",String(e??s.classList.contains("show")))}_clearDropdownPosition(t){let e=t?.matches?.(".sidebar-menu-item")?t:t?.closest?.(".sidebar-menu-item");e&&(delete e.dataset.sidebarDropdownPositioned,e.style.removeProperty("--moo-sidebar-dropdown-block-start"),e.style.removeProperty("--moo-sidebar-dropdown-block-end"),e.style.removeProperty("--moo-sidebar-dropdown-left"),e.style.removeProperty("--moo-sidebar-dropdown-right"))}_closeDropdowns(t=null){let e=this._bootstrap("Dropdown");this._element.querySelectorAll('[data-bs-toggle="dropdown"][aria-expanded="true"]').forEach(i=>{i!==t&&(e?e.getOrCreateInstance(i).hide():(i.setAttribute("aria-expanded","false"),i.closest(".dropdown")?.querySelector(".dropdown-menu.show")?.classList.remove("show"),this._clearDropdownPosition(i)))})}_positionDropdown(t){let e=t?.closest?.(".sidebar-menu-item"),i=t?.classList.contains("sidebar-menu-button--workspace")&&t.closest('[data-slot="sidebar-header"]'),s=t?.closest(".sidebar-menu-item--account")&&t.closest('[data-slot="sidebar-footer"]');if(!t||!e||!(i||s)||!this._isDesktop()){this._clearDropdownPosition(t);return}this._closeFlyouts();let r=t.getBoundingClientRect(),n=4;if((t.closest('[data-slot="sidebar"]')?.dataset.side||"left")==="right"){let l=this._window.innerWidth-r.left+n;e.style.setProperty("--moo-sidebar-dropdown-right","".concat(Math.round(l),"px")),e.style.removeProperty("--moo-sidebar-dropdown-left")}else{let l=r.right+n;e.style.setProperty("--moo-sidebar-dropdown-left","".concat(Math.round(l),"px")),e.style.removeProperty("--moo-sidebar-dropdown-right")}i?(e.style.setProperty("--moo-sidebar-dropdown-block-start","".concat(Math.round(r.bottom+n),"px")),e.style.removeProperty("--moo-sidebar-dropdown-block-end")):(e.style.setProperty("--moo-sidebar-dropdown-block-end","".concat(Math.round(this._window.innerHeight-r.top+n),"px")),e.style.removeProperty("--moo-sidebar-dropdown-block-start")),e.dataset.sidebarDropdownPositioned=""}_removeFlyoutPortal(){this._flyout?.remove(),this._flyoutOwner&&this._resetFlyoutTrigger(this._flyoutOwner,!1),this._flyout=null,this._flyoutOwner=null}_closeFlyouts(){this._removeFlyoutPortal(),this._element.querySelectorAll(".sidebar-menu-item--flyout-open").forEach(t=>{t.classList.remove("sidebar-menu-item--flyout-open"),t.style.removeProperty("--moo-sidebar-flyout-block-start"),t.style.removeProperty("--moo-sidebar-flyout-left"),this._resetFlyoutTrigger(t,!1)})}_openFlyout(t){let e=t?.querySelector(":scope > .sidebar-menu-sub"),i=t?.querySelector(":scope > .sidebar-menu-sub-trigger");if(!t||!e||!this._isCollapsed()||this._flyoutOwner===t&&this._flyout)return;this._closeDropdowns(),this._closeFlyouts();let s=t.getBoundingClientRect(),r=this._sidebar,n=r?.getBoundingClientRect()||s,o=4,c=e.cloneNode(!0);c.removeAttribute("id"),c.classList.remove("collapse","show","collapsing"),c.classList.add("sidebar-menu-flyout"),c.dataset.sidebarFlyout="",c.removeAttribute("style"),c.style.setProperty("--moo-sidebar-flyout-block-start","".concat(Math.round(s.top),"px"));let l=r?.dataset.side||"left";this._portalRoot(t).appendChild(c);let h=c.getBoundingClientRect().width,_=l==="right"?n.left-h-o:n.right+o,m=Math.max(0,Math.min(this._window.innerWidth-h,_));c.style.setProperty("--moo-sidebar-flyout-left","".concat(Math.round(m),"px")),this._flyout=c,this._flyoutOwner=t,t.classList.add("sidebar-menu-item--flyout-open"),i?.setAttribute("aria-expanded","true")}_tooltipAnchor(t){return t.closest("li")||t}_isIdentityTrigger(t){return t.closest(".sidebar-menu-item--account")||t.classList.contains("sidebar-menu-button--workspace")}_disposeTooltip(t){let e=this._bootstrap("Tooltip");if(!e||!t)return;let i=this._tooltipAnchor(t);e.getInstance(i)?.dispose(),this._tooltipAnchors.delete(i),i.removeAttribute("title"),i.removeAttribute("data-bs-title"),i.removeAttribute("data-bs-original-title"),i.removeAttribute("aria-describedby")}_syncTooltips(){let t=this._bootstrap("Tooltip");if(!t)return;let e=this._isCollapsed(),s=(this._sidebar?.dataset.side||"left")==="right"?"left":"right";this._element.querySelectorAll("[data-sidebar-tooltip]").forEach(r=>{if(this._disposeTooltip(r),!e||this._isIdentityTrigger(r)||r.closest(".sidebar-menu-item")?.querySelector(":scope > .sidebar-menu-sub"))return;let n=this._tooltipAnchor(r);new t(n,{title:r.getAttribute("data-sidebar-tooltip"),placement:s,offset:[0,8],container:this._portalRoot(r),trigger:"hover focus"}),this._tooltipAnchors.add(n)})}_bindEvents(){this._listen(this._sidebar,"shown.bs.offcanvas",()=>this._syncControls()),this._listen(this._sidebar,"hidden.bs.offcanvas",()=>{this._syncControls();let t=this._offcanvasTrigger;this._offcanvasTrigger=null,t?.isConnected&&t.focus()}),this._listen(this._document,"show.bs.dropdown",t=>{let e=this._dropdownControl(t.target);e&&(this._closeDropdowns(e),this._disposeTooltip(e),this._positionDropdown(e))}),this._listen(this._document,"hidden.bs.dropdown",t=>{let e=this._dropdownControl(t.target);e&&(this._clearDropdownPosition(e),this._syncTooltips())}),this._listen(this._element,"click",t=>this._handleControlClick(t)),this._listen(this._window,"click",t=>this._handleSubmenuClick(t),!0),this._listen(this._document,"click",t=>this._handleOutsideFlyoutClick(t)),this._listen(this._document,"keydown",t=>this._handleShortcut(t)),this._listen(this._window,"resize",()=>{this._closeFlyouts(),this._element.querySelectorAll("[data-sidebar-dropdown-positioned]").forEach(t=>this._clearDropdownPosition(t)),this._syncControls(),this._syncTooltips()})}_dropdownControl(t){return!(t instanceof this._window.Element)||!this._element.contains(t)?null:t.matches('[data-bs-toggle="dropdown"][data-sidebar-tooltip]')?t:t.querySelector?.('[data-bs-toggle="dropdown"][data-sidebar-tooltip]')||null}_handleControlClick(t){let e=t.target,i=e instanceof this._window.Element?e.closest("[data-sidebar-trigger], [data-sidebar-rail]"):null;if(!i||!this._element.contains(i))return;if(this._isDesktop()){t.preventDefault(),this._closeFlyouts(),this._toggle();return}if(!i.matches("[data-sidebar-trigger]"))return;let s=this._document.getElementById(i.getAttribute("aria-controls")),r=this._bootstrap("Offcanvas");s&&r&&(this._offcanvasTrigger=i,this._offcanvas=r.getOrCreateInstance(s),this._offcanvas.toggle())}_handleSubmenuClick(t){let e=t.target,i=e instanceof this._window.Element?e.closest(".sidebar-menu-sub-trigger"):null,s=i?.closest(".sidebar-menu-item");!i||!s||!this._element.contains(s)||!this._isCollapsed()||(t.preventDefault(),t.stopImmediatePropagation(),this._flyoutOwner===s&&this._flyout?this._closeFlyouts():this._openFlyout(s))}_handleOutsideFlyoutClick(t){this._flyout&&(this._flyout.contains(t.target)?this._closeFlyouts():this._flyoutOwner?.contains(t.target)||this._closeFlyouts())}_handleShortcut(t){let e=t.target,i=e instanceof this._window.Element&&(e.matches("input, textarea, select")||e.isContentEditable);t.defaultPrevented||t.isComposing||i||!this._config.keyboard||!(t.metaKey||t.ctrlKey)||t.key.toLowerCase()!=="b"||!this._isDesktop()||(this._document.querySelector('[data-slot="sidebar-wrapper"][data-sidebar-key]')||this._document.querySelector('[data-slot="sidebar-wrapper"]'))!==this._element||(t.preventDefault(),this._closeFlyouts(),this._toggle())}};var U=new WeakMap;function X(a,t){let e=Number(a);return Number.isFinite(e)?e:t}function R(a){return X(a.min,0)}function j(a){return X(a.max,100)}function Zt(a){if(!a.step||a.step==="any")return 1;let t=Number(a.step);return Number.isFinite(t)&&t>0?t:1}function L(a,t,e){return Math.min(Math.max(a,t),e)}function Ft(a){let t=String(a);return t.includes(".")?t.split(".").at(-1).length:0}function te(a,t){let e=R(t),i=j(t);if(t.step==="any")return Number(L(a,e,i).toFixed(4));let s=Zt(t),r=e+Math.round((a-e)/s)*s,n=Math.max(Ft(s),Ft(e));return L(Number(r.toFixed(n)),e,i)}function G(a){let t=R(a),e=j(a);return e<=t?0:(X(a.value,t)-t)/(e-t)*100}function ut(a){return a.value||String(R(a))}var J=class a{static getInstance(t){return t?.nodeType===1&&U.get(t)||null}static getOrCreateInstance(t,e={}){return a.getInstance(t)||new a(t,e)}constructor(t,e={}){if(t?.nodeType!==1||!t.matches("[data-slider]"))throw new TypeError("MooSlider requires a [data-slider] root element.");let i=U.get(t);if(i)return i;if(this._element=t,this._document=t.ownerDocument,this._window=this._document.defaultView,this._config={...e},this._listeners=[],this._dragListeners=[],this._draggingInput=null,this._disposed=!1,this._inputs=Array.from(t.querySelectorAll(':scope input[type="range"][data-slider-input]')),this._track=t.querySelector("[data-slider-track]"),this._output=t.querySelector("[data-slider-output]"),this._inputs.length<1||this._inputs.length>2)throw new TypeError("MooSlider requires one or two native range inputs.");if(!this._track)throw new TypeError("MooSlider requires a [data-slider-track] element.");U.set(t,this),this._bindEvents(),this._sync()}dispose(){this._disposed||(this._disposed=!0,this._clearDragListeners(),this._clearPointerFocus(),this._listeners.forEach(({target:t,type:e,handler:i,options:s})=>{t.removeEventListener(e,i,s)}),this._listeners=[],U.get(this._element)===this&&U.delete(this._element))}_listen(t,e,i,s){t&&(t.addEventListener(e,i,s),this._listeners.push({target:t,type:e,handler:i,options:s}))}_listenDuringDrag(t,e,i,s){t&&(t.addEventListener(e,i,s),this._dragListeners.push({target:t,type:e,handler:i,options:s}))}_clearDragListeners(){this._dragListeners.forEach(({target:t,type:e,handler:i,options:s})=>{t.removeEventListener(e,i,s)}),this._dragListeners=[],this._draggingInput=null,this._element.removeAttribute("data-slider-dragging")}_bindEvents(){this._inputs.forEach(e=>{this._listen(e,"input",()=>this._sync(e)),this._listen(e,"change",()=>{this._sync(e),this._trigger("change")}),this._listen(e,"keydown",()=>this._clearPointerFocus()),this._listen(e,"focusout",()=>this._clearPointerFocus())}),new Set(this._inputs.map(e=>e.form||e.closest?.("form")).filter(Boolean)).forEach(e=>{this._listen(e,"reset",()=>{this._window.setTimeout(()=>this._sync(),0)})}),this._listen(this._track,"pointerdown",e=>this._handleTrackPointer(e))}_trigger(t){this._element.dispatchEvent(new this._window.CustomEvent("".concat(t,".moo.slider"),{bubbles:!0}))}_isRange(){return this._inputs.length===2}_sync(t=null){if(this._isRange()){let[i,s]=this._inputs,r=X(i.value,R(i)),n=X(s.value,j(s));r>n&&(t===s?s.value=i.value:i.value=s.value),this._writeFill(G(i),G(s)),this._writeOutput("".concat(ut(i)," - ").concat(ut(s))),this._syncAria(i),this._syncAria(s);return}let e=this._inputs[0];this._writeFill(0,G(e)),this._writeOutput(ut(e)),this._syncAria(e)}_syncAria(t){t.setAttribute("aria-valuemin",String(R(t))),t.setAttribute("aria-valuemax",String(j(t))),t.setAttribute("aria-valuenow",ut(t))}_writeFill(t,e){let i=L(t,0,100),s=L(e,0,100);this._element.style.setProperty("--moo-slider-start","".concat(Math.min(i,s),"%")),this._element.style.setProperty("--moo-slider-end","".concat(Math.max(i,s),"%"))}_writeOutput(t){this._output&&(this._output.textContent=t)}_handleTrackPointer(t){if(t.button!==void 0&&t.button!==0)return;let e=this._inputs.filter(r=>!r.disabled);if(!e.length)return;t.preventDefault?.();let i=this._pointerPercent(t),s=this._nearestInput(i*100,e);this._setPointerFocus(),this._startDrag(s,t),this._setInputFromPointer(s,t)}_setPointerFocus(){this._element.setAttribute("data-slider-pointer-focus","true")}_clearPointerFocus(){this._element.removeAttribute("data-slider-pointer-focus")}_startDrag(t,e){this._clearDragListeners(),this._draggingInput=t,this._element.setAttribute("data-slider-dragging","true"),this._track.setPointerCapture?.(e.pointerId);let i=e.pointerId,s=o=>i===void 0||o.pointerId===i,r=o=>{!s(o)||this._draggingInput!==t||(o.preventDefault?.(),this._setInputFromPointer(t,o))},n=o=>{!s(o)||this._draggingInput!==t||(o.preventDefault?.(),this._setInputFromPointer(t,o,!1),t.dispatchEvent(new this._window.Event("change",{bubbles:!0})),this._track.releasePointerCapture?.(i),this._clearDragListeners())};this._listenDuringDrag(this._document,"pointermove",r),this._listenDuringDrag(this._document,"pointerup",n),this._listenDuringDrag(this._document,"pointercancel",n)}_setInputFromPointer(t,e,i=!0){let s=this._pointerPercent(e),r=R(t),n=j(t);t.value=String(te(r+s*(n-r),t)),t.focus({preventScroll:!0}),this._sync(t),i&&t.dispatchEvent(new this._window.Event("input",{bubbles:!0}))}_pointerPercent(t){let e=this._track.getBoundingClientRect();return(this._element.dataset.sliderOrientation||"horizontal")==="vertical"?L((e.bottom-t.clientY)/(e.height||1),0,1):this._horizontalPointerPercent(t,e)}_horizontalPointerPercent(t,e){let s=this._window.getComputedStyle?.(this._element).direction==="rtl"?e.right-t.clientX:t.clientX-e.left;return L(s/(e.width||1),0,1)}_nearestInput(t,e){if(e.length===1)return e[0];let[i,s]=e,r=G(i),n=G(s),o=Math.abs(r-t),c=Math.abs(n-t);return o===c?t>=r?s:i:c<o?s:i}};var Q=new WeakMap,vt='.moo-ui[data-bs-theme="light"], .moo-ui[data-bs-theme="dark"]';function qt(a,t=0){if(!a||typeof a!="object"||Array.isArray(a))throw new TypeError("TableOfContents options must be an object.");let e=a.activationOffset===void 0?t:a.activationOffset;if(typeof e!="number"||!Number.isFinite(e)||e<0)throw new TypeError("TableOfContents activationOffset must be a finite nonnegative number.");return e}function Ot(a){if(!a?.startsWith("#")||a.length===1)return null;try{return decodeURIComponent(a.slice(1))}catch{return null}}var Z=class a{static getInstance(t){return t?.nodeType===1&&Q.get(t)||null}static getOrCreateInstance(t,e={}){return a.getInstance(t)||new a(t,e)}constructor(t,e={}){if(t?.nodeType!==1||!t.matches("[data-toc]"))throw new TypeError("TableOfContents requires a [data-toc] root element.");let i=Q.get(t);if(i)return i;this._element=t,this._document=t.ownerDocument,this._window=this._document.defaultView,this._offset=qt(e),this._listeners=[],this._originalLinks=new Map,this._originalStatus=new Map,this._originalMarker={attribute:t.getAttribute("data-toc-marker"),properties:["--moo-toc-marker-offset","--moo-toc-marker-height"].map(s=>({name:s,value:t.style.getPropertyValue(s),priority:t.style.getPropertyPriority(s)}))},this._links=[],this._targets=[],this._frame=0,this._disposed=!1,Q.set(t,this),this.refresh()}refresh(t={}){if(this._disposed)return this;let e=qt(t,this._offset);this._clearListeners(),this._offset=e;let i=this._element.closest(vt),s=this._element.getAttribute("data-toc-content"),r=s?this._document.getElementById(s):i,n=this._element.getAttribute("data-toc-scroll-root");if(this._scrollElement=n?this._document.getElementById(n):null,this._status=Array.from(this._element.querySelectorAll("[data-toc-current]")).find(l=>l.closest("[data-toc]")===this._element)||null,this._status&&!this._originalStatus.has(this._status)&&this._originalStatus.set(this._status,this._status.textContent),this._overview=this._status?this._originalStatus.get(this._status):"",this._links=Array.from(this._element.querySelectorAll('a[href^="#"]')).filter(l=>l.closest("[data-toc]")===this._element).map(l=>({link:l,id:Ot(l.getAttribute("href"))})),this._links.forEach(({link:l})=>{this._originalLinks.has(l)||this._originalLinks.set(l,{active:l.classList.contains("active"),current:l.getAttribute("aria-current")})}),this._targets=[],this._activate(null),!i||!r||r.closest(vt)!==i||n&&(!this._scrollElement||!this._scrollElement.contains(r)))return this;let o=new Set;if(this._links.forEach(({id:l,link:h})=>{let _=l?this._document.getElementById(l):null;!_||o.has(l)||!r.contains(_)||_.closest(vt)!==i||(o.add(l),this._targets.push({id:l,target:_,label:h.textContent.trim()}))}),!this._targets.length)return this;let c=()=>this._requestUpdate();return this._listen(this._scrollElement||this._window,"scroll",c,{passive:!0}),this._listen(this._window,"resize",c),this._listen(this._window,"hashchange",c),this._listen(this._element,"click",c),this._update(),this}dispose(){if(this._disposed)return;this._disposed=!0,this._clearListeners(),this._originalLinks.forEach(({active:i,current:s},r)=>{r.classList.toggle("active",i),s===null?r.removeAttribute("aria-current"):r.setAttribute("aria-current",s)}),this._originalStatus.forEach((i,s)=>{s.textContent=i});let{attribute:t,properties:e}=this._originalMarker;t===null?this._element.removeAttribute("data-toc-marker"):this._element.setAttribute("data-toc-marker",t),e.forEach(({name:i,value:s,priority:r})=>{s?this._element.style.setProperty(i,s,r):this._element.style.removeProperty(i)}),this._originalLinks.clear(),this._originalStatus.clear(),this._targets=[],this._links=[],Q.get(this._element)===this&&Q.delete(this._element)}_listen(t,e,i,s){t.addEventListener(e,i,s),this._listeners.push({target:t,type:e,handler:i,options:s})}_clearListeners(){this._listeners.forEach(({target:t,type:e,handler:i,options:s})=>t.removeEventListener(e,i,s)),this._listeners=[],this._frame&&this._window.cancelAnimationFrame(this._frame),this._frame=0}_requestUpdate(){this._disposed||this._frame||(this._frame=this._window.requestAnimationFrame(()=>{this._frame=0,this._update()}))}_update(){if(this._disposed)return;let t=this._targets.filter(({target:n})=>n.isConnected&&n.getClientRects().length>0),e=this._scrollElement||this._document.scrollingElement,i=(this._scrollElement?this._scrollElement.getBoundingClientRect().top+this._scrollElement.clientTop:0)+this._offset,s=null;t.forEach(n=>{n.target.getBoundingClientRect().top<=i+1&&(s=n)});let r=e&&e.scrollHeight>e.clientHeight+1;if(!r){let n=Ot(this._window.location.hash);s=t.find(({id:o})=>o===n)||s}t.length&&r&&e.scrollTop+e.clientHeight>=e.scrollHeight-1&&(s=t[t.length-1]),this._activate(s)}_activate(t){let e=null;this._links.forEach(({link:i,id:s})=>{let r=t!==null&&s===t.id;i.classList.toggle("active",r),r?(i.setAttribute("aria-current","location"),e||(e=i)):i.removeAttribute("aria-current")}),this._status&&(this._status.textContent=t?t.label:this._overview),this._updateMarker(e)}_updateMarker(t){let e=this._element.querySelector(":scope > .nav"),i=t?.querySelector("span");if(!e?.contains(t)||!i?.offsetHeight||!this._element.getClientRects().length){this._element.removeAttribute("data-toc-marker");return}this._element.style.setProperty("--moo-toc-marker-offset","".concat(t.offsetTop+i.offsetTop,"px")),this._element.style.setProperty("--moo-toc-marker-height","".concat(i.offsetHeight,"px")),this._element.setAttribute("data-toc-marker","")}};var tt=new WeakMap,ee=0,et=class a{static getInstance(t,e=t?.ownerDocument?.scrollingElement){let i=e&&tt.get(e);return i?._owner===t?i:null}static getOrCreateInstance(t,e={}){return a.getInstance(t,e.scrollElement)||new a(t,e)}constructor(t,{scrollElement:e=null,hideDelay:i=900,label:s="Page scroll position"}={}){if(!t?.matches?.('.moo-ui[data-bs-theme="light"], .moo-ui[data-bs-theme="dark"]')||!t.isConnected)throw new TypeError("OverlayScrollbar requires a connected, resolved .moo-ui theme owner.");if(!Number.isFinite(i)||i<0||typeof s!="string"||!s.trim())throw new TypeError("OverlayScrollbar requires a nonnegative hideDelay and a nonempty label.");let r=t.ownerDocument,n=e??r.scrollingElement,o=n===r.scrollingElement;if(n?.nodeType!==1||!n.isConnected||n.ownerDocument!==r||!o&&(!t.contains(n)||n.closest('.moo-ui[data-bs-theme="light"], .moo-ui[data-bs-theme="dark"]')!==t))throw new TypeError("OverlayScrollbar scrollElement must belong to the same resolved theme owner.");let c=tt.get(n);if(c){if(c._owner===t)return c;throw new Error("Only one OverlayScrollbar theme owner may control a scroll element.")}if(this._owner=t,this._document=r,this._window=r.defaultView,this._root=n,this._isDocument=o,o&&n!==r.documentElement)throw new TypeError("OverlayScrollbar requires a standards-mode document scroll root.");if(this._hideDelay=i,this._listeners=[],this._frame=0,this._timer=0,this._disposed=!1,this._originalNativeClass=this._root.classList.contains("scrollbar-overlay-native"),this._originalId=this._root.getAttribute("id"),this._forcedColors=this._window.matchMedia("(forced-colors: active)"),this._bar=r.createElement("div"),this._bar.className="scrollbar-overlay",this._bar.tabIndex=0,this._bar.setAttribute("role","scrollbar"),this._bar.setAttribute("aria-label",s),this._bar.setAttribute("aria-orientation","vertical"),this._bar.setAttribute("aria-valuemin","0"),this._thumb=r.createElement("div"),this._thumb.className="scrollbar-overlay-thumb",this._thumb.setAttribute("aria-hidden","true"),this._bar.append(this._thumb),t.append(this._bar),this._window.getComputedStyle(this._bar).position!=="fixed")throw this._bar.remove(),new Error("OverlayScrollbar requires the Moo UI overlay scrollbar stylesheet.");if(!this._originalId){do this._generatedId="scrollbar-overlay-page-".concat(++ee);while(r.getElementById(this._generatedId));this._root.id=this._generatedId}this._bar.setAttribute("aria-controls",this._root.id),tt.set(n,this);try{this._listen(o?this._window:n,"scroll",()=>{this._reveal(),this._queue()},{passive:!0}),o||this._listen(r,"scroll",()=>this._queue(),{passive:!0,capture:!0}),this._listen(this._window,"resize",()=>this._queue()),this._listen(r,"pointermove",l=>this._onPointerMove(l),{passive:!0}),this._listen(r,"pointerout",l=>{l.pointerType==="mouse"&&!l.relatedTarget&&(this._nearEdge=!1,this._drag||delete this._bar.dataset.scrollbarInteractive,this._hideLater())}),this._listen(this._bar,"pointerdown",l=>this._onPointerDown(l)),this._listen(this._bar,"pointerup",()=>this._finishDrag()),this._listen(this._bar,"pointercancel",()=>this._finishDrag()),this._listen(this._bar,"lostpointercapture",()=>this._finishDrag()),this._listen(this._bar,"focus",()=>this._reveal()),this._listen(this._bar,"blur",()=>this._hideLater()),this._listen(this._bar,"keydown",l=>this._onKeyDown(l)),this._listen(this._forcedColors,"change",()=>this.refresh()),this._listen(this._window,"beforeprint",()=>{this._printing=!0,this.refresh()}),this._listen(this._window,"afterprint",()=>{this._printing=!1,this.refresh()}),this._resize=new this._window.ResizeObserver(()=>this._queue()),this._resize.observe(this._root),this._resize.observe(r.body),this._mutations=new this._window.MutationObserver(()=>this._queue()),this._mutations.observe(this._root,{attributes:!0,attributeFilter:["class","style","dir"]}),o||this._mutations.observe(r.documentElement,{attributes:!0,attributeFilter:["class","style","dir"]}),this._mutations.observe(r.body,{attributes:!0,attributeFilter:["class","style"]}),this._mutations.observe(t,{attributes:!0,attributeFilter:["class","style","dir","data-bs-theme"]}),this._contentMutations=new this._window.MutationObserver(l=>{l.some(h=>h.target!==this._bar&&!this._bar.contains(h.target))&&this._queue()}),this._contentMutations.observe(o?r.body:n,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","style","hidden"]}),this._listen(n,"load",()=>this._queue(),{capture:!0}),r.fonts&&this._listen(r.fonts,"loadingdone",()=>this._queue()),this.refresh()}catch(l){throw this.dispose(),l}}refresh(){if(this._disposed)return this;let t=this._window,e=this._root,i=!this._forcedColors.matches&&!this._printing;i&&e.classList.add("scrollbar-overlay-native");let s=i&&e.scrollWidth<=e.clientWidth+1;e.classList.toggle("scrollbar-overlay-native",this._originalNativeClass||s),this._mutations?.takeRecords(),this._contentMutations?.takeRecords();let r=(this._isDocument?[e,this._document.body]:[e]).some(_=>["hidden","clip"].includes(t.getComputedStyle(_).overflowY));this._maximum=Math.max(0,e.scrollHeight-e.clientHeight);let n=this._position();if(this._bar.hidden=!s||r||!n||this._maximum<=0,this._bar.hidden)return this._document.activeElement===this._bar&&this._bar.blur(),delete this._bar.dataset.scrollbarVisible,delete this._bar.dataset.scrollbarInteractive,this;let o=this._bar.clientWidth,c=this._bar.clientHeight,l=Math.min(c,Math.max(o,c*e.clientHeight/e.scrollHeight));this._travel=Math.max(0,c-l);let h=Math.min(this._maximum,Math.max(0,e.scrollTop));return this._thumb.style.height="".concat(l,"px"),this._thumb.style.transform="translateY(".concat(this._travel*h/this._maximum,"px)"),this._bar.setAttribute("aria-valuemax",String(Math.round(this._maximum))),this._bar.setAttribute("aria-valuenow",String(Math.round(h))),this}_position(){if(this._isDocument)return!0;let t=this._root,e=t.getBoundingClientRect(),i=Math.max(0,e.top+t.clientTop),s=Math.min(this._window.innerHeight,e.top+t.clientTop+t.clientHeight),r=parseFloat(this._window.getComputedStyle(this._bar).inlineSize),n=this._window.getComputedStyle(t).direction==="rtl",o=e.left+t.clientLeft+(n?0:t.clientWidth-r);return Object.assign(this._bar.style,{insetInlineEnd:"auto",bottom:"auto",top:"".concat(i,"px"),height:"".concat(Math.max(0,s-i),"px"),left:"".concat(Math.max(0,Math.min(this._window.innerWidth-r,o)),"px"),direction:n?"rtl":"ltr"}),e.width>0&&s>i&&o<this._window.innerWidth&&o+r>0}dispose(){if(!this._disposed){this._disposed=!0;for(let[t,e,i,s]of this._listeners)t.removeEventListener(e,i,s);this._listeners=[],this._resize?.disconnect(),this._mutations?.disconnect(),this._contentMutations?.disconnect(),this._window.cancelAnimationFrame(this._frame),this._window.clearTimeout(this._timer),this._drag&&this._bar.hasPointerCapture(this._drag.id)&&this._bar.releasePointerCapture(this._drag.id),this._drag=null,this._bar.remove(),this._root.classList.toggle("scrollbar-overlay-native",this._originalNativeClass),this._generatedId&&this._root.id===this._generatedId&&(this._originalId===null?this._root.removeAttribute("id"):this._root.setAttribute("id",this._originalId)),tt.get(this._root)===this&&tt.delete(this._root)}}_listen(t,e,i,s){t.addEventListener(e,i,s),this._listeners.push([t,e,i,s])}_queue(){this._disposed||this._frame||(this._frame=this._window.requestAnimationFrame(()=>{this._frame=0,this.refresh()}))}_reveal(){this._disposed||this._bar.hidden||(this._bar.dataset.scrollbarVisible="true",this._hideLater())}_hideLater(){this._window.clearTimeout(this._timer),this._timer=0,!this._disposed&&this._bar.hasAttribute("data-scrollbar-visible")&&(this._timer=this._window.setTimeout(()=>{this._timer=0,!(this._disposed||this._nearEdge||this._drag||this._bar.matches(":focus-visible"))&&delete this._bar.dataset.scrollbarVisible},this._hideDelay))}_onPointerMove(t){if(this._disposed)return;if(this._drag?.id===t.pointerId){this._travel&&this._scroll(this._drag.top+(t.clientY-this._drag.y)*this._maximum/this._travel);return}if(t.pointerType!=="mouse"){this._nearEdge=!1,this._drag||delete this._bar.dataset.scrollbarInteractive;return}let e=this._bar.getBoundingClientRect();!this._bar.hidden&&t.clientX>=e.left&&t.clientX<=e.right&&t.clientY>=e.top&&t.clientY<=e.bottom?(this._nearEdge=!0,this._bar.dataset.scrollbarInteractive="true",this._reveal()):this._nearEdge&&(this._nearEdge=!1,this._drag||delete this._bar.dataset.scrollbarInteractive,this._hideLater())}_onPointerDown(t){if(t.button!==0||this._bar.hidden||t.pointerType==="touch")return;t.preventDefault(),this._reveal();let e=this._thumb.getBoundingClientRect();if(t.clientY>=e.top&&t.clientY<=e.bottom)this._drag={id:t.pointerId,y:t.clientY,top:this._root.scrollTop},this._bar.setPointerCapture(t.pointerId);else{let i=t.clientY<this._thumb.getBoundingClientRect().top?-1:1;this._scroll(this._root.scrollTop+i*this._root.clientHeight)}}_finishDrag(){if(!this._drag||this._disposed)return;let t=this._drag.id;this._drag=null,this._nearEdge||delete this._bar.dataset.scrollbarInteractive,this._bar.hasPointerCapture(t)&&this._bar.releasePointerCapture(t),this._hideLater()}_onKeyDown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;this.refresh();let e=parseFloat(this._window.getComputedStyle(this._root).lineHeight)||16,i=this._root.clientHeight,s={ArrowUp:this._root.scrollTop-e,ArrowDown:this._root.scrollTop+e,PageUp:this._root.scrollTop-i,PageDown:this._root.scrollTop+i,Home:0,End:this._maximum," ":this._root.scrollTop+(t.shiftKey?-i:i)};Object.hasOwn(s,t.key)&&(t.preventDefault(),this._scroll(s[t.key]),this._reveal())}_scroll(t){(this._isDocument?this._window:this._root).scrollTo({top:Math.min(this._maximum,Math.max(0,t)),behavior:"instant"}),this._queue()}};var it=new WeakMap;function Lt(a=document){if(it.has(a))return it.get(a);let e=(a.nodeType===9?a:a.ownerDocument)?.defaultView?.bootstrap?.Offcanvas;if(!e)return()=>{};let i=Array.from(a.querySelectorAll(".offcanvas.sheet")),s=n=>{n.target===n.currentTarget&&n.currentTarget.querySelector("[autofocus]:not(:disabled)")?.focus()},r=()=>{it.get(a)===r&&(i.forEach(n=>{n.removeEventListener("shown.bs.offcanvas",s)}),it.delete(a))};return it.set(a,r),i.forEach(n=>{n.addEventListener("shown.bs.offcanvas",s),n.dataset.sheetOpenOnLoad==="true"&&(n.removeAttribute("data-sheet-open-on-load"),e.getOrCreateInstance(n).show())}),r}async function ie(){let{default:a}=await import("./chart.js");return a}var se={loadChart:ie,Combobox:V,ContextMenu:N,DataTable:B,Datepicker:W,MooCalendar:O,MooDateRangePicker:ct,Sidebar:Y,Slider:J,TableOfContents:Z,OverlayScrollbar:et,initSheets:Lt};var Ce=se;export{V as Combobox,N as ContextMenu,B as DataTable,W as Datepicker,O as MooCalendar,ct as MooDateRangePicker,et as OverlayScrollbar,Y as Sidebar,J as Slider,Z as TableOfContents,Ce as default,Lt as initSheets,ie as loadChart};
|
|
7
|
+
var st=new WeakMap,rt=a=>a.trim().toLowerCase(),V=class a{static getInstance(t){return t?.nodeType===1&&st.get(t)||null}static getOrCreateInstance(t,e={}){return a.getInstance(t)||new a(t,e)}constructor(t,e={}){if(t?.nodeType!==1||!t.matches(".combobox"))throw new TypeError("Combobox requires a .combobox root element.");let i=st.get(t);if(i)return i;if(this._element=t,this._document=t.ownerDocument,this._window=this._document.defaultView,this._config={noResultsText:"No results found.",...e},this._input=t.querySelector(".combobox-input"),this._menu=t.querySelector(".combobox-menu"),this._options=Array.from(t.querySelectorAll(".combobox-option")),!this._input||!this._menu||this._options.length===0)throw new TypeError("Combobox requires an input, menu, and at least one option.");this._isMultiple=t.dataset.comboboxMultiple==="true",this._hidden=this._isMultiple?null:t.querySelector('input[type="hidden"]'),this._chipValue=t.querySelector(".combobox-value"),this._valueStore=t.querySelector("[data-combobox-value-store]"),this._chipIconTemplate=t.querySelector("[data-combobox-chip-icon]"),this._clearTrigger=t.querySelector("[data-combobox-clear]"),this._indicator=t.querySelector(".combobox-indicator"),this._groups=Array.from(t.querySelectorAll("[data-combobox-group]")),this._separators=Array.from(t.querySelectorAll("[data-combobox-separator]")),this._listeners=[],this._generated=[],this._startsOpen=this._menu.classList.contains("show"),this._empty=this._menu.querySelector("[data-combobox-empty]"),this._empty||(this._empty=this._document.createElement("li"),this._empty.className="combobox-empty",this._empty.hidden=!0,this._empty.dataset.comboboxEmpty="true",this._empty.textContent=this._config.noResultsText,this._menu.appendChild(this._empty),this._generated.push(this._empty)),this._liveRegion=t.querySelector("[data-combobox-live]"),this._liveRegion||(this._liveRegion=this._document.createElement("span"),this._liveRegion.className="visually-hidden",this._liveRegion.setAttribute("aria-live","polite"),this._liveRegion.dataset.comboboxLive="true",t.appendChild(this._liveRegion),this._generated.push(this._liveRegion)),st.set(t,this),this._bindEvents(),this._toggleClear(this._input.dataset.comboboxSelected==="true"||t.dataset.comboboxSelected==="true"),this._syncMultipleValue(),this._filterOptions({open:this._startsOpen,activate:this._startsOpen}),this._startsOpen||this._closeMenu(!1)}dispose(){this._listeners.forEach(({target:t,type:e,handler:i,options:s})=>{t.removeEventListener(e,i,s)}),this._listeners=[],this._closeMenu(!1),this._generated.forEach(t=>t.remove()),this._generated=[],this._chipValue?.querySelectorAll("[data-combobox-generated]").forEach(t=>t.remove()),this._valueStore?.querySelectorAll("[data-combobox-generated]").forEach(t=>t.remove()),st.delete(this._element)}_listen(t,e,i,s){t?.addEventListener(e,i,s),t&&this._listeners.push({target:t,type:e,handler:i,options:s})}_trigger(t,e={}){return this._element.dispatchEvent(new this._window.CustomEvent("".concat(t,".moo.combobox"),{bubbles:!0,cancelable:t==="show"||t==="hide",detail:e}))}_optionGroupIsHidden(t){return t.closest("[data-combobox-group]")?.hidden||!1}_visibleOptions(){return this._options.filter(t=>!t.hidden&&!t.disabled&&!this._optionGroupIsHidden(t))}_syncGroupVisibility(){if(this._groups.length===0)return;let t=0;this._groups.forEach(e=>{let i=Array.from(e.querySelectorAll(".combobox-option")).some(s=>!s.hidden);e.hidden=!i,t+=i?1:0}),this._separators.forEach(e=>{e.hidden=t<2})}_openMenu(t=!0){if(this._menu.classList.contains("show")){this._input.setAttribute("aria-expanded","true");return}t&&!this._trigger("show")||(this._menu.classList.add("show"),this._input.setAttribute("aria-expanded","true"),t&&this._trigger("shown"))}_closeMenu(t=!0){let e=this._menu.classList.contains("show");e&&t&&!this._trigger("hide")||(this._menu.classList.remove("show"),this._input.setAttribute("aria-expanded","false"),this._input.removeAttribute("aria-activedescendant"),this._options.forEach(i=>{i.removeAttribute("aria-current"),i.classList.remove("active")}),e&&t&&this._trigger("hidden"))}_optionLabel(t){return t?.querySelector(".combobox-option__label")?.textContent?.trim()||""}_selectedOptions(){return this._options.filter(t=>t.getAttribute("aria-selected")==="true")}_toggleClear(t){let e=t?"true":"false";this._element.dataset.comboboxSelected=e,this._input.dataset.comboboxSelected=e,this._clearTrigger&&(this._clearTrigger.hidden=!t,this._indicator&&(this._indicator.hidden=t))}_createChip(t){let e=t.dataset.value||"",i=this._optionLabel(t),s=this._document.createElement("span");s.className="badge text-bg-secondary combobox-chip",s.dataset.value=e,s.dataset.comboboxGenerated="true";let r=this._document.createElement("span");r.className="combobox-chip__label",r.textContent=i,s.appendChild(r);let n=this._document.createElement("button");return n.className="combobox-chip__remove",n.type="button",n.dataset.value=e,n.dataset.comboboxChipRemove="true",n.setAttribute("aria-label","Remove ".concat(i)),n.append(this._chipIconTemplate?.content.cloneNode(!0)||"x"),s.appendChild(n),s}_syncMultipleValue(){if(!this._isMultiple)return;let t=this._selectedOptions();if(this._chipValue&&this._chipValue.replaceChildren(...t.map(e=>this._createChip(e))),this._valueStore){this._valueStore.replaceChildren();let e=this._valueStore.dataset.comboboxName||"";t.forEach(i=>{let s=this._document.createElement("input");s.type="hidden",s.name=e,s.value=i.dataset.value||"",s.dataset.comboboxGenerated="true",this._valueStore.appendChild(s)})}this._toggleClear(t.length>0)}_emitChange(){let t=this._selectedOptions();this._trigger("change",{values:t.map(e=>e.dataset.value||"")})}_removeChip(t){let e=this._options.find(i=>i.dataset.value===t);e&&(e.setAttribute("aria-selected","false"),this._syncMultipleValue(),this._emitChange())}_clearSelection(t=!0){this._hidden&&(this._hidden.value=""),this._options.forEach(e=>e.setAttribute("aria-selected","false")),this._isMultiple?this._syncMultipleValue():this._toggleClear(!1),t&&this._emitChange()}_clearStaleSelection(){if(this._isMultiple){this._input.value="",this._options.forEach(i=>{i.hidden=!1}),this._syncGroupVisibility(),this._empty.hidden=!0;return}let t=this._selectedOptions()[0]||null,e=this._optionLabel(t);!this._input.value||e&&rt(this._input.value)===rt(e)||(this._clearSelection(),this._input.value="")}_activeOption(){let t=this._input.getAttribute("aria-activedescendant");return t&&this._visibleOptions().find(e=>e.id===t)||null}_selectedOption(){return this._isMultiple?null:this._visibleOptions().find(t=>t.getAttribute("aria-selected")==="true")||null}_preferredActiveOption(){return this._selectedOption()||this._visibleOptions()[0]||null}_activatePreferredOptionIfNeeded(){this._activeOption()||this._setActiveOption(this._preferredActiveOption())}_setActiveOption(t,{scroll:e=!0}={}){if(this._options.forEach(i=>{let s=i===t;s?i.setAttribute("aria-current","true"):i.removeAttribute("aria-current"),i.classList.toggle("active",s)}),!t){this._input.removeAttribute("aria-activedescendant");return}if(this._input.setAttribute("aria-activedescendant",t.id),e){let i=t.getBoundingClientRect(),s=this._menu.getBoundingClientRect();i.top<s.top?this._menu.scrollTop-=s.top-i.top:i.bottom>s.bottom&&(this._menu.scrollTop+=i.bottom-s.bottom)}}_activateOptionFromPointer(t,e){e.pointerType==="touch"||t.disabled||t.getAttribute("aria-disabled")==="true"||t===this._activeOption()||this._setActiveOption(t,{scroll:!1})}_restoreSelectedActiveOption(){if(!this._menu.classList.contains("show"))return;let t=this._selectedOption();t&&this._setActiveOption(t,{scroll:!1})}_chooseOption(t){if(!(!t||t.disabled)){if(this._isMultiple){t.setAttribute("aria-selected",t.getAttribute("aria-selected")==="true"?"false":"true"),this._input.value="",this._syncMultipleValue(),this._filterOptions(),this._setActiveOption(t),this._emitChange();return}this._options.forEach(e=>{e.setAttribute("aria-selected",e===t?"true":"false")}),this._input.value=this._optionLabel(t),this._hidden&&(this._hidden.value=t.dataset.value||""),this._toggleClear(!0),this._setActiveOption(t),this._emitChange()}}_filterOptions({open:t=!0,activate:e=!0,resetActive:i=!1}={}){t&&this._openMenu();let s=rt(this._input.value),r=0;this._options.forEach(n=>{let o=!s||rt(n.textContent).includes(s);n.hidden=!o,r+=o?1:0}),this._syncGroupVisibility(),this._empty.hidden=r!==0,this._liveRegion.textContent=r===0?"No results":"".concat(r," result").concat(r===1?"":"s"),i&&this._setActiveOption(null,{scroll:!1}),e&&this._activatePreferredOptionIfNeeded()}_bindEvents(){this._listen(this._input,"focus",()=>{this._openMenu(),!this._isMultiple&&this._input.dataset.comboboxSelected==="true"&&this._input.select(),this._activatePreferredOptionIfNeeded()}),this._listen(this._input,"input",()=>{this._isMultiple||this._clearSelection(),this._filterOptions({resetActive:!0})}),this._listen(this._input,"blur",t=>{let e=t.relatedTarget;e instanceof this._window.Node&&this._element.contains(e)||this._clearStaleSelection()}),this._listen(this._input,"click",()=>{this._openMenu(),this._setActiveOption(this._preferredActiveOption())}),this._listen(this._input,"keydown",t=>this._handleKeydown(t)),this._options.forEach(t=>{this._listen(t,"keydown",e=>this._handleKeydown(e)),this._listen(t,"pointerenter",e=>{this._activateOptionFromPointer(t,e)}),this._listen(t,"click",()=>{this._chooseOption(t),this._isMultiple?this._input.focus():this._closeMenu()})}),this._listen(this._clearTrigger,"click",t=>{t.preventDefault(),this._clearSelection(),this._input.value="",this._input.focus(),this._filterOptions({resetActive:!0})}),this._listen(this._menu,"pointerleave",()=>this._restoreSelectedActiveOption()),this._listen(this._element,"click",t=>this._handleRootClick(t)),this._listen(this._document,"click",t=>{t.target instanceof this._window.Node&&!this._element.contains(t.target)&&this._closeMenu()})}_handleRootClick(t){let e=t.target,i=e instanceof this._window.Element?e.closest("[data-combobox-chip-remove]"):null;i?(t.preventDefault(),this._removeChip(i.dataset.value||""),this._input.focus()):this._isMultiple&&e instanceof this._window.Element&&e.closest(".combobox-chips")&&this._input.focus()}_handleKeydown(t){let e=this._visibleOptions(),i=e.findIndex(n=>n.id===this._input.getAttribute("aria-activedescendant")),s=t.key==="ArrowDown"||t.key==="Down",r=t.key==="ArrowUp"||t.key==="Up";if(this._isMultiple&&t.key==="Backspace"&&this._input.value===""){let n=this._selectedOptions(),o=n[n.length-1];o&&(t.preventDefault(),this._removeChip(o.dataset.value||""))}else if((s||r)&&e.length){t.preventDefault(),this._openMenu();let o=i===-1?0:(i+(s?1:-1)+e.length)%e.length;this._setActiveOption(e[o]),t.target!==this._input&&this._input.focus({preventScroll:!0})}else if(t.key==="Enter"){let n=e[i];n&&(t.preventDefault(),this._chooseOption(n),this._isMultiple||this._closeMenu())}else t.key==="Escape"?(this._closeMenu(),this._input.focus()):t.key==="Tab"&&this._closeMenu()}};var at=new WeakMap;function Rt(a){let{clientX:t,clientY:e}=a;return{top:e,left:t,right:t,bottom:e,width:0,height:0,x:t,y:e}}function _t(a){return!!(a?.disabled||a?.getAttribute?.("aria-disabled")==="true")}function Vt(a){let t=a.target,e=t.closest?.(".dropdown-item");return e||t.closest?.("li")?.querySelector(":scope > .dropdown-item")||null}var N=class a{static getInstance(t){return t?.nodeType===1&&at.get(t)||null}static getOrCreateInstance(t,e={}){return a.getInstance(t)||new a(t,e)}constructor(t,e={}){if(t?.nodeType!==1||!t.matches(".context-menu"))throw new TypeError("ContextMenu requires a .context-menu root element.");let i=at.get(t);if(i)return i;if(this._element=t,this._document=t.ownerDocument,this._window=this._document.defaultView,this._menu=t.querySelector(":scope > .context-menu-menu"),this._fallback=t.querySelector(":scope > [data-context-menu-fallback]"),!this._menu)throw new TypeError("ContextMenu requires a .context-menu-menu element.");if(!this._fallback)throw new TypeError("ContextMenu requires an explicit fallback trigger.");let s=this._bootstrap("Dropdown");if(!s)throw new TypeError("ContextMenu requires bootstrap.Dropdown (bootstrap.bundle.js).");this._config={...e},this._listeners=[],this._invoker=null,this._pointerRect=null,this._openMethod=null,this._reference={getBoundingClientRect:()=>this._currentRect(),contextElement:this._fallback},this._dropdown=new s(this._fallback,{reference:this._reference,autoClose:"outside"}),at.set(t,this),this._bindEvents()}dispose(){this._listeners.forEach(({target:t,type:e,handler:i,options:s})=>{t.removeEventListener(e,i,s)}),this._listeners=[],this._dropdown.dispose(),this._syncExpanded(!1),this._invoker=null,this._pointerRect=null,at.delete(this._element)}show(t=this._fallback){this._open(t,null)}hide(){this._dropdown.hide()}_listen(t,e,i,s){t.addEventListener(e,i,s),this._listeners.push({target:t,type:e,handler:i,options:s})}_bootstrap(t){return this._window.bootstrap?.[t]||null}_currentRect(){return this._pointerRect?this._pointerRect:(this._invoker||this._fallback).getBoundingClientRect()}_trigger(t,e=!1){return this._element.dispatchEvent(new this._window.CustomEvent("".concat(t,".moo.context-menu"),{bubbles:!0,cancelable:e}))}_triggers(){return Array.from(this._element.querySelectorAll(":scope > .context-menu-trigger"))}_syncExpanded(t){this._triggers().forEach(e=>{e.setAttribute("aria-expanded",String(t))})}_menuItems(){return Array.from(this._menu.querySelectorAll(".dropdown-item")).filter(t=>!_t(t)&&!t.classList.contains("disabled"))}_open(t,e,i){_t(t)||(this._menu.classList.contains("show")&&this._dropdown.hide(),this._invoker=t,this._pointerRect=e?Rt(e):null,this._openMethod=i,this._dropdown.show())}_handleContextMenu(t){let e=t.target.closest(".context-menu-trigger");!e||!this._element.contains(e)||(t.preventDefault(),this._open(e,t,"pointer"))}_handleKeydown(t){let e=t.target.closest(".context-menu-trigger");if(!e||!this._element.contains(e))return;let i=t.shiftKey&&t.key==="F10",s=t.key==="ContextMenu";!i&&!s||(t.preventDefault(),this._open(e,null,"keyboard"))}_handleFallbackClick(){this._invoker=this._fallback,this._pointerRect=null,this._openMethod="pointer"}_handleFallbackKeydown(t){if(!(t.key!==" "&&t.key!=="Spacebar")){if(t.preventDefault(),t.stopPropagation(),this._menu.classList.contains("show")){this._dropdown.hide();return}this._open(this._fallback,null,"fallback-keyboard")}}_handleMenuClick(t){let e=Vt(t);if(!e)return;let i=e.matches(".dropdown-item-check, [data-context-menu-persistent]");if(e.matches('.dropdown-item.disabled, .dropdown-item[aria-disabled="true"], .dropdown-item:disabled')||_t(e)){t.preventDefault(),t.stopPropagation();return}let r=e.matches("[data-context-menu-radio-group]")?e:null;if(r){t.preventDefault(),t.stopPropagation();let n=r.dataset.contextMenuRadioGroup;this._menu.querySelectorAll('[data-context-menu-radio-group="'.concat(n,'"]')).forEach(o=>{let c=o===r;o.classList.toggle("active",c),o.setAttribute("aria-pressed",String(c))});return}i||this._dropdown.hide()}_bindEvents(){this._listen(this._element,"contextmenu",t=>this._handleContextMenu(t)),this._listen(this._element,"keydown",t=>this._handleKeydown(t)),this._listen(this._fallback,"click",()=>this._handleFallbackClick()),this._listen(this._fallback,"keydown",t=>this._handleFallbackKeydown(t)),this._listen(this._menu,"click",t=>this._handleMenuClick(t)),this._listen(this._fallback,"show.bs.dropdown",t=>{this._trigger("show",!0)||t.preventDefault()}),this._listen(this._fallback,"shown.bs.dropdown",()=>{this._syncExpanded(!0),this._openMethod==="fallback-keyboard"?this._fallback.focus():this._openMethod==="keyboard"?this._menuItems()[0]?.focus():this._menu.focus(),this._trigger("shown")}),this._listen(this._fallback,"hide.bs.dropdown",t=>{this._trigger("hide",!0)||t.preventDefault()}),this._listen(this._fallback,"hidden.bs.dropdown",()=>{this._syncExpanded(!1);let t=this._invoker;this._pointerRect=null,this._invoker=null,this._openMethod=null,this._trigger("hidden"),queueMicrotask(()=>{t&&t!==this._fallback&&this._document.activeElement===this._fallback&&t.focus()})})}};var kt='.moo-ui[data-bs-theme="light"], .moo-ui[data-bs-theme="dark"]',Nt="[data-moo-overlay-host]";function Bt(a){return a?.nodeType===9?a:a?.ownerDocument?a.ownerDocument:typeof document>"u"?null:document}function $t(a){return!!a?.matches?.(kt)}function zt(a){let t=Bt(a);return a?.nodeType===9||a===t?.body?t?.body?.firstElementChild||null:a}function E(a=typeof document>"u"?null:document){let t=zt(a);return t?$t(t)?t:t.closest?.(kt)||null:null}function P(a){return a?Array.from(a.children||[]).find(t=>t.matches?.(Nt))||a:null}var nt=new WeakMap;function M(a){return(a??"").toString().trim().toLowerCase()}var B=class a{static getInstance(t){return t?.nodeType===1&&nt.get(t)||null}static getOrCreateInstance(t,e={}){return a.getInstance(t)||new a(t,e)}constructor(t,e={}){if(t?.nodeType!==1||!t.matches(".datatable"))throw new TypeError("DataTable requires a .datatable root element.");let i=nt.get(t);if(i)return i;if(this._element=t,this._document=t.ownerDocument,this._window=this._document.defaultView,this._table=t.querySelector(":scope .datatable-table"),this._tbody=this._table?.querySelector(":scope > tbody"),!this._table||!this._tbody)throw new TypeError("DataTable requires a .datatable-table with a tbody.");this._cards=t.querySelector("[data-datatable-cards]");let s=new Map(Array.from(t.querySelectorAll("[data-datatable-card]")).map(r=>[r.dataset.datatableCardFor,r]));this._config={...e},this._listeners=[],this._pageSize=Number(t.dataset.datatablePageSize)||10,this._currentPage=1,this._sortKey=null,this._sortDirection=null,this._selectedIds=new Set,this._facetSelections=new Map,this._visibleFacets=new Map,this._searchTerm="",this._tooltips=[],this._filterMode=t.dataset.datatableFilterMode||"inline",this._reparentedRowMenus=new Map,this._reparentedRowMenuByTrigger=new WeakMap,this._reparentedSortMenus=new Map,this._reparentedSortMenuByTrigger=new WeakMap,this._rows=Array.from(this._tbody.querySelectorAll(":scope > tr[data-datatable-row]")).map((r,n)=>({element:r,cardElement:s.get(r.id)||null,index:n,search:M(r.dataset.datatableSearch),facets:this._readFacets(r)})),this._readInitialFacetVisibility(),this._readInitialSort(),nt.set(t,this),this._bindEvents(),this._render(),this._initBulkTooltips(),this._initViewToggle(),this._initRowActionDropdowns(),this._initSortDropdowns()}dispose(){this._disposeRowActionDropdowns(),this._disposeSortDropdowns(),this._restoreRowActionMenus(),this._restoreSortMenus(),this._listeners.forEach(({target:t,type:e,handler:i,options:s})=>{t.removeEventListener(e,i,s)}),this._listeners=[],this._tooltips.forEach(t=>t.dispose()),this._tooltips=[],nt.delete(this._element)}getSelectedIds(){return Array.from(this._selectedIds)}_listen(t,e,i,s){t&&(t.addEventListener(e,i,s),this._listeners.push({target:t,type:e,handler:i,options:s}))}_rowActionTriggers(){return this._element.querySelectorAll('tr[data-datatable-row] .dropdown [data-bs-toggle="dropdown"], [data-datatable-card] .dropdown [data-bs-toggle="dropdown"]')}_initRowActionDropdowns(){let t=this._bootstrap("Dropdown");t&&this._rowActionTriggers().forEach(e=>{t.getOrCreateInstance(e,{popperConfig:i=>this._clippingSafePopperConfig(i)})})}_sortTriggers(){return this._element.querySelectorAll('.datatable-sort [data-bs-toggle="dropdown"]')}_initSortDropdowns(){let t=this._bootstrap("Dropdown");t&&this._sortTriggers().forEach(e=>{t.getOrCreateInstance(e,{popperConfig:i=>this._clippingSafePopperConfig(i)})})}_clippingSafePopperConfig(t){return{...t,strategy:"fixed",modifiers:[...t.modifiers||[],{name:"flip",options:{fallbackPlacements:["top-end","top-start","bottom-end","bottom-start"]}},{name:"preventOverflow",options:{boundary:"viewport",padding:8}}]}}_disposeRowActionDropdowns(){let t=this._bootstrap("Dropdown");t&&this._rowActionTriggers().forEach(e=>{let i=t.getInstance(e);i&&(i.hide(),i.dispose())})}_disposeSortDropdowns(){let t=this._bootstrap("Dropdown");t&&this._sortTriggers().forEach(e=>{let i=t.getInstance(e);i&&(i.hide(),i.dispose())})}_rowActionMenuForTrigger(t){return t?.closest?.("tr[data-datatable-row], [data-datatable-card]")&&t.closest(".dropdown")?.querySelector(":scope > .dropdown-menu")||null}_rowActionOwnerIdForTrigger(t){let e=t?.closest?.("tr[data-datatable-row]")?.id;return e||t?.closest?.("[data-datatable-card]")?.getAttribute("data-datatable-card-for")||""}_reparentRowActionMenu(t){let e=this._rowActionMenuForTrigger(t);if(!e||this._reparentedRowMenus.has(e))return;let i=this._rowActionOwnerIdForTrigger(t);i&&e.setAttribute("data-datatable-row-action-owner",i),t.id&&e.setAttribute("data-datatable-row-action-trigger",t.id),this._reparentedRowMenus.set(e,{parent:e.parentNode,nextSibling:e.nextSibling,trigger:t,owner:E(t)}),this._reparentedRowMenuByTrigger.set(t,e),this._portalRoot(t).appendChild(e)}_restoreRowActionMenuForTrigger(t){let e=this._reparentedRowMenuByTrigger.get(t)||this._rowActionMenuForTrigger(t);e&&this._restoreRowActionMenu(e)}_restoreRowActionMenu(t){let e=this._reparentedRowMenus.get(t);if(!e)return;let{parent:i,nextSibling:s,trigger:r,owner:n}=e;n?.isConnected===!1?t.remove():i?.isConnected?s?.parentNode===i?i.insertBefore(t,s):i.appendChild(t):t.remove(),r&&this._reparentedRowMenuByTrigger.delete(r),t.removeAttribute("data-datatable-row-action-owner"),t.removeAttribute("data-datatable-row-action-trigger"),this._reparentedRowMenus.delete(t)}_restoreRowActionMenus(){Array.from(this._reparentedRowMenus.keys()).forEach(t=>{this._restoreRowActionMenu(t)})}_sortMenuForTrigger(t){return t?.closest?.(".datatable-sort")&&(this._reparentedSortMenuByTrigger.get(t)||t?.closest?.(".dropdown")?.querySelector(":scope > .dropdown-menu"))||null}_reparentSortMenu(t){let e=this._sortMenuForTrigger(t);!e||this._reparentedSortMenus.has(e)||(this._reparentedSortMenus.set(e,{parent:e.parentNode,nextSibling:e.nextSibling,trigger:t,owner:t.closest(".datatable-sort"),themeOwner:E(t)}),this._reparentedSortMenuByTrigger.set(t,e),this._portalRoot(t).appendChild(e))}_restoreSortMenuForTrigger(t){let e=this._reparentedSortMenuByTrigger.get(t)||this._sortMenuForTrigger(t);e&&this._restoreSortMenu(e)}_restoreSortMenu(t){let e=this._reparentedSortMenus.get(t);if(!e)return;let{parent:i,nextSibling:s,trigger:r,themeOwner:n}=e;n?.isConnected===!1?t.remove():i?.isConnected?s?.parentNode===i?i.insertBefore(t,s):i.appendChild(t):t.remove(),r&&this._reparentedSortMenuByTrigger.delete(r),this._reparentedSortMenus.delete(t)}_restoreSortMenus(){Array.from(this._reparentedSortMenus.keys()).forEach(t=>{this._restoreSortMenu(t)})}_bootstrap(t){return this._window.bootstrap?.[t]||null}_portalRoot(t=this._element){return P(E(t))||this._document.body||this._document.documentElement}_initBulkTooltips(){let t=this._bootstrap("Tooltip");t&&this._element.querySelectorAll('[data-datatable-bulk-actions] [data-bs-title]:not([data-bs-toggle="dropdown"])').forEach(e=>{this._tooltips.push(t.getOrCreateInstance(e,{animation:!1,container:this._portalRoot(e)}))})}_hideBulkTooltips({blur:t=!1}={}){if(this._tooltips.forEach(i=>{i.hide()}),!t)return;let e=this._document.activeElement;e?.closest?.("[data-datatable-bulk-actions]")&&e.blur()}_initViewToggle(){let t=Array.from(this._element.querySelectorAll(".datatable-view-toggle"));if(!t.length)return;let e=t.flatMap(h=>Array.from(h.querySelectorAll("input"))),i=this._window.getComputedStyle(this._element).getPropertyValue("--moo-datatable-responsive-breakpoint").trim(),s=this._element.hasAttribute("data-datatable-responsive-breakpoint"),r=s&&i?this._window.matchMedia("(min-width: ".concat(i,")")):null,n=new Map,o=()=>"moo-datatable-view:".concat(this._element.id).concat(r?r.matches?":wide":":narrow":""),c=(h,{persist:_=!1}={})=>{if(this._element.dataset.datatableView!==h){let m=this._bootstrap("Dropdown");[...this._rowActionTriggers(),...this._sortTriggers()].forEach(p=>{m?.getInstance(p)?.hide()})}if(this._element.dataset.datatableView=h,e.forEach(m=>{m.checked=m.value===h}),_){n.set(o(),h);try{this._window.localStorage.setItem(o(),h)}catch{}}},l=()=>{let h=n.get(o());try{h??(h=this._window.localStorage.getItem(o()))}catch{}c(h==="table"||h==="cards"?h:r?r.matches?"table":"cards":this._element.dataset.datatableView)};!s||r?l():e.forEach(h=>{h.checked=!1}),r&&this._listen(r,"change",l),t.forEach(h=>{this._listen(h,"change",_=>{let m=_.target.value;m!=="table"&&m!=="cards"||c(m,{persist:!0})})})}_readFacets(t){let e={};return Array.from(t.attributes).forEach(i=>{let s=/^data-datatable-facet-(.+)$/.exec(i.name);s&&(e[s[1]]=i.value)}),e}_readInitialFacetVisibility(){this._element.querySelectorAll("[data-datatable-facet]").forEach(t=>{let e=t.dataset.datatableFacet;e&&this._visibleFacets.set(e,!t.hidden)}),this._element.querySelectorAll("[data-datatable-filter-group]").forEach(t=>{let e=t.dataset.datatableFilterGroup;e&&!this._visibleFacets.has(e)&&this._visibleFacets.set(e,!1)}),this._element.querySelectorAll("[data-datatable-filter-option-key]").forEach(t=>{let e=t.dataset.datatableFilterOptionKey;e&&!this._visibleFacets.has(e)&&this._visibleFacets.set(e,!1)})}_readInitialSort(){let t=this._element.querySelector("th[data-datatable-initial-sort][data-datatable-column]"),e=t?.dataset.datatableInitialSort;e!=="asc"&&e!=="desc"||(this._sortKey=t.dataset.datatableColumn||null,this._sortDirection=this._sortKey?e:null)}_trigger(t,e={}){this._element.dispatchEvent(new this._window.CustomEvent("".concat(t,".moo.datatable"),{bubbles:!0,detail:e}))}_sortValue(t,e){let i=t.element.querySelector(':scope > [data-datatable-column="'.concat(e,'"]'));return i?M(i.dataset.datatableSortValue??i.textContent):""}_matchesFilters(t){if(this._searchTerm&&!t.search.includes(this._searchTerm))return!1;for(let[e,i]of this._facetSelections)if(i.size!==0&&!i.has(t.facets[e]))return!1;return!0}_visibleRows(){let t=this._rows.filter(e=>this._matchesFilters(e));if(this._sortKey){let e=this._sortDirection==="desc"?-1:1;t.sort((i,s)=>{let r=this._sortValue(i,this._sortKey),n=this._sortValue(s,this._sortKey);return r===n?i.index-s.index:r>n?e:-e})}else t.sort((e,i)=>e.index-i.index);return t}_pageCount(t){return Math.max(1,Math.ceil(t/this._pageSize))}_render(){let t=this._visibleRows(),e=this._pageCount(t.length);this._currentPage=Math.min(Math.max(1,this._currentPage),e);let i=(this._currentPage-1)*this._pageSize,s=t.slice(i,i+this._pageSize),r=new Set(s.map(l=>l.element.id));this._rows.forEach(l=>{let h=r.has(l.element.id);l.element.hidden=!h,l.cardElement&&(l.cardElement.hidden=!h)});let n=Array.from(this._tbody.children).filter(l=>r.has(l.id)).map(l=>l.id),o=s.map(l=>l.element.id);(n.length!==o.length||n.some((l,h)=>l!==o[h]))&&s.forEach(l=>{this._tbody.appendChild(l.element),this._cards&&l.cardElement&&this._cards.appendChild(l.cardElement)}),this._renderToolbarState(),this._renderSortHeaders(),this._renderSelection(s),this._renderFrameState(t.length),this._renderEmptyState(t.length),this._renderPagination(t.length,e),this._renderPageSize(),this._renderBulkActions()}_renderToolbarState(){let t=!!this._searchTerm,e=Array.from(this._facetSelections.values()).some(s=>s.size>0),i=this._element.querySelector("[data-datatable-reset]");i&&(i.hidden=!(t||e)),this._element.querySelectorAll("[data-datatable-facet]").forEach(s=>{let r=s.dataset.datatableFacet,n=this._facetSelections.get(r)||new Set;this._visibleFacets.has(r)&&(s.hidden=!this._visibleFacets.get(r)),s.querySelector(".datatable-facet-trigger")?.classList.toggle("datatable-facet-trigger-active",n.size>0);let c=s.querySelector("[data-datatable-facet-summary]");c&&(c.hidden=n.size===0,c.replaceChildren(),n.size>2?c.appendChild(this._createFacetBadge("".concat(n.size," selected"))):n.forEach(l=>{let _=s.querySelector('[data-datatable-facet-option="'.concat(l,'"]'))?.querySelector("[data-datatable-facet-option-label]")?.textContent??l;c.appendChild(this._createFacetBadge(_))})),s.querySelectorAll("[data-datatable-facet-option]").forEach(l=>{let h=n.has(l.dataset.datatableFacetOption);l.classList.toggle("active",h),l.setAttribute("aria-pressed",String(h))})}),this._element.querySelectorAll("[data-datatable-filter-toggle]").forEach(s=>{let r=s.dataset.datatableFilterToggle,n=this._visibleFacets.get(r)??!0;s.classList.toggle("active",n),s.setAttribute("aria-pressed",n?"true":"false")}),this._element.querySelectorAll("[data-datatable-filter-option]").forEach(s=>{let r=s.dataset.datatableFilterOptionKey,o=(this._facetSelections.get(r)||new Set).has(s.dataset.datatableFilterOption);s.classList.toggle("active",o),s.setAttribute("aria-pressed",o?"true":"false")}),this._element.querySelectorAll("[data-datatable-filter-group-summary]").forEach(s=>{let r=this._facetSelections.get(s.dataset.datatableFilterGroupSummary)||new Set;s.hidden=r.size===0,s.textContent=r.size>0?"".concat(r.size," selected"):""})}_createFacetBadge(t){let e=this._document.createElement("span");return e.className="datatable-facet-badge",e.textContent=t,e}_renderSelection(t){let e=Array.from(this._element.querySelectorAll("[data-datatable-select-all]"));t.forEach(r=>{[r.element,r.cardElement].forEach(n=>{let o=n?.querySelector("[data-datatable-select-row]");o&&(o.checked=this._selectedIds.has(r.element.id)),n?.classList.toggle("datatable-row-selected",this._selectedIds.has(r.element.id))})});let i=t.length,s=t.filter(r=>this._selectedIds.has(r.element.id)).length;e.forEach(r=>{r.checked=i>0&&s===i,r.indeterminate=s>0&&s<i})}_renderBulkActions(){let t=this._element.querySelector("[data-datatable-bulk-actions]");if(!t)return;t.hidden=this._selectedIds.size===0;let e=t.querySelector("[data-datatable-bulk-count]");e&&(e.textContent=String(this._selectedIds.size))}_renderFrameState(t){let e=t===0;this._element.querySelectorAll(".datatable-frame, .datatable-card-frame").forEach(i=>{i.hidden=e})}_renderEmptyState(t){let e=this._element.querySelector("[data-datatable-empty]");if(!e)return;let i=this._rows.length>0;e.hidden=t!==0,e.querySelector(".empty-state-title, .datatable-empty-title")?.replaceChildren(this._document.createTextNode(i?"No matching results":"No rows to display"));let s=e.querySelector(".empty-state-description, .datatable-empty-copy");s&&(s.hidden=!i);let r=e.querySelector("[data-datatable-empty-reset]");if(r){r.hidden=!i;let n=r.closest(".empty-state-actions");n&&(n.hidden=!i)}}_sortAriaValue(t){return t==="asc"?"ascending":t==="desc"?"descending":"none"}_renderSortHeaders(){this._element.querySelectorAll("th[data-datatable-column]").forEach(t=>{if(!t.querySelector("[data-datatable-sort-key]")){delete t.dataset.datatableSortState,delete t.dataset.datatableSortDirection,t.removeAttribute("aria-sort");return}let i=t.dataset.datatableColumn,s=i&&i===this._sortKey?this._sortDirection:"none";t.dataset.datatableSortState=s||"none",t.setAttribute("aria-sort",this._sortAriaValue(s)),s==="asc"||s==="desc"?t.dataset.datatableSortDirection=s:delete t.dataset.datatableSortDirection})}_renderPagination(t,e){let i=this._element.querySelector("[data-datatable-page-first]"),s=this._element.querySelector("[data-datatable-page-prev]"),r=this._element.querySelector("[data-datatable-page-next]"),n=this._element.querySelector("[data-datatable-page-last]"),o=this._currentPage<=1,c=this._currentPage>=e;[i,s].forEach(u=>this._setPageItemDisabled(u,o)),[r,n].forEach(u=>this._setPageItemDisabled(u,c));let l=this._element.querySelector("[data-datatable-results-summary]");if(l)if(t===0)l.textContent="No results";else{let u=(this._currentPage-1)*this._pageSize+1,d=Math.min(this._currentPage*this._pageSize,t);l.textContent="Showing ".concat(u,"-").concat(d," of ").concat(t)}let h=this._element.querySelector("template[data-datatable-page-numbers]");if(!h)return;let _=this._pageWindow(this._currentPage,e),m=Array.from(h.parentNode.querySelectorAll("[data-datatable-page-number], [data-datatable-page-ellipsis]")),p=m.map(u=>u.dataset.datatablePageEllipsis===void 0?Number(u.dataset.datatablePageNumber):"\u2026");if(p.length!==_.length||p.some((u,d)=>u!==_[d])){m.forEach(d=>d.remove());let u=this._document.createDocumentFragment();_.forEach(d=>{let D=this._document.createElement("li");if(D.className="page-item",d==="\u2026")D.dataset.datatablePageEllipsis="",D.innerHTML='<span class="page-link">\u2026</span>';else{D.dataset.datatablePageNumber=String(d);let w=this._document.createElement("button");w.type="button",w.className="page-link",w.textContent=String(d),w.setAttribute("aria-label","Go to page ".concat(d)),w.dataset.datatablePageGo=String(d),D.appendChild(w)}u.appendChild(D)}),h.parentNode.insertBefore(u,h)}h.parentNode.querySelectorAll("[data-datatable-page-number]").forEach(u=>{let d=Number(u.dataset.datatablePageNumber)===this._currentPage;u.classList.toggle("active",d),d?u.setAttribute("aria-current","page"):u.removeAttribute("aria-current")})}_renderPageSize(){let t=String(this._pageSize),e=this._element.querySelector("[data-datatable-page-size-value]");e&&(e.textContent=t);let i=this._element.querySelector("[data-datatable-page-size-select]");i&&(i.value=t),this._element.querySelectorAll("[data-datatable-page-size-option]").forEach(s=>{let r=s.dataset.datatablePageSizeOption===t;s.classList.toggle("active",r),s.setAttribute("aria-pressed",r?"true":"false")})}_setPageItemDisabled(t,e){t&&(t.disabled=e,t.closest(".page-item")?.classList.toggle("disabled",e))}_pageWindow(t,e){if(e<=7)return Array.from({length:e},(n,o)=>o+1);let i=new Set([1,e,t-1,t,t+1]),s=Array.from(i).filter(n=>n>=1&&n<=e).sort((n,o)=>n-o),r=[];return s.forEach((n,o)=>{o>0&&n-s[o-1]>1&&r.push("\u2026"),r.push(n)}),r}_isColumnFixed(t){return this._element.querySelector('th[data-datatable-column="'.concat(t,'"]'))?.hasAttribute("data-datatable-column-fixed")||!1}_setColumnVisible(t,e,{syncViewToggle:i=!0}={}){!e&&this._isColumnFixed(t)||(this._element.querySelectorAll('[data-datatable-column="'.concat(t,'"], [data-datatable-detail-column="').concat(t,'"]')).forEach(s=>{s.classList.toggle("datatable-col-hidden",!e)}),i&&this._element.querySelectorAll('[data-datatable-column-toggle="'.concat(t,'"]')).forEach(s=>{s.classList.toggle("active",e),s.setAttribute("aria-pressed",String(e))}))}_setSort(t,e){let i=e==="asc"||e==="desc"?e:null;this._sortKey=i?t:null,this._sortDirection=i,this._render(),this._trigger("sort",{key:this._sortKey,direction:this._sortDirection})}_handleSortAction(t){let e=t.target.closest("[data-datatable-sort-action]");if(!e)return;let i=e.closest(".dropdown-menu"),s=i?.closest(".datatable-sort")||this._reparentedSortMenus.get(i)?.owner;if(!s||!this._element.contains(s))return;let r=s.querySelector("[data-datatable-sort-key]")?.dataset.datatableSortKey;if(!r)return;let n=e.dataset.datatableSortAction;if(n==="hide"){this._setColumnVisible(r,!1);return}this._setSort(r,n)}_handleFacetClick(t){let e=t.target.closest("[data-datatable-facet-option]"),i=t.target.closest("[data-datatable-facet-clear]");if(!e&&!i)return;let r=t.target.closest("[data-datatable-facet]")?.dataset.datatableFacet;if(!r)return;let n=this._facetSelections.get(r)||new Set;if(i)n.clear();else{let o=e.dataset.datatableFacetOption;n.has(o)?n.delete(o):n.add(o)}this._facetSelections.set(r,n),this._filterMode==="picker"&&n.size===0&&this._visibleFacets.set(r,!1),this._currentPage=1,this._render(),this._trigger("filter")}_handleFacetSearch(t){let e=t.target.closest("[data-datatable-facet-search]");if(!e)return;let i=e.closest("[data-datatable-facet]"),s=M(e.value);i?.querySelectorAll("[data-datatable-facet-option]").forEach(r=>{let n=M(r.querySelector("[data-datatable-facet-option-label]")?.textContent||r.textContent);r.closest("li")?.classList.toggle("datatable-facet-search-hidden",s.length>0&&!n.includes(s))})}_handleFacetSearchKeydown(t){if(t.key!=="ArrowDown")return;let e=t.target.closest("[data-datatable-facet-search]");if(!e)return;let i=e.closest("[data-datatable-facet]"),r=Array.from(i?.querySelectorAll("[data-datatable-facet-option]")||[]).find(n=>!n.closest("li")?.classList.contains("datatable-facet-search-hidden"));r&&(t.preventDefault(),r.focus())}_handleFilterOptionClick(t){let e=t.target.closest("[data-datatable-filter-option]");if(!e)return;let i=e.dataset.datatableFilterOptionKey,s=e.dataset.datatableFilterOption;if(!i||!this._visibleFacets.has(i))return;this._visibleFacets.set(i,!0);let r=this._facetSelections.get(i)||new Set;r.has(s)?r.delete(s):r.add(s),this._facetSelections.set(i,r),r.size===0&&this._visibleFacets.set(i,!1),this._currentPage=1,this._render(),this._trigger("filter")}_showFilterPickerPanel(t=null){this._element.querySelectorAll("[data-datatable-filter-panel]").forEach(e=>{let i=e.dataset.datatableFilterPanel==="facets",s=e.dataset.datatableFilterPanelKey===t;e.hidden=t?!s:!i}),this._element.querySelector(".datatable-search-filter-menu")?.setAttribute("data-datatable-filter-menu-panel",t?"options":"facets")}_handleFilterPickerClick(t){let e=t.target.closest("[data-datatable-filter-group]");if(e){let i=e.dataset.datatableFilterGroup;this._showFilterPickerPanel(i);let s=this._element.querySelector('[data-datatable-filter-option-search="'.concat(i,'"]')),r=this._element.querySelector('[data-datatable-filter-option-key="'.concat(i,'"]'));(s||r)?.focus({preventScroll:!0});return}t.target.closest("[data-datatable-filter-back]")&&this._showFilterPickerPanel()}_handleFilterOptionSearch(t){let e=t.target.closest("[data-datatable-filter-option-search]");if(!e)return;let i=e.dataset.datatableFilterOptionSearch,s=M(e.value);this._element.querySelectorAll('[data-datatable-filter-option-key="'.concat(i,'"]')).forEach(r=>{let n=M(r.querySelector("[data-datatable-filter-option-label]")?.textContent||r.textContent);r.closest("li")?.classList.toggle("datatable-filter-option-search-hidden",s.length>0&&!n.includes(s))})}_handleFilterOptionSearchKeydown(t){if(t.key!=="ArrowDown")return;let e=t.target.closest("[data-datatable-filter-option-search]");if(!e)return;let i=e.dataset.datatableFilterOptionSearch,r=Array.from(this._element.querySelectorAll('[data-datatable-filter-option-key="'.concat(i,'"]'))).find(n=>!n.closest("li")?.classList.contains("datatable-filter-option-search-hidden"));r&&(t.preventDefault(),r.focus())}_handleFilterToggleClick(t){let e=t.target.closest("[data-datatable-filter-toggle]");if(!e)return;let i=e.dataset.datatableFilterToggle;if(!i||!this._visibleFacets.has(i))return;let s=!this._visibleFacets.get(i);this._visibleFacets.set(i,s),s||(this._facetSelections.get(i)?.clear(),this._currentPage=1,this._trigger("filter")),this._render()}_handleColumnToggleClick(t){let e=t.target.closest("[data-datatable-column-toggle]");if(!e)return;let i=e.dataset.datatableColumnToggle,s=e.getAttribute("aria-pressed")==="true";this._setColumnVisible(i,s,{syncViewToggle:!1})}_handleReset(){let t=this._element.querySelector("[data-datatable-search]");t&&(t.value=""),this._searchTerm="",this._facetSelections.forEach(e=>e.clear()),this._filterMode==="picker"&&this._visibleFacets.forEach((e,i)=>{this._visibleFacets.set(i,!1)}),this._currentPage=1,this._render(),this._trigger("filter")}_handleSelectAll(t){let e=t.target.checked,i=this._visibleRows(),s=(this._currentPage-1)*this._pageSize;i.slice(s,s+this._pageSize).forEach(n=>{e?this._selectedIds.add(n.element.id):this._selectedIds.delete(n.element.id)}),this._render(),this._trigger("select")}_handleSelectRow(t){let e=t.target.closest("[data-datatable-select-row]");if(!e)return;let i=e.closest("[data-datatable-row]"),s=e.closest("[data-datatable-card]"),r=i?.id||s?.dataset.datatableCardFor;r&&(e.checked?this._selectedIds.add(r):this._selectedIds.delete(r),this._render(),this._trigger("select"))}_handleBulkClick(t){if(t.target.closest("[data-datatable-bulk-clear]")){this._clearSelection();return}let e=t.target.closest("[data-datatable-bulk-update]");if(e){let s=e.dataset.datatableBulkUpdate,r=e.dataset.datatableBulkUpdateValue;this._applyBulkUpdate(s,r,e);return}let i=t.target.closest("[data-datatable-bulk-action]");if(i){let s=i.dataset.datatableBulkAction;if(s==="delete"){this._applyBulkDelete();return}this._trigger("bulk-".concat(s),{ids:this.getSelectedIds()})}}_clearSelection(){this._hideBulkTooltips({blur:!0}),this._selectedIds.clear(),this._render(),this._trigger("select")}_applyBulkUpdate(t,e,i){let s=i.querySelector("svg")?.cloneNode(!0),r=i.querySelector("span")?.textContent?.trim()??e;this._selectedIds.forEach(n=>{let o=this._rows.find(m=>m.element.id===n);if(!o)return;o.element.setAttribute("data-datatable-facet-".concat(t),e),o.facets[t]=e;let c=o.element.querySelector('[data-datatable-column="'.concat(t,'"]'));if(!c)return;let l=c.querySelector("[data-datatable-cell-label]");l?l.textContent=r:c.textContent=r;let h=c.querySelector("svg");h&&s&&h.replaceWith(s.cloneNode(!0));let _=o.cardElement?.querySelector('[data-datatable-detail-column="'.concat(t,'"] .datatable-card-value'));_&&(_.innerHTML=c.innerHTML)}),this._render(),this._trigger("bulk-update",{key:t,value:e,ids:this.getSelectedIds()})}_applyBulkDelete(){let t=this.getSelectedIds();t.forEach(e=>{let i=this._rows.findIndex(s=>s.element.id===e);i!==-1&&(this._rows[i].element.remove(),this._rows[i].cardElement?.remove(),this._rows.splice(i,1))}),this._selectedIds.clear(),this._render(),this._trigger("bulk-delete",{ids:t})}_handlePageClick(t){let e=t.target.closest("[data-datatable-page-go]");if(e){this._currentPage=Number(e.dataset.datatablePageGo),this._render();return}if(t.target.closest("[data-datatable-page-first]")){this._currentPage=1,this._render();return}if(t.target.closest("[data-datatable-page-prev]")){this._currentPage-=1,this._render();return}if(t.target.closest("[data-datatable-page-next]")){this._currentPage+=1,this._render();return}t.target.closest("[data-datatable-page-last]")&&(this._currentPage=this._pageCount(this._visibleRows().length),this._render())}_setPageSize(t){let e=Number(t);!Number.isFinite(e)||e<=0||(this._pageSize=e,this._element.dataset.datatablePageSize=String(e),this._currentPage=1,this._render())}_bindEvents(){let t=this._element.querySelector("[data-datatable-search]");this._listen(t,"input",s=>{this._searchTerm=M(s.target.value),this._currentPage=1,this._render(),this._trigger("filter")}),this._listen(t,"keydown",s=>{if(s.key!=="Enter")return;s.preventDefault();let r=this._element.querySelector("[data-datatable-filter-menu-trigger]"),n=this._bootstrap("Dropdown");r&&n&&n.getOrCreateInstance(r).hide()}),this._listen(this._element,"click",s=>{this._handleFilterPickerClick(s),this._handleFilterOptionClick(s),this._handleFilterToggleClick(s),this._handleFacetClick(s),this._handleColumnToggleClick(s),this._handlePageClick(s),this._handleBulkClick(s),s.target.closest("[data-datatable-empty-reset]")&&this._handleReset(),s.target.closest("[data-datatable-select-row]")&&this._handleSelectRow(s)}),this._listen(this._document,"click",s=>this._handleSortAction(s)),this._listen(this._document,"keydown",s=>{s.key==="Escape"&&this._selectedIds.size>0&&this._clearSelection()}),this._listen(this._element,"show.bs.dropdown",s=>{this._reparentRowActionMenu(s.target),this._reparentSortMenu(s.target);let r=this._bootstrap("Tooltip")?.getInstance(s.target);r?.hide(),r?.disable()}),this._listen(this._element,"hidden.bs.dropdown",s=>{this._restoreRowActionMenuForTrigger(s.target),this._restoreSortMenuForTrigger(s.target),this._bootstrap("Tooltip")?.getInstance(s.target)?.enable(),s.target.matches("[data-datatable-filter-menu-trigger]")&&this._showFilterPickerPanel()}),this._element.querySelectorAll("[data-datatable-filter-option-search]").forEach(s=>{this._listen(s,"input",r=>this._handleFilterOptionSearch(r)),this._listen(s,"keydown",r=>this._handleFilterOptionSearchKeydown(r))}),this._element.querySelectorAll("[data-datatable-facet-search]").forEach(s=>{this._listen(s,"input",r=>this._handleFacetSearch(r)),this._listen(s,"keydown",r=>this._handleFacetSearchKeydown(r))});let e=this._element.querySelector("[data-datatable-reset]");this._listen(e,"click",()=>this._handleReset()),this._element.querySelectorAll("[data-datatable-select-all]").forEach(s=>{this._listen(s,"change",r=>this._handleSelectAll(r))});let i=this._element.querySelector("[data-datatable-page-size-select]");this._listen(i,"change",s=>this._setPageSize(s.target.value)),this._element.querySelectorAll("[data-datatable-page-size-option]").forEach(s=>{this._listen(s,"click",()=>{this._setPageSize(s.dataset.datatablePageSizeOption)})})}};var $=new WeakMap,z=new WeakMap,K=new WeakMap,A="en",he=1440*60*1e3,Kt=new Date(2026,7,16),F=8;function bt(a,t){return a?.nodeType===1&&!!a.matches?.(t)}function b(a,t,e,i,s){t&&(t.addEventListener(e,i,s),a.push({target:t,type:e,handler:i,options:s}))}function I(a){a.forEach(({target:t,type:e,handler:i,options:s})=>{t.removeEventListener(e,i,s)}),a.length=0}function g(a){if(!a)return null;if(a instanceof Date)return Number.isNaN(a.getTime())?null:new Date(a.getFullYear(),a.getMonth(),a.getDate());if(typeof a=="number")return g(new Date(a));let t=String(a).trim(),e=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t);if(e){let i=new Date(Number(e[1]),Number(e[2])-1,Number(e[3]));return i.getFullYear()===Number(e[1])&&i.getMonth()===Number(e[2])-1&&i.getDate()===Number(e[3])?i:null}return null}function Et(a){return String(a).padStart(2,"0")}function y(a){return"".concat(a.getFullYear(),"-").concat(Et(a.getMonth()+1),"-").concat(Et(a.getDate()))}function S(a,t){return!a||!t?0:a.getTime()-t.getTime()}function T(a,t){return!!(a&&t&&y(a)===y(t))}function x(a,t){return new Date(a.getFullYear(),a.getMonth(),a.getDate()+t)}function pt(a,t){let e=new Date(a.getFullYear(),a.getMonth()+t,1),i=Math.min(a.getDate(),mt(e.getFullYear(),e.getMonth()));return new Date(e.getFullYear(),e.getMonth(),i)}function ot(a=A){try{if(typeof Intl<"u"&&typeof Intl.Locale=="function"){let t=new Intl.Locale(a||A),e=t.weekInfo||t.getWeekInfo?.();if(Number.isInteger(e?.firstDay))return e.firstDay%7}}catch{}return 0}function Ht(a=A){let t=ot(a);return Array.from({length:7},(e,i)=>x(Kt,(t+i)%7))}function C(a){return new Date(a.getFullYear(),a.getMonth(),1)}function mt(a,t){return new Date(a,t+1,0).getDate()}function Wt(a,t,e){return t&&S(a,t)<0?new Date(t):e&&S(a,e)>0?new Date(e):a}function Yt(a){if(Array.isArray(a))return a.map(g).filter(Boolean).map(y);if(!a)return[];let t=String(a).trim();if(!t)return[];try{let e=JSON.parse(t);if(Array.isArray(e))return e.map(g).filter(Boolean).map(y)}catch{}return t.split(",").map(g).filter(Boolean).map(y)}function q(a,t=A){return a?new Intl.DateTimeFormat(t||A,{month:"short",day:"numeric",year:"numeric"}).format(a):""}function At(a,t=A){return new Intl.DateTimeFormat(t||A,{month:"long",year:"numeric"}).format(a)}function ft(a,t,e=A){if(a)return t==="yyyy-mm-dd"?y(a):t?q(a,e):new Date(a)}function yt(a,t={}){let e=a.dataset||{},i=t.locale||e.datepickerLocale||e.calendarLocale||A,s=g(t.minDate||e.calendarMinDate||e.datepickerMinDate),r=g(t.maxDate||e.calendarMaxDate||e.datepickerMaxDate);return{locale:i,mode:t.mode||e.calendarMode||e.datepickerMode||"single",placeholder:t.placeholder||e.datepickerPlaceholder||"Pick a date",value:t.value||e.calendarValue||e.datepickerValue||"",startValue:t.startValue||e.calendarStartValue||e.datepickerStartValue||"",endValue:t.endValue||e.calendarEndValue||e.datepickerEndValue||"",minDate:s,maxDate:r,disabledDates:Yt(t.disabledDates||e.calendarDisabledDates||e.datepickerDisabledDates),captionLayout:t.captionLayout||e.calendarCaptionLayout||"",showPresets:t.showPresets??(e.calendarShowPresets==="true"||e.datepickerShowPresets==="true")}}function k(a,t,e,i={},s=!1){return a.dispatchEvent(new t.CustomEvent(e,{bubbles:!0,cancelable:s,detail:i}))}function gt(a,t){a&&(a.value=t||"")}function Tt(a,t){a&&(a.value=t||"")}function wt(a,t,e){if(e){a.dataset.invalid="true",t.classList.add("is-invalid"),t.setAttribute("aria-invalid","true");return}delete a.dataset.invalid,t.classList.remove("is-invalid"),t.removeAttribute("aria-invalid")}function It(a,t,e){e?.required&&e.checkValidity()&&wt(a,t,!1)}function Ct(a,t,e){return e<t?t:Math.min(Math.max(a,t),e)}function Ut(a,t,e){let i=a?.ownerDocument?.defaultView||window,s=a?i.getComputedStyle(a).getPropertyValue(t).trim():"",r=Number.parseFloat(s);if(!Number.isFinite(r))return e;if(s.endsWith("rem")){let n=a.ownerDocument.documentElement,o=Number.parseFloat(i.getComputedStyle(n).fontSize);return Number.isFinite(o)?r*o:e}if(s.endsWith("em")){let n=Number.parseFloat(i.getComputedStyle(a).fontSize);return Number.isFinite(n)?r*n:e}return Number.isFinite(r)?r:e}function H(a,t){return!!(t&&(a._element.contains(t)||a._popover.contains(t)))}function xt(a){let e=E(a._trigger)?.getAttribute("data-bs-theme")||null,i=a._document.defaultView?.getComputedStyle(a._trigger).direction;e?a._popover.setAttribute("data-bs-theme",e):a._popover.removeAttribute("data-bs-theme"),i==="ltr"||i==="rtl"?a._popover.setAttribute("dir",i):a._popover.removeAttribute("dir")}function Gt(a){let t=a._popover,e=E(a._trigger),i=P(e)||a._document.body||a._document.documentElement;if(i){if(a._popoverPortal?.portal===i&&t.parentElement===i){xt(a);return}ht(a),a._popoverPortal={parent:t.parentNode,nextSibling:t.nextSibling,owner:e,portal:i,hadTheme:t.hasAttribute("data-bs-theme"),theme:t.getAttribute("data-bs-theme"),hadDirection:t.hasAttribute("dir"),direction:t.getAttribute("dir")},i.appendChild(t),xt(a)}}function ht(a){let t=a._popoverPortal;if(!t)return;let e=a._popover;t.owner?.isConnected===!1?e.remove():t.parent?.isConnected?t.nextSibling?.parentNode===t.parent?t.parent.insertBefore(e,t.nextSibling):t.parent.appendChild(e):e.remove(),t.hadTheme?e.setAttribute("data-bs-theme",t.theme):e.removeAttribute("data-bs-theme"),t.hadDirection?e.setAttribute("dir",t.direction):e.removeAttribute("dir"),a._popoverPortal=null}function jt(a,t,e,i){let s=Ut(e,"--moo-datepicker-popover-offset",6),r=getComputedStyle(a).direction;t.style.position="fixed",t.style.inset="auto",t.style.right="auto",t.style.bottom="auto",t.style.maxHeight="",t.style.overflowY="";let n=a.getBoundingClientRect(),o=t.getBoundingClientRect(),c=i.innerWidth,l=i.innerHeight,h=r==="rtl"?n.right-o.width:n.left,_=Ct(h,F,c-o.width-F),m=n.bottom+s<=l?l-n.bottom-s-F:0,p=n.top-s-F,f=o.height>m&&p>m,u=f?"top":"bottom",d=Math.max(0,f?p:m),D=Math.min(o.height,d),w=f?n.top-s-D:n.bottom+s;t.style.left="".concat(Math.round(_),"px"),t.style.top="".concat(Math.round(Ct(w,F,l-D-F)),"px"),d>0&&(t.style.maxHeight="".concat(Math.floor(d),"px"),t.style.overflowY="auto"),t.dataset.datepickerPlacement=u}function Xt(a){a.style.position="",a.style.inset="",a.style.right="",a.style.bottom="",a.style.left="",a.style.top="",a.style.maxHeight="",a.style.overflowY="",delete a.dataset.datepickerPlacement}function Pt(a){I(a._floatingListeners),Gt(a);let t=()=>{a.isOpen()&&jt(a._trigger,a._popover,a._element,a._window)};a._positionPopover=t,t(),b(a._floatingListeners,a._window,"resize",t),b(a._floatingListeners,a._window,"scroll",t,!0),b(a._floatingListeners,a._document,"scroll",t,!0)}function lt(a){I(a._floatingListeners),a._positionPopover=null,Xt(a._popover),ht(a)}function Jt(a,t){return new Intl.DateTimeFormat(t||A,{month:"short"}).format(new Date(2026,a,1))}function Qt(a,t,e){let i=a?a.getFullYear():e.getFullYear()-100,s=t?t.getFullYear():e.getFullYear()+20,r=[];for(let n=i;n<=s;n+=1)r.push(n);return r}function Mt(a,t,e=""){let i=a.createElement("span");return i.className=e,i.setAttribute("aria-hidden","true"),i.textContent=t,i}var O=class a{static getInstance(t){return t?.nodeType===1&&z.get(t)||null}static getOrCreateInstance(t,e={}){return a.getInstance(t)||new a(t,e)}constructor(t,e={}){if(!bt(t,"[data-calendar]"))throw new TypeError("MooCalendar requires a [data-calendar] root element.");let i=z.get(t);if(i)return i;this._element=t,this._document=t.ownerDocument,this._window=this._document.defaultView||window,this._listeners=[],this._disposed=!1,this._config=yt(t,e),this._mode=this._config.mode==="range"?"range":"single",this._disabledDates=new Set(this._config.disabledDates),this._selectedDate=g(this._config.value),this._rangeStart=g(this._config.startValue),this._rangeEnd=g(this._config.endValue),this._activeDate=this._nearestEnabledDate(this._rangeStart||this._selectedDate||new Date),this._viewDate=C(this._activeDate),this._captionId=this._element.id?"".concat(this._element.id,"-caption"):"moo-calendar-caption-".concat(Math.random().toString(36).slice(2)),this._labelId=this._element.id?"".concat(this._element.id,"-label"):"moo-calendar-label-".concat(Math.random().toString(36).slice(2)),z.set(t,this),this._bindEvents(),this._render()}dispose(){this._disposed||(this._disposed=!0,I(this._listeners),this._element.replaceChildren(),z.get(this._element)===this&&z.delete(this._element))}getDate(t=void 0){return this._mode==="range"?this.getDates(t):ft(this._selectedDate,t,this._config.locale)}getDates(t=void 0){return[ft(this._rangeStart,t,this._config.locale),ft(this._rangeEnd,t,this._config.locale)]}setDate(t,e={}){if(this._mode!=="single")return!1;let i=g(t);return!i||this._isDisabled(i)?!1:(this._selectedDate=i,this._activeDate=i,this._viewDate=C(i),this._render(),e.emit!==!1&&this._emitChange(!0),!0)}setDates(t,e,i={}){if(this._mode!=="range")return!1;let s=g(t),r=g(e);return s&&this._isDisabled(s)||r&&this._isDisabled(r)?!1:(this._rangeStart=s,this._rangeEnd=r,this._rangeStart&&this._rangeEnd&&S(this._rangeStart,this._rangeEnd)>0&&([this._rangeStart,this._rangeEnd]=[this._rangeEnd,this._rangeStart]),this._activeDate=this._rangeEnd||this._rangeStart||this._activeDate,this._viewDate=C(this._activeDate),this._render(),i.emit!==!1&&this._emitChange(!!(this._rangeStart&&this._rangeEnd)),!0)}clear(t={}){this._selectedDate=null,this._rangeStart=null,this._rangeEnd=null,this._render(),t.emit!==!1&&this._emitChange(!1)}focusActiveDay(){this._dayButton(this._activeDate)?.focus()}_bindEvents(){b(this._listeners,this._element,"click",t=>{let e=t.target,i=e.closest?.("[data-calendar-day]"),s=e.closest?.("[data-calendar-prev]"),r=e.closest?.("[data-calendar-next]"),n=e.closest?.("[data-calendar-preset]");s?this._changeMonth(-1,!0):r?this._changeMonth(1,!0):n?this._selectPreset(n.dataset.calendarPreset):i&&this._selectDate(g(i.dataset.calendarDay),!0)}),b(this._listeners,this._element,"keydown",t=>{t.target.closest?.("[data-calendar-day]")&&this._handleDayKeydown(t)}),b(this._listeners,this._element,"change",t=>{t.target.matches?.("[data-calendar-month]")&&this._setActiveMonth(this._viewDate.getFullYear(),Number(t.target.value),!0),t.target.matches?.("[data-calendar-year]")&&this._setActiveMonth(Number(t.target.value),this._viewDate.getMonth(),!0)})}_emitChange(t){k(this._element,this._window,"change.moo.calendar",{date:this._selectedDate?new Date(this._selectedDate):void 0,value:this._selectedDate?y(this._selectedDate):"",startDate:this._rangeStart?new Date(this._rangeStart):void 0,endDate:this._rangeEnd?new Date(this._rangeEnd):void 0,startValue:this._rangeStart?y(this._rangeStart):"",endValue:this._rangeEnd?y(this._rangeEnd):"",complete:t})}_changeMonth(t,e){let i=C(pt(this._viewDate,t));this._setActiveMonth(i.getFullYear(),i.getMonth(),e)}_setActiveMonth(t,e,i=!1){let s=Math.min(this._activeDate.getDate(),mt(t,e));this._activeDate=this._nearestEnabledDate(new Date(t,e,s)),this._viewDate=C(this._activeDate),this._render(),i&&this.focusActiveDay()}_selectPreset(t){if(!t)return;let e=new Date,i={today:0,tomorrow:1,"in-3-days":3,"in-a-week":7,"in-2-weeks":14};t in i&&this._selectDate(x(e,i[t]),!0)}_handleDayKeydown(t){let e=t.target.closest?.("[data-calendar-day]"),i=g(e?.dataset?.calendarDay);i&&S(i,this._activeDate)!==0&&(this._activeDate=i);let s={ArrowRight:1,ArrowLeft:-1,ArrowDown:7,ArrowUp:-7},r=null;if(t.key in s)r=x(this._activeDate,s[t.key]);else if(t.key==="Home"){let n=ot(this._config.locale),o=(this._activeDate.getDay()-n+7)%7;r=x(this._activeDate,-o)}else if(t.key==="End"){let n=ot(this._config.locale),o=(this._activeDate.getDay()-n+7)%7;r=x(this._activeDate,6-o)}else if(t.key==="PageUp")r=pt(this._activeDate,-1);else if(t.key==="PageDown")r=pt(this._activeDate,1);else if(t.key==="Enter"||t.key===" "||t.key==="Spacebar"){t.preventDefault(),this._selectDate(this._activeDate,!0);return}else return;t.preventDefault(),this._setActiveDate(r,!0,S(r,this._activeDate)<0?-1:1)}_setActiveDate(t,e=!1,i=0){let s=i===0?this._nearestEnabledDate(t):this._nextEnabledDate(t,i);this._activeDate=s,this._viewDate=C(s),this._render(),e&&this.focusActiveDay()}_nextEnabledDate(t,e){let i=g(t);if(!i)return this._activeDate;let s=e<0?-1:1;for(let r=0;r<366&&!(this._config.minDate&&S(i,this._config.minDate)<0||this._config.maxDate&&S(i,this._config.maxDate)>0);r+=1){if(!this._isDisabled(i))return i;i=x(i,s)}return this._activeDate}_nearestEnabledDate(t){let e=Wt(g(t)||new Date,this._config.minDate,this._config.maxDate);if(!this._isDisabled(e))return e;let i=C(e),s=mt(i.getFullYear(),i.getMonth());for(let r=1;r<=s;r+=1){let n=new Date(i.getFullYear(),i.getMonth(),r);if(!this._isDisabled(n))return n}return e}_selectDate(t,e){if(!(!t||this._isDisabled(t))){if(this._activeDate=t,this._viewDate=C(t),this._mode==="range"){!this._rangeStart||this._rangeEnd||S(t,this._rangeStart)<0?(this._rangeStart=t,this._rangeEnd=null):this._rangeEnd=t,this._render(),e&&this._emitChange(!!(this._rangeStart&&this._rangeEnd));return}this._selectedDate=t,this._render(),e&&this._emitChange(!0)}}_isDisabled(t){return!t||this._config.minDate&&S(t,this._config.minDate)<0||this._config.maxDate&&S(t,this._config.maxDate)>0?!0:this._disabledDates.has(y(t))}_isSelected(t){return this._mode==="range"?T(t,this._rangeStart)||T(t,this._rangeEnd):T(t,this._selectedDate)}_rangeState(t){return this._mode!=="range"||!this._rangeStart?"":T(t,this._rangeStart)?"start":T(t,this._rangeEnd)?"end":this._rangeStart&&this._rangeEnd&&S(t,this._rangeStart)>0&&S(t,this._rangeEnd)<0?"middle":""}_dayButton(t){return this._element.querySelector('[data-calendar-day="'.concat(y(t),'"]'))}_render(){let t=this._document,e=t.createDocumentFragment(),i=t.createElement("div");i.className="moo-calendar__header";let s=t.createElement("button");s.className="btn btn-ghost btn-icon-sm moo-calendar__nav",s.type="button",s.dataset.calendarPrev="true",s.setAttribute("aria-label","Previous month"),s.appendChild(Mt(t,"\u2039","moo-calendar__nav-icon"));let r=t.createElement("button");r.className="btn btn-ghost btn-icon-sm moo-calendar__nav",r.type="button",r.dataset.calendarNext="true",r.setAttribute("aria-label","Next month"),r.appendChild(Mt(t,"\u203A","moo-calendar__nav-icon"));let n=t.createElement("div");if(n.className="moo-calendar__caption",n.id=this._captionId,n.setAttribute("aria-live","polite"),this._config.captionLayout==="dropdown"){let p=t.createElement("select");p.className="moo-calendar__select",p.dataset.calendarMonth="true",p.setAttribute("aria-label","Month");for(let u=0;u<12;u+=1){let d=t.createElement("option");d.value=String(u),d.textContent=Jt(u,this._config.locale),d.selected=u===this._viewDate.getMonth(),p.appendChild(d)}let f=t.createElement("select");f.className="moo-calendar__select",f.dataset.calendarYear="true",f.setAttribute("aria-label","Year"),Qt(this._config.minDate,this._config.maxDate,this._viewDate).forEach(u=>{let d=t.createElement("option");d.value=String(u),d.textContent=String(u),d.selected=u===this._viewDate.getFullYear(),f.appendChild(d)}),n.append(p,f)}else n.textContent=At(this._viewDate,this._config.locale);i.append(s,n,r),e.appendChild(i);let o=t.createElement("div");o.id=this._labelId,o.className="visually-hidden",o.textContent=this._element.getAttribute("aria-label")||At(this._viewDate,this._config.locale),e.appendChild(o);let c=t.createElement("div");c.className="moo-calendar__weekdays",c.setAttribute("role","row"),Ht(this._config.locale).forEach(p=>{let f=t.createElement("span");f.className="moo-calendar__weekday",f.setAttribute("role","columnheader"),f.textContent=new Intl.DateTimeFormat(this._config.locale,{weekday:"narrow"}).format(p),c.appendChild(f)});let l=t.createElement("div");l.className="moo-calendar__grid",l.setAttribute("role","grid"),l.setAttribute("aria-labelledby",this._labelId),l.appendChild(c);let h=C(this._viewDate),_=ot(this._config.locale),m=x(h,-((h.getDay()-_+7)%7));for(let p=0;p<6;p+=1){let f=t.createElement("div");f.className="moo-calendar__week",f.setAttribute("role","row");for(let u=0;u<7;u+=1){let d=x(m,p*7+u),D=y(d),w=t.createElement("div");w.className="moo-calendar__cell",w.setAttribute("role","gridcell");let v=t.createElement("button");v.className="moo-calendar__day",v.type="button",v.dataset.calendarDay=D,v.textContent=String(d.getDate()),v.tabIndex=T(d,this._activeDate)?0:-1,v.setAttribute("aria-label",q(d,this._config.locale));let St=this._isSelected(d);v.dataset.calendarSelected=String(St),w.setAttribute("aria-selected",St?"true":"false"),d.getMonth()!==this._viewDate.getMonth()&&(v.dataset.calendarOutside="true"),T(d,new Date)&&(v.dataset.calendarToday="true",v.setAttribute("aria-current","date"));let Dt=this._rangeState(d);Dt&&(v.dataset.calendarRange=Dt),this._isDisabled(d)&&(v.disabled=!0,v.setAttribute("aria-disabled","true")),w.appendChild(v),f.appendChild(w)}l.appendChild(f)}if(e.appendChild(l),this._config.showPresets){let p=t.createElement("div");p.className="moo-calendar__presets",[["today","Today"],["tomorrow","Tomorrow"],["in-3-days","In 3 days"],["in-a-week","In a week"],["in-2-weeks","In 2 weeks"]].forEach(([f,u])=>{let d=t.createElement("button");d.className="btn btn-outline-secondary btn-sm moo-calendar__preset",d.type="button",d.dataset.calendarPreset=f,d.textContent=u,p.appendChild(d)}),e.appendChild(p)}this._element.classList.add("moo-calendar"),this._element.dataset.calendar=this._element.dataset.calendar||"",this._element.dataset.calendarMode=this._mode,this._element.dataset.calendarActiveDate=y(this._activeDate),this._mode==="single"&&this._selectedDate?this._element.dataset.calendarValue=y(this._selectedDate):delete this._element.dataset.calendarValue,this._mode==="range"?(this._element.dataset.calendarStartValue=this._rangeStart?y(this._rangeStart):"",this._element.dataset.calendarEndValue=this._rangeEnd?y(this._rangeEnd):""):(delete this._element.dataset.calendarStartValue,delete this._element.dataset.calendarEndValue),this._element.replaceChildren(e)}},W=class a{static getInstance(t){return t?.nodeType===1&&$.get(t)||null}static getOrCreateInstance(t,e={}){return a.getInstance(t)||new a(t,e)}constructor(t,e={}){if(!bt(t,"[data-datepicker]"))throw new TypeError("MooDatepicker requires a [data-datepicker] root element.");let i=$.get(t);if(i)return i;if(this._element=t,this._document=t.ownerDocument,this._window=this._document.defaultView||window,this._listeners=[],this._floatingListeners=[],this._disposed=!1,this._positionPopover=null,this._popoverPortal=null,this._trigger=t.querySelector("[data-datepicker-trigger]"),this._popover=t.querySelector("[data-datepicker-popover]"),this._label=t.querySelector("[data-datepicker-label]"),this._input=t.querySelector("[data-datepicker-input]")||t.querySelector('input[type="hidden"]'),this._validationInput=t.querySelector("[data-datepicker-validation]"),this._calendarRoot=t.querySelector("[data-calendar]"),!this._trigger||!this._popover||!this._label||!this._input||!this._calendarRoot)throw new TypeError("MooDatepicker requires a trigger, popover, calendar, and hidden input.");this._config=yt(t,{...e,value:e.value||this._input.value||t.dataset.datepickerValue}),this._placeholder=this._config.placeholder,this._defaultValue=this._input.defaultValue||this._input.getAttribute("value")||"",this.calendar=O.getOrCreateInstance(this._calendarRoot,{...this._config,mode:"single",value:this._input.value||this._config.value}),$.set(t,this),this._syncFromCalendar(),this._bindEvents()}dispose(){this._disposed||(this._disposed=!0,I(this._listeners),this.hide(!1),lt(this),ht(this),I(this._floatingListeners),this.calendar?.dispose(),$.get(this._element)===this&&$.delete(this._element))}show(){this._trigger.disabled||this._element.dataset.datepickerDisabled==="true"||this.isOpen()||k(this._element,this._window,"show.moo.datepicker",{},!0)&&(this._popover.hidden=!1,this._popover.classList.add("show"),Pt(this),this._trigger.setAttribute("aria-expanded","true"),this.calendar.focusActiveDay(),k(this._element,this._window,"shown.moo.datepicker"))}hide(t=!0){this.isOpen()&&k(this._element,this._window,"hide.moo.datepicker",{},!0)&&(this._popover.hidden=!0,this._popover.classList.remove("show"),lt(this),this._trigger.setAttribute("aria-expanded","false"),t&&this._trigger.focus({preventScroll:!0}),k(this._element,this._window,"hidden.moo.datepicker"))}toggle(){this.isOpen()?this.hide():this.show()}isOpen(){return!this._popover.hidden}getDate(t=void 0){return this.calendar.getDate(t)}setDate(t,e={}){let i=this.calendar.setDate(t,{emit:!1});return i&&(this._syncFromCalendar(),e.emit!==!1&&this._emitChange()),i}clear(t={}){this.calendar.clear({emit:!1}),this._syncFromCalendar(),t.emit!==!1&&this._emitChange()}_bindEvents(){b(this._listeners,this._trigger,"click",()=>this.toggle()),b(this._listeners,this._popover,"keydown",e=>{e.key==="Escape"&&(e.preventDefault(),this.hide())}),b(this._listeners,this._document,"pointerdown",e=>{this.isOpen()&&!H(this,e.target)&&this._window.setTimeout(()=>{this.isOpen()&&!H(this,e.target)&&this.hide()},0)}),b(this._listeners,this._calendarRoot,"change.moo.calendar",e=>{this._syncFromCalendar(),this._emitChange(),e.detail.complete&&this.hide()});let t=this._input.form||this._element.closest("form");b(this._listeners,this._validationInput,"invalid",e=>{e.preventDefault(),wt(this._element,this._trigger,!0),this._trigger.focus({preventScroll:!0})}),b(this._listeners,t,"reset",()=>{this._window.setTimeout(()=>{this._defaultValue?this.setDate(this._defaultValue,{emit:!1}):this.clear({emit:!1})},0)})}_syncFromCalendar(){let t=this.calendar.getDate("yyyy-mm-dd")||"";gt(this._input,t),Tt(this._validationInput,t),It(this._element,this._trigger,this._validationInput),this._element.dataset.datepickerValue=t,this._label.dataset.datepickerEmpty=t?"false":"true",this._label.textContent=t?q(g(t),this._config.locale):this._placeholder}_emitChange(){k(this._element,this._window,"change.moo.datepicker",{date:this.getDate(),value:this.getDate("yyyy-mm-dd")||""})}},ct=class a{static getInstance(t){return t?.nodeType===1&&K.get(t)||null}static getOrCreateInstance(t,e={}){return a.getInstance(t)||new a(t,e)}constructor(t,e={}){if(!bt(t,"[data-datepicker-range]"))throw new TypeError("MooDateRangePicker requires a [data-datepicker-range] root element.");let i=K.get(t);if(i)return i;if(this._element=t,this._document=t.ownerDocument,this._window=this._document.defaultView||window,this._listeners=[],this._floatingListeners=[],this._disposed=!1,this._positionPopover=null,this._popoverPortal=null,this._trigger=t.querySelector("[data-datepicker-trigger]"),this._popover=t.querySelector("[data-datepicker-popover]"),this._label=t.querySelector("[data-datepicker-label]"),this._startInput=t.querySelector("[data-datepicker-range-start]"),this._endInput=t.querySelector("[data-datepicker-range-end]"),this._validationInput=t.querySelector("[data-datepicker-validation]"),this._calendarRoot=t.querySelector("[data-calendar]"),!this._trigger||!this._popover||!this._label||!this._startInput||!this._endInput||!this._calendarRoot)throw new TypeError("MooDateRangePicker requires a trigger, popover, calendar, and start/end hidden inputs.");this._config=yt(t,{...e,mode:"range",startValue:e.startValue||this._startInput.value||t.dataset.datepickerStartValue,endValue:e.endValue||this._endInput.value||t.dataset.datepickerEndValue}),this._placeholder=this._config.placeholder,this._defaultStartValue=this._startInput.defaultValue||this._startInput.getAttribute("value")||"",this._defaultEndValue=this._endInput.defaultValue||this._endInput.getAttribute("value")||"",this.calendar=O.getOrCreateInstance(this._calendarRoot,this._config),K.set(t,this),this._syncFromCalendar(),this._bindEvents()}dispose(){this._disposed||(this._disposed=!0,I(this._listeners),this.hide(!1),lt(this),ht(this),I(this._floatingListeners),this.calendar?.dispose(),K.get(this._element)===this&&K.delete(this._element))}show(){this._trigger.disabled||this._element.dataset.datepickerDisabled==="true"||this.isOpen()||k(this._element,this._window,"show.moo.datepicker",{},!0)&&(this._popover.hidden=!1,this._popover.classList.add("show"),Pt(this),this._trigger.setAttribute("aria-expanded","true"),this.calendar.focusActiveDay(),k(this._element,this._window,"shown.moo.datepicker"))}hide(t=!0){this.isOpen()&&k(this._element,this._window,"hide.moo.datepicker",{},!0)&&(this._popover.hidden=!0,this._popover.classList.remove("show"),lt(this),this._trigger.setAttribute("aria-expanded","false"),t&&this._trigger.focus({preventScroll:!0}),k(this._element,this._window,"hidden.moo.datepicker"))}toggle(){this.isOpen()?this.hide():this.show()}isOpen(){return!this._popover.hidden}getDates(t=void 0){return this.calendar.getDates(t)}setDates(t,e,i={}){let s=this.calendar.setDates(t,e,{emit:!1});return s&&(this._syncFromCalendar(),i.emit!==!1&&this._emitChange()),s}clear(t={}){this.calendar.clear({emit:!1}),this._syncFromCalendar(),t.emit!==!1&&this._emitChange()}_bindEvents(){b(this._listeners,this._trigger,"click",()=>this.toggle()),b(this._listeners,this._popover,"keydown",i=>{i.key==="Escape"&&(i.preventDefault(),this.hide())}),b(this._listeners,this._document,"pointerdown",i=>{this.isOpen()&&!H(this,i.target)&&this._window.setTimeout(()=>{this.isOpen()&&!H(this,i.target)&&this.hide()},0)});let t=()=>{this._window.setTimeout(()=>{this.isOpen()&&!H(this,this._document.activeElement)&&this.hide(!1)},0)};b(this._listeners,this._element,"focusout",t),b(this._listeners,this._popover,"focusout",t),b(this._listeners,this._calendarRoot,"change.moo.calendar",i=>{this._syncFromCalendar(),this._emitChange(),i.detail.complete?this.hide():this.calendar.focusActiveDay()});let e=this._startInput.form||this._element.closest("form");b(this._listeners,this._validationInput,"invalid",i=>{i.preventDefault(),wt(this._element,this._trigger,!0),this._trigger.focus({preventScroll:!0})}),b(this._listeners,e,"reset",()=>{this._window.setTimeout(()=>{this.setDates(this._defaultStartValue,this._defaultEndValue,{emit:!1})},0)})}_syncFromCalendar(){let[t="",e=""]=this.calendar.getDates("yyyy-mm-dd");gt(this._startInput,t||""),gt(this._endInput,e||""),Tt(this._validationInput,t&&e?"".concat(t," - ").concat(e):""),It(this._element,this._trigger,this._validationInput),this._element.dataset.datepickerStartValue=t||"",this._element.dataset.datepickerEndValue=e||"",this._label.dataset.datepickerEmpty=t?"false":"true",t&&e?this._label.textContent="".concat(q(g(t),this._config.locale)," - ").concat(q(g(e),this._config.locale)):t?this._label.textContent=q(g(t),this._config.locale):this._label.textContent=this._placeholder}_emitChange(){let[t,e]=this.getDates(),[i="",s=""]=this.getDates("yyyy-mm-dd");k(this._element,this._window,"change.moo.datepicker",{startDate:t,endDate:e,startValue:i,endValue:s})}};var dt=new WeakMap,Y=class a{static getInstance(t){return t?.nodeType===1&&dt.get(t)||null}static getOrCreateInstance(t,e={}){return a.getInstance(t)||new a(t,e)}constructor(t,e={}){if(t?.nodeType!==1||!t.matches('[data-slot="sidebar-wrapper"]'))throw new TypeError("Sidebar requires a [data-slot=sidebar-wrapper] root.");let i=dt.get(t);if(i)return i;this._element=t,this._document=t.ownerDocument,this._window=this._document.defaultView,this._documentElement=this._document.documentElement,this._root=E(t)||this._document.body||this._documentElement,this._sidebar=t.querySelector('[data-slot="sidebar"]'),this._config={breakpoint:"(min-width: 992px)",storagePrefix:"moo-sidebar:",keyboard:!0,...e},this._listeners=[],this._tooltipAnchors=new Set,this._flyout=null,this._flyoutOwner=null,this._offcanvas=null,this._offcanvasTrigger=null,dt.set(t,this),this._bindEvents(),this._restoreState(),this._scrollActiveItemIntoView(),this._element.setAttribute("data-sidebar-ready",""),this._observeDirection()}dispose(){this._listeners.forEach(({target:t,type:e,handler:i,options:s})=>{t.removeEventListener(e,i,s)}),this._listeners=[],this._directionObserver?.disconnect(),this._closeFlyouts(),this._element.querySelectorAll("[data-sidebar-dropdown-positioned]").forEach(t=>this._clearDropdownPosition(t)),this._element.querySelectorAll("[data-sidebar-tooltip]").forEach(t=>this._disposeTooltip(t)),this._offcanvas?.dispose(),this._offcanvas=null,this._offcanvasTrigger=null,this._element.removeAttribute("data-sidebar-ready"),dt.delete(this._element)}_listen(t,e,i,s){t?.addEventListener(e,i,s),t&&this._listeners.push({target:t,type:e,handler:i,options:s})}_bootstrap(t){return this._window.bootstrap?.[t]||null}_portalRoot(t=this._element){return P(E(t))||this._document.body||this._documentElement}_isDesktop(){return this._window.matchMedia(this._config.breakpoint).matches}_isCollapsed(){return this._isDesktop()&&this._sidebar?.dataset?.collapsible==="icon"&&this._element.dataset.sidebarState==="collapsed"}_trigger(t,e={}){return this._element.dispatchEvent(new this._window.CustomEvent("".concat(t,".moo.sidebar"),{bubbles:!0,cancelable:t==="show"||t==="hide",detail:e}))}_observeDirection(){let t=this._window.MutationObserver;t&&(this._directionObserver=new t(()=>{this._closeFlyouts(),this._syncTooltips()}),this._directionObserver.observe(this._documentElement,{attributes:!0,attributeFilter:["dir"]}))}_restoreState(){let t=this._element.dataset.sidebarKey,e=null;if(t)try{e=this._window.localStorage.getItem(this._config.storagePrefix+t)}catch{e=null}let i=e==="collapsed"||e==="expanded"?e:this._element.dataset.sidebarState==="collapsed"?"collapsed":"expanded";this._setState(i,!1,!1)}_scrollActiveItemIntoView(){let e=this._element.querySelector('[data-slot="sidebar-content"] a[data-slot="sidebar-menu-button"][aria-current="page"], [data-slot="sidebar-content"] a.sidebar-menu-button[aria-current="page"], [data-slot="sidebar-content"] a.sidebar-menu-button.active')||this._element.querySelector('[data-slot="sidebar-content"] [data-slot="sidebar-menu-button"][aria-current="page"], [data-slot="sidebar-content"] .sidebar-menu-button[aria-current="page"], [data-slot="sidebar-content"] .sidebar-menu-button.active'),i=e?.closest?.('[data-slot="sidebar-content"]');if(!e||!i||i.clientHeight<=0)return;let s=i.scrollHeight-i.clientHeight;if(s<=0)return;let r=i.getBoundingClientRect(),n=e.getBoundingClientRect();if(r.height<=0||n.height<=0)return;let o=i.scrollTop+n.top-r.top-(i.clientHeight-n.height)/2;i.scrollTop=Math.round(Math.min(Math.max(o,0),s))}_setState(t,e=!0,i=!0){let s=t==="collapsed"?"collapsed":"expanded",r=this._element.dataset.sidebarState;this._element.dataset.sidebarState=s;let n=this._element.dataset.sidebarKey;if(n==="catalog-shell"&&(this._root.dataset.sidebarCatalogState=s),e&&n)try{this._window.localStorage.setItem(this._config.storagePrefix+n,s)}catch{}this._syncControls(),s==="expanded"&&this._element.querySelectorAll(".sidebar-menu-item").forEach(o=>this._resetFlyoutTrigger(o)),this._syncTooltips(),i&&r!==s&&this._trigger("change",{state:s,previousState:r||null})}_toggle(){this._setState(this._element.dataset.sidebarState==="collapsed"?"expanded":"collapsed")}_syncControls(){let t=this._isDesktop()?this._element.dataset.sidebarState==="expanded":this._sidebar?.classList.contains("show")||!1;this._element.querySelectorAll("[data-sidebar-trigger], [data-sidebar-rail]").forEach(e=>e.setAttribute("aria-expanded",String(t)))}_resetFlyoutTrigger(t,e=null){let i=t?.querySelector(":scope > .sidebar-menu-sub-trigger"),s=t?.querySelector(":scope > .sidebar-menu-sub");i&&s&&i.setAttribute("aria-expanded",String(e??s.classList.contains("show")))}_clearDropdownPosition(t){let e=t?.matches?.(".sidebar-menu-item")?t:t?.closest?.(".sidebar-menu-item");e&&(delete e.dataset.sidebarDropdownPositioned,e.style.removeProperty("--moo-sidebar-dropdown-block-start"),e.style.removeProperty("--moo-sidebar-dropdown-block-end"),e.style.removeProperty("--moo-sidebar-dropdown-left"),e.style.removeProperty("--moo-sidebar-dropdown-right"))}_closeDropdowns(t=null){let e=this._bootstrap("Dropdown");this._element.querySelectorAll('[data-bs-toggle="dropdown"][aria-expanded="true"]').forEach(i=>{i!==t&&(e?e.getOrCreateInstance(i).hide():(i.setAttribute("aria-expanded","false"),i.closest(".dropdown")?.querySelector(".dropdown-menu.show")?.classList.remove("show"),this._clearDropdownPosition(i)))})}_positionDropdown(t){let e=t?.closest?.(".sidebar-menu-item"),i=t?.classList.contains("sidebar-menu-button--workspace")&&t.closest('[data-slot="sidebar-header"]'),s=t?.closest(".sidebar-menu-item--account")&&t.closest('[data-slot="sidebar-footer"]');if(!t||!e||!(i||s)||!this._isDesktop()){this._clearDropdownPosition(t);return}this._closeFlyouts();let r=t.getBoundingClientRect(),n=4;if((t.closest('[data-slot="sidebar"]')?.dataset.side||"left")==="right"){let l=this._window.innerWidth-r.left+n;e.style.setProperty("--moo-sidebar-dropdown-right","".concat(Math.round(l),"px")),e.style.removeProperty("--moo-sidebar-dropdown-left")}else{let l=r.right+n;e.style.setProperty("--moo-sidebar-dropdown-left","".concat(Math.round(l),"px")),e.style.removeProperty("--moo-sidebar-dropdown-right")}i?(e.style.setProperty("--moo-sidebar-dropdown-block-start","".concat(Math.round(r.bottom+n),"px")),e.style.removeProperty("--moo-sidebar-dropdown-block-end")):(e.style.setProperty("--moo-sidebar-dropdown-block-end","".concat(Math.round(this._window.innerHeight-r.top+n),"px")),e.style.removeProperty("--moo-sidebar-dropdown-block-start")),e.dataset.sidebarDropdownPositioned=""}_removeFlyoutPortal(){this._flyout?.remove(),this._flyoutOwner&&this._resetFlyoutTrigger(this._flyoutOwner,!1),this._flyout=null,this._flyoutOwner=null}_closeFlyouts(){this._removeFlyoutPortal(),this._element.querySelectorAll(".sidebar-menu-item--flyout-open").forEach(t=>{t.classList.remove("sidebar-menu-item--flyout-open"),t.style.removeProperty("--moo-sidebar-flyout-block-start"),t.style.removeProperty("--moo-sidebar-flyout-left"),this._resetFlyoutTrigger(t,!1)})}_openFlyout(t){let e=t?.querySelector(":scope > .sidebar-menu-sub"),i=t?.querySelector(":scope > .sidebar-menu-sub-trigger");if(!t||!e||!this._isCollapsed()||this._flyoutOwner===t&&this._flyout)return;this._closeDropdowns(),this._closeFlyouts();let s=t.getBoundingClientRect(),r=this._sidebar,n=r?.getBoundingClientRect()||s,o=4,c=e.cloneNode(!0);c.removeAttribute("id"),c.classList.remove("collapse","show","collapsing"),c.classList.add("sidebar-menu-flyout"),c.dataset.sidebarFlyout="",c.removeAttribute("style"),c.style.setProperty("--moo-sidebar-flyout-block-start","".concat(Math.round(s.top),"px"));let l=r?.dataset.side||"left";this._portalRoot(t).appendChild(c);let h=c.getBoundingClientRect().width,_=l==="right"?n.left-h-o:n.right+o,m=Math.max(0,Math.min(this._window.innerWidth-h,_));c.style.setProperty("--moo-sidebar-flyout-left","".concat(Math.round(m),"px")),this._flyout=c,this._flyoutOwner=t,t.classList.add("sidebar-menu-item--flyout-open"),i?.setAttribute("aria-expanded","true")}_tooltipAnchor(t){return t.closest("li")||t}_isIdentityTrigger(t){return t.closest(".sidebar-menu-item--account")||t.classList.contains("sidebar-menu-button--workspace")}_disposeTooltip(t){let e=this._bootstrap("Tooltip");if(!e||!t)return;let i=this._tooltipAnchor(t);e.getInstance(i)?.dispose(),this._tooltipAnchors.delete(i),i.removeAttribute("title"),i.removeAttribute("data-bs-title"),i.removeAttribute("data-bs-original-title"),i.removeAttribute("aria-describedby")}_syncTooltips(){let t=this._bootstrap("Tooltip");if(!t)return;let e=this._isCollapsed(),s=(this._sidebar?.dataset.side||"left")==="right"?"left":"right";this._element.querySelectorAll("[data-sidebar-tooltip]").forEach(r=>{if(this._disposeTooltip(r),!e||this._isIdentityTrigger(r)||r.closest(".sidebar-menu-item")?.querySelector(":scope > .sidebar-menu-sub"))return;let n=this._tooltipAnchor(r);new t(n,{title:r.getAttribute("data-sidebar-tooltip"),placement:s,offset:[0,8],container:this._portalRoot(r),trigger:"hover focus"}),this._tooltipAnchors.add(n)})}_bindEvents(){this._listen(this._sidebar,"shown.bs.offcanvas",()=>this._syncControls()),this._listen(this._sidebar,"hidden.bs.offcanvas",()=>{this._syncControls();let t=this._offcanvasTrigger;this._offcanvasTrigger=null,t?.isConnected&&t.focus()}),this._listen(this._document,"show.bs.dropdown",t=>{let e=this._dropdownControl(t.target);e&&(this._closeDropdowns(e),this._disposeTooltip(e),this._positionDropdown(e))}),this._listen(this._document,"hidden.bs.dropdown",t=>{let e=this._dropdownControl(t.target);e&&(this._clearDropdownPosition(e),this._syncTooltips())}),this._listen(this._element,"click",t=>this._handleControlClick(t)),this._listen(this._window,"click",t=>this._handleSubmenuClick(t),!0),this._listen(this._document,"click",t=>this._handleOutsideFlyoutClick(t)),this._listen(this._document,"keydown",t=>this._handleShortcut(t)),this._listen(this._window,"resize",()=>{this._closeFlyouts(),this._element.querySelectorAll("[data-sidebar-dropdown-positioned]").forEach(t=>this._clearDropdownPosition(t)),this._syncControls(),this._syncTooltips()})}_dropdownControl(t){return!(t instanceof this._window.Element)||!this._element.contains(t)?null:t.matches('[data-bs-toggle="dropdown"][data-sidebar-tooltip]')?t:t.querySelector?.('[data-bs-toggle="dropdown"][data-sidebar-tooltip]')||null}_handleControlClick(t){let e=t.target,i=e instanceof this._window.Element?e.closest("[data-sidebar-trigger], [data-sidebar-rail]"):null;if(!i||!this._element.contains(i))return;if(this._isDesktop()){t.preventDefault(),this._closeFlyouts(),this._toggle();return}if(!i.matches("[data-sidebar-trigger]"))return;let s=this._document.getElementById(i.getAttribute("aria-controls")),r=this._bootstrap("Offcanvas");s&&r&&(this._offcanvasTrigger=i,this._offcanvas=r.getOrCreateInstance(s),this._offcanvas.toggle())}_handleSubmenuClick(t){let e=t.target,i=e instanceof this._window.Element?e.closest(".sidebar-menu-sub-trigger"):null,s=i?.closest(".sidebar-menu-item");!i||!s||!this._element.contains(s)||!this._isCollapsed()||(t.preventDefault(),t.stopImmediatePropagation(),this._flyoutOwner===s&&this._flyout?this._closeFlyouts():this._openFlyout(s))}_handleOutsideFlyoutClick(t){this._flyout&&(this._flyout.contains(t.target)?this._closeFlyouts():this._flyoutOwner?.contains(t.target)||this._closeFlyouts())}_handleShortcut(t){let e=t.target,i=e instanceof this._window.Element&&(e.matches("input, textarea, select")||e.isContentEditable);t.defaultPrevented||t.isComposing||i||!this._config.keyboard||!(t.metaKey||t.ctrlKey)||t.key.toLowerCase()!=="b"||!this._isDesktop()||(this._document.querySelector('[data-slot="sidebar-wrapper"][data-sidebar-key]')||this._document.querySelector('[data-slot="sidebar-wrapper"]'))!==this._element||(t.preventDefault(),this._closeFlyouts(),this._toggle())}};var U=new WeakMap;function X(a,t){let e=Number(a);return Number.isFinite(e)?e:t}function R(a){return X(a.min,0)}function j(a){return X(a.max,100)}function Zt(a){if(!a.step||a.step==="any")return 1;let t=Number(a.step);return Number.isFinite(t)&&t>0?t:1}function L(a,t,e){return Math.min(Math.max(a,t),e)}function Ft(a){let t=String(a);return t.includes(".")?t.split(".").at(-1).length:0}function te(a,t){let e=R(t),i=j(t);if(t.step==="any")return Number(L(a,e,i).toFixed(4));let s=Zt(t),r=e+Math.round((a-e)/s)*s,n=Math.max(Ft(s),Ft(e));return L(Number(r.toFixed(n)),e,i)}function G(a){let t=R(a),e=j(a);return e<=t?0:(X(a.value,t)-t)/(e-t)*100}function ut(a){return a.value||String(R(a))}var J=class a{static getInstance(t){return t?.nodeType===1&&U.get(t)||null}static getOrCreateInstance(t,e={}){return a.getInstance(t)||new a(t,e)}constructor(t,e={}){if(t?.nodeType!==1||!t.matches("[data-slider]"))throw new TypeError("MooSlider requires a [data-slider] root element.");let i=U.get(t);if(i)return i;if(this._element=t,this._document=t.ownerDocument,this._window=this._document.defaultView,this._config={...e},this._listeners=[],this._dragListeners=[],this._draggingInput=null,this._disposed=!1,this._inputs=Array.from(t.querySelectorAll(':scope input[type="range"][data-slider-input]')),this._track=t.querySelector("[data-slider-track]"),this._output=t.querySelector("[data-slider-output]"),this._inputs.length<1||this._inputs.length>2)throw new TypeError("MooSlider requires one or two native range inputs.");if(!this._track)throw new TypeError("MooSlider requires a [data-slider-track] element.");U.set(t,this),this._bindEvents(),this._sync()}dispose(){this._disposed||(this._disposed=!0,this._clearDragListeners(),this._clearPointerFocus(),this._listeners.forEach(({target:t,type:e,handler:i,options:s})=>{t.removeEventListener(e,i,s)}),this._listeners=[],U.get(this._element)===this&&U.delete(this._element))}_listen(t,e,i,s){t&&(t.addEventListener(e,i,s),this._listeners.push({target:t,type:e,handler:i,options:s}))}_listenDuringDrag(t,e,i,s){t&&(t.addEventListener(e,i,s),this._dragListeners.push({target:t,type:e,handler:i,options:s}))}_clearDragListeners(){this._dragListeners.forEach(({target:t,type:e,handler:i,options:s})=>{t.removeEventListener(e,i,s)}),this._dragListeners=[],this._draggingInput=null,this._element.removeAttribute("data-slider-dragging")}_bindEvents(){this._inputs.forEach(e=>{this._listen(e,"input",()=>this._sync(e)),this._listen(e,"change",()=>{this._sync(e),this._trigger("change")}),this._listen(e,"keydown",()=>this._clearPointerFocus()),this._listen(e,"focusout",()=>this._clearPointerFocus())}),new Set(this._inputs.map(e=>e.form||e.closest?.("form")).filter(Boolean)).forEach(e=>{this._listen(e,"reset",()=>{this._window.setTimeout(()=>this._sync(),0)})}),this._listen(this._track,"pointerdown",e=>this._handleTrackPointer(e))}_trigger(t){this._element.dispatchEvent(new this._window.CustomEvent("".concat(t,".moo.slider"),{bubbles:!0}))}_isRange(){return this._inputs.length===2}_sync(t=null){if(this._isRange()){let[i,s]=this._inputs,r=X(i.value,R(i)),n=X(s.value,j(s));r>n&&(t===s?s.value=i.value:i.value=s.value),this._writeFill(G(i),G(s)),this._writeOutput("".concat(ut(i)," - ").concat(ut(s))),this._syncAria(i),this._syncAria(s);return}let e=this._inputs[0];this._writeFill(0,G(e)),this._writeOutput(ut(e)),this._syncAria(e)}_syncAria(t){t.setAttribute("aria-valuemin",String(R(t))),t.setAttribute("aria-valuemax",String(j(t))),t.setAttribute("aria-valuenow",ut(t))}_writeFill(t,e){let i=L(t,0,100),s=L(e,0,100);this._element.style.setProperty("--moo-slider-start","".concat(Math.min(i,s),"%")),this._element.style.setProperty("--moo-slider-end","".concat(Math.max(i,s),"%"))}_writeOutput(t){this._output&&(this._output.textContent=t)}_handleTrackPointer(t){if(t.button!==void 0&&t.button!==0)return;let e=this._inputs.filter(r=>!r.disabled);if(!e.length)return;t.preventDefault?.();let i=this._pointerPercent(t),s=this._nearestInput(i*100,e);this._setPointerFocus(),this._startDrag(s,t),this._setInputFromPointer(s,t)}_setPointerFocus(){this._element.setAttribute("data-slider-pointer-focus","true")}_clearPointerFocus(){this._element.removeAttribute("data-slider-pointer-focus")}_startDrag(t,e){this._clearDragListeners(),this._draggingInput=t,this._element.setAttribute("data-slider-dragging","true"),this._track.setPointerCapture?.(e.pointerId);let i=e.pointerId,s=o=>i===void 0||o.pointerId===i,r=o=>{!s(o)||this._draggingInput!==t||(o.preventDefault?.(),this._setInputFromPointer(t,o))},n=o=>{!s(o)||this._draggingInput!==t||(o.preventDefault?.(),this._setInputFromPointer(t,o,!1),t.dispatchEvent(new this._window.Event("change",{bubbles:!0})),this._track.releasePointerCapture?.(i),this._clearDragListeners())};this._listenDuringDrag(this._document,"pointermove",r),this._listenDuringDrag(this._document,"pointerup",n),this._listenDuringDrag(this._document,"pointercancel",n)}_setInputFromPointer(t,e,i=!0){let s=this._pointerPercent(e),r=R(t),n=j(t);t.value=String(te(r+s*(n-r),t)),t.focus({preventScroll:!0}),this._sync(t),i&&t.dispatchEvent(new this._window.Event("input",{bubbles:!0}))}_pointerPercent(t){let e=this._track.getBoundingClientRect();return(this._element.dataset.sliderOrientation||"horizontal")==="vertical"?L((e.bottom-t.clientY)/(e.height||1),0,1):this._horizontalPointerPercent(t,e)}_horizontalPointerPercent(t,e){let s=this._window.getComputedStyle?.(this._element).direction==="rtl"?e.right-t.clientX:t.clientX-e.left;return L(s/(e.width||1),0,1)}_nearestInput(t,e){if(e.length===1)return e[0];let[i,s]=e,r=G(i),n=G(s),o=Math.abs(r-t),c=Math.abs(n-t);return o===c?t>=r?s:i:c<o?s:i}};var Q=new WeakMap,vt='.moo-ui[data-bs-theme="light"], .moo-ui[data-bs-theme="dark"]';function qt(a,t=0){if(!a||typeof a!="object"||Array.isArray(a))throw new TypeError("TableOfContents options must be an object.");let e=a.activationOffset===void 0?t:a.activationOffset;if(typeof e!="number"||!Number.isFinite(e)||e<0)throw new TypeError("TableOfContents activationOffset must be a finite nonnegative number.");return e}function Ot(a){if(!a?.startsWith("#")||a.length===1)return null;try{return decodeURIComponent(a.slice(1))}catch{return null}}var Z=class a{static getInstance(t){return t?.nodeType===1&&Q.get(t)||null}static getOrCreateInstance(t,e={}){return a.getInstance(t)||new a(t,e)}constructor(t,e={}){if(t?.nodeType!==1||!t.matches("[data-toc]"))throw new TypeError("TableOfContents requires a [data-toc] root element.");let i=Q.get(t);if(i)return i;this._element=t,this._document=t.ownerDocument,this._window=this._document.defaultView,this._offset=qt(e),this._listeners=[],this._originalLinks=new Map,this._originalStatus=new Map,this._originalMarker={attribute:t.getAttribute("data-toc-marker"),properties:["--moo-toc-marker-offset","--moo-toc-marker-height"].map(s=>({name:s,value:t.style.getPropertyValue(s),priority:t.style.getPropertyPriority(s)}))},this._links=[],this._targets=[],this._frame=0,this._disposed=!1,Q.set(t,this),this.refresh()}refresh(t={}){if(this._disposed)return this;let e=qt(t,this._offset);this._clearListeners(),this._offset=e;let i=this._element.closest(vt),s=this._element.getAttribute("data-toc-content"),r=s?this._document.getElementById(s):i,n=this._element.getAttribute("data-toc-scroll-root");if(this._scrollElement=n?this._document.getElementById(n):null,this._status=Array.from(this._element.querySelectorAll("[data-toc-current]")).find(l=>l.closest("[data-toc]")===this._element)||null,this._status&&!this._originalStatus.has(this._status)&&this._originalStatus.set(this._status,this._status.textContent),this._overview=this._status?this._originalStatus.get(this._status):"",this._links=Array.from(this._element.querySelectorAll('a[href^="#"]')).filter(l=>l.closest("[data-toc]")===this._element).map(l=>({link:l,id:Ot(l.getAttribute("href"))})),this._links.forEach(({link:l})=>{this._originalLinks.has(l)||this._originalLinks.set(l,{active:l.classList.contains("active"),current:l.getAttribute("aria-current")})}),this._targets=[],this._activate(null),!i||!r||r.closest(vt)!==i||n&&(!this._scrollElement||!this._scrollElement.contains(r)))return this;let o=new Set;if(this._links.forEach(({id:l,link:h})=>{let _=l?this._document.getElementById(l):null;!_||o.has(l)||!r.contains(_)||_.closest(vt)!==i||(o.add(l),this._targets.push({id:l,target:_,label:h.textContent.trim()}))}),!this._targets.length)return this;let c=()=>this._requestUpdate();return this._listen(this._scrollElement||this._window,"scroll",c,{passive:!0}),this._listen(this._window,"resize",c),this._listen(this._window,"hashchange",c),this._listen(this._element,"click",c),this._update(),this}dispose(){if(this._disposed)return;this._disposed=!0,this._clearListeners(),this._originalLinks.forEach(({active:i,current:s},r)=>{r.classList.toggle("active",i),s===null?r.removeAttribute("aria-current"):r.setAttribute("aria-current",s)}),this._originalStatus.forEach((i,s)=>{s.textContent=i});let{attribute:t,properties:e}=this._originalMarker;t===null?this._element.removeAttribute("data-toc-marker"):this._element.setAttribute("data-toc-marker",t),e.forEach(({name:i,value:s,priority:r})=>{s?this._element.style.setProperty(i,s,r):this._element.style.removeProperty(i)}),this._originalLinks.clear(),this._originalStatus.clear(),this._targets=[],this._links=[],Q.get(this._element)===this&&Q.delete(this._element)}_listen(t,e,i,s){t.addEventListener(e,i,s),this._listeners.push({target:t,type:e,handler:i,options:s})}_clearListeners(){this._listeners.forEach(({target:t,type:e,handler:i,options:s})=>t.removeEventListener(e,i,s)),this._listeners=[],this._frame&&this._window.cancelAnimationFrame(this._frame),this._frame=0}_requestUpdate(){this._disposed||this._frame||(this._frame=this._window.requestAnimationFrame(()=>{this._frame=0,this._update()}))}_update(){if(this._disposed)return;let t=this._targets.filter(({target:n})=>n.isConnected&&n.getClientRects().length>0),e=this._scrollElement||this._document.scrollingElement,i=(this._scrollElement?this._scrollElement.getBoundingClientRect().top+this._scrollElement.clientTop:0)+this._offset,s=null;t.forEach(n=>{n.target.getBoundingClientRect().top<=i+1&&(s=n)});let r=e&&e.scrollHeight>e.clientHeight+1;if(!r){let n=Ot(this._window.location.hash);s=t.find(({id:o})=>o===n)||s}t.length&&r&&e.scrollTop+e.clientHeight>=e.scrollHeight-1&&(s=t[t.length-1]),this._activate(s)}_activate(t){let e=null;this._links.forEach(({link:i,id:s})=>{let r=t!==null&&s===t.id;i.classList.toggle("active",r),r?(i.setAttribute("aria-current","location"),e||(e=i)):i.removeAttribute("aria-current")}),this._status&&(this._status.textContent=t?t.label:this._overview),this._updateMarker(e)}_updateMarker(t){let e=this._element.querySelector(":scope > .nav"),i=t?.querySelector("span");if(!e?.contains(t)||!i?.offsetHeight||!this._element.getClientRects().length){this._element.removeAttribute("data-toc-marker");return}this._element.style.setProperty("--moo-toc-marker-offset","".concat(t.offsetTop+i.offsetTop,"px")),this._element.style.setProperty("--moo-toc-marker-height","".concat(i.offsetHeight,"px")),this._element.setAttribute("data-toc-marker","")}};var tt=new WeakMap,ee=0,et=class a{static getInstance(t,e=t?.ownerDocument?.scrollingElement){let i=e&&tt.get(e);return i?._owner===t?i:null}static getOrCreateInstance(t,e={}){return a.getInstance(t,e.scrollElement)||new a(t,e)}constructor(t,{scrollElement:e=null,hideDelay:i=900,label:s="Page scroll position"}={}){if(!t?.matches?.('.moo-ui[data-bs-theme="light"], .moo-ui[data-bs-theme="dark"]')||!t.isConnected)throw new TypeError("OverlayScrollbar requires a connected, resolved .moo-ui theme owner.");if(!Number.isFinite(i)||i<0||typeof s!="string"||!s.trim())throw new TypeError("OverlayScrollbar requires a nonnegative hideDelay and a nonempty label.");let r=t.ownerDocument,n=e??r.scrollingElement,o=n===r.scrollingElement;if(n?.nodeType!==1||!n.isConnected||n.ownerDocument!==r||!o&&(!t.contains(n)||n.closest('.moo-ui[data-bs-theme="light"], .moo-ui[data-bs-theme="dark"]')!==t))throw new TypeError("OverlayScrollbar scrollElement must belong to the same resolved theme owner.");let c=tt.get(n);if(c){if(c._owner===t)return c;throw new Error("Only one OverlayScrollbar theme owner may control a scroll element.")}if(this._owner=t,this._document=r,this._window=r.defaultView,this._root=n,this._isDocument=o,o&&n!==r.documentElement)throw new TypeError("OverlayScrollbar requires a standards-mode document scroll root.");if(this._hideDelay=i,this._listeners=[],this._frame=0,this._timer=0,this._disposed=!1,this._originalNativeClass=o&&typeof t.__mooNativeScrollbarBaseline=="boolean"?t.__mooNativeScrollbarBaseline:this._root.classList.contains("scrollbar-overlay-native"),this._originalId=this._root.getAttribute("id"),this._forcedColors=this._window.matchMedia("(forced-colors: active)"),this._bar=r.createElement("div"),this._bar.className="scrollbar-overlay",this._bar.tabIndex=0,this._bar.setAttribute("role","scrollbar"),this._bar.setAttribute("aria-label",s),this._bar.setAttribute("aria-orientation","vertical"),this._bar.setAttribute("aria-valuemin","0"),this._thumb=r.createElement("div"),this._thumb.className="scrollbar-overlay-thumb",this._thumb.setAttribute("aria-hidden","true"),this._bar.append(this._thumb),t.append(this._bar),this._window.getComputedStyle(this._bar).position!=="fixed")throw this._bar.remove(),new Error("OverlayScrollbar requires the Moo UI overlay scrollbar stylesheet.");if(!this._originalId){do this._generatedId="scrollbar-overlay-page-".concat(++ee);while(r.getElementById(this._generatedId));this._root.id=this._generatedId}this._bar.setAttribute("aria-controls",this._root.id),tt.set(n,this);try{this._listen(o?this._window:n,"scroll",()=>{this._reveal(),this._queue()},{passive:!0}),o||this._listen(r,"scroll",()=>this._queue(),{passive:!0,capture:!0}),this._listen(this._window,"resize",()=>this._queue()),this._listen(r,"pointermove",l=>this._onPointerMove(l),{passive:!0}),this._listen(r,"pointerout",l=>{l.pointerType==="mouse"&&!l.relatedTarget&&(this._nearEdge=!1,this._drag||delete this._bar.dataset.scrollbarInteractive,this._hideLater())}),this._listen(this._bar,"pointerdown",l=>this._onPointerDown(l)),this._listen(this._bar,"pointerup",()=>this._finishDrag()),this._listen(this._bar,"pointercancel",()=>this._finishDrag()),this._listen(this._bar,"lostpointercapture",()=>this._finishDrag()),this._listen(this._bar,"focus",()=>this._reveal()),this._listen(this._bar,"blur",()=>this._hideLater()),this._listen(this._bar,"keydown",l=>this._onKeyDown(l)),this._listen(this._forcedColors,"change",()=>this.refresh()),this._listen(this._window,"beforeprint",()=>{this._printing=!0,this.refresh()}),this._listen(this._window,"afterprint",()=>{this._printing=!1,this.refresh()}),this._resize=new this._window.ResizeObserver(()=>this._queue()),this._resize.observe(this._root),this._resize.observe(r.body),this._mutations=new this._window.MutationObserver(()=>this._queue()),this._mutations.observe(this._root,{attributes:!0,attributeFilter:["class","style","dir"]}),o||this._mutations.observe(r.documentElement,{attributes:!0,attributeFilter:["class","style","dir"]}),this._mutations.observe(r.body,{attributes:!0,attributeFilter:["class","style"]}),this._mutations.observe(t,{attributes:!0,attributeFilter:["class","style","dir","data-bs-theme"]}),this._contentMutations=new this._window.MutationObserver(l=>{l.some(h=>h.target!==this._bar&&!this._bar.contains(h.target))&&this._queue()}),this._contentMutations.observe(o?r.body:n,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","style","hidden"]}),this._listen(n,"load",()=>this._queue(),{capture:!0}),r.fonts&&this._listen(r.fonts,"loadingdone",()=>this._queue()),this.refresh()}catch(l){throw this.dispose(),l}}refresh(){if(this._disposed)return this;let t=this._window,e=this._root,i=!this._forcedColors.matches&&!this._printing;i&&e.classList.add("scrollbar-overlay-native");let s=i&&e.scrollWidth<=e.clientWidth+1;e.classList.toggle("scrollbar-overlay-native",this._originalNativeClass||s),this._mutations?.takeRecords(),this._contentMutations?.takeRecords();let r=(this._isDocument?[e,this._document.body]:[e]).some(_=>["hidden","clip"].includes(t.getComputedStyle(_).overflowY));this._maximum=Math.max(0,e.scrollHeight-e.clientHeight);let n=this._position();if(this._bar.hidden=!s||r||!n||this._maximum<=0,this._bar.hidden)return this._document.activeElement===this._bar&&this._bar.blur(),delete this._bar.dataset.scrollbarVisible,delete this._bar.dataset.scrollbarInteractive,this;let o=this._bar.clientWidth,c=this._bar.clientHeight,l=Math.min(c,Math.max(o,c*e.clientHeight/e.scrollHeight));this._travel=Math.max(0,c-l);let h=Math.min(this._maximum,Math.max(0,e.scrollTop));return this._thumb.style.height="".concat(l,"px"),this._thumb.style.transform="translateY(".concat(this._travel*h/this._maximum,"px)"),this._bar.setAttribute("aria-valuemax",String(Math.round(this._maximum))),this._bar.setAttribute("aria-valuenow",String(Math.round(h))),this}_position(){if(this._isDocument)return!0;let t=this._root,e=t.getBoundingClientRect(),i=Math.max(0,e.top+t.clientTop),s=Math.min(this._window.innerHeight,e.top+t.clientTop+t.clientHeight),r=parseFloat(this._window.getComputedStyle(this._bar).inlineSize),n=this._window.getComputedStyle(t).direction==="rtl",o=e.left+t.clientLeft+(n?0:t.clientWidth-r);return Object.assign(this._bar.style,{insetInlineEnd:"auto",bottom:"auto",top:"".concat(i,"px"),height:"".concat(Math.max(0,s-i),"px"),left:"".concat(Math.max(0,Math.min(this._window.innerWidth-r,o)),"px"),direction:n?"rtl":"ltr"}),e.width>0&&s>i&&o<this._window.innerWidth&&o+r>0}dispose(){if(!this._disposed){this._disposed=!0;for(let[t,e,i,s]of this._listeners)t.removeEventListener(e,i,s);this._listeners=[],this._resize?.disconnect(),this._mutations?.disconnect(),this._contentMutations?.disconnect(),this._window.cancelAnimationFrame(this._frame),this._window.clearTimeout(this._timer),this._drag&&this._bar.hasPointerCapture(this._drag.id)&&this._bar.releasePointerCapture(this._drag.id),this._drag=null,this._bar.remove(),this._root.classList.toggle("scrollbar-overlay-native",this._originalNativeClass),this._generatedId&&this._root.id===this._generatedId&&(this._originalId===null?this._root.removeAttribute("id"):this._root.setAttribute("id",this._originalId)),tt.get(this._root)===this&&tt.delete(this._root)}}_listen(t,e,i,s){t.addEventListener(e,i,s),this._listeners.push([t,e,i,s])}_queue(){this._disposed||this._frame||(this._frame=this._window.requestAnimationFrame(()=>{this._frame=0,this.refresh()}))}_reveal(){this._disposed||this._bar.hidden||(this._bar.dataset.scrollbarVisible="true",this._hideLater())}_hideLater(){this._window.clearTimeout(this._timer),this._timer=0,!this._disposed&&this._bar.hasAttribute("data-scrollbar-visible")&&(this._timer=this._window.setTimeout(()=>{this._timer=0,!(this._disposed||this._nearEdge||this._drag||this._bar.matches(":focus-visible"))&&delete this._bar.dataset.scrollbarVisible},this._hideDelay))}_onPointerMove(t){if(this._disposed)return;if(this._drag?.id===t.pointerId){this._travel&&this._scroll(this._drag.top+(t.clientY-this._drag.y)*this._maximum/this._travel);return}if(t.pointerType!=="mouse"){this._nearEdge=!1,this._drag||delete this._bar.dataset.scrollbarInteractive;return}let e=this._bar.getBoundingClientRect();!this._bar.hidden&&t.clientX>=e.left&&t.clientX<=e.right&&t.clientY>=e.top&&t.clientY<=e.bottom?(this._nearEdge=!0,this._bar.dataset.scrollbarInteractive="true",this._reveal()):this._nearEdge&&(this._nearEdge=!1,this._drag||delete this._bar.dataset.scrollbarInteractive,this._hideLater())}_onPointerDown(t){if(t.button!==0||this._bar.hidden||t.pointerType==="touch")return;t.preventDefault(),this._reveal();let e=this._thumb.getBoundingClientRect();if(t.clientY>=e.top&&t.clientY<=e.bottom)this._drag={id:t.pointerId,y:t.clientY,top:this._root.scrollTop},this._bar.setPointerCapture(t.pointerId);else{let i=t.clientY<this._thumb.getBoundingClientRect().top?-1:1;this._scroll(this._root.scrollTop+i*this._root.clientHeight)}}_finishDrag(){if(!this._drag||this._disposed)return;let t=this._drag.id;this._drag=null,this._nearEdge||delete this._bar.dataset.scrollbarInteractive,this._bar.hasPointerCapture(t)&&this._bar.releasePointerCapture(t),this._hideLater()}_onKeyDown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;this.refresh();let e=parseFloat(this._window.getComputedStyle(this._root).lineHeight)||16,i=this._root.clientHeight,s={ArrowUp:this._root.scrollTop-e,ArrowDown:this._root.scrollTop+e,PageUp:this._root.scrollTop-i,PageDown:this._root.scrollTop+i,Home:0,End:this._maximum," ":this._root.scrollTop+(t.shiftKey?-i:i)};Object.hasOwn(s,t.key)&&(t.preventDefault(),this._scroll(s[t.key]),this._reveal())}_scroll(t){(this._isDocument?this._window:this._root).scrollTo({top:Math.min(this._maximum,Math.max(0,t)),behavior:"instant"}),this._queue()}};var it=new WeakMap;function Lt(a=document){if(it.has(a))return it.get(a);let e=(a.nodeType===9?a:a.ownerDocument)?.defaultView?.bootstrap?.Offcanvas;if(!e)return()=>{};let i=Array.from(a.querySelectorAll(".offcanvas.sheet")),s=n=>{n.target===n.currentTarget&&n.currentTarget.querySelector("[autofocus]:not(:disabled)")?.focus()},r=()=>{it.get(a)===r&&(i.forEach(n=>{n.removeEventListener("shown.bs.offcanvas",s)}),it.delete(a))};return it.set(a,r),i.forEach(n=>{n.addEventListener("shown.bs.offcanvas",s),n.dataset.sheetOpenOnLoad==="true"&&(n.removeAttribute("data-sheet-open-on-load"),e.getOrCreateInstance(n).show())}),r}async function ie(){let{default:a}=await import("./chart.js");return a}var se={loadChart:ie,Combobox:V,ContextMenu:N,DataTable:B,Datepicker:W,MooCalendar:O,MooDateRangePicker:ct,Sidebar:Y,Slider:J,TableOfContents:Z,OverlayScrollbar:et,initSheets:Lt};var Ce=se;export{V as Combobox,N as ContextMenu,B as DataTable,W as Datepicker,O as MooCalendar,ct as MooDateRangePicker,et as OverlayScrollbar,Y as Sidebar,J as Slider,Z as TableOfContents,Ce as default,Lt as initSheets,ie as loadChart};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Moo UI overlay-scrollbar.js v1.4.
|
|
2
|
+
* Moo UI overlay-scrollbar.js v1.4.3 (https://wpmoo.org/)
|
|
3
3
|
* Copyright 2026 WPMoo Authors
|
|
4
4
|
* Licensed under MIT (https://github.com/wpmoo-org/ui/blob/main/LICENSE)
|
|
5
5
|
*/
|
|
@@ -45,7 +45,7 @@ class OverlayScrollbar {
|
|
|
45
45
|
this._frame = 0;
|
|
46
46
|
this._timer = 0;
|
|
47
47
|
this._disposed = false;
|
|
48
|
-
this._originalNativeClass = this._root.classList.contains("scrollbar-overlay-native");
|
|
48
|
+
this._originalNativeClass = isDocument && typeof owner.__mooNativeScrollbarBaseline === "boolean" ? owner.__mooNativeScrollbarBaseline : this._root.classList.contains("scrollbar-overlay-native");
|
|
49
49
|
this._originalId = this._root.getAttribute("id");
|
|
50
50
|
this._forcedColors = this._window.matchMedia("(forced-colors: active)");
|
|
51
51
|
this._bar = document.createElement("div");
|
package/dist/js/sheet.js
CHANGED
package/dist/js/sidebar.js
CHANGED
package/dist/js/slider.js
CHANGED
package/dist/js/state.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Moo UI state.js v1.4.
|
|
2
|
+
* Moo UI state.js v1.4.3 (https://wpmoo.org/)
|
|
3
3
|
* Copyright 2026 WPMoo Authors
|
|
4
4
|
* Licensed under MIT (https://github.com/wpmoo-org/ui/blob/main/LICENSE)
|
|
5
5
|
*/
|
|
@@ -12,6 +12,11 @@
|
|
|
12
12
|
if (owner.matches?.('.moo-ui[data-bs-theme="light"], .moo-ui[data-bs-theme="dark"]')) {
|
|
13
13
|
const body = ownerDocument?.body;
|
|
14
14
|
const documentOwner = owner.dataset?.mooDocumentOwner === "true" && owner.parentElement === body && owner === body?.firstElementChild;
|
|
15
|
+
if (documentOwner && ownerDocument.documentElement?.classList) {
|
|
16
|
+
const root = ownerDocument.documentElement;
|
|
17
|
+
owner.__mooNativeScrollbarBaseline ?? (owner.__mooNativeScrollbarBaseline = root.classList.contains("scrollbar-overlay-native"));
|
|
18
|
+
root.classList.add("scrollbar-overlay-native");
|
|
19
|
+
}
|
|
15
20
|
const normalizeDirection = (value) => value === "ltr" || value === "rtl" ? value : null;
|
|
16
21
|
const ownerDirection = normalizeDirection(
|
|
17
22
|
owner.getAttribute?.("dir") || owner.dir
|
package/dist/js/toc.js
CHANGED
|
@@ -3,22 +3,22 @@
|
|
|
3
3
|
{
|
|
4
4
|
"export": "./moo.css",
|
|
5
5
|
"path": "dist/assets/css/moo.css",
|
|
6
|
-
"sha256": "
|
|
6
|
+
"sha256": "bab99b11ea86eaae400d7b6d25c1a3e0db4a20094c8996eb2d5911dcaf6c13d2"
|
|
7
7
|
},
|
|
8
8
|
{
|
|
9
9
|
"export": "./moo-ui.css",
|
|
10
10
|
"path": "dist/assets/css/moo-ui.css",
|
|
11
|
-
"sha256": "
|
|
11
|
+
"sha256": "c1f16fd9b2a5ce8b888d0bf6145f9b8145196eff4097e704faa24017741d9e64"
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
"export": "./state.js",
|
|
15
15
|
"path": "dist/js/state.js",
|
|
16
|
-
"sha256": "
|
|
16
|
+
"sha256": "d0d840af5875d07d8b044dab2ad5409c16db7a06636093200d5a438f8913fa61"
|
|
17
17
|
}
|
|
18
18
|
],
|
|
19
19
|
"package": {
|
|
20
20
|
"name": "@wpmoo/ui",
|
|
21
|
-
"version": "1.4.
|
|
21
|
+
"version": "1.4.3"
|
|
22
22
|
},
|
|
23
23
|
"schemaVersion": 1
|
|
24
24
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wpmoo/ui",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.3",
|
|
4
4
|
"description": "Bootstrap markup. shadcn feel. A frontend-framework-free component system for server-rendered apps.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "WPMoo (https://wpmoo.org)",
|
|
@@ -21,9 +21,7 @@
|
|
|
21
21
|
"test:quick": ".venv/bin/python3 scripts/run-test-tier.py run quick",
|
|
22
22
|
"test:browser-smoke": ".venv/bin/python3 scripts/run-test-tier.py run browser-smoke",
|
|
23
23
|
"test:browser-full": ".venv/bin/python3 scripts/run-test-tier.py run browser-full",
|
|
24
|
-
"test:release": ".venv/bin/python3 scripts/run-test-tier.py run release"
|
|
25
|
-
"deploy": "wrangler deploy",
|
|
26
|
-
"preview": "wrangler dev"
|
|
24
|
+
"test:release": ".venv/bin/python3 scripts/run-test-tier.py run release"
|
|
27
25
|
},
|
|
28
26
|
"style": "dist/assets/css/moo-ui.css",
|
|
29
27
|
"exports": {
|
|
@@ -110,7 +108,6 @@
|
|
|
110
108
|
"devDependencies": {
|
|
111
109
|
"axe-core": "4.14.0",
|
|
112
110
|
"chart.js": "4.5.1",
|
|
113
|
-
"esbuild": "0.28.2"
|
|
114
|
-
"wrangler": "^4.120.0"
|
|
111
|
+
"esbuild": "0.28.2"
|
|
115
112
|
}
|
|
116
113
|
}
|
package/scss/mixins/_banner.scss
CHANGED