@versini/sassysaint 8.95.2 → 8.96.1

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.DdgvmVh8.js → AboutChangelog.5H3s6hXQ.js} +3 -3
  2. package/dist/chunks/{AboutEntry.C1fW0jZw.js → AboutEntry.DXuBTI5j.js} +5 -5
  3. package/dist/chunks/{App.DomZi2aY.js → App.DLUrB4o3.js} +16 -16
  4. package/dist/chunks/{Chart.BMd37BRy.js → Chart.DI3FUiHS.js} +2 -2
  5. package/dist/chunks/{ChatBubbleAssistant.D_DGnRoF.js → ChatBubbleAssistant.DWmnAQaK.js} +4 -4
  6. package/dist/chunks/{ChatBubbleUser.DIUzEpFf.js → ChatBubbleUser.JLxLbGEM.js} +3 -3
  7. package/dist/chunks/{ChatHistoryTable.BZukzMZV.js → ChatHistoryTable.BRWZcHZc.js} +3 -3
  8. package/dist/chunks/{HistoryEntry.YA7ItX-L.js → HistoryEntry.oGDvXnWV.js} +3 -3
  9. package/dist/chunks/{ProfileEntry.BC2dQx_a.js → ProfileEntry.61BaHgn1.js} +2 -2
  10. package/dist/chunks/{SettingsEntry.DLEokqwd.js → SettingsEntry.E4VKXtoi.js} +3 -3
  11. package/dist/chunks/UsageEntry.XdEYO506.js +245 -0
  12. package/dist/chunks/{UserMemoriesPanel.Bwn0qtvT.js → UserMemoriesPanel.C7ti4Lwv.js} +4 -4
  13. package/dist/chunks/{index.C85CKsp_.js → index.C4VZ7mpR.js} +2 -2
  14. package/dist/chunks/{index.CX9vPRQx.js → index.CLQ0Bsht.js} +1 -1
  15. package/dist/chunks/{index.5FXpZklE.js → index.CVOBsWzS.js} +1 -1
  16. package/dist/chunks/{index.CouwP20c.js → index.DSodEAJa.js} +1 -1
  17. package/dist/chunks/{index.CNgGh8z9.js → index.DVqhEqAN.js} +1 -1
  18. package/dist/chunks/{index.DKR7ObRa.js → index.Dqtte2J_.js} +3 -3
  19. package/dist/chunks/{index.Waig1B4B.js → index.EWH6k6x-.js} +1 -1
  20. package/dist/chunks/{index.V-Ja2hIJ.js → index.GNlaCbH7.js} +1 -1
  21. package/dist/chunks/{index.CADoaCBK.js → index.joz2BwFF.js} +106 -102
  22. package/dist/chunks/{useMarkdown.CUfOdxCR.js → useMarkdown.D67s_hlv.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 +4 -4
  27. package/dist/chunks/UsageEntry.BXGCnO1N.js +0 -240
@@ -1,240 +0,0 @@
1
- import { jsxs as d, jsx as e } from "react/jsx-runtime";
2
- import { n as X, useUniqueId as Z, useUserChatStats as J, useLocalStorage as g, LOCAL_STORAGE_PREFIX as _, LOCAL_STORAGE_USAGE_VIEW_MODE as Q, LOCAL_STORAGE_USAGE_TIME_RANGE as $, TIME_RANGES as t, LOCAL_STORAGE_USAGE_SELECTED_MONTH as ee, useChatsUsage as te, USAGE_TITLE as ne, Card as Y, CARDS as T, L as A, j as c, TIME_RANGE_LABELS as k, MONTHS as N, ButtonIcon as u, IconChart as re, IconSelected as P, IconUnSelected as b, IconPrevious as le, IconNext as se, renderDataAsList as ae, Button as oe, pluralize as D } from "./index.CADoaCBK.js";
3
- import { Panel as ie, Menu as x, MenuGroupLabel as ce, MenuItem as G } from "./App.DomZi2aY.js";
4
- import { useState as U, Suspense as de, lazy as Te } from "react";
5
- const a = [0, 3, 6, 9], s = {
6
- TOKEN: "token",
7
- MODEL: "model"
8
- }, ue = [
9
- t.TODAY,
10
- t.YESTERDAY,
11
- t.CURRENT_YEAR,
12
- t.LAST_YEAR
13
- ], Ee = Te(
14
- () => import(
15
- /* webpackChunkName: "chart-highcharts" */
16
- "./Chart.BMd37BRy.js"
17
- )
18
- ), me = ({
19
- open: v,
20
- onOpenChange: R
21
- }) => {
22
- const { getAccessToken: L, user: p } = X(), H = Z(), { data: o, isSuccess: F } = J({
23
- user: p?.username,
24
- getAccessToken: L
25
- }), f = Math.floor((/* @__PURE__ */ new Date()).getMonth() / 3) * 3, [m, C] = U(f), [i, z] = g({
26
- key: _ + Q,
27
- initialValue: s.MODEL
28
- }), [r, E] = g({
29
- key: _ + $,
30
- initialValue: t.CURRENT_YEAR
31
- }), [l, S] = g({
32
- key: _ + ee,
33
- initialValue: null
34
- }), [B, y] = U(
35
- (/* @__PURE__ */ new Date()).getFullYear()
36
- ), { data: h, isSuccess: V } = te({
37
- user: p?.username,
38
- getAccessToken: L,
39
- timeRange: r,
40
- month: r === t.SPECIFIC_MONTH && l !== null ? String(l) : void 0,
41
- year: r === t.SPECIFIC_MONTH ? String(B) : void 0,
42
- timezone: Intl.DateTimeFormat().resolvedOptions().timeZone
43
- }), K = (n) => {
44
- if (n.preventDefault(), r === t.TODAY || r === t.YESTERDAY) {
45
- E(
46
- r === t.TODAY ? t.YESTERDAY : t.TODAY
47
- );
48
- return;
49
- }
50
- if (r === t.SPECIFIC_MONTH && l !== null) {
51
- const M = (l + 1) % 12;
52
- S(M);
53
- return;
54
- }
55
- const O = (a.indexOf(m) + 1) % a.length;
56
- C(a[O]);
57
- }, j = (n) => {
58
- if (n.preventDefault(), r === t.TODAY || r === t.YESTERDAY) {
59
- E(
60
- r === t.TODAY ? t.YESTERDAY : t.TODAY
61
- );
62
- return;
63
- }
64
- if (r === t.SPECIFIC_MONTH && l !== null) {
65
- const M = (l - 1 + 12) % 12;
66
- S(M);
67
- return;
68
- }
69
- const O = (a.indexOf(m) - 1 + a.length) % a.length;
70
- C(a[O]);
71
- }, w = (n) => {
72
- E(n), n !== t.SPECIFIC_MONTH && S(null), (n === t.CURRENT_YEAR || n === t.LAST_YEAR) && C(f);
73
- }, W = (n) => {
74
- S(n), y((/* @__PURE__ */ new Date()).getFullYear()), E(t.SPECIFIC_MONTH);
75
- }, q = () => r === t.SPECIFIC_MONTH && l !== null ? N[l] : k[r];
76
- return /* @__PURE__ */ d(
77
- ie,
78
- {
79
- open: v,
80
- onOpenChange: R,
81
- title: ne,
82
- animation: !0,
83
- animationType: "fade",
84
- blurEffect: "large",
85
- footer: /* @__PURE__ */ e(
86
- A,
87
- {
88
- columnGap: 2,
89
- alignHorizontal: "flex-end",
90
- className: "pb-8 sm:pb-0",
91
- children: /* @__PURE__ */ e(c, { children: /* @__PURE__ */ e(
92
- oe,
93
- {
94
- mode: "dark",
95
- variant: "secondary",
96
- focusMode: "light",
97
- noBorder: !0,
98
- onClick: () => R(!1),
99
- children: "Dismiss"
100
- }
101
- ) })
102
- }
103
- ),
104
- children: [
105
- /* @__PURE__ */ e(
106
- Y,
107
- {
108
- header: T.MAIN_STATISTICS.USAGE,
109
- className: "prose-dark dark:prose-lighter mb-4 min-h-[578px]",
110
- noBorder: !0,
111
- children: V && h ? /* @__PURE__ */ d(de, { fallback: /* @__PURE__ */ e("div", {}), children: [
112
- /* @__PURE__ */ e(A, { className: "mb-2", alignHorizontal: "center", children: /* @__PURE__ */ e(c, { children: /* @__PURE__ */ d(
113
- x,
114
- {
115
- mode: "dark",
116
- focusMode: "light",
117
- trigger: /* @__PURE__ */ e(
118
- u,
119
- {
120
- noBorder: !0,
121
- variant: "selected",
122
- size: "small",
123
- labelRight: q(),
124
- children: /* @__PURE__ */ e(re, { className: "mr-1", size: "size-4" })
125
- }
126
- ),
127
- defaultPlacement: "bottom-start",
128
- children: [
129
- /* @__PURE__ */ e(ce, { children: "Date Range" }),
130
- ue.map((n) => /* @__PURE__ */ e(
131
- G,
132
- {
133
- label: k[n],
134
- selected: r === n,
135
- onClick: () => w(n)
136
- },
137
- n
138
- )),
139
- /* @__PURE__ */ e(x, { label: "Month", children: N.map((n, I) => /* @__PURE__ */ e(
140
- G,
141
- {
142
- label: n,
143
- selected: r === t.SPECIFIC_MONTH && l === I,
144
- onClick: () => W(I)
145
- },
146
- n
147
- )) })
148
- ]
149
- }
150
- ) }) }),
151
- /* @__PURE__ */ d(A, { className: "mb-2", alignHorizontal: "center", columnGap: 2, children: [
152
- /* @__PURE__ */ e(c, { children: /* @__PURE__ */ e(
153
- u,
154
- {
155
- onClick: () => z(s.MODEL),
156
- labelRight: "Model Usage",
157
- noBorder: !0,
158
- size: "small",
159
- mode: i === s.MODEL ? "light" : "dark",
160
- children: i === s.MODEL ? /* @__PURE__ */ e(P, { size: "size-4" }) : /* @__PURE__ */ e(b, { size: "size-4" })
161
- }
162
- ) }),
163
- /* @__PURE__ */ e(c, { children: /* @__PURE__ */ e(
164
- u,
165
- {
166
- onClick: () => z(s.TOKEN),
167
- labelRight: "Token Usage",
168
- noBorder: !0,
169
- size: "small",
170
- mode: i === s.TOKEN ? "light" : "dark",
171
- children: i === s.TOKEN ? /* @__PURE__ */ e(P, { size: "size-4" }) : /* @__PURE__ */ e(b, { size: "size-4" })
172
- }
173
- ) })
174
- ] }),
175
- /* @__PURE__ */ e(
176
- Ee,
177
- {
178
- tokenUsage: i === s.TOKEN ? h.tokenUsage?.series || [] : h.modelUsage?.series || [],
179
- page: m,
180
- viewMode: i,
181
- timeRange: r,
182
- categories: h.categories,
183
- chartTitle: r === t.SPECIFIC_MONTH && l !== null ? N[l] : void 0
184
- }
185
- ),
186
- /* @__PURE__ */ d(A, { className: "mt-2", alignHorizontal: "center", columnGap: 2, children: [
187
- /* @__PURE__ */ e(c, { children: /* @__PURE__ */ e(
188
- u,
189
- {
190
- noBorder: !0,
191
- size: "small",
192
- label: "Previous",
193
- onClick: j,
194
- children: /* @__PURE__ */ e(le, { size: "size-4" })
195
- }
196
- ) }),
197
- /* @__PURE__ */ e(c, { children: /* @__PURE__ */ e(
198
- u,
199
- {
200
- noBorder: !0,
201
- size: "small",
202
- label: "Next",
203
- onClick: K,
204
- children: /* @__PURE__ */ e(se, { size: "size-4" })
205
- }
206
- ) })
207
- ] })
208
- ] }) : null
209
- }
210
- ),
211
- /* @__PURE__ */ e(
212
- Y,
213
- {
214
- header: T.MAIN_STATISTICS.TITLE,
215
- className: "prose-dark dark:prose-lighter min-h-[170px]",
216
- noBorder: !0,
217
- children: F ? ae(
218
- H,
219
- {
220
- [D(T.MAIN_STATISTICS.TOTAL, o.totalChats)]: o.totalChats,
221
- [D(
222
- T.MAIN_STATISTICS.TOTAL_PRIVATE,
223
- o.privateChats
224
- )]: o.privateChats,
225
- [D(
226
- T.MAIN_STATISTICS.TOTAL_DELETED,
227
- o.deletedChats
228
- )]: o.deletedChats
229
- },
230
- !0
231
- ) : null
232
- }
233
- )
234
- ]
235
- }
236
- );
237
- };
238
- export {
239
- me as Usage
240
- };