@versini/sassysaint 8.62.2 → 8.63.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 (27) hide show
  1. package/dist/chunks/{AboutChangelog.CBM8DU-l.js → AboutChangelog.CcpXjtz2.js} +2 -2
  2. package/dist/chunks/{AboutEntry.C9RkO1UB.js → AboutEntry.D-K-8suU.js} +9 -9
  3. package/dist/chunks/{App.D3GdUdDt.js → App.BUHkBnAs.js} +1551 -1540
  4. package/dist/chunks/{Chart.Yybbexr3.js → Chart.f_78Yn-S.js} +2 -2
  5. package/dist/chunks/{ChatBubbleAssistant.Bkoh8-GW.js → ChatBubbleAssistant.BMzfA5pX.js} +13 -13
  6. package/dist/chunks/{ChatBubbleUser.DaJoiXXH.js → ChatBubbleUser.BkwIMaLA.js} +3 -3
  7. package/dist/chunks/{ChatHistoryTable.C6Ksf3TE.js → ChatHistoryTable.z1gXvLbS.js} +21 -21
  8. package/dist/chunks/{HistoryEntry.D8TfS6NX.js → HistoryEntry.6LhEmpQ3.js} +30 -30
  9. package/dist/chunks/ProfileEntry.BVd9oy8m.js +158 -0
  10. package/dist/chunks/{SettingsEntry.CYRs-kZR.js → SettingsEntry.BITLpN9E.js} +104 -105
  11. package/dist/chunks/{Table.BO7U8k6z.js → Table.BuN5VZQJ.js} +8 -8
  12. package/dist/chunks/{UsageEntry.DTJ6Ewrp.js → UsageEntry.B5xt2ba5.js} +3 -3
  13. package/dist/chunks/{UserMemoriesPanel.DUD0vi57.js → UserMemoriesPanel.DU82nD6K.js} +3 -3
  14. package/dist/chunks/{index.BwP0kG4H.js → index.790ujKXR.js} +15 -15
  15. package/dist/chunks/{index.H6hFK3Q7.js → index.BCvnlzn1.js} +1022 -960
  16. package/dist/chunks/{index.CBvWjpu9.js → index.Bmi4qytW.js} +2 -2
  17. package/dist/chunks/{index.DpFQswsr.js → index.Cq79kge7.js} +1 -1
  18. package/dist/chunks/{index.PmUBv-Nk.js → index.DEwRELHl.js} +3 -3
  19. package/dist/chunks/{index.BM7cljgA.js → index.TsLNeuu8.js} +1 -1
  20. package/dist/chunks/{index.DqVd7od-.js → index.W_JEPkEx.js} +1 -1
  21. package/dist/chunks/{index.tBXfskeI.js → index.hfGQXbdH.js} +1 -1
  22. package/dist/chunks/{useMarkdown.DT9Y5TNa.js → useMarkdown.D7Tx0mAO.js} +6 -6
  23. package/dist/components/SassySaint/SassySaint.js +1 -1
  24. package/dist/index.js +4 -4
  25. package/dist/style.css +1 -1
  26. package/package.json +3 -3
  27. package/dist/chunks/ProfileEntry.CdKbNy5F.js +0 -60
@@ -1,7 +1,7 @@
1
1
  import { jsx as Ap } from "react/jsx-runtime";
2
- import { getDefaultExportFromCjs as ln } from "./App.D3GdUdDt.js";
2
+ import { getDefaultExportFromCjs as ln } from "./App.BUHkBnAs.js";
3
3
  import Cp, { useState as Pp, useEffect as Op } from "react";
4
- import { TRIMESTERS as rn, TRIMESTERS_SHORT as Lp, isProbablyMobile as Ep } from "./index.H6hFK3Q7.js";
4
+ import { TRIMESTERS as rn, TRIMESTERS_SHORT as Lp, isProbablyMobile as Ep } from "./index.BCvnlzn1.js";
5
5
  var ls = { exports: {} }, Ip = ls.exports, on;
6
6
  function Dp() {
7
7
  return on || (on = 1, (function(ke, ne) {
@@ -1,17 +1,17 @@
1
- import { jsx as M } from "react/jsx-runtime";
2
- import { n as N, useUserPreferences as O, convertCamelCaseToReadable as P, numberFormatter as R, pluralize as y, ne as L } from "./index.H6hFK3Q7.js";
3
- import { BUBBLE_FOOTER_EMPTY as _ } from "./index.BM7cljgA.js";
1
+ import { jsx as x } from "react/jsx-runtime";
2
+ import { n as N, useUserPreferences as O, convertCamelCaseToReadable as P, numberFormatter as R, pluralize as y, re as L } from "./index.BCvnlzn1.js";
3
+ import { BUBBLE_FOOTER_EMPTY as _ } from "./index.TsLNeuu8.js";
4
4
  import w from "clsx";
5
- import v, { useState as b, useRef as A, useEffect as U, useContext as B } from "react";
6
- import { ChatContext as G, AsyncBubble as E } from "./App.D3GdUdDt.js";
7
- import { useMarkdown as D } from "./useMarkdown.DT9Y5TNa.js";
8
- const j = 2, q = j * 1e3, x = "", I = (e) => e * (2 - e);
5
+ import v, { useState as M, useRef as A, useEffect as U, useContext as B } from "react";
6
+ import { ChatContext as G, AsyncBubble as E } from "./App.BUHkBnAs.js";
7
+ import { useMarkdown as D } from "./useMarkdown.D7Tx0mAO.js";
8
+ const j = 2, q = j * 1e3, b = "", I = (e) => e * (2 - e);
9
9
  function W(e, n = !0) {
10
- const [a, p] = b(0), [i, C] = b(0), [t, T] = b(e), r = A(0), s = A(0);
10
+ const [a, p] = M(0), [i, C] = M(0), [t, T] = M(e), r = A(0), s = A(0);
11
11
  return t !== e && (T(e), C(e.startsWith(t) ? a : 0)), U(() => {
12
12
  if (!n)
13
13
  return;
14
- const u = e.split(x).length, o = (c) => {
14
+ const u = e.split(b).length, o = (c) => {
15
15
  s.current || (s.current = c);
16
16
  const l = c - s.current, m = Math.min(l / q, 1), h = I(m), g = i + (u - i) * h;
17
17
  p(Math.floor(g)), m < 1 && (r.current = requestAnimationFrame(o));
@@ -19,7 +19,7 @@ function W(e, n = !0) {
19
19
  return s.current = 0, r.current = requestAnimationFrame(o), () => {
20
20
  r.current && cancelAnimationFrame(r.current);
21
21
  };
22
- }, [i, e, n]), n ? e.split(x).slice(0, a).join(x) : e;
22
+ }, [i, e, n]), n ? e.split(b).slice(0, a).join(b) : e;
23
23
  }
24
24
  const d = {
25
25
  MODEL: "Model",
@@ -46,16 +46,16 @@ const d = {
46
46
  [d.PLUGIN]: a ? P(a) : null
47
47
  }, o && (C ? f[d.USAGE] = `${R.format(o)} ${y("token", o)}` : f[d.USAGE] = _)), U(() => {
48
48
  t && l(t);
49
- }, [t, l]), p === L ? /* @__PURE__ */ M(
49
+ }, [t, l]), p === L ? /* @__PURE__ */ x(
50
50
  E,
51
51
  {
52
52
  tail: !0,
53
53
  className: k,
54
54
  contentClassName: S,
55
55
  noMaxWidth: !0,
56
- children: /* @__PURE__ */ M("div", { className: "flex items-center justify-center italic text-copy-error-dark dark:text-red-300", children: c })
56
+ children: /* @__PURE__ */ x("div", { className: "flex items-center justify-center italic text-copy-error-dark dark:text-red-300", children: c })
57
57
  }
58
- ) : /* @__PURE__ */ M(
58
+ ) : /* @__PURE__ */ x(
59
59
  E,
60
60
  {
61
61
  tail: !0,
@@ -1,8 +1,8 @@
1
1
  import { jsx as n, Fragment as b, jsxs as A } from "react/jsx-runtime";
2
2
  import { useState as C, useMemo as u, isValidElement as p, useEffect as I } from "react";
3
- import { AsyncBubble as w } from "./App.D3GdUdDt.js";
4
- import { useMarkdown as _ } from "./useMarkdown.DT9Y5TNa.js";
5
- import { C as M } from "./index.H6hFK3Q7.js";
3
+ import { AsyncBubble as w } from "./App.BUHkBnAs.js";
4
+ import { useMarkdown as _ } from "./useMarkdown.D7Tx0mAO.js";
5
+ import { C as M } from "./index.BCvnlzn1.js";
6
6
  const R = 200, N = ({
7
7
  string: e,
8
8
  idealLength: r = R
@@ -1,9 +1,9 @@
1
1
  import { jsxs as m, jsx as e } from "react/jsx-runtime";
2
- import { I as g, le as N, pe as C, INFINITE_SCROLL_THRESHOLD as A, CARDS as E, pluralize as y, te as x, numberFormatter as k, Oe as b, isProbablyMobile as D, y as U, i$1 as B, E as I } from "./index.H6hFK3Q7.js";
3
- import { st as u, p$1 as P, z as L, p$2 as V } from "./App.D3GdUdDt.js";
2
+ import { I as g, pe as N, fe as C, INFINITE_SCROLL_THRESHOLD as A, CARDS as E, pluralize as y, te as p, numberFormatter as k, le as b, isProbablyMobile as D, d as U, c as B, y as I } from "./index.BCvnlzn1.js";
3
+ import { st as u, p$1 as P, z as L, p$2 as V } from "./App.BUHkBnAs.js";
4
4
  import h from "clsx";
5
- import { Fragment as $ } from "react";
6
- import { j as _, D as H, G as M, H as Y, U as F, M as a, F as f, l as G } from "./Table.BO7U8k6z.js";
5
+ import { Fragment as _ } from "react";
6
+ import { j as $, D as H, G as M, H as Y, U as F, M as a, F as R, l as G } from "./Table.BuN5VZQJ.js";
7
7
  const K = ({
8
8
  className: c,
9
9
  viewBox: l,
@@ -112,8 +112,8 @@ const K = ({
112
112
  onClickSort: i,
113
113
  onClickRestore: n,
114
114
  onClickDelete: w,
115
- onClickFavorite: O,
116
- infinityScrollMarkerRef: S
115
+ onClickFavorite: S,
116
+ infinityScrollMarkerRef: O
117
117
  }) => {
118
118
  const v = D() ? J : Q, T = (s) => {
119
119
  switch (s) {
@@ -121,7 +121,7 @@ const K = ({
121
121
  return /* @__PURE__ */ e(a, { className: "sr-only", children: "Row" }, s);
122
122
  case t.TIMESTAMP:
123
123
  return /* @__PURE__ */ e(
124
- f,
124
+ R,
125
125
  {
126
126
  focusMode: "system",
127
127
  buttonClassName: "text-xs sm:text-sm",
@@ -142,7 +142,7 @@ const K = ({
142
142
  return /* @__PURE__ */ e(a, { className: "text-xs sm:text-sm", children: "Provider" }, s);
143
143
  case t.TOKEN_USAGE:
144
144
  return /* @__PURE__ */ e(
145
- f,
145
+ R,
146
146
  {
147
147
  focusMode: "system",
148
148
  buttonClassName: "text-xs sm:text-sm",
@@ -162,10 +162,10 @@ const K = ({
162
162
  default:
163
163
  return null;
164
164
  }
165
- }, z = (s, r, p) => {
165
+ }, z = (s, r, x) => {
166
166
  switch (s) {
167
167
  case t.ROW:
168
- return /* @__PURE__ */ e(a, { children: p + 1 }, s);
168
+ return /* @__PURE__ */ e(a, { children: x + 1 }, s);
169
169
  case t.TIMESTAMP:
170
170
  return /* @__PURE__ */ e(
171
171
  a,
@@ -198,7 +198,7 @@ const K = ({
198
198
  );
199
199
  }
200
200
  case t.PROVIDER: {
201
- const d = r.model ? b(r.model) : null, R = d ? q[d] : null;
201
+ const d = r.model ? b(r.model) : null, f = d ? q[d] : null;
202
202
  return /* @__PURE__ */ e(
203
203
  a,
204
204
  {
@@ -206,8 +206,8 @@ const K = ({
206
206
  scope: "row",
207
207
  className: h("dark:text-gray-400"),
208
208
  align: "center",
209
- children: R ? /* @__PURE__ */ e(
210
- R,
209
+ children: f ? /* @__PURE__ */ e(
210
+ f,
211
211
  {
212
212
  size: "size-4 sm:size-5",
213
213
  semantic: !0,
@@ -236,7 +236,7 @@ const K = ({
236
236
  label: "Restore chat",
237
237
  placement: "top",
238
238
  trigger: /* @__PURE__ */ e(
239
- x,
239
+ p,
240
240
  {
241
241
  noBorder: !0,
242
242
  label: "Restore chat",
@@ -256,13 +256,13 @@ const K = ({
256
256
  label: r.favoriteChat ? "Remove from favorites" : "Add to favorites",
257
257
  placement: "top",
258
258
  trigger: /* @__PURE__ */ e(
259
- x,
259
+ p,
260
260
  {
261
261
  noBorder: !0,
262
262
  label: r.favoriteChat ? "Remove from favorites" : "Add to favorites",
263
263
  variant: "primary",
264
264
  onClick: async () => {
265
- await O(r);
265
+ await S(r);
266
266
  },
267
267
  children: r.favoriteChat ? /* @__PURE__ */ e(W, { size: "size-4", monotone: !0 }) : /* @__PURE__ */ e(j, { size: "size-4", monotone: !0 })
268
268
  }
@@ -275,7 +275,7 @@ const K = ({
275
275
  label: "Delete chat",
276
276
  placement: "top",
277
277
  trigger: /* @__PURE__ */ e(
278
- x,
278
+ p,
279
279
  {
280
280
  noBorder: !0,
281
281
  label: "Delete chat",
@@ -294,12 +294,12 @@ const K = ({
294
294
  return null;
295
295
  }
296
296
  };
297
- return /* @__PURE__ */ m(_, { stickyHeader: !0, stickyFooter: !0, compact: !0, mode: "alt-system", children: [
297
+ return /* @__PURE__ */ m($, { stickyHeader: !0, stickyFooter: !0, compact: !0, mode: "alt-system", children: [
298
298
  /* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(M, { children: v.map((s) => T(s)) }) }),
299
- /* @__PURE__ */ e(Y, { children: c.slice(0, o).map((s, r) => s?.messages?.length > 0 ? /* @__PURE__ */ m($, { children: [
300
- r === o - A && /* @__PURE__ */ e("tr", { ref: S }),
299
+ /* @__PURE__ */ e(Y, { children: c.slice(0, o).map((s, r) => s?.messages?.length > 0 ? /* @__PURE__ */ m(_, { children: [
300
+ r === o - A && /* @__PURE__ */ e("tr", { ref: O }),
301
301
  /* @__PURE__ */ e(M, { children: v.map(
302
- (p) => z(p, s, r)
302
+ (x) => z(x, s, r)
303
303
  ) })
304
304
  ] }, `${E.HISTORY.TITLE}-${s.id}-${r}`) : null) }),
305
305
  /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(a, { colSpan: 1e3, children: /* @__PURE__ */ e("div", { children: y(
@@ -1,6 +1,6 @@
1
1
  import { jsxs as n, jsx as t, Fragment as Q } from "react/jsx-runtime";
2
- import { I as Z, n as P, INFINITE_SCROLL_LIMIT as G, INFINITE_SCROLL_THRESHOLD as ee, LOCAL_STORAGE_PREFIX as y, LOCAL_STORAGE_SORT_TIMESTAMP as te, LOCAL_STORAGE_SORT_TOKEN_USAGE as re, LOCAL_STORAGE_SORT as ae, le as L, useUserPreferences as se, APP_CLASSNAME as oe, mutateCall as b, SERVICE_TYPES as x, setNewProvider as ie, ACTION_SORT as ne, pe as ce, TOAST_CHAT_DELETED as le, TOAST_PROVIDER_CHANGED as de, useChatsHistory as he, LOCAL_STORAGE_SEARCH as me, LOCAL_STORAGE_FAVORITES_ONLY as ue, HISTORY_TITLE as Ce, S as Se, Y as pe, debounce as Te, C as fe, ACTION_SEARCH as ye } from "./index.H6hFK3Q7.js";
3
- import { HistoryContext as z, ChatContext as M, useAiChat as Ee, E, e as m, ConfirmationPanel as ge, LazyToastContainerWrapper as Ae, showErrorToast as _e, CHAT_SET_PROVIDER as Oe, showSuccessToast as ve, CHAT_SET_STATUS as De, oe as Le, O as Re } from "./App.D3GdUdDt.js";
2
+ import { I as Z, n as P, INFINITE_SCROLL_LIMIT as G, INFINITE_SCROLL_THRESHOLD as ee, LOCAL_STORAGE_PREFIX as y, LOCAL_STORAGE_SORT_TIMESTAMP as te, LOCAL_STORAGE_SORT_TOKEN_USAGE as re, LOCAL_STORAGE_SORT as ae, pe as L, useUserPreferences as se, APP_CLASSNAME as oe, mutateCall as b, SERVICE_TYPES as x, TOAST_CHAT_DELETED as ie, setNewProvider as ne, ACTION_SORT as ce, fe as le, TOAST_PROVIDER_CHANGED as de, useChatsHistory as he, LOCAL_STORAGE_SEARCH as me, LOCAL_STORAGE_FAVORITES_ONLY as ue, HISTORY_TITLE as Ce, S as Se, Y as pe, debounce as Te, C as fe, ACTION_SEARCH as ye } from "./index.BCvnlzn1.js";
3
+ import { HistoryContext as z, ChatContext as M, useAiChat as Ee, E, e as m, ConfirmationPanel as ge, LazyToastContainerWrapper as Ae, showErrorToast as _e, CHAT_SET_PROVIDER as Oe, showSuccessToast as ve, CHAT_SET_STATUS as De, oe as Le, O as Re } from "./App.BUHkBnAs.js";
4
4
  import { useRef as H, useState as F, useContext as R, useCallback as ke, useEffect as U, Suspense as Ie, lazy as we } from "react";
5
5
  const Ne = ({
6
6
  className: l,
@@ -31,7 +31,7 @@ const Ne = ({
31
31
  ), be = we(
32
32
  () => import(
33
33
  /* webpackChunkName: "history-table" */
34
- "./ChatHistoryTable.C6Ksf3TE.js"
34
+ "./ChatHistoryTable.z1gXvLbS.js"
35
35
  ).then((l) => ({ default: l.ChatHistoryTable }))
36
36
  ), xe = ({
37
37
  filteredHistory: l,
@@ -56,7 +56,7 @@ const Ne = ({
56
56
  } = R(M), { setInput: N } = Ee(), [O, v] = E({
57
57
  key: y + te,
58
58
  initialValue: m.DESC
59
- }), [s, B] = E({
59
+ }), [a, B] = E({
60
60
  key: y + re,
61
61
  initialValue: m.ASC
62
62
  }), [, Y] = E({
@@ -66,22 +66,22 @@ const Ne = ({
66
66
  user: d?.username,
67
67
  getAccessToken: C
68
68
  }), $ = (e) => {
69
- const a = i.sortedCell === e;
69
+ const s = i.sortedCell === e;
70
70
  let r, D;
71
71
  switch (e) {
72
72
  case L:
73
- D = v, r = a ? i.sortDirection : O;
73
+ D = v, r = s ? i.sortDirection : O;
74
74
  break;
75
- case ce:
76
- D = B, r = a ? i.sortDirection : s;
75
+ case le:
76
+ D = B, r = s ? i.sortDirection : a;
77
77
  break;
78
78
  default:
79
- D = v, r = a ? i.sortDirection : O;
79
+ D = v, r = s ? i.sortDirection : O;
80
80
  break;
81
81
  }
82
82
  const V = r === m.ASC ? m.DESC : m.ASC;
83
83
  D(V), Y(e), A({
84
- type: ne,
84
+ type: ce,
85
85
  payload: {
86
86
  sortedCell: e,
87
87
  sortDirection: V
@@ -97,7 +97,7 @@ const Ne = ({
97
97
  userId: d?.username || "",
98
98
  id: e.id
99
99
  }
100
- }), u(""), await _e(le, {
100
+ }), u(""), await _e(ie, {
101
101
  autoClose: 2e3,
102
102
  containerId: "history-table"
103
103
  });
@@ -105,16 +105,16 @@ const Ne = ({
105
105
  }
106
106
  }, W = async (e) => {
107
107
  try {
108
- const a = await C(), r = await b({
109
- accessToken: a,
108
+ const s = await C(), r = await b({
109
+ accessToken: s,
110
110
  type: x.GET_CHAT,
111
111
  params: {
112
112
  id: e.id
113
113
  }
114
114
  });
115
- r.status === 200 && (r.data.provider !== f && (await ie({
115
+ r.data.provider !== f && (await ne({
116
116
  provider: r.data.provider,
117
- accessToken: a,
117
+ accessToken: s,
118
118
  username: d?.username || ""
119
119
  }), h({
120
120
  type: Oe,
@@ -133,7 +133,7 @@ const Ne = ({
133
133
  restoredModel: r.data?.model || "",
134
134
  restoredUsage: r.data?.tokenUsage || 0
135
135
  }
136
- }), N(""), w(e.id), _(r.data.messages), T(!1));
136
+ }), N(""), w(e.id), _(r.data.messages), T(!1);
137
137
  } catch {
138
138
  }
139
139
  }, X = (e) => {
@@ -144,14 +144,14 @@ const Ne = ({
144
144
  }, g(!c);
145
145
  }, q = async (e) => {
146
146
  try {
147
- (await b({
147
+ await b({
148
148
  accessToken: await C(),
149
149
  type: x.TOGGLE_FAVORITE_CHAT,
150
150
  params: {
151
151
  userId: d?.username || "",
152
152
  id: e.id
153
153
  }
154
- })).status === 200 && u("");
154
+ }), u("");
155
155
  } catch {
156
156
  }
157
157
  }, J = ke((e) => {
@@ -161,8 +161,8 @@ const Ne = ({
161
161
  const e = {
162
162
  // root: null,
163
163
  rootMargin: "20px"
164
- }, a = new IntersectionObserver(J, e);
165
- S.current && a.observe(S.current);
164
+ }, s = new IntersectionObserver(J, e);
165
+ S.current && s.observe(S.current);
166
166
  }), /* @__PURE__ */ n(Q, { children: [
167
167
  /* @__PURE__ */ n(
168
168
  ge,
@@ -232,20 +232,20 @@ const Ne = ({
232
232
  });
233
233
  U(() => {
234
234
  p && S(
235
- f ? p.filter((s) => s.favoriteChat === !0) : p
235
+ f ? p.filter((a) => a.favoriteChat === !0) : p
236
236
  );
237
237
  }, [p, f]);
238
- const _ = async (s) => {
239
- I(s), g({
238
+ const _ = async (a) => {
239
+ I(a), g({
240
240
  type: ye,
241
- payload: { searchString: s }
241
+ payload: { searchString: a }
242
242
  });
243
- }, N = Te((s) => {
244
- _(s.target.value.trim());
245
- }, 500), O = async (s) => {
246
- s.preventDefault();
247
- }, v = (s) => {
248
- w(s);
243
+ }, N = Te((a) => {
244
+ _(a.target.value.trim());
245
+ }, 500), O = async (a) => {
246
+ a.preventDefault();
247
+ }, v = (a) => {
248
+ w(a);
249
249
  };
250
250
  return /* @__PURE__ */ n(
251
251
  Le,
@@ -0,0 +1,158 @@
1
+ import { jsxs as t, Fragment as M, jsx as e } from "react/jsx-runtime";
2
+ import { preloadToast as B, showSuccessToast as G, showErrorToast as O, LazyToastContainerWrapper as j, oe as D } from "./App.BUHkBnAs.js";
3
+ import { n as K, i as W, useUserPreferences as Y, useServerCapabilities as H, Ee as $, setUserPlan as V, S as o, renderDataAsList as q, CARDS as r, L as E, j as l, C as J, it as Q, isTauri as X, te as Z, l as I, PROFILE_TITLE as ee } from "./index.BCvnlzn1.js";
4
+ import se from "clsx";
5
+ import { useState as L, useMemo as re, useCallback as k } from "react";
6
+ const ae = () => {
7
+ const {
8
+ isAuthenticated: d,
9
+ user: a,
10
+ registeringForPasskey: g,
11
+ authenticationType: w,
12
+ getAccessToken: m
13
+ } = K(), [y, S] = L(null), [N, b] = L(!1), v = W(), P = a?.username || "", {
14
+ data: h,
15
+ isSuccess: F,
16
+ refetch: f
17
+ } = Y({
18
+ user: a?.username,
19
+ getAccessToken: m
20
+ }), { data: p, isSuccess: u } = H(), T = re(() => !u || !p?.plans ? [] : p.plans.map((s) => ({
21
+ id: s.name,
22
+ label: s.label,
23
+ description: s.description,
24
+ features: s.features,
25
+ models: s.allowedModels.map(
26
+ (n) => $[n] || n
27
+ )
28
+ })), [u, p?.plans]), C = k(() => {
29
+ N || (B(), b(!0));
30
+ }, [N]), x = k(
31
+ async (s, n) => {
32
+ if (!(!a?.username || s === h?.plan))
33
+ try {
34
+ S(s), await V({
35
+ plan: s,
36
+ accessToken: await m(),
37
+ username: a.username
38
+ }), await f(), await G(`${r.PLANS.SWITCH_SUCCESS} ${n}`, {
39
+ containerId: "profile-plan-selection"
40
+ });
41
+ } catch {
42
+ await O(r.PLANS.SWITCH_ERROR, {
43
+ containerId: "profile-plan-selection"
44
+ });
45
+ } finally {
46
+ S(null);
47
+ }
48
+ },
49
+ [m, h?.plan, f, a?.username]
50
+ );
51
+ return d && P ? /* @__PURE__ */ t(M, { children: [
52
+ /* @__PURE__ */ e("div", { className: "av-sassy", children: /* @__PURE__ */ e(j, { containerId: "profile-plan-selection" }) }),
53
+ /* @__PURE__ */ e(
54
+ o,
55
+ {
56
+ header: r.PREFERENCES.TITLE,
57
+ className: "prose-dark dark:prose-lighter",
58
+ noBorder: !0,
59
+ children: q(v, {
60
+ [r.PREFERENCES.USERNAME]: P,
61
+ [r.PREFERENCES.EMAIL]: a?.email || ""
62
+ })
63
+ }
64
+ ),
65
+ F && u && T.length > 0 && /* @__PURE__ */ t(
66
+ o,
67
+ {
68
+ header: r.PLANS.TITLE,
69
+ className: "prose-dark dark:prose-lighter mt-4",
70
+ noBorder: !0,
71
+ children: [
72
+ /* @__PURE__ */ e("p", { className: "text-sm", children: r.PLANS.DESCRIPTION }),
73
+ /* @__PURE__ */ e(E, { columnGap: 3, rowGap: 3, className: "mt-4", children: T.map(({ id: s, label: n, description: R, features: U, models: _ }) => {
74
+ const c = h?.plan === s, z = c ? r.PLANS.ACTIVE_BADGE : `Get ${n}`, A = y === s;
75
+ return /* @__PURE__ */ e(l, { span: { fallback: 12, md: 4 }, children: /* @__PURE__ */ e(o, { mode: "darker", className: "prose-lighter h-full", children: /* @__PURE__ */ t(E, { direction: "column", children: [
76
+ /* @__PURE__ */ t(l, { children: [
77
+ /* @__PURE__ */ e("div", { className: "flex items-start justify-between gap-2", children: /* @__PURE__ */ t("div", { children: [
78
+ /* @__PURE__ */ e(
79
+ "h3",
80
+ {
81
+ className: se("m-0", {
82
+ "text-emerald-400": c
83
+ }),
84
+ children: n
85
+ }
86
+ ),
87
+ /* @__PURE__ */ e("p", { className: "mb-0 text-sm opacity-80", children: R })
88
+ ] }) }),
89
+ /* @__PURE__ */ e("h4", { children: "Features" }),
90
+ /* @__PURE__ */ e("ul", { className: "prose-li:text-sm", children: U.map((i) => /* @__PURE__ */ e("li", { children: i }, i)) }),
91
+ /* @__PURE__ */ e("h4", { children: "Models" }),
92
+ /* @__PURE__ */ e("ul", { className: "prose-li:text-sm", children: _.map((i) => /* @__PURE__ */ e("li", { children: i }, i)) })
93
+ ] }),
94
+ /* @__PURE__ */ e(l, { children: /* @__PURE__ */ e(
95
+ J,
96
+ {
97
+ mode: "dark",
98
+ size: "small",
99
+ variant: c ? "selected" : "secondary",
100
+ className: "mt-4",
101
+ fullWidth: !0,
102
+ disabled: c || A,
103
+ onClick: async () => {
104
+ await x(s, n);
105
+ },
106
+ onMouseEnter: C,
107
+ onFocus: C,
108
+ children: A ? "Updating..." : z
109
+ }
110
+ ) })
111
+ ] }) }) }, s);
112
+ }) })
113
+ ]
114
+ }
115
+ ),
116
+ w !== Q.PASSKEY && !X() && /* @__PURE__ */ t(
117
+ o,
118
+ {
119
+ className: "prose-dark dark:prose-lighter mt-4",
120
+ noBorder: !0,
121
+ header: /* @__PURE__ */ e("h2", { className: "m-0", children: /* @__PURE__ */ t(E, { columnGap: 3, alignVertical: "center", children: [
122
+ /* @__PURE__ */ e(l, { children: /* @__PURE__ */ e(I, { size: "size-8" }) }),
123
+ /* @__PURE__ */ e(l, { children: /* @__PURE__ */ e("div", { children: r.PREFERENCES.PASSKEY_TITLE }) })
124
+ ] }) }),
125
+ children: [
126
+ /* @__PURE__ */ e("p", { children: r.PREFERENCES.PASSKEY_INSTRUCTIONS }),
127
+ /* @__PURE__ */ e(
128
+ Z,
129
+ {
130
+ variant: "selected",
131
+ size: "small",
132
+ className: "mt-2",
133
+ onClick: g,
134
+ labelLeft: r.PREFERENCES.PASSKEY_BUTTON,
135
+ children: /* @__PURE__ */ e(I, { size: "size-5", monotone: !0 })
136
+ }
137
+ )
138
+ ]
139
+ }
140
+ )
141
+ ] }) : null;
142
+ }, oe = ({
143
+ open: d,
144
+ onOpenChange: a
145
+ }) => /* @__PURE__ */ e(
146
+ D,
147
+ {
148
+ open: d,
149
+ onOpenChange: a,
150
+ title: ee,
151
+ animation: !0,
152
+ animationType: "fade",
153
+ children: /* @__PURE__ */ e(ae, {})
154
+ }
155
+ );
156
+ export {
157
+ oe as Profile
158
+ };