@epam/ai-dial-conversation-panel 1.1.0-dev.21 → 1.1.0-dev.211

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 (31) 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 -0
  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/PillTabs/PillTabs.d.ts +53 -0
  11. package/components/PillTabs/PillTabs.d.ts.map +1 -0
  12. package/components/RowRenderer/RowRenderer.d.ts +1 -1
  13. package/components/RowRenderer/RowRenderer.d.ts.map +1 -1
  14. package/index.css +1 -1
  15. package/index.d.ts +2 -2
  16. package/index.d.ts.map +1 -1
  17. package/index.js +469 -425
  18. package/models/panel-props.d.ts +51 -66
  19. package/models/panel-props.d.ts.map +1 -1
  20. package/models/virtual-row.d.ts +5 -6
  21. package/models/virtual-row.d.ts.map +1 -1
  22. package/package.json +4 -5
  23. package/types/conversation-classification.d.ts +1 -4
  24. package/types/conversation-classification.d.ts.map +1 -1
  25. package/utils/conversation-row.d.ts +1 -7
  26. package/utils/conversation-row.d.ts.map +1 -1
  27. package/utils/drag.d.ts +2 -14
  28. package/utils/drag.d.ts.map +1 -1
  29. package/components/ConversationGroup/ConversationGroup.d.ts +0 -31
  30. package/components/ConversationGroup/ConversationGroup.d.ts.map +0 -1
  31. 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";
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";
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, DialEllipsisTooltip as l, Dropdown as u, ElementSize as d, GhostIconButton as f, Highlight as p, Search as m, Skeleton as h, SkeletonVariant as g, Tag as _, mergeClasses as v } from "@epam/ai-dial-ui-kit";
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 { Fragment as ee, jsx as k, jsxs as A } from "react/jsx-runtime";
6
+ import { IconCaretDownFilled as j, IconCaretRightFilled as M, IconClock as N, IconDotsVertical as P, IconPlus as te } 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 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":
@@ -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 }) {
18
- let { styleHeight: s, styleWidth: c } = D(() => ({
19
- styleHeight: L(o?.height),
20
- styleWidth: L(o?.width)
21
- }), [o?.height, o?.width]), [l, u] = k({
17
+ function L({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
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 I(() => {
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 R({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i,
42
42
  i,
43
43
  s,
44
44
  c
45
- ]), D(() => ({
45
+ ]), E(() => ({
46
46
  height: s ?? l.height,
47
47
  width: c ?? l.width
48
48
  }), [
@@ -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) {
55
- let t = O(() => {
54
+ function ne(e) {
55
+ let t = D(() => {
56
56
  throw Error("Cannot call during render.");
57
57
  });
58
- return I(() => {
58
+ return F(() => {
59
59
  t.current = e;
60
- }, [e]), S((e) => t.current?.(e), [t]);
60
+ }, [e]), x((e) => t.current?.(e), [t]);
61
61
  }
62
- var z = null;
63
- function te(e = !1) {
64
- if (z === null || e) {
62
+ var R = null;
63
+ function re(e = !1) {
64
+ if (R === 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 ? R = "positive-descending" : (e.scrollLeft = 1, R = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), R;
69
69
  }
70
- return z;
70
+ return R;
71
71
  }
72
- function B({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
73
- if (t === "horizontal" && n) switch (te()) {
72
+ function z({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
73
+ if (t === "horizontal" && n) switch (re()) {
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 B(e, t = "Assertion error") {
85
85
  if (!e) throw console.error(t), Error(t);
86
86
  }
87
- function H(e, t) {
87
+ function V(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 || (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 U({ 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 V(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 ne({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
101
+ function ie({ 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 = H({
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 U({ 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 W({ 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 (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 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
+ 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 V(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 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 ae({ itemCount: e, itemProps: t, itemSize: n }) {
172
+ return E(() => W({
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 G({ 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
+ 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;
@@ -191,21 +191,21 @@ 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 K({ 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 } = L({
196
196
  defaultHeight: r === "vertical" ? n : void 0,
197
197
  defaultWidth: r === "horizontal" ? n : void 0,
198
198
  element: e,
199
199
  mode: r === "vertical" ? "only-height" : "only-width",
200
200
  style: t
201
- }), f = O({
201
+ }), f = D({
202
202
  height: 0,
203
203
  width: 0
204
- }), p = r === "vertical" ? u : d, m = re({
204
+ }), p = r === "vertical" ? u : d, m = G({
205
205
  containerSize: p,
206
206
  itemSize: s
207
207
  });
208
- E(() => {
208
+ T(() => {
209
209
  if (typeof c == "function") {
210
210
  let e = f.current;
211
211
  (e.height !== u || e.width !== d) && (c({
@@ -218,22 +218,22 @@ function ie({ containerElement: e, containerStyle: t, defaultContainerSize: n =
218
218
  c,
219
219
  d
220
220
  ]);
221
- let h = K({
221
+ let h = ae({
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 = x((e) => h.get(e), [h]), [_, v] = O(() => U({
226
226
  cachedBounds: h,
227
227
  containerScrollOffset: 0,
228
228
  containerSize: p,
229
229
  itemCount: a,
230
230
  overscanCount: l
231
- })), { startIndexVisible: y, startIndexOverscan: b, stopIndexVisible: x, stopIndexOverscan: C } = {
231
+ })), { startIndexVisible: y, startIndexOverscan: b, stopIndexVisible: S, stopIndexOverscan: C } = {
232
232
  startIndexVisible: Math.min(a - 1, _.startIndexVisible),
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 = 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
- ]), T = S((t) => W({
244
+ ]), E = x((t) => U({
245
245
  cachedBounds: h,
246
- containerScrollOffset: B({
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 I(() => {
265
- v(T((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
- T
270
- ]), I(() => {
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 = W({
274
+ let { scrollLeft: n, scrollTop: o } = e, s = U({
275
275
  cachedBounds: h,
276
- containerScrollOffset: B({
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 H(s, t) ? t : s;
286
+ return V(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: ne(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
303
+ let s = ie({
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 = 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 = T(s);
320
- H(_, e) || v(e);
319
+ let e = E(s);
320
+ V(_, e) || v(e);
321
321
  }
322
322
  return s;
323
323
  }
@@ -325,38 +325,38 @@ function ie({ containerElement: e, containerStyle: t, defaultContainerSize: n =
325
325
  startIndexOverscan: b,
326
326
  startIndexVisible: y,
327
327
  stopIndexOverscan: C,
328
- stopIndexVisible: x
328
+ stopIndexVisible: S
329
329
  };
330
330
  }
331
- function ae(e) {
332
- return D(() => e, Object.values(e));
331
+ function q(e) {
332
+ return E(() => e, Object.values(e));
333
333
  }
334
- function oe(e, t) {
334
+ function J(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 V(n, a) && V(r, o) && V(i, s);
337
337
  }
338
- function se(e) {
338
+ function oe(e) {
339
339
  return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
340
340
  }
341
- var ce = "data-react-window-index";
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({
341
+ var se = "data-react-window-index";
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 = q(u), h = E(() => b(s, J), [s]), [g, _] = O(null), v = oe(l), { getCellBounds: x, getEstimatedSize: C, scrollToIndex: T, startIndexOverscan: D, startIndexVisible: ee, stopIndexOverscan: A, stopIndexVisible: j } = K({
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: D(() => 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
- T(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 = w({
359
+ let r = T({
360
360
  align: e,
361
361
  containerScrollOffset: g?.scrollTop ?? 0,
362
362
  index: n
@@ -366,40 +366,40 @@ 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, 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 = `${E + t}`;
374
- return e.setAttribute(ce, n), !0;
373
+ let n = `${D + t}`;
374
+ return e.setAttribute(se, n), !0;
375
375
  });
376
376
  if (v) return l.observeRowElements(e);
377
377
  }, [
378
378
  g,
379
379
  v,
380
380
  l,
381
- E,
382
- j
383
- ]), C(() => {
384
- E >= 0 && j >= 0 && a && a({
385
- startIndex: O,
386
- stopIndex: M
387
- }, {
388
- startIndex: E,
381
+ D,
382
+ A
383
+ ]), S(() => {
384
+ D >= 0 && A >= 0 && a && a({
385
+ startIndex: ee,
389
386
  stopIndex: j
387
+ }, {
388
+ startIndex: D,
389
+ stopIndex: A
390
390
  });
391
391
  }, [
392
392
  a,
393
- E,
394
- O,
395
- j,
396
- M
393
+ D,
394
+ ee,
395
+ A,
396
+ j
397
397
  ]);
398
- let N = D(() => {
398
+ let M = E(() => {
399
399
  let e = [];
400
- if (c > 0) for (let t = E; t <= j; t++) {
401
- let n = y(t);
402
- e.push(/* @__PURE__ */ b(h, {
400
+ if (c > 0) for (let t = D; t <= A; t++) {
401
+ let n = x(t);
402
+ e.push(/* @__PURE__ */ y(h, {
403
403
  ...m,
404
404
  ariaAttributes: {
405
405
  "aria-posinset": t + 1,
@@ -420,21 +420,21 @@ function le({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
420
420
  return e;
421
421
  }, [
422
422
  h,
423
- y,
423
+ x,
424
424
  v,
425
425
  c,
426
426
  m,
427
- E,
428
- j
429
- ]), P = /* @__PURE__ */ A("div", {
427
+ D,
428
+ A
429
+ ]), N = /* @__PURE__ */ k("div", {
430
430
  "aria-hidden": !0,
431
431
  style: {
432
- height: S(),
432
+ height: C(),
433
433
  width: "100%",
434
434
  zIndex: -1
435
435
  }
436
436
  });
437
- return b(d, {
437
+ return y(d, {
438
438
  role: "list",
439
439
  ...p,
440
440
  className: t,
@@ -446,445 +446,483 @@ function le({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
446
446
  overflowY: "auto",
447
447
  ...f
448
448
  }
449
- }, N, e, P);
449
+ }, M, e, N);
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
+ }({}), 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 === Y.Item ? 36 : e === 0 ? 24 : 56, fe = (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
- }, me = (e, t) => {
463
+ }, pe = (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
- }, he = (e, t, n) => {
468
+ }, me = (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
- t && r.add(pe(t.source));
473
- } else r.add(J.Pinned);
472
+ t && r.add(fe(t.source));
473
+ } else r.add(X.Pinned);
474
474
  return r;
475
- }, ge = (e, t, n, r) => {
475
+ }, he = (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", {
485
+ }, ge = {
486
+ tabContainer: "_tabContainer_1rks7_1",
487
+ tabActive: "_tabActive_1rks7_15"
488
+ }, _e = b(({ tabs: e, activeTabId: r, onTabChange: i, styles: a }) => {
489
+ let { tabClassName: o = "dial-tiny-semi-text" } = a?.typography ?? {}, s = a?.colors;
490
+ return /* @__PURE__ */ k("div", {
491
491
  className: "flex flex-nowrap gap-1",
492
+ role: "tablist",
493
+ style: t({
494
+ "--pt-tab-text": s?.tabText,
495
+ "--pt-tab-text-hover": s?.tabTextHover,
496
+ "--pt-tab-active-text": s?.activeTabText,
497
+ "--pt-tab-border": s?.tabBorder,
498
+ "--pt-tab-bg": s?.tabBackground,
499
+ "--pt-tab-bg-hover": s?.tabBackgroundHover,
500
+ "--pt-tab-active-bg": s?.activeTabBackground,
501
+ "--pt-tab-active-bg-hover": s?.activeTabBackgroundHover
502
+ }),
492
503
  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)
504
+ let t = r === e.id;
505
+ return /* @__PURE__ */ k("div", {
506
+ role: "tab",
507
+ "aria-selected": t,
508
+ className: "contents",
509
+ children: /* @__PURE__ */ k(_, {
510
+ label: e.label,
511
+ selected: t,
512
+ onClick: () => i(e.id),
513
+ className: n("box-border h-auto shrink-0 justify-center rounded-full p-2 text-center", o, ge.tabContainer, t && ge.tabActive)
514
+ })
500
515
  }, e.id);
501
516
  })
502
517
  });
503
518
  }), ve = [
504
519
  {
505
- value: J.All,
520
+ value: X.All,
506
521
  labelKey: "all"
507
522
  },
508
523
  {
509
- value: J.MyChats,
524
+ value: X.MyChats,
510
525
  labelKey: "myChats"
511
526
  },
512
527
  {
513
- value: J.Shared,
528
+ value: X.Shared,
514
529
  labelKey: "shared"
515
530
  },
516
531
  {
517
- value: J.Organization,
532
+ value: X.Organization,
518
533
  labelKey: "organization"
519
534
  }
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, {
535
+ ], ye = b(({ activeTab: e, labels: t, onChange: n, tabClassName: r = "dial-tiny-semi-text", colors: i }) => /* @__PURE__ */ k("div", {
536
+ className: "px-3 py-2",
537
+ children: /* @__PURE__ */ k(_e, {
523
538
  tabs: ve.map(({ value: e, labelKey: n }) => ({
524
539
  id: e,
525
540
  label: t[n]
526
541
  })),
527
542
  activeTabId: e,
528
543
  onTabChange: (e) => n(e),
529
- styles: { typography: { tabClassName: y(r, "flex-1") } }
544
+ styles: {
545
+ typography: { tabClassName: v(r, "flex-1") },
546
+ colors: i
547
+ }
530
548
  })
531
- })), be = { button: "_button_1ggx8_1" }, xe = x(({ label: e, onClick: t, labelClassName: n = "dial-small-semi-text" }) => /* @__PURE__ */ A("div", {
549
+ })), be = { button: "_button_8xsgo_1" }, xe = b(({ label: e, onClick: r, labelClassName: i = "dial-small-semi-text", colors: a }) => /* @__PURE__ */ k("div", {
532
550
  className: "px-3 py-2",
533
- children: /* @__PURE__ */ j("button", {
534
- onClick: t,
551
+ style: t({
552
+ "--cp-new-chat-bg": a?.background,
553
+ "--cp-new-chat-text": a?.text,
554
+ "--cp-new-chat-focus-outline": a?.focusOutline
555
+ }),
556
+ children: /* @__PURE__ */ A("button", {
557
+ onClick: r,
535
558
  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, {
559
+ 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-md active:shadow-xs", be.button),
560
+ children: [/* @__PURE__ */ k(te, {
538
561
  size: 18,
539
562
  stroke: 2,
540
563
  className: "shrink-0"
541
- }), /* @__PURE__ */ A("span", {
542
- className: n,
564
+ }), /* @__PURE__ */ k("span", {
565
+ className: i,
543
566
  children: e
544
567
  })]
545
568
  })
546
- })), X = {
569
+ })), Z = {
547
570
  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, {
571
+ item: "_item_1qyc3_1",
572
+ itemActive: "_itemActive_1qyc3_7",
573
+ groupHeader: "_groupHeader_1qyc3_12",
574
+ taskBadge: "_taskBadge_1qyc3_16",
575
+ dropZoneActive: "_dropZoneActive_1qyc3_22",
576
+ triggerActive: "_triggerActive_1qyc3_27",
577
+ triggerIcon: "_triggerIcon_1qyc3_30",
578
+ unreadDot: "_unreadDot_1qyc3_38"
579
+ }, Se = ({ label: e, isExpanded: t, onToggle: r, listId: i, className: a = "dial-tiny-lead-text", dropZoneGroupKey: o, isDragOver: s, onDragOver: c, onDragLeave: u, onDrop: d }) => {
580
+ let f = o != null;
581
+ return /* @__PURE__ */ A("button", {
582
+ type: "button",
583
+ "aria-expanded": t,
584
+ "aria-controls": i,
585
+ onClick: r,
586
+ onDragOver: f ? (e) => {
587
+ f && (e.preventDefault(), c?.(o));
588
+ } : void 0,
589
+ onDragLeave: f ? (e) => {
590
+ f && (e.currentTarget.contains(e.relatedTarget) || u?.());
591
+ } : void 0,
592
+ onDrop: f ? (e) => {
593
+ f && (e.preventDefault(), d?.(o, o, null));
594
+ } : void 0,
595
+ className: n("flex h-6 w-full items-center gap-1 rounded py-1 pe-3 text-start", a, Z.groupHeader, s && Z.dropZoneActive),
596
+ children: [t ? /* @__PURE__ */ k(j, {
597
+ stroke: .5,
598
+ size: 12,
599
+ className: "shrink-0",
600
+ "aria-hidden": !0
601
+ }) : /* @__PURE__ */ k(M, {
602
+ stroke: .5,
603
+ size: 12,
604
+ className: "shrink-0 rtl:scale-x-[-1]",
605
+ "aria-hidden": !0
606
+ }), /* @__PURE__ */ k(l, { text: e })]
607
+ });
608
+ }, Ce = ({ item: t, isActive: r, onSelectConversation: i, searchQuery: a = "", getActions: o, onActionMenuOpen: l, actionsLabel: m = "More actions", itemTitleClassName: _ = "dial-small-text", itemIconBadgeClassName: v, taskBadgeClassName: y = "dial-caption-lead-semi-text", unreadIndicatorLabel: b = "Unread", rowGroupKey: S, rows: C, draggingId: w, dragOverId: T, allowedDropGroups: E, onDragStart: j, onDragEnd: M, onDragOver: te, onDragLeave: F, onDrop: I }) => {
609
+ let [L, ne] = O(!1), R = D(null), re = x((e) => {
610
+ ne(e), e && R.current && l?.(t, R.current);
611
+ }, [t, l]), z = o?.(t) ?? [], B = z.length > 0, V = t.isIconLoading ? /* @__PURE__ */ k(h, {
560
612
  variant: g.Circular,
561
- width: u.LG,
562
- height: u.LG,
563
- color: X.skeletonColor,
613
+ width: c.LG,
614
+ height: c.LG,
615
+ color: Z.skeletonColor,
564
616
  "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;
617
+ }) : /* @__PURE__ */ k(e, {
618
+ src: t.iconUrl,
619
+ size: c.LG,
620
+ initialsName: t.iconTooltip ?? "",
621
+ labels: { tooltip: t.iconTooltip },
622
+ styles: { badgeClassName: v }
623
+ }), H = /* @__PURE__ */ A("span", {
624
+ className: "flex shrink-0 items-center",
625
+ children: [/* @__PURE__ */ k("span", {
626
+ className: "relative flex size-3 shrink-0 items-center justify-center",
627
+ children: t.isUnread && /* @__PURE__ */ A(ee, { children: [/* @__PURE__ */ k("span", {
628
+ className: n("size-[5.33px] rounded-full", Z.unreadDot),
629
+ "aria-hidden": !0
630
+ }), /* @__PURE__ */ k("span", {
631
+ className: "sr-only",
632
+ children: b
633
+ })] })
634
+ }), V]
635
+ }), ie = ue(B, L), U = t.showTaskBadge ? /* @__PURE__ */ A("span", {
636
+ className: n("flex h-5 shrink-0 items-center justify-center gap-0.5 rounded-full border pe-2 ps-1", Z.taskBadge, y),
637
+ children: [/* @__PURE__ */ k(N, {
638
+ size: 12,
639
+ "aria-hidden": !0
640
+ }), t.taskBadgeLabel]
641
+ }) : void 0, W = S != null, ae = x((e) => {
642
+ e.currentTarget.contains(e.relatedTarget) || F?.();
643
+ }, [F]), G = x((e) => {
644
+ if (!S || !C || !I) return;
575
645
  e.preventDefault();
576
- let t = ge(e, n.id, x, b);
577
- F(n.id, b, t);
646
+ let n = he(e, t.id, C, S);
647
+ I(t.id, S, n);
578
648
  }, [
579
- n.id,
580
- 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);
649
+ t.id,
650
+ C,
651
+ S,
652
+ I
653
+ ]), K = t.id === w, q = t.id === T, J = S != null && (E?.has(S) ?? !1), oe = w != null;
654
+ return /* @__PURE__ */ A("li", {
655
+ className: n("group/conversation relative", K && "cursor-grabbing opacity-50", q && J && "rounded", q && J && Z.dropZoneActive, oe && !K && !J && "cursor-not-allowed"),
656
+ draggable: W || void 0,
657
+ onDragStart: W ? () => j?.(t.id) : void 0,
658
+ onDragEnd: W ? M : void 0,
659
+ onDragOver: W ? (e) => {
660
+ e.preventDefault(), te?.(t.id);
591
661
  } : void 0,
592
- onDragLeave: H ? U : void 0,
593
- onDrop: H ? ne : void 0,
594
- children: [/* @__PURE__ */ A("a", {
595
- href: n.href,
662
+ onDragLeave: W ? ae : void 0,
663
+ onDrop: W ? G : void 0,
664
+ children: [/* @__PURE__ */ k("a", {
665
+ href: t.href,
596
666
  className: "contents",
597
667
  onClick: (e) => {
598
- n.href && (e.preventDefault(), a(n.id));
668
+ t.href && (e.preventDefault(), i(t.id));
599
669
  },
600
- children: /* @__PURE__ */ A(d, {
601
- iconBefore: B,
602
- label: /* @__PURE__ */ A(t, {
603
- text: n.title,
604
- query: o,
670
+ children: /* @__PURE__ */ k(s, {
671
+ iconBefore: H,
672
+ label: /* @__PURE__ */ k(p, {
673
+ text: t.title,
674
+ query: a,
605
675
  className: _,
606
676
  maxLines: 1
607
677
  }),
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)
678
+ iconAfter: U,
679
+ textClassName: "min-w-0 flex-1",
680
+ "aria-current": r ? "page" : void 0,
681
+ onClick: t.href ? void 0 : () => i(t.id),
682
+ tabIndex: t.href ? -1 : void 0,
683
+ className: n("h-8 w-full justify-start gap-2 rounded-xl py-2 ps-0", ie, Z.item, r && Z.itemActive, L && Z.itemActive)
613
684
  })
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, {
685
+ }), B && /* @__PURE__ */ k("div", {
686
+ className: n("absolute inset-y-0 end-1 flex items-center", L ? "opacity-100" : "opacity-0 group-focus-within/conversation:opacity-100 group-hover/conversation:opacity-100"),
687
+ children: /* @__PURE__ */ k(u, {
617
688
  items: z,
618
- onOpenChange: ee,
689
+ onOpenChange: re,
619
690
  matchReferenceWidth: !1,
620
- listClassName: "w-[140px] cp-dropdown-overlay",
621
- children: /* @__PURE__ */ A(m, {
691
+ listClassName: "w-[200px]",
692
+ children: /* @__PURE__ */ k(f, {
622
693
  ref: R,
623
- icon: /* @__PURE__ */ A(P, {
624
- size: u.SM,
625
- className: X.triggerIcon,
694
+ icon: /* @__PURE__ */ k(P, {
695
+ size: c.SM,
696
+ className: Z.triggerIcon,
626
697
  "aria-hidden": !0
627
698
  }),
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)
699
+ size: d.Small,
700
+ "aria-label": m,
701
+ className: n(L && Z.triggerActive)
632
702
  })
633
703
  })
634
704
  })]
635
705
  });
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", {
706
+ }, 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, unreadIndicatorLabel: f, styles: p, draggingId: m, dragOverId: h, allowedDropGroups: g, onDragStart: _, onDragEnd: v, onDragOver: y, onDragLeave: b, onDrop: x }) => {
707
+ let S = n[e];
708
+ if (S.kind === Y.Header) {
709
+ let n = S.groupKey === X.Pinned;
710
+ return /* @__PURE__ */ k("div", {
670
711
  role: "presentation",
671
712
  style: t,
672
713
  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),
714
+ children: /* @__PURE__ */ k(Se, {
715
+ label: S.label,
716
+ isExpanded: r.has(S.groupKey),
717
+ onToggle: () => i(S.groupKey),
677
718
  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
719
+ className: p?.groupHeaderClassName,
720
+ dropZoneGroupKey: n ? X.Pinned : void 0,
721
+ isDragOver: n && h === X.Pinned,
722
+ onDragOver: n ? y : void 0,
723
+ onDragLeave: n ? b : void 0,
724
+ onDrop: n ? x : void 0
684
725
  })
685
726
  });
686
727
  }
687
- return /* @__PURE__ */ A("div", {
728
+ return /* @__PURE__ */ k("div", {
688
729
  role: "presentation",
689
730
  style: t,
690
731
  className: "pt-1",
691
- children: /* @__PURE__ */ A(Se, {
692
- item: x.item,
693
- isActive: x.item.id === o,
732
+ children: /* @__PURE__ */ k(Ce, {
733
+ item: S.item,
734
+ isActive: S.item.id === o,
694
735
  searchQuery: s,
695
736
  onSelectConversation: c,
696
737
  getActions: l,
697
738
  onActionMenuOpen: u,
698
739
  actionsLabel: d,
699
- itemTitleClassName: f?.itemTitleClassName,
700
- itemIconBadgeClassName: f?.itemIconBadgeClassName,
701
- rowGroupKey: x.groupKey,
740
+ unreadIndicatorLabel: f,
741
+ itemTitleClassName: p?.itemTitleClassName,
742
+ itemIconBadgeClassName: p?.itemIconBadgeClassName,
743
+ taskBadgeClassName: p?.taskBadgeClassName,
744
+ rowGroupKey: S.groupKey,
702
745
  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
746
+ draggingId: m,
747
+ dragOverId: h,
748
+ allowedDropGroups: g,
749
+ onDragStart: _,
750
+ onDragEnd: v,
751
+ onDragOver: y,
752
+ onDragLeave: b,
753
+ onDrop: x
711
754
  })
712
755
  });
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
- C(() => {
721
- T != null && (G(T), E?.(T));
756
+ }, Te = (e, t) => t === X.All ? !0 : e.source === t, Ee = (e, t) => t ? e.title.toLowerCase().includes(t.toLowerCase()) : !0, De = new Set([
757
+ X.Pinned,
758
+ X.MyChats,
759
+ X.Shared,
760
+ X.Organization
761
+ ]), Oe = b(({ 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: w, activeFilter: T, onActiveFilterChange: ee, isFilterTabsHidden: j = !1 }) => {
762
+ let { colors: M, typography: N, newChatButton: P, filterTabs: te } = p ?? {}, { title: F, emptyLabel: I, noResultsLabel: L, loadingLabel: ne = "Loading conversations", newChatLabel: R, searchPlaceholder: re, searchClearLabel: z, filterLabels: B, groupLabels: V, actionsLabel: H, unreadIndicatorLabel: ie, closeAriaLabel: U } = d, [W, ae] = O(""), [G, K] = O(X.All);
763
+ S(() => {
764
+ T != null && K(T);
722
765
  }, [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) => {
766
+ let [q, J] = O(() => De), [oe, se] = O(5), ue = C(), fe = D(null), he = D(null), [ge, _e] = O(null), [ve, be] = O(null), [Se, Ce] = O(null), Oe = D(null), ke = D(null), Ae = x(({ height: e }) => {
767
+ se(Math.ceil(e / 36 * 2));
768
+ }, []), je = x((e) => {
769
+ ae(e ?? "");
770
+ }, []), Me = x((e) => {
771
+ J((t) => {
727
772
  let n = new Set(t);
728
773
  return n.has(e) ? n.delete(e) : n.add(e), n;
729
774
  });
730
- }, []), Z = S(() => {
731
- be.current = null, X.current = null, pe(null), Y(null), ve(null);
732
- }, []), Oe = S((t, n) => {
733
- 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?.({
775
+ }, []), Ne = x(() => {
776
+ Oe.current = null, ke.current = null, _e(null), be(null), Ce(null);
777
+ }, []), Pe = x((t, n) => {
778
+ let r = me(t, pe(n, t), e);
779
+ Oe.current = t, ke.current = r, _e(t), Ce(r);
780
+ }, [e]), Fe = x(() => {
781
+ Ne();
782
+ }, [Ne]), Ie = x((e) => {
783
+ be(e);
784
+ }, []), Le = x(() => {
785
+ be(null);
786
+ }, []), Re = x((e, t, n) => {
787
+ let r = Oe.current, i = ke.current;
788
+ Ne(), r != null && r !== e && i?.has(t) && w?.({
744
789
  draggedId: r,
745
790
  targetGroupKey: t,
746
791
  afterId: n
747
792
  });
748
- }, [Z, x]), Ne = n({
749
- "--cp-bg": M?.background,
750
- "--sb-border": M?.border,
793
+ }, [Ne, w]), ze = t({
751
794
  "--cp-item-hover": M?.itemHover,
752
795
  "--cp-item-active": M?.itemActive,
753
796
  "--cp-text": M?.text,
754
797
  "--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,
798
+ "--cp-new-chat-bg": P?.background,
799
+ "--cp-new-chat-text": P?.text,
800
+ "--cp-new-chat-focus-outline": P?.focusOutline,
765
801
  "--cp-drop-zone-ring": M?.dropZoneRing,
766
802
  "--cp-trigger-bg": M?.triggerBackground,
767
803
  "--cp-trigger-icon": M?.triggerIcon,
768
804
  "--cp-trigger-icon-idle": M?.triggerIconIdle,
769
- "--cp-skeleton-color": M?.skeletonColor
770
- }), Q = D(() => e.filter((e) => Te(e, W) && Ee(e, U)), [
805
+ "--cp-skeleton-color": M?.skeletonColor,
806
+ "--cp-task-badge-border": M?.taskBadgeBorder,
807
+ "--cp-task-badge-bg": M?.taskBadgeBackground,
808
+ "--cp-task-badge-text": M?.taskBadgeText,
809
+ "--cp-unread-dot": M?.unreadDot
810
+ }), Q = E(() => e.filter((e) => Te(e, G) && Ee(e, W)), [
771
811
  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(() => [
812
+ G,
813
+ W
814
+ ]), Be = E(() => Q.filter((e) => e.isPinned), [Q]), Ve = E(() => Q.filter((e) => !e.isPinned && e.source !== X.Shared && e.source !== X.Organization), [Q]), He = E(() => Q.filter((e) => !e.isPinned && e.source === X.Shared), [Q]), Ue = E(() => Q.filter((e) => !e.isPinned && e.source === X.Organization), [Q]), We = E(() => [
775
815
  {
776
- key: J.Pinned,
777
- label: B?.pinned ?? "Pinned",
778
- items: Pe
816
+ key: X.Pinned,
817
+ label: V?.pinned ?? "Pinned",
818
+ items: Be
779
819
  },
780
820
  {
781
- key: J.MyChats,
782
- label: B?.myChats ?? "My chats",
783
- items: Fe
821
+ key: X.MyChats,
822
+ label: V?.myChats ?? "My chats",
823
+ items: Ve
784
824
  },
785
825
  {
786
- key: J.Shared,
787
- label: B?.shared ?? "Shared",
788
- items: Ie
826
+ key: X.Shared,
827
+ label: V?.shared ?? "Shared",
828
+ items: He
789
829
  },
790
830
  {
791
- key: J.Organization,
792
- label: B?.organization ?? "Organization",
793
- items: Le
831
+ key: X.Organization,
832
+ label: V?.organization ?? "Organization",
833
+ items: Ue
794
834
  }
795
835
  ], [
796
- B,
797
- Pe,
798
- Fe,
799
- Ie,
800
- Le
801
- ]), $ = D(() => {
836
+ V,
837
+ Be,
838
+ Ve,
839
+ He,
840
+ Ue
841
+ ]), $ = E(() => {
802
842
  let e = [];
803
- for (let t of Re) if (t.items.length !== 0 && (e.push({
804
- kind: q.Header,
843
+ for (let t of We) if (t.items.length !== 0 && (e.push({
844
+ kind: Y.Header,
805
845
  groupKey: t.key,
806
846
  label: t.label
807
- }), K.has(t.key))) for (let n of t.items) e.push({
808
- kind: q.Item,
847
+ }), q.has(t.key))) for (let n of t.items) e.push({
848
+ kind: Y.Item,
809
849
  item: n,
810
850
  groupKey: t.key
811
851
  });
812
852
  return e;
813
- }, [Re, K]);
814
- 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,
853
+ }, [We, q]);
854
+ S(() => {
855
+ if (!u || he.current === u) return;
856
+ let e = $.findIndex((e) => e.kind === Y.Item && e.item.id === u);
857
+ e >= 0 && (fe.current?.scrollToRow({
858
+ index: e,
825
859
  align: "smart",
826
860
  behavior: "smooth"
827
- }), ce.current = d);
861
+ }), he.current = u);
828
862
  }, [
829
- d,
830
- Re,
831
- K,
863
+ u,
864
+ We,
865
+ q,
832
866
  $
833
867
  ]);
834
- let ze = D(() => ({
868
+ let Ge = E(() => ({
835
869
  rows: $,
836
- expandedGroups: K,
837
- onToggleGroup: Ce,
838
- listId: oe,
839
- activeConversationId: d,
840
- searchQuery: U,
841
- onSelectConversation: u,
870
+ expandedGroups: q,
871
+ onToggleGroup: Me,
872
+ listId: ue,
873
+ activeConversationId: u,
874
+ searchQuery: W,
875
+ onSelectConversation: l,
842
876
  getActions: _,
843
877
  onActionMenuOpen: v,
844
- actionsLabel: V,
878
+ actionsLabel: H,
879
+ unreadIndicatorLabel: ie,
845
880
  styles: {
846
881
  groupHeaderClassName: N?.groupHeaderClassName,
847
882
  itemTitleClassName: N?.itemTitleClassName,
848
- itemIconBadgeClassName: m?.itemIconBadgeClassName
883
+ itemIconBadgeClassName: p?.itemIconBadgeClassName,
884
+ taskBadgeClassName: p?.taskBadgeClassName
849
885
  },
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
886
+ draggingId: ge,
887
+ dragOverId: ve,
888
+ allowedDropGroups: Se,
889
+ onDragStart: (e) => Pe(e, $),
890
+ onDragEnd: Fe,
891
+ onDragOver: Ie,
892
+ onDragLeave: Le,
893
+ onDrop: Re
858
894
  }), [
859
895
  $,
860
- K,
861
- Ce,
862
- oe,
863
- d,
864
- U,
896
+ q,
897
+ Me,
898
+ ue,
865
899
  u,
900
+ W,
901
+ l,
866
902
  _,
867
903
  v,
868
- V,
904
+ H,
905
+ ie,
869
906
  N?.groupHeaderClassName,
870
907
  N?.itemTitleClassName,
871
- m?.itemIconBadgeClassName,
872
- de,
908
+ p?.itemIconBadgeClassName,
909
+ p?.taskBadgeClassName,
873
910
  ge,
874
- _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,
911
+ ve,
912
+ Se,
913
+ Pe,
914
+ Fe,
915
+ Ie,
916
+ Le,
917
+ Re
918
+ ]), Ke = e.length === 0, qe = e.length > 0 && Q.length === 0;
919
+ return /* @__PURE__ */ A(o, {
920
+ isOpen: c,
921
+ orientation: a.Left,
922
+ title: F,
885
923
  labels: {
886
- ariaLabel: P,
887
- closeLabel: H
924
+ ariaLabel: F,
925
+ closeLabel: U
888
926
  },
889
927
  onClose: y,
890
928
  styles: {
@@ -894,66 +932,72 @@ var q = /* @__PURE__ */ function(e) {
894
932
  },
895
933
  typography: { fontClassName: N?.fontClassName },
896
934
  bodyClassName: "flex flex-col overflow-hidden p-0 gap-3",
897
- cssVars: Ne,
935
+ cssVars: ze,
898
936
  titleClassName: N?.fontClassName,
899
937
  headerClassName: "h-[64px]",
900
- className: r(l ? "w-[325px] border-s border-e mobile:w-full" : "w-0", g)
938
+ className: n(c ? "w-[324px] mobile:w-full" : "w-0", g)
901
939
  },
902
940
  rightActions: b,
903
941
  children: [
904
- /* @__PURE__ */ A(xe, {
942
+ /* @__PURE__ */ k(xe, {
905
943
  label: R,
906
- onClick: p,
907
- labelClassName: N?.newChatLabelClassName
944
+ onClick: f,
945
+ labelClassName: N?.newChatLabelClassName,
946
+ colors: P
908
947
  }),
909
- /* @__PURE__ */ A(o, {
910
- value: U,
911
- onChange: ne,
912
- labels: {
913
- placeholder: ee,
914
- clearLabel: z
915
- }
948
+ /* @__PURE__ */ k("div", {
949
+ role: "search",
950
+ className: "px-3 py-2",
951
+ children: /* @__PURE__ */ k(m, {
952
+ wrapperClassName: "rounded-full",
953
+ value: W,
954
+ onChange: je,
955
+ placeholder: re,
956
+ clearLabel: z,
957
+ "aria-label": re
958
+ })
916
959
  }),
917
- /* @__PURE__ */ A(ye, {
918
- activeTab: W,
919
- labels: te,
960
+ !j && /* @__PURE__ */ k(ye, {
961
+ activeTab: G,
962
+ labels: B,
920
963
  onChange: (e) => {
921
- G(e), E?.(e);
964
+ K(e), ee?.(e);
922
965
  },
923
- tabClassName: N?.tabClassName
966
+ tabClassName: N?.tabClassName,
967
+ colors: te
924
968
  }),
925
- /* @__PURE__ */ A("span", {
969
+ /* @__PURE__ */ k("span", {
926
970
  role: "status",
927
971
  "aria-live": "polite",
928
972
  className: "sr-only",
929
- children: t ? L : Be ? F : Ve ? I : ""
973
+ children: s ? ne : Ke ? I : qe ? L : ""
930
974
  }),
931
- /* @__PURE__ */ A("div", {
975
+ /* @__PURE__ */ k("div", {
932
976
  className: "flex-1 overflow-hidden px-2 py-1",
933
- children: t ? /* @__PURE__ */ A("div", {
977
+ children: s ? /* @__PURE__ */ k("div", {
934
978
  className: "flex flex-col gap-3 px-2 py-3",
935
- children: Array.from({ length: 15 }, (e, t) => /* @__PURE__ */ A(h, {
979
+ children: Array.from({ length: 15 }, (e, t) => /* @__PURE__ */ k(h, {
936
980
  avatar: { size: 24 },
937
- showTitle: { width: ue(t) },
981
+ showTitle: { width: le(t) },
938
982
  paragraph: !1,
939
983
  active: !0,
940
- color: "var(--bg-layer-4)"
984
+ color: Z.skeletonColor
941
985
  }, t))
942
- }) : Be ? /* @__PURE__ */ A(i, { label: F }) : Ve ? /* @__PURE__ */ A(a, { label: I }) : /* @__PURE__ */ A(le, {
943
- listRef: se,
944
- id: oe,
986
+ }) : Ke ? /* @__PURE__ */ k(r, { label: I }) : qe ? /* @__PURE__ */ k(i, { label: L }) : /* @__PURE__ */ k(ce, {
987
+ listRef: fe,
988
+ id: ue,
945
989
  role: "list",
946
990
  style: { height: "100%" },
947
991
  rowComponent: we,
948
992
  rowCount: $.length,
949
- rowHeight: fe,
950
- overscanCount: ie,
951
- onResize: Se,
952
- rowProps: ze
993
+ rowHeight: de,
994
+ overscanCount: oe,
995
+ onResize: Ae,
996
+ rowProps: Ge
953
997
  })
954
998
  })
955
999
  ]
956
1000
  });
957
1001
  });
958
1002
  //#endregion
959
- export { Z as ConversationPanel, J as FilterTab };
1003
+ export { Oe as ConversationPanel, X as FilterTab };