@versini/sassysaint 5.5.2 → 5.5.3
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/{LazyApp.TMfqkS0t.js → LazyApp.QsJz23b9.js} +540 -449
- package/dist/chunks/{LazyHeader.ujJ_wqZx.js → LazyHeader.B13GX_MA.js} +4 -4
- package/dist/chunks/{LazyMarkdownWithExtra.DbNrgEec.js → LazyMarkdownWithExtra.BJeytb8a.js} +2 -2
- package/dist/chunks/{LazyMessageAssistant.axz4vvCk.js → LazyMessageAssistant.BSHGsDRn.js} +4 -4
- package/dist/chunks/{index.DL3JlbtG.js → index.BpKSgAc6.js} +1 -1
- package/dist/chunks/{index.CSNLtEls.js → index.gS3otlF2.js} +2 -2
- package/dist/components/SassySaint/SassySaint.js +1 -1
- package/dist/index.js +4 -4
- package/package.json +3 -3
|
@@ -1,9 +1,36 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ACTION_RESTORE as
|
|
3
|
-
import { AppContext as
|
|
4
|
-
import
|
|
1
|
+
import { jsxs as v, jsx as s, Fragment as G } from "react/jsx-runtime";
|
|
2
|
+
import { g as Te, ACTION_RESTORE as we, ACTION_MESSAGE as R, ROLE_ASSISTANT as B, ACTION_RESET as _e, ACTION_MODEL as ie, ACTION_ENGINE as ne, ACTION_STREAMING as se, ACTION_SORT as Ne, ACTION_SEARCH as Ee, ACTION_SET_TAGS as de, ACTION_RESET_TAGS as ce, ACTION_TOGGLE_TAG as le, ROLE_INTERNAL as j, ROLE_USER as $, isLastMessageFromRole as Ce, un as O, getMessageContaintWrapperClass as Ie, O as Se, MessagesContainerHeader as Re, ROLE_SYSTEM as Be, ROLE_HIDDEN as Ae, DEFAULT_AI_ENGINE as M, STATS_SEPARATOR as Y, CLIPBOARD_TAG as J, TYPE_QUESTION as Me, C as ge, SEND as Le, ERROR_MESSAGE as Oe, L as ze, j as Ue, _ as Ve, LOCAL_STORAGE_PREFIX as Q, LOCAL_STORAGE_SEARCH as De, LOCAL_STORAGE_SORT as $e } from "./index.gS3otlF2.js";
|
|
3
|
+
import { AppContext as z, TagsContext as P, restCall as He, Fe as Ge, NewChatButton as je, serviceCall as me, SERVICE_TYPES as ue, E as X, HistoryContext as Pe, f as Fe } from "./index.BpKSgAc6.js";
|
|
4
|
+
import S, { useRef as C, useEffect as k, useCallback as H, useState as I, useMemo as We, lazy as Ke, useContext as A, Suspense as Z, useLayoutEffect as qe, useReducer as V } from "react";
|
|
5
5
|
import d from "clsx";
|
|
6
|
-
|
|
6
|
+
const Ye = ({
|
|
7
|
+
className: e,
|
|
8
|
+
viewBox: t,
|
|
9
|
+
title: r,
|
|
10
|
+
monotone: a,
|
|
11
|
+
...o
|
|
12
|
+
}) => /* @__PURE__ */ v(
|
|
13
|
+
Te,
|
|
14
|
+
{
|
|
15
|
+
defaultViewBox: "0 0 384 512",
|
|
16
|
+
size: "size-5",
|
|
17
|
+
viewBox: t,
|
|
18
|
+
className: e,
|
|
19
|
+
title: r || "Down",
|
|
20
|
+
...o,
|
|
21
|
+
children: [
|
|
22
|
+
/* @__PURE__ */ s(
|
|
23
|
+
"path",
|
|
24
|
+
{
|
|
25
|
+
opacity: a ? "1" : "0.4",
|
|
26
|
+
d: "M160 370.7V64c0-17.7 14.3-32 32-32s32 14.3 32 32V370.7l-32 32-32-32z"
|
|
27
|
+
}
|
|
28
|
+
),
|
|
29
|
+
/* @__PURE__ */ s("path", { d: "M169.4 470.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 402.7 54.6 265.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z" })
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
function Je(e) {
|
|
7
34
|
const t = e.toLowerCase().split("+").map((i) => i.trim()), r = {
|
|
8
35
|
alt: t.includes("alt"),
|
|
9
36
|
ctrl: t.includes("ctrl"),
|
|
@@ -16,54 +43,81 @@ function Pe(e) {
|
|
|
16
43
|
key: o
|
|
17
44
|
};
|
|
18
45
|
}
|
|
19
|
-
function
|
|
20
|
-
const { alt: r, ctrl: a, meta: o, mod: i, shift:
|
|
21
|
-
if (r !==
|
|
46
|
+
function Qe(e, t) {
|
|
47
|
+
const { alt: r, ctrl: a, meta: o, mod: i, shift: l, key: c } = e, { altKey: n, ctrlKey: h, metaKey: m, shiftKey: b, key: g } = t;
|
|
48
|
+
if (r !== n)
|
|
22
49
|
return !1;
|
|
23
50
|
if (i) {
|
|
24
|
-
if (!
|
|
51
|
+
if (!h && !m)
|
|
25
52
|
return !1;
|
|
26
|
-
} else if (a !==
|
|
53
|
+
} else if (a !== h || o !== m)
|
|
27
54
|
return !1;
|
|
28
|
-
return
|
|
55
|
+
return l !== b ? !1 : !!(c && (g.toLowerCase() === c.toLowerCase() || t.code.replace("Key", "").toLowerCase() === c.toLowerCase()));
|
|
29
56
|
}
|
|
30
|
-
function
|
|
31
|
-
return (t) =>
|
|
57
|
+
function Xe(e) {
|
|
58
|
+
return (t) => Qe(Je(e), t);
|
|
32
59
|
}
|
|
33
|
-
function
|
|
60
|
+
function Ze(e) {
|
|
34
61
|
return (t) => {
|
|
35
62
|
const r = "nativeEvent" in t ? t.nativeEvent : t;
|
|
36
63
|
e.forEach(([a, o, i = { preventDefault: !0 }]) => {
|
|
37
|
-
|
|
64
|
+
Xe(a)(r) && (i.preventDefault && t.preventDefault(), o(r));
|
|
38
65
|
});
|
|
39
66
|
};
|
|
40
67
|
}
|
|
68
|
+
function et() {
|
|
69
|
+
const e = C(!1);
|
|
70
|
+
return k(() => (e.current = !0, () => {
|
|
71
|
+
e.current = !1;
|
|
72
|
+
}), []), H(() => e.current, []);
|
|
73
|
+
}
|
|
74
|
+
const tt = {
|
|
75
|
+
x: 0,
|
|
76
|
+
y: 0,
|
|
77
|
+
width: 0,
|
|
78
|
+
height: 0,
|
|
79
|
+
top: 0,
|
|
80
|
+
left: 0,
|
|
81
|
+
bottom: 0,
|
|
82
|
+
right: 0
|
|
83
|
+
};
|
|
84
|
+
function rt(e) {
|
|
85
|
+
const t = et(), r = C(0), a = C(null), [o, i] = I(tt), l = We(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((c) => {
|
|
86
|
+
const n = c[0];
|
|
87
|
+
n && (cancelAnimationFrame(r.current), r.current = requestAnimationFrame(() => {
|
|
88
|
+
a.current && t() && i(n.contentRect);
|
|
89
|
+
}));
|
|
90
|
+
}), [t]);
|
|
91
|
+
return k(() => (a.current && (l == null || l.observe(a.current, e)), () => {
|
|
92
|
+
l == null || l.disconnect(), r.current && cancelAnimationFrame(r.current);
|
|
93
|
+
}), [l, e]), [a, o];
|
|
94
|
+
}
|
|
41
95
|
const y = [];
|
|
42
96
|
for (let e = 0; e < 256; ++e)
|
|
43
97
|
y.push((e + 256).toString(16).slice(1));
|
|
44
|
-
function
|
|
98
|
+
function at(e, t = 0) {
|
|
45
99
|
return (y[e[t + 0]] + y[e[t + 1]] + y[e[t + 2]] + y[e[t + 3]] + "-" + y[e[t + 4]] + y[e[t + 5]] + "-" + y[e[t + 6]] + y[e[t + 7]] + "-" + y[e[t + 8]] + y[e[t + 9]] + "-" + y[e[t + 10]] + y[e[t + 11]] + y[e[t + 12]] + y[e[t + 13]] + y[e[t + 14]] + y[e[t + 15]]).toLowerCase();
|
|
46
100
|
}
|
|
47
|
-
let
|
|
48
|
-
const
|
|
49
|
-
function
|
|
50
|
-
if (!
|
|
101
|
+
let D;
|
|
102
|
+
const ot = new Uint8Array(16);
|
|
103
|
+
function it() {
|
|
104
|
+
if (!D) {
|
|
51
105
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
52
106
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
53
|
-
|
|
107
|
+
D = crypto.getRandomValues.bind(crypto);
|
|
54
108
|
}
|
|
55
|
-
return
|
|
109
|
+
return D(ot);
|
|
56
110
|
}
|
|
57
|
-
const
|
|
58
|
-
function
|
|
59
|
-
if (
|
|
60
|
-
return
|
|
111
|
+
const nt = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), ee = { randomUUID: nt };
|
|
112
|
+
function F(e, t, r) {
|
|
113
|
+
if (ee.randomUUID && !t && !e)
|
|
114
|
+
return ee.randomUUID();
|
|
61
115
|
e = e || {};
|
|
62
|
-
const a = e.random || (e.rng ||
|
|
63
|
-
return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128,
|
|
116
|
+
const a = e.random || (e.rng || it)();
|
|
117
|
+
return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, at(a);
|
|
64
118
|
}
|
|
65
|
-
const
|
|
66
|
-
if ((t == null ? void 0 : t.type) ===
|
|
119
|
+
const st = (e, t) => {
|
|
120
|
+
if ((t == null ? void 0 : t.type) === we) {
|
|
67
121
|
const r = t.payload.messages.map((a) => ({
|
|
68
122
|
message: {
|
|
69
123
|
role: a.role,
|
|
@@ -82,35 +136,35 @@ const Xe = (e, t) => {
|
|
|
82
136
|
tags: e.tags
|
|
83
137
|
};
|
|
84
138
|
}
|
|
85
|
-
if ((t == null ? void 0 : t.type) ===
|
|
86
|
-
const r = t.payload.message.role, a = t.payload.message.content, o = t.payload.message.name, i = t.payload.message.processingTime,
|
|
139
|
+
if ((t == null ? void 0 : t.type) === R) {
|
|
140
|
+
const r = t.payload.message.role, a = t.payload.message.content, o = t.payload.message.name, i = t.payload.message.processingTime, l = t.payload.message.messageId;
|
|
87
141
|
if (r !== "") {
|
|
88
|
-
const
|
|
142
|
+
const c = {
|
|
89
143
|
role: r,
|
|
90
144
|
content: a,
|
|
91
145
|
name: o,
|
|
92
146
|
processingTime: i,
|
|
93
|
-
messageId:
|
|
147
|
+
messageId: l
|
|
94
148
|
};
|
|
95
|
-
if (r ===
|
|
96
|
-
const
|
|
97
|
-
(
|
|
149
|
+
if (r === B) {
|
|
150
|
+
const n = e.messages.findIndex(
|
|
151
|
+
(h) => h.message.messageId === l
|
|
98
152
|
);
|
|
99
|
-
if (
|
|
100
|
-
const
|
|
153
|
+
if (n !== -1) {
|
|
154
|
+
const h = e.messages.map((m, b) => b === n ? {
|
|
101
155
|
message: {
|
|
102
|
-
...
|
|
103
|
-
content: `${
|
|
156
|
+
...m.message,
|
|
157
|
+
content: `${m.message.content}${a}`,
|
|
104
158
|
processingTime: i,
|
|
105
159
|
name: o
|
|
106
160
|
}
|
|
107
|
-
} :
|
|
161
|
+
} : m);
|
|
108
162
|
return {
|
|
109
163
|
id: e.id,
|
|
110
164
|
model: e.model,
|
|
111
165
|
usage: e.usage,
|
|
112
166
|
isComponent: e.isComponent,
|
|
113
|
-
messages:
|
|
167
|
+
messages: h,
|
|
114
168
|
engine: e.engine,
|
|
115
169
|
tags: e.tags
|
|
116
170
|
};
|
|
@@ -126,21 +180,21 @@ const Xe = (e, t) => {
|
|
|
126
180
|
messages: [
|
|
127
181
|
...e.messages,
|
|
128
182
|
{
|
|
129
|
-
message:
|
|
183
|
+
message: c
|
|
130
184
|
}
|
|
131
185
|
]
|
|
132
186
|
};
|
|
133
187
|
}
|
|
134
188
|
}
|
|
135
|
-
return (t == null ? void 0 : t.type) ===
|
|
136
|
-
id:
|
|
189
|
+
return (t == null ? void 0 : t.type) === _e ? {
|
|
190
|
+
id: F(),
|
|
137
191
|
model: e.model,
|
|
138
192
|
engine: e.engine,
|
|
139
193
|
usage: 0,
|
|
140
194
|
messages: [],
|
|
141
195
|
isComponent: e.isComponent,
|
|
142
196
|
tags: e.tags
|
|
143
|
-
} : (t == null ? void 0 : t.type) ===
|
|
197
|
+
} : (t == null ? void 0 : t.type) === ie ? {
|
|
144
198
|
id: e.id,
|
|
145
199
|
model: t.payload.model,
|
|
146
200
|
engine: e.engine,
|
|
@@ -148,22 +202,22 @@ const Xe = (e, t) => {
|
|
|
148
202
|
usage: t.payload.usage,
|
|
149
203
|
messages: e.messages,
|
|
150
204
|
isComponent: e.isComponent
|
|
151
|
-
} : (t == null ? void 0 : t.type) ===
|
|
205
|
+
} : (t == null ? void 0 : t.type) === ne ? {
|
|
152
206
|
...e,
|
|
153
207
|
engine: t.payload.engine
|
|
154
|
-
} : (t == null ? void 0 : t.type) ===
|
|
208
|
+
} : (t == null ? void 0 : t.type) === se ? {
|
|
155
209
|
...e,
|
|
156
210
|
streaming: t.payload.streaming
|
|
157
211
|
} : e;
|
|
158
|
-
},
|
|
212
|
+
}, dt = (e, t) => {
|
|
159
213
|
switch (t == null ? void 0 : t.type) {
|
|
160
|
-
case
|
|
214
|
+
case Ee:
|
|
161
215
|
return {
|
|
162
216
|
searchString: t.payload.searchString,
|
|
163
217
|
sortedCell: e.sortedCell,
|
|
164
218
|
sortDirection: e.sortDirection
|
|
165
219
|
};
|
|
166
|
-
case
|
|
220
|
+
case Ne:
|
|
167
221
|
return {
|
|
168
222
|
searchString: e.searchString,
|
|
169
223
|
sortedCell: t.payload.sortedCell,
|
|
@@ -172,19 +226,19 @@ const Xe = (e, t) => {
|
|
|
172
226
|
default:
|
|
173
227
|
return e;
|
|
174
228
|
}
|
|
175
|
-
},
|
|
229
|
+
}, ct = (e, t) => {
|
|
176
230
|
switch (t == null ? void 0 : t.type) {
|
|
177
231
|
case le:
|
|
178
232
|
return {
|
|
179
233
|
tags: e.tags,
|
|
180
234
|
tag: t.payload.tag
|
|
181
235
|
};
|
|
182
|
-
case
|
|
236
|
+
case ce:
|
|
183
237
|
return {
|
|
184
238
|
tags: e.tags,
|
|
185
239
|
tag: ""
|
|
186
240
|
};
|
|
187
|
-
case
|
|
241
|
+
case de:
|
|
188
242
|
return {
|
|
189
243
|
tags: t.payload.tags,
|
|
190
244
|
tag: ""
|
|
@@ -206,26 +260,26 @@ try {
|
|
|
206
260
|
});
|
|
207
261
|
} catch {
|
|
208
262
|
}
|
|
209
|
-
const
|
|
263
|
+
const lt = "av-bubble", te = "av-button", W = "icon", gt = "button", mt = "link", ut = ({
|
|
210
264
|
type: e,
|
|
211
265
|
size: t,
|
|
212
266
|
labelRight: r,
|
|
213
267
|
labelLeft: a,
|
|
214
268
|
align: o
|
|
215
269
|
}) => {
|
|
216
|
-
const i = "text-sm font-medium max-h-8 py-0 px-2",
|
|
270
|
+
const i = "text-sm font-medium max-h-8 py-0 px-2", l = "text-base font-medium max-h-9 py-1 px-3", c = "text-lg font-medium max-h-12 py-2 px-4";
|
|
217
271
|
switch (e) {
|
|
218
|
-
case
|
|
272
|
+
case gt:
|
|
219
273
|
return d({
|
|
220
274
|
[i]: t === "small",
|
|
221
|
-
[
|
|
222
|
-
[
|
|
275
|
+
[l]: t === "medium",
|
|
276
|
+
[c]: t === "large"
|
|
223
277
|
});
|
|
224
|
-
case
|
|
278
|
+
case mt:
|
|
225
279
|
return d("text-center", {
|
|
226
280
|
[i]: t === "small",
|
|
227
|
-
[
|
|
228
|
-
[
|
|
281
|
+
[l]: t === "medium",
|
|
282
|
+
[c]: t === "large"
|
|
229
283
|
});
|
|
230
284
|
case W:
|
|
231
285
|
return d("inline-flex items-center", {
|
|
@@ -240,7 +294,7 @@ const tt = "av-bubble", ee = "av-button", W = "icon", rt = "button", at = "link"
|
|
|
240
294
|
"h-12 px-4 text-lg font-medium": t === "large" && (r || a)
|
|
241
295
|
});
|
|
242
296
|
}
|
|
243
|
-
},
|
|
297
|
+
}, ht = ({
|
|
244
298
|
mode: e,
|
|
245
299
|
noBackground: t,
|
|
246
300
|
noTruncate: r,
|
|
@@ -297,7 +351,7 @@ const tt = "av-bubble", ee = "av-button", W = "icon", rt = "button", at = "link"
|
|
|
297
351
|
"bg-action-selected-dark text-copy-light dark:bg-action-selected-light dark:text-copy-lighter": e === "system",
|
|
298
352
|
"bg-action-selected-light text-copy-lighter dark:bg-action-selected-dark dark:text-copy-light": e === "alt-system"
|
|
299
353
|
});
|
|
300
|
-
},
|
|
354
|
+
}, bt = ({
|
|
301
355
|
mode: e,
|
|
302
356
|
disabled: t,
|
|
303
357
|
variant: r
|
|
@@ -332,7 +386,7 @@ const tt = "av-bubble", ee = "av-button", W = "icon", rt = "button", at = "link"
|
|
|
332
386
|
"hover:bg-action-selected-dark-hover dark:hover:bg-action-selected-light-hover": e === "system",
|
|
333
387
|
"hover:bg-action-selected-light-hover dark:hover:bg-action-selected-dark-hover": e === "alt-system"
|
|
334
388
|
});
|
|
335
|
-
},
|
|
389
|
+
}, pt = ({
|
|
336
390
|
mode: e,
|
|
337
391
|
disabled: t,
|
|
338
392
|
variant: r
|
|
@@ -367,7 +421,7 @@ const tt = "av-bubble", ee = "av-button", W = "icon", rt = "button", at = "link"
|
|
|
367
421
|
"active:bg-action-selected-dark-active dark:active:bg-action-selected-light-active": e === "system",
|
|
368
422
|
"active:bg-action-selected-light-active dark:active:bg-action-selected-dark-active": e === "alt-system"
|
|
369
423
|
});
|
|
370
|
-
},
|
|
424
|
+
}, yt = ({
|
|
371
425
|
mode: e,
|
|
372
426
|
noBorder: t,
|
|
373
427
|
variant: r
|
|
@@ -402,73 +456,73 @@ const tt = "av-bubble", ee = "av-button", W = "icon", rt = "button", at = "link"
|
|
|
402
456
|
"border-border-selected-dark dark:border-border-selected-medium": e === "system",
|
|
403
457
|
"border-border-selected-medium dark:border-border-selected-dark": e === "alt-system"
|
|
404
458
|
});
|
|
405
|
-
},
|
|
459
|
+
}, ft = ({
|
|
406
460
|
focusMode: e
|
|
407
461
|
}) => d("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
|
|
408
462
|
"focus:outline-focus-dark": e === "dark",
|
|
409
463
|
"focus:outline-focus-light": e === "light",
|
|
410
464
|
"focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
|
|
411
465
|
"focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
|
|
412
|
-
}),
|
|
466
|
+
}), he = ({
|
|
413
467
|
type: e,
|
|
414
468
|
className: t,
|
|
415
469
|
raw: r,
|
|
416
470
|
mode: a,
|
|
417
471
|
focusMode: o,
|
|
418
472
|
disabled: i,
|
|
419
|
-
fullWidth:
|
|
420
|
-
size:
|
|
421
|
-
noBorder:
|
|
422
|
-
labelRight:
|
|
423
|
-
labelLeft:
|
|
424
|
-
noBackground:
|
|
425
|
-
variant:
|
|
473
|
+
fullWidth: l,
|
|
474
|
+
size: c,
|
|
475
|
+
noBorder: n,
|
|
476
|
+
labelRight: h,
|
|
477
|
+
labelLeft: m,
|
|
478
|
+
noBackground: b,
|
|
479
|
+
variant: g,
|
|
426
480
|
noTruncate: u,
|
|
427
481
|
align: p,
|
|
428
|
-
radius:
|
|
429
|
-
}) => (
|
|
430
|
-
|
|
431
|
-
|
|
482
|
+
radius: f
|
|
483
|
+
}) => (g || (g = "primary"), r ? d(te, t) : d(
|
|
484
|
+
te,
|
|
485
|
+
ht({
|
|
432
486
|
mode: a,
|
|
433
|
-
variant:
|
|
434
|
-
noBackground:
|
|
487
|
+
variant: g,
|
|
488
|
+
noBackground: b,
|
|
435
489
|
noTruncate: u,
|
|
436
|
-
radius:
|
|
490
|
+
radius: f
|
|
437
491
|
}),
|
|
438
|
-
|
|
492
|
+
ut({
|
|
439
493
|
type: e,
|
|
440
|
-
size:
|
|
441
|
-
labelRight:
|
|
442
|
-
labelLeft:
|
|
494
|
+
size: c,
|
|
495
|
+
labelRight: h,
|
|
496
|
+
labelLeft: m,
|
|
443
497
|
align: p
|
|
444
498
|
}),
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
499
|
+
yt({ mode: a, variant: g, noBorder: n }),
|
|
500
|
+
ft({ focusMode: o }),
|
|
501
|
+
bt({ mode: a, variant: g, disabled: i }),
|
|
502
|
+
pt({ mode: a, variant: g, disabled: i }),
|
|
449
503
|
{
|
|
450
|
-
"w-full":
|
|
504
|
+
"w-full": l,
|
|
451
505
|
"disabled:cursor-not-allowed disabled:opacity-50": i
|
|
452
506
|
},
|
|
453
507
|
t
|
|
454
|
-
)),
|
|
508
|
+
)), vt = (e, t, r) => {
|
|
455
509
|
var a;
|
|
456
510
|
!t && (!document.activeElement || document.activeElement !== e.currentTarget) && typeof ((a = e == null ? void 0 : e.currentTarget) == null ? void 0 : a.focus) == "function" && e.currentTarget.focus(), typeof r == "function" && r(e);
|
|
457
|
-
},
|
|
511
|
+
}, K = S.forwardRef((e, t) => {
|
|
458
512
|
const { onClick: r, noInternalClick: a = !1, ...o } = e;
|
|
459
513
|
return /* @__PURE__ */ s(
|
|
460
514
|
"button",
|
|
461
515
|
{
|
|
462
516
|
ref: t,
|
|
463
517
|
onClick: (i) => {
|
|
464
|
-
|
|
518
|
+
vt(i, a, r);
|
|
465
519
|
},
|
|
466
520
|
...o
|
|
467
521
|
}
|
|
468
522
|
);
|
|
469
523
|
});
|
|
470
|
-
|
|
471
|
-
const
|
|
524
|
+
K.displayName = "BaseButton";
|
|
525
|
+
const be = S.forwardRef(
|
|
472
526
|
({
|
|
473
527
|
children: e,
|
|
474
528
|
disabled: t = !1,
|
|
@@ -476,59 +530,59 @@ const he = I.forwardRef(
|
|
|
476
530
|
focusMode: a = "system",
|
|
477
531
|
fullWidth: o = !1,
|
|
478
532
|
className: i,
|
|
479
|
-
type:
|
|
480
|
-
raw:
|
|
481
|
-
noBorder:
|
|
482
|
-
"aria-label":
|
|
483
|
-
label:
|
|
484
|
-
size:
|
|
485
|
-
labelRight:
|
|
533
|
+
type: l = "button",
|
|
534
|
+
raw: c = !1,
|
|
535
|
+
noBorder: n = !1,
|
|
536
|
+
"aria-label": h,
|
|
537
|
+
label: m,
|
|
538
|
+
size: b = "medium",
|
|
539
|
+
labelRight: g,
|
|
486
540
|
labelLeft: u,
|
|
487
541
|
noBackground: p = !1,
|
|
488
|
-
align:
|
|
542
|
+
align: f = "center",
|
|
489
543
|
radius: _ = "large",
|
|
490
|
-
...
|
|
491
|
-
},
|
|
492
|
-
const
|
|
544
|
+
...N
|
|
545
|
+
}, x) => {
|
|
546
|
+
const T = he({
|
|
493
547
|
type: W,
|
|
494
548
|
mode: r,
|
|
495
549
|
focusMode: a,
|
|
496
550
|
fullWidth: o,
|
|
497
551
|
disabled: t,
|
|
498
|
-
raw:
|
|
552
|
+
raw: c,
|
|
499
553
|
className: i,
|
|
500
|
-
noBorder:
|
|
501
|
-
size:
|
|
502
|
-
labelRight:
|
|
554
|
+
noBorder: n,
|
|
555
|
+
size: b,
|
|
556
|
+
labelRight: g,
|
|
503
557
|
labelLeft: u,
|
|
504
558
|
noBackground: p,
|
|
505
|
-
align:
|
|
559
|
+
align: f,
|
|
506
560
|
radius: _
|
|
507
|
-
}),
|
|
508
|
-
"text-copy-accent-dark": r === "light" && !
|
|
509
|
-
"text-copy-light": r === "dark" && !
|
|
510
|
-
"text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !
|
|
511
|
-
"text-copy-light dark:text-copy-accent-dark": r === "system" && !
|
|
561
|
+
}), E = d({
|
|
562
|
+
"text-copy-accent-dark": r === "light" && !c,
|
|
563
|
+
"text-copy-light": r === "dark" && !c,
|
|
564
|
+
"text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !c,
|
|
565
|
+
"text-copy-light dark:text-copy-accent-dark": r === "system" && !c
|
|
512
566
|
});
|
|
513
|
-
return /* @__PURE__ */
|
|
514
|
-
|
|
567
|
+
return /* @__PURE__ */ v(
|
|
568
|
+
K,
|
|
515
569
|
{
|
|
516
|
-
ref:
|
|
517
|
-
className:
|
|
570
|
+
ref: x,
|
|
571
|
+
className: T,
|
|
518
572
|
disabled: t,
|
|
519
|
-
type:
|
|
520
|
-
"aria-label":
|
|
521
|
-
...
|
|
573
|
+
type: l,
|
|
574
|
+
"aria-label": h || m,
|
|
575
|
+
...N,
|
|
522
576
|
children: [
|
|
523
577
|
u && /* @__PURE__ */ s("span", { className: "pr-2", children: u }),
|
|
524
|
-
/* @__PURE__ */ s("div", { className:
|
|
525
|
-
|
|
578
|
+
/* @__PURE__ */ s("div", { className: E, children: e }),
|
|
579
|
+
g && /* @__PURE__ */ s("span", { className: "pl-2", children: g })
|
|
526
580
|
]
|
|
527
581
|
}
|
|
528
582
|
);
|
|
529
583
|
}
|
|
530
584
|
);
|
|
531
|
-
|
|
585
|
+
be.displayName = "ButtonIcon";
|
|
532
586
|
/*!
|
|
533
587
|
@versini/ui-button v3.2.0
|
|
534
588
|
© 2024 gizmette.com
|
|
@@ -542,7 +596,7 @@ try {
|
|
|
542
596
|
});
|
|
543
597
|
} catch {
|
|
544
598
|
}
|
|
545
|
-
const
|
|
599
|
+
const kt = S.forwardRef(
|
|
546
600
|
({
|
|
547
601
|
children: e,
|
|
548
602
|
disabled: t = !1,
|
|
@@ -550,41 +604,41 @@ const gt = I.forwardRef(
|
|
|
550
604
|
focusMode: a = "system",
|
|
551
605
|
fullWidth: o = !1,
|
|
552
606
|
className: i,
|
|
553
|
-
type:
|
|
554
|
-
raw:
|
|
555
|
-
noBorder:
|
|
556
|
-
"aria-label":
|
|
557
|
-
label:
|
|
558
|
-
size:
|
|
559
|
-
labelRight:
|
|
607
|
+
type: l = "button",
|
|
608
|
+
raw: c = !1,
|
|
609
|
+
noBorder: n = !1,
|
|
610
|
+
"aria-label": h,
|
|
611
|
+
label: m,
|
|
612
|
+
size: b = "medium",
|
|
613
|
+
labelRight: g,
|
|
560
614
|
labelLeft: u,
|
|
561
615
|
noBackground: p = !1,
|
|
562
|
-
align:
|
|
616
|
+
align: f = "center",
|
|
563
617
|
active: _ = !1,
|
|
564
|
-
radius:
|
|
565
|
-
...
|
|
566
|
-
},
|
|
567
|
-
const
|
|
618
|
+
radius: N = "large",
|
|
619
|
+
...x
|
|
620
|
+
}, T) => {
|
|
621
|
+
const E = he({
|
|
568
622
|
type: W,
|
|
569
623
|
mode: r,
|
|
570
624
|
focusMode: a,
|
|
571
625
|
fullWidth: o,
|
|
572
626
|
disabled: t,
|
|
573
|
-
raw:
|
|
627
|
+
raw: c,
|
|
574
628
|
className: i,
|
|
575
|
-
noBorder:
|
|
576
|
-
size:
|
|
577
|
-
labelRight:
|
|
629
|
+
noBorder: n,
|
|
630
|
+
size: b,
|
|
631
|
+
labelRight: g,
|
|
578
632
|
labelLeft: u,
|
|
579
633
|
noBackground: p,
|
|
580
|
-
align:
|
|
581
|
-
radius:
|
|
582
|
-
}),
|
|
583
|
-
"text-copy-accent-dark": r === "light" && !
|
|
584
|
-
"text-copy-light": r === "dark" && !
|
|
585
|
-
"text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !
|
|
586
|
-
"text-copy-light dark:text-copy-accent-dark": r === "system" && !
|
|
587
|
-
}),
|
|
634
|
+
align: f,
|
|
635
|
+
radius: N
|
|
636
|
+
}), w = d({
|
|
637
|
+
"text-copy-accent-dark": r === "light" && !c,
|
|
638
|
+
"text-copy-light": r === "dark" && !c,
|
|
639
|
+
"text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !c,
|
|
640
|
+
"text-copy-light dark:text-copy-accent-dark": r === "system" && !c
|
|
641
|
+
}), U = _ ? d(
|
|
588
642
|
"relative",
|
|
589
643
|
"focus-within:static",
|
|
590
644
|
"focus-within:after:border-transparent",
|
|
@@ -601,53 +655,53 @@ const gt = I.forwardRef(
|
|
|
601
655
|
"after:border-table-light dark:after:border-table-dark": r === "alt-system"
|
|
602
656
|
}
|
|
603
657
|
) : "";
|
|
604
|
-
return /* @__PURE__ */ s("div", { className:
|
|
605
|
-
|
|
658
|
+
return /* @__PURE__ */ s("div", { className: U, children: /* @__PURE__ */ v(
|
|
659
|
+
K,
|
|
606
660
|
{
|
|
607
|
-
ref:
|
|
608
|
-
className:
|
|
661
|
+
ref: T,
|
|
662
|
+
className: E,
|
|
609
663
|
disabled: t,
|
|
610
|
-
type:
|
|
611
|
-
"aria-label":
|
|
612
|
-
...
|
|
664
|
+
type: l,
|
|
665
|
+
"aria-label": h || m,
|
|
666
|
+
...x,
|
|
613
667
|
children: [
|
|
614
668
|
u && /* @__PURE__ */ s("span", { className: "pr-2", children: u }),
|
|
615
|
-
/* @__PURE__ */ s("div", { className:
|
|
616
|
-
|
|
669
|
+
/* @__PURE__ */ s("div", { className: w, children: e }),
|
|
670
|
+
g && /* @__PURE__ */ s("span", { className: "pl-2", children: g })
|
|
617
671
|
]
|
|
618
672
|
}
|
|
619
673
|
) });
|
|
620
674
|
}
|
|
621
675
|
);
|
|
622
|
-
|
|
623
|
-
const
|
|
676
|
+
kt.displayName = "ButtonSort";
|
|
677
|
+
const pe = ({
|
|
624
678
|
children: e,
|
|
625
679
|
fill: t,
|
|
626
680
|
viewBox: r,
|
|
627
681
|
className: a,
|
|
628
682
|
defaultViewBox: o,
|
|
629
683
|
size: i,
|
|
630
|
-
title:
|
|
631
|
-
semantic:
|
|
632
|
-
...
|
|
684
|
+
title: l,
|
|
685
|
+
semantic: c = !1,
|
|
686
|
+
...n
|
|
633
687
|
}) => {
|
|
634
|
-
const
|
|
635
|
-
return /* @__PURE__ */
|
|
688
|
+
const h = d(i, a);
|
|
689
|
+
return /* @__PURE__ */ v(G, { children: [
|
|
636
690
|
/* @__PURE__ */ s(
|
|
637
691
|
"svg",
|
|
638
692
|
{
|
|
639
693
|
xmlns: "http://www.w3.org/2000/svg",
|
|
640
|
-
className:
|
|
694
|
+
className: h,
|
|
641
695
|
viewBox: r || o,
|
|
642
696
|
fill: t || "currentColor",
|
|
643
697
|
role: "img",
|
|
644
|
-
"aria-hidden": !
|
|
698
|
+
"aria-hidden": !c,
|
|
645
699
|
focusable: !1,
|
|
646
|
-
...
|
|
700
|
+
...n,
|
|
647
701
|
children: e
|
|
648
702
|
}
|
|
649
703
|
),
|
|
650
|
-
|
|
704
|
+
l && c && /* @__PURE__ */ s("span", { className: "sr-only", children: l })
|
|
651
705
|
] });
|
|
652
706
|
};
|
|
653
707
|
/*!
|
|
@@ -663,14 +717,14 @@ try {
|
|
|
663
717
|
});
|
|
664
718
|
} catch {
|
|
665
719
|
}
|
|
666
|
-
const
|
|
720
|
+
const xt = ({
|
|
667
721
|
className: e,
|
|
668
722
|
viewBox: t,
|
|
669
723
|
title: r,
|
|
670
724
|
monotone: a,
|
|
671
725
|
...o
|
|
672
|
-
}) => /* @__PURE__ */
|
|
673
|
-
|
|
726
|
+
}) => /* @__PURE__ */ v(
|
|
727
|
+
pe,
|
|
674
728
|
{
|
|
675
729
|
defaultViewBox: "0 0 448 512",
|
|
676
730
|
size: "size-5",
|
|
@@ -689,14 +743,14 @@ const mt = ({
|
|
|
689
743
|
/* @__PURE__ */ s("path", { d: "M337 175c9.4 9.4 9.4 24.6 0 33.9L209 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L303 175c9.4-9.4 24.6-9.4 33.9 0z" })
|
|
690
744
|
]
|
|
691
745
|
}
|
|
692
|
-
),
|
|
746
|
+
), Tt = ({
|
|
693
747
|
className: e,
|
|
694
748
|
viewBox: t,
|
|
695
749
|
title: r,
|
|
696
750
|
monotone: a,
|
|
697
751
|
...o
|
|
698
752
|
}) => /* @__PURE__ */ s(
|
|
699
|
-
|
|
753
|
+
pe,
|
|
700
754
|
{
|
|
701
755
|
defaultViewBox: "0 0 512 512",
|
|
702
756
|
size: "size-5",
|
|
@@ -720,23 +774,23 @@ try {
|
|
|
720
774
|
});
|
|
721
775
|
} catch {
|
|
722
776
|
}
|
|
723
|
-
const
|
|
777
|
+
const wt = () => "p-4 max-w-xs sm:max-w-md md:max-w-2xl", _t = ({ kind: e }) => d({
|
|
724
778
|
"bg-surface-lighter dark:bg-surface-dark": e === "left",
|
|
725
779
|
"bg-surface-accent": e === "right"
|
|
726
|
-
}),
|
|
780
|
+
}), Nt = ({ kind: e }) => d(
|
|
727
781
|
"prose prose-dark dark:prose-lighter prose-p:my-3 prose-blockquote:my-3 prose-ol:my-3 prose-ul:my-3 prose-ul:prose-li:marker:text-black",
|
|
728
782
|
{
|
|
729
783
|
"text-copy-lighter": e === "right"
|
|
730
784
|
}
|
|
731
|
-
),
|
|
785
|
+
), Et = ({ kind: e }) => d("rounded-b-xl", {
|
|
732
786
|
"rounded-tr-xl": e === "left",
|
|
733
787
|
"rounded-tl-xl": e === "right"
|
|
734
|
-
}),
|
|
788
|
+
}), Ct = ({
|
|
735
789
|
kind: e,
|
|
736
790
|
className: t
|
|
737
791
|
}) => {
|
|
738
792
|
const r = d(
|
|
739
|
-
|
|
793
|
+
lt,
|
|
740
794
|
"flex items-start",
|
|
741
795
|
{
|
|
742
796
|
"flex-row-reverse": e === "right"
|
|
@@ -744,10 +798,10 @@ const ht = () => "p-4 max-w-xs sm:max-w-md md:max-w-2xl", bt = ({ kind: e }) =>
|
|
|
744
798
|
t
|
|
745
799
|
), a = d(
|
|
746
800
|
"flex flex-col empty:hidden",
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
801
|
+
wt(),
|
|
802
|
+
Nt({ kind: e }),
|
|
803
|
+
_t({ kind: e }),
|
|
804
|
+
Et({ kind: e })
|
|
751
805
|
), o = "pr-2 pt-1 text-end text-xs text-copy-light", i = d("flex flex-col-reverse gap-2 sm:flex-row", {
|
|
752
806
|
"ml-2": e === "left",
|
|
753
807
|
"mr-2": e === "right"
|
|
@@ -758,73 +812,73 @@ const ht = () => "p-4 max-w-xs sm:max-w-md md:max-w-2xl", bt = ({ kind: e }) =>
|
|
|
758
812
|
footer: o,
|
|
759
813
|
copyButton: i
|
|
760
814
|
};
|
|
761
|
-
},
|
|
815
|
+
}, It = ({
|
|
762
816
|
children: e,
|
|
763
817
|
kind: t = "left",
|
|
764
818
|
className: r,
|
|
765
819
|
footer: a,
|
|
766
820
|
rawFooter: o,
|
|
767
821
|
copyToClipboard: i,
|
|
768
|
-
copyToClipboardFocusMode:
|
|
769
|
-
copyToClipboardMode:
|
|
822
|
+
copyToClipboardFocusMode: l = "system",
|
|
823
|
+
copyToClipboardMode: c = "system"
|
|
770
824
|
}) => {
|
|
771
|
-
const [
|
|
772
|
-
|
|
825
|
+
const [n, h] = I(!1), m = Ct({ kind: t, className: r }), b = !!i && (typeof i == "function" || typeof i == "string" || typeof e == "string"), g = () => {
|
|
826
|
+
h(!0), typeof i == "function" ? i(e) : typeof i == "string" ? navigator.clipboard.writeText(i) : typeof e == "string" && navigator.clipboard.writeText(e);
|
|
773
827
|
};
|
|
774
|
-
return
|
|
828
|
+
return k(() => {
|
|
775
829
|
let u;
|
|
776
|
-
return
|
|
777
|
-
|
|
830
|
+
return n && (u = window.setTimeout(() => {
|
|
831
|
+
h(!1);
|
|
778
832
|
}, 3e3)), () => {
|
|
779
833
|
clearTimeout(u);
|
|
780
834
|
};
|
|
781
|
-
}, [
|
|
782
|
-
/* @__PURE__ */
|
|
783
|
-
/* @__PURE__ */ s("div", { className:
|
|
784
|
-
a && Object.keys(a).map((u) => a[u] ? /* @__PURE__ */ s("div", { className: "prose-p:m-0", children: /* @__PURE__ */
|
|
835
|
+
}, [n]), /* @__PURE__ */ v("div", { className: m.wrapper, children: [
|
|
836
|
+
/* @__PURE__ */ v("div", { children: [
|
|
837
|
+
/* @__PURE__ */ s("div", { className: m.main, children: e }),
|
|
838
|
+
a && Object.keys(a).map((u) => a[u] ? /* @__PURE__ */ s("div", { className: "prose-p:m-0", children: /* @__PURE__ */ v("p", { className: m.footer, children: [
|
|
785
839
|
u,
|
|
786
840
|
": ",
|
|
787
841
|
a[u]
|
|
788
842
|
] }) }, `-${u}`) : null),
|
|
789
843
|
o && o
|
|
790
844
|
] }),
|
|
791
|
-
|
|
792
|
-
|
|
845
|
+
b && /* @__PURE__ */ s("div", { className: m.copyButton, children: /* @__PURE__ */ s(
|
|
846
|
+
be,
|
|
793
847
|
{
|
|
794
848
|
noBorder: !0,
|
|
795
849
|
noBackground: !0,
|
|
796
850
|
size: "small",
|
|
797
|
-
mode:
|
|
798
|
-
focusMode:
|
|
799
|
-
label:
|
|
800
|
-
onClick:
|
|
801
|
-
disabled:
|
|
802
|
-
children:
|
|
851
|
+
mode: c,
|
|
852
|
+
focusMode: l,
|
|
853
|
+
label: n ? "Copied to clipboard" : "Copy to clipboard",
|
|
854
|
+
onClick: g,
|
|
855
|
+
disabled: n,
|
|
856
|
+
children: n ? /* @__PURE__ */ s(xt, { size: "size-3" }) : /* @__PURE__ */ s(Tt, { size: "size-3" })
|
|
803
857
|
}
|
|
804
858
|
) })
|
|
805
859
|
] });
|
|
806
|
-
},
|
|
860
|
+
}, re = "av-button", ye = "icon", fe = "button", St = "link", Rt = ({
|
|
807
861
|
type: e,
|
|
808
862
|
size: t,
|
|
809
863
|
labelRight: r,
|
|
810
864
|
labelLeft: a,
|
|
811
865
|
align: o
|
|
812
866
|
}) => {
|
|
813
|
-
const i = "text-sm font-medium max-h-8 py-0 px-2",
|
|
867
|
+
const i = "text-sm font-medium max-h-8 py-0 px-2", l = "text-base font-medium max-h-9 py-1 px-3", c = "text-lg font-medium max-h-12 py-2 px-4";
|
|
814
868
|
switch (e) {
|
|
815
|
-
case
|
|
869
|
+
case fe:
|
|
816
870
|
return d({
|
|
817
871
|
[i]: t === "small",
|
|
818
|
-
[
|
|
819
|
-
[
|
|
872
|
+
[l]: t === "medium",
|
|
873
|
+
[c]: t === "large"
|
|
820
874
|
});
|
|
821
|
-
case
|
|
875
|
+
case St:
|
|
822
876
|
return d("text-center", {
|
|
823
877
|
[i]: t === "small",
|
|
824
|
-
[
|
|
825
|
-
[
|
|
878
|
+
[l]: t === "medium",
|
|
879
|
+
[c]: t === "large"
|
|
826
880
|
});
|
|
827
|
-
case
|
|
881
|
+
case ye:
|
|
828
882
|
return d("inline-flex items-center", {
|
|
829
883
|
"justify-center": o === "center",
|
|
830
884
|
"justify-start": o === "left",
|
|
@@ -837,7 +891,7 @@ const ht = () => "p-4 max-w-xs sm:max-w-md md:max-w-2xl", bt = ({ kind: e }) =>
|
|
|
837
891
|
"h-12 px-4 text-lg font-medium": t === "large" && (r || a)
|
|
838
892
|
});
|
|
839
893
|
}
|
|
840
|
-
},
|
|
894
|
+
}, Bt = ({
|
|
841
895
|
mode: e,
|
|
842
896
|
noBackground: t,
|
|
843
897
|
noTruncate: r,
|
|
@@ -894,7 +948,7 @@ const ht = () => "p-4 max-w-xs sm:max-w-md md:max-w-2xl", bt = ({ kind: e }) =>
|
|
|
894
948
|
"bg-action-selected-dark text-copy-light dark:bg-action-selected-light dark:text-copy-lighter": e === "system",
|
|
895
949
|
"bg-action-selected-light text-copy-lighter dark:bg-action-selected-dark dark:text-copy-light": e === "alt-system"
|
|
896
950
|
});
|
|
897
|
-
},
|
|
951
|
+
}, At = ({
|
|
898
952
|
mode: e,
|
|
899
953
|
disabled: t,
|
|
900
954
|
variant: r
|
|
@@ -929,7 +983,7 @@ const ht = () => "p-4 max-w-xs sm:max-w-md md:max-w-2xl", bt = ({ kind: e }) =>
|
|
|
929
983
|
"hover:bg-action-selected-dark-hover dark:hover:bg-action-selected-light-hover": e === "system",
|
|
930
984
|
"hover:bg-action-selected-light-hover dark:hover:bg-action-selected-dark-hover": e === "alt-system"
|
|
931
985
|
});
|
|
932
|
-
},
|
|
986
|
+
}, Mt = ({
|
|
933
987
|
mode: e,
|
|
934
988
|
disabled: t,
|
|
935
989
|
variant: r
|
|
@@ -964,7 +1018,7 @@ const ht = () => "p-4 max-w-xs sm:max-w-md md:max-w-2xl", bt = ({ kind: e }) =>
|
|
|
964
1018
|
"active:bg-action-selected-dark-active dark:active:bg-action-selected-light-active": e === "system",
|
|
965
1019
|
"active:bg-action-selected-light-active dark:active:bg-action-selected-dark-active": e === "alt-system"
|
|
966
1020
|
});
|
|
967
|
-
},
|
|
1021
|
+
}, Lt = ({
|
|
968
1022
|
mode: e,
|
|
969
1023
|
noBorder: t,
|
|
970
1024
|
variant: r
|
|
@@ -999,7 +1053,7 @@ const ht = () => "p-4 max-w-xs sm:max-w-md md:max-w-2xl", bt = ({ kind: e }) =>
|
|
|
999
1053
|
"border-border-selected-dark dark:border-border-selected-medium": e === "system",
|
|
1000
1054
|
"border-border-selected-medium dark:border-border-selected-dark": e === "alt-system"
|
|
1001
1055
|
});
|
|
1002
|
-
},
|
|
1056
|
+
}, Ot = ({
|
|
1003
1057
|
focusMode: e
|
|
1004
1058
|
}) => d("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
|
|
1005
1059
|
"focus:outline-focus-dark": e === "dark",
|
|
@@ -1013,59 +1067,59 @@ const ht = () => "p-4 max-w-xs sm:max-w-md md:max-w-2xl", bt = ({ kind: e }) =>
|
|
|
1013
1067
|
mode: a,
|
|
1014
1068
|
focusMode: o,
|
|
1015
1069
|
disabled: i,
|
|
1016
|
-
fullWidth:
|
|
1017
|
-
size:
|
|
1018
|
-
noBorder:
|
|
1019
|
-
labelRight:
|
|
1020
|
-
labelLeft:
|
|
1021
|
-
noBackground:
|
|
1022
|
-
variant:
|
|
1070
|
+
fullWidth: l,
|
|
1071
|
+
size: c,
|
|
1072
|
+
noBorder: n,
|
|
1073
|
+
labelRight: h,
|
|
1074
|
+
labelLeft: m,
|
|
1075
|
+
noBackground: b,
|
|
1076
|
+
variant: g,
|
|
1023
1077
|
noTruncate: u,
|
|
1024
1078
|
align: p,
|
|
1025
|
-
radius:
|
|
1026
|
-
}) => (
|
|
1027
|
-
|
|
1028
|
-
|
|
1079
|
+
radius: f
|
|
1080
|
+
}) => (g || (g = "primary"), r ? d(re, t) : d(
|
|
1081
|
+
re,
|
|
1082
|
+
Bt({
|
|
1029
1083
|
mode: a,
|
|
1030
|
-
variant:
|
|
1031
|
-
noBackground:
|
|
1084
|
+
variant: g,
|
|
1085
|
+
noBackground: b,
|
|
1032
1086
|
noTruncate: u,
|
|
1033
|
-
radius:
|
|
1087
|
+
radius: f
|
|
1034
1088
|
}),
|
|
1035
|
-
|
|
1089
|
+
Rt({
|
|
1036
1090
|
type: e,
|
|
1037
|
-
size:
|
|
1038
|
-
labelRight:
|
|
1039
|
-
labelLeft:
|
|
1091
|
+
size: c,
|
|
1092
|
+
labelRight: h,
|
|
1093
|
+
labelLeft: m,
|
|
1040
1094
|
align: p
|
|
1041
1095
|
}),
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1096
|
+
Lt({ mode: a, variant: g, noBorder: n }),
|
|
1097
|
+
Ot({ focusMode: o }),
|
|
1098
|
+
At({ mode: a, variant: g, disabled: i }),
|
|
1099
|
+
Mt({ mode: a, variant: g, disabled: i }),
|
|
1046
1100
|
{
|
|
1047
|
-
"w-full":
|
|
1101
|
+
"w-full": l,
|
|
1048
1102
|
"disabled:cursor-not-allowed disabled:opacity-50": i
|
|
1049
1103
|
},
|
|
1050
1104
|
t
|
|
1051
|
-
)),
|
|
1105
|
+
)), zt = (e, t, r) => {
|
|
1052
1106
|
var a;
|
|
1053
1107
|
!t && (!document.activeElement || document.activeElement !== e.currentTarget) && typeof ((a = e == null ? void 0 : e.currentTarget) == null ? void 0 : a.focus) == "function" && e.currentTarget.focus(), typeof r == "function" && r(e);
|
|
1054
|
-
},
|
|
1108
|
+
}, q = S.forwardRef((e, t) => {
|
|
1055
1109
|
const { onClick: r, noInternalClick: a = !1, ...o } = e;
|
|
1056
1110
|
return /* @__PURE__ */ s(
|
|
1057
1111
|
"button",
|
|
1058
1112
|
{
|
|
1059
1113
|
ref: t,
|
|
1060
1114
|
onClick: (i) => {
|
|
1061
|
-
|
|
1115
|
+
zt(i, a, r);
|
|
1062
1116
|
},
|
|
1063
1117
|
...o
|
|
1064
1118
|
}
|
|
1065
1119
|
);
|
|
1066
1120
|
});
|
|
1067
|
-
|
|
1068
|
-
const
|
|
1121
|
+
q.displayName = "BaseButton";
|
|
1122
|
+
const ke = S.forwardRef(
|
|
1069
1123
|
({
|
|
1070
1124
|
children: e,
|
|
1071
1125
|
disabled: t = !1,
|
|
@@ -1073,41 +1127,41 @@ const fe = I.forwardRef(
|
|
|
1073
1127
|
focusMode: a = "system",
|
|
1074
1128
|
fullWidth: o = !1,
|
|
1075
1129
|
className: i,
|
|
1076
|
-
size:
|
|
1077
|
-
raw:
|
|
1078
|
-
noBorder:
|
|
1079
|
-
variant:
|
|
1080
|
-
noTruncate:
|
|
1081
|
-
radius:
|
|
1082
|
-
...
|
|
1130
|
+
size: l = "medium",
|
|
1131
|
+
raw: c = !1,
|
|
1132
|
+
noBorder: n = !1,
|
|
1133
|
+
variant: h = "primary",
|
|
1134
|
+
noTruncate: m = !1,
|
|
1135
|
+
radius: b = "large",
|
|
1136
|
+
...g
|
|
1083
1137
|
}, u) => {
|
|
1084
1138
|
const p = ve({
|
|
1085
|
-
type:
|
|
1139
|
+
type: fe,
|
|
1086
1140
|
mode: r,
|
|
1087
1141
|
focusMode: a,
|
|
1088
1142
|
fullWidth: o,
|
|
1089
1143
|
disabled: t,
|
|
1090
|
-
raw:
|
|
1144
|
+
raw: c,
|
|
1091
1145
|
className: i,
|
|
1092
|
-
size:
|
|
1093
|
-
noBorder:
|
|
1094
|
-
variant:
|
|
1095
|
-
noTruncate:
|
|
1096
|
-
radius:
|
|
1146
|
+
size: l,
|
|
1147
|
+
noBorder: n,
|
|
1148
|
+
variant: h,
|
|
1149
|
+
noTruncate: m,
|
|
1150
|
+
radius: b
|
|
1097
1151
|
});
|
|
1098
1152
|
return /* @__PURE__ */ s(
|
|
1099
|
-
|
|
1153
|
+
q,
|
|
1100
1154
|
{
|
|
1101
1155
|
ref: u,
|
|
1102
1156
|
className: p,
|
|
1103
1157
|
disabled: t,
|
|
1104
|
-
...
|
|
1158
|
+
...g,
|
|
1105
1159
|
children: e
|
|
1106
1160
|
}
|
|
1107
1161
|
);
|
|
1108
1162
|
}
|
|
1109
1163
|
);
|
|
1110
|
-
|
|
1164
|
+
ke.displayName = "Button";
|
|
1111
1165
|
/*!
|
|
1112
1166
|
@versini/ui-button v3.2.0
|
|
1113
1167
|
© 2024 gizmette.com
|
|
@@ -1121,7 +1175,7 @@ try {
|
|
|
1121
1175
|
});
|
|
1122
1176
|
} catch {
|
|
1123
1177
|
}
|
|
1124
|
-
const
|
|
1178
|
+
const Ut = S.forwardRef(
|
|
1125
1179
|
({
|
|
1126
1180
|
children: e,
|
|
1127
1181
|
disabled: t = !1,
|
|
@@ -1129,41 +1183,41 @@ const Ct = I.forwardRef(
|
|
|
1129
1183
|
focusMode: a = "system",
|
|
1130
1184
|
fullWidth: o = !1,
|
|
1131
1185
|
className: i,
|
|
1132
|
-
type:
|
|
1133
|
-
raw:
|
|
1134
|
-
noBorder:
|
|
1135
|
-
"aria-label":
|
|
1136
|
-
label:
|
|
1137
|
-
size:
|
|
1138
|
-
labelRight:
|
|
1186
|
+
type: l = "button",
|
|
1187
|
+
raw: c = !1,
|
|
1188
|
+
noBorder: n = !1,
|
|
1189
|
+
"aria-label": h,
|
|
1190
|
+
label: m,
|
|
1191
|
+
size: b = "medium",
|
|
1192
|
+
labelRight: g,
|
|
1139
1193
|
labelLeft: u,
|
|
1140
1194
|
noBackground: p = !1,
|
|
1141
|
-
align:
|
|
1195
|
+
align: f = "center",
|
|
1142
1196
|
active: _ = !1,
|
|
1143
|
-
radius:
|
|
1144
|
-
...
|
|
1145
|
-
},
|
|
1146
|
-
const
|
|
1147
|
-
type:
|
|
1197
|
+
radius: N = "large",
|
|
1198
|
+
...x
|
|
1199
|
+
}, T) => {
|
|
1200
|
+
const E = ve({
|
|
1201
|
+
type: ye,
|
|
1148
1202
|
mode: r,
|
|
1149
1203
|
focusMode: a,
|
|
1150
1204
|
fullWidth: o,
|
|
1151
1205
|
disabled: t,
|
|
1152
|
-
raw:
|
|
1206
|
+
raw: c,
|
|
1153
1207
|
className: i,
|
|
1154
|
-
noBorder:
|
|
1155
|
-
size:
|
|
1156
|
-
labelRight:
|
|
1208
|
+
noBorder: n,
|
|
1209
|
+
size: b,
|
|
1210
|
+
labelRight: g,
|
|
1157
1211
|
labelLeft: u,
|
|
1158
1212
|
noBackground: p,
|
|
1159
|
-
align:
|
|
1160
|
-
radius:
|
|
1161
|
-
}),
|
|
1162
|
-
"text-copy-accent-dark": r === "light" && !
|
|
1163
|
-
"text-copy-light": r === "dark" && !
|
|
1164
|
-
"text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !
|
|
1165
|
-
"text-copy-light dark:text-copy-accent-dark": r === "system" && !
|
|
1166
|
-
}),
|
|
1213
|
+
align: f,
|
|
1214
|
+
radius: N
|
|
1215
|
+
}), w = d({
|
|
1216
|
+
"text-copy-accent-dark": r === "light" && !c,
|
|
1217
|
+
"text-copy-light": r === "dark" && !c,
|
|
1218
|
+
"text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !c,
|
|
1219
|
+
"text-copy-light dark:text-copy-accent-dark": r === "system" && !c
|
|
1220
|
+
}), U = _ ? d(
|
|
1167
1221
|
"relative",
|
|
1168
1222
|
"focus-within:static",
|
|
1169
1223
|
"focus-within:after:border-transparent",
|
|
@@ -1180,28 +1234,28 @@ const Ct = I.forwardRef(
|
|
|
1180
1234
|
"after:border-table-light dark:after:border-table-dark": r === "alt-system"
|
|
1181
1235
|
}
|
|
1182
1236
|
) : "";
|
|
1183
|
-
return /* @__PURE__ */ s("div", { className:
|
|
1184
|
-
|
|
1237
|
+
return /* @__PURE__ */ s("div", { className: U, children: /* @__PURE__ */ v(
|
|
1238
|
+
q,
|
|
1185
1239
|
{
|
|
1186
|
-
ref:
|
|
1187
|
-
className:
|
|
1240
|
+
ref: T,
|
|
1241
|
+
className: E,
|
|
1188
1242
|
disabled: t,
|
|
1189
|
-
type:
|
|
1190
|
-
"aria-label":
|
|
1191
|
-
...
|
|
1243
|
+
type: l,
|
|
1244
|
+
"aria-label": h || m,
|
|
1245
|
+
...x,
|
|
1192
1246
|
children: [
|
|
1193
1247
|
u && /* @__PURE__ */ s("span", { className: "pr-2", children: u }),
|
|
1194
|
-
/* @__PURE__ */ s("div", { className:
|
|
1195
|
-
|
|
1248
|
+
/* @__PURE__ */ s("div", { className: w, children: e }),
|
|
1249
|
+
g && /* @__PURE__ */ s("span", { className: "pl-2", children: g })
|
|
1196
1250
|
]
|
|
1197
1251
|
}
|
|
1198
1252
|
) });
|
|
1199
1253
|
}
|
|
1200
1254
|
);
|
|
1201
|
-
|
|
1202
|
-
const
|
|
1255
|
+
Ut.displayName = "ButtonSort";
|
|
1256
|
+
const Vt = 200, Dt = ({
|
|
1203
1257
|
string: e,
|
|
1204
|
-
idealLength: t =
|
|
1258
|
+
idealLength: t = Vt
|
|
1205
1259
|
}) => {
|
|
1206
1260
|
if (e.length <= t)
|
|
1207
1261
|
return { string: e, isTruncated: !1 };
|
|
@@ -1212,30 +1266,30 @@ const St = 200, Rt = ({
|
|
|
1212
1266
|
string: e.slice(0, t + r),
|
|
1213
1267
|
isTruncated: !0
|
|
1214
1268
|
};
|
|
1215
|
-
},
|
|
1269
|
+
}, $t = ({
|
|
1216
1270
|
children: e,
|
|
1217
1271
|
length: t = 200,
|
|
1218
1272
|
mode: r = "system",
|
|
1219
1273
|
focusMode: a = "system"
|
|
1220
1274
|
}) => {
|
|
1221
|
-
const [o, i] =
|
|
1275
|
+
const [o, i] = I(!1);
|
|
1222
1276
|
if (typeof e != "string")
|
|
1223
1277
|
return e;
|
|
1224
|
-
const { string:
|
|
1278
|
+
const { string: l, isTruncated: c } = Dt({
|
|
1225
1279
|
string: e,
|
|
1226
1280
|
idealLength: t
|
|
1227
1281
|
});
|
|
1228
|
-
return /* @__PURE__ */
|
|
1229
|
-
o ? e :
|
|
1230
|
-
|
|
1231
|
-
|
|
1282
|
+
return /* @__PURE__ */ v("span", { style: { wordBreak: "break-word" }, children: [
|
|
1283
|
+
o ? e : l,
|
|
1284
|
+
c && /* @__PURE__ */ s(
|
|
1285
|
+
ke,
|
|
1232
1286
|
{
|
|
1233
1287
|
mode: r,
|
|
1234
1288
|
focusMode: a,
|
|
1235
1289
|
className: "ml-2",
|
|
1236
1290
|
size: "small",
|
|
1237
|
-
onClick: (
|
|
1238
|
-
|
|
1291
|
+
onClick: (n) => {
|
|
1292
|
+
n.preventDefault(), i(!o);
|
|
1239
1293
|
},
|
|
1240
1294
|
children: o ? "less..." : "more..."
|
|
1241
1295
|
}
|
|
@@ -1255,200 +1309,237 @@ try {
|
|
|
1255
1309
|
});
|
|
1256
1310
|
} catch {
|
|
1257
1311
|
}
|
|
1258
|
-
const
|
|
1312
|
+
const ae = Ke(
|
|
1259
1313
|
() => import(
|
|
1260
1314
|
/* webpackChunkName: "LazyMessageAssistant" */
|
|
1261
|
-
"./LazyMessageAssistant.
|
|
1315
|
+
"./LazyMessageAssistant.BSHGsDRn.js"
|
|
1262
1316
|
).then((e) => e.LazyMessageAssistant)
|
|
1263
|
-
),
|
|
1264
|
-
const { state: e } =
|
|
1265
|
-
return /* @__PURE__ */
|
|
1317
|
+
), Ht = () => {
|
|
1318
|
+
const { state: e } = A(z);
|
|
1319
|
+
return /* @__PURE__ */ v("div", { className: "space-y-6 mt-2", children: [
|
|
1266
1320
|
e && e.messages.length > 0 && e.messages.map((t, r) => {
|
|
1267
|
-
const { role: a, content: o, name: i, processingTime:
|
|
1268
|
-
return (a ===
|
|
1269
|
-
|
|
1321
|
+
const { role: a, content: o, name: i, processingTime: l } = t.message;
|
|
1322
|
+
return (a === B || a === j) && o ? /* @__PURE__ */ s(Z, { fallback: /* @__PURE__ */ s("span", {}), children: /* @__PURE__ */ s(
|
|
1323
|
+
ae,
|
|
1270
1324
|
{
|
|
1271
1325
|
name: i,
|
|
1272
|
-
processingTime:
|
|
1326
|
+
processingTime: l,
|
|
1273
1327
|
children: o
|
|
1274
1328
|
}
|
|
1275
|
-
) }, `${r}-${a}`) : a ===
|
|
1276
|
-
|
|
1329
|
+
) }, `${r}-${a}`) : a === $ && o ? /* @__PURE__ */ s(
|
|
1330
|
+
It,
|
|
1277
1331
|
{
|
|
1278
1332
|
kind: "right",
|
|
1279
1333
|
copyToClipboard: o,
|
|
1280
1334
|
copyToClipboardFocusMode: "light",
|
|
1281
|
-
children: /* @__PURE__ */ s(
|
|
1335
|
+
children: /* @__PURE__ */ s($t, { mode: "light", focusMode: "light", children: o })
|
|
1282
1336
|
},
|
|
1283
1337
|
`${r}-${a}`
|
|
1284
1338
|
) : null;
|
|
1285
1339
|
}),
|
|
1286
|
-
|
|
1340
|
+
Ce($, e) && /* @__PURE__ */ s(Z, { fallback: /* @__PURE__ */ s("span", {}), children: /* @__PURE__ */ s(ae, { loading: !0 }) })
|
|
1341
|
+
] });
|
|
1342
|
+
}, Gt = () => {
|
|
1343
|
+
const { isAuthenticated: e } = O(), { state: t } = A(z), [r, a] = I(!1), [o, i] = rt(), l = Ie(e), c = H(() => {
|
|
1344
|
+
const m = o.current;
|
|
1345
|
+
if (m) {
|
|
1346
|
+
const { scrollHeight: b, clientHeight: g, scrollTop: u } = m, p = b - g - u;
|
|
1347
|
+
m.scrollBy({
|
|
1348
|
+
top: p,
|
|
1349
|
+
behavior: "smooth"
|
|
1350
|
+
});
|
|
1351
|
+
}
|
|
1352
|
+
}, [o]), n = H(() => {
|
|
1353
|
+
const m = o.current;
|
|
1354
|
+
if (m) {
|
|
1355
|
+
const { scrollTop: b, scrollHeight: g, clientHeight: u } = m, p = g > u, f = b + u >= g - 1;
|
|
1356
|
+
a(p && !f);
|
|
1357
|
+
}
|
|
1358
|
+
}, [o]);
|
|
1359
|
+
qe(() => {
|
|
1360
|
+
i && i.width && t && !t.streaming && n();
|
|
1361
|
+
}, [i, t, n]), k(() => {
|
|
1362
|
+
const m = o.current;
|
|
1363
|
+
if (m)
|
|
1364
|
+
return m.addEventListener("scroll", n), () => m.removeEventListener("scroll", n);
|
|
1365
|
+
}, [n, o]), k(() => {
|
|
1366
|
+
t && t.streaming && n();
|
|
1367
|
+
}, [t, n]);
|
|
1368
|
+
const h = C(!1);
|
|
1369
|
+
return k(() => {
|
|
1370
|
+
t && (!h.current && t.streaming && c(), h.current = !!t.streaming);
|
|
1371
|
+
}, [t, c]), /* @__PURE__ */ v("div", { className: l, ref: o, children: [
|
|
1372
|
+
r && /* @__PURE__ */ s("div", { className: "bottom-44 z-40 fixed left-1/2 transform -translate-x-1/2", children: /* @__PURE__ */ s(
|
|
1373
|
+
Se,
|
|
1374
|
+
{
|
|
1375
|
+
className: "bg-white hover:bg-white active:bg-slate-400",
|
|
1376
|
+
size: "medium",
|
|
1377
|
+
mode: "dark",
|
|
1378
|
+
onClick: c,
|
|
1379
|
+
children: /* @__PURE__ */ s(Ye, { monotone: !0, size: "size-3", className: "text-copy-dark" })
|
|
1380
|
+
}
|
|
1381
|
+
) }),
|
|
1382
|
+
/* @__PURE__ */ s(Re, {}),
|
|
1383
|
+
/* @__PURE__ */ s(Ht, {})
|
|
1287
1384
|
] });
|
|
1288
|
-
},
|
|
1289
|
-
const { isAuthenticated: e } = O(), t = Ee(e);
|
|
1290
|
-
return /* @__PURE__ */ s(R, { children: /* @__PURE__ */ f("div", { className: t, children: [
|
|
1291
|
-
/* @__PURE__ */ s(Ie, {}),
|
|
1292
|
-
/* @__PURE__ */ s(At, {})
|
|
1293
|
-
] }) });
|
|
1294
|
-
}, M = (e, t) => {
|
|
1385
|
+
}, L = (e, t) => {
|
|
1295
1386
|
e({
|
|
1296
|
-
type:
|
|
1387
|
+
type: se,
|
|
1297
1388
|
payload: {
|
|
1298
1389
|
streaming: t
|
|
1299
1390
|
}
|
|
1300
1391
|
});
|
|
1301
|
-
},
|
|
1302
|
-
|
|
1303
|
-
type:
|
|
1392
|
+
}, oe = (e) => {
|
|
1393
|
+
L(e, !1), e({
|
|
1394
|
+
type: R,
|
|
1304
1395
|
payload: {
|
|
1305
1396
|
message: {
|
|
1306
|
-
role:
|
|
1307
|
-
content:
|
|
1397
|
+
role: j,
|
|
1398
|
+
content: Oe
|
|
1308
1399
|
}
|
|
1309
1400
|
}
|
|
1310
1401
|
});
|
|
1311
|
-
},
|
|
1312
|
-
const { state: e, dispatch: t } =
|
|
1402
|
+
}, jt = () => {
|
|
1403
|
+
const { state: e, dispatch: t } = A(z), { state: r, dispatch: a } = A(P), [o, i] = I(""), { getAccessToken: l, user: c } = O(), n = C(null), h = C(
|
|
1313
1404
|
null
|
|
1314
1405
|
);
|
|
1315
|
-
|
|
1406
|
+
k(() => {
|
|
1316
1407
|
(async () => {
|
|
1317
|
-
var
|
|
1408
|
+
var g;
|
|
1318
1409
|
if (!e || e.messages.length === 0) {
|
|
1319
|
-
(
|
|
1410
|
+
(g = h == null ? void 0 : h.current) == null || g.cancel();
|
|
1320
1411
|
return;
|
|
1321
1412
|
}
|
|
1322
|
-
const
|
|
1323
|
-
if (!(e.messages.length === 0 ||
|
|
1413
|
+
const b = e.messages[e.messages.length - 1];
|
|
1414
|
+
if (!(e.messages.length === 0 || b.message.role === B || b.message.role === Be || b.message.role === j || b.message.role === Ae))
|
|
1324
1415
|
try {
|
|
1325
|
-
const u = await
|
|
1326
|
-
accessToken: await
|
|
1416
|
+
const u = await He({
|
|
1417
|
+
accessToken: await l(),
|
|
1327
1418
|
name: "generate",
|
|
1328
1419
|
data: {
|
|
1329
1420
|
messages: e.messages,
|
|
1330
|
-
model: e.engine ||
|
|
1331
|
-
user: (
|
|
1421
|
+
model: e.engine || M,
|
|
1422
|
+
user: (c == null ? void 0 : c.username) || "",
|
|
1332
1423
|
id: e.id,
|
|
1333
1424
|
usage: e.usage
|
|
1334
1425
|
}
|
|
1335
1426
|
});
|
|
1336
1427
|
if (u && u.ok) {
|
|
1337
|
-
const p =
|
|
1338
|
-
|
|
1339
|
-
const
|
|
1428
|
+
const p = F();
|
|
1429
|
+
h.current = u.body.getReader();
|
|
1430
|
+
const f = new TextDecoder();
|
|
1340
1431
|
for (; ; ) {
|
|
1341
|
-
|
|
1342
|
-
const { done: _, value:
|
|
1432
|
+
L(t, !0);
|
|
1433
|
+
const { done: _, value: N } = await h.current.read();
|
|
1343
1434
|
if (_) {
|
|
1344
|
-
|
|
1435
|
+
L(t, !1);
|
|
1345
1436
|
break;
|
|
1346
1437
|
}
|
|
1347
|
-
const
|
|
1348
|
-
if (
|
|
1349
|
-
const
|
|
1350
|
-
|
|
1438
|
+
const x = f.decode(N, { stream: !0 }), T = x.indexOf(Y);
|
|
1439
|
+
if (T !== -1) {
|
|
1440
|
+
const E = x.substring(0, T), w = JSON.parse(
|
|
1441
|
+
x.substring(T + Y.length)
|
|
1351
1442
|
);
|
|
1352
1443
|
t({
|
|
1353
|
-
type:
|
|
1444
|
+
type: ie,
|
|
1354
1445
|
payload: {
|
|
1355
|
-
model:
|
|
1356
|
-
usage:
|
|
1446
|
+
model: w.model,
|
|
1447
|
+
usage: w.usage
|
|
1357
1448
|
}
|
|
1358
1449
|
}), t({
|
|
1359
|
-
type:
|
|
1450
|
+
type: R,
|
|
1360
1451
|
payload: {
|
|
1361
1452
|
message: {
|
|
1362
|
-
content:
|
|
1363
|
-
role:
|
|
1453
|
+
content: E,
|
|
1454
|
+
role: B,
|
|
1364
1455
|
messageId: p,
|
|
1365
|
-
processingTime:
|
|
1366
|
-
name:
|
|
1456
|
+
processingTime: w.processingTime,
|
|
1457
|
+
name: w.name
|
|
1367
1458
|
}
|
|
1368
1459
|
}
|
|
1369
|
-
}),
|
|
1460
|
+
}), L(t, !1);
|
|
1370
1461
|
break;
|
|
1371
1462
|
} else
|
|
1372
1463
|
t({
|
|
1373
|
-
type:
|
|
1464
|
+
type: R,
|
|
1374
1465
|
payload: {
|
|
1375
1466
|
message: {
|
|
1376
|
-
content:
|
|
1377
|
-
role:
|
|
1467
|
+
content: x,
|
|
1468
|
+
role: B,
|
|
1378
1469
|
messageId: p
|
|
1379
1470
|
}
|
|
1380
1471
|
}
|
|
1381
1472
|
});
|
|
1382
1473
|
}
|
|
1383
1474
|
} else
|
|
1384
|
-
|
|
1475
|
+
oe(t);
|
|
1385
1476
|
} catch (u) {
|
|
1386
|
-
console.error(u),
|
|
1477
|
+
console.error(u), oe(t);
|
|
1387
1478
|
}
|
|
1388
1479
|
})();
|
|
1389
1480
|
}, [e == null ? void 0 : e.messages]);
|
|
1390
|
-
const
|
|
1391
|
-
|
|
1392
|
-
type:
|
|
1481
|
+
const m = async (b) => {
|
|
1482
|
+
b.preventDefault(), t({
|
|
1483
|
+
type: R,
|
|
1393
1484
|
payload: {
|
|
1394
1485
|
message: {
|
|
1395
|
-
role:
|
|
1486
|
+
role: $,
|
|
1396
1487
|
content: o
|
|
1397
1488
|
}
|
|
1398
1489
|
}
|
|
1399
1490
|
}), i("");
|
|
1400
1491
|
};
|
|
1401
|
-
return
|
|
1492
|
+
return k(() => {
|
|
1402
1493
|
if (r.tag !== "") {
|
|
1403
|
-
const
|
|
1404
|
-
|
|
1405
|
-
i(
|
|
1406
|
-
}) : i(
|
|
1407
|
-
type:
|
|
1494
|
+
const b = r.tag.endsWith(":") && !r.tag.endsWith(": ") ? r.tag + " " : r.tag;
|
|
1495
|
+
b.indexOf(J) !== -1 ? navigator.clipboard.readText().then((u) => {
|
|
1496
|
+
i(b.replace(J, u));
|
|
1497
|
+
}) : i(b), n.current && n.current.focus(), a({
|
|
1498
|
+
type: ce
|
|
1408
1499
|
});
|
|
1409
1500
|
}
|
|
1410
|
-
}, [r, a]),
|
|
1411
|
-
e && e.usage === 0 && e.messages.length === 0 &&
|
|
1412
|
-
}, [e]), /* @__PURE__ */ s(
|
|
1413
|
-
|
|
1501
|
+
}, [r, a]), k(() => {
|
|
1502
|
+
e && e.usage === 0 && e.messages.length === 0 && n.current && n.current.focus();
|
|
1503
|
+
}, [e]), /* @__PURE__ */ s(G, { children: /* @__PURE__ */ s("form", { className: "mt-2", onSubmit: m, children: /* @__PURE__ */ s(
|
|
1504
|
+
Ge,
|
|
1414
1505
|
{
|
|
1415
1506
|
mode: "dark",
|
|
1416
1507
|
focusMode: "light",
|
|
1417
|
-
ref:
|
|
1508
|
+
ref: n,
|
|
1418
1509
|
name: "chat-input",
|
|
1419
|
-
label:
|
|
1510
|
+
label: Me,
|
|
1420
1511
|
helperText: "Press ENTER to add a new line",
|
|
1421
1512
|
helperTextOnFocus: !0,
|
|
1422
1513
|
required: !0,
|
|
1423
1514
|
value: o,
|
|
1424
|
-
onChange: (
|
|
1425
|
-
onKeyDown:
|
|
1426
|
-
leftElement: /* @__PURE__ */ s(
|
|
1515
|
+
onChange: (b) => i(b.target.value),
|
|
1516
|
+
onKeyDown: Ze([["mod+Enter", m]]),
|
|
1517
|
+
leftElement: /* @__PURE__ */ s(je, {}),
|
|
1427
1518
|
rightElement: /* @__PURE__ */ s(
|
|
1428
|
-
|
|
1519
|
+
ge,
|
|
1429
1520
|
{
|
|
1430
1521
|
disabled: e == null ? void 0 : e.streaming,
|
|
1431
1522
|
noBorder: !0,
|
|
1432
1523
|
type: "submit",
|
|
1433
1524
|
mode: "light",
|
|
1434
1525
|
focusMode: "light",
|
|
1435
|
-
children:
|
|
1526
|
+
children: Le
|
|
1436
1527
|
}
|
|
1437
1528
|
)
|
|
1438
1529
|
}
|
|
1439
1530
|
) }) });
|
|
1440
|
-
},
|
|
1441
|
-
const { dispatch: e, state: t } =
|
|
1531
|
+
}, Pt = () => {
|
|
1532
|
+
const { dispatch: e, state: t } = A(P), { getAccessToken: r, user: a } = O(), [o, i] = I({
|
|
1442
1533
|
loaded: !1
|
|
1443
|
-
}),
|
|
1444
|
-
|
|
1534
|
+
}), l = "mt-2 flex justify-center rounded-md", c = (n, h) => {
|
|
1535
|
+
n.preventDefault(), e({
|
|
1445
1536
|
type: le,
|
|
1446
1537
|
payload: {
|
|
1447
|
-
tag:
|
|
1538
|
+
tag: h
|
|
1448
1539
|
}
|
|
1449
1540
|
});
|
|
1450
1541
|
};
|
|
1451
|
-
return
|
|
1542
|
+
return k(() => {
|
|
1452
1543
|
if (!a) {
|
|
1453
1544
|
i({
|
|
1454
1545
|
loaded: !1
|
|
@@ -1457,17 +1548,17 @@ const re = je(
|
|
|
1457
1548
|
}
|
|
1458
1549
|
o.loaded || (async () => {
|
|
1459
1550
|
try {
|
|
1460
|
-
const
|
|
1551
|
+
const n = await me({
|
|
1461
1552
|
accessToken: await r(),
|
|
1462
|
-
type:
|
|
1553
|
+
type: ue.GET_USER_PREFERENCES,
|
|
1463
1554
|
params: {
|
|
1464
1555
|
user: a.username
|
|
1465
1556
|
}
|
|
1466
1557
|
});
|
|
1467
|
-
|
|
1468
|
-
type:
|
|
1558
|
+
n.status === 200 && (e({
|
|
1559
|
+
type: de,
|
|
1469
1560
|
payload: {
|
|
1470
|
-
tags:
|
|
1561
|
+
tags: n.data.tags || []
|
|
1471
1562
|
}
|
|
1472
1563
|
}), i({
|
|
1473
1564
|
loaded: !0
|
|
@@ -1475,60 +1566,60 @@ const re = je(
|
|
|
1475
1566
|
} catch {
|
|
1476
1567
|
}
|
|
1477
1568
|
})();
|
|
1478
|
-
}, [a]), /* @__PURE__ */ s(
|
|
1479
|
-
|
|
1569
|
+
}, [a]), /* @__PURE__ */ s(G, { children: /* @__PURE__ */ s(ze, { alignHorizontal: "center", columnGap: 2, children: o && o.loaded && t.tags && t.tags.map((n) => n.enabled && n.label && n.content && /* @__PURE__ */ s(Ue, { children: /* @__PURE__ */ s("div", { className: l, children: /* @__PURE__ */ s(
|
|
1570
|
+
ge,
|
|
1480
1571
|
{
|
|
1481
1572
|
noBorder: !0,
|
|
1482
1573
|
mode: "dark",
|
|
1483
1574
|
focusMode: "light",
|
|
1484
1575
|
size: "small",
|
|
1485
|
-
onClick: (
|
|
1486
|
-
children:
|
|
1576
|
+
onClick: (h) => c(h, n.content),
|
|
1577
|
+
children: n.label
|
|
1487
1578
|
}
|
|
1488
|
-
) }) }, `tag-button-${
|
|
1579
|
+
) }) }, `tag-button-${n.slot}`)) }) });
|
|
1489
1580
|
};
|
|
1490
|
-
function
|
|
1491
|
-
const t =
|
|
1492
|
-
key:
|
|
1581
|
+
function xe({ isComponent: e = !1 }) {
|
|
1582
|
+
const t = C(!1), { getAccessToken: r, user: a } = O(), [o] = X({
|
|
1583
|
+
key: Q + De,
|
|
1493
1584
|
initialValue: ""
|
|
1494
|
-
}), [i] =
|
|
1495
|
-
key:
|
|
1496
|
-
initialValue:
|
|
1497
|
-
}), [
|
|
1498
|
-
id:
|
|
1499
|
-
model:
|
|
1500
|
-
engine:
|
|
1585
|
+
}), [i] = X({
|
|
1586
|
+
key: Q + $e,
|
|
1587
|
+
initialValue: Fe.ASC
|
|
1588
|
+
}), [l, c] = V(st, {
|
|
1589
|
+
id: F(),
|
|
1590
|
+
model: M,
|
|
1591
|
+
engine: M,
|
|
1501
1592
|
usage: 0,
|
|
1502
1593
|
messages: [],
|
|
1503
1594
|
tags: [],
|
|
1504
1595
|
isComponent: e
|
|
1505
|
-
}), [
|
|
1596
|
+
}), [n, h] = V(dt, {
|
|
1506
1597
|
searchString: o,
|
|
1507
1598
|
sortedCell: "timestamp",
|
|
1508
1599
|
sortDirection: i
|
|
1509
|
-
}), [
|
|
1600
|
+
}), [m, b] = V(ct, {
|
|
1510
1601
|
tag: "",
|
|
1511
1602
|
tags: []
|
|
1512
|
-
}), [
|
|
1603
|
+
}), [g, u] = I({
|
|
1513
1604
|
version: "",
|
|
1514
1605
|
models: [],
|
|
1515
1606
|
plugins: [],
|
|
1516
|
-
engine:
|
|
1607
|
+
engine: M,
|
|
1517
1608
|
engines: []
|
|
1518
1609
|
});
|
|
1519
|
-
return
|
|
1520
|
-
|
|
1610
|
+
return k(() => {
|
|
1611
|
+
g.version !== "" || t.current || (async () => {
|
|
1521
1612
|
try {
|
|
1522
1613
|
t.current = !0;
|
|
1523
|
-
const p = await
|
|
1614
|
+
const p = await me({
|
|
1524
1615
|
accessToken: await r(),
|
|
1525
|
-
type:
|
|
1616
|
+
type: ue.ABOUT,
|
|
1526
1617
|
params: {
|
|
1527
1618
|
user: a == null ? void 0 : a.username
|
|
1528
1619
|
}
|
|
1529
1620
|
});
|
|
1530
|
-
t.current = !1, p.status === 200 && (u(p.data),
|
|
1531
|
-
type:
|
|
1621
|
+
t.current = !1, p.status === 200 && (u(p.data), c({
|
|
1622
|
+
type: ne,
|
|
1532
1623
|
payload: {
|
|
1533
1624
|
engine: p.data.engine
|
|
1534
1625
|
}
|
|
@@ -1536,28 +1627,28 @@ function ke({ isComponent: e = !1 }) {
|
|
|
1536
1627
|
} catch {
|
|
1537
1628
|
}
|
|
1538
1629
|
})();
|
|
1539
|
-
}, [
|
|
1630
|
+
}, [g, r, a]), k(() => {
|
|
1540
1631
|
var p;
|
|
1541
1632
|
(p = document.getElementById("logo")) == null || p.classList.add("fadeOut"), setTimeout(() => {
|
|
1542
|
-
var
|
|
1543
|
-
(
|
|
1633
|
+
var f;
|
|
1634
|
+
(f = document.getElementById("root")) == null || f.classList.replace("app-hidden", "fadeIn");
|
|
1544
1635
|
}, 500);
|
|
1545
|
-
}), /* @__PURE__ */ s(
|
|
1546
|
-
|
|
1636
|
+
}), /* @__PURE__ */ s(z.Provider, { value: { state: l, dispatch: c, serverStats: g }, children: /* @__PURE__ */ s(
|
|
1637
|
+
Pe.Provider,
|
|
1547
1638
|
{
|
|
1548
1639
|
value: {
|
|
1549
|
-
state:
|
|
1550
|
-
dispatch:
|
|
1640
|
+
state: n,
|
|
1641
|
+
dispatch: h
|
|
1551
1642
|
},
|
|
1552
|
-
children: /* @__PURE__ */
|
|
1553
|
-
|
|
1643
|
+
children: /* @__PURE__ */ v(
|
|
1644
|
+
P.Provider,
|
|
1554
1645
|
{
|
|
1555
|
-
value: { state:
|
|
1646
|
+
value: { state: m, dispatch: b },
|
|
1556
1647
|
children: [
|
|
1557
|
-
/* @__PURE__ */ s(
|
|
1558
|
-
/* @__PURE__ */
|
|
1559
|
-
/* @__PURE__ */ s(
|
|
1560
|
-
/* @__PURE__ */ s(
|
|
1648
|
+
/* @__PURE__ */ s(Ve, { className: "max-h-[calc(100svh_-_163px)]", children: /* @__PURE__ */ s(Gt, {}) }),
|
|
1649
|
+
/* @__PURE__ */ v("div", { className: "md:mx-auto md:max-w-4xl w-11/12 fixed bottom-10 left-1/2 transform -translate-x-1/2 z-1000", children: [
|
|
1650
|
+
/* @__PURE__ */ s(Pt, {}),
|
|
1651
|
+
/* @__PURE__ */ s(jt, {})
|
|
1561
1652
|
] })
|
|
1562
1653
|
]
|
|
1563
1654
|
}
|
|
@@ -1565,9 +1656,9 @@ function ke({ isComponent: e = !1 }) {
|
|
|
1565
1656
|
}
|
|
1566
1657
|
) });
|
|
1567
1658
|
}
|
|
1568
|
-
|
|
1569
|
-
const
|
|
1659
|
+
xe.displayName = "App";
|
|
1660
|
+
const Jt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: xe }, Symbol.toStringTag, { value: "Module" }));
|
|
1570
1661
|
export {
|
|
1571
|
-
|
|
1572
|
-
|
|
1662
|
+
Jt as LazyApp,
|
|
1663
|
+
It as ae
|
|
1573
1664
|
};
|