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