@versini/sassysaint 8.81.1 → 8.83.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.C1wdrYSy.js → AboutChangelog.Dnae3ZET.js} +3 -3
- package/dist/chunks/{AboutEntry.BBP0FMsE.js → AboutEntry.DaKcxQlb.js} +7 -7
- package/dist/chunks/{App.DXUu7noN.js → App.CfJzwyx5.js} +380 -389
- package/dist/chunks/{Chart.BU6Zc5b7.js → Chart.CmXf5ahL.js} +2 -2
- package/dist/chunks/{ChatBubbleAssistant.D-RvTGFO.js → ChatBubbleAssistant.rQ0E9CSF.js} +4 -4
- package/dist/chunks/{ChatBubbleUser.BneldyFS.js → ChatBubbleUser.iSkDnxmM.js} +3 -3
- package/dist/chunks/ChatHistoryTable.3HSGoZd4.js +215 -0
- package/dist/chunks/HistoryEntry.4IXWZ8qq.js +298 -0
- package/dist/chunks/{ProfileEntry.COb4Ix5z.js → ProfileEntry.Chfyj-dQ.js} +2 -2
- package/dist/chunks/{SettingsEntry.BVpLsSfw.js → SettingsEntry.SAurNjp0.js} +3 -3
- package/dist/chunks/{UsageEntry.P4bknnZZ.js → UsageEntry.DPp3sbic.js} +3 -3
- package/dist/chunks/{UserMemoriesPanel.CvpKKLRV.js → UserMemoriesPanel.DiSRjoNR.js} +4 -4
- package/dist/chunks/{index.BlptHNvh.js → index.9ZW-D7id.js} +1 -1
- package/dist/chunks/{index.BD8hmCW6.js → index.B6gxiXab.js} +1 -1
- package/dist/chunks/{index.8j5Dq4sI.js → index.BQXkk0E7.js} +984 -989
- package/dist/chunks/{index.qjNo6KZO.js → index.CoVeibJJ.js} +1 -1
- package/dist/chunks/{index.DClQQbmr.js → index.D4xbtPpm.js} +3 -3
- package/dist/chunks/{index.BYK-C5Zz.js → index.DNDgXAMw.js} +2 -2
- package/dist/chunks/{index.BjkO_ONr.js → index.HO-K8Z3S.js} +1 -1
- package/dist/chunks/{index.BPUn0gZ3.js → index.ZpurL-_2.js} +1 -1
- package/dist/chunks/{index.BKDGy5qf.js → index.iKl0E1mP.js} +1 -1
- package/dist/chunks/{useMarkdown.Cw4b4qiL.js → useMarkdown.D1WsA7gy.js} +6 -6
- package/dist/components/SassySaint/SassySaint.js +1 -1
- package/dist/index.js +4 -4
- package/dist/style.css +1 -1
- package/package.json +3 -3
- package/dist/chunks/ChatHistoryTable.CZe2E7YV.js +0 -237
- package/dist/chunks/HistoryEntry.wQYZDKWF.js +0 -316
|
@@ -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.CfJzwyx5.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.BQXkk0E7.js";
|
|
5
5
|
var ls = { exports: {} }, Ip = ls.exports, on;
|
|
6
6
|
function Dp() {
|
|
7
7
|
return on || (on = 1, (function(we, he) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as x } from "react/jsx-runtime";
|
|
2
|
-
import { ChatContext as P, AppContext as R, n as y, useUserPreferences as L, convertCamelCaseToReadable as _, numberFormatter as v, pluralize as B, Q as G } from "./index.
|
|
3
|
-
import { BUBBLE_FOOTER_EMPTY as D } from "./index.
|
|
2
|
+
import { ChatContext as P, AppContext as R, n as y, useUserPreferences as L, convertCamelCaseToReadable as _, numberFormatter as v, pluralize as B, Q as G } from "./index.BQXkk0E7.js";
|
|
3
|
+
import { BUBBLE_FOOTER_EMPTY as D } from "./index.HO-K8Z3S.js";
|
|
4
4
|
import U from "clsx";
|
|
5
5
|
import j, { useState as M, useRef as E, useEffect as F, useContext as S } from "react";
|
|
6
|
-
import { AsyncBubble as k } from "./App.
|
|
7
|
-
import { useMarkdown as q } from "./useMarkdown.
|
|
6
|
+
import { AsyncBubble as k } from "./App.CfJzwyx5.js";
|
|
7
|
+
import { useMarkdown as q } from "./useMarkdown.D1WsA7gy.js";
|
|
8
8
|
const I = 2, W = I * 1e3, b = "", V = (e) => e * (2 - e);
|
|
9
9
|
function Y(e, n = !0) {
|
|
10
10
|
const [a, d] = M(0), [i, p] = M(0), [t, C] = M(e), r = E(0), s = E(0);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as a, Fragment as h, jsxs as S } from "react/jsx-runtime";
|
|
2
|
-
import { Button as C } from "./index.
|
|
2
|
+
import { Button as C } from "./index.BQXkk0E7.js";
|
|
3
3
|
import { useState as _, useMemo as m, isValidElement as T, useEffect as b } from "react";
|
|
4
|
-
import { AsyncBubble as w } from "./App.
|
|
5
|
-
import { useMarkdown as x } from "./useMarkdown.
|
|
4
|
+
import { AsyncBubble as w } from "./App.CfJzwyx5.js";
|
|
5
|
+
import { useMarkdown as x } from "./useMarkdown.D1WsA7gy.js";
|
|
6
6
|
/*!
|
|
7
7
|
@versini/ui-truncate v5.2.0
|
|
8
8
|
© 2025 gizmette.com
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { f as x, h as u, INFINITE_SCROLL_THRESHOLD as v, CARDS as I, pluralize as f, ButtonIcon as i, IconRestore as U, IconStarInCircle as y, IconStarInCircleLight as D, IconDelete as z, numberFormatter as L, isProbablyMobile as _ } from "./index.BQXkk0E7.js";
|
|
3
|
+
import { W as P, j as $, G as m, H as B, M as a, F as M } from "./index.ZpurL-_2.js";
|
|
4
|
+
import { Tooltip as d } from "./App.CfJzwyx5.js";
|
|
5
|
+
import h from "clsx";
|
|
6
|
+
import { Fragment as W } from "react";
|
|
7
|
+
const s = {
|
|
8
|
+
ROW: "row",
|
|
9
|
+
TIMESTAMP: x,
|
|
10
|
+
SUMMARY: "summary",
|
|
11
|
+
TOKEN_USAGE: u,
|
|
12
|
+
ACTIONS: "actions"
|
|
13
|
+
}, Y = [
|
|
14
|
+
s.ROW,
|
|
15
|
+
s.TIMESTAMP,
|
|
16
|
+
s.SUMMARY,
|
|
17
|
+
s.ACTIONS
|
|
18
|
+
], G = [
|
|
19
|
+
s.ROW,
|
|
20
|
+
s.SUMMARY,
|
|
21
|
+
s.TIMESTAMP,
|
|
22
|
+
s.TOKEN_USAGE,
|
|
23
|
+
s.ACTIONS
|
|
24
|
+
], X = ({
|
|
25
|
+
filteredHistory: n,
|
|
26
|
+
historyState: o,
|
|
27
|
+
lastEntryToLoad: p,
|
|
28
|
+
onClickSort: g,
|
|
29
|
+
onClickRestore: T,
|
|
30
|
+
onClickDelete: S,
|
|
31
|
+
onClickFavorite: N,
|
|
32
|
+
infinityScrollMarkerRef: A,
|
|
33
|
+
isLoading: O = !1,
|
|
34
|
+
totalHistoryCount: b,
|
|
35
|
+
isFiltered: R = !1
|
|
36
|
+
}) => {
|
|
37
|
+
const C = _() ? Y : G, w = (t) => {
|
|
38
|
+
switch (t) {
|
|
39
|
+
case s.ROW:
|
|
40
|
+
return /* @__PURE__ */ e(a, { className: "sr-only", children: "Row" }, t);
|
|
41
|
+
case s.TIMESTAMP:
|
|
42
|
+
return /* @__PURE__ */ e(
|
|
43
|
+
M,
|
|
44
|
+
{
|
|
45
|
+
focusMode: "system",
|
|
46
|
+
buttonClassName: "text-xs sm:text-sm",
|
|
47
|
+
cellId: x,
|
|
48
|
+
align: "left",
|
|
49
|
+
sortDirection: o.sortDirection,
|
|
50
|
+
sortedCell: o.sortedCell,
|
|
51
|
+
onClick: () => {
|
|
52
|
+
g(x);
|
|
53
|
+
},
|
|
54
|
+
children: "Date"
|
|
55
|
+
},
|
|
56
|
+
t
|
|
57
|
+
);
|
|
58
|
+
case s.SUMMARY:
|
|
59
|
+
return /* @__PURE__ */ e(a, { className: "text-xs sm:text-sm", children: "Summary" }, t);
|
|
60
|
+
case s.TOKEN_USAGE:
|
|
61
|
+
return /* @__PURE__ */ e(
|
|
62
|
+
M,
|
|
63
|
+
{
|
|
64
|
+
focusMode: "system",
|
|
65
|
+
buttonClassName: "text-xs sm:text-sm",
|
|
66
|
+
cellId: u,
|
|
67
|
+
align: "right",
|
|
68
|
+
sortDirection: o.sortDirection,
|
|
69
|
+
sortedCell: o.sortedCell,
|
|
70
|
+
onClick: () => {
|
|
71
|
+
g(u);
|
|
72
|
+
},
|
|
73
|
+
children: "Tokens"
|
|
74
|
+
},
|
|
75
|
+
t
|
|
76
|
+
);
|
|
77
|
+
case s.ACTIONS:
|
|
78
|
+
return /* @__PURE__ */ e(a, { className: "text-xs sm:text-sm text-right", children: "Actions" }, t);
|
|
79
|
+
default:
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
}, k = (t, r, l) => {
|
|
83
|
+
switch (t) {
|
|
84
|
+
case s.ROW:
|
|
85
|
+
return /* @__PURE__ */ e(a, { children: l + 1 }, t);
|
|
86
|
+
case s.TIMESTAMP:
|
|
87
|
+
return /* @__PURE__ */ e(
|
|
88
|
+
a,
|
|
89
|
+
{
|
|
90
|
+
component: "th",
|
|
91
|
+
scope: "row",
|
|
92
|
+
className: h(
|
|
93
|
+
"dark:text-gray-400",
|
|
94
|
+
"sm:whitespace-nowrap text-xs sm:text-sm max-w-20 sm:max-w-none"
|
|
95
|
+
),
|
|
96
|
+
children: r.timestamp.split(",")[0]
|
|
97
|
+
},
|
|
98
|
+
t
|
|
99
|
+
);
|
|
100
|
+
case s.SUMMARY: {
|
|
101
|
+
const E = r.summary || (r.messages.length > 0 ? r.messages[0]?.content : "");
|
|
102
|
+
return /* @__PURE__ */ e(
|
|
103
|
+
a,
|
|
104
|
+
{
|
|
105
|
+
className: h(
|
|
106
|
+
"dark:text-white",
|
|
107
|
+
"max-w-[100px] sm:max-w-full text-xs sm:text-sm"
|
|
108
|
+
),
|
|
109
|
+
style: {
|
|
110
|
+
wordBreak: "break-word"
|
|
111
|
+
},
|
|
112
|
+
children: E
|
|
113
|
+
},
|
|
114
|
+
t
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
case s.TOKEN_USAGE:
|
|
118
|
+
return /* @__PURE__ */ e(
|
|
119
|
+
a,
|
|
120
|
+
{
|
|
121
|
+
className: h("dark:text-gray-400", "text-xs sm:text-sm"),
|
|
122
|
+
align: "right",
|
|
123
|
+
children: r.tokenUsage ? L.format(r.tokenUsage) : "0"
|
|
124
|
+
},
|
|
125
|
+
t
|
|
126
|
+
);
|
|
127
|
+
case s.ACTIONS:
|
|
128
|
+
return /* @__PURE__ */ e(
|
|
129
|
+
a,
|
|
130
|
+
{
|
|
131
|
+
className: "border-l border-table-light dark:border-table-dark",
|
|
132
|
+
children: /* @__PURE__ */ c("div", { className: "flex flex-col items-end sm:flex-row gap-2", children: [
|
|
133
|
+
/* @__PURE__ */ e(
|
|
134
|
+
d,
|
|
135
|
+
{
|
|
136
|
+
label: "Restore chat",
|
|
137
|
+
placement: "top",
|
|
138
|
+
trigger: /* @__PURE__ */ e(
|
|
139
|
+
i,
|
|
140
|
+
{
|
|
141
|
+
noBorder: !0,
|
|
142
|
+
label: "Restore chat",
|
|
143
|
+
variant: "primary",
|
|
144
|
+
iconClassName: "text-green-800 dark:text-green-500",
|
|
145
|
+
onClick: async () => {
|
|
146
|
+
await T(r);
|
|
147
|
+
},
|
|
148
|
+
children: /* @__PURE__ */ e(U, { size: "size-3", monotone: !0 })
|
|
149
|
+
}
|
|
150
|
+
)
|
|
151
|
+
}
|
|
152
|
+
),
|
|
153
|
+
/* @__PURE__ */ e(
|
|
154
|
+
d,
|
|
155
|
+
{
|
|
156
|
+
label: r.favoriteChat ? "Remove from favorites" : "Add to favorites",
|
|
157
|
+
placement: "top",
|
|
158
|
+
trigger: /* @__PURE__ */ e(
|
|
159
|
+
i,
|
|
160
|
+
{
|
|
161
|
+
noBorder: !0,
|
|
162
|
+
label: r.favoriteChat ? "Remove from favorites" : "Add to favorites",
|
|
163
|
+
variant: "primary",
|
|
164
|
+
onClick: async () => {
|
|
165
|
+
await N(r);
|
|
166
|
+
},
|
|
167
|
+
children: r.favoriteChat ? /* @__PURE__ */ e(y, { size: "size-4", monotone: !0 }) : /* @__PURE__ */ e(D, { size: "size-4", monotone: !0 })
|
|
168
|
+
}
|
|
169
|
+
)
|
|
170
|
+
}
|
|
171
|
+
),
|
|
172
|
+
/* @__PURE__ */ e(
|
|
173
|
+
d,
|
|
174
|
+
{
|
|
175
|
+
label: "Delete chat",
|
|
176
|
+
placement: "top",
|
|
177
|
+
trigger: /* @__PURE__ */ e(
|
|
178
|
+
i,
|
|
179
|
+
{
|
|
180
|
+
noBorder: !0,
|
|
181
|
+
label: "Delete chat",
|
|
182
|
+
variant: "primary",
|
|
183
|
+
iconClassName: "text-red-700 dark:text-red-500",
|
|
184
|
+
onClick: () => {
|
|
185
|
+
S(r);
|
|
186
|
+
},
|
|
187
|
+
children: /* @__PURE__ */ e(z, { size: "size-3", monotone: !0 })
|
|
188
|
+
}
|
|
189
|
+
)
|
|
190
|
+
}
|
|
191
|
+
)
|
|
192
|
+
] })
|
|
193
|
+
},
|
|
194
|
+
t
|
|
195
|
+
);
|
|
196
|
+
default:
|
|
197
|
+
return null;
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
return /* @__PURE__ */ c(P, { stickyHeader: !0, compact: !0, mode: "alt-system", caption: (() => {
|
|
201
|
+
const t = n.length, r = b ?? t;
|
|
202
|
+
return R && r > t ? `Showing ${f(`${t} chat`, t)} out of ${r}` : f(`${t} chat`, t);
|
|
203
|
+
})(), children: [
|
|
204
|
+
/* @__PURE__ */ e($, { children: /* @__PURE__ */ e(m, { children: C.map((t) => w(t)) }) }),
|
|
205
|
+
/* @__PURE__ */ e(B, { children: O && n.length === 0 ? /* @__PURE__ */ e(m, { children: /* @__PURE__ */ e(a, { colSpan: 1e3, children: /* @__PURE__ */ e("div", { children: "Loading..." }) }) }) : n.slice(0, p).map((t, r) => t?.messages?.length > 0 ? /* @__PURE__ */ c(W, { children: [
|
|
206
|
+
r === p - v && /* @__PURE__ */ e("tr", { ref: A }),
|
|
207
|
+
/* @__PURE__ */ e(m, { children: C.map(
|
|
208
|
+
(l) => k(l, t, r)
|
|
209
|
+
) })
|
|
210
|
+
] }, `${I.HISTORY.TITLE}-${t.id}-${r}`) : null) })
|
|
211
|
+
] });
|
|
212
|
+
};
|
|
213
|
+
export {
|
|
214
|
+
X as ChatHistoryTable
|
|
215
|
+
};
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import { jsxs as c, Fragment as $, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { n as P, INFINITE_SCROLL_LIMIT as G, INFINITE_SCROLL_THRESHOLD as ee, HistoryContext as V, ChatContext as te, useLocalStorage as f, LOCAL_STORAGE_PREFIX as y, LOCAL_STORAGE_SORT_TIMESTAMP as ae, e as h, LOCAL_STORAGE_SORT_TOKEN_USAGE as re, LOCAL_STORAGE_SORT as se, f as v, useDeleteChat as oe, useToggleFavoriteChat as ne, APP_CLASSNAME as ie, TOAST_CHAT_DELETED as ce, graphQLRequest as le, SERVICE_TYPES as de, ACTION_SORT as he, h as me, useChatsHistory as ue, useUserChatStats as Ce, LOCAL_STORAGE_SEARCH as Se, LOCAL_STORAGE_FAVORITES_ONLY as fe, HISTORY_TITLE as ye, Card as pe, TextInput as Te, debounce as ge, IconSearch as Ae, Button as Ee, ACTION_SEARCH as De } from "./index.BQXkk0E7.js";
|
|
3
|
+
import { useAiChat as _e, ConfirmationPanel as Oe, LazyToastContainerWrapper as Le, showErrorToast as ve, CHAT_SET_STATUS as ke, Panel as Re, Toggle as Ie } from "./App.CfJzwyx5.js";
|
|
4
|
+
import { useRef as N, useState as H, useContext as w, useCallback as M, Suspense as be, lazy as xe, useEffect as Ne } from "react";
|
|
5
|
+
const He = xe(
|
|
6
|
+
() => import(
|
|
7
|
+
/* webpackChunkName: "history-table" */
|
|
8
|
+
"./ChatHistoryTable.3HSGoZd4.js"
|
|
9
|
+
).then((m) => ({ default: m.ChatHistoryTable }))
|
|
10
|
+
), we = ({
|
|
11
|
+
filteredHistory: m,
|
|
12
|
+
onOpenChange: p,
|
|
13
|
+
mutate: C,
|
|
14
|
+
isLoading: T = !1,
|
|
15
|
+
totalHistoryCount: k,
|
|
16
|
+
isFiltered: g = !1
|
|
17
|
+
}) => {
|
|
18
|
+
const { user: l, getAccessToken: s } = P(), S = N(null), n = N({
|
|
19
|
+
id: "",
|
|
20
|
+
timestamp: "",
|
|
21
|
+
message: ""
|
|
22
|
+
}), [A, E] = H(!1), [D, d] = H(
|
|
23
|
+
G + ee
|
|
24
|
+
), { state: i, dispatch: R } = w(V), u = {
|
|
25
|
+
searchString: i.searchString || "",
|
|
26
|
+
sortDirection: i.sortDirection || h.DESC,
|
|
27
|
+
sortedCell: i.sortedCell || v
|
|
28
|
+
}, {
|
|
29
|
+
setChatId: I,
|
|
30
|
+
setInitialMessages: _,
|
|
31
|
+
dispatch: b
|
|
32
|
+
} = w(te), { setInput: x } = _e(), [O, a] = f({
|
|
33
|
+
key: y + ae,
|
|
34
|
+
initialValue: h.DESC
|
|
35
|
+
}), [U, B] = f({
|
|
36
|
+
key: y + re,
|
|
37
|
+
initialValue: h.ASC
|
|
38
|
+
}), [, j] = f({
|
|
39
|
+
key: y + se,
|
|
40
|
+
initialValue: v
|
|
41
|
+
}), { mutateAsync: Y } = oe({ getAccessToken: s }), { mutateAsync: q } = ne({
|
|
42
|
+
getAccessToken: s
|
|
43
|
+
}), K = (e) => {
|
|
44
|
+
const o = i.sortedCell === e;
|
|
45
|
+
let r, L;
|
|
46
|
+
switch (e) {
|
|
47
|
+
case v:
|
|
48
|
+
L = a, r = o ? i.sortDirection : O;
|
|
49
|
+
break;
|
|
50
|
+
case me:
|
|
51
|
+
L = B, r = o ? i.sortDirection : U;
|
|
52
|
+
break;
|
|
53
|
+
default:
|
|
54
|
+
L = a, r = o ? i.sortDirection : O;
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
const z = r === h.ASC ? h.DESC : h.ASC;
|
|
58
|
+
L(z), j(e), R({
|
|
59
|
+
type: he,
|
|
60
|
+
payload: {
|
|
61
|
+
sortedCell: e,
|
|
62
|
+
sortDirection: z
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}, Q = async () => {
|
|
66
|
+
const e = n.current;
|
|
67
|
+
try {
|
|
68
|
+
await Y({
|
|
69
|
+
userId: l?.username || "",
|
|
70
|
+
id: e.id
|
|
71
|
+
}), C(""), await ve(ce, {
|
|
72
|
+
autoClose: 2e3,
|
|
73
|
+
containerId: "history-table"
|
|
74
|
+
});
|
|
75
|
+
} catch {
|
|
76
|
+
}
|
|
77
|
+
}, W = async (e) => {
|
|
78
|
+
try {
|
|
79
|
+
const o = await s(), r = await le({
|
|
80
|
+
accessToken: o,
|
|
81
|
+
type: de.GET_CHAT,
|
|
82
|
+
params: {
|
|
83
|
+
id: e.id
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
b({
|
|
87
|
+
type: ke,
|
|
88
|
+
payload: {
|
|
89
|
+
streaming: !1,
|
|
90
|
+
loading: !1,
|
|
91
|
+
restoring: !0,
|
|
92
|
+
restoredModel: r.data?.model || "",
|
|
93
|
+
restoredUsage: r.data?.tokenUsage || 0
|
|
94
|
+
}
|
|
95
|
+
}), x(""), I(e.id), _(r.data.messages), p(!1);
|
|
96
|
+
} catch {
|
|
97
|
+
}
|
|
98
|
+
}, X = (e) => {
|
|
99
|
+
n.current = {
|
|
100
|
+
id: e.id,
|
|
101
|
+
timestamp: e.timestamp,
|
|
102
|
+
message: e.messages.length > 0 ? e.messages[0]?.content : ""
|
|
103
|
+
}, E(!A);
|
|
104
|
+
}, J = async (e) => {
|
|
105
|
+
try {
|
|
106
|
+
await q({
|
|
107
|
+
userId: l?.username || "",
|
|
108
|
+
id: e.id
|
|
109
|
+
}), C("");
|
|
110
|
+
} catch {
|
|
111
|
+
}
|
|
112
|
+
}, F = M((e) => {
|
|
113
|
+
e[0].isIntersecting && d((r) => r + G);
|
|
114
|
+
}, []), Z = M(
|
|
115
|
+
(e) => {
|
|
116
|
+
if (S.current && S.current.disconnect(), e) {
|
|
117
|
+
const o = {
|
|
118
|
+
rootMargin: "20px"
|
|
119
|
+
}, r = new IntersectionObserver(F, o);
|
|
120
|
+
r.observe(e), S.current = r;
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
[F]
|
|
124
|
+
);
|
|
125
|
+
return /* @__PURE__ */ c($, { children: [
|
|
126
|
+
/* @__PURE__ */ c(
|
|
127
|
+
Oe,
|
|
128
|
+
{
|
|
129
|
+
showConfirmation: A,
|
|
130
|
+
setShowConfirmation: E,
|
|
131
|
+
action: Q,
|
|
132
|
+
customStrings: {
|
|
133
|
+
confirmAction: "Delete",
|
|
134
|
+
cancelAction: "Cancel",
|
|
135
|
+
title: "Delete chat"
|
|
136
|
+
},
|
|
137
|
+
children: [
|
|
138
|
+
/* @__PURE__ */ t("p", { className: "m-0", children: "Are you sure you want to delete the following chat:" }),
|
|
139
|
+
/* @__PURE__ */ c("ul", { className: "m-0", children: [
|
|
140
|
+
/* @__PURE__ */ c("li", { children: [
|
|
141
|
+
"Timestamp:",
|
|
142
|
+
" ",
|
|
143
|
+
/* @__PURE__ */ t("span", { className: "text-lg", children: n.current && n.current.timestamp })
|
|
144
|
+
] }),
|
|
145
|
+
/* @__PURE__ */ c("li", { children: [
|
|
146
|
+
"First message:",
|
|
147
|
+
" ",
|
|
148
|
+
/* @__PURE__ */ t("span", { className: "text-lg", children: n.current?.message })
|
|
149
|
+
] })
|
|
150
|
+
] })
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
),
|
|
154
|
+
/* @__PURE__ */ t("div", { className: ie, children: /* @__PURE__ */ t(Le, { containerId: "history-table" }) }),
|
|
155
|
+
/* @__PURE__ */ t(be, { fallback: /* @__PURE__ */ t("div", {}), children: /* @__PURE__ */ t(
|
|
156
|
+
He,
|
|
157
|
+
{
|
|
158
|
+
filteredHistory: m,
|
|
159
|
+
historyState: u,
|
|
160
|
+
lastEntryToLoad: D,
|
|
161
|
+
onClickSort: K,
|
|
162
|
+
onClickRestore: W,
|
|
163
|
+
onClickDelete: X,
|
|
164
|
+
onClickFavorite: J,
|
|
165
|
+
infinityScrollMarkerRef: Z,
|
|
166
|
+
isLoading: T,
|
|
167
|
+
totalHistoryCount: k,
|
|
168
|
+
isFiltered: g
|
|
169
|
+
}
|
|
170
|
+
) })
|
|
171
|
+
] });
|
|
172
|
+
}, Pe = ({
|
|
173
|
+
open: m,
|
|
174
|
+
onOpenChange: p
|
|
175
|
+
}) => {
|
|
176
|
+
const { getAccessToken: C, user: T } = P(), [k, g] = H([]), l = N(null), { state: s, dispatch: S } = w(V), {
|
|
177
|
+
data: n,
|
|
178
|
+
refetch: A,
|
|
179
|
+
isLoading: E,
|
|
180
|
+
isError: D
|
|
181
|
+
} = ue({
|
|
182
|
+
enabled: m,
|
|
183
|
+
user: T?.username || "",
|
|
184
|
+
searchString: s.searchString || "",
|
|
185
|
+
sortDirection: s.sortDirection || h.DESC,
|
|
186
|
+
sortedCell: s.sortedCell || v,
|
|
187
|
+
getAccessToken: C
|
|
188
|
+
}), { data: d } = Ce({
|
|
189
|
+
user: T?.username,
|
|
190
|
+
getAccessToken: C
|
|
191
|
+
}), i = d && d.totalChats ? d.totalChats - d.privateChats - d.deletedChats : 0, [, R] = f({
|
|
192
|
+
key: y + Se,
|
|
193
|
+
initialValue: s.searchString
|
|
194
|
+
}), [u, I] = f({
|
|
195
|
+
key: y + fe,
|
|
196
|
+
initialValue: !1
|
|
197
|
+
});
|
|
198
|
+
Ne(() => {
|
|
199
|
+
n && g(
|
|
200
|
+
u ? n.filter((a) => a.favoriteChat === !0) : n
|
|
201
|
+
);
|
|
202
|
+
}, [n, u]);
|
|
203
|
+
const _ = async (a) => {
|
|
204
|
+
R(a), S({
|
|
205
|
+
type: De,
|
|
206
|
+
payload: { searchString: a }
|
|
207
|
+
});
|
|
208
|
+
}, b = ge((a) => {
|
|
209
|
+
_(a.target.value.trim());
|
|
210
|
+
}, 500), x = async (a) => {
|
|
211
|
+
a.preventDefault();
|
|
212
|
+
}, O = (a) => {
|
|
213
|
+
I(a);
|
|
214
|
+
};
|
|
215
|
+
return /* @__PURE__ */ c(
|
|
216
|
+
Re,
|
|
217
|
+
{
|
|
218
|
+
open: m,
|
|
219
|
+
onOpenChange: p,
|
|
220
|
+
title: ye,
|
|
221
|
+
animation: !0,
|
|
222
|
+
animationType: "fade",
|
|
223
|
+
children: [
|
|
224
|
+
/* @__PURE__ */ t(
|
|
225
|
+
pe,
|
|
226
|
+
{
|
|
227
|
+
header: s.searchString ? "Filters applied" : "Filters",
|
|
228
|
+
className: "prose-dark dark:prose-lighter mb-4",
|
|
229
|
+
noBorder: !0,
|
|
230
|
+
compact: !0,
|
|
231
|
+
children: /* @__PURE__ */ c("form", { autoComplete: "off", onSubmit: x, children: [
|
|
232
|
+
/* @__PURE__ */ t(
|
|
233
|
+
Te,
|
|
234
|
+
{
|
|
235
|
+
placeholder: "Search",
|
|
236
|
+
labelHidden: !0,
|
|
237
|
+
noBorder: !0,
|
|
238
|
+
autoCapitalize: "off",
|
|
239
|
+
autoComplete: "off",
|
|
240
|
+
autoCorrect: "off",
|
|
241
|
+
ref: l,
|
|
242
|
+
defaultValue: s.searchString,
|
|
243
|
+
mode: "alt-system",
|
|
244
|
+
name: "Search",
|
|
245
|
+
label: "Search",
|
|
246
|
+
onChange: b,
|
|
247
|
+
className: "my-2",
|
|
248
|
+
rightElement: /* @__PURE__ */ t("div", { className: "dark:text-copy-dark text-copy-light", children: /* @__PURE__ */ t(Ae, { monotone: !0, size: "size-3" }) })
|
|
249
|
+
}
|
|
250
|
+
),
|
|
251
|
+
/* @__PURE__ */ c("div", { className: "flex flex-col justify-between sm:flex-row gap-2 sm:mb-0 mb-1", children: [
|
|
252
|
+
/* @__PURE__ */ t("div", { className: "order-1 sm:order-0", children: /* @__PURE__ */ t(
|
|
253
|
+
Ie,
|
|
254
|
+
{
|
|
255
|
+
name: "favorites-only",
|
|
256
|
+
checked: u,
|
|
257
|
+
onChange: O,
|
|
258
|
+
label: "Show favorites only",
|
|
259
|
+
narrow: !0,
|
|
260
|
+
noBorder: !0
|
|
261
|
+
}
|
|
262
|
+
) }),
|
|
263
|
+
/* @__PURE__ */ t(
|
|
264
|
+
Ee,
|
|
265
|
+
{
|
|
266
|
+
size: "small",
|
|
267
|
+
disabled: s.searchString === "",
|
|
268
|
+
onClick: () => {
|
|
269
|
+
_(""), l.current?.value && (l.current.value = "", l.current.focus());
|
|
270
|
+
},
|
|
271
|
+
children: "Reset Search"
|
|
272
|
+
}
|
|
273
|
+
)
|
|
274
|
+
] })
|
|
275
|
+
] })
|
|
276
|
+
}
|
|
277
|
+
),
|
|
278
|
+
/* @__PURE__ */ c("div", { className: "flex flex-col sm:flex-row max-h-[65vh] sm:max-h-[75vh] min-h-[60vh]", children: [
|
|
279
|
+
D && /* @__PURE__ */ t("p", { className: "m-0 text-red-500", children: "Failed to load history." }),
|
|
280
|
+
!D && /* @__PURE__ */ t(
|
|
281
|
+
we,
|
|
282
|
+
{
|
|
283
|
+
mutate: A,
|
|
284
|
+
filteredHistory: k,
|
|
285
|
+
onOpenChange: p,
|
|
286
|
+
isLoading: E,
|
|
287
|
+
totalHistoryCount: i,
|
|
288
|
+
isFiltered: !!(s.searchString || u)
|
|
289
|
+
}
|
|
290
|
+
)
|
|
291
|
+
] })
|
|
292
|
+
]
|
|
293
|
+
}
|
|
294
|
+
);
|
|
295
|
+
};
|
|
296
|
+
export {
|
|
297
|
+
Pe as HistoryPanel
|
|
298
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as t, Fragment as D, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { preloadToast as K, showSuccessToast as W, showErrorToast as Y, ConfirmationPanel as H, LazyToastContainerWrapper as $, Panel as V } from "./App.
|
|
3
|
-
import { n as q, useUniqueId as J, useUserPreferences as Q, useServerCapabilities as X, d as Z, setUserPlan as ee, Card as d, renderDataAsList as ae, CARDS as s, L as P, j as c, Button as se, it as ne, isTauri as re, ButtonIcon as te, IconPasskey as L, PROFILE_TITLE as le } from "./index.
|
|
2
|
+
import { preloadToast as K, showSuccessToast as W, showErrorToast as Y, ConfirmationPanel as H, LazyToastContainerWrapper as $, Panel as V } from "./App.CfJzwyx5.js";
|
|
3
|
+
import { n as q, useUniqueId as J, useUserPreferences as Q, useServerCapabilities as X, d as Z, setUserPlan as ee, Card as d, renderDataAsList as ae, CARDS as s, L as P, j as c, Button as se, it as ne, isTauri as re, ButtonIcon as te, IconPasskey as L, PROFILE_TITLE as le } from "./index.BQXkk0E7.js";
|
|
4
4
|
import ie from "clsx";
|
|
5
5
|
import { useState as m, useMemo as ce, useCallback as f } from "react";
|
|
6
6
|
const oe = () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as n, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { n as je, useEntitlements as Ve, AppContext as Fe, useUserPreferences as We, V as ie, useLocalStorage as de, LOCAL_STORAGE_OLED_MODE as $e, LOCAL_STORAGE_FULL_SCREEN as ze, k as ue, canEvaluateModels as He, Y as Ye, getCacheInfo as qe, isServiceWorkerEnabled as Ke, SETTINGS_TITLE as Qe, Card as E, CARDS as r, b as Je, Button as v, PROMPTS_DESCRIPTION as Xe, e_ as me, L as Ze, j as he, applyOledMode as Ee, APP_SET_OLED_MODE as fe, APP_SET_FULL_SCREEN as Se, getCurrentGeoLocation as et, graphQLRequest as pe, handleServiceWorkerToggle as tt, SERVICE_TYPES as ge } from "./index.
|
|
3
|
-
import { useCapability as be, Panel as ot, Toggle as l } from "./App.
|
|
4
|
-
import { TextArea as Te } from "./index.
|
|
2
|
+
import { n as je, useEntitlements as Ve, AppContext as Fe, useUserPreferences as We, V as ie, useLocalStorage as de, LOCAL_STORAGE_OLED_MODE as $e, LOCAL_STORAGE_FULL_SCREEN as ze, k as ue, canEvaluateModels as He, Y as Ye, getCacheInfo as qe, isServiceWorkerEnabled as Ke, SETTINGS_TITLE as Qe, Card as E, CARDS as r, b as Je, Button as v, PROMPTS_DESCRIPTION as Xe, e_ as me, L as Ze, j as he, applyOledMode as Ee, APP_SET_OLED_MODE as fe, APP_SET_FULL_SCREEN as Se, getCurrentGeoLocation as et, graphQLRequest as pe, handleServiceWorkerToggle as tt, SERVICE_TYPES as ge } from "./index.BQXkk0E7.js";
|
|
3
|
+
import { useCapability as be, Panel as ot, Toggle as l } from "./App.CfJzwyx5.js";
|
|
4
|
+
import { TextArea as Te } from "./index.9ZW-D7id.js";
|
|
5
5
|
import { useContext as at, useState as a, useMemo as st, useCallback as nt, useEffect as Ne } from "react";
|
|
6
6
|
const ut = ({
|
|
7
7
|
open: Ce,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { n as f, useUniqueId as v, useUserChatStats as _, useChatsUsage as z, USAGE_TITLE as B, Card as g, renderDataAsList as P, CARDS as a, L as p, j as A, Button as i, pluralize as m } from "./index.
|
|
3
|
-
import { Panel as H } from "./App.
|
|
2
|
+
import { n as f, useUniqueId as v, useUserChatStats as _, useChatsUsage as z, USAGE_TITLE as B, Card as g, renderDataAsList as P, CARDS as a, L as p, j as A, Button as i, pluralize as m } from "./index.BQXkk0E7.js";
|
|
3
|
+
import { Panel as H } from "./App.CfJzwyx5.js";
|
|
4
4
|
import { useState as C, Suspense as K, lazy as j } from "react";
|
|
5
5
|
const s = [0, 3, 6, 9], n = {
|
|
6
6
|
TOKEN: "token",
|
|
7
7
|
MODEL: "model"
|
|
8
8
|
}, w = j(() => import(
|
|
9
9
|
/* webpackChunkName: "LazyChart" */
|
|
10
|
-
"./Chart.
|
|
10
|
+
"./Chart.CmXf5ahL.js"
|
|
11
11
|
)), R = ({
|
|
12
12
|
open: k,
|
|
13
13
|
onOpenChange: E
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as e, jsxs as r, Fragment as b } from "react/jsx-runtime";
|
|
2
|
-
import { L as R, j as A, Button as M, n as Ne, useLocalStorage as K, LOCAL_STORAGE_PREFIX as Q, LOCAL_STORAGE_SORT_MEMORY_DIRECTION as we, e as l, LOCAL_STORAGE_SORT_MEMORY_COLUMN as ke, useUserMemories as Se, useExpiredMemories as Te, useDeleteMemory as ve, useDeleteAllActiveMemories as De, useDeleteAllExpiredMemories as Me, useUpdateMemory as Ee, useRestoreMemory as be, ButtonIcon as O, IconEdit as Re, IconDelete as Z, IconRestore as Ie } from "./index.
|
|
3
|
-
import { Panel as le, Toggle as _, ConfirmationPanel as ee, Tooltip as z } from "./App.
|
|
4
|
-
import { W as te, j as re, G as D, M as s, F as B, H as ie, D as ne } from "./index.
|
|
2
|
+
import { L as R, j as A, Button as M, n as Ne, useLocalStorage as K, LOCAL_STORAGE_PREFIX as Q, LOCAL_STORAGE_SORT_MEMORY_DIRECTION as we, e as l, LOCAL_STORAGE_SORT_MEMORY_COLUMN as ke, useUserMemories as Se, useExpiredMemories as Te, useDeleteMemory as ve, useDeleteAllActiveMemories as De, useDeleteAllExpiredMemories as Me, useUpdateMemory as Ee, useRestoreMemory as be, ButtonIcon as O, IconEdit as Re, IconDelete as Z, IconRestore as Ie } from "./index.BQXkk0E7.js";
|
|
3
|
+
import { Panel as le, Toggle as _, ConfirmationPanel as ee, Tooltip as z } from "./App.CfJzwyx5.js";
|
|
4
|
+
import { W as te, j as re, G as D, M as s, F as B, H as ie, D as ne } from "./index.ZpurL-_2.js";
|
|
5
5
|
import y from "clsx";
|
|
6
6
|
import { useState as C, useEffect as Le, useRef as oe } from "react";
|
|
7
|
-
import { TextArea as Oe } from "./index.
|
|
7
|
+
import { TextArea as Oe } from "./index.9ZW-D7id.js";
|
|
8
8
|
const _e = ({
|
|
9
9
|
open: N,
|
|
10
10
|
onOpenChange: E,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as oe, jsx as h } from "react/jsx-runtime";
|
|
2
|
-
import { useMergeRefs as ce, useResizeObserver as W, useUniqueId as ne, useUncontrolled as le, LiveRegion as ie } from "./index.
|
|
2
|
+
import { useMergeRefs as ce, useResizeObserver as W, useUniqueId as ne, useUncontrolled as le, LiveRegion as ie } from "./index.BQXkk0E7.js";
|
|
3
3
|
import ue, { useRef as k, useState as I, useLayoutEffect as R } from "react";
|
|
4
4
|
import o from "clsx";
|
|
5
5
|
/*!
|