react-toast-master 2.2.9 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1399 @@
1
+ import Oe, { useContext as Xe, createContext as Ze, forwardRef as Qe, createElement as Re, useState as Tr, useRef as Ce, useEffect as Ee, useCallback as z } from "react";
2
+ var Se = { exports: {} }, oe = {};
3
+ /**
4
+ * @license React
5
+ * react-jsx-runtime.production.min.js
6
+ *
7
+ * Copyright (c) Facebook, Inc. and its affiliates.
8
+ *
9
+ * This source code is licensed under the MIT license found in the
10
+ * LICENSE file in the root directory of this source tree.
11
+ */
12
+ var qe;
13
+ function Rr() {
14
+ if (qe) return oe;
15
+ qe = 1;
16
+ var r = Oe, s = Symbol.for("react.element"), d = Symbol.for("react.fragment"), l = Object.prototype.hasOwnProperty, C = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, x = { key: !0, ref: !0, __self: !0, __source: !0 };
17
+ function j(p, i, w) {
18
+ var h, T = {}, D = null, M = null;
19
+ w !== void 0 && (D = "" + w), i.key !== void 0 && (D = "" + i.key), i.ref !== void 0 && (M = i.ref);
20
+ for (h in i) l.call(i, h) && !x.hasOwnProperty(h) && (T[h] = i[h]);
21
+ if (p && p.defaultProps) for (h in i = p.defaultProps, i) T[h] === void 0 && (T[h] = i[h]);
22
+ return { $$typeof: s, type: p, key: D, ref: M, props: T, _owner: C.current };
23
+ }
24
+ return oe.Fragment = d, oe.jsx = j, oe.jsxs = j, oe;
25
+ }
26
+ var se = {};
27
+ /**
28
+ * @license React
29
+ * react-jsx-runtime.development.js
30
+ *
31
+ * Copyright (c) Facebook, Inc. and its affiliates.
32
+ *
33
+ * This source code is licensed under the MIT license found in the
34
+ * LICENSE file in the root directory of this source tree.
35
+ */
36
+ var Ge;
37
+ function Sr() {
38
+ return Ge || (Ge = 1, process.env.NODE_ENV !== "production" && function() {
39
+ var r = Oe, s = Symbol.for("react.element"), d = Symbol.for("react.portal"), l = Symbol.for("react.fragment"), C = Symbol.for("react.strict_mode"), x = Symbol.for("react.profiler"), j = Symbol.for("react.provider"), p = Symbol.for("react.context"), i = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), h = Symbol.for("react.suspense_list"), T = Symbol.for("react.memo"), D = Symbol.for("react.lazy"), M = Symbol.for("react.offscreen"), o = Symbol.iterator, m = "@@iterator";
40
+ function v(e) {
41
+ if (e === null || typeof e != "object")
42
+ return null;
43
+ var t = o && e[o] || e[m];
44
+ return typeof t == "function" ? t : null;
45
+ }
46
+ var R = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
47
+ function y(e) {
48
+ {
49
+ for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), c = 1; c < t; c++)
50
+ n[c - 1] = arguments[c];
51
+ N("error", e, n);
52
+ }
53
+ }
54
+ function N(e, t, n) {
55
+ {
56
+ var c = R.ReactDebugCurrentFrame, _ = c.getStackAddendum();
57
+ _ !== "" && (t += "%s", n = n.concat([_]));
58
+ var g = n.map(function(f) {
59
+ return String(f);
60
+ });
61
+ g.unshift("Warning: " + t), Function.prototype.apply.call(console[e], console, g);
62
+ }
63
+ }
64
+ var V = !1, q = !1, re = !1, te = !1, H = !1, U;
65
+ U = Symbol.for("react.module.reference");
66
+ function ge(e) {
67
+ return !!(typeof e == "string" || typeof e == "function" || e === l || e === x || H || e === C || e === w || e === h || te || e === M || V || q || re || typeof e == "object" && e !== null && (e.$$typeof === D || e.$$typeof === T || e.$$typeof === j || e.$$typeof === p || e.$$typeof === i || // This needs to include all possible module reference object
68
+ // types supported by any Flight configuration anywhere since
69
+ // we don't know which Flight build this will end up being used
70
+ // with.
71
+ e.$$typeof === U || e.getModuleId !== void 0));
72
+ }
73
+ function pe(e, t, n) {
74
+ var c = e.displayName;
75
+ if (c)
76
+ return c;
77
+ var _ = t.displayName || t.name || "";
78
+ return _ !== "" ? n + "(" + _ + ")" : n;
79
+ }
80
+ function ne(e) {
81
+ return e.displayName || "Context";
82
+ }
83
+ function B(e) {
84
+ if (e == null)
85
+ return null;
86
+ if (typeof e.tag == "number" && y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
87
+ return e.displayName || e.name || null;
88
+ if (typeof e == "string")
89
+ return e;
90
+ switch (e) {
91
+ case l:
92
+ return "Fragment";
93
+ case d:
94
+ return "Portal";
95
+ case x:
96
+ return "Profiler";
97
+ case C:
98
+ return "StrictMode";
99
+ case w:
100
+ return "Suspense";
101
+ case h:
102
+ return "SuspenseList";
103
+ }
104
+ if (typeof e == "object")
105
+ switch (e.$$typeof) {
106
+ case p:
107
+ var t = e;
108
+ return ne(t) + ".Consumer";
109
+ case j:
110
+ var n = e;
111
+ return ne(n._context) + ".Provider";
112
+ case i:
113
+ return pe(e, e.render, "ForwardRef");
114
+ case T:
115
+ var c = e.displayName || null;
116
+ return c !== null ? c : B(e.type) || "Memo";
117
+ case D: {
118
+ var _ = e, g = _._payload, f = _._init;
119
+ try {
120
+ return B(f(g));
121
+ } catch {
122
+ return null;
123
+ }
124
+ }
125
+ }
126
+ return null;
127
+ }
128
+ var S = Object.assign, G = 0, ie, ce, le, ue, de, fe, J;
129
+ function A() {
130
+ }
131
+ A.__reactDisabledLog = !0;
132
+ function Y() {
133
+ {
134
+ if (G === 0) {
135
+ ie = console.log, ce = console.info, le = console.warn, ue = console.error, de = console.group, fe = console.groupCollapsed, J = console.groupEnd;
136
+ var e = {
137
+ configurable: !0,
138
+ enumerable: !0,
139
+ value: A,
140
+ writable: !0
141
+ };
142
+ Object.defineProperties(console, {
143
+ info: e,
144
+ log: e,
145
+ warn: e,
146
+ error: e,
147
+ group: e,
148
+ groupCollapsed: e,
149
+ groupEnd: e
150
+ });
151
+ }
152
+ G++;
153
+ }
154
+ }
155
+ function W() {
156
+ {
157
+ if (G--, G === 0) {
158
+ var e = {
159
+ configurable: !0,
160
+ enumerable: !0,
161
+ writable: !0
162
+ };
163
+ Object.defineProperties(console, {
164
+ log: S({}, e, {
165
+ value: ie
166
+ }),
167
+ info: S({}, e, {
168
+ value: ce
169
+ }),
170
+ warn: S({}, e, {
171
+ value: le
172
+ }),
173
+ error: S({}, e, {
174
+ value: ue
175
+ }),
176
+ group: S({}, e, {
177
+ value: de
178
+ }),
179
+ groupCollapsed: S({}, e, {
180
+ value: fe
181
+ }),
182
+ groupEnd: S({}, e, {
183
+ value: J
184
+ })
185
+ });
186
+ }
187
+ G < 0 && y("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
188
+ }
189
+ }
190
+ var O = R.ReactCurrentDispatcher, L;
191
+ function X(e, t, n) {
192
+ {
193
+ if (L === void 0)
194
+ try {
195
+ throw Error();
196
+ } catch (_) {
197
+ var c = _.stack.trim().match(/\n( *(at )?)/);
198
+ L = c && c[1] || "";
199
+ }
200
+ return `
201
+ ` + L + e;
202
+ }
203
+ }
204
+ var ve = !1, _e;
205
+ {
206
+ var tr = typeof WeakMap == "function" ? WeakMap : Map;
207
+ _e = new tr();
208
+ }
209
+ function $e(e, t) {
210
+ if (!e || ve)
211
+ return "";
212
+ {
213
+ var n = _e.get(e);
214
+ if (n !== void 0)
215
+ return n;
216
+ }
217
+ var c;
218
+ ve = !0;
219
+ var _ = Error.prepareStackTrace;
220
+ Error.prepareStackTrace = void 0;
221
+ var g;
222
+ g = O.current, O.current = null, Y();
223
+ try {
224
+ if (t) {
225
+ var f = function() {
226
+ throw Error();
227
+ };
228
+ if (Object.defineProperty(f.prototype, "props", {
229
+ set: function() {
230
+ throw Error();
231
+ }
232
+ }), typeof Reflect == "object" && Reflect.construct) {
233
+ try {
234
+ Reflect.construct(f, []);
235
+ } catch (F) {
236
+ c = F;
237
+ }
238
+ Reflect.construct(e, [], f);
239
+ } else {
240
+ try {
241
+ f.call();
242
+ } catch (F) {
243
+ c = F;
244
+ }
245
+ e.call(f.prototype);
246
+ }
247
+ } else {
248
+ try {
249
+ throw Error();
250
+ } catch (F) {
251
+ c = F;
252
+ }
253
+ e();
254
+ }
255
+ } catch (F) {
256
+ if (F && c && typeof F.stack == "string") {
257
+ for (var u = F.stack.split(`
258
+ `), $ = c.stack.split(`
259
+ `), b = u.length - 1, k = $.length - 1; b >= 1 && k >= 0 && u[b] !== $[k]; )
260
+ k--;
261
+ for (; b >= 1 && k >= 0; b--, k--)
262
+ if (u[b] !== $[k]) {
263
+ if (b !== 1 || k !== 1)
264
+ do
265
+ if (b--, k--, k < 0 || u[b] !== $[k]) {
266
+ var I = `
267
+ ` + u[b].replace(" at new ", " at ");
268
+ return e.displayName && I.includes("<anonymous>") && (I = I.replace("<anonymous>", e.displayName)), typeof e == "function" && _e.set(e, I), I;
269
+ }
270
+ while (b >= 1 && k >= 0);
271
+ break;
272
+ }
273
+ }
274
+ } finally {
275
+ ve = !1, O.current = g, W(), Error.prepareStackTrace = _;
276
+ }
277
+ var Q = e ? e.displayName || e.name : "", K = Q ? X(Q) : "";
278
+ return typeof e == "function" && _e.set(e, K), K;
279
+ }
280
+ function nr(e, t, n) {
281
+ return $e(e, !1);
282
+ }
283
+ function ar(e) {
284
+ var t = e.prototype;
285
+ return !!(t && t.isReactComponent);
286
+ }
287
+ function he(e, t, n) {
288
+ if (e == null)
289
+ return "";
290
+ if (typeof e == "function")
291
+ return $e(e, ar(e));
292
+ if (typeof e == "string")
293
+ return X(e);
294
+ switch (e) {
295
+ case w:
296
+ return X("Suspense");
297
+ case h:
298
+ return X("SuspenseList");
299
+ }
300
+ if (typeof e == "object")
301
+ switch (e.$$typeof) {
302
+ case i:
303
+ return nr(e.render);
304
+ case T:
305
+ return he(e.type, t, n);
306
+ case D: {
307
+ var c = e, _ = c._payload, g = c._init;
308
+ try {
309
+ return he(g(_), t, n);
310
+ } catch {
311
+ }
312
+ }
313
+ }
314
+ return "";
315
+ }
316
+ var ae = Object.prototype.hasOwnProperty, Pe = {}, De = R.ReactDebugCurrentFrame;
317
+ function me(e) {
318
+ if (e) {
319
+ var t = e._owner, n = he(e.type, e._source, t ? t.type : null);
320
+ De.setExtraStackFrame(n);
321
+ } else
322
+ De.setExtraStackFrame(null);
323
+ }
324
+ function or(e, t, n, c, _) {
325
+ {
326
+ var g = Function.call.bind(ae);
327
+ for (var f in e)
328
+ if (g(e, f)) {
329
+ var u = void 0;
330
+ try {
331
+ if (typeof e[f] != "function") {
332
+ var $ = Error((c || "React class") + ": " + n + " type `" + f + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[f] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
333
+ throw $.name = "Invariant Violation", $;
334
+ }
335
+ u = e[f](t, f, c, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
336
+ } catch (b) {
337
+ u = b;
338
+ }
339
+ u && !(u instanceof Error) && (me(_), y("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", c || "React class", n, f, typeof u), me(null)), u instanceof Error && !(u.message in Pe) && (Pe[u.message] = !0, me(_), y("Failed %s type: %s", n, u.message), me(null));
340
+ }
341
+ }
342
+ }
343
+ var sr = Array.isArray;
344
+ function ye(e) {
345
+ return sr(e);
346
+ }
347
+ function ir(e) {
348
+ {
349
+ var t = typeof Symbol == "function" && Symbol.toStringTag, n = t && e[Symbol.toStringTag] || e.constructor.name || "Object";
350
+ return n;
351
+ }
352
+ }
353
+ function cr(e) {
354
+ try {
355
+ return Fe(e), !1;
356
+ } catch {
357
+ return !0;
358
+ }
359
+ }
360
+ function Fe(e) {
361
+ return "" + e;
362
+ }
363
+ function Ae(e) {
364
+ if (cr(e))
365
+ return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ir(e)), Fe(e);
366
+ }
367
+ var Ne = R.ReactCurrentOwner, lr = {
368
+ key: !0,
369
+ ref: !0,
370
+ __self: !0,
371
+ __source: !0
372
+ }, Ie, Me;
373
+ function ur(e) {
374
+ if (ae.call(e, "ref")) {
375
+ var t = Object.getOwnPropertyDescriptor(e, "ref").get;
376
+ if (t && t.isReactWarning)
377
+ return !1;
378
+ }
379
+ return e.ref !== void 0;
380
+ }
381
+ function dr(e) {
382
+ if (ae.call(e, "key")) {
383
+ var t = Object.getOwnPropertyDescriptor(e, "key").get;
384
+ if (t && t.isReactWarning)
385
+ return !1;
386
+ }
387
+ return e.key !== void 0;
388
+ }
389
+ function fr(e, t) {
390
+ typeof e.ref == "string" && Ne.current;
391
+ }
392
+ function _r(e, t) {
393
+ {
394
+ var n = function() {
395
+ Ie || (Ie = !0, y("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
396
+ };
397
+ n.isReactWarning = !0, Object.defineProperty(e, "key", {
398
+ get: n,
399
+ configurable: !0
400
+ });
401
+ }
402
+ }
403
+ function hr(e, t) {
404
+ {
405
+ var n = function() {
406
+ Me || (Me = !0, y("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
407
+ };
408
+ n.isReactWarning = !0, Object.defineProperty(e, "ref", {
409
+ get: n,
410
+ configurable: !0
411
+ });
412
+ }
413
+ }
414
+ var mr = function(e, t, n, c, _, g, f) {
415
+ var u = {
416
+ // This tag allows us to uniquely identify this as a React Element
417
+ $$typeof: s,
418
+ // Built-in properties that belong on the element
419
+ type: e,
420
+ key: t,
421
+ ref: n,
422
+ props: f,
423
+ // Record the component responsible for creating this element.
424
+ _owner: g
425
+ };
426
+ return u._store = {}, Object.defineProperty(u._store, "validated", {
427
+ configurable: !1,
428
+ enumerable: !1,
429
+ writable: !0,
430
+ value: !1
431
+ }), Object.defineProperty(u, "_self", {
432
+ configurable: !1,
433
+ enumerable: !1,
434
+ writable: !1,
435
+ value: c
436
+ }), Object.defineProperty(u, "_source", {
437
+ configurable: !1,
438
+ enumerable: !1,
439
+ writable: !1,
440
+ value: _
441
+ }), Object.freeze && (Object.freeze(u.props), Object.freeze(u)), u;
442
+ };
443
+ function gr(e, t, n, c, _) {
444
+ {
445
+ var g, f = {}, u = null, $ = null;
446
+ n !== void 0 && (Ae(n), u = "" + n), dr(t) && (Ae(t.key), u = "" + t.key), ur(t) && ($ = t.ref, fr(t, _));
447
+ for (g in t)
448
+ ae.call(t, g) && !lr.hasOwnProperty(g) && (f[g] = t[g]);
449
+ if (e && e.defaultProps) {
450
+ var b = e.defaultProps;
451
+ for (g in b)
452
+ f[g] === void 0 && (f[g] = b[g]);
453
+ }
454
+ if (u || $) {
455
+ var k = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
456
+ u && _r(f, k), $ && hr(f, k);
457
+ }
458
+ return mr(e, u, $, _, c, Ne.current, f);
459
+ }
460
+ }
461
+ var we = R.ReactCurrentOwner, We = R.ReactDebugCurrentFrame;
462
+ function Z(e) {
463
+ if (e) {
464
+ var t = e._owner, n = he(e.type, e._source, t ? t.type : null);
465
+ We.setExtraStackFrame(n);
466
+ } else
467
+ We.setExtraStackFrame(null);
468
+ }
469
+ var be;
470
+ be = !1;
471
+ function xe(e) {
472
+ return typeof e == "object" && e !== null && e.$$typeof === s;
473
+ }
474
+ function Le() {
475
+ {
476
+ if (we.current) {
477
+ var e = B(we.current.type);
478
+ if (e)
479
+ return `
480
+
481
+ Check the render method of \`` + e + "`.";
482
+ }
483
+ return "";
484
+ }
485
+ }
486
+ function pr(e) {
487
+ return "";
488
+ }
489
+ var Be = {};
490
+ function vr(e) {
491
+ {
492
+ var t = Le();
493
+ if (!t) {
494
+ var n = typeof e == "string" ? e : e.displayName || e.name;
495
+ n && (t = `
496
+
497
+ Check the top-level render call using <` + n + ">.");
498
+ }
499
+ return t;
500
+ }
501
+ }
502
+ function Ye(e, t) {
503
+ {
504
+ if (!e._store || e._store.validated || e.key != null)
505
+ return;
506
+ e._store.validated = !0;
507
+ var n = vr(t);
508
+ if (Be[n])
509
+ return;
510
+ Be[n] = !0;
511
+ var c = "";
512
+ e && e._owner && e._owner !== we.current && (c = " It was passed a child from " + B(e._owner.type) + "."), Z(e), y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', n, c), Z(null);
513
+ }
514
+ }
515
+ function Ve(e, t) {
516
+ {
517
+ if (typeof e != "object")
518
+ return;
519
+ if (ye(e))
520
+ for (var n = 0; n < e.length; n++) {
521
+ var c = e[n];
522
+ xe(c) && Ye(c, t);
523
+ }
524
+ else if (xe(e))
525
+ e._store && (e._store.validated = !0);
526
+ else if (e) {
527
+ var _ = v(e);
528
+ if (typeof _ == "function" && _ !== e.entries)
529
+ for (var g = _.call(e), f; !(f = g.next()).done; )
530
+ xe(f.value) && Ye(f.value, t);
531
+ }
532
+ }
533
+ }
534
+ function yr(e) {
535
+ {
536
+ var t = e.type;
537
+ if (t == null || typeof t == "string")
538
+ return;
539
+ var n;
540
+ if (typeof t == "function")
541
+ n = t.propTypes;
542
+ else if (typeof t == "object" && (t.$$typeof === i || // Note: Memo only checks outer props here.
543
+ // Inner props are checked in the reconciler.
544
+ t.$$typeof === T))
545
+ n = t.propTypes;
546
+ else
547
+ return;
548
+ if (n) {
549
+ var c = B(t);
550
+ or(n, e.props, "prop", c, e);
551
+ } else if (t.PropTypes !== void 0 && !be) {
552
+ be = !0;
553
+ var _ = B(t);
554
+ y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _ || "Unknown");
555
+ }
556
+ typeof t.getDefaultProps == "function" && !t.getDefaultProps.isReactClassApproved && y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
557
+ }
558
+ }
559
+ function wr(e) {
560
+ {
561
+ for (var t = Object.keys(e.props), n = 0; n < t.length; n++) {
562
+ var c = t[n];
563
+ if (c !== "children" && c !== "key") {
564
+ Z(e), y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", c), Z(null);
565
+ break;
566
+ }
567
+ }
568
+ e.ref !== null && (Z(e), y("Invalid attribute `ref` supplied to `React.Fragment`."), Z(null));
569
+ }
570
+ }
571
+ var ze = {};
572
+ function Ue(e, t, n, c, _, g) {
573
+ {
574
+ var f = ge(e);
575
+ if (!f) {
576
+ var u = "";
577
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (u += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
578
+ var $ = pr();
579
+ $ ? u += $ : u += Le();
580
+ var b;
581
+ e === null ? b = "null" : ye(e) ? b = "array" : e !== void 0 && e.$$typeof === s ? (b = "<" + (B(e.type) || "Unknown") + " />", u = " Did you accidentally export a JSX literal instead of a component?") : b = typeof e, y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", b, u);
582
+ }
583
+ var k = gr(e, t, n, _, g);
584
+ if (k == null)
585
+ return k;
586
+ if (f) {
587
+ var I = t.children;
588
+ if (I !== void 0)
589
+ if (c)
590
+ if (ye(I)) {
591
+ for (var Q = 0; Q < I.length; Q++)
592
+ Ve(I[Q], e);
593
+ Object.freeze && Object.freeze(I);
594
+ } else
595
+ y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
596
+ else
597
+ Ve(I, e);
598
+ }
599
+ if (ae.call(t, "key")) {
600
+ var K = B(e), F = Object.keys(t).filter(function(jr) {
601
+ return jr !== "key";
602
+ }), ke = F.length > 0 ? "{key: someKey, " + F.join(": ..., ") + ": ...}" : "{key: someKey}";
603
+ if (!ze[K + ke]) {
604
+ var Er = F.length > 0 ? "{" + F.join(": ..., ") + ": ...}" : "{}";
605
+ y(`A props object containing a "key" prop is being spread into JSX:
606
+ let props = %s;
607
+ <%s {...props} />
608
+ React keys must be passed directly to JSX without using spread:
609
+ let props = %s;
610
+ <%s key={someKey} {...props} />`, ke, K, Er, K), ze[K + ke] = !0;
611
+ }
612
+ }
613
+ return e === l ? wr(k) : yr(k), k;
614
+ }
615
+ }
616
+ function br(e, t, n) {
617
+ return Ue(e, t, n, !0);
618
+ }
619
+ function xr(e, t, n) {
620
+ return Ue(e, t, n, !1);
621
+ }
622
+ var kr = xr, Cr = br;
623
+ se.Fragment = l, se.jsx = kr, se.jsxs = Cr;
624
+ }()), se;
625
+ }
626
+ process.env.NODE_ENV === "production" ? Se.exports = Rr() : Se.exports = Sr();
627
+ var a = Se.exports;
628
+ /**
629
+ * @license lucide-react v1.17.0 - ISC
630
+ *
631
+ * This source code is licensed under the ISC license.
632
+ * See the LICENSE file in the root directory of this source tree.
633
+ */
634
+ const er = (...r) => r.filter((s, d, l) => !!s && s.trim() !== "" && l.indexOf(s) === d).join(" ").trim();
635
+ /**
636
+ * @license lucide-react v1.17.0 - ISC
637
+ *
638
+ * This source code is licensed under the ISC license.
639
+ * See the LICENSE file in the root directory of this source tree.
640
+ */
641
+ const Or = (r) => r.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
642
+ /**
643
+ * @license lucide-react v1.17.0 - ISC
644
+ *
645
+ * This source code is licensed under the ISC license.
646
+ * See the LICENSE file in the root directory of this source tree.
647
+ */
648
+ const $r = (r) => r.replace(
649
+ /^([A-Z])|[\s-_]+(\w)/g,
650
+ (s, d, l) => l ? l.toUpperCase() : d.toLowerCase()
651
+ );
652
+ /**
653
+ * @license lucide-react v1.17.0 - ISC
654
+ *
655
+ * This source code is licensed under the ISC license.
656
+ * See the LICENSE file in the root directory of this source tree.
657
+ */
658
+ const Ke = (r) => {
659
+ const s = $r(r);
660
+ return s.charAt(0).toUpperCase() + s.slice(1);
661
+ };
662
+ /**
663
+ * @license lucide-react v1.17.0 - ISC
664
+ *
665
+ * This source code is licensed under the ISC license.
666
+ * See the LICENSE file in the root directory of this source tree.
667
+ */
668
+ var je = {
669
+ xmlns: "http://www.w3.org/2000/svg",
670
+ width: 24,
671
+ height: 24,
672
+ viewBox: "0 0 24 24",
673
+ fill: "none",
674
+ stroke: "currentColor",
675
+ strokeWidth: 2,
676
+ strokeLinecap: "round",
677
+ strokeLinejoin: "round"
678
+ };
679
+ /**
680
+ * @license lucide-react v1.17.0 - ISC
681
+ *
682
+ * This source code is licensed under the ISC license.
683
+ * See the LICENSE file in the root directory of this source tree.
684
+ */
685
+ const Pr = (r) => {
686
+ for (const s in r)
687
+ if (s.startsWith("aria-") || s === "role" || s === "title")
688
+ return !0;
689
+ return !1;
690
+ }, Dr = Ze({}), Fr = () => Xe(Dr), Ar = Qe(
691
+ ({ color: r, size: s, strokeWidth: d, absoluteStrokeWidth: l, className: C = "", children: x, iconNode: j, ...p }, i) => {
692
+ const {
693
+ size: w = 24,
694
+ strokeWidth: h = 2,
695
+ absoluteStrokeWidth: T = !1,
696
+ color: D = "currentColor",
697
+ className: M = ""
698
+ } = Fr() ?? {}, o = l ?? T ? Number(d ?? h) * 24 / Number(s ?? w) : d ?? h;
699
+ return Re(
700
+ "svg",
701
+ {
702
+ ref: i,
703
+ ...je,
704
+ width: s ?? w ?? je.width,
705
+ height: s ?? w ?? je.height,
706
+ stroke: r ?? D,
707
+ strokeWidth: o,
708
+ className: er("lucide", M, C),
709
+ ...!x && !Pr(p) && { "aria-hidden": "true" },
710
+ ...p
711
+ },
712
+ [
713
+ ...j.map(([m, v]) => Re(m, v)),
714
+ ...Array.isArray(x) ? x : [x]
715
+ ]
716
+ );
717
+ }
718
+ );
719
+ /**
720
+ * @license lucide-react v1.17.0 - ISC
721
+ *
722
+ * This source code is licensed under the ISC license.
723
+ * See the LICENSE file in the root directory of this source tree.
724
+ */
725
+ const ee = (r, s) => {
726
+ const d = Qe(
727
+ ({ className: l, ...C }, x) => Re(Ar, {
728
+ ref: x,
729
+ iconNode: s,
730
+ className: er(
731
+ `lucide-${Or(Ke(r))}`,
732
+ `lucide-${r}`,
733
+ l
734
+ ),
735
+ ...C
736
+ })
737
+ );
738
+ return d.displayName = Ke(r), d;
739
+ };
740
+ /**
741
+ * @license lucide-react v1.17.0 - ISC
742
+ *
743
+ * This source code is licensed under the ISC license.
744
+ * See the LICENSE file in the root directory of this source tree.
745
+ */
746
+ const Nr = [
747
+ ["path", { d: "M18 6 7 17l-5-5", key: "116fxf" }],
748
+ ["path", { d: "m22 10-7.5 7.5L13 16", key: "ke71qq" }]
749
+ ], Ir = ee("check-check", Nr);
750
+ /**
751
+ * @license lucide-react v1.17.0 - ISC
752
+ *
753
+ * This source code is licensed under the ISC license.
754
+ * See the LICENSE file in the root directory of this source tree.
755
+ */
756
+ const Mr = [
757
+ ["path", { d: "M10.1 2.182a10 10 0 0 1 3.8 0", key: "5ilxe3" }],
758
+ ["path", { d: "M13.9 21.818a10 10 0 0 1-3.8 0", key: "11zvb9" }],
759
+ ["path", { d: "M17.609 3.721a10 10 0 0 1 2.69 2.7", key: "1iw5b2" }],
760
+ ["path", { d: "M2.182 13.9a10 10 0 0 1 0-3.8", key: "c0bmvh" }],
761
+ ["path", { d: "M20.279 17.609a10 10 0 0 1-2.7 2.69", key: "1ruxm7" }],
762
+ ["path", { d: "M21.818 10.1a10 10 0 0 1 0 3.8", key: "qkgqxc" }],
763
+ ["path", { d: "M3.721 6.391a10 10 0 0 1 2.7-2.69", key: "1mcia2" }],
764
+ ["path", { d: "M6.391 20.279a10 10 0 0 1-2.69-2.7", key: "1fvljs" }]
765
+ ], Wr = ee("circle-dashed", Mr);
766
+ /**
767
+ * @license lucide-react v1.17.0 - ISC
768
+ *
769
+ * This source code is licensed under the ISC license.
770
+ * See the LICENSE file in the root directory of this source tree.
771
+ */
772
+ const Lr = [
773
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
774
+ ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
775
+ ["path", { d: "m9 9 6 6", key: "z0biqf" }]
776
+ ], Br = ee("circle-x", Lr);
777
+ /**
778
+ * @license lucide-react v1.17.0 - ISC
779
+ *
780
+ * This source code is licensed under the ISC license.
781
+ * See the LICENSE file in the root directory of this source tree.
782
+ */
783
+ const Yr = [
784
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
785
+ ["path", { d: "M12 16v-4", key: "1dtifu" }],
786
+ ["path", { d: "M12 8h.01", key: "e9boi3" }]
787
+ ], Vr = ee("info", Yr);
788
+ /**
789
+ * @license lucide-react v1.17.0 - ISC
790
+ *
791
+ * This source code is licensed under the ISC license.
792
+ * See the LICENSE file in the root directory of this source tree.
793
+ */
794
+ const zr = [
795
+ ["path", { d: "M12 17v5", key: "bb1du9" }],
796
+ [
797
+ "path",
798
+ {
799
+ d: "M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",
800
+ key: "1nkz8b"
801
+ }
802
+ ]
803
+ ], Ur = ee("pin", zr);
804
+ /**
805
+ * @license lucide-react v1.17.0 - ISC
806
+ *
807
+ * This source code is licensed under the ISC license.
808
+ * See the LICENSE file in the root directory of this source tree.
809
+ */
810
+ const qr = [
811
+ ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
812
+ ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
813
+ ], He = ee("x", qr), P = {
814
+ // Text color classes for different toast types
815
+ textClasses: {
816
+ success: "text_success",
817
+ error: "text_error",
818
+ loading: "text_warning",
819
+ warning: "text_warning",
820
+ warningStay: "text_warning",
821
+ info: "text_info",
822
+ infoStay: "text_info",
823
+ confirm: "text_white",
824
+ basic: "text_white",
825
+ successWhite: "text_white",
826
+ errorWhite: "text_white",
827
+ loadingWhite: "text_white",
828
+ warningWhite: "text_white",
829
+ warningStayWhite: "text_white",
830
+ infoWhite: "text_white",
831
+ infoStayWhite: "text_white",
832
+ successDark: "text_dark",
833
+ errorDark: "text_dark",
834
+ loadingDark: "text_dark",
835
+ warningDark: "text_dark",
836
+ warningStayDark: "text_dark",
837
+ infoDark: "text_dark",
838
+ infoStayDark: "text_dark",
839
+ confirmDark: "text_dark",
840
+ basicDark: "text_dark"
841
+ },
842
+ // Background classes
843
+ backgroundClasses: {
844
+ success: "bg_success",
845
+ error: "bg_error",
846
+ warning: "bg_warning",
847
+ info: "bg_info",
848
+ glass: "bg_glass",
849
+ white: "bg_white",
850
+ dark: "bg_dark",
851
+ gray: "bg_gray",
852
+ transparent: "bg_transparent"
853
+ },
854
+ // Position classes
855
+ positionClasses: {
856
+ top: "top",
857
+ topFull: "topFull",
858
+ topLeft: "topLeft",
859
+ topRight: "topRight",
860
+ bottom: "bottom",
861
+ bottomFull: "bottomFull",
862
+ bottomLeft: "bottomLeft",
863
+ bottomRight: "bottomRight",
864
+ center: "middle"
865
+ },
866
+ // Animation classes
867
+ animationClasses: {
868
+ down: "ani_down",
869
+ top: "ani_top",
870
+ left: "ani_left",
871
+ right: "ani_right",
872
+ fade: "ani_fade",
873
+ zoom: "ani_zoom",
874
+ jelly: "ani_jelly"
875
+ },
876
+ // Alignment classes
877
+ alignmentClasses: {
878
+ left: "text_start",
879
+ right: "text_end",
880
+ center: "text_center"
881
+ },
882
+ // Skew classes
883
+ skewClasses: {
884
+ three: "right3",
885
+ six: "right6",
886
+ twelve: "right12"
887
+ },
888
+ // Shadow classes
889
+ shadowClasses: {
890
+ none: "",
891
+ gray: "box_shadow",
892
+ block: "box_shadow_block",
893
+ error: "shadow_error",
894
+ white: "shadow_white",
895
+ dark: "shadow_dark",
896
+ success: "shadow_success",
897
+ info: "shadow_info",
898
+ warning: "shadow_warning",
899
+ around: "shadow_around"
900
+ },
901
+ // Border radius classes
902
+ radiusClasses: {
903
+ none: "rounded_none",
904
+ sm: "rounded_sm",
905
+ md: "rounded_md",
906
+ lg: "rounded_lg",
907
+ xl: "rounded_xl",
908
+ twoXl: "rounded_2xl",
909
+ full: "rounded_full"
910
+ }
911
+ }, E = {
912
+ // Types that auto-hide
913
+ autoHideTypes: [
914
+ "success",
915
+ "successWhite",
916
+ "successDark",
917
+ "error",
918
+ "errorWhite",
919
+ "errorDark",
920
+ "warning",
921
+ "warningWhite",
922
+ "warningDark",
923
+ "info",
924
+ "infoWhite",
925
+ "infoDark",
926
+ "basic",
927
+ "basicDark"
928
+ ],
929
+ stayTypes: [
930
+ "infoStay",
931
+ "infoStayWhite",
932
+ "infoStayDark",
933
+ "warningStay",
934
+ "warningStayWhite",
935
+ "warningStayDark",
936
+ "customStay"
937
+ ],
938
+ // Types that show an overlay
939
+ overlayTypes: ["confirm", "confirmDark"],
940
+ // Types that need special loading handling
941
+ loadingTypes: ["loading", "loadingWhite", "loadingDark"],
942
+ // Durations
943
+ durations: {
944
+ standard: 4500,
945
+ afterHover: 1500,
946
+ animationClose: 300,
947
+ loadingFooterDelay: 5330,
948
+ loadingCloseButtonDelay: 5e3
949
+ }
950
+ }, Gr = ({ footer: r, toastAlignment: s, toastBG: d }) => /* @__PURE__ */ a.jsx("div", { className: `_footer toast_width ${s} ${Kr[d]}`, children: r }), Kr = {
951
+ dark: "footer_dark",
952
+ warning: "footer_dark",
953
+ white: "footer_white",
954
+ info: "footer_info",
955
+ error: "footer_error",
956
+ success: "footer_success",
957
+ gray: "footer_success",
958
+ glass: "footer_success",
959
+ transparent: "footer_success"
960
+ }, Je = ({ footer: r, toastAlignment: s, toastBG: d }) => /* @__PURE__ */ a.jsx("div", { className: `innerFooter ${s} ${Hr[d]}`, children: r }), Hr = {
961
+ dark: "footer_dark",
962
+ warning: "footer_dark",
963
+ white: "footer_white",
964
+ info: "footer_info",
965
+ error: "footer_error",
966
+ success: "footer_success",
967
+ gray: "footer_success",
968
+ glass: "footer_success",
969
+ transparent: "footer_success"
970
+ }, Jr = ({ toastAlignment: r, toastBG: s, loadFooter: d }) => /* @__PURE__ */ a.jsx("div", { className: `_footer toast_width reveal_ani ${r} ${Xr[s]}`, children: d }), Xr = {
971
+ dark: "footer_dark",
972
+ warning: "footer_dark",
973
+ white: "footer_white",
974
+ info: "footer_info",
975
+ error: "footer_error",
976
+ success: "footer_success",
977
+ gray: "footer_success",
978
+ glass: "footer_success",
979
+ transparent: "footer_success"
980
+ }, Zr = ({ toast: r, onHide: s, onConfirm: d, onCancel: l, onMouseEnter: C, onMouseLeave: x, setToasts: j }) => {
981
+ const p = Object.keys(P.positionClasses).find(
982
+ (o) => P.positionClasses[o] === r.position
983
+ ), i = Object.keys(P.backgroundClasses).find(
984
+ (o) => P.backgroundClasses[o] === r.background
985
+ ), w = p === "bottomFull" || p === "topFull", h = E.overlayTypes.includes(r.type), T = r.type === "basic" || r.type === "basicDark", D = r.type === "custom" || r.type === "customStay", M = (o) => o.includes("success") ? /* @__PURE__ */ a.jsx(Ir, {}) : o.includes("error") ? /* @__PURE__ */ a.jsx(Br, {}) : o.includes("loading") ? /* @__PURE__ */ a.jsx(Wr, { className: "animate_spin" }) : o.includes("warning") ? /* @__PURE__ */ a.jsx(Vr, {}) : o.includes("info") ? /* @__PURE__ */ a.jsx(Ur, { className: "rotate_deg" }) : null;
986
+ return /* @__PURE__ */ a.jsxs(Oe.Fragment, { children: [
987
+ r.showOverlay && /* @__PURE__ */ a.jsx("div", { className: `overlay ${r.showOverlay ? "show" : ""}` }),
988
+ /* @__PURE__ */ a.jsx(
989
+ "div",
990
+ {
991
+ className: `
992
+ outer_container
993
+ ${r.position}
994
+ ${r.animation}
995
+ ${r.isExiting ? "exiting" : ""}
996
+ `,
997
+ style: { zIndex: 9999 },
998
+ onAnimationEnd: () => {
999
+ r.isExiting && j((o) => o.filter((m) => m.id !== r.id));
1000
+ },
1001
+ children: D ? /* @__PURE__ */ a.jsx(
1002
+ "div",
1003
+ {
1004
+ className: `inner_container ${w ? "toast_width_full" : "max_width"} ${r.radius}`,
1005
+ onMouseEnter: () => C(r.id, r.type),
1006
+ onMouseLeave: () => x(r.id, r.type),
1007
+ children: r.custom
1008
+ }
1009
+ ) : h ? /* @__PURE__ */ a.jsx(
1010
+ "div",
1011
+ {
1012
+ className: `inner_container ${w ? "toast_width_full" : "max_width"} ${P.textClasses[r.type]} ${r.background} ${r.skew} ${r.shadow} ${r.radius}`,
1013
+ onMouseEnter: () => C(r.id, r.type),
1014
+ onMouseLeave: () => x(r.id, r.type),
1015
+ children: /* @__PURE__ */ a.jsxs("div", { className: h ? "toast_width_confirm" : "toast_width", children: [
1016
+ /* @__PURE__ */ a.jsxs("div", { className: `confirm_message ${r.alignment}`, children: [
1017
+ !T && /* @__PURE__ */ a.jsxs("div", { children: [
1018
+ /* @__PURE__ */ a.jsx("span", { className: "sr_only", children: "toast icon" }),
1019
+ /* @__PURE__ */ a.jsx("span", { "aria-hidden": "true", children: M(r.type) })
1020
+ ] }),
1021
+ /* @__PURE__ */ a.jsx(a.Fragment, { children: r.message }),
1022
+ /* @__PURE__ */ a.jsx(
1023
+ "div",
1024
+ {
1025
+ className: `closeDiv ${r.showCloseButton && r.showButton && !h ? "div_flex" : "div_hidden"}`,
1026
+ children: /* @__PURE__ */ a.jsxs(
1027
+ "button",
1028
+ {
1029
+ onClick: () => s(r.id),
1030
+ id: `close-${r.id}`,
1031
+ className: `closeButton ${i === "white" ? "bg_whiter" : i === "glass" || i === "transparent" ? "bg_glass_close" : "bg_darker"}`,
1032
+ children: [
1033
+ /* @__PURE__ */ a.jsx("span", { className: "sr_only", children: "close toast" }),
1034
+ /* @__PURE__ */ a.jsx(
1035
+ He,
1036
+ {
1037
+ "aria-hidden": "true",
1038
+ size: 18
1039
+ }
1040
+ )
1041
+ ]
1042
+ }
1043
+ )
1044
+ }
1045
+ )
1046
+ ] }),
1047
+ r.footer && /* @__PURE__ */ a.jsx(
1048
+ Je,
1049
+ {
1050
+ footer: r.footer,
1051
+ toastBG: i,
1052
+ toastAlignment: r.alignment
1053
+ }
1054
+ ),
1055
+ /* @__PURE__ */ a.jsxs(
1056
+ "div",
1057
+ {
1058
+ className: `confirm_div ${r.alignment === "text_start" ? "justify_end" : r.alignment === "text_end" ? "justify_start" : r.alignment === "text_center" ? "justify_center" : null}`,
1059
+ children: [
1060
+ /* @__PURE__ */ a.jsxs(
1061
+ "button",
1062
+ {
1063
+ className: `cancel_button ${i === "white" ? "cancel_button_dark" : i === "success" || i === "warning" || i === "error" || i === "info" || i === "dark" ? "cancel_button_all" : "cancel_button_glass"}`,
1064
+ onClick: () => l(r.id),
1065
+ children: [
1066
+ /* @__PURE__ */ a.jsx("span", { className: "sr_only", children: "close toast" }),
1067
+ "Cancel"
1068
+ ]
1069
+ }
1070
+ ),
1071
+ /* @__PURE__ */ a.jsxs(
1072
+ "button",
1073
+ {
1074
+ className: `confirm_button ${i === "dark" ? "confirm_button_dark" : "confirm_button_white"}`,
1075
+ onClick: () => d(r.id),
1076
+ children: [
1077
+ /* @__PURE__ */ a.jsx("span", { className: "sr_only", children: "confirm action" }),
1078
+ "Confirm"
1079
+ ]
1080
+ }
1081
+ )
1082
+ ]
1083
+ }
1084
+ )
1085
+ ] })
1086
+ }
1087
+ ) : /* @__PURE__ */ a.jsxs(
1088
+ "div",
1089
+ {
1090
+ className: `inner_container ${w ? "toast_width_full" : "max_width"} ${P.textClasses[r.type]} ${r.background} ${r.skew} ${r.shadow} ${r.radius}`,
1091
+ onMouseEnter: () => C(r.id, r.type),
1092
+ onMouseLeave: () => x(r.id, r.type),
1093
+ children: [
1094
+ /* @__PURE__ */ a.jsxs("div", { className: h ? "toast_width_confirm" : "toast_width", children: [
1095
+ /* @__PURE__ */ a.jsxs("div", { className: `toast_message ${r.alignment}`, children: [
1096
+ !h && !T && /* @__PURE__ */ a.jsxs("div", { children: [
1097
+ /* @__PURE__ */ a.jsx("span", { className: "sr_only", children: "toast icon" }),
1098
+ /* @__PURE__ */ a.jsx("span", { "aria-hidden": "true", children: M(r.type) })
1099
+ ] }),
1100
+ /* @__PURE__ */ a.jsx(a.Fragment, { children: r.message }),
1101
+ /* @__PURE__ */ a.jsx(
1102
+ "div",
1103
+ {
1104
+ className: `closeDiv ${r.showCloseButton && r.showButton && !h ? "div_flex" : "div_hidden"}`,
1105
+ children: /* @__PURE__ */ a.jsxs(
1106
+ "button",
1107
+ {
1108
+ onClick: () => s(r.id),
1109
+ id: `close-${r.id}`,
1110
+ className: `closeButton
1111
+ ${i === "white" ? "bg_whiter" : i === "glass" || i === "transparent" ? "bg_glass_close" : "bg_darker"}`,
1112
+ children: [
1113
+ /* @__PURE__ */ a.jsx("span", { className: "sr_only", children: "close toast" }),
1114
+ /* @__PURE__ */ a.jsx(
1115
+ He,
1116
+ {
1117
+ "aria-hidden": "true",
1118
+ size: 18
1119
+ }
1120
+ )
1121
+ ]
1122
+ }
1123
+ )
1124
+ }
1125
+ )
1126
+ ] }),
1127
+ h && r.footer && /* @__PURE__ */ a.jsx(
1128
+ Je,
1129
+ {
1130
+ footer: r.footer,
1131
+ toastBG: i,
1132
+ toastAlignment: r.alignment
1133
+ }
1134
+ ),
1135
+ h && /* @__PURE__ */ a.jsxs(
1136
+ "div",
1137
+ {
1138
+ className: `confirm_div
1139
+ ${r.alignment === "text_start" ? "justify_end" : r.alignment === "text_end" ? "justify_start" : r.alignment === "text_center" ? "justify_center" : null}
1140
+ `,
1141
+ children: [
1142
+ /* @__PURE__ */ a.jsxs(
1143
+ "button",
1144
+ {
1145
+ className: `cancel_button ${i === "white" ? "cancel_button_dark" : i === "success" || i === "warning" || i === "error" || i === "info" || i === "dark" ? "cancel_button_all" : "cancel_button_glass"}`,
1146
+ onClick: () => l(r.id),
1147
+ children: [
1148
+ /* @__PURE__ */ a.jsx("span", { className: "sr_only", children: "close toast" }),
1149
+ "Cancel"
1150
+ ]
1151
+ }
1152
+ ),
1153
+ /* @__PURE__ */ a.jsxs(
1154
+ "button",
1155
+ {
1156
+ className: `confirm_button
1157
+ ${i === "dark" ? "confirm_button_dark" : "confirm_button_white"}`,
1158
+ onClick: () => d(r.id),
1159
+ children: [
1160
+ /* @__PURE__ */ a.jsx("span", { className: "sr_only", children: "confirm action" }),
1161
+ "Confirm"
1162
+ ]
1163
+ }
1164
+ )
1165
+ ]
1166
+ }
1167
+ )
1168
+ ] }),
1169
+ /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
1170
+ !h && !w && r.footer && /* @__PURE__ */ a.jsx("div", { children: /* @__PURE__ */ a.jsx(
1171
+ Gr,
1172
+ {
1173
+ footer: r.footer,
1174
+ toastBG: i,
1175
+ toastAlignment: r.alignment
1176
+ }
1177
+ ) }),
1178
+ !h && !w && r.showLoadFooter && r.loadFooter && /* @__PURE__ */ a.jsx(
1179
+ Jr,
1180
+ {
1181
+ toastAlignment: r.alignment,
1182
+ toastBG: i,
1183
+ loadFooter: r.loadFooter
1184
+ }
1185
+ )
1186
+ ] })
1187
+ ]
1188
+ }
1189
+ )
1190
+ }
1191
+ )
1192
+ ] }, r.id);
1193
+ }, Te = (r, s) => {
1194
+ let l = {
1195
+ ani_top: "ani_slide_out_up",
1196
+ ani_down: "ani_slide_out_down",
1197
+ ani_left: "ani_slide_out_left",
1198
+ ani_right: "ani_slide_out_right",
1199
+ ani_jelly: "ani_jelly_out",
1200
+ ani_zoom: "ani_zoom_out",
1201
+ ani_fade: "ani_fade_out"
1202
+ }[r] || "ani_fade_out";
1203
+ return s && ["bottomFull", "topFull"].includes(s) && (l = "ani_fade_out_full"), l;
1204
+ }, Qr = () => {
1205
+ const [r, s] = Tr([]), d = Ce(/* @__PURE__ */ new Map()), l = Ce(/* @__PURE__ */ new Map()), C = Ce(r);
1206
+ Ee(() => {
1207
+ C.current = r;
1208
+ }, [r]);
1209
+ const x = z(() => `toast-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, []), j = z((o) => {
1210
+ l.current.has(o) && (clearTimeout(l.current.get(o)), l.current.delete(o));
1211
+ }, []), p = z((o) => {
1212
+ var R, y;
1213
+ const m = o ?? ((y = (R = C.current) == null ? void 0 : R[C.current.length - 1]) == null ? void 0 : y.id);
1214
+ if (!m) return;
1215
+ s((N) => {
1216
+ const V = N.findIndex((U) => U.id === m);
1217
+ if (V === -1) return N;
1218
+ const q = N[V], re = Object.keys(P.positionClasses).find(
1219
+ (U) => P.positionClasses[U] === q.position
1220
+ ), te = Te(q.animation, re), H = [...N];
1221
+ return H[V] = { ...q, animation: te, isExiting: !0 }, H;
1222
+ });
1223
+ const v = setTimeout(() => {
1224
+ s((N) => N.filter((V) => V.id !== m)), d.current.delete(m);
1225
+ }, E.durations.animationClose);
1226
+ l.current.set(m, v);
1227
+ }, []), i = z(
1228
+ (o) => {
1229
+ s((m) => {
1230
+ const v = m.findIndex((N) => N.id === o);
1231
+ if (v === -1) return m;
1232
+ const R = [...m], y = R[v];
1233
+ return R[v] = {
1234
+ ...y,
1235
+ animation: Te(y.animation, y.position)
1236
+ }, R;
1237
+ }), j(o), l.current.set(
1238
+ o,
1239
+ setTimeout(() => {
1240
+ d.current.has(o) && (d.current.get(o)(!0), d.current.delete(o)), s((m) => m.filter((v) => v.id !== o));
1241
+ }, E.durations.animationClose)
1242
+ );
1243
+ },
1244
+ [j]
1245
+ ), w = z(
1246
+ (o) => {
1247
+ d.current.has(o) && (d.current.get(o)(!1), d.current.delete(o)), p(o);
1248
+ },
1249
+ [p]
1250
+ ), h = z(
1251
+ (o, m) => {
1252
+ E.autoHideTypes.includes(m) && j(o);
1253
+ },
1254
+ [j]
1255
+ ), T = z(
1256
+ (o, m) => {
1257
+ E.autoHideTypes.includes(m) && l.current.set(
1258
+ o,
1259
+ setTimeout(() => p(o), E.durations.afterHover)
1260
+ );
1261
+ },
1262
+ [p]
1263
+ ), D = z(
1264
+ (o, m) => {
1265
+ const {
1266
+ type: v = "success",
1267
+ message: R = "",
1268
+ bg: y = "white",
1269
+ position: N = "top",
1270
+ transition: V = "zoom",
1271
+ loadFooter: q = null,
1272
+ footer: re = null,
1273
+ skew: te = "",
1274
+ cancelButton: H = !0,
1275
+ shadow: U = "gray",
1276
+ radius: ge = "lg",
1277
+ align: pe = "center",
1278
+ timeout: ne = E.durations.standard,
1279
+ custom: B = null
1280
+ } = o, S = x(), G = P.backgroundClasses[y] || "", ie = P.positionClasses[N] || "", ce = P.animationClasses[V] || "", le = P.skewClasses[te] || "", ue = P.shadowClasses[U] || "", de = P.radiusClasses[ge] || "", fe = P.alignmentClasses[pe] || "", J = {
1281
+ id: S,
1282
+ type: v,
1283
+ message: R,
1284
+ position: ie,
1285
+ background: G,
1286
+ animation: ce,
1287
+ skew: le,
1288
+ shadow: ue,
1289
+ radius: de,
1290
+ alignment: fe,
1291
+ footer: re,
1292
+ loadFooter: q,
1293
+ showButton: H,
1294
+ showCloseButton: !0,
1295
+ showLoadFooter: !1,
1296
+ showOverlay: E.overlayTypes.includes(v),
1297
+ timeout: ne,
1298
+ custom: B
1299
+ };
1300
+ return E.loadingTypes.includes(v) && (J.showCloseButton = !1, J.showLoadFooter = !1), s((A) => {
1301
+ const Y = A.filter((O) => !O.isExiting);
1302
+ let W = [...A];
1303
+ if (Y.length >= 3) {
1304
+ const O = Y[0];
1305
+ W = W.map(
1306
+ (L) => L.id === O.id ? {
1307
+ ...L,
1308
+ isExiting: !0,
1309
+ animation: Te(L.animation, L.position)
1310
+ } : L
1311
+ ), setTimeout(() => {
1312
+ s(
1313
+ (L) => L.filter((X) => X.id !== O.id)
1314
+ ), l.current.has(O.id) && (clearTimeout(l.current.get(O.id)), l.current.delete(O.id));
1315
+ }, E.durations.animationClose);
1316
+ }
1317
+ return [...W, J];
1318
+ }), E.loadingTypes.includes(v) && (setTimeout(() => {
1319
+ s((A) => {
1320
+ const Y = A.findIndex((O) => O.id === S);
1321
+ if (Y === -1) return A;
1322
+ const W = [...A];
1323
+ return W[Y].showCloseButton = !0, W;
1324
+ });
1325
+ }, E.durations.loadingCloseButtonDelay), setTimeout(() => {
1326
+ s((A) => {
1327
+ const Y = A.findIndex((O) => O.id === S);
1328
+ if (Y === -1) return A;
1329
+ const W = [...A];
1330
+ return W[Y].showLoadFooter = !0, W;
1331
+ });
1332
+ }, E.durations.loadingFooterDelay)), E.overlayTypes.includes(v) && m && d.current.set(S, m), !E.stayTypes.includes(v) && !E.loadingTypes.includes(v) && !E.overlayTypes.includes(v) && l.current.set(
1333
+ S,
1334
+ setTimeout(() => p(S), ne)
1335
+ ), S;
1336
+ },
1337
+ [x, p]
1338
+ ), M = z(
1339
+ (o) => new Promise((m) => D(o, m)),
1340
+ [D]
1341
+ );
1342
+ return Ee(() => {
1343
+ const o = (m) => {
1344
+ if (m.key === "Escape" && r.length > 0) {
1345
+ const v = r[r.length - 1];
1346
+ v && p(v.id);
1347
+ }
1348
+ };
1349
+ return document.addEventListener("keydown", o), () => document.removeEventListener("keydown", o);
1350
+ }, [p, r]), Ee(() => () => {
1351
+ l.current.forEach((o) => clearTimeout(o)), l.current.clear();
1352
+ }, []), {
1353
+ toasts: r,
1354
+ setToasts: s,
1355
+ toastMaster: M,
1356
+ hideToast: p,
1357
+ handleConfirm: i,
1358
+ handleCancel: w,
1359
+ handleMouseEnter: h,
1360
+ handleMouseLeave: T
1361
+ };
1362
+ }, rr = Ze(null), rt = ({ children: r }) => {
1363
+ const {
1364
+ toasts: s,
1365
+ setToasts: d,
1366
+ toastMaster: l,
1367
+ hideToast: C,
1368
+ handleConfirm: x,
1369
+ handleCancel: j,
1370
+ handleMouseEnter: p,
1371
+ handleMouseLeave: i
1372
+ } = Qr();
1373
+ return /* @__PURE__ */ a.jsxs(rr.Provider, { value: { toastMaster: l, hideToast: C }, children: [
1374
+ r,
1375
+ s.map((w) => /* @__PURE__ */ a.jsx(
1376
+ Zr,
1377
+ {
1378
+ toast: w,
1379
+ setToasts: d,
1380
+ onHide: C,
1381
+ onConfirm: x,
1382
+ onCancel: j,
1383
+ onMouseEnter: p,
1384
+ onMouseLeave: i
1385
+ },
1386
+ w.id
1387
+ ))
1388
+ ] });
1389
+ }, tt = () => {
1390
+ const r = Xe(rr);
1391
+ if (!r)
1392
+ throw new Error("useToast must be used within a ToastProvider");
1393
+ return r;
1394
+ };
1395
+ export {
1396
+ rr as ToastContext,
1397
+ rt as ToastProvider,
1398
+ tt as useToast
1399
+ };