import{r as i,c as t,h as e,H as s,g as h}from"./p-2b0a6102.js";const n=class{constructor(e){i(this,e);this.enterend=t(this,"enterend",3);this.leaveend=t(this,"leaveend",3);this.timers={enterMountTimer:undefined,enterDurationTimer:undefined,leaveMountTimer:undefined,leaveDurationTimer:undefined};this.enterClass=undefined;this.enterAttribute=undefined;this.enterDuration=undefined;this.leaveClass=undefined;this.leaveAttribute=undefined;this.leaveDuration=undefined;this.enterControlled=false;this.enterTrigger=false;this.leaveTrigger=false}get childEl(){if(!this._childEl&&this.hostEl.children.length>0){this._childEl=this.hostEl.children[0]}return this._childEl}componentDidLoad(){if(!this.enterControlled){this.handleEnterTransition()}}handleEnterTrigger(i){if(this.enterControlled&&i){this.handleEnterTransition()}}handleLeaveTrigger(i){if(i){this.handleLeaveTransition()}}handleEnterTransition(){this.timers.enterMountTimer=setTimeout((()=>{this.addEnterClassAndAttribute();this.timers.enterDurationTimer=setTimeout((()=>{this.enterend.emit()}),this.enterDuration)}),10)}addEnterClassAndAttribute(){if(this.enterClass){this.childEl.classList.add(this.enterClass)}if(this.enterAttribute){this.childEl.setAttribute(this.enterAttribute,"")}}handleLeaveTransition(){var i;this.removeEnterClassAndAttribute();this.addLeaveClassAndAttribute();this.timers.leaveDurationTimer=setTimeout((()=>{this.leaveend.emit()}),(i=this.leaveDuration)!==null&&i!==void 0?i:this.enterDuration)}addLeaveClassAndAttribute(){if(this.leaveClass){this.childEl.classList.add(this.leaveClass)}if(this.leaveAttribute){this.childEl.setAttribute(this.leaveAttribute,"")}}removeEnterClassAndAttribute(){if(this.enterClass){this.childEl.classList.remove(this.enterClass)}if(this.enterAttribute){this.childEl.removeAttribute(this.enterAttribute)}}disconnectedCallback(){Object.keys(this.timers).forEach((i=>{if(this.timers[i]){clearTimeout(this.timers[i]);this.timers[i]=undefined}}))}render(){return e(s,null,e("slot",null))}get hostEl(){return h(this)}static get watchers(){return{enterTrigger:["handleEnterTrigger"],leaveTrigger:["handleLeaveTrigger"]}}};export{n as bs_transition};
//# sourceMappingURL=p-738513ef.entry.js.map