import{r as registerInstance,h,g as getElement,H as Host}from"./index-da72c774.js";import{f as getTooltipElement,t as tinyMDtoHTML}from"./helpers-82cb299a.js";import{c as createPopper}from"./popper-0fbeff6d.js";var styleCss='x-tooltip{display:inherit}x-tooltip-overlay{font-family:"Poppins", "Arial", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";background:var(--color-dark-tinted, #626262);color:var(--color-text-light, #FEFEFE);padding:4px 8px;font-size:0.9rem;border-radius:4px;display:none;-webkit-box-shadow:0 0 1em rgba(0, 0, 0, 0.2);box-shadow:0 0 1em rgba(0, 0, 0, 0.2);z-index:10000;position:relative;text-align:inherit}x-tooltip-overlay:empty{display:none}.is-dark-mode x-tooltip-overlay{background:var(--color-light-shade, #d8d8d8);color:var(--color-text, #4A4A4A)}x-tooltip-overlay[data-show]{display:block;-webkit-animation:0.4s fadeIn;animation:0.4s fadeIn}x-tooltip-overlay>p{margin:0px;font-family:"Poppins", "Arial", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"}x-tooltip-overlay .tooltip-arrow,x-tooltip-overlay .tooltip-arrow::before{position:absolute;width:8px;height:8px;z-index:-1}x-tooltip-overlay .tooltip-arrow::before{content:"";-webkit-transform:rotate(45deg);transform:rotate(45deg);background:var(--color-dark-tinted, #626262)}.is-dark-mode x-tooltip-overlay .tooltip-arrow::before{background:var(--color-light-shade, #d8d8d8)}x-tooltip-overlay[data-popper-placement^=top]>.tooltip-arrow{bottom:-4px}x-tooltip-overlay[data-popper-placement^=bottom]>.tooltip-arrow{top:-4px}x-tooltip-overlay[data-popper-placement^=left]>.tooltip-arrow{right:-4px}x-tooltip-overlay[data-popper-placement^=right]>.tooltip-arrow{left:-4px}';var XTooltipStyle0=styleCss;var popperDefaultConfig={placement:"auto",modifiers:[{name:"offset",options:{offset:[0,4]}}]};var showEvents=["mouseenter"];var hideEvents=["mouseleave","blur"];var XTooltip=function(){function o(o){registerInstance(this,o);this.content=undefined;this.align="top"}o.prototype.componentDidLoad=function(){var o=this;this.tooltip=getTooltipElement();showEvents.forEach((function(t){o.el.addEventListener(t,o.showHandler.bind(o))}));hideEvents.forEach((function(t){o.el.addEventListener(t,o.hideHandler.bind(o))}))};o.prototype.disconectedCallback=function(){var o=this;showEvents.forEach((function(t){o.el.removeEventListener(t,o.showHandler)}));hideEvents.forEach((function(t){o.el.removeEventListener(t,o.hideHandler)}));if(this.popper){this.popper.destroy()}};o.prototype.showHandler=function(){this.tooltip.setAttribute("data-show","");this.tooltip.querySelector("span").innerHTML=tinyMDtoHTML(this.content)||"";this.popper=createPopper(this.el,this.tooltip,Object.assign(Object.assign({},popperDefaultConfig),{placement:this.align}))};o.prototype.hideHandler=function(){this.tooltip.removeAttribute("data-show");this.tooltip.querySelector("span").innerHTML="";this.popper.destroy();this.popper=null};o.prototype.render=function(){return h(Host,{key:"b50b8a5bdb305699d7553b82ac2156ca7caa373d","aria-label":this.content})};Object.defineProperty(o.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return o}();XTooltip.style=XTooltipStyle0;export{XTooltip as x_tooltip};