react-toast-kit
Version:
A modern, accessible toast notification system for React applications with automatic CSS injection
2 lines • 92.8 kB
JavaScript
"use client";
'use strict';var rt=require('react'),jsxRuntime=require('react/jsx-runtime'),reactDom=require('react-dom'),framerMotion=require('framer-motion');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var rt__namespace=/*#__PURE__*/_interopNamespace(rt);var J=Object.defineProperty;var $t=Object.getOwnPropertyDescriptor;var Vt=Object.getOwnPropertyNames;var Ht=Object.prototype.hasOwnProperty;var $=(t,e)=>()=>(t&&(e=t(t=0)),e);var Gt=(t,e)=>{for(var o in e)J(t,o,{get:e[o],enumerable:true});},Wt=(t,e,o,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Vt(e))!Ht.call(t,n)&&n!==o&&J(t,n,{get:()=>e[n],enumerable:!(s=$t(e,n))||s.enumerable});return t};var Ft=t=>Wt(J({},"__esModule",{value:true}),t);var st,nt,Z=$(()=>{st=t=>{let e,o=new Set,s=(p,f)=>{let T=typeof p=="function"?p(e):p;if(!Object.is(T,e)){let m=e;e=f??(typeof T!="object"||T===null)?T:Object.assign({},e,T),o.forEach(w=>w(e,m));}},n=()=>e,g={setState:s,getState:n,getInitialState:()=>a,subscribe:p=>(o.add(p),()=>o.delete(p))},a=e=t(s,n,g);return g},nt=t=>t?st(t):st;});function Kt(t,e=Xt){let o=rt__namespace.default.useSyncExternalStore(t.subscribe,()=>e(t.getState()),()=>e(t.getInitialState()));return rt__namespace.default.useDebugValue(o),o}var Xt,at,lt,ct=$(()=>{Z();Xt=t=>t;at=t=>{let e=nt(t),o=s=>Kt(e,s);return Object.assign(o,e),o},lt=t=>t?at(t):at;});var dt=$(()=>{Z();ct();});var Yt,qt,mt,Jt,pt;exports.useToastStore=void 0;var Zt,ut,G,V;exports.toast=void 0;exports.registerPlugin=void 0;exports.unregisterPlugin=void 0;exports.cleanup=void 0;var L=$(()=>{dt();Yt={defaultDuration:4e3,defaultDismissible:true,defaultPauseOnHover:true,defaultDismissOnClick:false,defaultAnimation:"slide",defaultStyle:"solid",defaultProgressBarPosition:"bottom",defaultProgressBarThickness:3,defaultProgressAnimation:"linear",defaultFloating:false,defaultRippleEffect:false,defaultSwipeToDismiss:false,defaultPriority:"normal",defaultStagger:0},qt="top-right",mt="system",Jt=3,pt=()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return "light";try{return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch{return "light"}},exports.useToastStore=lt((t,e)=>({toasts:[],maxToasts:Jt,theme:mt,effectiveTheme:pt(),pausedToasts:new Set,activeTimers:new Map,timerStartedAt:new Map,remainingTime:new Map,plugins:[],config:Yt,setConfig:o=>{t(s=>({config:{...s.config,...o}}));},addToast:o=>{try{let{plugins:s,activeTimers:n,pausedToasts:d}=e(),r=o;for(let T of s)if(T.beforeCreate){let m=T.beforeCreate(r),w;(m.style||r.style)&&(w={...r.style||{},...m.style||{}}),r={...r,...m,id:m.id||r.id,variant:m.variant||r.variant,position:m.position||r.position,duration:m.duration!==void 0?m.duration:r.duration,pauseOnHover:m.pauseOnHover!==void 0?m.pauseOnHover:r.pauseOnHover,dismissible:m.dismissible!==void 0?m.dismissible:r.dismissible,dismissOnClick:m.dismissOnClick!==void 0?m.dismissOnClick:r.dismissOnClick,theme:m.theme||r.theme,createdAt:r.createdAt,style:w,iconString:r.iconString,updating:r.updating};}let g=e().toasts;if(g.length>=e().maxToasts){let T=[...g].sort((m,w)=>m.createdAt-w.createdAt).find(m=>m.id!==r.id);T&&e().removeToast(T.id);}let a=e().toasts,p=a.length;if(r.priority==="high")p=0;else if(r.priority==="normal"){let T=a.findIndex(m=>m.priority==="low");T!==-1&&(p=T);}let f=[...a];if(f.splice(p,0,r),t({toasts:f}),r.duration>0&&!d.has(r.id)){let T=n.get(r.id);T&&clearTimeout(T);let m=Date.now(),w=window.setTimeout(()=>{e().removeToast(r.id);},r.duration);t(A=>({activeTimers:new Map(A.activeTimers).set(r.id,w),timerStartedAt:new Map(A.timerStartedAt).set(r.id,m)}));}for(let T of s)T.afterCreate?.(r);return r.id}catch(s){return console.error("React Toast Kit: Failed to add toast",s),""}},removeToast:o=>{try{let{toasts:s,plugins:n,activeTimers:d}=e(),r=s.find(p=>p.id===o);if(!r)return;let g=!0;for(let p of n)p.beforeRemove?.(r)===!1&&(g=!1);if(!g)return;let a=d.get(o);a&&clearTimeout(a),r.onDismiss?.(o),t(p=>{let f=new Map(p.activeTimers);f.delete(o);let T=new Map(p.timerStartedAt);T.delete(o);let m=new Map(p.remainingTime);m.delete(o);let w=new Set(p.pausedToasts);return w.delete(o),{toasts:p.toasts.filter(A=>A.id!==o),pausedToasts:w,activeTimers:f,timerStartedAt:T,remainingTime:m}});for(let p of n)p.afterRemove?.(r);}catch(s){console.error("React Toast Kit: Failed to remove toast",s);}},updateToast:(o,s)=>{try{if(t(n=>({toasts:n.toasts.map(d=>d.id===o?{...d,...s,updating:!0}:d)})),s.duration!==void 0){let{activeTimers:n,pausedToasts:d}=e(),r=n.get(o);r&&clearTimeout(r);let g=e().toasts.find(a=>a.id===o);if(g&&g.duration>0&&!d.has(o)){let a=Date.now(),p=window.setTimeout(()=>{e().removeToast(o);},g.duration);t(f=>({activeTimers:new Map(f.activeTimers).set(o,p),timerStartedAt:new Map(f.timerStartedAt).set(o,a),remainingTime:(()=>{let T=new Map(f.remainingTime);return T.delete(o),T})()}));}}setTimeout(()=>{t(n=>({toasts:n.toasts.map(d=>d.id===o?{...d,updating:!1}:d)}));},100);}catch(n){console.error("React Toast Kit: Failed to update toast",n);}},pauseToast:o=>{let{activeTimers:s,timerStartedAt:n}=e(),d=s.get(o);if(d){clearTimeout(d);let r=n.get(o),g=e().toasts.find(a=>a.id===o);if(r!==void 0&&g){let a=Date.now()-r,p=Math.max(0,g.duration-a);t(f=>{let T=new Map(f.activeTimers);T.delete(o);let m=new Map(f.timerStartedAt);m.delete(o);let w=new Map(f.remainingTime).set(o,p);return {activeTimers:T,timerStartedAt:m,remainingTime:w}});}else t(a=>{let p=new Map(a.activeTimers);return p.delete(o),{activeTimers:p}});}t(r=>({pausedToasts:new Set(r.pausedToasts).add(o)}));},resumeToast:o=>{let{remainingTime:s,toasts:n}=e();t(g=>{let a=new Set(g.pausedToasts);return a.delete(o),{pausedToasts:a}});let d=n.find(g=>g.id===o);if(!d||d.duration<=0)return;let r=s.get(o)??Math.max(0,d.duration-(Date.now()-d.createdAt));if(r>0){let g=Date.now(),a=window.setTimeout(()=>{e().removeToast(o);},r);t(p=>{let f=new Map(p.remainingTime);return f.delete(o),{activeTimers:new Map(p.activeTimers).set(o,a),timerStartedAt:new Map(p.timerStartedAt).set(o,g),remainingTime:f}});}},clearAllToasts:()=>{try{let{toasts:o,activeTimers:s}=e();s.forEach(n=>clearTimeout(n)),o.forEach(n=>n.onDismiss?.(n.id)),t({toasts:[],pausedToasts:new Set,activeTimers:new Map,timerStartedAt:new Map,remainingTime:new Map});}catch(o){console.error("React Toast Kit: Failed to clear all toasts",o);}},setTheme:o=>{t({theme:o}),e().updateEffectiveTheme();},setMaxToasts:o=>{t({maxToasts:Math.max(1,o)});},updateEffectiveTheme:()=>{let{theme:o}=e(),s=o==="system"?pt():o;t({effectiveTheme:s});},cleanup:()=>{try{let{activeTimers:o,toasts:s}=e();o.forEach(n=>clearTimeout(n)),s.forEach(n=>n.onDismiss?.(n.id)),t({toasts:[],pausedToasts:new Set,activeTimers:new Map,timerStartedAt:new Map,remainingTime:new Map});}catch(o){console.error("React Toast Kit: Failed to cleanup",o);}},registerPlugin:o=>{t(s=>({plugins:[...s.plugins.filter(n=>n.name!==o.name),o]}));},unregisterPlugin:o=>{t(s=>({plugins:s.plugins.filter(n=>n.name!==o)}));}}));if(typeof window<"u"&&typeof window.matchMedia=="function")try{let t=window.matchMedia("(prefers-color-scheme: dark)"),e=()=>{exports.useToastStore.getState().theme==="system"&&exports.useToastStore.getState().updateEffectiveTheme();};typeof t.addEventListener=="function"?t.addEventListener("change",e):t.addListener?.(e),exports.useToastStore.getState().updateEffectiveTheme();}catch{}Zt=()=>Math.random().toString(36).substring(2,9),ut={success:'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Success"><path d="M10 18.3333C14.6024 18.3333 18.3334 14.6023 18.3334 9.99996C18.3334 5.39759 14.6024 1.66663 10 1.66663C5.39765 1.66663 1.66669 5.39759 1.66669 9.99996C1.66669 14.6023 5.39765 18.3333 10 18.3333Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M6.66669 10L9.16669 12.5L13.3334 7.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>',error:'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Error"><path d="M10 18.3333C14.6024 18.3333 18.3334 14.6023 18.3334 9.99996C18.3334 5.39759 14.6024 1.66663 10 1.66663C5.39765 1.66663 1.66669 5.39759 1.66669 9.99996C1.66669 14.6023 5.39765 18.3333 10 18.3333Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M12.5 7.5L7.5 12.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M7.5 7.5L12.5 12.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>',warning:'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Warning"><path d="M8.57465 3.21667L1.51632 15C1.37079 15.2589 1.29379 15.5503 1.29298 15.8469C1.29216 16.1434 1.36756 16.4353 1.51175 16.6951C1.65593 16.9548 1.86359 17.1738 2.11656 17.3309C2.36954 17.4879 2.65908 17.5778 2.95548 17.5917H17.0721C17.3685 17.5778 17.6581 17.4879 17.9111 17.3309C18.164 17.1738 18.3717 16.9548 18.5159 16.6951C18.6601 16.4353 18.7355 16.1434 18.7347 15.8469C18.7339 15.5503 18.6569 15.2589 18.5113 15L11.453 3.21667C11.3018 2.96735 11.0893 2.7609 10.8353 2.61224C10.5813 2.46357 10.294 2.3779 10.0005 2.3646C9.7069 2.37798 9.41956 2.46374 9.16556 2.61247C8.91156 2.76121 8.69907 2.96773 8.54798 3.21708L8.57465 3.21667Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M10 7.5V10.8333" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M10 14.1667H10.0083" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>',info:'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Info"><path d="M10 18.3333C14.6024 18.3333 18.3334 14.6023 18.3334 9.99996C18.3334 5.39759 14.6024 1.66663 10 1.66663C5.39765 1.66663 1.66669 5.39759 1.66669 9.99996C1.66669 14.6023 5.39765 18.3333 10 18.3333Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M10 13.3333V10" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M10 6.66663H10.0083" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>',default:'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Notification"><path d="M18.3334 10C18.3334 14.6024 14.6024 18.3333 10 18.3333C5.39765 18.3333 1.66669 14.6024 1.66669 10C1.66669 5.39763 5.39765 1.66667 10 1.66667C14.6024 1.66667 18.3334 5.39763 18.3334 10Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M10 6.66667V10" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M10 13.3333H10.0083" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>',loading:'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" class="animate-spin" role="img" aria-label="Loading"><path d="M10 3.33337V5.00004" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M10 15V16.6667" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M4.1084 4.1084L5.2834 5.28257" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M14.7166 14.7167L15.8916 15.8917" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M3.33337 10H5.00004" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M15 10H16.6667" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M4.1084 15.8917L5.2834 14.7167" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M14.7166 5.28257L15.8916 4.1084" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>'},G=t=>{try{let e=exports.useToastStore.getState().config,o={duration:e.defaultDuration,dismissible:e.defaultDismissible,pauseOnHover:e.defaultPauseOnHover,dismissOnClick:e.defaultDismissOnClick,animation:e.defaultAnimation,visualStyle:e.defaultStyle,progressBarStyle:e.defaultProgressBarStyle,progressBarColor:e.defaultProgressBarColor,progressBarPosition:e.defaultProgressBarPosition,progressBarThickness:e.defaultProgressBarThickness,progressAnimation:e.defaultProgressAnimation,floating:e.defaultFloating,rippleEffect:e.defaultRippleEffect,swipeToDismiss:e.defaultSwipeToDismiss,priority:e.defaultPriority,stagger:e.defaultStagger},s=typeof t=="string"?{...o,description:t}:{...o,...t};e.globalClassName&&(s.className=s.className?`${e.globalClassName} ${s.className}`:e.globalClassName),e.globalStyle&&(s.style={...e.globalStyle,...s.style||{}});let n={id:s.id||Zt(),variant:s.variant||"default",position:s.position||qt,duration:s.duration??e.defaultDuration,pauseOnHover:s.pauseOnHover??!0,dismissible:s.dismissible??!0,dismissOnClick:s.dismissOnClick??!1,theme:s.theme||mt,title:s.title,description:s.description,icon:s.icon,component:s.component,createdAt:Date.now(),onDismiss:s.onDismiss,className:s.className,style:s.style,animation:s.animation,customAnimation:s.customAnimation,visualStyle:s.visualStyle,progressBarStyle:s.progressBarStyle,progressBarColor:s.progressBarColor,progressBarPosition:s.progressBarPosition,progressBarThickness:s.progressBarThickness,floating:s.floating,emoji:s.emoji,rippleEffect:s.rippleEffect,stagger:s.stagger,swipeToDismiss:s.swipeToDismiss,priority:s.priority,progressAnimation:s.progressAnimation,actions:s.actions};return !n.icon&&!n.emoji&&n.variant&&n.variant in ut&&(n.iconString=ut[n.variant]),exports.useToastStore.getState().addToast(n)}catch(e){return console.error("React Toast Kit: Failed to create toast",e),""}},V=t=>e=>G({...typeof e=="string"?{description:e}:e,variant:t}),exports.toast=t=>G(t);exports.toast.success=V("success");exports.toast.error=V("error");exports.toast.warning=V("warning");exports.toast.info=V("info");exports.toast.loading=V("loading");exports.toast.custom=(t,e={})=>G({...e,component:t,variant:"custom"});exports.toast.promise=async(t,e)=>{let o=typeof e.loading=="string"?{description:e.loading}:e.loading,s=G({...o,variant:"loading",duration:0}),n=exports.useToastStore.getState().config.defaultDuration;try{let d=await t,r=typeof e.success=="function"?e.success(d):e.success;return exports.toast.update(s,typeof r=="string"?{description:r,variant:"success",duration:n}:{...r,variant:"success",duration:r.duration??n}),d}catch(d){let r=typeof e.error=="function"?e.error(d):e.error;throw exports.toast.update(s,typeof r=="string"?{description:r,variant:"error",duration:n}:{...r,variant:"error",duration:r.duration??n}),d}};exports.toast.update=(t,e)=>{try{exports.useToastStore.getState().toasts.find(s=>s.id===t)?.variant==="loading"&&e.variant&&e.variant!=="loading"&&!e.duration&&(e.duration=exports.useToastStore.getState().config.defaultDuration),exports.useToastStore.getState().updateToast(t,e);}catch(o){console.error("React Toast Kit: Failed to update toast",o);}};exports.toast.dismiss=t=>{t?exports.useToastStore.getState().removeToast(t):exports.useToastStore.getState().clearAllToasts();};exports.toast.clearAll=()=>{exports.useToastStore.getState().clearAllToasts();};exports.registerPlugin=t=>{exports.useToastStore.getState().registerPlugin(t);},exports.unregisterPlugin=t=>{exports.useToastStore.getState().unregisterPlugin(t);},exports.cleanup=()=>{exports.useToastStore.getState().cleanup();},{show:()=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("react-toast-kit:devtools:show"));},hide:()=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("react-toast-kit:devtools:hide"));},toggle:()=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("react-toast-kit:devtools:toggle"));},getToasts:()=>exports.useToastStore.getState().toasts,...typeof process<"u"&&process.env.NODE_ENV==="development"?{getActiveToasts:()=>exports.useToastStore.getState().toasts,clearAll:()=>exports.useToastStore.getState().clearAllToasts(),debugInfo:()=>{let t=exports.useToastStore.getState();console.group("React Toast Kit Debug Info"),console.table(t.toasts.map(e=>({id:e.id,variant:e.variant,position:e.position,duration:e.duration,priority:e.priority,createdAt:new Date(e.createdAt).toLocaleTimeString()}))),console.log("Theme:",t.theme,"| Effective:",t.effectiveTheme),console.log("Paused toasts:",Array.from(t.pausedToasts)),console.log("Active timers:",t.activeTimers.size),console.log("Registered plugins:",t.plugins.map(e=>e.name)),console.groupEnd();},getStore:()=>exports.useToastStore.getState(),simulateError:()=>exports.toast.error("Test error toast for debugging"),simulateSuccess:()=>exports.toast.success("Test success toast for debugging")}:{}};});var Pt={};Gt(Pt,{ToastDevTools:()=>Ct,default:()=>ue});var K,de,pe,wt,Ct,ue,Rt=$(()=>{L();(({useState:K,useEffect:de,useCallback:pe,useMemo:wt}=rt__namespace)),Ct=()=>{let[t,e]=K(false),[o,s]=K("monitor"),[n,d]=K(false),{toasts:r,theme:g,effectiveTheme:a,maxToasts:p,pausedToasts:f,activeTimers:T,plugins:m,clearAllToasts:w,removeToast:A,pauseToast:O,resumeToast:M,setTheme:E,setMaxToasts:h}=exports.useToastStore(),[k,b]=K({title:"Test Toast",description:"This is a test toast for debugging",variant:"info",position:"top-right",animation:"slide",visualStyle:"solid",duration:4e3,pauseOnHover:true,dismissible:true}),x=wt(()=>{let i=r.reduce((S,D)=>(S[D.variant]=(S[D.variant]||0)+1,S),{}),u=r.reduce((S,D)=>(S[D.position]=(S[D.position]||0)+1,S),{});return {total:r.length,paused:f.size,timers:T.size,byVariant:i,byPosition:u}},[r,f,T]),R={success:()=>exports.toast.success("\u2705 Success toast test"),error:()=>exports.toast.error("\u274C Error toast test"),warning:()=>exports.toast.warning("\u26A0\uFE0F Warning toast test"),info:()=>exports.toast.info("\u2139\uFE0F Info toast test"),loading:()=>exports.toast.loading("\u23F3 Loading toast test"),custom:()=>exports.toast.custom(jsxRuntime.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[jsxRuntime.jsx("span",{style:{fontSize:"24px"},children:"\u{1F389}"}),jsxRuntime.jsx("span",{children:"Custom component toast!"})]})),promise:()=>{let i=new Promise((u,S)=>{setTimeout(()=>Math.random()>.5?u("Success!"):S("Failed!"),2e3);});exports.toast.promise(i,{loading:"Loading...",success:"Promise resolved!",error:"Promise rejected!"});},stress:()=>{for(let i=0;i<5;i++)setTimeout(()=>{exports.toast({title:`Stress test toast #${i+1}`,description:"Testing multiple toasts at once",variant:["success","error","warning","info"][i%4],position:["top-left","top-right","bottom-left","bottom-right"][i%4],duration:2e3});},i*200);}},B=pe(()=>{exports.toast(k);},[k]);de(()=>{let i=u=>{u.altKey&&u.shiftKey&&u.key==="D"&&e(S=>!S);};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[]);let I=(i="default")=>{switch(i){case "success":return {background:"#dcfce7",color:"#166534"};case "error":return {background:"#fee2e2",color:"#b91c1c"};case "warning":return {background:"#fef3c7",color:"#92400e"};case "info":return {background:"#dbeafe",color:"#1e40af"};case "loading":return {background:"#f3f4f6",color:"#4b5563"};default:return {background:"#f1f5f9",color:"#334155"}}},c=wt(()=>({devToolsButton:{position:"fixed",bottom:"16px",right:"16px",zIndex:1e4,width:"48px",height:"48px",borderRadius:"24px",background:"linear-gradient(135deg, #3b82f6, #8b5cf6)",color:"white",boxShadow:"0 4px 12px rgba(59, 130, 246, 0.5)",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"transform 0.2s"},devToolsPanel:{position:"fixed",bottom:"16px",right:"16px",zIndex:1e4,width:n?"320px":"380px",height:n?"48px":"600px",background:a==="dark"?"#1f2937":"white",borderRadius:"8px",boxShadow:"0 10px 25px rgba(0, 0, 0, 0.2)",border:`1px solid ${a==="dark"?"#374151":"#e5e7eb"}`,overflow:"hidden",fontFamily:"system-ui, sans-serif",display:"flex",flexDirection:"column"},panelHeader:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",background:a==="dark"?"#111827":"#f0f9ff",borderBottom:`1px solid ${a==="dark"?"#374151":"#e5e7eb"}`},headerTitle:{display:"flex",alignItems:"center",gap:"8px",fontWeight:600,fontSize:"14px",color:a==="dark"?"#f3f4f6":"#1f2937"},statusIndicator:{width:"8px",height:"8px",borderRadius:"4px",background:"#22c55e"},tabsContainer:{display:"flex",borderBottom:`1px solid ${a==="dark"?"#374151":"#e5e7eb"}`},tab:i=>({flex:1,padding:"10px",textAlign:"center",fontSize:"13px",color:i?a==="dark"?"#60a5fa":"#3b82f6":a==="dark"?"#9ca3af":"#64748b",background:i?a==="dark"?"#111827":"white":a==="dark"?"#1f2937":"#f8fafc",cursor:"pointer",borderBottom:i?`2px solid ${a==="dark"?"#60a5fa":"#3b82f6"}`:"2px solid transparent"}),contentContainer:{padding:"16px",overflowY:"auto",flex:1,fontSize:"14px"},statsGrid:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"8px",marginBottom:"16px"},statCard:(i=false)=>({padding:"12px",borderRadius:"6px",background:a==="dark"?i?"#422006":"#082f49":i?"#fef3c7":"#f0f9ff",display:"flex",flexDirection:"column"}),statTitle:(i=false)=>({fontSize:"12px",fontWeight:500,color:a==="dark"?i?"#fcd34d":"#93c5fd":i?"#b45309":"#0369a1",marginBottom:"4px"}),statValue:(i=false)=>({fontSize:"20px",fontWeight:700,color:a==="dark"?i?"#fbbf24":"#bfdbfe":i?"#92400e":"#0c4a6e"}),sectionTitle:{fontWeight:600,color:a==="dark"?"#e2e8f0":"#334155",margin:"16px 0 8px"},quickTestsGrid:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"8px",marginBottom:"16px"},quickTestButton:{padding:"8px",borderRadius:"6px",background:a==="dark"?"#1f2937":"#f1f5f9",border:"none",color:a==="dark"?"#d1d5db":"#334155",fontSize:"12px",cursor:"pointer",textAlign:"left"},toastsList:{display:"flex",flexDirection:"column",gap:"8px",maxHeight:"240px",overflowY:"auto"},toastItem:{padding:"10px",borderRadius:"6px",background:a==="dark"?"#1f2937":"#f8fafc",border:`1px solid ${a==="dark"?"#374151":"#e2e8f0"}`},toastHeader:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"6px"},variantBadge:(i="default")=>{let u=I(i);return {padding:"2px 6px",borderRadius:"4px",fontSize:"11px",fontWeight:500,background:u.background,color:u.color}},toastActions:{display:"flex",gap:"4px"},actionButton:i=>({background:"none",border:"none",fontSize:"11px",cursor:"pointer",padding:"2px 4px",borderRadius:"4px",color:i}),toastContent:{fontSize:"12px",color:a==="dark"?"#cbd5e1":"#475569"},toastTitle:{fontWeight:500,color:a==="dark"?"#e2e8f0":"#334155",marginBottom:"2px"},toastDescription:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},toastMeta:{marginTop:"4px",fontSize:"11px",color:a==="dark"?"#64748b":"#94a3b8"},inputGroup:{marginBottom:"12px"},inputLabel:{display:"block",fontSize:"12px",fontWeight:500,color:a==="dark"?"#e2e8f0":"#334155",marginBottom:"4px"},textInput:{width:"100%",padding:"8px",border:`1px solid ${a==="dark"?"#374151":"#cbd5e1"}`,borderRadius:"4px",fontSize:"12px",background:a==="dark"?"#1f2937":"white",color:a==="dark"?"#f1f5f9":"inherit"},selectInput:{width:"100%",padding:"8px",border:`1px solid ${a==="dark"?"#374151":"#cbd5e1"}`,borderRadius:"4px",fontSize:"12px",background:a==="dark"?"#1f2937":"white",color:a==="dark"?"#f1f5f9":"inherit"},createButton:{width:"100%",padding:"8px",background:"#3b82f6",color:"white",border:"none",borderRadius:"4px",fontSize:"13px",fontWeight:500,cursor:"pointer"},formGrid:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"8px"}}),[a,n]);return typeof process<"u"&&process.env.NODE_ENV==="production"?null:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[!t&&jsxRuntime.jsx("button",{onClick:()=>e(true),style:c.devToolsButton,title:"Open Toast DevTools (Alt+Shift+D)",children:jsxRuntime.jsxs("svg",{width:"24",height:"24",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}),t&&jsxRuntime.jsxs("div",{style:c.devToolsPanel,children:[jsxRuntime.jsxs("div",{style:c.panelHeader,children:[jsxRuntime.jsxs("div",{style:c.headerTitle,children:[jsxRuntime.jsx("div",{style:c.statusIndicator}),jsxRuntime.jsx("span",{children:"React Toast Kit DevTools"}),jsxRuntime.jsxs("span",{style:{fontSize:"11px",padding:"2px 6px",borderRadius:"4px",background:a==="dark"?"#0c4a6e":"#dbeafe",color:a==="dark"?"#bfdbfe":"#1e40af"},children:[x.total," active"]})]}),jsxRuntime.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[jsxRuntime.jsx("button",{onClick:()=>d(!n),style:{padding:"4px",background:"transparent",border:"none",cursor:"pointer",color:a==="dark"?"#9ca3af":"#64748b"},title:n?"Expand":"Minimize",children:jsxRuntime.jsx("svg",{width:"16",height:"16",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:n?"M7 14l5-5 5 5":"M17 10l-5 5-5-5"})})}),jsxRuntime.jsx("button",{onClick:()=>e(false),style:{padding:"4px",background:"transparent",border:"none",cursor:"pointer",color:"#ef4444"},title:"Close DevTools",children:jsxRuntime.jsx("svg",{width:"16",height:"16",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]}),!n&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{style:c.tabsContainer,children:[{key:"monitor",label:"Monitor",icon:"\u{1F4CA}"},{key:"create",label:"Create",icon:"\u2795"},{key:"settings",label:"Settings",icon:"\u2699\uFE0F"}].map(i=>jsxRuntime.jsxs("button",{onClick:()=>s(i.key),style:c.tab(o===i.key),children:[jsxRuntime.jsx("span",{style:{marginRight:"4px"},children:i.icon}),i.label]},i.key))}),jsxRuntime.jsxs("div",{style:c.contentContainer,children:[o==="monitor"&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{style:c.statsGrid,children:[jsxRuntime.jsxs("div",{style:c.statCard(),children:[jsxRuntime.jsx("div",{style:c.statTitle(),children:"Total"}),jsxRuntime.jsx("div",{style:c.statValue(),children:x.total})]}),jsxRuntime.jsxs("div",{style:c.statCard(true),children:[jsxRuntime.jsx("div",{style:c.statTitle(true),children:"Paused"}),jsxRuntime.jsx("div",{style:c.statValue(true),children:x.paused})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{style:c.sectionTitle,children:"Quick Tests"}),jsxRuntime.jsx("div",{style:c.quickTestsGrid,children:Object.entries(R).map(([i,u])=>jsxRuntime.jsx("button",{onClick:u,style:c.quickTestButton,children:i.charAt(0).toUpperCase()+i.slice(1)},i))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"8px"},children:[jsxRuntime.jsx("h3",{style:c.sectionTitle,children:"Active Toasts"}),r.length>0&&jsxRuntime.jsx("button",{onClick:w,style:{fontSize:"12px",color:"#ef4444",background:"transparent",border:"none",cursor:"pointer",textDecoration:"underline"},children:"Clear All"})]}),jsxRuntime.jsx("div",{style:c.toastsList,children:r.length===0?jsxRuntime.jsx("div",{style:{textAlign:"center",padding:"16px",color:a==="dark"?"#9ca3af":"#64748b"},children:"No active toasts"}):r.map(i=>jsxRuntime.jsxs("div",{style:c.toastItem,children:[jsxRuntime.jsxs("div",{style:c.toastHeader,children:[jsxRuntime.jsx("span",{style:c.variantBadge(i.variant),children:i.variant||"default"}),jsxRuntime.jsxs("div",{style:c.toastActions,children:[jsxRuntime.jsx("button",{onClick:()=>f.has(i.id)?M(i.id):O(i.id),style:c.actionButton("#2563eb"),children:f.has(i.id)?"\u25B6\uFE0F":"\u23F8\uFE0F"}),jsxRuntime.jsx("button",{onClick:()=>A(i.id),style:c.actionButton("#ef4444"),children:"\u274C"})]})]}),jsxRuntime.jsxs("div",{style:c.toastContent,children:[jsxRuntime.jsx("div",{style:c.toastTitle,children:i.title||"No title"}),i.description&&jsxRuntime.jsx("div",{style:c.toastDescription,children:i.description}),jsxRuntime.jsxs("div",{style:c.toastMeta,children:[i.position," \u2022 ",i.animation||"slide"," \u2022 ",i.duration,"ms"]})]})]},i.id))})]})]}),o==="create"&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{style:c.sectionTitle,children:"Create Test Toast"}),jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[jsxRuntime.jsxs("div",{style:c.inputGroup,children:[jsxRuntime.jsx("label",{style:c.inputLabel,children:"Title"}),jsxRuntime.jsx("input",{type:"text",value:k.title||"",onChange:i=>b(u=>({...u,title:i.target.value})),style:c.textInput})]}),jsxRuntime.jsxs("div",{style:c.inputGroup,children:[jsxRuntime.jsx("label",{style:c.inputLabel,children:"Description"}),jsxRuntime.jsx("textarea",{value:k.description||"",onChange:i=>b(u=>({...u,description:i.target.value})),style:{...c.textInput,minHeight:"60px",resize:"vertical"},rows:2})]}),jsxRuntime.jsxs("div",{style:c.formGrid,children:[jsxRuntime.jsxs("div",{style:c.inputGroup,children:[jsxRuntime.jsx("label",{style:c.inputLabel,children:"Variant"}),jsxRuntime.jsxs("select",{value:k.variant||"default",onChange:i=>b(u=>({...u,variant:i.target.value})),style:c.selectInput,children:[jsxRuntime.jsx("option",{value:"default",children:"Default"}),jsxRuntime.jsx("option",{value:"success",children:"Success"}),jsxRuntime.jsx("option",{value:"error",children:"Error"}),jsxRuntime.jsx("option",{value:"warning",children:"Warning"}),jsxRuntime.jsx("option",{value:"info",children:"Info"}),jsxRuntime.jsx("option",{value:"loading",children:"Loading"})]})]}),jsxRuntime.jsxs("div",{style:c.inputGroup,children:[jsxRuntime.jsx("label",{style:c.inputLabel,children:"Position"}),jsxRuntime.jsxs("select",{value:k.position||"top-right",onChange:i=>b(u=>({...u,position:i.target.value})),style:c.selectInput,children:[jsxRuntime.jsx("option",{value:"top-left",children:"Top Left"}),jsxRuntime.jsx("option",{value:"top-center",children:"Top Center"}),jsxRuntime.jsx("option",{value:"top-right",children:"Top Right"}),jsxRuntime.jsx("option",{value:"bottom-left",children:"Bottom Left"}),jsxRuntime.jsx("option",{value:"bottom-center",children:"Bottom Center"}),jsxRuntime.jsx("option",{value:"bottom-right",children:"Bottom Right"})]})]})]}),jsxRuntime.jsxs("div",{style:c.formGrid,children:[jsxRuntime.jsxs("div",{style:c.inputGroup,children:[jsxRuntime.jsx("label",{style:c.inputLabel,children:"Animation"}),jsxRuntime.jsxs("select",{value:k.animation||"slide",onChange:i=>b(u=>({...u,animation:i.target.value})),style:c.selectInput,children:[jsxRuntime.jsx("option",{value:"slide",children:"Slide"}),jsxRuntime.jsx("option",{value:"fade",children:"Fade"}),jsxRuntime.jsx("option",{value:"bounce",children:"Bounce"}),jsxRuntime.jsx("option",{value:"flip",children:"Flip"}),jsxRuntime.jsx("option",{value:"zoom",children:"Zoom"}),jsxRuntime.jsx("option",{value:"elastic",children:"Elastic"}),jsxRuntime.jsx("option",{value:"none",children:"None"})]})]}),jsxRuntime.jsxs("div",{style:c.inputGroup,children:[jsxRuntime.jsx("label",{style:c.inputLabel,children:"Style"}),jsxRuntime.jsxs("select",{value:k.visualStyle||"solid",onChange:i=>b(u=>({...u,visualStyle:i.target.value})),style:c.selectInput,children:[jsxRuntime.jsx("option",{value:"solid",children:"Solid"}),jsxRuntime.jsx("option",{value:"minimal",children:"Minimal"}),jsxRuntime.jsx("option",{value:"outlined",children:"Outlined"}),jsxRuntime.jsx("option",{value:"glass",children:"Glass"}),jsxRuntime.jsx("option",{value:"gradient",children:"Gradient"}),jsxRuntime.jsx("option",{value:"shimmer",children:"Shimmer"}),jsxRuntime.jsx("option",{value:"pill",children:"Pill"}),jsxRuntime.jsx("option",{value:"neon",children:"Neon"}),jsxRuntime.jsx("option",{value:"retro",children:"Retro"}),jsxRuntime.jsx("option",{value:"confetti",children:"Confetti"})]})]})]}),jsxRuntime.jsxs("div",{style:c.inputGroup,children:[jsxRuntime.jsx("label",{style:c.inputLabel,children:"Duration (ms)"}),jsxRuntime.jsx("input",{type:"number",value:k.duration||4e3,onChange:i=>b(u=>({...u,duration:parseInt(i.target.value)})),style:c.textInput})]}),jsxRuntime.jsx("button",{onClick:B,style:c.createButton,children:"Create Toast"})]})]}),o==="settings"&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{style:c.sectionTitle,children:"Global Settings"}),jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[jsxRuntime.jsxs("div",{style:c.inputGroup,children:[jsxRuntime.jsx("label",{style:c.inputLabel,children:"Theme"}),jsxRuntime.jsxs("select",{value:g,onChange:i=>E(i.target.value),style:c.selectInput,children:[jsxRuntime.jsx("option",{value:"light",children:"Light"}),jsxRuntime.jsx("option",{value:"dark",children:"Dark"}),jsxRuntime.jsx("option",{value:"system",children:"System"})]}),jsxRuntime.jsxs("div",{style:{fontSize:"11px",color:a==="dark"?"#64748b":"#94a3b8",marginTop:"4px"},children:["Current: ",a]})]}),jsxRuntime.jsxs("div",{style:c.inputGroup,children:[jsxRuntime.jsx("label",{style:c.inputLabel,children:"Max Toasts"}),jsxRuntime.jsx("input",{type:"number",value:p,onChange:i=>h(parseInt(i.target.value)),min:"1",max:"10",style:c.textInput})]}),jsxRuntime.jsxs("div",{style:{marginTop:"16px",paddingTop:"16px",borderTop:`1px solid ${a==="dark"?"#374151":"#e5e7eb"}`},children:[jsxRuntime.jsx("h4",{style:{...c.sectionTitle,fontSize:"13px"},children:"Keyboard Shortcuts"}),jsxRuntime.jsx("div",{style:{fontSize:"12px",background:a==="dark"?"#1f2937":"#f1f5f9",padding:"8px",borderRadius:"4px",marginTop:"8px"},children:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("strong",{children:"Alt + Shift + D"}),": Toggle DevTools"]})})]}),jsxRuntime.jsxs("div",{style:{marginTop:"8px",paddingTop:"16px",borderTop:`1px solid ${a==="dark"?"#374151":"#e5e7eb"}`},children:[jsxRuntime.jsx("h4",{style:{...c.sectionTitle,fontSize:"13px"},children:"Plugin Info"}),m.length===0?jsxRuntime.jsx("div",{style:{fontSize:"12px",color:a==="dark"?"#9ca3af":"#64748b"},children:"No plugins registered"}):jsxRuntime.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:m.map(i=>jsxRuntime.jsxs("div",{style:{fontSize:"12px",background:a==="dark"?"#1f2937":"#f1f5f9",padding:"8px",borderRadius:"4px"},children:[jsxRuntime.jsx("div",{style:{fontWeight:500},children:i.name}),jsxRuntime.jsx("div",{style:{color:a==="dark"?"#9ca3af":"#64748b"},children:i.description})]},i.name))})]})]})]})]})]})]})]})},ue=Ct;});L();L();L();var{useEffect:X,useState:W,memo:_,useRef:N,useCallback:j,useMemo:z}=rt__namespace,ne=(()=>{let t=null,e=0;return ()=>{let o=Date.now();if(t!==null&&o-e<5e3)return t;let s=9e3;if(typeof window<"u")try{let n=document.getElementsByTagName("*");for(let d=0;d<n.length;d++){let r=parseInt(window.getComputedStyle(n[d]).zIndex,10);r&&r>s&&(s=r);}}catch{}return t=s+1,e=o,t}})(),gt={mobile:640,tablet:1024},re={mobile:320,tablet:360,desktop:380},Tt=_(({svgString:t,className:e=""})=>{let o=z(()=>({__html:t}),[t]);return jsxRuntime.jsx("div",{className:e,dangerouslySetInnerHTML:o})});Tt.displayName="SVGIcon";var vt=_(({toasts:t})=>{let[e,o]=W(""),s=N(""),n=N(null);return X(()=>{if(t.length===0)return;let d=t[0];if(d.id===n.current)return;let r=d.variant?`${d.variant} notification: `:"";d.title&&(r+=d.title+(d.description?". ":"")),d.description&&(r+=d.description),r&&r!==s.current&&(s.current=r,n.current=d.id,o(r),setTimeout(()=>o(""),1e3));},[t]),e?jsxRuntime.jsx("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",role:"status",children:e}):null});vt.displayName="AccessibilityAnnouncer";var ae=(t,e,o=100)=>{let s=N(0),n=N(0),d=N(false),r=j(p=>{t&&(s.current=p.touches[0].clientX,n.current=p.touches[0].clientY,d.current=false);},[t]),g=j(p=>{if(!t)return;let f=Math.abs(p.touches[0].clientX-s.current),T=Math.abs(p.touches[0].clientY-n.current);f>T&&f>10&&(d.current=true,p.preventDefault());},[t]),a=j(p=>{!t||!d.current||(Math.abs(p.changedTouches[0].clientX-s.current)>o&&e(),d.current=false);},[t,e,o]);return {handleTouchStart:r,handleTouchMove:g,handleTouchEnd:a}},ht=_(({duration:t,isPaused:e,progressBarStyle:o,progressBarColor:s,progressBarThickness:n,progressBarPosition:d,progressAnimation:r})=>{let g=framerMotion.useAnimation(),a=N(0),p=N(null),f=N(Date.now()),T=r||"linear",m=d==="left"||d==="right";X(()=>{f.current=Date.now(),m?g.start({scaleY:0,transition:{duration:t/1e3,ease:T}}):g.start({scaleX:0,transition:{duration:t/1e3,ease:T}});},[]),X(()=>{if(e)g.stop(),p.current=Date.now();else if(p.current!==null){a.current+=Date.now()-p.current,p.current=null;let A=Date.now()-f.current-a.current,O=Math.max(0,t/1e3-A/1e3);m?g.start({scaleY:0,transition:{duration:O,ease:"linear"}}):g.start({scaleX:0,transition:{duration:O,ease:"linear"}});}},[e]);let w=`react-toast-progress${o?` ${o}`:""}`;return jsxRuntime.jsx("div",{className:w,children:jsxRuntime.jsx(framerMotion.motion.div,{animate:g,initial:m?{scaleY:1}:{scaleX:1},className:"react-toast-progress-fill",style:{backgroundColor:s||void 0,transformOrigin:m?"top center":"left center",...m?{width:n?`${n}px`:void 0}:{height:n?`${n}px`:void 0}}})})});ht.displayName="ProgressBar";var bt=_(({toast:t,onDismiss:e,onPause:o,onResume:s,animation:n,position:d,toastTheme:r,defaultStyle:g})=>{let a=N(null),p=exports.useToastStore(b=>b.pausedToasts.has(t.id)),f=j(()=>e(t.id),[e,t.id]),T=j(()=>{t.pauseOnHover&&o(t.id);},[o,t.id,t.pauseOnHover]),m=j(()=>s(t.id),[s,t.id]),w=j(b=>{if(t.rippleEffect&&a.current){let x=a.current.getBoundingClientRect(),R=document.createElement("div");R.className="toast-ripple-element",R.style.left=`${b.clientX-x.left}px`,R.style.top=`${b.clientY-x.top}px`,a.current.appendChild(R),setTimeout(()=>{a.current?.contains(R)&&a.current.removeChild(R);},700);}t.dismissOnClick&&f();},[t.rippleEffect,t.dismissOnClick,f]),A=z(()=>{if((t.visualStyle||g)!=="gradient")return {};let x=r==="dark",R={success:[x?"rgba(5,95,70,.9)":"rgba(16,185,129,.8)",x?"rgba(4,120,87,.8)":"rgba(5,150,105,.7)"],error:[x?"rgba(153,27,27,.9)":"rgba(239,68,68,.8)",x?"rgba(185,28,28,.8)":"rgba(220,38,38,.7)"],warning:[x?"rgba(146,64,14,.9)":"rgba(245,158,11,.8)",x?"rgba(180,83,9,.8)":"rgba(217,119,6,.7)"],info:[x?"rgba(30,64,175,.9)":"rgba(59,130,246,.8)",x?"rgba(29,78,216,.8)":"rgba(37,99,235,.7)"]},[B,I]=R[t.variant]??[x?"rgba(55,65,81,.9)":"rgba(229,231,235,.8)",x?"rgba(75,85,99,.8)":"rgba(209,213,219,.7)"];return {"--toast-gradient-from":B,"--toast-gradient-to":I}},[t.variant,t.visualStyle,r,g]),O=z(()=>{if(t.customAnimation)return {initial:t.customAnimation.initial,animate:t.customAnimation.animate,exit:t.customAnimation.exit};let b=t.animation||n,x=t.position||d,R=x.startsWith("top"),B=x.endsWith("left"),I=x.endsWith("right");if(b==="none")return {initial:{opacity:1},animate:{opacity:1},exit:{opacity:1}};if(b==="fade")return {initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}};if(b==="bounce"){let u={opacity:0,scale:.9};return R?Object.assign(u,{y:-80}):B?Object.assign(u,{x:-80}):I?Object.assign(u,{x:80}):Object.assign(u,{y:80}),{initial:u,animate:{opacity:1,y:0,x:0,scale:1,transition:{type:"spring",stiffness:350,damping:25}},exit:{opacity:0,scale:.9,transition:{duration:.2}}}}if(b==="flip")return {initial:{opacity:0,rotateX:90,perspective:400},animate:{opacity:1,rotateX:0,perspective:400,transition:{type:"spring",stiffness:300,damping:25}},exit:{opacity:0,rotateX:90,perspective:400,transition:{duration:.3}}};if(b==="zoom")return {initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1,transition:{type:"spring",stiffness:400,damping:30}},exit:{opacity:0,scale:.5,transition:{duration:.2}}};if(b==="elastic"){let u={opacity:0,scale:.8};return R?Object.assign(u,{y:-30}):B?Object.assign(u,{x:-30}):I?Object.assign(u,{x:30}):Object.assign(u,{y:30}),{initial:u,animate:{opacity:1,y:0,x:0,scale:1,transition:{type:"spring",stiffness:500,damping:20,mass:.8}},exit:{opacity:0,scale:.85,transition:{type:"spring",stiffness:600,damping:35}}}}let c={opacity:0},i={opacity:0};return R?(Object.assign(c,{y:-20}),Object.assign(i,{y:-20})):B?(Object.assign(c,{x:-20}),Object.assign(i,{x:-20})):I?(Object.assign(c,{x:20}),Object.assign(i,{x:20})):(Object.assign(c,{y:20}),Object.assign(i,{y:20})),{initial:c,animate:{opacity:1,y:0,x:0},exit:i}},[t.customAnimation,t.animation,n,t.position,d]),M=z(()=>{let b=[];t.floating&&b.push("react-toast-floating"),t.rippleEffect&&b.push("toast-ripple");let x=t.visualStyle||g;return (x==="glass"||x==="gradient")&&b.push("toast-soft-shadow"),b.join(" ")},[t.floating,t.rippleEffect,t.visualStyle,g]),E=z(()=>t.variant==="custom"?"":!t.variant||t.variant==="default"?r==="dark"?"text-gray-300":"text-gray-500":"text-white",[t.variant,r]),h=z(()=>t.progressBarStyle?t.progressBarStyle:t.variant==="custom"?"bg-white/20":!t.variant||t.variant==="default"?r==="dark"?"bg-gray-600":"bg-gray-300":"bg-white/30",[t.progressBarStyle,t.variant,r]),k=ae(t.swipeToDismiss||false,f);return jsxRuntime.jsx(framerMotion.motion.div,{className:"react-toast-item w-full",initial:O.initial,animate:O.animate,exit:O.exit,transition:{duration:t.updating?.1:.2},layout:true,children:jsxRuntime.jsxs("div",{ref:a,role:t.variant==="error"?"alert":"status","aria-live":t.variant==="error"?"assertive":"polite",className:`relative overflow-hidden shadow-lg rounded-lg react-toast w-full ${t.className||""} ${M}`,style:{...t.style||{},...A},onMouseEnter:T,onMouseLeave:m,onClick:w,onTouchStart:k.handleTouchStart,onTouchMove:k.handleTouchMove,onTouchEnd:k.handleTouchEnd,"data-variant":t.variant,"data-theme":r,"data-style":t.visualStyle||g,"data-progress-position":t.progressBarPosition||"bottom","data-testid":`toast-${t.id}`,tabIndex:0,children:[t.duration>0&&jsxRuntime.jsx(ht,{duration:t.duration,isPaused:p,progressBarStyle:h,progressBarColor:t.progressBarColor,progressBarThickness:t.progressBarThickness,progressBarPosition:t.progressBarPosition,progressAnimation:t.progressAnimation}),jsxRuntime.jsx("div",{className:"p-4 toast-content",children:t.variant==="custom"&&t.component?t.component:jsxRuntime.jsxs("div",{className:"flex items-start",children:[t.emoji?jsxRuntime.jsx("div",{className:"flex-shrink-0 mr-3 toast-emoji",children:t.emoji}):t.icon?jsxRuntime.jsx("div",{className:`flex-shrink-0 mr-3 ${E} toast-icon-container toast-icon-animated`,children:t.icon}):t.iconString?jsxRuntime.jsx("div",{className:`flex-shrink-0 mr-3 ${E} toast-icon-container toast-icon-animated`,children:jsxRuntime.jsx(Tt,{svgString:t.iconString,className:E})}):null,jsxRuntime.jsxs("div",{className:"flex-1",children:[t.title&&jsxRuntime.jsx("h4",{className:"font-medium mb-1",children:t.title}),t.description&&jsxRuntime.jsx("div",{className:"toast-description",children:t.description}),t.actions&&t.actions.length>0&&jsxRuntime.jsx("div",{className:"toast-actions",children:t.actions.map((b,x)=>jsxRuntime.jsx("button",{"data-variant":b.variant||"primary",className:"toast-action-btn",onClick:R=>{R.stopPropagation(),b.onClick(t.id),b.closeOnClick!==false&&e(t.id);},children:b.label},x))})]}),t.dismissible&&jsxRuntime.jsx("button",{onClick:b=>{b.stopPropagation(),f();},className:"react-toast-close","aria-label":"Close notification","data-dismiss":"toast",children:jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})})]})},t.id)});bt.displayName="ToastItem";var yt=_(({position:t,toasts:e,positionStyle:o,onDismiss:s,onPause:n,onResume:d,defaultAnimation:r,toastTheme:g,defaultStyle:a,containerClassName:p})=>jsxRuntime.jsx("div",{className:`fixed flex flex-col z-50 react-toast-container ${p||""}`,"data-position":t,"data-theme":g,style:o,children:jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"sync",children:e.map(f=>jsxRuntime.jsx(bt,{toast:f,onDismiss:s,onPause:n,onResume:d,animation:f.animation||r,position:t,toastTheme:g,defaultStyle:a},f.id))})}));yt.displayName="ToastContainer";var St=({containerClassName:t="",topOffset:e=16,bottomOffset:o=16,leftOffset:s=16,rightOffset:n=16,defaultAnimation:d="slide",defaultStyle:r="solid",enableAccessibleAnnouncements:g=true,suppressHydrationWarning:a=false})=>{let[p,f]=W(false),[T,m]=W(null),[w,A]=W("desktop"),O=N(1024),M=exports.useToastStore(i=>i.toasts),E=exports.useToastStore(i=>i.removeToast),h=exports.useToastStore(i=>i.pauseToast),k=exports.useToastStore(i=>i.resumeToast),b=exports.useToastStore(i=>i.effectiveTheme),x=j(()=>{if(typeof window>"u")return;let i=window.innerWidth;O.current=i;let u=i<gt.mobile?"mobile":i<gt.tablet?"tablet":"desktop";A(S=>S!==u?u:S);},[]);X(()=>{if(typeof window>"u")return;x(),f(true);let i=document.getElementById("react-toast-kit-portal");i||(i=document.createElement("div"),i.id="react-toast-kit-portal",i.style.cssText=`position:fixed;top:0;left:0;width:0;height:0;z-index:${ne()}`,a&&i.setAttribute("data-suppress-hydration-warning","true"),document.body.appendChild(i)),m(i);let u,S=()=>{clearTimeout(u),u=window.setTimeout(x,100);};return window.addEventListener("resize",S),()=>{window.removeEventListener("resize",S),clearTimeout(u),i?.parentNode&&!document.getElementById("react-toast-kit-portal-static")&&document.body.removeChild(i);}},[x,a]);let R=j(()=>re[w],[w]),B=j(i=>{let u=R(),S={position:"fixed",width:`${u}px`,display:"flex",flexDirection:"column",gap:"0.5rem"};if(w==="mobile"){let D=Math.min(u,O.current-s-n);S.width=`${D}px`,S.maxWidth=`calc(100vw - ${s+n}px)`;}switch(i){case "top-left":return {...S,top:`${e}px`,left:`${s}px`,alignItems:"flex-start"};case "top-center":return {...S,top:`${e}px`,left:"50%",transform:"translateX(-50%)",alignItems:"center"};case "top-right":return {...S,top:`${e}px`,right:`${n}px`,alignItems:"flex-end"};case "bottom-left":return {...S,bottom:`${o}px`,left:`${s}px`,alignItems:"flex-start"};case "bottom-center":return {...S,bottom:`${o}px`,left:"50%",transform:"translateX(-50%)",alignItems:"center"};case "bottom-right":return {...S,bottom:`${o}px`,right:`${n}px`,alignItems:"flex-end"};default:return {...S,top:`${e}px`,right:`${n}px`,alignItems:"flex-end"}}},[R,w,s,n,e,o]),I=z(()=>M.reduce((i,u)=>{let S=u.position||"top-right";return i[S]||(i[S]=[]),i[S].push(u),i},{}),[M]);if(!p||!T)return null;let c=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[g&&jsxRuntime.jsx(vt,{toasts:M}),Object.entries(I).map(([i,u])=>jsxRuntime.jsx(yt,{position:i,toasts:u,positionStyle:B(i),onDismiss:E,onPause:h,onResume:k,defaultAnimation:d,toastTheme:b,defaultStyle:r,containerClassName:t},i))]});return reactDom.createPortal(a?jsxRuntime.jsx("div",{suppressHydrationWarning:true,children:c}):c,T)};St.displayName="ToastPortal";var xt=_(St);var {createContext:ge,useContext:fe,useEffect:Y,useMemo:At}=rt__namespace,Mt=ge(null),Te=({children:t,theme:e="system",position:o="top-right",maxToasts:s=3,defaultAnimation:n="slide",defaultStyle:d="solid",defaultDuration:r=4e3,defaultDismissible:g=true,defaultPauseOnHover:a=true,defaultDismissOnClick:p=false,defaultProgressBarStyle:f,defaultProgressBarColor:T,defaultProgressBarPosition:m="bottom",defaultProgressBarThickness:w=3,defaultProgressAnimation:A="linear",defaultFloating:O=false,defaultRippleEffect:M=false,defaultSwipeToDismiss:E=false,defaultPriority:h="normal",defaultStagger:k=0,containerClassName:b,topOffset:x,bottomOffset:R,leftOffset:B,rightOffset:I,enableAccessibleAnnouncements:c=true,enableDevMode:i=false,enableDevTools:u=false,suppressHydrationWarning:S=false,globalClassName:D,globalStyle:H})=>{let{setTheme:Q,setMaxToasts:tt,setConfig:et,effectiveTheme:ot}=exports.useToastStore();Y(()=>{Q(e);},[e,Q]),Y(()=>{tt(s);},[s,tt]),Y(()=>{et({defaultDuration:r,defaultDismissible:g,defaultPauseOnHover:a,defaultDismissOnClick:p,defaultAnimation:n,defaultStyle:d,defaultProgressBarStyle:f,defaultProgressBarColor:T,defaultProgressBarPosition:m,defaultProgressBarThickness:w,defaultProgressAnimation:A,defaultFloating:O,defaultRippleEffect:M,defaultSwipeToDismiss:E,defaultPriority:h,defaultStagger:k,globalClassName:D,globalStyle:H});},[et,r,g,a,p,n,d,f,T,m,w,A,O,M,E,h,k,D,H]),Y(()=>(i&&typeof window<"u"&&process.env.NODE_ENV==="development"&&(window.__TOAST_DEV_MODE__=true),()=>{typeof window<"u"&&delete window.__TOAST_DEV_MODE__;}),[i]);let zt=At(()=>({theme:e,effectiveTheme:ot,position:o,maxToasts:s,defaultAnimation:n,defaultStyle:d,defaultDuration:r,defaultDismissible:g,defaultPauseOnHover:a,defaultDismissOnClick:p,defaultProgressBarStyle:f,defaultProgressBarColor:T,defaultProgressBarPosition:m,defaultProgressBarThickness:w,defaultProgressAnimation:A,defaultFloating:O,defaultRippleEffect:M,defaultSwipeToDismiss:E,defaultPriority:h,defaultStagger:k,globalClassName:D,globalStyle:H}),[e,ot,o,s,n,d,r,g,a,p,f,T,m,w,A,O,M,E,h,k,D,H]),it=At(()=>{if(!u||process.env.NODE_ENV!=="development")return null;let{ToastDevTools:_t}=(Rt(),Ft(Pt));return _t},[u]);return jsxRuntime.jsxs(Mt.Provider,{value:zt,children:[t