import{A as f,r as u}from"./tpFEFzWU.js";const e=u([]);function v(){const t=n=>{const o=`notification-${Date.now()}-${Math.random().toString(36).slice(2)}`,i={id:o,duration:5e3,...n};e.value.push(i),i.duration&&i.duration>0&&setTimeout(()=>{s(o)},i.duration)},s=n=>{const o=e.value.findIndex(i=>i.id===n);o!==-1&&e.value.splice(o,1)},c=(n,o)=>{t({type:"success",message:n,...o!==void 0&&{duration:o}})},r=(n,o)=>{t({type:"error",message:n,duration:o??8e3})},a=(n,o)=>{t({type:"warning",message:n,...o!==void 0&&{duration:o}})},d=(n,o)=>{t({type:"info",message:n,...o!==void 0&&{duration:o}})};return{notifications:f(e),add:t,remove:s,success:c,error:r,warning:a,info:d}}export{v as u};
