juneau 0.14.1 → 0.16.0
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/README.md +28 -0
- package/dist/components/AiChat/AiChat.d.ts +15 -1
- package/dist/components/AiChat/AiChat.d.ts.map +1 -1
- package/dist/components/AiInput/AiInput.d.ts.map +1 -1
- package/dist/components/AiSidebar/AiSidebar.d.ts +6 -1
- package/dist/components/AiSidebar/AiSidebar.d.ts.map +1 -1
- package/dist/index.cjs +21 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +746 -710
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
import { jsx as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
function
|
|
6
|
-
return e.map((t) => t.role !== "assistant" || t.parts.some((
|
|
1
|
+
import { useState as W, useRef as U, useEffect as ce, useCallback as z, useMemo as _e, useContext as le, createContext as be } from "react";
|
|
2
|
+
import { jsx as a, jsxs as m, Fragment as ve } from "react/jsx-runtime";
|
|
3
|
+
import Ae from "react-markdown";
|
|
4
|
+
import ze from "remark-gfm";
|
|
5
|
+
function Me(e) {
|
|
6
|
+
return e.map((t) => t.role !== "assistant" || t.parts.some((n) => n.type === "text") ? t : { ...t, parts: [{ type: "text", text: "" }] });
|
|
7
7
|
}
|
|
8
|
-
const
|
|
9
|
-
function
|
|
8
|
+
const _ = (e) => new Promise((t) => setTimeout(t, e));
|
|
9
|
+
function Ie(e) {
|
|
10
10
|
return e.parts.filter((t) => t.type === "text").map((t) => t.text).join("");
|
|
11
11
|
}
|
|
12
|
-
async function
|
|
12
|
+
async function pe(e, t, n) {
|
|
13
13
|
for await (const r of e)
|
|
14
|
-
if (
|
|
14
|
+
if (n?.aborted || (t(r), r.type === "done" || r.type === "error")) break;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function we(e) {
|
|
17
17
|
return e.type === "proposal";
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function cn(e) {
|
|
20
20
|
return e.type === "chart" && Array.isArray(e.series);
|
|
21
21
|
}
|
|
22
|
-
const
|
|
23
|
-
function
|
|
22
|
+
const Te = 1;
|
|
23
|
+
function ln(e) {
|
|
24
24
|
return e.map((t) => ({
|
|
25
25
|
...t,
|
|
26
|
-
v:
|
|
26
|
+
v: Te,
|
|
27
27
|
createdAt: t.createdAt.toISOString(),
|
|
28
|
-
parts: t.parts.filter((
|
|
28
|
+
parts: t.parts.filter((n) => !(n.type === "activity" && n.status === "running")).map(Le)
|
|
29
29
|
}));
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
return
|
|
31
|
+
function Le(e) {
|
|
32
|
+
return we(e) && !e.proposal.resolved ? { ...e, proposal: { ...e.proposal, resolved: "expired" } } : e;
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
return e.map(({ v: t, ...
|
|
36
|
-
...
|
|
37
|
-
createdAt: new Date(
|
|
34
|
+
function dn(e) {
|
|
35
|
+
return e.map(({ v: t, ...n }) => ({
|
|
36
|
+
...n,
|
|
37
|
+
createdAt: new Date(n.createdAt)
|
|
38
38
|
}));
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function Be(e, t) {
|
|
41
41
|
if (t <= 0 || e.length <= t) return e;
|
|
42
|
-
let
|
|
43
|
-
for (;
|
|
44
|
-
|
|
45
|
-
return e.slice(
|
|
42
|
+
let n = e.length - t;
|
|
43
|
+
for (; n < e.length && e[n].role === "assistant"; )
|
|
44
|
+
n++;
|
|
45
|
+
return e.slice(n);
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
return t <= 0 || e.length <= t ? [...e].sort(
|
|
47
|
+
function un(e, t) {
|
|
48
|
+
return t <= 0 || e.length <= t ? [...e].sort(ye) : [...e].sort(ye).slice(0, t);
|
|
49
49
|
}
|
|
50
|
-
const
|
|
50
|
+
const ye = (e, t) => t.updatedAt.getTime() - e.updatedAt.getTime(), pn = {
|
|
51
51
|
async *sendMessage(e) {
|
|
52
|
-
const t = [...e.messages].reverse().find((r) => r.role === "user"),
|
|
53
|
-
|
|
52
|
+
const t = [...e.messages].reverse().find((r) => r.role === "user"), n = t ? Ie(t).toLowerCase() : "";
|
|
53
|
+
n.includes("activity") || n.includes("progress") || n.includes("document") || n.includes("dokument") ? yield* $e() : n.includes("table") || n.includes("data") || n.includes("list") || n.includes("show") ? yield* Pe() : n.includes("proposal") || n.includes("suggest") || n.includes("recommend") ? yield* De() : n.includes("entity") || n.includes("card") || n.includes("detail") || n.includes("find") ? yield* Re() : n.includes("help") || n.includes("what can") || n.includes("how do") ? yield* Ee() : n.includes("error") || n.includes("fail") || n.includes("break") ? yield* He() : yield* Ve(n);
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
|
-
async function*
|
|
56
|
+
async function* $e() {
|
|
57
57
|
yield {
|
|
58
58
|
type: "part",
|
|
59
59
|
part: {
|
|
@@ -63,7 +63,7 @@ async function* Le() {
|
|
|
63
63
|
description: "Looking for the best skill for this request.",
|
|
64
64
|
status: "running"
|
|
65
65
|
}
|
|
66
|
-
}, await
|
|
66
|
+
}, await _(700), yield {
|
|
67
67
|
type: "part",
|
|
68
68
|
part: {
|
|
69
69
|
type: "activity",
|
|
@@ -72,7 +72,7 @@ async function* Le() {
|
|
|
72
72
|
description: "Using Document Search.",
|
|
73
73
|
status: "done"
|
|
74
74
|
}
|
|
75
|
-
}, await
|
|
75
|
+
}, await _(300), yield {
|
|
76
76
|
type: "part",
|
|
77
77
|
part: {
|
|
78
78
|
type: "activity",
|
|
@@ -81,7 +81,7 @@ async function* Le() {
|
|
|
81
81
|
description: "Looking up document by ID.",
|
|
82
82
|
status: "running"
|
|
83
83
|
}
|
|
84
|
-
}, await
|
|
84
|
+
}, await _(900), yield {
|
|
85
85
|
type: "part",
|
|
86
86
|
part: {
|
|
87
87
|
type: "activity",
|
|
@@ -90,13 +90,13 @@ async function* Le() {
|
|
|
90
90
|
description: "Found document INV-2024-0894.",
|
|
91
91
|
status: "done"
|
|
92
92
|
}
|
|
93
|
-
}, await
|
|
93
|
+
}, await _(300), yield* x(`
|
|
94
94
|
Found document **INV-2024-0894** from **DataSys a.s.** for **CZK 390 000**.`, 25), yield { type: "done" };
|
|
95
95
|
}
|
|
96
|
-
async function*
|
|
96
|
+
async function* Pe() {
|
|
97
97
|
yield* x(`Here is a summary of the data you requested:
|
|
98
98
|
|
|
99
|
-
`, 30), await
|
|
99
|
+
`, 30), await _(400), yield {
|
|
100
100
|
type: "part",
|
|
101
101
|
part: {
|
|
102
102
|
type: "table",
|
|
@@ -109,13 +109,13 @@ async function* Be() {
|
|
|
109
109
|
{ Name: "Item Epsilon", Category: "Type B", Value: "2,200", Status: "Active" }
|
|
110
110
|
]
|
|
111
111
|
}
|
|
112
|
-
}, await
|
|
112
|
+
}, await _(300), yield* x(`
|
|
113
113
|
Total across all entries: **7,900** — Type A accounts for the largest share at 53%.`, 25), yield { type: "done" };
|
|
114
114
|
}
|
|
115
|
-
async function*
|
|
115
|
+
async function* De() {
|
|
116
116
|
yield* x(`Based on the current data, I have a suggestion for you:
|
|
117
117
|
|
|
118
|
-
`, 30), await
|
|
118
|
+
`, 30), await _(500), yield {
|
|
119
119
|
type: "part",
|
|
120
120
|
part: {
|
|
121
121
|
type: "proposal",
|
|
@@ -130,10 +130,10 @@ async function* Pe() {
|
|
|
130
130
|
}
|
|
131
131
|
}, yield { type: "done" };
|
|
132
132
|
}
|
|
133
|
-
async function*
|
|
133
|
+
async function* Re() {
|
|
134
134
|
yield* x(`I found these records matching your request:
|
|
135
135
|
|
|
136
|
-
`, 30), await
|
|
136
|
+
`, 30), await _(400), yield {
|
|
137
137
|
type: "part",
|
|
138
138
|
part: {
|
|
139
139
|
type: "entity-list",
|
|
@@ -162,10 +162,10 @@ async function* $e() {
|
|
|
162
162
|
}
|
|
163
163
|
]
|
|
164
164
|
}
|
|
165
|
-
}, await
|
|
165
|
+
}, await _(300), yield* x(`
|
|
166
166
|
Here is the detail of the first one:
|
|
167
167
|
|
|
168
|
-
`, 25), await
|
|
168
|
+
`, 25), await _(300), yield {
|
|
169
169
|
type: "part",
|
|
170
170
|
part: {
|
|
171
171
|
type: "entity",
|
|
@@ -184,35 +184,35 @@ Here is the detail of the first one:
|
|
|
184
184
|
}
|
|
185
185
|
}, yield { type: "done" };
|
|
186
186
|
}
|
|
187
|
-
async function*
|
|
187
|
+
async function* Ee() {
|
|
188
188
|
yield* x(`I'm a general-purpose AI assistant. Here's what I can help with:
|
|
189
189
|
|
|
190
|
-
`, 30), await
|
|
191
|
-
`, 22), await
|
|
192
|
-
`, 22), await
|
|
193
|
-
`, 22), await
|
|
190
|
+
`, 30), await _(200), yield* x(`- **Summarise data** — ask me to show, list, or summarise information
|
|
191
|
+
`, 22), await _(150), yield* x(`- **Make suggestions** — ask me to recommend or propose something
|
|
192
|
+
`, 22), await _(150), yield* x(`- **Answer questions** — ask me anything and I'll do my best
|
|
193
|
+
`, 22), await _(200), yield* x(`
|
|
194
194
|
Try asking: *"Show me the data"* or *"Can you suggest something?"*`, 25), yield { type: "done" };
|
|
195
195
|
}
|
|
196
|
-
async function*
|
|
197
|
-
yield* x("Attempting to process your request…", 30), await
|
|
196
|
+
async function* He() {
|
|
197
|
+
yield* x("Attempting to process your request…", 30), await _(800), yield { type: "error", message: "Simulated error: the upstream service returned an unexpected response." };
|
|
198
198
|
}
|
|
199
|
-
async function*
|
|
199
|
+
async function* Ve(e) {
|
|
200
200
|
yield* x(`Got it — you asked about *"${e || "your request"}"*.
|
|
201
201
|
|
|
202
|
-
`, 30), await
|
|
202
|
+
`, 30), await _(400), yield* x(`I'm a **mock adapter** used for development. I respond to a few trigger words:
|
|
203
203
|
|
|
204
|
-
`, 25), await
|
|
205
|
-
`, 22), await
|
|
206
|
-
`, 22), await
|
|
207
|
-
`, 22), await
|
|
208
|
-
`, 22), await
|
|
204
|
+
`, 25), await _(200), yield* x(`- Say **"show"**, **"list"**, **"data"**, or **"table"** → renders a data table
|
|
205
|
+
`, 22), await _(150), yield* x(`- Say **"suggest"**, **"recommend"**, or **"proposal"** → renders a proposal card
|
|
206
|
+
`, 22), await _(150), yield* x(`- Say **"entity"**, **"card"**, **"detail"**, or **"find"** → renders entity cards
|
|
207
|
+
`, 22), await _(150), yield* x(`- Say **"help"** or **"what can you do"** → shows capabilities
|
|
208
|
+
`, 22), await _(150), yield* x(`- Say **"error"** or **"fail"** → simulates an error response
|
|
209
209
|
`, 22), yield { type: "done" };
|
|
210
210
|
}
|
|
211
211
|
async function* x(e, t) {
|
|
212
212
|
for (let r = 0; r < e.length; r += 3)
|
|
213
|
-
yield { type: "text", text: e.slice(r, r + 3) }, await
|
|
213
|
+
yield { type: "text", text: e.slice(r, r + 3) }, await _(t);
|
|
214
214
|
}
|
|
215
|
-
function
|
|
215
|
+
function xe(e) {
|
|
216
216
|
if (!e || e === "[DONE]") return [];
|
|
217
217
|
let t;
|
|
218
218
|
try {
|
|
@@ -245,21 +245,21 @@ function ve(e) {
|
|
|
245
245
|
return [];
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
|
-
function
|
|
248
|
+
function yn(e, t = {}) {
|
|
249
249
|
const {
|
|
250
|
-
method:
|
|
250
|
+
method: n = "POST",
|
|
251
251
|
headers: r = {},
|
|
252
252
|
getHeaders: s,
|
|
253
|
-
getBody:
|
|
253
|
+
getBody: o,
|
|
254
254
|
getMessages: d,
|
|
255
|
-
parseEvent:
|
|
256
|
-
credentials:
|
|
255
|
+
parseEvent: i = qe,
|
|
256
|
+
credentials: c
|
|
257
257
|
} = t;
|
|
258
258
|
return {
|
|
259
259
|
async *sendMessage(u) {
|
|
260
|
-
const p = s ? await s(u) : {},
|
|
261
|
-
method:
|
|
262
|
-
credentials:
|
|
260
|
+
const p = s ? await s(u) : {}, l = d ? await d(u.messages) : u.messages, f = { ...u, messages: l }, C = o ? o(f) : { messages: f.messages, context: f.context }, y = await fetch(e, {
|
|
261
|
+
method: n,
|
|
262
|
+
credentials: c,
|
|
263
263
|
headers: {
|
|
264
264
|
"Content-Type": "application/json",
|
|
265
265
|
...r,
|
|
@@ -268,76 +268,76 @@ function ln(e, t = {}) {
|
|
|
268
268
|
body: JSON.stringify(C)
|
|
269
269
|
});
|
|
270
270
|
if (!y.ok) {
|
|
271
|
-
const
|
|
272
|
-
yield { type: "error", message: `Request failed (${y.status}): ${
|
|
271
|
+
const T = await y.text().catch(() => `HTTP ${y.status}`);
|
|
272
|
+
yield { type: "error", message: `Request failed (${y.status}): ${T}` };
|
|
273
273
|
return;
|
|
274
274
|
}
|
|
275
275
|
if (!y.body) {
|
|
276
276
|
yield { type: "error", message: "Response body is empty — server may not support streaming." };
|
|
277
277
|
return;
|
|
278
278
|
}
|
|
279
|
-
yield*
|
|
279
|
+
yield* Oe(y.body, i);
|
|
280
280
|
}
|
|
281
281
|
};
|
|
282
282
|
}
|
|
283
|
-
async function*
|
|
284
|
-
const
|
|
283
|
+
async function* Oe(e, t) {
|
|
284
|
+
const n = e.getReader(), r = new TextDecoder();
|
|
285
285
|
let s = "";
|
|
286
286
|
try {
|
|
287
287
|
for (; ; ) {
|
|
288
|
-
const { done:
|
|
289
|
-
if (
|
|
288
|
+
const { done: o, value: d } = await n.read();
|
|
289
|
+
if (o) break;
|
|
290
290
|
s += r.decode(d, { stream: !0 });
|
|
291
|
-
const
|
|
291
|
+
const i = s.split(`
|
|
292
292
|
`);
|
|
293
|
-
s =
|
|
294
|
-
for (const
|
|
295
|
-
const u =
|
|
293
|
+
s = i.pop() ?? "";
|
|
294
|
+
for (const c of i) {
|
|
295
|
+
const u = c.trim();
|
|
296
296
|
if (!(!u || u.startsWith(":")) && u.startsWith("data: ")) {
|
|
297
297
|
const p = u.slice(6);
|
|
298
298
|
if (p === "[DONE]") {
|
|
299
299
|
yield { type: "done" };
|
|
300
300
|
return;
|
|
301
301
|
}
|
|
302
|
-
const
|
|
303
|
-
for (const f of
|
|
302
|
+
const l = t(p);
|
|
303
|
+
for (const f of l)
|
|
304
304
|
if (yield f, f.type === "done" || f.type === "error") return;
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
308
|
} finally {
|
|
309
|
-
|
|
309
|
+
n.releaseLock();
|
|
310
310
|
}
|
|
311
311
|
yield { type: "done" };
|
|
312
312
|
}
|
|
313
|
-
const
|
|
313
|
+
const qe = (e) => {
|
|
314
314
|
if (!e || e === "[DONE]") return [];
|
|
315
|
-
const t =
|
|
315
|
+
const t = xe(e);
|
|
316
316
|
if (t.length > 0) return t;
|
|
317
317
|
try {
|
|
318
|
-
const
|
|
319
|
-
if (
|
|
320
|
-
return [{ type: "error", message:
|
|
321
|
-
const r =
|
|
322
|
-
return
|
|
318
|
+
const n = JSON.parse(e);
|
|
319
|
+
if (n.error?.message)
|
|
320
|
+
return [{ type: "error", message: n.error.message }];
|
|
321
|
+
const r = n.choices?.[0]?.delta;
|
|
322
|
+
return n.choices?.[0]?.finish_reason === "stop" ? [{ type: "done" }] : r?.content ? [{ type: "text", text: r.content }] : [];
|
|
323
323
|
} catch {
|
|
324
324
|
return [];
|
|
325
325
|
}
|
|
326
326
|
};
|
|
327
|
-
function
|
|
327
|
+
function mn(e, t = {}) {
|
|
328
328
|
const {
|
|
329
|
-
method:
|
|
329
|
+
method: n = "POST",
|
|
330
330
|
headers: r = {},
|
|
331
331
|
getHeaders: s,
|
|
332
|
-
getBody:
|
|
333
|
-
parseChunk: d =
|
|
334
|
-
credentials:
|
|
332
|
+
getBody: o,
|
|
333
|
+
parseChunk: d = Fe,
|
|
334
|
+
credentials: i
|
|
335
335
|
} = t;
|
|
336
336
|
return {
|
|
337
|
-
async *sendMessage(
|
|
338
|
-
const u = s ? await s(
|
|
339
|
-
method:
|
|
340
|
-
credentials:
|
|
337
|
+
async *sendMessage(c) {
|
|
338
|
+
const u = s ? await s(c) : {}, p = o ? o(c) : { messages: c.messages, context: c.context }, l = await fetch(e, {
|
|
339
|
+
method: n,
|
|
340
|
+
credentials: i,
|
|
341
341
|
headers: {
|
|
342
342
|
"Content-Type": "application/json",
|
|
343
343
|
...r,
|
|
@@ -345,241 +345,241 @@ function dn(e, t = {}) {
|
|
|
345
345
|
},
|
|
346
346
|
body: JSON.stringify(p)
|
|
347
347
|
});
|
|
348
|
-
if (!
|
|
349
|
-
const f = await
|
|
350
|
-
yield { type: "error", message: `Request failed (${
|
|
348
|
+
if (!l.ok) {
|
|
349
|
+
const f = await l.text().catch(() => `HTTP ${l.status}`);
|
|
350
|
+
yield { type: "error", message: `Request failed (${l.status}): ${f}` };
|
|
351
351
|
return;
|
|
352
352
|
}
|
|
353
|
-
if (!
|
|
353
|
+
if (!l.body) {
|
|
354
354
|
yield { type: "error", message: "Response body is empty — server may not support streaming." };
|
|
355
355
|
return;
|
|
356
356
|
}
|
|
357
|
-
yield*
|
|
357
|
+
yield* We(l.body, d);
|
|
358
358
|
}
|
|
359
359
|
};
|
|
360
360
|
}
|
|
361
|
-
async function*
|
|
362
|
-
const
|
|
361
|
+
async function* We(e, t) {
|
|
362
|
+
const n = e.getReader(), r = new TextDecoder();
|
|
363
363
|
let s = "";
|
|
364
364
|
try {
|
|
365
365
|
for (; ; ) {
|
|
366
|
-
const { done:
|
|
367
|
-
if (
|
|
366
|
+
const { done: o, value: d } = await n.read();
|
|
367
|
+
if (o) break;
|
|
368
368
|
s += r.decode(d, { stream: !0 });
|
|
369
|
-
const
|
|
369
|
+
const i = s.split(`
|
|
370
370
|
`);
|
|
371
|
-
s =
|
|
372
|
-
for (const
|
|
373
|
-
const u =
|
|
371
|
+
s = i.pop() ?? "";
|
|
372
|
+
for (const c of i) {
|
|
373
|
+
const u = c.trim();
|
|
374
374
|
if (!u) continue;
|
|
375
375
|
const p = t(u);
|
|
376
|
-
for (const
|
|
377
|
-
if (yield
|
|
376
|
+
for (const l of p)
|
|
377
|
+
if (yield l, l.type === "done" || l.type === "error") return;
|
|
378
378
|
}
|
|
379
379
|
}
|
|
380
380
|
if (s.trim()) {
|
|
381
|
-
const
|
|
382
|
-
for (const d of
|
|
381
|
+
const o = t(s.trim());
|
|
382
|
+
for (const d of o)
|
|
383
383
|
if (yield d, d.type === "done" || d.type === "error") return;
|
|
384
384
|
}
|
|
385
385
|
} finally {
|
|
386
|
-
|
|
386
|
+
n.releaseLock();
|
|
387
387
|
}
|
|
388
388
|
yield { type: "done" };
|
|
389
389
|
}
|
|
390
|
-
const
|
|
391
|
-
const t =
|
|
390
|
+
const Fe = (e) => {
|
|
391
|
+
const t = xe(e);
|
|
392
392
|
return t.length > 0 ? t : e ? [{ type: "text", text: e }] : [];
|
|
393
393
|
};
|
|
394
|
-
let
|
|
395
|
-
const
|
|
396
|
-
function
|
|
394
|
+
let Ze = 0;
|
|
395
|
+
const se = () => `msg-${++Ze}-${Date.now()}`, me = Me;
|
|
396
|
+
function Je({
|
|
397
397
|
adapter: e,
|
|
398
398
|
context: t,
|
|
399
|
-
onProposalConfirm:
|
|
399
|
+
onProposalConfirm: n,
|
|
400
400
|
onProposalCancel: r,
|
|
401
401
|
initialMessages: s,
|
|
402
|
-
historyLimit:
|
|
402
|
+
historyLimit: o,
|
|
403
403
|
onMessagesChange: d
|
|
404
404
|
}) {
|
|
405
|
-
const [
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
}),
|
|
409
|
-
!
|
|
410
|
-
}, [
|
|
411
|
-
const
|
|
412
|
-
|
|
413
|
-
const
|
|
414
|
-
if (!
|
|
415
|
-
if (
|
|
416
|
-
const w = [...
|
|
417
|
-
(N) => N.type === "activity" && N.id ===
|
|
405
|
+
const [i, c] = W(s ?? []), [u, p] = W(""), [l, f] = W(!1), [C, y] = W(!1), [T, A] = W(null), M = U(null), L = U(!1), V = U(d);
|
|
406
|
+
ce(() => {
|
|
407
|
+
V.current = d;
|
|
408
|
+
}), ce(() => {
|
|
409
|
+
!L.current || l || (L.current = !1, V.current?.(i));
|
|
410
|
+
}, [i, l]);
|
|
411
|
+
const k = z((h) => {
|
|
412
|
+
c((v) => {
|
|
413
|
+
const b = v[v.length - 1];
|
|
414
|
+
if (!b || b.role !== "assistant") return v;
|
|
415
|
+
if (h.type === "activity" && h.id) {
|
|
416
|
+
const w = [...b.parts], g = w.findIndex(
|
|
417
|
+
(N) => N.type === "activity" && N.id === h.id
|
|
418
418
|
);
|
|
419
|
-
if (
|
|
420
|
-
return w[
|
|
419
|
+
if (g !== -1)
|
|
420
|
+
return w[g] = h, [...v.slice(0, -1), { ...b, parts: w }];
|
|
421
421
|
}
|
|
422
422
|
return [
|
|
423
423
|
...v.slice(0, -1),
|
|
424
|
-
{ ...
|
|
424
|
+
{ ...b, parts: [...b.parts, h] }
|
|
425
425
|
];
|
|
426
426
|
});
|
|
427
|
-
}, []),
|
|
428
|
-
|
|
429
|
-
const
|
|
430
|
-
if (!
|
|
431
|
-
const w = [...
|
|
432
|
-
return
|
|
427
|
+
}, []), S = z((h) => {
|
|
428
|
+
c((v) => {
|
|
429
|
+
const b = v[v.length - 1];
|
|
430
|
+
if (!b || b.role !== "assistant") return v;
|
|
431
|
+
const w = [...b.parts], g = w[w.length - 1];
|
|
432
|
+
return g?.type === "text" ? w[w.length - 1] = { type: "text", text: g.text + h } : w.push({ type: "text", text: h }), [...v.slice(0, -1), { ...b, parts: w }];
|
|
433
433
|
});
|
|
434
|
-
}, []),
|
|
434
|
+
}, []), $ = z(async (h, v) => {
|
|
435
435
|
A(null);
|
|
436
|
-
const
|
|
437
|
-
id:
|
|
436
|
+
const b = {
|
|
437
|
+
id: se(),
|
|
438
438
|
role: "user",
|
|
439
|
-
parts: [{ type: "text", text:
|
|
439
|
+
parts: [{ type: "text", text: h }],
|
|
440
440
|
createdAt: /* @__PURE__ */ new Date()
|
|
441
|
-
}, w =
|
|
442
|
-
let
|
|
441
|
+
}, w = se();
|
|
442
|
+
let g = !1;
|
|
443
443
|
const N = () => {
|
|
444
|
-
if (
|
|
445
|
-
|
|
446
|
-
const
|
|
444
|
+
if (g) return;
|
|
445
|
+
g = !0;
|
|
446
|
+
const R = {
|
|
447
447
|
id: w,
|
|
448
448
|
role: "assistant",
|
|
449
449
|
parts: [],
|
|
450
450
|
createdAt: /* @__PURE__ */ new Date()
|
|
451
451
|
};
|
|
452
|
-
|
|
452
|
+
c((Z) => [...Z, R]);
|
|
453
453
|
};
|
|
454
|
-
|
|
455
|
-
const
|
|
456
|
-
|
|
454
|
+
c((R) => [...R, b]), f(!0), y(!0), M.current?.abort();
|
|
455
|
+
const ue = new AbortController();
|
|
456
|
+
M.current = ue;
|
|
457
457
|
try {
|
|
458
|
-
const
|
|
459
|
-
[...v,
|
|
460
|
-
|
|
461
|
-
),
|
|
462
|
-
await
|
|
463
|
-
|
|
464
|
-
(
|
|
465
|
-
switch (y(!1),
|
|
458
|
+
const R = Be(
|
|
459
|
+
[...v, b],
|
|
460
|
+
o ?? Number.POSITIVE_INFINITY
|
|
461
|
+
), Z = e.sendMessage({ messages: me(R), context: t });
|
|
462
|
+
await pe(
|
|
463
|
+
Z,
|
|
464
|
+
(K) => {
|
|
465
|
+
switch (y(!1), K.type) {
|
|
466
466
|
case "text":
|
|
467
|
-
N(),
|
|
467
|
+
N(), S(K.text);
|
|
468
468
|
break;
|
|
469
469
|
case "part":
|
|
470
|
-
N(),
|
|
470
|
+
N(), k(K.part);
|
|
471
471
|
break;
|
|
472
472
|
case "error":
|
|
473
|
-
N(),
|
|
473
|
+
N(), k({ type: "error", message: K.message }), A(K.message);
|
|
474
474
|
break;
|
|
475
475
|
case "done":
|
|
476
476
|
break;
|
|
477
477
|
}
|
|
478
478
|
},
|
|
479
|
-
|
|
479
|
+
ue.signal
|
|
480
480
|
);
|
|
481
|
-
} catch (
|
|
482
|
-
const
|
|
483
|
-
A(
|
|
481
|
+
} catch (R) {
|
|
482
|
+
const Z = R instanceof Error ? R.message : "Unknown error occurred";
|
|
483
|
+
A(Z), N(), k({ type: "error", message: Z });
|
|
484
484
|
} finally {
|
|
485
|
-
|
|
485
|
+
L.current = !0, f(!1), y(!1);
|
|
486
486
|
}
|
|
487
|
-
}, [e, t,
|
|
488
|
-
const
|
|
489
|
-
!
|
|
490
|
-
}, [u,
|
|
491
|
-
!
|
|
492
|
-
}, [
|
|
493
|
-
if (
|
|
487
|
+
}, [e, t, o, S, k]), O = z(async () => {
|
|
488
|
+
const h = u.trim();
|
|
489
|
+
!h || l || (p(""), await $(h, i));
|
|
490
|
+
}, [u, l, i, $]), q = z(async (h) => {
|
|
491
|
+
!h.trim() || l || await $(h, i);
|
|
492
|
+
}, [l, i, $]), X = z(async (h) => {
|
|
493
|
+
if (l) return;
|
|
494
494
|
A(null), f(!0), y(!0);
|
|
495
495
|
const v = {
|
|
496
|
-
id:
|
|
496
|
+
id: se(),
|
|
497
497
|
role: "assistant",
|
|
498
498
|
parts: [],
|
|
499
499
|
createdAt: /* @__PURE__ */ new Date()
|
|
500
500
|
};
|
|
501
|
-
|
|
502
|
-
const
|
|
503
|
-
|
|
501
|
+
c((g) => [...g, v]), M.current?.abort();
|
|
502
|
+
const b = new AbortController();
|
|
503
|
+
M.current = b;
|
|
504
504
|
const w = {
|
|
505
|
-
id:
|
|
505
|
+
id: se(),
|
|
506
506
|
role: "system",
|
|
507
|
-
parts: [{ type: "text", text:
|
|
507
|
+
parts: [{ type: "text", text: h }],
|
|
508
508
|
createdAt: /* @__PURE__ */ new Date()
|
|
509
509
|
};
|
|
510
510
|
try {
|
|
511
|
-
const
|
|
512
|
-
await
|
|
513
|
-
|
|
511
|
+
const g = e.sendMessage({ messages: me([w]), context: t });
|
|
512
|
+
await pe(
|
|
513
|
+
g,
|
|
514
514
|
(N) => {
|
|
515
515
|
switch (y(!1), N.type) {
|
|
516
516
|
case "text":
|
|
517
|
-
|
|
517
|
+
S(N.text);
|
|
518
518
|
break;
|
|
519
519
|
case "part":
|
|
520
|
-
|
|
520
|
+
k(N.part);
|
|
521
521
|
break;
|
|
522
522
|
case "error":
|
|
523
|
-
|
|
523
|
+
k({ type: "error", message: N.message }), A(N.message);
|
|
524
524
|
break;
|
|
525
525
|
case "done":
|
|
526
526
|
break;
|
|
527
527
|
}
|
|
528
528
|
},
|
|
529
|
-
|
|
529
|
+
b.signal
|
|
530
530
|
);
|
|
531
|
-
} catch (
|
|
532
|
-
const N =
|
|
533
|
-
A(N),
|
|
531
|
+
} catch (g) {
|
|
532
|
+
const N = g instanceof Error ? g.message : "Unknown error occurred";
|
|
533
|
+
A(N), k({ type: "error", message: N });
|
|
534
534
|
} finally {
|
|
535
|
-
|
|
535
|
+
L.current = !0, f(!1), y(!1);
|
|
536
536
|
}
|
|
537
|
-
}, [
|
|
538
|
-
|
|
539
|
-
}, []),
|
|
540
|
-
|
|
541
|
-
}, []),
|
|
542
|
-
|
|
537
|
+
}, [l, e, t, S, k]), ee = z(() => {
|
|
538
|
+
M.current?.abort(), f(!1), y(!1);
|
|
539
|
+
}, []), te = z((h) => {
|
|
540
|
+
M.current?.abort(), L.current = !0, c(h ?? []), p(""), A(null), f(!1), y(!1);
|
|
541
|
+
}, []), F = z((h, v) => {
|
|
542
|
+
L.current = !0, c((b) => b.map((w) => ({
|
|
543
543
|
...w,
|
|
544
544
|
parts: w.parts.map(
|
|
545
|
-
(
|
|
545
|
+
(g) => we(g) && g.proposal.id === h ? { ...g, proposal: { ...g.proposal, resolved: v } } : g
|
|
546
546
|
)
|
|
547
547
|
})));
|
|
548
|
-
}, []),
|
|
549
|
-
|
|
550
|
-
}, [
|
|
551
|
-
|
|
552
|
-
}, [r,
|
|
553
|
-
return
|
|
554
|
-
messages:
|
|
548
|
+
}, []), ae = z((h, v) => {
|
|
549
|
+
F(h, "confirmed"), n?.(h, v);
|
|
550
|
+
}, [n, F]), ne = z((h) => {
|
|
551
|
+
F(h, "cancelled"), r?.(h);
|
|
552
|
+
}, [r, F]);
|
|
553
|
+
return _e(() => ({
|
|
554
|
+
messages: i,
|
|
555
555
|
input: u,
|
|
556
556
|
setInput: p,
|
|
557
|
-
sendMessage:
|
|
558
|
-
sendMessageWithText:
|
|
559
|
-
sendGreeting:
|
|
560
|
-
stop:
|
|
561
|
-
isLoading:
|
|
557
|
+
sendMessage: O,
|
|
558
|
+
sendMessageWithText: q,
|
|
559
|
+
sendGreeting: X,
|
|
560
|
+
stop: ee,
|
|
561
|
+
isLoading: l,
|
|
562
562
|
isConnecting: C,
|
|
563
|
-
error:
|
|
564
|
-
reset:
|
|
565
|
-
confirmProposal:
|
|
566
|
-
cancelProposal:
|
|
563
|
+
error: T,
|
|
564
|
+
reset: te,
|
|
565
|
+
confirmProposal: ae,
|
|
566
|
+
cancelProposal: ne
|
|
567
567
|
}), [
|
|
568
|
-
|
|
568
|
+
i,
|
|
569
569
|
u,
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
Y,
|
|
570
|
+
O,
|
|
571
|
+
q,
|
|
573
572
|
X,
|
|
574
|
-
c,
|
|
575
|
-
C,
|
|
576
|
-
M,
|
|
577
573
|
ee,
|
|
574
|
+
l,
|
|
575
|
+
C,
|
|
576
|
+
T,
|
|
578
577
|
te,
|
|
579
|
-
ae
|
|
578
|
+
ae,
|
|
579
|
+
ne
|
|
580
580
|
]);
|
|
581
581
|
}
|
|
582
|
-
const
|
|
582
|
+
const Ce = {
|
|
583
583
|
sidebarTitle: "AI Assistant",
|
|
584
584
|
clearConversation: "Clear conversation",
|
|
585
585
|
resetConversation: "Reset conversation",
|
|
@@ -606,29 +606,29 @@ const we = {
|
|
|
606
606
|
actionRules: "Rules",
|
|
607
607
|
historyEmpty: "No previous chats",
|
|
608
608
|
historyDeleteChat: "Delete chat"
|
|
609
|
-
},
|
|
610
|
-
function
|
|
611
|
-
return
|
|
609
|
+
}, Ne = be(Ce);
|
|
610
|
+
function H() {
|
|
611
|
+
return le(Ne);
|
|
612
612
|
}
|
|
613
|
-
const
|
|
614
|
-
root:
|
|
613
|
+
const Ue = "_root_14q8g_1", Ke = {
|
|
614
|
+
root: Ue
|
|
615
615
|
};
|
|
616
|
-
function
|
|
616
|
+
function hn({ children: e, theme: t, labels: n, defaultTitle: r, className: s, style: o }) {
|
|
617
617
|
const d = {
|
|
618
|
-
...
|
|
618
|
+
...Ce,
|
|
619
619
|
...r ? { sidebarTitle: r } : {},
|
|
620
|
-
...
|
|
621
|
-
},
|
|
622
|
-
return /* @__PURE__ */
|
|
620
|
+
...n
|
|
621
|
+
}, i = t ? Ge(t) : void 0;
|
|
622
|
+
return /* @__PURE__ */ a(Ne.Provider, { value: d, children: /* @__PURE__ */ a(
|
|
623
623
|
"div",
|
|
624
624
|
{
|
|
625
|
-
className: [
|
|
626
|
-
style: { ...
|
|
625
|
+
className: [Ke.root, s].filter(Boolean).join(" "),
|
|
626
|
+
style: { ...i, ...o },
|
|
627
627
|
children: e
|
|
628
628
|
}
|
|
629
629
|
) });
|
|
630
630
|
}
|
|
631
|
-
function
|
|
631
|
+
function Ge(e) {
|
|
632
632
|
const t = {
|
|
633
633
|
"--juneau-color-primary": e.colorPrimary,
|
|
634
634
|
"--juneau-color-primary-dark": e.colorPrimaryDark,
|
|
@@ -674,48 +674,48 @@ function Ue(e) {
|
|
|
674
674
|
"--juneau-transition-fast": e.transitionFast
|
|
675
675
|
};
|
|
676
676
|
return Object.fromEntries(
|
|
677
|
-
Object.entries(t).filter(([,
|
|
677
|
+
Object.entries(t).filter(([, n]) => n !== void 0)
|
|
678
678
|
);
|
|
679
679
|
}
|
|
680
|
-
const
|
|
681
|
-
function
|
|
682
|
-
const e =
|
|
680
|
+
const de = be(null);
|
|
681
|
+
function Qe() {
|
|
682
|
+
const e = le(de);
|
|
683
683
|
if (!e)
|
|
684
684
|
throw new Error(
|
|
685
685
|
"useAiChatContext must be used inside <AiChatProvider>. Wrap your app (or layout) with <AiChatProvider adapter={...}>."
|
|
686
686
|
);
|
|
687
687
|
return e;
|
|
688
688
|
}
|
|
689
|
-
function
|
|
690
|
-
return
|
|
689
|
+
function fn() {
|
|
690
|
+
return le(de);
|
|
691
691
|
}
|
|
692
|
-
function
|
|
692
|
+
function gn({
|
|
693
693
|
adapter: e,
|
|
694
694
|
context: t,
|
|
695
|
-
onProposalConfirm:
|
|
695
|
+
onProposalConfirm: n,
|
|
696
696
|
onProposalCancel: r,
|
|
697
697
|
initialMessages: s,
|
|
698
|
-
historyLimit:
|
|
698
|
+
historyLimit: o,
|
|
699
699
|
onMessagesChange: d,
|
|
700
|
-
children:
|
|
700
|
+
children: i
|
|
701
701
|
}) {
|
|
702
|
-
const [
|
|
702
|
+
const [c, u] = W(t), p = z((C) => {
|
|
703
703
|
u(typeof C == "function" ? (y) => C(y) : C);
|
|
704
|
-
}, []),
|
|
704
|
+
}, []), l = Je({
|
|
705
705
|
adapter: e,
|
|
706
|
-
context:
|
|
707
|
-
onProposalConfirm:
|
|
706
|
+
context: c,
|
|
707
|
+
onProposalConfirm: n,
|
|
708
708
|
onProposalCancel: r,
|
|
709
709
|
initialMessages: s,
|
|
710
|
-
historyLimit:
|
|
710
|
+
historyLimit: o,
|
|
711
711
|
onMessagesChange: d
|
|
712
|
-
}), f =
|
|
713
|
-
() => ({ ...
|
|
714
|
-
[
|
|
712
|
+
}), f = _e(
|
|
713
|
+
() => ({ ...l, setContext: p }),
|
|
714
|
+
[l, p]
|
|
715
715
|
);
|
|
716
|
-
return /* @__PURE__ */
|
|
716
|
+
return /* @__PURE__ */ a(de.Provider, { value: f, children: i });
|
|
717
717
|
}
|
|
718
|
-
const
|
|
718
|
+
const _n = {
|
|
719
719
|
sidebarTitle: "AI Asistent",
|
|
720
720
|
clearConversation: "Vymazat konverzaci",
|
|
721
721
|
resetConversation: "Resetovat konverzaci",
|
|
@@ -743,8 +743,8 @@ const mn = {
|
|
|
743
743
|
historyEmpty: "Žádné předchozí konverzace",
|
|
744
744
|
historyDeleteChat: "Smazat konverzaci"
|
|
745
745
|
};
|
|
746
|
-
function
|
|
747
|
-
return /* @__PURE__ */
|
|
746
|
+
function je({ className: e, style: t, "aria-hidden": n = !0 }) {
|
|
747
|
+
return /* @__PURE__ */ a(
|
|
748
748
|
"svg",
|
|
749
749
|
{
|
|
750
750
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -754,13 +754,13 @@ function Ce({ className: e, style: t, "aria-hidden": a = !0 }) {
|
|
|
754
754
|
fill: "currentColor",
|
|
755
755
|
className: e,
|
|
756
756
|
style: t,
|
|
757
|
-
"aria-hidden":
|
|
758
|
-
children: /* @__PURE__ */
|
|
757
|
+
"aria-hidden": n,
|
|
758
|
+
children: /* @__PURE__ */ a("path", { d: "M456 0c-48.6 0-88 39.4-88 88l0 29.2L12.5 390.6c-14 10.8-16.6 30.9-5.9 44.9s30.9 16.6 44.9 5.9L126.1 384l133.1 0 46.6 113.1c5 12.3 19.1 18.1 31.3 13.1s18.1-19.1 13.1-31.3L311.1 384l40.9 0c1.1 0 2.1 0 3.2 0l46.6 113.2c5 12.3 19.1 18.1 31.3 13.1s18.1-19.1 13.1-31.3l-42-102C484.9 354.1 544 280 544 192l0-64 0-8 80.5-20.1c8.6-2.1 13.8-10.8 11.6-19.4C629 52 603.4 32 574 32l-50.1 0C507.7 12.5 483.3 0 456 0zm0 64a24 24 0 1 1 0 48 24 24 0 1 1 0-48z" })
|
|
759
759
|
}
|
|
760
760
|
);
|
|
761
761
|
}
|
|
762
|
-
function
|
|
763
|
-
return /* @__PURE__ */
|
|
762
|
+
function Ye({ className: e, style: t, "aria-hidden": n = !0 }) {
|
|
763
|
+
return /* @__PURE__ */ a(
|
|
764
764
|
"svg",
|
|
765
765
|
{
|
|
766
766
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -770,13 +770,13 @@ function Ge({ className: e, style: t, "aria-hidden": a = !0 }) {
|
|
|
770
770
|
fill: "currentColor",
|
|
771
771
|
className: e,
|
|
772
772
|
style: t,
|
|
773
|
-
"aria-hidden":
|
|
774
|
-
children: /* @__PURE__ */
|
|
773
|
+
"aria-hidden": n,
|
|
774
|
+
children: /* @__PURE__ */ a("path", { d: "M498.1 5.6c10.1 7 15.4 19.1 13.5 31.2l-64 416c-1.5 9.7-7.4 18.2-16 23s-18.9 5.4-28 1.6L284 427.7l-68.5 74.1c-8.9 9.7-22.9 12.9-35.2 8.1S160 493.2 160 480V396.4c0-4 1.5-7.8 4.2-10.8L331.8 202.8c5.8-6.3 5.6-16-.4-22s-15.7-6.4-22-.7L106 360.8 17.7 316.6C7.1 311.3 .3 300.7 0 288.9s6.2-22.8 16.4-28.7l448-256c10.7-6.1 23.9-5.5 34 1.4z" })
|
|
775
775
|
}
|
|
776
776
|
);
|
|
777
777
|
}
|
|
778
|
-
function
|
|
779
|
-
return /* @__PURE__ */
|
|
778
|
+
function Xe({ className: e, style: t, "aria-hidden": n = !0 }) {
|
|
779
|
+
return /* @__PURE__ */ a(
|
|
780
780
|
"svg",
|
|
781
781
|
{
|
|
782
782
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -786,13 +786,13 @@ function Qe({ className: e, style: t, "aria-hidden": a = !0 }) {
|
|
|
786
786
|
fill: "currentColor",
|
|
787
787
|
className: e,
|
|
788
788
|
style: t,
|
|
789
|
-
"aria-hidden":
|
|
790
|
-
children: /* @__PURE__ */
|
|
789
|
+
"aria-hidden": n,
|
|
790
|
+
children: /* @__PURE__ */ a("path", { d: "M364.2 83.8c-24.4-24.4-64-24.4-88.4 0l-184 184c-42.1 42.1-42.1 110.3 0 152.4s110.3 42.1 152.4 0l152-152c10.9-10.9 28.7-10.9 39.6 0s10.9 28.7 0 39.6l-152 152c-64 64-167.6 64-231.6 0s-64-167.6 0-231.6l184-184c46.3-46.3 121.3-46.3 167.6 0s46.3 121.3 0 167.6l-176 176c-28.6 28.6-75 28.6-103.6 0s-28.6-75 0-103.6l144-144c10.9-10.9 28.7-10.9 39.6 0s10.9 28.7 0 39.6l-144 144c-6.7 6.7-6.7 17.7 0 24.4s17.7 6.7 24.4 0l176-176c24.4-24.4 24.4-64 0-88.4z" })
|
|
791
791
|
}
|
|
792
792
|
);
|
|
793
793
|
}
|
|
794
|
-
function
|
|
795
|
-
return /* @__PURE__ */
|
|
794
|
+
function et({ className: e, style: t, "aria-hidden": n = !0 }) {
|
|
795
|
+
return /* @__PURE__ */ a(
|
|
796
796
|
"svg",
|
|
797
797
|
{
|
|
798
798
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -802,13 +802,13 @@ function Ye({ className: e, style: t, "aria-hidden": a = !0 }) {
|
|
|
802
802
|
fill: "currentColor",
|
|
803
803
|
className: e,
|
|
804
804
|
style: t,
|
|
805
|
-
"aria-hidden":
|
|
806
|
-
children: /* @__PURE__ */
|
|
805
|
+
"aria-hidden": n,
|
|
806
|
+
children: /* @__PURE__ */ a("path", { d: "M349.4 44.6c5.9-13.7 1.5-29.7-10.6-38.5s-28.6-8-39.9 1.8l-256 224c-10 8.8-13.6 22.9-8.9 35.3S50.7 288 64 288l111.5 0L98.6 467.4c-5.9 13.7-1.5 29.7 10.6 38.5s28.6 8 39.9-1.8l256-224c10-8.8 13.6-22.9 8.9-35.3s-16.6-20.7-30-20.7l-111.5 0L349.4 44.6z" })
|
|
807
807
|
}
|
|
808
808
|
);
|
|
809
809
|
}
|
|
810
|
-
function
|
|
811
|
-
return /* @__PURE__ */
|
|
810
|
+
function tt({ className: e, style: t, "aria-hidden": n = !0 }) {
|
|
811
|
+
return /* @__PURE__ */ a(
|
|
812
812
|
"svg",
|
|
813
813
|
{
|
|
814
814
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -818,13 +818,13 @@ function Xe({ className: e, style: t, "aria-hidden": a = !0 }) {
|
|
|
818
818
|
fill: "currentColor",
|
|
819
819
|
className: e,
|
|
820
820
|
style: t,
|
|
821
|
-
"aria-hidden":
|
|
822
|
-
children: /* @__PURE__ */
|
|
821
|
+
"aria-hidden": n,
|
|
822
|
+
children: /* @__PURE__ */ a("path", { d: "M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 144L48 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l144 0 0 144c0 17.7 14.3 32 32 32s32-14.3 32-32l0-144 144 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-144 0 0-144z" })
|
|
823
823
|
}
|
|
824
824
|
);
|
|
825
825
|
}
|
|
826
|
-
function
|
|
827
|
-
return /* @__PURE__ */
|
|
826
|
+
function at({ className: e, style: t, "aria-hidden": n = !0 }) {
|
|
827
|
+
return /* @__PURE__ */ a(
|
|
828
828
|
"svg",
|
|
829
829
|
{
|
|
830
830
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -834,13 +834,13 @@ function et({ className: e, style: t, "aria-hidden": a = !0 }) {
|
|
|
834
834
|
fill: "currentColor",
|
|
835
835
|
className: e,
|
|
836
836
|
style: t,
|
|
837
|
-
"aria-hidden":
|
|
838
|
-
children: /* @__PURE__ */
|
|
837
|
+
"aria-hidden": n,
|
|
838
|
+
children: /* @__PURE__ */ a("path", { d: "M75 75L41 41C25.9 25.9 0 36.6 0 57.9L0 168c0 13.3 10.7 24 24 24l110.1 0c21.4 0 32.1-25.9 17-41l-31.8-31.8C143.9 83.5 196.2 64 252.6 64C370.8 64 464 157.8 464 276c0 77.5-40.8 145.4-102 182.9c-15.1 9.2-19.9 29-10.7 44.1s29 19.9 44.1 10.7C471 467.5 528 378.4 528 276C528 124.1 404.5 0 252.6 0C186 0 125.3 26.4 80 70.2L75 75zM256 152c-13.3 0-24 10.7-24 24l0 104c0 6.4 2.5 12.5 7 17l72 72c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-65-65 0-94.1c0-13.3-10.7-24-24-24z" })
|
|
839
839
|
}
|
|
840
840
|
);
|
|
841
841
|
}
|
|
842
|
-
function
|
|
843
|
-
return /* @__PURE__ */
|
|
842
|
+
function nt({ className: e, style: t, "aria-hidden": n = !0 }) {
|
|
843
|
+
return /* @__PURE__ */ a(
|
|
844
844
|
"svg",
|
|
845
845
|
{
|
|
846
846
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -850,13 +850,13 @@ function tt({ className: e, style: t, "aria-hidden": a = !0 }) {
|
|
|
850
850
|
fill: "currentColor",
|
|
851
851
|
className: e,
|
|
852
852
|
style: t,
|
|
853
|
-
"aria-hidden":
|
|
854
|
-
children: /* @__PURE__ */
|
|
853
|
+
"aria-hidden": n,
|
|
854
|
+
children: /* @__PURE__ */ a("path", { d: "M0 80C0 53.5 21.5 32 48 32l96 0c26.5 0 48 21.5 48 48l0 16 192 0 0-16c0-26.5 21.5-48 48-48l96 0c26.5 0 48 21.5 48 48l0 96c0 26.5-21.5 48-48 48l-26.6 0c-25.8 50.9-72.7 88.5-129.4 99.8L384 416l32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l32 0 0-72.2C135.3 332.5 88.4 294.9 62.6 244L48 244c-26.5 0-48-21.5-48-48L0 80zM128 240c0 70.7 57.3 128 128 128s128-57.3 128-128l0-128L128 112l0 128zM512 176l0-64-64 0 0 64-48 0 0 16c0 8.8-.7 17.4-2 25.8c3.3 .1 6.6 .2 9.9 .2l56 0c26.5 0 48-21.5 48-48l0-64zM48 176c0 26.5 21.5 48 48 48l56 0c3.4 0 6.7-.1 9.9-.2c-1.3-8.4-2-17-2-25.8l0-16-48 0 0-64-64 0 0 58z" })
|
|
855
855
|
}
|
|
856
856
|
);
|
|
857
857
|
}
|
|
858
|
-
function
|
|
859
|
-
return /* @__PURE__ */
|
|
858
|
+
function st({ className: e, style: t, "aria-hidden": n = !0 }) {
|
|
859
|
+
return /* @__PURE__ */ a(
|
|
860
860
|
"svg",
|
|
861
861
|
{
|
|
862
862
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -866,13 +866,13 @@ function at({ className: e, style: t, "aria-hidden": a = !0 }) {
|
|
|
866
866
|
fill: "currentColor",
|
|
867
867
|
className: e,
|
|
868
868
|
style: t,
|
|
869
|
-
"aria-hidden":
|
|
870
|
-
children: /* @__PURE__ */
|
|
869
|
+
"aria-hidden": n,
|
|
870
|
+
children: /* @__PURE__ */ a("path", { d: "M32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l448 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 416z" })
|
|
871
871
|
}
|
|
872
872
|
);
|
|
873
873
|
}
|
|
874
|
-
function
|
|
875
|
-
return /* @__PURE__ */
|
|
874
|
+
function rt({ className: e, style: t, "aria-hidden": n = !0 }) {
|
|
875
|
+
return /* @__PURE__ */ a(
|
|
876
876
|
"svg",
|
|
877
877
|
{
|
|
878
878
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -882,13 +882,13 @@ function nt({ className: e, style: t, "aria-hidden": a = !0 }) {
|
|
|
882
882
|
fill: "currentColor",
|
|
883
883
|
className: e,
|
|
884
884
|
style: t,
|
|
885
|
-
"aria-hidden":
|
|
886
|
-
children: /* @__PURE__ */
|
|
885
|
+
"aria-hidden": n,
|
|
886
|
+
children: /* @__PURE__ */ a("path", { d: "M432 64L208 64c-8.8 0-16 7.2-16 16l0 16-64 0 0-16c0-44.2 35.8-80 80-80L432 0c44.2 0 80 35.8 80 80l0 224c0 44.2-35.8 80-80 80l-16 0 0-64 16 0c8.8 0 16-7.2 16-16l0-224c0-8.8-7.2-16-16-16zM0 192c0-35.3 28.7-64 64-64l256 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 192zm64 32c0 17.7 14.3 32 32 32l192 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L96 192c-17.7 0-32 14.3-32 32z" })
|
|
887
887
|
}
|
|
888
888
|
);
|
|
889
889
|
}
|
|
890
|
-
function
|
|
891
|
-
return /* @__PURE__ */
|
|
890
|
+
function ot({ className: e, style: t, "aria-hidden": n = !0 }) {
|
|
891
|
+
return /* @__PURE__ */ a(
|
|
892
892
|
"svg",
|
|
893
893
|
{
|
|
894
894
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -898,13 +898,13 @@ function st({ className: e, style: t, "aria-hidden": a = !0 }) {
|
|
|
898
898
|
fill: "currentColor",
|
|
899
899
|
className: e,
|
|
900
900
|
style: t,
|
|
901
|
-
"aria-hidden":
|
|
902
|
-
children: /* @__PURE__ */
|
|
901
|
+
"aria-hidden": n,
|
|
902
|
+
children: /* @__PURE__ */ a("path", { d: "M125.7 160H176c17.7 0 32 14.3 32 32s-14.3 32-32 32H48c-17.7 0-32-14.3-32-32V64c0-17.7 14.3-32 32-32s32 14.3 32 32v51.2L97.6 97.6c87.5-87.5 229.3-87.5 316.8 0s87.5 229.3 0 316.8s-229.3 87.5-316.8 0c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0c62.5 62.5 163.8 62.5 226.3 0s62.5-163.8 0-226.3s-163.8-62.5-226.3 0L125.7 160z" })
|
|
903
903
|
}
|
|
904
904
|
);
|
|
905
905
|
}
|
|
906
|
-
function
|
|
907
|
-
return /* @__PURE__ */
|
|
906
|
+
function it({ className: e, style: t, "aria-hidden": n = !0 }) {
|
|
907
|
+
return /* @__PURE__ */ a(
|
|
908
908
|
"svg",
|
|
909
909
|
{
|
|
910
910
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -914,63 +914,63 @@ function rt({ className: e, style: t, "aria-hidden": a = !0 }) {
|
|
|
914
914
|
fill: "currentColor",
|
|
915
915
|
className: e,
|
|
916
916
|
style: t,
|
|
917
|
-
"aria-hidden":
|
|
918
|
-
children: /* @__PURE__ */
|
|
917
|
+
"aria-hidden": n,
|
|
918
|
+
children: /* @__PURE__ */ a("path", { fillRule: "evenodd", d: "M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z", clipRule: "evenodd" })
|
|
919
919
|
}
|
|
920
920
|
);
|
|
921
921
|
}
|
|
922
|
-
const
|
|
923
|
-
wrapper:
|
|
924
|
-
table:
|
|
925
|
-
th:
|
|
926
|
-
tr:
|
|
927
|
-
td:
|
|
922
|
+
const ct = "_wrapper_v5oy7_1", lt = "_table_v5oy7_8", dt = "_th_v5oy7_14", ut = "_tr_v5oy7_24", pt = "_td_v5oy7_32", G = {
|
|
923
|
+
wrapper: ct,
|
|
924
|
+
table: lt,
|
|
925
|
+
th: dt,
|
|
926
|
+
tr: ut,
|
|
927
|
+
td: pt
|
|
928
928
|
};
|
|
929
|
-
function
|
|
930
|
-
return /* @__PURE__ */
|
|
931
|
-
/* @__PURE__ */
|
|
932
|
-
/* @__PURE__ */
|
|
929
|
+
function yt({ part: e }) {
|
|
930
|
+
return /* @__PURE__ */ a("div", { className: G.wrapper, "data-juneau": "table-part", children: /* @__PURE__ */ m("table", { className: G.table, children: [
|
|
931
|
+
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ a("tr", { children: e.columns.map((t) => /* @__PURE__ */ a("th", { className: G.th, children: t }, t)) }) }),
|
|
932
|
+
/* @__PURE__ */ a("tbody", { children: e.rows.map((t, n) => /* @__PURE__ */ a("tr", { className: G.tr, children: e.columns.map((r) => /* @__PURE__ */ a("td", { className: G.td, children: String(t[r] ?? "") }, r)) }, n)) })
|
|
933
933
|
] }) });
|
|
934
934
|
}
|
|
935
|
-
const
|
|
936
|
-
card:
|
|
937
|
-
header:
|
|
938
|
-
icon:
|
|
939
|
-
title:
|
|
940
|
-
description:
|
|
941
|
-
cardResolved:
|
|
942
|
-
resolvedBadge:
|
|
943
|
-
actions:
|
|
944
|
-
confirm:
|
|
945
|
-
cancel:
|
|
935
|
+
const mt = "_card_1un2m_1", ht = "_header_1un2m_9", ft = "_icon_1un2m_16", gt = "_title_1un2m_24", _t = "_description_1un2m_30", bt = "_cardResolved_1un2m_37", vt = "_resolvedBadge_1un2m_41", wt = "_actions_1un2m_52", xt = "_confirm_1un2m_57", Ct = "_cancel_1un2m_73", I = {
|
|
936
|
+
card: mt,
|
|
937
|
+
header: ht,
|
|
938
|
+
icon: ft,
|
|
939
|
+
title: gt,
|
|
940
|
+
description: _t,
|
|
941
|
+
cardResolved: bt,
|
|
942
|
+
resolvedBadge: vt,
|
|
943
|
+
actions: wt,
|
|
944
|
+
confirm: xt,
|
|
945
|
+
cancel: Ct
|
|
946
946
|
};
|
|
947
|
-
function
|
|
948
|
-
const r =
|
|
949
|
-
return /* @__PURE__ */
|
|
947
|
+
function Nt({ part: e, onConfirm: t, onCancel: n }) {
|
|
948
|
+
const r = H(), { proposal: s } = e, o = s.resolved === "confirmed" ? r.proposalConfirmed : s.resolved === "cancelled" ? r.proposalCancelled : s.resolved === "expired" ? r.proposalExpired : null;
|
|
949
|
+
return /* @__PURE__ */ m(
|
|
950
950
|
"div",
|
|
951
951
|
{
|
|
952
|
-
className: s.resolved ? `${
|
|
952
|
+
className: s.resolved ? `${I.card} ${I.cardResolved}` : I.card,
|
|
953
953
|
"data-juneau": "proposal-card",
|
|
954
954
|
children: [
|
|
955
|
-
/* @__PURE__ */
|
|
956
|
-
/* @__PURE__ */
|
|
957
|
-
/* @__PURE__ */
|
|
955
|
+
/* @__PURE__ */ m("div", { className: I.header, children: [
|
|
956
|
+
/* @__PURE__ */ a("svg", { className: I.icon, viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ a("path", { d: "M10 1a.75.75 0 01.75.75v1.5a.75.75 0 01-1.5 0v-1.5A.75.75 0 0110 1zM5.05 3.05a.75.75 0 011.06 1.06l-1.06 1.06a.75.75 0 11-1.06-1.06l1.06-1.06zm9.9 0a.75.75 0 010 1.06l-1.06 1.06a.75.75 0 11-1.06-1.06l1.06-1.06a.75.75 0 011.06 0zM10 6a4 4 0 100 8 4 4 0 000-8zm-9 4a.75.75 0 01.75-.75h1.5a.75.75 0 010 1.5h-1.5A.75.75 0 011 10zm15.75-.75a.75.75 0 000 1.5h1.5a.75.75 0 000-1.5h-1.5zM4.11 14.89a.75.75 0 010 1.06l-1.06 1.06a.75.75 0 11-1.06-1.06l1.06-1.06a.75.75 0 011.06 0zm11.84 1.06a.75.75 0 10-1.06-1.06l-1.06 1.06a.75.75 0 101.06 1.06l1.06-1.06zM10 17.25a.75.75 0 01.75.75v1.5a.75.75 0 01-1.5 0v-1.5a.75.75 0 01.75-.75z" }) }),
|
|
957
|
+
/* @__PURE__ */ a("span", { className: I.title, children: s.title })
|
|
958
958
|
] }),
|
|
959
|
-
s.description && /* @__PURE__ */
|
|
960
|
-
|
|
961
|
-
/* @__PURE__ */
|
|
959
|
+
s.description && /* @__PURE__ */ a("p", { className: I.description, children: s.description }),
|
|
960
|
+
o ? /* @__PURE__ */ a("span", { className: I.resolvedBadge, children: o }) : /* @__PURE__ */ m("div", { className: I.actions, children: [
|
|
961
|
+
/* @__PURE__ */ a(
|
|
962
962
|
"button",
|
|
963
963
|
{
|
|
964
|
-
className:
|
|
964
|
+
className: I.confirm,
|
|
965
965
|
onClick: () => t(s.id, s.payload),
|
|
966
966
|
children: s.confirmLabel ?? r.proposalConfirm
|
|
967
967
|
}
|
|
968
968
|
),
|
|
969
|
-
/* @__PURE__ */
|
|
969
|
+
/* @__PURE__ */ a(
|
|
970
970
|
"button",
|
|
971
971
|
{
|
|
972
|
-
className:
|
|
973
|
-
onClick: () =>
|
|
972
|
+
className: I.cancel,
|
|
973
|
+
onClick: () => n(s.id),
|
|
974
974
|
children: s.cancelLabel ?? r.proposalCancel
|
|
975
975
|
}
|
|
976
976
|
)
|
|
@@ -979,615 +979,651 @@ function xt({ part: e, onConfirm: t, onCancel: a }) {
|
|
|
979
979
|
}
|
|
980
980
|
);
|
|
981
981
|
}
|
|
982
|
-
const
|
|
983
|
-
activity:
|
|
984
|
-
indicator:
|
|
985
|
-
content:
|
|
986
|
-
title:
|
|
987
|
-
description:
|
|
982
|
+
const jt = "_activity_2jjfs_1", kt = "_indicator_2jjfs_13", St = "_content_2jjfs_36", At = "_title_2jjfs_40", zt = "_description_2jjfs_45", Q = {
|
|
983
|
+
activity: jt,
|
|
984
|
+
indicator: kt,
|
|
985
|
+
content: St,
|
|
986
|
+
title: At,
|
|
987
|
+
description: zt
|
|
988
988
|
};
|
|
989
|
-
function
|
|
990
|
-
return /* @__PURE__ */
|
|
991
|
-
/* @__PURE__ */
|
|
992
|
-
/* @__PURE__ */
|
|
993
|
-
/* @__PURE__ */
|
|
994
|
-
e.description && /* @__PURE__ */
|
|
989
|
+
function Mt({ part: e }) {
|
|
990
|
+
return /* @__PURE__ */ m("div", { className: Q.activity, "data-status": e.status, "data-juneau": "activity-part", children: [
|
|
991
|
+
/* @__PURE__ */ a("span", { className: Q.indicator, "aria-hidden": "true" }),
|
|
992
|
+
/* @__PURE__ */ m("div", { className: Q.content, children: [
|
|
993
|
+
/* @__PURE__ */ a("div", { className: Q.title, children: e.title }),
|
|
994
|
+
e.description && /* @__PURE__ */ a("div", { className: Q.description, children: e.description })
|
|
995
995
|
] })
|
|
996
996
|
] });
|
|
997
997
|
}
|
|
998
|
-
const
|
|
999
|
-
card:
|
|
1000
|
-
cardClickable:
|
|
1001
|
-
header:
|
|
1002
|
-
title:
|
|
1003
|
-
subtitle:
|
|
1004
|
-
fields:
|
|
1005
|
-
fieldRow:
|
|
1006
|
-
fieldLabel:
|
|
1007
|
-
fieldValue:
|
|
1008
|
-
badge:
|
|
1009
|
-
badgeSuccess:
|
|
1010
|
-
badgeWarning:
|
|
1011
|
-
badgeDanger:
|
|
1012
|
-
badgeNeutral:
|
|
1013
|
-
},
|
|
1014
|
-
success:
|
|
1015
|
-
warning:
|
|
1016
|
-
danger:
|
|
1017
|
-
neutral:
|
|
998
|
+
const It = "_card_jwkcu_1", Tt = "_cardClickable_jwkcu_14", Lt = "_header_jwkcu_24", Bt = "_title_jwkcu_30", $t = "_subtitle_jwkcu_36", Pt = "_fields_jwkcu_41", Dt = "_fieldRow_jwkcu_48", Rt = "_fieldLabel_jwkcu_55", Et = "_fieldValue_jwkcu_61", Ht = "_badge_jwkcu_68", Vt = "_badgeSuccess_jwkcu_76", Ot = "_badgeWarning_jwkcu_81", qt = "_badgeDanger_jwkcu_86", Wt = "_badgeNeutral_jwkcu_91", j = {
|
|
999
|
+
card: It,
|
|
1000
|
+
cardClickable: Tt,
|
|
1001
|
+
header: Lt,
|
|
1002
|
+
title: Bt,
|
|
1003
|
+
subtitle: $t,
|
|
1004
|
+
fields: Pt,
|
|
1005
|
+
fieldRow: Dt,
|
|
1006
|
+
fieldLabel: Rt,
|
|
1007
|
+
fieldValue: Et,
|
|
1008
|
+
badge: Ht,
|
|
1009
|
+
badgeSuccess: Vt,
|
|
1010
|
+
badgeWarning: Ot,
|
|
1011
|
+
badgeDanger: qt,
|
|
1012
|
+
badgeNeutral: Wt
|
|
1013
|
+
}, Ft = {
|
|
1014
|
+
success: j.badgeSuccess,
|
|
1015
|
+
warning: j.badgeWarning,
|
|
1016
|
+
danger: j.badgeDanger,
|
|
1017
|
+
neutral: j.badgeNeutral
|
|
1018
1018
|
};
|
|
1019
|
-
function
|
|
1020
|
-
const { entity:
|
|
1021
|
-
/* @__PURE__ */
|
|
1022
|
-
/* @__PURE__ */
|
|
1023
|
-
|
|
1019
|
+
function ke({ part: e, onEntityClick: t }) {
|
|
1020
|
+
const { entity: n, entityType: r } = e, s = t !== void 0, o = /* @__PURE__ */ m(ve, { children: [
|
|
1021
|
+
/* @__PURE__ */ m("div", { className: j.header, children: [
|
|
1022
|
+
/* @__PURE__ */ a("span", { className: j.title, children: n.title }),
|
|
1023
|
+
n.subtitle && /* @__PURE__ */ a("span", { className: j.subtitle, children: n.subtitle })
|
|
1024
1024
|
] }),
|
|
1025
|
-
|
|
1026
|
-
/* @__PURE__ */
|
|
1027
|
-
/* @__PURE__ */
|
|
1028
|
-
] },
|
|
1025
|
+
n.fields && n.fields.length > 0 && /* @__PURE__ */ a("dl", { className: j.fields, children: n.fields.map((d, i) => /* @__PURE__ */ m("div", { className: j.fieldRow, children: [
|
|
1026
|
+
/* @__PURE__ */ a("dt", { className: j.fieldLabel, children: d.label }),
|
|
1027
|
+
/* @__PURE__ */ a("dd", { className: j.fieldValue, children: d.badge ? /* @__PURE__ */ a("span", { className: `${j.badge} ${Ft[d.badge]}`, children: d.value }) : d.value })
|
|
1028
|
+
] }, i)) })
|
|
1029
1029
|
] });
|
|
1030
|
-
return s ? /* @__PURE__ */
|
|
1030
|
+
return s ? /* @__PURE__ */ a(
|
|
1031
1031
|
"button",
|
|
1032
1032
|
{
|
|
1033
1033
|
type: "button",
|
|
1034
|
-
className: `${
|
|
1035
|
-
onClick: () => t(
|
|
1034
|
+
className: `${j.card} ${j.cardClickable}`,
|
|
1035
|
+
onClick: () => t(n, r),
|
|
1036
1036
|
"data-juneau": "entity-card",
|
|
1037
|
-
children:
|
|
1037
|
+
children: o
|
|
1038
1038
|
}
|
|
1039
|
-
) : /* @__PURE__ */
|
|
1039
|
+
) : /* @__PURE__ */ a("div", { className: j.card, "data-juneau": "entity-card", children: o });
|
|
1040
1040
|
}
|
|
1041
|
-
const
|
|
1042
|
-
list:
|
|
1043
|
-
listTitle:
|
|
1041
|
+
const Zt = "_list_a2maw_1", Jt = "_listTitle_a2maw_11", he = {
|
|
1042
|
+
list: Zt,
|
|
1043
|
+
listTitle: Jt
|
|
1044
1044
|
};
|
|
1045
|
-
function
|
|
1046
|
-
return /* @__PURE__ */
|
|
1047
|
-
e.title && /* @__PURE__ */
|
|
1048
|
-
e.entities.map((
|
|
1049
|
-
|
|
1045
|
+
function Ut({ part: e, onEntityClick: t }) {
|
|
1046
|
+
return /* @__PURE__ */ m("div", { className: he.list, "data-juneau": "entity-list-part", children: [
|
|
1047
|
+
e.title && /* @__PURE__ */ a("span", { className: he.listTitle, children: e.title }),
|
|
1048
|
+
e.entities.map((n, r) => /* @__PURE__ */ a(
|
|
1049
|
+
ke,
|
|
1050
1050
|
{
|
|
1051
|
-
part: { type: "entity", entity:
|
|
1051
|
+
part: { type: "entity", entity: n, entityType: e.entityType },
|
|
1052
1052
|
onEntityClick: t
|
|
1053
1053
|
},
|
|
1054
|
-
|
|
1054
|
+
n.id ?? r
|
|
1055
1055
|
))
|
|
1056
1056
|
] });
|
|
1057
1057
|
}
|
|
1058
|
-
const
|
|
1059
|
-
markdown:
|
|
1060
|
-
unknownPart:
|
|
1061
|
-
errorText:
|
|
1062
|
-
errorIcon:
|
|
1058
|
+
const Kt = "_markdown_1yi3y_1", Gt = "_unknownPart_1yi3y_84", Qt = "_errorText_1yi3y_98", Yt = "_errorIcon_1yi3y_106", re = {
|
|
1059
|
+
markdown: Kt,
|
|
1060
|
+
unknownPart: Gt,
|
|
1061
|
+
errorText: Qt,
|
|
1062
|
+
errorIcon: Yt
|
|
1063
1063
|
};
|
|
1064
|
-
function
|
|
1064
|
+
function Xt({ part: e, onProposalConfirm: t, onProposalCancel: n, onEntityClick: r, renderPart: s }) {
|
|
1065
1065
|
if (s) {
|
|
1066
|
-
const
|
|
1067
|
-
if (
|
|
1068
|
-
return /* @__PURE__ */
|
|
1066
|
+
const o = s(e);
|
|
1067
|
+
if (o != null)
|
|
1068
|
+
return /* @__PURE__ */ a(ve, { children: o });
|
|
1069
1069
|
}
|
|
1070
1070
|
switch (e.type) {
|
|
1071
1071
|
case "text":
|
|
1072
|
-
return /* @__PURE__ */
|
|
1072
|
+
return /* @__PURE__ */ a("div", { className: re.markdown, children: /* @__PURE__ */ a(Ae, { remarkPlugins: [ze], children: e.text }) });
|
|
1073
1073
|
case "table":
|
|
1074
|
-
return /* @__PURE__ */
|
|
1074
|
+
return /* @__PURE__ */ a(yt, { part: e });
|
|
1075
1075
|
case "activity":
|
|
1076
|
-
return /* @__PURE__ */
|
|
1076
|
+
return /* @__PURE__ */ a(Mt, { part: e });
|
|
1077
1077
|
case "proposal":
|
|
1078
|
-
return /* @__PURE__ */
|
|
1079
|
-
|
|
1078
|
+
return /* @__PURE__ */ a(
|
|
1079
|
+
Nt,
|
|
1080
1080
|
{
|
|
1081
1081
|
part: e,
|
|
1082
1082
|
onConfirm: t,
|
|
1083
|
-
onCancel:
|
|
1083
|
+
onCancel: n
|
|
1084
1084
|
}
|
|
1085
1085
|
);
|
|
1086
1086
|
case "entity":
|
|
1087
|
-
return /* @__PURE__ */
|
|
1087
|
+
return /* @__PURE__ */ a(ke, { part: e, onEntityClick: r });
|
|
1088
1088
|
case "entity-list":
|
|
1089
|
-
return /* @__PURE__ */
|
|
1089
|
+
return /* @__PURE__ */ a(Ut, { part: e, onEntityClick: r });
|
|
1090
1090
|
case "error":
|
|
1091
|
-
return /* @__PURE__ */
|
|
1092
|
-
/* @__PURE__ */
|
|
1091
|
+
return /* @__PURE__ */ m("span", { className: re.errorText, children: [
|
|
1092
|
+
/* @__PURE__ */ a(it, { className: re.errorIcon }),
|
|
1093
1093
|
e.message
|
|
1094
1094
|
] });
|
|
1095
1095
|
default:
|
|
1096
|
-
return globalThis.process?.env?.NODE_ENV !== "production" ? /* @__PURE__ */
|
|
1096
|
+
return globalThis.process?.env?.NODE_ENV !== "production" ? /* @__PURE__ */ m("div", { className: re.unknownPart, children: [
|
|
1097
1097
|
"Unhandled part type: ",
|
|
1098
|
-
/* @__PURE__ */
|
|
1098
|
+
/* @__PURE__ */ a("code", { children: e.type }),
|
|
1099
1099
|
" — pass a",
|
|
1100
1100
|
" ",
|
|
1101
|
-
/* @__PURE__ */
|
|
1101
|
+
/* @__PURE__ */ a("code", { children: "renderPart" }),
|
|
1102
1102
|
" prop to render it."
|
|
1103
1103
|
] }) : null;
|
|
1104
1104
|
}
|
|
1105
1105
|
}
|
|
1106
|
-
const
|
|
1107
|
-
wrapper:
|
|
1108
|
-
user:
|
|
1109
|
-
assistant:
|
|
1110
|
-
avatar:
|
|
1111
|
-
content:
|
|
1112
|
-
bubble:
|
|
1113
|
-
card:
|
|
1114
|
-
empty:
|
|
1115
|
-
},
|
|
1116
|
-
function
|
|
1117
|
-
return !
|
|
1106
|
+
const ea = "_wrapper_1q20p_1", ta = "_user_1q20p_8", aa = "_assistant_1q20p_12", na = "_avatar_1q20p_16", sa = "_content_1q20p_43", ra = "_bubble_1q20p_51", oa = "_card_1q20p_70", ia = "_empty_1q20p_92", B = {
|
|
1107
|
+
wrapper: ea,
|
|
1108
|
+
user: ta,
|
|
1109
|
+
assistant: aa,
|
|
1110
|
+
avatar: na,
|
|
1111
|
+
content: sa,
|
|
1112
|
+
bubble: ra,
|
|
1113
|
+
card: oa,
|
|
1114
|
+
empty: ia
|
|
1115
|
+
}, ca = /* @__PURE__ */ new Set(["text", "error", "activity"]);
|
|
1116
|
+
function Se(e) {
|
|
1117
|
+
return !ca.has(e.type);
|
|
1118
1118
|
}
|
|
1119
|
-
function
|
|
1119
|
+
function la(e) {
|
|
1120
1120
|
const t = [];
|
|
1121
|
-
return e.forEach((
|
|
1122
|
-
const s =
|
|
1123
|
-
if (
|
|
1124
|
-
|
|
1121
|
+
return e.forEach((n, r) => {
|
|
1122
|
+
const s = Se(n), o = t[t.length - 1];
|
|
1123
|
+
if (o && !s && !o.card) {
|
|
1124
|
+
o.parts.push({ part: n, index: r });
|
|
1125
1125
|
return;
|
|
1126
1126
|
}
|
|
1127
|
-
t.push({ card: s, parts: [{ part:
|
|
1127
|
+
t.push({ card: s, parts: [{ part: n, index: r }] });
|
|
1128
1128
|
}), t;
|
|
1129
1129
|
}
|
|
1130
|
-
function
|
|
1131
|
-
const d =
|
|
1132
|
-
|
|
1130
|
+
function da({ message: e, onProposalConfirm: t, onProposalCancel: n, onEntityClick: r, assistantIcon: s, renderPart: o }) {
|
|
1131
|
+
const d = H(), i = e.role === "user", c = (p, l) => /* @__PURE__ */ a(
|
|
1132
|
+
Xt,
|
|
1133
1133
|
{
|
|
1134
1134
|
part: p,
|
|
1135
1135
|
onProposalConfirm: t,
|
|
1136
|
-
onProposalCancel:
|
|
1136
|
+
onProposalCancel: n,
|
|
1137
1137
|
onEntityClick: r,
|
|
1138
|
-
renderPart:
|
|
1138
|
+
renderPart: o
|
|
1139
1139
|
},
|
|
1140
|
-
|
|
1141
|
-
), u = e.parts.some(
|
|
1142
|
-
return /* @__PURE__ */
|
|
1140
|
+
l
|
|
1141
|
+
), u = e.parts.some(Se);
|
|
1142
|
+
return /* @__PURE__ */ m(
|
|
1143
1143
|
"div",
|
|
1144
1144
|
{
|
|
1145
|
-
className: `${
|
|
1145
|
+
className: `${B.wrapper} ${i ? B.user : B.assistant}`,
|
|
1146
1146
|
"data-juneau": "message",
|
|
1147
1147
|
"data-juneau-role": e.role,
|
|
1148
1148
|
children: [
|
|
1149
|
-
!
|
|
1150
|
-
u ? /* @__PURE__ */
|
|
1149
|
+
!i && /* @__PURE__ */ a("div", { className: B.avatar, "aria-hidden": "true", "data-juneau": "assistant-avatar", children: s ?? /* @__PURE__ */ a(je, {}) }),
|
|
1150
|
+
u ? /* @__PURE__ */ a("div", { className: B.content, children: la(e.parts).map((p, l) => /* @__PURE__ */ a(
|
|
1151
1151
|
"div",
|
|
1152
1152
|
{
|
|
1153
|
-
className: p.card ?
|
|
1153
|
+
className: p.card ? B.card : B.bubble,
|
|
1154
1154
|
"data-juneau-segment": p.card ? "card" : "bubble",
|
|
1155
|
-
children: p.parts.map(({ part: f, index: C }) =>
|
|
1155
|
+
children: p.parts.map(({ part: f, index: C }) => c(f, C))
|
|
1156
1156
|
},
|
|
1157
|
-
|
|
1158
|
-
)) }) : /* @__PURE__ */
|
|
1159
|
-
e.parts.map((p,
|
|
1160
|
-
e.parts.length === 0 && /* @__PURE__ */
|
|
1157
|
+
l
|
|
1158
|
+
)) }) : /* @__PURE__ */ m("div", { className: B.bubble, "data-juneau-segment": "bubble", children: [
|
|
1159
|
+
e.parts.map((p, l) => c(p, l)),
|
|
1160
|
+
e.parts.length === 0 && /* @__PURE__ */ a("span", { className: B.empty })
|
|
1161
1161
|
] }),
|
|
1162
|
-
|
|
1162
|
+
i && /* @__PURE__ */ a("div", { className: B.avatar, children: d.userLabel })
|
|
1163
1163
|
]
|
|
1164
1164
|
}
|
|
1165
1165
|
);
|
|
1166
1166
|
}
|
|
1167
|
-
const
|
|
1168
|
-
wrapper:
|
|
1169
|
-
dot:
|
|
1170
|
-
connectingLabel:
|
|
1167
|
+
const ua = "_wrapper_1dvvu_1", pa = "_dot_1dvvu_8", ya = "_connectingLabel_1dvvu_19", Y = {
|
|
1168
|
+
wrapper: ua,
|
|
1169
|
+
dot: pa,
|
|
1170
|
+
connectingLabel: ya
|
|
1171
1171
|
};
|
|
1172
|
-
function
|
|
1173
|
-
const t =
|
|
1174
|
-
return /* @__PURE__ */
|
|
1172
|
+
function ma({ connecting: e = !1 }) {
|
|
1173
|
+
const t = H();
|
|
1174
|
+
return /* @__PURE__ */ m(
|
|
1175
1175
|
"div",
|
|
1176
1176
|
{
|
|
1177
|
-
className:
|
|
1177
|
+
className: Y.wrapper,
|
|
1178
1178
|
"aria-label": e ? t.connectingMessage : t.typingMessage,
|
|
1179
1179
|
"data-juneau": "typing-indicator",
|
|
1180
1180
|
children: [
|
|
1181
|
-
/* @__PURE__ */
|
|
1182
|
-
/* @__PURE__ */
|
|
1183
|
-
/* @__PURE__ */
|
|
1184
|
-
e && /* @__PURE__ */
|
|
1181
|
+
/* @__PURE__ */ a("span", { className: Y.dot }),
|
|
1182
|
+
/* @__PURE__ */ a("span", { className: Y.dot }),
|
|
1183
|
+
/* @__PURE__ */ a("span", { className: Y.dot }),
|
|
1184
|
+
e && /* @__PURE__ */ a("span", { className: Y.connectingLabel, children: t.connectingMessage })
|
|
1185
1185
|
]
|
|
1186
1186
|
}
|
|
1187
1187
|
);
|
|
1188
1188
|
}
|
|
1189
|
-
const
|
|
1190
|
-
list:
|
|
1191
|
-
empty:
|
|
1192
|
-
hint:
|
|
1193
|
-
typing:
|
|
1189
|
+
const ha = "_list_1f8gn_1", fa = "_empty_1f8gn_11", ga = "_hint_1f8gn_24", _a = "_typing_1f8gn_31", oe = {
|
|
1190
|
+
list: ha,
|
|
1191
|
+
empty: fa,
|
|
1192
|
+
hint: ga,
|
|
1193
|
+
typing: _a
|
|
1194
1194
|
};
|
|
1195
|
-
function
|
|
1196
|
-
const u =
|
|
1197
|
-
return
|
|
1195
|
+
function fe({ messages: e, isLoading: t, isConnecting: n, onProposalConfirm: r, onProposalCancel: s, onEntityClick: o, assistantIcon: d, renderPart: i, emptyState: c }) {
|
|
1196
|
+
const u = H(), p = U(null);
|
|
1197
|
+
return ce(() => {
|
|
1198
1198
|
p.current?.scrollIntoView({ behavior: "smooth" });
|
|
1199
|
-
}, [e, t]), /* @__PURE__ */
|
|
1200
|
-
e.length === 0 && (
|
|
1201
|
-
/* @__PURE__ */
|
|
1202
|
-
/* @__PURE__ */
|
|
1199
|
+
}, [e, t]), /* @__PURE__ */ m("div", { className: oe.list, "data-juneau": "message-list", children: [
|
|
1200
|
+
e.length === 0 && (c ?? /* @__PURE__ */ m("div", { className: oe.empty, "data-juneau": "empty-state", children: [
|
|
1201
|
+
/* @__PURE__ */ a("p", { children: u.emptyStateText }),
|
|
1202
|
+
/* @__PURE__ */ a("p", { className: oe.hint, children: /* @__PURE__ */ a("em", { children: u.emptyStateHint }) })
|
|
1203
1203
|
] })),
|
|
1204
|
-
e.map((
|
|
1205
|
-
|
|
1204
|
+
e.map((l) => /* @__PURE__ */ a(
|
|
1205
|
+
da,
|
|
1206
1206
|
{
|
|
1207
|
-
message:
|
|
1207
|
+
message: l,
|
|
1208
1208
|
onProposalConfirm: r,
|
|
1209
1209
|
onProposalCancel: s,
|
|
1210
|
-
onEntityClick:
|
|
1210
|
+
onEntityClick: o,
|
|
1211
1211
|
assistantIcon: d,
|
|
1212
|
-
renderPart:
|
|
1212
|
+
renderPart: i
|
|
1213
1213
|
},
|
|
1214
|
-
|
|
1214
|
+
l.id
|
|
1215
1215
|
)),
|
|
1216
|
-
t && /* @__PURE__ */
|
|
1217
|
-
/* @__PURE__ */
|
|
1216
|
+
t && /* @__PURE__ */ a("div", { className: oe.typing, children: /* @__PURE__ */ a(ma, { connecting: n }) }),
|
|
1217
|
+
/* @__PURE__ */ a("div", { ref: p })
|
|
1218
1218
|
] });
|
|
1219
1219
|
}
|
|
1220
|
-
const
|
|
1221
|
-
wrapper:
|
|
1222
|
-
textarea:
|
|
1223
|
-
toolbar:
|
|
1224
|
-
actions:
|
|
1225
|
-
actionBtn:
|
|
1226
|
-
sendBtn:
|
|
1227
|
-
spinnerIcon:
|
|
1220
|
+
const ba = "_wrapper_v8iyr_1", va = "_textarea_v8iyr_11", wa = "_toolbar_v8iyr_35", xa = "_actions_v8iyr_45", Ca = "_actionBtn_v8iyr_52", Na = "_sendBtn_v8iyr_85", ja = "_spinnerIcon_v8iyr_116", ka = "_stopBtn_v8iyr_126", Sa = "_stopIcon_v8iyr_149", P = {
|
|
1221
|
+
wrapper: ba,
|
|
1222
|
+
textarea: va,
|
|
1223
|
+
toolbar: wa,
|
|
1224
|
+
actions: xa,
|
|
1225
|
+
actionBtn: Ca,
|
|
1226
|
+
sendBtn: Na,
|
|
1227
|
+
spinnerIcon: ja,
|
|
1228
1228
|
stopBtn: ka,
|
|
1229
|
-
stopIcon:
|
|
1229
|
+
stopIcon: Sa
|
|
1230
1230
|
};
|
|
1231
|
-
function
|
|
1232
|
-
const
|
|
1233
|
-
|
|
1231
|
+
function Aa({ value: e, onChange: t, onSend: n, onStop: r, isLoading: s, placeholder: o, actions: d, sendIcon: i }) {
|
|
1232
|
+
const c = H(), u = U(null), p = U(!1);
|
|
1233
|
+
ce(() => {
|
|
1234
1234
|
p.current && !s && u.current?.focus(), p.current = s;
|
|
1235
1235
|
}, [s]);
|
|
1236
|
-
const
|
|
1237
|
-
{ icon: /* @__PURE__ */
|
|
1238
|
-
{ icon: /* @__PURE__ */
|
|
1239
|
-
{ icon: /* @__PURE__ */
|
|
1240
|
-
{ icon: /* @__PURE__ */
|
|
1241
|
-
{ icon: /* @__PURE__ */
|
|
1242
|
-
], f = d ??
|
|
1243
|
-
y.key === "Enter" && !y.shiftKey && (y.preventDefault(), s ||
|
|
1236
|
+
const l = [
|
|
1237
|
+
{ icon: /* @__PURE__ */ a(Xe, {}), label: c.actionAddFile },
|
|
1238
|
+
{ icon: /* @__PURE__ */ a(et, {}), label: c.actionQuickActions },
|
|
1239
|
+
{ icon: /* @__PURE__ */ a(tt, {}), label: c.actionNew },
|
|
1240
|
+
{ icon: /* @__PURE__ */ a(at, {}), label: c.actionHistory },
|
|
1241
|
+
{ icon: /* @__PURE__ */ a(nt, {}), label: c.actionRules }
|
|
1242
|
+
], f = d ?? l, C = (y) => {
|
|
1243
|
+
y.key === "Enter" && !y.shiftKey && (y.preventDefault(), s || n());
|
|
1244
1244
|
};
|
|
1245
|
-
return /* @__PURE__ */
|
|
1246
|
-
/* @__PURE__ */
|
|
1245
|
+
return /* @__PURE__ */ m("div", { className: P.wrapper, "data-juneau": "input", children: [
|
|
1246
|
+
/* @__PURE__ */ a(
|
|
1247
1247
|
"textarea",
|
|
1248
1248
|
{
|
|
1249
1249
|
ref: u,
|
|
1250
|
-
className:
|
|
1250
|
+
className: P.textarea,
|
|
1251
1251
|
"data-juneau": "input-textarea",
|
|
1252
1252
|
value: e,
|
|
1253
1253
|
onChange: (y) => t(y.target.value),
|
|
1254
1254
|
onKeyDown: C,
|
|
1255
|
-
placeholder:
|
|
1255
|
+
placeholder: o ?? c.inputPlaceholder,
|
|
1256
1256
|
rows: 3,
|
|
1257
|
-
"aria-label":
|
|
1257
|
+
"aria-label": c.sendMessage
|
|
1258
1258
|
}
|
|
1259
1259
|
),
|
|
1260
|
-
/* @__PURE__ */
|
|
1261
|
-
f.length > 0 && /* @__PURE__ */
|
|
1260
|
+
/* @__PURE__ */ m("div", { className: P.toolbar, children: [
|
|
1261
|
+
f.length > 0 && /* @__PURE__ */ a("div", { className: P.actions, children: f.map((y, T) => /* @__PURE__ */ m(
|
|
1262
1262
|
"button",
|
|
1263
1263
|
{
|
|
1264
|
-
className:
|
|
1264
|
+
className: P.actionBtn,
|
|
1265
1265
|
type: "button",
|
|
1266
1266
|
disabled: s,
|
|
1267
1267
|
"aria-label": y.label,
|
|
1268
1268
|
onClick: y.onClick,
|
|
1269
1269
|
children: [
|
|
1270
1270
|
y.icon,
|
|
1271
|
-
/* @__PURE__ */
|
|
1271
|
+
/* @__PURE__ */ a("span", { children: y.label })
|
|
1272
1272
|
]
|
|
1273
1273
|
},
|
|
1274
|
-
|
|
1274
|
+
T
|
|
1275
1275
|
)) }),
|
|
1276
|
-
s && r ? /* @__PURE__ */
|
|
1276
|
+
s && r ? /* @__PURE__ */ m(
|
|
1277
1277
|
"button",
|
|
1278
1278
|
{
|
|
1279
|
-
className:
|
|
1279
|
+
className: P.stopBtn,
|
|
1280
1280
|
onClick: r,
|
|
1281
|
-
"aria-label":
|
|
1281
|
+
"aria-label": c.stopMessage,
|
|
1282
1282
|
type: "button",
|
|
1283
|
+
"data-juneau": "input-stop",
|
|
1283
1284
|
children: [
|
|
1284
|
-
/* @__PURE__ */
|
|
1285
|
-
/* @__PURE__ */
|
|
1285
|
+
/* @__PURE__ */ a("svg", { className: P.stopIcon, viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ a("rect", { x: "6", y: "6", width: "12", height: "12", rx: "2" }) }),
|
|
1286
|
+
/* @__PURE__ */ a("span", { children: c.stopMessage })
|
|
1286
1287
|
]
|
|
1287
1288
|
}
|
|
1288
|
-
) : /* @__PURE__ */
|
|
1289
|
+
) : /* @__PURE__ */ m(
|
|
1289
1290
|
"button",
|
|
1290
1291
|
{
|
|
1291
|
-
className:
|
|
1292
|
-
onClick:
|
|
1292
|
+
className: P.sendBtn,
|
|
1293
|
+
onClick: n,
|
|
1293
1294
|
disabled: s || !e.trim(),
|
|
1294
|
-
"aria-label":
|
|
1295
|
+
"aria-label": c.sendMessage,
|
|
1295
1296
|
type: "button",
|
|
1297
|
+
"data-juneau": "input-send",
|
|
1296
1298
|
children: [
|
|
1297
|
-
s ? /* @__PURE__ */
|
|
1298
|
-
/* @__PURE__ */
|
|
1299
|
+
s ? /* @__PURE__ */ a("svg", { className: P.spinnerIcon, viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ a("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round", strokeDasharray: "32", strokeDashoffset: "12" }) }) : i ?? /* @__PURE__ */ a(Ye, {}),
|
|
1300
|
+
/* @__PURE__ */ a("span", { children: c.sendMessage })
|
|
1299
1301
|
]
|
|
1300
1302
|
}
|
|
1301
1303
|
)
|
|
1302
1304
|
] })
|
|
1303
1305
|
] });
|
|
1304
1306
|
}
|
|
1305
|
-
const
|
|
1306
|
-
wrapper:
|
|
1307
|
-
icon:
|
|
1308
|
-
message:
|
|
1307
|
+
const za = "_wrapper_1kefv_1", Ma = "_icon_1kefv_14", Ia = "_message_1kefv_20", Ta = "_dismiss_1kefv_24", ie = {
|
|
1308
|
+
wrapper: za,
|
|
1309
|
+
icon: Ma,
|
|
1310
|
+
message: Ia,
|
|
1309
1311
|
dismiss: Ta
|
|
1310
1312
|
};
|
|
1311
|
-
function
|
|
1312
|
-
const
|
|
1313
|
-
return /* @__PURE__ */
|
|
1314
|
-
/* @__PURE__ */
|
|
1315
|
-
/* @__PURE__ */
|
|
1316
|
-
t && /* @__PURE__ */
|
|
1313
|
+
function La({ message: e, onDismiss: t }) {
|
|
1314
|
+
const n = H();
|
|
1315
|
+
return /* @__PURE__ */ m("div", { className: ie.wrapper, role: "alert", "data-juneau": "error", children: [
|
|
1316
|
+
/* @__PURE__ */ a("svg", { className: ie.icon, viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ a("path", { fillRule: "evenodd", d: "M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z", clipRule: "evenodd" }) }),
|
|
1317
|
+
/* @__PURE__ */ a("span", { className: ie.message, children: e }),
|
|
1318
|
+
t && /* @__PURE__ */ a("button", { className: ie.dismiss, onClick: t, "aria-label": n.errorDismiss, children: /* @__PURE__ */ a("svg", { viewBox: "0 0 16 16", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ a("path", { d: "M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z" }) }) })
|
|
1317
1319
|
] });
|
|
1318
1320
|
}
|
|
1319
|
-
const
|
|
1320
|
-
chat:
|
|
1321
|
+
const Ba = "_chat_tboxh_1", $a = "_aboveInput_tboxh_8", Pa = "_start_tboxh_15", Da = "_startColumn_tboxh_24", Ra = "_belowInput_tboxh_32", J = {
|
|
1322
|
+
chat: Ba,
|
|
1323
|
+
aboveInput: $a,
|
|
1324
|
+
start: Pa,
|
|
1325
|
+
startColumn: Da,
|
|
1326
|
+
belowInput: Ra
|
|
1321
1327
|
};
|
|
1322
|
-
function
|
|
1328
|
+
function Ea({
|
|
1323
1329
|
messages: e,
|
|
1324
1330
|
input: t,
|
|
1325
|
-
isLoading:
|
|
1331
|
+
isLoading: n,
|
|
1326
1332
|
isConnecting: r,
|
|
1327
1333
|
error: s,
|
|
1328
|
-
onInputChange:
|
|
1334
|
+
onInputChange: o,
|
|
1329
1335
|
onSend: d,
|
|
1330
|
-
onStop:
|
|
1331
|
-
onProposalConfirm:
|
|
1336
|
+
onStop: i,
|
|
1337
|
+
onProposalConfirm: c,
|
|
1332
1338
|
onProposalCancel: u,
|
|
1333
1339
|
onEntityClick: p,
|
|
1334
|
-
placeholder:
|
|
1340
|
+
placeholder: l,
|
|
1335
1341
|
assistantIcon: f,
|
|
1336
1342
|
actions: C,
|
|
1337
1343
|
sendIcon: y,
|
|
1338
|
-
renderPart:
|
|
1344
|
+
renderPart: T,
|
|
1339
1345
|
emptyState: A,
|
|
1340
|
-
|
|
1341
|
-
|
|
1346
|
+
aboveInput: M,
|
|
1347
|
+
centerInputWhenEmpty: L = !1,
|
|
1348
|
+
belowInput: V,
|
|
1349
|
+
className: k,
|
|
1350
|
+
style: S
|
|
1342
1351
|
}) {
|
|
1343
|
-
|
|
1352
|
+
const $ = s && /* @__PURE__ */ a(La, { message: s }), O = M != null && /* @__PURE__ */ a("div", { className: J.aboveInput, "data-juneau": "above-input", "data-juneau-above-input": "", children: M }), q = /* @__PURE__ */ a(
|
|
1353
|
+
Aa,
|
|
1354
|
+
{
|
|
1355
|
+
value: t,
|
|
1356
|
+
onChange: o,
|
|
1357
|
+
onSend: d,
|
|
1358
|
+
onStop: i,
|
|
1359
|
+
isLoading: n,
|
|
1360
|
+
placeholder: l,
|
|
1361
|
+
actions: C,
|
|
1362
|
+
sendIcon: y
|
|
1363
|
+
}
|
|
1364
|
+
);
|
|
1365
|
+
return L && e.length === 0 ? /* @__PURE__ */ a(
|
|
1366
|
+
"div",
|
|
1367
|
+
{
|
|
1368
|
+
className: [J.chat, k].filter(Boolean).join(" "),
|
|
1369
|
+
style: S,
|
|
1370
|
+
"data-juneau": "chat",
|
|
1371
|
+
children: /* @__PURE__ */ a("div", { className: J.start, "data-juneau": "chat-start", children: /* @__PURE__ */ m("div", { className: J.startColumn, children: [
|
|
1372
|
+
A ?? /* @__PURE__ */ a(
|
|
1373
|
+
fe,
|
|
1374
|
+
{
|
|
1375
|
+
messages: e,
|
|
1376
|
+
isLoading: n,
|
|
1377
|
+
isConnecting: r,
|
|
1378
|
+
onProposalConfirm: c,
|
|
1379
|
+
onProposalCancel: u
|
|
1380
|
+
}
|
|
1381
|
+
),
|
|
1382
|
+
$,
|
|
1383
|
+
O,
|
|
1384
|
+
q,
|
|
1385
|
+
V != null && /* @__PURE__ */ a("div", { className: J.belowInput, "data-juneau": "below-input", children: V })
|
|
1386
|
+
] }) })
|
|
1387
|
+
}
|
|
1388
|
+
) : /* @__PURE__ */ m(
|
|
1344
1389
|
"div",
|
|
1345
1390
|
{
|
|
1346
|
-
className: [
|
|
1347
|
-
style:
|
|
1391
|
+
className: [J.chat, k].filter(Boolean).join(" "),
|
|
1392
|
+
style: S,
|
|
1348
1393
|
"data-juneau": "chat",
|
|
1349
1394
|
children: [
|
|
1350
|
-
/* @__PURE__ */
|
|
1351
|
-
|
|
1395
|
+
/* @__PURE__ */ a(
|
|
1396
|
+
fe,
|
|
1352
1397
|
{
|
|
1353
1398
|
messages: e,
|
|
1354
|
-
isLoading:
|
|
1399
|
+
isLoading: n,
|
|
1355
1400
|
isConnecting: r,
|
|
1356
|
-
onProposalConfirm:
|
|
1401
|
+
onProposalConfirm: c,
|
|
1357
1402
|
onProposalCancel: u,
|
|
1358
1403
|
onEntityClick: p,
|
|
1359
1404
|
assistantIcon: f,
|
|
1360
|
-
renderPart:
|
|
1405
|
+
renderPart: T,
|
|
1361
1406
|
emptyState: A
|
|
1362
1407
|
}
|
|
1363
1408
|
),
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
{
|
|
1368
|
-
value: t,
|
|
1369
|
-
onChange: i,
|
|
1370
|
-
onSend: d,
|
|
1371
|
-
onStop: o,
|
|
1372
|
-
isLoading: a,
|
|
1373
|
-
placeholder: c,
|
|
1374
|
-
actions: C,
|
|
1375
|
-
sendIcon: y
|
|
1376
|
-
}
|
|
1377
|
-
)
|
|
1409
|
+
$,
|
|
1410
|
+
O,
|
|
1411
|
+
q
|
|
1378
1412
|
]
|
|
1379
1413
|
}
|
|
1380
1414
|
);
|
|
1381
1415
|
}
|
|
1382
|
-
const
|
|
1383
|
-
header:
|
|
1384
|
-
left:
|
|
1385
|
-
icon:
|
|
1386
|
-
title:
|
|
1387
|
-
resetBtn:
|
|
1388
|
-
actions:
|
|
1389
|
-
badge:
|
|
1416
|
+
const Ha = "_header_1ss3g_1", Va = "_left_1ss3g_12", Oa = "_icon_1ss3g_18", qa = "_title_1ss3g_23", Wa = "_resetBtn_1ss3g_29", Fa = "_actions_1ss3g_50", Za = "_badge_1ss3g_57", E = {
|
|
1417
|
+
header: Ha,
|
|
1418
|
+
left: Va,
|
|
1419
|
+
icon: Oa,
|
|
1420
|
+
title: qa,
|
|
1421
|
+
resetBtn: Wa,
|
|
1422
|
+
actions: Fa,
|
|
1423
|
+
badge: Za
|
|
1390
1424
|
};
|
|
1391
|
-
function
|
|
1425
|
+
function Ja({
|
|
1392
1426
|
title: e,
|
|
1393
1427
|
onMinimize: t,
|
|
1394
|
-
isMinimized:
|
|
1428
|
+
isMinimized: n,
|
|
1395
1429
|
icon: r,
|
|
1396
1430
|
onReset: s,
|
|
1397
|
-
badge:
|
|
1431
|
+
badge: o,
|
|
1398
1432
|
headerActions: d
|
|
1399
1433
|
}) {
|
|
1400
|
-
const
|
|
1401
|
-
return /* @__PURE__ */
|
|
1402
|
-
/* @__PURE__ */
|
|
1403
|
-
/* @__PURE__ */
|
|
1404
|
-
/* @__PURE__ */
|
|
1405
|
-
|
|
1434
|
+
const i = H();
|
|
1435
|
+
return /* @__PURE__ */ m("div", { className: E.header, "data-juneau": "header", children: [
|
|
1436
|
+
/* @__PURE__ */ m("div", { className: E.left, children: [
|
|
1437
|
+
/* @__PURE__ */ a("span", { className: E.icon, "aria-hidden": "true", "data-juneau": "header-icon", children: r ?? /* @__PURE__ */ a(je, {}) }),
|
|
1438
|
+
/* @__PURE__ */ a("span", { className: E.title, children: e ?? i.sidebarTitle }),
|
|
1439
|
+
o && /* @__PURE__ */ a("span", { className: E.badge, "data-juneau": "header-badge", children: o })
|
|
1406
1440
|
] }),
|
|
1407
|
-
(t || s || d) && /* @__PURE__ */
|
|
1441
|
+
(t || s || d) && /* @__PURE__ */ m("div", { className: E.actions, children: [
|
|
1408
1442
|
d,
|
|
1409
|
-
s && /* @__PURE__ */
|
|
1443
|
+
s && /* @__PURE__ */ a(
|
|
1410
1444
|
"button",
|
|
1411
1445
|
{
|
|
1412
|
-
className:
|
|
1446
|
+
className: E.resetBtn,
|
|
1413
1447
|
onClick: s,
|
|
1414
|
-
title:
|
|
1415
|
-
"aria-label":
|
|
1448
|
+
title: i.resetConversation,
|
|
1449
|
+
"aria-label": i.resetConversation,
|
|
1416
1450
|
"data-juneau": "header-reset",
|
|
1417
|
-
children: /* @__PURE__ */
|
|
1451
|
+
children: /* @__PURE__ */ a(ot, {})
|
|
1418
1452
|
}
|
|
1419
1453
|
),
|
|
1420
|
-
t && /* @__PURE__ */
|
|
1454
|
+
t && /* @__PURE__ */ a(
|
|
1421
1455
|
"button",
|
|
1422
1456
|
{
|
|
1423
|
-
className:
|
|
1457
|
+
className: E.resetBtn,
|
|
1424
1458
|
onClick: t,
|
|
1425
|
-
title:
|
|
1426
|
-
"aria-label":
|
|
1459
|
+
title: n ? i.expandSidebar : i.minimizeSidebar,
|
|
1460
|
+
"aria-label": n ? i.expandSidebar : i.minimizeSidebar,
|
|
1427
1461
|
"data-juneau": "header-minimize",
|
|
1428
|
-
children:
|
|
1462
|
+
children: n ? /* @__PURE__ */ a(rt, {}) : /* @__PURE__ */ a(st, {})
|
|
1429
1463
|
}
|
|
1430
1464
|
)
|
|
1431
1465
|
] })
|
|
1432
1466
|
] });
|
|
1433
1467
|
}
|
|
1434
|
-
const
|
|
1435
|
-
sidebar:
|
|
1436
|
-
minimized:
|
|
1468
|
+
const Ua = "_sidebar_17ski_1", Ka = "_minimized_17ski_20", ge = {
|
|
1469
|
+
sidebar: Ua,
|
|
1470
|
+
minimized: Ka
|
|
1437
1471
|
};
|
|
1438
|
-
function
|
|
1472
|
+
function bn({
|
|
1439
1473
|
title: e,
|
|
1440
1474
|
icon: t,
|
|
1441
|
-
assistantIcon:
|
|
1475
|
+
assistantIcon: n,
|
|
1442
1476
|
actions: r,
|
|
1443
1477
|
sendIcon: s,
|
|
1444
|
-
height:
|
|
1478
|
+
height: o = "60vh",
|
|
1445
1479
|
className: d,
|
|
1446
|
-
style:
|
|
1447
|
-
onReset:
|
|
1480
|
+
style: i,
|
|
1481
|
+
onReset: c,
|
|
1448
1482
|
confirmReset: u,
|
|
1449
1483
|
renderPart: p,
|
|
1450
|
-
onEntityClick:
|
|
1484
|
+
onEntityClick: l,
|
|
1451
1485
|
headerActions: f,
|
|
1452
1486
|
badge: C,
|
|
1453
1487
|
minimized: y,
|
|
1454
|
-
onMinimizedChange:
|
|
1455
|
-
emptyState: A
|
|
1488
|
+
onMinimizedChange: T,
|
|
1489
|
+
emptyState: A,
|
|
1490
|
+
aboveInput: M
|
|
1456
1491
|
}) {
|
|
1457
|
-
const [
|
|
1458
|
-
const
|
|
1459
|
-
|
|
1492
|
+
const [L, V] = W(!1), k = y !== void 0, S = k ? y : L, $ = () => {
|
|
1493
|
+
const g = !S;
|
|
1494
|
+
k || V(g), T?.(g);
|
|
1460
1495
|
}, {
|
|
1461
|
-
messages:
|
|
1462
|
-
input:
|
|
1463
|
-
setInput:
|
|
1464
|
-
sendMessage:
|
|
1465
|
-
stop:
|
|
1466
|
-
isLoading:
|
|
1467
|
-
isConnecting:
|
|
1468
|
-
error:
|
|
1469
|
-
reset:
|
|
1470
|
-
confirmProposal:
|
|
1471
|
-
cancelProposal:
|
|
1472
|
-
} =
|
|
1473
|
-
u && !await u() || (
|
|
1496
|
+
messages: O,
|
|
1497
|
+
input: q,
|
|
1498
|
+
setInput: X,
|
|
1499
|
+
sendMessage: ee,
|
|
1500
|
+
stop: te,
|
|
1501
|
+
isLoading: F,
|
|
1502
|
+
isConnecting: ae,
|
|
1503
|
+
error: ne,
|
|
1504
|
+
reset: h,
|
|
1505
|
+
confirmProposal: v,
|
|
1506
|
+
cancelProposal: b
|
|
1507
|
+
} = Qe(), w = c ? async () => {
|
|
1508
|
+
u && !await u() || (h(), c());
|
|
1474
1509
|
} : void 0;
|
|
1475
|
-
return /* @__PURE__ */
|
|
1510
|
+
return /* @__PURE__ */ m(
|
|
1476
1511
|
"aside",
|
|
1477
1512
|
{
|
|
1478
|
-
className: [
|
|
1479
|
-
style: { height:
|
|
1513
|
+
className: [ge.sidebar, S ? ge.minimized : "", d].filter(Boolean).join(" "),
|
|
1514
|
+
style: { height: S ? void 0 : o, ...i },
|
|
1480
1515
|
"data-juneau": "sidebar",
|
|
1481
1516
|
children: [
|
|
1482
|
-
/* @__PURE__ */
|
|
1483
|
-
|
|
1517
|
+
/* @__PURE__ */ a(
|
|
1518
|
+
Ja,
|
|
1484
1519
|
{
|
|
1485
1520
|
title: e,
|
|
1486
1521
|
icon: t,
|
|
1487
|
-
onMinimize:
|
|
1488
|
-
isMinimized:
|
|
1489
|
-
onReset:
|
|
1522
|
+
onMinimize: $,
|
|
1523
|
+
isMinimized: S,
|
|
1524
|
+
onReset: w,
|
|
1490
1525
|
badge: C,
|
|
1491
1526
|
headerActions: f
|
|
1492
1527
|
}
|
|
1493
1528
|
),
|
|
1494
|
-
!
|
|
1495
|
-
|
|
1529
|
+
!S && /* @__PURE__ */ a(
|
|
1530
|
+
Ea,
|
|
1496
1531
|
{
|
|
1497
|
-
messages:
|
|
1498
|
-
input:
|
|
1499
|
-
isLoading:
|
|
1500
|
-
isConnecting:
|
|
1501
|
-
error:
|
|
1502
|
-
onInputChange:
|
|
1503
|
-
onSend:
|
|
1504
|
-
onStop:
|
|
1505
|
-
onProposalConfirm:
|
|
1506
|
-
onProposalCancel:
|
|
1507
|
-
assistantIcon:
|
|
1532
|
+
messages: O,
|
|
1533
|
+
input: q,
|
|
1534
|
+
isLoading: F,
|
|
1535
|
+
isConnecting: ae,
|
|
1536
|
+
error: ne,
|
|
1537
|
+
onInputChange: X,
|
|
1538
|
+
onSend: ee,
|
|
1539
|
+
onStop: te,
|
|
1540
|
+
onProposalConfirm: v,
|
|
1541
|
+
onProposalCancel: b,
|
|
1542
|
+
assistantIcon: n ?? t,
|
|
1508
1543
|
actions: r,
|
|
1509
1544
|
sendIcon: s,
|
|
1510
1545
|
renderPart: p,
|
|
1511
|
-
onEntityClick:
|
|
1512
|
-
emptyState: A
|
|
1546
|
+
onEntityClick: l,
|
|
1547
|
+
emptyState: A,
|
|
1548
|
+
aboveInput: M
|
|
1513
1549
|
}
|
|
1514
1550
|
)
|
|
1515
1551
|
]
|
|
1516
1552
|
}
|
|
1517
1553
|
);
|
|
1518
1554
|
}
|
|
1519
|
-
const
|
|
1520
|
-
list:
|
|
1521
|
-
item:
|
|
1522
|
-
chat:
|
|
1523
|
-
chatActive:
|
|
1524
|
-
title:
|
|
1525
|
-
date:
|
|
1555
|
+
const Ga = "_list_180ms_1", Qa = "_item_180ms_10", Ya = "_chat_180ms_16", Xa = "_chatActive_180ms_36", en = "_title_180ms_40", tn = "_date_180ms_50", an = "_empty_180ms_82", D = {
|
|
1556
|
+
list: Ga,
|
|
1557
|
+
item: Qa,
|
|
1558
|
+
chat: Ya,
|
|
1559
|
+
chatActive: Xa,
|
|
1560
|
+
title: en,
|
|
1561
|
+
date: tn,
|
|
1526
1562
|
delete: "_delete_180ms_56",
|
|
1527
|
-
empty:
|
|
1563
|
+
empty: an
|
|
1528
1564
|
};
|
|
1529
|
-
function
|
|
1530
|
-
const s =
|
|
1531
|
-
return e.length === 0 ? /* @__PURE__ */
|
|
1532
|
-
/* @__PURE__ */
|
|
1565
|
+
function vn({ chats: e, onSelect: t, activeChatId: n, onDelete: r }) {
|
|
1566
|
+
const s = H();
|
|
1567
|
+
return e.length === 0 ? /* @__PURE__ */ a("p", { className: D.empty, children: s.historyEmpty }) : /* @__PURE__ */ a("ul", { className: D.list, "data-juneau": "history-list", children: e.map((o) => /* @__PURE__ */ m("li", { className: D.item, children: [
|
|
1568
|
+
/* @__PURE__ */ m(
|
|
1533
1569
|
"button",
|
|
1534
1570
|
{
|
|
1535
|
-
className:
|
|
1536
|
-
onClick: () => t(
|
|
1571
|
+
className: o.id === n ? `${D.chat} ${D.chatActive}` : D.chat,
|
|
1572
|
+
onClick: () => t(o.id),
|
|
1537
1573
|
children: [
|
|
1538
|
-
/* @__PURE__ */
|
|
1539
|
-
/* @__PURE__ */
|
|
1574
|
+
/* @__PURE__ */ a("span", { className: D.title, children: o.title }),
|
|
1575
|
+
/* @__PURE__ */ a("span", { className: D.date, children: o.updatedAt.toLocaleDateString(void 0, { day: "numeric", month: "short" }) })
|
|
1540
1576
|
]
|
|
1541
1577
|
}
|
|
1542
1578
|
),
|
|
1543
|
-
r && /* @__PURE__ */
|
|
1579
|
+
r && /* @__PURE__ */ a(
|
|
1544
1580
|
"button",
|
|
1545
1581
|
{
|
|
1546
|
-
className:
|
|
1547
|
-
onClick: () => r(
|
|
1582
|
+
className: D.delete,
|
|
1583
|
+
onClick: () => r(o.id),
|
|
1548
1584
|
"aria-label": s.historyDeleteChat,
|
|
1549
|
-
children: /* @__PURE__ */
|
|
1585
|
+
children: /* @__PURE__ */ a("svg", { viewBox: "0 0 16 16", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ a("path", { d: "M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z" }) })
|
|
1550
1586
|
}
|
|
1551
1587
|
)
|
|
1552
|
-
] },
|
|
1588
|
+
] }, o.id)) });
|
|
1553
1589
|
}
|
|
1554
1590
|
export {
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1591
|
+
Mt as AiActivityPart,
|
|
1592
|
+
Ea as AiChat,
|
|
1593
|
+
de as AiChatContext,
|
|
1594
|
+
Ja as AiChatHeader,
|
|
1595
|
+
vn as AiChatHistoryList,
|
|
1596
|
+
gn as AiChatProvider,
|
|
1597
|
+
ke as AiEntityCard,
|
|
1598
|
+
Ut as AiEntityListPart,
|
|
1599
|
+
La as AiError,
|
|
1600
|
+
Aa as AiInput,
|
|
1601
|
+
da as AiMessageBubble,
|
|
1602
|
+
fe as AiMessageList,
|
|
1603
|
+
Xt as AiMessagePartRenderer,
|
|
1604
|
+
Nt as AiProposalCard,
|
|
1605
|
+
bn as AiSidebar,
|
|
1606
|
+
yt as AiTablePart,
|
|
1607
|
+
ma as AiTypingIndicator,
|
|
1608
|
+
hn as JuneauProvider,
|
|
1609
|
+
pe as consumeStream,
|
|
1610
|
+
mn as createFetchStreamAdapter,
|
|
1611
|
+
yn as createSseAdapter,
|
|
1612
|
+
_ as delay,
|
|
1613
|
+
dn as deserializeMessages,
|
|
1614
|
+
Ie as getMessageText,
|
|
1615
|
+
cn as isChartPart,
|
|
1616
|
+
we as isProposalPart,
|
|
1617
|
+
_n as juneauCs,
|
|
1618
|
+
Ce as juneauEn,
|
|
1619
|
+
pn as mockAdapter,
|
|
1620
|
+
xe as parseJuneauWire,
|
|
1621
|
+
ln as serializeForStorage,
|
|
1622
|
+
Me as serializeMessages,
|
|
1623
|
+
un as trimChats,
|
|
1624
|
+
Be as trimHistory,
|
|
1625
|
+
Je as useAiChat,
|
|
1626
|
+
Qe as useAiChatContext,
|
|
1627
|
+
fn as useAiChatContextSafe
|
|
1592
1628
|
};
|
|
1593
1629
|
//# sourceMappingURL=index.js.map
|