import{B as e,J as t,f as s}from"./index-bd74d86a.js";export default class extends e{connected(){const{host:e}=this,n=this.parent=this.host.parentNode;n&&n.nuElement&&!n.hasAttribute("describedby")&&n.setAttribute("describedby",this.nuId);let o=!1,i=!1;if(e.hidden=!0,this.setMod("tooltip",!0),t)return;const d=()=>{this.use("fixate").then((e=>e.start())),e.hidden=!1,n.nuSetMod("tooltip-shown",!0)},r=()=>{this.use("fixate").then((e=>e.end())),e.hidden=!0,n.nuSetMod("tooltip-shown",!1)},h=()=>{o=!0,i||(d(),setTimeout((()=>{s(e)})))},u=()=>{o=!1,i=!1,r()};n.addEventListener("mouseenter",h),n.addEventListener("mouseleave",u),this.removeListeners=()=>{n.removeEventListener("mouseenter",h),n.removeEventListener("mouseleave",u)},e.nuSetContextHook("focus",(e=>{e?(i=!0,o||d()):(i=!1,o||r())}))}disconnected(){const e=this.removeListeners;e&&e()}}
