@versini/sassysaint 8.39.10 → 8.40.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.CCL6woFi.js → AboutChangelog.sxwJVJMw.js} +2 -2
- package/dist/chunks/{AboutEntry.CdUMph5q.js → AboutEntry.BQ81lUub.js} +5 -5
- package/dist/chunks/App.B9gc6fg7.js +14162 -0
- package/dist/chunks/{Chart.BDCtfHpJ.js → Chart.C49WdExM.js} +2 -2
- package/dist/chunks/ChatBubbleAssistant.BGAdbVxr.js +75 -0
- package/dist/chunks/{HistoryEntry.DzQ2MSaZ.js → HistoryEntry.B9fK7Ffl.js} +231 -216
- package/dist/chunks/{LNWAZHJI.D7CCdvNo.js → LNWAZHJI.CdnUhcqc.js} +1 -1
- package/dist/chunks/{ProfileEntry.YotUrCiu.js → ProfileEntry.CfrDx_1j.js} +2 -2
- package/dist/chunks/{SettingsEntry.CnnDhK6w.js → SettingsEntry.D75eEHLZ.js} +2 -2
- package/dist/chunks/{UsageEntry.D2ZOKNfK.js → UsageEntry.In0ugMi8.js} +3 -3
- package/dist/chunks/{index.Dx6oN_z4.js → index.BKnr6q_J.js} +1 -1
- package/dist/chunks/{index.RXuXaAsE.js → index.Cl7AhqCZ.js} +1 -1
- package/dist/chunks/{index.Dym4y9es.js → index.CrPLofea.js} +626 -592
- package/dist/chunks/{index.7uobAuKV.js → index.D3As27U8.js} +2 -2
- package/dist/chunks/{index.f7-kYhdF.js → index.DBcnZQzl.js} +1 -1
- package/dist/chunks/{index.CVlucvO6.js → index.uP1AYao7.js} +3 -3
- package/dist/chunks/{useMarkdown.ClVoAzdf.js → useMarkdown.4lWqmQ_l.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/App.fCKFZhqI.js +0 -10314
- package/dist/chunks/ChatBubbleAssistant.DNqS0sbL.js +0 -74
@@ -1,169 +1,169 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { I, INFINITE_SCROLL_THRESHOLD as
|
3
|
-
import { De as
|
4
|
-
import { Fragment as
|
5
|
-
const
|
1
|
+
import { jsxs as h, jsx as e, Fragment as ne } from "react/jsx-runtime";
|
2
|
+
import { I as z, ue$1 as A, Ae as M, INFINITE_SCROLL_THRESHOLD as F, CARDS as ce, pluralize as ie, ue as I, numberFormatter as le, de, isProbablyMobile as me, E as he, a as ue, i as Ce, n as Y, INFINITE_SCROLL_LIMIT as U, LOCAL_STORAGE_PREFIX as v, LOCAL_STORAGE_SORT_TIMESTAMP as pe, LOCAL_STORAGE_SORT_TOKEN_USAGE as Se, LOCAL_STORAGE_SORT as Te, APP_CLASSNAME as ge, ACTION_SORT as Ee, TOAST_CHAT_DELETED as xe, TOAST_PROVIDER_CHANGED as fe, LOCAL_STORAGE_SEARCH as ye, HISTORY_TITLE as Ae, pe$1 as De, debounce as Oe, ACTION_SEARCH as Re } from "./index.CrPLofea.js";
|
3
|
+
import { De as Ne, He as ve, qe as k, Ge as we, Fe as Me, Pe as p, Ye as V, st as $, a as _e, p as ke, p$1 as Ie, HistoryContext as K, ChatContext as W, useAiChat as be, E as w, E$1 as y, useUserPreferences as Le, ConfirmationPanel as ze, LazyToastContainerWrapper as He, mutateCall as B, SERVICE_TYPES as G, showErrorToast as Pe, setNewProvider as Ue, CHAT_SET_PROVIDER as Ve, showSuccessToast as $e, CHAT_SET_STATUS as Be, useChatsHistory as Ge, tt as Fe, a$1 as Ye } from "./App.B9gc6fg7.js";
|
4
|
+
import { Fragment as Ke, useRef as b, useState as L, useContext as _, useCallback as We, useEffect as j } from "react";
|
5
|
+
const je = ({
|
6
6
|
className: c,
|
7
|
-
viewBox:
|
8
|
-
title:
|
9
|
-
monotone:
|
7
|
+
viewBox: o,
|
8
|
+
title: d,
|
9
|
+
monotone: m,
|
10
10
|
...i
|
11
|
-
}) => /* @__PURE__ */
|
12
|
-
|
11
|
+
}) => /* @__PURE__ */ h(
|
12
|
+
z,
|
13
13
|
{
|
14
14
|
defaultViewBox: "0 0 448 512",
|
15
15
|
size: "size-5",
|
16
|
-
viewBox:
|
16
|
+
viewBox: o,
|
17
17
|
className: c,
|
18
|
-
title:
|
18
|
+
title: d || "Delete",
|
19
19
|
...i,
|
20
20
|
children: [
|
21
21
|
/* @__PURE__ */ e(
|
22
22
|
"path",
|
23
23
|
{
|
24
24
|
d: "M32 96v352c0 35.3 28.7 64 64 64h256c35.3 0 64-28.7 64-64V96zm80 80c0-8.8 7.2-16 16-16s16 7.2 16 16v224c0 8.8-7.2 16-16 16s-16-7.2-16-16zm96 0c0-8.8 7.2-16 16-16s16 7.2 16 16v224c0 8.8-7.2 16-16 16s-16-7.2-16-16zm96 0c0-8.8 7.2-16 16-16s16 7.2 16 16v224c0 8.8-7.2 16-16 16s-16-7.2-16-16z",
|
25
|
-
opacity:
|
25
|
+
opacity: m ? "1" : "0.4"
|
26
26
|
}
|
27
27
|
),
|
28
28
|
/* @__PURE__ */ e("path", { d: "M163.8 0c-12.1 0-23.2 6.8-28.6 17.7L128 32H32C14.3 32 0 46.3 0 64s14.3 32 32 32h384c17.7 0 32-14.3 32-32s-14.3-32-32-32h-96l-7.2-14.3C307.4 6.8 296.3 0 284.2 0z" })
|
29
29
|
]
|
30
30
|
}
|
31
|
-
),
|
31
|
+
), qe = ({
|
32
32
|
className: c,
|
33
|
-
viewBox:
|
34
|
-
title:
|
35
|
-
monotone:
|
33
|
+
viewBox: o,
|
34
|
+
title: d,
|
35
|
+
monotone: m,
|
36
36
|
...i
|
37
|
-
}) => /* @__PURE__ */
|
38
|
-
|
37
|
+
}) => /* @__PURE__ */ h(
|
38
|
+
z,
|
39
39
|
{
|
40
40
|
defaultViewBox: "0 0 512 512",
|
41
41
|
size: "size-5",
|
42
|
-
viewBox:
|
42
|
+
viewBox: o,
|
43
43
|
className: c,
|
44
|
-
title:
|
44
|
+
title: d || "Restore",
|
45
45
|
...i,
|
46
46
|
children: [
|
47
47
|
/* @__PURE__ */ e(
|
48
48
|
"path",
|
49
49
|
{
|
50
50
|
d: "M128 80v16h64V80c0-8.8 7.2-16 16-16h224c8.8 0 16 7.2 16 16v224c0 8.8-7.2 16-16 16h-16v64h16c44.2 0 80-35.8 80-80V80c0-44.2-35.8-80-80-80H208c-44.2 0-80 35.8-80 80",
|
51
|
-
opacity:
|
51
|
+
opacity: m ? "1" : "0.4"
|
52
52
|
}
|
53
53
|
),
|
54
54
|
/* @__PURE__ */ e("path", { d: "M64 128c-35.3 0-64 28.7-64 64v256c0 35.3 28.7 64 64 64h256c35.3 0 64-28.7 64-64V192c0-35.3-28.7-64-64-64zm32 64h192c17.7 0 32 14.3 32 32s-14.3 32-32 32H96c-17.7 0-32-14.3-32-32s14.3-32 32-32" })
|
55
55
|
]
|
56
56
|
}
|
57
|
-
),
|
57
|
+
), Xe = ({
|
58
58
|
className: c,
|
59
|
-
viewBox:
|
60
|
-
title:
|
61
|
-
monotone:
|
59
|
+
viewBox: o,
|
60
|
+
title: d,
|
61
|
+
monotone: m,
|
62
62
|
...i
|
63
|
-
}) => /* @__PURE__ */
|
64
|
-
|
63
|
+
}) => /* @__PURE__ */ h(
|
64
|
+
z,
|
65
65
|
{
|
66
66
|
defaultViewBox: "0 0 512 512",
|
67
67
|
size: "size-5",
|
68
|
-
viewBox:
|
68
|
+
viewBox: o,
|
69
69
|
className: c,
|
70
|
-
title:
|
70
|
+
title: d || "Search",
|
71
71
|
...i,
|
72
72
|
children: [
|
73
73
|
/* @__PURE__ */ e(
|
74
74
|
"path",
|
75
75
|
{
|
76
76
|
d: "M0 208a208 208 0 1 0 416 0 208 208 0 1 0-416 0m352 0a144 144 0 1 1-288 0 144 144 0 1 1 288 0",
|
77
|
-
opacity:
|
77
|
+
opacity: m ? "1" : "0.4"
|
78
78
|
}
|
79
79
|
),
|
80
80
|
/* @__PURE__ */ e("path", { d: "m330.7 376 126.7 126.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L376 330.7c-12.7 17.3-28 32.6-45.3 45.3" })
|
81
81
|
]
|
82
82
|
}
|
83
|
-
),
|
84
|
-
[
|
85
|
-
[
|
86
|
-
[
|
83
|
+
), Je = {
|
84
|
+
[Ce]: Ie,
|
85
|
+
[ue]: ke,
|
86
|
+
[he]: _e
|
87
87
|
}, r = {
|
88
88
|
ROW: "row",
|
89
|
-
TIMESTAMP:
|
89
|
+
TIMESTAMP: A,
|
90
90
|
SUMMARY: "summary",
|
91
91
|
PROVIDER: "provider",
|
92
|
-
TOKEN_USAGE:
|
92
|
+
TOKEN_USAGE: M,
|
93
93
|
ACTIONS: "actions"
|
94
|
-
},
|
94
|
+
}, Qe = [
|
95
95
|
r.ROW,
|
96
96
|
r.TIMESTAMP,
|
97
97
|
r.SUMMARY,
|
98
98
|
r.ACTIONS
|
99
|
-
],
|
99
|
+
], Ze = [
|
100
100
|
r.ROW,
|
101
101
|
r.SUMMARY,
|
102
102
|
r.TIMESTAMP,
|
103
103
|
r.TOKEN_USAGE,
|
104
104
|
r.PROVIDER,
|
105
105
|
r.ACTIONS
|
106
|
-
],
|
106
|
+
], et = ({
|
107
107
|
filteredHistory: c,
|
108
|
-
historyState:
|
109
|
-
lastEntryToLoad:
|
110
|
-
onClickSort:
|
108
|
+
historyState: o,
|
109
|
+
lastEntryToLoad: d,
|
110
|
+
onClickSort: m,
|
111
111
|
onClickRestore: i,
|
112
|
-
onClickDelete:
|
112
|
+
onClickDelete: E,
|
113
113
|
infinityScrollMarkerRef: x
|
114
114
|
}) => {
|
115
|
-
const
|
115
|
+
const l = me() ? Qe : Ze, D = (t) => {
|
116
116
|
switch (t) {
|
117
117
|
case r.ROW:
|
118
|
-
return /* @__PURE__ */ e(
|
118
|
+
return /* @__PURE__ */ e(p, { className: "sr-only", children: "Row" }, t);
|
119
119
|
case r.TIMESTAMP:
|
120
120
|
return /* @__PURE__ */ e(
|
121
|
-
|
121
|
+
V,
|
122
122
|
{
|
123
123
|
buttonClassName: "text-xs sm:text-sm",
|
124
|
-
cellId:
|
124
|
+
cellId: A,
|
125
125
|
align: "left",
|
126
|
-
sortDirection:
|
127
|
-
sortedCell:
|
126
|
+
sortDirection: o.sortDirection,
|
127
|
+
sortedCell: o.sortedCell,
|
128
128
|
onClick: () => {
|
129
|
-
|
129
|
+
m(A);
|
130
130
|
},
|
131
131
|
children: "Date"
|
132
132
|
},
|
133
133
|
t
|
134
134
|
);
|
135
135
|
case r.SUMMARY:
|
136
|
-
return /* @__PURE__ */ e(
|
136
|
+
return /* @__PURE__ */ e(p, { className: "text-xs sm:text-sm", children: "Summary" }, t);
|
137
137
|
case r.PROVIDER:
|
138
|
-
return /* @__PURE__ */ e(
|
138
|
+
return /* @__PURE__ */ e(p, { className: "text-xs sm:text-sm", children: "Provider" }, t);
|
139
139
|
case r.TOKEN_USAGE:
|
140
140
|
return /* @__PURE__ */ e(
|
141
|
-
|
141
|
+
V,
|
142
142
|
{
|
143
143
|
buttonClassName: "text-xs sm:text-sm",
|
144
|
-
cellId:
|
144
|
+
cellId: M,
|
145
145
|
align: "right",
|
146
|
-
sortDirection:
|
147
|
-
sortedCell:
|
146
|
+
sortDirection: o.sortDirection,
|
147
|
+
sortedCell: o.sortedCell,
|
148
148
|
onClick: () => {
|
149
|
-
|
149
|
+
m(M);
|
150
150
|
},
|
151
151
|
children: "Tokens"
|
152
152
|
},
|
153
153
|
t
|
154
154
|
);
|
155
155
|
case r.ACTIONS:
|
156
|
-
return /* @__PURE__ */ e(
|
156
|
+
return /* @__PURE__ */ e(p, { className: "text-xs sm:text-sm text-right", children: "Actions" }, t);
|
157
157
|
default:
|
158
158
|
return null;
|
159
159
|
}
|
160
160
|
}, f = (t, s, T) => {
|
161
161
|
switch (t) {
|
162
162
|
case r.ROW:
|
163
|
-
return /* @__PURE__ */ e(
|
163
|
+
return /* @__PURE__ */ e(p, { children: T + 1 }, t);
|
164
164
|
case r.TIMESTAMP:
|
165
165
|
return /* @__PURE__ */ e(
|
166
|
-
|
166
|
+
p,
|
167
167
|
{
|
168
168
|
component: "th",
|
169
169
|
scope: "row",
|
@@ -173,34 +173,34 @@ const He = ({
|
|
173
173
|
t
|
174
174
|
);
|
175
175
|
case r.SUMMARY: {
|
176
|
-
const
|
176
|
+
const S = s.summary || (s.messages.length > 0 ? s.messages[0]?.content : "");
|
177
177
|
return /* @__PURE__ */ e(
|
178
|
-
|
178
|
+
p,
|
179
179
|
{
|
180
180
|
className: "max-w-[100px] text-white sm:max-w-full text-xs sm:text-sm",
|
181
181
|
style: {
|
182
182
|
wordBreak: "break-word"
|
183
183
|
},
|
184
|
-
children:
|
184
|
+
children: S
|
185
185
|
},
|
186
186
|
t
|
187
187
|
);
|
188
188
|
}
|
189
189
|
case r.PROVIDER: {
|
190
|
-
const
|
190
|
+
const S = s.model ? de(s.model) : null, O = S ? Je[S] : null;
|
191
191
|
return /* @__PURE__ */ e(
|
192
|
-
|
192
|
+
p,
|
193
193
|
{
|
194
194
|
component: "th",
|
195
195
|
scope: "row",
|
196
196
|
className: "text-gray-400",
|
197
197
|
align: "center",
|
198
|
-
children:
|
199
|
-
|
198
|
+
children: O ? /* @__PURE__ */ e(
|
199
|
+
O,
|
200
200
|
{
|
201
201
|
size: "size-4 sm:size-5",
|
202
202
|
semantic: !0,
|
203
|
-
title: s.model ||
|
203
|
+
title: s.model || S
|
204
204
|
}
|
205
205
|
) : null
|
206
206
|
},
|
@@ -209,24 +209,24 @@ const He = ({
|
|
209
209
|
}
|
210
210
|
case r.TOKEN_USAGE:
|
211
211
|
return /* @__PURE__ */ e(
|
212
|
-
|
212
|
+
p,
|
213
213
|
{
|
214
214
|
className: "text-gray-400 text-xs sm:text-sm",
|
215
215
|
align: "right",
|
216
|
-
children: s.tokenUsage ?
|
216
|
+
children: s.tokenUsage ? le.format(s.tokenUsage) : "0"
|
217
217
|
},
|
218
218
|
t
|
219
219
|
);
|
220
220
|
case r.ACTIONS:
|
221
|
-
return /* @__PURE__ */ e(
|
221
|
+
return /* @__PURE__ */ e(p, { children: /* @__PURE__ */ h("div", { className: "flex flex-col items-end sm:flex-row gap-2", children: [
|
222
222
|
/* @__PURE__ */ e(
|
223
|
-
|
223
|
+
$,
|
224
224
|
{
|
225
225
|
label: "Restore chat",
|
226
226
|
mode: "alt-system",
|
227
227
|
placement: "top",
|
228
228
|
trigger: /* @__PURE__ */ e(
|
229
|
-
|
229
|
+
I,
|
230
230
|
{
|
231
231
|
focusMode: "alt-system",
|
232
232
|
noBorder: !0,
|
@@ -236,19 +236,19 @@ const He = ({
|
|
236
236
|
onClick: async () => {
|
237
237
|
await i(s);
|
238
238
|
},
|
239
|
-
children: /* @__PURE__ */ e(
|
239
|
+
children: /* @__PURE__ */ e(qe, { size: "size-3", monotone: !0 })
|
240
240
|
}
|
241
241
|
)
|
242
242
|
}
|
243
243
|
),
|
244
244
|
/* @__PURE__ */ e(
|
245
|
-
|
245
|
+
$,
|
246
246
|
{
|
247
247
|
label: "Delete chat",
|
248
248
|
mode: "alt-system",
|
249
249
|
placement: "top",
|
250
250
|
trigger: /* @__PURE__ */ e(
|
251
|
-
|
251
|
+
I,
|
252
252
|
{
|
253
253
|
focusMode: "alt-system",
|
254
254
|
noBorder: !0,
|
@@ -256,9 +256,9 @@ const He = ({
|
|
256
256
|
variant: "primary",
|
257
257
|
iconClassName: "text-red-700 dark:text-red-500",
|
258
258
|
onClick: () => {
|
259
|
-
|
259
|
+
E(s);
|
260
260
|
},
|
261
|
-
children: /* @__PURE__ */ e(
|
261
|
+
children: /* @__PURE__ */ e(je, { size: "size-3", monotone: !0 })
|
262
262
|
}
|
263
263
|
)
|
264
264
|
}
|
@@ -268,133 +268,152 @@ const He = ({
|
|
268
268
|
return null;
|
269
269
|
}
|
270
270
|
};
|
271
|
-
return /* @__PURE__ */
|
272
|
-
/* @__PURE__ */ e(
|
273
|
-
/* @__PURE__ */ e(
|
274
|
-
s ===
|
275
|
-
/* @__PURE__ */ e(
|
271
|
+
return /* @__PURE__ */ h(Ne, { stickyHeader: !0, stickyFooter: !0, compact: !0, children: [
|
272
|
+
/* @__PURE__ */ e(ve, { children: /* @__PURE__ */ e(k, { children: l.map((t) => D(t)) }) }),
|
273
|
+
/* @__PURE__ */ e(we, { children: c.slice(0, d).map((t, s) => t?.messages?.length > 0 ? /* @__PURE__ */ h(Ke, { children: [
|
274
|
+
s === d - F && /* @__PURE__ */ e("tr", { ref: x }),
|
275
|
+
/* @__PURE__ */ e(k, { children: l.map(
|
276
276
|
(T) => f(T, t, s)
|
277
277
|
) })
|
278
|
-
] }, `${
|
279
|
-
/* @__PURE__ */ e(
|
278
|
+
] }, `${ce.HISTORY.TITLE}-${t.id}-${s}`) : null) }),
|
279
|
+
/* @__PURE__ */ e(Me, { children: /* @__PURE__ */ e(k, { children: /* @__PURE__ */ e(p, { colSpan: 1e3, children: /* @__PURE__ */ e("div", { children: ie(
|
280
280
|
`${c.length} chat`,
|
281
281
|
c.length
|
282
282
|
) }) }) }) })
|
283
283
|
] });
|
284
|
-
},
|
284
|
+
}, tt = ({
|
285
285
|
filteredHistory: c,
|
286
|
-
dispatch:
|
287
|
-
onOpenChange:
|
288
|
-
mutate:
|
286
|
+
dispatch: o,
|
287
|
+
onOpenChange: d,
|
288
|
+
mutate: m
|
289
289
|
}) => {
|
290
|
-
const { user: i, getAccessToken:
|
290
|
+
const { user: i, getAccessToken: E } = Y(), x = b(null), u = b({
|
291
291
|
id: "",
|
292
292
|
timestamp: "",
|
293
293
|
message: ""
|
294
|
-
}), [
|
295
|
-
|
296
|
-
), { state: s, dispatch: T } =
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
}
|
301
|
-
|
302
|
-
|
303
|
-
|
294
|
+
}), [l, D] = L(!1), [f, t] = L(
|
295
|
+
U + F
|
296
|
+
), { state: s, dispatch: T } = _(K), S = {
|
297
|
+
searchString: s.searchString || "",
|
298
|
+
sortDirection: s.sortDirection || y.DESC,
|
299
|
+
sortedCell: s.sortedCell || A
|
300
|
+
}, {
|
301
|
+
state: { provider: O },
|
302
|
+
setChatId: g,
|
303
|
+
setInitialMessages: q
|
304
|
+
} = _(W), { setInput: X } = be(), [H, P] = w({
|
305
|
+
key: v + pe,
|
306
|
+
initialValue: y.DESC
|
307
|
+
}), [J, Q] = w({
|
308
|
+
key: v + Se,
|
309
|
+
initialValue: y.ASC
|
310
|
+
}), [, Z] = w({
|
311
|
+
key: v + Te,
|
312
|
+
initialValue: A
|
313
|
+
}), { refetch: ee } = Le({
|
304
314
|
user: i?.username,
|
305
|
-
getAccessToken:
|
306
|
-
}),
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
});
|
315
|
+
getAccessToken: E
|
316
|
+
}), te = (a) => {
|
317
|
+
const C = s.sortedCell === a;
|
318
|
+
let n, R;
|
319
|
+
switch (a) {
|
320
|
+
case A:
|
321
|
+
R = P, n = C ? s.sortDirection : H;
|
322
|
+
break;
|
323
|
+
case M:
|
324
|
+
R = Q, n = C ? s.sortDirection : J;
|
316
325
|
break;
|
317
326
|
default:
|
318
|
-
|
319
|
-
type: z,
|
320
|
-
payload: {
|
321
|
-
sortedCell: n,
|
322
|
-
sortDirection: N.ASC
|
323
|
-
}
|
324
|
-
});
|
327
|
+
R = P, n = C ? s.sortDirection : H;
|
325
328
|
break;
|
326
329
|
}
|
327
|
-
|
328
|
-
|
330
|
+
let N;
|
331
|
+
switch (n) {
|
332
|
+
case y.ASC:
|
333
|
+
N = y.DESC;
|
334
|
+
break;
|
335
|
+
default:
|
336
|
+
N = y.ASC;
|
337
|
+
break;
|
338
|
+
}
|
339
|
+
R(N), Z(a), T({
|
340
|
+
type: Ee,
|
341
|
+
payload: {
|
342
|
+
sortedCell: a,
|
343
|
+
sortDirection: N
|
344
|
+
}
|
345
|
+
});
|
346
|
+
}, se = async () => {
|
347
|
+
const a = u.current;
|
329
348
|
try {
|
330
|
-
await
|
331
|
-
accessToken: await
|
332
|
-
type:
|
349
|
+
await B({
|
350
|
+
accessToken: await E(),
|
351
|
+
type: G.DELETE_CHAT,
|
333
352
|
params: {
|
334
353
|
userId: i?.username || "",
|
335
|
-
id:
|
354
|
+
id: a.id
|
336
355
|
}
|
337
|
-
}),
|
356
|
+
}), m(""), await Pe(xe, {
|
338
357
|
autoClose: 2e3,
|
339
358
|
containerId: "history-table"
|
340
359
|
});
|
341
360
|
} catch {
|
342
361
|
}
|
343
|
-
},
|
362
|
+
}, re = async (a) => {
|
344
363
|
try {
|
345
|
-
const
|
346
|
-
accessToken:
|
347
|
-
type:
|
364
|
+
const C = await E(), n = await B({
|
365
|
+
accessToken: C,
|
366
|
+
type: G.GET_CHAT,
|
348
367
|
params: {
|
349
|
-
id:
|
368
|
+
id: a.id
|
350
369
|
}
|
351
370
|
});
|
352
|
-
|
353
|
-
provider:
|
354
|
-
accessToken:
|
371
|
+
n.status === 200 && (n.data.provider !== O && (await Ue({
|
372
|
+
provider: n.data.provider,
|
373
|
+
accessToken: C,
|
355
374
|
username: i?.username || ""
|
356
|
-
}),
|
357
|
-
type:
|
375
|
+
}), o({
|
376
|
+
type: Ve,
|
358
377
|
payload: {
|
359
|
-
provider:
|
378
|
+
provider: n.data.provider
|
360
379
|
}
|
361
|
-
}),
|
362
|
-
`${
|
380
|
+
}), ee(), await $e(
|
381
|
+
`${fe} ${n.data.provider}`,
|
363
382
|
{
|
364
383
|
containerId: "toggle-provider"
|
365
384
|
}
|
366
|
-
)),
|
367
|
-
type:
|
385
|
+
)), o({
|
386
|
+
type: Be,
|
368
387
|
payload: {
|
369
388
|
restoring: !0,
|
370
|
-
restoredModel:
|
371
|
-
restoredUsage:
|
389
|
+
restoredModel: n.data?.model || "",
|
390
|
+
restoredUsage: n.data?.tokenUsage || 0
|
372
391
|
}
|
373
|
-
}),
|
392
|
+
}), X(""), g(a.id), q(n.data.messages), d(!1));
|
374
393
|
} catch {
|
375
394
|
}
|
376
|
-
},
|
377
|
-
|
378
|
-
id:
|
379
|
-
timestamp:
|
380
|
-
message:
|
381
|
-
},
|
382
|
-
},
|
383
|
-
|
395
|
+
}, ae = (a) => {
|
396
|
+
u.current = {
|
397
|
+
id: a.id,
|
398
|
+
timestamp: a.timestamp,
|
399
|
+
message: a.messages.length > 0 ? a.messages[0]?.content : ""
|
400
|
+
}, D(!l);
|
401
|
+
}, oe = We((a) => {
|
402
|
+
a[0].isIntersecting && t((n) => n + U);
|
384
403
|
}, []);
|
385
|
-
return
|
386
|
-
const
|
404
|
+
return j(() => {
|
405
|
+
const a = {
|
387
406
|
// root: null,
|
388
407
|
rootMargin: "20px"
|
389
|
-
},
|
390
|
-
x.current &&
|
391
|
-
}), /* @__PURE__ */
|
392
|
-
/* @__PURE__ */
|
393
|
-
|
408
|
+
}, C = new IntersectionObserver(oe, a);
|
409
|
+
x.current && C.observe(x.current);
|
410
|
+
}), /* @__PURE__ */ h(ne, { children: [
|
411
|
+
/* @__PURE__ */ h(
|
412
|
+
ze,
|
394
413
|
{
|
395
|
-
showConfirmation:
|
396
|
-
setShowConfirmation:
|
397
|
-
action:
|
414
|
+
showConfirmation: l,
|
415
|
+
setShowConfirmation: D,
|
416
|
+
action: se,
|
398
417
|
customStrings: {
|
399
418
|
confirmAction: "Delete",
|
400
419
|
cancelAction: "Cancel",
|
@@ -402,78 +421,74 @@ const He = ({
|
|
402
421
|
},
|
403
422
|
children: [
|
404
423
|
/* @__PURE__ */ e("p", { className: "m-0", children: "Are you sure you want to delete the following chat:" }),
|
405
|
-
/* @__PURE__ */
|
406
|
-
/* @__PURE__ */
|
424
|
+
/* @__PURE__ */ h("ul", { className: "m-0", children: [
|
425
|
+
/* @__PURE__ */ h("li", { children: [
|
407
426
|
"Timestamp:",
|
408
427
|
" ",
|
409
|
-
/* @__PURE__ */ e("span", { className: "text-lg", children:
|
428
|
+
/* @__PURE__ */ e("span", { className: "text-lg", children: u.current && u.current.timestamp })
|
410
429
|
] }),
|
411
|
-
/* @__PURE__ */
|
430
|
+
/* @__PURE__ */ h("li", { children: [
|
412
431
|
"First message:",
|
413
432
|
" ",
|
414
|
-
/* @__PURE__ */ e("span", { className: "text-lg", children:
|
433
|
+
/* @__PURE__ */ e("span", { className: "text-lg", children: u.current?.message })
|
415
434
|
] })
|
416
435
|
] })
|
417
436
|
]
|
418
437
|
}
|
419
438
|
),
|
420
|
-
/* @__PURE__ */ e("div", { className:
|
439
|
+
/* @__PURE__ */ e("div", { className: ge, children: /* @__PURE__ */ e(He, { containerId: "history-table" }) }),
|
421
440
|
/* @__PURE__ */ e(
|
422
|
-
|
441
|
+
et,
|
423
442
|
{
|
424
443
|
filteredHistory: c,
|
425
|
-
historyState:
|
444
|
+
historyState: S,
|
426
445
|
lastEntryToLoad: f,
|
427
|
-
onClickSort:
|
428
|
-
onClickRestore:
|
429
|
-
onClickDelete:
|
446
|
+
onClickSort: te,
|
447
|
+
onClickRestore: re,
|
448
|
+
onClickDelete: ae,
|
430
449
|
infinityScrollMarkerRef: x
|
431
450
|
}
|
432
451
|
)
|
433
452
|
] });
|
434
|
-
},
|
453
|
+
}, nt = ({
|
435
454
|
open: c,
|
436
|
-
onOpenChange:
|
455
|
+
onOpenChange: o
|
437
456
|
}) => {
|
438
|
-
const { getAccessToken:
|
439
|
-
o.sortDirection
|
440
|
-
), { data: s, refetch: T } = Ie({
|
457
|
+
const { getAccessToken: d, user: m } = Y(), { dispatch: i } = _(W), [E, x] = L([]), u = b(null), { state: l, dispatch: D } = _(K), { data: f, refetch: t } = Ge({
|
441
458
|
enabled: c,
|
442
|
-
user:
|
443
|
-
searchString:
|
444
|
-
sortDirection:
|
445
|
-
sortedCell:
|
446
|
-
getAccessToken:
|
447
|
-
}), [,
|
448
|
-
key:
|
449
|
-
initialValue:
|
459
|
+
user: m?.username || "",
|
460
|
+
searchString: l.searchString || "",
|
461
|
+
sortDirection: l.sortDirection || y.DESC,
|
462
|
+
sortedCell: l.sortedCell || A,
|
463
|
+
getAccessToken: d
|
464
|
+
}), [, s] = w({
|
465
|
+
key: v + ye,
|
466
|
+
initialValue: l.searchString
|
450
467
|
});
|
451
|
-
|
452
|
-
|
453
|
-
}, [
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
type: me,
|
459
|
-
payload: { searchString: S }
|
468
|
+
j(() => {
|
469
|
+
f && x(f);
|
470
|
+
}, [f]);
|
471
|
+
const T = async (g) => {
|
472
|
+
s(g), D({
|
473
|
+
type: Re,
|
474
|
+
payload: { searchString: g }
|
460
475
|
});
|
461
|
-
},
|
462
|
-
|
476
|
+
}, S = Oe((g) => {
|
477
|
+
T(g.target.value.trim());
|
463
478
|
}, 500);
|
464
|
-
return /* @__PURE__ */
|
465
|
-
|
479
|
+
return /* @__PURE__ */ h(
|
480
|
+
Fe,
|
466
481
|
{
|
467
482
|
open: c,
|
468
|
-
onOpenChange:
|
469
|
-
title:
|
483
|
+
onOpenChange: o,
|
484
|
+
title: Ae,
|
470
485
|
animation: !0,
|
471
486
|
animationType: "fade",
|
472
487
|
children: [
|
473
|
-
/* @__PURE__ */ e("form", { autoComplete: "off", onSubmit: async (
|
474
|
-
|
488
|
+
/* @__PURE__ */ e("form", { autoComplete: "off", onSubmit: async (g) => {
|
489
|
+
g.preventDefault();
|
475
490
|
}, children: /* @__PURE__ */ e(
|
476
|
-
|
491
|
+
De,
|
477
492
|
{
|
478
493
|
placeholder: "Search",
|
479
494
|
labelHidden: !0,
|
@@ -481,37 +496,37 @@ const He = ({
|
|
481
496
|
autoCapitalize: "off",
|
482
497
|
autoComplete: "off",
|
483
498
|
autoCorrect: "off",
|
484
|
-
ref:
|
485
|
-
defaultValue:
|
499
|
+
ref: u,
|
500
|
+
defaultValue: l.searchString,
|
486
501
|
focusMode: "light",
|
487
502
|
mode: "light",
|
488
503
|
name: "Search",
|
489
504
|
label: "Search",
|
490
|
-
onChange:
|
505
|
+
onChange: S,
|
491
506
|
className: "my-2",
|
492
507
|
rightElement: /* @__PURE__ */ e("div", { className: "text-copy-dark", children: /* @__PURE__ */ e(
|
493
|
-
|
508
|
+
I,
|
494
509
|
{
|
495
510
|
mode: "dark",
|
496
511
|
focusMode: "dark",
|
497
512
|
label: "Search",
|
498
513
|
size: "small",
|
499
514
|
onClick: () => {
|
500
|
-
|
515
|
+
T(""), u.current?.value && (u.current.value = "", u.current.focus());
|
501
516
|
},
|
502
|
-
disabled:
|
503
|
-
children:
|
517
|
+
disabled: l.searchString === "",
|
518
|
+
children: l.searchString !== "" ? /* @__PURE__ */ e(Ye, { monotone: !0, size: "size-3" }) : /* @__PURE__ */ e(Xe, { monotone: !0, size: "size-3" })
|
504
519
|
}
|
505
520
|
) })
|
506
521
|
}
|
507
522
|
) }),
|
508
523
|
/* @__PURE__ */ e("div", { className: "flex flex-col sm:flex-row max-h-[75vh] min-h-[60vh]", children: /* @__PURE__ */ e(
|
509
|
-
|
524
|
+
tt,
|
510
525
|
{
|
511
|
-
mutate:
|
512
|
-
filteredHistory:
|
526
|
+
mutate: t,
|
527
|
+
filteredHistory: E,
|
513
528
|
dispatch: i,
|
514
|
-
onOpenChange:
|
529
|
+
onOpenChange: o
|
515
530
|
}
|
516
531
|
) })
|
517
532
|
]
|
@@ -519,5 +534,5 @@ const He = ({
|
|
519
534
|
);
|
520
535
|
};
|
521
536
|
export {
|
522
|
-
|
537
|
+
nt as HistoryPanel
|
523
538
|
};
|