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