@epam/ai-dial-conversation-panel 1.1.0-dev.262 → 1.1.0-dev.267

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { DeploymentIcon as e, buildCssVars as t, mergeClasses as n } from "@epam/ai-dial-chat-shared";
2
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 _, 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";
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
+ 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 { 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 F = typeof window < "u" ? T : S;
9
- function I(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 I(e) {
14
14
  break;
15
15
  }
16
16
  }
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({
17
+ function te({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
18
+ let { styleHeight: s, styleWidth: c } = D(() => ({
19
+ styleHeight: R(o?.height),
20
+ styleWidth: R(o?.width)
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 F(() => {
25
+ return L(() => {
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 L({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i,
42
42
  i,
43
43
  s,
44
44
  c
45
- ]), E(() => ({
45
+ ]), D(() => ({
46
46
  height: s ?? l.height,
47
47
  width: c ?? l.width
48
48
  }), [
@@ -51,26 +51,26 @@ function L({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i,
51
51
  c
52
52
  ]);
53
53
  }
54
- function ne(e) {
55
- let t = D(() => {
54
+ function z(e) {
55
+ let t = O(() => {
56
56
  throw Error("Cannot call during render.");
57
57
  });
58
- return F(() => {
58
+ return L(() => {
59
59
  t.current = e;
60
- }, [e]), x((e) => t.current?.(e), [t]);
60
+ }, [e]), S((e) => t.current?.(e), [t]);
61
61
  }
62
- var R = null;
63
- function re(e = !1) {
64
- if (R === 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 ? R = "positive-descending" : (e.scrollLeft = 1, R = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), R;
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 R;
70
+ return B;
71
71
  }
72
- function z({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
73
- if (t === "horizontal" && n) switch (re()) {
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 z({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
81
81
  }
82
82
  return r;
83
83
  }
84
- function B(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 V(e, t) {
87
+ function U(e, t) {
88
88
  if (e === t) return !0;
89
- if (!!e != !!t || (B(e !== void 0), B(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 H({ 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 B(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 ie({ 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 = H({
103
+ let s = re({
104
104
  cachedBounds: t,
105
105
  itemCount: r,
106
106
  itemSize: i
@@ -112,7 +112,7 @@ function ie({ 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 U({ 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 U({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCo
131
131
  stopIndexOverscan: l
132
132
  };
133
133
  }
134
- function W({ 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 (B(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 W({ itemCount: e, itemProps: t, itemSize: n }) {
151
151
  });
152
152
  else {
153
153
  let t = r.get(e - 1);
154
- B(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 B(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 W({ itemCount: e, itemProps: t, itemSize: n }) {
168
168
  }
169
169
  };
170
170
  }
171
- function ae({ itemCount: e, itemProps: t, itemSize: n }) {
172
- return E(() => W({
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 ae({ itemCount: e, itemProps: t, itemSize: n }) {
179
179
  n
180
180
  ]);
181
181
  }
182
- function G({ 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
- 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;
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,21 +191,21 @@ function G({ containerSize: e, itemSize: t }) {
191
191
  }
192
192
  return n;
193
193
  }
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({
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,
199
199
  mode: r === "vertical" ? "only-height" : "only-width",
200
200
  style: t
201
- }), f = D({
201
+ }), f = O({
202
202
  height: 0,
203
203
  width: 0
204
- }), p = r === "vertical" ? u : d, m = G({
204
+ }), p = r === "vertical" ? u : d, m = q({
205
205
  containerSize: p,
206
206
  itemSize: s
207
207
  });
208
- T(() => {
208
+ E(() => {
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 K({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0
218
218
  c,
219
219
  d
220
220
  ]);
221
- let h = ae({
221
+ let h = ie({
222
222
  itemCount: a,
223
223
  itemProps: o,
224
224
  itemSize: m
225
- }), g = x((e) => h.get(e), [h]), [_, v] = O(() => U({
225
+ }), g = S((e) => h.get(e), [h]), [_, v] = k(() => G({
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: S, stopIndexOverscan: C } = {
231
+ })), { startIndexVisible: y, startIndexOverscan: b, stopIndexVisible: x, 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 = x(() => H({
236
+ }, w = S(() => re({
237
237
  cachedBounds: h,
238
238
  itemCount: a,
239
239
  itemSize: m
@@ -241,9 +241,9 @@ function K({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0
241
241
  h,
242
242
  a,
243
243
  m
244
- ]), E = x((t) => U({
244
+ ]), T = S((t) => G({
245
245
  cachedBounds: h,
246
- containerScrollOffset: z({
246
+ containerScrollOffset: V({
247
247
  containerElement: e,
248
248
  direction: r,
249
249
  isRtl: i,
@@ -261,19 +261,19 @@ function K({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0
261
261
  a,
262
262
  l
263
263
  ]);
264
- return F(() => {
265
- v(E((r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0));
264
+ return L(() => {
265
+ v(T((r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0));
266
266
  }, [
267
267
  e,
268
268
  r,
269
- E
270
- ]), F(() => {
269
+ T
270
+ ]), L(() => {
271
271
  if (!e) return;
272
272
  let t = () => {
273
273
  v((t) => {
274
- let { scrollLeft: n, scrollTop: o } = e, s = U({
274
+ let { scrollLeft: n, scrollTop: o } = e, s = G({
275
275
  cachedBounds: h,
276
- containerScrollOffset: z({
276
+ containerScrollOffset: V({
277
277
  containerElement: e,
278
278
  direction: r,
279
279
  isRtl: i,
@@ -283,7 +283,7 @@ function K({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0
283
283
  itemCount: a,
284
284
  overscanCount: l
285
285
  });
286
- return V(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 K({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0
299
299
  ]), {
300
300
  getCellBounds: g,
301
301
  getEstimatedSize: w,
302
- scrollToIndex: ne(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
303
- let s = ie({
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 K({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0
310
310
  itemSize: m
311
311
  });
312
312
  if (e) {
313
- if (s = z({
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
- let e = E(s);
320
- V(_, e) || v(e);
319
+ let e = T(s);
320
+ U(_, e) || v(e);
321
321
  }
322
322
  return s;
323
323
  }
@@ -325,38 +325,38 @@ function K({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0
325
325
  startIndexOverscan: b,
326
326
  startIndexVisible: y,
327
327
  stopIndexOverscan: C,
328
- stopIndexVisible: S
328
+ stopIndexVisible: x
329
329
  };
330
330
  }
331
- function q(e) {
332
- return E(() => e, Object.values(e));
331
+ function J(e) {
332
+ return D(() => e, Object.values(e));
333
333
  }
334
- function J(e, t) {
334
+ function oe(e, t) {
335
335
  let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
336
- return V(n, a) && V(r, o) && V(i, s);
336
+ return U(n, a) && U(r, o) && U(i, s);
337
337
  }
338
- function oe(e) {
338
+ function se(e) {
339
339
  return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
340
340
  }
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({
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 = 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,
347
347
  direction: "vertical",
348
348
  itemCount: c,
349
349
  itemProps: m,
350
- itemSize: E(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
350
+ itemSize: D(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
351
351
  onResize: i,
352
352
  overscanCount: o
353
353
  });
354
- w(r, () => ({
354
+ T(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 = T({
359
+ let r = w({
360
360
  align: e,
361
361
  containerScrollOffset: g?.scrollTop ?? 0,
362
362
  index: n
@@ -366,40 +366,40 @@ function ce({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
366
366
  top: r
367
367
  });
368
368
  }
369
- }), [g, T]), F(() => {
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;
373
- let n = `${D + t}`;
374
- return e.setAttribute(se, n), !0;
373
+ let n = `${E + t}`;
374
+ return e.setAttribute(ce, n), !0;
375
375
  });
376
376
  if (v) return l.observeRowElements(e);
377
377
  }, [
378
378
  g,
379
379
  v,
380
380
  l,
381
- D,
381
+ E,
382
382
  A
383
- ]), S(() => {
384
- D >= 0 && A >= 0 && a && a({
385
- startIndex: ee,
386
- stopIndex: j
383
+ ]), C(() => {
384
+ E >= 0 && A >= 0 && a && a({
385
+ startIndex: O,
386
+ stopIndex: M
387
387
  }, {
388
- startIndex: D,
388
+ startIndex: E,
389
389
  stopIndex: A
390
390
  });
391
391
  }, [
392
392
  a,
393
- D,
394
- ee,
393
+ E,
394
+ O,
395
395
  A,
396
- j
396
+ M
397
397
  ]);
398
- let M = E(() => {
398
+ let N = D(() => {
399
399
  let e = [];
400
- if (c > 0) for (let t = D; t <= A; t++) {
401
- let n = x(t);
402
- e.push(/* @__PURE__ */ y(h, {
400
+ if (c > 0) for (let t = E; t <= A; t++) {
401
+ let n = y(t);
402
+ e.push(/* @__PURE__ */ b(h, {
403
403
  ...m,
404
404
  ariaAttributes: {
405
405
  "aria-posinset": t + 1,
@@ -420,21 +420,21 @@ function ce({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
420
420
  return e;
421
421
  }, [
422
422
  h,
423
- x,
423
+ y,
424
424
  v,
425
425
  c,
426
426
  m,
427
- D,
427
+ E,
428
428
  A
429
- ]), N = /* @__PURE__ */ k("div", {
429
+ ]), P = /* @__PURE__ */ j("div", {
430
430
  "aria-hidden": !0,
431
431
  style: {
432
- height: C(),
432
+ height: S(),
433
433
  width: "100%",
434
434
  zIndex: -1
435
435
  }
436
436
  });
437
- return y(d, {
437
+ return b(d, {
438
438
  role: "list",
439
439
  ...p,
440
440
  className: t,
@@ -446,7 +446,7 @@ function ce({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
446
446
  overflowY: "auto",
447
447
  ...f
448
448
  }
449
- }, M, e, N);
449
+ }, N, e, P);
450
450
  }
451
451
  //#endregion
452
452
  //#region src/types/virtual-row.ts
@@ -454,25 +454,25 @@ var Y = /* @__PURE__ */ function(e) {
454
454
  return e.Header = "header", e.Item = "item", e;
455
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
- }({}), 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) => {
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
459
  case X.Shared: return X.Shared;
460
460
  case X.Organization: return X.Organization;
461
461
  default: return X.MyChats;
462
462
  }
463
- }, pe = (e, t) => {
463
+ }, me = (e, t) => {
464
464
  let n = null;
465
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
- }, me = (e, t, n) => {
468
+ }, he = (e, t, n) => {
469
469
  let r = /* @__PURE__ */ new Set();
470
470
  if (t != null && r.add(t), t === X.Pinned) {
471
471
  let t = n.find((t) => t.id === e);
472
- t && r.add(fe(t.source));
472
+ t && r.add(pe(t.source));
473
473
  } else r.add(X.Pinned);
474
474
  return r;
475
- }, he = (e, t, n, r) => {
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;
@@ -482,40 +482,7 @@ var Y = /* @__PURE__ */ function(e) {
482
482
  a = e.item.id;
483
483
  }
484
484
  return null;
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
- 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
- }),
503
- children: e.map((e) => {
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
- })
515
- }, e.id);
516
- })
517
- });
518
- }), ve = [
485
+ }, _e = [
519
486
  {
520
487
  value: X.All,
521
488
  labelKey: "all"
@@ -532,53 +499,50 @@ var Y = /* @__PURE__ */ function(e) {
532
499
  value: X.Organization,
533
500
  labelKey: "organization"
534
501
  }
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, {
538
- tabs: ve.map(({ value: e, labelKey: n }) => ({
539
- id: e,
540
- label: t[n]
541
- })),
542
- activeTabId: e,
543
- onTabChange: (e) => n(e),
544
- styles: {
545
- typography: { tabClassName: v(r, "flex-1") },
546
- colors: i
547
- }
548
- })
549
- })), be = { button: "_button_8xsgo_1" }, xe = b(({ label: e, onClick: r, labelClassName: i = "dial-small-semi-text", colors: a }) => /* @__PURE__ */ k("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", {
550
514
  className: "px-3 py-2",
551
515
  style: t({
552
516
  "--cp-new-chat-bg": a?.background,
553
517
  "--cp-new-chat-text": a?.text,
554
518
  "--cp-new-chat-focus-outline": a?.focusOutline
555
519
  }),
556
- children: /* @__PURE__ */ A("button", {
520
+ children: /* @__PURE__ */ M("button", {
557
521
  onClick: r,
558
522
  type: "button",
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-xs active:shadow-xs", be.button),
560
- children: [/* @__PURE__ */ k(te, {
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, {
561
525
  size: 18,
562
526
  stroke: 2,
563
527
  className: "shrink-0"
564
- }), /* @__PURE__ */ k("span", {
528
+ }), /* @__PURE__ */ j("span", {
565
529
  className: i,
566
530
  children: e
567
531
  })]
568
532
  })
569
533
  })), Z = {
570
- skeletonColor: "var(--cp-skeleton-color, var(--bg-layer-4, #d1dbea))",
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: l, onDrop: u }) => {
534
+ skeletonColor: "var(--cp-skeleton-color, var(--bg-control-disable-primary, #dce0e8))",
535
+ item: "_item_1tjrz_1",
536
+ itemActive: "_itemActive_1tjrz_7",
537
+ groupHeader: "_groupHeader_1tjrz_12",
538
+ taskBadge: "_taskBadge_1tjrz_16",
539
+ dropZoneActive: "_dropZoneActive_1tjrz_22",
540
+ triggerActive: "_triggerActive_1tjrz_27",
541
+ triggerIcon: "_triggerIcon_1tjrz_30",
542
+ unreadDot: "_unreadDot_1tjrz_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 }) => {
580
544
  let f = o != null;
581
- return /* @__PURE__ */ A("button", {
545
+ return /* @__PURE__ */ M("button", {
582
546
  type: "button",
583
547
  "aria-expanded": t,
584
548
  "aria-controls": i,
@@ -593,125 +557,125 @@ var Y = /* @__PURE__ */ function(e) {
593
557
  f && (e.preventDefault(), u?.(o, o, null));
594
558
  } : void 0,
595
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),
596
- children: [t ? /* @__PURE__ */ k(j, {
560
+ children: [t ? /* @__PURE__ */ j(N, {
597
561
  stroke: .5,
598
562
  size: 12,
599
563
  className: "shrink-0",
600
564
  "aria-hidden": !0
601
- }) : /* @__PURE__ */ k(M, {
565
+ }) : /* @__PURE__ */ j(P, {
602
566
  stroke: .5,
603
567
  size: 12,
604
568
  className: "shrink-0 rtl:scale-x-[-1]",
605
569
  "aria-hidden": !0
606
- }), /* @__PURE__ */ k(d, { text: e })]
570
+ }), /* @__PURE__ */ j(d, { text: e })]
607
571
  });
608
- }, Ce = ({ 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: 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 && d?.(t, R.current);
611
- }, [t, d]), z = o?.(t) ?? [], B = z.length > 0, V = t.isIconLoading ? /* @__PURE__ */ k(h, {
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, {
612
576
  variant: g.Circular,
613
577
  width: c.LG,
614
578
  height: c.LG,
615
579
  color: Z.skeletonColor,
616
580
  "aria-hidden": !0
617
- }) : /* @__PURE__ */ k(e, {
581
+ }) : /* @__PURE__ */ j(e, {
618
582
  src: t.iconUrl,
619
583
  size: c.LG,
620
584
  initialsName: t.iconTooltip ?? "",
621
585
  labels: { tooltip: t.iconTooltip },
622
586
  styles: { badgeClassName: v }
623
- }), H = /* @__PURE__ */ A("span", {
587
+ }), U = /* @__PURE__ */ M("span", {
624
588
  className: "flex shrink-0 items-center",
625
- children: [/* @__PURE__ */ k("span", {
589
+ children: [/* @__PURE__ */ j("span", {
626
590
  className: "relative flex size-3 shrink-0 items-center justify-center",
627
- children: t.isUnread && /* @__PURE__ */ A(ee, { children: [/* @__PURE__ */ k("span", {
591
+ children: t.isUnread && /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j("span", {
628
592
  className: n("size-[5.33px] rounded-full", Z.unreadDot),
629
593
  "aria-hidden": !0
630
- }), /* @__PURE__ */ k("span", {
594
+ }), /* @__PURE__ */ j("span", {
631
595
  className: "sr-only",
632
596
  children: b
633
597
  })] })
634
- }), V]
635
- }), ie = ue(B, L), U = t.showTaskBadge ? /* @__PURE__ */ A("span", {
598
+ }), H]
599
+ }), re = de(V, R), W = t.showTaskBadge ? /* @__PURE__ */ M("span", {
636
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),
637
- children: [/* @__PURE__ */ k(N, {
601
+ children: [/* @__PURE__ */ j(F, {
638
602
  size: 12,
639
603
  "aria-hidden": !0
640
604
  }), 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;
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;
645
609
  e.preventDefault();
646
- let n = he(e, t.id, C, S);
647
- I(t.id, S, n);
610
+ let n = ge(e, t.id, C, x);
611
+ L(t.id, x, n);
648
612
  }, [
649
613
  t.id,
650
614
  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);
615
+ x,
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);
661
625
  } : void 0,
662
- onDragLeave: W ? ae : void 0,
663
- onDrop: W ? G : void 0,
664
- children: [/* @__PURE__ */ k("a", {
626
+ onDragLeave: G ? K : void 0,
627
+ onDrop: G ? ie : void 0,
628
+ children: [/* @__PURE__ */ j("a", {
665
629
  href: t.href,
666
630
  className: "contents",
667
631
  onClick: (e) => {
668
632
  t.href && (e.preventDefault(), i(t.id));
669
633
  },
670
- children: /* @__PURE__ */ k(s, {
671
- iconBefore: H,
672
- label: /* @__PURE__ */ k(p, {
634
+ children: /* @__PURE__ */ j(s, {
635
+ iconBefore: U,
636
+ label: /* @__PURE__ */ j(p, {
673
637
  text: t.title,
674
638
  query: a,
675
639
  className: _,
676
640
  maxLines: 1
677
641
  }),
678
- iconAfter: U,
642
+ iconAfter: W,
679
643
  textClassName: "min-w-0 flex-1",
680
644
  "aria-current": r ? "page" : void 0,
681
645
  onClick: t.href ? void 0 : () => i(t.id),
682
646
  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)
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)
684
648
  })
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(l, {
688
- items: z,
689
- onOpenChange: re,
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,
690
654
  matchReferenceWidth: !1,
691
655
  listClassName: "w-[200px]",
692
- children: /* @__PURE__ */ k(f, {
693
- ref: R,
694
- icon: /* @__PURE__ */ k(P, {
656
+ children: /* @__PURE__ */ j(f, {
657
+ ref: z,
658
+ icon: /* @__PURE__ */ j(ee, {
695
659
  size: c.SM,
696
660
  className: Z.triggerIcon,
697
661
  "aria-hidden": !0
698
662
  }),
699
663
  size: u.Small,
700
664
  "aria-label": m,
701
- className: n(L && Z.triggerActive)
665
+ className: n(R && Z.triggerActive)
702
666
  })
703
667
  })
704
668
  })]
705
669
  });
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 }) => {
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 }) => {
707
671
  let S = n[e];
708
672
  if (S.kind === Y.Header) {
709
673
  let n = S.groupKey === X.Pinned;
710
- return /* @__PURE__ */ k("div", {
674
+ return /* @__PURE__ */ j("div", {
711
675
  role: "presentation",
712
676
  style: t,
713
677
  className: e === 0 ? "pt-0" : "pt-8",
714
- children: /* @__PURE__ */ k(Se, {
678
+ children: /* @__PURE__ */ j(xe, {
715
679
  label: S.label,
716
680
  isExpanded: r.has(S.groupKey),
717
681
  onToggle: () => i(S.groupKey),
@@ -725,11 +689,11 @@ var Y = /* @__PURE__ */ function(e) {
725
689
  })
726
690
  });
727
691
  }
728
- return /* @__PURE__ */ k("div", {
692
+ return /* @__PURE__ */ j("div", {
729
693
  role: "presentation",
730
694
  style: t,
731
695
  className: "pt-1",
732
- children: /* @__PURE__ */ k(Ce, {
696
+ children: /* @__PURE__ */ j(Se, {
733
697
  item: S.item,
734
698
  isActive: S.item.id === o,
735
699
  searchQuery: s,
@@ -753,94 +717,94 @@ var Y = /* @__PURE__ */ function(e) {
753
717
  onDrop: x
754
718
  })
755
719
  });
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([
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([
757
721
  X.Pinned,
758
722
  X.MyChats,
759
723
  X.Shared,
760
724
  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);
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);
727
+ C(() => {
728
+ T != null && ie(T);
765
729
  }, [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) => {
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) => {
772
736
  let n = new Set(t);
773
737
  return n.has(e) ? n.delete(e) : n.add(e), n;
774
738
  });
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?.({
739
+ }, []), Me = S(() => {
740
+ De.current = null, Oe.current = null, ge(null), ye(null), Se(null);
741
+ }, []), Ne = S((t, n) => {
742
+ let r = he(t, me(n, t), e);
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?.({
789
753
  draggedId: r,
790
754
  targetGroupKey: t,
791
755
  afterId: n
792
756
  });
793
- }, [Ne, w]), ze = t({
794
- "--cp-item-hover": M?.itemHover,
795
- "--cp-item-active": M?.itemActive,
796
- "--cp-text": M?.text,
797
- "--cp-text-secondary": M?.textSecondary,
798
- "--cp-new-chat-bg": P?.background,
799
- "--cp-new-chat-text": P?.text,
800
- "--cp-new-chat-focus-outline": P?.focusOutline,
801
- "--cp-drop-zone-ring": M?.dropZoneRing,
802
- "--cp-trigger-bg": M?.triggerBackground,
803
- "--cp-trigger-icon": M?.triggerIcon,
804
- "--cp-trigger-icon-idle": M?.triggerIconIdle,
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)), [
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)), [
811
775
  e,
812
- G,
776
+ K,
813
777
  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(() => [
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(() => [
815
779
  {
816
780
  key: X.Pinned,
817
781
  label: V?.pinned ?? "Pinned",
818
- items: Be
782
+ items: ze
819
783
  },
820
784
  {
821
785
  key: X.MyChats,
822
786
  label: V?.myChats ?? "My chats",
823
- items: Ve
787
+ items: Be
824
788
  },
825
789
  {
826
790
  key: X.Shared,
827
791
  label: V?.shared ?? "Shared",
828
- items: He
792
+ items: Ve
829
793
  },
830
794
  {
831
795
  key: X.Organization,
832
796
  label: V?.organization ?? "Organization",
833
- items: Ue
797
+ items: He
834
798
  }
835
799
  ], [
836
800
  V,
801
+ ze,
837
802
  Be,
838
803
  Ve,
839
- He,
840
- Ue
841
- ]), $ = E(() => {
804
+ He
805
+ ]), $ = D(() => {
842
806
  let e = [];
843
- for (let t of We) if (t.items.length !== 0 && (e.push({
807
+ for (let t of Ue) if (t.items.length !== 0 && (e.push({
844
808
  kind: Y.Header,
845
809
  groupKey: t.key,
846
810
  label: t.label
@@ -850,154 +814,153 @@ var Y = /* @__PURE__ */ function(e) {
850
814
  groupKey: t.key
851
815
  });
852
816
  return e;
853
- }, [We, q]);
854
- S(() => {
855
- if (!u || he.current === u) return;
817
+ }, [Ue, q]);
818
+ C(() => {
819
+ if (!u || de.current === u) return;
856
820
  let e = $.findIndex((e) => e.kind === Y.Item && e.item.id === u);
857
- e >= 0 && (fe.current?.scrollToRow({
821
+ e >= 0 && (ce.current?.scrollToRow({
858
822
  index: e,
859
823
  align: "smart",
860
824
  behavior: "smooth"
861
- }), he.current = u);
825
+ }), de.current = u);
862
826
  }, [
863
827
  u,
864
- We,
828
+ Ue,
865
829
  q,
866
830
  $
867
831
  ]);
868
- let Ge = E(() => ({
832
+ let We = D(() => ({
869
833
  rows: $,
870
834
  expandedGroups: q,
871
- onToggleGroup: Me,
872
- listId: ue,
835
+ onToggleGroup: je,
836
+ listId: se,
873
837
  activeConversationId: u,
874
838
  searchQuery: W,
875
839
  onSelectConversation: l,
876
840
  getActions: _,
877
841
  onActionMenuOpen: v,
878
842
  actionsLabel: H,
879
- unreadIndicatorLabel: ie,
843
+ unreadIndicatorLabel: U,
880
844
  styles: {
881
- groupHeaderClassName: N?.groupHeaderClassName,
882
- itemTitleClassName: N?.itemTitleClassName,
845
+ groupHeaderClassName: P?.groupHeaderClassName,
846
+ itemTitleClassName: P?.itemTitleClassName,
883
847
  itemIconBadgeClassName: p?.itemIconBadgeClassName,
884
848
  taskBadgeClassName: p?.taskBadgeClassName
885
849
  },
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
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
894
858
  }), [
895
859
  $,
896
860
  q,
897
- Me,
898
- ue,
861
+ je,
862
+ se,
899
863
  u,
900
864
  W,
901
865
  l,
902
866
  _,
903
867
  v,
904
868
  H,
905
- ie,
906
- N?.groupHeaderClassName,
907
- N?.itemTitleClassName,
869
+ U,
870
+ P?.groupHeaderClassName,
871
+ P?.itemTitleClassName,
908
872
  p?.itemIconBadgeClassName,
909
873
  p?.taskBadgeClassName,
910
- ge,
911
- ve,
912
- Se,
874
+ pe,
875
+ _e,
876
+ xe,
877
+ Ne,
913
878
  Pe,
914
879
  Fe,
915
880
  Ie,
916
- Le,
917
- Re
918
- ]), Ke = e.length === 0, qe = e.length > 0 && Q.length === 0;
919
- return /* @__PURE__ */ A(o, {
881
+ Le
882
+ ]), Ge = e.length === 0, Ke = e.length > 0 && Q.length === 0;
883
+ return /* @__PURE__ */ M(o, {
920
884
  isOpen: c,
921
885
  orientation: a.Left,
922
- title: F,
886
+ title: ee,
923
887
  labels: {
924
- ariaLabel: F,
925
- closeLabel: U
888
+ ariaLabel: ee,
889
+ closeLabel: re
926
890
  },
927
891
  onClose: y,
928
892
  styles: {
929
893
  colors: {
930
- background: M?.background,
931
- border: M?.border
894
+ background: N?.background,
895
+ border: N?.border
932
896
  },
933
- typography: { fontClassName: N?.fontClassName },
897
+ typography: { fontClassName: P?.fontClassName },
934
898
  bodyClassName: "flex flex-col overflow-hidden p-0 gap-3",
935
- cssVars: ze,
936
- titleClassName: N?.fontClassName,
899
+ cssVars: Re,
900
+ titleClassName: P?.fontClassName,
937
901
  headerClassName: "h-[64px]",
938
902
  className: n(c ? "w-[324px] mobile:w-full" : "w-0", g)
939
903
  },
940
904
  rightActions: b,
941
905
  children: [
942
- /* @__PURE__ */ k(xe, {
943
- label: R,
906
+ /* @__PURE__ */ j(be, {
907
+ label: te,
944
908
  onClick: f,
945
- labelClassName: N?.newChatLabelClassName,
946
- colors: P
909
+ labelClassName: P?.newChatLabelClassName,
910
+ colors: F
947
911
  }),
948
- /* @__PURE__ */ k("div", {
912
+ /* @__PURE__ */ j("div", {
949
913
  role: "search",
950
914
  className: "px-3 py-2",
951
- children: /* @__PURE__ */ k(m, {
915
+ children: /* @__PURE__ */ j(m, {
952
916
  wrapperClassName: "rounded-full",
953
917
  value: W,
954
- onChange: je,
955
- placeholder: re,
956
- clearLabel: z,
957
- "aria-label": re
918
+ onChange: Ae,
919
+ placeholder: z,
920
+ clearLabel: B,
921
+ "aria-label": z
958
922
  })
959
923
  }),
960
- !j && /* @__PURE__ */ k(ye, {
961
- activeTab: G,
962
- labels: B,
924
+ !A && /* @__PURE__ */ j(ve, {
925
+ activeTab: K,
926
+ labels: ne,
963
927
  onChange: (e) => {
964
- K(e), ee?.(e);
928
+ ie(e), E?.(e);
965
929
  },
966
- tabClassName: N?.tabClassName,
967
- colors: te
930
+ tabClassName: P?.tabClassName
968
931
  }),
969
- /* @__PURE__ */ k("span", {
932
+ /* @__PURE__ */ j("span", {
970
933
  role: "status",
971
934
  "aria-live": "polite",
972
935
  className: "sr-only",
973
- children: s ? ne : Ke ? I : qe ? L : ""
936
+ children: s ? R : Ge ? I : Ke ? L : ""
974
937
  }),
975
- /* @__PURE__ */ k("div", {
938
+ /* @__PURE__ */ j("div", {
976
939
  className: "flex-1 overflow-hidden px-2 py-1",
977
- children: s ? /* @__PURE__ */ k("div", {
940
+ children: s ? /* @__PURE__ */ j("div", {
978
941
  className: "flex flex-col gap-3 px-2 py-3",
979
- children: Array.from({ length: 15 }, (e, t) => /* @__PURE__ */ k(h, {
942
+ children: Array.from({ length: 15 }, (e, t) => /* @__PURE__ */ j(h, {
980
943
  avatar: { size: 24 },
981
- showTitle: { width: le(t) },
944
+ showTitle: { width: ue(t) },
982
945
  paragraph: !1,
983
946
  active: !0,
984
947
  color: Z.skeletonColor
985
948
  }, t))
986
- }) : Ke ? /* @__PURE__ */ k(r, { label: I }) : qe ? /* @__PURE__ */ k(i, { label: L }) : /* @__PURE__ */ k(ce, {
987
- listRef: fe,
988
- id: ue,
949
+ }) : Ge ? /* @__PURE__ */ j(r, { label: I }) : Ke ? /* @__PURE__ */ j(i, { label: L }) : /* @__PURE__ */ j(le, {
950
+ listRef: ce,
951
+ id: se,
989
952
  role: "list",
990
953
  style: { height: "100%" },
991
- rowComponent: we,
954
+ rowComponent: Ce,
992
955
  rowCount: $.length,
993
- rowHeight: de,
994
- overscanCount: oe,
995
- onResize: Ae,
996
- rowProps: Ge
956
+ rowHeight: fe,
957
+ overscanCount: J,
958
+ onResize: ke,
959
+ rowProps: We
997
960
  })
998
961
  })
999
962
  ]
1000
963
  });
1001
964
  });
1002
965
  //#endregion
1003
- export { Oe as ConversationPanel, X as FilterTab };
966
+ export { De as ConversationPanel, X as FilterTab };