@versini/sassysaint 8.118.4 → 8.119.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.Dspi4cmi.js → AboutChangelog.B3zToB4T.js} +2 -2
- package/dist/chunks/{AboutEntry.DxWZPlbg.js → AboutEntry.Dc0GMtzL.js} +7 -7
- package/dist/chunks/{App.yIuQGm0t.js → App.Bcw00dJK.js} +647 -646
- package/dist/chunks/{BubbleActions.BMYwxyEv.js → BubbleActions.BcwPpzhU.js} +3 -3
- package/dist/chunks/ButtonIconDelete.CASHORv6.js +523 -0
- package/dist/chunks/{Chart.C1IWoXDe.js → Chart.B0oqrdYo.js} +2 -2
- package/dist/chunks/{ChatBubbleAssistant.BKlO1McH.js → ChatBubbleAssistant.DAwx85Wd.js} +9 -6
- package/dist/chunks/{ChatBubbleUser.CSjDB1B9.js → ChatBubbleUser.BRTLYDmZ.js} +4 -4
- package/dist/chunks/HistoryDataGrid.Bg984Jd_.js +465 -0
- package/dist/chunks/HistoryEntry.4GpBDf9x.js +305 -0
- package/dist/chunks/InlineFilter.Cv_LUpTp.js +123 -0
- package/dist/chunks/{LoginEntry.BEPZiizw.js → LoginEntry.5bQhuYQl.js} +4 -4
- package/dist/chunks/{LogoEntry.BZFz5IRw.js → LogoEntry.CN5P16eA.js} +175 -163
- package/dist/chunks/{MemoriesEntry.C40K6l5F.js → MemoriesEntry.D0q1U5FD.js} +234 -206
- package/dist/chunks/{ProfileEntry.C0WTyHem.js → ProfileEntry.Ck-5SP70.js} +4 -4
- package/dist/chunks/{SettingsEntry.B1WFVdjg.js → SettingsEntry.CfB9DKIp.js} +5 -5
- package/dist/chunks/{UsageEntry.CPOickJC.js → UsageEntry.BCFJMOjQ.js} +5 -5
- package/dist/chunks/{_baseUniq.YXUy3_Q9.js → _baseUniq.DRTEXwBu.js} +1 -1
- package/dist/chunks/{arc.CgPKPJv0.js → arc.x_GRGNuD.js} +1 -1
- package/dist/chunks/{architecture-U656AL7Q.D2ZUn_s6.js → architecture-U656AL7Q.DSfD0nUy.js} +1 -1
- package/dist/chunks/{architectureDiagram-VXUJARFQ.DbVJLkeI.js → architectureDiagram-VXUJARFQ.CAS-oDjc.js} +4 -4
- package/dist/chunks/{blockDiagram-VD42YOAC.DFlSEVyA.js → blockDiagram-VD42YOAC.P_XB2AgQ.js} +5 -5
- package/dist/chunks/{browser.DtDEL-3A.js → browser.oW1ZW8ge.js} +1 -1
- package/dist/chunks/{c4Diagram-YG6GDRKO.CiBMNtX8.js → c4Diagram-YG6GDRKO.Dc9Vyv3k.js} +2 -2
- package/dist/chunks/{channel.DS55bkfq.js → channel.TjlRRr3U.js} +1 -1
- package/dist/chunks/{chunk-4BX2VUAB.t3AfQtrb.js → chunk-4BX2VUAB.BwgmyLAX.js} +1 -1
- package/dist/chunks/{chunk-55IACEB6.tlGBBIP8.js → chunk-55IACEB6.Cgq1oeLK.js} +1 -1
- package/dist/chunks/{chunk-B4BG7PRW.DB-Y3GhQ.js → chunk-B4BG7PRW.Ds2wbzEG.js} +4 -4
- package/dist/chunks/{chunk-DI55MBZ5.CkwKVFLI.js → chunk-DI55MBZ5.Bft9jyaz.js} +3 -3
- package/dist/chunks/{chunk-FMBD7UC4.CRLAfQmx.js → chunk-FMBD7UC4.DF-Zr883.js} +1 -1
- package/dist/chunks/{chunk-QN33PNHL.DF4bWkbp.js → chunk-QN33PNHL.BVMRH_Hs.js} +1 -1
- package/dist/chunks/{chunk-QZHKN3VN.BijmX3ar.js → chunk-QZHKN3VN.DS306ds1.js} +1 -1
- package/dist/chunks/{chunk-TZMSLE5B.BIvqaR0r.js → chunk-TZMSLE5B.Cl4RUaGp.js} +1 -1
- package/dist/chunks/{classDiagram-2ON5EDUG.SU5U-1P1.js → classDiagram-2ON5EDUG.DbFfjSp_.js} +2 -2
- package/dist/chunks/{classDiagram-v2-WZHVMYZB.SU5U-1P1.js → classDiagram-v2-WZHVMYZB.DbFfjSp_.js} +2 -2
- package/dist/chunks/{clone.8clUx6ET.js → clone.B8XxgJj0.js} +1 -1
- package/dist/chunks/{cose-bilkent-S5V4N54A.DnWtIsYd.js → cose-bilkent-S5V4N54A.CL-tsB7O.js} +2 -2
- package/dist/chunks/{dagre-6UL2VRFP.C8KeFvOQ.js → dagre-6UL2VRFP.7xKesqEK.js} +5 -5
- package/dist/chunks/{diagram-PSM6KHXK.DnzHPurw.js → diagram-PSM6KHXK.D6JNXJQr.js} +4 -4
- package/dist/chunks/{diagram-QEK2KX5R.DCKZbQSh.js → diagram-QEK2KX5R.VaJKE9Ih.js} +3 -3
- package/dist/chunks/{diagram-S2PKOQOG.lY2nb2ry.js → diagram-S2PKOQOG.BjCuqhPd.js} +3 -3
- package/dist/chunks/{erDiagram-Q2GNP2WA.BYtHx1uZ.js → erDiagram-Q2GNP2WA.BYnxwTG-.js} +4 -4
- package/dist/chunks/{flowDiagram-NV44I4VS.G-nRLM7M.js → flowDiagram-NV44I4VS.DefWDma3.js} +5 -5
- package/dist/chunks/{ganttDiagram-JELNMOA3.B7RwC1m-.js → ganttDiagram-JELNMOA3.BrEeaW2n.js} +2 -2
- package/dist/chunks/{gitGraph-F6HP7TQM.Chwk8Igs.js → gitGraph-F6HP7TQM.C4_YWAr0.js} +1 -1
- package/dist/chunks/{gitGraphDiagram-NY62KEGX.BQpsCwST.js → gitGraphDiagram-NY62KEGX.GGrXKGya.js} +4 -4
- package/dist/chunks/{graph.toxuN_lw.js → graph.BxDrvENy.js} +2 -2
- package/dist/chunks/{index.KxPrp_tf.js → index.BMADibmh.js} +3 -3
- package/dist/chunks/{index.ChIqgESd.js → index.CR0NHbVR.js} +1 -1
- package/dist/chunks/{index.mDr9FsVI.js → index.CZRaE0eA.js} +1 -1
- package/dist/chunks/{index.7D5oQmQR.js → index.CsAjUl3G.js} +3 -3
- package/dist/chunks/{index.petd1VFV.js → index.DOwjLeiM.js} +1 -1
- package/dist/chunks/{index.D_muERB9.js → index.DS9SCH32.js} +1 -1
- package/dist/chunks/{index.Bt339Jho.js → index.DvThh-C6.js} +1 -1
- package/dist/chunks/{index.hGvmkGha.js → index.o4ZD5ALX.js} +2 -2
- package/dist/chunks/{index.BlDUpXR0.js → index.tqKeN7sl.js} +1 -1
- package/dist/chunks/{info-NVLQJR56.DqwhVDNM.js → info-NVLQJR56.E0G9wIVE.js} +1 -1
- package/dist/chunks/{infoDiagram-WHAUD3N6.Bz9PwgrD.js → infoDiagram-WHAUD3N6.CY9ADLsc.js} +2 -2
- package/dist/chunks/{journeyDiagram-XKPGCS4Q.b8ugCUee.js → journeyDiagram-XKPGCS4Q.BZHhK7w4.js} +4 -4
- package/dist/chunks/{kanban-definition-3W4ZIXB7.ruPmZWrk.js → kanban-definition-3W4ZIXB7.DQSZD0Em.js} +2 -2
- package/dist/chunks/{layout.Bw1IU1i2.js → layout.DUh_4gWb.js} +4 -4
- package/dist/chunks/{mermaid-parser.core.BgEYW9Yt.js → mermaid-parser.core.lAJFSSvC.js} +10 -10
- package/dist/chunks/{min.C98rd9wr.js → min.B3NH5ZNz.js} +2 -2
- package/dist/chunks/{mindmap-definition-VGOIOE7T.VWXpOB6F.js → mindmap-definition-VGOIOE7T.CVTcq_-S.js} +257 -232
- package/dist/chunks/{packet-BFZMPI3H.BYL6GQTI.js → packet-BFZMPI3H.CaaCaP6S.js} +1 -1
- package/dist/chunks/{pie-7BOR55EZ.BbY5iD1e.js → pie-7BOR55EZ.Ctr5Wngs.js} +1 -1
- package/dist/chunks/{pieDiagram-ADFJNKIX.CsOtW7r-.js → pieDiagram-ADFJNKIX.v0K5SYBL.js} +4 -4
- package/dist/chunks/{quadrantDiagram-AYHSOK5B.7UFNI_vX.js → quadrantDiagram-AYHSOK5B.CSGhc5R-.js} +1 -1
- package/dist/chunks/{radar-NHE76QYJ.DvagCir3.js → radar-NHE76QYJ.BYJioslS.js} +1 -1
- package/dist/chunks/{rehype-mermaid.hM-_EEUn.js → rehype-mermaid.CYJb7tO-.js} +33 -33
- package/dist/chunks/{requirementDiagram-UZGBJVZJ.CBvrcwfU.js → requirementDiagram-UZGBJVZJ.07FdvPam.js} +3 -3
- package/dist/chunks/{sankeyDiagram-TZEHDZUN.DwPokg-1.js → sankeyDiagram-TZEHDZUN.BJQl-LVq.js} +1 -1
- package/dist/chunks/{sequenceDiagram-WL72ISMW.DTlYi-bq.js → sequenceDiagram-WL72ISMW.D3HP-wCt.js} +3 -3
- package/dist/chunks/{stateDiagram-FKZM4ZOC.B3zjLqs6.js → stateDiagram-FKZM4ZOC.uXuYKEnS.js} +4 -4
- package/dist/chunks/{stateDiagram-v2-4FDKWEC3.M0ePKl-7.js → stateDiagram-v2-4FDKWEC3.i7NR_lBC.js} +2 -2
- package/dist/chunks/{timeline-definition-IT6M3QCI.QqZxgHc2.js → timeline-definition-IT6M3QCI.CfrxZtW7.js} +2 -2
- package/dist/chunks/{treemap-KMMF4GRG.BmCv7l6d.js → treemap-KMMF4GRG.D0E-EXib.js} +1 -1
- package/dist/chunks/{useMarkdown.ZHvHgCd8.js → useMarkdown.CVmi3L7b.js} +8 -8
- package/dist/chunks/{xychartDiagram-PRI3JC2R.CPjv7vTS.js → xychartDiagram-PRI3JC2R.BedGeb-X.js} +1 -1
- package/dist/components/SassySaint/SassySaint.js +1 -1
- package/dist/index.js +3 -3
- package/dist/style.css +1 -1
- package/package.json +4 -4
- package/dist/chunks/ButtonIconDelete.BMqZFgu1.js +0 -326
- package/dist/chunks/ChatHistoryTable.B8dA3To0.js +0 -322
- package/dist/chunks/HistoryEntry.Bhv62llk.js +0 -333
- package/dist/chunks/useAnimatedHeight.3F4Xj7iE.js +0 -91
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
import { jsx as t, jsxs as h, Fragment as L } from "react/jsx-runtime";
|
|
2
|
+
import { DataGridContext as P, useColumnMeasurement as X, getBodyClass as Z, DataGridHeader as J, DataGridRow as j, DataGridCell as d, DataGridCellSort as A, ButtonIconDelete as K, DataGrid as Q } from "./ButtonIconDelete.CASHORv6.js";
|
|
3
|
+
import { forwardRef as ee, useContext as te, useRef as R, useState as q, useCallback as M, useEffect as N, useImperativeHandle as re, useMemo as G } from "react";
|
|
4
|
+
import { CellWrapper as ne, IconCloseLight as se, ButtonIcon as O, IconRestore as oe, IconStarInCircle as le, IconStarInCircleLight as ae, CARDS as ce } from "./LogoEntry.CN5P16eA.js";
|
|
5
|
+
import { pluralize as F, numberFormatter as ie, ResponsiveTooltip as U, isProbablyMobile as me } from "./App.Bcw00dJK.js";
|
|
6
|
+
import k from "clsx";
|
|
7
|
+
import { y as D, V as H, INFINITE_SCROLL_THRESHOLD as ue, INFINITE_SCROLL_LIMIT as de } from "./index.o4ZD5ALX.js";
|
|
8
|
+
const fe = 20, xe = 5, pe = "20px", z = "data-row-index";
|
|
9
|
+
function he(e) {
|
|
10
|
+
let r = e.parentElement;
|
|
11
|
+
for (; r; ) {
|
|
12
|
+
const l = getComputedStyle(r).overflowY;
|
|
13
|
+
if (l === "auto" || l === "scroll")
|
|
14
|
+
return r;
|
|
15
|
+
r = r.parentElement;
|
|
16
|
+
}
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
function ge({ data: e, children: r, batchSize: o = fe, threshold: l = xe, rootMargin: i = pe, onVisibleCountChange: f, className: x }, g) {
|
|
20
|
+
const u = te(P), b = R(null), y = R(null), m = R(null), s = e.length, C = Math.min(o + l, s), [a, v] = q(C), I = a < s, T = M((n) => {
|
|
21
|
+
const c = b.current;
|
|
22
|
+
if (!c)
|
|
23
|
+
return;
|
|
24
|
+
const S = c.querySelector(`[${z}="${n}"]`);
|
|
25
|
+
if (S) {
|
|
26
|
+
const $ = S.querySelector('[role="row"]');
|
|
27
|
+
$ && $.scrollIntoView({
|
|
28
|
+
behavior: "smooth",
|
|
29
|
+
block: "center"
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}, []);
|
|
33
|
+
N(() => {
|
|
34
|
+
if (m.current !== null) {
|
|
35
|
+
const n = m.current;
|
|
36
|
+
n < a && (requestAnimationFrame(() => {
|
|
37
|
+
T(n);
|
|
38
|
+
}), m.current = null);
|
|
39
|
+
}
|
|
40
|
+
}, [
|
|
41
|
+
a,
|
|
42
|
+
T
|
|
43
|
+
]), re(g, () => ({
|
|
44
|
+
scrollToIndex: (n) => {
|
|
45
|
+
if (n < 0 || n >= s) {
|
|
46
|
+
console.warn(`scrollToIndex: index ${n} is out of bounds (0-${s - 1})`);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (n < a) {
|
|
50
|
+
T(n);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const c = Math.min(n + l + 1, s);
|
|
54
|
+
m.current = n, v(c);
|
|
55
|
+
}
|
|
56
|
+
}), [
|
|
57
|
+
s,
|
|
58
|
+
a,
|
|
59
|
+
l,
|
|
60
|
+
T
|
|
61
|
+
]), N(() => {
|
|
62
|
+
v(Math.min(o + l, s));
|
|
63
|
+
}, [
|
|
64
|
+
s,
|
|
65
|
+
o,
|
|
66
|
+
l
|
|
67
|
+
]), N(() => {
|
|
68
|
+
f?.(a, s);
|
|
69
|
+
}, [
|
|
70
|
+
a,
|
|
71
|
+
s,
|
|
72
|
+
f
|
|
73
|
+
]);
|
|
74
|
+
const p = M((n) => {
|
|
75
|
+
n[0]?.isIntersecting && v((S) => Math.min(S + o, s));
|
|
76
|
+
}, [
|
|
77
|
+
o,
|
|
78
|
+
s
|
|
79
|
+
]), w = M((n) => {
|
|
80
|
+
if (y.current && (y.current.disconnect(), y.current = null), n && I) {
|
|
81
|
+
const c = he(n);
|
|
82
|
+
y.current = new IntersectionObserver(p, {
|
|
83
|
+
root: c,
|
|
84
|
+
rootMargin: i
|
|
85
|
+
}), y.current.observe(n);
|
|
86
|
+
}
|
|
87
|
+
}, [
|
|
88
|
+
I,
|
|
89
|
+
p,
|
|
90
|
+
i
|
|
91
|
+
]);
|
|
92
|
+
N(() => () => {
|
|
93
|
+
y.current?.disconnect();
|
|
94
|
+
}, []);
|
|
95
|
+
const E = G(() => I ? Math.max(0, a - l) : -1, [
|
|
96
|
+
I,
|
|
97
|
+
a,
|
|
98
|
+
l
|
|
99
|
+
]), B = G(() => {
|
|
100
|
+
const n = [];
|
|
101
|
+
for (let c = 0; c < a && c < s; c++)
|
|
102
|
+
c === E && n.push(/* @__PURE__ */ t("div", {
|
|
103
|
+
ref: w,
|
|
104
|
+
"aria-hidden": "true",
|
|
105
|
+
style: {
|
|
106
|
+
height: "1px",
|
|
107
|
+
background: "transparent"
|
|
108
|
+
}
|
|
109
|
+
}, "__infinite-scroll-marker-inline__")), n.push(/* @__PURE__ */ t("div", {
|
|
110
|
+
[z]: c,
|
|
111
|
+
style: {
|
|
112
|
+
display: "contents"
|
|
113
|
+
},
|
|
114
|
+
children: r(e[c], c)
|
|
115
|
+
}, c));
|
|
116
|
+
return E === a && I && n.push(/* @__PURE__ */ t("div", {
|
|
117
|
+
ref: w,
|
|
118
|
+
"aria-hidden": "true",
|
|
119
|
+
style: {
|
|
120
|
+
height: "1px",
|
|
121
|
+
background: "transparent"
|
|
122
|
+
}
|
|
123
|
+
}, "__infinite-scroll-marker-end__")), n;
|
|
124
|
+
}, [
|
|
125
|
+
e,
|
|
126
|
+
a,
|
|
127
|
+
s,
|
|
128
|
+
E,
|
|
129
|
+
I,
|
|
130
|
+
r,
|
|
131
|
+
w
|
|
132
|
+
]);
|
|
133
|
+
X(b, B);
|
|
134
|
+
const W = Z(!!u.columns, x);
|
|
135
|
+
return /* @__PURE__ */ t(P.Provider, {
|
|
136
|
+
value: {
|
|
137
|
+
...u,
|
|
138
|
+
cellWrapper: ne.BODY
|
|
139
|
+
},
|
|
140
|
+
children: /* @__PURE__ */ t("div", {
|
|
141
|
+
ref: b,
|
|
142
|
+
role: "rowgroup",
|
|
143
|
+
className: W,
|
|
144
|
+
children: B
|
|
145
|
+
})
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
const be = /* @__PURE__ */ ee(ge), ye = ({
|
|
149
|
+
sortDirection: e,
|
|
150
|
+
sortedCell: r,
|
|
151
|
+
onSortChange: o,
|
|
152
|
+
caption: l,
|
|
153
|
+
isSearchActive: i = !1,
|
|
154
|
+
showTokenUsage: f = !0
|
|
155
|
+
}) => {
|
|
156
|
+
const x = (g) => {
|
|
157
|
+
o(g);
|
|
158
|
+
};
|
|
159
|
+
return /* @__PURE__ */ t(J, { caption: l, children: /* @__PURE__ */ h(j, { children: [
|
|
160
|
+
/* @__PURE__ */ t(d, { className: "invisible", children: "Row" }),
|
|
161
|
+
f ? /* @__PURE__ */ h(L, { children: [
|
|
162
|
+
/* @__PURE__ */ t(d, { className: "text-xs sm:text-sm", children: "Summary" }),
|
|
163
|
+
i ? /* @__PURE__ */ t(d, { className: "text-xs sm:text-sm", children: "Date" }) : /* @__PURE__ */ t(
|
|
164
|
+
A,
|
|
165
|
+
{
|
|
166
|
+
focusMode: "system",
|
|
167
|
+
buttonClassName: "text-xs sm:text-sm",
|
|
168
|
+
cellId: D,
|
|
169
|
+
align: "left",
|
|
170
|
+
sortDirection: r === D ? e : !1,
|
|
171
|
+
sortedCell: r,
|
|
172
|
+
onSort: x,
|
|
173
|
+
children: "Date"
|
|
174
|
+
}
|
|
175
|
+
),
|
|
176
|
+
i ? /* @__PURE__ */ t(d, { align: "right", className: "text-xs sm:text-sm", children: "Tokens" }) : /* @__PURE__ */ t(
|
|
177
|
+
A,
|
|
178
|
+
{
|
|
179
|
+
focusMode: "system",
|
|
180
|
+
buttonClassName: "text-xs sm:text-sm",
|
|
181
|
+
cellId: H,
|
|
182
|
+
align: "right",
|
|
183
|
+
sortDirection: r === H ? e : !1,
|
|
184
|
+
sortedCell: r,
|
|
185
|
+
onSort: x,
|
|
186
|
+
children: "Tokens"
|
|
187
|
+
}
|
|
188
|
+
)
|
|
189
|
+
] }) : /* @__PURE__ */ h(L, { children: [
|
|
190
|
+
i ? /* @__PURE__ */ t(d, { className: "text-xs sm:text-sm", children: "Date" }) : /* @__PURE__ */ t(
|
|
191
|
+
A,
|
|
192
|
+
{
|
|
193
|
+
focusMode: "system",
|
|
194
|
+
buttonClassName: "text-xs sm:text-sm",
|
|
195
|
+
cellId: D,
|
|
196
|
+
align: "left",
|
|
197
|
+
sortDirection: r === D ? e : !1,
|
|
198
|
+
sortedCell: r,
|
|
199
|
+
onSort: x,
|
|
200
|
+
children: "Date"
|
|
201
|
+
}
|
|
202
|
+
),
|
|
203
|
+
/* @__PURE__ */ t(d, { className: "text-xs sm:text-sm", children: "Summary" })
|
|
204
|
+
] }),
|
|
205
|
+
/* @__PURE__ */ t(d, { align: "right", className: "text-xs sm:text-sm", children: "Actions" })
|
|
206
|
+
] }) });
|
|
207
|
+
};
|
|
208
|
+
const we = "av-pill", ke = ({ variant: e }) => k("rounded-xs border", {
|
|
209
|
+
"border-border-information": e === "information",
|
|
210
|
+
"border-border-warning": e === "warning",
|
|
211
|
+
"border-border-success": e === "success",
|
|
212
|
+
"border-border-error": e === "error"
|
|
213
|
+
}), V = ({ variant: e }) => k("not-prose", {
|
|
214
|
+
"text-copy-information": e === "information",
|
|
215
|
+
"text-copy-warning": e === "warning",
|
|
216
|
+
"text-copy-success": e === "success",
|
|
217
|
+
"text-copy-error": e === "error"
|
|
218
|
+
}), Ie = ({ variant: e }) => k({
|
|
219
|
+
"bg-surface-information": e === "information",
|
|
220
|
+
"bg-surface-warning": e === "warning",
|
|
221
|
+
"bg-surface-success": e === "success",
|
|
222
|
+
"bg-surface-error": e === "error"
|
|
223
|
+
}), Ce = (e) => {
|
|
224
|
+
const { className: r, variant: o } = e;
|
|
225
|
+
return {
|
|
226
|
+
main: k(we, "inline-flex items-center gap-1 px-2 py-0.5 text-xs", ke({
|
|
227
|
+
variant: o
|
|
228
|
+
}), V({
|
|
229
|
+
variant: o
|
|
230
|
+
}), Ie(e), r),
|
|
231
|
+
button: k("inline-flex items-center justify-center", "ml-1", "focus:outline", "focus:outline-1", "focus:outline-offset-1", "focus:outline-focus-dark", "hover:bg-surface-medium/50", "rounded-full", V({
|
|
232
|
+
variant: o
|
|
233
|
+
}))
|
|
234
|
+
};
|
|
235
|
+
}, Y = ({ label: e, className: r, variant: o = "information", description: l, onClose: i }) => {
|
|
236
|
+
const [f, x] = q(!0), g = (b) => {
|
|
237
|
+
i && (i(b), b.defaultPrevented || x(!1));
|
|
238
|
+
};
|
|
239
|
+
if (!f)
|
|
240
|
+
return null;
|
|
241
|
+
const u = Ce({
|
|
242
|
+
className: r,
|
|
243
|
+
variant: o
|
|
244
|
+
});
|
|
245
|
+
return /* @__PURE__ */ h("div", {
|
|
246
|
+
role: "text",
|
|
247
|
+
className: u.main,
|
|
248
|
+
children: [
|
|
249
|
+
l && /* @__PURE__ */ t("span", {
|
|
250
|
+
className: "sr-only",
|
|
251
|
+
children: l
|
|
252
|
+
}),
|
|
253
|
+
/* @__PURE__ */ t("span", {
|
|
254
|
+
children: e
|
|
255
|
+
}),
|
|
256
|
+
i && /* @__PURE__ */ t("button", {
|
|
257
|
+
type: "button",
|
|
258
|
+
onClick: g,
|
|
259
|
+
className: u.button,
|
|
260
|
+
"aria-label": "Close",
|
|
261
|
+
children: /* @__PURE__ */ t(se, {
|
|
262
|
+
size: "size-3"
|
|
263
|
+
})
|
|
264
|
+
})
|
|
265
|
+
]
|
|
266
|
+
});
|
|
267
|
+
};
|
|
268
|
+
function Ne(e, r, o) {
|
|
269
|
+
return o && r > e ? `Showing ${F(`${e} chat`, e)} out of ${r}` : F(`${e} chat`, e);
|
|
270
|
+
}
|
|
271
|
+
const _ = {
|
|
272
|
+
rowNumber: "dark:text-copy-medium",
|
|
273
|
+
summary: "dark:text-white sm:max-w-full text-xs sm:text-sm",
|
|
274
|
+
timestamp: "dark:text-copy-medium sm:whitespace-nowrap text-xs sm:text-sm max-w-20 sm:max-w-none",
|
|
275
|
+
tokenUsage: "dark:text-copy-medium text-xs sm:text-sm"
|
|
276
|
+
};
|
|
277
|
+
function ve({
|
|
278
|
+
item: e,
|
|
279
|
+
index: r,
|
|
280
|
+
onClickRestore: o,
|
|
281
|
+
onClickDelete: l,
|
|
282
|
+
onClickFavorite: i,
|
|
283
|
+
showTokenUsage: f = !0,
|
|
284
|
+
isActive: x = !1
|
|
285
|
+
}) {
|
|
286
|
+
const g = e.timestamp.split(",")[0], u = e.similarityScore !== void 0 && e.similarityScore !== null ? Math.round(e.similarityScore * 100) : null, b = u !== null && u < 40 ? "warning" : "success", y = e.keywordMatch === !0, m = /* @__PURE__ */ t(
|
|
287
|
+
d,
|
|
288
|
+
{
|
|
289
|
+
className: k(_.summary),
|
|
290
|
+
style: { wordBreak: "break-word" },
|
|
291
|
+
children: /* @__PURE__ */ h("div", { className: "flex flex-col gap-1", children: [
|
|
292
|
+
/* @__PURE__ */ h("div", { className: "flex flex-wrap gap-1", children: [
|
|
293
|
+
u !== null && /* @__PURE__ */ t(
|
|
294
|
+
Y,
|
|
295
|
+
{
|
|
296
|
+
variant: b,
|
|
297
|
+
label: `${u}% semantic`
|
|
298
|
+
}
|
|
299
|
+
),
|
|
300
|
+
y && /* @__PURE__ */ t(Y, { variant: "information", label: "keyword" })
|
|
301
|
+
] }),
|
|
302
|
+
/* @__PURE__ */ t("span", { children: e.summary })
|
|
303
|
+
] })
|
|
304
|
+
}
|
|
305
|
+
), s = /* @__PURE__ */ t(d, { className: k(_.timestamp), children: g }), C = f ? /* @__PURE__ */ t(d, { align: "right", className: k(_.tokenUsage), children: e.tokenUsage ? ie.format(e.tokenUsage) : "0" }) : null, a = /* @__PURE__ */ t(d, { align: "center", borderLeft: !0, children: /* @__PURE__ */ h("div", { className: "flex flex-col items-end sm:flex-row gap-2", children: [
|
|
306
|
+
/* @__PURE__ */ t(
|
|
307
|
+
U,
|
|
308
|
+
{
|
|
309
|
+
label: "Restore chat",
|
|
310
|
+
placement: "top",
|
|
311
|
+
trigger: /* @__PURE__ */ t(
|
|
312
|
+
O,
|
|
313
|
+
{
|
|
314
|
+
noBorder: !0,
|
|
315
|
+
label: "Restore chat",
|
|
316
|
+
variant: "primary",
|
|
317
|
+
onClick: async () => {
|
|
318
|
+
await o(e);
|
|
319
|
+
},
|
|
320
|
+
children: /* @__PURE__ */ t(
|
|
321
|
+
oe,
|
|
322
|
+
{
|
|
323
|
+
size: "size-3",
|
|
324
|
+
monotone: !0,
|
|
325
|
+
className: "text-copy-success dark:text-copy-success-light"
|
|
326
|
+
}
|
|
327
|
+
)
|
|
328
|
+
}
|
|
329
|
+
)
|
|
330
|
+
}
|
|
331
|
+
),
|
|
332
|
+
/* @__PURE__ */ t(
|
|
333
|
+
U,
|
|
334
|
+
{
|
|
335
|
+
label: e.favoriteChat ? "Remove from favorites" : "Add to favorites",
|
|
336
|
+
placement: "top",
|
|
337
|
+
trigger: /* @__PURE__ */ t(
|
|
338
|
+
O,
|
|
339
|
+
{
|
|
340
|
+
noBorder: !0,
|
|
341
|
+
label: e.favoriteChat ? "Remove from favorites" : "Add to favorites",
|
|
342
|
+
variant: "primary",
|
|
343
|
+
onClick: async () => {
|
|
344
|
+
await i(e);
|
|
345
|
+
},
|
|
346
|
+
children: e.favoriteChat ? /* @__PURE__ */ t(le, { size: "size-4", monotone: !0 }) : /* @__PURE__ */ t(ae, { size: "size-4", monotone: !0 })
|
|
347
|
+
}
|
|
348
|
+
)
|
|
349
|
+
}
|
|
350
|
+
),
|
|
351
|
+
/* @__PURE__ */ t(
|
|
352
|
+
K,
|
|
353
|
+
{
|
|
354
|
+
label: "Delete chat",
|
|
355
|
+
disabled: !1,
|
|
356
|
+
onClick: () => {
|
|
357
|
+
l(e);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
)
|
|
361
|
+
] }) });
|
|
362
|
+
return /* @__PURE__ */ h(j, { active: x, children: [
|
|
363
|
+
/* @__PURE__ */ t(d, { className: k(_.rowNumber), children: r + 1 }),
|
|
364
|
+
f ? /* @__PURE__ */ h(L, { children: [
|
|
365
|
+
m,
|
|
366
|
+
s,
|
|
367
|
+
C
|
|
368
|
+
] }) : /* @__PURE__ */ h(L, { children: [
|
|
369
|
+
s,
|
|
370
|
+
m
|
|
371
|
+
] }),
|
|
372
|
+
a
|
|
373
|
+
] });
|
|
374
|
+
}
|
|
375
|
+
const Ae = ({
|
|
376
|
+
filteredHistory: e,
|
|
377
|
+
sortDirection: r,
|
|
378
|
+
sortedCell: o,
|
|
379
|
+
onSortChange: l,
|
|
380
|
+
onClickRestore: i,
|
|
381
|
+
onClickDelete: f,
|
|
382
|
+
onClickFavorite: x,
|
|
383
|
+
isLoading: g = !1,
|
|
384
|
+
totalHistoryCount: u,
|
|
385
|
+
isFiltered: b = !1,
|
|
386
|
+
isSearchActive: y = !1,
|
|
387
|
+
activeChatId: m
|
|
388
|
+
}) => {
|
|
389
|
+
const s = me(), C = R(null), a = R(!1);
|
|
390
|
+
N(() => {
|
|
391
|
+
if (!m || a.current)
|
|
392
|
+
return;
|
|
393
|
+
const p = e.findIndex(
|
|
394
|
+
(w) => w.id === m
|
|
395
|
+
);
|
|
396
|
+
if (p !== -1) {
|
|
397
|
+
a.current = !0;
|
|
398
|
+
const w = setTimeout(() => {
|
|
399
|
+
C.current?.scrollToIndex(p);
|
|
400
|
+
}, 100);
|
|
401
|
+
return () => clearTimeout(w);
|
|
402
|
+
}
|
|
403
|
+
}, [m, e]), N(() => {
|
|
404
|
+
a.current = !1;
|
|
405
|
+
}, [m]);
|
|
406
|
+
const v = Ne(
|
|
407
|
+
e.length,
|
|
408
|
+
u ?? e.length,
|
|
409
|
+
b
|
|
410
|
+
);
|
|
411
|
+
return /* @__PURE__ */ h(
|
|
412
|
+
Q,
|
|
413
|
+
{
|
|
414
|
+
stickyHeader: !0,
|
|
415
|
+
stickyFooter: !0,
|
|
416
|
+
compact: !0,
|
|
417
|
+
mode: "alt-system",
|
|
418
|
+
blurEffect: "medium",
|
|
419
|
+
columns: s ? ["auto", "auto", "1fr", ".4fr"] : ["auto", "minmax(10px, 1fr)", ".3fr", ".3fr", ".3fr"],
|
|
420
|
+
wrapperClassName: k(
|
|
421
|
+
"max-h-[clamp(12rem,calc(100dvh-24rem),60dvh)]",
|
|
422
|
+
"sm:max-h-[clamp(12rem,calc(100dvh-24rem),60dvh)]"
|
|
423
|
+
),
|
|
424
|
+
loading: g && e.length > 0,
|
|
425
|
+
children: [
|
|
426
|
+
/* @__PURE__ */ t(
|
|
427
|
+
ye,
|
|
428
|
+
{
|
|
429
|
+
sortDirection: r,
|
|
430
|
+
sortedCell: o,
|
|
431
|
+
onSortChange: l,
|
|
432
|
+
caption: v,
|
|
433
|
+
isSearchActive: y,
|
|
434
|
+
showTokenUsage: !s
|
|
435
|
+
}
|
|
436
|
+
),
|
|
437
|
+
g && e.length === 0 ? /* @__PURE__ */ t("div", { className: "p-4 text-center", role: "status", "aria-live": "polite", children: "Loading..." }) : /* @__PURE__ */ t(
|
|
438
|
+
be,
|
|
439
|
+
{
|
|
440
|
+
ref: C,
|
|
441
|
+
data: e.filter((p) => p?.summary),
|
|
442
|
+
batchSize: de,
|
|
443
|
+
threshold: ue,
|
|
444
|
+
children: (p, w) => /* @__PURE__ */ t(
|
|
445
|
+
ve,
|
|
446
|
+
{
|
|
447
|
+
item: p,
|
|
448
|
+
index: w,
|
|
449
|
+
onClickRestore: i,
|
|
450
|
+
onClickDelete: f,
|
|
451
|
+
onClickFavorite: x,
|
|
452
|
+
showTokenUsage: !s,
|
|
453
|
+
isActive: m === p.id
|
|
454
|
+
},
|
|
455
|
+
`${ce.HISTORY.TITLE}-${p.id}-${w}`
|
|
456
|
+
)
|
|
457
|
+
}
|
|
458
|
+
)
|
|
459
|
+
]
|
|
460
|
+
}
|
|
461
|
+
);
|
|
462
|
+
};
|
|
463
|
+
export {
|
|
464
|
+
Ae as HistoryDataGrid
|
|
465
|
+
};
|