@versini/sassysaint 5.5.30 → 5.5.32

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.
@@ -1,2305 +0,0 @@
1
- import { jsx as t, jsxs as m, Fragment as z } from "react/jsx-runtime";
2
- import { g as M, un as P, R as B, CARDS as C, renderDataAsList as ie, pluralize as de, ABOUT_TITLE as lt, L as H, j as _, C as U, INFINITE_SCROLL_LIMIT as Le, INFINITE_SCROLL_THRESHOLD as ze, LOCAL_STORAGE_PREFIX as oe, LOCAL_STORAGE_SORT as ct, P as W, ACTION_RESET as De, ACTION_RESTORE as it, ACTION_SORT as Me, LOCAL_STORAGE_SEARCH as dt, HISTORY_TITLE as mt, ye, ACTION_SEARCH as ht, debounce as ut, M as gt, z as Re, durationFormatter as pt, PROFILE_TITLE as ft, PROMPTS_DESCRIPTION as bt, DEFAULT_AI_ENGINE as yt, LOCAL_STORAGE_ENGINE_TOGGLE as Ve, LOCAL_STORAGE_CHAT_DETAILS as kt, SETTINGS_TITLE as vt, ENGINE_OPENAI as F, ENGINE_ANTHROPIC as D, APP_NAME as Nt, getCurrentGeoLocation as xt, LOG_OUT as Ae } from "./index.DbjZmArX.js";
3
- import * as I from "react";
4
- import he, { useId as we, forwardRef as Ue, useState as E, useRef as Y, useContext as K, useEffect as G, useCallback as wt, Fragment as Ct } from "react";
5
- import u from "clsx";
6
- import { useFloatingTree as He, useFloatingNodeId as Et, useListItem as Ge, useFloating as je, offset as It, flip as Tt, shift as St, autoUpdate as _t, useClick as We, useRole as Ye, useDismiss as Ke, useListNavigation as Lt, useTypeahead as zt, useInteractions as Ze, useMergeRefs as Ce, FloatingNode as Mt, FloatingList as Rt, FloatingPortal as qe, FloatingFocusManager as Qe, FloatingTree as At, FloatingOverlay as Bt } from "@floating-ui/react";
7
- import { useServerCapabilities as Pt, HistoryContext as Xe, E as re, ge as Ot, he as $t, ue as be, ie as R, ye as Ft, me as Dt, be as Vt, serviceCall as Z, SERVICE_TYPES as q, f as ee, AppContext as Ee, useChatsHistory as Ut, useUserChatStats as Ht, useUserPreferences as Ie, Fe as Be, NewChatButton as Gt } from "./App.QCfXzAXM.js";
8
- const ke = ({
9
- className: e,
10
- viewBox: o,
11
- title: a,
12
- monotone: r,
13
- ...n
14
- }) => /* @__PURE__ */ t(
15
- M,
16
- {
17
- defaultViewBox: "0 0 24 24",
18
- size: "size-5",
19
- viewBox: o,
20
- className: e,
21
- title: a || "Anthropic",
22
- ...n,
23
- children: /* @__PURE__ */ t("path", { d: "M17.3041 3.541h-3.6718l6.696 16.918H24Zm-10.6082 0L0 20.459h3.7442l1.3693-3.5527h7.0052l1.3693 3.5528h3.7442L10.5363 3.5409Zm-.3712 10.2232 2.2914-5.9456 2.2914 5.9456Z" })
24
- }
25
- ), jt = ({
26
- className: e,
27
- viewBox: o,
28
- title: a,
29
- monotone: r,
30
- ...n
31
- }) => /* @__PURE__ */ m(
32
- M,
33
- {
34
- defaultViewBox: "0 0 512 512",
35
- size: "size-5",
36
- viewBox: o,
37
- className: e,
38
- title: a || "Back",
39
- ...n,
40
- children: [
41
- /* @__PURE__ */ t(
42
- "path",
43
- {
44
- className: "fa-secondary",
45
- opacity: r ? "1" : "0.4",
46
- d: "M66.6 320c0 1.8 .1 3.5 .4 5.3C84.9 431.3 177 512 288 512c123.7 0 224-100.3 224-224c0-111-80.7-203.1-186.7-220.9c-1.8-.3-3.6-.4-5.3-.4c-15.3 0-28.9 11.1-31.5 26.7c-2.9 17.4 8.8 33.9 26.3 36.9C390.4 142.9 448 208.8 448 288c0 88.4-71.6 160-160 160c-79.2 0-145.1-57.6-157.8-133.3c-2.9-17.4-19.4-29.2-36.9-26.3c-15.6 2.6-26.7 16.2-26.7 31.5z"
47
- }
48
- ),
49
- /* @__PURE__ */ t(
50
- "path",
51
- {
52
- className: "fa-primary",
53
- d: "M32 0L192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-82.7 0L342.6 297.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L64 109.3 64 192c0 17.7-14.3 32-32 32s-32-14.3-32-32L0 32C0 14.3 14.3 0 32 0z"
54
- }
55
- )
56
- ]
57
- }
58
- ), Wt = ({
59
- className: e,
60
- viewBox: o,
61
- title: a,
62
- monotone: r,
63
- ...n
64
- }) => /* @__PURE__ */ m(
65
- M,
66
- {
67
- defaultViewBox: "0 0 448 512",
68
- size: "size-5",
69
- viewBox: o,
70
- className: e,
71
- title: a || "Delete",
72
- ...n,
73
- children: [
74
- /* @__PURE__ */ t(
75
- "path",
76
- {
77
- className: "fa-secondary",
78
- opacity: r ? "1" : "0.4",
79
- d: "M32 96l0 352c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-352L32 96zm80 80c0-8.8 7.2-16 16-16s16 7.2 16 16l0 224c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-224zm96 0c0-8.8 7.2-16 16-16s16 7.2 16 16l0 224c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-224zm96 0c0-8.8 7.2-16 16-16s16 7.2 16 16l0 224c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-224z"
80
- }
81
- ),
82
- /* @__PURE__ */ t(
83
- "path",
84
- {
85
- className: "fa-primary",
86
- d: "M163.8 0c-12.1 0-23.2 6.8-28.6 17.7L128 32 32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0-7.2-14.3C307.4 6.8 296.3 0 284.2 0L163.8 0z"
87
- }
88
- )
89
- ]
90
- }
91
- ), Yt = ({
92
- className: e,
93
- viewBox: o,
94
- title: a,
95
- monotone: r,
96
- ...n
97
- }) => /* @__PURE__ */ m(
98
- M,
99
- {
100
- defaultViewBox: "0 0 512 512",
101
- size: "size-5",
102
- viewBox: o,
103
- className: e,
104
- title: a || "Edit",
105
- ...n,
106
- children: [
107
- /* @__PURE__ */ t(
108
- "path",
109
- {
110
- className: "fa-secondary",
111
- opacity: r ? "1" : "0.4",
112
- d: "M0 160c0-53 43-96 96-96l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-96 0c-17.7 0-32 14.3-32 32l0 256c0 17.7 14.3 32 32 32l256 0c17.7 0 32-14.3 32-32l0-96c0-17.7 14.3-32 32-32s32 14.3 32 32l0 96c0 53-43 96-96 96L96 512c-53 0-96-43-96-96L0 160z"
113
- }
114
- ),
115
- /* @__PURE__ */ t(
116
- "path",
117
- {
118
- className: "fa-primary",
119
- d: "M392.4 21.7L362.3 51.7l97.9 97.9 30.1-30.1c21.9-21.9 21.9-57.3 0-79.2L471.6 21.7c-21.9-21.9-57.3-21.9-79.2 0zM339.7 74.3L172.4 241.7c-6.1 6.1-10.8 13.6-13.5 21.9l-29.6 88.8c-2.9 8.6-.6 18.1 5.8 24.6s15.9 8.7 24.6 5.8l88.8-29.6c8.2-2.7 15.7-7.4 21.9-13.5L437.7 172.3 339.7 74.3z"
120
- }
121
- )
122
- ]
123
- }
124
- ), Kt = ({
125
- className: e,
126
- viewBox: o,
127
- title: a,
128
- monotone: r,
129
- ...n
130
- }) => /* @__PURE__ */ m(
131
- M,
132
- {
133
- defaultViewBox: "0 0 512 512",
134
- size: "size-5",
135
- viewBox: o,
136
- className: e,
137
- title: a || "History",
138
- ...n,
139
- children: [
140
- /* @__PURE__ */ t(
141
- "path",
142
- {
143
- className: "fa-secondary",
144
- opacity: r ? "1" : "0.4",
145
- d: "M0 57.9L0 168c0 13.3 10.7 24 24 24l110.1 0c21.4 0 32.1-25.9 17-41l-30.8-30.8C155 85.5 203 64 256 64c106 0 192 86 192 192s-86 192-192 192c-40.8 0-78.6-12.7-109.7-34.4c-14.5-10.1-34.4-6.6-44.6 7.9s-6.6 34.4 7.9 44.6C151.2 495 201.7 512 256 512c141.4 0 256-114.6 256-256S397.4 0 256 0C185.3 0 121.3 28.7 75 75L41 41C25.9 25.9 0 36.6 0 57.9z"
146
- }
147
- ),
148
- /* @__PURE__ */ t(
149
- "path",
150
- {
151
- className: "fa-primary",
152
- d: "M256 128c13.3 0 24 10.7 24 24l0 94.1 65 65c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-72-72c-4.5-4.5-7-10.6-7-17l0-104c0-13.3 10.7-24 24-24z"
153
- }
154
- )
155
- ]
156
- }
157
- ), Zt = ({
158
- className: e,
159
- viewBox: o,
160
- title: a,
161
- monotone: r,
162
- ...n
163
- }) => /* @__PURE__ */ m(
164
- M,
165
- {
166
- defaultViewBox: "0 0 512 512",
167
- size: "size-5",
168
- viewBox: o,
169
- className: e,
170
- title: a || "Info",
171
- ...n,
172
- children: [
173
- /* @__PURE__ */ t(
174
- "path",
175
- {
176
- className: "fa-secondary",
177
- opacity: "0.4",
178
- d: "M0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zm192-8c0-13.3 10.7-24 24-24l48 0c13.3 0 24 10.7 24 24l0 88 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l24 0 0-64-24 0c-13.3 0-24-10.7-24-24zm96-88a32 32 0 1 1 -64 0 32 32 0 1 1 64 0z"
179
- }
180
- ),
181
- /* @__PURE__ */ t(
182
- "path",
183
- {
184
- className: "fa-primary",
185
- d: "M256 128a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM192 248c0-13.3 10.7-24 24-24l48 0c13.3 0 24 10.7 24 24l0 88 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l24 0 0-64-24 0c-13.3 0-24-10.7-24-24z"
186
- }
187
- )
188
- ]
189
- }
190
- ), ve = ({
191
- className: e,
192
- viewBox: o,
193
- title: a,
194
- monotone: r,
195
- ...n
196
- }) => /* @__PURE__ */ t(
197
- M,
198
- {
199
- defaultViewBox: "0 0 24 24",
200
- size: "size-5",
201
- viewBox: o,
202
- className: e,
203
- title: a || "OpenAI",
204
- ...n,
205
- children: /* @__PURE__ */ t("path", { d: "M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z" })
206
- }
207
- ), qt = ({
208
- className: e,
209
- viewBox: o,
210
- title: a,
211
- monotone: r,
212
- ...n
213
- }) => /* @__PURE__ */ m(
214
- M,
215
- {
216
- defaultViewBox: "0 0 576 512",
217
- size: "size-5",
218
- viewBox: o,
219
- className: e,
220
- title: a || "Profile",
221
- ...n,
222
- children: [
223
- /* @__PURE__ */ t(
224
- "path",
225
- {
226
- className: "fa-secondary",
227
- opacity: "0.4",
228
- d: "M0 96L0 416c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32C28.7 32 0 60.7 0 96zM64 368c0-44.2 35.8-80 80-80l64 0c44.2 0 80 35.8 80 80c0 8.8-7.2 16-16 16L80 384c-8.8 0-16-7.2-16-16zM240 192a64 64 0 1 1 -128 0 64 64 0 1 1 128 0zm112-16c0-8.8 7.2-16 16-16l128 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-128 0c-8.8 0-16-7.2-16-16zm0 64c0-8.8 7.2-16 16-16l128 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-128 0c-8.8 0-16-7.2-16-16zm0 64c0-8.8 7.2-16 16-16l128 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-128 0c-8.8 0-16-7.2-16-16z"
229
- }
230
- ),
231
- /* @__PURE__ */ t(
232
- "path",
233
- {
234
- className: "fa-primary",
235
- d: "M176 256a64 64 0 1 0 0-128 64 64 0 1 0 0 128zm-32 32c-44.2 0-80 35.8-80 80c0 8.8 7.2 16 16 16l192 0c8.8 0 16-7.2 16-16c0-44.2-35.8-80-80-80l-64 0z"
236
- }
237
- )
238
- ]
239
- }
240
- ), Qt = ({
241
- className: e,
242
- viewBox: o,
243
- title: a,
244
- monotone: r,
245
- ...n
246
- }) => /* @__PURE__ */ m(
247
- M,
248
- {
249
- defaultViewBox: "0 0 512 512",
250
- size: "size-5",
251
- viewBox: o,
252
- className: e,
253
- title: a || "Restore",
254
- ...n,
255
- children: [
256
- /* @__PURE__ */ t(
257
- "path",
258
- {
259
- className: "fa-secondary",
260
- opacity: r ? "1" : "0.4",
261
- d: "M128 80l0 16 64 0 0-16c0-8.8 7.2-16 16-16l224 0c8.8 0 16 7.2 16 16l0 224c0 8.8-7.2 16-16 16l-16 0 0 64 16 0c44.2 0 80-35.8 80-80l0-224c0-44.2-35.8-80-80-80L208 0c-44.2 0-80 35.8-80 80z"
262
- }
263
- ),
264
- /* @__PURE__ */ t(
265
- "path",
266
- {
267
- className: "fa-primary",
268
- d: "M64 128c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L64 128zm32 64l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L96 256c-17.7 0-32-14.3-32-32s14.3-32 32-32z"
269
- }
270
- )
271
- ]
272
- }
273
- ), Xt = ({
274
- className: e,
275
- viewBox: o,
276
- title: a,
277
- monotone: r,
278
- ...n
279
- }) => /* @__PURE__ */ t(
280
- M,
281
- {
282
- defaultViewBox: "0 0 448 512",
283
- size: "size-5",
284
- viewBox: o,
285
- className: e,
286
- title: a || "Settings",
287
- ...n,
288
- children: /* @__PURE__ */ t("path", { d: "M8 256a56 56 0 1 1 112 0A56 56 0 1 1 8 256zm160 0a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zm216-56a56 56 0 1 1 0 112 56 56 0 1 1 0-112z" })
289
- }
290
- ), Jt = ({
291
- className: e,
292
- viewBox: o,
293
- title: a,
294
- monotone: r,
295
- ...n
296
- }) => /* @__PURE__ */ m(
297
- M,
298
- {
299
- defaultViewBox: "0 0 512 512",
300
- size: "size-5",
301
- viewBox: o,
302
- className: e,
303
- title: a || "Sliders",
304
- ...n,
305
- children: [
306
- /* @__PURE__ */ t(
307
- "path",
308
- {
309
- className: "fa-secondary",
310
- opacity: r ? "1" : "0.4",
311
- d: "M0 96C0 78.3 14.3 64 32 64l86.7 0c-2.1 4.9-3.8 10.1-4.9 15.4c-.6 2.7-1 5.4-1.3 8.2c-.1 1.4-.3 2.8-.3 4.2s-.1 2.8-.1 4.2c0 11.4 2.4 22.2 6.7 32L32 128C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32l246.7 0c-2.1 4.9-3.8 10.1-4.9 15.4c-.6 2.7-1 5.4-1.3 8.2c-.1 1.4-.3 2.8-.3 4.2s-.1 2.8-.1 4.2c0 11.4 2.4 22.2 6.7 32L32 288c-17.7 0-32-14.3-32-32zM0 416c0-17.7 14.3-32 32-32l54.7 0c-2.1 4.9-3.8 10.1-4.9 15.4c-.6 2.7-1 5.4-1.3 8.2c-.1 1.4-.3 2.8-.3 4.2s-.1 2.8-.1 4.2c0 11.4 2.4 22.2 6.7 32L32 448c-17.7 0-32-14.3-32-32zm233.3-32L480 384c17.7 0 32 14.3 32 32s-14.3 32-32 32l-246.7 0c2.1-4.9 3.8-10.1 4.9-15.4c.6-2.7 1-5.4 1.3-8.2c.1-1.4 .3-2.8 .3-4.2s.1-2.8 .1-4.2c0-11.4-2.4-22.2-6.7-32zm32-320L480 64c17.7 0 32 14.3 32 32s-14.3 32-32 32l-214.7 0c2.1-4.9 3.8-10.1 4.9-15.4c.6-2.7 1-5.4 1.3-8.2c.1-1.4 .3-2.8 .3-4.2s.1-2.8 .1-4.2c0-11.4-2.4-22.2-6.7-32zm160 160l54.7 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-54.7 0c2.1-4.9 3.8-10.1 4.9-15.4c.6-2.7 1-5.4 1.3-8.2c.1-1.4 .3-2.8 .3-4.2s.1-2.8 .1-4.2c0-11.4-2.4-22.2-6.7-32z"
312
- }
313
- ),
314
- /* @__PURE__ */ t(
315
- "path",
316
- {
317
- className: "fa-primary",
318
- d: "M128 416a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm112 0A80 80 0 1 0 80 416a80 80 0 1 0 160 0zm80-160a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm112 0a80 80 0 1 0 -160 0 80 80 0 1 0 160 0zM192 128a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm0-112a80 80 0 1 0 0 160 80 80 0 1 0 0-160z"
319
- }
320
- )
321
- ]
322
- }
323
- );
324
- function me(e) {
325
- return we();
326
- }
327
- const Ne = I.createContext({
328
- getItemProps: () => ({}),
329
- activeIndex: null,
330
- /* v8 ignore next 2 */
331
- setActiveIndex: () => {
332
- },
333
- setHasFocusInside: () => {
334
- },
335
- isOpen: !1
336
- }), Pe = (e) => {
337
- if (typeof e == "string")
338
- return e;
339
- if (typeof e == "function")
340
- return e.displayName || e.name || "Component";
341
- if (typeof e == "object" && e !== null && "type" in e) {
342
- const o = e.type;
343
- if (typeof o == "function" || typeof o == "object")
344
- return o.displayName || o.name || "Component";
345
- }
346
- return "Element";
347
- }, Je = Ue(
348
- ({
349
- trigger: e,
350
- children: o,
351
- label: a = "Open menu",
352
- defaultPlacement: r = "bottom-start",
353
- onOpenChange: n,
354
- mode: s = "system",
355
- focusMode: d = "system",
356
- ...l
357
- }, g) => {
358
- const [c, b] = E(!1), [k, h] = E(!1), [i, y] = E(null), v = Y([]), f = Y([]), T = K(Ne), N = He(), p = Et(), w = Ge(), { floatingStyles: S, refs: A, context: L } = je({
359
- nodeId: p,
360
- open: c,
361
- onOpenChange: ($) => {
362
- b($), n == null || n($);
363
- },
364
- placement: r,
365
- strategy: "fixed",
366
- middleware: [It({ mainAxis: 10 }), Tt(), St()],
367
- whileElementsMounted: _t
368
- }), pe = We(L, {
369
- event: "mousedown",
370
- toggle: !0,
371
- ignoreMouse: !1
372
- }), ne = Ye(L, { role: "menu" }), fe = Ke(L, { bubbles: !0 }), se = Lt(L, {
373
- listRef: v,
374
- activeIndex: i,
375
- nested: !1,
376
- onNavigate: y,
377
- loop: !0
378
- }), x = zt(L, {
379
- listRef: f,
380
- onMatch: c ? y : void 0,
381
- activeIndex: i
382
- }), { getReferenceProps: O, getFloatingProps: X, getItemProps: _e } = Ze([pe, ne, fe, se, x]), J = Pe(e) === "Button" || Pe(e) === "ButtonIcon", j = J ? {
383
- noInternalClick: J,
384
- focusMode: d,
385
- mode: s
386
- } : {}, le = he.cloneElement(
387
- e,
388
- {
389
- ...j,
390
- "aria-label": a,
391
- "data-open": c ? "" : void 0,
392
- "data-focus-inside": k ? "" : void 0,
393
- ref: Ce([A.setReference, w.ref, g]),
394
- ...O(
395
- T.getItemProps({
396
- ...l
397
- })
398
- )
399
- }
400
- );
401
- return G(() => {
402
- if (!N)
403
- return;
404
- function $() {
405
- b(!1), n == null || n(!1);
406
- }
407
- return N.events.on("click", $), () => {
408
- N.events.off("click", $);
409
- };
410
- }, [N, n]), G(() => {
411
- c && N && N.events.emit("menuopen", { nodeId: p });
412
- }, [N, c, p]), /* @__PURE__ */ m(Mt, { id: p, children: [
413
- le,
414
- /* @__PURE__ */ t(
415
- Ne.Provider,
416
- {
417
- value: {
418
- activeIndex: i,
419
- setActiveIndex: y,
420
- getItemProps: _e,
421
- setHasFocusInside: h,
422
- isOpen: c
423
- },
424
- children: /* @__PURE__ */ t(Rt, { elementsRef: v, labelsRef: f, children: c && /* @__PURE__ */ t(qe, { children: /* @__PURE__ */ t(
425
- Qe,
426
- {
427
- context: L,
428
- modal: !1,
429
- initialFocus: 0,
430
- returnFocus: !0,
431
- children: /* @__PURE__ */ t(
432
- "div",
433
- {
434
- ref: A.setFloating,
435
- className: "rounded-md bg-surface-light shadow-sm shadow-border-dark outline-none p-4 sm:p-2",
436
- style: S,
437
- ...X(),
438
- children: o
439
- }
440
- )
441
- }
442
- ) }) })
443
- }
444
- )
445
- ] });
446
- }
447
- ), Te = Ue((e, o) => /* @__PURE__ */ t(At, { children: /* @__PURE__ */ t(Je, { ...e, ref: o }) }));
448
- Te.displayName = "Menu";
449
- Je.displayName = "MenuComponent";
450
- const V = I.forwardRef(
451
- ({
452
- label: e,
453
- disabled: o,
454
- icon: a,
455
- raw: r = !1,
456
- children: n,
457
- ignoreClick: s = !1,
458
- selected: d = !1,
459
- ...l
460
- }, g) => {
461
- let c = "";
462
- const b = I.useContext(Ne), k = Ge({ label: o ? null : e }), h = He(), i = Ce([k.ref, g]);
463
- if (r && n)
464
- return /* @__PURE__ */ t(
465
- "div",
466
- {
467
- role: "menuitem",
468
- ...b.getItemProps({
469
- onClick(v) {
470
- var f;
471
- s || ((f = l.onClick) == null || f.call(l, v), h == null || h.events.emit("click"));
472
- }
473
- }),
474
- children: n
475
- }
476
- );
477
- a && (c = "pl-2");
478
- const y = u(
479
- "m-0 first:mt-0 mt-2 sm:mt-1 px-2 py-1 flex w-full rounded-md border border-transparent text-left text-base outline-none focus:border focus:border-border-medium focus:bg-surface-lighter focus:underline disabled:cursor-not-allowed disabled:text-copy-medium",
480
- {
481
- "bg-surface-medium text-copy-lighter font-bold": !o && d,
482
- "bg-none": !o && !d,
483
- "focus:text-copy-dark": d
484
- }
485
- );
486
- return /* @__PURE__ */ m(
487
- "button",
488
- {
489
- ...l,
490
- ref: i,
491
- role: "menuitem",
492
- className: y,
493
- tabIndex: 0,
494
- disabled: o,
495
- ...b.getItemProps({
496
- onClick(v) {
497
- var f;
498
- s || ((f = l.onClick) == null || f.call(l, v), h == null || h.events.emit("click"));
499
- },
500
- onFocus(v) {
501
- var f;
502
- (f = l.onFocus) == null || f.call(l, v), b.setHasFocusInside(!0);
503
- }
504
- }),
505
- children: [
506
- a,
507
- e && /* @__PURE__ */ t("span", { className: c, children: e })
508
- ]
509
- }
510
- );
511
- }
512
- );
513
- V.displayName = "MenuItem";
514
- const ea = ({ className: e, ...o }) => {
515
- const a = u(e, "my-1 border-t border-border-medium");
516
- return /* @__PURE__ */ t("div", { className: a, ...o });
517
- }, ta = ({
518
- className: e,
519
- ...o
520
- }) => {
521
- const a = u(e, "py-1 px-2 text-sm text-copy-medium");
522
- return /* @__PURE__ */ t("div", { className: a, ...o });
523
- };
524
- /*!
525
- @versini/ui-menu v3.2.0
526
- © 2025 gizmette.com
527
- */
528
- try {
529
- window.__VERSINI_UI_MENU__ || (window.__VERSINI_UI_MENU__ = {
530
- version: "3.2.0",
531
- buildTime: "01/07/2025 04:41 PM EST",
532
- homepage: "https://github.com/aversini/ui-components",
533
- license: "MIT"
534
- });
535
- } catch {
536
- }
537
- /*!
538
- @versini/ui-panel v1.3.4
539
- © 2025 gizmette.com
540
- */
541
- try {
542
- window.__VERSINI_UI_PANEL__ || (window.__VERSINI_UI_PANEL__ = {
543
- version: "1.3.4",
544
- buildTime: "01/06/2025 08:01 PM EST",
545
- homepage: "https://github.com/aversini/ui-components",
546
- license: "MIT"
547
- });
548
- } catch {
549
- }
550
- const Oe = "av-messagebox", $e = "av-panel", Fe = "av-button", ue = "icon", et = "button", xe = "link", aa = ({
551
- type: e,
552
- size: o,
553
- labelRight: a,
554
- labelLeft: r,
555
- align: n
556
- }) => {
557
- const s = "max-h-8 py-0 px-2", d = "max-h-9 py-1 px-3", l = "max-h-12 py-2 px-4";
558
- switch (e) {
559
- case et:
560
- case xe:
561
- return u({
562
- [s]: o === "small",
563
- [d]: o === "medium",
564
- [l]: o === "large"
565
- });
566
- case ue:
567
- return u("inline-flex items-center", {
568
- "justify-center": n === "center",
569
- "justify-start": n === "left",
570
- "justify-end": n === "right",
571
- "h-6 w-6 p-0": o === "small" && !(a || r),
572
- "h-6 px-2": o === "small" && (a || r),
573
- "h-8 w-8 p-1": o === "medium" && !(a || r),
574
- "h-8 px-3": o === "medium" && (a || r),
575
- "h-12 w-12 p-2": o === "large" && !(a || r),
576
- "h-12 px-4": o === "large" && (a || r)
577
- });
578
- }
579
- }, oa = ({
580
- type: e,
581
- size: o,
582
- labelRight: a,
583
- labelLeft: r
584
- }) => {
585
- const n = "text-sm font-medium", s = "text-base font-medium", d = "text-lg font-medium";
586
- switch (e) {
587
- case et:
588
- case xe:
589
- return u({
590
- "text-center": e === xe,
591
- [n]: o === "small",
592
- [s]: o === "medium",
593
- [d]: o === "large"
594
- });
595
- case ue:
596
- return u({
597
- [n]: o === "small" && (a || r),
598
- [s]: o === "medium" && (a || r),
599
- [d]: o === "large" && (a || r)
600
- });
601
- }
602
- }, ra = ({
603
- mode: e,
604
- noBackground: o,
605
- noTruncate: a,
606
- variant: r
607
- }) => {
608
- if (o)
609
- return "not-prose";
610
- if (r === "primary")
611
- return u("not-prose", {
612
- truncate: !a,
613
- "text-copy-light": e === "dark" || e === "system",
614
- "text-copy-lighter": e === "light" || e === "alt-system",
615
- "dark:text-copy-lighter": e === "system",
616
- "dark:text-copy-light": e === "alt-system"
617
- });
618
- if (r === "secondary")
619
- return u("not-prose", {
620
- truncate: !a,
621
- "text-copy-light": e === "light" || e === "system",
622
- "text-copy-lighter": e === "dark" || e === "alt-system",
623
- "dark:text-copy-lighter": e === "alt-system",
624
- "dark:text-copy-light": e === "system"
625
- });
626
- if (r === "danger")
627
- return u("not-prose", {
628
- truncate: !a,
629
- "text-copy-light": e === "dark" || e === "system",
630
- "text-copy-lighter": e === "light" || e === "alt-system",
631
- "dark:text-copy-lighter": e === "system",
632
- "dark:text-copy-light": e === "alt-system"
633
- });
634
- if (r === "selected")
635
- return u("not-prose text-copy-lighter", {
636
- truncate: !a
637
- });
638
- }, na = ({
639
- mode: e,
640
- noBackground: o,
641
- variant: a
642
- }) => {
643
- if (!o) {
644
- if (a === "primary")
645
- return u({
646
- "bg-action-dark": e === "dark",
647
- "bg-action-light": e === "light",
648
- "bg-action-dark dark:bg-action-light": e === "system",
649
- "bg-action-light dark:bg-action-dark": e === "alt-system"
650
- });
651
- if (a === "secondary")
652
- return u({
653
- "bg-action-dark": e === "light",
654
- "bg-action-light": e === "dark",
655
- "bg-action-dark dark:bg-action-light": e === "alt-system",
656
- "bg-action-light dark:bg-action-dark": e === "system"
657
- });
658
- if (a === "danger")
659
- return u({
660
- "bg-action-danger-dark": e === "dark",
661
- "bg-action-danger-light": e === "light",
662
- "bg-action-danger-dark dark:bg-action-danger-light": e === "system",
663
- "bg-action-danger-light dark:bg-action-danger-dark": e === "alt-system"
664
- });
665
- if (a === "selected")
666
- return "bg-action-selected-dark";
667
- }
668
- }, sa = ({
669
- radius: e
670
- }) => u({
671
- "rounded-full": e === "large",
672
- "rounded-md": e === "medium",
673
- "rounded-sm": e === "small"
674
- }), la = ({
675
- mode: e,
676
- disabled: o,
677
- variant: a
678
- }) => {
679
- if (o)
680
- return "";
681
- if (a === "primary")
682
- return u("hover:text-copy-light-hover", {
683
- "hover:bg-action-dark-hover": e === "dark",
684
- "hover:bg-action-light-hover": e === "light",
685
- "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "system",
686
- "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "alt-system"
687
- });
688
- if (a === "secondary")
689
- return u("hover:text-copy-light-hover", {
690
- "hover:bg-action-dark-hover": e === "light",
691
- "hover:bg-action-light-hover": e === "dark",
692
- "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "alt-system",
693
- "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "system"
694
- });
695
- if (a === "danger")
696
- return u("hover:text-copy-light-hover", {
697
- "hover:bg-action-danger-dark-hover": e === "dark",
698
- "hover:bg-action-danger-light-hover": e === "light",
699
- "hover:bg-action-danger-dark-hover dark:hover:bg-action-danger-light-hover": e === "system",
700
- "hover:bg-action-danger-light-hover dark:hover:bg-action-danger-dark-hover": e === "alt-system"
701
- });
702
- if (a === "selected")
703
- return "hover:text-copy-light-hover hover:bg-action-selected-dark-hover";
704
- }, ca = ({
705
- mode: e,
706
- disabled: o,
707
- variant: a
708
- }) => {
709
- if (o)
710
- return "";
711
- if (a === "primary")
712
- return u("active:text-copy-light-active", {
713
- "active:bg-action-dark-active": e === "dark",
714
- "active:bg-action-light-active": e === "light",
715
- "active:bg-action-dark-active dark:active:bg-action-light-active": e === "system",
716
- "active:bg-action-light-active dark:active:bg-action-dark-active": e === "alt-system"
717
- });
718
- if (a === "secondary")
719
- return u("active:text-copy-light-active", {
720
- "active:bg-action-dark-active": e === "light",
721
- "active:bg-action-light-active": e === "dark",
722
- "active:bg-action-dark-active dark:active:bg-action-light-active": e === "alt-system",
723
- "active:bg-action-light-active dark:active:bg-action-dark-active": e === "system"
724
- });
725
- if (a === "danger")
726
- return u("active:text-copy-lighter-active", {
727
- "active:bg-action-danger-dark-active": e === "dark",
728
- "active:bg-action-danger-light-active": e === "light",
729
- "active:bg-action-danger-dark-active dark:active:bg-action-danger-light-active": e === "system",
730
- "active:bg-action-danger-light-active dark:active:bg-action-danger-dark-active": e === "alt-system"
731
- });
732
- if (a === "selected")
733
- return "active:text-copy-lighter-active active:bg-action-selected-dark-active";
734
- }, ia = ({
735
- mode: e,
736
- noBorder: o,
737
- variant: a
738
- }) => {
739
- if (o)
740
- return "border border-transparent";
741
- if (a === "primary")
742
- return u("border", {
743
- "border-border-dark": e === "dark",
744
- "border-border-accent": e === "light",
745
- "border-border-dark dark:border-border-accent": e === "system",
746
- "border-border-accent dark:border-border-dark": e === "alt-system"
747
- });
748
- if (a === "secondary")
749
- return u("border", {
750
- "border-border-dark": e === "light",
751
- "border-border-accent": e === "dark",
752
- "border-border-dark dark:border-border-accent": e === "alt-system",
753
- "border-border-accent dark:border-border-dark": e === "system"
754
- });
755
- if (a === "danger")
756
- return u("border", {
757
- "border-border-danger-dark": e === "dark",
758
- "border-border-danger-medium": e === "light",
759
- "border-border-danger-dark dark:border-border-danger-medium": e === "system",
760
- "border-border-danger-medium dark:border-border-danger-dark": e === "alt-system"
761
- });
762
- if (a === "selected")
763
- return "border border-border-selected-dark";
764
- }, da = ({
765
- focusMode: e
766
- }) => u("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
767
- "focus:outline-focus-dark": e === "dark",
768
- "focus:outline-focus-light": e === "light",
769
- "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
770
- "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
771
- }), tt = ({
772
- type: e,
773
- className: o,
774
- raw: a,
775
- mode: r,
776
- focusMode: n,
777
- disabled: s,
778
- fullWidth: d,
779
- size: l,
780
- noBorder: g,
781
- labelRight: c,
782
- labelLeft: b,
783
- noBackground: k,
784
- variant: h,
785
- noTruncate: i,
786
- align: y,
787
- radius: v
788
- }) => (h || (h = "primary"), a ? u(Fe, o) : u(
789
- Fe,
790
- ra({
791
- mode: r,
792
- variant: h,
793
- noBackground: k,
794
- noTruncate: i
795
- }),
796
- na({ mode: r, noBackground: k, variant: h }),
797
- sa({ radius: v }),
798
- aa({
799
- type: e,
800
- size: l,
801
- labelRight: c,
802
- labelLeft: b,
803
- align: y
804
- }),
805
- oa({ type: e, size: l, labelRight: c, labelLeft: b }),
806
- ia({ mode: r, variant: h, noBorder: g }),
807
- da({ focusMode: n }),
808
- la({ mode: r, variant: h, disabled: s }),
809
- ca({ mode: r, variant: h, disabled: s }),
810
- {
811
- "w-full": d,
812
- "disabled:cursor-not-allowed disabled:opacity-50": s
813
- },
814
- o
815
- )), ma = (e, o, a) => {
816
- var r;
817
- !o && (!document.activeElement || document.activeElement !== e.currentTarget) && typeof ((r = e == null ? void 0 : e.currentTarget) == null ? void 0 : r.focus) == "function" && e.currentTarget.focus(), typeof a == "function" && a(e);
818
- }, Se = he.forwardRef((e, o) => {
819
- const { onClick: a, noInternalClick: r = !1, ...n } = e;
820
- return /* @__PURE__ */ t(
821
- "button",
822
- {
823
- ref: o,
824
- onClick: (s) => {
825
- ma(s, r, a);
826
- },
827
- ...n
828
- }
829
- );
830
- });
831
- Se.displayName = "BaseButton";
832
- const at = he.forwardRef(
833
- ({
834
- children: e,
835
- disabled: o = !1,
836
- mode: a = "system",
837
- focusMode: r = "system",
838
- fullWidth: n = !1,
839
- className: s,
840
- type: d = "button",
841
- raw: l = !1,
842
- noBorder: g = !1,
843
- "aria-label": c,
844
- label: b,
845
- size: k = "medium",
846
- labelRight: h,
847
- labelLeft: i,
848
- noBackground: y = !1,
849
- align: v = "center",
850
- radius: f = "large",
851
- variant: T = "primary",
852
- ...N
853
- }, p) => {
854
- const w = tt({
855
- type: ue,
856
- mode: a,
857
- focusMode: r,
858
- fullWidth: n,
859
- disabled: o,
860
- raw: l,
861
- className: s,
862
- noBorder: g,
863
- size: k,
864
- labelRight: h,
865
- labelLeft: i,
866
- noBackground: y,
867
- align: v,
868
- radius: f,
869
- variant: T
870
- }), S = u({
871
- "text-copy-accent-dark": a === "light" && !l,
872
- "text-copy-light": a === "dark" && !l,
873
- "text-copy-accent-dark dark:text-copy-light": a === "alt-system" && !l,
874
- "text-copy-light dark:text-copy-accent-dark": a === "system" && !l
875
- });
876
- return /* @__PURE__ */ m(
877
- Se,
878
- {
879
- ref: p,
880
- className: w,
881
- disabled: o,
882
- type: d,
883
- "aria-label": c || b,
884
- ...N,
885
- children: [
886
- i && /* @__PURE__ */ t("span", { className: "pr-2", children: i }),
887
- /* @__PURE__ */ t("div", { className: S, children: e }),
888
- h && /* @__PURE__ */ t("span", { className: "pl-2", children: h })
889
- ]
890
- }
891
- );
892
- }
893
- );
894
- at.displayName = "ButtonIcon";
895
- /*!
896
- @versini/ui-button v4.0.4
897
- © 2025 gizmette.com
898
- */
899
- try {
900
- window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
901
- version: "4.0.4",
902
- buildTime: "01/06/2025 08:01 PM EST",
903
- homepage: "https://github.com/aversini/ui-components",
904
- license: "MIT"
905
- });
906
- } catch {
907
- }
908
- const ha = he.forwardRef(
909
- ({
910
- children: e,
911
- disabled: o = !1,
912
- mode: a = "system",
913
- focusMode: r = "system",
914
- fullWidth: n = !1,
915
- className: s,
916
- type: d = "button",
917
- raw: l = !1,
918
- noBorder: g = !1,
919
- "aria-label": c,
920
- label: b,
921
- size: k = "medium",
922
- labelRight: h,
923
- labelLeft: i,
924
- noBackground: y = !1,
925
- align: v = "center",
926
- active: f = !1,
927
- radius: T = "large",
928
- ...N
929
- }, p) => {
930
- const w = tt({
931
- type: ue,
932
- mode: a,
933
- focusMode: r,
934
- fullWidth: n,
935
- disabled: o,
936
- raw: l,
937
- className: s,
938
- noBorder: g,
939
- size: k,
940
- labelRight: h,
941
- labelLeft: i,
942
- noBackground: y,
943
- align: v,
944
- radius: T
945
- }), S = u({
946
- "text-copy-accent-dark": a === "light" && !l,
947
- "text-copy-light": a === "dark" && !l,
948
- "text-copy-accent-dark dark:text-copy-light": a === "alt-system" && !l,
949
- "text-copy-light dark:text-copy-accent-dark": a === "system" && !l
950
- }), A = f ? u(
951
- "relative",
952
- "focus-within:static",
953
- "focus-within:after:border-transparent",
954
- "after:absolute",
955
- "after:content-['']",
956
- "after:border-b-2",
957
- "after:bottom-[-4px]",
958
- "after:left-0",
959
- "after:right-0",
960
- {
961
- "after:border-table-dark": a === "dark",
962
- "after:border-table-light": a === "light",
963
- "after:border-table-dark dark:after:border-table-light": a === "system",
964
- "after:border-table-light dark:after:border-table-dark": a === "alt-system"
965
- }
966
- ) : "";
967
- return /* @__PURE__ */ t("div", { className: A, children: /* @__PURE__ */ m(
968
- Se,
969
- {
970
- ref: p,
971
- className: w,
972
- disabled: o,
973
- type: d,
974
- "aria-label": c || b,
975
- ...N,
976
- children: [
977
- i && /* @__PURE__ */ t("span", { className: "pr-2", children: i }),
978
- /* @__PURE__ */ t("div", { className: S, children: e }),
979
- h && /* @__PURE__ */ t("span", { className: "pl-2", children: h })
980
- ]
981
- }
982
- ) });
983
- }
984
- );
985
- ha.displayName = "ButtonSort";
986
- const ua = ({
987
- children: e,
988
- fill: o,
989
- viewBox: a,
990
- className: r,
991
- defaultViewBox: n,
992
- size: s,
993
- title: d,
994
- semantic: l = !1,
995
- ...g
996
- }) => {
997
- const c = u(s, r);
998
- return /* @__PURE__ */ m(z, { children: [
999
- /* @__PURE__ */ t(
1000
- "svg",
1001
- {
1002
- xmlns: "http://www.w3.org/2000/svg",
1003
- className: c,
1004
- viewBox: a || n,
1005
- fill: o || "currentColor",
1006
- role: "img",
1007
- "aria-hidden": !l,
1008
- focusable: !1,
1009
- ...g,
1010
- children: e
1011
- }
1012
- ),
1013
- d && l && /* @__PURE__ */ t("span", { className: "sr-only", children: d })
1014
- ] });
1015
- };
1016
- /*!
1017
- @versini/ui-svgicon v4.0.1
1018
- © 2025 gizmette.com
1019
- */
1020
- try {
1021
- window.__VERSINI_UI_SVGICON__ || (window.__VERSINI_UI_SVGICON__ = {
1022
- version: "4.0.1",
1023
- buildTime: "01/06/2025 08:00 PM EST",
1024
- homepage: "https://github.com/aversini/ui-components",
1025
- license: "MIT"
1026
- });
1027
- } catch {
1028
- }
1029
- const ga = ({
1030
- className: e,
1031
- viewBox: o,
1032
- title: a,
1033
- monotone: r,
1034
- ...n
1035
- }) => /* @__PURE__ */ t(
1036
- ua,
1037
- {
1038
- defaultViewBox: "0 0 384 512",
1039
- size: "size-5",
1040
- viewBox: o,
1041
- className: e,
1042
- title: a || "Close",
1043
- ...n,
1044
- children: /* @__PURE__ */ t("path", { d: "M345 137c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-119 119L73 103c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l119 119L39 375c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l119-119L311 409c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-119-119L345 137z" })
1045
- }
1046
- );
1047
- /*!
1048
- @versini/ui-icons v4.2.1
1049
- © 2025 gizmette.com
1050
- */
1051
- try {
1052
- window.__VERSINI_UI_ICONS__ || (window.__VERSINI_UI_ICONS__ = {
1053
- version: "4.2.1",
1054
- buildTime: "01/06/2025 08:00 PM EST",
1055
- homepage: "https://github.com/aversini/ui-components",
1056
- license: "MIT"
1057
- });
1058
- } catch {
1059
- }
1060
- const ot = I.createContext(null);
1061
- function pa({
1062
- initialOpen: e = !1,
1063
- open: o,
1064
- onOpenChange: a
1065
- } = {}) {
1066
- const [r, n] = I.useState(e), [s, d] = I.useState(), [l, g] = I.useState(), c = o ?? r, b = a ?? n, k = je({
1067
- open: c,
1068
- onOpenChange: b
1069
- }), h = k.context, i = We(h, {
1070
- enabled: o == null
1071
- }), y = Ke(h, {
1072
- outsidePress: !1,
1073
- outsidePressEvent: "mousedown"
1074
- }), v = Ye(h), f = Ze([i, y, v]);
1075
- return I.useMemo(
1076
- () => ({
1077
- open: c,
1078
- setOpen: b,
1079
- ...f,
1080
- ...k,
1081
- labelId: s,
1082
- descriptionId: l,
1083
- setLabelId: d,
1084
- setDescriptionId: g
1085
- }),
1086
- [c, b, f, k, s, l]
1087
- );
1088
- }
1089
- const ge = () => {
1090
- const e = I.useContext(ot);
1091
- if (e == null)
1092
- throw new Error("Modal components must be wrapped in <Modal />");
1093
- return e;
1094
- };
1095
- function fa({
1096
- children: e,
1097
- ...o
1098
- }) {
1099
- const a = pa(o);
1100
- return /* @__PURE__ */ t(ot.Provider, { value: a, children: e });
1101
- }
1102
- const ba = I.forwardRef(function(e, o) {
1103
- const { context: a, ...r } = ge(), n = Ce([r.refs.setFloating, o]);
1104
- if (!a.open)
1105
- return null;
1106
- const { overlayBackground: s, ...d } = e, l = u("grid place-items-center", {
1107
- [`${s}`]: s,
1108
- "bg-black sm:bg-black/[.8]": !s
1109
- });
1110
- return /* @__PURE__ */ t(qe, { children: /* @__PURE__ */ t(Bt, { className: l, lockScroll: !0, children: /* @__PURE__ */ t(Qe, { context: a, children: /* @__PURE__ */ t(
1111
- "div",
1112
- {
1113
- ref: n,
1114
- "aria-labelledby": r.labelId,
1115
- "aria-describedby": r.descriptionId,
1116
- ...r.getFloatingProps(d),
1117
- children: d.children
1118
- }
1119
- ) }) }) });
1120
- }), ya = I.forwardRef(function({ children: e, ...o }, a) {
1121
- const { setLabelId: r } = ge(), n = we();
1122
- return I.useLayoutEffect(() => (r(n), () => r(void 0)), [n, r]), /* @__PURE__ */ t("h1", { ...o, ref: a, id: n, children: e });
1123
- }), ka = I.forwardRef(function({ children: e, ...o }, a) {
1124
- const { setDescriptionId: r } = ge(), n = we();
1125
- return I.useLayoutEffect(() => (r(n), () => r(void 0)), [n, r]), /* @__PURE__ */ t("div", { ...o, ref: a, id: n, children: e });
1126
- }), va = I.forwardRef(function(e, o) {
1127
- const { setOpen: a } = ge(), { trigger: r, className: n, ...s } = e, d = I.useCallback(() => a(!1), [a]);
1128
- return /* @__PURE__ */ t("div", { className: n, children: I.cloneElement(r, {
1129
- ref: o,
1130
- onClick: d,
1131
- ...s
1132
- }) });
1133
- });
1134
- /*!
1135
- @versini/ui-modal v1.2.1
1136
- © 2025 gizmette.com
1137
- */
1138
- try {
1139
- window.__VERSINI_UI_MODAL__ || (window.__VERSINI_UI_MODAL__ = {
1140
- version: "1.2.1",
1141
- buildTime: "01/06/2025 08:00 PM EST",
1142
- homepage: "https://github.com/aversini/ui-components",
1143
- license: "MIT"
1144
- });
1145
- } catch {
1146
- }
1147
- const te = "panel", ce = "messagebox", Na = ({
1148
- className: e,
1149
- kind: o,
1150
- borderMode: a
1151
- }) => ({
1152
- main: u("prose prose-lighter flex flex-col bg-surface-medium", {
1153
- [`${$e} max-h-full sm:max-h-[95%] min-h-full sm:min-h-[10rem] sm:rounded-lg sm:border-2`]: o === te,
1154
- [`${$e} w-full sm:w-[95%] md:max-w-2xl`]: o === te && !e,
1155
- [`${Oe} rounded-lg border-2`]: o === ce,
1156
- [`${Oe} w-[95%] sm:w-[50%] md:max-w-2xl`]: o === ce && !e,
1157
- [`${e}`]: !!e,
1158
- "sm:border-border-dark": a === "dark" && o === te,
1159
- "sm:border-border-accent": a === "light" && o === te,
1160
- "border-border-dark": a === "dark" && o === ce,
1161
- "border-border-accent": a === "light" && o === ce
1162
- }),
1163
- content: "flex flex-col py-2 sm:py-4 sm:px-4 px-2 overflow-y-auto",
1164
- footer: "flex flex-grow flex-col sm:p-4 p-2",
1165
- header: "sm:p-4 mb-0 p-2",
1166
- close: "sm:p-4 p-2"
1167
- }), Q = ({
1168
- open: e,
1169
- onOpenChange: o,
1170
- title: a,
1171
- children: r,
1172
- footer: n,
1173
- borderMode: s = "light",
1174
- kind: d = te,
1175
- className: l
1176
- }) => {
1177
- const g = Y(""), c = Na({ className: l, kind: d, borderMode: s });
1178
- return G(() => (e && (g.current = document.title, document.title = `${a} | ${g.current}`), () => {
1179
- e && (document.title = g.current);
1180
- }), [a, e]), /* @__PURE__ */ t(z, { children: e && /* @__PURE__ */ t(fa, { open: e, onOpenChange: o, children: /* @__PURE__ */ m(ba, { className: c.main, children: [
1181
- /* @__PURE__ */ m("div", { className: "flex flex-row-reverse items-center justify-between", children: [
1182
- /* @__PURE__ */ t(
1183
- va,
1184
- {
1185
- className: c.close,
1186
- trigger: /* @__PURE__ */ t(
1187
- at,
1188
- {
1189
- mode: "dark",
1190
- focusMode: "light",
1191
- noBorder: !0,
1192
- label: "Close",
1193
- children: /* @__PURE__ */ t(ga, {})
1194
- }
1195
- )
1196
- }
1197
- ),
1198
- /* @__PURE__ */ t(ya, { className: c.header, children: a })
1199
- ] }),
1200
- /* @__PURE__ */ t(ka, { className: c.content, children: r }),
1201
- n && /* @__PURE__ */ t("div", { className: c.footer, children: n })
1202
- ] }) }) });
1203
- }, xa = () => {
1204
- const { getAccessToken: e } = P(), o = me(), a = me(), {
1205
- data: r,
1206
- error: n,
1207
- isLoading: s
1208
- } = Pt({
1209
- getAccessToken: e
1210
- }), d = (r == null ? void 0 : r.plugins) || [], l = (r == null ? void 0 : r.version) || "", g = (r == null ? void 0 : r.models) || [];
1211
- return /* @__PURE__ */ m(z, { children: [
1212
- /* @__PURE__ */ t("div", { className: "mb-4", children: /* @__PURE__ */ t(
1213
- B,
1214
- {
1215
- header: C.ABOUT.TITLE_CLIENT,
1216
- className: "prose-dark dark:prose-lighter",
1217
- children: ie(o, {
1218
- [C.ABOUT.VERSION]: "5.19.16",
1219
- [C.ABOUT.BUILD_TIMESTAMP]: "01/09/2025 09:01 AM EST"
1220
- })
1221
- }
1222
- ) }),
1223
- n || s ? null : /* @__PURE__ */ t(
1224
- B,
1225
- {
1226
- header: C.ABOUT.TITLE_SERVER,
1227
- className: "prose-dark dark:prose-lighter",
1228
- children: ie(a, {
1229
- [C.ABOUT.VERSION]: l,
1230
- [de(C.ABOUT.ENGINE, g.length)]: /* @__PURE__ */ t(z, { children: g.map((c) => /* @__PURE__ */ t("div", { className: "text-right", children: c }, c)) }),
1231
- [de(C.ABOUT.PLUGIN, d.length)]: /* @__PURE__ */ t(z, { children: d.map((c) => /* @__PURE__ */ t("div", { className: "text-right", children: c }, c)) })
1232
- })
1233
- }
1234
- )
1235
- ] });
1236
- }, wa = ({
1237
- open: e,
1238
- onOpenChange: o
1239
- }) => /* @__PURE__ */ t(Q, { open: e, onOpenChange: o, title: lt, children: /* @__PURE__ */ t(xa, {}) }), rt = ({
1240
- showConfirmation: e,
1241
- setShowConfirmation: o,
1242
- action: a,
1243
- children: r,
1244
- customStrings: n
1245
- }) => /* @__PURE__ */ t(
1246
- Q,
1247
- {
1248
- kind: "messagebox",
1249
- open: e,
1250
- onOpenChange: o,
1251
- title: n.title,
1252
- footer: /* @__PURE__ */ m(H, { columnGap: 2, alignHorizontal: "flex-end", children: [
1253
- /* @__PURE__ */ t(_, { children: /* @__PURE__ */ t(
1254
- U,
1255
- {
1256
- mode: "dark",
1257
- variant: "secondary",
1258
- focusMode: "light",
1259
- onClick: () => {
1260
- o(!1);
1261
- },
1262
- children: n.cancelAction
1263
- }
1264
- ) }),
1265
- /* @__PURE__ */ t(_, { children: /* @__PURE__ */ t(
1266
- U,
1267
- {
1268
- mode: "dark",
1269
- variant: "danger",
1270
- focusMode: "light",
1271
- onClick: () => {
1272
- o(!1), a();
1273
- },
1274
- children: n.confirmAction
1275
- }
1276
- ) })
1277
- ] }),
1278
- children: r
1279
- }
1280
- ), Ca = async (e, o, a, r) => {
1281
- try {
1282
- const n = await Z({
1283
- accessToken: r,
1284
- type: q.GET_CHAT,
1285
- params: {
1286
- id: e.id
1287
- }
1288
- });
1289
- n.status === 200 && (o({
1290
- type: De
1291
- }), o({
1292
- type: it,
1293
- payload: {
1294
- id: e.id,
1295
- model: n.data.model,
1296
- usage: n.data.usage,
1297
- messages: n.data.messages
1298
- }
1299
- }), a(!1));
1300
- } catch {
1301
- }
1302
- }, Ea = ({
1303
- filteredHistory: e,
1304
- dispatch: o,
1305
- onOpenChange: a,
1306
- mutate: r
1307
- }) => {
1308
- var N;
1309
- const { user: n, getAccessToken: s } = P(), d = Y(null), l = Y({
1310
- id: 0,
1311
- timestamp: "",
1312
- message: ""
1313
- }), [g, c] = E(!1), [b, k] = E(
1314
- Le + ze
1315
- ), { state: h, dispatch: i } = K(Xe), [, y] = re({
1316
- key: oe + ct,
1317
- initialValue: h.sortDirection
1318
- }), v = (p) => {
1319
- switch (h.sortDirection) {
1320
- case ee.ASC:
1321
- y(ee.DESC), i({
1322
- type: Me,
1323
- payload: {
1324
- sortedCell: p,
1325
- sortDirection: ee.DESC
1326
- }
1327
- });
1328
- break;
1329
- default:
1330
- y(ee.ASC), i({
1331
- type: Me,
1332
- payload: {
1333
- sortedCell: p,
1334
- sortDirection: ee.ASC
1335
- }
1336
- });
1337
- break;
1338
- }
1339
- }, f = async () => {
1340
- const p = l.current;
1341
- try {
1342
- await Z({
1343
- accessToken: await s(),
1344
- type: q.DELETE_CHAT,
1345
- params: {
1346
- userId: (n == null ? void 0 : n.username) || "",
1347
- id: p.id
1348
- }
1349
- }), r();
1350
- } catch {
1351
- }
1352
- }, T = wt((p) => {
1353
- p[0].isIntersecting && k((S) => S + Le);
1354
- }, []);
1355
- return G(() => {
1356
- const p = {
1357
- // root: null,
1358
- rootMargin: "20px"
1359
- }, w = new IntersectionObserver(T, p);
1360
- d.current && w.observe(d.current);
1361
- }), /* @__PURE__ */ m(z, { children: [
1362
- /* @__PURE__ */ m(
1363
- rt,
1364
- {
1365
- showConfirmation: g,
1366
- setShowConfirmation: c,
1367
- action: f,
1368
- customStrings: {
1369
- confirmAction: "Delete",
1370
- cancelAction: "Cancel",
1371
- title: "Delete chat"
1372
- },
1373
- children: [
1374
- /* @__PURE__ */ t("p", { className: "m-0", children: "Are you sure you want to delete the following chat:" }),
1375
- /* @__PURE__ */ m("ul", { className: "m-0", children: [
1376
- /* @__PURE__ */ m("li", { children: [
1377
- "Timestamp:",
1378
- " ",
1379
- /* @__PURE__ */ t("span", { className: "text-lg", children: l.current && l.current.timestamp })
1380
- ] }),
1381
- /* @__PURE__ */ m("li", { children: [
1382
- "First message:",
1383
- " ",
1384
- /* @__PURE__ */ t("span", { className: "text-lg", children: (N = l.current) == null ? void 0 : N.message })
1385
- ] })
1386
- ] })
1387
- ]
1388
- }
1389
- ),
1390
- /* @__PURE__ */ m(Ot, { stickyHeader: !0, stickyFooter: !0, compact: !0, children: [
1391
- /* @__PURE__ */ t($t, { children: /* @__PURE__ */ m(be, { children: [
1392
- /* @__PURE__ */ t(R, { className: "sr-only", children: "Row" }),
1393
- /* @__PURE__ */ t(
1394
- Ft,
1395
- {
1396
- buttonClassName: "text-xs sm:text-sm",
1397
- cellId: "timestamp",
1398
- align: "left",
1399
- sortDirection: h.sortDirection,
1400
- sortedCell: h.sortedCell,
1401
- onClick: () => {
1402
- v("timestamp");
1403
- },
1404
- children: "Date"
1405
- }
1406
- ),
1407
- /* @__PURE__ */ t(R, { className: "text-xs sm:text-sm", children: "First message" }),
1408
- /* @__PURE__ */ t(R, { className: "text-xs sm:text-sm", children: "Model" }),
1409
- /* @__PURE__ */ t(R, { className: "text-xs sm:text-sm text-right", children: "Actions" })
1410
- ] }) }),
1411
- /* @__PURE__ */ t(Dt, { children: e.slice(0, b).map((p, w) => {
1412
- var S, A;
1413
- return ((S = p == null ? void 0 : p.messages) == null ? void 0 : S.length) > 0 ? /* @__PURE__ */ m(Ct, { children: [
1414
- w === b - ze && /* @__PURE__ */ t("tr", { ref: d }),
1415
- /* @__PURE__ */ m(be, { children: [
1416
- /* @__PURE__ */ t(R, { children: w + 1 }),
1417
- /* @__PURE__ */ t(
1418
- R,
1419
- {
1420
- component: "th",
1421
- scope: "row",
1422
- className: "text-gray-400 sm:whitespace-nowrap text-xs sm:text-sm max-w-20 sm:max-w-none",
1423
- children: p.timestamp.split(",")[0]
1424
- }
1425
- ),
1426
- /* @__PURE__ */ t(
1427
- R,
1428
- {
1429
- className: "max-w-[100px] text-white sm:max-w-full text-xs sm:text-sm",
1430
- style: {
1431
- wordBreak: "break-word"
1432
- },
1433
- children: p.messages.length > 0 ? (A = p.messages[0]) == null ? void 0 : A.content : ""
1434
- }
1435
- ),
1436
- /* @__PURE__ */ m(
1437
- R,
1438
- {
1439
- component: "th",
1440
- scope: "row",
1441
- className: "text-gray-400",
1442
- align: "center",
1443
- children: [
1444
- p.model && p.model.startsWith("claude") && /* @__PURE__ */ t(ke, { size: "size-4 sm:size-5" }),
1445
- p.model && p.model.startsWith("gpt") && /* @__PURE__ */ t(ve, { size: "size-4 sm:size-5" })
1446
- ]
1447
- }
1448
- ),
1449
- /* @__PURE__ */ m(R, { align: "right", children: [
1450
- /* @__PURE__ */ t(
1451
- W,
1452
- {
1453
- className: "mr-2",
1454
- focusMode: "alt-system",
1455
- noBorder: !0,
1456
- label: "Restore chat",
1457
- onClick: async () => {
1458
- const L = await s();
1459
- Ca(
1460
- p,
1461
- o,
1462
- a,
1463
- L
1464
- );
1465
- },
1466
- children: /* @__PURE__ */ t(Qt, { size: "size-3", monotone: !0 })
1467
- }
1468
- ),
1469
- /* @__PURE__ */ t(
1470
- W,
1471
- {
1472
- focusMode: "alt-system",
1473
- noBorder: !0,
1474
- label: "Delete chat",
1475
- onClick: () => {
1476
- var L;
1477
- l.current = {
1478
- id: p.id,
1479
- timestamp: p.timestamp,
1480
- message: p.messages.length > 0 ? (L = p.messages[0]) == null ? void 0 : L.content : ""
1481
- }, c(!g);
1482
- },
1483
- children: /* @__PURE__ */ t("div", { className: "text-red-400", children: /* @__PURE__ */ t(Wt, { size: "size-3", monotone: !0 }) })
1484
- }
1485
- )
1486
- ] })
1487
- ] })
1488
- ] }, `${C.HISTORY.TITLE}-${p.id}-${w}`) : null;
1489
- }) }),
1490
- /* @__PURE__ */ t(Vt, { children: /* @__PURE__ */ t(be, { children: /* @__PURE__ */ t(R, { colSpan: 1e3, children: /* @__PURE__ */ t("div", { children: de(
1491
- `${e.length} chat`,
1492
- e.length
1493
- ) }) }) }) })
1494
- ] })
1495
- ] });
1496
- }, Ia = ({
1497
- open: e,
1498
- onOpenChange: o
1499
- }) => {
1500
- const { getAccessToken: a, user: r } = P(), { dispatch: n } = K(Ee), { state: s, dispatch: d } = K(Xe), { data: l, mutate: g } = Ut({
1501
- keys: [
1502
- r == null ? void 0 : r.username,
1503
- s.searchString,
1504
- s.sortDirection
1505
- ],
1506
- getAccessToken: a
1507
- }), c = Y(null), [, b] = re({
1508
- key: oe + dt,
1509
- initialValue: s.searchString
1510
- }), [k, h] = E([]);
1511
- G(() => {
1512
- l && h(l);
1513
- }, [l]);
1514
- const i = async (f) => {
1515
- b(f), d({
1516
- type: ht,
1517
- payload: { searchString: f }
1518
- });
1519
- }, y = ut((f) => {
1520
- i(f.target.value.trim());
1521
- }, 500);
1522
- return /* @__PURE__ */ t(Q, { open: e, onOpenChange: o, title: mt, children: /* @__PURE__ */ m(z, { children: [
1523
- /* @__PURE__ */ t("form", { autoComplete: "off", onSubmit: async (f) => {
1524
- f.preventDefault();
1525
- }, children: /* @__PURE__ */ t(
1526
- ye,
1527
- {
1528
- autoCapitalize: "off",
1529
- autoComplete: "off",
1530
- autoCorrect: "off",
1531
- ref: c,
1532
- defaultValue: s.searchString,
1533
- focusMode: "light",
1534
- mode: "dark",
1535
- name: "Search",
1536
- label: "Search",
1537
- onChange: y,
1538
- className: "mt-2 mb-2",
1539
- ...s.searchString && {
1540
- rightElement: /* @__PURE__ */ t(
1541
- U,
1542
- {
1543
- type: "button",
1544
- disabled: !s.searchString,
1545
- mode: "light",
1546
- focusMode: "light",
1547
- noBorder: !0,
1548
- size: "small",
1549
- onClick: () => {
1550
- var f;
1551
- i(""), (f = c.current) != null && f.value && (c.current.value = "", c.current.focus());
1552
- },
1553
- children: "Reset"
1554
- }
1555
- )
1556
- }
1557
- }
1558
- ) }),
1559
- /* @__PURE__ */ t("div", { className: "flex flex-col gap-2 sm:flex-row max-h-[60vh] min-h-[60vh]", children: /* @__PURE__ */ t(
1560
- Ea,
1561
- {
1562
- mutate: g,
1563
- filteredHistory: k,
1564
- dispatch: n,
1565
- onOpenChange: o
1566
- }
1567
- ) })
1568
- ] }) });
1569
- }, Ta = ({ stats: e }) => {
1570
- const { isAuthenticated: o, user: a, registeringForPasskey: r, authenticationType: n } = P(), s = me(), d = me(), l = (a == null ? void 0 : a.username) || "";
1571
- return o && l ? /* @__PURE__ */ m(z, { children: [
1572
- /* @__PURE__ */ t(
1573
- B,
1574
- {
1575
- header: C.PREFERENCES.TITLE,
1576
- className: "prose-dark dark:prose-lighter",
1577
- children: ie(s, {
1578
- [C.PREFERENCES.NAME]: l,
1579
- [C.PREFERENCES.EMAIL]: (a == null ? void 0 : a.email) || ""
1580
- })
1581
- }
1582
- ),
1583
- n !== gt.PASSKEY && /* @__PURE__ */ m(
1584
- B,
1585
- {
1586
- className: "prose-dark dark:prose-lighter mt-4",
1587
- header: /* @__PURE__ */ t("h2", { className: "m-0", children: /* @__PURE__ */ m(H, { columnGap: 3, alignVertical: "center", children: [
1588
- /* @__PURE__ */ t(_, { children: /* @__PURE__ */ t(Re, { size: "size-8" }) }),
1589
- /* @__PURE__ */ t(_, { children: /* @__PURE__ */ t("div", { children: C.PREFERENCES.PASSKEY_TITLE }) })
1590
- ] }) }),
1591
- children: [
1592
- /* @__PURE__ */ t("p", { children: C.PREFERENCES.PASSKEY_INSTRUCTIONS }),
1593
- /* @__PURE__ */ t(
1594
- W,
1595
- {
1596
- size: "small",
1597
- className: "mt-2",
1598
- onClick: r,
1599
- labelLeft: C.PREFERENCES.PASSKEY_BUTTON,
1600
- children: /* @__PURE__ */ t(Re, { size: "size-5", monotone: !0 })
1601
- }
1602
- )
1603
- ]
1604
- }
1605
- ),
1606
- /* @__PURE__ */ t(
1607
- B,
1608
- {
1609
- header: C.MAIN_STATISTICS.TITLE,
1610
- className: "prose-dark dark:prose-lighter mt-4",
1611
- children: ie(d, {
1612
- [de(C.MAIN_STATISTICS.TOTAL, e.totalChats)]: e.totalChats,
1613
- [C.MAIN_STATISTICS.PROCESSING_TIME]: pt(
1614
- e.averageProcessingTimes
1615
- )
1616
- })
1617
- }
1618
- )
1619
- ] }) : null;
1620
- }, Sa = ({
1621
- open: e,
1622
- onOpenChange: o
1623
- }) => {
1624
- const { getAccessToken: a, user: r } = P(), {
1625
- data: n,
1626
- error: s,
1627
- isLoading: d
1628
- } = Ht({
1629
- keys: [r == null ? void 0 : r.username],
1630
- getAccessToken: a
1631
- });
1632
- return s || d ? null : /* @__PURE__ */ t(Q, { open: e, onOpenChange: o, title: ft, children: /* @__PURE__ */ t(Ta, { stats: n }) });
1633
- };
1634
- /*!
1635
- @versini/ui-toggle v3.0.1
1636
- © 2025 gizmette.com
1637
- */
1638
- try {
1639
- window.__VERSINI_UI_TOGGLE__ || (window.__VERSINI_UI_TOGGLE__ = {
1640
- version: "3.0.1",
1641
- buildTime: "01/06/2025 08:00 PM EST",
1642
- homepage: "https://github.com/aversini/ui-components",
1643
- license: "MIT"
1644
- });
1645
- } catch {
1646
- }
1647
- const _a = "av-toggle", La = () => u("peer", "h-6", "w-11", "rounded-full"), za = ({
1648
- focusMode: e
1649
- }) => u(
1650
- "peer-focus:outline",
1651
- "peer-focus:outline-2",
1652
- "peer-focus:outline-offset-2",
1653
- {
1654
- "peer-focus:outline-focus-dark": e === "dark",
1655
- "peer-focus:outline-focus-light": e === "light",
1656
- "peer-focus:outline-focus-light dark:peer-focus:outline-focus-dark": e === "alt-system",
1657
- "peer-focus:outline-focus-dark dark:peer-focus:outline-focus-light": e === "system"
1658
- }
1659
- ), Ma = () => u(
1660
- "peer-checked:after:translate-x-full",
1661
- // background color when checked
1662
- "peer-checked:bg-violet-500",
1663
- // knob circle and border color when checked
1664
- "peer-checked:after:bg-white",
1665
- "peer-checked:after:border-white"
1666
- ), Ra = () => u(
1667
- "after:left-[2px]",
1668
- "after:top-[2px]",
1669
- "after:border",
1670
- "after:border-surface-light dark:after:border-surface-medium",
1671
- "after:bg-surface-light dark:after:bg-surface-medium",
1672
- "after:absolute",
1673
- "after:h-5",
1674
- "after:w-5",
1675
- "after:rounded-full",
1676
- "after:transition-all",
1677
- "after:content-['']"
1678
- ), Aa = ({
1679
- mode: e,
1680
- noBorder: o
1681
- }) => u({
1682
- border: !o,
1683
- "border-border-dark bg-surface-medium": e === "light",
1684
- "border-border-light bg-surface-darker": e === "dark",
1685
- "border-border-light bg-surface-darker dark:border-border-dark dark:bg-surface-medium": e === "alt-system",
1686
- "border-border-dark bg-surface-medium dark:border-border-light dark:bg-surface-darker": e === "system"
1687
- }), Ba = ({
1688
- mode: e,
1689
- labelHidden: o
1690
- }) => o ? "sr-only" : u("ml-2 text-sm", {
1691
- "text-copy-dark": e === "light",
1692
- "text-copy-lighter": e === "dark",
1693
- "text-copy-lighter dark:text-copy-dark": e === "alt-system",
1694
- "text-copy-dark dark:text-copy-lighter": e === "system"
1695
- }), Pa = ({ className: e }) => u(
1696
- _a,
1697
- "relative flex cursor-pointer items-center",
1698
- e
1699
- ), Oa = ({
1700
- mode: e,
1701
- focusMode: o,
1702
- labelHidden: a,
1703
- className: r,
1704
- noBorder: n
1705
- }) => ({
1706
- toggle: u(
1707
- La(),
1708
- Aa({ mode: e, noBorder: n }),
1709
- za({ focusMode: o }),
1710
- Ra(),
1711
- Ma()
1712
- ),
1713
- label: Ba({ mode: e, labelHidden: a }),
1714
- input: "peer sr-only",
1715
- wrapper: Pa({ className: r })
1716
- }), ae = ({
1717
- checked: e = !1,
1718
- onChange: o,
1719
- label: a,
1720
- labelHidden: r = !1,
1721
- name: n,
1722
- mode: s = "system",
1723
- focusMode: d = "system",
1724
- className: l,
1725
- noBorder: g = !1
1726
- }) => {
1727
- const c = Oa({
1728
- mode: s,
1729
- focusMode: d,
1730
- labelHidden: r,
1731
- className: l,
1732
- noBorder: g
1733
- }), b = (k) => {
1734
- o == null || o(k.target.checked);
1735
- };
1736
- return /* @__PURE__ */ m("label", { className: c.wrapper, children: [
1737
- /* @__PURE__ */ t(
1738
- "input",
1739
- {
1740
- name: n,
1741
- checked: e,
1742
- type: "checkbox",
1743
- className: c.input,
1744
- onChange: b
1745
- }
1746
- ),
1747
- /* @__PURE__ */ t("div", { className: c.toggle }),
1748
- /* @__PURE__ */ t("span", { className: c.label, children: a })
1749
- ] });
1750
- }, $a = ({
1751
- open: e,
1752
- onOpenChange: o
1753
- }) => {
1754
- const { getAccessToken: a, user: r } = P(), {
1755
- data: n,
1756
- error: s,
1757
- isLoading: d,
1758
- mutate: l
1759
- } = Ie({
1760
- keys: [r == null ? void 0 : r.username],
1761
- getAccessToken: a
1762
- }), [g, c] = E({
1763
- prompts: []
1764
- }), b = ({
1765
- slot: i,
1766
- checked: y,
1767
- label: v,
1768
- content: f
1769
- }) => {
1770
- c((T) => {
1771
- const N = T.prompts, p = {
1772
- slot: i,
1773
- label: v,
1774
- content: f,
1775
- enabled: y
1776
- }, w = N.findIndex((S) => S.slot === i);
1777
- return w === -1 ? {
1778
- ...T,
1779
- prompts: [...N, { ...p, slot: i }]
1780
- } : (N[w] = p, {
1781
- ...T,
1782
- prompts: [...N]
1783
- });
1784
- });
1785
- }, k = async (i) => {
1786
- i.preventDefault();
1787
- try {
1788
- await Z({
1789
- accessToken: await a(),
1790
- type: q.SET_USER_PREFERENCES,
1791
- params: {
1792
- user: r == null ? void 0 : r.username,
1793
- tags: g.prompts
1794
- }
1795
- });
1796
- } catch {
1797
- }
1798
- }, h = () => {
1799
- l({ ...n }), o(!1);
1800
- };
1801
- return G(() => {
1802
- n != null && n.tags && c({ prompts: n.tags });
1803
- }, [n]), s || d ? null : /* @__PURE__ */ m(
1804
- Q,
1805
- {
1806
- open: e,
1807
- onOpenChange: h,
1808
- title: "Prompts",
1809
- footer: /* @__PURE__ */ m(
1810
- H,
1811
- {
1812
- columnGap: 2,
1813
- alignHorizontal: "flex-end",
1814
- className: "pb-8 sm:pb-0",
1815
- children: [
1816
- /* @__PURE__ */ t(_, { children: /* @__PURE__ */ t(
1817
- U,
1818
- {
1819
- mode: "dark",
1820
- variant: "secondary",
1821
- focusMode: "light",
1822
- onClick: h,
1823
- children: "Cancel"
1824
- }
1825
- ) }),
1826
- /* @__PURE__ */ t(_, { children: /* @__PURE__ */ t(
1827
- U,
1828
- {
1829
- mode: "dark",
1830
- variant: "danger",
1831
- focusMode: "light",
1832
- onClick: async (i) => {
1833
- o(!1), await k(i);
1834
- },
1835
- children: "Save"
1836
- }
1837
- ) })
1838
- ]
1839
- }
1840
- ),
1841
- children: [
1842
- /* @__PURE__ */ t("p", { children: bt }),
1843
- g.prompts && g.prompts.map((i) => /* @__PURE__ */ m(
1844
- B,
1845
- {
1846
- header: `Prompt ${i.slot + 1}`,
1847
- className: "prose-dark dark:prose-lighter mb-2",
1848
- children: [
1849
- /* @__PURE__ */ m(H, { className: "mt-8 mb-6", columnGap: 2, rowGap: 6, children: [
1850
- /* @__PURE__ */ t(_, { span: 12, children: /* @__PURE__ */ t(
1851
- ye,
1852
- {
1853
- label: "Label",
1854
- name: `prompt${i.slot}-label`,
1855
- value: i.label,
1856
- onChange: (y) => {
1857
- b({
1858
- slot: i.slot,
1859
- checked: i.enabled,
1860
- label: y.target.value,
1861
- content: i.content
1862
- });
1863
- }
1864
- }
1865
- ) }),
1866
- /* @__PURE__ */ t(_, { span: 12, children: /* @__PURE__ */ t(
1867
- ye,
1868
- {
1869
- label: "Content",
1870
- name: `prompt${i.slot}-content`,
1871
- value: i.content,
1872
- onChange: (y) => {
1873
- b({
1874
- slot: i.slot,
1875
- checked: i.enabled,
1876
- label: i.label,
1877
- content: y.target.value
1878
- });
1879
- }
1880
- }
1881
- ) })
1882
- ] }),
1883
- /* @__PURE__ */ t(
1884
- ae,
1885
- {
1886
- className: "mt-2",
1887
- noBorder: !0,
1888
- label: "Enabled",
1889
- name: i.slot.toString(),
1890
- onChange: (y) => {
1891
- b({
1892
- slot: i.slot,
1893
- checked: y,
1894
- label: i.label,
1895
- content: i.content
1896
- });
1897
- },
1898
- checked: i.enabled
1899
- }
1900
- )
1901
- ]
1902
- },
1903
- `prompt-slot-${i.slot}`
1904
- ))
1905
- ]
1906
- }
1907
- );
1908
- }, Fa = ({
1909
- open: e,
1910
- onOpenChange: o
1911
- }) => {
1912
- const { getAccessToken: a, user: r } = P(), {
1913
- data: n,
1914
- error: s,
1915
- isLoading: d,
1916
- mutate: l
1917
- } = Ie({
1918
- keys: [r == null ? void 0 : r.username],
1919
- getAccessToken: a
1920
- }), [g, c] = E(!1), [b, k] = E({
1921
- loadingLocation: !1
1922
- }), [h, i] = E(""), [y, v] = E(""), [f, T] = E(yt), [N, p] = re({
1923
- key: oe + Ve,
1924
- initialValue: !1
1925
- }), [w, S] = re({
1926
- key: oe + kt,
1927
- initialValue: !1
1928
- }), A = (x) => {
1929
- S(x);
1930
- }, L = async (x) => {
1931
- x.preventDefault();
1932
- try {
1933
- await Z({
1934
- accessToken: await a(),
1935
- type: q.SET_USER_PREFERENCES,
1936
- params: {
1937
- user: r == null ? void 0 : r.username,
1938
- instructions: h,
1939
- location: y,
1940
- engine: f
1941
- }
1942
- }), l(), k({
1943
- loadingLocation: !1
1944
- });
1945
- } catch {
1946
- }
1947
- }, pe = async () => {
1948
- k({
1949
- loadingLocation: !0
1950
- }), v("...");
1951
- try {
1952
- const x = Date.now(), O = await xt(), X = await Z({
1953
- accessToken: await a(),
1954
- type: q.GET_LOCATION,
1955
- params: {
1956
- latitude: O.latitude,
1957
- longitude: O.longitude
1958
- }
1959
- }), J = Date.now() - x;
1960
- if (J < 2e3 && await new Promise((j) => setTimeout(j, 2e3 - J)), X.status === 200) {
1961
- const { city: j, state: le, country: $, displayName: nt } = X.data, st = j && le && $ ? `${j}, ${le}, ${$}` : nt;
1962
- k({
1963
- loadingLocation: !1
1964
- }), v(st);
1965
- } else
1966
- k({
1967
- loadingLocation: !1
1968
- });
1969
- } catch {
1970
- }
1971
- }, ne = (x, O) => {
1972
- T(x ? O : O === F ? D : F);
1973
- }, fe = () => {
1974
- c(!g);
1975
- }, se = () => {
1976
- l({ ...n }), o(!1);
1977
- };
1978
- return G(() => {
1979
- n != null && n.instructions && i(n.instructions), n != null && n.location && v(n.location), n != null && n.engine && T(n.engine);
1980
- }, [n]), s || d ? null : /* @__PURE__ */ t(
1981
- Q,
1982
- {
1983
- open: e,
1984
- onOpenChange: se,
1985
- title: vt,
1986
- footer: /* @__PURE__ */ m(
1987
- H,
1988
- {
1989
- columnGap: 2,
1990
- alignHorizontal: "flex-end",
1991
- className: "pb-8 sm:pb-0",
1992
- children: [
1993
- /* @__PURE__ */ t(_, { children: /* @__PURE__ */ t(
1994
- U,
1995
- {
1996
- mode: "dark",
1997
- variant: "secondary",
1998
- focusMode: "light",
1999
- onClick: se,
2000
- children: "Cancel"
2001
- }
2002
- ) }),
2003
- /* @__PURE__ */ t(_, { children: /* @__PURE__ */ t(
2004
- U,
2005
- {
2006
- mode: "dark",
2007
- variant: "danger",
2008
- focusMode: "light",
2009
- onClick: async (x) => {
2010
- o(!1), await L(x);
2011
- },
2012
- children: "Save"
2013
- }
2014
- ) })
2015
- ]
2016
- }
2017
- ),
2018
- children: /* @__PURE__ */ m(z, { children: [
2019
- g && /* @__PURE__ */ t($a, { open: g, onOpenChange: c }),
2020
- /* @__PURE__ */ m(
2021
- B,
2022
- {
2023
- header: C.SETTINGS_ENGINE.TITLE,
2024
- className: "prose-dark dark:prose-lighter",
2025
- children: [
2026
- /* @__PURE__ */ t("p", { className: "text-sm", children: "Select the AI engine that will be used to generate responses." }),
2027
- /* @__PURE__ */ t(
2028
- ae,
2029
- {
2030
- noBorder: !0,
2031
- label: F,
2032
- name: F,
2033
- onChange: (x) => ne(x, F),
2034
- checked: f === F
2035
- }
2036
- ),
2037
- /* @__PURE__ */ t(
2038
- ae,
2039
- {
2040
- className: "mt-2",
2041
- noBorder: !0,
2042
- label: D,
2043
- name: D,
2044
- onChange: (x) => ne(x, D),
2045
- checked: f === D
2046
- }
2047
- ),
2048
- /* @__PURE__ */ t("p", { className: "text-sm", children: "This option introduces a new menu at the top of the screen, enabling you to quickly switch between engines." }),
2049
- /* @__PURE__ */ t(
2050
- ae,
2051
- {
2052
- className: "mt-2",
2053
- noBorder: !0,
2054
- label: "Show Quick Engine Toggle Menu",
2055
- name: "show-toggle-engine-menu",
2056
- onChange: p,
2057
- checked: N
2058
- }
2059
- ),
2060
- /* @__PURE__ */ t("p", { className: "text-sm", children: "This option adds individual statistics for each messages under their respective bubbles, such as processing time, model name, and more." }),
2061
- /* @__PURE__ */ t(
2062
- ae,
2063
- {
2064
- className: "mt-2",
2065
- noBorder: !0,
2066
- label: "Show Message Statistics",
2067
- name: "show-message-statistics",
2068
- onChange: A,
2069
- checked: w
2070
- }
2071
- ),
2072
- /* @__PURE__ */ t("h3", { className: "border-b-2 border-slate-400", children: "Prompts" }),
2073
- /* @__PURE__ */ t(
2074
- W,
2075
- {
2076
- className: "mt-2",
2077
- size: "small",
2078
- onClick: fe,
2079
- labelLeft: "Edit Custom Prompts",
2080
- children: /* @__PURE__ */ t(Yt, { size: "size-3", monotone: !0 })
2081
- }
2082
- )
2083
- ]
2084
- }
2085
- ),
2086
- /* @__PURE__ */ m(
2087
- B,
2088
- {
2089
- header: "Custom Instructions",
2090
- className: "prose-dark dark:prose-lighter mt-4",
2091
- children: [
2092
- /* @__PURE__ */ m("p", { className: "text-sm", children: [
2093
- "What would you like ",
2094
- /* @__PURE__ */ t("em", { children: Nt }),
2095
- " to know about you to provide better responses?"
2096
- ] }),
2097
- /* @__PURE__ */ t(
2098
- Be,
2099
- {
2100
- mode: "alt-system",
2101
- autoCapitalize: "off",
2102
- autoComplete: "off",
2103
- autoCorrect: "off",
2104
- name: "customInstructions",
2105
- label: "Custom Instructions",
2106
- value: h,
2107
- onChange: (x) => {
2108
- i(x.target.value);
2109
- },
2110
- helperText: "Press ENTER to add a new line."
2111
- }
2112
- )
2113
- ]
2114
- }
2115
- ),
2116
- /* @__PURE__ */ m(
2117
- B,
2118
- {
2119
- header: "Location",
2120
- className: "prose-dark dark:prose-lighter mt-4",
2121
- children: [
2122
- /* @__PURE__ */ t("p", { className: "text-sm", children: "You can share your location to receive customized responses based on your area." }),
2123
- /* @__PURE__ */ t(
2124
- Be,
2125
- {
2126
- mode: "alt-system",
2127
- name: "location",
2128
- label: "Location",
2129
- value: y,
2130
- onChange: (x) => {
2131
- v(x.target.value);
2132
- },
2133
- helperText: "Enter your location or press auto-detect."
2134
- }
2135
- ),
2136
- /* @__PURE__ */ t(
2137
- U,
2138
- {
2139
- className: "mt-2",
2140
- size: "small",
2141
- noBorder: !0,
2142
- disabled: b.loadingLocation,
2143
- onClick: pe,
2144
- children: b.loadingLocation ? "Detecting..." : "Auto-detect"
2145
- }
2146
- )
2147
- ]
2148
- }
2149
- )
2150
- ] })
2151
- }
2152
- );
2153
- }, Da = () => {
2154
- const { state: e, dispatch: o } = K(Ee), { getAccessToken: a, user: r } = P(), [n] = re({
2155
- key: oe + Ve,
2156
- initialValue: !1
2157
- }), {
2158
- data: s,
2159
- error: d,
2160
- isLoading: l,
2161
- mutate: g
2162
- } = Ie({
2163
- keys: [r == null ? void 0 : r.username],
2164
- getAccessToken: a
2165
- }), c = async (b) => {
2166
- try {
2167
- await Z({
2168
- accessToken: await a(),
2169
- type: q.SET_USER_PREFERENCES,
2170
- params: {
2171
- user: r == null ? void 0 : r.username,
2172
- engine: b
2173
- }
2174
- }), g({ ...s }), e && (e == null ? void 0 : e.messages.length) > 0 && o({
2175
- type: De
2176
- });
2177
- } catch {
2178
- }
2179
- };
2180
- return d || l ? null : n && s && /* @__PURE__ */ t(_, { children: /* @__PURE__ */ m(
2181
- Te,
2182
- {
2183
- mode: "dark",
2184
- focusMode: "light",
2185
- trigger: /* @__PURE__ */ t(W, { className: "mr-2", children: s && s.engine === D ? /* @__PURE__ */ t(ke, {}) : /* @__PURE__ */ t(ve, {}) }),
2186
- defaultPlacement: "bottom-start",
2187
- children: [
2188
- /* @__PURE__ */ t(ta, { children: "Engines" }),
2189
- /* @__PURE__ */ t(
2190
- V,
2191
- {
2192
- selected: s && s.engine === F,
2193
- label: "OpenAI",
2194
- icon: /* @__PURE__ */ t(ve, {}),
2195
- onClick: () => c(F)
2196
- }
2197
- ),
2198
- /* @__PURE__ */ t(
2199
- V,
2200
- {
2201
- selected: s && s.engine === D,
2202
- label: "Anthropic",
2203
- icon: /* @__PURE__ */ t(ke, {}),
2204
- onClick: () => c(D)
2205
- }
2206
- )
2207
- ]
2208
- }
2209
- ) });
2210
- }, Ya = () => {
2211
- const { logout: e } = P(), { state: o } = K(Ee), [a, r] = E(!1), [n, s] = E(!1), [d, l] = E(!1), [g, c] = E(!1), [b, k] = E(!1), h = () => {
2212
- r(!a);
2213
- }, i = () => {
2214
- s(!n);
2215
- }, y = () => {
2216
- l(!d);
2217
- }, v = () => {
2218
- c(!g);
2219
- }, f = () => {
2220
- k(!b);
2221
- };
2222
- return /* @__PURE__ */ m(z, { children: [
2223
- /* @__PURE__ */ t(
2224
- rt,
2225
- {
2226
- showConfirmation: b,
2227
- setShowConfirmation: k,
2228
- action: e,
2229
- customStrings: {
2230
- confirmAction: Ae,
2231
- cancelAction: "Cancel",
2232
- title: Ae
2233
- },
2234
- children: /* @__PURE__ */ t("p", { children: "Are you sure you want to log out?" })
2235
- }
2236
- ),
2237
- /* @__PURE__ */ t(Sa, { open: a, onOpenChange: r }),
2238
- /* @__PURE__ */ t(Fa, { open: n, onOpenChange: s }),
2239
- d && /* @__PURE__ */ t(Ia, { open: d, onOpenChange: l }),
2240
- /* @__PURE__ */ t(wa, { open: g, onOpenChange: c }),
2241
- /* @__PURE__ */ t("div", { className: "bg-slate-900 py-4 px-4 rounded-t-md", children: /* @__PURE__ */ m(H, { alignHorizontal: "space-between", alignVertical: "center", children: [
2242
- /* @__PURE__ */ t(_, { children: /* @__PURE__ */ t(Gt, { mode: "dark", radius: "large" }) }),
2243
- /* @__PURE__ */ t(_, { children: /* @__PURE__ */ m(H, { children: [
2244
- /* @__PURE__ */ t(Da, {}),
2245
- /* @__PURE__ */ t(_, { children: /* @__PURE__ */ m(
2246
- Te,
2247
- {
2248
- mode: "dark",
2249
- focusMode: "light",
2250
- trigger: /* @__PURE__ */ t(W, { children: /* @__PURE__ */ t(Xt, {}) }),
2251
- defaultPlacement: "bottom-end",
2252
- children: [
2253
- /* @__PURE__ */ t(
2254
- V,
2255
- {
2256
- label: "Profile",
2257
- onClick: h,
2258
- icon: /* @__PURE__ */ t(qt, {})
2259
- }
2260
- ),
2261
- /* @__PURE__ */ t(
2262
- V,
2263
- {
2264
- label: "Settings",
2265
- onClick: i,
2266
- icon: /* @__PURE__ */ t(Jt, {})
2267
- }
2268
- ),
2269
- /* @__PURE__ */ t(
2270
- V,
2271
- {
2272
- label: "History",
2273
- onClick: y,
2274
- icon: /* @__PURE__ */ t(Kt, {})
2275
- }
2276
- ),
2277
- /* @__PURE__ */ t(
2278
- V,
2279
- {
2280
- label: "About",
2281
- onClick: v,
2282
- icon: /* @__PURE__ */ t(Zt, {})
2283
- }
2284
- ),
2285
- o && o.id && !o.isComponent && /* @__PURE__ */ m(z, { children: [
2286
- /* @__PURE__ */ t(ea, {}),
2287
- /* @__PURE__ */ t(
2288
- V,
2289
- {
2290
- label: "Log out",
2291
- onClick: f,
2292
- icon: /* @__PURE__ */ t("div", { className: "text-red-700", children: /* @__PURE__ */ t(jt, { monotone: !0 }) })
2293
- }
2294
- )
2295
- ] })
2296
- ]
2297
- }
2298
- ) })
2299
- ] }) })
2300
- ] }) })
2301
- ] });
2302
- };
2303
- export {
2304
- Ya as default
2305
- };