import{G as e,W as t,h as n}from"./vscode-api-DjORcpSo.js";var r=5,i=1,a={duration:r,hasCloseButton:!0,isShown:!0,level:`info`,title:null},o={close:()=>{}},s={info:()=>o,success:()=>o,warning:()=>o,danger:()=>o,custom:()=>o,closeAll:()=>{}},c=new Map,l=t(n,s),u=t(n,[]),d=t(n,i),f=e(n,e=>a);function p(e,t){let n=e.get(u);if(t.customId!=null){let r=`${t.customId}-`;for(let t of n)t.startsWith(r)&&e.set(f,t,e=>({...e,isShown:!1}))}e.set(d,e=>e+1),e.set(f,t.id,t.toast),e.set(u,[t.id,...n.filter(e=>e!==t.id)])}function m(e,t){e.set(f,t,e=>({...e,isShown:!1}))}function h(e,t){c.get(t)?.(),c.delete(t),e.set(u,e=>e.filter(e=>e!==t))}function g(e){for(let t of e.get(u))m(e,t)}function _(e){return{info(t,n){return v(e,t,n,`info`)},success(t,n){return v(e,t,n,`success`)},warning(t,n){return v(e,t,n,`warning`)},danger(t,n){return v(e,t,n,`danger`)},custom(t){return v(e,null,t,t.level??`info`)},closeAll(){g(e)}}}function v(e,t,n,i){let a=e.get(d),o=n?.id==null?`${a}`:`${n.id}-${a}`,s=()=>{m(e,o)};return n?.onRemove!=null&&c.set(o,n.onRemove),p(e,{customId:n?.id,id:o,toast:{content:n!=null&&`content`in n?n.content({close:s,level:i}):void 0,description:n?.description,duration:n?.duration??r,hasCloseButton:n?.hasCloseButton??!0,isShown:!0,level:i,testId:n?.testId,title:t}}),{close:s}}export{u as a,f as i,h as n,l as r,_ as t};
//# sourceMappingURL=toast-signal-ifUptee5.js.map