!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("lit"),require("lit/decorators.js"));else if("function"==typeof define&&define.amd)define(["lit","lit/decorators.js"],t);else{var o="object"==typeof exports?t(require("lit"),require("lit/decorators.js")):t(e.lit,e["lit/decorators.js"]);for(var r in o)("object"==typeof exports?exports:e)[r]=o[r]}}(self,(e,t)=>(()=>{"use strict";var o,r={3701(e,t,o){o.r(t),o.d(t,{Accordion:()=>r});var r,s=o(2900),i=o(7704),n=o(9609),c=o(4084),d=o(7161),l=o(429),a=o(742),u=function(e,t,o,r){var s,i=arguments.length,n=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,r);else for(var c=e.length-1;c>=0;c--)(s=e[c])&&(n=(i<3?s(n):i>3?s(t,o,n):s(t,o))||n);return i>3&&n&&Object.defineProperty(t,o,n),n};!function(e){let t=class extends((0,i.TS)(d.LitElement)){constructor(){super(...arguments),this.multiple=!1,this.suppressContainerFocus=!1,this.doubleClickToExpand=!1,this.handleAccordionItemFocus=()=>{this.toggleAttribute("focusable",!0)},this.handleAccordionItemBlur=()=>{this.toggleAttribute("focusable",!1)}}get slotItem(){return this.accordionItemSlotElement}filterSlotted(){return this.accordionItemSlotElement.assignedElements()}switchFocusedAccordionItem(e){const t=this.slotted.findIndex(e=>e.hasAttribute("focus-visible")),o=this.slotted.length;let r=t;for(r=(o+r+e)%o;this.slotted[r].disabled;)r=(o+r+e)%o;this.focusAccordionItem(this.slotted[r])}focusAccordionItem(e){e.hasAttribute("focus-visible")||requestAnimationFrame(()=>e.header.focus())}setActiveAccordionItem(e){this.multiple?e.expanded=!e.expanded:(this.slotted.forEach(t=>{const o=t;o.expanded&&!t.isEqualNode(e)&&(o.expanded=!1)}),e.expanded=!0)}setupExpandedAccordionItems(){this.multiple||this.slotted.filter(e=>e.expanded).forEach((e,t)=>{const o=e;o.expanded&&t>0&&(o.expanded=!1)})}setupFocusAccordionItems(){this.slotted.forEach(e=>{this.suppressContainerFocus||(e.addEventListener("focus",this.handleAccordionItemFocus),e.addEventListener("blur",this.handleAccordionItemBlur))})}removeFocusAccordionItems(){this.slotted.forEach(e=>{this.suppressContainerFocus||(e.removeEventListener("focus",this.handleAccordionItemFocus),e.removeEventListener("blur",this.handleAccordionItemBlur))})}handleKeyDown(e){const{srcEvent:t}=e.detail,{code:o}=t;switch(o){case s.Uz.Space:case s.Uz.Enter:{const{target:t}=e;t&&this.setActiveAccordionItem(t);break}case s.Uz.ArrowDown:this.switchFocusedAccordionItem(1);break;case s.Uz.ArrowUp:this.switchFocusedAccordionItem(-1);break;case s.Uz.Home:{const e=this.slotted[0];this.focusAccordionItem(e);break}case s.Uz.End:{const e=this.slotted[this.slotted.length-1];this.focusAccordionItem(e);break}}}handleClick(e){const{target:t}=e,o=this.slotted.find(e=>e.isSameNode(t));o&&this.setActiveAccordionItem(o)}propagateDoubleClickSetting(){this.slotted.forEach(e=>{e.doubleClickToExpand=this.doubleClickToExpand})}updated(e){super.updated(e),e.has("slotted")&&(this.setupExpandedAccordionItems(),this.setupFocusAccordionItems(),this.propagateDoubleClickSetting())}connectedCallback(){super.connectedCallback(),this.addEventListener("accordion-item-keydown",this.handleKeyDown),this.addEventListener("accordion-item-click",this.handleClick)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("accordion-item-keydown",this.handleKeyDown),this.removeEventListener("accordion-item-click",this.handleClick),this.removeFocusAccordionItems()}static get styles(){return[c.A,a.A]}render(){return d.html`
        <div class="md-accordion" part="accordion">
          <slot name="accordion-item"></slot>
        </div>
      `}};u([(0,l.property)({type:Boolean,reflect:!0})],t.prototype,"multiple",void 0),u([(0,l.property)({type:Boolean,attribute:"suppress-container-focus"})],t.prototype,"suppressContainerFocus",void 0),u([(0,l.property)({type:Boolean,attribute:"double-click-to-expand"})],t.prototype,"doubleClickToExpand",void 0),u([(0,l.query)('slot[name="accordion-item"]')],t.prototype,"accordionItemSlotElement",void 0),t=u([(0,n.w)("md-accordion")],t),e.ELEMENT=t}(r||(r={}))},7704(e,t,o){o.d(t,{TS:()=>r.T}),o(2364),o(3203),o(9938),o(5201),o(4781);var r=o(608)},7161(t){t.exports=e},429(e){e.exports=t}},s={};function i(e){var t=s[e];if(void 0!==t)return t.exports;var o=s[e]={exports:{}};return r[e](o,o.exports,i),o.exports}i.m=r,o=[],i.O=(e,t,r,s)=>{if(!t){var n=1/0;for(a=0;a<o.length;a++){for(var[t,r,s]=o[a],c=!0,d=0;d<t.length;d++)(!1&s||n>=s)&&Object.keys(i.O).every(e=>i.O[e](t[d]))?t.splice(d--,1):(c=!1,s<n&&(n=s));if(c){o.splice(a--,1);var l=r();void 0!==l&&(e=l)}}return e}s=s||0;for(var a=o.length;a>0&&o[a-1][2]>s;a--)o[a]=o[a-1];o[a]=[t,r,s]},i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var o in t)i.o(t,o)&&!i.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={561:0,2942:0,5323:0,6220:0,7704:0,8180:0};i.O.j=t=>0===e[t];var t=(t,o)=>{var r,s,[n,c,d]=o,l=0;if(n.some(t=>0!==e[t])){for(r in c)i.o(c,r)&&(i.m[r]=c[r]);if(d)var a=d(i)}for(t&&t(o);l<n.length;l++)s=n[l],i.o(e,s)&&e[s]&&e[s][0](),e[s]=0;return i.O(a)},o=self["momentum-web-components-[id]"]=self["momentum-web-components-[id]"]||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})();var n=i.O(void 0,[9609,4084,2364,9938,4781,5201,2900,608,3203,742],()=>i(3701));return i.O(n)})());