import{p as t,H as s,h as e,a as i}from"./index.js";import{T as o,a as n,d as a}from"./p-DfI_0WW6.js";import{t as c}from"./p-DKo9A5gq.js";import{d as l}from"./p-CWqMiVYH.js";import{d as r}from"./p-BJnSrRNH.js";const f=t(class t extends s{constructor(){super();this.__registerHost();this.color=o.PRIMARY;this.size=n._M;this.persist=false;this.isVisible=false;this.parentId=null}visibleContent(t){clearTimeout(this.timeout);if(t===false){this.timeout=setTimeout((()=>{this.host.style.visibility="hidden"}),250)}else{this.host.style.visibility="visible"}}hideContent(){this.isVisible=false;this.persist=false;const t=document.getElementById(this.parentId);if(t){t.hide().catch()}}render(){return e(i,{key:"a826527fe9f7851ad25f700156d987c1b29f3adc",class:a.root,role:"tooltip",hidden:!this.isVisible,"aria-hidden":!c(this.isVisible),"is-visible":this.isVisible},e("slot",{key:"d3891d8a3f3df7ee7f852db8485c7ecc2f61992c"}),this.persist?e("gov-button",{"on-gov-click":this.hideContent.bind(this),color:this.color,size:this.size,type:"base"},e("gov-icon",{slot:"icon-start",name:"x-lg",type:"components"})):null)}get host(){return this}static get watchers(){return{isVisible:["visibleContent"]}}},[4,"gov-tooltip-content",{color:[1],size:[1],persist:[4],isVisible:[1028,"is-visible"],parentId:[1,"parent-id"]},undefined,{isVisible:["visibleContent"]}]);function h(){if(typeof customElements==="undefined"){return}const t=["gov-tooltip-content","gov-button","gov-icon"];t.forEach((t=>{switch(t){case"gov-tooltip-content":if(!customElements.get(t)){customElements.define(t,f)}break;case"gov-button":if(!customElements.get(t)){l()}break;case"gov-icon":if(!customElements.get(t)){r()}break}}))}h();export{f as G,h as d};
//# sourceMappingURL=p-DZJk8GrA.js.map