@epam/ai-dial-conversation-panel 1.1.0-dev.29 → 1.1.0-dev.290

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