@versini/sassysaint 8.110.0 → 8.110.2

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 (88) hide show
  1. package/dist/chunks/{AboutChangelog.BfOWMaYg.js → AboutChangelog.DEj7-6K6.js} +2 -2
  2. package/dist/chunks/AboutEntry.BSWdup9R.js +77 -0
  3. package/dist/chunks/{App.BD0e8HgV.js → App.Hqmg5y2Y.js} +2435 -2452
  4. package/dist/chunks/{Bubble.fxUgvZMG.js → Bubble.DJc-QO-3.js} +1 -1
  5. package/dist/chunks/ButtonIconDelete.D4aZDe7F.js +335 -0
  6. package/dist/chunks/{Chart.C-EqsPgy.js → Chart.CPv5Bfk9.js} +2 -2
  7. package/dist/chunks/{ChatBubbleAssistant.hM8owVIk.js → ChatBubbleAssistant.DqUdvWwl.js} +4 -4
  8. package/dist/chunks/{ChatBubbleUser.CnsuEhxO.js → ChatBubbleUser.Cs4LFprm.js} +3 -3
  9. package/dist/chunks/{ChatHistoryTable.WRplbgo4.js → ChatHistoryTable.CkVMdj9x.js} +73 -73
  10. package/dist/chunks/{HistoryEntry.BgO_PD7Q.js → HistoryEntry.DM331KtZ.js} +72 -80
  11. package/dist/chunks/LoginEntry.Cvod0kbl.js +118 -0
  12. package/dist/chunks/{LogoEntry.CucXks5G.js → LogoEntry.DohsYXa0.js} +642 -746
  13. package/dist/chunks/MemoriesEntry.DJEsuqmV.js +649 -0
  14. package/dist/chunks/ProfileEntry.DHOE716m.js +205 -0
  15. package/dist/chunks/{SettingsEntry.ByPtC4lj.js → SettingsEntry.6_BWb1qD.js} +114 -122
  16. package/dist/chunks/UsageEntry.CtQKtTac.js +230 -0
  17. package/dist/chunks/{_baseUniq.DJhemj5B.js → _baseUniq.DdHdSR90.js} +1 -1
  18. package/dist/chunks/{arc.ClK0mYh2.js → arc.D4_xOXXj.js} +1 -1
  19. package/dist/chunks/{architecture-U656AL7Q.DGORleeb.js → architecture-U656AL7Q.s3rGBRgV.js} +1 -1
  20. package/dist/chunks/{architectureDiagram-VXUJARFQ.HR_eet_T.js → architectureDiagram-VXUJARFQ.CdCO91E5.js} +4 -4
  21. package/dist/chunks/{blockDiagram-VD42YOAC.CWrnXf_B.js → blockDiagram-VD42YOAC.CCDa9IbF.js} +5 -5
  22. package/dist/chunks/{browser.5ieI9QUP.js → browser.G7msF8GI.js} +1 -1
  23. package/dist/chunks/{c4Diagram-YG6GDRKO.CaA0SaMc.js → c4Diagram-YG6GDRKO.BYwrdrnm.js} +2 -2
  24. package/dist/chunks/{channel.BI8KZVUl.js → channel.Bhd_WAGN.js} +1 -1
  25. package/dist/chunks/{chunk-4BX2VUAB.CTzK9jPw.js → chunk-4BX2VUAB.CAsx7lRR.js} +1 -1
  26. package/dist/chunks/{chunk-55IACEB6.DMb8Reca.js → chunk-55IACEB6.ChwKLiO_.js} +1 -1
  27. package/dist/chunks/{chunk-B4BG7PRW.BHBa3N2V.js → chunk-B4BG7PRW.0XXdIUvB.js} +4 -4
  28. package/dist/chunks/{chunk-DI55MBZ5.Bqwg_jpX.js → chunk-DI55MBZ5.PoYuLfqT.js} +3 -3
  29. package/dist/chunks/{chunk-FMBD7UC4.p8OpoFJE.js → chunk-FMBD7UC4.ClQPaEEe.js} +1 -1
  30. package/dist/chunks/{chunk-QN33PNHL._xYLGQNv.js → chunk-QN33PNHL.BNHDFW8q.js} +1 -1
  31. package/dist/chunks/{chunk-QZHKN3VN.Bt1FHb64.js → chunk-QZHKN3VN.YjxD8GE7.js} +1 -1
  32. package/dist/chunks/{chunk-TZMSLE5B.hFsU0iJf.js → chunk-TZMSLE5B.CTNar1je.js} +1 -1
  33. package/dist/chunks/{classDiagram-2ON5EDUG.DiSJfiEu.js → classDiagram-2ON5EDUG.Ccr_Z8SZ.js} +2 -2
  34. package/dist/chunks/{classDiagram-v2-WZHVMYZB.DiSJfiEu.js → classDiagram-v2-WZHVMYZB.Ccr_Z8SZ.js} +2 -2
  35. package/dist/chunks/{clone.NcwizCyH.js → clone.BX8gciZV.js} +1 -1
  36. package/dist/chunks/{cose-bilkent-S5V4N54A.DogEbzcD.js → cose-bilkent-S5V4N54A.CJs1QiYn.js} +2 -2
  37. package/dist/chunks/{dagre-6UL2VRFP.Cy_GltZx.js → dagre-6UL2VRFP.DL9dVBGy.js} +5 -5
  38. package/dist/chunks/{diagram-PSM6KHXK.CazeYJ2F.js → diagram-PSM6KHXK.BlxCy0Sy.js} +4 -4
  39. package/dist/chunks/{diagram-QEK2KX5R.ByhZHDpm.js → diagram-QEK2KX5R.BWDu5W6C.js} +3 -3
  40. package/dist/chunks/{diagram-S2PKOQOG.D49-fpQd.js → diagram-S2PKOQOG.Ri3EElHD.js} +3 -3
  41. package/dist/chunks/{erDiagram-Q2GNP2WA.nce3gDBb.js → erDiagram-Q2GNP2WA.DEiFjTBB.js} +4 -4
  42. package/dist/chunks/{flowDiagram-NV44I4VS.DDUGMSKf.js → flowDiagram-NV44I4VS.BW00PHx7.js} +5 -5
  43. package/dist/chunks/{ganttDiagram-JELNMOA3.NGXzLkaH.js → ganttDiagram-JELNMOA3.ema0-IHx.js} +2 -2
  44. package/dist/chunks/{gitGraph-F6HP7TQM.BzKXexyv.js → gitGraph-F6HP7TQM.D7K-i_h_.js} +1 -1
  45. package/dist/chunks/{gitGraphDiagram-NY62KEGX.C3cn9f8o.js → gitGraphDiagram-NY62KEGX.D4HvM8U6.js} +4 -4
  46. package/dist/chunks/{graph.CURTRirk.js → graph.WmSD_kIW.js} +2 -2
  47. package/dist/chunks/{index.DAuo-OH1.js → index.5YcMrbtG.js} +1 -1
  48. package/dist/chunks/{index.BYDZbdMZ.js → index.BDdSIqNw.js} +1 -1
  49. package/dist/chunks/{index.CBEv2y_C.js → index.BRIbdI1P.js} +2 -2
  50. package/dist/chunks/{index.BinkIORG.js → index.CUKXvrUy.js} +1 -1
  51. package/dist/chunks/{index.gy41K1EE.js → index.CspNN5N2.js} +3 -3
  52. package/dist/chunks/{index.uUNtrS04.js → index.Damzobcg.js} +3 -3
  53. package/dist/chunks/{index.BqIARWUR.js → index.HEruAaRk.js} +1 -1
  54. package/dist/chunks/{index.CkajM1v0.js → index.OMR8Uuyn.js} +1 -1
  55. package/dist/chunks/{index.CURM9PiU.js → index.fRQVHuxk.js} +1 -1
  56. package/dist/chunks/{info-NVLQJR56.CHnZmbT7.js → info-NVLQJR56.jYI0Duob.js} +1 -1
  57. package/dist/chunks/{infoDiagram-WHAUD3N6.DCZfKYU8.js → infoDiagram-WHAUD3N6.BqOPFyGl.js} +2 -2
  58. package/dist/chunks/{journeyDiagram-XKPGCS4Q.B-0JNmK_.js → journeyDiagram-XKPGCS4Q.B1bd5wZT.js} +4 -4
  59. package/dist/chunks/{kanban-definition-3W4ZIXB7.C7aI8iBJ.js → kanban-definition-3W4ZIXB7.CXydmjo0.js} +2 -2
  60. package/dist/chunks/{layout.Bmgsrc8X.js → layout.D0fWXkiy.js} +4 -4
  61. package/dist/chunks/{mermaid-parser.core.BZIZyjyF.js → mermaid-parser.core.7OYqXvcF.js} +10 -10
  62. package/dist/chunks/{min.CtR4qhyM.js → min.DULzPnFA.js} +2 -2
  63. package/dist/chunks/{mindmap-definition-VGOIOE7T.DCsxzuhI.js → mindmap-definition-VGOIOE7T.BUC8Tuhp.js} +3 -3
  64. package/dist/chunks/{packet-BFZMPI3H.CQ2Sbdms.js → packet-BFZMPI3H.D_-dNPlf.js} +1 -1
  65. package/dist/chunks/{pie-7BOR55EZ.BYs1omMd.js → pie-7BOR55EZ.C5wUCEk_.js} +1 -1
  66. package/dist/chunks/{pieDiagram-ADFJNKIX.DqkDHdMo.js → pieDiagram-ADFJNKIX.DOCTIr8o.js} +4 -4
  67. package/dist/chunks/{quadrantDiagram-AYHSOK5B.Cx-eq1uu.js → quadrantDiagram-AYHSOK5B.DbasmgIr.js} +1 -1
  68. package/dist/chunks/{radar-NHE76QYJ.CIqwL1Hw.js → radar-NHE76QYJ.D-zD079S.js} +1 -1
  69. package/dist/chunks/{rehype-mermaid.LJaY9ylI.js → rehype-mermaid.C6-wTJWi.js} +33 -33
  70. package/dist/chunks/{requirementDiagram-UZGBJVZJ.C-YKp79x.js → requirementDiagram-UZGBJVZJ.CnuUJN5O.js} +3 -3
  71. package/dist/chunks/{sankeyDiagram-TZEHDZUN.BbfUzvVS.js → sankeyDiagram-TZEHDZUN.R_1cgZZg.js} +1 -1
  72. package/dist/chunks/{sequenceDiagram-WL72ISMW.D5wDvZwT.js → sequenceDiagram-WL72ISMW.sCa2kzuv.js} +3 -3
  73. package/dist/chunks/{stateDiagram-FKZM4ZOC.-65PQCxm.js → stateDiagram-FKZM4ZOC.DczjcrsN.js} +4 -4
  74. package/dist/chunks/{stateDiagram-v2-4FDKWEC3.BXy_3BUS.js → stateDiagram-v2-4FDKWEC3.DwOAdSSj.js} +2 -2
  75. package/dist/chunks/{timeline-definition-IT6M3QCI.B2tmtGDZ.js → timeline-definition-IT6M3QCI.Qx0o1egT.js} +2 -2
  76. package/dist/chunks/{treemap-KMMF4GRG.Dm_alnmO.js → treemap-KMMF4GRG.CwfQGJx8.js} +1 -1
  77. package/dist/chunks/{useMarkdown.BWJCktGN.js → useMarkdown.CZvYSQuE.js} +8 -8
  78. package/dist/chunks/{xychartDiagram-PRI3JC2R.XQCHu3eO.js → xychartDiagram-PRI3JC2R.CFOiW2rk.js} +1 -1
  79. package/dist/components/SassySaint/SassySaint.js +1 -1
  80. package/dist/index.js +3 -3
  81. package/dist/style.css +1 -1
  82. package/package.json +4 -4
  83. package/dist/chunks/AboutEntry.B7fBRGac.js +0 -85
  84. package/dist/chunks/ButtonIconDelete.Bw7zU6Rb.js +0 -456
  85. package/dist/chunks/LoginEntry.DvDNWT7T.js +0 -118
  86. package/dist/chunks/MemoriesEntry.OQ1K4KNa.js +0 -743
  87. package/dist/chunks/ProfileEntry.CbZLIK8x.js +0 -213
  88. package/dist/chunks/UsageEntry.CSkPteMr.js +0 -238
@@ -1,743 +0,0 @@
1
- import { jsx as e, jsxs as r, Fragment as D } from "react/jsx-runtime";
2
- import { n as Se, LOCAL_STORAGE_PREFIX as ee, LOCAL_STORAGE_SORT_MEMORY_DIRECTION as Te, LOCAL_STORAGE_SORT_MEMORY_COLUMN as we, useUserMemories as De, useExpiredMemories as ve, useDeleteMemory as Ee, useDeleteAllActiveMemories as Me, useDeleteAllExpiredMemories as be, useUpdateMemory as Re, useRestoreMemory as Ie } from "./index.CBEv2y_C.js";
3
- import { L as R, j as f, Button as _, e as l, ButtonIcon as G, IconEdit as Le, IconRestore as Oe, IconDelete as _e } from "./LogoEntry.CucXks5G.js";
4
- import { Panel as ce, Toggle as L, ButtonCancel as se, useLocalStorage as te, ConfirmationPanel as re, ResponsiveTooltip as U } from "./App.BD0e8HgV.js";
5
- import { H as ie, F as oe, q as v, O as c, J as O, Y as ne, ButtonIconDelete as ze, G as le } from "./ButtonIconDelete.Bw7zU6Rb.js";
6
- import C from "clsx";
7
- import { useState as N, useEffect as Be, useRef as q } from "react";
8
- import { TextArea as Pe } from "./index.DAuo-OH1.js";
9
- const Fe = ({
10
- open: k,
11
- onOpenChange: E,
12
- initialText: d,
13
- metadata: o,
14
- onSave: y,
15
- isSaving: M = !1
16
- }) => {
17
- const [s, b] = N(d), [A, p] = N("none");
18
- Be(() => {
19
- if (k) {
20
- b(d);
21
- const n = o?.expiration || "none";
22
- p(n);
23
- }
24
- }, [k, d, o?.expiration]);
25
- const z = () => {
26
- if (s.trim().length >= 3) {
27
- const n = A === "none" ? null : A;
28
- y(s.trim(), n);
29
- }
30
- }, T = s.trim().length >= 3, h = s.trim() !== d.trim() || A !== (o?.expiration || "none");
31
- return /* @__PURE__ */ e(
32
- ce,
33
- {
34
- open: k,
35
- onOpenChange: E,
36
- title: "Edit Memory",
37
- animation: !0,
38
- animationType: "fade",
39
- footer: /* @__PURE__ */ r(R, { columnGap: 2, alignHorizontal: "flex-end", children: [
40
- /* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(se, { onOpenChange: E, label: "Cancel" }) }),
41
- /* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(
42
- _,
43
- {
44
- mode: "dark",
45
- focusMode: "light",
46
- disabled: M || !T || !h,
47
- onClick: z,
48
- children: M ? "Saving..." : "Save"
49
- }
50
- ) })
51
- ] }),
52
- children: /* @__PURE__ */ r("div", { className: "flex flex-col pt-2 gap-4", children: [
53
- /* @__PURE__ */ e(
54
- Pe,
55
- {
56
- mode: "dark",
57
- focusMode: "light",
58
- label: "Memory text",
59
- name: "memoryText",
60
- value: s,
61
- onChange: (n) => b(n.target.value),
62
- autoFocus: !0,
63
- helperText: s.trim().length < 3 ? "Memory text must be at least 3 characters" : `${s.length} characters`
64
- }
65
- ),
66
- /* @__PURE__ */ r("div", { className: "flex flex-col gap-3 p-4 bg-surface-darker rounded-md", children: [
67
- /* @__PURE__ */ e("h3", { className: "text-sm m-0", children: "Memory Expiration" }),
68
- /* @__PURE__ */ e("p", { className: "text-xs text-copy-medium m-0", children: "Set when this memory should expire and be automatically removed." }),
69
- /* @__PURE__ */ r("div", { className: "flex flex-col gap-2", children: [
70
- /* @__PURE__ */ e(
71
- L,
72
- {
73
- mode: "dark",
74
- focusMode: "light",
75
- noBorder: !0,
76
- narrow: !0,
77
- label: "Never expire",
78
- name: "expiration-none",
79
- checked: A === "none",
80
- onChange: (n) => {
81
- n && p("none");
82
- }
83
- }
84
- ),
85
- /* @__PURE__ */ e(
86
- L,
87
- {
88
- mode: "dark",
89
- focusMode: "light",
90
- noBorder: !0,
91
- narrow: !0,
92
- label: "Short (1 month)",
93
- name: "expiration-short",
94
- checked: A === "short",
95
- onChange: (n) => {
96
- n && p("short");
97
- }
98
- }
99
- ),
100
- /* @__PURE__ */ e(
101
- L,
102
- {
103
- mode: "dark",
104
- focusMode: "light",
105
- noBorder: !0,
106
- narrow: !0,
107
- label: "Medium (6 months)",
108
- name: "expiration-medium",
109
- checked: A === "medium",
110
- onChange: (n) => {
111
- n && p("medium");
112
- }
113
- }
114
- ),
115
- /* @__PURE__ */ e(
116
- L,
117
- {
118
- mode: "dark",
119
- focusMode: "light",
120
- noBorder: !0,
121
- narrow: !0,
122
- label: "Long (1 year)",
123
- name: "expiration-long",
124
- checked: A === "long",
125
- onChange: (n) => {
126
- n && p("long");
127
- }
128
- }
129
- )
130
- ] })
131
- ] }),
132
- o && /* @__PURE__ */ r("div", { className: "flex flex-col gap-3 p-4 bg-surface-darker rounded-md", children: [
133
- /* @__PURE__ */ e("h3", { className: "text-sm m-0", children: "Memory Details" }),
134
- o.categories && o.categories.length > 0 && /* @__PURE__ */ r("div", { className: "flex flex-col gap-1", children: [
135
- /* @__PURE__ */ e("span", { className: "text-xs text-copy-medium uppercase", children: "Category" }),
136
- /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1", children: o.categories.map((n, u) => /* @__PURE__ */ e(
137
- "span",
138
- {
139
- className: "text-xs px-2 py-1 text-copy-light rounded",
140
- children: n
141
- },
142
- `${n}-${u}`
143
- )) })
144
- ] }),
145
- /* @__PURE__ */ r("div", { className: "flex flex-col sm:flex-row gap-4", children: [
146
- /* @__PURE__ */ r("div", { className: "flex flex-col gap-3 sm:flex-1", children: [
147
- o.confidence !== void 0 && o.confidence !== null && /* @__PURE__ */ r("div", { className: "flex flex-col gap-1", children: [
148
- /* @__PURE__ */ e("span", { className: "text-xs text-copy-medium uppercase", children: "Confidence" }),
149
- /* @__PURE__ */ r("span", { className: "text-sm text-copy-light", children: [
150
- (o.confidence * 100).toFixed(0),
151
- "%"
152
- ] })
153
- ] }),
154
- o.status && /* @__PURE__ */ r("div", { className: "flex flex-col gap-1", children: [
155
- /* @__PURE__ */ e("span", { className: "text-xs text-copy-medium uppercase", children: "Status" }),
156
- /* @__PURE__ */ e("span", { className: "text-sm text-copy-light capitalize", children: o.status })
157
- ] }),
158
- o.sourceType && /* @__PURE__ */ r("div", { className: "flex flex-col gap-1", children: [
159
- /* @__PURE__ */ e("span", { className: "text-xs text-copy-medium uppercase", children: "Source Type" }),
160
- /* @__PURE__ */ e("span", { className: "text-sm text-copy-light capitalize", children: o.sourceType })
161
- ] })
162
- ] }),
163
- /* @__PURE__ */ r("div", { className: "flex flex-col gap-3 sm:flex-1", children: [
164
- o.quote && /* @__PURE__ */ r("div", { className: "flex flex-col gap-1", children: [
165
- /* @__PURE__ */ e("span", { className: "text-xs text-copy-medium uppercase", children: "Original Prompt" }),
166
- /* @__PURE__ */ r("p", { className: "text-sm text-copy-light m-0 italic", children: [
167
- '"',
168
- o.quote,
169
- '"'
170
- ] })
171
- ] }),
172
- o.canonicalText && /* @__PURE__ */ r("div", { className: "flex flex-col gap-1", children: [
173
- /* @__PURE__ */ e("span", { className: "text-xs text-copy-medium uppercase", children: "Canonical Text" }),
174
- /* @__PURE__ */ e("p", { className: "text-sm text-copy-light m-0 font-mono", children: o.canonicalText })
175
- ] })
176
- ] })
177
- ] })
178
- ] })
179
- ] })
180
- }
181
- );
182
- }, Ye = ({ open: k, onOpenChange: E, user: d }) => {
183
- const o = q(null), { getAccessToken: y } = Se(), [M] = N(void 0), [s, b] = N("active"), [A, p] = te({
184
- key: ee + Te,
185
- initialValue: l.DESC
186
- }), [z, T] = te({
187
- key: ee + we,
188
- initialValue: "createdAt"
189
- }), [h, n] = N(A || l.DESC), [u, I] = N(
190
- z || "createdAt"
191
- ), { data: w, isLoading: H, isError: $ } = De({
192
- user: d,
193
- query: M,
194
- getAccessToken: y,
195
- enabled: k && s === "active"
196
- }), {
197
- data: g,
198
- isLoading: X,
199
- isError: V
200
- } = ve({
201
- user: d,
202
- query: M,
203
- getAccessToken: y,
204
- enabled: k && s === "expired"
205
- }), B = Ee({ getAccessToken: y }), j = Me({ getAccessToken: y }), Y = be({ getAccessToken: y }), P = Re({ getAccessToken: y }), J = Ie({ getAccessToken: y }), [ae, K] = N(!1), S = q(null), [de, Q] = N(!1), [me, F] = N(!1), x = q(null), W = (t, i, a, m) => {
206
- S.current = { id: t, text: i, description: a, createdAt: m }, K(!0);
207
- }, xe = () => {
208
- S.current && B.mutate({ user: d, memoryId: S.current.id });
209
- }, pe = (t, i, a, m, fe, ye, Ae, Ce, Ne, ke) => {
210
- x.current = {
211
- id: t,
212
- description: i,
213
- categories: a,
214
- quote: m,
215
- canonicalText: fe,
216
- confidence: ye,
217
- status: Ae,
218
- sourceType: Ce,
219
- expiration: Ne,
220
- expiresAt: ke
221
- }, F(!0);
222
- }, he = (t, i) => {
223
- x.current && d && P.mutate(
224
- {
225
- user: d,
226
- memoryId: x.current.id,
227
- description: t,
228
- expiration: i || void 0
229
- },
230
- {
231
- onSuccess: () => {
232
- F(!1);
233
- }
234
- }
235
- );
236
- }, ue = () => {
237
- d && Q(!0);
238
- }, ge = () => {
239
- d && (s === "active" ? j.mutate({ user: d }) : Y.mutate({ user: d }));
240
- }, Z = (t) => {
241
- const i = `${t.total} memor${t.total === 1 ? "y" : "ies"}`, a = t.totalTokenUsage ? ` (~${t.totalTokenUsage} tokens)` : "";
242
- return i + a;
243
- };
244
- return /* @__PURE__ */ r(D, { children: [
245
- /* @__PURE__ */ e(
246
- Fe,
247
- {
248
- open: me,
249
- onOpenChange: F,
250
- initialText: x.current?.description || "",
251
- metadata: x.current ? {
252
- categories: x.current.categories,
253
- quote: x.current.quote,
254
- canonicalText: x.current.canonicalText,
255
- confidence: x.current.confidence,
256
- status: x.current.status,
257
- sourceType: x.current.sourceType,
258
- expiration: x.current.expiration,
259
- expiresAt: x.current.expiresAt
260
- } : void 0,
261
- onSave: he,
262
- isSaving: P.isPending
263
- }
264
- ),
265
- /* @__PURE__ */ r(
266
- re,
267
- {
268
- showConfirmation: ae,
269
- setShowConfirmation: K,
270
- action: xe,
271
- customStrings: {
272
- title: "Delete memory",
273
- confirmAction: "Delete",
274
- cancelAction: "Cancel"
275
- },
276
- children: [
277
- /* @__PURE__ */ e("p", { className: "m-0", children: "Are you sure you want to delete this memory?" }),
278
- /* @__PURE__ */ r("ul", { className: "m-0 mt-2 list-disc list-inside text-xs opacity-80", children: [
279
- /* @__PURE__ */ r("li", { children: [
280
- "Excerpt:",
281
- " ",
282
- (S.current?.description || S.current?.text || "").slice(0, 80)
283
- ] }),
284
- /* @__PURE__ */ r("li", { children: [
285
- "Created:",
286
- " ",
287
- S.current?.createdAt ? new Date(S.current.createdAt).toLocaleString() : "-"
288
- ] })
289
- ] })
290
- ]
291
- }
292
- ),
293
- /* @__PURE__ */ e(
294
- re,
295
- {
296
- showConfirmation: de,
297
- setShowConfirmation: Q,
298
- action: ge,
299
- customStrings: {
300
- title: "Delete memories",
301
- confirmAction: "Delete all",
302
- cancelAction: "Cancel"
303
- },
304
- children: /* @__PURE__ */ e("p", { className: "m-0", children: s === "active" ? /* @__PURE__ */ r(D, { children: [
305
- "This will permanently delete all ",
306
- /* @__PURE__ */ e("em", { children: "active memories" }),
307
- " for this user. This action cannot be undone."
308
- ] }) : /* @__PURE__ */ r(D, { children: [
309
- "This will permanently delete all ",
310
- /* @__PURE__ */ e("em", { children: "expired memories" }),
311
- " for this user. This action cannot be undone."
312
- ] }) })
313
- }
314
- ),
315
- /* @__PURE__ */ e(
316
- ce,
317
- {
318
- open: k,
319
- onOpenChange: (t) => E(t),
320
- title: "User Memories",
321
- animation: !0,
322
- animationType: "fade",
323
- blurEffect: "large",
324
- initialFocus: o,
325
- footer: /* @__PURE__ */ r(R, { columnGap: 2, alignHorizontal: "flex-end", children: [
326
- /* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(
327
- se,
328
- {
329
- onOpenChange: E,
330
- label: "Close",
331
- ref: o
332
- }
333
- ) }),
334
- /* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(
335
- _,
336
- {
337
- mode: "dark",
338
- focusMode: "light",
339
- variant: "danger",
340
- disabled: (s === "active" ? j.isPending : Y.isPending) || (s === "active" ? (w?.total ?? 0) === 0 : (g?.total ?? 0) === 0),
341
- onClick: ue,
342
- children: "Delete All"
343
- }
344
- ) })
345
- ] }),
346
- children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-4 @container/editmemoriespanel", children: [
347
- /* @__PURE__ */ r(R, { columnGap: 2, alignHorizontal: "center", children: [
348
- /* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(
349
- _,
350
- {
351
- focusMode: "light",
352
- mode: s === "active" ? "light" : "dark",
353
- size: "small",
354
- noBorder: !0,
355
- onClick: () => b("active"),
356
- children: "Active Memories"
357
- }
358
- ) }),
359
- /* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(
360
- _,
361
- {
362
- focusMode: "light",
363
- mode: s === "expired" ? "light" : "dark",
364
- size: "small",
365
- noBorder: !0,
366
- onClick: () => b("expired"),
367
- children: "Expired Memories"
368
- }
369
- ) })
370
- ] }),
371
- /* @__PURE__ */ e(
372
- "div",
373
- {
374
- className: C(
375
- "flex flex-col sm:flex-row",
376
- "max-h-[75vh]",
377
- "sm:max-h-[75vh]",
378
- "min-h-[70vh]"
379
- ),
380
- children: s === "active" ? /* @__PURE__ */ r(D, { children: [
381
- H && /* @__PURE__ */ e("p", { className: "m-0", children: "Loading memories..." }),
382
- $ && /* @__PURE__ */ e("p", { className: "m-0 text-copy-error-light", children: "Failed to load memories." }),
383
- !H && !$ && (w && w.items.length > 0 ? /* @__PURE__ */ r(
384
- ie,
385
- {
386
- stickyHeader: !0,
387
- stickyFooter: !0,
388
- compact: !0,
389
- mode: "alt-system",
390
- caption: Z(w),
391
- children: [
392
- /* @__PURE__ */ e(oe, { children: /* @__PURE__ */ r(v, { children: [
393
- /* @__PURE__ */ e(c, { className: "sr-only", children: "Row" }),
394
- /* @__PURE__ */ e(c, { children: "Memory" }),
395
- /* @__PURE__ */ e(
396
- O,
397
- {
398
- focusMode: "system",
399
- buttonClassName: "text-xs sm:text-sm",
400
- cellId: "createdAt",
401
- align: "left",
402
- sortDirection: h,
403
- sortedCell: u,
404
- onClick: () => {
405
- I("createdAt"), T("createdAt"), n((t) => {
406
- const i = t === l.ASC ? l.DESC : l.ASC;
407
- return p(i), i;
408
- });
409
- },
410
- children: "Date"
411
- }
412
- ),
413
- /* @__PURE__ */ e(
414
- O,
415
- {
416
- focusMode: "system",
417
- buttonClassName: "text-xs sm:text-sm",
418
- cellId: "expiresAt",
419
- align: "left",
420
- sortDirection: h,
421
- sortedCell: u,
422
- onClick: () => {
423
- I("expiresAt"), T("expiresAt"), n((t) => {
424
- const i = t === l.ASC ? l.DESC : l.ASC;
425
- return p(i), i;
426
- });
427
- },
428
- children: "Expires"
429
- }
430
- ),
431
- /* @__PURE__ */ e(c, { align: "right", children: "Actions" })
432
- ] }) }),
433
- /* @__PURE__ */ e(ne, { children: [...w.items].sort((t, i) => {
434
- if (u === "createdAt") {
435
- const a = t.createdAt ? new Date(t.createdAt).getTime() : 0, m = i.createdAt ? new Date(i.createdAt).getTime() : 0;
436
- return h === l.ASC ? a - m : m - a;
437
- }
438
- if (u === "expiresAt") {
439
- const a = t.expiresAt ? new Date(t.expiresAt).getTime() : Number.MAX_SAFE_INTEGER, m = i.expiresAt ? new Date(i.expiresAt).getTime() : Number.MAX_SAFE_INTEGER;
440
- return h === l.ASC ? a - m : m - a;
441
- }
442
- return 0;
443
- }).map((t, i) => /* @__PURE__ */ r(v, { children: [
444
- /* @__PURE__ */ e(
445
- c,
446
- {
447
- className: C("dark:text-copy-medium"),
448
- children: i + 1
449
- }
450
- ),
451
- /* @__PURE__ */ e(
452
- c,
453
- {
454
- className: C(
455
- "dark:text-copy-lighter",
456
- "max-w-25 sm:max-w-100",
457
- "text-xs sm:text-sm"
458
- ),
459
- style: {
460
- wordBreak: "break-word"
461
- },
462
- children: t.description || t.text
463
- }
464
- ),
465
- /* @__PURE__ */ e(
466
- c,
467
- {
468
- className: C(
469
- "dark:text-copy-medium",
470
- "sm:whitespace-nowrap text-xs sm:text-sm max-w-20 sm:max-w-none"
471
- ),
472
- children: t.createdAt ? new Date(t.createdAt).toLocaleDateString() : "-"
473
- }
474
- ),
475
- /* @__PURE__ */ e(
476
- c,
477
- {
478
- className: C(
479
- "dark:text-copy-medium",
480
- "sm:whitespace-nowrap text-xs sm:text-sm"
481
- ),
482
- children: t.expiresAt ? new Date(t.expiresAt).toLocaleDateString() : "Never"
483
- }
484
- ),
485
- /* @__PURE__ */ e(
486
- c,
487
- {
488
- className: "align-top border-l border-table-light dark:border-table-dark",
489
- align: "right",
490
- children: /* @__PURE__ */ r(
491
- R,
492
- {
493
- columnGap: 2,
494
- alignHorizontal: "flex-end",
495
- children: [
496
- /* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(
497
- U,
498
- {
499
- label: "Edit memory",
500
- mode: "system",
501
- placement: "top",
502
- trigger: /* @__PURE__ */ e(
503
- G,
504
- {
505
- focusMode: "system",
506
- noBorder: !0,
507
- label: "Edit memory",
508
- variant: "primary",
509
- disabled: P.isPending,
510
- onClick: () => pe(
511
- t.memoryId,
512
- t.description || t.text,
513
- t.categories,
514
- t.quote,
515
- t.canonicalText,
516
- t.confidence,
517
- t.status,
518
- t.sourceType,
519
- t.expiration,
520
- t.expiresAt
521
- ),
522
- children: /* @__PURE__ */ e(Le, { size: "size-3", monotone: !0 })
523
- }
524
- )
525
- }
526
- ) }),
527
- /* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(
528
- ze,
529
- {
530
- label: "Delete memory",
531
- disabled: B.isPending,
532
- onClick: () => W(
533
- t.memoryId,
534
- t.text,
535
- t.description,
536
- t.createdAt
537
- )
538
- }
539
- ) })
540
- ]
541
- }
542
- )
543
- }
544
- )
545
- ] }, t.memoryId)) }),
546
- /* @__PURE__ */ e(le, { children: /* @__PURE__ */ e(v, { children: /* @__PURE__ */ e(c, { colSpan: 5, children: Z(w) }) }) })
547
- ]
548
- }
549
- ) : /* @__PURE__ */ e("p", { className: "m-0 italic opacity-70", children: "No memories stored." }))
550
- ] }) : /* @__PURE__ */ r(D, { children: [
551
- X && /* @__PURE__ */ e("p", { className: "m-0", children: "Loading expired memories..." }),
552
- V && /* @__PURE__ */ e("p", { className: "m-0 text-copy-error-light", children: "Failed to load expired memories." }),
553
- !X && !V && (g && g.items.length > 0 ? /* @__PURE__ */ r(ie, { stickyHeader: !0, stickyFooter: !0, compact: !0, mode: "alt-system", children: [
554
- /* @__PURE__ */ e(oe, { children: /* @__PURE__ */ r(v, { children: [
555
- /* @__PURE__ */ e(c, { className: "sr-only", children: "Row" }),
556
- /* @__PURE__ */ e(c, { children: "Memory" }),
557
- /* @__PURE__ */ e(
558
- O,
559
- {
560
- focusMode: "system",
561
- buttonClassName: "text-xs sm:text-sm",
562
- cellId: "createdAt",
563
- align: "left",
564
- sortDirection: h,
565
- sortedCell: u,
566
- onClick: () => {
567
- I("createdAt"), T("createdAt"), n((t) => {
568
- const i = t === l.ASC ? l.DESC : l.ASC;
569
- return p(i), i;
570
- });
571
- },
572
- children: "Date"
573
- }
574
- ),
575
- /* @__PURE__ */ e(
576
- O,
577
- {
578
- focusMode: "system",
579
- buttonClassName: "text-xs sm:text-sm",
580
- cellId: "expiresAt",
581
- align: "left",
582
- sortDirection: h,
583
- sortedCell: u,
584
- onClick: () => {
585
- I("expiresAt"), T("expiresAt"), n((t) => {
586
- const i = t === l.ASC ? l.DESC : l.ASC;
587
- return p(i), i;
588
- });
589
- },
590
- children: "Expired"
591
- }
592
- ),
593
- /* @__PURE__ */ e(c, { align: "right", children: "Actions" })
594
- ] }) }),
595
- /* @__PURE__ */ e(ne, { children: [...g.items].sort((t, i) => {
596
- if (u === "createdAt") {
597
- const a = t.createdAt ? new Date(t.createdAt).getTime() : 0, m = i.createdAt ? new Date(i.createdAt).getTime() : 0;
598
- return h === l.ASC ? a - m : m - a;
599
- }
600
- if (u === "expiresAt") {
601
- const a = t.expiresAt ? new Date(t.expiresAt).getTime() : Number.MAX_SAFE_INTEGER, m = i.expiresAt ? new Date(i.expiresAt).getTime() : Number.MAX_SAFE_INTEGER;
602
- return h === l.ASC ? a - m : m - a;
603
- }
604
- return 0;
605
- }).map((t, i) => /* @__PURE__ */ r(v, { children: [
606
- /* @__PURE__ */ e(
607
- c,
608
- {
609
- className: C("dark:text-copy-medium"),
610
- children: i + 1
611
- }
612
- ),
613
- /* @__PURE__ */ e(
614
- c,
615
- {
616
- className: C(
617
- "dark:text-copy-lighter",
618
- "max-w-25 sm:max-w-100",
619
- "text-xs sm:text-sm"
620
- ),
621
- style: {
622
- wordBreak: "break-word"
623
- },
624
- children: t.description || t.text
625
- }
626
- ),
627
- /* @__PURE__ */ e(
628
- c,
629
- {
630
- className: C(
631
- "dark:text-copy-medium",
632
- "sm:whitespace-nowrap text-xs sm:text-sm max-w-20 sm:max-w-none"
633
- ),
634
- children: t.createdAt ? new Date(t.createdAt).toLocaleDateString() : "-"
635
- }
636
- ),
637
- /* @__PURE__ */ e(
638
- c,
639
- {
640
- className: C(
641
- "dark:text-copy-medium",
642
- "sm:whitespace-nowrap text-xs sm:text-sm"
643
- ),
644
- children: t.expiresAt ? new Date(t.expiresAt).toLocaleDateString() : "-"
645
- }
646
- ),
647
- /* @__PURE__ */ e(
648
- c,
649
- {
650
- className: "align-top border-l border-table-light dark:border-table-dark",
651
- align: "right",
652
- children: /* @__PURE__ */ r(
653
- R,
654
- {
655
- columnGap: 2,
656
- alignHorizontal: "flex-end",
657
- children: [
658
- /* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(
659
- U,
660
- {
661
- label: "Restore memory",
662
- mode: "system",
663
- placement: "top",
664
- trigger: /* @__PURE__ */ e(
665
- G,
666
- {
667
- focusMode: "system",
668
- noBorder: !0,
669
- label: "Restore memory",
670
- variant: "primary",
671
- disabled: J.isPending,
672
- onClick: () => {
673
- d && J.mutate({
674
- user: d,
675
- memoryId: t.memoryId
676
- });
677
- },
678
- children: /* @__PURE__ */ e(Oe, { size: "size-3", monotone: !0 })
679
- }
680
- )
681
- }
682
- ) }),
683
- /* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(
684
- U,
685
- {
686
- label: "Delete memory",
687
- mode: "system",
688
- placement: "top",
689
- trigger: /* @__PURE__ */ e(
690
- G,
691
- {
692
- focusMode: "system",
693
- noBorder: !0,
694
- label: "Delete memory",
695
- variant: "primary",
696
- iconClassName: "text-copy-error-dark dark:text-copy-error-light",
697
- disabled: B.isPending,
698
- onClick: () => W(
699
- t.memoryId,
700
- t.text,
701
- t.description,
702
- t.createdAt
703
- ),
704
- children: /* @__PURE__ */ e(_e, { size: "size-3", monotone: !0 })
705
- }
706
- )
707
- }
708
- ) })
709
- ]
710
- }
711
- )
712
- }
713
- )
714
- ] }, t.memoryId)) }),
715
- /* @__PURE__ */ e(le, { children: /* @__PURE__ */ e(v, { children: /* @__PURE__ */ r(c, { colSpan: 5, children: [
716
- g.total,
717
- " expired memor",
718
- g.total === 1 ? "y" : "ies",
719
- g.totalTokenUsage !== void 0 && g.totalTokenUsage > 0 && /* @__PURE__ */ r(D, { children: [
720
- " ",
721
- "(approximately",
722
- " ",
723
- Math.round(
724
- g.totalTokenUsage
725
- ).toLocaleString(),
726
- " ",
727
- "token",
728
- Math.round(g.totalTokenUsage) === 1 ? "" : "s",
729
- ")"
730
- ] })
731
- ] }) }) })
732
- ] }) : /* @__PURE__ */ e("p", { className: "m-0 italic opacity-70", children: "No expired memories." }))
733
- ] })
734
- }
735
- )
736
- ] })
737
- }
738
- )
739
- ] });
740
- };
741
- export {
742
- Ye as default
743
- };