import{r as t,h as o,H as e}from"./p-CjTHbolG.js";import{c as n}from"./p-BfP9ezJQ.js";const a=()=>`verdocs-button-panel{font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif);display:inline-block}verdocs-button-panel .icon{display:inline-block;cursor:pointer;opacity:0.6}verdocs-button-panel .icon svg{fill:#707ae5}verdocs-button-panel .icon:hover{opacity:1}.verdocs-button-panel-content{font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif);-webkit-box-shadow:0 0 10px 1px #999999;box-shadow:0 0 10px 1px #999999;display:none;background:#ffffff;color:#33364b;width:320px;font-weight:bold;padding:15px;font-size:14px;position:relative;border-radius:4px;z-index:10000}.verdocs-button-panel-content .arrow,.verdocs-button-panel-content .arrow::before{position:absolute;width:8px;height:8px;background:inherit}.verdocs-button-panel-content .arrow{visibility:hidden;top:-4px}.verdocs-button-panel-content .arrow::before{visibility:visible;content:"";-webkit-transform:rotate(45deg);transform:rotate(45deg)}.verdocs-button-panel-content[data-show]{display:block}.verdocs-button-panel-content[data-popper-placement^=top]>.arrow{bottom:-4px}.verdocs-button-panel-content[data-popper-placement^=bottom]>.arrow{top:-4px}.verdocs-button-panel-content[data-popper-placement^=left]>.arrow{right:-4px}.verdocs-button-panel-content[data-popper-placement^=right]>.arrow{left:-4px}.verdocs-button-panel-content h6{font-size:16px;font-weight:bold;margin:0 0 16px 0;color:#092c4c;border-bottom:1px solid #cccccc}`;const i=class{constructor(o){t(this,o);this.icon="";this.showing=false}componentDidRender(){document.body.appendChild(this.panelEl);if(this.popperInstance){this.popperInstance.destroy()}this.popperInstance=n(this.iconEl,this.panelEl,{})}disconnectedCallback(){if(this.popperInstance){this.popperInstance.destroy();this.popperInstance=null}if(this.panelEl){this.panelEl.remove()}}async showPanel(){var t,o;(t=this.panelEl)===null||t===void 0?void 0:t.setAttribute("data-show","");(o=this.popperInstance)===null||o===void 0?void 0:o.update().catch((()=>{}));this.showing=true;this.hiderEl=document.createElement("div");this.hiderEl.id="verdocs-button-panel-hider";this.hiderEl.style.zIndex="100";this.hiderEl.style.position="absolute";this.hiderEl.style.top="0px";this.hiderEl.style.left="0px";this.hiderEl.style.right="0px";this.hiderEl.style.bottom="0px";this.hiderEl.onclick=t=>{t.stopPropagation();this.toggle()};document.body.appendChild(this.hiderEl)}async hidePanel(){var t;Array.from(document.getElementsByClassName("verdocs-button-panel-content")).forEach((t=>{t.removeAttribute("data-show")}));(t=document.getElementById("verdocs-button-panel-hider"))===null||t===void 0?void 0:t.remove();this.showing=false}async toggle(){if(this.showing){await this.hidePanel()}else{await this.showPanel()}}render(){return o(e,{key:"a72a2e112a525fa9bde58d0c4a10f2b807b024b6"},o("div",{key:"0bd3a5d35339a4c5d2023b8f237a0a84565d9e2a",class:"icon",innerHTML:this.icon,onClick:t=>{t.stopPropagation();return this.toggle()},ref:t=>this.iconEl=t}),o("div",{key:"d5b96ef39face8c26f02750cdd82782a5307d39d",role:"tooltip",class:"verdocs-button-panel-content","data-popper-placement":"bottom",ref:t=>this.panelEl=t},o("div",{key:"76954b398a6f8294bd042aceff4cba6fdc912d1f","data-popper-arrow":"true",class:"arrow"}),o("slot",{key:"dc4b6331c986e6779c2343d89c1ae3b2fb44c968"})))}};i.style=a();export{i as verdocs_button_panel};
//# sourceMappingURL=p-60812b90.entry.js.map