import{r as t,c as i,h as s,H as o}from"./p-93b809e8.js";import{g as e,a as n}from"./p-feb3bd38.js";const h=class{constructor(s){t(this,s),this.bdsToggle=i(this,"bdsToggle",7),this.refMenuElement=t=>{this.menuElement=t},this.onClickCloseButtom=t=>{this.open=!1,t.stopPropagation()},this.refElement=null,this.intoView=null,this.menupositionTop=0,this.menupositionLeft=0,this.menu=null,this.position="right",this.open=!1}componentWillLoad(){this.refElement=document.getElementById(this.menu),this.intoView=e(this.refElement)}async toggle(){this.open=!this.open}openMenu(){if(this.bdsToggle.emit({value:this.open}),this.open){const t=n({actionElement:this.refElement,changedElement:this.menuElement,intoView:this.intoView});this.menupositionTop=t.top,this.menupositionLeft=t.left}}render(){return s(o,null,s("div",{ref:this.refMenuElement,class:{menu:!0,[`menu__${this.position}`]:!0,menu__open:this.open},style:{top:`${this.menupositionTop}px`,left:`${this.menupositionLeft}px`}},s("slot",null)),this.open&&s("div",{class:{outzone:!0},onClick:t=>this.onClickCloseButtom(t)}))}static get watchers(){return{open:["openMenu"]}}};h.style=".menu{position:fixed;pointer-events:none;top:0;left:0;padding:2px;background-color:var(--color-surface-1, #f6f6f6);border-radius:8px;-webkit-box-shadow:0px 8px 12px rgba(0, 0, 0, 0.08);box-shadow:0px 8px 12px rgba(0, 0, 0, 0.08);width:240px;opacity:0;-webkit-transition:opacity 0.5s;-moz-transition:opacity 0.5s;transition:opacity 0.5s;z-index:90000}.menu__open{pointer-events:auto;opacity:1}.outzone{position:fixed;top:0;left:0;width:100%;height:100vh;z-index:80000}";export{h as bds_menu}