@udixio/ui-react 0.3.6 → 0.3.8

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.
Files changed (4) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/index.js +2 -10838
  3. package/index.mjs +2823 -0
  4. package/package.json +2 -2
package/index.mjs ADDED
@@ -0,0 +1,2823 @@
1
+ import { jsx as i, jsxs as P, Fragment as te } from "react/jsx-runtime";
2
+ import { extendTailwindMerge as xe } from "tailwind-merge";
3
+ import W, { useState as S, useEffect as B, useRef as O, useLayoutEffect as ie, isValidElement as we, cloneElement as ve, useMemo as be } from "react";
4
+ import { motion as U, AnimatePresence as z, useScroll as Ne, useMotionValueEvent as oe, motionValue as ue, useTransform as re } from "motion/react";
5
+ import { createPortal as Le } from "react-dom";
6
+ import Ee from "react-textarea-autosize";
7
+ function fe(e) {
8
+ var t, r, n = "";
9
+ if (typeof e == "string" || typeof e == "number") n += e;
10
+ else if (typeof e == "object") if (Array.isArray(e)) {
11
+ var l = e.length;
12
+ for (t = 0; t < l; t++) e[t] && (r = fe(e[t])) && (n && (n += " "), n += r);
13
+ } else for (r in e) e[r] && (n && (n += " "), n += r);
14
+ return n;
15
+ }
16
+ function de() {
17
+ for (var e, t, r = 0, n = "", l = arguments.length; r < l; r++) (e = arguments[r]) && (t = fe(e)) && (n && (n += " "), n += t);
18
+ return n;
19
+ }
20
+ const me = xe({
21
+ override: {
22
+ classGroups: {
23
+ "text-color": [
24
+ {
25
+ text: [
26
+ (e) => !e.startsWith("display-") && !e.startsWith("headline-") && !e.startsWith("title-") && !e.startsWith("body-") && !e.startsWith("label-")
27
+ ]
28
+ }
29
+ ]
30
+ }
31
+ },
32
+ extend: {
33
+ classGroups: {
34
+ font: [
35
+ {
36
+ text: [
37
+ (e) => e.startsWith("display-") || e.startsWith("headline-") || e.startsWith("title-") || e.startsWith("body-") || e.startsWith("label-")
38
+ ]
39
+ }
40
+ ]
41
+ },
42
+ conflictingClassGroups: {
43
+ font: ["font"]
44
+ }
45
+ }
46
+ }), f = (...e) => me(de(e)), Ie = (...e) => me(de(e));
47
+ function ke(e) {
48
+ return e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
49
+ }
50
+ const Me = (e) => {
51
+ let t = {};
52
+ e.classNameList.forEach((n) => {
53
+ var l;
54
+ if (n)
55
+ if (typeof n == "string")
56
+ (t[l = e.default] ?? (t[l] = [])).push(n);
57
+ else {
58
+ const c = n(e.states);
59
+ Object.entries(c).map((o) => {
60
+ const [s, d] = o;
61
+ (t[s] ?? (t[s] = [])).push(d);
62
+ });
63
+ }
64
+ });
65
+ const r = t;
66
+ return Object.entries(t).map((n) => {
67
+ let [l, c] = n;
68
+ c = c.reverse(), l == e.default && c.unshift("relative"), c.unshift(ke(l)), r[l] = Ie(...c);
69
+ }), r;
70
+ }, H = (e, t) => (r) => Me({
71
+ classNameList: [r.className, t],
72
+ default: e,
73
+ states: r
74
+ }), Re = H(
75
+ "button",
76
+ ({
77
+ variant: e,
78
+ disabled: t,
79
+ iconPosition: r,
80
+ icon: n,
81
+ loading: l,
82
+ shape: c,
83
+ size: o,
84
+ allowShapeTransformation: s
85
+ }) => ({
86
+ button: f(
87
+ "group flex items-center cursor-pointer",
88
+ o === "xSmall" && "py-2",
89
+ o === "small" && "py-1",
90
+ e === "text" && [
91
+ o === "xSmall" && "-my-2",
92
+ o === "small" && "-my-1"
93
+ ]
94
+ ),
95
+ container: f(
96
+ " relative outline-none overflow-hidden inline-block flex justify-center items-center ",
97
+ o === "xSmall" && "text-label-large px-3 py-1.5 gap-1",
98
+ o === "small" && "text-label-large px-4 py-2.5 gap-2",
99
+ o === "medium" && "text-title-medium px-6 py-4 gap-2",
100
+ o === "large" && "text-headline-small px-12 py-8 gap-3",
101
+ o === "xLarge" && "text-headline-large px-16 py-12 gap-4",
102
+ c === "rounded" && {
103
+ "rounded-[30px]": o === "xSmall" || o == "small",
104
+ "rounded-[40px]": o === "medium",
105
+ "rounded-[70px]": o === "large" || o == "xLarge"
106
+ },
107
+ c === "squared" && {
108
+ "rounded-[12px]": o === "xSmall" || o == "small",
109
+ "rounded-[16px]": o === "medium",
110
+ "rounded-[28px]": o === "large" || o == "xLarge"
111
+ },
112
+ s && !t && {
113
+ "group-active:rounded-[12px]": o === "xSmall" || o == "small",
114
+ "group-active:rounded-[16px]": o === "medium",
115
+ "group-active:rounded-[28px]": o === "large" || o == "xLarge"
116
+ },
117
+ e === "elevated" && {
118
+ "bg-surface-container-low shadow-1 hover:shadow-2": !t
119
+ },
120
+ e === "filled" && {
121
+ "bg-primary hover:shadow-1": !t
122
+ },
123
+ e === "filledTonal" && {
124
+ "bg-secondary-container hover:shadow-1": !t
125
+ },
126
+ e === "outlined" && [
127
+ " border",
128
+ {
129
+ "border-on-surface/[0.12]": t,
130
+ " border-outline focus:border-primary": !t
131
+ }
132
+ ],
133
+ e === "text" && [
134
+ "w-fit",
135
+ {
136
+ "text-primary": !t,
137
+ "text-on-surface/[0.38]": t
138
+ },
139
+ o === "xSmall" && "-mx-3 ",
140
+ o === "small" && "-mx-4 ",
141
+ o === "medium" && "-mx-6 ",
142
+ o === "large" && "-mx-12",
143
+ o === "xLarge" && "-mx-16 "
144
+ // size === 'small' && ' -my-2.5',
145
+ // size === 'medium' && ' -my-4',
146
+ // size === 'large' && '-my-8',
147
+ // size === 'xLarge' && ' -my-12',
148
+ ],
149
+ t && "cursor-default"
150
+ ),
151
+ stateLayer: f(
152
+ "state-layer min-h-full min-w-full absolute top-0 left-0 ",
153
+ e === "elevated" && {
154
+ "bg-on-surface/[0.12]": t,
155
+ "group-state-primary": !t
156
+ },
157
+ e === "filled" && {
158
+ "bg-on-surface/[0.12]": t,
159
+ "group-state-on-primary": !t
160
+ },
161
+ e === "filledTonal" && {
162
+ "bg-on-surface/[0.12]": t,
163
+ "group-state-on-secondary-container ": !t
164
+ },
165
+ e === "outlined" && {
166
+ "group-state-primary group-state-primary": !t
167
+ },
168
+ e === "text" && {
169
+ "group-state-primary": !t
170
+ }
171
+ ),
172
+ label: f(
173
+ { invisible: l },
174
+ e === "elevated" && {
175
+ "text-primary": !t,
176
+ "text-on-surface/[38%]": t
177
+ },
178
+ e === "filled" && {
179
+ "text-on-primary": !t,
180
+ "text-on-surface/[38%]": t
181
+ },
182
+ e === "filledTonal" && {
183
+ "text-on-secondary-container": !t,
184
+ "text-on-surface/[0.38]": t
185
+ },
186
+ e === "outlined" && {
187
+ "text-primary": !t,
188
+ "text-on-surface/[0.38]": t
189
+ },
190
+ e === "text" && {
191
+ "text-primary": !t,
192
+ "text-on-surface/[0.38]": t
193
+ }
194
+ ),
195
+ icon: f(
196
+ { invisible: l },
197
+ o === "xSmall" && "size-5",
198
+ o === "small" && "size-5",
199
+ o === "medium" && "size-6",
200
+ o === "large" && "size-8",
201
+ o === "xLarge" && "size-10",
202
+ e === "elevated" && {
203
+ "text-primary": !t,
204
+ "text-on-surface/[38%]": t
205
+ },
206
+ e === "filled" && {
207
+ "text-on-primary": !t,
208
+ "text-on-surface/[38%]": t
209
+ },
210
+ e === "filledTonal" && {
211
+ "text-on-secondary-container": !t,
212
+ "text-on-surface/[0.38]": t
213
+ },
214
+ e === "outlined" && {
215
+ "text-primary": !t,
216
+ "text-on-surface/[0.38]": t
217
+ },
218
+ e === "text" && {
219
+ "text-primary": !t,
220
+ "text-on-surface/[0.38]": t
221
+ }
222
+ )
223
+ })
224
+ ), Se = H(
225
+ "card",
226
+ ({ variant: e, isInteractive: t }) => ({
227
+ card: f(
228
+ "card group/card rounded-xl overflow-hidden z-10",
229
+ e === "outlined" && "bg-surface",
230
+ e === "elevated" && "bg-surface-container-low shadow-1",
231
+ e === "filled" && "bg-surface-container-highest",
232
+ e !== "filled" && "border border-outline-variant"
233
+ ),
234
+ stateLayer: f([
235
+ "w-full top-0 left-0 h-full absolute -z-10",
236
+ {
237
+ " group-hover/card:hover-state-on-surface group-focus-visible/card:focus-state-on-surface": t
238
+ }
239
+ ])
240
+ })
241
+ ), Ce = H(
242
+ "carouselItem",
243
+ ({}) => ({
244
+ carouselItem: f("rounded-[28px] overflow-hidden flex-none")
245
+ })
246
+ ), Ve = H(
247
+ "carousel",
248
+ ({}) => ({
249
+ carousel: f(["w-full h-[400px]"]),
250
+ track: f(
251
+ "grid grid-flow-col h-full transition-transform ease-out w-fit"
252
+ )
253
+ })
254
+ ), Be = H(
255
+ "divider",
256
+ ({ orientation: e }) => ({
257
+ divider: f(
258
+ "border-outline-variant ",
259
+ {
260
+ "h-fit w-full border-t": e === "horizontal"
261
+ },
262
+ {
263
+ "h-auto self-stretch w-fit border-l": e === "vertical"
264
+ }
265
+ )
266
+ })
267
+ ), De = H(
268
+ "fab",
269
+ ({ size: e, variant: t, isExtended: r }) => ({
270
+ fab: f(
271
+ "flex shadow-3 hover:shadow-4 group overflow-hidden outline-none items-center cursor-pointer",
272
+ {
273
+ "rounded-[12px]": e == "small" && !r,
274
+ "rounded-[16px]": e == "medium" || r,
275
+ "rounded-[28px]": e == "large" && !r
276
+ },
277
+ {
278
+ "p-2": e == "small" && !r,
279
+ "p-4": e == "medium" || r,
280
+ "p-[30px]": e == "large" && !r
281
+ },
282
+ t === "surface" && "bg-surface-container",
283
+ t === "primary" && "bg-primary-container",
284
+ t === "secondary" && "bg-secondary-container",
285
+ t === "tertiary" && "bg-tertiary-container"
286
+ ),
287
+ stateLayer: f(
288
+ "absolute w-full h-full overflow-hidden left-1/2 top-1/2 transform -translate-y-1/2 -translate-x-1/2",
289
+ t === "surface" && "group-hover:hover-state-primary group-focus:focus-state-primary",
290
+ t === "primary" && "group-hover:hover-state-on-primary-container group-focus-visible:focus-state-on-primary-container",
291
+ t === "secondary" && "group-hover:hover-state-on-secondary-container group-focus-visible:focus-state-on-secondary-container",
292
+ t === "tertiary" && "group-hover:hover-state-on-tertiary-container group-focus-visible:focus-state-on-tertiary-container"
293
+ ),
294
+ icon: f(
295
+ {
296
+ "h-6 w-6": e == "small" || e == "medium" || r,
297
+ "h-9 w-9": e == "large" && !r
298
+ },
299
+ t === "surface" && "text-primary",
300
+ t === "primary" && "text-on-primary-container",
301
+ t === "secondary" && "text-on-secondary-container",
302
+ t === "tertiary" && "text-on-tertiary-container"
303
+ ),
304
+ label: f(
305
+ "text-label-large text-nowrap",
306
+ t === "surface" && "text-primary",
307
+ t === "primary" && "text-on-primary-container",
308
+ t === "secondary" && "text-on-secondary-container",
309
+ t === "tertiary" && "text-on-tertiary-container"
310
+ )
311
+ })
312
+ ), $e = H(
313
+ "iconButton",
314
+ ({
315
+ variant: e,
316
+ disabled: t,
317
+ onToggle: r,
318
+ isActive: n,
319
+ size: l,
320
+ width: c,
321
+ shape: o,
322
+ allowShapeTransformation: s
323
+ }) => ({
324
+ iconButton: f(
325
+ "group min-h-12 flex items-center cursor-pointer",
326
+ {
327
+ "cursor-default": t
328
+ }
329
+ ),
330
+ container: f(
331
+ "rounded-full relative flex overflow-hidden transition-all duration-300",
332
+ (o === "rounded" || o === "squared" && r && !t && n && s) && {
333
+ "rounded-[30px]": l === "xSmall" || l == "small",
334
+ "rounded-[40px]": l === "medium",
335
+ "rounded-[70px]": l === "large" || l == "xLarge"
336
+ },
337
+ (o === "squared" || o === "rounded" && r && !t && n && s) && {
338
+ "rounded-[12px]": l === "xSmall" || l == "small",
339
+ "rounded-[16px]": l === "medium",
340
+ "rounded-[28px]": l === "large" || l == "xLarge"
341
+ },
342
+ s && !t && {
343
+ "group-active:rounded-[12px]": l === "xSmall" || l == "small",
344
+ "group-active:rounded-[16px]": l === "medium",
345
+ "group-active:rounded-[28px]": l === "large" || l == "xLarge"
346
+ },
347
+ e === "filled" && [
348
+ !t && {
349
+ "bg-surface-container": !n && !!r,
350
+ "bg-primary": n || !r
351
+ },
352
+ !!t && "bg-on-surface/[0.12]"
353
+ ],
354
+ e === "tonal" && [
355
+ !t && {
356
+ "bg-surface-container": !n && !!r,
357
+ "bg-secondary-container": n || !r
358
+ },
359
+ !!t && "bg-on-surface/[0.12]"
360
+ ],
361
+ e === "outlined" && [
362
+ !t && {
363
+ "border border-outline": !n,
364
+ "border border-transparent bg-inverse-surface": n
365
+ },
366
+ !!t && {
367
+ "border border-on-surface/[0.12]": !n,
368
+ "border border-transparent bg-on-surface/[0.12]": n
369
+ }
370
+ ]
371
+ ),
372
+ stateLayer: f(
373
+ "absolute top-0 left-0 h-full w-full ",
374
+ !t && [
375
+ e === "standard" && {
376
+ "state-on-surface-variant": !n,
377
+ "state-primary": n
378
+ },
379
+ e === "filled" && {
380
+ "state-primary": !n && !!r,
381
+ "state-inverse-on-surface": n || !r
382
+ },
383
+ e === "tonal" && {
384
+ "state-on-surface-variant": !n && !!r,
385
+ "state-on-secondary-container": n || !r
386
+ },
387
+ e === "outlined" && {
388
+ "state-on-surface-variant": !n,
389
+ "state-on-primary": n
390
+ }
391
+ ]
392
+ ),
393
+ icon: f(
394
+ " transition-all duration-300",
395
+ { "size-5 p-1.5": l === "xSmall" },
396
+ { "size-6 p-2": l === "small" },
397
+ { "size-6 p-4": l === "medium" },
398
+ { "size-8 p-8": l === "large" },
399
+ { "size-10 p-12": l === "xLarge" },
400
+ c == "narrow" && [
401
+ { "px-1": l === "xSmall" },
402
+ { "px-1": l === "small" },
403
+ { "px-3": l === "medium" },
404
+ { "px-4": l === "large" },
405
+ { "px-8": l === "xLarge" }
406
+ ],
407
+ c == "wide" && [
408
+ { "px-2.5": l === "xSmall" },
409
+ { "px-3.5": l === "small" },
410
+ { "px-6": l === "medium" },
411
+ { "px-12": l === "large" },
412
+ { "px-[72px]": l === "xLarge" }
413
+ ],
414
+ !t && [
415
+ e === "standard" && {
416
+ "text-on-surface-variant": !n,
417
+ "text-primary": n
418
+ },
419
+ e === "filled" && {
420
+ "text-primary": !n && !!r,
421
+ "text-on-primary": n || !r
422
+ },
423
+ e === "tonal" && {
424
+ "text-on-surface-variant": !n && !!r,
425
+ "text-on-secondary-container": n || !r
426
+ },
427
+ e === "outlined" && {
428
+ "text-on-surface-variant": !n,
429
+ "text-inverse-on-surface": n
430
+ }
431
+ ],
432
+ !!t && "text-on-surface/[0.38]"
433
+ )
434
+ })
435
+ ), We = H(
436
+ "progressIndicator",
437
+ ({ variant: e, isVisible: t }) => ({
438
+ progressIndicator: f(
439
+ (e === "linear-determinate" || e == "linear-indeterminate") && "flex w-full"
440
+ ),
441
+ track: "h-full rounded-full bg-primary rounded-l-full",
442
+ activeIndicator: f(
443
+ (e === "linear-determinate" || e == "linear-indeterminate") && "h-full flex-1 rounded-full bg-primary-container",
444
+ (e === "circular-determinate" || e == "circular-indeterminate") && [
445
+ "stroke-primary fill-transparent ",
446
+ {
447
+ "stroke-[4px]": t,
448
+ "stroke-[0px]": !t
449
+ }
450
+ ]
451
+ ),
452
+ stop: "absolute right-0 bg-primary rounded-full"
453
+ })
454
+ ), Pe = H(
455
+ "slider",
456
+ ({ isChanging: e }) => ({
457
+ slider: f([
458
+ "relative w-full h-11 flex items-center rounded gap-x-1.5 cursor-pointer"
459
+ ]),
460
+ activeTrack: f([
461
+ "h-4 relative transition-all duration-100 bg-primary overflow-hidden rounded-l-full "
462
+ ]),
463
+ inactiveTrack: f([
464
+ "h-4 relative transition-all duration-100 bg-primary-container rounded-r-full overflow-hidden"
465
+ ]),
466
+ handle: f([
467
+ "transform transition-all duration-100 bg-primary h-full rounded-full ",
468
+ { "w-0.5": e, "w-1": !e }
469
+ ]),
470
+ valueIndicator: f([
471
+ "absolute select-none bg-inverse-surface text-inverse-on-surface py-3 px-4 text-label-large rounded-full bottom-[calc(100%+4px)] transform left-1/2 -translate-x-1/2"
472
+ ]),
473
+ dot: f([
474
+ "h-1 w-1 absolute transform -translate-y-1/2 -translate-x-1/2 top-1/2 rounded-full"
475
+ ])
476
+ })
477
+ ), Ue = H(
478
+ "snackbar",
479
+ ({}) => ({
480
+ snackbar: f(" rounded bg-inverse-surface "),
481
+ container: f(
482
+ "pl-4 pr-2 max-w-full py-1 flex items-center flex-wrap"
483
+ ),
484
+ supportingText: f("text-body-medium text-inverse-on-surface "),
485
+ icon: f(" ml-auto mr-0 text-inverse-on-surface block dark")
486
+ })
487
+ ), je = H(
488
+ "switch",
489
+ ({ isSelected: e, disabled: t, inactiveIcon: r }) => ({
490
+ switch: f(
491
+ "group w-[52px] h-[32px] outline-none rounded-full border-2 flex items-center",
492
+ { "bg-on-surface/[0.12] border-transparent": t },
493
+ !t && [
494
+ "cursor-pointer ",
495
+ { "bg-primary border-primary": e },
496
+ { "bg-surface-container border-outline": !e }
497
+ ]
498
+ // { 'justify-start': !isSelected },
499
+ // { 'justify-end': isSelected },
500
+ ),
501
+ handleContainer: f(
502
+ "flex items-center justify-center absolute",
503
+ { "left-[14px]": !e },
504
+ { "right-[14px]": e }
505
+ ),
506
+ handle: f(
507
+ "transition-all duration-100 z-10 rounded-full flex items-center justify-center",
508
+ { "w-[16px] h-[16px]": !e && !r },
509
+ { "w-[24px] h-[24px]": !(!e && !r) },
510
+ !t && [
511
+ "cursor-pointer group-active:h-[28px] group-active:w-[28px]",
512
+ { "bg-on-primary group-hover:bg-primary-container": e },
513
+ { "bg-outline group-hover:bg-on-surface-variant": !e }
514
+ ],
515
+ { "bg-surface": t }
516
+ ),
517
+ handleStateLayer: f(
518
+ "w-[40px] h-[40px] -z-10 rounded-full absolute",
519
+ { "group-state-primary": !t }
520
+ ),
521
+ icon: f(
522
+ "w-[16px] h-[16px]",
523
+ !t && [
524
+ { "text-on-primary-container": e },
525
+ { "text-on-primary": !e }
526
+ ],
527
+ { "text-on-surface/[0.38]": t }
528
+ )
529
+ })
530
+ ), Oe = H(
531
+ "tab",
532
+ ({ isSelected: e, icon: t, label: r, variant: n }) => ({
533
+ tab: f(
534
+ "bg-surface flex-1 group outline-none flex px-4 justify-center items-center cursor-pointer",
535
+ { "z-10": e },
536
+ !!(t && r) && n === "primary" && "h-16",
537
+ !(t && r && n === "primary") && "h-12"
538
+ ),
539
+ stateLayer: f(
540
+ "absolute w-full h-full overflow-hidden left-1/2 top-1/2 transform -translate-y-1/2 -translate-x-1/2",
541
+ n === "primary" && {
542
+ "group-hover:hover-state-on-surface group-focus-visible:focus-state-on-surface": !e,
543
+ "group-hover:hover-state-primary group-focus-visible:focus-state-primary": e
544
+ },
545
+ n === "secondary" && "group-hover:hover-state-on-surface group-focus-visible:focus-state-on-surface"
546
+ ),
547
+ content: f(
548
+ "flex gap-0.5 h-full justify-center",
549
+ {
550
+ relative: n == "primary"
551
+ },
552
+ {
553
+ "": !!(r && !t)
554
+ },
555
+ n === "primary" && "flex-col items-center",
556
+ n === "secondary" && {
557
+ "flex-col items-center": !(r && t),
558
+ "flex-row items-center gap-2": !!(r && t)
559
+ }
560
+ ),
561
+ icon: f(
562
+ "h-6 w-6 p-0.5 !box-border",
563
+ n === "primary" && {
564
+ "text-on-surface-variant": !e,
565
+ "text-primary": e
566
+ },
567
+ n === "secondary" && {
568
+ "text-on-surface-variant": !e,
569
+ "text-on-surface": e
570
+ }
571
+ ),
572
+ label: f(
573
+ "text-title-small text-nowrap",
574
+ n === "primary" && {
575
+ "text-on-surface-variant": !e,
576
+ "text-primary": e
577
+ },
578
+ n === "secondary" && {
579
+ "text-on-surface-variant": !e,
580
+ "text-on-surface": e
581
+ }
582
+ ),
583
+ underline: f(
584
+ "bg-primary absolute w-full left-0 bottom-0",
585
+ n === "primary" && "h-[3px] rounded-t",
586
+ n === "secondary" && "h-0.5"
587
+ )
588
+ })
589
+ ), Xe = H(
590
+ "tabs",
591
+ ({ scrollable: e }) => ({
592
+ tabs: f(
593
+ "border-b border-surface-container-highest",
594
+ "flex relative ",
595
+ { "overflow-x-auto": e }
596
+ )
597
+ })
598
+ ), Fe = H(
599
+ "textField",
600
+ ({
601
+ disabled: e,
602
+ leadingIcon: t,
603
+ trailingIcon: r,
604
+ variant: n,
605
+ errorText: l,
606
+ isFocused: c,
607
+ value: o,
608
+ suffix: s,
609
+ textLine: d
610
+ }) => ({
611
+ textField: f({
612
+ "opacity-[.38]": e
613
+ }),
614
+ content: f(
615
+ "group transition-border duration-200 relative flex items-center ",
616
+ { "h-14": d == "singleLine" },
617
+ {
618
+ "border-on-surface-variant": !(l != null && l.length) && !c && n == "filled",
619
+ "border-outline": !(l != null && l.length) && !c && n == "outlined",
620
+ "border-primary": !(l != null && l.length) && c,
621
+ "border-error": !!(l != null && l.length)
622
+ },
623
+ { "bg-on-surface/[0.04]": e },
624
+ n == "filled" && [
625
+ "rounded-t overflow-hidden border-b",
626
+ { "bg-surface-container-highest": !e }
627
+ ],
628
+ n == "outlined" && [
629
+ "border rounded box-border",
630
+ {
631
+ "border-[3px]": c
632
+ }
633
+ ]
634
+ ),
635
+ stateLayer: f(
636
+ "absolute -z-10 w-full h-full top-0 left-0",
637
+ {
638
+ hidden: n == "outlined"
639
+ },
640
+ {
641
+ "group-state-on-surface": !e,
642
+ "focus-state-on-surface": c
643
+ }
644
+ ),
645
+ label: f(
646
+ "inline-flex outline-none whitespace-nowrap",
647
+ { "text-on-surface-variant": !e && !(l != null && l.length) },
648
+ { "text-on-surface": e },
649
+ { "text-error": !!(l != null && l.length) },
650
+ { "text-primary": !(l != null && l.length) && c }
651
+ ),
652
+ input: f(
653
+ "w-full resize-none px-4 text-body-large bg-[inherit] outline-none autofill:transition-colors autofill:duration-[5000000ms]",
654
+ {
655
+ " text-on-surface placeholder:text-on-surface-variant": !e,
656
+ "placeholder:text-on-surface text-on-surface": e
657
+ },
658
+ {
659
+ "pr-0": !!s
660
+ },
661
+ n == "filled" && " pb-2 pt-6",
662
+ n == "outlined" && "py-4 relative z-10"
663
+ ),
664
+ activeIndicator: f(
665
+ "absolute w-0 inset-x-0 border-rounded mx-auto bottom-0",
666
+ n == "filled" && [
667
+ "h-[2px] transition-all duration-300",
668
+ { "bg-primary": !(l != null && l.length) },
669
+ { "bg-error": !!(l != null && l.length) },
670
+ { "!w-full": c }
671
+ ]
672
+ ),
673
+ supportingText: f(
674
+ " text-body-small px-4 pt-1",
675
+ { "text-on-surface-variant": !e && !(l != null && l.length) },
676
+ { "text-on-surface": e },
677
+ { "!w-full": c },
678
+ { "text-error": !!(l != null && l.length) }
679
+ ),
680
+ leadingIcon: f([
681
+ "h-12 ml-3 flex items-center justify-center",
682
+ { "cursor-text": !W.isValidElement(t) }
683
+ ]),
684
+ trailingIcon: f("h-12 w-12 flex items-center justify-center", {
685
+ "cursor-text": !W.isValidElement(r)
686
+ }),
687
+ suffix: f(
688
+ "text-on-surface-variant pl-0 pr-4",
689
+ n == "filled" && " pb-2 pt-6",
690
+ n == "outlined" && "py-4 relative z-10"
691
+ )
692
+ })
693
+ ), Ke = H(
694
+ "toolTip",
695
+ ({ position: e, variant: t }) => ({
696
+ toolTip: f(
697
+ " pointer-events-auto w-max z-10 absolute m-1 w-max-content max-w-[312px]",
698
+ {
699
+ "bottom-full left-1/2 -translate-x-1/2": e == "top",
700
+ "top-full left-1/2 -translate-x-1/2": e == "bottom",
701
+ "right-full top-1/2 -translate-y-1/2": e == "left",
702
+ "left-full top-1/2 -translate-y-1/2": e == "right",
703
+ "bottom-full right-full": e == "top-left",
704
+ "bottom-full left-full": e == "top-right",
705
+ "top-full right-full": e == "bottom-left",
706
+ "top-full left-full": e == "bottom-right"
707
+ }
708
+ ),
709
+ container: f(
710
+ "pb-2",
711
+ t == "rich" && "bg-surface-container rounded-2xl text-on-surface-container px-4 pt-3 shadow-2",
712
+ t == "plain" && "bg-inverse-surface rounded text-inverse-on-surface px-2 py-1"
713
+ ),
714
+ actions: f(
715
+ "flex gap-10 px-1 mt-2",
716
+ t == "plain" && "hidden"
717
+ ),
718
+ subHead: f(
719
+ "text-title-small mb-1",
720
+ t == "plain" && "hidden"
721
+ ),
722
+ supportingText: f("")
723
+ })
724
+ ), J = ({ icon: e, colors: t = [], className: r }) => {
725
+ const { icon: n } = e, [l, c, , , o] = n || [], s = (d) => {
726
+ switch (d.length) {
727
+ case 2:
728
+ return {
729
+ "--fa-primary-color": d[0] || "inherit",
730
+ "--fa-secondary-color": d[1] || "inherit"
731
+ };
732
+ case 1:
733
+ return { color: d[0] };
734
+ default:
735
+ return {};
736
+ }
737
+ };
738
+ return /* @__PURE__ */ i(
739
+ "svg",
740
+ {
741
+ className: f("size-5 box-content", r),
742
+ style: {
743
+ ...s(t)
744
+ },
745
+ xmlns: "http://www.w3.org/2000/svg",
746
+ viewBox: `0 0 ${l} ${c}`,
747
+ role: "img",
748
+ "aria-hidden": "true",
749
+ children: typeof o == "string" ? /* @__PURE__ */ i("path", { className: "fill-current", d: o }) : o.map((d, u) => /* @__PURE__ */ i("path", { d }, u))
750
+ }
751
+ );
752
+ }, Ge = ({
753
+ variant: e = "linear-determinate",
754
+ minHeight: t = 4,
755
+ value: r = 0,
756
+ transitionDuration: n = 1e3,
757
+ className: l,
758
+ ...c
759
+ }) => {
760
+ const [o, s] = S(r), [d, u] = S(1.5);
761
+ B(() => {
762
+ r > 100 && (r = 100), r < 0 && (r = 0), s(r);
763
+ }, [r]);
764
+ const [p, w] = S(!0), a = () => p ? d : d * 0.5;
765
+ B(() => {
766
+ if ((e === "circular-indeterminate" || e === "linear-indeterminate") && o !== 100) {
767
+ const L = setInterval(() => {
768
+ s(p ? 10 : 90), w(!p);
769
+ }, a() * 1e3);
770
+ return () => clearInterval(L);
771
+ }
772
+ }, [e, p, o]);
773
+ const [y, v] = S(!1);
774
+ B(() => {
775
+ if (o >= 100) {
776
+ const L = setTimeout(() => {
777
+ v(!1);
778
+ }, n);
779
+ return () => {
780
+ clearTimeout(L);
781
+ };
782
+ } else
783
+ v(!0);
784
+ }, [o, n]);
785
+ const b = We({
786
+ className: l,
787
+ variant: e,
788
+ value: r,
789
+ transitionDuration: n,
790
+ isVisible: y,
791
+ minHeight: t
792
+ });
793
+ return /* @__PURE__ */ P(te, { children: [
794
+ (e === "linear-determinate" || e == "linear-indeterminate") && /* @__PURE__ */ P(
795
+ "div",
796
+ {
797
+ style: { height: `${t}px` },
798
+ className: b.progressIndicator,
799
+ ...c,
800
+ children: [
801
+ /* @__PURE__ */ i(
802
+ "div",
803
+ {
804
+ style: {
805
+ height: y ? `${t}px` : "0px",
806
+ width: `${o}%`,
807
+ transition: `width 1ms ease-in-out ${o == 100 ? ", height 200ms 0.5s ease-in-out" : ""}`
808
+ },
809
+ className: b.track
810
+ }
811
+ ),
812
+ /* @__PURE__ */ i(
813
+ "div",
814
+ {
815
+ style: {
816
+ height: y ? `${t}px` : "0px",
817
+ marginLeft: o != 100 ? "6px" : "0px",
818
+ transition: `width ${n}ms ease-in-out ${o == 100 ? `, height 200ms 0.5s ease-in-out, margin-left ${n}ms ${n / 1.5}ms` : ""}`
819
+ },
820
+ className: b.activeIndicator
821
+ }
822
+ ),
823
+ /* @__PURE__ */ i(
824
+ "div",
825
+ {
826
+ style: {
827
+ height: y ? `${t}px` : "0px",
828
+ width: `${t}px`,
829
+ transition: `width ${n}ms ease-in-out, height 200ms 0.5s ease-in-out`
830
+ },
831
+ className: b.stop
832
+ }
833
+ )
834
+ ]
835
+ }
836
+ ),
837
+ (e === "circular-determinate" || e == "circular-indeterminate") && /* @__PURE__ */ i(
838
+ U.svg,
839
+ {
840
+ width: "48",
841
+ height: "48",
842
+ viewBox: "0 0 48 48",
843
+ initial: { rotate: -90 },
844
+ animate: { rotate: 270 },
845
+ transition: {
846
+ repeat: 1 / 0,
847
+ duration: a(),
848
+ ease: "linear"
849
+ },
850
+ className: b.progressIndicator,
851
+ ...c,
852
+ children: /* @__PURE__ */ i(
853
+ U.circle,
854
+ {
855
+ cx: "50%",
856
+ cy: "50%",
857
+ r: y ? "calc(50% - 2px)" : "50%",
858
+ style: {
859
+ strokeLinecap: "round"
860
+ },
861
+ initial: "hidden",
862
+ animate: "visible",
863
+ className: b.activeIndicator,
864
+ variants: {
865
+ hidden: {
866
+ pathLength: p ? 10 / 100 : 90 / 100
867
+ },
868
+ visible: {
869
+ pathLength: p ? 90 / 100 : 10 / 100
870
+ }
871
+ },
872
+ transition: {
873
+ pathLength: {
874
+ type: "tween",
875
+ ease: "linear",
876
+ duration: a(),
877
+ bounce: 0
878
+ }
879
+ }
880
+ }
881
+ )
882
+ },
883
+ p + ""
884
+ )
885
+ ] });
886
+ }, ne = ({
887
+ colorName: e = "on-surface",
888
+ triggerRef: t
889
+ }) => {
890
+ const r = {
891
+ initial: {
892
+ opacity: 0,
893
+ borderRadius: "50%",
894
+ width: "25%",
895
+ height: "25%"
896
+ },
897
+ animate: {
898
+ opacity: 1,
899
+ borderRadius: 0,
900
+ width: "200%",
901
+ height: "200%",
902
+ transition: {
903
+ duration: 0.3,
904
+ borderRadius: { duration: 0.3, delay: 0.3 }
905
+ }
906
+ }
907
+ }, [n, l] = S(!0), [c, o] = S(!1), [s, d] = S({ x: 0, y: 0 });
908
+ B(() => {
909
+ c && (l(!0), l(!1));
910
+ }, [c]), B(() => {
911
+ const a = t == null ? void 0 : t.current;
912
+ if (a)
913
+ return a.addEventListener("mousedown", u), a.addEventListener("mouseup", w), a.addEventListener("mouseleave", p), () => {
914
+ a.removeEventListener("mousedown", u), a.removeEventListener("mouseup", w), a.removeEventListener("mouseleave", p);
915
+ };
916
+ }, [t]);
917
+ const u = (a) => {
918
+ const y = t == null ? void 0 : t.current, v = y.getBoundingClientRect();
919
+ o(!0), d({
920
+ x: (a.clientX - v.left) / y.clientWidth * 100,
921
+ y: (a.clientY - v.top) / y.clientHeight * 100
922
+ });
923
+ }, p = (a) => {
924
+ o(!1);
925
+ }, w = (a) => {
926
+ o(!1);
927
+ };
928
+ return /* @__PURE__ */ i(z, { mode: "wait", children: (c || !c && !n) && /* @__PURE__ */ i(
929
+ U.div,
930
+ {
931
+ style: {
932
+ position: "absolute",
933
+ width: "100%",
934
+ height: "100%",
935
+ top: s.y + "%",
936
+ left: s.x + "%",
937
+ background: `color-mix(in srgb, var(--color-${e}) 12%, transparent)`,
938
+ pointerEvents: "none"
939
+ },
940
+ variants: r,
941
+ initial: "initial",
942
+ animate: "animate",
943
+ exit: { opacity: 0, transition: { duration: 0 } },
944
+ onAnimationComplete: () => l(!0),
945
+ className: "transform -translate-x-1/2 -translate-y-1/2"
946
+ }
947
+ ) });
948
+ };
949
+ function qe(e, t, r) {
950
+ var n = {}, l = n.noTrailing, c = l === void 0 ? !1 : l, o = n.noLeading, s = o === void 0 ? !1 : o, d = n.debounceMode, u = d === void 0 ? void 0 : d, p, w = !1, a = 0;
951
+ function y() {
952
+ p && clearTimeout(p);
953
+ }
954
+ function v(L) {
955
+ var E = L || {}, m = E.upcomingOnly, N = m === void 0 ? !1 : m;
956
+ y(), w = !N;
957
+ }
958
+ function b() {
959
+ for (var L = arguments.length, E = new Array(L), m = 0; m < L; m++)
960
+ E[m] = arguments[m];
961
+ var N = this, k = Date.now() - a;
962
+ if (w)
963
+ return;
964
+ function I() {
965
+ a = Date.now(), t.apply(N, E);
966
+ }
967
+ function C() {
968
+ p = void 0;
969
+ }
970
+ !s && u && !p && I(), y(), u === void 0 && k > e ? s ? (a = Date.now(), c || (p = setTimeout(u ? C : I, e))) : I() : c !== !0 && (p = setTimeout(u ? C : I, u === void 0 ? e - k : e));
971
+ }
972
+ return b.cancel = v, b;
973
+ }
974
+ const He = H(
975
+ "customScroll",
976
+ ({ orientation: e, draggable: t, isDragging: r }) => ({
977
+ customScroll: f(
978
+ "flex h-full w-full",
979
+ t && [
980
+ "[&::-webkit-scrollbar-track]:rounded-full",
981
+ "[&::-webkit-scrollbar-track]:bg-transparent",
982
+ "[&::-webkit-scrollbar-thumb]:rounded-full",
983
+ {
984
+ "[&::-webkit-scrollbar-thumb]:bg-outline": r,
985
+ "[&::-webkit-scrollbar-thumb]:bg-transparent": !r
986
+ },
987
+ { "[&::-webkit-scrollbar]:h-2": e === "horizontal" },
988
+ { "[&::-webkit-scrollbar]:w-2": e === "vertical" }
989
+ ],
990
+ {
991
+ "overflow-y-scroll flex-col": e === "vertical",
992
+ "overflow-x-scroll flex-row": e === "horizontal",
993
+ "cursor-grab": t && !r,
994
+ "cursor-grabbing": t && r
995
+ }
996
+ ),
997
+ track: f("overflow-hidden flex-none sticky", {
998
+ "left-0 h-full": e === "horizontal",
999
+ "top-0 w-full": e === "vertical"
1000
+ })
1001
+ })
1002
+ ), pe = ({
1003
+ children: e,
1004
+ orientation: t = "vertical",
1005
+ scrollSize: r,
1006
+ onScroll: n,
1007
+ className: l,
1008
+ draggable: c = !1,
1009
+ throttleDuration: o = 75
1010
+ }) => {
1011
+ var V, X;
1012
+ const s = O(null), d = O(null), [u, p] = S({
1013
+ width: null,
1014
+ height: null
1015
+ });
1016
+ B(() => {
1017
+ if (!s.current) return;
1018
+ const M = new ResizeObserver((F) => {
1019
+ for (const K of F)
1020
+ K.target === s.current && p({
1021
+ width: K.contentRect.width,
1022
+ height: K.contentRect.height
1023
+ // On observe aussi la hauteur maintenant
1024
+ });
1025
+ });
1026
+ return M.observe(s.current), () => {
1027
+ M.disconnect();
1028
+ };
1029
+ }, [s]);
1030
+ const w = O(null), a = O(null), y = () => {
1031
+ const M = d.current;
1032
+ return M ? {
1033
+ width: r ?? M.scrollWidth,
1034
+ height: r ?? M.scrollHeight
1035
+ } : null;
1036
+ }, v = () => {
1037
+ const M = s.current;
1038
+ return M ? {
1039
+ width: M.clientWidth,
1040
+ height: M.clientHeight
1041
+ // Correction ici pour retourner la bonne hauteur
1042
+ } : null;
1043
+ }, { scrollYProgress: b, scrollXProgress: L } = Ne({
1044
+ container: s
1045
+ }), E = O(null);
1046
+ E.current || (E.current = qe(
1047
+ o,
1048
+ (M, F) => {
1049
+ !a.current || !w.current || n && (t === "horizontal" && F === "x" && n({
1050
+ scrollProgress: M,
1051
+ scroll: M * w.current.width,
1052
+ scrollTotal: w.current.width,
1053
+ scrollVisible: a.current.width
1054
+ }), t === "vertical" && F === "y" && n({
1055
+ scrollProgress: M,
1056
+ scroll: M * w.current.height,
1057
+ scrollTotal: w.current.height,
1058
+ scrollVisible: a.current.height
1059
+ }));
1060
+ }
1061
+ ));
1062
+ const m = (M, F) => {
1063
+ E.current && E.current(M, F);
1064
+ };
1065
+ B(() => {
1066
+ u.width && m(L.get(), "x"), u.height && m(b.get(), "y");
1067
+ }, [u]), oe(L, "change", (M) => {
1068
+ m(M, "x");
1069
+ }), oe(b, "change", (M) => {
1070
+ m(M, "y");
1071
+ });
1072
+ const [N, k] = S(!1);
1073
+ ie(() => {
1074
+ N || !a.current || !w.current || !n || (n({
1075
+ scrollProgress: 0,
1076
+ scroll: 0,
1077
+ scrollTotal: t == "vertical" ? w.current.height : w.current.width,
1078
+ scrollVisible: t == "vertical" ? a.current.height : a.current.width
1079
+ }), k(!0));
1080
+ }, [a, w, n]), w.current = y(), a.current = v();
1081
+ const [I, C] = S(!1), D = He({
1082
+ isDragging: I,
1083
+ children: e,
1084
+ className: l,
1085
+ onScroll: n,
1086
+ orientation: t,
1087
+ scrollSize: r,
1088
+ draggable: c,
1089
+ throttleDuration: o
1090
+ }), [$, R] = S(0), [h, j] = S(0), A = (M) => {
1091
+ if (!c) return;
1092
+ const F = s.current;
1093
+ if (!F || $ == null) return;
1094
+ const Z = (M.pageX - F.offsetLeft - $) * 1.5;
1095
+ F.scrollLeft = h - Z;
1096
+ }, q = (M) => {
1097
+ const F = s.current;
1098
+ F && (C(!0), R(M.pageX - F.offsetLeft), j(F.scrollLeft));
1099
+ }, Y = (M) => {
1100
+ I && (M.preventDefault(), A(M));
1101
+ }, G = () => {
1102
+ C(!1);
1103
+ }, Q = () => {
1104
+ C(!1);
1105
+ }, x = (M) => {
1106
+ M.preventDefault();
1107
+ };
1108
+ B(() => {
1109
+ }, [I]);
1110
+ const g = O(null);
1111
+ return B(() => () => {
1112
+ g.current && clearTimeout(g.current);
1113
+ }, []), /* @__PURE__ */ P(
1114
+ "div",
1115
+ {
1116
+ className: D.customScroll,
1117
+ ref: s,
1118
+ onMouseDown: q,
1119
+ onMouseMove: Y,
1120
+ onMouseUp: G,
1121
+ onMouseLeave: Q,
1122
+ onDragStart: x,
1123
+ onScroll: (M) => {
1124
+ I || (R(null), C(!0), g.current && clearTimeout(g.current), g.current = setTimeout(() => {
1125
+ C(!1);
1126
+ }, 1e3));
1127
+ },
1128
+ children: [
1129
+ /* @__PURE__ */ i(
1130
+ "div",
1131
+ {
1132
+ ref: d,
1133
+ style: t === "vertical" ? { height: ((V = a == null ? void 0 : a.current) == null ? void 0 : V.height) ?? "100%" } : { width: ((X = a == null ? void 0 : a.current) == null ? void 0 : X.width) ?? "100%" },
1134
+ className: D.track,
1135
+ children: e
1136
+ }
1137
+ ),
1138
+ a.current && w.current && /* @__PURE__ */ P(te, { children: [
1139
+ t === "vertical" && w.current.height > a.current.height && /* @__PURE__ */ i(
1140
+ U.div,
1141
+ {
1142
+ className: "flex-none",
1143
+ style: {
1144
+ height: w.current.height - a.current.height
1145
+ }
1146
+ }
1147
+ ),
1148
+ t === "horizontal" && w.current.width > a.current.width && /* @__PURE__ */ i(
1149
+ U.div,
1150
+ {
1151
+ className: "flex-none",
1152
+ style: {
1153
+ width: w.current.width - a.current.width
1154
+ }
1155
+ }
1156
+ )
1157
+ ] })
1158
+ ]
1159
+ }
1160
+ );
1161
+ }, mt = ({
1162
+ children: e,
1163
+ transition: t = ".5s",
1164
+ orientation: r = "vertical",
1165
+ throttleDuration: n = 25,
1166
+ ...l
1167
+ }) => {
1168
+ const [c, o] = S(null), s = ue((c == null ? void 0 : c.scrollProgress) ?? 0), d = re(
1169
+ s,
1170
+ [0, 1],
1171
+ [0, 1 - ((c == null ? void 0 : c.scrollVisible) ?? 0) / ((c == null ? void 0 : c.scrollTotal) ?? 0)]
1172
+ ), u = re(
1173
+ d,
1174
+ (a) => `${-a * 100}%`
1175
+ ), p = (a) => {
1176
+ s.set(a.scrollProgress), a.scrollTotal > 0 && o(a);
1177
+ }, w = O(null);
1178
+ return oe(u, "change", (a) => {
1179
+ const y = performance.now();
1180
+ if (w.current !== null) {
1181
+ const v = y - w.current;
1182
+ console.log(`Delta temps : ${v} ms`);
1183
+ }
1184
+ w.current = y, console.log(a);
1185
+ }), /* @__PURE__ */ i(
1186
+ pe,
1187
+ {
1188
+ onScroll: p,
1189
+ throttleDuration: n,
1190
+ ...l,
1191
+ children: /* @__PURE__ */ i(
1192
+ U.div,
1193
+ {
1194
+ className: f("transition-transform ease-out", {
1195
+ "w-fit h-full": r === "horizontal",
1196
+ "h-fit w-full": r === "vertical"
1197
+ }),
1198
+ style: {
1199
+ transitionDuration: t,
1200
+ ...r == "vertical" ? { y: u } : { x: u }
1201
+ },
1202
+ children: e
1203
+ }
1204
+ )
1205
+ }
1206
+ );
1207
+ }, _e = ({
1208
+ targetRef: e,
1209
+ children: t
1210
+ }) => {
1211
+ const [r, n] = S(null), l = O(null), c = () => {
1212
+ const o = e.current;
1213
+ if (!o) return;
1214
+ const s = o.getBoundingClientRect();
1215
+ console.log(o), n({
1216
+ position: "fixed",
1217
+ top: s.top,
1218
+ left: s.left,
1219
+ width: s.width,
1220
+ height: s.height,
1221
+ pointerEvents: "none",
1222
+ // si le wrapper ne doit pas capter les events
1223
+ zIndex: 999
1224
+ // personnalise si besoin
1225
+ });
1226
+ };
1227
+ return B(() => {
1228
+ const o = e.current;
1229
+ if (o)
1230
+ return c(), window.addEventListener("scroll", c, !0), window.addEventListener("resize", c), l.current = new ResizeObserver(c), l.current.observe(o), () => {
1231
+ var s;
1232
+ window.removeEventListener("scroll", c, !0), window.removeEventListener("resize", c), (s = l.current) == null || s.disconnect();
1233
+ };
1234
+ }, [e]), r ? Le(/* @__PURE__ */ i("div", { style: r, children: t }), document.body) : null;
1235
+ }, Ae = ({
1236
+ variant: e = "filled",
1237
+ disabled: t = !1,
1238
+ icon: r,
1239
+ href: n,
1240
+ label: l,
1241
+ className: c,
1242
+ iconPosition: o = "left",
1243
+ loading: s = !1,
1244
+ shape: d = "rounded",
1245
+ onClick: u,
1246
+ ref: p,
1247
+ size: w = "medium",
1248
+ allowShapeTransformation: a = !0,
1249
+ transition: y,
1250
+ ...v
1251
+ }) => {
1252
+ const b = n ? "a" : "button", L = O(null), E = p || L, m = Re({
1253
+ allowShapeTransformation: a,
1254
+ size: w,
1255
+ shape: d,
1256
+ href: n,
1257
+ disabled: t,
1258
+ icon: r,
1259
+ iconPosition: o,
1260
+ label: l,
1261
+ loading: s,
1262
+ variant: e,
1263
+ transition: y,
1264
+ className: c
1265
+ }), N = r ? /* @__PURE__ */ i(J, { icon: r, className: m.icon }) : /* @__PURE__ */ i(te, {});
1266
+ return y = { duration: 0.3, ...y }, /* @__PURE__ */ i(
1267
+ b,
1268
+ {
1269
+ ref: E,
1270
+ href: n,
1271
+ className: m.button,
1272
+ ...v,
1273
+ onClick: (k) => {
1274
+ t ? k.preventDefault() : u && u(k);
1275
+ },
1276
+ disabled: t,
1277
+ children: /* @__PURE__ */ P(
1278
+ "div",
1279
+ {
1280
+ className: m.container,
1281
+ style: { transition: y.duration + "s" },
1282
+ children: [
1283
+ /* @__PURE__ */ i("div", { className: m.stateLayer, children: !t && /* @__PURE__ */ i(
1284
+ ne,
1285
+ {
1286
+ colorName: e === "elevated" && "primary" || e === "filled" && "on-primary" || e === "filledTonal" && "on-secondary-container" || e === "outlined" && "primary" || e === "text" && "primary" || "",
1287
+ triggerRef: E
1288
+ }
1289
+ ) }),
1290
+ o === "left" && N,
1291
+ s && /* @__PURE__ */ i(
1292
+ "div",
1293
+ {
1294
+ className: "!absolute left-1/2 -translate-x-1/2 top-1/2 -translate-y-1/2",
1295
+ children: /* @__PURE__ */ i(
1296
+ Ge,
1297
+ {
1298
+ className: () => ({
1299
+ progressIndicator: "h-6 w-6",
1300
+ activeIndicator: f(
1301
+ {
1302
+ "!stroke-primary": e === "elevated" && !t,
1303
+ "!stroke-on-surface/[38%]": e === "elevated" && t
1304
+ },
1305
+ {
1306
+ "!stroke-on-primary": e === "filled" && !t,
1307
+ "!stroke-on-surface/[38%]": e === "filled" && t
1308
+ },
1309
+ {
1310
+ "!stroke-on-secondary-container": e === "filledTonal" && !t,
1311
+ "!stroke-on-surface/[38%]": e === "filledTonal" && t
1312
+ },
1313
+ {
1314
+ "!stroke-primary": e === "outlined" && !t,
1315
+ "!stroke-on-surface/[38%]": e === "outlined" && t
1316
+ },
1317
+ {
1318
+ "!stroke-primary": e === "text" && !t,
1319
+ "!stroke-on-surface/[38%]": e === "text" && t
1320
+ }
1321
+ )
1322
+ }),
1323
+ variant: "circular-indeterminate"
1324
+ }
1325
+ )
1326
+ }
1327
+ ),
1328
+ /* @__PURE__ */ i("span", { className: m.label, children: l }),
1329
+ o === "right" && N
1330
+ ]
1331
+ }
1332
+ )
1333
+ }
1334
+ );
1335
+ }, pt = ({
1336
+ variant: e = "outlined",
1337
+ className: t,
1338
+ children: r,
1339
+ isInteractive: n = !1,
1340
+ ref: l,
1341
+ ...c
1342
+ }) => {
1343
+ const o = Se({ className: t, isInteractive: n, variant: e }), s = O(null), d = l || s;
1344
+ return /* @__PURE__ */ P("div", { ...c, ref: d, className: o.card, children: [
1345
+ /* @__PURE__ */ i("div", { className: o.stateLayer, children: n && /* @__PURE__ */ i(ne, { colorName: "on-surface", triggerRef: d }) }),
1346
+ r
1347
+ ] });
1348
+ }, Ye = (e, t, r = [0, 1]) => {
1349
+ const [n, l] = t, [c, o] = r, d = (Math.max(n, Math.min(e, l)) - n) / (l - n);
1350
+ return c + d * (o - c);
1351
+ }, Ze = ({
1352
+ className: e,
1353
+ children: t,
1354
+ width: r = 1,
1355
+ index: n = 0,
1356
+ ref: l,
1357
+ ...c
1358
+ }) => {
1359
+ const o = O(null), s = l || o, d = Ce({
1360
+ className: e,
1361
+ index: n,
1362
+ width: r,
1363
+ children: t
1364
+ });
1365
+ return /* @__PURE__ */ i(
1366
+ U.div,
1367
+ {
1368
+ ref: s,
1369
+ animate: { width: r + "px" },
1370
+ transition: {
1371
+ duration: 0.5,
1372
+ ease: "linear"
1373
+ },
1374
+ className: d.carouselItem,
1375
+ ...c,
1376
+ children: t
1377
+ }
1378
+ );
1379
+ }, ht = ({
1380
+ variant: e = "hero",
1381
+ className: t,
1382
+ children: r,
1383
+ ref: n,
1384
+ marginPourcent: l = 0,
1385
+ inputRange: c = [0.21, 0.65],
1386
+ outputRange: o = [42, 300],
1387
+ gap: s = 8,
1388
+ onChange: d,
1389
+ scrollSensitivity: u = 1.25,
1390
+ ...p
1391
+ }) => {
1392
+ var G, Q;
1393
+ const w = O(null), a = n || w, y = Ve({
1394
+ className: t,
1395
+ children: r,
1396
+ variant: e,
1397
+ inputRange: c,
1398
+ outputRange: o,
1399
+ marginPourcent: l,
1400
+ onChange: d,
1401
+ gap: s,
1402
+ scrollSensitivity: u
1403
+ }), v = W.Children.toArray(r).filter(
1404
+ (x) => W.isValidElement(x) && x.type === Ze
1405
+ ), b = O(null), [L, E] = S([]), [m, N] = S(null), k = () => {
1406
+ var F;
1407
+ if (!b.current || !a.current || !m) return [];
1408
+ const { scrollVisible: x, scrollProgress: g } = m;
1409
+ function V(K, Z) {
1410
+ return K.map(
1411
+ (T) => (T - Z) / Math.abs(K[1] - K[0])
1412
+ );
1413
+ }
1414
+ let X = v.map((K, Z) => {
1415
+ if (!I[Z].current || !b.current) return 0;
1416
+ let ee = Z / (v.length - 1);
1417
+ return ee > 1 && (ee = 1), ee < 0 && (ee = 0), ee;
1418
+ });
1419
+ X = V(X, g);
1420
+ let M = ((((F = a.current) == null ? void 0 : F.clientWidth) ?? x) - (o[0] + s)) / (o[1] + s);
1421
+ return X.map((K, Z) => ({ value: Math.abs(K), originalIndex: Z })).sort((K, Z) => K.value - Z.value).forEach((K, Z) => {
1422
+ Z === 0 && D(K.originalIndex);
1423
+ let T = Ye(M, [0, 1], [0, o[1]]);
1424
+ T < o[0] && (T = o[0]), M--, X[K.originalIndex] = T;
1425
+ }), X;
1426
+ }, I = O([]).current, [C, D] = S(0);
1427
+ B(() => {
1428
+ d && d(C);
1429
+ }, [C]), I.length !== v.length && v.forEach((x, g) => {
1430
+ I[g] || (I[g] = W.createRef());
1431
+ });
1432
+ const $ = v.map((x, g) => W.cloneElement(
1433
+ x,
1434
+ {
1435
+ width: L[g],
1436
+ ref: I[g],
1437
+ key: g,
1438
+ index: g
1439
+ }
1440
+ )), R = ue((m == null ? void 0 : m.scrollProgress) ?? 0), h = re(
1441
+ R,
1442
+ [0, 1],
1443
+ [
1444
+ 0,
1445
+ 1 - (((G = a.current) == null ? void 0 : G.clientWidth) ?? 0) / (((Q = b == null ? void 0 : b.current) == null ? void 0 : Q.clientWidth) ?? 0)
1446
+ ]
1447
+ ), j = re(
1448
+ h,
1449
+ (x) => `${-x * 100}%`
1450
+ ), A = (x) => {
1451
+ x.scrollTotal > 0 && N(x);
1452
+ };
1453
+ B(() => {
1454
+ const x = k();
1455
+ E(x);
1456
+ }, [m]);
1457
+ const [q, Y] = S(0);
1458
+ return ie(() => {
1459
+ let x = o[1];
1460
+ m && x > m.scrollVisible && (x = m.scrollVisible);
1461
+ const g = (x + s) * $.length / u;
1462
+ Y(g);
1463
+ }, [a, I, m]), /* @__PURE__ */ i("div", { className: y.carousel, ref: a, ...p, children: /* @__PURE__ */ i(
1464
+ pe,
1465
+ {
1466
+ draggable: !0,
1467
+ orientation: "horizontal",
1468
+ onScroll: A,
1469
+ scrollSize: q,
1470
+ children: /* @__PURE__ */ i(
1471
+ U.div,
1472
+ {
1473
+ className: y.track,
1474
+ ref: b,
1475
+ style: {
1476
+ transitionDuration: "0.5s",
1477
+ transitionTimingFunction: "ease-out",
1478
+ gap: `${s}px`,
1479
+ x: j
1480
+ },
1481
+ children: $
1482
+ }
1483
+ )
1484
+ }
1485
+ ) });
1486
+ }, yt = ({
1487
+ orientation: e = "horizontal",
1488
+ className: t,
1489
+ ...r
1490
+ }) => {
1491
+ const n = Be({ orientation: e, className: t });
1492
+ return /* @__PURE__ */ i("hr", { className: n.divider, ...r });
1493
+ }, _ = [];
1494
+ for (let e = 0; e < 256; ++e)
1495
+ _.push((e + 256).toString(16).slice(1));
1496
+ function Je(e, t = 0) {
1497
+ return (_[e[t + 0]] + _[e[t + 1]] + _[e[t + 2]] + _[e[t + 3]] + "-" + _[e[t + 4]] + _[e[t + 5]] + "-" + _[e[t + 6]] + _[e[t + 7]] + "-" + _[e[t + 8]] + _[e[t + 9]] + "-" + _[e[t + 10]] + _[e[t + 11]] + _[e[t + 12]] + _[e[t + 13]] + _[e[t + 14]] + _[e[t + 15]]).toLowerCase();
1498
+ }
1499
+ let le;
1500
+ const Qe = new Uint8Array(16);
1501
+ function ze() {
1502
+ if (!le) {
1503
+ if (typeof crypto > "u" || !crypto.getRandomValues)
1504
+ throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
1505
+ le = crypto.getRandomValues.bind(crypto);
1506
+ }
1507
+ return le(Qe);
1508
+ }
1509
+ const Te = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), se = { randomUUID: Te };
1510
+ function ae(e, t, r) {
1511
+ var l;
1512
+ if (se.randomUUID && !e)
1513
+ return se.randomUUID();
1514
+ e = e || {};
1515
+ const n = e.random ?? ((l = e.rng) == null ? void 0 : l.call(e)) ?? ze();
1516
+ if (n.length < 16)
1517
+ throw new Error("Random bytes length must be >= 16");
1518
+ return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, Je(n);
1519
+ }
1520
+ const he = ({
1521
+ variant: e = "plain",
1522
+ buttons: t,
1523
+ className: r,
1524
+ children: n,
1525
+ title: l,
1526
+ text: c,
1527
+ position: o,
1528
+ targetRef: s,
1529
+ ref: d,
1530
+ trigger: u = ["hover", "focus"],
1531
+ ...p
1532
+ }) => {
1533
+ if (!n && !s)
1534
+ throw new Error("ToolTip must have a child or a targetRef");
1535
+ Array.isArray(u) || (u = [u]), t && !Array.isArray(t) && (t = [t]);
1536
+ const w = O(null), a = s || w, [y, v] = S(null), [b] = S(ae()), [L, E] = S(!1), m = O(null);
1537
+ B(() => {
1538
+ const h = (j) => {
1539
+ v(j.detail);
1540
+ };
1541
+ return document.addEventListener("tooltip-update", h), () => {
1542
+ document.removeEventListener(
1543
+ "tooltip-update",
1544
+ h
1545
+ );
1546
+ };
1547
+ }, []), B(() => {
1548
+ m.current && clearTimeout(m.current), y ? E(y === b) : m.current = setTimeout(() => {
1549
+ E(!1);
1550
+ }, 1200);
1551
+ }, [y, b]);
1552
+ const N = () => {
1553
+ if (u.includes("hover")) {
1554
+ const h = new CustomEvent("tooltip-update", { detail: b });
1555
+ document.dispatchEvent(h);
1556
+ }
1557
+ }, k = () => {
1558
+ if (u.includes("hover")) {
1559
+ const h = new CustomEvent("tooltip-update", { detail: null });
1560
+ document.dispatchEvent(h);
1561
+ }
1562
+ }, I = () => {
1563
+ if (u.includes("click")) {
1564
+ const h = new CustomEvent("tooltip-update", {
1565
+ detail: L ? null : b
1566
+ });
1567
+ document.dispatchEvent(h);
1568
+ }
1569
+ }, C = () => {
1570
+ if (u.includes("focus")) {
1571
+ const h = new CustomEvent("tooltip-update", { detail: b });
1572
+ document.dispatchEvent(h);
1573
+ }
1574
+ }, D = () => {
1575
+ if (u.includes("focus")) {
1576
+ const h = new CustomEvent("tooltip-update", { detail: null });
1577
+ document.dispatchEvent(h);
1578
+ }
1579
+ };
1580
+ B(() => {
1581
+ if (a != null && a.current) {
1582
+ const h = a.current;
1583
+ return h.addEventListener("mouseenter", N), h.addEventListener("mouseleave", k), h.addEventListener("click", I), h.addEventListener("focus", C), h.addEventListener("blur", D), () => {
1584
+ h.removeEventListener("mouseenter", N), h.removeEventListener("mouseleave", k), h.removeEventListener("click", I), h.removeEventListener("focus", C), h.removeEventListener("blur", D);
1585
+ };
1586
+ }
1587
+ }, [a, u, b, L]);
1588
+ const $ = !s && we(n) ? ve(n, { ref: w }) : n;
1589
+ if (!o && typeof window < "u" && a != null && a.current && !o) {
1590
+ const h = a.current.getBoundingClientRect(), j = window.innerWidth, A = window.innerHeight, q = h.left / j, Y = h.top / A;
1591
+ e === "plain" ? q < 1 / 3 ? o = "right" : q > 2 / 3 ? o = "left" : o = Y > 0.5 ? "top" : "bottom" : q < 1 / 2 && Y < 1 / 2 ? o = "bottom-right" : q > 1 / 2 && Y < 1 / 2 ? o = "bottom-left" : q > 1 / 2 && Y > 1 / 2 ? o = "top-left" : q < 1 / 2 && Y > 1 / 2 && (o = "top-right");
1592
+ }
1593
+ const R = Ke({
1594
+ variant: e,
1595
+ buttons: t,
1596
+ className: r,
1597
+ title: l,
1598
+ text: c,
1599
+ position: o,
1600
+ trigger: u,
1601
+ targetRef: s,
1602
+ children: n
1603
+ });
1604
+ return /* @__PURE__ */ P(te, { children: [
1605
+ $,
1606
+ /* @__PURE__ */ i(z, { children: L && /* @__PURE__ */ i(_e, { targetRef: a, children: /* @__PURE__ */ i(
1607
+ U.div,
1608
+ {
1609
+ initial: { opacity: y ? 1 : 0 },
1610
+ animate: { opacity: 1 },
1611
+ transition: { duration: y ? 0 : 0.3 },
1612
+ exit: { opacity: y ? 1 : 0 },
1613
+ className: R.toolTip,
1614
+ ...p,
1615
+ onMouseEnter: N,
1616
+ onMouseLeave: k,
1617
+ children: /* @__PURE__ */ P(
1618
+ U.div,
1619
+ {
1620
+ className: R.container,
1621
+ layoutId: "tool-tip",
1622
+ transition: {
1623
+ type: "spring",
1624
+ stiffness: 200,
1625
+ damping: 20
1626
+ },
1627
+ children: [
1628
+ l && /* @__PURE__ */ i("div", { className: R.subHead, children: l }),
1629
+ /* @__PURE__ */ i("div", { className: R.supportingText, children: c }),
1630
+ t && /* @__PURE__ */ i("div", { className: R.actions, children: Array.isArray(t) && t.map((h, j) => /* @__PURE__ */ i(
1631
+ Ae,
1632
+ {
1633
+ size: "small",
1634
+ variant: "text",
1635
+ ...h
1636
+ },
1637
+ j
1638
+ )) })
1639
+ ]
1640
+ }
1641
+ )
1642
+ }
1643
+ ) }) })
1644
+ ] });
1645
+ }, ce = ({
1646
+ className: e,
1647
+ label: t,
1648
+ variant: r = "primary",
1649
+ size: n = "medium",
1650
+ href: l,
1651
+ type: c,
1652
+ icon: o,
1653
+ isExtended: s = !1,
1654
+ ref: d,
1655
+ transition: u,
1656
+ ...p
1657
+ }) => {
1658
+ const w = l ? "a" : "button", a = De({
1659
+ href: l,
1660
+ icon: o,
1661
+ isExtended: s,
1662
+ label: t,
1663
+ size: n,
1664
+ variant: r,
1665
+ className: e,
1666
+ transition: u
1667
+ });
1668
+ u = { duration: 0.3, ...u };
1669
+ const y = O(null), v = d || y, b = {
1670
+ visible: {
1671
+ width: "auto",
1672
+ marginLeft: 12,
1673
+ opacity: 1,
1674
+ transition: {
1675
+ ...u,
1676
+ opacity: {
1677
+ duration: u.duration / 2,
1678
+ delay: u.duration - u.duration / 2
1679
+ }
1680
+ }
1681
+ },
1682
+ hidden: {
1683
+ width: 0,
1684
+ marginLeft: 0,
1685
+ opacity: 0,
1686
+ transition: {
1687
+ ...u,
1688
+ marginLeft: {
1689
+ duration: u.duration / 2,
1690
+ delay: u.duration - u.duration / 2
1691
+ }
1692
+ }
1693
+ }
1694
+ };
1695
+ return /* @__PURE__ */ P(
1696
+ w,
1697
+ {
1698
+ ...p,
1699
+ ref: v,
1700
+ href: l,
1701
+ "aria-label": s ? void 0 : t,
1702
+ className: a.fab,
1703
+ children: [
1704
+ /* @__PURE__ */ i(
1705
+ he,
1706
+ {
1707
+ trigger: s ? null : void 0,
1708
+ text: t,
1709
+ targetRef: v
1710
+ }
1711
+ ),
1712
+ /* @__PURE__ */ i("span", { className: a.stateLayer, children: /* @__PURE__ */ i(
1713
+ ne,
1714
+ {
1715
+ colorName: f({
1716
+ primary: r == "surface",
1717
+ "on-primary-container": r == "primary",
1718
+ "on-secondary-container": r == "secondary",
1719
+ "on-tertiary-container": r == "tertiary"
1720
+ }),
1721
+ triggerRef: v
1722
+ }
1723
+ ) }),
1724
+ /* @__PURE__ */ i(J, { icon: o, className: a.icon }),
1725
+ /* @__PURE__ */ i(z, { children: s && /* @__PURE__ */ i(
1726
+ U.span,
1727
+ {
1728
+ variants: b,
1729
+ initial: "hidden",
1730
+ animate: "visible",
1731
+ exit: "hidden",
1732
+ className: a.label,
1733
+ children: t
1734
+ }
1735
+ ) })
1736
+ ]
1737
+ }
1738
+ );
1739
+ }, ye = ({
1740
+ variant: e = "standard",
1741
+ href: t,
1742
+ disabled: r = !1,
1743
+ type: n = "button",
1744
+ title: l,
1745
+ arialLabel: c,
1746
+ onToggle: o,
1747
+ activated: s = !1,
1748
+ onClick: d,
1749
+ icon: u,
1750
+ size: p = "medium",
1751
+ iconSelected: w,
1752
+ className: a,
1753
+ ref: y,
1754
+ width: v = "default",
1755
+ shape: b = "rounded",
1756
+ allowShapeTransformation: L = !0,
1757
+ transition: E,
1758
+ ...m
1759
+ }) => {
1760
+ l || (l = c);
1761
+ const [N, k] = W.useState(s);
1762
+ let I;
1763
+ o ? o && (I = (h) => {
1764
+ r && h.preventDefault(), k(!N), o(!!N);
1765
+ }, u = N && w || u) : I = (h) => {
1766
+ r && h.preventDefault(), d && d(h);
1767
+ }, B(() => {
1768
+ k(s);
1769
+ }, [s]);
1770
+ const C = t ? "a" : "button", D = $e({
1771
+ transition: E,
1772
+ shape: b,
1773
+ allowShapeTransformation: L,
1774
+ width: v,
1775
+ href: t,
1776
+ activated: s,
1777
+ arialLabel: c,
1778
+ iconSelected: w,
1779
+ isActive: N,
1780
+ onToggle: o,
1781
+ disabled: r,
1782
+ icon: u,
1783
+ variant: e,
1784
+ className: a,
1785
+ size: p,
1786
+ ...m
1787
+ }), $ = O(null), R = y || $;
1788
+ return E = { duration: 0.3, ...E }, /* @__PURE__ */ P(
1789
+ C,
1790
+ {
1791
+ disabled: r,
1792
+ href: t,
1793
+ className: D.iconButton,
1794
+ "aria-label": c,
1795
+ ...m,
1796
+ title: void 0,
1797
+ onClick: I,
1798
+ ref: R,
1799
+ children: [
1800
+ /* @__PURE__ */ i(
1801
+ he,
1802
+ {
1803
+ targetRef: R,
1804
+ trigger: r ? null : void 0,
1805
+ text: l
1806
+ }
1807
+ ),
1808
+ /* @__PURE__ */ P(
1809
+ "div",
1810
+ {
1811
+ style: { transition: E.duration + "s" },
1812
+ className: D.container,
1813
+ children: [
1814
+ /* @__PURE__ */ i("div", { className: D.stateLayer, children: !r && /* @__PURE__ */ i(
1815
+ ne,
1816
+ {
1817
+ colorName: f(
1818
+ e === "standard" && {
1819
+ "on-surface-variant": !N,
1820
+ primary: N
1821
+ },
1822
+ e === "filled" && {
1823
+ primary: !N && !!o,
1824
+ "inverse-on-surface": N || !o
1825
+ },
1826
+ e === "tonal" && {
1827
+ "on-surface-variant": !N && !!o,
1828
+ "on-secondary-container": N || !o
1829
+ },
1830
+ e === "outlined" && {
1831
+ "on-surface-variant": !N,
1832
+ "on-primary": N
1833
+ }
1834
+ ),
1835
+ triggerRef: R
1836
+ }
1837
+ ) }),
1838
+ u && /* @__PURE__ */ i(J, { icon: u, className: D.icon })
1839
+ ]
1840
+ }
1841
+ )
1842
+ ]
1843
+ }
1844
+ );
1845
+ }, gt = ({
1846
+ className: e,
1847
+ valueFormatter: t,
1848
+ step: r = 10,
1849
+ name: n,
1850
+ value: l = 0,
1851
+ min: c = 0,
1852
+ max: o = 100,
1853
+ marks: s = [
1854
+ {
1855
+ value: 0,
1856
+ label: "0"
1857
+ },
1858
+ {
1859
+ value: 100,
1860
+ label: "100"
1861
+ }
1862
+ ],
1863
+ ref: d,
1864
+ onChange: u,
1865
+ ...p
1866
+ }) => {
1867
+ const w = (x) => {
1868
+ const g = y(), V = a();
1869
+ return x === 1 / 0 ? 100 : x === -1 / 0 ? 0 : (x - g) / (V - g) * 100;
1870
+ }, a = (x = !1) => x ? o : o == 1 / 0 ? s[(s == null ? void 0 : s.length) - 1].value : o, y = (x = !1) => x ? c : c == -1 / 0 ? s[0].value : c, v = (x) => {
1871
+ const g = y(!1);
1872
+ return (a(!1) - g) * x / 100 + g;
1873
+ }, [b, L] = S(!1), E = O(null), m = d || E, [N, k] = S(l), [I, C] = S(w(l)), [D, $] = S(!1), R = (x) => {
1874
+ $(!0), L(!0), A(x);
1875
+ }, h = () => {
1876
+ $(!1), L(!1);
1877
+ };
1878
+ B(() => (D ? (window.addEventListener("mouseup", h), window.addEventListener("mousemove", A), window.addEventListener("touchend", h), window.addEventListener("touchmove", A)) : (window.removeEventListener("mouseup", h), window.removeEventListener("mousemove", A), window.removeEventListener("touchend", h), window.removeEventListener("touchmove", A)), () => {
1879
+ window.removeEventListener("mouseup", h), window.removeEventListener("mousemove", A), window.removeEventListener("touchend", h), window.removeEventListener("touchmove", A);
1880
+ }), [D]);
1881
+ const j = Pe({
1882
+ className: e,
1883
+ isChanging: b,
1884
+ marks: s,
1885
+ max: o,
1886
+ min: c,
1887
+ name: n,
1888
+ step: r,
1889
+ value: N,
1890
+ valueFormatter: t,
1891
+ onChange: u
1892
+ }), A = (x) => {
1893
+ const g = m == null ? void 0 : m.current;
1894
+ if (g) {
1895
+ const V = g.getBoundingClientRect().left;
1896
+ let M = ((x.type === "touchmove" || x.type === "touchstart" ? x.touches[0].clientX : x.clientX) - V) / g.offsetWidth * 100;
1897
+ q({ pourcent: M });
1898
+ }
1899
+ }, q = ({
1900
+ pourcent: x,
1901
+ value: g
1902
+ }) => {
1903
+ if (x) {
1904
+ if (x >= 100) {
1905
+ k(a(!0)), C(100);
1906
+ return;
1907
+ }
1908
+ if (x <= 0) {
1909
+ k(y(!0)), C(0);
1910
+ return;
1911
+ }
1912
+ g = v(x), g == y() && (g = y(!0)), g == a() && (g = a(!0));
1913
+ } else if (g != null) {
1914
+ if (g >= a()) {
1915
+ k(a(!0)), C(100);
1916
+ return;
1917
+ }
1918
+ if (g <= y()) {
1919
+ k(y(!0)), C(0);
1920
+ return;
1921
+ }
1922
+ x = w(g);
1923
+ } else
1924
+ return;
1925
+ r != null ? g = Math.round((g - y()) / r) * r + y() : s && (g = s.reduce((V, X, M) => {
1926
+ let F = X.value === 1 / 0 ? a() : X.value === -1 / 0 ? y() : X.value, K = V.value === 1 / 0 ? a() : V.value === -1 / 0 ? y() : V.value;
1927
+ return F = Math.abs(F - g), K = Math.abs(K - g), F < K ? X : V;
1928
+ }).value), g >= a() && (g = a(!0)), g <= y() && (g = y(!0)), x = w(g), k(g), C(x), u && u(g);
1929
+ }, [Y, G] = S(0);
1930
+ return B(() => {
1931
+ const x = () => {
1932
+ m.current && G(m.current.offsetWidth);
1933
+ };
1934
+ return x(), window.addEventListener("resize", x), () => {
1935
+ window.removeEventListener("resize", x);
1936
+ };
1937
+ }, []), /* @__PURE__ */ P(
1938
+ "div",
1939
+ {
1940
+ tabIndex: 0,
1941
+ onKeyDown: (x) => {
1942
+ switch (x.key) {
1943
+ case "ArrowRight":
1944
+ if (r)
1945
+ q({ value: N + r });
1946
+ else if (s) {
1947
+ const g = s.find((V) => V.value > N);
1948
+ g && q({ value: g.value });
1949
+ }
1950
+ break;
1951
+ case "ArrowLeft":
1952
+ if (r)
1953
+ q({ value: N - r });
1954
+ else if (s) {
1955
+ const g = s.slice(0).reverse().find((V, X, M) => N === 1 / 0 ? X === 1 : V.value < N);
1956
+ g && q({ value: g.value });
1957
+ }
1958
+ break;
1959
+ default:
1960
+ return;
1961
+ }
1962
+ },
1963
+ role: "slider",
1964
+ "aria-valuemin": y(!0),
1965
+ "aria-valuemax": a(!0),
1966
+ "aria-valuenow": N,
1967
+ "aria-valuetext": N.toString(),
1968
+ className: j.slider,
1969
+ onMouseDown: R,
1970
+ onClick: A,
1971
+ ref: m,
1972
+ onTouchStart: R,
1973
+ onDragStart: (x) => x.preventDefault(),
1974
+ ...p,
1975
+ children: [
1976
+ /* @__PURE__ */ i("input", { type: "hidden", name: n, value: N }),
1977
+ /* @__PURE__ */ i(
1978
+ "div",
1979
+ {
1980
+ className: j.activeTrack,
1981
+ style: { flex: I / 100 }
1982
+ }
1983
+ ),
1984
+ /* @__PURE__ */ i("div", { className: j.handle, children: /* @__PURE__ */ i(z, { children: b && /* @__PURE__ */ i(
1985
+ U.div,
1986
+ {
1987
+ className: j.valueIndicator,
1988
+ initial: "hidden",
1989
+ animate: "visible",
1990
+ exit: "hidden",
1991
+ style: {
1992
+ translate: "-50%",
1993
+ transformOrigin: "center bottom",
1994
+ textWrap: "nowrap"
1995
+ },
1996
+ variants: {
1997
+ visible: { opacity: 1, scale: 1 },
1998
+ hidden: { opacity: 1, scale: 0 }
1999
+ },
2000
+ transition: { duration: 0.1 },
2001
+ children: t ? t(N) : N
2002
+ }
2003
+ ) }) }),
2004
+ /* @__PURE__ */ i(
2005
+ "div",
2006
+ {
2007
+ className: j.inactiveTrack,
2008
+ style: { flex: 1 - I / 100 }
2009
+ }
2010
+ ),
2011
+ /* @__PURE__ */ i(
2012
+ "div",
2013
+ {
2014
+ className: "w-[calc(100%-12px)] h-full absolute -translate-x-1/2 transform left-1/2",
2015
+ children: s && s.map((x, g) => {
2016
+ let V = null;
2017
+ const X = (b ? 9 : 10) / Y * 100, M = w(x.value);
2018
+ return M <= I - X ? V = !0 : M >= I + X && (V = !1), /* @__PURE__ */ i(
2019
+ "div",
2020
+ {
2021
+ className: f(j.dot, {
2022
+ "bg-primary-container": V != null && V,
2023
+ "bg-primary": V != null && !V
2024
+ }),
2025
+ style: {
2026
+ left: `${w(x.value)}%`
2027
+ }
2028
+ },
2029
+ g
2030
+ );
2031
+ })
2032
+ }
2033
+ )
2034
+ ]
2035
+ }
2036
+ );
2037
+ };
2038
+ /*!
2039
+ * Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com
2040
+ * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
2041
+ * Copyright 2024 Fonticons, Inc.
2042
+ */
2043
+ const et = {
2044
+ prefix: "fas",
2045
+ iconName: "bars",
2046
+ icon: [448, 512, ["navicon"], "f0c9", "M0 96C0 78.3 14.3 64 32 64l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 128C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32L32 448c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"]
2047
+ }, tt = {
2048
+ prefix: "fas",
2049
+ iconName: "circle-exclamation",
2050
+ icon: [512, 512, ["exclamation-circle"], "f06a", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]
2051
+ }, ge = {
2052
+ prefix: "fas",
2053
+ iconName: "xmark",
2054
+ icon: [384, 512, [128473, 10005, 10006, 10060, 215, "close", "multiply", "remove", "times"], "f00d", "M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"]
2055
+ }, xt = ({
2056
+ supportingText: e,
2057
+ className: t,
2058
+ duration: r,
2059
+ closeIcon: n = ge,
2060
+ onClose: l,
2061
+ ...c
2062
+ }) => {
2063
+ const [o, s] = S(!0), d = Ue({
2064
+ className: t,
2065
+ closeIcon: n,
2066
+ duration: r,
2067
+ isVisible: o,
2068
+ onClose: l,
2069
+ supportingText: e
2070
+ });
2071
+ B(() => {
2072
+ r && setTimeout(() => {
2073
+ u();
2074
+ }, r);
2075
+ }, [r]);
2076
+ const u = () => {
2077
+ s(!1), l == null || l();
2078
+ };
2079
+ return /* @__PURE__ */ i(z, { children: o && /* @__PURE__ */ i(
2080
+ U.div,
2081
+ {
2082
+ initial: { height: 0 },
2083
+ animate: { height: "auto" },
2084
+ exit: { height: 0 },
2085
+ transition: { duration: 0.1 },
2086
+ className: d.snackbar,
2087
+ ...c,
2088
+ children: /* @__PURE__ */ P("div", { className: d.container, children: [
2089
+ /* @__PURE__ */ i("p", { className: d.supportingText, children: e }),
2090
+ /* @__PURE__ */ i(
2091
+ ye,
2092
+ {
2093
+ onClick: () => u(),
2094
+ className: d.icon,
2095
+ icon: n,
2096
+ arialLabel: "close the snackbar"
2097
+ }
2098
+ )
2099
+ ] })
2100
+ }
2101
+ ) });
2102
+ }, wt = ({
2103
+ selected: e = !1,
2104
+ className: t,
2105
+ activeIcon: r,
2106
+ disabled: n = !1,
2107
+ inactiveIcon: l,
2108
+ onChange: c,
2109
+ onClick: o,
2110
+ onKeyDown: s,
2111
+ ref: d,
2112
+ ...u
2113
+ }) => {
2114
+ const [p, w] = S(e), a = (m) => {
2115
+ n || (v(), o && o(m));
2116
+ }, y = (m) => {
2117
+ n || ((m.key === " " || m.key === "Enter") && (m.preventDefault(), v()), s && s(m));
2118
+ }, v = () => {
2119
+ w(!p), c == null || c(!p);
2120
+ }, b = je({
2121
+ className: t,
2122
+ isSelected: p,
2123
+ activeIcon: r,
2124
+ inactiveIcon: l,
2125
+ disabled: n,
2126
+ selected: p,
2127
+ onChange: c
2128
+ }), L = O(null), E = d || L;
2129
+ return /* @__PURE__ */ P(
2130
+ U.div,
2131
+ {
2132
+ role: "switch",
2133
+ "aria-checked": p,
2134
+ tabIndex: n ? -1 : 0,
2135
+ onKeyDown: y,
2136
+ onClick: a,
2137
+ ref: E,
2138
+ className: b.switch,
2139
+ ...u,
2140
+ children: [
2141
+ /* @__PURE__ */ i("input", { type: "hidden", value: p ? "1" : "0" }),
2142
+ /* @__PURE__ */ P(
2143
+ U.div,
2144
+ {
2145
+ layout: !0,
2146
+ style: { translate: p ? "50%" : "-50%" },
2147
+ transition: {
2148
+ type: "spring",
2149
+ stiffness: 700,
2150
+ damping: 30
2151
+ },
2152
+ className: b.handleContainer,
2153
+ children: [
2154
+ /* @__PURE__ */ i("div", { className: b.handle, children: (p ? r : l) && /* @__PURE__ */ i(
2155
+ J,
2156
+ {
2157
+ className: b.icon,
2158
+ icon: p ? r : l
2159
+ }
2160
+ ) }),
2161
+ /* @__PURE__ */ i("div", { className: b.handleStateLayer })
2162
+ ]
2163
+ }
2164
+ )
2165
+ ]
2166
+ }
2167
+ );
2168
+ }, nt = ({
2169
+ className: e,
2170
+ onClick: t,
2171
+ label: r,
2172
+ variant: n = "primary",
2173
+ href: l,
2174
+ icon: c,
2175
+ selectedTab: o,
2176
+ setSelectedTab: s,
2177
+ tabsId: d,
2178
+ index: u,
2179
+ onTabSelected: p,
2180
+ scrollable: w = !1,
2181
+ selected: a = !1,
2182
+ ref: y,
2183
+ ...v
2184
+ }) => {
2185
+ const b = O(null), L = y || b, [E, m] = S(a);
2186
+ B(() => {
2187
+ a && o == null ? m(!0) : m(o == u && u != null);
2188
+ }, [o]), B(() => {
2189
+ o == u && p && p({
2190
+ ref: L,
2191
+ index: u || 0,
2192
+ label: r,
2193
+ icon: c
2194
+ });
2195
+ }, [o]);
2196
+ const N = l ? "a" : "button", k = (C) => {
2197
+ s && s(u ?? null), t && t(C);
2198
+ }, I = Oe({
2199
+ className: e,
2200
+ onTabSelected: p,
2201
+ scrollable: w,
2202
+ selectedTab: o,
2203
+ index: u,
2204
+ tabsId: d,
2205
+ selected: E,
2206
+ variant: n,
2207
+ icon: c,
2208
+ label: r,
2209
+ isSelected: E,
2210
+ setSelectedTab: s,
2211
+ href: l
2212
+ });
2213
+ return /* @__PURE__ */ P(
2214
+ N,
2215
+ {
2216
+ ...v,
2217
+ role: "tab",
2218
+ "aria-selected": E,
2219
+ ref: L,
2220
+ href: l,
2221
+ className: I.tab,
2222
+ onClick: k,
2223
+ ...v,
2224
+ children: [
2225
+ /* @__PURE__ */ i("span", { className: I.stateLayer, children: /* @__PURE__ */ i(
2226
+ ne,
2227
+ {
2228
+ colorName: n === "primary" && E ? "primary" : "on-surface",
2229
+ triggerRef: L
2230
+ }
2231
+ ) }),
2232
+ /* @__PURE__ */ P("span", { className: I.content, children: [
2233
+ c && /* @__PURE__ */ i(J, { icon: c, className: I.icon }),
2234
+ /* @__PURE__ */ i("span", { className: I.label, children: r }),
2235
+ E && /* @__PURE__ */ i(
2236
+ U.span,
2237
+ {
2238
+ layoutId: `underline-${d}`,
2239
+ className: I.underline,
2240
+ transition: { duration: 0.3 }
2241
+ }
2242
+ )
2243
+ ] })
2244
+ ]
2245
+ }
2246
+ );
2247
+ }, vt = ({
2248
+ variant: e = "primary",
2249
+ onTabSelected: t,
2250
+ children: r,
2251
+ className: n,
2252
+ selectedTab: l,
2253
+ setSelectedTab: c,
2254
+ scrollable: o = !1
2255
+ }) => {
2256
+ const [s, d] = S(
2257
+ null
2258
+ );
2259
+ let u;
2260
+ l == 0 || l != null ? u = l : u = s;
2261
+ const p = c || d, w = W.Children.toArray(r).filter(
2262
+ (L) => W.isValidElement(L) && L.type === nt
2263
+ ), a = W.useRef(null), y = (L) => {
2264
+ if (t == null || t(L), o) {
2265
+ const E = a.current, m = L.ref.current;
2266
+ if (E && m) {
2267
+ const N = m.offsetLeft + m.offsetWidth / 2 - E.offsetWidth / 2;
2268
+ E.scrollTo({ left: N, behavior: "smooth" });
2269
+ }
2270
+ }
2271
+ }, v = be(() => ae(), []), b = Xe({
2272
+ children: r,
2273
+ onTabSelected: t,
2274
+ scrollable: o,
2275
+ selectedTab: u,
2276
+ setSelectedTab: p,
2277
+ className: n,
2278
+ variant: e
2279
+ });
2280
+ return /* @__PURE__ */ i("div", { ref: a, role: "tablist", className: b.tabs, children: w.map((L, E) => W.cloneElement(L, {
2281
+ key: E,
2282
+ index: E,
2283
+ variant: e,
2284
+ selectedTab: u,
2285
+ setSelectedTab: p,
2286
+ tabsId: v,
2287
+ onTabSelected: y,
2288
+ scrollable: o
2289
+ })) });
2290
+ }, bt = ({
2291
+ variant: e = "filled",
2292
+ disabled: t = !1,
2293
+ errorText: r,
2294
+ placeholder: n,
2295
+ suffix: l,
2296
+ name: c,
2297
+ label: o,
2298
+ className: s,
2299
+ supportingText: d,
2300
+ trailingIcon: u,
2301
+ leadingIcon: p,
2302
+ type: w = "text",
2303
+ textLine: a = "singleLine",
2304
+ autoComplete: y = "on",
2305
+ onChange: v,
2306
+ value: b,
2307
+ showSupportingText: L = !1,
2308
+ ...E
2309
+ }) => {
2310
+ const [m, N] = S(b ?? ""), [k, I] = S(!1), [C, D] = S(!1), [$, R] = S(
2311
+ L
2312
+ );
2313
+ B(() => {
2314
+ N(b ?? "");
2315
+ }, [b]), B(() => {
2316
+ r != null && r.length ? D(!0) : D(!1);
2317
+ }, [r]), B(() => {
2318
+ L ? R(L) : d != null && d.length ? R(!0) : R(!1);
2319
+ }, [$, d]), B(() => {
2320
+ k && D(!1);
2321
+ }, [k]);
2322
+ const h = W.useRef(null), j = () => {
2323
+ h.current && !k && h.current.focus();
2324
+ }, A = () => {
2325
+ I(!0);
2326
+ }, q = (V) => {
2327
+ const X = V.target.value;
2328
+ N(X), D(!1), typeof v == "function" && v(X);
2329
+ }, Y = () => {
2330
+ I(!1);
2331
+ }, G = Fe({
2332
+ showSupportingText: $,
2333
+ isFocused: k,
2334
+ showErrorIcon: C,
2335
+ disabled: t,
2336
+ name: c,
2337
+ label: o,
2338
+ autoComplete: y,
2339
+ className: s,
2340
+ onChange: v,
2341
+ placeholder: n,
2342
+ supportingText: d,
2343
+ type: w,
2344
+ leadingIcon: p,
2345
+ trailingIcon: u,
2346
+ variant: e,
2347
+ errorText: r,
2348
+ value: m,
2349
+ suffix: l,
2350
+ textLine: a
2351
+ }), [Q] = S(ae());
2352
+ let x, g;
2353
+ switch (a) {
2354
+ case "multiLine":
2355
+ g = Ee, x = {};
2356
+ break;
2357
+ case "textAreas":
2358
+ g = "textarea", x = {};
2359
+ break;
2360
+ case "singleLine":
2361
+ default:
2362
+ g = "input", x = { type: w };
2363
+ break;
2364
+ }
2365
+ return /* @__PURE__ */ P("div", { className: G.textField, ...E, children: [
2366
+ /* @__PURE__ */ P("fieldset", { onClick: j, className: G.content, children: [
2367
+ /* @__PURE__ */ i("div", { className: G.stateLayer }),
2368
+ p && /* @__PURE__ */ i("div", { className: G.leadingIcon, children: W.isValidElement(p) ? p : /* @__PURE__ */ i(J, { className: "w-5 h-5", icon: p }) }),
2369
+ !(!k && !m.length || e == "filled") && /* @__PURE__ */ i(
2370
+ U.legend,
2371
+ {
2372
+ variants: {
2373
+ hidden: { width: 0, padding: 0 },
2374
+ visible: { width: "auto", padding: "0 8px" }
2375
+ },
2376
+ initial: "hidden",
2377
+ animate: !k && !m.length ? "hidden" : "visible",
2378
+ className: "max-w-full ml-2 px-2 text-body-small h-0",
2379
+ transition: { duration: 0.2 },
2380
+ children: /* @__PURE__ */ i("span", { className: "transform inline-flex -translate-y-1/2", children: /* @__PURE__ */ i(
2381
+ U.span,
2382
+ {
2383
+ className: G.label,
2384
+ transition: { duration: 0.3 },
2385
+ layoutId: Q,
2386
+ children: o
2387
+ }
2388
+ ) })
2389
+ }
2390
+ ),
2391
+ /* @__PURE__ */ P("div", { className: "flex-1 relative", children: [
2392
+ (!k && !m.length || e == "filled") && /* @__PURE__ */ i(
2393
+ U.label,
2394
+ {
2395
+ htmlFor: c,
2396
+ className: f(
2397
+ "absolute left-4 transition-all duration-300",
2398
+ {
2399
+ "text-body-small top-2": e == "filled" && !(!k && !m.length),
2400
+ "text-body-large top-1/2 transform -translate-y-1/2": !(e == "filled" && !(!k && !m.length))
2401
+ }
2402
+ ),
2403
+ transition: { duration: 0.3 },
2404
+ children: /* @__PURE__ */ i(
2405
+ U.span,
2406
+ {
2407
+ className: G.label,
2408
+ transition: { duration: 0.3 },
2409
+ layoutId: e == "outlined" ? Q : void 0,
2410
+ children: o
2411
+ }
2412
+ )
2413
+ }
2414
+ ),
2415
+ /* @__PURE__ */ i(
2416
+ g,
2417
+ {
2418
+ ref: h,
2419
+ value: m,
2420
+ onChange: q,
2421
+ className: G.input,
2422
+ id: c,
2423
+ name: c,
2424
+ placeholder: k ? n ?? void 0 : "",
2425
+ onFocus: A,
2426
+ onBlur: Y,
2427
+ disabled: t,
2428
+ autoComplete: y,
2429
+ "aria-invalid": !!(r != null && r.length),
2430
+ "aria-label": o,
2431
+ ...x
2432
+ }
2433
+ )
2434
+ ] }),
2435
+ /* @__PURE__ */ i("div", { className: G.activeIndicator }),
2436
+ !C && /* @__PURE__ */ P(te, { children: [
2437
+ u && /* @__PURE__ */ i(
2438
+ "div",
2439
+ {
2440
+ onClick: (V) => {
2441
+ V.stopPropagation();
2442
+ },
2443
+ className: G.trailingIcon,
2444
+ children: W.isValidElement(u) ? u : /* @__PURE__ */ i(J, { className: "h-5", icon: u })
2445
+ }
2446
+ ),
2447
+ !u && l && /* @__PURE__ */ i("span", { className: G.suffix, children: l })
2448
+ ] }),
2449
+ C && /* @__PURE__ */ i(
2450
+ "div",
2451
+ {
2452
+ className: f(G.trailingIcon, {
2453
+ " absolute right-0": !u
2454
+ }),
2455
+ children: /* @__PURE__ */ i(
2456
+ J,
2457
+ {
2458
+ className: "h-5 text-error",
2459
+ icon: tt
2460
+ }
2461
+ )
2462
+ }
2463
+ )
2464
+ ] }),
2465
+ $ && /* @__PURE__ */ i("p", { className: G.supportingText, children: r != null && r.length ? r : d != null && d.length ? d : " " })
2466
+ ] });
2467
+ }, rt = H(
2468
+ "navigationRailItem",
2469
+ ({ isSelected: e, icon: t, label: r, variant: n }) => ({
2470
+ navigationRailItem: f(" group flex flex-col pt-1 pb-1.5 cursor-pointer", {
2471
+ "text-on-surface-variant": !e,
2472
+ "text-on-secondary-container": e,
2473
+ "gap-2 h-[68px]": n == "vertical",
2474
+ "gap-0 h-[66px]": n == "horizontal"
2475
+ }),
2476
+ container: f(
2477
+ " w-fit flex justify-center relative rounded-full items-center mx-5",
2478
+ {
2479
+ "bg-secondary-container overflow-hidden": e,
2480
+ "gap-2 ": n == "horizontal",
2481
+ "gap-0 ": n == "vertical",
2482
+ "p-4": !r
2483
+ },
2484
+ r && [
2485
+ "px-4",
2486
+ {
2487
+ "py-1 ": n == "vertical",
2488
+ "py-4 ": n == "horizontal"
2489
+ }
2490
+ ]
2491
+ ),
2492
+ stateLayer: f(
2493
+ " absolute w-full rounded-full h-full left-0 top-0 ",
2494
+ {
2495
+ "group-state-on-surface": !e,
2496
+ "group-state-on-secondary-container": e
2497
+ }
2498
+ ),
2499
+ icon: f("size-6 flex"),
2500
+ label: f("w-fit mx-auto", {
2501
+ "text-label-large ": n == "horizontal",
2502
+ "text-label-medium": n == "vertical"
2503
+ })
2504
+ })
2505
+ ), lt = ({ label: e }) => /* @__PURE__ */ i("div", { className: " h-9 flex items-center mx-9 mt-3", children: /* @__PURE__ */ i("p", { className: "text-label-large text-on-surface-variant", children: e }) }), ot = ({
2506
+ className: e,
2507
+ onClick: t,
2508
+ label: r,
2509
+ variant: n = "vertical",
2510
+ href: l,
2511
+ icon: c,
2512
+ selectedItem: o,
2513
+ setSelectedItem: s,
2514
+ index: d,
2515
+ onItemSelected: u,
2516
+ selected: p = !1,
2517
+ ref: w,
2518
+ transition: a,
2519
+ isExtended: y,
2520
+ iconSelected: v,
2521
+ style: b,
2522
+ extendedOnly: L,
2523
+ ...E
2524
+ }) => {
2525
+ const m = O(null), N = w || m, [k, I] = S(p);
2526
+ B(() => {
2527
+ p && o == null ? I(!0) : I(o == d && d != null);
2528
+ }, [o]), B(() => {
2529
+ o == d && u && u({
2530
+ ref: N,
2531
+ index: d || 0,
2532
+ label: r,
2533
+ icon: c
2534
+ });
2535
+ }, [o]);
2536
+ const C = l ? "a" : "button", D = (R) => {
2537
+ s && s(d ?? null), t && t(R);
2538
+ }, $ = rt({
2539
+ isExtended: y,
2540
+ extendedOnly: L,
2541
+ className: e,
2542
+ onItemSelected: u,
2543
+ selectedItem: o,
2544
+ index: d,
2545
+ transition: a,
2546
+ selected: k,
2547
+ variant: n,
2548
+ icon: c,
2549
+ label: r,
2550
+ isSelected: k,
2551
+ setSelectedItem: s,
2552
+ href: l,
2553
+ iconSelected: v
2554
+ });
2555
+ return a = { duration: 0.3, ...a }, L && !y ? null : (
2556
+ // @ts-ignore
2557
+ /* @__PURE__ */ P(
2558
+ C,
2559
+ {
2560
+ ...E,
2561
+ role: "tab",
2562
+ "aria-selected": k,
2563
+ ref: N,
2564
+ href: l,
2565
+ className: $.navigationRailItem,
2566
+ onClick: D,
2567
+ style: { transition: a.duration + "s", ...b },
2568
+ children: [
2569
+ /* @__PURE__ */ P(
2570
+ U.div,
2571
+ {
2572
+ style: {
2573
+ transition: n == "horizontal" ? a.duration + `s, gap ${a.duration / 2}s ${a.duration - a.duration / 2}s` : a.duration + `s, gap ${a.duration / 3}s ${a.duration - a.duration / 3}s`
2574
+ },
2575
+ transition: a,
2576
+ className: $.container,
2577
+ children: [
2578
+ /* @__PURE__ */ i(U.div, { layout: !0, className: $.stateLayer }),
2579
+ c && /* @__PURE__ */ i(
2580
+ J,
2581
+ {
2582
+ icon: k ? v : c,
2583
+ className: $.icon
2584
+ }
2585
+ ),
2586
+ /* @__PURE__ */ i(z, { children: n == "horizontal" && (() => {
2587
+ const R = {
2588
+ width: 0,
2589
+ opacity: 0,
2590
+ transition: {
2591
+ ...a
2592
+ }
2593
+ }, h = {
2594
+ width: "auto",
2595
+ opacity: 1,
2596
+ transition: {
2597
+ ...a,
2598
+ opacity: {
2599
+ duration: a.duration / 2,
2600
+ delay: a.duration - a.duration / 2
2601
+ }
2602
+ }
2603
+ };
2604
+ return /* @__PURE__ */ i(
2605
+ U.span,
2606
+ {
2607
+ initial: R,
2608
+ animate: h,
2609
+ exit: R,
2610
+ className: $.label,
2611
+ children: r
2612
+ }
2613
+ );
2614
+ })() })
2615
+ ]
2616
+ }
2617
+ ),
2618
+ /* @__PURE__ */ i(z, { children: n == "vertical" && (() => {
2619
+ const R = {
2620
+ height: 0,
2621
+ opacity: 0,
2622
+ transition: {
2623
+ ...a,
2624
+ opacity: {
2625
+ duration: 0
2626
+ }
2627
+ }
2628
+ }, h = {
2629
+ height: "auto",
2630
+ opacity: 1,
2631
+ transition: {
2632
+ ...a,
2633
+ opacity: {
2634
+ duration: a.duration / 3,
2635
+ delay: a.duration - a.duration / 3
2636
+ }
2637
+ }
2638
+ };
2639
+ return /* @__PURE__ */ i(
2640
+ U.span,
2641
+ {
2642
+ initial: R,
2643
+ animate: h,
2644
+ exit: R,
2645
+ className: $.label,
2646
+ transition: a,
2647
+ children: r
2648
+ }
2649
+ );
2650
+ })() })
2651
+ ]
2652
+ }
2653
+ )
2654
+ );
2655
+ }, at = H(
2656
+ "navigationRail",
2657
+ ({ isExtended: e, alignment: t }) => ({
2658
+ navigationRail: f("flex flex-col left-0 h-full top-0 pt-11", {
2659
+ "w-fit max-w-24": !e,
2660
+ "w-fit min-w-[220px] max-w-[360px]": e,
2661
+ "justify-between": t == "middle",
2662
+ "justify-start": t == "top"
2663
+ }),
2664
+ header: f("flex flex-col gap-1 items-start"),
2665
+ menuIcon: "mx-5",
2666
+ segments: f(" flex flex-col overflow-auto min-w-full mt-10", {
2667
+ "w-full": !e,
2668
+ "w-fit items-start": e
2669
+ })
2670
+ })
2671
+ ), Nt = ({
2672
+ variant: e = "standard",
2673
+ onItemSelected: t,
2674
+ children: r,
2675
+ className: n,
2676
+ selectedItem: l,
2677
+ extended: c,
2678
+ alignment: o = "top",
2679
+ menu: s = {
2680
+ closed: {
2681
+ icon: et,
2682
+ label: "Open menu"
2683
+ },
2684
+ opened: {
2685
+ icon: ge,
2686
+ label: "Close menu"
2687
+ }
2688
+ },
2689
+ style: d,
2690
+ onExtendedChange: u,
2691
+ transition: p,
2692
+ setSelectedItem: w
2693
+ }) => {
2694
+ const [a, y] = S(null), [v, b] = S(c);
2695
+ let L;
2696
+ l == 0 || l != null ? L = l : L = a;
2697
+ const E = w || y, m = W.useRef(null), N = (R) => {
2698
+ t == null || t(R);
2699
+ };
2700
+ function k(R) {
2701
+ const h = [];
2702
+ return W.Children.forEach(R, (j) => {
2703
+ W.isValidElement(j) && j.type === W.Fragment ? h.push(...k(j.props.children)) : h.push(j);
2704
+ }), h;
2705
+ }
2706
+ const I = k(r), C = I.filter(
2707
+ (R) => W.isValidElement(R) && R.type === ce
2708
+ ), D = at({
2709
+ children: r,
2710
+ onItemSelected: t,
2711
+ selectedItem: L,
2712
+ setSelectedItem: E,
2713
+ className: n,
2714
+ variant: e,
2715
+ extended: v,
2716
+ isExtended: v,
2717
+ alignment: o,
2718
+ menu: s,
2719
+ transition: p,
2720
+ onExtendedChange: u
2721
+ });
2722
+ p = { duration: 0.3, ...p };
2723
+ const $ = O(!1);
2724
+ return $.current = !1, B(() => {
2725
+ u == null || u(v ?? !1);
2726
+ }, [v]), /* @__PURE__ */ P(
2727
+ "div",
2728
+ {
2729
+ style: { transition: p.duration + "s", ...d },
2730
+ ref: m,
2731
+ className: D.navigationRail,
2732
+ children: [
2733
+ /* @__PURE__ */ P("div", { className: D.header, children: [
2734
+ /* @__PURE__ */ i(
2735
+ ye,
2736
+ {
2737
+ onClick: () => b(!v),
2738
+ arialLabel: v ? s == null ? void 0 : s.opened.label : s == null ? void 0 : s.closed.label,
2739
+ className: D.menuIcon,
2740
+ icon: v ? s.opened.icon : s == null ? void 0 : s.closed.icon
2741
+ }
2742
+ ),
2743
+ C.length > 0 && W.cloneElement(
2744
+ C[0],
2745
+ {
2746
+ transition: p,
2747
+ isExtended: v,
2748
+ className: "!shadow-none mx-5 " + C[0].props.className
2749
+ }
2750
+ )
2751
+ ] }),
2752
+ /* @__PURE__ */ i("div", { className: D.segments, children: (() => {
2753
+ let R = 0;
2754
+ return I.map((h) => W.isValidElement(h) && h.type === ot ? W.cloneElement(
2755
+ h,
2756
+ {
2757
+ key: R,
2758
+ index: R++,
2759
+ // Utilise et incrémente le compteur dédié
2760
+ variant: v ? "horizontal" : "vertical",
2761
+ selectedItem: L,
2762
+ setSelectedItem: E,
2763
+ onItemSelected: N,
2764
+ transition: p,
2765
+ extendedOnly: $.current,
2766
+ isExtended: v
2767
+ }
2768
+ ) : W.isValidElement(h) && h.type === ce ? null : W.isValidElement(h) && h.type === lt ? ($.current = !0, v ? W.cloneElement(
2769
+ h,
2770
+ {}
2771
+ ) : null) : h);
2772
+ })() }),
2773
+ /* @__PURE__ */ i("div", { className: "flex-1 max-h-[160px]" })
2774
+ ]
2775
+ }
2776
+ );
2777
+ };
2778
+ export {
2779
+ Ae as Button,
2780
+ pt as Card,
2781
+ ht as Carousel,
2782
+ Ze as CarouselItem,
2783
+ pe as CustomScroll,
2784
+ yt as Divider,
2785
+ ce as Fab,
2786
+ J as Icon,
2787
+ ye as IconButton,
2788
+ Nt as NavigationRail,
2789
+ ot as NavigationRailItem,
2790
+ lt as NavigationRailSection,
2791
+ Ge as ProgressIndicator,
2792
+ ne as RippleEffect,
2793
+ gt as Slider,
2794
+ mt as SmoothScroll,
2795
+ xt as Snackbar,
2796
+ wt as Switch,
2797
+ _e as SyncedFixedWrapper,
2798
+ nt as Tab,
2799
+ vt as Tabs,
2800
+ bt as TextField,
2801
+ he as ToolTip,
2802
+ Re as buttonStyle,
2803
+ Se as cardStyle,
2804
+ Ce as carouselItemStyle,
2805
+ Ve as carouselStyle,
2806
+ f as classNames,
2807
+ Ie as classnames,
2808
+ He as customScrollStyle,
2809
+ H as defaultClassNames,
2810
+ Be as dividerStyle,
2811
+ De as fabStyle,
2812
+ Me as getClassNames,
2813
+ $e as iconButtonStyle,
2814
+ Ye as normalize,
2815
+ We as progressIndicatorStyle,
2816
+ Pe as sliderStyle,
2817
+ Ue as snackbarStyle,
2818
+ je as switchStyle,
2819
+ Oe as tabStyle,
2820
+ Xe as tabsStyle,
2821
+ Fe as textFieldStyle,
2822
+ Ke as toolStyle
2823
+ };