@epam/ai-dial-conversation-panel 1.3.0-dev.241 → 1.3.0-dev.244

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/index.js CHANGED
@@ -1,32 +1,32 @@
1
1
  import { ConversationKind as e, DeploymentIcon as t, FilterTab as n, buildCssVars as r, getUtf8ByteLength as i, mergeClasses as a, sanitizeConversationName as o, stripTrailingDots as s } from "@epam/ai-dial-chat-shared";
2
2
  import { PanelEmpty as c, PanelNoResults as l, SidebarOrientation as u, SidebarPanel as d } from "@epam/ai-dial-sidebar";
3
- import { Button as f, ButtonVariant as p, DIAL_ICON_SIZE as m, DIAL_KIT_ICON_STROKE as h, Dropdown as g, ElementSize as _, EllipsisTooltip as v, FilterChips as y, GhostIconButton as b, Highlight as x, Input as S, MenuItemMark as C, Popup as w, PopupSize as T, Search as E, Skeleton as D, SkeletonVariant as O, Spinner as k, mergeClasses as A } from "@epam/ai-dial-ui-kit";
4
- import { createElement as j, memo as M, useCallback as N, useEffect as P, useId as ee, useImperativeHandle as F, useLayoutEffect as I, useMemo as L, useRef as R, useState as z } from "react";
5
- import { Fragment as B, jsx as V, jsxs as H } from "react/jsx-runtime";
6
- import { IconCaretDownFilled as te, IconCaretRightFilled as ne, IconChevronDown as U, IconChevronRight as W, IconDotsVertical as re, IconFilter2 as ie, IconPlus as ae, IconSearch as oe, IconSparkles as G, IconX as se } from "@tabler/icons-react";
3
+ import { Button as f, ButtonVariant as p, DIAL_ICON_SIZE as m, DIAL_KIT_ICON_STROKE as h, Dropdown as g, ElementSize as _, EllipsisTooltip as v, FilterChips as y, GhostIconButton as b, Highlight as x, Input as S, MenuItemMark as C, Popup as w, PopupSize as T, Search as ee, Skeleton as E, SkeletonVariant as D, Spinner as O, mergeClasses as k } from "@epam/ai-dial-ui-kit";
4
+ import { createElement as A, memo as j, useCallback as M, useEffect as N, useId as te, useImperativeHandle as ne, useLayoutEffect as P, useMemo as F, useRef as I, useState as L } from "react";
5
+ import { Fragment as re, jsx as R, jsxs as z } from "react/jsx-runtime";
6
+ import { IconCaretDownFilled as B, IconCaretRightFilled as ie, IconChevronDown as V, IconChevronRight as H, IconDotsVertical as ae, IconFilter2 as oe, IconPlus as se, IconSearch as ce, IconSparkles as U, IconX as le } from "@tabler/icons-react";
7
7
  //#region src/constants/public-class-names.ts
8
- var ce = {
8
+ var ue = {
9
9
  newChatButton: "dial-cp-new-chat-button",
10
10
  search: "dial-cp-search",
11
11
  list: "dial-cp-list",
12
12
  listHeader: "dial-cp-list-header",
13
13
  listSection: "dial-cp-list-section"
14
- }, K = typeof window < "u" ? I : P;
15
- function q(e) {
14
+ }, W = typeof window < "u" ? P : N;
15
+ function G(e) {
16
16
  if (e !== void 0) switch (typeof e) {
17
17
  case "number": return e;
18
18
  case "string": if (e.endsWith("px")) return parseFloat(e);
19
19
  }
20
20
  }
21
- function le({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
22
- let { styleHeight: s, styleWidth: c } = L(() => ({
23
- styleHeight: q(o?.height),
24
- styleWidth: q(o?.width)
25
- }), [o?.height, o?.width]), [l, u] = z({
21
+ function K({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
22
+ let { styleHeight: s, styleWidth: c } = F(() => ({
23
+ styleHeight: G(o?.height),
24
+ styleWidth: G(o?.width)
25
+ }), [o?.height, o?.width]), [l, u] = L({
26
26
  height: t,
27
27
  width: n
28
28
  }), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
29
- return K(() => {
29
+ return W(() => {
30
30
  if (i === null || d) return;
31
31
  let t = new ResizeObserver((e) => {
32
32
  for (let t of e) {
@@ -46,7 +46,7 @@ function le({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
46
46
  i,
47
47
  s,
48
48
  c
49
- ]), L(() => ({
49
+ ]), F(() => ({
50
50
  height: s ?? l.height,
51
51
  width: c ?? l.width
52
52
  }), [
@@ -55,23 +55,23 @@ function le({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
55
55
  c
56
56
  ]);
57
57
  }
58
- function ue(e) {
59
- let t = R(() => {
58
+ function de(e) {
59
+ let t = I(() => {
60
60
  throw Error("Cannot call during render.");
61
61
  });
62
- return K(() => {
62
+ return W(() => {
63
63
  t.current = e;
64
- }, [e]), N((e) => t.current?.(e), [t]);
64
+ }, [e]), M((e) => t.current?.(e), [t]);
65
65
  }
66
- var de = null;
66
+ var q = null;
67
67
  function fe(e = !1) {
68
- if (de === null || e) {
68
+ if (q === null || e) {
69
69
  let e = document.createElement("div"), t = e.style;
70
70
  t.width = "50px", t.height = "50px", t.overflow = "scroll", t.direction = "rtl";
71
71
  let n = document.createElement("div"), r = n.style;
72
- return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? de = "positive-descending" : (e.scrollLeft = 1, de = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), de;
72
+ return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? q = "positive-descending" : (e.scrollLeft = 1, q = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), q;
73
73
  }
74
- return de;
74
+ return q;
75
75
  }
76
76
  function pe({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
77
77
  if (t === "horizontal" && n) switch (fe()) {
@@ -169,7 +169,7 @@ function ve({ itemCount: e, itemProps: t, itemSize: n }) {
169
169
  };
170
170
  }
171
171
  function ye({ itemCount: e, itemProps: t, itemSize: n }) {
172
- return L(() => ve({
172
+ return F(() => ve({
173
173
  itemCount: e,
174
174
  itemProps: t,
175
175
  itemSize: n
@@ -190,20 +190,20 @@ function be({ containerSize: e, itemSize: t }) {
190
190
  return n;
191
191
  }
192
192
  function xe({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
193
- let { height: u = n, width: d = n } = le({
193
+ let { height: u = n, width: d = n } = K({
194
194
  defaultHeight: r === "vertical" ? n : void 0,
195
195
  defaultWidth: r === "horizontal" ? n : void 0,
196
196
  element: e,
197
197
  mode: r === "vertical" ? "only-height" : "only-width",
198
198
  style: t
199
- }), f = R({
199
+ }), f = I({
200
200
  height: 0,
201
201
  width: 0
202
202
  }), p = r === "vertical" ? u : d, m = be({
203
203
  containerSize: p,
204
204
  itemSize: s
205
205
  });
206
- I(() => {
206
+ P(() => {
207
207
  if (typeof c == "function") {
208
208
  let e = f.current;
209
209
  (e.height !== u || e.width !== d) && (c({
@@ -220,7 +220,7 @@ function xe({ containerElement: e, containerStyle: t, defaultContainerSize: n =
220
220
  itemCount: a,
221
221
  itemProps: o,
222
222
  itemSize: m
223
- }), g = N((e) => h.get(e), [h]), [_, v] = z(() => _e({
223
+ }), g = M((e) => h.get(e), [h]), [_, v] = L(() => _e({
224
224
  cachedBounds: h,
225
225
  containerScrollOffset: 0,
226
226
  containerSize: p,
@@ -231,7 +231,7 @@ function xe({ containerElement: e, containerStyle: t, defaultContainerSize: n =
231
231
  startIndexOverscan: Math.min(a - 1, _.startIndexOverscan),
232
232
  stopIndexVisible: Math.min(a - 1, _.stopIndexVisible),
233
233
  stopIndexOverscan: Math.min(a - 1, _.stopIndexOverscan)
234
- }, C = N(() => he({
234
+ }, C = M(() => he({
235
235
  cachedBounds: h,
236
236
  itemCount: a,
237
237
  itemSize: m
@@ -239,7 +239,7 @@ function xe({ containerElement: e, containerStyle: t, defaultContainerSize: n =
239
239
  h,
240
240
  a,
241
241
  m
242
- ]), w = N((t) => {
242
+ ]), w = M((t) => {
243
243
  let n = pe({
244
244
  containerElement: e,
245
245
  direction: r,
@@ -262,14 +262,14 @@ function xe({ containerElement: e, containerStyle: t, defaultContainerSize: n =
262
262
  a,
263
263
  l
264
264
  ]);
265
- return K(() => {
265
+ return W(() => {
266
266
  let t = (r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0;
267
267
  v(w(t));
268
268
  }, [
269
269
  e,
270
270
  r,
271
271
  w
272
- ]), K(() => {
272
+ ]), W(() => {
273
273
  if (!e) return;
274
274
  let t = () => {
275
275
  v((t) => {
@@ -301,7 +301,7 @@ function xe({ containerElement: e, containerStyle: t, defaultContainerSize: n =
301
301
  ]), {
302
302
  getCellBounds: g,
303
303
  getEstimatedSize: C,
304
- scrollToIndex: ue(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
304
+ scrollToIndex: de(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
305
305
  let s = ge({
306
306
  align: t,
307
307
  cachedBounds: h,
@@ -331,7 +331,7 @@ function xe({ containerElement: e, containerStyle: t, defaultContainerSize: n =
331
331
  };
332
332
  }
333
333
  function Se(e) {
334
- return L(() => e, Object.values(e));
334
+ return F(() => e, Object.values(e));
335
335
  }
336
336
  function Ce(e, t) {
337
337
  let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
@@ -342,18 +342,18 @@ function we(e) {
342
342
  }
343
343
  var Te = "data-react-window-index";
344
344
  function Ee({ children: e, className: t, defaultHeight: n = 0, listRef: r, onResize: i, onRowsRendered: a, overscanCount: o = 3, rowComponent: s, rowCount: c, rowHeight: l, rowProps: u, tagName: d = "div", style: f, ...p }) {
345
- let m = Se(u), h = L(() => M(s, Ce), [s]), [g, _] = z(null), v = we(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = xe({
345
+ let m = Se(u), h = F(() => j(s, Ce), [s]), [g, _] = L(null), v = we(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = xe({
346
346
  containerElement: g,
347
347
  containerStyle: f,
348
348
  defaultContainerSize: n,
349
349
  direction: "vertical",
350
350
  itemCount: c,
351
351
  itemProps: m,
352
- itemSize: L(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
352
+ itemSize: F(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
353
353
  onResize: i,
354
354
  overscanCount: o
355
355
  });
356
- F(r, () => ({
356
+ ne(r, () => ({
357
357
  get element() {
358
358
  return g;
359
359
  },
@@ -368,7 +368,7 @@ function Ee({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
368
368
  top: r
369
369
  });
370
370
  }
371
- }), [g, x]), K(() => {
371
+ }), [g, x]), W(() => {
372
372
  if (!g) return;
373
373
  let e = Array.from(g.children).filter((e, t) => {
374
374
  if (e.hasAttribute("aria-hidden")) return !1;
@@ -382,7 +382,7 @@ function Ee({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
382
382
  l,
383
383
  S,
384
384
  w
385
- ]), P(() => {
385
+ ]), N(() => {
386
386
  S >= 0 && w >= 0 && a && a({
387
387
  startIndex: C,
388
388
  stopIndex: T
@@ -397,11 +397,11 @@ function Ee({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
397
397
  w,
398
398
  T
399
399
  ]);
400
- let E = L(() => {
400
+ let ee = F(() => {
401
401
  let e = [];
402
402
  if (c > 0) for (let t = S; t <= w; t++) {
403
403
  let n = y(t);
404
- e.push(/* @__PURE__ */ j(h, {
404
+ e.push(/* @__PURE__ */ A(h, {
405
405
  ...m,
406
406
  ariaAttributes: {
407
407
  "aria-posinset": t + 1,
@@ -428,7 +428,7 @@ function Ee({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
428
428
  m,
429
429
  S,
430
430
  w
431
- ]), D = /* @__PURE__ */ V("div", {
431
+ ]), E = /* @__PURE__ */ R("div", {
432
432
  "aria-hidden": !0,
433
433
  style: {
434
434
  height: b(),
@@ -436,7 +436,7 @@ function Ee({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
436
436
  zIndex: -1
437
437
  }
438
438
  });
439
- return j(d, {
439
+ return A(d, {
440
440
  role: "list",
441
441
  ...p,
442
442
  className: t,
@@ -448,7 +448,7 @@ function Ee({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
448
448
  overflowY: "auto",
449
449
  ...f
450
450
  }
451
- }, E, e, D);
451
+ }, ee, e, E);
452
452
  }
453
453
  //#endregion
454
454
  //#region src/types/conversation-kind.ts
@@ -465,25 +465,32 @@ var Y = /* @__PURE__ */ function(e) {
465
465
  }, Ae = (e, t) => !t || e.title.toLowerCase().includes(t.toLowerCase()), je = (e) => `${60 + e * 23 % 35}%`, Me = (e, t) => e ? t ? "pe-9" : "pe-2 group-focus-within/conversation:pe-9 group-hover/conversation:pe-9" : "pe-3", Ne = (e, t) => {
466
466
  let n = t.rows[e];
467
467
  return t.rowVariant === X.Indicator ? n.kind === De.Item ? 34 : e === 0 ? 32 : 40 : n.kind === De.Item ? 36 : e === 0 ? 24 : 56;
468
- }, Z = 5, Pe = (e) => Math.max(Z, Math.ceil(Math.ceil(e / 36) / 2)), Fe = (e) => {
468
+ }, Pe = 5, Fe = (e) => Math.max(Pe, Math.ceil(Math.ceil(e / 36) / 2)), Ie = (e, { startIndex: t, stopIndex: n }) => {
469
+ let r = /* @__PURE__ */ new Set();
470
+ for (let i = Math.max(0, t); i <= Math.min(n, e.length - 1); i++) {
471
+ let t = e[i];
472
+ t.kind === De.Item && r.add(t.item.id);
473
+ }
474
+ return [...r];
475
+ }, Le = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]), Z = (e) => {
469
476
  switch (e) {
470
477
  case n.Shared: return n.Shared;
471
478
  case n.Organization: return n.Organization;
472
479
  default: return n.MyChats;
473
480
  }
474
- }, Ie = (e, t) => {
481
+ }, Re = (e, t) => {
475
482
  let n = null;
476
483
  for (let r of e) if (r.kind === De.Header) n = r.groupKey;
477
484
  else if (r.item.id === t) return n;
478
485
  return null;
479
- }, Le = (e, t, r) => {
486
+ }, ze = (e, t, r) => {
480
487
  let i = /* @__PURE__ */ new Set();
481
488
  if (t != null && i.add(t), t === n.Pinned) {
482
489
  let t = r.find((t) => t.id === e);
483
- t && i.add(Fe(t.source));
490
+ t && i.add(Z(t.source));
484
491
  } else i.add(n.Pinned);
485
492
  return i;
486
- }, Re = (e, t, n, r) => {
493
+ }, Be = (e, t, n, r) => {
487
494
  let i = e.currentTarget.getBoundingClientRect();
488
495
  if (e.clientY >= i.top + i.height / 2) return t;
489
496
  let a = null, o = !1;
@@ -506,9 +513,9 @@ var Y = /* @__PURE__ */ function(e) {
506
513
  unreadDot: "_unreadDot_gcqru_51",
507
514
  search: "_search_gcqru_59",
508
515
  list: "_list_gcqru_70"
509
- }, ze = ({ label: e, isExpanded: t, onToggle: n, listId: r, className: i = "dial-tiny-lead-text", variant: o = X.Avatar, dropZoneGroupKey: s, isDragOver: c, onDragOver: l, onDragLeave: u, onDrop: d }) => {
516
+ }, Ve = ({ label: e, isExpanded: t, onToggle: n, listId: r, className: i = "dial-tiny-lead-text", variant: o = X.Avatar, dropZoneGroupKey: s, isDragOver: c, onDragOver: l, onDragLeave: u, onDrop: d }) => {
510
517
  let f = s != null, p = o === X.Indicator;
511
- return /* @__PURE__ */ H("button", {
518
+ return /* @__PURE__ */ z("button", {
512
519
  type: "button",
513
520
  "aria-expanded": t,
514
521
  "aria-controls": r,
@@ -524,25 +531,25 @@ var Y = /* @__PURE__ */ function(e) {
524
531
  } : void 0,
525
532
  className: a("group flex h-6 w-full items-center gap-1 rounded text-start", p ? "px-2" : "py-1 pe-3", i, Q.groupHeader, c && Q.dropZoneActive),
526
533
  children: [
527
- !p && (t ? /* @__PURE__ */ V(te, {
534
+ !p && (t ? /* @__PURE__ */ R(B, {
528
535
  size: 12,
529
536
  className: "shrink-0 opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-visible:opacity-100",
530
537
  "aria-hidden": !0
531
- }) : /* @__PURE__ */ V(ne, {
538
+ }) : /* @__PURE__ */ R(ie, {
532
539
  size: 12,
533
540
  className: "shrink-0 opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-visible:opacity-100 rtl:scale-x-[-1]",
534
541
  "aria-hidden": !0
535
542
  })),
536
- p ? /* @__PURE__ */ V("span", {
543
+ p ? /* @__PURE__ */ R("span", {
537
544
  className: "max-w-full min-w-0",
538
- children: /* @__PURE__ */ V(v, { text: e })
539
- }) : /* @__PURE__ */ V(v, { text: e }),
540
- p && (t ? /* @__PURE__ */ V(U, {
545
+ children: /* @__PURE__ */ R(v, { text: e })
546
+ }) : /* @__PURE__ */ R(v, { text: e }),
547
+ p && (t ? /* @__PURE__ */ R(V, {
541
548
  size: m.SM,
542
549
  stroke: h,
543
550
  className: "shrink-0 opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-visible:opacity-100",
544
551
  "aria-hidden": !0
545
- }) : /* @__PURE__ */ V(W, {
552
+ }) : /* @__PURE__ */ R(H, {
546
553
  size: m.SM,
547
554
  stroke: h,
548
555
  className: "shrink-0 opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-visible:opacity-100 rtl:scale-x-[-1]",
@@ -550,117 +557,117 @@ var Y = /* @__PURE__ */ function(e) {
550
557
  }))
551
558
  ]
552
559
  });
553
- }, Be = M(({ item: e, isActive: n, onSelectConversation: r, searchQuery: i = "", getActions: o, onActionMenuOpen: s, actionsLabel: c = "More actions", itemTitleClassName: l = "dial-small-text", itemIconBadgeClassName: u, unreadIndicatorLabel: d = "Unread", variant: p = X.Avatar, rowGroupKey: v, rows: y, draggingId: S, dragOverId: C, allowedDropGroups: w, onDragStart: T, onDragEnd: E, onDragOver: k, onDragLeave: A, onDrop: j }) => {
554
- let [M, P] = z(!1), ee = R(null), F = N((t) => {
555
- P(t), t && ee.current && s?.(e, ee.current);
556
- }, [e, s]), I = L(() => o?.(e) ?? [], [o, e]), B = I.length > 0, te = L(() => ({ tooltip: e.iconTooltip }), [e.iconTooltip]), ne = L(() => ({ badgeClassName: u }), [u]), U = p === X.Indicator, W = e.leadingIcon ? /* @__PURE__ */ V("span", {
560
+ }, He = j(({ item: e, isActive: n, onSelectConversation: r, searchQuery: i = "", getActions: o, onActionMenuOpen: s, actionsLabel: c = "More actions", itemTitleClassName: l = "dial-small-text", itemIconBadgeClassName: u, unreadIndicatorLabel: d = "Unread", variant: p = X.Avatar, rowGroupKey: v, rows: y, draggingId: S, dragOverId: C, allowedDropGroups: w, onDragStart: T, onDragEnd: ee, onDragOver: O, onDragLeave: k, onDrop: A }) => {
561
+ let [j, N] = L(!1), te = I(null), ne = M((t) => {
562
+ N(t), t && te.current && s?.(e, te.current);
563
+ }, [e, s]), P = F(() => o?.(e) ?? [], [o, e]), re = P.length > 0, B = F(() => ({ tooltip: e.iconTooltip }), [e.iconTooltip]), ie = F(() => ({ badgeClassName: u }), [u]), V = p === X.Indicator, H = e.leadingIcon ? /* @__PURE__ */ R("span", {
557
564
  className: "flex size-6 shrink-0 items-center justify-center",
558
565
  children: e.leadingIcon
559
- }) : e.isIconLoading ? /* @__PURE__ */ V(D, {
560
- variant: O.Circular,
566
+ }) : e.isIconLoading ? /* @__PURE__ */ R(E, {
567
+ variant: D.Circular,
561
568
  width: m.LG,
562
569
  height: m.LG,
563
570
  color: Q.skeletonColor,
564
571
  "aria-hidden": !0
565
- }) : /* @__PURE__ */ V(t, {
572
+ }) : /* @__PURE__ */ R(t, {
566
573
  src: e.iconUrl,
567
574
  size: m.LG,
568
575
  initialsName: e.iconTooltip ?? "",
569
- labels: te,
570
- styles: ne
571
- }), ie = Me(B, M), ae = /* @__PURE__ */ H("span", {
576
+ labels: B,
577
+ styles: ie
578
+ }), oe = Me(re, j), se = /* @__PURE__ */ z("span", {
572
579
  className: "flex size-6 shrink-0 items-center justify-center",
573
- children: [/* @__PURE__ */ V("span", {
580
+ children: [/* @__PURE__ */ R("span", {
574
581
  className: a("size-2 rounded-full", e.isUnread ? a("size-[7.11px]", Q.unreadDot) : Q.indicatorDot),
575
582
  "aria-hidden": !0
576
- }), e.isUnread && /* @__PURE__ */ V("span", {
583
+ }), e.isUnread && /* @__PURE__ */ R("span", {
577
584
  className: "sr-only",
578
585
  children: d
579
586
  })]
580
- }), oe = e.isUnread && !U ? /* @__PURE__ */ H("span", {
587
+ }), ce = e.isUnread && !V ? /* @__PURE__ */ z("span", {
581
588
  className: "flex size-6 shrink-0 items-center justify-center",
582
- children: [/* @__PURE__ */ V("span", {
583
- className: a("size-[7.11px] rounded-full", Q.unreadDot, B && (M ? "opacity-0" : "group-focus-within/conversation:opacity-0 group-hover/conversation:opacity-0")),
589
+ children: [/* @__PURE__ */ R("span", {
590
+ className: a("size-[7.11px] rounded-full", Q.unreadDot, re && (j ? "opacity-0" : "group-focus-within/conversation:opacity-0 group-hover/conversation:opacity-0")),
584
591
  "aria-hidden": !0
585
- }), /* @__PURE__ */ V("span", {
592
+ }), /* @__PURE__ */ R("span", {
586
593
  className: "sr-only",
587
594
  children: d
588
595
  })]
589
- }) : void 0, G = v != null, se = N((e) => {
590
- e.currentTarget.contains(e.relatedTarget) || A?.();
591
- }, [A]), ce = N((t) => {
592
- if (!v || !y || !j) return;
596
+ }) : void 0, U = v != null, le = M((e) => {
597
+ e.currentTarget.contains(e.relatedTarget) || k?.();
598
+ }, [k]), ue = M((t) => {
599
+ if (!v || !y || !A) return;
593
600
  t.preventDefault();
594
- let n = Re(t, e.id, y, v);
595
- j(e.id, v, n);
601
+ let n = Be(t, e.id, y, v);
602
+ A(e.id, v, n);
596
603
  }, [
597
604
  e.id,
598
605
  y,
599
606
  v,
600
- j
601
- ]), K = e.id === S, q = e.id === C, le = v != null && (w?.has(v) ?? !1), ue = S != null;
602
- return /* @__PURE__ */ H("li", {
603
- className: a("group/conversation relative", K && "cursor-grabbing opacity-50", q && le && "rounded", q && le && Q.dropZoneActive, ue && !K && !le && "cursor-not-allowed"),
604
- draggable: G || void 0,
605
- onDragStart: G ? () => T?.(e.id) : void 0,
606
- onDragEnd: G ? E : void 0,
607
- onDragOver: G ? (t) => {
608
- t.preventDefault(), k?.(e.id);
607
+ A
608
+ ]), W = e.id === S, G = e.id === C, K = v != null && (w?.has(v) ?? !1), de = S != null;
609
+ return /* @__PURE__ */ z("li", {
610
+ className: a("group/conversation relative", W && "cursor-grabbing opacity-50", G && K && "rounded", G && K && Q.dropZoneActive, de && !W && !K && "cursor-not-allowed"),
611
+ draggable: U || void 0,
612
+ onDragStart: U ? () => T?.(e.id) : void 0,
613
+ onDragEnd: U ? ee : void 0,
614
+ onDragOver: U ? (t) => {
615
+ t.preventDefault(), O?.(e.id);
609
616
  } : void 0,
610
- onDragLeave: G ? se : void 0,
611
- onDrop: G ? ce : void 0,
612
- children: [/* @__PURE__ */ V("a", {
617
+ onDragLeave: U ? le : void 0,
618
+ onDrop: U ? ue : void 0,
619
+ children: [/* @__PURE__ */ R("a", {
613
620
  href: e.href,
614
621
  className: "contents",
615
622
  onClick: (t) => {
616
623
  e.href && (t.preventDefault(), r(e.id));
617
624
  },
618
- children: /* @__PURE__ */ V(f, {
619
- iconBefore: U ? ae : W,
620
- label: /* @__PURE__ */ V(x, {
625
+ children: /* @__PURE__ */ R(f, {
626
+ iconBefore: V ? se : H,
627
+ label: /* @__PURE__ */ R(x, {
621
628
  text: e.title,
622
629
  query: i,
623
630
  className: e.isUnread ? "dial-small-semi-text" : l,
624
631
  maxLines: 1
625
632
  }),
626
- iconAfter: oe,
633
+ iconAfter: ce,
627
634
  textClassName: "min-w-0 flex-1",
628
635
  "aria-current": n ? "page" : void 0,
629
636
  onClick: e.href ? void 0 : () => r(e.id),
630
637
  tabIndex: e.href ? -1 : void 0,
631
- className: a("h-8 w-full justify-start py-2 after:pointer-events-none", U ? "gap-0.5 ps-0" : "gap-2 ps-3", ie, Q.item, U && Q.itemIndicator, n && Q.itemActive, M && Q.itemActive)
638
+ className: a("h-8 w-full justify-start py-2 after:pointer-events-none", V ? "gap-0.5 ps-0" : "gap-2 ps-3", oe, Q.item, V && Q.itemIndicator, n && Q.itemActive, j && Q.itemActive)
632
639
  })
633
- }), B && /* @__PURE__ */ V("div", {
634
- className: a("absolute inset-y-0 flex items-center", U ? "end-2" : "end-1", M ? "opacity-100" : "opacity-0 group-focus-within/conversation:opacity-100 group-hover/conversation:opacity-100"),
635
- children: /* @__PURE__ */ V(g, {
636
- items: I,
637
- onOpenChange: F,
640
+ }), re && /* @__PURE__ */ R("div", {
641
+ className: a("absolute inset-y-0 flex items-center", V ? "end-2" : "end-1", j ? "opacity-100" : "opacity-0 group-focus-within/conversation:opacity-100 group-hover/conversation:opacity-100"),
642
+ children: /* @__PURE__ */ R(g, {
643
+ items: P,
644
+ onOpenChange: ne,
638
645
  matchReferenceWidth: !1,
639
646
  listClassName: "w-[200px]",
640
- children: /* @__PURE__ */ V(b, {
641
- ref: ee,
642
- icon: /* @__PURE__ */ V(re, {
643
- size: U ? m.SM : m.MD,
647
+ children: /* @__PURE__ */ R(b, {
648
+ ref: te,
649
+ icon: /* @__PURE__ */ R(ae, {
650
+ size: V ? m.SM : m.MD,
644
651
  className: Q.triggerIcon,
645
652
  "aria-hidden": !0,
646
653
  stroke: h
647
654
  }),
648
655
  size: _.Small,
649
656
  "aria-label": c,
650
- className: a(U && "!size-6 !min-h-0 !min-w-0 !p-1", M && Q.triggerActive)
657
+ className: a(V && "!size-6 !min-h-0 !min-w-0 !p-1", j && Q.triggerActive)
651
658
  })
652
659
  })
653
660
  })]
654
661
  });
655
- }), Ve = (e, t) => t ? e === 0 ? "pt-2" : "pt-4" : e === 0 ? "pt-0" : "pt-8", He = ({ index: e, style: t, rows: r, expandedGroups: i, onToggleGroup: a, listId: o, activeConversationId: s, searchQuery: c, onSelectConversation: l, getActions: u, onActionMenuOpen: d, actionsLabel: f, unreadIndicatorLabel: p, styles: m, rowVariant: h = X.Avatar, draggingId: g, dragOverId: _, allowedDropGroups: v, onDragStart: y, onDragEnd: b, onDragOver: x, onDragLeave: S, onDrop: C }) => {
662
+ }), Ue = (e, t) => t ? e === 0 ? "pt-2" : "pt-4" : e === 0 ? "pt-0" : "pt-8", We = ({ index: e, style: t, rows: r, expandedGroups: i, onToggleGroup: a, listId: o, activeConversationId: s, searchQuery: c, onSelectConversation: l, getActions: u, onActionMenuOpen: d, actionsLabel: f, unreadIndicatorLabel: p, styles: m, rowVariant: h = X.Avatar, draggingId: g, dragOverId: _, allowedDropGroups: v, onDragStart: y, onDragEnd: b, onDragOver: x, onDragLeave: S, onDrop: C }) => {
656
663
  let w = r[e], T = h === X.Indicator;
657
664
  if (w.kind === De.Header) {
658
665
  let r = w.groupKey === n.Pinned;
659
- return /* @__PURE__ */ V("div", {
666
+ return /* @__PURE__ */ R("div", {
660
667
  role: "listitem",
661
668
  style: t,
662
- className: Ve(e, T),
663
- children: /* @__PURE__ */ V(ze, {
669
+ className: Ue(e, T),
670
+ children: /* @__PURE__ */ R(Ve, {
664
671
  variant: h,
665
672
  label: w.label,
666
673
  isExpanded: i.has(w.groupKey),
@@ -675,11 +682,11 @@ var Y = /* @__PURE__ */ function(e) {
675
682
  })
676
683
  });
677
684
  }
678
- return /* @__PURE__ */ V("div", {
685
+ return /* @__PURE__ */ R("div", {
679
686
  role: "presentation",
680
687
  style: t,
681
688
  className: T ? "pt-0.5" : "pt-1",
682
- children: /* @__PURE__ */ V(Be, {
689
+ children: /* @__PURE__ */ R(He, {
683
690
  variant: h,
684
691
  item: w.item,
685
692
  isActive: w.item.id === s,
@@ -703,58 +710,58 @@ var Y = /* @__PURE__ */ function(e) {
703
710
  onDrop: C
704
711
  })
705
712
  });
706
- }, Ue = /* @__PURE__ */ new Set([
713
+ }, Ge = /* @__PURE__ */ new Set([
707
714
  n.Pinned,
708
715
  n.MyChats,
709
716
  n.Shared,
710
717
  n.Organization
711
- ]), $ = M(({ conversations: e, isLoading: t, isUpdatingTitles: i = !1, preserveActiveSearchResult: o = !1, onSelectConversation: s, activeConversationId: u, labels: d, searchQuery: f = "", activeFilter: p = n.All, activeTypeFilter: m = Y.All, hiddenSources: h, rowVariant: g, getActions: _, onActionMenuOpen: v, onMoveConversation: y, styles: b, id: x, className: S }) => {
712
- let { colors: C, typography: w, itemIconBadgeClassName: T } = b ?? {}, { emptyLabel: E, emptyDescription: O, noResultsLabel: k, noResultsDescription: A, sharedEmptyDescription: j = A, tabEmptyLabels: M, loadingLabel: F = "Loading conversations", updatingTitlesLabel: I = "Updating conversation names", groupLabels: B, actionsLabel: te, unreadIndicatorLabel: ne } = d, U = L(() => h?.length ? e.filter((e) => e.source == null || !h.includes(e.source)) : e, [e, h]), [W, re] = z(() => Ue), [ie, ae] = z(5), oe = ee(), G = R(null), se = R(null), [K, q] = z(null), [le, ue] = z(null), [de, fe] = z(null), pe = R(null), J = R(null), me = N(({ height: e }) => {
713
- ae(Pe(e));
714
- }, []), he = N((e) => {
715
- re((t) => {
718
+ ]), Ke = j(({ conversations: e, isLoading: t, isUpdatingTitles: i = !1, preserveActiveSearchResult: o = !1, onSelectConversation: s, activeConversationId: u, labels: d, searchQuery: f = "", activeFilter: p = n.All, activeTypeFilter: m = Y.All, hiddenSources: h, rowVariant: g, getActions: _, onActionMenuOpen: v, onMoveConversation: y, onVisibleConversationIdsChange: b, styles: x, id: S, className: C }) => {
719
+ let { colors: w, typography: T, itemIconBadgeClassName: ee } = x ?? {}, { emptyLabel: D, emptyDescription: O, noResultsLabel: k, noResultsDescription: A, sharedEmptyDescription: j = A, tabEmptyLabels: ne, loadingLabel: P = "Loading conversations", updatingTitlesLabel: re = "Updating conversation names", groupLabels: B, actionsLabel: ie, unreadIndicatorLabel: V } = d, H = F(() => h?.length ? e.filter((e) => e.source == null || !h.includes(e.source)) : e, [e, h]), [ae, oe] = L(() => Ge), [se, ce] = L(5), U = te(), le = I(null), W = I(null), [G, K] = L(null), [de, q] = L(null), [fe, pe] = L(null), J = I(null), me = I(null), he = M(({ height: e }) => {
720
+ ce(Fe(e));
721
+ }, []), ge = M((e) => {
722
+ oe((t) => {
716
723
  let n = new Set(t);
717
724
  return n.has(e) ? n.delete(e) : n.add(e), n;
718
725
  });
719
- }, []), ge = N(() => {
720
- pe.current = null, J.current = null, q(null), ue(null), fe(null);
721
- }, []), _e = N((e, t) => {
722
- let n = Le(e, Ie(t, e), U);
723
- pe.current = e, J.current = n, q(e), fe(n);
724
- }, [U]), ve = N(() => {
725
- ge();
726
- }, [ge]), ye = N((e) => {
727
- ue(e);
728
- }, []), be = N(() => {
729
- ue(null);
730
- }, []), xe = N((e, t, n) => {
731
- let r = pe.current, i = J.current;
732
- ge(), r != null && r !== e && i?.has(t) && y?.({
726
+ }, []), _e = M(() => {
727
+ J.current = null, me.current = null, K(null), q(null), pe(null);
728
+ }, []), ve = M((e, t) => {
729
+ let n = ze(e, Re(t, e), H);
730
+ J.current = e, me.current = n, K(e), pe(n);
731
+ }, [H]), ye = M(() => {
732
+ _e();
733
+ }, [_e]), be = M((e) => {
734
+ q(e);
735
+ }, []), xe = M(() => {
736
+ q(null);
737
+ }, []), Se = M((e, t, n) => {
738
+ let r = J.current, i = me.current;
739
+ _e(), r != null && r !== e && i?.has(t) && y?.({
733
740
  draggedId: r,
734
741
  targetGroupKey: t,
735
742
  afterId: n
736
743
  });
737
- }, [ge, y]), Se = r({
738
- "--cp-item-hover": C?.itemHover,
739
- "--cp-item-active": C?.itemActive,
740
- "--cp-text": C?.text,
741
- "--cp-text-secondary": C?.textSecondary,
742
- "--cp-drop-zone-ring": C?.dropZoneRing,
743
- "--cp-trigger-bg": C?.triggerBackground,
744
- "--cp-trigger-icon": C?.triggerIcon,
745
- "--cp-trigger-icon-idle": C?.triggerIconIdle,
746
- "--cp-skeleton-color": C?.skeletonColor,
747
- "--cp-unread-dot": C?.unreadDot,
748
- "--cp-indicator-dot": C?.indicatorDot,
749
- "--cp-list-font-family": w?.fontFamily
750
- }), [Ce, we] = z(null);
751
- P(() => {
744
+ }, [_e, y]), Ce = r({
745
+ "--cp-item-hover": w?.itemHover,
746
+ "--cp-item-active": w?.itemActive,
747
+ "--cp-text": w?.text,
748
+ "--cp-text-secondary": w?.textSecondary,
749
+ "--cp-drop-zone-ring": w?.dropZoneRing,
750
+ "--cp-trigger-bg": w?.triggerBackground,
751
+ "--cp-trigger-icon": w?.triggerIcon,
752
+ "--cp-trigger-icon-idle": w?.triggerIconIdle,
753
+ "--cp-skeleton-color": w?.skeletonColor,
754
+ "--cp-unread-dot": w?.unreadDot,
755
+ "--cp-indicator-dot": w?.indicatorDot,
756
+ "--cp-list-font-family": T?.fontFamily
757
+ }), [we, Te] = L(null);
758
+ N(() => {
752
759
  if (!o || !f || !u) {
753
- we(null);
760
+ Te(null);
754
761
  return;
755
762
  }
756
- let e = U.find((e) => e.id === u);
757
- we((t) => e && Ae(e, f) ? t?.id === e.id && t.query === f ? t : {
763
+ let e = H.find((e) => e.id === u);
764
+ Te((t) => e && Ae(e, f) ? t?.id === e.id && t.query === f ? t : {
758
765
  id: e.id,
759
766
  query: f
760
767
  } : t?.id === u && t.query === f ? t : null);
@@ -762,10 +769,10 @@ var Y = /* @__PURE__ */ function(e) {
762
769
  o,
763
770
  f,
764
771
  u,
765
- U
772
+ H
766
773
  ]);
767
- let Te = N((e) => {
768
- o && f && we({
774
+ let Me = M((e) => {
775
+ o && f && Te({
769
776
  id: e,
770
777
  query: f
771
778
  }), s(e);
@@ -773,162 +780,177 @@ var Y = /* @__PURE__ */ function(e) {
773
780
  o,
774
781
  f,
775
782
  s
776
- ]), Me = o && f !== "" && Ce?.query === f && Ce.id === u ? Ce.id : void 0, Z = L(() => U.filter((e) => Oe(e, p) && ke(e, m) && (Ae(e, f) || e.id === Me)), [
777
- U,
783
+ ]), Pe = o && f !== "" && we?.query === f && we.id === u ? we.id : void 0, Z = F(() => H.filter((e) => Oe(e, p) && ke(e, m) && (Ae(e, f) || e.id === Pe)), [
784
+ H,
778
785
  p,
779
786
  m,
780
787
  f,
781
- Me
782
- ]), Fe = L(() => Z.filter((e) => e.isPinned), [Z]), Re = L(() => Z.filter((e) => !e.isPinned && e.source !== n.Shared && e.source !== n.Organization), [Z]), ze = L(() => Z.filter((e) => !e.isPinned && e.source === n.Shared), [Z]), Be = L(() => Z.filter((e) => !e.isPinned && e.source === n.Organization), [Z]), Ve = L(() => [
788
+ Pe
789
+ ]), Be = F(() => Z.filter((e) => e.isPinned), [Z]), Ve = F(() => Z.filter((e) => !e.isPinned && e.source !== n.Shared && e.source !== n.Organization), [Z]), He = F(() => Z.filter((e) => !e.isPinned && e.source === n.Shared), [Z]), Ue = F(() => Z.filter((e) => !e.isPinned && e.source === n.Organization), [Z]), Ke = F(() => [
783
790
  {
784
791
  key: n.Pinned,
785
792
  label: B?.pinned ?? "Pinned",
786
- items: Fe
793
+ items: Be
787
794
  },
788
795
  {
789
796
  key: n.MyChats,
790
797
  label: B?.myChats ?? "My chats",
791
- items: Re
798
+ items: Ve
792
799
  },
793
800
  {
794
801
  key: n.Shared,
795
802
  label: B?.shared ?? "Shared",
796
- items: ze
803
+ items: He
797
804
  },
798
805
  {
799
806
  key: n.Organization,
800
807
  label: B?.organization ?? "Organization",
801
- items: Be
808
+ items: Ue
802
809
  }
803
810
  ], [
804
811
  B,
805
- Fe,
806
- Re,
807
- ze,
808
- Be
809
- ]), $ = L(() => {
812
+ Be,
813
+ Ve,
814
+ He,
815
+ Ue
816
+ ]), $ = F(() => {
810
817
  let e = [];
811
- for (let t of Ve) if (t.items.length !== 0 && (e.push({
818
+ for (let t of Ke) if (t.items.length !== 0 && (e.push({
812
819
  kind: De.Header,
813
820
  groupKey: t.key,
814
821
  label: t.label
815
- }), W.has(t.key))) for (let n of t.items) e.push({
822
+ }), ae.has(t.key))) for (let n of t.items) e.push({
816
823
  kind: De.Item,
817
824
  item: n,
818
825
  groupKey: t.key
819
826
  });
820
827
  return e;
821
- }, [Ve, W]);
822
- P(() => {
823
- if (!u || se.current === u) return;
828
+ }, [Ke, ae]);
829
+ N(() => {
830
+ if (!u || W.current === u) return;
824
831
  let e = $.findIndex((e) => e.kind === De.Item && e.item.id === u);
825
- e >= 0 && (G.current?.scrollToRow({
832
+ e >= 0 && (le.current?.scrollToRow({
826
833
  index: e,
827
834
  align: "smart",
828
835
  behavior: "smooth"
829
- }), se.current = u);
836
+ }), W.current = u);
830
837
  }, [
831
838
  u,
832
- Ve,
833
- W,
839
+ Ke,
840
+ ae,
834
841
  $
835
842
  ]);
836
- let We = R($);
837
- P(() => {
838
- We.current = $;
843
+ let qe = I($);
844
+ N(() => {
845
+ qe.current = $;
839
846
  }, [$]);
840
- let Ge = N((e) => _e(e, We.current), [_e]), Ke = L(() => ({
847
+ let Je = M((e) => ve(e, qe.current), [ve]), Ye = F(() => ({
841
848
  rows: $,
842
- expandedGroups: W,
843
- onToggleGroup: he,
844
- listId: oe,
849
+ expandedGroups: ae,
850
+ onToggleGroup: ge,
851
+ listId: U,
845
852
  activeConversationId: u,
846
853
  searchQuery: f,
847
- onSelectConversation: Te,
854
+ onSelectConversation: Me,
848
855
  getActions: _,
849
856
  onActionMenuOpen: v,
850
- actionsLabel: te,
851
- unreadIndicatorLabel: ne,
857
+ actionsLabel: ie,
858
+ unreadIndicatorLabel: V,
852
859
  rowVariant: g,
853
860
  styles: {
854
- groupHeaderClassName: w?.groupHeaderClassName,
855
- itemTitleClassName: w?.itemTitleClassName,
856
- itemIconBadgeClassName: T
861
+ groupHeaderClassName: T?.groupHeaderClassName,
862
+ itemTitleClassName: T?.itemTitleClassName,
863
+ itemIconBadgeClassName: ee
857
864
  },
858
- draggingId: K,
859
- dragOverId: le,
860
- allowedDropGroups: de,
861
- onDragStart: Ge,
862
- onDragEnd: ve,
863
- onDragOver: ye,
864
- onDragLeave: be,
865
- onDrop: xe
865
+ draggingId: G,
866
+ dragOverId: de,
867
+ allowedDropGroups: fe,
868
+ onDragStart: Je,
869
+ onDragEnd: ye,
870
+ onDragOver: be,
871
+ onDragLeave: xe,
872
+ onDrop: Se
866
873
  }), [
867
874
  $,
868
- W,
869
- he,
870
- oe,
875
+ ae,
876
+ ge,
877
+ U,
871
878
  u,
872
879
  f,
873
- Te,
880
+ Me,
874
881
  _,
875
882
  v,
876
- te,
877
- ne,
883
+ ie,
884
+ V,
878
885
  g,
879
- w?.groupHeaderClassName,
880
- w?.itemTitleClassName,
881
- T,
882
- K,
883
- le,
886
+ T?.groupHeaderClassName,
887
+ T?.itemTitleClassName,
888
+ ee,
889
+ G,
884
890
  de,
885
- Ge,
886
- ve,
891
+ fe,
892
+ Je,
887
893
  ye,
888
894
  be,
889
- xe
890
- ]), qe = f !== "" || p !== n.All || m !== Y.All, Je = Z.length === 0, Ye = Je && qe, Xe = Je && !qe, Ze = Ye && f === "" && m === Y.All ? M?.[p] : void 0, Qe = Ze?.label ?? k, $e = p === n.Shared && f === "" ? j : A, et = Ze?.description ?? $e;
891
- return /* @__PURE__ */ H("div", {
892
- id: x,
893
- style: Se,
894
- className: a("flex-1 overflow-hidden px-3", Q.list, w?.fontClassName, g !== X.Indicator && "py-1", S, ce.list),
895
- children: [/* @__PURE__ */ V("span", {
895
+ xe,
896
+ Se
897
+ ]), Xe = f !== "" || p !== n.All || m !== Y.All, Ze = Z.length === 0, Qe = Ze && Xe, $e = Ze && !Xe, et = Qe && f === "" && m === Y.All ? ne?.[p] : void 0, tt = et?.label ?? k, nt = p === n.Shared && f === "" ? j : A, rt = et?.description ?? nt, it = !t && !Ze, at = I(null), ot = I(null), st = I(b);
898
+ N(() => {
899
+ st.current = b;
900
+ }, [b]);
901
+ let ct = M((e) => {
902
+ ot.current && Le(ot.current, e) || (ot.current = e, st.current?.(e));
903
+ }, []), lt = M((e) => {
904
+ at.current = e, ct(Ie($, e));
905
+ }, [$, ct]);
906
+ return N(() => {
907
+ it ? at.current && ct(Ie($, at.current)) : (at.current = null, ct([]));
908
+ }, [
909
+ it,
910
+ $,
911
+ ct
912
+ ]), /* @__PURE__ */ z("div", {
913
+ id: S,
914
+ style: Ce,
915
+ className: a("flex-1 overflow-hidden px-3", Q.list, T?.fontClassName, g !== X.Indicator && "py-1", C, ue.list),
916
+ children: [/* @__PURE__ */ R("span", {
896
917
  role: "status",
897
918
  "aria-live": "polite",
898
919
  className: "sr-only",
899
- children: t ? F : i ? I : Xe ? E : Ye ? Qe : ""
900
- }), t ? /* @__PURE__ */ V("div", {
920
+ children: t ? P : i ? re : $e ? D : Qe ? tt : ""
921
+ }), t ? /* @__PURE__ */ R("div", {
901
922
  className: "flex flex-col gap-3 px-2 py-3",
902
- children: Array.from({ length: 15 }, (e, t) => /* @__PURE__ */ V(D, {
923
+ children: Array.from({ length: 15 }, (e, t) => /* @__PURE__ */ R(E, {
903
924
  avatar: { size: 24 },
904
925
  showTitle: { width: je(t) },
905
926
  paragraph: !1,
906
927
  active: !0,
907
928
  color: Q.skeletonColor
908
929
  }, t))
909
- }) : Xe ? /* @__PURE__ */ V(c, {
910
- label: E,
930
+ }) : $e ? /* @__PURE__ */ R(c, {
931
+ label: D,
911
932
  description: O
912
- }) : Ye && f !== "" && i ? /* @__PURE__ */ V(c, { label: I }) : Ye ? /* @__PURE__ */ V(l, {
913
- label: Qe,
914
- description: et
915
- }) : /* @__PURE__ */ V(Ee, {
916
- listRef: G,
917
- id: oe,
933
+ }) : Qe && f !== "" && i ? /* @__PURE__ */ R(c, { label: re }) : Qe ? /* @__PURE__ */ R(l, {
934
+ label: tt,
935
+ description: rt
936
+ }) : /* @__PURE__ */ R(Ee, {
937
+ listRef: le,
938
+ id: U,
918
939
  role: "list",
919
940
  style: { height: "100%" },
920
- rowComponent: He,
941
+ rowComponent: We,
921
942
  rowCount: $.length,
922
943
  rowHeight: Ne,
923
- overscanCount: ie,
924
- onResize: me,
925
- rowProps: Ke
944
+ overscanCount: se,
945
+ onResize: he,
946
+ onRowsRendered: lt,
947
+ rowProps: Ye
926
948
  })]
927
949
  });
928
- }), We = {
950
+ }), $ = {
929
951
  title: "_title_r35fs_2",
930
952
  filterIndicator: "_filterIndicator_r35fs_13"
931
- }, Ge = "!size-6 !min-h-0 !min-w-0 !p-1", Ke = [
953
+ }, qe = "!size-6 !min-h-0 !min-w-0 !p-1", Je = [
932
954
  {
933
955
  value: n.All,
934
956
  getLabel: (e) => e.all
@@ -945,7 +967,7 @@ var Y = /* @__PURE__ */ function(e) {
945
967
  value: n.Organization,
946
968
  getLabel: (e) => e.organization
947
969
  }
948
- ], qe = [
970
+ ], Ye = [
949
971
  {
950
972
  value: Y.All,
951
973
  getLabel: (e) => e.all
@@ -958,35 +980,35 @@ var Y = /* @__PURE__ */ function(e) {
958
980
  value: Y.Task,
959
981
  getLabel: (e) => e.task ?? "Task"
960
982
  }
961
- ], Je = M(({ labels: e, isExpanded: t = !0, onToggleExpanded: i, controlsId: o, searchQuery: s = "", isSearchOpen: c = !1, onSearchChange: l, onSearchOpenChange: u, activeFilter: d = n.All, onFilterChange: f, activeTypeFilter: p = Y.All, onTypeFilterChange: v, hiddenSources: y, actions: x, styles: S, className: w }) => {
962
- let T = S?.typography?.titleClassName ?? "dial-tiny-lead-semi-text", D = S?.typography?.searchTextClassName ?? "dial-tiny-text", O = R(null), k = R(null), A = R(c), j = e.filterLabels.groupAriaLabel ?? "Filter chats", M = e.filterActiveLabel ?? "Filters applied", F = ee(), I = d !== n.All || p !== Y.All, z = l != null && u != null;
963
- P(() => {
964
- c ? k.current?.focus() : A.current && O.current?.focus(), A.current = c;
983
+ ], Xe = j(({ labels: e, isExpanded: t = !0, onToggleExpanded: i, controlsId: o, searchQuery: s = "", isSearchOpen: c = !1, onSearchChange: l, onSearchOpenChange: u, activeFilter: d = n.All, onFilterChange: f, activeTypeFilter: p = Y.All, onTypeFilterChange: v, hiddenSources: y, actions: x, styles: S, className: w }) => {
984
+ let T = S?.typography?.titleClassName ?? "dial-tiny-lead-semi-text", E = S?.typography?.searchTextClassName ?? "dial-tiny-text", D = I(null), O = I(null), k = I(c), A = e.filterLabels.groupAriaLabel ?? "Filter chats", j = e.filterActiveLabel ?? "Filters applied", ne = te(), P = d !== n.All || p !== Y.All, L = l != null && u != null;
985
+ N(() => {
986
+ c ? O.current?.focus() : k.current && D.current?.focus(), k.current = c;
965
987
  }, [c]);
966
- let te = N(() => {
988
+ let B = M(() => {
967
989
  u?.(!0);
968
- }, [u]), ne = N(() => {
990
+ }, [u]), ie = M(() => {
969
991
  l?.(""), u?.(!1);
970
- }, [l, u]), re = N((e) => {
992
+ }, [l, u]), ae = M((e) => {
971
993
  l?.(e ?? "");
972
- }, [l]), ae = N((e) => {
973
- e.key === "Escape" && (e.stopPropagation(), ne());
974
- }, [ne]), G = L(() => {
975
- let { filterLabels: t } = e, n = (e, t) => () => /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("span", {
994
+ }, [l]), se = M((e) => {
995
+ e.key === "Escape" && (e.stopPropagation(), ie());
996
+ }, [ie]), U = F(() => {
997
+ let { filterLabels: t } = e, n = (e, t) => () => /* @__PURE__ */ z(re, { children: [/* @__PURE__ */ R("span", {
976
998
  className: "min-w-0 flex-1 truncate text-start",
977
999
  children: e
978
- }), /* @__PURE__ */ V("span", {
1000
+ }), /* @__PURE__ */ R("span", {
979
1001
  className: "shrink-0 text-secondary",
980
1002
  children: t
981
1003
  })] }), r = [];
982
1004
  if (v) {
983
- let e = qe.map(({ value: e, getLabel: n }) => ({
1005
+ let e = Ye.map(({ value: e, getLabel: n }) => ({
984
1006
  key: e,
985
1007
  label: n(t),
986
1008
  mark: C.Check,
987
1009
  checked: e === p,
988
1010
  onClick: () => v(e)
989
- })), i = qe.find(({ value: e }) => e === p);
1011
+ })), i = Ye.find(({ value: e }) => e === p);
990
1012
  r.push({
991
1013
  key: "filter-type",
992
1014
  label: t.type ?? "Type",
@@ -995,7 +1017,7 @@ var Y = /* @__PURE__ */ function(e) {
995
1017
  });
996
1018
  }
997
1019
  if (f) {
998
- let e = Ke.filter(({ value: e }) => !y?.includes(e)), i = e.find(({ value: e }) => e === d);
1020
+ let e = Je.filter(({ value: e }) => !y?.includes(e)), i = e.find(({ value: e }) => e === d);
999
1021
  r.push({
1000
1022
  key: "filter-origin",
1001
1023
  label: t.origin ?? "Origin",
@@ -1017,7 +1039,7 @@ var Y = /* @__PURE__ */ function(e) {
1017
1039
  p,
1018
1040
  f,
1019
1041
  v
1020
- ]), K = L(() => r({
1042
+ ]), W = F(() => r({
1021
1043
  "--cp-list-header-title": S?.colors?.title,
1022
1044
  "--cp-list-header-title-focus": S?.colors?.titleFocus,
1023
1045
  "--cp-list-header-filter-indicator": S?.colors?.filterIndicator
@@ -1025,148 +1047,148 @@ var Y = /* @__PURE__ */ function(e) {
1025
1047
  S?.colors?.title,
1026
1048
  S?.colors?.titleFocus,
1027
1049
  S?.colors?.filterIndicator
1028
- ]), q = (e) => a("flex min-h-6 items-center justify-between ps-2", e, w, ce.listHeader);
1029
- if (z && c) return /* @__PURE__ */ H("div", {
1050
+ ]), G = (e) => a("flex min-h-6 items-center justify-between ps-2", e, w, ue.listHeader);
1051
+ if (L && c) return /* @__PURE__ */ z("div", {
1030
1052
  role: "search",
1031
- style: K,
1032
- className: q("gap-2"),
1033
- onKeyDown: ae,
1034
- children: [/* @__PURE__ */ V(E, {
1053
+ style: W,
1054
+ className: G("gap-2"),
1055
+ onKeyDown: se,
1056
+ children: [/* @__PURE__ */ R(ee, {
1035
1057
  containerClassName: "min-w-0 flex-1",
1036
- wrapperClassName: a("!h-6 !min-h-0 !py-1 !pe-2 [&_svg]:!size-4", D),
1037
- inputRef: k,
1058
+ wrapperClassName: a("!h-6 !min-h-0 !py-1 !pe-2 [&_svg]:!size-4", E),
1059
+ inputRef: O,
1038
1060
  value: s,
1039
- onChange: re,
1061
+ onChange: ae,
1040
1062
  placeholder: e.searchPlaceholder,
1041
1063
  clearLabel: e.searchClearLabel,
1042
1064
  "aria-label": e.searchPlaceholder
1043
- }), /* @__PURE__ */ V(b, {
1044
- icon: /* @__PURE__ */ V(se, {
1065
+ }), /* @__PURE__ */ R(b, {
1066
+ icon: /* @__PURE__ */ R(le, {
1045
1067
  size: m.SM,
1046
1068
  stroke: h,
1047
1069
  "aria-hidden": !0
1048
1070
  }),
1049
1071
  size: _.Small,
1050
- className: Ge,
1072
+ className: qe,
1051
1073
  "aria-label": e.searchCloseLabel,
1052
- onClick: ne
1074
+ onClick: ie
1053
1075
  })]
1054
1076
  });
1055
- let le = /* @__PURE__ */ V("span", {
1077
+ let K = /* @__PURE__ */ R("span", {
1056
1078
  className: T,
1057
1079
  children: e.title
1058
1080
  });
1059
- return /* @__PURE__ */ H("div", {
1060
- style: K,
1061
- className: q(),
1062
- children: [i ? /* @__PURE__ */ H("button", {
1081
+ return /* @__PURE__ */ z("div", {
1082
+ style: W,
1083
+ className: G(),
1084
+ children: [i ? /* @__PURE__ */ z("button", {
1063
1085
  type: "button",
1064
1086
  "aria-expanded": t,
1065
1087
  "aria-controls": o,
1066
1088
  onClick: i,
1067
- className: a("group flex items-center gap-1 rounded", We.title),
1068
- children: [le, t ? /* @__PURE__ */ V(U, {
1089
+ className: a("group flex items-center gap-1 rounded", $.title),
1090
+ children: [K, t ? /* @__PURE__ */ R(V, {
1069
1091
  size: m.SM,
1070
1092
  stroke: h,
1071
1093
  className: "opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100",
1072
1094
  "aria-hidden": !0
1073
- }) : /* @__PURE__ */ V(W, {
1095
+ }) : /* @__PURE__ */ R(H, {
1074
1096
  size: m.SM,
1075
1097
  stroke: h,
1076
1098
  className: "opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100 rtl:scale-x-[-1]",
1077
1099
  "aria-hidden": !0
1078
1100
  })]
1079
- }) : /* @__PURE__ */ V("span", {
1080
- className: We.title,
1081
- children: le
1082
- }), /* @__PURE__ */ H("div", {
1101
+ }) : /* @__PURE__ */ R("span", {
1102
+ className: $.title,
1103
+ children: K
1104
+ }), /* @__PURE__ */ z("div", {
1083
1105
  className: "flex items-center gap-2",
1084
1106
  children: [
1085
- z && /* @__PURE__ */ V(b, {
1086
- ref: O,
1087
- icon: /* @__PURE__ */ V(oe, {
1107
+ L && /* @__PURE__ */ R(b, {
1108
+ ref: D,
1109
+ icon: /* @__PURE__ */ R(ce, {
1088
1110
  size: m.SM,
1089
1111
  stroke: h,
1090
1112
  "aria-hidden": !0
1091
1113
  }),
1092
1114
  size: _.Small,
1093
- className: Ge,
1115
+ className: qe,
1094
1116
  "aria-label": e.searchOpenLabel,
1095
- onClick: te
1117
+ onClick: B
1096
1118
  }),
1097
- (f || v) && /* @__PURE__ */ V(g, {
1098
- items: G,
1119
+ (f || v) && /* @__PURE__ */ R(g, {
1120
+ items: U,
1099
1121
  placement: "bottom-end",
1100
1122
  matchReferenceWidth: !1,
1101
- children: /* @__PURE__ */ V(b, {
1102
- icon: /* @__PURE__ */ H("span", {
1123
+ children: /* @__PURE__ */ R(b, {
1124
+ icon: /* @__PURE__ */ z("span", {
1103
1125
  className: "relative inline-flex",
1104
- children: [/* @__PURE__ */ V(ie, {
1126
+ children: [/* @__PURE__ */ R(oe, {
1105
1127
  size: m.SM,
1106
1128
  stroke: h,
1107
1129
  "aria-hidden": !0
1108
- }), I && /* @__PURE__ */ V("span", {
1130
+ }), P && /* @__PURE__ */ R("span", {
1109
1131
  "aria-hidden": !0,
1110
- className: a(We.filterIndicator, "absolute -end-0.5 -top-0.5 size-1.5 rounded-full")
1132
+ className: a($.filterIndicator, "absolute -end-0.5 -top-0.5 size-1.5 rounded-full")
1111
1133
  })]
1112
1134
  }),
1113
1135
  size: _.Small,
1114
- className: Ge,
1115
- "aria-label": j,
1116
- "aria-describedby": I ? F : void 0
1136
+ className: qe,
1137
+ "aria-label": A,
1138
+ "aria-describedby": P ? ne : void 0
1117
1139
  })
1118
1140
  }),
1119
- I && (f || v) && /* @__PURE__ */ V("span", {
1120
- id: F,
1141
+ P && (f || v) && /* @__PURE__ */ R("span", {
1142
+ id: ne,
1121
1143
  className: "sr-only",
1122
- children: M
1144
+ children: j
1123
1145
  }),
1124
1146
  x
1125
1147
  ]
1126
1148
  })]
1127
1149
  });
1128
- }), Ye = M(({ conversations: e, isLoading: t, isUpdatingTitles: r, preserveActiveSearchResult: i, onSelectConversation: o, activeConversationId: s, labels: c, requestedFilter: l, isFilterHidden: u = !1, onFilterChange: d, isTypeFilterHidden: f = !1, onTypeFilterChange: p, hiddenSources: m, headerActions: h, getActions: g, onActionMenuOpen: _, onMoveConversation: v, styles: y, listClassName: b, className: x }) => {
1129
- let S = ee(), [C, w] = z(""), [T, E] = z(!1), [D, O] = z(!0), [k, A] = z(n.All), [j, M] = z(Y.All);
1130
- P(() => {
1150
+ }), Ze = j(({ conversations: e, isLoading: t, isUpdatingTitles: r, preserveActiveSearchResult: i, onSelectConversation: o, activeConversationId: s, labels: c, requestedFilter: l, isFilterHidden: u = !1, onFilterChange: d, isTypeFilterHidden: f = !1, onTypeFilterChange: p, hiddenSources: m, headerActions: h, getActions: g, onActionMenuOpen: _, onMoveConversation: v, onVisibleConversationIdsChange: y, styles: b, listClassName: x, className: S }) => {
1151
+ let C = te(), [w, T] = L(""), [ee, E] = L(!1), [D, O] = L(!0), [k, A] = L(n.All), [j, ne] = L(Y.All);
1152
+ N(() => {
1131
1153
  l != null && A(l);
1132
1154
  }, [l]);
1133
- let F = N((e) => {
1155
+ let P = M((e) => {
1134
1156
  A(e), d?.(e);
1135
- }, [d]), I = N((e) => {
1136
- w(e), e !== "" && O(!0);
1137
- }, []), L = N((e) => {
1157
+ }, [d]), F = M((e) => {
1158
+ T(e), e !== "" && O(!0);
1159
+ }, []), I = M((e) => {
1138
1160
  E(e), e && O(!0);
1139
- }, []), R = N((e) => {
1140
- M(e), p?.(e);
1141
- }, [p]), B = N(() => O((e) => !e), []);
1142
- return /* @__PURE__ */ H("section", {
1161
+ }, []), re = M((e) => {
1162
+ ne(e), p?.(e);
1163
+ }, [p]), B = M(() => O((e) => !e), []);
1164
+ return /* @__PURE__ */ z("section", {
1143
1165
  "aria-label": c.title,
1144
- className: a("flex min-h-0 flex-1 flex-col px-1 pt-4", x, ce.listSection),
1145
- children: [/* @__PURE__ */ V("div", {
1166
+ className: a("flex min-h-0 flex-1 flex-col px-1 pt-4", S, ue.listSection),
1167
+ children: [/* @__PURE__ */ R("div", {
1146
1168
  className: "px-3 pb-2",
1147
- children: /* @__PURE__ */ V(Je, {
1169
+ children: /* @__PURE__ */ R(Xe, {
1148
1170
  labels: c,
1149
1171
  isExpanded: D,
1150
1172
  onToggleExpanded: B,
1151
- controlsId: S,
1152
- searchQuery: C,
1153
- isSearchOpen: T,
1154
- onSearchChange: I,
1155
- onSearchOpenChange: L,
1173
+ controlsId: C,
1174
+ searchQuery: w,
1175
+ isSearchOpen: ee,
1176
+ onSearchChange: F,
1177
+ onSearchOpenChange: I,
1156
1178
  activeFilter: k,
1157
- onFilterChange: u ? void 0 : F,
1179
+ onFilterChange: u ? void 0 : P,
1158
1180
  activeTypeFilter: j,
1159
- onTypeFilterChange: u || f ? void 0 : R,
1181
+ onTypeFilterChange: u || f ? void 0 : re,
1160
1182
  hiddenSources: m,
1161
1183
  actions: h,
1162
- styles: y?.header
1184
+ styles: b?.header
1163
1185
  })
1164
- }), /* @__PURE__ */ V("div", {
1186
+ }), /* @__PURE__ */ R("div", {
1165
1187
  hidden: !D,
1166
1188
  inert: !D,
1167
1189
  className: D ? "flex min-h-0 flex-1 flex-col" : "hidden",
1168
- children: /* @__PURE__ */ V($, {
1169
- id: S,
1190
+ children: /* @__PURE__ */ R(Ke, {
1191
+ id: C,
1170
1192
  conversations: e,
1171
1193
  isLoading: t,
1172
1194
  isUpdatingTitles: r,
@@ -1174,7 +1196,7 @@ var Y = /* @__PURE__ */ function(e) {
1174
1196
  onSelectConversation: o,
1175
1197
  activeConversationId: s,
1176
1198
  labels: c,
1177
- searchQuery: C,
1199
+ searchQuery: w,
1178
1200
  activeFilter: k,
1179
1201
  activeTypeFilter: j,
1180
1202
  hiddenSources: m,
@@ -1182,12 +1204,13 @@ var Y = /* @__PURE__ */ function(e) {
1182
1204
  getActions: g,
1183
1205
  onActionMenuOpen: _,
1184
1206
  onMoveConversation: v,
1185
- styles: y?.list,
1186
- className: b
1207
+ onVisibleConversationIdsChange: y,
1208
+ styles: b?.list,
1209
+ className: x
1187
1210
  })
1188
1211
  })]
1189
1212
  });
1190
- }), Xe = [
1213
+ }), Qe = [
1191
1214
  {
1192
1215
  value: n.All,
1193
1216
  labelKey: "all"
@@ -1204,79 +1227,79 @@ var Y = /* @__PURE__ */ function(e) {
1204
1227
  value: n.Organization,
1205
1228
  labelKey: "organization"
1206
1229
  }
1207
- ], Ze = M(({ activeTab: e, labels: t, onChange: n, tabClassName: r = "dial-tiny-semi-text", hiddenSources: i }) => {
1208
- let a = L(() => Xe.filter(({ value: e }) => !i?.includes(e)).map(({ value: e, labelKey: n }) => ({
1230
+ ], $e = j(({ activeTab: e, labels: t, onChange: n, tabClassName: r = "dial-tiny-semi-text", hiddenSources: i }) => {
1231
+ let a = F(() => Qe.filter(({ value: e }) => !i?.includes(e)).map(({ value: e, labelKey: n }) => ({
1209
1232
  value: e,
1210
1233
  label: t[n]
1211
1234
  })), [t, i]);
1212
- return /* @__PURE__ */ V(y, {
1235
+ return /* @__PURE__ */ R(y, {
1213
1236
  items: a,
1214
1237
  value: e,
1215
1238
  onChange: n,
1216
1239
  stretch: !0,
1217
1240
  "aria-label": t.groupAriaLabel ?? "Filter chats",
1218
1241
  className: "px-3 py-2",
1219
- chipClassName: A("!px-2", r)
1242
+ chipClassName: k("!px-2", r)
1220
1243
  });
1221
- }), Qe = { button: "_button_vjird_1" }, $e = M(({ label: e, onClick: t, labelClassName: n = "dial-small-semi-text", colors: i, className: o }) => {
1244
+ }), et = { button: "_button_vjird_1" }, tt = j(({ label: e, onClick: t, labelClassName: n = "dial-small-semi-text", colors: i, className: o }) => {
1222
1245
  let s = r({
1223
1246
  "--cp-new-chat-bg": i?.background,
1224
1247
  "--cp-new-chat-text": i?.text,
1225
1248
  "--cp-new-chat-focus-outline": i?.focusOutline
1226
1249
  });
1227
- return /* @__PURE__ */ V("div", {
1250
+ return /* @__PURE__ */ R("div", {
1228
1251
  className: "px-3 py-2",
1229
1252
  style: s,
1230
- children: /* @__PURE__ */ V(f, {
1253
+ children: /* @__PURE__ */ R(f, {
1231
1254
  label: e,
1232
1255
  textClassName: n,
1233
- iconBefore: /* @__PURE__ */ V(ae, {
1256
+ iconBefore: /* @__PURE__ */ R(se, {
1234
1257
  size: 18,
1235
1258
  stroke: h,
1236
1259
  className: "shrink-0",
1237
1260
  "aria-hidden": !0
1238
1261
  }),
1239
1262
  onClick: t,
1240
- className: a("h-[36px] w-full gap-2 px-3 py-1 shadow-chat-button hover:shadow-xs focus-visible:shadow-xs active:shadow-xs", Qe.button, o, ce.newChatButton)
1263
+ className: a("h-[36px] w-full gap-2 px-3 py-1 shadow-chat-button hover:shadow-xs focus-visible:shadow-xs active:shadow-xs", et.button, o, ue.newChatButton)
1241
1264
  })
1242
1265
  });
1243
- }), et = M(({ conversations: e, isLoading: t, isUpdatingTitles: i, preserveActiveSearchResult: o, isOpen: s, onSelectConversation: c, activeConversationId: l, labels: f, onNewChat: p, styles: m, className: h, isOverlay: g = !1, getActions: _, onActionMenuOpen: v, onToggle: y, headerActions: b, onMoveConversation: x, activeFilter: S, onActiveFilterChange: C, isFilterTabsHidden: w = !1, hiddenSources: T }) => {
1244
- let { colors: D, typography: O, newChatButton: k, searchWrapperClassName: A, headerClassName: j, headerActionsClassName: M, newChatButtonClassName: ee } = m ?? {}, { title: F, emptyLabel: I, emptyDescription: R, noResultsLabel: B, noResultsDescription: te, sharedEmptyDescription: ne, tabEmptyLabels: U, loadingLabel: W, updatingTitlesLabel: re, newChatLabel: ie, searchPlaceholder: ae, searchClearLabel: oe, filterLabels: G, groupLabels: se, actionsLabel: K, unreadIndicatorLabel: q, closeAriaLabel: le } = f, [ue, de] = z(""), [fe, pe] = z(n.All);
1245
- P(() => {
1246
- S != null && pe(S);
1247
- }, [S]);
1248
- let J = N((e) => {
1249
- de(e ?? "");
1250
- }, []), me = r({
1266
+ }), nt = j(({ conversations: e, isLoading: t, isUpdatingTitles: i, preserveActiveSearchResult: o, isOpen: s, onSelectConversation: c, activeConversationId: l, labels: f, onNewChat: p, styles: m, className: h, isOverlay: g = !1, getActions: _, onActionMenuOpen: v, onToggle: y, headerActions: b, onMoveConversation: x, onVisibleConversationIdsChange: S, activeFilter: C, onActiveFilterChange: w, isFilterTabsHidden: T = !1, hiddenSources: E }) => {
1267
+ let { colors: D, typography: O, newChatButton: k, searchWrapperClassName: A, headerClassName: j, headerActionsClassName: te, newChatButtonClassName: ne } = m ?? {}, { title: P, emptyLabel: I, emptyDescription: re, noResultsLabel: B, noResultsDescription: ie, sharedEmptyDescription: V, tabEmptyLabels: H, loadingLabel: ae, updatingTitlesLabel: oe, newChatLabel: se, searchPlaceholder: ce, searchClearLabel: U, filterLabels: le, groupLabels: W, actionsLabel: G, unreadIndicatorLabel: K, closeAriaLabel: de } = f, [q, fe] = L(""), [pe, J] = L(n.All);
1268
+ N(() => {
1269
+ C != null && J(C);
1270
+ }, [C]);
1271
+ let me = M((e) => {
1272
+ fe(e ?? "");
1273
+ }, []), he = r({
1251
1274
  "--cp-text": D?.text,
1252
1275
  "--cp-new-chat-bg": k?.background,
1253
1276
  "--cp-new-chat-text": k?.text,
1254
1277
  "--cp-new-chat-focus-outline": k?.focusOutline
1255
- }), he = L(() => ({
1278
+ }), ge = F(() => ({
1256
1279
  emptyLabel: I,
1257
- emptyDescription: R,
1280
+ emptyDescription: re,
1258
1281
  noResultsLabel: B,
1259
- noResultsDescription: te,
1260
- sharedEmptyDescription: ne,
1261
- tabEmptyLabels: U,
1262
- loadingLabel: W,
1263
- updatingTitlesLabel: re,
1264
- groupLabels: se,
1265
- actionsLabel: K,
1266
- unreadIndicatorLabel: q
1282
+ noResultsDescription: ie,
1283
+ sharedEmptyDescription: V,
1284
+ tabEmptyLabels: H,
1285
+ loadingLabel: ae,
1286
+ updatingTitlesLabel: oe,
1287
+ groupLabels: W,
1288
+ actionsLabel: G,
1289
+ unreadIndicatorLabel: K
1267
1290
  }), [
1268
1291
  I,
1269
- R,
1292
+ re,
1270
1293
  B,
1271
- te,
1272
- ne,
1273
- U,
1294
+ ie,
1295
+ V,
1296
+ H,
1297
+ ae,
1298
+ oe,
1274
1299
  W,
1275
- re,
1276
- se,
1277
- K,
1278
- q
1279
- ]), ge = L(() => ({
1300
+ G,
1301
+ K
1302
+ ]), _e = F(() => ({
1280
1303
  colors: D,
1281
1304
  typography: {
1282
1305
  fontFamily: O?.fontFamily,
@@ -1291,14 +1314,14 @@ var Y = /* @__PURE__ */ function(e) {
1291
1314
  O?.itemTitleClassName,
1292
1315
  m?.itemIconBadgeClassName
1293
1316
  ]);
1294
- return /* @__PURE__ */ H(d, {
1317
+ return /* @__PURE__ */ z(d, {
1295
1318
  isOpen: s,
1296
1319
  isOverlay: g,
1297
1320
  orientation: u.Left,
1298
- title: F,
1321
+ title: P,
1299
1322
  labels: {
1300
- ariaLabel: F,
1301
- closeLabel: le
1323
+ ariaLabel: P,
1324
+ closeLabel: de
1302
1325
  },
1303
1326
  onClose: y,
1304
1327
  styles: {
@@ -1308,103 +1331,104 @@ var Y = /* @__PURE__ */ function(e) {
1308
1331
  },
1309
1332
  typography: { fontClassName: O?.fontClassName },
1310
1333
  bodyClassName: "flex flex-col overflow-hidden p-0 gap-3",
1311
- cssVars: me,
1334
+ cssVars: he,
1312
1335
  titleClassName: O?.fontClassName,
1313
1336
  headerClassName: a("h-[64px]", j),
1314
- headerActionsClassName: M,
1337
+ headerActionsClassName: te,
1315
1338
  className: a(s ? "w-[324px] mobile:w-full" : "w-0", h)
1316
1339
  },
1317
1340
  rightActions: b,
1318
1341
  children: [
1319
- /* @__PURE__ */ V($e, {
1320
- label: ie,
1342
+ /* @__PURE__ */ R(tt, {
1343
+ label: se,
1321
1344
  onClick: p,
1322
1345
  labelClassName: O?.newChatLabelClassName,
1323
1346
  colors: k,
1324
- className: ee
1347
+ className: ne
1325
1348
  }),
1326
- /* @__PURE__ */ V("div", {
1349
+ /* @__PURE__ */ R("div", {
1327
1350
  role: "search",
1328
- className: a("px-3 py-2", ce.search),
1329
- children: /* @__PURE__ */ V(E, {
1351
+ className: a("px-3 py-2", ue.search),
1352
+ children: /* @__PURE__ */ R(ee, {
1330
1353
  wrapperClassName: a(Q.search, A),
1331
- value: ue,
1332
- onChange: J,
1333
- placeholder: ae,
1334
- clearLabel: oe,
1335
- "aria-label": ae
1354
+ value: q,
1355
+ onChange: me,
1356
+ placeholder: ce,
1357
+ clearLabel: U,
1358
+ "aria-label": ce
1336
1359
  })
1337
1360
  }),
1338
- !w && /* @__PURE__ */ V(Ze, {
1339
- activeTab: fe,
1340
- labels: G,
1361
+ !T && /* @__PURE__ */ R($e, {
1362
+ activeTab: pe,
1363
+ labels: le,
1341
1364
  onChange: (e) => {
1342
- pe(e), C?.(e);
1365
+ J(e), w?.(e);
1343
1366
  },
1344
1367
  tabClassName: O?.tabClassName,
1345
- hiddenSources: T
1368
+ hiddenSources: E
1346
1369
  }),
1347
- /* @__PURE__ */ V($, {
1370
+ /* @__PURE__ */ R(Ke, {
1348
1371
  conversations: e,
1349
1372
  isLoading: t,
1350
1373
  isUpdatingTitles: i,
1351
1374
  preserveActiveSearchResult: o,
1352
1375
  onSelectConversation: c,
1353
1376
  activeConversationId: l,
1354
- labels: he,
1355
- searchQuery: ue,
1356
- activeFilter: fe,
1357
- hiddenSources: T,
1377
+ labels: ge,
1378
+ searchQuery: q,
1379
+ activeFilter: pe,
1380
+ hiddenSources: E,
1358
1381
  getActions: _,
1359
1382
  onActionMenuOpen: v,
1360
1383
  onMoveConversation: x,
1361
- styles: ge
1384
+ onVisibleConversationIdsChange: S,
1385
+ styles: _e
1362
1386
  })
1363
1387
  ]
1364
1388
  });
1365
- }), tt = M(({ isOpen: e, currentTitle: t, isSaving: n, error: r, onSave: a, onCancel: c, onGenerateWithAi: l, labels: u, styles: d }) => {
1366
- let [f, g] = z(t), [_, v] = z(!1), [y, x] = z(null), C = R(null), E = R(!1), D = R(0);
1367
- P(() => {
1368
- let n = e && !E.current;
1369
- if (E.current = e, !e) {
1370
- D.current += 1, v(!1);
1389
+ }), rt = j(({ isOpen: e, currentTitle: t, isSaving: n, error: r, onSave: a, onCancel: c, onGenerateWithAi: l, labels: u, styles: d }) => {
1390
+ let [f, g] = L(t), [_, v] = L(!1), [y, x] = L(null), C = I(null), ee = I(!1), E = I(0);
1391
+ N(() => {
1392
+ let n = e && !ee.current;
1393
+ if (ee.current = e, !e) {
1394
+ E.current += 1, v(!1);
1371
1395
  return;
1372
1396
  }
1373
1397
  if (!n) return;
1374
- D.current += 1, g(t), x(null), v(!1);
1398
+ E.current += 1, g(t), x(null), v(!1);
1375
1399
  let r = setTimeout(() => C.current?.focus(), 0);
1376
1400
  return () => clearTimeout(r);
1377
- }, [e, t]), P(() => () => {
1378
- D.current += 1;
1401
+ }, [e, t]), N(() => () => {
1402
+ E.current += 1;
1379
1403
  }, []);
1380
- let O = s(f.trim()), A = i(O) > 255, j = n || O === "" || O === t.trim() || A, M = N(() => {
1381
- j || a(O);
1404
+ let D = s(f.trim()), k = i(D) > 255, A = n || D === "" || D === t.trim() || k, j = M(() => {
1405
+ A || a(D);
1382
1406
  }, [
1383
- j,
1407
+ A,
1384
1408
  a,
1385
- O
1386
- ]), ee = N((e) => {
1387
- e.key === "Enter" && M();
1388
- }, [M]), F = N(async () => {
1409
+ D
1410
+ ]), te = M((e) => {
1411
+ e.key === "Enter" && j();
1412
+ }, [j]), ne = M(async () => {
1389
1413
  if (_) return;
1390
- let e = ++D.current;
1414
+ let e = ++E.current;
1391
1415
  v(!0), x(null);
1392
1416
  try {
1393
1417
  let t = await l();
1394
- if (e !== D.current) return;
1418
+ if (e !== E.current) return;
1395
1419
  g(o(t));
1396
1420
  } catch {
1397
- if (e !== D.current) return;
1421
+ if (e !== E.current) return;
1398
1422
  x(u.renameWithAiError);
1399
1423
  } finally {
1400
- e === D.current && v(!1);
1424
+ e === E.current && v(!1);
1401
1425
  }
1402
1426
  }, [
1403
1427
  _,
1404
1428
  l,
1405
1429
  u.renameWithAiError
1406
- ]), I = y ?? r ?? void 0, L;
1407
- return L = A ? u.nameTooLongError : I, /* @__PURE__ */ V(w, {
1430
+ ]), P = y ?? r ?? void 0, F;
1431
+ return F = k ? u.nameTooLongError : P, /* @__PURE__ */ R(w, {
1408
1432
  open: e,
1409
1433
  header: u.popupTitle,
1410
1434
  size: T.Sm,
@@ -1415,45 +1439,45 @@ var Y = /* @__PURE__ */ function(e) {
1415
1439
  }, {
1416
1440
  label: u.saveLabel,
1417
1441
  variant: p.Primary,
1418
- disabled: j,
1419
- onClick: M
1442
+ disabled: A,
1443
+ onClick: j
1420
1444
  }],
1421
- children: /* @__PURE__ */ V("div", {
1445
+ children: /* @__PURE__ */ R("div", {
1422
1446
  className: d?.bodyClassName,
1423
1447
  style: d?.cssVars,
1424
- children: n ? /* @__PURE__ */ V("div", {
1448
+ children: n ? /* @__PURE__ */ R("div", {
1425
1449
  className: "h-[120px] px-6 py-4",
1426
- children: /* @__PURE__ */ V(k, { size: 50 })
1427
- }) : /* @__PURE__ */ H("div", {
1450
+ children: /* @__PURE__ */ R(O, { size: 50 })
1451
+ }) : /* @__PURE__ */ z("div", {
1428
1452
  className: "flex items-start gap-2 px-6 py-3",
1429
1453
  children: [
1430
- /* @__PURE__ */ V("span", {
1454
+ /* @__PURE__ */ R("span", {
1431
1455
  role: "alert",
1432
1456
  className: "sr-only",
1433
- children: A ? "" : I ?? ""
1457
+ children: k ? "" : P ?? ""
1434
1458
  }),
1435
- /* @__PURE__ */ V("div", {
1459
+ /* @__PURE__ */ R("div", {
1436
1460
  className: "min-w-0 flex-1",
1437
- children: /* @__PURE__ */ V(S, {
1461
+ children: /* @__PURE__ */ R(S, {
1438
1462
  inputRef: C,
1439
1463
  value: f,
1440
1464
  placeholder: u.inputPlaceholder,
1441
- error: L,
1465
+ error: F,
1442
1466
  onChange: (e) => g(o(e ?? "")),
1443
- onKeyDown: ee
1467
+ onKeyDown: te
1444
1468
  })
1445
1469
  }),
1446
- /* @__PURE__ */ V(b, {
1470
+ /* @__PURE__ */ R(b, {
1447
1471
  "aria-label": u.renameWithAiLabel,
1448
1472
  tooltipProps: { tooltip: u.renameWithAiLabel },
1449
1473
  disabled: _ || n,
1450
1474
  "aria-busy": _,
1451
- onClick: F,
1452
- icon: _ ? /* @__PURE__ */ V("span", {
1475
+ onClick: ne,
1476
+ icon: _ ? /* @__PURE__ */ R("span", {
1453
1477
  className: "flex",
1454
1478
  "aria-hidden": !0,
1455
- children: /* @__PURE__ */ V(k, { size: m.MD })
1456
- }) : /* @__PURE__ */ V(G, {
1479
+ children: /* @__PURE__ */ R(O, { size: m.MD })
1480
+ }) : /* @__PURE__ */ R(U, {
1457
1481
  size: m.MD,
1458
1482
  stroke: h,
1459
1483
  "aria-hidden": !0
@@ -1464,6 +1488,6 @@ var Y = /* @__PURE__ */ function(e) {
1464
1488
  })
1465
1489
  });
1466
1490
  });
1467
- tt.displayName = "RenameConversationPopup";
1491
+ rt.displayName = "RenameConversationPopup";
1468
1492
  //#endregion
1469
- export { ce as CONVERSATION_PANEL_CLASS, $ as ConversationList, Je as ConversationListHeader, Ye as ConversationListSection, et as ConversationPanel, X as ConversationRowVariant, Y as ConversationTypeFilter, tt as RenameConversationPopup };
1493
+ export { ue as CONVERSATION_PANEL_CLASS, Ke as ConversationList, Xe as ConversationListHeader, Ze as ConversationListSection, nt as ConversationPanel, X as ConversationRowVariant, Y as ConversationTypeFilter, rt as RenameConversationPopup };