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

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