export const __webpack_esm_id__=9613;export const __webpack_esm_ids__=[3943,9613];export const __webpack_esm_modules__={9613(e,t,o){var s,n=o(2900),i=o(7704),l=o(9609),p=o(2050),r=o(4084),a=o(2927),d=o(8899),h=o(4955),c=o(6343),u=function(e,t,o,s){var n,i=arguments.length,l=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,o):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,o,s);else for(var p=e.length-1;p>=0;p--)(n=e[p])&&(l=(i<3?n(l):i>3?n(t,o,l):n(t,o))||l);return i>3&&l&&Object.defineProperty(t,o,l),l};!function(e){let t=class extends((0,i.UM)((0,i.yC)(a.LitElement))){constructor(){super(...arguments),this.message="",this.placement="auto",this.disabled=!1,this.opened=!1,this.slotToTooltip=!1,this.slotContent=null,this._keyDownListener=e=>{this.handleKeyDown(e)},this._wheelListener=e=>{this.opened&&this.notifyTooltipDestroy()}}hasMessage(){return this.message&&this.message.trim().length>0}hasSlotContent(){return this.slotContent&&this.slotContent.length>0}get hasTooltipContent(){return this.hasMessage()||this.hasSlotContent()}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this._keyDownListener),window.addEventListener("wheel",this._wheelListener,{passive:!0})}disconnectedCallback(){this.notifyTooltipDisconnected(),super.disconnectedCallback(),document.removeEventListener("keydown",this._keyDownListener),window.removeEventListener("wheel",this._wheelListener)}handleResize(e){var t;null===(t=super.handleResize)||void 0===t||t.call(this,e),(0,p.sg)(()=>{this.slotToTooltip&&(this.disabled=this.reference&&!this.isContentTruncated(this.reference))},100)()}handleFocusIn(e){super.handleFocusIn&&super.handleFocusIn(e),this.notifyTooltipCreate()}handleFocusOut(e){super.handleFocusOut&&super.handleFocusOut(e),this.notifyTooltipDestroy()}openTooltip(){this.dispatchEvent(new CustomEvent("tooltip-create",{bubbles:!0,composed:!0,detail:Object.assign({placement:this.placement,reference:this.reference,popper:this.popper},!this.message&&{slotContent:this.slotContent})}))}notifyTooltipDisconnected(){document.dispatchEvent(new CustomEvent("tooltip-disconnected",{bubbles:!0,composed:!0,detail:{}}))}closeTooltip(){this.dispatchEvent(new CustomEvent("tooltip-destroy",{bubbles:!0,composed:!0,detail:{placement:this.placement,reference:this.reference,popper:this.popper}}))}changeMessage(){this.dispatchEvent(new CustomEvent("tooltip-message",{bubbles:!0,composed:!0,detail:{placement:this.placement,reference:this.reference,popper:this.popper}}))}changeSlotContent(e){this.dispatchEvent(new CustomEvent("tooltip-slot",{bubbles:!0,composed:!0,detail:{placement:this.placement,reference:this.reference,popper:this.popper,slotContent:e}}))}notifyTooltipCreate(){!this.disabled&&this.hasTooltipContent&&(this.opened=!0)}notifyTooltipDestroy(){this.disabled||(this.opened=!1)}handleKeyDown(e){e.code===n.Uz.Escape&&this.notifyTooltipDestroy()}handleSlotContentChange(e){const t=e.target;if(t){const e=t.assignedElements({flatten:!0});e.length&&(this.slotContent&&this.changeSlotContent(e),this.slotContent=e)}}updated(e){super.updated(e),e.has("opened")&&(this.opened?this.openTooltip():this.closeTooltip()),e.has("message")&&this.changeMessage(),e.has("disabled")&&this.opened&&(this.opened=!1)}handleSlotChanged(e){const t=e.target;if(this.slotToTooltip&&t){const e=t.assignedNodes({flatten:!0}).map(e=>e.textContent).join(" ").trim();this.message=e,this.disabled=this.reference&&!this.isContentTruncated(this.reference)}}isContentTruncated(e){return e.scrollWidth>e.clientWidth}get tooltipClassMap(){return{"md-tooltip--disabled":this.disabled}}render(){return a.html`
        <div class="md-tooltip ${(0,h.classMap)(this.tooltipClassMap)}">
          <div class="md-tooltip__popper" role="tooltip" part="tooltip-popper">
            <div id="md-tooltip__content" class="md-tooltip__content" part="tooltip-content">
              ${this.message||a.html` <slot name="tooltip-content" @slotchange=${this.handleSlotContentChange}></slot> `}
            </div>
            <div id="arrow" class="md-tooltip__arrow" data-popper-arrow></div>
          </div>
          <div
            class="md-tooltip__reference"
            part="tooltip_reference"
            @mouseenter=${()=>this.notifyTooltipCreate()}
            @mouseleave=${()=>this.notifyTooltipDestroy()}
            @focusin=${e=>this.handleFocusIn(e)}
            @focusout=${e=>this.handleFocusOut(e)}
            @keydown=${e=>this.handleKeyDown(e)}
            aria-describedby="md-tooltip__content"
          >
            <slot @slotchange=${this.handleSlotChanged}></slot>
          </div>
        </div>
      `}static get styles(){return[r.A,c.A]}};u([(0,d.property)({type:String})],t.prototype,"message",void 0),u([(0,d.property)({type:String,reflect:!0})],t.prototype,"placement",void 0),u([(0,d.property)({type:Boolean,reflect:!0})],t.prototype,"disabled",void 0),u([(0,d.property)({type:Boolean,reflect:!0})],t.prototype,"opened",void 0),u([(0,d.property)({type:Boolean,reflect:!0,attribute:"slot-to-tooltip"})],t.prototype,"slotToTooltip",void 0),u([(0,d.query)(".md-tooltip__popper")],t.prototype,"popper",void 0),u([(0,d.query)(".md-tooltip__reference")],t.prototype,"reference",void 0),t=u([(0,l.w)("md-tooltip")],t),e.ELEMENT=t}(s||(s={}))}};