chordia-ui 4.0.6 → 4.0.7
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/dist/MessageThread.cjs.js +4 -6
- package/dist/MessageThread.cjs.js.map +1 -1
- package/dist/MessageThread.es.js +348 -475
- package/dist/MessageThread.es.js.map +1 -1
- package/dist/ThinkingIndicator.cjs.js +17 -0
- package/dist/ThinkingIndicator.cjs.js.map +1 -0
- package/dist/{ChatMessage.es.js → ThinkingIndicator.es.js} +415 -288
- package/dist/ThinkingIndicator.es.js.map +1 -0
- package/dist/Toast.cjs.js +2 -2
- package/dist/Toast.cjs.js.map +1 -1
- package/dist/Toast.es.js +103 -115
- package/dist/Toast.es.js.map +1 -1
- package/dist/components/chat.cjs.js +1 -1
- package/dist/components/chat.cjs.js.map +1 -1
- package/dist/components/chat.es.js +5 -5
- package/dist/components/common.cjs.js +1 -1
- package/dist/components/common.es.js +1 -1
- package/dist/components/policies.cjs.js +1 -1
- package/dist/components/policies.cjs.js.map +1 -1
- package/dist/components/policies.es.js +357 -283
- package/dist/components/policies.es.js.map +1 -1
- package/dist/components/reports.cjs.js +2 -2
- package/dist/components/reports.cjs.js.map +1 -1
- package/dist/components/reports.es.js +25 -20
- package/dist/components/reports.es.js.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +5 -5
- package/package.json +1 -1
- package/src/components/common/AskCompass.jsx +2 -15
- package/src/components/policies/PoliciesPage.jsx +15 -13
- package/src/components/policies/PolicyCard.jsx +35 -5
- package/src/components/policies/PolicyDetailsDrawer.jsx +101 -34
- package/src/components/reports/ReportsList.jsx +8 -2
- package/dist/ChatMessage.cjs.js +0 -15
- package/dist/ChatMessage.cjs.js.map +0 -1
- package/dist/ChatMessage.es.js.map +0 -1
package/dist/MessageThread.es.js
CHANGED
|
@@ -1,174 +1,48 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Send as
|
|
4
|
-
import { C as
|
|
5
|
-
const
|
|
6
|
-
function
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"div",
|
|
10
|
-
{
|
|
11
|
-
style: {
|
|
12
|
-
width: d,
|
|
13
|
-
height: d,
|
|
14
|
-
borderRadius: "9999px",
|
|
15
|
-
background: ye,
|
|
16
|
-
display: "flex",
|
|
17
|
-
alignItems: "center",
|
|
18
|
-
justifyContent: "center",
|
|
19
|
-
overflow: "hidden",
|
|
20
|
-
flexShrink: 0
|
|
21
|
-
},
|
|
22
|
-
children: /* @__PURE__ */ a(
|
|
23
|
-
"svg",
|
|
24
|
-
{
|
|
25
|
-
width: p,
|
|
26
|
-
height: p,
|
|
27
|
-
viewBox: "0 0 24 24",
|
|
28
|
-
fill: "none",
|
|
29
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
30
|
-
style: { display: "block" },
|
|
31
|
-
"aria-hidden": "true",
|
|
32
|
-
children: [
|
|
33
|
-
/* @__PURE__ */ e(
|
|
34
|
-
"path",
|
|
35
|
-
{
|
|
36
|
-
d: "M12 24C18.6274 24 24 18.6274 24 12C24 5.37258 18.6274 0 12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24Z",
|
|
37
|
-
fill: ye
|
|
38
|
-
}
|
|
39
|
-
),
|
|
40
|
-
/* @__PURE__ */ e(
|
|
41
|
-
"path",
|
|
42
|
-
{
|
|
43
|
-
d: "M12.0281 1.54883C15.1413 1.54883 17.9364 2.90958 19.8514 5.06845C21.4881 6.9137 22.4824 9.34236 22.4824 12.0032C22.4824 15.0939 21.1413 17.8711 19.0094 19.7849C17.1586 21.4463 14.7113 22.4575 12.0281 22.4575C9.34478 22.4575 6.74638 21.3828 4.8764 19.6286C2.84343 17.7216 1.57373 15.0107 1.57373 12.0032C1.57373 9.28897 2.60792 6.81646 4.30366 4.95829C6.21523 2.86349 8.9682 1.54883 12.0281 1.54883Z",
|
|
44
|
-
stroke: "#E8D4A3",
|
|
45
|
-
strokeWidth: "1.6",
|
|
46
|
-
strokeMiterlimit: "10"
|
|
47
|
-
}
|
|
48
|
-
),
|
|
49
|
-
/* @__PURE__ */ e(
|
|
50
|
-
"path",
|
|
51
|
-
{
|
|
52
|
-
d: "M12.0281 4.27832C14.237 4.27832 16.2239 5.21303 17.6307 6.69799C18.9409 8.08066 19.7525 9.94558 19.7525 12.0027C19.7525 14.2369 18.8032 16.2491 17.2862 17.6582C15.9086 18.9419 14.06 19.7271 12.0281 19.7271C9.99626 19.7271 8.46689 18.4265 7.08366 17.1225C5.58971 15.714 4.30371 14.2184 4.30371 12.0027C4.30371 10.0097 5.05856 8.19307 6.2979 6.82333C7.71148 5.26024 9.75514 4.27832 12.0281 4.27832Z",
|
|
53
|
-
stroke: "#9BDB9C",
|
|
54
|
-
strokeWidth: "1.2",
|
|
55
|
-
strokeMiterlimit: "10"
|
|
56
|
-
}
|
|
57
|
-
),
|
|
58
|
-
/* @__PURE__ */ e(
|
|
59
|
-
"path",
|
|
60
|
-
{
|
|
61
|
-
d: "M12.0282 7.00837C13.3327 7.00837 14.5209 7.50861 15.4101 8.32753C16.4016 9.24032 17.0226 10.5488 17.0226 12.0028C17.0226 13.3805 16.4651 14.6282 15.563 15.5315C14.6592 16.4369 13.4091 16.9973 12.0282 16.9973C10.6472 16.9973 10.1869 15.4702 9.29093 14.6164C8.33599 13.7065 7.03369 13.426 7.03369 12.0023C7.03369 10.7303 7.50919 9.56969 8.29158 8.68781C9.20662 7.65699 10.5415 7.00781 12.0282 7.00781V7.00837Z",
|
|
62
|
-
stroke: "#4DE294",
|
|
63
|
-
strokeWidth: "0.8",
|
|
64
|
-
strokeMiterlimit: "10"
|
|
65
|
-
}
|
|
66
|
-
)
|
|
67
|
-
]
|
|
68
|
-
}
|
|
69
|
-
)
|
|
70
|
-
}
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
function Ae({
|
|
74
|
-
phase: d = "thinking",
|
|
75
|
-
label: p,
|
|
76
|
-
// eslint-disable-next-line no-unused-vars
|
|
77
|
-
toolSteps: k = [],
|
|
78
|
-
// eslint-disable-next-line no-unused-vars
|
|
79
|
-
elapsedMs: S,
|
|
80
|
-
compact: c = !1
|
|
81
|
-
}) {
|
|
82
|
-
return /* @__PURE__ */ a(
|
|
83
|
-
"div",
|
|
84
|
-
{
|
|
85
|
-
style: {
|
|
86
|
-
display: "flex",
|
|
87
|
-
alignItems: "center",
|
|
88
|
-
gap: "8px",
|
|
89
|
-
animation: "cuiThinkingPulse 1.6s ease-in-out infinite"
|
|
90
|
-
},
|
|
91
|
-
children: [
|
|
92
|
-
/* @__PURE__ */ e("style", { children: `
|
|
93
|
-
@keyframes cuiThinkingPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
|
|
94
|
-
` }),
|
|
95
|
-
/* @__PURE__ */ e(Pe, { size: c ? 28 : 32 }),
|
|
96
|
-
/* @__PURE__ */ e(
|
|
97
|
-
"div",
|
|
98
|
-
{
|
|
99
|
-
style: {
|
|
100
|
-
display: "inline-flex",
|
|
101
|
-
alignItems: "center",
|
|
102
|
-
background: Le,
|
|
103
|
-
padding: c ? "8px 12px" : "12px 16px",
|
|
104
|
-
borderRadius: "20px",
|
|
105
|
-
maxWidth: "100%",
|
|
106
|
-
minWidth: 0
|
|
107
|
-
},
|
|
108
|
-
children: /* @__PURE__ */ e(
|
|
109
|
-
"p",
|
|
110
|
-
{
|
|
111
|
-
style: {
|
|
112
|
-
margin: 0,
|
|
113
|
-
fontSize: "14px",
|
|
114
|
-
fontWeight: 400,
|
|
115
|
-
lineHeight: "normal",
|
|
116
|
-
color: We,
|
|
117
|
-
fontFamily: "inherit",
|
|
118
|
-
// Grow / shrink (and wrap) with the message text.
|
|
119
|
-
overflowWrap: "anywhere",
|
|
120
|
-
wordBreak: "break-word"
|
|
121
|
-
},
|
|
122
|
-
children: p || (d === "responding" || d === "generating" ? "Compass is generating response..." : "Thinking...")
|
|
123
|
-
}
|
|
124
|
-
)
|
|
125
|
-
}
|
|
126
|
-
)
|
|
127
|
-
]
|
|
128
|
-
}
|
|
129
|
-
);
|
|
130
|
-
}
|
|
131
|
-
const He = { error: (...d) => console.warn("toast.error:", ...d) };
|
|
132
|
-
function qe({
|
|
133
|
-
initialMessages: d = [],
|
|
134
|
-
onSendMessage: p,
|
|
1
|
+
import { jsxs as l, jsx as e, Fragment as ie } from "react/jsx-runtime";
|
|
2
|
+
import { useState as d, useRef as te, useEffect as j, useMemo as xe } from "react";
|
|
3
|
+
import { Send as he, PanelLeftClose as we, Search as Ce, Pin as ue, MessageSquare as Te, Check as Me, X as ze, MoreVertical as Ie, ChevronLeft as Fe, ChevronRight as Ee, Clock as fe, Hash as be, AtSign as De, Paperclip as Re } from "lucide-react";
|
|
4
|
+
import { C as ye, T as Le } from "./ThinkingIndicator.es.js";
|
|
5
|
+
const Be = { error: (...h) => console.warn("toast.error:", ...h) };
|
|
6
|
+
function Ye({
|
|
7
|
+
initialMessages: h = [],
|
|
8
|
+
onSendMessage: b,
|
|
135
9
|
onStreamMessage: k,
|
|
136
10
|
// NEW: streaming version of onSendMessage
|
|
137
11
|
onMessagesChange: S,
|
|
138
12
|
// NEW: callback when messages array changes
|
|
139
13
|
onCodeBlockClick: c,
|
|
140
14
|
// callback when "Canvas" button clicked on a code block: ({ code, language }) => void
|
|
141
|
-
placeholder:
|
|
142
|
-
title:
|
|
15
|
+
placeholder: B = "Ask a question about this interaction...",
|
|
16
|
+
title: O = "Chat with Chordia"
|
|
143
17
|
}) {
|
|
144
|
-
const [
|
|
145
|
-
|
|
146
|
-
var
|
|
147
|
-
(
|
|
148
|
-
}, [
|
|
149
|
-
|
|
150
|
-
|
|
18
|
+
const [T, P] = d(h || []), [f, ne] = d(""), [U, I] = d(!1), [m, p] = d(!1), [y, A] = d(null), [F, V] = d("thinking"), [_, n] = d(null), [v, E] = d(0), x = te(null), D = te(null), N = te(null), G = te(null), H = te(null), [$, Y] = d(!1), [re, q] = d(0);
|
|
19
|
+
j(() => {
|
|
20
|
+
var a;
|
|
21
|
+
(a = x.current) == null || a.scrollIntoView({ behavior: "smooth" });
|
|
22
|
+
}, [T, U]), j(() => {
|
|
23
|
+
D.current && (D.current.style.height = "auto", D.current.style.height = `${Math.min(
|
|
24
|
+
D.current.scrollHeight,
|
|
151
25
|
120
|
|
152
26
|
)}px`);
|
|
153
|
-
}, [
|
|
27
|
+
}, [f]), j(() => {
|
|
154
28
|
if (S) {
|
|
155
|
-
const
|
|
156
|
-
y &&
|
|
29
|
+
const a = [...T];
|
|
30
|
+
y && a.push(y), S(a);
|
|
157
31
|
}
|
|
158
|
-
}, [
|
|
159
|
-
let
|
|
160
|
-
return
|
|
161
|
-
if (
|
|
162
|
-
const s = (Date.now() -
|
|
32
|
+
}, [T, y, S]), j(() => {
|
|
33
|
+
let a;
|
|
34
|
+
return U && _ && (a = setInterval(() => {
|
|
35
|
+
if (E(Date.now() - _), H.current) {
|
|
36
|
+
const s = (Date.now() - H.current) / 1e3;
|
|
163
37
|
s >= 3 ? (Y(!0), q(Math.floor(s))) : Y(!1);
|
|
164
38
|
}
|
|
165
|
-
}, 500)), () =>
|
|
166
|
-
}, [
|
|
167
|
-
const
|
|
168
|
-
|
|
169
|
-
}, ae = (
|
|
170
|
-
if (
|
|
171
|
-
const s =
|
|
39
|
+
}, 500)), () => a && clearInterval(a);
|
|
40
|
+
}, [U, _]);
|
|
41
|
+
const Z = () => {
|
|
42
|
+
I(!1), p(!1), A(null), G.current = null, V("thinking"), Y(!1), q(0), H.current = null, n(null), E(0), N.current && (N.current.abort(), N.current = null);
|
|
43
|
+
}, ae = (a) => {
|
|
44
|
+
if (a.startsWith("data: ")) {
|
|
45
|
+
const s = a.slice(6);
|
|
172
46
|
if (s === "[DONE]")
|
|
173
47
|
return { type: "done" };
|
|
174
48
|
try {
|
|
@@ -178,18 +52,18 @@ function qe({
|
|
|
178
52
|
}
|
|
179
53
|
}
|
|
180
54
|
return null;
|
|
181
|
-
}, de = (
|
|
182
|
-
var
|
|
183
|
-
if (!((
|
|
55
|
+
}, de = (a) => {
|
|
56
|
+
var M, u;
|
|
57
|
+
if (!((u = (M = a.choices) == null ? void 0 : M[0]) != null && u.delta))
|
|
184
58
|
return;
|
|
185
|
-
|
|
186
|
-
const s =
|
|
59
|
+
H.current = Date.now(), Y(!1);
|
|
60
|
+
const s = a.choices[0].delta;
|
|
187
61
|
if (s.tool_calls || s.tool_results) {
|
|
188
62
|
V("tool");
|
|
189
63
|
return;
|
|
190
64
|
}
|
|
191
|
-
s.content !== void 0 && (V("responding"),
|
|
192
|
-
const
|
|
65
|
+
s.content !== void 0 && (V("responding"), A((w) => {
|
|
66
|
+
const K = w || {
|
|
193
67
|
id: Date.now().toString(),
|
|
194
68
|
role: "assistant",
|
|
195
69
|
content: "",
|
|
@@ -198,31 +72,31 @@ function qe({
|
|
|
198
72
|
minute: "2-digit"
|
|
199
73
|
}),
|
|
200
74
|
isStreaming: !0
|
|
201
|
-
},
|
|
202
|
-
...
|
|
203
|
-
content: (
|
|
75
|
+
}, J = {
|
|
76
|
+
...K,
|
|
77
|
+
content: (K.content || "") + (s.content || "")
|
|
204
78
|
};
|
|
205
|
-
return
|
|
79
|
+
return G.current = J, J;
|
|
206
80
|
}));
|
|
207
|
-
}, ee = async (
|
|
208
|
-
const s =
|
|
209
|
-
let
|
|
81
|
+
}, ee = async (a) => {
|
|
82
|
+
const s = a.getReader(), M = new TextDecoder();
|
|
83
|
+
let u = "";
|
|
210
84
|
try {
|
|
211
85
|
for (; ; ) {
|
|
212
|
-
const { done: w, value:
|
|
86
|
+
const { done: w, value: K } = await s.read();
|
|
213
87
|
if (w)
|
|
214
88
|
break;
|
|
215
|
-
|
|
216
|
-
const
|
|
89
|
+
u += M.decode(K, { stream: !0 });
|
|
90
|
+
const J = u.split(`
|
|
217
91
|
`);
|
|
218
|
-
|
|
219
|
-
for (const ce of
|
|
92
|
+
u = J.pop() || "";
|
|
93
|
+
for (const ce of J)
|
|
220
94
|
if (ce.trim()) {
|
|
221
|
-
const
|
|
222
|
-
if (
|
|
223
|
-
if (
|
|
95
|
+
const oe = ae(ce);
|
|
96
|
+
if (oe) {
|
|
97
|
+
if (oe.type === "done")
|
|
224
98
|
return;
|
|
225
|
-
|
|
99
|
+
oe.type === "data" && de(oe.data);
|
|
226
100
|
}
|
|
227
101
|
}
|
|
228
102
|
}
|
|
@@ -230,24 +104,24 @@ function qe({
|
|
|
230
104
|
s.releaseLock();
|
|
231
105
|
}
|
|
232
106
|
}, le = async () => {
|
|
233
|
-
if (!
|
|
107
|
+
if (!f.trim() || m)
|
|
234
108
|
return;
|
|
235
|
-
const
|
|
109
|
+
const a = f.trim(), s = {
|
|
236
110
|
id: Date.now().toString(),
|
|
237
111
|
role: "user",
|
|
238
|
-
content:
|
|
112
|
+
content: a,
|
|
239
113
|
timestamp: (/* @__PURE__ */ new Date()).toLocaleTimeString(void 0, {
|
|
240
114
|
hour: "2-digit",
|
|
241
115
|
minute: "2-digit"
|
|
242
116
|
})
|
|
243
|
-
},
|
|
244
|
-
|
|
117
|
+
}, M = [...T, s];
|
|
118
|
+
P(M), ne(""), I(!0), p(!0), V("thinking"), n(Date.now()), H.current = Date.now(), N.current = new AbortController();
|
|
245
119
|
try {
|
|
246
|
-
let
|
|
120
|
+
let u;
|
|
247
121
|
if (k)
|
|
248
|
-
|
|
249
|
-
else if (
|
|
250
|
-
|
|
122
|
+
u = await k(a, M);
|
|
123
|
+
else if (b)
|
|
124
|
+
u = await b(a, M);
|
|
251
125
|
else {
|
|
252
126
|
setTimeout(() => {
|
|
253
127
|
const w = {
|
|
@@ -259,31 +133,31 @@ function qe({
|
|
|
259
133
|
minute: "2-digit"
|
|
260
134
|
})
|
|
261
135
|
};
|
|
262
|
-
|
|
136
|
+
P((K) => [...K, w]), Z();
|
|
263
137
|
}, 1e3);
|
|
264
138
|
return;
|
|
265
139
|
}
|
|
266
|
-
if (
|
|
267
|
-
await ee(
|
|
268
|
-
else if (
|
|
269
|
-
await ee(
|
|
270
|
-
else if (
|
|
271
|
-
const w = await
|
|
140
|
+
if (u instanceof ReadableStream)
|
|
141
|
+
await ee(u);
|
|
142
|
+
else if (u instanceof Response && u.body)
|
|
143
|
+
await ee(u.body);
|
|
144
|
+
else if (u && typeof u.then == "function") {
|
|
145
|
+
const w = await u;
|
|
272
146
|
w instanceof ReadableStream ? await ee(w) : w instanceof Response && w.body && await ee(w.body);
|
|
273
147
|
}
|
|
274
|
-
|
|
275
|
-
...
|
|
148
|
+
G.current && P((w) => [...w, {
|
|
149
|
+
...G.current,
|
|
276
150
|
isStreaming: !1
|
|
277
151
|
}]);
|
|
278
|
-
} catch (
|
|
279
|
-
|
|
152
|
+
} catch (u) {
|
|
153
|
+
u.name !== "AbortError" && (Be.error("Failed to send message"), console.error("Stream error:", u));
|
|
280
154
|
} finally {
|
|
281
|
-
|
|
155
|
+
Z();
|
|
282
156
|
}
|
|
283
|
-
},
|
|
284
|
-
|
|
157
|
+
}, R = (a) => {
|
|
158
|
+
a.key === "Enter" && !a.shiftKey && (a.preventDefault(), le());
|
|
285
159
|
};
|
|
286
|
-
return /* @__PURE__ */
|
|
160
|
+
return /* @__PURE__ */ l(
|
|
287
161
|
"div",
|
|
288
162
|
{
|
|
289
163
|
style: {
|
|
@@ -296,7 +170,7 @@ function qe({
|
|
|
296
170
|
overflow: "hidden"
|
|
297
171
|
},
|
|
298
172
|
children: [
|
|
299
|
-
|
|
173
|
+
O ? /* @__PURE__ */ l(
|
|
300
174
|
"div",
|
|
301
175
|
{
|
|
302
176
|
style: {
|
|
@@ -314,7 +188,7 @@ function qe({
|
|
|
314
188
|
letterSpacing: "-0.01em",
|
|
315
189
|
color: "var(--text-strong, rgba(30,33,37,0.92))"
|
|
316
190
|
},
|
|
317
|
-
children:
|
|
191
|
+
children: O
|
|
318
192
|
}
|
|
319
193
|
),
|
|
320
194
|
/* @__PURE__ */ e(
|
|
@@ -342,7 +216,7 @@ function qe({
|
|
|
342
216
|
display: "flex",
|
|
343
217
|
flexDirection: "column"
|
|
344
218
|
},
|
|
345
|
-
children:
|
|
219
|
+
children: T.length === 0 ? /* @__PURE__ */ e(
|
|
346
220
|
"div",
|
|
347
221
|
{
|
|
348
222
|
style: {
|
|
@@ -357,22 +231,22 @@ function qe({
|
|
|
357
231
|
},
|
|
358
232
|
children: "No messages yet. Start a conversation by asking a question below."
|
|
359
233
|
}
|
|
360
|
-
) : /* @__PURE__ */
|
|
361
|
-
|
|
362
|
-
|
|
234
|
+
) : /* @__PURE__ */ l(ie, { children: [
|
|
235
|
+
T.map((a) => /* @__PURE__ */ e(
|
|
236
|
+
ye,
|
|
363
237
|
{
|
|
364
|
-
role:
|
|
365
|
-
content:
|
|
366
|
-
html:
|
|
367
|
-
timestamp:
|
|
368
|
-
toolBadges:
|
|
369
|
-
isStreaming:
|
|
238
|
+
role: a.role,
|
|
239
|
+
content: a.content,
|
|
240
|
+
html: a.html,
|
|
241
|
+
timestamp: a.timestamp,
|
|
242
|
+
toolBadges: a.toolBadges,
|
|
243
|
+
isStreaming: a.isStreaming,
|
|
370
244
|
onCodeBlockClick: c
|
|
371
245
|
},
|
|
372
|
-
|
|
246
|
+
a.id
|
|
373
247
|
)),
|
|
374
248
|
y && /* @__PURE__ */ e(
|
|
375
|
-
|
|
249
|
+
ye,
|
|
376
250
|
{
|
|
377
251
|
role: y.role,
|
|
378
252
|
content: y.content,
|
|
@@ -382,19 +256,19 @@ function qe({
|
|
|
382
256
|
},
|
|
383
257
|
y.id
|
|
384
258
|
),
|
|
385
|
-
|
|
386
|
-
|
|
259
|
+
U && (!y || $) && /* @__PURE__ */ e("div", { style: { marginBottom: "16px" }, children: /* @__PURE__ */ e(
|
|
260
|
+
Le,
|
|
387
261
|
{
|
|
388
262
|
phase: $ ? "tool" : F,
|
|
389
263
|
elapsedMs: v,
|
|
390
264
|
label: $ && re >= 30 ? "Compacting conversation — trimming context to stay sharp..." : $ && re >= 10 ? "Running background tasks..." : $ ? "Still working..." : void 0
|
|
391
265
|
}
|
|
392
266
|
) }),
|
|
393
|
-
/* @__PURE__ */ e("div", { ref:
|
|
267
|
+
/* @__PURE__ */ e("div", { ref: x })
|
|
394
268
|
] })
|
|
395
269
|
}
|
|
396
270
|
),
|
|
397
|
-
/* @__PURE__ */
|
|
271
|
+
/* @__PURE__ */ l(
|
|
398
272
|
"div",
|
|
399
273
|
{
|
|
400
274
|
style: {
|
|
@@ -403,7 +277,7 @@ function qe({
|
|
|
403
277
|
background: "var(--paper-elevated, rgba(255,255,255,0.82))"
|
|
404
278
|
},
|
|
405
279
|
children: [
|
|
406
|
-
/* @__PURE__ */
|
|
280
|
+
/* @__PURE__ */ l(
|
|
407
281
|
"div",
|
|
408
282
|
{
|
|
409
283
|
style: {
|
|
@@ -415,11 +289,11 @@ function qe({
|
|
|
415
289
|
/* @__PURE__ */ e(
|
|
416
290
|
"textarea",
|
|
417
291
|
{
|
|
418
|
-
ref:
|
|
419
|
-
value:
|
|
420
|
-
onChange: (
|
|
421
|
-
onKeyDown:
|
|
422
|
-
placeholder:
|
|
292
|
+
ref: D,
|
|
293
|
+
value: f,
|
|
294
|
+
onChange: (a) => ne(a.target.value),
|
|
295
|
+
onKeyDown: R,
|
|
296
|
+
placeholder: B,
|
|
423
297
|
rows: 1,
|
|
424
298
|
disabled: m,
|
|
425
299
|
style: {
|
|
@@ -440,11 +314,11 @@ function qe({
|
|
|
440
314
|
opacity: m ? 0.6 : 1,
|
|
441
315
|
cursor: m ? "not-allowed" : "text"
|
|
442
316
|
},
|
|
443
|
-
onFocus: (
|
|
444
|
-
m || (
|
|
317
|
+
onFocus: (a) => {
|
|
318
|
+
m || (a.target.style.borderColor = "rgba(94, 136, 176, 0.35)");
|
|
445
319
|
},
|
|
446
|
-
onBlur: (
|
|
447
|
-
|
|
320
|
+
onBlur: (a) => {
|
|
321
|
+
a.target.style.borderColor = "rgba(52, 58, 64, 0.18)";
|
|
448
322
|
}
|
|
449
323
|
}
|
|
450
324
|
),
|
|
@@ -452,14 +326,14 @@ function qe({
|
|
|
452
326
|
"button",
|
|
453
327
|
{
|
|
454
328
|
onClick: le,
|
|
455
|
-
disabled: !
|
|
329
|
+
disabled: !f.trim() || m,
|
|
456
330
|
style: {
|
|
457
331
|
padding: "10px 16px",
|
|
458
|
-
background:
|
|
459
|
-
color:
|
|
332
|
+
background: f.trim() && !m ? "var(--Base-Strong, #0B0B0B)" : "#ECEEF2",
|
|
333
|
+
color: f.trim() && !m ? "white" : "var(--text-base)",
|
|
460
334
|
border: "none",
|
|
461
335
|
borderRadius: "var(--radius-md, 8px)",
|
|
462
|
-
cursor:
|
|
336
|
+
cursor: f.trim() && !m ? "pointer" : "not-allowed",
|
|
463
337
|
display: "flex",
|
|
464
338
|
alignItems: "center",
|
|
465
339
|
gap: "6px",
|
|
@@ -468,7 +342,7 @@ function qe({
|
|
|
468
342
|
transition: "all 0.15s ease",
|
|
469
343
|
height: "42px"
|
|
470
344
|
},
|
|
471
|
-
children: m ? /* @__PURE__ */
|
|
345
|
+
children: m ? /* @__PURE__ */ l(ie, { children: [
|
|
472
346
|
/* @__PURE__ */ e("style", { children: `
|
|
473
347
|
@keyframes buttonSpin {
|
|
474
348
|
from { transform: rotate(0deg); }
|
|
@@ -489,8 +363,8 @@ function qe({
|
|
|
489
363
|
}
|
|
490
364
|
),
|
|
491
365
|
"Sending..."
|
|
492
|
-
] }) : /* @__PURE__ */
|
|
493
|
-
/* @__PURE__ */ e(
|
|
366
|
+
] }) : /* @__PURE__ */ l(ie, { children: [
|
|
367
|
+
/* @__PURE__ */ e(he, { size: 16 }),
|
|
494
368
|
"Send"
|
|
495
369
|
] })
|
|
496
370
|
}
|
|
@@ -516,7 +390,7 @@ function qe({
|
|
|
516
390
|
}
|
|
517
391
|
);
|
|
518
392
|
}
|
|
519
|
-
const
|
|
393
|
+
const o = {
|
|
520
394
|
title: "#2e3236",
|
|
521
395
|
// grey/strong
|
|
522
396
|
muted: "#808183",
|
|
@@ -537,19 +411,19 @@ const i = {
|
|
|
537
411
|
searchTrack: "#d8d8d8"
|
|
538
412
|
// neutral/150
|
|
539
413
|
};
|
|
540
|
-
function
|
|
541
|
-
const
|
|
542
|
-
if (!
|
|
414
|
+
function We(h) {
|
|
415
|
+
const b = h ? new Date(h) : null;
|
|
416
|
+
if (!b || Number.isNaN(b.getTime()))
|
|
543
417
|
return "Older";
|
|
544
418
|
const k = /* @__PURE__ */ new Date(), S = new Date(k.getFullYear(), k.getMonth(), k.getDate()), c = new Date(S);
|
|
545
|
-
return c.setDate(S.getDate() - 1),
|
|
419
|
+
return c.setDate(S.getDate() - 1), b >= S ? "Today" : b >= c ? "Yesterday" : "Older";
|
|
546
420
|
}
|
|
547
|
-
const
|
|
548
|
-
function
|
|
549
|
-
const
|
|
550
|
-
if (!
|
|
421
|
+
const Pe = ["Today", "Yesterday", "Older"];
|
|
422
|
+
function Ae(h) {
|
|
423
|
+
const b = h ? new Date(h) : null;
|
|
424
|
+
if (!b || Number.isNaN(b.getTime()))
|
|
551
425
|
return "";
|
|
552
|
-
const k = Date.now() -
|
|
426
|
+
const k = Date.now() - b.getTime(), S = Math.floor(k / 6e4);
|
|
553
427
|
if (S < 1)
|
|
554
428
|
return "just now";
|
|
555
429
|
if (S < 60)
|
|
@@ -557,98 +431,98 @@ function _e(d) {
|
|
|
557
431
|
const c = Math.floor(S / 60);
|
|
558
432
|
if (c < 24)
|
|
559
433
|
return `${c}h ago`;
|
|
560
|
-
const
|
|
561
|
-
return
|
|
434
|
+
const B = Math.floor(c / 24);
|
|
435
|
+
return B < 7 ? `${B}d ago` : b.toLocaleDateString(void 0, { month: "short", day: "numeric" });
|
|
562
436
|
}
|
|
563
|
-
function
|
|
564
|
-
threads:
|
|
565
|
-
activeThreadId:
|
|
437
|
+
function Ke({
|
|
438
|
+
threads: h = [],
|
|
439
|
+
activeThreadId: b,
|
|
566
440
|
onSelectThread: k,
|
|
567
441
|
onNewChat: S,
|
|
568
442
|
onCollapse: c,
|
|
569
|
-
onRenameThread:
|
|
570
|
-
onDeleteThread:
|
|
571
|
-
onPinThread:
|
|
572
|
-
loading:
|
|
573
|
-
pageSize:
|
|
443
|
+
onRenameThread: B,
|
|
444
|
+
onDeleteThread: O,
|
|
445
|
+
onPinThread: T,
|
|
446
|
+
loading: P = !1,
|
|
447
|
+
pageSize: f = 10,
|
|
574
448
|
// Server-side pagination (controlled). When `onPageChange` is provided the
|
|
575
449
|
// panel renders whatever `threads` it's given as the current page, drives the
|
|
576
450
|
// controls from `page` / `pageCount`, and asks the parent to fetch new pages.
|
|
577
451
|
page: ne,
|
|
578
|
-
pageCount:
|
|
579
|
-
onPageChange:
|
|
452
|
+
pageCount: U,
|
|
453
|
+
onPageChange: I,
|
|
580
454
|
// Called when the All/Pinned filter changes. When provided, the parent is
|
|
581
455
|
// expected to (re)fetch — e.g. hit the API with `&pinned=true`.
|
|
582
456
|
onFilterChange: m
|
|
583
457
|
}) {
|
|
584
|
-
const
|
|
585
|
-
V(
|
|
586
|
-
}, [n, v] =
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
}, [
|
|
458
|
+
const p = typeof I == "function", [y, A] = d(""), [F, V] = d("all"), _ = (i) => {
|
|
459
|
+
V(i), m == null || m(i);
|
|
460
|
+
}, [n, v] = d(1), [E, x] = d(null), [D, N] = d(null), [G, H] = d(""), [$, Y] = d(null), [re, q] = d(null), Z = te(null);
|
|
461
|
+
j(() => {
|
|
462
|
+
D && Z.current && (Z.current.focus(), Z.current.select());
|
|
463
|
+
}, [D]), j(() => {
|
|
590
464
|
if (!re)
|
|
591
465
|
return;
|
|
592
|
-
const
|
|
466
|
+
const i = () => q(null), r = (L) => {
|
|
593
467
|
L.key === "Escape" && q(null);
|
|
594
468
|
};
|
|
595
|
-
return document.addEventListener("click",
|
|
596
|
-
document.removeEventListener("click",
|
|
469
|
+
return document.addEventListener("click", i), document.addEventListener("keydown", r), () => {
|
|
470
|
+
document.removeEventListener("click", i), document.removeEventListener("keydown", r);
|
|
597
471
|
};
|
|
598
472
|
}, [re]);
|
|
599
|
-
const ae = typeof
|
|
600
|
-
const
|
|
601
|
-
if (
|
|
473
|
+
const ae = typeof B == "function", de = typeof O == "function", ee = typeof T == "function", { groups: le, totalPages: R } = xe(() => {
|
|
474
|
+
const i = y.trim().toLowerCase(), L = [...h.filter((g) => F === "pinned" && !g.pinned ? !1 : i ? (g.title || "").toLowerCase().includes(i) || (g.last_message_preview || "").toLowerCase().includes(i) : !0)].sort((g, z) => {
|
|
475
|
+
if (g.pinned && !z.pinned)
|
|
602
476
|
return -1;
|
|
603
|
-
if (!
|
|
477
|
+
if (!g.pinned && z.pinned)
|
|
604
478
|
return 1;
|
|
605
|
-
const pe = new Date(
|
|
479
|
+
const pe = new Date(g.updated_at || g.created_at || 0).getTime();
|
|
606
480
|
return new Date(z.updated_at || z.created_at || 0).getTime() - pe;
|
|
607
|
-
}),
|
|
481
|
+
}), Q = p ? Math.max(1, U || 1) : Math.max(1, Math.ceil(L.length / f));
|
|
608
482
|
let C;
|
|
609
|
-
if (
|
|
483
|
+
if (p)
|
|
610
484
|
C = L;
|
|
611
485
|
else {
|
|
612
|
-
const z = (Math.min(n,
|
|
613
|
-
C = L.slice(z, z +
|
|
486
|
+
const z = (Math.min(n, Q) - 1) * f;
|
|
487
|
+
C = L.slice(z, z + f);
|
|
614
488
|
}
|
|
615
489
|
const W = {};
|
|
616
|
-
for (const
|
|
617
|
-
const z =
|
|
618
|
-
(W[z] || (W[z] = [])).push(
|
|
490
|
+
for (const g of C) {
|
|
491
|
+
const z = We(g.updated_at || g.created_at);
|
|
492
|
+
(W[z] || (W[z] = [])).push(g);
|
|
619
493
|
}
|
|
620
|
-
return { groups:
|
|
621
|
-
label:
|
|
622
|
-
items: W[
|
|
623
|
-
})).filter((
|
|
624
|
-
}, [
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
}, [y, F,
|
|
628
|
-
|
|
629
|
-
}, [
|
|
630
|
-
const
|
|
631
|
-
if (
|
|
632
|
-
return Array.from({ length:
|
|
494
|
+
return { groups: Pe.map((g) => ({
|
|
495
|
+
label: g,
|
|
496
|
+
items: W[g] || []
|
|
497
|
+
})).filter((g) => g.items.length > 0), totalPages: Q };
|
|
498
|
+
}, [h, y, F, n, f, p, U]), a = le.reduce((i, r) => i + r.items.length, 0), s = p ? Math.max(1, ne || 1) : n, M = p ? I : v;
|
|
499
|
+
j(() => {
|
|
500
|
+
p || v(1);
|
|
501
|
+
}, [y, F, p]), j(() => {
|
|
502
|
+
p || v((i) => Math.min(i, R));
|
|
503
|
+
}, [R, p]);
|
|
504
|
+
const u = xe(() => {
|
|
505
|
+
if (R <= 5)
|
|
506
|
+
return Array.from({ length: R }, (Q, C) => C + 1);
|
|
633
507
|
let r = Math.max(1, s - 2);
|
|
634
|
-
const L = Math.min(
|
|
635
|
-
return r = Math.max(1, L - 5 + 1), Array.from({ length: L - r + 1 }, (
|
|
636
|
-
}, [
|
|
637
|
-
|
|
638
|
-
},
|
|
639
|
-
|
|
640
|
-
const r = (
|
|
641
|
-
|
|
642
|
-
},
|
|
643
|
-
|
|
644
|
-
}, ce = (
|
|
645
|
-
|
|
646
|
-
},
|
|
647
|
-
|
|
648
|
-
},
|
|
649
|
-
|
|
650
|
-
},
|
|
651
|
-
|
|
508
|
+
const L = Math.min(R, r + 5 - 1);
|
|
509
|
+
return r = Math.max(1, L - 5 + 1), Array.from({ length: L - r + 1 }, (Q, C) => r + C);
|
|
510
|
+
}, [R, s]), w = (i, r) => {
|
|
511
|
+
i.stopPropagation(), q(null), Y(null), N(r.id), H(r.title || r.name || "");
|
|
512
|
+
}, K = (i) => {
|
|
513
|
+
i && i.stopPropagation();
|
|
514
|
+
const r = (G || "").trim();
|
|
515
|
+
D && r && (B == null || B(D, r)), N(null), H("");
|
|
516
|
+
}, J = (i) => {
|
|
517
|
+
i && i.stopPropagation(), N(null), H("");
|
|
518
|
+
}, ce = (i, r) => {
|
|
519
|
+
i.stopPropagation(), q(null), N(null), Y(r.id);
|
|
520
|
+
}, oe = (i) => {
|
|
521
|
+
i && i.stopPropagation(), $ && (O == null || O($)), Y(null);
|
|
522
|
+
}, me = (i) => {
|
|
523
|
+
i && i.stopPropagation(), Y(null);
|
|
524
|
+
}, ve = (i, r) => {
|
|
525
|
+
i.stopPropagation(), T == null || T(r.id, !r.pinned);
|
|
652
526
|
}, se = {
|
|
653
527
|
display: "inline-flex",
|
|
654
528
|
alignItems: "center",
|
|
@@ -660,11 +534,11 @@ function Ze({
|
|
|
660
534
|
border: "none",
|
|
661
535
|
borderRadius: "6px",
|
|
662
536
|
cursor: "pointer",
|
|
663
|
-
color:
|
|
537
|
+
color: o.muted,
|
|
664
538
|
transition: "all 0.12s ease",
|
|
665
539
|
flexShrink: 0
|
|
666
540
|
};
|
|
667
|
-
return /* @__PURE__ */
|
|
541
|
+
return /* @__PURE__ */ l(
|
|
668
542
|
"div",
|
|
669
543
|
{
|
|
670
544
|
style: {
|
|
@@ -675,8 +549,8 @@ function Ze({
|
|
|
675
549
|
overflow: "hidden"
|
|
676
550
|
},
|
|
677
551
|
children: [
|
|
678
|
-
/* @__PURE__ */
|
|
679
|
-
/* @__PURE__ */
|
|
552
|
+
/* @__PURE__ */ l("div", { style: { padding: "16px 16px 0 16px", flexShrink: 0 }, children: [
|
|
553
|
+
/* @__PURE__ */ l(
|
|
680
554
|
"div",
|
|
681
555
|
{
|
|
682
556
|
style: {
|
|
@@ -686,7 +560,7 @@ function Ze({
|
|
|
686
560
|
height: "32px"
|
|
687
561
|
},
|
|
688
562
|
children: [
|
|
689
|
-
/* @__PURE__ */ e("div", { style: { fontSize: "14px", fontWeight: 400, color:
|
|
563
|
+
/* @__PURE__ */ e("div", { style: { fontSize: "14px", fontWeight: 400, color: o.title }, children: "Threads" }),
|
|
690
564
|
c && /* @__PURE__ */ e(
|
|
691
565
|
"button",
|
|
692
566
|
{
|
|
@@ -697,11 +571,11 @@ function Ze({
|
|
|
697
571
|
...se,
|
|
698
572
|
width: "20px",
|
|
699
573
|
height: "20px",
|
|
700
|
-
color:
|
|
574
|
+
color: o.muted
|
|
701
575
|
},
|
|
702
|
-
onMouseEnter: (
|
|
703
|
-
onMouseLeave: (
|
|
704
|
-
children: /* @__PURE__ */ e(
|
|
576
|
+
onMouseEnter: (i) => i.currentTarget.style.background = o.hoverBg,
|
|
577
|
+
onMouseLeave: (i) => i.currentTarget.style.background = "transparent",
|
|
578
|
+
children: /* @__PURE__ */ e(we, { size: 20, strokeWidth: 1.5 })
|
|
705
579
|
}
|
|
706
580
|
)
|
|
707
581
|
]
|
|
@@ -714,12 +588,12 @@ function Ze({
|
|
|
714
588
|
display: "flex",
|
|
715
589
|
alignItems: "center",
|
|
716
590
|
height: "32px",
|
|
717
|
-
background:
|
|
591
|
+
background: o.searchTrack,
|
|
718
592
|
borderRadius: "11px",
|
|
719
593
|
padding: "1px",
|
|
720
594
|
marginTop: "12px"
|
|
721
595
|
},
|
|
722
|
-
children: /* @__PURE__ */
|
|
596
|
+
children: /* @__PURE__ */ l(
|
|
723
597
|
"div",
|
|
724
598
|
{
|
|
725
599
|
style: {
|
|
@@ -733,13 +607,13 @@ function Ze({
|
|
|
733
607
|
padding: "4px 8px"
|
|
734
608
|
},
|
|
735
609
|
children: [
|
|
736
|
-
/* @__PURE__ */ e(
|
|
610
|
+
/* @__PURE__ */ e(Ce, { size: 18, style: { color: o.faint, flexShrink: 0 } }),
|
|
737
611
|
/* @__PURE__ */ e(
|
|
738
612
|
"input",
|
|
739
613
|
{
|
|
740
614
|
type: "text",
|
|
741
615
|
value: y,
|
|
742
|
-
onChange: (
|
|
616
|
+
onChange: (i) => A(i.target.value),
|
|
743
617
|
placeholder: "Search",
|
|
744
618
|
style: {
|
|
745
619
|
flex: 1,
|
|
@@ -749,7 +623,7 @@ function Ze({
|
|
|
749
623
|
background: "transparent",
|
|
750
624
|
fontSize: "14px",
|
|
751
625
|
fontWeight: 500,
|
|
752
|
-
color:
|
|
626
|
+
color: o.title
|
|
753
627
|
}
|
|
754
628
|
}
|
|
755
629
|
)
|
|
@@ -758,7 +632,7 @@ function Ze({
|
|
|
758
632
|
)
|
|
759
633
|
}
|
|
760
634
|
),
|
|
761
|
-
/* @__PURE__ */
|
|
635
|
+
/* @__PURE__ */ l("div", { style: { display: "flex", alignItems: "center", gap: "16px", marginTop: "12px" }, children: [
|
|
762
636
|
/* @__PURE__ */ e(
|
|
763
637
|
"button",
|
|
764
638
|
{
|
|
@@ -777,13 +651,13 @@ function Ze({
|
|
|
777
651
|
fontWeight: 400,
|
|
778
652
|
lineHeight: "24px",
|
|
779
653
|
transition: "all 0.12s ease",
|
|
780
|
-
background: F === "all" ?
|
|
781
|
-
color: F === "all" ?
|
|
654
|
+
background: F === "all" ? o.pillDarkBg : o.hoverBg,
|
|
655
|
+
color: F === "all" ? o.pillDarkText : o.title
|
|
782
656
|
},
|
|
783
657
|
children: "All"
|
|
784
658
|
}
|
|
785
659
|
),
|
|
786
|
-
/* @__PURE__ */
|
|
660
|
+
/* @__PURE__ */ l(
|
|
787
661
|
"button",
|
|
788
662
|
{
|
|
789
663
|
type: "button",
|
|
@@ -802,8 +676,8 @@ function Ze({
|
|
|
802
676
|
fontWeight: 400,
|
|
803
677
|
lineHeight: "24px",
|
|
804
678
|
transition: "all 0.12s ease",
|
|
805
|
-
background: F === "pinned" ?
|
|
806
|
-
color: F === "pinned" ?
|
|
679
|
+
background: F === "pinned" ? o.pillDarkBg : o.hoverBg,
|
|
680
|
+
color: F === "pinned" ? o.pillDarkText : o.title
|
|
807
681
|
},
|
|
808
682
|
children: [
|
|
809
683
|
/* @__PURE__ */ e(ue, { size: 16, style: { flexShrink: 0 } }),
|
|
@@ -813,29 +687,29 @@ function Ze({
|
|
|
813
687
|
)
|
|
814
688
|
] })
|
|
815
689
|
] }),
|
|
816
|
-
/* @__PURE__ */ e("div", { style: { flex: 1, overflowY: "auto", padding: "16px 16px 8px 16px" }, children:
|
|
690
|
+
/* @__PURE__ */ e("div", { style: { flex: 1, overflowY: "auto", padding: "16px 16px 8px 16px" }, children: P ? /* @__PURE__ */ e("div", { style: { padding: "30px 16px", textAlign: "center", color: o.faint, fontSize: "13px" }, children: "Loading threads..." }) : a === 0 ? /* @__PURE__ */ e("div", { style: { padding: "30px 16px", textAlign: "center", color: o.faint, fontSize: "13px" }, children: y ? "No threads found" : F === "pinned" ? "No pinned threads" : "No threads yet" }) : le.map((i) => /* @__PURE__ */ l("div", { style: { marginBottom: "8px" }, children: [
|
|
817
691
|
/* @__PURE__ */ e(
|
|
818
692
|
"div",
|
|
819
693
|
{
|
|
820
694
|
style: {
|
|
821
695
|
fontSize: "13px",
|
|
822
696
|
fontWeight: 500,
|
|
823
|
-
color:
|
|
697
|
+
color: o.title,
|
|
824
698
|
padding: "8px 0 4px 0"
|
|
825
699
|
},
|
|
826
|
-
children:
|
|
700
|
+
children: i.label
|
|
827
701
|
}
|
|
828
702
|
),
|
|
829
|
-
|
|
830
|
-
const L = r.id ===
|
|
831
|
-
return /* @__PURE__ */
|
|
703
|
+
i.items.map((r) => {
|
|
704
|
+
const L = r.id === b, Q = E === r.id, C = D === r.id, W = $ === r.id, X = re === r.id, g = ae || de, z = (ee || g) && (Q || L || X) && !C && !W, pe = X || W || C, ge = L ? o.selectedBg : Q || pe ? o.hoverBg : "transparent", ke = L || Q || pe ? `1px solid ${o.border}` : "1px solid transparent";
|
|
705
|
+
return /* @__PURE__ */ l(
|
|
832
706
|
"div",
|
|
833
707
|
{
|
|
834
708
|
onClick: () => {
|
|
835
709
|
C || W || k == null || k(r.id);
|
|
836
710
|
},
|
|
837
|
-
onMouseEnter: () =>
|
|
838
|
-
onMouseLeave: () =>
|
|
711
|
+
onMouseEnter: () => x(r.id),
|
|
712
|
+
onMouseLeave: () => x((t) => t === r.id ? null : t),
|
|
839
713
|
style: {
|
|
840
714
|
display: "flex",
|
|
841
715
|
alignItems: "center",
|
|
@@ -844,7 +718,7 @@ function Ze({
|
|
|
844
718
|
marginBottom: "2px",
|
|
845
719
|
borderRadius: "8px",
|
|
846
720
|
background: ge,
|
|
847
|
-
border:
|
|
721
|
+
border: ke,
|
|
848
722
|
cursor: C || W ? "default" : "pointer",
|
|
849
723
|
transition: "background 0.12s ease, border-color 0.12s ease",
|
|
850
724
|
boxSizing: "border-box",
|
|
@@ -861,7 +735,7 @@ function Ze({
|
|
|
861
735
|
width: "40px",
|
|
862
736
|
height: "40px",
|
|
863
737
|
flexShrink: 0,
|
|
864
|
-
color:
|
|
738
|
+
color: o.muted
|
|
865
739
|
},
|
|
866
740
|
children: /* @__PURE__ */ e(Te, { size: 20 })
|
|
867
741
|
}
|
|
@@ -869,29 +743,29 @@ function Ze({
|
|
|
869
743
|
C ? /* @__PURE__ */ e(
|
|
870
744
|
"input",
|
|
871
745
|
{
|
|
872
|
-
ref:
|
|
746
|
+
ref: Z,
|
|
873
747
|
type: "text",
|
|
874
|
-
value:
|
|
875
|
-
onChange: (t) =>
|
|
748
|
+
value: G,
|
|
749
|
+
onChange: (t) => H(t.target.value),
|
|
876
750
|
onClick: (t) => t.stopPropagation(),
|
|
877
751
|
onKeyDown: (t) => {
|
|
878
|
-
t.stopPropagation(), t.key === "Enter" ?
|
|
752
|
+
t.stopPropagation(), t.key === "Enter" ? K(t) : t.key === "Escape" && J(t);
|
|
879
753
|
},
|
|
880
754
|
style: {
|
|
881
755
|
flex: 1,
|
|
882
756
|
minWidth: 0,
|
|
883
757
|
fontSize: "14px",
|
|
884
758
|
fontWeight: 600,
|
|
885
|
-
color:
|
|
759
|
+
color: o.title,
|
|
886
760
|
background: "#fff",
|
|
887
|
-
border: `1px solid ${
|
|
761
|
+
border: `1px solid ${o.border}`,
|
|
888
762
|
borderRadius: "6px",
|
|
889
763
|
padding: "4px 8px",
|
|
890
764
|
outline: "none",
|
|
891
765
|
boxSizing: "border-box"
|
|
892
766
|
}
|
|
893
767
|
}
|
|
894
|
-
) : /* @__PURE__ */
|
|
768
|
+
) : /* @__PURE__ */ l(
|
|
895
769
|
"div",
|
|
896
770
|
{
|
|
897
771
|
style: {
|
|
@@ -913,7 +787,7 @@ function Ze({
|
|
|
913
787
|
maxWidth: "100%",
|
|
914
788
|
fontSize: "14px",
|
|
915
789
|
fontWeight: L ? 550 : 500,
|
|
916
|
-
color:
|
|
790
|
+
color: o.title,
|
|
917
791
|
overflow: "hidden",
|
|
918
792
|
textOverflow: "ellipsis",
|
|
919
793
|
whiteSpace: "nowrap",
|
|
@@ -922,7 +796,7 @@ function Ze({
|
|
|
922
796
|
children: r.title || r.name || "Untitled thread"
|
|
923
797
|
}
|
|
924
798
|
),
|
|
925
|
-
W ? /* @__PURE__ */
|
|
799
|
+
W ? /* @__PURE__ */ l(
|
|
926
800
|
"div",
|
|
927
801
|
{
|
|
928
802
|
style: {
|
|
@@ -938,7 +812,7 @@ function Ze({
|
|
|
938
812
|
style: {
|
|
939
813
|
fontSize: "12px",
|
|
940
814
|
fontWeight: 500,
|
|
941
|
-
color:
|
|
815
|
+
color: o.title
|
|
942
816
|
},
|
|
943
817
|
children: "Confirm: delete this thread?"
|
|
944
818
|
}
|
|
@@ -947,14 +821,14 @@ function Ze({
|
|
|
947
821
|
"button",
|
|
948
822
|
{
|
|
949
823
|
type: "button",
|
|
950
|
-
onClick:
|
|
824
|
+
onClick: oe,
|
|
951
825
|
style: {
|
|
952
826
|
padding: "3px 12px",
|
|
953
827
|
fontSize: "12px",
|
|
954
828
|
fontWeight: 600,
|
|
955
|
-
color:
|
|
829
|
+
color: o.title,
|
|
956
830
|
background: "#ECEEF2",
|
|
957
|
-
border: `1px solid ${
|
|
831
|
+
border: `1px solid ${o.borderSubtle}`,
|
|
958
832
|
borderRadius: "6px",
|
|
959
833
|
cursor: "pointer"
|
|
960
834
|
},
|
|
@@ -967,59 +841,59 @@ function Ze({
|
|
|
967
841
|
"button",
|
|
968
842
|
{
|
|
969
843
|
type: "button",
|
|
970
|
-
onClick:
|
|
844
|
+
onClick: me,
|
|
971
845
|
style: {
|
|
972
846
|
padding: "3px 6px",
|
|
973
847
|
fontSize: "12px",
|
|
974
848
|
fontWeight: 500,
|
|
975
|
-
color:
|
|
849
|
+
color: o.muted,
|
|
976
850
|
background: "transparent",
|
|
977
851
|
border: "none",
|
|
978
852
|
cursor: "pointer"
|
|
979
853
|
},
|
|
980
|
-
onMouseEnter: (t) => t.currentTarget.style.color =
|
|
981
|
-
onMouseLeave: (t) => t.currentTarget.style.color =
|
|
854
|
+
onMouseEnter: (t) => t.currentTarget.style.color = o.title,
|
|
855
|
+
onMouseLeave: (t) => t.currentTarget.style.color = o.muted,
|
|
982
856
|
children: "No"
|
|
983
857
|
}
|
|
984
858
|
)
|
|
985
859
|
]
|
|
986
860
|
}
|
|
987
|
-
) : /* @__PURE__ */
|
|
861
|
+
) : /* @__PURE__ */ l(
|
|
988
862
|
"div",
|
|
989
863
|
{
|
|
990
864
|
style: {
|
|
991
865
|
fontSize: "12px",
|
|
992
|
-
color:
|
|
866
|
+
color: o.muted,
|
|
993
867
|
overflow: "hidden",
|
|
994
868
|
textOverflow: "ellipsis",
|
|
995
869
|
whiteSpace: "nowrap",
|
|
996
870
|
lineHeight: 1.5
|
|
997
871
|
},
|
|
998
872
|
children: [
|
|
999
|
-
r.message_count != null && /* @__PURE__ */
|
|
873
|
+
r.message_count != null && /* @__PURE__ */ l(ie, { children: [
|
|
1000
874
|
r.message_count,
|
|
1001
875
|
" msg",
|
|
1002
876
|
r.message_count !== 1 ? "s" : "",
|
|
1003
877
|
" · "
|
|
1004
878
|
] }),
|
|
1005
|
-
|
|
879
|
+
Ae(r.updated_at || r.created_at)
|
|
1006
880
|
]
|
|
1007
881
|
}
|
|
1008
882
|
)
|
|
1009
883
|
]
|
|
1010
884
|
}
|
|
1011
885
|
),
|
|
1012
|
-
C && /* @__PURE__ */
|
|
886
|
+
C && /* @__PURE__ */ l("div", { style: { display: "inline-flex", alignItems: "center", gap: "2px", flexShrink: 0 }, children: [
|
|
1013
887
|
/* @__PURE__ */ e(
|
|
1014
888
|
"button",
|
|
1015
889
|
{
|
|
1016
890
|
type: "button",
|
|
1017
891
|
title: "Save",
|
|
1018
|
-
onClick:
|
|
892
|
+
onClick: K,
|
|
1019
893
|
style: { ...se, color: "#1f9d57" },
|
|
1020
894
|
onMouseEnter: (t) => t.currentTarget.style.background = "rgba(31,157,87,0.12)",
|
|
1021
895
|
onMouseLeave: (t) => t.currentTarget.style.background = "transparent",
|
|
1022
|
-
children: /* @__PURE__ */ e(
|
|
896
|
+
children: /* @__PURE__ */ e(Me, { size: 15 })
|
|
1023
897
|
}
|
|
1024
898
|
),
|
|
1025
899
|
/* @__PURE__ */ e(
|
|
@@ -1027,11 +901,11 @@ function Ze({
|
|
|
1027
901
|
{
|
|
1028
902
|
type: "button",
|
|
1029
903
|
title: "Cancel",
|
|
1030
|
-
onClick:
|
|
904
|
+
onClick: J,
|
|
1031
905
|
style: se,
|
|
1032
906
|
onMouseEnter: (t) => t.currentTarget.style.background = "rgba(0,0,0,0.06)",
|
|
1033
907
|
onMouseLeave: (t) => t.currentTarget.style.background = "transparent",
|
|
1034
|
-
children: /* @__PURE__ */ e(
|
|
908
|
+
children: /* @__PURE__ */ e(ze, { size: 15 })
|
|
1035
909
|
}
|
|
1036
910
|
)
|
|
1037
911
|
] }),
|
|
@@ -1039,54 +913,54 @@ function Ze({
|
|
|
1039
913
|
ue,
|
|
1040
914
|
{
|
|
1041
915
|
size: 14,
|
|
1042
|
-
style: { color:
|
|
916
|
+
style: { color: o.title, flexShrink: 0 },
|
|
1043
917
|
fill: "currentColor"
|
|
1044
918
|
}
|
|
1045
919
|
),
|
|
1046
|
-
z && /* @__PURE__ */
|
|
920
|
+
z && /* @__PURE__ */ l("div", { style: { display: "inline-flex", alignItems: "center", gap: "2px", flexShrink: 0 }, children: [
|
|
1047
921
|
ee && /* @__PURE__ */ e(
|
|
1048
922
|
"button",
|
|
1049
923
|
{
|
|
1050
924
|
type: "button",
|
|
1051
925
|
title: r.pinned ? "Unpin" : "Pin",
|
|
1052
|
-
onClick: (t) =>
|
|
926
|
+
onClick: (t) => ve(t, r),
|
|
1053
927
|
style: {
|
|
1054
928
|
...se,
|
|
1055
|
-
color: r.pinned ?
|
|
929
|
+
color: r.pinned ? o.title : o.muted
|
|
1056
930
|
},
|
|
1057
931
|
onMouseEnter: (t) => {
|
|
1058
|
-
t.currentTarget.style.background = "rgba(0,0,0,0.06)", t.currentTarget.style.color =
|
|
932
|
+
t.currentTarget.style.background = "rgba(0,0,0,0.06)", t.currentTarget.style.color = o.title;
|
|
1059
933
|
},
|
|
1060
934
|
onMouseLeave: (t) => {
|
|
1061
|
-
t.currentTarget.style.background = "transparent", t.currentTarget.style.color = r.pinned ?
|
|
935
|
+
t.currentTarget.style.background = "transparent", t.currentTarget.style.color = r.pinned ? o.title : o.muted;
|
|
1062
936
|
},
|
|
1063
937
|
children: /* @__PURE__ */ e(ue, { size: 14, fill: r.pinned ? "currentColor" : "none" })
|
|
1064
938
|
}
|
|
1065
939
|
),
|
|
1066
|
-
|
|
940
|
+
g && /* @__PURE__ */ e(
|
|
1067
941
|
"button",
|
|
1068
942
|
{
|
|
1069
943
|
type: "button",
|
|
1070
944
|
title: "More",
|
|
1071
945
|
onClick: (t) => {
|
|
1072
|
-
t.stopPropagation(), q((
|
|
946
|
+
t.stopPropagation(), q((Se) => Se === r.id ? null : r.id);
|
|
1073
947
|
},
|
|
1074
948
|
style: {
|
|
1075
949
|
...se,
|
|
1076
|
-
color:
|
|
1077
|
-
background:
|
|
950
|
+
color: X ? o.title : o.muted,
|
|
951
|
+
background: X ? "rgba(0,0,0,0.06)" : "transparent"
|
|
1078
952
|
},
|
|
1079
953
|
onMouseEnter: (t) => {
|
|
1080
|
-
t.currentTarget.style.background = "rgba(0,0,0,0.06)", t.currentTarget.style.color =
|
|
954
|
+
t.currentTarget.style.background = "rgba(0,0,0,0.06)", t.currentTarget.style.color = o.title;
|
|
1081
955
|
},
|
|
1082
956
|
onMouseLeave: (t) => {
|
|
1083
|
-
t.currentTarget.style.background =
|
|
957
|
+
t.currentTarget.style.background = X ? "rgba(0,0,0,0.06)" : "transparent", t.currentTarget.style.color = X ? o.title : o.muted;
|
|
1084
958
|
},
|
|
1085
|
-
children: /* @__PURE__ */ e(
|
|
959
|
+
children: /* @__PURE__ */ e(Ie, { size: 14 })
|
|
1086
960
|
}
|
|
1087
961
|
)
|
|
1088
962
|
] }),
|
|
1089
|
-
|
|
963
|
+
X && g && /* @__PURE__ */ l(
|
|
1090
964
|
"div",
|
|
1091
965
|
{
|
|
1092
966
|
onClick: (t) => t.stopPropagation(),
|
|
@@ -1097,7 +971,7 @@ function Ze({
|
|
|
1097
971
|
zIndex: 20,
|
|
1098
972
|
width: "144px",
|
|
1099
973
|
background: "#FFFFFF",
|
|
1100
|
-
border: `1px solid ${
|
|
974
|
+
border: `1px solid ${o.border}`,
|
|
1101
975
|
borderRadius: "4px",
|
|
1102
976
|
boxShadow: "-2px 2px 4px rgba(0,0,0,0.1)",
|
|
1103
977
|
overflow: "hidden"
|
|
@@ -1114,12 +988,12 @@ function Ze({
|
|
|
1114
988
|
textAlign: "left",
|
|
1115
989
|
padding: "12px",
|
|
1116
990
|
fontSize: "13px",
|
|
1117
|
-
color:
|
|
991
|
+
color: o.title,
|
|
1118
992
|
background: "transparent",
|
|
1119
993
|
border: "none",
|
|
1120
994
|
cursor: "pointer"
|
|
1121
995
|
},
|
|
1122
|
-
onMouseEnter: (t) => t.currentTarget.style.background =
|
|
996
|
+
onMouseEnter: (t) => t.currentTarget.style.background = o.hoverBg,
|
|
1123
997
|
onMouseLeave: (t) => t.currentTarget.style.background = "transparent",
|
|
1124
998
|
children: "Rename"
|
|
1125
999
|
}
|
|
@@ -1135,13 +1009,13 @@ function Ze({
|
|
|
1135
1009
|
textAlign: "left",
|
|
1136
1010
|
padding: "12px",
|
|
1137
1011
|
fontSize: "13px",
|
|
1138
|
-
color:
|
|
1012
|
+
color: o.title,
|
|
1139
1013
|
background: "transparent",
|
|
1140
1014
|
border: "none",
|
|
1141
|
-
borderTop: ae ? `1px solid ${
|
|
1015
|
+
borderTop: ae ? `1px solid ${o.border}` : "none",
|
|
1142
1016
|
cursor: "pointer"
|
|
1143
1017
|
},
|
|
1144
|
-
onMouseEnter: (t) => t.currentTarget.style.background =
|
|
1018
|
+
onMouseEnter: (t) => t.currentTarget.style.background = o.hoverBg,
|
|
1145
1019
|
onMouseLeave: (t) => t.currentTarget.style.background = "transparent",
|
|
1146
1020
|
children: "Delete"
|
|
1147
1021
|
}
|
|
@@ -1154,8 +1028,8 @@ function Ze({
|
|
|
1154
1028
|
r.id
|
|
1155
1029
|
);
|
|
1156
1030
|
})
|
|
1157
|
-
] },
|
|
1158
|
-
!
|
|
1031
|
+
] }, i.label)) }),
|
|
1032
|
+
!P && R > 1 && /* @__PURE__ */ l(
|
|
1159
1033
|
"div",
|
|
1160
1034
|
{
|
|
1161
1035
|
style: {
|
|
@@ -1167,15 +1041,15 @@ function Ze({
|
|
|
1167
1041
|
height: "64px",
|
|
1168
1042
|
padding: "0 16px",
|
|
1169
1043
|
boxSizing: "border-box",
|
|
1170
|
-
borderTop: `1px solid ${
|
|
1044
|
+
borderTop: `1px solid ${o.border}`
|
|
1171
1045
|
},
|
|
1172
1046
|
children: [
|
|
1173
|
-
/* @__PURE__ */
|
|
1047
|
+
/* @__PURE__ */ l(
|
|
1174
1048
|
"button",
|
|
1175
1049
|
{
|
|
1176
1050
|
type: "button",
|
|
1177
1051
|
disabled: s <= 1,
|
|
1178
|
-
onClick: () =>
|
|
1052
|
+
onClick: () => M(Math.max(1, s - 1)),
|
|
1179
1053
|
style: {
|
|
1180
1054
|
display: "inline-flex",
|
|
1181
1055
|
alignItems: "center",
|
|
@@ -1185,7 +1059,7 @@ function Ze({
|
|
|
1185
1059
|
padding: "4px 8px",
|
|
1186
1060
|
borderRadius: "10px",
|
|
1187
1061
|
background: "#FFFFFF",
|
|
1188
|
-
border: `1px solid ${
|
|
1062
|
+
border: `1px solid ${o.borderSubtle}`,
|
|
1189
1063
|
fontSize: "12px",
|
|
1190
1064
|
lineHeight: "16px",
|
|
1191
1065
|
color: "#0b0b0b",
|
|
@@ -1198,13 +1072,13 @@ function Ze({
|
|
|
1198
1072
|
]
|
|
1199
1073
|
}
|
|
1200
1074
|
),
|
|
1201
|
-
|
|
1202
|
-
const r =
|
|
1075
|
+
u.map((i) => {
|
|
1076
|
+
const r = i === s;
|
|
1203
1077
|
return /* @__PURE__ */ e(
|
|
1204
1078
|
"button",
|
|
1205
1079
|
{
|
|
1206
1080
|
type: "button",
|
|
1207
|
-
onClick: () =>
|
|
1081
|
+
onClick: () => M(i),
|
|
1208
1082
|
style: {
|
|
1209
1083
|
display: "inline-flex",
|
|
1210
1084
|
alignItems: "center",
|
|
@@ -1218,20 +1092,20 @@ function Ze({
|
|
|
1218
1092
|
cursor: "pointer",
|
|
1219
1093
|
background: r ? "#0b0b0b" : "#FFFFFF",
|
|
1220
1094
|
color: r ? "#FFFFFF" : "#0b0b0b",
|
|
1221
|
-
border: r ? "1px solid #0b0b0b" : `1px solid ${
|
|
1095
|
+
border: r ? "1px solid #0b0b0b" : `1px solid ${o.borderSubtle}`,
|
|
1222
1096
|
fontWeight: r ? 600 : 400
|
|
1223
1097
|
},
|
|
1224
|
-
children:
|
|
1098
|
+
children: i
|
|
1225
1099
|
},
|
|
1226
|
-
|
|
1100
|
+
i
|
|
1227
1101
|
);
|
|
1228
1102
|
}),
|
|
1229
|
-
/* @__PURE__ */
|
|
1103
|
+
/* @__PURE__ */ l(
|
|
1230
1104
|
"button",
|
|
1231
1105
|
{
|
|
1232
1106
|
type: "button",
|
|
1233
|
-
disabled: s >=
|
|
1234
|
-
onClick: () =>
|
|
1107
|
+
disabled: s >= R,
|
|
1108
|
+
onClick: () => M(Math.min(R, s + 1)),
|
|
1235
1109
|
style: {
|
|
1236
1110
|
display: "inline-flex",
|
|
1237
1111
|
alignItems: "center",
|
|
@@ -1241,16 +1115,16 @@ function Ze({
|
|
|
1241
1115
|
padding: "4px 8px",
|
|
1242
1116
|
borderRadius: "10px",
|
|
1243
1117
|
background: "#FFFFFF",
|
|
1244
|
-
border: `1px solid ${
|
|
1118
|
+
border: `1px solid ${o.borderSubtle}`,
|
|
1245
1119
|
fontSize: "12px",
|
|
1246
1120
|
lineHeight: "16px",
|
|
1247
1121
|
color: "#0b0b0b",
|
|
1248
|
-
cursor: s >=
|
|
1249
|
-
opacity: s >=
|
|
1122
|
+
cursor: s >= R ? "default" : "pointer",
|
|
1123
|
+
opacity: s >= R ? 0.5 : 1
|
|
1250
1124
|
},
|
|
1251
1125
|
children: [
|
|
1252
1126
|
"Next",
|
|
1253
|
-
/* @__PURE__ */ e(
|
|
1127
|
+
/* @__PURE__ */ e(Ee, { size: 12 })
|
|
1254
1128
|
]
|
|
1255
1129
|
}
|
|
1256
1130
|
)
|
|
@@ -1261,67 +1135,67 @@ function Ze({
|
|
|
1261
1135
|
}
|
|
1262
1136
|
);
|
|
1263
1137
|
}
|
|
1264
|
-
const
|
|
1265
|
-
function
|
|
1266
|
-
sessionTitle:
|
|
1267
|
-
messages:
|
|
1138
|
+
const He = { error: (...h) => console.warn("toast.error:", ...h) }, je = () => ({ userData: { name: "User", email: "" } });
|
|
1139
|
+
function Ue({
|
|
1140
|
+
sessionTitle: h,
|
|
1141
|
+
messages: b,
|
|
1268
1142
|
onSendMessage: k,
|
|
1269
1143
|
currentUser: S
|
|
1270
1144
|
}) {
|
|
1271
1145
|
var _;
|
|
1272
|
-
const [c,
|
|
1273
|
-
name: (
|
|
1274
|
-
initials: ((_ =
|
|
1146
|
+
const [c, B] = d(""), [O, T] = d(!1), [P, f] = d(b || []), [ne, U] = d(!1), [I, m] = d(!1), { userData: p } = je(), y = te(null), A = S || {
|
|
1147
|
+
name: (p == null ? void 0 : p.name) || "You",
|
|
1148
|
+
initials: ((_ = p == null ? void 0 : p.name) == null ? void 0 : _.split(" ").map((n) => n[0]).join("").toUpperCase()) || "YO",
|
|
1275
1149
|
color: "#6B7C93"
|
|
1276
1150
|
};
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
}, [
|
|
1151
|
+
j(() => {
|
|
1152
|
+
f(b || []);
|
|
1153
|
+
}, [b]), j(() => {
|
|
1280
1154
|
y.current && y.current.scrollIntoView({ behavior: "smooth" });
|
|
1281
|
-
}, [
|
|
1155
|
+
}, [P]);
|
|
1282
1156
|
const F = async () => {
|
|
1283
1157
|
if (!c.trim())
|
|
1284
1158
|
return;
|
|
1285
1159
|
const n = c.trim();
|
|
1286
|
-
|
|
1160
|
+
B(""), m(!0);
|
|
1287
1161
|
const v = {
|
|
1288
1162
|
id: `temp-${Date.now()}`,
|
|
1289
1163
|
author: {
|
|
1290
|
-
name:
|
|
1291
|
-
role: (
|
|
1292
|
-
initials:
|
|
1293
|
-
color:
|
|
1164
|
+
name: A.name,
|
|
1165
|
+
role: (p == null ? void 0 : p.role) || "",
|
|
1166
|
+
initials: A.initials,
|
|
1167
|
+
color: A.color
|
|
1294
1168
|
},
|
|
1295
1169
|
content: n,
|
|
1296
1170
|
timestamp: "Just now",
|
|
1297
1171
|
type: "comment",
|
|
1298
1172
|
isOptimistic: !0
|
|
1299
1173
|
};
|
|
1300
|
-
if (
|
|
1174
|
+
if (f((E) => [...E, v]), k) {
|
|
1301
1175
|
try {
|
|
1302
|
-
await k(n),
|
|
1303
|
-
(
|
|
1304
|
-
(
|
|
1176
|
+
await k(n), f(
|
|
1177
|
+
(E) => E.map(
|
|
1178
|
+
(x) => x.id === v.id ? { ...x, isOptimistic: !1 } : x
|
|
1305
1179
|
)
|
|
1306
1180
|
);
|
|
1307
1181
|
} catch {
|
|
1308
|
-
|
|
1182
|
+
f((x) => x.filter((D) => D.id !== v.id)), He.error("Failed to send message");
|
|
1309
1183
|
} finally {
|
|
1310
1184
|
m(!1);
|
|
1311
1185
|
}
|
|
1312
1186
|
return;
|
|
1313
1187
|
}
|
|
1314
1188
|
setTimeout(() => {
|
|
1315
|
-
|
|
1316
|
-
(
|
|
1317
|
-
(
|
|
1189
|
+
f(
|
|
1190
|
+
(E) => E.map(
|
|
1191
|
+
(x) => x.id === v.id ? { ...x, isOptimistic: !1 } : x
|
|
1318
1192
|
)
|
|
1319
1193
|
), m(!1);
|
|
1320
1194
|
}, 500);
|
|
1321
1195
|
}, V = (n) => {
|
|
1322
1196
|
n.key === "Enter" && !n.shiftKey && (n.preventDefault(), F());
|
|
1323
1197
|
};
|
|
1324
|
-
return /* @__PURE__ */
|
|
1198
|
+
return /* @__PURE__ */ l(
|
|
1325
1199
|
"div",
|
|
1326
1200
|
{
|
|
1327
1201
|
style: {
|
|
@@ -1334,7 +1208,7 @@ function Ge({
|
|
|
1334
1208
|
overflow: "hidden"
|
|
1335
1209
|
},
|
|
1336
1210
|
children: [
|
|
1337
|
-
|
|
1211
|
+
h && /* @__PURE__ */ l(
|
|
1338
1212
|
"div",
|
|
1339
1213
|
{
|
|
1340
1214
|
style: {
|
|
@@ -1355,7 +1229,7 @@ function Ge({
|
|
|
1355
1229
|
children: "Session Discussion"
|
|
1356
1230
|
}
|
|
1357
1231
|
),
|
|
1358
|
-
|
|
1232
|
+
h && /* @__PURE__ */ e(
|
|
1359
1233
|
"div",
|
|
1360
1234
|
{
|
|
1361
1235
|
style: {
|
|
@@ -1365,13 +1239,13 @@ function Ge({
|
|
|
1365
1239
|
alignItems: "center",
|
|
1366
1240
|
gap: "8px"
|
|
1367
1241
|
},
|
|
1368
|
-
children: /* @__PURE__ */ e("span", { children:
|
|
1242
|
+
children: /* @__PURE__ */ e("span", { children: h })
|
|
1369
1243
|
}
|
|
1370
1244
|
)
|
|
1371
1245
|
]
|
|
1372
1246
|
}
|
|
1373
1247
|
),
|
|
1374
|
-
/* @__PURE__ */
|
|
1248
|
+
/* @__PURE__ */ l(
|
|
1375
1249
|
"div",
|
|
1376
1250
|
{
|
|
1377
1251
|
style: {
|
|
@@ -1395,7 +1269,7 @@ function Ge({
|
|
|
1395
1269
|
},
|
|
1396
1270
|
children: "Loading messages..."
|
|
1397
1271
|
}
|
|
1398
|
-
) :
|
|
1272
|
+
) : P.length === 0 ? /* @__PURE__ */ e(
|
|
1399
1273
|
"div",
|
|
1400
1274
|
{
|
|
1401
1275
|
style: {
|
|
@@ -1407,7 +1281,7 @@ function Ge({
|
|
|
1407
1281
|
},
|
|
1408
1282
|
children: "No messages yet. Start the conversation!"
|
|
1409
1283
|
}
|
|
1410
|
-
) :
|
|
1284
|
+
) : P.map((n) => /* @__PURE__ */ l(
|
|
1411
1285
|
"div",
|
|
1412
1286
|
{
|
|
1413
1287
|
style: {
|
|
@@ -1455,8 +1329,8 @@ function Ge({
|
|
|
1455
1329
|
children: /* @__PURE__ */ e(fe, { size: 14 })
|
|
1456
1330
|
}
|
|
1457
1331
|
),
|
|
1458
|
-
/* @__PURE__ */
|
|
1459
|
-
/* @__PURE__ */
|
|
1332
|
+
/* @__PURE__ */ l("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
1333
|
+
/* @__PURE__ */ l(
|
|
1460
1334
|
"div",
|
|
1461
1335
|
{
|
|
1462
1336
|
style: {
|
|
@@ -1539,7 +1413,7 @@ function Ge({
|
|
|
1539
1413
|
gap: "6px",
|
|
1540
1414
|
marginTop: "8px"
|
|
1541
1415
|
},
|
|
1542
|
-
children: n.references.map((v,
|
|
1416
|
+
children: n.references.map((v, E) => /* @__PURE__ */ l(
|
|
1543
1417
|
"button",
|
|
1544
1418
|
{
|
|
1545
1419
|
type: "button",
|
|
@@ -1557,11 +1431,11 @@ function Ge({
|
|
|
1557
1431
|
transition: "all 0.15s ease",
|
|
1558
1432
|
fontWeight: 550
|
|
1559
1433
|
},
|
|
1560
|
-
onMouseEnter: (
|
|
1561
|
-
|
|
1434
|
+
onMouseEnter: (x) => {
|
|
1435
|
+
x.currentTarget.style.background = "rgba(255, 255, 255, 0.95)", x.currentTarget.style.borderColor = "rgba(52, 58, 64, 0.24)";
|
|
1562
1436
|
},
|
|
1563
|
-
onMouseLeave: (
|
|
1564
|
-
|
|
1437
|
+
onMouseLeave: (x) => {
|
|
1438
|
+
x.currentTarget.style.background = "rgba(255, 255, 255, 0.7)", x.currentTarget.style.borderColor = "rgba(52, 58, 64, 0.16)";
|
|
1565
1439
|
},
|
|
1566
1440
|
children: [
|
|
1567
1441
|
v.type === "timestamp" && /* @__PURE__ */ e(fe, { size: 12 }),
|
|
@@ -1569,7 +1443,7 @@ function Ge({
|
|
|
1569
1443
|
v.label
|
|
1570
1444
|
]
|
|
1571
1445
|
},
|
|
1572
|
-
|
|
1446
|
+
E
|
|
1573
1447
|
))
|
|
1574
1448
|
}
|
|
1575
1449
|
)
|
|
@@ -1582,7 +1456,7 @@ function Ge({
|
|
|
1582
1456
|
]
|
|
1583
1457
|
}
|
|
1584
1458
|
),
|
|
1585
|
-
/* @__PURE__ */
|
|
1459
|
+
/* @__PURE__ */ l(
|
|
1586
1460
|
"div",
|
|
1587
1461
|
{
|
|
1588
1462
|
style: {
|
|
@@ -1591,7 +1465,7 @@ function Ge({
|
|
|
1591
1465
|
background: "var(--paper-elevated, rgba(255,255,255,0.82))"
|
|
1592
1466
|
},
|
|
1593
1467
|
children: [
|
|
1594
|
-
/* @__PURE__ */
|
|
1468
|
+
/* @__PURE__ */ l(
|
|
1595
1469
|
"div",
|
|
1596
1470
|
{
|
|
1597
1471
|
style: {
|
|
@@ -1607,7 +1481,7 @@ function Ge({
|
|
|
1607
1481
|
width: "32px",
|
|
1608
1482
|
height: "32px",
|
|
1609
1483
|
borderRadius: "var(--radius-md, 8px)",
|
|
1610
|
-
background:
|
|
1484
|
+
background: A.color,
|
|
1611
1485
|
color: "white",
|
|
1612
1486
|
display: "flex",
|
|
1613
1487
|
alignItems: "center",
|
|
@@ -1617,10 +1491,10 @@ function Ge({
|
|
|
1617
1491
|
flexShrink: 0,
|
|
1618
1492
|
opacity: 0.9
|
|
1619
1493
|
},
|
|
1620
|
-
children:
|
|
1494
|
+
children: A.initials
|
|
1621
1495
|
}
|
|
1622
1496
|
),
|
|
1623
|
-
/* @__PURE__ */
|
|
1497
|
+
/* @__PURE__ */ l(
|
|
1624
1498
|
"div",
|
|
1625
1499
|
{
|
|
1626
1500
|
style: {
|
|
@@ -1634,10 +1508,10 @@ function Ge({
|
|
|
1634
1508
|
"textarea",
|
|
1635
1509
|
{
|
|
1636
1510
|
value: c,
|
|
1637
|
-
onChange: (n) =>
|
|
1511
|
+
onChange: (n) => B(n.target.value),
|
|
1638
1512
|
onKeyDown: V,
|
|
1639
|
-
onFocus: () =>
|
|
1640
|
-
onBlur: () =>
|
|
1513
|
+
onFocus: () => T(!0),
|
|
1514
|
+
onBlur: () => T(!1),
|
|
1641
1515
|
placeholder: "Add a comment...",
|
|
1642
1516
|
style: {
|
|
1643
1517
|
width: "100%",
|
|
@@ -1647,7 +1521,7 @@ function Ge({
|
|
|
1647
1521
|
fontSize: "var(--text-md, 13px)",
|
|
1648
1522
|
color: "var(--text-base, rgba(30,33,37,0.78))",
|
|
1649
1523
|
background: "white",
|
|
1650
|
-
border: `1px solid ${
|
|
1524
|
+
border: `1px solid ${O ? "rgba(94, 136, 176, 0.35)" : "rgba(52, 58, 64, 0.16)"}`,
|
|
1651
1525
|
borderRadius: "var(--radius-md, 8px)",
|
|
1652
1526
|
resize: "vertical",
|
|
1653
1527
|
outline: "none",
|
|
@@ -1657,7 +1531,7 @@ function Ge({
|
|
|
1657
1531
|
}
|
|
1658
1532
|
}
|
|
1659
1533
|
),
|
|
1660
|
-
/* @__PURE__ */
|
|
1534
|
+
/* @__PURE__ */ l(
|
|
1661
1535
|
"div",
|
|
1662
1536
|
{
|
|
1663
1537
|
style: {
|
|
@@ -1666,7 +1540,7 @@ function Ge({
|
|
|
1666
1540
|
justifyContent: "space-between"
|
|
1667
1541
|
},
|
|
1668
1542
|
children: [
|
|
1669
|
-
/* @__PURE__ */
|
|
1543
|
+
/* @__PURE__ */ l("div", { style: { display: "flex", gap: "4px" }, children: [
|
|
1670
1544
|
/* @__PURE__ */ e(
|
|
1671
1545
|
"button",
|
|
1672
1546
|
{
|
|
@@ -1689,7 +1563,7 @@ function Ge({
|
|
|
1689
1563
|
n.currentTarget.style.background = "transparent", n.currentTarget.style.color = "rgba(30, 33, 37, 0.52)";
|
|
1690
1564
|
},
|
|
1691
1565
|
title: "Mention user",
|
|
1692
|
-
children: /* @__PURE__ */ e(
|
|
1566
|
+
children: /* @__PURE__ */ e(De, { size: 16 })
|
|
1693
1567
|
}
|
|
1694
1568
|
),
|
|
1695
1569
|
/* @__PURE__ */ e(
|
|
@@ -1739,7 +1613,7 @@ function Ge({
|
|
|
1739
1613
|
n.currentTarget.style.background = "transparent", n.currentTarget.style.color = "rgba(30, 33, 37, 0.52)";
|
|
1740
1614
|
},
|
|
1741
1615
|
title: "Attach file",
|
|
1742
|
-
children: /* @__PURE__ */ e(
|
|
1616
|
+
children: /* @__PURE__ */ e(Re, { size: 16 })
|
|
1743
1617
|
}
|
|
1744
1618
|
)
|
|
1745
1619
|
] }),
|
|
@@ -1748,28 +1622,28 @@ function Ge({
|
|
|
1748
1622
|
{
|
|
1749
1623
|
type: "button",
|
|
1750
1624
|
onClick: F,
|
|
1751
|
-
disabled: !c.trim() ||
|
|
1625
|
+
disabled: !c.trim() || I,
|
|
1752
1626
|
style: {
|
|
1753
1627
|
padding: "6px 12px",
|
|
1754
|
-
background: c.trim() && !
|
|
1628
|
+
background: c.trim() && !I ? "rgba(94, 136, 176, 0.85)" : "var(--border-subtle, rgba(52,58,64,0.08))",
|
|
1755
1629
|
border: "none",
|
|
1756
1630
|
borderRadius: "6px",
|
|
1757
|
-
color: c.trim() && !
|
|
1631
|
+
color: c.trim() && !I ? "white" : "var(--text-faint, rgba(30,33,37,0.36))",
|
|
1758
1632
|
fontSize: "var(--text-sm, 11px)",
|
|
1759
1633
|
fontWeight: 600,
|
|
1760
|
-
cursor: c.trim() && !
|
|
1634
|
+
cursor: c.trim() && !I ? "pointer" : "not-allowed",
|
|
1761
1635
|
display: "flex",
|
|
1762
1636
|
alignItems: "center",
|
|
1763
1637
|
gap: "6px",
|
|
1764
1638
|
transition: "all 0.15s ease"
|
|
1765
1639
|
},
|
|
1766
1640
|
onMouseEnter: (n) => {
|
|
1767
|
-
c.trim() && !
|
|
1641
|
+
c.trim() && !I && (n.currentTarget.style.background = "rgba(94, 136, 176, 1)");
|
|
1768
1642
|
},
|
|
1769
1643
|
onMouseLeave: (n) => {
|
|
1770
|
-
c.trim() && !
|
|
1644
|
+
c.trim() && !I && (n.currentTarget.style.background = "rgba(94, 136, 176, 0.85)");
|
|
1771
1645
|
},
|
|
1772
|
-
children:
|
|
1646
|
+
children: I ? /* @__PURE__ */ l(ie, { children: [
|
|
1773
1647
|
/* @__PURE__ */ e("style", { children: `
|
|
1774
1648
|
@keyframes messageSpin {
|
|
1775
1649
|
from { transform: rotate(0deg); }
|
|
@@ -1790,8 +1664,8 @@ function Ge({
|
|
|
1790
1664
|
}
|
|
1791
1665
|
),
|
|
1792
1666
|
"Sending..."
|
|
1793
|
-
] }) : /* @__PURE__ */
|
|
1794
|
-
/* @__PURE__ */ e(
|
|
1667
|
+
] }) : /* @__PURE__ */ l(ie, { children: [
|
|
1668
|
+
/* @__PURE__ */ e(he, { size: 14 }),
|
|
1795
1669
|
"Send"
|
|
1796
1670
|
] })
|
|
1797
1671
|
}
|
|
@@ -1805,7 +1679,7 @@ function Ge({
|
|
|
1805
1679
|
]
|
|
1806
1680
|
}
|
|
1807
1681
|
),
|
|
1808
|
-
/* @__PURE__ */
|
|
1682
|
+
/* @__PURE__ */ l(
|
|
1809
1683
|
"div",
|
|
1810
1684
|
{
|
|
1811
1685
|
style: {
|
|
@@ -1860,9 +1734,8 @@ function Ge({
|
|
|
1860
1734
|
);
|
|
1861
1735
|
}
|
|
1862
1736
|
export {
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
Ze as a
|
|
1737
|
+
Ye as C,
|
|
1738
|
+
Ue as M,
|
|
1739
|
+
Ke as a
|
|
1867
1740
|
};
|
|
1868
1741
|
//# sourceMappingURL=MessageThread.es.js.map
|