@versini/sassysaint 8.47.2 → 8.49.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/dist/chunks/{AboutChangelog.DF-VOodQ.js → AboutChangelog.h63EDdwh.js} +2 -2
  2. package/dist/chunks/{AboutEntry.DalvRJPu.js → AboutEntry.bOQXv5GS.js} +5 -5
  3. package/dist/chunks/{App.DEd7989C.js → App.Buw_7bdF.js} +1784 -1655
  4. package/dist/chunks/{Chart.CwLSpgTZ.js → Chart.3xwfjmfL.js} +2 -2
  5. package/dist/chunks/{ChatBubbleAssistant.BwKFUhwE.js → ChatBubbleAssistant.Cy1PGZsN.js} +13 -13
  6. package/dist/chunks/ChatBubbleUser.Dk2VTVAc.js +127 -0
  7. package/dist/chunks/{ChatHistoryTable.4Y-wEval.js → ChatHistoryTable.BqB_YJay.js} +2 -2
  8. package/dist/chunks/{HistoryEntry.02EkbV2r.js → HistoryEntry.D3MICkQa.js} +3 -3
  9. package/dist/chunks/{LNWAZHJI.BgaLMWwH.js → LNWAZHJI.Dkf9465d.js} +1 -1
  10. package/dist/chunks/{ProfileEntry.I9Ny-iUl.js → ProfileEntry.oAcH82-L.js} +2 -2
  11. package/dist/chunks/SettingsEntry.C070BVPa.js +755 -0
  12. package/dist/chunks/{UsageEntry.Co_C4_Ly.js → UsageEntry.BMA_UKkG.js} +3 -3
  13. package/dist/chunks/{index.fBJffIIV.js → index.C53PCELr.js} +2 -2
  14. package/dist/chunks/{index.Br3926F8.js → index.CON2uSZR.js} +3 -3
  15. package/dist/chunks/{index.Cq0SkuUt.js → index.CUVW2CLY.js} +1 -1
  16. package/dist/chunks/{index.3SzBYAWU.js → index.DlBVcuDI.js} +1 -1
  17. package/dist/chunks/{index.Dd6KinX5.js → index.Dupy_SsG.js} +1 -1
  18. package/dist/chunks/{index.CGGECapX.js → index.UqSwLX11.js} +1 -1
  19. package/dist/chunks/{index.DMM94EvH.js → index.yFjbdWat.js} +2 -2
  20. package/dist/chunks/{useMarkdown.WuFAc7Zw.js → useMarkdown.IcEntGo8.js} +6 -6
  21. package/dist/components/SassySaint/SassySaint.js +1 -1
  22. package/dist/index.js +4 -4
  23. package/dist/style.css +1 -1
  24. package/package.json +3 -3
  25. package/dist/chunks/SettingsEntry.BUz1K73x.js +0 -891
@@ -1,891 +0,0 @@
1
- import { jsxs as m, jsx as a, Fragment as pe } from "react/jsx-runtime";
2
- import { o as ge, h as ie, i as ye, x as be, n as xe, useUserPreferences as ke, getCacheInfo as we, isServiceWorkerEnabled as Ne, SETTINGS_TITLE as Ee, S as V, CARDS as R, de as Te, C as se, PROMPTS_DESCRIPTION as ve, L as Se, j as de, pe as Ce, getCurrentGeoLocation as Ie, mutateCall as ue, handleServiceWorkerToggle as _e, SERVICE_TYPES as me } from "./index.DMM94EvH.js";
3
- import { useCapability as Le, se as Me } from "./App.DEd7989C.js";
4
- import Oe, { useState as f, useEffect as ne, useRef as W, useLayoutEffect as Y, useCallback as Pe } from "react";
5
- import c from "clsx";
6
- function Ae({
7
- value: e,
8
- defaultValue: s,
9
- finalValue: o,
10
- onChange: l = () => {
11
- },
12
- initialControlledDelay: r = 0
13
- }) {
14
- const [n, d] = f(!1), [h, x] = f(
15
- s !== void 0 ? s : o
16
- ), k = (u) => {
17
- x(u), l?.(u);
18
- };
19
- return ne(() => {
20
- (async () => e !== void 0 && !n && r > 0 && (await new Promise(
21
- (u) => setTimeout(u, r)
22
- ), d(!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", Re = "av-text-area-wrapper", le = "av-text-area-helper-text", Be = "av-text-area__control--right", De = "av-text-area__control--left", Ge = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hidden px-4 py-7", He = ({ 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
- }), Ue = ({
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
- }), $e = ({
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
- }), Ve = ({
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
- }, We = ({
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
- }, ze = ({
112
- className: e,
113
- textAreaClassName: s,
114
- raw: o,
115
- focusMode: l,
116
- disabled: r,
117
- noBorder: n,
118
- error: d,
119
- mode: h,
120
- leftElement: x,
121
- rightElement: k
122
- }) => {
123
- const u = o ? e : c(
124
- "relative flex w-full flex-col justify-center",
125
- Re,
126
- e
127
- ), v = o ? c(s) : c(
128
- fe,
129
- s,
130
- Ge(),
131
- He({ mode: h }),
132
- Ue({ focusMode: l }),
133
- $e({
134
- noBorder: n,
135
- error: d
136
- }),
137
- {
138
- "disabled:cursor-not-allowed disabled:opacity-50": r
139
- }
140
- ), I = o ? void 0 : "sr-only", D = Ve({
141
- disabled: r,
142
- raw: o,
143
- error: d,
144
- mode: h,
145
- rightElement: k,
146
- leftElement: x
147
- }), y = We({
148
- error: d,
149
- raw: o,
150
- mode: h,
151
- disabled: r
152
- }), _ = o ? void 0 : c(Be, "absolute"), w = o ? void 0 : c(De, "absolute");
153
- return {
154
- wrapper: u,
155
- textArea: v,
156
- accessibleLabel: I,
157
- visibleLabel: D,
158
- helperText: y,
159
- rightElement: _,
160
- leftElement: w
161
- };
162
- }, Fe = ({
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 d = e - s, h = Math.abs(d / 24);
171
- r = o + -1 * Math.sign(d) * (12 * h), n = l + Math.sign(d) * (12 * h);
172
- }
173
- return {
174
- labelOffset: r,
175
- helperTextOffset: n,
176
- scrollHeight: e
177
- };
178
- }, ce = Oe.forwardRef(
179
- ({
180
- id: e,
181
- name: s,
182
- label: o,
183
- error: l = !1,
184
- raw: r = !1,
185
- className: n,
186
- textAreaClassName: d,
187
- mode: h = "system",
188
- focusMode: x = "system",
189
- value: k,
190
- defaultValue: u,
191
- disabled: v = !1,
192
- noBorder: I = !1,
193
- labelId: D,
194
- helperText: y = "",
195
- helperTextOnFocus: _ = !1,
196
- rightElement: w,
197
- leftElement: S,
198
- onChange: z,
199
- onFocus: L,
200
- onBlur: F,
201
- ...G
202
- }, X) => {
203
- const p = W(null), q = ge([X, p]), [J, M] = ie(), [K, C] = ie(), H = W(80), Q = W(-25), U = W(null), Z = W(30), ee = W(null), O = ye({ id: e, prefix: `${fe}-` }), [re, te] = f(0), [$, ae] = f(0), [t, i] = f(
204
- !!(!_ && y)
205
- ), P = `${s} error, ${y}`, N = ze({
206
- className: n,
207
- textAreaClassName: d,
208
- error: l,
209
- raw: r,
210
- focusMode: x,
211
- disabled: v,
212
- noBorder: I,
213
- mode: h,
214
- rightElement: !!w,
215
- leftElement: !!S
216
- }), [g, E] = Ae({
217
- value: k,
218
- initialControlledDelay: 20,
219
- defaultValue: u,
220
- onChange: (b) => {
221
- z && z({
222
- target: {
223
- value: b
224
- }
225
- });
226
- }
227
- }), T = (b) => {
228
- E(b.target.value);
229
- }, A = (b) => {
230
- _ && y && i(!0), L && L(b);
231
- }, j = (b) => {
232
- _ && y && !g && i(!1), F && F(b);
233
- };
234
- return Y(() => {
235
- M && M.width && te(M.width + 18 + 10);
236
- }, [M]), Y(() => {
237
- C && C.width && ae(C.width + 18 + 10);
238
- }, [C]), Y(() => {
239
- r || p && p.current && g !== void 0 && (p.current.style.height = "inherit", p.current.style.height = p.current.scrollHeight + "px");
240
- }, [g, r]), Y(() => {
241
- r || setTimeout(() => {
242
- U?.current?.style.setProperty(
243
- "--av-text-area-wrapper-transition",
244
- g ? "none" : "all 0.2s ease-out"
245
- );
246
- }, 0);
247
- }, [g, r]), Y(() => {
248
- if (!r && p && p.current && g !== void 0) {
249
- const { labelOffset: b, helperTextOffset: oe, scrollHeight: he } = Fe({
250
- scrollHeight: p.current.scrollHeight,
251
- currentHeight: H.current,
252
- currentLabelOffset: Q.current,
253
- currentHelperTextOffset: Z.current
254
- });
255
- b && (Q.current = b, U?.current?.style.setProperty(
256
- "--av-text-area-label",
257
- `${b}px`
258
- )), oe && (Z.current = oe, ee?.current?.style.setProperty(
259
- "--av-text-area-helper-text",
260
- `${oe}px`
261
- )), H.current = he || H.current;
262
- }
263
- }, [g, r]), C.width > 0 && U?.current?.style.setProperty(
264
- "--tw-translate-x",
265
- `${12 + C.width + 5}px`
266
- ), /* @__PURE__ */ m("div", { className: N.wrapper, children: [
267
- /* @__PURE__ */ a(
268
- "label",
269
- {
270
- htmlFor: O,
271
- id: D,
272
- className: N.accessibleLabel,
273
- children: o
274
- }
275
- ),
276
- S && /* @__PURE__ */ a(
277
- "div",
278
- {
279
- ref: K,
280
- className: N.leftElement,
281
- children: S
282
- }
283
- ),
284
- /* @__PURE__ */ a(
285
- "textarea",
286
- {
287
- ref: q,
288
- id: O,
289
- name: s,
290
- disabled: v,
291
- placeholder: r ? void 0 : " ",
292
- className: N.textArea,
293
- rows: 1,
294
- ...y && { "aria-describedby": `${O}-helper` },
295
- ...l && { "aria-invalid": "true" },
296
- ...w && !S && !r && { style: { paddingRight: re } },
297
- ...S && !w && !r && { style: { paddingLeft: $ } },
298
- ...w && S && !r && {
299
- style: {
300
- paddingRight: re,
301
- paddingLeft: $
302
- }
303
- },
304
- value: g,
305
- onChange: T,
306
- onFocus: A,
307
- onBlur: j,
308
- ...G
309
- }
310
- ),
311
- !r && /* @__PURE__ */ a(
312
- "label",
313
- {
314
- ref: U,
315
- "aria-hidden": !0,
316
- htmlFor: O,
317
- className: `${N.visibleLabel}`,
318
- children: o
319
- }
320
- ),
321
- t && /* @__PURE__ */ a(
322
- "div",
323
- {
324
- ref: ee,
325
- id: `${O}-helper`,
326
- className: N.helperText,
327
- children: y
328
- }
329
- ),
330
- w && /* @__PURE__ */ a(
331
- "div",
332
- {
333
- ref: J,
334
- className: N.rightElement,
335
- children: w
336
- }
337
- ),
338
- l && y && /* @__PURE__ */ a(be, { politeness: "polite", clearAnnouncementDelay: 500, children: P })
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 je = "av-toggle", Ye = ({ 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
- ), Xe = ({
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
- ), qe = ({ 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
- ), Je = ({ 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
- ), Ke = ({
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
- }), Ze = ({ className: e }) => c(
421
- je,
422
- "relative flex cursor-pointer items-center",
423
- e
424
- ), er = ({
425
- mode: e,
426
- focusMode: s,
427
- labelHidden: o,
428
- className: l,
429
- noBorder: r,
430
- narrow: n
431
- }) => ({
432
- toggle: c(
433
- Ye({ narrow: n }),
434
- Ke({ mode: e, noBorder: r }),
435
- Xe({ focusMode: s }),
436
- Je({ narrow: n }),
437
- qe({ narrow: n })
438
- ),
439
- label: Qe({ mode: e, labelHidden: o }),
440
- input: "peer sr-only",
441
- wrapper: Ze({ 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: d = "system",
450
- className: h,
451
- noBorder: x = !1,
452
- narrow: k = !1
453
- }) => {
454
- const u = er({
455
- mode: n,
456
- focusMode: d,
457
- labelHidden: l,
458
- className: h,
459
- noBorder: x,
460
- narrow: k
461
- }), v = (I) => {
462
- s?.(I.target.checked);
463
- };
464
- return /* @__PURE__ */ m("label", { className: u.wrapper, children: [
465
- /* @__PURE__ */ a(
466
- "input",
467
- {
468
- name: r,
469
- checked: e,
470
- type: "checkbox",
471
- className: u.input,
472
- onChange: v
473
- }
474
- ),
475
- /* @__PURE__ */ a("div", { className: u.toggle }),
476
- /* @__PURE__ */ a("span", { className: u.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 lr = ({
493
- open: e,
494
- onOpenChange: s
495
- }) => {
496
- const { getAccessToken: o, user: l } = xe(), {
497
- data: r,
498
- isSuccess: n,
499
- refetch: d
500
- } = ke({
501
- user: l?.username,
502
- getAccessToken: o
503
- }), [h, x] = f({
504
- loadingLocation: !1
505
- }), [k, u] = f({
506
- prompts: []
507
- }), [v, I] = f(""), [D, y] = f(""), [_, w] = f(!1), [S, z] = f(!1), [L, F] = f(!1), [G, X] = f(!1), [p, q] = f(null), [J, M] = f(!1), [K, C] = f(!1), H = Le(Ce.TOOL.MEMORIES), Q = (t) => {
508
- C(t);
509
- }, U = (t) => {
510
- w(t);
511
- }, Z = (t) => {
512
- H && z(t);
513
- }, ee = (t) => {
514
- X(t);
515
- }, O = 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: v,
524
- location: D,
525
- provider: r?.provider,
526
- tags: k.prompts,
527
- sendOnEnter: _,
528
- useMemory: S,
529
- showDetails: K
530
- }
531
- }), G !== L && (await _e(G), F(G)), d(), x({
532
- loadingLocation: !1
533
- });
534
- } catch {
535
- }
536
- }, re = async () => {
537
- x({
538
- loadingLocation: !0
539
- }), y("...");
540
- try {
541
- const t = Date.now(), i = await Ie(), P = await ue({
542
- accessToken: await o(),
543
- type: me.GET_LOCATION,
544
- params: {
545
- latitude: i.latitude,
546
- longitude: i.longitude
547
- }
548
- }), g = Date.now() - t;
549
- if (g < 2e3 && await new Promise((E) => setTimeout(E, 2e3 - g)), P.status === 200) {
550
- const { city: E, state: T, country: A, displayName: j } = P.data, b = E && T && A ? `${E}, ${T}, ${A}` : j;
551
- x({
552
- loadingLocation: !1
553
- }), y(b);
554
- } else
555
- x({
556
- loadingLocation: !1
557
- });
558
- } catch {
559
- }
560
- }, te = () => {
561
- d(), s(!1);
562
- }, $ = ({
563
- enabled: t = !1,
564
- privateChat: i = !1,
565
- clipboardAccess: P = !1,
566
- ...N
567
- }) => {
568
- u((g) => {
569
- const E = g.prompts, T = {
570
- ...N,
571
- enabled: t,
572
- privateChat: i,
573
- clipboardAccess: P
574
- };
575
- P ? T.content = T.content.replace(/{{clipboard}}/g, "") + " {{clipboard}}" : T.content = T.content.replace(/{{clipboard}}/g, "");
576
- const A = E.findIndex((j) => j.slot === N.slot);
577
- return A === -1 ? {
578
- ...g,
579
- prompts: [...E, { ...T }]
580
- } : (E[A] = T, {
581
- ...g,
582
- prompts: [...E]
583
- });
584
- });
585
- }, ae = Pe(async () => {
586
- try {
587
- M(!0);
588
- const t = await we();
589
- q(t);
590
- } catch {
591
- } finally {
592
- M(!1);
593
- }
594
- }, []);
595
- return ne(() => {
596
- if (!r)
597
- return;
598
- r.instructions && I(r.instructions), r.location && y(r.location), r.tags && u({ prompts: r.tags }), r.sendOnEnter !== void 0 && w(r.sendOnEnter), r.useMemory !== void 0 && z(r.useMemory), r.showDetails !== void 0 && C(r.showDetails);
599
- const t = Ne();
600
- F(t), X(t);
601
- }, [r]), ne(() => {
602
- L ? ae() : q(null);
603
- }, [L, ae]), n ? /* @__PURE__ */ m(
604
- Me,
605
- {
606
- open: e,
607
- onOpenChange: te,
608
- title: Ee,
609
- animation: !0,
610
- animationType: "fade",
611
- footer: /* @__PURE__ */ m(
612
- Se,
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: te,
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 O(t);
636
- },
637
- children: "Save"
638
- }
639
- ) })
640
- ]
641
- }
642
- ),
643
- children: [
644
- /* @__PURE__ */ m(
645
- V,
646
- {
647
- header: R.SETTINGS_DETAILS.TITLE,
648
- className: "prose-dark dark:prose-lighter",
649
- noBorder: !0,
650
- children: [
651
- /* @__PURE__ */ a("p", { className: "text-sm", children: R.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: Q,
660
- checked: K
661
- }
662
- ),
663
- /* @__PURE__ */ a("p", { className: "text-sm mt-5", children: R.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: U,
672
- checked: _
673
- }
674
- ),
675
- H && /* @__PURE__ */ m(pe, { children: [
676
- /* @__PURE__ */ a("p", { className: "text-sm mt-5", children: R.SETTINGS_DETAILS.USE_MEMORY }),
677
- /* @__PURE__ */ a(
678
- B,
679
- {
680
- narrow: !0,
681
- className: "mt-2",
682
- label: "Use Memory",
683
- name: "use-memory",
684
- onChange: Z,
685
- checked: S
686
- }
687
- )
688
- ] })
689
- ]
690
- }
691
- ),
692
- /* @__PURE__ */ m(
693
- V,
694
- {
695
- header: "Custom Instructions",
696
- className: "prose-dark dark:prose-lighter mt-4",
697
- noBorder: !0,
698
- children: [
699
- /* @__PURE__ */ m("p", { className: "text-sm", children: [
700
- "What would you like ",
701
- /* @__PURE__ */ a("em", { children: Te }),
702
- " to know about you to provide better responses?"
703
- ] }),
704
- /* @__PURE__ */ a(
705
- ce,
706
- {
707
- mode: "alt-system",
708
- autoCapitalize: "off",
709
- autoComplete: "off",
710
- autoCorrect: "off",
711
- name: "customInstructions",
712
- label: "Custom Instructions",
713
- value: v,
714
- onChange: (t) => {
715
- I(t.target.value);
716
- },
717
- helperText: "Press ENTER to add a new line."
718
- }
719
- )
720
- ]
721
- }
722
- ),
723
- /* @__PURE__ */ m(
724
- V,
725
- {
726
- header: "Location",
727
- className: "prose-dark dark:prose-lighter mt-4",
728
- noBorder: !0,
729
- children: [
730
- /* @__PURE__ */ a("p", { className: "text-sm", children: "You can share your location to receive customized responses based on your area." }),
731
- /* @__PURE__ */ a(
732
- ce,
733
- {
734
- mode: "alt-system",
735
- name: "location",
736
- label: "Location",
737
- value: D,
738
- onChange: (t) => {
739
- y(t.target.value);
740
- },
741
- helperText: "Enter your location or press auto-detect."
742
- }
743
- ),
744
- /* @__PURE__ */ a(
745
- se,
746
- {
747
- className: "mt-2",
748
- size: "small",
749
- noBorder: !0,
750
- variant: "secondary",
751
- disabled: h.loadingLocation,
752
- onClick: re,
753
- children: h.loadingLocation ? "Detecting..." : "Auto-detect"
754
- }
755
- )
756
- ]
757
- }
758
- ),
759
- /* @__PURE__ */ m(
760
- V,
761
- {
762
- header: R.SETTINGS_PROMPTS.TITLE,
763
- className: "prose-dark dark:prose-lighter mt-4",
764
- noBorder: !0,
765
- children: [
766
- /* @__PURE__ */ a("p", { className: "text-sm", children: ve }),
767
- k.prompts && k.prompts.slice(0, 3).map((t) => /* @__PURE__ */ m(
768
- V,
769
- {
770
- mode: "dark",
771
- noBorder: !0,
772
- header: t.label.replace("...", ""),
773
- className: "prose-light mb-2",
774
- children: [
775
- /* @__PURE__ */ a("p", { className: "text-sm", children: t.description }),
776
- /* @__PURE__ */ a(
777
- B,
778
- {
779
- narrow: !0,
780
- mode: "dark",
781
- focusMode: "light",
782
- className: "mt-2",
783
- noBorder: !0,
784
- label: "Enabled",
785
- name: t.slot.toString(),
786
- onChange: (i) => {
787
- $({
788
- ...t,
789
- enabled: i
790
- });
791
- },
792
- checked: t.enabled
793
- }
794
- ),
795
- /* @__PURE__ */ a(
796
- B,
797
- {
798
- narrow: !0,
799
- mode: "dark",
800
- focusMode: "light",
801
- className: "mt-2",
802
- noBorder: !0,
803
- label: "Private Chat",
804
- name: `private-${t.slot.toString()}`,
805
- onChange: (i) => {
806
- $({
807
- ...t,
808
- privateChat: i
809
- });
810
- },
811
- checked: t.privateChat
812
- }
813
- ),
814
- /* @__PURE__ */ a(
815
- B,
816
- {
817
- narrow: !0,
818
- mode: "dark",
819
- focusMode: "light",
820
- className: "mt-2",
821
- noBorder: !0,
822
- label: "Use Clipboard",
823
- name: `clipboard-${t.slot.toString()}`,
824
- onChange: (i) => {
825
- $({
826
- ...t,
827
- clipboardAccess: i
828
- });
829
- },
830
- checked: t.clipboardAccess
831
- }
832
- )
833
- ]
834
- },
835
- `prompt-slot-${t.slot}`
836
- ))
837
- ]
838
- }
839
- ),
840
- /* @__PURE__ */ m(
841
- V,
842
- {
843
- header: R.SETTINGS_CACHING.TITLE,
844
- className: "prose-dark dark:prose-lighter mt-4 ",
845
- noBorder: !0,
846
- children: [
847
- /* @__PURE__ */ a("p", { className: "text-sm", children: R.SETTINGS_CACHING.DESCRIPTION }),
848
- /* @__PURE__ */ a(
849
- B,
850
- {
851
- narrow: !0,
852
- className: "mt-2",
853
- label: "Enable Assets Caching",
854
- name: "enable-service-worker",
855
- onChange: ee,
856
- checked: G
857
- }
858
- ),
859
- L && /* @__PURE__ */ m("div", { className: "mt-4 p-3 border border-dashed border-neutral-700 dark:border-neutral-400 rounded @container/optimizations", children: [
860
- /* @__PURE__ */ a("h3", { className: "m-0 mb-2 text-xs uppercase opacity-70", children: "Cache Info" }),
861
- p ? /* @__PURE__ */ m("div", { className: "text-xs space-y-2", children: [
862
- /* @__PURE__ */ m("p", { className: "m-0", children: [
863
- "Version: ",
864
- /* @__PURE__ */ a("strong", { children: p.version })
865
- ] }),
866
- /* @__PURE__ */ m("p", { className: "m-0", children: [
867
- "Total Items: ",
868
- /* @__PURE__ */ a("strong", { children: p.totalItems })
869
- ] }),
870
- 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((i) => /* @__PURE__ */ a(
871
- "li",
872
- {
873
- className: "truncate text-xs text-copy-dark dark:text-copy-light overflow-hidden text-ellipsis",
874
- title: i,
875
- children: new URL(i).pathname
876
- },
877
- i
878
- )) }) }, t.name)),
879
- p.totalItems === 0 && !J && /* @__PURE__ */ a("p", { className: "italic m-0 opacity-70", children: "No cached assets yet." })
880
- ] }) : /* @__PURE__ */ a("p", { className: "text-xs opacity-70 m-0", children: J ? "Loading cache info..." : "No cache info available." })
881
- ] })
882
- ]
883
- }
884
- )
885
- ]
886
- }
887
- ) : null;
888
- };
889
- export {
890
- lr as SettingsPanel
891
- };