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