class ToastManager{constructor(){this.container=document.createElement("div"),this.container.className="toast-container",document.body.appendChild(this.container),this.toasts=[],this.maxToasts=3}show(t,s="information"){let a=["success","information","error"].includes(s)?s:"information",e=document.createElement("div");for(e.className=`toast ${a}`,e.textContent=t,this.toasts.push(e),this.container.appendChild(e);this.toasts.length>this.maxToasts;){let o=this.toasts.shift();o.remove()}setTimeout(()=>{e.classList.add("fade-out"),e.addEventListener("animationend",()=>{e.remove(),this.toasts=this.toasts.filter(t=>t!==e)})},3e3)}}const toastManager=new ToastManager;window.showToast=(t,s)=>toastManager.show(t,s);