@epam/ai-dial-conversation-panel 1.0.0-dev.478 → 1.0.0-dev.481

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 (33) hide show
  1. package/components/ConversationGroup/ConversationGroup.d.ts +4 -8
  2. package/components/ConversationGroup/ConversationGroup.d.ts.map +1 -1
  3. package/components/ConversationGroup/ConversationRow.d.ts +7 -7
  4. package/components/ConversationGroup/ConversationRow.d.ts.map +1 -1
  5. package/components/ConversationGroupHeader/ConversationGroupHeader.d.ts +5 -3
  6. package/components/ConversationGroupHeader/ConversationGroupHeader.d.ts.map +1 -1
  7. package/components/ConversationPanel/ConversationPanel.d.ts +1 -1
  8. package/components/ConversationPanel/ConversationPanel.d.ts.map +1 -1
  9. package/components/ConversationPanel/utils.d.ts +4 -4
  10. package/components/ConversationPanel/utils.d.ts.map +1 -1
  11. package/components/FilterTabs/FilterTabs.d.ts +2 -5
  12. package/components/FilterTabs/FilterTabs.d.ts.map +1 -1
  13. package/components/RowRenderer/RowRenderer.d.ts +1 -1
  14. package/components/RowRenderer/RowRenderer.d.ts.map +1 -1
  15. package/index.css +1 -1
  16. package/index.d.ts +2 -4
  17. package/index.d.ts.map +1 -1
  18. package/index.js +362 -328
  19. package/models/panel-props.d.ts +64 -60
  20. package/models/panel-props.d.ts.map +1 -1
  21. package/models/virtual-row.d.ts +22 -15
  22. package/models/virtual-row.d.ts.map +1 -1
  23. package/package.json +4 -4
  24. package/types/conversation-classification.d.ts +12 -0
  25. package/types/conversation-classification.d.ts.map +1 -0
  26. package/utils/drag.d.ts +8 -9
  27. package/utils/drag.d.ts.map +1 -1
  28. package/types/conversation-group-key.d.ts +0 -8
  29. package/types/conversation-group-key.d.ts.map +0 -1
  30. package/types/conversation-source.d.ts +0 -7
  31. package/types/conversation-source.d.ts.map +0 -1
  32. package/types/filter-tab.d.ts +0 -8
  33. package/types/filter-tab.d.ts.map +0 -1
package/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { DeploymentIcon as e, Highlight as t, buildCssVars as n, mergeClasses as r } from "@epam/ai-dial-chat-shared";
2
2
  import { PanelEmpty as i, PanelNoResults as a, SearchInput as o, SidebarOrientation as s, SidebarPanel as c } from "@epam/ai-dial-sidebar";
3
3
  import { ButtonAppearance as l, DIAL_ICON_SIZE as u, DialButton as d, DialDropdown as f, DialEllipsisTooltip as p, DialIconButton as m, DialSkeleton as h, DialSkeletonVariant as g, DialTag as _, ElementSize as v } from "@epam/ai-dial-ui-kit";
4
- import { createElement as y, memo as b, useCallback as x, useEffect as S, useImperativeHandle as C, useLayoutEffect as w, useMemo as T, useRef as E, useState as D } from "react";
5
- import { jsx as O, jsxs as k } from "react/jsx-runtime";
6
- import { IconCaretDownFilled as A, IconCaretRightFilled as j, IconDotsVertical as M, IconPlus as N } from "@tabler/icons-react";
4
+ import { createElement as y, memo as b, useCallback as x, useEffect as S, useId as C, useImperativeHandle as w, useLayoutEffect as T, useMemo as E, useRef as D, useState as O } from "react";
5
+ import { jsx as k, jsxs as A } from "react/jsx-runtime";
6
+ import { IconCaretDownFilled as j, IconCaretRightFilled as M, IconDotsVertical as N, IconPlus as P } from "@tabler/icons-react";
7
7
  //#region ../../node_modules/react-window/dist/react-window.js
8
- var P = typeof window < "u" ? w : S;
9
- function F(e) {
8
+ var F = typeof window < "u" ? T : S;
9
+ function I(e) {
10
10
  if (e !== void 0) switch (typeof e) {
11
11
  case "number": return e;
12
12
  case "string":
@@ -15,14 +15,14 @@ function F(e) {
15
15
  }
16
16
  }
17
17
  function ee({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
18
- let { styleHeight: s, styleWidth: c } = T(() => ({
19
- styleHeight: F(o?.height),
20
- styleWidth: F(o?.width)
21
- }), [o?.height, o?.width]), [l, u] = D({
18
+ let { styleHeight: s, styleWidth: c } = E(() => ({
19
+ styleHeight: I(o?.height),
20
+ styleWidth: I(o?.width)
21
+ }), [o?.height, o?.width]), [l, u] = O({
22
22
  height: t,
23
23
  width: n
24
24
  }), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
25
- return P(() => {
25
+ return F(() => {
26
26
  if (i === null || d) return;
27
27
  let t = new ResizeObserver((e) => {
28
28
  for (let t of e) {
@@ -42,7 +42,7 @@ function ee({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
42
42
  i,
43
43
  s,
44
44
  c
45
- ]), T(() => ({
45
+ ]), E(() => ({
46
46
  height: s ?? l.height,
47
47
  width: c ?? l.width
48
48
  }), [
@@ -52,25 +52,25 @@ function ee({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
52
52
  ]);
53
53
  }
54
54
  function te(e) {
55
- let t = E(() => {
55
+ let t = D(() => {
56
56
  throw Error("Cannot call during render.");
57
57
  });
58
- return P(() => {
58
+ return F(() => {
59
59
  t.current = e;
60
60
  }, [e]), x((e) => t.current?.(e), [t]);
61
61
  }
62
- var I = null;
63
- function ne(e = !1) {
64
- if (I === null || e) {
62
+ var L = null;
63
+ function R(e = !1) {
64
+ if (L === null || e) {
65
65
  let e = document.createElement("div"), t = e.style;
66
66
  t.width = "50px", t.height = "50px", t.overflow = "scroll", t.direction = "rtl";
67
67
  let n = document.createElement("div"), r = n.style;
68
- return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? I = "positive-descending" : (e.scrollLeft = 1, I = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), I;
68
+ return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? L = "positive-descending" : (e.scrollLeft = 1, L = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), L;
69
69
  }
70
- return I;
70
+ return L;
71
71
  }
72
- function L({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
73
- if (t === "horizontal" && n) switch (ne()) {
72
+ function z({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
73
+ if (t === "horizontal" && n) switch (R()) {
74
74
  case "negative": return -r;
75
75
  case "positive-descending":
76
76
  if (e) {
@@ -81,26 +81,26 @@ function L({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
81
81
  }
82
82
  return r;
83
83
  }
84
- function R(e, t = "Assertion error") {
84
+ function B(e, t = "Assertion error") {
85
85
  if (!e) throw console.error(t), Error(t);
86
86
  }
87
- function z(e, t) {
87
+ function V(e, t) {
88
88
  if (e === t) return !0;
89
- if (!!e != !!t || (R(e !== void 0), R(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
89
+ if (!!e != !!t || (B(e !== void 0), B(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
90
90
  for (let n in e) if (!Object.is(t[n], e[n])) return !1;
91
91
  return !0;
92
92
  }
93
- function B({ cachedBounds: e, itemCount: t, itemSize: n }) {
93
+ function H({ cachedBounds: e, itemCount: t, itemSize: n }) {
94
94
  if (t === 0) return 0;
95
95
  if (typeof n == "number") return t * n;
96
96
  {
97
97
  let n = e.get(e.size === 0 ? 0 : e.size - 1);
98
- return R(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
98
+ return B(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
99
99
  }
100
100
  }
101
- function V({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
101
+ function U({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
102
102
  if (n < 0 || n >= r) throw RangeError(`Invalid index specified: ${n}`, { cause: `Index ${n} is not within the range of 0 - ${r - 1}` });
103
- let s = B({
103
+ let s = H({
104
104
  cachedBounds: t,
105
105
  itemCount: r,
106
106
  itemSize: i
@@ -112,7 +112,7 @@ function V({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, con
112
112
  default: return a >= u && a <= l ? a : a < u ? u : l;
113
113
  }
114
114
  }
115
- function H({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
115
+ function W({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
116
116
  let a = r - 1, o = 0, s = -1, c = 0, l = -1, u = 0;
117
117
  for (; u < a;) {
118
118
  let n = e.get(u);
@@ -131,11 +131,11 @@ function H({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCo
131
131
  stopIndexOverscan: l
132
132
  };
133
133
  }
134
- function U({ itemCount: e, itemProps: t, itemSize: n }) {
134
+ function ne({ itemCount: e, itemProps: t, itemSize: n }) {
135
135
  let r = /* @__PURE__ */ new Map();
136
136
  return {
137
137
  get(i) {
138
- for (R(i < e, `Invalid index ${i}`); r.size - 1 < i;) {
138
+ for (B(i < e, `Invalid index ${i}`); r.size - 1 < i;) {
139
139
  let e = r.size, a;
140
140
  switch (typeof n) {
141
141
  case "function":
@@ -151,14 +151,14 @@ function U({ itemCount: e, itemProps: t, itemSize: n }) {
151
151
  });
152
152
  else {
153
153
  let t = r.get(e - 1);
154
- R(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
154
+ B(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
155
155
  scrollOffset: t.scrollOffset + t.size,
156
156
  size: a
157
157
  });
158
158
  }
159
159
  }
160
160
  let a = r.get(i);
161
- return R(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
161
+ return B(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
162
162
  },
163
163
  set(e, t) {
164
164
  r.set(e, t);
@@ -168,8 +168,8 @@ function U({ itemCount: e, itemProps: t, itemSize: n }) {
168
168
  }
169
169
  };
170
170
  }
171
- function re({ itemCount: e, itemProps: t, itemSize: n }) {
172
- return T(() => U({
171
+ function G({ itemCount: e, itemProps: t, itemSize: n }) {
172
+ return E(() => ne({
173
173
  itemCount: e,
174
174
  itemProps: t,
175
175
  itemSize: n
@@ -179,11 +179,11 @@ function re({ itemCount: e, itemProps: t, itemSize: n }) {
179
179
  n
180
180
  ]);
181
181
  }
182
- function W({ containerSize: e, itemSize: t }) {
182
+ function re({ containerSize: e, itemSize: t }) {
183
183
  let n;
184
184
  switch (typeof t) {
185
185
  case "string":
186
- R(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), R(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseInt(t) / 100;
186
+ B(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), B(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseInt(t) / 100;
187
187
  break;
188
188
  default:
189
189
  n = t;
@@ -198,14 +198,14 @@ function ie({ containerElement: e, containerStyle: t, defaultContainerSize: n =
198
198
  element: e,
199
199
  mode: r === "vertical" ? "only-height" : "only-width",
200
200
  style: t
201
- }), f = E({
201
+ }), f = D({
202
202
  height: 0,
203
203
  width: 0
204
- }), p = r === "vertical" ? u : d, m = W({
204
+ }), p = r === "vertical" ? u : d, m = re({
205
205
  containerSize: p,
206
206
  itemSize: s
207
207
  });
208
- w(() => {
208
+ T(() => {
209
209
  if (typeof c == "function") {
210
210
  let e = f.current;
211
211
  (e.height !== u || e.width !== d) && (c({
@@ -218,11 +218,11 @@ function ie({ containerElement: e, containerStyle: t, defaultContainerSize: n =
218
218
  c,
219
219
  d
220
220
  ]);
221
- let h = re({
221
+ let h = G({
222
222
  itemCount: a,
223
223
  itemProps: o,
224
224
  itemSize: m
225
- }), g = x((e) => h.get(e), [h]), [_, v] = D(() => H({
225
+ }), g = x((e) => h.get(e), [h]), [_, v] = O(() => W({
226
226
  cachedBounds: h,
227
227
  containerScrollOffset: 0,
228
228
  containerSize: p,
@@ -233,7 +233,7 @@ function ie({ containerElement: e, containerStyle: t, defaultContainerSize: n =
233
233
  startIndexOverscan: Math.min(a - 1, _.startIndexOverscan),
234
234
  stopIndexVisible: Math.min(a - 1, _.stopIndexVisible),
235
235
  stopIndexOverscan: Math.min(a - 1, _.stopIndexOverscan)
236
- }, T = x(() => B({
236
+ }, w = x(() => H({
237
237
  cachedBounds: h,
238
238
  itemCount: a,
239
239
  itemSize: m
@@ -241,9 +241,9 @@ function ie({ containerElement: e, containerStyle: t, defaultContainerSize: n =
241
241
  h,
242
242
  a,
243
243
  m
244
- ]), O = x((t) => H({
244
+ ]), E = x((t) => W({
245
245
  cachedBounds: h,
246
- containerScrollOffset: L({
246
+ containerScrollOffset: z({
247
247
  containerElement: e,
248
248
  direction: r,
249
249
  isRtl: i,
@@ -261,19 +261,19 @@ function ie({ containerElement: e, containerStyle: t, defaultContainerSize: n =
261
261
  a,
262
262
  l
263
263
  ]);
264
- return P(() => {
265
- v(O((r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0));
264
+ return F(() => {
265
+ v(E((r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0));
266
266
  }, [
267
267
  e,
268
268
  r,
269
- O
270
- ]), P(() => {
269
+ E
270
+ ]), F(() => {
271
271
  if (!e) return;
272
272
  let t = () => {
273
273
  v((t) => {
274
- let { scrollLeft: n, scrollTop: o } = e, s = H({
274
+ let { scrollLeft: n, scrollTop: o } = e, s = W({
275
275
  cachedBounds: h,
276
- containerScrollOffset: L({
276
+ containerScrollOffset: z({
277
277
  containerElement: e,
278
278
  direction: r,
279
279
  isRtl: i,
@@ -283,7 +283,7 @@ function ie({ containerElement: e, containerStyle: t, defaultContainerSize: n =
283
283
  itemCount: a,
284
284
  overscanCount: l
285
285
  });
286
- return z(s, t) ? t : s;
286
+ return V(s, t) ? t : s;
287
287
  });
288
288
  };
289
289
  return e.addEventListener("scroll", t), () => {
@@ -298,9 +298,9 @@ function ie({ containerElement: e, containerStyle: t, defaultContainerSize: n =
298
298
  l
299
299
  ]), {
300
300
  getCellBounds: g,
301
- getEstimatedSize: T,
301
+ getEstimatedSize: w,
302
302
  scrollToIndex: te(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
303
- let s = V({
303
+ let s = U({
304
304
  align: t,
305
305
  cachedBounds: h,
306
306
  containerScrollOffset: n,
@@ -310,14 +310,14 @@ function ie({ containerElement: e, containerStyle: t, defaultContainerSize: n =
310
310
  itemSize: m
311
311
  });
312
312
  if (e) {
313
- if (s = L({
313
+ if (s = z({
314
314
  containerElement: e,
315
315
  direction: r,
316
316
  isRtl: i,
317
317
  scrollOffset: s
318
318
  }), typeof e.scrollTo != "function") {
319
- let e = O(s);
320
- z(_, e) || v(e);
319
+ let e = E(s);
320
+ V(_, e) || v(e);
321
321
  }
322
322
  return s;
323
323
  }
@@ -328,35 +328,35 @@ function ie({ containerElement: e, containerStyle: t, defaultContainerSize: n =
328
328
  stopIndexVisible: S
329
329
  };
330
330
  }
331
- function G(e) {
332
- return T(() => e, Object.values(e));
331
+ function ae(e) {
332
+ return E(() => e, Object.values(e));
333
333
  }
334
- function ae(e, t) {
334
+ function K(e, t) {
335
335
  let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
336
- return z(n, a) && z(r, o) && z(i, s);
336
+ return V(n, a) && V(r, o) && V(i, s);
337
337
  }
338
338
  function oe(e) {
339
339
  return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
340
340
  }
341
341
  var se = "data-react-window-index";
342
342
  function ce({ 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 }) {
343
- let m = G(u), h = T(() => b(s, ae), [s]), [g, _] = D(null), v = oe(l), { getCellBounds: x, getEstimatedSize: w, scrollToIndex: E, startIndexOverscan: k, startIndexVisible: A, stopIndexOverscan: j, stopIndexVisible: M } = ie({
343
+ let m = ae(u), h = E(() => b(s, K), [s]), [g, _] = O(null), v = oe(l), { getCellBounds: x, getEstimatedSize: C, scrollToIndex: T, startIndexOverscan: D, startIndexVisible: A, stopIndexOverscan: j, stopIndexVisible: M } = ie({
344
344
  containerElement: g,
345
345
  containerStyle: f,
346
346
  defaultContainerSize: n,
347
347
  direction: "vertical",
348
348
  itemCount: c,
349
349
  itemProps: m,
350
- itemSize: T(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
350
+ itemSize: E(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
351
351
  onResize: i,
352
352
  overscanCount: o
353
353
  });
354
- C(r, () => ({
354
+ w(r, () => ({
355
355
  get element() {
356
356
  return g;
357
357
  },
358
358
  scrollToRow({ align: e = "auto", behavior: t = "auto", index: n }) {
359
- let r = E({
359
+ let r = T({
360
360
  align: e,
361
361
  containerScrollOffset: g?.scrollTop ?? 0,
362
362
  index: n
@@ -366,11 +366,11 @@ function ce({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
366
366
  top: r
367
367
  });
368
368
  }
369
- }), [g, E]), P(() => {
369
+ }), [g, T]), F(() => {
370
370
  if (!g) return;
371
371
  let e = Array.from(g.children).filter((e, t) => {
372
372
  if (e.hasAttribute("aria-hidden")) return !1;
373
- let n = `${k + t}`;
373
+ let n = `${D + t}`;
374
374
  return e.setAttribute(se, n), !0;
375
375
  });
376
376
  if (v) return l.observeRowElements(e);
@@ -378,26 +378,26 @@ function ce({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
378
378
  g,
379
379
  v,
380
380
  l,
381
- k,
381
+ D,
382
382
  j
383
383
  ]), S(() => {
384
- k >= 0 && j >= 0 && a && a({
384
+ D >= 0 && j >= 0 && a && a({
385
385
  startIndex: A,
386
386
  stopIndex: M
387
387
  }, {
388
- startIndex: k,
388
+ startIndex: D,
389
389
  stopIndex: j
390
390
  });
391
391
  }, [
392
392
  a,
393
- k,
393
+ D,
394
394
  A,
395
395
  j,
396
396
  M
397
397
  ]);
398
- let N = T(() => {
398
+ let N = E(() => {
399
399
  let e = [];
400
- if (c > 0) for (let t = k; t <= j; t++) {
400
+ if (c > 0) for (let t = D; t <= j; t++) {
401
401
  let n = x(t);
402
402
  e.push(/* @__PURE__ */ y(h, {
403
403
  ...m,
@@ -424,12 +424,12 @@ function ce({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
424
424
  v,
425
425
  c,
426
426
  m,
427
- k,
427
+ D,
428
428
  j
429
- ]), F = /* @__PURE__ */ O("div", {
429
+ ]), P = /* @__PURE__ */ k("div", {
430
430
  "aria-hidden": !0,
431
431
  style: {
432
- height: w(),
432
+ height: C(),
433
433
  width: "100%",
434
434
  zIndex: -1
435
435
  }
@@ -446,81 +446,77 @@ function ce({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
446
446
  overflowY: "auto",
447
447
  ...f
448
448
  }
449
- }, N, e, F);
449
+ }, N, e, P);
450
450
  }
451
451
  //#endregion
452
452
  //#region src/types/virtual-row.ts
453
- var K = /* @__PURE__ */ function(e) {
453
+ var q = /* @__PURE__ */ function(e) {
454
454
  return e.Header = "header", e.Item = "item", e;
455
- }({}), q = /* @__PURE__ */ function(e) {
456
- return e.Pinned = "pinned", e.MyChats = "myChats", e.Shared = "shared", e.Organization = "organization", e;
457
455
  }({}), J = /* @__PURE__ */ function(e) {
458
- return e.MyChats = "my-chats", e.Shared = "shared", e.Organization = "organization", e;
459
- }({}), Y = /* @__PURE__ */ function(e) {
460
- return e.All = "all", e.MyChats = "my-chats", e.Shared = "shared", e.Organization = "organization", e;
461
- }({}), le = (e) => `${60 + e * 23 % 35}%`, ue = (e, t) => e ? t ? "pe-9" : "pe-2 group-hover/conversation:pe-9" : "pe-3", de = (e, t) => t.rows[e].kind === K.Item ? 36 : e === 0 ? 24 : 56, fe = (e) => {
456
+ return e.All = "all", e.Pinned = "pinned", e.MyChats = "my-chats", e.Shared = "shared", e.Organization = "organization", e;
457
+ }({}), le = (e) => `${60 + e * 23 % 35}%`, ue = (e, t) => e ? t ? "pe-9" : "pe-2 group-hover/conversation:pe-9" : "pe-3", de = (e, t) => t.rows[e].kind === q.Item ? 36 : e === 0 ? 24 : 56, fe = (e) => {
462
458
  switch (e) {
463
- case J.Shared: return q.Shared;
464
- case J.Organization: return q.Organization;
465
- default: return q.MyChats;
459
+ case J.Shared: return J.Shared;
460
+ case J.Organization: return J.Organization;
461
+ default: return J.MyChats;
466
462
  }
467
463
  }, pe = (e, t) => {
468
464
  let n = null;
469
- for (let r of e) if (r.kind === K.Header) n = r.groupKey;
465
+ for (let r of e) if (r.kind === q.Header) n = r.groupKey;
470
466
  else if (r.item.id === t) return n;
471
467
  return null;
472
468
  }, me = (e, t, n) => {
473
469
  let r = /* @__PURE__ */ new Set();
474
- if (t != null && r.add(t), t === q.Pinned) {
470
+ if (t != null && r.add(t), t === J.Pinned) {
475
471
  let t = n.find((t) => t.id === e);
476
472
  t && r.add(fe(t.source));
477
- } else r.add(q.Pinned);
473
+ } else r.add(J.Pinned);
478
474
  return r;
479
475
  }, he = (e, t, n, r) => {
480
476
  let i = e.currentTarget.getBoundingClientRect();
481
477
  if (e.clientY >= i.top + i.height / 2) return t;
482
478
  let a = null, o = !1;
483
- for (let e of n) if (e.kind === K.Header) o = e.groupKey === r;
479
+ for (let e of n) if (e.kind === q.Header) o = e.groupKey === r;
484
480
  else if (o) {
485
481
  if (e.item.id === t) return a;
486
482
  a = e.item.id;
487
483
  }
488
484
  return null;
489
- }, ge = {
485
+ }, Y = {
490
486
  tab: "_tab_1mi6x_1",
491
487
  tabActive: "_tabActive_1mi6x_13"
492
- }, _e = b(({ tabs: e, activeTabId: t, onTabChange: n, tabClassName: i = "dial-tiny-semi-text" }) => /* @__PURE__ */ O("div", {
488
+ }, ge = b(({ tabs: e, activeTabId: t, onTabChange: n, tabClassName: i = "dial-tiny-semi-text" }) => /* @__PURE__ */ k("div", {
493
489
  className: "flex flex-nowrap gap-1",
494
490
  children: e.map((e) => {
495
491
  let a = t === e.id;
496
- return /* @__PURE__ */ O(_, {
492
+ return /* @__PURE__ */ k(_, {
497
493
  label: e.label,
498
494
  selected: a,
499
495
  onClick: () => n(e.id),
500
- className: r("box-border h-auto shrink-0 justify-center rounded-full p-2 text-center", i, ge.tab, a && ge.tabActive)
496
+ className: r("box-border h-auto shrink-0 justify-center rounded-full p-2 text-center", i, Y.tab, a && Y.tabActive)
501
497
  }, e.id);
502
498
  })
503
- })), ve = [
499
+ })), _e = [
504
500
  {
505
- value: Y.All,
501
+ value: J.All,
506
502
  labelKey: "all"
507
503
  },
508
504
  {
509
- value: Y.MyChats,
505
+ value: J.MyChats,
510
506
  labelKey: "myChats"
511
507
  },
512
508
  {
513
- value: Y.Shared,
509
+ value: J.Shared,
514
510
  labelKey: "shared"
515
511
  },
516
512
  {
517
- value: Y.Organization,
513
+ value: J.Organization,
518
514
  labelKey: "organization"
519
515
  }
520
- ], ye = b(({ activeTab: e, labels: t, onChange: n, tabClassName: r = "flex-1 dial-tiny-semi-text" }) => /* @__PURE__ */ O("div", {
516
+ ], ve = b(({ activeTab: e, labels: t, onChange: n, tabClassName: r = "dial-tiny-semi-text" }) => /* @__PURE__ */ k("div", {
521
517
  className: "mx-3 my-2",
522
- children: /* @__PURE__ */ O(_e, {
523
- tabs: ve.map(({ value: e, labelKey: n }) => ({
518
+ children: /* @__PURE__ */ k(ge, {
519
+ tabs: _e.map(({ value: e, labelKey: n }) => ({
524
520
  id: e,
525
521
  label: t[n]
526
522
  })),
@@ -528,72 +524,76 @@ var K = /* @__PURE__ */ function(e) {
528
524
  onTabChange: (e) => n(e),
529
525
  tabClassName: r
530
526
  })
531
- })), be = { button: "_button_1blz1_1" }, xe = b(({ label: e, onClick: t, labelClassName: n = "dial-small-semi-text" }) => /* @__PURE__ */ O("div", {
527
+ })), ye = { button: "_button_1ggx8_1" }, be = b(({ label: e, onClick: t, labelClassName: n = "dial-small-semi-text" }) => /* @__PURE__ */ k("div", {
532
528
  className: "px-3 py-2",
533
- children: /* @__PURE__ */ k("button", {
529
+ children: /* @__PURE__ */ A("button", {
534
530
  onClick: t,
535
531
  type: "button",
536
- className: r("flex h-[36px] w-full cursor-pointer items-center justify-center gap-2 px-3 py-1", be.button),
537
- children: [/* @__PURE__ */ O(N, {
532
+ className: r("flex h-[36px] w-full cursor-pointer items-center justify-center gap-2 rounded-full px-3 py-1", ye.button),
533
+ children: [/* @__PURE__ */ k(P, {
538
534
  size: 18,
539
535
  stroke: 2,
540
536
  className: "shrink-0"
541
- }), /* @__PURE__ */ O("span", {
537
+ }), /* @__PURE__ */ k("span", {
542
538
  className: n,
543
539
  children: e
544
540
  })]
545
541
  })
546
542
  })), X = {
547
- header: "_header_1o9mn_1",
548
- item: "_item_1o9mn_5",
549
- itemActive: "_itemActive_1o9mn_11",
550
- groupHeader: "_groupHeader_1o9mn_16",
551
- trigger: "_trigger_1o9mn_21",
552
- triggerActive: "_triggerActive_1o9mn_21",
553
- triggerIcon: "_triggerIcon_1o9mn_24"
554
- }, Se = ({ item: n, isActive: i, onSelectConversation: a, searchQuery: o = "", getActions: s, actionsLabel: c = "More actions", itemTitleClassName: p = "dial-small-text", itemIconBadgeClassName: _, rowGroupKey: y, rows: b, draggingId: S, dragOverId: C, allowedDropGroups: w, onDragStart: T, onDragEnd: E, onDragOver: A, onDragLeave: j, onDrop: N }) => {
555
- let [P, F] = D(!1), ee = s?.(n) ?? [], te = ee.length > 0, I = n.isIconLoading ? /* @__PURE__ */ O(h, {
543
+ skeletonColor: "var(--cp-skeleton-color, var(--bg-layer-4, #d1dbea))",
544
+ header: "_header_dr0k7_1",
545
+ item: "_item_dr0k7_5",
546
+ itemActive: "_itemActive_dr0k7_11",
547
+ groupHeader: "_groupHeader_dr0k7_16",
548
+ dropZoneActive: "_dropZoneActive_dr0k7_20",
549
+ trigger: "_trigger_dr0k7_28",
550
+ triggerActive: "_triggerActive_dr0k7_28",
551
+ triggerIcon: "_triggerIcon_dr0k7_31"
552
+ }, xe = ({ item: n, isActive: i, onSelectConversation: a, searchQuery: o = "", getActions: s, actionsLabel: c = "More actions", itemTitleClassName: p = "dial-small-text", itemIconBadgeClassName: _, rowGroupKey: y, rows: b, draggingId: S, dragOverId: C, allowedDropGroups: w, onDragStart: T, onDragEnd: E, onDragOver: D, onDragLeave: j, onDrop: M }) => {
553
+ let [P, F] = O(!1), I = s?.(n) ?? [], ee = I.length > 0, te = n.isIconLoading ? /* @__PURE__ */ k(h, {
556
554
  variant: g.Circular,
557
555
  width: u.LG,
558
556
  height: u.LG,
559
- color: "var(--bg-layer-4)",
557
+ color: X.skeletonColor,
560
558
  "aria-hidden": !0
561
- }) : /* @__PURE__ */ O(e, {
559
+ }) : /* @__PURE__ */ k(e, {
562
560
  src: n.iconUrl,
563
561
  size: u.LG,
564
562
  initialsName: n.iconTooltip ?? "",
565
563
  tooltip: n.iconTooltip,
566
564
  badgeClassName: _
567
- }), ne = ue(te, P), L = y != null, R = x((e) => {
565
+ }), L = ue(ee, P), R = y != null, z = x((e) => {
568
566
  e.currentTarget.contains(e.relatedTarget) || j?.();
569
- }, [j]), z = x((e) => {
570
- if (!y || !b || !N) return;
567
+ }, [j]), B = x((e) => {
568
+ if (!y || !b || !M) return;
571
569
  e.preventDefault();
572
570
  let t = he(e, n.id, b, y);
573
- N(n.id, y, t);
571
+ M(n.id, y, t);
574
572
  }, [
575
573
  n.id,
576
574
  b,
577
575
  y,
578
- N
579
- ]), B = n.id === S, V = n.id === C, H = y != null && (w?.has(y) ?? !1);
580
- return /* @__PURE__ */ k("li", {
581
- className: r("group/conversation relative", B && "cursor-grabbing opacity-50", V && H && "ring-accent-secondary rounded ring-1 ring-inset", S != null && !B && !H && "cursor-not-allowed"),
582
- draggable: L || void 0,
583
- onDragStart: L ? () => T?.(n.id) : void 0,
584
- onDragEnd: L ? E : void 0,
585
- onDragOver: L ? (e) => {
586
- e.preventDefault(), A?.(n.id);
576
+ M
577
+ ]), V = n.id === S, H = n.id === C, U = y != null && (w?.has(y) ?? !1), W = S != null;
578
+ return /* @__PURE__ */ A("li", {
579
+ className: r("group/conversation relative", V && "cursor-grabbing opacity-50", H && U && "rounded", H && U && X.dropZoneActive, W && !V && !U && "cursor-not-allowed"),
580
+ draggable: R || void 0,
581
+ onDragStart: R ? () => T?.(n.id) : void 0,
582
+ onDragEnd: R ? E : void 0,
583
+ onDragOver: R ? (e) => {
584
+ e.preventDefault(), D?.(n.id);
587
585
  } : void 0,
588
- onDragLeave: L ? R : void 0,
589
- onDrop: L ? z : void 0,
590
- children: [/* @__PURE__ */ O("a", {
586
+ onDragLeave: R ? z : void 0,
587
+ onDrop: R ? B : void 0,
588
+ children: [/* @__PURE__ */ k("a", {
591
589
  href: n.href,
592
590
  className: "contents",
593
- onClick: (e) => e.preventDefault(),
594
- children: /* @__PURE__ */ O(d, {
595
- iconBefore: I,
596
- label: /* @__PURE__ */ O(t, {
591
+ onClick: (e) => {
592
+ n.href && (e.preventDefault(), a(n.id));
593
+ },
594
+ children: /* @__PURE__ */ k(d, {
595
+ iconBefore: te,
596
+ label: /* @__PURE__ */ k(t, {
597
597
  text: n.title,
598
598
  query: o,
599
599
  className: p,
@@ -601,21 +601,22 @@ var K = /* @__PURE__ */ function(e) {
601
601
  }),
602
602
  textClassName: "min-w-0",
603
603
  "aria-current": i ? "page" : void 0,
604
- onClick: () => a(n.id),
604
+ onClick: n.href ? void 0 : () => a(n.id),
605
605
  tabIndex: n.href ? -1 : void 0,
606
- className: r("flex h-8 w-full items-center justify-start gap-2 rounded-xl py-2 ps-3", ne, X.item, i && X.itemActive, P && X.itemActive)
606
+ className: r("flex h-8 w-full items-center justify-start gap-2 rounded-xl py-2 ps-3", L, X.item, i && X.itemActive, P && X.itemActive)
607
607
  })
608
- }), te && /* @__PURE__ */ O("div", {
609
- className: r("absolute inset-y-0 end-1 flex items-center", P ? "opacity-100" : "opacity-0 group-hover/conversation:opacity-100"),
610
- children: /* @__PURE__ */ O(f, {
611
- items: ee,
608
+ }), ee && /* @__PURE__ */ k("div", {
609
+ className: r("absolute inset-y-0 end-1 flex items-center", P ? "opacity-100" : "opacity-0 group-focus-within/conversation:opacity-100 group-hover/conversation:opacity-100"),
610
+ children: /* @__PURE__ */ k(f, {
611
+ items: I,
612
612
  onOpenChange: F,
613
613
  matchReferenceWidth: !1,
614
614
  listClassName: "w-[140px] cp-dropdown-overlay",
615
- children: /* @__PURE__ */ O(m, {
616
- icon: /* @__PURE__ */ O(M, {
615
+ children: /* @__PURE__ */ k(m, {
616
+ icon: /* @__PURE__ */ k(N, {
617
617
  size: u.SM,
618
- className: X.triggerIcon
618
+ className: X.triggerIcon,
619
+ "aria-hidden": !0
619
620
  }),
620
621
  appearance: l.Ghost,
621
622
  size: v.Small,
@@ -625,289 +626,322 @@ var K = /* @__PURE__ */ function(e) {
625
626
  })
626
627
  })]
627
628
  });
628
- }, Ce = ({ label: e, isExpanded: t, onToggle: n, className: i = "dial-tiny-semi-text uppercase", dropZoneGroupKey: a, isDragOver: o, onDragOver: s, onDragLeave: c, onDrop: l }) => {
629
- let u = a != null;
630
- return /* @__PURE__ */ k("button", {
629
+ }, Se = ({ label: e, isExpanded: t, onToggle: n, listId: i, className: a = "dial-tiny-semi-text uppercase", dropZoneGroupKey: o, isDragOver: s, onDragOver: c, onDragLeave: l, onDrop: u }) => {
630
+ let d = o != null;
631
+ return /* @__PURE__ */ A("button", {
631
632
  type: "button",
632
633
  "aria-expanded": t,
634
+ "aria-controls": i,
633
635
  onClick: n,
634
- onDragOver: u ? (e) => {
635
- u && (e.preventDefault(), s?.(a));
636
+ onDragOver: d ? (e) => {
637
+ d && (e.preventDefault(), c?.(o));
636
638
  } : void 0,
637
- onDragLeave: u ? (e) => {
638
- u && (e.currentTarget.contains(e.relatedTarget) || c?.());
639
+ onDragLeave: d ? (e) => {
640
+ d && (e.currentTarget.contains(e.relatedTarget) || l?.());
639
641
  } : void 0,
640
- onDrop: u ? (e) => {
641
- u && (e.preventDefault(), l?.(a, a, null));
642
+ onDrop: d ? (e) => {
643
+ d && (e.preventDefault(), u?.(o, o, null));
642
644
  } : void 0,
643
- className: r("flex h-6 w-full items-center gap-1 rounded py-1 pe-3 text-start", i, X.groupHeader, o && "ring-accent-secondary ring-1 ring-inset"),
644
- children: [O(t ? A : j, {
645
+ className: r("flex h-6 w-full items-center gap-1 rounded py-1 pe-3 text-start", a, X.groupHeader, s && X.dropZoneActive),
646
+ children: [t ? /* @__PURE__ */ k(j, {
645
647
  stroke: .5,
646
648
  size: 12,
647
- className: "shrink-0"
648
- }), /* @__PURE__ */ O(p, { text: e })]
649
+ className: "shrink-0",
650
+ "aria-hidden": !0
651
+ }) : /* @__PURE__ */ k(M, {
652
+ stroke: .5,
653
+ size: 12,
654
+ className: "shrink-0 rtl:scale-x-[-1]",
655
+ "aria-hidden": !0
656
+ }), /* @__PURE__ */ k(p, { text: e })]
649
657
  });
650
- }, we = ({ index: e, style: t, rows: n, expandedGroups: r, onToggleGroup: i, activeConversationId: a, searchQuery: o, onSelectConversation: s, getActions: c, actionsLabel: l, groupHeaderClassName: u, itemTitleClassName: d, itemIconBadgeClassName: f, draggingId: p, dragOverId: m, allowedDropGroups: h, onDragStart: g, onDragEnd: _, onDragOver: v, onDragLeave: y, onDrop: b }) => {
651
- let x = n[e];
652
- if (x.kind === K.Header) {
653
- let n = x.groupKey === q.Pinned;
654
- return /* @__PURE__ */ O("div", {
658
+ }, Ce = ({ index: e, style: t, rows: n, expandedGroups: r, onToggleGroup: i, listId: a, activeConversationId: o, searchQuery: s, onSelectConversation: c, getActions: l, actionsLabel: u, styles: d, draggingId: f, dragOverId: p, allowedDropGroups: m, onDragStart: h, onDragEnd: g, onDragOver: _, onDragLeave: v, onDrop: y }) => {
659
+ let b = n[e];
660
+ if (b.kind === q.Header) {
661
+ let n = b.groupKey === J.Pinned;
662
+ return /* @__PURE__ */ k("div", {
663
+ role: "presentation",
655
664
  style: t,
656
665
  className: e === 0 ? "pt-0" : "pt-8",
657
- children: /* @__PURE__ */ O(Ce, {
658
- label: x.label,
659
- isExpanded: r.has(x.groupKey),
660
- onToggle: () => i(x.groupKey),
661
- className: u,
662
- dropZoneGroupKey: n ? q.Pinned : void 0,
663
- isDragOver: n && m === q.Pinned,
664
- onDragOver: n ? v : void 0,
665
- onDragLeave: n ? y : void 0,
666
- onDrop: n ? b : void 0
666
+ children: /* @__PURE__ */ k(Se, {
667
+ label: b.label,
668
+ isExpanded: r.has(b.groupKey),
669
+ onToggle: () => i(b.groupKey),
670
+ listId: a,
671
+ className: d?.groupHeaderClassName,
672
+ dropZoneGroupKey: n ? J.Pinned : void 0,
673
+ isDragOver: n && p === J.Pinned,
674
+ onDragOver: n ? _ : void 0,
675
+ onDragLeave: n ? v : void 0,
676
+ onDrop: n ? y : void 0
667
677
  })
668
678
  });
669
679
  }
670
- return /* @__PURE__ */ O("div", {
680
+ return /* @__PURE__ */ k("div", {
681
+ role: "presentation",
671
682
  style: t,
672
683
  className: "pt-1",
673
- children: /* @__PURE__ */ O(Se, {
674
- item: x.item,
675
- isActive: x.item.id === a,
676
- searchQuery: o,
677
- onSelectConversation: s,
678
- getActions: c,
679
- actionsLabel: l,
680
- itemTitleClassName: d,
681
- itemIconBadgeClassName: f,
682
- rowGroupKey: x.groupKey,
684
+ children: /* @__PURE__ */ k(xe, {
685
+ item: b.item,
686
+ isActive: b.item.id === o,
687
+ searchQuery: s,
688
+ onSelectConversation: c,
689
+ getActions: l,
690
+ actionsLabel: u,
691
+ itemTitleClassName: d?.itemTitleClassName,
692
+ itemIconBadgeClassName: d?.itemIconBadgeClassName,
693
+ rowGroupKey: b.groupKey,
683
694
  rows: n,
684
- draggingId: p,
685
- dragOverId: m,
686
- allowedDropGroups: h,
687
- onDragStart: g,
688
- onDragEnd: _,
689
- onDragOver: v,
690
- onDragLeave: y,
691
- onDrop: b
695
+ draggingId: f,
696
+ dragOverId: p,
697
+ allowedDropGroups: m,
698
+ onDragStart: h,
699
+ onDragEnd: g,
700
+ onDragOver: _,
701
+ onDragLeave: v,
702
+ onDrop: y
692
703
  })
693
704
  });
694
- }, Te = (e, t) => t === Y.All ? !0 : e.source === t, Ee = (e, t) => t ? e.title.toLowerCase().includes(t.toLowerCase()) : !0, De = new Set(Object.values(q)), Oe = b(({ conversations: e, isLoading: t, isOpen: l, onSelectConversation: u, activeConversationId: d, title: f, emptyLabel: p, noResultsLabel: m, onNewChat: g, newChatLabel: _, searchPlaceholder: v, searchClearLabel: y, filterLabels: b, groupLabels: C, styles: w, className: A, getActions: j, actionsLabel: M, onToggle: N, closeAriaLabel: P, resizable: F, defaultPanelWidth: ee = 325, minPanelWidth: te = 312, maxPanelWidth: I = 600, onPanelResizeStop: ne, headerActions: L, onMoveConversation: R, activeFilter: z, onActiveFilterChange: B }) => {
695
- let { colors: V, typography: H } = w ?? {}, [U, re] = D(""), [W, ie] = D(Y.All);
705
+ }, we = (e, t) => t === J.All ? !0 : e.source === t, Te = (e, t) => t ? e.title.toLowerCase().includes(t.toLowerCase()) : !0, Ee = new Set([
706
+ J.Pinned,
707
+ J.MyChats,
708
+ J.Shared,
709
+ J.Organization
710
+ ]), Z = b(({ conversations: e, isLoading: t, isOpen: l, onSelectConversation: u, activeConversationId: d, labels: f, onNewChat: p, styles: m, className: g, getActions: _, onToggle: v, headerActions: y, onMoveConversation: b, activeFilter: w, onActiveFilterChange: T }) => {
711
+ let { colors: j, typography: M } = m ?? {}, { title: N, emptyLabel: P, noResultsLabel: F, loadingLabel: I = "Loading conversations", newChatLabel: ee, searchPlaceholder: te, searchClearLabel: L, filterLabels: R, groupLabels: z, actionsLabel: B, closeAriaLabel: V } = f, [H, U] = O(""), [W, ne] = O(J.All);
696
712
  S(() => {
697
- z != null && (ie(z), B?.(z));
698
- }, [z]);
699
- let [G, ae] = D(() => De), [oe, se] = D(5), ue = E(null), fe = E(null), [he, ge] = D(null), [_e, ve] = D(null), [be, X] = D(null), Se = E(null), Ce = E(null), Oe = x(({ height: e }) => {
700
- se(Math.ceil(e / 36 * 2));
701
- }, []), ke = x((e) => {
702
- ae((t) => {
713
+ w != null && (ne(w), T?.(w));
714
+ }, [w]);
715
+ let [G, re] = O(() => Ee), [ie, ae] = O(5), K = C(), oe = D(null), se = D(null), [ue, fe] = O(null), [he, Y] = O(null), [ge, _e] = O(null), ye = D(null), X = D(null), xe = x(({ height: e }) => {
716
+ ae(Math.ceil(e / 36 * 2));
717
+ }, []), Se = x((e) => {
718
+ re((t) => {
703
719
  let n = new Set(t);
704
720
  return n.has(e) ? n.delete(e) : n.add(e), n;
705
721
  });
706
- }, []), Ae = x(() => {
707
- Se.current = null, Ce.current = null, ge(null), ve(null), X(null);
708
- }, []), je = x((t, n) => {
722
+ }, []), Z = x(() => {
723
+ ye.current = null, X.current = null, fe(null), Y(null), _e(null);
724
+ }, []), De = x((t, n) => {
709
725
  let r = me(t, pe(n, t), e);
710
- Se.current = t, Ce.current = r, ge(t), X(r);
711
- }, [e]), Me = x(() => {
712
- Ae();
713
- }, [Ae]), Ne = x((e) => {
714
- ve(e);
715
- }, []), Pe = x(() => {
716
- ve(null);
717
- }, []), Fe = x((e, t, n) => {
718
- let r = Se.current, i = Ce.current;
719
- Ae(), r != null && r !== e && i?.has(t) && R?.({
726
+ ye.current = t, X.current = r, fe(t), _e(r);
727
+ }, [e]), Oe = x(() => {
728
+ Z();
729
+ }, [Z]), ke = x((e) => {
730
+ Y(e);
731
+ }, []), Ae = x(() => {
732
+ Y(null);
733
+ }, []), je = x((e, t, n) => {
734
+ let r = ye.current, i = X.current;
735
+ Z(), r != null && r !== e && i?.has(t) && b?.({
720
736
  draggedId: r,
721
737
  targetGroupKey: t,
722
738
  afterId: n
723
739
  });
724
- }, [Ae, R]), Ie = n({
725
- "--cp-bg": V?.background,
726
- "--sb-border": V?.border,
727
- "--cp-item-hover": V?.itemHover,
728
- "--cp-item-active": V?.itemActive,
729
- "--cp-text": V?.text,
730
- "--cp-text-secondary": V?.textSecondary,
731
- "--cp-new-chat-hover": V?.newChatHoverBackground,
732
- "--cp-new-chat-active": V?.newChatActiveBackground,
733
- "--cp-new-chat-bg": V?.newChatBackground
734
- }), Z = T(() => e.filter((e) => Te(e, W) && Ee(e, U)), [
740
+ }, [Z, b]), Me = n({
741
+ "--cp-bg": j?.background,
742
+ "--sb-border": j?.border,
743
+ "--cp-item-hover": j?.itemHover,
744
+ "--cp-item-active": j?.itemActive,
745
+ "--cp-text": j?.text,
746
+ "--cp-text-secondary": j?.textSecondary,
747
+ "--cp-new-chat-hover": j?.newChatHoverBackground,
748
+ "--cp-new-chat-active": j?.newChatActiveBackground,
749
+ "--cp-new-chat-bg": j?.newChatBackground,
750
+ "--cp-new-chat-text": j?.newChatText,
751
+ "--cp-new-chat-shadow-blue": j?.newChatShadowBlue,
752
+ "--cp-new-chat-shadow-blue-hover": j?.newChatShadowBlueHover,
753
+ "--cp-new-chat-shadow-blue-active": j?.newChatShadowBlueActive,
754
+ "--cp-new-chat-shadow-purple": j?.newChatShadowPurple,
755
+ "--cp-new-chat-shadow-purple-hover": j?.newChatShadowPurpleHover,
756
+ "--cp-new-chat-shadow-purple-active": j?.newChatShadowPurpleActive,
757
+ "--cp-drop-zone-ring": j?.dropZoneRing,
758
+ "--cp-trigger-bg": j?.triggerBackground,
759
+ "--cp-trigger-icon": j?.triggerIcon,
760
+ "--cp-trigger-icon-idle": j?.triggerIconIdle,
761
+ "--cp-skeleton-color": j?.skeletonColor
762
+ }), Q = E(() => e.filter((e) => we(e, W) && Te(e, H)), [
735
763
  e,
736
764
  W,
737
- U
738
- ]), Le = T(() => Z.filter((e) => e.isPinned), [Z]), Re = T(() => Z.filter((e) => !e.isPinned && e.source !== J.Shared && e.source !== J.Organization), [Z]), ze = T(() => Z.filter((e) => !e.isPinned && e.source === J.Shared), [Z]), Be = T(() => Z.filter((e) => !e.isPinned && e.source === J.Organization), [Z]), Q = T(() => [
765
+ H
766
+ ]), Ne = E(() => Q.filter((e) => e.isPinned), [Q]), Pe = E(() => Q.filter((e) => !e.isPinned && e.source !== J.Shared && e.source !== J.Organization), [Q]), Fe = E(() => Q.filter((e) => !e.isPinned && e.source === J.Shared), [Q]), Ie = E(() => Q.filter((e) => !e.isPinned && e.source === J.Organization), [Q]), Le = E(() => [
739
767
  {
740
- key: q.Pinned,
741
- label: C?.pinned ?? "Pinned",
742
- items: Le
768
+ key: J.Pinned,
769
+ label: z?.pinned ?? "Pinned",
770
+ items: Ne
743
771
  },
744
772
  {
745
- key: q.MyChats,
746
- label: C?.myChats ?? "My chats",
747
- items: Re
773
+ key: J.MyChats,
774
+ label: z?.myChats ?? "My chats",
775
+ items: Pe
748
776
  },
749
777
  {
750
- key: q.Shared,
751
- label: C?.shared ?? "Shared",
752
- items: ze
778
+ key: J.Shared,
779
+ label: z?.shared ?? "Shared",
780
+ items: Fe
753
781
  },
754
782
  {
755
- key: q.Organization,
756
- label: C?.organization ?? "Organization",
757
- items: Be
783
+ key: J.Organization,
784
+ label: z?.organization ?? "Organization",
785
+ items: Ie
758
786
  }
759
787
  ], [
760
- C,
761
- Le,
762
- Re,
763
- ze,
764
- Be
765
- ]), $ = T(() => {
788
+ z,
789
+ Ne,
790
+ Pe,
791
+ Fe,
792
+ Ie
793
+ ]), $ = E(() => {
766
794
  let e = [];
767
- for (let t of Q) if (t.items.length !== 0 && (e.push({
768
- kind: K.Header,
795
+ for (let t of Le) if (t.items.length !== 0 && (e.push({
796
+ kind: q.Header,
769
797
  groupKey: t.key,
770
798
  label: t.label
771
799
  }), G.has(t.key))) for (let n of t.items) e.push({
772
- kind: K.Item,
800
+ kind: q.Item,
773
801
  item: n,
774
802
  groupKey: t.key
775
803
  });
776
804
  return e;
777
- }, [Q, G]);
805
+ }, [Le, G]);
778
806
  S(() => {
779
807
  if (!d) return;
780
- let e = Q.find((e) => e.items.some((e) => e.id === d))?.key;
808
+ let e = Le.find((e) => e.items.some((e) => e.id === d))?.key;
781
809
  if (e && !G.has(e)) {
782
- ae((t) => new Set(t).add(e));
810
+ re((t) => new Set(t).add(e));
783
811
  return;
784
812
  }
785
- if (fe.current === d) return;
786
- let t = $.findIndex((e) => e.kind === K.Item && e.item.id === d);
787
- t >= 0 && (ue.current?.scrollToRow({
813
+ if (se.current === d) return;
814
+ let t = $.findIndex((e) => e.kind === q.Item && e.item.id === d);
815
+ t >= 0 && (oe.current?.scrollToRow({
788
816
  index: t,
789
817
  align: "smart",
790
818
  behavior: "smooth"
791
- }), fe.current = d);
819
+ }), se.current = d);
792
820
  }, [
793
821
  d,
794
- Q,
822
+ Le,
795
823
  G,
796
824
  $
797
825
  ]);
798
- let Ve = T(() => ({
826
+ let Re = E(() => ({
799
827
  rows: $,
800
828
  expandedGroups: G,
801
- onToggleGroup: ke,
829
+ onToggleGroup: Se,
830
+ listId: K,
802
831
  activeConversationId: d,
803
- searchQuery: U,
832
+ searchQuery: H,
804
833
  onSelectConversation: u,
805
- getActions: j,
806
- actionsLabel: M,
807
- groupHeaderClassName: H?.groupHeaderClassName,
808
- itemTitleClassName: H?.itemTitleClassName,
809
- itemIconBadgeClassName: H?.itemIconBadgeClassName,
810
- draggingId: he,
811
- dragOverId: _e,
812
- allowedDropGroups: be,
813
- onDragStart: (e) => je(e, $),
814
- onDragEnd: Me,
815
- onDragOver: Ne,
816
- onDragLeave: Pe,
817
- onDrop: Fe
834
+ getActions: _,
835
+ actionsLabel: B,
836
+ styles: {
837
+ groupHeaderClassName: M?.groupHeaderClassName,
838
+ itemTitleClassName: M?.itemTitleClassName,
839
+ itemIconBadgeClassName: m?.itemIconBadgeClassName
840
+ },
841
+ draggingId: ue,
842
+ dragOverId: he,
843
+ allowedDropGroups: ge,
844
+ onDragStart: (e) => De(e, $),
845
+ onDragEnd: Oe,
846
+ onDragOver: ke,
847
+ onDragLeave: Ae,
848
+ onDrop: je
818
849
  }), [
819
850
  $,
820
851
  G,
821
- ke,
852
+ Se,
853
+ K,
822
854
  d,
823
- U,
855
+ H,
824
856
  u,
825
- j,
826
- M,
827
- H?.groupHeaderClassName,
828
- H?.itemTitleClassName,
829
- H?.itemIconBadgeClassName,
857
+ _,
858
+ B,
859
+ M?.groupHeaderClassName,
860
+ M?.itemTitleClassName,
861
+ m?.itemIconBadgeClassName,
862
+ ue,
830
863
  he,
831
- _e,
832
- be,
833
- je,
834
- Me,
835
- Ne,
836
- Pe,
837
- Fe
838
- ]), He = e.length === 0, Ue = e.length > 0 && Z.length === 0;
839
- return /* @__PURE__ */ k(c, {
864
+ ge,
865
+ De,
866
+ Oe,
867
+ ke,
868
+ Ae,
869
+ je
870
+ ]), ze = e.length === 0, Be = e.length > 0 && Q.length === 0;
871
+ return /* @__PURE__ */ A(c, {
840
872
  isOpen: l,
841
873
  orientation: s.Left,
842
- title: f,
874
+ title: N,
843
875
  labels: {
844
- ariaLabel: f,
845
- closeLabel: P
876
+ ariaLabel: N,
877
+ closeLabel: V
846
878
  },
847
- onClose: N,
879
+ onClose: v,
848
880
  styles: {
849
881
  colors: {
850
- background: V?.background,
851
- border: V?.border
882
+ background: j?.background,
883
+ border: j?.border
852
884
  },
853
- typography: { fontClassName: H?.fontClassName },
885
+ typography: { fontClassName: M?.fontClassName },
854
886
  bodyClassName: "flex flex-col overflow-hidden p-0 gap-3",
855
- cssVars: Ie,
856
- titleClassName: H?.fontClassName,
887
+ cssVars: Me,
888
+ titleClassName: M?.fontClassName,
857
889
  headerClassName: "h-[64px]",
858
- className: r(l ? F ? "border-l border-r mobile:w-full" : "w-[325px] border-l border-r mobile:w-full" : "w-0", A)
890
+ className: r(l ? "w-[325px] border-s border-e mobile:w-full" : "w-0", g)
859
891
  },
860
- resizable: F,
861
- defaultWidth: ee,
862
- minWidth: te,
863
- maxWidth: I,
864
- onResizeStop: ne,
865
- rightActions: L,
892
+ rightActions: y,
866
893
  children: [
867
- /* @__PURE__ */ O(xe, {
868
- label: _,
869
- onClick: g,
870
- labelClassName: H?.newChatLabelClassName
894
+ /* @__PURE__ */ k(be, {
895
+ label: ee,
896
+ onClick: p,
897
+ labelClassName: M?.newChatLabelClassName
871
898
  }),
872
- /* @__PURE__ */ O(o, {
873
- placeholder: v,
874
- value: U,
875
- onChange: re,
876
- clearLabel: y
899
+ /* @__PURE__ */ k(o, {
900
+ placeholder: te,
901
+ value: H,
902
+ onChange: U,
903
+ clearLabel: L
877
904
  }),
878
- /* @__PURE__ */ O(ye, {
905
+ /* @__PURE__ */ k(ve, {
879
906
  activeTab: W,
880
- labels: b,
907
+ labels: R,
881
908
  onChange: (e) => {
882
- ie(e), B?.(e);
909
+ ne(e), T?.(e);
883
910
  },
884
- tabClassName: H?.tabClassName
911
+ tabClassName: M?.tabClassName
912
+ }),
913
+ /* @__PURE__ */ k("span", {
914
+ role: "status",
915
+ "aria-live": "polite",
916
+ className: "sr-only",
917
+ children: t ? I : ze ? P : Be ? F : ""
885
918
  }),
886
- /* @__PURE__ */ O("div", {
919
+ /* @__PURE__ */ k("div", {
887
920
  className: "flex-1 overflow-hidden px-2 py-1",
888
- children: t ? /* @__PURE__ */ O("div", {
921
+ children: t ? /* @__PURE__ */ k("div", {
889
922
  className: "flex flex-col gap-3 px-2 py-3",
890
- children: Array.from({ length: 15 }, (e, t) => /* @__PURE__ */ O(h, {
923
+ children: Array.from({ length: 15 }, (e, t) => /* @__PURE__ */ k(h, {
891
924
  avatar: { size: 24 },
892
925
  showTitle: { width: le(t) },
893
926
  paragraph: !1,
894
927
  active: !0,
895
928
  color: "var(--bg-layer-4)"
896
929
  }, t))
897
- }) : He ? /* @__PURE__ */ O(i, { label: p }) : Ue ? /* @__PURE__ */ O(a, { label: m }) : /* @__PURE__ */ O(ce, {
898
- listRef: ue,
930
+ }) : ze ? /* @__PURE__ */ k(i, { label: P }) : Be ? /* @__PURE__ */ k(a, { label: F }) : /* @__PURE__ */ k(ce, {
931
+ listRef: oe,
932
+ id: K,
899
933
  role: "list",
900
934
  style: { height: "100%" },
901
- rowComponent: we,
935
+ rowComponent: Ce,
902
936
  rowCount: $.length,
903
937
  rowHeight: de,
904
- overscanCount: oe,
905
- onResize: Oe,
906
- rowProps: Ve
938
+ overscanCount: ie,
939
+ onResize: xe,
940
+ rowProps: Re
907
941
  })
908
942
  })
909
943
  ]
910
944
  });
911
945
  });
912
946
  //#endregion
913
- export { q as ConversationGroupKey, Oe as ConversationPanel, J as ConversationSource, Y as FilterTab };
947
+ export { Z as ConversationPanel, J as FilterTab };