inline-chat-kit 0.58.0 → 0.59.2
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/CHANGELOG.md +108 -0
- package/README.md +35 -0
- package/dist/ChatExperience/ChatExperience.d.ts +18 -1
- package/dist/{ChatExperience-CrWU56fi.js → ChatExperience-umh3nGe_.js} +1181 -1066
- package/dist/ChatExperience-umh3nGe_.js.map +1 -0
- package/dist/demo.js +1 -1
- package/dist/inline-chat-kit.css +1 -1
- package/dist/inline-chat-kit.js +1 -1
- package/dist/turnParts/turnParts.d.ts +21 -3
- package/package.json +1 -1
- package/dist/ChatExperience-CrWU56fi.js.map +0 -1
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import e, { createContext as t, createElement as n, forwardRef as r, isValidElement as i, memo as a, useCallback as o, useContext as s, useEffect as c, useId as l, useImperativeHandle as u, useLayoutEffect as d, useMemo as f, useRef as p, useState as m, useSyncExternalStore as h } from "react";
|
|
3
3
|
import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
4
4
|
import { AnimatePresence as y, LayoutGroup as b, MotionConfig as x, animate as S, motion as C, useAnimationControls as w, useMotionValue as T, useReducedMotion as E } from "motion/react";
|
|
5
|
-
import { ArrowDown as D, ArrowLeft as O, Bookmark as k, Brain as A, Check as j, ChevronDown as M, ChevronLeft as N, ChevronRight as ee, Copy as P, CornerDownLeft as F, File as I, FileText as
|
|
6
|
-
var
|
|
5
|
+
import { ArrowDown as D, ArrowLeft as O, Bookmark as k, Brain as A, Check as j, ChevronDown as M, ChevronLeft as N, ChevronRight as ee, Copy as P, CornerDownLeft as F, File as I, FileText as L, Film as R, Highlighter as te, Image as ne, Link2 as re, Maximize2 as z, MessageCircle as ie, Mic as ae, Minimize2 as oe, Moon as se, MoreHorizontal as ce, Music as le, Palette as ue, Paperclip as B, Pencil as de, Plus as fe, RotateCcw as pe, Save as me, Share as he, Square as ge, Sun as _e, TextCursor as ve, ThumbsDown as ye, ThumbsUp as be, Trash2 as xe, TriangleAlert as Se, X as Ce } from "lucide-react";
|
|
6
|
+
var V = {
|
|
7
7
|
btn: "ick-btn-ZW5E",
|
|
8
8
|
xs: "ick-xs-rDs4",
|
|
9
9
|
s: "ick-s-DE-t",
|
|
@@ -21,25 +21,25 @@ var B = {
|
|
|
21
21
|
loading: "ick-loading-NCs-",
|
|
22
22
|
spinner: "ick-spinner-0n6Q",
|
|
23
23
|
spin: "ick-spin-QgE6"
|
|
24
|
+
}, we = {
|
|
25
|
+
primary: V.primary,
|
|
26
|
+
secondary: V.secondary,
|
|
27
|
+
outline: V.outline,
|
|
28
|
+
ghost: V.ghost,
|
|
29
|
+
glass: V.glass
|
|
24
30
|
}, Te = {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
xs: B.xs,
|
|
32
|
-
s: B.s,
|
|
33
|
-
m: B.m,
|
|
34
|
-
l: B.l,
|
|
35
|
-
xl: B.xl
|
|
36
|
-
}, V = r(function({ variant: e = "primary", size: t = "s", icon: n, iconRight: r, loading: i = !1, children: a, className: o, disabled: s, ...c }, l) {
|
|
31
|
+
xs: V.xs,
|
|
32
|
+
s: V.s,
|
|
33
|
+
m: V.m,
|
|
34
|
+
l: V.l,
|
|
35
|
+
xl: V.xl
|
|
36
|
+
}, H = r(function({ variant: e = "primary", size: t = "s", icon: n, iconRight: r, loading: i = !1, children: a, className: o, disabled: s, ...c }, l) {
|
|
37
37
|
let u = [
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
a ?
|
|
42
|
-
i ?
|
|
38
|
+
V.btn,
|
|
39
|
+
we[e],
|
|
40
|
+
Te[t],
|
|
41
|
+
a ? V.hasText : "",
|
|
42
|
+
i ? V.loading : "",
|
|
43
43
|
o ?? ""
|
|
44
44
|
].filter(Boolean).join(" ");
|
|
45
45
|
return /* @__PURE__ */ v("button", {
|
|
@@ -50,24 +50,24 @@ var B = {
|
|
|
50
50
|
...c,
|
|
51
51
|
children: [
|
|
52
52
|
n && /* @__PURE__ */ _("span", {
|
|
53
|
-
className:
|
|
53
|
+
className: V.icon,
|
|
54
54
|
children: n
|
|
55
55
|
}),
|
|
56
56
|
a && /* @__PURE__ */ _("span", {
|
|
57
|
-
className:
|
|
57
|
+
className: V.label,
|
|
58
58
|
children: a
|
|
59
59
|
}),
|
|
60
60
|
r && /* @__PURE__ */ _("span", {
|
|
61
|
-
className:
|
|
61
|
+
className: V.icon,
|
|
62
62
|
children: r
|
|
63
63
|
}),
|
|
64
64
|
i && /* @__PURE__ */ _("span", {
|
|
65
|
-
className:
|
|
65
|
+
className: V.spinner,
|
|
66
66
|
"aria-hidden": "true"
|
|
67
67
|
})
|
|
68
68
|
]
|
|
69
69
|
});
|
|
70
|
-
}),
|
|
70
|
+
}), Ee = {
|
|
71
71
|
list: "ick-list-4-Xw",
|
|
72
72
|
item: "ick-item-5jP3",
|
|
73
73
|
picture: "ick-picture-JacB",
|
|
@@ -76,7 +76,7 @@ var B = {
|
|
|
76
76
|
name: "ick-name-6t7S",
|
|
77
77
|
size: "ick-size-sR5p",
|
|
78
78
|
remove: "ick-remove-6I5y"
|
|
79
|
-
},
|
|
79
|
+
}, De = {
|
|
80
80
|
approval: {
|
|
81
81
|
once: "Allow once",
|
|
82
82
|
always: "Always allow",
|
|
@@ -226,9 +226,9 @@ var B = {
|
|
|
226
226
|
paragraph: "Paragraph {index}",
|
|
227
227
|
responding: "Generating response"
|
|
228
228
|
}
|
|
229
|
-
},
|
|
230
|
-
function
|
|
231
|
-
let n = s(
|
|
229
|
+
}, Oe = t({});
|
|
230
|
+
function ke({ labels: e, children: t }) {
|
|
231
|
+
let n = s(Oe), r = e ? JSON.stringify(e) : "", i = f(() => {
|
|
232
232
|
if (!r) return n;
|
|
233
233
|
let e = JSON.parse(r), t = { ...n };
|
|
234
234
|
for (let r of Object.keys(e)) t[r] = {
|
|
@@ -237,25 +237,25 @@ function Ae({ labels: e, children: t }) {
|
|
|
237
237
|
};
|
|
238
238
|
return t;
|
|
239
239
|
}, [n, r]);
|
|
240
|
-
return /* @__PURE__ */ _(
|
|
240
|
+
return /* @__PURE__ */ _(Oe.Provider, {
|
|
241
241
|
value: i,
|
|
242
242
|
children: t
|
|
243
243
|
});
|
|
244
244
|
}
|
|
245
|
-
function
|
|
246
|
-
let n = s(
|
|
245
|
+
function U(e, t) {
|
|
246
|
+
let n = s(Oe)[e];
|
|
247
247
|
return {
|
|
248
|
-
...
|
|
248
|
+
...De[e],
|
|
249
249
|
...n,
|
|
250
250
|
...t
|
|
251
251
|
};
|
|
252
252
|
}
|
|
253
|
-
function
|
|
253
|
+
function Ae(e, t) {
|
|
254
254
|
return e.replace(/\{(\w+)\}/g, (e, n) => n in t ? String(t[n]) : e);
|
|
255
255
|
}
|
|
256
256
|
//#endregion
|
|
257
257
|
//#region src/Attachments/Attachments.tsx
|
|
258
|
-
function
|
|
258
|
+
function je(e) {
|
|
259
259
|
if (e === void 0 || !Number.isFinite(e) || e < 0) return "";
|
|
260
260
|
if (e < 1024) return `${e} B`;
|
|
261
261
|
let t = [
|
|
@@ -269,47 +269,47 @@ function U(e) {
|
|
|
269
269
|
var Me = (e) => !!e.url && (e.type ?? "").startsWith("image/"), Ne = (e) => e.replace(/["\\]/g, encodeURIComponent);
|
|
270
270
|
function Pe({ type: e }) {
|
|
271
271
|
let t = (e ?? "").split("/")[0];
|
|
272
|
-
return _(t === "image" ?
|
|
272
|
+
return _(t === "image" ? ne : t === "video" ? R : t === "audio" ? le : e === "application/pdf" || t === "text" ? L : I, {
|
|
273
273
|
size: 16,
|
|
274
274
|
"aria-hidden": !0
|
|
275
275
|
});
|
|
276
276
|
}
|
|
277
277
|
function Fe({ attachments: e, onRemove: t, labels: n, className: r, ...i }) {
|
|
278
|
-
let a =
|
|
278
|
+
let a = U("attachments", n);
|
|
279
279
|
return e.length === 0 ? null : /* @__PURE__ */ _("ul", {
|
|
280
|
-
className: [
|
|
280
|
+
className: [Ee.list, r ?? ""].filter(Boolean).join(" "),
|
|
281
281
|
...i,
|
|
282
282
|
children: e.map((e) => {
|
|
283
|
-
let n =
|
|
283
|
+
let n = je(e.size);
|
|
284
284
|
return /* @__PURE__ */ v("li", {
|
|
285
|
-
className:
|
|
285
|
+
className: Ee.item,
|
|
286
286
|
"data-picture": Me(e) || void 0,
|
|
287
287
|
children: [Me(e) ? /* @__PURE__ */ _("span", {
|
|
288
|
-
className:
|
|
288
|
+
className: Ee.picture,
|
|
289
289
|
style: { backgroundImage: `url("${Ne(e.url)}")` },
|
|
290
290
|
role: "img",
|
|
291
291
|
"aria-label": e.name
|
|
292
292
|
}) : /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("span", {
|
|
293
|
-
className:
|
|
293
|
+
className: Ee.glyph,
|
|
294
294
|
children: /* @__PURE__ */ _(Pe, { type: e.type })
|
|
295
295
|
}), /* @__PURE__ */ v("span", {
|
|
296
|
-
className:
|
|
296
|
+
className: Ee.body,
|
|
297
297
|
children: [/* @__PURE__ */ _("span", {
|
|
298
|
-
className:
|
|
298
|
+
className: Ee.name,
|
|
299
299
|
children: e.name
|
|
300
300
|
}), n && /* @__PURE__ */ _("span", {
|
|
301
|
-
className:
|
|
301
|
+
className: Ee.size,
|
|
302
302
|
children: n
|
|
303
303
|
})]
|
|
304
304
|
})] }), t && /* @__PURE__ */ _("span", {
|
|
305
|
-
className:
|
|
306
|
-
children: /* @__PURE__ */ _(
|
|
305
|
+
className: Ee.remove,
|
|
306
|
+
children: /* @__PURE__ */ _(H, {
|
|
307
307
|
variant: "glass",
|
|
308
308
|
size: "s",
|
|
309
309
|
onClick: () => t(e.id),
|
|
310
310
|
onPointerDown: (e) => e.stopPropagation(),
|
|
311
311
|
"aria-label": `${a.remove} ${e.name}`,
|
|
312
|
-
icon: /* @__PURE__ */ _(
|
|
312
|
+
icon: /* @__PURE__ */ _(Ce, {
|
|
313
313
|
size: 14,
|
|
314
314
|
"aria-hidden": !0
|
|
315
315
|
})
|
|
@@ -371,7 +371,7 @@ function Le({ mode: e, color: t = "currentColor", duration: n = .22, size: r = 1
|
|
|
371
371
|
strokeWidth: 1.8,
|
|
372
372
|
strokeLinecap: "round",
|
|
373
373
|
strokeLinejoin: "round"
|
|
374
|
-
}) : e === "mic" ? /* @__PURE__ */ _(
|
|
374
|
+
}) : e === "mic" ? /* @__PURE__ */ _(ae, {
|
|
375
375
|
size: r,
|
|
376
376
|
color: t,
|
|
377
377
|
strokeWidth: 1.8,
|
|
@@ -383,7 +383,7 @@ function Le({ mode: e, color: t = "currentColor", duration: n = .22, size: r = 1
|
|
|
383
383
|
strokeWidth: 2.2,
|
|
384
384
|
strokeLinecap: "round",
|
|
385
385
|
strokeLinejoin: "round"
|
|
386
|
-
}) : /* @__PURE__ */ _(
|
|
386
|
+
}) : /* @__PURE__ */ _(ge, {
|
|
387
387
|
size: r,
|
|
388
388
|
color: t,
|
|
389
389
|
fill: t,
|
|
@@ -421,7 +421,7 @@ var W = {
|
|
|
421
421
|
//#endregion
|
|
422
422
|
//#region src/ChatInput/HoverActionsRow.tsx
|
|
423
423
|
function Re({ showActions: e, showReadMore: t, isExpanded: n, setIsExpanded: r, onCopy: i, onEdit: a, value: o, ac: s }) {
|
|
424
|
-
let c =
|
|
424
|
+
let c = U("input");
|
|
425
425
|
return /* @__PURE__ */ _(y, {
|
|
426
426
|
initial: !1,
|
|
427
427
|
children: e && /* @__PURE__ */ v(C.div, {
|
|
@@ -467,7 +467,7 @@ function Re({ showActions: e, showReadMore: t, isExpanded: n, setIsExpanded: r,
|
|
|
467
467
|
},
|
|
468
468
|
exit: {}
|
|
469
469
|
},
|
|
470
|
-
children: /* @__PURE__ */ _(
|
|
470
|
+
children: /* @__PURE__ */ _(H, {
|
|
471
471
|
variant: "ghost",
|
|
472
472
|
icon: n ? c.readLess : c.readMore,
|
|
473
473
|
onClick: (e) => {
|
|
@@ -491,7 +491,7 @@ function Re({ showActions: e, showReadMore: t, isExpanded: n, setIsExpanded: r,
|
|
|
491
491
|
label: c.copy
|
|
492
492
|
}, {
|
|
493
493
|
id: "edit",
|
|
494
|
-
icon: /* @__PURE__ */ _(
|
|
494
|
+
icon: /* @__PURE__ */ _(de, {
|
|
495
495
|
size: 14,
|
|
496
496
|
"aria-hidden": !0
|
|
497
497
|
}),
|
|
@@ -514,7 +514,7 @@ function Re({ showActions: e, showReadMore: t, isExpanded: n, setIsExpanded: r,
|
|
|
514
514
|
},
|
|
515
515
|
exit: {}
|
|
516
516
|
},
|
|
517
|
-
children: /* @__PURE__ */ _(
|
|
517
|
+
children: /* @__PURE__ */ _(H, {
|
|
518
518
|
variant: "ghost",
|
|
519
519
|
icon: t,
|
|
520
520
|
onClick: n,
|
|
@@ -528,12 +528,12 @@ function Re({ showActions: e, showReadMore: t, isExpanded: n, setIsExpanded: r,
|
|
|
528
528
|
//#endregion
|
|
529
529
|
//#region src/ChatInput/AddCardsOverlay.tsx
|
|
530
530
|
function ze() {
|
|
531
|
-
let e =
|
|
531
|
+
let e = U("input");
|
|
532
532
|
return [
|
|
533
533
|
{
|
|
534
534
|
id: "attach",
|
|
535
535
|
label: e.attach,
|
|
536
|
-
icon: /* @__PURE__ */ _(
|
|
536
|
+
icon: /* @__PURE__ */ _(B, {
|
|
537
537
|
size: 16,
|
|
538
538
|
"aria-hidden": !0
|
|
539
539
|
})
|
|
@@ -541,7 +541,7 @@ function ze() {
|
|
|
541
541
|
{
|
|
542
542
|
id: "design",
|
|
543
543
|
label: e.design,
|
|
544
|
-
icon: /* @__PURE__ */ _(
|
|
544
|
+
icon: /* @__PURE__ */ _(ue, {
|
|
545
545
|
size: 16,
|
|
546
546
|
"aria-hidden": !0
|
|
547
547
|
})
|
|
@@ -549,7 +549,7 @@ function ze() {
|
|
|
549
549
|
{
|
|
550
550
|
id: "connectors",
|
|
551
551
|
label: e.connectors,
|
|
552
|
-
icon: /* @__PURE__ */ _(
|
|
552
|
+
icon: /* @__PURE__ */ _(re, {
|
|
553
553
|
size: 16,
|
|
554
554
|
"aria-hidden": !0
|
|
555
555
|
})
|
|
@@ -557,7 +557,7 @@ function ze() {
|
|
|
557
557
|
];
|
|
558
558
|
}
|
|
559
559
|
function Be({ isAddOpen: e, setIsAddOpen: t, onAdd: n, items: r, showInlineGlyph: i, showButtons: a, ac: o }) {
|
|
560
|
-
let s = ze(), c = r ?? s, { closeMenu: l } =
|
|
560
|
+
let s = ze(), c = r ?? s, { closeMenu: l } = U("input");
|
|
561
561
|
return /* @__PURE__ */ _(y, { children: e && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(C.div, {
|
|
562
562
|
className: W.addBackdrop,
|
|
563
563
|
initial: { opacity: 0 },
|
|
@@ -661,9 +661,9 @@ function Be({ isAddOpen: e, setIsAddOpen: t, onAdd: n, items: r, showInlineGlyph
|
|
|
661
661
|
pointerEvents: "auto",
|
|
662
662
|
zIndex: 10
|
|
663
663
|
},
|
|
664
|
-
children: /* @__PURE__ */ _(
|
|
664
|
+
children: /* @__PURE__ */ _(H, {
|
|
665
665
|
variant: "ghost",
|
|
666
|
-
icon: /* @__PURE__ */ _(
|
|
666
|
+
icon: /* @__PURE__ */ _(Ce, {
|
|
667
667
|
size: 14,
|
|
668
668
|
"aria-hidden": !0
|
|
669
669
|
}),
|
|
@@ -730,7 +730,7 @@ function Qe({ onTranscribe: e, onTranscript: t, onDone: n, meterRef: r, labels:
|
|
|
730
730
|
onTranscript: t,
|
|
731
731
|
onDone: n
|
|
732
732
|
}), w = p({
|
|
733
|
-
...
|
|
733
|
+
...De.voice,
|
|
734
734
|
...i
|
|
735
735
|
});
|
|
736
736
|
c(() => {
|
|
@@ -739,7 +739,7 @@ function Qe({ onTranscribe: e, onTranscript: t, onDone: n, meterRef: r, labels:
|
|
|
739
739
|
onTranscript: t,
|
|
740
740
|
onDone: n
|
|
741
741
|
}, w.current = {
|
|
742
|
-
...
|
|
742
|
+
...De.voice,
|
|
743
743
|
...i
|
|
744
744
|
};
|
|
745
745
|
});
|
|
@@ -929,12 +929,20 @@ var nt = .9, rt = {
|
|
|
929
929
|
angle3: -50,
|
|
930
930
|
hoverPull: 12
|
|
931
931
|
}
|
|
932
|
-
}
|
|
932
|
+
};
|
|
933
|
+
function it(e) {
|
|
934
|
+
let { stiffness: t, damping: n, mass: r = 1 } = e;
|
|
935
|
+
return t === void 0 ? e : {
|
|
936
|
+
...e,
|
|
937
|
+
damping: Math.max(n ?? 0, 2 * Math.sqrt(t * r))
|
|
938
|
+
};
|
|
939
|
+
}
|
|
940
|
+
var at = {
|
|
933
941
|
type: "spring",
|
|
934
942
|
stiffness: 600,
|
|
935
943
|
damping: 21.5,
|
|
936
944
|
mass: .2
|
|
937
|
-
},
|
|
945
|
+
}, ot = (e) => {
|
|
938
946
|
if (typeof document.execCommand == "function") try {
|
|
939
947
|
if (document.execCommand("insertText", !1, e)) return !0;
|
|
940
948
|
} catch {}
|
|
@@ -944,14 +952,14 @@ var nt = .9, rt = {
|
|
|
944
952
|
n.deleteContents();
|
|
945
953
|
let r = document.createTextNode(e);
|
|
946
954
|
return n.insertNode(r), n.setStartAfter(r), n.collapse(!0), t.removeAllRanges(), t.addRange(n), !1;
|
|
947
|
-
},
|
|
948
|
-
let
|
|
955
|
+
}, st = r(function({ state: e, value: t, onChange: n, onSubmit: r, onStop: i, onAdd: a, attachments: s, onAttach: d, onRemoveAttachment: f, accept: h = "image/*", multiple: T = !1, onTranscribe: E, onCopy: D, onEdit: O, onCancelEdit: k, isEditing: A = !1, busy: j = !1, placeholder: M, menu: N, labels: ee, animationConfig: P, style: F }, I) {
|
|
956
|
+
let L = l(), R = U("input", ee), te = U("voice"), ne = M ?? R.placeholder, re = N !== !1, z = p(null), ie = p(null), ae = p(null), oe = p(0), se = p(!1), ce = p(null), [le, ue] = m(!1), [B, de] = m(!1), [pe, me] = m(!1), [he, ge] = m(!0), [_e, ve] = m(!1), [ye, be] = m(!1), [xe, Se] = m(!1), V = p(0), we = p(!1), Te = p(0), Ee = p(!1), De = p(null);
|
|
949
957
|
c(() => () => {
|
|
950
|
-
|
|
958
|
+
De.current && clearTimeout(De.current);
|
|
951
959
|
}, []);
|
|
952
|
-
let
|
|
953
|
-
|
|
954
|
-
let
|
|
960
|
+
let Oe = w(), ke = p(e), Ae = p(P);
|
|
961
|
+
Ae.current = P;
|
|
962
|
+
let je = p(null), [Me, Ne] = m([]), Pe = s ?? Me, Ie = p(Pe);
|
|
955
963
|
Ie.current = Pe;
|
|
956
964
|
let ze = p([]);
|
|
957
965
|
c(() => () => {
|
|
@@ -991,9 +999,9 @@ var nt = .9, rt = {
|
|
|
991
999
|
Ne((t) => (Ve(t.find((t) => t.id === e)?.url), t.filter((t) => t.id !== e)));
|
|
992
1000
|
}, [f, Ve]);
|
|
993
1001
|
u(I, () => ({
|
|
994
|
-
focus: (e) =>
|
|
1002
|
+
focus: (e) => z.current?.focus(e),
|
|
995
1003
|
setValue: (e) => {
|
|
996
|
-
let t =
|
|
1004
|
+
let t = z.current;
|
|
997
1005
|
t && (t.textContent = e, $e(t)), n(e);
|
|
998
1006
|
},
|
|
999
1007
|
getValue: () => t
|
|
@@ -1001,7 +1009,7 @@ var nt = .9, rt = {
|
|
|
1001
1009
|
let We = p(null), Ge = p(null), Ke = p(null);
|
|
1002
1010
|
c(() => {
|
|
1003
1011
|
if (!E) return;
|
|
1004
|
-
let e =
|
|
1012
|
+
let e = z.current;
|
|
1005
1013
|
if (!e) return;
|
|
1006
1014
|
let t = () => {
|
|
1007
1015
|
let t = window.getSelection();
|
|
@@ -1012,23 +1020,23 @@ var nt = .9, rt = {
|
|
|
1012
1020
|
let G = Qe({
|
|
1013
1021
|
onTranscribe: E,
|
|
1014
1022
|
onTranscript: o((e) => {
|
|
1015
|
-
let t = Ge.current, r =
|
|
1023
|
+
let t = Ge.current, r = z.current;
|
|
1016
1024
|
if (!t || !r) return;
|
|
1017
1025
|
let i = t.base.slice(0, t.at) + e + t.base.slice(t.at);
|
|
1018
1026
|
r.textContent = i, tt(r, t.at + e.length), n(i);
|
|
1019
1027
|
}, [n]),
|
|
1020
1028
|
onDone: () => {
|
|
1021
|
-
Ge.current = null,
|
|
1029
|
+
Ge.current = null, z.current?.focus();
|
|
1022
1030
|
},
|
|
1023
1031
|
meterRef: We,
|
|
1024
|
-
labels:
|
|
1025
|
-
}), K = e === "responding" || e === "resting", q = K, qe = t.trim().length > 0 || Pe.length > 0, Je = e === "typing" || e === "idle", Ye = Je && qe && !j, Xe = !!i && (e === "responding" || j && Je), Ze = j && Je && qe && !i, rt = e === "resting" &&
|
|
1032
|
+
labels: te
|
|
1033
|
+
}), K = e === "responding" || e === "resting", q = K, qe = t.trim().length > 0 || Pe.length > 0, Je = e === "typing" || e === "idle", Ye = Je && qe && !j, Xe = !!i && (e === "responding" || j && Je), Ze = j && Je && qe && !i, rt = e === "resting" && le, st = rt, ct = e === "resting" && ye, lt = G.state === "listening" || G.state === "requesting" || G.state === "transcribing", ut = !!E && G.supported && !A, dt = Ye || Xe || Ze, J = P, ft = J ? {
|
|
1026
1034
|
type: "spring",
|
|
1027
1035
|
stiffness: J.bubble.stiffness,
|
|
1028
1036
|
damping: J.bubble.damping,
|
|
1029
1037
|
mass: J.bubble.mass
|
|
1030
|
-
} :
|
|
1031
|
-
let e =
|
|
1038
|
+
} : at, pt = o(() => {
|
|
1039
|
+
let e = ie.current, t = ae.current;
|
|
1032
1040
|
if (!e || !t) return;
|
|
1033
1041
|
if (!(e.scrollHeight > e.clientHeight)) {
|
|
1034
1042
|
t.removeAttribute("data-fade");
|
|
@@ -1038,32 +1046,32 @@ var nt = .9, rt = {
|
|
|
1038
1046
|
!n && !r ? t.dataset.fade = "both" : n ? r ? t.removeAttribute("data-fade") : t.dataset.fade = "bottom" : t.dataset.fade = "top";
|
|
1039
1047
|
}, []);
|
|
1040
1048
|
c(() => {
|
|
1041
|
-
let e =
|
|
1042
|
-
if (e) return e.addEventListener("scroll",
|
|
1043
|
-
}, [
|
|
1049
|
+
let e = ie.current;
|
|
1050
|
+
if (e) return e.addEventListener("scroll", pt, { passive: !0 }), () => e.removeEventListener("scroll", pt);
|
|
1051
|
+
}, [pt]), c(() => {
|
|
1044
1052
|
let e = requestAnimationFrame(() => {
|
|
1045
|
-
let e =
|
|
1046
|
-
e && !q && (e.scrollTop = e.scrollHeight),
|
|
1053
|
+
let e = ie.current;
|
|
1054
|
+
e && !q && (e.scrollTop = e.scrollHeight), pt();
|
|
1047
1055
|
});
|
|
1048
1056
|
return () => cancelAnimationFrame(e);
|
|
1049
1057
|
}, [
|
|
1050
1058
|
t,
|
|
1051
1059
|
q,
|
|
1052
|
-
|
|
1060
|
+
pt
|
|
1053
1061
|
]), c(() => {
|
|
1054
|
-
(e === "idle" || e === "typing") &&
|
|
1062
|
+
(e === "idle" || e === "typing") && z.current?.focus({ preventScroll: !0 });
|
|
1055
1063
|
}, [e]), c(() => {
|
|
1056
|
-
let e =
|
|
1057
|
-
e && (
|
|
1064
|
+
let e = z.current;
|
|
1065
|
+
e && (V.current = e.scrollHeight || 17);
|
|
1058
1066
|
}, []), c(() => {
|
|
1059
|
-
let e =
|
|
1060
|
-
!e || !
|
|
1061
|
-
let n = t ? t.offsetWidth : 0, r = e.clientWidth - 16, i = (
|
|
1062
|
-
|
|
1067
|
+
let e = z.current, t = ce.current;
|
|
1068
|
+
!e || !V.current || requestAnimationFrame(() => {
|
|
1069
|
+
let n = t ? t.offsetWidth : 0, r = e.clientWidth - 16, i = (ie.current?.scrollHeight ?? 0) > V.current + 2, a = Ae.current;
|
|
1070
|
+
we.current ? !(i || n >= r - 2) && n < Te.current * (a?.wrap?.exitThreshold ?? .75) && (we.current = !1, Ee.current = !1, me(!1), ge(!0), De.current &&= (clearTimeout(De.current), null)) : (Te.current = r, (i || n >= Te.current * (a?.wrap?.nearThreshold ?? .92)) && (we.current = !0, Ee.current = !0, ge(!1)));
|
|
1063
1071
|
});
|
|
1064
1072
|
}, [t]), c(() => {
|
|
1065
1073
|
if (!K) return;
|
|
1066
|
-
let e =
|
|
1074
|
+
let e = ie.current;
|
|
1067
1075
|
if (!e || e.scrollTop === 0) return;
|
|
1068
1076
|
let t = e.scrollTop;
|
|
1069
1077
|
S(t, 0, {
|
|
@@ -1076,24 +1084,24 @@ var nt = .9, rt = {
|
|
|
1076
1084
|
}
|
|
1077
1085
|
});
|
|
1078
1086
|
}, [K]), c(() => {
|
|
1079
|
-
K ?
|
|
1087
|
+
K ? Se(!1) : (ve(!1), be(!1));
|
|
1080
1088
|
}, [K]), c(() => {
|
|
1081
1089
|
if (!K) return;
|
|
1082
|
-
let e =
|
|
1083
|
-
e && (
|
|
1090
|
+
let e = ae.current;
|
|
1091
|
+
e && (ye && !_e ? e.dataset.fade = "bottom" : e.removeAttribute("data-fade"));
|
|
1084
1092
|
}, [
|
|
1085
1093
|
K,
|
|
1086
|
-
|
|
1087
|
-
|
|
1094
|
+
ye,
|
|
1095
|
+
_e
|
|
1088
1096
|
]), c(() => {
|
|
1089
|
-
let t =
|
|
1090
|
-
if (
|
|
1097
|
+
let t = ke.current;
|
|
1098
|
+
if (ke.current = e, t !== "responding" || e !== "resting") return;
|
|
1091
1099
|
requestAnimationFrame(() => {
|
|
1092
|
-
let e =
|
|
1093
|
-
e && (
|
|
1094
|
-
}),
|
|
1095
|
-
let n =
|
|
1096
|
-
|
|
1100
|
+
let e = ie.current;
|
|
1101
|
+
e && (oe.current = e.scrollHeight, be(e.scrollHeight > 241), pt());
|
|
1102
|
+
}), de(!0);
|
|
1103
|
+
let n = Ae.current;
|
|
1104
|
+
Oe.start({
|
|
1097
1105
|
scaleX: [
|
|
1098
1106
|
1,
|
|
1099
1107
|
n?.ripple?.scaleX ?? 1.018,
|
|
@@ -1114,35 +1122,35 @@ var nt = .9, rt = {
|
|
|
1114
1122
|
]
|
|
1115
1123
|
}
|
|
1116
1124
|
});
|
|
1117
|
-
let r = window.setTimeout(() =>
|
|
1125
|
+
let r = window.setTimeout(() => de(!1), n?.ripple?.pulseDuration ?? 260);
|
|
1118
1126
|
return () => clearTimeout(r);
|
|
1119
1127
|
}, [
|
|
1120
1128
|
e,
|
|
1121
|
-
|
|
1122
|
-
|
|
1129
|
+
Oe,
|
|
1130
|
+
pt
|
|
1123
1131
|
]);
|
|
1124
|
-
let
|
|
1125
|
-
let e =
|
|
1126
|
-
e && (
|
|
1127
|
-
}, [n]),
|
|
1128
|
-
e.preventDefault(),
|
|
1129
|
-
}, [
|
|
1132
|
+
let mt = o(() => {
|
|
1133
|
+
let e = z.current;
|
|
1134
|
+
e && (se.current = !0, n(e.textContent ?? ""));
|
|
1135
|
+
}, [n]), ht = o((e) => {
|
|
1136
|
+
e.preventDefault(), ot(e.clipboardData.getData("text/plain")) || mt();
|
|
1137
|
+
}, [mt]), gt = o((e) => {
|
|
1130
1138
|
if (e.key === "Enter") {
|
|
1131
|
-
if (e.preventDefault(), e.shiftKey)
|
|
1139
|
+
if (e.preventDefault(), e.shiftKey) ot("\n") || mt();
|
|
1132
1140
|
else if (j) return;
|
|
1133
1141
|
else (t.trim().length > 0 || Ie.current.length > 0) && r(t, Ie.current);
|
|
1134
1142
|
}
|
|
1135
1143
|
}, [
|
|
1136
1144
|
t,
|
|
1137
1145
|
r,
|
|
1138
|
-
|
|
1146
|
+
mt,
|
|
1139
1147
|
j
|
|
1140
1148
|
]);
|
|
1141
1149
|
return c(() => {
|
|
1142
|
-
let e =
|
|
1150
|
+
let e = z.current;
|
|
1143
1151
|
if (e) {
|
|
1144
|
-
if (
|
|
1145
|
-
|
|
1152
|
+
if (se.current) {
|
|
1153
|
+
se.current = !1;
|
|
1146
1154
|
return;
|
|
1147
1155
|
}
|
|
1148
1156
|
e.textContent !== t && (e.textContent = t, document.activeElement === e && $e(e));
|
|
@@ -1150,24 +1158,24 @@ var nt = .9, rt = {
|
|
|
1150
1158
|
}, [t]), /* @__PURE__ */ _(x, {
|
|
1151
1159
|
reducedMotion: "user",
|
|
1152
1160
|
children: /* @__PURE__ */ _(b, {
|
|
1153
|
-
id:
|
|
1161
|
+
id: L,
|
|
1154
1162
|
children: /* @__PURE__ */ v("div", {
|
|
1155
1163
|
className: W.wrap,
|
|
1156
|
-
onMouseEnter: () =>
|
|
1157
|
-
onMouseLeave: () =>
|
|
1164
|
+
onMouseEnter: () => ue(!0),
|
|
1165
|
+
onMouseLeave: () => ue(!1),
|
|
1158
1166
|
style: F,
|
|
1159
1167
|
children: [
|
|
1160
1168
|
/* @__PURE__ */ _(C.div, {
|
|
1161
1169
|
className: `${W.root} ${K ? W.isGlassRoot : ""}`,
|
|
1162
1170
|
layout: !0,
|
|
1163
|
-
animate: { filter:
|
|
1171
|
+
animate: { filter: xe ? `blur(${J?.addCards?.inputBlur ?? 2}px)` : "blur(0px)" },
|
|
1164
1172
|
style: {
|
|
1165
|
-
pointerEvents:
|
|
1173
|
+
pointerEvents: xe ? "none" : "auto",
|
|
1166
1174
|
width: F?.width === "100%" ? "100%" : void 0,
|
|
1167
1175
|
maxWidth: F?.maxWidth
|
|
1168
1176
|
},
|
|
1169
1177
|
transition: {
|
|
1170
|
-
...
|
|
1178
|
+
...ft,
|
|
1171
1179
|
filter: {
|
|
1172
1180
|
type: "tween",
|
|
1173
1181
|
duration: .2,
|
|
@@ -1175,19 +1183,19 @@ var nt = .9, rt = {
|
|
|
1175
1183
|
}
|
|
1176
1184
|
},
|
|
1177
1185
|
children: /* @__PURE__ */ v(C.div, {
|
|
1178
|
-
className: `${W.surface} ${K ? W.glass : ""} ${rt ? W.hovered : ""} ${
|
|
1186
|
+
className: `${W.surface} ${K ? W.glass : ""} ${rt ? W.hovered : ""} ${B ? W.pulsed : ""}`,
|
|
1179
1187
|
style: {
|
|
1180
1188
|
alignItems: "stretch",
|
|
1181
1189
|
flexDirection: "column",
|
|
1182
1190
|
justifyContent: "center"
|
|
1183
1191
|
},
|
|
1184
|
-
transition:
|
|
1185
|
-
animate:
|
|
1186
|
-
onClick: () =>
|
|
1192
|
+
transition: ft,
|
|
1193
|
+
animate: Oe,
|
|
1194
|
+
onClick: () => z.current?.focus(),
|
|
1187
1195
|
children: [
|
|
1188
1196
|
/* @__PURE__ */ _("input", {
|
|
1189
1197
|
type: "file",
|
|
1190
|
-
ref:
|
|
1198
|
+
ref: je,
|
|
1191
1199
|
accept: h,
|
|
1192
1200
|
multiple: T,
|
|
1193
1201
|
style: { display: "none" },
|
|
@@ -1230,15 +1238,15 @@ var nt = .9, rt = {
|
|
|
1230
1238
|
display: "flex",
|
|
1231
1239
|
flexDirection: "row",
|
|
1232
1240
|
alignItems: "center",
|
|
1233
|
-
flexWrap:
|
|
1234
|
-
justifyContent:
|
|
1241
|
+
flexWrap: pe ? "wrap" : "nowrap",
|
|
1242
|
+
justifyContent: pe ? "flex-end" : "flex-start",
|
|
1235
1243
|
width: "100%",
|
|
1236
1244
|
minWidth: 0,
|
|
1237
1245
|
flex: 1
|
|
1238
1246
|
},
|
|
1239
1247
|
children: [
|
|
1240
1248
|
/* @__PURE__ */ _("span", {
|
|
1241
|
-
ref:
|
|
1249
|
+
ref: ce,
|
|
1242
1250
|
"aria-hidden": "true",
|
|
1243
1251
|
style: {
|
|
1244
1252
|
position: "absolute",
|
|
@@ -1251,16 +1259,16 @@ var nt = .9, rt = {
|
|
|
1251
1259
|
children: t
|
|
1252
1260
|
}),
|
|
1253
1261
|
/* @__PURE__ */ _("div", {
|
|
1254
|
-
ref:
|
|
1262
|
+
ref: ae,
|
|
1255
1263
|
className: W.editorClip,
|
|
1256
|
-
style: { flexBasis:
|
|
1264
|
+
style: { flexBasis: pe ? "100%" : void 0 },
|
|
1257
1265
|
children: /* @__PURE__ */ _(C.div, {
|
|
1258
|
-
ref:
|
|
1266
|
+
ref: ie,
|
|
1259
1267
|
className: `${W.editorWrap} ${K ? W.editorWrapGlass : ""}`,
|
|
1260
1268
|
layout: "position",
|
|
1261
|
-
animate: K &&
|
|
1269
|
+
animate: K && ye ? { maxHeight: _e ? oe.current : 240 } : void 0,
|
|
1262
1270
|
transition: {
|
|
1263
|
-
...
|
|
1271
|
+
...ft,
|
|
1264
1272
|
maxHeight: {
|
|
1265
1273
|
type: "spring",
|
|
1266
1274
|
stiffness: 300,
|
|
@@ -1269,24 +1277,24 @@ var nt = .9, rt = {
|
|
|
1269
1277
|
}
|
|
1270
1278
|
},
|
|
1271
1279
|
children: /* @__PURE__ */ _("div", {
|
|
1272
|
-
ref:
|
|
1280
|
+
ref: z,
|
|
1273
1281
|
className: W.editor,
|
|
1274
1282
|
contentEditable: q ? "false" : "plaintext-only",
|
|
1275
1283
|
suppressContentEditableWarning: !0,
|
|
1276
|
-
onInput:
|
|
1277
|
-
onKeyDown:
|
|
1278
|
-
onPaste:
|
|
1284
|
+
onInput: mt,
|
|
1285
|
+
onKeyDown: gt,
|
|
1286
|
+
onPaste: ht,
|
|
1279
1287
|
spellCheck: !1,
|
|
1280
1288
|
role: "textbox",
|
|
1281
1289
|
"aria-multiline": "true",
|
|
1282
|
-
"aria-label":
|
|
1283
|
-
"data-placeholder": q ? "" :
|
|
1290
|
+
"aria-label": ne,
|
|
1291
|
+
"data-placeholder": q ? "" : ne
|
|
1284
1292
|
})
|
|
1285
1293
|
})
|
|
1286
1294
|
}),
|
|
1287
1295
|
/* @__PURE__ */ v("div", {
|
|
1288
1296
|
className: W.buttonGroup,
|
|
1289
|
-
children: [!K &&
|
|
1297
|
+
children: [!K && he && ut && /* @__PURE__ */ _(C.div, {
|
|
1290
1298
|
initial: {
|
|
1291
1299
|
opacity: 0,
|
|
1292
1300
|
scale: nt,
|
|
@@ -1304,7 +1312,7 @@ var nt = .9, rt = {
|
|
|
1304
1312
|
scale: nt,
|
|
1305
1313
|
width: 0,
|
|
1306
1314
|
marginLeft: 0,
|
|
1307
|
-
transition:
|
|
1315
|
+
transition: Ee.current ? {
|
|
1308
1316
|
type: "tween",
|
|
1309
1317
|
duration: J?.wrap?.exitDuration ?? .15,
|
|
1310
1318
|
ease: "easeOut",
|
|
@@ -1329,7 +1337,7 @@ var nt = .9, rt = {
|
|
|
1329
1337
|
position: "relative",
|
|
1330
1338
|
height: 28
|
|
1331
1339
|
},
|
|
1332
|
-
children: /* @__PURE__ */ _(
|
|
1340
|
+
children: /* @__PURE__ */ _(H, {
|
|
1333
1341
|
variant: "ghost",
|
|
1334
1342
|
"data-voice": G.state,
|
|
1335
1343
|
icon: /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("span", {
|
|
@@ -1343,7 +1351,7 @@ var nt = .9, rt = {
|
|
|
1343
1351
|
})] }),
|
|
1344
1352
|
onClick: (e) => {
|
|
1345
1353
|
if (e.stopPropagation(), G.state !== "denied") {
|
|
1346
|
-
if (!
|
|
1354
|
+
if (!lt) {
|
|
1347
1355
|
let e = Math.min(Ke.current ?? t.length, t.length);
|
|
1348
1356
|
Ge.current = {
|
|
1349
1357
|
base: t,
|
|
@@ -1356,7 +1364,7 @@ var nt = .9, rt = {
|
|
|
1356
1364
|
"aria-busy": G.state === "requesting" || G.state === "transcribing",
|
|
1357
1365
|
"aria-pressed": G.state === "listening",
|
|
1358
1366
|
disabled: G.state === "denied",
|
|
1359
|
-
"aria-label": G.state === "listening" ?
|
|
1367
|
+
"aria-label": G.state === "listening" ? R.stopListening : G.state === "requesting" ? R.waitingForMicrophone : G.state === "transcribing" ? R.cancelTranscription : G.state === "denied" ? R.microphoneBlocked : R.dictate,
|
|
1360
1368
|
style: {
|
|
1361
1369
|
width: "100%",
|
|
1362
1370
|
height: "100%",
|
|
@@ -1366,11 +1374,11 @@ var nt = .9, rt = {
|
|
|
1366
1374
|
}, "mic"), /* @__PURE__ */ v(y, {
|
|
1367
1375
|
initial: !1,
|
|
1368
1376
|
onExitComplete: () => {
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
},
|
|
1377
|
+
Ee.current && (Ee.current = !1, me(!0), De.current && clearTimeout(De.current), De.current = window.setTimeout(() => {
|
|
1378
|
+
ge(!0), De.current = null;
|
|
1379
|
+
}, Ae.current?.wrap?.slideInDelay ?? 120));
|
|
1372
1380
|
},
|
|
1373
|
-
children: [!K &&
|
|
1381
|
+
children: [!K && he && (re || A) && /* @__PURE__ */ _(C.div, {
|
|
1374
1382
|
initial: {
|
|
1375
1383
|
opacity: 0,
|
|
1376
1384
|
scale: nt,
|
|
@@ -1385,7 +1393,7 @@ var nt = .9, rt = {
|
|
|
1385
1393
|
opacity: 0,
|
|
1386
1394
|
scale: nt,
|
|
1387
1395
|
width: 0,
|
|
1388
|
-
transition:
|
|
1396
|
+
transition: Ee.current ? {
|
|
1389
1397
|
type: "tween",
|
|
1390
1398
|
duration: J?.wrap?.exitDuration ?? .15,
|
|
1391
1399
|
ease: "easeOut",
|
|
@@ -1437,23 +1445,23 @@ var nt = .9, rt = {
|
|
|
1437
1445
|
position: "absolute",
|
|
1438
1446
|
inset: 0
|
|
1439
1447
|
},
|
|
1440
|
-
children: /* @__PURE__ */ _(
|
|
1448
|
+
children: /* @__PURE__ */ _(H, {
|
|
1441
1449
|
variant: "ghost",
|
|
1442
|
-
icon: /* @__PURE__ */ _(
|
|
1450
|
+
icon: /* @__PURE__ */ _(Ce, {
|
|
1443
1451
|
size: 14,
|
|
1444
1452
|
"aria-hidden": !0
|
|
1445
1453
|
}),
|
|
1446
1454
|
onClick: (e) => {
|
|
1447
1455
|
e.stopPropagation(), k?.();
|
|
1448
1456
|
},
|
|
1449
|
-
"aria-label":
|
|
1450
|
-
title:
|
|
1457
|
+
"aria-label": R.cancelEdit,
|
|
1458
|
+
title: R.cancelEdit,
|
|
1451
1459
|
style: {
|
|
1452
1460
|
width: "100%",
|
|
1453
1461
|
height: "100%"
|
|
1454
1462
|
}
|
|
1455
1463
|
})
|
|
1456
|
-
}, "cancel-btn") :
|
|
1464
|
+
}, "cancel-btn") : re && !xe ? /* @__PURE__ */ _(C.div, {
|
|
1457
1465
|
initial: {
|
|
1458
1466
|
opacity: 0,
|
|
1459
1467
|
scale: .5
|
|
@@ -1474,17 +1482,17 @@ var nt = .9, rt = {
|
|
|
1474
1482
|
position: "absolute",
|
|
1475
1483
|
inset: 0
|
|
1476
1484
|
},
|
|
1477
|
-
children: /* @__PURE__ */ _(
|
|
1485
|
+
children: /* @__PURE__ */ _(H, {
|
|
1478
1486
|
variant: "ghost",
|
|
1479
|
-
icon: /* @__PURE__ */ _(
|
|
1487
|
+
icon: /* @__PURE__ */ _(fe, {
|
|
1480
1488
|
size: 14,
|
|
1481
1489
|
"aria-hidden": !0
|
|
1482
1490
|
}),
|
|
1483
1491
|
onClick: (e) => {
|
|
1484
|
-
e.stopPropagation(),
|
|
1492
|
+
e.stopPropagation(), Se(!0);
|
|
1485
1493
|
},
|
|
1486
|
-
"aria-label":
|
|
1487
|
-
title:
|
|
1494
|
+
"aria-label": R.add,
|
|
1495
|
+
title: R.add,
|
|
1488
1496
|
style: {
|
|
1489
1497
|
width: "100%",
|
|
1490
1498
|
height: "100%"
|
|
@@ -1492,7 +1500,7 @@ var nt = .9, rt = {
|
|
|
1492
1500
|
})
|
|
1493
1501
|
}, "plus-btn") : null
|
|
1494
1502
|
})
|
|
1495
|
-
}, "lead"),
|
|
1503
|
+
}, "lead"), dt && he && /* @__PURE__ */ _(C.div, {
|
|
1496
1504
|
initial: {
|
|
1497
1505
|
opacity: 0,
|
|
1498
1506
|
scale: nt,
|
|
@@ -1510,7 +1518,7 @@ var nt = .9, rt = {
|
|
|
1510
1518
|
scale: nt,
|
|
1511
1519
|
width: 0,
|
|
1512
1520
|
marginLeft: 0,
|
|
1513
|
-
transition:
|
|
1521
|
+
transition: Ee.current ? {
|
|
1514
1522
|
type: "tween",
|
|
1515
1523
|
duration: J?.wrap?.exitDuration ?? .15,
|
|
1516
1524
|
ease: "easeOut"
|
|
@@ -1522,8 +1530,8 @@ var nt = .9, rt = {
|
|
|
1522
1530
|
type: "tween",
|
|
1523
1531
|
duration: .15
|
|
1524
1532
|
},
|
|
1525
|
-
width:
|
|
1526
|
-
marginLeft:
|
|
1533
|
+
width: it(ft),
|
|
1534
|
+
marginLeft: it(ft)
|
|
1527
1535
|
}
|
|
1528
1536
|
},
|
|
1529
1537
|
transition: {
|
|
@@ -1544,14 +1552,14 @@ var nt = .9, rt = {
|
|
|
1544
1552
|
transformOrigin: "right",
|
|
1545
1553
|
height: 28
|
|
1546
1554
|
},
|
|
1547
|
-
children: /* @__PURE__ */ _(
|
|
1555
|
+
children: /* @__PURE__ */ _(H, {
|
|
1548
1556
|
variant: "primary",
|
|
1549
1557
|
icon: /* @__PURE__ */ _(Le, { mode: Xe ? "stop" : A ? "check" : "send" }),
|
|
1550
1558
|
onClick: (e) => {
|
|
1551
1559
|
e.stopPropagation(), Xe ? i?.() : j || r(t, Pe);
|
|
1552
1560
|
},
|
|
1553
1561
|
disabled: Ze,
|
|
1554
|
-
"aria-label": Xe ?
|
|
1562
|
+
"aria-label": Xe ? R.stop : A ? R.save : R.send,
|
|
1555
1563
|
style: {
|
|
1556
1564
|
flexShrink: 0,
|
|
1557
1565
|
width: 28
|
|
@@ -1566,31 +1574,31 @@ var nt = .9, rt = {
|
|
|
1566
1574
|
})
|
|
1567
1575
|
}),
|
|
1568
1576
|
/* @__PURE__ */ _(Be, {
|
|
1569
|
-
isAddOpen:
|
|
1570
|
-
setIsAddOpen:
|
|
1577
|
+
isAddOpen: xe,
|
|
1578
|
+
setIsAddOpen: Se,
|
|
1571
1579
|
items: N || void 0,
|
|
1572
1580
|
onAdd: (e, t) => {
|
|
1573
1581
|
let n = N ? N.find((e) => e.id === t) : void 0;
|
|
1574
|
-
t === "attach" && !n?.onSelect &&
|
|
1582
|
+
t === "attach" && !n?.onSelect && je.current?.click(), a?.();
|
|
1575
1583
|
},
|
|
1576
|
-
showInlineGlyph:
|
|
1577
|
-
showButtons:
|
|
1584
|
+
showInlineGlyph: dt,
|
|
1585
|
+
showButtons: he,
|
|
1578
1586
|
ac: J
|
|
1579
1587
|
}),
|
|
1580
1588
|
/* @__PURE__ */ _(Re, {
|
|
1581
|
-
showActions:
|
|
1582
|
-
showReadMore:
|
|
1583
|
-
isExpanded:
|
|
1584
|
-
setIsExpanded:
|
|
1589
|
+
showActions: st,
|
|
1590
|
+
showReadMore: ct,
|
|
1591
|
+
isExpanded: _e,
|
|
1592
|
+
setIsExpanded: ve,
|
|
1585
1593
|
onCopy: D,
|
|
1586
1594
|
onEdit: O,
|
|
1587
1595
|
value: t,
|
|
1588
1596
|
ac: J
|
|
1589
1597
|
}),
|
|
1590
|
-
|
|
1598
|
+
ut && (G.state === "denied" || G.state === "failed") && /* @__PURE__ */ _("p", {
|
|
1591
1599
|
className: W.voiceNote,
|
|
1592
1600
|
"data-tone": G.state,
|
|
1593
|
-
children: G.state === "denied" ?
|
|
1601
|
+
children: G.state === "denied" ? R.microphoneBlockedHelp : G.error ?? te.couldNotOpen
|
|
1594
1602
|
})
|
|
1595
1603
|
]
|
|
1596
1604
|
})
|
|
@@ -1599,7 +1607,7 @@ var nt = .9, rt = {
|
|
|
1599
1607
|
});
|
|
1600
1608
|
//#endregion
|
|
1601
1609
|
//#region src/turnParts/turnParts.ts
|
|
1602
|
-
function
|
|
1610
|
+
function ct(e, t) {
|
|
1603
1611
|
let n = e.findIndex((e) => e.id === t.id);
|
|
1604
1612
|
if (n === -1) return [...e, t];
|
|
1605
1613
|
let r = e.slice();
|
|
@@ -1610,7 +1618,7 @@ function st(e, t) {
|
|
|
1610
1618
|
}
|
|
1611
1619
|
//#endregion
|
|
1612
1620
|
//#region src/useChatTurns/useChatTurns.ts
|
|
1613
|
-
var
|
|
1621
|
+
var lt = 260, ut = 220, dt = "Generating response", J = () => typeof crypto < "u" && "randomUUID" in crypto ? crypto.randomUUID() : Math.random().toString(36).slice(2, 11), ft = () => ({
|
|
1614
1622
|
id: J(),
|
|
1615
1623
|
user: "",
|
|
1616
1624
|
ai: "",
|
|
@@ -1618,7 +1626,7 @@ var ct = 260, lt = 220, ut = "Generating response", J = () => typeof crypto < "u
|
|
|
1618
1626
|
versions: [],
|
|
1619
1627
|
versionIndex: 0,
|
|
1620
1628
|
state: "idle"
|
|
1621
|
-
}),
|
|
1629
|
+
}), pt = (e) => {
|
|
1622
1630
|
let t = e.versions;
|
|
1623
1631
|
if (!t?.length) return e;
|
|
1624
1632
|
let n = e.versionIndex ?? 0, r = t[n];
|
|
@@ -1630,7 +1638,7 @@ var ct = 260, lt = 220, ut = "Generating response", J = () => typeof crypto < "u
|
|
|
1630
1638
|
parts: e.parts
|
|
1631
1639
|
} : t)
|
|
1632
1640
|
};
|
|
1633
|
-
},
|
|
1641
|
+
}, mt = (e) => typeof e == "object" && !!e && Symbol.asyncIterator in e, ht = (e, t, n) => {
|
|
1634
1642
|
let r = 1e3 / t, i = Array(e.length), a = 0;
|
|
1635
1643
|
for (let t = 0; t < e.length; t++) {
|
|
1636
1644
|
a += r;
|
|
@@ -1639,8 +1647,8 @@ var ct = 260, lt = 220, ut = "Generating response", J = () => typeof crypto < "u
|
|
|
1639
1647
|
}
|
|
1640
1648
|
return i;
|
|
1641
1649
|
};
|
|
1642
|
-
function
|
|
1643
|
-
let [a, s] = m(() => [
|
|
1650
|
+
function gt({ onSend: e, revealSpeed: t = lt, sentencePause: n = ut, announcements: r, nextTurn: i = "after-answer" }) {
|
|
1651
|
+
let [a, s] = m(() => [ft()]), [l, u] = m(!1), d = p(null), f = p(null), h = p(/* @__PURE__ */ new Map()), g = p(/* @__PURE__ */ new Map()), _ = p(null), v = p(e), y = p(r), b = p(a);
|
|
1644
1652
|
c(() => {
|
|
1645
1653
|
v.current = e, b.current = a, y.current = r;
|
|
1646
1654
|
});
|
|
@@ -1653,7 +1661,7 @@ function ht({ onSend: e, revealSpeed: t = ct, sentencePause: n = lt, announcemen
|
|
|
1653
1661
|
...n,
|
|
1654
1662
|
...t
|
|
1655
1663
|
};
|
|
1656
|
-
return "versionIndex" in t || "versions" in t ? i :
|
|
1664
|
+
return "versionIndex" in t || "versions" in t ? i : pt(i);
|
|
1657
1665
|
});
|
|
1658
1666
|
return r ? (b.current = i, i) : n;
|
|
1659
1667
|
});
|
|
@@ -1665,10 +1673,10 @@ function ht({ onSend: e, revealSpeed: t = ct, sentencePause: n = lt, announcemen
|
|
|
1665
1673
|
e.clear(), t.clear(), s((e) => {
|
|
1666
1674
|
let t = e.map((e) => {
|
|
1667
1675
|
let t = n.find(([t]) => t === e.id)?.[1], i = r.find(([t]) => t === e.id)?.[1];
|
|
1668
|
-
return t === void 0 && !i ? e :
|
|
1676
|
+
return t === void 0 && !i ? e : pt({
|
|
1669
1677
|
...e,
|
|
1670
1678
|
...t === void 0 ? null : { ai: t },
|
|
1671
|
-
...i ? { parts: i.reduce(
|
|
1679
|
+
...i ? { parts: i.reduce(ct, e.parts) } : null
|
|
1672
1680
|
});
|
|
1673
1681
|
});
|
|
1674
1682
|
return b.current = t, t;
|
|
@@ -1681,7 +1689,11 @@ function ht({ onSend: e, revealSpeed: t = ct, sentencePause: n = lt, announcemen
|
|
|
1681
1689
|
let n = g.current.get(e);
|
|
1682
1690
|
n ? n.push(t) : g.current.set(e, [t]), C();
|
|
1683
1691
|
}, [C]), E = o((e, t) => {
|
|
1684
|
-
|
|
1692
|
+
let n = b.current.find((t) => t.id === e), r = n?.parts?.some((e) => e.id === t.id) || g.current.get(e)?.some((e) => e.id === t.id), i = h.current.get(e) ?? n?.ai ?? "";
|
|
1693
|
+
T(e, r || t.at !== void 0 ? t : {
|
|
1694
|
+
...t,
|
|
1695
|
+
at: i.length
|
|
1696
|
+
});
|
|
1685
1697
|
}, [T]);
|
|
1686
1698
|
c(() => () => {
|
|
1687
1699
|
f.current !== null && cancelAnimationFrame(f.current), d.current?.abort();
|
|
@@ -1689,7 +1701,7 @@ function ht({ onSend: e, revealSpeed: t = ct, sentencePause: n = lt, announcemen
|
|
|
1689
1701
|
let D = o(() => {
|
|
1690
1702
|
s((e) => {
|
|
1691
1703
|
if (e.some((e) => (e.state === "idle" || e.state === "typing") && e.ai === "")) return e;
|
|
1692
|
-
let t = [...e,
|
|
1704
|
+
let t = [...e, ft()];
|
|
1693
1705
|
return b.current = t, t;
|
|
1694
1706
|
});
|
|
1695
1707
|
}, []), O = o((e, t) => {
|
|
@@ -1699,7 +1711,7 @@ function ht({ onSend: e, revealSpeed: t = ct, sentencePause: n = lt, announcemen
|
|
|
1699
1711
|
w(e, r), a();
|
|
1700
1712
|
return;
|
|
1701
1713
|
}
|
|
1702
|
-
let o =
|
|
1714
|
+
let o = ht(r, t, n), s = performance.now(), c = 0, l = () => {
|
|
1703
1715
|
if (i.aborted) {
|
|
1704
1716
|
w(e, r), a();
|
|
1705
1717
|
return;
|
|
@@ -1721,7 +1733,7 @@ function ht({ onSend: e, revealSpeed: t = ct, sentencePause: n = lt, announcemen
|
|
|
1721
1733
|
let n = y.current;
|
|
1722
1734
|
if (n === !1) return;
|
|
1723
1735
|
if (e === "responding") {
|
|
1724
|
-
let e = n && "responding" in n ? n.responding :
|
|
1736
|
+
let e = n && "responding" in n ? n.responding : dt;
|
|
1725
1737
|
e && Ke(e);
|
|
1726
1738
|
return;
|
|
1727
1739
|
}
|
|
@@ -1743,16 +1755,23 @@ function ht({ onSend: e, revealSpeed: t = ct, sentencePause: n = lt, announcemen
|
|
|
1743
1755
|
versions: s,
|
|
1744
1756
|
versionIndex: s.length - 1
|
|
1745
1757
|
}), A("responding"), i === "at-send" && !n && D();
|
|
1746
|
-
let c = "";
|
|
1758
|
+
let c = "", l = /* @__PURE__ */ new Set();
|
|
1747
1759
|
try {
|
|
1748
1760
|
let n = v.current(t, {
|
|
1749
1761
|
signal: a.signal,
|
|
1750
1762
|
turnId: e,
|
|
1751
1763
|
attachments: r
|
|
1752
1764
|
});
|
|
1753
|
-
if (
|
|
1765
|
+
if (mt(n)) for await (let t of n) {
|
|
1754
1766
|
if (a.signal.aborted) break;
|
|
1755
|
-
typeof t == "string"
|
|
1767
|
+
if (typeof t == "string") c += t, w(e, c);
|
|
1768
|
+
else {
|
|
1769
|
+
let n = !l.has(t.id);
|
|
1770
|
+
l.add(t.id), T(e, n && t.at === void 0 ? {
|
|
1771
|
+
...t,
|
|
1772
|
+
at: c.length
|
|
1773
|
+
} : t);
|
|
1774
|
+
}
|
|
1756
1775
|
}
|
|
1757
1776
|
else c = await n ?? "", await k(e, c, a.signal);
|
|
1758
1777
|
} catch (e) {
|
|
@@ -1843,23 +1862,23 @@ var Y = {
|
|
|
1843
1862
|
menuItem: "ick-menuItem-V7gI",
|
|
1844
1863
|
menuIcon: "ick-menuIcon-tjBi",
|
|
1845
1864
|
menuCount: "ick-menuCount-tC3s"
|
|
1846
|
-
},
|
|
1865
|
+
}, _t = {
|
|
1847
1866
|
s: "s",
|
|
1848
1867
|
m: "m",
|
|
1849
1868
|
l: "l"
|
|
1850
|
-
},
|
|
1869
|
+
}, vt = {
|
|
1851
1870
|
s: 14,
|
|
1852
1871
|
m: 16,
|
|
1853
1872
|
l: 18
|
|
1854
|
-
},
|
|
1873
|
+
}, yt = vt, bt = {
|
|
1855
1874
|
s: Y.s,
|
|
1856
1875
|
m: Y.m,
|
|
1857
1876
|
l: Y.l
|
|
1858
|
-
},
|
|
1877
|
+
}, xt = {
|
|
1859
1878
|
plain: Y.plain,
|
|
1860
1879
|
glass: Y.glass,
|
|
1861
1880
|
bordered: Y.bordered
|
|
1862
|
-
},
|
|
1881
|
+
}, St = (e) => e.count === void 0 ? e.label : `${e.label}, ${e.count}`, Ct = (e) => {
|
|
1863
1882
|
let t = e?.parentElement ?? null;
|
|
1864
1883
|
for (; t;) {
|
|
1865
1884
|
let { overflowY: e } = getComputedStyle(t);
|
|
@@ -1867,8 +1886,8 @@ var Y = {
|
|
|
1867
1886
|
t = t.parentElement;
|
|
1868
1887
|
}
|
|
1869
1888
|
return window;
|
|
1870
|
-
},
|
|
1871
|
-
let D =
|
|
1889
|
+
}, wt = r(function({ title: e, subtitle: t, avatar: n, headingLevel: r = 2, truncate: i = !0, onBack: a, backHref: s, backLabel: l, actions: u = [], overflowLabel: d, variant: f = "plain", size: h = "m", align: g = "start", sticky: y = !1, elevateOnScroll: b = y, collapseActionsAt: x = 520, landmark: S = !0, children: C, className: w, ...T }, E) {
|
|
1890
|
+
let D = U("header"), k = l ?? D.back, A = d ?? D.more, j = p(null), [M, N] = m(!1), [ee, P] = m(!1), F = o((e) => {
|
|
1872
1891
|
j.current = e, typeof E == "function" ? E(e) : E && (E.current = e);
|
|
1873
1892
|
}, [E]);
|
|
1874
1893
|
c(() => {
|
|
@@ -1881,19 +1900,19 @@ var Y = {
|
|
|
1881
1900
|
return t.observe(e), () => t.disconnect();
|
|
1882
1901
|
}, [x]), c(() => {
|
|
1883
1902
|
if (!b) return;
|
|
1884
|
-
let e =
|
|
1903
|
+
let e = Ct(j.current), t = () => {
|
|
1885
1904
|
let t = e === window ? window.scrollY : e.scrollTop;
|
|
1886
1905
|
P(t > 0);
|
|
1887
1906
|
};
|
|
1888
1907
|
return t(), e.addEventListener("scroll", t, { passive: !0 }), () => e.removeEventListener("scroll", t);
|
|
1889
1908
|
}, [b]);
|
|
1890
|
-
let I = x !== !1 && M,
|
|
1909
|
+
let I = x !== !1 && M, L = I ? u.filter((e) => e.pinned) : u, R = I ? u.filter((e) => !e.pinned) : [], te = r ? `h${r}` : "span";
|
|
1891
1910
|
return /* @__PURE__ */ v(S ? "header" : "div", {
|
|
1892
1911
|
ref: F,
|
|
1893
1912
|
className: [
|
|
1894
1913
|
Y.header,
|
|
1895
|
-
|
|
1896
|
-
|
|
1914
|
+
bt[h],
|
|
1915
|
+
xt[f],
|
|
1897
1916
|
g === "center" ? Y.center : "",
|
|
1898
1917
|
y ? Y.sticky : "",
|
|
1899
1918
|
w ?? ""
|
|
@@ -1908,14 +1927,14 @@ var Y = {
|
|
|
1908
1927
|
className: Y.back,
|
|
1909
1928
|
"aria-label": k,
|
|
1910
1929
|
children: /* @__PURE__ */ _(O, {
|
|
1911
|
-
size:
|
|
1930
|
+
size: yt[h],
|
|
1912
1931
|
"aria-hidden": !0
|
|
1913
1932
|
})
|
|
1914
|
-
}) : a ? /* @__PURE__ */ _(
|
|
1933
|
+
}) : a ? /* @__PURE__ */ _(H, {
|
|
1915
1934
|
variant: "secondary",
|
|
1916
|
-
size:
|
|
1935
|
+
size: _t[h],
|
|
1917
1936
|
icon: /* @__PURE__ */ _(O, {
|
|
1918
|
-
size:
|
|
1937
|
+
size: yt[h],
|
|
1919
1938
|
"aria-hidden": !0
|
|
1920
1939
|
}),
|
|
1921
1940
|
"aria-label": k,
|
|
@@ -1927,7 +1946,7 @@ var Y = {
|
|
|
1927
1946
|
}),
|
|
1928
1947
|
(e || t) && /* @__PURE__ */ v("div", {
|
|
1929
1948
|
className: Y.titles,
|
|
1930
|
-
children: [e && /* @__PURE__ */ _(
|
|
1949
|
+
children: [e && /* @__PURE__ */ _(te, {
|
|
1931
1950
|
className: [Y.title, i ? Y.truncate : ""].filter(Boolean).join(" "),
|
|
1932
1951
|
title: typeof e == "string" && i ? e : void 0,
|
|
1933
1952
|
children: e
|
|
@@ -1941,12 +1960,12 @@ var Y = {
|
|
|
1941
1960
|
className: Y.end,
|
|
1942
1961
|
children: [
|
|
1943
1962
|
C,
|
|
1944
|
-
|
|
1963
|
+
L.map((e) => /* @__PURE__ */ _(Tt, {
|
|
1945
1964
|
action: e,
|
|
1946
1965
|
size: h
|
|
1947
1966
|
}, e.id)),
|
|
1948
|
-
|
|
1949
|
-
actions:
|
|
1967
|
+
R.length > 0 && /* @__PURE__ */ _(Et, {
|
|
1968
|
+
actions: R,
|
|
1950
1969
|
size: h,
|
|
1951
1970
|
label: A
|
|
1952
1971
|
})
|
|
@@ -1954,8 +1973,8 @@ var Y = {
|
|
|
1954
1973
|
})]
|
|
1955
1974
|
});
|
|
1956
1975
|
});
|
|
1957
|
-
function
|
|
1958
|
-
let n =
|
|
1976
|
+
function Tt({ action: e, size: t }) {
|
|
1977
|
+
let n = St(e), r = e.count !== void 0 && e.count > 0 ? /* @__PURE__ */ _("span", {
|
|
1959
1978
|
className: Y.badge,
|
|
1960
1979
|
"aria-hidden": "true",
|
|
1961
1980
|
children: e.count > 99 ? "99+" : e.count
|
|
@@ -1968,9 +1987,9 @@ function wt({ action: e, size: t }) {
|
|
|
1968
1987
|
children: [e.icon, r]
|
|
1969
1988
|
}) : /* @__PURE__ */ v("span", {
|
|
1970
1989
|
className: Y.actionWrap,
|
|
1971
|
-
children: [/* @__PURE__ */ _(
|
|
1990
|
+
children: [/* @__PURE__ */ _(H, {
|
|
1972
1991
|
variant: "secondary",
|
|
1973
|
-
size:
|
|
1992
|
+
size: _t[t],
|
|
1974
1993
|
icon: e.icon,
|
|
1975
1994
|
"aria-label": n,
|
|
1976
1995
|
title: e.label,
|
|
@@ -1980,7 +1999,7 @@ function wt({ action: e, size: t }) {
|
|
|
1980
1999
|
}), r]
|
|
1981
2000
|
});
|
|
1982
2001
|
}
|
|
1983
|
-
function
|
|
2002
|
+
function Et({ actions: e, size: t, label: n }) {
|
|
1984
2003
|
let [r, i] = m(!1), [a, s] = m(0), [u, d] = m(!1), f = p(null), h = p(null), g = l(), y = o((e) => {
|
|
1985
2004
|
i(!1), e && f.current?.focus();
|
|
1986
2005
|
}, []), b = Math.min(a, Math.max(e.length - 1, 0));
|
|
@@ -1988,12 +2007,12 @@ function Tt({ actions: e, size: t, label: n }) {
|
|
|
1988
2007
|
r && (h.current?.querySelectorAll("[role=\"menuitem\"], [role=\"menuitemcheckbox\"]"))?.[b]?.focus();
|
|
1989
2008
|
}, [r, b]), /* @__PURE__ */ v("span", {
|
|
1990
2009
|
className: Y.overflow,
|
|
1991
|
-
children: [/* @__PURE__ */ _(
|
|
2010
|
+
children: [/* @__PURE__ */ _(H, {
|
|
1992
2011
|
ref: f,
|
|
1993
2012
|
variant: "secondary",
|
|
1994
|
-
size:
|
|
1995
|
-
icon: /* @__PURE__ */ _(
|
|
1996
|
-
size:
|
|
2013
|
+
size: _t[t],
|
|
2014
|
+
icon: /* @__PURE__ */ _(ce, {
|
|
2015
|
+
size: yt[t],
|
|
1997
2016
|
"aria-hidden": !0
|
|
1998
2017
|
}),
|
|
1999
2018
|
"aria-label": n,
|
|
@@ -2062,17 +2081,17 @@ function Tt({ actions: e, size: t, label: n }) {
|
|
|
2062
2081
|
})]
|
|
2063
2082
|
});
|
|
2064
2083
|
}
|
|
2065
|
-
var
|
|
2084
|
+
var Dt = {
|
|
2066
2085
|
row: "ick-row-yugg",
|
|
2067
2086
|
reveal: "ick-reveal-z3mw"
|
|
2068
|
-
},
|
|
2069
|
-
function
|
|
2070
|
-
let [h, y] = m(!1), b = p(null), x =
|
|
2087
|
+
}, Ot = 1600;
|
|
2088
|
+
function kt({ text: e, onCopy: t, onRegenerate: n, onFeedback: r, feedback: i = null, children: a, reveal: s = !1, busy: l = !1, labels: u, className: d, ...f }) {
|
|
2089
|
+
let [h, y] = m(!1), b = p(null), x = U("answerActions", u);
|
|
2071
2090
|
c(() => () => {
|
|
2072
2091
|
b.current && clearTimeout(b.current);
|
|
2073
2092
|
}, []);
|
|
2074
2093
|
let S = o(() => {
|
|
2075
|
-
t ? t(e) : navigator.clipboard?.writeText(e), y(!0), Ke(x.copied), b.current && clearTimeout(b.current), b.current = setTimeout(() => y(!1),
|
|
2094
|
+
t ? t(e) : navigator.clipboard?.writeText(e), y(!0), Ke(x.copied), b.current && clearTimeout(b.current), b.current = setTimeout(() => y(!1), Ot);
|
|
2076
2095
|
}, [
|
|
2077
2096
|
x.copied,
|
|
2078
2097
|
t,
|
|
@@ -2080,13 +2099,13 @@ function Ot({ text: e, onCopy: t, onRegenerate: n, onFeedback: r, feedback: i =
|
|
|
2080
2099
|
]), C = (e) => r?.(i === e ? null : e);
|
|
2081
2100
|
return /* @__PURE__ */ v("div", {
|
|
2082
2101
|
className: [
|
|
2083
|
-
|
|
2084
|
-
s ?
|
|
2102
|
+
Dt.row,
|
|
2103
|
+
s ? Dt.reveal : "",
|
|
2085
2104
|
d ?? ""
|
|
2086
2105
|
].filter(Boolean).join(" "),
|
|
2087
2106
|
...f,
|
|
2088
2107
|
children: [
|
|
2089
|
-
/* @__PURE__ */ _(
|
|
2108
|
+
e.trim() && /* @__PURE__ */ _(H, {
|
|
2090
2109
|
variant: "ghost",
|
|
2091
2110
|
icon: _(h ? j : P, {
|
|
2092
2111
|
size: 14,
|
|
@@ -2096,9 +2115,9 @@ function Ot({ text: e, onCopy: t, onRegenerate: n, onFeedback: r, feedback: i =
|
|
|
2096
2115
|
"aria-label": h ? x.copied : x.copy,
|
|
2097
2116
|
title: h ? x.copied : x.copy
|
|
2098
2117
|
}),
|
|
2099
|
-
n && /* @__PURE__ */ _(
|
|
2118
|
+
n && /* @__PURE__ */ _(H, {
|
|
2100
2119
|
variant: "ghost",
|
|
2101
|
-
icon: /* @__PURE__ */ _(
|
|
2120
|
+
icon: /* @__PURE__ */ _(pe, {
|
|
2102
2121
|
size: 14,
|
|
2103
2122
|
"aria-hidden": !0
|
|
2104
2123
|
}),
|
|
@@ -2108,9 +2127,9 @@ function Ot({ text: e, onCopy: t, onRegenerate: n, onFeedback: r, feedback: i =
|
|
|
2108
2127
|
"aria-label": x.regenerate,
|
|
2109
2128
|
title: x.regenerate
|
|
2110
2129
|
}),
|
|
2111
|
-
r && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(
|
|
2130
|
+
r && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(H, {
|
|
2112
2131
|
variant: "ghost",
|
|
2113
|
-
icon: /* @__PURE__ */ _(
|
|
2132
|
+
icon: /* @__PURE__ */ _(be, {
|
|
2114
2133
|
size: 14,
|
|
2115
2134
|
"aria-hidden": !0
|
|
2116
2135
|
}),
|
|
@@ -2118,9 +2137,9 @@ function Ot({ text: e, onCopy: t, onRegenerate: n, onFeedback: r, feedback: i =
|
|
|
2118
2137
|
"aria-pressed": i === "up",
|
|
2119
2138
|
"aria-label": x.up,
|
|
2120
2139
|
title: x.up
|
|
2121
|
-
}), /* @__PURE__ */ _(
|
|
2140
|
+
}), /* @__PURE__ */ _(H, {
|
|
2122
2141
|
variant: "ghost",
|
|
2123
|
-
icon: /* @__PURE__ */ _(
|
|
2142
|
+
icon: /* @__PURE__ */ _(ye, {
|
|
2124
2143
|
size: 14,
|
|
2125
2144
|
"aria-hidden": !0
|
|
2126
2145
|
}),
|
|
@@ -2133,7 +2152,7 @@ function Ot({ text: e, onCopy: t, onRegenerate: n, onFeedback: r, feedback: i =
|
|
|
2133
2152
|
]
|
|
2134
2153
|
});
|
|
2135
2154
|
}
|
|
2136
|
-
var
|
|
2155
|
+
var At = {
|
|
2137
2156
|
branch: "ick-branch-lR6b",
|
|
2138
2157
|
step: "ick-step-JSch ick-target-vuT2",
|
|
2139
2158
|
count: "ick-count-kOmV",
|
|
@@ -2141,19 +2160,19 @@ var kt = {
|
|
|
2141
2160
|
};
|
|
2142
2161
|
//#endregion
|
|
2143
2162
|
//#region src/Branch/Branch.tsx
|
|
2144
|
-
function
|
|
2145
|
-
let o =
|
|
2163
|
+
function jt({ total: e, index: t, onSelect: n, labels: r, className: i, ...a }) {
|
|
2164
|
+
let o = U("branch", r);
|
|
2146
2165
|
if (e < 2) return null;
|
|
2147
2166
|
let s = Math.min(Math.max(t, 0), e - 1), c = o.position.replace("{index}", String(s + 1)).replace("{total}", String(e));
|
|
2148
2167
|
return /* @__PURE__ */ v("div", {
|
|
2149
|
-
className: [
|
|
2168
|
+
className: [At.branch, i ?? ""].filter(Boolean).join(" "),
|
|
2150
2169
|
role: "group",
|
|
2151
2170
|
"aria-label": c,
|
|
2152
2171
|
...a,
|
|
2153
2172
|
children: [
|
|
2154
2173
|
/* @__PURE__ */ _("button", {
|
|
2155
2174
|
type: "button",
|
|
2156
|
-
className:
|
|
2175
|
+
className: At.step,
|
|
2157
2176
|
onClick: () => n(s - 1),
|
|
2158
2177
|
onPointerDown: (e) => e.stopPropagation(),
|
|
2159
2178
|
disabled: s === 0,
|
|
@@ -2164,11 +2183,11 @@ function At({ total: e, index: t, onSelect: n, labels: r, className: i, ...a })
|
|
|
2164
2183
|
})
|
|
2165
2184
|
}),
|
|
2166
2185
|
/* @__PURE__ */ v("span", {
|
|
2167
|
-
className:
|
|
2186
|
+
className: At.count,
|
|
2168
2187
|
children: [
|
|
2169
2188
|
s + 1,
|
|
2170
2189
|
/* @__PURE__ */ _("span", {
|
|
2171
|
-
className:
|
|
2190
|
+
className: At.of,
|
|
2172
2191
|
children: "/"
|
|
2173
2192
|
}),
|
|
2174
2193
|
e
|
|
@@ -2176,7 +2195,7 @@ function At({ total: e, index: t, onSelect: n, labels: r, className: i, ...a })
|
|
|
2176
2195
|
}),
|
|
2177
2196
|
/* @__PURE__ */ _("button", {
|
|
2178
2197
|
type: "button",
|
|
2179
|
-
className:
|
|
2198
|
+
className: At.step,
|
|
2180
2199
|
onClick: () => n(s + 1),
|
|
2181
2200
|
onPointerDown: (e) => e.stopPropagation(),
|
|
2182
2201
|
disabled: s === e - 1,
|
|
@@ -2189,7 +2208,7 @@ function At({ total: e, index: t, onSelect: n, labels: r, className: i, ...a })
|
|
|
2189
2208
|
]
|
|
2190
2209
|
});
|
|
2191
2210
|
}
|
|
2192
|
-
var
|
|
2211
|
+
var Mt = {
|
|
2193
2212
|
loader: "ick-loader-7WbG",
|
|
2194
2213
|
dot: "ick-dot-JJFT",
|
|
2195
2214
|
blink: "ick-blink-MCVu",
|
|
@@ -2199,10 +2218,10 @@ var jt = {
|
|
|
2199
2218
|
};
|
|
2200
2219
|
//#endregion
|
|
2201
2220
|
//#region src/Loader/Loader.tsx
|
|
2202
|
-
function
|
|
2221
|
+
function Nt({ variant: e = "dots", children: t, label: n = null, className: r, ...i }) {
|
|
2203
2222
|
let a = [
|
|
2204
|
-
|
|
2205
|
-
|
|
2223
|
+
Mt.loader,
|
|
2224
|
+
Mt[e],
|
|
2206
2225
|
r ?? ""
|
|
2207
2226
|
].filter(Boolean).join(" ");
|
|
2208
2227
|
return /* @__PURE__ */ v("div", {
|
|
@@ -2211,21 +2230,21 @@ function Mt({ variant: e = "dots", children: t, label: n = null, className: r, .
|
|
|
2211
2230
|
"aria-hidden": !n || void 0,
|
|
2212
2231
|
...i,
|
|
2213
2232
|
children: [n && /* @__PURE__ */ _("span", {
|
|
2214
|
-
className:
|
|
2233
|
+
className: Mt.srOnly,
|
|
2215
2234
|
children: n
|
|
2216
2235
|
}), e === "dots" ? /* @__PURE__ */ v(g, { children: [
|
|
2217
|
-
/* @__PURE__ */ _("span", { className:
|
|
2218
|
-
/* @__PURE__ */ _("span", { className:
|
|
2219
|
-
/* @__PURE__ */ _("span", { className:
|
|
2236
|
+
/* @__PURE__ */ _("span", { className: Mt.dot }),
|
|
2237
|
+
/* @__PURE__ */ _("span", { className: Mt.dot }),
|
|
2238
|
+
/* @__PURE__ */ _("span", { className: Mt.dot })
|
|
2220
2239
|
] }) : /* @__PURE__ */ _("span", {
|
|
2221
|
-
className:
|
|
2240
|
+
className: Mt.text,
|
|
2222
2241
|
children: t
|
|
2223
2242
|
})]
|
|
2224
2243
|
});
|
|
2225
2244
|
}
|
|
2226
2245
|
//#endregion
|
|
2227
2246
|
//#region src/disclosure/useDisclosure.ts
|
|
2228
|
-
function
|
|
2247
|
+
function Pt({ open: e, defaultOpen: t, onOpenChange: n, preferOpen: r }) {
|
|
2229
2248
|
let [i, a] = m(null), s = e ?? i ?? t ?? r;
|
|
2230
2249
|
return {
|
|
2231
2250
|
isOpen: s,
|
|
@@ -2239,7 +2258,7 @@ function Nt({ open: e, defaultOpen: t, onOpenChange: n, preferOpen: r }) {
|
|
|
2239
2258
|
])
|
|
2240
2259
|
};
|
|
2241
2260
|
}
|
|
2242
|
-
var
|
|
2261
|
+
var Ft = {
|
|
2243
2262
|
header: "ick-header-C0FS ick-target-vuT2",
|
|
2244
2263
|
chevron: "ick-chevron-RY4c",
|
|
2245
2264
|
static: "ick-static-6vUk",
|
|
@@ -2247,30 +2266,30 @@ var Pt = {
|
|
|
2247
2266
|
label: "ick-label-L-k2",
|
|
2248
2267
|
sweep: "ick-sweep-owLs",
|
|
2249
2268
|
meta: "ick-meta-wT3y"
|
|
2250
|
-
},
|
|
2251
|
-
function
|
|
2269
|
+
}, It = (...e) => e.filter(Boolean).join(" ");
|
|
2270
|
+
function Lt({ fit: e = "band", open: t, onToggle: n, controls: r, disabled: i, glyph: a, label: o, pending: s, meta: c, children: l, className: u }) {
|
|
2252
2271
|
let d = /* @__PURE__ */ v(g, { children: [
|
|
2253
2272
|
a && /* @__PURE__ */ _("span", {
|
|
2254
|
-
className:
|
|
2273
|
+
className: Ft.glyph,
|
|
2255
2274
|
children: a
|
|
2256
2275
|
}),
|
|
2257
2276
|
/* @__PURE__ */ _("span", {
|
|
2258
|
-
className:
|
|
2277
|
+
className: Ft.label,
|
|
2259
2278
|
"data-pending": s || void 0,
|
|
2260
2279
|
children: o
|
|
2261
2280
|
}),
|
|
2262
2281
|
l,
|
|
2263
2282
|
c ? /* @__PURE__ */ _("span", {
|
|
2264
|
-
className:
|
|
2283
|
+
className: Ft.meta,
|
|
2265
2284
|
children: c
|
|
2266
2285
|
}) : null,
|
|
2267
2286
|
n && /* @__PURE__ */ _(M, {
|
|
2268
|
-
className:
|
|
2287
|
+
className: Ft.chevron,
|
|
2269
2288
|
size: 14,
|
|
2270
2289
|
"aria-hidden": !0
|
|
2271
2290
|
})
|
|
2272
2291
|
] }), f = {
|
|
2273
|
-
className: Ft
|
|
2292
|
+
className: It(Ft.header, u),
|
|
2274
2293
|
"data-fit": e
|
|
2275
2294
|
};
|
|
2276
2295
|
return n ? /* @__PURE__ */ _("button", {
|
|
@@ -2284,25 +2303,25 @@ function It({ fit: e = "band", open: t, onToggle: n, controls: r, disabled: i, g
|
|
|
2284
2303
|
children: d
|
|
2285
2304
|
}) : /* @__PURE__ */ _("div", {
|
|
2286
2305
|
...f,
|
|
2287
|
-
className:
|
|
2306
|
+
className: It(f.className, Ft.static),
|
|
2288
2307
|
children: d
|
|
2289
2308
|
});
|
|
2290
2309
|
}
|
|
2291
|
-
var
|
|
2310
|
+
var Rt = {
|
|
2292
2311
|
outer: "ick-outer-6UEA",
|
|
2293
2312
|
wrap: "ick-wrap-u6ww"
|
|
2294
2313
|
};
|
|
2295
2314
|
//#endregion
|
|
2296
2315
|
//#region src/disclosure/DisclosureBody.tsx
|
|
2297
|
-
function
|
|
2316
|
+
function zt({ id: e, open: t, className: n, children: r }) {
|
|
2298
2317
|
let i = q();
|
|
2299
2318
|
return /* @__PURE__ */ _("div", {
|
|
2300
2319
|
id: e,
|
|
2301
|
-
className:
|
|
2320
|
+
className: Rt.outer,
|
|
2302
2321
|
children: /* @__PURE__ */ _(y, {
|
|
2303
2322
|
initial: !1,
|
|
2304
2323
|
children: t && r ? /* @__PURE__ */ _(C.div, {
|
|
2305
|
-
className:
|
|
2324
|
+
className: Rt.wrap,
|
|
2306
2325
|
initial: i ? { opacity: 0 } : {
|
|
2307
2326
|
height: 0,
|
|
2308
2327
|
opacity: 0
|
|
@@ -2334,20 +2353,20 @@ function Rt({ id: e, open: t, className: n, children: r }) {
|
|
|
2334
2353
|
}
|
|
2335
2354
|
//#endregion
|
|
2336
2355
|
//#region src/duration/formatDuration.ts
|
|
2337
|
-
function
|
|
2356
|
+
function Bt(e) {
|
|
2338
2357
|
if (!Number.isFinite(e) || e < 0) return "";
|
|
2339
2358
|
if (e < 1e3) return `${Math.round(e)}ms`;
|
|
2340
2359
|
let t = e / 1e3;
|
|
2341
2360
|
return `${t < 10 ? t.toFixed(1) : Math.round(t)}s`;
|
|
2342
2361
|
}
|
|
2343
|
-
var
|
|
2362
|
+
var Vt = {
|
|
2344
2363
|
reasoning: "ick-reasoning-qbLZ",
|
|
2345
2364
|
bodyInner: "ick-bodyInner-5PBC"
|
|
2346
2365
|
};
|
|
2347
2366
|
//#endregion
|
|
2348
2367
|
//#region src/Reasoning/Reasoning.tsx
|
|
2349
|
-
function
|
|
2350
|
-
let u =
|
|
2368
|
+
function Ht({ children: e, state: t = "done", duration: n, open: r, defaultOpen: i, onOpenChange: a, labels: o, className: s, ...c }) {
|
|
2369
|
+
let u = U("reasoning", o), d = l(), f = t === "thinking", { isOpen: p, toggle: h } = Pt({
|
|
2351
2370
|
open: r,
|
|
2352
2371
|
defaultOpen: i,
|
|
2353
2372
|
onOpenChange: a,
|
|
@@ -2363,12 +2382,12 @@ function Vt({ children: e, state: t = "done", duration: n, open: r, defaultOpen:
|
|
|
2363
2382
|
from: null,
|
|
2364
2383
|
took: e.from === null ? null : Date.now() - e.from
|
|
2365
2384
|
}));
|
|
2366
|
-
let S = n ?? b.took, C = f || S === null ? "" :
|
|
2385
|
+
let S = n ?? b.took, C = f || S === null ? "" : Bt(S);
|
|
2367
2386
|
return /* @__PURE__ */ v("div", {
|
|
2368
|
-
className: [
|
|
2387
|
+
className: [Vt.reasoning, s ?? ""].filter(Boolean).join(" "),
|
|
2369
2388
|
"data-state": t,
|
|
2370
2389
|
...c,
|
|
2371
|
-
children: [/* @__PURE__ */ _(
|
|
2390
|
+
children: [/* @__PURE__ */ _(Lt, {
|
|
2372
2391
|
fit: "inline",
|
|
2373
2392
|
open: p,
|
|
2374
2393
|
onToggle: h,
|
|
@@ -2379,17 +2398,17 @@ function Vt({ children: e, state: t = "done", duration: n, open: r, defaultOpen:
|
|
|
2379
2398
|
}),
|
|
2380
2399
|
label: f ? u.thinking : C ? `${u.thoughtFor} ${C}` : u.thought,
|
|
2381
2400
|
pending: f
|
|
2382
|
-
}), /* @__PURE__ */ _(
|
|
2401
|
+
}), /* @__PURE__ */ _(zt, {
|
|
2383
2402
|
id: d,
|
|
2384
2403
|
open: p,
|
|
2385
|
-
className:
|
|
2404
|
+
className: Vt.bodyInner,
|
|
2386
2405
|
children: e
|
|
2387
2406
|
})]
|
|
2388
2407
|
});
|
|
2389
2408
|
}
|
|
2390
2409
|
//#endregion
|
|
2391
2410
|
//#region src/CodeBlock/highlight.ts
|
|
2392
|
-
var
|
|
2411
|
+
var Ut = [
|
|
2393
2412
|
"bash",
|
|
2394
2413
|
"css",
|
|
2395
2414
|
"diff",
|
|
@@ -2401,7 +2420,7 @@ var Ht = [
|
|
|
2401
2420
|
"typescript",
|
|
2402
2421
|
"xml",
|
|
2403
2422
|
"yaml"
|
|
2404
|
-
],
|
|
2423
|
+
], Wt = {
|
|
2405
2424
|
js: "javascript",
|
|
2406
2425
|
jsx: "javascript",
|
|
2407
2426
|
mjs: "javascript",
|
|
@@ -2422,15 +2441,15 @@ var Ht = [
|
|
|
2422
2441
|
patch: "diff",
|
|
2423
2442
|
yml: "yaml",
|
|
2424
2443
|
yamllint: "yaml"
|
|
2425
|
-
},
|
|
2444
|
+
}, Gt = new Set(Ut), Kt = (e) => [{
|
|
2426
2445
|
value: e,
|
|
2427
2446
|
kind: null
|
|
2428
|
-
}],
|
|
2447
|
+
}], qt = (e) => {
|
|
2429
2448
|
if (!e) return null;
|
|
2430
|
-
let t =
|
|
2431
|
-
return
|
|
2432
|
-
},
|
|
2433
|
-
function
|
|
2449
|
+
let t = Wt[e.toLowerCase()] ?? e.toLowerCase();
|
|
2450
|
+
return Gt.has(t) ? t : null;
|
|
2451
|
+
}, Jt = (e) => qt(e) !== null;
|
|
2452
|
+
function Yt(e) {
|
|
2434
2453
|
let t = [], n = (e, n) => {
|
|
2435
2454
|
if (!e) return;
|
|
2436
2455
|
let r = t[t.length - 1];
|
|
@@ -2450,42 +2469,42 @@ function Jt(e) {
|
|
|
2450
2469
|
};
|
|
2451
2470
|
return r(e.children ?? [], null), t;
|
|
2452
2471
|
}
|
|
2453
|
-
var
|
|
2454
|
-
function
|
|
2455
|
-
return
|
|
2472
|
+
var Xt = null, Zt = null, Qt = () => Xt;
|
|
2473
|
+
function $t() {
|
|
2474
|
+
return Xt ? Promise.resolve(Xt) : Zt || (Zt = (async () => {
|
|
2456
2475
|
let { createHighlighter: e } = await import("./grammars-B19jp7qm.js"), t = e();
|
|
2457
|
-
return
|
|
2458
|
-
let r =
|
|
2459
|
-
if (!r) return
|
|
2476
|
+
return Xt = (e, n) => {
|
|
2477
|
+
let r = qt(n);
|
|
2478
|
+
if (!r) return Kt(e);
|
|
2460
2479
|
try {
|
|
2461
|
-
let n =
|
|
2462
|
-
return n.length > 0 ? n :
|
|
2480
|
+
let n = Yt(t.highlight(r, e));
|
|
2481
|
+
return n.length > 0 ? n : Kt(e);
|
|
2463
2482
|
} catch {
|
|
2464
|
-
return
|
|
2483
|
+
return Kt(e);
|
|
2465
2484
|
}
|
|
2466
|
-
},
|
|
2467
|
-
})(),
|
|
2485
|
+
}, Xt;
|
|
2486
|
+
})(), Zt);
|
|
2468
2487
|
}
|
|
2469
|
-
var
|
|
2488
|
+
var en = {
|
|
2470
2489
|
block: "ick-block-xN1a",
|
|
2471
2490
|
bar: "ick-bar-5YJ4",
|
|
2472
2491
|
lang: "ick-lang-pkCd",
|
|
2473
2492
|
copy: "ick-copy-KoCs ick-target-vuT2",
|
|
2474
2493
|
copyLabel: "ick-copyLabel-E8mN",
|
|
2475
2494
|
pre: "ick-pre-qaBX"
|
|
2476
|
-
},
|
|
2477
|
-
function
|
|
2478
|
-
let d =
|
|
2495
|
+
}, tn = 1600;
|
|
2496
|
+
function nn({ code: e, lang: t, label: n, copyable: r = !0, onCopy: i, copiedFor: a = tn, labels: s, className: l, ...u }) {
|
|
2497
|
+
let d = U("codeBlock", s), [h, g] = m(!1), y = p(null), [b, x] = m(Qt);
|
|
2479
2498
|
c(() => {
|
|
2480
|
-
if (b || !
|
|
2499
|
+
if (b || !Jt(t)) return;
|
|
2481
2500
|
let e = !0;
|
|
2482
|
-
return
|
|
2501
|
+
return $t().then((t) => {
|
|
2483
2502
|
e && x(() => t);
|
|
2484
2503
|
}), () => {
|
|
2485
2504
|
e = !1;
|
|
2486
2505
|
};
|
|
2487
2506
|
}, [b, t]);
|
|
2488
|
-
let S = f(() => b ? b(e, t) :
|
|
2507
|
+
let S = f(() => b ? b(e, t) : Kt(e), [
|
|
2489
2508
|
b,
|
|
2490
2509
|
e,
|
|
2491
2510
|
t
|
|
@@ -2502,16 +2521,16 @@ function tn({ code: e, lang: t, label: n, copyable: r = !0, onCopy: i, copiedFor
|
|
|
2502
2521
|
d.copiedAnnouncement
|
|
2503
2522
|
]), w = n === !1 ? null : n ?? t ?? null, T = w !== null || r;
|
|
2504
2523
|
return /* @__PURE__ */ v("div", {
|
|
2505
|
-
className: [
|
|
2524
|
+
className: [en.block, l ?? ""].filter(Boolean).join(" "),
|
|
2506
2525
|
...u,
|
|
2507
2526
|
children: [T && /* @__PURE__ */ v("div", {
|
|
2508
|
-
className:
|
|
2527
|
+
className: en.bar,
|
|
2509
2528
|
children: [/* @__PURE__ */ _("span", {
|
|
2510
|
-
className:
|
|
2529
|
+
className: en.lang,
|
|
2511
2530
|
children: w
|
|
2512
2531
|
}), r && /* @__PURE__ */ v("button", {
|
|
2513
2532
|
type: "button",
|
|
2514
|
-
className:
|
|
2533
|
+
className: en.copy,
|
|
2515
2534
|
onClick: C,
|
|
2516
2535
|
onPointerDown: (e) => e.stopPropagation(),
|
|
2517
2536
|
"aria-label": h ? d.copied : d.copyCode,
|
|
@@ -2519,12 +2538,12 @@ function tn({ code: e, lang: t, label: n, copyable: r = !0, onCopy: i, copiedFor
|
|
|
2519
2538
|
size: 13,
|
|
2520
2539
|
"aria-hidden": !0
|
|
2521
2540
|
}), /* @__PURE__ */ _("span", {
|
|
2522
|
-
className:
|
|
2541
|
+
className: en.copyLabel,
|
|
2523
2542
|
children: h ? d.copied : d.copy
|
|
2524
2543
|
})]
|
|
2525
2544
|
})]
|
|
2526
2545
|
}), /* @__PURE__ */ _("pre", {
|
|
2527
|
-
className:
|
|
2546
|
+
className: en.pre,
|
|
2528
2547
|
children: /* @__PURE__ */ _("code", { children: S.map((e, t) => e.kind ? /* @__PURE__ */ _("span", {
|
|
2529
2548
|
"data-hl": e.kind,
|
|
2530
2549
|
children: e.value
|
|
@@ -2532,7 +2551,7 @@ function tn({ code: e, lang: t, label: n, copyable: r = !0, onCopy: i, copiedFor
|
|
|
2532
2551
|
})]
|
|
2533
2552
|
});
|
|
2534
2553
|
}
|
|
2535
|
-
var
|
|
2554
|
+
var rn = {
|
|
2536
2555
|
glyph: "ick-glyph-NSSW",
|
|
2537
2556
|
queued: "ick-queued-6cCj",
|
|
2538
2557
|
spinner: "ick-spinner-HeOp",
|
|
@@ -2540,15 +2559,15 @@ var nn = {
|
|
|
2540
2559
|
};
|
|
2541
2560
|
//#endregion
|
|
2542
2561
|
//#region src/stateGlyph/StateGlyph.tsx
|
|
2543
|
-
function
|
|
2562
|
+
function an({ state: e }) {
|
|
2544
2563
|
return /* @__PURE__ */ _("span", {
|
|
2545
|
-
className:
|
|
2564
|
+
className: rn.glyph,
|
|
2546
2565
|
"data-state": e,
|
|
2547
2566
|
"aria-hidden": !0,
|
|
2548
|
-
children: e === "running" ? /* @__PURE__ */ _("span", { className:
|
|
2567
|
+
children: e === "running" ? /* @__PURE__ */ _("span", { className: rn.spinner }) : e === "done" ? /* @__PURE__ */ _(j, { size: 13 }) : e === "error" ? /* @__PURE__ */ _(Se, { size: 13 }) : /* @__PURE__ */ _("span", { className: rn.queued })
|
|
2549
2568
|
});
|
|
2550
2569
|
}
|
|
2551
|
-
var
|
|
2570
|
+
var on = {
|
|
2552
2571
|
tool: "ick-tool-en0M",
|
|
2553
2572
|
card: "ick-card-nzIg",
|
|
2554
2573
|
overview: "ick-overview-lVM-",
|
|
@@ -2560,7 +2579,7 @@ var an = {
|
|
|
2560
2579
|
};
|
|
2561
2580
|
//#endregion
|
|
2562
2581
|
//#region src/Tool/Tool.tsx
|
|
2563
|
-
function
|
|
2582
|
+
function sn(e) {
|
|
2564
2583
|
if (e == null) return null;
|
|
2565
2584
|
if (i(e)) return {
|
|
2566
2585
|
kind: "node",
|
|
@@ -2587,75 +2606,75 @@ function on(e) {
|
|
|
2587
2606
|
};
|
|
2588
2607
|
}
|
|
2589
2608
|
}
|
|
2590
|
-
function
|
|
2609
|
+
function cn({ label: e, value: t, tone: n }) {
|
|
2591
2610
|
if (!t) return null;
|
|
2592
|
-
if (t.kind === "json") return /* @__PURE__ */ _(
|
|
2611
|
+
if (t.kind === "json") return /* @__PURE__ */ _(nn, {
|
|
2593
2612
|
code: t.code,
|
|
2594
2613
|
lang: "json",
|
|
2595
2614
|
label: e
|
|
2596
2615
|
});
|
|
2597
2616
|
let r = t.kind === "text" ? /* @__PURE__ */ _("p", {
|
|
2598
|
-
className:
|
|
2617
|
+
className: on.text,
|
|
2599
2618
|
children: t.text
|
|
2600
2619
|
}) : t.node;
|
|
2601
2620
|
return /* @__PURE__ */ v("div", {
|
|
2602
|
-
className:
|
|
2621
|
+
className: on.section,
|
|
2603
2622
|
"data-tone": n,
|
|
2604
2623
|
children: [/* @__PURE__ */ _("span", {
|
|
2605
|
-
className:
|
|
2624
|
+
className: on.sectionLabel,
|
|
2606
2625
|
children: e
|
|
2607
2626
|
}), r]
|
|
2608
2627
|
});
|
|
2609
2628
|
}
|
|
2610
|
-
function
|
|
2611
|
-
let m =
|
|
2629
|
+
function ln({ name: e, state: t = "done", summary: n, input: r, output: i, error: a, duration: o, open: s, defaultOpen: c, onOpenChange: u, labels: d, className: f, ...p }) {
|
|
2630
|
+
let m = U("tool", d), h = l(), g = t === "error", { isOpen: y, toggle: b } = Pt({
|
|
2612
2631
|
open: s,
|
|
2613
2632
|
defaultOpen: c,
|
|
2614
2633
|
onOpenChange: u,
|
|
2615
2634
|
preferOpen: g
|
|
2616
|
-
}), x =
|
|
2635
|
+
}), x = sn(r), S = g ? null : sn(i), C = g ? sn(a) : null, w = !!(x || S || C || t === "running"), T = t === "done" || g ? Bt(o ?? NaN) : "";
|
|
2617
2636
|
return /* @__PURE__ */ v("div", {
|
|
2618
|
-
className: [
|
|
2637
|
+
className: [on.tool, f ?? ""].filter(Boolean).join(" "),
|
|
2619
2638
|
"data-state": t,
|
|
2620
2639
|
...p,
|
|
2621
|
-
children: [/* @__PURE__ */ _(
|
|
2640
|
+
children: [/* @__PURE__ */ _(Lt, {
|
|
2622
2641
|
open: y,
|
|
2623
2642
|
onToggle: b,
|
|
2624
2643
|
controls: h,
|
|
2625
2644
|
disabled: !w,
|
|
2626
|
-
glyph: /* @__PURE__ */ _(
|
|
2645
|
+
glyph: /* @__PURE__ */ _(an, { state: t }),
|
|
2627
2646
|
label: e,
|
|
2628
2647
|
meta: T || void 0,
|
|
2629
2648
|
children: /* @__PURE__ */ _("span", {
|
|
2630
|
-
className:
|
|
2649
|
+
className: on.srOnly,
|
|
2631
2650
|
children: m[t]
|
|
2632
2651
|
})
|
|
2633
2652
|
}), /* @__PURE__ */ v("div", {
|
|
2634
|
-
className:
|
|
2653
|
+
className: on.card,
|
|
2635
2654
|
children: [/* @__PURE__ */ _("p", {
|
|
2636
|
-
className:
|
|
2655
|
+
className: on.overview,
|
|
2637
2656
|
children: n ?? m[t]
|
|
2638
|
-
}), /* @__PURE__ */ v(
|
|
2657
|
+
}), /* @__PURE__ */ v(zt, {
|
|
2639
2658
|
id: h,
|
|
2640
2659
|
open: y && w,
|
|
2641
|
-
className:
|
|
2660
|
+
className: on.bodyInner,
|
|
2642
2661
|
children: [
|
|
2643
|
-
/* @__PURE__ */ _(
|
|
2662
|
+
/* @__PURE__ */ _(cn, {
|
|
2644
2663
|
label: m.input,
|
|
2645
2664
|
value: x
|
|
2646
2665
|
}),
|
|
2647
2666
|
t === "running" && !S && /* @__PURE__ */ v("div", {
|
|
2648
|
-
className:
|
|
2667
|
+
className: on.section,
|
|
2649
2668
|
children: [/* @__PURE__ */ _("span", {
|
|
2650
|
-
className:
|
|
2669
|
+
className: on.sectionLabel,
|
|
2651
2670
|
children: m.output
|
|
2652
|
-
}), /* @__PURE__ */ _(
|
|
2671
|
+
}), /* @__PURE__ */ _(Nt, {})]
|
|
2653
2672
|
}),
|
|
2654
|
-
/* @__PURE__ */ _(
|
|
2673
|
+
/* @__PURE__ */ _(cn, {
|
|
2655
2674
|
label: m.output,
|
|
2656
2675
|
value: S
|
|
2657
2676
|
}),
|
|
2658
|
-
/* @__PURE__ */ _(
|
|
2677
|
+
/* @__PURE__ */ _(cn, {
|
|
2659
2678
|
label: m.error,
|
|
2660
2679
|
value: C,
|
|
2661
2680
|
tone: "error"
|
|
@@ -2665,7 +2684,7 @@ function cn({ name: e, state: t = "done", summary: n, input: r, output: i, error
|
|
|
2665
2684
|
})]
|
|
2666
2685
|
});
|
|
2667
2686
|
}
|
|
2668
|
-
var
|
|
2687
|
+
var un = {
|
|
2669
2688
|
approval: "ick-approval-zlJi",
|
|
2670
2689
|
head: "ick-head-CX4j",
|
|
2671
2690
|
title: "ick-title-n-wh",
|
|
@@ -2674,62 +2693,62 @@ var ln = {
|
|
|
2674
2693
|
actions: "ick-actions-t5Oz",
|
|
2675
2694
|
deny: "ick-deny-XXyG",
|
|
2676
2695
|
settled: "ick-settled-OaBX"
|
|
2677
|
-
},
|
|
2696
|
+
}, dn = [
|
|
2678
2697
|
"once",
|
|
2679
2698
|
"always",
|
|
2680
2699
|
"deny"
|
|
2681
|
-
],
|
|
2700
|
+
], fn = {
|
|
2682
2701
|
once: "allowedOnce",
|
|
2683
2702
|
always: "allowedAlways",
|
|
2684
2703
|
denied: "wasDenied"
|
|
2685
2704
|
};
|
|
2686
|
-
function
|
|
2687
|
-
let d =
|
|
2705
|
+
function pn({ title: e, description: t, children: n, decision: r = null, onDecide: i, readOnly: a = !1, choices: o = dn, labels: s, className: c, ...u }) {
|
|
2706
|
+
let d = U("approval", s), f = (e) => o.includes(e), p = l(), m = r !== null;
|
|
2688
2707
|
return /* @__PURE__ */ v("section", {
|
|
2689
|
-
className: [
|
|
2708
|
+
className: [un.approval, c ?? ""].filter(Boolean).join(" "),
|
|
2690
2709
|
"data-decision": r ?? void 0,
|
|
2691
2710
|
"aria-labelledby": p,
|
|
2692
2711
|
...u,
|
|
2693
2712
|
children: [
|
|
2694
2713
|
/* @__PURE__ */ v("div", {
|
|
2695
|
-
className:
|
|
2714
|
+
className: un.head,
|
|
2696
2715
|
children: [/* @__PURE__ */ _("p", {
|
|
2697
|
-
className:
|
|
2716
|
+
className: un.title,
|
|
2698
2717
|
id: p,
|
|
2699
2718
|
children: e
|
|
2700
2719
|
}), t && /* @__PURE__ */ _("p", {
|
|
2701
|
-
className:
|
|
2720
|
+
className: un.description,
|
|
2702
2721
|
children: t
|
|
2703
2722
|
})]
|
|
2704
2723
|
}),
|
|
2705
2724
|
n && /* @__PURE__ */ _("div", {
|
|
2706
|
-
className:
|
|
2725
|
+
className: un.subject,
|
|
2707
2726
|
children: n
|
|
2708
2727
|
}),
|
|
2709
2728
|
m ? /* @__PURE__ */ v("p", {
|
|
2710
|
-
className:
|
|
2729
|
+
className: un.settled,
|
|
2711
2730
|
"data-decision": r,
|
|
2712
|
-
children: [_(r === "denied" ?
|
|
2731
|
+
children: [_(r === "denied" ? Ce : j, {
|
|
2713
2732
|
size: 13,
|
|
2714
2733
|
"aria-hidden": !0
|
|
2715
|
-
}), d[
|
|
2734
|
+
}), d[fn[r]]]
|
|
2716
2735
|
}) : !a && /* @__PURE__ */ v("div", {
|
|
2717
|
-
className:
|
|
2736
|
+
className: un.actions,
|
|
2718
2737
|
children: [
|
|
2719
|
-
f("deny") && /* @__PURE__ */ _(
|
|
2738
|
+
f("deny") && /* @__PURE__ */ _(H, {
|
|
2720
2739
|
variant: "ghost",
|
|
2721
2740
|
size: "m",
|
|
2722
|
-
className:
|
|
2741
|
+
className: un.deny,
|
|
2723
2742
|
onClick: () => i?.("denied"),
|
|
2724
2743
|
children: d.deny
|
|
2725
2744
|
}),
|
|
2726
|
-
f("always") && /* @__PURE__ */ _(
|
|
2745
|
+
f("always") && /* @__PURE__ */ _(H, {
|
|
2727
2746
|
variant: "outline",
|
|
2728
2747
|
size: "m",
|
|
2729
2748
|
onClick: () => i?.("always"),
|
|
2730
2749
|
children: d.always
|
|
2731
2750
|
}),
|
|
2732
|
-
f("once") && /* @__PURE__ */ _(
|
|
2751
|
+
f("once") && /* @__PURE__ */ _(H, {
|
|
2733
2752
|
variant: "primary",
|
|
2734
2753
|
size: "m",
|
|
2735
2754
|
onClick: () => i?.("once"),
|
|
@@ -2740,7 +2759,7 @@ function fn({ title: e, description: t, children: n, decision: r = null, onDecid
|
|
|
2740
2759
|
]
|
|
2741
2760
|
});
|
|
2742
2761
|
}
|
|
2743
|
-
var
|
|
2762
|
+
var mn = {
|
|
2744
2763
|
tasks: "ick-tasks-2ToX",
|
|
2745
2764
|
list: "ick-list-D8wS",
|
|
2746
2765
|
item: "ick-item-QsIm",
|
|
@@ -2751,33 +2770,33 @@ var pn = {
|
|
|
2751
2770
|
};
|
|
2752
2771
|
//#endregion
|
|
2753
2772
|
//#region src/TaskList/TaskList.tsx
|
|
2754
|
-
function
|
|
2755
|
-
let u =
|
|
2773
|
+
function hn({ tasks: e, title: t, collapsible: n = !1, open: r, defaultOpen: i, onOpenChange: a, labels: o, className: s, ...c }) {
|
|
2774
|
+
let u = U("tasks", o), d = l(), f = q(), p = e.filter((e) => (e.state ?? "pending") === "done").length, m = Pt({
|
|
2756
2775
|
open: r,
|
|
2757
2776
|
defaultOpen: i,
|
|
2758
2777
|
onOpenChange: a,
|
|
2759
2778
|
preferOpen: !(e.length > 0 && p === e.length)
|
|
2760
2779
|
}), h = !n || m.isOpen, g = u.progress.replace("{done}", String(p)).replace("{total}", String(e.length));
|
|
2761
2780
|
return /* @__PURE__ */ v("section", {
|
|
2762
|
-
className: [
|
|
2781
|
+
className: [mn.tasks, s ?? ""].filter(Boolean).join(" "),
|
|
2763
2782
|
...c,
|
|
2764
|
-
children: [t && /* @__PURE__ */ _(
|
|
2783
|
+
children: [t && /* @__PURE__ */ _(Lt, {
|
|
2765
2784
|
open: h,
|
|
2766
2785
|
onToggle: n ? m.toggle : void 0,
|
|
2767
2786
|
controls: d,
|
|
2768
2787
|
label: t,
|
|
2769
2788
|
meta: g
|
|
2770
|
-
}), /* @__PURE__ */ _(
|
|
2789
|
+
}), /* @__PURE__ */ _(zt, {
|
|
2771
2790
|
id: d,
|
|
2772
2791
|
open: h,
|
|
2773
2792
|
children: /* @__PURE__ */ _("ol", {
|
|
2774
|
-
className:
|
|
2793
|
+
className: mn.list,
|
|
2775
2794
|
children: /* @__PURE__ */ _(y, {
|
|
2776
2795
|
initial: !1,
|
|
2777
2796
|
children: e.map((e) => {
|
|
2778
2797
|
let t = e.state ?? "pending";
|
|
2779
2798
|
return /* @__PURE__ */ v(C.li, {
|
|
2780
|
-
className:
|
|
2799
|
+
className: mn.item,
|
|
2781
2800
|
"data-state": t,
|
|
2782
2801
|
"aria-current": t === "running" ? "step" : void 0,
|
|
2783
2802
|
initial: f ? { opacity: 0 } : {
|
|
@@ -2793,19 +2812,19 @@ function mn({ tasks: e, title: t, collapsible: n = !1, open: r, defaultOpen: i,
|
|
|
2793
2812
|
y: -4
|
|
2794
2813
|
},
|
|
2795
2814
|
transition: { duration: f ? .12 : .2 },
|
|
2796
|
-
children: [/* @__PURE__ */ _(
|
|
2797
|
-
className:
|
|
2815
|
+
children: [/* @__PURE__ */ _(an, { state: t }), /* @__PURE__ */ v("span", {
|
|
2816
|
+
className: mn.body,
|
|
2798
2817
|
children: [
|
|
2799
2818
|
/* @__PURE__ */ _("span", {
|
|
2800
|
-
className:
|
|
2819
|
+
className: mn.label,
|
|
2801
2820
|
children: e.label
|
|
2802
2821
|
}),
|
|
2803
2822
|
/* @__PURE__ */ _("span", {
|
|
2804
|
-
className:
|
|
2823
|
+
className: mn.srOnly,
|
|
2805
2824
|
children: u[t]
|
|
2806
2825
|
}),
|
|
2807
2826
|
e.detail && /* @__PURE__ */ _("span", {
|
|
2808
|
-
className:
|
|
2827
|
+
className: mn.detail,
|
|
2809
2828
|
children: e.detail
|
|
2810
2829
|
})
|
|
2811
2830
|
]
|
|
@@ -2817,7 +2836,7 @@ function mn({ tasks: e, title: t, collapsible: n = !1, open: r, defaultOpen: i,
|
|
|
2817
2836
|
})]
|
|
2818
2837
|
});
|
|
2819
2838
|
}
|
|
2820
|
-
var
|
|
2839
|
+
var gn = {
|
|
2821
2840
|
chain: "ick-chain-NGeh",
|
|
2822
2841
|
list: "ick-list-B2Pj",
|
|
2823
2842
|
step: "ick-step--tPX",
|
|
@@ -2828,37 +2847,37 @@ var hn = {
|
|
|
2828
2847
|
};
|
|
2829
2848
|
//#endregion
|
|
2830
2849
|
//#region src/ChainOfThought/ChainOfThought.tsx
|
|
2831
|
-
function
|
|
2832
|
-
let u =
|
|
2850
|
+
function _n({ steps: e, state: t = "done", duration: n, open: r, defaultOpen: i, onOpenChange: a, labels: o, className: s, ...c }) {
|
|
2851
|
+
let u = U("chain", o), d = l(), f = q(), p = t === "thinking", { isOpen: m, toggle: h } = Pt({
|
|
2833
2852
|
open: r,
|
|
2834
2853
|
defaultOpen: i,
|
|
2835
2854
|
onOpenChange: a,
|
|
2836
2855
|
preferOpen: p
|
|
2837
|
-
}), g = p ? e.find((e) => (e.state ?? "done") === "running") ?? e[e.length - 1] : void 0, b = p ? "" :
|
|
2856
|
+
}), g = p ? e.find((e) => (e.state ?? "done") === "running") ?? e[e.length - 1] : void 0, b = p ? "" : Bt(n ?? NaN), x = `${u.through} ${e.length} ${e.length === 1 ? u.step : u.steps}`;
|
|
2838
2857
|
return /* @__PURE__ */ v("section", {
|
|
2839
|
-
className: [
|
|
2858
|
+
className: [gn.chain, s ?? ""].filter(Boolean).join(" "),
|
|
2840
2859
|
"data-state": t,
|
|
2841
2860
|
...c,
|
|
2842
|
-
children: [/* @__PURE__ */ _(
|
|
2861
|
+
children: [/* @__PURE__ */ _(Lt, {
|
|
2843
2862
|
fit: "inline",
|
|
2844
2863
|
open: m,
|
|
2845
2864
|
onToggle: h,
|
|
2846
2865
|
controls: d,
|
|
2847
|
-
glyph: /* @__PURE__ */ _(
|
|
2866
|
+
glyph: /* @__PURE__ */ _(an, { state: p ? "running" : "done" }),
|
|
2848
2867
|
label: p ? g?.label ?? u.thinking : x,
|
|
2849
2868
|
pending: p,
|
|
2850
2869
|
meta: b || void 0
|
|
2851
|
-
}), /* @__PURE__ */ _(
|
|
2870
|
+
}), /* @__PURE__ */ _(zt, {
|
|
2852
2871
|
id: d,
|
|
2853
2872
|
open: m && e.length > 0,
|
|
2854
2873
|
children: /* @__PURE__ */ _("ol", {
|
|
2855
|
-
className:
|
|
2874
|
+
className: gn.list,
|
|
2856
2875
|
children: /* @__PURE__ */ _(y, {
|
|
2857
2876
|
initial: !1,
|
|
2858
2877
|
children: e.map((e) => {
|
|
2859
2878
|
let t = e.state ?? "done";
|
|
2860
2879
|
return /* @__PURE__ */ v(C.li, {
|
|
2861
|
-
className:
|
|
2880
|
+
className: gn.step,
|
|
2862
2881
|
"data-state": t,
|
|
2863
2882
|
"aria-current": t === "running" ? "step" : void 0,
|
|
2864
2883
|
initial: f ? { opacity: 0 } : {
|
|
@@ -2875,16 +2894,16 @@ function gn({ steps: e, state: t = "done", duration: n, open: r, defaultOpen: i,
|
|
|
2875
2894
|
},
|
|
2876
2895
|
transition: { duration: f ? .12 : .2 },
|
|
2877
2896
|
children: [/* @__PURE__ */ _("span", {
|
|
2878
|
-
className:
|
|
2897
|
+
className: gn.rail,
|
|
2879
2898
|
"aria-hidden": !0,
|
|
2880
|
-
children: /* @__PURE__ */ _(
|
|
2899
|
+
children: /* @__PURE__ */ _(an, { state: t })
|
|
2881
2900
|
}), /* @__PURE__ */ v("span", {
|
|
2882
|
-
className:
|
|
2901
|
+
className: gn.body,
|
|
2883
2902
|
children: [/* @__PURE__ */ _("span", {
|
|
2884
|
-
className:
|
|
2903
|
+
className: gn.stepLabel,
|
|
2885
2904
|
children: e.label
|
|
2886
2905
|
}), e.body && /* @__PURE__ */ _("span", {
|
|
2887
|
-
className:
|
|
2906
|
+
className: gn.working,
|
|
2888
2907
|
children: e.body
|
|
2889
2908
|
})]
|
|
2890
2909
|
})]
|
|
@@ -2895,7 +2914,7 @@ function gn({ steps: e, state: t = "done", duration: n, open: r, defaultOpen: i,
|
|
|
2895
2914
|
})]
|
|
2896
2915
|
});
|
|
2897
2916
|
}
|
|
2898
|
-
var
|
|
2917
|
+
var vn = {
|
|
2899
2918
|
sources: "ick-sources-w6ma",
|
|
2900
2919
|
list: "ick-list-UdKr",
|
|
2901
2920
|
item: "ick-item-zBLs",
|
|
@@ -2908,55 +2927,55 @@ var _n = {
|
|
|
2908
2927
|
};
|
|
2909
2928
|
//#endregion
|
|
2910
2929
|
//#region src/Sources/Sources.tsx
|
|
2911
|
-
function
|
|
2912
|
-
let f =
|
|
2930
|
+
function yn({ sources: e, title: t, collapsible: n = !1, activeId: r = null, onSelect: i, open: a, defaultOpen: o, onOpenChange: s, labels: c, className: u, ...d }) {
|
|
2931
|
+
let f = U("sources", c), p = l(), m = Pt({
|
|
2913
2932
|
open: a,
|
|
2914
2933
|
defaultOpen: o,
|
|
2915
2934
|
onOpenChange: s,
|
|
2916
2935
|
preferOpen: !0
|
|
2917
2936
|
}), h = !n || m.isOpen, y = `${e.length} ${e.length === 1 ? f.one : f.many}`;
|
|
2918
2937
|
return /* @__PURE__ */ v("section", {
|
|
2919
|
-
className: [
|
|
2938
|
+
className: [vn.sources, u ?? ""].filter(Boolean).join(" "),
|
|
2920
2939
|
...d,
|
|
2921
|
-
children: [/* @__PURE__ */ _(
|
|
2940
|
+
children: [/* @__PURE__ */ _(Lt, {
|
|
2922
2941
|
open: h,
|
|
2923
2942
|
onToggle: n ? m.toggle : void 0,
|
|
2924
2943
|
controls: p,
|
|
2925
2944
|
label: t ?? f.title,
|
|
2926
2945
|
meta: y
|
|
2927
|
-
}), /* @__PURE__ */ _(
|
|
2946
|
+
}), /* @__PURE__ */ _(zt, {
|
|
2928
2947
|
id: p,
|
|
2929
2948
|
open: h && e.length > 0,
|
|
2930
2949
|
children: /* @__PURE__ */ _("ol", {
|
|
2931
|
-
className:
|
|
2950
|
+
className: vn.list,
|
|
2932
2951
|
children: e.map((e, t) => {
|
|
2933
2952
|
let n = t + 1, a = e.id === r, o = /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("span", {
|
|
2934
|
-
className:
|
|
2953
|
+
className: vn.number,
|
|
2935
2954
|
"data-active": a || void 0,
|
|
2936
2955
|
children: n
|
|
2937
2956
|
}), /* @__PURE__ */ v("span", {
|
|
2938
|
-
className:
|
|
2957
|
+
className: vn.body,
|
|
2939
2958
|
children: [
|
|
2940
2959
|
/* @__PURE__ */ _("span", {
|
|
2941
|
-
className:
|
|
2960
|
+
className: vn.name,
|
|
2942
2961
|
children: e.title
|
|
2943
2962
|
}),
|
|
2944
2963
|
e.origin && /* @__PURE__ */ _("span", {
|
|
2945
|
-
className:
|
|
2964
|
+
className: vn.origin,
|
|
2946
2965
|
children: e.origin
|
|
2947
2966
|
}),
|
|
2948
2967
|
e.quote && /* @__PURE__ */ _("span", {
|
|
2949
|
-
className:
|
|
2968
|
+
className: vn.quote,
|
|
2950
2969
|
children: e.quote
|
|
2951
2970
|
})
|
|
2952
2971
|
]
|
|
2953
2972
|
})] });
|
|
2954
2973
|
return /* @__PURE__ */ _("li", {
|
|
2955
|
-
className:
|
|
2974
|
+
className: vn.item,
|
|
2956
2975
|
"data-active": a || void 0,
|
|
2957
2976
|
id: `${p}-${e.id}`,
|
|
2958
2977
|
children: e.url ? /* @__PURE__ */ _("a", {
|
|
2959
|
-
className:
|
|
2978
|
+
className: vn.entry,
|
|
2960
2979
|
href: e.url,
|
|
2961
2980
|
target: "_blank",
|
|
2962
2981
|
rel: "noreferrer noopener",
|
|
@@ -2964,7 +2983,7 @@ function vn({ sources: e, title: t, collapsible: n = !1, activeId: r = null, onS
|
|
|
2964
2983
|
onPointerDown: (e) => e.stopPropagation(),
|
|
2965
2984
|
children: o
|
|
2966
2985
|
}) : /* @__PURE__ */ _("div", {
|
|
2967
|
-
className:
|
|
2986
|
+
className: vn.entry,
|
|
2968
2987
|
children: o
|
|
2969
2988
|
})
|
|
2970
2989
|
}, e.id);
|
|
@@ -2973,13 +2992,13 @@ function vn({ sources: e, title: t, collapsible: n = !1, activeId: r = null, onS
|
|
|
2973
2992
|
})]
|
|
2974
2993
|
});
|
|
2975
2994
|
}
|
|
2976
|
-
var
|
|
2995
|
+
var bn = { chip: "ick-chip-FJNL" };
|
|
2977
2996
|
//#endregion
|
|
2978
2997
|
//#region src/Chip/Chip.tsx
|
|
2979
|
-
function
|
|
2998
|
+
function xn({ children: e, className: t }) {
|
|
2980
2999
|
let n = q();
|
|
2981
3000
|
return /* @__PURE__ */ _(C.span, {
|
|
2982
|
-
className: [
|
|
3001
|
+
className: [bn.chip, t ?? ""].filter(Boolean).join(" "),
|
|
2983
3002
|
initial: n ? { opacity: 0 } : {
|
|
2984
3003
|
opacity: 0,
|
|
2985
3004
|
scale: .85
|
|
@@ -3024,7 +3043,7 @@ var X = {
|
|
|
3024
3043
|
fieldLabel: "ick-fieldLabel--DkK",
|
|
3025
3044
|
fieldInput: "ick-fieldInput-Er9C",
|
|
3026
3045
|
shellCard: "ick-shellCard-pBK9"
|
|
3027
|
-
},
|
|
3046
|
+
}, Sn = r(function({ children: e, selected: t, onCard: n, className: r, ...i }, a) {
|
|
3028
3047
|
return /* @__PURE__ */ _("span", {
|
|
3029
3048
|
ref: a,
|
|
3030
3049
|
className: [X.badge, r ?? ""].filter(Boolean).join(" "),
|
|
@@ -3034,7 +3053,7 @@ var X = {
|
|
|
3034
3053
|
...i,
|
|
3035
3054
|
children: e
|
|
3036
3055
|
});
|
|
3037
|
-
}),
|
|
3056
|
+
}), Cn = r(function({ letter: e, title: t, description: n, selected: r = !1, className: i, ...a }, o) {
|
|
3038
3057
|
let s = q();
|
|
3039
3058
|
return /* @__PURE__ */ v(C.button, {
|
|
3040
3059
|
ref: o,
|
|
@@ -3044,7 +3063,7 @@ var X = {
|
|
|
3044
3063
|
"aria-pressed": r,
|
|
3045
3064
|
whileTap: s ? void 0 : { scale: .99 },
|
|
3046
3065
|
...a,
|
|
3047
|
-
children: [e !== void 0 && /* @__PURE__ */ _(
|
|
3066
|
+
children: [e !== void 0 && /* @__PURE__ */ _(Sn, {
|
|
3048
3067
|
selected: r,
|
|
3049
3068
|
children: e
|
|
3050
3069
|
}), /* @__PURE__ */ v("span", {
|
|
@@ -3058,13 +3077,13 @@ var X = {
|
|
|
3058
3077
|
})]
|
|
3059
3078
|
})]
|
|
3060
3079
|
});
|
|
3061
|
-
}),
|
|
3080
|
+
}), wn = r(function({ letter: e, label: t, value: n, onChange: r, onEnter: i, className: a, id: o, onFocus: s, onBlur: c, onKeyDown: u, ...d }, f) {
|
|
3062
3081
|
let [p, h] = m(!1), g = l(), y = o ?? g;
|
|
3063
3082
|
return /* @__PURE__ */ v("label", {
|
|
3064
3083
|
className: [X.field, a ?? ""].filter(Boolean).join(" "),
|
|
3065
3084
|
"data-focused": p || void 0,
|
|
3066
3085
|
htmlFor: y,
|
|
3067
|
-
children: [e !== void 0 && /* @__PURE__ */ _(
|
|
3086
|
+
children: [e !== void 0 && /* @__PURE__ */ _(Sn, {
|
|
3068
3087
|
selected: p,
|
|
3069
3088
|
children: e
|
|
3070
3089
|
}), /* @__PURE__ */ v("span", {
|
|
@@ -3092,13 +3111,13 @@ var X = {
|
|
|
3092
3111
|
})]
|
|
3093
3112
|
})]
|
|
3094
3113
|
});
|
|
3095
|
-
}),
|
|
3114
|
+
}), Tn = r(function({ letter: e, value: t, placeholder: n, onChange: r, onEnter: i, className: a, onKeyDown: o, ...s }, c) {
|
|
3096
3115
|
let l = t.trim().length > 0;
|
|
3097
3116
|
return /* @__PURE__ */ v("label", {
|
|
3098
3117
|
className: [X.option, a ?? ""].filter(Boolean).join(" "),
|
|
3099
3118
|
"data-selected": l || void 0,
|
|
3100
3119
|
"data-other": "",
|
|
3101
|
-
children: [e !== void 0 && /* @__PURE__ */ _(
|
|
3120
|
+
children: [e !== void 0 && /* @__PURE__ */ _(Sn, {
|
|
3102
3121
|
selected: l,
|
|
3103
3122
|
children: e
|
|
3104
3123
|
}), /* @__PURE__ */ _("span", {
|
|
@@ -3118,7 +3137,7 @@ var X = {
|
|
|
3118
3137
|
})
|
|
3119
3138
|
})]
|
|
3120
3139
|
});
|
|
3121
|
-
}),
|
|
3140
|
+
}), En = r(function({ number: e, title: t, subtitle: n, children: r, footer: i, card: a = !0, className: o, ...s }, c) {
|
|
3122
3141
|
return /* @__PURE__ */ v("div", {
|
|
3123
3142
|
ref: c,
|
|
3124
3143
|
className: [
|
|
@@ -3130,7 +3149,7 @@ var X = {
|
|
|
3130
3149
|
children: [
|
|
3131
3150
|
/* @__PURE__ */ v("div", {
|
|
3132
3151
|
className: X.header,
|
|
3133
|
-
children: [e !== void 0 && /* @__PURE__ */ _(
|
|
3152
|
+
children: [e !== void 0 && /* @__PURE__ */ _(Sn, {
|
|
3134
3153
|
selected: !0,
|
|
3135
3154
|
children: e
|
|
3136
3155
|
}), /* @__PURE__ */ v("div", {
|
|
@@ -3157,7 +3176,7 @@ var X = {
|
|
|
3157
3176
|
});
|
|
3158
3177
|
//#endregion
|
|
3159
3178
|
//#region src/radiusCorrection/useCorrectedRadius.ts
|
|
3160
|
-
function
|
|
3179
|
+
function Dn(e) {
|
|
3161
3180
|
let [t, n] = m(void 0);
|
|
3162
3181
|
return d(() => {
|
|
3163
3182
|
let t = e.current;
|
|
@@ -3168,12 +3187,12 @@ function En(e) {
|
|
|
3168
3187
|
}
|
|
3169
3188
|
//#endregion
|
|
3170
3189
|
//#region src/QuestionCard/QuestionCard.tsx
|
|
3171
|
-
var
|
|
3190
|
+
var On = {
|
|
3172
3191
|
type: "spring",
|
|
3173
3192
|
stiffness: 260,
|
|
3174
3193
|
damping: 30
|
|
3175
|
-
},
|
|
3176
|
-
function
|
|
3194
|
+
}, kn = (e, t) => Array.from(t)[e] ?? String(e + 1), An = 300, jn = 380;
|
|
3195
|
+
function Mn(e, t) {
|
|
3177
3196
|
if (!t) return [];
|
|
3178
3197
|
if (e.type === "inputs" && "values" in t) {
|
|
3179
3198
|
let n = e.fields.map((e) => t.values?.[e.id]).filter(Boolean);
|
|
@@ -3191,11 +3210,11 @@ function jn(e, t) {
|
|
|
3191
3210
|
}
|
|
3192
3211
|
return [];
|
|
3193
3212
|
}
|
|
3194
|
-
function
|
|
3213
|
+
function Nn({ question: e, number: t, answer: n, onCommit: r, labels: i }) {
|
|
3195
3214
|
let [a, o] = m(() => n && "values" in n ? { ...n.values } : {}), [s, l] = m(() => n && "optionIds" in n ? [...n.optionIds ?? []] : []), [u, d] = m(() => n && "optionIds" in n ? n.other ?? "" : ""), [h, g] = m(n && "optionId" in n ? n.optionId : null), y = p(null), b = f(() => e.type === "inputs" ? e.fields.map(() => ({ current: null })) : [], [e]);
|
|
3196
3215
|
c(() => {
|
|
3197
3216
|
if (e.type !== "inputs") return;
|
|
3198
|
-
let t = setTimeout(() => y.current?.focus({ preventScroll: !0 }), q() ? 0 :
|
|
3217
|
+
let t = setTimeout(() => y.current?.focus({ preventScroll: !0 }), q() ? 0 : jn);
|
|
3199
3218
|
return () => clearTimeout(t);
|
|
3200
3219
|
}, [e.type]);
|
|
3201
3220
|
let x = f(() => e.type !== "inputs" || e.fields.every((e) => e.optional || (a[e.id] ?? "").trim()), [e, a]), S = {
|
|
@@ -3206,17 +3225,17 @@ function Mn({ question: e, number: t, answer: n, onCommit: r, labels: i }) {
|
|
|
3206
3225
|
};
|
|
3207
3226
|
if (e.type === "inputs") {
|
|
3208
3227
|
let t = () => x && r?.({ values: a });
|
|
3209
|
-
return /* @__PURE__ */ _(
|
|
3228
|
+
return /* @__PURE__ */ _(En, {
|
|
3210
3229
|
...S,
|
|
3211
|
-
footer: /* @__PURE__ */ _(
|
|
3230
|
+
footer: /* @__PURE__ */ _(H, {
|
|
3212
3231
|
variant: "secondary",
|
|
3213
3232
|
size: "m",
|
|
3214
3233
|
disabled: !x,
|
|
3215
3234
|
onClick: t,
|
|
3216
3235
|
children: i.next
|
|
3217
3236
|
}),
|
|
3218
|
-
children: e.fields.map((e, n) => /* @__PURE__ */ _(
|
|
3219
|
-
letter:
|
|
3237
|
+
children: e.fields.map((e, n) => /* @__PURE__ */ _(wn, {
|
|
3238
|
+
letter: kn(n, i.letters),
|
|
3220
3239
|
label: e.label,
|
|
3221
3240
|
placeholder: e.placeholder,
|
|
3222
3241
|
value: a[e.id] ?? "",
|
|
@@ -3232,15 +3251,15 @@ function Mn({ question: e, number: t, answer: n, onCommit: r, labels: i }) {
|
|
|
3232
3251
|
}, e.id))
|
|
3233
3252
|
});
|
|
3234
3253
|
}
|
|
3235
|
-
if (e.type === "single") return /* @__PURE__ */ _(
|
|
3254
|
+
if (e.type === "single") return /* @__PURE__ */ _(En, {
|
|
3236
3255
|
...S,
|
|
3237
|
-
children: e.options.map((e, t) => /* @__PURE__ */ _(
|
|
3238
|
-
letter:
|
|
3256
|
+
children: e.options.map((e, t) => /* @__PURE__ */ _(Cn, {
|
|
3257
|
+
letter: kn(t, i.letters),
|
|
3239
3258
|
title: e.title,
|
|
3240
3259
|
description: e.description,
|
|
3241
3260
|
selected: h === e.id,
|
|
3242
3261
|
onClick: () => {
|
|
3243
|
-
g(e.id), setTimeout(() => r?.({ optionId: e.id }),
|
|
3262
|
+
g(e.id), setTimeout(() => r?.({ optionId: e.id }), An);
|
|
3244
3263
|
}
|
|
3245
3264
|
}, e.id))
|
|
3246
3265
|
});
|
|
@@ -3250,23 +3269,23 @@ function Mn({ question: e, number: t, answer: n, onCommit: r, labels: i }) {
|
|
|
3250
3269
|
...C ? { other: C } : {}
|
|
3251
3270
|
});
|
|
3252
3271
|
};
|
|
3253
|
-
return /* @__PURE__ */ v(
|
|
3272
|
+
return /* @__PURE__ */ v(En, {
|
|
3254
3273
|
...S,
|
|
3255
|
-
footer: /* @__PURE__ */ _(
|
|
3274
|
+
footer: /* @__PURE__ */ _(H, {
|
|
3256
3275
|
variant: "secondary",
|
|
3257
3276
|
size: "m",
|
|
3258
3277
|
disabled: !e.allowEmpty && w,
|
|
3259
3278
|
onClick: T,
|
|
3260
3279
|
children: e.allowEmpty && w ? i.none : i.next
|
|
3261
3280
|
}),
|
|
3262
|
-
children: [e.options.map((e, t) => /* @__PURE__ */ _(
|
|
3263
|
-
letter:
|
|
3281
|
+
children: [e.options.map((e, t) => /* @__PURE__ */ _(Cn, {
|
|
3282
|
+
letter: kn(t, i.letters),
|
|
3264
3283
|
title: e.title,
|
|
3265
3284
|
description: e.description,
|
|
3266
3285
|
selected: s.includes(e.id),
|
|
3267
3286
|
onClick: () => l((t) => t.includes(e.id) ? t.filter((t) => t !== e.id) : [...t, e.id])
|
|
3268
|
-
}, e.id)), e.allowOther && /* @__PURE__ */ _(
|
|
3269
|
-
letter:
|
|
3287
|
+
}, e.id)), e.allowOther && /* @__PURE__ */ _(Tn, {
|
|
3288
|
+
letter: kn(e.options.length, i.letters),
|
|
3270
3289
|
value: u,
|
|
3271
3290
|
placeholder: e.otherPlaceholder ?? i.other,
|
|
3272
3291
|
onChange: d,
|
|
@@ -3274,9 +3293,9 @@ function Mn({ question: e, number: t, answer: n, onCommit: r, labels: i }) {
|
|
|
3274
3293
|
})]
|
|
3275
3294
|
});
|
|
3276
3295
|
}
|
|
3277
|
-
function
|
|
3278
|
-
let c =
|
|
3279
|
-
if (n === "active") m = /* @__PURE__ */ _(
|
|
3296
|
+
function Pn({ question: e, number: t, state: n, answer: r, onCommit: i, onEdit: a, readOnly: o = !1, labels: s }) {
|
|
3297
|
+
let c = U("question", s), l = n !== "upcoming", u = q(), d = p(null), f = Dn(d), m;
|
|
3298
|
+
if (n === "active") m = /* @__PURE__ */ _(Nn, {
|
|
3280
3299
|
question: e,
|
|
3281
3300
|
number: t,
|
|
3282
3301
|
answer: r,
|
|
@@ -3284,9 +3303,9 @@ function Nn({ question: e, number: t, state: n, answer: r, onCommit: i, onEdit:
|
|
|
3284
3303
|
labels: c
|
|
3285
3304
|
});
|
|
3286
3305
|
else if (n === "collapsed") {
|
|
3287
|
-
let n =
|
|
3306
|
+
let n = Mn(e, r), i = /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ v("span", {
|
|
3288
3307
|
className: X.collapsedLabel,
|
|
3289
|
-
children: [/* @__PURE__ */ _(
|
|
3308
|
+
children: [/* @__PURE__ */ _(Sn, {
|
|
3290
3309
|
onCard: !0,
|
|
3291
3310
|
children: t
|
|
3292
3311
|
}), /* @__PURE__ */ _("span", {
|
|
@@ -3295,7 +3314,7 @@ function Nn({ question: e, number: t, state: n, answer: r, onCommit: i, onEdit:
|
|
|
3295
3314
|
})]
|
|
3296
3315
|
}), /* @__PURE__ */ v("span", {
|
|
3297
3316
|
className: X.collapsedAnswer,
|
|
3298
|
-
children: [n.map((e, t) => /* @__PURE__ */ _(
|
|
3317
|
+
children: [n.map((e, t) => /* @__PURE__ */ _(xn, { children: e }, `${e}-${t}`)), !o && /* @__PURE__ */ _(de, {
|
|
3299
3318
|
className: X.pencil,
|
|
3300
3319
|
size: 14,
|
|
3301
3320
|
"aria-hidden": !0
|
|
@@ -3313,7 +3332,7 @@ function Nn({ question: e, number: t, state: n, answer: r, onCommit: i, onEdit:
|
|
|
3313
3332
|
});
|
|
3314
3333
|
} else m = /* @__PURE__ */ v("div", {
|
|
3315
3334
|
className: X.upcoming,
|
|
3316
|
-
children: [/* @__PURE__ */ _(
|
|
3335
|
+
children: [/* @__PURE__ */ _(Sn, { children: t }), /* @__PURE__ */ _("span", {
|
|
3317
3336
|
className: X.upcomingLabel,
|
|
3318
3337
|
children: e.shortTitle
|
|
3319
3338
|
})]
|
|
@@ -3324,7 +3343,7 @@ function Nn({ question: e, number: t, state: n, answer: r, onCommit: i, onEdit:
|
|
|
3324
3343
|
"data-active": n === "active" || void 0,
|
|
3325
3344
|
className: X.item,
|
|
3326
3345
|
"data-card": l || void 0,
|
|
3327
|
-
transition: { layout:
|
|
3346
|
+
transition: { layout: On },
|
|
3328
3347
|
style: { borderRadius: f },
|
|
3329
3348
|
children: /* @__PURE__ */ _(y, {
|
|
3330
3349
|
mode: "popLayout",
|
|
@@ -3348,7 +3367,7 @@ function Nn({ question: e, number: t, state: n, answer: r, onCommit: i, onEdit:
|
|
|
3348
3367
|
})
|
|
3349
3368
|
});
|
|
3350
3369
|
}
|
|
3351
|
-
var
|
|
3370
|
+
var Fn = {
|
|
3352
3371
|
group: "ick-group-pPcU",
|
|
3353
3372
|
body: "ick-body-lHD3",
|
|
3354
3373
|
list: "ick-list-7cp2",
|
|
@@ -3356,7 +3375,7 @@ var Pn = {
|
|
|
3356
3375
|
summary: "ick-summary-eb2t",
|
|
3357
3376
|
count: "ick-count-eHDc",
|
|
3358
3377
|
summaryList: "ick-summaryList-2sOL"
|
|
3359
|
-
},
|
|
3378
|
+
}, In = 3, Ln = {
|
|
3360
3379
|
visualDuration: .34,
|
|
3361
3380
|
bounce: .1,
|
|
3362
3381
|
rowDuration: .3,
|
|
@@ -3367,9 +3386,9 @@ var Pn = {
|
|
|
3367
3386
|
fadeOut: .08,
|
|
3368
3387
|
fadeInDelay: .08
|
|
3369
3388
|
};
|
|
3370
|
-
function
|
|
3371
|
-
let [h, g] = m(!1), [x, S] = m(!1), w = l(), T = p(null), E =
|
|
3372
|
-
...
|
|
3389
|
+
function Rn({ id: e, title: t, questions: n, answers: r, activeIndex: i = null, collapsible: a = !1, onCommit: o, onEdit: s, readOnly: c = !1, labels: u, foldMotion: d, className: f }) {
|
|
3390
|
+
let [h, g] = m(!1), [x, S] = m(!1), w = l(), T = p(null), E = Dn(T), D = U("questionGroup", u), O = q(), k = a && !h, A = n.map((e) => e.shortTitle).join(" · "), j = {
|
|
3391
|
+
...Ln,
|
|
3373
3392
|
...d
|
|
3374
3393
|
}, M = O ? { duration: 0 } : {
|
|
3375
3394
|
type: "spring",
|
|
@@ -3413,13 +3432,13 @@ function Ln({ id: e, title: t, questions: n, answers: r, activeIndex: i = null,
|
|
|
3413
3432
|
ref: T,
|
|
3414
3433
|
layout: !O,
|
|
3415
3434
|
transition: M,
|
|
3416
|
-
className: [
|
|
3435
|
+
className: [Fn.group, f ?? ""].filter(Boolean).join(" "),
|
|
3417
3436
|
"data-moving": x || void 0,
|
|
3418
3437
|
style: { borderRadius: E },
|
|
3419
3438
|
children: [(t || a) && /* @__PURE__ */ _(C.div, {
|
|
3420
3439
|
layout: !O && "position",
|
|
3421
3440
|
transition: M,
|
|
3422
|
-
children: /* @__PURE__ */ _(
|
|
3441
|
+
children: /* @__PURE__ */ _(Lt, {
|
|
3423
3442
|
open: !k,
|
|
3424
3443
|
onToggle: a ? () => {
|
|
3425
3444
|
S(!0), g((e) => !e);
|
|
@@ -3431,7 +3450,7 @@ function Ln({ id: e, title: t, questions: n, answers: r, activeIndex: i = null,
|
|
|
3431
3450
|
id: w,
|
|
3432
3451
|
layout: !O && "position",
|
|
3433
3452
|
transition: M,
|
|
3434
|
-
className:
|
|
3453
|
+
className: Fn.body,
|
|
3435
3454
|
children: /* @__PURE__ */ _(y, {
|
|
3436
3455
|
initial: !1,
|
|
3437
3456
|
mode: "popLayout",
|
|
@@ -3439,26 +3458,26 @@ function Ln({ id: e, title: t, questions: n, answers: r, activeIndex: i = null,
|
|
|
3439
3458
|
...F,
|
|
3440
3459
|
children: /* @__PURE__ */ v(C.div, {
|
|
3441
3460
|
variants: P,
|
|
3442
|
-
className:
|
|
3461
|
+
className: Fn.summary,
|
|
3443
3462
|
children: [/* @__PURE__ */ v("span", {
|
|
3444
|
-
className:
|
|
3463
|
+
className: Fn.count,
|
|
3445
3464
|
children: [
|
|
3446
3465
|
n.length,
|
|
3447
3466
|
" ",
|
|
3448
3467
|
D.answers
|
|
3449
3468
|
]
|
|
3450
3469
|
}), /* @__PURE__ */ _("span", {
|
|
3451
|
-
className:
|
|
3470
|
+
className: Fn.summaryList,
|
|
3452
3471
|
children: A
|
|
3453
3472
|
})]
|
|
3454
3473
|
})
|
|
3455
3474
|
}, "summary") : /* @__PURE__ */ _(C.div, {
|
|
3456
|
-
className:
|
|
3475
|
+
className: Fn.list,
|
|
3457
3476
|
...F,
|
|
3458
3477
|
children: n.map((e, t) => /* @__PURE__ */ _(C.div, {
|
|
3459
3478
|
variants: P,
|
|
3460
|
-
className:
|
|
3461
|
-
children: /* @__PURE__ */ _(
|
|
3479
|
+
className: Fn.row,
|
|
3480
|
+
children: /* @__PURE__ */ _(Pn, {
|
|
3462
3481
|
question: e,
|
|
3463
3482
|
number: t + 1,
|
|
3464
3483
|
state: t === i ? "active" : r[e.id] ? "collapsed" : "upcoming",
|
|
@@ -3474,59 +3493,60 @@ function Ln({ id: e, title: t, questions: n, answers: r, activeIndex: i = null,
|
|
|
3474
3493
|
})
|
|
3475
3494
|
});
|
|
3476
3495
|
}
|
|
3477
|
-
var
|
|
3496
|
+
var zn = { message: "ick-message-wTar" };
|
|
3478
3497
|
//#endregion
|
|
3479
3498
|
//#region src/SystemMessage/SystemMessage.tsx
|
|
3480
|
-
function
|
|
3499
|
+
function Bn({ children: e, tone: t = "notice", className: n, ...r }) {
|
|
3481
3500
|
return /* @__PURE__ */ _("div", {
|
|
3482
|
-
className: [
|
|
3501
|
+
className: [zn.message, n ?? ""].filter(Boolean).join(" "),
|
|
3483
3502
|
"data-tone": t,
|
|
3484
3503
|
...r,
|
|
3485
3504
|
children: e
|
|
3486
3505
|
});
|
|
3487
3506
|
}
|
|
3488
|
-
var
|
|
3507
|
+
var Vn = {
|
|
3489
3508
|
artifact: "ick-artifact-rz53",
|
|
3490
3509
|
card: "ick-card-iGYJ",
|
|
3491
3510
|
head: "ick-head-XVNm",
|
|
3492
3511
|
title: "ick-title-1JVB",
|
|
3493
3512
|
"artifact-sweep": "ick-artifact-sweep-19ol",
|
|
3494
3513
|
meta: "ick-meta-vxo7",
|
|
3514
|
+
grows: "ick-grows-v7GM",
|
|
3495
3515
|
preview: "ick-preview-jRni",
|
|
3496
3516
|
text: "ick-text-uJx8",
|
|
3497
3517
|
waiting: "ick-waiting-ADQs"
|
|
3498
|
-
},
|
|
3499
|
-
function
|
|
3518
|
+
}, Hn = 8;
|
|
3519
|
+
function Un(e, t) {
|
|
3500
3520
|
let n = e.split("\n");
|
|
3501
3521
|
return {
|
|
3502
3522
|
shown: n.slice(0, t).join("\n"),
|
|
3503
3523
|
more: n.length > t
|
|
3504
3524
|
};
|
|
3505
3525
|
}
|
|
3506
|
-
function
|
|
3507
|
-
let f = o === "writing", p = a ?
|
|
3508
|
-
className:
|
|
3526
|
+
function Wn({ id: e, title: t, meta: n, kind: r = "code", lang: i, content: a, state: o = "done", lines: s = Hn, onOpen: c, open: l, className: u, ...d }) {
|
|
3527
|
+
let f = o === "writing", p = a ? Un(a, s) : null, m = /* @__PURE__ */ _(Kn, { children: /* @__PURE__ */ _("div", {
|
|
3528
|
+
className: Vn.preview,
|
|
3509
3529
|
"data-more": p?.more || void 0,
|
|
3510
3530
|
"aria-hidden": !0,
|
|
3511
3531
|
children: p === null ? /* @__PURE__ */ _("div", {
|
|
3512
|
-
className:
|
|
3513
|
-
children: /* @__PURE__ */ _(
|
|
3514
|
-
}) : r === "code" ? /* @__PURE__ */ _(
|
|
3532
|
+
className: Vn.waiting,
|
|
3533
|
+
children: /* @__PURE__ */ _(Nt, {})
|
|
3534
|
+
}) : r === "code" ? /* @__PURE__ */ _(nn, {
|
|
3515
3535
|
code: p.shown,
|
|
3516
3536
|
lang: i,
|
|
3517
3537
|
label: !1,
|
|
3518
3538
|
copyable: !1
|
|
3519
3539
|
}) : /* @__PURE__ */ _("p", {
|
|
3520
|
-
className:
|
|
3540
|
+
className: Vn.text,
|
|
3521
3541
|
children: p.shown
|
|
3522
3542
|
})
|
|
3523
|
-
}), h = /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(
|
|
3543
|
+
}) }), h = /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(Gn, {
|
|
3524
3544
|
title: t,
|
|
3525
3545
|
meta: n,
|
|
3526
3546
|
writing: f
|
|
3527
|
-
}), m] }), y = { className:
|
|
3547
|
+
}), m] }), y = { className: Vn.card };
|
|
3528
3548
|
return /* @__PURE__ */ _("div", {
|
|
3529
|
-
className: [
|
|
3549
|
+
className: [Vn.artifact, u ?? ""].filter(Boolean).join(" "),
|
|
3530
3550
|
"data-state": o,
|
|
3531
3551
|
"data-open": l || void 0,
|
|
3532
3552
|
...d,
|
|
@@ -3542,36 +3562,62 @@ function Un({ id: e, title: t, meta: n, kind: r = "code", lang: i, content: a, s
|
|
|
3542
3562
|
})
|
|
3543
3563
|
});
|
|
3544
3564
|
}
|
|
3545
|
-
function
|
|
3565
|
+
function Gn({ title: e, meta: t, writing: n }) {
|
|
3546
3566
|
return /* @__PURE__ */ v("span", {
|
|
3547
|
-
className:
|
|
3567
|
+
className: Vn.head,
|
|
3548
3568
|
children: [/* @__PURE__ */ _("span", {
|
|
3549
|
-
className:
|
|
3569
|
+
className: Vn.title,
|
|
3550
3570
|
"data-writing": n || void 0,
|
|
3551
3571
|
children: e
|
|
3552
3572
|
}), t && /* @__PURE__ */ _("span", {
|
|
3553
|
-
className:
|
|
3573
|
+
className: Vn.meta,
|
|
3554
3574
|
children: t
|
|
3555
3575
|
})]
|
|
3556
3576
|
});
|
|
3557
3577
|
}
|
|
3578
|
+
function Kn({ children: e }) {
|
|
3579
|
+
let t = p(null), [n, r] = m("auto");
|
|
3580
|
+
return d(() => {
|
|
3581
|
+
let e = t.current;
|
|
3582
|
+
if (!e || typeof ResizeObserver > "u") return;
|
|
3583
|
+
let n = new ResizeObserver(() => r(e.offsetHeight));
|
|
3584
|
+
return n.observe(e), () => n.disconnect();
|
|
3585
|
+
}, []), /* @__PURE__ */ _(C.div, {
|
|
3586
|
+
className: Vn.grows,
|
|
3587
|
+
initial: !1,
|
|
3588
|
+
animate: { height: n },
|
|
3589
|
+
transition: {
|
|
3590
|
+
duration: q() ? 0 : .22,
|
|
3591
|
+
ease: [
|
|
3592
|
+
.32,
|
|
3593
|
+
.72,
|
|
3594
|
+
0,
|
|
3595
|
+
1
|
|
3596
|
+
]
|
|
3597
|
+
},
|
|
3598
|
+
children: /* @__PURE__ */ _("div", {
|
|
3599
|
+
ref: t,
|
|
3600
|
+
children: e
|
|
3601
|
+
})
|
|
3602
|
+
});
|
|
3603
|
+
}
|
|
3558
3604
|
//#endregion
|
|
3559
3605
|
//#region src/markdown/parse.ts
|
|
3560
|
-
var
|
|
3561
|
-
function
|
|
3606
|
+
var qn = "\\`*_{}[]()#+-.!>~|", Jn = (e) => e === void 0 || /\s/.test(e);
|
|
3607
|
+
function Yn(e, t, n, r) {
|
|
3562
3608
|
let i = e[t + n];
|
|
3563
|
-
return !(
|
|
3609
|
+
return !(Jn(i) || r === "_" && /[\w]/.test(e[t - 1] ?? ""));
|
|
3564
3610
|
}
|
|
3565
|
-
function
|
|
3611
|
+
function Xn(e, t, n, r) {
|
|
3566
3612
|
let i = e[t - 1];
|
|
3567
|
-
return !(
|
|
3613
|
+
return !(Jn(i) || r === "_" && /[\w]/.test(e[t + n] ?? ""));
|
|
3568
3614
|
}
|
|
3569
|
-
function
|
|
3615
|
+
function Zn(e, t, n) {
|
|
3570
3616
|
let r = 0;
|
|
3571
3617
|
for (; e[t + r] === n;) r++;
|
|
3572
3618
|
return r;
|
|
3573
3619
|
}
|
|
3574
|
-
function
|
|
3620
|
+
function Qn(e, t) {
|
|
3575
3621
|
let n = 0;
|
|
3576
3622
|
for (let r = t; r < e.length; r++) {
|
|
3577
3623
|
let t = e[r];
|
|
@@ -3580,7 +3626,7 @@ function Xn(e, t) {
|
|
|
3580
3626
|
continue;
|
|
3581
3627
|
}
|
|
3582
3628
|
if (t === "`") {
|
|
3583
|
-
let t =
|
|
3629
|
+
let t = Zn(e, r, "`"), n = e.indexOf("`".repeat(t), r + t);
|
|
3584
3630
|
r = n === -1 ? e.length : n + t - 1;
|
|
3585
3631
|
continue;
|
|
3586
3632
|
}
|
|
@@ -3589,7 +3635,7 @@ function Xn(e, t) {
|
|
|
3589
3635
|
}
|
|
3590
3636
|
return -1;
|
|
3591
3637
|
}
|
|
3592
|
-
function
|
|
3638
|
+
function $n(e, t) {
|
|
3593
3639
|
if (e[t] !== "(") return null;
|
|
3594
3640
|
let n = 0, r = -1;
|
|
3595
3641
|
for (let i = t; i < e.length; i++) {
|
|
@@ -3611,8 +3657,8 @@ function Zn(e, t) {
|
|
|
3611
3657
|
end: r + 1
|
|
3612
3658
|
};
|
|
3613
3659
|
}
|
|
3614
|
-
var
|
|
3615
|
-
function
|
|
3660
|
+
var er = /^<\/?[A-Za-z][A-Za-z0-9-]*(\s[^<>]*?)?\/?>|^<!--[\s\S]*?-->/;
|
|
3661
|
+
function tr(e) {
|
|
3616
3662
|
let t = [], n = "", r = () => {
|
|
3617
3663
|
n && t.push({
|
|
3618
3664
|
type: "text",
|
|
@@ -3627,7 +3673,7 @@ function $n(e) {
|
|
|
3627
3673
|
r(), t.push({ type: "break" }), i += 2;
|
|
3628
3674
|
continue;
|
|
3629
3675
|
}
|
|
3630
|
-
if (o &&
|
|
3676
|
+
if (o && qn.includes(o)) {
|
|
3631
3677
|
n += o, i += 2;
|
|
3632
3678
|
continue;
|
|
3633
3679
|
}
|
|
@@ -3640,7 +3686,7 @@ function $n(e) {
|
|
|
3640
3686
|
continue;
|
|
3641
3687
|
}
|
|
3642
3688
|
if (a === "`") {
|
|
3643
|
-
let n =
|
|
3689
|
+
let n = Zn(e, i, "`"), a = e.indexOf("`".repeat(n), i + n);
|
|
3644
3690
|
if (a !== -1 && !e.slice(i + n, a).startsWith("`")) {
|
|
3645
3691
|
r();
|
|
3646
3692
|
let o = e.slice(i + n, a);
|
|
@@ -3652,7 +3698,7 @@ function $n(e) {
|
|
|
3652
3698
|
}
|
|
3653
3699
|
}
|
|
3654
3700
|
if (a === "!" && e[i + 1] === "[") {
|
|
3655
|
-
let n =
|
|
3701
|
+
let n = Qn(e, i + 1), a = n === -1 ? null : $n(e, n + 1);
|
|
3656
3702
|
if (a) {
|
|
3657
3703
|
r(), t.push({
|
|
3658
3704
|
type: "image",
|
|
@@ -3673,13 +3719,13 @@ function $n(e) {
|
|
|
3673
3719
|
}
|
|
3674
3720
|
}
|
|
3675
3721
|
if (a === "[") {
|
|
3676
|
-
let n =
|
|
3722
|
+
let n = Qn(e, i), a = n === -1 ? null : $n(e, n + 1);
|
|
3677
3723
|
if (a) {
|
|
3678
3724
|
r(), t.push({
|
|
3679
3725
|
type: "link",
|
|
3680
3726
|
url: a.url,
|
|
3681
3727
|
...a.title ? { title: a.title } : {},
|
|
3682
|
-
children:
|
|
3728
|
+
children: tr(e.slice(i + 1, n))
|
|
3683
3729
|
}), i = a.end;
|
|
3684
3730
|
continue;
|
|
3685
3731
|
}
|
|
@@ -3689,14 +3735,14 @@ function $n(e) {
|
|
|
3689
3735
|
if (n !== -1 && n > i + 2) {
|
|
3690
3736
|
r(), t.push({
|
|
3691
3737
|
type: "delete",
|
|
3692
|
-
children:
|
|
3738
|
+
children: tr(e.slice(i + 2, n))
|
|
3693
3739
|
}), i = n + 2;
|
|
3694
3740
|
continue;
|
|
3695
3741
|
}
|
|
3696
3742
|
}
|
|
3697
3743
|
if (a === "*" || a === "_") {
|
|
3698
|
-
let n = Math.min(
|
|
3699
|
-
if (
|
|
3744
|
+
let n = Math.min(Zn(e, i, a), 2);
|
|
3745
|
+
if (Yn(e, i, n, a)) {
|
|
3700
3746
|
let o = i + n, s = -1;
|
|
3701
3747
|
for (; o < e.length;) {
|
|
3702
3748
|
if (e[o] === "\\") {
|
|
@@ -3704,8 +3750,8 @@ function $n(e) {
|
|
|
3704
3750
|
continue;
|
|
3705
3751
|
}
|
|
3706
3752
|
if (e[o] === a) {
|
|
3707
|
-
let t =
|
|
3708
|
-
if (t >= n &&
|
|
3753
|
+
let t = Zn(e, o, a);
|
|
3754
|
+
if (t >= n && Xn(e, o, n, a)) {
|
|
3709
3755
|
s = o;
|
|
3710
3756
|
break;
|
|
3711
3757
|
}
|
|
@@ -3716,7 +3762,7 @@ function $n(e) {
|
|
|
3716
3762
|
}
|
|
3717
3763
|
if (s !== -1 && s > i + n) {
|
|
3718
3764
|
r();
|
|
3719
|
-
let a =
|
|
3765
|
+
let a = tr(e.slice(i + n, s));
|
|
3720
3766
|
t.push(n === 2 ? {
|
|
3721
3767
|
type: "strong",
|
|
3722
3768
|
children: a
|
|
@@ -3729,7 +3775,7 @@ function $n(e) {
|
|
|
3729
3775
|
}
|
|
3730
3776
|
}
|
|
3731
3777
|
if (a === "<") {
|
|
3732
|
-
let n = e.slice(i).match(
|
|
3778
|
+
let n = e.slice(i).match(er);
|
|
3733
3779
|
if (n) {
|
|
3734
3780
|
r(), t.push({
|
|
3735
3781
|
type: "html",
|
|
@@ -3742,8 +3788,8 @@ function $n(e) {
|
|
|
3742
3788
|
}
|
|
3743
3789
|
return r(), t;
|
|
3744
3790
|
}
|
|
3745
|
-
var
|
|
3746
|
-
function
|
|
3791
|
+
var nr = /^ {0,3}(`{3,}|~{3,})\s*([^`\s]*)[^`]*$/, rr = /^ {0,3}(#{1,6})(?:\s+(.*?))?\s*#*\s*$/, ir = /^ {0,3}(?:(?:\*\s*){3,}|(?:-\s*){3,}|(?:_\s*){3,})$/, ar = /^ {0,3}>\s?/, or = /^(\s*)([-*+])(\s+)(.*)$/, sr = /^(\s*)(\d{1,9})([.)])(\s+)(.*)$/, cr = /^ {0,3}\|?\s*:?-{1,}:?\s*(\|\s*:?-{1,}:?\s*)*\|?\s*$/, lr = /^:?-+:?$/, ur = /^\s*$/;
|
|
3792
|
+
function dr(e) {
|
|
3747
3793
|
let t = e.trim().replace(/^\|/, "").replace(/\|$/, ""), n = [], r = "";
|
|
3748
3794
|
for (let e = 0; e < t.length; e++) {
|
|
3749
3795
|
if (t[e] === "\\" && t[e + 1] === "|") {
|
|
@@ -3758,16 +3804,16 @@ function lr(e) {
|
|
|
3758
3804
|
}
|
|
3759
3805
|
return n.push(r.trim()), n;
|
|
3760
3806
|
}
|
|
3761
|
-
var
|
|
3762
|
-
function
|
|
3807
|
+
var fr = (e) => nr.test(e) || rr.test(e) || ir.test(e) || ar.test(e) || or.test(e) || sr.test(e);
|
|
3808
|
+
function pr(e) {
|
|
3763
3809
|
let t = e.replace(/\r\n?/g, "\n").split("\n"), n = [], r = 0;
|
|
3764
3810
|
for (; r < t.length;) {
|
|
3765
3811
|
let e = t[r];
|
|
3766
|
-
if (
|
|
3812
|
+
if (ur.test(e)) {
|
|
3767
3813
|
r++;
|
|
3768
3814
|
continue;
|
|
3769
3815
|
}
|
|
3770
|
-
let i = e.match(
|
|
3816
|
+
let i = e.match(nr);
|
|
3771
3817
|
if (i) {
|
|
3772
3818
|
let e = i[1][0], a = i[1].length, o = [];
|
|
3773
3819
|
for (r++; r < t.length;) {
|
|
@@ -3784,44 +3830,44 @@ function dr(e) {
|
|
|
3784
3830
|
});
|
|
3785
3831
|
continue;
|
|
3786
3832
|
}
|
|
3787
|
-
let a = e.match(
|
|
3833
|
+
let a = e.match(rr);
|
|
3788
3834
|
if (a) {
|
|
3789
3835
|
n.push({
|
|
3790
3836
|
type: "heading",
|
|
3791
3837
|
depth: a[1].length,
|
|
3792
|
-
children:
|
|
3838
|
+
children: tr(a[2] ?? "")
|
|
3793
3839
|
}), r++;
|
|
3794
3840
|
continue;
|
|
3795
3841
|
}
|
|
3796
|
-
if (
|
|
3842
|
+
if (ir.test(e)) {
|
|
3797
3843
|
n.push({ type: "thematicBreak" }), r++;
|
|
3798
3844
|
continue;
|
|
3799
3845
|
}
|
|
3800
|
-
if (
|
|
3846
|
+
if (ar.test(e)) {
|
|
3801
3847
|
let e = [];
|
|
3802
|
-
for (; r < t.length && !
|
|
3848
|
+
for (; r < t.length && !ur.test(t[r]);) e.push(t[r].replace(ar, "")), r++;
|
|
3803
3849
|
n.push({
|
|
3804
3850
|
type: "blockquote",
|
|
3805
|
-
children:
|
|
3851
|
+
children: pr(e.join("\n"))
|
|
3806
3852
|
});
|
|
3807
3853
|
continue;
|
|
3808
3854
|
}
|
|
3809
|
-
let o = e.includes("|") && r + 1 < t.length &&
|
|
3810
|
-
if (o && o.length ===
|
|
3811
|
-
let i =
|
|
3855
|
+
let o = e.includes("|") && r + 1 < t.length && cr.test(t[r + 1]) ? dr(t[r + 1]) : null;
|
|
3856
|
+
if (o && o.length === dr(e).length && o.every((e) => lr.test(e))) {
|
|
3857
|
+
let i = dr(e), a = [{
|
|
3812
3858
|
type: "tableRow",
|
|
3813
3859
|
children: i.map((e) => ({
|
|
3814
3860
|
type: "tableCell",
|
|
3815
|
-
children:
|
|
3861
|
+
children: tr(e)
|
|
3816
3862
|
}))
|
|
3817
3863
|
}];
|
|
3818
|
-
for (r += 2; r < t.length && !
|
|
3819
|
-
let e =
|
|
3864
|
+
for (r += 2; r < t.length && !ur.test(t[r]) && t[r].includes("|");) {
|
|
3865
|
+
let e = dr(t[r]);
|
|
3820
3866
|
a.push({
|
|
3821
3867
|
type: "tableRow",
|
|
3822
3868
|
children: i.map((t, n) => ({
|
|
3823
3869
|
type: "tableCell",
|
|
3824
|
-
children:
|
|
3870
|
+
children: tr(e[n] ?? "")
|
|
3825
3871
|
}))
|
|
3826
3872
|
}), r++;
|
|
3827
3873
|
}
|
|
@@ -3831,16 +3877,16 @@ function dr(e) {
|
|
|
3831
3877
|
});
|
|
3832
3878
|
continue;
|
|
3833
3879
|
}
|
|
3834
|
-
let s = e.match(
|
|
3880
|
+
let s = e.match(or), c = e.match(sr);
|
|
3835
3881
|
if (s || c) {
|
|
3836
3882
|
let e = !!c, i = c ? Number(c[2]) : void 0, a = [];
|
|
3837
3883
|
for (; r < t.length;) {
|
|
3838
|
-
let n = t[r].match(
|
|
3884
|
+
let n = t[r].match(or), i = t[r].match(sr), o = e ? i : n;
|
|
3839
3885
|
if (!o || !!i !== e) break;
|
|
3840
3886
|
let s = e ? o[1].length + o[2].length + 1 + o[4].length : o[1].length + 1 + o[3].length, c = [e ? o[5] : o[4]];
|
|
3841
3887
|
for (r++; r < t.length;) {
|
|
3842
3888
|
let e = t[r];
|
|
3843
|
-
if (
|
|
3889
|
+
if (ur.test(e)) {
|
|
3844
3890
|
let e = t[r + 1];
|
|
3845
3891
|
if (e !== void 0 && RegExp(`^ {${s},}\\S`).test(e)) {
|
|
3846
3892
|
c.push(""), r++;
|
|
@@ -3852,12 +3898,12 @@ function dr(e) {
|
|
|
3852
3898
|
c.push(e.slice(s)), r++;
|
|
3853
3899
|
continue;
|
|
3854
3900
|
}
|
|
3855
|
-
if (
|
|
3901
|
+
if (or.test(e) || sr.test(e) || fr(e)) break;
|
|
3856
3902
|
c.push(e.trim()), r++;
|
|
3857
3903
|
}
|
|
3858
3904
|
a.push({
|
|
3859
3905
|
type: "listItem",
|
|
3860
|
-
children:
|
|
3906
|
+
children: pr(c.join("\n"))
|
|
3861
3907
|
});
|
|
3862
3908
|
}
|
|
3863
3909
|
n.push({
|
|
@@ -3869,25 +3915,25 @@ function dr(e) {
|
|
|
3869
3915
|
continue;
|
|
3870
3916
|
}
|
|
3871
3917
|
let l = [];
|
|
3872
|
-
for (; r < t.length && !
|
|
3918
|
+
for (; r < t.length && !ur.test(t[r]) && !(l.length && fr(t[r]) || l.length && t[r].includes("|") && r + 1 < t.length && cr.test(t[r + 1]));) l.push(t[r]), r++;
|
|
3873
3919
|
let u = l.map((e) => e.replace(/^[ \t]+/, "")).join("\n").replace(/\s+$/, "");
|
|
3874
3920
|
n.push({
|
|
3875
3921
|
type: "paragraph",
|
|
3876
|
-
children:
|
|
3922
|
+
children: tr(u)
|
|
3877
3923
|
});
|
|
3878
3924
|
}
|
|
3879
3925
|
return n;
|
|
3880
3926
|
}
|
|
3881
3927
|
//#endregion
|
|
3882
3928
|
//#region src/markdown/parseMarkdown.ts
|
|
3883
|
-
var
|
|
3929
|
+
var mr = "\n\n", hr = [
|
|
3884
3930
|
"h1",
|
|
3885
3931
|
"h2",
|
|
3886
3932
|
"h3",
|
|
3887
3933
|
"h4",
|
|
3888
3934
|
"h5",
|
|
3889
3935
|
"h6"
|
|
3890
|
-
],
|
|
3936
|
+
], gr = class {
|
|
3891
3937
|
tokens = [];
|
|
3892
3938
|
text(e) {
|
|
3893
3939
|
let t = [];
|
|
@@ -3898,7 +3944,7 @@ var fr = "\n\n", pr = [
|
|
|
3898
3944
|
return t;
|
|
3899
3945
|
}
|
|
3900
3946
|
break() {
|
|
3901
|
-
this.tokens.push(
|
|
3947
|
+
this.tokens.push(mr);
|
|
3902
3948
|
}
|
|
3903
3949
|
}, Z = (e, t, n) => ({
|
|
3904
3950
|
type: "el",
|
|
@@ -3906,29 +3952,29 @@ var fr = "\n\n", pr = [
|
|
|
3906
3952
|
children: t,
|
|
3907
3953
|
...n ? { props: n } : {}
|
|
3908
3954
|
});
|
|
3909
|
-
function
|
|
3955
|
+
function _r(e, t, n) {
|
|
3910
3956
|
return e.map((e, r) => (r > 0 && t.break(), n(e)));
|
|
3911
3957
|
}
|
|
3912
|
-
function
|
|
3958
|
+
function vr(e, t) {
|
|
3913
3959
|
let n = [];
|
|
3914
3960
|
for (let r of e) switch (r.type) {
|
|
3915
3961
|
case "text":
|
|
3916
3962
|
n.push(...t.text(r.value));
|
|
3917
3963
|
break;
|
|
3918
3964
|
case "strong":
|
|
3919
|
-
n.push(Z("strong",
|
|
3965
|
+
n.push(Z("strong", vr(r.children, t)));
|
|
3920
3966
|
break;
|
|
3921
3967
|
case "emphasis":
|
|
3922
|
-
n.push(Z("em",
|
|
3968
|
+
n.push(Z("em", vr(r.children, t)));
|
|
3923
3969
|
break;
|
|
3924
3970
|
case "delete":
|
|
3925
|
-
n.push(Z("del",
|
|
3971
|
+
n.push(Z("del", vr(r.children, t)));
|
|
3926
3972
|
break;
|
|
3927
3973
|
case "inlineCode":
|
|
3928
3974
|
n.push(Z("code", t.text(r.value)));
|
|
3929
3975
|
break;
|
|
3930
3976
|
case "link":
|
|
3931
|
-
n.push(Z("a",
|
|
3977
|
+
n.push(Z("a", vr(r.children, t), {
|
|
3932
3978
|
href: r.url,
|
|
3933
3979
|
target: "_blank",
|
|
3934
3980
|
rel: "noopener noreferrer",
|
|
@@ -3947,25 +3993,25 @@ function gr(e, t) {
|
|
|
3947
3993
|
case "break":
|
|
3948
3994
|
n.push(Z("br", []));
|
|
3949
3995
|
break;
|
|
3950
|
-
default: "children" in r && Array.isArray(r.children) && n.push(...
|
|
3996
|
+
default: "children" in r && Array.isArray(r.children) && n.push(...vr(r.children, t));
|
|
3951
3997
|
}
|
|
3952
3998
|
return n;
|
|
3953
3999
|
}
|
|
3954
|
-
function
|
|
4000
|
+
function yr(e, t) {
|
|
3955
4001
|
let n = [];
|
|
3956
4002
|
return e.forEach((e, r) => {
|
|
3957
4003
|
switch (r > 0 && t.break(), e.type) {
|
|
3958
4004
|
case "paragraph":
|
|
3959
|
-
n.push(Z("p",
|
|
4005
|
+
n.push(Z("p", vr(e.children, t)));
|
|
3960
4006
|
break;
|
|
3961
4007
|
case "heading":
|
|
3962
|
-
n.push(Z(
|
|
4008
|
+
n.push(Z(hr[e.depth - 1] ?? "h6", vr(e.children, t)));
|
|
3963
4009
|
break;
|
|
3964
4010
|
case "list":
|
|
3965
|
-
n.push(Z(e.ordered ? "ol" : "ul",
|
|
4011
|
+
n.push(Z(e.ordered ? "ol" : "ul", _r(e.children, t, (e) => Z("li", yr(e.children, t))), e.ordered && e.start != null && e.start !== 1 ? { start: String(e.start) } : void 0));
|
|
3966
4012
|
break;
|
|
3967
4013
|
case "blockquote":
|
|
3968
|
-
n.push(Z("blockquote",
|
|
4014
|
+
n.push(Z("blockquote", yr(e.children, t)));
|
|
3969
4015
|
break;
|
|
3970
4016
|
case "code":
|
|
3971
4017
|
n.push({
|
|
@@ -3978,24 +4024,24 @@ function _r(e, t) {
|
|
|
3978
4024
|
n.push(Z("hr", []));
|
|
3979
4025
|
break;
|
|
3980
4026
|
case "table": {
|
|
3981
|
-
let [r, ...i] = e.children, a = (e, n) =>
|
|
4027
|
+
let [r, ...i] = e.children, a = (e, n) => _r(e.children, t, (e) => Z(n, vr(e.children, t))), o = r ? Z("thead", [Z("tr", a(r, "th"))]) : null;
|
|
3982
4028
|
o && i.length && t.break();
|
|
3983
|
-
let s = i.length ? Z("tbody",
|
|
4029
|
+
let s = i.length ? Z("tbody", _r(i, t, (e) => Z("tr", a(e, "td")))) : null;
|
|
3984
4030
|
n.push(Z("table", [o, s].filter((e) => e !== null)));
|
|
3985
4031
|
break;
|
|
3986
4032
|
}
|
|
3987
|
-
default: "children" in e && Array.isArray(e.children) && n.push(...
|
|
4033
|
+
default: "children" in e && Array.isArray(e.children) && n.push(...vr(e.children, t));
|
|
3988
4034
|
}
|
|
3989
4035
|
}), n;
|
|
3990
4036
|
}
|
|
3991
|
-
function
|
|
3992
|
-
let t = new
|
|
4037
|
+
function br(e) {
|
|
4038
|
+
let t = new gr(), n = yr(pr(e), t);
|
|
3993
4039
|
return {
|
|
3994
4040
|
tokens: t.tokens,
|
|
3995
4041
|
nodes: n
|
|
3996
4042
|
};
|
|
3997
4043
|
}
|
|
3998
|
-
var
|
|
4044
|
+
var xr = {
|
|
3999
4045
|
citation: "ick-citation-3Yqh",
|
|
4000
4046
|
marked: "ick-marked-MYhj",
|
|
4001
4047
|
passage: "ick-passage-QMNg",
|
|
@@ -4003,16 +4049,16 @@ var yr = {
|
|
|
4003
4049
|
};
|
|
4004
4050
|
//#endregion
|
|
4005
4051
|
//#region src/InlineCitation/InlineCitation.tsx
|
|
4006
|
-
function
|
|
4007
|
-
let { cite: s } =
|
|
4052
|
+
function Sr({ index: e, source: t, children: n, onSelect: r, labels: i, className: a, ...o }) {
|
|
4053
|
+
let { cite: s } = U("citation", i), c = t ? `${s} ${e}: ${t.title}` : `${s} ${e}`, l = r ? /* @__PURE__ */ _("button", {
|
|
4008
4054
|
type: "button",
|
|
4009
|
-
className:
|
|
4055
|
+
className: xr.marker,
|
|
4010
4056
|
onClick: () => r(e, t),
|
|
4011
4057
|
onPointerDown: (e) => e.stopPropagation(),
|
|
4012
4058
|
"aria-label": c,
|
|
4013
4059
|
children: e
|
|
4014
4060
|
}) : /* @__PURE__ */ _("span", {
|
|
4015
|
-
className:
|
|
4061
|
+
className: xr.marker,
|
|
4016
4062
|
"data-static": "",
|
|
4017
4063
|
"aria-label": c,
|
|
4018
4064
|
role: "note",
|
|
@@ -4020,22 +4066,22 @@ function br({ index: e, source: t, children: n, onSelect: r, labels: i, classNam
|
|
|
4020
4066
|
});
|
|
4021
4067
|
return n ? /* @__PURE__ */ v("span", {
|
|
4022
4068
|
className: [
|
|
4023
|
-
|
|
4024
|
-
|
|
4069
|
+
xr.citation,
|
|
4070
|
+
xr.marked,
|
|
4025
4071
|
a ?? ""
|
|
4026
4072
|
].filter(Boolean).join(" "),
|
|
4027
4073
|
...o,
|
|
4028
4074
|
children: [/* @__PURE__ */ _("span", {
|
|
4029
|
-
className:
|
|
4075
|
+
className: xr.passage,
|
|
4030
4076
|
children: n
|
|
4031
4077
|
}), l]
|
|
4032
4078
|
}) : /* @__PURE__ */ _("span", {
|
|
4033
|
-
className: [
|
|
4079
|
+
className: [xr.citation, a ?? ""].filter(Boolean).join(" "),
|
|
4034
4080
|
...o,
|
|
4035
4081
|
children: l
|
|
4036
4082
|
});
|
|
4037
4083
|
}
|
|
4038
|
-
var
|
|
4084
|
+
var Cr = {
|
|
4039
4085
|
marker: "ick-marker-BYwC",
|
|
4040
4086
|
shimmer: "ick-shimmer-InQp",
|
|
4041
4087
|
"shimmer-sweep": "ick-shimmer-sweep-O8S3",
|
|
@@ -4046,21 +4092,21 @@ var xr = {
|
|
|
4046
4092
|
canvas: "ick-canvas-IRKL",
|
|
4047
4093
|
menu: "ick-menu-gZzr",
|
|
4048
4094
|
srOnly: "ick-srOnly-Q3GJ"
|
|
4049
|
-
},
|
|
4095
|
+
}, wr = -20, Tr = Math.tan(wr * Math.PI / 180), Er = (e) => {
|
|
4050
4096
|
if (e.length === 0) return "";
|
|
4051
4097
|
let t = e[0], n = `M ${t.x} ${t.y}`;
|
|
4052
4098
|
for (let t = 1; t < e.length; t++) n += ` L ${e[t].x} ${e[t].y}`;
|
|
4053
4099
|
return n;
|
|
4054
|
-
},
|
|
4100
|
+
}, Dr = (e) => {
|
|
4055
4101
|
let t = Infinity, n = -Infinity, r = Infinity;
|
|
4056
4102
|
return e.forEach((e) => {
|
|
4057
|
-
let i = e.x +
|
|
4103
|
+
let i = e.x + Tr * e.y;
|
|
4058
4104
|
i < t && (t = i), i > n && (n = i), e.y < r && (r = e.y);
|
|
4059
4105
|
}), {
|
|
4060
4106
|
x: (t + n) / 2,
|
|
4061
4107
|
y: r
|
|
4062
4108
|
};
|
|
4063
|
-
},
|
|
4109
|
+
}, Or = (e) => {
|
|
4064
4110
|
let t = Infinity, n = -Infinity, r = Infinity;
|
|
4065
4111
|
return e.forEach((e) => {
|
|
4066
4112
|
e.x < t && (t = e.x), e.x + e.w > n && (n = e.x + e.w), e.y < r && (r = e.y);
|
|
@@ -4068,67 +4114,67 @@ var xr = {
|
|
|
4068
4114
|
x: (t + n) / 2,
|
|
4069
4115
|
y: r
|
|
4070
4116
|
};
|
|
4071
|
-
},
|
|
4117
|
+
}, kr = (e, t) => {
|
|
4072
4118
|
if (e.size === 0) return "";
|
|
4073
4119
|
let n = [...e].sort((e, t) => e - t), r = "";
|
|
4074
4120
|
for (let e = n[0]; e <= n[n.length - 1]; e++) r += t[e];
|
|
4075
4121
|
return r.trim();
|
|
4076
|
-
},
|
|
4122
|
+
}, Ar = (e, t = 60) => e.length > t ? `${e.slice(0, t).trimEnd()}…` : e, jr = (e) => {
|
|
4077
4123
|
let t = "";
|
|
4078
4124
|
return e.forEach((e) => {
|
|
4079
|
-
let n = e.y + e.h / 2, r = e.x - n *
|
|
4125
|
+
let n = e.y + e.h / 2, r = e.x - n * Tr, i = e.x + e.w - n * Tr;
|
|
4080
4126
|
t += `M ${r} ${n} L ${i} ${n} `;
|
|
4081
4127
|
}), t.trim();
|
|
4082
4128
|
};
|
|
4083
|
-
function
|
|
4084
|
-
let h =
|
|
4129
|
+
function Mr({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlightComplete: a, onReplyInThread: s, sources: u, onSelectSource: d }) {
|
|
4130
|
+
let h = U("highlighter"), g = p(null), [b, S] = m([]), [w, T] = m([]), [E, D] = m(null), [O, k] = m(!1), [A, j] = m(null), [M, N] = m(0), ee = p(null), P = p(null), [F, I] = m(null), [L, R] = m(null), te = o((e) => {
|
|
4085
4131
|
e.viaKeyboard && (P.current = document.activeElement), N(0), j(e);
|
|
4086
|
-
}, []),
|
|
4132
|
+
}, []), ne = o((e = "none") => {
|
|
4087
4133
|
let t = P.current;
|
|
4088
4134
|
P.current = null, j(null), e !== "none" && (e === "restore" && t?.isConnected ? t.focus() : g.current?.focus());
|
|
4089
4135
|
}, []);
|
|
4090
4136
|
c(() => {
|
|
4091
4137
|
let e = (e) => {
|
|
4092
|
-
A && g.current && !g.current.contains(e.target) &&
|
|
4138
|
+
A && g.current && !g.current.contains(e.target) && ne();
|
|
4093
4139
|
};
|
|
4094
4140
|
return window.addEventListener("pointerdown", e), () => window.removeEventListener("pointerdown", e);
|
|
4095
|
-
}, [A,
|
|
4096
|
-
let
|
|
4141
|
+
}, [A, ne]);
|
|
4142
|
+
let re = f(() => br(t), [t]), z = re.tokens, ae = p(w), oe = p(a), se = p(A);
|
|
4097
4143
|
c(() => {
|
|
4098
|
-
|
|
4144
|
+
ae.current = w, oe.current = a, se.current = A;
|
|
4099
4145
|
});
|
|
4100
|
-
let
|
|
4146
|
+
let ce = f(() => [...b.map((e) => ({
|
|
4101
4147
|
id: e.id,
|
|
4102
|
-
d:
|
|
4148
|
+
d: Er(e.points),
|
|
4103
4149
|
kind: "path",
|
|
4104
4150
|
item: e,
|
|
4105
|
-
text:
|
|
4151
|
+
text: kr(e.highlightedIndices, z)
|
|
4106
4152
|
})), ...w.map((e) => ({
|
|
4107
4153
|
id: e.id,
|
|
4108
|
-
d:
|
|
4154
|
+
d: jr(e.rects),
|
|
4109
4155
|
kind: "selection",
|
|
4110
4156
|
item: e,
|
|
4111
4157
|
text: e.text
|
|
4112
4158
|
}))], [
|
|
4113
4159
|
b,
|
|
4114
4160
|
w,
|
|
4115
|
-
|
|
4116
|
-
]),
|
|
4117
|
-
let n = e.kind === "path" ?
|
|
4118
|
-
|
|
4161
|
+
z
|
|
4162
|
+
]), le = (e, t = !1) => {
|
|
4163
|
+
let n = e.kind === "path" ? Dr(e.item.points) : Or(e.item.rects);
|
|
4164
|
+
te({
|
|
4119
4165
|
x: n.x,
|
|
4120
4166
|
y: n.y,
|
|
4121
4167
|
pathId: e.id,
|
|
4122
4168
|
kind: e.kind,
|
|
4123
4169
|
viaKeyboard: t
|
|
4124
4170
|
});
|
|
4125
|
-
},
|
|
4171
|
+
}, ue = o((e, t, n = !1) => {
|
|
4126
4172
|
let r = g.current, i = t.trim();
|
|
4127
4173
|
if (!r || !i) return;
|
|
4128
4174
|
let a = /* @__PURE__ */ new Set();
|
|
4129
4175
|
r.querySelectorAll("span[data-index]").forEach((t) => {
|
|
4130
4176
|
e.intersectsNode(t) && a.add(parseInt(t.getAttribute("data-index"), 10));
|
|
4131
|
-
}),
|
|
4177
|
+
}), oe.current?.(i);
|
|
4132
4178
|
let o = r.getBoundingClientRect(), s = Array.from(e.getClientRects()).map((e) => ({
|
|
4133
4179
|
x: e.left - o.left,
|
|
4134
4180
|
y: e.top - o.top,
|
|
@@ -4156,24 +4202,24 @@ function Ar({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
|
|
|
4156
4202
|
text: i,
|
|
4157
4203
|
highlightedIndices: a
|
|
4158
4204
|
}]);
|
|
4159
|
-
let d =
|
|
4160
|
-
|
|
4205
|
+
let d = Or(l);
|
|
4206
|
+
te({
|
|
4161
4207
|
x: d.x,
|
|
4162
4208
|
y: d.y,
|
|
4163
4209
|
pathId: u,
|
|
4164
4210
|
kind: "selection",
|
|
4165
4211
|
viaKeyboard: n
|
|
4166
4212
|
});
|
|
4167
|
-
}, [
|
|
4213
|
+
}, [te]);
|
|
4168
4214
|
c(() => {
|
|
4169
4215
|
let e = (e) => {
|
|
4170
|
-
if (
|
|
4216
|
+
if (se.current) return;
|
|
4171
4217
|
let t = g.current;
|
|
4172
4218
|
if (!t) return;
|
|
4173
4219
|
let n = window.getSelection();
|
|
4174
4220
|
if (!n || n.isCollapsed || n.rangeCount === 0 || !n.toString().trim()) return;
|
|
4175
4221
|
let r = n.getRangeAt(0);
|
|
4176
|
-
t.contains(r.commonAncestorContainer) && (
|
|
4222
|
+
t.contains(r.commonAncestorContainer) && (ue(r, n.toString(), e), requestAnimationFrame(() => window.getSelection()?.removeAllRanges()));
|
|
4177
4223
|
}, t = () => e(!1), n = (t) => {
|
|
4178
4224
|
let n = (t.ctrlKey || t.metaKey) && t.key.toLowerCase() === "a";
|
|
4179
4225
|
!t.shiftKey && !n || e(!0);
|
|
@@ -4181,34 +4227,34 @@ function Ar({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
|
|
|
4181
4227
|
return document.addEventListener("mouseup", t), document.addEventListener("keyup", n), () => {
|
|
4182
4228
|
document.removeEventListener("mouseup", t), document.removeEventListener("keyup", n);
|
|
4183
4229
|
};
|
|
4184
|
-
}, [
|
|
4185
|
-
let [
|
|
4186
|
-
|
|
4187
|
-
let
|
|
4188
|
-
from: Math.min(
|
|
4189
|
-
to: Math.max(
|
|
4190
|
-
}, [
|
|
4191
|
-
|
|
4192
|
-
},
|
|
4230
|
+
}, [ue]);
|
|
4231
|
+
let [B, de] = m(i);
|
|
4232
|
+
B !== i && (de(i), j(null));
|
|
4233
|
+
let fe = f(() => z.map((e, t) => e.trim() ? t : -1).filter((e) => e >= 0), [z]), [pe, me] = m(null), [he, ge] = m(null), _e = l(), ve = f(() => pe === null || he === null ? null : {
|
|
4234
|
+
from: Math.min(he, pe),
|
|
4235
|
+
to: Math.max(he, pe)
|
|
4236
|
+
}, [pe, he]), ye = () => {
|
|
4237
|
+
me(null), ge(null);
|
|
4238
|
+
}, be = () => {
|
|
4193
4239
|
let e = g.current;
|
|
4194
|
-
if (!e || !
|
|
4195
|
-
let t = e.querySelector(`span[data-index="${
|
|
4240
|
+
if (!e || !ve) return;
|
|
4241
|
+
let t = e.querySelector(`span[data-index="${ve.from}"]`), n = e.querySelector(`span[data-index="${ve.to}"]`);
|
|
4196
4242
|
if (!t || !n) return;
|
|
4197
4243
|
let r = document.createRange();
|
|
4198
4244
|
r.setStartBefore(t), r.setEndAfter(n);
|
|
4199
4245
|
let i = "";
|
|
4200
|
-
for (let e =
|
|
4201
|
-
|
|
4202
|
-
},
|
|
4246
|
+
for (let e = ve.from; e <= ve.to; e++) i += z[e];
|
|
4247
|
+
ue(r, i, !0), ye();
|
|
4248
|
+
}, Se = () => [...ee.current?.querySelectorAll("[role=\"menuitem\"]") ?? []];
|
|
4203
4249
|
c(() => {
|
|
4204
4250
|
if (!A) return;
|
|
4205
|
-
let e =
|
|
4251
|
+
let e = Se();
|
|
4206
4252
|
if (e.length === 0) return;
|
|
4207
4253
|
let t = ee.current?.contains(document.activeElement);
|
|
4208
4254
|
(A.viaKeyboard || t) && e[Math.min(M, e.length - 1)]?.focus();
|
|
4209
4255
|
}, [A, M]);
|
|
4210
|
-
let
|
|
4211
|
-
let t =
|
|
4256
|
+
let Ce = (e) => {
|
|
4257
|
+
let t = Se().length;
|
|
4212
4258
|
if (t === 0) return;
|
|
4213
4259
|
let n = (n) => {
|
|
4214
4260
|
e.preventDefault(), e.stopPropagation(), N((e) => (e + n + t) % t);
|
|
@@ -4222,41 +4268,41 @@ function Ar({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
|
|
|
4222
4268
|
case "End": return e.preventDefault(), N(t - 1);
|
|
4223
4269
|
default: return;
|
|
4224
4270
|
}
|
|
4225
|
-
},
|
|
4226
|
-
if (e.target !== e.currentTarget && e.key !== "Escape" ||
|
|
4271
|
+
}, V = (e) => {
|
|
4272
|
+
if (e.target !== e.currentTarget && e.key !== "Escape" || fe.length === 0) return;
|
|
4227
4273
|
let t = (t, n) => {
|
|
4228
4274
|
e.preventDefault();
|
|
4229
|
-
let r =
|
|
4230
|
-
|
|
4275
|
+
let r = pe === null ? -1 : fe.indexOf(pe), i = r === -1 ? fe[t === 1 ? 0 : fe.length - 1] : fe[Math.min(fe.length - 1, Math.max(0, r + t))];
|
|
4276
|
+
me(i), (!n || he === null) && ge(i);
|
|
4231
4277
|
}, n = (t) => {
|
|
4232
|
-
e.preventDefault(),
|
|
4278
|
+
e.preventDefault(), me(t), (!e.shiftKey || he === null) && ge(t);
|
|
4233
4279
|
};
|
|
4234
4280
|
switch (e.key) {
|
|
4235
4281
|
case "ArrowRight": return t(1, e.shiftKey);
|
|
4236
4282
|
case "ArrowLeft": return t(-1, e.shiftKey);
|
|
4237
|
-
case "Home": return n(
|
|
4238
|
-
case "End": return n(
|
|
4283
|
+
case "Home": return n(fe[0]);
|
|
4284
|
+
case "End": return n(fe[fe.length - 1]);
|
|
4239
4285
|
case "Enter":
|
|
4240
|
-
case " ": return
|
|
4241
|
-
case "Escape": return !A &&
|
|
4286
|
+
case " ": return ve ? (e.preventDefault(), be()) : void 0;
|
|
4287
|
+
case "Escape": return !A && pe === null ? void 0 : (e.preventDefault(), ne("restore"), ye());
|
|
4242
4288
|
default: return;
|
|
4243
4289
|
}
|
|
4244
|
-
},
|
|
4290
|
+
}, we = (e, t, n) => {
|
|
4245
4291
|
let r = document.elementFromPoint(e, t);
|
|
4246
4292
|
if (r && r.hasAttribute("data-index")) {
|
|
4247
4293
|
let e = parseInt(r.getAttribute("data-index"), 10);
|
|
4248
4294
|
n.add(e);
|
|
4249
4295
|
}
|
|
4250
|
-
},
|
|
4296
|
+
}, Te = (e) => {
|
|
4251
4297
|
if (A) {
|
|
4252
|
-
|
|
4298
|
+
ne();
|
|
4253
4299
|
return;
|
|
4254
4300
|
}
|
|
4255
4301
|
if (i === "precise" || e.button !== 0 && e.pointerType === "mouse") return;
|
|
4256
4302
|
e.preventDefault(), k(!0);
|
|
4257
4303
|
let t = e.currentTarget;
|
|
4258
4304
|
t.setPointerCapture(e.pointerId);
|
|
4259
|
-
let n = t.getBoundingClientRect(), r = e.clientX - n.left, a = e.clientY - n.top, o = r - a *
|
|
4305
|
+
let n = t.getBoundingClientRect(), r = e.clientX - n.left, a = e.clientY - n.top, o = r - a * Tr, s = {
|
|
4260
4306
|
id: Date.now().toString(),
|
|
4261
4307
|
points: [{
|
|
4262
4308
|
x: o,
|
|
@@ -4264,14 +4310,14 @@ function Ar({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
|
|
|
4264
4310
|
}],
|
|
4265
4311
|
highlightedIndices: /* @__PURE__ */ new Set()
|
|
4266
4312
|
};
|
|
4267
|
-
D(s),
|
|
4268
|
-
},
|
|
4313
|
+
D(s), ne(), we(e.clientX, e.clientY, s.highlightedIndices);
|
|
4314
|
+
}, Ee = (e) => {
|
|
4269
4315
|
if (i === "precise" || !E) return;
|
|
4270
|
-
let t = g.current.getBoundingClientRect(), n = e.clientX - t.left, r = e.clientY - t.top, a = n - r *
|
|
4316
|
+
let t = g.current.getBoundingClientRect(), n = e.clientX - t.left, r = e.clientY - t.top, a = n - r * Tr;
|
|
4271
4317
|
D((t) => {
|
|
4272
4318
|
if (!t) return t;
|
|
4273
4319
|
let n = new Set(t.highlightedIndices);
|
|
4274
|
-
return
|
|
4320
|
+
return we(e.clientX, e.clientY, n), {
|
|
4275
4321
|
...t,
|
|
4276
4322
|
points: [...t.points, {
|
|
4277
4323
|
x: a,
|
|
@@ -4280,27 +4326,27 @@ function Ar({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
|
|
|
4280
4326
|
highlightedIndices: n
|
|
4281
4327
|
};
|
|
4282
4328
|
});
|
|
4283
|
-
},
|
|
4329
|
+
}, De = (e) => {
|
|
4284
4330
|
if (i !== "precise" && (k(!1), E)) {
|
|
4285
4331
|
if (e.currentTarget.releasePointerCapture(e.pointerId), S((e) => [...e, E]), E.highlightedIndices.size > 0) {
|
|
4286
|
-
let e =
|
|
4287
|
-
|
|
4332
|
+
let e = Dr(E.points);
|
|
4333
|
+
te({
|
|
4288
4334
|
x: e.x,
|
|
4289
4335
|
y: e.y,
|
|
4290
4336
|
pathId: E.id,
|
|
4291
4337
|
kind: "path"
|
|
4292
4338
|
});
|
|
4293
4339
|
}
|
|
4294
|
-
a && E.highlightedIndices.size > 0 && a(
|
|
4340
|
+
a && E.highlightedIndices.size > 0 && a(kr(E.highlightedIndices, z)), D(null);
|
|
4295
4341
|
}
|
|
4296
|
-
},
|
|
4342
|
+
}, Oe = (e) => {
|
|
4297
4343
|
i !== "precise" && (k(!1), E && (e.currentTarget.releasePointerCapture(e.pointerId), D(null)));
|
|
4298
|
-
},
|
|
4344
|
+
}, ke = (e) => {
|
|
4299
4345
|
let t = b.find((t) => t.id === e);
|
|
4300
|
-
return t ?
|
|
4301
|
-
},
|
|
4346
|
+
return t ? kr(t.highlightedIndices, z) : "";
|
|
4347
|
+
}, je = (e) => {
|
|
4302
4348
|
let t = A?.viaKeyboard;
|
|
4303
|
-
A?.kind === "selection" ? T((t) => t.filter((t) => t.id !== e)) : S((t) => t.filter((t) => t.id !== e)),
|
|
4349
|
+
A?.kind === "selection" ? T((t) => t.filter((t) => t.id !== e)) : S((t) => t.filter((t) => t.id !== e)), ne(t ? "container" : "none");
|
|
4304
4350
|
}, Me = () => {
|
|
4305
4351
|
let e = A?.viaKeyboard;
|
|
4306
4352
|
if (A && s) {
|
|
@@ -4315,34 +4361,36 @@ function Ar({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
|
|
|
4315
4361
|
s(e.text, c);
|
|
4316
4362
|
}
|
|
4317
4363
|
} else {
|
|
4318
|
-
let e =
|
|
4364
|
+
let e = ke(A.pathId), t = document.getElementById(`highlight-path-${A.pathId}`);
|
|
4319
4365
|
t && s(e, t.getBoundingClientRect());
|
|
4320
4366
|
}
|
|
4321
4367
|
}
|
|
4322
|
-
|
|
4368
|
+
ne(e ? "restore" : "none");
|
|
4323
4369
|
}, Ne = (e) => {
|
|
4324
|
-
let t =
|
|
4370
|
+
let t = z[e];
|
|
4371
|
+
if (!r) return t;
|
|
4372
|
+
let n = !1;
|
|
4325
4373
|
A && (n = (A.kind === "path" ? b.find((e) => e.id === A.pathId) : w.find((e) => e.id === A.pathId))?.highlightedIndices?.has(e) ?? !1);
|
|
4326
|
-
let
|
|
4327
|
-
return F && (
|
|
4374
|
+
let i = !1;
|
|
4375
|
+
return F && (i = (b.find((e) => e.id === F) ?? w.find((e) => e.id === F))?.highlightedIndices?.has(e) ?? !1), /* @__PURE__ */ _("span", {
|
|
4328
4376
|
"data-index": e,
|
|
4329
|
-
className:
|
|
4377
|
+
className: Cr.token,
|
|
4330
4378
|
"data-space": !t.trim() || void 0,
|
|
4331
4379
|
"data-active": n || void 0,
|
|
4332
|
-
"data-pressed":
|
|
4333
|
-
"data-kbd-cursor":
|
|
4334
|
-
"data-kbd-selected":
|
|
4380
|
+
"data-pressed": i || void 0,
|
|
4381
|
+
"data-kbd-cursor": pe === e || void 0,
|
|
4382
|
+
"data-kbd-selected": ve && e >= ve.from && e <= ve.to || void 0,
|
|
4335
4383
|
children: t
|
|
4336
4384
|
}, e);
|
|
4337
4385
|
}, Pe = (e) => e.map((e, t) => {
|
|
4338
4386
|
if (e.type === "token") return Ne(e.index);
|
|
4339
|
-
if (e.type === "code") return /* @__PURE__ */ _(
|
|
4387
|
+
if (e.type === "code") return /* @__PURE__ */ _(nn, {
|
|
4340
4388
|
code: e.value,
|
|
4341
4389
|
lang: e.lang
|
|
4342
4390
|
}, `c${t}`);
|
|
4343
4391
|
if (e.type === "el" && e.tag === "cite") {
|
|
4344
4392
|
let n = Number(e.props?.index ?? 0);
|
|
4345
|
-
return /* @__PURE__ */ _(
|
|
4393
|
+
return /* @__PURE__ */ _(Sr, {
|
|
4346
4394
|
index: n,
|
|
4347
4395
|
source: u?.[n - 1],
|
|
4348
4396
|
onSelect: d ? (e, t) => d(e, t) : void 0
|
|
@@ -4370,84 +4418,84 @@ function Ar({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
|
|
|
4370
4418
|
},
|
|
4371
4419
|
"data-drawing": O || void 0,
|
|
4372
4420
|
"data-menu": !!A || void 0,
|
|
4373
|
-
className:
|
|
4421
|
+
className: Cr.surface,
|
|
4374
4422
|
...r ? {
|
|
4375
|
-
onPointerDown:
|
|
4376
|
-
onPointerMove:
|
|
4377
|
-
onPointerUp:
|
|
4378
|
-
onPointerCancel:
|
|
4423
|
+
onPointerDown: Te,
|
|
4424
|
+
onPointerMove: Ee,
|
|
4425
|
+
onPointerUp: De,
|
|
4426
|
+
onPointerCancel: Oe,
|
|
4379
4427
|
tabIndex: 0,
|
|
4380
|
-
onKeyDown:
|
|
4381
|
-
onBlur:
|
|
4382
|
-
"aria-describedby":
|
|
4428
|
+
onKeyDown: V,
|
|
4429
|
+
onBlur: ye,
|
|
4430
|
+
"aria-describedby": _e
|
|
4383
4431
|
} : null,
|
|
4384
4432
|
children: [
|
|
4385
4433
|
r && /* @__PURE__ */ _("span", {
|
|
4386
|
-
id:
|
|
4387
|
-
className:
|
|
4434
|
+
id: _e,
|
|
4435
|
+
className: Cr.srOnly,
|
|
4388
4436
|
"aria-hidden": "true",
|
|
4389
4437
|
children: h.keyboardHint
|
|
4390
4438
|
}),
|
|
4391
|
-
r && /* @__PURE__ */ _("div", { className:
|
|
4439
|
+
r && /* @__PURE__ */ _("div", { className: Cr.hitbox }),
|
|
4392
4440
|
/* @__PURE__ */ _("div", {
|
|
4393
|
-
className:
|
|
4441
|
+
className: Cr.tokens,
|
|
4394
4442
|
"data-focus": !!A || void 0,
|
|
4395
|
-
children: Pe(
|
|
4443
|
+
children: Pe(re.nodes)
|
|
4396
4444
|
}),
|
|
4397
4445
|
r && /* @__PURE__ */ _("svg", {
|
|
4398
|
-
className:
|
|
4446
|
+
className: Cr.canvas,
|
|
4399
4447
|
children: /* @__PURE__ */ v("g", {
|
|
4400
|
-
transform: `skewX(${
|
|
4401
|
-
children: [
|
|
4448
|
+
transform: `skewX(${wr})`,
|
|
4449
|
+
children: [ce.map((t) => /* @__PURE__ */ v(e.Fragment, { children: [/* @__PURE__ */ _("path", {
|
|
4402
4450
|
id: `highlight-${t.kind}-${t.id}`,
|
|
4403
|
-
className:
|
|
4451
|
+
className: Cr.marker,
|
|
4404
4452
|
d: t.d,
|
|
4405
4453
|
"data-cursor": "pointer",
|
|
4406
4454
|
"data-pressed": F === t.id || void 0,
|
|
4407
|
-
"data-active": A?.pathId === t.id ||
|
|
4455
|
+
"data-active": A?.pathId === t.id || L === t.id || void 0,
|
|
4408
4456
|
"data-dimmed": A && A.pathId !== t.id || void 0,
|
|
4409
4457
|
style: { pointerEvents: O ? "none" : "stroke" },
|
|
4410
4458
|
onPointerDown: (e) => {
|
|
4411
4459
|
O || (e.stopPropagation(), I(t.id));
|
|
4412
4460
|
},
|
|
4413
4461
|
onPointerUp: (e) => {
|
|
4414
|
-
F === t.id && (e.stopPropagation(),
|
|
4462
|
+
F === t.id && (e.stopPropagation(), le(t), I(null));
|
|
4415
4463
|
},
|
|
4416
4464
|
onPointerLeave: () => I(null),
|
|
4417
4465
|
onPointerCancel: () => I(null)
|
|
4418
4466
|
}), /* @__PURE__ */ _("path", {
|
|
4419
|
-
className:
|
|
4467
|
+
className: Cr.shimmer,
|
|
4420
4468
|
d: t.d,
|
|
4421
4469
|
pathLength: 1,
|
|
4422
|
-
"data-active": A?.pathId === t.id ||
|
|
4470
|
+
"data-active": A?.pathId === t.id || L === t.id || void 0
|
|
4423
4471
|
})] }, t.id)), E && /* @__PURE__ */ _("path", {
|
|
4424
|
-
className:
|
|
4425
|
-
d:
|
|
4472
|
+
className: Cr.marker,
|
|
4473
|
+
d: Er(E.points)
|
|
4426
4474
|
})]
|
|
4427
4475
|
})
|
|
4428
4476
|
}),
|
|
4429
|
-
r &&
|
|
4477
|
+
r && ce.length > 0 && /* @__PURE__ */ _("div", {
|
|
4430
4478
|
role: "group",
|
|
4431
|
-
"aria-label":
|
|
4432
|
-
children:
|
|
4479
|
+
"aria-label": Ae(ce.length === 1 ? h.countOne : h.countMany, { count: ce.length }),
|
|
4480
|
+
children: ce.map((e) => /* @__PURE__ */ _("button", {
|
|
4433
4481
|
type: "button",
|
|
4434
|
-
className:
|
|
4482
|
+
className: Cr.srOnly,
|
|
4435
4483
|
onPointerDown: (e) => e.stopPropagation(),
|
|
4436
|
-
onFocus: () =>
|
|
4437
|
-
onBlur: () =>
|
|
4484
|
+
onFocus: () => R(e.id),
|
|
4485
|
+
onBlur: () => R(null),
|
|
4438
4486
|
onClick: (t) => {
|
|
4439
|
-
t.stopPropagation(),
|
|
4487
|
+
t.stopPropagation(), le(e, !0);
|
|
4440
4488
|
},
|
|
4441
|
-
children: `${h.highlight} ${
|
|
4489
|
+
children: `${h.highlight} ${Ar(e.text)}`
|
|
4442
4490
|
}, e.id))
|
|
4443
4491
|
}),
|
|
4444
4492
|
/* @__PURE__ */ _(y, { children: r && A && /* @__PURE__ */ v(C.div, {
|
|
4445
4493
|
ref: ee,
|
|
4446
4494
|
role: "menu",
|
|
4447
4495
|
"aria-label": h.menu,
|
|
4448
|
-
onKeyDown:
|
|
4496
|
+
onKeyDown: Ce,
|
|
4449
4497
|
onBlur: (e) => {
|
|
4450
|
-
e.currentTarget.contains(e.relatedTarget) ||
|
|
4498
|
+
e.currentTarget.contains(e.relatedTarget) || ne();
|
|
4451
4499
|
},
|
|
4452
4500
|
initial: { opacity: 0 },
|
|
4453
4501
|
animate: {
|
|
@@ -4461,7 +4509,7 @@ function Ar({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
|
|
|
4461
4509
|
staggerDirection: -1
|
|
4462
4510
|
}
|
|
4463
4511
|
},
|
|
4464
|
-
className:
|
|
4512
|
+
className: Cr.menu,
|
|
4465
4513
|
style: {
|
|
4466
4514
|
left: A.x,
|
|
4467
4515
|
top: A.y
|
|
@@ -4488,11 +4536,11 @@ function Ar({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
|
|
|
4488
4536
|
scale: .9,
|
|
4489
4537
|
transition: { duration: .1 }
|
|
4490
4538
|
},
|
|
4491
|
-
children: /* @__PURE__ */ _(
|
|
4539
|
+
children: /* @__PURE__ */ _(H, {
|
|
4492
4540
|
variant: "primary",
|
|
4493
4541
|
role: "menuitem",
|
|
4494
4542
|
tabIndex: M === 0 ? 0 : -1,
|
|
4495
|
-
icon: /* @__PURE__ */ _(
|
|
4543
|
+
icon: /* @__PURE__ */ _(ie, { size: 14 }),
|
|
4496
4544
|
onClick: (e) => {
|
|
4497
4545
|
e.stopPropagation(), Me();
|
|
4498
4546
|
},
|
|
@@ -4520,13 +4568,13 @@ function Ar({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
|
|
|
4520
4568
|
scale: .9,
|
|
4521
4569
|
transition: { duration: .1 }
|
|
4522
4570
|
},
|
|
4523
|
-
children: /* @__PURE__ */ _(
|
|
4571
|
+
children: /* @__PURE__ */ _(H, {
|
|
4524
4572
|
variant: "primary",
|
|
4525
4573
|
role: "menuitem",
|
|
4526
4574
|
tabIndex: M === 1 ? 0 : -1,
|
|
4527
|
-
icon: /* @__PURE__ */ _(
|
|
4575
|
+
icon: /* @__PURE__ */ _(xe, { size: 14 }),
|
|
4528
4576
|
onClick: (e) => {
|
|
4529
|
-
e.stopPropagation(),
|
|
4577
|
+
e.stopPropagation(), je(A.pathId);
|
|
4530
4578
|
},
|
|
4531
4579
|
title: h.remove,
|
|
4532
4580
|
"aria-label": h.remove
|
|
@@ -4537,24 +4585,142 @@ function Ar({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
|
|
|
4537
4585
|
})
|
|
4538
4586
|
});
|
|
4539
4587
|
}
|
|
4540
|
-
var
|
|
4588
|
+
var Nr = {
|
|
4541
4589
|
turn: "ick-turn-R-WW",
|
|
4542
4590
|
question: "ick-question-Fhqf",
|
|
4543
4591
|
body: "ick-body-wvid",
|
|
4544
4592
|
custom: "ick-custom-s7j-",
|
|
4545
4593
|
answer: "ick-answer-pZAi",
|
|
4546
4594
|
actions: "ick-actions-CWq8"
|
|
4547
|
-
},
|
|
4595
|
+
}, Pr = (e) => {
|
|
4548
4596
|
navigator.clipboard?.writeText(e);
|
|
4549
|
-
},
|
|
4550
|
-
let
|
|
4597
|
+
}, Fr = (e, t) => {
|
|
4598
|
+
let n = t.map((t, n) => ({
|
|
4599
|
+
part: t,
|
|
4600
|
+
order: n,
|
|
4601
|
+
at: Math.min(Math.max(t.at ?? 0, 0), e.length)
|
|
4602
|
+
})).sort((e, t) => e.at - t.at || e.order - t.order), r = [], i = 0, a = (t) => {
|
|
4603
|
+
let n = e.slice(i, t);
|
|
4604
|
+
n.trim() && r.push({
|
|
4605
|
+
kind: "prose",
|
|
4606
|
+
text: n,
|
|
4607
|
+
from: i
|
|
4608
|
+
}), i = t;
|
|
4609
|
+
};
|
|
4610
|
+
for (let { part: e, at: t } of n) t > i && a(t), r.push({
|
|
4611
|
+
kind: "part",
|
|
4612
|
+
part: e
|
|
4613
|
+
});
|
|
4614
|
+
return i < e.length && a(e.length), r;
|
|
4615
|
+
}, Ir = a(function({ turn: e, isActiveInput: t = !1, inputRef: n = null, placeholder: r, animationConfig: i, foldMotion: a, openArtifactId: o = null, onOpenArtifact: s, onArtifactChange: c, entranceDelay: l = 0, selectionMode: u = "marker", highlights: d = !0, questionAlign: f = "end", onDraft: p, onSubmit: m, onStop: h, busy: g, onEdit: y, onCancelEdit: b, onCopy: x = Pr, onHighlight: S, onReplyInThread: w, onRegenerate: T, onShowVersion: E, onFeedback: D, feedback: O = null, answerActions: k = !0, onAnswerQuestion: A, onEditQuestion: j, onDecideApproval: M, renderPart: N, composerMenu: ee, labels: P, className: F, onTranscribe: I }) {
|
|
4616
|
+
let L = q(), R = L ? 0 : -16, te = e.parts ?? [], ne = te.find((e) => e.kind === "sources")?.sources, re = Fr(e.ai, te), z = k && (e.state === "resting" || e.state === "responding") && re.length > 0, ie = z && e.state === "resting", ae = z ? re[re.length - 1].kind === "prose" ? re.length - 1 : re.length : -1, oe = z ? /* @__PURE__ */ v("div", {
|
|
4617
|
+
className: Nr.actions,
|
|
4618
|
+
"data-pending": ie ? void 0 : "",
|
|
4619
|
+
style: ie ? void 0 : { visibility: "hidden" },
|
|
4620
|
+
children: [/* @__PURE__ */ _(jt, {
|
|
4621
|
+
total: e.versions?.length ?? 0,
|
|
4622
|
+
index: e.versionIndex ?? 0,
|
|
4623
|
+
onSelect: (t) => E?.(e.id, t)
|
|
4624
|
+
}), /* @__PURE__ */ _(kt, {
|
|
4625
|
+
text: e.ai,
|
|
4626
|
+
onCopy: x,
|
|
4627
|
+
onRegenerate: T ? () => T(e.id) : void 0,
|
|
4628
|
+
onFeedback: D ? (t) => D(e.id, t) : void 0,
|
|
4629
|
+
feedback: O
|
|
4630
|
+
})]
|
|
4631
|
+
}) : null, se = (t) => {
|
|
4632
|
+
switch (t.kind) {
|
|
4633
|
+
case "reasoning": return /* @__PURE__ */ _(Ht, {
|
|
4634
|
+
state: t.state,
|
|
4635
|
+
duration: t.duration,
|
|
4636
|
+
children: t.text ?? ""
|
|
4637
|
+
}, t.id);
|
|
4638
|
+
case "tool": return /* @__PURE__ */ _(ln, {
|
|
4639
|
+
name: t.name ?? "",
|
|
4640
|
+
state: t.state,
|
|
4641
|
+
summary: t.summary,
|
|
4642
|
+
input: t.input,
|
|
4643
|
+
output: t.output,
|
|
4644
|
+
error: t.error,
|
|
4645
|
+
duration: t.duration
|
|
4646
|
+
}, t.id);
|
|
4647
|
+
case "tasks": return /* @__PURE__ */ _(hn, {
|
|
4648
|
+
title: t.title,
|
|
4649
|
+
tasks: t.tasks ?? [],
|
|
4650
|
+
collapsible: t.collapsible
|
|
4651
|
+
}, t.id);
|
|
4652
|
+
case "chain": return /* @__PURE__ */ _(_n, {
|
|
4653
|
+
steps: t.steps ?? [],
|
|
4654
|
+
state: t.state,
|
|
4655
|
+
duration: t.duration
|
|
4656
|
+
}, t.id);
|
|
4657
|
+
case "sources": return /* @__PURE__ */ _(yn, {
|
|
4658
|
+
sources: t.sources ?? [],
|
|
4659
|
+
title: t.title,
|
|
4660
|
+
collapsible: t.collapsible
|
|
4661
|
+
}, t.id);
|
|
4662
|
+
case "approval": return /* @__PURE__ */ _(pn, {
|
|
4663
|
+
title: t.title,
|
|
4664
|
+
description: t.description,
|
|
4665
|
+
decision: t.decision ?? null,
|
|
4666
|
+
choices: t.choices,
|
|
4667
|
+
onDecide: (n) => M?.(e.id, t.id, n),
|
|
4668
|
+
children: t.tool && /* @__PURE__ */ _(ln, {
|
|
4669
|
+
name: t.tool.name,
|
|
4670
|
+
state: "pending",
|
|
4671
|
+
input: t.tool.input,
|
|
4672
|
+
defaultOpen: !0
|
|
4673
|
+
})
|
|
4674
|
+
}, t.id);
|
|
4675
|
+
case "artifact": return /* @__PURE__ */ _(Wn, {
|
|
4676
|
+
id: t.id,
|
|
4677
|
+
title: t.title,
|
|
4678
|
+
meta: t.meta,
|
|
4679
|
+
kind: t.preview,
|
|
4680
|
+
lang: t.lang,
|
|
4681
|
+
content: t.content,
|
|
4682
|
+
state: t.state,
|
|
4683
|
+
open: o === t.id,
|
|
4684
|
+
onOpen: s ? (t) => s(e.id, t) : void 0
|
|
4685
|
+
}, t.id);
|
|
4686
|
+
case "notice": return /* @__PURE__ */ _(Bn, {
|
|
4687
|
+
tone: t.tone,
|
|
4688
|
+
children: t.text
|
|
4689
|
+
}, t.id);
|
|
4690
|
+
case "question": return /* @__PURE__ */ _(Rn, {
|
|
4691
|
+
id: t.id,
|
|
4692
|
+
title: t.title,
|
|
4693
|
+
questions: t.questions ?? [],
|
|
4694
|
+
answers: t.answers ?? {},
|
|
4695
|
+
activeIndex: t.activeIndex,
|
|
4696
|
+
collapsible: t.collapsible,
|
|
4697
|
+
readOnly: t.readOnly,
|
|
4698
|
+
foldMotion: a,
|
|
4699
|
+
onCommit: (n, r) => A?.(e.id, t.id, n, r),
|
|
4700
|
+
onEdit: (n) => j?.(e.id, t.id, n)
|
|
4701
|
+
}, t.id);
|
|
4702
|
+
case "custom": {
|
|
4703
|
+
let n = N?.(t, {
|
|
4704
|
+
turnId: e.id,
|
|
4705
|
+
openArtifact: (t) => c ? c(t) : s?.(e.id, t),
|
|
4706
|
+
closeArtifact: () => c?.(null)
|
|
4707
|
+
});
|
|
4708
|
+
return n == null || n === !1 ? null : /* @__PURE__ */ _("div", {
|
|
4709
|
+
className: Nr.custom,
|
|
4710
|
+
"data-part": "custom",
|
|
4711
|
+
"data-part-type": t.type,
|
|
4712
|
+
children: n
|
|
4713
|
+
}, t.id);
|
|
4714
|
+
}
|
|
4715
|
+
}
|
|
4716
|
+
}, ce = /* @__PURE__ */ v(C.article, {
|
|
4551
4717
|
id: `turn-${e.id}`,
|
|
4552
|
-
className: [
|
|
4718
|
+
className: [Nr.turn, F ?? ""].filter(Boolean).join(" "),
|
|
4553
4719
|
"data-active-input": t || void 0,
|
|
4554
4720
|
"aria-busy": e.state === "responding" || void 0,
|
|
4555
4721
|
initial: {
|
|
4556
4722
|
opacity: 0,
|
|
4557
|
-
y:
|
|
4723
|
+
y: R
|
|
4558
4724
|
},
|
|
4559
4725
|
animate: {
|
|
4560
4726
|
opacity: 1,
|
|
@@ -4562,10 +4728,10 @@ var jr = {
|
|
|
4562
4728
|
},
|
|
4563
4729
|
exit: {
|
|
4564
4730
|
opacity: 0,
|
|
4565
|
-
y:
|
|
4731
|
+
y: R
|
|
4566
4732
|
},
|
|
4567
4733
|
transition: {
|
|
4568
|
-
duration:
|
|
4734
|
+
duration: L ? .15 : .4,
|
|
4569
4735
|
ease: [
|
|
4570
4736
|
.22,
|
|
4571
4737
|
1,
|
|
@@ -4575,9 +4741,9 @@ var jr = {
|
|
|
4575
4741
|
delay: l
|
|
4576
4742
|
},
|
|
4577
4743
|
children: [/* @__PURE__ */ _("div", {
|
|
4578
|
-
className:
|
|
4744
|
+
className: Nr.question,
|
|
4579
4745
|
"data-align": f,
|
|
4580
|
-
children: /* @__PURE__ */ _(
|
|
4746
|
+
children: /* @__PURE__ */ _(st, {
|
|
4581
4747
|
ref: n,
|
|
4582
4748
|
style: f === "stretch" ? { width: "100%" } : void 0,
|
|
4583
4749
|
state: e.state,
|
|
@@ -4597,129 +4763,35 @@ var jr = {
|
|
|
4597
4763
|
menu: ee
|
|
4598
4764
|
})
|
|
4599
4765
|
}), /* @__PURE__ */ v("div", {
|
|
4600
|
-
className:
|
|
4766
|
+
className: Nr.body,
|
|
4601
4767
|
children: [
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
|
|
4605
|
-
|
|
4606
|
-
duration: t.duration,
|
|
4607
|
-
children: t.text ?? ""
|
|
4608
|
-
}, t.id);
|
|
4609
|
-
case "tool": return /* @__PURE__ */ _(cn, {
|
|
4610
|
-
name: t.name ?? "",
|
|
4611
|
-
state: t.state,
|
|
4612
|
-
summary: t.summary,
|
|
4613
|
-
input: t.input,
|
|
4614
|
-
output: t.output,
|
|
4615
|
-
error: t.error,
|
|
4616
|
-
duration: t.duration
|
|
4617
|
-
}, t.id);
|
|
4618
|
-
case "tasks": return /* @__PURE__ */ _(mn, {
|
|
4619
|
-
title: t.title,
|
|
4620
|
-
tasks: t.tasks ?? [],
|
|
4621
|
-
collapsible: t.collapsible
|
|
4622
|
-
}, t.id);
|
|
4623
|
-
case "chain": return /* @__PURE__ */ _(gn, {
|
|
4624
|
-
steps: t.steps ?? [],
|
|
4625
|
-
state: t.state,
|
|
4626
|
-
duration: t.duration
|
|
4627
|
-
}, t.id);
|
|
4628
|
-
case "sources": return /* @__PURE__ */ _(vn, {
|
|
4629
|
-
sources: t.sources ?? [],
|
|
4630
|
-
title: t.title,
|
|
4631
|
-
collapsible: t.collapsible
|
|
4632
|
-
}, t.id);
|
|
4633
|
-
case "approval": return /* @__PURE__ */ _(fn, {
|
|
4634
|
-
title: t.title,
|
|
4635
|
-
description: t.description,
|
|
4636
|
-
decision: t.decision ?? null,
|
|
4637
|
-
choices: t.choices,
|
|
4638
|
-
onDecide: (n) => M?.(e.id, t.id, n),
|
|
4639
|
-
children: t.tool && /* @__PURE__ */ _(cn, {
|
|
4640
|
-
name: t.tool.name,
|
|
4641
|
-
state: "pending",
|
|
4642
|
-
input: t.tool.input,
|
|
4643
|
-
defaultOpen: !0
|
|
4644
|
-
})
|
|
4645
|
-
}, t.id);
|
|
4646
|
-
case "artifact": return /* @__PURE__ */ _(Un, {
|
|
4647
|
-
id: t.id,
|
|
4648
|
-
title: t.title,
|
|
4649
|
-
meta: t.meta,
|
|
4650
|
-
kind: t.preview,
|
|
4651
|
-
lang: t.lang,
|
|
4652
|
-
content: t.content,
|
|
4653
|
-
state: t.state,
|
|
4654
|
-
open: o === t.id,
|
|
4655
|
-
onOpen: s ? (t) => s(e.id, t) : void 0
|
|
4656
|
-
}, t.id);
|
|
4657
|
-
case "notice": return /* @__PURE__ */ _(zn, {
|
|
4658
|
-
tone: t.tone,
|
|
4659
|
-
children: t.text
|
|
4660
|
-
}, t.id);
|
|
4661
|
-
case "question": return /* @__PURE__ */ _(Ln, {
|
|
4662
|
-
id: t.id,
|
|
4663
|
-
title: t.title,
|
|
4664
|
-
questions: t.questions ?? [],
|
|
4665
|
-
answers: t.answers ?? {},
|
|
4666
|
-
activeIndex: t.activeIndex,
|
|
4667
|
-
collapsible: t.collapsible,
|
|
4668
|
-
readOnly: t.readOnly,
|
|
4669
|
-
foldMotion: a,
|
|
4670
|
-
onCommit: (n, r) => A?.(e.id, t.id, n, r),
|
|
4671
|
-
onEdit: (n) => j?.(e.id, t.id, n)
|
|
4672
|
-
}, t.id);
|
|
4673
|
-
case "custom": {
|
|
4674
|
-
let n = N?.(t, {
|
|
4675
|
-
turnId: e.id,
|
|
4676
|
-
openArtifact: (t) => c ? c(t) : s?.(e.id, t),
|
|
4677
|
-
closeArtifact: () => c?.(null)
|
|
4678
|
-
});
|
|
4679
|
-
return n == null || n === !1 ? null : /* @__PURE__ */ _("div", {
|
|
4680
|
-
className: jr.custom,
|
|
4681
|
-
"data-part": "custom",
|
|
4682
|
-
"data-part-type": t.type,
|
|
4683
|
-
children: n
|
|
4684
|
-
}, t.id);
|
|
4685
|
-
}
|
|
4686
|
-
}
|
|
4687
|
-
}),
|
|
4688
|
-
e.state === "responding" && !e.ai && ne.length === 0 && /* @__PURE__ */ _("div", {
|
|
4689
|
-
className: jr.answer,
|
|
4690
|
-
children: /* @__PURE__ */ _(Mt, {})
|
|
4691
|
-
}),
|
|
4692
|
-
e.ai && /* @__PURE__ */ v("div", {
|
|
4693
|
-
className: jr.answer,
|
|
4694
|
-
children: [/* @__PURE__ */ _(Ar, {
|
|
4695
|
-
text: e.ai,
|
|
4768
|
+
re.map((t, n) => t.kind === "part" ? se(t.part) : /* @__PURE__ */ v("div", {
|
|
4769
|
+
className: Nr.answer,
|
|
4770
|
+
children: [/* @__PURE__ */ _(Mr, {
|
|
4771
|
+
text: t.text,
|
|
4696
4772
|
marking: d,
|
|
4697
4773
|
selectionMode: u,
|
|
4698
|
-
sources:
|
|
4774
|
+
sources: ne,
|
|
4699
4775
|
onHighlightComplete: d ? (t) => S?.(e.id, t) : void 0,
|
|
4700
4776
|
onReplyInThread: d ? w : void 0
|
|
4701
|
-
}),
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
|
|
4705
|
-
|
|
4706
|
-
|
|
4707
|
-
|
|
4708
|
-
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
onFeedback: D ? (t) => D(e.id, t) : void 0,
|
|
4712
|
-
feedback: O
|
|
4713
|
-
})]
|
|
4714
|
-
})]
|
|
4777
|
+
}), ae === n && oe]
|
|
4778
|
+
}, `prose-${t.from}`)),
|
|
4779
|
+
e.state === "responding" && !e.ai && te.length === 0 && /* @__PURE__ */ _("div", {
|
|
4780
|
+
className: Nr.answer,
|
|
4781
|
+
children: /* @__PURE__ */ _(Nt, {})
|
|
4782
|
+
}),
|
|
4783
|
+
ae === re.length && /* @__PURE__ */ _("div", {
|
|
4784
|
+
className: Nr.answer,
|
|
4785
|
+
"data-actions-only": "",
|
|
4786
|
+
children: oe
|
|
4715
4787
|
})
|
|
4716
4788
|
]
|
|
4717
4789
|
})]
|
|
4718
4790
|
});
|
|
4719
|
-
return P ? /* @__PURE__ */ _(
|
|
4791
|
+
return P ? /* @__PURE__ */ _(ke, {
|
|
4720
4792
|
labels: P,
|
|
4721
|
-
children:
|
|
4722
|
-
}) :
|
|
4793
|
+
children: ce
|
|
4794
|
+
}) : ce;
|
|
4723
4795
|
}, (e, t) => {
|
|
4724
4796
|
let n = /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)]);
|
|
4725
4797
|
for (let r of n) {
|
|
@@ -4731,7 +4803,7 @@ var jr = {
|
|
|
4731
4803
|
if (!Object.is(e[r], t[r])) return !1;
|
|
4732
4804
|
}
|
|
4733
4805
|
return !0;
|
|
4734
|
-
}),
|
|
4806
|
+
}), Lr = {
|
|
4735
4807
|
context: "ick-context-ZOiv",
|
|
4736
4808
|
ring: "ick-ring-uVUc",
|
|
4737
4809
|
track: "ick-track---kg",
|
|
@@ -4740,7 +4812,7 @@ var jr = {
|
|
|
4740
4812
|
};
|
|
4741
4813
|
//#endregion
|
|
4742
4814
|
//#region src/Context/Context.tsx
|
|
4743
|
-
function
|
|
4815
|
+
function Rr(e) {
|
|
4744
4816
|
if (!Number.isFinite(e) || e < 0) return "";
|
|
4745
4817
|
if (e >= 1e6) {
|
|
4746
4818
|
let t = e / 1e6;
|
|
@@ -4752,11 +4824,11 @@ function Fr(e) {
|
|
|
4752
4824
|
}
|
|
4753
4825
|
return String(Math.round(e));
|
|
4754
4826
|
}
|
|
4755
|
-
var
|
|
4756
|
-
function
|
|
4757
|
-
let s =
|
|
4827
|
+
var zr = 6, Br = 2 * Math.PI * zr;
|
|
4828
|
+
function Vr({ used: e, total: t, warnAt: n = .8, label: r, labels: i, className: a, ...o }) {
|
|
4829
|
+
let s = U("context", i), c = t > 0 ? Math.min(1, Math.max(0, e / t)) : 0, l = Math.round(c * 100), u = c >= n, d = r === !1 ? null : r ?? `${l}%`, f = `${s.name}: ${l}%, ${Rr(e)} ${s.of} ${Rr(t)} ${s.tokens}${u ? `. ${s.nearlyFull}` : ""}`;
|
|
4758
4830
|
return /* @__PURE__ */ v("div", {
|
|
4759
|
-
className: [
|
|
4831
|
+
className: [Lr.context, a ?? ""].filter(Boolean).join(" "),
|
|
4760
4832
|
"data-warn": u || void 0,
|
|
4761
4833
|
role: "meter",
|
|
4762
4834
|
"aria-valuenow": l,
|
|
@@ -4766,31 +4838,31 @@ function Rr({ used: e, total: t, warnAt: n = .8, label: r, labels: i, className:
|
|
|
4766
4838
|
title: f,
|
|
4767
4839
|
...o,
|
|
4768
4840
|
children: [/* @__PURE__ */ v("svg", {
|
|
4769
|
-
className:
|
|
4841
|
+
className: Lr.ring,
|
|
4770
4842
|
viewBox: "0 0 16 16",
|
|
4771
4843
|
"aria-hidden": !0,
|
|
4772
4844
|
focusable: "false",
|
|
4773
4845
|
children: [/* @__PURE__ */ _("circle", {
|
|
4774
|
-
className:
|
|
4846
|
+
className: Lr.track,
|
|
4775
4847
|
cx: "8",
|
|
4776
4848
|
cy: "8",
|
|
4777
|
-
r:
|
|
4849
|
+
r: zr
|
|
4778
4850
|
}), /* @__PURE__ */ _("circle", {
|
|
4779
|
-
className:
|
|
4851
|
+
className: Lr.fill,
|
|
4780
4852
|
cx: "8",
|
|
4781
4853
|
cy: "8",
|
|
4782
|
-
r:
|
|
4783
|
-
strokeDasharray:
|
|
4784
|
-
strokeDashoffset:
|
|
4854
|
+
r: zr,
|
|
4855
|
+
strokeDasharray: Br,
|
|
4856
|
+
strokeDashoffset: Br * (1 - c),
|
|
4785
4857
|
transform: "rotate(-90 8 8)"
|
|
4786
4858
|
})]
|
|
4787
4859
|
}), d !== null && /* @__PURE__ */ _("span", {
|
|
4788
|
-
className:
|
|
4860
|
+
className: Lr.label,
|
|
4789
4861
|
children: d
|
|
4790
4862
|
})]
|
|
4791
4863
|
});
|
|
4792
4864
|
}
|
|
4793
|
-
var
|
|
4865
|
+
var Hr = {
|
|
4794
4866
|
pane: "ick-pane-Yv8Y",
|
|
4795
4867
|
grabber: "ick-grabber-OhMd",
|
|
4796
4868
|
head: "ick-head-p2-j",
|
|
@@ -4804,8 +4876,8 @@ var zr = {
|
|
|
4804
4876
|
};
|
|
4805
4877
|
//#endregion
|
|
4806
4878
|
//#region src/Artifact/ArtifactPane.tsx
|
|
4807
|
-
function
|
|
4808
|
-
let h =
|
|
4879
|
+
function Ur({ title: e, meta: t, children: n, onClose: r, modal: i = !1, expanded: a = !1, onToggleExpanded: o, closeLabel: s, expandLabel: u, collapseLabel: d, className: f, ...m }) {
|
|
4880
|
+
let h = U("pane"), g = s ?? h.close, y = u ?? h.expand, b = d ?? h.collapse, x = l(), S = p(null), C = p(null);
|
|
4809
4881
|
return c(() => {
|
|
4810
4882
|
C.current?.focus({ preventScroll: !0 });
|
|
4811
4883
|
}, []), c(() => {
|
|
@@ -4823,36 +4895,36 @@ function Br({ title: e, meta: t, children: n, onClose: r, modal: i = !1, expande
|
|
|
4823
4895
|
return document.addEventListener("focusin", e), () => document.removeEventListener("focusin", e);
|
|
4824
4896
|
}, [i]), /* @__PURE__ */ v("div", {
|
|
4825
4897
|
ref: S,
|
|
4826
|
-
className: [
|
|
4898
|
+
className: [Hr.pane, f ?? ""].filter(Boolean).join(" "),
|
|
4827
4899
|
"aria-labelledby": x,
|
|
4828
4900
|
"aria-modal": i || void 0,
|
|
4829
4901
|
role: i ? "dialog" : "complementary",
|
|
4830
4902
|
...m,
|
|
4831
4903
|
children: [
|
|
4832
4904
|
i && /* @__PURE__ */ _("span", {
|
|
4833
|
-
className:
|
|
4905
|
+
className: Hr.grabber,
|
|
4834
4906
|
"aria-hidden": !0
|
|
4835
4907
|
}),
|
|
4836
4908
|
/* @__PURE__ */ v("div", {
|
|
4837
|
-
className:
|
|
4909
|
+
className: Hr.head,
|
|
4838
4910
|
children: [
|
|
4839
4911
|
/* @__PURE__ */ v("div", {
|
|
4840
|
-
className:
|
|
4912
|
+
className: Hr.headText,
|
|
4841
4913
|
children: [/* @__PURE__ */ _("h2", {
|
|
4842
|
-
className:
|
|
4914
|
+
className: Hr.title,
|
|
4843
4915
|
id: x,
|
|
4844
4916
|
ref: C,
|
|
4845
4917
|
tabIndex: -1,
|
|
4846
4918
|
children: e
|
|
4847
4919
|
}), t && /* @__PURE__ */ _("p", {
|
|
4848
|
-
className:
|
|
4920
|
+
className: Hr.meta,
|
|
4849
4921
|
children: t
|
|
4850
4922
|
})]
|
|
4851
4923
|
}),
|
|
4852
|
-
o && !i && /* @__PURE__ */ _(
|
|
4924
|
+
o && !i && /* @__PURE__ */ _(H, {
|
|
4853
4925
|
variant: "ghost",
|
|
4854
4926
|
size: "s",
|
|
4855
|
-
icon: _(a ?
|
|
4927
|
+
icon: _(a ? oe : z, {
|
|
4856
4928
|
size: 15,
|
|
4857
4929
|
"aria-hidden": !0
|
|
4858
4930
|
}),
|
|
@@ -4860,10 +4932,10 @@ function Br({ title: e, meta: t, children: n, onClose: r, modal: i = !1, expande
|
|
|
4860
4932
|
"aria-pressed": a,
|
|
4861
4933
|
onClick: o
|
|
4862
4934
|
}),
|
|
4863
|
-
r && /* @__PURE__ */ _(
|
|
4935
|
+
r && /* @__PURE__ */ _(H, {
|
|
4864
4936
|
variant: "ghost",
|
|
4865
4937
|
size: "s",
|
|
4866
|
-
icon: /* @__PURE__ */ _(
|
|
4938
|
+
icon: /* @__PURE__ */ _(Ce, {
|
|
4867
4939
|
size: 15,
|
|
4868
4940
|
"aria-hidden": !0
|
|
4869
4941
|
}),
|
|
@@ -4873,15 +4945,15 @@ function Br({ title: e, meta: t, children: n, onClose: r, modal: i = !1, expande
|
|
|
4873
4945
|
]
|
|
4874
4946
|
}),
|
|
4875
4947
|
/* @__PURE__ */ _("div", {
|
|
4876
|
-
className:
|
|
4877
|
-
children: n ?? /* @__PURE__ */ _(
|
|
4948
|
+
className: Hr.body,
|
|
4949
|
+
children: n ?? /* @__PURE__ */ _(Wr, {})
|
|
4878
4950
|
})
|
|
4879
4951
|
]
|
|
4880
4952
|
});
|
|
4881
4953
|
}
|
|
4882
|
-
function
|
|
4954
|
+
function Wr() {
|
|
4883
4955
|
return /* @__PURE__ */ _("div", {
|
|
4884
|
-
className:
|
|
4956
|
+
className: Hr.skeleton,
|
|
4885
4957
|
"aria-hidden": !0,
|
|
4886
4958
|
children: [
|
|
4887
4959
|
68,
|
|
@@ -4892,18 +4964,18 @@ function Vr() {
|
|
|
4892
4964
|
100,
|
|
4893
4965
|
84
|
|
4894
4966
|
].map((e, t) => /* @__PURE__ */ _("span", {
|
|
4895
|
-
className:
|
|
4967
|
+
className: Hr.line,
|
|
4896
4968
|
style: { width: `${e}%` }
|
|
4897
4969
|
}, t))
|
|
4898
4970
|
});
|
|
4899
4971
|
}
|
|
4900
|
-
var
|
|
4972
|
+
var Gr = {
|
|
4901
4973
|
layout: "ick-layout-nC6G",
|
|
4902
4974
|
chat: "ick-chat-OTXm",
|
|
4903
4975
|
card: "ick-card-Iddg",
|
|
4904
4976
|
slot: "ick-slot-O--R",
|
|
4905
4977
|
scrim: "ick-scrim-11Pp"
|
|
4906
|
-
},
|
|
4978
|
+
}, Kr = 760, qr = {
|
|
4907
4979
|
closed: {
|
|
4908
4980
|
width: 0,
|
|
4909
4981
|
transition: {
|
|
@@ -4921,7 +4993,7 @@ var Hr = {
|
|
|
4921
4993
|
bounce: 0
|
|
4922
4994
|
}
|
|
4923
4995
|
}
|
|
4924
|
-
},
|
|
4996
|
+
}, Jr = {
|
|
4925
4997
|
closed: {
|
|
4926
4998
|
opacity: 0,
|
|
4927
4999
|
x: 24,
|
|
@@ -4940,7 +5012,7 @@ var Hr = {
|
|
|
4940
5012
|
delay: .06
|
|
4941
5013
|
}
|
|
4942
5014
|
}
|
|
4943
|
-
},
|
|
5015
|
+
}, Yr = {
|
|
4944
5016
|
closed: {
|
|
4945
5017
|
y: "100%",
|
|
4946
5018
|
transition: {
|
|
@@ -4957,7 +5029,7 @@ var Hr = {
|
|
|
4957
5029
|
bounce: .18
|
|
4958
5030
|
}
|
|
4959
5031
|
}
|
|
4960
|
-
},
|
|
5032
|
+
}, Xr = {
|
|
4961
5033
|
closed: {
|
|
4962
5034
|
opacity: 0,
|
|
4963
5035
|
transition: { duration: .18 }
|
|
@@ -4966,34 +5038,34 @@ var Hr = {
|
|
|
4966
5038
|
opacity: 1,
|
|
4967
5039
|
transition: { duration: .26 }
|
|
4968
5040
|
}
|
|
4969
|
-
},
|
|
5041
|
+
}, Zr = { transition: { duration: 0 } }, Qr = (e) => ({
|
|
4970
5042
|
closed: {
|
|
4971
5043
|
...e.closed,
|
|
4972
|
-
...
|
|
5044
|
+
...Zr
|
|
4973
5045
|
},
|
|
4974
5046
|
open: {
|
|
4975
5047
|
...e.open,
|
|
4976
|
-
...
|
|
5048
|
+
...Zr
|
|
4977
5049
|
}
|
|
4978
5050
|
});
|
|
4979
|
-
function
|
|
5051
|
+
function $r({ children: e, pane: t, onDismiss: n, surface: r = "flush", className: i, ...a }) {
|
|
4980
5052
|
let s = p(null), [l, u] = m(!1), [d, h] = m(!1), g = o(() => h((e) => !e), []), b = E(), [x, S, w] = f(() => {
|
|
4981
|
-
let e = l ?
|
|
5053
|
+
let e = l ? Yr : qr, t = l ? void 0 : Jr;
|
|
4982
5054
|
return b ? [
|
|
4983
|
-
|
|
4984
|
-
t &&
|
|
4985
|
-
|
|
5055
|
+
Qr(e),
|
|
5056
|
+
t && Qr(t),
|
|
5057
|
+
Qr(Xr)
|
|
4986
5058
|
] : [
|
|
4987
5059
|
e,
|
|
4988
5060
|
t,
|
|
4989
|
-
|
|
5061
|
+
Xr
|
|
4990
5062
|
];
|
|
4991
5063
|
}, [b, l]);
|
|
4992
5064
|
c(() => {
|
|
4993
5065
|
let e = s.current;
|
|
4994
5066
|
if (!e || typeof ResizeObserver > "u") return;
|
|
4995
5067
|
let t = new ResizeObserver(([e]) => {
|
|
4996
|
-
u(e.contentRect.width <=
|
|
5068
|
+
u(e.contentRect.width <= Kr);
|
|
4997
5069
|
});
|
|
4998
5070
|
return t.observe(e), () => t.disconnect();
|
|
4999
5071
|
}, []);
|
|
@@ -5004,17 +5076,17 @@ function Xr({ children: e, pane: t, onDismiss: n, surface: r = "flush", classNam
|
|
|
5004
5076
|
});
|
|
5005
5077
|
return /* @__PURE__ */ v("div", {
|
|
5006
5078
|
ref: s,
|
|
5007
|
-
className: [
|
|
5079
|
+
className: [Gr.layout, i ?? ""].filter(Boolean).join(" "),
|
|
5008
5080
|
"data-pane": T ? "" : void 0,
|
|
5009
5081
|
"data-surface": r === "panes" ? "panes" : void 0,
|
|
5010
5082
|
...a,
|
|
5011
5083
|
children: [/* @__PURE__ */ _("div", {
|
|
5012
|
-
className:
|
|
5084
|
+
className: Gr.chat,
|
|
5013
5085
|
children: e
|
|
5014
5086
|
}), /* @__PURE__ */ v(y, {
|
|
5015
5087
|
initial: !1,
|
|
5016
5088
|
children: [T && l && n && /* @__PURE__ */ _(C.div, {
|
|
5017
|
-
className:
|
|
5089
|
+
className: Gr.scrim,
|
|
5018
5090
|
variants: w,
|
|
5019
5091
|
initial: "closed",
|
|
5020
5092
|
animate: "open",
|
|
@@ -5022,13 +5094,13 @@ function Xr({ children: e, pane: t, onDismiss: n, surface: r = "flush", classNam
|
|
|
5022
5094
|
"aria-hidden": !0,
|
|
5023
5095
|
onClick: n
|
|
5024
5096
|
}, "scrim"), T && /* @__PURE__ */ _(C.div, {
|
|
5025
|
-
className:
|
|
5097
|
+
className: Gr.slot,
|
|
5026
5098
|
variants: x,
|
|
5027
5099
|
initial: "closed",
|
|
5028
5100
|
animate: "open",
|
|
5029
5101
|
exit: "closed",
|
|
5030
5102
|
children: /* @__PURE__ */ _(C.div, {
|
|
5031
|
-
className:
|
|
5103
|
+
className: Gr.card,
|
|
5032
5104
|
"data-expanded": d && !l || void 0,
|
|
5033
5105
|
variants: S,
|
|
5034
5106
|
...l && n ? {
|
|
@@ -5054,7 +5126,7 @@ function Xr({ children: e, pane: t, onDismiss: n, surface: r = "flush", classNam
|
|
|
5054
5126
|
}
|
|
5055
5127
|
//#endregion
|
|
5056
5128
|
//#region src/Artifact/useArtifacts.ts
|
|
5057
|
-
function
|
|
5129
|
+
function ei(e = null) {
|
|
5058
5130
|
let [t, n] = m(e);
|
|
5059
5131
|
return {
|
|
5060
5132
|
openId: t,
|
|
@@ -5063,15 +5135,15 @@ function Zr(e = null) {
|
|
|
5063
5135
|
toggle: o((e) => n((t) => t === e ? null : e), [])
|
|
5064
5136
|
};
|
|
5065
5137
|
}
|
|
5066
|
-
var
|
|
5138
|
+
var ti = {
|
|
5067
5139
|
root: "ick-root-JrOP",
|
|
5068
5140
|
viewport: "ick-viewport-C3hz",
|
|
5069
5141
|
content: "ick-content-33lN",
|
|
5070
5142
|
jump: "ick-jump-nd6O"
|
|
5071
|
-
},
|
|
5143
|
+
}, ni = 64, ri = 500, ii = .2, ai = 120, oi = 50, si = 4, ci = (e, t) => e.offsetTop - t.offsetTop, li = (e, t) => t ? e.querySelector(`[id="${CSS.escape(t)}"]`) : null, ui = (e) => (e.lastElementChild?.offsetHeight ?? 0) + (parseFloat(getComputedStyle(e).rowGap) || 0), di = (e, t, n) => {
|
|
5072
5144
|
n !== t.current && (t.current = n, e.style.setProperty("--ick-conversation-tail", `${Math.round(n)}px`));
|
|
5073
|
-
},
|
|
5074
|
-
let C =
|
|
5145
|
+
}, fi = r(function({ children: e, anchorId: t, anchorOffset: n = 0, endOffset: r = 0, tail: i = "auto", threshold: a = ni, scrollButton: s = !0, scrollButtonLabel: l, follow: f = !0, dock: h = !1, className: g, viewportClassName: y, onScroll: b, ...x }, S) {
|
|
5146
|
+
let C = U("conversation").jump, w = l ?? C, T = p(null);
|
|
5075
5147
|
u(S, () => T.current, []);
|
|
5076
5148
|
let E = p(null), O = p(null), [k, A] = m(!0);
|
|
5077
5149
|
c(() => {
|
|
@@ -5086,98 +5158,140 @@ var Qr = {
|
|
|
5086
5158
|
r.disconnect(), t.style.removeProperty("--ick-dock-height");
|
|
5087
5159
|
};
|
|
5088
5160
|
}, [h]);
|
|
5089
|
-
let j = p(-1), M = p(
|
|
5161
|
+
let j = p(-1), M = p(-1), N = p(null), ee = p(!1), P = o(() => {
|
|
5090
5162
|
let e = T.current, t = E.current;
|
|
5091
5163
|
if (!e || !t) return 0;
|
|
5092
|
-
if (i === "auto" &&
|
|
5093
|
-
let n = h ? null : t.lastElementChild, a = n ?
|
|
5164
|
+
if (i === "auto" && ee.current) return Math.max(0, e.scrollHeight - e.clientHeight);
|
|
5165
|
+
let n = h ? null : t.lastElementChild, a = n ? ci(n, e) + n.offsetHeight : ci(t, e) + t.offsetHeight - (h ? 0 : j.current);
|
|
5094
5166
|
return Math.max(0, a + r - e.clientHeight);
|
|
5095
5167
|
}, [
|
|
5096
5168
|
h,
|
|
5097
5169
|
r,
|
|
5098
5170
|
i
|
|
5099
|
-
]),
|
|
5171
|
+
]), F = o(() => {
|
|
5100
5172
|
let e = T.current, a = E.current;
|
|
5101
5173
|
if (!e || !a) return;
|
|
5102
|
-
if (i !== "auto") return
|
|
5103
|
-
let o = parseFloat(getComputedStyle(e).paddingBottom) || 0, s = Math.max(0, r - o), c = a.lastElementChild, l =
|
|
5104
|
-
if (
|
|
5105
|
-
|
|
5106
|
-
|
|
5174
|
+
if (i !== "auto") return di(a, j, Math.max(0, i));
|
|
5175
|
+
let o = parseFloat(getComputedStyle(e).paddingBottom) || 0, s = Math.max(0, r - o), c = a.lastElementChild, l = li(e, N.current);
|
|
5176
|
+
if (ee.current = !!c && !!l, !ee.current || !c || !l) return di(a, j, s);
|
|
5177
|
+
if (h) {
|
|
5178
|
+
let t = Math.max(0, e.clientHeight - n - o - ui(a));
|
|
5179
|
+
return t !== M.current && (M.current = t, a.style.setProperty("--ick-conversation-room", `${Math.round(t)}px`)), di(a, j, s);
|
|
5180
|
+
}
|
|
5181
|
+
let u = ci(c, e) + c.offsetHeight - ci(l, e), d = Math.max(s, e.clientHeight - n - u - o);
|
|
5182
|
+
di(a, j, t ? Math.max(d, j.current) : d);
|
|
5107
5183
|
}, [
|
|
5108
5184
|
i,
|
|
5109
5185
|
n,
|
|
5110
5186
|
r,
|
|
5111
5187
|
t,
|
|
5112
5188
|
h
|
|
5113
|
-
]),
|
|
5189
|
+
]), I = o(() => {
|
|
5114
5190
|
let e = T.current;
|
|
5115
5191
|
if (!e) return 0;
|
|
5116
5192
|
if (t) {
|
|
5117
5193
|
let r = e.querySelector(`[id="${CSS.escape(t)}"]`);
|
|
5118
5194
|
if (r) {
|
|
5119
|
-
let t = Math.max(0, e.scrollHeight - e.clientHeight), i =
|
|
5120
|
-
return Math.max(0, Math.min(Math.max(a,
|
|
5195
|
+
let t = Math.max(0, e.scrollHeight - e.clientHeight), i = ci(r, e), a = i - n, o = h && E.current ? ui(E.current) : 0, s = i + r.offsetHeight + o - e.clientHeight;
|
|
5196
|
+
return Math.max(0, Math.min(Math.max(a, s), t));
|
|
5121
5197
|
}
|
|
5122
5198
|
}
|
|
5123
|
-
return
|
|
5199
|
+
return P();
|
|
5124
5200
|
}, [
|
|
5125
5201
|
t,
|
|
5126
5202
|
n,
|
|
5127
|
-
|
|
5128
|
-
|
|
5203
|
+
P,
|
|
5204
|
+
h
|
|
5205
|
+
]), L = p(0), R = p(null), te = o((e) => {
|
|
5129
5206
|
let t = T.current;
|
|
5130
5207
|
if (!t) return;
|
|
5131
5208
|
let n = e && !q();
|
|
5132
|
-
|
|
5133
|
-
top:
|
|
5209
|
+
L.current = n ? performance.now() + ri : 0, t.scrollTo({
|
|
5210
|
+
top: I(),
|
|
5134
5211
|
behavior: n ? "smooth" : "auto"
|
|
5135
5212
|
}), A(!0);
|
|
5136
|
-
}, [
|
|
5213
|
+
}, [I]);
|
|
5137
5214
|
d(() => {
|
|
5138
|
-
t && (
|
|
5215
|
+
t && (N.current = t);
|
|
5139
5216
|
let e = T.current, n = E.current;
|
|
5140
|
-
if (
|
|
5141
|
-
let r = new ResizeObserver(
|
|
5217
|
+
if (F(), !e || !n || typeof ResizeObserver > "u") return;
|
|
5218
|
+
let r = new ResizeObserver(F);
|
|
5142
5219
|
return r.observe(n), r.observe(e), () => r.disconnect();
|
|
5143
|
-
}, [t,
|
|
5220
|
+
}, [t, F]), d(() => {
|
|
5144
5221
|
if (!f || !k && !t) return;
|
|
5145
5222
|
let e = T.current, n = E.current;
|
|
5146
5223
|
if (!e || !n || typeof ResizeObserver > "u") return;
|
|
5147
|
-
let r = () => {
|
|
5148
|
-
|
|
5149
|
-
|
|
5150
|
-
|
|
5151
|
-
|
|
5224
|
+
let r = 0, i = () => {
|
|
5225
|
+
L.current = 0;
|
|
5226
|
+
let t = I();
|
|
5227
|
+
if (Math.abs(t - e.scrollTop) > a && !q()) {
|
|
5228
|
+
L.current = performance.now() + ri, e.scrollTo({
|
|
5229
|
+
top: t,
|
|
5230
|
+
behavior: "smooth"
|
|
5231
|
+
}), r = window.setTimeout(i, 550);
|
|
5232
|
+
return;
|
|
5233
|
+
}
|
|
5234
|
+
e.scrollTop = t;
|
|
5235
|
+
}, o = () => {
|
|
5236
|
+
let n = I();
|
|
5237
|
+
if (L.current) {
|
|
5238
|
+
let t = L.current - performance.now();
|
|
5239
|
+
if (t > 0 && Math.abs(e.scrollTop - n) > 1) {
|
|
5240
|
+
window.clearTimeout(r), r = window.setTimeout(i, t + oi);
|
|
5241
|
+
return;
|
|
5242
|
+
}
|
|
5243
|
+
L.current = 0;
|
|
5244
|
+
}
|
|
5245
|
+
let o = n - e.scrollTop;
|
|
5246
|
+
if (N.current && !t && !q() && h) {
|
|
5247
|
+
!s && Math.abs(o) > si && (window.clearTimeout(c), c = window.setTimeout(l, ai));
|
|
5248
|
+
return;
|
|
5152
5249
|
}
|
|
5153
|
-
|
|
5154
|
-
|
|
5155
|
-
I.current = performance.now() + ei, e.scrollTo({
|
|
5250
|
+
if (N.current && !t && Math.abs(o) > a && !q()) {
|
|
5251
|
+
L.current = performance.now() + ri, e.scrollTo({
|
|
5156
5252
|
top: n,
|
|
5157
5253
|
behavior: "smooth"
|
|
5158
5254
|
});
|
|
5159
5255
|
return;
|
|
5160
5256
|
}
|
|
5161
5257
|
e.scrollTop = n;
|
|
5162
|
-
},
|
|
5163
|
-
|
|
5164
|
-
|
|
5258
|
+
}, s = 0, c = 0, l = () => {
|
|
5259
|
+
if (s) return;
|
|
5260
|
+
if (typeof requestAnimationFrame > "u") {
|
|
5261
|
+
e.scrollTop = I();
|
|
5262
|
+
return;
|
|
5263
|
+
}
|
|
5264
|
+
let t = () => {
|
|
5265
|
+
let n = I(), r = n - e.scrollTop;
|
|
5266
|
+
if (Math.abs(r) <= 1) {
|
|
5267
|
+
e.scrollTop = n, s = 0;
|
|
5268
|
+
return;
|
|
5269
|
+
}
|
|
5270
|
+
e.scrollTop += Math.sign(r) * Math.max(1, Math.abs(r) * ii), s = requestAnimationFrame(t);
|
|
5271
|
+
};
|
|
5272
|
+
s = requestAnimationFrame(t);
|
|
5273
|
+
}, u = t != null && t !== R.current;
|
|
5274
|
+
t && (R.current = t), u && !q() && Math.abs(e.scrollTop - I()) > a ? (L.current = performance.now() + ri, e.scrollTo({
|
|
5275
|
+
top: I(),
|
|
5165
5276
|
behavior: "smooth"
|
|
5166
|
-
})) :
|
|
5167
|
-
let
|
|
5168
|
-
return
|
|
5277
|
+
})) : o();
|
|
5278
|
+
let d = new ResizeObserver(o);
|
|
5279
|
+
return d.observe(n), () => {
|
|
5280
|
+
d.disconnect(), window.clearTimeout(r), s && cancelAnimationFrame(s), window.clearTimeout(c);
|
|
5281
|
+
};
|
|
5169
5282
|
}, [
|
|
5170
5283
|
f,
|
|
5171
5284
|
k,
|
|
5172
|
-
|
|
5285
|
+
I,
|
|
5173
5286
|
t,
|
|
5174
|
-
a
|
|
5287
|
+
a,
|
|
5288
|
+
h
|
|
5175
5289
|
]), c(() => {
|
|
5176
5290
|
if (!f) return;
|
|
5177
5291
|
let e = T.current;
|
|
5178
5292
|
if (!e) return;
|
|
5179
5293
|
let n = () => {
|
|
5180
|
-
|
|
5294
|
+
L.current = 0, Math.abs(e.scrollTop - I()) > a && A(!1);
|
|
5181
5295
|
}, r = (e) => {
|
|
5182
5296
|
t ? n() : e.deltaY < 0 && A(!1);
|
|
5183
5297
|
}, i = (e) => {
|
|
@@ -5203,40 +5317,40 @@ var Qr = {
|
|
|
5203
5317
|
}, [
|
|
5204
5318
|
f,
|
|
5205
5319
|
a,
|
|
5206
|
-
|
|
5320
|
+
I,
|
|
5207
5321
|
t
|
|
5208
5322
|
]);
|
|
5209
5323
|
let ne = o((e) => {
|
|
5210
5324
|
if (b?.(e), !f) return;
|
|
5211
5325
|
let t = T.current;
|
|
5212
|
-
t && Math.abs(t.scrollTop -
|
|
5326
|
+
t && Math.abs(t.scrollTop - I()) <= si && (L.current = 0, A(!0));
|
|
5213
5327
|
}, [
|
|
5214
5328
|
f,
|
|
5215
5329
|
b,
|
|
5216
|
-
|
|
5330
|
+
I
|
|
5217
5331
|
]), re = f && !k;
|
|
5218
5332
|
return /* @__PURE__ */ v("div", {
|
|
5219
5333
|
ref: O,
|
|
5220
|
-
className: [
|
|
5334
|
+
className: [ti.root, g ?? ""].filter(Boolean).join(" "),
|
|
5221
5335
|
"data-dock": h || void 0,
|
|
5222
5336
|
children: [/* @__PURE__ */ _("div", {
|
|
5223
5337
|
ref: T,
|
|
5224
|
-
className: [
|
|
5338
|
+
className: [ti.viewport, y ?? ""].filter(Boolean).join(" "),
|
|
5225
5339
|
onScroll: ne,
|
|
5226
5340
|
...x,
|
|
5227
5341
|
children: /* @__PURE__ */ _("div", {
|
|
5228
5342
|
ref: E,
|
|
5229
|
-
className:
|
|
5343
|
+
className: ti.content,
|
|
5230
5344
|
"data-dock": h || void 0,
|
|
5231
5345
|
children: e
|
|
5232
5346
|
})
|
|
5233
5347
|
}), s && /* @__PURE__ */ _("button", {
|
|
5234
5348
|
type: "button",
|
|
5235
|
-
className:
|
|
5349
|
+
className: ti.jump,
|
|
5236
5350
|
"data-shown": re || void 0,
|
|
5237
5351
|
tabIndex: re ? 0 : -1,
|
|
5238
5352
|
"aria-hidden": !re || void 0,
|
|
5239
|
-
onClick: () =>
|
|
5353
|
+
onClick: () => te(!0),
|
|
5240
5354
|
"aria-label": w,
|
|
5241
5355
|
children: /* @__PURE__ */ _(D, {
|
|
5242
5356
|
size: 15,
|
|
@@ -5244,7 +5358,7 @@ var Qr = {
|
|
|
5244
5358
|
})
|
|
5245
5359
|
})]
|
|
5246
5360
|
});
|
|
5247
|
-
}),
|
|
5361
|
+
}), pi = {
|
|
5248
5362
|
empty: "ick-empty-BP6G",
|
|
5249
5363
|
icon: "ick-icon-rZWd",
|
|
5250
5364
|
title: "ick-title-AoPi",
|
|
@@ -5253,29 +5367,29 @@ var Qr = {
|
|
|
5253
5367
|
};
|
|
5254
5368
|
//#endregion
|
|
5255
5369
|
//#region src/EmptyState/EmptyState.tsx
|
|
5256
|
-
function
|
|
5257
|
-
let l =
|
|
5370
|
+
function mi({ icon: e, title: t, description: n, suggestions: r, onSuggestion: i, suggestionsLabel: a, children: o, className: s, ...c }) {
|
|
5371
|
+
let l = U("emptyState").suggestions, u = a ?? l, d = i ? r ?? [] : [];
|
|
5258
5372
|
return /* @__PURE__ */ v("div", {
|
|
5259
|
-
className: [
|
|
5373
|
+
className: [pi.empty, s ?? ""].filter(Boolean).join(" "),
|
|
5260
5374
|
...c,
|
|
5261
5375
|
children: [
|
|
5262
5376
|
e && /* @__PURE__ */ _("div", {
|
|
5263
|
-
className:
|
|
5377
|
+
className: pi.icon,
|
|
5264
5378
|
children: e
|
|
5265
5379
|
}),
|
|
5266
5380
|
t && /* @__PURE__ */ _("div", {
|
|
5267
|
-
className:
|
|
5381
|
+
className: pi.title,
|
|
5268
5382
|
children: t
|
|
5269
5383
|
}),
|
|
5270
5384
|
n && /* @__PURE__ */ _("p", {
|
|
5271
|
-
className:
|
|
5385
|
+
className: pi.description,
|
|
5272
5386
|
children: n
|
|
5273
5387
|
}),
|
|
5274
5388
|
d.length > 0 && /* @__PURE__ */ _("div", {
|
|
5275
|
-
className:
|
|
5389
|
+
className: pi.suggestions,
|
|
5276
5390
|
role: "group",
|
|
5277
5391
|
"aria-label": u,
|
|
5278
|
-
children: d.map((e) => /* @__PURE__ */ _(
|
|
5392
|
+
children: d.map((e) => /* @__PURE__ */ _(H, {
|
|
5279
5393
|
variant: "primary",
|
|
5280
5394
|
size: "m",
|
|
5281
5395
|
onClick: () => i?.(e),
|
|
@@ -5288,14 +5402,14 @@ function si({ icon: e, title: t, description: n, suggestions: r, onSuggestion: i
|
|
|
5288
5402
|
}
|
|
5289
5403
|
//#endregion
|
|
5290
5404
|
//#region src/ReplyThreadPopup/placePanel.ts
|
|
5291
|
-
var
|
|
5292
|
-
function
|
|
5293
|
-
let r = Math.max(t - 48, 0), i = Math.min(Math.max(e.width +
|
|
5405
|
+
var hi = 24, gi = 480, _i = 80, vi = 260;
|
|
5406
|
+
function yi(e, t, n = Infinity) {
|
|
5407
|
+
let r = Math.max(t - 48, 0), i = Math.min(Math.max(e.width + _i, gi), r), a = e.left + e.width / 2 - i / 2, o = Math.min(Math.max(a, hi), t - hi - i), s = Math.max(hi, n - hi - vi), c = Math.min(Math.max(e.top - hi, Math.min(hi, n)), Number.isFinite(s) ? s : Infinity);
|
|
5294
5408
|
return {
|
|
5295
5409
|
x: o,
|
|
5296
5410
|
y: c,
|
|
5297
5411
|
width: i,
|
|
5298
|
-
maxHeight: Number.isFinite(n) ? Math.max(
|
|
5412
|
+
maxHeight: Number.isFinite(n) ? Math.max(vi, n - c - hi) : Infinity
|
|
5299
5413
|
};
|
|
5300
5414
|
}
|
|
5301
5415
|
var Q = {
|
|
@@ -5319,7 +5433,7 @@ var Q = {
|
|
|
5319
5433
|
turn: "ick-turn-ogjU",
|
|
5320
5434
|
turnRow: "ick-turnRow-0OuP",
|
|
5321
5435
|
srOnly: "ick-srOnly-LwE1"
|
|
5322
|
-
},
|
|
5436
|
+
}, bi = 760, xi = {
|
|
5323
5437
|
closed: {
|
|
5324
5438
|
y: "100%",
|
|
5325
5439
|
opacity: 1,
|
|
@@ -5338,16 +5452,16 @@ var Q = {
|
|
|
5338
5452
|
bounce: .18
|
|
5339
5453
|
}
|
|
5340
5454
|
}
|
|
5341
|
-
},
|
|
5342
|
-
function
|
|
5343
|
-
let i =
|
|
5455
|
+
}, Si = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [contenteditable]:not([contenteditable=\"false\"]), [tabindex]:not([tabindex=\"-1\"])";
|
|
5456
|
+
function Ci({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
|
|
5457
|
+
let i = U("thread"), { responding: a } = U("experience"), [o, s] = m("none"), u = p(null), d = p(null), f = p(null), [h] = m(() => typeof document > "u" ? null : document.activeElement), g = l(), y = l(), b = rt, [S, w] = m(() => typeof window > "u" ? !1 : window.matchMedia?.(`(max-width: ${bi}px)`)?.matches ?? !1);
|
|
5344
5458
|
c(() => {
|
|
5345
|
-
let e = window.matchMedia?.(`(max-width: ${
|
|
5459
|
+
let e = window.matchMedia?.(`(max-width: ${bi}px)`);
|
|
5346
5460
|
if (!e?.addEventListener) return;
|
|
5347
5461
|
let t = () => w(e.matches);
|
|
5348
5462
|
return t(), e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
5349
5463
|
}, []);
|
|
5350
|
-
let T = e.text, { turns: E, setDraft: D, submit: O, stop: k, beginEdit: A } =
|
|
5464
|
+
let T = e.text, { turns: E, setDraft: D, submit: O, stop: k, beginEdit: A } = gt({
|
|
5351
5465
|
onSend: (e, t) => r(e, T, t),
|
|
5352
5466
|
announcements: { responding: a }
|
|
5353
5467
|
});
|
|
@@ -5361,7 +5475,7 @@ function gi({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
|
|
|
5361
5475
|
return;
|
|
5362
5476
|
}
|
|
5363
5477
|
if (e.key !== "Tab") return;
|
|
5364
|
-
let n = [...f.current?.querySelectorAll(
|
|
5478
|
+
let n = [...f.current?.querySelectorAll(Si) ?? []];
|
|
5365
5479
|
if (n.length === 0) return;
|
|
5366
5480
|
let r = n[0], i = n[n.length - 1], a = document.activeElement;
|
|
5367
5481
|
e.shiftKey && a === r ? (e.preventDefault(), i.focus()) : !e.shiftKey && a === i && (e.preventDefault(), r.focus());
|
|
@@ -5398,7 +5512,7 @@ function gi({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
|
|
|
5398
5512
|
y: 0,
|
|
5399
5513
|
width: 480,
|
|
5400
5514
|
maxHeight: Infinity
|
|
5401
|
-
} :
|
|
5515
|
+
} : yi(e.rect, window.innerWidth, window.innerHeight);
|
|
5402
5516
|
return /* @__PURE__ */ _(x, {
|
|
5403
5517
|
reducedMotion: "user",
|
|
5404
5518
|
children: /* @__PURE__ */ _("div", {
|
|
@@ -5432,7 +5546,7 @@ function gi({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
|
|
|
5432
5546
|
scale: .95,
|
|
5433
5547
|
filter: "blur(4px)"
|
|
5434
5548
|
},
|
|
5435
|
-
variants: S ?
|
|
5549
|
+
variants: S ? xi : void 0,
|
|
5436
5550
|
transition: S ? void 0 : {
|
|
5437
5551
|
type: "spring",
|
|
5438
5552
|
bounce: 0,
|
|
@@ -5480,14 +5594,14 @@ function gi({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
|
|
|
5480
5594
|
})]
|
|
5481
5595
|
}), /* @__PURE__ */ v("div", {
|
|
5482
5596
|
className: Q.headerActions,
|
|
5483
|
-
children: [/* @__PURE__ */ _(
|
|
5597
|
+
children: [/* @__PURE__ */ _(H, {
|
|
5484
5598
|
variant: "primary",
|
|
5485
|
-
icon: /* @__PURE__ */ _(
|
|
5599
|
+
icon: /* @__PURE__ */ _(me, { size: 16 }),
|
|
5486
5600
|
onClick: n,
|
|
5487
5601
|
children: i.save
|
|
5488
|
-
}), /* @__PURE__ */ _(
|
|
5602
|
+
}), /* @__PURE__ */ _(H, {
|
|
5489
5603
|
variant: "secondary",
|
|
5490
|
-
icon: /* @__PURE__ */ _(
|
|
5604
|
+
icon: /* @__PURE__ */ _(Ce, { size: 16 }),
|
|
5491
5605
|
onClick: t,
|
|
5492
5606
|
"aria-label": i.close
|
|
5493
5607
|
})]
|
|
@@ -5545,7 +5659,7 @@ function gi({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
|
|
|
5545
5659
|
children: [/* @__PURE__ */ _("div", {
|
|
5546
5660
|
className: Q.turnRow,
|
|
5547
5661
|
"data-editing": r || void 0,
|
|
5548
|
-
children: /* @__PURE__ */ _(
|
|
5662
|
+
children: /* @__PURE__ */ _(st, {
|
|
5549
5663
|
ref: n ? u : null,
|
|
5550
5664
|
state: e.state,
|
|
5551
5665
|
value: e.user,
|
|
@@ -5576,7 +5690,7 @@ function gi({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
|
|
|
5576
5690
|
}
|
|
5577
5691
|
//#endregion
|
|
5578
5692
|
//#region src/CustomCursor/CustomCursor.tsx
|
|
5579
|
-
function
|
|
5693
|
+
function wi() {
|
|
5580
5694
|
let e = T(-100), t = T(-100), [n, r] = m("default"), [i, a] = m(!1), [o, s] = m(!1);
|
|
5581
5695
|
return c(() => {
|
|
5582
5696
|
let n = (n) => {
|
|
@@ -5734,7 +5848,7 @@ function _i() {
|
|
|
5734
5848
|
}
|
|
5735
5849
|
//#endregion
|
|
5736
5850
|
//#region src/theme/useThemeAttribute.ts
|
|
5737
|
-
function
|
|
5851
|
+
function Ti(e) {
|
|
5738
5852
|
c(() => {
|
|
5739
5853
|
e !== void 0 && (e ? document.documentElement.setAttribute("data-theme", e) : document.documentElement.removeAttribute("data-theme"));
|
|
5740
5854
|
}, [e]);
|
|
@@ -5744,7 +5858,7 @@ var $ = {
|
|
|
5744
5858
|
feed: "ick-feed-XqZl",
|
|
5745
5859
|
dock: "ick-dock-tvIC",
|
|
5746
5860
|
centred: "ick-centred-5tu8",
|
|
5747
|
-
|
|
5861
|
+
fitted: "ick-fitted-JApW",
|
|
5748
5862
|
topBlur: "ick-topBlur-69Dl",
|
|
5749
5863
|
bottomBlur: "ick-bottomBlur-MXmb",
|
|
5750
5864
|
header: "ick-header-pQ7Z",
|
|
@@ -5761,134 +5875,134 @@ var $ = {
|
|
|
5761
5875
|
groupTitle: "ick-groupTitle-jiBB",
|
|
5762
5876
|
marks: "ick-marks-gwsN",
|
|
5763
5877
|
mark: "ick-mark-QkpW"
|
|
5764
|
-
},
|
|
5878
|
+
}, Ei = () => "", Di = {
|
|
5765
5879
|
stiffness: 170,
|
|
5766
5880
|
damping: 24,
|
|
5767
5881
|
mass: 1
|
|
5768
5882
|
};
|
|
5769
|
-
function
|
|
5770
|
-
let
|
|
5883
|
+
function Oi({ onSend: e, chat: t, renderPart: n, labels: r, headerActions: i = !0, composerMenu: a, onTranscribe: s, onThreadReply: l, title: u, backHref: d, backLabel: h, actions: b, placeholder: x, empty: S, contextTotal: w, contextBase: T = 0, artifact: E, openArtifactId: D, onOpenArtifactChange: O, pane: A = "inline", surface: j = "flush", composer: M = "inline", fill: N = "window", theme: ee, onThemeChange: P, cursor: F = !1, selectionToggle: I = !1, highlights: L = !0, bookmarks: R = !0, anchorOffset: ne = 100, endOffset: re = 120, animationConfig: z, foldMotion: ie, feedDelay: ae = 0, onAnswerQuestion: oe, onEditQuestion: ce, onDecideApproval: le, className: ue }) {
|
|
5884
|
+
let B = U("experience", r?.experience), de = u ?? B.title, [fe, pe] = m([]), [me, ge] = m(!1), [ye, be] = m(null), [xe, Se] = m("marker"), Ce = p(null), V = ee !== void 0, [we, Te] = m(null), H = V ? ee : we, [Ee, De] = m(() => typeof window < "u" && !!window.matchMedia?.("(prefers-color-scheme: dark)").matches);
|
|
5771
5885
|
c(() => {
|
|
5772
5886
|
let e = window.matchMedia("(prefers-color-scheme: dark)"), t = () => De(e.matches);
|
|
5773
5887
|
return e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
5774
5888
|
}, []);
|
|
5775
|
-
let Oe =
|
|
5776
|
-
|
|
5777
|
-
let
|
|
5778
|
-
|
|
5779
|
-
}, [
|
|
5889
|
+
let Oe = H ?? (Ee ? "dark" : "light");
|
|
5890
|
+
Ti(H);
|
|
5891
|
+
let je = o((e) => {
|
|
5892
|
+
V || Te(e), P?.(e);
|
|
5893
|
+
}, [V, P]), Me = M === "docked", Ne = f(() => Me ? {
|
|
5780
5894
|
...rt,
|
|
5781
|
-
...
|
|
5782
|
-
bubble:
|
|
5783
|
-
} :
|
|
5784
|
-
onSend: e ??
|
|
5785
|
-
announcements: { responding:
|
|
5786
|
-
nextTurn:
|
|
5787
|
-
}), { turns:
|
|
5788
|
-
|
|
5789
|
-
}, [
|
|
5895
|
+
...z,
|
|
5896
|
+
bubble: z?.bubble ?? Di
|
|
5897
|
+
} : z, [Me, z]), Pe = gt({
|
|
5898
|
+
onSend: e ?? Ei,
|
|
5899
|
+
announcements: { responding: B.responding },
|
|
5900
|
+
nextTurn: Me ? "at-send" : "after-answer"
|
|
5901
|
+
}), { turns: Fe, setDraft: Ie, submit: Le, showVersion: W, stop: Re, beginEdit: ze, cancelEdit: Be, updatePart: Ve, isStreaming: He } = t ?? Pe, [Ue, We] = m(null), Ge = o((e, t, n) => {
|
|
5902
|
+
We(e), Le(e, t, n);
|
|
5903
|
+
}, [Le]), G = Ue ? Fe.find((e) => e.id === Ue) ?? null : null, K = (G?.versions?.length ?? 0) > 0, q = G && K && G.state !== "resting" ? Ue : null, [qe, Je] = m(0), Ye = N === "window";
|
|
5790
5904
|
c(() => {
|
|
5791
|
-
if (!
|
|
5905
|
+
if (!Me || !Ye) return;
|
|
5792
5906
|
let e = window.visualViewport;
|
|
5793
5907
|
if (!e) return;
|
|
5794
|
-
let t = () =>
|
|
5908
|
+
let t = () => Je(Math.max(0, Math.round(window.innerHeight - e.height)));
|
|
5795
5909
|
return t(), e.addEventListener("resize", t), () => e.removeEventListener("resize", t);
|
|
5796
|
-
}, [
|
|
5797
|
-
let
|
|
5798
|
-
|
|
5799
|
-
}, [
|
|
5910
|
+
}, [Me, Ye]);
|
|
5911
|
+
let Xe = o((e) => {
|
|
5912
|
+
We(e), Le(e);
|
|
5913
|
+
}, [Le]), Ze = Fe.length === 1 && !Fe[0].user && !Fe[0].ai, Qe = T + Math.round(Fe.reduce((e, t) => e + t.user.length + t.ai.length + JSON.stringify(t.parts ?? []).length, 0) / 4), $e = w !== void 0 && Qe >= w, et = p(!1);
|
|
5800
5914
|
c(() => {
|
|
5801
|
-
if (
|
|
5802
|
-
|
|
5915
|
+
if (!$e) {
|
|
5916
|
+
et.current = !1;
|
|
5803
5917
|
return;
|
|
5804
5918
|
}
|
|
5805
|
-
|
|
5806
|
-
}, [
|
|
5807
|
-
let
|
|
5808
|
-
openArtifactId:
|
|
5809
|
-
artifactHeld:
|
|
5919
|
+
et.current || (et.current = !0, Ke(B.windowFull));
|
|
5920
|
+
}, [$e, B.windowFull]);
|
|
5921
|
+
let tt = ei(), nt = D !== void 0, it = nt ? D : tt.openId, at = p({
|
|
5922
|
+
openArtifactId: it,
|
|
5923
|
+
artifactHeld: nt,
|
|
5810
5924
|
onOpenArtifactChange: O
|
|
5811
5925
|
});
|
|
5812
5926
|
c(() => {
|
|
5813
|
-
|
|
5814
|
-
openArtifactId:
|
|
5815
|
-
artifactHeld:
|
|
5927
|
+
at.current = {
|
|
5928
|
+
openArtifactId: it,
|
|
5929
|
+
artifactHeld: nt,
|
|
5816
5930
|
onOpenArtifactChange: O
|
|
5817
5931
|
};
|
|
5818
5932
|
});
|
|
5819
|
-
let
|
|
5820
|
-
let { artifactHeld: t, onOpenArtifactChange: n } =
|
|
5821
|
-
t || (e === null ?
|
|
5822
|
-
}, [
|
|
5823
|
-
|
|
5933
|
+
let ot = tt.open, st = tt.close, ct = o((e) => {
|
|
5934
|
+
let { artifactHeld: t, onOpenArtifactChange: n } = at.current;
|
|
5935
|
+
t || (e === null ? st() : ot(e)), n?.(e);
|
|
5936
|
+
}, [ot, st]), lt = o(() => ct(null), [ct]), [ut, dt] = m({}), J = o((e, t) => {
|
|
5937
|
+
dt((n) => ({
|
|
5824
5938
|
...n,
|
|
5825
5939
|
[e]: t
|
|
5826
5940
|
}));
|
|
5827
|
-
}, []),
|
|
5828
|
-
|
|
5941
|
+
}, []), ft = Fe.find((e) => e.state !== "idle" && e.state !== "typing" && e.user.trim())?.user.trim() ?? de, pt = o((e, t) => {
|
|
5942
|
+
R && t.trim().length > 0 && pe((n) => [...n, {
|
|
5829
5943
|
turnId: e,
|
|
5830
5944
|
text: t.trim()
|
|
5831
5945
|
}]);
|
|
5832
|
-
}, [
|
|
5946
|
+
}, [R]), mt = o((e, t) => ct(at.current.openArtifactId === t ? null : t), [ct]), ht = o((e, t) => {
|
|
5833
5947
|
be({
|
|
5834
5948
|
text: e,
|
|
5835
5949
|
rect: t
|
|
5836
5950
|
});
|
|
5837
|
-
}, []),
|
|
5951
|
+
}, []), Y = f(() => oe ? (e, t, n, r) => oe(Ve, e, t, n, r) : void 0, [oe, Ve]), _t = f(() => ce ? (e, t, n) => ce(Ve, e, t, n) : void 0, [ce, Ve]), vt = f(() => le ? (e, t, n) => le(Ve, e, t, n) : void 0, [le, Ve]), [yt, bt] = m(() => typeof window > "u" || !window.matchMedia || window.matchMedia("(pointer: fine)").matches);
|
|
5838
5952
|
c(() => {
|
|
5839
|
-
if (!
|
|
5840
|
-
let e = window.matchMedia("(pointer: fine)"), t = () =>
|
|
5953
|
+
if (!F) return;
|
|
5954
|
+
let e = window.matchMedia("(pointer: fine)"), t = () => bt(e.matches);
|
|
5841
5955
|
return t(), e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
5842
|
-
}, [
|
|
5843
|
-
let
|
|
5844
|
-
...
|
|
5956
|
+
}, [F]);
|
|
5957
|
+
let xt = (e) => i === !0 || Array.isArray(i) && i.includes(e), St = [
|
|
5958
|
+
...L && R && fe.length > 0 ? [{
|
|
5845
5959
|
id: "bookmarks",
|
|
5846
|
-
label:
|
|
5960
|
+
label: B.savedHighlights,
|
|
5847
5961
|
icon: /* @__PURE__ */ _(k, {
|
|
5848
5962
|
size: 16,
|
|
5849
5963
|
"aria-hidden": !0
|
|
5850
5964
|
}),
|
|
5851
5965
|
count: fe.length,
|
|
5852
5966
|
pinned: !0,
|
|
5853
|
-
onClick: () =>
|
|
5967
|
+
onClick: () => ge(!0)
|
|
5854
5968
|
}] : [],
|
|
5855
|
-
...
|
|
5969
|
+
...xt("theme") ? [{
|
|
5856
5970
|
id: "theme",
|
|
5857
|
-
label: Oe === "dark" ?
|
|
5858
|
-
icon: _(Oe === "dark" ?
|
|
5971
|
+
label: Oe === "dark" ? B.themeToLight : B.themeToDark,
|
|
5972
|
+
icon: _(Oe === "dark" ? _e : se, {
|
|
5859
5973
|
size: 16,
|
|
5860
5974
|
"aria-hidden": !0
|
|
5861
5975
|
}),
|
|
5862
5976
|
active: Oe === "dark",
|
|
5863
|
-
onClick: () =>
|
|
5977
|
+
onClick: () => je(Oe === "dark" ? "light" : "dark")
|
|
5864
5978
|
}] : [],
|
|
5865
|
-
...
|
|
5979
|
+
...xt("share") ? [{
|
|
5866
5980
|
id: "share",
|
|
5867
|
-
label:
|
|
5868
|
-
icon: /* @__PURE__ */ _(
|
|
5981
|
+
label: B.share,
|
|
5982
|
+
icon: /* @__PURE__ */ _(he, {
|
|
5869
5983
|
size: 16,
|
|
5870
5984
|
"aria-hidden": !0
|
|
5871
5985
|
}),
|
|
5872
5986
|
onClick: () => navigator.share?.({
|
|
5873
|
-
title:
|
|
5987
|
+
title: ft,
|
|
5874
5988
|
url: window.location.href
|
|
5875
5989
|
})
|
|
5876
5990
|
}] : [],
|
|
5877
5991
|
...b ?? []
|
|
5878
|
-
],
|
|
5992
|
+
], Ct = A === "inline" && it ? E?.(it) : null, Tt = /* @__PURE__ */ v(C.div, {
|
|
5879
5993
|
className: [
|
|
5880
5994
|
$.page,
|
|
5881
|
-
j === "panes" ? $.
|
|
5995
|
+
j === "panes" || !Ye ? $.fitted : "",
|
|
5882
5996
|
"ick-chat-page",
|
|
5883
5997
|
ue
|
|
5884
5998
|
].filter(Boolean).join(" "),
|
|
5885
|
-
style: { "--ick-experience-anchor": `${
|
|
5886
|
-
"data-composer":
|
|
5999
|
+
style: { "--ick-experience-anchor": `${ne}px` },
|
|
6000
|
+
"data-composer": Me ? "docked" : void 0,
|
|
5887
6001
|
initial: { opacity: 0 },
|
|
5888
6002
|
animate: {
|
|
5889
|
-
opacity:
|
|
5890
|
-
filter:
|
|
5891
|
-
scale:
|
|
6003
|
+
opacity: ye || me ? .4 : 1,
|
|
6004
|
+
filter: ye || me ? "blur(3px)" : "blur(0px)",
|
|
6005
|
+
scale: ye || me ? .9 : 1
|
|
5892
6006
|
},
|
|
5893
6007
|
transition: {
|
|
5894
6008
|
type: "spring",
|
|
@@ -5901,126 +6015,127 @@ function xi({ onSend: e, chat: t, renderPart: n, labels: r, headerActions: i = !
|
|
|
5901
6015
|
},
|
|
5902
6016
|
children: [
|
|
5903
6017
|
/* @__PURE__ */ _("div", { className: $.topBlur }),
|
|
5904
|
-
/* @__PURE__ */ v(
|
|
6018
|
+
/* @__PURE__ */ v(wt, {
|
|
5905
6019
|
className: `${$.header} ick-chat-header`,
|
|
5906
|
-
title:
|
|
6020
|
+
title: ft,
|
|
5907
6021
|
backHref: d,
|
|
5908
6022
|
backLabel: h,
|
|
5909
6023
|
elevateOnScroll: !1,
|
|
5910
6024
|
collapseActionsAt: 480,
|
|
5911
|
-
actions:
|
|
5912
|
-
children: [w !== void 0 && /* @__PURE__ */ _(
|
|
6025
|
+
actions: St,
|
|
6026
|
+
children: [w !== void 0 && /* @__PURE__ */ _(Vr, {
|
|
5913
6027
|
className: $.context,
|
|
5914
|
-
used:
|
|
6028
|
+
used: Qe,
|
|
5915
6029
|
total: w
|
|
5916
|
-
}),
|
|
6030
|
+
}), I && L && /* @__PURE__ */ v("div", {
|
|
5917
6031
|
className: $.selectMode,
|
|
5918
6032
|
role: "group",
|
|
5919
|
-
"aria-label":
|
|
6033
|
+
"aria-label": B.selectionMode,
|
|
5920
6034
|
children: [/* @__PURE__ */ _("button", {
|
|
5921
6035
|
type: "button",
|
|
5922
6036
|
"data-active": xe === "marker",
|
|
5923
6037
|
onClick: () => Se("marker"),
|
|
5924
|
-
"aria-label":
|
|
5925
|
-
title:
|
|
5926
|
-
children: /* @__PURE__ */ _(
|
|
6038
|
+
"aria-label": B.marker,
|
|
6039
|
+
title: B.marker,
|
|
6040
|
+
children: /* @__PURE__ */ _(te, { size: 16 })
|
|
5927
6041
|
}), /* @__PURE__ */ _("button", {
|
|
5928
6042
|
type: "button",
|
|
5929
6043
|
"data-active": xe === "precise",
|
|
5930
6044
|
onClick: () => Se("precise"),
|
|
5931
|
-
"aria-label":
|
|
5932
|
-
title:
|
|
5933
|
-
children: /* @__PURE__ */ _(
|
|
6045
|
+
"aria-label": B.precise,
|
|
6046
|
+
title: B.precise,
|
|
6047
|
+
children: /* @__PURE__ */ _(ve, { size: 16 })
|
|
5934
6048
|
})]
|
|
5935
6049
|
})]
|
|
5936
6050
|
}),
|
|
5937
|
-
/* @__PURE__ */ v(
|
|
6051
|
+
/* @__PURE__ */ v(fi, {
|
|
5938
6052
|
viewportClassName: `${$.feed} ick-chat-feed`,
|
|
5939
|
-
anchorId:
|
|
5940
|
-
dock:
|
|
5941
|
-
anchorOffset:
|
|
5942
|
-
endOffset:
|
|
6053
|
+
anchorId: q ? `turn-${q}` : void 0,
|
|
6054
|
+
dock: Me,
|
|
6055
|
+
anchorOffset: ne,
|
|
6056
|
+
endOffset: Me ? 0 : re,
|
|
5943
6057
|
children: [
|
|
5944
|
-
|
|
5945
|
-
className:
|
|
6058
|
+
Ze && S && /* @__PURE__ */ _(mi, {
|
|
6059
|
+
className: Me ? `${$.opening} ${$.centred}` : $.opening,
|
|
5946
6060
|
title: S.title,
|
|
5947
6061
|
description: S.description,
|
|
5948
6062
|
suggestions: S.suggestions,
|
|
5949
|
-
onSuggestion: (e) =>
|
|
6063
|
+
onSuggestion: (e) => Ge(Fe[0].id, e)
|
|
5950
6064
|
}),
|
|
5951
|
-
/* @__PURE__ */ _(y, { children:
|
|
5952
|
-
let r = t ===
|
|
5953
|
-
return /* @__PURE__ */ _(
|
|
6065
|
+
/* @__PURE__ */ _(y, { children: Fe.map((e, t) => {
|
|
6066
|
+
let r = t === Fe.length - 1 && (e.state === "idle" || e.state === "typing");
|
|
6067
|
+
return /* @__PURE__ */ _(Ir, {
|
|
5954
6068
|
turn: e,
|
|
5955
|
-
questionAlign:
|
|
5956
|
-
className:
|
|
6069
|
+
questionAlign: Me && r || Ze && t === 0 ? "stretch" : "end",
|
|
6070
|
+
className: Me && r ? $.dock : Ze && t === 0 ? $.opening : void 0,
|
|
5957
6071
|
onTranscribe: s,
|
|
5958
6072
|
isActiveInput: r,
|
|
5959
6073
|
inputRef: r ? Ce : null,
|
|
5960
6074
|
entranceDelay: t === 0 ? ae : 0,
|
|
5961
6075
|
selectionMode: xe,
|
|
5962
|
-
highlights:
|
|
5963
|
-
animationConfig:
|
|
5964
|
-
foldMotion:
|
|
5965
|
-
openArtifactId:
|
|
5966
|
-
onOpenArtifact:
|
|
5967
|
-
onArtifactChange:
|
|
6076
|
+
highlights: L,
|
|
6077
|
+
animationConfig: Ne,
|
|
6078
|
+
foldMotion: ie,
|
|
6079
|
+
openArtifactId: it,
|
|
6080
|
+
onOpenArtifact: mt,
|
|
6081
|
+
onArtifactChange: ct,
|
|
5968
6082
|
placeholder: x,
|
|
5969
|
-
onDraft:
|
|
5970
|
-
onSubmit:
|
|
5971
|
-
onRegenerate:
|
|
5972
|
-
onShowVersion:
|
|
5973
|
-
onFeedback:
|
|
5974
|
-
feedback:
|
|
5975
|
-
onStop: !
|
|
5976
|
-
busy:
|
|
5977
|
-
onEdit:
|
|
5978
|
-
onCancelEdit:
|
|
5979
|
-
onHighlight:
|
|
5980
|
-
onReplyInThread: l ?
|
|
5981
|
-
onAnswerQuestion:
|
|
5982
|
-
onEditQuestion:
|
|
5983
|
-
onDecideApproval:
|
|
6083
|
+
onDraft: Ie,
|
|
6084
|
+
onSubmit: Ge,
|
|
6085
|
+
onRegenerate: Xe,
|
|
6086
|
+
onShowVersion: W,
|
|
6087
|
+
onFeedback: J,
|
|
6088
|
+
feedback: ut[e.id] ?? null,
|
|
6089
|
+
onStop: !Me || r ? Re : void 0,
|
|
6090
|
+
busy: Me && r ? He : void 0,
|
|
6091
|
+
onEdit: ze,
|
|
6092
|
+
onCancelEdit: Be,
|
|
6093
|
+
onHighlight: pt,
|
|
6094
|
+
onReplyInThread: l ? ht : void 0,
|
|
6095
|
+
onAnswerQuestion: Y,
|
|
6096
|
+
onEditQuestion: _t,
|
|
6097
|
+
onDecideApproval: vt,
|
|
5984
6098
|
renderPart: n,
|
|
5985
6099
|
composerMenu: a
|
|
5986
6100
|
}, e.id);
|
|
5987
6101
|
}) }),
|
|
5988
|
-
|
|
6102
|
+
$e && /* @__PURE__ */ _(Bn, { children: B.windowFull })
|
|
5989
6103
|
]
|
|
5990
6104
|
}),
|
|
5991
6105
|
/* @__PURE__ */ _("div", { className: $.bottomBlur })
|
|
5992
6106
|
]
|
|
5993
6107
|
});
|
|
5994
|
-
return /* @__PURE__ */ v(
|
|
6108
|
+
return /* @__PURE__ */ v(ke, {
|
|
5995
6109
|
labels: r,
|
|
5996
6110
|
children: [
|
|
5997
|
-
|
|
5998
|
-
/* @__PURE__ */ _(
|
|
6111
|
+
F && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("style", { dangerouslySetInnerHTML: { __html: "@media (pointer: fine) { * { cursor: none !important; } }" } }), yt && /* @__PURE__ */ _(wi, {})] }),
|
|
6112
|
+
/* @__PURE__ */ _($r, {
|
|
5999
6113
|
className: $.workspace,
|
|
6000
6114
|
surface: j,
|
|
6001
|
-
|
|
6002
|
-
|
|
6003
|
-
|
|
6004
|
-
|
|
6005
|
-
|
|
6115
|
+
"data-fill": Ye ? void 0 : "container",
|
|
6116
|
+
style: Ye && qe > 0 ? { "--ick-keyboard": `${qe}px` } : void 0,
|
|
6117
|
+
onDismiss: lt,
|
|
6118
|
+
pane: ({ narrow: e, expanded: t, toggleExpanded: n }) => Ct ? /* @__PURE__ */ _(Ur, {
|
|
6119
|
+
title: Ct.title,
|
|
6120
|
+
meta: Ct.meta,
|
|
6006
6121
|
modal: e,
|
|
6007
6122
|
expanded: t,
|
|
6008
6123
|
onToggleExpanded: n,
|
|
6009
|
-
onClose:
|
|
6010
|
-
children:
|
|
6124
|
+
onClose: lt,
|
|
6125
|
+
children: Ct.children
|
|
6011
6126
|
}) : null,
|
|
6012
|
-
children:
|
|
6127
|
+
children: Tt
|
|
6013
6128
|
}),
|
|
6014
6129
|
/* @__PURE__ */ _(y, { children: me && /* @__PURE__ */ _(C.div, {
|
|
6015
6130
|
className: $.scrim,
|
|
6016
6131
|
initial: { opacity: 0 },
|
|
6017
6132
|
animate: { opacity: 1 },
|
|
6018
6133
|
exit: { opacity: 0 },
|
|
6019
|
-
onClick: () =>
|
|
6134
|
+
onClick: () => ge(!1),
|
|
6020
6135
|
children: /* @__PURE__ */ v(C.div, {
|
|
6021
6136
|
className: $.sheet,
|
|
6022
6137
|
role: "dialog",
|
|
6023
|
-
"aria-label":
|
|
6138
|
+
"aria-label": B.savedHighlights,
|
|
6024
6139
|
initial: {
|
|
6025
6140
|
y: 20,
|
|
6026
6141
|
scale: .95
|
|
@@ -6038,24 +6153,24 @@ function xi({ onSend: e, chat: t, renderPart: n, labels: r, headerActions: i = !
|
|
|
6038
6153
|
className: $.sheetHead,
|
|
6039
6154
|
children: [/* @__PURE__ */ _("h2", {
|
|
6040
6155
|
className: $.sheetTitle,
|
|
6041
|
-
children:
|
|
6156
|
+
children: B.highlights
|
|
6042
6157
|
}), /* @__PURE__ */ _("button", {
|
|
6043
6158
|
className: $.close,
|
|
6044
|
-
onClick: () =>
|
|
6045
|
-
children:
|
|
6159
|
+
onClick: () => ge(!1),
|
|
6160
|
+
children: B.close
|
|
6046
6161
|
})]
|
|
6047
6162
|
}), Array.from(new Set(fe.map((e) => e.turnId))).map((e, t) => /* @__PURE__ */ v("div", {
|
|
6048
6163
|
className: $.group,
|
|
6049
6164
|
children: [/* @__PURE__ */ _("h3", {
|
|
6050
6165
|
className: $.groupTitle,
|
|
6051
|
-
children:
|
|
6166
|
+
children: Ae(B.paragraph, { index: t + 1 })
|
|
6052
6167
|
}), /* @__PURE__ */ _("div", {
|
|
6053
6168
|
className: $.marks,
|
|
6054
6169
|
children: fe.filter((t) => t.turnId === e).map((t, n) => /* @__PURE__ */ _("button", {
|
|
6055
6170
|
type: "button",
|
|
6056
6171
|
className: $.mark,
|
|
6057
6172
|
onClick: () => {
|
|
6058
|
-
|
|
6173
|
+
ge(!1), setTimeout(() => {
|
|
6059
6174
|
let t = document.getElementById(`turn-${e}`), n = document.querySelector(".ick-chat-feed"), r = document.querySelector(".ick-chat-header");
|
|
6060
6175
|
if (t && n) {
|
|
6061
6176
|
let e = r ? r.offsetHeight : 80;
|
|
@@ -6075,8 +6190,8 @@ function xi({ onSend: e, chat: t, renderPart: n, labels: r, headerActions: i = !
|
|
|
6075
6190
|
}, e))]
|
|
6076
6191
|
})
|
|
6077
6192
|
}) }),
|
|
6078
|
-
/* @__PURE__ */ _(y, { children:
|
|
6079
|
-
activeReply:
|
|
6193
|
+
/* @__PURE__ */ _(y, { children: ye && l && /* @__PURE__ */ _(Ci, {
|
|
6194
|
+
activeReply: ye,
|
|
6080
6195
|
onClose: () => be(null),
|
|
6081
6196
|
onSendMessage: l
|
|
6082
6197
|
}, "thread-popup") })
|
|
@@ -6084,6 +6199,6 @@ function xi({ onSend: e, chat: t, renderPart: n, labels: r, headerActions: i = !
|
|
|
6084
6199
|
});
|
|
6085
6200
|
}
|
|
6086
6201
|
//#endregion
|
|
6087
|
-
export {
|
|
6202
|
+
export { De as $, pn as A, vt as B, Cn as C, yn as D, xn as E, Ht as F, Qe as G, ct as H, Nt as I, Re as J, Ke as K, jt as L, nn as M, Jt as N, _n as O, $t as P, ke as Q, kt as R, wn as S, En as T, st as U, gt as V, rt as W, Fe as X, Le as Y, je as Z, Rn as _, mi as a, Mn as b, $r as c, Ir as d, H as et, Mr as f, In as g, Bn as h, Ci as i, ln as j, hn as k, Ur as l, Wn as m, Ti as n, fi as o, Sr as p, Be as q, wi as r, ei as s, Oi as t, Vr as u, Ln as v, Tn as w, Sn as x, Pn as y, wt as z };
|
|
6088
6203
|
|
|
6089
|
-
//# sourceMappingURL=ChatExperience-
|
|
6204
|
+
//# sourceMappingURL=ChatExperience-umh3nGe_.js.map
|