@versini/sassysaint 8.59.4 → 8.60.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.
- package/dist/chunks/{AboutChangelog.Ce5xKXvl.js → AboutChangelog.D7rARJQu.js} +2 -2
- package/dist/chunks/{AboutEntry.BIxJ0nBU.js → AboutEntry.2nf0TV4n.js} +5 -5
- package/dist/chunks/{App.C0TMLCXL.js → App.Ch8FU2zW.js} +17 -17
- package/dist/chunks/{Chart.Dm1awtwo.js → Chart.Iz1BoL-_.js} +2 -2
- package/dist/chunks/{ChatBubbleAssistant.Dq5_Eygw.js → ChatBubbleAssistant.M4WRDuaw.js} +4 -4
- package/dist/chunks/{ChatBubbleUser.BklufN6-.js → ChatBubbleUser.CJHFRmMF.js} +3 -3
- package/dist/chunks/{ChatHistoryTable.BG-EQekK.js → ChatHistoryTable.B2mRc_wV.js} +9 -9
- package/dist/chunks/{HistoryEntry.DEz9BkNK.js → HistoryEntry.71E6Pz_O.js} +3 -3
- package/dist/chunks/{ProfileEntry.DlK0mggZ.js → ProfileEntry.BWsYCeof.js} +2 -2
- package/dist/chunks/SettingsEntry.Qi5gQD0-.js +781 -0
- package/dist/chunks/{Table.DMMefioh.js → Table.SHD8KKEE.js} +2 -2
- package/dist/chunks/{UsageEntry.By1Tqk3d.js → UsageEntry.DPhNHm9B.js} +3 -3
- package/dist/chunks/UserMemoriesPanel.CT_7TJ_Z.js +208 -0
- package/dist/chunks/{index._DAcm-25.js → index.BBAApLM_.js} +1 -1
- package/dist/chunks/{index.Cnzsl-SW.js → index.BJqzFaBo.js} +2 -2
- package/dist/chunks/{index._ok9-Gz7.js → index.CEgF3L_6.js} +3 -3
- package/dist/chunks/{index.BQNxqtEh.js → index.CqKtw4TJ.js} +1 -1
- package/dist/chunks/{index.CowNGsFh.js → index.DG2NgWZ6.js} +1 -1
- package/dist/chunks/{index.DxCuShZW.js → index.DnHjiSVh.js} +604 -637
- package/dist/chunks/{index.B1gwgNLh.js → index.HkxzuofI.js} +1 -1
- package/dist/chunks/{useMarkdown.BF3V5ODx.js → useMarkdown.BBFa2GkT.js} +6 -6
- package/dist/components/SassySaint/SassySaint.js +1 -1
- package/dist/index.js +4 -4
- package/package.json +3 -3
- package/dist/chunks/SettingsEntry.DqU_B5BR.js +0 -430
- package/dist/chunks/UserMemoriesPanel.BaEGaQVG.js +0 -692
|
@@ -1,692 +0,0 @@
|
|
|
1
|
-
import { jsxs as m, jsx as e, Fragment as we } from "react/jsx-runtime";
|
|
2
|
-
import { I as ve, o as Ce, h as re, i as Ae, x as Ee, L as $, j as P, C as X, isProbablyiPhone as Me, n as Te, LOCAL_STORAGE_PREFIX as oe, LOCAL_STORAGE_SORT_MEMORY_DIRECTION as De, LOCAL_STORAGE_SORT_MEMORY_COLUMN as Ne, useUserMemories as Se, useDeleteMemory as _e, useDeleteAllMemories as Oe, useUpdateMemory as Re, te as ae } from "./index.DxCuShZW.js";
|
|
3
|
-
import { oe as ce, E as le, e as I, ConfirmationPanel as ie, st as ne } from "./App.C0TMLCXL.js";
|
|
4
|
-
import c from "clsx";
|
|
5
|
-
import Le, { useState as x, useEffect as de, useRef as N, useLayoutEffect as V } from "react";
|
|
6
|
-
import { j as Ie, D as Pe, G as W, M as D, F as He, H as Be, l as ze, U as Ue } from "./Table.DMMefioh.js";
|
|
7
|
-
function Ve({
|
|
8
|
-
value: t,
|
|
9
|
-
defaultValue: l,
|
|
10
|
-
finalValue: r,
|
|
11
|
-
onChange: a = () => {
|
|
12
|
-
},
|
|
13
|
-
initialControlledDelay: o = 0
|
|
14
|
-
}) {
|
|
15
|
-
const [i, d] = x(!1), [u, w] = x(
|
|
16
|
-
l !== void 0 ? l : r
|
|
17
|
-
), b = (h) => {
|
|
18
|
-
w(h), a?.(h);
|
|
19
|
-
};
|
|
20
|
-
return de(() => {
|
|
21
|
-
(async () => t !== void 0 && !i && o > 0 && (await new Promise(
|
|
22
|
-
(h) => setTimeout(h, o)
|
|
23
|
-
), d(!0)))();
|
|
24
|
-
}, [t, o, i]), t !== void 0 ? !i && o > 0 ? ["", a, !0] : [t, a, !0] : [u, b, !1];
|
|
25
|
-
}
|
|
26
|
-
const Fe = ({
|
|
27
|
-
className: t,
|
|
28
|
-
viewBox: l,
|
|
29
|
-
title: r,
|
|
30
|
-
monotone: a,
|
|
31
|
-
...o
|
|
32
|
-
}) => /* @__PURE__ */ m(
|
|
33
|
-
ve,
|
|
34
|
-
{
|
|
35
|
-
defaultViewBox: "0 0 512 512",
|
|
36
|
-
size: "size-5",
|
|
37
|
-
viewBox: l,
|
|
38
|
-
className: t,
|
|
39
|
-
title: r || "Edit",
|
|
40
|
-
...o,
|
|
41
|
-
children: [
|
|
42
|
-
/* @__PURE__ */ e(
|
|
43
|
-
"path",
|
|
44
|
-
{
|
|
45
|
-
d: "M0 160c0-53 43-96 96-96h96c17.7 0 32 14.3 32 32s-14.3 32-32 32H96c-17.7 0-32 14.3-32 32v256c0 17.7 14.3 32 32 32h256c17.7 0 32-14.3 32-32v-96c0-17.7 14.3-32 32-32s32 14.3 32 32v96c0 53-43 96-96 96H96c-53 0-96-43-96-96z",
|
|
46
|
-
opacity: a ? "1" : "0.4"
|
|
47
|
-
}
|
|
48
|
-
),
|
|
49
|
-
/* @__PURE__ */ e("path", { d: "m392.4 21.7-30.1 30 97.9 97.9 30.1-30.1c21.9-21.9 21.9-57.3 0-79.2l-18.7-18.6c-21.9-21.9-57.3-21.9-79.2 0m-52.7 52.6L172.4 241.7c-6.1 6.1-10.8 13.6-13.5 21.9l-29.6 88.8c-2.9 8.6-.6 18.1 5.8 24.6s15.9 8.7 24.6 5.8l88.8-29.6c8.2-2.7 15.7-7.4 21.9-13.5l167.3-167.4z" })
|
|
50
|
-
]
|
|
51
|
-
}
|
|
52
|
-
), me = "av-text-area", je = "av-text-area-wrapper", Z = "av-text-area-helper-text", Ge = "av-text-area__control--right", qe = "av-text-area__control--left", Xe = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hidden px-4 py-7", Ye = ({ mode: t }) => c({
|
|
53
|
-
"bg-surface-darker text-copy-lighter caret-copy-light": t === "dark",
|
|
54
|
-
"bg-surface-lighter text-copy-dark caret-copy-dark": t === "light",
|
|
55
|
-
"bg-surface-lighter text-copy-dark caret-copy-dark dark:bg-surface-darker dark:text-copy-lighter dark:caret-copy-light": t === "system",
|
|
56
|
-
"bg-surface-darker text-copy-lighter caret-copy-light dark:bg-surface-lighter dark:text-copy-dark dark:caret-copy-dark": t === "alt-system"
|
|
57
|
-
}), Je = ({
|
|
58
|
-
focusMode: t
|
|
59
|
-
}) => c("focus:outline focus:outline-2 focus:outline-offset-2", {
|
|
60
|
-
"focus:outline-focus-dark": t === "dark",
|
|
61
|
-
"focus:outline-focus-light": t === "light",
|
|
62
|
-
"focus:outline-focus-light dark:focus:outline-focus-dark": t === "alt-system",
|
|
63
|
-
"focus:outline-focus-dark dark:focus:outline-focus-light": t === "system"
|
|
64
|
-
}), Ke = ({
|
|
65
|
-
noBorder: t,
|
|
66
|
-
error: l
|
|
67
|
-
}) => c("border-2", {
|
|
68
|
-
"border-border-dark": !t && !l,
|
|
69
|
-
"focus:border-border-dark": !t && l,
|
|
70
|
-
"border-border-error-dark": !t && l,
|
|
71
|
-
"border-transparent": t
|
|
72
|
-
}), Qe = ({
|
|
73
|
-
disabled: t,
|
|
74
|
-
raw: l,
|
|
75
|
-
error: r,
|
|
76
|
-
mode: a,
|
|
77
|
-
leftElement: o,
|
|
78
|
-
rightElement: i
|
|
79
|
-
}) => {
|
|
80
|
-
if (l)
|
|
81
|
-
return "";
|
|
82
|
-
if (t)
|
|
83
|
-
return c(
|
|
84
|
-
"transform translate-y-0 scale-100 absolute px-2 cursor-not-allowed opacity-50 font-medium",
|
|
85
|
-
{
|
|
86
|
-
"translate-x-[10px]": i === !0 && !o || !i && !o
|
|
87
|
-
}
|
|
88
|
-
);
|
|
89
|
-
if (!r)
|
|
90
|
-
return c(
|
|
91
|
-
"absolute px-2 cursor-text font-medium transform translate-y-0 scale-100",
|
|
92
|
-
{
|
|
93
|
-
"translate-x-[10px]": i === !0 && !o || !i && !o,
|
|
94
|
-
"text-copy-medium": a === "dark",
|
|
95
|
-
"text-copy-dark": a === "light",
|
|
96
|
-
"text-copy-dark dark:text-copy-medium": a === "system",
|
|
97
|
-
"text-copy-medium dark:text-copy-dark": a === "alt-system"
|
|
98
|
-
}
|
|
99
|
-
);
|
|
100
|
-
if (r)
|
|
101
|
-
return c(
|
|
102
|
-
"absolute px-2 cursor-text font-medium transform translate-y-0 scale-100",
|
|
103
|
-
{
|
|
104
|
-
"translate-x-[10px]": i === !0 && !o || !i && !o,
|
|
105
|
-
"text-copy-medium": a === "dark",
|
|
106
|
-
"text-copy-error-dark": a === "light",
|
|
107
|
-
"text-copy-error-dark dark:text-copy-error-light": a === "system",
|
|
108
|
-
"text-copy-medium dark:text-copy-error-dark": a === "alt-system"
|
|
109
|
-
}
|
|
110
|
-
);
|
|
111
|
-
}, We = ({
|
|
112
|
-
error: t,
|
|
113
|
-
raw: l,
|
|
114
|
-
mode: r,
|
|
115
|
-
disabled: a
|
|
116
|
-
}) => {
|
|
117
|
-
if (l)
|
|
118
|
-
return "";
|
|
119
|
-
if (a)
|
|
120
|
-
return c(
|
|
121
|
-
Z,
|
|
122
|
-
"absolute px-2 cursor-not-allowed opacity-50 font-medium"
|
|
123
|
-
);
|
|
124
|
-
if (!t)
|
|
125
|
-
return c(Z, "absolute px-2 font-medium", {
|
|
126
|
-
"text-copy-medium": r === "dark",
|
|
127
|
-
"text-copy-dark": r === "light",
|
|
128
|
-
"text-copy-dark dark:text-copy-medium": r === "system",
|
|
129
|
-
"text-copy-medium dark:text-copy-dark": r === "alt-system"
|
|
130
|
-
});
|
|
131
|
-
if (t)
|
|
132
|
-
return c(Z, "absolute px-2 font-medium", {
|
|
133
|
-
"text-copy-error-light": r === "dark",
|
|
134
|
-
"text-copy-error-dark": r === "light",
|
|
135
|
-
"text-copy-error-dark dark:text-copy-error-light": r === "system",
|
|
136
|
-
"dark:text-copy-error-dark text-copy-error-light": r === "alt-system"
|
|
137
|
-
});
|
|
138
|
-
}, Ze = ({
|
|
139
|
-
className: t,
|
|
140
|
-
textAreaClassName: l,
|
|
141
|
-
raw: r,
|
|
142
|
-
focusMode: a,
|
|
143
|
-
disabled: o,
|
|
144
|
-
noBorder: i,
|
|
145
|
-
error: d,
|
|
146
|
-
mode: u,
|
|
147
|
-
leftElement: w,
|
|
148
|
-
rightElement: b
|
|
149
|
-
}) => {
|
|
150
|
-
const h = r ? t : c(
|
|
151
|
-
"relative flex w-full flex-col justify-center",
|
|
152
|
-
je,
|
|
153
|
-
t
|
|
154
|
-
), O = r ? c(l) : c(
|
|
155
|
-
me,
|
|
156
|
-
l,
|
|
157
|
-
Xe(),
|
|
158
|
-
Ye({ mode: u }),
|
|
159
|
-
Je({ focusMode: a }),
|
|
160
|
-
Ke({
|
|
161
|
-
noBorder: i,
|
|
162
|
-
error: d
|
|
163
|
-
}),
|
|
164
|
-
{
|
|
165
|
-
"disabled:cursor-not-allowed disabled:opacity-50": o
|
|
166
|
-
}
|
|
167
|
-
), H = r ? void 0 : "sr-only", k = Qe({
|
|
168
|
-
disabled: o,
|
|
169
|
-
raw: r,
|
|
170
|
-
error: d,
|
|
171
|
-
mode: u,
|
|
172
|
-
rightElement: b,
|
|
173
|
-
leftElement: w
|
|
174
|
-
}), f = We({
|
|
175
|
-
error: d,
|
|
176
|
-
raw: r,
|
|
177
|
-
mode: u,
|
|
178
|
-
disabled: o
|
|
179
|
-
}), A = r ? void 0 : c(Ge, "absolute"), y = r ? void 0 : c(qe, "absolute");
|
|
180
|
-
return {
|
|
181
|
-
wrapper: h,
|
|
182
|
-
textArea: O,
|
|
183
|
-
accessibleLabel: H,
|
|
184
|
-
visibleLabel: k,
|
|
185
|
-
helperText: f,
|
|
186
|
-
rightElement: A,
|
|
187
|
-
leftElement: y
|
|
188
|
-
};
|
|
189
|
-
}, $e = ({
|
|
190
|
-
scrollHeight: t,
|
|
191
|
-
currentHeight: l,
|
|
192
|
-
currentLabelOffset: r = 0,
|
|
193
|
-
currentHelperTextOffset: a = 0
|
|
194
|
-
}) => {
|
|
195
|
-
let o, i;
|
|
196
|
-
if (t > 0 && t !== l) {
|
|
197
|
-
const d = t - l, u = Math.abs(d / 24);
|
|
198
|
-
o = r + -1 * Math.sign(d) * (12 * u), i = a + Math.sign(d) * (12 * u);
|
|
199
|
-
}
|
|
200
|
-
return {
|
|
201
|
-
labelOffset: o,
|
|
202
|
-
helperTextOffset: i,
|
|
203
|
-
scrollHeight: t
|
|
204
|
-
};
|
|
205
|
-
}, ue = Le.forwardRef(
|
|
206
|
-
({
|
|
207
|
-
id: t,
|
|
208
|
-
name: l,
|
|
209
|
-
label: r,
|
|
210
|
-
error: a = !1,
|
|
211
|
-
raw: o = !1,
|
|
212
|
-
className: i,
|
|
213
|
-
textAreaClassName: d,
|
|
214
|
-
mode: u = "system",
|
|
215
|
-
focusMode: w = "system",
|
|
216
|
-
value: b,
|
|
217
|
-
defaultValue: h,
|
|
218
|
-
disabled: O = !1,
|
|
219
|
-
noBorder: H = !1,
|
|
220
|
-
labelId: k,
|
|
221
|
-
helperText: f = "",
|
|
222
|
-
helperTextOnFocus: A = !1,
|
|
223
|
-
rightElement: y,
|
|
224
|
-
leftElement: v,
|
|
225
|
-
onChange: R,
|
|
226
|
-
onFocus: F,
|
|
227
|
-
onBlur: B,
|
|
228
|
-
...E
|
|
229
|
-
}, Y) => {
|
|
230
|
-
const p = N(null), J = Ce([Y, p]), [z, C] = re(), [K, M] = re(), U = N(80), j = N(-25), L = N(null), G = N(30), n = N(null), s = Ae({ id: t, prefix: `${me}-` }), [S, q] = x(0), [ee, he] = x(0), [fe, te] = x(
|
|
231
|
-
!!(!A && f)
|
|
232
|
-
), pe = `${l} error, ${f}`, _ = Ze({
|
|
233
|
-
className: i,
|
|
234
|
-
textAreaClassName: d,
|
|
235
|
-
error: a,
|
|
236
|
-
raw: o,
|
|
237
|
-
focusMode: w,
|
|
238
|
-
disabled: O,
|
|
239
|
-
noBorder: H,
|
|
240
|
-
mode: u,
|
|
241
|
-
rightElement: !!y,
|
|
242
|
-
leftElement: !!v
|
|
243
|
-
}), [T, xe] = Ve({
|
|
244
|
-
value: b,
|
|
245
|
-
initialControlledDelay: 20,
|
|
246
|
-
defaultValue: h,
|
|
247
|
-
onChange: (g) => {
|
|
248
|
-
R && R({
|
|
249
|
-
target: {
|
|
250
|
-
value: g
|
|
251
|
-
}
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
}), ye = (g) => {
|
|
255
|
-
xe(g.target.value);
|
|
256
|
-
}, ge = (g) => {
|
|
257
|
-
A && f && te(!0), F && F(g);
|
|
258
|
-
}, be = (g) => {
|
|
259
|
-
A && f && !T && te(!1), B && B(g);
|
|
260
|
-
};
|
|
261
|
-
return V(() => {
|
|
262
|
-
C && C.width && q(C.width + 18 + 10);
|
|
263
|
-
}, [C]), V(() => {
|
|
264
|
-
M && M.width && he(M.width + 18 + 10);
|
|
265
|
-
}, [M]), V(() => {
|
|
266
|
-
o || p && p.current && T !== void 0 && (p.current.style.height = "inherit", p.current.style.height = p.current.scrollHeight + "px");
|
|
267
|
-
}, [T, o]), V(() => {
|
|
268
|
-
o || setTimeout(() => {
|
|
269
|
-
L?.current?.style.setProperty(
|
|
270
|
-
"--av-text-area-wrapper-transition",
|
|
271
|
-
T ? "none" : "all 0.2s ease-out"
|
|
272
|
-
);
|
|
273
|
-
}, 0);
|
|
274
|
-
}, [T, o]), V(() => {
|
|
275
|
-
if (!o && p && p.current && T !== void 0) {
|
|
276
|
-
const { labelOffset: g, helperTextOffset: Q, scrollHeight: ke } = $e({
|
|
277
|
-
scrollHeight: p.current.scrollHeight,
|
|
278
|
-
currentHeight: U.current,
|
|
279
|
-
currentLabelOffset: j.current,
|
|
280
|
-
currentHelperTextOffset: G.current
|
|
281
|
-
});
|
|
282
|
-
g && (j.current = g, L?.current?.style.setProperty(
|
|
283
|
-
"--av-text-area-label",
|
|
284
|
-
`${g}px`
|
|
285
|
-
)), Q && (G.current = Q, n?.current?.style.setProperty(
|
|
286
|
-
"--av-text-area-helper-text",
|
|
287
|
-
`${Q}px`
|
|
288
|
-
)), U.current = ke || U.current;
|
|
289
|
-
}
|
|
290
|
-
}, [T, o]), M.width > 0 && L?.current?.style.setProperty(
|
|
291
|
-
"--tw-translate-x",
|
|
292
|
-
`${12 + M.width + 5}px`
|
|
293
|
-
), /* @__PURE__ */ m("div", { className: _.wrapper, children: [
|
|
294
|
-
/* @__PURE__ */ e(
|
|
295
|
-
"label",
|
|
296
|
-
{
|
|
297
|
-
htmlFor: s,
|
|
298
|
-
id: k,
|
|
299
|
-
className: _.accessibleLabel,
|
|
300
|
-
children: r
|
|
301
|
-
}
|
|
302
|
-
),
|
|
303
|
-
v && /* @__PURE__ */ e(
|
|
304
|
-
"div",
|
|
305
|
-
{
|
|
306
|
-
ref: K,
|
|
307
|
-
className: _.leftElement,
|
|
308
|
-
children: v
|
|
309
|
-
}
|
|
310
|
-
),
|
|
311
|
-
/* @__PURE__ */ e(
|
|
312
|
-
"textarea",
|
|
313
|
-
{
|
|
314
|
-
ref: J,
|
|
315
|
-
id: s,
|
|
316
|
-
name: l,
|
|
317
|
-
disabled: O,
|
|
318
|
-
placeholder: o ? void 0 : " ",
|
|
319
|
-
className: _.textArea,
|
|
320
|
-
rows: 1,
|
|
321
|
-
...f && { "aria-describedby": `${s}-helper` },
|
|
322
|
-
...a && { "aria-invalid": "true" },
|
|
323
|
-
...y && !v && !o && { style: { paddingRight: S } },
|
|
324
|
-
...v && !y && !o && { style: { paddingLeft: ee } },
|
|
325
|
-
...y && v && !o && {
|
|
326
|
-
style: {
|
|
327
|
-
paddingRight: S,
|
|
328
|
-
paddingLeft: ee
|
|
329
|
-
}
|
|
330
|
-
},
|
|
331
|
-
value: T,
|
|
332
|
-
onChange: ye,
|
|
333
|
-
onFocus: ge,
|
|
334
|
-
onBlur: be,
|
|
335
|
-
...E
|
|
336
|
-
}
|
|
337
|
-
),
|
|
338
|
-
!o && /* @__PURE__ */ e(
|
|
339
|
-
"label",
|
|
340
|
-
{
|
|
341
|
-
ref: L,
|
|
342
|
-
"aria-hidden": !0,
|
|
343
|
-
htmlFor: s,
|
|
344
|
-
className: `${_.visibleLabel}`,
|
|
345
|
-
children: r
|
|
346
|
-
}
|
|
347
|
-
),
|
|
348
|
-
fe && /* @__PURE__ */ e(
|
|
349
|
-
"div",
|
|
350
|
-
{
|
|
351
|
-
ref: n,
|
|
352
|
-
id: `${s}-helper`,
|
|
353
|
-
className: _.helperText,
|
|
354
|
-
children: f
|
|
355
|
-
}
|
|
356
|
-
),
|
|
357
|
-
y && /* @__PURE__ */ e(
|
|
358
|
-
"div",
|
|
359
|
-
{
|
|
360
|
-
ref: z,
|
|
361
|
-
className: _.rightElement,
|
|
362
|
-
children: y
|
|
363
|
-
}
|
|
364
|
-
),
|
|
365
|
-
a && f && /* @__PURE__ */ e(Ee, { politeness: "polite", clearAnnouncementDelay: 500, children: pe })
|
|
366
|
-
] });
|
|
367
|
-
}
|
|
368
|
-
);
|
|
369
|
-
ue.displayName = "TextArea";
|
|
370
|
-
/*!
|
|
371
|
-
@versini/ui-textarea v5.0.2
|
|
372
|
-
© 2025 gizmette.com
|
|
373
|
-
*/
|
|
374
|
-
try {
|
|
375
|
-
window.__VERSINI_UI_TEXTAREA__ || (window.__VERSINI_UI_TEXTAREA__ = {
|
|
376
|
-
version: "5.0.2",
|
|
377
|
-
buildTime: "10/11/2025 07:15 PM EDT",
|
|
378
|
-
homepage: "https://github.com/aversini/ui-components",
|
|
379
|
-
license: "MIT"
|
|
380
|
-
});
|
|
381
|
-
} catch {
|
|
382
|
-
}
|
|
383
|
-
const et = ({
|
|
384
|
-
open: t,
|
|
385
|
-
onOpenChange: l,
|
|
386
|
-
initialText: r,
|
|
387
|
-
onSave: a,
|
|
388
|
-
isSaving: o = !1
|
|
389
|
-
}) => {
|
|
390
|
-
const [i, d] = x(r);
|
|
391
|
-
de(() => {
|
|
392
|
-
t && d(r);
|
|
393
|
-
}, [t, r]);
|
|
394
|
-
const u = () => {
|
|
395
|
-
i.trim().length >= 3 && a(i.trim());
|
|
396
|
-
}, w = i.trim().length >= 3, b = i.trim() !== r.trim();
|
|
397
|
-
return /* @__PURE__ */ e(
|
|
398
|
-
ce,
|
|
399
|
-
{
|
|
400
|
-
kind: Me() ? "panel" : "messagebox",
|
|
401
|
-
open: t,
|
|
402
|
-
onOpenChange: l,
|
|
403
|
-
title: "Edit Memory",
|
|
404
|
-
animation: !0,
|
|
405
|
-
animationType: "fade",
|
|
406
|
-
footer: /* @__PURE__ */ m($, { columnGap: 2, alignHorizontal: "flex-end", children: [
|
|
407
|
-
/* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(
|
|
408
|
-
X,
|
|
409
|
-
{
|
|
410
|
-
mode: "dark",
|
|
411
|
-
variant: "secondary",
|
|
412
|
-
noBorder: !0,
|
|
413
|
-
focusMode: "light",
|
|
414
|
-
onClick: () => l(!1),
|
|
415
|
-
disabled: o,
|
|
416
|
-
children: "Cancel"
|
|
417
|
-
}
|
|
418
|
-
) }),
|
|
419
|
-
/* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(
|
|
420
|
-
X,
|
|
421
|
-
{
|
|
422
|
-
mode: "dark",
|
|
423
|
-
focusMode: "light",
|
|
424
|
-
disabled: o || !w || !b,
|
|
425
|
-
onClick: u,
|
|
426
|
-
children: o ? "Saving..." : "Save"
|
|
427
|
-
}
|
|
428
|
-
) })
|
|
429
|
-
] }),
|
|
430
|
-
children: /* @__PURE__ */ e("div", { className: "flex flex-col pt-2", children: /* @__PURE__ */ e(
|
|
431
|
-
ue,
|
|
432
|
-
{
|
|
433
|
-
mode: "dark",
|
|
434
|
-
focusMode: "light",
|
|
435
|
-
label: "Memory text",
|
|
436
|
-
name: "memoryText",
|
|
437
|
-
value: i,
|
|
438
|
-
onChange: (h) => d(h.target.value),
|
|
439
|
-
autoFocus: !0,
|
|
440
|
-
helperText: i.trim().length < 3 ? "Memory text must be at least 3 characters" : `${i.length} characters`
|
|
441
|
-
}
|
|
442
|
-
) })
|
|
443
|
-
}
|
|
444
|
-
);
|
|
445
|
-
}, se = ({
|
|
446
|
-
open: t,
|
|
447
|
-
onOpenChange: l,
|
|
448
|
-
user: r
|
|
449
|
-
}) => {
|
|
450
|
-
const { getAccessToken: a } = Te(), [o] = x(void 0), [i, d] = le({
|
|
451
|
-
key: oe + De,
|
|
452
|
-
initialValue: I.DESC
|
|
453
|
-
}), [u, w] = le({
|
|
454
|
-
key: oe + Ne,
|
|
455
|
-
initialValue: "createdAt"
|
|
456
|
-
}), [b, h] = x(i || I.DESC), [O, H] = x(
|
|
457
|
-
u || "createdAt"
|
|
458
|
-
), { data: k, isLoading: f, isError: A } = Se({
|
|
459
|
-
user: r,
|
|
460
|
-
query: o,
|
|
461
|
-
getAccessToken: a,
|
|
462
|
-
enabled: t
|
|
463
|
-
}), y = _e({ getAccessToken: a }), v = Oe({ getAccessToken: a }), R = Re({ getAccessToken: a }), [F, B] = x(!1), E = N(null), [Y, p] = x(!1), [J, z] = x(!1), C = N(null), K = (n, s, S) => {
|
|
464
|
-
E.current = { id: n, text: s, createdAt: S }, B(!0);
|
|
465
|
-
}, M = () => {
|
|
466
|
-
E.current && y.mutate({ user: r, memoryId: E.current.id });
|
|
467
|
-
}, U = () => {
|
|
468
|
-
r && p(!0);
|
|
469
|
-
}, j = () => {
|
|
470
|
-
r && v.mutate({ user: r });
|
|
471
|
-
}, L = (n, s) => {
|
|
472
|
-
C.current = { id: n, text: s }, z(!0);
|
|
473
|
-
}, G = (n) => {
|
|
474
|
-
C.current && r && R.mutate(
|
|
475
|
-
{
|
|
476
|
-
user: r,
|
|
477
|
-
memoryId: C.current.id,
|
|
478
|
-
text: n
|
|
479
|
-
},
|
|
480
|
-
{
|
|
481
|
-
onSuccess: () => {
|
|
482
|
-
z(!1);
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
);
|
|
486
|
-
};
|
|
487
|
-
return /* @__PURE__ */ m(we, { children: [
|
|
488
|
-
/* @__PURE__ */ m(
|
|
489
|
-
ie,
|
|
490
|
-
{
|
|
491
|
-
showConfirmation: F,
|
|
492
|
-
setShowConfirmation: B,
|
|
493
|
-
action: M,
|
|
494
|
-
customStrings: {
|
|
495
|
-
title: "Delete memory",
|
|
496
|
-
confirmAction: "Delete",
|
|
497
|
-
cancelAction: "Cancel"
|
|
498
|
-
},
|
|
499
|
-
children: [
|
|
500
|
-
/* @__PURE__ */ e("p", { className: "m-0", children: "Are you sure you want to delete this memory?" }),
|
|
501
|
-
/* @__PURE__ */ m("ul", { className: "m-0 mt-2 list-disc list-inside text-xs opacity-80", children: [
|
|
502
|
-
/* @__PURE__ */ m("li", { children: [
|
|
503
|
-
"Excerpt: ",
|
|
504
|
-
E.current?.text?.slice(0, 80) || ""
|
|
505
|
-
] }),
|
|
506
|
-
/* @__PURE__ */ m("li", { children: [
|
|
507
|
-
"Created:",
|
|
508
|
-
" ",
|
|
509
|
-
E.current?.createdAt ? new Date(E.current.createdAt).toLocaleString() : "-"
|
|
510
|
-
] })
|
|
511
|
-
] })
|
|
512
|
-
]
|
|
513
|
-
}
|
|
514
|
-
),
|
|
515
|
-
/* @__PURE__ */ e(
|
|
516
|
-
ie,
|
|
517
|
-
{
|
|
518
|
-
showConfirmation: Y,
|
|
519
|
-
setShowConfirmation: p,
|
|
520
|
-
action: j,
|
|
521
|
-
customStrings: {
|
|
522
|
-
title: "Delete all memories",
|
|
523
|
-
confirmAction: "Delete all",
|
|
524
|
-
cancelAction: "Cancel"
|
|
525
|
-
},
|
|
526
|
-
children: /* @__PURE__ */ e("p", { className: "m-0", children: "This will permanently delete all memories for this user. This action cannot be undone." })
|
|
527
|
-
}
|
|
528
|
-
),
|
|
529
|
-
/* @__PURE__ */ e(
|
|
530
|
-
et,
|
|
531
|
-
{
|
|
532
|
-
open: J,
|
|
533
|
-
onOpenChange: z,
|
|
534
|
-
initialText: C.current?.text || "",
|
|
535
|
-
onSave: G,
|
|
536
|
-
isSaving: R.isPending
|
|
537
|
-
}
|
|
538
|
-
),
|
|
539
|
-
/* @__PURE__ */ e(
|
|
540
|
-
ce,
|
|
541
|
-
{
|
|
542
|
-
open: t,
|
|
543
|
-
onOpenChange: (n) => l(n),
|
|
544
|
-
title: "User Memories",
|
|
545
|
-
animation: !0,
|
|
546
|
-
animationType: "fade",
|
|
547
|
-
footer: /* @__PURE__ */ m($, { columnGap: 2, alignHorizontal: "flex-end", children: [
|
|
548
|
-
/* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(
|
|
549
|
-
X,
|
|
550
|
-
{
|
|
551
|
-
mode: "dark",
|
|
552
|
-
variant: "secondary",
|
|
553
|
-
noBorder: !0,
|
|
554
|
-
focusMode: "light",
|
|
555
|
-
onClick: () => l(!1),
|
|
556
|
-
children: "Close"
|
|
557
|
-
}
|
|
558
|
-
) }),
|
|
559
|
-
/* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(
|
|
560
|
-
X,
|
|
561
|
-
{
|
|
562
|
-
mode: "dark",
|
|
563
|
-
focusMode: "light",
|
|
564
|
-
variant: "danger",
|
|
565
|
-
disabled: v.isPending || (k?.total ?? 0) === 0,
|
|
566
|
-
onClick: U,
|
|
567
|
-
children: "Delete All"
|
|
568
|
-
}
|
|
569
|
-
) })
|
|
570
|
-
] }),
|
|
571
|
-
children: /* @__PURE__ */ m("div", { className: "flex flex-col sm:flex-row max-h-[75vh] min-h-[60vh] pt-2", children: [
|
|
572
|
-
f && /* @__PURE__ */ e("p", { className: "m-0", children: "Loading memories..." }),
|
|
573
|
-
A && /* @__PURE__ */ e("p", { className: "m-0 text-red-500", children: "Failed to load memories." }),
|
|
574
|
-
!f && !A && (k && k.items.length > 0 ? /* @__PURE__ */ m(Ie, { stickyHeader: !0, stickyFooter: !0, compact: !0, mode: "alt-system", children: [
|
|
575
|
-
/* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ m(W, { children: [
|
|
576
|
-
/* @__PURE__ */ e(D, { className: "sr-only", children: "Row" }),
|
|
577
|
-
/* @__PURE__ */ e(D, { children: "Memory" }),
|
|
578
|
-
/* @__PURE__ */ e(
|
|
579
|
-
He,
|
|
580
|
-
{
|
|
581
|
-
focusMode: "system",
|
|
582
|
-
buttonClassName: "text-xs sm:text-sm",
|
|
583
|
-
cellId: "createdAt",
|
|
584
|
-
align: "left",
|
|
585
|
-
sortDirection: b,
|
|
586
|
-
sortedCell: O,
|
|
587
|
-
onClick: () => {
|
|
588
|
-
H("createdAt"), w("createdAt"), h((n) => {
|
|
589
|
-
const s = n === I.ASC ? I.DESC : I.ASC;
|
|
590
|
-
return d(s), s;
|
|
591
|
-
});
|
|
592
|
-
},
|
|
593
|
-
children: "Date"
|
|
594
|
-
}
|
|
595
|
-
),
|
|
596
|
-
/* @__PURE__ */ e(D, { align: "right", children: "Actions" })
|
|
597
|
-
] }) }),
|
|
598
|
-
/* @__PURE__ */ e(Be, { children: [...k.items].sort((n, s) => {
|
|
599
|
-
const S = n.createdAt ? new Date(n.createdAt).getTime() : 0, q = s.createdAt ? new Date(s.createdAt).getTime() : 0;
|
|
600
|
-
return b === I.ASC ? S - q : q - S;
|
|
601
|
-
}).map((n, s) => /* @__PURE__ */ m(W, { children: [
|
|
602
|
-
/* @__PURE__ */ e(D, { className: c("dark:text-gray-400"), children: s + 1 }),
|
|
603
|
-
/* @__PURE__ */ e(
|
|
604
|
-
D,
|
|
605
|
-
{
|
|
606
|
-
className: c(
|
|
607
|
-
"dark:text-white",
|
|
608
|
-
"max-w-[100px] sm:max-w-[400px]",
|
|
609
|
-
"text-xs sm:text-sm"
|
|
610
|
-
),
|
|
611
|
-
style: {
|
|
612
|
-
wordBreak: "break-word"
|
|
613
|
-
},
|
|
614
|
-
children: n.text
|
|
615
|
-
}
|
|
616
|
-
),
|
|
617
|
-
/* @__PURE__ */ e(
|
|
618
|
-
D,
|
|
619
|
-
{
|
|
620
|
-
component: "th",
|
|
621
|
-
scope: "row",
|
|
622
|
-
className: c(
|
|
623
|
-
"dark:text-gray-400",
|
|
624
|
-
"sm:whitespace-nowrap text-xs sm:text-sm max-w-20 sm:max-w-none"
|
|
625
|
-
),
|
|
626
|
-
children: n.createdAt ? new Date(n.createdAt).toLocaleDateString() : "-"
|
|
627
|
-
}
|
|
628
|
-
),
|
|
629
|
-
/* @__PURE__ */ e(D, { className: "align-top", align: "right", children: /* @__PURE__ */ m($, { columnGap: 1, alignHorizontal: "flex-end", children: [
|
|
630
|
-
/* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(
|
|
631
|
-
ne,
|
|
632
|
-
{
|
|
633
|
-
label: "Edit memory",
|
|
634
|
-
mode: "system",
|
|
635
|
-
placement: "top",
|
|
636
|
-
trigger: /* @__PURE__ */ e(
|
|
637
|
-
ae,
|
|
638
|
-
{
|
|
639
|
-
focusMode: "system",
|
|
640
|
-
noBorder: !0,
|
|
641
|
-
label: "Edit memory",
|
|
642
|
-
variant: "primary",
|
|
643
|
-
disabled: R.isPending,
|
|
644
|
-
onClick: () => L(n.memoryId, n.text),
|
|
645
|
-
children: /* @__PURE__ */ e(Fe, { size: "size-3", monotone: !0 })
|
|
646
|
-
}
|
|
647
|
-
)
|
|
648
|
-
}
|
|
649
|
-
) }),
|
|
650
|
-
/* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(
|
|
651
|
-
ne,
|
|
652
|
-
{
|
|
653
|
-
label: "Delete memory",
|
|
654
|
-
mode: "system",
|
|
655
|
-
placement: "top",
|
|
656
|
-
trigger: /* @__PURE__ */ e(
|
|
657
|
-
ae,
|
|
658
|
-
{
|
|
659
|
-
focusMode: "system",
|
|
660
|
-
noBorder: !0,
|
|
661
|
-
label: "Delete memory",
|
|
662
|
-
variant: "primary",
|
|
663
|
-
iconClassName: "text-red-700 dark:text-red-500",
|
|
664
|
-
disabled: y.isPending,
|
|
665
|
-
onClick: () => K(
|
|
666
|
-
n.memoryId,
|
|
667
|
-
n.text,
|
|
668
|
-
n.createdAt
|
|
669
|
-
),
|
|
670
|
-
children: /* @__PURE__ */ e(ze, { size: "size-3", monotone: !0 })
|
|
671
|
-
}
|
|
672
|
-
)
|
|
673
|
-
}
|
|
674
|
-
) })
|
|
675
|
-
] }) })
|
|
676
|
-
] }, n.memoryId)) }),
|
|
677
|
-
/* @__PURE__ */ e(Ue, { children: /* @__PURE__ */ e(W, { children: /* @__PURE__ */ m(D, { colSpan: 4, children: [
|
|
678
|
-
k.total,
|
|
679
|
-
" memor",
|
|
680
|
-
k.total === 1 ? "y" : "ies"
|
|
681
|
-
] }) }) })
|
|
682
|
-
] }) : /* @__PURE__ */ e("p", { className: "m-0 italic opacity-70", children: "No memories stored." }))
|
|
683
|
-
] })
|
|
684
|
-
}
|
|
685
|
-
)
|
|
686
|
-
] });
|
|
687
|
-
}, nt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, UserMemoriesPanel: se, default: se }, Symbol.toStringTag, { value: "Module" }));
|
|
688
|
-
export {
|
|
689
|
-
ue as Re,
|
|
690
|
-
se as UserMemoriesPanel,
|
|
691
|
-
nt as UserMemoriesPanel$1
|
|
692
|
-
};
|