import{r as t,c as s,h as r,H as a,g as e}from"./p-1a84f38a.js";import{c as n}from"./p-284c5358.js";const i=class{constructor(r){t(this,r),this.anjDrawerChange=s(this,"anjDrawerChange",7)}async onKeyDown(t){if("Escape"===t.key)return this.close();"Tab"===t.key&&n(t,this.element)}onTransitionEnd(t){t.target===this.element&&"transform"===t.propertyName&&(this.active?this.element.focus():this.element.style.display="")}async close(){this.active=!1,this.emitChange(),this.triggerEl&&this.triggerEl.focus()}async open(){return this.triggerEl=document.activeElement,new Promise(t=>{this.element.style.display="block",window.setTimeout(()=>{this.contentEl.style.maxHeight=`${this.contentEl.offsetHeight}px`,this.active=!0,this.emitChange(),t()})})}async toggle(){return this.active?this.close():this.open()}emitChange(){this.anjDrawerChange.emit({active:this.active,contentHeight:this.contentEl.offsetHeight})}render(){return r(a,{class:{"anj-active":this.active},tabindex:"-1"},r("div",{class:"anj-drawer-content",ref:t=>this.contentEl=t},r("slot",null)))}get element(){return e(this)}static get style(){return".sc-anj-drawer-h{display:none;font-size:.875rem;font-family:var(--anj-font-family);font-weight:400;line-height:1.5;outline:none;background-color:var(--anj-light);bottom:0;pointer-events:none;position:absolute;right:0;top:0;-webkit-transform:translateX(100%);transform:translateX(100%);z-index:500}.sc-anj-drawer-h, .sc-anj-drawer-h:after, .sc-anj-drawer-h:before{-webkit-box-sizing:border-box;box-sizing:border-box;outline:none}.sc-anj-drawer-h:active, .sc-anj-drawer-h .sc-anj-drawer:active, .sc-anj-drawer-h:focus, .sc-anj-drawer-h .sc-anj-drawer:focus{outline:none}.anj-active.sc-anj-drawer-h{-webkit-box-shadow:0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12),0 2px 4px -1px rgba(0,0,0,.2);box-shadow:0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12),0 2px 4px -1px rgba(0,0,0,.2);pointer-events:auto;-webkit-transform:translateX(0);transform:translateX(0)}.hydrated.sc-anj-drawer-h{-webkit-transition:all .5s ease;transition:all .5s ease}.sc-anj-drawer-h .anj-drawer-content.sc-anj-drawer{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-height:100%}"}},c=class{constructor(s){t(this,s)}static get style(){return"anj-drawer-body{-ms-flex:1 1 auto;flex:1 1 auto;overflow-y:scroll;padding:1.25rem}"}},o=class{constructor(s){t(this,s)}static get style(){return"anj-drawer-container{display:block;min-height:100%;overflow:hidden;position:relative}"}},h=class{constructor(s){t(this,s)}static get style(){return"anj-drawer-footer{border-top:1px solid var(--anj-border);padding:1.25rem}"}},E=class{constructor(s){t(this,s)}static get style(){return"anj-drawer-header{border-bottom:1px solid var(--anj-border);padding:.75rem 1.25rem}"}};export{i as anj_drawer,c as anj_drawer_body,o as anj_drawer_container,h as anj_drawer_footer,E as anj_drawer_header};