@soft-toast/vue 1.0.2 → 1.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.
- package/README.md +8 -8
- package/dist/animations/gsapConfig.d.ts +2 -1
- package/dist/animations/gsapConfig.d.ts.map +1 -1
- package/dist/composables/{useToast.d.ts → useSoftToast.d.ts} +6 -6
- package/dist/composables/useSoftToast.d.ts.map +1 -0
- package/dist/composables/useSoftToast.test.d.ts +2 -0
- package/dist/composables/useSoftToast.test.d.ts.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +794 -756
- package/dist/stores/toastStore.d.ts +1 -1
- package/dist/stores/toastStore.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +5 -5
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +15 -2
- package/src/animations/gsapConfig.ts +45 -14
- package/src/components/ToastItem.vue +41 -10
- package/src/components/ToastRegion.vue +6 -2
- package/src/composables/useFlash.ts +1 -1
- package/src/composables/{useToast.test.ts → useSoftToast.test.ts} +54 -54
- package/src/composables/{useToast.ts → useSoftToast.ts} +5 -5
- package/src/exports.test.ts +39 -22
- package/src/index.ts +1 -2
- package/src/stores/toastStore.ts +29 -9
- package/src/styles/toast.css +18 -9
- package/src/types/index.ts +5 -5
- package/dist/composables/useToast.d.ts.map +0 -1
- package/dist/composables/useToast.test.d.ts +0 -2
- package/dist/composables/useToast.test.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { ref as R, computed as z, defineComponent as pe, shallowRef as
|
|
2
|
-
import { gsap as
|
|
3
|
-
let
|
|
4
|
-
const
|
|
5
|
-
|
|
1
|
+
import { ref as R, computed as z, defineComponent as pe, shallowRef as un, onMounted as qe, watch as G, onUnmounted as Ve, h as Ge, nextTick as ke, openBlock as P, createElementBlock as $, createVNode as st, unref as Nt, createElementVNode as Q, normalizeStyle as De, normalizeClass as Fe, renderSlot as re, withModifiers as $e, createCommentVNode as ee, createBlock as K, resolveDynamicComponent as gt, toDisplayString as ye, Fragment as Ie, createTextVNode as fn, renderList as Se, Teleport as Ht, withDirectives as dn, createSlots as qt, withCtx as Vt, mergeProps as Ke, vShow as pn, createApp as hn } from "vue";
|
|
2
|
+
import { gsap as F } from "gsap";
|
|
3
|
+
let we = null, Yt = !1;
|
|
4
|
+
const mn = () => {
|
|
5
|
+
Yt = !0;
|
|
6
6
|
};
|
|
7
7
|
typeof window < "u" && ["click", "keydown", "pointerdown", "touchstart"].forEach(
|
|
8
|
-
(e) => window.addEventListener(e,
|
|
8
|
+
(e) => window.addEventListener(e, mn, { once: !0, passive: !0 })
|
|
9
9
|
);
|
|
10
|
-
const
|
|
11
|
-
}),
|
|
12
|
-
const i =
|
|
10
|
+
const gn = () => typeof window > "u" || typeof AudioContext > "u" ? null : (we || (we = new AudioContext()), we.state === "suspended" && we.resume().catch(() => {
|
|
11
|
+
}), we), U = (e, t, n, o = "sine", s = 0) => {
|
|
12
|
+
const i = gn();
|
|
13
13
|
if (i)
|
|
14
14
|
try {
|
|
15
15
|
const r = i.createOscillator(), a = i.createGain();
|
|
16
16
|
r.connect(a), a.connect(i.destination), r.type = o, r.frequency.setValueAtTime(e, i.currentTime + s), a.gain.setValueAtTime(0, i.currentTime + s), a.gain.linearRampToValueAtTime(n, i.currentTime + s + 0.01), a.gain.exponentialRampToValueAtTime(1e-3, i.currentTime + s + t), r.start(i.currentTime + s), r.stop(i.currentTime + s + t + 0.02);
|
|
17
17
|
} catch {
|
|
18
18
|
}
|
|
19
|
-
},
|
|
19
|
+
}, vt = {
|
|
20
20
|
success: (e) => {
|
|
21
21
|
U(523.25, 0.12, e * 0.45, "sine", 0), U(659.25, 0.14, e * 0.5, "sine", 0.08), U(783.99, 0.2, e * 0.55, "sine", 0.16);
|
|
22
22
|
},
|
|
@@ -36,8 +36,8 @@ const mn = () => typeof window > "u" || typeof AudioContext > "u" ? null : (xe |
|
|
|
36
36
|
promise: (e) => {
|
|
37
37
|
U(523.25, 0.12, e * 0.3, "sine", 0);
|
|
38
38
|
}
|
|
39
|
-
},
|
|
40
|
-
if (!t || typeof window > "u" || !
|
|
39
|
+
}, yt = (e, t, n = 0.5) => {
|
|
40
|
+
if (!t || typeof window > "u" || !Yt) return;
|
|
41
41
|
const o = Math.max(0, Math.min(1, n));
|
|
42
42
|
if (typeof t == "string") {
|
|
43
43
|
try {
|
|
@@ -48,8 +48,8 @@ const mn = () => typeof window > "u" || typeof AudioContext > "u" ? null : (xe |
|
|
|
48
48
|
}
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
|
-
(
|
|
52
|
-
},
|
|
51
|
+
(vt[e] ?? vt.default)(o);
|
|
52
|
+
}, vn = () => `toast-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`, se = {
|
|
53
53
|
type: "default",
|
|
54
54
|
duration: 4e3,
|
|
55
55
|
position: "top-right",
|
|
@@ -58,8 +58,14 @@ const mn = () => typeof window > "u" || typeof AudioContext > "u" ? null : (xe |
|
|
|
58
58
|
spring: !0,
|
|
59
59
|
showTimestamp: !1,
|
|
60
60
|
showProgress: !1
|
|
61
|
-
}, k = R([]),
|
|
62
|
-
|
|
61
|
+
}, k = R([]), X = /* @__PURE__ */ new Map(), Je = (e, t, n = !1) => {
|
|
62
|
+
if (t === 1 / 0) {
|
|
63
|
+
X.delete(e);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
X.set(e, { remainingTime: t, isPaused: n });
|
|
67
|
+
}, yn = (e) => z(() => k.value.filter((t) => t.position === e)), wn = z(() => k.value), ae = (e) => {
|
|
68
|
+
const t = e.id || vn(), n = k.value.findIndex((a) => a.id === t);
|
|
63
69
|
if (n !== -1 && !k.value[n].isLeaving) {
|
|
64
70
|
const a = k.value[n];
|
|
65
71
|
k.value[n] = {
|
|
@@ -70,12 +76,12 @@ const mn = () => typeof window > "u" || typeof AudioContext > "u" ? null : (xe |
|
|
|
70
76
|
remainingTime: e.duration ?? a.duration,
|
|
71
77
|
isPaused: a.isPaused,
|
|
72
78
|
isLeaving: !1
|
|
73
|
-
};
|
|
74
|
-
const
|
|
75
|
-
return
|
|
79
|
+
}, Je(t, e.duration ?? a.duration, a.isPaused);
|
|
80
|
+
const l = e.sound, c = e.soundVolume ?? 0.5;
|
|
81
|
+
return l && yt(e.type ?? a.type, l, c), t;
|
|
76
82
|
}
|
|
77
|
-
const o = e.duration ??
|
|
78
|
-
...
|
|
83
|
+
const o = e.duration ?? se.duration, s = {
|
|
84
|
+
...se,
|
|
79
85
|
...e,
|
|
80
86
|
id: t,
|
|
81
87
|
createdAt: Date.now(),
|
|
@@ -83,131 +89,138 @@ const mn = () => typeof window > "u" || typeof AudioContext > "u" ? null : (xe |
|
|
|
83
89
|
isPaused: !1,
|
|
84
90
|
isExpanded: !0,
|
|
85
91
|
isLeaving: !1,
|
|
86
|
-
preset: e.preset ??
|
|
87
|
-
bounce: e.bounce ??
|
|
88
|
-
spring: e.spring ??
|
|
89
|
-
showTimestamp: e.showTimestamp ??
|
|
90
|
-
showProgress: e.showProgress ??
|
|
92
|
+
preset: e.preset ?? se.preset,
|
|
93
|
+
bounce: e.bounce ?? se.bounce,
|
|
94
|
+
spring: e.spring ?? se.spring,
|
|
95
|
+
showTimestamp: e.showTimestamp ?? se.showTimestamp,
|
|
96
|
+
showProgress: e.showProgress ?? se.showProgress
|
|
91
97
|
};
|
|
92
|
-
|
|
98
|
+
Je(t, o, !1), k.value.unshift(s), Sn();
|
|
93
99
|
const i = e.sound, r = e.soundVolume ?? 0.5;
|
|
94
|
-
return i &&
|
|
95
|
-
},
|
|
100
|
+
return i && yt(s.type, i, r), t;
|
|
101
|
+
}, Ze = (e, t) => {
|
|
96
102
|
const n = k.value.findIndex((o) => o.id === e);
|
|
97
|
-
n !== -1
|
|
98
|
-
|
|
103
|
+
if (n !== -1) {
|
|
104
|
+
const o = k.value[n], s = t.duration ?? o.duration, i = t.duration === void 0 ? o.remainingTime : s;
|
|
105
|
+
k.value[n] = {
|
|
106
|
+
...o,
|
|
107
|
+
...t,
|
|
108
|
+
remainingTime: i
|
|
109
|
+
}, t.duration !== void 0 && Je(e, s, o.isPaused);
|
|
110
|
+
}
|
|
111
|
+
}, xn = (e) => {
|
|
99
112
|
var t;
|
|
100
113
|
if (!e) {
|
|
101
114
|
k.value.forEach((n) => {
|
|
102
115
|
n.isLeaving = !0;
|
|
103
|
-
}),
|
|
116
|
+
}), X.clear(), setTimeout(() => {
|
|
104
117
|
k.value = [];
|
|
105
118
|
}, 400);
|
|
106
119
|
return;
|
|
107
120
|
}
|
|
108
121
|
if (typeof e == "string") {
|
|
109
122
|
const n = k.value.find((o) => o.id === e);
|
|
110
|
-
n && (n.isLeaving = !0, (t = n.onDismiss) == null || t.call(n, e),
|
|
123
|
+
n && (n.isLeaving = !0, (t = n.onDismiss) == null || t.call(n, e), X.delete(e), setTimeout(() => {
|
|
111
124
|
k.value = k.value.filter((o) => o.id !== e);
|
|
112
125
|
}, 400));
|
|
113
126
|
} else {
|
|
114
127
|
const n = Array.isArray(e.type) ? e.type : [e.type];
|
|
115
128
|
k.value.forEach((o) => {
|
|
116
129
|
var s;
|
|
117
|
-
n.includes(o.type) && (o.isLeaving = !0, (s = o.onDismiss) == null || s.call(o, o.id),
|
|
130
|
+
n.includes(o.type) && (o.isLeaving = !0, (s = o.onDismiss) == null || s.call(o, o.id), X.delete(o.id));
|
|
118
131
|
}), setTimeout(() => {
|
|
119
132
|
k.value = k.value.filter((o) => !n.includes(o.type));
|
|
120
133
|
}, 400);
|
|
121
134
|
}
|
|
122
|
-
},
|
|
123
|
-
const t =
|
|
135
|
+
}, bn = (e) => {
|
|
136
|
+
const t = X.get(e);
|
|
124
137
|
t && (t.isPaused = !0);
|
|
125
138
|
const n = k.value.find((o) => o.id === e);
|
|
126
139
|
n && (n.isPaused = !0);
|
|
127
|
-
},
|
|
128
|
-
const t =
|
|
140
|
+
}, Tn = (e) => {
|
|
141
|
+
const t = X.get(e);
|
|
129
142
|
t && (t.isPaused = !1);
|
|
130
143
|
const n = k.value.find((o) => o.id === e);
|
|
131
144
|
n && (n.isPaused = !1);
|
|
132
|
-
},
|
|
145
|
+
}, kn = (e) => {
|
|
133
146
|
const t = k.value.find((n) => n.id === e);
|
|
134
147
|
t && (t.isExpanded = !0);
|
|
135
|
-
},
|
|
148
|
+
}, In = (e) => {
|
|
136
149
|
const t = k.value.find((n) => n.id === e);
|
|
137
150
|
t && (t.isExpanded = !1);
|
|
138
151
|
};
|
|
139
|
-
let
|
|
140
|
-
const
|
|
152
|
+
let xe = 0, Me = null;
|
|
153
|
+
const Sn = () => {
|
|
141
154
|
if (Me !== null || typeof window > "u") return;
|
|
142
155
|
const e = (t) => {
|
|
143
156
|
var s;
|
|
144
|
-
|
|
145
|
-
const n = t -
|
|
146
|
-
|
|
157
|
+
xe === 0 && (xe = t);
|
|
158
|
+
const n = t - xe;
|
|
159
|
+
xe = t;
|
|
147
160
|
const o = [];
|
|
148
|
-
|
|
161
|
+
X.forEach((i, r) => {
|
|
149
162
|
if (i.isPaused) return;
|
|
150
|
-
const a = k.value.find((
|
|
163
|
+
const a = k.value.find((l) => l.id === r);
|
|
151
164
|
!a || a.isLeaving || a.duration === 1 / 0 || (i.remainingTime -= n, a.showProgress && (a.remainingTime = i.remainingTime), i.remainingTime <= 0 && o.push(r));
|
|
152
165
|
});
|
|
153
166
|
for (const i of o) {
|
|
154
|
-
|
|
167
|
+
X.delete(i);
|
|
155
168
|
const r = k.value.find((a) => a.id === i);
|
|
156
169
|
r && !r.isLeaving && (r.isLeaving = !0, (s = r.onAutoClose) == null || s.call(r, i), setTimeout(() => {
|
|
157
170
|
k.value = k.value.filter((a) => a.id !== i);
|
|
158
171
|
}, 400));
|
|
159
172
|
}
|
|
160
|
-
k.value.length > 0 ? Me = requestAnimationFrame(e) : (Me = null,
|
|
173
|
+
k.value.length > 0 ? Me = requestAnimationFrame(e) : (Me = null, xe = 0);
|
|
161
174
|
};
|
|
162
175
|
Me = requestAnimationFrame(e);
|
|
163
|
-
},
|
|
164
|
-
var s, i, r;
|
|
165
|
-
const o =
|
|
176
|
+
}, En = (e, t) => ae({ ...t, type: "success", title: e }), Pn = (e, t) => ae({ ...t, type: "error", title: e }), Ln = (e, t) => ae({ ...t, type: "warning", title: e }), Cn = (e, t) => ae({ ...t, type: "info", title: e }), An = (e, t) => ae({ ...t, type: "promise", title: e, duration: 1 / 0 }), On = async (e, t, n) => {
|
|
177
|
+
var s, i, r, a, l;
|
|
178
|
+
const o = ae({
|
|
166
179
|
...n,
|
|
167
180
|
type: "promise",
|
|
168
181
|
title: t.loading,
|
|
169
182
|
duration: 1 / 0
|
|
170
183
|
});
|
|
171
184
|
try {
|
|
172
|
-
const
|
|
173
|
-
return
|
|
185
|
+
const c = await e;
|
|
186
|
+
return Ze(o, {
|
|
174
187
|
type: "success",
|
|
175
|
-
title: t.success,
|
|
176
|
-
description: (s = t.description) == null ? void 0 : s.success,
|
|
188
|
+
title: typeof t.success == "function" ? t.success(c) : t.success,
|
|
189
|
+
description: typeof ((s = t.description) == null ? void 0 : s.success) == "function" ? t.description.success(c) : (i = t.description) == null ? void 0 : i.success,
|
|
177
190
|
duration: 4e3
|
|
178
|
-
}),
|
|
179
|
-
} catch (
|
|
180
|
-
throw
|
|
191
|
+
}), c;
|
|
192
|
+
} catch (c) {
|
|
193
|
+
throw Ze(o, {
|
|
181
194
|
type: "error",
|
|
182
|
-
title: t.error,
|
|
183
|
-
description: (
|
|
184
|
-
action: (
|
|
195
|
+
title: typeof t.error == "function" ? t.error(c) : t.error,
|
|
196
|
+
description: typeof ((r = t.description) == null ? void 0 : r.error) == "function" ? t.description.error(c) : (a = t.description) == null ? void 0 : a.error,
|
|
197
|
+
action: (l = t.action) == null ? void 0 : l.error,
|
|
185
198
|
duration: 6e3
|
|
186
|
-
}),
|
|
199
|
+
}), c;
|
|
187
200
|
}
|
|
188
|
-
},
|
|
189
|
-
|
|
190
|
-
},
|
|
191
|
-
|
|
192
|
-
},
|
|
193
|
-
toasts:
|
|
194
|
-
getToastsByPosition:
|
|
195
|
-
add:
|
|
196
|
-
update:
|
|
197
|
-
dismiss:
|
|
198
|
-
pause:
|
|
199
|
-
resume:
|
|
200
|
-
expand:
|
|
201
|
-
collapse:
|
|
202
|
-
success:
|
|
203
|
-
error:
|
|
204
|
-
warning:
|
|
201
|
+
}, Mn = () => {
|
|
202
|
+
X.clear(), k.value = [];
|
|
203
|
+
}, Dn = (e) => {
|
|
204
|
+
X.delete(e), k.value = k.value.filter((t) => t.id !== e);
|
|
205
|
+
}, y = {
|
|
206
|
+
toasts: wn,
|
|
207
|
+
getToastsByPosition: yn,
|
|
208
|
+
add: ae,
|
|
209
|
+
update: Ze,
|
|
210
|
+
dismiss: xn,
|
|
211
|
+
pause: bn,
|
|
212
|
+
resume: Tn,
|
|
213
|
+
expand: kn,
|
|
214
|
+
collapse: In,
|
|
215
|
+
success: En,
|
|
216
|
+
error: Pn,
|
|
217
|
+
warning: Ln,
|
|
205
218
|
info: Cn,
|
|
206
219
|
loading: An,
|
|
207
|
-
promise:
|
|
208
|
-
clearAll:
|
|
209
|
-
remove:
|
|
210
|
-
},
|
|
220
|
+
promise: On,
|
|
221
|
+
clearAll: Mn,
|
|
222
|
+
remove: Dn
|
|
223
|
+
}, zt = /^[a-z0-9]+(-[a-z0-9]+)*$/, Ye = (e, t, n, o = "") => {
|
|
211
224
|
const s = e.split(":");
|
|
212
225
|
if (e.slice(0, 1) === "@") {
|
|
213
226
|
if (s.length < 2 || s.length > 3) return null;
|
|
@@ -215,12 +228,12 @@ const In = () => {
|
|
|
215
228
|
}
|
|
216
229
|
if (s.length > 3 || !s.length) return null;
|
|
217
230
|
if (s.length > 1) {
|
|
218
|
-
const a = s.pop(),
|
|
231
|
+
const a = s.pop(), l = s.pop(), c = {
|
|
219
232
|
provider: s.length > 0 ? s[0] : o,
|
|
220
|
-
prefix:
|
|
233
|
+
prefix: l,
|
|
221
234
|
name: a
|
|
222
235
|
};
|
|
223
|
-
return t && !Be(
|
|
236
|
+
return t && !Be(c) ? null : c;
|
|
224
237
|
}
|
|
225
238
|
const i = s[0], r = i.split("-");
|
|
226
239
|
if (r.length > 1) {
|
|
@@ -241,20 +254,20 @@ const In = () => {
|
|
|
241
254
|
}
|
|
242
255
|
return null;
|
|
243
256
|
}, Be = (e, t) => e ? !!((t && e.prefix === "" || e.prefix) && e.name) : !1;
|
|
244
|
-
function
|
|
257
|
+
function Fn(e, t) {
|
|
245
258
|
const n = e.icons, o = e.aliases || /* @__PURE__ */ Object.create(null), s = /* @__PURE__ */ Object.create(null);
|
|
246
259
|
function i(r) {
|
|
247
260
|
if (n[r]) return s[r] = [];
|
|
248
261
|
if (!(r in s)) {
|
|
249
262
|
s[r] = null;
|
|
250
|
-
const a = o[r] && o[r].parent,
|
|
251
|
-
|
|
263
|
+
const a = o[r] && o[r].parent, l = a && i(a);
|
|
264
|
+
l && (s[r] = [a].concat(l));
|
|
252
265
|
}
|
|
253
266
|
return s[r];
|
|
254
267
|
}
|
|
255
268
|
return Object.keys(n).concat(Object.keys(o)).forEach(i), s;
|
|
256
269
|
}
|
|
257
|
-
const
|
|
270
|
+
const Qt = Object.freeze({
|
|
258
271
|
left: 0,
|
|
259
272
|
top: 0,
|
|
260
273
|
width: 16,
|
|
@@ -264,73 +277,73 @@ const zt = Object.freeze({
|
|
|
264
277
|
vFlip: !1,
|
|
265
278
|
hFlip: !1
|
|
266
279
|
}), ze = Object.freeze({
|
|
267
|
-
...
|
|
280
|
+
...Qt,
|
|
268
281
|
...Ne
|
|
269
|
-
}),
|
|
282
|
+
}), _e = Object.freeze({
|
|
270
283
|
...ze,
|
|
271
284
|
body: "",
|
|
272
285
|
hidden: !1
|
|
273
286
|
});
|
|
274
|
-
function
|
|
287
|
+
function Bn(e, t) {
|
|
275
288
|
const n = {};
|
|
276
289
|
!e.hFlip != !t.hFlip && (n.hFlip = !0), !e.vFlip != !t.vFlip && (n.vFlip = !0);
|
|
277
290
|
const o = ((e.rotate || 0) + (t.rotate || 0)) % 4;
|
|
278
291
|
return o && (n.rotate = o), n;
|
|
279
292
|
}
|
|
280
|
-
function
|
|
281
|
-
const n =
|
|
282
|
-
for (const o in
|
|
293
|
+
function wt(e, t) {
|
|
294
|
+
const n = Bn(e, t);
|
|
295
|
+
for (const o in _e) o in Ne ? o in e && !(o in n) && (n[o] = Ne[o]) : o in t ? n[o] = t[o] : o in e && (n[o] = e[o]);
|
|
283
296
|
return n;
|
|
284
297
|
}
|
|
285
|
-
function
|
|
298
|
+
function jn(e, t, n) {
|
|
286
299
|
const o = e.icons, s = e.aliases || /* @__PURE__ */ Object.create(null);
|
|
287
300
|
let i = {};
|
|
288
301
|
function r(a) {
|
|
289
|
-
i =
|
|
302
|
+
i = wt(o[a] || s[a], i);
|
|
290
303
|
}
|
|
291
|
-
return r(t), n.forEach(r),
|
|
304
|
+
return r(t), n.forEach(r), wt(e, i);
|
|
292
305
|
}
|
|
293
|
-
function
|
|
306
|
+
function Ut(e, t) {
|
|
294
307
|
const n = [];
|
|
295
308
|
if (typeof e != "object" || typeof e.icons != "object") return n;
|
|
296
309
|
e.not_found instanceof Array && e.not_found.forEach((s) => {
|
|
297
310
|
t(s, null), n.push(s);
|
|
298
311
|
});
|
|
299
|
-
const o =
|
|
312
|
+
const o = Fn(e);
|
|
300
313
|
for (const s in o) {
|
|
301
314
|
const i = o[s];
|
|
302
|
-
i && (t(s,
|
|
315
|
+
i && (t(s, jn(e, s, i)), n.push(s));
|
|
303
316
|
}
|
|
304
317
|
return n;
|
|
305
318
|
}
|
|
306
|
-
const
|
|
319
|
+
const Rn = {
|
|
307
320
|
provider: "",
|
|
308
321
|
aliases: {},
|
|
309
322
|
not_found: {},
|
|
310
|
-
...
|
|
323
|
+
...Qt
|
|
311
324
|
};
|
|
312
325
|
function Xe(e, t) {
|
|
313
326
|
for (const n in t) if (n in e && typeof e[n] != typeof t[n]) return !1;
|
|
314
327
|
return !0;
|
|
315
328
|
}
|
|
316
|
-
function
|
|
329
|
+
function Xt(e) {
|
|
317
330
|
if (typeof e != "object" || e === null) return null;
|
|
318
331
|
const t = e;
|
|
319
|
-
if (typeof t.prefix != "string" || !e.icons || typeof e.icons != "object" || !Xe(e,
|
|
332
|
+
if (typeof t.prefix != "string" || !e.icons || typeof e.icons != "object" || !Xe(e, Rn)) return null;
|
|
320
333
|
const n = t.icons;
|
|
321
334
|
for (const s in n) {
|
|
322
335
|
const i = n[s];
|
|
323
|
-
if (!s || typeof i.body != "string" || !Xe(i,
|
|
336
|
+
if (!s || typeof i.body != "string" || !Xe(i, _e)) return null;
|
|
324
337
|
}
|
|
325
338
|
const o = t.aliases || /* @__PURE__ */ Object.create(null);
|
|
326
339
|
for (const s in o) {
|
|
327
340
|
const i = o[s], r = i.parent;
|
|
328
|
-
if (!s || typeof r != "string" || !n[r] && !o[r] || !Xe(i,
|
|
341
|
+
if (!s || typeof r != "string" || !n[r] && !o[r] || !Xe(i, _e)) return null;
|
|
329
342
|
}
|
|
330
343
|
return t;
|
|
331
344
|
}
|
|
332
|
-
const
|
|
333
|
-
function
|
|
345
|
+
const xt = /* @__PURE__ */ Object.create(null);
|
|
346
|
+
function $n(e, t) {
|
|
334
347
|
return {
|
|
335
348
|
provider: e,
|
|
336
349
|
prefix: t,
|
|
@@ -338,16 +351,16 @@ function Rn(e, t) {
|
|
|
338
351
|
missing: /* @__PURE__ */ new Set()
|
|
339
352
|
};
|
|
340
353
|
}
|
|
341
|
-
function
|
|
342
|
-
const n =
|
|
343
|
-
return n[t] || (n[t] =
|
|
354
|
+
function de(e, t) {
|
|
355
|
+
const n = xt[e] || (xt[e] = /* @__PURE__ */ Object.create(null));
|
|
356
|
+
return n[t] || (n[t] = $n(e, t));
|
|
344
357
|
}
|
|
345
|
-
function
|
|
346
|
-
return
|
|
358
|
+
function Wt(e, t) {
|
|
359
|
+
return Xt(t) ? Ut(t, (n, o) => {
|
|
347
360
|
o ? e.icons[n] = o : e.missing.add(n);
|
|
348
361
|
}) : [];
|
|
349
362
|
}
|
|
350
|
-
function
|
|
363
|
+
function Nn(e, t, n) {
|
|
351
364
|
try {
|
|
352
365
|
if (typeof n.body == "string")
|
|
353
366
|
return e.icons[t] = { ...n }, !0;
|
|
@@ -355,52 +368,52 @@ function $n(e, t, n) {
|
|
|
355
368
|
}
|
|
356
369
|
return !1;
|
|
357
370
|
}
|
|
358
|
-
let
|
|
359
|
-
function
|
|
360
|
-
return typeof e == "boolean" && (
|
|
371
|
+
let Ee = !1;
|
|
372
|
+
function Gt(e) {
|
|
373
|
+
return typeof e == "boolean" && (Ee = e), Ee;
|
|
361
374
|
}
|
|
362
|
-
function
|
|
363
|
-
const t = typeof e == "string" ? Ye(e, !0,
|
|
375
|
+
function Hn(e) {
|
|
376
|
+
const t = typeof e == "string" ? Ye(e, !0, Ee) : e;
|
|
364
377
|
if (t) {
|
|
365
|
-
const n =
|
|
378
|
+
const n = de(t.provider, t.prefix), o = t.name;
|
|
366
379
|
return n.icons[o] || (n.missing.has(o) ? null : void 0);
|
|
367
380
|
}
|
|
368
381
|
}
|
|
369
|
-
function
|
|
370
|
-
const n = Ye(e, !0,
|
|
382
|
+
function ie(e, t) {
|
|
383
|
+
const n = Ye(e, !0, Ee);
|
|
371
384
|
if (!n) return !1;
|
|
372
|
-
const o =
|
|
373
|
-
return t ?
|
|
385
|
+
const o = de(n.provider, n.prefix);
|
|
386
|
+
return t ? Nn(o, n.name, t) : (o.missing.add(n.name), !0);
|
|
374
387
|
}
|
|
375
|
-
function
|
|
388
|
+
function qn(e, t) {
|
|
376
389
|
if (typeof e != "object") return !1;
|
|
377
|
-
if (typeof t != "string" && (t = e.provider || ""),
|
|
390
|
+
if (typeof t != "string" && (t = e.provider || ""), Ee && !t && !e.prefix) {
|
|
378
391
|
let o = !1;
|
|
379
|
-
return
|
|
380
|
-
|
|
392
|
+
return Xt(e) && (e.prefix = "", Ut(e, (s, i) => {
|
|
393
|
+
ie(s, i) && (o = !0);
|
|
381
394
|
})), o;
|
|
382
395
|
}
|
|
383
396
|
const n = e.prefix;
|
|
384
397
|
return Be({
|
|
385
398
|
prefix: n,
|
|
386
399
|
name: "a"
|
|
387
|
-
}) ? !!
|
|
400
|
+
}) ? !!Wt(de(t, n), e) : !1;
|
|
388
401
|
}
|
|
389
|
-
const
|
|
402
|
+
const Kt = Object.freeze({
|
|
390
403
|
width: null,
|
|
391
404
|
height: null
|
|
392
|
-
}),
|
|
393
|
-
...
|
|
405
|
+
}), Jt = Object.freeze({
|
|
406
|
+
...Kt,
|
|
394
407
|
...Ne
|
|
395
|
-
}),
|
|
396
|
-
function
|
|
408
|
+
}), Vn = /(-?[0-9.]*[0-9]+[0-9.]*)/g, Yn = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
|
|
409
|
+
function bt(e, t, n) {
|
|
397
410
|
if (t === 1) return e;
|
|
398
411
|
if (n = n || 100, typeof e == "number") return Math.ceil(e * t * n) / n;
|
|
399
412
|
if (typeof e != "string") return e;
|
|
400
|
-
const o = e.split(
|
|
413
|
+
const o = e.split(Vn);
|
|
401
414
|
if (o === null || !o.length) return e;
|
|
402
415
|
const s = [];
|
|
403
|
-
let i = o.shift(), r =
|
|
416
|
+
let i = o.shift(), r = Yn.test(i);
|
|
404
417
|
for (; ; ) {
|
|
405
418
|
if (r) {
|
|
406
419
|
const a = parseFloat(i);
|
|
@@ -410,7 +423,7 @@ function xt(e, t, n) {
|
|
|
410
423
|
r = !r;
|
|
411
424
|
}
|
|
412
425
|
}
|
|
413
|
-
function
|
|
426
|
+
function zn(e, t = "defs") {
|
|
414
427
|
let n = "";
|
|
415
428
|
const o = e.indexOf("<" + t);
|
|
416
429
|
for (; o >= 0; ) {
|
|
@@ -425,20 +438,20 @@ function Yn(e, t = "defs") {
|
|
|
425
438
|
content: e
|
|
426
439
|
};
|
|
427
440
|
}
|
|
428
|
-
function
|
|
441
|
+
function Qn(e, t) {
|
|
429
442
|
return e ? "<defs>" + e + "</defs>" + t : t;
|
|
430
443
|
}
|
|
431
|
-
function
|
|
432
|
-
const o =
|
|
433
|
-
return
|
|
444
|
+
function Un(e, t, n) {
|
|
445
|
+
const o = zn(e);
|
|
446
|
+
return Qn(o.defs, t + o.content + n);
|
|
434
447
|
}
|
|
435
|
-
const
|
|
436
|
-
function
|
|
448
|
+
const Xn = (e) => e === "unset" || e === "undefined" || e === "none";
|
|
449
|
+
function Wn(e, t) {
|
|
437
450
|
const n = {
|
|
438
451
|
...ze,
|
|
439
452
|
...e
|
|
440
453
|
}, o = {
|
|
441
|
-
...
|
|
454
|
+
...Jt,
|
|
442
455
|
...t
|
|
443
456
|
}, s = {
|
|
444
457
|
left: n.left,
|
|
@@ -448,9 +461,9 @@ function Xn(e, t) {
|
|
|
448
461
|
};
|
|
449
462
|
let i = n.body;
|
|
450
463
|
[n, o].forEach((I) => {
|
|
451
|
-
const h = [],
|
|
464
|
+
const h = [], N = I.hFlip, O = I.vFlip;
|
|
452
465
|
let b = I.rotate;
|
|
453
|
-
|
|
466
|
+
N ? O ? b += 2 : (h.push("translate(" + (s.width + s.left).toString() + " " + (0 - s.top).toString() + ")"), h.push("scale(-1 1)"), s.top = s.left = 0) : O && (h.push("translate(" + (0 - s.left).toString() + " " + (s.height + s.top).toString() + ")"), h.push("scale(1 -1)"), s.top = s.left = 0);
|
|
454
467
|
let T;
|
|
455
468
|
switch (b < 0 && (b -= Math.floor(b / 4) * 4), b = b % 4, b) {
|
|
456
469
|
case 1:
|
|
@@ -463,52 +476,52 @@ function Xn(e, t) {
|
|
|
463
476
|
T = s.width / 2 + s.left, h.unshift("rotate(-90 " + T.toString() + " " + T.toString() + ")");
|
|
464
477
|
break;
|
|
465
478
|
}
|
|
466
|
-
b % 2 === 1 && (s.left !== s.top && (T = s.left, s.left = s.top, s.top = T), s.width !== s.height && (T = s.width, s.width = s.height, s.height = T)), h.length && (i =
|
|
479
|
+
b % 2 === 1 && (s.left !== s.top && (T = s.left, s.left = s.top, s.top = T), s.width !== s.height && (T = s.width, s.width = s.height, s.height = T)), h.length && (i = Un(i, '<g transform="' + h.join(" ") + '">', "</g>"));
|
|
467
480
|
});
|
|
468
|
-
const r = o.width, a = o.height,
|
|
481
|
+
const r = o.width, a = o.height, l = s.width, c = s.height;
|
|
469
482
|
let d, w;
|
|
470
|
-
r === null ? (w = a === null ? "1em" : a === "auto" ?
|
|
483
|
+
r === null ? (w = a === null ? "1em" : a === "auto" ? c : a, d = bt(w, l / c)) : (d = r === "auto" ? l : r, w = a === null ? bt(d, c / l) : a === "auto" ? c : a);
|
|
471
484
|
const x = {}, S = (I, h) => {
|
|
472
|
-
|
|
485
|
+
Xn(h) || (x[I] = h.toString());
|
|
473
486
|
};
|
|
474
487
|
S("width", d), S("height", w);
|
|
475
|
-
const
|
|
488
|
+
const g = [
|
|
476
489
|
s.left,
|
|
477
490
|
s.top,
|
|
478
|
-
|
|
479
|
-
|
|
491
|
+
l,
|
|
492
|
+
c
|
|
480
493
|
];
|
|
481
|
-
return x.viewBox =
|
|
494
|
+
return x.viewBox = g.join(" "), {
|
|
482
495
|
attributes: x,
|
|
483
|
-
viewBox:
|
|
496
|
+
viewBox: g,
|
|
484
497
|
body: i
|
|
485
498
|
};
|
|
486
499
|
}
|
|
487
|
-
const
|
|
488
|
-
function
|
|
500
|
+
const Gn = /\sid="(\S+)"/g, Tt = /* @__PURE__ */ new Map();
|
|
501
|
+
function Kn(e) {
|
|
489
502
|
e = e.replace(/[0-9]+$/, "") || "a";
|
|
490
|
-
const t =
|
|
491
|
-
return
|
|
503
|
+
const t = Tt.get(e) || 0;
|
|
504
|
+
return Tt.set(e, t + 1), t ? `${e}${t}` : e;
|
|
492
505
|
}
|
|
493
|
-
function
|
|
506
|
+
function Jn(e) {
|
|
494
507
|
const t = [];
|
|
495
508
|
let n;
|
|
496
|
-
for (; n =
|
|
509
|
+
for (; n = Gn.exec(e); ) t.push(n[1]);
|
|
497
510
|
if (!t.length) return e;
|
|
498
511
|
const o = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
|
|
499
512
|
return t.forEach((s) => {
|
|
500
|
-
const i =
|
|
513
|
+
const i = Kn(s), r = s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
501
514
|
e = e.replace(new RegExp('([#;"])(' + r + ')([")]|\\.[a-z])', "g"), "$1" + i + o + "$3");
|
|
502
515
|
}), e = e.replace(new RegExp(o, "g"), ""), e;
|
|
503
516
|
}
|
|
504
|
-
const
|
|
505
|
-
function
|
|
506
|
-
|
|
517
|
+
const et = /* @__PURE__ */ Object.create(null);
|
|
518
|
+
function Zn(e, t) {
|
|
519
|
+
et[e] = t;
|
|
507
520
|
}
|
|
508
|
-
function
|
|
509
|
-
return
|
|
521
|
+
function tt(e) {
|
|
522
|
+
return et[e] || et[""];
|
|
510
523
|
}
|
|
511
|
-
function
|
|
524
|
+
function it(e) {
|
|
512
525
|
let t;
|
|
513
526
|
if (typeof e.resources == "string") t = [e.resources];
|
|
514
527
|
else if (t = e.resources, !(t instanceof Array) || !t.length) return null;
|
|
@@ -523,26 +536,26 @@ function st(e) {
|
|
|
523
536
|
dataAfterTimeout: e.dataAfterTimeout !== !1
|
|
524
537
|
};
|
|
525
538
|
}
|
|
526
|
-
const
|
|
527
|
-
for (;
|
|
528
|
-
|
|
529
|
-
function
|
|
530
|
-
const n =
|
|
531
|
-
return n === null ? !1 : (
|
|
539
|
+
const rt = /* @__PURE__ */ Object.create(null), be = ["https://api.simplesvg.com", "https://api.unisvg.com"], je = [];
|
|
540
|
+
for (; be.length > 0; ) be.length === 1 || Math.random() > 0.5 ? je.push(be.shift()) : je.push(be.pop());
|
|
541
|
+
rt[""] = it({ resources: ["https://api.iconify.design"].concat(je) });
|
|
542
|
+
function _n(e, t) {
|
|
543
|
+
const n = it(t);
|
|
544
|
+
return n === null ? !1 : (rt[e] = n, !0);
|
|
532
545
|
}
|
|
533
|
-
function
|
|
534
|
-
return
|
|
546
|
+
function at(e) {
|
|
547
|
+
return rt[e];
|
|
535
548
|
}
|
|
536
|
-
const
|
|
549
|
+
const eo = () => {
|
|
537
550
|
let e;
|
|
538
551
|
try {
|
|
539
552
|
if (e = fetch, typeof e == "function") return e;
|
|
540
553
|
} catch {
|
|
541
554
|
}
|
|
542
555
|
};
|
|
543
|
-
let
|
|
544
|
-
function
|
|
545
|
-
const n =
|
|
556
|
+
let kt = eo();
|
|
557
|
+
function to(e, t) {
|
|
558
|
+
const n = at(e);
|
|
546
559
|
if (!n) return 0;
|
|
547
560
|
let o;
|
|
548
561
|
if (!n.maxURL) o = 0;
|
|
@@ -556,39 +569,39 @@ function eo(e, t) {
|
|
|
556
569
|
}
|
|
557
570
|
return o;
|
|
558
571
|
}
|
|
559
|
-
function
|
|
572
|
+
function no(e) {
|
|
560
573
|
return e === 404;
|
|
561
574
|
}
|
|
562
|
-
const
|
|
563
|
-
const o = [], s =
|
|
575
|
+
const oo = (e, t, n) => {
|
|
576
|
+
const o = [], s = to(e, t), i = "icons";
|
|
564
577
|
let r = {
|
|
565
578
|
type: i,
|
|
566
579
|
provider: e,
|
|
567
580
|
prefix: t,
|
|
568
581
|
icons: []
|
|
569
582
|
}, a = 0;
|
|
570
|
-
return n.forEach((
|
|
571
|
-
a +=
|
|
583
|
+
return n.forEach((l, c) => {
|
|
584
|
+
a += l.length + 1, a >= s && c > 0 && (o.push(r), r = {
|
|
572
585
|
type: i,
|
|
573
586
|
provider: e,
|
|
574
587
|
prefix: t,
|
|
575
588
|
icons: []
|
|
576
|
-
}, a =
|
|
589
|
+
}, a = l.length), r.icons.push(l);
|
|
577
590
|
}), o.push(r), o;
|
|
578
591
|
};
|
|
579
|
-
function
|
|
592
|
+
function so(e) {
|
|
580
593
|
if (typeof e == "string") {
|
|
581
|
-
const t =
|
|
594
|
+
const t = at(e);
|
|
582
595
|
if (t) return t.path;
|
|
583
596
|
}
|
|
584
597
|
return "/";
|
|
585
598
|
}
|
|
586
|
-
const
|
|
587
|
-
if (!
|
|
599
|
+
const io = (e, t, n) => {
|
|
600
|
+
if (!kt) {
|
|
588
601
|
n("abort", 424);
|
|
589
602
|
return;
|
|
590
603
|
}
|
|
591
|
-
let o =
|
|
604
|
+
let o = so(t.provider);
|
|
592
605
|
switch (t.type) {
|
|
593
606
|
case "icons": {
|
|
594
607
|
const i = t.prefix, r = t.icons.join(","), a = new URLSearchParams({ icons: r });
|
|
@@ -605,11 +618,11 @@ const so = (e, t, n) => {
|
|
|
605
618
|
return;
|
|
606
619
|
}
|
|
607
620
|
let s = 503;
|
|
608
|
-
|
|
621
|
+
kt(e + o).then((i) => {
|
|
609
622
|
const r = i.status;
|
|
610
623
|
if (r !== 200) {
|
|
611
624
|
setTimeout(() => {
|
|
612
|
-
n(
|
|
625
|
+
n(no(r) ? "abort" : "next", r);
|
|
613
626
|
});
|
|
614
627
|
return;
|
|
615
628
|
}
|
|
@@ -627,17 +640,17 @@ const so = (e, t, n) => {
|
|
|
627
640
|
}).catch(() => {
|
|
628
641
|
n("next", s);
|
|
629
642
|
});
|
|
630
|
-
},
|
|
631
|
-
prepare:
|
|
632
|
-
send:
|
|
643
|
+
}, ro = {
|
|
644
|
+
prepare: oo,
|
|
645
|
+
send: io
|
|
633
646
|
};
|
|
634
|
-
function
|
|
647
|
+
function Zt(e, t) {
|
|
635
648
|
e.forEach((n) => {
|
|
636
649
|
const o = n.loaderCallbacks;
|
|
637
650
|
o && (n.loaderCallbacks = o.filter((s) => s.id !== t));
|
|
638
651
|
});
|
|
639
652
|
}
|
|
640
|
-
function
|
|
653
|
+
function ao(e) {
|
|
641
654
|
e.pendingCallbacksFlag || (e.pendingCallbacksFlag = !0, setTimeout(() => {
|
|
642
655
|
e.pendingCallbacksFlag = !1;
|
|
643
656
|
const t = e.loaderCallbacks ? e.loaderCallbacks.slice(0) : [];
|
|
@@ -646,29 +659,29 @@ function ro(e) {
|
|
|
646
659
|
const o = e.provider, s = e.prefix;
|
|
647
660
|
t.forEach((i) => {
|
|
648
661
|
const r = i.icons, a = r.pending.length;
|
|
649
|
-
r.pending = r.pending.filter((
|
|
650
|
-
if (
|
|
651
|
-
const
|
|
652
|
-
if (e.icons[
|
|
662
|
+
r.pending = r.pending.filter((l) => {
|
|
663
|
+
if (l.prefix !== s) return !0;
|
|
664
|
+
const c = l.name;
|
|
665
|
+
if (e.icons[c]) r.loaded.push({
|
|
653
666
|
provider: o,
|
|
654
667
|
prefix: s,
|
|
655
|
-
name:
|
|
668
|
+
name: c
|
|
656
669
|
});
|
|
657
|
-
else if (e.missing.has(
|
|
670
|
+
else if (e.missing.has(c)) r.missing.push({
|
|
658
671
|
provider: o,
|
|
659
672
|
prefix: s,
|
|
660
|
-
name:
|
|
673
|
+
name: c
|
|
661
674
|
});
|
|
662
675
|
else
|
|
663
676
|
return n = !0, !0;
|
|
664
677
|
return !1;
|
|
665
|
-
}), r.pending.length !== a && (n ||
|
|
678
|
+
}), r.pending.length !== a && (n || Zt([e], i.id), i.callback(r.loaded.slice(0), r.missing.slice(0), r.pending.slice(0), i.abort));
|
|
666
679
|
});
|
|
667
680
|
}));
|
|
668
681
|
}
|
|
669
|
-
let
|
|
682
|
+
let co = 0;
|
|
670
683
|
function lo(e, t, n) {
|
|
671
|
-
const o =
|
|
684
|
+
const o = co++, s = Zt.bind(null, n, o);
|
|
672
685
|
if (!t.pending.length) return s;
|
|
673
686
|
const i = {
|
|
674
687
|
id: o,
|
|
@@ -680,7 +693,7 @@ function lo(e, t, n) {
|
|
|
680
693
|
(r.loaderCallbacks || (r.loaderCallbacks = [])).push(i);
|
|
681
694
|
}), s;
|
|
682
695
|
}
|
|
683
|
-
function
|
|
696
|
+
function uo(e) {
|
|
684
697
|
const t = {
|
|
685
698
|
loaded: [],
|
|
686
699
|
missing: [],
|
|
@@ -695,9 +708,9 @@ function co(e) {
|
|
|
695
708
|
return e.forEach((s) => {
|
|
696
709
|
if (o.name === s.name && o.prefix === s.prefix && o.provider === s.provider) return;
|
|
697
710
|
o = s;
|
|
698
|
-
const i = s.provider, r = s.prefix, a = s.name,
|
|
711
|
+
const i = s.provider, r = s.prefix, a = s.name, l = n[i] || (n[i] = /* @__PURE__ */ Object.create(null)), c = l[r] || (l[r] = de(i, r));
|
|
699
712
|
let d;
|
|
700
|
-
a in
|
|
713
|
+
a in c.icons ? d = t.loaded : r === "" || c.missing.has(a) ? d = t.missing : d = t.pending;
|
|
701
714
|
const w = {
|
|
702
715
|
provider: i,
|
|
703
716
|
prefix: r,
|
|
@@ -706,14 +719,14 @@ function co(e) {
|
|
|
706
719
|
d.push(w);
|
|
707
720
|
}), t;
|
|
708
721
|
}
|
|
709
|
-
function
|
|
722
|
+
function fo(e, t = !0, n = !1) {
|
|
710
723
|
const o = [];
|
|
711
724
|
return e.forEach((s) => {
|
|
712
725
|
const i = typeof s == "string" ? Ye(s, t, n) : s;
|
|
713
726
|
i && o.push(i);
|
|
714
727
|
}), o;
|
|
715
728
|
}
|
|
716
|
-
const
|
|
729
|
+
const po = {
|
|
717
730
|
resources: [],
|
|
718
731
|
index: 0,
|
|
719
732
|
timeout: 2e3,
|
|
@@ -721,55 +734,55 @@ const fo = {
|
|
|
721
734
|
random: !1,
|
|
722
735
|
dataAfterTimeout: !1
|
|
723
736
|
};
|
|
724
|
-
function
|
|
737
|
+
function ho(e, t, n, o) {
|
|
725
738
|
const s = e.resources.length, i = e.random ? Math.floor(Math.random() * s) : e.index;
|
|
726
739
|
let r;
|
|
727
740
|
if (e.random) {
|
|
728
|
-
let
|
|
729
|
-
for (r = [];
|
|
730
|
-
const
|
|
731
|
-
r.push(
|
|
741
|
+
let v = e.resources.slice(0);
|
|
742
|
+
for (r = []; v.length > 1; ) {
|
|
743
|
+
const M = Math.floor(Math.random() * v.length);
|
|
744
|
+
r.push(v[M]), v = v.slice(0, M).concat(v.slice(M + 1));
|
|
732
745
|
}
|
|
733
|
-
r = r.concat(
|
|
746
|
+
r = r.concat(v);
|
|
734
747
|
} else r = e.resources.slice(i).concat(e.resources.slice(0, i));
|
|
735
748
|
const a = Date.now();
|
|
736
|
-
let
|
|
749
|
+
let l = "pending", c = 0, d, w = null, x = [], S = [];
|
|
737
750
|
typeof o == "function" && S.push(o);
|
|
738
|
-
function
|
|
751
|
+
function g() {
|
|
739
752
|
w && (clearTimeout(w), w = null);
|
|
740
753
|
}
|
|
741
754
|
function I() {
|
|
742
|
-
|
|
743
|
-
|
|
755
|
+
l === "pending" && (l = "aborted"), g(), x.forEach((v) => {
|
|
756
|
+
v.status === "pending" && (v.status = "aborted");
|
|
744
757
|
}), x = [];
|
|
745
758
|
}
|
|
746
|
-
function h(
|
|
747
|
-
|
|
759
|
+
function h(v, M) {
|
|
760
|
+
M && (S = []), typeof v == "function" && S.push(v);
|
|
748
761
|
}
|
|
749
|
-
function
|
|
762
|
+
function N() {
|
|
750
763
|
return {
|
|
751
764
|
startTime: a,
|
|
752
765
|
payload: t,
|
|
753
|
-
status:
|
|
754
|
-
queriesSent:
|
|
766
|
+
status: l,
|
|
767
|
+
queriesSent: c,
|
|
755
768
|
queriesPending: x.length,
|
|
756
769
|
subscribe: h,
|
|
757
770
|
abort: I
|
|
758
771
|
};
|
|
759
772
|
}
|
|
760
|
-
function
|
|
761
|
-
|
|
762
|
-
|
|
773
|
+
function O() {
|
|
774
|
+
l = "failed", S.forEach((v) => {
|
|
775
|
+
v(void 0, d);
|
|
763
776
|
});
|
|
764
777
|
}
|
|
765
778
|
function b() {
|
|
766
|
-
x.forEach((
|
|
767
|
-
|
|
779
|
+
x.forEach((v) => {
|
|
780
|
+
v.status === "pending" && (v.status = "aborted");
|
|
768
781
|
}), x = [];
|
|
769
782
|
}
|
|
770
|
-
function T(
|
|
771
|
-
const J =
|
|
772
|
-
switch (x = x.filter((
|
|
783
|
+
function T(v, M, W) {
|
|
784
|
+
const J = M !== "success";
|
|
785
|
+
switch (x = x.filter((E) => E !== v), l) {
|
|
773
786
|
case "pending":
|
|
774
787
|
break;
|
|
775
788
|
case "failed":
|
|
@@ -778,61 +791,61 @@ function po(e, t, n, o) {
|
|
|
778
791
|
default:
|
|
779
792
|
return;
|
|
780
793
|
}
|
|
781
|
-
if (
|
|
782
|
-
d =
|
|
794
|
+
if (M === "abort") {
|
|
795
|
+
d = W, O();
|
|
783
796
|
return;
|
|
784
797
|
}
|
|
785
798
|
if (J) {
|
|
786
|
-
d =
|
|
799
|
+
d = W, x.length || (r.length ? H() : O());
|
|
787
800
|
return;
|
|
788
801
|
}
|
|
789
|
-
if (
|
|
790
|
-
const
|
|
791
|
-
|
|
802
|
+
if (g(), b(), !e.random) {
|
|
803
|
+
const E = e.resources.indexOf(v.resource);
|
|
804
|
+
E !== -1 && E !== e.index && (e.index = E);
|
|
792
805
|
}
|
|
793
|
-
|
|
794
|
-
|
|
806
|
+
l = "completed", S.forEach((E) => {
|
|
807
|
+
E(W);
|
|
795
808
|
});
|
|
796
809
|
}
|
|
797
|
-
function
|
|
798
|
-
if (
|
|
799
|
-
|
|
800
|
-
const
|
|
801
|
-
if (
|
|
810
|
+
function H() {
|
|
811
|
+
if (l !== "pending") return;
|
|
812
|
+
g();
|
|
813
|
+
const v = r.shift();
|
|
814
|
+
if (v === void 0) {
|
|
802
815
|
if (x.length) {
|
|
803
816
|
w = setTimeout(() => {
|
|
804
|
-
|
|
817
|
+
g(), l === "pending" && (b(), O());
|
|
805
818
|
}, e.timeout);
|
|
806
819
|
return;
|
|
807
820
|
}
|
|
808
|
-
|
|
821
|
+
O();
|
|
809
822
|
return;
|
|
810
823
|
}
|
|
811
|
-
const
|
|
824
|
+
const M = {
|
|
812
825
|
status: "pending",
|
|
813
|
-
resource:
|
|
814
|
-
callback: (
|
|
815
|
-
T(
|
|
826
|
+
resource: v,
|
|
827
|
+
callback: (W, J) => {
|
|
828
|
+
T(M, W, J);
|
|
816
829
|
}
|
|
817
830
|
};
|
|
818
|
-
x.push(
|
|
831
|
+
x.push(M), c++, w = setTimeout(H, e.rotate), n(v, t, M.callback);
|
|
819
832
|
}
|
|
820
|
-
return setTimeout(
|
|
833
|
+
return setTimeout(H), N;
|
|
821
834
|
}
|
|
822
|
-
function
|
|
835
|
+
function _t(e) {
|
|
823
836
|
const t = {
|
|
824
|
-
...
|
|
837
|
+
...po,
|
|
825
838
|
...e
|
|
826
839
|
};
|
|
827
840
|
let n = [];
|
|
828
841
|
function o() {
|
|
829
842
|
n = n.filter((r) => r().status === "pending");
|
|
830
843
|
}
|
|
831
|
-
function s(r, a,
|
|
832
|
-
const
|
|
833
|
-
o(),
|
|
844
|
+
function s(r, a, l) {
|
|
845
|
+
const c = ho(t, r, a, (d, w) => {
|
|
846
|
+
o(), l && l(d, w);
|
|
834
847
|
});
|
|
835
|
-
return n.push(
|
|
848
|
+
return n.push(c), c;
|
|
836
849
|
}
|
|
837
850
|
function i(r) {
|
|
838
851
|
return n.find((a) => r(a)) || null;
|
|
@@ -847,56 +860,56 @@ function Zt(e) {
|
|
|
847
860
|
cleanup: o
|
|
848
861
|
};
|
|
849
862
|
}
|
|
850
|
-
function
|
|
863
|
+
function It() {
|
|
851
864
|
}
|
|
852
865
|
const We = /* @__PURE__ */ Object.create(null);
|
|
853
|
-
function
|
|
866
|
+
function mo(e) {
|
|
854
867
|
if (!We[e]) {
|
|
855
|
-
const t =
|
|
868
|
+
const t = at(e);
|
|
856
869
|
if (!t) return;
|
|
857
870
|
We[e] = {
|
|
858
871
|
config: t,
|
|
859
|
-
redundancy:
|
|
872
|
+
redundancy: _t(t)
|
|
860
873
|
};
|
|
861
874
|
}
|
|
862
875
|
return We[e];
|
|
863
876
|
}
|
|
864
|
-
function
|
|
877
|
+
function go(e, t, n) {
|
|
865
878
|
let o, s;
|
|
866
879
|
if (typeof e == "string") {
|
|
867
|
-
const i =
|
|
880
|
+
const i = tt(e);
|
|
868
881
|
if (!i)
|
|
869
|
-
return n(void 0, 424),
|
|
882
|
+
return n(void 0, 424), It;
|
|
870
883
|
s = i.send;
|
|
871
|
-
const r =
|
|
884
|
+
const r = mo(e);
|
|
872
885
|
r && (o = r.redundancy);
|
|
873
886
|
} else {
|
|
874
|
-
const i =
|
|
887
|
+
const i = it(e);
|
|
875
888
|
if (i) {
|
|
876
|
-
o =
|
|
877
|
-
const r =
|
|
889
|
+
o = _t(i);
|
|
890
|
+
const r = tt(e.resources ? e.resources[0] : "");
|
|
878
891
|
r && (s = r.send);
|
|
879
892
|
}
|
|
880
893
|
}
|
|
881
|
-
return !o || !s ? (n(void 0, 424),
|
|
894
|
+
return !o || !s ? (n(void 0, 424), It) : o.query(t, s, n)().abort;
|
|
882
895
|
}
|
|
883
|
-
function
|
|
896
|
+
function St() {
|
|
884
897
|
}
|
|
885
|
-
function
|
|
898
|
+
function vo(e) {
|
|
886
899
|
e.iconsLoaderFlag || (e.iconsLoaderFlag = !0, setTimeout(() => {
|
|
887
|
-
e.iconsLoaderFlag = !1,
|
|
900
|
+
e.iconsLoaderFlag = !1, ao(e);
|
|
888
901
|
}));
|
|
889
902
|
}
|
|
890
|
-
function
|
|
903
|
+
function yo(e) {
|
|
891
904
|
const t = [], n = [];
|
|
892
905
|
return e.forEach((o) => {
|
|
893
|
-
(o.match(
|
|
906
|
+
(o.match(zt) ? t : n).push(o);
|
|
894
907
|
}), {
|
|
895
908
|
valid: t,
|
|
896
909
|
invalid: n
|
|
897
910
|
};
|
|
898
911
|
}
|
|
899
|
-
function
|
|
912
|
+
function Te(e, t, n) {
|
|
900
913
|
function o() {
|
|
901
914
|
const s = e.pendingIcons;
|
|
902
915
|
t.forEach((i) => {
|
|
@@ -904,65 +917,65 @@ function ke(e, t, n) {
|
|
|
904
917
|
});
|
|
905
918
|
}
|
|
906
919
|
if (n && typeof n == "object") try {
|
|
907
|
-
if (!
|
|
920
|
+
if (!Wt(e, n).length) {
|
|
908
921
|
o();
|
|
909
922
|
return;
|
|
910
923
|
}
|
|
911
924
|
} catch (s) {
|
|
912
925
|
console.error(s);
|
|
913
926
|
}
|
|
914
|
-
o(),
|
|
927
|
+
o(), vo(e);
|
|
915
928
|
}
|
|
916
|
-
function
|
|
929
|
+
function Et(e, t) {
|
|
917
930
|
e instanceof Promise ? e.then((n) => {
|
|
918
931
|
t(n);
|
|
919
932
|
}).catch(() => {
|
|
920
933
|
t(null);
|
|
921
934
|
}) : t(e);
|
|
922
935
|
}
|
|
923
|
-
function
|
|
936
|
+
function wo(e, t) {
|
|
924
937
|
e.iconsToLoad ? e.iconsToLoad = e.iconsToLoad.concat(t).sort() : e.iconsToLoad = t, e.iconsQueueFlag || (e.iconsQueueFlag = !0, setTimeout(() => {
|
|
925
938
|
e.iconsQueueFlag = !1;
|
|
926
939
|
const { provider: n, prefix: o } = e, s = e.iconsToLoad;
|
|
927
940
|
if (delete e.iconsToLoad, !s || !s.length) return;
|
|
928
941
|
const i = e.loadIcon;
|
|
929
942
|
if (e.loadIcons && (s.length > 1 || !i)) {
|
|
930
|
-
|
|
931
|
-
|
|
943
|
+
Et(e.loadIcons(s, o, n), (c) => {
|
|
944
|
+
Te(e, s, c);
|
|
932
945
|
});
|
|
933
946
|
return;
|
|
934
947
|
}
|
|
935
948
|
if (i) {
|
|
936
|
-
s.forEach((
|
|
937
|
-
|
|
938
|
-
|
|
949
|
+
s.forEach((c) => {
|
|
950
|
+
Et(i(c, o, n), (d) => {
|
|
951
|
+
Te(e, [c], d ? {
|
|
939
952
|
prefix: o,
|
|
940
|
-
icons: { [
|
|
953
|
+
icons: { [c]: d }
|
|
941
954
|
} : null);
|
|
942
955
|
});
|
|
943
956
|
});
|
|
944
957
|
return;
|
|
945
958
|
}
|
|
946
|
-
const { valid: r, invalid: a } =
|
|
947
|
-
if (a.length &&
|
|
948
|
-
const
|
|
949
|
-
if (!
|
|
950
|
-
|
|
959
|
+
const { valid: r, invalid: a } = yo(s);
|
|
960
|
+
if (a.length && Te(e, a, null), !r.length) return;
|
|
961
|
+
const l = o.match(zt) ? tt(n) : null;
|
|
962
|
+
if (!l) {
|
|
963
|
+
Te(e, r, null);
|
|
951
964
|
return;
|
|
952
965
|
}
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
966
|
+
l.prepare(n, o, r).forEach((c) => {
|
|
967
|
+
go(n, c, (d) => {
|
|
968
|
+
Te(e, c.icons, d);
|
|
956
969
|
});
|
|
957
970
|
});
|
|
958
971
|
}));
|
|
959
972
|
}
|
|
960
|
-
const
|
|
961
|
-
const n =
|
|
973
|
+
const xo = (e, t) => {
|
|
974
|
+
const n = uo(fo(e, !0, Gt()));
|
|
962
975
|
if (!n.pending.length) {
|
|
963
976
|
let a = !0;
|
|
964
977
|
return t && setTimeout(() => {
|
|
965
|
-
a && t(n.loaded, n.missing, n.pending,
|
|
978
|
+
a && t(n.loaded, n.missing, n.pending, St);
|
|
966
979
|
}), () => {
|
|
967
980
|
a = !1;
|
|
968
981
|
};
|
|
@@ -970,30 +983,30 @@ const wo = (e, t) => {
|
|
|
970
983
|
const o = /* @__PURE__ */ Object.create(null), s = [];
|
|
971
984
|
let i, r;
|
|
972
985
|
return n.pending.forEach((a) => {
|
|
973
|
-
const { provider:
|
|
974
|
-
if (
|
|
975
|
-
i =
|
|
976
|
-
const d = o[
|
|
977
|
-
d[
|
|
986
|
+
const { provider: l, prefix: c } = a;
|
|
987
|
+
if (c === r && l === i) return;
|
|
988
|
+
i = l, r = c, s.push(de(l, c));
|
|
989
|
+
const d = o[l] || (o[l] = /* @__PURE__ */ Object.create(null));
|
|
990
|
+
d[c] || (d[c] = []);
|
|
978
991
|
}), n.pending.forEach((a) => {
|
|
979
|
-
const { provider:
|
|
980
|
-
x.has(d) || (x.add(d), o[
|
|
992
|
+
const { provider: l, prefix: c, name: d } = a, w = de(l, c), x = w.pendingIcons || (w.pendingIcons = /* @__PURE__ */ new Set());
|
|
993
|
+
x.has(d) || (x.add(d), o[l][c].push(d));
|
|
981
994
|
}), s.forEach((a) => {
|
|
982
|
-
const
|
|
983
|
-
|
|
984
|
-
}), t ? lo(t, n, s) :
|
|
995
|
+
const l = o[a.provider][a.prefix];
|
|
996
|
+
l.length && wo(a, l);
|
|
997
|
+
}), t ? lo(t, n, s) : St;
|
|
985
998
|
};
|
|
986
|
-
function
|
|
999
|
+
function bo(e, t) {
|
|
987
1000
|
const n = { ...e };
|
|
988
1001
|
for (const o in t) {
|
|
989
1002
|
const s = t[o], i = typeof s;
|
|
990
|
-
o in
|
|
1003
|
+
o in Kt ? (s === null || s && (i === "string" || i === "number")) && (n[o] = s) : i === typeof n[o] && (n[o] = o === "rotate" ? s % 4 : s);
|
|
991
1004
|
}
|
|
992
1005
|
return n;
|
|
993
1006
|
}
|
|
994
|
-
const
|
|
995
|
-
function
|
|
996
|
-
t.split(
|
|
1007
|
+
const To = /[\s,]+/;
|
|
1008
|
+
function ko(e, t) {
|
|
1009
|
+
t.split(To).forEach((n) => {
|
|
997
1010
|
switch (n.trim()) {
|
|
998
1011
|
case "horizontal":
|
|
999
1012
|
e.hFlip = !0;
|
|
@@ -1004,7 +1017,7 @@ function To(e, t) {
|
|
|
1004
1017
|
}
|
|
1005
1018
|
});
|
|
1006
1019
|
}
|
|
1007
|
-
function
|
|
1020
|
+
function Io(e, t = 0) {
|
|
1008
1021
|
const n = e.replace(/^-?[0-9.]*/, "");
|
|
1009
1022
|
function o(s) {
|
|
1010
1023
|
for (; s < 0; ) s += 4;
|
|
@@ -1029,22 +1042,22 @@ function ko(e, t = 0) {
|
|
|
1029
1042
|
}
|
|
1030
1043
|
return t;
|
|
1031
1044
|
}
|
|
1032
|
-
function
|
|
1045
|
+
function So(e, t) {
|
|
1033
1046
|
let n = e.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
|
|
1034
1047
|
for (const o in t) n += " " + o + '="' + t[o] + '"';
|
|
1035
1048
|
return '<svg xmlns="http://www.w3.org/2000/svg"' + n + ">" + e + "</svg>";
|
|
1036
1049
|
}
|
|
1037
|
-
function So(e) {
|
|
1038
|
-
return e.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
|
|
1039
|
-
}
|
|
1040
1050
|
function Eo(e) {
|
|
1041
|
-
return "
|
|
1051
|
+
return e.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
|
|
1042
1052
|
}
|
|
1043
1053
|
function Po(e) {
|
|
1044
|
-
return
|
|
1054
|
+
return "data:image/svg+xml," + Eo(e);
|
|
1045
1055
|
}
|
|
1046
|
-
|
|
1047
|
-
|
|
1056
|
+
function Lo(e) {
|
|
1057
|
+
return 'url("' + Po(e) + '")';
|
|
1058
|
+
}
|
|
1059
|
+
const Pt = {
|
|
1060
|
+
...Jt,
|
|
1048
1061
|
inline: !1
|
|
1049
1062
|
}, Co = {
|
|
1050
1063
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1053,23 +1066,23 @@ const Et = {
|
|
|
1053
1066
|
role: "img"
|
|
1054
1067
|
}, Ao = {
|
|
1055
1068
|
display: "inline-block"
|
|
1056
|
-
},
|
|
1069
|
+
}, nt = {
|
|
1057
1070
|
backgroundColor: "currentColor"
|
|
1058
|
-
},
|
|
1071
|
+
}, en = {
|
|
1059
1072
|
backgroundColor: "transparent"
|
|
1060
|
-
},
|
|
1073
|
+
}, Lt = {
|
|
1061
1074
|
Image: "var(--svg)",
|
|
1062
1075
|
Repeat: "no-repeat",
|
|
1063
1076
|
Size: "100% 100%"
|
|
1064
1077
|
}, Ct = {
|
|
1065
|
-
webkitMask:
|
|
1066
|
-
mask:
|
|
1067
|
-
background:
|
|
1078
|
+
webkitMask: nt,
|
|
1079
|
+
mask: nt,
|
|
1080
|
+
background: en
|
|
1068
1081
|
};
|
|
1069
1082
|
for (const e in Ct) {
|
|
1070
1083
|
const t = Ct[e];
|
|
1071
|
-
for (const n in
|
|
1072
|
-
t[e + n] =
|
|
1084
|
+
for (const n in Lt)
|
|
1085
|
+
t[e + n] = Lt[n];
|
|
1073
1086
|
}
|
|
1074
1087
|
const Re = {};
|
|
1075
1088
|
["horizontal", "vertical"].forEach((e) => {
|
|
@@ -1079,8 +1092,8 @@ const Re = {};
|
|
|
1079
1092
|
function At(e) {
|
|
1080
1093
|
return e + (e.match(/^[-0-9.]+$/) ? "px" : "");
|
|
1081
1094
|
}
|
|
1082
|
-
const
|
|
1083
|
-
const n =
|
|
1095
|
+
const Ot = (e, t) => {
|
|
1096
|
+
const n = bo(Pt, t), o = { ...Co }, s = t.mode || "svg", i = {}, r = t.style, a = typeof r == "object" && !(r instanceof Array) ? r : {};
|
|
1084
1097
|
for (let I in t) {
|
|
1085
1098
|
const h = t[I];
|
|
1086
1099
|
if (h !== void 0)
|
|
@@ -1098,47 +1111,47 @@ const Lt = (e, t) => {
|
|
|
1098
1111
|
n[I] = h === !0 || h === "true" || h === 1;
|
|
1099
1112
|
break;
|
|
1100
1113
|
case "flip":
|
|
1101
|
-
typeof h == "string" &&
|
|
1114
|
+
typeof h == "string" && ko(n, h);
|
|
1102
1115
|
break;
|
|
1103
1116
|
case "color":
|
|
1104
1117
|
i.color = h;
|
|
1105
1118
|
break;
|
|
1106
1119
|
case "rotate":
|
|
1107
|
-
typeof h == "string" ? n[I] =
|
|
1120
|
+
typeof h == "string" ? n[I] = Io(h) : typeof h == "number" && (n[I] = h);
|
|
1108
1121
|
break;
|
|
1109
1122
|
case "ariaHidden":
|
|
1110
1123
|
case "aria-hidden":
|
|
1111
1124
|
h !== !0 && h !== "true" && delete o["aria-hidden"];
|
|
1112
1125
|
break;
|
|
1113
1126
|
default: {
|
|
1114
|
-
const
|
|
1115
|
-
|
|
1127
|
+
const N = Re[I];
|
|
1128
|
+
N ? (h === !0 || h === "true" || h === 1) && (n[N] = !0) : Pt[I] === void 0 && (o[I] = h);
|
|
1116
1129
|
}
|
|
1117
1130
|
}
|
|
1118
1131
|
}
|
|
1119
|
-
const
|
|
1132
|
+
const l = Wn(e, n), c = l.attributes;
|
|
1120
1133
|
if (n.inline && (i.verticalAlign = "-0.125em"), s === "svg")
|
|
1121
1134
|
return o.style = {
|
|
1122
1135
|
...i,
|
|
1123
1136
|
...a
|
|
1124
|
-
}, Object.assign(o,
|
|
1125
|
-
const { body: d, width: w, height: x } = e, S = s === "mask" || (s === "bg" ? !1 : d.indexOf("currentColor") !== -1),
|
|
1126
|
-
...
|
|
1137
|
+
}, Object.assign(o, c), o.innerHTML = Jn(l.body), Ge("svg", o);
|
|
1138
|
+
const { body: d, width: w, height: x } = e, S = s === "mask" || (s === "bg" ? !1 : d.indexOf("currentColor") !== -1), g = So(d, {
|
|
1139
|
+
...c,
|
|
1127
1140
|
width: w + "",
|
|
1128
1141
|
height: x + ""
|
|
1129
1142
|
});
|
|
1130
1143
|
return o.style = {
|
|
1131
1144
|
...i,
|
|
1132
|
-
"--svg":
|
|
1133
|
-
width: At(
|
|
1134
|
-
height: At(
|
|
1145
|
+
"--svg": Lo(g),
|
|
1146
|
+
width: At(c.width),
|
|
1147
|
+
height: At(c.height),
|
|
1135
1148
|
...Ao,
|
|
1136
|
-
...S ?
|
|
1149
|
+
...S ? nt : en,
|
|
1137
1150
|
...a
|
|
1138
1151
|
}, Ge("span", o);
|
|
1139
1152
|
};
|
|
1140
|
-
|
|
1141
|
-
|
|
1153
|
+
Gt(!0);
|
|
1154
|
+
Zn("", ro);
|
|
1142
1155
|
if (typeof document < "u" && typeof window < "u") {
|
|
1143
1156
|
const e = window;
|
|
1144
1157
|
if (e.IconifyPreload !== void 0) {
|
|
@@ -1148,7 +1161,7 @@ if (typeof document < "u" && typeof window < "u") {
|
|
|
1148
1161
|
// Check if item is an object and not null/array
|
|
1149
1162
|
(typeof o != "object" || o === null || o instanceof Array || // Check for 'icons' and 'prefix'
|
|
1150
1163
|
typeof o.icons != "object" || typeof o.prefix != "string" || // Add icon set
|
|
1151
|
-
!
|
|
1164
|
+
!qn(o)) && console.error(n);
|
|
1152
1165
|
} catch {
|
|
1153
1166
|
console.error(n);
|
|
1154
1167
|
}
|
|
@@ -1163,72 +1176,72 @@ if (typeof document < "u" && typeof window < "u") {
|
|
|
1163
1176
|
const s = t[n];
|
|
1164
1177
|
if (typeof s != "object" || !s || s.resources === void 0)
|
|
1165
1178
|
continue;
|
|
1166
|
-
|
|
1179
|
+
_n(n, s) || console.error(o);
|
|
1167
1180
|
} catch {
|
|
1168
1181
|
console.error(o);
|
|
1169
1182
|
}
|
|
1170
1183
|
}
|
|
1171
1184
|
}
|
|
1172
1185
|
}
|
|
1173
|
-
const
|
|
1186
|
+
const Oo = {
|
|
1174
1187
|
...ze,
|
|
1175
1188
|
body: ""
|
|
1176
|
-
},
|
|
1189
|
+
}, tn = pe((e, { emit: t }) => {
|
|
1177
1190
|
const n = R(null);
|
|
1178
1191
|
function o() {
|
|
1179
|
-
var
|
|
1180
|
-
n.value && ((d = (
|
|
1192
|
+
var c, d;
|
|
1193
|
+
n.value && ((d = (c = n.value).abort) == null || d.call(c), n.value = null);
|
|
1181
1194
|
}
|
|
1182
|
-
const s = R(!!e.ssr), i = R(""), r =
|
|
1195
|
+
const s = R(!!e.ssr), i = R(""), r = un(null);
|
|
1183
1196
|
function a() {
|
|
1184
|
-
const
|
|
1185
|
-
if (typeof
|
|
1197
|
+
const c = e.icon;
|
|
1198
|
+
if (typeof c == "object" && c !== null && typeof c.body == "string")
|
|
1186
1199
|
return i.value = "", {
|
|
1187
|
-
data:
|
|
1200
|
+
data: c
|
|
1188
1201
|
};
|
|
1189
1202
|
let d;
|
|
1190
|
-
if (typeof
|
|
1203
|
+
if (typeof c != "string" || (d = Ye(c, !1, !0)) === null)
|
|
1191
1204
|
return null;
|
|
1192
|
-
let w =
|
|
1205
|
+
let w = Hn(d);
|
|
1193
1206
|
if (!w) {
|
|
1194
|
-
const
|
|
1195
|
-
return (!
|
|
1196
|
-
name:
|
|
1207
|
+
const g = n.value;
|
|
1208
|
+
return (!g || g.name !== c) && (w === null ? n.value = {
|
|
1209
|
+
name: c
|
|
1197
1210
|
} : n.value = {
|
|
1198
|
-
name:
|
|
1199
|
-
abort:
|
|
1211
|
+
name: c,
|
|
1212
|
+
abort: xo([d], l)
|
|
1200
1213
|
}), null;
|
|
1201
1214
|
}
|
|
1202
|
-
o(), i.value !==
|
|
1203
|
-
t("load",
|
|
1215
|
+
o(), i.value !== c && (i.value = c, ke(() => {
|
|
1216
|
+
t("load", c);
|
|
1204
1217
|
}));
|
|
1205
1218
|
const x = e.customise;
|
|
1206
1219
|
if (x) {
|
|
1207
1220
|
w = Object.assign({}, w);
|
|
1208
|
-
const
|
|
1209
|
-
typeof
|
|
1221
|
+
const g = x(w.body, d.name, d.prefix, d.provider);
|
|
1222
|
+
typeof g == "string" && (w.body = g);
|
|
1210
1223
|
}
|
|
1211
1224
|
const S = ["iconify"];
|
|
1212
1225
|
return d.prefix !== "" && S.push("iconify--" + d.prefix), d.provider !== "" && S.push("iconify--" + d.provider), { data: w, classes: S };
|
|
1213
1226
|
}
|
|
1214
|
-
function
|
|
1227
|
+
function l() {
|
|
1215
1228
|
var d;
|
|
1216
|
-
const
|
|
1217
|
-
|
|
1229
|
+
const c = a();
|
|
1230
|
+
c ? c.data !== ((d = r.value) == null ? void 0 : d.data) && (r.value = c) : r.value = null;
|
|
1218
1231
|
}
|
|
1219
|
-
return s.value ?
|
|
1220
|
-
s.value = !0,
|
|
1221
|
-
}), G(() => e.icon,
|
|
1222
|
-
const
|
|
1223
|
-
if (!
|
|
1224
|
-
return
|
|
1232
|
+
return s.value ? l() : qe(() => {
|
|
1233
|
+
s.value = !0, l();
|
|
1234
|
+
}), G(() => e.icon, l), Ve(o), () => {
|
|
1235
|
+
const c = r.value;
|
|
1236
|
+
if (!c)
|
|
1237
|
+
return Ot(Oo, e);
|
|
1225
1238
|
let d = e;
|
|
1226
|
-
return
|
|
1239
|
+
return c.classes && (d = {
|
|
1227
1240
|
...e,
|
|
1228
|
-
class:
|
|
1229
|
-
}),
|
|
1241
|
+
class: c.classes.join(" ")
|
|
1242
|
+
}), Ot({
|
|
1230
1243
|
...ze,
|
|
1231
|
-
...
|
|
1244
|
+
...c.data
|
|
1232
1245
|
}, d);
|
|
1233
1246
|
};
|
|
1234
1247
|
}, {
|
|
@@ -1258,38 +1271,38 @@ const Lo = {
|
|
|
1258
1271
|
],
|
|
1259
1272
|
emits: ["load"]
|
|
1260
1273
|
});
|
|
1261
|
-
let
|
|
1274
|
+
let Mt = !1;
|
|
1262
1275
|
const ue = {
|
|
1263
1276
|
width: 24,
|
|
1264
1277
|
height: 24
|
|
1265
|
-
},
|
|
1266
|
-
|
|
1278
|
+
}, nn = () => {
|
|
1279
|
+
Mt || (Mt = !0, ie("lucide:circle-check", {
|
|
1267
1280
|
...ue,
|
|
1268
1281
|
body: '<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><circle cx="12" cy="12" r="10"/><path d="m9 12l2 2l4-4"/></g>'
|
|
1269
|
-
}),
|
|
1282
|
+
}), ie("lucide:circle-x", {
|
|
1270
1283
|
...ue,
|
|
1271
1284
|
body: '<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><circle cx="12" cy="12" r="10"/><path d="m15 9l-6 6m0-6l6 6"/></g>'
|
|
1272
|
-
}),
|
|
1285
|
+
}), ie("lucide:triangle-alert", {
|
|
1273
1286
|
...ue,
|
|
1274
1287
|
body: '<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m21.73 18l-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3M12 9v4m0 4h.01"/>'
|
|
1275
|
-
}),
|
|
1288
|
+
}), ie("lucide:info", {
|
|
1276
1289
|
...ue,
|
|
1277
1290
|
body: '<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4m0-4h.01"/></g>'
|
|
1278
|
-
}),
|
|
1291
|
+
}), ie("lucide:bell", {
|
|
1279
1292
|
...ue,
|
|
1280
1293
|
body: '<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.268 21a2 2 0 0 0 3.464 0m-10.47-5.674A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326"/>'
|
|
1281
|
-
}),
|
|
1294
|
+
}), ie("lucide:loader-circle", {
|
|
1282
1295
|
...ue,
|
|
1283
1296
|
body: '<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 1 1-6.219-8.56"/>'
|
|
1284
1297
|
}));
|
|
1285
|
-
},
|
|
1298
|
+
}, Mo = { class: "soft-toast-icon" }, Dt = /* @__PURE__ */ pe({
|
|
1286
1299
|
__name: "ToastIcon",
|
|
1287
1300
|
props: {
|
|
1288
1301
|
type: {},
|
|
1289
1302
|
customIcon: {}
|
|
1290
1303
|
},
|
|
1291
1304
|
setup(e) {
|
|
1292
|
-
|
|
1305
|
+
nn();
|
|
1293
1306
|
const t = e, n = {
|
|
1294
1307
|
success: "lucide:circle-check",
|
|
1295
1308
|
error: "lucide:circle-x",
|
|
@@ -1297,8 +1310,8 @@ const ue = {
|
|
|
1297
1310
|
info: "lucide:info",
|
|
1298
1311
|
default: "lucide:bell"
|
|
1299
1312
|
}, o = () => t.customIcon ? t.customIcon : n[t.type] || n.default;
|
|
1300
|
-
return (s, i) => (
|
|
1301
|
-
|
|
1313
|
+
return (s, i) => (P(), $("span", Mo, [
|
|
1314
|
+
st(Nt(tn), {
|
|
1302
1315
|
class: "soft-toast-icon-svg",
|
|
1303
1316
|
icon: o(),
|
|
1304
1317
|
width: 18,
|
|
@@ -1328,32 +1341,32 @@ const ue = {
|
|
|
1328
1341
|
duration: 0.5
|
|
1329
1342
|
}
|
|
1330
1343
|
};
|
|
1331
|
-
|
|
1332
|
-
const
|
|
1344
|
+
F.defaults({ overwrite: "auto" });
|
|
1345
|
+
const Do = typeof window < "u" && window.matchMedia("(pointer: coarse)").matches, fe = (e) => Do ? e * 0.65 : e, Fo = 0.22, ot = "power2.out", Bo = (e) => {
|
|
1333
1346
|
const t = 0.8 + e * 0.8, n = 0.55 - e * 0.15;
|
|
1334
1347
|
return `elastic.out(${t.toFixed(2)}, ${n.toFixed(2)})`;
|
|
1335
|
-
},
|
|
1336
|
-
const n = Number(
|
|
1337
|
-
return s < 0.5 ?
|
|
1348
|
+
}, jo = (e, t, n) => Math.max(t, Math.min(n, e)), Ft = (e, t) => {
|
|
1349
|
+
const n = Number(F.getProperty(e, "y")) || 0, o = t.y - n, s = Math.abs(o);
|
|
1350
|
+
return s < 0.5 ? F.to(e, {
|
|
1338
1351
|
y: t.y,
|
|
1339
1352
|
scale: t.scale,
|
|
1340
1353
|
opacity: t.opacity,
|
|
1341
1354
|
force3D: !0,
|
|
1342
1355
|
overwrite: !0,
|
|
1343
|
-
duration:
|
|
1344
|
-
ease:
|
|
1345
|
-
}) :
|
|
1356
|
+
duration: Fo,
|
|
1357
|
+
ease: ot
|
|
1358
|
+
}) : F.to(e, {
|
|
1346
1359
|
y: t.y,
|
|
1347
1360
|
scale: t.scale,
|
|
1348
1361
|
opacity: t.opacity,
|
|
1349
1362
|
force3D: !0,
|
|
1350
1363
|
overwrite: !0,
|
|
1351
|
-
duration:
|
|
1364
|
+
duration: fe(jo(0.34 + s * 3e-3, 0.36, 0.46)),
|
|
1352
1365
|
ease: "sine.out"
|
|
1353
1366
|
});
|
|
1354
|
-
},
|
|
1355
|
-
const { direction: n = "up", preset: o = "smooth" } = t, s = He[o] || He.smooth, i = n === "down" ? -14 : 14, r =
|
|
1356
|
-
return
|
|
1367
|
+
}, Ro = (e, t = {}) => {
|
|
1368
|
+
const { direction: n = "up", preset: o = "smooth" } = t, s = He[o] || He.smooth, i = n === "down" ? -14 : 14, r = fe(Math.min(s.duration, 0.46)), a = o === "bouncy" ? "back.out(1.35)" : ot, l = F.timeline(), c = e.querySelector(".soft-toast-extra");
|
|
1369
|
+
return c && F.set(c, { height: 0, opacity: 0 }), l.fromTo(
|
|
1357
1370
|
e,
|
|
1358
1371
|
{ y: i, opacity: 0, scale: 0.94 },
|
|
1359
1372
|
{
|
|
@@ -1364,35 +1377,38 @@ const Mo = typeof window < "u" && window.matchMedia("(pointer: coarse)").matches
|
|
|
1364
1377
|
ease: a,
|
|
1365
1378
|
transformOrigin: n === "down" ? "top center" : "bottom center"
|
|
1366
1379
|
}
|
|
1367
|
-
),
|
|
1380
|
+
), c && l.to(c, {
|
|
1368
1381
|
height: "auto",
|
|
1369
1382
|
opacity: 1,
|
|
1370
|
-
duration:
|
|
1383
|
+
duration: fe(0.36),
|
|
1371
1384
|
force3D: !0,
|
|
1372
|
-
ease:
|
|
1385
|
+
ease: ot,
|
|
1373
1386
|
clearProps: "overflow"
|
|
1374
|
-
}, "-=0.32"),
|
|
1375
|
-
},
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1387
|
+
}, "-=0.32"), l;
|
|
1388
|
+
}, $o = (e) => {
|
|
1389
|
+
const t = F.timeline();
|
|
1390
|
+
return t.to(e, {
|
|
1391
|
+
scale: 0.85,
|
|
1392
|
+
opacity: 0,
|
|
1393
|
+
force3D: !0,
|
|
1394
|
+
overwrite: "auto",
|
|
1395
|
+
duration: 0.2,
|
|
1396
|
+
ease: "power2.out"
|
|
1397
|
+
}), t.to(e, {
|
|
1398
|
+
height: 0,
|
|
1399
|
+
paddingTop: 0,
|
|
1400
|
+
paddingBottom: 0,
|
|
1401
|
+
marginBottom: 0,
|
|
1402
|
+
duration: 0.14,
|
|
1403
|
+
ease: "power2.in"
|
|
1404
|
+
}, "-=0.05"), t;
|
|
1405
|
+
}, No = (e, t) => F.to(e, {
|
|
1383
1406
|
x: t,
|
|
1384
1407
|
opacity: 0,
|
|
1385
1408
|
force3D: !0,
|
|
1386
1409
|
overwrite: "auto",
|
|
1387
1410
|
duration: 0.28,
|
|
1388
1411
|
ease: "power3.out"
|
|
1389
|
-
}), No = (e) => O.to(e, {
|
|
1390
|
-
x: 0,
|
|
1391
|
-
opacity: 1,
|
|
1392
|
-
force3D: !0,
|
|
1393
|
-
overwrite: "auto",
|
|
1394
|
-
duration: de(0.45),
|
|
1395
|
-
ease: "elastic.out(1, 0.55)"
|
|
1396
1412
|
}), Ho = (e, t) => {
|
|
1397
1413
|
const {
|
|
1398
1414
|
index: n,
|
|
@@ -1401,49 +1417,64 @@ const Mo = typeof window < "u" && window.matchMedia("(pointer: coarse)").matches
|
|
|
1401
1417
|
bounce: i = 0.4,
|
|
1402
1418
|
spring: r = !0,
|
|
1403
1419
|
direction: a = "up",
|
|
1404
|
-
expandedOffset:
|
|
1405
|
-
liftPx:
|
|
1420
|
+
expandedOffset: l = 0,
|
|
1421
|
+
liftPx: c = 14,
|
|
1406
1422
|
scaleStep: d = 0.055,
|
|
1407
1423
|
opacityStep: w = 0.2,
|
|
1408
1424
|
maxVisible: x = 3,
|
|
1409
|
-
reposition: S = !1
|
|
1410
|
-
|
|
1425
|
+
reposition: S = !1,
|
|
1426
|
+
resetSwipe: g = !1
|
|
1427
|
+
} = t, I = He[s] || He.smooth, h = a === "up" ? -1 : 1;
|
|
1411
1428
|
if (o) {
|
|
1412
|
-
const
|
|
1413
|
-
|
|
1429
|
+
const M = {
|
|
1430
|
+
x: g ? 0 : void 0,
|
|
1431
|
+
y: l * h,
|
|
1414
1432
|
scale: 1,
|
|
1415
|
-
opacity: 1
|
|
1433
|
+
opacity: 1,
|
|
1434
|
+
rotate: g ? 0 : void 0
|
|
1416
1435
|
};
|
|
1417
|
-
return S && r ?
|
|
1418
|
-
...
|
|
1436
|
+
return S && r && !g ? Ft(e, M) : F.to(e, {
|
|
1437
|
+
...M,
|
|
1419
1438
|
force3D: !0,
|
|
1420
|
-
overwrite:
|
|
1421
|
-
duration:
|
|
1422
|
-
ease: "power2.out"
|
|
1439
|
+
overwrite: !0,
|
|
1440
|
+
duration: fe(g ? 0.34 : 0.12),
|
|
1441
|
+
ease: g ? "elastic.out(1, 0.55)" : "power2.out"
|
|
1423
1442
|
});
|
|
1424
1443
|
}
|
|
1425
|
-
const
|
|
1444
|
+
const N = n >= x, O = Math.min(n, x), b = O * c * h, T = 1 - O * d, H = N ? 0 : Math.max(0, 1 - O * w);
|
|
1426
1445
|
if (S && r)
|
|
1427
|
-
return
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1446
|
+
return g ? F.to(e, {
|
|
1447
|
+
x: 0,
|
|
1448
|
+
y: b,
|
|
1449
|
+
scale: T,
|
|
1450
|
+
opacity: H,
|
|
1451
|
+
rotate: 0,
|
|
1452
|
+
force3D: !0,
|
|
1453
|
+
overwrite: !0,
|
|
1454
|
+
duration: fe(0.38),
|
|
1455
|
+
ease: "elastic.out(1, 0.55)"
|
|
1456
|
+
}) : Ft(e, {
|
|
1457
|
+
y: b,
|
|
1458
|
+
scale: T,
|
|
1459
|
+
opacity: H
|
|
1431
1460
|
});
|
|
1432
|
-
const
|
|
1433
|
-
return
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1461
|
+
const v = r ? Bo(i) : I.ease;
|
|
1462
|
+
return F.to(e, {
|
|
1463
|
+
x: g ? 0 : void 0,
|
|
1464
|
+
y: b,
|
|
1465
|
+
scale: T,
|
|
1466
|
+
opacity: H,
|
|
1467
|
+
rotate: g ? 0 : void 0,
|
|
1437
1468
|
force3D: !0,
|
|
1438
|
-
overwrite: "auto",
|
|
1439
|
-
duration:
|
|
1440
|
-
ease:
|
|
1469
|
+
overwrite: g ? !0 : "auto",
|
|
1470
|
+
duration: fe(g ? 0.38 : I.duration * 0.85),
|
|
1471
|
+
ease: g ? "elastic.out(1, 0.55)" : v
|
|
1441
1472
|
});
|
|
1442
|
-
}, qo = (e, t, n) =>
|
|
1473
|
+
}, qo = (e, t, n) => F.fromTo(
|
|
1443
1474
|
e,
|
|
1444
1475
|
{ scaleX: 1 },
|
|
1445
1476
|
{ scaleX: 0, duration: t / 1e3, ease: "linear", onComplete: n }
|
|
1446
|
-
),
|
|
1477
|
+
), Bt = (e) => e.pause(), Vo = (e) => e.play(), Yo = (e) => F.killTweensOf(e), zo = { class: "soft-toast-progress" }, Qo = /* @__PURE__ */ pe({
|
|
1447
1478
|
__name: "ToastProgress",
|
|
1448
1479
|
props: {
|
|
1449
1480
|
remainingTime: {},
|
|
@@ -1456,13 +1487,13 @@ const Mo = typeof window < "u" && window.matchMedia("(pointer: coarse)").matches
|
|
|
1456
1487
|
n.value && (o.value = qo(
|
|
1457
1488
|
n.value,
|
|
1458
1489
|
t.remainingTime
|
|
1459
|
-
), t.isPaused &&
|
|
1490
|
+
), t.isPaused && Bt(o.value));
|
|
1460
1491
|
}), G(() => t.isPaused, (s) => {
|
|
1461
|
-
o.value && (s ?
|
|
1492
|
+
o.value && (s ? Bt(o.value) : Vo(o.value));
|
|
1462
1493
|
}), Ve(() => {
|
|
1463
1494
|
var s;
|
|
1464
1495
|
(s = o.value) == null || s.kill();
|
|
1465
|
-
}), (s, i) => (
|
|
1496
|
+
}), (s, i) => (P(), $("div", zo, [
|
|
1466
1497
|
Q(
|
|
1467
1498
|
"div",
|
|
1468
1499
|
{
|
|
@@ -1501,7 +1532,7 @@ const Mo = typeof window < "u" && window.matchMedia("(pointer: coarse)").matches
|
|
|
1501
1532
|
}, is = {
|
|
1502
1533
|
key: 1,
|
|
1503
1534
|
class: "soft-toast-timestamp"
|
|
1504
|
-
},
|
|
1535
|
+
}, jt = /* @__PURE__ */ pe({
|
|
1505
1536
|
__name: "ToastItem",
|
|
1506
1537
|
props: {
|
|
1507
1538
|
toast: {},
|
|
@@ -1516,23 +1547,23 @@ const Mo = typeof window < "u" && window.matchMedia("(pointer: coarse)").matches
|
|
|
1516
1547
|
interactive: { type: Boolean, default: !0 }
|
|
1517
1548
|
},
|
|
1518
1549
|
setup(e, { expose: t }) {
|
|
1519
|
-
|
|
1550
|
+
nn();
|
|
1520
1551
|
const n = e, o = R(null), s = R(!1), i = R("");
|
|
1521
1552
|
let r = !1;
|
|
1522
|
-
const a = z(() => new Date(n.toast.createdAt).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" })),
|
|
1523
|
-
var
|
|
1553
|
+
const a = z(() => new Date(n.toast.createdAt).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" })), l = z(() => n.swipeToDismiss !== !1), c = () => {
|
|
1554
|
+
var B, q;
|
|
1524
1555
|
if (r || !o.value) return;
|
|
1525
|
-
const p = n.toast.id,
|
|
1526
|
-
r = !0, n.toast.isLeaving = !0,
|
|
1527
|
-
|
|
1528
|
-
}, 320),
|
|
1556
|
+
const p = n.toast.id, L = n.toast.isLeaving;
|
|
1557
|
+
r = !0, n.toast.isLeaving = !0, L || (q = (B = n.toast).onDismiss) == null || q.call(B, p), v !== null && window.clearTimeout(v), v = window.setTimeout(() => {
|
|
1558
|
+
y.remove(p), v = null;
|
|
1559
|
+
}, 320), $o(o.value);
|
|
1529
1560
|
}, d = async (p) => {
|
|
1530
1561
|
if (p)
|
|
1531
1562
|
try {
|
|
1532
|
-
await p.onClick(), p.successLabel && (s.value = !0, i.value = p.successLabel, setTimeout(
|
|
1563
|
+
await p.onClick(), p.successLabel && (s.value = !0, i.value = p.successLabel, setTimeout(c, 1200));
|
|
1533
1564
|
} catch {
|
|
1534
1565
|
}
|
|
1535
|
-
}, w = z(() => n.toast.action ? Array.isArray(n.toast.action) ? n.toast.action : [n.toast.action] : []), x = (p = !1,
|
|
1566
|
+
}, w = z(() => n.toast.action ? Array.isArray(n.toast.action) ? n.toast.action : [n.toast.action] : []), x = (p = !1, L, B = !1) => {
|
|
1536
1567
|
!o.value || n.toast.isLeaving || h || Ho(o.value, {
|
|
1537
1568
|
index: n.index,
|
|
1538
1569
|
expanded: n.expanded,
|
|
@@ -1540,95 +1571,102 @@ const Mo = typeof window < "u" && window.matchMedia("(pointer: coarse)").matches
|
|
|
1540
1571
|
bounce: n.toast.bounce,
|
|
1541
1572
|
spring: n.toast.spring,
|
|
1542
1573
|
direction: n.stackDirection,
|
|
1543
|
-
expandedOffset:
|
|
1544
|
-
reposition: p
|
|
1574
|
+
expandedOffset: L ?? n.expandedOffset,
|
|
1575
|
+
reposition: p,
|
|
1576
|
+
resetSwipe: B
|
|
1545
1577
|
});
|
|
1546
1578
|
};
|
|
1547
|
-
let S = 0,
|
|
1548
|
-
const
|
|
1549
|
-
|
|
1550
|
-
},
|
|
1579
|
+
let S = 0, g = 0, I = 0, h = !1, N = !1, O = 0, b = null, T = null, H = null, v = null;
|
|
1580
|
+
const M = () => {
|
|
1581
|
+
H !== null && (window.clearTimeout(H), H = null);
|
|
1582
|
+
}, W = () => {
|
|
1551
1583
|
if (!(b === null || !T))
|
|
1552
1584
|
try {
|
|
1553
1585
|
T.hasPointerCapture(b) && T.releasePointerCapture(b);
|
|
1554
1586
|
} catch {
|
|
1555
1587
|
}
|
|
1556
1588
|
}, J = () => {
|
|
1557
|
-
window.removeEventListener("pointermove",
|
|
1558
|
-
},
|
|
1559
|
-
h = !1,
|
|
1560
|
-
},
|
|
1561
|
-
o.value && (
|
|
1562
|
-
},
|
|
1589
|
+
window.removeEventListener("pointermove", Le), window.removeEventListener("pointerup", me), window.removeEventListener("pointercancel", _);
|
|
1590
|
+
}, E = () => {
|
|
1591
|
+
h = !1, N = !1, M(), W(), J(), b = null, T = null;
|
|
1592
|
+
}, Z = () => {
|
|
1593
|
+
o.value && (n.expanded || y.resume(n.toast.id), x(!0, void 0, !0));
|
|
1594
|
+
}, Pe = () => {
|
|
1563
1595
|
if (!o.value) return;
|
|
1564
|
-
const p =
|
|
1565
|
-
if (
|
|
1596
|
+
const p = O, L = Math.max(1, Date.now() - I), B = Math.abs(p) / L * 1e3, q = o.value.offsetWidth, ne = q * 0.35;
|
|
1597
|
+
if (E(), Math.abs(p) >= ne || B >= 500) {
|
|
1566
1598
|
r = !0;
|
|
1567
|
-
const
|
|
1568
|
-
n.toast.isLeaving = !0,
|
|
1569
|
-
|
|
1599
|
+
const oe = n.toast.id;
|
|
1600
|
+
n.toast.isLeaving = !0, v !== null && window.clearTimeout(v), v = window.setTimeout(() => {
|
|
1601
|
+
y.remove(oe), v = null;
|
|
1570
1602
|
}, 320);
|
|
1571
|
-
const
|
|
1572
|
-
|
|
1603
|
+
const ge = p > 0 ? q * 1.6 : -q * 1.6;
|
|
1604
|
+
No(o.value, ge);
|
|
1573
1605
|
} else
|
|
1574
|
-
|
|
1575
|
-
},
|
|
1576
|
-
if (
|
|
1577
|
-
|
|
1606
|
+
Z();
|
|
1607
|
+
}, he = (p) => {
|
|
1608
|
+
if (h && b !== null)
|
|
1609
|
+
try {
|
|
1610
|
+
(T ?? p.currentTarget).hasPointerCapture(b) || (E(), Z());
|
|
1611
|
+
} catch {
|
|
1612
|
+
E();
|
|
1613
|
+
}
|
|
1614
|
+
if (!(!l.value || r || h || n.toast.isLeaving || p.pointerType === "mouse" && p.button !== 0 || p.target.closest("button, a"))) {
|
|
1615
|
+
S = p.clientX, g = p.clientY, I = Date.now(), h = !0, N = !1, O = 0, b = p.pointerId, T = p.currentTarget, F.killTweensOf(o.value);
|
|
1578
1616
|
try {
|
|
1579
1617
|
T.setPointerCapture(p.pointerId);
|
|
1580
1618
|
} catch {
|
|
1581
1619
|
}
|
|
1582
|
-
window.addEventListener("pointermove",
|
|
1620
|
+
window.addEventListener("pointermove", Le), window.addEventListener("pointerup", me), window.addEventListener("pointercancel", _), y.pause(n.toast.id);
|
|
1583
1621
|
}
|
|
1584
|
-
},
|
|
1622
|
+
}, Le = (p) => {
|
|
1585
1623
|
if (!h || !o.value || b !== null && p.pointerId !== b) return;
|
|
1586
|
-
|
|
1587
|
-
const
|
|
1588
|
-
if (!
|
|
1589
|
-
if (Math.abs(
|
|
1590
|
-
|
|
1624
|
+
M();
|
|
1625
|
+
const L = p.clientX - S, B = p.clientY - g;
|
|
1626
|
+
if (!N) {
|
|
1627
|
+
if (Math.abs(B) > Math.abs(L) + 4) {
|
|
1628
|
+
E(), Z();
|
|
1591
1629
|
return;
|
|
1592
1630
|
}
|
|
1593
|
-
if (Math.abs(
|
|
1594
|
-
|
|
1631
|
+
if (Math.abs(L) > Math.abs(B) + 4)
|
|
1632
|
+
N = !0;
|
|
1595
1633
|
else
|
|
1596
1634
|
return;
|
|
1597
1635
|
}
|
|
1598
|
-
p.preventDefault(),
|
|
1599
|
-
const
|
|
1600
|
-
|
|
1601
|
-
},
|
|
1602
|
-
!h || !o.value || b !== null && p.pointerId !== b ||
|
|
1603
|
-
},
|
|
1604
|
-
!h || !o.value || p && b !== null && p.pointerId !== b || (
|
|
1605
|
-
},
|
|
1606
|
-
!h || !o.value || b !== null && p.pointerId !== b || (T = null,
|
|
1607
|
-
h &&
|
|
1608
|
-
},
|
|
1609
|
-
},
|
|
1610
|
-
document.hidden && h && (
|
|
1636
|
+
p.preventDefault(), O = L;
|
|
1637
|
+
const q = o.value.offsetWidth, ne = Math.max(0, 1 - Math.abs(L) / (q * 0.7)), oe = L / q * 6;
|
|
1638
|
+
F.set(o.value, { x: L, opacity: ne, rotate: oe, overwrite: "auto" });
|
|
1639
|
+
}, me = (p) => {
|
|
1640
|
+
!h || !o.value || b !== null && p.pointerId !== b || Pe();
|
|
1641
|
+
}, _ = (p) => {
|
|
1642
|
+
!h || !o.value || p && b !== null && p.pointerId !== b || (E(), Z());
|
|
1643
|
+
}, te = (p) => {
|
|
1644
|
+
!h || !o.value || b !== null && p.pointerId !== b || (T = null, M(), H = window.setTimeout(() => {
|
|
1645
|
+
h && (E(), Z());
|
|
1646
|
+
}, 150));
|
|
1647
|
+
}, ce = () => {
|
|
1648
|
+
document.hidden && h && (E(), Z());
|
|
1611
1649
|
};
|
|
1612
1650
|
return qe(() => {
|
|
1613
|
-
if (document.addEventListener("visibilitychange",
|
|
1651
|
+
if (document.addEventListener("visibilitychange", ce), !o.value) return;
|
|
1614
1652
|
const p = n.toast.position.includes("bottom");
|
|
1615
|
-
|
|
1653
|
+
Ro(o.value, {
|
|
1616
1654
|
preset: n.toast.preset,
|
|
1617
1655
|
bounce: n.toast.bounce,
|
|
1618
1656
|
spring: n.toast.spring,
|
|
1619
1657
|
direction: p ? "up" : "down"
|
|
1620
1658
|
}).eventCallback("onComplete", () => {
|
|
1621
|
-
|
|
1659
|
+
ke(x);
|
|
1622
1660
|
});
|
|
1623
1661
|
}), G(
|
|
1624
1662
|
() => n.index,
|
|
1625
|
-
(p,
|
|
1626
|
-
n.expanded || x(p <
|
|
1663
|
+
(p, L) => {
|
|
1664
|
+
n.expanded || x(p < L || n.reposition);
|
|
1627
1665
|
}
|
|
1628
1666
|
), G(
|
|
1629
1667
|
() => n.expandedOffset,
|
|
1630
|
-
(p,
|
|
1631
|
-
n.expanded && x(p !==
|
|
1668
|
+
(p, L) => {
|
|
1669
|
+
n.expanded && x(p !== L);
|
|
1632
1670
|
}
|
|
1633
1671
|
), G(
|
|
1634
1672
|
() => n.expanded,
|
|
@@ -1638,41 +1676,41 @@ const Mo = typeof window < "u" && window.matchMedia("(pointer: coarse)").matches
|
|
|
1638
1676
|
), G(
|
|
1639
1677
|
() => n.expanded,
|
|
1640
1678
|
(p) => {
|
|
1641
|
-
p ?
|
|
1679
|
+
p ? y.pause(n.toast.id) : !h && !n.toast.isLeaving && y.resume(n.toast.id);
|
|
1642
1680
|
}
|
|
1643
1681
|
), G(
|
|
1644
1682
|
() => n.toast.isLeaving,
|
|
1645
1683
|
(p) => {
|
|
1646
|
-
p &&
|
|
1684
|
+
p && (h && E(), c());
|
|
1647
1685
|
}
|
|
1648
1686
|
), t({ applyStackPosition: x }), Ve(() => {
|
|
1649
|
-
document.removeEventListener("visibilitychange",
|
|
1650
|
-
}), (p,
|
|
1687
|
+
document.removeEventListener("visibilitychange", ce), h && (E(), y.resume(n.toast.id)), v !== null && (window.clearTimeout(v), v = null), o.value && Yo(o.value);
|
|
1688
|
+
}), (p, L) => (P(), $("div", {
|
|
1651
1689
|
ref_key: "toastRef",
|
|
1652
1690
|
ref: o,
|
|
1653
|
-
class: Fe(["soft-toast-item", { "soft-toast-item--swipeable":
|
|
1691
|
+
class: Fe(["soft-toast-item", { "soft-toast-item--swipeable": l.value }]),
|
|
1654
1692
|
"data-type": e.toast.type,
|
|
1655
1693
|
"data-st-index": e.index,
|
|
1656
1694
|
"data-toast-id": e.toast.id,
|
|
1657
1695
|
"data-leaving": e.toast.isLeaving,
|
|
1658
1696
|
"data-interactive": e.interactive,
|
|
1659
1697
|
style: De({ zIndex: 1e3 - e.index }),
|
|
1660
|
-
onPointerdown:
|
|
1661
|
-
onPointercancel:
|
|
1662
|
-
onLostpointercapture:
|
|
1698
|
+
onPointerdown: he,
|
|
1699
|
+
onPointercancel: _,
|
|
1700
|
+
onLostpointercapture: te
|
|
1663
1701
|
}, [
|
|
1664
|
-
|
|
1702
|
+
re(p.$slots, "close-button", {
|
|
1665
1703
|
toast: e.toast,
|
|
1666
|
-
dismiss:
|
|
1704
|
+
dismiss: c,
|
|
1667
1705
|
closeButton: e.closeButton
|
|
1668
1706
|
}, () => [
|
|
1669
|
-
e.closeButton ? (
|
|
1707
|
+
e.closeButton ? (P(), $("button", {
|
|
1670
1708
|
key: 0,
|
|
1671
1709
|
class: "soft-toast-close",
|
|
1672
1710
|
"data-position": typeof e.closeButton == "string" ? e.closeButton : "top-right",
|
|
1673
|
-
onClick: $e(
|
|
1711
|
+
onClick: $e(c, ["stop"]),
|
|
1674
1712
|
"aria-label": "Close"
|
|
1675
|
-
}, [...
|
|
1713
|
+
}, [...L[0] || (L[0] = [
|
|
1676
1714
|
Q(
|
|
1677
1715
|
"svg",
|
|
1678
1716
|
{
|
|
@@ -1701,34 +1739,34 @@ const Mo = typeof window < "u" && window.matchMedia("(pointer: coarse)").matches
|
|
|
1701
1739
|
-1
|
|
1702
1740
|
/* CACHED */
|
|
1703
1741
|
)
|
|
1704
|
-
])], 8, Xo)) :
|
|
1742
|
+
])], 8, Xo)) : ee("v-if", !0)
|
|
1705
1743
|
]),
|
|
1706
1744
|
Q("div", Wo, [
|
|
1707
|
-
|
|
1745
|
+
re(p.$slots, "icon", {
|
|
1708
1746
|
toast: e.toast,
|
|
1709
1747
|
closeButton: e.closeButton
|
|
1710
1748
|
}, () => [
|
|
1711
|
-
e.toast.type === "promise" ? (
|
|
1712
|
-
|
|
1749
|
+
e.toast.type === "promise" ? (P(), $("div", Go, [
|
|
1750
|
+
st(Nt(tn), {
|
|
1713
1751
|
class: "soft-toast-icon-svg",
|
|
1714
1752
|
icon: "lucide:loader-circle",
|
|
1715
1753
|
width: 18,
|
|
1716
1754
|
height: 18
|
|
1717
1755
|
})
|
|
1718
|
-
])) : e.toast.icon && typeof e.toast.icon == "string" ? (
|
|
1756
|
+
])) : e.toast.icon && typeof e.toast.icon == "string" ? (P(), K(Dt, {
|
|
1719
1757
|
key: 1,
|
|
1720
1758
|
type: e.toast.type,
|
|
1721
1759
|
customIcon: e.toast.icon
|
|
1722
|
-
}, null, 8, ["type", "customIcon"])) : e.toast.icon ? (
|
|
1723
|
-
(
|
|
1724
|
-
])) : e.toast.type !== "default" ? (
|
|
1760
|
+
}, null, 8, ["type", "customIcon"])) : e.toast.icon ? (P(), $("div", Ko, [
|
|
1761
|
+
(P(), K(gt(e.toast.icon)))
|
|
1762
|
+
])) : e.toast.type !== "default" ? (P(), K(Dt, {
|
|
1725
1763
|
key: 3,
|
|
1726
1764
|
type: e.toast.type
|
|
1727
|
-
}, null, 8, ["type"])) :
|
|
1765
|
+
}, null, 8, ["type"])) : ee("v-if", !0)
|
|
1728
1766
|
]),
|
|
1729
1767
|
Q("div", Jo, [
|
|
1730
1768
|
Q("div", Zo, [
|
|
1731
|
-
|
|
1769
|
+
re(p.$slots, "title", {
|
|
1732
1770
|
toast: e.toast,
|
|
1733
1771
|
closeButton: e.closeButton
|
|
1734
1772
|
}, () => [
|
|
@@ -1739,24 +1777,24 @@ const Mo = typeof window < "u" && window.matchMedia("(pointer: coarse)").matches
|
|
|
1739
1777
|
"soft-toast-title--has-close": e.closeButton === !0 || e.closeButton === "top-right"
|
|
1740
1778
|
}])
|
|
1741
1779
|
},
|
|
1742
|
-
|
|
1780
|
+
ye(e.toast.title),
|
|
1743
1781
|
3
|
|
1744
1782
|
/* TEXT, CLASS */
|
|
1745
1783
|
)
|
|
1746
1784
|
])
|
|
1747
1785
|
]),
|
|
1748
|
-
e.toast.description || e.toast.action ? (
|
|
1749
|
-
|
|
1786
|
+
e.toast.description || e.toast.action ? (P(), $("div", _o, [
|
|
1787
|
+
re(p.$slots, "description", {
|
|
1750
1788
|
toast: e.toast,
|
|
1751
1789
|
closeButton: e.closeButton
|
|
1752
1790
|
}, () => [
|
|
1753
|
-
e.toast.description ? (
|
|
1754
|
-
typeof e.toast.description == "object" ? (
|
|
1755
|
-
|
|
1791
|
+
e.toast.description ? (P(), $("p", es, [
|
|
1792
|
+
typeof e.toast.description == "object" ? (P(), K(gt(e.toast.description), { key: 0 })) : (P(), $(
|
|
1793
|
+
Ie,
|
|
1756
1794
|
{ key: 1 },
|
|
1757
1795
|
[
|
|
1758
|
-
|
|
1759
|
-
|
|
1796
|
+
fn(
|
|
1797
|
+
ye(e.toast.description),
|
|
1760
1798
|
1
|
|
1761
1799
|
/* TEXT */
|
|
1762
1800
|
)
|
|
@@ -1764,59 +1802,59 @@ const Mo = typeof window < "u" && window.matchMedia("(pointer: coarse)").matches
|
|
|
1764
1802
|
64
|
|
1765
1803
|
/* STABLE_FRAGMENT */
|
|
1766
1804
|
))
|
|
1767
|
-
])) :
|
|
1805
|
+
])) : ee("v-if", !0)
|
|
1768
1806
|
]),
|
|
1769
|
-
|
|
1807
|
+
re(p.$slots, "action", {
|
|
1770
1808
|
toast: e.toast,
|
|
1771
1809
|
execute: d,
|
|
1772
1810
|
hasSucceeded: s.value,
|
|
1773
1811
|
closeButton: e.closeButton
|
|
1774
1812
|
}, () => [
|
|
1775
|
-
w.value.length > 0 && !s.value ? (
|
|
1776
|
-
(
|
|
1777
|
-
|
|
1813
|
+
w.value.length > 0 && !s.value ? (P(), $("div", ts, [
|
|
1814
|
+
(P(!0), $(
|
|
1815
|
+
Ie,
|
|
1778
1816
|
null,
|
|
1779
|
-
|
|
1780
|
-
key:
|
|
1817
|
+
Se(w.value, (B, q) => (P(), $("button", {
|
|
1818
|
+
key: q,
|
|
1781
1819
|
class: Fe(["soft-toast-action-button", [
|
|
1782
|
-
|
|
1783
|
-
|
|
1820
|
+
B.class || "",
|
|
1821
|
+
B.primary ? "soft-toast-action-primary" : ""
|
|
1784
1822
|
]]),
|
|
1785
|
-
onClick: $e(() => d(
|
|
1786
|
-
},
|
|
1823
|
+
onClick: $e(() => d(B), ["stop"])
|
|
1824
|
+
}, ye(B.label), 11, ns))),
|
|
1787
1825
|
128
|
|
1788
1826
|
/* KEYED_FRAGMENT */
|
|
1789
1827
|
))
|
|
1790
|
-
])) : s.value ? (
|
|
1828
|
+
])) : s.value ? (P(), $("div", os, [
|
|
1791
1829
|
Q(
|
|
1792
1830
|
"span",
|
|
1793
1831
|
ss,
|
|
1794
|
-
|
|
1832
|
+
ye(i.value),
|
|
1795
1833
|
1
|
|
1796
1834
|
/* TEXT */
|
|
1797
1835
|
)
|
|
1798
|
-
])) :
|
|
1836
|
+
])) : ee("v-if", !0)
|
|
1799
1837
|
])
|
|
1800
|
-
])) :
|
|
1801
|
-
|
|
1802
|
-
e.toast.showTimestamp ? (
|
|
1838
|
+
])) : ee("v-if", !0),
|
|
1839
|
+
ee(" Timestamp lives below all content — never overlaps close button "),
|
|
1840
|
+
e.toast.showTimestamp ? (P(), $(
|
|
1803
1841
|
"span",
|
|
1804
1842
|
is,
|
|
1805
|
-
|
|
1843
|
+
ye(a.value),
|
|
1806
1844
|
1
|
|
1807
1845
|
/* TEXT */
|
|
1808
|
-
)) :
|
|
1846
|
+
)) : ee("v-if", !0)
|
|
1809
1847
|
])
|
|
1810
1848
|
]),
|
|
1811
|
-
e.toast.showProgress && e.toast.duration > 0 && e.toast.duration !== 1 / 0 ? (
|
|
1849
|
+
e.toast.showProgress && e.toast.duration > 0 && e.toast.duration !== 1 / 0 ? (P(), K(Qo, {
|
|
1812
1850
|
key: 0,
|
|
1813
1851
|
"remaining-time": e.toast.remainingTime,
|
|
1814
1852
|
"total-duration": e.toast.duration,
|
|
1815
1853
|
"is-paused": e.toast.isPaused
|
|
1816
|
-
}, null, 8, ["remaining-time", "total-duration", "is-paused"])) :
|
|
1854
|
+
}, null, 8, ["remaining-time", "total-duration", "is-paused"])) : ee("v-if", !0)
|
|
1817
1855
|
], 46, Uo));
|
|
1818
1856
|
}
|
|
1819
|
-
}), rs = ["data-position", "data-soft-toast-theme", "data-soft-toast-dir", "data-expanded"], as = ["data-direction"],
|
|
1857
|
+
}), rs = ["data-position", "data-soft-toast-theme", "data-soft-toast-dir", "data-expanded"], as = ["data-direction"], cs = 15, ls = /* @__PURE__ */ pe({
|
|
1820
1858
|
__name: "ToastRegion",
|
|
1821
1859
|
props: {
|
|
1822
1860
|
position: { default: "top-right" },
|
|
@@ -1845,119 +1883,119 @@ const Mo = typeof window < "u" && window.matchMedia("(pointer: coarse)").matches
|
|
|
1845
1883
|
/* @__PURE__ */ new Map()
|
|
1846
1884
|
), r = (u, f) => {
|
|
1847
1885
|
f ? i.value.set(u, f) : i.value.delete(u);
|
|
1848
|
-
}, a = z(() =>
|
|
1886
|
+
}, a = z(() => y.getToastsByPosition(t.position).value), l = (u) => {
|
|
1849
1887
|
if (u.key === "Escape" && t.closeOnEscape) {
|
|
1850
1888
|
const f = a.value;
|
|
1851
|
-
f.length > 0 &&
|
|
1889
|
+
f.length > 0 && y.dismiss(f[0].id);
|
|
1852
1890
|
}
|
|
1853
|
-
},
|
|
1891
|
+
}, c = () => {
|
|
1854
1892
|
const u = a.value;
|
|
1855
|
-
document.hidden ? u.forEach((f) =>
|
|
1893
|
+
document.hidden ? u.forEach((f) => y.pause(f.id)) : u.forEach((f) => y.resume(f.id));
|
|
1856
1894
|
};
|
|
1857
1895
|
qe(() => {
|
|
1858
1896
|
var u;
|
|
1859
|
-
t.closeOnEscape && document.addEventListener("keydown",
|
|
1897
|
+
t.closeOnEscape && document.addEventListener("keydown", l), document.addEventListener("visibilitychange", c), document.addEventListener("touchstart", dt, { passive: !0 }), (u = o.value) == null || u.addEventListener("touchmove", pt, {
|
|
1860
1898
|
passive: !1
|
|
1861
|
-
}), typeof ResizeObserver < "u" && (
|
|
1899
|
+
}), typeof ResizeObserver < "u" && (_ = new ResizeObserver(() => v()), te = new ResizeObserver(() => v()), s.value && _.observe(s.value)), ke(() => v());
|
|
1862
1900
|
}), Ve(() => {
|
|
1863
1901
|
var u;
|
|
1864
|
-
t.closeOnEscape && document.removeEventListener("keydown",
|
|
1902
|
+
t.closeOnEscape && document.removeEventListener("keydown", l), document.removeEventListener("visibilitychange", c), document.removeEventListener("touchstart", dt), (u = o.value) == null || u.removeEventListener("touchmove", pt), _ && _.disconnect(), te && te.disconnect(), h(), ce = /* @__PURE__ */ new WeakSet();
|
|
1865
1903
|
}), G(
|
|
1866
1904
|
() => a.value.map((u) => `${u.id}:${u.isLeaving}`).join(","),
|
|
1867
1905
|
() => {
|
|
1868
|
-
|
|
1906
|
+
ke(v);
|
|
1869
1907
|
}
|
|
1870
1908
|
), G(
|
|
1871
|
-
() =>
|
|
1909
|
+
() => y.toasts.value.length,
|
|
1872
1910
|
(u, f) => {
|
|
1873
1911
|
if (u > f) {
|
|
1874
|
-
const m =
|
|
1912
|
+
const m = y.toasts.value[0];
|
|
1875
1913
|
m && (m.duration || (m.duration = t.duration), m.preset || (m.preset = t.preset), m.bounce === void 0 && (m.bounce = t.bounce), m.spring === void 0 && (m.spring = t.spring), m.showProgress === void 0 && (m.showProgress = t.showProgress), m.showTimestamp === void 0 && (m.showTimestamp = t.showTimestamp));
|
|
1876
1914
|
}
|
|
1877
1915
|
}
|
|
1878
1916
|
);
|
|
1879
1917
|
const d = z(() => `soft-toast-container--${t.position}`), w = z(() => t.position.endsWith("-center")), x = z(
|
|
1880
1918
|
() => a.value.filter((u) => !u.isLeaving)
|
|
1881
|
-
), S = (u, f) => u.isLeaving ? f : x.value.findIndex((m) => m.id === u.id),
|
|
1919
|
+
), S = (u, f) => u.isLeaving ? f : x.value.findIndex((m) => m.id === u.id), g = R(!1);
|
|
1882
1920
|
let I = null;
|
|
1883
1921
|
const h = () => {
|
|
1884
1922
|
I !== null && (window.clearTimeout(I), I = null);
|
|
1885
|
-
},
|
|
1886
|
-
const u = a.value, f = u.slice(0,
|
|
1887
|
-
return [...f, ...m.filter((C) => !
|
|
1888
|
-
}),
|
|
1889
|
-
let
|
|
1890
|
-
const
|
|
1891
|
-
|
|
1892
|
-
|
|
1923
|
+
}, N = z(() => {
|
|
1924
|
+
const u = a.value, f = u.slice(0, cs), m = u.filter((C) => C.isLeaving), D = new Set(f.map((C) => C.id));
|
|
1925
|
+
return [...f, ...m.filter((C) => !D.has(C.id))];
|
|
1926
|
+
}), O = R({}), b = R(0), T = R(0);
|
|
1927
|
+
let H = null;
|
|
1928
|
+
const v = () => {
|
|
1929
|
+
H === null && (H = requestAnimationFrame(() => {
|
|
1930
|
+
H = null, W(!1);
|
|
1893
1931
|
}));
|
|
1894
|
-
},
|
|
1932
|
+
}, M = (u, f, m) => {
|
|
1895
1933
|
if (b.value !== f || T.value !== m) return !0;
|
|
1896
|
-
const
|
|
1897
|
-
return C.length !== j.length ? !0 : j.some((V) =>
|
|
1898
|
-
},
|
|
1934
|
+
const D = O.value, C = Object.keys(D), j = Object.keys(u);
|
|
1935
|
+
return C.length !== j.length ? !0 : j.some((V) => D[V] !== u[V]);
|
|
1936
|
+
}, W = (u = !1) => {
|
|
1899
1937
|
if (!s.value) return;
|
|
1900
1938
|
const f = Array.from(
|
|
1901
1939
|
s.value.querySelectorAll(".soft-toast-item")
|
|
1902
1940
|
);
|
|
1903
1941
|
p(f);
|
|
1904
|
-
const m = t.gap ?? 10,
|
|
1942
|
+
const m = t.gap ?? 10, D = [];
|
|
1905
1943
|
let C = 0, j = 0;
|
|
1906
1944
|
for (let Y = 0; Y < f.length; Y++)
|
|
1907
|
-
if (
|
|
1945
|
+
if (D.push(C), f[Y].getAttribute("data-leaving") !== "true") {
|
|
1908
1946
|
C += f[Y].offsetHeight + m;
|
|
1909
|
-
const Oe = f[Y].dataset.toastId, Ue = a.value.find((
|
|
1947
|
+
const Oe = f[Y].dataset.toastId, Ue = a.value.find((mt) => mt.id === Oe);
|
|
1910
1948
|
Ue && S(Ue, a.value.indexOf(Ue)) === 0 && (j = f[Y].offsetHeight);
|
|
1911
1949
|
}
|
|
1912
1950
|
const V = {};
|
|
1913
1951
|
for (let Y = 0; Y < f.length; Y++) {
|
|
1914
1952
|
const Oe = f[Y].dataset.toastId;
|
|
1915
|
-
Oe && (V[Oe] =
|
|
1953
|
+
Oe && (V[Oe] = D[Y]);
|
|
1916
1954
|
}
|
|
1917
|
-
const
|
|
1918
|
-
if (
|
|
1919
|
-
const Y =
|
|
1920
|
-
|
|
1955
|
+
const le = Math.max(0, C - m), Ae = M(V, j, le);
|
|
1956
|
+
if (Ae && (O.value = V, b.value = j, T.value = le), g.value && s.value && Ae && he(0), s.value && Ae) {
|
|
1957
|
+
const Y = g.value ? T.value : b.value;
|
|
1958
|
+
F.set(s.value, { height: Y });
|
|
1921
1959
|
}
|
|
1922
|
-
|
|
1960
|
+
g.value && (Ae || u) && J();
|
|
1923
1961
|
}, J = () => {
|
|
1924
|
-
|
|
1962
|
+
N.value.forEach((u) => {
|
|
1925
1963
|
const f = i.value.get(u.id);
|
|
1926
|
-
f && f.applyStackPosition(!1,
|
|
1964
|
+
f && f.applyStackPosition(!1, O.value[u.id] ?? 0);
|
|
1927
1965
|
});
|
|
1928
|
-
},
|
|
1966
|
+
}, E = R(0), Z = () => {
|
|
1929
1967
|
const f = Math.max(
|
|
1930
1968
|
0,
|
|
1931
1969
|
T.value - window.innerHeight + 120
|
|
1932
1970
|
);
|
|
1933
|
-
return
|
|
1934
|
-
},
|
|
1971
|
+
return Ce.value === "up" ? { min: 0, max: f } : { min: -f, max: 0 };
|
|
1972
|
+
}, Pe = (u, f = !0, m = 0.18, D = "power2.out") => {
|
|
1935
1973
|
if (!s.value) return;
|
|
1936
|
-
const { min: C, max: j } =
|
|
1937
|
-
if (
|
|
1938
|
-
|
|
1939
|
-
y:
|
|
1974
|
+
const { min: C, max: j } = Z();
|
|
1975
|
+
if (E.value = Math.max(C, Math.min(u, j)), !f) {
|
|
1976
|
+
F.set(s.value, {
|
|
1977
|
+
y: E.value,
|
|
1940
1978
|
force3D: !0,
|
|
1941
1979
|
overwrite: !0
|
|
1942
1980
|
});
|
|
1943
1981
|
return;
|
|
1944
1982
|
}
|
|
1945
|
-
|
|
1946
|
-
y:
|
|
1983
|
+
F.to(s.value, {
|
|
1984
|
+
y: E.value,
|
|
1947
1985
|
duration: m,
|
|
1948
|
-
ease:
|
|
1986
|
+
ease: D,
|
|
1949
1987
|
overwrite: "auto"
|
|
1950
1988
|
});
|
|
1951
|
-
},
|
|
1952
|
-
|
|
1953
|
-
},
|
|
1954
|
-
if (!
|
|
1989
|
+
}, he = (u, f = !0) => {
|
|
1990
|
+
Pe(E.value - u, f);
|
|
1991
|
+
}, Le = (u) => {
|
|
1992
|
+
if (!g.value) return;
|
|
1955
1993
|
let f = u.target, m = !1;
|
|
1956
1994
|
for (; f && f !== o.value; ) {
|
|
1957
1995
|
const j = window.getComputedStyle(f).overflowY;
|
|
1958
1996
|
if ((j === "auto" || j === "scroll") && f.scrollHeight > f.clientHeight) {
|
|
1959
|
-
const V = Math.ceil(f.scrollTop + f.clientHeight) < f.scrollHeight,
|
|
1960
|
-
if (u.deltaY > 0 && V || u.deltaY < 0 &&
|
|
1997
|
+
const V = Math.ceil(f.scrollTop + f.clientHeight) < f.scrollHeight, le = f.scrollTop > 0;
|
|
1998
|
+
if (u.deltaY > 0 && V || u.deltaY < 0 && le) {
|
|
1961
1999
|
m = !0;
|
|
1962
2000
|
break;
|
|
1963
2001
|
}
|
|
@@ -1967,29 +2005,29 @@ const Mo = typeof window < "u" && window.matchMedia("(pointer: coarse)").matches
|
|
|
1967
2005
|
m || Math.max(
|
|
1968
2006
|
0,
|
|
1969
2007
|
T.value - window.innerHeight + 120
|
|
1970
|
-
) <= 0 || (u.preventDefault(),
|
|
1971
|
-
},
|
|
2008
|
+
) <= 0 || (u.preventDefault(), he(u.deltaY));
|
|
2009
|
+
}, me = (u) => {
|
|
1972
2010
|
if (!s.value) return;
|
|
1973
2011
|
const f = u ? T.value : b.value;
|
|
1974
|
-
|
|
2012
|
+
F.to(s.value, {
|
|
1975
2013
|
height: f,
|
|
1976
2014
|
duration: u ? 0.14 : 0.16,
|
|
1977
2015
|
ease: u ? "power3.out" : "power2.out",
|
|
1978
2016
|
overwrite: "auto"
|
|
1979
2017
|
});
|
|
1980
2018
|
};
|
|
1981
|
-
let
|
|
2019
|
+
let _ = null, te = null, ce = /* @__PURE__ */ new WeakSet();
|
|
1982
2020
|
const p = (u) => {
|
|
1983
|
-
if (
|
|
2021
|
+
if (te)
|
|
1984
2022
|
for (const f of u)
|
|
1985
|
-
|
|
1986
|
-
},
|
|
1987
|
-
h(), !
|
|
1988
|
-
|
|
2023
|
+
ce.has(f) || (ce.add(f), te.observe(f));
|
|
2024
|
+
}, L = () => {
|
|
2025
|
+
h(), !g.value && (g.value = !0, ke(() => {
|
|
2026
|
+
W(!0), me(!0);
|
|
1989
2027
|
}));
|
|
1990
|
-
},
|
|
2028
|
+
}, B = () => {
|
|
1991
2029
|
h(), I = window.setTimeout(() => {
|
|
1992
|
-
I = null,
|
|
2030
|
+
I = null, g.value = !1, me(!1), E.value = 0, s.value && F.to(s.value, {
|
|
1993
2031
|
y: 0,
|
|
1994
2032
|
duration: 0.2,
|
|
1995
2033
|
ease: "power2.out",
|
|
@@ -1997,24 +2035,24 @@ const Mo = typeof window < "u" && window.matchMedia("(pointer: coarse)").matches
|
|
|
1997
2035
|
});
|
|
1998
2036
|
}, 80);
|
|
1999
2037
|
};
|
|
2000
|
-
let
|
|
2001
|
-
const
|
|
2002
|
-
|
|
2003
|
-
},
|
|
2004
|
-
var
|
|
2038
|
+
let q = 0, ne = 0, oe = 0, ge = 0, ve = 0, Qe = !1;
|
|
2039
|
+
const rn = (u) => {
|
|
2040
|
+
q = u.touches[0].clientX, ne = u.touches[0].clientY, oe = u.touches[0].clientY, ge = performance.now(), ve = 0, Qe = !1, s.value && F.killTweensOf(s.value);
|
|
2041
|
+
}, an = (u) => {
|
|
2042
|
+
var D, C;
|
|
2005
2043
|
if (a.value.length <= 1) return;
|
|
2006
|
-
const f = Math.abs((((
|
|
2044
|
+
const f = Math.abs((((D = u.changedTouches[0]) == null ? void 0 : D.clientX) ?? q) - q), m = Math.abs((((C = u.changedTouches[0]) == null ? void 0 : C.clientY) ?? ne) - ne);
|
|
2007
2045
|
if (f > 8 || m > 8) {
|
|
2008
|
-
if (
|
|
2046
|
+
if (g.value && Qe && Math.abs(ve) > 0.08) {
|
|
2009
2047
|
const j = Math.max(
|
|
2010
2048
|
-460,
|
|
2011
|
-
Math.min(
|
|
2049
|
+
Math.min(ve * 560, 460)
|
|
2012
2050
|
), V = Math.max(
|
|
2013
2051
|
0.32,
|
|
2014
2052
|
Math.min(Math.abs(j) / 780, 0.62)
|
|
2015
2053
|
);
|
|
2016
|
-
|
|
2017
|
-
|
|
2054
|
+
Pe(
|
|
2055
|
+
E.value + j,
|
|
2018
2056
|
!0,
|
|
2019
2057
|
V,
|
|
2020
2058
|
"power3.out"
|
|
@@ -2022,49 +2060,49 @@ const Mo = typeof window < "u" && window.matchMedia("(pointer: coarse)").matches
|
|
|
2022
2060
|
}
|
|
2023
2061
|
return;
|
|
2024
2062
|
}
|
|
2025
|
-
|
|
2026
|
-
}, ft = (u) => {
|
|
2027
|
-
y.value && n.value && !n.value.contains(u.target) && N();
|
|
2063
|
+
g.value ? B() : (u.preventDefault(), L());
|
|
2028
2064
|
}, dt = (u) => {
|
|
2029
|
-
|
|
2065
|
+
g.value && n.value && !n.value.contains(u.target) && B();
|
|
2066
|
+
}, pt = (u) => {
|
|
2067
|
+
if (!g.value) return;
|
|
2030
2068
|
u.preventDefault();
|
|
2031
|
-
const f = u.touches[0].clientY, m =
|
|
2032
|
-
if (
|
|
2069
|
+
const f = u.touches[0].clientY, m = oe - f, D = performance.now(), C = Math.max(1, D - ge);
|
|
2070
|
+
if (oe = f, ge = D, Math.max(
|
|
2033
2071
|
0,
|
|
2034
2072
|
T.value - window.innerHeight + 120
|
|
2035
2073
|
) <= 0) return;
|
|
2036
|
-
const V =
|
|
2037
|
-
|
|
2038
|
-
const
|
|
2039
|
-
|
|
2040
|
-
},
|
|
2074
|
+
const V = E.value;
|
|
2075
|
+
he(m, !1);
|
|
2076
|
+
const le = (E.value - V) / C;
|
|
2077
|
+
ve = ve * 0.35 + le * 0.65, Qe = !0;
|
|
2078
|
+
}, Ce = z(
|
|
2041
2079
|
() => t.position.includes("bottom") ? "up" : "down"
|
|
2042
|
-
),
|
|
2080
|
+
), cn = z(() => ({
|
|
2043
2081
|
width: w.value ? "100%" : void 0
|
|
2044
2082
|
})), ln = (u) => {
|
|
2045
2083
|
var f;
|
|
2046
2084
|
return ((f = t.slotFilter) == null ? void 0 : f.call(t, u)) ?? !0;
|
|
2047
|
-
},
|
|
2048
|
-
return (u, f) => (
|
|
2049
|
-
|
|
2085
|
+
}, ht = z(() => t.swipeToDismiss !== !1);
|
|
2086
|
+
return (u, f) => (P(), K(Ht, { to: "body" }, [
|
|
2087
|
+
dn(Q("div", {
|
|
2050
2088
|
ref_key: "containerRef",
|
|
2051
2089
|
ref: n,
|
|
2052
2090
|
class: Fe(["soft-toast-container", d.value]),
|
|
2053
2091
|
"data-position": e.position,
|
|
2054
2092
|
"data-soft-toast-theme": e.theme,
|
|
2055
2093
|
"data-soft-toast-dir": e.dir,
|
|
2056
|
-
"data-expanded":
|
|
2094
|
+
"data-expanded": g.value
|
|
2057
2095
|
}, [
|
|
2058
2096
|
Q("div", {
|
|
2059
2097
|
ref_key: "stackRef",
|
|
2060
2098
|
ref: o,
|
|
2061
2099
|
class: "soft-toast-stack",
|
|
2062
|
-
"data-direction":
|
|
2063
|
-
onMouseenter:
|
|
2064
|
-
onMouseleave:
|
|
2065
|
-
onTouchstart: $e(
|
|
2066
|
-
onTouchend: $e(
|
|
2067
|
-
onWheel:
|
|
2100
|
+
"data-direction": Ce.value,
|
|
2101
|
+
onMouseenter: L,
|
|
2102
|
+
onMouseleave: B,
|
|
2103
|
+
onTouchstart: $e(rn, ["stop"]),
|
|
2104
|
+
onTouchend: $e(an, ["stop"]),
|
|
2105
|
+
onWheel: Le,
|
|
2068
2106
|
"data-lenis-prevent": "true"
|
|
2069
2107
|
}, [
|
|
2070
2108
|
Q(
|
|
@@ -2073,57 +2111,57 @@ const Mo = typeof window < "u" && window.matchMedia("(pointer: coarse)").matches
|
|
|
2073
2111
|
ref_key: "listRef",
|
|
2074
2112
|
ref: s,
|
|
2075
2113
|
class: "soft-toast-list",
|
|
2076
|
-
style: De(
|
|
2114
|
+
style: De(cn.value)
|
|
2077
2115
|
},
|
|
2078
2116
|
[
|
|
2079
|
-
(
|
|
2080
|
-
|
|
2117
|
+
(P(!0), $(
|
|
2118
|
+
Ie,
|
|
2081
2119
|
null,
|
|
2082
|
-
|
|
2083
|
-
|
|
2120
|
+
Se(N.value, (m, D) => (P(), $(
|
|
2121
|
+
Ie,
|
|
2084
2122
|
{
|
|
2085
2123
|
key: m.id
|
|
2086
2124
|
},
|
|
2087
2125
|
[
|
|
2088
|
-
ln(m) ? (
|
|
2126
|
+
ln(m) ? (P(), K(jt, {
|
|
2089
2127
|
key: 0,
|
|
2090
2128
|
ref_for: !0,
|
|
2091
2129
|
ref: (C) => r(m.id, C),
|
|
2092
2130
|
toast: m,
|
|
2093
|
-
index: S(m,
|
|
2131
|
+
index: S(m, D),
|
|
2094
2132
|
total: x.value.length,
|
|
2095
|
-
expanded:
|
|
2096
|
-
"expanded-offset":
|
|
2097
|
-
"stack-direction":
|
|
2098
|
-
interactive:
|
|
2133
|
+
expanded: g.value,
|
|
2134
|
+
"expanded-offset": O.value[m.id] ?? 0,
|
|
2135
|
+
"stack-direction": Ce.value,
|
|
2136
|
+
interactive: !m.isLeaving && (g.value || S(m, D) === 0),
|
|
2099
2137
|
"close-button": m.closeButton ?? e.closeButton,
|
|
2100
|
-
"swipe-to-dismiss":
|
|
2138
|
+
"swipe-to-dismiss": ht.value,
|
|
2101
2139
|
style: De(
|
|
2102
2140
|
w.value ? { left: "50%", marginLeft: "-50%" } : void 0
|
|
2103
2141
|
)
|
|
2104
|
-
},
|
|
2142
|
+
}, qt({
|
|
2105
2143
|
_: 2
|
|
2106
2144
|
/* DYNAMIC */
|
|
2107
2145
|
}, [
|
|
2108
|
-
|
|
2146
|
+
Se(u.$slots, (C, j) => ({
|
|
2109
2147
|
name: j,
|
|
2110
|
-
fn:
|
|
2111
|
-
|
|
2148
|
+
fn: Vt((V) => [
|
|
2149
|
+
re(u.$slots, j, Ke({ ref_for: !0 }, V || {}), void 0, !0)
|
|
2112
2150
|
])
|
|
2113
2151
|
}))
|
|
2114
|
-
]), 1032, ["toast", "index", "total", "expanded", "expanded-offset", "stack-direction", "interactive", "close-button", "swipe-to-dismiss", "style"])) : (
|
|
2152
|
+
]), 1032, ["toast", "index", "total", "expanded", "expanded-offset", "stack-direction", "interactive", "close-button", "swipe-to-dismiss", "style"])) : (P(), K(jt, {
|
|
2115
2153
|
key: 1,
|
|
2116
2154
|
ref_for: !0,
|
|
2117
2155
|
ref: (C) => r(m.id, C),
|
|
2118
2156
|
toast: m,
|
|
2119
|
-
index: S(m,
|
|
2157
|
+
index: S(m, D),
|
|
2120
2158
|
total: x.value.length,
|
|
2121
|
-
expanded:
|
|
2122
|
-
"expanded-offset":
|
|
2123
|
-
"stack-direction":
|
|
2124
|
-
interactive:
|
|
2159
|
+
expanded: g.value,
|
|
2160
|
+
"expanded-offset": O.value[m.id] ?? 0,
|
|
2161
|
+
"stack-direction": Ce.value,
|
|
2162
|
+
interactive: !m.isLeaving && (g.value || S(m, D) === 0),
|
|
2125
2163
|
"close-button": m.closeButton ?? e.closeButton,
|
|
2126
|
-
"swipe-to-dismiss":
|
|
2164
|
+
"swipe-to-dismiss": ht.value,
|
|
2127
2165
|
style: De(
|
|
2128
2166
|
w.value ? { left: "50%", marginLeft: "-50%" } : void 0
|
|
2129
2167
|
)
|
|
@@ -2141,7 +2179,7 @@ const Mo = typeof window < "u" && window.matchMedia("(pointer: coarse)").matches
|
|
|
2141
2179
|
)
|
|
2142
2180
|
], 40, as)
|
|
2143
2181
|
], 10, rs), [
|
|
2144
|
-
[
|
|
2182
|
+
[pn, a.value.length > 0]
|
|
2145
2183
|
])
|
|
2146
2184
|
]));
|
|
2147
2185
|
}
|
|
@@ -2150,7 +2188,7 @@ const Mo = typeof window < "u" && window.matchMedia("(pointer: coarse)").matches
|
|
|
2150
2188
|
for (const [o, s] of t)
|
|
2151
2189
|
n[o] = s;
|
|
2152
2190
|
return n;
|
|
2153
|
-
}, fs = /* @__PURE__ */ us(
|
|
2191
|
+
}, fs = /* @__PURE__ */ us(ls, [["__scopeId", "data-v-ad802395"]]), Rt = /* @__PURE__ */ pe({
|
|
2154
2192
|
__name: "ToastContainer",
|
|
2155
2193
|
props: {
|
|
2156
2194
|
position: { default: "top-right" },
|
|
@@ -2187,18 +2225,18 @@ const Mo = typeof window < "u" && window.matchMedia("(pointer: coarse)").matches
|
|
|
2187
2225
|
"bottom-center",
|
|
2188
2226
|
"bottom-right"
|
|
2189
2227
|
];
|
|
2190
|
-
return (o, s) => (
|
|
2191
|
-
(
|
|
2192
|
-
|
|
2228
|
+
return (o, s) => (P(), K(Ht, { to: "body" }, [
|
|
2229
|
+
(P(), $(
|
|
2230
|
+
Ie,
|
|
2193
2231
|
null,
|
|
2194
|
-
|
|
2232
|
+
Se(n, (i) => st(fs, Ke({ key: i }, { ref_for: !0 }, t, { position: i }), qt({
|
|
2195
2233
|
_: 2
|
|
2196
2234
|
/* DYNAMIC */
|
|
2197
2235
|
}, [
|
|
2198
|
-
|
|
2236
|
+
Se(o.$slots, (r, a) => ({
|
|
2199
2237
|
name: a,
|
|
2200
|
-
fn:
|
|
2201
|
-
|
|
2238
|
+
fn: Vt((l) => [
|
|
2239
|
+
re(o.$slots, a, Ke({ ref_for: !0 }, l || {}))
|
|
2202
2240
|
])
|
|
2203
2241
|
}))
|
|
2204
2242
|
]), 1040, ["position"])),
|
|
@@ -2225,14 +2263,14 @@ let A = {
|
|
|
2225
2263
|
swipeToDismiss: !0,
|
|
2226
2264
|
teleportTarget: "body",
|
|
2227
2265
|
autoMount: !0
|
|
2228
|
-
},
|
|
2266
|
+
}, $t = !1;
|
|
2229
2267
|
const hs = {
|
|
2230
2268
|
install(e, t = {}) {
|
|
2231
|
-
if (A = { ...A, ...t }, e.component("SoftToastContainer",
|
|
2269
|
+
if (A = { ...A, ...t }, e.component("SoftToastContainer", Rt), A.autoMount !== !1 && !$t && typeof window < "u") {
|
|
2232
2270
|
const n = "soft-toast-global-container";
|
|
2233
2271
|
let o = document.getElementById(n);
|
|
2234
|
-
o || (o = document.createElement("div"), o.id = n, document.body.appendChild(o)),
|
|
2235
|
-
render: () => Ge(
|
|
2272
|
+
o || (o = document.createElement("div"), o.id = n, document.body.appendChild(o)), hn({
|
|
2273
|
+
render: () => Ge(Rt, {
|
|
2236
2274
|
position: A.position,
|
|
2237
2275
|
duration: A.duration,
|
|
2238
2276
|
gap: A.gap,
|
|
@@ -2251,63 +2289,63 @@ const hs = {
|
|
|
2251
2289
|
showTimestamp: A.showTimestamp,
|
|
2252
2290
|
slotFilter: A.slotFilter
|
|
2253
2291
|
})
|
|
2254
|
-
}).mount(o),
|
|
2292
|
+
}).mount(o), $t = !0;
|
|
2255
2293
|
}
|
|
2256
2294
|
e.provide("softToastOptions", A), typeof document < "u" && (document.body.setAttribute("data-soft-toast-theme", A.theme || "light"), document.body.setAttribute("data-soft-toast-dir", A.dir || "ltr"));
|
|
2257
2295
|
}
|
|
2258
|
-
}, ms = () => A,
|
|
2296
|
+
}, ms = () => A, on = "@soft-toast/vue:flash", ct = () => {
|
|
2259
2297
|
if (typeof sessionStorage > "u") return [];
|
|
2260
2298
|
try {
|
|
2261
|
-
return JSON.parse(sessionStorage.getItem(
|
|
2299
|
+
return JSON.parse(sessionStorage.getItem(on) || "[]");
|
|
2262
2300
|
} catch {
|
|
2263
2301
|
return [];
|
|
2264
2302
|
}
|
|
2265
|
-
},
|
|
2303
|
+
}, sn = (e) => {
|
|
2266
2304
|
if (!(typeof sessionStorage > "u"))
|
|
2267
2305
|
try {
|
|
2268
|
-
sessionStorage.setItem(
|
|
2306
|
+
sessionStorage.setItem(on, JSON.stringify(e));
|
|
2269
2307
|
} catch {
|
|
2270
2308
|
}
|
|
2271
2309
|
}, lt = (e, t = {}) => {
|
|
2272
|
-
const n =
|
|
2310
|
+
const n = ct().filter(
|
|
2273
2311
|
(o) => Date.now() - o.queuedAt < 3e4
|
|
2274
2312
|
// discard stale flashes
|
|
2275
2313
|
);
|
|
2276
|
-
n.push({ title: e, options: t, queuedAt: Date.now() }),
|
|
2277
|
-
},
|
|
2278
|
-
const e =
|
|
2314
|
+
n.push({ title: e, options: t, queuedAt: Date.now() }), sn(n);
|
|
2315
|
+
}, ut = () => {
|
|
2316
|
+
const e = ct().filter(
|
|
2279
2317
|
(t) => Date.now() - t.queuedAt < 3e4
|
|
2280
2318
|
);
|
|
2281
|
-
return
|
|
2282
|
-
|
|
2319
|
+
return sn([]), e.forEach((t) => {
|
|
2320
|
+
y.add({ title: t.title, type: "default", ...t.options });
|
|
2283
2321
|
}), e.length;
|
|
2284
|
-
},
|
|
2322
|
+
}, ft = () => ct().some((e) => Date.now() - e.queuedAt < 3e4), gs = () => ({
|
|
2285
2323
|
/** Queue a toast that will appear on the next page/route */
|
|
2286
2324
|
flash: lt,
|
|
2287
2325
|
/** Show all pending flashes now — call in onMounted */
|
|
2288
|
-
showPendingFlashes:
|
|
2326
|
+
showPendingFlashes: ut,
|
|
2289
2327
|
/** True if there are flashes waiting to be shown */
|
|
2290
|
-
hasPending:
|
|
2328
|
+
hasPending: ft
|
|
2291
2329
|
}), vs = () => ({
|
|
2292
|
-
default: (e, t) =>
|
|
2293
|
-
success: (e, t) =>
|
|
2294
|
-
error: (e, t) =>
|
|
2295
|
-
warning: (e, t) =>
|
|
2296
|
-
info: (e, t) =>
|
|
2297
|
-
loading: (e, t) =>
|
|
2298
|
-
promise: (e, t, n) =>
|
|
2299
|
-
custom: (e) =>
|
|
2300
|
-
update: (e, t) =>
|
|
2301
|
-
dismiss: (e) =>
|
|
2302
|
-
dismissAll: () =>
|
|
2303
|
-
pause: (e) =>
|
|
2304
|
-
resume: (e) =>
|
|
2330
|
+
default: (e, t) => y.add({ ...t, type: "default", title: e }),
|
|
2331
|
+
success: (e, t) => y.add({ ...t, type: "success", title: e }),
|
|
2332
|
+
error: (e, t) => y.add({ ...t, type: "error", title: e }),
|
|
2333
|
+
warning: (e, t) => y.add({ ...t, type: "warning", title: e }),
|
|
2334
|
+
info: (e, t) => y.add({ ...t, type: "info", title: e }),
|
|
2335
|
+
loading: (e, t) => y.loading(e, t),
|
|
2336
|
+
promise: (e, t, n) => y.promise(e, t, n),
|
|
2337
|
+
custom: (e) => y.add(e),
|
|
2338
|
+
update: (e, t) => y.update(e, t),
|
|
2339
|
+
dismiss: (e) => y.dismiss(e),
|
|
2340
|
+
dismissAll: () => y.dismiss(),
|
|
2341
|
+
pause: (e) => y.pause(e),
|
|
2342
|
+
resume: (e) => y.resume(e),
|
|
2305
2343
|
/**
|
|
2306
2344
|
* Queue a toast that will be shown on the next page load / route navigation.
|
|
2307
2345
|
* Perfect for the "submit → redirect → show success" pattern.
|
|
2308
2346
|
*
|
|
2309
2347
|
* @example
|
|
2310
|
-
* const { flash } =
|
|
2348
|
+
* const { flash } = useSoftToast()
|
|
2311
2349
|
* await api.save()
|
|
2312
2350
|
* flash('Saved!', { type: 'success' })
|
|
2313
2351
|
* router.push('/dashboard')
|
|
@@ -2317,37 +2355,37 @@ const hs = {
|
|
|
2317
2355
|
* Show any toasts that were queued with flash() before a page navigation.
|
|
2318
2356
|
* Call this in onMounted() of your root layout or App.vue.
|
|
2319
2357
|
*/
|
|
2320
|
-
showFlashes: () =>
|
|
2358
|
+
showFlashes: () => ut(),
|
|
2321
2359
|
/** Check if there are pending flash messages without consuming them. */
|
|
2322
|
-
hasFlashes: () =>
|
|
2360
|
+
hasFlashes: () => ft()
|
|
2323
2361
|
}), ys = {
|
|
2324
|
-
default: (e, t) =>
|
|
2325
|
-
success: (e, t) =>
|
|
2326
|
-
error: (e, t) =>
|
|
2327
|
-
warning: (e, t) =>
|
|
2328
|
-
info: (e, t) =>
|
|
2329
|
-
loading: (e, t) =>
|
|
2330
|
-
promise: (e, t, n) =>
|
|
2331
|
-
custom: (e) =>
|
|
2332
|
-
update: (e, t) =>
|
|
2333
|
-
dismiss: (e) =>
|
|
2334
|
-
dismissAll: () =>
|
|
2335
|
-
pause: (e) =>
|
|
2336
|
-
resume: (e) =>
|
|
2362
|
+
default: (e, t) => y.add({ ...t, type: "default", title: e }),
|
|
2363
|
+
success: (e, t) => y.add({ ...t, type: "success", title: e }),
|
|
2364
|
+
error: (e, t) => y.add({ ...t, type: "error", title: e }),
|
|
2365
|
+
warning: (e, t) => y.add({ ...t, type: "warning", title: e }),
|
|
2366
|
+
info: (e, t) => y.add({ ...t, type: "info", title: e }),
|
|
2367
|
+
loading: (e, t) => y.loading(e, t),
|
|
2368
|
+
promise: (e, t, n) => y.promise(e, t, n),
|
|
2369
|
+
custom: (e) => y.add(e),
|
|
2370
|
+
update: (e, t) => y.update(e, t),
|
|
2371
|
+
dismiss: (e) => y.dismiss(e),
|
|
2372
|
+
dismissAll: () => y.dismiss(),
|
|
2373
|
+
pause: (e) => y.pause(e),
|
|
2374
|
+
resume: (e) => y.resume(e),
|
|
2337
2375
|
flash: (e, t = {}) => lt(e, t),
|
|
2338
|
-
showFlashes: () =>
|
|
2339
|
-
hasFlashes: () =>
|
|
2376
|
+
showFlashes: () => ut(),
|
|
2377
|
+
hasFlashes: () => ft()
|
|
2340
2378
|
};
|
|
2341
2379
|
export {
|
|
2342
2380
|
hs as SoftToastPlugin,
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2381
|
+
Rt as ToastContainer,
|
|
2382
|
+
jt as ToastItem,
|
|
2383
|
+
ut as consumeFlashes,
|
|
2346
2384
|
ms as getToastOptions,
|
|
2347
|
-
|
|
2385
|
+
ft as hasPendingFlashes,
|
|
2348
2386
|
lt as queueFlash,
|
|
2349
|
-
ys as
|
|
2350
|
-
|
|
2387
|
+
ys as softToast,
|
|
2388
|
+
y as toastStore,
|
|
2351
2389
|
gs as useFlash,
|
|
2352
|
-
vs as
|
|
2390
|
+
vs as useSoftToast
|
|
2353
2391
|
};
|