1import{l as O,p as r}from"./CdF3t0oV.js";const _=1,c=1e6,a={ADD_TOAST:"ADD_TOAST",UPDATE_TOAST:"UPDATE_TOAST",DISMISS_TOAST:"DISMISS_TOAST",REMOVE_TOAST:"REMOVE_TOAST"};let u=0;function l(){return u=(u+1)%Number.MAX_VALUE,u.toString()}const A=new Map;function i(s){if(A.has(s))return;const t=setTimeout(()=>{A.delete(s),T({type:a.REMOVE_TOAST,toastId:s})},c);A.set(s,t)}const e=r({toasts:[]});function T(s){switch(s.type){case a.ADD_TOAST:e.value.toasts=[s.toast,...e.value.toasts].slice(0,_);break;case a.UPDATE_TOAST:e.value.toasts=e.value.toasts.map(t=>t.id===s.toast.id?{...t,...s.toast}:t);break;case a.DISMISS_TOAST:{const{toastId:t}=s;t?i(t):e.value.toasts.forEach(o=>{i(o.id)}),e.value.toasts=e.value.toasts.map(o=>o.id===t||t===void 0?{...o,open:!1}:o);break}case a.REMOVE_TOAST:s.toastId===void 0?e.value.toasts=[]:e.value.toasts=e.value.toasts.filter(t=>t.id!==s.toastId);break}}function D(){return{toasts:O(()=>e.value.toasts),toast:p,dismiss:s=>T({type:a.DISMISS_TOAST,toastId:s})}}function p(s){const t=l(),o=S=>T({type:a.UPDATE_TOAST,toast:{...S,id:t}}),n=()=>T({type:a.DISMISS_TOAST,toastId:t});return T({type:a.ADD_TOAST,toast:{...s,id:t,open:!0,onOpenChange:S=>{S||n()}}}),{id:t,dismiss:n,update:o}}export{p as t,D as u};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.