@donkit-ai/design-system 1.4.74 → 1.4.75

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.es.js CHANGED
@@ -1,6 +1,6 @@
1
- import q, { useState as I, useRef as R, useEffect as P, useLayoutEffect as nt, forwardRef as Je, useCallback as le, useContext as de, createContext as Ze } from "react";
1
+ import q, { useState as B, useRef as R, useEffect as P, useLayoutEffect as nt, forwardRef as Je, useCallback as ce, useContext as ue, createContext as Ze } from "react";
2
2
  import { Check as Re, X as ee, ChevronDown as je, Minus as rt, Plus as at, XCircle as Se, AlertTriangle as Ae, CheckCircle as De, Info as Ie, ChevronUp as ot, ChevronsUpDown as it, ChevronLeft as lt, ChevronRight as ct, Copy as dt, Brain as ut, Loader as ft, Paperclip as ze, Square as mt, ArrowUp as pt, Zap as ht, Cpu as Fe, FileText as xt, ThumbsUp as vt, ThumbsDown as _t } from "lucide-react";
3
- import me from "react-dom";
3
+ import re from "react-dom";
4
4
  const C = {
5
5
  1: 16,
6
6
  2: 20,
@@ -59,13 +59,13 @@ function jt() {
59
59
  return f.$$typeof === F ? null : f.displayName || f.name || null;
60
60
  if (typeof f == "string") return f;
61
61
  switch (f) {
62
- case g:
62
+ case b:
63
63
  return "Fragment";
64
- case _:
64
+ case N:
65
65
  return "Profiler";
66
66
  case $:
67
67
  return "StrictMode";
68
- case B:
68
+ case D:
69
69
  return "Suspense";
70
70
  case M:
71
71
  return "SuspenseList";
@@ -76,11 +76,11 @@ function jt() {
76
76
  switch (typeof f.tag == "number" && console.error(
77
77
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
78
78
  ), f.$$typeof) {
79
- case b:
79
+ case w:
80
80
  return "Portal";
81
81
  case y:
82
82
  return f.displayName || "Context";
83
- case N:
83
+ case _:
84
84
  return (f._context.displayName || "Context") + ".Consumer";
85
85
  case S:
86
86
  var T = f.render;
@@ -117,7 +117,7 @@ function jt() {
117
117
  }
118
118
  }
119
119
  function r(f) {
120
- if (f === g) return "<>";
120
+ if (f === b) return "<>";
121
121
  if (typeof f == "object" && f !== null && f.$$typeof === z)
122
122
  return "<...>";
123
123
  try {
@@ -159,10 +159,10 @@ function jt() {
159
159
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
160
160
  )), f = this.props.ref, f !== void 0 ? f : null;
161
161
  }
162
- function d(f, T, O, Y, te, oe) {
162
+ function d(f, T, O, Y, te, ie) {
163
163
  var H = O.ref;
164
164
  return f = {
165
- $$typeof: x,
165
+ $$typeof: h,
166
166
  type: f,
167
167
  key: T,
168
168
  props: O,
@@ -189,22 +189,22 @@ function jt() {
189
189
  configurable: !1,
190
190
  enumerable: !1,
191
191
  writable: !0,
192
- value: oe
192
+ value: ie
193
193
  }), Object.freeze && (Object.freeze(f.props), Object.freeze(f)), f;
194
194
  }
195
- function u(f, T, O, Y, te, oe) {
195
+ function u(f, T, O, Y, te, ie) {
196
196
  var H = T.children;
197
197
  if (H !== void 0)
198
198
  if (Y)
199
- if (D(H)) {
199
+ if (I(H)) {
200
200
  for (Y = 0; Y < H.length; Y++)
201
- p(H[Y]);
201
+ m(H[Y]);
202
202
  Object.freeze && Object.freeze(H);
203
203
  } else
204
204
  console.error(
205
205
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
206
206
  );
207
- else p(H);
207
+ else m(H);
208
208
  if (V.call(T, "key")) {
209
209
  H = t(f);
210
210
  var Q = Object.keys(T).filter(function(ge) {
@@ -225,8 +225,8 @@ React keys must be passed directly to JSX without using spread:
225
225
  }
226
226
  if (H = null, O !== void 0 && (n(O), H = "" + O), i(T) && (n(T.key), H = "" + T.key), "key" in T) {
227
227
  O = {};
228
- for (var ie in T)
229
- ie !== "key" && (O[ie] = T[ie]);
228
+ for (var le in T)
229
+ le !== "key" && (O[le] = T[le]);
230
230
  } else O = T;
231
231
  return H && l(
232
232
  O,
@@ -237,28 +237,28 @@ React keys must be passed directly to JSX without using spread:
237
237
  O,
238
238
  a(),
239
239
  te,
240
- oe
240
+ ie
241
241
  );
242
242
  }
243
- function p(f) {
244
- h(f) ? f._store && (f._store.validated = 1) : typeof f == "object" && f !== null && f.$$typeof === z && (f._payload.status === "fulfilled" ? h(f._payload.value) && f._payload.value._store && (f._payload.value._store.validated = 1) : f._store && (f._store.validated = 1));
243
+ function m(f) {
244
+ x(f) ? f._store && (f._store.validated = 1) : typeof f == "object" && f !== null && f.$$typeof === z && (f._payload.status === "fulfilled" ? x(f._payload.value) && f._payload.value._store && (f._payload.value._store.validated = 1) : f._store && (f._store.validated = 1));
245
245
  }
246
- function h(f) {
247
- return typeof f == "object" && f !== null && f.$$typeof === x;
246
+ function x(f) {
247
+ return typeof f == "object" && f !== null && f.$$typeof === h;
248
248
  }
249
- var m = q, x = Symbol.for("react.transitional.element"), b = Symbol.for("react.portal"), g = Symbol.for("react.fragment"), $ = Symbol.for("react.strict_mode"), _ = Symbol.for("react.profiler"), N = Symbol.for("react.consumer"), y = Symbol.for("react.context"), S = Symbol.for("react.forward_ref"), B = Symbol.for("react.suspense"), M = Symbol.for("react.suspense_list"), W = Symbol.for("react.memo"), z = Symbol.for("react.lazy"), j = Symbol.for("react.activity"), F = Symbol.for("react.client.reference"), K = m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, V = Object.prototype.hasOwnProperty, D = Array.isArray, v = console.createTask ? console.createTask : function() {
249
+ var p = q, h = Symbol.for("react.transitional.element"), w = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), $ = Symbol.for("react.strict_mode"), N = Symbol.for("react.profiler"), _ = Symbol.for("react.consumer"), y = Symbol.for("react.context"), S = Symbol.for("react.forward_ref"), D = Symbol.for("react.suspense"), M = Symbol.for("react.suspense_list"), W = Symbol.for("react.memo"), z = Symbol.for("react.lazy"), j = Symbol.for("react.activity"), F = Symbol.for("react.client.reference"), K = p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, V = Object.prototype.hasOwnProperty, I = Array.isArray, v = console.createTask ? console.createTask : function() {
250
250
  return null;
251
251
  };
252
- m = {
252
+ p = {
253
253
  react_stack_bottom_frame: function(f) {
254
254
  return f();
255
255
  }
256
256
  };
257
- var k, A = {}, U = m.react_stack_bottom_frame.bind(
258
- m,
257
+ var k, A = {}, U = p.react_stack_bottom_frame.bind(
258
+ p,
259
259
  o
260
260
  )(), G = v(r(o)), E = {};
261
- be.Fragment = g, be.jsx = function(f, T, O) {
261
+ be.Fragment = b, be.jsx = function(f, T, O) {
262
262
  var Y = 1e4 > K.recentlyCreatedOwnerStacks++;
263
263
  return u(
264
264
  f,
@@ -295,7 +295,7 @@ function Nt({ size: t = "m", color: s = "default", className: n = "", ...r }) {
295
295
  );
296
296
  }
297
297
  const wt = { xs: 12, s: 14, m: 16, l: 20 };
298
- function ae({
298
+ function oe({
299
299
  children: t,
300
300
  variant: s = "primary",
301
301
  size: n = "m",
@@ -307,23 +307,23 @@ function ae({
307
307
  type: c = "button",
308
308
  href: d,
309
309
  "aria-label": u,
310
- className: p = "",
311
- ...h
310
+ className: m = "",
311
+ ...x
312
312
  }) {
313
- const m = a && !t, x = i === "loading", b = i === "success", g = i === "error", $ = x || b || g, _ = n === "xs" ? "s" : "m", N = s === "danger" ? "on-accent" : "default", y = wt[n] ?? 16, S = x ? /* @__PURE__ */ e.jsx(Nt, { size: _, color: N }) : b ? /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(Re, { size: y, strokeWidth: 2.5 }) }) : g ? /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(ee, { size: y, strokeWidth: 2.5 }) }) : null, B = [
313
+ const p = a && !t, h = i === "loading", w = i === "success", b = i === "error", $ = h || w || b, N = n === "xs" ? "s" : "m", _ = s === "danger" ? "on-accent" : "default", y = wt[n] ?? 16, S = h ? /* @__PURE__ */ e.jsx(Nt, { size: N, color: _ }) : w ? /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(Re, { size: y, strokeWidth: 2.5 }) }) : b ? /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(ee, { size: y, strokeWidth: 2.5 }) }) : null, D = [
314
314
  "ds-button",
315
315
  `ds-button--${s}`,
316
316
  `ds-button--${n}`,
317
317
  r && "ds-button--full",
318
- m && "ds-button--icon-only",
319
- p
318
+ p && "ds-button--icon-only",
319
+ m
320
320
  ].filter(Boolean).join(" "), M = i !== "idle" ? i : void 0, W = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
321
321
  $ ? S : a && /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: a }),
322
322
  t
323
323
  ] });
324
324
  if (d) {
325
325
  const z = (j) => {
326
- if (o || x) {
326
+ if (o || h) {
327
327
  j.preventDefault();
328
328
  return;
329
329
  }
@@ -332,14 +332,14 @@ function ae({
332
332
  return /* @__PURE__ */ e.jsx(
333
333
  "a",
334
334
  {
335
- className: B,
336
- href: o || x ? void 0 : d,
335
+ className: D,
336
+ href: o || h ? void 0 : d,
337
337
  onClick: z,
338
338
  "aria-label": u,
339
- "aria-disabled": o || x ? "true" : void 0,
340
- "aria-busy": x ? "true" : void 0,
339
+ "aria-disabled": o || h ? "true" : void 0,
340
+ "aria-busy": h ? "true" : void 0,
341
341
  "data-state": M,
342
- ...h,
342
+ ...x,
343
343
  children: W
344
344
  }
345
345
  );
@@ -348,13 +348,13 @@ function ae({
348
348
  "button",
349
349
  {
350
350
  type: c,
351
- className: B,
351
+ className: D,
352
352
  disabled: o,
353
- onClick: x ? void 0 : l,
353
+ onClick: h ? void 0 : l,
354
354
  "aria-label": u,
355
- "aria-busy": x ? "true" : void 0,
355
+ "aria-busy": h ? "true" : void 0,
356
356
  "data-state": M,
357
- ...h,
357
+ ...x,
358
358
  children: W
359
359
  }
360
360
  );
@@ -372,19 +372,19 @@ function cs({
372
372
  id: d,
373
373
  ...u
374
374
  }) {
375
- const p = d || `input-${q.useId()}`, h = n ? `${p}-hint` : void 0, m = s ? `${p}-error` : void 0, x = m || h;
375
+ const m = d || `input-${q.useId()}`, x = n ? `${m}-hint` : void 0, p = s ? `${m}-error` : void 0, h = p || x;
376
376
  return /* @__PURE__ */ e.jsxs("div", { className: `ds-input-wrapper ${r ? "ds-input-wrapper--full" : ""} ${c ? "ds-input-wrapper--disabled" : ""} ${s ? "ds-input-wrapper--error" : ""}`, children: [
377
- t && /* @__PURE__ */ e.jsx("label", { className: "ds-input-label", htmlFor: p, children: t }),
377
+ t && /* @__PURE__ */ e.jsx("label", { className: "ds-input-label", htmlFor: m, children: t }),
378
378
  /* @__PURE__ */ e.jsxs("div", { className: "ds-input-container", children: [
379
379
  a && /* @__PURE__ */ e.jsx("span", { className: `ds-input-icon ds-input-icon--${l}`, "aria-hidden": "true", children: a }),
380
380
  /* @__PURE__ */ e.jsx(
381
381
  "input",
382
382
  {
383
- id: p,
383
+ id: m,
384
384
  className: `ds-input ds-input--${l} ${a ? "ds-input--with-icon" : ""} ${o ? "ds-input--with-icon-right" : ""} ${s ? "ds-input--error" : ""}`,
385
385
  disabled: c,
386
386
  "aria-invalid": s ? "true" : "false",
387
- "aria-describedby": x,
387
+ "aria-describedby": h,
388
388
  ...u
389
389
  }
390
390
  ),
@@ -400,8 +400,8 @@ function cs({
400
400
  }
401
401
  )
402
402
  ] }),
403
- n && !s && /* @__PURE__ */ e.jsx("span", { id: h, className: "ds-input-hint", children: n }),
404
- /* @__PURE__ */ e.jsx("div", { className: "ds-input-error-wrap", children: /* @__PURE__ */ e.jsx("div", { className: "ds-input-error-inner", children: s && /* @__PURE__ */ e.jsx("span", { id: m, className: "ds-input-error", role: "alert", children: s }) }) })
403
+ n && !s && /* @__PURE__ */ e.jsx("span", { id: x, className: "ds-input-hint", children: n }),
404
+ /* @__PURE__ */ e.jsx("div", { className: "ds-input-error-wrap", children: /* @__PURE__ */ e.jsx("div", { className: "ds-input-error-inner", children: s && /* @__PURE__ */ e.jsx("span", { id: p, className: "ds-input-error", role: "alert", children: s }) }) })
405
405
  ] });
406
406
  }
407
407
  function ds({
@@ -416,7 +416,7 @@ function ds({
416
416
  rows: c = 3,
417
417
  ...d
418
418
  }) {
419
- const u = i || `textarea-${q.useId()}`, p = n ? `${u}-hint` : void 0, h = s ? `${u}-error` : void 0, m = h || p;
419
+ const u = i || `textarea-${q.useId()}`, m = n ? `${u}-hint` : void 0, x = s ? `${u}-error` : void 0, p = x || m;
420
420
  return /* @__PURE__ */ e.jsxs("div", { className: `ds-textarea-wrapper ${r ? "ds-textarea-wrapper--full" : ""} ${o ? "ds-textarea-wrapper--disabled" : ""}`, children: [
421
421
  t && /* @__PURE__ */ e.jsx("label", { className: "ds-textarea-label", htmlFor: u, children: t }),
422
422
  /* @__PURE__ */ e.jsx(
@@ -426,13 +426,13 @@ function ds({
426
426
  className: `ds-textarea ds-textarea--${a} ${s ? "ds-textarea--error" : ""} ${l ? "" : "ds-textarea--no-resize"}`,
427
427
  disabled: o,
428
428
  "aria-invalid": s ? "true" : "false",
429
- "aria-describedby": m,
429
+ "aria-describedby": p,
430
430
  rows: c,
431
431
  ...d
432
432
  }
433
433
  ),
434
- n && !s && /* @__PURE__ */ e.jsx("span", { id: p, className: "ds-textarea-hint", children: n }),
435
- s && /* @__PURE__ */ e.jsx("span", { id: h, className: "ds-textarea-error", role: "alert", children: s })
434
+ n && !s && /* @__PURE__ */ e.jsx("span", { id: m, className: "ds-textarea-hint", children: n }),
435
+ s && /* @__PURE__ */ e.jsx("span", { id: x, className: "ds-textarea-error", role: "alert", children: s })
436
436
  ] });
437
437
  }
438
438
  function us({
@@ -448,70 +448,70 @@ function us({
448
448
  id: d,
449
449
  ...u
450
450
  }) {
451
- const [p, h] = I(!1), [m, x] = I(!1), [b, g] = I({}), [$, _] = I("down"), [N, y] = I(-1), S = R(null), B = R(null), M = R(null), W = R(null), z = d || `select-${q.useId()}`, j = `${z}-label`, F = o ? `${z}-error` : void 0, K = 150, V = (E = !1) => {
452
- m || (x(!0), y(-1), W.current = setTimeout(() => {
451
+ const [m, x] = B(!1), [p, h] = B(!1), [w, b] = B({}), [$, N] = B("down"), [_, y] = B(-1), S = R(null), D = R(null), M = R(null), W = R(null), z = d || `select-${q.useId()}`, j = `${z}-label`, F = o ? `${z}-error` : void 0, K = 150, V = (E = !1) => {
452
+ p || (h(!0), y(-1), W.current = setTimeout(() => {
453
453
  var f;
454
- h(!1), x(!1), E && ((f = M.current) == null || f.focus());
454
+ x(!1), h(!1), E && ((f = M.current) == null || f.focus());
455
455
  }, K));
456
- }, D = (E) => {
457
- clearTimeout(W.current), x(!1);
456
+ }, I = (E) => {
457
+ clearTimeout(W.current), h(!1);
458
458
  const f = E !== void 0 ? E : Math.max(r.findIndex((T) => T.value === s), 0);
459
- y(f), h(!0);
459
+ y(f), x(!0);
460
460
  };
461
461
  P(() => () => clearTimeout(W.current), []);
462
462
  const v = () => {
463
- var oe;
464
- const E = (oe = S.current) == null ? void 0 : oe.getBoundingClientRect();
463
+ var ie;
464
+ const E = (ie = S.current) == null ? void 0 : ie.getBoundingClientRect();
465
465
  if (!E) return;
466
466
  const f = window.innerHeight, T = f - E.bottom, O = E.top, te = T < 300 && O > T;
467
- _(te ? "up" : "down"), g(
467
+ N(te ? "up" : "down"), b(
468
468
  te ? { bottom: f - E.top + 4, left: E.left, width: E.width } : { top: E.bottom + 4, left: E.left, width: E.width }
469
469
  );
470
470
  };
471
471
  P(() => {
472
- if (p)
472
+ if (m)
473
473
  return v(), window.addEventListener("scroll", v, !0), window.addEventListener("resize", v), () => {
474
474
  window.removeEventListener("scroll", v, !0), window.removeEventListener("resize", v);
475
475
  };
476
- }, [p]), P(() => {
476
+ }, [m]), P(() => {
477
477
  const E = (f) => {
478
- S.current && !S.current.contains(f.target) && B.current && !B.current.contains(f.target) && V();
478
+ S.current && !S.current.contains(f.target) && D.current && !D.current.contains(f.target) && V();
479
479
  };
480
480
  return document.addEventListener("mousedown", E), () => document.removeEventListener("mousedown", E);
481
- }, [m]), P(() => {
481
+ }, [p]), P(() => {
482
482
  var f;
483
- if (!p || N < 0 || !B.current) return;
484
- (f = B.current.querySelectorAll(".ds-select-option")[N]) == null || f.scrollIntoView({ block: "nearest" });
485
- }, [N, p]);
483
+ if (!m || _ < 0 || !D.current) return;
484
+ (f = D.current.querySelectorAll(".ds-select-option")[_]) == null || f.scrollIntoView({ block: "nearest" });
485
+ }, [_, m]);
486
486
  const k = (E) => {
487
487
  switch (E.key) {
488
488
  case "ArrowDown":
489
- E.preventDefault(), p ? y((f) => Math.min(f + 1, r.length - 1)) : D();
489
+ E.preventDefault(), m ? y((f) => Math.min(f + 1, r.length - 1)) : I();
490
490
  break;
491
491
  case "ArrowUp":
492
- E.preventDefault(), p ? y((f) => Math.max(f - 1, 0)) : D(r.length - 1);
492
+ E.preventDefault(), m ? y((f) => Math.max(f - 1, 0)) : I(r.length - 1);
493
493
  break;
494
494
  case "Home":
495
- p && (E.preventDefault(), y(0));
495
+ m && (E.preventDefault(), y(0));
496
496
  break;
497
497
  case "End":
498
- p && (E.preventDefault(), y(r.length - 1));
498
+ m && (E.preventDefault(), y(r.length - 1));
499
499
  break;
500
500
  case "Enter":
501
501
  case " ":
502
- E.preventDefault(), p ? N >= 0 && (n == null || n(r[N].value), V(!0)) : D();
502
+ E.preventDefault(), m ? _ >= 0 && (n == null || n(r[_].value), V(!0)) : I();
503
503
  break;
504
504
  case "Escape":
505
- p && (E.preventDefault(), V(!0));
505
+ m && (E.preventDefault(), V(!0));
506
506
  break;
507
507
  case "Tab":
508
- p && V(!1);
508
+ m && V(!1);
509
509
  break;
510
510
  }
511
- }, A = r.find((E) => E.value === s), U = l === "xs" ? C[1] : l === "small" ? C[2] : C[3], G = p && /* @__PURE__ */ e.jsx(
511
+ }, A = r.find((E) => E.value === s), U = l === "xs" ? C[1] : l === "small" ? C[2] : C[3], G = m && /* @__PURE__ */ e.jsx(
512
512
  "div",
513
513
  {
514
- ref: B,
514
+ ref: D,
515
515
  "data-ds-portal": "",
516
516
  role: "listbox",
517
517
  "aria-labelledby": t ? j : void 0,
@@ -520,9 +520,9 @@ function us({
520
520
  "ds-select-dropdown ds-scrollable",
521
521
  `ds-select-dropdown--${l}`,
522
522
  `ds-select-dropdown--${$}`,
523
- m && "ds-select-dropdown--closing"
523
+ p && "ds-select-dropdown--closing"
524
524
  ].filter(Boolean).join(" "),
525
- style: b,
525
+ style: w,
526
526
  children: r.map((E, f) => /* @__PURE__ */ e.jsx(
527
527
  "button",
528
528
  {
@@ -535,7 +535,7 @@ function us({
535
535
  "ds-select-option",
536
536
  `ds-select-option--${l}`,
537
537
  s === E.value && "ds-select-option--selected",
538
- f === N && "ds-select-option--active"
538
+ f === _ && "ds-select-option--active"
539
539
  ].filter(Boolean).join(" "),
540
540
  onClick: () => {
541
541
  n == null || n(E.value), V(!0);
@@ -556,14 +556,14 @@ function us({
556
556
  id: z,
557
557
  role: "combobox",
558
558
  "aria-haspopup": "listbox",
559
- "aria-expanded": p,
560
- "aria-activedescendant": p && N >= 0 ? `${z}-opt-${N}` : void 0,
559
+ "aria-expanded": m,
560
+ "aria-activedescendant": m && _ >= 0 ? `${z}-opt-${_}` : void 0,
561
561
  "aria-labelledby": t ? j : void 0,
562
562
  "aria-invalid": o ? "true" : "false",
563
563
  "aria-describedby": F,
564
564
  className: `ds-select-trigger ds-select-trigger--${l} ${o ? "ds-select-trigger--error" : ""}`,
565
565
  onClick: () => {
566
- c || (p ? V() : D());
566
+ c || (m ? V() : I());
567
567
  },
568
568
  onKeyDown: k,
569
569
  disabled: c,
@@ -575,7 +575,7 @@ function us({
575
575
  {
576
576
  size: U,
577
577
  strokeWidth: 1.5,
578
- className: `ds-select-icon ${p && $ === "down" ? "ds-select-icon--open" : ""} ${p && $ === "up" ? "ds-select-icon--up" : ""}`,
578
+ className: `ds-select-icon ${m && $ === "down" ? "ds-select-icon--open" : ""} ${m && $ === "up" ? "ds-select-icon--up" : ""}`,
579
579
  "aria-hidden": "true"
580
580
  }
581
581
  )
@@ -583,7 +583,7 @@ function us({
583
583
  }
584
584
  ) }),
585
585
  o && /* @__PURE__ */ e.jsx("span", { id: F, className: "ds-select-error", role: "alert", children: o }),
586
- typeof document < "u" && me.createPortal(G, document.body)
586
+ typeof document < "u" && re.createPortal(G, document.body)
587
587
  ] });
588
588
  }
589
589
  function fs({
@@ -599,47 +599,47 @@ function fs({
599
599
  error: d,
600
600
  ...u
601
601
  }) {
602
- const p = () => {
602
+ const m = () => {
603
603
  if (l) return;
604
604
  const $ = Math.min(Number(s) + o, a);
605
605
  n == null || n($);
606
- }, h = () => {
606
+ }, x = () => {
607
607
  if (l) return;
608
608
  const $ = Math.max(Number(s) - o, r);
609
609
  n == null || n($);
610
- }, m = ($) => {
610
+ }, p = ($) => {
611
611
  if (l) return;
612
- const _ = $.target.value;
613
- if (_ === "") {
612
+ const N = $.target.value;
613
+ if (N === "") {
614
614
  n == null || n(r);
615
615
  return;
616
616
  }
617
- const N = Number(_);
618
- if (!isNaN(N)) {
619
- const y = Math.min(Math.max(N, r), a);
617
+ const _ = Number(N);
618
+ if (!isNaN(_)) {
619
+ const y = Math.min(Math.max(_, r), a);
620
620
  n == null || n(y);
621
621
  }
622
- }, x = [
622
+ }, h = [
623
623
  "ds-stepper-wrapper",
624
624
  l && "ds-stepper-wrapper--disabled",
625
625
  d && "ds-stepper-wrapper--error"
626
- ].filter(Boolean).join(" "), b = [
626
+ ].filter(Boolean).join(" "), w = [
627
627
  "ds-stepper",
628
628
  `ds-stepper--${i}`,
629
629
  l && "ds-stepper--disabled"
630
- ].filter(Boolean).join(" "), g = i === "xs" ? C[1] : i === "small" ? C[2] : C[3];
631
- return /* @__PURE__ */ e.jsxs("div", { className: x, children: [
630
+ ].filter(Boolean).join(" "), b = i === "xs" ? C[1] : i === "small" ? C[2] : C[3];
631
+ return /* @__PURE__ */ e.jsxs("div", { className: h, children: [
632
632
  t && /* @__PURE__ */ e.jsx("label", { className: "ds-stepper-label", children: t }),
633
- /* @__PURE__ */ e.jsxs("div", { className: b, children: [
633
+ /* @__PURE__ */ e.jsxs("div", { className: w, children: [
634
634
  /* @__PURE__ */ e.jsx(
635
635
  "button",
636
636
  {
637
637
  type: "button",
638
638
  className: "ds-stepper-button ds-stepper-button--minus",
639
- onClick: h,
639
+ onClick: x,
640
640
  disabled: l || s <= r,
641
641
  "aria-label": "Decrease",
642
- children: /* @__PURE__ */ e.jsx(rt, { size: g, strokeWidth: 1.5 })
642
+ children: /* @__PURE__ */ e.jsx(rt, { size: b, strokeWidth: 1.5 })
643
643
  }
644
644
  ),
645
645
  /* @__PURE__ */ e.jsx(
@@ -648,7 +648,7 @@ function fs({
648
648
  type: "number",
649
649
  className: "ds-stepper-input",
650
650
  value: s,
651
- onChange: m,
651
+ onChange: p,
652
652
  min: r,
653
653
  max: a,
654
654
  step: o,
@@ -661,10 +661,10 @@ function fs({
661
661
  {
662
662
  type: "button",
663
663
  className: "ds-stepper-button ds-stepper-button--plus",
664
- onClick: p,
664
+ onClick: m,
665
665
  disabled: l || s >= a,
666
666
  "aria-label": "Increase",
667
- children: /* @__PURE__ */ e.jsx(at, { size: g, strokeWidth: 1.5 })
667
+ children: /* @__PURE__ */ e.jsx(at, { size: b, strokeWidth: 1.5 })
668
668
  }
669
669
  )
670
670
  ] }),
@@ -689,36 +689,36 @@ function ms({
689
689
  d && "ds-card--interactive"
690
690
  ].filter(Boolean).join(" ");
691
691
  if (o) {
692
- const m = (x) => {
692
+ const p = (h) => {
693
693
  if (i) {
694
- x.preventDefault();
694
+ h.preventDefault();
695
695
  return;
696
696
  }
697
- x.metaKey || x.ctrlKey || x.button === 1 || (x.preventDefault(), a == null || a(x));
697
+ h.metaKey || h.ctrlKey || h.button === 1 || (h.preventDefault(), a == null || a(h));
698
698
  };
699
699
  return /* @__PURE__ */ e.jsx(
700
700
  "a",
701
701
  {
702
702
  className: u,
703
703
  href: i ? void 0 : o,
704
- onClick: m,
704
+ onClick: p,
705
705
  "aria-disabled": i ? "true" : void 0,
706
706
  ...l,
707
707
  children: t
708
708
  }
709
709
  );
710
710
  }
711
- const p = d && a ? "button" : "div", h = d && a ? {
711
+ const m = d && a ? "button" : "div", x = d && a ? {
712
712
  type: "button",
713
713
  onClick: a,
714
714
  disabled: i
715
715
  } : {};
716
716
  return /* @__PURE__ */ e.jsx(
717
- p,
717
+ m,
718
718
  {
719
719
  className: u,
720
720
  role: d && !a ? "article" : void 0,
721
- ...h,
721
+ ...x,
722
722
  ...l,
723
723
  children: t
724
724
  }
@@ -745,7 +745,7 @@ function gt({ children: t, secondary: s = !1, ...n }) {
745
745
  function Qe({ children: t, secondary: s = !1, ...n }) {
746
746
  return /* @__PURE__ */ e.jsx("p", { className: `ds-p3 ${s ? "ds-p3--secondary" : ""}`, ...n, children: t });
747
747
  }
748
- function fe({
748
+ function me({
749
749
  children: t,
750
750
  variant: s = "default",
751
751
  size: n = "m",
@@ -800,25 +800,24 @@ function js({
800
800
  subHeader: o,
801
801
  ...i
802
802
  }) {
803
- const l = R(null), c = q.useId(), [d, u] = I(!1), p = () => {
803
+ const l = R(null), c = q.useId(), [d, u] = B(!1), m = () => {
804
804
  !n || d || (u(!0), setTimeout(() => {
805
805
  u(!1), n();
806
806
  }, kt));
807
807
  };
808
808
  P(() => {
809
- const b = ($) => {
810
- $.key === "Escape" && p();
811
- }, g = ($) => {
812
- var N, y, S;
813
- const _ = ((y = (N = $.composedPath) == null ? void 0 : N.call($)) == null ? void 0 : y[0]) ?? $.target;
814
- l.current && !l.current.contains(_) && !((S = _.closest) != null && S.call(_, "[data-ds-portal]")) && p();
809
+ const b = (N) => {
810
+ N.key === "Escape" && m();
811
+ }, $ = (N) => {
812
+ var y, S, D;
813
+ const _ = ((S = (y = N.composedPath) == null ? void 0 : y.call(N)) == null ? void 0 : S[0]) ?? N.target;
814
+ l.current && !l.current.contains(_) && !((D = _.closest) != null && D.call(_, "[data-ds-portal]")) && m();
815
815
  };
816
- return document.addEventListener("keydown", b), document.addEventListener("mousedown", g), () => {
817
- document.removeEventListener("keydown", b), document.removeEventListener("mousedown", g);
816
+ return document.addEventListener("keydown", b), document.addEventListener("mousedown", $), () => {
817
+ document.removeEventListener("keydown", b), document.removeEventListener("mousedown", $);
818
818
  };
819
819
  }, [n, d]);
820
- const h = q.Children.toArray(t), m = h.find((b) => (b == null ? void 0 : b.type) === he), x = h.filter((b) => (b == null ? void 0 : b.type) !== he);
821
- return /* @__PURE__ */ e.jsx("div", { className: ["ds-modal-overlay", d && "ds-modal-overlay--closing"].filter(Boolean).join(" "), ...i, children: /* @__PURE__ */ e.jsxs(
820
+ const x = q.Children.toArray(t), p = x.find((b) => (b == null ? void 0 : b.type) === he), h = x.filter((b) => (b == null ? void 0 : b.type) !== he), w = /* @__PURE__ */ e.jsx("div", { className: ["ds-modal-overlay", d && "ds-modal-overlay--closing"].filter(Boolean).join(" "), ...i, children: /* @__PURE__ */ e.jsxs(
822
821
  "div",
823
822
  {
824
823
  className: [`ds-modal ds-modal--${r}`, a && "ds-modal--scrollable"].filter(Boolean).join(" "),
@@ -828,13 +827,13 @@ function js({
828
827
  "aria-labelledby": s ? c : void 0,
829
828
  children: [
830
829
  n && /* @__PURE__ */ e.jsx(
831
- ae,
830
+ oe,
832
831
  {
833
832
  className: "ds-modal__close",
834
833
  variant: "ghost",
835
834
  size: "small",
836
835
  icon: /* @__PURE__ */ e.jsx(ee, { size: C[2], strokeWidth: 1.5 }),
837
- onClick: p,
836
+ onClick: m,
838
837
  "aria-label": "Close modal"
839
838
  }
840
839
  ),
@@ -842,11 +841,12 @@ function js({
842
841
  s && /* @__PURE__ */ e.jsx("h3", { id: c, className: "ds-modal__title", children: s }),
843
842
  o && /* @__PURE__ */ e.jsx("div", { className: "ds-modal__subheader", children: o })
844
843
  ] }),
845
- /* @__PURE__ */ e.jsx("div", { className: "ds-modal__body ds-scrollable", children: x }),
846
- m
844
+ /* @__PURE__ */ e.jsx("div", { className: "ds-modal__body ds-scrollable", children: h }),
845
+ p
847
846
  ]
848
847
  }
849
848
  ) });
849
+ return typeof document > "u" ? w : re.createPortal(w, document.body);
850
850
  }
851
851
  function he({ children: t }) {
852
852
  return !t || q.Children.count(t) === 0 ? null : /* @__PURE__ */ e.jsx("div", { className: "ds-modal__footer", children: t });
@@ -859,25 +859,24 @@ function Ns({
859
859
  subHeader: r,
860
860
  ...a
861
861
  }) {
862
- const o = R(null), i = q.useId(), [l, c] = I(!1), d = () => {
862
+ const o = R(null), i = q.useId(), [l, c] = B(!1), d = () => {
863
863
  !n || l || (c(!0), setTimeout(() => {
864
864
  c(!1), n();
865
865
  }, Et));
866
866
  };
867
867
  P(() => {
868
- const m = (b) => {
868
+ const h = (b) => {
869
869
  b.key === "Escape" && d();
870
- }, x = (b) => {
871
- var $, _, N;
872
- const g = ((_ = ($ = b.composedPath) == null ? void 0 : $.call(b)) == null ? void 0 : _[0]) ?? b.target;
873
- o.current && !o.current.contains(g) && !((N = g.closest) != null && N.call(g, "[data-ds-portal]")) && d();
870
+ }, w = (b) => {
871
+ var N, _, y;
872
+ const $ = ((_ = (N = b.composedPath) == null ? void 0 : N.call(b)) == null ? void 0 : _[0]) ?? b.target;
873
+ o.current && !o.current.contains($) && !((y = $.closest) != null && y.call($, "[data-ds-portal]")) && d();
874
874
  };
875
- return document.addEventListener("keydown", m), document.addEventListener("mousedown", x), () => {
876
- document.removeEventListener("keydown", m), document.removeEventListener("mousedown", x);
875
+ return document.addEventListener("keydown", h), document.addEventListener("mousedown", w), () => {
876
+ document.removeEventListener("keydown", h), document.removeEventListener("mousedown", w);
877
877
  };
878
878
  }, [n, l]);
879
- const u = q.Children.toArray(t), p = u.find((m) => (m == null ? void 0 : m.type) === he), h = u.filter((m) => (m == null ? void 0 : m.type) !== he);
880
- return /* @__PURE__ */ e.jsx(
879
+ const u = q.Children.toArray(t), m = u.find((h) => (h == null ? void 0 : h.type) === he), x = u.filter((h) => (h == null ? void 0 : h.type) !== he), p = /* @__PURE__ */ e.jsx(
881
880
  "div",
882
881
  {
883
882
  className: ["ds-bottom-sheet-overlay", l && "ds-bottom-sheet-overlay--closing"].filter(Boolean).join(" "),
@@ -893,7 +892,7 @@ function Ns({
893
892
  children: [
894
893
  /* @__PURE__ */ e.jsx("div", { className: "ds-bottom-sheet__handle", "aria-hidden": "true" }),
895
894
  n && /* @__PURE__ */ e.jsx(
896
- ae,
895
+ oe,
897
896
  {
898
897
  className: "ds-bottom-sheet__close",
899
898
  variant: "ghost",
@@ -907,13 +906,14 @@ function Ns({
907
906
  s && /* @__PURE__ */ e.jsx("h3", { id: i, className: "ds-bottom-sheet__title", children: s }),
908
907
  r && /* @__PURE__ */ e.jsx("div", { className: "ds-bottom-sheet__subheader", children: r })
909
908
  ] }),
910
- /* @__PURE__ */ e.jsx("div", { className: "ds-bottom-sheet__body ds-scrollable", children: h }),
911
- p
909
+ /* @__PURE__ */ e.jsx("div", { className: "ds-bottom-sheet__body ds-scrollable", children: x }),
910
+ m
912
911
  ]
913
912
  }
914
913
  )
915
914
  }
916
915
  );
916
+ return typeof document > "u" ? p : re.createPortal(p, document.body);
917
917
  }
918
918
  function $t({
919
919
  children: t,
@@ -925,22 +925,22 @@ function $t({
925
925
  className: i = "",
926
926
  ...l
927
927
  }) {
928
- const [c, d] = I(n), u = r !== void 0, p = u ? r : c, h = () => {
929
- u ? a == null || a(!r) : d((x) => !x);
930
- }, m = [
928
+ const [c, d] = B(n), u = r !== void 0, m = u ? r : c, x = () => {
929
+ u ? a == null || a(!r) : d((h) => !h);
930
+ }, p = [
931
931
  "ds-code-accordion",
932
932
  `ds-code-accordion--${o}`,
933
- p && "ds-code-accordion--expanded",
933
+ m && "ds-code-accordion--expanded",
934
934
  i
935
935
  ].filter(Boolean).join(" ");
936
- return /* @__PURE__ */ e.jsxs("div", { className: m, ...l, children: [
936
+ return /* @__PURE__ */ e.jsxs("div", { className: p, ...l, children: [
937
937
  /* @__PURE__ */ e.jsxs(
938
938
  "button",
939
939
  {
940
940
  type: "button",
941
941
  className: "ds-code-accordion__header",
942
- onClick: h,
943
- "aria-expanded": p,
942
+ onClick: x,
943
+ "aria-expanded": m,
944
944
  children: [
945
945
  /* @__PURE__ */ e.jsx("span", { className: "ds-code-accordion__title", children: s }),
946
946
  /* @__PURE__ */ e.jsx(
@@ -948,7 +948,7 @@ function $t({
948
948
  {
949
949
  size: C[2],
950
950
  strokeWidth: 1.5,
951
- className: `ds-code-accordion__icon ${p ? "ds-code-accordion__icon--expanded" : ""}`
951
+ className: `ds-code-accordion__icon ${m ? "ds-code-accordion__icon--expanded" : ""}`
952
952
  }
953
953
  )
954
954
  ]
@@ -985,17 +985,17 @@ function ks({ children: t, selected: s = !1, onClick: n, size: r = "m", variant:
985
985
  `ds-tab--${a}`,
986
986
  s && "ds-tab--selected",
987
987
  d && "ds-tab--icon-only"
988
- ].filter(Boolean).join(" "), p = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
988
+ ].filter(Boolean).join(" "), m = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
989
989
  i && /* @__PURE__ */ e.jsx("span", { className: "ds-tab-icon", children: i }),
990
990
  t
991
991
  ] });
992
992
  if (l) {
993
- const h = (m) => {
993
+ const x = (p) => {
994
994
  if (o) {
995
- m.preventDefault();
995
+ p.preventDefault();
996
996
  return;
997
997
  }
998
- m.metaKey || m.ctrlKey || m.button === 1 || (m.preventDefault(), n == null || n(m));
998
+ p.metaKey || p.ctrlKey || p.button === 1 || (p.preventDefault(), n == null || n(p));
999
999
  };
1000
1000
  return /* @__PURE__ */ e.jsx(
1001
1001
  "a",
@@ -1005,9 +1005,9 @@ function ks({ children: t, selected: s = !1, onClick: n, size: r = "m", variant:
1005
1005
  "aria-disabled": o ? "true" : void 0,
1006
1006
  className: u,
1007
1007
  href: o ? void 0 : l,
1008
- onClick: h,
1008
+ onClick: x,
1009
1009
  ...c,
1010
- children: p
1010
+ children: m
1011
1011
  }
1012
1012
  );
1013
1013
  }
@@ -1020,33 +1020,33 @@ function ks({ children: t, selected: s = !1, onClick: n, size: r = "m", variant:
1020
1020
  onClick: n,
1021
1021
  disabled: o,
1022
1022
  ...c,
1023
- children: p
1023
+ children: m
1024
1024
  }
1025
1025
  );
1026
1026
  }
1027
1027
  function Es({ options: t, value: s, onChange: n, size: r = "m", disabled: a = !1 }) {
1028
- const o = R(null), i = R(null), [l, c] = I(!1), d = R(!1), u = R(null), p = R(null), h = () => {
1028
+ const o = R(null), i = R(null), [l, c] = B(!1), d = R(!1), u = R(null), m = R(null), x = () => {
1029
1029
  if (!o.current) return;
1030
- const m = o.current.querySelector(`[data-value="${s}"]`);
1031
- if (!m) return;
1032
- const x = o.current.getBoundingClientRect(), b = m.getBoundingClientRect(), g = b.left - x.left, $ = b.width;
1033
- i.current ? (i.current.style.transition = d.current ? "left var(--transition-normal), width var(--transition-normal)" : "none", i.current.style.left = g + "px", i.current.style.width = $ + "px", d.current = !1) : (c(!0), requestAnimationFrame(() => {
1030
+ const p = o.current.querySelector(`[data-value="${s}"]`);
1031
+ if (!p) return;
1032
+ const h = o.current.getBoundingClientRect(), w = p.getBoundingClientRect(), b = w.left - h.left, $ = w.width;
1033
+ i.current ? (i.current.style.transition = d.current ? "left var(--transition-normal), width var(--transition-normal)" : "none", i.current.style.left = b + "px", i.current.style.width = $ + "px", d.current = !1) : (c(!0), requestAnimationFrame(() => {
1034
1034
  if (!i.current || !o.current) return;
1035
- const _ = o.current.querySelector(`[data-value="${s}"]`);
1036
- if (!_) return;
1037
- const N = o.current.getBoundingClientRect(), y = _.getBoundingClientRect();
1038
- i.current.style.transition = "none", i.current.style.left = y.left - N.left + "px", i.current.style.width = y.width + "px";
1035
+ const N = o.current.querySelector(`[data-value="${s}"]`);
1036
+ if (!N) return;
1037
+ const _ = o.current.getBoundingClientRect(), y = N.getBoundingClientRect();
1038
+ i.current.style.transition = "none", i.current.style.left = y.left - _.left + "px", i.current.style.width = y.width + "px";
1039
1039
  }));
1040
1040
  };
1041
- return p.current = h, nt(() => {
1042
- const m = u.current !== s;
1043
- u.current = s, d.current = l && m, h();
1041
+ return m.current = x, nt(() => {
1042
+ const p = u.current !== s;
1043
+ u.current = s, d.current = l && p, x();
1044
1044
  }), P(() => {
1045
1045
  if (!o.current) return;
1046
- const m = new ResizeObserver(() => {
1047
- d.current = !1, p.current();
1046
+ const p = new ResizeObserver(() => {
1047
+ d.current = !1, m.current();
1048
1048
  });
1049
- return m.observe(o.current), () => m.disconnect();
1049
+ return p.observe(o.current), () => p.disconnect();
1050
1050
  }, []), /* @__PURE__ */ e.jsxs(
1051
1051
  "div",
1052
1052
  {
@@ -1066,21 +1066,21 @@ function Es({ options: t, value: s, onChange: n, size: r = "m", disabled: a = !1
1066
1066
  "aria-hidden": "true"
1067
1067
  }
1068
1068
  ),
1069
- t.map((m) => /* @__PURE__ */ e.jsxs(
1069
+ t.map((p) => /* @__PURE__ */ e.jsxs(
1070
1070
  "button",
1071
1071
  {
1072
1072
  type: "button",
1073
- "data-value": m.value,
1074
- className: ["ds-seg__btn", s === m.value && "ds-seg__btn--active"].filter(Boolean).join(" "),
1075
- onClick: () => !a && n(m.value),
1076
- "aria-pressed": s === m.value,
1073
+ "data-value": p.value,
1074
+ className: ["ds-seg__btn", s === p.value && "ds-seg__btn--active"].filter(Boolean).join(" "),
1075
+ onClick: () => !a && n(p.value),
1076
+ "aria-pressed": s === p.value,
1077
1077
  disabled: a,
1078
1078
  children: [
1079
- m.icon && /* @__PURE__ */ e.jsx("span", { className: "ds-seg__btn-icon", "aria-hidden": "true", children: m.icon }),
1080
- m.label
1079
+ p.icon && /* @__PURE__ */ e.jsx("span", { className: "ds-seg__btn-icon", "aria-hidden": "true", children: p.icon }),
1080
+ p.label
1081
1081
  ]
1082
1082
  },
1083
- m.value
1083
+ p.value
1084
1084
  ))
1085
1085
  ]
1086
1086
  }
@@ -1095,20 +1095,20 @@ function Be({
1095
1095
  padding: o = "m",
1096
1096
  ...i
1097
1097
  }) {
1098
- const [l, c] = I(n), d = r !== void 0, u = d ? r : l, p = () => {
1099
- d ? a == null || a(!r) : c((m) => !m);
1100
- }, h = [
1098
+ const [l, c] = B(n), d = r !== void 0, u = d ? r : l, m = () => {
1099
+ d ? a == null || a(!r) : c((p) => !p);
1100
+ }, x = [
1101
1101
  "ds-accordion",
1102
1102
  `ds-accordion--${o}`,
1103
1103
  u && "ds-accordion--expanded"
1104
1104
  ].filter(Boolean).join(" ");
1105
- return /* @__PURE__ */ e.jsxs("div", { className: h, ...i, children: [
1105
+ return /* @__PURE__ */ e.jsxs("div", { className: x, ...i, children: [
1106
1106
  /* @__PURE__ */ e.jsxs(
1107
1107
  "button",
1108
1108
  {
1109
1109
  type: "button",
1110
1110
  className: "ds-accordion__header",
1111
- onClick: p,
1111
+ onClick: m,
1112
1112
  "aria-expanded": u,
1113
1113
  children: [
1114
1114
  /* @__PURE__ */ e.jsx("span", { className: "ds-accordion__title", children: s }),
@@ -1126,46 +1126,46 @@ function Be({
1126
1126
  /* @__PURE__ */ e.jsx("div", { className: "ds-accordion__content", children: /* @__PURE__ */ e.jsx("div", { className: "ds-accordion__content-inner", children: /* @__PURE__ */ e.jsx("div", { className: "ds-accordion__content-body", children: t }) }) })
1127
1127
  ] });
1128
1128
  }
1129
- const re = 8, pe = 8;
1129
+ const ae = 8, pe = 8;
1130
1130
  function Tt(t, s, n) {
1131
1131
  const r = window.innerWidth;
1132
1132
  let a, o;
1133
1133
  switch (t) {
1134
1134
  case "top":
1135
- a = s.top - n.height - re, o = s.left + s.width / 2 - n.width / 2;
1135
+ a = s.top - n.height - ae, o = s.left + s.width / 2 - n.width / 2;
1136
1136
  break;
1137
1137
  case "bottom":
1138
- a = s.bottom + re, o = s.left + s.width / 2 - n.width / 2;
1138
+ a = s.bottom + ae, o = s.left + s.width / 2 - n.width / 2;
1139
1139
  break;
1140
1140
  case "left":
1141
- a = s.top + s.height / 2 - n.height / 2, o = s.left - n.width - re;
1141
+ a = s.top + s.height / 2 - n.height / 2, o = s.left - n.width - ae;
1142
1142
  break;
1143
1143
  case "right":
1144
- a = s.top + s.height / 2 - n.height / 2, o = s.right + re;
1144
+ a = s.top + s.height / 2 - n.height / 2, o = s.right + ae;
1145
1145
  break;
1146
1146
  default:
1147
- a = s.bottom + re, o = s.left;
1147
+ a = s.bottom + ae, o = s.left;
1148
1148
  }
1149
1149
  const i = Math.max(pe, Math.min(r - n.width - pe, o)), l = o - i;
1150
1150
  return { top: a, left: i, arrowOffset: l };
1151
1151
  }
1152
1152
  function Rt(t, s, n) {
1153
1153
  const r = window.innerWidth, a = window.innerHeight;
1154
- if (t.top >= s + re + pe) return "top";
1155
- if (a - t.bottom >= s + re + pe) return "bottom";
1156
- if (r - t.right >= n + re + pe) return "right";
1157
- if (t.left >= n + re + pe) return "left";
1154
+ if (t.top >= s + ae + pe) return "top";
1155
+ if (a - t.bottom >= s + ae + pe) return "bottom";
1156
+ if (r - t.right >= n + ae + pe) return "right";
1157
+ if (t.left >= n + ae + pe) return "left";
1158
1158
  const o = Math.max(t.top, a - t.bottom, t.left, r - t.right);
1159
1159
  return o === t.top ? "top" : o === a - t.bottom ? "bottom" : o === r - t.right ? "right" : "left";
1160
1160
  }
1161
1161
  function Le({ children: t, content: s, position: n, ...r }) {
1162
- const [a, o] = I(!1), [i, l] = I({ visibility: "hidden" }), [c, d] = I(n || "top"), u = R(null), p = R(null), h = R(!1), m = () => {
1163
- if (!u.current || !p.current) return;
1164
- const b = u.current.getBoundingClientRect(), g = p.current.getBoundingClientRect(), $ = n || Rt(b, g.height, g.width), { top: _, left: N, arrowOffset: y } = Tt($, b, g);
1162
+ const [a, o] = B(!1), [i, l] = B({ visibility: "hidden" }), [c, d] = B(n || "top"), u = R(null), m = R(null), x = R(!1), p = () => {
1163
+ if (!u.current || !m.current) return;
1164
+ const w = u.current.getBoundingClientRect(), b = m.current.getBoundingClientRect(), $ = n || Rt(w, b.height, b.width), { top: N, left: _, arrowOffset: y } = Tt($, w, b);
1165
1165
  d($), l({
1166
1166
  position: "fixed",
1167
- top: _,
1168
- left: N,
1167
+ top: N,
1168
+ left: _,
1169
1169
  visibility: "visible",
1170
1170
  "--arrow-offset": `${y}px`
1171
1171
  });
@@ -1173,21 +1173,21 @@ function Le({ children: t, content: s, position: n, ...r }) {
1173
1173
  if (P(() => {
1174
1174
  if (!a) return;
1175
1175
  l({ position: "fixed", visibility: "hidden" });
1176
- const b = requestAnimationFrame(m);
1177
- return window.addEventListener("scroll", m, !0), window.addEventListener("resize", m), () => {
1178
- cancelAnimationFrame(b), window.removeEventListener("scroll", m, !0), window.removeEventListener("resize", m);
1176
+ const w = requestAnimationFrame(p);
1177
+ return window.addEventListener("scroll", p, !0), window.addEventListener("resize", p), () => {
1178
+ cancelAnimationFrame(w), window.removeEventListener("scroll", p, !0), window.removeEventListener("resize", p);
1179
1179
  };
1180
1180
  }, [a, n]), P(() => {
1181
1181
  if (!a) return;
1182
- const b = (g) => {
1183
- u.current && !u.current.contains(g.target) && o(!1);
1182
+ const w = (b) => {
1183
+ u.current && !u.current.contains(b.target) && o(!1);
1184
1184
  };
1185
- return document.addEventListener("touchstart", b), () => document.removeEventListener("touchstart", b);
1185
+ return document.addEventListener("touchstart", w), () => document.removeEventListener("touchstart", w);
1186
1186
  }, [a]), !s) return t;
1187
- const x = a && /* @__PURE__ */ e.jsx(
1187
+ const h = a && /* @__PURE__ */ e.jsx(
1188
1188
  "div",
1189
1189
  {
1190
- ref: p,
1190
+ ref: m,
1191
1191
  "data-ds-portal": "",
1192
1192
  className: `ds-tooltip ds-tooltip--${c}`,
1193
1193
  role: "tooltip",
@@ -1201,18 +1201,18 @@ function Le({ children: t, content: s, position: n, ...r }) {
1201
1201
  ref: u,
1202
1202
  className: "ds-tooltip-wrapper",
1203
1203
  onMouseEnter: () => {
1204
- h.current || o(!0);
1204
+ x.current || o(!0);
1205
1205
  },
1206
1206
  onMouseLeave: () => {
1207
- h.current || o(!1);
1207
+ x.current || o(!1);
1208
1208
  },
1209
1209
  onTouchStart: () => {
1210
- h.current = !0, o((b) => !b);
1210
+ x.current = !0, o((w) => !w);
1211
1211
  },
1212
1212
  ...r,
1213
1213
  children: [
1214
1214
  t,
1215
- typeof document < "u" && me.createPortal(x, document.body)
1215
+ typeof document < "u" && re.createPortal(h, document.body)
1216
1216
  ]
1217
1217
  }
1218
1218
  );
@@ -1310,7 +1310,7 @@ function Rs({
1310
1310
  id: d,
1311
1311
  className: "ds-radio__input",
1312
1312
  checked: t,
1313
- onChange: (p) => s == null ? void 0 : s(p.target.checked),
1313
+ onChange: (m) => s == null ? void 0 : s(m.target.checked),
1314
1314
  disabled: r,
1315
1315
  name: o,
1316
1316
  value: i,
@@ -1364,7 +1364,7 @@ function It(t) {
1364
1364
  return s.length >= 2 ? (s[0][0] + s[1][0]).toUpperCase() : t[0].toUpperCase();
1365
1365
  }
1366
1366
  function Ss({ seed: t, icon: s, src: n, size: r = 32, className: a = "", style: o = {}, ...i }) {
1367
- const l = Dt(t ?? ""), [c, d] = I(!1), u = s ?? /* @__PURE__ */ e.jsx("span", { className: "ds-avatar__initials", children: It(t) });
1367
+ const l = Dt(t ?? ""), [c, d] = B(!1), u = s ?? /* @__PURE__ */ e.jsx("span", { className: "ds-avatar__initials", children: It(t) });
1368
1368
  return /* @__PURE__ */ e.jsx(
1369
1369
  "div",
1370
1370
  {
@@ -1509,7 +1509,7 @@ function Fs({
1509
1509
  style: c,
1510
1510
  ...d
1511
1511
  }) {
1512
- const u = q.useId(), p = o ?? u, h = `${p}-hint`, m = `${p}-error`;
1512
+ const u = q.useId(), m = o ?? u, x = `${m}-hint`, p = `${m}-error`;
1513
1513
  return /* @__PURE__ */ e.jsxs(
1514
1514
  "div",
1515
1515
  {
@@ -1520,10 +1520,10 @@ function Fs({
1520
1520
  style: c,
1521
1521
  ...d,
1522
1522
  children: [
1523
- t && /* @__PURE__ */ e.jsx("label", { className: "ds-field-label", htmlFor: p, children: t }),
1523
+ t && /* @__PURE__ */ e.jsx("label", { className: "ds-field-label", htmlFor: m, children: t }),
1524
1524
  /* @__PURE__ */ e.jsx("div", { className: "ds-field-control", children: i }),
1525
- s && !n && /* @__PURE__ */ e.jsx("p", { className: "ds-field-hint", id: h, children: s }),
1526
- n && /* @__PURE__ */ e.jsx("p", { className: "ds-field-error", id: m, role: "alert", children: n })
1525
+ s && !n && /* @__PURE__ */ e.jsx("p", { className: "ds-field-hint", id: x, children: s }),
1526
+ n && /* @__PURE__ */ e.jsx("p", { className: "ds-field-error", id: p, role: "alert", children: n })
1527
1527
  ]
1528
1528
  }
1529
1529
  );
@@ -1648,28 +1648,27 @@ function Us({
1648
1648
  keepOpenRef: c,
1649
1649
  ...d
1650
1650
  }) {
1651
- const u = R(null), p = q.useId(), [h, m] = I(!1), x = () => {
1652
- !n || h || (m(!0), setTimeout(() => {
1653
- m(!1), n();
1651
+ const u = R(null), m = q.useId(), [x, p] = B(!1), h = () => {
1652
+ !n || x || (p(!0), setTimeout(() => {
1653
+ p(!1), n();
1654
1654
  }, Lt));
1655
1655
  };
1656
1656
  P(() => {
1657
- const _ = (y) => {
1658
- y.key === "Escape" && x();
1659
- }, N = (y) => {
1660
- var B, M, W, z;
1661
- const S = ((M = (B = y.composedPath) == null ? void 0 : B.call(y)) == null ? void 0 : M[0]) ?? y.target;
1662
- (W = c == null ? void 0 : c.current) != null && W.contains(S) || u.current && !u.current.contains(S) && !((z = S.closest) != null && z.call(S, "[data-ds-portal]")) && x();
1657
+ const _ = (S) => {
1658
+ S.key === "Escape" && h();
1659
+ }, y = (S) => {
1660
+ var M, W, z, j;
1661
+ const D = ((W = (M = S.composedPath) == null ? void 0 : M.call(S)) == null ? void 0 : W[0]) ?? S.target;
1662
+ (z = c == null ? void 0 : c.current) != null && z.contains(D) || u.current && !u.current.contains(D) && !((j = D.closest) != null && j.call(D, "[data-ds-portal]")) && h();
1663
1663
  };
1664
- return document.addEventListener("keydown", _), document.addEventListener("mousedown", N), () => {
1665
- document.removeEventListener("keydown", _), document.removeEventListener("mousedown", N);
1664
+ return document.addEventListener("keydown", _), document.addEventListener("mousedown", y), () => {
1665
+ document.removeEventListener("keydown", _), document.removeEventListener("mousedown", y);
1666
1666
  };
1667
- }, [n, h, c]);
1668
- const b = q.Children.toArray(t), g = b.find((_) => (_ == null ? void 0 : _.type) === Oe || (_ == null ? void 0 : _.type) === he), $ = b.filter((_) => (_ == null ? void 0 : _.type) !== Oe && (_ == null ? void 0 : _.type) !== he);
1669
- return /* @__PURE__ */ e.jsx(
1667
+ }, [n, x, c]);
1668
+ const w = q.Children.toArray(t), b = w.find((_) => (_ == null ? void 0 : _.type) === Oe || (_ == null ? void 0 : _.type) === he), $ = w.filter((_) => (_ == null ? void 0 : _.type) !== Oe && (_ == null ? void 0 : _.type) !== he), N = /* @__PURE__ */ e.jsx(
1670
1669
  "div",
1671
1670
  {
1672
- className: ["ds-side-page-overlay", h && "ds-side-page-overlay--closing"].filter(Boolean).join(" "),
1671
+ className: ["ds-side-page-overlay", x && "ds-side-page-overlay--closing"].filter(Boolean).join(" "),
1673
1672
  "data-side": a,
1674
1673
  style: { "--ds-side-page-offset-left": `${i}px`, "--ds-side-page-offset-right": `${l}px` },
1675
1674
  ...d,
@@ -1677,35 +1676,36 @@ function Us({
1677
1676
  "div",
1678
1677
  {
1679
1678
  ref: u,
1680
- className: ["ds-side-page", h && "ds-side-page--closing"].filter(Boolean).join(" "),
1679
+ className: ["ds-side-page", x && "ds-side-page--closing"].filter(Boolean).join(" "),
1681
1680
  "data-side": a,
1682
1681
  "data-size": o,
1683
1682
  role: "dialog",
1684
1683
  "aria-modal": "true",
1685
- "aria-labelledby": s ? p : void 0,
1684
+ "aria-labelledby": s ? m : void 0,
1686
1685
  children: [
1687
1686
  n && /* @__PURE__ */ e.jsx(
1688
- ae,
1687
+ oe,
1689
1688
  {
1690
1689
  className: "ds-side-page__close",
1691
1690
  variant: "ghost",
1692
1691
  size: "small",
1693
1692
  icon: /* @__PURE__ */ e.jsx(ee, { size: C[2], strokeWidth: 1.5 }),
1694
- onClick: x,
1693
+ onClick: h,
1695
1694
  "aria-label": "Close"
1696
1695
  }
1697
1696
  ),
1698
1697
  (s || r) && /* @__PURE__ */ e.jsxs("div", { className: "ds-side-page__header", children: [
1699
- s && /* @__PURE__ */ e.jsx("h3", { id: p, className: "ds-side-page__title", children: s }),
1698
+ s && /* @__PURE__ */ e.jsx("h3", { id: m, className: "ds-side-page__title", children: s }),
1700
1699
  r && /* @__PURE__ */ e.jsx("div", { className: "ds-side-page__subheader", children: r })
1701
1700
  ] }),
1702
1701
  /* @__PURE__ */ e.jsx("div", { className: "ds-side-page__body ds-scrollable", children: $ }),
1703
- g
1702
+ b
1704
1703
  ]
1705
1704
  }
1706
1705
  )
1707
1706
  }
1708
1707
  );
1708
+ return typeof document > "u" ? N : re.createPortal(N, document.body);
1709
1709
  }
1710
1710
  function Oe({ children: t }) {
1711
1711
  return !t || q.Children.count(t) === 0 ? null : /* @__PURE__ */ e.jsx("div", { className: "ds-side-page__footer", children: t });
@@ -1724,8 +1724,8 @@ const ve = Ze({ collapsed: !1, side: "left" }), we = Ze(!1), Vs = Je(function({
1724
1724
  n && "ds-nav-rail--collapsed",
1725
1725
  `ds-nav-rail--${r}`,
1726
1726
  i
1727
- ].filter(Boolean).join(" "), u = le((p) => {
1728
- if (!p.target.closest('button, a, input, select, textarea, [role="button"], [tabindex]')) {
1727
+ ].filter(Boolean).join(" "), u = ce((m) => {
1728
+ if (!m.target.closest('button, a, input, select, textarea, [role="button"], [tabindex]')) {
1729
1729
  if (n && a) {
1730
1730
  a();
1731
1731
  return;
@@ -1758,9 +1758,9 @@ function Ys({
1758
1758
  open: c = !1,
1759
1759
  onboarding: d = !1,
1760
1760
  className: u = "",
1761
- ...p
1761
+ ...m
1762
1762
  }) {
1763
- const { collapsed: h, side: m } = de(ve), x = de(we), $ = {
1763
+ const { collapsed: x, side: p } = ue(ve), h = ue(we), $ = {
1764
1764
  className: [
1765
1765
  "ds-nav-rail__item",
1766
1766
  u
@@ -1768,7 +1768,7 @@ function Ys({
1768
1768
  onClick: r ? void 0 : o,
1769
1769
  "aria-current": n ? "page" : void 0,
1770
1770
  "aria-disabled": r ? "true" : void 0,
1771
- "aria-label": h ? s : void 0,
1771
+ "aria-label": x ? s : void 0,
1772
1772
  tabIndex: r ? -1 : void 0,
1773
1773
  ...{
1774
1774
  "data-selected": n || void 0,
@@ -1776,15 +1776,15 @@ function Ys({
1776
1776
  "data-open": c || void 0,
1777
1777
  "data-onboarding": d || void 0
1778
1778
  },
1779
- ...p
1780
- }, _ = i != null, N = m === "left" ? "right" : "left", y = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1779
+ ...m
1780
+ }, N = i != null, _ = p === "left" ? "right" : "left", y = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1781
1781
  /* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__icon", "aria-hidden": "true", children: t }),
1782
- !h && /* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__label", children: s }),
1783
- !h && l && /* @__PURE__ */ e.jsx(fe, { size: "xs", variant: "accent", className: "ds-nav-rail__badge-expanded", children: "New" }),
1784
- !h && _ && /* @__PURE__ */ e.jsx("span", { className: ["ds-nav-rail__count", i === 0 && "ds-nav-rail__count--zero"].filter(Boolean).join(" "), children: i }),
1785
- h && l && /* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__dot", "aria-hidden": "true" })
1782
+ !x && /* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__label", children: s }),
1783
+ !x && l && /* @__PURE__ */ e.jsx(me, { size: "xs", variant: "accent", className: "ds-nav-rail__badge-expanded", children: "New" }),
1784
+ !x && N && /* @__PURE__ */ e.jsx("span", { className: ["ds-nav-rail__count", i === 0 && "ds-nav-rail__count--zero"].filter(Boolean).join(" "), children: i }),
1785
+ x && l && /* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__dot", "aria-hidden": "true" })
1786
1786
  ] }), S = a ? /* @__PURE__ */ e.jsx("a", { href: r ? void 0 : a, ...$, children: y }) : /* @__PURE__ */ e.jsx("button", { type: "button", ...$, children: y });
1787
- return h && !x ? /* @__PURE__ */ e.jsx(Le, { content: s, position: N, children: S }) : S;
1787
+ return x && !h ? /* @__PURE__ */ e.jsx(Le, { content: s, position: _, children: S }) : S;
1788
1788
  }
1789
1789
  function Hs({ children: t, className: s = "", ...n }) {
1790
1790
  return /* @__PURE__ */ e.jsx("div", { className: ["ds-nav-rail__body", "ds-scrollable", s].filter(Boolean).join(" "), ...n, children: t });
@@ -1799,7 +1799,7 @@ function Ks({ className: t = "", ...s }) {
1799
1799
  return /* @__PURE__ */ e.jsx("hr", { className: ["ds-nav-rail__divider", t].filter(Boolean).join(" "), ...s });
1800
1800
  }
1801
1801
  function Xs({ children: t, label: s = "Recents", defaultOpen: n = !0, className: r = "", ...a }) {
1802
- const { collapsed: o } = de(ve), [i, l] = I(n);
1802
+ const { collapsed: o } = ue(ve), [i, l] = B(n);
1803
1803
  return /* @__PURE__ */ e.jsxs("div", { className: ["ds-nav-rail__recents", r].filter(Boolean).join(" "), ...a, children: [
1804
1804
  !o && /* @__PURE__ */ e.jsxs(
1805
1805
  "button",
@@ -1824,28 +1824,28 @@ const Js = Je(function({
1824
1824
  className: a = "",
1825
1825
  ...o
1826
1826
  }, i) {
1827
- const { collapsed: l, side: c } = de(ve), d = de(we), u = c === "left" ? "right" : "left", p = [
1827
+ const { collapsed: l, side: c } = ue(ve), d = ue(we), u = c === "left" ? "right" : "left", m = [
1828
1828
  "ds-nav-rail__item",
1829
1829
  "ds-nav-rail__agent",
1830
1830
  a
1831
- ].filter(Boolean).join(" "), h = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1831
+ ].filter(Boolean).join(" "), x = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1832
1832
  /* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__icon", "aria-hidden": "true", children: n }),
1833
1833
  !l && /* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__label", children: r })
1834
- ] }), m = /* @__PURE__ */ e.jsx(
1834
+ ] }), p = /* @__PURE__ */ e.jsx(
1835
1835
  s,
1836
1836
  {
1837
1837
  ref: i,
1838
- className: p,
1838
+ className: m,
1839
1839
  "aria-label": l ? r : void 0,
1840
1840
  ...s === "button" ? { type: "button" } : {},
1841
1841
  ...o,
1842
- children: h
1842
+ children: x
1843
1843
  }
1844
1844
  );
1845
- return l && !d ? /* @__PURE__ */ e.jsx(Le, { content: r, position: u, children: m }) : m;
1845
+ return l && !d ? /* @__PURE__ */ e.jsx(Le, { content: r, position: u, children: p }) : p;
1846
1846
  });
1847
1847
  function Zs({ avatar: t, label: s, selected: n = !1, disabled: r = !1, href: a, onClick: o, className: i = "", ...l }) {
1848
- const { collapsed: c, side: d } = de(ve), u = de(we), m = {
1848
+ const { collapsed: c, side: d } = ue(ve), u = ue(we), p = {
1849
1849
  className: [
1850
1850
  "ds-nav-rail__item",
1851
1851
  "ds-nav-rail__agent",
@@ -1860,11 +1860,11 @@ function Zs({ avatar: t, label: s, selected: n = !1, disabled: r = !1, href: a,
1860
1860
  "data-disabled": r || void 0
1861
1861
  },
1862
1862
  ...l
1863
- }, x = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1863
+ }, h = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1864
1864
  /* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__icon", "aria-hidden": "true", children: t }),
1865
1865
  !c && /* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__label", children: s })
1866
- ] }), b = d === "left" ? "right" : "left", g = a ? /* @__PURE__ */ e.jsx("a", { href: r ? void 0 : a, ...m, children: x }) : /* @__PURE__ */ e.jsx("button", { type: "button", ...m, children: x });
1867
- return c && !u ? /* @__PURE__ */ e.jsx(Le, { content: s, position: b, children: g }) : g;
1866
+ ] }), w = d === "left" ? "right" : "left", b = a ? /* @__PURE__ */ e.jsx("a", { href: r ? void 0 : a, ...p, children: h }) : /* @__PURE__ */ e.jsx("button", { type: "button", ...p, children: h });
1867
+ return c && !u ? /* @__PURE__ */ e.jsx(Le, { content: s, position: w, children: b }) : b;
1868
1868
  }
1869
1869
  const Ue = 240, Ve = 6, Ye = 8;
1870
1870
  function Qs({
@@ -1875,16 +1875,16 @@ function Qs({
1875
1875
  onOpenChange: a,
1876
1876
  defaultOpen: o = !1
1877
1877
  }) {
1878
- const { side: i } = de(ve), [l, c] = I(o), d = r !== void 0, u = d ? r : l, [p, h] = I(!1), m = R(null), x = R(null), [b, g] = I({}), $ = le(() => {
1878
+ const { side: i } = ue(ve), [l, c] = B(o), d = r !== void 0, u = d ? r : l, [m, x] = B(!1), p = R(null), h = R(null), [w, b] = B({}), $ = ce(() => {
1879
1879
  d ? a == null || a(!0) : c(!0);
1880
- }, [d, a]), _ = le(() => {
1880
+ }, [d, a]), N = ce(() => {
1881
1881
  d ? a == null || a(!1) : c(!1);
1882
- }, [d, a]), N = le(() => u ? _() : $(), [u, $, _]), y = le(() => {
1882
+ }, [d, a]), _ = ce(() => u ? N() : $(), [u, $, N]), y = ce(() => {
1883
1883
  var F;
1884
- const B = m.current;
1885
- if (!B) return;
1886
- const M = B.getBoundingClientRect(), W = window.innerHeight, z = ((F = x.current) == null ? void 0 : F.offsetHeight) ?? 300, j = Math.max(Ye, Math.min(W - z - Ye, M.top));
1887
- g(i === "right" ? {
1884
+ const D = p.current;
1885
+ if (!D) return;
1886
+ const M = D.getBoundingClientRect(), W = window.innerHeight, z = ((F = h.current) == null ? void 0 : F.offsetHeight) ?? 300, j = Math.max(Ye, Math.min(W - z - Ye, M.top));
1887
+ b(i === "right" ? {
1888
1888
  position: "fixed",
1889
1889
  top: j,
1890
1890
  right: window.innerWidth - M.left + Ve,
@@ -1898,34 +1898,34 @@ function Qs({
1898
1898
  }, [i]);
1899
1899
  P(() => {
1900
1900
  if (!u) {
1901
- h(!1);
1901
+ x(!1);
1902
1902
  return;
1903
1903
  }
1904
- return y(), requestAnimationFrame(() => h(!0)), window.addEventListener("scroll", y, !0), window.addEventListener("resize", y), () => {
1904
+ return y(), requestAnimationFrame(() => x(!0)), window.addEventListener("scroll", y, !0), window.addEventListener("resize", y), () => {
1905
1905
  window.removeEventListener("scroll", y, !0), window.removeEventListener("resize", y);
1906
1906
  };
1907
1907
  }, [u, y]), P(() => {
1908
1908
  if (!u) return;
1909
- const B = (W) => {
1909
+ const D = (W) => {
1910
1910
  var z, j;
1911
- !((z = x.current) != null && z.contains(W.target)) && !((j = m.current) != null && j.contains(W.target)) && _();
1911
+ !((z = h.current) != null && z.contains(W.target)) && !((j = p.current) != null && j.contains(W.target)) && N();
1912
1912
  }, M = (W) => {
1913
- W.key === "Escape" && _();
1913
+ W.key === "Escape" && N();
1914
1914
  };
1915
- return document.addEventListener("mousedown", B), document.addEventListener("keydown", M), () => {
1916
- document.removeEventListener("mousedown", B), document.removeEventListener("keydown", M);
1915
+ return document.addEventListener("mousedown", D), document.addEventListener("keydown", M), () => {
1916
+ document.removeEventListener("mousedown", D), document.removeEventListener("keydown", M);
1917
1917
  };
1918
- }, [u, _]);
1918
+ }, [u, N]);
1919
1919
  const S = u && /* @__PURE__ */ e.jsxs(
1920
1920
  "div",
1921
1921
  {
1922
- ref: x,
1922
+ ref: h,
1923
1923
  className: [
1924
1924
  "ds-nav-rail-flyout",
1925
1925
  `ds-nav-rail-flyout--${i}`,
1926
- p && "ds-nav-rail-flyout--visible"
1926
+ m && "ds-nav-rail-flyout--visible"
1927
1927
  ].filter(Boolean).join(" "),
1928
- style: b,
1928
+ style: w,
1929
1929
  "data-ds-portal": "",
1930
1930
  role: "dialog",
1931
1931
  "aria-modal": "false",
@@ -1937,7 +1937,7 @@ function Qs({
1937
1937
  {
1938
1938
  type: "button",
1939
1939
  className: "ds-nav-rail-flyout__close",
1940
- onClick: _,
1940
+ onClick: N,
1941
1941
  "aria-label": "Close",
1942
1942
  children: /* @__PURE__ */ e.jsx(ee, { size: 16, strokeWidth: 2 })
1943
1943
  }
@@ -1948,8 +1948,8 @@ function Qs({
1948
1948
  }
1949
1949
  );
1950
1950
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1951
- /* @__PURE__ */ e.jsx(we.Provider, { value: u, children: /* @__PURE__ */ e.jsx("div", { ref: m, onClick: N, style: { display: "flex", flexDirection: "column", width: "100%" }, children: t }) }),
1952
- typeof document < "u" && me.createPortal(S, document.body)
1951
+ /* @__PURE__ */ e.jsx(we.Provider, { value: u, children: /* @__PURE__ */ e.jsx("div", { ref: p, onClick: _, style: { display: "flex", flexDirection: "column", width: "100%" }, children: t }) }),
1952
+ typeof document < "u" && re.createPortal(S, document.body)
1953
1953
  ] });
1954
1954
  }
1955
1955
  const Pt = {
@@ -2011,26 +2011,26 @@ function tn({
2011
2011
  style: l,
2012
2012
  ...c
2013
2013
  }) {
2014
- const [d, u] = I(!1), [p, h] = I(!1), m = n !== void 0, x = m ? n : d, b = R(null), g = R(null), $ = R(null), _ = R(null), [N, y] = I({}), S = R(null), B = 150, M = () => {
2015
- if (m)
2014
+ const [d, u] = B(!1), [m, x] = B(!1), p = n !== void 0, h = p ? n : d, w = R(null), b = R(null), $ = R(null), N = R(null), [_, y] = B({}), S = R(null), D = 150, M = () => {
2015
+ if (p)
2016
2016
  r == null || r(!1);
2017
2017
  else {
2018
- if (p) return;
2019
- h(!0), S.current = setTimeout(() => {
2020
- u(!1), h(!1);
2021
- }, B);
2018
+ if (m) return;
2019
+ x(!0), S.current = setTimeout(() => {
2020
+ u(!1), x(!1);
2021
+ }, D);
2022
2022
  }
2023
2023
  }, W = () => {
2024
- const v = !x;
2025
- m ? r == null || r(v) : v ? (clearTimeout(S.current), h(!1), u(!0)) : M();
2024
+ const v = !h;
2025
+ p ? r == null || r(v) : v ? (clearTimeout(S.current), x(!1), u(!0)) : M();
2026
2026
  }, z = () => {
2027
- x || (m ? r == null || r(!0) : (clearTimeout(S.current), h(!1), u(!0)));
2027
+ h || (p ? r == null || r(!0) : (clearTimeout(S.current), x(!1), u(!0)));
2028
2028
  };
2029
2029
  P(() => () => clearTimeout(S.current), []), P(() => {
2030
- if (!x) return;
2030
+ if (!h) return;
2031
2031
  const v = 300, k = () => {
2032
2032
  var E;
2033
- const A = (E = b.current) == null ? void 0 : E.getBoundingClientRect();
2033
+ const A = (E = w.current) == null ? void 0 : E.getBoundingClientRect();
2034
2034
  if (!A) return;
2035
2035
  const U = window.innerHeight - A.bottom, G = U < v + 8 && A.top > U;
2036
2036
  y(
@@ -2040,7 +2040,7 @@ function tn({
2040
2040
  return k(), window.addEventListener("scroll", k, !0), window.addEventListener("resize", k), () => {
2041
2041
  window.removeEventListener("scroll", k, !0), window.removeEventListener("resize", k);
2042
2042
  };
2043
- }, [x, a]);
2043
+ }, [h, a]);
2044
2044
  const j = () => {
2045
2045
  var k;
2046
2046
  const v = (k = $.current) == null ? void 0 : k.querySelector(
@@ -2049,30 +2049,30 @@ function tn({
2049
2049
  v == null || v.focus();
2050
2050
  };
2051
2051
  P(() => {
2052
- if (!x) return;
2052
+ if (!h) return;
2053
2053
  const v = (A) => {
2054
2054
  var U, G;
2055
- !((U = b.current) != null && U.contains(A.target)) && !((G = g.current) != null && G.contains(A.target)) && M();
2055
+ !((U = w.current) != null && U.contains(A.target)) && !((G = b.current) != null && G.contains(A.target)) && M();
2056
2056
  }, k = (A) => {
2057
2057
  A.key === "Escape" && (M(), j());
2058
2058
  };
2059
2059
  return document.addEventListener("mousedown", v), document.addEventListener("keydown", k), () => {
2060
2060
  document.removeEventListener("mousedown", v), document.removeEventListener("keydown", k);
2061
2061
  };
2062
- }, [x]), P(() => {
2063
- if (!x || !_.current || !g.current) return;
2064
- const v = F(), k = _.current === "last" ? v[v.length - 1] : v[0];
2065
- k == null || k.focus(), _.current = null;
2066
- }, [x]);
2067
- const F = () => g.current ? [...g.current.querySelectorAll(
2062
+ }, [h]), P(() => {
2063
+ if (!h || !N.current || !b.current) return;
2064
+ const v = F(), k = N.current === "last" ? v[v.length - 1] : v[0];
2065
+ k == null || k.focus(), N.current = null;
2066
+ }, [h]);
2067
+ const F = () => b.current ? [...b.current.querySelectorAll(
2068
2068
  'button:not([disabled]), a[href]:not([aria-disabled="true"]), [tabindex]:not([tabindex="-1"])'
2069
2069
  )] : [], K = (v) => {
2070
2070
  var k, A;
2071
2071
  if (v.key === "ArrowDown")
2072
- v.preventDefault(), x ? (k = F()[0]) == null || k.focus() : (_.current = "first", z());
2072
+ v.preventDefault(), h ? (k = F()[0]) == null || k.focus() : (N.current = "first", z());
2073
2073
  else if (v.key === "ArrowUp")
2074
- if (v.preventDefault(), !x)
2075
- _.current = "last", z();
2074
+ if (v.preventDefault(), !h)
2075
+ N.current = "last", z();
2076
2076
  else {
2077
2077
  const U = F();
2078
2078
  (A = U[U.length - 1]) == null || A.focus();
@@ -2097,18 +2097,18 @@ function tn({
2097
2097
  M();
2098
2098
  break;
2099
2099
  }
2100
- }, D = x && /* @__PURE__ */ e.jsx(
2100
+ }, I = h && /* @__PURE__ */ e.jsx(
2101
2101
  "div",
2102
2102
  {
2103
- ref: g,
2103
+ ref: b,
2104
2104
  role: "menu",
2105
2105
  "data-ds-portal": "",
2106
2106
  className: [
2107
2107
  "ds-dropdown__menu",
2108
2108
  `ds-dropdown__menu--${a}`,
2109
- p && "ds-dropdown__menu--closing"
2109
+ m && "ds-dropdown__menu--closing"
2110
2110
  ].filter(Boolean).join(" "),
2111
- style: N,
2111
+ style: _,
2112
2112
  onKeyDown: V,
2113
2113
  children: s.map((v, k) => {
2114
2114
  if (v.separator)
@@ -2146,7 +2146,7 @@ function tn({
2146
2146
  return /* @__PURE__ */ e.jsxs(
2147
2147
  "div",
2148
2148
  {
2149
- ref: b,
2149
+ ref: w,
2150
2150
  className: ["ds-dropdown", o && "ds-dropdown--full-width", i].filter(Boolean).join(" "),
2151
2151
  style: l,
2152
2152
  ...c,
@@ -2161,7 +2161,7 @@ function tn({
2161
2161
  children: t
2162
2162
  }
2163
2163
  ),
2164
- typeof document < "u" && me.createPortal(D, document.body)
2164
+ typeof document < "u" && re.createPortal(I, document.body)
2165
2165
  ]
2166
2166
  }
2167
2167
  );
@@ -2205,7 +2205,7 @@ function sn({
2205
2205
  }
2206
2206
  const Mt = (t) => 1 - Math.pow(1 - t, 3), zt = () => typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
2207
2207
  function Ft(t, { duration: s = 600 } = {}) {
2208
- const [n, r] = I(t), a = R(t), o = R(null);
2208
+ const [n, r] = B(t), a = R(t), o = R(null);
2209
2209
  return P(() => {
2210
2210
  if (zt()) {
2211
2211
  r(t), a.current = t;
@@ -2216,8 +2216,8 @@ function Ft(t, { duration: s = 600 } = {}) {
2216
2216
  let c = null;
2217
2217
  const d = (u) => {
2218
2218
  c || (c = u);
2219
- const p = Math.min((u - c) / s, 1);
2220
- r(i + l * Mt(p)), p < 1 ? o.current = requestAnimationFrame(d) : a.current = t;
2219
+ const m = Math.min((u - c) / s, 1);
2220
+ r(i + l * Mt(m)), m < 1 ? o.current = requestAnimationFrame(d) : a.current = t;
2221
2221
  };
2222
2222
  return o.current = requestAnimationFrame(d), () => cancelAnimationFrame(o.current);
2223
2223
  }, [t, s]), n;
@@ -2233,7 +2233,7 @@ function nn({
2233
2233
  return `${r}${i}${a}`;
2234
2234
  }
2235
2235
  function Wt({ threshold: t = 0.1, rootMargin: s = "0px", once: n = !1 } = {}) {
2236
- const r = R(null), [a, o] = I(!1);
2236
+ const r = R(null), [a, o] = B(!1);
2237
2237
  return P(() => {
2238
2238
  const i = r.current;
2239
2239
  if (!i) return;
@@ -2291,7 +2291,7 @@ function an() {
2291
2291
  return t.success = (s, n) => t(s, { ...n, type: "success" }), t.error = (s, n) => t(s, { ...n, type: "error" }), t.warning = (s, n) => t(s, { ...n, type: "warning" }), { toast: t };
2292
2292
  }
2293
2293
  function Ut({ data: t, onDismiss: s }) {
2294
- const [n, r] = I(!1), a = R(null);
2294
+ const [n, r] = B(!1), a = R(null);
2295
2295
  P(() => (requestAnimationFrame(() => r(!0)), t.duration > 0 && (a.current = setTimeout(() => o(), t.duration)), () => clearTimeout(a.current)), []);
2296
2296
  function o() {
2297
2297
  r(!1), setTimeout(() => s(t.id), 250);
@@ -2324,16 +2324,16 @@ function Ut({ data: t, onDismiss: s }) {
2324
2324
  );
2325
2325
  }
2326
2326
  function on({ position: t = "bottom-right" }) {
2327
- const [s, n] = I(() => [...xe]);
2328
- return P(() => ($e.add(n), () => $e.delete(n)), []), !s.length || typeof document > "u" ? null : me.createPortal(
2327
+ const [s, n] = B(() => [...xe]);
2328
+ return P(() => ($e.add(n), () => $e.delete(n)), []), !s.length || typeof document > "u" ? null : re.createPortal(
2329
2329
  /* @__PURE__ */ e.jsx("div", { "data-ds-portal": "", className: ["ds-toast-container", `ds-toast-container--${t}`].join(" "), children: s.map((r) => /* @__PURE__ */ e.jsx(Ut, { data: r, onDismiss: Ot }, r.id)) }),
2330
2330
  document.body
2331
2331
  );
2332
2332
  }
2333
2333
  const Vt = {
2334
- running: /* @__PURE__ */ e.jsx(fe, { size: "xs", variant: "info", children: "Running..." }),
2335
- success: /* @__PURE__ */ e.jsx(fe, { size: "xs", variant: "success", children: "Done" }),
2336
- error: /* @__PURE__ */ e.jsx(fe, { size: "xs", variant: "error", children: "Error" })
2334
+ running: /* @__PURE__ */ e.jsx(me, { size: "xs", variant: "info", children: "Running..." }),
2335
+ success: /* @__PURE__ */ e.jsx(me, { size: "xs", variant: "success", children: "Done" }),
2336
+ error: /* @__PURE__ */ e.jsx(me, { size: "xs", variant: "error", children: "Error" })
2337
2337
  };
2338
2338
  function ln({
2339
2339
  label: t,
@@ -2347,7 +2347,7 @@ function ln({
2347
2347
  className: c = "",
2348
2348
  ...d
2349
2349
  }) {
2350
- const u = s === "running", p = /* @__PURE__ */ e.jsxs("span", { className: "ds-tool-card__title-row", children: [
2350
+ const u = s === "running", m = /* @__PURE__ */ e.jsxs("span", { className: "ds-tool-card__title-row", children: [
2351
2351
  n && /* @__PURE__ */ e.jsx("span", { className: "ds-tool-card__icon", children: n }),
2352
2352
  /* @__PURE__ */ e.jsx("span", { className: "ds-tool-card__label", children: t }),
2353
2353
  Vt[s],
@@ -2361,7 +2361,7 @@ function ln({
2361
2361
  children: /* @__PURE__ */ e.jsx(
2362
2362
  Be,
2363
2363
  {
2364
- title: p,
2364
+ title: m,
2365
2365
  padding: "s",
2366
2366
  defaultExpanded: a,
2367
2367
  expanded: u ? !1 : o,
@@ -2375,7 +2375,7 @@ function ln({
2375
2375
  {
2376
2376
  className: ["ds-tool-card", "ds-tool-card--bubble", c].filter(Boolean).join(" "),
2377
2377
  ...d,
2378
- children: p
2378
+ children: m
2379
2379
  }
2380
2380
  );
2381
2381
  }
@@ -2386,13 +2386,13 @@ function Yt({
2386
2386
  "aria-label": r = "Copy to clipboard",
2387
2387
  ...a
2388
2388
  }) {
2389
- const [o, i] = I(!1), l = (c) => {
2389
+ const [o, i] = B(!1), l = (c) => {
2390
2390
  c.currentTarget.blur(), navigator.clipboard.writeText(t).then(() => {
2391
2391
  i(!0), setTimeout(() => i(!1), n);
2392
2392
  });
2393
2393
  };
2394
2394
  return /* @__PURE__ */ e.jsx(
2395
- ae,
2395
+ oe,
2396
2396
  {
2397
2397
  variant: "ghost",
2398
2398
  size: s,
@@ -2405,7 +2405,7 @@ function Yt({
2405
2405
  );
2406
2406
  }
2407
2407
  function cn({ content: t, streaming: s = !1, ...n }) {
2408
- const [r, a] = I(s);
2408
+ const [r, a] = B(s);
2409
2409
  return P(() => {
2410
2410
  a(!!s);
2411
2411
  }, [s]), /* @__PURE__ */ e.jsx(
@@ -2438,22 +2438,22 @@ function dn({
2438
2438
  }) {
2439
2439
  return /* @__PURE__ */ e.jsxs("div", { className: ["ds-step-indicator", o].filter(Boolean).join(" "), ...l, children: [
2440
2440
  /* @__PURE__ */ e.jsx("div", { className: "ds-step-indicator__dots", role: "tablist", "aria-label": i, children: Array.from({ length: t }, (c, d) => {
2441
- const u = d === s, p = n.includes(d) && !u, h = r && (d <= s || n.includes(d)), m = [
2441
+ const u = d === s, m = n.includes(d) && !u, x = r && (d <= s || n.includes(d)), p = [
2442
2442
  "ds-step-indicator__dot",
2443
2443
  u && "ds-step-indicator__dot--active",
2444
- p && "ds-step-indicator__dot--done"
2444
+ m && "ds-step-indicator__dot--done"
2445
2445
  ].filter(Boolean).join(" ");
2446
2446
  return /* @__PURE__ */ e.jsx(
2447
2447
  "button",
2448
2448
  {
2449
2449
  type: "button",
2450
- className: m,
2450
+ className: p,
2451
2451
  role: "tab",
2452
2452
  "aria-selected": u,
2453
2453
  "aria-label": `Step ${d + 1}`,
2454
- disabled: !h || d === s,
2454
+ disabled: !x || d === s,
2455
2455
  onClick: () => r == null ? void 0 : r(d),
2456
- children: p ? /* @__PURE__ */ e.jsx(Re, { size: 8, strokeWidth: 3 }) : null
2456
+ children: m ? /* @__PURE__ */ e.jsx(Re, { size: 8, strokeWidth: 3 }) : null
2457
2457
  },
2458
2458
  d
2459
2459
  );
@@ -2532,33 +2532,33 @@ function Ht({
2532
2532
  betweenTime: o = 380,
2533
2533
  manualPauseMs: i = 5e3
2534
2534
  }) {
2535
- const [l, c] = I(0), [d, u] = I(""), p = R("typing"), h = R(0), m = R(0), x = R(null), b = R(0);
2535
+ const [l, c] = B(0), [d, u] = B(""), m = R("typing"), x = R(0), p = R(0), h = R(null), w = R(0);
2536
2536
  P(() => {
2537
- m.current = l;
2537
+ p.current = l;
2538
2538
  }, [l]), P(() => {
2539
- if (x.current && (clearTimeout(x.current), x.current = null), !s || t.length === 0) {
2540
- u(""), h.current = 0, p.current = "typing";
2539
+ if (h.current && (clearTimeout(h.current), h.current = null), !s || t.length === 0) {
2540
+ u(""), x.current = 0, m.current = "typing";
2541
2541
  return;
2542
2542
  }
2543
2543
  const y = () => {
2544
2544
  const S = Date.now();
2545
- if (b.current > S) {
2546
- x.current = setTimeout(y, b.current - S);
2545
+ if (w.current > S) {
2546
+ h.current = setTimeout(y, w.current - S);
2547
2547
  return;
2548
2548
  }
2549
- const B = t[m.current % t.length] ?? "";
2550
- p.current === "typing" ? (h.current += 1, u(B.slice(0, h.current)), h.current >= B.length ? (p.current = "holding", x.current = setTimeout(y, a)) : x.current = setTimeout(y, n + Math.random() * 28)) : p.current === "holding" ? (p.current = "erasing", x.current = setTimeout(y, r)) : (h.current = Math.max(0, h.current - 1), u(B.slice(0, h.current)), h.current <= 0 ? (p.current = "typing", m.current = (m.current + 1) % t.length, c(m.current), x.current = setTimeout(y, o)) : x.current = setTimeout(y, r));
2549
+ const D = t[p.current % t.length] ?? "";
2550
+ m.current === "typing" ? (x.current += 1, u(D.slice(0, x.current)), x.current >= D.length ? (m.current = "holding", h.current = setTimeout(y, a)) : h.current = setTimeout(y, n + Math.random() * 28)) : m.current === "holding" ? (m.current = "erasing", h.current = setTimeout(y, r)) : (x.current = Math.max(0, x.current - 1), u(D.slice(0, x.current)), x.current <= 0 ? (m.current = "typing", p.current = (p.current + 1) % t.length, c(p.current), h.current = setTimeout(y, o)) : h.current = setTimeout(y, r));
2551
2551
  };
2552
- return x.current = setTimeout(y, 260), () => {
2553
- x.current && clearTimeout(x.current);
2552
+ return h.current = setTimeout(y, 260), () => {
2553
+ h.current && clearTimeout(h.current);
2554
2554
  };
2555
2555
  }, [s, t, n, r, a, o]);
2556
- const g = (y) => {
2556
+ const b = (y) => {
2557
2557
  if (t.length === 0) return;
2558
- const S = (y % t.length + t.length) % t.length, B = t[S];
2559
- m.current = S, h.current = B.length, p.current = "holding", b.current = Date.now() + i, c(S), u(B);
2560
- }, $ = () => g(m.current + 1), _ = () => g(m.current - 1), N = t[l % t.length] ?? "";
2561
- return { displayed: d, currentPrompt: N, index: l, next: $, prev: _ };
2558
+ const S = (y % t.length + t.length) % t.length, D = t[S];
2559
+ p.current = S, x.current = D.length, m.current = "holding", w.current = Date.now() + i, c(S), u(D);
2560
+ }, $ = () => b(p.current + 1), N = () => b(p.current - 1), _ = t[l % t.length] ?? "";
2561
+ return { displayed: d, currentPrompt: _, index: l, next: $, prev: N };
2562
2562
  }
2563
2563
  let qt = 0;
2564
2564
  function pn({
@@ -2573,61 +2573,61 @@ function pn({
2573
2573
  animatedPlaceholders: c,
2574
2574
  attachments: d,
2575
2575
  images: u,
2576
- onAttachFiles: p,
2577
- onAttachImages: h,
2578
- onRemoveAttachment: m,
2579
- onRemoveImage: x,
2580
- acceptImage: b,
2581
- acceptFile: g,
2576
+ onAttachFiles: m,
2577
+ onAttachImages: x,
2578
+ onRemoveAttachment: p,
2579
+ onRemoveImage: h,
2580
+ acceptImage: w,
2581
+ acceptFile: b,
2582
2582
  maxImages: $,
2583
- maxImageSize: _,
2584
- leftSlot: N,
2583
+ maxImageSize: N,
2584
+ leftSlot: _,
2585
2585
  rightSlot: y,
2586
2586
  className: S = "",
2587
- ...B
2587
+ ...D
2588
2588
  }) {
2589
- const M = R(null), W = R(null), z = R(0), [j, F] = I(!1), [K, V] = I([]), D = (w) => {
2589
+ const M = R(null), W = R(null), z = R(0), [j, F] = B(!1), [K, V] = B([]), I = (g) => {
2590
2590
  const L = ++qt;
2591
- V((X) => [...X, { id: L, msg: w }]), setTimeout(() => V((X) => X.filter((J) => J.id !== L)), 6e3);
2592
- }, v = (w) => V((L) => L.filter((X) => X.id !== w)), k = (w) => w.type.startsWith("image/"), A = () => !0, U = b ?? k, G = g ?? A, E = (w) => {
2591
+ V((X) => [...X, { id: L, msg: g }]), setTimeout(() => V((X) => X.filter((J) => J.id !== L)), 6e3);
2592
+ }, v = (g) => V((L) => L.filter((X) => X.id !== g)), k = (g) => g.type.startsWith("image/"), A = () => !0, U = w ?? k, G = b ?? A, E = (g) => {
2593
2593
  const L = [], X = [], J = [], Z = [];
2594
- let se = 0, ue = $ != null ? $ - ((u == null ? void 0 : u.length) ?? 0) : 1 / 0;
2595
- for (const ne of w)
2596
- U(ne) ? _ && ne.size > _ ? J.push(ne.name) : ue > 0 ? (L.push(ne), ue--) : se++ : G(ne) ? X.push(ne) : Z.push(ne.name);
2594
+ let se = 0, fe = $ != null ? $ - ((u == null ? void 0 : u.length) ?? 0) : 1 / 0;
2595
+ for (const ne of g)
2596
+ U(ne) ? N && ne.size > N ? J.push(ne.name) : fe > 0 ? (L.push(ne), fe--) : se++ : G(ne) ? X.push(ne) : Z.push(ne.name);
2597
2597
  return { imageFiles: L, docFiles: X, tooLarge: J, skipped: Z, limitExceeded: se };
2598
- }, f = (w) => {
2599
- const { imageFiles: L, docFiles: X, tooLarge: J, skipped: Z, limitExceeded: se } = E(w);
2600
- J.length && D(`File${J.length > 1 ? "s" : ""} too large${_ ? ` (max ${_ / 1024 / 1024}MB)` : ""}: ${J.join(", ")}`), Z.length && D(`Skipped unsupported file${Z.length > 1 ? "s" : ""}: ${Z.join(", ")}`), se && D(`Max ${$} images per message`), h && L.length && h(L);
2601
- const ue = X.concat(h ? [] : L);
2602
- p && ue.length && p(ue);
2598
+ }, f = (g) => {
2599
+ const { imageFiles: L, docFiles: X, tooLarge: J, skipped: Z, limitExceeded: se } = E(g);
2600
+ J.length && I(`File${J.length > 1 ? "s" : ""} too large${N ? ` (max ${N / 1024 / 1024}MB)` : ""}: ${J.join(", ")}`), Z.length && I(`Skipped unsupported file${Z.length > 1 ? "s" : ""}: ${Z.join(", ")}`), se && I(`Max ${$} images per message`), x && L.length && x(L);
2601
+ const fe = X.concat(x ? [] : L);
2602
+ m && fe.length && m(fe);
2603
2603
  };
2604
2604
  P(() => {
2605
- const w = W.current;
2606
- w && (w.style.height = "auto", w.style.height = `${Math.min(w.scrollHeight, 200)}px`);
2605
+ const g = W.current;
2606
+ g && (g.style.height = "auto", g.style.height = `${Math.min(g.scrollHeight, 200)}px`);
2607
2607
  }, [t]), P(() => {
2608
- const w = (L) => {
2608
+ const g = (L) => {
2609
2609
  var J, Z, se;
2610
2610
  if (o || i) return;
2611
2611
  const X = (J = L.target) == null ? void 0 : J.tagName;
2612
2612
  X === "INPUT" || X === "TEXTAREA" || X === "SELECT" || (Z = L.target) != null && Z.isContentEditable || L.ctrlKey || L.metaKey || L.altKey || L.key.length !== 1 && L.key !== "Backspace" && L.key !== "Delete" || (se = W.current) == null || se.focus();
2613
2613
  };
2614
- return document.addEventListener("keydown", w), () => document.removeEventListener("keydown", w);
2614
+ return document.addEventListener("keydown", g), () => document.removeEventListener("keydown", g);
2615
2615
  }, [o, i]);
2616
- const T = (w) => {
2617
- w.preventDefault(), z.current++, w.dataTransfer.types.includes("Files") && F(!0);
2618
- }, O = (w) => {
2619
- w.preventDefault(), z.current--, z.current === 0 && F(!1);
2620
- }, Y = (w) => w.preventDefault(), te = (w) => {
2621
- w.preventDefault(), z.current = 0, F(!1);
2622
- const L = Array.from(w.dataTransfer.files);
2616
+ const T = (g) => {
2617
+ g.preventDefault(), z.current++, g.dataTransfer.types.includes("Files") && F(!0);
2618
+ }, O = (g) => {
2619
+ g.preventDefault(), z.current--, z.current === 0 && F(!1);
2620
+ }, Y = (g) => g.preventDefault(), te = (g) => {
2621
+ g.preventDefault(), z.current = 0, F(!1);
2622
+ const L = Array.from(g.dataTransfer.files);
2623
2623
  L.length && f(L);
2624
- }, oe = (w) => {
2625
- const L = Array.from(w.target.files || []);
2624
+ }, ie = (g) => {
2625
+ const L = Array.from(g.target.files || []);
2626
2626
  M.current && (M.current.value = ""), L.length && f(L);
2627
- }, H = (w) => {
2627
+ }, H = (g) => {
2628
2628
  var ne;
2629
- if (!h) return;
2630
- const L = (ne = w.clipboardData) == null ? void 0 : ne.items;
2629
+ if (!x) return;
2630
+ const L = (ne = g.clipboardData) == null ? void 0 : ne.items;
2631
2631
  if (!L) return;
2632
2632
  const X = [];
2633
2633
  for (const st of L) {
@@ -2635,29 +2635,29 @@ function pn({
2635
2635
  Me && X.push(Me);
2636
2636
  }
2637
2637
  if (X.length === 0) return;
2638
- const { imageFiles: J, tooLarge: Z, skipped: se, limitExceeded: ue } = E(X);
2639
- Z.length && D(`File${Z.length > 1 ? "s" : ""} too large: ${Z.join(", ")}`), se.length && D(`Skipped unsupported file${se.length > 1 ? "s" : ""}: ${se.join(", ")}`), ue && D(`Max ${$} images per message`), J.length && (w.preventDefault(), h(J));
2640
- }, Q = !o && !i && !!(c != null && c.length) && t.length === 0, ie = Ht({
2638
+ const { imageFiles: J, tooLarge: Z, skipped: se, limitExceeded: fe } = E(X);
2639
+ Z.length && I(`File${Z.length > 1 ? "s" : ""} too large: ${Z.join(", ")}`), se.length && I(`Skipped unsupported file${se.length > 1 ? "s" : ""}: ${se.join(", ")}`), fe && I(`Max ${$} images per message`), J.length && (g.preventDefault(), x(J));
2640
+ }, Q = !o && !i && !!(c != null && c.length) && t.length === 0, le = Ht({
2641
2641
  prompts: c ?? [],
2642
2642
  enabled: Q
2643
- }), ge = (w) => {
2643
+ }), ge = (g) => {
2644
2644
  if (Q) {
2645
- if (w.key === "ArrowDown" || w.key === "ArrowRight") {
2646
- w.preventDefault(), ie.next();
2645
+ if (g.key === "ArrowDown" || g.key === "ArrowRight") {
2646
+ g.preventDefault(), le.next();
2647
2647
  return;
2648
2648
  }
2649
- if (w.key === "ArrowUp" || w.key === "ArrowLeft") {
2650
- w.preventDefault(), ie.prev();
2649
+ if (g.key === "ArrowUp" || g.key === "ArrowLeft") {
2650
+ g.preventDefault(), le.prev();
2651
2651
  return;
2652
2652
  }
2653
- if (w.key === "Tab" && !w.shiftKey) {
2654
- w.preventDefault(), s == null || s(ie.currentPrompt);
2653
+ if (g.key === "Tab" && !g.shiftKey) {
2654
+ g.preventDefault(), s == null || s(le.currentPrompt);
2655
2655
  return;
2656
2656
  }
2657
2657
  }
2658
- a == null || a(w);
2659
- }, tt = (t.trim() || (u == null ? void 0 : u.length) > 0 || (d == null ? void 0 : d.length) > 0) && !i, Pe = p || h;
2660
- return /* @__PURE__ */ e.jsxs("div", { className: ["ds-prompt-input", S].filter(Boolean).join(" "), ...B, children: [
2658
+ a == null || a(g);
2659
+ }, tt = (t.trim() || (u == null ? void 0 : u.length) > 0 || (d == null ? void 0 : d.length) > 0) && !i, Pe = m || x;
2660
+ return /* @__PURE__ */ e.jsxs("div", { className: ["ds-prompt-input", S].filter(Boolean).join(" "), ...D, children: [
2661
2661
  Pe && /* @__PURE__ */ e.jsx(
2662
2662
  "input",
2663
2663
  {
@@ -2666,7 +2666,7 @@ function pn({
2666
2666
  multiple: !0,
2667
2667
  accept: "*/*",
2668
2668
  className: "ds-prompt-input__file-input",
2669
- onChange: oe
2669
+ onChange: ie
2670
2670
  }
2671
2671
  ),
2672
2672
  /* @__PURE__ */ e.jsxs(
@@ -2684,7 +2684,7 @@ function pn({
2684
2684
  {
2685
2685
  ref: W,
2686
2686
  value: t,
2687
- onChange: (w) => s == null ? void 0 : s(w.target.value),
2687
+ onChange: (g) => s == null ? void 0 : s(g.target.value),
2688
2688
  onKeyDown: ge,
2689
2689
  onPaste: H,
2690
2690
  placeholder: Q ? "" : l,
@@ -2694,67 +2694,67 @@ function pn({
2694
2694
  }
2695
2695
  ),
2696
2696
  Q && /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__anim", "aria-hidden": "true", children: [
2697
- /* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__anim-text", children: ie.displayed }),
2697
+ /* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__anim-text", children: le.displayed }),
2698
2698
  /* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__anim-cursor" })
2699
2699
  ] }),
2700
- u && u.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__images", children: u.map((w, L) => /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__image-thumb", children: [
2701
- /* @__PURE__ */ e.jsx("img", { src: w.preview, alt: "" }),
2700
+ u && u.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__images", children: u.map((g, L) => /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__image-thumb", children: [
2701
+ /* @__PURE__ */ e.jsx("img", { src: g.preview, alt: "" }),
2702
2702
  /* @__PURE__ */ e.jsx(
2703
2703
  "button",
2704
2704
  {
2705
2705
  className: "ds-prompt-input__image-remove",
2706
- onClick: () => x == null ? void 0 : x(L),
2706
+ onClick: () => h == null ? void 0 : h(L),
2707
2707
  "aria-label": "Remove image",
2708
2708
  type: "button",
2709
2709
  children: /* @__PURE__ */ e.jsx(ee, { size: 12, strokeWidth: 2 })
2710
2710
  }
2711
2711
  )
2712
2712
  ] }, L)) }),
2713
- K.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__warnings", children: K.map((w) => /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__warning", role: "alert", children: [
2714
- /* @__PURE__ */ e.jsx("span", { children: w.msg }),
2713
+ K.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__warnings", children: K.map((g) => /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__warning", role: "alert", children: [
2714
+ /* @__PURE__ */ e.jsx("span", { children: g.msg }),
2715
2715
  /* @__PURE__ */ e.jsx(
2716
2716
  "button",
2717
2717
  {
2718
2718
  type: "button",
2719
2719
  className: "ds-prompt-input__warning-close",
2720
- onClick: () => v(w.id),
2720
+ onClick: () => v(g.id),
2721
2721
  "aria-label": "Dismiss",
2722
2722
  children: /* @__PURE__ */ e.jsx(ee, { size: C[1], strokeWidth: 1.5 })
2723
2723
  }
2724
2724
  )
2725
- ] }, w.id)) }),
2726
- d && d.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__attachments", children: d.map((w, L) => /* @__PURE__ */ e.jsx(fe, { size: "xs", children: /* @__PURE__ */ e.jsxs("span", { className: "ds-prompt-input__badge-content", children: [
2727
- w.uploading ? /* @__PURE__ */ e.jsx(ft, { size: C[1], strokeWidth: 1.5, className: "spin" }) : /* @__PURE__ */ e.jsx(ze, { size: C[1], strokeWidth: 1.5 }),
2728
- w.filename,
2729
- w.uploading ? /* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__uploading", children: "Uploading..." }) : /* @__PURE__ */ e.jsx(
2725
+ ] }, g.id)) }),
2726
+ d && d.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__attachments", children: d.map((g, L) => /* @__PURE__ */ e.jsx(me, { size: "xs", children: /* @__PURE__ */ e.jsxs("span", { className: "ds-prompt-input__badge-content", children: [
2727
+ g.uploading ? /* @__PURE__ */ e.jsx(ft, { size: C[1], strokeWidth: 1.5, className: "spin" }) : /* @__PURE__ */ e.jsx(ze, { size: C[1], strokeWidth: 1.5 }),
2728
+ g.filename,
2729
+ g.uploading ? /* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__uploading", children: "Uploading..." }) : /* @__PURE__ */ e.jsx(
2730
2730
  "button",
2731
2731
  {
2732
2732
  type: "button",
2733
2733
  className: "ds-prompt-input__remove-btn",
2734
- onClick: () => m == null ? void 0 : m(L),
2734
+ onClick: () => p == null ? void 0 : p(L),
2735
2735
  children: /* @__PURE__ */ e.jsx(ee, { size: C[1], strokeWidth: 1.5 })
2736
2736
  }
2737
2737
  )
2738
2738
  ] }) }, L)) }),
2739
2739
  /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__toolbar", children: [
2740
2740
  Pe && /* @__PURE__ */ e.jsx(
2741
- ae,
2741
+ oe,
2742
2742
  {
2743
2743
  variant: "ghost",
2744
2744
  size: "xs",
2745
2745
  icon: /* @__PURE__ */ e.jsx(ze, { size: C[2], strokeWidth: 1.5 }),
2746
2746
  "aria-label": "Attach files",
2747
2747
  onClick: () => {
2748
- var w;
2749
- return (w = M.current) == null ? void 0 : w.click();
2748
+ var g;
2749
+ return (g = M.current) == null ? void 0 : g.click();
2750
2750
  }
2751
2751
  }
2752
2752
  ),
2753
- N,
2753
+ _,
2754
2754
  y,
2755
2755
  /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__spacer" }),
2756
2756
  o ? /* @__PURE__ */ e.jsx(
2757
- ae,
2757
+ oe,
2758
2758
  {
2759
2759
  variant: "primary",
2760
2760
  size: "xs",
@@ -2763,7 +2763,7 @@ function pn({
2763
2763
  "aria-label": "Stop"
2764
2764
  }
2765
2765
  ) : /* @__PURE__ */ e.jsx(
2766
- ae,
2766
+ oe,
2767
2767
  {
2768
2768
  variant: "primary",
2769
2769
  size: "xs",
@@ -2791,33 +2791,33 @@ function hn({
2791
2791
  className: l = "",
2792
2792
  ...c
2793
2793
  }) {
2794
- const [d, u] = I(!1), p = R(null), h = R(null), m = R(null), [x, b] = I({}), g = t.filter((j) => !a || j.name === "auto" ? !0 : (qe[j.tier] ?? 1) >= (qe[a] ?? 1)), $ = g.find((j) => j.name === "auto"), _ = g.filter((j) => j.name !== "auto"), N = t.find((j) => j.name === s), S = new Set(_.map((j) => j.tier).filter(Boolean)).size > 1;
2794
+ const [d, u] = B(!1), m = R(null), x = R(null), p = R(null), [h, w] = B({}), b = t.filter((j) => !a || j.name === "auto" ? !0 : (qe[j.tier] ?? 1) >= (qe[a] ?? 1)), $ = b.find((j) => j.name === "auto"), N = b.filter((j) => j.name !== "auto"), _ = t.find((j) => j.name === s), S = new Set(N.map((j) => j.tier).filter(Boolean)).size > 1;
2795
2795
  P(() => {
2796
2796
  if (!d) return;
2797
2797
  const j = 320, F = () => {
2798
2798
  var A;
2799
- const D = (A = h.current) == null ? void 0 : A.getBoundingClientRect();
2800
- if (!D) return;
2801
- const v = window.innerHeight - D.bottom, k = v < j + 8 && D.top > v;
2802
- b({
2799
+ const I = (A = x.current) == null ? void 0 : A.getBoundingClientRect();
2800
+ if (!I) return;
2801
+ const v = window.innerHeight - I.bottom, k = v < j + 8 && I.top > v;
2802
+ w({
2803
2803
  position: "fixed",
2804
2804
  zIndex: "var(--z-dropdown, 500)",
2805
- left: D.left,
2806
- ...k ? { bottom: window.innerHeight - D.top + 4, top: "auto" } : { top: D.bottom + 4, bottom: "auto" }
2805
+ left: I.left,
2806
+ ...k ? { bottom: window.innerHeight - I.top + 4, top: "auto" } : { top: I.bottom + 4, bottom: "auto" }
2807
2807
  });
2808
2808
  };
2809
2809
  F(), window.addEventListener("scroll", F, !0), window.addEventListener("resize", F);
2810
- const K = (D) => {
2810
+ const K = (I) => {
2811
2811
  var v, k;
2812
- !((v = p.current) != null && v.contains(D.target)) && !((k = m.current) != null && k.contains(D.target)) && u(!1);
2813
- }, V = (D) => {
2814
- D.key === "Escape" && u(!1);
2812
+ !((v = m.current) != null && v.contains(I.target)) && !((k = p.current) != null && k.contains(I.target)) && u(!1);
2813
+ }, V = (I) => {
2814
+ I.key === "Escape" && u(!1);
2815
2815
  };
2816
2816
  return document.addEventListener("mousedown", K), document.addEventListener("keydown", V), () => {
2817
2817
  window.removeEventListener("scroll", F, !0), window.removeEventListener("resize", F), document.removeEventListener("mousedown", K), document.removeEventListener("keydown", V);
2818
2818
  };
2819
2819
  }, [d]);
2820
- const B = (j) => {
2820
+ const D = (j) => {
2821
2821
  n == null || n(j), u(!1);
2822
2822
  }, M = (j) => /* @__PURE__ */ e.jsxs(
2823
2823
  "button",
@@ -2827,21 +2827,21 @@ function hn({
2827
2827
  "ds-model-picker__item",
2828
2828
  j.name === s && "ds-model-picker__item--active"
2829
2829
  ].filter(Boolean).join(" "),
2830
- onClick: () => B(j.name),
2830
+ onClick: () => D(j.name),
2831
2831
  children: [
2832
2832
  j.icon ? /* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-icon", children: j.icon }) : /* @__PURE__ */ e.jsx(Fe, { size: 12, strokeWidth: 1.5, className: "ds-model-picker__item-icon" }),
2833
2833
  /* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children: j.displayName || j.name }),
2834
- S && j.tier && /* @__PURE__ */ e.jsx(fe, { size: "xs", variant: Ge[j.tier] || "default", children: j.tier })
2834
+ S && j.tier && /* @__PURE__ */ e.jsx(me, { size: "xs", variant: Ge[j.tier] || "default", children: j.tier })
2835
2835
  ]
2836
2836
  },
2837
2837
  j.name
2838
- ), W = () => !i || !S ? _.map(M) : ["fast", "standard", "premium"].flatMap((j) => {
2839
- const F = _.filter((K) => K.tier === j);
2838
+ ), W = () => !i || !S ? N.map(M) : ["fast", "standard", "premium"].flatMap((j) => {
2839
+ const F = N.filter((K) => K.tier === j);
2840
2840
  return F.length ? [
2841
2841
  /* @__PURE__ */ e.jsx("div", { className: "ds-model-picker__group-label", "data-tier": j, children: j.charAt(0).toUpperCase() + j.slice(1) }, `lbl-${j}`),
2842
2842
  ...F.map(M)
2843
2843
  ] : [];
2844
- }), z = d && /* @__PURE__ */ e.jsxs("div", { ref: m, className: "ds-model-picker__menu ds-scrollable", "data-ds-portal": "", style: x, children: [
2844
+ }), z = d && /* @__PURE__ */ e.jsxs("div", { ref: p, className: "ds-model-picker__menu ds-scrollable", "data-ds-portal": "", style: h, children: [
2845
2845
  o && $ && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2846
2846
  /* @__PURE__ */ e.jsxs(
2847
2847
  "button",
@@ -2852,41 +2852,41 @@ function hn({
2852
2852
  "ds-model-picker__item--auto",
2853
2853
  s === "auto" && "ds-model-picker__item--active"
2854
2854
  ].filter(Boolean).join(" "),
2855
- onClick: () => B("auto"),
2855
+ onClick: () => D("auto"),
2856
2856
  children: [
2857
2857
  /* @__PURE__ */ e.jsx(ht, { size: 12, strokeWidth: 1.5, className: "ds-model-picker__item-icon" }),
2858
2858
  /* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children: "Auto (smart routing)" })
2859
2859
  ]
2860
2860
  }
2861
2861
  ),
2862
- _.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-model-picker__separator" })
2862
+ N.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-model-picker__separator" })
2863
2863
  ] }),
2864
2864
  W()
2865
2865
  ] });
2866
2866
  return /* @__PURE__ */ e.jsxs(
2867
2867
  "div",
2868
2868
  {
2869
- ref: p,
2869
+ ref: m,
2870
2870
  className: ["ds-model-picker", l].filter(Boolean).join(" "),
2871
2871
  ...c,
2872
2872
  children: [
2873
2873
  /* @__PURE__ */ e.jsxs(
2874
2874
  "button",
2875
2875
  {
2876
- ref: h,
2876
+ ref: x,
2877
2877
  type: "button",
2878
2878
  className: "ds-model-picker__trigger",
2879
2879
  onClick: () => u((j) => !j),
2880
2880
  "aria-haspopup": "listbox",
2881
2881
  "aria-expanded": d,
2882
2882
  children: [
2883
- N != null && N.icon ? /* @__PURE__ */ e.jsx("span", { children: N.icon }) : /* @__PURE__ */ e.jsx(Fe, { size: 12, strokeWidth: 1.5 }),
2884
- /* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__trigger-name", children: (N == null ? void 0 : N.displayName) || (N == null ? void 0 : N.name) || s }),
2885
- S && (N == null ? void 0 : N.tier) && /* @__PURE__ */ e.jsx(fe, { size: "xs", variant: Ge[N.tier] || "default", children: N.tier })
2883
+ _ != null && _.icon ? /* @__PURE__ */ e.jsx("span", { children: _.icon }) : /* @__PURE__ */ e.jsx(Fe, { size: 12, strokeWidth: 1.5 }),
2884
+ /* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__trigger-name", children: (_ == null ? void 0 : _.displayName) || (_ == null ? void 0 : _.name) || s }),
2885
+ S && (_ == null ? void 0 : _.tier) && /* @__PURE__ */ e.jsx(me, { size: "xs", variant: Ge[_.tier] || "default", children: _.tier })
2886
2886
  ]
2887
2887
  }
2888
2888
  ),
2889
- typeof document < "u" && me.createPortal(z, document.body)
2889
+ typeof document < "u" && re.createPortal(z, document.body)
2890
2890
  ]
2891
2891
  }
2892
2892
  );
@@ -2911,22 +2911,22 @@ function xn({
2911
2911
  maxVisible: r = 5,
2912
2912
  onSourceClick: a
2913
2913
  }) {
2914
- const [o, i] = I(!1), l = Kt(t), c = l.length > r, d = o ? l : l.slice(0, r), u = t.some((h) => h.snippet), p = ["ds-sources-panel", s === "compact" && "ds-sources-panel--compact"].filter(Boolean).join(" ");
2915
- return s === "compact" ? /* @__PURE__ */ e.jsxs("div", { className: p, children: [
2916
- d.map((h) => {
2917
- const m = h.items.map((b) => b.page).filter(Boolean), x = !!a;
2914
+ const [o, i] = B(!1), l = Kt(t), c = l.length > r, d = o ? l : l.slice(0, r), u = t.some((x) => x.snippet), m = ["ds-sources-panel", s === "compact" && "ds-sources-panel--compact"].filter(Boolean).join(" ");
2915
+ return s === "compact" ? /* @__PURE__ */ e.jsxs("div", { className: m, children: [
2916
+ d.map((x) => {
2917
+ const p = x.items.map((w) => w.page).filter(Boolean), h = !!a;
2918
2918
  return /* @__PURE__ */ e.jsxs(
2919
2919
  "div",
2920
2920
  {
2921
- className: `ds-sources-panel__compact-row${x ? " ds-sources-panel__compact-row--clickable" : ""}`,
2922
- onClick: x ? () => a(h.items[0]) : void 0,
2921
+ className: `ds-sources-panel__compact-row${h ? " ds-sources-panel__compact-row--clickable" : ""}`,
2922
+ onClick: h ? () => a(x.items[0]) : void 0,
2923
2923
  children: [
2924
2924
  /* @__PURE__ */ e.jsx(xt, { size: C[1], strokeWidth: 1.5, className: "ds-sources-panel__compact-icon" }),
2925
- /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: h.filename }),
2926
- m.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: Te(m) })
2925
+ /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: x.filename }),
2926
+ p.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: Te(p) })
2927
2927
  ]
2928
2928
  },
2929
- h.filename
2929
+ x.filename
2930
2930
  );
2931
2931
  }),
2932
2932
  c && !o && /* @__PURE__ */ e.jsxs("button", { className: "ds-sources-panel__more", onClick: () => i(!0), children: [
@@ -2934,37 +2934,37 @@ function xn({
2934
2934
  l.length - r,
2935
2935
  " more sources"
2936
2936
  ] })
2937
- ] }) : /* @__PURE__ */ e.jsxs("div", { className: p, children: [
2937
+ ] }) : /* @__PURE__ */ e.jsxs("div", { className: m, children: [
2938
2938
  n && /* @__PURE__ */ e.jsx("div", { className: "ds-sources-panel__title", children: n }),
2939
- d.map((h) => {
2940
- const m = h.items.map((b) => b.page).filter(Boolean), x = !!a;
2939
+ d.map((x) => {
2940
+ const p = x.items.map((w) => w.page).filter(Boolean), h = !!a;
2941
2941
  return u ? /* @__PURE__ */ e.jsx(
2942
2942
  Be,
2943
2943
  {
2944
- title: /* @__PURE__ */ e.jsx(Gt, { filename: h.filename, pages: m }),
2944
+ title: /* @__PURE__ */ e.jsx(Gt, { filename: x.filename, pages: p }),
2945
2945
  padding: "s",
2946
- children: h.items.map((b, g) => /* @__PURE__ */ e.jsx(
2946
+ children: x.items.map((w, b) => /* @__PURE__ */ e.jsx(
2947
2947
  "div",
2948
2948
  {
2949
- className: `ds-sources-panel__snippet${x ? " ds-sources-panel__snippet--clickable" : ""}`,
2950
- onClick: x ? () => a(b) : void 0,
2951
- children: b.snippet ?? `p. ${b.page}`
2949
+ className: `ds-sources-panel__snippet${h ? " ds-sources-panel__snippet--clickable" : ""}`,
2950
+ onClick: h ? () => a(w) : void 0,
2951
+ children: w.snippet ?? `p. ${w.page}`
2952
2952
  },
2953
- g
2953
+ b
2954
2954
  ))
2955
2955
  },
2956
- h.filename
2956
+ x.filename
2957
2957
  ) : /* @__PURE__ */ e.jsxs(
2958
2958
  "div",
2959
2959
  {
2960
- className: `ds-sources-panel__row${x ? " ds-sources-panel__row--clickable" : ""}`,
2961
- onClick: x ? () => a(h.items[0]) : void 0,
2960
+ className: `ds-sources-panel__row${h ? " ds-sources-panel__row--clickable" : ""}`,
2961
+ onClick: h ? () => a(x.items[0]) : void 0,
2962
2962
  children: [
2963
- /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: h.filename }),
2964
- m.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: Te(m) })
2963
+ /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: x.filename }),
2964
+ p.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: Te(p) })
2965
2965
  ]
2966
2966
  },
2967
- h.filename
2967
+ x.filename
2968
2968
  );
2969
2969
  }),
2970
2970
  c && !o && /* @__PURE__ */ e.jsxs("button", { className: "ds-sources-panel__more", onClick: () => i(!0), children: [
@@ -3070,8 +3070,8 @@ function bn({
3070
3070
  return /* @__PURE__ */ e.jsxs("div", { className: i, children: [
3071
3071
  o && /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__title", children: o }),
3072
3072
  /* @__PURE__ */ e.jsxs("div", { className: "ds-diff-view__body ds-scrollable", style: l, children: [
3073
- /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col ds-scrollable", children: c.map((u, p) => /* @__PURE__ */ e.jsx(ye, { line: u, lineNumbers: r }, p)) }),
3074
- /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col ds-scrollable", children: d.map((u, p) => /* @__PURE__ */ e.jsx(ye, { line: u, lineNumbers: r }, p)) })
3073
+ /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col ds-scrollable", children: c.map((u, m) => /* @__PURE__ */ e.jsx(ye, { line: u, lineNumbers: r }, m)) }),
3074
+ /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col ds-scrollable", children: d.map((u, m) => /* @__PURE__ */ e.jsx(ye, { line: u, lineNumbers: r }, m)) })
3075
3075
  ] })
3076
3076
  ] });
3077
3077
  }
@@ -3237,16 +3237,16 @@ function gn({ children: t, axis: s = "y", style: n, className: r = "", ...a }) {
3237
3237
  }
3238
3238
  );
3239
3239
  }
3240
- const ke = 280, es = 22, ts = 14, ce = 8, Ne = 6, ss = 200;
3240
+ const ke = 280, es = 22, ts = 14, de = 8, Ne = 6, ss = 200;
3241
3241
  function ns(t) {
3242
3242
  return t ? typeof t == "function" ? t() : typeof t == "string" ? document.querySelector(t) : null : null;
3243
3243
  }
3244
3244
  function rs(t, s, n, r) {
3245
3245
  const a = window.innerWidth, o = window.innerHeight;
3246
- if (o - t.bottom >= s + r + ce) return "bottom";
3247
- if (t.top >= s + r + ce) return "top";
3248
- if (a - t.right >= n + r + ce) return "right";
3249
- if (t.left >= n + r + ce) return "left";
3246
+ if (o - t.bottom >= s + r + de) return "bottom";
3247
+ if (t.top >= s + r + de) return "top";
3248
+ if (a - t.right >= n + r + de) return "right";
3249
+ if (t.left >= n + r + de) return "left";
3250
3250
  const i = Math.max(t.top, o - t.bottom, a - t.right, t.left);
3251
3251
  return i === o - t.bottom ? "bottom" : i === t.top ? "top" : i === a - t.right ? "right" : "left";
3252
3252
  }
@@ -3266,7 +3266,7 @@ function as(t, s, n, r, a) {
3266
3266
  default:
3267
3267
  l = s.top + s.height / 2 - n / 2, c = s.right + a;
3268
3268
  }
3269
- const d = Math.max(ce, Math.min(o - r - ce, c)), u = Math.max(ce, Math.min(i - n - ce, l));
3269
+ const d = Math.max(de, Math.min(o - r - de, c)), u = Math.max(de, Math.min(i - n - de, l));
3270
3270
  return { top: u, left: d, arrowOffset: c - d, arrowOffsetY: l - u };
3271
3271
  }
3272
3272
  function yn({
@@ -3281,18 +3281,18 @@ function yn({
3281
3281
  labelNext: c = "Next",
3282
3282
  labelBack: d = "Back",
3283
3283
  labelSkip: u = "Skip tour",
3284
- labelFinish: p = "Done",
3285
- statePrimary: h = "idle",
3286
- stateBack: m = "idle"
3284
+ labelFinish: m = "Done",
3285
+ statePrimary: x = "idle",
3286
+ stateBack: p = "idle"
3287
3287
  }) {
3288
- const x = R(null), b = R(t), g = R(s), $ = R(l);
3289
- b.current = t, g.current = s, $.current = l;
3290
- const [_, N] = I(!1), [y, S] = I({ position: "fixed", visibility: "hidden", width: ke }), [B, M] = I("bottom"), [W, z] = I(null), j = R(!1), F = t[s], K = s === t.length - 1, V = le(() => {
3291
- const D = b.current[g.current];
3292
- if (!D || !x.current) return;
3293
- const v = ns(D.target);
3288
+ const h = R(null), w = R(t), b = R(s), $ = R(l);
3289
+ w.current = t, b.current = s, $.current = l;
3290
+ const [N, _] = B(!1), [y, S] = B({ position: "fixed", visibility: "hidden", width: ke }), [D, M] = B("bottom"), [W, z] = B(null), j = R(!1), F = t[s], K = s === t.length - 1, V = ce(() => {
3291
+ const I = w.current[b.current];
3292
+ if (!I || !h.current) return;
3293
+ const v = ns(I.target);
3294
3294
  if (!v) return;
3295
- const k = v.getBoundingClientRect(), U = x.current.getBoundingClientRect().height || 160, G = ke, E = $.current ? es : ts, f = D.position || rs(k, U, G, E), { top: T, left: O, arrowOffset: Y, arrowOffsetY: te } = as(f, k, U, G, E);
3295
+ const k = v.getBoundingClientRect(), U = h.current.getBoundingClientRect().height || 160, G = ke, E = $.current ? es : ts, f = I.position || rs(k, U, G, E), { top: T, left: O, arrowOffset: Y, arrowOffsetY: te } = as(f, k, U, G, E);
3296
3296
  M(f), S({
3297
3297
  position: "fixed",
3298
3298
  top: T,
@@ -3310,41 +3310,41 @@ function yn({
3310
3310
  }, []);
3311
3311
  return P(() => {
3312
3312
  window.addEventListener("scroll", V, !0), window.addEventListener("resize", V);
3313
- const D = requestAnimationFrame(() => {
3314
- V(), N(!0), j.current = !0;
3313
+ const I = requestAnimationFrame(() => {
3314
+ V(), _(!0), j.current = !0;
3315
3315
  });
3316
3316
  return () => {
3317
- cancelAnimationFrame(D), window.removeEventListener("scroll", V, !0), window.removeEventListener("resize", V);
3317
+ cancelAnimationFrame(I), window.removeEventListener("scroll", V, !0), window.removeEventListener("resize", V);
3318
3318
  };
3319
3319
  }, []), P(() => {
3320
3320
  if (!j.current) return;
3321
- N(!1);
3322
- const D = setTimeout(() => {
3321
+ _(!1);
3322
+ const I = setTimeout(() => {
3323
3323
  S((v) => ({ ...v, visibility: "hidden" })), requestAnimationFrame(() => {
3324
- V(), N(!0);
3324
+ V(), _(!0);
3325
3325
  });
3326
3326
  }, ss + 20);
3327
- return () => clearTimeout(D);
3327
+ return () => clearTimeout(I);
3328
3328
  }, [s]), P(() => {
3329
- _ && x.current && x.current.focus({ preventScroll: !0 });
3330
- }, [_]), P(() => {
3331
- const D = (v) => {
3329
+ N && h.current && h.current.focus({ preventScroll: !0 });
3330
+ }, [N]), P(() => {
3331
+ const I = (v) => {
3332
3332
  v.key === "Escape" && a();
3333
3333
  };
3334
- return document.addEventListener("keydown", D), () => document.removeEventListener("keydown", D);
3334
+ return document.addEventListener("keydown", I), () => document.removeEventListener("keydown", I);
3335
3335
  }, [a]), P(() => {
3336
- if (!_) return;
3337
- const D = (v) => {
3338
- if (v.key !== "Tab" || !x.current) return;
3336
+ if (!N) return;
3337
+ const I = (v) => {
3338
+ if (v.key !== "Tab" || !h.current) return;
3339
3339
  const k = Array.from(
3340
- x.current.querySelectorAll('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])')
3340
+ h.current.querySelectorAll('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])')
3341
3341
  );
3342
3342
  if (!k.length) return;
3343
3343
  const A = k[0], U = k[k.length - 1];
3344
3344
  v.shiftKey && document.activeElement === A ? (v.preventDefault(), U.focus()) : !v.shiftKey && document.activeElement === U && (v.preventDefault(), A.focus());
3345
3345
  };
3346
- return document.addEventListener("keydown", D), () => document.removeEventListener("keydown", D);
3347
- }, [_]), !F || typeof document > "u" ? null : me.createPortal(
3346
+ return document.addEventListener("keydown", I), () => document.removeEventListener("keydown", I);
3347
+ }, [N]), !F || typeof document > "u" ? null : re.createPortal(
3348
3348
  /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3349
3349
  W && /* @__PURE__ */ e.jsx(
3350
3350
  "div",
@@ -3353,7 +3353,7 @@ function yn({
3353
3353
  "ds-coachmark__spotlight",
3354
3354
  i && "ds-coachmark__spotlight--overlay",
3355
3355
  !l && "ds-coachmark__spotlight--no-ring",
3356
- _ && "ds-coachmark__spotlight--visible"
3356
+ N && "ds-coachmark__spotlight--visible"
3357
3357
  ].filter(Boolean).join(" "),
3358
3358
  style: W,
3359
3359
  "aria-hidden": "true"
@@ -3362,7 +3362,7 @@ function yn({
3362
3362
  /* @__PURE__ */ e.jsxs(
3363
3363
  "div",
3364
3364
  {
3365
- ref: x,
3365
+ ref: h,
3366
3366
  "data-ds-portal": "",
3367
3367
  role: "dialog",
3368
3368
  "aria-modal": "false",
@@ -3370,8 +3370,8 @@ function yn({
3370
3370
  "aria-label": F.title ?? `Step ${s + 1} of ${t.length}`,
3371
3371
  className: [
3372
3372
  "ds-coachmark__bubble",
3373
- `ds-coachmark__bubble--${B}`,
3374
- _ && "ds-coachmark__bubble--visible"
3373
+ `ds-coachmark__bubble--${D}`,
3374
+ N && "ds-coachmark__bubble--visible"
3375
3375
  ].filter(Boolean).join(" "),
3376
3376
  style: y,
3377
3377
  tabIndex: -1,
@@ -3395,8 +3395,8 @@ function yn({
3395
3395
  t.length
3396
3396
  ] }),
3397
3397
  /* @__PURE__ */ e.jsxs("div", { className: "ds-coachmark__footer-nav", children: [
3398
- s > 0 && /* @__PURE__ */ e.jsx(ae, { variant: "secondary", size: "s", state: m, onClick: r, children: d }),
3399
- /* @__PURE__ */ e.jsx(ae, { variant: "primary", size: "s", state: h, onClick: K ? o : n, children: K ? p : c })
3398
+ s > 0 && /* @__PURE__ */ e.jsx(oe, { variant: "secondary", size: "s", state: p, onClick: r, children: d }),
3399
+ /* @__PURE__ */ e.jsx(oe, { variant: "primary", size: "s", state: x, onClick: K ? o : n, children: K ? m : c })
3400
3400
  ] })
3401
3401
  ] })
3402
3402
  ]
@@ -3407,7 +3407,7 @@ function yn({
3407
3407
  );
3408
3408
  }
3409
3409
  function kn(t, s = {}) {
3410
- const { storageKey: n } = s, [r, a] = I(0), [o, i] = I(!1), l = () => n && typeof localStorage < "u" && localStorage.getItem(n) === "done", c = le(() => {
3410
+ const { storageKey: n } = s, [r, a] = B(0), [o, i] = B(!1), l = () => n && typeof localStorage < "u" && localStorage.getItem(n) === "done", c = ce(() => {
3411
3411
  i(!1), n && typeof localStorage < "u" && localStorage.setItem(n, "done");
3412
3412
  }, [n]);
3413
3413
  return {
@@ -3423,7 +3423,7 @@ function kn(t, s = {}) {
3423
3423
  };
3424
3424
  }
3425
3425
  function En() {
3426
- const t = R(null), s = le(() => {
3426
+ const t = R(null), s = ce(() => {
3427
3427
  const n = t.current;
3428
3428
  if (!n) return;
3429
3429
  n.classList.remove("ds-shake"), n.offsetWidth, n.classList.add("ds-shake");
@@ -3439,11 +3439,11 @@ export {
3439
3439
  bs as Alert,
3440
3440
  nn as AnimatedNumber,
3441
3441
  Ss as Avatar,
3442
- fe as Badge,
3442
+ me as Badge,
3443
3443
  en as Banner,
3444
3444
  Ns as BottomSheet,
3445
3445
  Cs as Breadcrumb,
3446
- ae as Button,
3446
+ oe as Button,
3447
3447
  ms as Card,
3448
3448
  fn as ChatMessage,
3449
3449
  Ts as Checkbox,