!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js"),require("lit/directives/if-defined.js"));else if("function"==typeof define&&define.amd)define(["lit","lit/decorators.js","lit/directives/class-map.js","lit/directives/if-defined.js"],t);else{var i="object"==typeof exports?t(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js"),require("lit/directives/if-defined.js")):t(e.lit,e["lit/decorators.js"],e["lit/directives/class-map.js"],e["lit/directives/if-defined.js"]);for(var s in i)("object"==typeof exports?exports:e)[s]=i[s]}}(self,(e,t,i,s)=>(()=>{"use strict";var n,r={4085(e,t,i){i.r(t),i.d(t,{MORE_MENU_ITEM_COPY_ID_PREFIX:()=>p,Menu:()=>v});var s=i(2900),n=i(9609),r=i(4781),o=i(608),d=i(93),l=i(4084),c=i(7161),a=i(429),h=i(5125),m=i(5410),u=i(3051),f=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var d=e.length-1;d>=0;d--)(n=e[d])&&(o=(r<3?n(o):r>3?n(t,i,o):n(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o};const p="more-menu-item-";var v;!function(e){let t=class extends((0,o.T)((0,r.I)(c.LitElement))){constructor(){super(...arguments),this.justified=!1,this.direction="horizontal",this.items=[],this.itemsHash={},this.itemsIdxHash={}}getNormalizedItemId(e){return e.replace(p,"")}static get styles(){return[l.A,u.A]}get slotItem(){return this.menuSlotElement}linkMenuItems(){return e=this,t=void 0,s=function*(){const{items:e}=this;e.forEach((e,t)=>{const i=(0,d.O)("menu");e.setAttribute("id",i),e.setAttribute("aria-controls",i),e.selected=this.selected===t}),this.itemsHash=this.items.reduce((e,t)=>(e[t.id]=t,e),{}),this.itemsIdxHash=this.items.reduce((e,t,i)=>(e[t.id]=i,e),{})},new((i=void 0)||(i=Promise))(function(n,r){function o(e){try{l(s.next(e))}catch(e){r(e)}}function d(e){try{l(s.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,d)}l((s=s.apply(e,t||[])).next())});var e,t,i,s}setupMenuItems(){if(this.menuSlotElement){const e=this.menuSlotElement.assignedElements({flatten:!0});this.getChildrenFromTree({children:e},this.items)}}getChildrenFromTree(e,t){e.children.forEach(e=>{e instanceof m.MenuItem.ELEMENT&&t.push(e),this.getChildrenFromTree({children:Array.from(e.children)},t)})}updateSelectedItem(e){const t=this.slotted.findIndex(e=>e.hasAttribute("selected"));t!==e&&(this.items&&[t,e].forEach(e=>{const t=this.items[e];null==t||t.toggleAttribute("selected")}),this.dispatchEvent(new CustomEvent("selected-menu-item",{detail:{value:e},composed:!0,bubbles:!0})),this.changeSelectedItemIdx(e))}changeSelectedItemIdx(e){this.selected=e}handleItemClick(e){const{id:t}=e.detail,i=this.itemsHash[this.getNormalizedItemId(t)];if(i&&!i.disabled){const e=this.itemsIdxHash[i.id];-1!==e&&this.updateSelectedItem(e)}}handleItemKeydown(e){const{key:t,id:i}=e.detail;switch(t){case s.Uz.End:this.changeSelectedItemIdx(this.items.length-1);break;case s.Uz.Home:this.changeSelectedItemIdx(0);break;case s.Uz.ArrowLeft:case s.Uz.ArrowUp:0===this.selected?this.changeSelectedItemIdx(this.items.length-1):this.changeSelectedItemIdx(this.selected-1);break;case s.Uz.ArrowRight:case s.Uz.ArrowDown:this.selected===this.items.length-1?this.changeSelectedItemIdx(0):this.changeSelectedItemIdx(this.selected+1);break;case s.Uz.Enter:case s.Uz.Space:const e=this.slotted.findIndex(e=>e.id===i&&!e.disabled);-1!==e&&this.updateSelectedItem(e)}}connectedCallback(){super.connectedCallback(),this.addEventListener("menu-item-click",this.handleItemClick),this.addEventListener("menu-item-keydown",this.handleItemKeydown)}disconnectedCallback(){super.connectedCallback(),this.removeEventListener("menu-item-click",this.handleItemClick),this.removeEventListener("menu-item-keydown",this.handleItemKeydown)}onSlotChange(){this.setupMenuItems(),this.linkMenuItems()}get menuClassMap(){return{[`md-menu--${this.direction}`]:this.direction,justified:this.justified}}render(){return c.html`
        <nav class="md-menu ${(0,h.classMap)(this.menuClassMap)}">
          <ul class="md-menu-list">
            <slot @slotchange=${this.onSlotChange}></slot>
          </ul>
        </nav>
      `}};f([(0,a.property)({type:Boolean})],t.prototype,"justified",void 0),f([(0,a.property)({type:String})],t.prototype,"direction",void 0),f([(0,a.query)("slot")],t.prototype,"menuSlotElement",void 0),f([(0,a.query)("md-menu-overlay")],t.prototype,"menuSubElement",void 0),t=f([(0,n.w)("md-menu")],t),e.ELEMENT=t}(v||(v={}))},7161(t){t.exports=e},429(e){e.exports=t},5125(e){e.exports=i},291(e){e.exports=s}},o={};function d(e){var t=o[e];if(void 0!==t)return t.exports;var i=o[e]={exports:{}};return r[e](i,i.exports,d),i.exports}d.m=r,n=[],d.O=(e,t,i,s)=>{if(!t){var r=1/0;for(a=0;a<n.length;a++){for(var[t,i,s]=n[a],o=!0,l=0;l<t.length;l++)(!1&s||r>=s)&&Object.keys(d.O).every(e=>d.O[e](t[l]))?t.splice(l--,1):(o=!1,s<r&&(r=s));if(o){n.splice(a--,1);var c=i();void 0!==c&&(e=c)}}return e}s=s||0;for(var a=n.length;a>0&&n[a-1][2]>s;a--)n[a]=n[a-1];n[a]=[t,i,s]},d.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return d.d(t,{a:t}),t},d.d=(e,t)=>{for(var i in t)d.o(t,i)&&!d.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},d.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),d.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={1037:0};d.O.j=t=>0===e[t];var t=(t,i)=>{var s,n,[r,o,l]=i,c=0;if(r.some(t=>0!==e[t])){for(s in o)d.o(o,s)&&(d.m[s]=o[s]);if(l)var a=l(d)}for(t&&t(i);c<r.length;c++)n=r[c],d.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return d.O(a)},i=self["momentum-web-components-[id]"]=self["momentum-web-components-[id]"]||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})();var l=d.O(void 0,[9609,4084,519,9983,7162,93,5846,3051,5410],()=>d(4085));return d.O(l)})());