UNPKG

flyonui

Version:

The easiest, free and open-source Tailwind CSS component library with semantic classes.

24 lines 51.7 kB
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(self,()=>(()=>{"use strict";var e={287:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(e,t,n){this.el=e,this.options=t,this.events=n,this.el=e,this.options=t,this.events={}}createCollection(e,t){var n;e.push({id:(null===(n=null==t?void 0:t.el)||void 0===n?void 0:n.id)||e.length+1,element:t})}fireEvent(e,t=null){if(this.events.hasOwnProperty(e))return this.events[e](t)}on(e,t){this.events[e]=t}}},294:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(){this.components=[],this.currentlyOpenedComponents=[],this.activeComponent=null,this.initGlobalListeners()}initGlobalListeners(){document.addEventListener("keydown",e=>this.handleGlobalKeydown(e)),document.addEventListener("focusin",e=>this.handleGlobalFocusin(e))}getActiveComponent(e){if(!e)return null;const t=this.components.filter(t=>t.wrapper.contains(e)||t.context&&t.context.contains(e));if(0===t.length)return null;if(1===t.length)return t[0];let n=null,o=Number.MAX_SAFE_INTEGER;for(const i of t){let t=0,s=e;for(;s&&s!==i.wrapper&&s!==i.context;)t++,s=s.parentElement;t<o&&(o=t,n=i)}return n}handleGlobalFocusin(e){const t=e.target;this.activeComponent=this.getActiveComponent(t)}handleGlobalKeydown(e){const t=e.target;if(this.activeComponent=this.getActiveComponent(t),this.activeComponent)switch(e.key){case"Escape":if(this.activeComponent.isOpened)this.activeComponent.handlers.onEsc&&(this.activeComponent.handlers.onEsc(),e.preventDefault(),e.stopPropagation());else{const n=this.findClosestOpenParent(t);(null==n?void 0:n.handlers.onEsc)&&(n.handlers.onEsc(),e.preventDefault(),e.stopPropagation())}break;case"Enter":this.activeComponent.handlers.onEnter&&(this.activeComponent.handlers.onEnter(),e.preventDefault(),e.stopPropagation());break;case" ":case"Space":if("INPUT"===t.tagName||"TEXTAREA"===t.tagName)return;this.activeComponent.handlers.onSpace&&(this.activeComponent.handlers.onSpace(),e.preventDefault(),e.stopPropagation());break;case"ArrowDown":case"ArrowUp":case"ArrowLeft":case"ArrowRight":if(this.activeComponent.handlers.onArrow){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;this.activeComponent.handlers.onArrow(e),e.preventDefault(),e.stopPropagation()}break;case"Tab":if(!this.activeComponent.handlers.onTab)break;const n=e.shiftKey?this.activeComponent.handlers.onShiftTab:this.activeComponent.handlers.onTab;n&&n();break;case"Home":this.activeComponent.handlers.onHome&&(this.activeComponent.handlers.onHome(),e.preventDefault(),e.stopPropagation());break;case"End":this.activeComponent.handlers.onEnd&&(this.activeComponent.handlers.onEnd(),e.preventDefault(),e.stopPropagation());break;default:this.activeComponent.handlers.onFirstLetter&&1===e.key.length&&/^[a-zA-Z]$/.test(e.key)&&(this.activeComponent.handlers.onFirstLetter(e.key),e.preventDefault(),e.stopPropagation())}}findClosestOpenParent(e){let t=e.parentElement;for(;t;){const e=this.currentlyOpenedComponents.find(e=>e.wrapper===t&&e!==this.activeComponent);if(e)return e;t=t.parentElement}return null}registerComponent(e,t,n=!0,o="",i="",s){const r={wrapper:e,handlers:t,isOpened:n,name:o,selector:i,context:s,isRegistered:!0};return this.components.push(r),r}updateComponentState(e,t){e.isOpened=t,t?this.currentlyOpenedComponents.includes(e)||this.currentlyOpenedComponents.push(e):this.currentlyOpenedComponents=this.currentlyOpenedComponents.filter(t=>t!==e)}unregisterComponent(e){this.components=this.components.filter(t=>t!==e),this.currentlyOpenedComponents=this.currentlyOpenedComponents.filter(t=>t!==e)}}},753:function(e,t,n){ /* * HSDropdown * @version: 3.2.2 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(806),s=n(949),r=o(n(287)),l=o(n(294)),a=n(917);class c extends r.default{constructor(e,t,n){super(e,t,n),this.longPressTimer=null,this.openedViaKeyboard=!1,this.onTouchStartListener=null,this.onTouchEndListener=null,this.toggle=this.el.querySelector(":scope > .dropdown-toggle")||this.el.querySelector(":scope > .dropdown-toggle-wrapper > .dropdown-toggle")||this.el.children[0],this.closers=Array.from(this.el.querySelectorAll(":scope .dropdown-close"))||null,this.menu=this.el.querySelector(":scope > .dropdown-menu"),this.eventMode=(0,i.getClassProperty)(this.el,"--trigger","click"),this.closeMode=(0,i.getClassProperty)(this.el,"--auto-close","true"),this.hasAutofocus=(0,i.stringToBoolean)((0,i.getClassProperty)(this.el,"--has-autofocus","true")||"true"),this.autofocusOnKeyboardOnly=(0,i.stringToBoolean)((0,i.getClassProperty)(this.el,"--autofocus-on-keyboard-only","true")||"true"),this.animationInProcess=!1,this.onCloserClickListener=[],this.toggle&&this.menu&&this.init()}elementMouseEnter(){this.onMouseEnterHandler()}elementMouseLeave(){this.onMouseLeaveHandler()}toggleClick(e){this.onClickHandler(e)}toggleContextMenu(e){e.preventDefault(),this.onContextMenuHandler(e)}handleTouchStart(e){this.longPressTimer=window.setTimeout(()=>{e.preventDefault();const t=e.touches[0],n=new MouseEvent("contextmenu",{bubbles:!0,cancelable:!0,view:window,clientX:t.clientX,clientY:t.clientY});this.toggle&&this.toggle.dispatchEvent(n)},400)}handleTouchEnd(e){this.longPressTimer&&(clearTimeout(this.longPressTimer),this.longPressTimer=null)}closerClick(){this.close()}init(){if(this.createCollection(window.$hsDropdownCollection,this),this.toggle.disabled)return!1;this.toggle&&this.buildToggle(),this.menu&&this.buildMenu(),this.closers&&this.buildClosers(),(0,i.isIOS)()||(0,i.isIpadOS)()||(this.onElementMouseEnterListener=()=>this.elementMouseEnter(),this.onElementMouseLeaveListener=()=>this.elementMouseLeave(),this.el.addEventListener("mouseenter",this.onElementMouseEnterListener),this.el.addEventListener("mouseleave",this.onElementMouseLeaveListener)),"undefined"!=typeof window&&(window.HSAccessibilityObserver||(window.HSAccessibilityObserver=new l.default),this.setupAccessibility())}resizeHandler(){this.eventMode=(0,i.getClassProperty)(this.el,"--trigger","click"),this.closeMode=(0,i.getClassProperty)(this.el,"--auto-close","true"),this.hasAutofocus=(0,i.stringToBoolean)((0,i.getClassProperty)(this.el,"--has-autofocus","true")||"true"),this.autofocusOnKeyboardOnly=(0,i.stringToBoolean)((0,i.getClassProperty)(this.el,"--autofocus-on-keyboard-only","true")||"true")}isOpen(){return this.el.classList.contains("open")&&!this.menu.classList.contains("hidden")}buildToggle(){var e;(null===(e=null==this?void 0:this.toggle)||void 0===e?void 0:e.ariaExpanded)&&(this.el.classList.contains("open")?this.toggle.ariaExpanded="true":this.toggle.ariaExpanded="false"),"contextmenu"===this.eventMode?(this.onToggleContextMenuListener=e=>this.toggleContextMenu(e),this.onTouchStartListener=this.handleTouchStart.bind(this),this.onTouchEndListener=this.handleTouchEnd.bind(this),this.toggle.addEventListener("contextmenu",this.onToggleContextMenuListener),this.toggle.addEventListener("touchstart",this.onTouchStartListener,{passive:!1}),this.toggle.addEventListener("touchend",this.onTouchEndListener),this.toggle.addEventListener("touchmove",this.onTouchEndListener)):(this.onToggleClickListener=e=>this.toggleClick(e),this.toggle.addEventListener("click",this.onToggleClickListener))}buildMenu(){this.menu.role=this.menu.getAttribute("role")||"menu",this.menu.tabIndex=-1;const e=this.menu.querySelectorAll('[role="menuitemcheckbox"]'),t=this.menu.querySelectorAll('[role="menuitemradio"]');e.forEach(e=>e.addEventListener("click",()=>this.selectCheckbox(e))),t.forEach(e=>e.addEventListener("click",()=>this.selectRadio(e))),this.menu.addEventListener("click",()=>{this.menu.focus()})}buildClosers(){this.closers.forEach(e=>{this.onCloserClickListener.push({el:e,fn:()=>this.closerClick()}),e.addEventListener("click",this.onCloserClickListener.find(t=>t.el===e).fn)})}getScrollbarSize(){let e=document.createElement("div");e.style.overflow="scroll",e.style.width="100px",e.style.height="100px",document.body.appendChild(e);let t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),t}onContextMenuHandler(e){const t={getBoundingClientRect:(()=>new DOMRect,()=>new DOMRect(e.clientX,e.clientY,0,0))};c.closeCurrentlyOpened(),this.el.classList.contains("open")&&!this.menu.classList.contains("hidden")?(this.close(),document.body.style.overflow="",document.body.style.paddingRight=""):(document.body.style.overflow="hidden",document.body.style.paddingRight=`${this.getScrollbarSize()}px`,this.open(t))}onClickHandler(e){var t;if("hover"===(0,i.getClassProperty)(this.el,"--trigger","click")&&window.matchMedia("(hover: hover)").matches&&"mouse"===e.pointerType){const n=e.currentTarget;return"A"===n.tagName&&n.hasAttribute("href")&&"#"!==n.getAttribute("href")||(e.preventDefault(),e.stopPropagation(),null===(t=e.stopImmediatePropagation)||void 0===t||t.call(e)),!1}this.el.classList.contains("open")&&!this.menu.classList.contains("hidden")?this.close():this.open()}onMouseEnterHandler(){if("hover"!==(0,i.getClassProperty)(this.el,"--trigger","click"))return!1;(!this.el._floatingUI||this.el._floatingUI&&!this.el.classList.contains("open"))&&this.forceClearState(),!this.el.classList.contains("open")&&this.menu.classList.contains("hidden")&&this.open()}onMouseLeaveHandler(){if("hover"!==(0,i.getClassProperty)(this.el,"--trigger","click"))return!1;this.el.classList.contains("open")&&!this.menu.classList.contains("hidden")&&this.close()}destroyFloatingUI(){const e=(window.getComputedStyle(this.el).getPropertyValue("--scope")||"").trim();this.menu.classList.remove("block"),this.menu.classList.add("hidden"),this.menu.style.inset=null,this.menu.style.position=null,this.el&&this.el._floatingUI&&(this.el._floatingUI.destroy(),this.el._floatingUI=null),"window"===e&&this.el.appendChild(this.menu),this.animationInProcess=!1}focusElement(){const e=this.menu.querySelector("[autofocus]");if(e)return e.focus(),!0;const t=this.menu.querySelectorAll('a:not([hidden]), button:not([hidden]), [role="menuitem"]:not([hidden]), .dropdown-item');if(t.length>0){return t[0].focus(),!0}return!1}setupFloatingUI(e){const t=e||this.el,n=window.getComputedStyle(this.el),o=(n.getPropertyValue("--placement")||"").trim(),i=(n.getPropertyValue("--flip")||"true").trim(),r=(n.getPropertyValue("--strategy")||"fixed").trim(),l=(n.getPropertyValue("--offset")||"6").trim(),c=(n.getPropertyValue("--gpu-acceleration")||"true").trim(),d=(window.getComputedStyle(this.el).getPropertyValue("--adaptive")||"adaptive").replace(" ",""),h=r,u=parseInt(l,10),f=a.POSITIONS[o]||"bottom-start",p=[..."true"===i?[(0,s.flip)()]:[],(0,s.offset)(u)],m={placement:f,strategy:h,middleware:p},g=e=>{const t=this.menu.getBoundingClientRect(),n=window.innerWidth-(window.innerWidth-document.documentElement.clientWidth);return e+t.width>n&&(e=n-t.width),e<0&&(e=0),e},w=()=>{(0,s.computePosition)(t,this.menu,m).then(({x:e,y:t,placement:n})=>{const o=g(e);"absolute"===h&&"none"===d?Object.assign(this.menu.style,{position:h,margin:"0"}):"absolute"===h?Object.assign(this.menu.style,{position:h,transform:`translate3d(${e}px, ${t}px, 0px)`,margin:"0"}):"true"===c?Object.assign(this.menu.style,{position:h,left:"",top:"",inset:"0px auto auto 0px",margin:"0",transform:`translate3d(${"adaptive"===d?o:0}px, ${t}px, 0)`}):Object.assign(this.menu.style,{position:h,left:`${e}px`,top:`${t}px`,transform:""}),this.menu.setAttribute("data-placement",n)})};w();return{update:w,destroy:(0,s.autoUpdate)(t,this.menu,w)}}selectCheckbox(e){e.ariaChecked="true"===e.ariaChecked?"false":"true"}selectRadio(e){if("true"===e.ariaChecked)return!1;const t=e.closest(".group").querySelectorAll('[role="menuitemradio"]');Array.from(t).filter(t=>t!==e).forEach(e=>{e.ariaChecked="false"}),e.ariaChecked="true"}calculateFloatingUIPosition(e){const t=this.setupFloatingUI(e),n=this.menu.getAttribute("data-placement");return t.update(),t.destroy(),n}open(e,t=!1){if(this.el.classList.contains("open")||this.animationInProcess)return!1;this.openedViaKeyboard=t,this.animationInProcess=!0,this.menu.style.cssText="";const n=e||this.el,o=window.getComputedStyle(this.el),s=(o.getPropertyValue("--scope")||"").trim(),r=(o.getPropertyValue("--strategy")||"fixed").trim();"window"===s&&document.body.appendChild(this.menu),"static"!==r&&(this.el._floatingUI=this.setupFloatingUI(n)),this.menu.style.margin=null,this.menu.classList.remove("hidden"),this.menu.classList.add("block"),setTimeout(()=>{var e;(null===(e=null==this?void 0:this.toggle)||void 0===e?void 0:e.ariaExpanded)&&(this.toggle.ariaExpanded="true"),this.el.classList.add("open"),window.HSAccessibilityObserver&&this.accessibilityComponent&&window.HSAccessibilityObserver.updateComponentState(this.accessibilityComponent,!0),"window"===s&&this.menu.classList.add("open"),this.animationInProcess=!1,!this.hasAutofocus||this.autofocusOnKeyboardOnly&&!this.openedViaKeyboard||this.focusElement(),this.fireEvent("open",this.el),(0,i.dispatch)("open.dropdown",this.el,this.el)})}close(e=!0){if(this.animationInProcess||!this.el.classList.contains("open"))return!1;const t=(window.getComputedStyle(this.el).getPropertyValue("--scope")||"").trim();if(this.animationInProcess=!0,"window"===t&&this.menu.classList.remove("open"),window.HSAccessibilityObserver&&this.accessibilityComponent&&window.HSAccessibilityObserver.updateComponentState(this.accessibilityComponent,!1),e){const e=this.el.querySelector("[data-dropdown-transition]")||this.menu;let t=!1;const n=()=>{t||(t=!0,this.destroyFloatingUI())};(0,i.afterTransition)(e,n);const o=window.getComputedStyle(e).getPropertyValue("transition-duration"),s=1e3*parseFloat(o)||150;setTimeout(n,s+50)}else this.destroyFloatingUI();(()=>{var e;this.menu.style.margin=null,(null===(e=null==this?void 0:this.toggle)||void 0===e?void 0:e.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.el.classList.remove("open"),this.openedViaKeyboard=!1,this.fireEvent("close",this.el),(0,i.dispatch)("close.dropdown",this.el,this.el)})()}forceClearState(){this.destroyFloatingUI(),this.menu.style.margin=null,this.el.classList.remove("open"),this.menu.classList.add("hidden"),this.openedViaKeyboard=!1}destroy(){(0,i.isIOS)()||(0,i.isIpadOS)()||(this.el.removeEventListener("mouseenter",this.onElementMouseEnterListener),this.el.removeEventListener("mouseleave",()=>this.onElementMouseLeaveListener),this.onElementMouseEnterListener=null,this.onElementMouseLeaveListener=null),"contextmenu"===this.eventMode?(this.toggle&&(this.toggle.removeEventListener("contextmenu",this.onToggleContextMenuListener),this.toggle.removeEventListener("touchstart",this.onTouchStartListener),this.toggle.removeEventListener("touchend",this.onTouchEndListener),this.toggle.removeEventListener("touchmove",this.onTouchEndListener)),this.onToggleContextMenuListener=null,this.onTouchStartListener=null,this.onTouchEndListener=null):(this.toggle&&this.toggle.removeEventListener("click",this.onToggleClickListener),this.onToggleClickListener=null),this.closers.length&&(this.closers.forEach(e=>{e.removeEventListener("click",this.onCloserClickListener.find(t=>t.el===e).fn)}),this.onCloserClickListener=null),this.el.classList.remove("open"),this.destroyFloatingUI(),window.$hsDropdownCollection=window.$hsDropdownCollection.filter(({element:e})=>e.el!==this.el)}static findInCollection(e){return window.$hsDropdownCollection.find(t=>e instanceof c?t.element.el===e.el:"string"==typeof e?t.element.el===document.querySelector(e):t.element.el===e)||null}static getInstance(e,t){const n=window.$hsDropdownCollection.find(t=>t.element.el===("string"==typeof e?document.querySelector(e):e));return n?t?n:n.element:null}static autoInit(){if(!window.$hsDropdownCollection){window.$hsDropdownCollection=[],window.addEventListener("click",e=>{const t=e.target;c.closeCurrentlyOpened(t)});let e=window.innerWidth;window.addEventListener("resize",()=>{window.innerWidth!==e&&(e=innerWidth,c.closeCurrentlyOpened(null,!1))})}window.$hsDropdownCollection&&(window.$hsDropdownCollection=window.$hsDropdownCollection.filter(({element:e})=>document.contains(e.el))),document.querySelectorAll(".dropdown:not(.--prevent-on-load-init)").forEach(e=>{window.$hsDropdownCollection.find(t=>{var n;return(null===(n=null==t?void 0:t.element)||void 0===n?void 0:n.el)===e})||new c(e)})}static open(e,t=!1){const n=c.findInCollection(e);n&&n.element.menu.classList.contains("hidden")&&n.element.open(void 0,t)}static close(e){const t=c.findInCollection(e);t&&!t.element.menu.classList.contains("hidden")&&t.element.close()}static closeCurrentlyOpened(e=null,t=!0){const n=e&&e.closest(".dropdown")&&e.closest(".dropdown").parentElement.closest(".dropdown")?e.closest(".dropdown").parentElement.closest(".dropdown"):null;let o=n?window.$hsDropdownCollection.filter(e=>e.element.el.classList.contains("open")&&e.element.menu.closest(".dropdown").parentElement.closest(".dropdown")===n):window.$hsDropdownCollection.filter(e=>e.element.el.classList.contains("open"));if(e){const t=e.closest(".dropdown");if(t)"inside"===(0,i.getClassPropertyAlt)(t,"--auto-close")&&(o=o.filter(e=>e.element.el!==t));else{const t=e.closest(".dropdown-menu");if(t){const e=window.$hsDropdownCollection.find(e=>e.element.menu===t);e&&"inside"===(0,i.getClassPropertyAlt)(e.element.el,"--auto-close")&&(o=o.filter(t=>t.element.el!==e.element.el))}}}e&&e.closest(".dropdown")&&"outside"===(0,i.getClassPropertyAlt)(e.closest(".dropdown"),"--auto-close")&&(o=o.filter(t=>t.element.el==e.closest(".dropdown")),o.forEach(e=>e.element.close(t))),o&&o.forEach(e=>{if("false"===e.element.closeMode||"outside"===e.element.closeMode)return!1;e.element.close(t)}),o&&o.forEach(e=>{if("contextmenu"!==(0,i.getClassPropertyAlt)(e.element.el,"--trigger"))return!1;document.body.style.overflow="",document.body.style.paddingRight=""})}setupAccessibility(){this.accessibilityComponent=window.HSAccessibilityObserver.registerComponent(this.el,{onEnter:()=>{this.isOpened()||this.open(void 0,!0)},onSpace:()=>{this.isOpened()||this.open(void 0,!0)},onEsc:()=>{this.isOpened()&&(this.close(),this.toggle&&this.toggle.focus())},onArrow:e=>{if(!e.metaKey)switch(e.key){case"ArrowDown":this.isOpened()?this.focusMenuItem("next"):this.open(void 0,!0);break;case"ArrowUp":this.isOpened()&&this.focusMenuItem("prev");break;case"ArrowRight":this.onArrowX(e,"right");break;case"ArrowLeft":this.onArrowX(e,"left")}},onHome:()=>{this.isOpened()&&this.onStartEnd(!0)},onEnd:()=>{this.isOpened()&&this.onStartEnd(!1)},onTab:()=>{this.isOpened()&&this.close()},onFirstLetter:e=>{this.isOpened()&&this.onFirstLetter(e)}},this.isOpened(),"Dropdown",".dropdown",this.menu)}onFirstLetter(e){var t;if(!this.isOpened()||!this.menu)return;const n=this.menu.querySelectorAll('a:not([hidden]), button:not([hidden]), [role="menuitem"]:not([hidden]), .dropdown-item');if(0===n.length)return;const o=Array.from(n).indexOf(document.activeElement);for(let i=1;i<=n.length;i++){const s=(o+i)%n.length;if(((null===(t=n[s].textContent)||void 0===t?void 0:t.trim().toLowerCase())||"").startsWith(e.toLowerCase()))return void n[s].focus()}n[0].focus()}onArrowX(e,t){if(!this.isOpened())return;e.preventDefault(),e.stopImmediatePropagation();const n=this.menu.querySelectorAll('a:not([hidden]), button:not([hidden]), [role="menuitem"]:not([hidden]), .dropdown-item');if(!n.length)return;const o=Array.from(n).indexOf(document.activeElement);let i=-1;i="right"===t?(o+1)%n.length:o>0?o-1:n.length-1,n[i].focus()}onStartEnd(e=!0){if(!this.isOpened())return;const t=this.menu.querySelectorAll('a:not([hidden]), button:not([hidden]), [role="menuitem"]:not([hidden]), .dropdown-item');if(!t.length)return;t[e?0:t.length-1].focus()}focusMenuItem(e){const t=this.menu.querySelectorAll('a:not([hidden]), button:not([hidden]), [role="menuitem"]:not([hidden]), .dropdown-item');if(!t.length)return;const n=Array.from(t).indexOf(document.activeElement);t["next"===e?(n+1)%t.length:(n-1+t.length)%t.length].focus()}static on(e,t,n){const o=c.findInCollection(t);o&&(o.element.events[e]=n)}isOpened(){return this.isOpen()}containsElement(e){return this.el.contains(e)}}window.addEventListener("load",()=>{c.autoInit()}),window.addEventListener("resize",()=>{window.$hsDropdownCollection||(window.$hsDropdownCollection=[]),window.$hsDropdownCollection.forEach(e=>e.element.resizeHandler())}),"undefined"!=typeof window&&(window.HSDropdown=c),t.default=c},763:function(e,t,n){ /* * HSCollapse * @version: 3.2.2 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(806),s=o(n(287)),r=o(n(753));class l extends s.default{constructor(e,t,n){super(e,t,n),this.contentId=this.el.dataset.collapse,this.content=document.querySelector(this.contentId),this.animationInProcess=!1,this.content&&this.init()}elementClick(){this.content.classList.contains("open")?this.hide():this.show()}init(){var e;this.createCollection(window.$hsCollapseCollection,this),this.onElementClickListener=()=>this.elementClick(),(null===(e=null==this?void 0:this.el)||void 0===e?void 0:e.ariaExpanded)&&(this.el.classList.contains("open")?this.el.ariaExpanded="true":this.el.ariaExpanded="false"),this.el.addEventListener("click",this.onElementClickListener)}hideAllMegaMenuItems(){this.content.querySelectorAll(".mega-menu-content.block").forEach(e=>{e.classList.remove("block"),e.classList.add("hidden")})}closeDropdowns(){if(!this.content)return;this.content.querySelectorAll(".dropdown").forEach(e=>{try{const t=r.default.getInstance(e,!0);if(!(null==t?void 0:t.element))return;e instanceof HTMLElement&&e.classList.contains("open")&&t.element.close(!1)}catch(e){console.warn("Error closing dropdown:",e)}})}show(){var e;if(this.animationInProcess||this.el.classList.contains("open"))return!1;this.animationInProcess=!0,this.el.classList.add("open"),(null===(e=null==this?void 0:this.el)||void 0===e?void 0:e.ariaExpanded)&&(this.el.ariaExpanded="true"),this.content.classList.add("open"),this.content.classList.remove("hidden"),this.content.style.height="0",setTimeout(()=>{this.content.style.height=`${this.content.scrollHeight}px`,this.fireEvent("beforeOpen",this.el),(0,i.dispatch)("beforeOpen.collapse",this.el,this.el)}),(0,i.afterTransition)(this.content,()=>{this.content.style.height="",this.fireEvent("open",this.el),(0,i.dispatch)("open.collapse",this.el,this.el),this.animationInProcess=!1})}hide(){var e;if(this.animationInProcess||!this.el.classList.contains("open"))return!1;this.animationInProcess=!0,this.el.classList.remove("open"),(null===(e=null==this?void 0:this.el)||void 0===e?void 0:e.ariaExpanded)&&(this.el.ariaExpanded="false"),this.content.style.height=`${this.content.scrollHeight}px`,setTimeout(()=>{this.content.style.height="0"}),this.content.classList.remove("open"),(0,i.afterTransition)(this.content,()=>{this.content.classList.add("hidden"),this.content.style.height="",this.fireEvent("hide",this.el),(0,i.dispatch)("hide.collapse",this.el,this.el),this.animationInProcess=!1}),this.content.querySelectorAll(".mega-menu-content.block").length&&this.hideAllMegaMenuItems(),this.closeDropdowns()}destroy(){this.el.removeEventListener("click",this.onElementClickListener),this.content=null,this.animationInProcess=!1,window.$hsCollapseCollection=window.$hsCollapseCollection.filter(({element:e})=>e.el!==this.el)}static findInCollection(e){return window.$hsCollapseCollection.find(t=>e instanceof l?t.element.el===e.el:"string"==typeof e?t.element.el===document.querySelector(e):t.element.el===e)||null}static getInstance(e,t=!1){const n=window.$hsCollapseCollection.find(t=>t.element.el===("string"==typeof e?document.querySelector(e):e));return n?t?n:n.element.el:null}static autoInit(){window.$hsCollapseCollection||(window.$hsCollapseCollection=[]),window.$hsCollapseCollection&&(window.$hsCollapseCollection=window.$hsCollapseCollection.filter(({element:e})=>document.contains(e.el))),document.querySelectorAll(".collapse-toggle:not(.--prevent-on-load-init)").forEach(e=>{window.$hsCollapseCollection.find(t=>{var n;return(null===(n=null==t?void 0:t.element)||void 0===n?void 0:n.el)===e})||new l(e)})}static show(e){const t=l.findInCollection(e);t&&t.element.content.classList.contains("hidden")&&t.element.show()}static hide(e){const t=l.findInCollection(e);t&&!t.element.content.classList.contains("hidden")&&t.element.hide()}static on(e,t,n){const o=l.findInCollection(t);o&&(o.element.events[e]=n)}}window.addEventListener("load",()=>{l.autoInit()}),"undefined"!=typeof window&&(window.HSCollapse=l),t.default=l},806:function(e,t){ /* * @version: 3.2.2 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ Object.defineProperty(t,"__esModule",{value:!0}),t.stringToBoolean=t.menuSearchHistory=t.isScrollable=t.isParentOrElementHidden=t.isJson=t.isIpadOS=t.isIOS=t.isFormElement=t.isFocused=t.isEnoughSpace=t.isDirectChild=t.htmlToElement=t.getZIndex=t.getHighestZIndex=t.getClassPropertyAlt=t.getClassProperty=t.dispatch=t.debounce=t.classToClassList=t.afterTransition=void 0;t.stringToBoolean=e=>"true"===e;t.getClassProperty=(e,t,n="")=>(window.getComputedStyle(e).getPropertyValue(t)||n).replace(" ","");t.getClassPropertyAlt=(e,t,n="")=>{let o="";return e.classList.forEach(e=>{e.includes(t)&&(o=e)}),o.match(/:(.*)]/)?o.match(/:(.*)]/)[1]:n};const n=e=>window.getComputedStyle(e).getPropertyValue("z-index");t.getZIndex=n;t.getHighestZIndex=e=>{let t=Number.NEGATIVE_INFINITY;return e.forEach(e=>{let o=n(e);"auto"!==o&&(o=parseInt(o,10),o>t&&(t=o))}),t};t.isDirectChild=(e,t)=>{const n=e.children;for(let e=0;e<n.length;e++)if(n[e]===t)return!0;return!1};t.isEnoughSpace=(e,t,n="auto",o=10,i=null)=>{const s=t.getBoundingClientRect(),r=i?i.getBoundingClientRect():null,l=window.innerHeight,a=r?s.top-r.top:s.top,c=(i?r.bottom:l)-s.bottom,d=e.clientHeight+o;return"bottom"===n?c>=d:"top"===n?a>=d:a>=d||c>=d};t.isFocused=e=>document.activeElement===e;t.isFormElement=e=>e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement;t.isIOS=()=>!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform);t.isIpadOS=()=>navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform);t.isJson=e=>{if("string"!=typeof e)return!1;const t=e.trim()[0],n=e.trim().slice(-1);if("{"===t&&"}"===n||"["===t&&"]"===n)try{return JSON.parse(e),!0}catch(e){return!1}return!1};const o=e=>{if(!e)return!1;return"none"===window.getComputedStyle(e).display||o(e.parentElement)};t.isParentOrElementHidden=o;t.isScrollable=e=>{const t=window.getComputedStyle(e),n=t.overflowY,o=t.overflowX,i=("scroll"===n||"auto"===n)&&e.scrollHeight>e.clientHeight,s=("scroll"===o||"auto"===o)&&e.scrollWidth>e.clientWidth;return i||s};t.debounce=(e,t=200)=>{let n;return(...o)=>{clearTimeout(n),n=setTimeout(()=>{e.apply(this,o)},t)}};t.dispatch=(e,t,n=null)=>{const o=new CustomEvent(e,{detail:{payload:n},bubbles:!0,cancelable:!0,composed:!1});t.dispatchEvent(o)};t.afterTransition=(e,t)=>{const n=()=>{t(),e.removeEventListener("transitionend",n,!0)},o=window.getComputedStyle(e),i=o.getPropertyValue("transition-duration");"none"!==o.getPropertyValue("transition-property")&&parseFloat(i)>0?e.addEventListener("transitionend",n,!0):t()};t.htmlToElement=e=>{const t=document.createElement("template");return e=e.trim(),t.innerHTML=e,t.content.firstChild};t.classToClassList=(e,t,n=" ",o="add")=>{e.split(n).forEach(e=>{e.trim()&&("add"===o?t.classList.add(e):t.classList.remove(e))})};const i={historyIndex:-1,addHistory(e){this.historyIndex=e},existsInHistory(e){return e>this.historyIndex},clearHistory(){this.historyIndex=-1}};t.menuSearchHistory=i},917:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BREAKPOINTS=t.COMBO_BOX_ACCESSIBILITY_KEY_SET=t.SELECT_ACCESSIBILITY_KEY_SET=t.TABS_ACCESSIBILITY_KEY_SET=t.OVERLAY_ACCESSIBILITY_KEY_SET=t.DROPDOWN_ACCESSIBILITY_KEY_SET=t.POSITIONS=void 0,t.POSITIONS={auto:"auto","auto-start":"auto-start","auto-end":"auto-end",top:"top","top-start":"top-start","top-end":"top-end",bottom:"bottom","bottom-start":"bottom-start","bottom-end":"bottom-end",right:"right","right-start":"right-start","right-end":"right-end",left:"left","left-start":"left-start","left-end":"left-end"},t.DROPDOWN_ACCESSIBILITY_KEY_SET=["Escape","ArrowUp","ArrowDown","ArrowRight","ArrowLeft","Home","End","Enter"],t.OVERLAY_ACCESSIBILITY_KEY_SET=["Escape","Tab"],t.TABS_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End"],t.SELECT_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter","Space","Tab"],t.COMBO_BOX_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter"],t.BREAKPOINTS={xs:0,sm:640,md:768,lg:1024,xl:1280,"2xl":1536}},949:(e,t,n)=>{n.r(t),n.d(t,{arrow:()=>He,autoPlacement:()=>ke,autoUpdate:()=>Ie,computePosition:()=>Fe,detectOverflow:()=>Oe,flip:()=>Re,getOverflowAncestors:()=>ce,hide:()=>_e,inline:()=>Be,limitShift:()=>$e,offset:()=>Pe,platform:()=>Te,shift:()=>De,size:()=>Me});const o=["top","right","bottom","left"],i=["start","end"],s=o.reduce((e,t)=>e.concat(t,t+"-"+i[0],t+"-"+i[1]),[]),r=Math.min,l=Math.max,a=Math.round,c=Math.floor,d=e=>({x:e,y:e}),h={left:"right",right:"left",bottom:"top",top:"bottom"},u={start:"end",end:"start"};function f(e,t,n){return l(e,r(t,n))}function p(e,t){return"function"==typeof e?e(t):e}function m(e){return e.split("-")[0]}function g(e){return e.split("-")[1]}function w(e){return"x"===e?"y":"x"}function y(e){return"y"===e?"height":"width"}const v=new Set(["top","bottom"]);function C(e){return v.has(m(e))?"y":"x"}function b(e){return w(C(e))}function E(e,t,n){void 0===n&&(n=!1);const o=g(e),i=b(e),s=y(i);let r="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[s]>t.floating[s]&&(r=O(r)),[r,O(r)]}function x(e){return e.replace(/start|end/g,e=>u[e])}const L=["left","right"],S=["right","left"],T=["top","bottom"],A=["bottom","top"];function I(e,t,n,o){const i=g(e);let s=function(e,t,n){switch(e){case"top":case"bottom":return n?t?S:L:t?L:S;case"left":case"right":return t?T:A;default:return[]}}(m(e),"start"===n,o);return i&&(s=s.map(e=>e+"-"+i),t&&(s=s.concat(s.map(x)))),s}function O(e){return e.replace(/left|right|bottom|top/g,e=>h[e])}function P(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function k(e){const{x:t,y:n,width:o,height:i}=e;return{width:o,height:i,top:n,left:t,right:t+o,bottom:n+i,x:t,y:n}}function D(e,t,n){let{reference:o,floating:i}=e;const s=C(t),r=b(t),l=y(r),a=m(t),c="y"===s,d=o.x+o.width/2-i.width/2,h=o.y+o.height/2-i.height/2,u=o[l]/2-i[l]/2;let f;switch(a){case"top":f={x:d,y:o.y-i.height};break;case"bottom":f={x:d,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:h};break;case"left":f={x:o.x-i.width,y:h};break;default:f={x:o.x,y:o.y}}switch(g(t)){case"start":f[r]-=u*(n&&c?-1:1);break;case"end":f[r]+=u*(n&&c?-1:1)}return f}async function R(e,t){var n;void 0===t&&(t={});const{x:o,y:i,platform:s,rects:r,elements:l,strategy:a}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:u=!1,padding:f=0}=p(t,e),m=P(f),g=l[u?"floating"===h?"reference":"floating":h],w=k(await s.getClippingRect({element:null==(n=await(null==s.isElement?void 0:s.isElement(g)))||n?g:g.contextElement||await(null==s.getDocumentElement?void 0:s.getDocumentElement(l.floating)),boundary:c,rootBoundary:d,strategy:a})),y="floating"===h?{x:o,y:i,width:r.floating.width,height:r.floating.height}:r.reference,v=await(null==s.getOffsetParent?void 0:s.getOffsetParent(l.floating)),C=await(null==s.isElement?void 0:s.isElement(v))&&await(null==s.getScale?void 0:s.getScale(v))||{x:1,y:1},b=k(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:v,strategy:a}):y);return{top:(w.top-b.top+m.top)/C.y,bottom:(b.bottom-w.bottom+m.bottom)/C.y,left:(w.left-b.left+m.left)/C.x,right:(b.right-w.right+m.right)/C.x}}function M(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function _(e){return o.some(t=>e[t]>=0)}function H(e){const t=r(...e.map(e=>e.left)),n=r(...e.map(e=>e.top));return{x:t,y:n,width:l(...e.map(e=>e.right))-t,height:l(...e.map(e=>e.bottom))-n}}const B=new Set(["left","top"]);function $(){return"undefined"!=typeof window}function F(e){return K(e)?(e.nodeName||"").toLowerCase():"#document"}function V(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Y(e){var t;return null==(t=(K(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function K(e){return!!$()&&(e instanceof Node||e instanceof V(e).Node)}function q(e){return!!$()&&(e instanceof Element||e instanceof V(e).Element)}function W(e){return!!$()&&(e instanceof HTMLElement||e instanceof V(e).HTMLElement)}function N(e){return!(!$()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof V(e).ShadowRoot)}const U=new Set(["inline","contents"]);function j(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=se(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!U.has(i)}const z=new Set(["table","td","th"]);function X(e){return z.has(F(e))}const G=[":popover-open",":modal"];function Z(e){return G.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const J=["transform","translate","scale","rotate","perspective"],Q=["transform","translate","scale","rotate","perspective","filter"],ee=["paint","layout","strict","content"];function te(e){const t=ne(),n=q(e)?se(e):e;return J.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||Q.some(e=>(n.willChange||"").includes(e))||ee.some(e=>(n.contain||"").includes(e))}function ne(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const oe=new Set(["html","body","#document"]);function ie(e){return oe.has(F(e))}function se(e){return V(e).getComputedStyle(e)}function re(e){return q(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function le(e){if("html"===F(e))return e;const t=e.assignedSlot||e.parentNode||N(e)&&e.host||Y(e);return N(t)?t.host:t}function ae(e){const t=le(e);return ie(t)?e.ownerDocument?e.ownerDocument.body:e.body:W(t)&&j(t)?t:ae(t)}function ce(e,t,n){var o;void 0===t&&(t=[]),void 0===n&&(n=!0);const i=ae(e),s=i===(null==(o=e.ownerDocument)?void 0:o.body),r=V(i);if(s){const e=de(r);return t.concat(r,r.visualViewport||[],j(i)?i:[],e&&n?ce(e):[])}return t.concat(i,ce(i,[],n))}function de(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function he(e){const t=se(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=W(e),s=i?e.offsetWidth:n,r=i?e.offsetHeight:o,l=a(n)!==s||a(o)!==r;return l&&(n=s,o=r),{width:n,height:o,$:l}}function ue(e){return q(e)?e:e.contextElement}function fe(e){const t=ue(e);if(!W(t))return d(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:s}=he(t);let r=(s?a(n.width):n.width)/o,l=(s?a(n.height):n.height)/i;return r&&Number.isFinite(r)||(r=1),l&&Number.isFinite(l)||(l=1),{x:r,y:l}}const pe=d(0);function me(e){const t=V(e);return ne()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:pe}function ge(e,t,n,o){void 0===t&&(t=!1),void 0===n&&(n=!1);const i=e.getBoundingClientRect(),s=ue(e);let r=d(1);t&&(o?q(o)&&(r=fe(o)):r=fe(e));const l=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==V(e))&&t}(s,n,o)?me(s):d(0);let a=(i.left+l.x)/r.x,c=(i.top+l.y)/r.y,h=i.width/r.x,u=i.height/r.y;if(s){const e=V(s),t=o&&q(o)?V(o):o;let n=e,i=de(n);for(;i&&o&&t!==n;){const e=fe(i),t=i.getBoundingClientRect(),o=se(i),s=t.left+(i.clientLeft+parseFloat(o.paddingLeft))*e.x,r=t.top+(i.clientTop+parseFloat(o.paddingTop))*e.y;a*=e.x,c*=e.y,h*=e.x,u*=e.y,a+=s,c+=r,n=V(i),i=de(n)}}return k({width:h,height:u,x:a,y:c})}function we(e,t){const n=re(e).scrollLeft;return t?t.left+n:ge(Y(e)).left+n}function ye(e,t,n){void 0===n&&(n=!1);const o=e.getBoundingClientRect();return{x:o.left+t.scrollLeft-(n?0:we(e,o)),y:o.top+t.scrollTop}}const ve=new Set(["absolute","fixed"]);function Ce(e,t,n){let o;if("viewport"===t)o=function(e,t){const n=V(e),o=Y(e),i=n.visualViewport;let s=o.clientWidth,r=o.clientHeight,l=0,a=0;if(i){s=i.width,r=i.height;const e=ne();(!e||e&&"fixed"===t)&&(l=i.offsetLeft,a=i.offsetTop)}return{width:s,height:r,x:l,y:a}}(e,n);else if("document"===t)o=function(e){const t=Y(e),n=re(e),o=e.ownerDocument.body,i=l(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=l(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+we(e);const a=-n.scrollTop;return"rtl"===se(o).direction&&(r+=l(t.clientWidth,o.clientWidth)-i),{width:i,height:s,x:r,y:a}}(Y(e));else if(q(t))o=function(e,t){const n=ge(e,!0,"fixed"===t),o=n.top+e.clientTop,i=n.left+e.clientLeft,s=W(e)?fe(e):d(1);return{width:e.clientWidth*s.x,height:e.clientHeight*s.y,x:i*s.x,y:o*s.y}}(t,n);else{const n=me(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return k(o)}function be(e,t){const n=le(e);return!(n===t||!q(n)||ie(n))&&("fixed"===se(n).position||be(n,t))}function Ee(e,t,n){const o=W(t),i=Y(t),s="fixed"===n,r=ge(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const a=d(0);function c(){a.x=we(i)}if(o||!o&&!s)if(("body"!==F(t)||j(i))&&(l=re(t)),o){const e=ge(t,!0,s,t);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else i&&c();s&&!o&&i&&c();const h=!i||o||s?d(0):ye(i,l);return{x:r.left+l.scrollLeft-a.x-h.x,y:r.top+l.scrollTop-a.y-h.y,width:r.width,height:r.height}}function xe(e){return"static"===se(e).position}function Le(e,t){if(!W(e)||"fixed"===se(e).position)return null;if(t)return t(e);let n=e.offsetParent;return Y(e)===n&&(n=n.ownerDocument.body),n}function Se(e,t){const n=V(e);if(Z(e))return n;if(!W(e)){let t=le(e);for(;t&&!ie(t);){if(q(t)&&!xe(t))return t;t=le(t)}return n}let o=Le(e,t);for(;o&&X(o)&&xe(o);)o=Le(o,t);return o&&ie(o)&&xe(o)&&!te(o)?n:o||function(e){let t=le(e);for(;W(t)&&!ie(t);){if(te(t))return t;if(Z(t))return null;t=le(t)}return null}(e)||n}const Te={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const s="fixed"===i,r=Y(o),l=!!t&&Z(t.floating);if(o===r||l&&s)return n;let a={scrollLeft:0,scrollTop:0},c=d(1);const h=d(0),u=W(o);if((u||!u&&!s)&&(("body"!==F(o)||j(r))&&(a=re(o)),W(o))){const e=ge(o);c=fe(o),h.x=e.x+o.clientLeft,h.y=e.y+o.clientTop}const f=!r||u||s?d(0):ye(r,a,!0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+h.x+f.x,y:n.y*c.y-a.scrollTop*c.y+h.y+f.y}},getDocumentElement:Y,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const s=[..."clippingAncestors"===n?Z(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let o=ce(e,[],!1).filter(e=>q(e)&&"body"!==F(e)),i=null;const s="fixed"===se(e).position;let r=s?le(e):e;for(;q(r)&&!ie(r);){const t=se(r),n=te(r);n||"fixed"!==t.position||(i=null),(s?!n&&!i:!n&&"static"===t.position&&i&&ve.has(i.position)||j(r)&&!n&&be(e,r))?o=o.filter(e=>e!==r):i=t,r=le(r)}return t.set(e,o),o}(t,this._c):[].concat(n),o],a=s[0],c=s.reduce((e,n)=>{const o=Ce(t,n,i);return e.top=l(o.top,e.top),e.right=r(o.right,e.right),e.bottom=r(o.bottom,e.bottom),e.left=l(o.left,e.left),e},Ce(t,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:Se,getElementRects:async function(e){const t=this.getOffsetParent||Se,n=this.getDimensions,o=await n(e.floating);return{reference:Ee(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=he(e);return{width:t,height:n}},getScale:fe,isElement:q,isRTL:function(e){return"rtl"===se(e).direction}};function Ae(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ie(e,t,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:d="function"==typeof IntersectionObserver,animationFrame:h=!1}=o,u=ue(e),f=i||s?[...u?ce(u):[],...ce(t)]:[];f.forEach(e=>{i&&e.addEventListener("scroll",n,{passive:!0}),s&&e.addEventListener("resize",n)});const p=u&&d?function(e,t){let n,o=null;const i=Y(e);function s(){var e;clearTimeout(n),null==(e=o)||e.disconnect(),o=null}return function a(d,h){void 0===d&&(d=!1),void 0===h&&(h=1),s();const u=e.getBoundingClientRect(),{left:f,top:p,width:m,height:g}=u;if(d||t(),!m||!g)return;const w={rootMargin:-c(p)+"px "+-c(i.clientWidth-(f+m))+"px "+-c(i.clientHeight-(p+g))+"px "+-c(f)+"px",threshold:l(0,r(1,h))||1};let y=!0;function v(t){const o=t[0].intersectionRatio;if(o!==h){if(!y)return a();o?a(!1,o):n=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==o||Ae(u,e.getBoundingClientRect())||a(),y=!1}try{o=new IntersectionObserver(v,{...w,root:i.ownerDocument})}catch(e){o=new IntersectionObserver(v,w)}o.observe(e)}(!0),s}(u,n):null;let m,g=-1,w=null;a&&(w=new ResizeObserver(e=>{let[o]=e;o&&o.target===u&&w&&(w.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var e;null==(e=w)||e.observe(t)})),n()}),u&&!h&&w.observe(u),w.observe(t));let y=h?ge(e):null;return h&&function t(){const o=ge(e);y&&!Ae(y,o)&&n();y=o,m=requestAnimationFrame(t)}(),n(),()=>{var e;f.forEach(e=>{i&&e.removeEventListener("scroll",n),s&&e.removeEventListener("resize",n)}),null==p||p(),null==(e=w)||e.disconnect(),w=null,h&&cancelAnimationFrame(m)}}const Oe=R,Pe=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:i,y:s,placement:r,middlewareData:l}=t,a=await async function(e,t){const{placement:n,platform:o,elements:i}=e,s=await(null==o.isRTL?void 0:o.isRTL(i.floating)),r=m(n),l=g(n),a="y"===C(n),c=B.has(r)?-1:1,d=s&&a?-1:1,h=p(t,e);let{mainAxis:u,crossAxis:f,alignmentAxis:w}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&"number"==typeof w&&(f="end"===l?-1*w:w),a?{x:f*d,y:u*c}:{x:u*c,y:f*d}}(t,e);return r===(null==(n=l.offset)?void 0:n.placement)&&null!=(o=l.arrow)&&o.alignmentOffset?{}:{x:i+a.x,y:s+a.y,data:{...a,placement:r}}}}},ke=function(e){return void 0===e&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,o,i;const{rects:r,middlewareData:l,placement:a,platform:c,elements:d}=t,{crossAxis:h=!1,alignment:u,allowedPlacements:f=s,autoAlignment:w=!0,...y}=p(e,t),v=void 0!==u||f===s?function(e,t,n){return(e?[...n.filter(t=>g(t)===e),...n.filter(t=>g(t)!==e)]:n.filter(e=>m(e)===e)).filter(n=>!e||g(n)===e||!!t&&x(n)!==n)}(u||null,w,f):f,C=await R(t,y),b=(null==(n=l.autoPlacement)?void 0:n.index)||0,L=v[b];if(null==L)return{};const S=E(L,r,await(null==c.isRTL?void 0:c.isRTL(d.floating)));if(a!==L)return{reset:{placement:v[0]}};const T=[C[m(L)],C[S[0]],C[S[1]]],A=[...(null==(o=l.autoPlacement)?void 0:o.overflows)||[],{placement:L,overflows:T}],I=v[b+1];if(I)return{data:{index:b+1,overflows:A},reset:{placement:I}};const O=A.map(e=>{const t=g(e.placement);return[e.placement,t&&h?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),P=(null==(i=O.filter(e=>e[2].slice(0,g(e[0])?2:3).every(e=>e<=0))[0])?void 0:i[0])||O[0][0];return P!==a?{data:{index:b+1,overflows:A},reset:{placement:P}}:{}}}},De=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:i}=t,{mainAxis:s=!0,crossAxis:r=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...a}=p(e,t),c={x:n,y:o},d=await R(t,a),h=C(m(i)),u=w(h);let g=c[u],y=c[h];if(s){const e="y"===u?"bottom":"right";g=f(g+d["y"===u?"top":"left"],g,g-d[e])}if(r){const e="y"===h?"bottom":"right";y=f(y+d["y"===h?"top":"left"],y,y-d[e])}const v=l.fn({...t,[u]:g,[h]:y});return{...v,data:{x:v.x-n,y:v.y-o,enabled:{[u]:s,[h]:r}}}}}},Re=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:i,middlewareData:s,rects:r,initialPlacement:l,platform:a,elements:c}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:u,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:w=!0,...y}=p(e,t);if(null!=(n=s.arrow)&&n.alignmentOffset)return{};const v=m(i),b=C(l),L=m(l)===l,S=await(null==a.isRTL?void 0:a.isRTL(c.floating)),T=u||(L||!w?[O(l)]:function(e){const t=O(e);return[x(e),t,x(t)]}(l)),A="none"!==g;!u&&A&&T.push(...I(l,w,g,S));const P=[l,...T],k=await R(t,y),D=[];let M=(null==(o=s.flip)?void 0:o.overflows)||[];if(d&&D.push(k[v]),h){const e=E(i,r,S);D.push(k[e[0]],k[e[1]])}if(M=[...M,{placement:i,overflows:D}],!D.every(e=>e<=0)){var _,H;const e=((null==(_=s.flip)?void 0:_.index)||0)+1,t=P[e];if(t){if(!("alignment"===h&&b!==C(t))||M.every(e=>C(e.placement)!==b||e.overflows[0]>0))return{data:{index:e,overflows:M},reset:{placement:t}}}let n=null==(H=M.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:H.placement;if(!n)switch(f){case"bestFit":{var B;const e=null==(B=M.filter(e=>{if(A){const t=C(e.placement);return t===b||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:B[0];e&&(n=e);break}case"initialPlacement":n=l}if(i!==n)return{reset:{placement:n}}}return{}}}},Me=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:i,rects:s,platform:a,elements:c}=t,{apply:d=()=>{},...h}=p(e,t),u=await R(t,h),f=m(i),w=g(i),y="y"===C(i),{width:v,height:b}=s.floating;let E,x;"top"===f||"bottom"===f?(E=f,x=w===(await(null==a.isRTL?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(x=f,E="end"===w?"top":"bottom");const L=b-u.top-u.bottom,S=v-u.left-u.right,T=r(b-u[E],L),A=r(v-u[x],S),I=!t.middlewareData.shift;let O=T,P=A;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(P=S),null!=(o=t.middlewareData.shift)&&o.enabled.y&&(O=L),I&&!w){const e=l(u.left,0),t=l(u.right,0),n=l(u.top,0),o=l(u.bottom,0);y?P=v-2*(0!==e||0!==t?e+t:l(u.left,u.right)):O=b-2*(0!==n||0!==o?n+o:l(u.top,u.bottom))}await d({...t,availableWidth:P,availableHeight:O});const k=await a.getDimensions(c.floating);return v!==k.width||b!==k.height?{reset:{rects:!0}}:{}}}},_e=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...i}=p(e,t);switch(o){case"referenceHidden":{const e=M(await R(t,{...i,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:_(e)}}}case"escaped":{const e=M(await R(t,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:_(e)}}}default:return{}}}}},He=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:i,rects:s,platform:l,elements:a,middlewareData:c}=t,{element:d,padding:h=0}=p(e,t)||{};if(null==d)return{};const u=P(h),m={x:n,y:o},w=b(i),v=y(w),C=await l.getDimensions(d),E="y"===w,x=E?"top":"left",L=E?"bottom":"right",S=E?"clientHeight":"clientWidth",T=s.reference[v]+s.reference[w]-m[w]-s.floating[v],A=m[w]-s.reference[w],I=await(null==l.getOffsetParent?void 0:l.getOffsetParent(d));let O=I?I[S]:0;O&&await(null==l.isElement?void 0:l.isElement(I))||(O=a.floating[S]||s.floating[v]);const k=T/2-A/2,D=O/2-C[v]/2-1,R=r(u[x],D),M=r(u[L],D),_=R,H=O-C[v]-M,B=O/2-C[v]/2+k,$=f(_,B,H),F=!c.arrow&&null!=g(i)&&B!==$&&s.reference[v]/2-(B<_?R:M)-C[v]/2<0,V=F?B<_?B-_:B-H:0;return{[w]:m[w]+V,data:{[w]:$,centerOffset:B-$-V,...F&&{alignmentOffset:V}},reset:F}}}),Be=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:o,rects:i,platform:s,strategy:a}=t,{padding:c=2,x:d,y:h}=p(e,t),u=Array.from(await(null==s.getClientRects?void 0:s.getClientRects(o.reference))||[]),f=function(e){const t=e.slice().sort((e,t)=>e.y-t.y),n=[];let o=null;for(let e=0;e<t.length;e++){const i=t[e];!o||i.y-o.y>o.height/2?n.push([i]):n[n.length-1].push(i),o=i}return n.map(e=>k(H(e)))}(u),g=k(H(u)),w=P(c);const y=await s.getElementRects({reference:{getBoundingClientRect:function(){if(2===f.length&&f[0].left>f[1].right&&null!=d&&null!=h)return f.find(e=>d>e.left-w.left&&d<e.right+w.right&&h>e.top-w.top&&h<e.bottom+w.bottom)||g;if(f.length>=2){if("y"===C(n)){const e=f[0],t=f[f.length-1],o="top"===m(n),i=e.top,s=t.bottom,r=o?e.left:t.left,l=o?e.right:t.right;return{top:i,bottom:s,left:r,right:l,width:l-r,height:s-i,x:r,y:i}}const e="left"===m(n),t=l(...f.map(e=>e.right)),o=r(...f.map(e=>e.left)),i=f.filter(n=>e?n.left===o:n.right===t),s=i[0].top,a=i[i.length-1].bottom;return{top:s,bottom:a,left:o,right:t,width:t-o,height:a-s,x:o,y:s}}return g}},floating:o.floating,strategy:a});return i.reference.x!==y.reference.x||i.reference.y!==y.reference.y||i.reference.width!==y.reference.width||i.reference.height!==y.reference.height?{reset:{rects:y}}:{}}}},$e=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:i,rects:s,middlewareData:r}=t,{offset:l=0,mainAxis:a=!0,crossAxis:c=!0}=p(e,t),d={x:n,y:o},h=C(i),u=w(h);let f=d[u],g=d[h];const y=p(l,t),v="number"==typeof y?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(a){const e="y"===u?"height":"w