@pfct/purple 1.16.2 → 1.17.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.
Files changed (166) hide show
  1. package/dist/chunks/Accordion.DYya7dTN.js +1 -0
  2. package/dist/chunks/Accordion.DgWTtf1u.js +716 -0
  3. package/dist/chunks/Divider.CptJ_x2Y.js +1 -0
  4. package/dist/chunks/{Divider.DBtnaPqJ.js → Divider.DR-c4z_i.js} +16 -13
  5. package/dist/chunks/DotLottie.BQNTv0XO.js +5 -0
  6. package/dist/chunks/DotLottie.qOfU0HjI.js +1993 -0
  7. package/dist/chunks/Switch.D7T_jbtK.js +207 -0
  8. package/dist/chunks/Switch.DUWZASi8.js +1 -0
  9. package/dist/chunks/Toast.Bnm65xmy.js +1 -0
  10. package/dist/chunks/Toast.C7OnkFjA.js +698 -0
  11. package/dist/chunks/{bottomSheet.BGKwHjuP.js → bottomSheet.DCURoJ3z.js} +1 -1
  12. package/dist/chunks/{bottomSheet.C99fAuQK.js → bottomSheet.DqOEMG09.js} +1 -1
  13. package/dist/chunks/checkbox.DjQsU_Pk.js +1 -0
  14. package/dist/chunks/{checkbox.DNdnhspb.js → checkbox.Dl8nNqLc.js} +100 -92
  15. package/dist/chunks/dist.AclwPuO5.js +1 -0
  16. package/dist/chunks/{dist.BskID78S.js → dist.B0edyUiC.js} +176 -178
  17. package/dist/chunks/dist.B4GZ3aX4.js +111 -0
  18. package/dist/chunks/dist.BE2xxxwt.js +96 -0
  19. package/dist/chunks/dist.Ba6P-3sU.js +1 -0
  20. package/dist/chunks/dist.BaV_5zx8.js +186 -0
  21. package/dist/chunks/{dist.CDZCWPu4.js → dist.BnLwXMBJ.js} +8 -4
  22. package/dist/chunks/dist.BpQ7SpeW.js +227 -0
  23. package/dist/chunks/dist.Bui5aGSB.js +197 -0
  24. package/dist/chunks/dist.CBOTGT1c.js +1 -0
  25. package/dist/chunks/dist.CIvT5XE_.js +1 -0
  26. package/dist/chunks/dist.CKG-hzoQ.js +1 -0
  27. package/dist/chunks/{dist.QtpYoD01.js → dist.CVClT59R.js} +8 -3
  28. package/dist/chunks/dist.CcSbgqVt.js +1 -0
  29. package/dist/chunks/dist.Cf8FjzvS.js +1 -0
  30. package/dist/chunks/{dist.DIjdcvlQ.js → dist.Cx1JFVV3.js} +48 -59
  31. package/dist/chunks/dist.D7s7BenH.js +1 -0
  32. package/dist/chunks/dist.DQ5uOc4y.js +1 -0
  33. package/dist/chunks/dist.DWzqVshx.js +16 -0
  34. package/dist/chunks/dist.DfLaHIBc.js +1 -0
  35. package/dist/chunks/dist.DomaJxrX.js +1 -0
  36. package/dist/chunks/dist.e7n2cf43.js +144 -0
  37. package/dist/chunks/dist.gUJz6qTg.js +185 -0
  38. package/dist/chunks/dist.zJ3rbM0i.js +1 -0
  39. package/dist/chunks/drawer.Cots0_ea.js +7 -0
  40. package/dist/chunks/drawer.ftfBm36h.js +1836 -0
  41. package/dist/chunks/es2015.CfvYaoE5.js +41 -0
  42. package/dist/chunks/{es2015.ByVyszJo.js → es2015.DCKfm2VN.js} +168 -187
  43. package/dist/chunks/{src.D-VoFbup.js → src.BAhu5d2_.js} +1 -1
  44. package/dist/chunks/{src.CmgILXZE.js → src.DlM6Ki-I.js} +5 -5
  45. package/dist/chunks/tooltip.8vKL7w2a.js +1 -0
  46. package/dist/chunks/tooltip.D9PoXwtV.js +448 -0
  47. package/dist/components/Accordion/index.cjs.js +1 -1
  48. package/dist/components/Accordion/index.esm.js +1 -1
  49. package/dist/components/Control/Switch/index.cjs.js +1 -1
  50. package/dist/components/Control/Switch/index.esm.js +1 -1
  51. package/dist/components/Control/index.cjs.js +1 -1
  52. package/dist/components/Control/index.esm.js +2 -2
  53. package/dist/components/Divider/index.cjs.js +1 -1
  54. package/dist/components/Divider/index.esm.js +1 -1
  55. package/dist/components/LegacyModal/index.cjs.js +1 -1
  56. package/dist/components/LegacyModal/index.esm.js +1 -1
  57. package/dist/components/MiniButton/IconMiniButton/index.cjs.js +1 -1
  58. package/dist/components/MiniButton/IconMiniButton/index.esm.js +1 -1
  59. package/dist/components/MiniButton/UnderLineMiniButton/index.cjs.js +1 -1
  60. package/dist/components/MiniButton/UnderLineMiniButton/index.esm.js +1 -1
  61. package/dist/components/Modal/index.cjs.js +1 -1
  62. package/dist/components/Modal/index.esm.js +1 -1
  63. package/dist/components/Pagination/index.cjs.js +1 -1
  64. package/dist/components/Pagination/index.esm.js +1 -1
  65. package/dist/components/Tabs/FillTabs/index.cjs.js +1 -1
  66. package/dist/components/Tabs/FillTabs/index.esm.js +1 -1
  67. package/dist/components/Tabs/index.cjs.js +1 -1
  68. package/dist/components/Tabs/index.esm.js +1 -1
  69. package/dist/components/Tag/index.cjs.js +1 -1
  70. package/dist/components/Tag/index.esm.js +1 -1
  71. package/dist/components/Terms/index.cjs.js +1 -1
  72. package/dist/components/Terms/index.esm.js +3 -3
  73. package/dist/components/Toast/index.cjs.js +1 -1
  74. package/dist/components/Toast/index.esm.js +1 -1
  75. package/dist/components/index.cjs.js +1 -1
  76. package/dist/components/index.esm.js +8 -8
  77. package/dist/components/ui/bottomSheet.cjs.js +1 -1
  78. package/dist/components/ui/bottomSheet.esm.js +1 -1
  79. package/dist/components/ui/button.cjs.js +1 -1
  80. package/dist/components/ui/button.esm.js +1 -1
  81. package/dist/components/ui/checkbox.cjs.js +1 -1
  82. package/dist/components/ui/checkbox.esm.js +1 -1
  83. package/dist/components/ui/dialog.cjs.js +1 -1
  84. package/dist/components/ui/dialog.esm.js +1 -1
  85. package/dist/components/ui/drawer.cjs.js +1 -1
  86. package/dist/components/ui/drawer.esm.js +1 -1
  87. package/dist/components/ui/impact-tooltip.cjs.js +1 -1
  88. package/dist/components/ui/impact-tooltip.esm.js +1 -1
  89. package/dist/components/ui/select.cjs.js +1 -1
  90. package/dist/components/ui/select.esm.js +3 -3
  91. package/dist/components/ui/tooltip.cjs.js +1 -1
  92. package/dist/components/ui/tooltip.esm.js +1 -1
  93. package/dist/components/ui/typography.cjs.js +1 -1
  94. package/dist/components/ui/typography.esm.js +1 -1
  95. package/dist/icons/src/aliases/aliases.cjs.js +1 -1
  96. package/dist/icons/src/aliases/aliases.d.ts +1 -1
  97. package/dist/icons/src/aliases/aliases.d.ts.map +1 -1
  98. package/dist/icons/src/aliases/aliases.esm.js +3 -3
  99. package/dist/icons/src/aliases/index.cjs.js +1 -1
  100. package/dist/icons/src/aliases/index.esm.js +3 -3
  101. package/dist/icons/src/aliases/prefixed.cjs.js +1 -1
  102. package/dist/icons/src/aliases/prefixed.d.ts +9 -9
  103. package/dist/icons/src/aliases/prefixed.d.ts.map +1 -1
  104. package/dist/icons/src/aliases/prefixed.esm.js +3 -3
  105. package/dist/icons/src/aliases/suffixed.cjs.js +1 -1
  106. package/dist/icons/src/aliases/suffixed.d.ts +10 -10
  107. package/dist/icons/src/aliases/suffixed.d.ts.map +1 -1
  108. package/dist/icons/src/aliases/suffixed.esm.js +3 -3
  109. package/dist/icons/src/icons/index.cjs.js +1 -1
  110. package/dist/icons/src/icons/index.esm.js +3 -3
  111. package/dist/index.cjs.js +1 -1
  112. package/dist/index.esm.js +12 -12
  113. package/dist/library/DotLottie/index.cjs.js +1 -1
  114. package/dist/library/DotLottie/index.d.ts +13 -0
  115. package/dist/library/DotLottie/index.d.ts.map +1 -1
  116. package/dist/library/DotLottie/index.esm.js +1 -1
  117. package/dist/library/Lottie/index.cjs.js +1 -1
  118. package/dist/library/Lottie/index.d.ts +13 -0
  119. package/dist/library/Lottie/index.d.ts.map +1 -1
  120. package/dist/library/Lottie/index.esm.js +25 -25
  121. package/dist/library/index.cjs.js +1 -1
  122. package/dist/library/index.esm.js +1 -1
  123. package/package.json +4 -4
  124. package/dist/chunks/Accordion.Cs1f4aQZ.js +0 -373
  125. package/dist/chunks/Accordion.ZIp0NsA0.js +0 -1
  126. package/dist/chunks/Divider.BIS4pXEy.js +0 -1
  127. package/dist/chunks/DotLottie.CaDygpsw.js +0 -73962
  128. package/dist/chunks/DotLottie.Cf-SL2bJ.js +0 -5
  129. package/dist/chunks/Switch.C6xwIjJR.js +0 -1
  130. package/dist/chunks/Switch.D_myxCrS.js +0 -200
  131. package/dist/chunks/Toast.Cjdk4za6.js +0 -1
  132. package/dist/chunks/Toast.D1-VfeA2.js +0 -685
  133. package/dist/chunks/checkbox.CfWB_nqn.js +0 -1
  134. package/dist/chunks/dist.B2wZmrK1.js +0 -98
  135. package/dist/chunks/dist.B8tpQk-4.js +0 -1
  136. package/dist/chunks/dist.BC0-iqKU.js +0 -1
  137. package/dist/chunks/dist.BGATFz6w.js +0 -1
  138. package/dist/chunks/dist.BQIeYu70.js +0 -1
  139. package/dist/chunks/dist.BWsA5f1f.js +0 -1
  140. package/dist/chunks/dist.BixLWWwb.js +0 -71
  141. package/dist/chunks/dist.Bxqi8VAi.js +0 -1
  142. package/dist/chunks/dist.C8FJXTu6.js +0 -10
  143. package/dist/chunks/dist.C8NniehT.js +0 -1
  144. package/dist/chunks/dist.C8k7jQIp.js +0 -87
  145. package/dist/chunks/dist.CEJ-WCY_.js +0 -44
  146. package/dist/chunks/dist.CIQdvun-.js +0 -1
  147. package/dist/chunks/dist.Cff8LOoN.js +0 -67
  148. package/dist/chunks/dist.CmRTDXGG.js +0 -1
  149. package/dist/chunks/dist.CwMFqhEQ.js +0 -146
  150. package/dist/chunks/dist.CwWM0zXK.js +0 -25
  151. package/dist/chunks/dist.CyhalHxz.js +0 -1
  152. package/dist/chunks/dist.Czpint58.js +0 -1
  153. package/dist/chunks/dist.D3cPoDZ_.js +0 -194
  154. package/dist/chunks/dist.D4mQo5QB.js +0 -1
  155. package/dist/chunks/dist.D5ataprQ.js +0 -1
  156. package/dist/chunks/dist.D6A3yc_d.js +0 -11
  157. package/dist/chunks/dist.DKOi9kq6.js +0 -1
  158. package/dist/chunks/dist.DhCw5vjE.js +0 -1
  159. package/dist/chunks/dist.DrfVZqiO.js +0 -186
  160. package/dist/chunks/dist.SHmlpKFY.js +0 -1
  161. package/dist/chunks/dist.kg7EEYPp.js +0 -12
  162. package/dist/chunks/drawer.Cji5AtcU.js +0 -1720
  163. package/dist/chunks/drawer.Gt1AjdVH.js +0 -7
  164. package/dist/chunks/es2015.D2emqwtq.js +0 -41
  165. package/dist/chunks/tooltip.DGgNTZ5B.js +0 -444
  166. package/dist/chunks/tooltip.vEwTtt8v.js +0 -1
@@ -1,685 +0,0 @@
1
- import * as e from "react";
2
- import t from "react";
3
- import { jsx as n } from "react/jsx-runtime";
4
- import r from "react-dom";
5
- //#region node_modules/next-themes/dist/index.mjs
6
- var i = (e, t, n, r, i, a, o, s) => {
7
- let c = document.documentElement, l = ["light", "dark"];
8
- function u(t) {
9
- (Array.isArray(e) ? e : [e]).forEach((e) => {
10
- let n = e === "class", r = n && a ? i.map((e) => a[e] || e) : i;
11
- n ? (c.classList.remove(...r), c.classList.add(a && a[t] ? a[t] : t)) : c.setAttribute(e, t);
12
- }), d(t);
13
- }
14
- function d(e) {
15
- s && l.includes(e) && (c.style.colorScheme = e);
16
- }
17
- function f() {
18
- return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
19
- }
20
- if (r) u(r);
21
- else try {
22
- let e = localStorage.getItem(t) || n;
23
- u(o && e === "system" ? f() : e);
24
- } catch {}
25
- }, a = e.createContext(void 0), o = {
26
- setTheme: (e) => {},
27
- themes: []
28
- }, s = () => e.useContext(a) ?? o;
29
- e.memo(({ forcedTheme: t, storageKey: n, attribute: r, enableSystem: a, enableColorScheme: o, defaultTheme: s, value: c, themes: l, nonce: u, scriptProps: d }) => {
30
- let f = JSON.stringify([
31
- r,
32
- n,
33
- s,
34
- t,
35
- l,
36
- c,
37
- a,
38
- o
39
- ]).slice(1, -1);
40
- return e.createElement("script", {
41
- ...d,
42
- suppressHydrationWarning: !0,
43
- nonce: typeof window > "u" ? u : "",
44
- dangerouslySetInnerHTML: { __html: `(${i.toString()})(${f})` }
45
- });
46
- });
47
- //#endregion
48
- //#region node_modules/sonner/dist/index.mjs
49
- function c(e) {
50
- if (!e || typeof document > "u") return;
51
- let t = document.head || document.getElementsByTagName("head")[0], n = document.createElement("style");
52
- n.type = "text/css", t.appendChild(n), n.styleSheet ? n.styleSheet.cssText = e : n.appendChild(document.createTextNode(e));
53
- }
54
- var l = (e) => {
55
- switch (e) {
56
- case "success": return f;
57
- case "info": return m;
58
- case "warning": return p;
59
- case "error": return h;
60
- default: return null;
61
- }
62
- }, u = Array(12).fill(0), d = ({ visible: e, className: n }) => /*#__PURE__*/ t.createElement("div", {
63
- className: ["sonner-loading-wrapper", n].filter(Boolean).join(" "),
64
- "data-visible": e
65
- }, /*#__PURE__*/ t.createElement("div", { className: "sonner-spinner" }, u.map((e, n) => /*#__PURE__*/ t.createElement("div", {
66
- className: "sonner-loading-bar",
67
- key: `spinner-bar-${n}`
68
- })))), f = /*#__PURE__*/ t.createElement("svg", {
69
- xmlns: "http://www.w3.org/2000/svg",
70
- viewBox: "0 0 20 20",
71
- fill: "currentColor",
72
- height: "20",
73
- width: "20"
74
- }, /*#__PURE__*/ t.createElement("path", {
75
- fillRule: "evenodd",
76
- d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",
77
- clipRule: "evenodd"
78
- })), p = /*#__PURE__*/ t.createElement("svg", {
79
- xmlns: "http://www.w3.org/2000/svg",
80
- viewBox: "0 0 24 24",
81
- fill: "currentColor",
82
- height: "20",
83
- width: "20"
84
- }, /*#__PURE__*/ t.createElement("path", {
85
- fillRule: "evenodd",
86
- d: "M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",
87
- clipRule: "evenodd"
88
- })), m = /*#__PURE__*/ t.createElement("svg", {
89
- xmlns: "http://www.w3.org/2000/svg",
90
- viewBox: "0 0 20 20",
91
- fill: "currentColor",
92
- height: "20",
93
- width: "20"
94
- }, /*#__PURE__*/ t.createElement("path", {
95
- fillRule: "evenodd",
96
- d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",
97
- clipRule: "evenodd"
98
- })), h = /*#__PURE__*/ t.createElement("svg", {
99
- xmlns: "http://www.w3.org/2000/svg",
100
- viewBox: "0 0 20 20",
101
- fill: "currentColor",
102
- height: "20",
103
- width: "20"
104
- }, /*#__PURE__*/ t.createElement("path", {
105
- fillRule: "evenodd",
106
- d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",
107
- clipRule: "evenodd"
108
- })), ee = /*#__PURE__*/ t.createElement("svg", {
109
- xmlns: "http://www.w3.org/2000/svg",
110
- width: "12",
111
- height: "12",
112
- viewBox: "0 0 24 24",
113
- fill: "none",
114
- stroke: "currentColor",
115
- strokeWidth: "1.5",
116
- strokeLinecap: "round",
117
- strokeLinejoin: "round"
118
- }, /*#__PURE__*/ t.createElement("line", {
119
- x1: "18",
120
- y1: "6",
121
- x2: "6",
122
- y2: "18"
123
- }), /*#__PURE__*/ t.createElement("line", {
124
- x1: "6",
125
- y1: "6",
126
- x2: "18",
127
- y2: "18"
128
- })), g = () => {
129
- let [e, n] = t.useState(document.hidden);
130
- return t.useEffect(() => {
131
- let e = () => {
132
- n(document.hidden);
133
- };
134
- return document.addEventListener("visibilitychange", e), () => window.removeEventListener("visibilitychange", e);
135
- }, []), e;
136
- }, _ = 1, v = new class {
137
- constructor() {
138
- this.subscribe = (e) => (this.subscribers.push(e), () => {
139
- let t = this.subscribers.indexOf(e);
140
- this.subscribers.splice(t, 1);
141
- }), this.publish = (e) => {
142
- this.subscribers.forEach((t) => t(e));
143
- }, this.addToast = (e) => {
144
- this.publish(e), this.toasts = [...this.toasts, e];
145
- }, this.create = (e) => {
146
- let { message: t, ...n } = e, r = typeof e?.id == "number" || e.id?.length > 0 ? e.id : _++, i = this.toasts.find((e) => e.id === r), a = e.dismissible === void 0 ? !0 : e.dismissible;
147
- return this.dismissedToasts.has(r) && this.dismissedToasts.delete(r), i ? this.toasts = this.toasts.map((n) => n.id === r ? (this.publish({
148
- ...n,
149
- ...e,
150
- id: r,
151
- title: t
152
- }), {
153
- ...n,
154
- ...e,
155
- id: r,
156
- dismissible: a,
157
- title: t
158
- }) : n) : this.addToast({
159
- title: t,
160
- ...n,
161
- dismissible: a,
162
- id: r
163
- }), r;
164
- }, this.dismiss = (e) => (e ? (this.dismissedToasts.add(e), requestAnimationFrame(() => this.subscribers.forEach((t) => t({
165
- id: e,
166
- dismiss: !0
167
- })))) : this.toasts.forEach((e) => {
168
- this.subscribers.forEach((t) => t({
169
- id: e.id,
170
- dismiss: !0
171
- }));
172
- }), e), this.message = (e, t) => this.create({
173
- ...t,
174
- message: e
175
- }), this.error = (e, t) => this.create({
176
- ...t,
177
- message: e,
178
- type: "error"
179
- }), this.success = (e, t) => this.create({
180
- ...t,
181
- type: "success",
182
- message: e
183
- }), this.info = (e, t) => this.create({
184
- ...t,
185
- type: "info",
186
- message: e
187
- }), this.warning = (e, t) => this.create({
188
- ...t,
189
- type: "warning",
190
- message: e
191
- }), this.loading = (e, t) => this.create({
192
- ...t,
193
- type: "loading",
194
- message: e
195
- }), this.promise = (e, n) => {
196
- if (!n) return;
197
- let r;
198
- n.loading !== void 0 && (r = this.create({
199
- ...n,
200
- promise: e,
201
- type: "loading",
202
- message: n.loading,
203
- description: typeof n.description == "function" ? void 0 : n.description
204
- }));
205
- let i = Promise.resolve(e instanceof Function ? e() : e), a = r !== void 0, o, s = i.then(async (e) => {
206
- if (o = ["resolve", e], t.isValidElement(e)) a = !1, this.create({
207
- id: r,
208
- type: "default",
209
- message: e
210
- });
211
- else if (b(e) && !e.ok) {
212
- a = !1;
213
- let i = typeof n.error == "function" ? await n.error(`HTTP error! status: ${e.status}`) : n.error, o = typeof n.description == "function" ? await n.description(`HTTP error! status: ${e.status}`) : n.description, s = typeof i == "object" && !t.isValidElement(i) ? i : { message: i };
214
- this.create({
215
- id: r,
216
- type: "error",
217
- description: o,
218
- ...s
219
- });
220
- } else if (e instanceof Error) {
221
- a = !1;
222
- let i = typeof n.error == "function" ? await n.error(e) : n.error, o = typeof n.description == "function" ? await n.description(e) : n.description, s = typeof i == "object" && !t.isValidElement(i) ? i : { message: i };
223
- this.create({
224
- id: r,
225
- type: "error",
226
- description: o,
227
- ...s
228
- });
229
- } else if (n.success !== void 0) {
230
- a = !1;
231
- let i = typeof n.success == "function" ? await n.success(e) : n.success, o = typeof n.description == "function" ? await n.description(e) : n.description, s = typeof i == "object" && !t.isValidElement(i) ? i : { message: i };
232
- this.create({
233
- id: r,
234
- type: "success",
235
- description: o,
236
- ...s
237
- });
238
- }
239
- }).catch(async (e) => {
240
- if (o = ["reject", e], n.error !== void 0) {
241
- a = !1;
242
- let i = typeof n.error == "function" ? await n.error(e) : n.error, o = typeof n.description == "function" ? await n.description(e) : n.description, s = typeof i == "object" && !t.isValidElement(i) ? i : { message: i };
243
- this.create({
244
- id: r,
245
- type: "error",
246
- description: o,
247
- ...s
248
- });
249
- }
250
- }).finally(() => {
251
- a && (this.dismiss(r), r = void 0), n.finally == null || n.finally.call(n);
252
- }), c = () => new Promise((e, t) => s.then(() => o[0] === "reject" ? t(o[1]) : e(o[1])).catch(t));
253
- return typeof r != "string" && typeof r != "number" ? { unwrap: c } : Object.assign(r, { unwrap: c });
254
- }, this.custom = (e, t) => {
255
- let n = t?.id || _++;
256
- return this.create({
257
- jsx: e(n),
258
- id: n,
259
- ...t
260
- }), n;
261
- }, this.getActiveToasts = () => this.toasts.filter((e) => !this.dismissedToasts.has(e.id)), this.subscribers = [], this.toasts = [], this.dismissedToasts = /* @__PURE__ */ new Set();
262
- }
263
- }(), y = (e, t) => {
264
- let n = t?.id || _++;
265
- return v.addToast({
266
- title: e,
267
- ...t,
268
- id: n
269
- }), n;
270
- }, b = (e) => e && typeof e == "object" && "ok" in e && typeof e.ok == "boolean" && "status" in e && typeof e.status == "number", x = Object.assign(y, {
271
- success: v.success,
272
- info: v.info,
273
- warning: v.warning,
274
- error: v.error,
275
- custom: v.custom,
276
- message: v.message,
277
- promise: v.promise,
278
- dismiss: v.dismiss,
279
- loading: v.loading
280
- }, {
281
- getHistory: () => v.toasts,
282
- getToasts: () => v.getActiveToasts()
283
- });
284
- c("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");
285
- function S(e) {
286
- return e.label !== void 0;
287
- }
288
- var te = 3, C = "24px", w = "16px", T = 4e3, ne = 356, E = 14, re = 45, D = 200;
289
- function O(...e) {
290
- return e.filter(Boolean).join(" ");
291
- }
292
- function ie(e) {
293
- let [t, n] = e.split("-"), r = [];
294
- return t && r.push(t), n && r.push(n), r;
295
- }
296
- var k = (e) => {
297
- let { invert: n, toast: r, unstyled: i, interacting: a, setHeights: o, visibleToasts: s, heights: c, index: u, toasts: f, expanded: p, removeToast: m, defaultRichColors: h, closeButton: _, style: v, cancelButtonStyle: y, actionButtonStyle: b, className: x = "", descriptionClassName: te = "", duration: C, position: w, gap: ne, expandByDefault: E, classNames: k, icons: A, closeButtonAriaLabel: j = "Close toast" } = e, [M, N] = t.useState(null), [P, ae] = t.useState(null), [F, I] = t.useState(!1), [L, R] = t.useState(!1), [z, B] = t.useState(!1), [oe, se] = t.useState(!1), [ce, le] = t.useState(!1), [ue, V] = t.useState(0), [de, H] = t.useState(0), U = t.useRef(r.duration || C || T), fe = t.useRef(null), W = t.useRef(null), pe = u === 0, me = u + 1 <= s, G = r.type, K = r.dismissible !== !1, he = r.className || "", ge = r.descriptionClassName || "", q = t.useMemo(() => c.findIndex((e) => e.toastId === r.id) || 0, [c, r.id]), _e = t.useMemo(() => r.closeButton ?? _, [r.closeButton, _]), ve = t.useMemo(() => r.duration || C || T, [r.duration, C]), J = t.useRef(0), Y = t.useRef(0), X = t.useRef(0), Z = t.useRef(null), [ye, be] = w.split("-"), xe = t.useMemo(() => c.reduce((e, t, n) => n >= q ? e : e + t.height, 0), [c, q]), Se = g(), Ce = r.invert || n, Q = G === "loading";
298
- Y.current = t.useMemo(() => q * ne + xe, [q, xe]), t.useEffect(() => {
299
- U.current = ve;
300
- }, [ve]), t.useEffect(() => {
301
- I(!0);
302
- }, []), t.useEffect(() => {
303
- let e = W.current;
304
- if (e) {
305
- let t = e.getBoundingClientRect().height;
306
- return H(t), o((e) => [{
307
- toastId: r.id,
308
- height: t,
309
- position: r.position
310
- }, ...e]), () => o((e) => e.filter((e) => e.toastId !== r.id));
311
- }
312
- }, [o, r.id]), t.useLayoutEffect(() => {
313
- if (!F) return;
314
- let e = W.current, t = e.style.height;
315
- e.style.height = "auto";
316
- let n = e.getBoundingClientRect().height;
317
- e.style.height = t, H(n), o((e) => e.find((e) => e.toastId === r.id) ? e.map((e) => e.toastId === r.id ? {
318
- ...e,
319
- height: n
320
- } : e) : [{
321
- toastId: r.id,
322
- height: n,
323
- position: r.position
324
- }, ...e]);
325
- }, [
326
- F,
327
- r.title,
328
- r.description,
329
- o,
330
- r.id,
331
- r.jsx,
332
- r.action,
333
- r.cancel
334
- ]);
335
- let $ = t.useCallback(() => {
336
- R(!0), V(Y.current), o((e) => e.filter((e) => e.toastId !== r.id)), setTimeout(() => {
337
- m(r);
338
- }, D);
339
- }, [
340
- r,
341
- m,
342
- o,
343
- Y
344
- ]);
345
- t.useEffect(() => {
346
- if (r.promise && G === "loading" || r.duration === Infinity || r.type === "loading") return;
347
- let e;
348
- return p || a || Se ? (() => {
349
- if (X.current < J.current) {
350
- let e = (/* @__PURE__ */ new Date()).getTime() - J.current;
351
- U.current -= e;
352
- }
353
- X.current = (/* @__PURE__ */ new Date()).getTime();
354
- })() : U.current !== Infinity && (J.current = (/* @__PURE__ */ new Date()).getTime(), e = setTimeout(() => {
355
- r.onAutoClose == null || r.onAutoClose.call(r, r), $();
356
- }, U.current)), () => clearTimeout(e);
357
- }, [
358
- p,
359
- a,
360
- r,
361
- G,
362
- Se,
363
- $
364
- ]), t.useEffect(() => {
365
- r.delete && ($(), r.onDismiss == null || r.onDismiss.call(r, r));
366
- }, [$, r.delete]);
367
- function we() {
368
- return A?.loading ? /*#__PURE__*/ t.createElement("div", {
369
- className: O(k?.loader, r?.classNames?.loader, "sonner-loader"),
370
- "data-visible": G === "loading"
371
- }, A.loading) : /*#__PURE__*/ t.createElement(d, {
372
- className: O(k?.loader, r?.classNames?.loader),
373
- visible: G === "loading"
374
- });
375
- }
376
- let Te = r.icon || A?.[G] || l(G);
377
- return /*#__PURE__*/ t.createElement("li", {
378
- tabIndex: 0,
379
- ref: W,
380
- className: O(x, he, k?.toast, r?.classNames?.toast, k?.default, k?.[G], r?.classNames?.[G]),
381
- "data-sonner-toast": "",
382
- "data-rich-colors": r.richColors ?? h,
383
- "data-styled": !(r.jsx || r.unstyled || i),
384
- "data-mounted": F,
385
- "data-promise": !!r.promise,
386
- "data-swiped": ce,
387
- "data-removed": L,
388
- "data-visible": me,
389
- "data-y-position": ye,
390
- "data-x-position": be,
391
- "data-index": u,
392
- "data-front": pe,
393
- "data-swiping": z,
394
- "data-dismissible": K,
395
- "data-type": G,
396
- "data-invert": Ce,
397
- "data-swipe-out": oe,
398
- "data-swipe-direction": P,
399
- "data-expanded": !!(p || E && F),
400
- "data-testid": r.testId,
401
- style: {
402
- "--index": u,
403
- "--toasts-before": u,
404
- "--z-index": f.length - u,
405
- "--offset": `${L ? ue : Y.current}px`,
406
- "--initial-height": E ? "auto" : `${de}px`,
407
- ...v,
408
- ...r.style
409
- },
410
- onDragEnd: () => {
411
- B(!1), N(null), Z.current = null;
412
- },
413
- onPointerDown: (e) => {
414
- e.button !== 2 && (Q || !K || (fe.current = /* @__PURE__ */ new Date(), V(Y.current), e.target.setPointerCapture(e.pointerId), e.target.tagName !== "BUTTON" && (B(!0), Z.current = {
415
- x: e.clientX,
416
- y: e.clientY
417
- })));
418
- },
419
- onPointerUp: () => {
420
- if (oe || !K) return;
421
- Z.current = null;
422
- let e = Number(W.current?.style.getPropertyValue("--swipe-amount-x").replace("px", "") || 0), t = Number(W.current?.style.getPropertyValue("--swipe-amount-y").replace("px", "") || 0), n = (/* @__PURE__ */ new Date()).getTime() - fe.current?.getTime(), i = M === "x" ? e : t, a = Math.abs(i) / n;
423
- if (Math.abs(i) >= re || a > .11) {
424
- V(Y.current), r.onDismiss == null || r.onDismiss.call(r, r), ae(M === "x" ? e > 0 ? "right" : "left" : t > 0 ? "down" : "up"), $(), se(!0);
425
- return;
426
- } else {
427
- var o, s;
428
- (o = W.current) == null || o.style.setProperty("--swipe-amount-x", "0px"), (s = W.current) == null || s.style.setProperty("--swipe-amount-y", "0px");
429
- }
430
- le(!1), B(!1), N(null);
431
- },
432
- onPointerMove: (t) => {
433
- var n, r;
434
- if (!Z.current || !K || window.getSelection()?.toString().length > 0) return;
435
- let i = t.clientY - Z.current.y, a = t.clientX - Z.current.x, o = e.swipeDirections ?? ie(w);
436
- !M && (Math.abs(a) > 1 || Math.abs(i) > 1) && N(Math.abs(a) > Math.abs(i) ? "x" : "y");
437
- let s = {
438
- x: 0,
439
- y: 0
440
- }, c = (e) => 1 / (1.5 + Math.abs(e) / 20);
441
- if (M === "y") {
442
- if (o.includes("top") || o.includes("bottom")) if (o.includes("top") && i < 0 || o.includes("bottom") && i > 0) s.y = i;
443
- else {
444
- let e = i * c(i);
445
- s.y = Math.abs(e) < Math.abs(i) ? e : i;
446
- }
447
- } else if (M === "x" && (o.includes("left") || o.includes("right"))) if (o.includes("left") && a < 0 || o.includes("right") && a > 0) s.x = a;
448
- else {
449
- let e = a * c(a);
450
- s.x = Math.abs(e) < Math.abs(a) ? e : a;
451
- }
452
- (Math.abs(s.x) > 0 || Math.abs(s.y) > 0) && le(!0), (n = W.current) == null || n.style.setProperty("--swipe-amount-x", `${s.x}px`), (r = W.current) == null || r.style.setProperty("--swipe-amount-y", `${s.y}px`);
453
- }
454
- }, _e && !r.jsx && G !== "loading" ? /*#__PURE__*/ t.createElement("button", {
455
- "aria-label": j,
456
- "data-disabled": Q,
457
- "data-close-button": !0,
458
- onClick: Q || !K ? () => {} : () => {
459
- $(), r.onDismiss == null || r.onDismiss.call(r, r);
460
- },
461
- className: O(k?.closeButton, r?.classNames?.closeButton)
462
- }, A?.close ?? ee) : null, (G || r.icon || r.promise) && r.icon !== null && (A?.[G] !== null || r.icon) ? /*#__PURE__*/ t.createElement("div", {
463
- "data-icon": "",
464
- className: O(k?.icon, r?.classNames?.icon)
465
- }, r.promise || r.type === "loading" && !r.icon ? r.icon || we() : null, r.type === "loading" ? null : Te) : null, /*#__PURE__*/ t.createElement("div", {
466
- "data-content": "",
467
- className: O(k?.content, r?.classNames?.content)
468
- }, /*#__PURE__*/ t.createElement("div", {
469
- "data-title": "",
470
- className: O(k?.title, r?.classNames?.title)
471
- }, r.jsx ? r.jsx : typeof r.title == "function" ? r.title() : r.title), r.description ? /*#__PURE__*/ t.createElement("div", {
472
- "data-description": "",
473
- className: O(te, ge, k?.description, r?.classNames?.description)
474
- }, typeof r.description == "function" ? r.description() : r.description) : null), /*#__PURE__*/ t.isValidElement(r.cancel) ? r.cancel : r.cancel && S(r.cancel) ? /*#__PURE__*/ t.createElement("button", {
475
- "data-button": !0,
476
- "data-cancel": !0,
477
- style: r.cancelButtonStyle || y,
478
- onClick: (e) => {
479
- S(r.cancel) && K && (r.cancel.onClick == null || r.cancel.onClick.call(r.cancel, e), $());
480
- },
481
- className: O(k?.cancelButton, r?.classNames?.cancelButton)
482
- }, r.cancel.label) : null, /*#__PURE__*/ t.isValidElement(r.action) ? r.action : r.action && S(r.action) ? /*#__PURE__*/ t.createElement("button", {
483
- "data-button": !0,
484
- "data-action": !0,
485
- style: r.actionButtonStyle || b,
486
- onClick: (e) => {
487
- S(r.action) && (r.action.onClick == null || r.action.onClick.call(r.action, e), !e.defaultPrevented && $());
488
- },
489
- className: O(k?.actionButton, r?.classNames?.actionButton)
490
- }, r.action.label) : null);
491
- };
492
- function A() {
493
- if (typeof window > "u" || typeof document > "u") return "ltr";
494
- let e = document.documentElement.getAttribute("dir");
495
- return e === "auto" || !e ? window.getComputedStyle(document.documentElement).direction : e;
496
- }
497
- function j(e, t) {
498
- let n = {};
499
- return [e, t].forEach((e, t) => {
500
- let r = t === 1, i = r ? "--mobile-offset" : "--offset", a = r ? w : C;
501
- function o(e) {
502
- [
503
- "top",
504
- "right",
505
- "bottom",
506
- "left"
507
- ].forEach((t) => {
508
- n[`${i}-${t}`] = typeof e == "number" ? `${e}px` : e;
509
- });
510
- }
511
- typeof e == "number" || typeof e == "string" ? o(e) : typeof e == "object" ? [
512
- "top",
513
- "right",
514
- "bottom",
515
- "left"
516
- ].forEach((t) => {
517
- e[t] === void 0 ? n[`${i}-${t}`] = a : n[`${i}-${t}`] = typeof e[t] == "number" ? `${e[t]}px` : e[t];
518
- }) : o(a);
519
- }), n;
520
- }
521
- var M = /*#__PURE__*/ t.forwardRef(function(e, n) {
522
- let { id: i, invert: a, position: o = "bottom-right", hotkey: s = ["altKey", "KeyT"], expand: c, closeButton: l, className: u, offset: d, mobileOffset: f, theme: p = "light", richColors: m, duration: h, style: ee, visibleToasts: g = te, toastOptions: _, dir: y = A(), gap: b = E, icons: x, containerAriaLabel: S = "Notifications" } = e, [C, w] = t.useState([]), T = t.useMemo(() => i ? C.filter((e) => e.toasterId === i) : C.filter((e) => !e.toasterId), [C, i]), re = t.useMemo(() => Array.from(new Set([o].concat(T.filter((e) => e.position).map((e) => e.position)))), [T, o]), [D, O] = t.useState([]), [ie, M] = t.useState(!1), [N, P] = t.useState(!1), [ae, F] = t.useState(p === "system" ? typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : p), I = t.useRef(null), L = s.join("+").replace(/Key/g, "").replace(/Digit/g, ""), R = t.useRef(null), z = t.useRef(!1), B = t.useCallback((e) => {
523
- w((t) => (t.find((t) => t.id === e.id)?.delete || v.dismiss(e.id), t.filter(({ id: t }) => t !== e.id)));
524
- }, []);
525
- return t.useEffect(() => v.subscribe((e) => {
526
- if (e.dismiss) {
527
- requestAnimationFrame(() => {
528
- w((t) => t.map((t) => t.id === e.id ? {
529
- ...t,
530
- delete: !0
531
- } : t));
532
- });
533
- return;
534
- }
535
- setTimeout(() => {
536
- r.flushSync(() => {
537
- w((t) => {
538
- let n = t.findIndex((t) => t.id === e.id);
539
- return n === -1 ? [e, ...t] : [
540
- ...t.slice(0, n),
541
- {
542
- ...t[n],
543
- ...e
544
- },
545
- ...t.slice(n + 1)
546
- ];
547
- });
548
- });
549
- });
550
- }), [C]), t.useEffect(() => {
551
- if (p !== "system") {
552
- F(p);
553
- return;
554
- }
555
- if (p === "system" && (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? F("dark") : F("light")), typeof window > "u") return;
556
- let e = window.matchMedia("(prefers-color-scheme: dark)");
557
- try {
558
- e.addEventListener("change", ({ matches: e }) => {
559
- F(e ? "dark" : "light");
560
- });
561
- } catch {
562
- e.addListener(({ matches: e }) => {
563
- try {
564
- F(e ? "dark" : "light");
565
- } catch (e) {
566
- console.error(e);
567
- }
568
- });
569
- }
570
- }, [p]), t.useEffect(() => {
571
- C.length <= 1 && M(!1);
572
- }, [C]), t.useEffect(() => {
573
- let e = (e) => {
574
- if (s.every((t) => e[t] || e.code === t)) {
575
- var t;
576
- M(!0), (t = I.current) == null || t.focus();
577
- }
578
- e.code === "Escape" && (document.activeElement === I.current || I.current?.contains(document.activeElement)) && M(!1);
579
- };
580
- return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
581
- }, [s]), t.useEffect(() => {
582
- if (I.current) return () => {
583
- R.current && (R.current.focus({ preventScroll: !0 }), R.current = null, z.current = !1);
584
- };
585
- }, [I.current]), /*#__PURE__*/ t.createElement("section", {
586
- ref: n,
587
- "aria-label": `${S} ${L}`,
588
- tabIndex: -1,
589
- "aria-live": "polite",
590
- "aria-relevant": "additions text",
591
- "aria-atomic": "false",
592
- suppressHydrationWarning: !0
593
- }, re.map((n, r) => {
594
- let [i, o] = n.split("-");
595
- return T.length ? /*#__PURE__*/ t.createElement("ol", {
596
- key: n,
597
- dir: y === "auto" ? A() : y,
598
- tabIndex: -1,
599
- ref: I,
600
- className: u,
601
- "data-sonner-toaster": !0,
602
- "data-sonner-theme": ae,
603
- "data-y-position": i,
604
- "data-x-position": o,
605
- style: {
606
- "--front-toast-height": `${D[0]?.height || 0}px`,
607
- "--width": `${ne}px`,
608
- "--gap": `${b}px`,
609
- ...ee,
610
- ...j(d, f)
611
- },
612
- onBlur: (e) => {
613
- z.current && !e.currentTarget.contains(e.relatedTarget) && (z.current = !1, R.current &&= (R.current.focus({ preventScroll: !0 }), null));
614
- },
615
- onFocus: (e) => {
616
- e.target instanceof HTMLElement && e.target.dataset.dismissible === "false" || z.current || (z.current = !0, R.current = e.relatedTarget);
617
- },
618
- onMouseEnter: () => M(!0),
619
- onMouseMove: () => M(!0),
620
- onMouseLeave: () => {
621
- N || M(!1);
622
- },
623
- onDragEnd: () => M(!1),
624
- onPointerDown: (e) => {
625
- e.target instanceof HTMLElement && e.target.dataset.dismissible === "false" || P(!0);
626
- },
627
- onPointerUp: () => P(!1)
628
- }, T.filter((e) => !e.position && r === 0 || e.position === n).map((r, i) => /*#__PURE__*/ t.createElement(k, {
629
- key: r.id,
630
- icons: x,
631
- index: i,
632
- toast: r,
633
- defaultRichColors: m,
634
- duration: _?.duration ?? h,
635
- className: _?.className,
636
- descriptionClassName: _?.descriptionClassName,
637
- invert: a,
638
- visibleToasts: g,
639
- closeButton: _?.closeButton ?? l,
640
- interacting: N,
641
- position: n,
642
- style: _?.style,
643
- unstyled: _?.unstyled,
644
- classNames: _?.classNames,
645
- cancelButtonStyle: _?.cancelButtonStyle,
646
- actionButtonStyle: _?.actionButtonStyle,
647
- closeButtonAriaLabel: _?.closeButtonAriaLabel,
648
- removeToast: B,
649
- toasts: T.filter((e) => e.position == r.position),
650
- heights: D.filter((e) => e.position == r.position),
651
- setHeights: O,
652
- expandByDefault: c,
653
- gap: b,
654
- expanded: ie,
655
- swipeDirections: e.swipeDirections
656
- }))) : null;
657
- }));
658
- }), N = ({ ...e }) => {
659
- let { theme: t = "system" } = s();
660
- return typeof window > "u" ? null : /* @__PURE__ */ n(M, {
661
- className: "toaster group flex justify-center",
662
- duration: 2e3,
663
- mobileOffset: {
664
- top: 25,
665
- left: 20,
666
- right: 20,
667
- bottom: 25
668
- },
669
- position: "bottom-center",
670
- theme: t,
671
- toastOptions: {
672
- unstyled: !0,
673
- className: "w-fit",
674
- classNames: {
675
- toast: "flex bg-gray-900/80 rounded-[15px] text-white gap-2.5 justify-between items-center p-2.5 pl-3.75 pb-2 min-h-[55px]",
676
- title: "typo-t3",
677
- actionButton: "bg-gray-800 text-white typo-t4 rounded-[8px] px-[10px] py-[9.5px] text-white grid place-items-center active:bg-gray-500"
678
- }
679
- },
680
- visibleToasts: 1,
681
- ...e
682
- });
683
- };
684
- //#endregion
685
- export { x as n, N as t };