@leodamours/ds-components 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,3015 @@
1
+ import { defineComponent as V, ref as j, watch as we, computed as k, openBlock as g, createElementBlock as v, normalizeClass as T, toDisplayString as B, createCommentVNode as D, renderSlot as N, createTextVNode as X, createBlock as I, resolveDynamicComponent as $e, normalizeStyle as he, createElementVNode as $, shallowRef as kt, getCurrentScope as Ft, onScopeDispose as Ct, shallowReadonly as be, unref as R, mergeProps as de, createVNode as ne, withCtx as Re, Teleport as Oe, withModifiers as $t, Fragment as se, renderList as re, nextTick as je, withKeys as st, onBeforeUnmount as rt, Transition as at, onMounted as Dt, TransitionGroup as Et } from "vue";
2
+ const At = ["aria-label"], Bt = ["src", "alt"], Qo = /* @__PURE__ */ V({
3
+ __name: "DsAvatar",
4
+ props: {
5
+ src: {},
6
+ alt: {},
7
+ name: {},
8
+ size: { default: "md" },
9
+ variant: { default: "brand" }
10
+ },
11
+ setup(e) {
12
+ const t = e, n = j(!1);
13
+ we(() => t.src, () => {
14
+ n.value = !1;
15
+ });
16
+ const o = k(() => t.name ? t.name.split(" ").map((a) => a[0]).slice(0, 2).join("").toUpperCase() : "?"), s = k(() => [
17
+ "inline-flex",
18
+ "items-center",
19
+ "justify-center",
20
+ "rounded-full",
21
+ "overflow-hidden",
22
+ "shrink-0",
23
+ {
24
+ sm: "w-6 h-6 text-xs",
25
+ md: "w-8 h-8 text-sm",
26
+ lg: "w-10 h-10 text-base",
27
+ xl: "w-12 h-12 text-lg"
28
+ }[t.size]
29
+ ].join(" ")), r = k(() => [
30
+ "w-full",
31
+ "h-full",
32
+ "flex",
33
+ "items-center",
34
+ "justify-center",
35
+ "font-medium",
36
+ "select-none",
37
+ {
38
+ brand: "bg-brand-soft text-brand-on-soft",
39
+ neutral: "bg-neutral-soft text-neutral-on-soft"
40
+ }[t.variant]
41
+ ].join(" "));
42
+ return (a, l) => (g(), v("span", {
43
+ class: T(s.value),
44
+ role: "img",
45
+ "aria-label": e.alt || e.name
46
+ }, [
47
+ e.src && !n.value ? (g(), v("img", {
48
+ key: 0,
49
+ src: e.src,
50
+ alt: e.alt || e.name || "",
51
+ class: "w-full h-full object-cover rounded-full",
52
+ onError: l[0] || (l[0] = (i) => n.value = !0)
53
+ }, null, 40, Bt)) : (g(), v("span", {
54
+ key: 1,
55
+ class: T(r.value),
56
+ "aria-hidden": "true"
57
+ }, B(o.value), 3))
58
+ ], 10, At));
59
+ }
60
+ }), Zo = /* @__PURE__ */ V({
61
+ __name: "DsBadge",
62
+ props: {
63
+ label: {},
64
+ variant: { default: "neutral" },
65
+ size: { default: "md" },
66
+ dot: { type: Boolean, default: !1 }
67
+ },
68
+ setup(e) {
69
+ const t = e, n = k(() => {
70
+ const s = [
71
+ "inline-flex",
72
+ "items-center",
73
+ "font-medium",
74
+ "rounded-full",
75
+ "whitespace-nowrap"
76
+ ], r = t.dot ? { sm: "px-1.5 py-0.5", md: "px-2 py-0.5", lg: "px-2.5 py-1" } : { sm: "px-1.5 py-0.5 text-xs", md: "px-2 py-0.5 text-xs", lg: "px-2.5 py-1 text-sm" }, a = {
77
+ brand: "bg-brand-soft text-brand-on-soft",
78
+ neutral: "bg-neutral-soft text-neutral-on-soft",
79
+ error: "bg-error-soft text-error-on-soft",
80
+ success: "bg-success-soft text-success-on-soft",
81
+ warning: "bg-warning-soft text-warning-on-soft",
82
+ info: "bg-info-soft text-info-on-soft",
83
+ processing: "bg-processing-soft text-processing-on-soft"
84
+ };
85
+ return [
86
+ ...s,
87
+ r[t.size],
88
+ a[t.variant]
89
+ ].join(" ");
90
+ }), o = k(() => {
91
+ const s = { sm: "w-1.5 h-1.5", md: "w-2 h-2", lg: "w-2.5 h-2.5" }, r = {
92
+ brand: "bg-brand",
93
+ neutral: "bg-neutral",
94
+ error: "bg-error",
95
+ success: "bg-success",
96
+ warning: "bg-warning",
97
+ info: "bg-info",
98
+ processing: "bg-processing"
99
+ };
100
+ return ["inline-block", "rounded-full", s[t.size], r[t.variant]].join(" ");
101
+ });
102
+ return (s, r) => (g(), v("span", {
103
+ class: T(n.value)
104
+ }, [
105
+ e.dot ? (g(), v("span", {
106
+ key: 0,
107
+ class: T(o.value),
108
+ "aria-hidden": "true"
109
+ }, null, 2)) : D("", !0),
110
+ e.dot ? D("", !0) : N(s.$slots, "default", { key: 1 }, () => [
111
+ X(B(e.label), 1)
112
+ ])
113
+ ], 2));
114
+ }
115
+ }), Tt = ["type", "disabled", "aria-label", "aria-busy"], Rt = { key: 1 }, Ot = /* @__PURE__ */ V({
116
+ __name: "DsButton",
117
+ props: {
118
+ label: {},
119
+ variant: { default: "primary" },
120
+ size: { default: "medium" },
121
+ htmlType: { default: "button" },
122
+ disabled: { type: Boolean, default: !1 },
123
+ iconLeft: {},
124
+ iconRight: {},
125
+ fullWidth: { type: Boolean, default: !1 },
126
+ loading: { type: Boolean, default: !1 },
127
+ ariaLabel: {}
128
+ },
129
+ emits: ["click"],
130
+ setup(e) {
131
+ const t = e, n = k(() => {
132
+ const s = [
133
+ "inline-flex",
134
+ "items-center",
135
+ "justify-center",
136
+ "font-sans",
137
+ "font-medium",
138
+ "rounded-lg",
139
+ "transition-colors",
140
+ "focus-visible:outline-none",
141
+ "focus-visible:ring-2",
142
+ "focus-visible:ring-brand",
143
+ "focus-visible:ring-offset-2",
144
+ "disabled:cursor-not-allowed",
145
+ "disabled:opacity-95",
146
+ "border-solid"
147
+ ], r = {
148
+ small: ["px-3", "py-1.5", "text-xs"],
149
+ medium: ["px-4", "py-2", "text-sm"],
150
+ large: ["px-6", "py-3", "text-base"]
151
+ }, a = {
152
+ primary: [
153
+ "bg-brand",
154
+ "text-brand-on-solid",
155
+ "border",
156
+ "border-brand-active",
157
+ "hover:bg-brand-hover",
158
+ "active:bg-brand-active",
159
+ "disabled:bg-brand-disabled"
160
+ ],
161
+ secondary: [
162
+ "bg-neutral-soft",
163
+ "text-neutral-on-soft",
164
+ "border",
165
+ "border-neutral-border-strong",
166
+ "hover:bg-neutral-soft-hover",
167
+ "active:bg-neutral-soft-active"
168
+ ],
169
+ outline: [
170
+ "bg-transparent",
171
+ "text-brand",
172
+ "border",
173
+ "border-brand",
174
+ "hover:bg-brand-soft",
175
+ "active:bg-brand-soft-hover"
176
+ ],
177
+ ghost: [
178
+ "bg-transparent",
179
+ "text-fg-secondary",
180
+ "border",
181
+ "border-transparent",
182
+ "hover:text-fg",
183
+ "hover:bg-surface-hover-light"
184
+ ],
185
+ success: [
186
+ "bg-success",
187
+ "text-success-on-solid",
188
+ "border",
189
+ "border-success-border-strong",
190
+ "hover:bg-success-hover"
191
+ ],
192
+ danger: [
193
+ "bg-error",
194
+ "text-error-on-solid",
195
+ "border",
196
+ "border-error-border-strong",
197
+ "hover:bg-error-hover",
198
+ "active:bg-error-active"
199
+ ]
200
+ }, l = t.fullWidth ? ["w-full"] : [];
201
+ return [
202
+ ...s,
203
+ ...r[t.size],
204
+ ...a[t.variant],
205
+ ...l
206
+ ].join(" ");
207
+ }), o = k(() => ({
208
+ small: "w-3 h-3",
209
+ medium: "w-4 h-4",
210
+ large: "w-5 h-5"
211
+ })[t.size]);
212
+ return (s, r) => (g(), v("button", {
213
+ type: e.htmlType,
214
+ disabled: e.disabled || e.loading,
215
+ "aria-label": e.ariaLabel,
216
+ "aria-busy": e.loading ? "true" : void 0,
217
+ class: T(n.value),
218
+ onClick: r[0] || (r[0] = (a) => s.$emit("click", a))
219
+ }, [
220
+ e.iconLeft ? (g(), I($e(e.iconLeft), {
221
+ key: 0,
222
+ class: T(o.value),
223
+ style: he(e.label || s.$slots.default ? "margin-right: 0.375rem" : ""),
224
+ "aria-hidden": "true"
225
+ }, null, 8, ["class", "style"])) : D("", !0),
226
+ e.label ? (g(), v("span", Rt, B(e.label), 1)) : N(s.$slots, "default", { key: 2 }),
227
+ e.iconRight ? (g(), I($e(e.iconRight), {
228
+ key: 3,
229
+ class: T(o.value),
230
+ style: he(e.label || s.$slots.default ? "margin-left: 0.375rem" : ""),
231
+ "aria-hidden": "true"
232
+ }, null, 8, ["class", "style"])) : D("", !0)
233
+ ], 10, Tt));
234
+ }
235
+ }), Lt = ["id", "checked", "disabled", "value"], _o = /* @__PURE__ */ V({
236
+ __name: "DsCheckbox",
237
+ props: {
238
+ modelValue: { type: Boolean, default: !1 },
239
+ label: {},
240
+ id: {},
241
+ value: { type: [String, Number, Boolean] },
242
+ disabled: { type: Boolean, default: !1 },
243
+ size: { default: "medium" }
244
+ },
245
+ emits: ["update:modelValue", "change"],
246
+ setup(e, { emit: t }) {
247
+ const n = e, o = t, s = k(() => {
248
+ const l = [
249
+ "rounded",
250
+ "border",
251
+ "border-solid",
252
+ "border-border",
253
+ "transition-colors",
254
+ "focus-visible:outline-none",
255
+ "focus-visible:ring-2",
256
+ "focus-visible:ring-brand",
257
+ "focus-visible:ring-offset-2"
258
+ ], i = {
259
+ small: ["w-3", "h-3"],
260
+ medium: ["w-4", "h-4"],
261
+ large: ["w-5", "h-5"]
262
+ }, f = n.disabled ? ["cursor-not-allowed", "opacity-95"] : ["cursor-pointer"];
263
+ return [
264
+ ...l,
265
+ ...i[n.size],
266
+ ...f
267
+ ].join(" ");
268
+ }), r = k(() => [
269
+ "font-sans",
270
+ "select-none",
271
+ "transition-colors",
272
+ {
273
+ small: "text-xs ml-1.5",
274
+ medium: "text-sm ml-2",
275
+ large: "text-base ml-2.5"
276
+ }[n.size]
277
+ ].join(" ")), a = (l) => {
278
+ if (n.disabled) return;
279
+ const f = l.target.checked;
280
+ o("update:modelValue", f), o("change", f, l);
281
+ };
282
+ return (l, i) => (g(), v("label", {
283
+ class: T([
284
+ "inline-flex items-center",
285
+ e.disabled ? "cursor-not-allowed opacity-75" : "cursor-pointer"
286
+ ])
287
+ }, [
288
+ $("input", {
289
+ id: e.id,
290
+ type: "checkbox",
291
+ checked: e.modelValue,
292
+ disabled: e.disabled,
293
+ value: e.value,
294
+ class: T(s.value),
295
+ onChange: a
296
+ }, null, 42, Lt),
297
+ e.label || l.$slots.default ? (g(), v("span", {
298
+ key: 0,
299
+ class: T(r.value)
300
+ }, [
301
+ N(l.$slots, "default", {}, () => [
302
+ X(B(e.label), 1)
303
+ ])
304
+ ], 2)) : D("", !0)
305
+ ], 2));
306
+ }
307
+ }), ae = Math.min, q = Math.max, De = Math.round, Ce = Math.floor, Z = (e) => ({
308
+ x: e,
309
+ y: e
310
+ }), St = {
311
+ left: "right",
312
+ right: "left",
313
+ bottom: "top",
314
+ top: "bottom"
315
+ }, Vt = {
316
+ start: "end",
317
+ end: "start"
318
+ };
319
+ function Pe(e, t, n) {
320
+ return q(e, ae(t, n));
321
+ }
322
+ function pe(e, t) {
323
+ return typeof e == "function" ? e(t) : e;
324
+ }
325
+ function le(e) {
326
+ return e.split("-")[0];
327
+ }
328
+ function ye(e) {
329
+ return e.split("-")[1];
330
+ }
331
+ function lt(e) {
332
+ return e === "x" ? "y" : "x";
333
+ }
334
+ function He(e) {
335
+ return e === "y" ? "height" : "width";
336
+ }
337
+ const zt = /* @__PURE__ */ new Set(["top", "bottom"]);
338
+ function te(e) {
339
+ return zt.has(le(e)) ? "y" : "x";
340
+ }
341
+ function qe(e) {
342
+ return lt(te(e));
343
+ }
344
+ function Mt(e, t, n) {
345
+ n === void 0 && (n = !1);
346
+ const o = ye(e), s = qe(e), r = He(s);
347
+ let a = s === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
348
+ return t.reference[r] > t.floating[r] && (a = Ee(a)), [a, Ee(a)];
349
+ }
350
+ function jt(e) {
351
+ const t = Ee(e);
352
+ return [Ie(e), t, Ie(t)];
353
+ }
354
+ function Ie(e) {
355
+ return e.replace(/start|end/g, (t) => Vt[t]);
356
+ }
357
+ const Je = ["left", "right"], Qe = ["right", "left"], Pt = ["top", "bottom"], It = ["bottom", "top"];
358
+ function Nt(e, t, n) {
359
+ switch (e) {
360
+ case "top":
361
+ case "bottom":
362
+ return n ? t ? Qe : Je : t ? Je : Qe;
363
+ case "left":
364
+ case "right":
365
+ return t ? Pt : It;
366
+ default:
367
+ return [];
368
+ }
369
+ }
370
+ function Wt(e, t, n, o) {
371
+ const s = ye(e);
372
+ let r = Nt(le(e), n === "start", o);
373
+ return s && (r = r.map((a) => a + "-" + s), t && (r = r.concat(r.map(Ie)))), r;
374
+ }
375
+ function Ee(e) {
376
+ return e.replace(/left|right|bottom|top/g, (t) => St[t]);
377
+ }
378
+ function Ht(e) {
379
+ return {
380
+ top: 0,
381
+ right: 0,
382
+ bottom: 0,
383
+ left: 0,
384
+ ...e
385
+ };
386
+ }
387
+ function it(e) {
388
+ return typeof e != "number" ? Ht(e) : {
389
+ top: e,
390
+ right: e,
391
+ bottom: e,
392
+ left: e
393
+ };
394
+ }
395
+ function Ae(e) {
396
+ const {
397
+ x: t,
398
+ y: n,
399
+ width: o,
400
+ height: s
401
+ } = e;
402
+ return {
403
+ width: o,
404
+ height: s,
405
+ top: n,
406
+ left: t,
407
+ right: t + o,
408
+ bottom: n + s,
409
+ x: t,
410
+ y: n
411
+ };
412
+ }
413
+ function Ze(e, t, n) {
414
+ let {
415
+ reference: o,
416
+ floating: s
417
+ } = e;
418
+ const r = te(t), a = qe(t), l = He(a), i = le(t), f = r === "y", d = o.x + o.width / 2 - s.width / 2, u = o.y + o.height / 2 - s.height / 2, b = o[l] / 2 - s[l] / 2;
419
+ let c;
420
+ switch (i) {
421
+ case "top":
422
+ c = {
423
+ x: d,
424
+ y: o.y - s.height
425
+ };
426
+ break;
427
+ case "bottom":
428
+ c = {
429
+ x: d,
430
+ y: o.y + o.height
431
+ };
432
+ break;
433
+ case "right":
434
+ c = {
435
+ x: o.x + o.width,
436
+ y: u
437
+ };
438
+ break;
439
+ case "left":
440
+ c = {
441
+ x: o.x - s.width,
442
+ y: u
443
+ };
444
+ break;
445
+ default:
446
+ c = {
447
+ x: o.x,
448
+ y: o.y
449
+ };
450
+ }
451
+ switch (ye(t)) {
452
+ case "start":
453
+ c[a] -= b * (n && f ? -1 : 1);
454
+ break;
455
+ case "end":
456
+ c[a] += b * (n && f ? -1 : 1);
457
+ break;
458
+ }
459
+ return c;
460
+ }
461
+ async function qt(e, t) {
462
+ var n;
463
+ t === void 0 && (t = {});
464
+ const {
465
+ x: o,
466
+ y: s,
467
+ platform: r,
468
+ rects: a,
469
+ elements: l,
470
+ strategy: i
471
+ } = e, {
472
+ boundary: f = "clippingAncestors",
473
+ rootBoundary: d = "viewport",
474
+ elementContext: u = "floating",
475
+ altBoundary: b = !1,
476
+ padding: c = 0
477
+ } = pe(t, e), m = it(c), y = l[b ? u === "floating" ? "reference" : "floating" : u], w = Ae(await r.getClippingRect({
478
+ element: (n = await (r.isElement == null ? void 0 : r.isElement(y))) == null || n ? y : y.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(l.floating)),
479
+ boundary: f,
480
+ rootBoundary: d,
481
+ strategy: i
482
+ })), F = u === "floating" ? {
483
+ x: o,
484
+ y: s,
485
+ width: a.floating.width,
486
+ height: a.floating.height
487
+ } : a.reference, x = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(l.floating)), C = await (r.isElement == null ? void 0 : r.isElement(x)) ? await (r.getScale == null ? void 0 : r.getScale(x)) || {
488
+ x: 1,
489
+ y: 1
490
+ } : {
491
+ x: 1,
492
+ y: 1
493
+ }, A = Ae(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
494
+ elements: l,
495
+ rect: F,
496
+ offsetParent: x,
497
+ strategy: i
498
+ }) : F);
499
+ return {
500
+ top: (w.top - A.top + m.top) / C.y,
501
+ bottom: (A.bottom - w.bottom + m.bottom) / C.y,
502
+ left: (w.left - A.left + m.left) / C.x,
503
+ right: (A.right - w.right + m.right) / C.x
504
+ };
505
+ }
506
+ const Kt = async (e, t, n) => {
507
+ const {
508
+ placement: o = "bottom",
509
+ strategy: s = "absolute",
510
+ middleware: r = [],
511
+ platform: a
512
+ } = n, l = r.filter(Boolean), i = await (a.isRTL == null ? void 0 : a.isRTL(t));
513
+ let f = await a.getElementRects({
514
+ reference: e,
515
+ floating: t,
516
+ strategy: s
517
+ }), {
518
+ x: d,
519
+ y: u
520
+ } = Ze(f, o, i), b = o, c = {}, m = 0;
521
+ for (let y = 0; y < l.length; y++) {
522
+ var h;
523
+ const {
524
+ name: w,
525
+ fn: F
526
+ } = l[y], {
527
+ x,
528
+ y: C,
529
+ data: A,
530
+ reset: L
531
+ } = await F({
532
+ x: d,
533
+ y: u,
534
+ initialPlacement: o,
535
+ placement: b,
536
+ strategy: s,
537
+ middlewareData: c,
538
+ rects: f,
539
+ platform: {
540
+ ...a,
541
+ detectOverflow: (h = a.detectOverflow) != null ? h : qt
542
+ },
543
+ elements: {
544
+ reference: e,
545
+ floating: t
546
+ }
547
+ });
548
+ d = x ?? d, u = C ?? u, c = {
549
+ ...c,
550
+ [w]: {
551
+ ...c[w],
552
+ ...A
553
+ }
554
+ }, L && m <= 50 && (m++, typeof L == "object" && (L.placement && (b = L.placement), L.rects && (f = L.rects === !0 ? await a.getElementRects({
555
+ reference: e,
556
+ floating: t,
557
+ strategy: s
558
+ }) : L.rects), {
559
+ x: d,
560
+ y: u
561
+ } = Ze(f, b, i)), y = -1);
562
+ }
563
+ return {
564
+ x: d,
565
+ y: u,
566
+ placement: b,
567
+ strategy: s,
568
+ middlewareData: c
569
+ };
570
+ }, Ut = (e) => ({
571
+ name: "arrow",
572
+ options: e,
573
+ async fn(t) {
574
+ const {
575
+ x: n,
576
+ y: o,
577
+ placement: s,
578
+ rects: r,
579
+ platform: a,
580
+ elements: l,
581
+ middlewareData: i
582
+ } = t, {
583
+ element: f,
584
+ padding: d = 0
585
+ } = pe(e, t) || {};
586
+ if (f == null)
587
+ return {};
588
+ const u = it(d), b = {
589
+ x: n,
590
+ y: o
591
+ }, c = qe(s), m = He(c), h = await a.getDimensions(f), y = c === "y", w = y ? "top" : "left", F = y ? "bottom" : "right", x = y ? "clientHeight" : "clientWidth", C = r.reference[m] + r.reference[c] - b[c] - r.floating[m], A = b[c] - r.reference[c], L = await (a.getOffsetParent == null ? void 0 : a.getOffsetParent(f));
592
+ let E = L ? L[x] : 0;
593
+ (!E || !await (a.isElement == null ? void 0 : a.isElement(L))) && (E = l.floating[x] || r.floating[m]);
594
+ const z = C / 2 - A / 2, M = E / 2 - h[m] / 2 - 1, W = ae(u[w], M), Y = ae(u[F], M), U = W, p = E - h[m] - Y, O = E / 2 - h[m] / 2 + z, S = Pe(U, O, p), P = !i.arrow && ye(s) != null && O !== S && r.reference[m] / 2 - (O < U ? W : Y) - h[m] / 2 < 0, H = P ? O < U ? O - U : O - p : 0;
595
+ return {
596
+ [c]: b[c] + H,
597
+ data: {
598
+ [c]: S,
599
+ centerOffset: O - S - H,
600
+ ...P && {
601
+ alignmentOffset: H
602
+ }
603
+ },
604
+ reset: P
605
+ };
606
+ }
607
+ }), Xt = function(e) {
608
+ return e === void 0 && (e = {}), {
609
+ name: "flip",
610
+ options: e,
611
+ async fn(t) {
612
+ var n, o;
613
+ const {
614
+ placement: s,
615
+ middlewareData: r,
616
+ rects: a,
617
+ initialPlacement: l,
618
+ platform: i,
619
+ elements: f
620
+ } = t, {
621
+ mainAxis: d = !0,
622
+ crossAxis: u = !0,
623
+ fallbackPlacements: b,
624
+ fallbackStrategy: c = "bestFit",
625
+ fallbackAxisSideDirection: m = "none",
626
+ flipAlignment: h = !0,
627
+ ...y
628
+ } = pe(e, t);
629
+ if ((n = r.arrow) != null && n.alignmentOffset)
630
+ return {};
631
+ const w = le(s), F = te(l), x = le(l) === l, C = await (i.isRTL == null ? void 0 : i.isRTL(f.floating)), A = b || (x || !h ? [Ee(l)] : jt(l)), L = m !== "none";
632
+ !b && L && A.push(...Wt(l, h, m, C));
633
+ const E = [l, ...A], z = await i.detectOverflow(t, y), M = [];
634
+ let W = ((o = r.flip) == null ? void 0 : o.overflows) || [];
635
+ if (d && M.push(z[w]), u) {
636
+ const O = Mt(s, a, C);
637
+ M.push(z[O[0]], z[O[1]]);
638
+ }
639
+ if (W = [...W, {
640
+ placement: s,
641
+ overflows: M
642
+ }], !M.every((O) => O <= 0)) {
643
+ var Y, U;
644
+ const O = (((Y = r.flip) == null ? void 0 : Y.index) || 0) + 1, S = E[O];
645
+ if (S && (!(u === "alignment" ? F !== te(S) : !1) || // We leave the current main axis only if every placement on that axis
646
+ // overflows the main axis.
647
+ W.every((G) => te(G.placement) === F ? G.overflows[0] > 0 : !0)))
648
+ return {
649
+ data: {
650
+ index: O,
651
+ overflows: W
652
+ },
653
+ reset: {
654
+ placement: S
655
+ }
656
+ };
657
+ let P = (U = W.filter((H) => H.overflows[0] <= 0).sort((H, G) => H.overflows[1] - G.overflows[1])[0]) == null ? void 0 : U.placement;
658
+ if (!P)
659
+ switch (c) {
660
+ case "bestFit": {
661
+ var p;
662
+ const H = (p = W.filter((G) => {
663
+ if (L) {
664
+ const oe = te(G.placement);
665
+ return oe === F || // Create a bias to the `y` side axis due to horizontal
666
+ // reading directions favoring greater width.
667
+ oe === "y";
668
+ }
669
+ return !0;
670
+ }).map((G) => [G.placement, G.overflows.filter((oe) => oe > 0).reduce((oe, wt) => oe + wt, 0)]).sort((G, oe) => G[1] - oe[1])[0]) == null ? void 0 : p[0];
671
+ H && (P = H);
672
+ break;
673
+ }
674
+ case "initialPlacement":
675
+ P = l;
676
+ break;
677
+ }
678
+ if (s !== P)
679
+ return {
680
+ reset: {
681
+ placement: P
682
+ }
683
+ };
684
+ }
685
+ return {};
686
+ }
687
+ };
688
+ }, Yt = /* @__PURE__ */ new Set(["left", "top"]);
689
+ async function Gt(e, t) {
690
+ const {
691
+ placement: n,
692
+ platform: o,
693
+ elements: s
694
+ } = e, r = await (o.isRTL == null ? void 0 : o.isRTL(s.floating)), a = le(n), l = ye(n), i = te(n) === "y", f = Yt.has(a) ? -1 : 1, d = r && i ? -1 : 1, u = pe(t, e);
695
+ let {
696
+ mainAxis: b,
697
+ crossAxis: c,
698
+ alignmentAxis: m
699
+ } = typeof u == "number" ? {
700
+ mainAxis: u,
701
+ crossAxis: 0,
702
+ alignmentAxis: null
703
+ } : {
704
+ mainAxis: u.mainAxis || 0,
705
+ crossAxis: u.crossAxis || 0,
706
+ alignmentAxis: u.alignmentAxis
707
+ };
708
+ return l && typeof m == "number" && (c = l === "end" ? m * -1 : m), i ? {
709
+ x: c * d,
710
+ y: b * f
711
+ } : {
712
+ x: b * f,
713
+ y: c * d
714
+ };
715
+ }
716
+ const Jt = function(e) {
717
+ return e === void 0 && (e = 0), {
718
+ name: "offset",
719
+ options: e,
720
+ async fn(t) {
721
+ var n, o;
722
+ const {
723
+ x: s,
724
+ y: r,
725
+ placement: a,
726
+ middlewareData: l
727
+ } = t, i = await Gt(t, e);
728
+ return a === ((n = l.offset) == null ? void 0 : n.placement) && (o = l.arrow) != null && o.alignmentOffset ? {} : {
729
+ x: s + i.x,
730
+ y: r + i.y,
731
+ data: {
732
+ ...i,
733
+ placement: a
734
+ }
735
+ };
736
+ }
737
+ };
738
+ }, Qt = function(e) {
739
+ return e === void 0 && (e = {}), {
740
+ name: "shift",
741
+ options: e,
742
+ async fn(t) {
743
+ const {
744
+ x: n,
745
+ y: o,
746
+ placement: s,
747
+ platform: r
748
+ } = t, {
749
+ mainAxis: a = !0,
750
+ crossAxis: l = !1,
751
+ limiter: i = {
752
+ fn: (w) => {
753
+ let {
754
+ x: F,
755
+ y: x
756
+ } = w;
757
+ return {
758
+ x: F,
759
+ y: x
760
+ };
761
+ }
762
+ },
763
+ ...f
764
+ } = pe(e, t), d = {
765
+ x: n,
766
+ y: o
767
+ }, u = await r.detectOverflow(t, f), b = te(le(s)), c = lt(b);
768
+ let m = d[c], h = d[b];
769
+ if (a) {
770
+ const w = c === "y" ? "top" : "left", F = c === "y" ? "bottom" : "right", x = m + u[w], C = m - u[F];
771
+ m = Pe(x, m, C);
772
+ }
773
+ if (l) {
774
+ const w = b === "y" ? "top" : "left", F = b === "y" ? "bottom" : "right", x = h + u[w], C = h - u[F];
775
+ h = Pe(x, h, C);
776
+ }
777
+ const y = i.fn({
778
+ ...t,
779
+ [c]: m,
780
+ [b]: h
781
+ });
782
+ return {
783
+ ...y,
784
+ data: {
785
+ x: y.x - n,
786
+ y: y.y - o,
787
+ enabled: {
788
+ [c]: a,
789
+ [b]: l
790
+ }
791
+ }
792
+ };
793
+ }
794
+ };
795
+ }, Zt = function(e) {
796
+ return e === void 0 && (e = {}), {
797
+ name: "size",
798
+ options: e,
799
+ async fn(t) {
800
+ var n, o;
801
+ const {
802
+ placement: s,
803
+ rects: r,
804
+ platform: a,
805
+ elements: l
806
+ } = t, {
807
+ apply: i = () => {
808
+ },
809
+ ...f
810
+ } = pe(e, t), d = await a.detectOverflow(t, f), u = le(s), b = ye(s), c = te(s) === "y", {
811
+ width: m,
812
+ height: h
813
+ } = r.floating;
814
+ let y, w;
815
+ u === "top" || u === "bottom" ? (y = u, w = b === (await (a.isRTL == null ? void 0 : a.isRTL(l.floating)) ? "start" : "end") ? "left" : "right") : (w = u, y = b === "end" ? "top" : "bottom");
816
+ const F = h - d.top - d.bottom, x = m - d.left - d.right, C = ae(h - d[y], F), A = ae(m - d[w], x), L = !t.middlewareData.shift;
817
+ let E = C, z = A;
818
+ if ((n = t.middlewareData.shift) != null && n.enabled.x && (z = x), (o = t.middlewareData.shift) != null && o.enabled.y && (E = F), L && !b) {
819
+ const W = q(d.left, 0), Y = q(d.right, 0), U = q(d.top, 0), p = q(d.bottom, 0);
820
+ c ? z = m - 2 * (W !== 0 || Y !== 0 ? W + Y : q(d.left, d.right)) : E = h - 2 * (U !== 0 || p !== 0 ? U + p : q(d.top, d.bottom));
821
+ }
822
+ await i({
823
+ ...t,
824
+ availableWidth: z,
825
+ availableHeight: E
826
+ });
827
+ const M = await a.getDimensions(l.floating);
828
+ return m !== M.width || h !== M.height ? {
829
+ reset: {
830
+ rects: !0
831
+ }
832
+ } : {};
833
+ }
834
+ };
835
+ };
836
+ function Le() {
837
+ return typeof window < "u";
838
+ }
839
+ function ue(e) {
840
+ return Ke(e) ? (e.nodeName || "").toLowerCase() : "#document";
841
+ }
842
+ function K(e) {
843
+ var t;
844
+ return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
845
+ }
846
+ function ee(e) {
847
+ var t;
848
+ return (t = (Ke(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
849
+ }
850
+ function Ke(e) {
851
+ return Le() ? e instanceof Node || e instanceof K(e).Node : !1;
852
+ }
853
+ function J(e) {
854
+ return Le() ? e instanceof Element || e instanceof K(e).Element : !1;
855
+ }
856
+ function _(e) {
857
+ return Le() ? e instanceof HTMLElement || e instanceof K(e).HTMLElement : !1;
858
+ }
859
+ function _e(e) {
860
+ return !Le() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof K(e).ShadowRoot;
861
+ }
862
+ const _t = /* @__PURE__ */ new Set(["inline", "contents"]);
863
+ function Fe(e) {
864
+ const {
865
+ overflow: t,
866
+ overflowX: n,
867
+ overflowY: o,
868
+ display: s
869
+ } = Q(e);
870
+ return /auto|scroll|overlay|hidden|clip/.test(t + o + n) && !_t.has(s);
871
+ }
872
+ const en = /* @__PURE__ */ new Set(["table", "td", "th"]);
873
+ function tn(e) {
874
+ return en.has(ue(e));
875
+ }
876
+ const nn = [":popover-open", ":modal"];
877
+ function Se(e) {
878
+ return nn.some((t) => {
879
+ try {
880
+ return e.matches(t);
881
+ } catch {
882
+ return !1;
883
+ }
884
+ });
885
+ }
886
+ const on = ["transform", "translate", "scale", "rotate", "perspective"], sn = ["transform", "translate", "scale", "rotate", "perspective", "filter"], rn = ["paint", "layout", "strict", "content"];
887
+ function Ue(e) {
888
+ const t = Xe(), n = J(e) ? Q(e) : e;
889
+ return on.some((o) => n[o] ? n[o] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || sn.some((o) => (n.willChange || "").includes(o)) || rn.some((o) => (n.contain || "").includes(o));
890
+ }
891
+ function an(e) {
892
+ let t = ie(e);
893
+ for (; _(t) && !ve(t); ) {
894
+ if (Ue(t))
895
+ return t;
896
+ if (Se(t))
897
+ return null;
898
+ t = ie(t);
899
+ }
900
+ return null;
901
+ }
902
+ function Xe() {
903
+ return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
904
+ }
905
+ const ln = /* @__PURE__ */ new Set(["html", "body", "#document"]);
906
+ function ve(e) {
907
+ return ln.has(ue(e));
908
+ }
909
+ function Q(e) {
910
+ return K(e).getComputedStyle(e);
911
+ }
912
+ function Ve(e) {
913
+ return J(e) ? {
914
+ scrollLeft: e.scrollLeft,
915
+ scrollTop: e.scrollTop
916
+ } : {
917
+ scrollLeft: e.scrollX,
918
+ scrollTop: e.scrollY
919
+ };
920
+ }
921
+ function ie(e) {
922
+ if (ue(e) === "html")
923
+ return e;
924
+ const t = (
925
+ // Step into the shadow DOM of the parent of a slotted node.
926
+ e.assignedSlot || // DOM Element detected.
927
+ e.parentNode || // ShadowRoot detected.
928
+ _e(e) && e.host || // Fallback.
929
+ ee(e)
930
+ );
931
+ return _e(t) ? t.host : t;
932
+ }
933
+ function ct(e) {
934
+ const t = ie(e);
935
+ return ve(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : _(t) && Fe(t) ? t : ct(t);
936
+ }
937
+ function ke(e, t, n) {
938
+ var o;
939
+ t === void 0 && (t = []), n === void 0 && (n = !0);
940
+ const s = ct(e), r = s === ((o = e.ownerDocument) == null ? void 0 : o.body), a = K(s);
941
+ if (r) {
942
+ const l = Ne(a);
943
+ return t.concat(a, a.visualViewport || [], Fe(s) ? s : [], l && n ? ke(l) : []);
944
+ }
945
+ return t.concat(s, ke(s, [], n));
946
+ }
947
+ function Ne(e) {
948
+ return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
949
+ }
950
+ function dt(e) {
951
+ const t = Q(e);
952
+ let n = parseFloat(t.width) || 0, o = parseFloat(t.height) || 0;
953
+ const s = _(e), r = s ? e.offsetWidth : n, a = s ? e.offsetHeight : o, l = De(n) !== r || De(o) !== a;
954
+ return l && (n = r, o = a), {
955
+ width: n,
956
+ height: o,
957
+ $: l
958
+ };
959
+ }
960
+ function Ye(e) {
961
+ return J(e) ? e : e.contextElement;
962
+ }
963
+ function ge(e) {
964
+ const t = Ye(e);
965
+ if (!_(t))
966
+ return Z(1);
967
+ const n = t.getBoundingClientRect(), {
968
+ width: o,
969
+ height: s,
970
+ $: r
971
+ } = dt(t);
972
+ let a = (r ? De(n.width) : n.width) / o, l = (r ? De(n.height) : n.height) / s;
973
+ return (!a || !Number.isFinite(a)) && (a = 1), (!l || !Number.isFinite(l)) && (l = 1), {
974
+ x: a,
975
+ y: l
976
+ };
977
+ }
978
+ const cn = /* @__PURE__ */ Z(0);
979
+ function ut(e) {
980
+ const t = K(e);
981
+ return !Xe() || !t.visualViewport ? cn : {
982
+ x: t.visualViewport.offsetLeft,
983
+ y: t.visualViewport.offsetTop
984
+ };
985
+ }
986
+ function dn(e, t, n) {
987
+ return t === void 0 && (t = !1), !n || t && n !== K(e) ? !1 : t;
988
+ }
989
+ function ce(e, t, n, o) {
990
+ t === void 0 && (t = !1), n === void 0 && (n = !1);
991
+ const s = e.getBoundingClientRect(), r = Ye(e);
992
+ let a = Z(1);
993
+ t && (o ? J(o) && (a = ge(o)) : a = ge(e));
994
+ const l = dn(r, n, o) ? ut(r) : Z(0);
995
+ let i = (s.left + l.x) / a.x, f = (s.top + l.y) / a.y, d = s.width / a.x, u = s.height / a.y;
996
+ if (r) {
997
+ const b = K(r), c = o && J(o) ? K(o) : o;
998
+ let m = b, h = Ne(m);
999
+ for (; h && o && c !== m; ) {
1000
+ const y = ge(h), w = h.getBoundingClientRect(), F = Q(h), x = w.left + (h.clientLeft + parseFloat(F.paddingLeft)) * y.x, C = w.top + (h.clientTop + parseFloat(F.paddingTop)) * y.y;
1001
+ i *= y.x, f *= y.y, d *= y.x, u *= y.y, i += x, f += C, m = K(h), h = Ne(m);
1002
+ }
1003
+ }
1004
+ return Ae({
1005
+ width: d,
1006
+ height: u,
1007
+ x: i,
1008
+ y: f
1009
+ });
1010
+ }
1011
+ function ze(e, t) {
1012
+ const n = Ve(e).scrollLeft;
1013
+ return t ? t.left + n : ce(ee(e)).left + n;
1014
+ }
1015
+ function ft(e, t) {
1016
+ const n = e.getBoundingClientRect(), o = n.left + t.scrollLeft - ze(e, n), s = n.top + t.scrollTop;
1017
+ return {
1018
+ x: o,
1019
+ y: s
1020
+ };
1021
+ }
1022
+ function un(e) {
1023
+ let {
1024
+ elements: t,
1025
+ rect: n,
1026
+ offsetParent: o,
1027
+ strategy: s
1028
+ } = e;
1029
+ const r = s === "fixed", a = ee(o), l = t ? Se(t.floating) : !1;
1030
+ if (o === a || l && r)
1031
+ return n;
1032
+ let i = {
1033
+ scrollLeft: 0,
1034
+ scrollTop: 0
1035
+ }, f = Z(1);
1036
+ const d = Z(0), u = _(o);
1037
+ if ((u || !u && !r) && ((ue(o) !== "body" || Fe(a)) && (i = Ve(o)), _(o))) {
1038
+ const c = ce(o);
1039
+ f = ge(o), d.x = c.x + o.clientLeft, d.y = c.y + o.clientTop;
1040
+ }
1041
+ const b = a && !u && !r ? ft(a, i) : Z(0);
1042
+ return {
1043
+ width: n.width * f.x,
1044
+ height: n.height * f.y,
1045
+ x: n.x * f.x - i.scrollLeft * f.x + d.x + b.x,
1046
+ y: n.y * f.y - i.scrollTop * f.y + d.y + b.y
1047
+ };
1048
+ }
1049
+ function fn(e) {
1050
+ return Array.from(e.getClientRects());
1051
+ }
1052
+ function bn(e) {
1053
+ const t = ee(e), n = Ve(e), o = e.ownerDocument.body, s = q(t.scrollWidth, t.clientWidth, o.scrollWidth, o.clientWidth), r = q(t.scrollHeight, t.clientHeight, o.scrollHeight, o.clientHeight);
1054
+ let a = -n.scrollLeft + ze(e);
1055
+ const l = -n.scrollTop;
1056
+ return Q(o).direction === "rtl" && (a += q(t.clientWidth, o.clientWidth) - s), {
1057
+ width: s,
1058
+ height: r,
1059
+ x: a,
1060
+ y: l
1061
+ };
1062
+ }
1063
+ const et = 25;
1064
+ function mn(e, t) {
1065
+ const n = K(e), o = ee(e), s = n.visualViewport;
1066
+ let r = o.clientWidth, a = o.clientHeight, l = 0, i = 0;
1067
+ if (s) {
1068
+ r = s.width, a = s.height;
1069
+ const d = Xe();
1070
+ (!d || d && t === "fixed") && (l = s.offsetLeft, i = s.offsetTop);
1071
+ }
1072
+ const f = ze(o);
1073
+ if (f <= 0) {
1074
+ const d = o.ownerDocument, u = d.body, b = getComputedStyle(u), c = d.compatMode === "CSS1Compat" && parseFloat(b.marginLeft) + parseFloat(b.marginRight) || 0, m = Math.abs(o.clientWidth - u.clientWidth - c);
1075
+ m <= et && (r -= m);
1076
+ } else f <= et && (r += f);
1077
+ return {
1078
+ width: r,
1079
+ height: a,
1080
+ x: l,
1081
+ y: i
1082
+ };
1083
+ }
1084
+ const gn = /* @__PURE__ */ new Set(["absolute", "fixed"]);
1085
+ function hn(e, t) {
1086
+ const n = ce(e, !0, t === "fixed"), o = n.top + e.clientTop, s = n.left + e.clientLeft, r = _(e) ? ge(e) : Z(1), a = e.clientWidth * r.x, l = e.clientHeight * r.y, i = s * r.x, f = o * r.y;
1087
+ return {
1088
+ width: a,
1089
+ height: l,
1090
+ x: i,
1091
+ y: f
1092
+ };
1093
+ }
1094
+ function tt(e, t, n) {
1095
+ let o;
1096
+ if (t === "viewport")
1097
+ o = mn(e, n);
1098
+ else if (t === "document")
1099
+ o = bn(ee(e));
1100
+ else if (J(t))
1101
+ o = hn(t, n);
1102
+ else {
1103
+ const s = ut(e);
1104
+ o = {
1105
+ x: t.x - s.x,
1106
+ y: t.y - s.y,
1107
+ width: t.width,
1108
+ height: t.height
1109
+ };
1110
+ }
1111
+ return Ae(o);
1112
+ }
1113
+ function bt(e, t) {
1114
+ const n = ie(e);
1115
+ return n === t || !J(n) || ve(n) ? !1 : Q(n).position === "fixed" || bt(n, t);
1116
+ }
1117
+ function vn(e, t) {
1118
+ const n = t.get(e);
1119
+ if (n)
1120
+ return n;
1121
+ let o = ke(e, [], !1).filter((l) => J(l) && ue(l) !== "body"), s = null;
1122
+ const r = Q(e).position === "fixed";
1123
+ let a = r ? ie(e) : e;
1124
+ for (; J(a) && !ve(a); ) {
1125
+ const l = Q(a), i = Ue(a);
1126
+ !i && l.position === "fixed" && (s = null), (r ? !i && !s : !i && l.position === "static" && !!s && gn.has(s.position) || Fe(a) && !i && bt(e, a)) ? o = o.filter((d) => d !== a) : s = l, a = ie(a);
1127
+ }
1128
+ return t.set(e, o), o;
1129
+ }
1130
+ function pn(e) {
1131
+ let {
1132
+ element: t,
1133
+ boundary: n,
1134
+ rootBoundary: o,
1135
+ strategy: s
1136
+ } = e;
1137
+ const a = [...n === "clippingAncestors" ? Se(t) ? [] : vn(t, this._c) : [].concat(n), o], l = a[0], i = a.reduce((f, d) => {
1138
+ const u = tt(t, d, s);
1139
+ return f.top = q(u.top, f.top), f.right = ae(u.right, f.right), f.bottom = ae(u.bottom, f.bottom), f.left = q(u.left, f.left), f;
1140
+ }, tt(t, l, s));
1141
+ return {
1142
+ width: i.right - i.left,
1143
+ height: i.bottom - i.top,
1144
+ x: i.left,
1145
+ y: i.top
1146
+ };
1147
+ }
1148
+ function yn(e) {
1149
+ const {
1150
+ width: t,
1151
+ height: n
1152
+ } = dt(e);
1153
+ return {
1154
+ width: t,
1155
+ height: n
1156
+ };
1157
+ }
1158
+ function xn(e, t, n) {
1159
+ const o = _(t), s = ee(t), r = n === "fixed", a = ce(e, !0, r, t);
1160
+ let l = {
1161
+ scrollLeft: 0,
1162
+ scrollTop: 0
1163
+ };
1164
+ const i = Z(0);
1165
+ function f() {
1166
+ i.x = ze(s);
1167
+ }
1168
+ if (o || !o && !r)
1169
+ if ((ue(t) !== "body" || Fe(s)) && (l = Ve(t)), o) {
1170
+ const c = ce(t, !0, r, t);
1171
+ i.x = c.x + t.clientLeft, i.y = c.y + t.clientTop;
1172
+ } else s && f();
1173
+ r && !o && s && f();
1174
+ const d = s && !o && !r ? ft(s, l) : Z(0), u = a.left + l.scrollLeft - i.x - d.x, b = a.top + l.scrollTop - i.y - d.y;
1175
+ return {
1176
+ x: u,
1177
+ y: b,
1178
+ width: a.width,
1179
+ height: a.height
1180
+ };
1181
+ }
1182
+ function Me(e) {
1183
+ return Q(e).position === "static";
1184
+ }
1185
+ function nt(e, t) {
1186
+ if (!_(e) || Q(e).position === "fixed")
1187
+ return null;
1188
+ if (t)
1189
+ return t(e);
1190
+ let n = e.offsetParent;
1191
+ return ee(e) === n && (n = n.ownerDocument.body), n;
1192
+ }
1193
+ function mt(e, t) {
1194
+ const n = K(e);
1195
+ if (Se(e))
1196
+ return n;
1197
+ if (!_(e)) {
1198
+ let s = ie(e);
1199
+ for (; s && !ve(s); ) {
1200
+ if (J(s) && !Me(s))
1201
+ return s;
1202
+ s = ie(s);
1203
+ }
1204
+ return n;
1205
+ }
1206
+ let o = nt(e, t);
1207
+ for (; o && tn(o) && Me(o); )
1208
+ o = nt(o, t);
1209
+ return o && ve(o) && Me(o) && !Ue(o) ? n : o || an(e) || n;
1210
+ }
1211
+ const wn = async function(e) {
1212
+ const t = this.getOffsetParent || mt, n = this.getDimensions, o = await n(e.floating);
1213
+ return {
1214
+ reference: xn(e.reference, await t(e.floating), e.strategy),
1215
+ floating: {
1216
+ x: 0,
1217
+ y: 0,
1218
+ width: o.width,
1219
+ height: o.height
1220
+ }
1221
+ };
1222
+ };
1223
+ function kn(e) {
1224
+ return Q(e).direction === "rtl";
1225
+ }
1226
+ const Fn = {
1227
+ convertOffsetParentRelativeRectToViewportRelativeRect: un,
1228
+ getDocumentElement: ee,
1229
+ getClippingRect: pn,
1230
+ getOffsetParent: mt,
1231
+ getElementRects: wn,
1232
+ getClientRects: fn,
1233
+ getDimensions: yn,
1234
+ getScale: ge,
1235
+ isElement: J,
1236
+ isRTL: kn
1237
+ };
1238
+ function gt(e, t) {
1239
+ return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
1240
+ }
1241
+ function Cn(e, t) {
1242
+ let n = null, o;
1243
+ const s = ee(e);
1244
+ function r() {
1245
+ var l;
1246
+ clearTimeout(o), (l = n) == null || l.disconnect(), n = null;
1247
+ }
1248
+ function a(l, i) {
1249
+ l === void 0 && (l = !1), i === void 0 && (i = 1), r();
1250
+ const f = e.getBoundingClientRect(), {
1251
+ left: d,
1252
+ top: u,
1253
+ width: b,
1254
+ height: c
1255
+ } = f;
1256
+ if (l || t(), !b || !c)
1257
+ return;
1258
+ const m = Ce(u), h = Ce(s.clientWidth - (d + b)), y = Ce(s.clientHeight - (u + c)), w = Ce(d), x = {
1259
+ rootMargin: -m + "px " + -h + "px " + -y + "px " + -w + "px",
1260
+ threshold: q(0, ae(1, i)) || 1
1261
+ };
1262
+ let C = !0;
1263
+ function A(L) {
1264
+ const E = L[0].intersectionRatio;
1265
+ if (E !== i) {
1266
+ if (!C)
1267
+ return a();
1268
+ E ? a(!1, E) : o = setTimeout(() => {
1269
+ a(!1, 1e-7);
1270
+ }, 1e3);
1271
+ }
1272
+ E === 1 && !gt(f, e.getBoundingClientRect()) && a(), C = !1;
1273
+ }
1274
+ try {
1275
+ n = new IntersectionObserver(A, {
1276
+ ...x,
1277
+ // Handle <iframe>s
1278
+ root: s.ownerDocument
1279
+ });
1280
+ } catch {
1281
+ n = new IntersectionObserver(A, x);
1282
+ }
1283
+ n.observe(e);
1284
+ }
1285
+ return a(!0), r;
1286
+ }
1287
+ function $n(e, t, n, o) {
1288
+ o === void 0 && (o = {});
1289
+ const {
1290
+ ancestorScroll: s = !0,
1291
+ ancestorResize: r = !0,
1292
+ elementResize: a = typeof ResizeObserver == "function",
1293
+ layoutShift: l = typeof IntersectionObserver == "function",
1294
+ animationFrame: i = !1
1295
+ } = o, f = Ye(e), d = s || r ? [...f ? ke(f) : [], ...ke(t)] : [];
1296
+ d.forEach((w) => {
1297
+ s && w.addEventListener("scroll", n, {
1298
+ passive: !0
1299
+ }), r && w.addEventListener("resize", n);
1300
+ });
1301
+ const u = f && l ? Cn(f, n) : null;
1302
+ let b = -1, c = null;
1303
+ a && (c = new ResizeObserver((w) => {
1304
+ let [F] = w;
1305
+ F && F.target === f && c && (c.unobserve(t), cancelAnimationFrame(b), b = requestAnimationFrame(() => {
1306
+ var x;
1307
+ (x = c) == null || x.observe(t);
1308
+ })), n();
1309
+ }), f && !i && c.observe(f), c.observe(t));
1310
+ let m, h = i ? ce(e) : null;
1311
+ i && y();
1312
+ function y() {
1313
+ const w = ce(e);
1314
+ h && !gt(h, w) && n(), h = w, m = requestAnimationFrame(y);
1315
+ }
1316
+ return n(), () => {
1317
+ var w;
1318
+ d.forEach((F) => {
1319
+ s && F.removeEventListener("scroll", n), r && F.removeEventListener("resize", n);
1320
+ }), u == null || u(), (w = c) == null || w.disconnect(), c = null, i && cancelAnimationFrame(m);
1321
+ };
1322
+ }
1323
+ const ht = Jt, vt = Qt, pt = Xt, Dn = Zt, En = Ut, An = (e, t, n) => {
1324
+ const o = /* @__PURE__ */ new Map(), s = {
1325
+ platform: Fn,
1326
+ ...n
1327
+ }, r = {
1328
+ ...s.platform,
1329
+ _c: o
1330
+ };
1331
+ return Kt(e, t, {
1332
+ ...s,
1333
+ platform: r
1334
+ });
1335
+ };
1336
+ function Bn(e) {
1337
+ return e != null && typeof e == "object" && "$el" in e;
1338
+ }
1339
+ function We(e) {
1340
+ if (Bn(e)) {
1341
+ const t = e.$el;
1342
+ return Ke(t) && ue(t) === "#comment" ? null : t;
1343
+ }
1344
+ return e;
1345
+ }
1346
+ function me(e) {
1347
+ return typeof e == "function" ? e() : R(e);
1348
+ }
1349
+ function Tn(e) {
1350
+ return {
1351
+ name: "arrow",
1352
+ options: e,
1353
+ fn(t) {
1354
+ const n = We(me(e.element));
1355
+ return n == null ? {} : En({
1356
+ element: n,
1357
+ padding: e.padding
1358
+ }).fn(t);
1359
+ }
1360
+ };
1361
+ }
1362
+ function yt(e) {
1363
+ return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
1364
+ }
1365
+ function ot(e, t) {
1366
+ const n = yt(e);
1367
+ return Math.round(t * n) / n;
1368
+ }
1369
+ function xt(e, t, n) {
1370
+ n === void 0 && (n = {});
1371
+ const o = n.whileElementsMounted, s = k(() => {
1372
+ var E;
1373
+ return (E = me(n.open)) != null ? E : !0;
1374
+ }), r = k(() => me(n.middleware)), a = k(() => {
1375
+ var E;
1376
+ return (E = me(n.placement)) != null ? E : "bottom";
1377
+ }), l = k(() => {
1378
+ var E;
1379
+ return (E = me(n.strategy)) != null ? E : "absolute";
1380
+ }), i = k(() => {
1381
+ var E;
1382
+ return (E = me(n.transform)) != null ? E : !0;
1383
+ }), f = k(() => We(e.value)), d = k(() => We(t.value)), u = j(0), b = j(0), c = j(l.value), m = j(a.value), h = kt({}), y = j(!1), w = k(() => {
1384
+ const E = {
1385
+ position: c.value,
1386
+ left: "0",
1387
+ top: "0"
1388
+ };
1389
+ if (!d.value)
1390
+ return E;
1391
+ const z = ot(d.value, u.value), M = ot(d.value, b.value);
1392
+ return i.value ? {
1393
+ ...E,
1394
+ transform: "translate(" + z + "px, " + M + "px)",
1395
+ ...yt(d.value) >= 1.5 && {
1396
+ willChange: "transform"
1397
+ }
1398
+ } : {
1399
+ position: c.value,
1400
+ left: z + "px",
1401
+ top: M + "px"
1402
+ };
1403
+ });
1404
+ let F;
1405
+ function x() {
1406
+ if (f.value == null || d.value == null)
1407
+ return;
1408
+ const E = s.value;
1409
+ An(f.value, d.value, {
1410
+ middleware: r.value,
1411
+ placement: a.value,
1412
+ strategy: l.value
1413
+ }).then((z) => {
1414
+ u.value = z.x, b.value = z.y, c.value = z.strategy, m.value = z.placement, h.value = z.middlewareData, y.value = E !== !1;
1415
+ });
1416
+ }
1417
+ function C() {
1418
+ typeof F == "function" && (F(), F = void 0);
1419
+ }
1420
+ function A() {
1421
+ if (C(), o === void 0) {
1422
+ x();
1423
+ return;
1424
+ }
1425
+ if (f.value != null && d.value != null) {
1426
+ F = o(f.value, d.value, x);
1427
+ return;
1428
+ }
1429
+ }
1430
+ function L() {
1431
+ s.value || (y.value = !1);
1432
+ }
1433
+ return we([r, a, l, s], x, {
1434
+ flush: "sync"
1435
+ }), we([f, d], A, {
1436
+ flush: "sync"
1437
+ }), we(s, L, {
1438
+ flush: "sync"
1439
+ }), Ft() && Ct(C), {
1440
+ x: be(u),
1441
+ y: be(b),
1442
+ strategy: be(c),
1443
+ placement: be(m),
1444
+ middlewareData: be(h),
1445
+ isPositioned: be(y),
1446
+ floatingStyles: w,
1447
+ update: x
1448
+ };
1449
+ }
1450
+ const Be = /* @__PURE__ */ V({
1451
+ inheritAttrs: !1,
1452
+ __name: "DsIconX",
1453
+ setup(e) {
1454
+ return (t, n) => (g(), v("svg", de({
1455
+ fill: "none",
1456
+ stroke: "currentColor",
1457
+ viewBox: "0 0 24 24"
1458
+ }, t.$attrs, { "aria-hidden": "true" }), [...n[0] || (n[0] = [
1459
+ $("path", {
1460
+ "stroke-linecap": "round",
1461
+ "stroke-linejoin": "round",
1462
+ "stroke-width": "2",
1463
+ d: "M6 18L18 6M6 6l12 12"
1464
+ }, null, -1)
1465
+ ])], 16));
1466
+ }
1467
+ }), Rn = /* @__PURE__ */ V({
1468
+ inheritAttrs: !1,
1469
+ __name: "DsIconCheck",
1470
+ setup(e) {
1471
+ return (t, n) => (g(), v("svg", de({
1472
+ fill: "none",
1473
+ stroke: "currentColor",
1474
+ viewBox: "0 0 24 24"
1475
+ }, t.$attrs, { "aria-hidden": "true" }), [...n[0] || (n[0] = [
1476
+ $("path", {
1477
+ "stroke-linecap": "round",
1478
+ "stroke-linejoin": "round",
1479
+ "stroke-width": "2",
1480
+ d: "M5 13l4 4L19 7"
1481
+ }, null, -1)
1482
+ ])], 16));
1483
+ }
1484
+ }), On = /* @__PURE__ */ V({
1485
+ inheritAttrs: !1,
1486
+ __name: "DsIconWarning",
1487
+ setup(e) {
1488
+ return (t, n) => (g(), v("svg", de({
1489
+ fill: "none",
1490
+ stroke: "currentColor",
1491
+ viewBox: "0 0 24 24"
1492
+ }, t.$attrs, { "aria-hidden": "true" }), [...n[0] || (n[0] = [
1493
+ $("path", {
1494
+ "stroke-linecap": "round",
1495
+ "stroke-linejoin": "round",
1496
+ "stroke-width": "2",
1497
+ d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
1498
+ }, null, -1)
1499
+ ])], 16));
1500
+ }
1501
+ }), Ln = /* @__PURE__ */ V({
1502
+ inheritAttrs: !1,
1503
+ __name: "DsIconInfo",
1504
+ setup(e) {
1505
+ return (t, n) => (g(), v("svg", de({
1506
+ fill: "none",
1507
+ stroke: "currentColor",
1508
+ viewBox: "0 0 24 24"
1509
+ }, t.$attrs, { "aria-hidden": "true" }), [...n[0] || (n[0] = [
1510
+ $("path", {
1511
+ "stroke-linecap": "round",
1512
+ "stroke-linejoin": "round",
1513
+ "stroke-width": "2",
1514
+ d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
1515
+ }, null, -1)
1516
+ ])], 16));
1517
+ }
1518
+ }), Ge = /* @__PURE__ */ V({
1519
+ inheritAttrs: !1,
1520
+ __name: "DsIconChevronDown",
1521
+ setup(e) {
1522
+ return (t, n) => (g(), v("svg", de({
1523
+ fill: "none",
1524
+ stroke: "currentColor",
1525
+ viewBox: "0 0 24 24"
1526
+ }, t.$attrs, { "aria-hidden": "true" }), [...n[0] || (n[0] = [
1527
+ $("path", {
1528
+ "stroke-linecap": "round",
1529
+ "stroke-linejoin": "round",
1530
+ "stroke-width": "2",
1531
+ d: "M19 9l-7 7-7-7"
1532
+ }, null, -1)
1533
+ ])], 16));
1534
+ }
1535
+ }), Sn = /* @__PURE__ */ V({
1536
+ inheritAttrs: !1,
1537
+ __name: "DsIconChevronUp",
1538
+ setup(e) {
1539
+ return (t, n) => (g(), v("svg", de({
1540
+ fill: "none",
1541
+ stroke: "currentColor",
1542
+ viewBox: "0 0 24 24"
1543
+ }, t.$attrs, { "aria-hidden": "true" }), [...n[0] || (n[0] = [
1544
+ $("path", {
1545
+ "stroke-linecap": "round",
1546
+ "stroke-linejoin": "round",
1547
+ "stroke-width": "2",
1548
+ d: "M5 15l7-7 7 7"
1549
+ }, null, -1)
1550
+ ])], 16));
1551
+ }
1552
+ }), Vn = /* @__PURE__ */ V({
1553
+ inheritAttrs: !1,
1554
+ __name: "DsIconSort",
1555
+ setup(e) {
1556
+ return (t, n) => (g(), v("svg", de({
1557
+ fill: "none",
1558
+ stroke: "currentColor",
1559
+ viewBox: "0 0 24 24"
1560
+ }, t.$attrs, { "aria-hidden": "true" }), [...n[0] || (n[0] = [
1561
+ $("path", {
1562
+ "stroke-linecap": "round",
1563
+ "stroke-linejoin": "round",
1564
+ "stroke-width": "2",
1565
+ d: "M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"
1566
+ }, null, -1)
1567
+ ])], 16));
1568
+ }
1569
+ });
1570
+ let zn = 0;
1571
+ function fe(e = "ds") {
1572
+ return `${e}-${++zn}`;
1573
+ }
1574
+ const Mn = { class: "relative" }, jn = ["id", "aria-label"], Pn = ["id", "aria-selected", "aria-disabled", "onClick", "onMouseenter"], In = {
1575
+ key: 0,
1576
+ class: "px-3 py-2 text-sm text-fg-disabled",
1577
+ role: "status"
1578
+ }, es = /* @__PURE__ */ V({
1579
+ __name: "DsDropdownSelect",
1580
+ props: {
1581
+ modelValue: {},
1582
+ options: { default: () => [] },
1583
+ placeholder: { default: "Select an option" },
1584
+ variant: { default: "primary" },
1585
+ size: { default: "medium" },
1586
+ disabled: { type: Boolean, default: !1 },
1587
+ loading: { type: Boolean, default: !1 },
1588
+ iconLeft: {},
1589
+ fullWidth: { type: Boolean, default: !1 },
1590
+ emptyText: { default: "No options available" }
1591
+ },
1592
+ emits: ["update:modelValue", "change"],
1593
+ setup(e, { emit: t }) {
1594
+ const n = e, o = t, s = j(), r = j(), a = j(!1), l = fe("listbox"), i = j(-1), f = k(() => {
1595
+ if (!(!a.value || i.value < 0))
1596
+ return d(i.value);
1597
+ }), d = (p) => `${l}-option-${p}`, { floatingStyles: u } = xt(s, r, {
1598
+ placement: "bottom-start",
1599
+ middleware: [
1600
+ ht(4),
1601
+ pt(),
1602
+ vt({ padding: 8 }),
1603
+ Dn({
1604
+ apply({ rects: p }) {
1605
+ r.value && Object.assign(r.value.style, {
1606
+ minWidth: `${p.reference.width}px`
1607
+ });
1608
+ }
1609
+ })
1610
+ ],
1611
+ whileElementsMounted: $n
1612
+ }), b = k(() => n.modelValue), c = k(() => n.options.find((p) => h(p) === b.value)), m = k(() => c.value ? y(c.value) : ""), h = (p) => typeof p == "object" && p !== null ? p.value : p, y = (p) => typeof p == "object" && p !== null ? p.label : String(p), w = (p) => typeof p == "object" && p !== null && p.disabled || !1, F = () => {
1613
+ je(() => {
1614
+ const p = r.value;
1615
+ if (!p || i.value < 0) return;
1616
+ const O = p.querySelector(`#${d(i.value)}`);
1617
+ O == null || O.scrollIntoView({ block: "nearest" });
1618
+ });
1619
+ }, x = (p, O) => {
1620
+ let S = p;
1621
+ for (; S >= 0 && S < n.options.length; ) {
1622
+ if (!w(n.options[S])) return S;
1623
+ S += O;
1624
+ }
1625
+ return -1;
1626
+ }, C = () => {
1627
+ const p = x(i.value + 1, 1);
1628
+ p >= 0 && (i.value = p, F());
1629
+ }, A = () => {
1630
+ const p = x(i.value - 1, -1);
1631
+ p >= 0 && (i.value = p, F());
1632
+ }, L = () => {
1633
+ const p = x(0, 1);
1634
+ p >= 0 && (i.value = p, F());
1635
+ }, E = () => {
1636
+ const p = x(n.options.length - 1, -1);
1637
+ p >= 0 && (i.value = p, F());
1638
+ }, z = () => {
1639
+ n.disabled || n.loading || (a.value = !0, je(() => {
1640
+ const p = n.options.findIndex(
1641
+ (O) => h(O) === b.value
1642
+ );
1643
+ p >= 0 && !w(n.options[p]) ? i.value = p : L(), F();
1644
+ }));
1645
+ }, M = () => {
1646
+ a.value = !1, i.value = -1;
1647
+ }, W = () => {
1648
+ n.disabled || n.loading || (a.value ? M() : z());
1649
+ }, Y = (p) => {
1650
+ if (w(p)) return;
1651
+ const O = h(p);
1652
+ o("update:modelValue", O), o("change", O, p), M();
1653
+ }, U = (p) => {
1654
+ if (!(n.disabled || n.loading)) {
1655
+ if (!a.value) {
1656
+ (p.key === "ArrowDown" || p.key === "ArrowUp" || p.key === "Enter" || p.key === " ") && (p.preventDefault(), z());
1657
+ return;
1658
+ }
1659
+ switch (p.key) {
1660
+ case "ArrowDown":
1661
+ p.preventDefault(), i.value < 0 ? L() : C();
1662
+ break;
1663
+ case "ArrowUp":
1664
+ p.preventDefault(), i.value < 0 ? E() : A();
1665
+ break;
1666
+ case "Home":
1667
+ p.preventDefault(), L();
1668
+ break;
1669
+ case "End":
1670
+ p.preventDefault(), E();
1671
+ break;
1672
+ case "Enter":
1673
+ case " ":
1674
+ p.preventDefault(), i.value >= 0 && i.value < n.options.length && Y(n.options[i.value]);
1675
+ break;
1676
+ case "Escape":
1677
+ p.preventDefault(), M();
1678
+ break;
1679
+ case "Tab":
1680
+ M();
1681
+ break;
1682
+ }
1683
+ }
1684
+ };
1685
+ return (p, O) => (g(), v("div", Mn, [
1686
+ ne(Ot, {
1687
+ ref_key: "triggerRef",
1688
+ ref: s,
1689
+ variant: e.variant,
1690
+ disabled: e.disabled,
1691
+ loading: e.loading,
1692
+ size: e.size,
1693
+ iconLeft: e.iconLeft,
1694
+ iconRight: R(Ge),
1695
+ fullWidth: e.fullWidth,
1696
+ role: "combobox",
1697
+ "aria-expanded": a.value ? "true" : "false",
1698
+ "aria-controls": R(l),
1699
+ "aria-haspopup": "listbox",
1700
+ "aria-activedescendant": f.value,
1701
+ onClick: W,
1702
+ onKeydown: U
1703
+ }, {
1704
+ default: Re(() => [
1705
+ N(p.$slots, "trigger", {}, () => [
1706
+ X(B(m.value || e.placeholder), 1)
1707
+ ])
1708
+ ]),
1709
+ _: 3
1710
+ }, 8, ["variant", "disabled", "loading", "size", "iconLeft", "iconRight", "fullWidth", "aria-expanded", "aria-controls", "aria-activedescendant"]),
1711
+ (g(), I(Oe, { to: "body" }, [
1712
+ a.value ? (g(), v("div", {
1713
+ key: 0,
1714
+ ref_key: "floatingRef",
1715
+ ref: r,
1716
+ id: R(l),
1717
+ role: "listbox",
1718
+ "aria-label": e.placeholder,
1719
+ style: he(R(u)),
1720
+ class: "z-50 min-w-32 bg-bg border border-solid border-border rounded-md shadow-default max-h-64 overflow-y-auto",
1721
+ onClick: O[0] || (O[0] = $t(() => {
1722
+ }, ["stop"]))
1723
+ }, [
1724
+ (g(!0), v(se, null, re(e.options, (S, P) => (g(), v("div", {
1725
+ key: h(S),
1726
+ id: d(P),
1727
+ role: "option",
1728
+ "aria-selected": b.value === h(S) ? "true" : "false",
1729
+ "aria-disabled": w(S) ? "true" : void 0,
1730
+ class: T([
1731
+ "px-3 py-2 text-sm transition-colors outline-none",
1732
+ w(S) ? "opacity-50 cursor-not-allowed" : "cursor-pointer",
1733
+ b.value === h(S) ? "bg-brand text-brand-on-solid" : "",
1734
+ i.value === P && b.value !== h(S) ? "bg-surface-hover" : "",
1735
+ (i.value !== P && b.value !== h(S), ""),
1736
+ P === 0 ? "rounded-t-md" : "",
1737
+ P === e.options.length - 1 ? "rounded-b-md" : ""
1738
+ ]),
1739
+ onClick: (H) => Y(S),
1740
+ onMouseenter: (H) => i.value = P
1741
+ }, [
1742
+ N(p.$slots, "option", {
1743
+ option: S,
1744
+ index: P
1745
+ }, () => [
1746
+ X(B(y(S)), 1)
1747
+ ])
1748
+ ], 42, Pn))), 128)),
1749
+ e.options.length ? D("", !0) : (g(), v("div", In, B(e.emptyText), 1))
1750
+ ], 12, jn)) : D("", !0)
1751
+ ])),
1752
+ a.value ? (g(), v("div", {
1753
+ key: 0,
1754
+ class: "fixed inset-0 z-40",
1755
+ onClick: M
1756
+ })) : D("", !0)
1757
+ ]));
1758
+ }
1759
+ }), Nn = { class: "w-full" }, Wn = ["for"], Hn = {
1760
+ key: 0,
1761
+ class: "text-error ml-1",
1762
+ "aria-hidden": "true"
1763
+ }, qn = { class: "relative" }, Kn = {
1764
+ key: 0,
1765
+ class: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",
1766
+ "aria-hidden": "true"
1767
+ }, Un = ["id", "type", "value", "placeholder", "disabled", "readonly", "required", "autocomplete", "maxlength", "min", "max", "step", "aria-describedby", "aria-invalid"], Xn = {
1768
+ key: 1,
1769
+ class: "absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none",
1770
+ "aria-hidden": "true"
1771
+ }, ts = /* @__PURE__ */ V({
1772
+ __name: "DsInput",
1773
+ props: {
1774
+ modelValue: {},
1775
+ label: {},
1776
+ type: { default: "text" },
1777
+ placeholder: {},
1778
+ helpText: {},
1779
+ error: {},
1780
+ size: { default: "medium" },
1781
+ disabled: { type: Boolean, default: !1 },
1782
+ readonly: { type: Boolean, default: !1 },
1783
+ required: { type: Boolean, default: !1 },
1784
+ clearable: { type: Boolean, default: !1 },
1785
+ iconLeft: {},
1786
+ iconRight: {},
1787
+ autocomplete: {},
1788
+ maxLength: {},
1789
+ min: {},
1790
+ max: {},
1791
+ step: {}
1792
+ },
1793
+ emits: ["update:modelValue", "blur", "focus", "enter", "clear"],
1794
+ setup(e, { expose: t, emit: n }) {
1795
+ const o = e, s = n, r = j(null), a = fe("input"), l = `${a}-help`, i = `${a}-error`, f = k(() => {
1796
+ const x = [];
1797
+ return o.helpText && !o.error && x.push(l), o.error && x.push(i), x.length > 0 ? x.join(" ") : void 0;
1798
+ }), d = k(() => o.clearable && b.value && !o.disabled), u = k(() => o.iconRight || o.clearable), b = k(() => o.modelValue == null ? !1 : typeof o.modelValue == "string" ? o.modelValue.length > 0 : !0), c = k(() => {
1799
+ const x = [
1800
+ "block",
1801
+ "w-full",
1802
+ "rounded-md",
1803
+ "border",
1804
+ "border-solid",
1805
+ "bg-bg",
1806
+ "text-fg",
1807
+ "font-sans",
1808
+ "transition-colors",
1809
+ "placeholder:text-fg-tertiary",
1810
+ "focus:outline-none",
1811
+ "focus:ring-2",
1812
+ "focus:ring-offset-0",
1813
+ "disabled:cursor-not-allowed",
1814
+ "disabled:bg-surface-disabled",
1815
+ "disabled:text-fg-disabled",
1816
+ "box-border"
1817
+ ], A = {
1818
+ small: { text: "text-sm", py: "py-1", px: "px-2", pl: "pl-8", pr: "pr-8" },
1819
+ medium: { text: "text-base", py: "py-2", px: "px-3", pl: "pl-10", pr: "pr-10" },
1820
+ large: { text: "text-lg", py: "py-3", px: "px-4", pl: "pl-12", pr: "pr-12" }
1821
+ }[o.size], L = o.error ? ["border-error-border", "focus:border-error", "focus:ring-error"] : ["border-border", "focus:border-border-focus", "focus:ring-brand"];
1822
+ return [
1823
+ ...x,
1824
+ A.text,
1825
+ A.py,
1826
+ o.iconLeft ? A.pl : A.px,
1827
+ u.value ? A.pr : A.px,
1828
+ ...L
1829
+ ].join(" ");
1830
+ }), m = k(() => {
1831
+ const x = { small: "w-4 h-4", medium: "w-5 h-5", large: "w-6 h-6" }, C = o.error ? "text-error" : "text-fg-tertiary";
1832
+ return `${x[o.size]} ${C}`;
1833
+ });
1834
+ function h(x) {
1835
+ const C = x.target;
1836
+ if (o.type === "number") {
1837
+ const A = Number(C.value);
1838
+ s("update:modelValue", Number.isNaN(A) ? C.value : A);
1839
+ } else
1840
+ s("update:modelValue", C.value);
1841
+ }
1842
+ function y() {
1843
+ var x;
1844
+ s("update:modelValue", ""), s("clear"), (x = r.value) == null || x.focus();
1845
+ }
1846
+ function w() {
1847
+ var x;
1848
+ (x = r.value) == null || x.focus();
1849
+ }
1850
+ function F() {
1851
+ var x;
1852
+ (x = r.value) == null || x.blur();
1853
+ }
1854
+ return t({ focus: w, blur: F, inputRef: r }), (x, C) => (g(), v("div", Nn, [
1855
+ e.label ? (g(), v("label", {
1856
+ key: 0,
1857
+ for: R(a),
1858
+ class: "block text-label mb-1"
1859
+ }, [
1860
+ X(B(e.label) + " ", 1),
1861
+ e.required ? (g(), v("span", Hn, "*")) : D("", !0)
1862
+ ], 8, Wn)) : D("", !0),
1863
+ $("div", qn, [
1864
+ e.iconLeft ? (g(), v("div", Kn, [
1865
+ (g(), I($e(e.iconLeft), {
1866
+ class: T(m.value)
1867
+ }, null, 8, ["class"]))
1868
+ ])) : D("", !0),
1869
+ $("input", {
1870
+ ref_key: "inputRef",
1871
+ ref: r,
1872
+ id: R(a),
1873
+ type: e.type,
1874
+ value: e.modelValue,
1875
+ placeholder: e.placeholder,
1876
+ disabled: e.disabled,
1877
+ readonly: e.readonly,
1878
+ required: e.required,
1879
+ autocomplete: e.autocomplete,
1880
+ maxlength: e.maxLength,
1881
+ min: e.min,
1882
+ max: e.max,
1883
+ step: e.step,
1884
+ "aria-describedby": f.value,
1885
+ "aria-invalid": e.error ? "true" : void 0,
1886
+ class: T(c.value),
1887
+ onInput: h,
1888
+ onBlur: C[0] || (C[0] = (A) => x.$emit("blur", A)),
1889
+ onFocus: C[1] || (C[1] = (A) => x.$emit("focus", A)),
1890
+ onKeydown: C[2] || (C[2] = st((A) => x.$emit("enter"), ["enter"]))
1891
+ }, null, 42, Un),
1892
+ e.iconRight && !d.value ? (g(), v("div", Xn, [
1893
+ (g(), I($e(e.iconRight), {
1894
+ class: T(m.value)
1895
+ }, null, 8, ["class"]))
1896
+ ])) : D("", !0),
1897
+ d.value ? (g(), v("button", {
1898
+ key: 2,
1899
+ type: "button",
1900
+ "aria-label": "Clear input",
1901
+ class: "absolute inset-y-0 right-0 pr-3 flex items-center text-fg-tertiary hover:text-fg-secondary transition-colors",
1902
+ onClick: y
1903
+ }, [
1904
+ ne(R(Be), { class: "w-4 h-4" })
1905
+ ])) : D("", !0)
1906
+ ]),
1907
+ e.helpText && !e.error ? (g(), v("div", {
1908
+ key: 1,
1909
+ id: l,
1910
+ class: "mt-1 text-caption"
1911
+ }, B(e.helpText), 1)) : D("", !0),
1912
+ e.error ? (g(), v("div", {
1913
+ key: 2,
1914
+ id: i,
1915
+ class: "mt-1 text-sm text-error font-sans",
1916
+ role: "alert",
1917
+ "aria-live": "polite"
1918
+ }, B(e.error), 1)) : D("", !0)
1919
+ ]));
1920
+ }
1921
+ }), Yn = {
1922
+ key: 1,
1923
+ class: "sr-only"
1924
+ }, Gn = /* @__PURE__ */ V({
1925
+ __name: "DsLoadingSpinner",
1926
+ props: {
1927
+ size: { default: "medium" },
1928
+ variant: { default: "primary" },
1929
+ text: {},
1930
+ centered: { type: Boolean, default: !1 }
1931
+ },
1932
+ setup(e) {
1933
+ const t = e, n = k(() => {
1934
+ const r = ["inline-flex", "items-center"];
1935
+ return t.centered && r.push("justify-center"), t.text && r.push("gap-2"), r.join(" ");
1936
+ }), o = k(() => {
1937
+ const r = [
1938
+ "animate-spin",
1939
+ "rounded-full",
1940
+ "border-solid"
1941
+ ], a = {
1942
+ small: ["w-4", "h-4", "border-2"],
1943
+ medium: ["w-6", "h-6", "border-4"],
1944
+ large: ["w-8", "h-8", "border-6"]
1945
+ }, l = {
1946
+ primary: [
1947
+ "border-brand",
1948
+ "border-t-transparent"
1949
+ ],
1950
+ secondary: [
1951
+ "border-fg-secondary",
1952
+ "border-t-transparent"
1953
+ ],
1954
+ white: [
1955
+ "border-fg-inverse",
1956
+ "border-t-transparent"
1957
+ ],
1958
+ current: [
1959
+ "border-current",
1960
+ "border-t-transparent"
1961
+ ]
1962
+ };
1963
+ return [
1964
+ ...r,
1965
+ ...a[t.size],
1966
+ ...l[t.variant]
1967
+ ].join(" ");
1968
+ }), s = k(() => [
1969
+ {
1970
+ small: "text-sm",
1971
+ medium: "text-base",
1972
+ large: "text-lg"
1973
+ }[t.size],
1974
+ "text-fg-secondary",
1975
+ "font-medium"
1976
+ ].join(" "));
1977
+ return (r, a) => (g(), v("div", {
1978
+ class: T(n.value),
1979
+ role: "status",
1980
+ "aria-live": "polite"
1981
+ }, [
1982
+ $("div", {
1983
+ class: T(o.value),
1984
+ "aria-hidden": "true"
1985
+ }, null, 2),
1986
+ e.text ? (g(), v("span", {
1987
+ key: 0,
1988
+ class: T(s.value)
1989
+ }, B(e.text), 3)) : (g(), v("span", Yn, "Loading"))
1990
+ ], 2));
1991
+ }
1992
+ }), Jn = ["aria-labelledby"], Qn = { class: "flex items-center justify-between px-6 py-4 border-b border-solid border-border" }, Zn = ["id"], _n = { class: "px-6 py-4 overflow-y-auto flex-1" }, eo = {
1993
+ key: 0,
1994
+ class: "px-6 py-4 border-t border-solid border-border"
1995
+ }, ns = /* @__PURE__ */ V({
1996
+ __name: "DsModal",
1997
+ props: {
1998
+ modelValue: { type: Boolean },
1999
+ title: {},
2000
+ size: { default: "md" },
2001
+ closable: { type: Boolean, default: !0 },
2002
+ persistent: { type: Boolean, default: !1 }
2003
+ },
2004
+ emits: ["update:modelValue", "close"],
2005
+ setup(e, { emit: t }) {
2006
+ const n = e, o = t, s = fe("modal-title"), r = j(null);
2007
+ let a = null;
2008
+ const l = k(() => `relative z-10 bg-bg rounded-lg shadow-lg w-full ${{
2009
+ sm: "max-w-sm",
2010
+ md: "max-w-lg",
2011
+ lg: "max-w-2xl",
2012
+ xl: "max-w-4xl"
2013
+ }[n.size]} max-h-[90vh] flex flex-col`);
2014
+ function i() {
2015
+ o("update:modelValue", !1), o("close");
2016
+ }
2017
+ function f() {
2018
+ n.persistent || i();
2019
+ }
2020
+ function d() {
2021
+ n.persistent || i();
2022
+ }
2023
+ function u() {
2024
+ return r.value ? Array.from(
2025
+ r.value.querySelectorAll(
2026
+ 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])'
2027
+ )
2028
+ ) : [];
2029
+ }
2030
+ function b(c) {
2031
+ if (c.key !== "Tab") return;
2032
+ const m = u();
2033
+ if (m.length === 0) return;
2034
+ const h = m[0], y = m[m.length - 1];
2035
+ c.shiftKey && document.activeElement === h ? (c.preventDefault(), y.focus()) : !c.shiftKey && document.activeElement === y && (c.preventDefault(), h.focus());
2036
+ }
2037
+ return we(
2038
+ () => n.modelValue,
2039
+ async (c) => {
2040
+ var m;
2041
+ c ? (a = document.activeElement, document.body.style.overflow = "hidden", document.addEventListener("keydown", b), await je(), (m = r.value) == null || m.focus()) : (document.body.style.overflow = "", document.removeEventListener("keydown", b), a == null || a.focus(), a = null);
2042
+ }
2043
+ ), rt(() => {
2044
+ document.body.style.overflow = "", document.removeEventListener("keydown", b);
2045
+ }), (c, m) => (g(), I(Oe, { to: "body" }, [
2046
+ ne(at, {
2047
+ "enter-active-class": "transition-opacity duration-200",
2048
+ "enter-from-class": "opacity-0",
2049
+ "enter-to-class": "opacity-100",
2050
+ "leave-active-class": "transition-opacity duration-200",
2051
+ "leave-from-class": "opacity-100",
2052
+ "leave-to-class": "opacity-0"
2053
+ }, {
2054
+ default: Re(() => [
2055
+ e.modelValue ? (g(), v("div", {
2056
+ key: 0,
2057
+ class: "fixed inset-0 z-50 flex items-center justify-center p-4",
2058
+ onKeydown: st(d, ["escape"])
2059
+ }, [
2060
+ $("div", {
2061
+ class: "absolute inset-0 bg-bg-inverse/50",
2062
+ "aria-hidden": "true",
2063
+ onClick: f
2064
+ }),
2065
+ $("div", {
2066
+ ref_key: "panelRef",
2067
+ ref: r,
2068
+ role: "dialog",
2069
+ "aria-modal": "true",
2070
+ "aria-labelledby": R(s),
2071
+ class: T(l.value),
2072
+ tabindex: "-1"
2073
+ }, [
2074
+ $("div", Qn, [
2075
+ N(c.$slots, "header", {}, () => [
2076
+ $("h2", {
2077
+ id: R(s),
2078
+ class: "text-heading-lg m-0"
2079
+ }, B(e.title), 9, Zn)
2080
+ ]),
2081
+ e.closable ? (g(), v("button", {
2082
+ key: 0,
2083
+ type: "button",
2084
+ class: "p-1 rounded-md text-fg-tertiary hover:text-fg hover:bg-surface-hover-light transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand",
2085
+ "aria-label": "Close dialog",
2086
+ onClick: i
2087
+ }, [
2088
+ ne(R(Be), { class: "w-5 h-5" })
2089
+ ])) : D("", !0)
2090
+ ]),
2091
+ $("div", _n, [
2092
+ N(c.$slots, "default")
2093
+ ]),
2094
+ c.$slots.footer ? (g(), v("div", eo, [
2095
+ N(c.$slots, "footer")
2096
+ ])) : D("", !0)
2097
+ ], 10, Jn)
2098
+ ], 32)) : D("", !0)
2099
+ ]),
2100
+ _: 3
2101
+ })
2102
+ ]));
2103
+ }
2104
+ }), to = ["id", "name", "checked", "disabled", "value"], os = /* @__PURE__ */ V({
2105
+ __name: "DsRadio",
2106
+ props: {
2107
+ modelValue: { type: [String, Number, Boolean] },
2108
+ label: {},
2109
+ id: {},
2110
+ name: {},
2111
+ value: { type: [String, Number, Boolean] },
2112
+ disabled: { type: Boolean, default: !1 },
2113
+ size: { default: "medium" }
2114
+ },
2115
+ emits: ["update:modelValue", "change"],
2116
+ setup(e, { emit: t }) {
2117
+ const n = e, o = t, s = k(() => n.modelValue === n.value), r = k(() => {
2118
+ const i = [
2119
+ "rounded-full",
2120
+ "border",
2121
+ "border-solid",
2122
+ "border-border",
2123
+ "transition-colors",
2124
+ "focus-visible:outline-none",
2125
+ "focus-visible:ring-2",
2126
+ "focus-visible:ring-brand",
2127
+ "focus-visible:ring-offset-2"
2128
+ ], f = {
2129
+ small: ["w-3", "h-3"],
2130
+ medium: ["w-4", "h-4"],
2131
+ large: ["w-5", "h-5"]
2132
+ }, d = n.disabled ? ["cursor-not-allowed", "opacity-75"] : ["cursor-pointer"];
2133
+ return [
2134
+ ...i,
2135
+ ...f[n.size],
2136
+ ...d
2137
+ ].join(" ");
2138
+ }), a = k(() => [
2139
+ "font-sans",
2140
+ "select-none",
2141
+ "transition-colors",
2142
+ {
2143
+ small: "text-xs ml-1.5",
2144
+ medium: "text-sm ml-2",
2145
+ large: "text-base ml-2.5"
2146
+ }[n.size]
2147
+ ].join(" ")), l = (i) => {
2148
+ if (n.disabled) return;
2149
+ const f = i.target, d = n.value ?? f.value;
2150
+ o("update:modelValue", d), o("change", d, i);
2151
+ };
2152
+ return (i, f) => (g(), v("label", {
2153
+ class: T([
2154
+ "inline-flex items-center",
2155
+ e.disabled ? "cursor-not-allowed opacity-75" : "cursor-pointer"
2156
+ ])
2157
+ }, [
2158
+ $("input", {
2159
+ id: e.id,
2160
+ type: "radio",
2161
+ name: e.name,
2162
+ checked: s.value,
2163
+ disabled: e.disabled,
2164
+ value: e.value,
2165
+ class: T(r.value),
2166
+ onChange: l
2167
+ }, null, 42, to),
2168
+ e.label || i.$slots.default ? (g(), v("span", {
2169
+ key: 0,
2170
+ class: T(a.value)
2171
+ }, [
2172
+ N(i.$slots, "default", {}, () => [
2173
+ X(B(e.label), 1)
2174
+ ])
2175
+ ], 2)) : D("", !0)
2176
+ ], 2));
2177
+ }
2178
+ }), no = { class: "w-full" }, oo = ["for"], so = {
2179
+ key: 0,
2180
+ class: "text-error ml-1",
2181
+ "aria-hidden": "true"
2182
+ }, ro = { class: "relative" }, ao = ["id", "value", "disabled", "required", "aria-describedby", "aria-invalid"], lo = ["selected"], io = ["value", "disabled"], co = {
2183
+ class: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3",
2184
+ "aria-hidden": "true"
2185
+ }, ss = /* @__PURE__ */ V({
2186
+ __name: "DsSelect",
2187
+ props: {
2188
+ modelValue: {},
2189
+ label: {},
2190
+ placeholder: {},
2191
+ helpText: {},
2192
+ error: {},
2193
+ size: { default: "medium" },
2194
+ disabled: { type: Boolean, default: !1 },
2195
+ required: { type: Boolean, default: !1 },
2196
+ options: {}
2197
+ },
2198
+ emits: ["update:modelValue", "blur", "focus"],
2199
+ setup(e, { emit: t }) {
2200
+ const n = e, o = t, s = fe("select"), r = `${s}-help`, a = `${s}-error`, l = k(() => {
2201
+ const d = [];
2202
+ return n.helpText && !n.error && d.push(r), n.error && d.push(a), d.length > 0 ? d.join(" ") : void 0;
2203
+ }), i = k(() => {
2204
+ const d = [
2205
+ "block",
2206
+ "w-full",
2207
+ "rounded-md",
2208
+ "border",
2209
+ "border-solid",
2210
+ "bg-bg",
2211
+ "appearance-none",
2212
+ "transition-colors",
2213
+ "focus:outline-none",
2214
+ "focus:ring-2",
2215
+ "focus:ring-offset-0",
2216
+ "disabled:cursor-not-allowed",
2217
+ "disabled:bg-surface-disabled",
2218
+ "disabled:text-fg-disabled",
2219
+ "text-fg",
2220
+ "font-sans",
2221
+ "box-border",
2222
+ "pr-10"
2223
+ ], u = {
2224
+ small: "px-2 py-1 text-sm",
2225
+ medium: "px-3 py-2 text-base",
2226
+ large: "px-4 py-3 text-lg"
2227
+ }, b = n.error ? ["border-error-border", "focus:border-error", "focus:ring-error"] : ["border-border", "focus:border-border-focus", "focus:ring-brand"];
2228
+ return [...d, u[n.size], ...b].join(" ");
2229
+ }), f = (d) => {
2230
+ const b = d.target.value, c = n.options.find((m) => String(m.value) === b);
2231
+ o("update:modelValue", c && typeof c.value == "number" ? c.value : b);
2232
+ };
2233
+ return (d, u) => (g(), v("div", no, [
2234
+ e.label ? (g(), v("label", {
2235
+ key: 0,
2236
+ for: R(s),
2237
+ class: "block text-label mb-1"
2238
+ }, [
2239
+ X(B(e.label) + " ", 1),
2240
+ e.required ? (g(), v("span", so, "*")) : D("", !0)
2241
+ ], 8, oo)) : D("", !0),
2242
+ $("div", ro, [
2243
+ $("select", {
2244
+ id: R(s),
2245
+ value: e.modelValue,
2246
+ disabled: e.disabled,
2247
+ required: e.required,
2248
+ "aria-describedby": l.value,
2249
+ "aria-invalid": e.error ? "true" : void 0,
2250
+ class: T(i.value),
2251
+ onChange: f,
2252
+ onBlur: u[0] || (u[0] = (b) => d.$emit("blur", b)),
2253
+ onFocus: u[1] || (u[1] = (b) => d.$emit("focus", b))
2254
+ }, [
2255
+ e.placeholder ? (g(), v("option", {
2256
+ key: 0,
2257
+ value: "",
2258
+ disabled: "",
2259
+ selected: !e.modelValue
2260
+ }, B(e.placeholder), 9, lo)) : D("", !0),
2261
+ (g(!0), v(se, null, re(e.options, (b) => (g(), v("option", {
2262
+ key: b.value,
2263
+ value: b.value,
2264
+ disabled: b.disabled
2265
+ }, B(b.label), 9, io))), 128))
2266
+ ], 42, ao),
2267
+ $("div", co, [
2268
+ ne(R(Ge), { class: "w-4 h-4 text-fg-tertiary" })
2269
+ ])
2270
+ ]),
2271
+ e.helpText && !e.error ? (g(), v("div", {
2272
+ key: 1,
2273
+ id: r,
2274
+ class: "mt-1 text-caption"
2275
+ }, B(e.helpText), 1)) : D("", !0),
2276
+ e.error ? (g(), v("div", {
2277
+ key: 2,
2278
+ id: a,
2279
+ class: "mt-1 text-sm text-error font-sans",
2280
+ role: "alert",
2281
+ "aria-live": "polite"
2282
+ }, B(e.error), 1)) : D("", !0)
2283
+ ]));
2284
+ }
2285
+ }), uo = { class: "w-full overflow-x-auto" }, fo = {
2286
+ class: "w-full border-collapse text-sm",
2287
+ role: "table"
2288
+ }, bo = { class: "border-b border-solid border-border bg-bg-secondary" }, mo = ["aria-sort", "onClick"], go = {
2289
+ key: 0,
2290
+ class: "inline-flex",
2291
+ "aria-hidden": "true"
2292
+ }, ho = { key: 0 }, vo = ["colspan"], po = { key: 1 }, yo = ["colspan"], xo = {
2293
+ key: 0,
2294
+ class: "flex items-center justify-between px-4 py-3 border-t border-solid border-border bg-bg-secondary text-sm"
2295
+ }, wo = { class: "text-fg-secondary" }, ko = { class: "flex gap-2" }, Fo = ["disabled"], Co = ["disabled"], rs = /* @__PURE__ */ V({
2296
+ __name: "DsTable",
2297
+ props: {
2298
+ columns: {},
2299
+ rows: {},
2300
+ sortBy: {},
2301
+ sortOrder: {},
2302
+ loading: { type: Boolean, default: !1 },
2303
+ emptyText: { default: "No data available" },
2304
+ striped: { type: Boolean, default: !1 },
2305
+ stickyHeader: { type: Boolean, default: !1 },
2306
+ pagination: {}
2307
+ },
2308
+ emits: ["update:sortBy", "update:sortOrder", "update:page"],
2309
+ setup(e, { emit: t }) {
2310
+ const n = e, o = t, s = k(() => n.pagination ? Math.ceil(n.pagination.total / n.pagination.perPage) : 0), r = k(() => n.pagination ? (n.pagination.page - 1) * n.pagination.perPage + 1 : 0), a = k(() => n.pagination ? Math.min(
2311
+ n.pagination.page * n.pagination.perPage,
2312
+ n.pagination.total
2313
+ ) : 0);
2314
+ function l(b) {
2315
+ n.sortBy === b ? n.sortOrder === "asc" ? o("update:sortOrder", "desc") : (o("update:sortBy", ""), o("update:sortOrder", "asc")) : (o("update:sortBy", b), o("update:sortOrder", "asc"));
2316
+ }
2317
+ function i(b) {
2318
+ if (b.sortable)
2319
+ return n.sortBy !== b.key ? "none" : n.sortOrder === "asc" ? "ascending" : "descending";
2320
+ }
2321
+ function f(b) {
2322
+ return b === "center" ? "justify-center" : b === "right" ? "justify-end" : "";
2323
+ }
2324
+ function d(b) {
2325
+ return [
2326
+ "px-4 py-3 text-left text-overline",
2327
+ b.sortable ? "cursor-pointer select-none hover:text-fg" : ""
2328
+ ].join(" ");
2329
+ }
2330
+ function u(b) {
2331
+ return `px-4 py-3 ${b.align === "center" ? "text-center" : b.align === "right" ? "text-right" : "text-left"}`;
2332
+ }
2333
+ return (b, c) => (g(), v("div", uo, [
2334
+ $("table", fo, [
2335
+ $("thead", {
2336
+ class: T(e.stickyHeader ? "sticky top-0 z-10" : "")
2337
+ }, [
2338
+ $("tr", bo, [
2339
+ (g(!0), v(se, null, re(e.columns, (m) => (g(), v("th", {
2340
+ key: m.key,
2341
+ style: he(m.width ? { width: m.width } : void 0),
2342
+ class: T(d(m)),
2343
+ "aria-sort": i(m),
2344
+ onClick: (h) => m.sortable ? l(m.key) : void 0
2345
+ }, [
2346
+ $("div", {
2347
+ class: T(["flex items-center gap-1", f(m.align)])
2348
+ }, [
2349
+ N(b.$slots, `header-${m.key}`, { column: m }, () => [
2350
+ X(B(m.label), 1)
2351
+ ]),
2352
+ m.sortable ? (g(), v("span", go, [
2353
+ e.sortBy === m.key && e.sortOrder === "asc" ? (g(), I(R(Sn), {
2354
+ key: 0,
2355
+ class: "w-4 h-4"
2356
+ })) : e.sortBy === m.key && e.sortOrder === "desc" ? (g(), I(R(Ge), {
2357
+ key: 1,
2358
+ class: "w-4 h-4"
2359
+ })) : (g(), I(R(Vn), {
2360
+ key: 2,
2361
+ class: "w-4 h-4 text-fg-tertiary"
2362
+ }))
2363
+ ])) : D("", !0)
2364
+ ], 2)
2365
+ ], 14, mo))), 128))
2366
+ ])
2367
+ ], 2),
2368
+ $("tbody", null, [
2369
+ e.loading ? (g(), v("tr", ho, [
2370
+ $("td", {
2371
+ colspan: e.columns.length,
2372
+ class: "text-center py-12"
2373
+ }, [
2374
+ N(b.$slots, "loading", {}, () => [
2375
+ ne(Gn, { centered: "" })
2376
+ ])
2377
+ ], 8, vo)
2378
+ ])) : e.rows.length === 0 ? (g(), v("tr", po, [
2379
+ $("td", {
2380
+ colspan: e.columns.length,
2381
+ class: "text-center py-12 text-fg-secondary"
2382
+ }, [
2383
+ N(b.$slots, "empty", {}, () => [
2384
+ X(B(e.emptyText), 1)
2385
+ ])
2386
+ ], 8, yo)
2387
+ ])) : D("", !0),
2388
+ (g(!0), v(se, null, re(e.rows, (m, h) => (g(), v("tr", {
2389
+ key: h,
2390
+ class: T([
2391
+ "border-b border-solid border-border-light transition-colors hover:bg-surface-hover-light",
2392
+ e.striped && h % 2 === 1 ? "bg-bg-secondary" : ""
2393
+ ])
2394
+ }, [
2395
+ (g(!0), v(se, null, re(e.columns, (y) => (g(), v("td", {
2396
+ key: y.key,
2397
+ class: T(u(y))
2398
+ }, [
2399
+ N(b.$slots, `cell-${y.key}`, {
2400
+ row: m,
2401
+ value: m[y.key],
2402
+ index: h
2403
+ }, () => [
2404
+ X(B(m[y.key]), 1)
2405
+ ])
2406
+ ], 2))), 128))
2407
+ ], 2))), 128))
2408
+ ])
2409
+ ]),
2410
+ e.pagination ? (g(), v("div", xo, [
2411
+ $("span", wo, B(r.value) + "–" + B(a.value) + " of " + B(e.pagination.total), 1),
2412
+ $("div", ko, [
2413
+ $("button", {
2414
+ type: "button",
2415
+ disabled: e.pagination.page <= 1,
2416
+ class: "px-3 py-1 rounded-md border border-solid border-border bg-bg text-fg disabled:opacity-50 disabled:cursor-not-allowed hover:bg-surface-hover-light transition-colors",
2417
+ onClick: c[0] || (c[0] = (m) => b.$emit("update:page", e.pagination.page - 1))
2418
+ }, " Previous ", 8, Fo),
2419
+ $("button", {
2420
+ type: "button",
2421
+ disabled: e.pagination.page >= s.value,
2422
+ class: "px-3 py-1 rounded-md border border-solid border-border bg-bg text-fg disabled:opacity-50 disabled:cursor-not-allowed hover:bg-surface-hover-light transition-colors",
2423
+ onClick: c[1] || (c[1] = (m) => b.$emit("update:page", e.pagination.page + 1))
2424
+ }, " Next ", 8, Co)
2425
+ ])
2426
+ ])) : D("", !0)
2427
+ ]));
2428
+ }
2429
+ }), $o = ["aria-label"], Do = ["id", "aria-selected", "aria-controls", "tabindex", "disabled", "onClick", "onKeydown"], Eo = ["id", "aria-labelledby", "hidden"], as = /* @__PURE__ */ V({
2430
+ __name: "DsTabs",
2431
+ props: {
2432
+ modelValue: {},
2433
+ tabs: {},
2434
+ variant: { default: "line" },
2435
+ ariaLabel: { default: "Tabs" }
2436
+ },
2437
+ emits: ["update:modelValue"],
2438
+ setup(e, { emit: t }) {
2439
+ const n = e, o = t, s = fe("tabs"), r = k(
2440
+ () => n.variant === "line" ? "flex border-b border-solid border-border gap-0" : "flex gap-1 bg-neutral-soft p-1 rounded-lg"
2441
+ );
2442
+ function a(f) {
2443
+ f.disabled || o("update:modelValue", f.key);
2444
+ }
2445
+ function l(f) {
2446
+ const d = n.modelValue === f.key, u = "font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed";
2447
+ return n.variant === "line" ? [
2448
+ u,
2449
+ "px-4 py-2 text-sm border-b-2 border-solid border-t-0 border-l-0 border-r-0 bg-transparent -mb-px",
2450
+ d ? "border-b-brand text-brand" : "border-b-transparent text-fg-secondary hover:text-fg hover:border-b-border-strong"
2451
+ ].join(" ") : [
2452
+ u,
2453
+ "px-3 py-1.5 text-sm rounded-md border-0",
2454
+ d ? "bg-bg text-fg shadow-default" : "bg-transparent text-fg-secondary hover:text-fg"
2455
+ ].join(" ");
2456
+ }
2457
+ function i(f, d) {
2458
+ const u = n.tabs.filter((y) => !y.disabled), b = u.findIndex(
2459
+ (y) => y.key === n.tabs[d].key
2460
+ );
2461
+ let c = -1;
2462
+ switch (f.key) {
2463
+ case "ArrowRight":
2464
+ case "ArrowDown":
2465
+ f.preventDefault(), c = (b + 1) % u.length;
2466
+ break;
2467
+ case "ArrowLeft":
2468
+ case "ArrowUp":
2469
+ f.preventDefault(), c = (b - 1 + u.length) % u.length;
2470
+ break;
2471
+ case "Home":
2472
+ f.preventDefault(), c = 0;
2473
+ break;
2474
+ case "End":
2475
+ f.preventDefault(), c = u.length - 1;
2476
+ break;
2477
+ default:
2478
+ return;
2479
+ }
2480
+ const m = u[c];
2481
+ o("update:modelValue", m.key);
2482
+ const h = document.getElementById(`${s}-tab-${m.key}`);
2483
+ h == null || h.focus();
2484
+ }
2485
+ return (f, d) => (g(), v("div", null, [
2486
+ $("div", {
2487
+ class: T(r.value),
2488
+ role: "tablist",
2489
+ "aria-label": e.ariaLabel
2490
+ }, [
2491
+ (g(!0), v(se, null, re(e.tabs, (u, b) => (g(), v("button", {
2492
+ key: u.key,
2493
+ id: `${R(s)}-tab-${u.key}`,
2494
+ role: "tab",
2495
+ type: "button",
2496
+ "aria-selected": e.modelValue === u.key,
2497
+ "aria-controls": `${R(s)}-panel-${u.key}`,
2498
+ tabindex: e.modelValue === u.key ? 0 : -1,
2499
+ disabled: u.disabled,
2500
+ class: T(l(u)),
2501
+ onClick: (c) => a(u),
2502
+ onKeydown: (c) => i(c, b)
2503
+ }, B(u.label), 43, Do))), 128))
2504
+ ], 10, $o),
2505
+ (g(!0), v(se, null, re(e.tabs, (u) => (g(), v("div", {
2506
+ key: u.key,
2507
+ id: `${R(s)}-panel-${u.key}`,
2508
+ role: "tabpanel",
2509
+ "aria-labelledby": `${R(s)}-tab-${u.key}`,
2510
+ hidden: e.modelValue !== u.key,
2511
+ tabindex: 0
2512
+ }, [
2513
+ e.modelValue === u.key ? N(f.$slots, u.key, { key: 0 }) : D("", !0)
2514
+ ], 8, Eo))), 128))
2515
+ ]));
2516
+ }
2517
+ }), Ao = { class: "w-full" }, Bo = ["for"], To = {
2518
+ key: 0,
2519
+ class: "text-error ml-1",
2520
+ "aria-hidden": "true"
2521
+ }, Ro = { class: "relative" }, Oo = ["id", "value", "placeholder", "disabled", "readonly", "required", "rows", "maxlength", "aria-describedby", "aria-invalid"], Lo = {
2522
+ key: 1,
2523
+ class: "flex justify-between mt-1"
2524
+ }, So = {
2525
+ key: 2,
2526
+ class: "text-caption ml-auto"
2527
+ }, ls = /* @__PURE__ */ V({
2528
+ __name: "DsTextarea",
2529
+ props: {
2530
+ modelValue: {},
2531
+ label: {},
2532
+ placeholder: {},
2533
+ helpText: {},
2534
+ error: {},
2535
+ size: { default: "medium" },
2536
+ disabled: { type: Boolean, default: !1 },
2537
+ readonly: { type: Boolean, default: !1 },
2538
+ required: { type: Boolean, default: !1 },
2539
+ rows: { default: 3 },
2540
+ maxLength: {}
2541
+ },
2542
+ emits: ["update:modelValue", "blur", "focus"],
2543
+ setup(e, { expose: t, emit: n }) {
2544
+ const o = e, s = n, r = j(null), a = fe("textarea"), l = `${a}-help`, i = `${a}-error`, f = k(() => {
2545
+ const h = [];
2546
+ return o.helpText && !o.error && h.push(l), o.error && h.push(i), h.length > 0 ? h.join(" ") : void 0;
2547
+ }), d = k(() => (o.modelValue || "").length), u = k(() => {
2548
+ const h = [
2549
+ "block",
2550
+ "w-full",
2551
+ "rounded-md",
2552
+ "border",
2553
+ "border-solid",
2554
+ "bg-bg",
2555
+ "text-fg",
2556
+ "font-sans",
2557
+ "transition-colors",
2558
+ "resize-y",
2559
+ "placeholder:text-fg-tertiary",
2560
+ "focus:outline-none",
2561
+ "focus:ring-2",
2562
+ "focus:ring-offset-0",
2563
+ "disabled:cursor-not-allowed",
2564
+ "disabled:bg-surface-disabled",
2565
+ "disabled:text-fg-disabled",
2566
+ "box-border"
2567
+ ], y = {
2568
+ small: "px-2 py-1 text-sm",
2569
+ medium: "px-3 py-2 text-base",
2570
+ large: "px-4 py-3 text-lg"
2571
+ }, w = o.error ? ["border-error-border", "focus:border-error", "focus:ring-error"] : ["border-border", "focus:border-border-focus", "focus:ring-brand"];
2572
+ return [...h, y[o.size], ...w].join(" ");
2573
+ }), b = (h) => {
2574
+ const y = h.target;
2575
+ s("update:modelValue", y.value);
2576
+ };
2577
+ function c() {
2578
+ var h;
2579
+ (h = r.value) == null || h.focus();
2580
+ }
2581
+ function m() {
2582
+ var h;
2583
+ (h = r.value) == null || h.blur();
2584
+ }
2585
+ return t({ focus: c, blur: m, textareaRef: r }), (h, y) => (g(), v("div", Ao, [
2586
+ e.label ? (g(), v("label", {
2587
+ key: 0,
2588
+ for: R(a),
2589
+ class: "block text-label mb-1"
2590
+ }, [
2591
+ X(B(e.label) + " ", 1),
2592
+ e.required ? (g(), v("span", To, "*")) : D("", !0)
2593
+ ], 8, Bo)) : D("", !0),
2594
+ $("div", Ro, [
2595
+ $("textarea", {
2596
+ ref_key: "textareaRef",
2597
+ ref: r,
2598
+ id: R(a),
2599
+ value: e.modelValue,
2600
+ placeholder: e.placeholder,
2601
+ disabled: e.disabled,
2602
+ readonly: e.readonly,
2603
+ required: e.required,
2604
+ rows: e.rows,
2605
+ maxlength: e.maxLength,
2606
+ "aria-describedby": f.value,
2607
+ "aria-invalid": e.error ? "true" : void 0,
2608
+ class: T(u.value),
2609
+ onInput: b,
2610
+ onBlur: y[0] || (y[0] = (w) => h.$emit("blur", w)),
2611
+ onFocus: y[1] || (y[1] = (w) => h.$emit("focus", w))
2612
+ }, null, 42, Oo)
2613
+ ]),
2614
+ e.helpText || e.error || e.maxLength ? (g(), v("div", Lo, [
2615
+ e.helpText && !e.error ? (g(), v("div", {
2616
+ key: 0,
2617
+ id: l,
2618
+ class: "text-caption"
2619
+ }, B(e.helpText), 1)) : D("", !0),
2620
+ e.error ? (g(), v("div", {
2621
+ key: 1,
2622
+ id: i,
2623
+ class: "text-sm text-error font-sans",
2624
+ role: "alert",
2625
+ "aria-live": "polite"
2626
+ }, B(e.error), 1)) : D("", !0),
2627
+ e.maxLength ? (g(), v("div", So, B(d.value) + " / " + B(e.maxLength), 1)) : D("", !0)
2628
+ ])) : D("", !0)
2629
+ ]));
2630
+ }
2631
+ }), Vo = ["role", "aria-live"], zo = { class: "flex items-start gap-3 flex-1 min-w-0" }, Mo = { class: "flex-1 min-w-0" }, jo = {
2632
+ key: 0,
2633
+ class: "text-label m-0"
2634
+ }, Po = /* @__PURE__ */ V({
2635
+ __name: "DsToast",
2636
+ props: {
2637
+ toast: {}
2638
+ },
2639
+ emits: ["dismiss"],
2640
+ setup(e, { emit: t }) {
2641
+ const n = e, o = t;
2642
+ let s = null, r = n.toast.duration, a = 0;
2643
+ function l() {
2644
+ r <= 0 || (a = Date.now(), s = setTimeout(() => {
2645
+ o("dismiss", n.toast.id);
2646
+ }, r));
2647
+ }
2648
+ function i() {
2649
+ s && (clearTimeout(s), s = null, r -= Date.now() - a);
2650
+ }
2651
+ function f() {
2652
+ l();
2653
+ }
2654
+ const d = {
2655
+ brand: "border-l-brand",
2656
+ error: "border-l-error",
2657
+ success: "border-l-success",
2658
+ warning: "border-l-warning",
2659
+ info: "border-l-info"
2660
+ }, u = k(() => [
2661
+ "flex items-start gap-3 w-80 p-4 bg-bg border border-solid border-border rounded-lg shadow-lg",
2662
+ "border-l-4",
2663
+ d[n.toast.variant] || "border-l-brand"
2664
+ ].join(" ")), b = {
2665
+ brand: "text-brand",
2666
+ error: "text-error",
2667
+ success: "text-success",
2668
+ warning: "text-warning",
2669
+ info: "text-info"
2670
+ }, c = k(() => ["shrink-0 mt-0.5", b[n.toast.variant] || "text-brand"].join(" "));
2671
+ return Dt(() => {
2672
+ n.toast.duration > 0 && l();
2673
+ }), rt(() => {
2674
+ s && clearTimeout(s);
2675
+ }), (m, h) => (g(), v("div", {
2676
+ class: T(u.value),
2677
+ role: e.toast.variant === "error" ? "alert" : "status",
2678
+ "aria-live": e.toast.variant === "error" ? "assertive" : "polite",
2679
+ onMouseenter: i,
2680
+ onMouseleave: f
2681
+ }, [
2682
+ $("div", zo, [
2683
+ $("span", {
2684
+ class: T(c.value),
2685
+ "aria-hidden": "true"
2686
+ }, [
2687
+ e.toast.variant === "success" ? (g(), I(R(Rn), {
2688
+ key: 0,
2689
+ class: "w-5 h-5"
2690
+ })) : e.toast.variant === "error" ? (g(), I(R(Be), {
2691
+ key: 1,
2692
+ class: "w-5 h-5"
2693
+ })) : e.toast.variant === "warning" ? (g(), I(R(On), {
2694
+ key: 2,
2695
+ class: "w-5 h-5"
2696
+ })) : (g(), I(R(Ln), {
2697
+ key: 3,
2698
+ class: "w-5 h-5"
2699
+ }))
2700
+ ], 2),
2701
+ $("div", Mo, [
2702
+ e.toast.title ? (g(), v("p", jo, B(e.toast.title), 1)) : D("", !0),
2703
+ $("p", {
2704
+ class: T(["text-body-sm m-0", e.toast.title ? "mt-0.5" : ""])
2705
+ }, B(e.toast.message), 3)
2706
+ ])
2707
+ ]),
2708
+ e.toast.closable ? (g(), v("button", {
2709
+ key: 0,
2710
+ type: "button",
2711
+ class: "p-1 rounded-md text-fg-tertiary hover:text-fg transition-colors shrink-0 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand",
2712
+ "aria-label": "Dismiss notification",
2713
+ onClick: h[0] || (h[0] = (y) => m.$emit("dismiss", e.toast.id))
2714
+ }, [
2715
+ ne(R(Be), { class: "w-4 h-4" })
2716
+ ])) : D("", !0)
2717
+ ], 42, Vo));
2718
+ }
2719
+ });
2720
+ let Io = 0;
2721
+ const Te = j([]);
2722
+ function xe(e, t, n) {
2723
+ const o = ++Io, s = {
2724
+ id: o,
2725
+ variant: e,
2726
+ message: t,
2727
+ title: n == null ? void 0 : n.title,
2728
+ duration: (n == null ? void 0 : n.duration) ?? 5e3,
2729
+ closable: (n == null ? void 0 : n.closable) ?? !0
2730
+ };
2731
+ return Te.value.push(s), o;
2732
+ }
2733
+ function No(e) {
2734
+ const t = Te.value.findIndex((n) => n.id === e);
2735
+ t !== -1 && Te.value.splice(t, 1);
2736
+ }
2737
+ function Wo() {
2738
+ return {
2739
+ toasts: Te,
2740
+ removeToast: No,
2741
+ success: (e, t) => xe("success", e, t),
2742
+ error: (e, t) => xe("error", e, t),
2743
+ warning: (e, t) => xe("warning", e, t),
2744
+ info: (e, t) => xe("info", e, t),
2745
+ brand: (e, t) => xe("brand", e, t)
2746
+ };
2747
+ }
2748
+ const Ho = {
2749
+ class: "fixed top-4 right-4 z-50 flex flex-col gap-3",
2750
+ "aria-label": "Notifications"
2751
+ }, is = /* @__PURE__ */ V({
2752
+ __name: "DsToastContainer",
2753
+ setup(e) {
2754
+ const { toasts: t, removeToast: n } = Wo();
2755
+ return (o, s) => (g(), I(Oe, { to: "body" }, [
2756
+ $("div", Ho, [
2757
+ ne(Et, {
2758
+ "enter-active-class": "transition-all duration-300 ease-out",
2759
+ "enter-from-class": "opacity-0 translate-x-8",
2760
+ "enter-to-class": "opacity-100 translate-x-0",
2761
+ "leave-active-class": "transition-all duration-200 ease-in",
2762
+ "leave-from-class": "opacity-100 translate-x-0",
2763
+ "leave-to-class": "opacity-0 translate-x-8"
2764
+ }, {
2765
+ default: Re(() => [
2766
+ (g(!0), v(se, null, re(R(t), (r) => (g(), I(Po, {
2767
+ key: r.id,
2768
+ toast: r,
2769
+ onDismiss: R(n)
2770
+ }, null, 8, ["toast", "onDismiss"]))), 128))
2771
+ ]),
2772
+ _: 1
2773
+ })
2774
+ ])
2775
+ ]));
2776
+ }
2777
+ }), qo = ["aria-describedby"], Ko = ["id"], cs = /* @__PURE__ */ V({
2778
+ __name: "DsTooltip",
2779
+ props: {
2780
+ content: {},
2781
+ placement: { default: "top" },
2782
+ disabled: { type: Boolean, default: !1 }
2783
+ },
2784
+ setup(e) {
2785
+ const t = e, n = fe("tooltip"), o = j(!1), s = j(null), r = j(null), a = j(null), { floatingStyles: l, middlewareData: i, placement: f } = xt(s, r, {
2786
+ placement: k(() => t.placement),
2787
+ middleware: [ht(8), pt(), vt({ padding: 8 }), Tn({ element: a })]
2788
+ }), d = k(() => {
2789
+ const c = i.value.arrow;
2790
+ if (!c) return {};
2791
+ const m = f.value.split("-")[0], h = { top: "bottom", right: "left", bottom: "top", left: "right" }[m];
2792
+ return {
2793
+ left: c.x != null ? `${c.x}px` : "",
2794
+ top: c.y != null ? `${c.y}px` : "",
2795
+ [h]: "-4px"
2796
+ };
2797
+ });
2798
+ function u() {
2799
+ t.disabled || (o.value = !0);
2800
+ }
2801
+ function b() {
2802
+ o.value = !1;
2803
+ }
2804
+ return (c, m) => (g(), v("div", {
2805
+ class: "inline-flex",
2806
+ onMouseenter: u,
2807
+ onMouseleave: b,
2808
+ onFocusin: u,
2809
+ onFocusout: b
2810
+ }, [
2811
+ $("div", {
2812
+ ref_key: "referenceRef",
2813
+ ref: s,
2814
+ "aria-describedby": o.value ? R(n) : void 0
2815
+ }, [
2816
+ N(c.$slots, "default")
2817
+ ], 8, qo),
2818
+ (g(), I(Oe, { to: "body" }, [
2819
+ ne(at, {
2820
+ "enter-active-class": "transition-opacity duration-150",
2821
+ "enter-from-class": "opacity-0",
2822
+ "enter-to-class": "opacity-100",
2823
+ "leave-active-class": "transition-opacity duration-150",
2824
+ "leave-from-class": "opacity-100",
2825
+ "leave-to-class": "opacity-0"
2826
+ }, {
2827
+ default: Re(() => [
2828
+ o.value && !e.disabled ? (g(), v("div", {
2829
+ key: 0,
2830
+ id: R(n),
2831
+ ref_key: "floatingRef",
2832
+ ref: r,
2833
+ role: "tooltip",
2834
+ style: he(R(l)),
2835
+ class: "z-50 px-2 py-1 text-xs font-medium bg-bg-inverse text-fg-inverse rounded-md shadow-md max-w-xs pointer-events-none"
2836
+ }, [
2837
+ X(B(e.content) + " ", 1),
2838
+ $("div", {
2839
+ ref_key: "arrowRef",
2840
+ ref: a,
2841
+ style: he(d.value),
2842
+ class: "absolute w-2 h-2 bg-bg-inverse rotate-45"
2843
+ }, null, 4)
2844
+ ], 12, Ko)) : D("", !0)
2845
+ ]),
2846
+ _: 1
2847
+ })
2848
+ ]))
2849
+ ], 32));
2850
+ }
2851
+ }), Uo = {
2852
+ // Core UI
2853
+ bg: "#FFFFFF",
2854
+ "bg-secondary": "#F8FAFC",
2855
+ "bg-tertiary": "#F1F5F9",
2856
+ "bg-inverse": "#0F172A",
2857
+ "bg-inverse-secondary": "#1E293B",
2858
+ fg: "#0F172A",
2859
+ "fg-secondary": "#64748B",
2860
+ "fg-tertiary": "#94A3B8",
2861
+ "fg-inverse": "#FFFFFF",
2862
+ "fg-disabled": "#94A3B8",
2863
+ icon: "#64748B",
2864
+ "icon-hover": "#0F172A",
2865
+ "icon-active": "#0EA5E9",
2866
+ "icon-inverse": "#FFFFFF",
2867
+ "icon-disabled": "#CBD5E1",
2868
+ border: "#E2E8F0",
2869
+ "border-light": "#F1F5F9",
2870
+ "border-strong": "#CBD5E1",
2871
+ "border-focus": "#0F172A",
2872
+ "surface-hover": "#E2E8F0",
2873
+ "surface-hover-light": "#F1F5F9",
2874
+ "surface-active": "#B7E6FD",
2875
+ "surface-disabled": "#FAFCFF",
2876
+ // Brand
2877
+ brand: "#0EA5E9",
2878
+ "brand-hover": "#0284C7",
2879
+ "brand-active": "#0369A1",
2880
+ "brand-disabled": "#BAE6FD",
2881
+ "brand-soft": "#F0F9FF",
2882
+ "brand-soft-hover": "#E0F2FE",
2883
+ "brand-soft-active": "#B7E6FD",
2884
+ "brand-on-solid": "#FFFFFF",
2885
+ "brand-on-soft": "#0EA5E9",
2886
+ "brand-secondary": "#6366F1",
2887
+ // Neutral
2888
+ neutral: "#64748B",
2889
+ "neutral-soft": "#F8FAFC",
2890
+ "neutral-soft-hover": "#F1F5F9",
2891
+ "neutral-soft-active": "#E2E8F0",
2892
+ "neutral-on-solid": "#FFFFFF",
2893
+ "neutral-on-soft": "#0F172A",
2894
+ "neutral-border": "#D1D5DB",
2895
+ "neutral-border-hover": "#B5BCC9",
2896
+ "neutral-border-strong": "#94A3B8",
2897
+ // Error
2898
+ error: "#EF4444",
2899
+ "error-hover": "#DC2626",
2900
+ "error-active": "#B91C1C",
2901
+ "error-soft": "#FEF2F2",
2902
+ "error-soft-hover": "#FEE2E2",
2903
+ "error-soft-active": "#FECACA",
2904
+ "error-on-solid": "#FFFFFF",
2905
+ "error-on-soft": "#EF4444",
2906
+ "error-border": "#F8CDD1",
2907
+ "error-border-hover": "#F5A6B3",
2908
+ "error-border-strong": "#B91C1C",
2909
+ // Success
2910
+ success: "#10B981",
2911
+ "success-hover": "#0A8D63",
2912
+ "success-active": "#047857",
2913
+ "success-soft": "#ECFDF5",
2914
+ "success-soft-hover": "#D1FAE5",
2915
+ "success-soft-active": "#A7F3D0",
2916
+ "success-on-solid": "#FFFFFF",
2917
+ "success-on-soft": "#10B981",
2918
+ "success-border": "#BEF3D0",
2919
+ "success-border-hover": "#86EFAC",
2920
+ "success-border-strong": "#0EA875",
2921
+ // Warning
2922
+ warning: "#F59E0B",
2923
+ "warning-hover": "#D97706",
2924
+ "warning-active": "#B45309",
2925
+ "warning-soft": "#FFFBEB",
2926
+ "warning-soft-hover": "#FEF3C7",
2927
+ "warning-soft-active": "#FDE68A",
2928
+ "warning-on-solid": "#FFFFFF",
2929
+ "warning-on-soft": "#92400E",
2930
+ "warning-border": "#F3E6A5",
2931
+ "warning-border-hover": "#E6D378",
2932
+ // Info
2933
+ info: "#3B82F6",
2934
+ "info-hover": "#2563EB",
2935
+ "info-active": "#1D4ED8",
2936
+ "info-soft": "#EFF6FF",
2937
+ "info-soft-hover": "#DBEAFE",
2938
+ "info-soft-active": "#BFDBFE",
2939
+ "info-on-solid": "#FFFFFF",
2940
+ "info-on-soft": "#1E40AF",
2941
+ "info-border": "#C5D7F5",
2942
+ "info-border-hover": "#A8CCF2",
2943
+ // Processing
2944
+ processing: "#06B6D4",
2945
+ "processing-hover": "#0891B2",
2946
+ "processing-active": "#0E7490",
2947
+ "processing-soft": "#ECFEFF",
2948
+ "processing-soft-hover": "#CFFAFE",
2949
+ "processing-soft-active": "#A5F3FC",
2950
+ "processing-on-solid": "#FFFFFF",
2951
+ "processing-on-soft": "#155E75",
2952
+ "processing-border": "#B3F0FC",
2953
+ "processing-border-hover": "#7FE8F5",
2954
+ // Transcript (domain-specific)
2955
+ "transcript-bg": "#FEFCE8",
2956
+ "transcript-highlight": "#FEF3C7",
2957
+ "transcript-speaker": "#EDE9FE",
2958
+ "transcript-timestamp": "#F3F4F6"
2959
+ }, Xo = {
2960
+ "space-1": "4px",
2961
+ "space-2": "8px",
2962
+ "space-3": "12px",
2963
+ "space-4": "16px",
2964
+ "space-5": "24px",
2965
+ "space-6": "32px",
2966
+ "space-7": "48px",
2967
+ "space-8": "64px"
2968
+ }, Yo = {
2969
+ "radius-sm": "4px",
2970
+ "radius-md": "6px",
2971
+ "radius-lg": "8px",
2972
+ "radius-xl": "12px",
2973
+ "radius-full": "9999px"
2974
+ }, Go = {
2975
+ "shadow-sm": "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
2976
+ "shadow-md": "0 2px 4px -1px rgba(0, 0, 0, 0.06), 0 4px 6px -1px rgba(0, 0, 0, 0.1)",
2977
+ "shadow-lg": "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)"
2978
+ }, ds = { ...Uo, ...Xo, ...Yo, ...Go };
2979
+ function us(e) {
2980
+ return `--ds-${e}`;
2981
+ }
2982
+ function fs(e, t = ":root") {
2983
+ const n = Object.entries(e).map(([o, s]) => ` --ds-${o}: ${s};`).join(`
2984
+ `);
2985
+ return `${t} {
2986
+ ${n}
2987
+ }`;
2988
+ }
2989
+ export {
2990
+ Qo as DsAvatar,
2991
+ Zo as DsBadge,
2992
+ Ot as DsButton,
2993
+ _o as DsCheckbox,
2994
+ es as DsDropdownSelect,
2995
+ ts as DsInput,
2996
+ Gn as DsLoadingSpinner,
2997
+ ns as DsModal,
2998
+ os as DsRadio,
2999
+ ss as DsSelect,
3000
+ rs as DsTable,
3001
+ as as DsTabs,
3002
+ ls as DsTextarea,
3003
+ Po as DsToast,
3004
+ is as DsToastContainer,
3005
+ cs as DsTooltip,
3006
+ ds as allTokens,
3007
+ Uo as colorTokens,
3008
+ fs as generateThemeCss,
3009
+ Yo as radiusTokens,
3010
+ Go as shadowTokens,
3011
+ Xo as spacingTokens,
3012
+ us as tokenToCssVar,
3013
+ fe as useId,
3014
+ Wo as useToast
3015
+ };