export const __webpack_ids__=["3892"];export const __webpack_modules__={18399:function(t,e,o){o.r(e),o.d(e,{MDNDropdown:()=>MDNDropdown});var n=o(14703),s=o(99425),l=o(93707);let MDNDropdown=class MDNDropdown extends n.oi{static styles=l.Z;static properties={open:{type:Boolean},loaded:{type:Boolean,reflect:!0}};constructor(){super(),this.open=!1,this.loaded=!1}get _buttonSlotElements(){return this._slotElements("button")}get _dropdownSlotElements(){return this._slotElements("dropdown")}_slotElements(t){let e=this.shadowRoot?.querySelector(`slot[name="${t}"]`);return e instanceof HTMLSlotElement?e.assignedElements():[]}_globalClick(t){t.composedPath().includes(this)||(this.open=!1)}_globalKeyDown(t){this.open&&"Escape"===t.key&&this._toggleDropDown()}_toggleDropDown(){this.open=!this.open}_setAriaAttributes(){let t=this._dropdownSlotElements.find(t=>t.id)?.id;for(let e of(t||(t=(0,s.t)("uid_"),this._dropdownSlotElements[0]?.setAttribute("id",t)),this._buttonSlotElements))e.setAttribute("aria-expanded",this.open.toString()),t&&e.setAttribute("aria-controls",t)}connectedCallback(){super.connectedCallback(),this._globalClick=this._globalClick.bind(this),document.addEventListener("click",this._globalClick),this._globalKeyDown=this._globalKeyDown.bind(this),document.addEventListener("keydown",this._globalKeyDown)}render(){return(0,n.dy)`
      <slot name="button" @click=${this._toggleDropDown}></slot>
      <slot name="dropdown" ?hidden=${!this.open&&this.loaded}></slot>
    `}updated(){this._setAriaAttributes()}firstUpdated(){this.loaded=!0}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._globalClick),document.removeEventListener("keydown",this._globalKeyDown)}};customElements.define("mdn-dropdown",MDNDropdown)},99425:function(t,e,o){o.d(e,{t:()=>n});function n(t="id-"){return Math.random().toString(36).replace("0.",t)}},93707:function(t,e,o){o.d(e,{Z:()=>r});var n=o(14703),s=o(8081),l=o.n(s),i=o(23645),d=o.n(i)()(l());d.push([t.id,":host{display:contents}:host(:not([loaded],:focus-within)) slot[name=dropdown]{display:none}",""]);let r=(0,n.iv)([d.toString()])}};
//# sourceMappingURL=3892.db79ccfcc2e8b5a2.js.map