@epam/ai-dial-conversation-panel 1.3.0-dev.273 → 1.3.0-dev.276
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/index.js +1067 -628
- package/package.json +5 -5
package/index.js
CHANGED
|
@@ -1,34 +1,56 @@
|
|
|
1
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
2
|
import { PanelEmpty as c, PanelNoResults as l, SidebarOrientation as u, SidebarPanel as d } from "@epam/ai-dial-sidebar";
|
|
3
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, LiveRegion as C, LiveRegionElement as w, LiveRegionPoliteness as T, MenuItemMark as E, Popup as D, PopupSize as O, Search as k, Skeleton as A, SkeletonVariant as j, Spinner as M, mergeClasses as N } from "@epam/ai-dial-ui-kit";
|
|
4
|
-
import {
|
|
5
|
-
import { Fragment as te, jsx as
|
|
6
|
-
import { IconCaretDownFilled as
|
|
4
|
+
import { Fragment as P, createElement as F, memo as I, useCallback as L, useEffect as R, useId as z, useImperativeHandle as ee, useLayoutEffect as B, useMemo as V, useRef as H, useState as U, useSyncExternalStore as W } from "react";
|
|
5
|
+
import { Fragment as te, jsx as G, jsxs as K } from "react/jsx-runtime";
|
|
6
|
+
import { IconCaretDownFilled as q, IconCaretRightFilled as J, IconChevronDown as ne, IconChevronRight as re, IconDotsVertical as ie, IconFilter2 as ae, IconPlus as oe, IconSearch as se, IconSparkles as ce, IconX as le } from "@tabler/icons-react";
|
|
7
7
|
//#region src/constants/public-class-names.ts
|
|
8
|
-
var
|
|
8
|
+
var ue = {
|
|
9
9
|
newChatButton: "dial-cp-new-chat-button",
|
|
10
10
|
search: "dial-cp-search",
|
|
11
11
|
list: "dial-cp-list",
|
|
12
12
|
listHeader: "dial-cp-list-header",
|
|
13
13
|
listSection: "dial-cp-list-section"
|
|
14
|
-
},
|
|
15
|
-
function
|
|
14
|
+
}, Y = typeof window < "u" ? B : R;
|
|
15
|
+
function de(e) {
|
|
16
|
+
let t = e;
|
|
17
|
+
for (; t;) {
|
|
18
|
+
if (t.dir) return t.dir === "rtl";
|
|
19
|
+
t = t.parentElement;
|
|
20
|
+
}
|
|
21
|
+
return !1;
|
|
22
|
+
}
|
|
23
|
+
function fe() {
|
|
24
|
+
return () => {};
|
|
25
|
+
}
|
|
26
|
+
function pe() {
|
|
27
|
+
return W(fe, () => !1, () => !0);
|
|
28
|
+
}
|
|
29
|
+
function X(e) {
|
|
30
|
+
return e?.ownerDocument.defaultView ?? window;
|
|
31
|
+
}
|
|
32
|
+
function me(e) {
|
|
33
|
+
return X(e).ResizeObserver ?? (typeof ResizeObserver < "u" ? ResizeObserver : void 0);
|
|
34
|
+
}
|
|
35
|
+
function he(e) {
|
|
16
36
|
if (e !== void 0) switch (typeof e) {
|
|
17
37
|
case "number": return e;
|
|
18
38
|
case "string": if (e.endsWith("px")) return parseFloat(e);
|
|
19
39
|
}
|
|
20
40
|
}
|
|
21
|
-
function
|
|
22
|
-
let { styleHeight: s, styleWidth: c } =
|
|
23
|
-
styleHeight:
|
|
24
|
-
styleWidth:
|
|
25
|
-
}), [o?.height, o?.width]), [l, u] =
|
|
41
|
+
function ge({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
|
|
42
|
+
let { styleHeight: s, styleWidth: c } = V(() => ({
|
|
43
|
+
styleHeight: he(o?.height),
|
|
44
|
+
styleWidth: he(o?.width)
|
|
45
|
+
}), [o?.height, o?.width]), [l, u] = U({
|
|
26
46
|
height: t,
|
|
27
47
|
width: n
|
|
28
48
|
}), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
|
|
29
|
-
return
|
|
49
|
+
return Y(() => {
|
|
30
50
|
if (i === null || d) return;
|
|
31
|
-
let t =
|
|
51
|
+
let t = me(i);
|
|
52
|
+
if (!t) return;
|
|
53
|
+
let n = new t((e) => {
|
|
32
54
|
for (let t of e) {
|
|
33
55
|
let { contentRect: e, target: n } = t;
|
|
34
56
|
i === n && u((t) => t.height === e.height && t.width === e.width ? t : {
|
|
@@ -37,8 +59,8 @@ function de({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
|
|
|
37
59
|
});
|
|
38
60
|
}
|
|
39
61
|
});
|
|
40
|
-
return
|
|
41
|
-
|
|
62
|
+
return n.observe(i, { box: e }), () => {
|
|
63
|
+
n?.unobserve(i);
|
|
42
64
|
};
|
|
43
65
|
}, [
|
|
44
66
|
e,
|
|
@@ -46,7 +68,7 @@ function de({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
|
|
|
46
68
|
i,
|
|
47
69
|
s,
|
|
48
70
|
c
|
|
49
|
-
]),
|
|
71
|
+
]), V(() => ({
|
|
50
72
|
height: s ?? l.height,
|
|
51
73
|
width: c ?? l.width
|
|
52
74
|
}), [
|
|
@@ -55,110 +77,200 @@ function de({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
|
|
|
55
77
|
c
|
|
56
78
|
]);
|
|
57
79
|
}
|
|
58
|
-
function
|
|
59
|
-
let t =
|
|
60
|
-
throw Error("Cannot call
|
|
80
|
+
function _e(e) {
|
|
81
|
+
let t = H(() => {
|
|
82
|
+
throw Error("Cannot call an event handler while rendering.");
|
|
61
83
|
});
|
|
62
|
-
return
|
|
84
|
+
return Y(() => {
|
|
63
85
|
t.current = e;
|
|
64
|
-
}, [e]),
|
|
86
|
+
}, [e]), L((...e) => t.current?.(...e), [t]);
|
|
65
87
|
}
|
|
66
|
-
var
|
|
67
|
-
function
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
88
|
+
var ve = /* @__PURE__ */ new WeakMap();
|
|
89
|
+
function ye(e = !1, t = document) {
|
|
90
|
+
let n = ve.get(t);
|
|
91
|
+
if (n === void 0 || e) {
|
|
92
|
+
let e = t.createElement("div"), r = e.style;
|
|
93
|
+
r.width = "50px", r.height = "50px", r.overflow = "scroll", r.direction = "rtl";
|
|
94
|
+
let i = t.createElement("div"), a = i.style;
|
|
95
|
+
a.width = "100px", a.height = "100px", e.appendChild(i), t.body.appendChild(e), e.scrollLeft > 0 ? n = "positive-descending" : (e.scrollLeft = 1, n = e.scrollLeft === 0 ? "negative" : "positive-ascending"), t.body.removeChild(e), ve.set(t, n);
|
|
73
96
|
}
|
|
74
|
-
return
|
|
97
|
+
return n;
|
|
75
98
|
}
|
|
76
|
-
function
|
|
77
|
-
if (t === "horizontal" && n) switch (
|
|
99
|
+
function be({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
100
|
+
if (t === "horizontal" && n) switch (ye(!1, e?.ownerDocument ?? document)) {
|
|
78
101
|
case "negative": return -r;
|
|
79
102
|
case "positive-descending": if (e) {
|
|
80
|
-
let { clientWidth: t,
|
|
81
|
-
return
|
|
103
|
+
let { clientWidth: t, scrollWidth: n } = e;
|
|
104
|
+
return n - t - r;
|
|
82
105
|
}
|
|
83
106
|
}
|
|
84
107
|
return r;
|
|
85
108
|
}
|
|
86
|
-
function
|
|
109
|
+
function xe({ container: e, element: t, onChange: n }) {
|
|
110
|
+
let r = X(t), i = me(t), a = r.MutationObserver ?? (typeof MutationObserver < "u" ? MutationObserver : void 0), o = i ? new i(n) : void 0, s = (e) => !e.isConnected || (e.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_FOLLOWING) !== 0, c = a ? new a((e) => {
|
|
111
|
+
e.some((e) => Array.from(e.addedNodes).some(s) || e.removedNodes.length > 0 && e.nextSibling !== null && s(e.nextSibling)) && (u(), n());
|
|
112
|
+
}) : void 0, l = /* @__PURE__ */ new Set(), u = () => {
|
|
113
|
+
for (let e of l) o?.unobserve(e);
|
|
114
|
+
l.clear(), c?.disconnect();
|
|
115
|
+
let n = t;
|
|
116
|
+
for (; n !== e;) {
|
|
117
|
+
let e = n.parentElement;
|
|
118
|
+
if (e === null) break;
|
|
119
|
+
if (o) for (let e = n.previousElementSibling; e !== null; e = e.previousElementSibling) l.add(e), o.observe(e);
|
|
120
|
+
c?.observe(e, { childList: !0 }), n = e;
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
return u(), () => {
|
|
124
|
+
o?.disconnect(), c?.disconnect();
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
function Se(e) {
|
|
128
|
+
return e.window === e;
|
|
129
|
+
}
|
|
130
|
+
function Ce(e, t) {
|
|
131
|
+
return t === "window" ? e ? X(e) : null : t ?? null;
|
|
132
|
+
}
|
|
133
|
+
function we(e, t) {
|
|
134
|
+
return Se(e) ? t === "vertical" ? e.scrollY : e.scrollX : t === "vertical" ? e.scrollTop : e.scrollLeft;
|
|
135
|
+
}
|
|
136
|
+
function Te(e, t) {
|
|
137
|
+
let n = Se(e) ? e.document.scrollingElement ?? e.document.documentElement : e;
|
|
138
|
+
return t === "vertical" ? n.scrollHeight - n.clientHeight : n.scrollWidth - n.clientWidth;
|
|
139
|
+
}
|
|
140
|
+
function Ee(e, t) {
|
|
141
|
+
let { overflowX: n, overflowY: r } = X(e).getComputedStyle(e), i = t === "vertical" ? r : n;
|
|
142
|
+
return i === "visible" || i === "clip" ? !1 : t === "vertical" ? e.scrollHeight - e.clientHeight > 1 : e.scrollWidth - e.clientWidth > 1;
|
|
143
|
+
}
|
|
144
|
+
function De({ containerElement: e, direction: t, isRtl: n, scrollTarget: r }) {
|
|
145
|
+
let i = t === "vertical", a, o;
|
|
146
|
+
if (Se(r)) {
|
|
147
|
+
let { documentElement: e } = r.document;
|
|
148
|
+
a = 0, o = i ? e.clientHeight : e.clientWidth;
|
|
149
|
+
} else {
|
|
150
|
+
let e = r.getBoundingClientRect();
|
|
151
|
+
a = i ? e.top + r.clientTop : e.left + r.clientLeft, o = i ? r.clientHeight : r.clientWidth;
|
|
152
|
+
}
|
|
153
|
+
let s = a + o, c = e.getBoundingClientRect(), l = i ? c.top + e.clientTop : c.left + e.clientLeft, u = i ? e.clientHeight : e.clientWidth, d = l + u, f = be({
|
|
154
|
+
containerElement: e,
|
|
155
|
+
direction: t,
|
|
156
|
+
isRtl: n,
|
|
157
|
+
scrollOffset: i ? e.scrollTop : e.scrollLeft
|
|
158
|
+
}), p = !i && n ? d - s : a - l, m = p + o, h = Math.max(0, p), g = Math.min(u, m);
|
|
159
|
+
return {
|
|
160
|
+
offset: f + h,
|
|
161
|
+
size: Math.max(0, g - h),
|
|
162
|
+
viewportOffset: f + p,
|
|
163
|
+
viewportSize: o
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
function Oe({ direction: e, isRtl: t, scrollTarget: n, viewportSize: r }) {
|
|
167
|
+
let i = Se(n) ? n.document.documentElement : n, a = X(i).getComputedStyle(i), o = (e) => {
|
|
168
|
+
let t = parseFloat(e ?? "");
|
|
169
|
+
return !Number.isFinite(t) || t < 0 ? 0 : e.endsWith("px") ? t : e.endsWith("%") ? t * r / 100 : 0;
|
|
170
|
+
};
|
|
171
|
+
if (e === "vertical") return {
|
|
172
|
+
end: o(a.scrollPaddingBottom),
|
|
173
|
+
start: o(a.scrollPaddingTop)
|
|
174
|
+
};
|
|
175
|
+
let s = o(a.scrollPaddingLeft), c = o(a.scrollPaddingRight);
|
|
176
|
+
return t ? {
|
|
177
|
+
end: s,
|
|
178
|
+
start: c
|
|
179
|
+
} : {
|
|
180
|
+
end: c,
|
|
181
|
+
start: s
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
function ke(e, t = "Assertion error") {
|
|
87
185
|
if (!e) throw console.error(t), Error(t);
|
|
88
186
|
}
|
|
89
|
-
function
|
|
187
|
+
function Ae(e, t) {
|
|
90
188
|
if (e === t) return !0;
|
|
91
|
-
if (!!e != !!t || (
|
|
92
|
-
for (let n in e) if (!Object.is(t[n], e[n])) return !1;
|
|
189
|
+
if (!!e != !!t || (ke(e !== void 0), ke(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
|
|
190
|
+
for (let n in e) if (!Object.hasOwn(t, n) || !Object.is(t[n], e[n])) return !1;
|
|
93
191
|
return !0;
|
|
94
192
|
}
|
|
95
|
-
function
|
|
193
|
+
function je({ cachedBounds: e, itemCount: t, itemSize: n }) {
|
|
96
194
|
if (t === 0) return 0;
|
|
97
195
|
if (typeof n == "number") return t * n;
|
|
98
196
|
{
|
|
99
197
|
let n = e.get(e.size === 0 ? 0 : e.size - 1);
|
|
100
|
-
return
|
|
198
|
+
return ke(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
|
|
101
199
|
}
|
|
102
200
|
}
|
|
103
|
-
function
|
|
104
|
-
if (
|
|
105
|
-
let
|
|
201
|
+
function Me({ align: e, cachedBounds: t, clamp: n = !0, index: r, itemCount: i, itemSize: a, containerScrollOffset: o, containerSize: s }) {
|
|
202
|
+
if (r < 0 || r >= i) throw RangeError(`Invalid index specified: ${r}`, { cause: `Index ${r} is not within the range of 0 - ${i - 1}` });
|
|
203
|
+
let c = t.get(r), l = je({
|
|
106
204
|
cachedBounds: t,
|
|
107
|
-
itemCount:
|
|
108
|
-
itemSize:
|
|
109
|
-
}),
|
|
110
|
-
switch (e === "smart" && (e =
|
|
111
|
-
case "start": return
|
|
112
|
-
case "end": return
|
|
113
|
-
case "center": return c.scrollOffset
|
|
114
|
-
default: return
|
|
205
|
+
itemCount: i,
|
|
206
|
+
itemSize: a
|
|
207
|
+
}), u = (e) => n ? Math.max(0, Math.min(l - s, e)) : e, d = u(c.scrollOffset), f = n ? Math.max(0, c.scrollOffset - s + c.size) : c.scrollOffset - s + c.size, p = c.size > s ? o >= c.scrollOffset && o <= f : o >= f && o <= c.scrollOffset;
|
|
208
|
+
switch (e === "smart" && (e = p ? "auto" : "center"), e) {
|
|
209
|
+
case "start": return d;
|
|
210
|
+
case "end": return f;
|
|
211
|
+
case "center": return u(c.scrollOffset + c.size / 2 - s / 2);
|
|
212
|
+
default: return p ? o : o < f ? f : d;
|
|
115
213
|
}
|
|
116
214
|
}
|
|
117
|
-
function
|
|
118
|
-
let a = r - 1
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
215
|
+
function Ne({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
|
|
216
|
+
let a = r - 1;
|
|
217
|
+
if (r === 0) return {
|
|
218
|
+
startIndexVisible: 0,
|
|
219
|
+
stopIndexVisible: -1,
|
|
220
|
+
startIndexOverscan: 0,
|
|
221
|
+
stopIndexOverscan: -1
|
|
222
|
+
};
|
|
223
|
+
let o, s, { itemSize: c } = e;
|
|
224
|
+
if (c !== void 0) c > 0 ? (o = Math.max(0, Math.min(a, Math.floor(t / c))), s = Math.max(o, Math.min(a, Math.ceil((t + n) / c) - 1))) : (o = 0, s = 0);
|
|
225
|
+
else {
|
|
226
|
+
let r = 0, i = Math.min(a, Math.max(0, e.size - 1));
|
|
227
|
+
for (; r < i;) {
|
|
228
|
+
let n = Math.floor((r + i) / 2), a = e.get(n);
|
|
229
|
+
a.scrollOffset + a.size > t ? i = n : r = n + 1;
|
|
230
|
+
}
|
|
231
|
+
for (; r < a;) {
|
|
232
|
+
let n = e.get(r);
|
|
233
|
+
if (n.scrollOffset + n.size > t) break;
|
|
234
|
+
r++;
|
|
235
|
+
}
|
|
236
|
+
for (o = r, s = r; s < a;) {
|
|
237
|
+
let r = e.get(s);
|
|
238
|
+
if (r.scrollOffset + r.size >= t + n) break;
|
|
239
|
+
s++;
|
|
240
|
+
}
|
|
128
241
|
}
|
|
129
|
-
return
|
|
242
|
+
return {
|
|
130
243
|
startIndexVisible: o,
|
|
131
244
|
stopIndexVisible: s,
|
|
132
|
-
startIndexOverscan:
|
|
133
|
-
stopIndexOverscan:
|
|
245
|
+
startIndexOverscan: Math.max(0, o - i),
|
|
246
|
+
stopIndexOverscan: Math.min(a, s + i)
|
|
134
247
|
};
|
|
135
248
|
}
|
|
136
|
-
function
|
|
249
|
+
function Z({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
137
250
|
let r = /* @__PURE__ */ new Map();
|
|
138
251
|
return {
|
|
252
|
+
itemSize: typeof n == "number" ? n : void 0,
|
|
139
253
|
get(i) {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
case "number": a = n;
|
|
147
|
-
}
|
|
254
|
+
if (ke(i < e, `Invalid index ${i}`), typeof n == "number") return ke(i >= 0, `Invalid index ${i}`), {
|
|
255
|
+
size: n,
|
|
256
|
+
scrollOffset: i * n
|
|
257
|
+
};
|
|
258
|
+
for (; r.size - 1 < i;) {
|
|
259
|
+
let e = r.size, a = n(e, t);
|
|
148
260
|
if (e === 0) r.set(e, {
|
|
149
261
|
size: a,
|
|
150
262
|
scrollOffset: 0
|
|
151
263
|
});
|
|
152
264
|
else {
|
|
153
265
|
let t = r.get(e - 1);
|
|
154
|
-
|
|
266
|
+
ke(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
|
|
155
267
|
scrollOffset: t.scrollOffset + t.size,
|
|
156
268
|
size: a
|
|
157
269
|
});
|
|
158
270
|
}
|
|
159
271
|
}
|
|
160
272
|
let a = r.get(i);
|
|
161
|
-
return
|
|
273
|
+
return ke(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
|
|
162
274
|
},
|
|
163
275
|
set(e, t) {
|
|
164
276
|
r.set(e, t);
|
|
@@ -168,8 +280,8 @@ function be({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
168
280
|
}
|
|
169
281
|
};
|
|
170
282
|
}
|
|
171
|
-
function
|
|
172
|
-
return
|
|
283
|
+
function Pe({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
284
|
+
return V(() => Z({
|
|
173
285
|
itemCount: e,
|
|
174
286
|
itemProps: t,
|
|
175
287
|
itemSize: n
|
|
@@ -179,328 +291,655 @@ function xe({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
179
291
|
n
|
|
180
292
|
]);
|
|
181
293
|
}
|
|
182
|
-
function
|
|
294
|
+
function Fe({ containerSize: e, itemSize: t }) {
|
|
183
295
|
let n;
|
|
184
296
|
switch (typeof t) {
|
|
185
297
|
case "string":
|
|
186
|
-
|
|
298
|
+
ke(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), ke(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseFloat(t) / 100;
|
|
187
299
|
break;
|
|
188
300
|
default: n = t;
|
|
189
301
|
}
|
|
190
|
-
return n;
|
|
302
|
+
return typeof n == "number" && !(Number.isFinite(n) && n > 0) && (n = 0), n;
|
|
191
303
|
}
|
|
192
|
-
function
|
|
193
|
-
let { height:
|
|
194
|
-
defaultHeight:
|
|
195
|
-
defaultWidth:
|
|
304
|
+
function Ie({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, defaultScrollOffset: r = 0, direction: i, isRtl: a = !1, itemCount: o, itemProps: s, itemSize: c, onResize: l, overscanCount: u, scrollElement: d }) {
|
|
305
|
+
let f = d !== void 0, p = f ? Ce(e, d) : e, { height: m = n, width: h = n } = ge({
|
|
306
|
+
defaultHeight: i === "vertical" ? n : void 0,
|
|
307
|
+
defaultWidth: i === "horizontal" ? n : void 0,
|
|
196
308
|
element: e,
|
|
197
|
-
mode:
|
|
309
|
+
mode: i === "vertical" ? "only-height" : "only-width",
|
|
198
310
|
style: t
|
|
199
|
-
}),
|
|
311
|
+
}), g = H({
|
|
200
312
|
height: 0,
|
|
201
313
|
width: 0
|
|
202
|
-
}),
|
|
203
|
-
containerSize:
|
|
204
|
-
itemSize:
|
|
314
|
+
}), [_, v] = U(n), y = f ? _ : i === "vertical" ? m : h, b = Fe({
|
|
315
|
+
containerSize: y,
|
|
316
|
+
itemSize: c
|
|
205
317
|
});
|
|
206
|
-
|
|
207
|
-
if (typeof
|
|
208
|
-
let e =
|
|
209
|
-
(e.height !==
|
|
210
|
-
height:
|
|
211
|
-
width:
|
|
212
|
-
}, { ...e }), e.height =
|
|
318
|
+
Y(() => {
|
|
319
|
+
if (typeof l == "function") {
|
|
320
|
+
let e = g.current;
|
|
321
|
+
(e.height !== m || e.width !== h) && (l({
|
|
322
|
+
height: m,
|
|
323
|
+
width: h
|
|
324
|
+
}, { ...e }), e.height = m, e.width = h);
|
|
213
325
|
}
|
|
214
326
|
}, [
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
327
|
+
m,
|
|
328
|
+
l,
|
|
329
|
+
h
|
|
218
330
|
]);
|
|
219
|
-
let
|
|
220
|
-
itemCount:
|
|
221
|
-
itemProps:
|
|
222
|
-
itemSize:
|
|
223
|
-
}),
|
|
224
|
-
cachedBounds:
|
|
225
|
-
containerScrollOffset:
|
|
226
|
-
containerSize:
|
|
227
|
-
itemCount:
|
|
228
|
-
overscanCount:
|
|
229
|
-
})), { startIndexVisible:
|
|
230
|
-
startIndexVisible: Math.min(
|
|
231
|
-
startIndexOverscan: Math.min(
|
|
232
|
-
stopIndexVisible: Math.min(
|
|
233
|
-
stopIndexOverscan: Math.min(
|
|
234
|
-
},
|
|
235
|
-
cachedBounds:
|
|
236
|
-
itemCount:
|
|
237
|
-
itemSize:
|
|
331
|
+
let x = Pe({
|
|
332
|
+
itemCount: o,
|
|
333
|
+
itemProps: s,
|
|
334
|
+
itemSize: b
|
|
335
|
+
}), S = pe(), [C] = U(() => S || f ? 0 : r), w = L((e) => x.get(e), [x]), [T, E] = U(() => Ne({
|
|
336
|
+
cachedBounds: x,
|
|
337
|
+
containerScrollOffset: C,
|
|
338
|
+
containerSize: y,
|
|
339
|
+
itemCount: o,
|
|
340
|
+
overscanCount: u
|
|
341
|
+
})), { startIndexVisible: D, startIndexOverscan: O, stopIndexVisible: k, stopIndexOverscan: A } = {
|
|
342
|
+
startIndexVisible: Math.min(o - 1, T.startIndexVisible),
|
|
343
|
+
startIndexOverscan: Math.min(o - 1, T.startIndexOverscan),
|
|
344
|
+
stopIndexVisible: Math.min(o - 1, T.stopIndexVisible),
|
|
345
|
+
stopIndexOverscan: Math.min(o - 1, T.stopIndexOverscan)
|
|
346
|
+
}, j = L(() => je({
|
|
347
|
+
cachedBounds: x,
|
|
348
|
+
itemCount: o,
|
|
349
|
+
itemSize: b
|
|
238
350
|
}), [
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
]),
|
|
243
|
-
let n =
|
|
351
|
+
x,
|
|
352
|
+
o,
|
|
353
|
+
b
|
|
354
|
+
]), M = L((t) => {
|
|
355
|
+
let n = be({
|
|
244
356
|
containerElement: e,
|
|
245
|
-
direction:
|
|
246
|
-
isRtl:
|
|
357
|
+
direction: i,
|
|
358
|
+
isRtl: a,
|
|
247
359
|
scrollOffset: t
|
|
248
360
|
});
|
|
249
|
-
return
|
|
250
|
-
cachedBounds:
|
|
361
|
+
return Ne({
|
|
362
|
+
cachedBounds: x,
|
|
251
363
|
containerScrollOffset: n,
|
|
252
|
-
containerSize:
|
|
253
|
-
itemCount:
|
|
254
|
-
overscanCount:
|
|
364
|
+
containerSize: y,
|
|
365
|
+
itemCount: o,
|
|
366
|
+
overscanCount: u
|
|
255
367
|
});
|
|
256
368
|
}, [
|
|
257
|
-
|
|
369
|
+
x,
|
|
258
370
|
e,
|
|
259
|
-
|
|
260
|
-
r,
|
|
371
|
+
y,
|
|
261
372
|
i,
|
|
262
373
|
a,
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
374
|
+
o,
|
|
375
|
+
u
|
|
376
|
+
]), N = H(!1);
|
|
377
|
+
Y(() => {
|
|
378
|
+
if (!e || o === 0 || f || N.current || (N.current = !0, r <= 0)) return;
|
|
379
|
+
let t = i === "horizontal" && de(e);
|
|
380
|
+
if (be({
|
|
381
|
+
containerElement: e,
|
|
382
|
+
direction: i,
|
|
383
|
+
isRtl: t,
|
|
384
|
+
scrollOffset: i === "vertical" ? e.scrollTop : e.scrollLeft
|
|
385
|
+
}) !== 0) return;
|
|
386
|
+
let n = be({
|
|
387
|
+
containerElement: e,
|
|
388
|
+
direction: i,
|
|
389
|
+
isRtl: t,
|
|
390
|
+
scrollOffset: r
|
|
391
|
+
});
|
|
392
|
+
typeof e.scrollTo == "function" ? e.scrollTo({
|
|
393
|
+
behavior: "instant",
|
|
394
|
+
[i === "vertical" ? "top" : "left"]: n
|
|
395
|
+
}) : i === "vertical" ? e.scrollTop = n : e.scrollLeft = n;
|
|
396
|
+
}, [e, o]), Y(() => {
|
|
397
|
+
if (f && e && p) return;
|
|
398
|
+
let t = e && !f ? M(i === "vertical" ? e.scrollTop : e.scrollLeft) : Ne({
|
|
399
|
+
cachedBounds: x,
|
|
400
|
+
containerScrollOffset: C,
|
|
401
|
+
containerSize: y,
|
|
402
|
+
itemCount: o,
|
|
403
|
+
overscanCount: u
|
|
404
|
+
});
|
|
405
|
+
E((e) => Ae(t, e) ? e : t);
|
|
268
406
|
}, [
|
|
407
|
+
x,
|
|
269
408
|
e,
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
409
|
+
y,
|
|
410
|
+
i,
|
|
411
|
+
M,
|
|
412
|
+
C,
|
|
413
|
+
f,
|
|
414
|
+
o,
|
|
415
|
+
u,
|
|
416
|
+
p
|
|
417
|
+
]), Y(() => {
|
|
418
|
+
if (!e || f) return;
|
|
274
419
|
let t = () => {
|
|
275
|
-
|
|
276
|
-
let { scrollLeft: n, scrollTop:
|
|
420
|
+
E((t) => {
|
|
421
|
+
let { scrollLeft: n, scrollTop: r } = e, s = be({
|
|
277
422
|
containerElement: e,
|
|
278
|
-
direction:
|
|
279
|
-
isRtl:
|
|
280
|
-
scrollOffset:
|
|
281
|
-
}), c =
|
|
282
|
-
cachedBounds:
|
|
423
|
+
direction: i,
|
|
424
|
+
isRtl: a,
|
|
425
|
+
scrollOffset: i === "vertical" ? r : n
|
|
426
|
+
}), c = Ne({
|
|
427
|
+
cachedBounds: x,
|
|
283
428
|
containerScrollOffset: s,
|
|
284
|
-
containerSize:
|
|
285
|
-
itemCount:
|
|
286
|
-
overscanCount:
|
|
429
|
+
containerSize: y,
|
|
430
|
+
itemCount: o,
|
|
431
|
+
overscanCount: u
|
|
287
432
|
});
|
|
288
|
-
return
|
|
433
|
+
return Ae(c, t) ? t : c;
|
|
289
434
|
});
|
|
290
435
|
};
|
|
291
436
|
return e.addEventListener("scroll", t), () => {
|
|
292
437
|
e.removeEventListener("scroll", t);
|
|
293
438
|
};
|
|
294
439
|
}, [
|
|
295
|
-
|
|
440
|
+
x,
|
|
296
441
|
e,
|
|
297
|
-
|
|
298
|
-
|
|
442
|
+
y,
|
|
443
|
+
i,
|
|
299
444
|
a,
|
|
300
|
-
|
|
445
|
+
f,
|
|
446
|
+
o,
|
|
447
|
+
u
|
|
448
|
+
]);
|
|
449
|
+
let P = _e(() => {
|
|
450
|
+
if (!e || !p) return;
|
|
451
|
+
let { offset: t, size: n, viewportSize: r } = De({
|
|
452
|
+
containerElement: e,
|
|
453
|
+
direction: i,
|
|
454
|
+
isRtl: a,
|
|
455
|
+
scrollTarget: p
|
|
456
|
+
});
|
|
457
|
+
v(r);
|
|
458
|
+
let s = Ne({
|
|
459
|
+
cachedBounds: x,
|
|
460
|
+
containerScrollOffset: t,
|
|
461
|
+
containerSize: n,
|
|
462
|
+
itemCount: o,
|
|
463
|
+
overscanCount: u
|
|
464
|
+
});
|
|
465
|
+
E((e) => Ae(s, e) ? e : s);
|
|
466
|
+
});
|
|
467
|
+
return Y(() => {
|
|
468
|
+
f && P();
|
|
469
|
+
}), Y(() => {
|
|
470
|
+
if (!f || !e || !p) return;
|
|
471
|
+
let t = X(e), n = () => P();
|
|
472
|
+
p.addEventListener("scroll", n, { passive: !0 }), e.addEventListener("scroll", n, { passive: !0 }), t.addEventListener("resize", n);
|
|
473
|
+
let r, i = me(e);
|
|
474
|
+
i && !Se(p) && (r = new i(n), r.observe(p));
|
|
475
|
+
let a = xe({
|
|
476
|
+
container: Se(p) ? p.document.documentElement : p,
|
|
477
|
+
element: e,
|
|
478
|
+
onChange: n
|
|
479
|
+
});
|
|
480
|
+
return () => {
|
|
481
|
+
p.removeEventListener("scroll", n), e.removeEventListener("scroll", n), t.removeEventListener("resize", n), r?.disconnect(), a();
|
|
482
|
+
};
|
|
483
|
+
}, [
|
|
484
|
+
e,
|
|
485
|
+
f,
|
|
486
|
+
p,
|
|
487
|
+
P
|
|
301
488
|
]), {
|
|
302
|
-
getCellBounds:
|
|
303
|
-
getEstimatedSize:
|
|
304
|
-
|
|
305
|
-
let
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
489
|
+
getCellBounds: w,
|
|
490
|
+
getEstimatedSize: j,
|
|
491
|
+
getScrollPositionForIndex: _e(({ align: t = "auto", index: n }) => {
|
|
492
|
+
let r = ({ clamp: e, containerScrollOffset: r, containerSize: i, padding: a }) => {
|
|
493
|
+
if (a.start === 0 && a.end === 0) return Me({
|
|
494
|
+
align: t,
|
|
495
|
+
cachedBounds: x,
|
|
496
|
+
clamp: e,
|
|
497
|
+
containerScrollOffset: r,
|
|
498
|
+
containerSize: i,
|
|
499
|
+
index: n,
|
|
500
|
+
itemCount: o,
|
|
501
|
+
itemSize: b
|
|
502
|
+
});
|
|
503
|
+
let s = Me({
|
|
504
|
+
align: t,
|
|
505
|
+
cachedBounds: x,
|
|
506
|
+
clamp: !1,
|
|
507
|
+
containerScrollOffset: r + a.start,
|
|
508
|
+
containerSize: Math.max(0, i - a.start - a.end),
|
|
509
|
+
index: n,
|
|
510
|
+
itemCount: o,
|
|
511
|
+
itemSize: b
|
|
512
|
+
}) - a.start;
|
|
513
|
+
return e ? Math.max(0, Math.min(j() - i, s)) : s;
|
|
514
|
+
};
|
|
515
|
+
if (f && e && p && !Ee(e, i)) {
|
|
516
|
+
let { viewportOffset: t, viewportSize: n } = De({
|
|
517
|
+
containerElement: e,
|
|
518
|
+
direction: i,
|
|
519
|
+
isRtl: a,
|
|
520
|
+
scrollTarget: p
|
|
521
|
+
}), o = r({
|
|
522
|
+
clamp: !1,
|
|
523
|
+
containerScrollOffset: t,
|
|
524
|
+
containerSize: n,
|
|
525
|
+
padding: Oe({
|
|
526
|
+
direction: i,
|
|
527
|
+
isRtl: a,
|
|
528
|
+
scrollTarget: p,
|
|
529
|
+
viewportSize: n
|
|
530
|
+
})
|
|
531
|
+
}) - t, s = i === "horizontal" && a ? -o : o;
|
|
532
|
+
return {
|
|
533
|
+
scrollOffset: we(p, i) + s,
|
|
534
|
+
scrollTarget: p
|
|
535
|
+
};
|
|
536
|
+
}
|
|
537
|
+
let s = e ? i === "vertical" ? e.scrollTop : e.scrollLeft : 0, c = f && e ? i === "vertical" ? e.clientHeight : e.clientWidth : y, l = r({
|
|
538
|
+
clamp: !0,
|
|
539
|
+
containerScrollOffset: be({
|
|
316
540
|
containerElement: e,
|
|
317
|
-
direction:
|
|
318
|
-
isRtl:
|
|
541
|
+
direction: i,
|
|
542
|
+
isRtl: a,
|
|
319
543
|
scrollOffset: s
|
|
320
|
-
}),
|
|
321
|
-
|
|
322
|
-
|
|
544
|
+
}),
|
|
545
|
+
containerSize: c,
|
|
546
|
+
padding: e ? Oe({
|
|
547
|
+
direction: i,
|
|
548
|
+
isRtl: a,
|
|
549
|
+
scrollTarget: e,
|
|
550
|
+
viewportSize: c
|
|
551
|
+
}) : {
|
|
552
|
+
end: 0,
|
|
553
|
+
start: 0
|
|
323
554
|
}
|
|
324
|
-
|
|
555
|
+
});
|
|
556
|
+
if (e && (!f || p)) {
|
|
557
|
+
if (l = be({
|
|
558
|
+
containerElement: e,
|
|
559
|
+
direction: i,
|
|
560
|
+
isRtl: a,
|
|
561
|
+
scrollOffset: l
|
|
562
|
+
}), !f && typeof e.scrollTo != "function") {
|
|
563
|
+
let e = M(l);
|
|
564
|
+
Ae(T, e) || E(e);
|
|
565
|
+
}
|
|
566
|
+
return {
|
|
567
|
+
scrollOffset: l,
|
|
568
|
+
scrollTarget: e
|
|
569
|
+
};
|
|
325
570
|
}
|
|
326
571
|
}),
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
572
|
+
scrollTarget: p,
|
|
573
|
+
startIndexOverscan: O,
|
|
574
|
+
startIndexVisible: D,
|
|
575
|
+
stopIndexOverscan: A,
|
|
576
|
+
stopIndexVisible: k
|
|
331
577
|
};
|
|
332
578
|
}
|
|
333
|
-
function
|
|
334
|
-
|
|
579
|
+
function Le(e) {
|
|
580
|
+
let [t, n] = U(e);
|
|
581
|
+
return Ae(t, e) ? t : (n(e), e);
|
|
335
582
|
}
|
|
336
|
-
function
|
|
583
|
+
function Re(e, t) {
|
|
337
584
|
let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
|
|
338
|
-
return
|
|
585
|
+
return Ae(n, a) && Ae(r, o) && Ae(i, s);
|
|
339
586
|
}
|
|
340
|
-
|
|
587
|
+
var ze = "data-react-window-index", Be = "data-index";
|
|
588
|
+
function Ve(e) {
|
|
589
|
+
let t = e.getAttribute(ze) ?? e.getAttribute(Be);
|
|
590
|
+
return t !== null && /^\d+$/.test(t) ? Number(t) : void 0;
|
|
591
|
+
}
|
|
592
|
+
var He = 1e3, Ue = 500;
|
|
593
|
+
function We(e) {
|
|
594
|
+
return 1 - (1 - e) ** 3;
|
|
595
|
+
}
|
|
596
|
+
function Ge({ direction: e, element: t, getCellBounds: n, isDynamicSize: r, itemCount: i, itemElements: a, scrollTarget: o, getScrollPositionForIndex: s }) {
|
|
597
|
+
let c = e === "vertical", l = H(null), u = H(void 0), d = _e(() => {
|
|
598
|
+
l.current = null, u.current !== void 0 && (u.current.view.cancelAnimationFrame(u.current.id), u.current = void 0);
|
|
599
|
+
}), f = _e(() => {
|
|
600
|
+
let e = X(t);
|
|
601
|
+
u.current = {
|
|
602
|
+
id: e.requestAnimationFrame(p),
|
|
603
|
+
view: e
|
|
604
|
+
};
|
|
605
|
+
}), p = _e(() => {
|
|
606
|
+
u.current = void 0;
|
|
607
|
+
let o = l.current;
|
|
608
|
+
if (!o) return;
|
|
609
|
+
let p = performance.now();
|
|
610
|
+
if (!t || !r || o.index >= i || o.animation !== void 0 && p >= o.animation.deadline) {
|
|
611
|
+
d();
|
|
612
|
+
return;
|
|
613
|
+
}
|
|
614
|
+
let m = s({
|
|
615
|
+
align: o.align,
|
|
616
|
+
index: o.index
|
|
617
|
+
});
|
|
618
|
+
if (m !== void 0) {
|
|
619
|
+
let { scrollOffset: t, scrollTarget: r } = m, s = Math.max(0, Math.min(t, Te(r, e)));
|
|
620
|
+
o.animation === void 0 && (o.animation = {
|
|
621
|
+
deadline: p + (o.smooth ? Ue : 0) + He,
|
|
622
|
+
startOffset: we(r, e),
|
|
623
|
+
startTime: p
|
|
624
|
+
});
|
|
625
|
+
let l = o.smooth ? (p - o.animation.startTime) / Ue : 1;
|
|
626
|
+
if (l < 1) {
|
|
627
|
+
let { startOffset: e } = o.animation;
|
|
628
|
+
o.stableFrames = 0, r.scrollTo({
|
|
629
|
+
behavior: "instant",
|
|
630
|
+
[c ? "top" : "left"]: e + (s - e) * We(l)
|
|
631
|
+
});
|
|
632
|
+
} else if (Math.abs(s - we(r, e)) > 1) o.stableFrames = 0, r.scrollTo({
|
|
633
|
+
behavior: "instant",
|
|
634
|
+
[c ? "top" : "left"]: s
|
|
635
|
+
});
|
|
636
|
+
else {
|
|
637
|
+
let e = a.current;
|
|
638
|
+
if (!(e.some((e) => Ve(e) === o.index) && e.every((e) => {
|
|
639
|
+
let t = Ve(e);
|
|
640
|
+
if (t === void 0 || t >= i) return !0;
|
|
641
|
+
let r = c ? e.offsetHeight : e.offsetWidth;
|
|
642
|
+
return Math.abs(n(t).size - r) <= 1;
|
|
643
|
+
}))) o.stableFrames = 0;
|
|
644
|
+
else if (++o.stableFrames >= 2) {
|
|
645
|
+
d();
|
|
646
|
+
return;
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
f();
|
|
651
|
+
});
|
|
652
|
+
return Y(() => {
|
|
653
|
+
let e = o ?? t;
|
|
654
|
+
if (!e) return;
|
|
655
|
+
let n = (e) => {
|
|
656
|
+
switch (e.key) {
|
|
657
|
+
case "ArrowUp":
|
|
658
|
+
case "ArrowDown":
|
|
659
|
+
case "ArrowLeft":
|
|
660
|
+
case "ArrowRight":
|
|
661
|
+
case "PageUp":
|
|
662
|
+
case "PageDown":
|
|
663
|
+
case "Home":
|
|
664
|
+
case "End":
|
|
665
|
+
case " ": d();
|
|
666
|
+
}
|
|
667
|
+
};
|
|
668
|
+
return e.addEventListener("wheel", d, { passive: !0 }), e.addEventListener("touchstart", d, { passive: !0 }), e.addEventListener("pointerdown", d), e.addEventListener("keydown", n), () => {
|
|
669
|
+
d(), e.removeEventListener("wheel", d), e.removeEventListener("touchstart", d), e.removeEventListener("pointerdown", d), e.removeEventListener("keydown", n);
|
|
670
|
+
};
|
|
671
|
+
}, [
|
|
672
|
+
d,
|
|
673
|
+
t,
|
|
674
|
+
o
|
|
675
|
+
]), L(({ align: n = "auto", behavior: i = "auto", index: a }) => {
|
|
676
|
+
if (r && n === "smart") {
|
|
677
|
+
let t = s({
|
|
678
|
+
align: "auto",
|
|
679
|
+
index: a
|
|
680
|
+
});
|
|
681
|
+
n = t === void 0 || t.scrollOffset === we(t.scrollTarget, e) ? "auto" : "center";
|
|
682
|
+
}
|
|
683
|
+
let o = s({
|
|
684
|
+
align: n,
|
|
685
|
+
index: a
|
|
686
|
+
});
|
|
687
|
+
if (d(), o && typeof o.scrollTarget.scrollTo == "function") {
|
|
688
|
+
let { scrollOffset: e, scrollTarget: s } = o;
|
|
689
|
+
if (r) {
|
|
690
|
+
let e = i === "smooth" && t?.ownerDocument.visibilityState !== "hidden";
|
|
691
|
+
if (l.current = {
|
|
692
|
+
align: n,
|
|
693
|
+
index: a,
|
|
694
|
+
smooth: e,
|
|
695
|
+
stableFrames: 0
|
|
696
|
+
}, f(), e) return;
|
|
697
|
+
}
|
|
698
|
+
s.scrollTo({
|
|
699
|
+
behavior: r ? "instant" : i,
|
|
700
|
+
[c ? "top" : "left"]: e
|
|
701
|
+
});
|
|
702
|
+
}
|
|
703
|
+
}, [
|
|
704
|
+
d,
|
|
705
|
+
e,
|
|
706
|
+
t,
|
|
707
|
+
r,
|
|
708
|
+
c,
|
|
709
|
+
f,
|
|
710
|
+
s
|
|
711
|
+
]);
|
|
712
|
+
}
|
|
713
|
+
function Ke({ callback: e, element: t, enabled: n = !0 }) {
|
|
714
|
+
let r = _e(e);
|
|
715
|
+
R(() => {
|
|
716
|
+
if (!n || !t) return;
|
|
717
|
+
let e = X(t), i = e.requestAnimationFrame(() => {
|
|
718
|
+
i = e.requestAnimationFrame(r);
|
|
719
|
+
});
|
|
720
|
+
return () => {
|
|
721
|
+
e.cancelAnimationFrame(i);
|
|
722
|
+
};
|
|
723
|
+
}, [
|
|
724
|
+
t,
|
|
725
|
+
n,
|
|
726
|
+
r
|
|
727
|
+
]);
|
|
728
|
+
}
|
|
729
|
+
function qe({ elements: e, isFlowLayout: t, rowCount: n, startIndex: r, stopIndex: i }) {
|
|
730
|
+
if (r < 0 || i < r) return [];
|
|
731
|
+
let a = [], o = /* @__PURE__ */ new Set(), s = !0;
|
|
732
|
+
for (let t of e) {
|
|
733
|
+
let e = t.getAttribute("aria-posinset");
|
|
734
|
+
if (e === null) continue;
|
|
735
|
+
let c = Number(e) - 1;
|
|
736
|
+
if (!/^\d+$/.test(e) || c < r || c > i || o.has(c) || t.getAttribute("aria-setsize") !== `${n}`) {
|
|
737
|
+
s = !1;
|
|
738
|
+
break;
|
|
739
|
+
}
|
|
740
|
+
o.add(c), a.push({
|
|
741
|
+
element: t,
|
|
742
|
+
index: c
|
|
743
|
+
});
|
|
744
|
+
}
|
|
745
|
+
if (s && a.length > 0) return a;
|
|
746
|
+
let c = Math.min(e.length, i - r + 1);
|
|
747
|
+
return (t ? e.slice(e.length - c) : e.slice(0, c)).map((e, t) => ({
|
|
748
|
+
element: e,
|
|
749
|
+
index: r + t
|
|
750
|
+
}));
|
|
751
|
+
}
|
|
752
|
+
function Je(e) {
|
|
341
753
|
return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
|
|
342
754
|
}
|
|
343
|
-
var
|
|
344
|
-
function
|
|
345
|
-
let
|
|
346
|
-
|
|
347
|
-
|
|
755
|
+
var Ye = "data-react-window-sizer";
|
|
756
|
+
function Xe({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffset: r = 0, listRef: i, onResize: a, onRowsRendered: o, overscanCount: s = 3, rowComponent: c, rowCount: l, rowHeight: u, rowKey: d, rowProps: f, scrollElement: p, tagName: m = "div", style: h, ...g }) {
|
|
757
|
+
let _ = Le(f), v = V(() => I(c, Re), [c]), [y, b] = U(null), x = Je(u), S = V(() => x ? (e) => u.getRowHeight(e) ?? u.getAverageRowHeight() : u, [x, u]), C = pe(), [w, T] = U(() => C && x), E = H(u);
|
|
758
|
+
Y(() => {
|
|
759
|
+
w && E.current !== u && T(!1);
|
|
760
|
+
}, [w, u]), Ke({
|
|
761
|
+
callback: () => T(!1),
|
|
762
|
+
element: y,
|
|
763
|
+
enabled: w
|
|
764
|
+
});
|
|
765
|
+
let { getCellBounds: D, getEstimatedSize: O, scrollTarget: k, getScrollPositionForIndex: A, startIndexOverscan: j, startIndexVisible: M, stopIndexOverscan: N, stopIndexVisible: L } = Ie({
|
|
766
|
+
containerElement: y,
|
|
767
|
+
containerStyle: h,
|
|
348
768
|
defaultContainerSize: n,
|
|
769
|
+
defaultScrollOffset: r,
|
|
770
|
+
direction: "vertical",
|
|
771
|
+
itemCount: l,
|
|
772
|
+
itemProps: _,
|
|
773
|
+
itemSize: S,
|
|
774
|
+
onResize: a,
|
|
775
|
+
overscanCount: s,
|
|
776
|
+
scrollElement: p
|
|
777
|
+
}), z = H([]), B = Ge({
|
|
349
778
|
direction: "vertical",
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
779
|
+
element: y,
|
|
780
|
+
getCellBounds: D,
|
|
781
|
+
isDynamicSize: x,
|
|
782
|
+
itemCount: l,
|
|
783
|
+
itemElements: z,
|
|
784
|
+
scrollTarget: k,
|
|
785
|
+
getScrollPositionForIndex: A
|
|
355
786
|
});
|
|
356
|
-
|
|
787
|
+
ee(i, () => ({
|
|
357
788
|
get element() {
|
|
358
|
-
return
|
|
789
|
+
return y;
|
|
359
790
|
},
|
|
360
|
-
scrollToRow
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
if (
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
});
|
|
378
|
-
if (v) return l.observeRowElements(e);
|
|
791
|
+
scrollToRow: B
|
|
792
|
+
}), [y, B]);
|
|
793
|
+
let W = w && x && j === 0;
|
|
794
|
+
Y(() => {
|
|
795
|
+
if (!y) return;
|
|
796
|
+
let e = Array.from(y.children).filter((e) => !e.hasAttribute(Ye)), t = qe({
|
|
797
|
+
elements: e,
|
|
798
|
+
isFlowLayout: W,
|
|
799
|
+
rowCount: l,
|
|
800
|
+
startIndex: j,
|
|
801
|
+
stopIndex: N
|
|
802
|
+
}), n = t.map(({ element: e }) => e);
|
|
803
|
+
if (e.forEach((e) => {
|
|
804
|
+
n.includes(e) || e.removeAttribute(ze);
|
|
805
|
+
}), t.forEach(({ element: e, index: t }) => {
|
|
806
|
+
e.setAttribute(ze, `${t}`);
|
|
807
|
+
}), z.current = n, x) return u.observeRowElements(n);
|
|
379
808
|
}, [
|
|
380
|
-
g,
|
|
381
809
|
v,
|
|
810
|
+
y,
|
|
811
|
+
x,
|
|
812
|
+
W,
|
|
382
813
|
l,
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
814
|
+
u,
|
|
815
|
+
d,
|
|
816
|
+
_,
|
|
817
|
+
j,
|
|
818
|
+
N
|
|
819
|
+
]), R(() => {
|
|
820
|
+
j >= 0 && N >= 0 && o && o({
|
|
821
|
+
startIndex: M,
|
|
822
|
+
stopIndex: L
|
|
389
823
|
}, {
|
|
390
|
-
startIndex:
|
|
391
|
-
stopIndex:
|
|
824
|
+
startIndex: j,
|
|
825
|
+
stopIndex: N
|
|
392
826
|
});
|
|
393
827
|
}, [
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
828
|
+
o,
|
|
829
|
+
j,
|
|
830
|
+
M,
|
|
831
|
+
N,
|
|
832
|
+
L
|
|
399
833
|
]);
|
|
400
|
-
let
|
|
834
|
+
let te = V(() => {
|
|
401
835
|
let e = [];
|
|
402
|
-
if (
|
|
403
|
-
let n =
|
|
404
|
-
e.push(/* @__PURE__ */
|
|
405
|
-
...
|
|
836
|
+
if (l > 0) for (let t = j; t <= N; t++) {
|
|
837
|
+
let n = D(t);
|
|
838
|
+
e.push(/* @__PURE__ */ F(v, {
|
|
839
|
+
..._,
|
|
406
840
|
ariaAttributes: {
|
|
407
841
|
"aria-posinset": t + 1,
|
|
408
|
-
"aria-setsize":
|
|
842
|
+
"aria-setsize": l,
|
|
409
843
|
role: "listitem"
|
|
410
844
|
},
|
|
411
|
-
key: t,
|
|
845
|
+
key: d ? d(t, _) : t,
|
|
412
846
|
index: t,
|
|
413
|
-
style: {
|
|
847
|
+
style: W ? { width: "100%" } : {
|
|
414
848
|
position: "absolute",
|
|
415
849
|
left: 0,
|
|
416
850
|
transform: `translateY(${n.scrollOffset}px)`,
|
|
417
|
-
height:
|
|
851
|
+
height: x ? void 0 : n.size,
|
|
418
852
|
width: "100%"
|
|
419
853
|
}
|
|
420
854
|
}));
|
|
421
855
|
}
|
|
422
856
|
return e;
|
|
423
857
|
}, [
|
|
424
|
-
h,
|
|
425
|
-
y,
|
|
426
858
|
v,
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
859
|
+
D,
|
|
860
|
+
x,
|
|
861
|
+
W,
|
|
862
|
+
l,
|
|
863
|
+
d,
|
|
864
|
+
_,
|
|
865
|
+
j,
|
|
866
|
+
N
|
|
867
|
+
]), K = /* @__PURE__ */ G("div", {
|
|
432
868
|
"aria-hidden": !0,
|
|
869
|
+
[Ye]: "",
|
|
433
870
|
style: {
|
|
434
|
-
|
|
871
|
+
position: W ? "absolute" : void 0,
|
|
872
|
+
top: W ? 0 : void 0,
|
|
873
|
+
height: O(),
|
|
435
874
|
width: "100%",
|
|
436
875
|
zIndex: -1
|
|
437
876
|
}
|
|
438
|
-
});
|
|
439
|
-
return
|
|
877
|
+
}, "sizer"), q = /* @__PURE__ */ G(P, { children: e }, "children"), J = /* @__PURE__ */ G(P, { children: te }, "rows");
|
|
878
|
+
return F(m, {
|
|
440
879
|
role: "list",
|
|
441
|
-
...
|
|
880
|
+
...g,
|
|
442
881
|
className: t,
|
|
443
|
-
ref:
|
|
882
|
+
ref: b,
|
|
444
883
|
style: {
|
|
445
884
|
position: "relative",
|
|
446
|
-
maxHeight: "100%",
|
|
447
885
|
flexGrow: 1,
|
|
448
|
-
|
|
449
|
-
|
|
886
|
+
...p === void 0 && {
|
|
887
|
+
maxHeight: "100%",
|
|
888
|
+
overflowY: "auto"
|
|
889
|
+
},
|
|
890
|
+
...h
|
|
450
891
|
}
|
|
451
|
-
},
|
|
892
|
+
}, ...W ? [q, J] : [J, q], K);
|
|
452
893
|
}
|
|
453
|
-
|
|
454
|
-
//#region src/types/conversation-kind.ts
|
|
455
|
-
var X = /* @__PURE__ */ function(e) {
|
|
894
|
+
var Ze = /* @__PURE__ */ Object.assign(Xe, { displayName: "List" }), Q = /* @__PURE__ */ function(e) {
|
|
456
895
|
return e.All = "all", e.Chat = "chat", e.Task = "task", e;
|
|
457
|
-
}({}),
|
|
896
|
+
}({}), Qe = /* @__PURE__ */ function(e) {
|
|
458
897
|
return e.Avatar = "avatar", e.Indicator = "indicator", e;
|
|
459
|
-
}({}),
|
|
898
|
+
}({}), $e = /* @__PURE__ */ function(e) {
|
|
460
899
|
return e.Header = "header", e.Item = "item", e;
|
|
461
|
-
}({}),
|
|
462
|
-
if (n ===
|
|
900
|
+
}({}), et = (e, t) => t === n.All || e.source === t, tt = (t, n) => {
|
|
901
|
+
if (n === Q.All) return !0;
|
|
463
902
|
let r = t.kind ?? e.Chat;
|
|
464
|
-
return n ===
|
|
465
|
-
},
|
|
903
|
+
return n === Q.Task ? r === e.Task : r === e.Chat;
|
|
904
|
+
}, nt = (e, t) => !t || e.title.toLowerCase().includes(t.toLowerCase()), rt = (e) => `${60 + e * 23 % 35}%`, it = (e, t) => e ? t ? "pe-9" : "pe-2 group-focus-within/conversation:pe-9 group-hover/conversation:pe-9" : "pe-3", at = (e, t) => {
|
|
466
905
|
let n = t.rows[e];
|
|
467
|
-
return t.rowVariant ===
|
|
468
|
-
},
|
|
906
|
+
return t.rowVariant === Qe.Indicator ? n.kind === $e.Item ? 34 : e === 0 ? 32 : 40 : n.kind === $e.Item ? 36 : e === 0 ? 24 : 56;
|
|
907
|
+
}, ot = 5, st = (e) => Math.max(ot, Math.ceil(Math.ceil(e / 36) / 2)), ct = (e, { startIndex: t, stopIndex: n }) => {
|
|
469
908
|
let r = /* @__PURE__ */ new Set();
|
|
470
909
|
for (let i = Math.max(0, t); i <= Math.min(n, e.length - 1); i++) {
|
|
471
910
|
let t = e[i];
|
|
472
|
-
t.kind ===
|
|
911
|
+
t.kind === $e.Item && r.add(t.item.id);
|
|
473
912
|
}
|
|
474
913
|
return [...r];
|
|
475
|
-
},
|
|
914
|
+
}, lt = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]), ut = (e) => {
|
|
476
915
|
switch (e) {
|
|
477
916
|
case n.Shared: return n.Shared;
|
|
478
917
|
case n.Organization: return n.Organization;
|
|
479
918
|
default: return n.MyChats;
|
|
480
919
|
}
|
|
481
|
-
},
|
|
920
|
+
}, dt = (e, t) => {
|
|
482
921
|
let n = null;
|
|
483
|
-
for (let r of e) if (r.kind ===
|
|
922
|
+
for (let r of e) if (r.kind === $e.Header) n = r.groupKey;
|
|
484
923
|
else if (r.item.id === t) return n;
|
|
485
924
|
return null;
|
|
486
|
-
},
|
|
925
|
+
}, ft = (e, t, r) => {
|
|
487
926
|
let i = /* @__PURE__ */ new Set();
|
|
488
927
|
if (t != null && i.add(t), t === n.Pinned) {
|
|
489
928
|
let t = r.find((t) => t.id === e);
|
|
490
|
-
t && i.add(
|
|
929
|
+
t && i.add(ut(t.source));
|
|
491
930
|
} else i.add(n.Pinned);
|
|
492
931
|
return i;
|
|
493
|
-
},
|
|
932
|
+
}, pt = (e, t, n, r) => {
|
|
494
933
|
let i = e.currentTarget.getBoundingClientRect();
|
|
495
934
|
if (e.clientY >= i.top + i.height / 2) return t;
|
|
496
935
|
let a = null, o = !1;
|
|
497
|
-
for (let e of n) if (e.kind ===
|
|
936
|
+
for (let e of n) if (e.kind === $e.Header) o = e.groupKey === r;
|
|
498
937
|
else if (o) {
|
|
499
938
|
if (e.item.id === t) return a;
|
|
500
939
|
a = e.item.id;
|
|
501
940
|
}
|
|
502
941
|
return null;
|
|
503
|
-
},
|
|
942
|
+
}, $ = {
|
|
504
943
|
skeletonColor: "var(--cp-skeleton-color, var(--bg-control-disable-primary, #dce0e8))",
|
|
505
944
|
item: "_item_gcqru_2",
|
|
506
945
|
itemActive: "_itemActive_gcqru_15",
|
|
@@ -513,9 +952,9 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
513
952
|
unreadDot: "_unreadDot_gcqru_51",
|
|
514
953
|
search: "_search_gcqru_59",
|
|
515
954
|
list: "_list_gcqru_70"
|
|
516
|
-
},
|
|
517
|
-
let f = s != null, p = o ===
|
|
518
|
-
return /* @__PURE__ */
|
|
955
|
+
}, mt = ({ label: e, isExpanded: t, onToggle: n, listId: r, className: i = "dial-tiny-lead-text", variant: o = Qe.Avatar, dropZoneGroupKey: s, isDragOver: c, onDragOver: l, onDragLeave: u, onDrop: d }) => {
|
|
956
|
+
let f = s != null, p = o === Qe.Indicator;
|
|
957
|
+
return /* @__PURE__ */ K("button", {
|
|
519
958
|
type: "button",
|
|
520
959
|
"aria-expanded": t,
|
|
521
960
|
"aria-controls": r,
|
|
@@ -529,27 +968,27 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
529
968
|
onDrop: f ? (e) => {
|
|
530
969
|
f && (e.preventDefault(), d?.(s, s, null));
|
|
531
970
|
} : void 0,
|
|
532
|
-
className: a("group flex h-6 w-full items-center gap-1 rounded text-start", p ? "px-2" : "py-1 pe-3", i,
|
|
971
|
+
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),
|
|
533
972
|
children: [
|
|
534
|
-
!p && (t ? /* @__PURE__ */
|
|
973
|
+
!p && (t ? /* @__PURE__ */ G(q, {
|
|
535
974
|
size: 12,
|
|
536
975
|
className: "shrink-0 opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-visible:opacity-100",
|
|
537
976
|
"aria-hidden": !0
|
|
538
|
-
}) : /* @__PURE__ */
|
|
977
|
+
}) : /* @__PURE__ */ G(J, {
|
|
539
978
|
size: 12,
|
|
540
979
|
className: "shrink-0 opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-visible:opacity-100 rtl:scale-x-[-1]",
|
|
541
980
|
"aria-hidden": !0
|
|
542
981
|
})),
|
|
543
|
-
p ? /* @__PURE__ */
|
|
982
|
+
p ? /* @__PURE__ */ G("span", {
|
|
544
983
|
className: "max-w-full min-w-0",
|
|
545
|
-
children: /* @__PURE__ */
|
|
546
|
-
}) : /* @__PURE__ */
|
|
547
|
-
p && (t ? /* @__PURE__ */
|
|
984
|
+
children: /* @__PURE__ */ G(v, { text: e })
|
|
985
|
+
}) : /* @__PURE__ */ G(v, { text: e }),
|
|
986
|
+
p && (t ? /* @__PURE__ */ G(ne, {
|
|
548
987
|
size: m.SM,
|
|
549
988
|
stroke: h,
|
|
550
989
|
className: "shrink-0 opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-visible:opacity-100",
|
|
551
990
|
"aria-hidden": !0
|
|
552
|
-
}) : /* @__PURE__ */
|
|
991
|
+
}) : /* @__PURE__ */ G(re, {
|
|
553
992
|
size: m.SM,
|
|
554
993
|
stroke: h,
|
|
555
994
|
className: "shrink-0 opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-visible:opacity-100 rtl:scale-x-[-1]",
|
|
@@ -557,117 +996,117 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
557
996
|
}))
|
|
558
997
|
]
|
|
559
998
|
});
|
|
560
|
-
},
|
|
561
|
-
let [N, P] =
|
|
999
|
+
}, ht = I(({ item: e, isActive: n, onSelectConversation: r, searchQuery: i = "", getActions: o, onActionMenuOpen: s, actionsLabel: c = "More actions", itemTitleClassName: l = "dial-small-text", unreadItemTitleClassName: u = "dial-small-semi-text", itemIconBadgeClassName: d, unreadIndicatorLabel: p = "Unread", variant: v = Qe.Avatar, rowGroupKey: y, rows: S, draggingId: C, dragOverId: w, allowedDropGroups: T, onDragStart: E, onDragEnd: D, onDragOver: O, onDragLeave: k, onDrop: M }) => {
|
|
1000
|
+
let [N, P] = U(!1), F = H(null), I = L((t) => {
|
|
562
1001
|
P(t), t && F.current && s?.(e, F.current);
|
|
563
|
-
}, [e, s]),
|
|
1002
|
+
}, [e, s]), R = V(() => o?.(e) ?? [], [o, e]), z = R.length > 0, ee = V(() => ({ tooltip: e.iconTooltip }), [e.iconTooltip]), B = V(() => ({ badgeClassName: d }), [d]), W = v === Qe.Indicator, te = e.leadingIcon ? /* @__PURE__ */ G("span", {
|
|
564
1003
|
className: "flex size-6 shrink-0 items-center justify-center",
|
|
565
1004
|
children: e.leadingIcon
|
|
566
|
-
}) : e.isIconLoading ? /* @__PURE__ */
|
|
1005
|
+
}) : e.isIconLoading ? /* @__PURE__ */ G(A, {
|
|
567
1006
|
variant: j.Circular,
|
|
568
1007
|
width: m.LG,
|
|
569
1008
|
height: m.LG,
|
|
570
|
-
color:
|
|
1009
|
+
color: $.skeletonColor,
|
|
571
1010
|
"aria-hidden": !0
|
|
572
|
-
}) : /* @__PURE__ */
|
|
1011
|
+
}) : /* @__PURE__ */ G(t, {
|
|
573
1012
|
src: e.iconUrl,
|
|
574
1013
|
size: m.LG,
|
|
575
1014
|
initialsName: e.iconTooltip ?? "",
|
|
576
|
-
labels:
|
|
577
|
-
styles:
|
|
578
|
-
}),
|
|
1015
|
+
labels: ee,
|
|
1016
|
+
styles: B
|
|
1017
|
+
}), q = it(z, N), J = /* @__PURE__ */ K("span", {
|
|
579
1018
|
className: "flex size-6 shrink-0 items-center justify-center",
|
|
580
|
-
children: [/* @__PURE__ */
|
|
581
|
-
className: a("size-2 rounded-full", e.isUnread ? a("size-[7.11px]",
|
|
1019
|
+
children: [/* @__PURE__ */ G("span", {
|
|
1020
|
+
className: a("size-2 rounded-full", e.isUnread ? a("size-[7.11px]", $.unreadDot) : $.indicatorDot),
|
|
582
1021
|
"aria-hidden": !0
|
|
583
|
-
}), e.isUnread && /* @__PURE__ */
|
|
1022
|
+
}), e.isUnread && /* @__PURE__ */ G("span", {
|
|
584
1023
|
className: "sr-only",
|
|
585
1024
|
children: p
|
|
586
1025
|
})]
|
|
587
|
-
}),
|
|
1026
|
+
}), ne = e.isUnread && !W ? /* @__PURE__ */ K("span", {
|
|
588
1027
|
className: "flex size-6 shrink-0 items-center justify-center",
|
|
589
|
-
children: [/* @__PURE__ */
|
|
590
|
-
className: a("size-[7.11px] rounded-full",
|
|
1028
|
+
children: [/* @__PURE__ */ G("span", {
|
|
1029
|
+
className: a("size-[7.11px] rounded-full", $.unreadDot, z && (N ? "opacity-0" : "group-focus-within/conversation:opacity-0 group-hover/conversation:opacity-0")),
|
|
591
1030
|
"aria-hidden": !0
|
|
592
|
-
}), /* @__PURE__ */
|
|
1031
|
+
}), /* @__PURE__ */ G("span", {
|
|
593
1032
|
className: "sr-only",
|
|
594
1033
|
children: p
|
|
595
1034
|
})]
|
|
596
|
-
}) : void 0,
|
|
1035
|
+
}) : void 0, re = y != null, ae = L((e) => {
|
|
597
1036
|
e.currentTarget.contains(e.relatedTarget) || k?.();
|
|
598
|
-
}, [k]),
|
|
1037
|
+
}, [k]), oe = L((t) => {
|
|
599
1038
|
if (!y || !S || !M) return;
|
|
600
1039
|
t.preventDefault();
|
|
601
|
-
let n =
|
|
1040
|
+
let n = pt(t, e.id, S, y);
|
|
602
1041
|
M(e.id, y, n);
|
|
603
1042
|
}, [
|
|
604
1043
|
e.id,
|
|
605
1044
|
S,
|
|
606
1045
|
y,
|
|
607
1046
|
M
|
|
608
|
-
]),
|
|
609
|
-
return /* @__PURE__ */
|
|
610
|
-
className: a("group/conversation relative",
|
|
611
|
-
draggable:
|
|
612
|
-
onDragStart:
|
|
613
|
-
onDragEnd:
|
|
614
|
-
onDragOver:
|
|
1047
|
+
]), se = e.id === C, ce = e.id === w, le = y != null && (T?.has(y) ?? !1), ue = C != null;
|
|
1048
|
+
return /* @__PURE__ */ K("li", {
|
|
1049
|
+
className: a("group/conversation relative", se && "cursor-grabbing opacity-50", ce && le && "rounded", ce && le && $.dropZoneActive, ue && !se && !le && "cursor-not-allowed"),
|
|
1050
|
+
draggable: re || void 0,
|
|
1051
|
+
onDragStart: re ? () => E?.(e.id) : void 0,
|
|
1052
|
+
onDragEnd: re ? D : void 0,
|
|
1053
|
+
onDragOver: re ? (t) => {
|
|
615
1054
|
t.preventDefault(), O?.(e.id);
|
|
616
1055
|
} : void 0,
|
|
617
|
-
onDragLeave:
|
|
618
|
-
onDrop:
|
|
619
|
-
children: [/* @__PURE__ */
|
|
1056
|
+
onDragLeave: re ? ae : void 0,
|
|
1057
|
+
onDrop: re ? oe : void 0,
|
|
1058
|
+
children: [/* @__PURE__ */ G("a", {
|
|
620
1059
|
href: e.href,
|
|
621
1060
|
className: "contents",
|
|
622
1061
|
onClick: (t) => {
|
|
623
1062
|
e.href && (t.preventDefault(), r(e.id));
|
|
624
1063
|
},
|
|
625
|
-
children: /* @__PURE__ */
|
|
626
|
-
iconBefore:
|
|
627
|
-
label: /* @__PURE__ */
|
|
1064
|
+
children: /* @__PURE__ */ G(f, {
|
|
1065
|
+
iconBefore: W ? J : te,
|
|
1066
|
+
label: /* @__PURE__ */ G(x, {
|
|
628
1067
|
text: e.title,
|
|
629
1068
|
query: i,
|
|
630
1069
|
className: e.isUnread ? u : l,
|
|
631
1070
|
maxLines: 1
|
|
632
1071
|
}),
|
|
633
|
-
iconAfter:
|
|
1072
|
+
iconAfter: ne,
|
|
634
1073
|
textClassName: "min-w-0 flex-1",
|
|
635
1074
|
"aria-current": n ? "page" : void 0,
|
|
636
1075
|
onClick: e.href ? void 0 : () => r(e.id),
|
|
637
1076
|
tabIndex: e.href ? -1 : void 0,
|
|
638
|
-
className: a("h-8 w-full justify-start py-2 after:pointer-events-none",
|
|
1077
|
+
className: a("h-8 w-full justify-start py-2 after:pointer-events-none", W ? "gap-0.5 ps-0" : "gap-2 ps-3", q, $.item, W && $.itemIndicator, n && $.itemActive, N && $.itemActive)
|
|
639
1078
|
})
|
|
640
|
-
}),
|
|
641
|
-
className: a("absolute inset-y-0 flex items-center",
|
|
642
|
-
children: /* @__PURE__ */
|
|
643
|
-
items:
|
|
644
|
-
onOpenChange:
|
|
1079
|
+
}), z && /* @__PURE__ */ G("div", {
|
|
1080
|
+
className: a("absolute inset-y-0 flex items-center", W ? "inset-e-2" : "inset-e-1", N ? "opacity-100" : "opacity-0 group-focus-within/conversation:opacity-100 group-hover/conversation:opacity-100"),
|
|
1081
|
+
children: /* @__PURE__ */ G(g, {
|
|
1082
|
+
items: R,
|
|
1083
|
+
onOpenChange: I,
|
|
645
1084
|
matchReferenceWidth: !1,
|
|
646
1085
|
listClassName: "w-[200px]",
|
|
647
|
-
children: /* @__PURE__ */
|
|
1086
|
+
children: /* @__PURE__ */ G(b, {
|
|
648
1087
|
ref: F,
|
|
649
|
-
icon: /* @__PURE__ */
|
|
650
|
-
size:
|
|
651
|
-
className:
|
|
1088
|
+
icon: /* @__PURE__ */ G(ie, {
|
|
1089
|
+
size: W ? m.SM : m.MD,
|
|
1090
|
+
className: $.triggerIcon,
|
|
652
1091
|
"aria-hidden": !0,
|
|
653
1092
|
stroke: h
|
|
654
1093
|
}),
|
|
655
1094
|
size: _.Small,
|
|
656
1095
|
"aria-label": c,
|
|
657
|
-
className: a(
|
|
1096
|
+
className: a(W && "size-6! min-h-0! min-w-0! p-1!", N && $.triggerActive)
|
|
658
1097
|
})
|
|
659
1098
|
})
|
|
660
1099
|
})]
|
|
661
1100
|
});
|
|
662
|
-
}),
|
|
663
|
-
let w = r[e], T = h ===
|
|
664
|
-
if (w.kind ===
|
|
1101
|
+
}), gt = (e, t) => t ? e === 0 ? "pt-2" : "pt-4" : e === 0 ? "pt-0" : "pt-8", _t = ({ 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 = Qe.Avatar, draggingId: g, dragOverId: _, allowedDropGroups: v, onDragStart: y, onDragEnd: b, onDragOver: x, onDragLeave: S, onDrop: C }) => {
|
|
1102
|
+
let w = r[e], T = h === Qe.Indicator;
|
|
1103
|
+
if (w.kind === $e.Header) {
|
|
665
1104
|
let r = w.groupKey === n.Pinned;
|
|
666
|
-
return /* @__PURE__ */
|
|
1105
|
+
return /* @__PURE__ */ G("div", {
|
|
667
1106
|
role: "listitem",
|
|
668
1107
|
style: t,
|
|
669
|
-
className:
|
|
670
|
-
children: /* @__PURE__ */
|
|
1108
|
+
className: gt(e, T),
|
|
1109
|
+
children: /* @__PURE__ */ G(mt, {
|
|
671
1110
|
variant: h,
|
|
672
1111
|
label: w.label,
|
|
673
1112
|
isExpanded: i.has(w.groupKey),
|
|
@@ -682,11 +1121,11 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
682
1121
|
})
|
|
683
1122
|
});
|
|
684
1123
|
}
|
|
685
|
-
return /* @__PURE__ */
|
|
1124
|
+
return /* @__PURE__ */ G("div", {
|
|
686
1125
|
role: "presentation",
|
|
687
1126
|
style: t,
|
|
688
1127
|
className: T ? "pt-0.5" : "pt-1",
|
|
689
|
-
children: /* @__PURE__ */
|
|
1128
|
+
children: /* @__PURE__ */ G(ht, {
|
|
690
1129
|
variant: h,
|
|
691
1130
|
item: w.item,
|
|
692
1131
|
isActive: w.item.id === s,
|
|
@@ -711,38 +1150,38 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
711
1150
|
onDrop: C
|
|
712
1151
|
})
|
|
713
1152
|
});
|
|
714
|
-
},
|
|
1153
|
+
}, vt = /* @__PURE__ */ new Set([
|
|
715
1154
|
n.Pinned,
|
|
716
1155
|
n.MyChats,
|
|
717
1156
|
n.Shared,
|
|
718
1157
|
n.Organization
|
|
719
|
-
]),
|
|
720
|
-
let { colors: E, typography: D, itemIconBadgeClassName: O } = x ?? {}, { emptyLabel: k, emptyDescription: j, noResultsLabel: M, noResultsDescription: N, sharedEmptyDescription: P = N, tabEmptyLabels: F, loadingLabel:
|
|
721
|
-
|
|
722
|
-
}, []),
|
|
723
|
-
|
|
1158
|
+
]), yt = I(({ conversations: e, isLoading: t, isUpdatingTitles: i = !1, preserveActiveSearchResult: o = !1, onSelectConversation: s, activeConversationId: u, labels: d, searchQuery: f = "", activeFilter: p = n.All, activeTypeFilter: m = Q.All, hiddenSources: h, rowVariant: g, getActions: _, onActionMenuOpen: v, onMoveConversation: y, onVisibleConversationIdsChange: b, styles: x, id: S, className: T }) => {
|
|
1159
|
+
let { colors: E, typography: D, itemIconBadgeClassName: O } = x ?? {}, { emptyLabel: k, emptyDescription: j, noResultsLabel: M, noResultsDescription: N, sharedEmptyDescription: P = N, tabEmptyLabels: F, loadingLabel: I = "Loading conversations", updatingTitlesLabel: ee = "Updating conversation names", groupLabels: B, actionsLabel: W, unreadIndicatorLabel: te } = d, q = V(() => h?.length ? e.filter((e) => e.source == null || !h.includes(e.source)) : e, [e, h]), [J, ne] = U(() => vt), [re, ie] = U(5), ae = z(), oe = H(null), se = H(null), [ce, le] = U(null), [Y, de] = U(null), [fe, pe] = U(null), X = H(null), me = H(null), he = L(({ height: e }) => {
|
|
1160
|
+
ie(st(e));
|
|
1161
|
+
}, []), ge = L((e) => {
|
|
1162
|
+
ne((t) => {
|
|
724
1163
|
let n = new Set(t);
|
|
725
1164
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
726
1165
|
});
|
|
727
|
-
}, []),
|
|
728
|
-
|
|
729
|
-
}, []),
|
|
730
|
-
let n =
|
|
731
|
-
|
|
732
|
-
}, [
|
|
733
|
-
|
|
734
|
-
}, [
|
|
735
|
-
|
|
736
|
-
}, []),
|
|
737
|
-
|
|
738
|
-
}, []),
|
|
739
|
-
let r =
|
|
740
|
-
|
|
1166
|
+
}, []), _e = L(() => {
|
|
1167
|
+
X.current = null, me.current = null, le(null), de(null), pe(null);
|
|
1168
|
+
}, []), ve = L((e, t) => {
|
|
1169
|
+
let n = ft(e, dt(t, e), q);
|
|
1170
|
+
X.current = e, me.current = n, le(e), pe(n);
|
|
1171
|
+
}, [q]), ye = L(() => {
|
|
1172
|
+
_e();
|
|
1173
|
+
}, [_e]), be = L((e) => {
|
|
1174
|
+
de(e);
|
|
1175
|
+
}, []), xe = L(() => {
|
|
1176
|
+
de(null);
|
|
1177
|
+
}, []), Se = L((e, t, n) => {
|
|
1178
|
+
let r = X.current, i = me.current;
|
|
1179
|
+
_e(), r != null && r !== e && i?.has(t) && y?.({
|
|
741
1180
|
draggedId: r,
|
|
742
1181
|
targetGroupKey: t,
|
|
743
1182
|
afterId: n
|
|
744
1183
|
});
|
|
745
|
-
}, [
|
|
1184
|
+
}, [_e, y]), Ce = r({
|
|
746
1185
|
"--cp-item-hover": E?.itemHover,
|
|
747
1186
|
"--cp-item-active": E?.itemActive,
|
|
748
1187
|
"--cp-text": E?.text,
|
|
@@ -755,14 +1194,14 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
755
1194
|
"--cp-unread-dot": E?.unreadDot,
|
|
756
1195
|
"--cp-indicator-dot": E?.indicatorDot,
|
|
757
1196
|
"--cp-list-font-family": D?.fontFamily
|
|
758
|
-
}), [
|
|
759
|
-
|
|
1197
|
+
}), [we, Te] = U(null);
|
|
1198
|
+
R(() => {
|
|
760
1199
|
if (!o || !f || !u) {
|
|
761
|
-
|
|
1200
|
+
Te(null);
|
|
762
1201
|
return;
|
|
763
1202
|
}
|
|
764
|
-
let e =
|
|
765
|
-
|
|
1203
|
+
let e = q.find((e) => e.id === u);
|
|
1204
|
+
Te((t) => e && nt(e, f) ? t?.id === e.id && t.query === f ? t : {
|
|
766
1205
|
id: e.id,
|
|
767
1206
|
query: f
|
|
768
1207
|
} : t?.id === u && t.query === f ? t : null);
|
|
@@ -770,10 +1209,10 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
770
1209
|
o,
|
|
771
1210
|
f,
|
|
772
1211
|
u,
|
|
773
|
-
|
|
1212
|
+
q
|
|
774
1213
|
]);
|
|
775
|
-
let
|
|
776
|
-
o && f &&
|
|
1214
|
+
let Ee = L((e) => {
|
|
1215
|
+
o && f && Te({
|
|
777
1216
|
id: e,
|
|
778
1217
|
query: f
|
|
779
1218
|
}), s(e);
|
|
@@ -781,82 +1220,82 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
781
1220
|
o,
|
|
782
1221
|
f,
|
|
783
1222
|
s
|
|
784
|
-
]),
|
|
785
|
-
|
|
1223
|
+
]), De = o && f !== "" && we?.query === f && we.id === u ? we.id : void 0, Oe = V(() => q.filter((e) => et(e, p) && tt(e, m) && (nt(e, f) || e.id === De)), [
|
|
1224
|
+
q,
|
|
786
1225
|
p,
|
|
787
1226
|
m,
|
|
788
1227
|
f,
|
|
789
|
-
|
|
790
|
-
]),
|
|
1228
|
+
De
|
|
1229
|
+
]), ke = V(() => Oe.filter((e) => e.isPinned), [Oe]), Ae = V(() => Oe.filter((e) => !e.isPinned && e.source !== n.Shared && e.source !== n.Organization), [Oe]), je = V(() => Oe.filter((e) => !e.isPinned && e.source === n.Shared), [Oe]), Me = V(() => Oe.filter((e) => !e.isPinned && e.source === n.Organization), [Oe]), Ne = V(() => [
|
|
791
1230
|
{
|
|
792
1231
|
key: n.Pinned,
|
|
793
|
-
label:
|
|
794
|
-
items:
|
|
1232
|
+
label: B?.pinned ?? "Pinned",
|
|
1233
|
+
items: ke
|
|
795
1234
|
},
|
|
796
1235
|
{
|
|
797
1236
|
key: n.MyChats,
|
|
798
|
-
label:
|
|
799
|
-
items:
|
|
1237
|
+
label: B?.myChats ?? "My chats",
|
|
1238
|
+
items: Ae
|
|
800
1239
|
},
|
|
801
1240
|
{
|
|
802
1241
|
key: n.Shared,
|
|
803
|
-
label:
|
|
804
|
-
items:
|
|
1242
|
+
label: B?.shared ?? "Shared",
|
|
1243
|
+
items: je
|
|
805
1244
|
},
|
|
806
1245
|
{
|
|
807
1246
|
key: n.Organization,
|
|
808
|
-
label:
|
|
809
|
-
items:
|
|
1247
|
+
label: B?.organization ?? "Organization",
|
|
1248
|
+
items: Me
|
|
810
1249
|
}
|
|
811
1250
|
], [
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
]),
|
|
1251
|
+
B,
|
|
1252
|
+
ke,
|
|
1253
|
+
Ae,
|
|
1254
|
+
je,
|
|
1255
|
+
Me
|
|
1256
|
+
]), Z = V(() => {
|
|
818
1257
|
let e = [];
|
|
819
|
-
for (let t of
|
|
820
|
-
kind:
|
|
1258
|
+
for (let t of Ne) if (t.items.length !== 0 && (e.push({
|
|
1259
|
+
kind: $e.Header,
|
|
821
1260
|
groupKey: t.key,
|
|
822
1261
|
label: t.label
|
|
823
|
-
}),
|
|
824
|
-
kind:
|
|
1262
|
+
}), J.has(t.key))) for (let n of t.items) e.push({
|
|
1263
|
+
kind: $e.Item,
|
|
825
1264
|
item: n,
|
|
826
1265
|
groupKey: t.key
|
|
827
1266
|
});
|
|
828
1267
|
return e;
|
|
829
|
-
}, [
|
|
830
|
-
|
|
831
|
-
if (!u ||
|
|
832
|
-
let e =
|
|
833
|
-
e >= 0 && (
|
|
1268
|
+
}, [Ne, J]);
|
|
1269
|
+
R(() => {
|
|
1270
|
+
if (!u || se.current === u) return;
|
|
1271
|
+
let e = Z.findIndex((e) => e.kind === $e.Item && e.item.id === u);
|
|
1272
|
+
e >= 0 && (oe.current?.scrollToRow({
|
|
834
1273
|
index: e,
|
|
835
1274
|
align: "smart",
|
|
836
1275
|
behavior: "smooth"
|
|
837
|
-
}),
|
|
1276
|
+
}), se.current = u);
|
|
838
1277
|
}, [
|
|
839
1278
|
u,
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
1279
|
+
Ne,
|
|
1280
|
+
J,
|
|
1281
|
+
Z
|
|
843
1282
|
]);
|
|
844
|
-
let
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
}, [
|
|
848
|
-
let
|
|
849
|
-
rows:
|
|
850
|
-
expandedGroups:
|
|
851
|
-
onToggleGroup:
|
|
852
|
-
listId:
|
|
1283
|
+
let Pe = H(Z);
|
|
1284
|
+
R(() => {
|
|
1285
|
+
Pe.current = Z;
|
|
1286
|
+
}, [Z]);
|
|
1287
|
+
let Fe = L((e) => ve(e, Pe.current), [ve]), Ie = V(() => ({
|
|
1288
|
+
rows: Z,
|
|
1289
|
+
expandedGroups: J,
|
|
1290
|
+
onToggleGroup: ge,
|
|
1291
|
+
listId: ae,
|
|
853
1292
|
activeConversationId: u,
|
|
854
1293
|
searchQuery: f,
|
|
855
|
-
onSelectConversation:
|
|
1294
|
+
onSelectConversation: Ee,
|
|
856
1295
|
getActions: _,
|
|
857
1296
|
onActionMenuOpen: v,
|
|
858
|
-
actionsLabel:
|
|
859
|
-
unreadIndicatorLabel:
|
|
1297
|
+
actionsLabel: W,
|
|
1298
|
+
unreadIndicatorLabel: te,
|
|
860
1299
|
rowVariant: g,
|
|
861
1300
|
styles: {
|
|
862
1301
|
groupHeaderClassName: D?.groupHeaderClassName,
|
|
@@ -864,96 +1303,96 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
864
1303
|
unreadItemTitleClassName: D?.unreadItemTitleClassName,
|
|
865
1304
|
itemIconBadgeClassName: O
|
|
866
1305
|
},
|
|
867
|
-
draggingId:
|
|
868
|
-
dragOverId:
|
|
869
|
-
allowedDropGroups:
|
|
870
|
-
onDragStart:
|
|
871
|
-
onDragEnd:
|
|
872
|
-
onDragOver:
|
|
873
|
-
onDragLeave:
|
|
874
|
-
onDrop:
|
|
1306
|
+
draggingId: ce,
|
|
1307
|
+
dragOverId: Y,
|
|
1308
|
+
allowedDropGroups: fe,
|
|
1309
|
+
onDragStart: Fe,
|
|
1310
|
+
onDragEnd: ye,
|
|
1311
|
+
onDragOver: be,
|
|
1312
|
+
onDragLeave: xe,
|
|
1313
|
+
onDrop: Se
|
|
875
1314
|
}), [
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
1315
|
+
Z,
|
|
1316
|
+
J,
|
|
1317
|
+
ge,
|
|
1318
|
+
ae,
|
|
880
1319
|
u,
|
|
881
1320
|
f,
|
|
882
|
-
|
|
1321
|
+
Ee,
|
|
883
1322
|
_,
|
|
884
1323
|
v,
|
|
885
|
-
|
|
886
|
-
|
|
1324
|
+
W,
|
|
1325
|
+
te,
|
|
887
1326
|
g,
|
|
888
1327
|
D?.groupHeaderClassName,
|
|
889
1328
|
D?.itemTitleClassName,
|
|
890
1329
|
D?.unreadItemTitleClassName,
|
|
891
1330
|
O,
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
1331
|
+
ce,
|
|
1332
|
+
Y,
|
|
1333
|
+
fe,
|
|
1334
|
+
Fe,
|
|
1335
|
+
ye,
|
|
896
1336
|
be,
|
|
897
1337
|
xe,
|
|
898
|
-
Se
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
lt.current = b;
|
|
1338
|
+
Se
|
|
1339
|
+
]), Le = f !== "" || p !== n.All || m !== Q.All, Re = Oe.length === 0, ze = Re && Le, Be = Re && !Le, Ve = ze && f === "" && m === Q.All ? F?.[p] : void 0, He = Ve?.label ?? M, Ue = p === n.Shared && f === "" ? P : N, We = Ve?.description ?? Ue, Ge = !t && !Re, Ke = H(null), qe = H(null), Je = H(b);
|
|
1340
|
+
R(() => {
|
|
1341
|
+
Je.current = b;
|
|
903
1342
|
}, [b]);
|
|
904
|
-
let
|
|
905
|
-
|
|
906
|
-
}, []),
|
|
907
|
-
|
|
908
|
-
}, [
|
|
909
|
-
return
|
|
910
|
-
|
|
1343
|
+
let Ye = L((e) => {
|
|
1344
|
+
qe.current && lt(qe.current, e) || (qe.current = e, Je.current?.(e));
|
|
1345
|
+
}, []), Xe = L((e) => {
|
|
1346
|
+
Ke.current = e, Ye(ct(Z, e));
|
|
1347
|
+
}, [Z, Ye]);
|
|
1348
|
+
return R(() => {
|
|
1349
|
+
Ge ? Ke.current && Ye(ct(Z, Ke.current)) : (Ke.current = null, Ye([]));
|
|
911
1350
|
}, [
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
]), /* @__PURE__ */
|
|
1351
|
+
Ge,
|
|
1352
|
+
Z,
|
|
1353
|
+
Ye
|
|
1354
|
+
]), /* @__PURE__ */ K("div", {
|
|
916
1355
|
id: S,
|
|
917
|
-
style:
|
|
918
|
-
className: a("flex-1 overflow-hidden px-3",
|
|
919
|
-
children: [/* @__PURE__ */
|
|
1356
|
+
style: Ce,
|
|
1357
|
+
className: a("flex-1 overflow-hidden px-3", $.list, D?.fontClassName, g !== Qe.Indicator && "py-1", T, ue.list),
|
|
1358
|
+
children: [/* @__PURE__ */ G(C, {
|
|
920
1359
|
visuallyHidden: !0,
|
|
921
1360
|
as: w.Span,
|
|
922
|
-
children: t ?
|
|
923
|
-
}), t ? /* @__PURE__ */
|
|
1361
|
+
children: t ? I : i ? ee : Be ? k : ze ? He : ""
|
|
1362
|
+
}), t ? /* @__PURE__ */ G("div", {
|
|
924
1363
|
className: "flex flex-col gap-3 px-2 py-3",
|
|
925
|
-
children: Array.from({ length: 15 }, (e, t) => /* @__PURE__ */
|
|
1364
|
+
children: Array.from({ length: 15 }, (e, t) => /* @__PURE__ */ G(A, {
|
|
926
1365
|
avatar: { size: 24 },
|
|
927
|
-
showTitle: { width:
|
|
1366
|
+
showTitle: { width: rt(t) },
|
|
928
1367
|
paragraph: !1,
|
|
929
1368
|
active: !0,
|
|
930
|
-
color:
|
|
1369
|
+
color: $.skeletonColor
|
|
931
1370
|
}, t))
|
|
932
|
-
}) :
|
|
1371
|
+
}) : Be ? /* @__PURE__ */ G(c, {
|
|
933
1372
|
label: k,
|
|
934
1373
|
description: j
|
|
935
|
-
}) :
|
|
936
|
-
label:
|
|
937
|
-
description:
|
|
938
|
-
}) : /* @__PURE__ */
|
|
939
|
-
listRef:
|
|
940
|
-
id:
|
|
1374
|
+
}) : ze && f !== "" && i ? /* @__PURE__ */ G(c, { label: ee }) : ze ? /* @__PURE__ */ G(l, {
|
|
1375
|
+
label: He,
|
|
1376
|
+
description: We
|
|
1377
|
+
}) : /* @__PURE__ */ G(Ze, {
|
|
1378
|
+
listRef: oe,
|
|
1379
|
+
id: ae,
|
|
941
1380
|
role: "list",
|
|
942
1381
|
style: { height: "100%" },
|
|
943
|
-
rowComponent:
|
|
944
|
-
rowCount:
|
|
945
|
-
rowHeight:
|
|
946
|
-
overscanCount:
|
|
947
|
-
onResize:
|
|
948
|
-
onRowsRendered:
|
|
949
|
-
rowProps:
|
|
1382
|
+
rowComponent: _t,
|
|
1383
|
+
rowCount: Z.length,
|
|
1384
|
+
rowHeight: at,
|
|
1385
|
+
overscanCount: re,
|
|
1386
|
+
onResize: he,
|
|
1387
|
+
onRowsRendered: Xe,
|
|
1388
|
+
rowProps: Ie
|
|
950
1389
|
})]
|
|
951
1390
|
});
|
|
952
|
-
}),
|
|
1391
|
+
}), bt = {
|
|
953
1392
|
title: "_title_mvx21_2",
|
|
954
1393
|
filterValue: "_filterValue_mvx21_12",
|
|
955
1394
|
filterIndicator: "_filterIndicator_mvx21_17"
|
|
956
|
-
},
|
|
1395
|
+
}, xt = "!size-6 !min-h-0 !min-w-0 !p-1", St = [
|
|
957
1396
|
{
|
|
958
1397
|
value: n.All,
|
|
959
1398
|
getLabel: (e) => e.all
|
|
@@ -970,49 +1409,49 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
970
1409
|
value: n.Organization,
|
|
971
1410
|
getLabel: (e) => e.organization
|
|
972
1411
|
}
|
|
973
|
-
],
|
|
1412
|
+
], Ct = [
|
|
974
1413
|
{
|
|
975
|
-
value:
|
|
1414
|
+
value: Q.All,
|
|
976
1415
|
getLabel: (e) => e.all
|
|
977
1416
|
},
|
|
978
1417
|
{
|
|
979
|
-
value:
|
|
1418
|
+
value: Q.Chat,
|
|
980
1419
|
getLabel: (e) => e.chat ?? "Chat"
|
|
981
1420
|
},
|
|
982
1421
|
{
|
|
983
|
-
value:
|
|
1422
|
+
value: Q.Task,
|
|
984
1423
|
getLabel: (e) => e.task ?? "Task"
|
|
985
1424
|
}
|
|
986
|
-
],
|
|
987
|
-
let w = S?.typography?.titleClassName ?? "dial-tiny-lead-semi-text", T = S?.typography?.searchTextClassName ?? "dial-tiny-text", D = S?.colors?.filterValue, O =
|
|
988
|
-
|
|
1425
|
+
], wt = I(({ 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 = Q.All, onTypeFilterChange: v, hiddenSources: y, actions: x, styles: S, className: C }) => {
|
|
1426
|
+
let w = S?.typography?.titleClassName ?? "dial-tiny-lead-semi-text", T = S?.typography?.searchTextClassName ?? "dial-tiny-text", D = S?.colors?.filterValue, O = H(null), A = H(null), j = H(c), M = e.filterLabels.groupAriaLabel ?? "Filter chats", N = e.filterActiveLabel ?? "Filters applied", P = z(), F = d !== n.All || p !== Q.All, I = l != null && u != null;
|
|
1427
|
+
R(() => {
|
|
989
1428
|
c ? A.current?.focus() : j.current && O.current?.focus(), j.current = c;
|
|
990
1429
|
}, [c]);
|
|
991
|
-
let
|
|
1430
|
+
let ee = L(() => {
|
|
992
1431
|
u?.(!0);
|
|
993
|
-
}, [u]),
|
|
1432
|
+
}, [u]), B = L(() => {
|
|
994
1433
|
l?.(""), u?.(!1);
|
|
995
|
-
}, [l, u]),
|
|
1434
|
+
}, [l, u]), U = L((e) => {
|
|
996
1435
|
l?.(e ?? "");
|
|
997
|
-
}, [l]),
|
|
998
|
-
e.key === "Escape" && (e.stopPropagation(),
|
|
999
|
-
}, [
|
|
1000
|
-
let { filterLabels: t } = e, n = r({ "--cp-list-header-filter-value": D }), i = (e, t) => () => /* @__PURE__ */
|
|
1436
|
+
}, [l]), W = L((e) => {
|
|
1437
|
+
e.key === "Escape" && (e.stopPropagation(), B());
|
|
1438
|
+
}, [B]), q = V(() => {
|
|
1439
|
+
let { filterLabels: t } = e, n = r({ "--cp-list-header-filter-value": D }), i = (e, t) => () => /* @__PURE__ */ K(te, { children: [/* @__PURE__ */ G("span", {
|
|
1001
1440
|
className: "min-w-0 flex-1 truncate text-start",
|
|
1002
1441
|
children: e
|
|
1003
|
-
}), /* @__PURE__ */
|
|
1004
|
-
className: a("shrink-0",
|
|
1442
|
+
}), /* @__PURE__ */ G("span", {
|
|
1443
|
+
className: a("shrink-0", bt.filterValue),
|
|
1005
1444
|
style: n,
|
|
1006
1445
|
children: t
|
|
1007
1446
|
})] }), o = [];
|
|
1008
1447
|
if (v) {
|
|
1009
|
-
let e =
|
|
1448
|
+
let e = Ct.map(({ value: e, getLabel: n }) => ({
|
|
1010
1449
|
key: e,
|
|
1011
1450
|
label: n(t),
|
|
1012
1451
|
mark: E.Check,
|
|
1013
1452
|
checked: e === p,
|
|
1014
1453
|
onClick: () => v(e)
|
|
1015
|
-
})), n =
|
|
1454
|
+
})), n = Ct.find(({ value: e }) => e === p);
|
|
1016
1455
|
o.push({
|
|
1017
1456
|
key: "filter-type",
|
|
1018
1457
|
label: t.type ?? "Type",
|
|
@@ -1021,7 +1460,7 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
1021
1460
|
});
|
|
1022
1461
|
}
|
|
1023
1462
|
if (f) {
|
|
1024
|
-
let e =
|
|
1463
|
+
let e = St.filter(({ value: e }) => !y?.includes(e)), n = e.find(({ value: e }) => e === d);
|
|
1025
1464
|
o.push({
|
|
1026
1465
|
key: "filter-origin",
|
|
1027
1466
|
label: t.origin ?? "Origin",
|
|
@@ -1044,7 +1483,7 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
1044
1483
|
f,
|
|
1045
1484
|
v,
|
|
1046
1485
|
D
|
|
1047
|
-
]),
|
|
1486
|
+
]), J = V(() => r({
|
|
1048
1487
|
"--cp-list-header-title": S?.colors?.title,
|
|
1049
1488
|
"--cp-list-header-title-focus": S?.colors?.titleFocus,
|
|
1050
1489
|
"--cp-list-header-filter-indicator": S?.colors?.filterIndicator
|
|
@@ -1052,98 +1491,98 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
1052
1491
|
S?.colors?.title,
|
|
1053
1492
|
S?.colors?.titleFocus,
|
|
1054
1493
|
S?.colors?.filterIndicator
|
|
1055
|
-
]),
|
|
1056
|
-
if (
|
|
1494
|
+
]), ie = (e) => a("flex min-h-6 items-center justify-between ps-2", e, C, ue.listHeader);
|
|
1495
|
+
if (I && c) return /* @__PURE__ */ K("div", {
|
|
1057
1496
|
role: "search",
|
|
1058
|
-
style:
|
|
1059
|
-
className:
|
|
1060
|
-
onKeyDown:
|
|
1061
|
-
children: [/* @__PURE__ */
|
|
1497
|
+
style: J,
|
|
1498
|
+
className: ie("gap-2"),
|
|
1499
|
+
onKeyDown: W,
|
|
1500
|
+
children: [/* @__PURE__ */ G(k, {
|
|
1062
1501
|
containerClassName: "min-w-0 flex-1",
|
|
1063
1502
|
wrapperClassName: a("h-6! min-h-0! py-1! pe-2! [&_svg]:size-4!", T),
|
|
1064
1503
|
inputRef: A,
|
|
1065
1504
|
value: s,
|
|
1066
|
-
onChange:
|
|
1505
|
+
onChange: U,
|
|
1067
1506
|
placeholder: e.searchPlaceholder,
|
|
1068
1507
|
clearLabel: e.searchClearLabel,
|
|
1069
1508
|
"aria-label": e.searchPlaceholder
|
|
1070
|
-
}), /* @__PURE__ */
|
|
1071
|
-
icon: /* @__PURE__ */
|
|
1509
|
+
}), /* @__PURE__ */ G(b, {
|
|
1510
|
+
icon: /* @__PURE__ */ G(le, {
|
|
1072
1511
|
size: m.SM,
|
|
1073
1512
|
stroke: h,
|
|
1074
1513
|
"aria-hidden": !0
|
|
1075
1514
|
}),
|
|
1076
1515
|
size: _.Small,
|
|
1077
|
-
className:
|
|
1516
|
+
className: xt,
|
|
1078
1517
|
"aria-label": e.searchCloseLabel,
|
|
1079
|
-
onClick:
|
|
1518
|
+
onClick: B
|
|
1080
1519
|
})]
|
|
1081
1520
|
});
|
|
1082
|
-
let
|
|
1521
|
+
let oe = /* @__PURE__ */ G("span", {
|
|
1083
1522
|
className: w,
|
|
1084
1523
|
children: e.title
|
|
1085
1524
|
});
|
|
1086
|
-
return /* @__PURE__ */
|
|
1087
|
-
style:
|
|
1088
|
-
className:
|
|
1089
|
-
children: [i ? /* @__PURE__ */
|
|
1525
|
+
return /* @__PURE__ */ K("div", {
|
|
1526
|
+
style: J,
|
|
1527
|
+
className: ie(),
|
|
1528
|
+
children: [i ? /* @__PURE__ */ K("button", {
|
|
1090
1529
|
type: "button",
|
|
1091
1530
|
"aria-expanded": t,
|
|
1092
1531
|
"aria-controls": o,
|
|
1093
1532
|
onClick: i,
|
|
1094
|
-
className: a("group flex items-center gap-1 rounded",
|
|
1095
|
-
children: [
|
|
1533
|
+
className: a("group flex items-center gap-1 rounded", bt.title),
|
|
1534
|
+
children: [oe, t ? /* @__PURE__ */ G(ne, {
|
|
1096
1535
|
size: m.SM,
|
|
1097
1536
|
stroke: h,
|
|
1098
1537
|
className: "opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100",
|
|
1099
1538
|
"aria-hidden": !0
|
|
1100
|
-
}) : /* @__PURE__ */
|
|
1539
|
+
}) : /* @__PURE__ */ G(re, {
|
|
1101
1540
|
size: m.SM,
|
|
1102
1541
|
stroke: h,
|
|
1103
1542
|
className: "opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100 rtl:scale-x-[-1]",
|
|
1104
1543
|
"aria-hidden": !0
|
|
1105
1544
|
})]
|
|
1106
|
-
}) : /* @__PURE__ */
|
|
1107
|
-
className:
|
|
1108
|
-
children:
|
|
1109
|
-
}), /* @__PURE__ */
|
|
1545
|
+
}) : /* @__PURE__ */ G("span", {
|
|
1546
|
+
className: bt.title,
|
|
1547
|
+
children: oe
|
|
1548
|
+
}), /* @__PURE__ */ K("div", {
|
|
1110
1549
|
className: "flex items-center gap-2",
|
|
1111
1550
|
children: [
|
|
1112
|
-
|
|
1551
|
+
I && /* @__PURE__ */ G(b, {
|
|
1113
1552
|
ref: O,
|
|
1114
|
-
icon: /* @__PURE__ */
|
|
1553
|
+
icon: /* @__PURE__ */ G(se, {
|
|
1115
1554
|
size: m.SM,
|
|
1116
1555
|
stroke: h,
|
|
1117
1556
|
"aria-hidden": !0
|
|
1118
1557
|
}),
|
|
1119
1558
|
size: _.Small,
|
|
1120
|
-
className:
|
|
1559
|
+
className: xt,
|
|
1121
1560
|
"aria-label": e.searchOpenLabel,
|
|
1122
|
-
onClick:
|
|
1561
|
+
onClick: ee
|
|
1123
1562
|
}),
|
|
1124
|
-
(f || v) && /* @__PURE__ */
|
|
1125
|
-
items:
|
|
1563
|
+
(f || v) && /* @__PURE__ */ G(g, {
|
|
1564
|
+
items: q,
|
|
1126
1565
|
placement: "bottom-end",
|
|
1127
1566
|
matchReferenceWidth: !1,
|
|
1128
|
-
children: /* @__PURE__ */
|
|
1129
|
-
icon: /* @__PURE__ */
|
|
1567
|
+
children: /* @__PURE__ */ G(b, {
|
|
1568
|
+
icon: /* @__PURE__ */ K("span", {
|
|
1130
1569
|
className: "relative inline-flex",
|
|
1131
|
-
children: [/* @__PURE__ */
|
|
1570
|
+
children: [/* @__PURE__ */ G(ae, {
|
|
1132
1571
|
size: m.SM,
|
|
1133
1572
|
stroke: h,
|
|
1134
1573
|
"aria-hidden": !0
|
|
1135
|
-
}), F && /* @__PURE__ */
|
|
1574
|
+
}), F && /* @__PURE__ */ G("span", {
|
|
1136
1575
|
"aria-hidden": !0,
|
|
1137
|
-
className: a(
|
|
1576
|
+
className: a(bt.filterIndicator, "absolute -inset-e-0.5 -top-0.5 size-1.5 rounded-full")
|
|
1138
1577
|
})]
|
|
1139
1578
|
}),
|
|
1140
1579
|
size: _.Small,
|
|
1141
|
-
className:
|
|
1580
|
+
className: xt,
|
|
1142
1581
|
"aria-label": M,
|
|
1143
1582
|
"aria-describedby": F ? P : void 0
|
|
1144
1583
|
})
|
|
1145
1584
|
}),
|
|
1146
|
-
F && (f || v) && /* @__PURE__ */
|
|
1585
|
+
F && (f || v) && /* @__PURE__ */ G("span", {
|
|
1147
1586
|
id: P,
|
|
1148
1587
|
className: "sr-only",
|
|
1149
1588
|
children: N
|
|
@@ -1152,26 +1591,26 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
1152
1591
|
]
|
|
1153
1592
|
})]
|
|
1154
1593
|
});
|
|
1155
|
-
}),
|
|
1156
|
-
let C =
|
|
1157
|
-
|
|
1594
|
+
}), Tt = I(({ conversations: e, isLoading: t, isUpdatingTitles: r, preserveActiveSearchResult: i, onSelectConversation: o, activeConversationId: s, labels: c, requestedFilter: l, isFilterHidden: u = !1, onFilterChange: d, isTypeFilterHidden: f = !1, onTypeFilterChange: p, hiddenSources: m, headerActions: h, getActions: g, onActionMenuOpen: _, onMoveConversation: v, onVisibleConversationIdsChange: y, styles: b, listClassName: x, className: S }) => {
|
|
1595
|
+
let C = z(), [w, T] = U(""), [E, D] = U(!1), [O, k] = U(!0), [A, j] = U(n.All), [M, N] = U(Q.All);
|
|
1596
|
+
R(() => {
|
|
1158
1597
|
l != null && j(l);
|
|
1159
1598
|
}, [l]);
|
|
1160
|
-
let P =
|
|
1599
|
+
let P = L((e) => {
|
|
1161
1600
|
j(e), d?.(e);
|
|
1162
|
-
}, [d]), F =
|
|
1601
|
+
}, [d]), F = L((e) => {
|
|
1163
1602
|
T(e), e !== "" && k(!0);
|
|
1164
|
-
}, []),
|
|
1603
|
+
}, []), I = L((e) => {
|
|
1165
1604
|
D(e), e && k(!0);
|
|
1166
|
-
}, []),
|
|
1605
|
+
}, []), ee = L((e) => {
|
|
1167
1606
|
N(e), p?.(e);
|
|
1168
|
-
}, [p]), B =
|
|
1169
|
-
return /* @__PURE__ */
|
|
1607
|
+
}, [p]), B = L(() => k((e) => !e), []);
|
|
1608
|
+
return /* @__PURE__ */ K("section", {
|
|
1170
1609
|
"aria-label": c.title,
|
|
1171
|
-
className: a("flex min-h-0 flex-1 flex-col px-1 pt-4", S,
|
|
1172
|
-
children: [/* @__PURE__ */
|
|
1610
|
+
className: a("flex min-h-0 flex-1 flex-col px-1 pt-4", S, ue.listSection),
|
|
1611
|
+
children: [/* @__PURE__ */ G("div", {
|
|
1173
1612
|
className: "px-3 pb-2",
|
|
1174
|
-
children: /* @__PURE__ */
|
|
1613
|
+
children: /* @__PURE__ */ G(wt, {
|
|
1175
1614
|
labels: c,
|
|
1176
1615
|
isExpanded: O,
|
|
1177
1616
|
onToggleExpanded: B,
|
|
@@ -1179,20 +1618,20 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
1179
1618
|
searchQuery: w,
|
|
1180
1619
|
isSearchOpen: E,
|
|
1181
1620
|
onSearchChange: F,
|
|
1182
|
-
onSearchOpenChange:
|
|
1621
|
+
onSearchOpenChange: I,
|
|
1183
1622
|
activeFilter: A,
|
|
1184
1623
|
onFilterChange: u ? void 0 : P,
|
|
1185
1624
|
activeTypeFilter: M,
|
|
1186
|
-
onTypeFilterChange: u || f ? void 0 :
|
|
1625
|
+
onTypeFilterChange: u || f ? void 0 : ee,
|
|
1187
1626
|
hiddenSources: m,
|
|
1188
1627
|
actions: h,
|
|
1189
1628
|
styles: b?.header
|
|
1190
1629
|
})
|
|
1191
|
-
}), /* @__PURE__ */
|
|
1630
|
+
}), /* @__PURE__ */ G("div", {
|
|
1192
1631
|
hidden: !O,
|
|
1193
1632
|
inert: !O,
|
|
1194
1633
|
className: O ? "flex min-h-0 flex-1 flex-col" : "hidden",
|
|
1195
|
-
children: /* @__PURE__ */
|
|
1634
|
+
children: /* @__PURE__ */ G(yt, {
|
|
1196
1635
|
id: C,
|
|
1197
1636
|
conversations: e,
|
|
1198
1637
|
isLoading: t,
|
|
@@ -1205,7 +1644,7 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
1205
1644
|
activeFilter: A,
|
|
1206
1645
|
activeTypeFilter: M,
|
|
1207
1646
|
hiddenSources: m,
|
|
1208
|
-
rowVariant:
|
|
1647
|
+
rowVariant: Qe.Indicator,
|
|
1209
1648
|
getActions: g,
|
|
1210
1649
|
onActionMenuOpen: _,
|
|
1211
1650
|
onMoveConversation: v,
|
|
@@ -1215,7 +1654,7 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
1215
1654
|
})
|
|
1216
1655
|
})]
|
|
1217
1656
|
});
|
|
1218
|
-
}),
|
|
1657
|
+
}), Et = [
|
|
1219
1658
|
{
|
|
1220
1659
|
value: n.All,
|
|
1221
1660
|
labelKey: "all"
|
|
@@ -1232,12 +1671,12 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
1232
1671
|
value: n.Organization,
|
|
1233
1672
|
labelKey: "organization"
|
|
1234
1673
|
}
|
|
1235
|
-
],
|
|
1236
|
-
let a =
|
|
1674
|
+
], Dt = I(({ activeTab: e, labels: t, onChange: n, tabClassName: r = "dial-tiny-semi-text", hiddenSources: i }) => {
|
|
1675
|
+
let a = V(() => Et.filter(({ value: e }) => !i?.includes(e)).map(({ value: e, labelKey: n }) => ({
|
|
1237
1676
|
value: e,
|
|
1238
1677
|
label: t[n]
|
|
1239
1678
|
})), [t, i]);
|
|
1240
|
-
return /* @__PURE__ */
|
|
1679
|
+
return /* @__PURE__ */ G(y, {
|
|
1241
1680
|
items: a,
|
|
1242
1681
|
value: e,
|
|
1243
1682
|
onChange: n,
|
|
@@ -1246,65 +1685,65 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
1246
1685
|
className: "px-3 py-2",
|
|
1247
1686
|
chipClassName: N("px-2!", r)
|
|
1248
1687
|
});
|
|
1249
|
-
}),
|
|
1688
|
+
}), Ot = { button: "_button_vjird_1" }, kt = I(({ label: e, onClick: t, labelClassName: n = "dial-small-semi-text", colors: i, className: o }) => {
|
|
1250
1689
|
let s = r({
|
|
1251
1690
|
"--cp-new-chat-bg": i?.background,
|
|
1252
1691
|
"--cp-new-chat-text": i?.text,
|
|
1253
1692
|
"--cp-new-chat-focus-outline": i?.focusOutline
|
|
1254
1693
|
});
|
|
1255
|
-
return /* @__PURE__ */
|
|
1694
|
+
return /* @__PURE__ */ G("div", {
|
|
1256
1695
|
className: "px-3 py-2",
|
|
1257
1696
|
style: s,
|
|
1258
|
-
children: /* @__PURE__ */
|
|
1697
|
+
children: /* @__PURE__ */ G(f, {
|
|
1259
1698
|
label: e,
|
|
1260
1699
|
textClassName: n,
|
|
1261
|
-
iconBefore: /* @__PURE__ */
|
|
1700
|
+
iconBefore: /* @__PURE__ */ G(oe, {
|
|
1262
1701
|
size: 18,
|
|
1263
1702
|
stroke: h,
|
|
1264
1703
|
className: "shrink-0",
|
|
1265
1704
|
"aria-hidden": !0
|
|
1266
1705
|
}),
|
|
1267
1706
|
onClick: t,
|
|
1268
|
-
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",
|
|
1707
|
+
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", Ot.button, o, ue.newChatButton)
|
|
1269
1708
|
})
|
|
1270
1709
|
});
|
|
1271
|
-
}),
|
|
1272
|
-
let { colors: D, typography: O, newChatButton: A, searchWrapperClassName: j, headerClassName: M, headerActionsClassName: N, newChatButtonClassName: P } = m ?? {}, { title: F, emptyLabel:
|
|
1273
|
-
|
|
1274
|
-
C != null &&
|
|
1710
|
+
}), At = I(({ conversations: e, isLoading: t, isUpdatingTitles: i, preserveActiveSearchResult: o, isOpen: s, onSelectConversation: c, activeConversationId: l, labels: f, onNewChat: p, styles: m, className: h, isOverlay: g = !1, getActions: _, onActionMenuOpen: v, onToggle: y, headerActions: b, onMoveConversation: x, onVisibleConversationIdsChange: S, activeFilter: C, onActiveFilterChange: w, isFilterTabsHidden: T = !1, hiddenSources: E }) => {
|
|
1711
|
+
let { colors: D, typography: O, newChatButton: A, searchWrapperClassName: j, headerClassName: M, headerActionsClassName: N, newChatButtonClassName: P } = m ?? {}, { title: F, emptyLabel: I, emptyDescription: z, noResultsLabel: ee, noResultsDescription: B, sharedEmptyDescription: H, tabEmptyLabels: W, loadingLabel: te, updatingTitlesLabel: q, newChatLabel: J, searchPlaceholder: ne, searchClearLabel: re, filterLabels: ie, groupLabels: ae, actionsLabel: oe, unreadIndicatorLabel: se, closeAriaLabel: ce } = f, [le, Y] = U(""), [de, fe] = U(n.All);
|
|
1712
|
+
R(() => {
|
|
1713
|
+
C != null && fe(C);
|
|
1275
1714
|
}, [C]);
|
|
1276
|
-
let
|
|
1277
|
-
|
|
1278
|
-
}, []),
|
|
1715
|
+
let pe = L((e) => {
|
|
1716
|
+
Y(e ?? "");
|
|
1717
|
+
}, []), X = r({
|
|
1279
1718
|
"--cp-text": D?.text,
|
|
1280
1719
|
"--cp-new-chat-bg": A?.background,
|
|
1281
1720
|
"--cp-new-chat-text": A?.text,
|
|
1282
1721
|
"--cp-new-chat-focus-outline": A?.focusOutline
|
|
1283
|
-
}),
|
|
1284
|
-
emptyLabel:
|
|
1285
|
-
emptyDescription:
|
|
1286
|
-
noResultsLabel:
|
|
1287
|
-
noResultsDescription:
|
|
1288
|
-
sharedEmptyDescription:
|
|
1289
|
-
tabEmptyLabels:
|
|
1290
|
-
loadingLabel:
|
|
1291
|
-
updatingTitlesLabel:
|
|
1292
|
-
groupLabels:
|
|
1293
|
-
actionsLabel:
|
|
1294
|
-
unreadIndicatorLabel:
|
|
1722
|
+
}), me = V(() => ({
|
|
1723
|
+
emptyLabel: I,
|
|
1724
|
+
emptyDescription: z,
|
|
1725
|
+
noResultsLabel: ee,
|
|
1726
|
+
noResultsDescription: B,
|
|
1727
|
+
sharedEmptyDescription: H,
|
|
1728
|
+
tabEmptyLabels: W,
|
|
1729
|
+
loadingLabel: te,
|
|
1730
|
+
updatingTitlesLabel: q,
|
|
1731
|
+
groupLabels: ae,
|
|
1732
|
+
actionsLabel: oe,
|
|
1733
|
+
unreadIndicatorLabel: se
|
|
1295
1734
|
}), [
|
|
1296
|
-
|
|
1297
|
-
R,
|
|
1735
|
+
I,
|
|
1298
1736
|
z,
|
|
1299
|
-
|
|
1737
|
+
ee,
|
|
1738
|
+
B,
|
|
1739
|
+
H,
|
|
1740
|
+
W,
|
|
1300
1741
|
te,
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
K,
|
|
1742
|
+
q,
|
|
1743
|
+
ae,
|
|
1304
1744
|
oe,
|
|
1305
|
-
se
|
|
1306
|
-
|
|
1307
|
-
]), ge = B(() => ({
|
|
1745
|
+
se
|
|
1746
|
+
]), he = V(() => ({
|
|
1308
1747
|
colors: D,
|
|
1309
1748
|
typography: {
|
|
1310
1749
|
fontFamily: O?.fontFamily,
|
|
@@ -1321,14 +1760,14 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
1321
1760
|
O?.unreadItemTitleClassName,
|
|
1322
1761
|
m?.itemIconBadgeClassName
|
|
1323
1762
|
]);
|
|
1324
|
-
return /* @__PURE__ */
|
|
1763
|
+
return /* @__PURE__ */ K(d, {
|
|
1325
1764
|
isOpen: s,
|
|
1326
1765
|
isOverlay: g,
|
|
1327
1766
|
orientation: u.Left,
|
|
1328
1767
|
title: F,
|
|
1329
1768
|
labels: {
|
|
1330
1769
|
ariaLabel: F,
|
|
1331
|
-
closeLabel:
|
|
1770
|
+
closeLabel: ce
|
|
1332
1771
|
},
|
|
1333
1772
|
onClose: y,
|
|
1334
1773
|
styles: {
|
|
@@ -1338,7 +1777,7 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
1338
1777
|
},
|
|
1339
1778
|
typography: { fontClassName: O?.fontClassName },
|
|
1340
1779
|
bodyClassName: "flex flex-col overflow-hidden p-0 gap-3",
|
|
1341
|
-
cssVars:
|
|
1780
|
+
cssVars: X,
|
|
1342
1781
|
titleClassName: O?.fontClassName,
|
|
1343
1782
|
headerClassName: a("h-[64px]", M),
|
|
1344
1783
|
headerActionsClassName: N,
|
|
@@ -1346,56 +1785,56 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
1346
1785
|
},
|
|
1347
1786
|
rightActions: b,
|
|
1348
1787
|
children: [
|
|
1349
|
-
/* @__PURE__ */
|
|
1350
|
-
label:
|
|
1788
|
+
/* @__PURE__ */ G(kt, {
|
|
1789
|
+
label: J,
|
|
1351
1790
|
onClick: p,
|
|
1352
1791
|
labelClassName: O?.newChatLabelClassName,
|
|
1353
1792
|
colors: A,
|
|
1354
1793
|
className: P
|
|
1355
1794
|
}),
|
|
1356
|
-
/* @__PURE__ */
|
|
1795
|
+
/* @__PURE__ */ G("div", {
|
|
1357
1796
|
role: "search",
|
|
1358
|
-
className: a("px-3 py-2",
|
|
1359
|
-
children: /* @__PURE__ */
|
|
1360
|
-
wrapperClassName: a(
|
|
1361
|
-
value:
|
|
1362
|
-
onChange:
|
|
1363
|
-
placeholder:
|
|
1364
|
-
clearLabel:
|
|
1365
|
-
"aria-label":
|
|
1797
|
+
className: a("px-3 py-2", ue.search),
|
|
1798
|
+
children: /* @__PURE__ */ G(k, {
|
|
1799
|
+
wrapperClassName: a($.search, j),
|
|
1800
|
+
value: le,
|
|
1801
|
+
onChange: pe,
|
|
1802
|
+
placeholder: ne,
|
|
1803
|
+
clearLabel: re,
|
|
1804
|
+
"aria-label": ne
|
|
1366
1805
|
})
|
|
1367
1806
|
}),
|
|
1368
|
-
!T && /* @__PURE__ */
|
|
1369
|
-
activeTab:
|
|
1370
|
-
labels:
|
|
1807
|
+
!T && /* @__PURE__ */ G(Dt, {
|
|
1808
|
+
activeTab: de,
|
|
1809
|
+
labels: ie,
|
|
1371
1810
|
onChange: (e) => {
|
|
1372
|
-
|
|
1811
|
+
fe(e), w?.(e);
|
|
1373
1812
|
},
|
|
1374
1813
|
tabClassName: O?.tabClassName,
|
|
1375
1814
|
hiddenSources: E
|
|
1376
1815
|
}),
|
|
1377
|
-
/* @__PURE__ */
|
|
1816
|
+
/* @__PURE__ */ G(yt, {
|
|
1378
1817
|
conversations: e,
|
|
1379
1818
|
isLoading: t,
|
|
1380
1819
|
isUpdatingTitles: i,
|
|
1381
1820
|
preserveActiveSearchResult: o,
|
|
1382
1821
|
onSelectConversation: c,
|
|
1383
1822
|
activeConversationId: l,
|
|
1384
|
-
labels:
|
|
1385
|
-
searchQuery:
|
|
1386
|
-
activeFilter:
|
|
1823
|
+
labels: me,
|
|
1824
|
+
searchQuery: le,
|
|
1825
|
+
activeFilter: de,
|
|
1387
1826
|
hiddenSources: E,
|
|
1388
1827
|
getActions: _,
|
|
1389
1828
|
onActionMenuOpen: v,
|
|
1390
1829
|
onMoveConversation: x,
|
|
1391
1830
|
onVisibleConversationIdsChange: S,
|
|
1392
|
-
styles:
|
|
1831
|
+
styles: he
|
|
1393
1832
|
})
|
|
1394
1833
|
]
|
|
1395
1834
|
});
|
|
1396
|
-
}),
|
|
1397
|
-
let [f, g] =
|
|
1398
|
-
|
|
1835
|
+
}), jt = I(({ isOpen: e, currentTitle: t, isSaving: n, error: r, onSave: a, onCancel: c, onGenerateWithAi: l, labels: u, styles: d }) => {
|
|
1836
|
+
let [f, g] = U(t), [_, v] = U(!1), [y, x] = U(null), E = H(null), k = H(!1), A = H(0);
|
|
1837
|
+
R(() => {
|
|
1399
1838
|
let n = e && !k.current;
|
|
1400
1839
|
if (k.current = e, !e) {
|
|
1401
1840
|
A.current += 1, v(!1);
|
|
@@ -1405,18 +1844,18 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
1405
1844
|
A.current += 1, g(t), x(null), v(!1);
|
|
1406
1845
|
let r = setTimeout(() => E.current?.focus(), 0);
|
|
1407
1846
|
return () => clearTimeout(r);
|
|
1408
|
-
}, [e, t]),
|
|
1847
|
+
}, [e, t]), R(() => () => {
|
|
1409
1848
|
A.current += 1;
|
|
1410
1849
|
}, []);
|
|
1411
|
-
let j = s(f.trim()), N = i(j) > 255, P = n || j === "" || j === t.trim() || N, F =
|
|
1850
|
+
let j = s(f.trim()), N = i(j) > 255, P = n || j === "" || j === t.trim() || N, F = L(() => {
|
|
1412
1851
|
P || a(j);
|
|
1413
1852
|
}, [
|
|
1414
1853
|
P,
|
|
1415
1854
|
a,
|
|
1416
1855
|
j
|
|
1417
|
-
]),
|
|
1856
|
+
]), I = L((e) => {
|
|
1418
1857
|
e.key === "Enter" && F();
|
|
1419
|
-
}, [F]),
|
|
1858
|
+
}, [F]), z = L(async () => {
|
|
1420
1859
|
if (_) return;
|
|
1421
1860
|
let e = ++A.current;
|
|
1422
1861
|
v(!0), x(null);
|
|
@@ -1434,8 +1873,8 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
1434
1873
|
_,
|
|
1435
1874
|
l,
|
|
1436
1875
|
u.renameWithAiError
|
|
1437
|
-
]),
|
|
1438
|
-
return B = N ? u.nameTooLongError :
|
|
1876
|
+
]), ee = y ?? r ?? void 0, B;
|
|
1877
|
+
return B = N ? u.nameTooLongError : ee, /* @__PURE__ */ G(D, {
|
|
1439
1878
|
open: e,
|
|
1440
1879
|
header: u.popupTitle,
|
|
1441
1880
|
size: O.Sm,
|
|
@@ -1449,40 +1888,40 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
1449
1888
|
disabled: P,
|
|
1450
1889
|
onClick: F
|
|
1451
1890
|
}],
|
|
1452
|
-
children: /* @__PURE__ */
|
|
1891
|
+
children: /* @__PURE__ */ K("div", {
|
|
1453
1892
|
className: d?.bodyClassName,
|
|
1454
1893
|
style: d?.cssVars,
|
|
1455
|
-
children: [/* @__PURE__ */
|
|
1894
|
+
children: [/* @__PURE__ */ G(C, {
|
|
1456
1895
|
politeness: T.Assertive,
|
|
1457
1896
|
visuallyHidden: !0,
|
|
1458
1897
|
as: w.Span,
|
|
1459
|
-
children: !n && !N &&
|
|
1460
|
-
}), n ? /* @__PURE__ */
|
|
1898
|
+
children: !n && !N && ee
|
|
1899
|
+
}), n ? /* @__PURE__ */ G("div", {
|
|
1461
1900
|
className: "h-[120px] px-6 py-4",
|
|
1462
|
-
children: /* @__PURE__ */
|
|
1463
|
-
}) : /* @__PURE__ */
|
|
1901
|
+
children: /* @__PURE__ */ G(M, { size: 50 })
|
|
1902
|
+
}) : /* @__PURE__ */ K("div", {
|
|
1464
1903
|
className: "flex items-start gap-2 px-6 py-3",
|
|
1465
|
-
children: [/* @__PURE__ */
|
|
1904
|
+
children: [/* @__PURE__ */ G("div", {
|
|
1466
1905
|
className: "min-w-0 flex-1",
|
|
1467
|
-
children: /* @__PURE__ */
|
|
1906
|
+
children: /* @__PURE__ */ G(S, {
|
|
1468
1907
|
inputRef: E,
|
|
1469
1908
|
value: f,
|
|
1470
1909
|
placeholder: u.inputPlaceholder,
|
|
1471
1910
|
error: B,
|
|
1472
1911
|
onChange: (e) => g(o(e ?? "")),
|
|
1473
|
-
onKeyDown:
|
|
1912
|
+
onKeyDown: I
|
|
1474
1913
|
})
|
|
1475
|
-
}), /* @__PURE__ */
|
|
1914
|
+
}), /* @__PURE__ */ G(b, {
|
|
1476
1915
|
"aria-label": u.renameWithAiLabel,
|
|
1477
1916
|
tooltipProps: { tooltip: u.renameWithAiLabel },
|
|
1478
1917
|
disabled: _ || n,
|
|
1479
1918
|
"aria-busy": _,
|
|
1480
|
-
onClick:
|
|
1481
|
-
icon: _ ? /* @__PURE__ */
|
|
1919
|
+
onClick: z,
|
|
1920
|
+
icon: _ ? /* @__PURE__ */ G("span", {
|
|
1482
1921
|
className: "flex",
|
|
1483
1922
|
"aria-hidden": !0,
|
|
1484
|
-
children: /* @__PURE__ */
|
|
1485
|
-
}) : /* @__PURE__ */
|
|
1923
|
+
children: /* @__PURE__ */ G(M, { size: m.MD })
|
|
1924
|
+
}) : /* @__PURE__ */ G(ce, {
|
|
1486
1925
|
size: m.MD,
|
|
1487
1926
|
stroke: h,
|
|
1488
1927
|
"aria-hidden": !0
|
|
@@ -1492,6 +1931,6 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
1492
1931
|
})
|
|
1493
1932
|
});
|
|
1494
1933
|
});
|
|
1495
|
-
|
|
1934
|
+
jt.displayName = "RenameConversationPopup";
|
|
1496
1935
|
//#endregion
|
|
1497
|
-
export {
|
|
1936
|
+
export { ue as CONVERSATION_PANEL_CLASS, yt as ConversationList, wt as ConversationListHeader, Tt as ConversationListSection, At as ConversationPanel, Qe as ConversationRowVariant, Q as ConversationTypeFilter, jt as RenameConversationPopup };
|