loopable-cli 0.1.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 (133) hide show
  1. package/.output/nitro.json +17 -0
  2. package/.output/public/apple-touch-icon.png +0 -0
  3. package/.output/public/assets/_connectorId-BWjYn5tm.js +1 -0
  4. package/.output/public/assets/_loopId-Ds4RkyEc.js +1 -0
  5. package/.output/public/assets/_taskId-BOzICXDf.js +1 -0
  6. package/.output/public/assets/alert-Bn9-Zm0l.js +1 -0
  7. package/.output/public/assets/arrow-left-BF9juV9T.js +1 -0
  8. package/.output/public/assets/arrow-right-CzqvnOY1.js +1 -0
  9. package/.output/public/assets/button-HCY6DCY-.js +1 -0
  10. package/.output/public/assets/connection-status-CYZB8kLy.js +1 -0
  11. package/.output/public/assets/connector-icon-BZ_MUJV_.js +1 -0
  12. package/.output/public/assets/connectors-BvzttfSu.js +1 -0
  13. package/.output/public/assets/connectors-DdJNwRN_.js +1 -0
  14. package/.output/public/assets/external-link-D46X-bXa.js +1 -0
  15. package/.output/public/assets/gaps-D-I6xiDc.js +1 -0
  16. package/.output/public/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
  17. package/.output/public/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
  18. package/.output/public/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
  19. package/.output/public/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
  20. package/.output/public/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
  21. package/.output/public/assets/inbox-BUUu9xxE.js +1 -0
  22. package/.output/public/assets/index-ztzex0FN.js +10 -0
  23. package/.output/public/assets/loader-CcBl2u8m.js +1 -0
  24. package/.output/public/assets/loop-form-dB3CLcZb.js +1 -0
  25. package/.output/public/assets/loops-DRunQrxL.js +1 -0
  26. package/.output/public/assets/loops-oSdqMd29.js +1 -0
  27. package/.output/public/assets/manifests-DNMqf7Vi.js +7 -0
  28. package/.output/public/assets/new-uyFxVjuB.js +1 -0
  29. package/.output/public/assets/preload-helper-ORbuV86A.js +3 -0
  30. package/.output/public/assets/runners-DSU3r5Ww.js +1 -0
  31. package/.output/public/assets/setting-fields-ixkpdBb-.js +3 -0
  32. package/.output/public/assets/styles-DZL5V1o7.css +2 -0
  33. package/.output/public/assets/switch-d5ummmHY.js +1 -0
  34. package/.output/public/assets/task-list-BpOStt9v.js +1 -0
  35. package/.output/public/assets/tasks-B8MsKgic.js +1 -0
  36. package/.output/public/assets/trash-2-D6u6NpzO.js +1 -0
  37. package/.output/public/favicon.svg +9 -0
  38. package/.output/server/_chunks/ssr-renderer.mjs +26 -0
  39. package/.output/server/_connectorId-8nb5yOzG.mjs +421 -0
  40. package/.output/server/_libs/@base-ui/react+[...].mjs +12841 -0
  41. package/.output/server/_libs/@tanstack/react-router+[...].mjs +14349 -0
  42. package/.output/server/_libs/class-variance-authority+clsx.mjs +69 -0
  43. package/.output/server/_libs/dijkstrajs.mjs +118 -0
  44. package/.output/server/_libs/drizzle-orm.mjs +4349 -0
  45. package/.output/server/_libs/h3+rou3+srvx.mjs +1361 -0
  46. package/.output/server/_libs/lucide-react.mjs +911 -0
  47. package/.output/server/_libs/next-themes.mjs +53 -0
  48. package/.output/server/_libs/pngjs.mjs +1680 -0
  49. package/.output/server/_libs/qrcode.mjs +2583 -0
  50. package/.output/server/_libs/sonner.mjs +955 -0
  51. package/.output/server/_libs/tailwind-merge.mjs +3380 -0
  52. package/.output/server/_libs/tanstack__history.mjs +341 -0
  53. package/.output/server/_libs/ufo.mjs +64 -0
  54. package/.output/server/_loopId-BsUL1SeL.mjs +272 -0
  55. package/.output/server/_runtime.mjs +35 -0
  56. package/.output/server/_ssr/access-zIl15o8y.mjs +42 -0
  57. package/.output/server/_ssr/agents-Btql102J.mjs +657 -0
  58. package/.output/server/_ssr/agents-DAOZPgO2.mjs +76 -0
  59. package/.output/server/_ssr/alert-NEiOCTOl.mjs +37 -0
  60. package/.output/server/_ssr/callback-CUINvl7M.mjs +62 -0
  61. package/.output/server/_ssr/client-CKkOfh-s.mjs +335 -0
  62. package/.output/server/_ssr/connection-status-Bi5peUAk.mjs +31 -0
  63. package/.output/server/_ssr/connections-qnw2GVlP.mjs +2542 -0
  64. package/.output/server/_ssr/connector-icon-DZXQLLFo.mjs +37 -0
  65. package/.output/server/_ssr/connectors-BHNwuIMj.mjs +106 -0
  66. package/.output/server/_ssr/connectors-C28g0i4c.mjs +83 -0
  67. package/.output/server/_ssr/createServerRpc-DPDrnFdH.mjs +12 -0
  68. package/.output/server/_ssr/empty-plugin-adapters-BJ4m9L8g.mjs +5 -0
  69. package/.output/server/_ssr/gaps-RAFSXLZf.mjs +53 -0
  70. package/.output/server/_ssr/inbox-k5zHergU.mjs +35 -0
  71. package/.output/server/_ssr/loop-form-DlObSewZ.mjs +412 -0
  72. package/.output/server/_ssr/loops-APFcP0y6.mjs +311 -0
  73. package/.output/server/_ssr/loops-xt2Bn7_q.mjs +222 -0
  74. package/.output/server/_ssr/new-DfKyd2Wa.mjs +169 -0
  75. package/.output/server/_ssr/router-3WmpE5b_.mjs +1553 -0
  76. package/.output/server/_ssr/runners-By-mwc3F.mjs +32 -0
  77. package/.output/server/_ssr/runners-DI_NxpHC.mjs +116 -0
  78. package/.output/server/_ssr/runners-DtXs4Q8a.mjs +106 -0
  79. package/.output/server/_ssr/secrets-Hqti-niS.mjs +199 -0
  80. package/.output/server/_ssr/setting-fields-8vKFj4df.mjs +92 -0
  81. package/.output/server/_ssr/ssr.mjs +6605 -0
  82. package/.output/server/_ssr/start-Bdc2GJUI.mjs +51 -0
  83. package/.output/server/_ssr/switch-ReNglgH6.mjs +18 -0
  84. package/.output/server/_ssr/task-list-CUITIqkb.mjs +186 -0
  85. package/.output/server/_ssr/tasks-SAjNovX6.mjs +110 -0
  86. package/.output/server/_ssr/tasks-vcoodp_D.mjs +533 -0
  87. package/.output/server/_tanstack-start-manifest_v-C0cP5F0M.mjs +125 -0
  88. package/.output/server/_taskId-CXS3lod0.mjs +249 -0
  89. package/.output/server/index.mjs +541 -0
  90. package/README.md +81 -0
  91. package/dist/cli.mjs +165 -0
  92. package/dist/dispatcher.mjs +9871 -0
  93. package/dist/runner.mjs +657 -0
  94. package/drizzle/0000_cold_demogoblin.sql +29 -0
  95. package/drizzle/0001_fancy_blonde_phantom.sql +13 -0
  96. package/drizzle/0002_spooky_smiling_tiger.sql +16 -0
  97. package/drizzle/0003_small_golden_guardian.sql +25 -0
  98. package/drizzle/0004_wonderful_thunderbolts.sql +39 -0
  99. package/drizzle/0005_named_workflows.sql +7 -0
  100. package/drizzle/0006_signals.sql +18 -0
  101. package/drizzle/0007_review_comments.sql +1 -0
  102. package/drizzle/0008_held_signals.sql +1 -0
  103. package/drizzle/0009_work_item_ref.sql +58 -0
  104. package/drizzle/0010_signal_payload.sql +2 -0
  105. package/drizzle/0011_rule_poll_cursor.sql +1 -0
  106. package/drizzle/0012_loops.sql +63 -0
  107. package/drizzle/0013_loop_owns_action_and_prompt.sql +154 -0
  108. package/drizzle/0014_loop_poll_every.sql +4 -0
  109. package/drizzle/0015_machines.sql +10 -0
  110. package/drizzle/0016_task_machine.sql +1 -0
  111. package/drizzle/0017_loop_machine.sql +1 -0
  112. package/drizzle/0018_runners.sql +1 -0
  113. package/drizzle/0019_task_runner.sql +1 -0
  114. package/drizzle/0020_loop_runner.sql +1 -0
  115. package/drizzle/0021_drop_runner_kind.sql +1 -0
  116. package/drizzle/0022_drop_loop_runner.sql +1 -0
  117. package/drizzle/0023_shared_host.sql +6 -0
  118. package/drizzle/meta/0000_snapshot.json +206 -0
  119. package/drizzle/meta/0001_snapshot.json +284 -0
  120. package/drizzle/meta/0002_snapshot.json +390 -0
  121. package/drizzle/meta/0003_snapshot.json +566 -0
  122. package/drizzle/meta/0004_snapshot.json +633 -0
  123. package/drizzle/meta/0005_snapshot.json +626 -0
  124. package/drizzle/meta/0006_snapshot.json +752 -0
  125. package/drizzle/meta/0007_snapshot.json +759 -0
  126. package/drizzle/meta/0008_snapshot.json +766 -0
  127. package/drizzle/meta/0009_snapshot.json +752 -0
  128. package/drizzle/meta/0010_snapshot.json +766 -0
  129. package/drizzle/meta/0011_snapshot.json +773 -0
  130. package/drizzle/meta/0012_snapshot.json +773 -0
  131. package/drizzle/meta/0013_snapshot.json +817 -0
  132. package/drizzle/meta/_journal.json +174 -0
  133. package/package.json +88 -0
@@ -0,0 +1,955 @@
1
+ import { i as __toESM } from "../_runtime.mjs";
2
+ import { V as require_react_dom, W as require_react } from "./@base-ui/react+[...].mjs";
3
+ //#region node_modules/.pnpm/sonner@2.0.8_@types+react@19.2.18_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/sonner/dist/index.mjs
4
+ var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
5
+ var import_react_dom = /* @__PURE__ */ __toESM(require_react_dom(), 1);
6
+ function __insertCSS(code) {
7
+ if (!code || typeof document == "undefined") return;
8
+ let head = document.head || document.getElementsByTagName("head")[0];
9
+ let style = document.createElement("style");
10
+ style.type = "text/css";
11
+ head.appendChild(style);
12
+ style.styleSheet ? style.styleSheet.cssText = code : style.appendChild(document.createTextNode(code));
13
+ }
14
+ var getAsset = (type) => {
15
+ switch (type) {
16
+ case "success": return SuccessIcon;
17
+ case "info": return InfoIcon;
18
+ case "warning": return WarningIcon;
19
+ case "error": return ErrorIcon;
20
+ default: return null;
21
+ }
22
+ };
23
+ var bars = Array(12).fill(0);
24
+ var Loader = ({ visible, className }) => {
25
+ return /*#__PURE__*/ import_react.createElement("div", {
26
+ className: ["sonner-loading-wrapper", className].filter(Boolean).join(" "),
27
+ "data-visible": visible
28
+ }, /*#__PURE__*/ import_react.createElement("div", { className: "sonner-spinner" }, bars.map((_, i) => /*#__PURE__*/ import_react.createElement("div", {
29
+ className: "sonner-loading-bar",
30
+ key: `spinner-bar-${i}`
31
+ }))));
32
+ };
33
+ var SuccessIcon = /*#__PURE__*/ import_react.createElement("svg", {
34
+ xmlns: "http://www.w3.org/2000/svg",
35
+ viewBox: "0 0 20 20",
36
+ fill: "currentColor",
37
+ height: "20",
38
+ width: "20",
39
+ "aria-hidden": "true"
40
+ }, /*#__PURE__*/ import_react.createElement("path", {
41
+ fillRule: "evenodd",
42
+ 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",
43
+ clipRule: "evenodd"
44
+ }));
45
+ var WarningIcon = /*#__PURE__*/ import_react.createElement("svg", {
46
+ xmlns: "http://www.w3.org/2000/svg",
47
+ viewBox: "0 0 24 24",
48
+ fill: "currentColor",
49
+ height: "20",
50
+ width: "20",
51
+ "aria-hidden": "true"
52
+ }, /*#__PURE__*/ import_react.createElement("path", {
53
+ fillRule: "evenodd",
54
+ 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",
55
+ clipRule: "evenodd"
56
+ }));
57
+ var InfoIcon = /*#__PURE__*/ import_react.createElement("svg", {
58
+ xmlns: "http://www.w3.org/2000/svg",
59
+ viewBox: "0 0 20 20",
60
+ fill: "currentColor",
61
+ height: "20",
62
+ width: "20",
63
+ "aria-hidden": "true"
64
+ }, /*#__PURE__*/ import_react.createElement("path", {
65
+ fillRule: "evenodd",
66
+ 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",
67
+ clipRule: "evenodd"
68
+ }));
69
+ var ErrorIcon = /*#__PURE__*/ import_react.createElement("svg", {
70
+ xmlns: "http://www.w3.org/2000/svg",
71
+ viewBox: "0 0 20 20",
72
+ fill: "currentColor",
73
+ height: "20",
74
+ width: "20",
75
+ "aria-hidden": "true"
76
+ }, /*#__PURE__*/ import_react.createElement("path", {
77
+ fillRule: "evenodd",
78
+ 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",
79
+ clipRule: "evenodd"
80
+ }));
81
+ var CloseIcon = /*#__PURE__*/ import_react.createElement("svg", {
82
+ xmlns: "http://www.w3.org/2000/svg",
83
+ width: "12",
84
+ height: "12",
85
+ viewBox: "0 0 24 24",
86
+ fill: "none",
87
+ stroke: "currentColor",
88
+ strokeWidth: "1.5",
89
+ strokeLinecap: "round",
90
+ strokeLinejoin: "round",
91
+ "aria-hidden": "true"
92
+ }, /*#__PURE__*/ import_react.createElement("line", {
93
+ x1: "18",
94
+ y1: "6",
95
+ x2: "6",
96
+ y2: "18"
97
+ }), /*#__PURE__*/ import_react.createElement("line", {
98
+ x1: "6",
99
+ y1: "6",
100
+ x2: "18",
101
+ y2: "18"
102
+ }));
103
+ var useIsDocumentHidden = () => {
104
+ const [isDocumentHidden, setIsDocumentHidden] = import_react.useState(document.hidden);
105
+ import_react.useEffect(() => {
106
+ const callback = () => {
107
+ setIsDocumentHidden(document.hidden);
108
+ };
109
+ document.addEventListener("visibilitychange", callback);
110
+ return () => document.removeEventListener("visibilitychange", callback);
111
+ }, []);
112
+ return isDocumentHidden;
113
+ };
114
+ var toastsCounter = 1;
115
+ var MAX_HISTORY_SIZE = 100;
116
+ var getToastId = (data) => {
117
+ var _data_id;
118
+ return typeof (data == null ? void 0 : data.id) === "number" || (data == null ? void 0 : (_data_id = data.id) == null ? void 0 : _data_id.length) > 0 ? data.id : toastsCounter++;
119
+ };
120
+ var Observer = class {
121
+ constructor() {
122
+ this.subscribe = (subscriber) => {
123
+ this.subscribers.push(subscriber);
124
+ this.getActiveToasts().forEach((toast) => subscriber(toast));
125
+ return () => {
126
+ const index = this.subscribers.indexOf(subscriber);
127
+ this.subscribers.splice(index, 1);
128
+ };
129
+ };
130
+ this.publish = (data) => {
131
+ this.subscribers.forEach((subscriber) => subscriber(data));
132
+ };
133
+ this.addToast = (data) => {
134
+ this.publish(data);
135
+ this.toasts = [...this.toasts, data];
136
+ this.trimHistory();
137
+ };
138
+ this.trimHistory = () => {
139
+ let toRemove = this.toasts.length - MAX_HISTORY_SIZE;
140
+ if (toRemove <= 0) return;
141
+ this.toasts = this.toasts.filter((toast) => {
142
+ if (toRemove > 0 && this.dismissedToasts.has(toast.id)) {
143
+ this.dismissedToasts.delete(toast.id);
144
+ toRemove--;
145
+ return false;
146
+ }
147
+ return true;
148
+ });
149
+ };
150
+ this.create = (data) => {
151
+ const { message, ...rest } = data;
152
+ const id = getToastId(data);
153
+ const pendingDismissal = this.pendingDismissals.get(id);
154
+ if (pendingDismissal !== void 0) {
155
+ cancelAnimationFrame(pendingDismissal);
156
+ this.pendingDismissals.delete(id);
157
+ this.dismissedToasts.delete(id);
158
+ }
159
+ const wasDismissed = this.dismissedToasts.has(id);
160
+ const dismissible = data.dismissible === void 0 ? true : data.dismissible;
161
+ if (wasDismissed) {
162
+ this.dismissedToasts.delete(id);
163
+ this.toasts = this.toasts.filter((toast) => toast.id !== id);
164
+ }
165
+ if (wasDismissed ? void 0 : this.toasts.find((toast) => {
166
+ return toast.id === id;
167
+ })) this.toasts = this.toasts.map((toast) => {
168
+ if (toast.id === id) {
169
+ this.publish({
170
+ ...toast,
171
+ ...data,
172
+ id,
173
+ title: message
174
+ });
175
+ return {
176
+ ...toast,
177
+ ...data,
178
+ id,
179
+ dismissible,
180
+ title: message
181
+ };
182
+ }
183
+ return toast;
184
+ });
185
+ else this.addToast({
186
+ title: message,
187
+ ...rest,
188
+ dismissible,
189
+ id
190
+ });
191
+ return id;
192
+ };
193
+ this.dismiss = (id) => {
194
+ if (id === void 0 || id === null) {
195
+ this.getActiveToasts().forEach((toast) => {
196
+ this.dismissedToasts.add(toast.id);
197
+ this.subscribers.forEach((subscriber) => subscriber({
198
+ id: toast.id,
199
+ dismiss: true
200
+ }));
201
+ });
202
+ return id;
203
+ }
204
+ this.dismissedToasts.add(id);
205
+ const alreadyPending = this.pendingDismissals.get(id);
206
+ if (alreadyPending !== void 0) cancelAnimationFrame(alreadyPending);
207
+ this.pendingDismissals.set(id, requestAnimationFrame(() => {
208
+ this.pendingDismissals.delete(id);
209
+ this.subscribers.forEach((subscriber) => subscriber({
210
+ id,
211
+ dismiss: true
212
+ }));
213
+ }));
214
+ return id;
215
+ };
216
+ this.message = (message, data) => {
217
+ return this.create({
218
+ ...data,
219
+ message,
220
+ type: void 0
221
+ });
222
+ };
223
+ this.error = (message, data) => {
224
+ return this.create({
225
+ ...data,
226
+ message,
227
+ type: "error"
228
+ });
229
+ };
230
+ this.success = (message, data) => {
231
+ return this.create({
232
+ ...data,
233
+ type: "success",
234
+ message
235
+ });
236
+ };
237
+ this.info = (message, data) => {
238
+ return this.create({
239
+ ...data,
240
+ type: "info",
241
+ message
242
+ });
243
+ };
244
+ this.warning = (message, data) => {
245
+ return this.create({
246
+ ...data,
247
+ type: "warning",
248
+ message
249
+ });
250
+ };
251
+ this.loading = (message, data) => {
252
+ return this.create({
253
+ ...data,
254
+ type: "loading",
255
+ message
256
+ });
257
+ };
258
+ this.promise = (promise, data) => {
259
+ if (!data) return;
260
+ let id = void 0;
261
+ if (data.loading !== void 0) id = this.create({
262
+ ...data,
263
+ promise,
264
+ type: "loading",
265
+ message: data.loading,
266
+ description: typeof data.description !== "function" ? data.description : void 0
267
+ });
268
+ const p = Promise.resolve(promise instanceof Function ? promise() : promise);
269
+ let shouldDismiss = id !== void 0;
270
+ let result;
271
+ const originalPromise = p.then(async (response) => {
272
+ result = ["resolve", response];
273
+ if (import_react.isValidElement(response)) {
274
+ shouldDismiss = false;
275
+ this.create({
276
+ id,
277
+ type: "default",
278
+ message: response
279
+ });
280
+ } else if (isHttpResponse(response) && !response.ok) {
281
+ shouldDismiss = false;
282
+ const promiseData = typeof data.error === "function" ? await data.error(`HTTP error! status: ${response.status}`) : data.error;
283
+ const description = typeof data.description === "function" ? await data.description(`HTTP error! status: ${response.status}`) : data.description;
284
+ const toastSettings = typeof promiseData === "object" && !import_react.isValidElement(promiseData) ? promiseData : { message: promiseData };
285
+ this.create({
286
+ id,
287
+ type: "error",
288
+ description,
289
+ ...toastSettings
290
+ });
291
+ } else if (response instanceof Error) {
292
+ shouldDismiss = false;
293
+ const promiseData = typeof data.error === "function" ? await data.error(response) : data.error;
294
+ const description = typeof data.description === "function" ? await data.description(response) : data.description;
295
+ const toastSettings = typeof promiseData === "object" && !import_react.isValidElement(promiseData) ? promiseData : { message: promiseData };
296
+ this.create({
297
+ id,
298
+ type: "error",
299
+ description,
300
+ ...toastSettings
301
+ });
302
+ } else if (data.success !== void 0) {
303
+ shouldDismiss = false;
304
+ const promiseData = typeof data.success === "function" ? await data.success(response) : data.success;
305
+ const description = typeof data.description === "function" ? await data.description(response) : data.description;
306
+ const toastSettings = typeof promiseData === "object" && !import_react.isValidElement(promiseData) ? promiseData : { message: promiseData };
307
+ this.create({
308
+ id,
309
+ type: "success",
310
+ description,
311
+ ...toastSettings
312
+ });
313
+ }
314
+ }).catch(async (error) => {
315
+ result = ["reject", error];
316
+ if (data.error !== void 0) {
317
+ shouldDismiss = false;
318
+ const promiseData = typeof data.error === "function" ? await data.error(error) : data.error;
319
+ const description = typeof data.description === "function" ? await data.description(error) : data.description;
320
+ const toastSettings = typeof promiseData === "object" && !import_react.isValidElement(promiseData) ? promiseData : { message: promiseData };
321
+ this.create({
322
+ id,
323
+ type: "error",
324
+ description,
325
+ ...toastSettings
326
+ });
327
+ }
328
+ }).finally(() => {
329
+ if (shouldDismiss) {
330
+ this.dismiss(id);
331
+ id = void 0;
332
+ }
333
+ data.finally == null || data.finally.call(data);
334
+ });
335
+ const unwrap = () => new Promise((resolve, reject) => originalPromise.then(() => result[0] === "reject" ? reject(result[1]) : resolve(result[1])).catch(reject));
336
+ if (typeof id !== "string" && typeof id !== "number") return { unwrap };
337
+ else return Object.assign(id, { unwrap });
338
+ };
339
+ this.custom = (jsx, data) => {
340
+ const id = getToastId(data);
341
+ this.create({
342
+ ...data,
343
+ jsx: jsx(id),
344
+ id,
345
+ type: void 0
346
+ });
347
+ return id;
348
+ };
349
+ this.getActiveToasts = () => {
350
+ return this.toasts.filter((toast) => !this.dismissedToasts.has(toast.id));
351
+ };
352
+ this.subscribers = [];
353
+ this.toasts = [];
354
+ this.dismissedToasts = /* @__PURE__ */ new Set();
355
+ this.pendingDismissals = /* @__PURE__ */ new Map();
356
+ }
357
+ };
358
+ var ToastState = new Observer();
359
+ var toastFunction = (message, data) => {
360
+ return ToastState.message(message, data);
361
+ };
362
+ var isHttpResponse = (data) => {
363
+ return data && typeof data === "object" && "ok" in data && typeof data.ok === "boolean" && "status" in data && typeof data.status === "number";
364
+ };
365
+ var basicToast = toastFunction;
366
+ var getHistory = () => ToastState.toasts;
367
+ var getToasts = () => ToastState.getActiveToasts();
368
+ var toast = Object.assign(basicToast, {
369
+ success: ToastState.success,
370
+ info: ToastState.info,
371
+ warning: ToastState.warning,
372
+ error: ToastState.error,
373
+ custom: ToastState.custom,
374
+ message: ToastState.message,
375
+ promise: ToastState.promise,
376
+ dismiss: ToastState.dismiss,
377
+ loading: ToastState.loading
378
+ }, {
379
+ getHistory,
380
+ getToasts
381
+ });
382
+ __insertCSS("[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;flex:1;min-width:0}[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(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);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]{-webkit-user-select:none;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%)}");
383
+ function isAction(action) {
384
+ return action.label !== void 0;
385
+ }
386
+ var VISIBLE_TOASTS_AMOUNT = 3;
387
+ var VIEWPORT_OFFSET = "24px";
388
+ var MOBILE_VIEWPORT_OFFSET = "16px";
389
+ var TOAST_LIFETIME = 4e3;
390
+ var TOAST_WIDTH = 356;
391
+ var GAP = 14;
392
+ var SWIPE_THRESHOLD = 45;
393
+ var TIME_BEFORE_UNMOUNT = 200;
394
+ function cn(...classes) {
395
+ return classes.filter(Boolean).join(" ");
396
+ }
397
+ function getDefaultSwipeDirections(position) {
398
+ const [y, x] = position.split("-");
399
+ const directions = [];
400
+ if (y) directions.push(y);
401
+ if (x) directions.push(x);
402
+ return directions;
403
+ }
404
+ var Toast = (props) => {
405
+ var _toast_classNames, _toast_classNames1, _toast_classNames2, _toast_classNames3, _toast_classNames4, _toast_classNames5, _toast_classNames6, _toast_classNames7, _toast_classNames8;
406
+ const { invert: ToasterInvert, toast, unstyled, interacting, setHeights, visibleToasts, heights, index, toasts, expanded, removeToast, defaultRichColors, closeButton: closeButtonFromToaster, style, cancelButtonStyle, actionButtonStyle, className = "", descriptionClassName = "", duration: durationFromToaster, position, gap, expandByDefault, classNames, icons, closeButtonAriaLabel = "Close toast" } = props;
407
+ const [swipeDirection, setSwipeDirection] = import_react.useState(null);
408
+ const [swipeOutDirection, setSwipeOutDirection] = import_react.useState(null);
409
+ const [mounted, setMounted] = import_react.useState(false);
410
+ const [removed, setRemoved] = import_react.useState(false);
411
+ const [swiping, setSwiping] = import_react.useState(false);
412
+ const [swipeOut, setSwipeOut] = import_react.useState(false);
413
+ const [isSwiped, setIsSwiped] = import_react.useState(false);
414
+ const [offsetBeforeRemove, setOffsetBeforeRemove] = import_react.useState(0);
415
+ const [initialHeight, setInitialHeight] = import_react.useState(0);
416
+ const remainingTime = import_react.useRef(toast.duration || durationFromToaster || TOAST_LIFETIME);
417
+ const dragStartTime = import_react.useRef(null);
418
+ const toastRef = import_react.useRef(null);
419
+ const isFront = index === 0;
420
+ const isVisible = index + 1 <= visibleToasts;
421
+ const toastType = toast.type;
422
+ const toastTypeKey = toastType != null ? toastType : "default";
423
+ const dismissible = toast.dismissible !== false;
424
+ const toastClassname = toast.className || "";
425
+ const toastDescriptionClassname = toast.descriptionClassName || "";
426
+ const heightIndex = import_react.useMemo(() => heights.findIndex((height) => height.toastId === toast.id) || 0, [heights, toast.id]);
427
+ const closeButton = import_react.useMemo(() => {
428
+ var _toast_closeButton;
429
+ return (_toast_closeButton = toast.closeButton) != null ? _toast_closeButton : closeButtonFromToaster;
430
+ }, [toast.closeButton, closeButtonFromToaster]);
431
+ const duration = import_react.useMemo(() => toast.duration || durationFromToaster || TOAST_LIFETIME, [toast.duration, durationFromToaster]);
432
+ const closeTimerStartTimeRef = import_react.useRef(0);
433
+ const offset = import_react.useRef(0);
434
+ const lastCloseTimerStartTimeRef = import_react.useRef(0);
435
+ const pointerStartRef = import_react.useRef(null);
436
+ const [y, x] = position.split("-");
437
+ const toastsHeightBefore = import_react.useMemo(() => {
438
+ return heights.reduce((prev, curr, reducerIndex) => {
439
+ if (reducerIndex >= heightIndex) return prev;
440
+ return prev + curr.height;
441
+ }, 0);
442
+ }, [heights, heightIndex]);
443
+ const isDocumentHidden = useIsDocumentHidden();
444
+ const swipeDirections = import_react.useMemo(() => {
445
+ var _props_swipeDirections;
446
+ return (_props_swipeDirections = props.swipeDirections) != null ? _props_swipeDirections : getDefaultSwipeDirections(position);
447
+ }, [props.swipeDirections, position]);
448
+ const invert = toast.invert || ToasterInvert;
449
+ const disabled = toastType === "loading";
450
+ offset.current = import_react.useMemo(() => heightIndex * gap + toastsHeightBefore, [heightIndex, toastsHeightBefore]);
451
+ import_react.useEffect(() => {
452
+ remainingTime.current = duration;
453
+ }, [duration]);
454
+ import_react.useEffect(() => {
455
+ setMounted(true);
456
+ }, []);
457
+ import_react.useEffect(() => {
458
+ const toastNode = toastRef.current;
459
+ if (toastNode) {
460
+ const height = toastNode.getBoundingClientRect().height;
461
+ setInitialHeight(height);
462
+ setHeights((h) => [{
463
+ toastId: toast.id,
464
+ height,
465
+ position: toast.position
466
+ }, ...h]);
467
+ return () => setHeights((h) => h.filter((height) => height.toastId !== toast.id));
468
+ }
469
+ }, [setHeights, toast.id]);
470
+ import_react.useLayoutEffect(() => {
471
+ if (!mounted) return;
472
+ const toastNode = toastRef.current;
473
+ const originalHeight = toastNode.style.height;
474
+ toastNode.style.height = "auto";
475
+ const newHeight = toastNode.getBoundingClientRect().height;
476
+ toastNode.style.height = originalHeight;
477
+ setInitialHeight(newHeight);
478
+ setHeights((heights) => {
479
+ if (!heights.find((height) => height.toastId === toast.id)) return [{
480
+ toastId: toast.id,
481
+ height: newHeight,
482
+ position: toast.position
483
+ }, ...heights];
484
+ else return heights.map((height) => height.toastId === toast.id ? {
485
+ ...height,
486
+ height: newHeight
487
+ } : height);
488
+ });
489
+ }, [
490
+ mounted,
491
+ toast.title,
492
+ toast.description,
493
+ setHeights,
494
+ toast.id,
495
+ toast.jsx,
496
+ toast.action,
497
+ toast.cancel
498
+ ]);
499
+ const deleteToast = import_react.useCallback(() => {
500
+ setRemoved(true);
501
+ setOffsetBeforeRemove(offset.current);
502
+ setHeights((h) => h.filter((height) => height.toastId !== toast.id));
503
+ setTimeout(() => {
504
+ removeToast(toast);
505
+ }, TIME_BEFORE_UNMOUNT);
506
+ }, [
507
+ toast,
508
+ removeToast,
509
+ setHeights,
510
+ offset
511
+ ]);
512
+ import_react.useEffect(() => {
513
+ if (toast.promise && toastType === "loading" || toast.duration === Infinity || toast.type === "loading") return;
514
+ let timeoutId;
515
+ const pauseTimer = () => {
516
+ if (lastCloseTimerStartTimeRef.current < closeTimerStartTimeRef.current) {
517
+ const elapsedTime = (/* @__PURE__ */ new Date()).getTime() - closeTimerStartTimeRef.current;
518
+ remainingTime.current = remainingTime.current - elapsedTime;
519
+ }
520
+ lastCloseTimerStartTimeRef.current = (/* @__PURE__ */ new Date()).getTime();
521
+ };
522
+ const startTimer = () => {
523
+ if (remainingTime.current === Infinity) return;
524
+ closeTimerStartTimeRef.current = (/* @__PURE__ */ new Date()).getTime();
525
+ timeoutId = setTimeout(() => {
526
+ toast.onAutoClose == null || toast.onAutoClose.call(toast, toast);
527
+ deleteToast();
528
+ }, remainingTime.current);
529
+ };
530
+ if (expanded || interacting || isDocumentHidden) pauseTimer();
531
+ else startTimer();
532
+ return () => clearTimeout(timeoutId);
533
+ }, [
534
+ expanded,
535
+ interacting,
536
+ toast,
537
+ toastType,
538
+ isDocumentHidden,
539
+ deleteToast
540
+ ]);
541
+ import_react.useEffect(() => {
542
+ if (toast.delete) {
543
+ deleteToast();
544
+ toast.onDismiss == null || toast.onDismiss.call(toast, toast);
545
+ }
546
+ }, [deleteToast, toast.delete]);
547
+ function getLoadingIcon() {
548
+ var _toast_classNames;
549
+ if (icons == null ? void 0 : icons.loading) {
550
+ var _toast_classNames1;
551
+ return /*#__PURE__*/ import_react.createElement("div", {
552
+ className: cn(classNames == null ? void 0 : classNames.loader, toast == null ? void 0 : (_toast_classNames1 = toast.classNames) == null ? void 0 : _toast_classNames1.loader, "sonner-loader"),
553
+ "data-visible": toastType === "loading"
554
+ }, icons.loading);
555
+ }
556
+ return /*#__PURE__*/ import_react.createElement(Loader, {
557
+ className: cn(classNames == null ? void 0 : classNames.loader, toast == null ? void 0 : (_toast_classNames = toast.classNames) == null ? void 0 : _toast_classNames.loader),
558
+ visible: toastType === "loading"
559
+ });
560
+ }
561
+ const icon = toast.icon || (icons == null ? void 0 : icons[toastType]) || getAsset(toastType);
562
+ var _toast_richColors, _icons_close;
563
+ return /*#__PURE__*/ import_react.createElement("li", {
564
+ tabIndex: 0,
565
+ ref: toastRef,
566
+ className: cn(className, toastClassname, classNames == null ? void 0 : classNames.toast, toast == null ? void 0 : (_toast_classNames = toast.classNames) == null ? void 0 : _toast_classNames.toast, classNames == null ? void 0 : classNames[toastTypeKey], toast == null ? void 0 : (_toast_classNames1 = toast.classNames) == null ? void 0 : _toast_classNames1[toastTypeKey]),
567
+ "data-sonner-toast": "",
568
+ "data-rich-colors": (_toast_richColors = toast.richColors) != null ? _toast_richColors : defaultRichColors,
569
+ "data-styled": !Boolean(toast.jsx || toast.unstyled || unstyled),
570
+ "data-mounted": mounted,
571
+ "data-promise": Boolean(toast.promise),
572
+ "data-swiped": isSwiped,
573
+ "data-removed": removed,
574
+ "data-visible": isVisible,
575
+ "data-y-position": y,
576
+ "data-x-position": x,
577
+ "data-index": index,
578
+ "data-front": isFront,
579
+ "data-swiping": swiping,
580
+ "data-dismissible": dismissible,
581
+ "data-type": toastType,
582
+ "data-invert": invert,
583
+ "data-swipe-out": swipeOut,
584
+ "data-swipe-direction": swipeOutDirection,
585
+ "data-expanded": Boolean(expanded || expandByDefault && mounted),
586
+ "data-testid": toast.testId,
587
+ style: {
588
+ "--index": index,
589
+ "--toasts-before": index,
590
+ "--z-index": toasts.length - index,
591
+ "--offset": `${removed ? offsetBeforeRemove : offset.current}px`,
592
+ "--initial-height": expandByDefault ? "auto" : `${initialHeight}px`,
593
+ ...style,
594
+ ...toast.style
595
+ },
596
+ onDragEnd: () => {
597
+ setSwiping(false);
598
+ setSwipeDirection(null);
599
+ pointerStartRef.current = null;
600
+ },
601
+ onPointerDown: (event) => {
602
+ if (event.button === 2) return;
603
+ if (disabled || !dismissible) return;
604
+ dragStartTime.current = /* @__PURE__ */ new Date();
605
+ setOffsetBeforeRemove(offset.current);
606
+ event.target.setPointerCapture(event.pointerId);
607
+ if (event.target.tagName === "BUTTON") return;
608
+ setSwiping(true);
609
+ pointerStartRef.current = {
610
+ x: event.clientX,
611
+ y: event.clientY
612
+ };
613
+ },
614
+ onPointerUp: () => {
615
+ var _toastRef_current, _toastRef_current1, _dragStartTime_current;
616
+ if (swipeOut || !dismissible) return;
617
+ pointerStartRef.current = null;
618
+ const swipeAmountX = Number(((_toastRef_current = toastRef.current) == null ? void 0 : _toastRef_current.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0);
619
+ const swipeAmountY = Number(((_toastRef_current1 = toastRef.current) == null ? void 0 : _toastRef_current1.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0);
620
+ const timeTaken = (/* @__PURE__ */ new Date()).getTime() - ((_dragStartTime_current = dragStartTime.current) == null ? void 0 : _dragStartTime_current.getTime());
621
+ const swipeAmount = swipeDirection === "x" ? swipeAmountX : swipeAmountY;
622
+ const velocity = Math.abs(swipeAmount) / timeTaken;
623
+ if ((swipeDirection === "x" ? swipeDirections.includes(swipeAmountX > 0 ? "right" : "left") : swipeDirections.includes(swipeAmountY > 0 ? "bottom" : "top")) && (Math.abs(swipeAmount) >= SWIPE_THRESHOLD || velocity > .11)) {
624
+ setOffsetBeforeRemove(offset.current);
625
+ toast.onDismiss == null || toast.onDismiss.call(toast, toast);
626
+ if (swipeDirection === "x") setSwipeOutDirection(swipeAmountX > 0 ? "right" : "left");
627
+ else setSwipeOutDirection(swipeAmountY > 0 ? "down" : "up");
628
+ deleteToast();
629
+ setSwipeOut(true);
630
+ return;
631
+ } else {
632
+ var _toastRef_current2, _toastRef_current3;
633
+ (_toastRef_current2 = toastRef.current) == null || _toastRef_current2.style.setProperty("--swipe-amount-x", `0px`);
634
+ (_toastRef_current3 = toastRef.current) == null || _toastRef_current3.style.setProperty("--swipe-amount-y", `0px`);
635
+ }
636
+ setIsSwiped(false);
637
+ setSwiping(false);
638
+ setSwipeDirection(null);
639
+ },
640
+ onPointerMove: (event) => {
641
+ var _window_getSelection, _toastRef_current, _toastRef_current1;
642
+ if (!pointerStartRef.current || !dismissible) return;
643
+ if (((_window_getSelection = window.getSelection()) == null ? void 0 : _window_getSelection.toString().length) > 0) return;
644
+ const yDelta = event.clientY - pointerStartRef.current.y;
645
+ const xDelta = event.clientX - pointerStartRef.current.x;
646
+ if (!swipeDirection && (Math.abs(xDelta) > 1 || Math.abs(yDelta) > 1)) setSwipeDirection(Math.abs(xDelta) > Math.abs(yDelta) ? "x" : "y");
647
+ let swipeAmount = {
648
+ x: 0,
649
+ y: 0
650
+ };
651
+ const getDampening = (delta) => {
652
+ return 1 / (1.5 + Math.abs(delta) / 20);
653
+ };
654
+ if (swipeDirection === "y") {
655
+ if (swipeDirections.includes("top") || swipeDirections.includes("bottom")) {
656
+ if (swipeDirections.includes("top") && yDelta < 0 || swipeDirections.includes("bottom") && yDelta > 0) swipeAmount.y = yDelta;
657
+ else {
658
+ const dampenedDelta = yDelta * getDampening(yDelta);
659
+ swipeAmount.y = Math.abs(dampenedDelta) < Math.abs(yDelta) ? dampenedDelta : yDelta;
660
+ }
661
+ }
662
+ } else if (swipeDirection === "x") {
663
+ if (swipeDirections.includes("left") || swipeDirections.includes("right")) {
664
+ if (swipeDirections.includes("left") && xDelta < 0 || swipeDirections.includes("right") && xDelta > 0) swipeAmount.x = xDelta;
665
+ else {
666
+ const dampenedDelta = xDelta * getDampening(xDelta);
667
+ swipeAmount.x = Math.abs(dampenedDelta) < Math.abs(xDelta) ? dampenedDelta : xDelta;
668
+ }
669
+ }
670
+ }
671
+ if (Math.abs(swipeAmount.x) > 0 || Math.abs(swipeAmount.y) > 0) setIsSwiped(true);
672
+ (_toastRef_current = toastRef.current) == null || _toastRef_current.style.setProperty("--swipe-amount-x", `${swipeAmount.x}px`);
673
+ (_toastRef_current1 = toastRef.current) == null || _toastRef_current1.style.setProperty("--swipe-amount-y", `${swipeAmount.y}px`);
674
+ }
675
+ }, closeButton && !toast.jsx && toastType !== "loading" ? /*#__PURE__*/ import_react.createElement("button", {
676
+ "aria-label": closeButtonAriaLabel,
677
+ "data-disabled": disabled,
678
+ "data-close-button": true,
679
+ onClick: disabled || !dismissible ? () => {} : () => {
680
+ deleteToast();
681
+ toast.onDismiss == null || toast.onDismiss.call(toast, toast);
682
+ },
683
+ className: cn(classNames == null ? void 0 : classNames.closeButton, toast == null ? void 0 : (_toast_classNames2 = toast.classNames) == null ? void 0 : _toast_classNames2.closeButton)
684
+ }, (_icons_close = icons == null ? void 0 : icons.close) != null ? _icons_close : CloseIcon) : null, (toastType || toast.icon || toast.promise) && toast.icon !== null && ((icons == null ? void 0 : icons[toastType]) !== null || toast.icon) ? /*#__PURE__*/ import_react.createElement("div", {
685
+ "data-icon": "",
686
+ className: cn(classNames == null ? void 0 : classNames.icon, toast == null ? void 0 : (_toast_classNames3 = toast.classNames) == null ? void 0 : _toast_classNames3.icon)
687
+ }, toastType === "loading" ? toast.icon || getLoadingIcon() : toast.promise ? getLoadingIcon() : null, toastType !== "loading" ? icon : null) : null, /*#__PURE__*/ import_react.createElement("div", {
688
+ "data-content": "",
689
+ className: cn(classNames == null ? void 0 : classNames.content, toast == null ? void 0 : (_toast_classNames4 = toast.classNames) == null ? void 0 : _toast_classNames4.content)
690
+ }, /*#__PURE__*/ import_react.createElement("div", {
691
+ "data-title": "",
692
+ className: cn(classNames == null ? void 0 : classNames.title, toast == null ? void 0 : (_toast_classNames5 = toast.classNames) == null ? void 0 : _toast_classNames5.title)
693
+ }, toast.jsx ? toast.jsx : typeof toast.title === "function" ? toast.title() : toast.title), toast.description ? /*#__PURE__*/ import_react.createElement("div", {
694
+ "data-description": "",
695
+ className: cn(descriptionClassName, toastDescriptionClassname, classNames == null ? void 0 : classNames.description, toast == null ? void 0 : (_toast_classNames6 = toast.classNames) == null ? void 0 : _toast_classNames6.description)
696
+ }, typeof toast.description === "function" ? toast.description() : toast.description) : null), /*#__PURE__*/ import_react.isValidElement(toast.cancel) ? toast.cancel : toast.cancel && isAction(toast.cancel) ? /*#__PURE__*/ import_react.createElement("button", {
697
+ "data-button": true,
698
+ "data-cancel": true,
699
+ style: toast.cancelButtonStyle || cancelButtonStyle,
700
+ onClick: (event) => {
701
+ if (!isAction(toast.cancel)) return;
702
+ if (!dismissible) return;
703
+ toast.cancel.onClick == null || toast.cancel.onClick.call(toast.cancel, event);
704
+ deleteToast();
705
+ },
706
+ className: cn(classNames == null ? void 0 : classNames.cancelButton, toast == null ? void 0 : (_toast_classNames7 = toast.classNames) == null ? void 0 : _toast_classNames7.cancelButton)
707
+ }, toast.cancel.label) : null, /*#__PURE__*/ import_react.isValidElement(toast.action) ? toast.action : toast.action && isAction(toast.action) ? /*#__PURE__*/ import_react.createElement("button", {
708
+ "data-button": true,
709
+ "data-action": true,
710
+ style: toast.actionButtonStyle || actionButtonStyle,
711
+ onClick: (event) => {
712
+ if (!isAction(toast.action)) return;
713
+ toast.action.onClick == null || toast.action.onClick.call(toast.action, event);
714
+ if (event.defaultPrevented) return;
715
+ deleteToast();
716
+ },
717
+ className: cn(classNames == null ? void 0 : classNames.actionButton, toast == null ? void 0 : (_toast_classNames8 = toast.classNames) == null ? void 0 : _toast_classNames8.actionButton)
718
+ }, toast.action.label) : null);
719
+ };
720
+ function getDocumentDirection() {
721
+ if (typeof window === "undefined") return "ltr";
722
+ if (typeof document === "undefined") return "ltr";
723
+ const dirAttribute = document.documentElement.getAttribute("dir");
724
+ if (dirAttribute === "auto" || !dirAttribute) return window.getComputedStyle(document.documentElement).direction;
725
+ return dirAttribute;
726
+ }
727
+ function assignOffset(defaultOffset, mobileOffset) {
728
+ const styles = {};
729
+ [defaultOffset, mobileOffset].forEach((offset, index) => {
730
+ const isMobile = index === 1;
731
+ const prefix = isMobile ? "--mobile-offset" : "--offset";
732
+ const defaultValue = isMobile ? MOBILE_VIEWPORT_OFFSET : VIEWPORT_OFFSET;
733
+ function assignAll(offset) {
734
+ [
735
+ "top",
736
+ "right",
737
+ "bottom",
738
+ "left"
739
+ ].forEach((key) => {
740
+ styles[`${prefix}-${key}`] = typeof offset === "number" ? `${offset}px` : offset;
741
+ });
742
+ }
743
+ if (typeof offset === "number" || typeof offset === "string") assignAll(offset);
744
+ else if (typeof offset === "object") [
745
+ "top",
746
+ "right",
747
+ "bottom",
748
+ "left"
749
+ ].forEach((key) => {
750
+ if (offset[key] === void 0) styles[`${prefix}-${key}`] = defaultValue;
751
+ else styles[`${prefix}-${key}`] = typeof offset[key] === "number" ? `${offset[key]}px` : offset[key];
752
+ });
753
+ else assignAll(defaultValue);
754
+ });
755
+ return styles;
756
+ }
757
+ var Toaster = /*#__PURE__*/ import_react.forwardRef(function Toaster(props, ref) {
758
+ const { id, invert, position = "bottom-right", hotkey = ["altKey", "KeyT"], expand, closeButton, className, offset, mobileOffset, theme = "light", richColors, duration, style, visibleToasts = VISIBLE_TOASTS_AMOUNT, toastOptions, dir = getDocumentDirection(), gap = GAP, icons, customAriaLabel, containerAriaLabel = "Notifications" } = props;
759
+ const [toasts, setToasts] = import_react.useState([]);
760
+ const filteredToasts = import_react.useMemo(() => {
761
+ if (id) return toasts.filter((toast) => toast.toasterId === id);
762
+ return toasts.filter((toast) => !toast.toasterId);
763
+ }, [toasts, id]);
764
+ const possiblePositions = import_react.useMemo(() => {
765
+ return Array.from(new Set([position].concat(filteredToasts.filter((toast) => toast.position).map((toast) => toast.position))));
766
+ }, [filteredToasts, position]);
767
+ const [heights, setHeights] = import_react.useState([]);
768
+ const [expanded, setExpanded] = import_react.useState(false);
769
+ const [interacting, setInteracting] = import_react.useState(false);
770
+ const [actualTheme, setActualTheme] = import_react.useState(theme !== "system" ? theme : typeof window !== "undefined" ? window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : "light");
771
+ const listRef = import_react.useRef(null);
772
+ const hotkeyLabel = hotkey.join("+").replace(/Key/g, "").replace(/Digit/g, "");
773
+ const lastFocusedElementRef = import_react.useRef(null);
774
+ const isFocusWithinRef = import_react.useRef(false);
775
+ const removeToast = import_react.useCallback((toastToRemove) => {
776
+ setToasts((toasts) => {
777
+ var _toasts_find;
778
+ if (!((_toasts_find = toasts.find((toast) => toast.id === toastToRemove.id)) == null ? void 0 : _toasts_find.delete)) ToastState.dismiss(toastToRemove.id);
779
+ return toasts.filter(({ id }) => id !== toastToRemove.id);
780
+ });
781
+ }, []);
782
+ import_react.useEffect(() => {
783
+ return ToastState.subscribe((toast) => {
784
+ if (toast.dismiss) {
785
+ requestAnimationFrame(() => {
786
+ setToasts((toasts) => toasts.map((t) => t.id === toast.id ? {
787
+ ...t,
788
+ delete: true
789
+ } : t));
790
+ });
791
+ return;
792
+ }
793
+ setTimeout(() => {
794
+ import_react_dom.flushSync(() => {
795
+ setToasts((toasts) => {
796
+ const indexOfExistingToast = toasts.findIndex((t) => t.id === toast.id);
797
+ if (indexOfExistingToast !== -1) return [
798
+ ...toasts.slice(0, indexOfExistingToast),
799
+ {
800
+ ...toasts[indexOfExistingToast],
801
+ ...toast
802
+ },
803
+ ...toasts.slice(indexOfExistingToast + 1)
804
+ ];
805
+ return [toast, ...toasts];
806
+ });
807
+ });
808
+ });
809
+ });
810
+ }, []);
811
+ import_react.useEffect(() => {
812
+ if (theme !== "system") {
813
+ setActualTheme(theme);
814
+ return;
815
+ }
816
+ if (theme === "system") {
817
+ if (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches) setActualTheme("dark");
818
+ else setActualTheme("light");
819
+ }
820
+ if (typeof window === "undefined") return;
821
+ const darkMediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
822
+ try {
823
+ darkMediaQuery.addEventListener("change", ({ matches }) => {
824
+ if (matches) setActualTheme("dark");
825
+ else setActualTheme("light");
826
+ });
827
+ } catch (error) {
828
+ darkMediaQuery.addListener(({ matches }) => {
829
+ try {
830
+ if (matches) setActualTheme("dark");
831
+ else setActualTheme("light");
832
+ } catch (e) {
833
+ console.error(e);
834
+ }
835
+ });
836
+ }
837
+ }, [theme]);
838
+ import_react.useEffect(() => {
839
+ if (toasts.length <= 1) setExpanded(false);
840
+ }, [toasts]);
841
+ import_react.useEffect(() => {
842
+ const handleKeyDown = (event) => {
843
+ var _listRef_current;
844
+ if (hotkey.length > 0 && hotkey.every((key) => event[key] || event.code === key)) {
845
+ var _listRef_current1;
846
+ setExpanded(true);
847
+ (_listRef_current1 = listRef.current) == null || _listRef_current1.focus();
848
+ }
849
+ if (event.code === "Escape" && (document.activeElement === listRef.current || ((_listRef_current = listRef.current) == null ? void 0 : _listRef_current.contains(document.activeElement)))) setExpanded(false);
850
+ };
851
+ document.addEventListener("keydown", handleKeyDown);
852
+ return () => document.removeEventListener("keydown", handleKeyDown);
853
+ }, [hotkey]);
854
+ import_react.useEffect(() => {
855
+ if (listRef.current) return () => {
856
+ if (lastFocusedElementRef.current) {
857
+ lastFocusedElementRef.current.focus({ preventScroll: true });
858
+ lastFocusedElementRef.current = null;
859
+ isFocusWithinRef.current = false;
860
+ }
861
+ };
862
+ }, [listRef.current]);
863
+ return /*#__PURE__*/ import_react.createElement("section", {
864
+ ref,
865
+ "aria-label": customAriaLabel != null ? customAriaLabel : `${containerAriaLabel} ${hotkeyLabel}`,
866
+ tabIndex: -1,
867
+ "aria-live": "polite",
868
+ "aria-relevant": "additions text",
869
+ "aria-atomic": "false",
870
+ suppressHydrationWarning: true,
871
+ "data-react-aria-top-layer": true
872
+ }, possiblePositions.map((position, index) => {
873
+ var _heights_;
874
+ const [y, x] = position.split("-");
875
+ if (!filteredToasts.length) return null;
876
+ return /*#__PURE__*/ import_react.createElement("ol", {
877
+ key: position,
878
+ dir: dir === "auto" ? getDocumentDirection() : dir,
879
+ tabIndex: -1,
880
+ ref: listRef,
881
+ className,
882
+ "data-sonner-toaster": true,
883
+ "data-sonner-theme": actualTheme,
884
+ "data-y-position": y,
885
+ "data-x-position": x,
886
+ style: {
887
+ "--front-toast-height": `${((_heights_ = heights[0]) == null ? void 0 : _heights_.height) || 0}px`,
888
+ "--width": `${TOAST_WIDTH}px`,
889
+ "--gap": `${gap}px`,
890
+ ...style,
891
+ ...assignOffset(offset, mobileOffset)
892
+ },
893
+ onBlur: (event) => {
894
+ if (isFocusWithinRef.current && !event.currentTarget.contains(event.relatedTarget)) {
895
+ isFocusWithinRef.current = false;
896
+ if (lastFocusedElementRef.current) {
897
+ lastFocusedElementRef.current.focus({ preventScroll: true });
898
+ lastFocusedElementRef.current = null;
899
+ }
900
+ }
901
+ },
902
+ onFocus: (event) => {
903
+ if (event.target instanceof HTMLElement && event.target.dataset.dismissible === "false") return;
904
+ if (!isFocusWithinRef.current) {
905
+ isFocusWithinRef.current = true;
906
+ lastFocusedElementRef.current = event.relatedTarget;
907
+ }
908
+ },
909
+ onMouseEnter: () => setExpanded(true),
910
+ onMouseMove: () => setExpanded(true),
911
+ onMouseLeave: () => {
912
+ if (!interacting) setExpanded(false);
913
+ },
914
+ onDragEnd: () => setExpanded(false),
915
+ onPointerDown: (event) => {
916
+ if (event.target instanceof HTMLElement && event.target.dataset.dismissible === "false") return;
917
+ setInteracting(true);
918
+ },
919
+ onPointerUp: () => setInteracting(false)
920
+ }, filteredToasts.filter((toast) => !toast.position && index === 0 || toast.position === position).map((toast, index) => {
921
+ var _toastOptions_duration, _toastOptions_closeButton;
922
+ return /*#__PURE__*/ import_react.createElement(Toast, {
923
+ key: toast.id,
924
+ icons,
925
+ index,
926
+ toast,
927
+ defaultRichColors: richColors,
928
+ duration: (_toastOptions_duration = toastOptions == null ? void 0 : toastOptions.duration) != null ? _toastOptions_duration : duration,
929
+ className: toastOptions == null ? void 0 : toastOptions.className,
930
+ descriptionClassName: toastOptions == null ? void 0 : toastOptions.descriptionClassName,
931
+ invert,
932
+ visibleToasts,
933
+ closeButton: (_toastOptions_closeButton = toastOptions == null ? void 0 : toastOptions.closeButton) != null ? _toastOptions_closeButton : closeButton,
934
+ interacting,
935
+ position,
936
+ style: toastOptions == null ? void 0 : toastOptions.style,
937
+ unstyled: toastOptions == null ? void 0 : toastOptions.unstyled,
938
+ classNames: toastOptions == null ? void 0 : toastOptions.classNames,
939
+ cancelButtonStyle: toastOptions == null ? void 0 : toastOptions.cancelButtonStyle,
940
+ actionButtonStyle: toastOptions == null ? void 0 : toastOptions.actionButtonStyle,
941
+ closeButtonAriaLabel: toastOptions == null ? void 0 : toastOptions.closeButtonAriaLabel,
942
+ removeToast,
943
+ toasts: filteredToasts.filter((t) => t.position == toast.position),
944
+ heights: heights.filter((h) => h.position == toast.position),
945
+ setHeights,
946
+ expandByDefault: expand,
947
+ gap,
948
+ expanded,
949
+ swipeDirections: props.swipeDirections
950
+ });
951
+ }));
952
+ }));
953
+ });
954
+ //#endregion
955
+ export { toast as n, Toaster as t };