@alfadocs/ui-kit 0.24.0 → 0.25.0

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