(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5892],{2355:(e,t,s)=>{"use strict";s.d(t,{d:()=>i,t:()=>u});var r=s(5155),a=s(2115);let n=(0,a.createContext)(void 0);function u(e){let{children:t}=e,[s,u]=(0,a.useState)([]),i=(0,a.useCallback)(e=>{u(t=>t.filter(t=>t.id!==e))},[]),l=(0,a.useCallback)(e=>{var t;let s=Math.random().toString(36).substr(2,9),r=5e3;switch(e.type){case"success":r=4e3;break;case"error":r=7e3;break;case"warning":r=6e3;break;case"info":r=5e3}let a={id:s,duration:null!=(t=e.duration)?t:r,...e};u(e=>{let t=[...e,a];return t.length>5?t.slice(-5):t}),a.duration&&a.duration>0&&setTimeout(()=>{i(s)},a.duration)},[i]),c=(0,a.useCallback)((e,t)=>{l({type:"success",message:e,title:t})},[l]),o=(0,a.useCallback)((e,t)=>{l({type:"error",message:e,title:t})},[l]),d=(0,a.useCallback)((e,t)=>{l({type:"warning",message:e,title:t})},[l]),h=(0,a.useCallback)((e,t)=>{l({type:"info",message:e,title:t})},[l]);return(0,r.jsx)(n.Provider,{value:{toasts:s,addToast:l,removeToast:i,showSuccess:c,showError:o,showWarning:d,showInfo:h},children:t})}function i(){let e=(0,a.useContext)(n);if(!e)throw Error("useToast must be used within a ToastProvider");return e}},3067:(e,t,s)=>{Promise.resolve().then(s.bind(s,7966))},7966:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>n});var r=s(5155),a=s(2355);function n(){let{showSuccess:e}=(0,a.d)();return(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{children:"Test Toast Page"}),(0,r.jsx)("button",{onClick:()=>e("This is a success toast!"),children:"Show Success Toast"})]})}}},e=>{e.O(0,[8441,5964,7358],()=>e(e.s=3067)),_N_E=e.O()}]);