@mx-cartographer/experiences 7.0.23-alpha.al10 → 7.0.23-alpha.al11

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 (58) hide show
  1. package/dist/{Account-CVVDlNDC.mjs → Account-BW3-oYEs.mjs} +1 -1
  2. package/dist/{AccountDetailsContent-bQKVSCZF.mjs → AccountDetailsContent-UxSEMBo_.mjs} +8 -8
  3. package/dist/{AccountDetailsHeader-BGQAu0Xm.mjs → AccountDetailsHeader-Eb3WvBGm.mjs} +8 -8
  4. package/dist/{AccountFields-CC7kzfPK.mjs → AccountFields-CIz-r3gP.mjs} +2 -2
  5. package/dist/{AccountListItem-wgvQjLxW.mjs → AccountListItem-B-ZjJ4Gp.mjs} +3 -3
  6. package/dist/{AccountStore-DpglOysH.mjs → AccountStore-DCDmxODy.mjs} +5 -5
  7. package/dist/{Accounts-ByViymVi.mjs → Accounts-CA-nqAjT.mjs} +1 -1
  8. package/dist/{BudgetUtil-gzgNEDE7.mjs → BudgetUtil-CeSLAcsl.mjs} +1 -1
  9. package/dist/{CategorySelectorDrawer-LpZcwQPa.mjs → CategorySelectorDrawer-BJ9jlCyt.mjs} +4 -4
  10. package/dist/{ConnectDrawer-C2minBK_.mjs → ConnectDrawer-phFH6OHt.mjs} +1 -1
  11. package/dist/{ConnectionsDrawer-Cd4dZuWL.mjs → ConnectionsDrawer-ihxkAi1P.mjs} +2 -2
  12. package/dist/{CurrencyInput-Dz4r9Rfe.mjs → CurrencyInput-bEx2Mbd0.mjs} +1 -1
  13. package/dist/{DebtsStore-B51DTXVj.mjs → DebtsStore-VkyMADzd.mjs} +1 -1
  14. package/dist/ExportCsvAction-CbMfQ2Wa.mjs +24 -0
  15. package/dist/{GoalStore-DqQ2FMx5.mjs → GoalStore-eSOkI6uE.mjs} +2 -2
  16. package/dist/{Help-DVPbIxMM.mjs → Help-KAAMEubC.mjs} +1 -1
  17. package/dist/{LineChart-DLk-bww5.mjs → LineChart-BWWmmJxV.mjs} +1 -1
  18. package/dist/{ListItemAction-DE6S0N5o.mjs → ListItemAction-DNZZ5fSa.mjs} +1 -1
  19. package/dist/{ManageIncome-BokhnWOn.mjs → ManageIncome-DbsiKUoO.mjs} +4 -4
  20. package/dist/{MicroWidgetContainer-5YscP1xa.mjs → MicroWidgetContainer-Dxz8uBN9.mjs} +1 -1
  21. package/dist/{MiniWidgetContainer-BlsgwNew.mjs → MiniWidgetContainer-CTyjmE1h.mjs} +1 -1
  22. package/dist/{NetWorthStore-C0hQSRzt.mjs → NetWorthStore-B6xF9eGH.mjs} +2 -2
  23. package/dist/{NotificationSettings-CWx6H-2z.mjs → NotificationSettings-BJFyyZYE.mjs} +2 -2
  24. package/dist/{OriginalBalanceAction-BKsSQVnI.mjs → OriginalBalanceAction-DepsKiJz.mjs} +3 -3
  25. package/dist/{RecurringSettings-CICRt51C.mjs → RecurringSettings-Dj29piAQ.mjs} +3 -3
  26. package/dist/ResponsiveButton-DZFp78fJ.mjs +45 -0
  27. package/dist/{TransactionDetails-BXl0m15s.mjs → TransactionDetails-C-z3HGTT.mjs} +37 -37
  28. package/dist/{TransactionStore-BElBVYfk.mjs → TransactionStore-0tLtBEIC.mjs} +209 -248
  29. package/dist/TrendsStore-WrHxzdbQ.mjs +565 -0
  30. package/dist/{User-DtwqVm3K.mjs → User-Dq9Qj764.mjs} +1 -1
  31. package/dist/ViewMoreMicroCard-DFAY0tA8.mjs +1974 -0
  32. package/dist/{WidgetContainer-DK8aZO5l.mjs → WidgetContainer-CdBs9WOZ.mjs} +2 -2
  33. package/dist/accounts/index.es.js +12 -12
  34. package/dist/analytics/index.es.js +8 -8
  35. package/dist/budgets/index.es.js +10 -10
  36. package/dist/cashflow/index.es.js +7 -7
  37. package/dist/categories/index.es.js +1 -1
  38. package/dist/common/index.es.js +518 -577
  39. package/dist/dashboard/index.es.js +9 -9
  40. package/dist/debts/index.es.js +9 -9
  41. package/dist/{exportTransactionsToCSV-Cf5VRYVr.mjs → exportTransactionsToCSV-BDlt8u0n.mjs} +1 -1
  42. package/dist/finstrong/index.es.js +6 -6
  43. package/dist/goals/index.es.js +11 -11
  44. package/dist/help/index.es.js +3 -3
  45. package/dist/{hooks-DUeXom8C.mjs → hooks-DkUqN6JE.mjs} +13 -13
  46. package/dist/investments/index.es.js +3 -3
  47. package/dist/merchants/index.es.js +1 -1
  48. package/dist/microinsights/index.es.js +14 -1969
  49. package/dist/networth/index.es.js +7 -7
  50. package/dist/notifications/index.es.js +2 -2
  51. package/dist/recurringtransactions/index.es.js +8 -8
  52. package/dist/settings/index.es.js +24 -24
  53. package/dist/spending/index.es.js +21 -21
  54. package/dist/transactions/index.es.js +259 -270
  55. package/dist/trends/index.es.js +789 -413
  56. package/package.json +1 -1
  57. package/dist/TrendsStore-DRuzsVVE.mjs +0 -505
  58. package/dist/TrendsWidget-CRi8EO04.mjs +0 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-cartographer/experiences",
3
- "version": "7.0.23-alpha.al10",
3
+ "version": "7.0.23-alpha.al11",
4
4
  "description": "Library containing experience widgets",
5
5
  "author": "MX",
6
6
  "license": "MIT",
@@ -1,505 +0,0 @@
1
- import _, { useState as q, useEffect as J, useRef as vt } from "react";
2
- import { k as St, u as xt, j as K } from "./hooks-DUeXom8C.mjs";
3
- import { jsxs as S, jsx as i } from "react/jsx-runtime";
4
- import A from "@mui/material/Box";
5
- import O from "@mui/material/Stack";
6
- import { useTheme as Q } from "@mui/material/styles";
7
- import { LineChart as _t } from "@mui/x-charts";
8
- import { u as U } from "./useScreenSize-B6JyS_Lj.mjs";
9
- import { u as Mt } from "./useDimensions-27p2evRx.mjs";
10
- import { observer as Tt } from "mobx-react-lite";
11
- import At from "@mui/material/Card";
12
- import Dt from "@mui/material/CardContent";
13
- import P from "@mui/material/Divider";
14
- import X from "@mui/material/Grid";
15
- import { CategoryIcon as Lt, Text as D } from "@mxenabled/mxui";
16
- import { b as Rt } from "./Localization-2MODESHW.mjs";
17
- import { C as B } from "./CurrencyText-YUhH2caW.mjs";
18
- import { useTheme as Ht, Card as Et, CardContent as kt, Box as Gt } from "@mui/material";
19
- import { f as L, D as R } from "./Dialog-CWW597AF.mjs";
20
- import wt from "@mui/material/Button";
21
- import { C as T, b as It, c as Nt } from "./Category-CevNQ03n.mjs";
22
- import { f as z } from "./NumberFormatting-CtWHhyBX.mjs";
23
- import { makeAutoObservable as Bt } from "mobx";
24
- import { addSeconds as Ot } from "date-fns/addSeconds";
25
- import { differenceInCalendarMonths as $t } from "date-fns/differenceInCalendarMonths";
26
- import { endOfMonth as V } from "date-fns/endOfMonth";
27
- import { subMonths as jt } from "date-fns/subMonths";
28
- const Te = () => {
29
- const { isInitialized: o, appDataStore: e } = St(), [r, a] = q(!1);
30
- return J(() => {
31
- o && e.clientInsightProfile?.is_enabled && a(!0);
32
- }, [o, e.clientInsightProfile]), r;
33
- }, Z = ({ categoryGuid: o, topLevelCategoryGuid: e }) => {
34
- const { categories: r } = xt(), { getCategoryName: a } = K(), n = a(o);
35
- return /* @__PURE__ */ S(O, { alignItems: "center", direction: "column", gap: "8", justifyContent: "center", mb: 4, children: [
36
- /* @__PURE__ */ i(
37
- A,
38
- {
39
- "aria-label": Rt(r.category_icon_label_aria, n),
40
- mb: 4,
41
- role: "img",
42
- children: /* @__PURE__ */ i(Lt, { categoryGuid: e })
43
- }
44
- ),
45
- /* @__PURE__ */ i(D, { variant: "Body", children: n })
46
- ] });
47
- }, Wt = ({
48
- categoryGuids: { guid: o, topLevelGuid: e },
49
- hoveredAreaData: r,
50
- cursorPosition: a,
51
- chartContainerRef: n
52
- }) => {
53
- const l = Q(), c = vt(null), [h, m] = q({ x: a.x, y: a.y });
54
- if (J(() => {
55
- (() => {
56
- const u = c.current, f = n.current;
57
- if (!u || !f) return;
58
- const y = u.getBoundingClientRect(), b = f.getBoundingClientRect();
59
- let p = a.x, v = a.y;
60
- p + y.width * 2 > b.right ? p = a.x - y.width : p - y.width < b.left && (p = a.x), v + y.height * 2 > b.bottom && (v = a.y - y.height), m({ x: p, y: v });
61
- })();
62
- }, [a, n]), !r) return null;
63
- const C = r.reduce((d, u) => d + u.y, 0);
64
- return /* @__PURE__ */ i(
65
- At,
66
- {
67
- ref: c,
68
- sx: {
69
- position: "absolute",
70
- top: h.y,
71
- left: h.x,
72
- width: 250,
73
- pointerEvents: "none"
74
- },
75
- children: /* @__PURE__ */ S(Dt, { children: [
76
- /* @__PURE__ */ S(A, { alignItems: "center", display: "flex", flexDirection: "column", children: [
77
- /* @__PURE__ */ i(Z, { categoryGuid: o, topLevelCategoryGuid: e }),
78
- /* @__PURE__ */ i(D, { variant: "Small", children: `${r.length}-month total` }),
79
- /* @__PURE__ */ i(B, { amount: C, bold: !0, formatString: "0,0", variant: "body2" })
80
- ] }),
81
- /* @__PURE__ */ i(P, { sx: { my: 16, width: "100%" } }),
82
- /* @__PURE__ */ i(X, { container: !0, children: r.map((d, u) => /* @__PURE__ */ S(_.Fragment, { children: [
83
- u > 0 && u % 3 === 0 && /* @__PURE__ */ i(P, { sx: { my: 16, width: "100%" } }),
84
- /* @__PURE__ */ i(X, { item: !0, xs: 4, children: /* @__PURE__ */ S(A, { alignItems: "center", display: "flex", flexDirection: "column", children: [
85
- /* @__PURE__ */ i(D, { color: l.palette.text.secondary, variant: "XSmall", children: d.x }),
86
- /* @__PURE__ */ i(
87
- B,
88
- {
89
- amount: d.y,
90
- bold: !0,
91
- formatString: "0,0",
92
- variant: "Body"
93
- }
94
- )
95
- ] }) })
96
- ] }, u)) })
97
- ] })
98
- }
99
- );
100
- }, Ft = Tt(Wt), Yt = ({
101
- categoryGuids: { guid: o, topLevelGuid: e },
102
- itemData: { dataIndex: r },
103
- series: a,
104
- xData: n
105
- }) => {
106
- const l = Ht(), c = a.data[r], h = n[r];
107
- return c === void 0 || !h ? null : /* @__PURE__ */ i(Et, { sx: { pt: 4, px: 8 }, children: /* @__PURE__ */ i(kt, { children: /* @__PURE__ */ S(Gt, { alignItems: "center", display: "flex", flexDirection: "column", children: [
108
- /* @__PURE__ */ i(Z, { categoryGuid: o, topLevelCategoryGuid: e }),
109
- /* @__PURE__ */ i(D, { color: l.palette.text.secondary, variant: "Small", children: L(h, R.MONTH_SHORT_YEAR) }),
110
- /* @__PURE__ */ i(B, { amount: String(c), bold: !0, formatString: "0,0", variant: "Body" })
111
- ] }) }) });
112
- }, Pt = ({
113
- sx: o,
114
- categoryGuids: e,
115
- hoveredLegend: r,
116
- legendRef: a,
117
- onHoverLegend: n,
118
- onClickLegend: l
119
- }) => {
120
- const { isMobile: c } = U(), { getCategoryName: h } = K();
121
- return /* @__PURE__ */ i(
122
- O,
123
- {
124
- direction: "row",
125
- flexWrap: "wrap",
126
- gap: c ? 2 : 6,
127
- justifyContent: "start",
128
- ref: a,
129
- sx: o,
130
- children: e.map(({ guid: m, top_level_guid: C }) => {
131
- const d = r === m, u = T[m], f = T[C], y = u ?? f ?? T.default, b = y + "33";
132
- return /* @__PURE__ */ S(
133
- wt,
134
- {
135
- onClick: () => l(m),
136
- onMouseEnter: () => n(m),
137
- onMouseLeave: () => n(null),
138
- sx: {
139
- color: "text.primary",
140
- fontWeight: "normal",
141
- display: "flex",
142
- justifyContent: "center",
143
- alignItems: "center",
144
- paddingX: 8,
145
- paddingY: 4,
146
- borderRadius: 1,
147
- opacity: d ? 1 : 0.7
148
- },
149
- children: [
150
- /* @__PURE__ */ i(
151
- A,
152
- {
153
- sx: {
154
- width: 16,
155
- height: 16,
156
- marginRight: c ? 5 : 10,
157
- borderRadius: "2px",
158
- backgroundColor: r ? d ? y : b : y
159
- }
160
- }
161
- ),
162
- /* @__PURE__ */ i(D, { variant: "Body", children: h(m) })
163
- ]
164
- },
165
- m
166
- );
167
- })
168
- }
169
- );
170
- }, Ae = ({
171
- onHoverArea: o,
172
- onHoverPoint: e,
173
- onHoverLegend: r,
174
- onClickLegend: a,
175
- stackedDatasets: n,
176
- unstackedDatasets: l = [],
177
- availableHeight: c = 0,
178
- minimumHeight: h = 350
179
- }) => {
180
- const m = Q(), { isMobile: C } = U(), [d, { height: u }] = Mt(), f = _.useRef(null), [y, b] = _.useState(0);
181
- _.useEffect(() => {
182
- const t = Math.max(c - u, h);
183
- b(t);
184
- }, [c, u]);
185
- const [p, v] = _.useState(null), [tt, H] = _.useState({
186
- hoveredSeriesId: null,
187
- hoveredAreaData: null,
188
- isAreaHovered: !1,
189
- cursorPos: { x: 0, y: 0 }
190
- }), { hoveredSeriesId: M, hoveredAreaData: $, isAreaHovered: et, cursorPos: E } = tt, j = et && M && $, W = !j, w = [...n, ...l], ot = w[0]?.dataset.length ?? 0, I = w.flatMap((t) => t.dataset.map((s) => s.x)), rt = w.flatMap((t) => t.dataset.map((s) => s.y)), at = n[0]?.dataset?.map(
191
- (t, s) => n.reduce((g, x) => g + x.dataset[s]?.y || 0, 0)
192
- ) ?? [0], nt = Math.max(...at), st = Math.max(
193
- ...l.flatMap((t) => t.dataset.map((s) => s.y))
194
- ), it = Math.floor(Math.min(...rt) / 100) * 100, lt = Math.ceil(Math.max(nt, st) / 100) * 100, k = n.map((t, s) => ({
195
- id: `stacked-${s}`,
196
- guid: t.category_guid,
197
- top_level_guid: t.top_level_category_guid,
198
- area: !0,
199
- color: n[s].category_color ?? m.palette.primary.main,
200
- data: t.dataset.map((g) => g.y),
201
- label: n[s].category_name,
202
- stack: "total",
203
- type: "line",
204
- highlightScope: { highlight: "item" },
205
- valueFormatter: (g) => z(g, "0,0")
206
- })), F = l.map((t, s) => ({
207
- id: `unstacked-${s}`,
208
- guid: t.category_guid,
209
- top_level_guid: t.top_level_category_guid,
210
- area: !1,
211
- color: t.category_color,
212
- data: t.dataset.map((g) => g.y),
213
- label: t.category_name,
214
- type: "line",
215
- valueFormatter: (g) => z(g, "0,0")
216
- })), Y = [...k, ...F], ct = [
217
- ...k.map(({ guid: t, top_level_guid: s }) => ({
218
- guid: t,
219
- top_level_guid: s
220
- })),
221
- ...F.map(({ guid: t, top_level_guid: s }) => ({
222
- guid: t,
223
- top_level_guid: s
224
- }))
225
- ], G = (t) => {
226
- const g = t.startsWith("stacked-") ? n[parseInt(t.split("-")[1])] : l[parseInt(t.split("-")[1])];
227
- return {
228
- guid: g?.category_guid,
229
- topLevelGuid: g?.top_level_category_guid
230
- };
231
- }, dt = (t) => {
232
- v(t), r?.(t ?? "");
233
- }, ut = (t) => {
234
- a?.(t ?? "");
235
- }, gt = () => {
236
- const t = G(String(M)).guid;
237
- t && a?.(t);
238
- }, mt = (t) => {
239
- const s = String(t?.seriesId), g = G(s).guid, x = Y.find((N) => N.id === s), yt = x && t?.dataIndex !== void 0, ft = x && t?.dataIndex === void 0;
240
- if (yt)
241
- H({
242
- hoveredSeriesId: s,
243
- hoveredAreaData: null,
244
- isAreaHovered: !1,
245
- cursorPos: E
246
- }), e?.(g);
247
- else if (ft) {
248
- const N = x?.data.map((Ct, bt) => ({
249
- x: I[bt],
250
- y: Ct
251
- })) ?? [];
252
- H({
253
- hoveredSeriesId: s,
254
- hoveredAreaData: N,
255
- isAreaHovered: !0,
256
- cursorPos: E
257
- }), o?.(g);
258
- } else
259
- H({
260
- hoveredSeriesId: null,
261
- hoveredAreaData: null,
262
- isAreaHovered: !1,
263
- cursorPos: E
264
- });
265
- }, ht = (t) => {
266
- const s = t.currentTarget.getBoundingClientRect();
267
- H((g) => ({
268
- ...g,
269
- cursorPos: {
270
- x: t.clientX - s.left,
271
- y: t.clientY - s.top
272
- }
273
- }));
274
- }, pt = {
275
- p: 4,
276
- "& .MuiBarLabel-root": {
277
- fontSize: 10,
278
- fontWeight: 600
279
- },
280
- "& .MuiAreaElement-root": {
281
- opacity: 0.4,
282
- transition: "opacity 0.3s ease"
283
- },
284
- "& .MuiAreaElement-root:hover": {
285
- opacity: 1
286
- },
287
- '& [class*="MuiLineElement-series-unstacked-"]': {
288
- strokeWidth: 3
289
- },
290
- ...p && k.reduce((t, s, g) => {
291
- const x = `.MuiAreaElement-series-stacked-${g}`;
292
- return t[x] = {
293
- opacity: k[g].guid === p ? 0.9 : 0.2
294
- }, t;
295
- }, {})
296
- };
297
- return /* @__PURE__ */ i(
298
- A,
299
- {
300
- onMouseMove: ht,
301
- ref: f,
302
- sx: {
303
- position: "relative",
304
- touchAction: "pan-y",
305
- "& svg": {
306
- touchAction: "pan-y",
307
- userSelect: "none"
308
- },
309
- "& .recharts-wrapper": {
310
- touchAction: "pan-y"
311
- }
312
- },
313
- children: /* @__PURE__ */ S(
314
- O,
315
- {
316
- direction: { xs: "column", md: "column" },
317
- spacing: { xs: 0, md: 4 },
318
- sx: { width: "100%", position: "relative" },
319
- children: [
320
- /* @__PURE__ */ i(
321
- _t,
322
- {
323
- height: y,
324
- margin: { bottom: 50 },
325
- onAreaClick: gt,
326
- onHighlightChange: mt,
327
- series: Y,
328
- skipAnimation: !0,
329
- slotProps: {
330
- legend: {
331
- hidden: !0
332
- }
333
- },
334
- slots: {
335
- itemContent: (t) => W && M ? /* @__PURE__ */ i(
336
- Yt,
337
- {
338
- categoryGuids: G(M),
339
- xData: I,
340
- ...t
341
- }
342
- ) : null
343
- },
344
- sx: pt,
345
- tooltip: {
346
- trigger: W ? "item" : "none"
347
- },
348
- xAxis: [
349
- {
350
- data: I,
351
- scaleType: "time",
352
- valueFormatter: (t) => L(t, R.MONTH_SHORT_YEAR),
353
- tickNumber: ot
354
- // How many ticks to show on the x-axis
355
- }
356
- ],
357
- yAxis: [
358
- {
359
- min: it,
360
- max: lt || 100
361
- }
362
- ]
363
- }
364
- ),
365
- /* @__PURE__ */ i(
366
- Pt,
367
- {
368
- categoryGuids: ct,
369
- hoveredLegend: p,
370
- legendRef: d,
371
- onClickLegend: ut,
372
- onHoverLegend: dt,
373
- sx: { px: C ? 0 : 24 }
374
- }
375
- ),
376
- j && /* @__PURE__ */ i(
377
- Ft,
378
- {
379
- categoryGuids: G(M),
380
- chartContainerRef: f,
381
- cursorPosition: E,
382
- hoveredAreaData: $.map((t) => ({
383
- ...t,
384
- x: L(t.x, R.MONTH_SHORT_YEAR)
385
- }))
386
- }
387
- )
388
- ]
389
- }
390
- )
391
- }
392
- );
393
- }, Xt = (o) => T[o] ?? T.default, zt = (o) => Nt[o];
394
- function Vt(o, e) {
395
- const r = [], a = new Date(o);
396
- for (; a <= e; ) {
397
- const n = a.getFullYear(), l = String(a.getMonth() + 1).padStart(2, "0");
398
- r.push(+`${n}${l}`), a.setMonth(a.getMonth() + 1);
399
- }
400
- return r;
401
- }
402
- const qt = (o) => o.reduce((r, a) => {
403
- const n = {
404
- top_level_category_guid: a.top_level_category_guid,
405
- category_guid: a.category_guid,
406
- amount: a.total,
407
- year_month: a.year_month
408
- }, { top_level_category_guid: l, category_guid: c } = n;
409
- return r[c] || (r[c] = []), r[c].push(n), l !== c && (r[l] || (r[l] = []), r[l].push(n)), r;
410
- }, {}), De = (o, e, r) => {
411
- const a = qt(o), n = Vt(e, r);
412
- return Object.entries(a).map(([c, h]) => {
413
- const m = h[0].top_level_category_guid, C = n.map((d) => {
414
- const u = h.filter((p) => p.year_month === d).reduce((p, v) => p + Math.abs(v.amount), 0), f = Number(String(d).slice(0, 4)), y = Number(String(d).slice(4));
415
- return { x: new Date(f, y - 1), y: u };
416
- }).sort((d, u) => d.x.getTime() - u.x.getTime());
417
- return {
418
- top_level_category_guid: m,
419
- category_guid: c,
420
- category_name: zt(c),
421
- category_color: Xt(m),
422
- dataset: C
423
- };
424
- });
425
- }, Le = (o, e) => {
426
- const r = typeof o == "string" ? parseFloat(o.replace(/[^0-9.-]+/g, "")) : o, a = typeof e == "string" ? parseFloat(e.replace(/[^0-9.-]+/g, "")) : e;
427
- return (r || 0) - (a || 0);
428
- }, Jt = (o, e) => {
429
- const r = o.subCategories.filter((l) => l.currentAmount !== 0), a = o.totalMonthlyAmounts.slice(-e), n = (l) => l.substring(0, 3) + " " + l.slice(-4);
430
- return a.map((l) => {
431
- const c = n(l.label), h = r.map((d) => {
432
- const u = d.monthlyAmounts.slice(-e).find((f) => n(f.label) === c);
433
- return {
434
- label: d.name,
435
- amount: Math.abs(u?.amount || 0),
436
- header: c
437
- };
438
- }), m = o.monthlyAmounts.slice(-e).find((d) => n(d.label) === c);
439
- return [{
440
- label: o.name,
441
- amount: Math.abs(m?.amount || 0),
442
- header: c
443
- }, ...h].sort((d, u) => u.amount - d.amount);
444
- });
445
- }, Kt = (o, e) => {
446
- const r = o ? o.totalMonthlyAmounts.slice(-e).map((n) => ({
447
- x: n.label.substring(0, 3),
448
- y: Math.abs(n.amount)
449
- })) : [], a = o ? Jt(o, e) : [];
450
- return { monthlyAmounts: r, tooltipLabels: a };
451
- }, Qt = (o) => o.slice().filter(
452
- (e) => e.totalAmount !== 0 && e.isTransfer === !1 && e.guid !== It.INVESTMENTS
453
- ).sort((e, r) => Math.abs(r.totalAmount) - Math.abs(e.totalAmount));
454
- class Re {
455
- globalStore;
456
- selectedCategoryData = null;
457
- selectedDateRange;
458
- visibleListLength = 5;
459
- constructor(e) {
460
- this.globalStore = e, this.selectedDateRange = {
461
- start: Ot(V(jt(/* @__PURE__ */ new Date(), 6)), 1),
462
- end: V(/* @__PURE__ */ new Date())
463
- }, Bt(this);
464
- }
465
- setSelectedCategoryData = (e) => {
466
- this.selectedCategoryData = e;
467
- };
468
- setSelectedDateRange = (e) => {
469
- this.selectedDateRange = e;
470
- };
471
- setVisibleListLength = (e) => {
472
- this.visibleListLength = e;
473
- };
474
- get sortedDetailedCategoriesWithTransactions() {
475
- return Qt(
476
- this.globalStore.categoryStore.detailedCategoriesWithTransactions
477
- );
478
- }
479
- get selectedDateRangeMonthCount() {
480
- return $t(this.selectedDateRange.end, this.selectedDateRange.start) + 1;
481
- }
482
- get selectedDateRangeMonthRange() {
483
- const e = L(this.selectedDateRange.start, R.MONTH_LONG), r = L(this.selectedDateRange.end, R.MONTH_LONG);
484
- return `${e} - ${r}`;
485
- }
486
- get visibleCategories() {
487
- return this.sortedDetailedCategoriesWithTransactions.slice(0, this.visibleListLength);
488
- }
489
- get collapsedCategories() {
490
- return this.sortedDetailedCategoriesWithTransactions.slice(this.visibleListLength);
491
- }
492
- get categoryDetailsChartData() {
493
- return Kt(
494
- this.selectedCategoryData,
495
- this.selectedDateRangeMonthCount
496
- );
497
- }
498
- }
499
- export {
500
- Ae as S,
501
- Re as T,
502
- Le as a,
503
- De as g,
504
- Te as u
505
- };
@@ -1,6 +0,0 @@
1
- const e = {
2
- featureVersion: "spendVsIncomeTrends"
3
- };
4
- export {
5
- e as T
6
- };