@versini/sassysaint 8.76.0 → 8.77.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{AboutChangelog.0kKcS_nT.js → AboutChangelog.tVLL6MtY.js} +10 -9
- package/dist/chunks/{AboutEntry.pKgicvGA.js → AboutEntry.D9MonPwL.js} +11 -11
- package/dist/chunks/App.CusyBC2e.js +9011 -0
- package/dist/chunks/{Chart.DD1RkG8X.js → Chart.bKur3H71.js} +2 -2
- package/dist/chunks/{ChatBubbleAssistant.K55U7Bno.js → ChatBubbleAssistant.CEZZn7AD.js} +25 -23
- package/dist/chunks/ChatBubbleUser.BYLIgaHX.js +131 -0
- package/dist/chunks/ChatHistoryTable.D9mUtUwJ.js +237 -0
- package/dist/chunks/HistoryEntry.DarYFRIp.js +316 -0
- package/dist/chunks/{ProfileEntry.Bb-kLfDX.js → ProfileEntry.C_Y--pVY.js} +26 -26
- package/dist/chunks/{SettingsEntry.DrmBVh-w.js → SettingsEntry.DffchAfB.js} +39 -39
- package/dist/chunks/Table.DBfFG7qO.js +359 -0
- package/dist/chunks/{UsageEntry.O3YdUF30.js → UsageEntry.C73mIvmD.js} +19 -19
- package/dist/chunks/{UserMemoriesPanel.Dl5GlyBr.js → UserMemoriesPanel.DXx_9ifJ.js} +184 -210
- package/dist/chunks/index.AVBqcs3f.js +266 -0
- package/dist/chunks/{index.DUl-LwyU.js → index.B4-jvDi6.js} +1 -1
- package/dist/chunks/{index.DEKgWsou.js → index.BVMzTtBw.js} +1 -1
- package/dist/chunks/index.BcYESdDV.js +7894 -0
- package/dist/chunks/{index.DGkW9g6n.js → index.ClJfV5zs.js} +3 -3
- package/dist/chunks/{index.BeIiCAAq.js → index.Hv_qeE7S.js} +2 -2
- package/dist/chunks/{index.B9mUNJfd.js → index.Ly8CrT48.js} +1 -1
- package/dist/chunks/index.bx7cnejn.js +153 -0
- package/dist/chunks/{useMarkdown.Bf7wGKkC.js → useMarkdown.KipSXqDZ.js} +2004 -2130
- package/dist/components/SassySaint/SassySaint.js +1 -1
- package/dist/index.js +4 -4
- package/dist/style.css +2 -2
- package/package.json +5 -5
- package/dist/chunks/App.CtFpHv2O.js +0 -10007
- package/dist/chunks/ChatBubbleUser.DsX56Kxx.js +0 -128
- package/dist/chunks/ChatHistoryTable.BvEUTjiq.js +0 -288
- package/dist/chunks/HistoryEntry.BSOPWYO2.js +0 -333
- package/dist/chunks/Table.BbIvEnBz.js +0 -456
- package/dist/chunks/index.BNusLsEn.js +0 -357
- package/dist/chunks/index.Czv_1MTM.js +0 -7203
- package/dist/chunks/index.icjUE8II.js +0 -249
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as Ap } from "react/jsx-runtime";
|
|
2
|
-
import { getDefaultExportFromCjs as ln } from "./App.
|
|
2
|
+
import { getDefaultExportFromCjs as ln } from "./App.CusyBC2e.js";
|
|
3
3
|
import Cp, { useState as Pp, useEffect as Op } from "react";
|
|
4
|
-
import { TRIMESTERS as rn, TRIMESTERS_SHORT as Lp, isProbablyMobile as Ep } from "./index.
|
|
4
|
+
import { TRIMESTERS as rn, TRIMESTERS_SHORT as Lp, isProbablyMobile as Ep } from "./index.BcYESdDV.js";
|
|
5
5
|
var ls = { exports: {} }, Ip = ls.exports, on;
|
|
6
6
|
function Dp() {
|
|
7
7
|
return on || (on = 1, (function(we, he) {
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { n as P, useUserPreferences as R, convertCamelCaseToReadable as y, numberFormatter as L, pluralize as _, J as v } from "./index.
|
|
3
|
-
import { BUBBLE_FOOTER_EMPTY as B } from "./index.
|
|
1
|
+
import { jsx as x } from "react/jsx-runtime";
|
|
2
|
+
import { n as P, useUserPreferences as R, convertCamelCaseToReadable as y, numberFormatter as L, pluralize as _, J as v } from "./index.BcYESdDV.js";
|
|
3
|
+
import { BUBBLE_FOOTER_EMPTY as B } from "./index.bx7cnejn.js";
|
|
4
4
|
import U from "clsx";
|
|
5
5
|
import G, { useState as M, useRef as E, useEffect as F, useContext as S } from "react";
|
|
6
|
-
import { ChatContext as D, AppContext as j, AsyncBubble as k } from "./App.
|
|
7
|
-
import { useMarkdown as q } from "./useMarkdown.
|
|
8
|
-
const I = 2, W = I * 1e3, b = "",
|
|
9
|
-
function
|
|
10
|
-
const [a, d] = M(0), [
|
|
6
|
+
import { ChatContext as D, AppContext as j, AsyncBubble as k } from "./App.CusyBC2e.js";
|
|
7
|
+
import { useMarkdown as q } from "./useMarkdown.KipSXqDZ.js";
|
|
8
|
+
const I = 2, W = I * 1e3, b = "", V = (e) => e * (2 - e);
|
|
9
|
+
function Y(e, n = !0) {
|
|
10
|
+
const [a, d] = M(0), [i, p] = M(0), [t, C] = M(e), r = E(0), s = E(0);
|
|
11
11
|
return t !== e && (C(e), p(e.startsWith(t) ? a : 0)), F(() => {
|
|
12
12
|
if (!n)
|
|
13
13
|
return;
|
|
14
|
-
const
|
|
14
|
+
const g = e.split(b).length, c = (o) => {
|
|
15
15
|
s.current || (s.current = o);
|
|
16
|
-
const u = o - s.current, l = Math.min(u / W, 1), h =
|
|
17
|
-
d(Math.floor(
|
|
16
|
+
const u = o - s.current, l = Math.min(u / W, 1), h = V(l), T = i + (g - i) * h;
|
|
17
|
+
d(Math.floor(T)), l < 1 && (r.current = requestAnimationFrame(c));
|
|
18
18
|
};
|
|
19
|
-
return s.current = 0, r.current = requestAnimationFrame(
|
|
19
|
+
return s.current = 0, r.current = requestAnimationFrame(c), () => {
|
|
20
20
|
r.current && cancelAnimationFrame(r.current);
|
|
21
21
|
};
|
|
22
|
-
}, [
|
|
22
|
+
}, [i, e, n]), n ? e.split(b).slice(0, a).join(b) : e;
|
|
23
23
|
}
|
|
24
24
|
const f = {
|
|
25
25
|
MODEL: "Model",
|
|
@@ -31,37 +31,39 @@ const f = {
|
|
|
31
31
|
annotations: n,
|
|
32
32
|
toolName: a,
|
|
33
33
|
role: d,
|
|
34
|
-
smooth:
|
|
34
|
+
smooth: i = !1,
|
|
35
35
|
isLastAssistantMessage: p = !1
|
|
36
36
|
}) => {
|
|
37
|
-
const t =
|
|
37
|
+
const t = Y(e, i), {
|
|
38
38
|
state: { streaming: C, restoredModel: r, tokenUsage: s }
|
|
39
39
|
} = S(D), {
|
|
40
|
-
state: { fullScreen:
|
|
41
|
-
} = S(j),
|
|
40
|
+
state: { fullScreen: g }
|
|
41
|
+
} = S(j), c = n?.model || r, o = s, [u, l] = q(), { user: h, getAccessToken: T } = P(), { data: N } = R({
|
|
42
42
|
user: h?.username,
|
|
43
|
-
getAccessToken:
|
|
43
|
+
getAccessToken: T
|
|
44
44
|
}), O = N?.showDetails || !1, A = U("prose-li:ps-3", {
|
|
45
|
-
"max-w-xs sm:max-w-3xl": !
|
|
45
|
+
"max-w-xs sm:max-w-3xl": !g
|
|
46
46
|
});
|
|
47
47
|
let m;
|
|
48
48
|
return O && (m = {
|
|
49
|
-
[f.MODEL]:
|
|
49
|
+
[f.MODEL]: c || null,
|
|
50
50
|
[f.PLUGIN]: a ? y(a) : null
|
|
51
51
|
}, o && (p ? m[f.USAGE] = `${L.format(o)} ${_("token", o)}` : m[f.USAGE] = B)), F(() => {
|
|
52
52
|
t && l(t);
|
|
53
|
-
}, [t, l]), d === v ? /* @__PURE__ */
|
|
53
|
+
}, [t, l]), d === v ? /* @__PURE__ */ x(
|
|
54
54
|
k,
|
|
55
55
|
{
|
|
56
|
+
gradient: "medium",
|
|
56
57
|
tail: !0,
|
|
57
58
|
className: w,
|
|
58
59
|
contentClassName: A,
|
|
59
60
|
noMaxWidth: !0,
|
|
60
|
-
children: /* @__PURE__ */
|
|
61
|
+
children: /* @__PURE__ */ x("div", { className: "flex items-center justify-center italic text-copy-error-dark dark:text-red-300", children: u })
|
|
61
62
|
}
|
|
62
|
-
) : /* @__PURE__ */
|
|
63
|
+
) : /* @__PURE__ */ x(
|
|
63
64
|
k,
|
|
64
65
|
{
|
|
66
|
+
gradient: "light",
|
|
65
67
|
tail: !0,
|
|
66
68
|
copyToClipboardMode: "dark",
|
|
67
69
|
copyToClipboardFocusMode: "light",
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { jsx as a, Fragment as h, jsxs as S } from "react/jsx-runtime";
|
|
2
|
+
import { Button as C } from "./index.BcYESdDV.js";
|
|
3
|
+
import { useState as _, useMemo as m, isValidElement as T, useEffect as b } from "react";
|
|
4
|
+
import { AsyncBubble as w } from "./App.CusyBC2e.js";
|
|
5
|
+
import { useMarkdown as x } from "./useMarkdown.KipSXqDZ.js";
|
|
6
|
+
/*!
|
|
7
|
+
@versini/ui-truncate v5.2.0
|
|
8
|
+
© 2025 gizmette.com
|
|
9
|
+
*/
|
|
10
|
+
try {
|
|
11
|
+
window.__VERSINI_UI_TRUNCATE__ || (window.__VERSINI_UI_TRUNCATE__ = {
|
|
12
|
+
version: "5.2.0",
|
|
13
|
+
buildTime: "11/04/2025 03:45 PM EST",
|
|
14
|
+
homepage: "https://github.com/aversini/ui-components",
|
|
15
|
+
license: "MIT"
|
|
16
|
+
});
|
|
17
|
+
} catch {
|
|
18
|
+
}
|
|
19
|
+
const M = 200, k = ({ string: e, idealLength: t = M }) => {
|
|
20
|
+
if (e.length <= t)
|
|
21
|
+
return {
|
|
22
|
+
string: e,
|
|
23
|
+
isTruncated: !1
|
|
24
|
+
};
|
|
25
|
+
if (e.charAt(t) === " ")
|
|
26
|
+
return {
|
|
27
|
+
string: e.slice(0, t),
|
|
28
|
+
isTruncated: !0
|
|
29
|
+
};
|
|
30
|
+
const s = e.slice(t).search(" ");
|
|
31
|
+
return {
|
|
32
|
+
string: e.slice(0, t + s),
|
|
33
|
+
isTruncated: !0
|
|
34
|
+
};
|
|
35
|
+
}, l = (e) => e == null || typeof e == "boolean" ? "" : typeof e == "string" || typeof e == "number" ? String(e) : Array.isArray(e) ? e.map(l).join("") : /* @__PURE__ */ T(e) ? l(e.props.children) : "", B = /* @__PURE__ */ new Set([
|
|
36
|
+
"P",
|
|
37
|
+
"DIV",
|
|
38
|
+
"UL",
|
|
39
|
+
"OL",
|
|
40
|
+
"LI",
|
|
41
|
+
"SECTION",
|
|
42
|
+
"ARTICLE",
|
|
43
|
+
"HEADER",
|
|
44
|
+
"FOOTER",
|
|
45
|
+
"MAIN",
|
|
46
|
+
"ASIDE",
|
|
47
|
+
"TABLE",
|
|
48
|
+
"THEAD",
|
|
49
|
+
"TBODY",
|
|
50
|
+
"TFOOT",
|
|
51
|
+
"TR",
|
|
52
|
+
"TD",
|
|
53
|
+
"TH",
|
|
54
|
+
"BLOCKQUOTE",
|
|
55
|
+
"PRE",
|
|
56
|
+
"H1",
|
|
57
|
+
"H2",
|
|
58
|
+
"H3",
|
|
59
|
+
"H4",
|
|
60
|
+
"H5",
|
|
61
|
+
"H6"
|
|
62
|
+
]), u = (e) => {
|
|
63
|
+
if (e == null || typeof e == "boolean" || typeof e == "string" || typeof e == "number")
|
|
64
|
+
return !1;
|
|
65
|
+
if (Array.isArray(e))
|
|
66
|
+
return e.some(u);
|
|
67
|
+
if (/* @__PURE__ */ T(e)) {
|
|
68
|
+
const t = e;
|
|
69
|
+
return typeof t.type == "string" && B.has(t.type.toUpperCase()) ? !0 : u(t.props.children);
|
|
70
|
+
}
|
|
71
|
+
return !1;
|
|
72
|
+
}, H = ({ children: e, length: t = 200, mode: n = "system", focusMode: c = "system", enableRichTruncation: s = !1 }) => {
|
|
73
|
+
const [r, d] = _(!1), y = typeof e != "string" && !s, p = m(() => typeof e == "string" ? e : l(e), [
|
|
74
|
+
e
|
|
75
|
+
]), { string: f, isTruncated: i } = m(() => k({
|
|
76
|
+
string: p,
|
|
77
|
+
idealLength: t
|
|
78
|
+
}), [
|
|
79
|
+
p,
|
|
80
|
+
t
|
|
81
|
+
]), g = s && i && !r, E = (I) => {
|
|
82
|
+
I.preventDefault(), d(!r);
|
|
83
|
+
};
|
|
84
|
+
if (y)
|
|
85
|
+
return /* @__PURE__ */ a(h, {
|
|
86
|
+
children: e
|
|
87
|
+
});
|
|
88
|
+
let o;
|
|
89
|
+
i ? r ? o = e : o = f : o = e;
|
|
90
|
+
const A = s ? u(e) : !1;
|
|
91
|
+
return /* @__PURE__ */ S("span", {
|
|
92
|
+
style: {
|
|
93
|
+
wordBreak: "break-word"
|
|
94
|
+
},
|
|
95
|
+
"data-testid": "truncate-root",
|
|
96
|
+
"aria-expanded": i ? r : void 0,
|
|
97
|
+
children: [
|
|
98
|
+
o,
|
|
99
|
+
i && /* @__PURE__ */ a(C, {
|
|
100
|
+
mode: n,
|
|
101
|
+
focusMode: c,
|
|
102
|
+
className: !(s && r && A) ? "ml-2" : void 0,
|
|
103
|
+
size: "small",
|
|
104
|
+
onClick: E,
|
|
105
|
+
"aria-label": r ? "Show less" : "Show more",
|
|
106
|
+
children: r ? "less..." : "more..."
|
|
107
|
+
})
|
|
108
|
+
]
|
|
109
|
+
});
|
|
110
|
+
}, F = ({ content: e }) => {
|
|
111
|
+
const [t, n] = x();
|
|
112
|
+
return b(() => {
|
|
113
|
+
e && n(e);
|
|
114
|
+
}, [e, n]), /* @__PURE__ */ a(
|
|
115
|
+
w,
|
|
116
|
+
{
|
|
117
|
+
gradient: "light",
|
|
118
|
+
tail: !0,
|
|
119
|
+
copyToClipboardMode: "dark",
|
|
120
|
+
copyToClipboardFocusMode: "light",
|
|
121
|
+
copyToClipboard: e,
|
|
122
|
+
kind: "right",
|
|
123
|
+
className: "mt-3",
|
|
124
|
+
contentClassName: "prose prose-lighter prose-p:only:my-0",
|
|
125
|
+
children: /* @__PURE__ */ a(H, { mode: "light", focusMode: "light", enableRichTruncation: !0, children: t })
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
};
|
|
129
|
+
export {
|
|
130
|
+
F as default
|
|
131
|
+
};
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { jsxs as m, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { f as p, h as u, INFINITE_SCROLL_THRESHOLD as b, CARDS as D, pluralize as T, ButtonIcon as d, IconRestore as y, IconStarInCircle as U, IconStarInCircleLight as z, IconDelete as P, numberFormatter as L, k as _, IconGoogleGemini as G, IconOpenAI as $, IconAnthropic as B, isProbablyMobile as W, z as Y, Z as H, E as K } from "./index.BcYESdDV.js";
|
|
3
|
+
import { Tooltip as h } from "./App.CusyBC2e.js";
|
|
4
|
+
import l from "clsx";
|
|
5
|
+
import { Fragment as F } from "react";
|
|
6
|
+
import { W as V, j, G as x, H as Z, M as n, F as N } from "./Table.DBfFG7qO.js";
|
|
7
|
+
const q = {
|
|
8
|
+
[K]: B,
|
|
9
|
+
[H]: $,
|
|
10
|
+
[Y]: G
|
|
11
|
+
}, s = {
|
|
12
|
+
ROW: "row",
|
|
13
|
+
TIMESTAMP: p,
|
|
14
|
+
SUMMARY: "summary",
|
|
15
|
+
PROVIDER: "provider",
|
|
16
|
+
TOKEN_USAGE: u,
|
|
17
|
+
ACTIONS: "actions"
|
|
18
|
+
}, J = [
|
|
19
|
+
s.ROW,
|
|
20
|
+
s.TIMESTAMP,
|
|
21
|
+
s.SUMMARY,
|
|
22
|
+
s.ACTIONS
|
|
23
|
+
], Q = [
|
|
24
|
+
s.ROW,
|
|
25
|
+
s.SUMMARY,
|
|
26
|
+
s.TIMESTAMP,
|
|
27
|
+
s.TOKEN_USAGE,
|
|
28
|
+
s.PROVIDER,
|
|
29
|
+
s.ACTIONS
|
|
30
|
+
], le = ({
|
|
31
|
+
filteredHistory: c,
|
|
32
|
+
historyState: o,
|
|
33
|
+
lastEntryToLoad: g,
|
|
34
|
+
onClickSort: C,
|
|
35
|
+
onClickRestore: R,
|
|
36
|
+
onClickDelete: S,
|
|
37
|
+
onClickFavorite: O,
|
|
38
|
+
infinityScrollMarkerRef: A,
|
|
39
|
+
isLoading: I = !1,
|
|
40
|
+
totalHistoryCount: E,
|
|
41
|
+
isFiltered: v = !1
|
|
42
|
+
}) => {
|
|
43
|
+
const M = W() ? J : Q, w = (t) => {
|
|
44
|
+
switch (t) {
|
|
45
|
+
case s.ROW:
|
|
46
|
+
return /* @__PURE__ */ e(n, { className: "sr-only", children: "Row" }, t);
|
|
47
|
+
case s.TIMESTAMP:
|
|
48
|
+
return /* @__PURE__ */ e(
|
|
49
|
+
N,
|
|
50
|
+
{
|
|
51
|
+
focusMode: "system",
|
|
52
|
+
buttonClassName: "text-xs sm:text-sm",
|
|
53
|
+
cellId: p,
|
|
54
|
+
align: "left",
|
|
55
|
+
sortDirection: o.sortDirection,
|
|
56
|
+
sortedCell: o.sortedCell,
|
|
57
|
+
onClick: () => {
|
|
58
|
+
C(p);
|
|
59
|
+
},
|
|
60
|
+
children: "Date"
|
|
61
|
+
},
|
|
62
|
+
t
|
|
63
|
+
);
|
|
64
|
+
case s.SUMMARY:
|
|
65
|
+
return /* @__PURE__ */ e(n, { className: "text-xs sm:text-sm", children: "Summary" }, t);
|
|
66
|
+
case s.PROVIDER:
|
|
67
|
+
return /* @__PURE__ */ e(n, { className: "text-xs sm:text-sm", children: "Provider" }, t);
|
|
68
|
+
case s.TOKEN_USAGE:
|
|
69
|
+
return /* @__PURE__ */ e(
|
|
70
|
+
N,
|
|
71
|
+
{
|
|
72
|
+
focusMode: "system",
|
|
73
|
+
buttonClassName: "text-xs sm:text-sm",
|
|
74
|
+
cellId: u,
|
|
75
|
+
align: "right",
|
|
76
|
+
sortDirection: o.sortDirection,
|
|
77
|
+
sortedCell: o.sortedCell,
|
|
78
|
+
onClick: () => {
|
|
79
|
+
C(u);
|
|
80
|
+
},
|
|
81
|
+
children: "Tokens"
|
|
82
|
+
},
|
|
83
|
+
t
|
|
84
|
+
);
|
|
85
|
+
case s.ACTIONS:
|
|
86
|
+
return /* @__PURE__ */ e(n, { className: "text-xs sm:text-sm text-right", children: "Actions" }, t);
|
|
87
|
+
default:
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
}, k = (t, r, i) => {
|
|
91
|
+
switch (t) {
|
|
92
|
+
case s.ROW:
|
|
93
|
+
return /* @__PURE__ */ e(n, { children: i + 1 }, t);
|
|
94
|
+
case s.TIMESTAMP:
|
|
95
|
+
return /* @__PURE__ */ e(
|
|
96
|
+
n,
|
|
97
|
+
{
|
|
98
|
+
component: "th",
|
|
99
|
+
scope: "row",
|
|
100
|
+
className: l(
|
|
101
|
+
"dark:text-gray-400",
|
|
102
|
+
"sm:whitespace-nowrap text-xs sm:text-sm max-w-20 sm:max-w-none"
|
|
103
|
+
),
|
|
104
|
+
children: r.timestamp.split(",")[0]
|
|
105
|
+
},
|
|
106
|
+
t
|
|
107
|
+
);
|
|
108
|
+
case s.SUMMARY: {
|
|
109
|
+
const a = r.summary || (r.messages.length > 0 ? r.messages[0]?.content : "");
|
|
110
|
+
return /* @__PURE__ */ e(
|
|
111
|
+
n,
|
|
112
|
+
{
|
|
113
|
+
className: l(
|
|
114
|
+
"dark:text-white",
|
|
115
|
+
"max-w-[100px] sm:max-w-full text-xs sm:text-sm"
|
|
116
|
+
),
|
|
117
|
+
style: {
|
|
118
|
+
wordBreak: "break-word"
|
|
119
|
+
},
|
|
120
|
+
children: a
|
|
121
|
+
},
|
|
122
|
+
t
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
case s.PROVIDER: {
|
|
126
|
+
const a = r.model ? _(r.model) : null, f = a ? q[a] : null;
|
|
127
|
+
return /* @__PURE__ */ e(
|
|
128
|
+
n,
|
|
129
|
+
{
|
|
130
|
+
component: "th",
|
|
131
|
+
scope: "row",
|
|
132
|
+
className: l("dark:text-gray-400"),
|
|
133
|
+
align: "center",
|
|
134
|
+
children: f ? /* @__PURE__ */ e(
|
|
135
|
+
f,
|
|
136
|
+
{
|
|
137
|
+
size: "size-4 sm:size-5",
|
|
138
|
+
semantic: !0,
|
|
139
|
+
title: r.model || a
|
|
140
|
+
}
|
|
141
|
+
) : null
|
|
142
|
+
},
|
|
143
|
+
t
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
case s.TOKEN_USAGE:
|
|
147
|
+
return /* @__PURE__ */ e(
|
|
148
|
+
n,
|
|
149
|
+
{
|
|
150
|
+
className: l("dark:text-gray-400", "text-xs sm:text-sm"),
|
|
151
|
+
align: "right",
|
|
152
|
+
children: r.tokenUsage ? L.format(r.tokenUsage) : "0"
|
|
153
|
+
},
|
|
154
|
+
t
|
|
155
|
+
);
|
|
156
|
+
case s.ACTIONS:
|
|
157
|
+
return /* @__PURE__ */ e(n, { children: /* @__PURE__ */ m("div", { className: "flex flex-col items-end sm:flex-row gap-2", children: [
|
|
158
|
+
/* @__PURE__ */ e(
|
|
159
|
+
h,
|
|
160
|
+
{
|
|
161
|
+
label: "Restore chat",
|
|
162
|
+
placement: "top",
|
|
163
|
+
trigger: /* @__PURE__ */ e(
|
|
164
|
+
d,
|
|
165
|
+
{
|
|
166
|
+
noBorder: !0,
|
|
167
|
+
label: "Restore chat",
|
|
168
|
+
variant: "primary",
|
|
169
|
+
iconClassName: "text-green-800 dark:text-green-500",
|
|
170
|
+
onClick: async () => {
|
|
171
|
+
await R(r);
|
|
172
|
+
},
|
|
173
|
+
children: /* @__PURE__ */ e(y, { size: "size-3", monotone: !0 })
|
|
174
|
+
}
|
|
175
|
+
)
|
|
176
|
+
}
|
|
177
|
+
),
|
|
178
|
+
/* @__PURE__ */ e(
|
|
179
|
+
h,
|
|
180
|
+
{
|
|
181
|
+
label: r.favoriteChat ? "Remove from favorites" : "Add to favorites",
|
|
182
|
+
placement: "top",
|
|
183
|
+
trigger: /* @__PURE__ */ e(
|
|
184
|
+
d,
|
|
185
|
+
{
|
|
186
|
+
noBorder: !0,
|
|
187
|
+
label: r.favoriteChat ? "Remove from favorites" : "Add to favorites",
|
|
188
|
+
variant: "primary",
|
|
189
|
+
onClick: async () => {
|
|
190
|
+
await O(r);
|
|
191
|
+
},
|
|
192
|
+
children: r.favoriteChat ? /* @__PURE__ */ e(U, { size: "size-4", monotone: !0 }) : /* @__PURE__ */ e(z, { size: "size-4", monotone: !0 })
|
|
193
|
+
}
|
|
194
|
+
)
|
|
195
|
+
}
|
|
196
|
+
),
|
|
197
|
+
/* @__PURE__ */ e(
|
|
198
|
+
h,
|
|
199
|
+
{
|
|
200
|
+
label: "Delete chat",
|
|
201
|
+
placement: "top",
|
|
202
|
+
trigger: /* @__PURE__ */ e(
|
|
203
|
+
d,
|
|
204
|
+
{
|
|
205
|
+
noBorder: !0,
|
|
206
|
+
label: "Delete chat",
|
|
207
|
+
variant: "primary",
|
|
208
|
+
iconClassName: "text-red-700 dark:text-red-500",
|
|
209
|
+
onClick: () => {
|
|
210
|
+
S(r);
|
|
211
|
+
},
|
|
212
|
+
children: /* @__PURE__ */ e(P, { size: "size-3", monotone: !0 })
|
|
213
|
+
}
|
|
214
|
+
)
|
|
215
|
+
}
|
|
216
|
+
)
|
|
217
|
+
] }) }, t);
|
|
218
|
+
default:
|
|
219
|
+
return null;
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
return /* @__PURE__ */ m(V, { stickyHeader: !0, compact: !0, mode: "alt-system", caption: (() => {
|
|
223
|
+
const t = c.length, r = E ?? t;
|
|
224
|
+
return v && r > t ? `Showing ${T(`${t} chat`, t)} out of ${r}` : T(`${t} chat`, t);
|
|
225
|
+
})(), children: [
|
|
226
|
+
/* @__PURE__ */ e(j, { children: /* @__PURE__ */ e(x, { children: M.map((t) => w(t)) }) }),
|
|
227
|
+
/* @__PURE__ */ e(Z, { children: I && c.length === 0 ? /* @__PURE__ */ e(x, { children: /* @__PURE__ */ e(n, { colSpan: 1e3, children: /* @__PURE__ */ e("div", { children: "Loading..." }) }) }) : c.slice(0, g).map((t, r) => t?.messages?.length > 0 ? /* @__PURE__ */ m(F, { children: [
|
|
228
|
+
r === g - b && /* @__PURE__ */ e("tr", { ref: A }),
|
|
229
|
+
/* @__PURE__ */ e(x, { children: M.map(
|
|
230
|
+
(i) => k(i, t, r)
|
|
231
|
+
) })
|
|
232
|
+
] }, `${D.HISTORY.TITLE}-${t.id}-${r}`) : null) })
|
|
233
|
+
] });
|
|
234
|
+
};
|
|
235
|
+
export {
|
|
236
|
+
le as ChatHistoryTable
|
|
237
|
+
};
|