vrembem 3.0.11 → 4.0.0-alpha.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.
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e||self).vrembem={})}(this,function(e){function t(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,"symbol"==typeof(i=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key))?i:String(i),r)}var i}function n(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function r(){return(r=Object.assign?Object.assign.bind():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 i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,o(e,t)}function o(e,t){return(o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var a=0;function c(e){return"__private_"+a+++"_"+e}function l(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var u=/*#__PURE__*/c("handler"),d=/*#__PURE__*/function(){function e(e,t){Object.defineProperty(this,u,{writable:!0,value:void 0}),this.value=e,l(this,u)[u]=t,this.mql=null}var t=e.prototype;return t.mount=function(e,t){return e&&(this.value=e),t&&(l(this,u)[u]=t),this.value?(this.mql=window.matchMedia("(min-width: "+this.value+")"),"function"==typeof this.mql.addEventListener?this.mql.addEventListener("change",l(this,u)[u]):this.mql.addListener(l(this,u)[u]),l(this,u)[u](this.mql),this):this},t.unmount=function(){return this.mql?("function"==typeof this.mql.removeEventListener?this.mql.removeEventListener("change",l(this,u)[u]):this.mql.removeListener(l(this,u)[u]),this.value=null,l(this,u)[u]=null,this.mql=null,this):this},n(e,[{key:"handler",get:function(){return l(this,u)[u]},set:function(e){this.mql&&("function"==typeof this.mql.removeEventListener?this.mql.removeEventListener("change",l(this,u)[u]):this.mql.removeListener(l(this,u)[u])),l(this,u)[u]=e}}]),e}();function f(e,t,n){if(!e.s){if(n instanceof h){if(!n.s)return void(n.o=f.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(f.bind(null,e,t),f.bind(null,e,2));e.s=t,e.v=n;const r=e.o;r&&r(e)}}var h=/*#__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{f(r,1,o(this.v))}catch(e){f(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?f(r,1,t?t(i):i):n?f(r,1,n(i)):f(r,2,i)}catch(e){f(r,2,e)}},r},e}();function p(e){return e instanceof h&&1&e.s}var v=/*#__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(p(i)&&(i=i.v),!i)return o;if(i.then){r=0;break}var o=n();if(o&&o.then){if(!p(o)){r=1;break}o=o.s}}var s=new h,a=f.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):f(s,1,o)})).then(void 0,a),s;function c(t){o=t;do{if(!(i=e())||p(i)&&!i.v)return void f(s,1,o);if(i.then)return void i.then(l).then(void 0,a);p(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):f(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}(),g=['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^="-"])'],m=/*#__PURE__*/c("focusable"),b=/*#__PURE__*/c("handleFocusTrap"),y=/*#__PURE__*/c("handleFocusLock"),w=/*#__PURE__*/function(){function e(e,t){void 0===e&&(e=null),void 0===t&&(t="[data-focus]"),Object.defineProperty(this,m,{writable:!0,value:void 0}),Object.defineProperty(this,b,{writable:!0,value:void 0}),Object.defineProperty(this,y,{writable:!0,value:void 0}),this.el=e,this.selectorFocus=t,l(this,b)[b]=E.bind(this),l(this,y)[y]=P.bind(this)}var t=e.prototype;return t.mount=function(e,t){e&&(this.el=e),t&&(this.selectorFocus=t),this.focusable=this.getFocusable(),this.focus()},t.unmount=function(){this.el=null,this.focusable=[],document.removeEventListener("keydown",l(this,b)[b]),document.removeEventListener("keydown",l(this,y)[y])},t.focus=function(e,t){void 0===e&&(e=this.el),void 0===t&&(t=this.selectorFocus),(e.querySelector(t)||e).focus()},t.getFocusable=function(e){void 0===e&&(e=this.el);var t=[],n=document.activeElement,r=e.scrollTop;return e.querySelectorAll(g.join(",")).forEach(function(e){e.focus(),document.activeElement===e&&t.push(e)}),e.scrollTop=r,n.focus(),t},n(e,[{key:"focusable",get:function(){return l(this,m)[m]},set:function(e){l(this,m)[m]=e,l(this,m)[m].length?(document.removeEventListener("keydown",l(this,y)[y]),document.addEventListener("keydown",l(this,b)[b])):(document.removeEventListener("keydown",l(this,b)[b]),document.addEventListener("keydown",l(this,y)[y]))}},{key:"focusableFirst",get:function(){return this.focusable[0]}},{key:"focusableLast",get:function(){return this.focusable[this.focusable.length-1]}}]),e}();function E(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 P(e){("Tab"===e.key||9===e.keyCode)&&e.preventDefault()}function x(e,t){var n=(e.getAttribute("data-"+t)||"").replace(/'/g,'"');return n?JSON.parse(n):{}}function O(e,t){void 0===t&&(t=!0);var n=localStorage.getItem(e),r=n?JSON.parse(n):{};return{get:function(e){return e?r[e]:r},set:function(n,i){return i?r[n]=i:delete r[n],t&&localStorage.setItem(e,JSON.stringify(r)),r}}}function L(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 k=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))})},A=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 j(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 C={__proto__:null,Breakpoint:d,Collection:v,FocusTrap:w,getConfig:x,getPrefix:function(){return getComputedStyle(document.body).getPropertyValue("--vrembem-variable-prefix").trim()},localStore:O,teleport:L,openTransition:k,closeTransition:A,updateGlobalState:j},S={autoInit:!1,stateAttr:"aria-checked",stateValue:"mixed"},D=/*#__PURE__*/function(){function e(e){this.defaults=S,this.settings=r({},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=r({},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}(),T={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 _(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 q(e){if("Escape"===e.key){var t=this.activeModal;t&&this.close(t)}}var I=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(){r.store.set(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 M(){return getComputedStyle(document.body).getPropertyValue("--vrembem-variable-prefix").trim()}function R(e){var t=M(),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 N(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 B(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 V(e){var t=B.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.get(e.id)){var n="opened"===t.store.get(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 W(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 H=function(e,t,n){void 0===n&&(n=!0);try{var i=function(){return n&&W.call(o,s),s.el.dispatchEvent(new CustomEvent(a.customEventPrefix+"opened",{detail:o,bubbles:!0})),s},o=this,s=N.call(o,e),a=r({},o.settings,s.settings);void 0!==t&&(a.transition=t);var c=function(){if("closed"===s.state)return s.state="opening",Promise.resolve(k(s.el,a)).then(function(){"modal"===s.mode&&j(!0,a),s.state="opened"})}();return Promise.resolve(c&&c.then?c.then(i):i())}catch(e){return Promise.reject(e)}},z=function(e,t,n){void 0===n&&(n=!0);try{var i=this,o=N.call(i,e),s=r({},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(A(o.el,s)).then(function(){"modal"===o.mode&&j(!1,s),n&&W.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)}},K=function(e,t,n){try{var r=this,i=N.call(r,e);return Promise.resolve("closed"===i.state?H.call(r,i,t,n):z.call(r,i,t,n))}catch(e){return Promise.reject(e)}},G=function(e){try{var t=this;return e.el.classList.add(e.getSetting("classModal")),e.dialog.setAttribute("aria-modal","true"),!t.store.get(e.id)&&e.el.classList.contains(e.getSetting("stateOpened"))&&t.store.set(e.id,"opened"),Promise.resolve(z.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"),j(!1,r({},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 G.call(this,e);default:throw new Error('"'+e.mode+'" is not a valid drawer mode.')}}var X=function(e,t){try{var n=this;return Promise.resolve(I.call(n,e,!1)).then(function(){var i=n,o=new d,s={open:function(e,t){return H.call(i,this,e,t)},close:function(e,t){return z.call(i,this,e,t)},toggle:function(e,t){return K.call(i,this,e,t)},deregister:function(){return I.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=r({id:e.id,el:e,dialog:t,trigger:null,settings:x(e,n.settings.dataConfig),get breakpoint(){return R.call(i,e)},get state(){return c},set state(e){c=e,"opened"!==e&&"closed"!==e||"inline"===this.mode&&i.store.set(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"),n.collection.push(a);var u=function(){if(!a.breakpoint)return Promise.resolve(F.call(n,a)).then(function(){});a.mountBreakpoint()}();return u&&u.then?u.then(function(){return a}):a})}catch(e){return Promise.reject(e)}},Y=/*#__PURE__*/c("handleClick"),Q=/*#__PURE__*/c("handleKeydown"),Z=/*#__PURE__*/function(e){function t(t){var n;return n=e.call(this)||this,Object.defineProperty(s(n),Y,{writable:!0,value:void 0}),Object.defineProperty(s(n),Q,{writable:!0,value:void 0}),n.defaults=T,n.settings=r({},n.defaults,t),n.focusTrap=new w,n.store=O(n.settings.storeKey,n.settings.store),l(s(n),Y)[Y]=_.bind(s(n)),l(s(n),Q)[Q]=q.bind(s(n)),n.settings.autoInit&&n.init(),n}i(t,e);var o=t.prototype;return o.init=function(e){void 0===e&&(e=null);try{var t=this;e&&(t.settings=r({},t.settings,e));var n=document.querySelectorAll(t.settings.selectorDrawer);return Promise.resolve(t.registerCollection(n)).then(function(){return t.settings.eventListeners&&t.initEventListeners(),t})}catch(e){return Promise.reject(e)}},o.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)}},o.initEventListeners=function(){document.addEventListener("click",l(this,Y)[Y],!1),document.addEventListener("keydown",l(this,Q)[Q],!1)},o.destroyEventListeners=function(){document.removeEventListener("click",l(this,Y)[Y],!1),document.removeEventListener("keydown",l(this,Q)[Q],!1)},o.register=function(e){var t=V.call(this,e);return t.error?Promise.reject(t.error):X.call(this,t.drawer,t.dialog)},o.deregister=function(e){var t=this.get(B.call(this,e));return I.call(this,t)},o.open=function(e,t,n){return H.call(this,e,t,n)},o.close=function(e,t,n){return z.call(this,e,t,n)},o.toggle=function(e,t,n){return K.call(this,e,t,n)},n(t,[{key:"activeModal",get:function(){return this.collection.find(function(e){return"opened"===e.state&&"modal"===e.mode})}}]),t}(v),$={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 ee(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 te(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 ne(e){var t=te.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 re(){this.active?this.focusTrap.mount(this.active.dialog,this.settings.selectorFocus):(this.trigger&&(this.trigger.focus(),this.trigger=null),this.focusTrap.unmount())}var ie=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(te.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(te.call(t,e.target))):Promise.resolve()}catch(e){return Promise.reject(e)}};function oe(e){if("Escape"===e.key&&this.active&&!this.active.dialog.matches(this.settings.selectorRequired))return this.close()}var se=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(){});r.stack.remove(n)}();return o&&o.then?o.then(e):e()}}();return Promise.resolve(o&&o.then?o.then(n):n())}catch(e){return Promise.reject(e)}},ae=function(e,t,n){void 0===n&&(n=!0);try{var i=function(){return n&&re.call(o),s.el.dispatchEvent(new CustomEvent(a.customEventPrefix+"opened",{detail:o,bubbles:!0})),s},o=this,s=ee.call(o,e),a=r({},o.settings,s.settings);void 0!==t&&(a.transition=t),o.stack.moveToTop(s);var c=function(){if("closed"===s.state)return s.state="opening",o.stack.add(s),Promise.resolve(k(s.el,a)).then(function(){s.state="opened"})}();return Promise.resolve(c&&c.then?c.then(i):i())}catch(e){return Promise.reject(e)}},ce=function(e,t,n){void 0===n&&(n=!0);try{var i=this,o=e?ee.call(i,e):i.active,s=function(){if(o&&"opened"===o.state){o.state="closing";var e=r({},i.settings,o.settings);return void 0!==t&&(e.transition=t),document.activeElement.blur(),Promise.resolve(A(o.el,e)).then(function(){i.stack.remove(o),n&&re.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)}},le=function(e,t){try{var n=this,r=[];return Promise.resolve(Promise.all(n.stack.value.map(function(i){try{var o=function(){i.trigger=null},s=function(){if(!e||e!==i.id){var o=r.push;return Promise.resolve(ce.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)}},ue=function(e,t,n){void 0===n&&(n=!0);try{var r,i,o=function(){return n&&re.call(s),{opened:r,closed:i}},s=this,a=ee.call(s,e),c="opened"===a.state?(r=a,Promise.resolve(le.call(s,a.id,t)).then(function(e){i=e})):(r=ae.call(s,a,t,!1),i=le.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)}},de=function(e,t){try{var n=this;return Promise.resolve(se.call(n,e,!1)).then(function(){var i=n,o={open:function(e,t){return ae.call(i,this,e,t)},close:function(e,t){return ce.call(i,this,e,t)},replace:function(e,t){return ue.call(i,this,e,t)},deregister:function(){return se.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=L(this.el,e,t),this.el)},teleportReturn:function(){return this.returnRef?(this.returnRef=L(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=r({id:e.id,state:"closed",el:e,dialog:t,returnRef:null,settings:x(e,n.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(),n.collection.push(s);var a=function(){if(s.el.classList.contains(n.settings.stateOpened))return Promise.resolve(s.open(!1)).then(function(){});s.el.classList.remove(n.settings.stateOpening),s.el.classList.remove(n.settings.stateClosing),s.el.classList.add(n.settings.stateClosed)}();return a&&a.then?a.then(function(){return s}):s})}catch(e){return Promise.reject(e)}},fe=/*#__PURE__*/c("handleClick"),he=/*#__PURE__*/c("handleKeydown"),pe=/*#__PURE__*/function(e){function t(t){var n,i,o;return n=e.call(this)||this,Object.defineProperty(s(n),fe,{writable:!0,value:void 0}),Object.defineProperty(s(n),he,{writable:!0,value:void 0}),n.defaults=$,n.settings=r({},n.defaults,t),n.trigger=null,n.focusTrap=new w,n.stack=(i=n.settings,o=[],{get value(){return[].concat(o)},get top(){return o[o.length-1]},updateIndex:function(){o.forEach(function(e,t){e.el.style.zIndex=null;var n=getComputedStyle(e.el)["z-index"];e.el.style.zIndex=parseInt(n)+t+1})},updateGlobalState:function(){j(this.top,i),this.updateIndex()},add:function(e){e.el.style.zIndex=null;var t=getComputedStyle(e.el)["z-index"];e.el.style.zIndex=parseInt(t)+o.length+1,o.push(e),this.updateGlobalState()},remove:function(e){var t=o.findIndex(function(t){return t.id===e.id});t>=0&&(e.el.style.zIndex=null,o.splice(t,1),this.updateGlobalState())},moveToTop:function(e){var t=o.findIndex(function(t){return t.id===e.id});t>=0&&(o.splice(t,1),this.add(e))}}),l(s(n),fe)[fe]=ie.bind(s(n)),l(s(n),he)[he]=oe.bind(s(n)),n.settings.autoInit&&n.init(),n}i(t,e);var o=t.prototype;return o.init=function(e){try{var t=this;e&&(t.settings=r({},t.settings,e));var n=document.querySelectorAll(t.settings.selectorModal);return Promise.resolve(t.registerCollection(n)).then(function(){return t.settings.eventListeners&&t.initEventListeners(),t})}catch(e){return Promise.reject(e)}},o.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)}},o.initEventListeners=function(){document.addEventListener("click",l(this,fe)[fe],!1),document.addEventListener("keydown",l(this,he)[he],!1)},o.destroyEventListeners=function(){document.removeEventListener("click",l(this,fe)[fe],!1),document.removeEventListener("keydown",l(this,he)[he],!1)},o.register=function(e){var t=ne.call(this,e);return t.error?Promise.reject(t.error):de.call(this,t.modal,t.dialog)},o.deregister=function(e){var t=this.get(te.call(this,e));return se.call(this,t)},o.open=function(e,t,n){return ae.call(this,e,t,n)},o.close=function(e,t,n){return ce.call(this,e,t,n)},o.replace=function(e,t,n){return ue.call(this,e,t,n)},o.closeAll=function(e,t,n){void 0===e&&(e=!1),void 0===n&&(n=!0);try{var r=this;return Promise.resolve(le.call(r,e,t)).then(function(e){return n&&re.call(r),e})}catch(e){return Promise.reject(e)}},n(t,[{key:"active",get:function(){return this.stack.top}}]),t}(v),ve={autoInit:!1,selectorPopover:".popover",selectorArrow:".popover__arrow",stateActive:"is-active",eventListeners:!0,eventType:"click",placement:"bottom"};function ge(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=M(),s=n.getPropertyValue("--"+o+"popover-"+i).trim();s&&(r[i]=s)}return r}function me(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 be(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 we(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 Ee=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(Pe.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)}},Pe=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(be.call(n,e)):Promise.resolve(Ee.call(n)).then(t))}catch(e){return Promise.reject(e)}};function xe(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+'"], [aria-describedby="'+e.id+'"]');return t||n||e.close(),e},1)}function Oe(e){"opened"===e.state?e.close():(this.trigger=e.trigger,e.open(),ke.call(this,e))}function Le(e){var t=this;switch(e.key){case"Escape":return this.trigger&&this.trigger.focus(),void Ee.call(this);case"Tab":return void this.collection.forEach(function(e){xe.call(t,e)});default:return}}function ke(e){var t=this;document.addEventListener("click",function n(r){r.target.closest("#"+e.id+', [aria-controls="'+e.id+'"], [aria-describedby="'+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 Ae="top",je="bottom",Ce="right",Se="left",De="auto",Te=[Ae,je,Ce,Se],_e="start",qe="end",Ie="viewport",Me="popper",Re=/*#__PURE__*/Te.reduce(function(e,t){return e.concat([t+"-"+_e,t+"-"+qe])},[]),Ne=/*#__PURE__*/[].concat(Te,[De]).reduce(function(e,t){return e.concat([t,t+"-"+_e,t+"-"+qe])},[]),Be=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Ve(e){return e?(e.nodeName||"").toLowerCase():null}function Fe(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function We(e){return e instanceof Fe(e).Element||e instanceof Element}function He(e){return e instanceof Fe(e).HTMLElement||e instanceof HTMLElement}function ze(e){return"undefined"!=typeof ShadowRoot&&(e instanceof Fe(e).ShadowRoot||e instanceof ShadowRoot)}function Ke(e){return e.split("-")[0]}var Ge=Math.max,Ue=Math.min,Je=Math.round;function Xe(){var e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Ye(){return!/^((?!chrome|android).)*safari/i.test(Xe())}function Qe(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&He(e)&&(i=e.offsetWidth>0&&Je(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Je(r.height)/e.offsetHeight||1);var s=(We(e)?Fe(e):window).visualViewport,a=!Ye()&&n,c=(r.left+(a&&s?s.offsetLeft:0))/i,l=(r.top+(a&&s?s.offsetTop:0))/o,u=r.width/i,d=r.height/o;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c,x:c,y:l}}function Ze(e){var t=Qe(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 $e(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&ze(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function et(e){return Fe(e).getComputedStyle(e)}function tt(e){return["table","td","th"].indexOf(Ve(e))>=0}function nt(e){return((We(e)?e.ownerDocument:e.document)||window.document).documentElement}function rt(e){return"html"===Ve(e)?e:e.assignedSlot||e.parentNode||(ze(e)?e.host:null)||nt(e)}function it(e){return He(e)&&"fixed"!==et(e).position?e.offsetParent:null}function ot(e){for(var t=Fe(e),n=it(e);n&&tt(n)&&"static"===et(n).position;)n=it(n);return n&&("html"===Ve(n)||"body"===Ve(n)&&"static"===et(n).position)?t:n||function(e){var t=/firefox/i.test(Xe());if(/Trident/i.test(Xe())&&He(e)&&"fixed"===et(e).position)return null;var n=rt(e);for(ze(n)&&(n=n.host);He(n)&&["html","body"].indexOf(Ve(n))<0;){var r=et(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 st(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function at(e,t,n){return Ge(e,Ue(t,n))}function ct(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function lt(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}function ut(e){return e.split("-")[1]}var dt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ft(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"),b=s.hasOwnProperty("y"),y=Se,w=Ae,E=window;if(l){var P=ot(n),x="clientHeight",O="clientWidth";P===Fe(n)&&"static"!==et(P=nt(n)).position&&"absolute"===a&&(x="scrollHeight",O="scrollWidth"),P=P,(i===Ae||(i===Se||i===Ce)&&o===qe)&&(w=je,v-=(d&&P===E&&E.visualViewport?E.visualViewport.height:P[x])-r.height,v*=c?1:-1),i!==Se&&(i!==Ae&&i!==je||o!==qe)||(y=Ce,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&&dt),A=!0===u?function(e){var t=e.y,n=window.devicePixelRatio||1;return{x:Je(e.x*n)/n||0,y:Je(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]=b?"0":"",L[y]=m?"0":"",L.transform=(E.devicePixelRatio||1)<=1?"translate("+h+"px, "+v+"px)":"translate3d("+h+"px, "+v+"px, 0)",L):((t={})[w]=b?v+"px":"",t[y]=m?h+"px":"",t.transform="",t))}var ht={passive:!0},pt={left:"right",right:"left",bottom:"top",top:"bottom"};function vt(e){return e.replace(/left|right|bottom|top/g,function(e){return pt[e]})}var gt={start:"end",end:"start"};function mt(e){return e.replace(/start|end/g,function(e){return gt[e]})}function bt(e){var t=Fe(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function yt(e){return Qe(nt(e)).left+bt(e).scrollLeft}function wt(e){var t=et(e);return/auto|scroll|overlay|hidden/.test(t.overflow+t.overflowY+t.overflowX)}function Et(e){return["html","body","#document"].indexOf(Ve(e))>=0?e.ownerDocument.body:He(e)&&wt(e)?e:Et(rt(e))}function Pt(e,t){var n;void 0===t&&(t=[]);var r=Et(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=Fe(r),s=i?[o].concat(o.visualViewport||[],wt(r)?r:[]):r,a=t.concat(s);return i?a:a.concat(Pt(rt(s)))}function xt(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Ot(e,t,n){return t===Ie?xt(function(e,t){var n=Fe(e),r=nt(e),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,c=0;if(i){o=i.width,s=i.height;var l=Ye();(l||!l&&"fixed"===t)&&(a=i.offsetLeft,c=i.offsetTop)}return{width:o,height:s,x:a+yt(e),y:c}}(e,n)):We(t)?function(e,t){var n=Qe(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):xt(function(e){var t,n=nt(e),r=bt(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=Ge(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Ge(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+yt(e),c=-r.scrollTop;return"rtl"===et(i||n).direction&&(a+=Ge(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:c}}(nt(e)))}function Lt(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?Ke(i):null,s=i?ut(i):null,a=n.x+n.width/2-r.width/2,c=n.y+n.height/2-r.height/2;switch(o){case Ae:t={x:a,y:n.y-r.height};break;case je:t={x:a,y:n.y+n.height};break;case Ce:t={x:n.x+n.width,y:c};break;case Se:t={x:n.x-r.width,y:c};break;default:t={x:n.x,y:n.y}}var l=o?st(o):null;if(null!=l){var u="y"===l?"height":"width";switch(s){case _e:t[l]=t[l]-(n[u]/2-r[u]/2);break;case qe:t[l]=t[l]+(n[u]/2-r[u]/2)}}return t}function kt(e,t){void 0===t&&(t={});var n=t.placement,r=void 0===n?e.placement:n,i=t.strategy,o=void 0===i?e.strategy:i,s=t.boundary,a=void 0===s?"clippingParents":s,c=t.rootBoundary,l=void 0===c?Ie:c,u=t.elementContext,d=void 0===u?Me:u,f=t.altBoundary,h=void 0!==f&&f,p=t.padding,v=void 0===p?0:p,g=ct("number"!=typeof v?v:lt(v,Te)),m=e.rects.popper,b=e.elements[h?d===Me?"reference":Me:d],y=function(e,t,n,r){var i="clippingParents"===t?function(e){var t=Pt(rt(e)),n=["absolute","fixed"].indexOf(et(e).position)>=0&&He(e)?ot(e):e;return We(n)?t.filter(function(e){return We(e)&&$e(e,n)&&"body"!==Ve(e)}):[]}(e):[].concat(t),o=[].concat(i,[n]),s=o.reduce(function(t,n){var i=Ot(e,n,r);return t.top=Ge(i.top,t.top),t.right=Ue(i.right,t.right),t.bottom=Ue(i.bottom,t.bottom),t.left=Ge(i.left,t.left),t},Ot(e,o[0],r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}(We(b)?b:b.contextElement||nt(e.elements.popper),a,l,o),w=Qe(e.elements.reference),E=Lt({reference:w,element:m,strategy:"absolute",placement:r}),P=xt(Object.assign({},m,E)),x=d===Me?P:w,O={top:y.top-x.top+g.top,bottom:x.bottom-y.bottom+g.bottom,left:y.left-x.left+g.left,right:x.right-y.right+g.right},L=e.modifiersData.offset;if(d===Me&&L){var k=L[r];Object.keys(O).forEach(function(e){var t=[Ce,je].indexOf(e)>=0?1:-1,n=[Ae,je].indexOf(e)>=0?"y":"x";O[e]+=k[n]*t})}return O}function At(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?Ne:s,c=ut(t.placement),l=c?o?Re:Re.filter(function(e){return ut(e)===c}):Te,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]=kt(e,{placement:o,boundary:n,rootBoundary:r,padding:i})[Ke(o)],t},{});return Object.keys(d).sort(function(e,t){return d[e]-d[t]})}function jt(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 Ct(e){return[Ae,Ce,je,Se].some(function(t){return e[t]>=0})}function St(e,t,n){void 0===n&&(n=!1);var r,i,o=He(t),s=He(t)&&function(e){var t=e.getBoundingClientRect(),n=Je(t.width)/e.offsetWidth||1,r=Je(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),a=nt(t),c=Qe(e,s,n),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(o||!o&&!n)&&(("body"!==Ve(t)||wt(a))&&(l=(r=t)!==Fe(r)&&He(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:bt(r)),He(t)?((u=Qe(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):a&&(u.x=yt(a))),{x:c.left+l.scrollLeft-u.x,y:c.top+l.scrollTop-u.y,width:c.width,height:c.height}}function Dt(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 Tt={placement:"bottom",modifiers:[],strategy:"absolute"};function _t(){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 qt(e){void 0===e&&(e={});var t=e.defaultModifiers,n=void 0===t?[]:t,r=e.defaultOptions,i=void 0===r?Tt:r;return function(e,t,r){void 0===r&&(r=i);var o,s,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},Tt,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:We(e)?Pt(e):e.contextElement?Pt(e.contextElement):[],popper:Pt(t)};var s,l,f=function(e){var t=Dt(e);return Be.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(_t(t,n)){a.rects={reference:St(t,ot(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(!_t(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 It=/*#__PURE__*/qt({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=Fe(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&l.forEach(function(e){e.addEventListener("scroll",n.update,ht)}),a&&c.addEventListener("resize",n.update,ht),function(){o&&l.forEach(function(e){e.removeEventListener("scroll",n.update,ht)}),a&&c.removeEventListener("resize",n.update,ht)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state;t.modifiersData[e.name]=Lt({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:Ke(t.placement),variation:ut(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,ft(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,ft(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];He(i)&&Ve(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},{});He(r)&&Ve(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=Ne.reduce(function(e,n){return e[n]=function(e,t,n){var r=Ke(e),i=[Se,Ae].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,[Se,Ce].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=Ke(g),b=c||(m!==g&&p?function(e){if(Ke(e)===De)return[];var t=vt(e);return[mt(e),t,mt(t)]}(g):[vt(g)]),y=[g].concat(b).reduce(function(e,n){return e.concat(Ke(n)===De?At(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=y[0],L=0;L<y.length;L++){var k=y[L],A=Ke(k),j=ut(k)===_e,C=[Ae,je].indexOf(A)>=0,S=C?"width":"height",D=kt(t,{placement:k,boundary:u,rootBoundary:d,altBoundary:f,padding:l}),T=C?j?Ce:Se:j?je:Ae;w[S]>E[S]&&(T=vt(T));var _=vt(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=y.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=kt(t,{boundary:n.boundary,rootBoundary:n.rootBoundary,padding:n.padding,altBoundary:n.altBoundary}),h=Ke(t.placement),p=ut(t.placement),v=!p,g=st(h),m="x"===g?"y":"x",b=t.modifiersData.popperOffsets,y=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(b){if(o){var L,k="y"===g?Ae:Se,A="y"===g?je:Ce,j="y"===g?"height":"width",C=b[g],S=C+f[k],D=C-f[A],T=l?-w[j]/2:0,_=p===_e?y[j]:w[j],q=p===_e?-w[j]:-y[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],V=at(0,y[j],M[j]),F=v?y[j]/2-T-V-N-P.mainAxis:_-V-N-P.mainAxis,W=v?-y[j]/2+T+V+B+P.mainAxis:q+V+B+P.mainAxis,H=t.elements.arrow&&ot(t.elements.arrow),z=null!=(L=null==x?void 0:x[g])?L:0,K=C+W-z,G=at(l?Ue(S,C+F-z-(H?"y"===g?H.clientTop||0:H.clientLeft||0:0)):S,C,l?Ge(D,K):D);b[g]=G,O[g]=G-C}if(a){var U,J=b[m],X="y"===m?"height":"width",Y=J+f["x"===g?Ae:Se],Q=J-f["x"===g?je:Ce],Z=-1!==[Ae,Se].indexOf(h),$=null!=(U=null==x?void 0:x[m])?U:0,ee=Z?Y:J-y[X]-w[X]-$+P.altAxis,te=Z?J+y[X]+w[X]-$-P.altAxis:Q,ne=l&&Z?function(e,t,n){var r=at(e,t,n);return r>n?n:r}(ee,J,te):at(l?ee:Y,J,l?te:Q);b[m]=ne,O[m]=ne-J}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=Ke(n.placement),c=st(a),l=[Se,Ce].indexOf(a)>=0?"height":"width";if(o&&s){var u=function(e,t){return ct("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:lt(e,Te))}(i.padding,n),d=Ze(o),f="y"===c?Ae:Se,h="y"===c?je:Ce,p=n.rects.reference[l]+n.rects.reference[c]-s[c]-n.rects.popper[l],v=s[c]-n.rects.reference[c],g=ot(o),m=g?"y"===c?g.clientHeight||0:g.clientWidth||0:0,b=m/2-d[l]/2+(p/2-v/2),y=at(u[f],b,m-d[l]-u[h]);n.modifiersData[r]=((t={})[c]=y,t.centerOffset=y-b,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)))&&$e(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=kt(t,{elementContext:"reference"}),a=kt(t,{altBoundary:!0}),c=jt(s,r),l=jt(a,i,o),u=Ct(c),d=Ct(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})}}]}),Mt=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(),Rt(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 Rt(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 Nt=function(e){try{var t=this,n=be.call(t,e);return n.el.classList.add(t.settings.stateActive),n.trigger.hasAttribute("aria-controls")&&n.trigger.setAttribute("aria-expanded","true"),n.config=ge(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:me(r["overflow-padding"])}},{name:"flip",options:{padding:me(r["flip-padding"])}},{name:"arrow",options:{element:r["arrow-element"],padding:me(r["arrow-padding"])}}]))}),n.popper.update(),n.state="opened",Promise.resolve(n)}catch(e){return Promise.reject(e)}var r},Bt=function(e,t){try{var n=this;Mt.call(n,e);var i=n,o={open:function(){return Nt.call(i,this)},close:function(){return Pe.call(i,this)},deregister:function(){return Mt.call(i,this)}},s=r({id:e.id,state:"closed",el:e,trigger:t,popper:It(t,e),config:ge(e,n.settings)},o);s.trigger.hasAttribute("aria-controls")&&s.trigger.setAttribute("aria-expanded","false"),Vt.call(n,s),n.collection.push(s);var a=function(){if(s.el.classList.contains(n.settings.stateActive))return Promise.resolve(s.open()).then(function(){ke.call(n,s)})}();return Promise.resolve(a&&a.then?a.then(function(){return s}):s)}catch(e){return Promise.reject(e)}};function Vt(e){return e.__eventListeners||("hover"===e.config.event?(e.__eventListeners=[{el:["trigger"],type:["mouseenter","focus"],listener:Nt.bind(this,e)},{el:["el","trigger"],type:["mouseleave","focusout"],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.__eventListeners=[{el:["trigger"],type:["click"],listener:Oe.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 Ft=/*#__PURE__*/c("handleKeydown"),Wt=/*#__PURE__*/function(e){function t(t){var n;return n=e.call(this)||this,Object.defineProperty(s(n),Ft,{writable:!0,value:void 0}),n.defaults=ve,n.settings=r({},n.defaults,t),n.trigger=null,l(s(n),Ft)[Ft]=Le.bind(s(n)),n.settings.autoInit&&n.init(),n}i(t,e);var n=t.prototype;return n.init=function(e){try{var t=this;e&&(t.settings=r({},t.settings,e));var n=document.querySelectorAll(t.settings.selectorPopover);return Promise.resolve(t.registerCollection(n)).then(function(){return t.settings.eventListeners&&t.initEventListeners(!1),t})}catch(e){return Promise.reject(e)}},n.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)}},n.initEventListeners=function(e){var t=this;void 0===e&&(e=!0),e&&this.collection.forEach(function(e){Vt.call(t,e)}),document.addEventListener("keydown",l(this,Ft)[Ft],!1)},n.destroyEventListeners=function(e){void 0===e&&(e=!0),e&&this.collection.forEach(function(e){Rt(e)}),document.removeEventListener("keydown",l(this,Ft)[Ft],!1)},n.register=function(e){var t=we.call(this,e);return t.error?Promise.reject(t.error):Bt.call(this,t.popover,t.trigger)},n.deregister=function(e){var t=this.get(ye.call(this,e));return Mt.call(this,t)},n.open=function(e){return Nt.call(this,e)},n.close=function(e){return Pe.call(this,e)},t}(v);e.Checkbox=D,e.Drawer=Z,e.Modal=pe,e.Popover=Wt,e.core=C});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e||self).vrembem={})}(this,function(e){function t(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,"symbol"==typeof(i=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key))?i:String(i),r)}var i}function n(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function r(){return(r=Object.assign?Object.assign.bind():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 i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,o(e,t)}function o(e,t){return(o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var a=0;function c(e){return"__private_"+a+++"_"+e}function l(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var u=/*#__PURE__*/c("handler"),d=/*#__PURE__*/function(){function e(e,t){Object.defineProperty(this,u,{writable:!0,value:void 0}),this.value=e,l(this,u)[u]=t,this.mql=null}var t=e.prototype;return t.mount=function(e,t){return e&&(this.value=e),t&&(l(this,u)[u]=t),this.value?(this.mql=window.matchMedia("(min-width: "+this.value+")"),"function"==typeof this.mql.addEventListener?this.mql.addEventListener("change",l(this,u)[u]):this.mql.addListener(l(this,u)[u]),l(this,u)[u](this.mql),this):this},t.unmount=function(){return this.mql?("function"==typeof this.mql.removeEventListener?this.mql.removeEventListener("change",l(this,u)[u]):this.mql.removeListener(l(this,u)[u]),this.value=null,l(this,u)[u]=null,this.mql=null,this):this},n(e,[{key:"handler",get:function(){return l(this,u)[u]},set:function(e){this.mql&&("function"==typeof this.mql.removeEventListener?this.mql.removeEventListener("change",l(this,u)[u]):this.mql.removeListener(l(this,u)[u])),l(this,u)[u]=e}}]),e}();function f(e,t,n){if(!e.s){if(n instanceof h){if(!n.s)return void(n.o=f.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(f.bind(null,e,t),f.bind(null,e,2));e.s=t,e.v=n;const r=e.o;r&&r(e)}}var h=/*#__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{f(r,1,o(this.v))}catch(e){f(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?f(r,1,t?t(i):i):n?f(r,1,n(i)):f(r,2,i)}catch(e){f(r,2,e)}},r},e}();function p(e){return e instanceof h&&1&e.s}var v=/*#__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(p(i)&&(i=i.v),!i)return o;if(i.then){r=0;break}var o=n();if(o&&o.then){if(!p(o)){r=1;break}o=o.s}}var s=new h,a=f.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):f(s,1,o)})).then(void 0,a),s;function c(t){o=t;do{if(!(i=e())||p(i)&&!i.v)return void f(s,1,o);if(i.then)return void i.then(l).then(void 0,a);p(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):f(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}();const g=":not([inert]):not([inert] *)",m=':not([tabindex^="-"])';var y=[`a[href]${g}${m}`,`area[href]${g}${m}`,`input:not([type="hidden"]):not([type="radio"])${g}${m}:not(:disabled)`,`input[type="radio"]${g}${m}:not(:disabled)`,`select${g}${m}:not(:disabled)`,`textarea${g}${m}:not(:disabled)`,`button${g}${m}:not(:disabled)`,`details${g} > summary:first-of-type${m}`,`iframe${g}${m}`,`audio[controls]${g}${m}`,`video[controls]${g}${m}`,`[contenteditable]${g}${m}`,`[tabindex]${g}${m}`],b=/*#__PURE__*/c("focusable"),w=/*#__PURE__*/c("handleFocusTrap"),E=/*#__PURE__*/c("handleFocusLock"),P=/*#__PURE__*/function(){function e(e,t){void 0===e&&(e=null),void 0===t&&(t="[data-focus]"),Object.defineProperty(this,b,{writable:!0,value:void 0}),Object.defineProperty(this,w,{writable:!0,value:void 0}),Object.defineProperty(this,E,{writable:!0,value:void 0}),this.el=e,this.selectorFocus=t,l(this,w)[w]=x.bind(this),l(this,E)[E]=O.bind(this)}var t=e.prototype;return t.mount=function(e,t){e&&(this.el=e),t&&(this.selectorFocus=t),this.focusable=this.getFocusable(),this.focus()},t.unmount=function(){this.el=null,this.focusable=[],document.removeEventListener("keydown",l(this,w)[w]),document.removeEventListener("keydown",l(this,E)[E])},t.focus=function(e,t){void 0===e&&(e=this.el),void 0===t&&(t=this.selectorFocus),(e.querySelector(t)||e).focus()},t.getFocusable=function(e){void 0===e&&(e=this.el);var t=[],n=document.activeElement,r=e.scrollTop;return e.querySelectorAll(y.join(",")).forEach(function(e){e.focus(),document.activeElement===e&&t.push(e)}),e.scrollTop=r,n.focus(),t},n(e,[{key:"focusable",get:function(){return l(this,b)[b]},set:function(e){l(this,b)[b]=e,l(this,b)[b].length?(document.removeEventListener("keydown",l(this,E)[E]),document.addEventListener("keydown",l(this,w)[w])):(document.removeEventListener("keydown",l(this,w)[w]),document.addEventListener("keydown",l(this,E)[E]))}},{key:"focusableFirst",get:function(){return this.focusable[0]}},{key:"focusableLast",get:function(){return this.focusable[this.focusable.length-1]}}]),e}();function x(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 O(e){("Tab"===e.key||9===e.keyCode)&&e.preventDefault()}function L(e,t){var n=(e.getAttribute("data-"+t)||"").replace(/'/g,'"');return n?JSON.parse(n):{}}function k(e,t){void 0===t&&(t=!0);var n=localStorage.getItem(e),r=n?JSON.parse(n):{};return{get:function(e){return e?r[e]:r},set:function(n,i){return i?r[n]=i:delete r[n],t&&localStorage.setItem(e,JSON.stringify(r)),r}}}function A(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 j=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))})},C=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 S(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 D={__proto__:null,Breakpoint:d,Collection:v,FocusTrap:P,getConfig:L,getPrefix:function(){return getComputedStyle(document.body).getPropertyValue("--vrembem-variable-prefix").trim()},localStore:k,teleport:A,openTransition:j,closeTransition:C,updateGlobalState:S},T={autoInit:!1,stateAttr:"aria-checked",stateValue:"mixed"},_=/*#__PURE__*/function(){function e(e){this.defaults=T,this.settings=r({},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=r({},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}(),q={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 I(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 M(e){if("Escape"===e.key){var t=this.activeModal;t&&this.close(t)}}var R=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(){r.store.set(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 N(){return getComputedStyle(document.body).getPropertyValue("--vrembem-variable-prefix").trim()}function B(e){var t=N(),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 $(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 V(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 F(e){var t=V.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 W=function(e){try{var t=this,n=function(){if(t.store.get(e.id)){var n="opened"===t.store.get(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 H(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 z=function(e,t,n){void 0===n&&(n=!0);try{var i=function(){return n&&H.call(o,s),s.el.dispatchEvent(new CustomEvent(a.customEventPrefix+"opened",{detail:o,bubbles:!0})),s},o=this,s=$.call(o,e),a=r({},o.settings,s.settings);void 0!==t&&(a.transition=t);var c=function(){if("closed"===s.state)return s.state="opening",Promise.resolve(j(s.el,a)).then(function(){"modal"===s.mode&&S(!0,a),s.state="opened"})}();return Promise.resolve(c&&c.then?c.then(i):i())}catch(e){return Promise.reject(e)}},K=function(e,t,n){void 0===n&&(n=!0);try{var i=this,o=$.call(i,e),s=r({},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(C(o.el,s)).then(function(){"modal"===o.mode&&S(!1,s),n&&H.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)}},G=function(e,t,n){try{var r=this,i=$.call(r,e);return Promise.resolve("closed"===i.state?z.call(r,i,t,n):K.call(r,i,t,n))}catch(e){return Promise.reject(e)}},U=function(e){try{var t=this;return e.el.classList.add(e.getSetting("classModal")),e.dialog.setAttribute("aria-modal","true"),!t.store.get(e.id)&&e.el.classList.contains(e.getSetting("stateOpened"))&&t.store.set(e.id,"opened"),Promise.resolve(K.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)}},J=function(e){try{var t=this;return e.el.classList.remove(e.getSetting("classModal")),e.dialog.removeAttribute("aria-modal"),S(!1,r({},t.settings,e.settings)),t.focusTrap.unmount(),Promise.resolve(W.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 X(e){switch(e.mode){case"inline":return J.call(this,e);case"modal":return U.call(this,e);default:throw new Error('"'+e.mode+'" is not a valid drawer mode.')}}var Y=function(e,t){try{var n=this;return Promise.resolve(R.call(n,e,!1)).then(function(){var i=n,o=new d,s={open:function(e,t){return z.call(i,this,e,t)},close:function(e,t){return K.call(i,this,e,t)},toggle:function(e,t){return G.call(i,this,e,t)},deregister:function(){return R.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=r({id:e.id,el:e,dialog:t,trigger:null,settings:L(e,n.settings.dataConfig),get breakpoint(){return B.call(i,e)},get state(){return c},set state(e){c=e,"opened"!==e&&"closed"!==e||"inline"===this.mode&&i.store.set(this.id,this.state)},get mode(){return l},set mode(e){l=e,X.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"),n.collection.push(a);var u=function(){if(!a.breakpoint)return Promise.resolve(W.call(n,a)).then(function(){});a.mountBreakpoint()}();return u&&u.then?u.then(function(){return a}):a})}catch(e){return Promise.reject(e)}},Q=/*#__PURE__*/c("handleClick"),Z=/*#__PURE__*/c("handleKeydown"),ee=/*#__PURE__*/function(e){function t(t){var n;return n=e.call(this)||this,Object.defineProperty(s(n),Q,{writable:!0,value:void 0}),Object.defineProperty(s(n),Z,{writable:!0,value:void 0}),n.defaults=q,n.settings=r({},n.defaults,t),n.focusTrap=new P,n.store=k(n.settings.storeKey,n.settings.store),l(s(n),Q)[Q]=I.bind(s(n)),l(s(n),Z)[Z]=M.bind(s(n)),n.settings.autoInit&&n.init(),n}i(t,e);var o=t.prototype;return o.init=function(e){void 0===e&&(e=null);try{var t=this;e&&(t.settings=r({},t.settings,e));var n=document.querySelectorAll(t.settings.selectorDrawer);return Promise.resolve(t.registerCollection(n)).then(function(){return t.settings.eventListeners&&t.initEventListeners(),t})}catch(e){return Promise.reject(e)}},o.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)}},o.initEventListeners=function(){document.addEventListener("click",l(this,Q)[Q],!1),document.addEventListener("keydown",l(this,Z)[Z],!1)},o.destroyEventListeners=function(){document.removeEventListener("click",l(this,Q)[Q],!1),document.removeEventListener("keydown",l(this,Z)[Z],!1)},o.register=function(e){var t=F.call(this,e);return t.error?Promise.reject(t.error):Y.call(this,t.drawer,t.dialog)},o.deregister=function(e){var t=this.get(V.call(this,e));return R.call(this,t)},o.open=function(e,t,n){return z.call(this,e,t,n)},o.close=function(e,t,n){return K.call(this,e,t,n)},o.toggle=function(e,t,n){return G.call(this,e,t,n)},n(t,[{key:"activeModal",get:function(){return this.collection.find(function(e){return"opened"===e.state&&"modal"===e.mode})}}]),t}(v),te={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 ne(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 re(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 ie(e){var t=re.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 oe(){this.active?this.focusTrap.mount(this.active.dialog,this.settings.selectorFocus):(this.trigger&&(this.trigger.focus(),this.trigger=null),this.focusTrap.unmount())}var se=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(re.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(re.call(t,e.target))):Promise.resolve()}catch(e){return Promise.reject(e)}};function ae(e){if("Escape"===e.key&&this.active&&!this.active.dialog.matches(this.settings.selectorRequired))return this.close()}var ce=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(){});r.stack.remove(n)}();return o&&o.then?o.then(e):e()}}();return Promise.resolve(o&&o.then?o.then(n):n())}catch(e){return Promise.reject(e)}},le=function(e,t,n){void 0===n&&(n=!0);try{var i=function(){return n&&oe.call(o),s.el.dispatchEvent(new CustomEvent(a.customEventPrefix+"opened",{detail:o,bubbles:!0})),s},o=this,s=ne.call(o,e),a=r({},o.settings,s.settings);void 0!==t&&(a.transition=t),o.stack.moveToTop(s);var c=function(){if("closed"===s.state)return s.state="opening",o.stack.add(s),Promise.resolve(j(s.el,a)).then(function(){s.state="opened"})}();return Promise.resolve(c&&c.then?c.then(i):i())}catch(e){return Promise.reject(e)}},ue=function(e,t,n){void 0===n&&(n=!0);try{var i=this,o=e?ne.call(i,e):i.active,s=function(){if(o&&"opened"===o.state){o.state="closing";var e=r({},i.settings,o.settings);return void 0!==t&&(e.transition=t),document.activeElement.blur(),Promise.resolve(C(o.el,e)).then(function(){i.stack.remove(o),n&&oe.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)}},de=function(e,t){try{var n=this,r=[];return Promise.resolve(Promise.all(n.stack.value.map(function(i){try{var o=function(){i.trigger=null},s=function(){if(!e||e!==i.id){var o=r.push;return Promise.resolve(ue.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)}},fe=function(e,t,n){void 0===n&&(n=!0);try{var r,i,o=function(){return n&&oe.call(s),{opened:r,closed:i}},s=this,a=ne.call(s,e),c="opened"===a.state?(r=a,Promise.resolve(de.call(s,a.id,t)).then(function(e){i=e})):(r=le.call(s,a,t,!1),i=de.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)}},he=function(e,t){try{var n=this;return Promise.resolve(ce.call(n,e,!1)).then(function(){var i=n,o={open:function(e,t){return le.call(i,this,e,t)},close:function(e,t){return ue.call(i,this,e,t)},replace:function(e,t){return fe.call(i,this,e,t)},deregister:function(){return ce.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=A(this.el,e,t),this.el)},teleportReturn:function(){return this.returnRef?(this.returnRef=A(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=r({id:e.id,state:"closed",el:e,dialog:t,returnRef:null,settings:L(e,n.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(),n.collection.push(s);var a=function(){if(s.el.classList.contains(n.settings.stateOpened))return Promise.resolve(s.open(!1)).then(function(){});s.el.classList.remove(n.settings.stateOpening),s.el.classList.remove(n.settings.stateClosing),s.el.classList.add(n.settings.stateClosed)}();return a&&a.then?a.then(function(){return s}):s})}catch(e){return Promise.reject(e)}},pe=/*#__PURE__*/c("handleClick"),ve=/*#__PURE__*/c("handleKeydown"),ge=/*#__PURE__*/function(e){function t(t){var n,i,o;return n=e.call(this)||this,Object.defineProperty(s(n),pe,{writable:!0,value:void 0}),Object.defineProperty(s(n),ve,{writable:!0,value:void 0}),n.defaults=te,n.settings=r({},n.defaults,t),n.trigger=null,n.focusTrap=new P,n.stack=(i=n.settings,o=[],{get value(){return[].concat(o)},get top(){return o[o.length-1]},updateIndex:function(){o.forEach(function(e,t){e.el.style.zIndex=null;var n=getComputedStyle(e.el)["z-index"];e.el.style.zIndex=parseInt(n)+t+1})},updateGlobalState:function(){S(this.top,i),this.updateIndex()},add:function(e){e.el.style.zIndex=null;var t=getComputedStyle(e.el)["z-index"];e.el.style.zIndex=parseInt(t)+o.length+1,o.push(e),this.updateGlobalState()},remove:function(e){var t=o.findIndex(function(t){return t.id===e.id});t>=0&&(e.el.style.zIndex=null,o.splice(t,1),this.updateGlobalState())},moveToTop:function(e){var t=o.findIndex(function(t){return t.id===e.id});t>=0&&(o.splice(t,1),this.add(e))}}),l(s(n),pe)[pe]=se.bind(s(n)),l(s(n),ve)[ve]=ae.bind(s(n)),n.settings.autoInit&&n.init(),n}i(t,e);var o=t.prototype;return o.init=function(e){try{var t=this;e&&(t.settings=r({},t.settings,e));var n=document.querySelectorAll(t.settings.selectorModal);return Promise.resolve(t.registerCollection(n)).then(function(){return t.settings.eventListeners&&t.initEventListeners(),t})}catch(e){return Promise.reject(e)}},o.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)}},o.initEventListeners=function(){document.addEventListener("click",l(this,pe)[pe],!1),document.addEventListener("keydown",l(this,ve)[ve],!1)},o.destroyEventListeners=function(){document.removeEventListener("click",l(this,pe)[pe],!1),document.removeEventListener("keydown",l(this,ve)[ve],!1)},o.register=function(e){var t=ie.call(this,e);return t.error?Promise.reject(t.error):he.call(this,t.modal,t.dialog)},o.deregister=function(e){var t=this.get(re.call(this,e));return ce.call(this,t)},o.open=function(e,t,n){return le.call(this,e,t,n)},o.close=function(e,t,n){return ue.call(this,e,t,n)},o.replace=function(e,t,n){return fe.call(this,e,t,n)},o.closeAll=function(e,t,n){void 0===e&&(e=!1),void 0===n&&(n=!0);try{var r=this;return Promise.resolve(de.call(r,e,t)).then(function(e){return n&&oe.call(r),e})}catch(e){return Promise.reject(e)}},n(t,[{key:"active",get:function(){return this.stack.top}}]),t}(v),me={autoInit:!1,selectorPopover:".popover",selectorArrow:".popover__arrow",stateActive:"is-active",eventListeners:!0,eventType:"click",placement:"bottom"};function ye(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=N(),s=n.getPropertyValue("--"+o+"popover-"+i).trim();s&&(r[i]=s)}return r}function be(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 we(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 Ee(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 Pe(e){var t=Ee.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 xe=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(Oe.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)}},Oe=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(we.call(n,e)):Promise.resolve(xe.call(n)).then(t))}catch(e){return Promise.reject(e)}};function Le(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+'"], [aria-describedby="'+e.id+'"]');return t||n||e.close(),e},1)}function ke(e){"opened"===e.state?e.close():(this.trigger=e.trigger,e.open(),je.call(this,e))}function Ae(e){var t=this;switch(e.key){case"Escape":return this.trigger&&this.trigger.focus(),void xe.call(this);case"Tab":return void this.collection.forEach(function(e){Le.call(t,e)});default:return}}function je(e){var t=this;document.addEventListener("click",function n(r){r.target.closest("#"+e.id+', [aria-controls="'+e.id+'"], [aria-describedby="'+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 Ce="top",Se="bottom",De="right",Te="left",_e="auto",qe=[Ce,Se,De,Te],Ie="start",Me="end",Re="viewport",Ne="popper",Be=/*#__PURE__*/qe.reduce(function(e,t){return e.concat([t+"-"+Ie,t+"-"+Me])},[]),$e=/*#__PURE__*/[].concat(qe,[_e]).reduce(function(e,t){return e.concat([t,t+"-"+Ie,t+"-"+Me])},[]),Ve=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Fe(e){return e?(e.nodeName||"").toLowerCase():null}function We(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function He(e){return e instanceof We(e).Element||e instanceof Element}function ze(e){return e instanceof We(e).HTMLElement||e instanceof HTMLElement}function Ke(e){return"undefined"!=typeof ShadowRoot&&(e instanceof We(e).ShadowRoot||e instanceof ShadowRoot)}function Ge(e){return e.split("-")[0]}var Ue=Math.max,Je=Math.min,Xe=Math.round;function Ye(){var e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Qe(){return!/^((?!chrome|android).)*safari/i.test(Ye())}function Ze(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&ze(e)&&(i=e.offsetWidth>0&&Xe(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Xe(r.height)/e.offsetHeight||1);var s=(He(e)?We(e):window).visualViewport,a=!Qe()&&n,c=(r.left+(a&&s?s.offsetLeft:0))/i,l=(r.top+(a&&s?s.offsetTop:0))/o,u=r.width/i,d=r.height/o;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c,x:c,y:l}}function et(e){var t=Ze(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 tt(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Ke(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function nt(e){return We(e).getComputedStyle(e)}function rt(e){return["table","td","th"].indexOf(Fe(e))>=0}function it(e){return((He(e)?e.ownerDocument:e.document)||window.document).documentElement}function ot(e){return"html"===Fe(e)?e:e.assignedSlot||e.parentNode||(Ke(e)?e.host:null)||it(e)}function st(e){return ze(e)&&"fixed"!==nt(e).position?e.offsetParent:null}function at(e){for(var t=We(e),n=st(e);n&&rt(n)&&"static"===nt(n).position;)n=st(n);return n&&("html"===Fe(n)||"body"===Fe(n)&&"static"===nt(n).position)?t:n||function(e){var t=/firefox/i.test(Ye());if(/Trident/i.test(Ye())&&ze(e)&&"fixed"===nt(e).position)return null;var n=ot(e);for(Ke(n)&&(n=n.host);ze(n)&&["html","body"].indexOf(Fe(n))<0;){var r=nt(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 ct(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function lt(e,t,n){return Ue(e,Je(t,n))}function ut(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function dt(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}function ft(e){return e.split("-")[1]}var ht={top:"auto",right:"auto",bottom:"auto",left:"auto"};function pt(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=Te,w=Ce,E=window;if(l){var P=at(n),x="clientHeight",O="clientWidth";P===We(n)&&"static"!==nt(P=it(n)).position&&"absolute"===a&&(x="scrollHeight",O="scrollWidth"),P=P,(i===Ce||(i===Te||i===De)&&o===Me)&&(w=Se,v-=(d&&P===E&&E.visualViewport?E.visualViewport.height:P[x])-r.height,v*=c?1:-1),i!==Te&&(i!==Ce&&i!==Se||o!==Me)||(b=De,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&&ht),A=!0===u?function(e){var t=e.y,n=window.devicePixelRatio||1;return{x:Xe(e.x*n)/n||0,y:Xe(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 vt={passive:!0},gt={left:"right",right:"left",bottom:"top",top:"bottom"};function mt(e){return e.replace(/left|right|bottom|top/g,function(e){return gt[e]})}var yt={start:"end",end:"start"};function bt(e){return e.replace(/start|end/g,function(e){return yt[e]})}function wt(e){var t=We(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Et(e){return Ze(it(e)).left+wt(e).scrollLeft}function Pt(e){var t=nt(e);return/auto|scroll|overlay|hidden/.test(t.overflow+t.overflowY+t.overflowX)}function xt(e){return["html","body","#document"].indexOf(Fe(e))>=0?e.ownerDocument.body:ze(e)&&Pt(e)?e:xt(ot(e))}function Ot(e,t){var n;void 0===t&&(t=[]);var r=xt(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=We(r),s=i?[o].concat(o.visualViewport||[],Pt(r)?r:[]):r,a=t.concat(s);return i?a:a.concat(Ot(ot(s)))}function Lt(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function kt(e,t,n){return t===Re?Lt(function(e,t){var n=We(e),r=it(e),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,c=0;if(i){o=i.width,s=i.height;var l=Qe();(l||!l&&"fixed"===t)&&(a=i.offsetLeft,c=i.offsetTop)}return{width:o,height:s,x:a+Et(e),y:c}}(e,n)):He(t)?function(e,t){var n=Ze(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):Lt(function(e){var t,n=it(e),r=wt(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=Ue(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Ue(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+Et(e),c=-r.scrollTop;return"rtl"===nt(i||n).direction&&(a+=Ue(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:c}}(it(e)))}function At(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?Ge(i):null,s=i?ft(i):null,a=n.x+n.width/2-r.width/2,c=n.y+n.height/2-r.height/2;switch(o){case Ce:t={x:a,y:n.y-r.height};break;case Se:t={x:a,y:n.y+n.height};break;case De:t={x:n.x+n.width,y:c};break;case Te:t={x:n.x-r.width,y:c};break;default:t={x:n.x,y:n.y}}var l=o?ct(o):null;if(null!=l){var u="y"===l?"height":"width";switch(s){case Ie:t[l]=t[l]-(n[u]/2-r[u]/2);break;case Me:t[l]=t[l]+(n[u]/2-r[u]/2)}}return t}function jt(e,t){void 0===t&&(t={});var n=t.placement,r=void 0===n?e.placement:n,i=t.strategy,o=void 0===i?e.strategy:i,s=t.boundary,a=void 0===s?"clippingParents":s,c=t.rootBoundary,l=void 0===c?Re:c,u=t.elementContext,d=void 0===u?Ne:u,f=t.altBoundary,h=void 0!==f&&f,p=t.padding,v=void 0===p?0:p,g=ut("number"!=typeof v?v:dt(v,qe)),m=e.rects.popper,y=e.elements[h?d===Ne?"reference":Ne:d],b=function(e,t,n,r){var i="clippingParents"===t?function(e){var t=Ot(ot(e)),n=["absolute","fixed"].indexOf(nt(e).position)>=0&&ze(e)?at(e):e;return He(n)?t.filter(function(e){return He(e)&&tt(e,n)&&"body"!==Fe(e)}):[]}(e):[].concat(t),o=[].concat(i,[n]),s=o.reduce(function(t,n){var i=kt(e,n,r);return t.top=Ue(i.top,t.top),t.right=Je(i.right,t.right),t.bottom=Je(i.bottom,t.bottom),t.left=Ue(i.left,t.left),t},kt(e,o[0],r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}(He(y)?y:y.contextElement||it(e.elements.popper),a,l,o),w=Ze(e.elements.reference),E=At({reference:w,element:m,strategy:"absolute",placement:r}),P=Lt(Object.assign({},m,E)),x=d===Ne?P:w,O={top:b.top-x.top+g.top,bottom:x.bottom-b.bottom+g.bottom,left:b.left-x.left+g.left,right:x.right-b.right+g.right},L=e.modifiersData.offset;if(d===Ne&&L){var k=L[r];Object.keys(O).forEach(function(e){var t=[De,Se].indexOf(e)>=0?1:-1,n=[Ce,Se].indexOf(e)>=0?"y":"x";O[e]+=k[n]*t})}return O}function Ct(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?$e:s,c=ft(t.placement),l=c?o?Be:Be.filter(function(e){return ft(e)===c}):qe,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]=jt(e,{placement:o,boundary:n,rootBoundary:r,padding:i})[Ge(o)],t},{});return Object.keys(d).sort(function(e,t){return d[e]-d[t]})}function St(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 Dt(e){return[Ce,De,Se,Te].some(function(t){return e[t]>=0})}function Tt(e,t,n){void 0===n&&(n=!1);var r,i,o=ze(t),s=ze(t)&&function(e){var t=e.getBoundingClientRect(),n=Xe(t.width)/e.offsetWidth||1,r=Xe(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),a=it(t),c=Ze(e,s,n),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(o||!o&&!n)&&(("body"!==Fe(t)||Pt(a))&&(l=(r=t)!==We(r)&&ze(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:wt(r)),ze(t)?((u=Ze(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):a&&(u.x=Et(a))),{x:c.left+l.scrollLeft-u.x,y:c.top+l.scrollTop-u.y,width:c.width,height:c.height}}function _t(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 qt={placement:"bottom",modifiers:[],strategy:"absolute"};function It(){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 Mt(e){void 0===e&&(e={});var t=e.defaultModifiers,n=void 0===t?[]:t,r=e.defaultOptions,i=void 0===r?qt:r;return function(e,t,r){void 0===r&&(r=i);var o,s,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},qt,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:He(e)?Ot(e):e.contextElement?Ot(e.contextElement):[],popper:Ot(t)};var s,l,f=function(e){var t=_t(e);return Ve.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(It(t,n)){a.rects={reference:Tt(t,at(n),"fixed"===a.options.strategy),popper:et(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(!It(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 Rt=/*#__PURE__*/Mt({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=We(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&l.forEach(function(e){e.addEventListener("scroll",n.update,vt)}),a&&c.addEventListener("resize",n.update,vt),function(){o&&l.forEach(function(e){e.removeEventListener("scroll",n.update,vt)}),a&&c.removeEventListener("resize",n.update,vt)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state;t.modifiersData[e.name]=At({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:Ge(t.placement),variation:ft(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,pt(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,pt(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];ze(i)&&Fe(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},{});ze(r)&&Fe(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=$e.reduce(function(e,n){return e[n]=function(e,t,n){var r=Ge(e),i=[Te,Ce].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,[Te,De].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=Ge(g),y=c||(m!==g&&p?function(e){if(Ge(e)===_e)return[];var t=mt(e);return[bt(e),t,bt(t)]}(g):[mt(g)]),b=[g].concat(y).reduce(function(e,n){return e.concat(Ge(n)===_e?Ct(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=Ge(k),j=ft(k)===Ie,C=[Ce,Se].indexOf(A)>=0,S=C?"width":"height",D=jt(t,{placement:k,boundary:u,rootBoundary:d,altBoundary:f,padding:l}),T=C?j?De:Te:j?Se:Ce;w[S]>E[S]&&(T=mt(T));var _=mt(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=jt(t,{boundary:n.boundary,rootBoundary:n.rootBoundary,padding:n.padding,altBoundary:n.altBoundary}),h=Ge(t.placement),p=ft(t.placement),v=!p,g=ct(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?Ce:Te,A="y"===g?Se:De,j="y"===g?"height":"width",C=y[g],S=C+f[k],D=C-f[A],T=l?-w[j]/2:0,_=p===Ie?b[j]:w[j],q=p===Ie?-w[j]:-b[j],I=t.elements.arrow,M=l&&I?et(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],$=lt(0,b[j],M[j]),V=v?b[j]/2-T-$-N-P.mainAxis:_-$-N-P.mainAxis,F=v?-b[j]/2+T+$+B+P.mainAxis:q+$+B+P.mainAxis,W=t.elements.arrow&&at(t.elements.arrow),H=null!=(L=null==x?void 0:x[g])?L:0,z=C+F-H,K=lt(l?Je(S,C+V-H-(W?"y"===g?W.clientTop||0:W.clientLeft||0:0)):S,C,l?Ue(D,z):D);y[g]=K,O[g]=K-C}if(a){var G,U=y[m],J="y"===m?"height":"width",X=U+f["x"===g?Ce:Te],Y=U-f["x"===g?Se:De],Q=-1!==[Ce,Te].indexOf(h),Z=null!=(G=null==x?void 0:x[m])?G:0,ee=Q?X:U-b[J]-w[J]-Z+P.altAxis,te=Q?U+b[J]+w[J]-Z-P.altAxis:Y,ne=l&&Q?function(e,t,n){var r=lt(e,t,n);return r>n?n:r}(ee,U,te):lt(l?ee:X,U,l?te:Y);y[m]=ne,O[m]=ne-U}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=Ge(n.placement),c=ct(a),l=[Te,De].indexOf(a)>=0?"height":"width";if(o&&s){var u=function(e,t){return ut("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:dt(e,qe))}(i.padding,n),d=et(o),f="y"===c?Ce:Te,h="y"===c?Se:De,p=n.rects.reference[l]+n.rects.reference[c]-s[c]-n.rects.popper[l],v=s[c]-n.rects.reference[c],g=at(o),m=g?"y"===c?g.clientHeight||0:g.clientWidth||0:0,y=m/2-d[l]/2+(p/2-v/2),b=lt(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)))&&tt(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=jt(t,{elementContext:"reference"}),a=jt(t,{altBoundary:!0}),c=St(s,r),l=St(a,i,o),u=Dt(c),d=Dt(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})}}]}),Nt=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(),Bt(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 Bt(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 $t=function(e){try{var t=this,n=we.call(t,e);return n.el.classList.add(t.settings.stateActive),n.trigger.hasAttribute("aria-controls")&&n.trigger.setAttribute("aria-expanded","true"),n.config=ye(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:be(r["overflow-padding"])}},{name:"flip",options:{padding:be(r["flip-padding"])}},{name:"arrow",options:{element:r["arrow-element"],padding:be(r["arrow-padding"])}}]))}),n.popper.update(),n.state="opened",Promise.resolve(n)}catch(e){return Promise.reject(e)}var r},Vt=function(e,t){try{var n=this;Nt.call(n,e);var i=n,o={open:function(){return $t.call(i,this)},close:function(){return Oe.call(i,this)},deregister:function(){return Nt.call(i,this)}},s=r({id:e.id,state:"closed",el:e,trigger:t,popper:Rt(t,e),config:ye(e,n.settings)},o);s.trigger.hasAttribute("aria-controls")&&s.trigger.setAttribute("aria-expanded","false"),Ft.call(n,s),n.collection.push(s);var a=function(){if(s.el.classList.contains(n.settings.stateActive))return Promise.resolve(s.open()).then(function(){je.call(n,s)})}();return Promise.resolve(a&&a.then?a.then(function(){return s}):s)}catch(e){return Promise.reject(e)}};function Ft(e){return e.__eventListeners||("hover"===e.config.event?(e.__eventListeners=[{el:["trigger"],type:["mouseenter","focus"],listener:$t.bind(this,e)},{el:["el","trigger"],type:["mouseleave","focusout"],listener:Le.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:ke.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 Wt=/*#__PURE__*/c("handleKeydown"),Ht=/*#__PURE__*/function(e){function t(t){var n;return n=e.call(this)||this,Object.defineProperty(s(n),Wt,{writable:!0,value:void 0}),n.defaults=me,n.settings=r({},n.defaults,t),n.trigger=null,l(s(n),Wt)[Wt]=Ae.bind(s(n)),n.settings.autoInit&&n.init(),n}i(t,e);var n=t.prototype;return n.init=function(e){try{var t=this;e&&(t.settings=r({},t.settings,e));var n=document.querySelectorAll(t.settings.selectorPopover);return Promise.resolve(t.registerCollection(n)).then(function(){return t.settings.eventListeners&&t.initEventListeners(!1),t})}catch(e){return Promise.reject(e)}},n.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)}},n.initEventListeners=function(e){var t=this;void 0===e&&(e=!0),e&&this.collection.forEach(function(e){Ft.call(t,e)}),document.addEventListener("keydown",l(this,Wt)[Wt],!1)},n.destroyEventListeners=function(e){void 0===e&&(e=!0),e&&this.collection.forEach(function(e){Bt(e)}),document.removeEventListener("keydown",l(this,Wt)[Wt],!1)},n.register=function(e){var t=Pe.call(this,e);return t.error?Promise.reject(t.error):Vt.call(this,t.popover,t.trigger)},n.deregister=function(e){var t=this.get(Ee.call(this,e));return Nt.call(this,t)},n.open=function(e){return $t.call(this,e)},n.close=function(e){return Oe.call(this,e)},t}(v);e.Checkbox=_,e.Drawer=ee,e.Modal=ge,e.Popover=Ht,e.core=D});
2
2
  //# sourceMappingURL=scripts.umd.js.map