@alfadocs/ui-kit 0.14.1 → 0.15.1
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/dist/_chunks/carousel.agent-OTn-kMQg.js +1669 -0
- package/dist/_chunks/{header-D0ULgQl3.js → header-DqmKROIY.js} +42 -52
- package/dist/_chunks/{map-view-Dd48BxVB.js → map-view-DVP-Kp9l.js} +445 -444
- package/dist/_chunks/menu-XRhW3_99.js +16 -0
- package/dist/_chunks/{patient-shell-CL20JnVJ.js → patient-shell-BE0CdPOJ.js} +2 -2
- package/dist/_chunks/public-header.agent-ZLBAQ30j.js +242 -0
- package/dist/_chunks/stat-CYEx8sIR.js +317 -0
- package/dist/_chunks/use-count-up-BLLetaZ8.js +109 -0
- package/dist/agent-catalog.json +92 -1
- package/dist/components/carousel/carousel.agent.d.ts +4 -0
- package/dist/components/carousel/carousel.d.ts +45 -0
- package/dist/components/carousel/index.d.ts +3 -0
- package/dist/components/carousel/index.js +6 -0
- package/dist/components/header/index.js +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/map-view/index.js +1 -1
- package/dist/components/map-view/map-view.d.ts +8 -0
- package/dist/components/public-header/index.d.ts +3 -0
- package/dist/components/public-header/index.js +6 -0
- package/dist/components/public-header/public-header.agent.d.ts +4 -0
- package/dist/components/public-header/public-header.d.ts +43 -0
- package/dist/components/stat/index.js +1 -1
- package/dist/components/stat/stat.d.ts +31 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.js +10 -8
- package/dist/hooks/use-count-up.d.ts +88 -0
- package/dist/i18n/config.js +51 -0
- package/dist/i18n/resources.d.ts +51 -0
- package/dist/index.js +367 -361
- package/dist/locales/de.json +17 -0
- package/dist/locales/en.json +17 -0
- package/dist/locales/it.json +17 -0
- package/dist/patterns/patient-shell/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +10 -1
- package/dist/_chunks/stat-CDQ_a0vk.js +0 -228
|
@@ -0,0 +1,1669 @@
|
|
|
1
|
+
import { jsx as V, jsxs as Dt } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as Pt, useState as nt, useCallback as lt, useEffect as dt, forwardRef as xt, useId as xe, useMemo as Qt, useImperativeHandle as ye, Children as te, isValidElement as ee, createContext as Ie, useContext as Ce } from "react";
|
|
3
|
+
import { c as ne } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as yt } from "react-i18next";
|
|
5
|
+
import { I as Jt } from "./icon-button-C4CGcYuz.js";
|
|
6
|
+
import { C as Le } from "./chevron-left-CX1jqD2M.js";
|
|
7
|
+
import { C as we } from "./chevron-right-BrpYejk0.js";
|
|
8
|
+
function Ee(t) {
|
|
9
|
+
return Object.prototype.toString.call(t) === "[object Object]";
|
|
10
|
+
}
|
|
11
|
+
function Xt(t) {
|
|
12
|
+
return Ee(t) || Array.isArray(t);
|
|
13
|
+
}
|
|
14
|
+
function Te() {
|
|
15
|
+
return !!(typeof window < "u" && window.document && window.document.createElement);
|
|
16
|
+
}
|
|
17
|
+
function Mt(t, e) {
|
|
18
|
+
const n = Object.keys(t), r = Object.keys(e);
|
|
19
|
+
if (n.length !== r.length) return !1;
|
|
20
|
+
const i = JSON.stringify(Object.keys(t.breakpoints || {})), s = JSON.stringify(Object.keys(e.breakpoints || {}));
|
|
21
|
+
return i !== s ? !1 : n.every((o) => {
|
|
22
|
+
const u = t[o], c = e[o];
|
|
23
|
+
return typeof u == "function" ? `${u}` == `${c}` : !Xt(u) || !Xt(c) ? u === c : Mt(u, c);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function Yt(t) {
|
|
27
|
+
return t.concat().sort((e, n) => e.name > n.name ? 1 : -1).map((e) => e.options);
|
|
28
|
+
}
|
|
29
|
+
function De(t, e) {
|
|
30
|
+
if (t.length !== e.length) return !1;
|
|
31
|
+
const n = Yt(t), r = Yt(e);
|
|
32
|
+
return n.every((i, s) => {
|
|
33
|
+
const o = r[s];
|
|
34
|
+
return Mt(i, o);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function kt(t) {
|
|
38
|
+
return typeof t == "number";
|
|
39
|
+
}
|
|
40
|
+
function At(t) {
|
|
41
|
+
return typeof t == "string";
|
|
42
|
+
}
|
|
43
|
+
function It(t) {
|
|
44
|
+
return typeof t == "boolean";
|
|
45
|
+
}
|
|
46
|
+
function Zt(t) {
|
|
47
|
+
return Object.prototype.toString.call(t) === "[object Object]";
|
|
48
|
+
}
|
|
49
|
+
function N(t) {
|
|
50
|
+
return Math.abs(t);
|
|
51
|
+
}
|
|
52
|
+
function Ot(t) {
|
|
53
|
+
return Math.sign(t);
|
|
54
|
+
}
|
|
55
|
+
function pt(t, e) {
|
|
56
|
+
return N(t - e);
|
|
57
|
+
}
|
|
58
|
+
function Pe(t, e) {
|
|
59
|
+
if (t === 0 || e === 0 || N(t) <= N(e)) return 0;
|
|
60
|
+
const n = pt(N(t), N(e));
|
|
61
|
+
return N(n / t);
|
|
62
|
+
}
|
|
63
|
+
function Ae(t) {
|
|
64
|
+
return Math.round(t * 100) / 100;
|
|
65
|
+
}
|
|
66
|
+
function mt(t) {
|
|
67
|
+
return gt(t).map(Number);
|
|
68
|
+
}
|
|
69
|
+
function J(t) {
|
|
70
|
+
return t[bt(t)];
|
|
71
|
+
}
|
|
72
|
+
function bt(t) {
|
|
73
|
+
return Math.max(0, t.length - 1);
|
|
74
|
+
}
|
|
75
|
+
function Ft(t, e) {
|
|
76
|
+
return e === bt(t);
|
|
77
|
+
}
|
|
78
|
+
function Wt(t, e = 0) {
|
|
79
|
+
return Array.from(Array(t), (n, r) => e + r);
|
|
80
|
+
}
|
|
81
|
+
function gt(t) {
|
|
82
|
+
return Object.keys(t);
|
|
83
|
+
}
|
|
84
|
+
function oe(t, e) {
|
|
85
|
+
return [t, e].reduce((n, r) => (gt(r).forEach((i) => {
|
|
86
|
+
const s = n[i], o = r[i], u = Zt(s) && Zt(o);
|
|
87
|
+
n[i] = u ? oe(s, o) : o;
|
|
88
|
+
}), n), {});
|
|
89
|
+
}
|
|
90
|
+
function Nt(t, e) {
|
|
91
|
+
return typeof e.MouseEvent < "u" && t instanceof e.MouseEvent;
|
|
92
|
+
}
|
|
93
|
+
function Ne(t, e) {
|
|
94
|
+
const n = {
|
|
95
|
+
start: r,
|
|
96
|
+
center: i,
|
|
97
|
+
end: s
|
|
98
|
+
};
|
|
99
|
+
function r() {
|
|
100
|
+
return 0;
|
|
101
|
+
}
|
|
102
|
+
function i(c) {
|
|
103
|
+
return s(c) / 2;
|
|
104
|
+
}
|
|
105
|
+
function s(c) {
|
|
106
|
+
return e - c;
|
|
107
|
+
}
|
|
108
|
+
function o(c, l) {
|
|
109
|
+
return At(t) ? n[t](c) : t(e, c, l);
|
|
110
|
+
}
|
|
111
|
+
return {
|
|
112
|
+
measure: o
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
function ht() {
|
|
116
|
+
let t = [];
|
|
117
|
+
function e(i, s, o, u = {
|
|
118
|
+
passive: !0
|
|
119
|
+
}) {
|
|
120
|
+
let c;
|
|
121
|
+
if ("addEventListener" in i)
|
|
122
|
+
i.addEventListener(s, o, u), c = () => i.removeEventListener(s, o, u);
|
|
123
|
+
else {
|
|
124
|
+
const l = i;
|
|
125
|
+
l.addListener(o), c = () => l.removeListener(o);
|
|
126
|
+
}
|
|
127
|
+
return t.push(c), r;
|
|
128
|
+
}
|
|
129
|
+
function n() {
|
|
130
|
+
t = t.filter((i) => i());
|
|
131
|
+
}
|
|
132
|
+
const r = {
|
|
133
|
+
add: e,
|
|
134
|
+
clear: n
|
|
135
|
+
};
|
|
136
|
+
return r;
|
|
137
|
+
}
|
|
138
|
+
function Me(t, e, n, r) {
|
|
139
|
+
const i = ht(), s = 1e3 / 60;
|
|
140
|
+
let o = null, u = 0, c = 0;
|
|
141
|
+
function l() {
|
|
142
|
+
i.add(t, "visibilitychange", () => {
|
|
143
|
+
t.hidden && d();
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
function b() {
|
|
147
|
+
v(), i.clear();
|
|
148
|
+
}
|
|
149
|
+
function p(h) {
|
|
150
|
+
if (!c) return;
|
|
151
|
+
o || (o = h, n(), n());
|
|
152
|
+
const f = h - o;
|
|
153
|
+
for (o = h, u += f; u >= s; )
|
|
154
|
+
n(), u -= s;
|
|
155
|
+
const a = u / s;
|
|
156
|
+
r(a), c && (c = e.requestAnimationFrame(p));
|
|
157
|
+
}
|
|
158
|
+
function m() {
|
|
159
|
+
c || (c = e.requestAnimationFrame(p));
|
|
160
|
+
}
|
|
161
|
+
function v() {
|
|
162
|
+
e.cancelAnimationFrame(c), o = null, u = 0, c = 0;
|
|
163
|
+
}
|
|
164
|
+
function d() {
|
|
165
|
+
o = null, u = 0;
|
|
166
|
+
}
|
|
167
|
+
return {
|
|
168
|
+
init: l,
|
|
169
|
+
destroy: b,
|
|
170
|
+
start: m,
|
|
171
|
+
stop: v,
|
|
172
|
+
update: n,
|
|
173
|
+
render: r
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
function ke(t, e) {
|
|
177
|
+
const n = e === "rtl", r = t === "y", i = r ? "y" : "x", s = r ? "x" : "y", o = !r && n ? -1 : 1, u = b(), c = p();
|
|
178
|
+
function l(d) {
|
|
179
|
+
const {
|
|
180
|
+
height: g,
|
|
181
|
+
width: h
|
|
182
|
+
} = d;
|
|
183
|
+
return r ? g : h;
|
|
184
|
+
}
|
|
185
|
+
function b() {
|
|
186
|
+
return r ? "top" : n ? "right" : "left";
|
|
187
|
+
}
|
|
188
|
+
function p() {
|
|
189
|
+
return r ? "bottom" : n ? "left" : "right";
|
|
190
|
+
}
|
|
191
|
+
function m(d) {
|
|
192
|
+
return d * o;
|
|
193
|
+
}
|
|
194
|
+
return {
|
|
195
|
+
scroll: i,
|
|
196
|
+
cross: s,
|
|
197
|
+
startEdge: u,
|
|
198
|
+
endEdge: c,
|
|
199
|
+
measureSize: l,
|
|
200
|
+
direction: m
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
function ct(t = 0, e = 0) {
|
|
204
|
+
const n = N(t - e);
|
|
205
|
+
function r(l) {
|
|
206
|
+
return l < t;
|
|
207
|
+
}
|
|
208
|
+
function i(l) {
|
|
209
|
+
return l > e;
|
|
210
|
+
}
|
|
211
|
+
function s(l) {
|
|
212
|
+
return r(l) || i(l);
|
|
213
|
+
}
|
|
214
|
+
function o(l) {
|
|
215
|
+
return s(l) ? r(l) ? t : e : l;
|
|
216
|
+
}
|
|
217
|
+
function u(l) {
|
|
218
|
+
return n ? l - n * Math.ceil((l - e) / n) : l;
|
|
219
|
+
}
|
|
220
|
+
return {
|
|
221
|
+
length: n,
|
|
222
|
+
max: e,
|
|
223
|
+
min: t,
|
|
224
|
+
constrain: o,
|
|
225
|
+
reachedAny: s,
|
|
226
|
+
reachedMax: i,
|
|
227
|
+
reachedMin: r,
|
|
228
|
+
removeOffset: u
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
function re(t, e, n) {
|
|
232
|
+
const {
|
|
233
|
+
constrain: r
|
|
234
|
+
} = ct(0, t), i = t + 1;
|
|
235
|
+
let s = o(e);
|
|
236
|
+
function o(m) {
|
|
237
|
+
return n ? N((i + m) % i) : r(m);
|
|
238
|
+
}
|
|
239
|
+
function u() {
|
|
240
|
+
return s;
|
|
241
|
+
}
|
|
242
|
+
function c(m) {
|
|
243
|
+
return s = o(m), p;
|
|
244
|
+
}
|
|
245
|
+
function l(m) {
|
|
246
|
+
return b().set(u() + m);
|
|
247
|
+
}
|
|
248
|
+
function b() {
|
|
249
|
+
return re(t, u(), n);
|
|
250
|
+
}
|
|
251
|
+
const p = {
|
|
252
|
+
get: u,
|
|
253
|
+
set: c,
|
|
254
|
+
add: l,
|
|
255
|
+
clone: b
|
|
256
|
+
};
|
|
257
|
+
return p;
|
|
258
|
+
}
|
|
259
|
+
function Oe(t, e, n, r, i, s, o, u, c, l, b, p, m, v, d, g, h, f, a) {
|
|
260
|
+
const {
|
|
261
|
+
cross: S,
|
|
262
|
+
direction: C
|
|
263
|
+
} = t, L = ["INPUT", "SELECT", "TEXTAREA"], w = {
|
|
264
|
+
passive: !1
|
|
265
|
+
}, y = ht(), I = ht(), E = ct(50, 225).constrain(v.measure(20)), P = {
|
|
266
|
+
mouse: 300,
|
|
267
|
+
touch: 400
|
|
268
|
+
}, T = {
|
|
269
|
+
mouse: 500,
|
|
270
|
+
touch: 600
|
|
271
|
+
}, j = d ? 43 : 25;
|
|
272
|
+
let M = !1, B = 0, R = 0, q = !1, X = !1, _ = !1, K = !1;
|
|
273
|
+
function ot(x) {
|
|
274
|
+
if (!a) return;
|
|
275
|
+
function D(G) {
|
|
276
|
+
(It(a) || a(x, G)) && k(G);
|
|
277
|
+
}
|
|
278
|
+
const z = e;
|
|
279
|
+
y.add(z, "dragstart", (G) => G.preventDefault(), w).add(z, "touchmove", () => {
|
|
280
|
+
}, w).add(z, "touchend", () => {
|
|
281
|
+
}).add(z, "touchstart", D).add(z, "mousedown", D).add(z, "touchcancel", F).add(z, "contextmenu", F).add(z, "click", $, !0);
|
|
282
|
+
}
|
|
283
|
+
function U() {
|
|
284
|
+
y.clear(), I.clear();
|
|
285
|
+
}
|
|
286
|
+
function W() {
|
|
287
|
+
const x = K ? n : e;
|
|
288
|
+
I.add(x, "touchmove", O, w).add(x, "touchend", F).add(x, "mousemove", O, w).add(x, "mouseup", F);
|
|
289
|
+
}
|
|
290
|
+
function tt(x) {
|
|
291
|
+
const D = x.nodeName || "";
|
|
292
|
+
return L.includes(D);
|
|
293
|
+
}
|
|
294
|
+
function Q() {
|
|
295
|
+
return (d ? T : P)[K ? "mouse" : "touch"];
|
|
296
|
+
}
|
|
297
|
+
function rt(x, D) {
|
|
298
|
+
const z = p.add(Ot(x) * -1), G = b.byDistance(x, !d).distance;
|
|
299
|
+
return d || N(x) < E ? G : h && D ? G * 0.5 : b.byIndex(z.get(), 0).distance;
|
|
300
|
+
}
|
|
301
|
+
function k(x) {
|
|
302
|
+
const D = Nt(x, r);
|
|
303
|
+
K = D, _ = d && D && !x.buttons && M, M = pt(i.get(), o.get()) >= 2, !(D && x.button !== 0) && (tt(x.target) || (q = !0, s.pointerDown(x), l.useFriction(0).useDuration(0), i.set(o), W(), B = s.readPoint(x), R = s.readPoint(x, S), m.emit("pointerDown")));
|
|
304
|
+
}
|
|
305
|
+
function O(x) {
|
|
306
|
+
if (!Nt(x, r) && x.touches.length >= 2) return F(x);
|
|
307
|
+
const z = s.readPoint(x), G = s.readPoint(x, S), Y = pt(z, B), Z = pt(G, R);
|
|
308
|
+
if (!X && !K && (!x.cancelable || (X = Y > Z, !X)))
|
|
309
|
+
return F(x);
|
|
310
|
+
const st = s.pointerMove(x);
|
|
311
|
+
Y > g && (_ = !0), l.useFriction(0.3).useDuration(0.75), u.start(), i.add(C(st)), x.preventDefault();
|
|
312
|
+
}
|
|
313
|
+
function F(x) {
|
|
314
|
+
const z = b.byDistance(0, !1).index !== p.get(), G = s.pointerUp(x) * Q(), Y = rt(C(G), z), Z = Pe(G, Y), st = j - 10 * Z, et = f + Z / 50;
|
|
315
|
+
X = !1, q = !1, I.clear(), l.useDuration(st).useFriction(et), c.distance(Y, !d), K = !1, m.emit("pointerUp");
|
|
316
|
+
}
|
|
317
|
+
function $(x) {
|
|
318
|
+
_ && (x.stopPropagation(), x.preventDefault(), _ = !1);
|
|
319
|
+
}
|
|
320
|
+
function H() {
|
|
321
|
+
return q;
|
|
322
|
+
}
|
|
323
|
+
return {
|
|
324
|
+
init: ot,
|
|
325
|
+
destroy: U,
|
|
326
|
+
pointerDown: H
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
function Fe(t, e) {
|
|
330
|
+
let r, i;
|
|
331
|
+
function s(p) {
|
|
332
|
+
return p.timeStamp;
|
|
333
|
+
}
|
|
334
|
+
function o(p, m) {
|
|
335
|
+
const d = `client${(m || t.scroll) === "x" ? "X" : "Y"}`;
|
|
336
|
+
return (Nt(p, e) ? p : p.touches[0])[d];
|
|
337
|
+
}
|
|
338
|
+
function u(p) {
|
|
339
|
+
return r = p, i = p, o(p);
|
|
340
|
+
}
|
|
341
|
+
function c(p) {
|
|
342
|
+
const m = o(p) - o(i), v = s(p) - s(r) > 170;
|
|
343
|
+
return i = p, v && (r = p), m;
|
|
344
|
+
}
|
|
345
|
+
function l(p) {
|
|
346
|
+
if (!r || !i) return 0;
|
|
347
|
+
const m = o(i) - o(r), v = s(p) - s(r), d = s(p) - s(i) > 170, g = m / v;
|
|
348
|
+
return v && !d && N(g) > 0.1 ? g : 0;
|
|
349
|
+
}
|
|
350
|
+
return {
|
|
351
|
+
pointerDown: u,
|
|
352
|
+
pointerMove: c,
|
|
353
|
+
pointerUp: l,
|
|
354
|
+
readPoint: o
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
function ze() {
|
|
358
|
+
function t(n) {
|
|
359
|
+
const {
|
|
360
|
+
offsetTop: r,
|
|
361
|
+
offsetLeft: i,
|
|
362
|
+
offsetWidth: s,
|
|
363
|
+
offsetHeight: o
|
|
364
|
+
} = n;
|
|
365
|
+
return {
|
|
366
|
+
top: r,
|
|
367
|
+
right: i + s,
|
|
368
|
+
bottom: r + o,
|
|
369
|
+
left: i,
|
|
370
|
+
width: s,
|
|
371
|
+
height: o
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
return {
|
|
375
|
+
measure: t
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
function Ve(t) {
|
|
379
|
+
function e(r) {
|
|
380
|
+
return t * (r / 100);
|
|
381
|
+
}
|
|
382
|
+
return {
|
|
383
|
+
measure: e
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
function je(t, e, n, r, i, s, o) {
|
|
387
|
+
const u = [t].concat(r);
|
|
388
|
+
let c, l, b = [], p = !1;
|
|
389
|
+
function m(h) {
|
|
390
|
+
return i.measureSize(o.measure(h));
|
|
391
|
+
}
|
|
392
|
+
function v(h) {
|
|
393
|
+
if (!s) return;
|
|
394
|
+
l = m(t), b = r.map(m);
|
|
395
|
+
function f(a) {
|
|
396
|
+
for (const S of a) {
|
|
397
|
+
if (p) return;
|
|
398
|
+
const C = S.target === t, L = r.indexOf(S.target), w = C ? l : b[L], y = m(C ? t : r[L]);
|
|
399
|
+
if (N(y - w) >= 0.5) {
|
|
400
|
+
h.reInit(), e.emit("resize");
|
|
401
|
+
break;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
c = new ResizeObserver((a) => {
|
|
406
|
+
(It(s) || s(h, a)) && f(a);
|
|
407
|
+
}), n.requestAnimationFrame(() => {
|
|
408
|
+
u.forEach((a) => c.observe(a));
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
function d() {
|
|
412
|
+
p = !0, c && c.disconnect();
|
|
413
|
+
}
|
|
414
|
+
return {
|
|
415
|
+
init: v,
|
|
416
|
+
destroy: d
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
function Be(t, e, n, r, i, s) {
|
|
420
|
+
let o = 0, u = 0, c = i, l = s, b = t.get(), p = 0;
|
|
421
|
+
function m() {
|
|
422
|
+
const w = r.get() - t.get(), y = !c;
|
|
423
|
+
let I = 0;
|
|
424
|
+
return y ? (o = 0, n.set(r), t.set(r), I = w) : (n.set(t), o += w / c, o *= l, b += o, t.add(o), I = b - p), u = Ot(I), p = b, L;
|
|
425
|
+
}
|
|
426
|
+
function v() {
|
|
427
|
+
const w = r.get() - e.get();
|
|
428
|
+
return N(w) < 1e-3;
|
|
429
|
+
}
|
|
430
|
+
function d() {
|
|
431
|
+
return c;
|
|
432
|
+
}
|
|
433
|
+
function g() {
|
|
434
|
+
return u;
|
|
435
|
+
}
|
|
436
|
+
function h() {
|
|
437
|
+
return o;
|
|
438
|
+
}
|
|
439
|
+
function f() {
|
|
440
|
+
return S(i);
|
|
441
|
+
}
|
|
442
|
+
function a() {
|
|
443
|
+
return C(s);
|
|
444
|
+
}
|
|
445
|
+
function S(w) {
|
|
446
|
+
return c = w, L;
|
|
447
|
+
}
|
|
448
|
+
function C(w) {
|
|
449
|
+
return l = w, L;
|
|
450
|
+
}
|
|
451
|
+
const L = {
|
|
452
|
+
direction: g,
|
|
453
|
+
duration: d,
|
|
454
|
+
velocity: h,
|
|
455
|
+
seek: m,
|
|
456
|
+
settled: v,
|
|
457
|
+
useBaseFriction: a,
|
|
458
|
+
useBaseDuration: f,
|
|
459
|
+
useFriction: C,
|
|
460
|
+
useDuration: S
|
|
461
|
+
};
|
|
462
|
+
return L;
|
|
463
|
+
}
|
|
464
|
+
function Re(t, e, n, r, i) {
|
|
465
|
+
const s = i.measure(10), o = i.measure(50), u = ct(0.1, 0.99);
|
|
466
|
+
let c = !1;
|
|
467
|
+
function l() {
|
|
468
|
+
return !(c || !t.reachedAny(n.get()) || !t.reachedAny(e.get()));
|
|
469
|
+
}
|
|
470
|
+
function b(v) {
|
|
471
|
+
if (!l()) return;
|
|
472
|
+
const d = t.reachedMin(e.get()) ? "min" : "max", g = N(t[d] - e.get()), h = n.get() - e.get(), f = u.constrain(g / o);
|
|
473
|
+
n.subtract(h * f), !v && N(h) < s && (n.set(t.constrain(n.get())), r.useDuration(25).useBaseFriction());
|
|
474
|
+
}
|
|
475
|
+
function p(v) {
|
|
476
|
+
c = !v;
|
|
477
|
+
}
|
|
478
|
+
return {
|
|
479
|
+
shouldConstrain: l,
|
|
480
|
+
constrain: b,
|
|
481
|
+
toggleActive: p
|
|
482
|
+
};
|
|
483
|
+
}
|
|
484
|
+
function He(t, e, n, r, i) {
|
|
485
|
+
const s = ct(-e + t, 0), o = p(), u = b(), c = m();
|
|
486
|
+
function l(d, g) {
|
|
487
|
+
return pt(d, g) <= 1;
|
|
488
|
+
}
|
|
489
|
+
function b() {
|
|
490
|
+
const d = o[0], g = J(o), h = o.lastIndexOf(d), f = o.indexOf(g) + 1;
|
|
491
|
+
return ct(h, f);
|
|
492
|
+
}
|
|
493
|
+
function p() {
|
|
494
|
+
return n.map((d, g) => {
|
|
495
|
+
const {
|
|
496
|
+
min: h,
|
|
497
|
+
max: f
|
|
498
|
+
} = s, a = s.constrain(d), S = !g, C = Ft(n, g);
|
|
499
|
+
return S ? f : C || l(h, a) ? h : l(f, a) ? f : a;
|
|
500
|
+
}).map((d) => parseFloat(d.toFixed(3)));
|
|
501
|
+
}
|
|
502
|
+
function m() {
|
|
503
|
+
if (e <= t + i) return [s.max];
|
|
504
|
+
if (r === "keepSnaps") return o;
|
|
505
|
+
const {
|
|
506
|
+
min: d,
|
|
507
|
+
max: g
|
|
508
|
+
} = u;
|
|
509
|
+
return o.slice(d, g);
|
|
510
|
+
}
|
|
511
|
+
return {
|
|
512
|
+
snapsContained: c,
|
|
513
|
+
scrollContainLimit: u
|
|
514
|
+
};
|
|
515
|
+
}
|
|
516
|
+
function Ge(t, e, n) {
|
|
517
|
+
const r = e[0], i = n ? r - t : J(e);
|
|
518
|
+
return {
|
|
519
|
+
limit: ct(i, r)
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
function Ue(t, e, n, r) {
|
|
523
|
+
const s = e.min + 0.1, o = e.max + 0.1, {
|
|
524
|
+
reachedMin: u,
|
|
525
|
+
reachedMax: c
|
|
526
|
+
} = ct(s, o);
|
|
527
|
+
function l(m) {
|
|
528
|
+
return m === 1 ? c(n.get()) : m === -1 ? u(n.get()) : !1;
|
|
529
|
+
}
|
|
530
|
+
function b(m) {
|
|
531
|
+
if (!l(m)) return;
|
|
532
|
+
const v = t * (m * -1);
|
|
533
|
+
r.forEach((d) => d.add(v));
|
|
534
|
+
}
|
|
535
|
+
return {
|
|
536
|
+
loop: b
|
|
537
|
+
};
|
|
538
|
+
}
|
|
539
|
+
function $e(t) {
|
|
540
|
+
const {
|
|
541
|
+
max: e,
|
|
542
|
+
length: n
|
|
543
|
+
} = t;
|
|
544
|
+
function r(s) {
|
|
545
|
+
const o = s - e;
|
|
546
|
+
return n ? o / -n : 0;
|
|
547
|
+
}
|
|
548
|
+
return {
|
|
549
|
+
get: r
|
|
550
|
+
};
|
|
551
|
+
}
|
|
552
|
+
function qe(t, e, n, r, i) {
|
|
553
|
+
const {
|
|
554
|
+
startEdge: s,
|
|
555
|
+
endEdge: o
|
|
556
|
+
} = t, {
|
|
557
|
+
groupSlides: u
|
|
558
|
+
} = i, c = p().map(e.measure), l = m(), b = v();
|
|
559
|
+
function p() {
|
|
560
|
+
return u(r).map((g) => J(g)[o] - g[0][s]).map(N);
|
|
561
|
+
}
|
|
562
|
+
function m() {
|
|
563
|
+
return r.map((g) => n[s] - g[s]).map((g) => -N(g));
|
|
564
|
+
}
|
|
565
|
+
function v() {
|
|
566
|
+
return u(l).map((g) => g[0]).map((g, h) => g + c[h]);
|
|
567
|
+
}
|
|
568
|
+
return {
|
|
569
|
+
snaps: l,
|
|
570
|
+
snapsAligned: b
|
|
571
|
+
};
|
|
572
|
+
}
|
|
573
|
+
function _e(t, e, n, r, i, s) {
|
|
574
|
+
const {
|
|
575
|
+
groupSlides: o
|
|
576
|
+
} = i, {
|
|
577
|
+
min: u,
|
|
578
|
+
max: c
|
|
579
|
+
} = r, l = b();
|
|
580
|
+
function b() {
|
|
581
|
+
const m = o(s), v = !t || e === "keepSnaps";
|
|
582
|
+
return n.length === 1 ? [s] : v ? m : m.slice(u, c).map((d, g, h) => {
|
|
583
|
+
const f = !g, a = Ft(h, g);
|
|
584
|
+
if (f) {
|
|
585
|
+
const S = J(h[0]) + 1;
|
|
586
|
+
return Wt(S);
|
|
587
|
+
}
|
|
588
|
+
if (a) {
|
|
589
|
+
const S = bt(s) - J(h)[0] + 1;
|
|
590
|
+
return Wt(S, J(h)[0]);
|
|
591
|
+
}
|
|
592
|
+
return d;
|
|
593
|
+
});
|
|
594
|
+
}
|
|
595
|
+
return {
|
|
596
|
+
slideRegistry: l
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
function Ke(t, e, n, r, i) {
|
|
600
|
+
const {
|
|
601
|
+
reachedAny: s,
|
|
602
|
+
removeOffset: o,
|
|
603
|
+
constrain: u
|
|
604
|
+
} = r;
|
|
605
|
+
function c(d) {
|
|
606
|
+
return d.concat().sort((g, h) => N(g) - N(h))[0];
|
|
607
|
+
}
|
|
608
|
+
function l(d) {
|
|
609
|
+
const g = t ? o(d) : u(d), h = e.map((a, S) => ({
|
|
610
|
+
diff: b(a - g, 0),
|
|
611
|
+
index: S
|
|
612
|
+
})).sort((a, S) => N(a.diff) - N(S.diff)), {
|
|
613
|
+
index: f
|
|
614
|
+
} = h[0];
|
|
615
|
+
return {
|
|
616
|
+
index: f,
|
|
617
|
+
distance: g
|
|
618
|
+
};
|
|
619
|
+
}
|
|
620
|
+
function b(d, g) {
|
|
621
|
+
const h = [d, d + n, d - n];
|
|
622
|
+
if (!t) return d;
|
|
623
|
+
if (!g) return c(h);
|
|
624
|
+
const f = h.filter((a) => Ot(a) === g);
|
|
625
|
+
return f.length ? c(f) : J(h) - n;
|
|
626
|
+
}
|
|
627
|
+
function p(d, g) {
|
|
628
|
+
const h = e[d] - i.get(), f = b(h, g);
|
|
629
|
+
return {
|
|
630
|
+
index: d,
|
|
631
|
+
distance: f
|
|
632
|
+
};
|
|
633
|
+
}
|
|
634
|
+
function m(d, g) {
|
|
635
|
+
const h = i.get() + d, {
|
|
636
|
+
index: f,
|
|
637
|
+
distance: a
|
|
638
|
+
} = l(h), S = !t && s(h);
|
|
639
|
+
if (!g || S) return {
|
|
640
|
+
index: f,
|
|
641
|
+
distance: d
|
|
642
|
+
};
|
|
643
|
+
const C = e[f] - a, L = d + b(C, 0);
|
|
644
|
+
return {
|
|
645
|
+
index: f,
|
|
646
|
+
distance: L
|
|
647
|
+
};
|
|
648
|
+
}
|
|
649
|
+
return {
|
|
650
|
+
byDistance: m,
|
|
651
|
+
byIndex: p,
|
|
652
|
+
shortcut: b
|
|
653
|
+
};
|
|
654
|
+
}
|
|
655
|
+
function Qe(t, e, n, r, i, s, o) {
|
|
656
|
+
function u(p) {
|
|
657
|
+
const m = p.distance, v = p.index !== e.get();
|
|
658
|
+
s.add(m), m && (r.duration() ? t.start() : (t.update(), t.render(1), t.update())), v && (n.set(e.get()), e.set(p.index), o.emit("select"));
|
|
659
|
+
}
|
|
660
|
+
function c(p, m) {
|
|
661
|
+
const v = i.byDistance(p, m);
|
|
662
|
+
u(v);
|
|
663
|
+
}
|
|
664
|
+
function l(p, m) {
|
|
665
|
+
const v = e.clone().set(p), d = i.byIndex(v.get(), m);
|
|
666
|
+
u(d);
|
|
667
|
+
}
|
|
668
|
+
return {
|
|
669
|
+
distance: c,
|
|
670
|
+
index: l
|
|
671
|
+
};
|
|
672
|
+
}
|
|
673
|
+
function Je(t, e, n, r, i, s, o, u) {
|
|
674
|
+
const c = {
|
|
675
|
+
passive: !0,
|
|
676
|
+
capture: !0
|
|
677
|
+
};
|
|
678
|
+
let l = 0;
|
|
679
|
+
function b(v) {
|
|
680
|
+
if (!u) return;
|
|
681
|
+
function d(g) {
|
|
682
|
+
if ((/* @__PURE__ */ new Date()).getTime() - l > 10) return;
|
|
683
|
+
o.emit("slideFocusStart"), t.scrollLeft = 0;
|
|
684
|
+
const a = n.findIndex((S) => S.includes(g));
|
|
685
|
+
kt(a) && (i.useDuration(0), r.index(a, 0), o.emit("slideFocus"));
|
|
686
|
+
}
|
|
687
|
+
s.add(document, "keydown", p, !1), e.forEach((g, h) => {
|
|
688
|
+
s.add(g, "focus", (f) => {
|
|
689
|
+
(It(u) || u(v, f)) && d(h);
|
|
690
|
+
}, c);
|
|
691
|
+
});
|
|
692
|
+
}
|
|
693
|
+
function p(v) {
|
|
694
|
+
v.code === "Tab" && (l = (/* @__PURE__ */ new Date()).getTime());
|
|
695
|
+
}
|
|
696
|
+
return {
|
|
697
|
+
init: b
|
|
698
|
+
};
|
|
699
|
+
}
|
|
700
|
+
function ft(t) {
|
|
701
|
+
let e = t;
|
|
702
|
+
function n() {
|
|
703
|
+
return e;
|
|
704
|
+
}
|
|
705
|
+
function r(c) {
|
|
706
|
+
e = o(c);
|
|
707
|
+
}
|
|
708
|
+
function i(c) {
|
|
709
|
+
e += o(c);
|
|
710
|
+
}
|
|
711
|
+
function s(c) {
|
|
712
|
+
e -= o(c);
|
|
713
|
+
}
|
|
714
|
+
function o(c) {
|
|
715
|
+
return kt(c) ? c : c.get();
|
|
716
|
+
}
|
|
717
|
+
return {
|
|
718
|
+
get: n,
|
|
719
|
+
set: r,
|
|
720
|
+
add: i,
|
|
721
|
+
subtract: s
|
|
722
|
+
};
|
|
723
|
+
}
|
|
724
|
+
function se(t, e) {
|
|
725
|
+
const n = t.scroll === "x" ? o : u, r = e.style;
|
|
726
|
+
let i = null, s = !1;
|
|
727
|
+
function o(m) {
|
|
728
|
+
return `translate3d(${m}px,0px,0px)`;
|
|
729
|
+
}
|
|
730
|
+
function u(m) {
|
|
731
|
+
return `translate3d(0px,${m}px,0px)`;
|
|
732
|
+
}
|
|
733
|
+
function c(m) {
|
|
734
|
+
if (s) return;
|
|
735
|
+
const v = Ae(t.direction(m));
|
|
736
|
+
v !== i && (r.transform = n(v), i = v);
|
|
737
|
+
}
|
|
738
|
+
function l(m) {
|
|
739
|
+
s = !m;
|
|
740
|
+
}
|
|
741
|
+
function b() {
|
|
742
|
+
s || (r.transform = "", e.getAttribute("style") || e.removeAttribute("style"));
|
|
743
|
+
}
|
|
744
|
+
return {
|
|
745
|
+
clear: b,
|
|
746
|
+
to: c,
|
|
747
|
+
toggleActive: l
|
|
748
|
+
};
|
|
749
|
+
}
|
|
750
|
+
function Xe(t, e, n, r, i, s, o, u, c) {
|
|
751
|
+
const b = mt(i), p = mt(i).reverse(), m = f().concat(a());
|
|
752
|
+
function v(y, I) {
|
|
753
|
+
return y.reduce((E, P) => E - i[P], I);
|
|
754
|
+
}
|
|
755
|
+
function d(y, I) {
|
|
756
|
+
return y.reduce((E, P) => v(E, I) > 0 ? E.concat([P]) : E, []);
|
|
757
|
+
}
|
|
758
|
+
function g(y) {
|
|
759
|
+
return s.map((I, E) => ({
|
|
760
|
+
start: I - r[E] + 0.5 + y,
|
|
761
|
+
end: I + e - 0.5 + y
|
|
762
|
+
}));
|
|
763
|
+
}
|
|
764
|
+
function h(y, I, E) {
|
|
765
|
+
const P = g(I);
|
|
766
|
+
return y.map((T) => {
|
|
767
|
+
const j = E ? 0 : -n, M = E ? n : 0, B = E ? "end" : "start", R = P[T][B];
|
|
768
|
+
return {
|
|
769
|
+
index: T,
|
|
770
|
+
loopPoint: R,
|
|
771
|
+
slideLocation: ft(-1),
|
|
772
|
+
translate: se(t, c[T]),
|
|
773
|
+
target: () => u.get() > R ? j : M
|
|
774
|
+
};
|
|
775
|
+
});
|
|
776
|
+
}
|
|
777
|
+
function f() {
|
|
778
|
+
const y = o[0], I = d(p, y);
|
|
779
|
+
return h(I, n, !1);
|
|
780
|
+
}
|
|
781
|
+
function a() {
|
|
782
|
+
const y = e - o[0] - 1, I = d(b, y);
|
|
783
|
+
return h(I, -n, !0);
|
|
784
|
+
}
|
|
785
|
+
function S() {
|
|
786
|
+
return m.every(({
|
|
787
|
+
index: y
|
|
788
|
+
}) => {
|
|
789
|
+
const I = b.filter((E) => E !== y);
|
|
790
|
+
return v(I, e) <= 0.1;
|
|
791
|
+
});
|
|
792
|
+
}
|
|
793
|
+
function C() {
|
|
794
|
+
m.forEach((y) => {
|
|
795
|
+
const {
|
|
796
|
+
target: I,
|
|
797
|
+
translate: E,
|
|
798
|
+
slideLocation: P
|
|
799
|
+
} = y, T = I();
|
|
800
|
+
T !== P.get() && (E.to(T), P.set(T));
|
|
801
|
+
});
|
|
802
|
+
}
|
|
803
|
+
function L() {
|
|
804
|
+
m.forEach((y) => y.translate.clear());
|
|
805
|
+
}
|
|
806
|
+
return {
|
|
807
|
+
canLoop: S,
|
|
808
|
+
clear: L,
|
|
809
|
+
loop: C,
|
|
810
|
+
loopPoints: m
|
|
811
|
+
};
|
|
812
|
+
}
|
|
813
|
+
function Ye(t, e, n) {
|
|
814
|
+
let r, i = !1;
|
|
815
|
+
function s(c) {
|
|
816
|
+
if (!n) return;
|
|
817
|
+
function l(b) {
|
|
818
|
+
for (const p of b)
|
|
819
|
+
if (p.type === "childList") {
|
|
820
|
+
c.reInit(), e.emit("slidesChanged");
|
|
821
|
+
break;
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
r = new MutationObserver((b) => {
|
|
825
|
+
i || (It(n) || n(c, b)) && l(b);
|
|
826
|
+
}), r.observe(t, {
|
|
827
|
+
childList: !0
|
|
828
|
+
});
|
|
829
|
+
}
|
|
830
|
+
function o() {
|
|
831
|
+
r && r.disconnect(), i = !0;
|
|
832
|
+
}
|
|
833
|
+
return {
|
|
834
|
+
init: s,
|
|
835
|
+
destroy: o
|
|
836
|
+
};
|
|
837
|
+
}
|
|
838
|
+
function Ze(t, e, n, r) {
|
|
839
|
+
const i = {};
|
|
840
|
+
let s = null, o = null, u, c = !1;
|
|
841
|
+
function l() {
|
|
842
|
+
u = new IntersectionObserver((d) => {
|
|
843
|
+
c || (d.forEach((g) => {
|
|
844
|
+
const h = e.indexOf(g.target);
|
|
845
|
+
i[h] = g;
|
|
846
|
+
}), s = null, o = null, n.emit("slidesInView"));
|
|
847
|
+
}, {
|
|
848
|
+
root: t.parentElement,
|
|
849
|
+
threshold: r
|
|
850
|
+
}), e.forEach((d) => u.observe(d));
|
|
851
|
+
}
|
|
852
|
+
function b() {
|
|
853
|
+
u && u.disconnect(), c = !0;
|
|
854
|
+
}
|
|
855
|
+
function p(d) {
|
|
856
|
+
return gt(i).reduce((g, h) => {
|
|
857
|
+
const f = parseInt(h), {
|
|
858
|
+
isIntersecting: a
|
|
859
|
+
} = i[f];
|
|
860
|
+
return (d && a || !d && !a) && g.push(f), g;
|
|
861
|
+
}, []);
|
|
862
|
+
}
|
|
863
|
+
function m(d = !0) {
|
|
864
|
+
if (d && s) return s;
|
|
865
|
+
if (!d && o) return o;
|
|
866
|
+
const g = p(d);
|
|
867
|
+
return d && (s = g), d || (o = g), g;
|
|
868
|
+
}
|
|
869
|
+
return {
|
|
870
|
+
init: l,
|
|
871
|
+
destroy: b,
|
|
872
|
+
get: m
|
|
873
|
+
};
|
|
874
|
+
}
|
|
875
|
+
function We(t, e, n, r, i, s) {
|
|
876
|
+
const {
|
|
877
|
+
measureSize: o,
|
|
878
|
+
startEdge: u,
|
|
879
|
+
endEdge: c
|
|
880
|
+
} = t, l = n[0] && i, b = d(), p = g(), m = n.map(o), v = h();
|
|
881
|
+
function d() {
|
|
882
|
+
if (!l) return 0;
|
|
883
|
+
const a = n[0];
|
|
884
|
+
return N(e[u] - a[u]);
|
|
885
|
+
}
|
|
886
|
+
function g() {
|
|
887
|
+
if (!l) return 0;
|
|
888
|
+
const a = s.getComputedStyle(J(r));
|
|
889
|
+
return parseFloat(a.getPropertyValue(`margin-${c}`));
|
|
890
|
+
}
|
|
891
|
+
function h() {
|
|
892
|
+
return n.map((a, S, C) => {
|
|
893
|
+
const L = !S, w = Ft(C, S);
|
|
894
|
+
return L ? m[S] + b : w ? m[S] + p : C[S + 1][u] - a[u];
|
|
895
|
+
}).map(N);
|
|
896
|
+
}
|
|
897
|
+
return {
|
|
898
|
+
slideSizes: m,
|
|
899
|
+
slideSizesWithGaps: v,
|
|
900
|
+
startGap: b,
|
|
901
|
+
endGap: p
|
|
902
|
+
};
|
|
903
|
+
}
|
|
904
|
+
function tn(t, e, n, r, i, s, o, u, c) {
|
|
905
|
+
const {
|
|
906
|
+
startEdge: l,
|
|
907
|
+
endEdge: b,
|
|
908
|
+
direction: p
|
|
909
|
+
} = t, m = kt(n);
|
|
910
|
+
function v(f, a) {
|
|
911
|
+
return mt(f).filter((S) => S % a === 0).map((S) => f.slice(S, S + a));
|
|
912
|
+
}
|
|
913
|
+
function d(f) {
|
|
914
|
+
return f.length ? mt(f).reduce((a, S, C) => {
|
|
915
|
+
const L = J(a) || 0, w = L === 0, y = S === bt(f), I = i[l] - s[L][l], E = i[l] - s[S][b], P = !r && w ? p(o) : 0, T = !r && y ? p(u) : 0, j = N(E - T - (I + P));
|
|
916
|
+
return C && j > e + c && a.push(S), y && a.push(f.length), a;
|
|
917
|
+
}, []).map((a, S, C) => {
|
|
918
|
+
const L = Math.max(C[S - 1] || 0);
|
|
919
|
+
return f.slice(L, a);
|
|
920
|
+
}) : [];
|
|
921
|
+
}
|
|
922
|
+
function g(f) {
|
|
923
|
+
return m ? v(f, n) : d(f);
|
|
924
|
+
}
|
|
925
|
+
return {
|
|
926
|
+
groupSlides: g
|
|
927
|
+
};
|
|
928
|
+
}
|
|
929
|
+
function en(t, e, n, r, i, s, o) {
|
|
930
|
+
const {
|
|
931
|
+
align: u,
|
|
932
|
+
axis: c,
|
|
933
|
+
direction: l,
|
|
934
|
+
startIndex: b,
|
|
935
|
+
loop: p,
|
|
936
|
+
duration: m,
|
|
937
|
+
dragFree: v,
|
|
938
|
+
dragThreshold: d,
|
|
939
|
+
inViewThreshold: g,
|
|
940
|
+
slidesToScroll: h,
|
|
941
|
+
skipSnaps: f,
|
|
942
|
+
containScroll: a,
|
|
943
|
+
watchResize: S,
|
|
944
|
+
watchSlides: C,
|
|
945
|
+
watchDrag: L,
|
|
946
|
+
watchFocus: w
|
|
947
|
+
} = s, y = 2, I = ze(), E = I.measure(e), P = n.map(I.measure), T = ke(c, l), j = T.measureSize(E), M = Ve(j), B = Ne(u, j), R = !p && !!a, q = p || !!a, {
|
|
948
|
+
slideSizes: X,
|
|
949
|
+
slideSizesWithGaps: _,
|
|
950
|
+
startGap: K,
|
|
951
|
+
endGap: ot
|
|
952
|
+
} = We(T, E, P, n, q, i), U = tn(T, j, h, p, E, P, K, ot, y), {
|
|
953
|
+
snaps: W,
|
|
954
|
+
snapsAligned: tt
|
|
955
|
+
} = qe(T, B, E, P, U), Q = -J(W) + J(_), {
|
|
956
|
+
snapsContained: rt,
|
|
957
|
+
scrollContainLimit: k
|
|
958
|
+
} = He(j, Q, tt, a, y), O = R ? rt : tt, {
|
|
959
|
+
limit: F
|
|
960
|
+
} = Ge(Q, O, p), $ = re(bt(O), b, p), H = $.clone(), A = mt(n), x = ({
|
|
961
|
+
dragHandler: at,
|
|
962
|
+
scrollBody: Et,
|
|
963
|
+
scrollBounds: Tt,
|
|
964
|
+
options: {
|
|
965
|
+
loop: vt
|
|
966
|
+
}
|
|
967
|
+
}) => {
|
|
968
|
+
vt || Tt.constrain(at.pointerDown()), Et.seek();
|
|
969
|
+
}, D = ({
|
|
970
|
+
scrollBody: at,
|
|
971
|
+
translate: Et,
|
|
972
|
+
location: Tt,
|
|
973
|
+
offsetLocation: vt,
|
|
974
|
+
previousLocation: de,
|
|
975
|
+
scrollLooper: pe,
|
|
976
|
+
slideLooper: me,
|
|
977
|
+
dragHandler: ge,
|
|
978
|
+
animation: he,
|
|
979
|
+
eventHandler: Gt,
|
|
980
|
+
scrollBounds: be,
|
|
981
|
+
options: {
|
|
982
|
+
loop: Ut
|
|
983
|
+
}
|
|
984
|
+
}, $t) => {
|
|
985
|
+
const qt = at.settled(), ve = !be.shouldConstrain(), _t = Ut ? qt : qt && ve, Kt = _t && !ge.pointerDown();
|
|
986
|
+
Kt && he.stop();
|
|
987
|
+
const Se = Tt.get() * $t + de.get() * (1 - $t);
|
|
988
|
+
vt.set(Se), Ut && (pe.loop(at.direction()), me.loop()), Et.to(vt.get()), Kt && Gt.emit("settle"), _t || Gt.emit("scroll");
|
|
989
|
+
}, z = Me(r, i, () => x(wt), (at) => D(wt, at)), G = 0.68, Y = O[$.get()], Z = ft(Y), st = ft(Y), et = ft(Y), it = ft(Y), ut = Be(Z, et, st, it, m, G), Ct = Ke(p, O, Q, F, it), Lt = Qe(z, $, H, ut, Ct, it, o), Bt = $e(F), Rt = ht(), le = Ze(e, n, o, g), {
|
|
990
|
+
slideRegistry: Ht
|
|
991
|
+
} = _e(R, a, O, k, U, A), fe = Je(t, n, Ht, Lt, ut, Rt, o, w), wt = {
|
|
992
|
+
ownerDocument: r,
|
|
993
|
+
ownerWindow: i,
|
|
994
|
+
eventHandler: o,
|
|
995
|
+
containerRect: E,
|
|
996
|
+
slideRects: P,
|
|
997
|
+
animation: z,
|
|
998
|
+
axis: T,
|
|
999
|
+
dragHandler: Oe(T, t, r, i, it, Fe(T, i), Z, z, Lt, ut, Ct, $, o, M, v, d, f, G, L),
|
|
1000
|
+
eventStore: Rt,
|
|
1001
|
+
percentOfView: M,
|
|
1002
|
+
index: $,
|
|
1003
|
+
indexPrevious: H,
|
|
1004
|
+
limit: F,
|
|
1005
|
+
location: Z,
|
|
1006
|
+
offsetLocation: et,
|
|
1007
|
+
previousLocation: st,
|
|
1008
|
+
options: s,
|
|
1009
|
+
resizeHandler: je(e, o, i, n, T, S, I),
|
|
1010
|
+
scrollBody: ut,
|
|
1011
|
+
scrollBounds: Re(F, et, it, ut, M),
|
|
1012
|
+
scrollLooper: Ue(Q, F, et, [Z, et, st, it]),
|
|
1013
|
+
scrollProgress: Bt,
|
|
1014
|
+
scrollSnapList: O.map(Bt.get),
|
|
1015
|
+
scrollSnaps: O,
|
|
1016
|
+
scrollTarget: Ct,
|
|
1017
|
+
scrollTo: Lt,
|
|
1018
|
+
slideLooper: Xe(T, j, Q, X, _, W, O, et, n),
|
|
1019
|
+
slideFocus: fe,
|
|
1020
|
+
slidesHandler: Ye(e, o, C),
|
|
1021
|
+
slidesInView: le,
|
|
1022
|
+
slideIndexes: A,
|
|
1023
|
+
slideRegistry: Ht,
|
|
1024
|
+
slidesToScroll: U,
|
|
1025
|
+
target: it,
|
|
1026
|
+
translate: se(T, e)
|
|
1027
|
+
};
|
|
1028
|
+
return wt;
|
|
1029
|
+
}
|
|
1030
|
+
function nn() {
|
|
1031
|
+
let t = {}, e;
|
|
1032
|
+
function n(l) {
|
|
1033
|
+
e = l;
|
|
1034
|
+
}
|
|
1035
|
+
function r(l) {
|
|
1036
|
+
return t[l] || [];
|
|
1037
|
+
}
|
|
1038
|
+
function i(l) {
|
|
1039
|
+
return r(l).forEach((b) => b(e, l)), c;
|
|
1040
|
+
}
|
|
1041
|
+
function s(l, b) {
|
|
1042
|
+
return t[l] = r(l).concat([b]), c;
|
|
1043
|
+
}
|
|
1044
|
+
function o(l, b) {
|
|
1045
|
+
return t[l] = r(l).filter((p) => p !== b), c;
|
|
1046
|
+
}
|
|
1047
|
+
function u() {
|
|
1048
|
+
t = {};
|
|
1049
|
+
}
|
|
1050
|
+
const c = {
|
|
1051
|
+
init: n,
|
|
1052
|
+
emit: i,
|
|
1053
|
+
off: o,
|
|
1054
|
+
on: s,
|
|
1055
|
+
clear: u
|
|
1056
|
+
};
|
|
1057
|
+
return c;
|
|
1058
|
+
}
|
|
1059
|
+
const on = {
|
|
1060
|
+
align: "center",
|
|
1061
|
+
axis: "x",
|
|
1062
|
+
container: null,
|
|
1063
|
+
slides: null,
|
|
1064
|
+
containScroll: "trimSnaps",
|
|
1065
|
+
direction: "ltr",
|
|
1066
|
+
slidesToScroll: 1,
|
|
1067
|
+
inViewThreshold: 0,
|
|
1068
|
+
breakpoints: {},
|
|
1069
|
+
dragFree: !1,
|
|
1070
|
+
dragThreshold: 10,
|
|
1071
|
+
loop: !1,
|
|
1072
|
+
skipSnaps: !1,
|
|
1073
|
+
duration: 25,
|
|
1074
|
+
startIndex: 0,
|
|
1075
|
+
active: !0,
|
|
1076
|
+
watchDrag: !0,
|
|
1077
|
+
watchResize: !0,
|
|
1078
|
+
watchSlides: !0,
|
|
1079
|
+
watchFocus: !0
|
|
1080
|
+
};
|
|
1081
|
+
function rn(t) {
|
|
1082
|
+
function e(s, o) {
|
|
1083
|
+
return oe(s, o || {});
|
|
1084
|
+
}
|
|
1085
|
+
function n(s) {
|
|
1086
|
+
const o = s.breakpoints || {}, u = gt(o).filter((c) => t.matchMedia(c).matches).map((c) => o[c]).reduce((c, l) => e(c, l), {});
|
|
1087
|
+
return e(s, u);
|
|
1088
|
+
}
|
|
1089
|
+
function r(s) {
|
|
1090
|
+
return s.map((o) => gt(o.breakpoints || {})).reduce((o, u) => o.concat(u), []).map(t.matchMedia);
|
|
1091
|
+
}
|
|
1092
|
+
return {
|
|
1093
|
+
mergeOptions: e,
|
|
1094
|
+
optionsAtMedia: n,
|
|
1095
|
+
optionsMediaQueries: r
|
|
1096
|
+
};
|
|
1097
|
+
}
|
|
1098
|
+
function sn(t) {
|
|
1099
|
+
let e = [];
|
|
1100
|
+
function n(s, o) {
|
|
1101
|
+
return e = o.filter(({
|
|
1102
|
+
options: u
|
|
1103
|
+
}) => t.optionsAtMedia(u).active !== !1), e.forEach((u) => u.init(s, t)), o.reduce((u, c) => Object.assign(u, {
|
|
1104
|
+
[c.name]: c
|
|
1105
|
+
}), {});
|
|
1106
|
+
}
|
|
1107
|
+
function r() {
|
|
1108
|
+
e = e.filter((s) => s.destroy());
|
|
1109
|
+
}
|
|
1110
|
+
return {
|
|
1111
|
+
init: n,
|
|
1112
|
+
destroy: r
|
|
1113
|
+
};
|
|
1114
|
+
}
|
|
1115
|
+
function St(t, e, n) {
|
|
1116
|
+
const r = t.ownerDocument, i = r.defaultView, s = rn(i), o = sn(s), u = ht(), c = nn(), {
|
|
1117
|
+
mergeOptions: l,
|
|
1118
|
+
optionsAtMedia: b,
|
|
1119
|
+
optionsMediaQueries: p
|
|
1120
|
+
} = s, {
|
|
1121
|
+
on: m,
|
|
1122
|
+
off: v,
|
|
1123
|
+
emit: d
|
|
1124
|
+
} = c, g = T;
|
|
1125
|
+
let h = !1, f, a = l(on, St.globalOptions), S = l(a), C = [], L, w, y;
|
|
1126
|
+
function I() {
|
|
1127
|
+
const {
|
|
1128
|
+
container: A,
|
|
1129
|
+
slides: x
|
|
1130
|
+
} = S;
|
|
1131
|
+
w = (At(A) ? t.querySelector(A) : A) || t.children[0];
|
|
1132
|
+
const z = At(x) ? w.querySelectorAll(x) : x;
|
|
1133
|
+
y = [].slice.call(z || w.children);
|
|
1134
|
+
}
|
|
1135
|
+
function E(A) {
|
|
1136
|
+
const x = en(t, w, y, r, i, A, c);
|
|
1137
|
+
if (A.loop && !x.slideLooper.canLoop()) {
|
|
1138
|
+
const D = Object.assign({}, A, {
|
|
1139
|
+
loop: !1
|
|
1140
|
+
});
|
|
1141
|
+
return E(D);
|
|
1142
|
+
}
|
|
1143
|
+
return x;
|
|
1144
|
+
}
|
|
1145
|
+
function P(A, x) {
|
|
1146
|
+
h || (a = l(a, A), S = b(a), C = x || C, I(), f = E(S), p([a, ...C.map(({
|
|
1147
|
+
options: D
|
|
1148
|
+
}) => D)]).forEach((D) => u.add(D, "change", T)), S.active && (f.translate.to(f.location.get()), f.animation.init(), f.slidesInView.init(), f.slideFocus.init(H), f.eventHandler.init(H), f.resizeHandler.init(H), f.slidesHandler.init(H), f.options.loop && f.slideLooper.loop(), w.offsetParent && y.length && f.dragHandler.init(H), L = o.init(H, C)));
|
|
1149
|
+
}
|
|
1150
|
+
function T(A, x) {
|
|
1151
|
+
const D = U();
|
|
1152
|
+
j(), P(l({
|
|
1153
|
+
startIndex: D
|
|
1154
|
+
}, A), x), c.emit("reInit");
|
|
1155
|
+
}
|
|
1156
|
+
function j() {
|
|
1157
|
+
f.dragHandler.destroy(), f.eventStore.clear(), f.translate.clear(), f.slideLooper.clear(), f.resizeHandler.destroy(), f.slidesHandler.destroy(), f.slidesInView.destroy(), f.animation.destroy(), o.destroy(), u.clear();
|
|
1158
|
+
}
|
|
1159
|
+
function M() {
|
|
1160
|
+
h || (h = !0, u.clear(), j(), c.emit("destroy"), c.clear());
|
|
1161
|
+
}
|
|
1162
|
+
function B(A, x, D) {
|
|
1163
|
+
!S.active || h || (f.scrollBody.useBaseFriction().useDuration(x === !0 ? 0 : S.duration), f.scrollTo.index(A, D || 0));
|
|
1164
|
+
}
|
|
1165
|
+
function R(A) {
|
|
1166
|
+
const x = f.index.add(1).get();
|
|
1167
|
+
B(x, A, -1);
|
|
1168
|
+
}
|
|
1169
|
+
function q(A) {
|
|
1170
|
+
const x = f.index.add(-1).get();
|
|
1171
|
+
B(x, A, 1);
|
|
1172
|
+
}
|
|
1173
|
+
function X() {
|
|
1174
|
+
return f.index.add(1).get() !== U();
|
|
1175
|
+
}
|
|
1176
|
+
function _() {
|
|
1177
|
+
return f.index.add(-1).get() !== U();
|
|
1178
|
+
}
|
|
1179
|
+
function K() {
|
|
1180
|
+
return f.scrollSnapList;
|
|
1181
|
+
}
|
|
1182
|
+
function ot() {
|
|
1183
|
+
return f.scrollProgress.get(f.offsetLocation.get());
|
|
1184
|
+
}
|
|
1185
|
+
function U() {
|
|
1186
|
+
return f.index.get();
|
|
1187
|
+
}
|
|
1188
|
+
function W() {
|
|
1189
|
+
return f.indexPrevious.get();
|
|
1190
|
+
}
|
|
1191
|
+
function tt() {
|
|
1192
|
+
return f.slidesInView.get();
|
|
1193
|
+
}
|
|
1194
|
+
function Q() {
|
|
1195
|
+
return f.slidesInView.get(!1);
|
|
1196
|
+
}
|
|
1197
|
+
function rt() {
|
|
1198
|
+
return L;
|
|
1199
|
+
}
|
|
1200
|
+
function k() {
|
|
1201
|
+
return f;
|
|
1202
|
+
}
|
|
1203
|
+
function O() {
|
|
1204
|
+
return t;
|
|
1205
|
+
}
|
|
1206
|
+
function F() {
|
|
1207
|
+
return w;
|
|
1208
|
+
}
|
|
1209
|
+
function $() {
|
|
1210
|
+
return y;
|
|
1211
|
+
}
|
|
1212
|
+
const H = {
|
|
1213
|
+
canScrollNext: X,
|
|
1214
|
+
canScrollPrev: _,
|
|
1215
|
+
containerNode: F,
|
|
1216
|
+
internalEngine: k,
|
|
1217
|
+
destroy: M,
|
|
1218
|
+
off: v,
|
|
1219
|
+
on: m,
|
|
1220
|
+
emit: d,
|
|
1221
|
+
plugins: rt,
|
|
1222
|
+
previousScrollSnap: W,
|
|
1223
|
+
reInit: g,
|
|
1224
|
+
rootNode: O,
|
|
1225
|
+
scrollNext: R,
|
|
1226
|
+
scrollPrev: q,
|
|
1227
|
+
scrollProgress: ot,
|
|
1228
|
+
scrollSnapList: K,
|
|
1229
|
+
scrollTo: B,
|
|
1230
|
+
selectedScrollSnap: U,
|
|
1231
|
+
slideNodes: $,
|
|
1232
|
+
slidesInView: tt,
|
|
1233
|
+
slidesNotInView: Q
|
|
1234
|
+
};
|
|
1235
|
+
return P(e, n), setTimeout(() => c.emit("init"), 0), H;
|
|
1236
|
+
}
|
|
1237
|
+
St.globalOptions = void 0;
|
|
1238
|
+
function zt(t = {}, e = []) {
|
|
1239
|
+
const n = Pt(t), r = Pt(e), [i, s] = nt(), [o, u] = nt(), c = lt(() => {
|
|
1240
|
+
i && i.reInit(n.current, r.current);
|
|
1241
|
+
}, [i]);
|
|
1242
|
+
return dt(() => {
|
|
1243
|
+
Mt(n.current, t) || (n.current = t, c());
|
|
1244
|
+
}, [t, c]), dt(() => {
|
|
1245
|
+
De(r.current, e) || (r.current = e, c());
|
|
1246
|
+
}, [e, c]), dt(() => {
|
|
1247
|
+
if (Te() && o) {
|
|
1248
|
+
St.globalOptions = zt.globalOptions;
|
|
1249
|
+
const l = St(o, n.current, r.current);
|
|
1250
|
+
return s(l), () => l.destroy();
|
|
1251
|
+
} else
|
|
1252
|
+
s(void 0);
|
|
1253
|
+
}, [o, s]), [u, i];
|
|
1254
|
+
}
|
|
1255
|
+
zt.globalOptions = void 0;
|
|
1256
|
+
const cn = ne(
|
|
1257
|
+
"ds:relative ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
|
|
1258
|
+
{
|
|
1259
|
+
variants: {
|
|
1260
|
+
size: {
|
|
1261
|
+
sm: "ds:[--carousel-item-inline-size:14rem]",
|
|
1262
|
+
md: "ds:[--carousel-item-inline-size:20rem]",
|
|
1263
|
+
lg: "ds:[--carousel-item-inline-size:28rem]"
|
|
1264
|
+
}
|
|
1265
|
+
},
|
|
1266
|
+
defaultVariants: { size: "md" }
|
|
1267
|
+
}
|
|
1268
|
+
), an = ne(
|
|
1269
|
+
[
|
|
1270
|
+
"ds:shrink-0 ds:basis-[var(--carousel-item-inline-size)]",
|
|
1271
|
+
"ds:min-w-0",
|
|
1272
|
+
"ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
|
|
1273
|
+
"ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
1274
|
+
"ds:rounded-[var(--radius-md)]"
|
|
1275
|
+
].join(" ")
|
|
1276
|
+
), ie = Ie(null);
|
|
1277
|
+
function ce(t) {
|
|
1278
|
+
const e = Ce(ie);
|
|
1279
|
+
if (!e)
|
|
1280
|
+
throw new Error(
|
|
1281
|
+
`[Carousel] \`${t}\` must be rendered inside <Carousel>.`
|
|
1282
|
+
);
|
|
1283
|
+
return e;
|
|
1284
|
+
}
|
|
1285
|
+
function un() {
|
|
1286
|
+
const [t, e] = nt(() => typeof window > "u" || !window.matchMedia ? !1 : window.matchMedia("(prefers-reduced-motion: reduce)").matches);
|
|
1287
|
+
return dt(() => {
|
|
1288
|
+
if (typeof window > "u" || !window.matchMedia) return;
|
|
1289
|
+
const n = window.matchMedia("(prefers-reduced-motion: reduce)"), r = () => e(n.matches);
|
|
1290
|
+
return n.addEventListener("change", r), () => n.removeEventListener("change", r);
|
|
1291
|
+
}, []), t;
|
|
1292
|
+
}
|
|
1293
|
+
function ln(t) {
|
|
1294
|
+
let e = null;
|
|
1295
|
+
const n = [];
|
|
1296
|
+
return te.forEach(t, (r) => {
|
|
1297
|
+
ee(r) && r.type.displayName === "Carousel.Header" ? e = r : n.push(r);
|
|
1298
|
+
}), { header: e, items: n };
|
|
1299
|
+
}
|
|
1300
|
+
const ae = xt(
|
|
1301
|
+
({
|
|
1302
|
+
children: t,
|
|
1303
|
+
size: e = "md",
|
|
1304
|
+
showControls: n = !0,
|
|
1305
|
+
showIndicators: r = !0,
|
|
1306
|
+
viewAllSlot: i,
|
|
1307
|
+
snap: s = "mandatory",
|
|
1308
|
+
id: o,
|
|
1309
|
+
className: u,
|
|
1310
|
+
"aria-label": c,
|
|
1311
|
+
...l
|
|
1312
|
+
}, b) => {
|
|
1313
|
+
const { t: p } = yt(), m = un(), v = xe(), d = `${o ?? v}-track`, g = `${o ?? v}-live`, h = Qt(
|
|
1314
|
+
() => ({
|
|
1315
|
+
align: "start",
|
|
1316
|
+
// `mandatory` → embla's default tight snap; `proximity` → free-scroll.
|
|
1317
|
+
dragFree: s === "proximity",
|
|
1318
|
+
// Reduced-motion disables embla's tween entirely (snap is instant).
|
|
1319
|
+
duration: m ? 0 : 25,
|
|
1320
|
+
// Prevents over-scroll at the ends so the last item snaps cleanly.
|
|
1321
|
+
containScroll: "trimSnaps"
|
|
1322
|
+
}),
|
|
1323
|
+
[s, m]
|
|
1324
|
+
), [f, a] = zt(h), [S, C] = nt(0), [L, w] = nt(0), [y, I] = nt(!1), [E, P] = nt(!1), [T, j] = nt(""), M = Pt("init");
|
|
1325
|
+
dt(() => {
|
|
1326
|
+
if (!a) return;
|
|
1327
|
+
w(a.scrollSnapList().length), C(a.selectedScrollSnap()), I(a.canScrollPrev()), P(a.canScrollNext());
|
|
1328
|
+
const k = () => {
|
|
1329
|
+
const H = a.selectedScrollSnap();
|
|
1330
|
+
C(H), I(a.canScrollPrev()), P(a.canScrollNext()), M.current === "control" && j(
|
|
1331
|
+
p("carousel.slideAnnouncement", {
|
|
1332
|
+
current: H + 1,
|
|
1333
|
+
total: a.scrollSnapList().length
|
|
1334
|
+
})
|
|
1335
|
+
);
|
|
1336
|
+
}, O = () => {
|
|
1337
|
+
M.current = "drag";
|
|
1338
|
+
}, F = () => {
|
|
1339
|
+
M.current = "init";
|
|
1340
|
+
}, $ = () => {
|
|
1341
|
+
w(a.scrollSnapList().length), C(a.selectedScrollSnap()), I(a.canScrollPrev()), P(a.canScrollNext());
|
|
1342
|
+
};
|
|
1343
|
+
return a.on("select", k), a.on("pointerDown", O), a.on("pointerUp", F), a.on("reInit", $), () => {
|
|
1344
|
+
a.off("select", k), a.off("pointerDown", O), a.off("pointerUp", F), a.off("reInit", $);
|
|
1345
|
+
};
|
|
1346
|
+
}, [a, p]);
|
|
1347
|
+
const B = lt(() => {
|
|
1348
|
+
a && (M.current = "control", a.scrollPrev());
|
|
1349
|
+
}, [a]), R = lt(() => {
|
|
1350
|
+
a && (M.current = "control", a.scrollNext());
|
|
1351
|
+
}, [a]), q = lt(
|
|
1352
|
+
(k) => {
|
|
1353
|
+
a && (M.current = "control", a.scrollTo(k));
|
|
1354
|
+
},
|
|
1355
|
+
[a]
|
|
1356
|
+
), X = lt(
|
|
1357
|
+
(k) => {
|
|
1358
|
+
if (a)
|
|
1359
|
+
switch (k.key) {
|
|
1360
|
+
case "ArrowRight":
|
|
1361
|
+
k.preventDefault(), a.scrollNext(), M.current = "control";
|
|
1362
|
+
break;
|
|
1363
|
+
case "ArrowLeft":
|
|
1364
|
+
k.preventDefault(), a.scrollPrev(), M.current = "control";
|
|
1365
|
+
break;
|
|
1366
|
+
case "Home":
|
|
1367
|
+
k.preventDefault(), a.scrollTo(0), M.current = "control";
|
|
1368
|
+
break;
|
|
1369
|
+
case "End":
|
|
1370
|
+
k.preventDefault(), a.scrollTo(a.scrollSnapList().length - 1), M.current = "control";
|
|
1371
|
+
break;
|
|
1372
|
+
case "PageDown":
|
|
1373
|
+
case "PageUp": {
|
|
1374
|
+
k.preventDefault();
|
|
1375
|
+
const O = a.slidesInView().length || 1, F = k.key === "PageDown" ? 1 : -1, $ = Math.max(
|
|
1376
|
+
0,
|
|
1377
|
+
Math.min(
|
|
1378
|
+
a.selectedScrollSnap() + F * O,
|
|
1379
|
+
a.scrollSnapList().length - 1
|
|
1380
|
+
)
|
|
1381
|
+
);
|
|
1382
|
+
a.scrollTo($), M.current = "control";
|
|
1383
|
+
break;
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
},
|
|
1387
|
+
[a]
|
|
1388
|
+
);
|
|
1389
|
+
ye(
|
|
1390
|
+
b,
|
|
1391
|
+
() => ({
|
|
1392
|
+
scrollTo: q,
|
|
1393
|
+
getActiveIndex: () => S,
|
|
1394
|
+
getCount: () => L,
|
|
1395
|
+
scrollPrev: B,
|
|
1396
|
+
scrollNext: R
|
|
1397
|
+
}),
|
|
1398
|
+
[q, B, R, S, L]
|
|
1399
|
+
);
|
|
1400
|
+
const { header: _, items: K } = ln(t), ot = K.length, U = Math.max(L, ot), W = n && U > 1 || i != null, tt = _ == null && W, Q = r && L > 1, rt = Qt(
|
|
1401
|
+
() => ({
|
|
1402
|
+
api: a,
|
|
1403
|
+
activeIndex: S,
|
|
1404
|
+
count: L,
|
|
1405
|
+
canScrollPrev: y,
|
|
1406
|
+
canScrollNext: E,
|
|
1407
|
+
scrollPrev: B,
|
|
1408
|
+
scrollNext: R,
|
|
1409
|
+
scrollToIndex: q,
|
|
1410
|
+
trackId: d
|
|
1411
|
+
}),
|
|
1412
|
+
[
|
|
1413
|
+
a,
|
|
1414
|
+
S,
|
|
1415
|
+
L,
|
|
1416
|
+
y,
|
|
1417
|
+
E,
|
|
1418
|
+
B,
|
|
1419
|
+
R,
|
|
1420
|
+
q,
|
|
1421
|
+
d
|
|
1422
|
+
]
|
|
1423
|
+
);
|
|
1424
|
+
return /* @__PURE__ */ V(ie.Provider, { value: rt, children: /* @__PURE__ */ Dt(
|
|
1425
|
+
"section",
|
|
1426
|
+
{
|
|
1427
|
+
...l,
|
|
1428
|
+
"aria-label": c ?? p("carousel.label", "Carousel"),
|
|
1429
|
+
"aria-roledescription": p("carousel.roleDescription", "carousel"),
|
|
1430
|
+
tabIndex: 0,
|
|
1431
|
+
onKeyDown: X,
|
|
1432
|
+
"data-component": "carousel",
|
|
1433
|
+
"data-component-id": o,
|
|
1434
|
+
"data-size": e,
|
|
1435
|
+
"data-state": m ? "reduced-motion" : void 0,
|
|
1436
|
+
className: cn({ size: e, className: u }),
|
|
1437
|
+
children: [
|
|
1438
|
+
_,
|
|
1439
|
+
tt ? /* @__PURE__ */ V("div", { className: "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-md)]", children: /* @__PURE__ */ Dt("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)] ds:ms-auto", children: [
|
|
1440
|
+
i,
|
|
1441
|
+
n && U > 1 ? /* @__PURE__ */ V(dn, {}) : null
|
|
1442
|
+
] }) }) : null,
|
|
1443
|
+
/* @__PURE__ */ V("div", { ref: f, className: "ds:overflow-hidden", children: /* @__PURE__ */ V(
|
|
1444
|
+
"div",
|
|
1445
|
+
{
|
|
1446
|
+
id: d,
|
|
1447
|
+
role: "presentation",
|
|
1448
|
+
className: "ds:flex ds:gap-[var(--spacing-md)]",
|
|
1449
|
+
children: te.map(K, (k, O) => ee(k) ? /* @__PURE__ */ V(fn, { index: O, total: U, children: k }) : k)
|
|
1450
|
+
}
|
|
1451
|
+
) }),
|
|
1452
|
+
Q ? /* @__PURE__ */ V(pn, {}) : null,
|
|
1453
|
+
/* @__PURE__ */ V(
|
|
1454
|
+
"div",
|
|
1455
|
+
{
|
|
1456
|
+
id: g,
|
|
1457
|
+
role: "status",
|
|
1458
|
+
"aria-live": "polite",
|
|
1459
|
+
"aria-atomic": "true",
|
|
1460
|
+
className: "ds:sr-only",
|
|
1461
|
+
children: T
|
|
1462
|
+
}
|
|
1463
|
+
)
|
|
1464
|
+
]
|
|
1465
|
+
}
|
|
1466
|
+
) });
|
|
1467
|
+
}
|
|
1468
|
+
);
|
|
1469
|
+
ae.displayName = "Carousel";
|
|
1470
|
+
const Vt = xt(
|
|
1471
|
+
({ children: t, className: e, ...n }, r) => /* @__PURE__ */ V(
|
|
1472
|
+
"div",
|
|
1473
|
+
{
|
|
1474
|
+
ref: r,
|
|
1475
|
+
...n,
|
|
1476
|
+
tabIndex: -1,
|
|
1477
|
+
className: an({ className: e }),
|
|
1478
|
+
children: t
|
|
1479
|
+
}
|
|
1480
|
+
)
|
|
1481
|
+
);
|
|
1482
|
+
Vt.displayName = "Carousel.Item";
|
|
1483
|
+
function fn({
|
|
1484
|
+
children: t,
|
|
1485
|
+
index: e,
|
|
1486
|
+
total: n
|
|
1487
|
+
}) {
|
|
1488
|
+
const { t: r } = yt(), i = t.props, s = i["aria-label"] ?? r("carousel.slideLabel", {
|
|
1489
|
+
current: e + 1,
|
|
1490
|
+
total: n,
|
|
1491
|
+
defaultValue: "{{current}} of {{total}}"
|
|
1492
|
+
}), o = {
|
|
1493
|
+
...i,
|
|
1494
|
+
role: "group",
|
|
1495
|
+
"aria-roledescription": r("carousel.slideRoleDescription", "slide"),
|
|
1496
|
+
"aria-label": s,
|
|
1497
|
+
"data-slide-index": e,
|
|
1498
|
+
"data-slide-id": i.id
|
|
1499
|
+
};
|
|
1500
|
+
return /* @__PURE__ */ V(Vt, { ...o });
|
|
1501
|
+
}
|
|
1502
|
+
const ue = xt(
|
|
1503
|
+
({ children: t, className: e, ...n }, r) => /* @__PURE__ */ V(
|
|
1504
|
+
"div",
|
|
1505
|
+
{
|
|
1506
|
+
ref: r,
|
|
1507
|
+
...n,
|
|
1508
|
+
className: [
|
|
1509
|
+
"ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-md)]",
|
|
1510
|
+
e
|
|
1511
|
+
].filter(Boolean).join(" "),
|
|
1512
|
+
children: t
|
|
1513
|
+
}
|
|
1514
|
+
)
|
|
1515
|
+
);
|
|
1516
|
+
ue.displayName = "Carousel.Header";
|
|
1517
|
+
function dn() {
|
|
1518
|
+
return /* @__PURE__ */ V(jt, {});
|
|
1519
|
+
}
|
|
1520
|
+
const jt = xt(({ className: t, ...e }, n) => {
|
|
1521
|
+
const { t: r } = yt(), { canScrollPrev: i, canScrollNext: s, scrollPrev: o, scrollNext: u, trackId: c } = ce("Carousel.Controls");
|
|
1522
|
+
return /* @__PURE__ */ Dt(
|
|
1523
|
+
"div",
|
|
1524
|
+
{
|
|
1525
|
+
ref: n,
|
|
1526
|
+
...e,
|
|
1527
|
+
className: [
|
|
1528
|
+
"ds:hidden ds:md:flex ds:items-center ds:gap-[var(--spacing-2xs)]",
|
|
1529
|
+
t
|
|
1530
|
+
].filter(Boolean).join(" "),
|
|
1531
|
+
children: [
|
|
1532
|
+
/* @__PURE__ */ V(
|
|
1533
|
+
Jt,
|
|
1534
|
+
{
|
|
1535
|
+
size: "sm",
|
|
1536
|
+
intent: "ghost",
|
|
1537
|
+
flipIconInRtl: !0,
|
|
1538
|
+
icon: /* @__PURE__ */ V(Le, { "aria-hidden": "true" }),
|
|
1539
|
+
"aria-controls": c,
|
|
1540
|
+
"aria-label": r("carousel.previous", "Previous slide"),
|
|
1541
|
+
disabled: !i,
|
|
1542
|
+
onClick: o
|
|
1543
|
+
}
|
|
1544
|
+
),
|
|
1545
|
+
/* @__PURE__ */ V(
|
|
1546
|
+
Jt,
|
|
1547
|
+
{
|
|
1548
|
+
size: "sm",
|
|
1549
|
+
intent: "ghost",
|
|
1550
|
+
flipIconInRtl: !0,
|
|
1551
|
+
icon: /* @__PURE__ */ V(we, { "aria-hidden": "true" }),
|
|
1552
|
+
"aria-controls": c,
|
|
1553
|
+
"aria-label": r("carousel.next", "Next slide"),
|
|
1554
|
+
disabled: !s,
|
|
1555
|
+
onClick: u
|
|
1556
|
+
}
|
|
1557
|
+
)
|
|
1558
|
+
]
|
|
1559
|
+
}
|
|
1560
|
+
);
|
|
1561
|
+
});
|
|
1562
|
+
jt.displayName = "Carousel.Controls";
|
|
1563
|
+
function pn() {
|
|
1564
|
+
const { t } = yt(), { activeIndex: e, count: n, scrollToIndex: r, trackId: i } = ce(
|
|
1565
|
+
"Carousel.Indicators"
|
|
1566
|
+
);
|
|
1567
|
+
return (
|
|
1568
|
+
// `<div role="tablist">` with direct `<button role="tab">` children.
|
|
1569
|
+
// axe's `aria-required-children` rejects `<li>` wrappers between the
|
|
1570
|
+
// tablist and its tabs, and the list semantic adds nothing the
|
|
1571
|
+
// tablist role doesn't already convey. Matches the WAI APG carousel
|
|
1572
|
+
// pattern.
|
|
1573
|
+
/* @__PURE__ */ V(
|
|
1574
|
+
"div",
|
|
1575
|
+
{
|
|
1576
|
+
role: "tablist",
|
|
1577
|
+
"aria-label": t("carousel.indicatorsLabel", "Slides"),
|
|
1578
|
+
className: "ds:flex ds:items-center ds:justify-center ds:gap-[var(--spacing-2xs)]",
|
|
1579
|
+
children: Array.from({ length: n }).map((s, o) => {
|
|
1580
|
+
const u = o === e;
|
|
1581
|
+
return /* @__PURE__ */ V(
|
|
1582
|
+
"button",
|
|
1583
|
+
{
|
|
1584
|
+
type: "button",
|
|
1585
|
+
role: "tab",
|
|
1586
|
+
"aria-controls": i,
|
|
1587
|
+
"aria-current": u ? "true" : void 0,
|
|
1588
|
+
"aria-label": t("carousel.goToSlide", {
|
|
1589
|
+
index: o + 1,
|
|
1590
|
+
defaultValue: "Go to slide {{index}}"
|
|
1591
|
+
}),
|
|
1592
|
+
onClick: () => r(o),
|
|
1593
|
+
"data-active": u ? "true" : void 0,
|
|
1594
|
+
className: [
|
|
1595
|
+
"ds:size-2 ds:rounded-[var(--radius-full)]",
|
|
1596
|
+
"ds:transition-[background-color,inline-size] ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
|
|
1597
|
+
"ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
|
|
1598
|
+
"ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
1599
|
+
u ? "ds:bg-[var(--primary)] ds:w-[length:var(--spacing-md)]" : "ds:bg-[var(--border)] ds:hover:bg-[var(--muted-foreground)]"
|
|
1600
|
+
].join(" ")
|
|
1601
|
+
},
|
|
1602
|
+
o
|
|
1603
|
+
);
|
|
1604
|
+
})
|
|
1605
|
+
}
|
|
1606
|
+
)
|
|
1607
|
+
);
|
|
1608
|
+
}
|
|
1609
|
+
const yn = Object.assign(ae, {
|
|
1610
|
+
Header: ue,
|
|
1611
|
+
Item: Vt,
|
|
1612
|
+
Controls: jt
|
|
1613
|
+
}), In = {
|
|
1614
|
+
id: "carousel",
|
|
1615
|
+
capabilities: ["navigate", "view_change"],
|
|
1616
|
+
state: {
|
|
1617
|
+
activeIndex: {
|
|
1618
|
+
type: "number",
|
|
1619
|
+
description: "Zero-based index of the currently snapped slide.",
|
|
1620
|
+
read: (t) => t.getActiveIndex()
|
|
1621
|
+
},
|
|
1622
|
+
count: {
|
|
1623
|
+
type: "number",
|
|
1624
|
+
description: "Total slide count.",
|
|
1625
|
+
read: (t) => t.getCount()
|
|
1626
|
+
}
|
|
1627
|
+
},
|
|
1628
|
+
actions: {
|
|
1629
|
+
scroll_to: {
|
|
1630
|
+
safety: "read",
|
|
1631
|
+
argsType: "{ index: number }",
|
|
1632
|
+
description: "Scroll to the slide at the given index.",
|
|
1633
|
+
invoke: (t, e) => {
|
|
1634
|
+
t.scrollTo(e.index);
|
|
1635
|
+
}
|
|
1636
|
+
},
|
|
1637
|
+
scroll_prev: {
|
|
1638
|
+
safety: "read",
|
|
1639
|
+
description: "Scroll to the previous slide.",
|
|
1640
|
+
invoke: (t) => {
|
|
1641
|
+
t.scrollPrev();
|
|
1642
|
+
}
|
|
1643
|
+
},
|
|
1644
|
+
scroll_next: {
|
|
1645
|
+
safety: "read",
|
|
1646
|
+
description: "Scroll to the next slide.",
|
|
1647
|
+
invoke: (t) => {
|
|
1648
|
+
t.scrollNext();
|
|
1649
|
+
}
|
|
1650
|
+
}
|
|
1651
|
+
},
|
|
1652
|
+
domHooks: {
|
|
1653
|
+
root: { attr: "data-component", value: "carousel" },
|
|
1654
|
+
instanceId: {
|
|
1655
|
+
attr: "data-component-id",
|
|
1656
|
+
sourceProp: "id",
|
|
1657
|
+
description: "Sourced from the id prop on Carousel."
|
|
1658
|
+
},
|
|
1659
|
+
item: {
|
|
1660
|
+
attr: "data-slide-id",
|
|
1661
|
+
description: "Each Carousel.Item emits its `id` prop as `data-slide-id`. `data-slide-index` carries the zero-based position alongside."
|
|
1662
|
+
}
|
|
1663
|
+
}
|
|
1664
|
+
};
|
|
1665
|
+
export {
|
|
1666
|
+
yn as C,
|
|
1667
|
+
In as c
|
|
1668
|
+
};
|
|
1669
|
+
//# sourceMappingURL=carousel.agent-OTn-kMQg.js.map
|