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