@aminnausin/cedar-ui 0.0.1 → 0.0.3
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/LICENSE +21 -0
- package/README.md +26 -0
- package/dist/cedar-ui.css +1 -1
- package/dist/cedar-ui.mjs +506 -3199
- package/dist/cedar-ui.umd.js +1 -13
- package/dist/index.d.ts +2 -371
- package/package.json +85 -61
package/dist/cedar-ui.mjs
CHANGED
|
@@ -1,2596 +1,12 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
key: 0,
|
|
8
|
-
class: "text-sm/6 text-gray-500 dark:text-gray-400"
|
|
9
|
-
}, kt = /* @__PURE__ */ K({
|
|
10
|
-
__name: "FormInputLabel",
|
|
11
|
-
props: {
|
|
12
|
-
field: {},
|
|
13
|
-
textSize: {},
|
|
14
|
-
class: {}
|
|
15
|
-
},
|
|
16
|
-
setup(n) {
|
|
17
|
-
const e = n;
|
|
18
|
-
return (t, a) => {
|
|
19
|
-
var r, o, s;
|
|
20
|
-
return m(), C(X, null, [
|
|
21
|
-
x("label", {
|
|
22
|
-
for: (r = t.field) == null ? void 0 : r.name,
|
|
23
|
-
class: D([
|
|
24
|
-
"leading-none block font-medium text-gray-700 dark:text-neutral-200",
|
|
25
|
-
t.textSize ? t.textSize : "text-sm",
|
|
26
|
-
`${e.class ?? ""}`
|
|
27
|
-
])
|
|
28
|
-
}, j((o = t.field) == null ? void 0 : o.text), 11, Qt),
|
|
29
|
-
(s = t.field) != null && s.subtext ? (m(), C("p", Jt, j(t.field.subtext), 1)) : R("", !0)
|
|
30
|
-
], 64);
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
}), ea = {
|
|
34
|
-
key: 0,
|
|
35
|
-
class: "text-rose-600 dark:text-rose-500 text-sm"
|
|
36
|
-
}, ta = /* @__PURE__ */ K({
|
|
37
|
-
__name: "FormErrorList",
|
|
38
|
-
props: {
|
|
39
|
-
errors: {},
|
|
40
|
-
fieldName: {}
|
|
41
|
-
},
|
|
42
|
-
setup(n) {
|
|
43
|
-
return (e, t) => (e.fieldName ? e.errors[e.fieldName] : Object.keys(e.errors).length > 0) ? (m(), C("ul", ea, [
|
|
44
|
-
F(e.$slots, "default", {}, () => [
|
|
45
|
-
(m(!0), C(X, null, ge(e.fieldName ? e.errors[e.fieldName] : e.errors, (a, r) => (m(), C("li", { key: r }, j(a), 1))), 128))
|
|
46
|
-
])
|
|
47
|
-
])) : R("", !0);
|
|
48
|
-
}
|
|
49
|
-
}), aa = ["for"], Rr = /* @__PURE__ */ K({
|
|
50
|
-
__name: "InputLabel",
|
|
51
|
-
props: {
|
|
52
|
-
name: {},
|
|
53
|
-
text: {},
|
|
54
|
-
subtext: {},
|
|
55
|
-
class: {},
|
|
56
|
-
subtextClass: {}
|
|
57
|
-
},
|
|
58
|
-
setup(n) {
|
|
59
|
-
const e = n;
|
|
60
|
-
return (t, a) => (m(), C(X, null, [
|
|
61
|
-
x("label", {
|
|
62
|
-
for: t.name,
|
|
63
|
-
class: D(["font-medium text-gray-700 dark:text-neutral-200", e.class])
|
|
64
|
-
}, j(t.text), 11, aa),
|
|
65
|
-
t.subtext ? (m(), C("p", {
|
|
66
|
-
key: 0,
|
|
67
|
-
class: D(["text-sm/6 text-gray-500 dark:text-gray-400", t.subtextClass])
|
|
68
|
-
}, j(t.subtext), 3)) : R("", !0)
|
|
69
|
-
], 64));
|
|
70
|
-
}
|
|
71
|
-
}), ee = (n, e) => {
|
|
72
|
-
const t = n.__vccOpts || n;
|
|
73
|
-
for (const [a, r] of e)
|
|
74
|
-
t[a] = r;
|
|
75
|
-
return t;
|
|
76
|
-
}, na = {}, ra = {
|
|
77
|
-
class: "w-5 h-5",
|
|
78
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
79
|
-
fill: "none",
|
|
80
|
-
viewBox: "0 0 24 24",
|
|
81
|
-
"stroke-width": "1.5",
|
|
82
|
-
stroke: "currentColor"
|
|
83
|
-
};
|
|
84
|
-
function sa(n, e) {
|
|
85
|
-
return m(), C("svg", ra, e[0] || (e[0] = [
|
|
86
|
-
x("path", {
|
|
87
|
-
"stroke-linecap": "round",
|
|
88
|
-
"stroke-linejoin": "round",
|
|
89
|
-
d: "M6 18L18 6M6 6l12 12"
|
|
90
|
-
}, null, -1)
|
|
91
|
-
]));
|
|
92
|
-
}
|
|
93
|
-
const et = /* @__PURE__ */ ee(na, [["render", sa]]), oa = {}, la = {
|
|
94
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
95
|
-
width: "1em",
|
|
96
|
-
height: "1em",
|
|
97
|
-
viewBox: "0 0 24 24"
|
|
98
|
-
};
|
|
99
|
-
function ia(n, e) {
|
|
100
|
-
return m(), C("svg", la, e[0] || (e[0] = [
|
|
101
|
-
x("g", { fill: "none" }, [
|
|
102
|
-
x("path", {
|
|
103
|
-
stroke: "currentColor",
|
|
104
|
-
"stroke-linecap": "round",
|
|
105
|
-
"stroke-linejoin": "round",
|
|
106
|
-
"stroke-width": "1.5",
|
|
107
|
-
d: "M7.09 2.75a4 4 0 0 0-4 4v6.208a4 4 0 0 0 4 4h.093v3.792a.5.5 0 0 0 .839.368l4.52-4.16h4.369a4 4 0 0 0 4-4V6.75a4 4 0 0 0-4-4z"
|
|
108
|
-
}),
|
|
109
|
-
x("path", {
|
|
110
|
-
stroke: "currentColor",
|
|
111
|
-
"stroke-linecap": "round",
|
|
112
|
-
"stroke-width": "1.5",
|
|
113
|
-
d: "M12 6.25v4"
|
|
114
|
-
}),
|
|
115
|
-
x("circle", {
|
|
116
|
-
cx: "12",
|
|
117
|
-
cy: "13.25",
|
|
118
|
-
r: "1",
|
|
119
|
-
fill: "currentColor"
|
|
120
|
-
})
|
|
121
|
-
], -1)
|
|
122
|
-
]));
|
|
123
|
-
}
|
|
124
|
-
const xt = /* @__PURE__ */ ee(oa, [["render", ia]]), ua = {}, ca = {
|
|
125
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
126
|
-
width: "1em",
|
|
127
|
-
height: "1em",
|
|
128
|
-
viewBox: "0 0 24 24"
|
|
129
|
-
};
|
|
130
|
-
function da(n, e) {
|
|
131
|
-
return m(), C("svg", ca, e[0] || (e[0] = [
|
|
132
|
-
x("path", {
|
|
133
|
-
fill: "none",
|
|
134
|
-
stroke: "currentColor",
|
|
135
|
-
"stroke-linecap": "round",
|
|
136
|
-
"stroke-linejoin": "round",
|
|
137
|
-
"stroke-width": "1.5",
|
|
138
|
-
d: "m9.75 4.75l6.19 6.19a1.5 1.5 0 0 1 0 2.12l-6.19 6.19"
|
|
139
|
-
}, null, -1)
|
|
140
|
-
]));
|
|
141
|
-
}
|
|
142
|
-
const tt = /* @__PURE__ */ ee(ua, [["render", da]]), fa = {}, va = {
|
|
143
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
144
|
-
width: "1em",
|
|
145
|
-
height: "1em",
|
|
146
|
-
viewBox: "0 0 24 24"
|
|
147
|
-
};
|
|
148
|
-
function ma(n, e) {
|
|
149
|
-
return m(), C("svg", va, e[0] || (e[0] = [
|
|
150
|
-
x("path", {
|
|
151
|
-
fill: "none",
|
|
152
|
-
stroke: "currentColor",
|
|
153
|
-
"stroke-linecap": "round",
|
|
154
|
-
"stroke-linejoin": "round",
|
|
155
|
-
"stroke-width": "1.5",
|
|
156
|
-
d: "m14.25 4.75l-6.19 6.19a1.5 1.5 0 0 0 0 2.12l6.19 6.19"
|
|
157
|
-
}, null, -1)
|
|
158
|
-
]));
|
|
159
|
-
}
|
|
160
|
-
const at = /* @__PURE__ */ ee(fa, [["render", ma]]), pa = {}, ga = {
|
|
161
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
162
|
-
width: "1em",
|
|
163
|
-
height: "1em",
|
|
164
|
-
viewBox: "0 0 256 256"
|
|
165
|
-
};
|
|
166
|
-
function ba(n, e) {
|
|
167
|
-
return m(), C("svg", ga, e[0] || (e[0] = [
|
|
168
|
-
x("path", {
|
|
169
|
-
fill: "currentColor",
|
|
170
|
-
d: "M42 128a6 6 0 0 1 6-6h72a6 6 0 0 1 0 12H48a6 6 0 0 1-6-6m6-58h56a6 6 0 0 0 0-12H48a6 6 0 0 0 0 12m136 116H48a6 6 0 0 0 0 12h136a6 6 0 0 0 0-12m44.24-102.24l-40-40a6 6 0 0 0-8.48 0l-40 40a6 6 0 0 0 8.48 8.48L178 62.49V144a6 6 0 0 0 12 0V62.49l29.76 29.75a6 6 0 0 0 8.48-8.48"
|
|
171
|
-
}, null, -1)
|
|
172
|
-
]));
|
|
173
|
-
}
|
|
174
|
-
const ha = /* @__PURE__ */ ee(pa, [["render", ba]]), ya = {}, wa = {
|
|
175
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
176
|
-
width: "1em",
|
|
177
|
-
height: "1em",
|
|
178
|
-
viewBox: "0 0 256 256"
|
|
179
|
-
};
|
|
180
|
-
function ka(n, e) {
|
|
181
|
-
return m(), C("svg", wa, e[0] || (e[0] = [
|
|
182
|
-
x("path", {
|
|
183
|
-
fill: "currentColor",
|
|
184
|
-
d: "M126 128a6 6 0 0 1-6 6H48a6 6 0 0 1 0-12h72a6 6 0 0 1 6 6M48 70h136a6 6 0 0 0 0-12H48a6 6 0 0 0 0 12m56 116H48a6 6 0 0 0 0 12h56a6 6 0 0 0 0-12m124.24-22.24a6 6 0 0 0-8.48 0L190 193.51V112a6 6 0 0 0-12 0v81.51l-29.76-29.75a6 6 0 0 0-8.48 8.48l40 40a6 6 0 0 0 8.48 0l40-40a6 6 0 0 0 0-8.48"
|
|
185
|
-
}, null, -1)
|
|
186
|
-
]));
|
|
187
|
-
}
|
|
188
|
-
const xa = /* @__PURE__ */ ee(ya, [["render", ka]]), Ca = {}, Ta = {
|
|
189
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
190
|
-
width: "1em",
|
|
191
|
-
height: "1em",
|
|
192
|
-
viewBox: "0 0 24 24"
|
|
193
|
-
};
|
|
194
|
-
function Ia(n, e) {
|
|
195
|
-
return m(), C("svg", Ta, e[0] || (e[0] = [
|
|
196
|
-
x("path", {
|
|
197
|
-
fill: "currentColor",
|
|
198
|
-
d: "M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z",
|
|
199
|
-
opacity: "0.25"
|
|
200
|
-
}, null, -1),
|
|
201
|
-
x("path", {
|
|
202
|
-
fill: "currentColor",
|
|
203
|
-
d: "M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z"
|
|
204
|
-
}, [
|
|
205
|
-
x("animateTransform", {
|
|
206
|
-
attributeName: "transform",
|
|
207
|
-
dur: "0.75s",
|
|
208
|
-
repeatCount: "indefinite",
|
|
209
|
-
type: "rotate",
|
|
210
|
-
values: "0 12 12;360 12 12"
|
|
211
|
-
})
|
|
212
|
-
], -1)
|
|
213
|
-
]));
|
|
214
|
-
}
|
|
215
|
-
const $a = /* @__PURE__ */ ee(Ca, [["render", Ia]]), Pa = ["aria-label", "title", "disabled"], Ve = /* @__PURE__ */ K({
|
|
216
|
-
__name: "ButtonCorner",
|
|
217
|
-
props: ["positionClasses", "colourClasses", "textClasses", "to", "label", "disabled"],
|
|
218
|
-
setup(n) {
|
|
219
|
-
const e = n;
|
|
220
|
-
return (t, a) => {
|
|
221
|
-
const r = gt("router-link");
|
|
222
|
-
return n.to ? (m(), Y(r, {
|
|
223
|
-
key: 0,
|
|
224
|
-
"aria-label": n.label ?? "Link",
|
|
225
|
-
title: n.label ?? "Link",
|
|
226
|
-
to: n.to ?? "/",
|
|
227
|
-
class: D(["flex items-center justify-center rounded-full aria-disabled:cursor-not-allowed aria-disabled:hover:ring-neutral-200 aria-disabled:hover:dark:ring-neutral-700 aria-disabled:opacity-60", `${n.positionClasses ?? " absolute top-0 right-0 w-8 h-8 mt-5 mr-5"} ${(e == null ? void 0 : e.colourClasses) ?? "hover:bg-gray-50 hover:dark:bg-gray-700"} ${(e == null ? void 0 : e.textClasses) ?? "text-gray-600 dark:text-gray-400 hover:text-gray-800 hover:dark:text-gray-200"}`]),
|
|
228
|
-
"aria-disabled": n.disabled
|
|
229
|
-
}, {
|
|
230
|
-
default: B(() => [
|
|
231
|
-
F(t.$slots, "icon", {}, () => [
|
|
232
|
-
M(b(et))
|
|
233
|
-
])
|
|
234
|
-
]),
|
|
235
|
-
_: 3
|
|
236
|
-
}, 8, ["aria-label", "title", "to", "class", "aria-disabled"])) : (m(), C("button", {
|
|
237
|
-
key: 1,
|
|
238
|
-
"aria-label": (e == null ? void 0 : e.label) ?? "Close Modal",
|
|
239
|
-
title: (e == null ? void 0 : e.label) ?? "Close Modal",
|
|
240
|
-
class: D(["flex items-center justify-center rounded-full disabled:cursor-not-allowed disabled:hover:ring-neutral-200 disabled:hover:dark:ring-neutral-700 disabled:opacity-60", `${(e == null ? void 0 : e.positionClasses) ?? "absolute top-0 right-0 w-8 h-8 mt-5 mr-5"} ${(e == null ? void 0 : e.colourClasses) ?? "hover:bg-gray-50 hover:dark:bg-gray-700"} ${(e == null ? void 0 : e.textClasses) ?? "text-gray-600 dark:text-gray-400 hover:text-gray-800 hover:dark:text-gray-200"}`]),
|
|
241
|
-
disabled: n.disabled,
|
|
242
|
-
type: "button"
|
|
243
|
-
}, [
|
|
244
|
-
F(t.$slots, "icon", {}, () => [
|
|
245
|
-
M(b(et))
|
|
246
|
-
])
|
|
247
|
-
], 10, Pa));
|
|
248
|
-
};
|
|
249
|
-
}
|
|
250
|
-
}), Vr = /* @__PURE__ */ K({
|
|
251
|
-
__name: "ChipTag",
|
|
252
|
-
props: ["label", "colour", "textClass", "URL", "removeable"],
|
|
253
|
-
setup(n) {
|
|
254
|
-
const e = n;
|
|
255
|
-
return (t, a) => e.URL ? (m(), Y(b(Zt), {
|
|
256
|
-
key: 0,
|
|
257
|
-
class: D(`p-1 px-2 text-sm ${e.textClass ? `${e.textClass} ` : ""}leading-none rounded-xl truncate lowercase text-neutral-100 dark:text-neutral-300 ${e.colour ? `${e.colour}` : "bg-violet-600 dark:bg-violet-900"} shrink-0 transition-colors duration-200 `),
|
|
258
|
-
to: e.URL
|
|
259
|
-
}, {
|
|
260
|
-
default: B(() => [
|
|
261
|
-
F(t.$slots, "content", {}, () => [
|
|
262
|
-
Z(j(e.label), 1)
|
|
263
|
-
]),
|
|
264
|
-
n.removeable ? (m(), Y(Ve, {
|
|
265
|
-
key: 0,
|
|
266
|
-
positionClasses: "w-4 h-4",
|
|
267
|
-
textClasses: "text-white dark:text-rose-700",
|
|
268
|
-
colourClasses: "dark:bg-neutral-900/20 dark:hover:bg-rose-700 hover:bg-rose-300 hover:text-rose-700 dark:hover:text-white drop-shadow",
|
|
269
|
-
label: "Remove",
|
|
270
|
-
onClick: a[0] || (a[0] = re((r) => t.$emit("clickAction"), ["stop", "prevent"]))
|
|
271
|
-
})) : R("", !0)
|
|
272
|
-
]),
|
|
273
|
-
_: 3
|
|
274
|
-
}, 8, ["class", "to"])) : (m(), C("p", {
|
|
275
|
-
key: 1,
|
|
276
|
-
class: D(`p-1 px-2 text-sm ${e.textClass ? `${e.textClass} ` : ""}leading-none rounded-xl truncate lowercase text-neutral-100 dark:text-neutral-300 ${e.colour ? `${e.colour}` : "bg-violet-600 dark:bg-violet-900"} shrink-0 transition-colors duration-200 cursor-default ${n.removeable ? "flex gap-1 items-center justify-between" : ""}`)
|
|
277
|
-
}, [
|
|
278
|
-
F(t.$slots, "content", {}, () => [
|
|
279
|
-
Z(j(e.label), 1)
|
|
280
|
-
]),
|
|
281
|
-
n.removeable ? (m(), Y(Ve, {
|
|
282
|
-
key: 0,
|
|
283
|
-
positionClasses: "w-4 h-4",
|
|
284
|
-
textClasses: `text-white dark:text-rose-700 ${n.textClass ?? ""}`,
|
|
285
|
-
colourClasses: "dark:bg-neutral-900/20 dark:hover:bg-rose-700 hover:bg-rose-300 hover:text-rose-700 dark:hover:text-white drop-shadow",
|
|
286
|
-
label: "Remove",
|
|
287
|
-
onClick: a[1] || (a[1] = re((r) => t.$emit("clickAction"), ["stop", "prevent"]))
|
|
288
|
-
}, null, 8, ["textClasses"])) : R("", !0)
|
|
289
|
-
], 2));
|
|
290
|
-
}
|
|
291
|
-
}), Sa = { class: "text-pretty h-fit w-full break-words whitespace-pre-wrap" }, jr = /* @__PURE__ */ K({
|
|
292
|
-
__name: "RelativeHoverCard",
|
|
293
|
-
props: {
|
|
294
|
-
content: {},
|
|
295
|
-
positionClasses: {},
|
|
296
|
-
hoverCardDelay: { default: 600 },
|
|
297
|
-
hoverCardLeaveDelay: { default: 500 },
|
|
298
|
-
iconHidden: { type: Boolean },
|
|
299
|
-
icon: { default: xt }
|
|
300
|
-
},
|
|
301
|
-
setup(n) {
|
|
302
|
-
const e = n, t = w(!1), a = w(null), r = w(null), o = w({}), s = w(!1), l = () => {
|
|
303
|
-
e.content !== "" && (r.value && clearTimeout(r.value), !t.value && (a.value && clearTimeout(a.value), s.value || (s.value = !0), a.value = window.setTimeout(() => {
|
|
304
|
-
t.value = !0;
|
|
305
|
-
}, e.hoverCardDelay)));
|
|
306
|
-
}, c = () => {
|
|
307
|
-
e.content !== "" && (a.value && clearTimeout(a.value), t.value && (r.value && clearTimeout(r.value), r.value = window.setTimeout(() => {
|
|
308
|
-
t.value = !1;
|
|
309
|
-
}, e.hoverCardLeaveDelay)));
|
|
310
|
-
};
|
|
311
|
-
return (i, d) => (m(), C("div", {
|
|
312
|
-
class: "relative",
|
|
313
|
-
onMouseover: l,
|
|
314
|
-
onMouseleave: c
|
|
315
|
-
}, [
|
|
316
|
-
F(i.$slots, "trigger", {}, () => [
|
|
317
|
-
d[0] || (d[0] = x("a", {
|
|
318
|
-
href: "#_",
|
|
319
|
-
class: "hover:underline"
|
|
320
|
-
}, "@thedevdojo", -1))
|
|
321
|
-
]),
|
|
322
|
-
M(pe, {
|
|
323
|
-
"enter-from-class": "opacity-0",
|
|
324
|
-
"enter-to-class": "opacity-100",
|
|
325
|
-
"leave-from-class": "opacity-100",
|
|
326
|
-
"leave-to-class": "opacity-0"
|
|
327
|
-
}, {
|
|
328
|
-
default: B(() => [
|
|
329
|
-
s.value ? G((m(), C("div", {
|
|
330
|
-
key: 0,
|
|
331
|
-
onMouseover: l,
|
|
332
|
-
onMouseleave: c,
|
|
333
|
-
class: D(`${i.positionClasses ?? ""} z-30 flex absolute overflow-auto transition-opacity ease-in-out duration-200 md:max-w-xl xl:max-w-3xl text-sm p-3 h-fit bg-white dark:odd:bg-primary-dark-600/70 dark:bg-neutral-800/70 backdrop-blur-lg border dark:border-none rounded-md shadow-md border-neutral-200/70 gap-2 items-center`),
|
|
334
|
-
style: ze(o.value)
|
|
335
|
-
}, [
|
|
336
|
-
F(i.$slots, "icon", {}, () => [
|
|
337
|
-
i.iconHidden ? R("", !0) : (m(), Y(De(i.icon), {
|
|
338
|
-
key: 0,
|
|
339
|
-
class: "h-5 w-5 mb-auto shrink-0"
|
|
340
|
-
}))
|
|
341
|
-
]),
|
|
342
|
-
F(i.$slots, "content", {}, () => [
|
|
343
|
-
x("p", Sa, j(i.content), 1)
|
|
344
|
-
])
|
|
345
|
-
], 38)), [
|
|
346
|
-
[Q, t.value]
|
|
347
|
-
]) : R("", !0)
|
|
348
|
-
]),
|
|
349
|
-
_: 3
|
|
350
|
-
})
|
|
351
|
-
], 32));
|
|
352
|
-
}
|
|
353
|
-
}), Aa = {}, Ea = { class: "flex gap-3 p-3 sm:p-6 flex-wrap sm:flex-nowrap rounded-xl shadow-md dark:bg-primary-dark-800/70 bg-white ring-1 ring-gray-900/5" };
|
|
354
|
-
function Da(n, e) {
|
|
355
|
-
return m(), C("section", Ea, [
|
|
356
|
-
F(n.$slots, "heading"),
|
|
357
|
-
F(n.$slots, "content")
|
|
358
|
-
]);
|
|
359
|
-
}
|
|
360
|
-
const Yr = /* @__PURE__ */ ee(Aa, [["render", Da]]), Ma = { class: "flex flex-col gap-2" }, Na = { key: 0 }, Oa = {
|
|
361
|
-
key: 1,
|
|
362
|
-
class: "dark:text-neutral-400 text-pretty whitespace-pre-wrap w-full"
|
|
363
|
-
}, Kr = /* @__PURE__ */ K({
|
|
364
|
-
__name: "HoverCard",
|
|
365
|
-
props: {
|
|
366
|
-
content: {},
|
|
367
|
-
contentTitle: {},
|
|
368
|
-
positionClasses: {},
|
|
369
|
-
hoverCardDelay: { default: 600 },
|
|
370
|
-
hoverCardLeaveDelay: { default: 500 },
|
|
371
|
-
margin: { default: 0 },
|
|
372
|
-
iconHidden: { type: Boolean },
|
|
373
|
-
paddingLeft: { default: 0 },
|
|
374
|
-
scrollContainer: { default: "body" },
|
|
375
|
-
disabled: { type: Boolean, default: !1 },
|
|
376
|
-
icon: { default: xt }
|
|
377
|
-
},
|
|
378
|
-
setup(n) {
|
|
379
|
-
const e = n, t = w(!1), a = w(null), r = w(null), o = w({}), s = w(!1), l = (d) => {
|
|
380
|
-
e.content === "" || e.disabled || (r.value && clearTimeout(r.value), !t.value && (a.value && clearTimeout(a.value), s.value || (s.value = !0), a.value = window.setTimeout(() => {
|
|
381
|
-
t.value = !0, i(d);
|
|
382
|
-
}, e.hoverCardDelay)));
|
|
383
|
-
}, c = () => {
|
|
384
|
-
a.value && clearTimeout(a.value), t.value && (r.value && clearTimeout(r.value), r.value = window.setTimeout(() => {
|
|
385
|
-
t.value = !1;
|
|
386
|
-
}, e.hoverCardLeaveDelay));
|
|
387
|
-
}, i = (d) => {
|
|
388
|
-
var P;
|
|
389
|
-
const g = d.target, h = (P = g.parentElement) == null ? void 0 : P.getBoundingClientRect();
|
|
390
|
-
let v = g.getBoundingClientRect();
|
|
391
|
-
h && h.height < v.height && (v = h);
|
|
392
|
-
const p = e.scrollContainer === "body" ? document.body.scrollTop : window.scrollY, T = e.scrollContainer === "body" ? document.body.scrollLeft : window.scrollX;
|
|
393
|
-
o.value = { left: `${v.left + T + e.paddingLeft}px`, top: `${v.bottom + e.margin + p}px` };
|
|
394
|
-
};
|
|
395
|
-
return W(
|
|
396
|
-
() => e.content,
|
|
397
|
-
() => {
|
|
398
|
-
(!e.content || e.content.trim() === "") && c();
|
|
399
|
-
}
|
|
400
|
-
), (d, g) => (m(), C("div", {
|
|
401
|
-
class: "",
|
|
402
|
-
onMouseover: l,
|
|
403
|
-
onMouseleave: c
|
|
404
|
-
}, [
|
|
405
|
-
F(d.$slots, "trigger", {}, () => [
|
|
406
|
-
g[0] || (g[0] = x("a", {
|
|
407
|
-
href: "#_",
|
|
408
|
-
class: "hover:underline"
|
|
409
|
-
}, null, -1))
|
|
410
|
-
]),
|
|
411
|
-
s.value ? (m(), Y(Ue, {
|
|
412
|
-
key: 0,
|
|
413
|
-
to: "body"
|
|
414
|
-
}, [
|
|
415
|
-
M(pe, {
|
|
416
|
-
"enter-from-class": "opacity-0",
|
|
417
|
-
"enter-to-class": "opacity-100",
|
|
418
|
-
"leave-from-class": "opacity-100",
|
|
419
|
-
"leave-to-class": "opacity-0"
|
|
420
|
-
}, {
|
|
421
|
-
default: B(() => [
|
|
422
|
-
G(x("div", {
|
|
423
|
-
onMouseover: l,
|
|
424
|
-
onMouseleave: c,
|
|
425
|
-
class: D([
|
|
426
|
-
d.positionClasses,
|
|
427
|
-
"z-30 flex absolute overflow-auto transition-opacity ease-in-out duration-200 md:max-w-xl xl:max-w-3xl text-sm p-3 h-fit max-h-[50vh] scrollbar-minimal bg-white dark:odd:bg-primary-dark-600/70 dark:bg-neutral-800/70 backdrop-blur-lg border dark:border-none rounded-md shadow-md border-neutral-200/70 gap-2 items-center"
|
|
428
|
-
]),
|
|
429
|
-
style: ze(o.value)
|
|
430
|
-
}, [
|
|
431
|
-
F(d.$slots, "icon", {}, () => [
|
|
432
|
-
d.iconHidden ? R("", !0) : (m(), Y(De(d.icon), {
|
|
433
|
-
key: 0,
|
|
434
|
-
class: "h-5 w-5 mb-auto shrink-0"
|
|
435
|
-
}))
|
|
436
|
-
]),
|
|
437
|
-
F(d.$slots, "content", {}, () => [
|
|
438
|
-
x("div", Ma, [
|
|
439
|
-
d.contentTitle ? (m(), C("h4", Na, j(d.contentTitle), 1)) : R("", !0),
|
|
440
|
-
d.content ? (m(), C("p", Oa, j(d.content), 1)) : R("", !0)
|
|
441
|
-
])
|
|
442
|
-
])
|
|
443
|
-
], 38), [
|
|
444
|
-
[Q, t.value]
|
|
445
|
-
])
|
|
446
|
-
]),
|
|
447
|
-
_: 3
|
|
448
|
-
})
|
|
449
|
-
])) : R("", !0)
|
|
450
|
-
], 32));
|
|
451
|
-
}
|
|
452
|
-
}), La = ["type", "disabled"], nt = /* @__PURE__ */ K({
|
|
453
|
-
__name: "ButtonForm",
|
|
454
|
-
props: {
|
|
455
|
-
disabled: { type: Boolean, default: !1 },
|
|
456
|
-
type: { default: "button" },
|
|
457
|
-
variant: {}
|
|
458
|
-
},
|
|
459
|
-
setup(n) {
|
|
460
|
-
const e = n, t = J(() => {
|
|
461
|
-
switch (e.variant) {
|
|
462
|
-
case "submit":
|
|
463
|
-
return [
|
|
464
|
-
"inline-flex items-center justify-center h-10 max-h-full px-4 py-2 font-medium text-white transition-colors border border-transparent rounded-md focus:outline-none",
|
|
465
|
-
"focus:ring-1 focus:ring-violet-900 focus:ring-offset-1 bg-neutral-950 hover:bg-neutral-800 dark:hover:bg-neutral-900",
|
|
466
|
-
"disabled:cursor-not-allowed disabled:hover:ring-neutral-200 disabled:hover:dark:ring-neutral-700 disabled:hover:ring-1 disabled:opacity-60"
|
|
467
|
-
];
|
|
468
|
-
case "reset":
|
|
469
|
-
return [
|
|
470
|
-
"inline-flex items-center justify-center h-10 max-h-full px-4 py-2 font-medium transition-colors border dark:border-neutral-600 rounded-md focus:outline-none",
|
|
471
|
-
"focus:ring-1 focus:ring-neutral-100 dark:focus:ring-neutral-400 focus:ring-offset-1 hover:bg-neutral-100 dark:hover:bg-neutral-900",
|
|
472
|
-
"disabled:cursor-not-allowed disabled:hover:ring-neutral-200 disabled:hover:dark:ring-neutral-700 disabled:hover:ring-1 disabled:opacity-60"
|
|
473
|
-
];
|
|
474
|
-
case "auth":
|
|
475
|
-
return [
|
|
476
|
-
"inline-flex items-center px-4 py-2",
|
|
477
|
-
"bg-gray-800 dark:bg-gray-200",
|
|
478
|
-
"border border-transparent rounded-md font-semibold text-xs uppercase tracking-widest",
|
|
479
|
-
"text-white dark:text-gray-800 hover:bg-gray-700 dark:hover:bg-white",
|
|
480
|
-
"focus:bg-gray-700 dark:focus:bg-white active:bg-gray-900 dark:active:bg-gray-300",
|
|
481
|
-
"focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-offset-2 dark:focus:ring-offset-gray-800",
|
|
482
|
-
"transition ease-in-out duration-150"
|
|
483
|
-
];
|
|
484
|
-
default:
|
|
485
|
-
return [
|
|
486
|
-
"inline-flex items-center justify-center px-4 py-2 text-sm transition-colors border dark:border-neutral-600 rounded-md focus:outline-none",
|
|
487
|
-
"focus:ring-1 focus:ring-neutral-100 dark:focus:ring-neutral-400 focus:ring-offset-1 hover:bg-neutral-100 dark:hover:bg-neutral-900",
|
|
488
|
-
"disabled:cursor-not-allowed disabled:hover:ring-neutral-200 disabled:hover:dark:ring-neutral-700 disabled:hover:ring-1 disabled:opacity-60"
|
|
489
|
-
];
|
|
490
|
-
}
|
|
491
|
-
});
|
|
492
|
-
return (a, r) => (m(), C("button", {
|
|
493
|
-
type: a.type,
|
|
494
|
-
class: D([...t.value]),
|
|
495
|
-
disabled: a.disabled
|
|
496
|
-
}, [
|
|
497
|
-
F(a.$slots, "text"),
|
|
498
|
-
F(a.$slots, "default")
|
|
499
|
-
], 10, La));
|
|
500
|
-
}
|
|
501
|
-
}), Ba = ["name", "title", "type", "required", "placeholder", "autocomplete", "aria-autocomplete", "min", "max"], Fa = /* @__PURE__ */ K({
|
|
502
|
-
__name: "FormInput",
|
|
503
|
-
props: /* @__PURE__ */ $e({
|
|
504
|
-
field: {}
|
|
505
|
-
}, {
|
|
506
|
-
modelValue: {},
|
|
507
|
-
modelModifiers: {}
|
|
508
|
-
}),
|
|
509
|
-
emits: ["update:modelValue"],
|
|
510
|
-
setup(n) {
|
|
511
|
-
const e = We(n, "modelValue");
|
|
512
|
-
return (t, a) => G((m(), C("input", {
|
|
513
|
-
class: D([
|
|
514
|
-
"rounded-md shadow-sm block mt-1 w-full text-sm",
|
|
515
|
-
"focus:outline-none border-none",
|
|
516
|
-
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
517
|
-
"text-gray-900 dark:text-neutral-100 bg-white dark:bg-neutral-700 placeholder:text-neutral-400",
|
|
518
|
-
"ring-inset focus:ring-inset ring-1 ring-neutral-200 dark:ring-neutral-700",
|
|
519
|
-
"focus:ring-[0.125rem] focus:ring-purple-400 dark:focus:ring-purple-500"
|
|
520
|
-
]),
|
|
521
|
-
name: t.field.name,
|
|
522
|
-
title: t.field.text ?? t.field.name,
|
|
523
|
-
type: t.field.type,
|
|
524
|
-
required: t.field.required ? "true" : "false",
|
|
525
|
-
placeholder: t.field.placeholder,
|
|
526
|
-
autocomplete: t.field.autocomplete,
|
|
527
|
-
"aria-autocomplete": t.field.ariaAutocomplete ?? (t.field.autocomplete ? "list" : "none"),
|
|
528
|
-
min: t.field.min ?? "",
|
|
529
|
-
max: t.field.max ?? "",
|
|
530
|
-
"onUpdate:modelValue": a[0] || (a[0] = (r) => e.value = r)
|
|
531
|
-
}, null, 8, Ba)), [
|
|
532
|
-
[Vt, e.value]
|
|
533
|
-
]);
|
|
534
|
-
}
|
|
535
|
-
});
|
|
536
|
-
function Ge() {
|
|
537
|
-
const n = w(!1), e = w(!1), t = w(300), a = w(null), r = be({}), o = jt(null);
|
|
538
|
-
function s(c, i = {}) {
|
|
539
|
-
a.value && clearTimeout(a.value), o.value = c, Object.assign(r, i), e.value = !0, n.value = !0, a.value = window.setTimeout(() => {
|
|
540
|
-
n.value = !1;
|
|
541
|
-
}, t.value);
|
|
542
|
-
}
|
|
543
|
-
function l() {
|
|
544
|
-
a.value && clearTimeout(a.value), e.value = !1, n.value = !0, a.value = window.setTimeout(() => {
|
|
545
|
-
n.value = !1;
|
|
546
|
-
}, t.value);
|
|
547
|
-
}
|
|
548
|
-
return { isOpen: e, isAnimating: n, animationTime: t, props: r, component: o, open: s, close: l };
|
|
549
|
-
}
|
|
550
|
-
function Ct(n = "pv_id_") {
|
|
551
|
-
return n + Math.random().toString(16).slice(2);
|
|
552
|
-
}
|
|
553
|
-
class _a {
|
|
554
|
-
constructor() {
|
|
555
|
-
q(this, "subscribers");
|
|
556
|
-
q(this, "toasts");
|
|
557
|
-
// We use arrow functions to maintain the correct `this` reference
|
|
558
|
-
q(this, "subscribe", (e) => (this.subscribers.push(e), () => {
|
|
559
|
-
const t = this.subscribers.indexOf(e);
|
|
560
|
-
this.subscribers.splice(t, 1);
|
|
561
|
-
}));
|
|
562
|
-
q(this, "publish", (e) => {
|
|
563
|
-
this.subscribers.forEach((t) => t(e));
|
|
564
|
-
});
|
|
565
|
-
q(this, "addToast", (e) => {
|
|
566
|
-
this.publish(e), this.toasts = [...this.toasts, e];
|
|
567
|
-
});
|
|
568
|
-
q(this, "create", (e, t) => {
|
|
569
|
-
const a = t.id ?? Ct("toast_");
|
|
570
|
-
return this.toasts.find((o) => o.id === a) ? this.toasts = this.toasts.map((o) => o.id === a ? (this.publish({ ...o, ...t, id: a, title: e }), {
|
|
571
|
-
...o,
|
|
572
|
-
...t,
|
|
573
|
-
id: a,
|
|
574
|
-
title: e
|
|
575
|
-
}) : o) : this.addToast({
|
|
576
|
-
title: e,
|
|
577
|
-
id: a,
|
|
578
|
-
scale: 1,
|
|
579
|
-
zIndex: 200,
|
|
580
|
-
offsetY: 0,
|
|
581
|
-
...t
|
|
582
|
-
}), a;
|
|
583
|
-
});
|
|
584
|
-
q(this, "dismiss", (e) => {
|
|
585
|
-
e ? (this.publish({ id: e, dismiss: !0 }), this.toasts = this.toasts.filter((t) => t.id !== e)) : (this.toasts.forEach((t) => {
|
|
586
|
-
this.publish({ id: t.id, dismiss: !0 });
|
|
587
|
-
}), this.toasts = []);
|
|
588
|
-
});
|
|
589
|
-
q(this, "add", (e, t) => this.create(e, { ...t }));
|
|
590
|
-
q(this, "success", (e, t) => this.create(e, { type: "success", ...t }));
|
|
591
|
-
q(this, "error", (e, t) => this.create(e, { type: "danger", ...t }));
|
|
592
|
-
q(this, "info", (e, t) => this.create(e, { type: "info", ...t }));
|
|
593
|
-
q(this, "warning", (e, t) => this.create(e, { type: "warning", ...t }));
|
|
594
|
-
this.subscribers = [], this.toasts = [];
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
const te = new _a();
|
|
598
|
-
function Ra(n, e) {
|
|
599
|
-
const t = Ct("toast_");
|
|
600
|
-
return te.create(n, { ...e, id: t }), t;
|
|
601
|
-
}
|
|
602
|
-
const Tt = Object.assign(Ra, {
|
|
603
|
-
add: te.add,
|
|
604
|
-
success: te.success,
|
|
605
|
-
error: te.error,
|
|
606
|
-
info: te.info,
|
|
607
|
-
warning: te.warning,
|
|
608
|
-
dismiss: te.dismiss
|
|
609
|
-
}), Va = { class: "flex flex-col gap-4" }, ja = /* @__PURE__ */ K({
|
|
610
|
-
__name: "BaseForm",
|
|
611
|
-
props: {
|
|
612
|
-
footerClass: {}
|
|
613
|
-
},
|
|
614
|
-
setup(n) {
|
|
615
|
-
return (e, t) => (m(), C("form", Va, [
|
|
616
|
-
F(e.$slots, "default"),
|
|
617
|
-
e.$slots.footer ? (m(), C("footer", {
|
|
618
|
-
key: 0,
|
|
619
|
-
class: D(["mt-4", e.footerClass])
|
|
620
|
-
}, [
|
|
621
|
-
F(e.$slots, "footer")
|
|
622
|
-
], 2)) : R("", !0)
|
|
623
|
-
]));
|
|
624
|
-
}
|
|
625
|
-
}), Ya = {}, Ka = { class: "grid gap-2" };
|
|
626
|
-
function Ha(n, e) {
|
|
627
|
-
return m(), C("div", Ka, [
|
|
628
|
-
F(n.$slots, "default")
|
|
629
|
-
]);
|
|
630
|
-
}
|
|
631
|
-
const za = /* @__PURE__ */ ee(Ya, [["render", Ha]]);
|
|
632
|
-
function Ua(n) {
|
|
633
|
-
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
634
|
-
}
|
|
635
|
-
var Le, rt;
|
|
636
|
-
function Wa() {
|
|
637
|
-
return rt || (rt = 1, Le = function n(e, t) {
|
|
638
|
-
if (e === t) return !0;
|
|
639
|
-
if (e && t && typeof e == "object" && typeof t == "object") {
|
|
640
|
-
if (e.constructor !== t.constructor) return !1;
|
|
641
|
-
var a, r, o;
|
|
642
|
-
if (Array.isArray(e)) {
|
|
643
|
-
if (a = e.length, a != t.length) return !1;
|
|
644
|
-
for (r = a; r-- !== 0; )
|
|
645
|
-
if (!n(e[r], t[r])) return !1;
|
|
646
|
-
return !0;
|
|
647
|
-
}
|
|
648
|
-
if (e.constructor === RegExp) return e.source === t.source && e.flags === t.flags;
|
|
649
|
-
if (e.valueOf !== Object.prototype.valueOf) return e.valueOf() === t.valueOf();
|
|
650
|
-
if (e.toString !== Object.prototype.toString) return e.toString() === t.toString();
|
|
651
|
-
if (o = Object.keys(e), a = o.length, a !== Object.keys(t).length) return !1;
|
|
652
|
-
for (r = a; r-- !== 0; )
|
|
653
|
-
if (!Object.prototype.hasOwnProperty.call(t, o[r])) return !1;
|
|
654
|
-
for (r = a; r-- !== 0; ) {
|
|
655
|
-
var s = o[r];
|
|
656
|
-
if (!n(e[s], t[s])) return !1;
|
|
657
|
-
}
|
|
658
|
-
return !0;
|
|
659
|
-
}
|
|
660
|
-
return e !== e && t !== t;
|
|
661
|
-
}), Le;
|
|
662
|
-
}
|
|
663
|
-
var qa = Wa();
|
|
664
|
-
const Ga = /* @__PURE__ */ Ua(qa);
|
|
665
|
-
function Za(n) {
|
|
666
|
-
let e = n, t;
|
|
667
|
-
const a = be({
|
|
668
|
-
fields: structuredClone(n),
|
|
669
|
-
errors: {},
|
|
670
|
-
dirty: !1,
|
|
671
|
-
hasErrors: !1,
|
|
672
|
-
processing: !1,
|
|
673
|
-
wasSuccessful: !1,
|
|
674
|
-
recentlySuccessful: !1,
|
|
675
|
-
async submit(r, o = {}) {
|
|
676
|
-
if (this.processing) return;
|
|
677
|
-
const s = {
|
|
678
|
-
onBefore: async () => {
|
|
679
|
-
this.processing = !0, this.wasSuccessful = !1, this.recentlySuccessful = !1, clearTimeout(t), o.onBefore && await o.onBefore();
|
|
680
|
-
},
|
|
681
|
-
onSuccess: async (l) => {
|
|
682
|
-
this.clearErrors(), this.wasSuccessful = !0, this.recentlySuccessful = !0, t = window.setTimeout(() => {
|
|
683
|
-
this.recentlySuccessful = !1;
|
|
684
|
-
}, 2e3), o.onSuccess && await o.onSuccess(l), e = structuredClone(this.fields);
|
|
685
|
-
},
|
|
686
|
-
onError: async (l) => {
|
|
687
|
-
var c, i, d, g, h;
|
|
688
|
-
this.hasErrors = !0, (((c = l == null ? void 0 : l.response) == null ? void 0 : c.status) === 422 || ((i = l == null ? void 0 : l.response) == null ? void 0 : i.status) === 401) && (this.clearErrors(), this.setErrors({
|
|
689
|
-
message: (d = l == null ? void 0 : l.response) == null ? void 0 : d.data.message,
|
|
690
|
-
...(h = (g = l == null ? void 0 : l.response) == null ? void 0 : g.data) == null ? void 0 : h.errors
|
|
691
|
-
})), o.onError && await o.onError(l);
|
|
692
|
-
},
|
|
693
|
-
onFinish: async () => {
|
|
694
|
-
this.processing = !1, o.onFinish && await o.onFinish();
|
|
695
|
-
}
|
|
696
|
-
};
|
|
697
|
-
await s.onBefore();
|
|
698
|
-
try {
|
|
699
|
-
const l = await r(this.fields);
|
|
700
|
-
await s.onSuccess(l);
|
|
701
|
-
} catch (l) {
|
|
702
|
-
await s.onError(l);
|
|
703
|
-
} finally {
|
|
704
|
-
await s.onFinish();
|
|
705
|
-
}
|
|
706
|
-
},
|
|
707
|
-
reset(...r) {
|
|
708
|
-
const o = structuredClone(e);
|
|
709
|
-
r.length === 0 ? this.fields = o : r.forEach((s) => {
|
|
710
|
-
o[s] !== void 0 && (this.fields[s] = o[s]);
|
|
711
|
-
});
|
|
712
|
-
},
|
|
713
|
-
clearErrors(...r) {
|
|
714
|
-
r.length === 0 ? this.errors = {} : r.forEach((o) => delete this.errors[o]), this.hasErrors = Object.keys(this.errors).length > 0;
|
|
715
|
-
},
|
|
716
|
-
setErrors(r) {
|
|
717
|
-
this.errors = { ...this.errors, ...r }, this.hasErrors = Object.keys(this.errors).length > 0;
|
|
718
|
-
}
|
|
719
|
-
});
|
|
720
|
-
return W(
|
|
721
|
-
() => a.fields,
|
|
722
|
-
() => {
|
|
723
|
-
a.dirty = !Ga(a.fields, e);
|
|
724
|
-
},
|
|
725
|
-
{ immediate: !0, deep: !0 }
|
|
726
|
-
), a;
|
|
727
|
-
}
|
|
728
|
-
const It = /* @__PURE__ */ K({
|
|
729
|
-
__name: "PasswordConfirm",
|
|
730
|
-
props: {
|
|
731
|
-
action: {},
|
|
732
|
-
successAction: {},
|
|
733
|
-
successMessage: {},
|
|
734
|
-
confirmText: { default: "Confirm" },
|
|
735
|
-
cancelText: { default: "Cancel" },
|
|
736
|
-
passwordLabel: {}
|
|
737
|
-
},
|
|
738
|
-
emits: ["confirm", "cancel"],
|
|
739
|
-
setup(n, { emit: e }) {
|
|
740
|
-
const t = e, a = n, r = [
|
|
741
|
-
{
|
|
742
|
-
name: "password",
|
|
743
|
-
text: "Confirm Password",
|
|
744
|
-
placeholder: "Password",
|
|
745
|
-
autocomplete: "current-password",
|
|
746
|
-
ariaAutocomplete: "inline",
|
|
747
|
-
type: "password",
|
|
748
|
-
required: !0,
|
|
749
|
-
max: 255
|
|
750
|
-
}
|
|
751
|
-
], o = Za({
|
|
752
|
-
password: ""
|
|
753
|
-
}), s = async () => {
|
|
754
|
-
o.submit(
|
|
755
|
-
async (l) => a.action(l),
|
|
756
|
-
{
|
|
757
|
-
onSuccess: (l) => {
|
|
758
|
-
a.successMessage && Tt.success(a.successMessage), a.successAction && a.successAction(l), t("confirm");
|
|
759
|
-
},
|
|
760
|
-
onError() {
|
|
761
|
-
o.reset("password");
|
|
762
|
-
}
|
|
763
|
-
}
|
|
764
|
-
);
|
|
765
|
-
};
|
|
766
|
-
return (l, c) => (m(), Y(ja, {
|
|
767
|
-
onSubmit: re(s, ["prevent"]),
|
|
768
|
-
"footer-class": "flex flex-col-reverse sm:flex-row sm:justify-end gap-2 text-sm"
|
|
769
|
-
}, {
|
|
770
|
-
footer: B(() => [
|
|
771
|
-
M(nt, {
|
|
772
|
-
variant: "reset",
|
|
773
|
-
type: "button",
|
|
774
|
-
disabled: b(o).processing,
|
|
775
|
-
class: "!capitalize",
|
|
776
|
-
onClick: c[0] || (c[0] = (i) => l.$emit("cancel"))
|
|
777
|
-
}, {
|
|
778
|
-
default: B(() => [
|
|
779
|
-
Z(j(l.cancelText), 1)
|
|
780
|
-
]),
|
|
781
|
-
_: 1
|
|
782
|
-
}, 8, ["disabled"]),
|
|
783
|
-
M(nt, {
|
|
784
|
-
variant: "submit",
|
|
785
|
-
type: "button",
|
|
786
|
-
onClick: s,
|
|
787
|
-
disabled: b(o).processing,
|
|
788
|
-
class: "!capitalize !bg-rose-600 hover:!bg-rose-500"
|
|
789
|
-
}, {
|
|
790
|
-
default: B(() => [
|
|
791
|
-
Z(j(l.confirmText), 1)
|
|
792
|
-
]),
|
|
793
|
-
_: 1
|
|
794
|
-
}, 8, ["disabled"])
|
|
795
|
-
]),
|
|
796
|
-
default: B(() => [
|
|
797
|
-
(m(), C(X, null, ge(r, (i, d) => M(za, { key: d }, {
|
|
798
|
-
default: B(() => [
|
|
799
|
-
l.passwordLabel ? (m(), Y(kt, {
|
|
800
|
-
key: 0,
|
|
801
|
-
field: { ...i, text: l.passwordLabel }
|
|
802
|
-
}, null, 8, ["field"])) : R("", !0),
|
|
803
|
-
M(Fa, {
|
|
804
|
-
modelValue: b(o).fields[i.name],
|
|
805
|
-
"onUpdate:modelValue": (g) => b(o).fields[i.name] = g,
|
|
806
|
-
field: i,
|
|
807
|
-
class: "!mt-0"
|
|
808
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "field"]),
|
|
809
|
-
M(ta, {
|
|
810
|
-
errors: b(o).errors,
|
|
811
|
-
"field-name": i.name
|
|
812
|
-
}, null, 8, ["errors", "field-name"])
|
|
813
|
-
]),
|
|
814
|
-
_: 2
|
|
815
|
-
}, 1024)), 64))
|
|
816
|
-
]),
|
|
817
|
-
_: 1
|
|
818
|
-
}));
|
|
819
|
-
}
|
|
820
|
-
}), Xa = { class: "flex flex-wrap gap-2 items-center" }, Qa = {
|
|
821
|
-
ref: "modalTitle",
|
|
822
|
-
id: "modalTitle",
|
|
823
|
-
class: "text-xl font-semibold scroll-mt-16 sm:scroll-mt-12 flex-1"
|
|
824
|
-
}, Ja = {
|
|
825
|
-
key: 0,
|
|
826
|
-
class: "text-neutral-500 dark:text-neutral-400 text-sm w-full",
|
|
827
|
-
id: "modalDescription"
|
|
828
|
-
}, $t = /* @__PURE__ */ K({
|
|
829
|
-
__name: "BaseModal",
|
|
830
|
-
props: {
|
|
831
|
-
modal: {}
|
|
832
|
-
},
|
|
833
|
-
setup(n) {
|
|
834
|
-
return (e, t) => (m(), C(X, null, [
|
|
835
|
-
x("section", Xa, [
|
|
836
|
-
x("h3", Qa, [
|
|
837
|
-
F(e.$slots, "title", {}, () => {
|
|
838
|
-
var a;
|
|
839
|
-
return [
|
|
840
|
-
Z(j(((a = e.modal.props) == null ? void 0 : a.title) ?? "Modal Title"), 1)
|
|
841
|
-
];
|
|
842
|
-
})
|
|
843
|
-
], 512),
|
|
844
|
-
M(Ve, {
|
|
845
|
-
onClick: e.modal.close,
|
|
846
|
-
class: "!m-0 !static"
|
|
847
|
-
}, null, 8, ["onClick"]),
|
|
848
|
-
e.$slots.description ? (m(), C("p", Ja, [
|
|
849
|
-
F(e.$slots, "description")
|
|
850
|
-
])) : R("", !0)
|
|
851
|
-
]),
|
|
852
|
-
F(e.$slots, "default")
|
|
853
|
-
], 64));
|
|
854
|
-
}
|
|
855
|
-
}), Hr = /* @__PURE__ */ K({
|
|
856
|
-
__name: "LogoutSessionsModal",
|
|
857
|
-
props: {
|
|
858
|
-
onSuccess: { type: Function }
|
|
859
|
-
},
|
|
860
|
-
setup(n) {
|
|
861
|
-
const e = n, t = Ge();
|
|
862
|
-
function a() {
|
|
863
|
-
var r;
|
|
864
|
-
t.close(), (r = e.onSuccess) == null || r.call(e);
|
|
865
|
-
}
|
|
866
|
-
return (r, o) => (m(), Y($t, { modal: b(t) }, {
|
|
867
|
-
title: B(() => o[0] || (o[0] = [
|
|
868
|
-
Z("Sign Out of Other Devices", -1)
|
|
869
|
-
])),
|
|
870
|
-
description: B(() => o[1] || (o[1] = [
|
|
871
|
-
Z("Are you sure you want to sign out of other devices? You won't be able to undo this action.", -1)
|
|
872
|
-
])),
|
|
873
|
-
default: B(() => [
|
|
874
|
-
M(It, {
|
|
875
|
-
action: async () => {
|
|
876
|
-
},
|
|
877
|
-
"success-message": "Other Sessions Logged Out Successfully",
|
|
878
|
-
onConfirm: a,
|
|
879
|
-
onCancel: b(t).close
|
|
880
|
-
}, null, 8, ["onCancel"])
|
|
881
|
-
]),
|
|
882
|
-
_: 1
|
|
883
|
-
}, 8, ["modal"]));
|
|
884
|
-
}
|
|
885
|
-
}), zr = /* @__PURE__ */ K({
|
|
886
|
-
__name: "DeleteAccountModal",
|
|
887
|
-
setup(n) {
|
|
888
|
-
const e = Ge(), t = Xt();
|
|
889
|
-
function a() {
|
|
890
|
-
e.close(), t.push("/");
|
|
891
|
-
}
|
|
892
|
-
async function r() {
|
|
893
|
-
}
|
|
894
|
-
return (o, s) => (m(), Y($t, { modal: b(e) }, {
|
|
895
|
-
title: B(() => s[0] || (s[0] = [
|
|
896
|
-
Z("Are you sure you want to delete your account?", -1)
|
|
897
|
-
])),
|
|
898
|
-
description: B(() => s[1] || (s[1] = [
|
|
899
|
-
Z(" Once your account is deleted, all of its resources and data will also be permanently deleted. Please enter your password to confirm you would like to permanently delete your account. ", -1)
|
|
900
|
-
])),
|
|
901
|
-
default: B(() => [
|
|
902
|
-
M(It, {
|
|
903
|
-
action: r,
|
|
904
|
-
"success-message": "Account Deleted...",
|
|
905
|
-
onConfirm: a,
|
|
906
|
-
onCancel: b(e).close
|
|
907
|
-
}, null, 8, ["onCancel"])
|
|
908
|
-
]),
|
|
909
|
-
_: 1
|
|
910
|
-
}, 8, ["modal"]));
|
|
911
|
-
}
|
|
912
|
-
});
|
|
913
|
-
function Ze(n) {
|
|
914
|
-
return Yt() ? (bt(n), !0) : !1;
|
|
915
|
-
}
|
|
916
|
-
function ce(n) {
|
|
917
|
-
return typeof n == "function" ? n() : b(n);
|
|
918
|
-
}
|
|
919
|
-
const Xe = typeof window < "u" && typeof document < "u";
|
|
920
|
-
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
921
|
-
const en = Object.prototype.toString, Pt = (n) => en.call(n) === "[object Object]", me = () => {
|
|
922
|
-
}, je = /* @__PURE__ */ tn();
|
|
923
|
-
function tn() {
|
|
924
|
-
var n, e;
|
|
925
|
-
return Xe && ((n = window == null ? void 0 : window.navigator) == null ? void 0 : n.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((e = window == null ? void 0 : window.navigator) == null ? void 0 : e.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
|
|
926
|
-
}
|
|
927
|
-
function an(...n) {
|
|
928
|
-
if (n.length !== 1)
|
|
929
|
-
return Kt(...n);
|
|
930
|
-
const e = n[0];
|
|
931
|
-
return typeof e == "function" ? Ht(zt(() => ({ get: e, set: me }))) : w(e);
|
|
932
|
-
}
|
|
933
|
-
function ke(n) {
|
|
934
|
-
var e;
|
|
935
|
-
const t = ce(n);
|
|
936
|
-
return (e = t == null ? void 0 : t.$el) != null ? e : t;
|
|
937
|
-
}
|
|
938
|
-
const St = Xe ? window : void 0;
|
|
939
|
-
function Be(...n) {
|
|
940
|
-
let e, t, a, r;
|
|
941
|
-
if (typeof n[0] == "string" || Array.isArray(n[0]) ? ([t, a, r] = n, e = St) : [e, t, a, r] = n, !e)
|
|
942
|
-
return me;
|
|
943
|
-
Array.isArray(t) || (t = [t]), Array.isArray(a) || (a = [a]);
|
|
944
|
-
const o = [], s = () => {
|
|
945
|
-
o.forEach((d) => d()), o.length = 0;
|
|
946
|
-
}, l = (d, g, h, v) => (d.addEventListener(g, h, v), () => d.removeEventListener(g, h, v)), c = W(
|
|
947
|
-
() => [ke(e), ce(r)],
|
|
948
|
-
([d, g]) => {
|
|
949
|
-
if (s(), !d)
|
|
950
|
-
return;
|
|
951
|
-
const h = Pt(g) ? { ...g } : g;
|
|
952
|
-
o.push(
|
|
953
|
-
...t.flatMap((v) => a.map((p) => l(d, v, p, h)))
|
|
954
|
-
);
|
|
955
|
-
},
|
|
956
|
-
{ immediate: !0, flush: "post" }
|
|
957
|
-
), i = () => {
|
|
958
|
-
c(), s();
|
|
959
|
-
};
|
|
960
|
-
return Ze(i), i;
|
|
961
|
-
}
|
|
962
|
-
let st = !1;
|
|
963
|
-
function nn(n, e, t = {}) {
|
|
964
|
-
const { window: a = St, ignore: r = [], capture: o = !0, detectIframe: s = !1 } = t;
|
|
965
|
-
if (!a)
|
|
966
|
-
return me;
|
|
967
|
-
je && !st && (st = !0, Array.from(a.document.body.children).forEach((h) => h.addEventListener("click", me)), a.document.documentElement.addEventListener("click", me));
|
|
968
|
-
let l = !0;
|
|
969
|
-
const c = (h) => r.some((v) => {
|
|
970
|
-
if (typeof v == "string")
|
|
971
|
-
return Array.from(a.document.querySelectorAll(v)).some((p) => p === h.target || h.composedPath().includes(p));
|
|
972
|
-
{
|
|
973
|
-
const p = ke(v);
|
|
974
|
-
return p && (h.target === p || h.composedPath().includes(p));
|
|
975
|
-
}
|
|
976
|
-
}), d = [
|
|
977
|
-
Be(a, "click", (h) => {
|
|
978
|
-
const v = ke(n);
|
|
979
|
-
if (!(!v || v === h.target || h.composedPath().includes(v))) {
|
|
980
|
-
if (h.detail === 0 && (l = !c(h)), !l) {
|
|
981
|
-
l = !0;
|
|
982
|
-
return;
|
|
983
|
-
}
|
|
984
|
-
e(h);
|
|
985
|
-
}
|
|
986
|
-
}, { passive: !0, capture: o }),
|
|
987
|
-
Be(a, "pointerdown", (h) => {
|
|
988
|
-
const v = ke(n);
|
|
989
|
-
l = !c(h) && !!(v && !h.composedPath().includes(v));
|
|
990
|
-
}, { passive: !0 }),
|
|
991
|
-
s && Be(a, "blur", (h) => {
|
|
992
|
-
setTimeout(() => {
|
|
993
|
-
var v;
|
|
994
|
-
const p = ke(n);
|
|
995
|
-
((v = a.document.activeElement) == null ? void 0 : v.tagName) === "IFRAME" && !(p != null && p.contains(a.document.activeElement)) && e(h);
|
|
996
|
-
}, 0);
|
|
997
|
-
})
|
|
998
|
-
].filter(Boolean);
|
|
999
|
-
return () => d.forEach((h) => h());
|
|
1000
|
-
}
|
|
1001
|
-
const At = /* @__PURE__ */ K({
|
|
1002
|
-
name: "OnClickOutside",
|
|
1003
|
-
props: ["as", "options"],
|
|
1004
|
-
emits: ["trigger"],
|
|
1005
|
-
setup(n, { slots: e, emit: t }) {
|
|
1006
|
-
const a = w();
|
|
1007
|
-
return nn(a, (r) => {
|
|
1008
|
-
t("trigger", r);
|
|
1009
|
-
}, n.options), () => {
|
|
1010
|
-
if (e.default)
|
|
1011
|
-
return ht(n.as || "div", { ref: a }, e.default());
|
|
1012
|
-
};
|
|
1013
|
-
}
|
|
1014
|
-
});
|
|
1015
|
-
function rn(n) {
|
|
1016
|
-
var e;
|
|
1017
|
-
const t = ce(n);
|
|
1018
|
-
return (e = t == null ? void 0 : t.$el) != null ? e : t;
|
|
1019
|
-
}
|
|
1020
|
-
const sn = Xe ? window : void 0;
|
|
1021
|
-
function on(...n) {
|
|
1022
|
-
let e, t, a, r;
|
|
1023
|
-
if (typeof n[0] == "string" || Array.isArray(n[0]) ? ([t, a, r] = n, e = sn) : [e, t, a, r] = n, !e)
|
|
1024
|
-
return me;
|
|
1025
|
-
Array.isArray(t) || (t = [t]), Array.isArray(a) || (a = [a]);
|
|
1026
|
-
const o = [], s = () => {
|
|
1027
|
-
o.forEach((d) => d()), o.length = 0;
|
|
1028
|
-
}, l = (d, g, h, v) => (d.addEventListener(g, h, v), () => d.removeEventListener(g, h, v)), c = W(
|
|
1029
|
-
() => [rn(e), ce(r)],
|
|
1030
|
-
([d, g]) => {
|
|
1031
|
-
if (s(), !d)
|
|
1032
|
-
return;
|
|
1033
|
-
const h = Pt(g) ? { ...g } : g;
|
|
1034
|
-
o.push(
|
|
1035
|
-
...t.flatMap((v) => a.map((p) => l(d, v, p, h)))
|
|
1036
|
-
);
|
|
1037
|
-
},
|
|
1038
|
-
{ immediate: !0, flush: "post" }
|
|
1039
|
-
), i = () => {
|
|
1040
|
-
c(), s();
|
|
1041
|
-
};
|
|
1042
|
-
return Ze(i), i;
|
|
1043
|
-
}
|
|
1044
|
-
function Fe(n) {
|
|
1045
|
-
return typeof Window < "u" && n instanceof Window ? n.document.documentElement : typeof Document < "u" && n instanceof Document ? n.documentElement : n;
|
|
1046
|
-
}
|
|
1047
|
-
function Et(n) {
|
|
1048
|
-
const e = window.getComputedStyle(n);
|
|
1049
|
-
if (e.overflowX === "scroll" || e.overflowY === "scroll" || e.overflowX === "auto" && n.clientWidth < n.scrollWidth || e.overflowY === "auto" && n.clientHeight < n.scrollHeight)
|
|
1050
|
-
return !0;
|
|
1051
|
-
{
|
|
1052
|
-
const t = n.parentNode;
|
|
1053
|
-
return !t || t.tagName === "BODY" ? !1 : Et(t);
|
|
1054
|
-
}
|
|
1055
|
-
}
|
|
1056
|
-
function ln(n) {
|
|
1057
|
-
const e = n || window.event, t = e.target;
|
|
1058
|
-
return Et(t) ? !1 : e.touches.length > 1 ? !0 : (e.preventDefault && e.preventDefault(), !1);
|
|
1059
|
-
}
|
|
1060
|
-
const _e = /* @__PURE__ */ new WeakMap();
|
|
1061
|
-
function un(n, e = !1) {
|
|
1062
|
-
const t = w(e);
|
|
1063
|
-
let a = null, r = "";
|
|
1064
|
-
W(an(n), (l) => {
|
|
1065
|
-
const c = Fe(ce(l));
|
|
1066
|
-
if (c) {
|
|
1067
|
-
const i = c;
|
|
1068
|
-
if (_e.get(i) || _e.set(i, i.style.overflow), i.style.overflow !== "hidden" && (r = i.style.overflow), i.style.overflow === "hidden")
|
|
1069
|
-
return t.value = !0;
|
|
1070
|
-
if (t.value)
|
|
1071
|
-
return i.style.overflow = "hidden";
|
|
1072
|
-
}
|
|
1073
|
-
}, {
|
|
1074
|
-
immediate: !0
|
|
1075
|
-
});
|
|
1076
|
-
const o = () => {
|
|
1077
|
-
const l = Fe(ce(n));
|
|
1078
|
-
!l || t.value || (je && (a = on(
|
|
1079
|
-
l,
|
|
1080
|
-
"touchmove",
|
|
1081
|
-
(c) => {
|
|
1082
|
-
ln(c);
|
|
1083
|
-
},
|
|
1084
|
-
{ passive: !1 }
|
|
1085
|
-
)), l.style.overflow = "hidden", t.value = !0);
|
|
1086
|
-
}, s = () => {
|
|
1087
|
-
const l = Fe(ce(n));
|
|
1088
|
-
!l || !t.value || (je && (a == null || a()), l.style.overflow = r, _e.delete(l), t.value = !1);
|
|
1089
|
-
};
|
|
1090
|
-
return Ze(s), J({
|
|
1091
|
-
get() {
|
|
1092
|
-
return t.value;
|
|
1093
|
-
},
|
|
1094
|
-
set(l) {
|
|
1095
|
-
l ? o() : s();
|
|
1096
|
-
}
|
|
1097
|
-
});
|
|
1098
|
-
}
|
|
1099
|
-
function cn() {
|
|
1100
|
-
let n = !1;
|
|
1101
|
-
const e = w(!1);
|
|
1102
|
-
return (t, a) => {
|
|
1103
|
-
if (e.value = a.value, n)
|
|
1104
|
-
return;
|
|
1105
|
-
n = !0;
|
|
1106
|
-
const r = un(t, a.value);
|
|
1107
|
-
W(e, (o) => r.value = o);
|
|
1108
|
-
};
|
|
1109
|
-
}
|
|
1110
|
-
cn();
|
|
1111
|
-
function dn(n) {
|
|
1112
|
-
return typeof n == "function" ? n() : b(n);
|
|
1113
|
-
}
|
|
1114
|
-
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
1115
|
-
function fn(n) {
|
|
1116
|
-
var e;
|
|
1117
|
-
const t = dn(n);
|
|
1118
|
-
return (e = t == null ? void 0 : t.$el) != null ? e : t;
|
|
1119
|
-
}
|
|
1120
|
-
/*!
|
|
1121
|
-
* tabbable 6.2.0
|
|
1122
|
-
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
1123
|
-
*/
|
|
1124
|
-
var Dt = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])", "a[href]:not([inert])", "button:not([inert])", "[tabindex]:not(slot):not([inert])", "audio[controls]:not([inert])", "video[controls]:not([inert])", '[contenteditable]:not([contenteditable="false"]):not([inert])', "details>summary:first-of-type:not([inert])", "details:not([inert])"], Pe = /* @__PURE__ */ Dt.join(","), Mt = typeof Element > "u", de = Mt ? function() {
|
|
1125
|
-
} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector, Se = !Mt && Element.prototype.getRootNode ? function(n) {
|
|
1126
|
-
var e;
|
|
1127
|
-
return n == null || (e = n.getRootNode) === null || e === void 0 ? void 0 : e.call(n);
|
|
1128
|
-
} : function(n) {
|
|
1129
|
-
return n == null ? void 0 : n.ownerDocument;
|
|
1130
|
-
}, Ae = function n(e, t) {
|
|
1131
|
-
var a;
|
|
1132
|
-
t === void 0 && (t = !0);
|
|
1133
|
-
var r = e == null || (a = e.getAttribute) === null || a === void 0 ? void 0 : a.call(e, "inert"), o = r === "" || r === "true", s = o || t && e && n(e.parentNode);
|
|
1134
|
-
return s;
|
|
1135
|
-
}, vn = function(e) {
|
|
1136
|
-
var t, a = e == null || (t = e.getAttribute) === null || t === void 0 ? void 0 : t.call(e, "contenteditable");
|
|
1137
|
-
return a === "" || a === "true";
|
|
1138
|
-
}, Nt = function(e, t, a) {
|
|
1139
|
-
if (Ae(e))
|
|
1140
|
-
return [];
|
|
1141
|
-
var r = Array.prototype.slice.apply(e.querySelectorAll(Pe));
|
|
1142
|
-
return t && de.call(e, Pe) && r.unshift(e), r = r.filter(a), r;
|
|
1143
|
-
}, Ot = function n(e, t, a) {
|
|
1144
|
-
for (var r = [], o = Array.from(e); o.length; ) {
|
|
1145
|
-
var s = o.shift();
|
|
1146
|
-
if (!Ae(s, !1))
|
|
1147
|
-
if (s.tagName === "SLOT") {
|
|
1148
|
-
var l = s.assignedElements(), c = l.length ? l : s.children, i = n(c, !0, a);
|
|
1149
|
-
a.flatten ? r.push.apply(r, i) : r.push({
|
|
1150
|
-
scopeParent: s,
|
|
1151
|
-
candidates: i
|
|
1152
|
-
});
|
|
1153
|
-
} else {
|
|
1154
|
-
var d = de.call(s, Pe);
|
|
1155
|
-
d && a.filter(s) && (t || !e.includes(s)) && r.push(s);
|
|
1156
|
-
var g = s.shadowRoot || // check for an undisclosed shadow
|
|
1157
|
-
typeof a.getShadowRoot == "function" && a.getShadowRoot(s), h = !Ae(g, !1) && (!a.shadowRootFilter || a.shadowRootFilter(s));
|
|
1158
|
-
if (g && h) {
|
|
1159
|
-
var v = n(g === !0 ? s.children : g.children, !0, a);
|
|
1160
|
-
a.flatten ? r.push.apply(r, v) : r.push({
|
|
1161
|
-
scopeParent: s,
|
|
1162
|
-
candidates: v
|
|
1163
|
-
});
|
|
1164
|
-
} else
|
|
1165
|
-
o.unshift.apply(o, s.children);
|
|
1166
|
-
}
|
|
1167
|
-
}
|
|
1168
|
-
return r;
|
|
1169
|
-
}, Lt = function(e) {
|
|
1170
|
-
return !isNaN(parseInt(e.getAttribute("tabindex"), 10));
|
|
1171
|
-
}, ue = function(e) {
|
|
1172
|
-
if (!e)
|
|
1173
|
-
throw new Error("No node provided");
|
|
1174
|
-
return e.tabIndex < 0 && (/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName) || vn(e)) && !Lt(e) ? 0 : e.tabIndex;
|
|
1175
|
-
}, mn = function(e, t) {
|
|
1176
|
-
var a = ue(e);
|
|
1177
|
-
return a < 0 && t && !Lt(e) ? 0 : a;
|
|
1178
|
-
}, pn = function(e, t) {
|
|
1179
|
-
return e.tabIndex === t.tabIndex ? e.documentOrder - t.documentOrder : e.tabIndex - t.tabIndex;
|
|
1180
|
-
}, Bt = function(e) {
|
|
1181
|
-
return e.tagName === "INPUT";
|
|
1182
|
-
}, gn = function(e) {
|
|
1183
|
-
return Bt(e) && e.type === "hidden";
|
|
1184
|
-
}, bn = function(e) {
|
|
1185
|
-
var t = e.tagName === "DETAILS" && Array.prototype.slice.apply(e.children).some(function(a) {
|
|
1186
|
-
return a.tagName === "SUMMARY";
|
|
1187
|
-
});
|
|
1188
|
-
return t;
|
|
1189
|
-
}, hn = function(e, t) {
|
|
1190
|
-
for (var a = 0; a < e.length; a++)
|
|
1191
|
-
if (e[a].checked && e[a].form === t)
|
|
1192
|
-
return e[a];
|
|
1193
|
-
}, yn = function(e) {
|
|
1194
|
-
if (!e.name)
|
|
1195
|
-
return !0;
|
|
1196
|
-
var t = e.form || Se(e), a = function(l) {
|
|
1197
|
-
return t.querySelectorAll('input[type="radio"][name="' + l + '"]');
|
|
1198
|
-
}, r;
|
|
1199
|
-
if (typeof window < "u" && typeof window.CSS < "u" && typeof window.CSS.escape == "function")
|
|
1200
|
-
r = a(window.CSS.escape(e.name));
|
|
1201
|
-
else
|
|
1202
|
-
try {
|
|
1203
|
-
r = a(e.name);
|
|
1204
|
-
} catch (s) {
|
|
1205
|
-
return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s", s.message), !1;
|
|
1206
|
-
}
|
|
1207
|
-
var o = hn(r, e.form);
|
|
1208
|
-
return !o || o === e;
|
|
1209
|
-
}, wn = function(e) {
|
|
1210
|
-
return Bt(e) && e.type === "radio";
|
|
1211
|
-
}, kn = function(e) {
|
|
1212
|
-
return wn(e) && !yn(e);
|
|
1213
|
-
}, xn = function(e) {
|
|
1214
|
-
var t, a = e && Se(e), r = (t = a) === null || t === void 0 ? void 0 : t.host, o = !1;
|
|
1215
|
-
if (a && a !== e) {
|
|
1216
|
-
var s, l, c;
|
|
1217
|
-
for (o = !!((s = r) !== null && s !== void 0 && (l = s.ownerDocument) !== null && l !== void 0 && l.contains(r) || e != null && (c = e.ownerDocument) !== null && c !== void 0 && c.contains(e)); !o && r; ) {
|
|
1218
|
-
var i, d, g;
|
|
1219
|
-
a = Se(r), r = (i = a) === null || i === void 0 ? void 0 : i.host, o = !!((d = r) !== null && d !== void 0 && (g = d.ownerDocument) !== null && g !== void 0 && g.contains(r));
|
|
1220
|
-
}
|
|
1221
|
-
}
|
|
1222
|
-
return o;
|
|
1223
|
-
}, ot = function(e) {
|
|
1224
|
-
var t = e.getBoundingClientRect(), a = t.width, r = t.height;
|
|
1225
|
-
return a === 0 && r === 0;
|
|
1226
|
-
}, Cn = function(e, t) {
|
|
1227
|
-
var a = t.displayCheck, r = t.getShadowRoot;
|
|
1228
|
-
if (getComputedStyle(e).visibility === "hidden")
|
|
1229
|
-
return !0;
|
|
1230
|
-
var o = de.call(e, "details>summary:first-of-type"), s = o ? e.parentElement : e;
|
|
1231
|
-
if (de.call(s, "details:not([open]) *"))
|
|
1232
|
-
return !0;
|
|
1233
|
-
if (!a || a === "full" || a === "legacy-full") {
|
|
1234
|
-
if (typeof r == "function") {
|
|
1235
|
-
for (var l = e; e; ) {
|
|
1236
|
-
var c = e.parentElement, i = Se(e);
|
|
1237
|
-
if (c && !c.shadowRoot && r(c) === !0)
|
|
1238
|
-
return ot(e);
|
|
1239
|
-
e.assignedSlot ? e = e.assignedSlot : !c && i !== e.ownerDocument ? e = i.host : e = c;
|
|
1240
|
-
}
|
|
1241
|
-
e = l;
|
|
1242
|
-
}
|
|
1243
|
-
if (xn(e))
|
|
1244
|
-
return !e.getClientRects().length;
|
|
1245
|
-
if (a !== "legacy-full")
|
|
1246
|
-
return !0;
|
|
1247
|
-
} else if (a === "non-zero-area")
|
|
1248
|
-
return ot(e);
|
|
1249
|
-
return !1;
|
|
1250
|
-
}, Tn = function(e) {
|
|
1251
|
-
if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))
|
|
1252
|
-
for (var t = e.parentElement; t; ) {
|
|
1253
|
-
if (t.tagName === "FIELDSET" && t.disabled) {
|
|
1254
|
-
for (var a = 0; a < t.children.length; a++) {
|
|
1255
|
-
var r = t.children.item(a);
|
|
1256
|
-
if (r.tagName === "LEGEND")
|
|
1257
|
-
return de.call(t, "fieldset[disabled] *") ? !0 : !r.contains(e);
|
|
1258
|
-
}
|
|
1259
|
-
return !0;
|
|
1260
|
-
}
|
|
1261
|
-
t = t.parentElement;
|
|
1262
|
-
}
|
|
1263
|
-
return !1;
|
|
1264
|
-
}, Ee = function(e, t) {
|
|
1265
|
-
return !(t.disabled || // we must do an inert look up to filter out any elements inside an inert ancestor
|
|
1266
|
-
// because we're limited in the type of selectors we can use in JSDom (see related
|
|
1267
|
-
// note related to `candidateSelectors`)
|
|
1268
|
-
Ae(t) || gn(t) || Cn(t, e) || // For a details element with a summary, the summary element gets the focus
|
|
1269
|
-
bn(t) || Tn(t));
|
|
1270
|
-
}, Ye = function(e, t) {
|
|
1271
|
-
return !(kn(t) || ue(t) < 0 || !Ee(e, t));
|
|
1272
|
-
}, In = function(e) {
|
|
1273
|
-
var t = parseInt(e.getAttribute("tabindex"), 10);
|
|
1274
|
-
return !!(isNaN(t) || t >= 0);
|
|
1275
|
-
}, $n = function n(e) {
|
|
1276
|
-
var t = [], a = [];
|
|
1277
|
-
return e.forEach(function(r, o) {
|
|
1278
|
-
var s = !!r.scopeParent, l = s ? r.scopeParent : r, c = mn(l, s), i = s ? n(r.candidates) : l;
|
|
1279
|
-
c === 0 ? s ? t.push.apply(t, i) : t.push(l) : a.push({
|
|
1280
|
-
documentOrder: o,
|
|
1281
|
-
tabIndex: c,
|
|
1282
|
-
item: r,
|
|
1283
|
-
isScope: s,
|
|
1284
|
-
content: i
|
|
1285
|
-
});
|
|
1286
|
-
}), a.sort(pn).reduce(function(r, o) {
|
|
1287
|
-
return o.isScope ? r.push.apply(r, o.content) : r.push(o.content), r;
|
|
1288
|
-
}, []).concat(t);
|
|
1289
|
-
}, Pn = function(e, t) {
|
|
1290
|
-
t = t || {};
|
|
1291
|
-
var a;
|
|
1292
|
-
return t.getShadowRoot ? a = Ot([e], t.includeContainer, {
|
|
1293
|
-
filter: Ye.bind(null, t),
|
|
1294
|
-
flatten: !1,
|
|
1295
|
-
getShadowRoot: t.getShadowRoot,
|
|
1296
|
-
shadowRootFilter: In
|
|
1297
|
-
}) : a = Nt(e, t.includeContainer, Ye.bind(null, t)), $n(a);
|
|
1298
|
-
}, Sn = function(e, t) {
|
|
1299
|
-
t = t || {};
|
|
1300
|
-
var a;
|
|
1301
|
-
return t.getShadowRoot ? a = Ot([e], t.includeContainer, {
|
|
1302
|
-
filter: Ee.bind(null, t),
|
|
1303
|
-
flatten: !0,
|
|
1304
|
-
getShadowRoot: t.getShadowRoot
|
|
1305
|
-
}) : a = Nt(e, t.includeContainer, Ee.bind(null, t)), a;
|
|
1306
|
-
}, ve = function(e, t) {
|
|
1307
|
-
if (t = t || {}, !e)
|
|
1308
|
-
throw new Error("No node provided");
|
|
1309
|
-
return de.call(e, Pe) === !1 ? !1 : Ye(t, e);
|
|
1310
|
-
}, An = /* @__PURE__ */ Dt.concat("iframe").join(","), Re = function(e, t) {
|
|
1311
|
-
if (t = t || {}, !e)
|
|
1312
|
-
throw new Error("No node provided");
|
|
1313
|
-
return de.call(e, An) === !1 ? !1 : Ee(t, e);
|
|
1314
|
-
};
|
|
1315
|
-
/*!
|
|
1316
|
-
* focus-trap 7.6.5
|
|
1317
|
-
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
|
|
1318
|
-
*/
|
|
1319
|
-
function Ke(n, e) {
|
|
1320
|
-
(e == null || e > n.length) && (e = n.length);
|
|
1321
|
-
for (var t = 0, a = Array(e); t < e; t++) a[t] = n[t];
|
|
1322
|
-
return a;
|
|
1323
|
-
}
|
|
1324
|
-
function En(n) {
|
|
1325
|
-
if (Array.isArray(n)) return Ke(n);
|
|
1326
|
-
}
|
|
1327
|
-
function Dn(n, e, t) {
|
|
1328
|
-
return (e = Bn(e)) in n ? Object.defineProperty(n, e, {
|
|
1329
|
-
value: t,
|
|
1330
|
-
enumerable: !0,
|
|
1331
|
-
configurable: !0,
|
|
1332
|
-
writable: !0
|
|
1333
|
-
}) : n[e] = t, n;
|
|
1334
|
-
}
|
|
1335
|
-
function Mn(n) {
|
|
1336
|
-
if (typeof Symbol < "u" && n[Symbol.iterator] != null || n["@@iterator"] != null) return Array.from(n);
|
|
1337
|
-
}
|
|
1338
|
-
function Nn() {
|
|
1339
|
-
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1340
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
1341
|
-
}
|
|
1342
|
-
function lt(n, e) {
|
|
1343
|
-
var t = Object.keys(n);
|
|
1344
|
-
if (Object.getOwnPropertySymbols) {
|
|
1345
|
-
var a = Object.getOwnPropertySymbols(n);
|
|
1346
|
-
e && (a = a.filter(function(r) {
|
|
1347
|
-
return Object.getOwnPropertyDescriptor(n, r).enumerable;
|
|
1348
|
-
})), t.push.apply(t, a);
|
|
1349
|
-
}
|
|
1350
|
-
return t;
|
|
1351
|
-
}
|
|
1352
|
-
function it(n) {
|
|
1353
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
1354
|
-
var t = arguments[e] != null ? arguments[e] : {};
|
|
1355
|
-
e % 2 ? lt(Object(t), !0).forEach(function(a) {
|
|
1356
|
-
Dn(n, a, t[a]);
|
|
1357
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(t)) : lt(Object(t)).forEach(function(a) {
|
|
1358
|
-
Object.defineProperty(n, a, Object.getOwnPropertyDescriptor(t, a));
|
|
1359
|
-
});
|
|
1360
|
-
}
|
|
1361
|
-
return n;
|
|
1362
|
-
}
|
|
1363
|
-
function On(n) {
|
|
1364
|
-
return En(n) || Mn(n) || Fn(n) || Nn();
|
|
1365
|
-
}
|
|
1366
|
-
function Ln(n, e) {
|
|
1367
|
-
if (typeof n != "object" || !n) return n;
|
|
1368
|
-
var t = n[Symbol.toPrimitive];
|
|
1369
|
-
if (t !== void 0) {
|
|
1370
|
-
var a = t.call(n, e);
|
|
1371
|
-
if (typeof a != "object") return a;
|
|
1372
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1373
|
-
}
|
|
1374
|
-
return (e === "string" ? String : Number)(n);
|
|
1375
|
-
}
|
|
1376
|
-
function Bn(n) {
|
|
1377
|
-
var e = Ln(n, "string");
|
|
1378
|
-
return typeof e == "symbol" ? e : e + "";
|
|
1379
|
-
}
|
|
1380
|
-
function Fn(n, e) {
|
|
1381
|
-
if (n) {
|
|
1382
|
-
if (typeof n == "string") return Ke(n, e);
|
|
1383
|
-
var t = {}.toString.call(n).slice(8, -1);
|
|
1384
|
-
return t === "Object" && n.constructor && (t = n.constructor.name), t === "Map" || t === "Set" ? Array.from(n) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? Ke(n, e) : void 0;
|
|
1385
|
-
}
|
|
1386
|
-
}
|
|
1387
|
-
var ut = {
|
|
1388
|
-
activateTrap: function(e, t) {
|
|
1389
|
-
if (e.length > 0) {
|
|
1390
|
-
var a = e[e.length - 1];
|
|
1391
|
-
a !== t && a._setPausedState(!0);
|
|
1392
|
-
}
|
|
1393
|
-
var r = e.indexOf(t);
|
|
1394
|
-
r === -1 || e.splice(r, 1), e.push(t);
|
|
1395
|
-
},
|
|
1396
|
-
deactivateTrap: function(e, t) {
|
|
1397
|
-
var a = e.indexOf(t);
|
|
1398
|
-
a !== -1 && e.splice(a, 1), e.length > 0 && !e[e.length - 1]._isManuallyPaused() && e[e.length - 1]._setPausedState(!1);
|
|
1399
|
-
}
|
|
1400
|
-
}, _n = function(e) {
|
|
1401
|
-
return e.tagName && e.tagName.toLowerCase() === "input" && typeof e.select == "function";
|
|
1402
|
-
}, Rn = function(e) {
|
|
1403
|
-
return (e == null ? void 0 : e.key) === "Escape" || (e == null ? void 0 : e.key) === "Esc" || (e == null ? void 0 : e.keyCode) === 27;
|
|
1404
|
-
}, xe = function(e) {
|
|
1405
|
-
return (e == null ? void 0 : e.key) === "Tab" || (e == null ? void 0 : e.keyCode) === 9;
|
|
1406
|
-
}, Vn = function(e) {
|
|
1407
|
-
return xe(e) && !e.shiftKey;
|
|
1408
|
-
}, jn = function(e) {
|
|
1409
|
-
return xe(e) && e.shiftKey;
|
|
1410
|
-
}, ct = function(e) {
|
|
1411
|
-
return setTimeout(e, 0);
|
|
1412
|
-
}, we = function(e) {
|
|
1413
|
-
for (var t = arguments.length, a = new Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++)
|
|
1414
|
-
a[r - 1] = arguments[r];
|
|
1415
|
-
return typeof e == "function" ? e.apply(void 0, a) : e;
|
|
1416
|
-
}, Ie = function(e) {
|
|
1417
|
-
return e.target.shadowRoot && typeof e.composedPath == "function" ? e.composedPath()[0] : e.target;
|
|
1418
|
-
}, Yn = [], Kn = function(e, t) {
|
|
1419
|
-
var a = (t == null ? void 0 : t.document) || document, r = (t == null ? void 0 : t.trapStack) || Yn, o = it({
|
|
1420
|
-
returnFocusOnDeactivate: !0,
|
|
1421
|
-
escapeDeactivates: !0,
|
|
1422
|
-
delayInitialFocus: !0,
|
|
1423
|
-
isKeyForward: Vn,
|
|
1424
|
-
isKeyBackward: jn
|
|
1425
|
-
}, t), s = {
|
|
1426
|
-
// containers given to createFocusTrap()
|
|
1427
|
-
// @type {Array<HTMLElement>}
|
|
1428
|
-
containers: [],
|
|
1429
|
-
// list of objects identifying tabbable nodes in `containers` in the trap
|
|
1430
|
-
// NOTE: it's possible that a group has no tabbable nodes if nodes get removed while the trap
|
|
1431
|
-
// is active, but the trap should never get to a state where there isn't at least one group
|
|
1432
|
-
// with at least one tabbable node in it (that would lead to an error condition that would
|
|
1433
|
-
// result in an error being thrown)
|
|
1434
|
-
// @type {Array<{
|
|
1435
|
-
// container: HTMLElement,
|
|
1436
|
-
// tabbableNodes: Array<HTMLElement>, // empty if none
|
|
1437
|
-
// focusableNodes: Array<HTMLElement>, // empty if none
|
|
1438
|
-
// posTabIndexesFound: boolean,
|
|
1439
|
-
// firstTabbableNode: HTMLElement|undefined,
|
|
1440
|
-
// lastTabbableNode: HTMLElement|undefined,
|
|
1441
|
-
// firstDomTabbableNode: HTMLElement|undefined,
|
|
1442
|
-
// lastDomTabbableNode: HTMLElement|undefined,
|
|
1443
|
-
// nextTabbableNode: (node: HTMLElement, forward: boolean) => HTMLElement|undefined
|
|
1444
|
-
// }>}
|
|
1445
|
-
containerGroups: [],
|
|
1446
|
-
// same order/length as `containers` list
|
|
1447
|
-
// references to objects in `containerGroups`, but only those that actually have
|
|
1448
|
-
// tabbable nodes in them
|
|
1449
|
-
// NOTE: same order as `containers` and `containerGroups`, but __not necessarily__
|
|
1450
|
-
// the same length
|
|
1451
|
-
tabbableGroups: [],
|
|
1452
|
-
nodeFocusedBeforeActivation: null,
|
|
1453
|
-
mostRecentlyFocusedNode: null,
|
|
1454
|
-
active: !1,
|
|
1455
|
-
paused: !1,
|
|
1456
|
-
manuallyPaused: !1,
|
|
1457
|
-
// timer ID for when delayInitialFocus is true and initial focus in this trap
|
|
1458
|
-
// has been delayed during activation
|
|
1459
|
-
delayInitialFocusTimer: void 0,
|
|
1460
|
-
// the most recent KeyboardEvent for the configured nav key (typically [SHIFT+]TAB), if any
|
|
1461
|
-
recentNavEvent: void 0
|
|
1462
|
-
}, l, c = function(f, u, y) {
|
|
1463
|
-
return f && f[u] !== void 0 ? f[u] : o[y || u];
|
|
1464
|
-
}, i = function(f, u) {
|
|
1465
|
-
var y = typeof (u == null ? void 0 : u.composedPath) == "function" ? u.composedPath() : void 0;
|
|
1466
|
-
return s.containerGroups.findIndex(function(I) {
|
|
1467
|
-
var S = I.container, O = I.tabbableNodes;
|
|
1468
|
-
return S.contains(f) || // fall back to explicit tabbable search which will take into consideration any
|
|
1469
|
-
// web components if the `tabbableOptions.getShadowRoot` option was used for
|
|
1470
|
-
// the trap, enabling shadow DOM support in tabbable (`Node.contains()` doesn't
|
|
1471
|
-
// look inside web components even if open)
|
|
1472
|
-
(y == null ? void 0 : y.includes(S)) || O.find(function(A) {
|
|
1473
|
-
return A === f;
|
|
1474
|
-
});
|
|
1475
|
-
});
|
|
1476
|
-
}, d = function(f) {
|
|
1477
|
-
var u = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, y = u.hasFallback, I = y === void 0 ? !1 : y, S = u.params, O = S === void 0 ? [] : S, A = o[f];
|
|
1478
|
-
if (typeof A == "function" && (A = A.apply(void 0, On(O))), A === !0 && (A = void 0), !A) {
|
|
1479
|
-
if (A === void 0 || A === !1)
|
|
1480
|
-
return A;
|
|
1481
|
-
throw new Error("`".concat(f, "` was specified but was not a node, or did not return a node"));
|
|
1482
|
-
}
|
|
1483
|
-
var L = A;
|
|
1484
|
-
if (typeof A == "string") {
|
|
1485
|
-
try {
|
|
1486
|
-
L = a.querySelector(A);
|
|
1487
|
-
} catch (z) {
|
|
1488
|
-
throw new Error("`".concat(f, '` appears to be an invalid selector; error="').concat(z.message, '"'));
|
|
1489
|
-
}
|
|
1490
|
-
if (!L && !I)
|
|
1491
|
-
throw new Error("`".concat(f, "` as selector refers to no known node"));
|
|
1492
|
-
}
|
|
1493
|
-
return L;
|
|
1494
|
-
}, g = function() {
|
|
1495
|
-
var f = d("initialFocus", {
|
|
1496
|
-
hasFallback: !0
|
|
1497
|
-
});
|
|
1498
|
-
if (f === !1)
|
|
1499
|
-
return !1;
|
|
1500
|
-
if (f === void 0 || f && !Re(f, o.tabbableOptions))
|
|
1501
|
-
if (i(a.activeElement) >= 0)
|
|
1502
|
-
f = a.activeElement;
|
|
1503
|
-
else {
|
|
1504
|
-
var u = s.tabbableGroups[0], y = u && u.firstTabbableNode;
|
|
1505
|
-
f = y || d("fallbackFocus");
|
|
1506
|
-
}
|
|
1507
|
-
else f === null && (f = d("fallbackFocus"));
|
|
1508
|
-
if (!f)
|
|
1509
|
-
throw new Error("Your focus-trap needs to have at least one focusable element");
|
|
1510
|
-
return f;
|
|
1511
|
-
}, h = function() {
|
|
1512
|
-
if (s.containerGroups = s.containers.map(function(f) {
|
|
1513
|
-
var u = Pn(f, o.tabbableOptions), y = Sn(f, o.tabbableOptions), I = u.length > 0 ? u[0] : void 0, S = u.length > 0 ? u[u.length - 1] : void 0, O = y.find(function(z) {
|
|
1514
|
-
return ve(z);
|
|
1515
|
-
}), A = y.slice().reverse().find(function(z) {
|
|
1516
|
-
return ve(z);
|
|
1517
|
-
}), L = !!u.find(function(z) {
|
|
1518
|
-
return ue(z) > 0;
|
|
1519
|
-
});
|
|
1520
|
-
return {
|
|
1521
|
-
container: f,
|
|
1522
|
-
tabbableNodes: u,
|
|
1523
|
-
focusableNodes: y,
|
|
1524
|
-
/** True if at least one node with positive `tabindex` was found in this container. */
|
|
1525
|
-
posTabIndexesFound: L,
|
|
1526
|
-
/** First tabbable node in container, __tabindex__ order; `undefined` if none. */
|
|
1527
|
-
firstTabbableNode: I,
|
|
1528
|
-
/** Last tabbable node in container, __tabindex__ order; `undefined` if none. */
|
|
1529
|
-
lastTabbableNode: S,
|
|
1530
|
-
// NOTE: DOM order is NOT NECESSARILY "document position" order, but figuring that out
|
|
1531
|
-
// would require more than just https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition
|
|
1532
|
-
// because that API doesn't work with Shadow DOM as well as it should (@see
|
|
1533
|
-
// https://github.com/whatwg/dom/issues/320) and since this first/last is only needed, so far,
|
|
1534
|
-
// to address an edge case related to positive tabindex support, this seems like a much easier,
|
|
1535
|
-
// "close enough most of the time" alternative for positive tabindexes which should generally
|
|
1536
|
-
// be avoided anyway...
|
|
1537
|
-
/** First tabbable node in container, __DOM__ order; `undefined` if none. */
|
|
1538
|
-
firstDomTabbableNode: O,
|
|
1539
|
-
/** Last tabbable node in container, __DOM__ order; `undefined` if none. */
|
|
1540
|
-
lastDomTabbableNode: A,
|
|
1541
|
-
/**
|
|
1542
|
-
* Finds the __tabbable__ node that follows the given node in the specified direction,
|
|
1543
|
-
* in this container, if any.
|
|
1544
|
-
* @param {HTMLElement} node
|
|
1545
|
-
* @param {boolean} [forward] True if going in forward tab order; false if going
|
|
1546
|
-
* in reverse.
|
|
1547
|
-
* @returns {HTMLElement|undefined} The next tabbable node, if any.
|
|
1548
|
-
*/
|
|
1549
|
-
nextTabbableNode: function(oe) {
|
|
1550
|
-
var he = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, ne = u.indexOf(oe);
|
|
1551
|
-
return ne < 0 ? he ? y.slice(y.indexOf(oe) + 1).find(function(ye) {
|
|
1552
|
-
return ve(ye);
|
|
1553
|
-
}) : y.slice(0, y.indexOf(oe)).reverse().find(function(ye) {
|
|
1554
|
-
return ve(ye);
|
|
1555
|
-
}) : u[ne + (he ? 1 : -1)];
|
|
1556
|
-
}
|
|
1557
|
-
};
|
|
1558
|
-
}), s.tabbableGroups = s.containerGroups.filter(function(f) {
|
|
1559
|
-
return f.tabbableNodes.length > 0;
|
|
1560
|
-
}), s.tabbableGroups.length <= 0 && !d("fallbackFocus"))
|
|
1561
|
-
throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");
|
|
1562
|
-
if (s.containerGroups.find(function(f) {
|
|
1563
|
-
return f.posTabIndexesFound;
|
|
1564
|
-
}) && s.containerGroups.length > 1)
|
|
1565
|
-
throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.");
|
|
1566
|
-
}, v = function(f) {
|
|
1567
|
-
var u = f.activeElement;
|
|
1568
|
-
if (u)
|
|
1569
|
-
return u.shadowRoot && u.shadowRoot.activeElement !== null ? v(u.shadowRoot) : u;
|
|
1570
|
-
}, p = function(f) {
|
|
1571
|
-
if (f !== !1 && f !== v(document)) {
|
|
1572
|
-
if (!f || !f.focus) {
|
|
1573
|
-
p(g());
|
|
1574
|
-
return;
|
|
1575
|
-
}
|
|
1576
|
-
f.focus({
|
|
1577
|
-
preventScroll: !!o.preventScroll
|
|
1578
|
-
}), s.mostRecentlyFocusedNode = f, _n(f) && f.select();
|
|
1579
|
-
}
|
|
1580
|
-
}, T = function(f) {
|
|
1581
|
-
var u = d("setReturnFocus", {
|
|
1582
|
-
params: [f]
|
|
1583
|
-
});
|
|
1584
|
-
return u || (u === !1 ? !1 : f);
|
|
1585
|
-
}, P = function(f) {
|
|
1586
|
-
var u = f.target, y = f.event, I = f.isBackward, S = I === void 0 ? !1 : I;
|
|
1587
|
-
u = u || Ie(y), h();
|
|
1588
|
-
var O = null;
|
|
1589
|
-
if (s.tabbableGroups.length > 0) {
|
|
1590
|
-
var A = i(u, y), L = A >= 0 ? s.containerGroups[A] : void 0;
|
|
1591
|
-
if (A < 0)
|
|
1592
|
-
S ? O = s.tabbableGroups[s.tabbableGroups.length - 1].lastTabbableNode : O = s.tabbableGroups[0].firstTabbableNode;
|
|
1593
|
-
else if (S) {
|
|
1594
|
-
var z = s.tabbableGroups.findIndex(function(Me) {
|
|
1595
|
-
var Ne = Me.firstTabbableNode;
|
|
1596
|
-
return u === Ne;
|
|
1597
|
-
});
|
|
1598
|
-
if (z < 0 && (L.container === u || Re(u, o.tabbableOptions) && !ve(u, o.tabbableOptions) && !L.nextTabbableNode(u, !1)) && (z = A), z >= 0) {
|
|
1599
|
-
var oe = z === 0 ? s.tabbableGroups.length - 1 : z - 1, he = s.tabbableGroups[oe];
|
|
1600
|
-
O = ue(u) >= 0 ? he.lastTabbableNode : he.lastDomTabbableNode;
|
|
1601
|
-
} else xe(y) || (O = L.nextTabbableNode(u, !1));
|
|
1602
|
-
} else {
|
|
1603
|
-
var ne = s.tabbableGroups.findIndex(function(Me) {
|
|
1604
|
-
var Ne = Me.lastTabbableNode;
|
|
1605
|
-
return u === Ne;
|
|
1606
|
-
});
|
|
1607
|
-
if (ne < 0 && (L.container === u || Re(u, o.tabbableOptions) && !ve(u, o.tabbableOptions) && !L.nextTabbableNode(u)) && (ne = A), ne >= 0) {
|
|
1608
|
-
var ye = ne === s.tabbableGroups.length - 1 ? 0 : ne + 1, Qe = s.tabbableGroups[ye];
|
|
1609
|
-
O = ue(u) >= 0 ? Qe.firstTabbableNode : Qe.firstDomTabbableNode;
|
|
1610
|
-
} else xe(y) || (O = L.nextTabbableNode(u));
|
|
1611
|
-
}
|
|
1612
|
-
} else
|
|
1613
|
-
O = d("fallbackFocus");
|
|
1614
|
-
return O;
|
|
1615
|
-
}, k = function(f) {
|
|
1616
|
-
var u = Ie(f);
|
|
1617
|
-
if (!(i(u, f) >= 0)) {
|
|
1618
|
-
if (we(o.clickOutsideDeactivates, f)) {
|
|
1619
|
-
l.deactivate({
|
|
1620
|
-
// NOTE: by setting `returnFocus: false`, deactivate() will do nothing,
|
|
1621
|
-
// which will result in the outside click setting focus to the node
|
|
1622
|
-
// that was clicked (and if not focusable, to "nothing"); by setting
|
|
1623
|
-
// `returnFocus: true`, we'll attempt to re-focus the node originally-focused
|
|
1624
|
-
// on activation (or the configured `setReturnFocus` node), whether the
|
|
1625
|
-
// outside click was on a focusable node or not
|
|
1626
|
-
returnFocus: o.returnFocusOnDeactivate
|
|
1627
|
-
});
|
|
1628
|
-
return;
|
|
1629
|
-
}
|
|
1630
|
-
we(o.allowOutsideClick, f) || f.preventDefault();
|
|
1631
|
-
}
|
|
1632
|
-
}, E = function(f) {
|
|
1633
|
-
var u = Ie(f), y = i(u, f) >= 0;
|
|
1634
|
-
if (y || u instanceof Document)
|
|
1635
|
-
y && (s.mostRecentlyFocusedNode = u);
|
|
1636
|
-
else {
|
|
1637
|
-
f.stopImmediatePropagation();
|
|
1638
|
-
var I, S = !0;
|
|
1639
|
-
if (s.mostRecentlyFocusedNode)
|
|
1640
|
-
if (ue(s.mostRecentlyFocusedNode) > 0) {
|
|
1641
|
-
var O = i(s.mostRecentlyFocusedNode), A = s.containerGroups[O].tabbableNodes;
|
|
1642
|
-
if (A.length > 0) {
|
|
1643
|
-
var L = A.findIndex(function(z) {
|
|
1644
|
-
return z === s.mostRecentlyFocusedNode;
|
|
1645
|
-
});
|
|
1646
|
-
L >= 0 && (o.isKeyForward(s.recentNavEvent) ? L + 1 < A.length && (I = A[L + 1], S = !1) : L - 1 >= 0 && (I = A[L - 1], S = !1));
|
|
1647
|
-
}
|
|
1648
|
-
} else
|
|
1649
|
-
s.containerGroups.some(function(z) {
|
|
1650
|
-
return z.tabbableNodes.some(function(oe) {
|
|
1651
|
-
return ue(oe) > 0;
|
|
1652
|
-
});
|
|
1653
|
-
}) || (S = !1);
|
|
1654
|
-
else
|
|
1655
|
-
S = !1;
|
|
1656
|
-
S && (I = P({
|
|
1657
|
-
// move FROM the MRU node, not event-related node (which will be the node that is
|
|
1658
|
-
// outside the trap causing the focus escape we're trying to fix)
|
|
1659
|
-
target: s.mostRecentlyFocusedNode,
|
|
1660
|
-
isBackward: o.isKeyBackward(s.recentNavEvent)
|
|
1661
|
-
})), p(I || s.mostRecentlyFocusedNode || g());
|
|
1662
|
-
}
|
|
1663
|
-
s.recentNavEvent = void 0;
|
|
1664
|
-
}, V = function(f) {
|
|
1665
|
-
var u = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
|
|
1666
|
-
s.recentNavEvent = f;
|
|
1667
|
-
var y = P({
|
|
1668
|
-
event: f,
|
|
1669
|
-
isBackward: u
|
|
1670
|
-
});
|
|
1671
|
-
y && (xe(f) && f.preventDefault(), p(y));
|
|
1672
|
-
}, U = function(f) {
|
|
1673
|
-
(o.isKeyForward(f) || o.isKeyBackward(f)) && V(f, o.isKeyBackward(f));
|
|
1674
|
-
}, _ = function(f) {
|
|
1675
|
-
Rn(f) && we(o.escapeDeactivates, f) !== !1 && (f.preventDefault(), l.deactivate());
|
|
1676
|
-
}, $ = function(f) {
|
|
1677
|
-
var u = Ie(f);
|
|
1678
|
-
i(u, f) >= 0 || we(o.clickOutsideDeactivates, f) || we(o.allowOutsideClick, f) || (f.preventDefault(), f.stopImmediatePropagation());
|
|
1679
|
-
}, H = function() {
|
|
1680
|
-
if (s.active)
|
|
1681
|
-
return ut.activateTrap(r, l), s.delayInitialFocusTimer = o.delayInitialFocus ? ct(function() {
|
|
1682
|
-
p(g());
|
|
1683
|
-
}) : p(g()), a.addEventListener("focusin", E, !0), a.addEventListener("mousedown", k, {
|
|
1684
|
-
capture: !0,
|
|
1685
|
-
passive: !1
|
|
1686
|
-
}), a.addEventListener("touchstart", k, {
|
|
1687
|
-
capture: !0,
|
|
1688
|
-
passive: !1
|
|
1689
|
-
}), a.addEventListener("click", $, {
|
|
1690
|
-
capture: !0,
|
|
1691
|
-
passive: !1
|
|
1692
|
-
}), a.addEventListener("keydown", U, {
|
|
1693
|
-
capture: !0,
|
|
1694
|
-
passive: !1
|
|
1695
|
-
}), a.addEventListener("keydown", _), l;
|
|
1696
|
-
}, Te = function() {
|
|
1697
|
-
if (s.active)
|
|
1698
|
-
return a.removeEventListener("focusin", E, !0), a.removeEventListener("mousedown", k, !0), a.removeEventListener("touchstart", k, !0), a.removeEventListener("click", $, !0), a.removeEventListener("keydown", U, !0), a.removeEventListener("keydown", _), l;
|
|
1699
|
-
}, fe = function(f) {
|
|
1700
|
-
var u = f.some(function(y) {
|
|
1701
|
-
var I = Array.from(y.removedNodes);
|
|
1702
|
-
return I.some(function(S) {
|
|
1703
|
-
return S === s.mostRecentlyFocusedNode;
|
|
1704
|
-
});
|
|
1705
|
-
});
|
|
1706
|
-
u && p(g());
|
|
1707
|
-
}, se = typeof window < "u" && "MutationObserver" in window ? new MutationObserver(fe) : void 0, ae = function() {
|
|
1708
|
-
se && (se.disconnect(), s.active && !s.paused && s.containers.map(function(f) {
|
|
1709
|
-
se.observe(f, {
|
|
1710
|
-
subtree: !0,
|
|
1711
|
-
childList: !0
|
|
1712
|
-
});
|
|
1713
|
-
}));
|
|
1714
|
-
};
|
|
1715
|
-
return l = {
|
|
1716
|
-
get active() {
|
|
1717
|
-
return s.active;
|
|
1718
|
-
},
|
|
1719
|
-
get paused() {
|
|
1720
|
-
return s.paused;
|
|
1721
|
-
},
|
|
1722
|
-
activate: function(f) {
|
|
1723
|
-
if (s.active)
|
|
1724
|
-
return this;
|
|
1725
|
-
var u = c(f, "onActivate"), y = c(f, "onPostActivate"), I = c(f, "checkCanFocusTrap");
|
|
1726
|
-
I || h(), s.active = !0, s.paused = !1, s.nodeFocusedBeforeActivation = v(a), u == null || u();
|
|
1727
|
-
var S = function() {
|
|
1728
|
-
I && h(), H(), ae(), y == null || y();
|
|
1729
|
-
};
|
|
1730
|
-
return I ? (I(s.containers.concat()).then(S, S), this) : (S(), this);
|
|
1731
|
-
},
|
|
1732
|
-
deactivate: function(f) {
|
|
1733
|
-
if (!s.active)
|
|
1734
|
-
return this;
|
|
1735
|
-
var u = it({
|
|
1736
|
-
onDeactivate: o.onDeactivate,
|
|
1737
|
-
onPostDeactivate: o.onPostDeactivate,
|
|
1738
|
-
checkCanReturnFocus: o.checkCanReturnFocus
|
|
1739
|
-
}, f);
|
|
1740
|
-
clearTimeout(s.delayInitialFocusTimer), s.delayInitialFocusTimer = void 0, Te(), s.active = !1, s.paused = !1, ae(), ut.deactivateTrap(r, l);
|
|
1741
|
-
var y = c(u, "onDeactivate"), I = c(u, "onPostDeactivate"), S = c(u, "checkCanReturnFocus"), O = c(u, "returnFocus", "returnFocusOnDeactivate");
|
|
1742
|
-
y == null || y();
|
|
1743
|
-
var A = function() {
|
|
1744
|
-
ct(function() {
|
|
1745
|
-
O && p(T(s.nodeFocusedBeforeActivation)), I == null || I();
|
|
1746
|
-
});
|
|
1747
|
-
};
|
|
1748
|
-
return O && S ? (S(T(s.nodeFocusedBeforeActivation)).then(A, A), this) : (A(), this);
|
|
1749
|
-
},
|
|
1750
|
-
pause: function(f) {
|
|
1751
|
-
return s.active ? (s.manuallyPaused = !0, this._setPausedState(!0, f)) : this;
|
|
1752
|
-
},
|
|
1753
|
-
unpause: function(f) {
|
|
1754
|
-
return s.active ? (s.manuallyPaused = !1, r[r.length - 1] !== this ? this : this._setPausedState(!1, f)) : this;
|
|
1755
|
-
},
|
|
1756
|
-
updateContainerElements: function(f) {
|
|
1757
|
-
var u = [].concat(f).filter(Boolean);
|
|
1758
|
-
return s.containers = u.map(function(y) {
|
|
1759
|
-
return typeof y == "string" ? a.querySelector(y) : y;
|
|
1760
|
-
}), s.active && h(), ae(), this;
|
|
1761
|
-
}
|
|
1762
|
-
}, Object.defineProperties(l, {
|
|
1763
|
-
_isManuallyPaused: {
|
|
1764
|
-
value: function() {
|
|
1765
|
-
return s.manuallyPaused;
|
|
1766
|
-
}
|
|
1767
|
-
},
|
|
1768
|
-
_setPausedState: {
|
|
1769
|
-
value: function(f, u) {
|
|
1770
|
-
if (s.paused === f)
|
|
1771
|
-
return this;
|
|
1772
|
-
if (s.paused = f, f) {
|
|
1773
|
-
var y = c(u, "onPause"), I = c(u, "onPostPause");
|
|
1774
|
-
y == null || y(), Te(), ae(), I == null || I();
|
|
1775
|
-
} else {
|
|
1776
|
-
var S = c(u, "onUnpause"), O = c(u, "onPostUnpause");
|
|
1777
|
-
S == null || S(), h(), H(), ae(), O == null || O();
|
|
1778
|
-
}
|
|
1779
|
-
return this;
|
|
1780
|
-
}
|
|
1781
|
-
}
|
|
1782
|
-
}), l.updateContainerElements(e), l;
|
|
1783
|
-
};
|
|
1784
|
-
const Hn = /* @__PURE__ */ K({
|
|
1785
|
-
name: "UseFocusTrap",
|
|
1786
|
-
props: ["as", "options"],
|
|
1787
|
-
setup(n, { slots: e }) {
|
|
1788
|
-
let t;
|
|
1789
|
-
const a = w(), r = () => t && t.activate(), o = () => t && t.deactivate();
|
|
1790
|
-
return W(
|
|
1791
|
-
() => fn(a),
|
|
1792
|
-
(s) => {
|
|
1793
|
-
s && (t = Kn(s, n.options || {}), r());
|
|
1794
|
-
},
|
|
1795
|
-
{ flush: "post" }
|
|
1796
|
-
), bt(() => o()), () => {
|
|
1797
|
-
if (e.default)
|
|
1798
|
-
return ht(n.as || "div", { ref: a }, e.default());
|
|
1799
|
-
};
|
|
1800
|
-
}
|
|
1801
|
-
}), zn = {
|
|
1802
|
-
class: "modal fixed top-0 left-0 z-[300] flex items-center justify-center w-screen h-screen text-gray-900 dark:text-neutral-200 bg-transparent",
|
|
1803
|
-
"aria-modal": "true",
|
|
1804
|
-
"aria-labelledby": "modalTitle",
|
|
1805
|
-
"aria-describedby": "modalDescription"
|
|
1806
|
-
}, Un = {
|
|
1807
|
-
key: 0,
|
|
1808
|
-
class: "absolute inset-0 w-full h-full backdrop-blur-sm bg-opacity-70"
|
|
1809
|
-
}, Ur = /* @__PURE__ */ K({
|
|
1810
|
-
__name: "GlobalModal",
|
|
1811
|
-
setup(n) {
|
|
1812
|
-
const e = Ge();
|
|
1813
|
-
return (t, a) => (m(), Y(Ue, { to: "body" }, [
|
|
1814
|
-
G(x("dialog", zn, [
|
|
1815
|
-
M(pe, {
|
|
1816
|
-
"enter-active-class": "ease-out duration-300",
|
|
1817
|
-
"enter-from-class": "opacity-0",
|
|
1818
|
-
"enter-to-class": "opacity-100",
|
|
1819
|
-
"leave-active-class": "ease-in duration-300",
|
|
1820
|
-
"leave-from-class": "opacity-100",
|
|
1821
|
-
"leave-to-class": "opacity-0"
|
|
1822
|
-
}, {
|
|
1823
|
-
default: B(() => [
|
|
1824
|
-
b(e).isOpen ? (m(), C("div", Un)) : R("", !0)
|
|
1825
|
-
]),
|
|
1826
|
-
_: 1
|
|
1827
|
-
}),
|
|
1828
|
-
M(pe, {
|
|
1829
|
-
"enter-active-class": "ease-out duration-300",
|
|
1830
|
-
"enter-from-class": "opacity-0 sm:scale-95",
|
|
1831
|
-
"enter-to-class": "opacity-100 sm:scale-100",
|
|
1832
|
-
"leave-active-class": "ease-in duration-200",
|
|
1833
|
-
"leave-from-class": "opacity-100 sm:scale-100",
|
|
1834
|
-
"leave-to-class": "opacity-0 sm:scale-95"
|
|
1835
|
-
}, {
|
|
1836
|
-
default: B(() => [
|
|
1837
|
-
b(e).isOpen ? (m(), Y(b(Hn), {
|
|
1838
|
-
key: 0,
|
|
1839
|
-
class: "relative w-full px-6 py-10 sm:py-6 max-h-screen h-full overflow-y-scroll scrollbar-hide flex items-center"
|
|
1840
|
-
}, {
|
|
1841
|
-
default: B(() => [
|
|
1842
|
-
M(b(At), {
|
|
1843
|
-
onTrigger: b(e).close,
|
|
1844
|
-
onKeydown: ie(b(e).close, ["esc"]),
|
|
1845
|
-
class: "gap-4 flex flex-col drop-shadow-md m-auto w-full p-6 bg-white dark:bg-neutral-800/90 backdrop-blur-lg border shadow-lg border-neutral-200 dark:border-neutral-700 sm:max-w-lg xl:max-w-xl 3xl:max-w-2xl rounded-md sm:rounded-lg",
|
|
1846
|
-
tabindex: "-1"
|
|
1847
|
-
}, {
|
|
1848
|
-
default: B(() => [
|
|
1849
|
-
(m(), Y(De(b(e).component), Ut(Wt(b(e).props)), null, 16))
|
|
1850
|
-
]),
|
|
1851
|
-
_: 1
|
|
1852
|
-
}, 8, ["onTrigger", "onKeydown"])
|
|
1853
|
-
]),
|
|
1854
|
-
_: 1
|
|
1855
|
-
})) : R("", !0)
|
|
1856
|
-
]),
|
|
1857
|
-
_: 1
|
|
1858
|
-
})
|
|
1859
|
-
], 512), [
|
|
1860
|
-
[Q, b(e).isOpen || b(e).isAnimating]
|
|
1861
|
-
])
|
|
1862
|
-
]));
|
|
1863
|
-
}
|
|
1864
|
-
}), Wn = ["disabled"], le = /* @__PURE__ */ K({
|
|
1865
|
-
__name: "TablePaginationButton",
|
|
1866
|
-
props: {
|
|
1867
|
-
currentPage: {},
|
|
1868
|
-
pageNumber: {},
|
|
1869
|
-
text: {},
|
|
1870
|
-
underline: { type: Boolean, default: !1 },
|
|
1871
|
-
sticky: { type: Boolean, default: !1 },
|
|
1872
|
-
disabled: { type: Boolean, default: !1 }
|
|
1873
|
-
},
|
|
1874
|
-
setup(n) {
|
|
1875
|
-
const e = n;
|
|
1876
|
-
return (t, a) => (m(), C("li", {
|
|
1877
|
-
class: D([{ hidden: e.currentPage !== e.pageNumber && !e.text && !e.sticky }, "h-full md:block z-0"])
|
|
1878
|
-
}, [
|
|
1879
|
-
x("button", {
|
|
1880
|
-
class: D(["relative inline-flex items-center h-full px-3 group hover:text-gray-900 hover:dark:text-white disabled:dark:text-neutral-500 disabled:text-neutral-400 disabled:cursor-not-allowed", { "text-gray-900 dark:text-white bg-gray-50 dark:bg-neutral-900": e.currentPage === e.pageNumber }]),
|
|
1881
|
-
disabled: e.disabled ?? !1
|
|
1882
|
-
}, [
|
|
1883
|
-
F(t.$slots, "content", {}, () => [
|
|
1884
|
-
x("span", null, j((e == null ? void 0 : e.text) ?? e.pageNumber), 1)
|
|
1885
|
-
]),
|
|
1886
|
-
!e.text || e.underline ? (m(), C("span", {
|
|
1887
|
-
key: 0,
|
|
1888
|
-
class: D(["box-content absolute bottom-0 w-0 h-px -mx-px duration-200 ease-out translate-y-px border-transparent group-hover:left-0 group-hover:w-full group-hover:border-l group-hover:border-r bg-violet-600 group-hover:border-violet-600", {
|
|
1889
|
-
"left-0 w-full border-l border-r": e.currentPage === e.pageNumber,
|
|
1890
|
-
"left-1/2": e.currentPage !== e.pageNumber
|
|
1891
|
-
}]),
|
|
1892
|
-
"bg-neutral-900": "",
|
|
1893
|
-
"dark:bg-violet-600": "",
|
|
1894
|
-
"group-hover:border-neutral-900": "",
|
|
1895
|
-
"group-hover:dark:border-violet-600": ""
|
|
1896
|
-
}, null, 2)) : R("", !0)
|
|
1897
|
-
], 10, Wn)
|
|
1898
|
-
], 2));
|
|
1899
|
-
}
|
|
1900
|
-
}), qn = { class: "dark:text-neutral-300 line-clamp-1 text-sm" }, Gn = { class: "font-medium dark:text-white" }, Zn = { class: "font-medium dark:text-white" }, Xn = { class: "font-medium dark:text-white" }, Qn = { class: "flex items-center text-sm leading-tight bg-white dark:bg-primary-dark-800/70 border divide-x rounded h-9 text-neutral-500 dark:text-neutral-300 divide-neutral-200 dark:divide-neutral-700 border-neutral-200 dark:border-neutral-700" }, Jn = /* @__PURE__ */ K({
|
|
1901
|
-
__name: "TablePagination",
|
|
1902
|
-
props: {
|
|
1903
|
-
listLength: {},
|
|
1904
|
-
currentPage: {},
|
|
1905
|
-
itemsPerPage: {},
|
|
1906
|
-
useIcons: { type: Boolean },
|
|
1907
|
-
maxVisiblePages: { default: 5 }
|
|
1908
|
-
},
|
|
1909
|
-
emits: ["setPage"],
|
|
1910
|
-
setup(n, { emit: e }) {
|
|
1911
|
-
const t = n, a = w(null), r = e, o = J(() => Math.ceil(t.listLength / t.itemsPerPage)), s = J(() => {
|
|
1912
|
-
const c = o.value, i = t.currentPage, d = t.maxVisiblePages, g = Math.max(d - 1, 3), h = Math.max(d - 1, 2);
|
|
1913
|
-
if (c <= d) return Array.from({ length: c }, (v, p) => p + 1);
|
|
1914
|
-
if (i < g) return Array.from({ length: h }, (v, p) => p + 1);
|
|
1915
|
-
if (o.value - i < g - 1) {
|
|
1916
|
-
let v = [];
|
|
1917
|
-
for (let p = o.value - h + 1; p <= o.value; p++)
|
|
1918
|
-
v = [...v, p];
|
|
1919
|
-
return v;
|
|
1920
|
-
}
|
|
1921
|
-
return d >= 5 ? [i - 1, i, i + 1] : [i];
|
|
1922
|
-
}), l = async (c) => {
|
|
1923
|
-
var i;
|
|
1924
|
-
r("setPage", c), await qe(), (i = a.value) == null || i.scrollIntoView({ behavior: "instant", block: "end" });
|
|
1925
|
-
};
|
|
1926
|
-
return (c, i) => (m(), C("div", {
|
|
1927
|
-
class: D("flex items-center flex-col sm:flex-row sm:justify-between flex-wrap gap-2 scroll-mb-12"),
|
|
1928
|
-
ref_key: "$element",
|
|
1929
|
-
ref: a
|
|
1930
|
-
}, [
|
|
1931
|
-
x("p", qn, [
|
|
1932
|
-
i[6] || (i[6] = Z(" Showing ", -1)),
|
|
1933
|
-
x("span", Gn, j(t.listLength ? t.itemsPerPage * (c.currentPage - 1) + 1 : 0), 1),
|
|
1934
|
-
i[7] || (i[7] = Z(" to ", -1)),
|
|
1935
|
-
x("span", Zn, j(Math.min(t.itemsPerPage * c.currentPage, t.listLength)), 1),
|
|
1936
|
-
i[8] || (i[8] = Z(" of ", -1)),
|
|
1937
|
-
x("span", Xn, j(c.listLength), 1)
|
|
1938
|
-
]),
|
|
1939
|
-
x("ul", Qn, [
|
|
1940
|
-
M(le, {
|
|
1941
|
-
pageNumber: -1,
|
|
1942
|
-
text: "Previous",
|
|
1943
|
-
disabled: t.currentPage === 1,
|
|
1944
|
-
onClick: i[0] || (i[0] = (d) => l(Math.max(1, t.currentPage - 1))),
|
|
1945
|
-
title: "Previous Page"
|
|
1946
|
-
}, Je({ _: 2 }, [
|
|
1947
|
-
c.useIcons ? {
|
|
1948
|
-
name: "content",
|
|
1949
|
-
fn: B(() => [
|
|
1950
|
-
M(b(at), {
|
|
1951
|
-
class: "w-4 h-4",
|
|
1952
|
-
title: "Previous"
|
|
1953
|
-
})
|
|
1954
|
-
]),
|
|
1955
|
-
key: "0"
|
|
1956
|
-
} : {
|
|
1957
|
-
name: "content",
|
|
1958
|
-
fn: B(() => [
|
|
1959
|
-
i[9] || (i[9] = x("span", { class: "hidden sm:block" }, j("Previous"), -1)),
|
|
1960
|
-
M(b(at), {
|
|
1961
|
-
class: "w-4 h-4 sm:hidden",
|
|
1962
|
-
title: "Previous"
|
|
1963
|
-
})
|
|
1964
|
-
]),
|
|
1965
|
-
key: "1"
|
|
1966
|
-
}
|
|
1967
|
-
]), 1032, ["disabled"]),
|
|
1968
|
-
o.value > t.maxVisiblePages && t.currentPage > Math.max(t.maxVisiblePages - 2, 2) ? (m(), C(X, { key: 0 }, [
|
|
1969
|
-
c.maxVisiblePages > 3 ? (m(), Y(le, {
|
|
1970
|
-
key: 0,
|
|
1971
|
-
pageNumber: 1,
|
|
1972
|
-
currentPage: t.currentPage,
|
|
1973
|
-
onClick: i[1] || (i[1] = (d) => l(1)),
|
|
1974
|
-
sticky: !0
|
|
1975
|
-
}, null, 8, ["currentPage"])) : R("", !0),
|
|
1976
|
-
M(le, {
|
|
1977
|
-
pageNumber: -1,
|
|
1978
|
-
text: "...",
|
|
1979
|
-
onClick: i[2] || (i[2] = (d) => l(Math.floor(c.currentPage / 2))),
|
|
1980
|
-
underline: !0,
|
|
1981
|
-
title: `Page ${Math.floor(c.currentPage / 2)}`
|
|
1982
|
-
}, null, 8, ["title"])
|
|
1983
|
-
], 64)) : R("", !0),
|
|
1984
|
-
(m(!0), C(X, null, ge(s.value, (d) => (m(), Y(le, {
|
|
1985
|
-
key: d,
|
|
1986
|
-
pageNumber: d,
|
|
1987
|
-
currentPage: t.currentPage,
|
|
1988
|
-
onClick: (g) => l(d),
|
|
1989
|
-
title: `Page ${d}`
|
|
1990
|
-
}, null, 8, ["pageNumber", "currentPage", "onClick", "title"]))), 128)),
|
|
1991
|
-
o.value > t.maxVisiblePages && o.value - t.currentPage > Math.max(t.maxVisiblePages - 3, 1) ? (m(), C(X, { key: 1 }, [
|
|
1992
|
-
M(le, {
|
|
1993
|
-
pageNumber: -1,
|
|
1994
|
-
text: "...",
|
|
1995
|
-
title: `Page ${Math.floor((o.value - c.currentPage) / 2 + c.currentPage)}`,
|
|
1996
|
-
onClick: i[3] || (i[3] = (d) => l(Math.floor((o.value - c.currentPage) / 2 + c.currentPage))),
|
|
1997
|
-
underline: !0
|
|
1998
|
-
}, null, 8, ["title"]),
|
|
1999
|
-
c.maxVisiblePages > 3 ? (m(), Y(le, {
|
|
2000
|
-
key: 0,
|
|
2001
|
-
pageNumber: o.value,
|
|
2002
|
-
currentPage: t.currentPage,
|
|
2003
|
-
onClick: i[4] || (i[4] = (d) => l(o.value)),
|
|
2004
|
-
sticky: !0
|
|
2005
|
-
}, null, 8, ["pageNumber", "currentPage"])) : R("", !0)
|
|
2006
|
-
], 64)) : R("", !0),
|
|
2007
|
-
M(le, {
|
|
2008
|
-
pageNumber: -1,
|
|
2009
|
-
text: "Next",
|
|
2010
|
-
disabled: t.currentPage === o.value,
|
|
2011
|
-
onClick: i[5] || (i[5] = (d) => l(Math.min(o.value, t.currentPage + 1))),
|
|
2012
|
-
title: "Next Page"
|
|
2013
|
-
}, Je({ _: 2 }, [
|
|
2014
|
-
c.useIcons ? {
|
|
2015
|
-
name: "content",
|
|
2016
|
-
fn: B(() => [
|
|
2017
|
-
M(b(tt), {
|
|
2018
|
-
class: "w-4 h-4",
|
|
2019
|
-
title: "Next"
|
|
2020
|
-
})
|
|
2021
|
-
]),
|
|
2022
|
-
key: "0"
|
|
2023
|
-
} : {
|
|
2024
|
-
name: "content",
|
|
2025
|
-
fn: B(() => [
|
|
2026
|
-
i[10] || (i[10] = x("span", { class: "hidden sm:block" }, j("Next"), -1)),
|
|
2027
|
-
M(b(tt), {
|
|
2028
|
-
class: "w-4 h-4 sm:hidden",
|
|
2029
|
-
title: "Next"
|
|
2030
|
-
})
|
|
2031
|
-
]),
|
|
2032
|
-
key: "1"
|
|
2033
|
-
}
|
|
2034
|
-
]), 1032, ["disabled"])
|
|
2035
|
-
])
|
|
2036
|
-
], 512));
|
|
2037
|
-
}
|
|
2038
|
-
}), er = { class: "flex flex-col justify-center gap-2 text-sm" }, tr = ["name", "id", "placeholder"], ar = /* @__PURE__ */ K({
|
|
2039
|
-
__name: "TextInputLabelled",
|
|
2040
|
-
props: /* @__PURE__ */ $e(["text", "placeholder", "id"], {
|
|
2041
|
-
modelValue: {},
|
|
2042
|
-
modelModifiers: {}
|
|
2043
|
-
}),
|
|
2044
|
-
emits: ["update:modelValue"],
|
|
2045
|
-
setup(n) {
|
|
2046
|
-
const e = We(n, "modelValue");
|
|
2047
|
-
return (t, a) => (m(), C("div", er, [
|
|
2048
|
-
M(kt, {
|
|
2049
|
-
field: { name: n.id, text: n.text, type: "text" }
|
|
2050
|
-
}, null, 8, ["field"]),
|
|
2051
|
-
G(x("input", {
|
|
2052
|
-
type: "text",
|
|
2053
|
-
"onUpdate:modelValue": a[0] || (a[0] = (r) => e.value = r),
|
|
2054
|
-
name: n.id,
|
|
2055
|
-
id: n.id,
|
|
2056
|
-
placeholder: n.placeholder,
|
|
2057
|
-
class: D(`h-10 p-2 px-3 shadow-sm rounded-md w-full text-sm
|
|
2058
|
-
border-none outline-none
|
|
2059
|
-
disabled:cursor-not-allowed disabled:opacity-50
|
|
2060
|
-
text-gray-900 dark:text-neutral-100 bg-white dark:bg-primary-dark-800 placeholder:text-neutral-400
|
|
2061
|
-
ring-inset focus:ring-inset ring-1 ring-neutral-200 dark:ring-neutral-700
|
|
2062
|
-
hocus:ring-[0.125rem] focus:ring-purple-400 dark:focus:ring-purple-500 hover:ring-violet-400 hover:dark:ring-violet-700`)
|
|
2063
|
-
}, null, 8, tr), [
|
|
2064
|
-
[qt, e.value]
|
|
2065
|
-
])
|
|
2066
|
-
]));
|
|
2067
|
-
}
|
|
2068
|
-
});
|
|
2069
|
-
function nr(n, e) {
|
|
2070
|
-
const t = be({
|
|
2071
|
-
selectOpen: !1,
|
|
2072
|
-
selectedItem: "",
|
|
2073
|
-
selectableItems: n,
|
|
2074
|
-
selectableItemActive: null,
|
|
2075
|
-
selectId: "select-12",
|
|
2076
|
-
selectKeydownValue: "",
|
|
2077
|
-
selectKeydownTimeout: 1e3,
|
|
2078
|
-
selectKeydownClearTimeout: null,
|
|
2079
|
-
selectDropdownPosition: "bottom",
|
|
2080
|
-
selectableItemsList: e.selectableItemsList,
|
|
2081
|
-
selectButton: e.selectButton,
|
|
2082
|
-
toggleSelect(r) {
|
|
2083
|
-
r !== void 0 ? this.selectOpen = r === !0 : this.selectOpen = !this.selectOpen;
|
|
2084
|
-
},
|
|
2085
|
-
updateRefs(r) {
|
|
2086
|
-
this.selectButton = r.selectButton, this.selectableItemsList = r.selectableItemsList;
|
|
2087
|
-
},
|
|
2088
|
-
selectableItemIsActive(r) {
|
|
2089
|
-
return this.selectableItemActive && this.selectableItemActive.value == r.value;
|
|
2090
|
-
},
|
|
2091
|
-
selectableItemActiveNext() {
|
|
2092
|
-
let r = this.selectableItems.indexOf(this.selectableItemActive);
|
|
2093
|
-
r < this.selectableItems.length - 1 && (this.selectableItemActive = this.selectableItems[r + 1], this.selectScrollToActiveItem());
|
|
2094
|
-
},
|
|
2095
|
-
selectableItemActivePrevious() {
|
|
2096
|
-
let r = this.selectableItems.indexOf(this.selectableItemActive);
|
|
2097
|
-
r > 0 && (this.selectableItemActive = this.selectableItems[r - 1], this.selectScrollToActiveItem());
|
|
2098
|
-
},
|
|
2099
|
-
selectScrollToActiveItem() {
|
|
2100
|
-
if (!this.selectableItemActive) return;
|
|
2101
|
-
let r = document.getElementById(this.selectableItemActive.value + "-" + this.selectId);
|
|
2102
|
-
r && r.focus();
|
|
2103
|
-
},
|
|
2104
|
-
selectKeydown(r) {
|
|
2105
|
-
if (r.keyCode >= 65 && r.keyCode <= 90) {
|
|
2106
|
-
this.selectKeydownValue += r.key;
|
|
2107
|
-
let o = this.selectItemsFindBestMatch();
|
|
2108
|
-
o && (this.selectOpen ? (this.selectableItemActive = o, this.selectScrollToActiveItem()) : this.selectedItem = this.selectableItemActive === o), this.selectKeydownValue != "" && (clearTimeout(this.selectKeydownClearTimeout), this.selectKeydownClearTimeout = window.setTimeout(() => {
|
|
2109
|
-
this.selectKeydownValue = "";
|
|
2110
|
-
}, this.selectKeydownTimeout));
|
|
2111
|
-
}
|
|
2112
|
-
},
|
|
2113
|
-
selectItemsFindBestMatch() {
|
|
2114
|
-
let r = this.selectKeydownValue.toLowerCase(), o = null, s = -1;
|
|
2115
|
-
for (const l of this.selectableItems) {
|
|
2116
|
-
let i = l.title.toLowerCase().indexOf(r);
|
|
2117
|
-
i > -1 && (s == -1 || i < s) && !l.disabled && (o = l, s = i);
|
|
2118
|
-
}
|
|
2119
|
-
return o;
|
|
2120
|
-
},
|
|
2121
|
-
selectPositionUpdate() {
|
|
2122
|
-
var o;
|
|
2123
|
-
if (!this.selectableItemsList || !this.selectButton) return;
|
|
2124
|
-
let r = ((o = this.selectButton) == null ? void 0 : o.getBoundingClientRect().top) + this.selectButton.offsetHeight + parseInt(window.getComputedStyle(this.selectableItemsList).maxHeight);
|
|
2125
|
-
window.innerHeight < r ? this.selectDropdownPosition = "top" : this.selectDropdownPosition = "bottom";
|
|
2126
|
-
}
|
|
2127
|
-
}), a = () => {
|
|
2128
|
-
t.selectOpen && t.selectPositionUpdate();
|
|
2129
|
-
};
|
|
2130
|
-
return W(
|
|
2131
|
-
() => t.selectOpen,
|
|
2132
|
-
function(r) {
|
|
2133
|
-
if (t.selectedItem ? t.selectableItemActive = t.selectedItem : t.selectableItemActive = t.selectableItems[0], !r) {
|
|
2134
|
-
window.removeEventListener("resize", a);
|
|
2135
|
-
return;
|
|
2136
|
-
}
|
|
2137
|
-
window.setTimeout(function() {
|
|
2138
|
-
t.selectScrollToActiveItem();
|
|
2139
|
-
}, 10), a(), window.addEventListener("resize", a);
|
|
2140
|
-
},
|
|
2141
|
-
{ immediate: !1 }
|
|
2142
|
-
), t;
|
|
2143
|
-
}
|
|
2144
|
-
const rr = ["id", "disabled", "title"], sr = { class: "truncate" }, or = { class: "absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none" }, lr = ["onClick", "onKeydown", "onFocus", "onMousemove", "id", "title", "data-disabled", "tabindex", "aria-selected"], ir = {
|
|
2145
|
-
key: 0,
|
|
2146
|
-
class: "absolute left-0 w-4 h-4 ml-2 stroke-current text-neutral-400",
|
|
2147
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2148
|
-
viewBox: "0 0 24 24",
|
|
2149
|
-
fill: "none",
|
|
2150
|
-
stroke: "currentColor",
|
|
2151
|
-
"stroke-width": "2",
|
|
2152
|
-
"stroke-linecap": "round",
|
|
2153
|
-
"stroke-linejoin": "round"
|
|
2154
|
-
}, ur = { class: "block font-medium truncate" }, cr = /* @__PURE__ */ K({
|
|
2155
|
-
__name: "InputSelect",
|
|
2156
|
-
props: {
|
|
2157
|
-
name: {},
|
|
2158
|
-
class: { default: "" },
|
|
2159
|
-
rootClass: { default: "" },
|
|
2160
|
-
placeholder: {},
|
|
2161
|
-
defaultItem: { default: null },
|
|
2162
|
-
options: { default: () => [
|
|
2163
|
-
{
|
|
2164
|
-
title: "Title",
|
|
2165
|
-
value: "title",
|
|
2166
|
-
disabled: !1
|
|
2167
|
-
},
|
|
2168
|
-
{
|
|
2169
|
-
title: "Date Uploaded",
|
|
2170
|
-
value: "date",
|
|
2171
|
-
disabled: !1
|
|
2172
|
-
},
|
|
2173
|
-
{
|
|
2174
|
-
title: "Date released",
|
|
2175
|
-
value: "date_released",
|
|
2176
|
-
disabled: !1
|
|
2177
|
-
},
|
|
2178
|
-
{
|
|
2179
|
-
title: "Episode",
|
|
2180
|
-
value: "episode",
|
|
2181
|
-
disabled: !0
|
|
2182
|
-
},
|
|
2183
|
-
{
|
|
2184
|
-
title: "Season",
|
|
2185
|
-
value: "season",
|
|
2186
|
-
disabled: !0
|
|
2187
|
-
}
|
|
2188
|
-
] },
|
|
2189
|
-
disabled: { type: Boolean },
|
|
2190
|
-
title: {},
|
|
2191
|
-
prefix: { default: "" },
|
|
2192
|
-
menuMargin: {}
|
|
2193
|
-
},
|
|
2194
|
-
emits: ["selectItem"],
|
|
2195
|
-
setup(n, { emit: e }) {
|
|
2196
|
-
const t = n, a = e, r = Oe("selectButton"), o = Oe("selectableItemsList"), s = Oe("selectableItemsRoot"), l = nr(t.options, { selectableItemsList: o, selectButton: r }), c = w(null), i = (v, p = !0) => {
|
|
2197
|
-
var T;
|
|
2198
|
-
l.selectedItem = v, l.toggleSelect(!1), p && ((T = r.value) == null || T.focus()), a("selectItem", l.selectedItem);
|
|
2199
|
-
}, d = (v) => {
|
|
2200
|
-
l.selectableItemActive = v, l.selectScrollToActiveItem();
|
|
2201
|
-
}, g = (v) => {
|
|
2202
|
-
l.selectableItemActive = v;
|
|
2203
|
-
}, h = () => {
|
|
2204
|
-
c.value && clearTimeout(c.value), c.value = window.setTimeout(() => {
|
|
2205
|
-
if (!s.value) return;
|
|
2206
|
-
const v = document.activeElement;
|
|
2207
|
-
s.value.contains(v) || l.toggleSelect(!1);
|
|
2208
|
-
}, 0);
|
|
2209
|
-
};
|
|
2210
|
-
return Ce(() => {
|
|
2211
|
-
t.disabled || t.defaultItem != null && t.defaultItem < t.options.length && t.defaultItem >= 0 && i(t.options[t.defaultItem], !1);
|
|
2212
|
-
}), W(
|
|
2213
|
-
() => t.options,
|
|
2214
|
-
() => {
|
|
2215
|
-
l.selectableItems = t.options;
|
|
2216
|
-
}
|
|
2217
|
-
), W(
|
|
2218
|
-
r,
|
|
2219
|
-
() => {
|
|
2220
|
-
r.value && (l.selectButton = r);
|
|
2221
|
-
},
|
|
2222
|
-
{ immediate: !0 }
|
|
2223
|
-
), W(
|
|
2224
|
-
() => o.value,
|
|
2225
|
-
() => {
|
|
2226
|
-
o.value && (l.selectableItemsList = o);
|
|
2227
|
-
},
|
|
2228
|
-
{ immediate: !0 }
|
|
2229
|
-
), (v, p) => (m(), C("section", {
|
|
2230
|
-
class: D(["relative", v.rootClass]),
|
|
2231
|
-
onFocusout: h,
|
|
2232
|
-
ref_key: "selectableItemsRoot",
|
|
2233
|
-
ref: s
|
|
2234
|
-
}, [
|
|
2235
|
-
x("button", {
|
|
2236
|
-
id: v.name ?? "Select",
|
|
2237
|
-
ref_key: "selectButton",
|
|
2238
|
-
ref: r,
|
|
2239
|
-
onClick: p[0] || (p[0] = (T) => b(l).toggleSelect()),
|
|
2240
|
-
class: D([
|
|
2241
|
-
{ "hocus:ring-0": b(l).selectOpen },
|
|
2242
|
-
{ "!text-neutral-400": v.placeholder && !b(l).selectedItem },
|
|
2243
|
-
"relative h-10 flex items-center justify-between w-full py-2 pl-3 pr-10",
|
|
2244
|
-
"text-left rounded-md shadow-sm cursor-pointer text-sm border-none focus:outline-none",
|
|
2245
|
-
"ring-inset ring-1 ring-neutral-200 dark:ring-neutral-700 hocus:ring-[0.125rem] hover:ring-violet-400 hover:dark:ring-violet-700 focus:ring-purple-400 dark:focus:ring-purple-500",
|
|
2246
|
-
"text-gray-900 dark:text-neutral-100 bg-white dark:bg-primary-dark-800",
|
|
2247
|
-
"disabled:cursor-not-allowed disabled:hover:ring-neutral-200 disabled:hover:dark:ring-neutral-700 disabled:opacity-60",
|
|
2248
|
-
t.class
|
|
2249
|
-
]),
|
|
2250
|
-
disabled: v.disabled,
|
|
2251
|
-
type: "button",
|
|
2252
|
-
title: v.title ?? "Make Selection"
|
|
2253
|
-
}, [
|
|
2254
|
-
x("span", sr, j(
|
|
2255
|
-
//@ts-ignore
|
|
2256
|
-
b(l).selectedItem ? `${v.prefix}${b(l).selectedItem.title}` : v.placeholder
|
|
2257
|
-
), 1),
|
|
2258
|
-
x("span", or, [
|
|
2259
|
-
F(v.$slots, "selectButtonIcon", {}, () => [
|
|
2260
|
-
p[7] || (p[7] = x("svg", {
|
|
2261
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2262
|
-
viewBox: "0 0 20 20",
|
|
2263
|
-
fill: "currentColor",
|
|
2264
|
-
"aria-hidden": "true",
|
|
2265
|
-
class: "w-5 h-5 text-gray-400"
|
|
2266
|
-
}, [
|
|
2267
|
-
x("path", {
|
|
2268
|
-
"fill-rule": "evenodd",
|
|
2269
|
-
d: "M10 3a.75.75 0 01.55.24l3.25 3.5a.75.75 0 11-1.1 1.02L10 4.852 7.3 7.76a.75.75 0 01-1.1-1.02l3.25-3.5A.75.75 0 0110 3zm-3.76 9.2a.75.75 0 011.06.04l2.7 2.908 2.7-2.908a.75.75 0 111.1 1.02l-3.25 3.5a.75.75 0 01-1.1 0l-3.25-3.5a.75.75 0 01.04-1.06z",
|
|
2270
|
-
"clip-rule": "evenodd"
|
|
2271
|
-
})
|
|
2272
|
-
], -1))
|
|
2273
|
-
])
|
|
2274
|
-
])
|
|
2275
|
-
], 10, rr),
|
|
2276
|
-
M(pe, {
|
|
2277
|
-
"enter-active-class": "transition ease-out duration-50",
|
|
2278
|
-
"enter-from-class": "opacity-0 -translate-y-1",
|
|
2279
|
-
"enter-to-class": "opacity-100"
|
|
2280
|
-
}, {
|
|
2281
|
-
default: B(() => {
|
|
2282
|
-
var T, P;
|
|
2283
|
-
return [
|
|
2284
|
-
b(l).selectOpen ? (m(), Y(b(At), {
|
|
2285
|
-
key: 0,
|
|
2286
|
-
class: D([[
|
|
2287
|
-
b(l).selectDropdownPosition == "top" ? `bottom-0 ${((T = v.menuMargin) == null ? void 0 : T.bottom) ?? "mb-11"}` : `top-0 ${((P = v.menuMargin) == null ? void 0 : P.top) ?? "mt-11"}`
|
|
2288
|
-
], "z-30 absolute w-full mt-1 overflow-clip text-sm rounded-md shadow-md max-h-56 ring-1 ring-opacity-5 ring-black dark:ring-neutral-700 bg-white dark:bg-neutral-800/70 backdrop-blur-lg"]),
|
|
2289
|
-
onTrigger: p[1] || (p[1] = (k) => b(l).toggleSelect(!1)),
|
|
2290
|
-
onKeydown: [
|
|
2291
|
-
p[2] || (p[2] = ie(re(
|
|
2292
|
-
(k) => {
|
|
2293
|
-
b(l).selectOpen && (b(l).toggleSelect(!1), k.stopPropagation());
|
|
2294
|
-
},
|
|
2295
|
-
["stop"]
|
|
2296
|
-
), ["esc"])),
|
|
2297
|
-
p[3] || (p[3] = ie(re(
|
|
2298
|
-
(k) => {
|
|
2299
|
-
b(l).selectOpen ? b(l).selectableItemActiveNext() : b(l).toggleSelect(!0), k.preventDefault();
|
|
2300
|
-
},
|
|
2301
|
-
["stop", "prevent"]
|
|
2302
|
-
), ["down"])),
|
|
2303
|
-
p[4] || (p[4] = ie(re(
|
|
2304
|
-
(k) => {
|
|
2305
|
-
b(l).selectOpen ? b(l).selectableItemActivePrevious() : b(l).toggleSelect(!0), k.preventDefault();
|
|
2306
|
-
},
|
|
2307
|
-
["stop", "prevent"]
|
|
2308
|
-
), ["up"])),
|
|
2309
|
-
p[5] || (p[5] = ie(re((k) => {
|
|
2310
|
-
b(l).selectedItem = b(l).selectableItemActive, b(l).toggleSelect(!1);
|
|
2311
|
-
}, ["stop"]), ["enter"])),
|
|
2312
|
-
p[6] || (p[6] = re((k) => b(l).selectKeydown(k), ["stop"]))
|
|
2313
|
-
]
|
|
2314
|
-
}, {
|
|
2315
|
-
default: B(() => [
|
|
2316
|
-
x("ul", {
|
|
2317
|
-
ref_key: "selectableItemsList",
|
|
2318
|
-
ref: o,
|
|
2319
|
-
class: "w-full overflow-auto max-h-56 scrollbar-thin focus:outline-none",
|
|
2320
|
-
tabindex: "-1",
|
|
2321
|
-
role: "listbox"
|
|
2322
|
-
}, [
|
|
2323
|
-
(m(!0), C(X, null, ge(b(l).selectableItems, (k) => (m(), C("li", {
|
|
2324
|
-
key: k.value,
|
|
2325
|
-
onClick: (E) => i(k),
|
|
2326
|
-
onKeydown: [
|
|
2327
|
-
ie((E) => i(k), ["enter"]),
|
|
2328
|
-
ie((E) => i(k), ["space"])
|
|
2329
|
-
],
|
|
2330
|
-
onFocus: (E) => g(k),
|
|
2331
|
-
onMousemove: (E) => d(k),
|
|
2332
|
-
id: k.value + "-" + b(l).selectId,
|
|
2333
|
-
title: k.title,
|
|
2334
|
-
"data-disabled": k.disabled ? k.disabled : "",
|
|
2335
|
-
tabindex: b(l).selectableItemIsActive(k) ? 0 : -1,
|
|
2336
|
-
class: D([{
|
|
2337
|
-
"bg-neutral-100 dark:bg-neutral-900/70 text-gray-900 dark:text-neutral-100": b(l).selectableItemIsActive(k),
|
|
2338
|
-
"text-gray-700 dark:text-neutral-300": !b(l).selectableItemIsActive(k)
|
|
2339
|
-
}, "focus:rounded-md relative flex items-center h-full py-2 pl-8 cursor-pointer data-[disabled=true]:opacity-50 data-[disabled=true]:pointer-events-none"]),
|
|
2340
|
-
role: "option",
|
|
2341
|
-
"aria-selected": b(l).selectableItemIsActive(k) ? "true" : "false"
|
|
2342
|
-
}, [
|
|
2343
|
-
//@ts-ignore
|
|
2344
|
-
b(l).selectedItem.value == k.value ? (m(), C("svg", ir, p[8] || (p[8] = [
|
|
2345
|
-
x("polyline", { points: "20 6 9 17 4 12" }, null, -1)
|
|
2346
|
-
]))) : R("", !0),
|
|
2347
|
-
x("span", ur, j(k.title), 1)
|
|
2348
|
-
], 42, lr))), 128))
|
|
2349
|
-
], 512)
|
|
2350
|
-
]),
|
|
2351
|
-
_: 1
|
|
2352
|
-
}, 8, ["class"])) : R("", !0)
|
|
2353
|
-
];
|
|
2354
|
-
}),
|
|
2355
|
-
_: 1
|
|
2356
|
-
})
|
|
2357
|
-
], 34));
|
|
2358
|
-
}
|
|
2359
|
-
}), dr = ["type", "disabled", "title"], fr = /* @__PURE__ */ K({
|
|
2360
|
-
__name: "ButtonIcon",
|
|
2361
|
-
props: {
|
|
2362
|
-
type: { default: "button" },
|
|
2363
|
-
disabled: { type: Boolean },
|
|
2364
|
-
title: {},
|
|
2365
|
-
variant: { default: "default" },
|
|
2366
|
-
to: {},
|
|
2367
|
-
target: { default: "_self" }
|
|
2368
|
-
},
|
|
2369
|
-
setup(n) {
|
|
2370
|
-
const e = n, t = J(() => {
|
|
2371
|
-
switch (e.variant) {
|
|
2372
|
-
case "ghost":
|
|
2373
|
-
return "";
|
|
2374
|
-
case "transparent":
|
|
2375
|
-
return [
|
|
2376
|
-
"transition",
|
|
2377
|
-
"hover:bg-white hover:dark:bg-primary-dark-800",
|
|
2378
|
-
"focus:outline-none hover:text-gray-900 dark:text-neutral-100",
|
|
2379
|
-
"hocus:ring-[0.125rem] hover:ring-violet-400 hover:dark:ring-violet-700 focus:ring-white",
|
|
2380
|
-
"aria-disabled:cursor-not-allowed aria-disabled:hover:ring-neutral-200 aria-disabled:hover:dark:ring-neutral-700 aria-disabled:ring-1 aria-disabled:opacity-60",
|
|
2381
|
-
"disabled:cursor-not-allowed disabled:hover:ring-neutral-200 disabled:hover:dark:ring-neutral-700 disabled:hover:ring-1 disabled:opacity-60"
|
|
2382
|
-
].join(" ");
|
|
2383
|
-
default:
|
|
2384
|
-
return [
|
|
2385
|
-
"h-10 max-h-full aspect-square rounded-md ",
|
|
2386
|
-
"p-2 shadow-sm",
|
|
2387
|
-
"focus:outline-none text-gray-900 dark:text-neutral-100",
|
|
2388
|
-
"ring-1 ring-neutral-200 dark:ring-neutral-700 hocus:ring-[0.125rem] focus:ring-purple-400 dark:focus:ring-purple-500 hover:ring-violet-400 hover:dark:ring-violet-700",
|
|
2389
|
-
"bg-white dark:bg-primary-dark-800",
|
|
2390
|
-
"aria-disabled:cursor-not-allowed aria-disabled:hover:ring-neutral-200 aria-disabled:hover:dark:ring-neutral-700 aria-disabled:ring-1 aria-disabled:opacity-60",
|
|
2391
|
-
"disabled:cursor-not-allowed disabled:hover:ring-neutral-200 disabled:hover:dark:ring-neutral-700 disabled:ring-1 disabled:opacity-60"
|
|
2392
|
-
].join(" ");
|
|
2393
|
-
}
|
|
2394
|
-
});
|
|
2395
|
-
return (a, r) => {
|
|
2396
|
-
const o = gt("router-link");
|
|
2397
|
-
return a.to ? (m(), Y(o, {
|
|
2398
|
-
key: 0,
|
|
2399
|
-
to: a.to,
|
|
2400
|
-
class: D(["flex items-center justify-center cursor-pointer", t.value]),
|
|
2401
|
-
type: e.type,
|
|
2402
|
-
title: e.title ?? "Button",
|
|
2403
|
-
"aria-disabled": a.disabled,
|
|
2404
|
-
target: a.target
|
|
2405
|
-
}, {
|
|
2406
|
-
default: B(() => [
|
|
2407
|
-
F(a.$slots, "text"),
|
|
2408
|
-
F(a.$slots, "icon")
|
|
2409
|
-
]),
|
|
2410
|
-
_: 3
|
|
2411
|
-
}, 8, ["to", "class", "type", "title", "aria-disabled", "target"])) : (m(), C("button", {
|
|
2412
|
-
key: 1,
|
|
2413
|
-
class: D(["flex items-center justify-center cursor-pointer", t.value]),
|
|
2414
|
-
type: e.type,
|
|
2415
|
-
disabled: e.disabled,
|
|
2416
|
-
title: e.title ?? "Icon"
|
|
2417
|
-
}, [
|
|
2418
|
-
F(a.$slots, "text"),
|
|
2419
|
-
F(a.$slots, "icon")
|
|
2420
|
-
], 10, dr));
|
|
2421
|
-
};
|
|
2422
|
-
}
|
|
2423
|
-
});
|
|
2424
|
-
function vr(n) {
|
|
2425
|
-
const e = w(1), t = w(n.itemsPerPage ?? 10), a = w(n.searchQuery ?? ""), r = be({
|
|
2426
|
-
filteredPage: J(() => {
|
|
2427
|
-
const o = t.value * (e.value - 1), s = Math.min(t.value * e.value, n.data.length);
|
|
2428
|
-
return n.data.slice(o, s);
|
|
2429
|
-
}),
|
|
2430
|
-
props: n,
|
|
2431
|
-
fields: { currentPage: e, itemsPerPage: t, searchQuery: a },
|
|
2432
|
-
handlePageChange(o) {
|
|
2433
|
-
e.value = o;
|
|
2434
|
-
},
|
|
2435
|
-
handlePageReset() {
|
|
2436
|
-
e.value = 1;
|
|
2437
|
-
}
|
|
2438
|
-
});
|
|
2439
|
-
return W(
|
|
2440
|
-
() => n.data,
|
|
2441
|
-
(o, s) => {
|
|
2442
|
-
var l, c;
|
|
2443
|
-
((o == null ? void 0 : o.length) !== (s == null ? void 0 : s.length) || o[0] && s[0] && ((l = o[0]) == null ? void 0 : l.id) !== ((c = s[0]) == null ? void 0 : c.id)) && r.handlePageReset();
|
|
2444
|
-
},
|
|
2445
|
-
{ immediate: !0 }
|
|
2446
|
-
), r;
|
|
2447
|
-
}
|
|
2448
|
-
const mr = { class: "flex flex-col gap-4 w-full" }, pr = {
|
|
2449
|
-
key: 0,
|
|
2450
|
-
class: "flex justify-center sm:justify-between flex-col sm:flex-row gap-2"
|
|
2451
|
-
}, gr = { class: "flex items-end gap-2 flex-wrap" }, br = { class: "flex gap-2 flex-col w-full sm:w-40 flex-1" }, hr = {
|
|
2452
|
-
key: 0,
|
|
2453
|
-
class: "col-span-full flex items-center justify-center text-center text-lg text-gray-500 dark:text-gray-400 uppercase tracking-wider w-full gap-2"
|
|
2454
|
-
}, Wr = /* @__PURE__ */ K({
|
|
2455
|
-
__name: "TableBase",
|
|
2456
|
-
props: /* @__PURE__ */ $e({
|
|
2457
|
-
useToolbar: { type: Boolean, default: !0 },
|
|
2458
|
-
usePagination: { type: Boolean, default: !0 },
|
|
2459
|
-
usePaginationIcons: { type: Boolean, default: !1 },
|
|
2460
|
-
useGrid: {},
|
|
2461
|
-
data: {},
|
|
2462
|
-
row: {},
|
|
2463
|
-
rowAttributes: {},
|
|
2464
|
-
loading: { type: Boolean },
|
|
2465
|
-
clickAction: {},
|
|
2466
|
-
otherAction: {},
|
|
2467
|
-
sortAction: {},
|
|
2468
|
-
sortingOptions: {},
|
|
2469
|
-
itemsPerPage: { default: 12 },
|
|
2470
|
-
itemName: {},
|
|
2471
|
-
searchQuery: { default: "" },
|
|
2472
|
-
selectedID: { default: null },
|
|
2473
|
-
tableStyles: {},
|
|
2474
|
-
startAscending: { type: Boolean, default: !0 },
|
|
2475
|
-
paginationClass: {},
|
|
2476
|
-
maxVisiblePages: { default: 5 },
|
|
2477
|
-
noResultsMessage: { default: "No Results" }
|
|
2478
|
-
}, {
|
|
2479
|
-
modelValue: {
|
|
2480
|
-
required: !1,
|
|
2481
|
-
default: void 0
|
|
2482
|
-
},
|
|
2483
|
-
modelModifiers: {}
|
|
2484
|
-
}),
|
|
2485
|
-
emits: /* @__PURE__ */ $e(["search"], ["update:modelValue"]),
|
|
2486
|
-
setup(n, { emit: e }) {
|
|
2487
|
-
const t = n, a = e, r = vr(t), o = w(t.startAscending), s = w(""), l = We(n, "modelValue"), c = (d) => {
|
|
2488
|
-
var g;
|
|
2489
|
-
d != null && d.value && (s.value = d.value), s.value && ((g = t.sortAction) == null || g.call(t, s.value, o.value ? 1 : -1));
|
|
2490
|
-
}, i = (d) => {
|
|
2491
|
-
const h = d.target.value;
|
|
2492
|
-
l.value !== void 0 ? l.value = h : r.fields.searchQuery = h, a("search", h);
|
|
2493
|
-
};
|
|
2494
|
-
return Ce(() => {
|
|
2495
|
-
t.useToolbar && t.sortAction && t.sortAction(s.value, t.startAscending ? 1 : -1);
|
|
2496
|
-
}), (d, g) => {
|
|
2497
|
-
var h;
|
|
2498
|
-
return m(), C("section", mr, [
|
|
2499
|
-
t.useToolbar ? (m(), C("section", pr, [
|
|
2500
|
-
M(ar, {
|
|
2501
|
-
value: l.value ?? b(r).fields.searchQuery,
|
|
2502
|
-
text: "",
|
|
2503
|
-
placeholder: `Search ${t.itemName ? `${t.itemName}...` : ""}`,
|
|
2504
|
-
id: "table-search",
|
|
2505
|
-
class: "w-full sm:w-80",
|
|
2506
|
-
title: "Search with...",
|
|
2507
|
-
onInput: i
|
|
2508
|
-
}, null, 8, ["value", "placeholder"]),
|
|
2509
|
-
x("span", gr, [
|
|
2510
|
-
x("div", br, [
|
|
2511
|
-
M(cr, {
|
|
2512
|
-
name: "sort",
|
|
2513
|
-
placeholder: "Sort by...",
|
|
2514
|
-
prefix: "By ",
|
|
2515
|
-
options: d.sortingOptions,
|
|
2516
|
-
defaultItem: 0,
|
|
2517
|
-
class: "w-full",
|
|
2518
|
-
title: "Sort by...",
|
|
2519
|
-
onSelectItem: c
|
|
2520
|
-
}, null, 8, ["options"])
|
|
2521
|
-
]),
|
|
2522
|
-
M(fr, {
|
|
2523
|
-
onClick: g[0] || (g[0] = (v) => {
|
|
2524
|
-
o.value = !o.value, c();
|
|
2525
|
-
}),
|
|
2526
|
-
title: "Reorder Results...",
|
|
2527
|
-
"aria-label": "Reorder Results",
|
|
2528
|
-
class: "ring-inset"
|
|
2529
|
-
}, {
|
|
2530
|
-
icon: B(() => [
|
|
2531
|
-
o.value ? (m(), Y(b(ha), {
|
|
2532
|
-
key: 0,
|
|
2533
|
-
width: "24",
|
|
2534
|
-
height: "24"
|
|
2535
|
-
})) : (m(), Y(b(xa), {
|
|
2536
|
-
key: 1,
|
|
2537
|
-
width: "24",
|
|
2538
|
-
height: "24"
|
|
2539
|
-
}))
|
|
2540
|
-
]),
|
|
2541
|
-
_: 1
|
|
2542
|
-
})
|
|
2543
|
-
])
|
|
2544
|
-
])) : R("", !0),
|
|
2545
|
-
x("section", {
|
|
2546
|
-
class: D([d.useGrid || `flex w-full flex-wrap gap-2 ${d.tableStyles ?? ""}`])
|
|
2547
|
-
}, [
|
|
2548
|
-
d.loading || b(r).filteredPage.length === 0 ? (m(), C("div", hr, [
|
|
2549
|
-
x("p", null, j(d.loading ? "...Loading" : d.noResultsMessage), 1),
|
|
2550
|
-
G(M(b($a), null, null, 512), [
|
|
2551
|
-
[Q, d.loading]
|
|
2552
|
-
])
|
|
2553
|
-
])) : (m(!0), C(X, { key: 1 }, ge(b(r).filteredPage, (v, p) => F(d.$slots, "row", {
|
|
2554
|
-
key: (v == null ? void 0 : v.id) ?? p,
|
|
2555
|
-
row: v,
|
|
2556
|
-
index: p,
|
|
2557
|
-
selectedID: t.selectedID
|
|
2558
|
-
}, () => [
|
|
2559
|
-
(m(), Y(De(t.row), yt({
|
|
2560
|
-
data: v,
|
|
2561
|
-
index: p,
|
|
2562
|
-
currentID: t.selectedID ?? null
|
|
2563
|
-
}, { ref_for: !0 }, d.rowAttributes, {
|
|
2564
|
-
onClickAction: (...T) => {
|
|
2565
|
-
var P;
|
|
2566
|
-
return (P = t.clickAction) == null ? void 0 : P.call(t, v == null ? void 0 : v.id, ...T);
|
|
2567
|
-
},
|
|
2568
|
-
onOtherAction: (...T) => {
|
|
2569
|
-
var P;
|
|
2570
|
-
return (P = t.otherAction) == null ? void 0 : P.call(t, v == null ? void 0 : v.id, ...T);
|
|
2571
|
-
}
|
|
2572
|
-
}), null, 16, ["data", "index", "currentID", "onClickAction", "onOtherAction"]))
|
|
2573
|
-
])), 128))
|
|
2574
|
-
], 2),
|
|
2575
|
-
d.usePagination ? (m(), Y(Jn, {
|
|
2576
|
-
key: 1,
|
|
2577
|
-
class: D(d.paginationClass),
|
|
2578
|
-
listLength: ((h = t.data) == null ? void 0 : h.length) ?? 0,
|
|
2579
|
-
itemsPerPage: b(r).fields.itemsPerPage,
|
|
2580
|
-
currentPage: b(r).fields.currentPage,
|
|
2581
|
-
useIcons: t.usePaginationIcons,
|
|
2582
|
-
"max-visible-pages": t.maxVisiblePages,
|
|
2583
|
-
onSetPage: b(r).handlePageChange
|
|
2584
|
-
}, null, 8, ["class", "listLength", "itemsPerPage", "currentPage", "useIcons", "max-visible-pages", "onSetPage"])) : R("", !0)
|
|
2585
|
-
]);
|
|
2586
|
-
};
|
|
2587
|
-
}
|
|
2588
|
-
});
|
|
2589
|
-
function qr({ options: n, defaultItems: e }, t) {
|
|
2590
|
-
const a = be({
|
|
1
|
+
var z = Object.defineProperty;
|
|
2
|
+
var W = (i, e, t) => e in i ? z(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
|
+
var p = (i, e, t) => W(i, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { reactive as S, watch as P, ref as u, computed as C, onMounted as J, nextTick as X, onBeforeUnmount as Q, shallowRef as G } from "vue";
|
|
5
|
+
function ue({ options: i, defaultItems: e }, t) {
|
|
6
|
+
const l = S({
|
|
2591
7
|
selectOpen: !1,
|
|
2592
8
|
selectedItems: e,
|
|
2593
|
-
selectableItems:
|
|
9
|
+
selectableItems: i,
|
|
2594
10
|
selectableItemActive: null,
|
|
2595
11
|
selectId: "select-12",
|
|
2596
12
|
selectKeydownValue: "",
|
|
@@ -2599,219 +15,354 @@ function qr({ options: n, defaultItems: e }, t) {
|
|
|
2599
15
|
selectDropdownPosition: "bottom",
|
|
2600
16
|
selectableItemsList: t.selectableItemsList,
|
|
2601
17
|
selectButton: t.selectButton,
|
|
2602
|
-
toggleSelect(
|
|
2603
|
-
|
|
18
|
+
toggleSelect(s) {
|
|
19
|
+
s !== void 0 ? this.selectOpen = s === !0 : this.selectOpen = !this.selectOpen;
|
|
2604
20
|
},
|
|
2605
|
-
updateRefs(
|
|
2606
|
-
this.selectButton =
|
|
21
|
+
updateRefs(s) {
|
|
22
|
+
this.selectButton = s.selectButton, this.selectableItemsList = s.selectableItemsList, this.selectPositionUpdate();
|
|
2607
23
|
},
|
|
2608
24
|
// In a multiselect (combobox) nothing is ever selected in the list. It appears elsewhere and is removed from the list
|
|
2609
25
|
selectableItemIsActive() {
|
|
2610
26
|
return !1;
|
|
2611
27
|
},
|
|
2612
|
-
async selectScrollToActiveItem(
|
|
2613
|
-
let
|
|
2614
|
-
|
|
28
|
+
async selectScrollToActiveItem(s, a = !0) {
|
|
29
|
+
let o = document.getElementById(s + "-" + this.selectId);
|
|
30
|
+
o && (o.scrollIntoView({ behavior: "smooth", block: "center" }), a && o.focus({ preventScroll: !1 }));
|
|
2615
31
|
},
|
|
2616
|
-
selectKeydown(
|
|
2617
|
-
if (
|
|
2618
|
-
this.selectKeydownValue +=
|
|
2619
|
-
let
|
|
2620
|
-
|
|
32
|
+
selectKeydown(s) {
|
|
33
|
+
if (s.keyCode < 65 || s.keyCode > 90) return;
|
|
34
|
+
this.selectKeydownValue += s.key;
|
|
35
|
+
let a = this.selectItemsFindBestMatch();
|
|
36
|
+
a && this.selectOpen && (this.selectableItemActive = a), this.selectKeydownValue !== "" && (clearTimeout(this.selectKeydownClearTimeout), this.selectKeydownClearTimeout = window.setTimeout(() => {
|
|
2621
37
|
this.selectKeydownValue = "";
|
|
2622
38
|
}, this.selectKeydownTimeout));
|
|
2623
39
|
},
|
|
2624
40
|
selectItemsFindBestMatch() {
|
|
2625
|
-
let
|
|
2626
|
-
for (const
|
|
2627
|
-
let
|
|
2628
|
-
|
|
41
|
+
let s = this.selectKeydownValue.toLowerCase(), a = null, o = -1;
|
|
42
|
+
for (const r of this.selectableItems) {
|
|
43
|
+
let h = r.name.toLowerCase().indexOf(s);
|
|
44
|
+
h > -1 && (o == -1 || h < o) && !r.disabled && (a = r, o = h);
|
|
2629
45
|
}
|
|
2630
|
-
return
|
|
46
|
+
return a;
|
|
2631
47
|
},
|
|
2632
48
|
selectPositionUpdate() {
|
|
2633
|
-
var
|
|
49
|
+
var a;
|
|
2634
50
|
if (!this.selectButton || !this.selectableItemsList) return;
|
|
2635
|
-
let
|
|
2636
|
-
this.selectDropdownPosition = window.innerHeight <
|
|
51
|
+
let s = ((a = this.selectButton) == null ? void 0 : a.getBoundingClientRect().top) + this.selectButton.offsetHeight + parseInt(window.getComputedStyle(this.selectableItemsList).maxHeight);
|
|
52
|
+
this.selectDropdownPosition = window.innerHeight < s ? "top" : "bottom";
|
|
2637
53
|
},
|
|
2638
|
-
setOptions(
|
|
2639
|
-
Array.isArray(
|
|
54
|
+
setOptions(s) {
|
|
55
|
+
Array.isArray(s) && (this.selectableItems = s);
|
|
2640
56
|
}
|
|
2641
|
-
}),
|
|
2642
|
-
|
|
57
|
+
}), n = () => {
|
|
58
|
+
l.selectOpen && l.selectPositionUpdate();
|
|
2643
59
|
};
|
|
2644
|
-
return
|
|
2645
|
-
() =>
|
|
2646
|
-
function(
|
|
2647
|
-
if (
|
|
2648
|
-
window.removeEventListener("resize",
|
|
60
|
+
return P(
|
|
61
|
+
() => l.selectOpen,
|
|
62
|
+
function(s) {
|
|
63
|
+
if (l.selectedItems ? l.selectableItemActive = l.selectedItem : l.selectableItemActive = l.selectableItems[0], !s) {
|
|
64
|
+
window.removeEventListener("resize", n);
|
|
2649
65
|
return;
|
|
2650
66
|
}
|
|
2651
|
-
|
|
67
|
+
n(), window.addEventListener("resize", n);
|
|
2652
68
|
},
|
|
2653
69
|
{ immediate: !1 }
|
|
2654
|
-
),
|
|
2655
|
-
}
|
|
2656
|
-
function
|
|
2657
|
-
var
|
|
2658
|
-
const
|
|
2659
|
-
let
|
|
2660
|
-
return
|
|
2661
|
-
}),
|
|
2662
|
-
const
|
|
2663
|
-
return Array.from({ length: 10 }, (
|
|
70
|
+
), l;
|
|
71
|
+
}
|
|
72
|
+
function fe(i, e, t) {
|
|
73
|
+
var L;
|
|
74
|
+
const l = u(!1), n = u(((L = i.model) == null ? void 0 : L.value) ?? i.defaultDate ?? ""), s = u("F d, Y"), a = u(0), o = u(0), r = u(0), f = u([]), h = u([]), d = u("bottom"), m = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], g = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], v = u("D"), I = C(() => {
|
|
75
|
+
let c = Math.max(a.value, 0);
|
|
76
|
+
return c >= m.length && (c = 0), m[c];
|
|
77
|
+
}), _ = C(() => {
|
|
78
|
+
const c = Math.floor(o.value / 10) * 10;
|
|
79
|
+
return Array.from({ length: 10 }, (b, w) => c + w);
|
|
2664
80
|
});
|
|
2665
|
-
function
|
|
2666
|
-
|
|
81
|
+
function K(c) {
|
|
82
|
+
l.value = c ?? !l.value, v.value = "D";
|
|
2667
83
|
}
|
|
2668
|
-
function
|
|
2669
|
-
|
|
84
|
+
function V(c = "D") {
|
|
85
|
+
v.value = c;
|
|
2670
86
|
}
|
|
2671
|
-
function
|
|
2672
|
-
const
|
|
2673
|
-
switch (
|
|
87
|
+
function E(c) {
|
|
88
|
+
const b = g[c.getDay()], w = ("0" + c.getDate()).slice(-2), T = m[c.getMonth()], M = T.substring(0, 3), B = ("0" + (c.getMonth() + 1)).slice(-2), y = c.getFullYear();
|
|
89
|
+
switch (s.value) {
|
|
2674
90
|
case "F d, Y":
|
|
2675
|
-
return `${
|
|
91
|
+
return `${T} ${w}, ${y}`;
|
|
2676
92
|
case "d M, Y":
|
|
2677
|
-
return `${
|
|
93
|
+
return `${w} ${M}, ${y}`;
|
|
2678
94
|
case "Y M d":
|
|
2679
|
-
return `${
|
|
95
|
+
return `${y} ${M} ${w}`;
|
|
2680
96
|
case "MM-DD-YYYY":
|
|
2681
|
-
return `${
|
|
97
|
+
return `${B}-${w}-${y}`;
|
|
2682
98
|
case "DD-MM-YYYY":
|
|
2683
|
-
return `${
|
|
99
|
+
return `${w}-${B}-${y}`;
|
|
2684
100
|
case "YYYY-MM-DD":
|
|
2685
|
-
return `${
|
|
101
|
+
return `${y}-${B}-${w}`;
|
|
2686
102
|
case "D d M, Y":
|
|
2687
|
-
return `${
|
|
103
|
+
return `${b} ${w} ${M} ${y}`;
|
|
2688
104
|
default:
|
|
2689
|
-
return `${
|
|
105
|
+
return `${T} ${w}, ${y}`;
|
|
2690
106
|
}
|
|
2691
107
|
}
|
|
2692
|
-
function
|
|
2693
|
-
switch (
|
|
108
|
+
function j(c) {
|
|
109
|
+
switch (v.value) {
|
|
2694
110
|
case "Y":
|
|
2695
|
-
|
|
111
|
+
o.value = c, v.value = "M";
|
|
2696
112
|
break;
|
|
2697
113
|
case "M":
|
|
2698
|
-
|
|
114
|
+
a.value = c, v.value = "D", O();
|
|
2699
115
|
break;
|
|
2700
116
|
default:
|
|
2701
|
-
|
|
117
|
+
r.value = c, n.value = E(new Date(o.value, a.value, c)), l.value = !1, i.model && (i.model.value = n.value);
|
|
2702
118
|
break;
|
|
2703
119
|
}
|
|
2704
120
|
}
|
|
2705
|
-
function
|
|
2706
|
-
switch (
|
|
121
|
+
function R() {
|
|
122
|
+
switch (v.value) {
|
|
2707
123
|
case "Y":
|
|
2708
|
-
|
|
124
|
+
o.value -= 10;
|
|
2709
125
|
break;
|
|
2710
126
|
case "M":
|
|
2711
|
-
|
|
127
|
+
o.value -= 1;
|
|
2712
128
|
break;
|
|
2713
129
|
default:
|
|
2714
|
-
|
|
130
|
+
a.value === 0 ? (o.value--, a.value = 11) : a.value--, O();
|
|
2715
131
|
break;
|
|
2716
132
|
}
|
|
2717
133
|
}
|
|
2718
|
-
function
|
|
2719
|
-
switch (
|
|
134
|
+
function H() {
|
|
135
|
+
switch (v.value) {
|
|
2720
136
|
case "Y":
|
|
2721
|
-
|
|
137
|
+
o.value += 10;
|
|
2722
138
|
break;
|
|
2723
139
|
case "M":
|
|
2724
|
-
|
|
140
|
+
o.value += 1;
|
|
2725
141
|
break;
|
|
2726
142
|
default:
|
|
2727
|
-
|
|
143
|
+
a.value === 11 ? (a.value = 0, o.value++) : a.value++, O();
|
|
2728
144
|
break;
|
|
2729
145
|
}
|
|
2730
146
|
}
|
|
2731
|
-
function
|
|
2732
|
-
const
|
|
2733
|
-
return
|
|
147
|
+
function U(c) {
|
|
148
|
+
const b = new Date(o.value, a.value, c);
|
|
149
|
+
return n.value === E(b);
|
|
2734
150
|
}
|
|
2735
|
-
function
|
|
2736
|
-
const
|
|
2737
|
-
return
|
|
151
|
+
function q(c) {
|
|
152
|
+
const b = /* @__PURE__ */ new Date(), w = new Date(o.value, a.value, c);
|
|
153
|
+
return b.toDateString() === w.toDateString();
|
|
2738
154
|
}
|
|
2739
|
-
function
|
|
2740
|
-
const
|
|
2741
|
-
|
|
155
|
+
function O() {
|
|
156
|
+
const c = new Date(o.value, a.value + 1, 0).getDate(), b = new Date(o.value, a.value).getDay();
|
|
157
|
+
h.value = Array.from({ length: b }, (w, T) => T + 1), f.value = Array.from({ length: c }, (w, T) => T + 1);
|
|
2742
158
|
}
|
|
2743
|
-
function
|
|
2744
|
-
if (!e.value || !t.value || !
|
|
2745
|
-
const
|
|
2746
|
-
|
|
159
|
+
function A() {
|
|
160
|
+
if (!e.value || !t.value || !l.value) return;
|
|
161
|
+
const c = e.value.getBoundingClientRect(), b = t.value.offsetHeight, w = c.top + c.height + b;
|
|
162
|
+
d.value = w > window.innerHeight ? "top" : "bottom";
|
|
2747
163
|
}
|
|
2748
|
-
function
|
|
2749
|
-
|
|
164
|
+
function k(c, b = !0) {
|
|
165
|
+
a.value = c.getMonth(), o.value = c.getFullYear(), r.value = c.getDate(), b && (n.value = E(c)), O();
|
|
2750
166
|
}
|
|
2751
|
-
function
|
|
2752
|
-
if (
|
|
2753
|
-
return
|
|
2754
|
-
|
|
167
|
+
function F() {
|
|
168
|
+
if (n.value)
|
|
169
|
+
return k(new Date(Date.parse(n.value)));
|
|
170
|
+
k(/* @__PURE__ */ new Date(), i.useDefaultDate);
|
|
2755
171
|
}
|
|
2756
|
-
return
|
|
2757
|
-
|
|
2758
|
-
}),
|
|
2759
|
-
if (!
|
|
2760
|
-
window.removeEventListener("resize",
|
|
172
|
+
return J(() => {
|
|
173
|
+
F();
|
|
174
|
+
}), P(l, async (c) => {
|
|
175
|
+
if (!c) {
|
|
176
|
+
window.removeEventListener("resize", A);
|
|
2761
177
|
return;
|
|
2762
178
|
}
|
|
2763
|
-
await
|
|
179
|
+
await X(), F(), A(), window.addEventListener("resize", A);
|
|
2764
180
|
}), {
|
|
2765
181
|
datePickerInput: e,
|
|
2766
182
|
datePickerCalendar: t,
|
|
2767
|
-
datePickerOpen:
|
|
2768
|
-
datePickerValue:
|
|
2769
|
-
datePickerPanel:
|
|
2770
|
-
datePickerFormat:
|
|
2771
|
-
datePickerMonth:
|
|
2772
|
-
datePickerMonthVerbose:
|
|
2773
|
-
datePickerYear:
|
|
2774
|
-
datePickerDecade:
|
|
2775
|
-
datePickerDay:
|
|
2776
|
-
datePickerDaysInMonth:
|
|
2777
|
-
datePickerBlankDaysInMonth:
|
|
2778
|
-
datePickerMonthNames:
|
|
2779
|
-
datePickerDays:
|
|
2780
|
-
datePickerPosition:
|
|
2781
|
-
toggleDatePicker:
|
|
2782
|
-
datePickerValueClicked:
|
|
2783
|
-
datePickerPrevious:
|
|
2784
|
-
datePickerNext:
|
|
2785
|
-
datePickerIsSelectedDate:
|
|
2786
|
-
datePickerIsToday:
|
|
2787
|
-
showDatePickerPanel:
|
|
183
|
+
datePickerOpen: l,
|
|
184
|
+
datePickerValue: n,
|
|
185
|
+
datePickerPanel: v,
|
|
186
|
+
datePickerFormat: s,
|
|
187
|
+
datePickerMonth: a,
|
|
188
|
+
datePickerMonthVerbose: I,
|
|
189
|
+
datePickerYear: o,
|
|
190
|
+
datePickerDecade: _,
|
|
191
|
+
datePickerDay: r,
|
|
192
|
+
datePickerDaysInMonth: f,
|
|
193
|
+
datePickerBlankDaysInMonth: h,
|
|
194
|
+
datePickerMonthNames: m,
|
|
195
|
+
datePickerDays: g,
|
|
196
|
+
datePickerPosition: d,
|
|
197
|
+
toggleDatePicker: K,
|
|
198
|
+
datePickerValueClicked: j,
|
|
199
|
+
datePickerPrevious: R,
|
|
200
|
+
datePickerNext: H,
|
|
201
|
+
datePickerIsSelectedDate: U,
|
|
202
|
+
datePickerIsToday: q,
|
|
203
|
+
showDatePickerPanel: V
|
|
2788
204
|
};
|
|
2789
205
|
}
|
|
2790
|
-
function
|
|
2791
|
-
|
|
206
|
+
function $(i = "pv_id_") {
|
|
207
|
+
return i + Math.random().toString(16).slice(2);
|
|
208
|
+
}
|
|
209
|
+
class Z {
|
|
210
|
+
constructor() {
|
|
211
|
+
p(this, "subscribers");
|
|
212
|
+
p(this, "toasts");
|
|
213
|
+
// We use arrow functions to maintain the correct `this` reference
|
|
214
|
+
p(this, "subscribe", (e) => (this.subscribers.push(e), () => {
|
|
215
|
+
const t = this.subscribers.indexOf(e);
|
|
216
|
+
this.subscribers.splice(t, 1);
|
|
217
|
+
}));
|
|
218
|
+
p(this, "publish", (e) => {
|
|
219
|
+
this.subscribers.forEach((t) => t(e));
|
|
220
|
+
});
|
|
221
|
+
p(this, "addToast", (e) => {
|
|
222
|
+
this.publish(e), this.toasts = [...this.toasts, e];
|
|
223
|
+
});
|
|
224
|
+
p(this, "create", (e, t) => {
|
|
225
|
+
const l = t.id ?? $("toast_");
|
|
226
|
+
return this.toasts.find((s) => s.id === l) ? this.toasts = this.toasts.map((s) => s.id === l ? (this.publish({ ...s, ...t, id: l, title: e }), {
|
|
227
|
+
...s,
|
|
228
|
+
...t,
|
|
229
|
+
id: l,
|
|
230
|
+
title: e
|
|
231
|
+
}) : s) : this.addToast({
|
|
232
|
+
title: e,
|
|
233
|
+
id: l,
|
|
234
|
+
scale: 1,
|
|
235
|
+
zIndex: 200,
|
|
236
|
+
offsetY: 0,
|
|
237
|
+
...t
|
|
238
|
+
}), l;
|
|
239
|
+
});
|
|
240
|
+
p(this, "dismiss", (e) => {
|
|
241
|
+
e ? (this.publish({ id: e, dismiss: !0 }), this.toasts = this.toasts.filter((t) => t.id !== e)) : (this.toasts.forEach((t) => {
|
|
242
|
+
this.publish({ id: t.id, dismiss: !0 });
|
|
243
|
+
}), this.toasts = []);
|
|
244
|
+
});
|
|
245
|
+
p(this, "add", (e, t) => this.create(e, { ...t }));
|
|
246
|
+
p(this, "success", (e, t) => this.create(e, { type: "success", ...t }));
|
|
247
|
+
p(this, "error", (e, t) => this.create(e, { type: "danger", ...t }));
|
|
248
|
+
p(this, "info", (e, t) => this.create(e, { type: "info", ...t }));
|
|
249
|
+
p(this, "warning", (e, t) => this.create(e, { type: "warning", ...t }));
|
|
250
|
+
this.subscribers = [], this.toasts = [];
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
const D = new Z();
|
|
254
|
+
function ee(i, e) {
|
|
255
|
+
const t = $("toast_");
|
|
256
|
+
return D.create(i, { ...e, id: t }), t;
|
|
257
|
+
}
|
|
258
|
+
const te = Object.assign(ee, {
|
|
259
|
+
add: D.add,
|
|
260
|
+
success: D.success,
|
|
261
|
+
error: D.error,
|
|
262
|
+
info: D.info,
|
|
263
|
+
warning: D.warning,
|
|
264
|
+
dismiss: D.dismiss
|
|
265
|
+
});
|
|
266
|
+
function de(i) {
|
|
267
|
+
const e = u(!1);
|
|
2792
268
|
return {
|
|
2793
269
|
copyNotification: e,
|
|
2794
270
|
copyToClipboard: async () => {
|
|
2795
271
|
try {
|
|
2796
|
-
await navigator.clipboard.writeText(
|
|
272
|
+
await navigator.clipboard.writeText(i.value), e.value = !0, setTimeout(() => {
|
|
2797
273
|
e.value = !1;
|
|
2798
274
|
}, 3e3);
|
|
2799
|
-
} catch (
|
|
2800
|
-
console.error(
|
|
275
|
+
} catch (l) {
|
|
276
|
+
console.error(l), te.error("Error", {
|
|
2801
277
|
description: "Unable to copy. Network is not secure."
|
|
2802
278
|
});
|
|
2803
279
|
}
|
|
2804
280
|
}
|
|
2805
281
|
};
|
|
2806
282
|
}
|
|
2807
|
-
function
|
|
2808
|
-
const
|
|
2809
|
-
|
|
283
|
+
function me(i, e) {
|
|
284
|
+
const t = S({
|
|
285
|
+
selectOpen: !1,
|
|
286
|
+
selectedItem: "",
|
|
287
|
+
selectableItems: i,
|
|
288
|
+
selectableItemActive: null,
|
|
289
|
+
selectId: "select-12",
|
|
290
|
+
selectKeydownValue: "",
|
|
291
|
+
selectKeydownTimeout: 1e3,
|
|
292
|
+
selectKeydownClearTimeout: null,
|
|
293
|
+
selectDropdownPosition: "bottom",
|
|
294
|
+
selectableItemsList: e.selectableItemsList,
|
|
295
|
+
selectButton: e.selectButton,
|
|
296
|
+
toggleSelect(n) {
|
|
297
|
+
n !== void 0 ? this.selectOpen = n === !0 : this.selectOpen = !this.selectOpen;
|
|
298
|
+
},
|
|
299
|
+
updateRefs(n) {
|
|
300
|
+
this.selectButton = n.selectButton, this.selectableItemsList = n.selectableItemsList;
|
|
301
|
+
},
|
|
302
|
+
selectableItemIsActive(n) {
|
|
303
|
+
return this.selectableItemActive && this.selectableItemActive.value == n.value;
|
|
304
|
+
},
|
|
305
|
+
selectableItemActiveNext() {
|
|
306
|
+
let n = this.selectableItems.indexOf(this.selectableItemActive);
|
|
307
|
+
n < this.selectableItems.length - 1 && (this.selectableItemActive = this.selectableItems[n + 1], this.selectScrollToActiveItem());
|
|
308
|
+
},
|
|
309
|
+
selectableItemActivePrevious() {
|
|
310
|
+
let n = this.selectableItems.indexOf(this.selectableItemActive);
|
|
311
|
+
n > 0 && (this.selectableItemActive = this.selectableItems[n - 1], this.selectScrollToActiveItem());
|
|
312
|
+
},
|
|
313
|
+
selectScrollToActiveItem() {
|
|
314
|
+
if (!this.selectableItemActive) return;
|
|
315
|
+
let n = document.getElementById(this.selectableItemActive.value + "-" + this.selectId);
|
|
316
|
+
n && n.focus();
|
|
317
|
+
},
|
|
318
|
+
selectKeydown(n) {
|
|
319
|
+
if (n.keyCode >= 65 && n.keyCode <= 90) {
|
|
320
|
+
this.selectKeydownValue += n.key;
|
|
321
|
+
let s = this.selectItemsFindBestMatch();
|
|
322
|
+
s && (this.selectOpen ? (this.selectableItemActive = s, this.selectScrollToActiveItem()) : this.selectedItem = this.selectableItemActive === s), this.selectKeydownValue != "" && (clearTimeout(this.selectKeydownClearTimeout), this.selectKeydownClearTimeout = window.setTimeout(() => {
|
|
323
|
+
this.selectKeydownValue = "";
|
|
324
|
+
}, this.selectKeydownTimeout));
|
|
325
|
+
}
|
|
326
|
+
},
|
|
327
|
+
selectItemsFindBestMatch() {
|
|
328
|
+
let n = this.selectKeydownValue.toLowerCase(), s = null, a = -1;
|
|
329
|
+
for (const o of this.selectableItems) {
|
|
330
|
+
let f = o.title.toLowerCase().indexOf(n);
|
|
331
|
+
f > -1 && (a == -1 || f < a) && !o.disabled && (s = o, a = f);
|
|
332
|
+
}
|
|
333
|
+
return s;
|
|
334
|
+
},
|
|
335
|
+
selectPositionUpdate() {
|
|
336
|
+
var s;
|
|
337
|
+
if (!this.selectableItemsList || !this.selectButton) return;
|
|
338
|
+
let n = ((s = this.selectButton) == null ? void 0 : s.getBoundingClientRect().top) + this.selectButton.offsetHeight + parseInt(window.getComputedStyle(this.selectableItemsList).maxHeight);
|
|
339
|
+
window.innerHeight < n ? this.selectDropdownPosition = "top" : this.selectDropdownPosition = "bottom";
|
|
340
|
+
}
|
|
341
|
+
}), l = () => {
|
|
342
|
+
t.selectOpen && t.selectPositionUpdate();
|
|
343
|
+
};
|
|
344
|
+
return P(
|
|
345
|
+
() => t.selectOpen,
|
|
346
|
+
function(n) {
|
|
347
|
+
if (t.selectedItem ? t.selectableItemActive = t.selectedItem : t.selectableItemActive = t.selectableItems[0], !n) {
|
|
348
|
+
window.removeEventListener("resize", l);
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
351
|
+
window.setTimeout(function() {
|
|
352
|
+
t.selectScrollToActiveItem();
|
|
353
|
+
}, 10), l(), window.addEventListener("resize", l);
|
|
354
|
+
},
|
|
355
|
+
{ immediate: !1 }
|
|
356
|
+
), t;
|
|
357
|
+
}
|
|
358
|
+
function he(i) {
|
|
359
|
+
const e = u(null);
|
|
360
|
+
return S({
|
|
2810
361
|
title: "",
|
|
2811
|
-
...
|
|
362
|
+
...i,
|
|
2812
363
|
modalOpen: !1,
|
|
2813
364
|
isAnimating: !1,
|
|
2814
|
-
animationTime:
|
|
365
|
+
animationTime: i.animationTime ?? 300,
|
|
2815
366
|
toggleModal(t = null) {
|
|
2816
367
|
this.isAnimating || (e.value && clearTimeout(e.value), t != null ? this.modalOpen = t : this.modalOpen = !this.modalOpen, this.isAnimating = !0, e.value = window.setTimeout(() => {
|
|
2817
368
|
this.isAnimating = !1;
|
|
@@ -2822,518 +373,274 @@ function Xr(n) {
|
|
|
2822
373
|
}
|
|
2823
374
|
});
|
|
2824
375
|
}
|
|
2825
|
-
function
|
|
2826
|
-
const
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
376
|
+
function ve(i) {
|
|
377
|
+
const e = u(1), t = u(i.itemsPerPage ?? 10), l = u(i.searchQuery ?? ""), n = S({
|
|
378
|
+
filteredPage: C(() => {
|
|
379
|
+
const s = t.value * (e.value - 1), a = Math.min(t.value * e.value, i.data.length);
|
|
380
|
+
return i.data.slice(s, a);
|
|
381
|
+
}),
|
|
382
|
+
props: i,
|
|
383
|
+
fields: { currentPage: e, itemsPerPage: t, searchQuery: l },
|
|
384
|
+
handlePageChange(s) {
|
|
385
|
+
e.value = s;
|
|
386
|
+
},
|
|
387
|
+
handlePageReset() {
|
|
388
|
+
e.value = 1;
|
|
389
|
+
}
|
|
390
|
+
});
|
|
391
|
+
return P(
|
|
392
|
+
() => i.data,
|
|
393
|
+
(s, a) => {
|
|
394
|
+
var o, r;
|
|
395
|
+
((s == null ? void 0 : s.length) !== (a == null ? void 0 : a.length) || s[0] && a[0] && ((o = s[0]) == null ? void 0 : o.id) !== ((r = a[0]) == null ? void 0 : r.id)) && n.handlePageReset();
|
|
396
|
+
},
|
|
397
|
+
{ immediate: !0 }
|
|
398
|
+
), n;
|
|
399
|
+
}
|
|
400
|
+
function se(i) {
|
|
401
|
+
return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
|
|
402
|
+
}
|
|
403
|
+
var x, Y;
|
|
404
|
+
function ne() {
|
|
405
|
+
return Y || (Y = 1, x = function i(e, t) {
|
|
406
|
+
if (e === t) return !0;
|
|
407
|
+
if (e && t && typeof e == "object" && typeof t == "object") {
|
|
408
|
+
if (e.constructor !== t.constructor) return !1;
|
|
409
|
+
var l, n, s;
|
|
410
|
+
if (Array.isArray(e)) {
|
|
411
|
+
if (l = e.length, l != t.length) return !1;
|
|
412
|
+
for (n = l; n-- !== 0; )
|
|
413
|
+
if (!i(e[n], t[n])) return !1;
|
|
414
|
+
return !0;
|
|
415
|
+
}
|
|
416
|
+
if (e.constructor === RegExp) return e.source === t.source && e.flags === t.flags;
|
|
417
|
+
if (e.valueOf !== Object.prototype.valueOf) return e.valueOf() === t.valueOf();
|
|
418
|
+
if (e.toString !== Object.prototype.toString) return e.toString() === t.toString();
|
|
419
|
+
if (s = Object.keys(e), l = s.length, l !== Object.keys(t).length) return !1;
|
|
420
|
+
for (n = l; n-- !== 0; )
|
|
421
|
+
if (!Object.prototype.hasOwnProperty.call(t, s[n])) return !1;
|
|
422
|
+
for (n = l; n-- !== 0; ) {
|
|
423
|
+
var a = s[n];
|
|
424
|
+
if (!i(e[a], t[a])) return !1;
|
|
425
|
+
}
|
|
426
|
+
return !0;
|
|
427
|
+
}
|
|
428
|
+
return e !== e && t !== t;
|
|
429
|
+
}), x;
|
|
430
|
+
}
|
|
431
|
+
var ie = ne();
|
|
432
|
+
const ae = /* @__PURE__ */ se(ie);
|
|
433
|
+
function we(i) {
|
|
434
|
+
let e = i, t;
|
|
435
|
+
const l = S({
|
|
436
|
+
fields: structuredClone(i),
|
|
437
|
+
errors: {},
|
|
438
|
+
dirty: !1,
|
|
439
|
+
hasErrors: !1,
|
|
440
|
+
processing: !1,
|
|
441
|
+
wasSuccessful: !1,
|
|
442
|
+
recentlySuccessful: !1,
|
|
443
|
+
async submit(n, s = {}) {
|
|
444
|
+
if (this.processing) return;
|
|
445
|
+
const a = {
|
|
446
|
+
onBefore: async () => {
|
|
447
|
+
this.processing = !0, this.wasSuccessful = !1, this.recentlySuccessful = !1, clearTimeout(t), s.onBefore && await s.onBefore();
|
|
448
|
+
},
|
|
449
|
+
onSuccess: async (o) => {
|
|
450
|
+
this.clearErrors(), this.wasSuccessful = !0, this.recentlySuccessful = !0, t = window.setTimeout(() => {
|
|
451
|
+
this.recentlySuccessful = !1;
|
|
452
|
+
}, 2e3), s.onSuccess && await s.onSuccess(o), e = structuredClone(this.fields);
|
|
453
|
+
},
|
|
454
|
+
onError: async (o) => {
|
|
455
|
+
var r, f, h, d, m;
|
|
456
|
+
this.hasErrors = !0, (((r = o == null ? void 0 : o.response) == null ? void 0 : r.status) === 422 || ((f = o == null ? void 0 : o.response) == null ? void 0 : f.status) === 401) && (this.clearErrors(), this.setErrors({
|
|
457
|
+
message: (h = o == null ? void 0 : o.response) == null ? void 0 : h.data.message,
|
|
458
|
+
...(m = (d = o == null ? void 0 : o.response) == null ? void 0 : d.data) == null ? void 0 : m.errors
|
|
459
|
+
})), s.onError && await s.onError(o);
|
|
460
|
+
},
|
|
461
|
+
onFinish: async () => {
|
|
462
|
+
this.processing = !1, s.onFinish && await s.onFinish();
|
|
463
|
+
}
|
|
464
|
+
};
|
|
465
|
+
await a.onBefore();
|
|
466
|
+
try {
|
|
467
|
+
const o = await n(this.fields);
|
|
468
|
+
await a.onSuccess(o);
|
|
469
|
+
} catch (o) {
|
|
470
|
+
await a.onError(o);
|
|
471
|
+
} finally {
|
|
472
|
+
await a.onFinish();
|
|
473
|
+
}
|
|
474
|
+
},
|
|
475
|
+
reset(...n) {
|
|
476
|
+
const s = structuredClone(e);
|
|
477
|
+
n.length === 0 ? this.fields = s : n.forEach((a) => {
|
|
478
|
+
s[a] !== void 0 && (this.fields[a] = s[a]);
|
|
479
|
+
});
|
|
480
|
+
},
|
|
481
|
+
clearErrors(...n) {
|
|
482
|
+
n.length === 0 ? this.errors = {} : n.forEach((s) => delete this.errors[s]), this.hasErrors = Object.keys(this.errors).length > 0;
|
|
483
|
+
},
|
|
484
|
+
setErrors(n) {
|
|
485
|
+
this.errors = { ...this.errors, ...n }, this.hasErrors = Object.keys(this.errors).length > 0;
|
|
486
|
+
}
|
|
487
|
+
});
|
|
488
|
+
return P(
|
|
489
|
+
() => l.fields,
|
|
490
|
+
() => {
|
|
491
|
+
l.dirty = !ae(l.fields, e);
|
|
492
|
+
},
|
|
493
|
+
{ immediate: !0, deep: !0 }
|
|
494
|
+
), l;
|
|
495
|
+
}
|
|
496
|
+
function pe({ directions: i, threshold: e, onSwipeOut: t }) {
|
|
497
|
+
const l = u(!1), n = u({ x: 0, y: 0 }), s = u(), a = u({ x: 0, y: 0 }), o = (d) => 1 / (1.5 + Math.abs(d) / 20);
|
|
498
|
+
function r(d) {
|
|
499
|
+
s.value = Date.now(), d.target.setPointerCapture(d.pointerId), !d.target.closest("button, a, input, textarea, select") && (a.value = { x: d.clientX, y: d.clientY }, l.value = !0);
|
|
500
|
+
}
|
|
501
|
+
function f(d) {
|
|
502
|
+
if (!l.value) return;
|
|
503
|
+
const m = { x: 0, y: 0 }, g = d.clientX - a.value.x, v = d.clientY - a.value.y;
|
|
504
|
+
if (i.value.includes("left") && g < 0 || i.value.includes("right") && g > 0)
|
|
505
|
+
m.x = g;
|
|
2835
506
|
else {
|
|
2836
|
-
const
|
|
2837
|
-
|
|
507
|
+
const I = g * o(g);
|
|
508
|
+
m.x = Math.abs(I) < Math.abs(g) ? I : g;
|
|
2838
509
|
}
|
|
2839
|
-
if (
|
|
2840
|
-
|
|
510
|
+
if (i.value.includes("top") && v < 0 || i.value.includes("bottom") && v > 0)
|
|
511
|
+
m.y = v;
|
|
2841
512
|
else {
|
|
2842
|
-
const
|
|
2843
|
-
|
|
513
|
+
const I = v * o(v);
|
|
514
|
+
m.y = Math.abs(I) < Math.abs(v) ? I : v;
|
|
2844
515
|
}
|
|
2845
|
-
|
|
516
|
+
n.value = m;
|
|
2846
517
|
}
|
|
2847
|
-
function
|
|
2848
|
-
if (!
|
|
2849
|
-
const
|
|
2850
|
-
if (Math.abs(
|
|
518
|
+
function h() {
|
|
519
|
+
if (!l.value) return;
|
|
520
|
+
const d = Date.now() - (s.value ?? 0), m = n.value.x, g = Math.abs(m) / d;
|
|
521
|
+
if (Math.abs(m) >= e || g > 0.11) {
|
|
2851
522
|
t();
|
|
2852
523
|
return;
|
|
2853
524
|
}
|
|
2854
|
-
|
|
525
|
+
l.value = !1, n.value = { x: 0, y: 0 };
|
|
2855
526
|
}
|
|
2856
527
|
return {
|
|
2857
|
-
offset:
|
|
2858
|
-
isSwiping:
|
|
2859
|
-
onPointerDown:
|
|
2860
|
-
onPointerMove:
|
|
2861
|
-
onPointerUp:
|
|
528
|
+
offset: n,
|
|
529
|
+
isSwiping: l,
|
|
530
|
+
onPointerDown: r,
|
|
531
|
+
onPointerMove: f,
|
|
532
|
+
onPointerUp: h
|
|
2862
533
|
};
|
|
2863
534
|
}
|
|
2864
|
-
function
|
|
2865
|
-
const
|
|
2866
|
-
function
|
|
2867
|
-
|
|
535
|
+
function ge({ duration: i, isPaused: e, onTimeout: t, immediate: l = !0 }) {
|
|
536
|
+
const n = u(), s = u(0), a = u(i);
|
|
537
|
+
function o() {
|
|
538
|
+
a.value === 1 / 0 || e() || (s.value = Date.now(), n.value = window.setTimeout(() => {
|
|
2868
539
|
t();
|
|
2869
|
-
},
|
|
540
|
+
}, a.value));
|
|
2870
541
|
}
|
|
2871
|
-
function
|
|
2872
|
-
|
|
2873
|
-
const
|
|
2874
|
-
|
|
542
|
+
function r() {
|
|
543
|
+
f();
|
|
544
|
+
const h = Date.now() - s.value;
|
|
545
|
+
a.value -= h;
|
|
2875
546
|
}
|
|
2876
|
-
function
|
|
2877
|
-
|
|
547
|
+
function f() {
|
|
548
|
+
n.value && (clearTimeout(n.value), n.value = null);
|
|
2878
549
|
}
|
|
2879
|
-
return
|
|
550
|
+
return P(
|
|
2880
551
|
e,
|
|
2881
|
-
(
|
|
2882
|
-
if (
|
|
2883
|
-
|
|
552
|
+
(h) => {
|
|
553
|
+
if (h) {
|
|
554
|
+
r();
|
|
2884
555
|
return;
|
|
2885
556
|
}
|
|
2886
|
-
|
|
557
|
+
o();
|
|
2887
558
|
},
|
|
2888
|
-
{ immediate:
|
|
2889
|
-
),
|
|
2890
|
-
|
|
2891
|
-
}), { cancel:
|
|
2892
|
-
}
|
|
2893
|
-
function Qr(n, e) {
|
|
2894
|
-
if (!n) return !1;
|
|
2895
|
-
let t = ["INPUT", "TEXTAREA", "SELECT"];
|
|
2896
|
-
return (e === " " || e === "Enter") && (t = [...t, "BUTTON"]), t.includes(n.tagName);
|
|
559
|
+
{ immediate: l }
|
|
560
|
+
), Q(() => {
|
|
561
|
+
f();
|
|
562
|
+
}), { cancel: f };
|
|
2897
563
|
}
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
},
|
|
2904
|
-
class: "w-[18px] h-[18px] mr-1.5 -ml-1",
|
|
2905
|
-
viewBox: "0 0 24 24",
|
|
2906
|
-
fill: "none",
|
|
2907
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
2908
|
-
}, Sr = {
|
|
2909
|
-
class: "w-[18px] h-[18px] mr-1.5 -ml-1",
|
|
2910
|
-
viewBox: "0 0 24 24",
|
|
2911
|
-
fill: "none",
|
|
2912
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
2913
|
-
}, Ar = {
|
|
2914
|
-
class: "w-[18px] h-[18px] mr-1.5 -ml-1",
|
|
2915
|
-
viewBox: "0 0 24 24",
|
|
2916
|
-
fill: "none",
|
|
2917
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
2918
|
-
}, Er = ["title"], Dr = /* @__PURE__ */ K({
|
|
2919
|
-
__name: "ToastNotification",
|
|
2920
|
-
props: {
|
|
2921
|
-
id: {},
|
|
2922
|
-
index: {},
|
|
2923
|
-
stack: {},
|
|
2924
|
-
position: { default: "bottom-center" },
|
|
2925
|
-
toastCount: {},
|
|
2926
|
-
expanded: { type: Boolean },
|
|
2927
|
-
maxVisibleToasts: { default: Ft },
|
|
2928
|
-
swipeDirections: { default: () => [] },
|
|
2929
|
-
style: { default: "" },
|
|
2930
|
-
title: { default: "Title" },
|
|
2931
|
-
description: {},
|
|
2932
|
-
type: { default: "default" },
|
|
2933
|
-
life: { default: ft },
|
|
2934
|
-
html: { default: "" },
|
|
2935
|
-
component: {},
|
|
2936
|
-
scale: {},
|
|
2937
|
-
zIndex: {},
|
|
2938
|
-
offsetY: {},
|
|
2939
|
-
positionY: {}
|
|
2940
|
-
},
|
|
2941
|
-
emits: ["close"],
|
|
2942
|
-
setup(n, { emit: e }) {
|
|
2943
|
-
const t = e, a = n, r = w("translate-y-0"), o = J(() => {
|
|
2944
|
-
if (a.swipeDirections.length > 0) return a.swipeDirections;
|
|
2945
|
-
const [_, $] = a.position.split("-"), H = [];
|
|
2946
|
-
return U(_) && H.push(_), U($) && H.push($), $ === "center" && H.push("left", "right"), H;
|
|
2947
|
-
}), s = J(() => a.position.includes("bottom")), l = w(null), c = w(null), i = w(!1), d = w(!1), { offset: g, isSwiping: h, onPointerDown: v, onPointerMove: p, onPointerUp: T } = yr({
|
|
2948
|
-
directions: o,
|
|
2949
|
-
threshold: Tr,
|
|
2950
|
-
onSwipeOut: E
|
|
2951
|
-
}), { cancel: P } = wr({
|
|
2952
|
-
duration: a.life || ft,
|
|
2953
|
-
isPaused: () => a.expanded || a.type === "loading" || !a.life || a.life === 1 / 0 || i.value,
|
|
2954
|
-
onTimeout: E
|
|
2955
|
-
});
|
|
2956
|
-
function k() {
|
|
2957
|
-
return h.value ? g.value.x > 0 ? "translate-x-full" : "-translate-x-full" : a.toastCount === 1 ? s.value ? "translate-y-full" : "-translate-y-full" : "translate-y-0";
|
|
2958
|
-
}
|
|
2959
|
-
function E() {
|
|
2960
|
-
l.value || (r.value = k(), d.value = !1, P(), l.value = window.setTimeout(() => {
|
|
2961
|
-
t("close", a.id);
|
|
2962
|
-
}, 350));
|
|
2963
|
-
}
|
|
2964
|
-
function V() {
|
|
2965
|
-
c.value && (clearTimeout(c.value), c.value = null), l.value && (clearTimeout(l.value), l.value = null);
|
|
2966
|
-
}
|
|
2967
|
-
function U(_) {
|
|
2968
|
-
return ["top", "right", "bottom", "left"].includes(_);
|
|
2969
|
-
}
|
|
2970
|
-
return Ce(() => {
|
|
2971
|
-
d.value = !0, c.value && clearTimeout(c.value), c.value = window.setTimeout(() => {
|
|
2972
|
-
a.stack();
|
|
2973
|
-
});
|
|
2974
|
-
}), wt(() => {
|
|
2975
|
-
V();
|
|
2976
|
-
}), (_, $) => (m(), C("li", {
|
|
2977
|
-
ref: "toastEl",
|
|
2978
|
-
id: a.id,
|
|
2979
|
-
class: D([
|
|
2980
|
-
"toast w-full absolute duration-300 transition-all ease-out",
|
|
2981
|
-
{ "toast-no-description": !_.description },
|
|
2982
|
-
{ "opacity-0 pointer-events-none": _.index >= _.maxVisibleToasts },
|
|
2983
|
-
_.style
|
|
2984
|
-
]),
|
|
2985
|
-
style: ze({
|
|
2986
|
-
"--offset-x": `${b(g).x}px`,
|
|
2987
|
-
"--offset-y": `${_.offsetY}px`,
|
|
2988
|
-
"--scale": _.scale,
|
|
2989
|
-
"--z-index": _.zIndex,
|
|
2990
|
-
"--position-top": `${_.expanded ? s.value ? "auto" : _.positionY : "inherit"}`,
|
|
2991
|
-
"--position-bottom": `${s.value && _.expanded ? _.positionY : "inherit"}`
|
|
2992
|
-
}),
|
|
2993
|
-
"data-isSwiping": b(h),
|
|
2994
|
-
onMouseover: $[0] || ($[0] = (H) => i.value = !0),
|
|
2995
|
-
onMouseout: $[1] || ($[1] = (H) => i.value = !1),
|
|
2996
|
-
onDragend: $[2] || ($[2] = //@ts-ignore
|
|
2997
|
-
(...H) => b(T) && b(T)(...H)),
|
|
2998
|
-
onPointerdown: $[3] || ($[3] = //@ts-ignore
|
|
2999
|
-
(...H) => b(v) && b(v)(...H)),
|
|
3000
|
-
onPointermove: $[4] || ($[4] = //@ts-ignore
|
|
3001
|
-
(...H) => b(p) && b(p)(...H)),
|
|
3002
|
-
onPointerup: $[5] || ($[5] = //@ts-ignore
|
|
3003
|
-
(...H) => b(T) && b(T)(...H)),
|
|
3004
|
-
role: "alert"
|
|
3005
|
-
}, [
|
|
3006
|
-
M(pe, {
|
|
3007
|
-
"enter-active-class": "",
|
|
3008
|
-
"enter-from-class": `opacity-0 ${s.value ? "translate-y-full" : "-translate-y-full"}`,
|
|
3009
|
-
"enter-to-class": "opacity-100 translate-y-0",
|
|
3010
|
-
"leave-active-class": "",
|
|
3011
|
-
"leave-from-class": "opacity-100 translate-y-0",
|
|
3012
|
-
"leave-to-class": `opacity-0 ${r.value}`
|
|
3013
|
-
}, {
|
|
3014
|
-
default: B(() => [
|
|
3015
|
-
G(x("span", {
|
|
3016
|
-
class: D([
|
|
3017
|
-
{ "p-4": !a.html, "p-0": a.html },
|
|
3018
|
-
"flex flex-col items-start backdrop-blur-lg rounded-md ",
|
|
3019
|
-
"group relative select-text",
|
|
3020
|
-
"transition-all duration-300 ease-out",
|
|
3021
|
-
"bg-white dark:bg-primary-dark-700/70 text-gray-800 dark:text-neutral-100 shadow-[0_5px_15px_-3px_rgb(0_0_0_/_0.08)]",
|
|
3022
|
-
"ring-inset ring-1 ring-gray-100 dark:ring-neutral-800/50",
|
|
3023
|
-
"!outline-none focus:ring-gray-400 dark:focus:ring-purple-500 focus:ring-2"
|
|
3024
|
-
])
|
|
3025
|
-
}, [
|
|
3026
|
-
a.html ? R("", !0) : (m(), C("div", {
|
|
3027
|
-
key: 0,
|
|
3028
|
-
class: D(["flex items-center", {
|
|
3029
|
-
"text-green-500": a.type === "success",
|
|
3030
|
-
"text-blue-500": a.type === "info",
|
|
3031
|
-
"text-orange-400": a.type === "warning",
|
|
3032
|
-
"text-rose-500": a.type === "danger",
|
|
3033
|
-
"dark:text-neutral-100 text-gray-800": a.type === "default"
|
|
3034
|
-
}])
|
|
3035
|
-
}, [
|
|
3036
|
-
G((m(), C("svg", $r, $[6] || ($[6] = [
|
|
3037
|
-
x("path", {
|
|
3038
|
-
"fill-rule": "evenodd",
|
|
3039
|
-
"clip-rule": "evenodd",
|
|
3040
|
-
d: "M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2ZM16.7744 9.63269C17.1238 9.20501 17.0604 8.57503 16.6327 8.22559C16.2051 7.87615 15.5751 7.93957 15.2256 8.36725L10.6321 13.9892L8.65936 12.2524C8.24484 11.8874 7.61295 11.9276 7.248 12.3421C6.88304 12.7566 6.92322 13.3885 7.33774 13.7535L9.31046 15.4903C10.1612 16.2393 11.4637 16.1324 12.1808 15.2547L16.7744 9.63269Z",
|
|
3041
|
-
fill: "currentColor"
|
|
3042
|
-
}, null, -1)
|
|
3043
|
-
]), 512)), [
|
|
3044
|
-
[Q, a.type === "success"]
|
|
3045
|
-
]),
|
|
3046
|
-
G((m(), C("svg", Pr, $[7] || ($[7] = [
|
|
3047
|
-
x("path", {
|
|
3048
|
-
"fill-rule": "evenodd",
|
|
3049
|
-
"clip-rule": "evenodd",
|
|
3050
|
-
d: "M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2ZM12 9C12.5523 9 13 8.55228 13 8C13 7.44772 12.5523 7 12 7C11.4477 7 11 7.44772 11 8C11 8.55228 11.4477 9 12 9ZM13 12C13 11.4477 12.5523 11 12 11C11.4477 11 11 11.4477 11 12V16C11 16.5523 11.4477 17 12 17C12.5523 17 13 16.5523 13 16V12Z",
|
|
3051
|
-
fill: "currentColor"
|
|
3052
|
-
}, null, -1)
|
|
3053
|
-
]), 512)), [
|
|
3054
|
-
[Q, a.type === "info"]
|
|
3055
|
-
]),
|
|
3056
|
-
G((m(), C("svg", Sr, $[8] || ($[8] = [
|
|
3057
|
-
x("path", {
|
|
3058
|
-
"fill-rule": "evenodd",
|
|
3059
|
-
"clip-rule": "evenodd",
|
|
3060
|
-
d: "M9.44829 4.46472C10.5836 2.51208 13.4105 2.51168 14.5464 4.46401L21.5988 16.5855C22.7423 18.5509 21.3145 21 19.05 21L4.94967 21C2.68547 21 1.25762 18.5516 2.4004 16.5862L9.44829 4.46472ZM11.9995 8C12.5518 8 12.9995 8.44772 12.9995 9V13C12.9995 13.5523 12.5518 14 11.9995 14C11.4473 14 10.9995 13.5523 10.9995 13V9C10.9995 8.44772 11.4473 8 11.9995 8ZM12.0009 15.99C11.4486 15.9892 11.0003 16.4363 10.9995 16.9886L10.9995 16.9986C10.9987 17.5509 11.4458 17.9992 11.9981 18C12.5504 18.0008 12.9987 17.5537 12.9995 17.0014L12.9995 16.9914C13.0003 16.4391 12.5532 15.9908 12.0009 15.99Z",
|
|
3061
|
-
fill: "currentColor"
|
|
3062
|
-
}, null, -1)
|
|
3063
|
-
]), 512)), [
|
|
3064
|
-
[Q, a.type === "warning"]
|
|
3065
|
-
]),
|
|
3066
|
-
G((m(), C("svg", Ar, $[9] || ($[9] = [
|
|
3067
|
-
x("path", {
|
|
3068
|
-
"fill-rule": "evenodd",
|
|
3069
|
-
"clip-rule": "evenodd",
|
|
3070
|
-
d: "M2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM11.9996 7C12.5519 7 12.9996 7.44772 12.9996 8V12C12.9996 12.5523 12.5519 13 11.9996 13C11.4474 13 10.9996 12.5523 10.9996 12V8C10.9996 7.44772 11.4474 7 11.9996 7ZM12.001 14.99C11.4488 14.9892 11.0004 15.4363 10.9997 15.9886L10.9996 15.9986C10.9989 16.5509 11.446 16.9992 11.9982 17C12.5505 17.0008 12.9989 16.5537 12.9996 16.0014L12.9996 15.9914C13.0004 15.4391 12.5533 14.9908 12.001 14.99Z",
|
|
3071
|
-
fill: "currentColor"
|
|
3072
|
-
}, null, -1)
|
|
3073
|
-
]), 512)), [
|
|
3074
|
-
[Q, a.type === "danger"]
|
|
3075
|
-
]),
|
|
3076
|
-
x("p", {
|
|
3077
|
-
class: "text-[13px] font-medium leading-none",
|
|
3078
|
-
title: a.title
|
|
3079
|
-
}, j(b(He) + " : " + a.title), 9, Er)
|
|
3080
|
-
], 2)),
|
|
3081
|
-
G(x("p", {
|
|
3082
|
-
class: D([{ "pl-5": a.type !== "default" }, "mt-1.5 text-xs leading-tight opacity-70 w-full whitespace-pre-wrap break-words overflow-y-auto scrollbar-minimal max-h-32 min-h-3 pe-2"])
|
|
3083
|
-
}, j(_.description), 3), [
|
|
3084
|
-
[Q, a.description]
|
|
3085
|
-
]),
|
|
3086
|
-
a.html ? R("", !0) : (m(), C("span", {
|
|
3087
|
-
key: 1,
|
|
3088
|
-
onClick: E,
|
|
3089
|
-
class: D(["absolute right-0 p-1.5 mr-2.5 text-gray-400 dark:text-rose-700 duration-100 ease-in-out rounded-full opacity-0 cursor-pointer hover:bg-gray-50 dark:bg-gray-800/50 hover:text-gray-500 dark:hover:text-rose-600", {
|
|
3090
|
-
"top-1/2 -translate-y-1/2": !a.description && !a.html,
|
|
3091
|
-
"top-0 mt-2.5": a.description || a.html,
|
|
3092
|
-
"opacity-100": i.value,
|
|
3093
|
-
"opacity-0": !i.value
|
|
3094
|
-
}])
|
|
3095
|
-
}, $[10] || ($[10] = [
|
|
3096
|
-
x("svg", {
|
|
3097
|
-
class: "w-3 h-3",
|
|
3098
|
-
fill: "currentColor",
|
|
3099
|
-
viewBox: "0 0 20 20",
|
|
3100
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
3101
|
-
}, [
|
|
3102
|
-
x("path", {
|
|
3103
|
-
"fill-rule": "evenodd",
|
|
3104
|
-
d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",
|
|
3105
|
-
"clip-rule": "evenodd"
|
|
3106
|
-
})
|
|
3107
|
-
], -1)
|
|
3108
|
-
]), 2))
|
|
3109
|
-
], 2), [
|
|
3110
|
-
[Q, d.value]
|
|
3111
|
-
])
|
|
3112
|
-
]),
|
|
3113
|
-
_: 1
|
|
3114
|
-
}, 8, ["enter-from-class", "leave-to-class"])
|
|
3115
|
-
], 46, Ir));
|
|
564
|
+
function be() {
|
|
565
|
+
const i = u(!1), e = u(!1), t = u(300), l = u(null), n = S({}), s = G(null);
|
|
566
|
+
function a(r, f = {}) {
|
|
567
|
+
l.value && clearTimeout(l.value), s.value = r, Object.assign(n, f), e.value = !0, i.value = !0, l.value = window.setTimeout(() => {
|
|
568
|
+
i.value = !1;
|
|
569
|
+
}, t.value);
|
|
3116
570
|
}
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
position: { default: "bottom-right" },
|
|
3122
|
-
defaultLife: { default: 3e3 },
|
|
3123
|
-
viewportOffset: { default: kr },
|
|
3124
|
-
mobileViewportOffset: { default: xr },
|
|
3125
|
-
paddingBetweenToasts: { default: Cr },
|
|
3126
|
-
maxVisibleToasts: { default: Ft },
|
|
3127
|
-
closeButton: { type: Boolean },
|
|
3128
|
-
icons: {}
|
|
3129
|
-
},
|
|
3130
|
-
setup(n) {
|
|
3131
|
-
const e = n, t = w(), a = w([]), r = w(e.position), o = w(e.layout), s = w(!1), l = w(e.layout === "expanded"), c = w(e.paddingBetweenToasts), i = w(null);
|
|
3132
|
-
w(null);
|
|
3133
|
-
function d(T) {
|
|
3134
|
-
a.value = a.value.filter((P) => P.id !== T), te.dismiss(T), g();
|
|
3135
|
-
}
|
|
3136
|
-
function g(T) {
|
|
3137
|
-
a.value.length > 0 && h(), v(), i.value && clearTimeout(i.value), l.value && (i.value = window.setTimeout(() => {
|
|
3138
|
-
v();
|
|
3139
|
-
}, 100));
|
|
3140
|
-
}
|
|
3141
|
-
function h(T) {
|
|
3142
|
-
try {
|
|
3143
|
-
const P = r.value.includes("bottom"), k = [];
|
|
3144
|
-
let E = 0, V = 1 + mt, U = -He, _ = 200 + vt;
|
|
3145
|
-
for (const $ of a.value) {
|
|
3146
|
-
const H = document.getElementById($.id);
|
|
3147
|
-
if (!H) return;
|
|
3148
|
-
if (_ -= vt, V -= mt, U += He, $.scale = V, $.offsetY = U, $.zIndex = _, k.push(H), l.value) {
|
|
3149
|
-
E = E + (E ? c.value : 0), $.positionY = E + "px", $.scale = 1, $.offsetY = 0, E += H.offsetHeight;
|
|
3150
|
-
continue;
|
|
3151
|
-
}
|
|
3152
|
-
$.scale = V, P ? $.offsetY *= -1 : p(k[0], $);
|
|
3153
|
-
}
|
|
3154
|
-
} catch (P) {
|
|
3155
|
-
console.log(P);
|
|
3156
|
-
}
|
|
3157
|
-
}
|
|
3158
|
-
function v() {
|
|
3159
|
-
var V, U;
|
|
3160
|
-
if (!t.value) return;
|
|
3161
|
-
if (a.value.length == 0) {
|
|
3162
|
-
t.value.style.height = "0px";
|
|
3163
|
-
return;
|
|
3164
|
-
}
|
|
3165
|
-
const T = a.value[Math.max(Math.min(a.value.length - 1, e.maxVisibleToasts - 1), 0)], P = (V = document.getElementById(`${T == null ? void 0 : T.id}`)) == null ? void 0 : V.getBoundingClientRect(), k = a.value[0], E = (U = document.getElementById(`${k == null ? void 0 : k.id}`)) == null ? void 0 : U.getBoundingClientRect();
|
|
3166
|
-
if (!(!E || !P)) {
|
|
3167
|
-
if (!s.value) {
|
|
3168
|
-
t.value.style.height = E.height + "px";
|
|
3169
|
-
return;
|
|
3170
|
-
}
|
|
3171
|
-
if (r.value.includes("bottom")) {
|
|
3172
|
-
t.value.style.height = E.top + E.height - P.top + "px";
|
|
3173
|
-
return;
|
|
3174
|
-
}
|
|
3175
|
-
t.value.style.height = P.top + P.height - E.top + "px";
|
|
3176
|
-
}
|
|
3177
|
-
}
|
|
3178
|
-
function p(T, P) {
|
|
3179
|
-
const k = document.getElementById(P.id);
|
|
3180
|
-
if (!k) return;
|
|
3181
|
-
const E = T.offsetTop, V = T.offsetHeight, U = k.offsetHeight, _ = E + (V - U);
|
|
3182
|
-
P.positionY = _ + "px";
|
|
3183
|
-
}
|
|
3184
|
-
return Ce(() => {
|
|
3185
|
-
g();
|
|
3186
|
-
}), W(
|
|
3187
|
-
() => s.value,
|
|
3188
|
-
(T) => {
|
|
3189
|
-
if (o.value === "default") {
|
|
3190
|
-
if (T) {
|
|
3191
|
-
l.value = !0, g();
|
|
3192
|
-
return;
|
|
3193
|
-
}
|
|
3194
|
-
l.value = !1, g();
|
|
3195
|
-
}
|
|
3196
|
-
}
|
|
3197
|
-
), W(
|
|
3198
|
-
() => a.value,
|
|
3199
|
-
() => {
|
|
3200
|
-
a.value.length <= 1 && (l.value = !1);
|
|
3201
|
-
}
|
|
3202
|
-
), Gt((T) => {
|
|
3203
|
-
const P = te.subscribe((k) => {
|
|
3204
|
-
k.dismiss || qe(() => {
|
|
3205
|
-
const E = a.value.findIndex((U) => U.id === k.id);
|
|
3206
|
-
if (E !== -1) {
|
|
3207
|
-
a.value = [
|
|
3208
|
-
...a.value.slice(0, E),
|
|
3209
|
-
{ ...a.value[E], ...k },
|
|
3210
|
-
...a.value.slice(E + 1)
|
|
3211
|
-
];
|
|
3212
|
-
return;
|
|
3213
|
-
}
|
|
3214
|
-
const V = k;
|
|
3215
|
-
V.position && (r.value = V.position), a.value.unshift({
|
|
3216
|
-
...V,
|
|
3217
|
-
id: V.id,
|
|
3218
|
-
type: V.type ?? "default",
|
|
3219
|
-
position: V.position ?? r.value,
|
|
3220
|
-
life: V.life ?? e.defaultLife,
|
|
3221
|
-
title: V.title
|
|
3222
|
-
});
|
|
3223
|
-
});
|
|
3224
|
-
});
|
|
3225
|
-
T(P);
|
|
3226
|
-
}), (T, P) => (m(), Y(Ue, { to: "body" }, [
|
|
3227
|
-
x("p", Nr, "toastsHovered: " + j(s.value), 1),
|
|
3228
|
-
x("ol", {
|
|
3229
|
-
ref_key: "container",
|
|
3230
|
-
ref: t,
|
|
3231
|
-
class: D([
|
|
3232
|
-
`fixed w-full group z-[500] [&>*]:px-4 [&>*]:px-[${T.mobileViewportOffset ?? T.viewportOffset}] [&>*]:sm:px-6 [&>*]:sm:px-[${T.viewportOffset}] my-4 sm:my-6 my-[${T.mobileViewportOffset ?? T.viewportOffset}] sm:my-[${T.viewportOffset}]`,
|
|
3233
|
-
`${b(dt) ? `sm:w-[${b(dt)}px]` : "sm:max-w-sm"}`,
|
|
3234
|
-
`${r.value == "top-right" ? "right-0 top-0" : ""}`,
|
|
3235
|
-
`${r.value == "top-left" ? "left-0 top-0" : ""}`,
|
|
3236
|
-
`${r.value == "top-center" ? "left-1/2 -translate-x-1/2 top-0" : ""}`,
|
|
3237
|
-
`${r.value == "bottom-right" ? "right-0 bottom-0" : ""}`,
|
|
3238
|
-
`${r.value == "bottom-left" ? "left-0 bottom-0" : ""}`,
|
|
3239
|
-
`${r.value == "bottom-center" ? "left-1/2 -translate-x-1/2 bottom-0" : ""}`
|
|
3240
|
-
]),
|
|
3241
|
-
onMouseenter: P[0] || (P[0] = (k) => s.value = !0),
|
|
3242
|
-
onMouseleave: P[1] || (P[1] = (k) => s.value = !1)
|
|
3243
|
-
}, [
|
|
3244
|
-
(m(!0), C(X, null, ge(a.value, (k, E) => (m(), Y(Mr, yt({ ref_for: !0 }, k, {
|
|
3245
|
-
key: k.id,
|
|
3246
|
-
stack: () => {
|
|
3247
|
-
g();
|
|
3248
|
-
},
|
|
3249
|
-
toastCount: a.value.length,
|
|
3250
|
-
position: r.value,
|
|
3251
|
-
expanded: l.value,
|
|
3252
|
-
index: E,
|
|
3253
|
-
maxVisibleToasts: T.maxVisibleToasts,
|
|
3254
|
-
onClose: d
|
|
3255
|
-
}), null, 16, ["stack", "toastCount", "position", "expanded", "index", "maxVisibleToasts"]))), 128))
|
|
3256
|
-
], 34)
|
|
3257
|
-
]));
|
|
571
|
+
function o() {
|
|
572
|
+
l.value && clearTimeout(l.value), e.value = !1, i.value = !0, l.value = window.setTimeout(() => {
|
|
573
|
+
i.value = !1;
|
|
574
|
+
}, t.value);
|
|
3258
575
|
}
|
|
3259
|
-
|
|
3260
|
-
stringInsensitive: (n, e) => pt(n).localeCompare(pt(e)),
|
|
3261
|
-
date: (n, e) => new Date(n).getTime() - new Date(e).getTime(),
|
|
3262
|
-
number: (n, e) => parseFloat(n) - parseFloat(e)
|
|
3263
|
-
};
|
|
3264
|
-
function pt(n) {
|
|
3265
|
-
return String(n ?? "").toLowerCase().replace(/\s+/g, " ").trim();
|
|
576
|
+
return { isOpen: e, isAnimating: i, animationTime: t, props: n, component: s, open: a, close: o };
|
|
3266
577
|
}
|
|
3267
|
-
function
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
578
|
+
function ye(i, e) {
|
|
579
|
+
if (!i) return !1;
|
|
580
|
+
let t = ["INPUT", "TEXTAREA", "SELECT"];
|
|
581
|
+
return (e === " " || e === "Enter") && (t = [...t, "BUTTON"]), t.includes(i.tagName);
|
|
582
|
+
}
|
|
583
|
+
const Ie = 3, Te = "24px", De = "16px", Se = 0, Pe = 3e3, Oe = 16, Ee = 45, Ae = 10, Me = 0.06, Be = 16, le = {
|
|
584
|
+
stringInsensitive: (i, e) => N(i).localeCompare(N(e)),
|
|
585
|
+
date: (i, e) => new Date(i).getTime() - new Date(e).getTime(),
|
|
586
|
+
number: (i, e) => parseFloat(i) - parseFloat(e)
|
|
587
|
+
};
|
|
588
|
+
function N(i) {
|
|
589
|
+
return String(i ?? "").toLowerCase().replace(/\s+/g, " ").trim();
|
|
590
|
+
}
|
|
591
|
+
function xe(i, e = 1, t = ["date", "date_released"]) {
|
|
592
|
+
return (l, n) => {
|
|
593
|
+
const s = l[i], a = n[i];
|
|
594
|
+
if (s instanceof Date && a instanceof Date || t.includes(String(i))) {
|
|
595
|
+
const f = new Date(String(s));
|
|
596
|
+
return (new Date(String(a)).getTime() - f.getTime()) * e;
|
|
597
|
+
}
|
|
598
|
+
const o = parseFloat(s), r = parseFloat(a);
|
|
599
|
+
return !isNaN(o) && !isNaN(r) ? (o - r) * e : String(s).toLowerCase().replace(/\s+/g, " ").localeCompare(String(a).toLowerCase().replace(/\s+/g, " ")) * e;
|
|
3276
600
|
};
|
|
3277
601
|
}
|
|
3278
|
-
function
|
|
3279
|
-
return (t,
|
|
3280
|
-
for (const { key:
|
|
3281
|
-
const
|
|
3282
|
-
let
|
|
3283
|
-
if (
|
|
602
|
+
function Ce(i, e = 1) {
|
|
603
|
+
return (t, l) => {
|
|
604
|
+
for (const { key: n, compareFn: s } of i) {
|
|
605
|
+
const a = n ? t[n] ?? "" : void 0, o = n ? l[n] ?? "" : void 0;
|
|
606
|
+
let r;
|
|
607
|
+
if (s ? r = n ? s(a, o) : s(t, l) : r = oe(a, o), r !== 0) return r * e;
|
|
3284
608
|
}
|
|
3285
609
|
return 0;
|
|
3286
610
|
};
|
|
3287
611
|
}
|
|
3288
|
-
function
|
|
3289
|
-
const t = parseFloat(
|
|
3290
|
-
if (!isNaN(t) && !isNaN(
|
|
3291
|
-
return t -
|
|
3292
|
-
const
|
|
3293
|
-
return !isNaN(
|
|
612
|
+
function oe(i, e) {
|
|
613
|
+
const t = parseFloat(i), l = parseFloat(e);
|
|
614
|
+
if (!isNaN(t) && !isNaN(l))
|
|
615
|
+
return t - l;
|
|
616
|
+
const n = new Date(i), s = new Date(e);
|
|
617
|
+
return !isNaN(n.getTime()) && !isNaN(s.getTime()) ? n.getTime() - s.getTime() : le.stringInsensitive(i, e);
|
|
3294
618
|
}
|
|
3295
619
|
export {
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
Ft as VISIBLE_TOASTS_AMOUNT,
|
|
3323
|
-
He as Y_OFFSET_STEP,
|
|
3324
|
-
vt as Z_STEP,
|
|
3325
|
-
Ge as createModalCore,
|
|
3326
|
-
Qr as isInputLikeElement,
|
|
3327
|
-
es as sortObject,
|
|
3328
|
-
ts as sortObjectNew,
|
|
3329
|
-
Tt as toast,
|
|
3330
|
-
Zr as useClipboard,
|
|
3331
|
-
Gr as useDatePicker,
|
|
3332
|
-
Za as useForm,
|
|
3333
|
-
Xr as useModal,
|
|
3334
|
-
qr as useMultiSelect,
|
|
3335
|
-
nr as useSelect,
|
|
3336
|
-
yr as useSwipeHandler,
|
|
3337
|
-
vr as useTable,
|
|
3338
|
-
wr as useToastTimer
|
|
620
|
+
le as CompareStrategies,
|
|
621
|
+
Oe as DEFAULT_GAP,
|
|
622
|
+
De as MOBILE_VIEWPORT_OFFSET,
|
|
623
|
+
Me as SCALE_STEP,
|
|
624
|
+
Ee as SWIPE_THRESHOLD,
|
|
625
|
+
Pe as TOAST_LIFE,
|
|
626
|
+
Se as TOAST_WIDTH,
|
|
627
|
+
D as ToastState,
|
|
628
|
+
Te as VIEWPORT_OFFSET,
|
|
629
|
+
Ie as VISIBLE_TOASTS_AMOUNT,
|
|
630
|
+
Be as Y_OFFSET_STEP,
|
|
631
|
+
Ae as Z_STEP,
|
|
632
|
+
be as createModalCore,
|
|
633
|
+
ye as isInputLikeElement,
|
|
634
|
+
xe as sortObject,
|
|
635
|
+
Ce as sortObjectNew,
|
|
636
|
+
te as toast,
|
|
637
|
+
de as useClipboard,
|
|
638
|
+
fe as useDatePicker,
|
|
639
|
+
we as useForm,
|
|
640
|
+
he as useModal,
|
|
641
|
+
ue as useMultiSelect,
|
|
642
|
+
me as useSelect,
|
|
643
|
+
pe as useSwipeHandler,
|
|
644
|
+
ve as useTable,
|
|
645
|
+
ge as useToastTimer
|
|
3339
646
|
};
|