vrembem 1.42.1 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dev/scripts.esm.js +2387 -1393
- package/dev/scripts.esm.js.map +1 -1
- package/dev/scripts.js +2387 -1393
- package/dev/scripts.js.map +1 -1
- package/dev/scripts.modern.js +1595 -1078
- package/dev/scripts.modern.js.map +1 -1
- package/dev/scripts.umd.js +2387 -1393
- package/dev/scripts.umd.js.map +1 -1
- package/dev/styles.css +39 -49
- package/dev/styles.css.map +1 -1
- package/dist/scripts.esm.js +1 -1
- package/dist/scripts.esm.js.map +1 -1
- package/dist/scripts.js +1 -1
- package/dist/scripts.js.map +1 -1
- package/dist/scripts.modern.js +1 -1
- package/dist/scripts.modern.js.map +1 -1
- package/dist/scripts.umd.js +1 -1
- package/dist/scripts.umd.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/package.json +26 -26
package/dist/scripts.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var t=function(t,e){e&&document.querySelectorAll(e).forEach(function(e){t?(e.inert=!0,e.setAttribute("aria-hidden",!0)):(e.inert=null,e.removeAttribute("aria-hidden"))})},e=function(t,e){e&&document.querySelectorAll(e).forEach(function(e){t?e.style.overflow="hidden":e.style.removeProperty("overflow")})},n=function(t){t&&document.querySelectorAll(t).forEach(function(t){t.setAttribute("tabindex","-1")})},r=function(t){var e=arguments;(t=t.forEach?t:[t]).forEach(function(t){var n;(n=t.classList).add.apply(n,[].slice.call(e,1))})},i=['a[href]:not([tabindex^="-"])','area[href]:not([tabindex^="-"])','input:not([type="hidden"]):not([type="radio"]):not([disabled]):not([tabindex^="-"])','input[type="radio"]:not([disabled]):not([tabindex^="-"])','select:not([disabled]):not([tabindex^="-"])','textarea:not([disabled]):not([tabindex^="-"])','button:not([disabled]):not([tabindex^="-"])','iframe:not([tabindex^="-"])','audio[controls]:not([tabindex^="-"])','video[controls]:not([tabindex^="-"])','[contenteditable]:not([tabindex^="-"])','[tabindex]:not([tabindex^="-"])'],o=function(t,e){var n=t.querySelector("[data-"+e.dataFocus+"]");if(n)n.focus();else{var r=t.querySelector('[tabindex="-1"]');r&&r.focus()}},s=function(t){void 0===t&&(t=null),t&&t.memory&&t.memory.trigger&&(t.memory.trigger.focus(),t.memory.trigger=null)},a=/*#__PURE__*/function(){function t(){this.target=null,this.__handlerFocusTrap=this.handlerFocusTrap.bind(this)}var e=t.prototype;return e.init=function(t){this.target=t,this.inner=this.target.querySelector('[tabindex="-1"]'),this.focusable=this.getFocusable(),this.focusable.length?(this.focusableFirst=this.focusable[0],this.focusableLast=this.focusable[this.focusable.length-1],this.target.addEventListener("keydown",this.__handlerFocusTrap)):this.target.addEventListener("keydown",this.handlerFocusLock)},e.destroy=function(){this.target&&(this.inner=null,this.focusable=null,this.focusableFirst=null,this.focusableLast=null,this.target.removeEventListener("keydown",this.__handlerFocusTrap),this.target.removeEventListener("keydown",this.handlerFocusLock),this.target=null)},e.refresh=function(){this.target&&(this.target.removeEventListener("keydown",this.__handlerFocusTrap),this.target.removeEventListener("keydown",this.handlerFocusLock),this.focusable=this.getFocusable(),this.focusable.length?(this.focusableFirst=this.focusable[0],this.focusableLast=this.focusable[this.focusable.length-1],this.target.addEventListener("keydown",this.__handlerFocusTrap)):(this.focusableFirst=null,this.focusableLast=null,this.target.addEventListener("keydown",this.handlerFocusLock)))},e.handlerFocusTrap=function(t){("Tab"===t.key||9===t.keyCode)&&(t.shiftKey?document.activeElement!==this.focusableFirst&&document.activeElement!==this.inner||(this.focusableLast.focus(),t.preventDefault()):document.activeElement!==this.focusableLast&&document.activeElement!==this.inner||(this.focusableFirst.focus(),t.preventDefault()))},e.handlerFocusLock=function(t){("Tab"===t.key||9===t.keyCode)&&t.preventDefault()},e.getFocusable=function(){var t=[],e=document.activeElement,n=this.inner?this.inner.scrollTop:0;return this.target.querySelectorAll(i.join(",")).forEach(function(e){e.focus(),e===document.activeElement&&t.push(e)}),this.inner&&(this.inner.scrollTop=n),e.focus(),t},t}(),c=function(t,e){return void 0===e&&(e=0),"string"!=typeof t?t:e?document.querySelector(t):document.querySelectorAll(t)},l=function(t){return t=[].slice.call(t=t.forEach?t:[t]),[].slice.call(arguments,1).some(function(e){return t.some(function(t){if(t.classList.contains(e))return!0})})};function u(t,e,n){if(void 0===n&&(n=!1),n){var r=c(t);if(!r.length)throw new Error('Move target element "'+t+'" not found!');var i=c(n,1);if(!i)throw new Error('Move reference element "'+n+'" not found!');r.forEach(function(t){switch(e){case"after":return i.after(t),{ref:i,el:t,type:e};case"before":return i.before(t),{ref:i,el:t,type:e};case"append":return i.append(t),{ref:i,el:t,type:e};case"prepend":return i.prepend(t),{ref:i,el:t,type:e};default:throw new Error('Move type "'+e+'" does not exist!')}})}}var d=function(t){var e=arguments;(t=t.forEach?t:[t]).forEach(function(t){var n;(n=t.classList).remove.apply(n,[].slice.call(e,1))})},f=function(t,e){return new Promise(function(n){e.transition?(t.classList.remove(e.stateClosed),t.classList.add(e.stateOpening),t.addEventListener("transitionend",function r(){t.classList.add(e.stateOpened),t.classList.remove(e.stateOpening),n(t),this.removeEventListener("transitionend",r)})):(t.classList.add(e.stateOpened),t.classList.remove(e.stateClosed),n(t))})},h=function(t,e){return new Promise(function(n){e.transition?(t.classList.add(e.stateClosing),t.classList.remove(e.stateOpened),t.addEventListener("transitionend",function r(){t.classList.remove(e.stateClosing),t.classList.add(e.stateClosed),n(t),this.removeEventListener("transitionend",r)})):(t.classList.add(e.stateClosed),t.classList.remove(e.stateOpened),n(t))})},p={__proto__:null,setInert:t,setOverflowHidden:e,setTabindex:n,addClass:r,camelCase:function(t){return t.replace(/-([a-z])/g,function(t){return t[1].toUpperCase()})},focusTarget:o,focusTrigger:s,FocusTrap:a,getElement:c,hasClass:l,hyphenCase:function(t){return t.replace(/([a-z][A-Z])/g,function(t){return t[0]+"-"+t[1].toLowerCase()})},moveElement:u,removeClass:d,toggleClass:function(t){var e=arguments;(t=t.forEach?t:[t]).forEach(function(t){[].slice.call(e,1).forEach(function(e){t.classList.toggle(e)})})},openTransition:f,closeTransition:h};function g(){return(g=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function v(t,e){return(v=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var m={autoInit:!1,stateAttr:"aria-checked",stateValue:"mixed"},y=/*#__PURE__*/function(){function t(t){this.defaults=m,this.settings=g({},this.defaults,t),this.__handlerClick=this.handlerClick.bind(this),this.settings.autoInit&&this.init()}var e=t.prototype;return e.init=function(t){void 0===t&&(t=null),t&&(this.settings=g({},this.settings,t));var e=document.querySelectorAll("["+this.settings.stateAttr+'="'+this.settings.stateValue+'"]');this.setIndeterminate(e),document.addEventListener("click",this.__handlerClick,!1)},e.destroy=function(){document.removeEventListener("click",this.__handlerClick,!1)},e.handlerClick=function(t){var e=t.target.closest("["+this.settings.stateAttr+'="'+this.settings.stateValue+'"]');e&&(this.removeAriaState(e),this.setIndeterminate(e))},e.setAriaState=function(t,e){var n=this;void 0===e&&(e=this.settings.stateValue),(t=t.forEach?t:[t]).forEach(function(t){t.setAttribute(n.settings.stateAttr,e)})},e.removeAriaState=function(t){var e=this;(t=t.forEach?t:[t]).forEach(function(t){t.removeAttribute(e.settings.stateAttr)})},e.setIndeterminate=function(t){var e=this;(t=t.forEach?t:[t]).forEach(function(t){t.indeterminate=!!t.hasAttribute(e.settings.stateAttr)})},t}(),b={autoInit:!1,dataDrawer:"drawer",dataDialog:"drawer-dialog",dataToggle:"drawer-toggle",dataOpen:"drawer-open",dataClose:"drawer-close",dataBreakpoint:"drawer-breakpoint",dataFocus:"drawer-focus",stateOpened:"is-opened",stateOpening:"is-opening",stateClosing:"is-closing",stateClosed:"is-closed",classModal:"drawer_modal",selectorInert:null,selectorOverflow:null,breakpoints:null,customEventPrefix:"drawer:",eventListeners:!0,stateSave:!0,stateKey:"DrawerState",setTabindex:!0,transition:!0},w=/*#__PURE__*/function(){function t(t){this.mediaQueryLists=[],this.parent=t,this.prefix=this.getVariablePrefix(),this.__check=this.check.bind(this)}var e=t.prototype;return e.init=function(){var t=this;document.querySelectorAll("[data-"+this.parent.settings.dataBreakpoint+"]").forEach(function(e){var n=e.getAttribute("data-"+t.parent.settings.dataDrawer),r=e.getAttribute("data-"+t.parent.settings.dataBreakpoint),i=t.getBreakpoint(r),o=window.matchMedia("(min-width:"+i+")");t.match(o,e),"function"==typeof o.addEventListener?o.addEventListener("change",t.__check):o.addListener(t.__check),t.mediaQueryLists.push({mql:o,drawer:n})})},e.destroy=function(){var t=this;this.mediaQueryLists&&this.mediaQueryLists.length&&this.mediaQueryLists.forEach(function(e){e.mql.removeListener(t.__check)}),this.mediaQueryLists=null},e.check=function(t){var e=this;void 0===t&&(t=null),this.mediaQueryLists&&this.mediaQueryLists.length&&(this.mediaQueryLists.forEach(function(n){if(!t||t.media==n.mql.media){var r=document.querySelector("[data-"+e.parent.settings.dataDrawer+'="'+n.drawer+'"]');r&&e.match(n.mql,r)}}),document.dispatchEvent(new CustomEvent(this.parent.settings.customEventPrefix+"breakpoint",{bubbles:!0})))},e.match=function(t,e){t.matches?this.parent.switchToDefault(e):this.parent.switchToModal(e)},e.getBreakpoint=function(t){var e=t;return this.parent.settings.breakpoints&&this.parent.settings.breakpoints[t]?e=this.parent.settings.breakpoints[t]:getComputedStyle(document.body).getPropertyValue(this.prefix+t)&&(e=getComputedStyle(document.body).getPropertyValue(this.prefix+t)),e},e.getVariablePrefix=function(){var t="--";return(t+=getComputedStyle(document.body).getPropertyValue("--vrembem-variable-prefix"))+"breakpoint-"},t}();function E(t){return"string"!=typeof t?t:document.querySelector("[data-"+this.settings.dataDrawer+'="'+t+'"]')}function x(t){return Promise.reject(new Error('Did not find drawer with key: "'+t+'"'))}var O=function(n){try{var r=this,i=r.getDrawer(n);return i?l(i,r.settings.stateOpened)?(r.working=!0,l(i,r.settings.classModal)&&(t(!1,r.settings.selectorInert),e(!1,r.settings.selectorOverflow)),Promise.resolve(h(i,r.settings)).then(function(){return r.stateSave(i),s(r),r.focusTrap.destroy(),i.dispatchEvent(new CustomEvent(r.settings.customEventPrefix+"closed",{detail:r,bubbles:!0})),r.working=!1,i})):Promise.resolve(i):Promise.resolve(x(n))}catch(t){return Promise.reject(t)}};function L(t){if(!this.working){var e=t.target.closest("[data-"+this.settings.dataToggle+"]");if(e){var n=e.getAttribute("data-"+this.settings.dataToggle);return this.memory.trigger=e,this.toggle(n),void t.preventDefault()}if(e=t.target.closest("[data-"+this.settings.dataOpen+"]")){var r=e.getAttribute("data-"+this.settings.dataOpen);return this.memory.trigger=e,this.open(r),void t.preventDefault()}if(e=t.target.closest("[data-"+this.settings.dataClose+"]")){var i=e.getAttribute("data-"+this.settings.dataClose);if(i)this.memory.trigger=e,this.close(i);else{var o=t.target.closest("[data-"+this.settings.dataDrawer+"]");o&&this.close(o)}t.preventDefault()}else t.target.hasAttribute("data-"+this.settings.dataDrawer)&&this.close(t.target)}}function k(t){if(!this.working&&"Escape"===t.key){var e=document.querySelector("."+this.settings.classModal+"."+this.settings.stateOpened);e&&this.close(e)}}var _=function(n){try{var r=this,i=r.getDrawer(n);if(!i)return Promise.resolve(x(n));if(l(i,r.settings.stateOpened))return o(i,r.settings),Promise.resolve(i);r.working=!0;var s=l(i,r.settings.classModal);return s&&e(!0,r.settings.selectorOverflow),Promise.resolve(f(i,r.settings)).then(function(){return r.stateSave(i),s&&(r.focusTrap.init(i),t(!0,r.settings.selectorInert)),o(i,r.settings),i.dispatchEvent(new CustomEvent(r.settings.customEventPrefix+"opened",{detail:r,bubbles:!0})),r.working=!1,i})}catch(t){return Promise.reject(t)}};function A(t,e){if(!e.stateSave)return C(e);var n=localStorage.getItem(e.stateKey)?JSON.parse(localStorage.getItem(e.stateKey)):{};return(t?[t]:document.querySelectorAll("[data-"+e.dataDrawer+"]")).forEach(function(t){if(!l(t,e.classModal)){var r=t.getAttribute("data-"+e.dataDrawer);n[r]=l(t,e.stateOpened)?e.stateOpened:e.stateClosed}}),localStorage.setItem(e.stateKey,JSON.stringify(n)),n}function C(t){return localStorage.getItem(t.stateKey)&&localStorage.removeItem(t.stateKey),{}}var P=function(n){try{var i=this,o=i.getDrawer(n);return o?l(o,i.settings.classModal)?(t(!1,i.settings.selectorInert),e(!1,i.settings.selectorOverflow),d(o,i.settings.classModal),i.focusTrap.destroy(),n=o.getAttribute("data-"+i.settings.dataDrawer),i.state[n]==i.settings.stateOpened&&(r(o,i.settings.stateOpened),d(o,i.settings.stateClosed)),o.dispatchEvent(new CustomEvent(i.settings.customEventPrefix+"toDefault",{bubbles:!0})),Promise.resolve(o)):Promise.resolve():Promise.resolve(x(n))}catch(t){return Promise.reject(t)}},S=function(t){try{var e=this,n=e.getDrawer(t);return n?l(n,e.settings.classModal)?Promise.resolve():(r(n,e.settings.classModal),r(n,e.settings.stateClosed),d(n,e.settings.stateOpened),n.dispatchEvent(new CustomEvent(e.settings.customEventPrefix+"toModal",{bubbles:!0})),Promise.resolve(n)):Promise.resolve(x(t))}catch(t){return Promise.reject(t)}},D=function(t){try{var e=this,n=e.getDrawer(t);if(!n)return Promise.resolve(x(t));var r=!l(n,e.settings.stateOpened);return Promise.resolve(r?e.open(n):e.close(n))}catch(t){return Promise.reject(t)}},T=/*#__PURE__*/function(){function t(t){this.defaults=b,this.settings=g({},this.defaults,t),this.working=!1,this.memory={},this.state={},this.focusTrap=new a,this.breakpoint=new w(this),this.__handlerClick=L.bind(this),this.__handlerKeydown=k.bind(this),this.settings.autoInit&&this.init()}var e=t.prototype;return e.init=function(t){void 0===t&&(t=null),t&&(this.settings=g({},this.settings,t)),this.stateSet(),this.settings.setTabindex&&this.setTabindex(),this.breakpoint.init(),this.settings.eventListeners&&this.initEventListeners()},e.destroy=function(){this.breakpoint.destroy(),this.memory={},this.state={},localStorage.removeItem(this.settings.stateKey),this.settings.eventListeners&&this.destroyEventListeners()},e.initEventListeners=function(){document.addEventListener("click",this.__handlerClick,!1),document.addEventListener("touchend",this.__handlerClick,!1),document.addEventListener("keydown",this.__handlerKeydown,!1)},e.destroyEventListeners=function(){document.removeEventListener("click",this.__handlerClick,!1),document.removeEventListener("touchend",this.__handlerClick,!1),document.removeEventListener("keydown",this.__handlerKeydown,!1)},e.getDrawer=function(t){return E.call(this,t)},e.setTabindex=function(){return n("\n [data-"+this.settings.dataDrawer+"]\n [data-"+this.settings.dataDialog+"]\n ")},e.stateSet=function(){this.state=function(t){if(!t.stateSave)return C(t);var e=localStorage.getItem(t.stateKey);if(!e||e&&0===Object.keys(JSON.parse(e)).length)return A(null,t);var n=JSON.parse(localStorage.getItem(t.stateKey));return Object.keys(n).forEach(function(e){var i=document.querySelector("[data-"+t.dataDrawer+'="'+e+'"]');i&&(n[e]==t.stateOpened?r(i,t.stateOpened):d(i,t.stateOpened))}),n}(this.settings)},e.stateSave=function(t){void 0===t&&(t=null),this.state=A(t,this.settings)},e.stateClear=function(){this.state=C(this.settings)},e.switchToDefault=function(t){return P.call(this,t)},e.switchToModal=function(t){return S.call(this,t)},e.toggle=function(t){return D.call(this,t)},e.open=function(t){return _.call(this,t)},e.close=function(t){return O.call(this,t)},t}(),j={autoInit:!1,dataModal:"modal",dataDialog:"modal-dialog",dataOpen:"modal-open",dataClose:"modal-close",dataFocus:"modal-focus",dataRequired:"modal-required",dataConfig:"modal-config",stateOpened:"is-opened",stateOpening:"is-opening",stateClosing:"is-closing",stateClosed:"is-closed",selectorInert:null,selectorOverflow:"body",customEventPrefix:"modal:",eventListeners:!0,moveModals:{ref:null,type:null},setTabindex:!0,transition:!0};function M(t){var e=t.getAttribute("data-"+this.settings.dataConfig);if(e){var n=JSON.parse(e);return g({},this.settings,n)}return this.settings}function q(t){return"string"!=typeof t?t:document.querySelector("[data-"+this.settings.dataModal+'="'+t+'"]')}function I(t,e){void 0===t&&(t=this.settings.moveModals.type),void 0===e&&(e=this.settings.moveModals.ref);var n=document.querySelectorAll("[data-"+this.settings.dataModal+"]");n.length&&u(n,t,e)}var F=function(n){void 0===n&&(n=!0);try{var r=this,i=document.querySelector("[data-"+r.settings.dataModal+"]."+r.settings.stateOpened);if(i){r.working=!0;var o=M.call(r,i);return t(!1,o.selectorInert),e(!1,o.selectorOverflow),Promise.resolve(h(i,o)).then(function(){return n&&s(r),r.focusTrap.destroy(),i.dispatchEvent(new CustomEvent(o.customEventPrefix+"closed",{detail:r,bubbles:!0})),r.working=!1,i})}return Promise.resolve(i)}catch(t){return Promise.reject(t)}},B=function(t){try{var e,n=function(n){return e?n:t.target.closest("[data-"+r.settings.dataClose+"]")?(t.preventDefault(),void r.close()):void(t.target.hasAttribute("data-"+r.settings.dataModal)&&!t.target.hasAttribute("data-"+r.settings.dataRequired)&&r.close())},r=this;if(r.working)return Promise.resolve();var i=t.target.closest("[data-"+r.settings.dataOpen+"]"),o=function(){if(i){t.preventDefault();var n=i.getAttribute("data-"+r.settings.dataOpen),o=t.target.closest("[data-"+r.settings.dataModal+"]");return o||(r.memory.trigger=i),Promise.resolve(r.close(!o)).then(function(){r.open(n),e=1})}}();return Promise.resolve(o&&o.then?o.then(n):n(o))}catch(t){return Promise.reject(t)}};function V(t){if(!this.working&&"Escape"===t.key){var e=document.querySelector("[data-"+this.settings.dataModal+"]."+this.settings.stateOpened);e&&!e.hasAttribute("data-"+this.settings.dataRequired)&&this.close()}}function K(){var n=this;document.querySelectorAll("[data-"+this.settings.dataModal+"]").forEach(function(i){i.classList.contains(n.settings.stateOpened)&&(t(!1,n.settings.selectorInert),e(!1,n.settings.selectorOverflow),s(n),n.focusTrap.destroy()),d(i,n.settings.stateOpened,n.settings.stateOpening,n.settings.stateClosing),r(i,n.settings.stateClosed)})}var R=function(n){try{var r=this,i=q.call(r,n);if(!i)return Promise.resolve(Promise.reject(new Error('Did not find modal with key: "'+n+'"')));var s=M.call(r,i);return l(i,s.stateClosed)?(r.working=!0,e(!0,s.selectorOverflow),Promise.resolve(f(i,s)).then(function(){return r.focusTrap.init(i),o(i,s),t(!0,s.selectorInert),i.dispatchEvent(new CustomEvent(s.customEventPrefix+"opened",{detail:r,bubbles:!0})),r.working=!1,i})):Promise.resolve(i)}catch(t){return Promise.reject(t)}},W=/*#__PURE__*/function(){function t(t){this.defaults=j,this.settings=g({},this.defaults,t),this.working=!1,this.memory={},this.focusTrap=new a,this.__handlerClick=B.bind(this),this.__handlerKeydown=V.bind(this),this.settings.autoInit&&this.init()}var e=t.prototype;return e.init=function(t){void 0===t&&(t=null),t&&(this.settings=g({},this.settings,t)),this.moveModals(),this.setInitialState(),this.settings.setTabindex&&this.setTabindex(),this.settings.eventListeners&&this.initEventListeners()},e.destroy=function(){this.memory={},this.settings.eventListeners&&this.destroyEventListeners()},e.initEventListeners=function(){document.addEventListener("click",this.__handlerClick,!1),document.addEventListener("touchend",this.__handlerClick,!1),document.addEventListener("keydown",this.__handlerKeydown,!1)},e.destroyEventListeners=function(){document.removeEventListener("click",this.__handlerClick,!1),document.removeEventListener("touchend",this.__handlerClick,!1),document.removeEventListener("keydown",this.__handlerKeydown,!1)},e.getModal=function(t){return q.call(this,t)},e.setTabindex=function(){return n("\n [data-"+this.settings.dataModal+"]\n [data-"+this.settings.dataDialog+"]\n ")},e.setInitialState=function(){return K.call(this)},e.moveModals=function(t,e){return I.call(this,t,e)},e.open=function(t){return R.call(this,t)},e.close=function(t){return F.call(this,t)},t}(),H=/*#__PURE__*/function(){function t(){this.collection=[]}var e=t.prototype;return e.register=function(t){return this.deregister(t),this.collection.push(t),this.collection},e.deregister=function(t){var e=this.collection.findIndex(function(e){return e===t});if(e>=0){var n=this.collection[e];Object.getOwnPropertyNames(n).forEach(function(t){delete n[t]}),this.collection.splice(e,1)}return this.collection},e.registerCollection=function(t){var e=this;return t.forEach(function(t){e.register(t)}),this.collection},e.deregisterCollection=function(){for(;this.collection.length>0;)this.deregister(this.collection[0]);return this.collection},e.get=function(t,e){return void 0===e&&(e="id"),this.collection.find(function(n){return n[e]===t})||null},t}(),N={autoInit:!1,selectorPopover:".popover",selectorArrow:".popover__arrow",stateActive:"is-active",eventListeners:!0,eventType:"click",placement:"bottom"};function Q(t){return t.target.classList.remove(this.settings.stateActive),t.trigger.hasAttribute("aria-controls")&&t.trigger.setAttribute("aria-expanded","false"),t.popper.setOptions({modifiers:[{name:"eventListeners",enabled:!1}]}),t.state="closed",t.trigger===this.memory.trigger&&(this.memory.trigger=null),t}function z(){return this.collection.forEach(function(t){"opened"===t.state&&t.close()}),this.collection}function J(t){"opened"==t.state&&setTimeout(function(){var e=t.target.closest(":hover")===t.target||t.trigger.closest(":hover")===t.trigger,n=document.activeElement.closest("#"+t.id+', [aria-controls="'+t.id+'"]');return e||n||t.close(),t},1)}function U(t){t.target.classList.contains(this.settings.stateActive)?t.close():(this.memory.trigger=t.trigger,t.open(),Y.call(this,t))}function X(t){var e=this;switch(t.key){case"Escape":return this.memory.trigger&&this.memory.trigger.focus(),void z.call(this);case"Tab":return void this.collection.forEach(function(t){J.call(e,t)});default:return}}function Y(t){var e=this;document.addEventListener("click",function n(r){r.target.closest("#"+t.id+', [aria-controls="'+t.id+'"]')?t.target&&!t.target.classList.contains(e.settings.stateActive)&&this.removeEventListener("click",n):(t.target&&t.target.classList.contains(e.settings.stateActive)&&t.close(),this.removeEventListener("click",n))})}function Z(t,e){var n=getComputedStyle(t),r={placement:e.placement,event:e.eventType,offset:0,"overflow-padding":0,"flip-padding":0,"arrow-element":e.selectorArrow,"arrow-padding":0};for(var i in r){var o=getComputedStyle(document.body).getPropertyValue("--vrembem-variable-prefix"),s=n.getPropertyValue("--"+o+"popover-"+i).trim();s&&(r[i]=s)}return r}function G(t){var e,n="string"==typeof t?t.trim().split(" "):[t];switch(n.forEach(function(t,e){n[e]=parseInt(t,10)}),n.length){case 1:e=n[0];break;case 2:e={top:n[0],right:n[1],bottom:n[0],left:n[1]};break;case 3:e={top:n[0],right:n[1],bottom:n[2],left:n[1]};break;case 4:e={top:n[0],right:n[1],bottom:n[2],left:n[3]};break;default:e=!1}return e}function $(t){return"string"==typeof t?t:"function"==typeof t.hasAttribute?t.hasAttribute("aria-controls")?t.getAttribute("aria-controls"):t.hasAttribute("aria-describedby")?t.getAttribute("aria-describedby"):!!t.closest(this.settings.selectorPopover)&&t.id:!!t.id&&t.id}function tt(t){var e=$.call(this,t);if(e){var n=document.querySelector('[aria-controls="'+e+'"]')||document.querySelector('[aria-describedby="'+e+'"]'),r=document.querySelector("#"+e);return n||r?n?r||console.error("No popover associated with the provided popover trigger:",n):console.error("No popover trigger associated with the provided popover:",r):console.error("No popover elements found using the provided ID:",e),!(!n||!r)&&{trigger:n,target:r}}return console.error("Could not resolve the popover ID:",t),!1}var et="top",nt="bottom",rt="right",it="left",ot=[et,nt,rt,it],st=/*#__PURE__*/ot.reduce(function(t,e){return t.concat([e+"-start",e+"-end"])},[]),at=/*#__PURE__*/[].concat(ot,["auto"]).reduce(function(t,e){return t.concat([e,e+"-start",e+"-end"])},[]),ct=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function lt(t){return t?(t.nodeName||"").toLowerCase():null}function ut(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function dt(t){return t instanceof ut(t).Element||t instanceof Element}function ft(t){return t instanceof ut(t).HTMLElement||t instanceof HTMLElement}function ht(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ut(t).ShadowRoot||t instanceof ShadowRoot)}function pt(t){return t.split("-")[0]}var gt=Math.max,vt=Math.min,mt=Math.round;function yt(t,e){void 0===e&&(e=!1);var n=t.getBoundingClientRect(),r=1,i=1;if(ft(t)&&e){var o=t.offsetHeight,s=t.offsetWidth;s>0&&(r=mt(n.width)/s||1),o>0&&(i=mt(n.height)/o||1)}return{width:n.width/r,height:n.height/i,top:n.top/i,right:n.right/r,bottom:n.bottom/i,left:n.left/r,x:n.left/r,y:n.top/i}}function bt(t){var e=yt(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function wt(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&ht(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Et(t){return ut(t).getComputedStyle(t)}function xt(t){return["table","td","th"].indexOf(lt(t))>=0}function Ot(t){return((dt(t)?t.ownerDocument:t.document)||window.document).documentElement}function Lt(t){return"html"===lt(t)?t:t.assignedSlot||t.parentNode||(ht(t)?t.host:null)||Ot(t)}function kt(t){return ft(t)&&"fixed"!==Et(t).position?t.offsetParent:null}function _t(t){for(var e=ut(t),n=kt(t);n&&xt(n)&&"static"===Et(n).position;)n=kt(n);return n&&("html"===lt(n)||"body"===lt(n)&&"static"===Et(n).position)?e:n||function(t){var e=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&ft(t)&&"fixed"===Et(t).position)return null;for(var n=Lt(t);ft(n)&&["html","body"].indexOf(lt(n))<0;){var r=Et(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||e&&"filter"===r.willChange||e&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(t)||e}function At(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Ct(t,e,n){return gt(t,vt(e,n))}function Pt(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function St(t,e){return e.reduce(function(e,n){return e[n]=t,e},{})}function Dt(t){return t.split("-")[1]}var Tt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function jt(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,s=t.offsets,a=t.position,c=t.gpuAcceleration,l=t.adaptive,u=t.roundOffsets,d=t.isFixed,f=s.x,h=void 0===f?0:f,p=s.y,g=void 0===p?0:p,v="function"==typeof u?u({x:h,y:g}):{x:h,y:g};h=v.x,g=v.y;var m=s.hasOwnProperty("x"),y=s.hasOwnProperty("y"),b=it,w=et,E=window;if(l){var x=_t(n),O="clientHeight",L="clientWidth";x===ut(n)&&"static"!==Et(x=Ot(n)).position&&"absolute"===a&&(O="scrollHeight",L="scrollWidth"),x=x,(i===et||(i===it||i===rt)&&"end"===o)&&(w=nt,g-=(d&&E.visualViewport?E.visualViewport.height:x[O])-r.height,g*=c?1:-1),i!==it&&(i!==et&&i!==nt||"end"!==o)||(b=rt,h-=(d&&E.visualViewport?E.visualViewport.width:x[L])-r.width,h*=c?1:-1)}var k,_=Object.assign({position:a},l&&Tt),A=!0===u?function(t){var e=t.y,n=window.devicePixelRatio||1;return{x:mt(t.x*n)/n||0,y:mt(e*n)/n||0}}({x:h,y:g}):{x:h,y:g};return h=A.x,g=A.y,Object.assign({},_,c?((k={})[w]=y?"0":"",k[b]=m?"0":"",k.transform=(E.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",k):((e={})[w]=y?g+"px":"",e[b]=m?h+"px":"",e.transform="",e))}var Mt={passive:!0},qt={left:"right",right:"left",bottom:"top",top:"bottom"};function It(t){return t.replace(/left|right|bottom|top/g,function(t){return qt[t]})}var Ft={start:"end",end:"start"};function Bt(t){return t.replace(/start|end/g,function(t){return Ft[t]})}function Vt(t){var e=ut(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Kt(t){return yt(Ot(t)).left+Vt(t).scrollLeft}function Rt(t){var e=Et(t);return/auto|scroll|overlay|hidden/.test(e.overflow+e.overflowY+e.overflowX)}function Wt(t){return["html","body","#document"].indexOf(lt(t))>=0?t.ownerDocument.body:ft(t)&&Rt(t)?t:Wt(Lt(t))}function Ht(t,e){var n;void 0===e&&(e=[]);var r=Wt(t),i=r===(null==(n=t.ownerDocument)?void 0:n.body),o=ut(r),s=i?[o].concat(o.visualViewport||[],Rt(r)?r:[]):r,a=e.concat(s);return i?a:a.concat(Ht(Lt(s)))}function Nt(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Qt(t,e){return"viewport"===e?Nt(function(t){var e=ut(t),n=Ot(t),r=e.visualViewport,i=n.clientWidth,o=n.clientHeight,s=0,a=0;return r&&(i=r.width,o=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=r.offsetLeft,a=r.offsetTop)),{width:i,height:o,x:s+Kt(t),y:a}}(t)):dt(e)?function(t){var e=yt(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}(e):Nt(function(t){var e,n=Ot(t),r=Vt(t),i=null==(e=t.ownerDocument)?void 0:e.body,o=gt(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=gt(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+Kt(t),c=-r.scrollTop;return"rtl"===Et(i||n).direction&&(a+=gt(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:c}}(Ot(t)))}function zt(t){var e,n=t.reference,r=t.element,i=t.placement,o=i?pt(i):null,s=i?Dt(i):null,a=n.x+n.width/2-r.width/2,c=n.y+n.height/2-r.height/2;switch(o){case et:e={x:a,y:n.y-r.height};break;case nt:e={x:a,y:n.y+n.height};break;case rt:e={x:n.x+n.width,y:c};break;case it:e={x:n.x-r.width,y:c};break;default:e={x:n.x,y:n.y}}var l=o?At(o):null;if(null!=l){var u="y"===l?"height":"width";switch(s){case"start":e[l]=e[l]-(n[u]/2-r[u]/2);break;case"end":e[l]=e[l]+(n[u]/2-r[u]/2)}}return e}function Jt(t,e){void 0===e&&(e={});var n=e.placement,r=void 0===n?t.placement:n,i=e.boundary,o=void 0===i?"clippingParents":i,s=e.rootBoundary,a=void 0===s?"viewport":s,c=e.elementContext,l=void 0===c?"popper":c,u=e.altBoundary,d=void 0!==u&&u,f=e.padding,h=void 0===f?0:f,p=Pt("number"!=typeof h?h:St(h,ot)),g=t.rects.popper,v=t.elements[d?"popper"===l?"reference":"popper":l],m=function(t,e,n){var r="clippingParents"===e?function(t){var e=Ht(Lt(t)),n=["absolute","fixed"].indexOf(Et(t).position)>=0&&ft(t)?_t(t):t;return dt(n)?e.filter(function(t){return dt(t)&&wt(t,n)&&"body"!==lt(t)}):[]}(t):[].concat(e),i=[].concat(r,[n]),o=i.reduce(function(e,n){var r=Qt(t,n);return e.top=gt(r.top,e.top),e.right=vt(r.right,e.right),e.bottom=vt(r.bottom,e.bottom),e.left=gt(r.left,e.left),e},Qt(t,i[0]));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}(dt(v)?v:v.contextElement||Ot(t.elements.popper),o,a),y=yt(t.elements.reference),b=zt({reference:y,element:g,strategy:"absolute",placement:r}),w=Nt(Object.assign({},g,b)),E="popper"===l?w:y,x={top:m.top-E.top+p.top,bottom:E.bottom-m.bottom+p.bottom,left:m.left-E.left+p.left,right:E.right-m.right+p.right},O=t.modifiersData.offset;if("popper"===l&&O){var L=O[r];Object.keys(x).forEach(function(t){var e=[rt,nt].indexOf(t)>=0?1:-1,n=[et,nt].indexOf(t)>=0?"y":"x";x[t]+=L[n]*e})}return x}function Ut(t,e){void 0===e&&(e={});var n=e.boundary,r=e.rootBoundary,i=e.padding,o=e.flipVariations,s=e.allowedAutoPlacements,a=void 0===s?at:s,c=Dt(e.placement),l=c?o?st:st.filter(function(t){return Dt(t)===c}):ot,u=l.filter(function(t){return a.indexOf(t)>=0});0===u.length&&(u=l);var d=u.reduce(function(e,o){return e[o]=Jt(t,{placement:o,boundary:n,rootBoundary:r,padding:i})[pt(o)],e},{});return Object.keys(d).sort(function(t,e){return d[t]-d[e]})}function Xt(t,e,n){return void 0===n&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Yt(t){return[et,rt,nt,it].some(function(e){return t[e]>=0})}function Zt(t,e,n){void 0===n&&(n=!1);var r,i,o=ft(e),s=ft(e)&&function(t){var e=t.getBoundingClientRect(),n=mt(e.width)/t.offsetWidth||1,r=mt(e.height)/t.offsetHeight||1;return 1!==n||1!==r}(e),a=Ot(e),c=yt(t,s),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(o||!o&&!n)&&(("body"!==lt(e)||Rt(a))&&(l=(r=e)!==ut(r)&&ft(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:Vt(r)),ft(e)?((u=yt(e,!0)).x+=e.clientLeft,u.y+=e.clientTop):a&&(u.x=Kt(a))),{x:c.left+l.scrollLeft-u.x,y:c.top+l.scrollTop-u.y,width:c.width,height:c.height}}function Gt(t){var e=new Map,n=new Set,r=[];function i(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){if(!n.has(t)){var r=e.get(t);r&&i(r)}}),r.push(t)}return t.forEach(function(t){e.set(t.name,t)}),t.forEach(function(t){n.has(t.name)||i(t)}),r}var $t={placement:"bottom",modifiers:[],strategy:"absolute"};function te(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(t){return!(t&&"function"==typeof t.getBoundingClientRect)})}function ee(t){void 0===t&&(t={});var e=t.defaultModifiers,n=void 0===e?[]:e,r=t.defaultOptions,i=void 0===r?$t:r;return function(t,e,r){void 0===r&&(r=i);var o,s,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},$t,i),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},c=[],l=!1,u={state:a,setOptions:function(r){var o="function"==typeof r?r(a.options):r;d(),a.options=Object.assign({},i,a.options,o),a.scrollParents={reference:dt(t)?Ht(t):t.contextElement?Ht(t.contextElement):[],popper:Ht(e)};var s,l,f=function(t){var e=Gt(t);return ct.reduce(function(t,n){return t.concat(e.filter(function(t){return t.phase===n}))},[])}((s=[].concat(n,a.options.modifiers),l=s.reduce(function(t,e){var n=t[e.name];return t[e.name]=n?Object.assign({},n,e,{options:Object.assign({},n.options,e.options),data:Object.assign({},n.data,e.data)}):e,t},{}),Object.keys(l).map(function(t){return l[t]})));return a.orderedModifiers=f.filter(function(t){return t.enabled}),a.orderedModifiers.forEach(function(t){var e=t.options,n=t.effect;if("function"==typeof n){var r=n({state:a,name:t.name,instance:u,options:void 0===e?{}:e});c.push(r||function(){})}}),u.update()},forceUpdate:function(){if(!l){var t=a.elements,e=t.reference,n=t.popper;if(te(e,n)){a.rects={reference:Zt(e,_t(n),"fixed"===a.options.strategy),popper:bt(n)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach(function(t){return a.modifiersData[t.name]=Object.assign({},t.data)});for(var r=0;r<a.orderedModifiers.length;r++)if(!0!==a.reset){var i=a.orderedModifiers[r],o=i.fn,s=i.options;"function"==typeof o&&(a=o({state:a,options:void 0===s?{}:s,name:i.name,instance:u})||a)}else a.reset=!1,r=-1}}},update:(o=function(){return new Promise(function(t){u.forceUpdate(),t(a)})},function(){return s||(s=new Promise(function(t){Promise.resolve().then(function(){s=void 0,t(o())})})),s}),destroy:function(){d(),l=!0}};if(!te(t,e))return u;function d(){c.forEach(function(t){return t()}),c=[]}return u.setOptions(r).then(function(t){!l&&r.onFirstUpdate&&r.onFirstUpdate(t)}),u}}var ne=/*#__PURE__*/ee({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=void 0===i||i,s=r.resize,a=void 0===s||s,c=ut(e.elements.popper),l=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&l.forEach(function(t){t.addEventListener("scroll",n.update,Mt)}),a&&c.addEventListener("resize",n.update,Mt),function(){o&&l.forEach(function(t){t.removeEventListener("scroll",n.update,Mt)}),a&&c.removeEventListener("resize",n.update,Mt)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state;e.modifiersData[t.name]=zt({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,s=void 0===o||o,a=n.roundOffsets,c=void 0===a||a,l={placement:pt(e.placement),variation:Dt(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,jt(Object.assign({},l,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:c})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,jt(Object.assign({},l,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach(function(t){var n=e.styles[t]||{},r=e.attributes[t]||{},i=e.elements[t];ft(i)&<(i)&&(Object.assign(i.style,n),Object.keys(r).forEach(function(t){var e=r[t];!1===e?i.removeAttribute(t):i.setAttribute(t,!0===e?"":e)}))})},effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(t){var r=e.elements[t],i=e.attributes[t]||{},o=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce(function(t,e){return t[e]="",t},{});ft(r)&<(r)&&(Object.assign(r.style,o),Object.keys(i).forEach(function(t){r.removeAttribute(t)}))})}},requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,n=t.name,r=t.options.offset,i=void 0===r?[0,0]:r,o=at.reduce(function(t,n){return t[n]=function(t,e,n){var r=pt(t),i=[it,et].indexOf(r)>=0?-1:1,o="function"==typeof n?n(Object.assign({},e,{placement:t})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[it,rt].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}(n,e.rects,i),t},{}),s=o[e.placement],a=s.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=s.x,e.modifiersData.popperOffsets.y+=a),e.modifiersData[n]=o}},{name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,s=n.altAxis,a=void 0===s||s,c=n.fallbackPlacements,l=n.padding,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,h=n.flipVariations,p=void 0===h||h,g=n.allowedAutoPlacements,v=e.options.placement,m=pt(v),y=c||(m!==v&&p?function(t){if("auto"===pt(t))return[];var e=It(t);return[Bt(t),e,Bt(e)]}(v):[It(v)]),b=[v].concat(y).reduce(function(t,n){return t.concat("auto"===pt(n)?Ut(e,{placement:n,boundary:u,rootBoundary:d,padding:l,flipVariations:p,allowedAutoPlacements:g}):n)},[]),w=e.rects.reference,E=e.rects.popper,x=new Map,O=!0,L=b[0],k=0;k<b.length;k++){var _=b[k],A=pt(_),C="start"===Dt(_),P=[et,nt].indexOf(A)>=0,S=P?"width":"height",D=Jt(e,{placement:_,boundary:u,rootBoundary:d,altBoundary:f,padding:l}),T=P?C?rt:it:C?nt:et;w[S]>E[S]&&(T=It(T));var j=It(T),M=[];if(o&&M.push(D[A]<=0),a&&M.push(D[T]<=0,D[j]<=0),M.every(function(t){return t})){L=_,O=!1;break}x.set(_,M)}if(O)for(var q=function(t){var e=b.find(function(e){var n=x.get(e);if(n)return n.slice(0,t).every(function(t){return t})});if(e)return L=e,"break"},I=p?3:1;I>0&&"break"!==q(I);I--);e.placement!==L&&(e.modifiersData[r]._skip=!0,e.placement=L,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=void 0===i||i,s=n.altAxis,a=void 0!==s&&s,c=n.tether,l=void 0===c||c,u=n.tetherOffset,d=void 0===u?0:u,f=Jt(e,{boundary:n.boundary,rootBoundary:n.rootBoundary,padding:n.padding,altBoundary:n.altBoundary}),h=pt(e.placement),p=Dt(e.placement),g=!p,v=At(h),m="x"===v?"y":"x",y=e.modifiersData.popperOffsets,b=e.rects.reference,w=e.rects.popper,E="function"==typeof d?d(Object.assign({},e.rects,{placement:e.placement})):d,x="number"==typeof E?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),O=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,L={x:0,y:0};if(y){if(o){var k,_="y"===v?et:it,A="y"===v?nt:rt,C="y"===v?"height":"width",P=y[v],S=P+f[_],D=P-f[A],T=l?-w[C]/2:0,j="start"===p?b[C]:w[C],M="start"===p?-w[C]:-b[C],q=e.elements.arrow,I=l&&q?bt(q):{width:0,height:0},F=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},B=F[_],V=F[A],K=Ct(0,b[C],I[C]),R=g?b[C]/2-T-K-B-x.mainAxis:j-K-B-x.mainAxis,W=g?-b[C]/2+T+K+V+x.mainAxis:M+K+V+x.mainAxis,H=e.elements.arrow&&_t(e.elements.arrow),N=null!=(k=null==O?void 0:O[v])?k:0,Q=P+W-N,z=Ct(l?vt(S,P+R-N-(H?"y"===v?H.clientTop||0:H.clientLeft||0:0)):S,P,l?gt(D,Q):D);y[v]=z,L[v]=z-P}if(a){var J,U=y[m],X="y"===m?"height":"width",Y=U+f["x"===v?et:it],Z=U-f["x"===v?nt:rt],G=-1!==[et,it].indexOf(h),$=null!=(J=null==O?void 0:O[m])?J:0,tt=G?Y:U-b[X]-w[X]-$+x.altAxis,ot=G?U+b[X]+w[X]-$-x.altAxis:Z,st=l&&G?function(t,e,n){var r=Ct(t,e,n);return r>n?n:r}(tt,U,ot):Ct(l?tt:Y,U,l?ot:Z);y[m]=st,L[m]=st-U}e.modifiersData[r]=L}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=pt(n.placement),c=At(a),l=[it,rt].indexOf(a)>=0?"height":"width";if(o&&s){var u=function(t,e){return Pt("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:St(t,ot))}(i.padding,n),d=bt(o),f="y"===c?et:it,h="y"===c?nt:rt,p=n.rects.reference[l]+n.rects.reference[c]-s[c]-n.rects.popper[l],g=s[c]-n.rects.reference[c],v=_t(o),m=v?"y"===c?v.clientHeight||0:v.clientWidth||0:0,y=m/2-d[l]/2+(p/2-g/2),b=Ct(u[f],y,m-d[l]-u[h]);n.modifiersData[r]=((e={})[c]=b,e.centerOffset=b-y,e)}},effect:function(t){var e=t.state,n=t.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=e.elements.popper.querySelector(r)))&&wt(e.elements.popper,r)&&(e.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=Jt(e,{elementContext:"reference"}),a=Jt(e,{altBoundary:!0}),c=Xt(s,r),l=Xt(a,i,o),u=Yt(c),d=Yt(l);e.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}}]});function re(t){var e;return t.target.classList.add(this.settings.stateActive),t.trigger.hasAttribute("aria-controls")&&t.trigger.setAttribute("aria-expanded","true"),t.config=Z(t.target,this.settings),t.popper.setOptions({placement:t.config.placement,modifiers:[{name:"eventListeners",enabled:!0}].concat((e=t.config,[{name:"offset",options:{offset:[0,parseInt(e.offset,10)]}},{name:"preventOverflow",options:{padding:G(e["overflow-padding"])}},{name:"flip",options:{padding:G(e["flip-padding"])}},{name:"arrow",options:{element:e["arrow-element"],padding:G(e["arrow-padding"])}}]))}),t.popper.update(),t.state="opened",t}function ie(t,e){this.deregister(e.id);var n=ne(t,e),r=this,i={open:function(){re.call(r,this)},close:function(){Q.call(r,this)},deregister:function(){oe.call(r,this)}},o=g({id:e.id,state:"closed",trigger:t,target:e,popper:n,config:Z(e,this.settings)},i);return se.call(this,o),o.target.classList.contains(this.settings.stateActive)?(o.open(),Y.call(this,o)):o.close(),this.collection.push(o),o}function oe(t){var e=this.collection.findIndex(function(e){return e.id===t.id});if(e>=0){var n=this.collection[e];"opened"===n.state&&n.close(),n.popper.destroy(),ae(n),Object.getOwnPropertyNames(n).forEach(function(t){delete n[t]}),this.collection.splice(e,1)}return this.collection}function se(t){return t.__eventListeners||("hover"===t.config.event?(t.__eventListeners=[{el:["trigger"],type:["mouseenter","focus"],listener:re.bind(this,t)},{el:["trigger","target"],type:["mouseleave","focusout"],listener:J.bind(this,t)}],t.__eventListeners.forEach(function(e){e.el.forEach(function(n){e.type.forEach(function(r){t[n].addEventListener(r,e.listener,!1)})})})):(t.__eventListeners=[{el:["trigger"],type:["click"],listener:U.bind(this,t)}],t.__eventListeners.forEach(function(e){e.el.forEach(function(n){e.type.forEach(function(r){t[n].addEventListener(r,e.listener,!1)})})}))),t}function ae(t){return t.__eventListeners&&(t.__eventListeners.forEach(function(e){e.el.forEach(function(n){e.type.forEach(function(r){t[n].removeEventListener(r,e.listener,!1)})})}),delete t.__eventListeners),t}var ce=/*#__PURE__*/function(t){var e,n;function r(e){var n;return(n=t.call(this)||this).defaults=N,n.settings=g({},n.defaults,e),n.memory={trigger:null},n.__handlerKeydown=X.bind(function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(n)),n.settings.autoInit&&n.init(),n}n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,v(e,n);var i=r.prototype;return i.init=function(t){void 0===t&&(t=null),t&&(this.settings=g({},this.settings,t));var e=document.querySelectorAll(this.settings.selectorPopover);this.registerCollection(e),this.settings.eventListeners&&this.initEventListeners(!1)},i.destroy=function(){this.deregisterCollection(),this.settings.eventListeners&&this.destroyEventListeners(!1)},i.initEventListeners=function(t){var e=this;void 0===t&&(t=!0),t&&this.collection.forEach(function(t){se.call(e,t)}),document.addEventListener("keydown",this.__handlerKeydown,!1)},i.destroyEventListeners=function(t){void 0===t&&(t=!0),t&&this.collection.forEach(function(t){ae(t)}),document.removeEventListener("keydown",this.__handlerKeydown,!1)},i.register=function(t){var e=tt.call(this,t);return!!e&&ie.call(this,e.trigger,e.target)},i.deregister=function(t){var e=this.get($(t));return!!e&&oe.call(this,e)},i.open=function(t){var e=this.get(t);return!!e&&e.open()},i.close=function(t){if(t){var e=this.get(t);return!!e&&e.close()}return z.call(this)},r}(H);export{y as Checkbox,T as Drawer,W as Modal,ce as Popover,p as core};
|
|
1
|
+
function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function t(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function n(){return(n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function r(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,i(e,t)}function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function o(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var s=0;function a(e){return"__private_"+s+++"_"+e}function c(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var l=/*#__PURE__*/a("handler"),u=/*#__PURE__*/function(){function e(e,t){Object.defineProperty(this,l,{writable:!0,value:void 0}),this.value=e,c(this,l)[l]=t,this.mql=null}var n=e.prototype;return n.mount=function(e,t){return e&&(this.value=e),t&&(c(this,l)[l]=t),this.value?(this.mql=window.matchMedia("(min-width: "+this.value+")"),"function"==typeof this.mql.addEventListener?this.mql.addEventListener("change",c(this,l)[l]):this.mql.addListener(c(this,l)[l]),c(this,l)[l](this.mql),this):this},n.unmount=function(){return this.mql?("function"==typeof this.mql.removeEventListener?this.mql.removeEventListener("change",c(this,l)[l]):this.mql.removeListener(c(this,l)[l]),this.value=null,c(this,l)[l]=null,this.mql=null,this):this},t(e,[{key:"handler",get:function(){return c(this,l)[l]},set:function(e){this.mql&&("function"==typeof this.mql.removeEventListener?this.mql.removeEventListener("change",c(this,l)[l]):this.mql.removeListener(c(this,l)[l])),c(this,l)[l]=e}}]),e}();function d(e,t,n){if(!e.s){if(n instanceof f){if(!n.s)return void(n.o=d.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(d.bind(null,e,t),d.bind(null,e,2));e.s=t,e.v=n;var r=e.o;r&&r(e)}}var f=/*#__PURE__*/function(){function e(){}return e.prototype.then=function(t,n){var r=new e,i=this.s;if(i){var o=1&i?t:n;if(o){try{d(r,1,o(this.v))}catch(e){d(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?d(r,1,t?t(i):i):n?d(r,1,n(i)):d(r,2,i)}catch(e){d(r,2,e)}},r},e}();function h(e){return e instanceof f&&1&e.s}var p=/*#__PURE__*/function(){function e(){this.collection=[]}var t=e.prototype;return t.register=function(e){try{var t=this;return Promise.resolve(t.deregister(e)).then(function(){return t.collection.push(e),t.collection})}catch(e){return Promise.reject(e)}},t.deregister=function(e){try{var t=this,n=t.collection.findIndex(function(t){return t===e});if(n>=0){var r=t.collection[n];Object.getOwnPropertyNames(r).forEach(function(e){delete r[e]}),t.collection.splice(n,1)}return Promise.resolve(t.collection)}catch(e){return Promise.reject(e)}},t.registerCollection=function(e){try{var t=this;return Promise.resolve(Promise.all(Array.from(e,function(e){t.register(e)}))).then(function(){return t.collection})}catch(e){return Promise.reject(e)}},t.deregisterCollection=function(){try{var e=function(){return t.collection},t=this,n=function(e,t,n){for(var r;;){var i=e();if(h(i)&&(i=i.v),!i)return o;if(i.then){r=0;break}var o=n();if(o&&o.then){if(!h(o)){r=1;break}o=o.s}}var s=new f,a=d.bind(null,s,2);return(0===r?i.then(l):1===r?o.then(c):(void 0).then(function(){(i=e())?i.then?i.then(l).then(void 0,a):l(i):d(s,1,o)})).then(void 0,a),s;function c(t){o=t;do{if(!(i=e())||h(i)&&!i.v)return void d(s,1,o);if(i.then)return void i.then(l).then(void 0,a);h(o=n())&&(o=o.v)}while(!o||!o.then);o.then(c).then(void 0,a)}function l(e){e?(o=n())&&o.then?o.then(c).then(void 0,a):c(o):d(s,1,o)}}(function(){return t.collection.length>0},0,function(){return Promise.resolve(t.deregister(t.collection[0])).then(function(){})});return Promise.resolve(n&&n.then?n.then(e):e())}catch(e){return Promise.reject(e)}},t.get=function(e,t){return void 0===t&&(t="id"),this.collection.find(function(n){return n[t]===e})},e}(),v=['a[href]:not([tabindex^="-"])','area[href]:not([tabindex^="-"])','input:not([type="hidden"]):not([type="radio"]):not([disabled]):not([tabindex^="-"])','input[type="radio"]:not([disabled]):not([tabindex^="-"])','select:not([disabled]):not([tabindex^="-"])','textarea:not([disabled]):not([tabindex^="-"])','button:not([disabled]):not([tabindex^="-"])','iframe:not([tabindex^="-"])','audio[controls]:not([tabindex^="-"])','video[controls]:not([tabindex^="-"])','[contenteditable]:not([tabindex^="-"])','[tabindex]:not([tabindex^="-"])'],g=/*#__PURE__*/a("focusable"),m=/*#__PURE__*/a("handleFocusTrap"),y=/*#__PURE__*/a("handleFocusLock"),b=/*#__PURE__*/function(){function e(e,t){void 0===e&&(e=null),void 0===t&&(t="[data-focus]"),Object.defineProperty(this,g,{writable:!0,value:void 0}),Object.defineProperty(this,m,{writable:!0,value:void 0}),Object.defineProperty(this,y,{writable:!0,value:void 0}),this.el=e,this.selectorFocus=t,c(this,m)[m]=w.bind(this),c(this,y)[y]=E.bind(this)}var n=e.prototype;return n.mount=function(e,t){e&&(this.el=e),t&&(this.selectorFocus=t),this.focusable=this.getFocusable(),this.focus()},n.unmount=function(){this.el=null,this.focusable=[],document.removeEventListener("keydown",c(this,m)[m]),document.removeEventListener("keydown",c(this,y)[y])},n.focus=function(e,t){void 0===e&&(e=this.el),void 0===t&&(t=this.selectorFocus),(e.querySelector(t)||e).focus()},n.getFocusable=function(e){void 0===e&&(e=this.el);var t=[],n=document.activeElement,r=e.scrollTop;return e.querySelectorAll(v.join(",")).forEach(function(e){e.focus(),document.activeElement===e&&t.push(e)}),e.scrollTop=r,n.focus(),t},t(e,[{key:"focusable",get:function(){return c(this,g)[g]},set:function(e){c(this,g)[g]=e,c(this,g)[g].length?(document.removeEventListener("keydown",c(this,y)[y]),document.addEventListener("keydown",c(this,m)[m])):(document.removeEventListener("keydown",c(this,m)[m]),document.addEventListener("keydown",c(this,y)[y]))}},{key:"focusableFirst",get:function(){return this.focusable[0]}},{key:"focusableLast",get:function(){return this.focusable[this.focusable.length-1]}}]),e}();function w(e){("Tab"===e.key||9===e.keyCode)&&(e.shiftKey?document.activeElement!==this.focusableFirst&&document.activeElement!==this.el||(e.preventDefault(),this.focusableLast.focus()):document.activeElement!==this.focusableLast&&document.activeElement!==this.el||(e.preventDefault(),this.focusableFirst.focus()))}function E(e){("Tab"===e.key||9===e.keyCode)&&e.preventDefault()}function P(e,t){var n=(e.getAttribute("data-"+t)||"").replace(/'/g,'"');return n?JSON.parse(n):{}}function x(e,t){function n(t){localStorage.setItem(e,JSON.stringify(t))}return void 0===t&&(t=!0),new Proxy((r=localStorage.getItem(e))?JSON.parse(r):{},{set:function(e,r,i){return e[r]=i,t&&n(e),!0},deleteProperty:function(e,r){return delete e[r],t&&n(e),!0}});var r}function O(e,t,n){var r=t.nodeType===Node.COMMENT_NODE,i=t.nodeType===Node.ELEMENT_NODE;if(r&&(n="after"),!(t=r||i?t:document.querySelector(t)))throw new Error("Not a valid teleport reference: '"+t+"'");if("function"!=typeof t[n])throw new Error("Not a valid teleport method: '"+n+"'");var o=null;return r||(o=document.createComment("teleported #"+e.id),e.before(o)),t[n](e),r&&t.remove(),o}var L=function(e,t){return new Promise(function(n){t.transition?(e.classList.remove(t.stateClosed),e.classList.add(t.stateOpening),e.addEventListener("transitionend",function r(){e.classList.add(t.stateOpened),e.classList.remove(t.stateOpening),n(e),this.removeEventListener("transitionend",r)})):(e.classList.add(t.stateOpened),e.classList.remove(t.stateClosed),n(e))})},k=function(e,t){return new Promise(function(n){t.transition?(e.classList.add(t.stateClosing),e.classList.remove(t.stateOpened),e.addEventListener("transitionend",function r(){e.classList.remove(t.stateClosing),e.classList.add(t.stateClosed),n(e),this.removeEventListener("transitionend",r)})):(e.classList.add(t.stateClosed),e.classList.remove(t.stateOpened),n(e))})};function A(e,t){var n,r;n=!!e,(r=t.selectorInert)&&document.querySelectorAll(r).forEach(function(e){n?(e.inert=!0,e.setAttribute("aria-hidden",!0)):(e.inert=null,e.removeAttribute("aria-hidden"))}),function(e,t){t&&document.querySelectorAll(t).forEach(function(t){e?t.style.overflow="hidden":t.style.removeProperty("overflow")})}(!!e,t.selectorOverflow)}var j={__proto__:null,Breakpoint:u,Collection:p,FocusTrap:b,getConfig:P,getPrefix:function(){return getComputedStyle(document.body).getPropertyValue("--vrembem-variable-prefix").trim()},localStore:x,teleport:O,openTransition:L,closeTransition:k,updateGlobalState:A},C={autoInit:!1,stateAttr:"aria-checked",stateValue:"mixed"},S=/*#__PURE__*/function(){function e(e){this.defaults=C,this.settings=n({},this.defaults,e),this.__handlerClick=this.handlerClick.bind(this),this.settings.autoInit&&this.init()}var t=e.prototype;return t.init=function(e){void 0===e&&(e=null),e&&(this.settings=n({},this.settings,e));var t=document.querySelectorAll("["+this.settings.stateAttr+'="'+this.settings.stateValue+'"]');this.setIndeterminate(t),document.addEventListener("click",this.__handlerClick,!1)},t.destroy=function(){document.removeEventListener("click",this.__handlerClick,!1)},t.handlerClick=function(e){var t=e.target.closest("["+this.settings.stateAttr+'="'+this.settings.stateValue+'"]');t&&(this.removeAriaState(t),this.setIndeterminate(t))},t.setAriaState=function(e,t){var n=this;void 0===t&&(t=this.settings.stateValue),(e=e.forEach?e:[e]).forEach(function(e){e.setAttribute(n.settings.stateAttr,t)})},t.removeAriaState=function(e){var t=this;(e=e.forEach?e:[e]).forEach(function(e){e.removeAttribute(t.settings.stateAttr)})},t.setIndeterminate=function(e){var t=this;(e=e.forEach?e:[e]).forEach(function(e){e.indeterminate=!!e.hasAttribute(t.settings.stateAttr)})},e}(),D={autoInit:!1,dataOpen:"drawer-open",dataClose:"drawer-close",dataToggle:"drawer-toggle",dataBreakpoint:"drawer-breakpoint",dataConfig:"drawer-config",selectorDrawer:".drawer",selectorDialog:".drawer__dialog",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};function T(e){var t=this,n=e.target.closest("\n [data-"+this.settings.dataOpen+"],\n [data-"+this.settings.dataToggle+"],\n [data-"+this.settings.dataClose+"]\n ");n?(e.preventDefault(),n.matches("[data-"+this.settings.dataToggle+"]")&&n.getAttribute("data-"+this.settings.dataToggle).trim().split(" ").forEach(function(e){var r=t.get(e);r.trigger=n,r.toggle()}),n.matches("[data-"+this.settings.dataOpen+"]")&&n.getAttribute("data-"+this.settings.dataOpen).trim().split(" ").forEach(function(e){var r=t.get(e);r.trigger=n,r.open()}),n.matches("[data-"+this.settings.dataClose+"]")&&n.getAttribute("data-"+this.settings.dataClose).trim().split(" ").forEach(function(r){if(r){var i=t.get(r);i.trigger=n,i.close()}else{var o=e.target.closest(t.settings.selectorDrawer);o&&t.close(o)}})):e.target.matches(this.settings.selectorDrawer)&&this.close(e.target.id)}function _(e){if("Escape"===e.key){var t=this.activeModal;t&&this.close(t)}}var q=function(e,t){void 0===t&&(t=!0);try{var n=function(){return r.collection},r=this;if(!e)return Promise.resolve(r.collection);var i=r.collection.findIndex(function(t){return t.id===e.id}),o=function(){if(i>=0){var e=function(){delete r.store[n.id],n.unmountBreakpoint(),Object.getOwnPropertyNames(n).forEach(function(e){delete n[e]}),r.collection.splice(i,1)},n=r.collection[i],o=function(){if(t&&"opened"===n.state)return Promise.resolve(n.close(!1)).then(function(){})}();return o&&o.then?o.then(e):e()}}();return Promise.resolve(o&&o.then?o.then(n):n())}catch(e){return Promise.reject(e)}};function I(){return getComputedStyle(document.body).getPropertyValue("--vrembem-variable-prefix").trim()}function M(e){var t=I(),n=e.getAttribute("data-"+this.settings.dataBreakpoint);return this.settings.breakpoints&&this.settings.breakpoints[n]?this.settings.breakpoints[n]:getComputedStyle(document.body).getPropertyValue("--"+t+"breakpoint-"+n).trim()?getComputedStyle(document.body).getPropertyValue("--"+t+"breakpoint-"+n).trim():n}function R(e){var t=this.get("string"==typeof e?e:e.id);if(t)return t;throw new Error('Drawer not found in collection with id of "'+(e.id||e)+'".')}function N(e){return"string"==typeof e?e:"function"==typeof e.hasAttribute?e.hasAttribute("data-"+this.settings.dataOpen)?e.getAttribute("data-"+this.settings.dataOpen):e.hasAttribute("data-"+this.settings.dataClose)?e.getAttribute("data-"+this.settings.dataClose)||!1:e.hasAttribute("data-"+this.settings.dataToggle)?e.getAttribute("data-"+this.settings.dataToggle):e.closest(this.settings.selectorDrawer)&&(e=e.closest(this.settings.selectorDrawer)).id||!1:!!e.id&&e.id}function B(e){var t=N.call(this,e);if(t){var n=document.querySelector("#"+t),r=n?n.querySelector(this.settings.selectorDialog):null;return n||r?r?{drawer:n,dialog:r}:{error:new Error("Drawer is missing dialog element.")}:{error:new Error('No drawer elements found using the ID: "'+t+'".')}}return{error:new Error("Could not resolve the drawer ID.")}}var F=function(e){try{var t=this,n=function(){if(t.store[e.id]){var n="opened"===t.store[e.id]?Promise.resolve(e.open(!1,!1)).then(function(){}):Promise.resolve(e.close(!1,!1)).then(function(){});if(n&&n.then)return n.then(function(){})}else e.el.classList.contains(t.settings.stateOpened)?e.state="opened":(e.el.classList.remove(t.settings.stateOpening),e.el.classList.remove(t.settings.stateClosing),e.el.classList.add(t.settings.stateClosed))}();return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}};function V(e){"opened"===e.state?"modal"===e.mode?this.focusTrap.mount(e.dialog,this.settings.selectorFocus):this.focusTrap.focus(e.dialog,this.settings.selectorFocus):(e.trigger&&(e.trigger.focus(),e.trigger=null),this.focusTrap.unmount())}var W=function(e,t,r){void 0===r&&(r=!0);try{var i=function(){return r&&V.call(o,s),s.el.dispatchEvent(new CustomEvent(a.customEventPrefix+"opened",{detail:o,bubbles:!0})),s},o=this,s=R.call(o,e),a=n({},o.settings,s.settings);void 0!==t&&(a.transition=t);var c=function(){if("closed"===s.state)return s.state="opening",Promise.resolve(L(s.el,a)).then(function(){"modal"===s.mode&&A(!0,a),s.state="opened"})}();return Promise.resolve(c&&c.then?c.then(i):i())}catch(e){return Promise.reject(e)}},H=function(e,t,r){void 0===r&&(r=!0);try{var i=this,o=R.call(i,e),s=n({},i.settings,o.settings);void 0!==t&&(s.transition=t);var a=function(){if("opened"===o.state)return o.state="closing",document.activeElement.blur(),Promise.resolve(k(o.el,s)).then(function(){"modal"===o.mode&&A(!1,s),r&&V.call(i,o),o.state="closed",o.el.dispatchEvent(new CustomEvent(s.customEventPrefix+"closed",{detail:i,bubbles:!0}))})}();return Promise.resolve(a&&a.then?a.then(function(){return o}):o)}catch(e){return Promise.reject(e)}},z=function(e,t,n){try{var r=this,i=R.call(r,e);return Promise.resolve("closed"===i.state?W.call(r,i,t,n):H.call(r,i,t,n))}catch(e){return Promise.reject(e)}},K=function(e){try{var t=this;return e.el.classList.add(e.getSetting("classModal")),e.dialog.setAttribute("aria-modal","true"),!t.store[e.id]&&e.el.classList.contains(e.getSetting("stateOpened"))&&(t.store[e.id]="opened"),Promise.resolve(H.call(t,e,!1,!1)).then(function(){return e.el.dispatchEvent(new CustomEvent(e.getSetting("customEventPrefix")+"switchMode",{detail:t,bubbles:!0})),e})}catch(e){return Promise.reject(e)}},U=function(e){try{var t=this;return e.el.classList.remove(e.getSetting("classModal")),e.dialog.removeAttribute("aria-modal"),A(!1,n({},t.settings,e.settings)),t.focusTrap.unmount(),Promise.resolve(F.call(t,e)).then(function(){return e.el.dispatchEvent(new CustomEvent(e.getSetting("customEventPrefix")+"switchMode",{detail:t,bubbles:!0})),e})}catch(e){return Promise.reject(e)}};function J(e){switch(e.mode){case"inline":return U.call(this,e);case"modal":return K.call(this,e);default:throw new Error('"'+e.mode+'" is not a valid drawer mode.')}}var X=function(e,t){try{var r=this;return Promise.resolve(q.call(r,e,!1)).then(function(){var i=r,o=new u,s={open:function(e,t){return W.call(i,this,e,t)},close:function(e,t){return H.call(i,this,e,t)},toggle:function(e,t){return z.call(i,this,e,t)},deregister:function(){return q.call(i,this)},mountBreakpoint:function(){var e=this.breakpoint,t=this.handleBreakpoint.bind(this);return o.mount(e,t),this},unmountBreakpoint:function(){return o.unmount(),this},handleBreakpoint:function(e){return this.mode=e.matches?"inline":"modal",this},getSetting:function(e){return e in this.settings?this.settings[e]:i.settings[e]}},a=n({id:e.id,el:e,dialog:t,trigger:null,settings:P(e,r.settings.dataConfig),get breakpoint(){return M.call(i,e)},get state(){return c},set state(e){c=e,"opened"!==e&&"closed"!==e||"inline"===this.mode&&(i.store[this.id]=this.state)},get mode(){return l},set mode(e){l=e,J.call(i,this)}},s),c=e.classList.contains(a.getSetting("stateOpened"))?"opened":"closed",l=e.classList.contains(a.getSetting("classModal"))?"modal":"inline";"modal"===a.mode?a.dialog.setAttribute("aria-modal","true"):a.dialog.removeAttribute("aria-modal"),a.getSetting("setTabindex")&&a.dialog.setAttribute("tabindex","-1"),r.collection.push(a);var d=function(){if(!a.breakpoint)return Promise.resolve(F.call(r,a)).then(function(){});a.mountBreakpoint()}();return d&&d.then?d.then(function(){return a}):a})}catch(e){return Promise.reject(e)}},Y=/*#__PURE__*/a("handleClick"),G=/*#__PURE__*/a("handleKeydown"),Q=/*#__PURE__*/function(e){function i(t){var r;return r=e.call(this)||this,Object.defineProperty(o(r),Y,{writable:!0,value:void 0}),Object.defineProperty(o(r),G,{writable:!0,value:void 0}),r.defaults=D,r.settings=n({},r.defaults,t),r.focusTrap=new b,r.store=x(r.settings.storeKey,r.settings.store),c(o(r),Y)[Y]=T.bind(o(r)),c(o(r),G)[G]=_.bind(o(r)),r.settings.autoInit&&r.init(),r}r(i,e);var s=i.prototype;return s.init=function(e){void 0===e&&(e=null);try{var t=this;e&&(t.settings=n({},t.settings,e));var r=document.querySelectorAll(t.settings.selectorDrawer);return Promise.resolve(t.registerCollection(r)).then(function(){return t.settings.eventListeners&&t.initEventListeners(),t})}catch(e){return Promise.reject(e)}},s.destroy=function(){try{var e=this;return Promise.resolve(e.deregisterCollection()).then(function(){return e.settings.eventListeners&&e.destroyEventListeners(),e})}catch(e){return Promise.reject(e)}},s.initEventListeners=function(){document.addEventListener("click",c(this,Y)[Y],!1),document.addEventListener("touchend",c(this,Y)[Y],!1),document.addEventListener("keydown",c(this,G)[G],!1)},s.destroyEventListeners=function(){document.removeEventListener("click",c(this,Y)[Y],!1),document.removeEventListener("touchend",c(this,Y)[Y],!1),document.removeEventListener("keydown",c(this,G)[G],!1)},s.register=function(e){var t=B.call(this,e);return t.error?Promise.reject(t.error):X.call(this,t.drawer,t.dialog)},s.deregister=function(e){var t=this.get(N.call(this,e));return q.call(this,t)},s.open=function(e,t,n){return W.call(this,e,t,n)},s.close=function(e,t,n){return H.call(this,e,t,n)},s.toggle=function(e,t,n){return z.call(this,e,t,n)},t(i,[{key:"activeModal",get:function(){return this.collection.find(function(e){return"opened"===e.state&&"modal"===e.mode})}}]),i}(p),Z={autoInit:!1,dataOpen:"modal-open",dataClose:"modal-close",dataReplace:"modal-replace",dataConfig:"modal-config",selectorModal:".modal",selectorDialog:".modal__dialog",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};function $(e){var t=this.get("string"==typeof e?e:e.id);if(t)return t;throw new Error('Modal not found in collection with id of "'+(e.id||e)+'".')}function ee(e){return"string"==typeof e?e:"function"==typeof e.hasAttribute?e.hasAttribute("data-"+this.settings.dataOpen)?e.getAttribute("data-"+this.settings.dataOpen):e.hasAttribute("data-"+this.settings.dataClose)?e.getAttribute("data-"+this.settings.dataClose)||!1:e.hasAttribute("data-"+this.settings.dataReplace)?e.getAttribute("data-"+this.settings.dataReplace):e.closest(this.settings.selectorModal)&&(e=e.closest(this.settings.selectorModal)).id||!1:!!e.id&&e.id}function te(e){var t=ee.call(this,e);if(t){var n=document.querySelector("#"+t),r=n?n.querySelector(this.settings.selectorDialog):null;return n||r?r?{modal:n,dialog:r}:{error:new Error("Modal is missing dialog element.")}:{error:new Error('No modal elements found using the ID: "'+t+'".')}}return{error:new Error("Could not resolve the modal ID.")}}function ne(){this.active?this.focusTrap.mount(this.active.dialog,this.settings.selectorFocus):(this.trigger&&(this.trigger.focus(),this.trigger=null),this.focusTrap.unmount())}var re=function(e){try{var t=this,n=e.target.closest("[data-"+t.settings.dataOpen+"], [data-"+t.settings.dataReplace+"]");if(n){e.preventDefault(),e.target.closest(t.settings.selectorModal)||(t.trigger=n);var r=t.get(ee.call(t,n));return Promise.resolve(n.matches("[data-"+t.settings.dataOpen+"]")?r.open():r.replace())}if(n=e.target.closest("[data-"+t.settings.dataClose+"]")){e.preventDefault();var i=n.getAttribute("data-"+t.settings.dataClose);return Promise.resolve("*"===i?t.closeAll():t.close(i))}return e.target.matches(t.settings.selectorModal)&&!e.target.querySelector(t.settings.selectorRequired)?Promise.resolve(t.close(ee.call(t,e.target))):Promise.resolve()}catch(e){return Promise.reject(e)}};function ie(e){if("Escape"===e.key&&this.active&&!this.active.dialog.matches(this.settings.selectorRequired))return this.close()}var oe=function(e,t){void 0===t&&(t=!0);try{var n=function(){return r.collection},r=this;if(!e)return Promise.resolve(r.collection);var i=r.collection.findIndex(function(t){return t.id===e.id}),o=function(){if(i>=0){var e=function(){n.getSetting("teleport")&&n.teleportReturn(),Object.getOwnPropertyNames(n).forEach(function(e){delete n[e]}),r.collection.splice(i,1)},n=r.collection[i],o=function(){if(t&&"opened"===n.state)return Promise.resolve(n.close(!1)).then(function(){});var e=r.stack.findIndex(function(e){return e.id===n.id});e>=0&&r.stack.splice(e,1)}();return o&&o.then?o.then(e):e()}}();return Promise.resolve(o&&o.then?o.then(n):n())}catch(e){return Promise.reject(e)}},se=function(e,t,r){void 0===r&&(r=!0);try{var i=function(){return r&&ne.call(o),s.el.dispatchEvent(new CustomEvent(a.customEventPrefix+"opened",{detail:o,bubbles:!0})),s},o=this,s=$.call(o,e),a=n({},o.settings,s.settings);void 0!==t&&(a.transition=t);var c=o.stack.findIndex(function(e){return e.id===s.id});c>=0&&(o.stack.splice(c,1),o.stack.push(s));var l=function(){if("closed"===s.state){s.state="opening",s.el.style.zIndex=null;var e=getComputedStyle(s.el)["z-index"];return s.el.style.zIndex=parseInt(e)+o.stack.length+1,o.stack.push(s),Promise.resolve(L(s.el,a)).then(function(){s.state="opened"})}}();return Promise.resolve(l&&l.then?l.then(i):i())}catch(e){return Promise.reject(e)}},ae=function(e,t,r){void 0===r&&(r=!0);try{var i=this,o=e?$.call(i,e):i.active,s=function(){if(o&&"opened"===o.state){o.state="closing";var e=n({},i.settings,o.settings);return void 0!==t&&(e.transition=t),document.activeElement.blur(),Promise.resolve(k(o.el,e)).then(function(){o.el.style.zIndex=null;var t=i.stack.findIndex(function(e){return e.id===o.id});i.stack.splice(t,1),r&&ne.call(i),o.state="closed",o.el.dispatchEvent(new CustomEvent(e.customEventPrefix+"closed",{detail:i,bubbles:!0}))})}}();return Promise.resolve(s&&s.then?s.then(function(){return o}):o)}catch(e){return Promise.reject(e)}},ce=function(e,t){try{var n=this,r=[];return Promise.resolve(Promise.all(n.stack.map(function(i){try{var o=function(){i.trigger=null},s=function(){if(!e||e!==i.id){var o=r.push;return Promise.resolve(ae.call(n,i,t,!1)).then(function(e){o.call(r,e)})}Promise.resolve()}();return Promise.resolve(s&&s.then?s.then(o):o())}catch(e){return Promise.reject(e)}}))).then(function(){return r})}catch(e){return Promise.reject(e)}},le=function(e,t,n){void 0===n&&(n=!0);try{var r,i,o=function(){return n&&ne.call(s),{opened:r,closed:i}},s=this,a=$.call(s,e),c="opened"===a.state?(r=a,Promise.resolve(ce.call(s,a.id,t)).then(function(e){i=e})):(r=se.call(s,a,t,!1),i=ce.call(s,!1,t),Promise.resolve(Promise.all([r,i])).then(function(){}));return Promise.resolve(c&&c.then?c.then(o):o())}catch(e){return Promise.reject(e)}},ue=function(e,t){try{var r=this;return Promise.resolve(oe.call(r,e,!1)).then(function(){var i=r,o={open:function(e,t){return se.call(i,this,e,t)},close:function(e,t){return ae.call(i,this,e,t)},replace:function(e,t){return le.call(i,this,e,t)},deregister:function(){return oe.call(i,this)},teleport:function(e,t){return void 0===e&&(e=this.getSetting("teleport")),void 0===t&&(t=this.getSetting("teleportMethod")),this.returnRef?(console.error("Element has already been teleported:",this.el),!1):(this.returnRef=O(this.el,e,t),this.el)},teleportReturn:function(){return this.returnRef?(this.returnRef=O(this.el,this.returnRef),this.el):(console.error("No return reference found:",this.el),!1)},getSetting:function(e){return e in this.settings?this.settings[e]:i.settings[e]}},s=n({id:e.id,state:"closed",el:e,dialog:t,returnRef:null,settings:P(e,r.settings.dataConfig)},o);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(),r.collection.push(s);var a=function(){if(s.el.classList.contains(r.settings.stateOpened))return Promise.resolve(s.open(!1)).then(function(){});s.el.classList.remove(r.settings.stateOpening),s.el.classList.remove(r.settings.stateClosing),s.el.classList.add(r.settings.stateClosed)}();return a&&a.then?a.then(function(){return s}):s})}catch(e){return Promise.reject(e)}},de=/*#__PURE__*/a("handleClick"),fe=/*#__PURE__*/a("handleKeydown"),he=/*#__PURE__*/function(e){function i(t){var r;return r=e.call(this)||this,Object.defineProperty(o(r),de,{writable:!0,value:void 0}),Object.defineProperty(o(r),fe,{writable:!0,value:void 0}),r.defaults=Z,r.settings=n({},r.defaults,t),r.trigger=null,r.focusTrap=new b,r.stack=new Proxy([],{set:function(e,t,n){return e[t]=n,"length"===t&&(A(r.active,r.settings),r.stack.forEach(function(e,t){e.el.style.zIndex=null;var n=getComputedStyle(e.el)["z-index"];e.el.style.zIndex=parseInt(n)+t+1})),!0}}),c(o(r),de)[de]=re.bind(o(r)),c(o(r),fe)[fe]=ie.bind(o(r)),r.settings.autoInit&&r.init(),r}r(i,e);var s=i.prototype;return s.init=function(e){try{var t=this;e&&(t.settings=n({},t.settings,e));var r=document.querySelectorAll(t.settings.selectorModal);return Promise.resolve(t.registerCollection(r)).then(function(){return t.settings.eventListeners&&t.initEventListeners(),t})}catch(e){return Promise.reject(e)}},s.destroy=function(){try{var e=this;return e.trigger=null,Promise.resolve(e.deregisterCollection()).then(function(){return e.settings.eventListeners&&e.destroyEventListeners(),e})}catch(e){return Promise.reject(e)}},s.initEventListeners=function(){document.addEventListener("click",c(this,de)[de],!1),document.addEventListener("touchend",c(this,de)[de],!1),document.addEventListener("keydown",c(this,fe)[fe],!1)},s.destroyEventListeners=function(){document.removeEventListener("click",c(this,de)[de],!1),document.removeEventListener("touchend",c(this,de)[de],!1),document.removeEventListener("keydown",c(this,fe)[fe],!1)},s.register=function(e){var t=te.call(this,e);return t.error?Promise.reject(t.error):ue.call(this,t.modal,t.dialog)},s.deregister=function(e){var t=this.get(ee.call(this,e));return oe.call(this,t)},s.open=function(e,t,n){return se.call(this,e,t,n)},s.close=function(e,t,n){return ae.call(this,e,t,n)},s.replace=function(e,t,n){return le.call(this,e,t,n)},s.closeAll=function(e,t,n){void 0===e&&(e=!1),void 0===n&&(n=!0);try{var r=this;return Promise.resolve(ce.call(r,e,t)).then(function(e){return n&&ne.call(r),e})}catch(e){return Promise.reject(e)}},t(i,[{key:"active",get:function(){return this.stack[this.stack.length-1]}}]),i}(p),pe={autoInit:!1,selectorPopover:".popover",selectorArrow:".popover__arrow",stateActive:"is-active",eventListeners:!0,eventType:"click",placement:"bottom"};function ve(e,t){var n=getComputedStyle(e),r={placement:t.placement,event:t.eventType,offset:0,"overflow-padding":0,"flip-padding":0,"arrow-element":t.selectorArrow,"arrow-padding":0};for(var i in r){var o=I(),s=n.getPropertyValue("--"+o+"popover-"+i).trim();s&&(r[i]=s)}return r}function ge(e){var t,n="string"==typeof e?e.trim().split(" "):[e];switch(n.forEach(function(e,t){n[t]=parseInt(e,10)}),n.length){case 1:t=n[0];break;case 2:t={top:n[0],right:n[1],bottom:n[0],left:n[1]};break;case 3:t={top:n[0],right:n[1],bottom:n[2],left:n[1]};break;case 4:t={top:n[0],right:n[1],bottom:n[2],left:n[3]};break;default:t=!1}return t}function me(e){var t=this.get("string"==typeof e?e:e.id);if(t)return t;throw new Error('Popover not found in collection with id of "'+e+'".')}function ye(e){return"string"==typeof e?e:"function"==typeof e.hasAttribute?e.closest(this.settings.selectorPopover)?(e=e.closest(this.settings.selectorPopover)).id:e.hasAttribute("aria-controls")?e.getAttribute("aria-controls"):!!e.hasAttribute("aria-describedby")&&e.getAttribute("aria-describedby"):!!e.id&&e.id}function be(e){var t=ye.call(this,e);if(t){var n=document.querySelector("#"+t),r=document.querySelector('[aria-controls="'+t+'"]')||document.querySelector('[aria-describedby="'+t+'"]');return r||n?r?n?{popover:n,trigger:r}:{error:new Error("No popover associated with the provided popover trigger.")}:{error:new Error("No popover trigger associated with the provided popover.")}:{error:new Error('No popover elements found using the ID: "'+t+'".')}}return{error:new Error("Could not resolve the popover ID.")}}var we=function(){try{var e=this,t=[];return Promise.resolve(Promise.all(e.collection.map(function(n){try{var r=function(){if("opened"===n.state){var r=t.push;return Promise.resolve(Ee.call(e,n)).then(function(e){r.call(t,e)})}}();return Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}))).then(function(){return t})}catch(e){return Promise.reject(e)}},Ee=function(e){try{var t=function(e){return e&&"opened"===e.state&&(e.el.classList.remove(n.settings.stateActive),e.trigger.hasAttribute("aria-controls")&&e.trigger.setAttribute("aria-expanded","false"),e.popper.setOptions({modifiers:[{name:"eventListeners",enabled:!1}]}),e.state="closed",e.trigger===n.trigger&&(n.trigger=null)),e},n=this;return Promise.resolve(e?t(me.call(n,e)):Promise.resolve(we.call(n)).then(t))}catch(e){return Promise.reject(e)}};function Pe(e){"opened"==e.state&&setTimeout(function(){var t=e.el.closest(":hover")===e.el||e.trigger.closest(":hover")===e.trigger,n=document.activeElement.closest("#"+e.id+', [aria-controls="'+e.id+'"]');return t||n||e.close(),e},1)}function xe(e){"opened"===e.state?e.close():(this.trigger=e.trigger,e.open(),Le.call(this,e))}function Oe(e){var t=this;switch(e.key){case"Escape":return this.trigger&&this.trigger.focus(),void we.call(this);case"Tab":return void this.collection.forEach(function(e){Pe.call(t,e)});default:return}}function Le(e){var t=this;document.addEventListener("click",function n(r){r.target.closest("#"+e.id+', [aria-controls="'+e.id+'"]')?e.el&&!e.el.classList.contains(t.settings.stateActive)&&this.removeEventListener("click",n):(e.el&&e.el.classList.contains(t.settings.stateActive)&&e.close(),this.removeEventListener("click",n))})}var ke="top",Ae="bottom",je="right",Ce="left",Se=[ke,Ae,je,Ce],De=/*#__PURE__*/Se.reduce(function(e,t){return e.concat([t+"-start",t+"-end"])},[]),Te=/*#__PURE__*/[].concat(Se,["auto"]).reduce(function(e,t){return e.concat([t,t+"-start",t+"-end"])},[]),_e=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function qe(e){return e?(e.nodeName||"").toLowerCase():null}function Ie(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Me(e){return e instanceof Ie(e).Element||e instanceof Element}function Re(e){return e instanceof Ie(e).HTMLElement||e instanceof HTMLElement}function Ne(e){return"undefined"!=typeof ShadowRoot&&(e instanceof Ie(e).ShadowRoot||e instanceof ShadowRoot)}function Be(e){return e.split("-")[0]}var Fe=Math.max,Ve=Math.min,We=Math.round;function He(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect(),r=1,i=1;if(Re(e)&&t){var o=e.offsetHeight,s=e.offsetWidth;s>0&&(r=We(n.width)/s||1),o>0&&(i=We(n.height)/o||1)}return{width:n.width/r,height:n.height/i,top:n.top/i,right:n.right/r,bottom:n.bottom/i,left:n.left/r,x:n.left/r,y:n.top/i}}function ze(e){var t=He(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function Ke(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Ne(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Ue(e){return Ie(e).getComputedStyle(e)}function Je(e){return["table","td","th"].indexOf(qe(e))>=0}function Xe(e){return((Me(e)?e.ownerDocument:e.document)||window.document).documentElement}function Ye(e){return"html"===qe(e)?e:e.assignedSlot||e.parentNode||(Ne(e)?e.host:null)||Xe(e)}function Ge(e){return Re(e)&&"fixed"!==Ue(e).position?e.offsetParent:null}function Qe(e){for(var t=Ie(e),n=Ge(e);n&&Je(n)&&"static"===Ue(n).position;)n=Ge(n);return n&&("html"===qe(n)||"body"===qe(n)&&"static"===Ue(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&Re(e)&&"fixed"===Ue(e).position)return null;var n=Ye(e);for(Ne(n)&&(n=n.host);Re(n)&&["html","body"].indexOf(qe(n))<0;){var r=Ue(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}function Ze(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function $e(e,t,n){return Fe(e,Ve(t,n))}function et(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function tt(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}function nt(e){return e.split("-")[1]}var rt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function it(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,s=e.offsets,a=e.position,c=e.gpuAcceleration,l=e.adaptive,u=e.roundOffsets,d=e.isFixed,f=s.x,h=void 0===f?0:f,p=s.y,v=void 0===p?0:p,g="function"==typeof u?u({x:h,y:v}):{x:h,y:v};h=g.x,v=g.y;var m=s.hasOwnProperty("x"),y=s.hasOwnProperty("y"),b=Ce,w=ke,E=window;if(l){var P=Qe(n),x="clientHeight",O="clientWidth";P===Ie(n)&&"static"!==Ue(P=Xe(n)).position&&"absolute"===a&&(x="scrollHeight",O="scrollWidth"),P=P,(i===ke||(i===Ce||i===je)&&"end"===o)&&(w=Ae,v-=(d&&P===E&&E.visualViewport?E.visualViewport.height:P[x])-r.height,v*=c?1:-1),i!==Ce&&(i!==ke&&i!==Ae||"end"!==o)||(b=je,h-=(d&&P===E&&E.visualViewport?E.visualViewport.width:P[O])-r.width,h*=c?1:-1)}var L,k=Object.assign({position:a},l&&rt),A=!0===u?function(e){var t=e.y,n=window.devicePixelRatio||1;return{x:We(e.x*n)/n||0,y:We(t*n)/n||0}}({x:h,y:v}):{x:h,y:v};return h=A.x,v=A.y,Object.assign({},k,c?((L={})[w]=y?"0":"",L[b]=m?"0":"",L.transform=(E.devicePixelRatio||1)<=1?"translate("+h+"px, "+v+"px)":"translate3d("+h+"px, "+v+"px, 0)",L):((t={})[w]=y?v+"px":"",t[b]=m?h+"px":"",t.transform="",t))}var ot={passive:!0},st={left:"right",right:"left",bottom:"top",top:"bottom"};function at(e){return e.replace(/left|right|bottom|top/g,function(e){return st[e]})}var ct={start:"end",end:"start"};function lt(e){return e.replace(/start|end/g,function(e){return ct[e]})}function ut(e){var t=Ie(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function dt(e){return He(Xe(e)).left+ut(e).scrollLeft}function ft(e){var t=Ue(e);return/auto|scroll|overlay|hidden/.test(t.overflow+t.overflowY+t.overflowX)}function ht(e){return["html","body","#document"].indexOf(qe(e))>=0?e.ownerDocument.body:Re(e)&&ft(e)?e:ht(Ye(e))}function pt(e,t){var n;void 0===t&&(t=[]);var r=ht(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=Ie(r),s=i?[o].concat(o.visualViewport||[],ft(r)?r:[]):r,a=t.concat(s);return i?a:a.concat(pt(Ye(s)))}function vt(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function gt(e,t){return"viewport"===t?vt(function(e){var t=Ie(e),n=Xe(e),r=t.visualViewport,i=n.clientWidth,o=n.clientHeight,s=0,a=0;return r&&(i=r.width,o=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=r.offsetLeft,a=r.offsetTop)),{width:i,height:o,x:s+dt(e),y:a}}(e)):Me(t)?function(e){var t=He(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):vt(function(e){var t,n=Xe(e),r=ut(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=Fe(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Fe(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+dt(e),c=-r.scrollTop;return"rtl"===Ue(i||n).direction&&(a+=Fe(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:c}}(Xe(e)))}function mt(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?Be(i):null,s=i?nt(i):null,a=n.x+n.width/2-r.width/2,c=n.y+n.height/2-r.height/2;switch(o){case ke:t={x:a,y:n.y-r.height};break;case Ae:t={x:a,y:n.y+n.height};break;case je:t={x:n.x+n.width,y:c};break;case Ce:t={x:n.x-r.width,y:c};break;default:t={x:n.x,y:n.y}}var l=o?Ze(o):null;if(null!=l){var u="y"===l?"height":"width";switch(s){case"start":t[l]=t[l]-(n[u]/2-r[u]/2);break;case"end":t[l]=t[l]+(n[u]/2-r[u]/2)}}return t}function yt(e,t){void 0===t&&(t={});var n=t.placement,r=void 0===n?e.placement:n,i=t.boundary,o=void 0===i?"clippingParents":i,s=t.rootBoundary,a=void 0===s?"viewport":s,c=t.elementContext,l=void 0===c?"popper":c,u=t.altBoundary,d=void 0!==u&&u,f=t.padding,h=void 0===f?0:f,p=et("number"!=typeof h?h:tt(h,Se)),v=e.rects.popper,g=e.elements[d?"popper"===l?"reference":"popper":l],m=function(e,t,n){var r="clippingParents"===t?function(e){var t=pt(Ye(e)),n=["absolute","fixed"].indexOf(Ue(e).position)>=0&&Re(e)?Qe(e):e;return Me(n)?t.filter(function(e){return Me(e)&&Ke(e,n)&&"body"!==qe(e)}):[]}(e):[].concat(t),i=[].concat(r,[n]),o=i.reduce(function(t,n){var r=gt(e,n);return t.top=Fe(r.top,t.top),t.right=Ve(r.right,t.right),t.bottom=Ve(r.bottom,t.bottom),t.left=Fe(r.left,t.left),t},gt(e,i[0]));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}(Me(g)?g:g.contextElement||Xe(e.elements.popper),o,a),y=He(e.elements.reference),b=mt({reference:y,element:v,strategy:"absolute",placement:r}),w=vt(Object.assign({},v,b)),E="popper"===l?w:y,P={top:m.top-E.top+p.top,bottom:E.bottom-m.bottom+p.bottom,left:m.left-E.left+p.left,right:E.right-m.right+p.right},x=e.modifiersData.offset;if("popper"===l&&x){var O=x[r];Object.keys(P).forEach(function(e){var t=[je,Ae].indexOf(e)>=0?1:-1,n=[ke,Ae].indexOf(e)>=0?"y":"x";P[e]+=O[n]*t})}return P}function bt(e,t){void 0===t&&(t={});var n=t.boundary,r=t.rootBoundary,i=t.padding,o=t.flipVariations,s=t.allowedAutoPlacements,a=void 0===s?Te:s,c=nt(t.placement),l=c?o?De:De.filter(function(e){return nt(e)===c}):Se,u=l.filter(function(e){return a.indexOf(e)>=0});0===u.length&&(u=l);var d=u.reduce(function(t,o){return t[o]=yt(e,{placement:o,boundary:n,rootBoundary:r,padding:i})[Be(o)],t},{});return Object.keys(d).sort(function(e,t){return d[e]-d[t]})}function wt(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Et(e){return[ke,je,Ae,Ce].some(function(t){return e[t]>=0})}function Pt(e,t,n){void 0===n&&(n=!1);var r,i,o=Re(t),s=Re(t)&&function(e){var t=e.getBoundingClientRect(),n=We(t.width)/e.offsetWidth||1,r=We(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),a=Xe(t),c=He(e,s),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(o||!o&&!n)&&(("body"!==qe(t)||ft(a))&&(l=(r=t)!==Ie(r)&&Re(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:ut(r)),Re(t)?((u=He(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):a&&(u.x=dt(a))),{x:c.left+l.scrollLeft-u.x,y:c.top+l.scrollTop-u.y,width:c.width,height:c.height}}function xt(e){var t=new Map,n=new Set,r=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}}),r.push(e)}return e.forEach(function(e){t.set(e.name,e)}),e.forEach(function(e){n.has(e.name)||i(e)}),r}var Ot={placement:"bottom",modifiers:[],strategy:"absolute"};function Lt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(e){return!(e&&"function"==typeof e.getBoundingClientRect)})}function kt(e){void 0===e&&(e={});var t=e.defaultModifiers,n=void 0===t?[]:t,r=e.defaultOptions,i=void 0===r?Ot:r;return function(e,t,r){void 0===r&&(r=i);var o,s,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},Ot,i),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},c=[],l=!1,u={state:a,setOptions:function(r){var o="function"==typeof r?r(a.options):r;d(),a.options=Object.assign({},i,a.options,o),a.scrollParents={reference:Me(e)?pt(e):e.contextElement?pt(e.contextElement):[],popper:pt(t)};var s,l,f=function(e){var t=xt(e);return _e.reduce(function(e,n){return e.concat(t.filter(function(e){return e.phase===n}))},[])}((s=[].concat(n,a.options.modifiers),l=s.reduce(function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e},{}),Object.keys(l).map(function(e){return l[e]})));return a.orderedModifiers=f.filter(function(e){return e.enabled}),a.orderedModifiers.forEach(function(e){var t=e.options,n=e.effect;if("function"==typeof n){var r=n({state:a,name:e.name,instance:u,options:void 0===t?{}:t});c.push(r||function(){})}}),u.update()},forceUpdate:function(){if(!l){var e=a.elements,t=e.reference,n=e.popper;if(Lt(t,n)){a.rects={reference:Pt(t,Qe(n),"fixed"===a.options.strategy),popper:ze(n)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach(function(e){return a.modifiersData[e.name]=Object.assign({},e.data)});for(var r=0;r<a.orderedModifiers.length;r++)if(!0!==a.reset){var i=a.orderedModifiers[r],o=i.fn,s=i.options;"function"==typeof o&&(a=o({state:a,options:void 0===s?{}:s,name:i.name,instance:u})||a)}else a.reset=!1,r=-1}}},update:(o=function(){return new Promise(function(e){u.forceUpdate(),e(a)})},function(){return s||(s=new Promise(function(e){Promise.resolve().then(function(){s=void 0,e(o())})})),s}),destroy:function(){d(),l=!0}};if(!Lt(e,t))return u;function d(){c.forEach(function(e){return e()}),c=[]}return u.setOptions(r).then(function(e){!l&&r.onFirstUpdate&&r.onFirstUpdate(e)}),u}}var At=/*#__PURE__*/kt({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=void 0===i||i,s=r.resize,a=void 0===s||s,c=Ie(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&l.forEach(function(e){e.addEventListener("scroll",n.update,ot)}),a&&c.addEventListener("resize",n.update,ot),function(){o&&l.forEach(function(e){e.removeEventListener("scroll",n.update,ot)}),a&&c.removeEventListener("resize",n.update,ot)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state;t.modifiersData[e.name]=mt({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,s=void 0===o||o,a=n.roundOffsets,c=void 0===a||a,l={placement:Be(t.placement),variation:nt(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,it(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:c})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,it(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];Re(i)&&qe(i)&&(Object.assign(i.style,n),Object.keys(r).forEach(function(e){var t=r[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(e){var r=t.elements[e],i=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce(function(e,t){return e[t]="",e},{});Re(r)&&qe(r)&&(Object.assign(r.style,o),Object.keys(i).forEach(function(e){r.removeAttribute(e)}))})}},requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.name,r=e.options.offset,i=void 0===r?[0,0]:r,o=Te.reduce(function(e,n){return e[n]=function(e,t,n){var r=Be(e),i=[Ce,ke].indexOf(r)>=0?-1:1,o="function"==typeof n?n(Object.assign({},t,{placement:e})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[Ce,je].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}(n,t.rects,i),e},{}),s=o[t.placement],a=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=s.x,t.modifiersData.popperOffsets.y+=a),t.modifiersData[n]=o}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,s=n.altAxis,a=void 0===s||s,c=n.fallbackPlacements,l=n.padding,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,h=n.flipVariations,p=void 0===h||h,v=n.allowedAutoPlacements,g=t.options.placement,m=Be(g),y=c||(m!==g&&p?function(e){if("auto"===Be(e))return[];var t=at(e);return[lt(e),t,lt(t)]}(g):[at(g)]),b=[g].concat(y).reduce(function(e,n){return e.concat("auto"===Be(n)?bt(t,{placement:n,boundary:u,rootBoundary:d,padding:l,flipVariations:p,allowedAutoPlacements:v}):n)},[]),w=t.rects.reference,E=t.rects.popper,P=new Map,x=!0,O=b[0],L=0;L<b.length;L++){var k=b[L],A=Be(k),j="start"===nt(k),C=[ke,Ae].indexOf(A)>=0,S=C?"width":"height",D=yt(t,{placement:k,boundary:u,rootBoundary:d,altBoundary:f,padding:l}),T=C?j?je:Ce:j?Ae:ke;w[S]>E[S]&&(T=at(T));var _=at(T),q=[];if(o&&q.push(D[A]<=0),a&&q.push(D[T]<=0,D[_]<=0),q.every(function(e){return e})){O=k,x=!1;break}P.set(k,q)}if(x)for(var I=function(e){var t=b.find(function(t){var n=P.get(t);if(n)return n.slice(0,e).every(function(e){return e})});if(t)return O=t,"break"},M=p?3:1;M>0&&"break"!==I(M);M--);t.placement!==O&&(t.modifiersData[r]._skip=!0,t.placement=O,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=void 0===i||i,s=n.altAxis,a=void 0!==s&&s,c=n.tether,l=void 0===c||c,u=n.tetherOffset,d=void 0===u?0:u,f=yt(t,{boundary:n.boundary,rootBoundary:n.rootBoundary,padding:n.padding,altBoundary:n.altBoundary}),h=Be(t.placement),p=nt(t.placement),v=!p,g=Ze(h),m="x"===g?"y":"x",y=t.modifiersData.popperOffsets,b=t.rects.reference,w=t.rects.popper,E="function"==typeof d?d(Object.assign({},t.rects,{placement:t.placement})):d,P="number"==typeof E?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),x=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,O={x:0,y:0};if(y){if(o){var L,k="y"===g?ke:Ce,A="y"===g?Ae:je,j="y"===g?"height":"width",C=y[g],S=C+f[k],D=C-f[A],T=l?-w[j]/2:0,_="start"===p?b[j]:w[j],q="start"===p?-w[j]:-b[j],I=t.elements.arrow,M=l&&I?ze(I):{width:0,height:0},R=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},N=R[k],B=R[A],F=$e(0,b[j],M[j]),V=v?b[j]/2-T-F-N-P.mainAxis:_-F-N-P.mainAxis,W=v?-b[j]/2+T+F+B+P.mainAxis:q+F+B+P.mainAxis,H=t.elements.arrow&&Qe(t.elements.arrow),z=null!=(L=null==x?void 0:x[g])?L:0,K=C+W-z,U=$e(l?Ve(S,C+V-z-(H?"y"===g?H.clientTop||0:H.clientLeft||0:0)):S,C,l?Fe(D,K):D);y[g]=U,O[g]=U-C}if(a){var J,X=y[m],Y="y"===m?"height":"width",G=X+f["x"===g?ke:Ce],Q=X-f["x"===g?Ae:je],Z=-1!==[ke,Ce].indexOf(h),$=null!=(J=null==x?void 0:x[m])?J:0,ee=Z?G:X-b[Y]-w[Y]-$+P.altAxis,te=Z?X+b[Y]+w[Y]-$-P.altAxis:Q,ne=l&&Z?function(e,t,n){var r=$e(e,t,n);return r>n?n:r}(ee,X,te):$e(l?ee:G,X,l?te:Q);y[m]=ne,O[m]=ne-X}t.modifiersData[r]=O}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=Be(n.placement),c=Ze(a),l=[Ce,je].indexOf(a)>=0?"height":"width";if(o&&s){var u=function(e,t){return et("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:tt(e,Se))}(i.padding,n),d=ze(o),f="y"===c?ke:Ce,h="y"===c?Ae:je,p=n.rects.reference[l]+n.rects.reference[c]-s[c]-n.rects.popper[l],v=s[c]-n.rects.reference[c],g=Qe(o),m=g?"y"===c?g.clientHeight||0:g.clientWidth||0:0,y=m/2-d[l]/2+(p/2-v/2),b=$e(u[f],y,m-d[l]-u[h]);n.modifiersData[r]=((t={})[c]=b,t.centerOffset=b-y,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&Ke(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,s=yt(t,{elementContext:"reference"}),a=yt(t,{altBoundary:!0}),c=wt(s,r),l=wt(a,i,o),u=Et(c),d=Et(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}}]}),jt=function(e){try{var t=this;if(!e)return Promise.resolve(t.collection);var n=t.collection.findIndex(function(t){return t.id===e.id});if(n>=0){var r=t.collection[n];"opened"===r.state&&r.close(),r.popper.destroy(),Ct(r),Object.getOwnPropertyNames(r).forEach(function(e){delete r[e]}),t.collection.splice(n,1)}return Promise.resolve(t.collection)}catch(e){return Promise.reject(e)}};function Ct(e){return e.__eventListeners&&(e.__eventListeners.forEach(function(t){t.el.forEach(function(n){t.type.forEach(function(r){e[n].removeEventListener(r,t.listener,!1)})})}),delete e.__eventListeners),e}var St=function(e){try{var t=this,n=me.call(t,e);return n.el.classList.add(t.settings.stateActive),n.trigger.hasAttribute("aria-controls")&&n.trigger.setAttribute("aria-expanded","true"),n.config=ve(n.el,t.settings),n.popper.setOptions({placement:n.config.placement,modifiers:[{name:"eventListeners",enabled:!0}].concat((r=n.config,[{name:"offset",options:{offset:[0,parseInt(r.offset,10)]}},{name:"preventOverflow",options:{padding:ge(r["overflow-padding"])}},{name:"flip",options:{padding:ge(r["flip-padding"])}},{name:"arrow",options:{element:r["arrow-element"],padding:ge(r["arrow-padding"])}}]))}),n.popper.update(),n.state="opened",Promise.resolve(n)}catch(e){return Promise.reject(e)}var r},Dt=function(e,t){try{var r=this;jt.call(r,e);var i=r,o={open:function(){return St.call(i,this)},close:function(){return Ee.call(i,this)},deregister:function(){return jt.call(i,this)}},s=n({id:e.id,state:"closed",el:e,trigger:t,popper:At(t,e),config:ve(e,r.settings)},o);s.trigger.hasAttribute("aria-controls")&&s.trigger.setAttribute("aria-expanded","false"),Tt.call(r,s),r.collection.push(s);var a=function(){if(s.el.classList.contains(r.settings.stateActive))return Promise.resolve(s.open()).then(function(){Le.call(r,s)})}();return Promise.resolve(a&&a.then?a.then(function(){return s}):s)}catch(e){return Promise.reject(e)}};function Tt(e){return e.__eventListeners||("hover"===e.config.event?(e.__eventListeners=[{el:["trigger"],type:["mouseenter","focus"],listener:St.bind(this,e)},{el:["el","trigger"],type:["mouseleave","focusout"],listener:Pe.bind(this,e)}],e.__eventListeners.forEach(function(t){t.el.forEach(function(n){t.type.forEach(function(r){e[n].addEventListener(r,t.listener,!1)})})})):(e.__eventListeners=[{el:["trigger"],type:["click"],listener:xe.bind(this,e)}],e.__eventListeners.forEach(function(t){t.el.forEach(function(n){t.type.forEach(function(r){e[n].addEventListener(r,t.listener,!1)})})}))),e}var _t=/*#__PURE__*/a("handleKeydown"),qt=/*#__PURE__*/function(e){function t(t){var r;return r=e.call(this)||this,Object.defineProperty(o(r),_t,{writable:!0,value:void 0}),r.defaults=pe,r.settings=n({},r.defaults,t),r.trigger=null,c(o(r),_t)[_t]=Oe.bind(o(r)),r.settings.autoInit&&r.init(),r}r(t,e);var i=t.prototype;return i.init=function(e){try{var t=this;e&&(t.settings=n({},t.settings,e));var r=document.querySelectorAll(t.settings.selectorPopover);return Promise.resolve(t.registerCollection(r)).then(function(){return t.settings.eventListeners&&t.initEventListeners(!1),t})}catch(e){return Promise.reject(e)}},i.destroy=function(){try{var e=this;return e.trigger=null,Promise.resolve(e.deregisterCollection()).then(function(){return e.settings.eventListeners&&e.destroyEventListeners(!1),e})}catch(e){return Promise.reject(e)}},i.initEventListeners=function(e){var t=this;void 0===e&&(e=!0),e&&this.collection.forEach(function(e){Tt.call(t,e)}),document.addEventListener("keydown",c(this,_t)[_t],!1)},i.destroyEventListeners=function(e){void 0===e&&(e=!0),e&&this.collection.forEach(function(e){Ct(e)}),document.removeEventListener("keydown",c(this,_t)[_t],!1)},i.register=function(e){var t=be.call(this,e);return t.error?Promise.reject(t.error):Dt.call(this,t.popover,t.trigger)},i.deregister=function(e){var t=this.get(ye.call(this,e));return jt.call(this,t)},i.open=function(e){return St.call(this,e)},i.close=function(e){return Ee.call(this,e)},t}(p);export{S as Checkbox,Q as Drawer,he as Modal,qt as Popover,j as core};
|
|
2
2
|
//# sourceMappingURL=scripts.esm.js.map
|