vrembem 4.0.0-next.25 → 4.0.0-next.26

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.
@@ -1,10 +1,10 @@
1
- (function(w,C){typeof exports=="object"&&typeof module<"u"?C(exports):typeof define=="function"&&define.amd?define(["exports"],C):(w=typeof globalThis<"u"?globalThis:w||self,C(w.vrembem={}))})(this,function(w){"use strict";var ii=w=>{throw TypeError(w)};var si=(w,C,P)=>C.has(w)||ii("Cannot "+P);var E=(w,C,P)=>(si(w,C,"read from private field"),P?P.call(w):C.get(w)),q=(w,C,P)=>C.has(w)?ii("Cannot add the same private member more than once"):C instanceof WeakSet?C.add(w):C.set(w,P),N=(w,C,P,at)=>(si(w,C,"write to private field"),at?at.call(w,P):C.set(w,P),P);var _,ht,tt,et,pt,gt,vt,mt,bt;class C{constructor(e,i){q(this,_);this.value=e,N(this,_,i),this.mql=null}get handler(){return E(this,_)}set handler(e){this.mql&&this.mql.removeEventListener("change",E(this,_)),N(this,_,e)}mount(e,i){return e&&(this.value=e),i&&N(this,_,i),this.value?(this.mql=window.matchMedia(`(min-width: ${this.value})`),this.mql.addEventListener("change",E(this,_)),E(this,_).call(this,this.mql),this):this}unmount(){return this.mql?(this.mql.removeEventListener("change",E(this,_)),this.value=null,N(this,_,null),this.mql=null,this):this}}_=new WeakMap;class P{constructor(){this.collection=[]}async register(e){return await this.deregister(e),this.collection.push(e),this.collection}async deregister(e){const i=this.collection.findIndex(s=>s===e);if(i>=0){const s=this.collection[i];Object.getOwnPropertyNames(s).forEach(n=>{delete s[n]}),this.collection.splice(i,1)}return this.collection}async registerCollection(e){return await Promise.all(Array.from(e,i=>{this.register(i)})),this.collection}async deregisterCollection(){for(;this.collection.length>0;)await this.deregister(this.collection[0]);return this.collection}get(e,i="id"){return this.collection.find(s=>s[i]===e)}}class at{constructor(e=null,i="[data-focus]"){q(this,ht);q(this,tt);q(this,et);this.el=e,this.selectorFocus=i,N(this,tt,ri.bind(this)),N(this,et,oi.bind(this))}get focusable(){return E(this,ht)}set focusable(e){N(this,ht,e),E(this,ht).length?(document.removeEventListener("keydown",E(this,et)),document.addEventListener("keydown",E(this,tt))):(document.removeEventListener("keydown",E(this,tt)),document.addEventListener("keydown",E(this,et)))}get focusableFirst(){return this.focusable[0]}get focusableLast(){return this.focusable[this.focusable.length-1]}mount(e,i){e&&(this.el=e),i&&(this.selectorFocus=i),this.focusable=this.getFocusable(),this.focus()}unmount(){this.el=null,this.focusable=[],document.removeEventListener("keydown",E(this,tt)),document.removeEventListener("keydown",E(this,et))}focus(e=this.el,i=this.selectorFocus){(e.querySelector(i)||e).focus()}getFocusable(e=this.el){const i=[],s=document.activeElement,n=e.scrollTop,r=ni.join(",");return e.querySelectorAll(r).forEach(l=>{l.focus(),document.activeElement===l&&i.push(l)}),e.scrollTop=n,s.focus(),i}}ht=new WeakMap,tt=new WeakMap,et=new WeakMap;const R=":not([inert])",B=':not([tabindex^="-"])',yt=":not(:disabled)",ni=[`a[href]${R}${B}`,`area[href]${R}${B}`,`input:not([type="hidden"]):not([type="radio"])${R}${B}${yt}`,`input[type="radio"]${R}${B}${yt}`,`select${R}${B}${yt}`,`textarea${R}${B}${yt}`,`button${R}${B}${yt}`,`details${R} > summary:first-of-type${B}`,`iframe${R}${B}`,`audio[controls]${R}${B}`,`video[controls]${R}${B}`,`[contenteditable]${R}${B}`,`[tabindex]${R}${B}`];function ri(t){(t.key==="Tab"||t.keyCode===9)&&(t.shiftKey?(document.activeElement===this.focusableFirst||document.activeElement===this.el)&&(t.preventDefault(),this.focusableLast.focus()):(document.activeElement===this.focusableLast||document.activeElement===this.el)&&(t.preventDefault(),this.focusableFirst.focus()))}function oi(t){(t.key==="Tab"||t.keyCode===9)&&t.preventDefault()}function Mt(){return getComputedStyle(document.body).getPropertyValue("--vb-prefix").trim()}function Kt(t,e){const i={fallback:null,element:document.body,...e};if(t.slice(0,2)!=="--"){const n=Mt();n&&(t=`${n}${t}`),t=`--${t}`}const s=getComputedStyle(i.element).getPropertyValue(t).trim();if(s)return s;if(i.fallback)return i.fallback;throw new Error(`CSS variable "${t}" was not found!`)}function Xt(t,e){const s=(t.getAttribute(`data-${e}`)||"").replace(/'/g,'"');return s?JSON.parse(s):{}}function Yt(t,e=!0){const i=localStorage.getItem(t),s=i?JSON.parse(i):{};return{get(n){return n?s[n]:s},set(n,r){return r?s[n]=r:delete s[n],e&&localStorage.setItem(t,JSON.stringify(s)),s}}}function qt(t,e,i){const s=e.nodeType===Node.COMMENT_NODE,n=e.nodeType===Node.ELEMENT_NODE;if(e=s||n?e:document.querySelector(e),s&&(i="after"),!e)throw new Error(`Not a valid teleport reference: '${e}'`);if(typeof e[i]!="function")throw new Error(`Not a valid teleport method: '${i}'`);let r=null;return s||(r=document.createComment("teleported #"+t.id),t.before(r)),e[i](t),s&&e.remove(),r}function ai(t){const e={prefix:Kt("prefix-themes",{fallback:"vb-theme-"}),themes:["root","light","dark"],storeKey:"VB:Profile"};for(const[r]of Object.entries(e))t&&t[r]&&(e[r]=t[r]);const i={onInit(){},onChange(){}};for(const[r]of Object.entries(i))t&&t[r]&&(i[r]=t[r]);const s=Yt(e.storeKey),n={settings:e,add(r){e.themes.push(r)},remove(r){const a=e.themes.indexOf(r);~a&&e.themes.splice(a,1)},callback(r){i[r].call(this)},get class(){return`${e.prefix}${this.theme}`},get classes(){return e.themes.map(r=>`${e.prefix}${r}`)},get themes(){return e.themes},get theme(){return s.get("theme")||"root"},set theme(r){e.themes.includes(r)?this.theme!=r&&(s.set("theme",r),document.documentElement.classList.remove(...this.classes),document.documentElement.classList.add(`${e.prefix}${r}`),this.callback("onChange")):console.error(`Not a valid theme value: "${r}"`)}};return n.callback("onInit"),n}function xt(t,e,i,s="transition-duration"){return new Promise(n=>{if(typeof s=="string"){const r=Kt(s,{element:t}),a=!!r.includes("ms");s=parseFloat(r)*(a?1:1e3)}t.classList.remove(e.finish),t.classList.add(i.start),setTimeout(()=>{t.classList.add(i.finish),t.classList.remove(i.start),n(t)},s)})}function li(t,e){e&&document.querySelectorAll(e).forEach(s=>{t?s.style.overflow="hidden":s.style.removeProperty("overflow")})}function ci(t,e){e&&document.querySelectorAll(e).forEach(s=>{t?(s.inert=!0,s.setAttribute("aria-hidden",!0)):(s.inert=null,s.removeAttribute("aria-hidden"))})}function Et(t,e){ci(!!t,e.selectorInert),li(!!t,e.selectorOverflow)}const fi=Object.freeze(Object.defineProperty({__proto__:null,Breakpoint:C,Collection:P,FocusTrap:at,cssVar:Kt,getConfig:Xt,getPrefix:Mt,localStore:Yt,teleport:qt,themeStore:ai,transition:xt,updateGlobalState:Et},Symbol.toStringTag,{value:"Module"})),ui={autoMount:!1,dataOpen:"drawer-open",dataClose:"drawer-close",dataToggle:"drawer-toggle",dataBreakpoint:"drawer-breakpoint",dataConfig:"drawer-config",selectorDrawer:".drawer",selectorDialog:".drawer__dialog",selectorScreen:".drawer",selectorFocus:"[data-focus]",selectorInert:null,selectorOverflow:"body",stateOpened:"is-opened",stateOpening:"is-opening",stateClosing:"is-closing",stateClosed:"is-closed",classModal:"drawer_modal",breakpoints:null,customEventPrefix:"drawer:",eventListeners:!0,store:!0,storeKey:"VB:DrawerState",setTabindex:!0,transition:!0,transitionDuration:"drawer-transition-duration"};function di(t){t.store==="opened"?t.open(!1,!1):t.store==="closed"?t.close(!1,!1):t.store==="indeterminate"?t.state="indeterminate":t.el.classList.contains(t.getSetting("stateOpened"))?t.open(!1,!1):t.el.classList.contains(t.getSetting("stateClosed"))?t.close(!1,!1):t.state="indeterminate"}async function hi(t){t.store==="opened"?await t.open(!1,!1):t.store==="closed"?await t.close(!1,!1):t.store==="indeterminate"?t.state!="indeterminate"&&(t.state="indeterminate"):(t.state!=t.inlineState&&(t.state=t.inlineState),t.inlineState==="opened"?await t.open(!1,!1):t.inlineState==="closed"&&await t.close(!1,!1))}function pi(t){const e=Mt(),i=t.getAttribute(`data-${this.settings.dataBreakpoint}`);return this.settings.breakpoints&&this.settings.breakpoints[i]?this.settings.breakpoints[i]:getComputedStyle(document.body).getPropertyValue(`--${e}breakpoint-${i}`).trim()?getComputedStyle(document.body).getPropertyValue(`--${e}breakpoint-${i}`).trim():i}function lt(t){const e=typeof t=="string"?this.get(t):this.get(t.id);if(e)return e;throw new Error(`Drawer not found in collection with id of "${t.id||t}".`)}function me(t){t.state==="opened"?t.mode==="modal"?this.focusTrap.mount(t.dialog,this.settings.selectorFocus):this.focusTrap.focus(t.dialog,this.settings.selectorFocus):(t.trigger&&(t.trigger.focus(),t.trigger=null),this.focusTrap.unmount())}async function gi(t){const e=t.target.closest(`
1
+ (function(x,C){typeof exports=="object"&&typeof module<"u"?C(exports):typeof define=="function"&&define.amd?define(["exports"],C):(x=typeof globalThis<"u"?globalThis:x||self,C(x.vrembem={}))})(this,function(x){"use strict";var Re=x=>{throw TypeError(x)};var Me=(x,C,L)=>C.has(x)||Re("Cannot "+L);var S=(x,C,L)=>(Me(x,C,"read from private field"),L?L.call(x):C.get(x)),I=(x,C,L)=>C.has(x)?Re("Cannot add the same private member more than once"):C instanceof WeakSet?C.add(x):C.set(x,L),$=(x,C,L,et)=>(Me(x,C,"write to private field"),et?et.call(x,L):C.set(x,L),L);var D,xt,lt,U,Z,ct,at,ft,ut,dt;class C{constructor(n,i){I(this,D);this.value=n,$(this,D,i),this.mql=null}get handler(){return S(this,D)}set handler(n){this.mql&&this.mql.removeEventListener("change",S(this,D)),$(this,D,n)}mount(n,i){return n&&(this.value=n),i&&$(this,D,i),this.value?(this.mql=window.matchMedia(`(min-width: ${this.value})`),this.mql.addEventListener("change",S(this,D)),S(this,D).call(this,this.mql),this):this}unmount(){return this.mql?(this.mql.removeEventListener("change",S(this,D)),this.value=null,$(this,D,null),this.mql=null,this):this}}D=new WeakMap;class L{constructor(n={}){I(this,xt);const i=this;this.module=this.constructor.name,this.collection=[],this.settings=Object.assign({dataConfig:"config"},n),$(this,xt,{applySettings(e){return Object.assign(this.settings,e)},getDataConfig(){return Object.assign(this.dataConfig,se(this.el,this.getSetting("dataConfig")))},getCustomProps(){return Object.assign(this.customProps,oe(this.el,i.module,this.customPropKeys))},getSetting(e){const s=le(e),o=ce(e);if("dataConfig"in this&&s in this.dataConfig)return this.dataConfig[s];if("customProps"in this&&o in this.customProps)return this.customProps[o];if("settings"in this&&s in this.settings)return this.settings[s];if("settings"in i&&s in i.settings)return i.settings[s];throw new Error(`${i.module} setting does not exist: ${e}`)},teleport(e=this.getSetting("teleport"),s=this.getSetting("teleportMethod")){return this.returnRef?(console.error("Element has already been teleported:",this.el),!1):(this.returnRef=Nt(this.el,e,s),this.el)},teleportReturn(){return this.returnRef?(this.returnRef=Nt(this.el,this.returnRef),this.el):(console.error("No return reference found:",this.el),!1)}})}createEntry(n,i={}){const e=re(n),s=Object.create(S(this,xt));return Object.assign(s,{id:e==null?void 0:e.id,el:e,settings:{},dataConfig:{},customProps:{},customPropKeys:[],returnRef:null},i),s}async register(n){return await this.deregister(n),this.collection.push(n),this.collection}async deregister(n){const i=this.collection.findIndex(e=>e===n);if(i>=0){const e=this.collection[i];Object.getOwnPropertyNames(e).forEach(s=>{delete e[s]}),this.collection.splice(i,1)}return this.collection}async registerCollection(n){return await Promise.all(Array.from(n,i=>{this.register(i)})),this.collection}async deregisterCollection(){for(;this.collection.length>0;)await this.deregister(this.collection[0]);return this.collection}get(n,i="id"){return this.collection.find(e=>e[i]===n)}}xt=new WeakMap;class et{constructor(n=null,i="[data-focus]"){I(this,lt);I(this,U);I(this,Z);this.el=n,this.selectorFocus=i,$(this,U,Fe.bind(this)),$(this,Z,Ne.bind(this))}get focusable(){return S(this,lt)}set focusable(n){$(this,lt,n),S(this,lt).length?(document.removeEventListener("keydown",S(this,Z)),document.addEventListener("keydown",S(this,U))):(document.removeEventListener("keydown",S(this,U)),document.addEventListener("keydown",S(this,Z)))}get focusableFirst(){return this.focusable[0]}get focusableLast(){return this.focusable[this.focusable.length-1]}mount(n,i){n&&(this.el=n),i&&(this.selectorFocus=i),this.focusable=this.getFocusable(),this.focus()}unmount(){this.el=null,this.focusable=[],document.removeEventListener("keydown",S(this,U)),document.removeEventListener("keydown",S(this,Z))}focus(n=this.el,i=this.selectorFocus){(n.querySelector(i)||n).focus()}getFocusable(n=this.el){const i=[],e=document.activeElement,s=n.scrollTop,o=Ie.join(",");return n.querySelectorAll(o).forEach(l=>{l.focus(),document.activeElement===l&&i.push(l)}),n.scrollTop=s,e.focus(),i}}lt=new WeakMap,U=new WeakMap,Z=new WeakMap;const O=":not([inert])",k=':not([tabindex^="-"])',ht=":not(:disabled)",Ie=[`a[href]${O}${k}`,`area[href]${O}${k}`,`input:not([type="hidden"]):not([type="radio"])${O}${k}${ht}`,`input[type="radio"]${O}${k}${ht}`,`select${O}${k}${ht}`,`textarea${O}${k}${ht}`,`button${O}${k}${ht}`,`details${O} > summary:first-of-type${k}`,`iframe${O}${k}`,`audio[controls]${O}${k}`,`video[controls]${O}${k}`,`[contenteditable]${O}${k}`,`[tabindex]${O}${k}`];function Fe(t){(t.key==="Tab"||t.keyCode===9)&&(t.shiftKey?(document.activeElement===this.focusableFirst||document.activeElement===this.el)&&(t.preventDefault(),this.focusableLast.focus()):(document.activeElement===this.focusableLast||document.activeElement===this.el)&&(t.preventDefault(),this.focusableFirst.focus()))}function Ne(t){(t.key==="Tab"||t.keyCode===9)&&t.preventDefault()}function Lt(){return getComputedStyle(document.body).getPropertyValue("--vb-prefix").trim()}function It(t,n){const i={fallback:null,element:document.body,...n};if(t.slice(0,2)!=="--"){const s=Lt();s&&(t=`${s}${t}`),t=`--${t}`}const e=getComputedStyle(i.element).getPropertyValue(t).trim();if(e)return e;if(i.fallback)return i.fallback;throw new Error(`CSS variable "${t}" was not found!`)}function se(t,n="config"){const e=(t.getAttribute(`data-${n}`)||"").replace(/'/g,'"');return e?JSON.parse(e):{}}function oe(t,n,i){const e=getComputedStyle(t),s={};for(let o=0;o<i.length;o++){const r=Lt(),l=e.getPropertyValue(`--${r}${n.toLowerCase()}-${i[o]}`).trim();l&&(s[i[o]]=l)}return s}function re(t){if(typeof t=="string")return document.getElementById(t);if(t instanceof HTMLElement)return t}function Ft(t,n=!0){const i=localStorage.getItem(t),e=i?JSON.parse(i):{};return{get(s){return s?e[s]:e},set(s,o){return o?e[s]=o:delete e[s],n&&localStorage.setItem(t,JSON.stringify(e)),e}}}function Nt(t,n,i){const e=n.nodeType===Node.COMMENT_NODE,s=n.nodeType===Node.ELEMENT_NODE;if(n=e||s?n:document.querySelector(n),e&&(i="after"),!n)throw new Error(`Not a valid teleport reference: '${n}'`);if(typeof n[i]!="function")throw new Error(`Not a valid teleport method: '${i}'`);let o=null;return e||(o=document.createComment("teleported #"+t.id),t.before(o)),n[i](t),e&&n.remove(),o}function _e(t){const n={prefix:It("prefix-themes",{fallback:"vb-theme-"}),themes:["root","light","dark"],storeKey:"VB:Profile"};for(const[o]of Object.entries(n))t&&t[o]&&(n[o]=t[o]);const i={onInit(){},onChange(){}};for(const[o]of Object.entries(i))t&&t[o]&&(i[o]=t[o]);const e=Ft(n.storeKey),s={settings:n,add(o){n.themes.push(o)},remove(o){const r=n.themes.indexOf(o);~r&&n.themes.splice(r,1)},callback(o){i[o].call(this)},get class(){return`${n.prefix}${this.theme}`},get classes(){return n.themes.map(o=>`${n.prefix}${o}`)},get themes(){return n.themes},get theme(){return e.get("theme")||"root"},set theme(o){n.themes.includes(o)?this.theme!=o&&(e.set("theme",o),document.documentElement.classList.remove(...this.classes),document.documentElement.classList.add(`${n.prefix}${o}`),this.callback("onChange")):console.error(`Not a valid theme value: "${o}"`)}};return s.callback("onInit"),s}function le(t){return t.split("-").map((n,i)=>i===0?n:n.charAt(0).toUpperCase()+n.slice(1)).join("")}function ce(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function mt(t,n,i,e="transition-duration"){return new Promise(s=>{if(typeof e=="string"){const o=It(e,{element:t}),r=!!o.includes("ms");e=parseFloat(o)*(r?1:1e3)}t.classList.remove(n.finish),t.classList.add(i.start),setTimeout(()=>{t.classList.add(i.finish),t.classList.remove(i.start),s(t)},e)})}function Be(t,n){n&&document.querySelectorAll(n).forEach(e=>{t?e.style.overflow="hidden":e.style.removeProperty("overflow")})}function Ve(t,n){n&&document.querySelectorAll(n).forEach(e=>{t?(e.inert=!0,e.setAttribute("aria-hidden",!0)):(e.inert=null,e.removeAttribute("aria-hidden"))})}function pt(t,n,i){Ve(!!t,n),Be(!!t,i)}const je=Object.freeze(Object.defineProperty({__proto__:null,Breakpoint:C,Collection:L,FocusTrap:et,cssVar:It,getConfig:se,getCustomProps:oe,getElement:re,getPrefix:Lt,localStore:Ft,teleport:Nt,themeStore:_e,toCamel:le,toKebab:ce,transition:mt,updateGlobalState:pt},Symbol.toStringTag,{value:"Module"})),He={dataOpen:"drawer-open",dataClose:"drawer-close",dataToggle:"drawer-toggle",dataBreakpoint:"drawer-breakpoint",selectorDrawer:".drawer",selectorDialog:".drawer__dialog",selectorScreen:".drawer",selectorFocus:"[data-focus]",selectorInert:null,selectorOverflow:"body",stateOpened:"is-opened",stateOpening:"is-opening",stateClosing:"is-closing",stateClosed:"is-closed",classModal:"drawer_modal",breakpoints:null,customEventPrefix:"drawer:",eventListeners:!0,store:!0,storeKey:"VB:DrawerState",setTabindex:!0,teleport:null,teleportMethod:"prepend",transition:!0,transitionDuration:"drawer-transition-duration"};function ze(t){t.store==="opened"?t.open(!1,!1):t.store==="closed"?t.close(!1,!1):t.store==="indeterminate"?t.state="indeterminate":t.el.classList.contains(t.getSetting("stateOpened"))?t.open(!1,!1):t.el.classList.contains(t.getSetting("stateClosed"))?t.close(!1,!1):t.state="indeterminate"}async function We(t){t.store==="opened"?await t.open(!1,!1):t.store==="closed"?await t.close(!1,!1):t.store==="indeterminate"?t.state!="indeterminate"&&(t.state="indeterminate"):(t.state!=t.inlineState&&(t.state=t.inlineState),t.inlineState==="opened"?await t.open(!1,!1):t.inlineState==="closed"&&await t.close(!1,!1))}function Ke(t){const n=Lt(),i=t.getAttribute(`data-${this.settings.dataBreakpoint}`);return this.settings.breakpoints&&this.settings.breakpoints[i]?this.settings.breakpoints[i]:getComputedStyle(document.body).getPropertyValue(`--${n}breakpoint-${i}`).trim()?getComputedStyle(document.body).getPropertyValue(`--${n}breakpoint-${i}`).trim():i}function it(t){const n=typeof t=="string"?this.get(t):this.get(t.id);if(n)return n;throw new Error(`Drawer not found in collection with id of "${t.id||t}".`)}function ae(t){t.state==="opened"?t.mode==="modal"?this.focusTrap.mount(t.dialog,this.settings.selectorFocus):this.focusTrap.focus(t.dialog,this.settings.selectorFocus):(t.trigger&&(t.trigger.focus(),t.trigger=null),this.focusTrap.unmount())}async function Xe(t){const n=t.target.closest(`
2
2
  [data-${this.settings.dataOpen}],
3
3
  [data-${this.settings.dataToggle}],
4
4
  [data-${this.settings.dataClose}]
5
- `);if(e){t.preventDefault(),e.matches(`[data-${this.settings.dataToggle}]`)&&e.getAttribute(`data-${this.settings.dataToggle}`).trim().split(" ").forEach(s=>{const n=lt.call(this,s);return n.trigger=e,n.toggle()}),e.matches(`[data-${this.settings.dataOpen}]`)&&e.getAttribute(`data-${this.settings.dataOpen}`).trim().split(" ").forEach(s=>{const n=lt.call(this,s);return n.trigger=e,n.open()}),e.matches(`[data-${this.settings.dataClose}]`)&&e.getAttribute(`data-${this.settings.dataClose}`).trim().split(" ").forEach(s=>{if(s){const n=lt.call(this,s);return n.trigger=e,n.close()}else{const n=t.target.closest(this.settings.selectorDrawer);if(n)return this.close(n)}});return}if(this.activeModal&&t.target.matches(this.settings.selectorScreen))return this.close(this.activeModal.id)}function vi(t){if(t.key==="Escape"&&this.activeModal)return this.close(this.activeModal)}async function Ut(t,e=!0){const i=this.collection.findIndex(s=>s.id===t.id);if(i>=0){const s=this.collection[i];e&&s.state==="opened"&&await s.close(!1),this.store.set(s.id),s.unmountBreakpoint(),Object.getOwnPropertyNames(s).forEach(n=>{delete s[n]}),this.collection.splice(i,1)}return this.collection}async function Gt(t,e,i=!0){const s=lt.call(this,t),n={...this.settings,...s.settings};return e!==void 0&&(n.transition=e),(s.state==="closed"||s.state==="indeterminate")&&(s.state="opening",n.transition?await xt(s.el,{start:n.stateClosing,finish:n.stateClosed},{start:n.stateOpening,finish:n.stateOpened},n.transitionDuration):(s.el.classList.add(n.stateOpened),s.el.classList.remove(n.stateClosed)),s.state="opened",s.mode==="modal"&&Et(!0,n),i&&me.call(this,s),s.el.dispatchEvent(new CustomEvent(n.customEventPrefix+"opened",{detail:this,bubbles:!0}))),s}async function It(t,e,i=!0){const s=lt.call(this,t),n={...this.settings,...s.settings};return e!==void 0&&(n.transition=e),(s.state==="opened"||s.state==="indeterminate")&&(s.state="closing",document.activeElement.blur(),n.transition?await xt(s.el,{start:n.stateOpening,finish:n.stateOpened},{start:n.stateClosing,finish:n.stateClosed},n.transitionDuration):(s.el.classList.add(n.stateClosed),s.el.classList.remove(n.stateOpened)),s.state="closed",s.mode==="modal"&&Et(!1,n),i&&me.call(this,s),s.el.dispatchEvent(new CustomEvent(n.customEventPrefix+"closed",{detail:this,bubbles:!0}))),s}async function be(t,e,i){const s=lt.call(this,t);return s.state==="closed"?Gt.call(this,s,e,i):It.call(this,s,e,i)}function mi(t){switch(t.mode){case"inline":return bi.call(this,t);case"modal":return wi.call(this,t);default:throw new Error(`"${t.mode}" is not a valid drawer mode.`)}}async function bi(t){return t.el.classList.remove(t.getSetting("classModal")),t.dialog.removeAttribute("aria-modal"),Et(!1,{...this.settings,...t.settings}),this.focusTrap.unmount(),await hi(t),t.el.dispatchEvent(new CustomEvent(t.getSetting("customEventPrefix")+"switchMode",{detail:this,bubbles:!0})),t}async function wi(t){return t.el.classList.add(t.getSetting("classModal")),t.dialog.setAttribute("aria-modal","true"),await It.call(this,t,!1,!1),t.el.dispatchEvent(new CustomEvent(t.getSetting("customEventPrefix")+"switchMode",{detail:this,bubbles:!0})),t}async function yi(t,e={}){await Ut.call(this,t,!1);const i=this,s=new C;let n,r="indeterminate";const a={id:t.id,el:t,dialog:null,trigger:null,settings:{...Xt(t,this.settings.dataConfig),...e},inlineState:"indeterminate",get breakpoint(){return pi.call(i,t)},get store(){return i.store.get(this.id)},get mode(){return n},set mode(o){n=o,mi.call(i,this)},get state(){return r},set state(o){r=o,this.mode==="inline"&&o!="opening"&&o!="closing"&&(this.inlineState=o,this.getSetting("store")&&i.store.set(this.id,o)),o==="indeterminate"&&(this.el.classList.remove(this.getSetting("stateOpened")),this.el.classList.remove(this.getSetting("stateOpening")),this.el.classList.remove(this.getSetting("stateClosed")),this.el.classList.remove(this.getSetting("stateClosing")))},open(o,f){return Gt.call(i,this,o,f)},close(o,f){return It.call(i,this,o,f)},toggle(o,f){return be.call(i,this,o,f)},deregister(){return Ut.call(i,this)},mountBreakpoint(){const o=this.breakpoint,f=this.handleBreakpoint.bind(this);return s.mount(o,f),this},unmountBreakpoint(){return s.unmount(),this},handleBreakpoint(o){const f=o.matches?"inline":"modal";return this.mode!=f&&(this.mode=f),this},getSetting(o){return o in this.settings?this.settings[o]:i.settings[o]}};this.collection.push(a);const l=t.querySelector(a.getSetting("selectorDialog"));return a.dialog=l||t,a.getSetting("setTabindex")&&a.dialog.setAttribute("tabindex","-1"),await di(a),a.inlineState=a.state,a.mode=t.classList.contains(a.getSetting("classModal"))?"modal":"inline",a.breakpoint&&a.mountBreakpoint(),a}class xi extends P{constructor(i){super();q(this,pt);q(this,gt);this.defaults=ui,this.settings={...this.defaults,...i},this.focusTrap=new at,this.store=Yt(this.settings.storeKey,this.settings.store),N(this,pt,gi.bind(this)),N(this,gt,vi.bind(this)),this.settings.autoMount&&this.mount()}get activeModal(){return this.collection.find(i=>i.state==="opened"&&i.mode==="modal")}async mount(i=null){i&&(this.settings={...this.settings,...i});const s=document.querySelectorAll(this.settings.selectorDrawer);return await this.registerCollection(s),this.settings.eventListeners&&this.mountEventListeners(),this}async unmount(){return await this.deregisterCollection(),this.settings.eventListeners&&this.unmountEventListeners(),this}mountEventListeners(){document.addEventListener("click",E(this,pt),!1),document.addEventListener("keydown",E(this,gt),!1)}unmountEventListeners(){document.removeEventListener("click",E(this,pt),!1),document.removeEventListener("keydown",E(this,gt),!1)}register(i,s={}){let n=typeof i=="string"?document.getElementById(i):i;return n?yi.call(this,n,s):Promise.reject(new Error(`Failed to register; drawer not found with ID of: "${i.id||i}".`))}deregister(i){let s=this.get(i.id||i);return s?Ut.call(this,s):Promise.reject(new Error(`Failed to deregister; drawer does not exist in collection with ID of: "${i.id||i}".`))}open(i,s,n){return Gt.call(this,i,s,n)}close(i,s,n){return It.call(this,i,s,n)}toggle(i,s,n){return be.call(this,i,s,n)}}pt=new WeakMap,gt=new WeakMap;const Ei={autoMount:!1,dataOpen:"modal-open",dataClose:"modal-close",dataReplace:"modal-replace",dataConfig:"modal-config",selectorModal:".modal",selectorDialog:".modal__dialog",selectorScreen:".modal",selectorRequired:'[role="alertdialog"]',selectorFocus:"[data-focus]",selectorInert:null,selectorOverflow:"body",stateOpened:"is-opened",stateOpening:"is-opening",stateClosing:"is-closing",stateClosed:"is-closed",customEventPrefix:"modal:",eventListeners:!0,teleport:null,teleportMethod:"append",setTabindex:!0,transition:!0,transitionDuration:"modal-transition-duration"};function Ot(t){const e=typeof t=="string"?this.get(t):this.get(t.id);if(e)return e;throw new Error(`Modal not found in collection with id of "${t.id||t}".`)}function Rt(){this.active?this.focusTrap.mount(this.active.dialog,this.settings.selectorFocus):(this.trigger&&(this.trigger.focus(),this.trigger=null),this.focusTrap.unmount())}async function Oi(t){const e=t.target.closest(`
5
+ `);if(n){t.preventDefault(),n.matches(`[data-${this.settings.dataToggle}]`)&&n.getAttribute(`data-${this.settings.dataToggle}`).trim().split(" ").forEach(e=>{const s=it.call(this,e);return s.trigger=n,s.toggle()}),n.matches(`[data-${this.settings.dataOpen}]`)&&n.getAttribute(`data-${this.settings.dataOpen}`).trim().split(" ").forEach(e=>{const s=it.call(this,e);return s.trigger=n,s.open()}),n.matches(`[data-${this.settings.dataClose}]`)&&n.getAttribute(`data-${this.settings.dataClose}`).trim().split(" ").forEach(e=>{if(e){const s=it.call(this,e);return s.trigger=n,s.close()}else{const s=t.target.closest(this.settings.selectorDrawer);if(s)return this.close(s)}});return}if(this.activeModal&&t.target.matches(this.settings.selectorScreen))return this.close(this.activeModal.id)}function Ye(t){if(t.key==="Escape"&&this.activeModal)return this.close(this.activeModal)}async function _t(t,n=!0){const i=this.collection.findIndex(e=>e.id===t.id);if(i>=0){const e=this.collection[i];n&&e.state==="opened"&&await e.close(!1),this.store.set(e.id),e.unmountBreakpoint(),Object.getOwnPropertyNames(e).forEach(s=>{delete e[s]}),this.collection.splice(i,1)}return this.collection}async function Bt(t,n,i=!0){const e=it.call(this,t);return(e.state==="closed"||e.state==="indeterminate")&&(e.state="opening",n??e.getSetting("transition")?await mt(e.el,{start:e.getSetting("stateClosing"),finish:e.getSetting("stateClosed")},{start:e.getSetting("stateOpening"),finish:e.getSetting("stateOpened")},e.getSetting("transitionDuration")):(e.el.classList.add(e.getSetting("stateOpened")),e.el.classList.remove(e.getSetting("stateClosed"))),e.state="opened",e.mode==="modal"&&pt(!0,e.getSetting("selectorInert"),e.getSetting("selectorOverflow")),i&&ae.call(this,e),e.el.dispatchEvent(new CustomEvent(e.getSetting("customEventPrefix")+"opened",{detail:this,bubbles:!0}))),e}async function At(t,n,i=!0){const e=it.call(this,t);return(e.state==="opened"||e.state==="indeterminate")&&(e.state="closing",document.activeElement.blur(),n??e.getSetting("transition")?await mt(e.el,{start:e.getSetting("stateOpening"),finish:e.getSetting("stateOpened")},{start:e.getSetting("stateClosing"),finish:e.getSetting("stateClosed")},e.getSetting("transitionDuration")):(e.el.classList.add(e.getSetting("stateClosed")),e.el.classList.remove(e.getSetting("stateOpened"))),e.state="closed",e.mode==="modal"&&pt(!1,e.getSetting("selectorInert"),e.getSetting("selectorOverflow")),i&&ae.call(this,e),e.el.dispatchEvent(new CustomEvent(e.getSetting("customEventPrefix")+"closed",{detail:this,bubbles:!0}))),e}async function fe(t,n,i){const e=it.call(this,t);return e.state==="closed"?Bt.call(this,e,n,i):At.call(this,e,n,i)}function Ge(t){switch(t.mode){case"inline":return Je.call(this,t);case"modal":return Ue.call(this,t);default:throw new Error(`"${t.mode}" is not a valid drawer mode.`)}}async function Je(t){return t.el.classList.remove(t.getSetting("classModal")),t.dialog.removeAttribute("aria-modal"),pt(!1,t.getSetting("selectorInert"),t.getSetting("selectorOverflow")),this.focusTrap.unmount(),await We(t),t.el.dispatchEvent(new CustomEvent(t.getSetting("customEventPrefix")+"switchMode",{detail:this,bubbles:!0})),t}async function Ue(t){return t.el.classList.add(t.getSetting("classModal")),t.dialog.setAttribute("aria-modal","true"),await At.call(this,t,!1,!1),t.el.dispatchEvent(new CustomEvent(t.getSetting("customEventPrefix")+"switchMode",{detail:this,bubbles:!0})),t}async function Ze(t,n={}){await _t.call(this,t,!1);const i=this,e=new C;let s,o="indeterminate";const r=this.createEntry(t);Object.assign(r,{dialog:null,trigger:null,inlineState:"indeterminate",open(c,a){return Bt.call(i,this,c,a)},close(c,a){return At.call(i,this,c,a)},toggle(c,a){return fe.call(i,this,c,a)},deregister(){return _t.call(i,this)},mountBreakpoint(){const c=this.breakpoint,a=this.handleBreakpoint.bind(this);return e.mount(c,a),this},unmountBreakpoint(){return e.unmount(),this},handleBreakpoint(c){const a=c.matches?"inline":"modal";return this.mode!=a&&(this.mode=a),this}}),Object.defineProperties(r,Object.getOwnPropertyDescriptors({get breakpoint(){return Ke.call(i,t)},get store(){return i.store.get(this.id)},get mode(){return s},set mode(c){s=c,Ge.call(i,this)},get state(){return o},set state(c){o=c,this.mode==="inline"&&c!="opening"&&c!="closing"&&(this.inlineState=c,this.getSetting("store")&&i.store.set(this.id,c)),c==="indeterminate"&&(this.el.classList.remove(this.getSetting("stateOpened")),this.el.classList.remove(this.getSetting("stateOpening")),this.el.classList.remove(this.getSetting("stateClosed")),this.el.classList.remove(this.getSetting("stateClosing")))}})),r.applySettings(n),r.getDataConfig(),r.getSetting("teleport")&&r.teleport(),this.collection.push(r);const l=t.querySelector(r.getSetting("selectorDialog"));return r.dialog=l||t,r.getSetting("setTabindex")&&r.dialog.setAttribute("tabindex","-1"),ze(r),r.inlineState=r.state,r.mode=t.classList.contains(r.getSetting("classModal"))?"modal":"inline",r.breakpoint&&r.mountBreakpoint(),r}class Qe extends L{constructor(i){super({...He,...i});I(this,ct);I(this,at);this.focusTrap=new et,this.store=Ft(this.settings.storeKey,this.settings.store),$(this,ct,Xe.bind(this)),$(this,at,Ye.bind(this))}get activeModal(){return this.collection.find(i=>i.state==="opened"&&i.mode==="modal")}async mount(i=null){i&&(this.settings={...this.settings,...i});const e=document.querySelectorAll(this.settings.selectorDrawer);return await this.registerCollection(e),this.settings.eventListeners&&this.mountEventListeners(),this}async unmount(){return await this.deregisterCollection(),this.settings.eventListeners&&this.unmountEventListeners(),this}mountEventListeners(){document.addEventListener("click",S(this,ct),!1),document.addEventListener("keydown",S(this,at),!1)}unmountEventListeners(){document.removeEventListener("click",S(this,ct),!1),document.removeEventListener("keydown",S(this,at),!1)}register(i,e={}){let s=typeof i=="string"?document.getElementById(i):i;return s?Ze.call(this,s,e):Promise.reject(new Error(`Failed to register; drawer not found with ID of: "${i.id||i}".`))}deregister(i){let e=this.get(i.id||i);return e?_t.call(this,e):Promise.reject(new Error(`Failed to deregister; drawer does not exist in collection with ID of: "${i.id||i}".`))}open(i,e,s){return Bt.call(this,i,e,s)}close(i,e,s){return At.call(this,i,e,s)}toggle(i,e,s){return fe.call(this,i,e,s)}}ct=new WeakMap,at=new WeakMap;const qe={dataOpen:"modal-open",dataClose:"modal-close",dataReplace:"modal-replace",selectorModal:".modal",selectorDialog:".modal__dialog",selectorScreen:".modal",selectorRequired:'[role="alertdialog"]',selectorFocus:"[data-focus]",selectorInert:null,selectorOverflow:"body",stateOpened:"is-opened",stateOpening:"is-opening",stateClosing:"is-closing",stateClosed:"is-closed",customEventPrefix:"modal:",eventListeners:!0,setTabindex:!0,teleport:null,teleportMethod:"append",transition:!0,transitionDuration:"modal-transition-duration"};function wt(t){const n=typeof t=="string"?this.get(t):this.get(t.id);if(n)return n;throw new Error(`Modal not found in collection with id of "${t.id||t}".`)}function $t(){this.active?this.focusTrap.mount(this.active.dialog,this.settings.selectorFocus):(this.trigger&&(this.trigger.focus(),this.trigger=null),this.focusTrap.unmount())}async function ti(t){const n=t.target.closest(`
6
6
  [data-${this.settings.dataOpen}],
7
7
  [data-${this.settings.dataReplace}],
8
8
  [data-${this.settings.dataClose}]
9
- `);if(e){if(t.preventDefault(),e.matches(`[data-${this.settings.dataOpen}]`)){const i=e.getAttribute(`data-${this.settings.dataOpen}`).trim(),s=Ot.call(this,i);return t.target.closest(this.settings.selectorModal)||(this.trigger=e),s.open()}if(e.matches(`[data-${this.settings.dataReplace}]`)){const i=e.getAttribute(`data-${this.settings.dataReplace}`).trim(),s=Ot.call(this,i);return t.target.closest(this.settings.selectorModal)||(this.trigger=e),s.replace()}if(e.matches(`[data-${this.settings.dataClose}]`)){const i=e.getAttribute(`data-${this.settings.dataClose}`).trim();return i==="*"?this.closeAll():this.close(i)}}if(this.active&&t.target.matches(this.settings.selectorScreen)&&!this.active.required)return this.close(this.active.id)}function $i(t){if(t.key==="Escape"&&this.active&&!this.active.dialog.matches(this.settings.selectorRequired))return this.close()}async function Jt(t,e=!0){const i=this.collection.findIndex(s=>s.id===t.id);if(i>=0){const s=this.collection[i];e&&s.state==="opened"?await s.close(!1):this.stack.remove(s),s.getSetting("teleport")&&s.teleportReturn(),Object.getOwnPropertyNames(s).forEach(n=>{delete s[n]}),this.collection.splice(i,1)}return this.collection}async function Qt(t,e,i=!0){const s=Ot.call(this,t),n={...this.settings,...s.settings};return e!==void 0&&(n.transition=e),this.stack.moveToTop(s),s.state==="closed"&&(s.state="opening",this.stack.add(s),n.transition?await xt(s.el,{start:n.stateClosing,finish:n.stateClosed},{start:n.stateOpening,finish:n.stateOpened},n.transitionDuration):(s.el.classList.add(n.stateOpened),s.el.classList.remove(n.stateClosed)),s.state="opened"),i&&Rt.call(this),s.el.dispatchEvent(new CustomEvent(n.customEventPrefix+"opened",{detail:this,bubbles:!0})),s}async function Zt(t,e,i=!0){const s=t?Ot.call(this,t):this.active;if(s&&s.state==="opened"){s.state="closing";const n={...this.settings,...s.settings};e!==void 0&&(n.transition=e),document.activeElement.blur(),n.transition?await xt(s.el,{start:n.stateOpening,finish:n.stateOpened},{start:n.stateClosing,finish:n.stateClosed},n.transitionDuration):(s.el.classList.add(n.stateClosed),s.el.classList.remove(n.stateOpened)),this.stack.remove(s),s.state="closed",i&&Rt.call(this),s.el.dispatchEvent(new CustomEvent(n.customEventPrefix+"closed",{detail:this,bubbles:!0}))}return s}async function te(t,e){const i=[];return await Promise.all(this.stack.value.map(async s=>{t&&t===s.id?Promise.resolve():i.push(await Zt.call(this,s,e,!1)),s.trigger=null})),i}async function we(t,e,i=!0){const s=Ot.call(this,t);let n,r;return s.state==="opened"?(n=s,r=await te.call(this,s.id,e)):(r=te.call(this,!1,e),n=Qt.call(this,s,e,!1),await Promise.all([n,r])),i&&Rt.call(this),{opened:n,closed:r}}async function Li(t,e={}){await Jt.call(this,t,!1);const i=this,s={id:t.id,state:"closed",el:t,dialog:null,get required(){return this.dialog.matches(this.getSetting("selectorRequired"))},returnRef:null,settings:{...Xt(t,this.settings.dataConfig),...e},open(r,a){return Qt.call(i,this,r,a)},close(r,a){return Zt.call(i,this,r,a)},replace(r,a){return we.call(i,this,r,a)},deregister(){return Jt.call(i,this)},teleport(r=this.getSetting("teleport"),a=this.getSetting("teleportMethod")){return this.returnRef?(console.error("Element has already been teleported:",this.el),!1):(this.returnRef=qt(this.el,r,a),this.el)},teleportReturn(){return this.returnRef?(this.returnRef=qt(this.el,this.returnRef),this.el):(console.error("No return reference found:",this.el),!1)},getSetting(r){return r in this.settings?this.settings[r]:i.settings[r]}},n=t.querySelector(s.getSetting("selectorDialog"));return s.dialog=n||t,s.dialog.setAttribute("aria-modal","true"),s.dialog.hasAttribute("role")||s.dialog.setAttribute("role","dialog"),s.getSetting("setTabindex")&&s.dialog.setAttribute("tabindex","-1"),s.getSetting("teleport")&&s.teleport(),this.collection.push(s),s.el.classList.contains(this.settings.stateOpened)?await s.open(!1):(s.el.classList.remove(this.settings.stateOpening),s.el.classList.remove(this.settings.stateClosing),s.el.classList.add(this.settings.stateClosed)),s}function Ci(t){const e=[];return{get value(){return[...e]},get top(){return e[e.length-1]},updateIndex(){e.forEach((i,s)=>{i.el.style.zIndex=null;const n=getComputedStyle(i.el)["z-index"];i.el.style.zIndex=parseInt(n)+s+1})},updateGlobalState(){Et(this.top,t),this.updateIndex()},add(i){i.el.style.zIndex=null;const s=getComputedStyle(i.el)["z-index"];i.el.style.zIndex=parseInt(s)+e.length+1,e.push(i),this.updateGlobalState()},remove(i){const s=e.findIndex(n=>n.id===i.id);s>=0&&(i.el.style.zIndex=null,e.splice(s,1),this.updateGlobalState())},moveToTop(i){const s=e.findIndex(n=>n.id===i.id);s>=0&&(e.splice(s,1),this.add(i))}}}class ki extends P{constructor(i){super();q(this,vt);q(this,mt);this.defaults=Ei,this.settings={...this.defaults,...i},this.trigger=null,this.focusTrap=new at,this.stack=Ci(this.settings),N(this,vt,Oi.bind(this)),N(this,mt,$i.bind(this)),this.settings.autoMount&&this.mount()}get active(){return this.stack.top}async mount(i){i&&(this.settings={...this.settings,...i});const s=document.querySelectorAll(this.settings.selectorModal);return await this.registerCollection(s),this.settings.eventListeners&&this.mountEventListeners(),this}async unmount(){return this.trigger=null,await this.deregisterCollection(),this.settings.eventListeners&&this.unmountEventListeners(),this}mountEventListeners(){document.addEventListener("click",E(this,vt),!1),document.addEventListener("keydown",E(this,mt),!1)}unmountEventListeners(){document.removeEventListener("click",E(this,vt),!1),document.removeEventListener("keydown",E(this,mt),!1)}register(i,s={}){let n=typeof i=="string"?document.getElementById(i):i;return n?Li.call(this,n,s):Promise.reject(new Error(`Failed to register; modal not found with ID of: "${i.id||i}".`))}deregister(i){let s=this.get(i.id||i);return s?Jt.call(this,s):Promise.reject(new Error(`Failed to deregister; modal does not exist in collection with ID of: "${i.id||i}".`))}open(i,s,n){return Qt.call(this,i,s,n)}close(i,s,n){return Zt.call(this,i,s,n)}replace(i,s,n){return we.call(this,i,s,n)}async closeAll(i=!1,s,n=!0){const r=await te.call(this,i,s);return n&&Rt.call(this),r}}vt=new WeakMap,mt=new WeakMap;const Si={autoMount:!1,selectorPopover:".popover",selectorTooltip:".popover_tooltip",selectorArrow:".popover__arrow",stateActive:"is-active",eventListeners:!0,eventType:"click",placement:"bottom",hoverToggleDelay:0};function ye(t,e){const i=getComputedStyle(t),s={placement:e.placement,event:e.eventType,offset:0,"overflow-padding":0,"flip-padding":0,"arrow-element":e.selectorArrow,"arrow-padding":0,"toggle-delay":e.hoverToggleDelay};for(const n in s){const r=Mt(),a=i.getPropertyValue(`--${r}popover-${n}`).trim();a&&(s[n]=a)}return s}function ee(t){let e;const i=typeof t=="string"?t.trim().split(" "):[t];switch(i.forEach(function(s,n){i[n]=parseInt(s,10)}),i.length){case 1:e=i[0];break;case 2:e={top:i[0],right:i[1],bottom:i[0],left:i[1]};break;case 3:e={top:i[0],right:i[1],bottom:i[2],left:i[1]};break;case 4:e={top:i[0],right:i[1],bottom:i[2],left:i[3]};break;default:e=!1;break}return e}function xe(t){return[{name:"offset",options:{offset:[0,parseInt(t.offset,10)]}},{name:"preventOverflow",options:{padding:ee(t["overflow-padding"])}},{name:"flip",options:{padding:ee(t["flip-padding"])}},{name:"arrow",options:{element:t["arrow-element"],padding:ee(t["arrow-padding"])}}]}function Ee(t){const e=typeof t=="string"?this.get(t):this.get(t.id);if(e)return e;throw new Error(`Popover not found in collection with id of "${t}".`)}function Ai(t){return typeof t=="string"?t:typeof t.hasAttribute=="function"?t.closest(this.settings.selectorPopover)?(t=t.closest(this.settings.selectorPopover),t.id):t.hasAttribute("aria-controls")?t.getAttribute("aria-controls"):t.hasAttribute("aria-describedby")?t.getAttribute("aria-describedby"):!1:!1}function Ti(t){const e=Ai.call(this,t);if(e){const i=document.querySelector(`#${e}`),s=document.querySelector(`[aria-controls="${e}"]`)||document.querySelector(`[aria-describedby="${e}"]`);return!s&&!i?{error:new Error(`No popover elements found using the ID: "${e}".`)}:s?i?{popover:i,trigger:s}:{error:new Error(`No popover associated with the provided popover trigger: "${e}".`)}:{error:new Error(`No popover trigger associated with the provided popover: "${e}".`)}}else return{error:new Error("Could not resolve the popover ID.")}}async function ie(t){const e=t?Ee.call(this,t):await Oe.call(this);return e&&e.state==="opened"&&(e.el.inert=!0,e.el.classList.remove(this.settings.stateActive),e.isTooltip||e.trigger.setAttribute("aria-expanded","false"),e.popper.setOptions({placement:e.config.placement,modifiers:[{name:"eventListeners",enabled:!1},...xe(e.config)]}),e.state="closed",e.trigger===this.trigger&&(this.trigger=null)),e}async function Oe(){const t=[];return await Promise.all(this.collection.map(async e=>{e.state==="opened"&&t.push(await ie.call(this,e))})),t}function $e(t){t.state=="opened"&&setTimeout(()=>{const e=t.el.matches(":hover")===t.el||t.trigger.matches(":hover")===t.trigger;let i=document.activeElement.closest(`#${t.id}, [aria-controls="${t.id}"], [aria-describedby="${t.id}"]`);return i=i?i.matches(":focus-visible"):!1,!e&&!i&&t.close(),t},1)}function Pi(t){const e=t.trigger.getAttribute("aria-describedby");if(e){const i=this.get(e);i.isTooltip&&(i.toggleDelayId&&clearTimeout(i.toggleDelayId),i.close())}t.state==="opened"?t.close():(this.trigger=t.trigger,t.open(),Le.call(this,t))}function Di(t,e){if(e.type=="focus"&&!t.trigger.matches(":focus-visible"))return;const i=t.trigger.getAttribute("aria-expanded");if(i&&i=="true")return;t.toggleDelayId&&clearTimeout(t.toggleDelayId);const s=this.activeTooltip?0:t.config["toggle-delay"];this.activeTooltip&&this.activeTooltip.close(),t.toggleDelayId=setTimeout(()=>{t.id&&t.open()},s)}function Mi(t){t.toggleDelayId&&clearTimeout(t.toggleDelayId),t.toggleDelayId=setTimeout(()=>{$e.call(this,t)},t.config["toggle-delay"])}function Ii(t){switch(t.key){case"Escape":this.trigger&&this.trigger.focus(),Oe.call(this);return;case"Tab":this.collection.forEach(e=>{$e.call(this,e)});return;default:return}}function Le(t){const e=this;document.addEventListener("click",function i(s){s.target.closest(`#${t.id}, [aria-controls="${t.id}"], [aria-describedby="${t.id}"]`)?t.el&&!t.el.classList.contains(e.settings.stateActive)&&this.removeEventListener("click",i):(t.el&&t.el.classList.contains(e.settings.stateActive)&&t.close(),this.removeEventListener("click",i))})}var M="top",V="bottom",W="right",I="left",se="auto",$t=[M,V,W,I],ct="start",Lt="end",Ri="clippingParents",Ce="viewport",Ct="popper",Bi="reference",ke=$t.reduce(function(t,e){return t.concat([e+"-"+ct,e+"-"+Lt])},[]),Se=[].concat($t,[se]).reduce(function(t,e){return t.concat([e,e+"-"+ct,e+"-"+Lt])},[]),ji="beforeRead",Fi="read",Ni="afterRead",Vi="beforeMain",Wi="main",Hi="afterMain",_i="beforeWrite",zi="write",Ki="afterWrite",Xi=[ji,Fi,Ni,Vi,Wi,Hi,_i,zi,Ki];function X(t){return t?(t.nodeName||"").toLowerCase():null}function j(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Q(t){var e=j(t).Element;return t instanceof e||t instanceof Element}function H(t){var e=j(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function ne(t){if(typeof ShadowRoot>"u")return!1;var e=j(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Yi(t){var e=t.state;Object.keys(e.elements).forEach(function(i){var s=e.styles[i]||{},n=e.attributes[i]||{},r=e.elements[i];!H(r)||!X(r)||(Object.assign(r.style,s),Object.keys(n).forEach(function(a){var l=n[a];l===!1?r.removeAttribute(a):r.setAttribute(a,l===!0?"":l)}))})}function qi(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach(function(s){var n=e.elements[s],r=e.attributes[s]||{},a=Object.keys(e.styles.hasOwnProperty(s)?e.styles[s]:i[s]),l=a.reduce(function(o,f){return o[f]="",o},{});!H(n)||!X(n)||(Object.assign(n.style,l),Object.keys(r).forEach(function(o){n.removeAttribute(o)}))})}}const Ui={name:"applyStyles",enabled:!0,phase:"write",fn:Yi,effect:qi,requires:["computeStyles"]};function Y(t){return t.split("-")[0]}var Z=Math.max,Bt=Math.min,ft=Math.round;function re(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Ae(){return!/^((?!chrome|android).)*safari/i.test(re())}function ut(t,e,i){e===void 0&&(e=!1),i===void 0&&(i=!1);var s=t.getBoundingClientRect(),n=1,r=1;e&&H(t)&&(n=t.offsetWidth>0&&ft(s.width)/t.offsetWidth||1,r=t.offsetHeight>0&&ft(s.height)/t.offsetHeight||1);var a=Q(t)?j(t):window,l=a.visualViewport,o=!Ae()&&i,f=(s.left+(o&&l?l.offsetLeft:0))/n,c=(s.top+(o&&l?l.offsetTop:0))/r,g=s.width/n,b=s.height/r;return{width:g,height:b,top:c,right:f+g,bottom:c+b,left:f,x:f,y:c}}function oe(t){var e=ut(t),i=t.offsetWidth,s=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-s)<=1&&(s=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:s}}function Te(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&ne(i)){var s=e;do{if(s&&t.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function U(t){return j(t).getComputedStyle(t)}function Gi(t){return["table","td","th"].indexOf(X(t))>=0}function G(t){return((Q(t)?t.ownerDocument:t.document)||window.document).documentElement}function jt(t){return X(t)==="html"?t:t.assignedSlot||t.parentNode||(ne(t)?t.host:null)||G(t)}function Pe(t){return!H(t)||U(t).position==="fixed"?null:t.offsetParent}function Ji(t){var e=/firefox/i.test(re()),i=/Trident/i.test(re());if(i&&H(t)){var s=U(t);if(s.position==="fixed")return null}var n=jt(t);for(ne(n)&&(n=n.host);H(n)&&["html","body"].indexOf(X(n))<0;){var r=U(n);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||e&&r.willChange==="filter"||e&&r.filter&&r.filter!=="none")return n;n=n.parentNode}return null}function kt(t){for(var e=j(t),i=Pe(t);i&&Gi(i)&&U(i).position==="static";)i=Pe(i);return i&&(X(i)==="html"||X(i)==="body"&&U(i).position==="static")?e:i||Ji(t)||e}function ae(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function St(t,e,i){return Z(t,Bt(e,i))}function Qi(t,e,i){var s=St(t,e,i);return s>i?i:s}function De(){return{top:0,right:0,bottom:0,left:0}}function Me(t){return Object.assign({},De(),t)}function Ie(t,e){return e.reduce(function(i,s){return i[s]=t,i},{})}var Zi=function(e,i){return e=typeof e=="function"?e(Object.assign({},i.rects,{placement:i.placement})):e,Me(typeof e!="number"?e:Ie(e,$t))};function ts(t){var e,i=t.state,s=t.name,n=t.options,r=i.elements.arrow,a=i.modifiersData.popperOffsets,l=Y(i.placement),o=ae(l),f=[I,W].indexOf(l)>=0,c=f?"height":"width";if(!(!r||!a)){var g=Zi(n.padding,i),b=oe(r),u=o==="y"?M:I,x=o==="y"?V:W,p=i.rects.reference[c]+i.rects.reference[o]-a[o]-i.rects.popper[c],h=a[o]-i.rects.reference[o],y=kt(r),$=y?o==="y"?y.clientHeight||0:y.clientWidth||0:0,L=p/2-h/2,d=g[u],v=$-b[c]-g[x],m=$/2-b[c]/2+L,O=St(d,m,v),A=o;i.modifiersData[s]=(e={},e[A]=O,e.centerOffset=O-m,e)}}function es(t){var e=t.state,i=t.options,s=i.element,n=s===void 0?"[data-popper-arrow]":s;n!=null&&(typeof n=="string"&&(n=e.elements.popper.querySelector(n),!n)||Te(e.elements.popper,n)&&(e.elements.arrow=n))}const is={name:"arrow",enabled:!0,phase:"main",fn:ts,effect:es,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function dt(t){return t.split("-")[1]}var ss={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ns(t,e){var i=t.x,s=t.y,n=e.devicePixelRatio||1;return{x:ft(i*n)/n||0,y:ft(s*n)/n||0}}function Re(t){var e,i=t.popper,s=t.popperRect,n=t.placement,r=t.variation,a=t.offsets,l=t.position,o=t.gpuAcceleration,f=t.adaptive,c=t.roundOffsets,g=t.isFixed,b=a.x,u=b===void 0?0:b,x=a.y,p=x===void 0?0:x,h=typeof c=="function"?c({x:u,y:p}):{x:u,y:p};u=h.x,p=h.y;var y=a.hasOwnProperty("x"),$=a.hasOwnProperty("y"),L=I,d=M,v=window;if(f){var m=kt(i),O="clientHeight",A="clientWidth";if(m===j(i)&&(m=G(i),U(m).position!=="static"&&l==="absolute"&&(O="scrollHeight",A="scrollWidth")),m=m,n===M||(n===I||n===W)&&r===Lt){d=V;var S=g&&m===v&&v.visualViewport?v.visualViewport.height:m[O];p-=S-s.height,p*=o?1:-1}if(n===I||(n===M||n===V)&&r===Lt){L=W;var k=g&&m===v&&v.visualViewport?v.visualViewport.width:m[A];u-=k-s.width,u*=o?1:-1}}var T=Object.assign({position:l},f&&ss),z=c===!0?ns({x:u,y:p},j(i)):{x:u,y:p};if(u=z.x,p=z.y,o){var D;return Object.assign({},T,(D={},D[d]=$?"0":"",D[L]=y?"0":"",D.transform=(v.devicePixelRatio||1)<=1?"translate("+u+"px, "+p+"px)":"translate3d("+u+"px, "+p+"px, 0)",D))}return Object.assign({},T,(e={},e[d]=$?p+"px":"",e[L]=y?u+"px":"",e.transform="",e))}function rs(t){var e=t.state,i=t.options,s=i.gpuAcceleration,n=s===void 0?!0:s,r=i.adaptive,a=r===void 0?!0:r,l=i.roundOffsets,o=l===void 0?!0:l,f={placement:Y(e.placement),variation:dt(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:n,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Re(Object.assign({},f,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:o})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Re(Object.assign({},f,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:o})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const os={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:rs,data:{}};var Ft={passive:!0};function as(t){var e=t.state,i=t.instance,s=t.options,n=s.scroll,r=n===void 0?!0:n,a=s.resize,l=a===void 0?!0:a,o=j(e.elements.popper),f=[].concat(e.scrollParents.reference,e.scrollParents.popper);return r&&f.forEach(function(c){c.addEventListener("scroll",i.update,Ft)}),l&&o.addEventListener("resize",i.update,Ft),function(){r&&f.forEach(function(c){c.removeEventListener("scroll",i.update,Ft)}),l&&o.removeEventListener("resize",i.update,Ft)}}const ls={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:as,data:{}};var cs={left:"right",right:"left",bottom:"top",top:"bottom"};function Nt(t){return t.replace(/left|right|bottom|top/g,function(e){return cs[e]})}var fs={start:"end",end:"start"};function Be(t){return t.replace(/start|end/g,function(e){return fs[e]})}function le(t){var e=j(t),i=e.pageXOffset,s=e.pageYOffset;return{scrollLeft:i,scrollTop:s}}function ce(t){return ut(G(t)).left+le(t).scrollLeft}function us(t,e){var i=j(t),s=G(t),n=i.visualViewport,r=s.clientWidth,a=s.clientHeight,l=0,o=0;if(n){r=n.width,a=n.height;var f=Ae();(f||!f&&e==="fixed")&&(l=n.offsetLeft,o=n.offsetTop)}return{width:r,height:a,x:l+ce(t),y:o}}function ds(t){var e,i=G(t),s=le(t),n=(e=t.ownerDocument)==null?void 0:e.body,r=Z(i.scrollWidth,i.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),a=Z(i.scrollHeight,i.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),l=-s.scrollLeft+ce(t),o=-s.scrollTop;return U(n||i).direction==="rtl"&&(l+=Z(i.clientWidth,n?n.clientWidth:0)-r),{width:r,height:a,x:l,y:o}}function fe(t){var e=U(t),i=e.overflow,s=e.overflowX,n=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+n+s)}function je(t){return["html","body","#document"].indexOf(X(t))>=0?t.ownerDocument.body:H(t)&&fe(t)?t:je(jt(t))}function At(t,e){var i;e===void 0&&(e=[]);var s=je(t),n=s===((i=t.ownerDocument)==null?void 0:i.body),r=j(s),a=n?[r].concat(r.visualViewport||[],fe(s)?s:[]):s,l=e.concat(a);return n?l:l.concat(At(jt(a)))}function ue(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function hs(t,e){var i=ut(t,!1,e==="fixed");return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}function Fe(t,e,i){return e===Ce?ue(us(t,i)):Q(e)?hs(e,i):ue(ds(G(t)))}function ps(t){var e=At(jt(t)),i=["absolute","fixed"].indexOf(U(t).position)>=0,s=i&&H(t)?kt(t):t;return Q(s)?e.filter(function(n){return Q(n)&&Te(n,s)&&X(n)!=="body"}):[]}function gs(t,e,i,s){var n=e==="clippingParents"?ps(t):[].concat(e),r=[].concat(n,[i]),a=r[0],l=r.reduce(function(o,f){var c=Fe(t,f,s);return o.top=Z(c.top,o.top),o.right=Bt(c.right,o.right),o.bottom=Bt(c.bottom,o.bottom),o.left=Z(c.left,o.left),o},Fe(t,a,s));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function Ne(t){var e=t.reference,i=t.element,s=t.placement,n=s?Y(s):null,r=s?dt(s):null,a=e.x+e.width/2-i.width/2,l=e.y+e.height/2-i.height/2,o;switch(n){case M:o={x:a,y:e.y-i.height};break;case V:o={x:a,y:e.y+e.height};break;case W:o={x:e.x+e.width,y:l};break;case I:o={x:e.x-i.width,y:l};break;default:o={x:e.x,y:e.y}}var f=n?ae(n):null;if(f!=null){var c=f==="y"?"height":"width";switch(r){case ct:o[f]=o[f]-(e[c]/2-i[c]/2);break;case Lt:o[f]=o[f]+(e[c]/2-i[c]/2);break}}return o}function Tt(t,e){e===void 0&&(e={});var i=e,s=i.placement,n=s===void 0?t.placement:s,r=i.strategy,a=r===void 0?t.strategy:r,l=i.boundary,o=l===void 0?Ri:l,f=i.rootBoundary,c=f===void 0?Ce:f,g=i.elementContext,b=g===void 0?Ct:g,u=i.altBoundary,x=u===void 0?!1:u,p=i.padding,h=p===void 0?0:p,y=Me(typeof h!="number"?h:Ie(h,$t)),$=b===Ct?Bi:Ct,L=t.rects.popper,d=t.elements[x?$:b],v=gs(Q(d)?d:d.contextElement||G(t.elements.popper),o,c,a),m=ut(t.elements.reference),O=Ne({reference:m,element:L,strategy:"absolute",placement:n}),A=ue(Object.assign({},L,O)),S=b===Ct?A:m,k={top:v.top-S.top+y.top,bottom:S.bottom-v.bottom+y.bottom,left:v.left-S.left+y.left,right:S.right-v.right+y.right},T=t.modifiersData.offset;if(b===Ct&&T){var z=T[n];Object.keys(k).forEach(function(D){var it=[W,V].indexOf(D)>=0?1:-1,st=[M,V].indexOf(D)>=0?"y":"x";k[D]+=z[st]*it})}return k}function vs(t,e){e===void 0&&(e={});var i=e,s=i.placement,n=i.boundary,r=i.rootBoundary,a=i.padding,l=i.flipVariations,o=i.allowedAutoPlacements,f=o===void 0?Se:o,c=dt(s),g=c?l?ke:ke.filter(function(x){return dt(x)===c}):$t,b=g.filter(function(x){return f.indexOf(x)>=0});b.length===0&&(b=g);var u=b.reduce(function(x,p){return x[p]=Tt(t,{placement:p,boundary:n,rootBoundary:r,padding:a})[Y(p)],x},{});return Object.keys(u).sort(function(x,p){return u[x]-u[p]})}function ms(t){if(Y(t)===se)return[];var e=Nt(t);return[Be(t),e,Be(e)]}function bs(t){var e=t.state,i=t.options,s=t.name;if(!e.modifiersData[s]._skip){for(var n=i.mainAxis,r=n===void 0?!0:n,a=i.altAxis,l=a===void 0?!0:a,o=i.fallbackPlacements,f=i.padding,c=i.boundary,g=i.rootBoundary,b=i.altBoundary,u=i.flipVariations,x=u===void 0?!0:u,p=i.allowedAutoPlacements,h=e.options.placement,y=Y(h),$=y===h,L=o||($||!x?[Nt(h)]:ms(h)),d=[h].concat(L).reduce(function(wt,J){return wt.concat(Y(J)===se?vs(e,{placement:J,boundary:c,rootBoundary:g,padding:f,flipVariations:x,allowedAutoPlacements:p}):J)},[]),v=e.rects.reference,m=e.rects.popper,O=new Map,A=!0,S=d[0],k=0;k<d.length;k++){var T=d[k],z=Y(T),D=dt(T)===ct,it=[M,V].indexOf(z)>=0,st=it?"width":"height",F=Tt(e,{placement:T,boundary:c,rootBoundary:g,altBoundary:b,padding:f}),K=it?D?W:I:D?V:M;v[st]>m[st]&&(K=Nt(K));var Vt=Nt(K),nt=[];if(r&&nt.push(F[z]<=0),l&&nt.push(F[K]<=0,F[Vt]<=0),nt.every(function(wt){return wt})){S=T,A=!1;break}O.set(T,nt)}if(A)for(var Wt=x?3:1,he=function(J){var Dt=d.find(function(_t){var rt=O.get(_t);if(rt)return rt.slice(0,J).every(function(pe){return pe})});if(Dt)return S=Dt,"break"},Pt=Wt;Pt>0;Pt--){var Ht=he(Pt);if(Ht==="break")break}e.placement!==S&&(e.modifiersData[s]._skip=!0,e.placement=S,e.reset=!0)}}const ws={name:"flip",enabled:!0,phase:"main",fn:bs,requiresIfExists:["offset"],data:{_skip:!1}};function Ve(t,e,i){return i===void 0&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function We(t){return[M,W,V,I].some(function(e){return t[e]>=0})}function ys(t){var e=t.state,i=t.name,s=e.rects.reference,n=e.rects.popper,r=e.modifiersData.preventOverflow,a=Tt(e,{elementContext:"reference"}),l=Tt(e,{altBoundary:!0}),o=Ve(a,s),f=Ve(l,n,r),c=We(o),g=We(f);e.modifiersData[i]={referenceClippingOffsets:o,popperEscapeOffsets:f,isReferenceHidden:c,hasPopperEscaped:g},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":g})}const xs={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:ys};function Es(t,e,i){var s=Y(t),n=[I,M].indexOf(s)>=0?-1:1,r=typeof i=="function"?i(Object.assign({},e,{placement:t})):i,a=r[0],l=r[1];return a=a||0,l=(l||0)*n,[I,W].indexOf(s)>=0?{x:l,y:a}:{x:a,y:l}}function Os(t){var e=t.state,i=t.options,s=t.name,n=i.offset,r=n===void 0?[0,0]:n,a=Se.reduce(function(c,g){return c[g]=Es(g,e.rects,r),c},{}),l=a[e.placement],o=l.x,f=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=o,e.modifiersData.popperOffsets.y+=f),e.modifiersData[s]=a}const $s={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Os};function Ls(t){var e=t.state,i=t.name;e.modifiersData[i]=Ne({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const Cs={name:"popperOffsets",enabled:!0,phase:"read",fn:Ls,data:{}};function ks(t){return t==="x"?"y":"x"}function Ss(t){var e=t.state,i=t.options,s=t.name,n=i.mainAxis,r=n===void 0?!0:n,a=i.altAxis,l=a===void 0?!1:a,o=i.boundary,f=i.rootBoundary,c=i.altBoundary,g=i.padding,b=i.tether,u=b===void 0?!0:b,x=i.tetherOffset,p=x===void 0?0:x,h=Tt(e,{boundary:o,rootBoundary:f,padding:g,altBoundary:c}),y=Y(e.placement),$=dt(e.placement),L=!$,d=ae(y),v=ks(d),m=e.modifiersData.popperOffsets,O=e.rects.reference,A=e.rects.popper,S=typeof p=="function"?p(Object.assign({},e.rects,{placement:e.placement})):p,k=typeof S=="number"?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),T=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,z={x:0,y:0};if(m){if(r){var D,it=d==="y"?M:I,st=d==="y"?V:W,F=d==="y"?"height":"width",K=m[d],Vt=K+h[it],nt=K-h[st],Wt=u?-A[F]/2:0,he=$===ct?O[F]:A[F],Pt=$===ct?-A[F]:-O[F],Ht=e.elements.arrow,wt=u&&Ht?oe(Ht):{width:0,height:0},J=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:De(),Dt=J[it],_t=J[st],rt=St(0,O[F],wt[F]),pe=L?O[F]/2-Wt-rt-Dt-k.mainAxis:he-rt-Dt-k.mainAxis,_s=L?-O[F]/2+Wt+rt+_t+k.mainAxis:Pt+rt+_t+k.mainAxis,ge=e.elements.arrow&&kt(e.elements.arrow),zs=ge?d==="y"?ge.clientTop||0:ge.clientLeft||0:0,Ye=(D=T==null?void 0:T[d])!=null?D:0,Ks=K+pe-Ye-zs,Xs=K+_s-Ye,qe=St(u?Bt(Vt,Ks):Vt,K,u?Z(nt,Xs):nt);m[d]=qe,z[d]=qe-K}if(l){var Ue,Ys=d==="x"?M:I,qs=d==="x"?V:W,ot=m[v],zt=v==="y"?"height":"width",Ge=ot+h[Ys],Je=ot-h[qs],ve=[M,I].indexOf(y)!==-1,Qe=(Ue=T==null?void 0:T[v])!=null?Ue:0,Ze=ve?Ge:ot-O[zt]-A[zt]-Qe+k.altAxis,ti=ve?ot+O[zt]+A[zt]-Qe-k.altAxis:Je,ei=u&&ve?Qi(Ze,ot,ti):St(u?Ze:Ge,ot,u?ti:Je);m[v]=ei,z[v]=ei-ot}e.modifiersData[s]=z}}const As={name:"preventOverflow",enabled:!0,phase:"main",fn:Ss,requiresIfExists:["offset"]};function Ts(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Ps(t){return t===j(t)||!H(t)?le(t):Ts(t)}function Ds(t){var e=t.getBoundingClientRect(),i=ft(e.width)/t.offsetWidth||1,s=ft(e.height)/t.offsetHeight||1;return i!==1||s!==1}function Ms(t,e,i){i===void 0&&(i=!1);var s=H(e),n=H(e)&&Ds(e),r=G(e),a=ut(t,n,i),l={scrollLeft:0,scrollTop:0},o={x:0,y:0};return(s||!s&&!i)&&((X(e)!=="body"||fe(r))&&(l=Ps(e)),H(e)?(o=ut(e,!0),o.x+=e.clientLeft,o.y+=e.clientTop):r&&(o.x=ce(r))),{x:a.left+l.scrollLeft-o.x,y:a.top+l.scrollTop-o.y,width:a.width,height:a.height}}function Is(t){var e=new Map,i=new Set,s=[];t.forEach(function(r){e.set(r.name,r)});function n(r){i.add(r.name);var a=[].concat(r.requires||[],r.requiresIfExists||[]);a.forEach(function(l){if(!i.has(l)){var o=e.get(l);o&&n(o)}}),s.push(r)}return t.forEach(function(r){i.has(r.name)||n(r)}),s}function Rs(t){var e=Is(t);return Xi.reduce(function(i,s){return i.concat(e.filter(function(n){return n.phase===s}))},[])}function Bs(t){var e;return function(){return e||(e=new Promise(function(i){Promise.resolve().then(function(){e=void 0,i(t())})})),e}}function js(t){var e=t.reduce(function(i,s){var n=i[s.name];return i[s.name]=n?Object.assign({},n,s,{options:Object.assign({},n.options,s.options),data:Object.assign({},n.data,s.data)}):s,i},{});return Object.keys(e).map(function(i){return e[i]})}var He={placement:"bottom",modifiers:[],strategy:"absolute"};function _e(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return!e.some(function(s){return!(s&&typeof s.getBoundingClientRect=="function")})}function Fs(t){t===void 0&&(t={});var e=t,i=e.defaultModifiers,s=i===void 0?[]:i,n=e.defaultOptions,r=n===void 0?He:n;return function(l,o,f){f===void 0&&(f=r);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},He,r),modifiersData:{},elements:{reference:l,popper:o},attributes:{},styles:{}},g=[],b=!1,u={state:c,setOptions:function(y){var $=typeof y=="function"?y(c.options):y;p(),c.options=Object.assign({},r,c.options,$),c.scrollParents={reference:Q(l)?At(l):l.contextElement?At(l.contextElement):[],popper:At(o)};var L=Rs(js([].concat(s,c.options.modifiers)));return c.orderedModifiers=L.filter(function(d){return d.enabled}),x(),u.update()},forceUpdate:function(){if(!b){var y=c.elements,$=y.reference,L=y.popper;if(_e($,L)){c.rects={reference:Ms($,kt(L),c.options.strategy==="fixed"),popper:oe(L)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(k){return c.modifiersData[k.name]=Object.assign({},k.data)});for(var d=0;d<c.orderedModifiers.length;d++){if(c.reset===!0){c.reset=!1,d=-1;continue}var v=c.orderedModifiers[d],m=v.fn,O=v.options,A=O===void 0?{}:O,S=v.name;typeof m=="function"&&(c=m({state:c,options:A,name:S,instance:u})||c)}}}},update:Bs(function(){return new Promise(function(h){u.forceUpdate(),h(c)})}),destroy:function(){p(),b=!0}};if(!_e(l,o))return u;u.setOptions(f).then(function(h){!b&&f.onFirstUpdate&&f.onFirstUpdate(h)});function x(){c.orderedModifiers.forEach(function(h){var y=h.name,$=h.options,L=$===void 0?{}:$,d=h.effect;if(typeof d=="function"){var v=d({state:c,name:y,instance:u,options:L}),m=function(){};g.push(v||m)}})}function p(){g.forEach(function(h){return h()}),g=[]}return u}}var Ns=[ls,Cs,os,Ui,$s,ws,As,is,xs],Vs=Fs({defaultModifiers:Ns});async function de(t){const e=this.collection.findIndex(i=>i.id===t.id);if(e>=0){const i=this.collection[e];i.state==="opened"&&i.close(),i.popper.destroy(),ze(i),Object.getOwnPropertyNames(i).forEach(s=>{delete i[s]}),this.collection.splice(e,1)}return this.collection}function ze(t){return t.__eventListeners&&(t.__eventListeners.forEach(e=>{e.el.forEach(i=>{e.type.forEach(s=>{t[i].removeEventListener(s,e.listener,!1)})})}),delete t.__eventListeners),t}async function Ke(t){const e=Ee.call(this,t);return e.el.inert=!1,e.el.classList.add(this.settings.stateActive),e.isTooltip||e.trigger.setAttribute("aria-expanded","true"),e.config=ye(e.el,this.settings),e.popper.setOptions({placement:e.config.placement,modifiers:[{name:"eventListeners",enabled:!0},...xe(e.config)]}),e.popper.update(),e.state="opened",e}async function Ws(t,e){de.call(this,t);const i=this,s={id:t.id,state:"closed",el:t,trigger:e,toggleDelayId:null,popper:Vs(e,t),config:ye(t,this.settings),get isTooltip(){return!!t.closest(i.settings.selectorTooltip)||t.getAttribute("role")=="tooltip"},open(){return Ke.call(i,this)},close(){return ie.call(i,this)},deregister(){return de.call(i,this)}};return s.isTooltip&&s.el.setAttribute("role","tooltip"),s.isTooltip||s.trigger.setAttribute("aria-expanded","false"),Xe.call(this,s),this.collection.push(s),s.el.classList.contains(this.settings.stateActive)?(await s.open(),Le.call(this,s)):s.el.inert=!0,s.popper.setOptions({placement:s.config.placement}),s}function Xe(t){return t.__eventListeners||((t.isTooltip?"hover":t.config.event)==="hover"?(t.__eventListeners=[{el:["trigger"],type:["mouseenter","focus"],listener:Di.bind(this,t)},{el:["el","trigger"],type:["mouseleave","focusout"],listener:Mi.bind(this,t)}],t.__eventListeners.forEach(i=>{i.el.forEach(s=>{i.type.forEach(n=>{t[s].addEventListener(n,i.listener,!1)})})})):(t.__eventListeners=[{el:["trigger"],type:["click"],listener:Pi.bind(this,t)}],t.__eventListeners.forEach(i=>{i.el.forEach(s=>{i.type.forEach(n=>{t[s].addEventListener(n,i.listener,!1)})})}))),t}class Hs extends P{constructor(i){super();q(this,bt);this.defaults=Si,this.settings={...this.defaults,...i},this.trigger=null,N(this,bt,Ii.bind(this)),this.settings.autoMount&&this.mount()}get active(){return this.collection.find(i=>i.state=="opened")}get activeTooltip(){return this.collection.find(i=>i.state=="opened"&&i.isTooltip)}async mount(i){i&&(this.settings={...this.settings,...i});const s=document.querySelectorAll(this.settings.selectorPopover);return await this.registerCollection(s),this.settings.eventListeners&&this.mountEventListeners(!1),this}async unmount(){return this.trigger=null,await this.deregisterCollection(),this.settings.eventListeners&&this.unmountEventListeners(!1),this}mountEventListeners(i=!0){i&&this.collection.forEach(s=>{Xe.call(this,s)}),document.addEventListener("keydown",E(this,bt),!1)}unmountEventListeners(i=!0){i&&this.collection.forEach(s=>{ze(s)}),document.removeEventListener("keydown",E(this,bt),!1)}register(i){const s=Ti.call(this,i);return s.error?Promise.reject(s.error):Ws.call(this,s.popover,s.trigger)}deregister(i){let s=this.get(i.id||i);return s?de.call(this,s):Promise.reject(new Error(`Failed to deregister; popover does not exist in collection with ID of: "${i.id||i}".`))}open(i){return Ke.call(this,i)}close(i){return ie.call(this,i)}}bt=new WeakMap,w.Drawer=xi,w.Modal=ki,w.Popover=Hs,w.core=fi,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})});
9
+ `);if(n){if(t.preventDefault(),n.matches(`[data-${this.settings.dataOpen}]`)){const i=n.getAttribute(`data-${this.settings.dataOpen}`).trim(),e=wt.call(this,i);return t.target.closest(this.settings.selectorModal)||(this.trigger=n),e.open()}if(n.matches(`[data-${this.settings.dataReplace}]`)){const i=n.getAttribute(`data-${this.settings.dataReplace}`).trim(),e=wt.call(this,i);return t.target.closest(this.settings.selectorModal)||(this.trigger=n),e.replace()}if(n.matches(`[data-${this.settings.dataClose}]`)){const i=n.getAttribute(`data-${this.settings.dataClose}`).trim();return i==="*"?this.closeAll():this.close(i)}}if(this.active&&t.target.matches(this.settings.selectorScreen)&&!this.active.isRequired)return this.close(this.active.id)}function ei(t){if(t.key==="Escape"&&this.active&&!this.active.dialog.matches(this.settings.selectorRequired))return this.close()}async function Vt(t,n=!0){const i=this.collection.findIndex(e=>e.id===t.id);if(i>=0){const e=this.collection[i];n&&e.state==="opened"?await e.close(!1):this.stack.remove(e),e.getSetting("teleport")&&e.teleportReturn(),Object.getOwnPropertyNames(e).forEach(s=>{delete e[s]}),this.collection.splice(i,1)}return this.collection}async function jt(t,n=void 0,i=!0){const e=wt.call(this,t);return this.stack.moveToTop(e),e.state==="closed"&&(e.state="opening",this.stack.add(e),n??e.getSetting("transition")?await mt(e.el,{start:e.getSetting("stateClosing"),finish:e.getSetting("stateClosed")},{start:e.getSetting("stateOpening"),finish:e.getSetting("stateOpened")},e.getSetting("transitionDuration")):(e.el.classList.add(e.getSetting("stateOpened")),e.el.classList.remove(e.getSetting("stateClosed"))),e.state="opened"),i&&$t.call(this),e.el.dispatchEvent(new CustomEvent(e.getSetting("customEventPrefix")+"opened",{detail:this,bubbles:!0})),e}async function Ht(t,n,i=!0){const e=t?wt.call(this,t):this.active;return e&&e.state==="opened"&&(e.state="closing",document.activeElement.blur(),n??e.getSetting("transition")?await mt(e.el,{start:e.getSetting("stateOpening"),finish:e.getSetting("stateOpened")},{start:e.getSetting("stateClosing"),finish:e.getSetting("stateClosed")},e.getSetting("transitionDuration")):(e.el.classList.add(e.getSetting("stateClosed")),e.el.classList.remove(e.getSetting("stateOpened"))),this.stack.remove(e),e.state="closed",i&&$t.call(this),e.el.dispatchEvent(new CustomEvent(e.getSetting("customEventPrefix")+"closed",{detail:this,bubbles:!0}))),e}async function zt(t,n){const i=[];return await Promise.all(this.stack.value.map(async e=>{t&&t===e.id?Promise.resolve():i.push(await Ht.call(this,e,n,!1)),e.trigger=null})),i}async function ue(t,n,i=!0){const e=wt.call(this,t);let s,o;return e.state==="opened"?(s=e,o=await zt.call(this,e.id,n)):(o=zt.call(this,!1,n),s=jt.call(this,e,n,!1),await Promise.all([s,o])),i&&$t.call(this),{opened:s,closed:o}}async function ii(t,n={}){await Vt.call(this,t,!1);const i=this,e=this.createEntry(t);Object.assign(e,{state:"closed",dialog:null,open(o,r){return jt.call(i,this,o,r)},close(o,r){return Ht.call(i,this,o,r)},replace(o,r){return ue.call(i,this,o,r)},deregister(){return Vt.call(i,this)}}),Object.defineProperties(e,Object.getOwnPropertyDescriptors({get isRequired(){return this.dialog.matches(this.getSetting("selectorRequired"))}})),e.applySettings(n),e.getDataConfig();const s=t.querySelector(e.getSetting("selectorDialog"));return e.dialog=s||t,e.dialog.setAttribute("aria-modal","true"),e.dialog.hasAttribute("role")||e.dialog.setAttribute("role","dialog"),e.getSetting("setTabindex")&&e.dialog.setAttribute("tabindex","-1"),e.getSetting("teleport")&&e.teleport(),this.collection.push(e),e.el.classList.contains(e.getSetting("stateOpened"))?await e.open(!1):(e.el.classList.remove(e.getSetting("stateOpening")),e.el.classList.remove(e.getSetting("stateClosing")),e.el.classList.add(e.getSetting("stateClosed"))),e}function ni(t){const n=[];return{get value(){return[...n]},get top(){const i=n[n.length-1];return i||null},updateIndex(){n.forEach((i,e)=>{i.el.style.zIndex=null;const s=getComputedStyle(i.el)["z-index"];i.el.style.zIndex=parseInt(s)+e+1})},updateGlobalState(){pt(this.top,t.selectorInert,t.selectorOverflow),this.updateIndex()},add(i){i.el.style.zIndex=null;const e=getComputedStyle(i.el)["z-index"];i.el.style.zIndex=parseInt(e)+n.length+1,n.push(i),this.updateGlobalState()},remove(i){const e=n.findIndex(s=>s.id===i.id);e>=0&&(i.el.style.zIndex=null,n.splice(e,1),this.updateGlobalState())},moveToTop(i){const e=n.findIndex(s=>s.id===i.id);e>=0&&(n.splice(e,1),this.add(i))}}}class si extends L{constructor(i){super({...qe,...i});I(this,ft);I(this,ut);this.trigger=null,this.focusTrap=new et,this.stack=ni(this.settings),$(this,ft,ti.bind(this)),$(this,ut,ei.bind(this))}get active(){return this.stack.top}async mount(i){i&&(this.settings={...this.settings,...i});const e=document.querySelectorAll(this.settings.selectorModal);return await this.registerCollection(e),this.settings.eventListeners&&this.mountEventListeners(),this}async unmount(){return this.trigger=null,await this.deregisterCollection(),this.settings.eventListeners&&this.unmountEventListeners(),this}mountEventListeners(){document.addEventListener("click",S(this,ft),!1),document.addEventListener("keydown",S(this,ut),!1)}unmountEventListeners(){document.removeEventListener("click",S(this,ft),!1),document.removeEventListener("keydown",S(this,ut),!1)}register(i,e={}){let s=typeof i=="string"?document.getElementById(i):i;return s?ii.call(this,s,e):Promise.reject(new Error(`Failed to register; modal not found with ID of: "${i.id||i}".`))}deregister(i){let e=this.get(i.id||i);return e?Vt.call(this,e):Promise.reject(new Error(`Failed to deregister; modal does not exist in collection with ID of: "${i.id||i}".`))}open(i,e,s){return jt.call(this,i,e,s)}close(i,e,s){return Ht.call(this,i,e,s)}replace(i,e,s){return ue.call(this,i,e,s)}async closeAll(i=!1,e,s=!0){const o=await zt.call(this,i,e);return s&&$t.call(this),o}}ft=new WeakMap,ut=new WeakMap;const oi={selectorPopover:".popover",selectorTooltip:".popover_tooltip",selectorArrow:".popover__arrow",stateActive:"is-active",placement:"bottom",event:"click",offset:0,flipPadding:0,shiftPadding:0,arrowPadding:0,toggleDelay:0,eventListeners:!0,teleport:null,teleportMethod:"append"};function de(t,n,i){Object.assign(t.style,{left:n!=null?`${n}px`:"",top:i!=null?`${i}px`:""})}function ge(t,n){let i=t.getSetting("toggle-delay");typeof i=="string"&&(i.indexOf(",")>-1&&(i=i.split(",")),i.indexOf(" ")>-1&&(i=i.split(" "))),Array.isArray(i)&&(i=i[n]);const e=Number(i);if(Number.isNaN(e))throw new Error(`Provided delay value is not a number: "${i}"`);return e}function Wt(t){let n;const i=typeof t=="string"?t.trim().split(" "):[t];for(let e=0;e<i.length;e++)i[e]=Number(i[e]);switch(i.length){case 1:n=i[0];break;case 2:n={top:i[0],right:i[1],bottom:i[0],left:i[1]};break;case 3:n={top:i[0],right:i[1],bottom:i[2],left:i[1]};break;case 4:n={top:i[0],right:i[1],bottom:i[2],left:i[3]};break;default:n=!1;break}return n}function ri(t){return{offset:Number(t.getSetting("offset")),flip:{padding:Wt(t.getSetting("flip-padding"))},shift:{padding:Wt(t.getSetting("shift-padding"))},arrow:{element:t.getSetting("selectorArrow"),padding:Wt(t.getSetting("arrow-padding"))}}}function he(t){const n=typeof t=="string"?this.get(t):this.get(t.id);if(n)return n;throw new Error(`Popover not found in collection with id of "${t}".`)}function li(t){return typeof t=="string"?t:typeof t.hasAttribute=="function"?t.closest(this.settings.selectorPopover)?(t=t.closest(this.settings.selectorPopover),t.id):t.hasAttribute("aria-controls")?t.getAttribute("aria-controls"):t.hasAttribute("aria-describedby")?t.getAttribute("aria-describedby"):!1:!1}function ci(t){const n=li.call(this,t);if(n){const i=document.querySelector(`#${n}`),e=document.querySelector(`[aria-controls="${n}"]`)||document.querySelector(`[aria-describedby="${n}"]`);return!e&&!i?{error:new Error(`No popover elements found using the ID: "${n}".`)}:e?i?{popover:i,trigger:e}:{error:new Error(`No popover associated with the provided popover trigger: "${n}".`)}:{error:new Error(`No popover trigger associated with the provided popover: "${n}".`)}}else return{error:new Error("Could not resolve the popover ID.")}}async function Kt(t){const n=t?he.call(this,t):await me.call(this);return n&&n.state==="opened"&&(n.el.inert=!0,n.el.classList.remove(this.settings.stateActive),n.isTooltip||n.trigger.setAttribute("aria-expanded","false"),n.cleanup(),n.state="closed",n.trigger===this.trigger&&(this.trigger=null)),n}async function me(){const t=[];return await Promise.all(this.collection.map(async n=>{n.state==="opened"&&t.push(await Kt.call(this,n))})),t}function pe(t){t.state=="opened"&&setTimeout(()=>{const n=t.el.matches(":hover")===t.el||t.trigger.matches(":hover")===t.trigger;let i=document.activeElement.closest(`#${t.id}, [aria-controls="${t.id}"], [aria-describedby="${t.id}"]`);return i=i?i.matches(":focus-visible"):!1,!n&&!i&&t.close(),t},1)}function ai(t){t.state==="opened"?t.close():(this.trigger=t.trigger,t.open(),we.call(this,t))}function fi(t){t.isTooltip&&(t.toggleDelayId&&clearTimeout(t.toggleDelayId),t.close())}function ui(t,n){if(t.isHovered=n,n.type=="focus"&&!t.trigger.matches(":focus-visible"))return;t.toggleDelayId&&clearTimeout(t.toggleDelayId);const i=t.trigger.getAttribute("aria-expanded");if(i&&i=="true")return;const e=this.activeHover?0:ge(t,0);this.activeHover&&this.activeHover.close(),t.toggleDelayId=setTimeout(()=>{t.id&&t.open()},e)}function di(t,n){setTimeout(()=>{t.isHovered=n,!t.isHovered&&(t.toggleDelayId&&clearTimeout(t.toggleDelayId),t.toggleDelayId=setTimeout(()=>{pe.call(this,t)},ge(t,1)))},1)}function gi(t){switch(t.key){case"Escape":this.trigger&&this.trigger.focus(),me.call(this);return;case"Tab":this.collection.forEach(n=>{pe.call(this,n)});return;default:return}}function we(t){const n=this;document.addEventListener("click",function i(e){e.target.closest(`#${t.id}, [aria-controls="${t.id}"], [aria-describedby="${t.id}"]`)?t.el&&!t.el.classList.contains(n.settings.stateActive)&&this.removeEventListener("click",i):(t.el&&t.el.classList.contains(n.settings.stateActive)&&t.close(),this.removeEventListener("click",i))})}async function Xt(t){const n=this.collection.findIndex(i=>i.id===t.id);if(n>=0){const i=this.collection[n];i.state==="opened"&&i.close(),i.cleanup(),be(i),i.getSetting("teleport")&&i.teleportReturn(),Object.getOwnPropertyNames(i).forEach(e=>{delete i[e]}),this.collection.splice(n,1)}return this.collection}function be(t){return t._eventListeners&&(t._eventListeners.forEach(n=>{n.el.forEach(i=>{n.type.forEach(e=>{t[i].removeEventListener(e,n.listener,!1)})})}),delete t._eventListeners),t}const nt=Math.min,X=Math.max,Ot=Math.round,kt=Math.floor,V=t=>({x:t,y:t}),hi={left:"right",right:"left",bottom:"top",top:"bottom"},mi={start:"end",end:"start"};function Yt(t,n,i){return X(t,nt(n,i))}function Y(t,n){return typeof t=="function"?t(n):t}function j(t){return t.split("-")[0]}function bt(t){return t.split("-")[1]}function Gt(t){return t==="x"?"y":"x"}function Jt(t){return t==="y"?"height":"width"}function G(t){return["top","bottom"].includes(j(t))?"y":"x"}function Ut(t){return Gt(G(t))}function pi(t,n,i){i===void 0&&(i=!1);const e=bt(t),s=Ut(t),o=Jt(s);let r=s==="x"?e===(i?"end":"start")?"right":"left":e==="start"?"bottom":"top";return n.reference[o]>n.floating[o]&&(r=Pt(r)),[r,Pt(r)]}function wi(t){const n=Pt(t);return[Zt(t),n,Zt(n)]}function Zt(t){return t.replace(/start|end/g,n=>mi[n])}function bi(t,n,i){const e=["left","right"],s=["right","left"],o=["top","bottom"],r=["bottom","top"];switch(t){case"top":case"bottom":return i?n?s:e:n?e:s;case"left":case"right":return n?o:r;default:return[]}}function vi(t,n,i,e){const s=bt(t);let o=bi(j(t),i==="start",e);return s&&(o=o.map(r=>r+"-"+s),n&&(o=o.concat(o.map(Zt)))),o}function Pt(t){return t.replace(/left|right|bottom|top/g,n=>hi[n])}function yi(t){return{top:0,right:0,bottom:0,left:0,...t}}function ve(t){return typeof t!="number"?yi(t):{top:t,right:t,bottom:t,left:t}}function Tt(t){const{x:n,y:i,width:e,height:s}=t;return{width:e,height:s,top:i,left:n,right:n+e,bottom:i+s,x:n,y:i}}function ye(t,n,i){let{reference:e,floating:s}=t;const o=G(n),r=Ut(n),l=Jt(r),c=j(n),a=o==="y",d=e.x+e.width/2-s.width/2,u=e.y+e.height/2-s.height/2,g=e[l]/2-s[l]/2;let f;switch(c){case"top":f={x:d,y:e.y-s.height};break;case"bottom":f={x:d,y:e.y+e.height};break;case"right":f={x:e.x+e.width,y:u};break;case"left":f={x:e.x-s.width,y:u};break;default:f={x:e.x,y:e.y}}switch(bt(n)){case"start":f[r]-=g*(i&&a?-1:1);break;case"end":f[r]+=g*(i&&a?-1:1);break}return f}const xi=async(t,n,i)=>{const{placement:e="bottom",strategy:s="absolute",middleware:o=[],platform:r}=i,l=o.filter(Boolean),c=await(r.isRTL==null?void 0:r.isRTL(n));let a=await r.getElementRects({reference:t,floating:n,strategy:s}),{x:d,y:u}=ye(a,e,c),g=e,f={},h=0;for(let m=0;m<l.length;m++){const{name:w,fn:p}=l[m],{x:b,y:v,data:E,reset:y}=await p({x:d,y:u,initialPlacement:e,placement:g,strategy:s,middlewareData:f,rects:a,platform:r,elements:{reference:t,floating:n}});d=b??d,u=v??u,f={...f,[w]:{...f[w],...E}},y&&h<=50&&(h++,typeof y=="object"&&(y.placement&&(g=y.placement),y.rects&&(a=y.rects===!0?await r.getElementRects({reference:t,floating:n,strategy:s}):y.rects),{x:d,y:u}=ye(a,g,c)),m=-1)}return{x:d,y:u,placement:g,strategy:s,middlewareData:f}};async function xe(t,n){var i;n===void 0&&(n={});const{x:e,y:s,platform:o,rects:r,elements:l,strategy:c}=t,{boundary:a="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:g=!1,padding:f=0}=Y(n,t),h=ve(f),w=l[g?u==="floating"?"reference":"floating":u],p=Tt(await o.getClippingRect({element:(i=await(o.isElement==null?void 0:o.isElement(w)))==null||i?w:w.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(l.floating)),boundary:a,rootBoundary:d,strategy:c})),b=u==="floating"?{x:e,y:s,width:r.floating.width,height:r.floating.height}:r.reference,v=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),E=await(o.isElement==null?void 0:o.isElement(v))?await(o.getScale==null?void 0:o.getScale(v))||{x:1,y:1}:{x:1,y:1},y=Tt(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:b,offsetParent:v,strategy:c}):b);return{top:(p.top-y.top+h.top)/E.y,bottom:(y.bottom-p.bottom+h.bottom)/E.y,left:(p.left-y.left+h.left)/E.x,right:(y.right-p.right+h.right)/E.x}}const Si=t=>({name:"arrow",options:t,async fn(n){const{x:i,y:e,placement:s,rects:o,platform:r,elements:l,middlewareData:c}=n,{element:a,padding:d=0}=Y(t,n)||{};if(a==null)return{};const u=ve(d),g={x:i,y:e},f=Ut(s),h=Jt(f),m=await r.getDimensions(a),w=f==="y",p=w?"top":"left",b=w?"bottom":"right",v=w?"clientHeight":"clientWidth",E=o.reference[h]+o.reference[f]-g[f]-o.floating[h],y=g[f]-o.reference[f],T=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a));let Q=T?T[v]:0;(!Q||!await(r.isElement==null?void 0:r.isElement(T)))&&(Q=l.floating[v]||o.floating[h]);const St=E/2-y/2,q=Q/2-m[h]/2-1,z=nt(u[p],q),Et=nt(u[b],q),tt=z,Ct=Q-m[h]-Et,A=Q/2-m[h]/2+St,gt=Yt(tt,A,Ct),B=!c.arrow&&bt(s)!=null&&A!==gt&&o.reference[h]/2-(A<tt?z:Et)-m[h]/2<0,_=B?A<tt?A-tt:A-Ct:0;return{[f]:g[f]+_,data:{[f]:gt,centerOffset:A-gt-_,...B&&{alignmentOffset:_}},reset:B}}}),Ei=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(n){var i,e;const{placement:s,middlewareData:o,rects:r,initialPlacement:l,platform:c,elements:a}=n,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:g,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...w}=Y(t,n);if((i=o.arrow)!=null&&i.alignmentOffset)return{};const p=j(s),b=G(l),v=j(l)===l,E=await(c.isRTL==null?void 0:c.isRTL(a.floating)),y=g||(v||!m?[Pt(l)]:wi(l)),T=h!=="none";!g&&T&&y.push(...vi(l,m,h,E));const Q=[l,...y],St=await xe(n,w),q=[];let z=((e=o.flip)==null?void 0:e.overflows)||[];if(d&&q.push(St[p]),u){const A=pi(s,r,E);q.push(St[A[0]],St[A[1]])}if(z=[...z,{placement:s,overflows:q}],!q.every(A=>A<=0)){var Et,tt;const A=(((Et=o.flip)==null?void 0:Et.index)||0)+1,gt=Q[A];if(gt)return{data:{index:A,overflows:z},reset:{placement:gt}};let B=(tt=z.filter(_=>_.overflows[0]<=0).sort((_,W)=>_.overflows[1]-W.overflows[1])[0])==null?void 0:tt.placement;if(!B)switch(f){case"bestFit":{var Ct;const _=(Ct=z.filter(W=>{if(T){const K=G(W.placement);return K===b||K==="y"}return!0}).map(W=>[W.placement,W.overflows.filter(K=>K>0).reduce((K,tn)=>K+tn,0)]).sort((W,K)=>W[1]-K[1])[0])==null?void 0:Ct[0];_&&(B=_);break}case"initialPlacement":B=l;break}if(s!==B)return{reset:{placement:B}}}return{}}}};async function Ci(t,n){const{placement:i,platform:e,elements:s}=t,o=await(e.isRTL==null?void 0:e.isRTL(s.floating)),r=j(i),l=bt(i),c=G(i)==="y",a=["left","top"].includes(r)?-1:1,d=o&&c?-1:1,u=Y(n,t);let{mainAxis:g,crossAxis:f,alignmentAxis:h}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return l&&typeof h=="number"&&(f=l==="end"?h*-1:h),c?{x:f*d,y:g*a}:{x:g*a,y:f*d}}const Li=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(n){var i,e;const{x:s,y:o,placement:r,middlewareData:l}=n,c=await Ci(n,t);return r===((i=l.offset)==null?void 0:i.placement)&&(e=l.arrow)!=null&&e.alignmentOffset?{}:{x:s+c.x,y:o+c.y,data:{...c,placement:r}}}}},Ai=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(n){const{x:i,y:e,placement:s}=n,{mainAxis:o=!0,crossAxis:r=!1,limiter:l={fn:w=>{let{x:p,y:b}=w;return{x:p,y:b}}},...c}=Y(t,n),a={x:i,y:e},d=await xe(n,c),u=G(j(s)),g=Gt(u);let f=a[g],h=a[u];if(o){const w=g==="y"?"top":"left",p=g==="y"?"bottom":"right",b=f+d[w],v=f-d[p];f=Yt(b,f,v)}if(r){const w=u==="y"?"top":"left",p=u==="y"?"bottom":"right",b=h+d[w],v=h-d[p];h=Yt(b,h,v)}const m=l.fn({...n,[g]:f,[u]:h});return{...m,data:{x:m.x-i,y:m.y-e,enabled:{[g]:o,[u]:r}}}}}},$i=function(t){return t===void 0&&(t={}),{options:t,fn(n){const{x:i,y:e,placement:s,rects:o,middlewareData:r}=n,{offset:l=0,mainAxis:c=!0,crossAxis:a=!0}=Y(t,n),d={x:i,y:e},u=G(s),g=Gt(u);let f=d[g],h=d[u];const m=Y(l,n),w=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){const v=g==="y"?"height":"width",E=o.reference[g]-o.floating[v]+w.mainAxis,y=o.reference[g]+o.reference[v]-w.mainAxis;f<E?f=E:f>y&&(f=y)}if(a){var p,b;const v=g==="y"?"width":"height",E=["top","left"].includes(j(s)),y=o.reference[u]-o.floating[v]+(E&&((p=r.offset)==null?void 0:p[u])||0)+(E?0:w.crossAxis),T=o.reference[u]+o.reference[v]+(E?0:((b=r.offset)==null?void 0:b[u])||0)-(E?w.crossAxis:0);h<y?h=y:h>T&&(h=T)}return{[g]:f,[u]:h}}}};function Dt(){return typeof window<"u"}function st(t){return Se(t)?(t.nodeName||"").toLowerCase():"#document"}function P(t){var n;return(t==null||(n=t.ownerDocument)==null?void 0:n.defaultView)||window}function F(t){var n;return(n=(Se(t)?t.ownerDocument:t.document)||window.document)==null?void 0:n.documentElement}function Se(t){return Dt()?t instanceof Node||t instanceof P(t).Node:!1}function R(t){return Dt()?t instanceof Element||t instanceof P(t).Element:!1}function N(t){return Dt()?t instanceof HTMLElement||t instanceof P(t).HTMLElement:!1}function Ee(t){return!Dt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof P(t).ShadowRoot}function vt(t){const{overflow:n,overflowX:i,overflowY:e,display:s}=M(t);return/auto|scroll|overlay|hidden|clip/.test(n+e+i)&&!["inline","contents"].includes(s)}function Oi(t){return["table","td","th"].includes(st(t))}function Rt(t){return[":popover-open",":modal"].some(n=>{try{return t.matches(n)}catch{return!1}})}function Qt(t){const n=qt(),i=R(t)?M(t):t;return i.transform!=="none"||i.perspective!=="none"||(i.containerType?i.containerType!=="normal":!1)||!n&&(i.backdropFilter?i.backdropFilter!=="none":!1)||!n&&(i.filter?i.filter!=="none":!1)||["transform","perspective","filter"].some(e=>(i.willChange||"").includes(e))||["paint","layout","strict","content"].some(e=>(i.contain||"").includes(e))}function ki(t){let n=H(t);for(;N(n)&&!ot(n);){if(Qt(n))return n;if(Rt(n))return null;n=H(n)}return null}function qt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ot(t){return["html","body","#document"].includes(st(t))}function M(t){return P(t).getComputedStyle(t)}function Mt(t){return R(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function H(t){if(st(t)==="html")return t;const n=t.assignedSlot||t.parentNode||Ee(t)&&t.host||F(t);return Ee(n)?n.host:n}function Ce(t){const n=H(t);return ot(n)?t.ownerDocument?t.ownerDocument.body:t.body:N(n)&&vt(n)?n:Ce(n)}function yt(t,n,i){var e;n===void 0&&(n=[]),i===void 0&&(i=!0);const s=Ce(t),o=s===((e=t.ownerDocument)==null?void 0:e.body),r=P(s);if(o){const l=te(r);return n.concat(r,r.visualViewport||[],vt(s)?s:[],l&&i?yt(l):[])}return n.concat(s,yt(s,[],i))}function te(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Le(t){const n=M(t);let i=parseFloat(n.width)||0,e=parseFloat(n.height)||0;const s=N(t),o=s?t.offsetWidth:i,r=s?t.offsetHeight:e,l=Ot(i)!==o||Ot(e)!==r;return l&&(i=o,e=r),{width:i,height:e,$:l}}function ee(t){return R(t)?t:t.contextElement}function rt(t){const n=ee(t);if(!N(n))return V(1);const i=n.getBoundingClientRect(),{width:e,height:s,$:o}=Le(n);let r=(o?Ot(i.width):i.width)/e,l=(o?Ot(i.height):i.height)/s;return(!r||!Number.isFinite(r))&&(r=1),(!l||!Number.isFinite(l))&&(l=1),{x:r,y:l}}const Pi=V(0);function Ae(t){const n=P(t);return!qt()||!n.visualViewport?Pi:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function Ti(t,n,i){return n===void 0&&(n=!1),!i||n&&i!==P(t)?!1:n}function J(t,n,i,e){n===void 0&&(n=!1),i===void 0&&(i=!1);const s=t.getBoundingClientRect(),o=ee(t);let r=V(1);n&&(e?R(e)&&(r=rt(e)):r=rt(t));const l=Ti(o,i,e)?Ae(o):V(0);let c=(s.left+l.x)/r.x,a=(s.top+l.y)/r.y,d=s.width/r.x,u=s.height/r.y;if(o){const g=P(o),f=e&&R(e)?P(e):e;let h=g,m=te(h);for(;m&&e&&f!==h;){const w=rt(m),p=m.getBoundingClientRect(),b=M(m),v=p.left+(m.clientLeft+parseFloat(b.paddingLeft))*w.x,E=p.top+(m.clientTop+parseFloat(b.paddingTop))*w.y;c*=w.x,a*=w.y,d*=w.x,u*=w.y,c+=v,a+=E,h=P(m),m=te(h)}}return Tt({width:d,height:u,x:c,y:a})}function Di(t){let{elements:n,rect:i,offsetParent:e,strategy:s}=t;const o=s==="fixed",r=F(e),l=n?Rt(n.floating):!1;if(e===r||l&&o)return i;let c={scrollLeft:0,scrollTop:0},a=V(1);const d=V(0),u=N(e);if((u||!u&&!o)&&((st(e)!=="body"||vt(r))&&(c=Mt(e)),N(e))){const g=J(e);a=rt(e),d.x=g.x+e.clientLeft,d.y=g.y+e.clientTop}return{width:i.width*a.x,height:i.height*a.y,x:i.x*a.x-c.scrollLeft*a.x+d.x,y:i.y*a.y-c.scrollTop*a.y+d.y}}function Ri(t){return Array.from(t.getClientRects())}function ie(t,n){const i=Mt(t).scrollLeft;return n?n.left+i:J(F(t)).left+i}function Mi(t){const n=F(t),i=Mt(t),e=t.ownerDocument.body,s=X(n.scrollWidth,n.clientWidth,e.scrollWidth,e.clientWidth),o=X(n.scrollHeight,n.clientHeight,e.scrollHeight,e.clientHeight);let r=-i.scrollLeft+ie(t);const l=-i.scrollTop;return M(e).direction==="rtl"&&(r+=X(n.clientWidth,e.clientWidth)-s),{width:s,height:o,x:r,y:l}}function Ii(t,n){const i=P(t),e=F(t),s=i.visualViewport;let o=e.clientWidth,r=e.clientHeight,l=0,c=0;if(s){o=s.width,r=s.height;const a=qt();(!a||a&&n==="fixed")&&(l=s.offsetLeft,c=s.offsetTop)}return{width:o,height:r,x:l,y:c}}function Fi(t,n){const i=J(t,!0,n==="fixed"),e=i.top+t.clientTop,s=i.left+t.clientLeft,o=N(t)?rt(t):V(1),r=t.clientWidth*o.x,l=t.clientHeight*o.y,c=s*o.x,a=e*o.y;return{width:r,height:l,x:c,y:a}}function $e(t,n,i){let e;if(n==="viewport")e=Ii(t,i);else if(n==="document")e=Mi(F(t));else if(R(n))e=Fi(n,i);else{const s=Ae(t);e={...n,x:n.x-s.x,y:n.y-s.y}}return Tt(e)}function Oe(t,n){const i=H(t);return i===n||!R(i)||ot(i)?!1:M(i).position==="fixed"||Oe(i,n)}function Ni(t,n){const i=n.get(t);if(i)return i;let e=yt(t,[],!1).filter(l=>R(l)&&st(l)!=="body"),s=null;const o=M(t).position==="fixed";let r=o?H(t):t;for(;R(r)&&!ot(r);){const l=M(r),c=Qt(r);!c&&l.position==="fixed"&&(s=null),(o?!c&&!s:!c&&l.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||vt(r)&&!c&&Oe(t,r))?e=e.filter(d=>d!==r):s=l,r=H(r)}return n.set(t,e),e}function _i(t){let{element:n,boundary:i,rootBoundary:e,strategy:s}=t;const r=[...i==="clippingAncestors"?Rt(n)?[]:Ni(n,this._c):[].concat(i),e],l=r[0],c=r.reduce((a,d)=>{const u=$e(n,d,s);return a.top=X(u.top,a.top),a.right=nt(u.right,a.right),a.bottom=nt(u.bottom,a.bottom),a.left=X(u.left,a.left),a},$e(n,l,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Bi(t){const{width:n,height:i}=Le(t);return{width:n,height:i}}function Vi(t,n,i){const e=N(n),s=F(n),o=i==="fixed",r=J(t,!0,o,n);let l={scrollLeft:0,scrollTop:0};const c=V(0);if(e||!e&&!o)if((st(n)!=="body"||vt(s))&&(l=Mt(n)),e){const f=J(n,!0,o,n);c.x=f.x+n.clientLeft,c.y=f.y+n.clientTop}else s&&(c.x=ie(s));let a=0,d=0;if(s&&!e&&!o){const f=s.getBoundingClientRect();d=f.top+l.scrollTop,a=f.left+l.scrollLeft-ie(s,f)}const u=r.left+l.scrollLeft-c.x-a,g=r.top+l.scrollTop-c.y-d;return{x:u,y:g,width:r.width,height:r.height}}function ne(t){return M(t).position==="static"}function ke(t,n){if(!N(t)||M(t).position==="fixed")return null;if(n)return n(t);let i=t.offsetParent;return F(t)===i&&(i=i.ownerDocument.body),i}function Pe(t,n){const i=P(t);if(Rt(t))return i;if(!N(t)){let s=H(t);for(;s&&!ot(s);){if(R(s)&&!ne(s))return s;s=H(s)}return i}let e=ke(t,n);for(;e&&Oi(e)&&ne(e);)e=ke(e,n);return e&&ot(e)&&ne(e)&&!Qt(e)?i:e||ki(t)||i}const ji=async function(t){const n=this.getOffsetParent||Pe,i=this.getDimensions,e=await i(t.floating);return{reference:Vi(t.reference,await n(t.floating),t.strategy),floating:{x:0,y:0,width:e.width,height:e.height}}};function Hi(t){return M(t).direction==="rtl"}const zi={convertOffsetParentRelativeRectToViewportRelativeRect:Di,getDocumentElement:F,getClippingRect:_i,getOffsetParent:Pe,getElementRects:ji,getClientRects:Ri,getDimensions:Bi,getScale:rt,isElement:R,isRTL:Hi};function Wi(t,n){let i=null,e;const s=F(t);function o(){var l;clearTimeout(e),(l=i)==null||l.disconnect(),i=null}function r(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),o();const{left:a,top:d,width:u,height:g}=t.getBoundingClientRect();if(l||n(),!u||!g)return;const f=kt(d),h=kt(s.clientWidth-(a+u)),m=kt(s.clientHeight-(d+g)),w=kt(a),b={rootMargin:-f+"px "+-h+"px "+-m+"px "+-w+"px",threshold:X(0,nt(1,c))||1};let v=!0;function E(y){const T=y[0].intersectionRatio;if(T!==c){if(!v)return r();T?r(!1,T):e=setTimeout(()=>{r(!1,1e-7)},1e3)}v=!1}try{i=new IntersectionObserver(E,{...b,root:s.ownerDocument})}catch{i=new IntersectionObserver(E,b)}i.observe(t)}return r(!0),o}function Ki(t,n,i,e){e===void 0&&(e={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=e,a=ee(t),d=s||o?[...a?yt(a):[],...yt(n)]:[];d.forEach(p=>{s&&p.addEventListener("scroll",i,{passive:!0}),o&&p.addEventListener("resize",i)});const u=a&&l?Wi(a,i):null;let g=-1,f=null;r&&(f=new ResizeObserver(p=>{let[b]=p;b&&b.target===a&&f&&(f.unobserve(n),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var v;(v=f)==null||v.observe(n)})),i()}),a&&!c&&f.observe(a),f.observe(n));let h,m=c?J(t):null;c&&w();function w(){const p=J(t);m&&(p.x!==m.x||p.y!==m.y||p.width!==m.width||p.height!==m.height)&&i(),m=p,h=requestAnimationFrame(w)}return i(),()=>{var p;d.forEach(b=>{s&&b.removeEventListener("scroll",i),o&&b.removeEventListener("resize",i)}),u==null||u(),(p=f)==null||p.disconnect(),f=null,c&&cancelAnimationFrame(h)}}const Xi=Li,Yi=Ai,Gi=Ei,Ji=Si,Ui=$i,Zi=(t,n,i)=>{const e=new Map,s={platform:zi,...i},o={...s.platform,_c:e};return xi(t,n,{...s,platform:o})};async function Te(t){const n=he.call(this,t);n.el.inert=!1,n.el.classList.add(this.settings.stateActive),n.isTooltip||n.trigger.setAttribute("aria-expanded","true"),n.getCustomProps();const i=ri(n),e=n.el.querySelector(i.arrow.element);return i.arrow.element=e||void 0,n.cleanup=Ki(n.trigger,n.el,()=>{Zi(n.trigger,n.el,{placement:n.getSetting("placement"),middleware:[Gi(i.flip),Yi({...i.shift,limiter:Ui()}),Xi(i.offset),Ji(i.arrow)]}).then(({x:s,y:o,placement:r,middlewareData:l})=>{if(n.el){if(de(n.el,s,o),i.arrow.element&&l.arrow){const{x:c,y:a}=l.arrow;de(i.arrow.element,c,a)}n.el.setAttribute("data-floating-placement",r)}})}),n.state="opened",n}async function Qi(t,n,i={}){await Xt.call(this,t);const e=this,s={el:!1,trigger:!1},o=["placement","event","offset","flip-padding","shift-padding","arrow-padding","toggle-delay"],r=this.createEntry(t,{customPropKeys:o});return Object.assign(r,{state:"closed",trigger:n,toggleDelayId:null,cleanup:()=>{},open(){return Te.call(e,this)},close(){return Kt.call(e,this)},deregister(){return Xt.call(e,this)}}),Object.defineProperties(r,Object.getOwnPropertyDescriptors({set isHovered(l){const c=l.type=="mouseenter"?!0:l.type=="mouseleave"?!1:void 0;if(c!=null)switch(l.target){case this.el:s.el=c;break;case this.trigger:s.trigger=c;break}},get isHovered(){return s.el||s.trigger},get isTooltip(){return!!t.closest(e.settings.selectorTooltip)||t.getAttribute("role")=="tooltip"}})),r.isTooltip&&(r.settings.event="hover"),r.applySettings(i),r.getDataConfig(),r.getCustomProps(),r.isTooltip&&r.el.setAttribute("role","tooltip"),r.isTooltip||r.trigger.setAttribute("aria-expanded","false"),De.call(this,r),r.getSetting("teleport")&&r.teleport(),this.collection.push(r),r.el.classList.contains(this.settings.stateActive)?(await r.open(),we.call(this,r)):r.el.inert=!0,r}function De(t){return t._eventListeners||(t.getSetting("event")==="hover"?(t._eventListeners=[{el:["el","trigger"],type:["mouseenter","focus"],listener:ui.bind(this,t)},{el:["el","trigger"],type:["mouseleave","focusout"],listener:di.bind(this,t)},{el:["trigger"],type:["click"],listener:fi.bind(this,t)}],t._eventListeners.forEach(i=>{i.el.forEach(e=>{i.type.forEach(s=>{t[e].addEventListener(s,i.listener,!1)})})})):(t._eventListeners=[{el:["trigger"],type:["click"],listener:ai.bind(this,t)}],t._eventListeners.forEach(i=>{i.el.forEach(e=>{i.type.forEach(s=>{t[e].addEventListener(s,i.listener,!1)})})}))),t}class qi extends L{constructor(i){super({...oi,...i});I(this,dt);this.trigger=null,$(this,dt,gi.bind(this))}get active(){return this.collection.find(i=>i.state=="opened")}get activeHover(){return this.collection.find(i=>i.state=="opened"&&i.getSetting("event")=="hover")}async mount(i){i&&(this.settings={...this.settings,...i});const e=document.querySelectorAll(this.settings.selectorPopover);return await this.registerCollection(e),this.settings.eventListeners&&this.mountEventListeners(!1),this}async unmount(){return this.trigger=null,await this.deregisterCollection(),this.settings.eventListeners&&this.unmountEventListeners(!1),this}mountEventListeners(i=!0){i&&this.collection.forEach(e=>{De.call(this,e)}),document.addEventListener("keydown",S(this,dt),!1)}unmountEventListeners(i=!0){i&&this.collection.forEach(e=>{be(e)}),document.removeEventListener("keydown",S(this,dt),!1)}register(i,e={}){const s=ci.call(this,i);return s.error?Promise.reject(s.error):Qi.call(this,s.popover,s.trigger,e)}deregister(i){let e=this.get(i.id||i);return e?Xt.call(this,e):Promise.reject(new Error(`Failed to deregister; popover does not exist in collection with ID of: "${i.id||i}".`))}open(i){return Te.call(this,i)}close(i){return Kt.call(this,i)}}dt=new WeakMap,x.Drawer=Qe,x.Modal=si,x.Popover=qi,x.core=je,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})});
10
10
  //# sourceMappingURL=index.umd.cjs.map