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