text: var AccessibleMenuBootstrap4=function(){"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(t,n){try{if("object"!==e(n)){var r=e(n);throw new TypeError("AccessibleMenu: Elements given to isValidInstance() must be inside of an object. ".concat(r," given."))}for(var o in n)if(!(n[o]instanceof t)){var i=e(n[o]);throw new TypeError("AccessibleMenu: ".concat(o," must be an instance of ").concat(t.name,". ").concat(i," given."))}return!0}catch(e){return console.error(e),!1}}function n(t,n){try{if("object"!==e(n)){var r=e(n);throw new TypeError("AccessibleMenu: Values given to isValidType() must be inside of an object. ".concat(r," given."))}for(var o in n){var i=e(n[o]);if(i!==t)throw new TypeError("AccessibleMenu: ".concat(o," must be a ").concat(t,". ").concat(i," given."))}return!0}catch(e){return console.error(e),!1}}function r(t){try{if("object"!==e(t)){var n=e(t);throw new TypeError("AccessibleMenu: Values given to isCSSSelector() must be inside of an object. ".concat(n," given."))}for(var r in t)try{if(null===t[r])throw new Error;document.querySelector(t[r])}catch(e){throw new TypeError("AccessibleMenu: ".concat(r,' must be a valid CSS selector. "').concat(t[r],'" given.'))}return!0}catch(e){return console.error(e),!1}}function o(t){try{if("object"!==e(t)||Array.isArray(t)){var n=e(t);throw new TypeError("AccessibleMenu: Values given to isValidClassList() must be inside of an object. ".concat(n," given."))}var o=function(n){var o=e(t[n]);if("string"!==o){if(!Array.isArray(t[n]))throw new TypeError("AccessibleMenu: ".concat(n," must be a string or an array of strings. ").concat(o," given."));t[n].forEach((function(e){if("string"!=typeof e)throw new TypeError("AccessibleMenu: ".concat(n," must be a string or an array of strings. An array containing non-strings given."))}))}else{var i={};i[n]=t[n],r(i)}};for(var i in t)o(i);return!0}catch(e){return console.error(e),!1}}function i(t){try{if("object"!==e(t)){var n=e(t);throw new TypeError("AccessibleMenu: Values given to isValidHoverType() must be inside of an object. ".concat(n," given."))}var r=["off","on","dynamic"];for(var o in t)if(!r.includes(t[o]))throw new TypeError("AccessibleMenu: ".concat(o," must be one of the following values: ").concat(r.join(", "),'. "').concat(t[o],'" given.'));return!0}catch(e){return console.error(e),!1}}function u(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var a=function(){function e(t){var n=t.menuToggleElement,r=t.parentElement,o=t.controlledMenu,i=t.parentMenu,u=void 0===i?null:i;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),s(this,"_dom",{toggle:null,parent:null}),s(this,"_elements",{controlledMenu:null,parentMenu:null}),s(this,"_open",!1),s(this,"_expandEvent",new CustomEvent("accessibleMenuExpand",{bubbles:!0,detail:{toggle:this}})),s(this,"_collapseEvent",new CustomEvent("accessibleMenuCollapse",{bubbles:!0,detail:{toggle:this}})),this._dom.toggle=n,this._dom.parent=r,this._elements.controlledMenu=o,this._elements.parentMenu=u}var r,o,i;return r=e,o=[{key:"initialize",value:function(){if(this.dom.toggle.setAttribute("aria-haspopup","true"),this.dom.toggle.setAttribute("aria-expanded","false"),function(e,r){if(n("string",{tagName:e})&&t(HTMLElement,r)){var o=e.toLowerCase(),i=!0;for(var u in r)r[u].tagName.toLowerCase()!==o&&(i=!1);return i}return!1}("button",{toggle:this.dom.toggle})||this.dom.toggle.setAttribute("role","button"),""===this.dom.toggle.id||""===this.elements.controlledMenu.dom.menu.id){var e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,10),r=this.dom.toggle.innerText.replace(/[^a-zA-Z0-9\s]/g,""),o=e;!r.replace(/\s/g,"").length&&this.dom.toggle.getAttribute("aria-label")&&(r=this.dom.toggle.getAttribute("aria-label").replace(/[^a-zA-Z0-9\s]/g,"")),r.replace(/\s/g,"").length>0&&((r=r.toLowerCase().replace(/\s+/g,"-")).startsWith("-")&&(r=r.substring(1)),r.endsWith("-")&&(r=r.slice(0,-1)),o="".concat(r,"-").concat(o)),this.dom.toggle.id=this.dom.toggle.id||"".concat(o,"-menu-button"),this.elements.controlledMenu.dom.menu.id=this.elements.controlledMenu.dom.menu.id||"".concat(o,"-menu")}this.elements.controlledMenu.dom.menu.setAttribute("aria-labelledby",this.dom.toggle.id),this.dom.toggle.setAttribute("aria-controls",this.elements.controlledMenu.dom.menu.id),this._collapse(!1)}},{key:"dom",get:function(){return this._dom}},{key:"elements",get:function(){return this._elements}},{key:"isOpen",get:function(){return this._open},set:function(e){n("boolean",{value:e}),this._open=e}},{key:"_expand",value:function(){var e,t,n=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=this.elements.controlledMenu,o=r.closeClass,i=r.openClass;this.dom.toggle.setAttribute("aria-expanded","true"),""!==i&&("string"==typeof i?this.elements.controlledMenu.dom.menu.classList.add(i):(e=this.elements.controlledMenu.dom.menu.classList).add.apply(e,u(i))),""!==o&&("string"==typeof o?this.elements.controlledMenu.dom.menu.classList.remove(o):(t=this.elements.controlledMenu.dom.menu.classList).remove.apply(t,u(o))),n&&this.dom.toggle.dispatchEvent(this._expandEvent)}},{key:"_collapse",value:function(){var e,t,n=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=this.elements.controlledMenu,o=r.closeClass,i=r.openClass;this.dom.toggle.setAttribute("aria-expanded","false"),""!==o&&("string"==typeof o?this.elements.controlledMenu.dom.menu.classList.add(o):(e=this.elements.controlledMenu.dom.menu.classList).add.apply(e,u(o))),""!==i&&("string"==typeof i?this.elements.controlledMenu.dom.menu.classList.remove(i):(t=this.elements.controlledMenu.dom.menu.classList).remove.apply(t,u(i))),n&&this.dom.toggle.dispatchEvent(this._collapseEvent)}},{key:"open",value:function(){this.elements.controlledMenu.focusState="self",this._expand(),this.isOpen=!0}},{key:"preview",value:function(){this.elements.parentMenu&&(this.elements.parentMenu.focusState="self"),this._expand(),this.isOpen=!0}},{key:"close",value:function(){this.isOpen&&(this.elements.controlledMenu.currentChild=0,this.elements.controlledMenu.blur(),this.elements.parentMenu&&(this.elements.parentMenu.focusState="self"),this._collapse(),this.isOpen=!1)}},{key:"toggle",value:function(){this.isOpen?this.close():this.open()}},{key:"closeSiblings",value:function(){var e=this;this.elements.parentMenu&&this.elements.parentMenu.elements.submenuToggles.forEach((function(t){t!==e&&t.close()}))}},{key:"closeChildren",value:function(){this.elements.controlledMenu.elements.submenuToggles.forEach((function(e){return e.close()}))}}],o&&c(r.prototype,o),i&&c(r,i),e}();function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var p=function(){function e(t){var n=t.menuItemElement,r=t.menuLinkElement,o=t.parentMenu,i=t.isSubmenuItem,u=void 0!==i&&i,l=t.childMenu,c=void 0===l?null:l,s=t.toggle,a=void 0===s?null:s;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),m(this,"_dom",{item:null,link:null}),m(this,"_elements",{parentMenu:null,childMenu:null,toggle:null}),m(this,"_submenu",!1),this._dom.item=n,this._dom.link=r,this._elements.parentMenu=o,this._elements.childMenu=c,this._elements.toggle=a,this._submenu=u}var t,n,r;return t=e,(n=[{key:"initialize",value:function(){}},{key:"dom",get:function(){return this._dom}},{key:"elements",get:function(){return this._elements}},{key:"isSubmenuItem",get:function(){return this._submenu}},{key:"focus",value:function(){this.elements.parentMenu.shouldFocus&&this.dom.link.focus()}},{key:"blur",value:function(){this.elements.parentMenu.shouldFocus&&this.dom.link.blur()}}])&&f(t.prototype,n),r&&f(t,r),e}();function h(e){try{var t=e.key||e.keyCode,n={Enter:"Enter"===t||13===t,Space:" "===t||"Spacebar"===t||32===t,Escape:"Escape"===t||"Esc"===t||27===t,ArrowUp:"ArrowUp"===t||"Up"===t||38===t,ArrowRight:"ArrowRight"===t||"Right"===t||39===t,ArrowDown:"ArrowDown"===t||"Down"===t||40===t,ArrowLeft:"ArrowLeft"===t||"Left"===t||37===t,Home:"Home"===t||36===t,End:"End"===t||35===t,Character:isNaN(t)&&!!t.match(/^[a-zA-Z]{1}$/),Tab:"Tab"===t||9===t,Asterisk:"*"===t||56===t};return Object.keys(n).find((function(e){return!0===n[e]}))||""}catch(e){return""}}function y(e){e.preventDefault(),e.stopPropagation()}function d(e){return function(e){if(Array.isArray(e))return v(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return v(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return v(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function b(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var w=function(){function u(e){var t=e.menuElement,n=e.menuItemSelector,r=void 0===n?"li":n,o=e.menuLinkSelector,i=void 0===o?"a":o,l=e.submenuItemSelector,c=void 0===l?"":l,s=e.submenuToggleSelector,f=void 0===s?"a":s,m=e.submenuSelector,h=void 0===m?"ul":m,y=e.controllerElement,d=void 0===y?null:y,v=e.containerElement,b=void 0===v?null:v,w=e.openClass,M=void 0===w?"show":w,_=e.closeClass,E=void 0===_?"hide":_,S=e.isTopLevel,O=void 0===S||S,C=e.parentMenu,T=void 0===C?null:C,I=e.hoverType,k=void 0===I?"off":I,j=e.hoverDelay,A=void 0===j?250:j;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),g(this,"_MenuType",u),g(this,"_MenuItemType",p),g(this,"_MenuToggleType",a),g(this,"_dom",{menu:null,menuItems:[],submenuItems:[],submenuToggles:[],submenus:[],controller:null,container:null}),g(this,"_selectors",{menuItems:"",menuLinks:"",submenuItems:"",submenuToggles:"",submenus:""}),g(this,"_elements",{menuItems:[],submenuToggles:[],controller:null,parentMenu:null,rootMenu:null}),g(this,"_openClass","show"),g(this,"_closeClass","hide"),g(this,"_root",!0),g(this,"_currentChild",0),g(this,"_focusState","none"),g(this,"_currentEvent","none"),g(this,"_hoverType","off"),g(this,"_hoverDelay",250),this._dom.menu=t,this._dom.controller=d,this._dom.container=b,this._selectors.menuItems=r,this._selectors.menuLinks=i,this._selectors.submenuItems=c,this._selectors.submenuToggles=f,this._selectors.submenus=h,this._elements.menuItems=[],this._elements.submenuToggles=[],this._elements.controller=null,this._elements.parentMenu=T,this._elements.rootMenu=O?this:null,this._openClass=M||"",this._closeClass=E||"",this._root=O,this._hoverType=k,this._hoverDelay=A}var l,c,s;return l=u,c=[{key:"initialize",value:function(){if(!this._validate())throw new Error("AccesibleMenu: cannot initialize menu. See other error messages for more information.");if(null===this.elements.rootMenu&&this._findRootMenu(this),this._setDOMElements(),this.isTopLevel&&this.dom.controller&&this.dom.container){var e=new this._MenuToggleType({menuToggleElement:this.dom.controller,parentElement:this.dom.container,controlledMenu:this});this._elements.controller=e}this._createChildElements()}},{key:"dom",get:function(){return this._dom}},{key:"selectors",get:function(){return this._selectors}},{key:"elements",get:function(){return this._elements}},{key:"isTopLevel",get:function(){return this._root}},{key:"openClass",get:function(){return this.isTopLevel?this._openClass:this.elements.rootMenu.openClass},set:function(e){o({openClass:e}),this._openClass!==e&&(this._openClass=e)}},{key:"closeClass",get:function(){return this.isTopLevel?this._closeClass:this.elements.rootMenu.closeClass},set:function(e){o({closeClass:e}),this._closeClass!==e&&(this._closeClass=e)}},{key:"currentChild",get:function(){return this._currentChild},set:function(e){function t(e){if(["mouse","character"].includes(e.currentEvent)&&e.elements.parentMenu)for(var t=0,n=!1;!n&&t<e.elements.parentMenu.elements.menuItems.length;){var r=e.elements.parentMenu.elements.menuItems[t];r.isSubmenuItem&&r.elements.toggle.elements.controlledMenu===e&&(n=!0,e.elements.parentMenu.currentEvent=e.currentEvent,e.elements.parentMenu.currentChild=t),t++}}n("number",{value:e}),e<-1?(this._currentChild=-1,t(this)):e>=this.elements.menuItems.length?(this._currentChild=this.elements.menuItems.length-1,t(this)):this.focusChild!==e&&(this._currentChild=e,t(this))}},{key:"focusState",get:function(){return this._focusState},set:function(t){!function(t){try{if("object"!==e(t)){var n=e(t);throw new TypeError("AccessibleMenu: Values given to isValidState() must be inside of an object. ".concat(n," given."))}var r=["none","self","child"];for(var o in t)if(!r.includes(t[o]))throw new TypeError("AccessibleMenu: ".concat(o," must be one of the following values: ").concat(r.join(", "),'. "').concat(t[o],'" given.'))}catch(e){return console.error(e),!1}}({value:t}),this._focusState!==t&&(this._focusState=t),this.elements.submenuToggles.length>0&&("self"===t||"none"===t)&&this.elements.submenuToggles.forEach((function(e){e.elements.controlledMenu.focusState="none"})),!this.elements.parentMenu||"self"!==t&&"child"!==t||(this.elements.parentMenu.focusState="child")}},{key:"currentEvent",get:function(){return this._currentEvent},set:function(t){!function(t){try{if("object"!==e(t)){var n=e(t);throw new TypeError("AccessibleMenu: Values given to isValidEvent() must be inside of an object. ".concat(n," given."))}var r=["none","mouse","keyboard","character"];for(var o in t)if(!r.includes(t[o]))throw new TypeError("AccessibleMenu: ".concat(o," must be one of the following values: ").concat(r.join(", "),'. "').concat(t[o],'" given.'))}catch(e){return console.error(e),!1}}({value:t}),this._currentEvent!==t&&(this._currentEvent=t,this.elements.submenuToggles.length>0&&this.elements.submenuToggles.forEach((function(e){e.elements.controlledMenu.currentEvent=t})))}},{key:"currentMenuItem",get:function(){return this.elements.menuItems[this.currentChild]}},{key:"hoverType",get:function(){return this._root?this._hoverType:this.elements.rootMenu.hoverType},set:function(e){i({value:e}),this._hoverType!==e&&(this._hoverType=e)}},{key:"hoverDelay",get:function(){return this._root?this._hoverDelay:this.elements.rootMenu.hoverDelay},set:function(e){n("number",{value:e}),this._hoverDelay!==e&&(this._hoverDelay=e)}},{key:"shouldFocus",get:function(){var e=!1;return"keyboard"!==this.currentEvent&&"character"!==this.currentEvent||(e=!0),"mouse"===this.currentEvent&&"dynamic"===this.hoverType&&(e=!0),e}},{key:"_validate",value:function(){var e=!0;return null!==this._dom.container||null!==this._dom.controller?t(HTMLElement,{menuElement:this._dom.menu,controllerElement:this._dom.controller,containerElement:this._dom.container})||(e=!1):t(HTMLElement,{menuElement:this._dom.menu})||(e=!1),""!==this._selectors.submenuItems?r({menuItemSelector:this._selectors.menuItems,menuLinkSelector:this._selectors.menuLinks,submenuItemSelector:this._selectors.submenuItems,submenuToggleSelector:this._selectors.submenuToggles,submenuSelector:this._selectors.submenus})||(e=!1):r({menuItemSelector:this._selectors.menuItems,menuLinkSelector:this._selectors.menuLinks})||(e=!1),""===this._openClass||o({openClass:this._openClass})||(e=!1),""===this._closeClass||o({closeClass:this._closeClass})||(e=!1),n("boolean",{isTopLevel:this._root})||(e=!1),null===this._elements.parentMenu||t(u,{parentMenu:this._elements.parentMenu})||(e=!1),i({hoverType:this._hoverType})||(e=!1),n("number",{hoverDelay:this._hoverDelay})||(e=!1),e}},{key:"_setDOMElementType",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dom.menu,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if("string"!=typeof this.selectors[e])throw new Error('AccessibleMenu: "'.concat(e,'" is not a valid element type within the menu.'));if(!Array.isArray(this.dom[e]))throw new Error('AccessibleMenu: The "'.concat(e,'" element cannot be set through _setDOMElementType.'));n!==this.dom.menu&&t(HTMLElement,{base:n});var o=Array.from(n.querySelectorAll(this.selectors[e])),i=o.filter((function(e){return e.parentElement===n}));this._dom[e]=r?i:[].concat(d(this._dom[e]),d(i))}},{key:"_resetDOMElementType",value:function(e){if(void 0===this.dom[e])throw new Error('AccessibleMenu: "'.concat(e,'" is not a valid element type within the menu.'));if(!Array.isArray(this.dom[e]))throw new Error('AccessibleMenu: The "'.concat(e,'" element cannot be reset through _resetDOMElementType.'));this._dom[e]=[]}},{key:"_setDOMElements",value:function(){var e=this;this._setDOMElementType("menuItems"),""!==this.selectors.submenuItems&&(this._setDOMElementType("submenuItems"),this._resetDOMElementType("submenuToggles"),this._resetDOMElementType("submenus"),this.dom.submenuItems.forEach((function(t){e._setDOMElementType("submenuToggles",t,!1),e._setDOMElementType("submenus",t,!1)})))}},{key:"_findRootMenu",value:function(e){if(e.isTopLevel)this._elements.rootMenu=e;else{if(null===e.elements.parentMenu)throw new Error("Cannot find root menu.");this._findRootMenu(e.elements.parentMenu)}}},{key:"_createChildElements",value:function(){var e=this;this.dom.menuItems.forEach((function(t){var n;if(e.dom.submenuItems.includes(t)){var r=t.querySelector(e.selectors.submenuToggles),o=t.querySelector(e.selectors.submenus),i=new e._MenuType({menuElement:o,menuItemSelector:e.selectors.menuItems,menuLinkSelector:e.selectors.menuLinks,submenuItemSelector:e.selectors.submenuItems,submenuToggleSelector:e.selectors.submenuToggles,submenuSelector:e.selectors.submenus,openClass:e.openClass,closeClass:e.closeClass,isTopLevel:!1,parentMenu:e,hoverType:e.hoverType,hoverDelay:e.hoverDelay}),u=new e._MenuToggleType({menuToggleElement:r,parentElement:t,controlledMenu:i,parentMenu:e});e._elements.submenuToggles.push(u),n=new e._MenuItemType({menuItemElement:t,menuLinkElement:r,parentMenu:e,isSubmenuItem:!0,childMenu:i,toggle:u})}else{var l=t.querySelector(e.selectors.menuLinks);n=new e._MenuItemType({menuItemElement:t,menuLinkElement:l,parentMenu:e})}e._elements.menuItems.push(n)}))}},{key:"_handleFocus",value:function(){var e=this;this.elements.menuItems.forEach((function(t,n){t.dom.link.addEventListener("focus",(function(){e.focusState="self",e.currentChild=n}))}))}},{key:"_handleClick",value:function(){var e=this;function t(e,t,n){y(n),t.toggle(),t.isOpen&&(e.focusState="self",t.elements.controlledMenu.focusState="none")}this.elements.menuItems.forEach((function(n,r){n.dom.link.addEventListener("pointerdown",(function(){e.currentEvent="mouse",e.elements.rootMenu.blurChildren(),e.focusChild(r)}),{passive:!0}),n.isSubmenuItem&&n.elements.toggle.dom.toggle.addEventListener("pointerup",(function(r){e.currentEvent="mouse",t(e,n.elements.toggle,r)}))})),this.isTopLevel&&this.elements.controller&&this.elements.controller.dom.toggle.addEventListener("pointerup",(function(n){e.currentEvent="mouse",t(e,e.elements.controller,n)}))}},{key:"_handleHover",value:function(){var e=this;this.elements.menuItems.forEach((function(t,n){t.dom.link.addEventListener("pointerenter",(function(r){if("pen"!==r.pointerType&&"touch"!==r.pointerType)if("on"===e.hoverType)e.currentEvent="mouse",e.currentChild=n,t.isSubmenuItem&&t.elements.toggle.preview();else if("dynamic"===e.hoverType){var o=e.elements.submenuToggles.some((function(e){return e.isOpen}));e.currentChild=n,e.isTopLevel&&"none"===e.focusState||(e.currentEvent="mouse",e.focusCurrentChild()),!t.isSubmenuItem||e.isTopLevel&&!o||(e.currentEvent="mouse",t.elements.toggle.preview())}})),t.isSubmenuItem&&t.dom.item.addEventListener("pointerleave",(function(n){"pen"!==n.pointerType&&"touch"!==n.pointerType&&("on"===e.hoverType?e.hoverDelay>0?setTimeout((function(){e.currentEvent="mouse",t.elements.toggle.close()}),e.hoverDelay):(e.currentEvent="mouse",t.elements.toggle.close()):"dynamic"===e.hoverType&&(e.isTopLevel||(e.hoverDelay>0?setTimeout((function(){e.currentEvent="mouse",t.elements.toggle.close(),e.focusCurrentChild()}),e.hoverDelay):(e.currentEvent="mouse",t.elements.toggle.close(),e.focusCurrentChild()))))}))}))}},{key:"_handleKeydown",value:function(){var e=this;this.isTopLevel&&this.elements.controller&&this.elements.controller.dom.toggle.addEventListener("keydown",(function(t){e.currentEvent="keyboard";var n=h(t);"Space"!==n&&"Enter"!==n||y(t)}))}},{key:"_handleKeyup",value:function(){var e=this;this.isTopLevel&&this.elements.controller&&this.elements.controller.dom.toggle.addEventListener("keyup",(function(t){e.currentEvent="keyboard";var n=h(t);"Space"!==n&&"Enter"!==n||(y(t),e.elements.controller.open(),e.focusFirstChild())}))}},{key:"focus",value:function(){this.focusState="self",this.shouldFocus&&this.dom.menu.focus()}},{key:"blur",value:function(){this.focusState="none",this.shouldFocus&&this.dom.menu.blur()}},{key:"focusCurrentChild",value:function(){this.focusState="self",-1!==this.currentChild&&this.currentMenuItem.focus()}},{key:"focusChild",value:function(e){this.blurCurrentChild(),this.currentChild=e,this.focusCurrentChild()}},{key:"focusFirstChild",value:function(){this.focusChild(0)}},{key:"focusLastChild",value:function(){this.focusChild(this.elements.menuItems.length-1)}},{key:"focusNextChild",value:function(){this.currentChild<this.elements.menuItems.length-1?this.focusChild(this.currentChild+1):this.focusCurrentChild()}},{key:"focusPreviousChild",value:function(){this.currentChild>0?this.focusChild(this.currentChild-1):this.focusCurrentChild()}},{key:"blurCurrentChild",value:function(){this.focusState="none",-1!==this.currentChild&&this.currentMenuItem.blur()}},{key:"focusController",value:function(){this.dom.controller&&(this.shouldFocus&&this.dom.controller.focus(),this.focusState="none")}},{key:"focusContainer",value:function(){this.dom.container&&(this.shouldFocus&&this.dom.container.focus(),this.focusState="none")}},{key:"closeChildren",value:function(){this.elements.submenuToggles.forEach((function(e){return e.close()}))}},{key:"blurChildren",value:function(){this.elements.menuItems.forEach((function(e){e.blur(),e.isSubmenuItem&&e.elements.childMenu.blurChildren()}))}}],c&&b(l.prototype,c),s&&b(l,s),u}();function M(e){return M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},M(e)}function _(e,t){return _=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},_(e,t)}function E(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return S(this,n)}}function S(e,t){if(t&&("object"===M(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function O(e){return O=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},O(e)}var C=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_(e,t)}(n,e);var t=E(n);function n(e){var r,o=e.menuItemElement,i=e.menuLinkElement,u=e.parentMenu,l=e.isSubmenuItem,c=void 0!==l&&l,s=e.childMenu,a=void 0===s?null:s,f=e.toggle,m=void 0===f?null:f,p=e.initialize,h=void 0===p||p;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),r=t.call(this,{menuItemElement:o,menuLinkElement:i,parentMenu:u,isSubmenuItem:c,childMenu:a,toggle:m}),h&&r.initialize(),r}return n}(p);function T(e){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},T(e)}function I(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function k(){return k="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=j(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},k.apply(this,arguments)}function j(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=P(e)););return e}function A(e,t){return A=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},A(e,t)}function L(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=P(e);if(t){var o=P(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return R(this,n)}}function R(e,t){if(t&&("object"===T(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function P(e){return P=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},P(e)}var x=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&A(e,t)}(i,e);var t,n,r,o=L(i);function i(e){var t,n=e.menuToggleElement,r=e.parentElement,u=e.controlledMenu,l=e.parentMenu,c=void 0===l?null:l,s=e.initialize,a=void 0===s||s;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),t=o.call(this,{menuToggleElement:n,parentElement:r,controlledMenu:u,parentMenu:c}),a&&t.initialize(),t}return t=i,(n=[{key:"open",value:function(){this.closeSiblings(),k(P(i.prototype),"open",this).call(this)}},{key:"preview",value:function(){this.closeSiblings(),k(P(i.prototype),"preview",this).call(this)}},{key:"close",value:function(){this.isOpen&&this.closeChildren(),k(P(i.prototype),"close",this).call(this)}}])&&I(t.prototype,n),r&&I(t,r),i}(a);function D(e){return D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},D(e)}function z(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function B(){return B="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=K(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},B.apply(this,arguments)}function K(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=V(e)););return e}function F(e,t){return F=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},F(e,t)}function N(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=V(e);if(t){var o=V(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return H(this,n)}}function H(e,t){if(t&&("object"===D(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return U(e)}function U(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function V(e){return V=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},V(e)}function q(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var $=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&F(e,t)}(u,e);var t,r,o,i=N(u);function u(e){var t,n=e.menuElement,r=e.menuItemSelector,o=void 0===r?"li":r,l=e.menuLinkSelector,c=void 0===l?"a":l,s=e.submenuItemSelector,a=void 0===s?"":s,f=e.submenuToggleSelector,m=void 0===f?"a":f,p=e.submenuSelector,h=void 0===p?"ul":p,y=e.controllerElement,d=void 0===y?null:y,v=e.containerElement,b=void 0===v?null:v,g=e.openClass,w=void 0===g?"show":g,M=e.closeClass,_=void 0===M?"hide":M,E=e.isTopLevel,S=void 0===E||E,O=e.parentMenu,T=void 0===O?null:O,I=e.hoverType,k=void 0===I?"off":I,j=e.hoverDelay,A=void 0===j?250:j,L=e.optionalKeySupport,R=void 0!==L&&L,P=e.initialize,D=void 0===P||P;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),q(U(t=i.call(this,{menuElement:n,menuItemSelector:o,menuLinkSelector:c,submenuItemSelector:a,submenuToggleSelector:m,submenuSelector:h,controllerElement:d,containerElement:b,openClass:w,closeClass:_,isTopLevel:S,parentMenu:T,hoverType:k,hoverDelay:A})),"_MenuType",u),q(U(t),"_MenuItemType",C),q(U(t),"_MenuToggleType",x),q(U(t),"_currentChild",-1),q(U(t),"_optionalSupport",!1),t._optionalSupport=R,D&&t.initialize(),t}return t=u,(r=[{key:"initialize",value:function(){try{B(V(u.prototype),"initialize",this).call(this),this._handleFocus(),this._handleClick(),this._handleHover(),this._handleKeydown(),this._handleKeyup()}catch(e){console.error(e)}}},{key:"optionalKeySupport",get:function(){return this.isTopLevel?this._optionalSupport:this.elements.rootMenu.optionalKeySupport},set:function(e){n("boolean",{optionalKeySupport:e}),this._optionalSupport=e}},{key:"_validate",value:function(){var e=B(V(u.prototype),"_validate",this).call(this);return n("boolean",{optionalKeySupport:this._optionalSupport})||(e=!1),e}},{key:"_handleClick",value:function(){var e=this;B(V(u.prototype),"_handleClick",this).call(this),document.addEventListener("pointerup",(function(t){"none"!==e.focusState&&(e.currentEvent="mouse",e.dom.menu.contains(t.target)||!e.dom.menu===t.target||(e.closeChildren(),e.blur(),e.elements.controller&&e.elements.controller.close()))}))}},{key:"_handleKeydown",value:function(){var e=this;B(V(u.prototype),"_handleKeydown",this).call(this),this.dom.menu.addEventListener("keydown",(function(t){e.currentEvent="keyboard";var n=h(t);"self"===e.focusState&&(e.optionalKeySupport?["ArrowUp","ArrowRight","ArrowDown","ArrowLeft","Home","End"].includes(n)&&y(t):(e.currentMenuItem.isSubmenuItem&&["Space","Enter"].includes(n)||e.elements.controller&&["Escape"].includes(n)||e.elements.parentMenu&&["Escape"].includes(n))&&y(t))}))}},{key:"_handleKeyup",value:function(){var e=this;B(V(u.prototype),"_handleKeyup",this).call(this),this.dom.menu.addEventListener("keyup",(function(t){e.currentEvent="keyboard";var n=h(t);"self"===e.focusState&&("Space"===n||"Enter"===n?e.currentMenuItem.isSubmenuItem?(y(t),e.currentMenuItem.elements.toggle.preview()):e.currentMenuItem.dom.link.click():"Escape"===n?e.elements.submenuToggles.some((function(e){return e.isOpen}))?(y(t),e.closeChildren()):e.elements.parentMenu?(y(t),e.elements.parentMenu.currentEvent=e.currentEvent,e.elements.parentMenu.closeChildren(),e.elements.parentMenu.focusCurrentChild()):e.isTopLevel&&e.elements.controller&&e.elements.controller.isOpen&&(e.elements.controller.close(),e.focusController()):e.optionalKeySupport&&("ArrowDown"===n||"ArrowRight"===n?(y(t),e.currentMenuItem.isSubmenuItem&&e.currentMenuItem.elements.toggle.isOpen?(e.currentMenuItem.elements.childMenu.currentEvent="keyboard",e.currentMenuItem.elements.childMenu.focusFirstChild()):e.focusNextChild()):"ArrowUp"===n||"ArrowLeft"===n?(y(t),e.focusPreviousChild()):"Home"===n?(y(t),e.focusFirstChild()):"End"===n&&(y(t),e.focusLastChild())))}))}}])&&z(t.prototype,r),o&&z(t,o),u}(w);function W(e){return W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},W(e)}function Z(e,t){return Z=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Z(e,t)}function G(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Q(e);if(t){var o=Q(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return J(this,n)}}function J(e,t){if(t&&("object"===W(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Q(e){return Q=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Q(e)}var X=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Z(e,t)}(n,e);var t=G(n);function n(e){var r,o=e.menuItemElement,i=e.menuLinkElement,u=e.parentMenu,l=e.isSubmenuItem,c=void 0!==l&&l,s=e.childMenu,a=void 0===s?null:s,f=e.toggle,m=void 0===f?null:f,p=e.initialize,h=void 0===p||p;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),r=t.call(this,{menuItemElement:o,menuLinkElement:i,parentMenu:u,isSubmenuItem:c,childMenu:a,toggle:m,initialize:!1}),h&&r.initialize(),r}return n}(C);function Y(e){return Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Y(e)}function ee(e){return function(e){if(Array.isArray(e))return te(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return te(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return te(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function te(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ne(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function re(){return re="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=oe(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},re.apply(this,arguments)}function oe(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=se(e)););return e}function ie(e,t){return ie=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ie(e,t)}function ue(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=se(e);if(t){var o=se(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return le(this,n)}}function le(e,t){if(t&&("object"===Y(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ce(e)}function ce(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function se(e){return se=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},se(e)}var ae=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ie(e,t)}(i,e);var t,n,r,o=ue(i);function i(e){var t,n,r,u,l=e.menuToggleElement,c=e.parentElement,s=e.controlledMenu,a=e.parentMenu,f=void 0===a?null:a,m=e.initialize,p=void 0===m||m;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),t=o.call(this,{menuToggleElement:l,parentElement:c,controlledMenu:s,parentMenu:f,initialize:!1}),n=ce(t),u={toggle:null,parent:null,container:null},(r="_dom")in n?Object.defineProperty(n,r,{value:u,enumerable:!0,configurable:!0,writable:!0}):n[r]=u,t._dom.toggle=l,t._dom.parent=c,t._dom.container=s.isTopLevel?s.dom.container:s.dom.menu,p&&t.initialize(),t}return t=i,n=[{key:"initialize",value:function(){re(se(i.prototype),"initialize",this).call(this),this.dom.toggle.hasAttribute("data-toggle")&&this.dom.toggle.removeAttribute("data-toggle"),this.dom.toggle.hasAttribute("data-target")&&this.dom.toggle.removeAttribute("data-target")}},{key:"_expand",value:function(){var e,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=this.elements.controlledMenu.openClass;this.dom.toggle.setAttribute("aria-expanded","true"),""!==n&&("string"==typeof n?this.dom.container.classList.add(n):(e=this.dom.container.classList).add.apply(e,ee(n))),t&&this.dom.toggle.dispatchEvent(this._expandEvent)}},{key:"_collapse",value:function(){var e,t,n=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=this.elements.controlledMenu,o=r.closeClass,i=r.openClass;this.dom.toggle.setAttribute("aria-expanded","false"),""!==o&&("string"==typeof o?this.dom.container.classList.add(o):(e=this.dom.container.classList).add.apply(e,ee(o))),""!==i&&("string"==typeof i?this.dom.container.classList.remove(i):(t=this.dom.container.classList).remove.apply(t,ee(i))),n&&this.dom.toggle.dispatchEvent(this._collapseEvent)}}],n&&ne(t.prototype,n),r&&ne(t,r),i}(x);function fe(e){return fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fe(e)}function me(e,t){return me=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},me(e,t)}function pe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=de(e);if(t){var o=de(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return he(this,n)}}function he(e,t){if(t&&("object"===fe(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ye(e)}function ye(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function de(e){return de=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},de(e)}function ve(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var be=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&me(e,t)}(n,e);var t=pe(n);function n(e){var r,o=e.menuElement,i=e.menuItemSelector,u=void 0===i?".nav-item":i,l=e.menuLinkSelector,c=void 0===l?".nav-link,.dropdown-item":l,s=e.submenuItemSelector,a=void 0===s?".dropdown":s,f=e.submenuToggleSelector,m=void 0===f?".dropdown-toggle":f,p=e.submenuSelector,h=void 0===p?".dropdown-menu":p,y=e.controllerElement,d=void 0===y?null:y,v=e.containerElement,b=void 0===v?null:v,g=e.openClass,w=void 0===g?"show":g,M=e.closeClass,_=void 0===M?"collapse":M,E=e.isTopLevel,S=void 0===E||E,O=e.parentMenu,C=void 0===O?null:O,T=e.hoverType,I=void 0===T?"off":T,k=e.hoverDelay,j=void 0===k?250:k,A=e.optionalKeySupport,L=void 0!==A&&A,R=e.initialize,P=void 0===R||R;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),ve(ye(r=t.call(this,{menuElement:o,menuItemSelector:u,menuLinkSelector:c,submenuItemSelector:a,submenuToggleSelector:m,submenuSelector:h,controllerElement:d,containerElement:b,openClass:w,closeClass:_,isTopLevel:S,parentMenu:C,hoverType:I,hoverDelay:j,optionalKeySupport:L,initialize:!1})),"_MenuType",n),ve(ye(r),"_MenuItemType",X),ve(ye(r),"_MenuToggleType",ae),P&&r.initialize(),r}return n}($);function ge(e){return ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ge(e)}function we(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Me(){return Me="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=_e(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},Me.apply(this,arguments)}function _e(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Ce(e)););return e}function Ee(e,t){return Ee=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ee(e,t)}function Se(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ce(e);if(t){var o=Ce(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Oe(this,n)}}function Oe(e,t){if(t&&("object"===ge(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Ce(e){return Ce=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Ce(e)}var Te=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ee(e,t)}(i,e);var t,n,r,o=Se(i);function i(e){var t,n=e.menuItemElement,r=e.menuLinkElement,u=e.parentMenu,l=e.isSubmenuItem,c=void 0!==l&&l,s=e.childMenu,a=void 0===s?null:s,f=e.toggle,m=void 0===f?null:f,p=e.initialize,h=void 0===p||p;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),t=o.call(this,{menuItemElement:n,menuLinkElement:r,parentMenu:u,isSubmenuItem:c,childMenu:a,toggle:m}),h&&t.initialize(),t}return t=i,(n=[{key:"initialize",value:function(){Me(Ce(i.prototype),"initialize",this).call(this),this.dom.item.setAttribute("role","none"),this.dom.link.setAttribute("role","menuitem"),this.dom.link.tabIndex=-1}},{key:"focus",value:function(){Me(Ce(i.prototype),"focus",this).call(this),this.elements.parentMenu.isTopLevel&&(this.dom.link.tabIndex=0)}},{key:"blur",value:function(){Me(Ce(i.prototype),"blur",this).call(this),this.elements.parentMenu.isTopLevel&&(this.dom.link.tabIndex=-1)}}])&&we(t.prototype,n),r&&we(t,r),i}(p);function Ie(e){return Ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ie(e)}function ke(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function je(){return je="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=Ae(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},je.apply(this,arguments)}function Ae(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=xe(e)););return e}function Le(e,t){return Le=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Le(e,t)}function Re(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=xe(e);if(t){var o=xe(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Pe(this,n)}}function Pe(e,t){if(t&&("object"===Ie(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function xe(e){return xe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},xe(e)}var De=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Le(e,t)}(i,e);var t,n,r,o=Re(i);function i(e){var t,n=e.menuToggleElement,r=e.parentElement,u=e.controlledMenu,l=e.parentMenu,c=void 0===l?null:l,s=e.initialize,a=void 0===s||s;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),t=o.call(this,{menuToggleElement:n,parentElement:r,controlledMenu:u,parentMenu:c}),a&&t.initialize(),t}return t=i,(n=[{key:"open",value:function(){this.closeSiblings(),je(xe(i.prototype),"open",this).call(this)}},{key:"preview",value:function(){this.closeSiblings(),je(xe(i.prototype),"preview",this).call(this)}},{key:"close",value:function(){this.isOpen&&this.closeChildren(),je(xe(i.prototype),"close",this).call(this)}}])&&ke(t.prototype,n),r&&ke(t,r),i}(a);function ze(e){return ze="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ze(e)}function Be(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ke(){return Ke="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=Fe(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},Ke.apply(this,arguments)}function Fe(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=qe(e)););return e}function Ne(e,t){return Ne=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ne(e,t)}function He(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=qe(e);if(t){var o=qe(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ue(this,n)}}function Ue(e,t){if(t&&("object"===ze(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ve(e)}function Ve(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qe(e){return qe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},qe(e)}function $e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var We=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ne(e,t)}(i,e);var t,n,r,o=He(i);function i(e){var t,n=e.menuElement,r=e.menuItemSelector,u=void 0===r?"li":r,l=e.menuLinkSelector,c=void 0===l?"a":l,s=e.submenuItemSelector,a=void 0===s?"":s,f=e.submenuToggleSelector,m=void 0===f?"a":f,p=e.submenuSelector,h=void 0===p?"ul":p,y=e.controllerElement,d=void 0===y?null:y,v=e.containerElement,b=void 0===v?null:v,g=e.openClass,w=void 0===g?"show":g,M=e.closeClass,_=void 0===M?"hide":M,E=e.isTopLevel,S=void 0===E||E,O=e.parentMenu,C=void 0===O?null:O,T=e.hoverType,I=void 0===T?"off":T,k=e.hoverDelay,j=void 0===k?250:k,A=e.initialize,L=void 0===A||A;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),$e(Ve(t=o.call(this,{menuElement:n,menuItemSelector:u,menuLinkSelector:c,submenuItemSelector:a,submenuToggleSelector:m,submenuSelector:h,controllerElement:d,containerElement:b,openClass:w,closeClass:_,isTopLevel:S,parentMenu:C,hoverType:I,hoverDelay:j})),"_MenuType",i),$e(Ve(t),"_MenuItemType",Te),$e(Ve(t),"_MenuToggleType",De),L&&t.initialize(),t}return t=i,(n=[{key:"initialize",value:function(){try{Ke(qe(i.prototype),"initialize",this).call(this),this.dom.menu.setAttribute("role","menubar"),this._handleFocus(),this._handleClick(),this._handleHover(),this._handleKeydown(),this._handleKeyup(),this.isTopLevel&&(this.elements.menuItems[0].dom.link.tabIndex=0)}catch(e){console.error(e)}}},{key:"_handleClick",value:function(){var e=this;Ke(qe(i.prototype),"_handleClick",this).call(this),document.addEventListener("pointerup",(function(t){"none"!==e.focusState&&(e.currentEvent="mouse",e.dom.menu.contains(t.target)||!e.dom.menu===t.target||(e.closeChildren(),e.blur(),e.elements.controller&&e.elements.controller.close()))}))}},{key:"_handleKeydown",value:function(){var e=this;Ke(qe(i.prototype),"_handleKeydown",this).call(this),this.dom.menu.addEventListener("keydown",(function(t){e.currentEvent="keyboard";var n=h(t);"Tab"===n&&("none"!==e.elements.rootMenu.focusState?(e.elements.rootMenu.blur(),e.elements.rootMenu.closeChildren()):e.elements.rootMenu.focus()),"Character"===n?y(t):e.isTopLevel?"self"===e.focusState&&(["ArrowRight","ArrowLeft","Home","End"].includes(n)||e.currentMenuItem.isSubmenuItem&&["Space","Enter","ArrowDown","ArrowUp"].includes(n)||e.elements.controller&&["Escape"].includes(n))&&y(t):(["Escape","ArrowRight","ArrowLeft","ArrowDown","ArrowUp","Home","End"].includes(n)||e.currentMenuItem.isSubmenuItem&&["Space","Enter"].includes(n))&&y(t)}))}},{key:"_handleKeyup",value:function(){var e=this;Ke(qe(i.prototype),"_handleKeyup",this).call(this),this.dom.menu.addEventListener("keyup",(function(t){e.currentEvent="keyboard";var n=h(t),r=t.altKey,o=t.crtlKey,i=t.metaKey;if("Character"!==n||r||o||i)if(e.isTopLevel){if("self"===e.focusState)if("Space"===n||"Enter"===n)e.currentMenuItem.isSubmenuItem?(y(t),e.currentMenuItem.elements.childMenu.currentEvent="keyboard",e.currentMenuItem.elements.toggle.open(),requestAnimationFrame((function(){e.currentMenuItem.elements.childMenu.focusFirstChild()}))):e.currentMenuItem.dom.link.click();else if("ArrowRight"===n){y(t);var u=e.currentMenuItem.isSubmenuItem&&e.currentMenuItem.elements.toggle.isOpen;e.focusNextChild(),u&&(e.currentMenuItem.isSubmenuItem?(e.currentMenuItem.elements.childMenu.currentEvent="keyboard",e.currentMenuItem.elements.toggle.preview()):e.closeChildren())}else if("ArrowLeft"===n){y(t);var l=e.currentMenuItem.isSubmenuItem&&e.currentMenuItem.elements.toggle.isOpen;e.focusPreviousChild(),l&&(e.currentMenuItem.isSubmenuItem?(e.currentMenuItem.elements.childMenu.currentEvent="keyboard",e.currentMenuItem.elements.toggle.preview()):e.closeChildren())}else"ArrowDown"===n?e.currentMenuItem.isSubmenuItem&&(y(t),e.currentMenuItem.elements.childMenu.currentEvent="keyboard",e.currentMenuItem.elements.toggle.open(),requestAnimationFrame((function(){e.currentMenuItem.elements.childMenu.focusFirstChild()}))):"ArrowUp"===n?e.currentMenuItem.isSubmenuItem&&(y(t),e.currentMenuItem.elements.childMenu.currentEvent="keyboard",e.currentMenuItem.elements.toggle.open(),requestAnimationFrame((function(){e.currentMenuItem.elements.childMenu.focusLastChild()}))):"Home"===n?(y(t),e.focusFirstChild()):"End"===n?(y(t),e.focusLastChild()):"Escape"===n&&(e.elements.submenuToggles.some((function(e){return e.isOpen}))?(y(t),e.closeChildren()):e.isTopLevel&&e.elements.controller&&e.elements.controller.isOpen&&(y(t),e.elements.controller.close(),e.focusController()))}else"Space"===n||"Enter"===n?e.currentMenuItem.isSubmenuItem?(y(t),e.currentMenuItem.elements.childMenu.currentEvent="keyboard",e.currentMenuItem.elements.toggle.open(),requestAnimationFrame((function(){e.currentMenuItem.elements.childMenu.focusFirstChild()}))):e.currentMenuItem.dom.link.click():"Escape"===n?(y(t),e.elements.rootMenu.closeChildren(),e.elements.rootMenu.focusCurrentChild()):"ArrowRight"===n?e.currentMenuItem.isSubmenuItem?(y(t),e.currentMenuItem.elements.childMenu.currentEvent="keyboard",e.currentMenuItem.elements.toggle.open(),requestAnimationFrame((function(){e.currentMenuItem.elements.childMenu.focusFirstChild()}))):(y(t),e.elements.rootMenu.closeChildren(),e.elements.rootMenu.focusNextChild(),e.elements.rootMenu.currentMenuItem.isSubmenuItem&&e.elements.rootMenu.currentMenuItem.elements.toggle.preview()):"ArrowLeft"===n?e.elements.parentMenu.currentMenuItem.isSubmenuItem&&(y(t),e.elements.parentMenu.currentMenuItem.elements.toggle.close(),e.elements.parentMenu.focusCurrentChild(),e.elements.parentMenu===e.elements.rootMenu&&(e.elements.rootMenu.closeChildren(),e.elements.rootMenu.focusPreviousChild(),e.elements.rootMenu.currentMenuItem.isSubmenuItem&&(e.elements.rootMenu.currentMenuItem.elements.childMenu.currentEvent="keyboard",e.elements.rootMenu.currentMenuItem.elements.toggle.preview()))):"ArrowDown"===n?(y(t),e.focusNextChild()):"ArrowUp"===n?(y(t),e.focusPreviousChild()):"Home"===n?(y(t),e.focusFirstChild()):"End"===n&&(y(t),e.focusLastChild());else y(t),e.elements.rootMenu.currentEvent="character",e.focusNextChildWithCharacter(t.key)}))}},{key:"focusNextChild",value:function(){this.currentChild===this.elements.menuItems.length-1?this.focusFirstChild():this.focusChild(this.currentChild+1)}},{key:"focusPreviousChild",value:function(){0===this.currentChild?this.focusLastChild():this.focusChild(this.currentChild-1)}},{key:"focusNextChildWithCharacter",value:function(e){for(var t=e.toLowerCase(),n=this.currentChild+1,r=!1;!r&&n<this.elements.menuItems.length;)(this.elements.menuItems[n].dom.item.innerText?this.elements.menuItems[n].dom.item.innerText:this.elements.menuItems[n].dom.item.textContent).replace(/[\s]/g,"").toLowerCase().charAt(0)===t&&(r=!0,this.focusChild(n)),n++}}])&&Be(t.prototype,n),r&&Be(t,r),i}(w);function Ze(e){return Ze="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ze(e)}function Ge(e,t){return Ge=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ge(e,t)}function Je(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Xe(e);if(t){var o=Xe(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Qe(this,n)}}function Qe(e,t){if(t&&("object"===Ze(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Xe(e){return Xe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Xe(e)}var Ye=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ge(e,t)}(n,e);var t=Je(n);function n(e){var r,o=e.menuItemElement,i=e.menuLinkElement,u=e.parentMenu,l=e.isSubmenuItem,c=void 0!==l&&l,s=e.childMenu,a=void 0===s?null:s,f=e.toggle,m=void 0===f?null:f,p=e.initialize,h=void 0===p||p;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),r=t.call(this,{menuItemElement:o,menuLinkElement:i,parentMenu:u,isSubmenuItem:c,childMenu:a,toggle:m,initialize:!1}),h&&r.initialize(),r}return n}(Te);function et(e){return et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},et(e)}function tt(e){return function(e){if(Array.isArray(e))return nt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return nt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nt(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function rt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ot(){return ot="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=it(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},ot.apply(this,arguments)}function it(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=at(e)););return e}function ut(e,t){return ut=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ut(e,t)}function lt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=at(e);if(t){var o=at(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ct(this,n)}}function ct(e,t){if(t&&("object"===et(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return st(e)}function st(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function at(e){return at=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},at(e)}var ft=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ut(e,t)}(i,e);var t,n,r,o=lt(i);function i(e){var t,n,r,u,l=e.menuToggleElement,c=e.parentElement,s=e.controlledMenu,a=e.parentMenu,f=void 0===a?null:a,m=e.initialize,p=void 0===m||m;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),t=o.call(this,{menuToggleElement:l,parentElement:c,controlledMenu:s,parentMenu:f,initialize:!1}),n=st(t),u={toggle:null,parent:null,container:null},(r="_dom")in n?Object.defineProperty(n,r,{value:u,enumerable:!0,configurable:!0,writable:!0}):n[r]=u,t._dom.toggle=l,t._dom.parent=c,t._dom.container=s.isTopLevel?s.dom.container:s.dom.menu,p&&t.initialize(),t}return t=i,n=[{key:"initialize",value:function(){ot(at(i.prototype),"initialize",this).call(this),this.dom.toggle.hasAttribute("data-toggle")&&this.dom.toggle.removeAttribute("data-toggle"),this.dom.toggle.hasAttribute("data-target")&&this.dom.toggle.removeAttribute("data-target")}},{key:"_expand",value:function(){var e,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=this.elements.controlledMenu.openClass;this.dom.toggle.setAttribute("aria-expanded","true"),""!==n&&("string"==typeof n?this.dom.container.classList.add(n):(e=this.dom.container.classList).add.apply(e,tt(n))),t&&this.dom.toggle.dispatchEvent(this._expandEvent)}},{key:"_collapse",value:function(){var e,t,n=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=this.elements.controlledMenu,o=r.closeClass,i=r.openClass;this.dom.toggle.setAttribute("aria-expanded","false"),""!==o&&("string"==typeof o?this.dom.container.classList.add(o):(e=this.dom.container.classList).add.apply(e,tt(o))),""!==i&&("string"==typeof i?this.dom.container.classList.remove(i):(t=this.dom.container.classList).remove.apply(t,tt(i))),n&&this.dom.toggle.dispatchEvent(this._collapseEvent)}}],n&&rt(t.prototype,n),r&&rt(t,r),i}(De);function mt(e){return mt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mt(e)}function pt(e,t){return pt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},pt(e,t)}function ht(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=vt(e);if(t){var o=vt(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return yt(this,n)}}function yt(e,t){if(t&&("object"===mt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return dt(e)}function dt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vt(e){return vt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},vt(e)}function bt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var gt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&pt(e,t)}(n,e);var t=ht(n);function n(e){var r,o=e.menuElement,i=e.menuItemSelector,u=void 0===i?".nav-item":i,l=e.menuLinkSelector,c=void 0===l?".nav-link,.dropdown-item":l,s=e.submenuItemSelector,a=void 0===s?".dropdown":s,f=e.submenuToggleSelector,m=void 0===f?".dropdown-toggle":f,p=e.submenuSelector,h=void 0===p?".dropdown-menu":p,y=e.controllerElement,d=void 0===y?null:y,v=e.containerElement,b=void 0===v?null:v,g=e.openClass,w=void 0===g?"show":g,M=e.closeClass,_=void 0===M?"collapse":M,E=e.isTopLevel,S=void 0===E||E,O=e.parentMenu,C=void 0===O?null:O,T=e.hoverType,I=void 0===T?"off":T,k=e.hoverDelay,j=void 0===k?250:k,A=e.initialize,L=void 0===A||A;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),bt(dt(r=t.call(this,{menuElement:o,menuItemSelector:u,menuLinkSelector:c,submenuItemSelector:a,submenuToggleSelector:m,submenuSelector:h,controllerElement:d,containerElement:b,openClass:w,closeClass:_,isTopLevel:S,parentMenu:C,hoverType:I,hoverDelay:j,initialize:!1})),"_MenuType",n),bt(dt(r),"_MenuItemType",Ye),bt(dt(r),"_MenuToggleType",ft),L&&r.initialize(),r}return n}(We);function wt(e){return wt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wt(e)}function Mt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _t(){return _t="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=Et(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},_t.apply(this,arguments)}function Et(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Tt(e)););return e}function St(e,t){return St=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},St(e,t)}function Ot(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Tt(e);if(t){var o=Tt(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ct(this,n)}}function Ct(e,t){if(t&&("object"===wt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Tt(e){return Tt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Tt(e)}var It=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&St(e,t)}(i,e);var t,n,r,o=Ot(i);function i(e){var t,n=e.menuItemElement,r=e.menuLinkElement,u=e.parentMenu,l=e.isSubmenuItem,c=void 0!==l&&l,s=e.childMenu,a=void 0===s?null:s,f=e.toggle,m=void 0===f?null:f,p=e.initialize,h=void 0===p||p;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),t=o.call(this,{menuItemElement:n,menuLinkElement:r,parentMenu:u,isSubmenuItem:c,childMenu:a,toggle:m}),h&&t.initialize(),t}return t=i,(n=[{key:"initialize",value:function(){_t(Tt(i.prototype),"initialize",this).call(this),this.dom.item.setAttribute("role","none"),this.dom.link.setAttribute("role","treeitem"),this.dom.link.tabIndex=-1}},{key:"focus",value:function(){_t(Tt(i.prototype),"focus",this).call(this),this.dom.link.tabIndex=0}},{key:"blur",value:function(){_t(Tt(i.prototype),"blur",this).call(this),this.dom.link.tabIndex=-1}}])&&Mt(t.prototype,n),r&&Mt(t,r),i}(p);function kt(e){return kt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},kt(e)}function jt(e,t){return jt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},jt(e,t)}function At(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Rt(e);if(t){var o=Rt(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Lt(this,n)}}function Lt(e,t){if(t&&("object"===kt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Rt(e){return Rt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Rt(e)}var Pt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&jt(e,t)}(n,e);var t=At(n);function n(e){var r,o=e.menuToggleElement,i=e.parentElement,u=e.controlledMenu,l=e.parentMenu,c=void 0===l?null:l,s=e.initialize,a=void 0===s||s;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),r=t.call(this,{menuToggleElement:o,parentElement:i,controlledMenu:u,parentMenu:c}),a&&r.initialize(),r}return n}(a);function xt(e){return xt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xt(e)}function Dt(e){return function(e){if(Array.isArray(e))return zt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return zt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zt(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Bt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Kt(){return Kt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=Ft(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},Kt.apply(this,arguments)}function Ft(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=qt(e)););return e}function Nt(e,t){return Nt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Nt(e,t)}function Ht(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=qt(e);if(t){var o=qt(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ut(this,n)}}function Ut(e,t){if(t&&("object"===xt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Vt(e)}function Vt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qt(e){return qt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},qt(e)}function $t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Wt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Nt(e,t)}(i,e);var t,n,r,o=Ht(i);function i(e){var t,n=e.menuElement,r=e.menuItemSelector,u=void 0===r?"li":r,l=e.menuLinkSelector,c=void 0===l?"a":l,s=e.submenuItemSelector,a=void 0===s?"":s,f=e.submenuToggleSelector,m=void 0===f?"a":f,p=e.submenuSelector,h=void 0===p?"ul":p,y=e.controllerElement,d=void 0===y?null:y,v=e.containerElement,b=void 0===v?null:v,g=e.openClass,w=void 0===g?"show":g,M=e.closeClass,_=void 0===M?"hide":M,E=e.isTopLevel,S=void 0===E||E,O=e.parentMenu,C=void 0===O?null:O,T=e.hoverType,I=void 0===T?"off":T,k=e.hoverDelay,j=void 0===k?250:k,A=e.initialize,L=void 0===A||A;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),$t(Vt(t=o.call(this,{menuElement:n,menuItemSelector:u,menuLinkSelector:c,submenuItemSelector:a,submenuToggleSelector:m,submenuSelector:h,controllerElement:d,containerElement:b,openClass:w,closeClass:_,isTopLevel:S,parentMenu:C,hoverType:I,hoverDelay:j})),"_MenuType",i),$t(Vt(t),"_MenuItemType",It),$t(Vt(t),"_MenuToggleType",Pt),L&&t.initialize(),t}return t=i,(n=[{key:"initialize",value:function(){try{Kt(qt(i.prototype),"initialize",this).call(this),this.isTopLevel?(this.dom.menu.setAttribute("role","tree"),this.elements.menuItems[0].dom.link.tabIndex=0):this.dom.menu.setAttribute("role","group"),this._handleFocus(),this._handleClick(),this._handleHover(),this._handleKeydown(),this._handleKeyup()}catch(e){console.error(e)}}},{key:"_handleKeydown",value:function(){var e=this;Kt(qt(i.prototype),"_handleKeydown",this).call(this),this.dom.menu.addEventListener("keydown",(function(t){e.currentEvent="keyboard";var n=h(t);"Tab"===n&&("none"!==e.elements.rootMenu.focusState?e.elements.rootMenu.blur():e.elements.rootMenu.focus()),"self"===e.focusState&&(["Space","ArrowUp","ArrowDown","ArrowLeft","Asterisk","Home","End"].includes(n)||e.currentMenuItem.isSubmenuItem&&["Enter","ArrowRight"].includes(n)||e.elements.controller&&["Escape"].includes(n))&&y(t)}))}},{key:"_handleKeyup",value:function(){var e=this;Kt(qt(i.prototype),"_handleKeyup",this).call(this),this.dom.menu.addEventListener("keyup",(function(t){e.currentEvent="keyboard";var n=h(t),r=t.altKey,o=t.crtlKey,i=t.metaKey;if("Character"!==n||r||o||i){if("self"===e.focusState)if("Enter"===n||"Space"===n)y(t),e.currentMenuItem.isSubmenuItem?e.currentMenuItem.elements.toggle.isOpen?e.currentMenuItem.elements.toggle.close():e.currentMenuItem.elements.toggle.preview():e.currentMenuItem.dom.link.click();else if("Escape"===n)e.isTopLevel&&e.elements.controller&&e.elements.controller.isOpen&&(e.elements.controller.close(),e.focusController());else if("ArrowDown"===n)y(t),e.currentMenuItem.isSubmenuItem&&e.currentMenuItem.elements.toggle.isOpen?(e.blurCurrentChild(),e.currentMenuItem.elements.childMenu.currentEvent=e.currentEvent,e.currentMenuItem.elements.childMenu.focusFirstChild()):e.isTopLevel||e.currentChild!==e.elements.menuItems.length-1?e.focusNextChild():e.focusParentsNextChild();else if("ArrowUp"===n){y(t);var u=e.elements.menuItems[e.currentChild-1];u&&u.isSubmenuItem&&u.elements.toggle.isOpen?(e.blurCurrentChild(),e.currentChild=e.currentChild-1,e.currentMenuItem.elements.childMenu.currentEvent=e.currentEvent,e.focusChildsLastNode()):e.isTopLevel||0!==e.currentChild?e.focusPreviousChild():(e.blurCurrentChild(),e.elements.parentMenu.currentEvent=e.currentEvent,e.elements.parentMenu.focusCurrentChild())}else"ArrowRight"===n?e.currentMenuItem.isSubmenuItem&&(y(t),e.currentMenuItem.elements.toggle.isOpen?(e.blurCurrentChild(),e.currentMenuItem.elements.childMenu.currentEvent=e.currentEvent,e.currentMenuItem.elements.childMenu.focusFirstChild()):e.currentMenuItem.elements.toggle.preview()):"ArrowLeft"===n?(y(t),e.currentMenuItem.isSubmenuItem&&e.currentMenuItem.elements.toggle.isOpen?(e.currentMenuItem.elements.childMenu.blurCurrentChild(),e.currentMenuItem.elements.toggle.close()):e.isTopLevel||(e.blurCurrentChild(),e.elements.parentMenu.currentEvent=e.currentEvent,e.elements.parentMenu.focusCurrentChild())):"Home"===n?(y(t),e.blurCurrentChild(),e.elements.rootMenu.focusFirstChild()):"End"===n?(y(t),e.blurCurrentChild(),e.elements.rootMenu.focusLastNode()):"Asterisk"===n&&(y(t),e.openChildren())}else y(t),e.elements.rootMenu.currentEvent="character",e.focusNextNodeWithCharacter(t.key)}))}},{key:"focusLastNode",value:function(){var e=this.elements.menuItems.length-1,t=this.elements.menuItems[e];t.isSubmenuItem&&t.elements.toggle.isOpen?(this.currentChild=e,t.elements.childMenu.currentEvent=this.currentEvent,t.elements.childMenu.focusLastNode()):this.focusLastChild()}},{key:"openChildren",value:function(){this.elements.submenuToggles.forEach((function(e){return e.preview()}))}},{key:"focusNextNodeWithCharacter",value:function(e){for(var t=e.toLowerCase(),n=function e(t){var n=[];return t.elements.menuItems.forEach((function(t){n.push(t),t.isSubmenuItem&&t.elements.toggle.isOpen&&(n=[].concat(Dt(n),Dt(e(t.elements.toggle.elements.controlledMenu))))})),n}(this.elements.rootMenu),r=n.indexOf(this.currentMenuItem)+1,o=[].concat(Dt(n.slice(r)),Dt(n.slice(0,r))),i=0,u=!1;!u&&i<o.length;){if((o[i].dom.item.innerText?o[i].dom.item.innerText:o[i].dom.item.textContent).replace(/[\s]/g,"").toLowerCase().charAt(0)===t){u=!0;var l=o[i].elements.parentMenu,c=l.elements.menuItems.indexOf(o[i]);this.elements.rootMenu.blurChildren(),l.focusChild(c)}i++}}},{key:"focusParentsNextChild",value:function(){this.elements.parentMenu&&(this.elements.parentMenu.currentEvent=this.currentEvent,this.elements.parentMenu.currentChild===this.elements.parentMenu.elements.menuItems.length-1?(this.elements.parentMenu.blurCurrentChild(),this.elements.parentMenu.focusParentsNextChild()):(this.blurChildren(),this.elements.parentMenu.focusNextChild()))}},{key:"focusChildsLastNode",value:function(){this.currentMenuItem.elements.childMenu.currentEvent=this.currentEvent,this.currentMenuItem.elements.childMenu.focusLastChild(),this.currentMenuItem.elements.childMenu.currentMenuItem.isSubmenuItem&&this.currentMenuItem.elements.childMenu.currentMenuItem.elements.toggle.isOpen&&(this.currentMenuItem.elements.childMenu.blurCurrentChild(),this.currentMenuItem.elements.childMenu.focusChildsLastNode())}}])&&Bt(t.prototype,n),r&&Bt(t,r),i}(w);function Zt(e){return Zt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zt(e)}function Gt(e,t){return Gt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Gt(e,t)}function Jt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Xt(e);if(t){var o=Xt(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Qt(this,n)}}function Qt(e,t){if(t&&("object"===Zt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Xt(e){return Xt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Xt(e)}var Yt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Gt(e,t)}(n,e);var t=Jt(n);function n(e){var r,o=e.menuItemElement,i=e.menuLinkElement,u=e.parentMenu,l=e.isSubmenuItem,c=void 0!==l&&l,s=e.childMenu,a=void 0===s?null:s,f=e.toggle,m=void 0===f?null:f,p=e.initialize,h=void 0===p||p;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),r=t.call(this,{menuItemElement:o,menuLinkElement:i,parentMenu:u,isSubmenuItem:c,childMenu:a,toggle:m,initialize:!1}),h&&r.initialize(),r}return n}(It);function en(e){return en="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},en(e)}function tn(e){return function(e){if(Array.isArray(e))return nn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return nn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nn(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function rn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function on(){return on="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=un(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},on.apply(this,arguments)}function un(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=fn(e)););return e}function ln(e,t){return ln=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ln(e,t)}function cn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=fn(e);if(t){var o=fn(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return sn(this,n)}}function sn(e,t){if(t&&("object"===en(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return an(e)}function an(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fn(e){return fn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},fn(e)}var mn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ln(e,t)}(i,e);var t,n,r,o=cn(i);function i(e){var t,n,r,u,l=e.menuToggleElement,c=e.parentElement,s=e.controlledMenu,a=e.parentMenu,f=void 0===a?null:a,m=e.initialize,p=void 0===m||m;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),t=o.call(this,{menuToggleElement:l,parentElement:c,controlledMenu:s,parentMenu:f,initialize:!1}),n=an(t),u={toggle:null,parent:null,container:null},(r="_dom")in n?Object.defineProperty(n,r,{value:u,enumerable:!0,configurable:!0,writable:!0}):n[r]=u,t._dom.toggle=l,t._dom.parent=c,t._dom.container=s.isTopLevel?s.dom.container:s.dom.menu,p&&t.initialize(),t}return t=i,n=[{key:"initialize",value:function(){on(fn(i.prototype),"initialize",this).call(this),this.dom.toggle.hasAttribute("data-toggle")&&this.dom.toggle.removeAttribute("data-toggle"),this.dom.toggle.hasAttribute("data-target")&&this.dom.toggle.removeAttribute("data-target")}},{key:"_expand",value:function(){var e,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=this.elements.controlledMenu.openClass;this.dom.toggle.setAttribute("aria-expanded","true"),""!==n&&("string"==typeof n?this.dom.container.classList.add(n):(e=this.dom.container.classList).add.apply(e,tn(n))),t&&this.dom.toggle.dispatchEvent(this._expandEvent)}},{key:"_collapse",value:function(){var e,t,n=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=this.elements.controlledMenu,o=r.closeClass,i=r.openClass;this.dom.toggle.setAttribute("aria-expanded","false"),""!==o&&("string"==typeof o?this.dom.container.classList.add(o):(e=this.dom.container.classList).add.apply(e,tn(o))),""!==i&&("string"==typeof i?this.dom.container.classList.remove(i):(t=this.dom.container.classList).remove.apply(t,tn(i))),n&&this.dom.toggle.dispatchEvent(this._collapseEvent)}}],n&&rn(t.prototype,n),r&&rn(t,r),i}(Pt);function pn(e){return pn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pn(e)}function hn(e,t){return hn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},hn(e,t)}function yn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=bn(e);if(t){var o=bn(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return dn(this,n)}}function dn(e,t){if(t&&("object"===pn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return vn(e)}function vn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function bn(e){return bn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},bn(e)}function gn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}return{Bootstrap4DisclosureMenu:be,Bootstrap4Menubar:gt,Bootstrap4Treeview:function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&hn(e,t)}(n,e);var t=yn(n);function n(e){var r,o=e.menuElement,i=e.menuItemSelector,u=void 0===i?".nav-item":i,l=e.menuLinkSelector,c=void 0===l?".nav-link,.dropdown-item":l,s=e.submenuItemSelector,a=void 0===s?".dropdown":s,f=e.submenuToggleSelector,m=void 0===f?".dropdown-toggle":f,p=e.submenuSelector,h=void 0===p?".dropdown-menu":p,y=e.controllerElement,d=void 0===y?null:y,v=e.containerElement,b=void 0===v?null:v,g=e.openClass,w=void 0===g?"show":g,M=e.closeClass,_=void 0===M?"collapse":M,E=e.isTopLevel,S=void 0===E||E,O=e.parentMenu,C=void 0===O?null:O,T=e.hoverType,I=void 0===T?"off":T,k=e.hoverDelay,j=void 0===k?250:k,A=e.initialize,L=void 0===A||A;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),gn(vn(r=t.call(this,{menuElement:o,menuItemSelector:u,menuLinkSelector:c,submenuItemSelector:a,submenuToggleSelector:m,submenuSelector:h,controllerElement:d,containerElement:b,openClass:w,closeClass:_,isTopLevel:S,parentMenu:C,hoverType:I,hoverDelay:j,initialize:!1})),"_MenuType",n),gn(vn(r),"_MenuItemType",Yt),gn(vn(r),"_MenuToggleType",mn),L&&r.initialize(),r}return n}(Wt)}}();
  //# sourceMappingURL=accessible-menu-bs4.min.js.map
  