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