import{r as t,h as s,g as i}from"./p-8e4e97b4.js";const e=class{constructor(s){t(this,s);this.pendingVisibility=[];this.showToast=t=>{const s=Array.from(document.querySelectorAll("ic-toast")).filter((t=>window.getComputedStyle(t).display!=="none"));if(s.indexOf(t)===-1&&s.length<=0){t.setVisible().then((t=>this.previouslyFocused=t))}if(s.length>0)this.pendingVisibility.push(t)}}watchOpenToastHandler(t){if(this.openToast!==undefined){this.showToast(t);this.openToast=undefined}}componentDidLoad(){if(this.openToast){this.showToast(this.openToast);this.openToast=undefined}}handleDismissedToast(){var t;if(this.pendingVisibility.length>0){this.pendingVisibility[0].setVisible().then((t=>this.previouslyFocused=t));this.pendingVisibility.shift()}else{if(this.previouslyFocused&&"setFocus"in this.previouslyFocused){this.previouslyFocused.setFocus()}else(t=this.previouslyFocused)===null||t===void 0?void 0:t.focus()}}render(){return s("slot",{key:"8ba16a1a1aa173043f4a14af432e11a82fffda5a"})}get el(){return i(this)}static get watchers(){return{openToast:["watchOpenToastHandler"]}}};export{e as ic_toast_region};
//# sourceMappingURL=p-1be17f22.entry.js.map