@versini/sassysaint 8.45.4 → 8.45.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{AboutChangelog.Dm7CeWzJ.js → AboutChangelog.LWPPo7H9.js} +2 -2
- package/dist/chunks/{AboutEntry.z1IGd8nH.js → AboutEntry.BFBDyy6h.js} +6 -6
- package/dist/chunks/App.Cwzj_7TG.js +10560 -0
- package/dist/chunks/{Chart.fnP0GZlV.js → Chart.BxV8to7Z.js} +2 -2
- package/dist/chunks/{ChatBubbleAssistant.C214h3Za.js → ChatBubbleAssistant.Bp18OzE9.js} +12 -12
- package/dist/chunks/ChatHistoryTable.BVjiHyBX.js +649 -0
- package/dist/chunks/{HistoryEntry.Bg8wGgO6.js → HistoryEntry.C16tGap4.js} +27 -27
- package/dist/chunks/{LNWAZHJI.CgXWR3aC.js → LNWAZHJI.CED6wpxJ.js} +1 -1
- package/dist/chunks/{ProfileEntry.llkfgZbz.js → ProfileEntry.DsI-YgqO.js} +5 -5
- package/dist/chunks/SettingsEntry.CIijARba.js +889 -0
- package/dist/chunks/{UsageEntry.Dt5P9AhJ.js → UsageEntry.DrEbNjpo.js} +7 -7
- package/dist/chunks/{index.aLXAYIRa.js → index.BFk_wbyz.js} +1 -1
- package/dist/chunks/{index.0hUxtRYc.js → index.BHaXd0Ws.js} +1 -1
- package/dist/chunks/{index.Brh2cWqI.js → index.C_uGQmmV.js} +1 -1
- package/dist/chunks/{index.DXnBFV0d.js → index.CvSvQRF0.js} +2 -2
- package/dist/chunks/{index.xegEqIYd.js → index.Ddqbg8Ks.js} +1506 -1455
- package/dist/chunks/{index.Cdz3tBE5.js → index.Des5u3uL.js} +3 -3
- package/dist/chunks/index.LWF-Ggi7.js +249 -0
- package/dist/chunks/{useMarkdown.CWlc3oNt.js → useMarkdown.CR3mLjmN.js} +502 -502
- package/dist/components/SassySaint/SassySaint.js +1 -1
- package/dist/index.js +4 -4
- package/package.json +5 -5
- package/dist/chunks/App.Dxe8LDdD.js +0 -12621
- package/dist/chunks/ChatHistoryTable.CHWU2-BC.js +0 -1205
- package/dist/chunks/SettingsEntry.mv_g2-2P.js +0 -1064
- package/dist/chunks/index.CyMvgyLB.js +0 -804
@@ -0,0 +1,889 @@
|
|
1
|
+
import { jsxs as g, jsx as a } from "react/jsx-runtime";
|
2
|
+
import { o as pe, h as ie, i as ge, x as ye, n as be, getCacheInfo as xe, isServiceWorkerEnabled as ke, SETTINGS_TITLE as we, S as H, CARDS as O, Oe as Ne, C as se, PROMPTS_DESCRIPTION as Ee, L as Te, j as de, getCurrentGeoLocation as ve, handleServiceWorkerToggle as Se } from "./index.Ddqbg8Ks.js";
|
3
|
+
import { useUserPreferences as Ce, se as Ie, mutateCall as ue, SERVICE_TYPES as me } from "./App.Cwzj_7TG.js";
|
4
|
+
import _e, { useState as f, useEffect as ne, useRef as U, useLayoutEffect as q, useCallback as Le } from "react";
|
5
|
+
import c from "clsx";
|
6
|
+
function Me({
|
7
|
+
value: e,
|
8
|
+
defaultValue: s,
|
9
|
+
finalValue: o,
|
10
|
+
onChange: l = () => {
|
11
|
+
},
|
12
|
+
initialControlledDelay: r = 0
|
13
|
+
}) {
|
14
|
+
const [n, u] = f(!1), [h, x] = f(
|
15
|
+
s !== void 0 ? s : o
|
16
|
+
), k = (m) => {
|
17
|
+
x(m), l?.(m);
|
18
|
+
};
|
19
|
+
return ne(() => {
|
20
|
+
(async () => e !== void 0 && !n && r > 0 && (await new Promise(
|
21
|
+
(m) => setTimeout(m, r)
|
22
|
+
), u(!0)))();
|
23
|
+
}, [e, r, n]), e !== void 0 ? !n && r > 0 ? ["", l, !0] : [e, l, !0] : [h, k, !1];
|
24
|
+
}
|
25
|
+
const fe = "av-text-area", Pe = "av-text-area-wrapper", le = "av-text-area-helper-text", Ae = "av-text-area__control--right", Oe = "av-text-area__control--left", Be = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hidden px-4 py-7", De = ({ mode: e }) => c({
|
26
|
+
"bg-surface-darker text-copy-lighter caret-copy-light": e === "dark",
|
27
|
+
"bg-surface-lighter text-copy-dark caret-copy-dark": e === "light",
|
28
|
+
"bg-surface-lighter text-copy-dark caret-copy-dark dark:bg-surface-darker dark:text-copy-lighter dark:caret-copy-light": e === "system",
|
29
|
+
"bg-surface-darker text-copy-lighter caret-copy-light dark:bg-surface-lighter dark:text-copy-dark dark:caret-copy-dark": e === "alt-system"
|
30
|
+
}), Re = ({
|
31
|
+
focusMode: e
|
32
|
+
}) => c("focus:outline focus:outline-2 focus:outline-offset-2", {
|
33
|
+
"focus:outline-focus-dark": e === "dark",
|
34
|
+
"focus:outline-focus-light": e === "light",
|
35
|
+
"focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
|
36
|
+
"focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
|
37
|
+
}), Ge = ({
|
38
|
+
noBorder: e,
|
39
|
+
error: s
|
40
|
+
}) => c("border-2", {
|
41
|
+
"border-border-dark": !e && !s,
|
42
|
+
"focus:border-border-dark": !e && s,
|
43
|
+
"border-border-error-dark": !e && s,
|
44
|
+
"border-transparent": e
|
45
|
+
}), He = ({
|
46
|
+
disabled: e,
|
47
|
+
raw: s,
|
48
|
+
error: o,
|
49
|
+
mode: l,
|
50
|
+
leftElement: r,
|
51
|
+
rightElement: n
|
52
|
+
}) => {
|
53
|
+
if (s)
|
54
|
+
return "";
|
55
|
+
if (e)
|
56
|
+
return c(
|
57
|
+
"transform translate-y-0 scale-100 absolute px-2 cursor-not-allowed opacity-50 font-medium",
|
58
|
+
{
|
59
|
+
"translate-x-[12px]": n === !0 && !r || !n && !r
|
60
|
+
}
|
61
|
+
);
|
62
|
+
if (!o)
|
63
|
+
return c(
|
64
|
+
"absolute px-2 cursor-text font-medium transform translate-y-0 scale-100",
|
65
|
+
{
|
66
|
+
"translate-x-[12px]": n === !0 && !r || !n && !r,
|
67
|
+
"text-copy-medium": l === "dark",
|
68
|
+
"text-copy-dark": l === "light",
|
69
|
+
"text-copy-dark dark:text-copy-medium": l === "system",
|
70
|
+
"text-copy-medium dark:text-copy-dark": l === "alt-system"
|
71
|
+
}
|
72
|
+
);
|
73
|
+
if (o)
|
74
|
+
return c(
|
75
|
+
"absolute px-2 cursor-text font-medium transform translate-y-0 scale-100",
|
76
|
+
{
|
77
|
+
"translate-x-[12px]": n === !0 && !r || !n && !r,
|
78
|
+
"text-copy-medium": l === "dark",
|
79
|
+
"text-copy-error-dark": l === "light",
|
80
|
+
"text-copy-error-dark dark:text-copy-error-light": l === "system",
|
81
|
+
"text-copy-medium dark:text-copy-error-dark": l === "alt-system"
|
82
|
+
}
|
83
|
+
);
|
84
|
+
}, Ue = ({
|
85
|
+
error: e,
|
86
|
+
raw: s,
|
87
|
+
mode: o,
|
88
|
+
disabled: l
|
89
|
+
}) => {
|
90
|
+
if (s)
|
91
|
+
return "";
|
92
|
+
if (l)
|
93
|
+
return c(
|
94
|
+
le,
|
95
|
+
"absolute px-2 cursor-not-allowed opacity-50 font-medium"
|
96
|
+
);
|
97
|
+
if (!e)
|
98
|
+
return c(le, "absolute px-2 font-medium", {
|
99
|
+
"text-copy-medium": o === "dark",
|
100
|
+
"text-copy-dark": o === "light",
|
101
|
+
"text-copy-dark dark:text-copy-medium": o === "system",
|
102
|
+
"text-copy-medium dark:text-copy-dark": o === "alt-system"
|
103
|
+
});
|
104
|
+
if (e)
|
105
|
+
return c(le, "absolute px-2 font-medium", {
|
106
|
+
"text-copy-error-light": o === "dark",
|
107
|
+
"text-copy-error-dark": o === "light",
|
108
|
+
"text-copy-error-dark dark:text-copy-error-light": o === "system",
|
109
|
+
"dark:text-copy-error-dark text-copy-error-light": o === "alt-system"
|
110
|
+
});
|
111
|
+
}, Ve = ({
|
112
|
+
className: e,
|
113
|
+
textAreaClassName: s,
|
114
|
+
raw: o,
|
115
|
+
focusMode: l,
|
116
|
+
disabled: r,
|
117
|
+
noBorder: n,
|
118
|
+
error: u,
|
119
|
+
mode: h,
|
120
|
+
leftElement: x,
|
121
|
+
rightElement: k
|
122
|
+
}) => {
|
123
|
+
const m = o ? e : c(
|
124
|
+
"relative flex w-full flex-col justify-center",
|
125
|
+
Pe,
|
126
|
+
e
|
127
|
+
), T = o ? c(s) : c(
|
128
|
+
fe,
|
129
|
+
s,
|
130
|
+
Be(),
|
131
|
+
De({ mode: h }),
|
132
|
+
Re({ focusMode: l }),
|
133
|
+
Ge({
|
134
|
+
noBorder: n,
|
135
|
+
error: u
|
136
|
+
}),
|
137
|
+
{
|
138
|
+
"disabled:cursor-not-allowed disabled:opacity-50": r
|
139
|
+
}
|
140
|
+
), C = o ? void 0 : "sr-only", D = He({
|
141
|
+
disabled: r,
|
142
|
+
raw: o,
|
143
|
+
error: u,
|
144
|
+
mode: h,
|
145
|
+
rightElement: k,
|
146
|
+
leftElement: x
|
147
|
+
}), y = Ue({
|
148
|
+
error: u,
|
149
|
+
raw: o,
|
150
|
+
mode: h,
|
151
|
+
disabled: r
|
152
|
+
}), I = o ? void 0 : c(Ae, "absolute"), w = o ? void 0 : c(Oe, "absolute");
|
153
|
+
return {
|
154
|
+
wrapper: m,
|
155
|
+
textArea: T,
|
156
|
+
accessibleLabel: C,
|
157
|
+
visibleLabel: D,
|
158
|
+
helperText: y,
|
159
|
+
rightElement: I,
|
160
|
+
leftElement: w
|
161
|
+
};
|
162
|
+
}, $e = ({
|
163
|
+
scrollHeight: e,
|
164
|
+
currentHeight: s,
|
165
|
+
currentLabelOffset: o = 0,
|
166
|
+
currentHelperTextOffset: l = 0
|
167
|
+
}) => {
|
168
|
+
let r, n;
|
169
|
+
if (e > 0 && e !== s) {
|
170
|
+
const u = e - s, h = Math.abs(u / 24);
|
171
|
+
r = o + -1 * Math.sign(u) * (12 * h), n = l + Math.sign(u) * (12 * h);
|
172
|
+
}
|
173
|
+
return {
|
174
|
+
labelOffset: r,
|
175
|
+
helperTextOffset: n,
|
176
|
+
scrollHeight: e
|
177
|
+
};
|
178
|
+
}, ce = _e.forwardRef(
|
179
|
+
({
|
180
|
+
id: e,
|
181
|
+
name: s,
|
182
|
+
label: o,
|
183
|
+
error: l = !1,
|
184
|
+
raw: r = !1,
|
185
|
+
className: n,
|
186
|
+
textAreaClassName: u,
|
187
|
+
mode: h = "system",
|
188
|
+
focusMode: x = "system",
|
189
|
+
value: k,
|
190
|
+
defaultValue: m,
|
191
|
+
disabled: T = !1,
|
192
|
+
noBorder: C = !1,
|
193
|
+
labelId: D,
|
194
|
+
helperText: y = "",
|
195
|
+
helperTextOnFocus: I = !1,
|
196
|
+
rightElement: w,
|
197
|
+
leftElement: v,
|
198
|
+
onChange: V,
|
199
|
+
onFocus: L,
|
200
|
+
onBlur: $,
|
201
|
+
...R
|
202
|
+
}, J) => {
|
203
|
+
const p = U(null), K = pe([J, p]), [Q, M] = ie(), [Z, S] = ie(), W = U(80), ee = U(-25), G = U(null), re = U(30), te = U(null), P = ge({ id: e, prefix: `${fe}-` }), [z, j] = f(0), [F, t] = f(0), [d, _] = f(
|
204
|
+
!!(!I && y)
|
205
|
+
), Y = `${s} error, ${y}`, b = Ve({
|
206
|
+
className: n,
|
207
|
+
textAreaClassName: u,
|
208
|
+
error: l,
|
209
|
+
raw: r,
|
210
|
+
focusMode: x,
|
211
|
+
disabled: T,
|
212
|
+
noBorder: C,
|
213
|
+
mode: h,
|
214
|
+
rightElement: !!w,
|
215
|
+
leftElement: !!v
|
216
|
+
}), [i, N] = Me({
|
217
|
+
value: k,
|
218
|
+
initialControlledDelay: 20,
|
219
|
+
defaultValue: m,
|
220
|
+
onChange: (E) => {
|
221
|
+
V && V({
|
222
|
+
target: {
|
223
|
+
value: E
|
224
|
+
}
|
225
|
+
});
|
226
|
+
}
|
227
|
+
}), A = (E) => {
|
228
|
+
N(E.target.value);
|
229
|
+
}, X = (E) => {
|
230
|
+
I && y && _(!0), L && L(E);
|
231
|
+
}, ae = (E) => {
|
232
|
+
I && y && !i && _(!1), $ && $(E);
|
233
|
+
};
|
234
|
+
return q(() => {
|
235
|
+
M && M.width && j(M.width + 18 + 10);
|
236
|
+
}, [M]), q(() => {
|
237
|
+
S && S.width && t(S.width + 18 + 10);
|
238
|
+
}, [S]), q(() => {
|
239
|
+
r || p && p.current && i !== void 0 && (p.current.style.height = "inherit", p.current.style.height = p.current.scrollHeight + "px");
|
240
|
+
}, [i, r]), q(() => {
|
241
|
+
r || setTimeout(() => {
|
242
|
+
G?.current?.style.setProperty(
|
243
|
+
"--av-text-area-wrapper-transition",
|
244
|
+
i ? "none" : "all 0.2s ease-out"
|
245
|
+
);
|
246
|
+
}, 0);
|
247
|
+
}, [i, r]), q(() => {
|
248
|
+
if (!r && p && p.current && i !== void 0) {
|
249
|
+
const { labelOffset: E, helperTextOffset: oe, scrollHeight: he } = $e({
|
250
|
+
scrollHeight: p.current.scrollHeight,
|
251
|
+
currentHeight: W.current,
|
252
|
+
currentLabelOffset: ee.current,
|
253
|
+
currentHelperTextOffset: re.current
|
254
|
+
});
|
255
|
+
E && (ee.current = E, G?.current?.style.setProperty(
|
256
|
+
"--av-text-area-label",
|
257
|
+
`${E}px`
|
258
|
+
)), oe && (re.current = oe, te?.current?.style.setProperty(
|
259
|
+
"--av-text-area-helper-text",
|
260
|
+
`${oe}px`
|
261
|
+
)), W.current = he || W.current;
|
262
|
+
}
|
263
|
+
}, [i, r]), S.width > 0 && G?.current?.style.setProperty(
|
264
|
+
"--tw-translate-x",
|
265
|
+
`${12 + S.width + 5}px`
|
266
|
+
), /* @__PURE__ */ g("div", { className: b.wrapper, children: [
|
267
|
+
/* @__PURE__ */ a(
|
268
|
+
"label",
|
269
|
+
{
|
270
|
+
htmlFor: P,
|
271
|
+
id: D,
|
272
|
+
className: b.accessibleLabel,
|
273
|
+
children: o
|
274
|
+
}
|
275
|
+
),
|
276
|
+
v && /* @__PURE__ */ a(
|
277
|
+
"div",
|
278
|
+
{
|
279
|
+
ref: Z,
|
280
|
+
className: b.leftElement,
|
281
|
+
children: v
|
282
|
+
}
|
283
|
+
),
|
284
|
+
/* @__PURE__ */ a(
|
285
|
+
"textarea",
|
286
|
+
{
|
287
|
+
ref: K,
|
288
|
+
id: P,
|
289
|
+
name: s,
|
290
|
+
disabled: T,
|
291
|
+
placeholder: r ? void 0 : " ",
|
292
|
+
className: b.textArea,
|
293
|
+
rows: 1,
|
294
|
+
...y && { "aria-describedby": `${P}-helper` },
|
295
|
+
...l && { "aria-invalid": "true" },
|
296
|
+
...w && !v && !r && { style: { paddingRight: z } },
|
297
|
+
...v && !w && !r && { style: { paddingLeft: F } },
|
298
|
+
...w && v && !r && {
|
299
|
+
style: {
|
300
|
+
paddingRight: z,
|
301
|
+
paddingLeft: F
|
302
|
+
}
|
303
|
+
},
|
304
|
+
value: i,
|
305
|
+
onChange: A,
|
306
|
+
onFocus: X,
|
307
|
+
onBlur: ae,
|
308
|
+
...R
|
309
|
+
}
|
310
|
+
),
|
311
|
+
!r && /* @__PURE__ */ a(
|
312
|
+
"label",
|
313
|
+
{
|
314
|
+
ref: G,
|
315
|
+
"aria-hidden": !0,
|
316
|
+
htmlFor: P,
|
317
|
+
className: `${b.visibleLabel}`,
|
318
|
+
children: o
|
319
|
+
}
|
320
|
+
),
|
321
|
+
d && /* @__PURE__ */ a(
|
322
|
+
"div",
|
323
|
+
{
|
324
|
+
ref: te,
|
325
|
+
id: `${P}-helper`,
|
326
|
+
className: b.helperText,
|
327
|
+
children: y
|
328
|
+
}
|
329
|
+
),
|
330
|
+
w && /* @__PURE__ */ a(
|
331
|
+
"div",
|
332
|
+
{
|
333
|
+
ref: Q,
|
334
|
+
className: b.rightElement,
|
335
|
+
children: w
|
336
|
+
}
|
337
|
+
),
|
338
|
+
l && y && /* @__PURE__ */ a(ye, { politeness: "polite", clearAnnouncementDelay: 500, children: Y })
|
339
|
+
] });
|
340
|
+
}
|
341
|
+
);
|
342
|
+
ce.displayName = "TextArea";
|
343
|
+
/*!
|
344
|
+
@versini/ui-textarea v5.0.1
|
345
|
+
© 2025 gizmette.com
|
346
|
+
*/
|
347
|
+
try {
|
348
|
+
window.__VERSINI_UI_TEXTAREA__ || (window.__VERSINI_UI_TEXTAREA__ = {
|
349
|
+
version: "5.0.1",
|
350
|
+
buildTime: "09/01/2025 04:01 PM EDT",
|
351
|
+
homepage: "https://github.com/aversini/ui-components",
|
352
|
+
license: "MIT"
|
353
|
+
});
|
354
|
+
} catch {
|
355
|
+
}
|
356
|
+
const We = "av-toggle", ze = ({ narrow: e }) => c(
|
357
|
+
"peer",
|
358
|
+
"rounded-full",
|
359
|
+
{
|
360
|
+
"h-6 w-11": !e,
|
361
|
+
"h-5 w-12": e
|
362
|
+
},
|
363
|
+
// Smooth background/border transition when toggling
|
364
|
+
"transition-colors duration-300 ease-in-out motion-reduce:transition-none"
|
365
|
+
), je = ({
|
366
|
+
focusMode: e
|
367
|
+
}) => c(
|
368
|
+
"peer-focus:outline",
|
369
|
+
"peer-focus:outline-2",
|
370
|
+
"peer-focus:outline-offset-2",
|
371
|
+
{
|
372
|
+
"peer-focus:outline-focus-dark": e === "dark",
|
373
|
+
"peer-focus:outline-focus-light": e === "light",
|
374
|
+
"peer-focus:outline-focus-light dark:peer-focus:outline-focus-dark": e === "alt-system",
|
375
|
+
"peer-focus:outline-focus-dark dark:peer-focus:outline-focus-light": e === "system"
|
376
|
+
}
|
377
|
+
), Fe = ({ narrow: e }) => c(
|
378
|
+
{
|
379
|
+
"peer-checked:after:translate-x-full": !e,
|
380
|
+
"peer-checked:after:translate-x-4": e
|
381
|
+
},
|
382
|
+
// background color when checked
|
383
|
+
"peer-checked:bg-action-light",
|
384
|
+
// knob circle and border color when checked
|
385
|
+
"peer-checked:after:bg-white",
|
386
|
+
"peer-checked:after:border-white"
|
387
|
+
), Ye = ({ narrow: e }) => c(
|
388
|
+
"after:left-[2px]",
|
389
|
+
"after:top-[2px]",
|
390
|
+
"after:border",
|
391
|
+
"after:border-surface-light dark:after:border-surface-medium",
|
392
|
+
"after:bg-surface-light dark:after:bg-surface-medium",
|
393
|
+
"after:absolute",
|
394
|
+
"after:transition-all after:duration-300 after:ease-in-out after:motion-reduce:transition-none after:will-change-transform",
|
395
|
+
"after:content-['']",
|
396
|
+
"after:rounded-full",
|
397
|
+
{
|
398
|
+
// Normal toggle knob (circle)
|
399
|
+
"after:h-5 after:w-5": !e,
|
400
|
+
// Narrow toggle knob (oval)
|
401
|
+
" after:h-4 after:w-7": e
|
402
|
+
}
|
403
|
+
), Xe = ({
|
404
|
+
mode: e,
|
405
|
+
noBorder: s
|
406
|
+
}) => c({
|
407
|
+
border: !s,
|
408
|
+
"border-border-medium bg-surface-medium": e === "light",
|
409
|
+
"border-border-light bg-surface-darker": e === "dark",
|
410
|
+
"border-border-light bg-surface-darker dark:border-border-dark dark:bg-surface-medium": e === "alt-system",
|
411
|
+
"border-border-medium bg-surface-medium dark:border-border-light dark:bg-surface-darker": e === "system"
|
412
|
+
}), qe = ({
|
413
|
+
mode: e,
|
414
|
+
labelHidden: s
|
415
|
+
}) => s ? "sr-only" : c("ml-2 text-sm", {
|
416
|
+
"text-copy-dark": e === "light",
|
417
|
+
"text-copy-lighter": e === "dark",
|
418
|
+
"text-copy-lighter dark:text-copy-dark": e === "alt-system",
|
419
|
+
"text-copy-dark dark:text-copy-lighter": e === "system"
|
420
|
+
}), Je = ({ className: e }) => c(
|
421
|
+
We,
|
422
|
+
"relative flex cursor-pointer items-center",
|
423
|
+
e
|
424
|
+
), Ke = ({
|
425
|
+
mode: e,
|
426
|
+
focusMode: s,
|
427
|
+
labelHidden: o,
|
428
|
+
className: l,
|
429
|
+
noBorder: r,
|
430
|
+
narrow: n
|
431
|
+
}) => ({
|
432
|
+
toggle: c(
|
433
|
+
ze({ narrow: n }),
|
434
|
+
Xe({ mode: e, noBorder: r }),
|
435
|
+
je({ focusMode: s }),
|
436
|
+
Ye({ narrow: n }),
|
437
|
+
Fe({ narrow: n })
|
438
|
+
),
|
439
|
+
label: qe({ mode: e, labelHidden: o }),
|
440
|
+
input: "peer sr-only",
|
441
|
+
wrapper: Je({ className: l })
|
442
|
+
}), B = ({
|
443
|
+
checked: e = !1,
|
444
|
+
onChange: s,
|
445
|
+
label: o,
|
446
|
+
labelHidden: l = !1,
|
447
|
+
name: r,
|
448
|
+
mode: n = "system",
|
449
|
+
focusMode: u = "system",
|
450
|
+
className: h,
|
451
|
+
noBorder: x = !1,
|
452
|
+
narrow: k = !1
|
453
|
+
}) => {
|
454
|
+
const m = Ke({
|
455
|
+
mode: n,
|
456
|
+
focusMode: u,
|
457
|
+
labelHidden: l,
|
458
|
+
className: h,
|
459
|
+
noBorder: x,
|
460
|
+
narrow: k
|
461
|
+
}), T = (C) => {
|
462
|
+
s?.(C.target.checked);
|
463
|
+
};
|
464
|
+
return /* @__PURE__ */ g("label", { className: m.wrapper, children: [
|
465
|
+
/* @__PURE__ */ a(
|
466
|
+
"input",
|
467
|
+
{
|
468
|
+
name: r,
|
469
|
+
checked: e,
|
470
|
+
type: "checkbox",
|
471
|
+
className: m.input,
|
472
|
+
onChange: T
|
473
|
+
}
|
474
|
+
),
|
475
|
+
/* @__PURE__ */ a("div", { className: m.toggle }),
|
476
|
+
/* @__PURE__ */ a("span", { className: m.label, children: o })
|
477
|
+
] });
|
478
|
+
};
|
479
|
+
/*!
|
480
|
+
@versini/ui-toggle v5.0.1
|
481
|
+
© 2025 gizmette.com
|
482
|
+
*/
|
483
|
+
try {
|
484
|
+
window.__VERSINI_UI_TOGGLE__ || (window.__VERSINI_UI_TOGGLE__ = {
|
485
|
+
version: "5.0.1",
|
486
|
+
buildTime: "09/01/2025 04:01 PM EDT",
|
487
|
+
homepage: "https://github.com/aversini/ui-components",
|
488
|
+
license: "MIT"
|
489
|
+
});
|
490
|
+
} catch {
|
491
|
+
}
|
492
|
+
const ar = ({
|
493
|
+
open: e,
|
494
|
+
onOpenChange: s
|
495
|
+
}) => {
|
496
|
+
const { getAccessToken: o, user: l } = be(), {
|
497
|
+
data: r,
|
498
|
+
isSuccess: n,
|
499
|
+
refetch: u
|
500
|
+
} = Ce({
|
501
|
+
user: l?.username,
|
502
|
+
getAccessToken: o
|
503
|
+
}), [h, x] = f({
|
504
|
+
loadingLocation: !1
|
505
|
+
}), [k, m] = f({
|
506
|
+
prompts: []
|
507
|
+
}), [T, C] = f(""), [D, y] = f(""), [I, w] = f(!1), [v, V] = f(!1), [L, $] = f(!1), [R, J] = f(!1), [p, K] = f(null), [Q, M] = f(!1), [Z, S] = f(!1), W = (t) => {
|
508
|
+
S(t);
|
509
|
+
}, ee = (t) => {
|
510
|
+
w(t);
|
511
|
+
}, G = (t) => {
|
512
|
+
V(t);
|
513
|
+
}, re = (t) => {
|
514
|
+
J(t);
|
515
|
+
}, te = async (t) => {
|
516
|
+
t.preventDefault();
|
517
|
+
try {
|
518
|
+
await ue({
|
519
|
+
accessToken: await o(),
|
520
|
+
type: me.SET_USER_PREFERENCES,
|
521
|
+
params: {
|
522
|
+
user: l?.username,
|
523
|
+
instructions: T,
|
524
|
+
location: D,
|
525
|
+
provider: r?.provider,
|
526
|
+
tags: k.prompts,
|
527
|
+
sendOnEnter: I,
|
528
|
+
useMemory: v,
|
529
|
+
showDetails: Z
|
530
|
+
}
|
531
|
+
}), R !== L && (await Se(R), $(R)), u(), x({
|
532
|
+
loadingLocation: !1
|
533
|
+
});
|
534
|
+
} catch {
|
535
|
+
}
|
536
|
+
}, P = async () => {
|
537
|
+
x({
|
538
|
+
loadingLocation: !0
|
539
|
+
}), y("...");
|
540
|
+
try {
|
541
|
+
const t = Date.now(), d = await ve(), _ = await ue({
|
542
|
+
accessToken: await o(),
|
543
|
+
type: me.GET_LOCATION,
|
544
|
+
params: {
|
545
|
+
latitude: d.latitude,
|
546
|
+
longitude: d.longitude
|
547
|
+
}
|
548
|
+
}), b = Date.now() - t;
|
549
|
+
if (b < 2e3 && await new Promise((i) => setTimeout(i, 2e3 - b)), _.status === 200) {
|
550
|
+
const { city: i, state: N, country: A, displayName: X } = _.data, ae = i && N && A ? `${i}, ${N}, ${A}` : X;
|
551
|
+
x({
|
552
|
+
loadingLocation: !1
|
553
|
+
}), y(ae);
|
554
|
+
} else
|
555
|
+
x({
|
556
|
+
loadingLocation: !1
|
557
|
+
});
|
558
|
+
} catch {
|
559
|
+
}
|
560
|
+
}, z = () => {
|
561
|
+
u(), s(!1);
|
562
|
+
}, j = ({
|
563
|
+
enabled: t = !1,
|
564
|
+
privateChat: d = !1,
|
565
|
+
clipboardAccess: _ = !1,
|
566
|
+
...Y
|
567
|
+
}) => {
|
568
|
+
m((b) => {
|
569
|
+
const i = b.prompts, N = {
|
570
|
+
...Y,
|
571
|
+
enabled: t,
|
572
|
+
privateChat: d,
|
573
|
+
clipboardAccess: _
|
574
|
+
};
|
575
|
+
_ ? N.content = N.content.replace(/{{clipboard}}/g, "") + " {{clipboard}}" : N.content = N.content.replace(/{{clipboard}}/g, "");
|
576
|
+
const A = i.findIndex((X) => X.slot === Y.slot);
|
577
|
+
return A === -1 ? {
|
578
|
+
...b,
|
579
|
+
prompts: [...i, { ...N }]
|
580
|
+
} : (i[A] = N, {
|
581
|
+
...b,
|
582
|
+
prompts: [...i]
|
583
|
+
});
|
584
|
+
});
|
585
|
+
}, F = Le(async () => {
|
586
|
+
try {
|
587
|
+
M(!0);
|
588
|
+
const t = await xe();
|
589
|
+
K(t);
|
590
|
+
} catch {
|
591
|
+
} finally {
|
592
|
+
M(!1);
|
593
|
+
}
|
594
|
+
}, []);
|
595
|
+
return ne(() => {
|
596
|
+
if (!r)
|
597
|
+
return;
|
598
|
+
r.instructions && C(r.instructions), r.location && y(r.location), r.tags && m({ prompts: r.tags }), r.sendOnEnter !== void 0 && w(r.sendOnEnter), r.useMemory !== void 0 && V(r.useMemory), r.showDetails !== void 0 && S(r.showDetails);
|
599
|
+
const t = ke();
|
600
|
+
$(t), J(t);
|
601
|
+
}, [r]), ne(() => {
|
602
|
+
L ? F() : K(null);
|
603
|
+
}, [L, F]), n ? /* @__PURE__ */ g(
|
604
|
+
Ie,
|
605
|
+
{
|
606
|
+
open: e,
|
607
|
+
onOpenChange: z,
|
608
|
+
title: we,
|
609
|
+
animation: !0,
|
610
|
+
animationType: "fade",
|
611
|
+
footer: /* @__PURE__ */ g(
|
612
|
+
Te,
|
613
|
+
{
|
614
|
+
columnGap: 2,
|
615
|
+
alignHorizontal: "flex-end",
|
616
|
+
className: "pb-8 sm:pb-0",
|
617
|
+
children: [
|
618
|
+
/* @__PURE__ */ a(de, { children: /* @__PURE__ */ a(
|
619
|
+
se,
|
620
|
+
{
|
621
|
+
mode: "dark",
|
622
|
+
variant: "secondary",
|
623
|
+
focusMode: "light",
|
624
|
+
noBorder: !0,
|
625
|
+
onClick: z,
|
626
|
+
children: "Cancel"
|
627
|
+
}
|
628
|
+
) }),
|
629
|
+
/* @__PURE__ */ a(de, { children: /* @__PURE__ */ a(
|
630
|
+
se,
|
631
|
+
{
|
632
|
+
mode: "dark",
|
633
|
+
focusMode: "light",
|
634
|
+
onClick: async (t) => {
|
635
|
+
s(!1), await te(t);
|
636
|
+
},
|
637
|
+
children: "Save"
|
638
|
+
}
|
639
|
+
) })
|
640
|
+
]
|
641
|
+
}
|
642
|
+
),
|
643
|
+
children: [
|
644
|
+
/* @__PURE__ */ g(
|
645
|
+
H,
|
646
|
+
{
|
647
|
+
header: O.SETTINGS_DETAILS.TITLE,
|
648
|
+
className: "prose-dark dark:prose-lighter",
|
649
|
+
noBorder: !0,
|
650
|
+
children: [
|
651
|
+
/* @__PURE__ */ a("p", { className: "text-sm", children: O.SETTINGS_DETAILS.DETAILS }),
|
652
|
+
/* @__PURE__ */ a(
|
653
|
+
B,
|
654
|
+
{
|
655
|
+
narrow: !0,
|
656
|
+
className: "mt-2",
|
657
|
+
label: "Show Message Statistics",
|
658
|
+
name: "show-message-statistics",
|
659
|
+
onChange: W,
|
660
|
+
checked: Z
|
661
|
+
}
|
662
|
+
),
|
663
|
+
/* @__PURE__ */ a("p", { className: "text-sm mt-5", children: O.SETTINGS_DETAILS.SEND_ON_ENTER }),
|
664
|
+
/* @__PURE__ */ a(
|
665
|
+
B,
|
666
|
+
{
|
667
|
+
narrow: !0,
|
668
|
+
className: "mt-2",
|
669
|
+
label: "Send Message on Enter",
|
670
|
+
name: "send-message-on-enter",
|
671
|
+
onChange: ee,
|
672
|
+
checked: I
|
673
|
+
}
|
674
|
+
),
|
675
|
+
/* @__PURE__ */ a("p", { className: "text-sm mt-5", children: O.SETTINGS_DETAILS.USE_MEMORY }),
|
676
|
+
/* @__PURE__ */ a(
|
677
|
+
B,
|
678
|
+
{
|
679
|
+
narrow: !0,
|
680
|
+
className: "mt-2",
|
681
|
+
label: "Use Memory",
|
682
|
+
name: "use-memory",
|
683
|
+
onChange: G,
|
684
|
+
checked: v
|
685
|
+
}
|
686
|
+
)
|
687
|
+
]
|
688
|
+
}
|
689
|
+
),
|
690
|
+
/* @__PURE__ */ g(
|
691
|
+
H,
|
692
|
+
{
|
693
|
+
header: "Custom Instructions",
|
694
|
+
className: "prose-dark dark:prose-lighter mt-4",
|
695
|
+
noBorder: !0,
|
696
|
+
children: [
|
697
|
+
/* @__PURE__ */ g("p", { className: "text-sm", children: [
|
698
|
+
"What would you like ",
|
699
|
+
/* @__PURE__ */ a("em", { children: Ne }),
|
700
|
+
" to know about you to provide better responses?"
|
701
|
+
] }),
|
702
|
+
/* @__PURE__ */ a(
|
703
|
+
ce,
|
704
|
+
{
|
705
|
+
mode: "alt-system",
|
706
|
+
autoCapitalize: "off",
|
707
|
+
autoComplete: "off",
|
708
|
+
autoCorrect: "off",
|
709
|
+
name: "customInstructions",
|
710
|
+
label: "Custom Instructions",
|
711
|
+
value: T,
|
712
|
+
onChange: (t) => {
|
713
|
+
C(t.target.value);
|
714
|
+
},
|
715
|
+
helperText: "Press ENTER to add a new line."
|
716
|
+
}
|
717
|
+
)
|
718
|
+
]
|
719
|
+
}
|
720
|
+
),
|
721
|
+
/* @__PURE__ */ g(
|
722
|
+
H,
|
723
|
+
{
|
724
|
+
header: "Location",
|
725
|
+
className: "prose-dark dark:prose-lighter mt-4",
|
726
|
+
noBorder: !0,
|
727
|
+
children: [
|
728
|
+
/* @__PURE__ */ a("p", { className: "text-sm", children: "You can share your location to receive customized responses based on your area." }),
|
729
|
+
/* @__PURE__ */ a(
|
730
|
+
ce,
|
731
|
+
{
|
732
|
+
mode: "alt-system",
|
733
|
+
name: "location",
|
734
|
+
label: "Location",
|
735
|
+
value: D,
|
736
|
+
onChange: (t) => {
|
737
|
+
y(t.target.value);
|
738
|
+
},
|
739
|
+
helperText: "Enter your location or press auto-detect."
|
740
|
+
}
|
741
|
+
),
|
742
|
+
/* @__PURE__ */ a(
|
743
|
+
se,
|
744
|
+
{
|
745
|
+
className: "mt-2",
|
746
|
+
size: "small",
|
747
|
+
noBorder: !0,
|
748
|
+
variant: "secondary",
|
749
|
+
disabled: h.loadingLocation,
|
750
|
+
onClick: P,
|
751
|
+
children: h.loadingLocation ? "Detecting..." : "Auto-detect"
|
752
|
+
}
|
753
|
+
)
|
754
|
+
]
|
755
|
+
}
|
756
|
+
),
|
757
|
+
/* @__PURE__ */ g(
|
758
|
+
H,
|
759
|
+
{
|
760
|
+
header: O.SETTINGS_PROMPTS.TITLE,
|
761
|
+
className: "prose-dark dark:prose-lighter mt-4",
|
762
|
+
noBorder: !0,
|
763
|
+
children: [
|
764
|
+
/* @__PURE__ */ a("p", { className: "text-sm", children: Ee }),
|
765
|
+
k.prompts && k.prompts.slice(0, 3).map((t) => /* @__PURE__ */ g(
|
766
|
+
H,
|
767
|
+
{
|
768
|
+
mode: "dark",
|
769
|
+
noBorder: !0,
|
770
|
+
header: t.label.replace("...", ""),
|
771
|
+
className: "prose-light mb-2",
|
772
|
+
children: [
|
773
|
+
/* @__PURE__ */ a("p", { className: "text-sm", children: t.description }),
|
774
|
+
/* @__PURE__ */ a(
|
775
|
+
B,
|
776
|
+
{
|
777
|
+
narrow: !0,
|
778
|
+
mode: "dark",
|
779
|
+
focusMode: "light",
|
780
|
+
className: "mt-2",
|
781
|
+
noBorder: !0,
|
782
|
+
label: "Enabled",
|
783
|
+
name: t.slot.toString(),
|
784
|
+
onChange: (d) => {
|
785
|
+
j({
|
786
|
+
...t,
|
787
|
+
enabled: d
|
788
|
+
});
|
789
|
+
},
|
790
|
+
checked: t.enabled
|
791
|
+
}
|
792
|
+
),
|
793
|
+
/* @__PURE__ */ a(
|
794
|
+
B,
|
795
|
+
{
|
796
|
+
narrow: !0,
|
797
|
+
mode: "dark",
|
798
|
+
focusMode: "light",
|
799
|
+
className: "mt-2",
|
800
|
+
noBorder: !0,
|
801
|
+
label: "Private Chat",
|
802
|
+
name: `private-${t.slot.toString()}`,
|
803
|
+
onChange: (d) => {
|
804
|
+
j({
|
805
|
+
...t,
|
806
|
+
privateChat: d
|
807
|
+
});
|
808
|
+
},
|
809
|
+
checked: t.privateChat
|
810
|
+
}
|
811
|
+
),
|
812
|
+
/* @__PURE__ */ a(
|
813
|
+
B,
|
814
|
+
{
|
815
|
+
narrow: !0,
|
816
|
+
mode: "dark",
|
817
|
+
focusMode: "light",
|
818
|
+
className: "mt-2",
|
819
|
+
noBorder: !0,
|
820
|
+
label: "Use Clipboard",
|
821
|
+
name: `clipboard-${t.slot.toString()}`,
|
822
|
+
onChange: (d) => {
|
823
|
+
j({
|
824
|
+
...t,
|
825
|
+
clipboardAccess: d
|
826
|
+
});
|
827
|
+
},
|
828
|
+
checked: t.clipboardAccess
|
829
|
+
}
|
830
|
+
)
|
831
|
+
]
|
832
|
+
},
|
833
|
+
`prompt-slot-${t.slot}`
|
834
|
+
))
|
835
|
+
]
|
836
|
+
}
|
837
|
+
),
|
838
|
+
/* @__PURE__ */ g(
|
839
|
+
H,
|
840
|
+
{
|
841
|
+
header: O.SETTINGS_CACHING.TITLE,
|
842
|
+
className: "prose-dark dark:prose-lighter mt-4 ",
|
843
|
+
noBorder: !0,
|
844
|
+
children: [
|
845
|
+
/* @__PURE__ */ a("p", { className: "text-sm", children: O.SETTINGS_CACHING.DESCRIPTION }),
|
846
|
+
/* @__PURE__ */ a(
|
847
|
+
B,
|
848
|
+
{
|
849
|
+
narrow: !0,
|
850
|
+
className: "mt-2",
|
851
|
+
label: "Enable Assets Caching",
|
852
|
+
name: "enable-service-worker",
|
853
|
+
onChange: re,
|
854
|
+
checked: R
|
855
|
+
}
|
856
|
+
),
|
857
|
+
L && /* @__PURE__ */ g("div", { className: "mt-4 p-3 border border-dashed border-neutral-700 dark:border-neutral-400 rounded @container/optimizations", children: [
|
858
|
+
/* @__PURE__ */ a("h3", { className: "m-0 mb-2 text-xs uppercase opacity-70", children: "Cache Info" }),
|
859
|
+
p ? /* @__PURE__ */ g("div", { className: "text-xs space-y-2", children: [
|
860
|
+
/* @__PURE__ */ g("p", { className: "m-0", children: [
|
861
|
+
"Version: ",
|
862
|
+
/* @__PURE__ */ a("strong", { children: p.version })
|
863
|
+
] }),
|
864
|
+
/* @__PURE__ */ g("p", { className: "m-0", children: [
|
865
|
+
"Total Items: ",
|
866
|
+
/* @__PURE__ */ a("strong", { children: p.totalItems })
|
867
|
+
] }),
|
868
|
+
p.caches.map((t) => /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a("ul", { className: "not-prose font-mono mt-2 list-none w-[95cqw]", children: t.urls.map((d) => /* @__PURE__ */ a(
|
869
|
+
"li",
|
870
|
+
{
|
871
|
+
className: "truncate text-xs text-copy-dark dark:text-copy-light overflow-hidden text-ellipsis",
|
872
|
+
title: d,
|
873
|
+
children: new URL(d).pathname
|
874
|
+
},
|
875
|
+
d
|
876
|
+
)) }) }, t.name)),
|
877
|
+
p.totalItems === 0 && !Q && /* @__PURE__ */ a("p", { className: "italic m-0 opacity-70", children: "No cached assets yet." })
|
878
|
+
] }) : /* @__PURE__ */ a("p", { className: "text-xs opacity-70 m-0", children: Q ? "Loading cache info..." : "No cache info available." })
|
879
|
+
] })
|
880
|
+
]
|
881
|
+
}
|
882
|
+
)
|
883
|
+
]
|
884
|
+
}
|
885
|
+
) : null;
|
886
|
+
};
|
887
|
+
export {
|
888
|
+
ar as SettingsPanel
|
889
|
+
};
|