1import{i as e,t}from"./immer-CNBAJko_.js";import{t as n}from"./index.browser-D65rSomk.js";var r=class{callback;remaining;timerId;createdAt=0;constructor(e,t){this.callback=e,this.remaining=t,this.resume()}pause(){clearTimeout(this.timerId),this.remaining-=Date.now()-this.createdAt}resume(){this.createdAt=Date.now(),this.timerId&&clearTimeout(this.timerId),this.timerId=setTimeout(this.callback,this.remaining)}clear(){clearTimeout(this.timerId)}},i=function(e){return e.Danger=`danger`,e.Default=`default`,e.Positive=`positive`,e.Loading=`loading`,e}({}),a=1;function o(e){switch(e){case`danger`:return 8e3;case`loading`:return 0;default:return 3e3}}var s=e()(t((e,t)=>({toasts:[],add:(i,s)=>{let c=t().toasts.length+1-a;c>0&&e(e=>{e.toasts.splice(0,c)});let l=s?.id||n(6),u=s?.type||`positive`,d=s?.duration??o(u),f={timer:d>0?new r(()=>t().remove(l),d):null,message:i,...s,id:l,type:u,position:s?.position||`bottom-center`,duration:d,disableExitAnimation:s?.disableExitAnimation,disableEnterAnimation:s?.disableEnterAnimation},p=t().toasts.findIndex(e=>e.id===f.id);e(p>-1?e=>{e.toasts[p]=f}:e=>{e.toasts.push(f)})},remove:n=>{let r=t().toasts.filter(e=>n!==e.id||(e.timer?.clear(),!1));e(e=>{e.toasts=r})}})));function c(){return s.getState()}function l(e,t){c().add(e,t)}l.danger=(e,t)=>{c().add(e,{...t,type:i.Danger})},l.positive=(e,t)=>{c().add(e,{...t,type:i.Positive})},l.loading=(e,t)=>
1{c().add(e,{...t,type:i.Loading})};export{c as n,s as r,l as t};
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.