@epam/ai-dial-conversation-panel 1.3.0-dev.13 → 1.3.0-dev.133

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/components/ConversationGroupHeader/ConversationGroupHeader.d.ts +3 -0
  2. package/components/ConversationGroupHeader/ConversationGroupHeader.d.ts.map +1 -1
  3. package/components/ConversationList/ConversationList.d.ts +5 -0
  4. package/components/ConversationList/ConversationList.d.ts.map +1 -0
  5. package/components/ConversationListHeader/ConversationListHeader.d.ts +5 -0
  6. package/components/ConversationListHeader/ConversationListHeader.d.ts.map +1 -0
  7. package/components/ConversationListSection/ConversationListSection.d.ts +5 -0
  8. package/components/ConversationListSection/ConversationListSection.d.ts.map +1 -0
  9. package/components/ConversationPanel/ConversationPanel.d.ts.map +1 -1
  10. package/components/ConversationRow/ConversationRow.d.ts +3 -0
  11. package/components/ConversationRow/ConversationRow.d.ts.map +1 -1
  12. package/components/RowRenderer/RowRenderer.d.ts +1 -1
  13. package/components/RowRenderer/RowRenderer.d.ts.map +1 -1
  14. package/constants/public-class-names.d.ts +6 -0
  15. package/constants/public-class-names.d.ts.map +1 -1
  16. package/constants/virtual-list.d.ts +6 -0
  17. package/constants/virtual-list.d.ts.map +1 -1
  18. package/index.css +3 -2
  19. package/index.d.ts +7 -0
  20. package/index.d.ts.map +1 -1
  21. package/index.js +764 -485
  22. package/models/conversation-list-header.d.ts +71 -0
  23. package/models/conversation-list-header.d.ts.map +1 -0
  24. package/models/conversation-list-section.d.ts +52 -0
  25. package/models/conversation-list-section.d.ts.map +1 -0
  26. package/models/conversation-list.d.ts +107 -0
  27. package/models/conversation-list.d.ts.map +1 -0
  28. package/models/panel-props.d.ts +9 -52
  29. package/models/panel-props.d.ts.map +1 -1
  30. package/models/virtual-row.d.ts +3 -0
  31. package/models/virtual-row.d.ts.map +1 -1
  32. package/package.json +4 -4
  33. package/types/conversation-row-variant.d.ts +8 -0
  34. package/types/conversation-row-variant.d.ts.map +1 -0
  35. package/{components/ConversationPanel/utils.d.ts → utils/conversation-filter.d.ts} +2 -2
  36. package/utils/conversation-filter.d.ts.map +1 -0
  37. package/utils/conversation-row.d.ts +1 -1
  38. package/utils/conversation-row.d.ts.map +1 -1
  39. package/components/ConversationPanel/utils.d.ts.map +0 -1
package/index.js CHANGED
@@ -1,31 +1,32 @@
1
1
  import { DeploymentIcon as e, FilterTab as t, buildCssVars as n, getUtf8ByteLength as r, mergeClasses as i, sanitizeConversationName as a, stripTrailingDots as o } from "@epam/ai-dial-chat-shared";
2
2
  import { PanelEmpty as s, PanelNoResults as c, SidebarOrientation as l, SidebarPanel as u } from "@epam/ai-dial-sidebar";
3
- import { Button as d, ButtonVariant as f, DIAL_ICON_SIZE as p, DIAL_KIT_ICON_STROKE as m, Dropdown as h, ElementSize as g, EllipsisTooltip as _, FilterChips as v, GhostIconButton as y, Highlight as b, Input as x, Popup as S, PopupSize as C, Search as w, Skeleton as T, SkeletonVariant as ee, Spinner as E, mergeClasses as D } from "@epam/ai-dial-ui-kit";
4
- import { createElement as O, memo as k, useCallback as A, useEffect as j, useId as te, useImperativeHandle as M, useLayoutEffect as ne, useMemo as N, useRef as P, useState as F } from "react";
5
- import { jsx as I, jsxs as re } from "react/jsx-runtime";
6
- import { IconCaretDownFilled as L, IconCaretRightFilled as R, IconDotsVertical as ie, IconPlus as ae, IconSparkles as oe } from "@tabler/icons-react";
3
+ import { Button as d, ButtonVariant as f, DIAL_ICON_SIZE as p, DIAL_KIT_ICON_STROKE as m, Dropdown as h, ElementSize as g, EllipsisTooltip as _, FilterChips as v, GhostIconButton as y, Highlight as b, Input as x, MenuItemMark as S, Popup as C, PopupSize as w, Search as T, 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 P, useImperativeHandle as F, useLayoutEffect as I, useMemo as L, useRef as R, useState as z } from "react";
5
+ import { jsx as B, jsxs as V } from "react/jsx-runtime";
6
+ import { IconCaretDownFilled as ee, IconCaretRightFilled as H, IconChevronDown as te, IconChevronRight as ne, IconDotsVertical as re, IconFilter2 as U, IconPlus as ie, IconSearch as ae, IconSparkles as oe, IconX as se } from "@tabler/icons-react";
7
7
  //#region src/constants/public-class-names.ts
8
- var se = {
8
+ var W = {
9
9
  newChatButton: "dial-cp-new-chat-button",
10
- search: "dial-cp-search"
11
- }, z = typeof window < "u" ? ne : j;
12
- function ce(e) {
10
+ search: "dial-cp-search",
11
+ list: "dial-cp-list",
12
+ listHeader: "dial-cp-list-header",
13
+ listSection: "dial-cp-list-section"
14
+ }, G = typeof window < "u" ? I : N;
15
+ function K(e) {
13
16
  if (e !== void 0) switch (typeof e) {
14
17
  case "number": return e;
15
- case "string":
16
- if (e.endsWith("px")) return parseFloat(e);
17
- break;
18
+ case "string": if (e.endsWith("px")) return parseFloat(e);
18
19
  }
19
20
  }
20
- function B({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
21
- let { styleHeight: s, styleWidth: c } = N(() => ({
22
- styleHeight: ce(o?.height),
23
- styleWidth: ce(o?.width)
24
- }), [o?.height, o?.width]), [l, u] = F({
21
+ function ce({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
22
+ let { styleHeight: s, styleWidth: c } = L(() => ({
23
+ styleHeight: K(o?.height),
24
+ styleWidth: K(o?.width)
25
+ }), [o?.height, o?.width]), [l, u] = z({
25
26
  height: t,
26
27
  width: n
27
28
  }), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
28
- return z(() => {
29
+ return G(() => {
29
30
  if (i === null || d) return;
30
31
  let t = new ResizeObserver((e) => {
31
32
  for (let t of e) {
@@ -45,7 +46,7 @@ function B({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i,
45
46
  i,
46
47
  s,
47
48
  c
48
- ]), N(() => ({
49
+ ]), L(() => ({
49
50
  height: s ?? l.height,
50
51
  width: c ?? l.width
51
52
  }), [
@@ -55,55 +56,53 @@ function B({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i,
55
56
  ]);
56
57
  }
57
58
  function le(e) {
58
- let t = P(() => {
59
+ let t = R(() => {
59
60
  throw Error("Cannot call during render.");
60
61
  });
61
- return z(() => {
62
+ return G(() => {
62
63
  t.current = e;
63
- }, [e]), A((e) => t.current?.(e), [t]);
64
+ }, [e]), M((e) => t.current?.(e), [t]);
64
65
  }
65
- var V = null;
66
- function H(e = !1) {
67
- if (V === null || e) {
66
+ var q = null;
67
+ function ue(e = !1) {
68
+ if (q === null || e) {
68
69
  let e = document.createElement("div"), t = e.style;
69
70
  t.width = "50px", t.height = "50px", t.overflow = "scroll", t.direction = "rtl";
70
71
  let n = document.createElement("div"), r = n.style;
71
- return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? V = "positive-descending" : (e.scrollLeft = 1, V = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), V;
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;
72
73
  }
73
- return V;
74
+ return q;
74
75
  }
75
- function U({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
76
- if (t === "horizontal" && n) switch (H()) {
76
+ function de({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
77
+ if (t === "horizontal" && n) switch (ue()) {
77
78
  case "negative": return -r;
78
- case "positive-descending":
79
- if (e) {
80
- let { clientWidth: t, scrollLeft: n, scrollWidth: r } = e;
81
- return r - t - n;
82
- }
83
- break;
79
+ case "positive-descending": if (e) {
80
+ let { clientWidth: t, scrollLeft: n, scrollWidth: r } = e;
81
+ return r - t - n;
82
+ }
84
83
  }
85
84
  return r;
86
85
  }
87
- function W(e, t = "Assertion error") {
86
+ function J(e, t = "Assertion error") {
88
87
  if (!e) throw console.error(t), Error(t);
89
88
  }
90
- function G(e, t) {
89
+ function fe(e, t) {
91
90
  if (e === t) return !0;
92
- if (!!e != !!t || (W(e !== void 0), W(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
91
+ if (!!e != !!t || (J(e !== void 0), J(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
93
92
  for (let n in e) if (!Object.is(t[n], e[n])) return !1;
94
93
  return !0;
95
94
  }
96
- function K({ cachedBounds: e, itemCount: t, itemSize: n }) {
95
+ function pe({ cachedBounds: e, itemCount: t, itemSize: n }) {
97
96
  if (t === 0) return 0;
98
97
  if (typeof n == "number") return t * n;
99
98
  {
100
99
  let n = e.get(e.size === 0 ? 0 : e.size - 1);
101
- return W(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
100
+ return J(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
102
101
  }
103
102
  }
104
- function ue({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
103
+ function me({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
105
104
  if (n < 0 || n >= r) throw RangeError(`Invalid index specified: ${n}`, { cause: `Index ${n} is not within the range of 0 - ${r - 1}` });
106
- let s = K({
105
+ let s = pe({
107
106
  cachedBounds: t,
108
107
  itemCount: r,
109
108
  itemSize: i
@@ -115,7 +114,7 @@ function ue({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, co
115
114
  default: return a >= u && a <= l ? a : a < u ? u : l;
116
115
  }
117
116
  }
118
- function q({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
117
+ function Y({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
119
118
  let a = r - 1, o = 0, s = -1, c = 0, l = -1, u = 0;
120
119
  for (; u < a;) {
121
120
  let n = e.get(u);
@@ -134,19 +133,17 @@ function q({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCo
134
133
  stopIndexOverscan: l
135
134
  };
136
135
  }
137
- function de({ itemCount: e, itemProps: t, itemSize: n }) {
136
+ function he({ itemCount: e, itemProps: t, itemSize: n }) {
138
137
  let r = /* @__PURE__ */ new Map();
139
138
  return {
140
139
  get(i) {
141
- for (W(i < e, `Invalid index ${i}`); r.size - 1 < i;) {
140
+ for (J(i < e, `Invalid index ${i}`); r.size - 1 < i;) {
142
141
  let e = r.size, a;
143
142
  switch (typeof n) {
144
143
  case "function":
145
144
  a = n(e, t);
146
145
  break;
147
- case "number":
148
- a = n;
149
- break;
146
+ case "number": a = n;
150
147
  }
151
148
  if (e === 0) r.set(e, {
152
149
  size: a,
@@ -154,14 +151,14 @@ function de({ itemCount: e, itemProps: t, itemSize: n }) {
154
151
  });
155
152
  else {
156
153
  let t = r.get(e - 1);
157
- W(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
154
+ J(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
158
155
  scrollOffset: t.scrollOffset + t.size,
159
156
  size: a
160
157
  });
161
158
  }
162
159
  }
163
160
  let a = r.get(i);
164
- return W(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
161
+ return J(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
165
162
  },
166
163
  set(e, t) {
167
164
  r.set(e, t);
@@ -171,8 +168,8 @@ function de({ itemCount: e, itemProps: t, itemSize: n }) {
171
168
  }
172
169
  };
173
170
  }
174
- function J({ itemCount: e, itemProps: t, itemSize: n }) {
175
- return N(() => de({
171
+ function ge({ itemCount: e, itemProps: t, itemSize: n }) {
172
+ return L(() => he({
176
173
  itemCount: e,
177
174
  itemProps: t,
178
175
  itemSize: n
@@ -182,33 +179,31 @@ function J({ itemCount: e, itemProps: t, itemSize: n }) {
182
179
  n
183
180
  ]);
184
181
  }
185
- function Y({ containerSize: e, itemSize: t }) {
182
+ function _e({ containerSize: e, itemSize: t }) {
186
183
  let n;
187
184
  switch (typeof t) {
188
185
  case "string":
189
- W(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), W(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseInt(t) / 100;
190
- break;
191
- default:
192
- n = t;
186
+ J(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), J(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseInt(t) / 100;
193
187
  break;
188
+ default: n = t;
194
189
  }
195
190
  return n;
196
191
  }
197
- function fe({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
198
- let { height: u = n, width: d = n } = B({
192
+ function ve({ 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 } = ce({
199
194
  defaultHeight: r === "vertical" ? n : void 0,
200
195
  defaultWidth: r === "horizontal" ? n : void 0,
201
196
  element: e,
202
197
  mode: r === "vertical" ? "only-height" : "only-width",
203
198
  style: t
204
- }), f = P({
199
+ }), f = R({
205
200
  height: 0,
206
201
  width: 0
207
- }), p = r === "vertical" ? u : d, m = Y({
202
+ }), p = r === "vertical" ? u : d, m = _e({
208
203
  containerSize: p,
209
204
  itemSize: s
210
205
  });
211
- ne(() => {
206
+ I(() => {
212
207
  if (typeof c == "function") {
213
208
  let e = f.current;
214
209
  (e.height !== u || e.width !== d) && (c({
@@ -221,11 +216,11 @@ function fe({ containerElement: e, containerStyle: t, defaultContainerSize: n =
221
216
  c,
222
217
  d
223
218
  ]);
224
- let h = J({
219
+ let h = ge({
225
220
  itemCount: a,
226
221
  itemProps: o,
227
222
  itemSize: m
228
- }), g = A((e) => h.get(e), [h]), [_, v] = F(() => q({
223
+ }), g = M((e) => h.get(e), [h]), [_, v] = z(() => Y({
229
224
  cachedBounds: h,
230
225
  containerScrollOffset: 0,
231
226
  containerSize: p,
@@ -236,7 +231,7 @@ function fe({ containerElement: e, containerStyle: t, defaultContainerSize: n =
236
231
  startIndexOverscan: Math.min(a - 1, _.startIndexOverscan),
237
232
  stopIndexVisible: Math.min(a - 1, _.stopIndexVisible),
238
233
  stopIndexOverscan: Math.min(a - 1, _.stopIndexOverscan)
239
- }, C = A(() => K({
234
+ }, C = M(() => pe({
240
235
  cachedBounds: h,
241
236
  itemCount: a,
242
237
  itemSize: m
@@ -244,18 +239,21 @@ function fe({ containerElement: e, containerStyle: t, defaultContainerSize: n =
244
239
  h,
245
240
  a,
246
241
  m
247
- ]), w = A((t) => q({
248
- cachedBounds: h,
249
- containerScrollOffset: U({
242
+ ]), w = M((t) => {
243
+ let n = de({
250
244
  containerElement: e,
251
245
  direction: r,
252
246
  isRtl: i,
253
247
  scrollOffset: t
254
- }),
255
- containerSize: p,
256
- itemCount: a,
257
- overscanCount: l
258
- }), [
248
+ });
249
+ return Y({
250
+ cachedBounds: h,
251
+ containerScrollOffset: n,
252
+ containerSize: p,
253
+ itemCount: a,
254
+ overscanCount: l
255
+ });
256
+ }, [
259
257
  h,
260
258
  e,
261
259
  p,
@@ -264,29 +262,30 @@ function fe({ containerElement: e, containerStyle: t, defaultContainerSize: n =
264
262
  a,
265
263
  l
266
264
  ]);
267
- return z(() => {
268
- v(w((r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0));
265
+ return G(() => {
266
+ let t = (r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0;
267
+ v(w(t));
269
268
  }, [
270
269
  e,
271
270
  r,
272
271
  w
273
- ]), z(() => {
272
+ ]), G(() => {
274
273
  if (!e) return;
275
274
  let t = () => {
276
275
  v((t) => {
277
- let { scrollLeft: n, scrollTop: o } = e, s = q({
276
+ let { scrollLeft: n, scrollTop: o } = e, s = de({
277
+ containerElement: e,
278
+ direction: r,
279
+ isRtl: i,
280
+ scrollOffset: r === "vertical" ? o : n
281
+ }), c = Y({
278
282
  cachedBounds: h,
279
- containerScrollOffset: U({
280
- containerElement: e,
281
- direction: r,
282
- isRtl: i,
283
- scrollOffset: r === "vertical" ? o : n
284
- }),
283
+ containerScrollOffset: s,
285
284
  containerSize: p,
286
285
  itemCount: a,
287
286
  overscanCount: l
288
287
  });
289
- return G(s, t) ? t : s;
288
+ return fe(c, t) ? t : c;
290
289
  });
291
290
  };
292
291
  return e.addEventListener("scroll", t), () => {
@@ -303,7 +302,7 @@ function fe({ containerElement: e, containerStyle: t, defaultContainerSize: n =
303
302
  getCellBounds: g,
304
303
  getEstimatedSize: C,
305
304
  scrollToIndex: le(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
306
- let s = ue({
305
+ let s = me({
307
306
  align: t,
308
307
  cachedBounds: h,
309
308
  containerScrollOffset: n,
@@ -313,14 +312,14 @@ function fe({ containerElement: e, containerStyle: t, defaultContainerSize: n =
313
312
  itemSize: m
314
313
  });
315
314
  if (e) {
316
- if (s = U({
315
+ if (s = de({
317
316
  containerElement: e,
318
317
  direction: r,
319
318
  isRtl: i,
320
319
  scrollOffset: s
321
320
  }), typeof e.scrollTo != "function") {
322
321
  let e = w(s);
323
- G(_, e) || v(e);
322
+ fe(_, e) || v(e);
324
323
  }
325
324
  return s;
326
325
  }
@@ -331,30 +330,30 @@ function fe({ containerElement: e, containerStyle: t, defaultContainerSize: n =
331
330
  stopIndexVisible: x
332
331
  };
333
332
  }
334
- function pe(e) {
335
- return N(() => e, Object.values(e));
333
+ function ye(e) {
334
+ return L(() => e, Object.values(e));
336
335
  }
337
- function me(e, t) {
336
+ function X(e, t) {
338
337
  let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
339
- return G(n, a) && G(r, o) && G(i, s);
338
+ return fe(n, a) && fe(r, o) && fe(i, s);
340
339
  }
341
- function he(e) {
340
+ function be(e) {
342
341
  return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
343
342
  }
344
- var ge = "data-react-window-index";
345
- function _e({ 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 }) {
346
- let m = pe(u), h = N(() => k(s, me), [s]), [g, _] = F(null), v = he(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = fe({
343
+ var xe = "data-react-window-index";
344
+ function Se({ 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 = ye(u), h = L(() => j(s, X), [s]), [g, _] = z(null), v = be(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = ve({
347
346
  containerElement: g,
348
347
  containerStyle: f,
349
348
  defaultContainerSize: n,
350
349
  direction: "vertical",
351
350
  itemCount: c,
352
351
  itemProps: m,
353
- itemSize: N(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
352
+ itemSize: L(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
354
353
  onResize: i,
355
354
  overscanCount: o
356
355
  });
357
- M(r, () => ({
356
+ F(r, () => ({
358
357
  get element() {
359
358
  return g;
360
359
  },
@@ -369,12 +368,12 @@ function _e({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
369
368
  top: r
370
369
  });
371
370
  }
372
- }), [g, x]), z(() => {
371
+ }), [g, x]), G(() => {
373
372
  if (!g) return;
374
373
  let e = Array.from(g.children).filter((e, t) => {
375
374
  if (e.hasAttribute("aria-hidden")) return !1;
376
375
  let n = `${S + t}`;
377
- return e.setAttribute(ge, n), !0;
376
+ return e.setAttribute(xe, n), !0;
378
377
  });
379
378
  if (v) return l.observeRowElements(e);
380
379
  }, [
@@ -383,7 +382,7 @@ function _e({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
383
382
  l,
384
383
  S,
385
384
  w
386
- ]), j(() => {
385
+ ]), N(() => {
387
386
  S >= 0 && w >= 0 && a && a({
388
387
  startIndex: C,
389
388
  stopIndex: T
@@ -398,11 +397,11 @@ function _e({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
398
397
  w,
399
398
  T
400
399
  ]);
401
- let ee = N(() => {
400
+ let E = L(() => {
402
401
  let e = [];
403
402
  if (c > 0) for (let t = S; t <= w; t++) {
404
403
  let n = y(t);
405
- e.push(/* @__PURE__ */ O(h, {
404
+ e.push(/* @__PURE__ */ A(h, {
406
405
  ...m,
407
406
  ariaAttributes: {
408
407
  "aria-posinset": t + 1,
@@ -429,7 +428,7 @@ function _e({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
429
428
  m,
430
429
  S,
431
430
  w
432
- ]), E = /* @__PURE__ */ I("div", {
431
+ ]), D = /* @__PURE__ */ B("div", {
433
432
  "aria-hidden": !0,
434
433
  style: {
435
434
  height: b(),
@@ -437,7 +436,7 @@ function _e({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
437
436
  zIndex: -1
438
437
  }
439
438
  });
440
- return O(d, {
439
+ return A(d, {
441
440
  role: "list",
442
441
  ...p,
443
442
  className: t,
@@ -449,246 +448,235 @@ function _e({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
449
448
  overflowY: "auto",
450
449
  ...f
451
450
  }
452
- }, ee, e, E);
451
+ }, E, e, D);
453
452
  }
454
453
  //#endregion
455
- //#region src/types/virtual-row.ts
456
- var X = /* @__PURE__ */ function(e) {
454
+ //#region src/types/conversation-row-variant.ts
455
+ var Z = /* @__PURE__ */ function(e) {
456
+ return e.Avatar = "avatar", e.Indicator = "indicator", e;
457
+ }({}), Q = /* @__PURE__ */ function(e) {
457
458
  return e.Header = "header", e.Item = "item", e;
458
- }({}), ve = (e) => `${60 + e * 23 % 35}%`, ye = (e, t) => e ? t ? "pe-9" : "pe-2 group-focus-within/conversation:pe-9 group-hover/conversation:pe-9" : "pe-3", be = (e, t) => t.rows[e].kind === X.Item ? 36 : e === 0 ? 24 : 56, xe = 5, Se = (e) => Math.max(xe, Math.ceil(Math.ceil(e / 36) / 2)), Ce = (e) => {
459
+ }({}), Ce = (e, n) => n === t.All || e.source === n, we = (e, t) => !t || e.title.toLowerCase().includes(t.toLowerCase()), Te = (e) => `${60 + e * 23 % 35}%`, Ee = (e, t) => e ? t ? "pe-9" : "pe-2 group-focus-within/conversation:pe-9 group-hover/conversation:pe-9" : "pe-3", De = (e, t) => {
460
+ let n = t.rows[e];
461
+ return t.rowVariant === Z.Indicator ? n.kind === Q.Item ? 34 : e === 0 ? 32 : 40 : n.kind === Q.Item ? 36 : e === 0 ? 24 : 56;
462
+ }, Oe = 5, ke = (e) => Math.max(Oe, Math.ceil(Math.ceil(e / 36) / 2)), Ae = (e) => {
459
463
  switch (e) {
460
464
  case t.Shared: return t.Shared;
461
465
  case t.Organization: return t.Organization;
462
466
  default: return t.MyChats;
463
467
  }
464
- }, we = (e, t) => {
468
+ }, je = (e, t) => {
465
469
  let n = null;
466
- for (let r of e) if (r.kind === X.Header) n = r.groupKey;
470
+ for (let r of e) if (r.kind === Q.Header) n = r.groupKey;
467
471
  else if (r.item.id === t) return n;
468
472
  return null;
469
- }, Te = (e, n, r) => {
473
+ }, Me = (e, n, r) => {
470
474
  let i = /* @__PURE__ */ new Set();
471
475
  if (n != null && i.add(n), n === t.Pinned) {
472
476
  let t = r.find((t) => t.id === e);
473
- t && i.add(Ce(t.source));
477
+ t && i.add(Ae(t.source));
474
478
  } else i.add(t.Pinned);
475
479
  return i;
476
- }, Ee = (e, t, n, r) => {
480
+ }, Ne = (e, t, n, r) => {
477
481
  let i = e.currentTarget.getBoundingClientRect();
478
482
  if (e.clientY >= i.top + i.height / 2) return t;
479
483
  let a = null, o = !1;
480
- for (let e of n) if (e.kind === X.Header) o = e.groupKey === r;
484
+ for (let e of n) if (e.kind === Q.Header) o = e.groupKey === r;
481
485
  else if (o) {
482
486
  if (e.item.id === t) return a;
483
487
  a = e.item.id;
484
488
  }
485
489
  return null;
486
- }, De = [
487
- {
488
- value: t.All,
489
- labelKey: "all"
490
- },
491
- {
492
- value: t.MyChats,
493
- labelKey: "myChats"
494
- },
495
- {
496
- value: t.Shared,
497
- labelKey: "shared"
498
- },
499
- {
500
- value: t.Organization,
501
- labelKey: "organization"
502
- }
503
- ], Oe = k(({ activeTab: e, labels: t, onChange: n, tabClassName: r = "dial-tiny-semi-text", hiddenSources: i }) => /* @__PURE__ */ I(v, {
504
- items: N(() => De.filter(({ value: e }) => !i?.includes(e)).map(({ value: e, labelKey: n }) => ({
505
- value: e,
506
- label: t[n]
507
- })), [t, i]),
508
- value: e,
509
- onChange: n,
510
- stretch: !0,
511
- "aria-label": t.groupAriaLabel ?? "Filter chats",
512
- className: "px-3 py-2",
513
- chipClassName: D("!px-2", r)
514
- })), ke = { button: "_button_vjird_1" }, Ae = k(({ label: e, onClick: t, labelClassName: r = "dial-small-semi-text", colors: a, className: o }) => /* @__PURE__ */ I("div", {
515
- className: "px-3 py-2",
516
- style: n({
517
- "--cp-new-chat-bg": a?.background,
518
- "--cp-new-chat-text": a?.text,
519
- "--cp-new-chat-focus-outline": a?.focusOutline
520
- }),
521
- children: /* @__PURE__ */ I(d, {
522
- label: e,
523
- textClassName: r,
524
- iconBefore: /* @__PURE__ */ I(ae, {
525
- size: 18,
526
- stroke: m,
527
- className: "shrink-0",
528
- "aria-hidden": !0
529
- }),
530
- onClick: t,
531
- className: i("h-[36px] w-full gap-2 px-3 py-1 shadow-chat-button hover:shadow-xs focus-visible:shadow-xs active:shadow-xs", ke.button, o, se.newChatButton)
532
- })
533
- })), Z = {
490
+ }, $ = {
534
491
  skeletonColor: "var(--cp-skeleton-color, var(--bg-control-disable-primary, #dce0e8))",
535
- item: "_item_j0zft_2",
536
- itemActive: "_itemActive_j0zft_15",
537
- groupHeader: "_groupHeader_j0zft_20",
538
- dropZoneActive: "_dropZoneActive_j0zft_24",
539
- triggerActive: "_triggerActive_j0zft_29",
540
- triggerIcon: "_triggerIcon_j0zft_32",
541
- unreadDot: "_unreadDot_j0zft_40",
542
- search: "_search_j0zft_48"
543
- }, je = ({ label: e, isExpanded: t, onToggle: n, listId: r, className: a = "dial-tiny-lead-text", dropZoneGroupKey: o, isDragOver: s, onDragOver: c, onDragLeave: l, onDrop: u }) => {
544
- let d = o != null;
545
- return /* @__PURE__ */ re("button", {
492
+ item: "_item_gcqru_2",
493
+ itemActive: "_itemActive_gcqru_15",
494
+ itemIndicator: "_itemIndicator_gcqru_24",
495
+ indicatorDot: "_indicatorDot_gcqru_28",
496
+ groupHeader: "_groupHeader_gcqru_32",
497
+ dropZoneActive: "_dropZoneActive_gcqru_36",
498
+ triggerActive: "_triggerActive_gcqru_40",
499
+ triggerIcon: "_triggerIcon_gcqru_43",
500
+ unreadDot: "_unreadDot_gcqru_51",
501
+ search: "_search_gcqru_59",
502
+ list: "_list_gcqru_70"
503
+ }, Pe = ({ label: e, isExpanded: t, onToggle: n, listId: r, className: a = "dial-tiny-lead-text", variant: o = Z.Avatar, dropZoneGroupKey: s, isDragOver: c, onDragOver: l, onDragLeave: u, onDrop: d }) => {
504
+ let f = s != null, h = o === Z.Indicator;
505
+ return /* @__PURE__ */ V("button", {
546
506
  type: "button",
547
507
  "aria-expanded": t,
548
508
  "aria-controls": r,
549
509
  onClick: n,
550
- onDragOver: d ? (e) => {
551
- d && (e.preventDefault(), c?.(o));
510
+ onDragOver: f ? (e) => {
511
+ f && (e.preventDefault(), l?.(s));
552
512
  } : void 0,
553
- onDragLeave: d ? (e) => {
554
- d && (e.currentTarget.contains(e.relatedTarget) || l?.());
513
+ onDragLeave: f ? (e) => {
514
+ f && (e.currentTarget.contains(e.relatedTarget) || u?.());
555
515
  } : void 0,
556
- onDrop: d ? (e) => {
557
- d && (e.preventDefault(), u?.(o, o, null));
516
+ onDrop: f ? (e) => {
517
+ f && (e.preventDefault(), d?.(s, s, null));
558
518
  } : void 0,
559
- className: i("group flex h-6 w-full items-center gap-1 rounded py-1 pe-3 text-start", a, Z.groupHeader, s && Z.dropZoneActive),
560
- children: [t ? /* @__PURE__ */ I(L, {
561
- size: 12,
562
- className: "shrink-0 opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-visible:opacity-100",
563
- "aria-hidden": !0
564
- }) : /* @__PURE__ */ I(R, {
565
- size: 12,
566
- className: "shrink-0 opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-visible:opacity-100 rtl:scale-x-[-1]",
567
- "aria-hidden": !0
568
- }), /* @__PURE__ */ I(_, { text: e })]
519
+ className: i("group flex h-6 w-full items-center gap-1 rounded text-start", h ? "px-2" : "py-1 pe-3", a, $.groupHeader, c && $.dropZoneActive),
520
+ children: [
521
+ !h && (t ? /* @__PURE__ */ B(ee, {
522
+ size: 12,
523
+ className: "shrink-0 opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-visible:opacity-100",
524
+ "aria-hidden": !0
525
+ }) : /* @__PURE__ */ B(H, {
526
+ size: 12,
527
+ className: "shrink-0 opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-visible:opacity-100 rtl:scale-x-[-1]",
528
+ "aria-hidden": !0
529
+ })),
530
+ h ? /* @__PURE__ */ B("span", {
531
+ className: "max-w-full min-w-0",
532
+ children: /* @__PURE__ */ B(_, { text: e })
533
+ }) : /* @__PURE__ */ B(_, { text: e }),
534
+ h && (t ? /* @__PURE__ */ B(te, {
535
+ size: p.SM,
536
+ stroke: m,
537
+ className: "shrink-0 opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-visible:opacity-100",
538
+ "aria-hidden": !0
539
+ }) : /* @__PURE__ */ B(ne, {
540
+ size: p.SM,
541
+ stroke: m,
542
+ className: "shrink-0 opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-visible:opacity-100 rtl:scale-x-[-1]",
543
+ "aria-hidden": !0
544
+ }))
545
+ ]
569
546
  });
570
- }, Me = k(({ item: t, isActive: n, onSelectConversation: r, searchQuery: a = "", getActions: o, onActionMenuOpen: s, actionsLabel: c = "More actions", itemTitleClassName: l = "dial-small-text", itemIconBadgeClassName: u, unreadIndicatorLabel: f = "Unread", rowGroupKey: _, rows: v, draggingId: x, dragOverId: S, allowedDropGroups: C, onDragStart: w, onDragEnd: E, onDragOver: D, onDragLeave: O, onDrop: k }) => {
571
- let [j, te] = F(!1), M = P(null), ne = A((e) => {
572
- te(e), e && M.current && s?.(t, M.current);
573
- }, [t, s]), L = N(() => o?.(t) ?? [], [o, t]), R = L.length > 0, ae = N(() => ({ tooltip: t.iconTooltip }), [t.iconTooltip]), oe = N(() => ({ badgeClassName: u }), [u]), se = t.leadingIcon ? /* @__PURE__ */ I("span", {
547
+ }, Fe = j(({ item: t, isActive: n, onSelectConversation: r, searchQuery: a = "", getActions: o, onActionMenuOpen: s, actionsLabel: c = "More actions", itemTitleClassName: l = "dial-small-text", itemIconBadgeClassName: u, unreadIndicatorLabel: f = "Unread", variant: _ = Z.Avatar, rowGroupKey: v, rows: x, draggingId: S, dragOverId: C, allowedDropGroups: w, onDragStart: T, onDragEnd: O, onDragOver: k, onDragLeave: A, onDrop: j }) => {
548
+ let [N, P] = z(!1), F = R(null), I = M((e) => {
549
+ P(e), e && F.current && s?.(t, F.current);
550
+ }, [t, s]), ee = L(() => o?.(t) ?? [], [o, t]), H = ee.length > 0, te = L(() => ({ tooltip: t.iconTooltip }), [t.iconTooltip]), ne = L(() => ({ badgeClassName: u }), [u]), U = _ === Z.Indicator, ie = t.leadingIcon ? /* @__PURE__ */ B("span", {
574
551
  className: "flex size-6 shrink-0 items-center justify-center",
575
552
  children: t.leadingIcon
576
- }) : t.isIconLoading ? /* @__PURE__ */ I(T, {
577
- variant: ee.Circular,
553
+ }) : t.isIconLoading ? /* @__PURE__ */ B(E, {
554
+ variant: D.Circular,
578
555
  width: p.LG,
579
556
  height: p.LG,
580
- color: Z.skeletonColor,
557
+ color: $.skeletonColor,
581
558
  "aria-hidden": !0
582
- }) : /* @__PURE__ */ I(e, {
559
+ }) : /* @__PURE__ */ B(e, {
583
560
  src: t.iconUrl,
584
561
  size: p.LG,
585
562
  initialsName: t.iconTooltip ?? "",
586
- labels: ae,
587
- styles: oe
588
- }), z = ye(R, j), ce = t.isUnread ? /* @__PURE__ */ re("span", {
563
+ labels: te,
564
+ styles: ne
565
+ }), ae = Ee(H, N), oe = /* @__PURE__ */ V("span", {
589
566
  className: "flex size-6 shrink-0 items-center justify-center",
590
- children: [/* @__PURE__ */ I("span", {
591
- className: i("size-[7.11px] rounded-full", Z.unreadDot, R && (j ? "opacity-0" : "group-focus-within/conversation:opacity-0 group-hover/conversation:opacity-0")),
567
+ children: [/* @__PURE__ */ B("span", {
568
+ className: i("size-2 rounded-full", t.isUnread ? i("size-[7.11px]", $.unreadDot) : $.indicatorDot),
592
569
  "aria-hidden": !0
593
- }), /* @__PURE__ */ I("span", {
570
+ }), t.isUnread && /* @__PURE__ */ B("span", {
594
571
  className: "sr-only",
595
572
  children: f
596
573
  })]
597
- }) : void 0, B = _ != null, le = A((e) => {
598
- e.currentTarget.contains(e.relatedTarget) || O?.();
599
- }, [O]), V = A((e) => {
600
- if (!_ || !v || !k) return;
574
+ }), se = t.isUnread && !U ? /* @__PURE__ */ V("span", {
575
+ className: "flex size-6 shrink-0 items-center justify-center",
576
+ children: [/* @__PURE__ */ B("span", {
577
+ className: i("size-[7.11px] rounded-full", $.unreadDot, H && (N ? "opacity-0" : "group-focus-within/conversation:opacity-0 group-hover/conversation:opacity-0")),
578
+ "aria-hidden": !0
579
+ }), /* @__PURE__ */ B("span", {
580
+ className: "sr-only",
581
+ children: f
582
+ })]
583
+ }) : void 0, W = v != null, G = M((e) => {
584
+ e.currentTarget.contains(e.relatedTarget) || A?.();
585
+ }, [A]), K = M((e) => {
586
+ if (!v || !x || !j) return;
601
587
  e.preventDefault();
602
- let n = Ee(e, t.id, v, _);
603
- k(t.id, _, n);
588
+ let n = Ne(e, t.id, x, v);
589
+ j(t.id, v, n);
604
590
  }, [
605
591
  t.id,
592
+ x,
606
593
  v,
607
- _,
608
- k
609
- ]), H = t.id === x, U = t.id === S, W = _ != null && (C?.has(_) ?? !1), G = x != null;
610
- return /* @__PURE__ */ re("li", {
611
- className: i("group/conversation relative", H && "cursor-grabbing opacity-50", U && W && "rounded", U && W && Z.dropZoneActive, G && !H && !W && "cursor-not-allowed"),
612
- draggable: B || void 0,
613
- onDragStart: B ? () => w?.(t.id) : void 0,
614
- onDragEnd: B ? E : void 0,
615
- onDragOver: B ? (e) => {
616
- e.preventDefault(), D?.(t.id);
594
+ j
595
+ ]), ce = t.id === S, le = t.id === C, q = v != null && (w?.has(v) ?? !1), ue = S != null;
596
+ return /* @__PURE__ */ V("li", {
597
+ className: i("group/conversation relative", ce && "cursor-grabbing opacity-50", le && q && "rounded", le && q && $.dropZoneActive, ue && !ce && !q && "cursor-not-allowed"),
598
+ draggable: W || void 0,
599
+ onDragStart: W ? () => T?.(t.id) : void 0,
600
+ onDragEnd: W ? O : void 0,
601
+ onDragOver: W ? (e) => {
602
+ e.preventDefault(), k?.(t.id);
617
603
  } : void 0,
618
- onDragLeave: B ? le : void 0,
619
- onDrop: B ? V : void 0,
620
- children: [/* @__PURE__ */ I("a", {
604
+ onDragLeave: W ? G : void 0,
605
+ onDrop: W ? K : void 0,
606
+ children: [/* @__PURE__ */ B("a", {
621
607
  href: t.href,
622
608
  className: "contents",
623
609
  onClick: (e) => {
624
610
  t.href && (e.preventDefault(), r(t.id));
625
611
  },
626
- children: /* @__PURE__ */ I(d, {
627
- iconBefore: se,
628
- label: /* @__PURE__ */ I(b, {
612
+ children: /* @__PURE__ */ B(d, {
613
+ iconBefore: U ? oe : ie,
614
+ label: /* @__PURE__ */ B(b, {
629
615
  text: t.title,
630
616
  query: a,
631
617
  className: t.isUnread ? "dial-small-semi-text" : l,
632
618
  maxLines: 1
633
619
  }),
634
- iconAfter: ce,
620
+ iconAfter: se,
635
621
  textClassName: "min-w-0 flex-1",
636
622
  "aria-current": n ? "page" : void 0,
637
623
  onClick: t.href ? void 0 : () => r(t.id),
638
624
  tabIndex: t.href ? -1 : void 0,
639
- className: i("h-8 w-full justify-start gap-2 py-2 ps-3 after:pointer-events-none", z, Z.item, n && Z.itemActive, j && Z.itemActive)
625
+ className: i("h-8 w-full justify-start py-2 after:pointer-events-none", U ? "gap-0.5 ps-0" : "gap-2 ps-3", ae, $.item, U && $.itemIndicator, n && $.itemActive, N && $.itemActive)
640
626
  })
641
- }), R && /* @__PURE__ */ I("div", {
642
- className: i("absolute inset-y-0 end-1 flex items-center", j ? "opacity-100" : "opacity-0 group-focus-within/conversation:opacity-100 group-hover/conversation:opacity-100"),
643
- children: /* @__PURE__ */ I(h, {
644
- items: L,
645
- onOpenChange: ne,
627
+ }), H && /* @__PURE__ */ B("div", {
628
+ className: i("absolute inset-y-0 flex items-center", U ? "end-2" : "end-1", N ? "opacity-100" : "opacity-0 group-focus-within/conversation:opacity-100 group-hover/conversation:opacity-100"),
629
+ children: /* @__PURE__ */ B(h, {
630
+ items: ee,
631
+ onOpenChange: I,
646
632
  matchReferenceWidth: !1,
647
633
  listClassName: "w-[200px]",
648
- children: /* @__PURE__ */ I(y, {
649
- ref: M,
650
- icon: /* @__PURE__ */ I(ie, {
651
- size: p.MD,
652
- className: Z.triggerIcon,
634
+ children: /* @__PURE__ */ B(y, {
635
+ ref: F,
636
+ icon: /* @__PURE__ */ B(re, {
637
+ size: U ? p.SM : p.MD,
638
+ className: $.triggerIcon,
653
639
  "aria-hidden": !0,
654
640
  stroke: m
655
641
  }),
656
642
  size: g.Small,
657
643
  "aria-label": c,
658
- className: i(j && Z.triggerActive)
644
+ className: i(U && "!size-6 !min-h-0 !min-w-0 !p-1", N && $.triggerActive)
659
645
  })
660
646
  })
661
647
  })]
662
648
  });
663
- }), Ne = ({ index: e, style: n, rows: r, expandedGroups: i, onToggleGroup: a, listId: o, activeConversationId: s, searchQuery: c, onSelectConversation: l, getActions: u, onActionMenuOpen: d, actionsLabel: f, unreadIndicatorLabel: p, styles: m, draggingId: h, dragOverId: g, allowedDropGroups: _, onDragStart: v, onDragEnd: y, onDragOver: b, onDragLeave: x, onDrop: S }) => {
664
- let C = r[e];
665
- if (C.kind === X.Header) {
666
- let r = C.groupKey === t.Pinned;
667
- return /* @__PURE__ */ I("div", {
668
- role: "presentation",
649
+ }), Ie = (e, t) => t ? e === 0 ? "pt-2" : "pt-4" : e === 0 ? "pt-0" : "pt-8", Le = ({ index: e, style: n, 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 = Z.Avatar, draggingId: g, dragOverId: _, allowedDropGroups: v, onDragStart: y, onDragEnd: b, onDragOver: x, onDragLeave: S, onDrop: C }) => {
650
+ let w = r[e], T = h === Z.Indicator;
651
+ if (w.kind === Q.Header) {
652
+ let r = w.groupKey === t.Pinned;
653
+ return /* @__PURE__ */ B("div", {
654
+ role: "listitem",
669
655
  style: n,
670
- className: e === 0 ? "pt-0" : "pt-8",
671
- children: /* @__PURE__ */ I(je, {
672
- label: C.label,
673
- isExpanded: i.has(C.groupKey),
674
- onToggle: () => a(C.groupKey),
656
+ className: Ie(e, T),
657
+ children: /* @__PURE__ */ B(Pe, {
658
+ variant: h,
659
+ label: w.label,
660
+ isExpanded: i.has(w.groupKey),
661
+ onToggle: () => a(w.groupKey),
675
662
  listId: o,
676
663
  className: m?.groupHeaderClassName,
677
664
  dropZoneGroupKey: r ? t.Pinned : void 0,
678
- isDragOver: r && g === t.Pinned,
679
- onDragOver: r ? b : void 0,
680
- onDragLeave: r ? x : void 0,
681
- onDrop: r ? S : void 0
665
+ isDragOver: r && _ === t.Pinned,
666
+ onDragOver: r ? x : void 0,
667
+ onDragLeave: r ? S : void 0,
668
+ onDrop: r ? C : void 0
682
669
  })
683
670
  });
684
671
  }
685
- return /* @__PURE__ */ I("div", {
672
+ return /* @__PURE__ */ B("div", {
686
673
  role: "presentation",
687
674
  style: n,
688
- className: "pt-1",
689
- children: /* @__PURE__ */ I(Me, {
690
- item: C.item,
691
- isActive: C.item.id === s,
675
+ className: T ? "pt-0.5" : "pt-1",
676
+ children: /* @__PURE__ */ B(Fe, {
677
+ variant: h,
678
+ item: w.item,
679
+ isActive: w.item.id === s,
692
680
  searchQuery: c,
693
681
  onSelectConversation: l,
694
682
  getActions: u,
@@ -697,299 +685,590 @@ var X = /* @__PURE__ */ function(e) {
697
685
  unreadIndicatorLabel: p,
698
686
  itemTitleClassName: m?.itemTitleClassName,
699
687
  itemIconBadgeClassName: m?.itemIconBadgeClassName,
700
- rowGroupKey: C.groupKey,
688
+ rowGroupKey: w.groupKey,
701
689
  rows: r,
702
- draggingId: h,
703
- dragOverId: g,
704
- allowedDropGroups: _,
705
- onDragStart: v,
706
- onDragEnd: y,
707
- onDragOver: b,
708
- onDragLeave: x,
709
- onDrop: S
690
+ draggingId: g,
691
+ dragOverId: _,
692
+ allowedDropGroups: v,
693
+ onDragStart: y,
694
+ onDragEnd: b,
695
+ onDragOver: x,
696
+ onDragLeave: S,
697
+ onDrop: C
710
698
  })
711
699
  });
712
- }, Pe = (e, n) => n === t.All ? !0 : e.source === n, Fe = (e, t) => t ? e.title.toLowerCase().includes(t.toLowerCase()) : !0, Ie = new Set([
700
+ }, Re = /* @__PURE__ */ new Set([
713
701
  t.Pinned,
714
702
  t.MyChats,
715
703
  t.Shared,
716
704
  t.Organization
717
- ]), Le = k(({ conversations: e, isLoading: r, isOpen: a, onSelectConversation: o, activeConversationId: d, 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: ee = !1, hiddenSources: E }) => {
718
- let { colors: D, typography: O, newChatButton: k, searchWrapperClassName: M, headerClassName: ne, headerActionsClassName: L, newChatButtonClassName: R } = m ?? {}, { title: ie, emptyLabel: ae, noResultsLabel: oe, loadingLabel: z = "Loading conversations", newChatLabel: ce, searchPlaceholder: B, searchClearLabel: le, filterLabels: V, groupLabels: H, actionsLabel: U, unreadIndicatorLabel: W, closeAriaLabel: G } = f, [K, ue] = F(""), [q, de] = F(t.All);
719
- j(() => {
720
- S != null && de(S);
721
- }, [S]);
722
- let J = N(() => E?.length ? e.filter((e) => e.source == null || !E.includes(e.source)) : e, [e, E]), [Y, fe] = F(() => Ie), [pe, me] = F(5), he = te(), ge = P(null), ye = P(null), [xe, Ce] = F(null), [Ee, De] = F(null), [ke, je] = F(null), Me = P(null), Le = P(null), Re = A(({ height: e }) => {
723
- me(Se(e));
724
- }, []), ze = A((e) => {
725
- ue(e ?? "");
726
- }, []), Be = A((e) => {
727
- fe((t) => {
705
+ ]), ze = j(({ conversations: e, isLoading: r, onSelectConversation: a, activeConversationId: o, labels: l, searchQuery: u = "", activeFilter: d = t.All, hiddenSources: f, rowVariant: p, getActions: m, onActionMenuOpen: h, onMoveConversation: g, styles: _, id: v, className: y }) => {
706
+ let { colors: b, typography: x, itemIconBadgeClassName: S } = _ ?? {}, { emptyLabel: C, noResultsLabel: w, loadingLabel: T = "Loading conversations", groupLabels: D, actionsLabel: O, unreadIndicatorLabel: k } = l, A = L(() => f?.length ? e.filter((e) => e.source == null || !f.includes(e.source)) : e, [e, f]), [j, F] = z(() => Re), [I, ee] = z(5), H = P(), te = R(null), ne = R(null), [re, U] = z(null), [ie, ae] = z(null), [oe, se] = z(null), G = R(null), K = R(null), ce = M(({ height: e }) => {
707
+ ee(ke(e));
708
+ }, []), le = M((e) => {
709
+ F((t) => {
728
710
  let n = new Set(t);
729
711
  return n.has(e) ? n.delete(e) : n.add(e), n;
730
712
  });
731
- }, []), Ve = A(() => {
732
- Me.current = null, Le.current = null, Ce(null), De(null), je(null);
733
- }, []), He = A((e, t) => {
734
- let n = Te(e, we(t, e), J);
735
- Me.current = e, Le.current = n, Ce(e), je(n);
736
- }, [J]), Ue = A(() => {
737
- Ve();
738
- }, [Ve]), We = A((e) => {
739
- De(e);
740
- }, []), Ge = A(() => {
741
- De(null);
742
- }, []), Ke = A((e, t, n) => {
743
- let r = Me.current, i = Le.current;
744
- Ve(), r != null && r !== e && i?.has(t) && x?.({
713
+ }, []), q = M(() => {
714
+ G.current = null, K.current = null, U(null), ae(null), se(null);
715
+ }, []), ue = M((e, t) => {
716
+ let n = Me(e, je(t, e), A);
717
+ G.current = e, K.current = n, U(e), se(n);
718
+ }, [A]), de = M(() => {
719
+ q();
720
+ }, [q]), J = M((e) => {
721
+ ae(e);
722
+ }, []), fe = M(() => {
723
+ ae(null);
724
+ }, []), pe = M((e, t, n) => {
725
+ let r = G.current, i = K.current;
726
+ q(), r != null && r !== e && i?.has(t) && g?.({
745
727
  draggedId: r,
746
728
  targetGroupKey: t,
747
729
  afterId: n
748
730
  });
749
- }, [Ve, x]), qe = n({
750
- "--cp-item-hover": D?.itemHover,
751
- "--cp-item-active": D?.itemActive,
752
- "--cp-text": D?.text,
753
- "--cp-text-secondary": D?.textSecondary,
754
- "--cp-new-chat-bg": k?.background,
755
- "--cp-new-chat-text": k?.text,
756
- "--cp-new-chat-focus-outline": k?.focusOutline,
757
- "--cp-drop-zone-ring": D?.dropZoneRing,
758
- "--cp-trigger-bg": D?.triggerBackground,
759
- "--cp-trigger-icon": D?.triggerIcon,
760
- "--cp-trigger-icon-idle": D?.triggerIconIdle,
761
- "--cp-skeleton-color": D?.skeletonColor,
762
- "--cp-unread-dot": D?.unreadDot
763
- }), Q = N(() => J.filter((e) => Pe(e, q) && Fe(e, K)), [
764
- J,
765
- q,
766
- K
767
- ]), Je = N(() => Q.filter((e) => e.isPinned), [Q]), Ye = N(() => Q.filter((e) => !e.isPinned && e.source !== t.Shared && e.source !== t.Organization), [Q]), Xe = N(() => Q.filter((e) => !e.isPinned && e.source === t.Shared), [Q]), Ze = N(() => Q.filter((e) => !e.isPinned && e.source === t.Organization), [Q]), Qe = N(() => [
731
+ }, [q, g]), me = n({
732
+ "--cp-item-hover": b?.itemHover,
733
+ "--cp-item-active": b?.itemActive,
734
+ "--cp-text": b?.text,
735
+ "--cp-text-secondary": b?.textSecondary,
736
+ "--cp-drop-zone-ring": b?.dropZoneRing,
737
+ "--cp-trigger-bg": b?.triggerBackground,
738
+ "--cp-trigger-icon": b?.triggerIcon,
739
+ "--cp-trigger-icon-idle": b?.triggerIconIdle,
740
+ "--cp-skeleton-color": b?.skeletonColor,
741
+ "--cp-unread-dot": b?.unreadDot,
742
+ "--cp-indicator-dot": b?.indicatorDot,
743
+ "--cp-list-font-family": x?.fontFamily
744
+ }), Y = L(() => A.filter((e) => Ce(e, d) && we(e, u)), [
745
+ A,
746
+ d,
747
+ u
748
+ ]), he = L(() => Y.filter((e) => e.isPinned), [Y]), ge = L(() => Y.filter((e) => !e.isPinned && e.source !== t.Shared && e.source !== t.Organization), [Y]), _e = L(() => Y.filter((e) => !e.isPinned && e.source === t.Shared), [Y]), ve = L(() => Y.filter((e) => !e.isPinned && e.source === t.Organization), [Y]), ye = L(() => [
768
749
  {
769
750
  key: t.Pinned,
770
- label: H?.pinned ?? "Pinned",
771
- items: Je
751
+ label: D?.pinned ?? "Pinned",
752
+ items: he
772
753
  },
773
754
  {
774
755
  key: t.MyChats,
775
- label: H?.myChats ?? "My chats",
776
- items: Ye
756
+ label: D?.myChats ?? "My chats",
757
+ items: ge
777
758
  },
778
759
  {
779
760
  key: t.Shared,
780
- label: H?.shared ?? "Shared",
781
- items: Xe
761
+ label: D?.shared ?? "Shared",
762
+ items: _e
782
763
  },
783
764
  {
784
765
  key: t.Organization,
785
- label: H?.organization ?? "Organization",
786
- items: Ze
766
+ label: D?.organization ?? "Organization",
767
+ items: ve
787
768
  }
788
769
  ], [
789
- H,
790
- Je,
791
- Ye,
792
- Xe,
793
- Ze
794
- ]), $ = N(() => {
770
+ D,
771
+ he,
772
+ ge,
773
+ _e,
774
+ ve
775
+ ]), X = L(() => {
795
776
  let e = [];
796
- for (let t of Qe) if (t.items.length !== 0 && (e.push({
797
- kind: X.Header,
777
+ for (let t of ye) if (t.items.length !== 0 && (e.push({
778
+ kind: Q.Header,
798
779
  groupKey: t.key,
799
780
  label: t.label
800
- }), Y.has(t.key))) for (let n of t.items) e.push({
801
- kind: X.Item,
781
+ }), j.has(t.key))) for (let n of t.items) e.push({
782
+ kind: Q.Item,
802
783
  item: n,
803
784
  groupKey: t.key
804
785
  });
805
786
  return e;
806
- }, [Qe, Y]);
807
- j(() => {
808
- if (!d || ye.current === d) return;
809
- let e = $.findIndex((e) => e.kind === X.Item && e.item.id === d);
810
- e >= 0 && (ge.current?.scrollToRow({
787
+ }, [ye, j]);
788
+ N(() => {
789
+ if (!o || ne.current === o) return;
790
+ let e = X.findIndex((e) => e.kind === Q.Item && e.item.id === o);
791
+ e >= 0 && (te.current?.scrollToRow({
811
792
  index: e,
812
793
  align: "smart",
813
794
  behavior: "smooth"
814
- }), ye.current = d);
795
+ }), ne.current = o);
815
796
  }, [
816
- d,
817
- Qe,
818
- Y,
819
- $
797
+ o,
798
+ ye,
799
+ j,
800
+ X
820
801
  ]);
821
- let $e = P($);
822
- j(() => {
823
- $e.current = $;
824
- }, [$]);
825
- let et = A((e) => He(e, $e.current), [He]), tt = N(() => ({
826
- rows: $,
827
- expandedGroups: Y,
828
- onToggleGroup: Be,
829
- listId: he,
830
- activeConversationId: d,
831
- searchQuery: K,
832
- onSelectConversation: o,
833
- getActions: _,
834
- onActionMenuOpen: v,
835
- actionsLabel: U,
836
- unreadIndicatorLabel: W,
802
+ let be = R(X);
803
+ N(() => {
804
+ be.current = X;
805
+ }, [X]);
806
+ let xe = M((e) => ue(e, be.current), [ue]), Ee = L(() => ({
807
+ rows: X,
808
+ expandedGroups: j,
809
+ onToggleGroup: le,
810
+ listId: H,
811
+ activeConversationId: o,
812
+ searchQuery: u,
813
+ onSelectConversation: a,
814
+ getActions: m,
815
+ onActionMenuOpen: h,
816
+ actionsLabel: O,
817
+ unreadIndicatorLabel: k,
818
+ rowVariant: p,
837
819
  styles: {
838
- groupHeaderClassName: O?.groupHeaderClassName,
839
- itemTitleClassName: O?.itemTitleClassName,
840
- itemIconBadgeClassName: m?.itemIconBadgeClassName
820
+ groupHeaderClassName: x?.groupHeaderClassName,
821
+ itemTitleClassName: x?.itemTitleClassName,
822
+ itemIconBadgeClassName: S
841
823
  },
842
- draggingId: xe,
843
- dragOverId: Ee,
844
- allowedDropGroups: ke,
845
- onDragStart: et,
846
- onDragEnd: Ue,
847
- onDragOver: We,
848
- onDragLeave: Ge,
849
- onDrop: Ke
824
+ draggingId: re,
825
+ dragOverId: ie,
826
+ allowedDropGroups: oe,
827
+ onDragStart: xe,
828
+ onDragEnd: de,
829
+ onDragOver: J,
830
+ onDragLeave: fe,
831
+ onDrop: pe
850
832
  }), [
851
- $,
852
- Y,
853
- Be,
854
- he,
855
- d,
856
- K,
833
+ X,
834
+ j,
835
+ le,
836
+ H,
857
837
  o,
838
+ u,
839
+ a,
840
+ m,
841
+ h,
842
+ O,
843
+ k,
844
+ p,
845
+ x?.groupHeaderClassName,
846
+ x?.itemTitleClassName,
847
+ S,
848
+ re,
849
+ ie,
850
+ oe,
851
+ xe,
852
+ de,
853
+ J,
854
+ fe,
855
+ pe
856
+ ]), Oe = A.length === 0, Ae = A.length > 0 && Y.length === 0;
857
+ return /* @__PURE__ */ V("div", {
858
+ id: v,
859
+ style: me,
860
+ className: i("flex-1 overflow-hidden px-3", $.list, x?.fontClassName, p !== Z.Indicator && "py-1", y, W.list),
861
+ children: [/* @__PURE__ */ B("span", {
862
+ role: "status",
863
+ "aria-live": "polite",
864
+ className: "sr-only",
865
+ children: r ? T : Oe ? C : Ae ? w : ""
866
+ }), r ? /* @__PURE__ */ B("div", {
867
+ className: "flex flex-col gap-3 px-2 py-3",
868
+ children: Array.from({ length: 15 }, (e, t) => /* @__PURE__ */ B(E, {
869
+ avatar: { size: 24 },
870
+ showTitle: { width: Te(t) },
871
+ paragraph: !1,
872
+ active: !0,
873
+ color: $.skeletonColor
874
+ }, t))
875
+ }) : Oe ? /* @__PURE__ */ B(s, { label: C }) : Ae ? /* @__PURE__ */ B(c, { label: w }) : /* @__PURE__ */ B(Se, {
876
+ listRef: te,
877
+ id: H,
878
+ role: "list",
879
+ style: { height: "100%" },
880
+ rowComponent: Le,
881
+ rowCount: X.length,
882
+ rowHeight: De,
883
+ overscanCount: I,
884
+ onResize: ce,
885
+ rowProps: Ee
886
+ })]
887
+ });
888
+ }), Be = { title: "_title_ewicn_2" }, Ve = "!size-6 !min-h-0 !min-w-0 !p-1", He = [
889
+ {
890
+ value: t.All,
891
+ labelKey: "all"
892
+ },
893
+ {
894
+ value: t.MyChats,
895
+ labelKey: "myChats"
896
+ },
897
+ {
898
+ value: t.Shared,
899
+ labelKey: "shared"
900
+ },
901
+ {
902
+ value: t.Organization,
903
+ labelKey: "organization"
904
+ }
905
+ ], Ue = j(({ labels: e, isExpanded: r = !0, onToggleExpanded: a, controlsId: o, searchQuery: s = "", isSearchOpen: c = !1, onSearchChange: l, onSearchOpenChange: u, activeFilter: d = t.All, onFilterChange: f, hiddenSources: _, actions: v, styles: b, className: x }) => {
906
+ let C = b?.typography?.titleClassName ?? "dial-tiny-lead-semi-text", w = b?.typography?.searchTextClassName ?? "dial-tiny-text", E = R(null), D = R(null), O = R(c), k = e.filterLabels.groupAriaLabel ?? "Filter chats", A = l != null && u != null;
907
+ N(() => {
908
+ c ? D.current?.focus() : O.current && E.current?.focus(), O.current = c;
909
+ }, [c]);
910
+ let j = M(() => {
911
+ u?.(!0);
912
+ }, [u]), P = M(() => {
913
+ l?.(""), u?.(!1);
914
+ }, [l, u]), F = M((e) => {
915
+ l?.(e ?? "");
916
+ }, [l]), I = M((e) => {
917
+ e.key === "Escape" && (e.stopPropagation(), P());
918
+ }, [P]), z = L(() => He.filter(({ value: e }) => !_?.includes(e)).map(({ value: t, labelKey: n }) => ({
919
+ key: t,
920
+ label: e.filterLabels[n],
921
+ mark: S.Check,
922
+ checked: t === d,
923
+ onClick: () => f?.(t)
924
+ })), [
858
925
  _,
859
- v,
926
+ e.filterLabels,
927
+ d,
928
+ f
929
+ ]), ee = L(() => n({
930
+ "--cp-list-header-title": b?.colors?.title,
931
+ "--cp-list-header-title-focus": b?.colors?.titleFocus
932
+ }), [b?.colors?.title, b?.colors?.titleFocus]), H = (e) => i("flex min-h-6 items-center justify-between ps-2", e, x, W.listHeader);
933
+ if (A && c) return /* @__PURE__ */ V("div", {
934
+ role: "search",
935
+ style: ee,
936
+ className: H("gap-2"),
937
+ onKeyDown: I,
938
+ children: [/* @__PURE__ */ B(T, {
939
+ containerClassName: "min-w-0 flex-1",
940
+ wrapperClassName: i("!h-6 !min-h-0 !py-1 !pe-2 [&_svg]:!size-4", w),
941
+ inputRef: D,
942
+ value: s,
943
+ onChange: F,
944
+ placeholder: e.searchPlaceholder,
945
+ clearLabel: e.searchClearLabel,
946
+ "aria-label": e.searchPlaceholder
947
+ }), /* @__PURE__ */ B(y, {
948
+ icon: /* @__PURE__ */ B(se, {
949
+ size: p.SM,
950
+ stroke: m,
951
+ "aria-hidden": !0
952
+ }),
953
+ size: g.Small,
954
+ className: Ve,
955
+ "aria-label": e.searchCloseLabel,
956
+ onClick: P
957
+ })]
958
+ });
959
+ let re = /* @__PURE__ */ B("span", {
960
+ className: C,
961
+ children: e.title
962
+ });
963
+ return /* @__PURE__ */ V("div", {
964
+ style: ee,
965
+ className: H(),
966
+ children: [a ? /* @__PURE__ */ V("button", {
967
+ type: "button",
968
+ "aria-expanded": r,
969
+ "aria-controls": o,
970
+ onClick: a,
971
+ className: i("group flex items-center gap-1 rounded", Be.title),
972
+ children: [re, r ? /* @__PURE__ */ B(te, {
973
+ size: p.SM,
974
+ stroke: m,
975
+ className: "opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100",
976
+ "aria-hidden": !0
977
+ }) : /* @__PURE__ */ B(ne, {
978
+ size: p.SM,
979
+ stroke: m,
980
+ className: "opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100 rtl:scale-x-[-1]",
981
+ "aria-hidden": !0
982
+ })]
983
+ }) : /* @__PURE__ */ B("span", {
984
+ className: Be.title,
985
+ children: re
986
+ }), /* @__PURE__ */ V("div", {
987
+ className: "flex items-center gap-2",
988
+ children: [
989
+ A && /* @__PURE__ */ B(y, {
990
+ ref: E,
991
+ icon: /* @__PURE__ */ B(ae, {
992
+ size: p.SM,
993
+ stroke: m,
994
+ "aria-hidden": !0
995
+ }),
996
+ size: g.Small,
997
+ className: Ve,
998
+ "aria-label": e.searchOpenLabel,
999
+ onClick: j
1000
+ }),
1001
+ f && /* @__PURE__ */ B(h, {
1002
+ items: z,
1003
+ placement: "bottom-end",
1004
+ matchReferenceWidth: !1,
1005
+ children: /* @__PURE__ */ B(y, {
1006
+ icon: /* @__PURE__ */ B(U, {
1007
+ size: p.SM,
1008
+ stroke: m,
1009
+ "aria-hidden": !0
1010
+ }),
1011
+ size: g.Small,
1012
+ className: Ve,
1013
+ "aria-label": k
1014
+ })
1015
+ }),
1016
+ v
1017
+ ]
1018
+ })]
1019
+ });
1020
+ }), We = j(({ conversations: e, isLoading: n, onSelectConversation: r, activeConversationId: a, labels: o, requestedFilter: s, isFilterHidden: c = !1, onFilterChange: l, hiddenSources: u, headerActions: d, getActions: f, onActionMenuOpen: p, onMoveConversation: m, styles: h, listClassName: g, className: _ }) => {
1021
+ let v = P(), [y, b] = z(""), [x, S] = z(!1), [C, w] = z(!0), [T, E] = z(t.All);
1022
+ N(() => {
1023
+ s != null && E(s);
1024
+ }, [s]);
1025
+ let D = M((e) => {
1026
+ E(e), l?.(e);
1027
+ }, [l]), O = M((e) => {
1028
+ b(e), e !== "" && w(!0);
1029
+ }, []), k = M((e) => {
1030
+ S(e), e && w(!0);
1031
+ }, []), A = M(() => w((e) => !e), []);
1032
+ return /* @__PURE__ */ V("section", {
1033
+ "aria-label": o.title,
1034
+ className: i("flex min-h-0 flex-1 flex-col px-1 pt-4", _, W.listSection),
1035
+ children: [/* @__PURE__ */ B("div", {
1036
+ className: "px-3 pb-2",
1037
+ children: /* @__PURE__ */ B(Ue, {
1038
+ labels: o,
1039
+ isExpanded: C,
1040
+ onToggleExpanded: A,
1041
+ controlsId: v,
1042
+ searchQuery: y,
1043
+ isSearchOpen: x,
1044
+ onSearchChange: O,
1045
+ onSearchOpenChange: k,
1046
+ activeFilter: T,
1047
+ onFilterChange: c ? void 0 : D,
1048
+ hiddenSources: u,
1049
+ actions: d,
1050
+ styles: h?.header
1051
+ })
1052
+ }), /* @__PURE__ */ B("div", {
1053
+ hidden: !C,
1054
+ inert: !C,
1055
+ className: C ? "flex min-h-0 flex-1 flex-col" : "hidden",
1056
+ children: /* @__PURE__ */ B(ze, {
1057
+ id: v,
1058
+ conversations: e,
1059
+ isLoading: n,
1060
+ onSelectConversation: r,
1061
+ activeConversationId: a,
1062
+ labels: o,
1063
+ searchQuery: y,
1064
+ activeFilter: T,
1065
+ hiddenSources: u,
1066
+ rowVariant: Z.Indicator,
1067
+ getActions: f,
1068
+ onActionMenuOpen: p,
1069
+ onMoveConversation: m,
1070
+ styles: h?.list,
1071
+ className: g
1072
+ })
1073
+ })]
1074
+ });
1075
+ }), Ge = [
1076
+ {
1077
+ value: t.All,
1078
+ labelKey: "all"
1079
+ },
1080
+ {
1081
+ value: t.MyChats,
1082
+ labelKey: "myChats"
1083
+ },
1084
+ {
1085
+ value: t.Shared,
1086
+ labelKey: "shared"
1087
+ },
1088
+ {
1089
+ value: t.Organization,
1090
+ labelKey: "organization"
1091
+ }
1092
+ ], Ke = j(({ activeTab: e, labels: t, onChange: n, tabClassName: r = "dial-tiny-semi-text", hiddenSources: i }) => {
1093
+ let a = L(() => Ge.filter(({ value: e }) => !i?.includes(e)).map(({ value: e, labelKey: n }) => ({
1094
+ value: e,
1095
+ label: t[n]
1096
+ })), [t, i]);
1097
+ return /* @__PURE__ */ B(v, {
1098
+ items: a,
1099
+ value: e,
1100
+ onChange: n,
1101
+ stretch: !0,
1102
+ "aria-label": t.groupAriaLabel ?? "Filter chats",
1103
+ className: "px-3 py-2",
1104
+ chipClassName: k("!px-2", r)
1105
+ });
1106
+ }), qe = { button: "_button_vjird_1" }, Je = j(({ label: e, onClick: t, labelClassName: r = "dial-small-semi-text", colors: a, className: o }) => {
1107
+ let s = n({
1108
+ "--cp-new-chat-bg": a?.background,
1109
+ "--cp-new-chat-text": a?.text,
1110
+ "--cp-new-chat-focus-outline": a?.focusOutline
1111
+ });
1112
+ return /* @__PURE__ */ B("div", {
1113
+ className: "px-3 py-2",
1114
+ style: s,
1115
+ children: /* @__PURE__ */ B(d, {
1116
+ label: e,
1117
+ textClassName: r,
1118
+ iconBefore: /* @__PURE__ */ B(ie, {
1119
+ size: 18,
1120
+ stroke: m,
1121
+ className: "shrink-0",
1122
+ "aria-hidden": !0
1123
+ }),
1124
+ onClick: t,
1125
+ className: i("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, W.newChatButton)
1126
+ })
1127
+ });
1128
+ }), Ye = j(({ conversations: e, isLoading: r, isOpen: a, onSelectConversation: o, activeConversationId: s, labels: c, onNewChat: d, styles: f, className: p, isOverlay: m = !1, getActions: h, onActionMenuOpen: g, onToggle: _, headerActions: v, onMoveConversation: y, activeFilter: b, onActiveFilterChange: x, isFilterTabsHidden: S = !1, hiddenSources: C }) => {
1129
+ let { colors: w, typography: E, newChatButton: D, searchWrapperClassName: O, headerClassName: k, headerActionsClassName: A, newChatButtonClassName: j } = f ?? {}, { title: P, emptyLabel: F, noResultsLabel: I, loadingLabel: R, newChatLabel: ee, searchPlaceholder: H, searchClearLabel: te, filterLabels: ne, groupLabels: re, actionsLabel: U, unreadIndicatorLabel: ie, closeAriaLabel: ae } = c, [oe, se] = z(""), [G, K] = z(t.All);
1130
+ N(() => {
1131
+ b != null && K(b);
1132
+ }, [b]);
1133
+ let ce = M((e) => {
1134
+ se(e ?? "");
1135
+ }, []), le = n({
1136
+ "--cp-text": w?.text,
1137
+ "--cp-new-chat-bg": D?.background,
1138
+ "--cp-new-chat-text": D?.text,
1139
+ "--cp-new-chat-focus-outline": D?.focusOutline
1140
+ }), q = L(() => ({
1141
+ emptyLabel: F,
1142
+ noResultsLabel: I,
1143
+ loadingLabel: R,
1144
+ groupLabels: re,
1145
+ actionsLabel: U,
1146
+ unreadIndicatorLabel: ie
1147
+ }), [
1148
+ F,
1149
+ I,
1150
+ R,
1151
+ re,
860
1152
  U,
861
- W,
862
- O?.groupHeaderClassName,
863
- O?.itemTitleClassName,
864
- m?.itemIconBadgeClassName,
865
- xe,
866
- Ee,
867
- ke,
868
- et,
869
- Ue,
870
- We,
871
- Ge,
872
- Ke
873
- ]), nt = J.length === 0, rt = J.length > 0 && Q.length === 0;
874
- return /* @__PURE__ */ re(u, {
1153
+ ie
1154
+ ]), ue = L(() => ({
1155
+ colors: w,
1156
+ typography: {
1157
+ fontFamily: E?.fontFamily,
1158
+ groupHeaderClassName: E?.groupHeaderClassName,
1159
+ itemTitleClassName: E?.itemTitleClassName
1160
+ },
1161
+ itemIconBadgeClassName: f?.itemIconBadgeClassName
1162
+ }), [
1163
+ w,
1164
+ E?.fontFamily,
1165
+ E?.groupHeaderClassName,
1166
+ E?.itemTitleClassName,
1167
+ f?.itemIconBadgeClassName
1168
+ ]);
1169
+ return /* @__PURE__ */ V(u, {
875
1170
  isOpen: a,
876
- isOverlay: g,
1171
+ isOverlay: m,
877
1172
  orientation: l.Left,
878
- title: ie,
1173
+ title: P,
879
1174
  labels: {
880
- ariaLabel: ie,
881
- closeLabel: G
1175
+ ariaLabel: P,
1176
+ closeLabel: ae
882
1177
  },
883
- onClose: y,
1178
+ onClose: _,
884
1179
  styles: {
885
1180
  colors: {
886
- background: D?.background,
887
- border: D?.border
1181
+ background: w?.background,
1182
+ border: w?.border
888
1183
  },
889
- typography: { fontClassName: O?.fontClassName },
1184
+ typography: { fontClassName: E?.fontClassName },
890
1185
  bodyClassName: "flex flex-col overflow-hidden p-0 gap-3",
891
- cssVars: qe,
892
- titleClassName: O?.fontClassName,
893
- headerClassName: i("h-[64px]", ne),
894
- headerActionsClassName: L,
895
- className: i(a ? "w-[324px] mobile:w-full" : "w-0", h)
1186
+ cssVars: le,
1187
+ titleClassName: E?.fontClassName,
1188
+ headerClassName: i("h-[64px]", k),
1189
+ headerActionsClassName: A,
1190
+ className: i(a ? "w-[324px] mobile:w-full" : "w-0", p)
896
1191
  },
897
- rightActions: b,
1192
+ rightActions: v,
898
1193
  children: [
899
- /* @__PURE__ */ I(Ae, {
900
- label: ce,
901
- onClick: p,
902
- labelClassName: O?.newChatLabelClassName,
903
- colors: k,
904
- className: R
1194
+ /* @__PURE__ */ B(Je, {
1195
+ label: ee,
1196
+ onClick: d,
1197
+ labelClassName: E?.newChatLabelClassName,
1198
+ colors: D,
1199
+ className: j
905
1200
  }),
906
- /* @__PURE__ */ I("div", {
1201
+ /* @__PURE__ */ B("div", {
907
1202
  role: "search",
908
- className: i("px-3 py-2", se.search),
909
- children: /* @__PURE__ */ I(w, {
910
- wrapperClassName: i(Z.search, M),
911
- value: K,
912
- onChange: ze,
913
- placeholder: B,
914
- clearLabel: le,
915
- "aria-label": B
1203
+ className: i("px-3 py-2", W.search),
1204
+ children: /* @__PURE__ */ B(T, {
1205
+ wrapperClassName: i($.search, O),
1206
+ value: oe,
1207
+ onChange: ce,
1208
+ placeholder: H,
1209
+ clearLabel: te,
1210
+ "aria-label": H
916
1211
  })
917
1212
  }),
918
- !ee && /* @__PURE__ */ I(Oe, {
919
- activeTab: q,
920
- labels: V,
1213
+ !S && /* @__PURE__ */ B(Ke, {
1214
+ activeTab: G,
1215
+ labels: ne,
921
1216
  onChange: (e) => {
922
- de(e), C?.(e);
1217
+ K(e), x?.(e);
923
1218
  },
924
- tabClassName: O?.tabClassName,
925
- hiddenSources: E
926
- }),
927
- /* @__PURE__ */ I("span", {
928
- role: "status",
929
- "aria-live": "polite",
930
- className: "sr-only",
931
- children: r ? z : nt ? ae : rt ? oe : ""
1219
+ tabClassName: E?.tabClassName,
1220
+ hiddenSources: C
932
1221
  }),
933
- /* @__PURE__ */ I("div", {
934
- className: "flex-1 overflow-hidden px-3 py-1",
935
- children: r ? /* @__PURE__ */ I("div", {
936
- className: "flex flex-col gap-3 px-2 py-3",
937
- children: Array.from({ length: 15 }, (e, t) => /* @__PURE__ */ I(T, {
938
- avatar: { size: 24 },
939
- showTitle: { width: ve(t) },
940
- paragraph: !1,
941
- active: !0,
942
- color: Z.skeletonColor
943
- }, t))
944
- }) : nt ? /* @__PURE__ */ I(s, { label: ae }) : rt ? /* @__PURE__ */ I(c, { label: oe }) : /* @__PURE__ */ I(_e, {
945
- listRef: ge,
946
- id: he,
947
- role: "list",
948
- style: { height: "100%" },
949
- rowComponent: Ne,
950
- rowCount: $.length,
951
- rowHeight: be,
952
- overscanCount: pe,
953
- onResize: Re,
954
- rowProps: tt
955
- })
1222
+ /* @__PURE__ */ B(ze, {
1223
+ conversations: e,
1224
+ isLoading: r,
1225
+ onSelectConversation: o,
1226
+ activeConversationId: s,
1227
+ labels: q,
1228
+ searchQuery: oe,
1229
+ activeFilter: G,
1230
+ hiddenSources: C,
1231
+ getActions: h,
1232
+ onActionMenuOpen: g,
1233
+ onMoveConversation: y,
1234
+ styles: ue
956
1235
  })
957
1236
  ]
958
1237
  });
959
- }), Re = k(({ isOpen: e, currentTitle: t, isSaving: n, error: i, onSave: s, onCancel: c, onGenerateWithAi: l, labels: u, styles: d }) => {
960
- let [h, g] = F(t), [_, v] = F(!1), [b, w] = F(null), T = P(null), ee = P(!1), D = P(0);
961
- j(() => {
962
- let n = e && !ee.current;
963
- if (ee.current = e, !e) {
1238
+ }), Xe = j(({ isOpen: e, currentTitle: t, isSaving: n, error: i, onSave: s, onCancel: c, onGenerateWithAi: l, labels: u, styles: d }) => {
1239
+ let [h, g] = z(t), [_, v] = z(!1), [b, S] = z(null), T = R(null), E = R(!1), D = R(0);
1240
+ N(() => {
1241
+ let n = e && !E.current;
1242
+ if (E.current = e, !e) {
964
1243
  D.current += 1, v(!1);
965
1244
  return;
966
1245
  }
967
1246
  if (!n) return;
968
- D.current += 1, g(t), w(null), v(!1);
1247
+ D.current += 1, g(t), S(null), v(!1);
969
1248
  let r = setTimeout(() => T.current?.focus(), 0);
970
1249
  return () => clearTimeout(r);
971
- }, [e, t]), j(() => () => {
1250
+ }, [e, t]), N(() => () => {
972
1251
  D.current += 1;
973
1252
  }, []);
974
- let O = o(h.trim()), k = r(O) > 255, te = n || O === "" || O === t.trim() || k, M = A(() => {
975
- te || s(O);
1253
+ let k = o(h.trim()), A = r(k) > 255, j = n || k === "" || k === t.trim() || A, P = M(() => {
1254
+ j || s(k);
976
1255
  }, [
977
- te,
1256
+ j,
978
1257
  s,
979
- O
980
- ]), ne = A((e) => {
981
- e.key === "Enter" && M();
982
- }, [M]), N = A(async () => {
1258
+ k
1259
+ ]), F = M((e) => {
1260
+ e.key === "Enter" && P();
1261
+ }, [P]), I = M(async () => {
983
1262
  if (_) return;
984
1263
  let e = ++D.current;
985
- v(!0), w(null);
1264
+ v(!0), S(null);
986
1265
  try {
987
1266
  let t = await l();
988
1267
  if (e !== D.current) return;
989
1268
  g(a(t));
990
1269
  } catch {
991
1270
  if (e !== D.current) return;
992
- w(u.renameWithAiError);
1271
+ S(u.renameWithAiError);
993
1272
  } finally {
994
1273
  e === D.current && v(!1);
995
1274
  }
@@ -998,10 +1277,10 @@ var X = /* @__PURE__ */ function(e) {
998
1277
  l,
999
1278
  u.renameWithAiError
1000
1279
  ]), L;
1001
- return L = k ? u.nameTooLongError : b ?? i ?? void 0, /* @__PURE__ */ I(S, {
1280
+ return L = A ? u.nameTooLongError : b ?? i ?? void 0, /* @__PURE__ */ B(C, {
1002
1281
  open: e,
1003
1282
  header: u.popupTitle,
1004
- size: C.Sm,
1283
+ size: w.Sm,
1005
1284
  onClose: c,
1006
1285
  mainButtons: n ? void 0 : [{
1007
1286
  label: u.cancelLabel,
@@ -1009,38 +1288,38 @@ var X = /* @__PURE__ */ function(e) {
1009
1288
  }, {
1010
1289
  label: u.saveLabel,
1011
1290
  variant: f.Primary,
1012
- disabled: te,
1013
- onClick: M
1291
+ disabled: j,
1292
+ onClick: P
1014
1293
  }],
1015
- children: /* @__PURE__ */ I("div", {
1294
+ children: /* @__PURE__ */ B("div", {
1016
1295
  className: d?.bodyClassName,
1017
1296
  style: d?.cssVars,
1018
- children: n ? /* @__PURE__ */ I("div", {
1297
+ children: n ? /* @__PURE__ */ B("div", {
1019
1298
  className: "h-[120px] px-6 py-4",
1020
- children: /* @__PURE__ */ I(E, { size: 50 })
1021
- }) : /* @__PURE__ */ re("div", {
1299
+ children: /* @__PURE__ */ B(O, { size: 50 })
1300
+ }) : /* @__PURE__ */ V("div", {
1022
1301
  className: "flex items-start gap-2 px-6 py-3",
1023
- children: [/* @__PURE__ */ I("div", {
1302
+ children: [/* @__PURE__ */ B("div", {
1024
1303
  className: "min-w-0 flex-1",
1025
- children: /* @__PURE__ */ I(x, {
1304
+ children: /* @__PURE__ */ B(x, {
1026
1305
  inputRef: T,
1027
1306
  value: h,
1028
1307
  placeholder: u.inputPlaceholder,
1029
1308
  error: L,
1030
1309
  onChange: (e) => g(a(e ?? "")),
1031
- onKeyDown: ne
1310
+ onKeyDown: F
1032
1311
  })
1033
- }), /* @__PURE__ */ I(y, {
1312
+ }), /* @__PURE__ */ B(y, {
1034
1313
  "aria-label": u.renameWithAiLabel,
1035
1314
  tooltipProps: { tooltip: u.renameWithAiLabel },
1036
1315
  disabled: _ || n,
1037
1316
  "aria-busy": _,
1038
- onClick: N,
1039
- icon: _ ? /* @__PURE__ */ I("span", {
1317
+ onClick: I,
1318
+ icon: _ ? /* @__PURE__ */ B("span", {
1040
1319
  className: "flex",
1041
1320
  "aria-hidden": !0,
1042
- children: /* @__PURE__ */ I(E, { size: p.MD })
1043
- }) : /* @__PURE__ */ I(oe, {
1321
+ children: /* @__PURE__ */ B(O, { size: p.MD })
1322
+ }) : /* @__PURE__ */ B(oe, {
1044
1323
  size: p.MD,
1045
1324
  stroke: m,
1046
1325
  "aria-hidden": !0
@@ -1050,6 +1329,6 @@ var X = /* @__PURE__ */ function(e) {
1050
1329
  })
1051
1330
  });
1052
1331
  });
1053
- Re.displayName = "RenameConversationPopup";
1332
+ Xe.displayName = "RenameConversationPopup";
1054
1333
  //#endregion
1055
- export { se as CONVERSATION_PANEL_CLASS, Le as ConversationPanel, Re as RenameConversationPopup };
1334
+ export { W as CONVERSATION_PANEL_CLASS, ze as ConversationList, Ue as ConversationListHeader, We as ConversationListSection, Ye as ConversationPanel, Z as ConversationRowVariant, Xe as RenameConversationPopup };