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