import{p as w,G as p,j as u}from"./index-IQ_epUwE.js";const n=u([]),h=u(0),e=u({});function y(){const t=(o,s=3e3,r="info")=>{const a=`toast-${++h.value}`,d={id:a,message:o,timeout:s,type:r};return n.value.push(d),s>0&&(e.value[a]=window.setTimeout(()=>{l(a)},s)),a},l=o=>{const s=n.value.findIndex(r=>r.id===o);s>-1&&n.value.splice(s,1),e.value[o]&&(clearTimeout(e.value[o]),e.value[o]=null)},c=()=>{for(const o in e.value)e.value[o]&&(clearTimeout(e.value[o]),e.value[o]=null);e.value={},n.value.splice(0)},i=(o,s)=>t(o,s,"primary"),v=(o,s)=>t(o,s,"success"),f=(o,s)=>t(o,s,"error"),m=(o,s)=>t(o,s,"warning"),T=(o,s)=>t(o,s,"info");return w(()=>{}),{toasts:p(n),addToast:t,removeToast:l,clearAllToasts:c,showSuccess:v,showError:f,showWarning:m,showInfo:T,showPrimary:i}}export{y as u};
