@mx-cartographer/experiences 7.2.15-alpha.sms3 → 7.2.16-alpha.mm0
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/{AccountDetailsContent-Vj4LO6cx.mjs → AccountDetailsContent-CsH1w_GZ.mjs} +1 -1
- package/dist/{ManageIncome-B9yGuahc.mjs → ManageIncome-CV-bGuR-.mjs} +1 -1
- package/dist/{NotificationSettings-DqrkNMod.mjs → NotificationSettings-5i3IywCi.mjs} +238 -236
- package/dist/{RecurringSettings-D9GFcsXV.mjs → RecurringSettings-G6_BbsIF.mjs} +1 -1
- package/dist/{TransactionDetails-BqCr2FTh.mjs → TransactionDetails-CDtya0KS.mjs} +42 -42
- package/dist/{TransactionStore-Dx8hFybD.mjs → TransactionStore-DxPLdF3B.mjs} +57 -57
- package/dist/accounts/index.es.js +118 -116
- package/dist/budgets/index.es.js +501 -499
- package/dist/cashflow/index.es.js +383 -381
- package/dist/common/index.es.js +2 -2
- package/dist/debts/index.es.js +377 -375
- package/dist/finstrong/index.es.js +417 -415
- package/dist/goals/index.es.js +559 -557
- package/dist/investments/index.es.js +436 -434
- package/dist/networth/index.es.js +173 -171
- package/dist/notifications/index.es.js +1 -1
- package/dist/recurringtransactions/index.es.js +174 -172
- package/dist/settings/index.es.js +284 -278
- package/dist/spending/index.es.js +282 -280
- package/dist/transactions/components/shared/transactiondetails/actions/DateAction.d.ts +2 -2
- package/dist/transactions/index.es.js +4 -4
- package/dist/trends/index.es.js +1 -1
- package/package.json +1 -1
package/dist/budgets/index.es.js
CHANGED
|
@@ -1,126 +1,126 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as m, jsx as e, Fragment as ze } from "react/jsx-runtime";
|
|
2
2
|
import l from "react";
|
|
3
3
|
import { observer as I } from "mobx-react-lite";
|
|
4
|
-
import { endOfMonth as
|
|
5
|
-
import { startOfMonth as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { Text as
|
|
10
|
-
import
|
|
11
|
-
import { u as w, i as D, j as
|
|
4
|
+
import { endOfMonth as pe } from "date-fns/endOfMonth";
|
|
5
|
+
import { startOfMonth as Q } from "date-fns/startOfMonth";
|
|
6
|
+
import W from "@mui/material/Box";
|
|
7
|
+
import S from "@mui/material/Stack";
|
|
8
|
+
import te from "@mui/material/styles/useTheme";
|
|
9
|
+
import { Text as b, CategoryIcon as K, Icon as N, H1 as Ue, H3 as Ae } from "@mxenabled/mxui";
|
|
10
|
+
import X from "@mui/material/List";
|
|
11
|
+
import { u as w, i as D, j as ne, m as z, q as oe, g as V, b as ae, h as re, a as Fe, d as Te, n as He } from "../hooks-D6XlXHf4.mjs";
|
|
12
12
|
import { f as T } from "../NumberFormatting-Buh7u8Oi.mjs";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
13
|
+
import we from "@mui/material/Button";
|
|
14
|
+
import se from "@mui/material/Divider";
|
|
15
|
+
import Y from "@mui/material/ListItem";
|
|
16
|
+
import ie from "@mui/material/ListItemAvatar";
|
|
17
|
+
import Z from "@mui/material/ListItemButton";
|
|
18
|
+
import q from "@mui/material/ListItemText";
|
|
19
19
|
import { b as R } from "../Localization-2MODESHW.mjs";
|
|
20
|
-
import { D as
|
|
21
|
-
import
|
|
22
|
-
import { C as
|
|
23
|
-
import { a as
|
|
24
|
-
import { C as
|
|
20
|
+
import { D as k } from "../Drawer-kEE73B87.mjs";
|
|
21
|
+
import We from "@mui/material/ListItemSecondaryAction";
|
|
22
|
+
import { C as Ke } from "../CurrencyInput-DUsQbkXb.mjs";
|
|
23
|
+
import { a as G } from "../Dialog-CWW597AF.mjs";
|
|
24
|
+
import { C as Xe } from "../ConnectionsDrawer-BDvVuJQf.mjs";
|
|
25
25
|
import * as O from "d3";
|
|
26
|
-
import
|
|
27
|
-
import { useTheme as
|
|
28
|
-
import { u as
|
|
29
|
-
import { L as
|
|
30
|
-
import { E as
|
|
31
|
-
import { A as
|
|
32
|
-
import { u as
|
|
33
|
-
import { M as
|
|
34
|
-
import { isAfter as
|
|
35
|
-
import { startOfToday as
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import { e as
|
|
41
|
-
import { T as
|
|
42
|
-
import
|
|
43
|
-
import
|
|
44
|
-
import { S as
|
|
45
|
-
import { S as
|
|
46
|
-
import { u as
|
|
47
|
-
import
|
|
48
|
-
import { subDays as
|
|
49
|
-
import
|
|
50
|
-
import { M as
|
|
51
|
-
const
|
|
52
|
-
const { budgets: t } = w(), { totalBudgeted: o } = D(), { incomeTotal: i } =
|
|
53
|
-
return /* @__PURE__ */
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
/* @__PURE__ */ e(
|
|
56
|
-
/* @__PURE__ */ e(
|
|
26
|
+
import Ve from "@mui/material/Tooltip";
|
|
27
|
+
import { useTheme as Ye } from "@mui/material/styles";
|
|
28
|
+
import { u as ce } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
29
|
+
import { L as j } from "../Loader-DUaFpDGv.mjs";
|
|
30
|
+
import { E as me } from "../EmptyState-DA_lfRBv.mjs";
|
|
31
|
+
import { A as L, W as Ze } from "../WidgetContainer-EbrN1oIo.mjs";
|
|
32
|
+
import { u as qe } from "../BudgetUtil-B2ZXyw-g.mjs";
|
|
33
|
+
import { M as Je } from "../MiniWidgetContainer-D0gfmbaF.mjs";
|
|
34
|
+
import { isAfter as Qe } from "date-fns/isAfter";
|
|
35
|
+
import { startOfToday as J } from "date-fns/startOfToday";
|
|
36
|
+
import et from "@mui/material/Alert";
|
|
37
|
+
import tt from "@mui/material/Snackbar";
|
|
38
|
+
import Ce from "@mui/material/Tab";
|
|
39
|
+
import nt from "@mui/material/Tabs";
|
|
40
|
+
import { e as ot } from "../exportTransactionsToCSV-7bVS7KXf.mjs";
|
|
41
|
+
import { T as De, a as at } from "../TransactionDetails-CDtya0KS.mjs";
|
|
42
|
+
import fe from "@mui/material/Card";
|
|
43
|
+
import be from "@mui/material/CardContent";
|
|
44
|
+
import { S as he } from "../StatusBar-BK_uYHAB.mjs";
|
|
45
|
+
import { S as Ie } from "../SingleSegmentDonut-BgbLgwHi.mjs";
|
|
46
|
+
import { u as rt, b as st } from "../CategorySelectorDrawer-DUe4lH5-.mjs";
|
|
47
|
+
import Ee from "@mui/material/CardHeader";
|
|
48
|
+
import { subDays as it } from "date-fns/subDays";
|
|
49
|
+
import ct from "@mui/material/IconButton";
|
|
50
|
+
import { M as lt } from "../ManageIncome-CV-bGuR-.mjs";
|
|
51
|
+
const dt = I(() => {
|
|
52
|
+
const { budgets: t } = w(), { totalBudgeted: o } = D(), { incomeTotal: i } = ne(), s = i - o;
|
|
53
|
+
return /* @__PURE__ */ m(S, { direction: "row", justifyContent: "center", my: 16, spacing: 20, children: [
|
|
54
|
+
/* @__PURE__ */ m(S, { alignItems: "center", children: [
|
|
55
|
+
/* @__PURE__ */ e(b, { bold: !0, variant: "Body", children: T(i, "0,0") }),
|
|
56
|
+
/* @__PURE__ */ e(b, { color: "secondary", variant: "Small", children: t.projected_income })
|
|
57
57
|
] }),
|
|
58
|
-
/* @__PURE__ */ e(
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
/* @__PURE__ */ e(
|
|
61
|
-
/* @__PURE__ */ e(
|
|
58
|
+
/* @__PURE__ */ e(b, { bold: !0, justifyContent: "center", variant: "Body", children: "-" }),
|
|
59
|
+
/* @__PURE__ */ m(S, { alignItems: "center", children: [
|
|
60
|
+
/* @__PURE__ */ e(b, { bold: !0, variant: "Body", children: T(o, "0,0") }),
|
|
61
|
+
/* @__PURE__ */ e(b, { color: "secondary", variant: "Small", children: t.budgeted })
|
|
62
62
|
] }),
|
|
63
|
-
/* @__PURE__ */ e(
|
|
64
|
-
/* @__PURE__ */
|
|
65
|
-
/* @__PURE__ */ e(
|
|
66
|
-
/* @__PURE__ */ e(
|
|
63
|
+
/* @__PURE__ */ e(b, { bold: !0, justifyContent: "center", variant: "Body", children: "=" }),
|
|
64
|
+
/* @__PURE__ */ m(S, { alignItems: "center", children: [
|
|
65
|
+
/* @__PURE__ */ e(b, { bold: !0, variant: "Body", children: T(s, "0,0") }),
|
|
66
|
+
/* @__PURE__ */ e(b, { color: "secondary", variant: "Small", children: t.remaining })
|
|
67
67
|
] })
|
|
68
68
|
] });
|
|
69
|
-
}),
|
|
69
|
+
}), ut = I(
|
|
70
70
|
({ category: t }) => {
|
|
71
71
|
const { budgets: o } = w(), { budgets: i } = D(), s = l.useMemo(() => {
|
|
72
72
|
const a = i.find((c) => c.category_guid === t.guid), n = T(t.totalAverageAmount, "0,0"), r = a ? R(o.recalculate_previous_budget, T(a.amount, "0,0")) : o.recalculate_new_budget;
|
|
73
73
|
return `${n} - ${r}`;
|
|
74
74
|
}, [o, i]);
|
|
75
|
-
return /* @__PURE__ */
|
|
76
|
-
/* @__PURE__ */ e(
|
|
77
|
-
/* @__PURE__ */ e(
|
|
78
|
-
/* @__PURE__ */ e(
|
|
75
|
+
return /* @__PURE__ */ m(l.Fragment, { children: [
|
|
76
|
+
/* @__PURE__ */ e(Y, { children: /* @__PURE__ */ m(Z, { children: [
|
|
77
|
+
/* @__PURE__ */ e(ie, { children: /* @__PURE__ */ e(K, { categoryGuid: t.guid, variant: "filled" }) }),
|
|
78
|
+
/* @__PURE__ */ e(q, { primary: t.name, secondary: s })
|
|
79
79
|
] }) }),
|
|
80
|
-
/* @__PURE__ */ e(
|
|
80
|
+
/* @__PURE__ */ e(se, {})
|
|
81
81
|
] }, t.guid);
|
|
82
82
|
}
|
|
83
|
-
),
|
|
84
|
-
const { budgets: o, common: i } = w(), { spendCategories: s } =
|
|
85
|
-
await a(
|
|
83
|
+
), mt = ({ onRecalculateBudgets: t }) => {
|
|
84
|
+
const { budgets: o, common: i } = w(), { spendCategories: s } = z(), { recalculateBudgets: a, setAlert: n } = D(), [r, c] = l.useState(!1), g = s.filter((u) => u.totalAverageAmount > 0), d = async () => {
|
|
85
|
+
await a(g), c(!1), n(o.alert_recalculated_budgets), t?.();
|
|
86
86
|
};
|
|
87
|
-
return /* @__PURE__ */
|
|
88
|
-
/* @__PURE__ */ e(
|
|
89
|
-
/* @__PURE__ */ e(
|
|
87
|
+
return /* @__PURE__ */ m(l.Fragment, { children: [
|
|
88
|
+
/* @__PURE__ */ e(we, { onClick: () => c(!0), sx: { mt: 24, mx: 24 }, variant: "text", children: o.recalculate_button }),
|
|
89
|
+
/* @__PURE__ */ e(b, { sx: { mx: 24, my: 16, textAlign: "center", whiteSpace: "wrap" }, variant: "Paragraph", children: o.recalculate_help }),
|
|
90
90
|
/* @__PURE__ */ e(
|
|
91
|
-
|
|
91
|
+
k,
|
|
92
92
|
{
|
|
93
93
|
ariaLabelClose: i.close_aria,
|
|
94
94
|
isOpen: r,
|
|
95
95
|
onClose: () => c(!1),
|
|
96
|
-
onPrimaryAction:
|
|
96
|
+
onPrimaryAction: d,
|
|
97
97
|
title: o.recalculate_title,
|
|
98
|
-
children: /* @__PURE__ */
|
|
99
|
-
/* @__PURE__ */
|
|
100
|
-
/* @__PURE__ */ e(
|
|
101
|
-
/* @__PURE__ */ e(
|
|
98
|
+
children: /* @__PURE__ */ m(S, { children: [
|
|
99
|
+
/* @__PURE__ */ m(S, { mx: 24, my: 16, children: [
|
|
100
|
+
/* @__PURE__ */ e(b, { bold: !0, variant: "Body", children: o.recalculate_description_top }),
|
|
101
|
+
/* @__PURE__ */ e(b, { variant: "ParagraphSmall", children: o.recalculate_description_bottom })
|
|
102
102
|
] }),
|
|
103
|
-
/* @__PURE__ */ e(
|
|
103
|
+
/* @__PURE__ */ e(W, { bgcolor: "background.paper", children: /* @__PURE__ */ e(X, { children: g.map((u) => /* @__PURE__ */ e(ut, { category: u }, u.guid)) }) })
|
|
104
104
|
] })
|
|
105
105
|
}
|
|
106
106
|
)
|
|
107
107
|
] });
|
|
108
|
-
},
|
|
108
|
+
}, le = ({
|
|
109
109
|
amount: t,
|
|
110
110
|
categoryName: o,
|
|
111
111
|
onAmountChanged: i
|
|
112
112
|
}) => {
|
|
113
|
-
const { budgets: s } = w(), { totalBudgeted: a } = D(), { incomeTotal: n } =
|
|
114
|
-
return /* @__PURE__ */
|
|
115
|
-
/* @__PURE__ */
|
|
116
|
-
/* @__PURE__ */ e(
|
|
113
|
+
const { budgets: s } = w(), { totalBudgeted: a } = D(), { incomeTotal: n } = ne(), r = n - a;
|
|
114
|
+
return /* @__PURE__ */ m(S, { gap: 16, children: [
|
|
115
|
+
/* @__PURE__ */ m(S, { children: [
|
|
116
|
+
/* @__PURE__ */ e(b, { children: R(
|
|
117
117
|
s.add_description_top,
|
|
118
118
|
T(r, "0,0")
|
|
119
119
|
) }),
|
|
120
|
-
/* @__PURE__ */ e(
|
|
120
|
+
/* @__PURE__ */ e(b, { children: R(s.add_description_bottom, o) })
|
|
121
121
|
] }),
|
|
122
122
|
/* @__PURE__ */ e(
|
|
123
|
-
|
|
123
|
+
Ke,
|
|
124
124
|
{
|
|
125
125
|
amount: t,
|
|
126
126
|
autoFocus: !0,
|
|
@@ -131,24 +131,24 @@ const ct = I(() => {
|
|
|
131
131
|
}
|
|
132
132
|
)
|
|
133
133
|
] });
|
|
134
|
-
},
|
|
134
|
+
}, gt = I(({ category: t, onAddBudget: o }) => {
|
|
135
135
|
const { budgets: i, common: s } = w(), [a, n] = l.useState(!1), [r, c] = l.useState(
|
|
136
136
|
`${t.totalAmount === 0 ? "" : t.totalAmount}`
|
|
137
137
|
);
|
|
138
|
-
return /* @__PURE__ */
|
|
139
|
-
/* @__PURE__ */ e(
|
|
140
|
-
/* @__PURE__ */ e(
|
|
138
|
+
return /* @__PURE__ */ m(l.Fragment, { children: [
|
|
139
|
+
/* @__PURE__ */ e(Y, { children: /* @__PURE__ */ m(Z, { onClick: () => n(!0), children: [
|
|
140
|
+
/* @__PURE__ */ e(ie, { children: /* @__PURE__ */ e(K, { categoryGuid: t.guid }) }),
|
|
141
141
|
/* @__PURE__ */ e(
|
|
142
|
-
|
|
142
|
+
q,
|
|
143
143
|
{
|
|
144
144
|
primary: t.name,
|
|
145
145
|
secondary: T(t.totalAmount, "0,0")
|
|
146
146
|
}
|
|
147
147
|
),
|
|
148
|
-
/* @__PURE__ */ e(
|
|
148
|
+
/* @__PURE__ */ e(We, { children: /* @__PURE__ */ e(N, { name: "add", size: 20 }) })
|
|
149
149
|
] }) }, t.guid),
|
|
150
150
|
/* @__PURE__ */ e(
|
|
151
|
-
|
|
151
|
+
G,
|
|
152
152
|
{
|
|
153
153
|
copy: { close_aria: s.close_aria, title: i.add_title },
|
|
154
154
|
disablePrimaryButton: Number(r) <= 0,
|
|
@@ -156,27 +156,27 @@ const ct = I(() => {
|
|
|
156
156
|
onClose: () => n(!1),
|
|
157
157
|
onPrimaryAction: () => o(t, Number(r)),
|
|
158
158
|
primaryText: i.add_save_button,
|
|
159
|
-
children: /* @__PURE__ */ e(
|
|
159
|
+
children: /* @__PURE__ */ e(le, { amount: r, categoryName: t.name, onAmountChanged: c })
|
|
160
160
|
}
|
|
161
161
|
)
|
|
162
162
|
] });
|
|
163
|
-
}),
|
|
163
|
+
}), Oe = I(({ onRecalculateBudgets: t }) => {
|
|
164
164
|
const { budgets: o } = w(), { addBudget: i, setAlert: s, unbudgetedCategories: a } = D(), n = async (r, c) => {
|
|
165
165
|
await i(r, c), s(R(o.alert_budget_created, r.name));
|
|
166
166
|
};
|
|
167
|
-
return /* @__PURE__ */
|
|
168
|
-
/* @__PURE__ */ e(
|
|
169
|
-
/* @__PURE__ */ e(
|
|
170
|
-
|
|
167
|
+
return /* @__PURE__ */ m(S, { children: [
|
|
168
|
+
/* @__PURE__ */ e(dt, {}),
|
|
169
|
+
/* @__PURE__ */ e(W, { bgcolor: "background.paper", children: /* @__PURE__ */ e(X, { children: a.map((r) => /* @__PURE__ */ e(
|
|
170
|
+
gt,
|
|
171
171
|
{
|
|
172
172
|
category: r,
|
|
173
173
|
onAddBudget: n
|
|
174
174
|
},
|
|
175
175
|
r.guid
|
|
176
176
|
)) }) }),
|
|
177
|
-
/* @__PURE__ */ e(
|
|
177
|
+
/* @__PURE__ */ e(mt, { onRecalculateBudgets: t })
|
|
178
178
|
] });
|
|
179
|
-
}),
|
|
179
|
+
}), Be = 5, Me = 100, ee = 25, pt = (t) => {
|
|
180
180
|
const o = (a) => {
|
|
181
181
|
a.active || t.alphaTarget(0.3).restart(), a.subject.fx = a.subject.x, a.subject.fy = a.subject.y;
|
|
182
182
|
}, i = (a) => {
|
|
@@ -185,14 +185,14 @@ const ct = I(() => {
|
|
|
185
185
|
a.active || t.alphaTarget(0), a.subject.fx = null, a.subject.fy = null;
|
|
186
186
|
};
|
|
187
187
|
return O.drag().on("start", o).on("drag", i).on("end", s);
|
|
188
|
-
},
|
|
188
|
+
}, ht = (t) => {
|
|
189
189
|
let o = t.transaction_total / t.amount;
|
|
190
190
|
o < 0 ? o = 0 : o > 1 && (o = 1);
|
|
191
|
-
const i = o * 2 * Math.PI, s = O.interpolate(0, i), a = O.arc().cornerRadius(5).innerRadius(t.radius -
|
|
191
|
+
const i = o * 2 * Math.PI, s = O.interpolate(0, i), a = O.arc().cornerRadius(5).innerRadius(t.radius - Be * 2).outerRadius(t.radius - Be).startAngle(0).endAngle(0);
|
|
192
192
|
return (n) => (a.endAngle(s(n)), a(t) || "");
|
|
193
|
-
},
|
|
194
|
-
O.selectAll(".bubble").call(
|
|
195
|
-
},
|
|
193
|
+
}, ft = (t) => {
|
|
194
|
+
O.selectAll(".bubble").call(pt(t));
|
|
195
|
+
}, Se = (t, o, i) => Math.min(Math.max(t, o), i), bt = (t, o, i) => {
|
|
196
196
|
t.alpha(1).restart().force(
|
|
197
197
|
"x",
|
|
198
198
|
O.forceX().x(i / 2).strength(0.01)
|
|
@@ -202,18 +202,18 @@ const ct = I(() => {
|
|
|
202
202
|
).on("tick", () => {
|
|
203
203
|
const s = t.nodes();
|
|
204
204
|
s.forEach((a) => {
|
|
205
|
-
const n = a.radius ??
|
|
206
|
-
a.x =
|
|
205
|
+
const n = a.radius ?? ee;
|
|
206
|
+
a.x = Se(a.x ?? 0, n, i - n), a.y = Se(a.y ?? 0, n, o - n);
|
|
207
207
|
}), O.selectAll(".bubble").data(s).attr("transform", (a) => `translate(${a.x},${a.y})`);
|
|
208
208
|
});
|
|
209
|
-
},
|
|
209
|
+
}, Re = (t, o) => O.scaleLinear().domain([t, o]).range([ee, Me]), yt = (t) => {
|
|
210
210
|
const o = t.reduce((n, r) => {
|
|
211
211
|
const c = Math.max(r.transaction_total, r.amount);
|
|
212
212
|
return c > n ? c : n;
|
|
213
213
|
}, 0), i = t.reduce((n, r) => {
|
|
214
214
|
const c = Math.max(r.transaction_total, r.amount);
|
|
215
215
|
return c < n ? c : n;
|
|
216
|
-
}, o), s =
|
|
216
|
+
}, o), s = Re(i, o), a = t.map((n) => {
|
|
217
217
|
const r = s(Math.max(n.transaction_total, n.amount)) || 25;
|
|
218
218
|
return {
|
|
219
219
|
...n,
|
|
@@ -221,25 +221,25 @@ const ct = I(() => {
|
|
|
221
221
|
};
|
|
222
222
|
});
|
|
223
223
|
return O.forceSimulation(a).velocityDecay(0.05).force("collide", O.forceCollide((n) => n.radius + 2).strength(0.7));
|
|
224
|
-
},
|
|
225
|
-
const a = Math.PI *
|
|
226
|
-
let u =
|
|
227
|
-
if (a <
|
|
228
|
-
const
|
|
229
|
-
u = Math.min(
|
|
224
|
+
}, _t = (t, o, i) => {
|
|
225
|
+
const a = Math.PI * ee ** 2 * t, n = i < 400 || o < 300, r = n ? 40 : 20, c = Math.max(100, i - r), g = Math.max(100, o - r), d = c * g;
|
|
226
|
+
let u = ee;
|
|
227
|
+
if (a < d) {
|
|
228
|
+
const h = Math.sqrt(d / (t * Math.PI)), f = Math.min(c, g) / 4;
|
|
229
|
+
u = Math.min(Me, h, f);
|
|
230
230
|
}
|
|
231
231
|
return n && t <= 3 && (u = Math.min(u, 45)), { minRadius: Math.max(20, u * 0.6), maxRadius: u };
|
|
232
|
-
},
|
|
233
|
-
const { maxRadius: n, minRadius: r } =
|
|
232
|
+
}, Ct = (t, o, i, s, a) => {
|
|
233
|
+
const { maxRadius: n, minRadius: r } = _t(t, o, a);
|
|
234
234
|
return O.scaleLinear().domain([s, i]).range([r, n]);
|
|
235
|
-
},
|
|
236
|
-
const n = o.map((
|
|
237
|
-
return t.map((
|
|
238
|
-
...
|
|
239
|
-
radius:
|
|
235
|
+
}, Bt = (t, o, i = !1, s, a) => {
|
|
236
|
+
const n = o.map((d) => Math.max(d.transaction_total, d.amount)), r = Math.min(...n), c = Math.max(...n), g = i ? Ct(t.length, s, c, r, a) : Re(r, c);
|
|
237
|
+
return t.map((d) => ({
|
|
238
|
+
...d,
|
|
239
|
+
radius: g(Math.max(d.transaction_total, d.amount))
|
|
240
240
|
}));
|
|
241
|
-
},
|
|
242
|
-
const o =
|
|
241
|
+
}, xe = 5, St = 2e3, xt = ({ bubble: t }) => {
|
|
242
|
+
const o = te(), {
|
|
243
243
|
amount: i,
|
|
244
244
|
guid: s,
|
|
245
245
|
budgetColors: { mercury: a },
|
|
@@ -247,20 +247,20 @@ const ct = I(() => {
|
|
|
247
247
|
transaction_total: r
|
|
248
248
|
} = t, c = `mercury-${s}`;
|
|
249
249
|
l.useEffect(() => {
|
|
250
|
-
O.select(`.${c}`).selectAll(".status").remove(), O.select(`.${c}`).append("path").transition().duration(
|
|
250
|
+
O.select(`.${c}`).selectAll(".status").remove(), O.select(`.${c}`).append("path").transition().duration(St).delay(0).attr("class", "status").attr("style", `fill: ${a}; fill-opacity: 1;`).attrTween("d", () => ht(t));
|
|
251
251
|
}, [i, n, r]);
|
|
252
|
-
const
|
|
252
|
+
const g = O.arc().innerRadius((d) => d - 2 * xe).outerRadius((d) => d - xe).startAngle(0).endAngle(2 * Math.PI);
|
|
253
253
|
return /* @__PURE__ */ e("g", { className: c, children: /* @__PURE__ */ e(
|
|
254
254
|
"path",
|
|
255
255
|
{
|
|
256
|
-
d:
|
|
256
|
+
d: g(n) || "",
|
|
257
257
|
style: { fill: o.palette.common.white, fillOpacity: 0.35 }
|
|
258
258
|
}
|
|
259
259
|
) });
|
|
260
|
-
},
|
|
261
|
-
function
|
|
260
|
+
}, vt = l.memo(xt), P = 75, ge = 50;
|
|
261
|
+
function At({ bubble: t, isDraggable: o, onClick: i = () => {
|
|
262
262
|
} }) {
|
|
263
|
-
const [s, a] = l.useState(!1), n =
|
|
263
|
+
const [s, a] = l.useState(!1), n = Ye(), { availableWidth: r } = oe(), c = l.useMemo(() => {
|
|
264
264
|
if (t)
|
|
265
265
|
return {
|
|
266
266
|
amount: t.amount,
|
|
@@ -272,50 +272,50 @@ function xt({ bubble: t, isDraggable: o, onClick: i = () => {
|
|
|
272
272
|
}, [t.amount, t.budgetColors, t.guid, t.radius, t.transaction_total]);
|
|
273
273
|
if (!t) return;
|
|
274
274
|
const {
|
|
275
|
-
budgetColors: { background:
|
|
276
|
-
category: { icon: u, name:
|
|
277
|
-
guid:
|
|
278
|
-
description:
|
|
275
|
+
budgetColors: { background: g, text: d },
|
|
276
|
+
category: { icon: u, name: B },
|
|
277
|
+
guid: h,
|
|
278
|
+
description: f,
|
|
279
279
|
radius: p,
|
|
280
|
-
x:
|
|
281
|
-
y
|
|
282
|
-
} = t,
|
|
283
|
-
let v =
|
|
284
|
-
p >
|
|
280
|
+
x: C,
|
|
281
|
+
y
|
|
282
|
+
} = t, _ = r < 400 ? -8 : -12;
|
|
283
|
+
let v = _, A = _;
|
|
284
|
+
p > P ? (v = -14, A = -45) : p > ge && (A = -32);
|
|
285
285
|
let x = 32;
|
|
286
|
-
p <=
|
|
287
|
-
const E = `${t.category.name}: ${
|
|
286
|
+
p <= P && (x = r < 400 ? 16 : 24);
|
|
287
|
+
const E = `${t.category.name}: ${f}`, M = {
|
|
288
288
|
modifiers: [
|
|
289
289
|
{
|
|
290
290
|
name: "offset",
|
|
291
291
|
options: { offset: [0, 15] }
|
|
292
292
|
}
|
|
293
293
|
]
|
|
294
|
-
},
|
|
295
|
-
(
|
|
296
|
-
},
|
|
294
|
+
}, $ = (F) => {
|
|
295
|
+
(F.key === "Enter" || F.key === " ") && (F.preventDefault(), i(t));
|
|
296
|
+
}, U = () => {
|
|
297
297
|
a(!0);
|
|
298
|
-
},
|
|
298
|
+
}, de = () => {
|
|
299
299
|
a(!1);
|
|
300
300
|
};
|
|
301
|
-
return /* @__PURE__ */
|
|
301
|
+
return /* @__PURE__ */ m(
|
|
302
302
|
"g",
|
|
303
303
|
{
|
|
304
|
-
"aria-label": `${
|
|
304
|
+
"aria-label": `${B} - ${f}`,
|
|
305
305
|
className: "bubble",
|
|
306
|
-
id: `bubble-${
|
|
307
|
-
onBlur:
|
|
306
|
+
id: `bubble-${h}`,
|
|
307
|
+
onBlur: de,
|
|
308
308
|
onClick: () => i(t),
|
|
309
|
-
onFocus:
|
|
310
|
-
onKeyDown:
|
|
309
|
+
onFocus: U,
|
|
310
|
+
onKeyDown: $,
|
|
311
311
|
onMouseEnter: () => a(!0),
|
|
312
312
|
onMouseLeave: () => a(!1),
|
|
313
313
|
role: "button",
|
|
314
314
|
style: { cursor: o ? "pointer" : "default" },
|
|
315
315
|
tabIndex: 0,
|
|
316
316
|
textAnchor: "middle",
|
|
317
|
-
x:
|
|
318
|
-
y
|
|
317
|
+
x: C,
|
|
318
|
+
y,
|
|
319
319
|
children: [
|
|
320
320
|
/* @__PURE__ */ e("style", { children: `
|
|
321
321
|
.bubble:focus,
|
|
@@ -330,110 +330,110 @@ function xt({ bubble: t, isDraggable: o, onClick: i = () => {
|
|
|
330
330
|
}
|
|
331
331
|
` }),
|
|
332
332
|
/* @__PURE__ */ e(
|
|
333
|
-
|
|
333
|
+
Ve,
|
|
334
334
|
{
|
|
335
335
|
followCursor: !0,
|
|
336
336
|
open: s,
|
|
337
337
|
slotProps: { popper: M },
|
|
338
338
|
title: E,
|
|
339
|
-
children: /* @__PURE__ */ e("circle", { fill:
|
|
339
|
+
children: /* @__PURE__ */ e("circle", { fill: g, id: `circle-${h}`, r: p })
|
|
340
340
|
}
|
|
341
341
|
),
|
|
342
|
-
/* @__PURE__ */ e("svg", { x: v, y: A, children: /* @__PURE__ */ e(
|
|
343
|
-
p >
|
|
344
|
-
|
|
342
|
+
/* @__PURE__ */ e("svg", { x: v, y: A, children: /* @__PURE__ */ e(N, { name: u, size: x, sx: { fill: d } }) }),
|
|
343
|
+
p > P && /* @__PURE__ */ e(
|
|
344
|
+
b,
|
|
345
345
|
{
|
|
346
346
|
bold: !0,
|
|
347
347
|
component: "text",
|
|
348
|
-
id: `budget-category-${
|
|
349
|
-
sx: { fill:
|
|
348
|
+
id: `budget-category-${h}`,
|
|
349
|
+
sx: { fill: d },
|
|
350
350
|
variant: "Small",
|
|
351
351
|
y: 4,
|
|
352
|
-
children:
|
|
352
|
+
children: B
|
|
353
353
|
}
|
|
354
354
|
),
|
|
355
|
-
p >
|
|
356
|
-
|
|
355
|
+
p > ge && /* @__PURE__ */ e(
|
|
356
|
+
b,
|
|
357
357
|
{
|
|
358
358
|
bold: !0,
|
|
359
359
|
component: "text",
|
|
360
|
-
id: `budget-description-${
|
|
361
|
-
sx: { fill:
|
|
360
|
+
id: `budget-description-${h}-1`,
|
|
361
|
+
sx: { fill: d },
|
|
362
362
|
variant: "Body",
|
|
363
|
-
y: p <=
|
|
364
|
-
children: p <=
|
|
363
|
+
y: p <= P ? 12 : 24,
|
|
364
|
+
children: p <= P ? f.split(" ")[0] : f
|
|
365
365
|
}
|
|
366
366
|
),
|
|
367
|
-
p <=
|
|
368
|
-
|
|
367
|
+
p <= P && p > ge && /* @__PURE__ */ e(
|
|
368
|
+
b,
|
|
369
369
|
{
|
|
370
370
|
component: "text",
|
|
371
|
-
id: `budget-description-${
|
|
372
|
-
sx: { fill:
|
|
371
|
+
id: `budget-description-${h}-2`,
|
|
372
|
+
sx: { fill: d },
|
|
373
373
|
variant: "XSmall",
|
|
374
374
|
y: 28,
|
|
375
|
-
children:
|
|
375
|
+
children: f.split(" ")[1]
|
|
376
376
|
}
|
|
377
377
|
),
|
|
378
|
-
/* @__PURE__ */ e(
|
|
378
|
+
/* @__PURE__ */ e(vt, { bubble: c })
|
|
379
379
|
]
|
|
380
380
|
},
|
|
381
|
-
|
|
381
|
+
h
|
|
382
382
|
);
|
|
383
383
|
}
|
|
384
|
-
const
|
|
384
|
+
const Tt = ({
|
|
385
385
|
height: t,
|
|
386
386
|
width: o,
|
|
387
387
|
isDraggable: i = !1,
|
|
388
388
|
onClick: s = () => {
|
|
389
389
|
}
|
|
390
390
|
}) => {
|
|
391
|
-
const [a, n] = l.useState([]), r = l.useRef(null), c = l.useRef(!1), { detailedBudgets:
|
|
392
|
-
const u = r.current,
|
|
391
|
+
const [a, n] = l.useState([]), r = l.useRef(null), c = l.useRef(!1), { detailedBudgets: g } = D(), d = l.useCallback(() => {
|
|
392
|
+
const u = r.current, B = yt(g), h = B.nodes();
|
|
393
393
|
if (u) {
|
|
394
|
-
const
|
|
395
|
-
|
|
396
|
-
const
|
|
397
|
-
|
|
398
|
-
vx:
|
|
399
|
-
vy:
|
|
400
|
-
x:
|
|
401
|
-
y:
|
|
394
|
+
const f = u.nodes(), p = new Map(f.map((C) => [C.guid, C]));
|
|
395
|
+
h.forEach((C) => {
|
|
396
|
+
const y = p.get(C.guid);
|
|
397
|
+
y && Object.assign(C, {
|
|
398
|
+
vx: y.vx,
|
|
399
|
+
vy: y.vy,
|
|
400
|
+
x: y.x,
|
|
401
|
+
y: y.y
|
|
402
402
|
});
|
|
403
403
|
});
|
|
404
404
|
}
|
|
405
|
-
r.current =
|
|
406
|
-
}, [
|
|
405
|
+
r.current = B, c.current = !1, n(h);
|
|
406
|
+
}, [g]);
|
|
407
407
|
return l.useEffect(() => {
|
|
408
|
-
|
|
409
|
-
}, [
|
|
408
|
+
d();
|
|
409
|
+
}, [d]), l.useEffect(() => () => {
|
|
410
410
|
r.current && (r.current.stop(), r.current = null);
|
|
411
411
|
}, []), l.useEffect(() => {
|
|
412
412
|
const u = r.current;
|
|
413
413
|
if (!u) return;
|
|
414
|
-
const
|
|
415
|
-
u.nodes(
|
|
416
|
-
|
|
417
|
-
}, 0), n([...
|
|
418
|
-
}, [t, o, i,
|
|
419
|
-
},
|
|
414
|
+
const B = u.nodes(), h = o > 0 && o < 450 || t > 0 && t < 300, f = Bt(B, g, h, t, o);
|
|
415
|
+
u.nodes(f), bt(u, t, o), i && setTimeout(() => {
|
|
416
|
+
ft(u);
|
|
417
|
+
}, 0), n([...f]);
|
|
418
|
+
}, [t, o, i, g]), /* @__PURE__ */ e("svg", { height: t, style: { overflow: "visible" }, width: Math.abs(o), children: a.map((u) => /* @__PURE__ */ e(At, { bubble: u, isDraggable: i, onClick: s }, u.guid)) });
|
|
419
|
+
}, wt = I(Tt), Dt = ({
|
|
420
420
|
isMiniWidget: t = !1,
|
|
421
421
|
onConnectAccountsClick: o,
|
|
422
422
|
createBudgetOnClick: i
|
|
423
423
|
}) => {
|
|
424
|
-
const { recalculateBudgets: s } = D(), { spendCategories: a } =
|
|
424
|
+
const { recalculateBudgets: s } = D(), { spendCategories: a } = z(), { budgets: n } = w(), { availableWidth: r } = oe(), { isMobile: c } = ce(r), g = t && c, [d, u] = l.useState(!1), [B, h] = l.useState(!1), [f, p] = l.useState(!1), C = l.useMemo(() => [...a.filter((_) => _.totalAverageAmount > 0)], [a]), y = async () => {
|
|
425
425
|
p(!0);
|
|
426
|
-
const { data:
|
|
427
|
-
p(!1), v ? (
|
|
426
|
+
const { data: _, isSuccess: v } = await s(C);
|
|
427
|
+
p(!1), v ? (_.length === 0 && h(!0), u(!1)) : u(!0);
|
|
428
428
|
};
|
|
429
|
-
return
|
|
430
|
-
|
|
429
|
+
return f ? /* @__PURE__ */ e(j, {}) : d ? /* @__PURE__ */ e(
|
|
430
|
+
me,
|
|
431
431
|
{
|
|
432
432
|
header: n.autogenerate_budgets_error_header,
|
|
433
433
|
icon: "error",
|
|
434
434
|
iconColor: "#4D4D4D",
|
|
435
|
-
onClick: (
|
|
436
|
-
|
|
435
|
+
onClick: (_) => {
|
|
436
|
+
_ === "primary" ? y() : i();
|
|
437
437
|
},
|
|
438
438
|
primaryButton: n.autogenerate_budgets_error_primary_button,
|
|
439
439
|
secondaryButton: n.zero_state_generate_budgets_secondary_button,
|
|
@@ -442,19 +442,19 @@ const vt = ({
|
|
|
442
442
|
width: { sm: 468 },
|
|
443
443
|
".buttons-footer": {
|
|
444
444
|
width: 208,
|
|
445
|
-
...
|
|
445
|
+
...g && { mt: 16, button: { height: "max-content" } }
|
|
446
446
|
},
|
|
447
|
-
...
|
|
447
|
+
...g && { justifyContent: "center", mt: 0, svg: { height: 32, width: 32 } }
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
|
-
) : /* @__PURE__ */ e(
|
|
451
|
-
|
|
450
|
+
) : /* @__PURE__ */ e(ze, { children: B ? /* @__PURE__ */ e(
|
|
451
|
+
me,
|
|
452
452
|
{
|
|
453
453
|
header: n.zero_state_generate_budgets_header,
|
|
454
454
|
icon: "error",
|
|
455
455
|
iconColor: "#4D4D4D",
|
|
456
|
-
onClick: (
|
|
457
|
-
|
|
456
|
+
onClick: (_) => {
|
|
457
|
+
_ === "primary" ? o() : i();
|
|
458
458
|
},
|
|
459
459
|
primaryButton: n.zero_state_generate_budgets_primary_button,
|
|
460
460
|
secondaryButton: n.zero_state_generate_budgets_secondary_button,
|
|
@@ -462,24 +462,24 @@ const vt = ({
|
|
|
462
462
|
sx: {
|
|
463
463
|
width: t ? "100%" : { sm: 500 },
|
|
464
464
|
height: t ? "100%" : { sm: 468 },
|
|
465
|
-
mt:
|
|
465
|
+
mt: g ? 0 : 50,
|
|
466
466
|
".buttons-footer": {
|
|
467
467
|
width: 208,
|
|
468
468
|
height: 100,
|
|
469
|
-
...
|
|
469
|
+
...g && { mt: 16, button: { height: "max-content" } }
|
|
470
470
|
},
|
|
471
471
|
padding: t ? 5 : 0,
|
|
472
|
-
...
|
|
472
|
+
...g && { justifyContent: "center", svg: { height: 32, width: 32 } }
|
|
473
473
|
}
|
|
474
474
|
}
|
|
475
475
|
) : /* @__PURE__ */ e(
|
|
476
|
-
|
|
476
|
+
me,
|
|
477
477
|
{
|
|
478
478
|
header: n.create_budgets_title,
|
|
479
479
|
icon: "bubble_chart",
|
|
480
480
|
iconColor: "#1A1A1A",
|
|
481
|
-
onClick: (
|
|
482
|
-
|
|
481
|
+
onClick: (_) => {
|
|
482
|
+
_ === "primary" ? y() : i();
|
|
483
483
|
},
|
|
484
484
|
primaryButton: n.empty_state_primary_button,
|
|
485
485
|
secondaryButton: t ? void 0 : n.empty_state_secondary_button,
|
|
@@ -487,18 +487,18 @@ const vt = ({
|
|
|
487
487
|
sx: {
|
|
488
488
|
width: t ? "100%" : { sm: 432 },
|
|
489
489
|
height: t ? "100%" : { sm: 468 },
|
|
490
|
-
mt:
|
|
490
|
+
mt: g ? 0 : 50,
|
|
491
491
|
".buttons-footer": {
|
|
492
492
|
width: 208,
|
|
493
493
|
height: 100,
|
|
494
|
-
...
|
|
494
|
+
...g && { mt: 24, button: { height: "max-content" } }
|
|
495
495
|
},
|
|
496
496
|
padding: t ? 4 : 0,
|
|
497
|
-
...
|
|
497
|
+
...g && { justifyContent: "center", svg: { height: 32, width: 32 } }
|
|
498
498
|
}
|
|
499
499
|
}
|
|
500
500
|
) });
|
|
501
|
-
},
|
|
501
|
+
}, Le = I(
|
|
502
502
|
({
|
|
503
503
|
createBudgetOnClick: t = () => {
|
|
504
504
|
},
|
|
@@ -508,41 +508,41 @@ const vt = ({
|
|
|
508
508
|
shouldShowZeroState: a,
|
|
509
509
|
unavailableWidth: n = 24
|
|
510
510
|
}) => {
|
|
511
|
-
const { onEvent: r } =
|
|
512
|
-
c(v), r(
|
|
511
|
+
const { onEvent: r } = V(), { setSelectedBudget: c } = D(), { isLoadingCategoryTotals: g } = z(), { isInitialized: d } = ae(), { accounts: u } = w(), { availableWidth: B } = oe(), { isMobile: h } = ce(), [f, p] = l.useState(!1), C = l.useMemo(() => B - n, [B]), y = (v) => {
|
|
512
|
+
c(v), r(L.BUDGETS_CLICK_BUDGET_CATEGORY, {
|
|
513
513
|
budget_category: v.category.name,
|
|
514
514
|
click_type: "bubble"
|
|
515
515
|
});
|
|
516
|
-
},
|
|
517
|
-
p(!0), r(
|
|
516
|
+
}, _ = () => {
|
|
517
|
+
p(!0), r(L.ACCOUNTS_CLICK_CONNECT);
|
|
518
518
|
};
|
|
519
|
-
return
|
|
520
|
-
|
|
519
|
+
return g ? /* @__PURE__ */ e(S, { alignItems: "center", height: o, justifyContent: "center", width: Math.abs(C), children: /* @__PURE__ */ e(j, {}) }) : /* @__PURE__ */ m(
|
|
520
|
+
W,
|
|
521
521
|
{
|
|
522
|
-
ml: a ||
|
|
522
|
+
ml: a || h ? 0 : 24,
|
|
523
523
|
sx: { alignSelf: "center", ...s && { height: "100%" } },
|
|
524
524
|
children: [
|
|
525
|
-
a || !
|
|
526
|
-
|
|
525
|
+
a || !d ? /* @__PURE__ */ e(
|
|
526
|
+
Dt,
|
|
527
527
|
{
|
|
528
528
|
createBudgetOnClick: t,
|
|
529
529
|
isMiniWidget: s,
|
|
530
|
-
onConnectAccountsClick:
|
|
530
|
+
onConnectAccountsClick: _
|
|
531
531
|
}
|
|
532
532
|
) : /* @__PURE__ */ e(
|
|
533
|
-
|
|
533
|
+
wt,
|
|
534
534
|
{
|
|
535
535
|
height: o,
|
|
536
536
|
isDraggable: i,
|
|
537
|
-
onClick:
|
|
538
|
-
width:
|
|
537
|
+
onClick: y,
|
|
538
|
+
width: C
|
|
539
539
|
}
|
|
540
540
|
),
|
|
541
541
|
/* @__PURE__ */ e(
|
|
542
|
-
|
|
542
|
+
Xe,
|
|
543
543
|
{
|
|
544
544
|
onClose: () => p(!1),
|
|
545
|
-
showConnectionsWidget:
|
|
545
|
+
showConnectionsWidget: f,
|
|
546
546
|
title: u.manage_connections
|
|
547
547
|
}
|
|
548
548
|
)
|
|
@@ -550,13 +550,13 @@ const vt = ({
|
|
|
550
550
|
}
|
|
551
551
|
);
|
|
552
552
|
}
|
|
553
|
-
),
|
|
553
|
+
), It = ({
|
|
554
554
|
budgetsCopy: t,
|
|
555
555
|
difference: o,
|
|
556
556
|
handleAddClick: i,
|
|
557
557
|
shouldShowZeroState: s
|
|
558
558
|
}) => {
|
|
559
|
-
const { availableHeight: a = 0 } =
|
|
559
|
+
const { availableHeight: a = 0 } = oe(), n = l.useRef(null);
|
|
560
560
|
l.useEffect(() => {
|
|
561
561
|
a > 0 && n.current === null && (n.current = a);
|
|
562
562
|
}, [a]);
|
|
@@ -564,9 +564,9 @@ const vt = ({
|
|
|
564
564
|
const c = n.current ?? a;
|
|
565
565
|
return c > 0 ? Math.round(Math.max(120, Math.min(450, c * 0.8))) - 40 : 450;
|
|
566
566
|
}, [a]);
|
|
567
|
-
return /* @__PURE__ */
|
|
567
|
+
return /* @__PURE__ */ m(S, { sx: { height: "100%", justifyContent: "space-between" }, children: [
|
|
568
568
|
/* @__PURE__ */ e(
|
|
569
|
-
|
|
569
|
+
Le,
|
|
570
570
|
{
|
|
571
571
|
createBudgetOnClick: i,
|
|
572
572
|
height: r,
|
|
@@ -574,25 +574,25 @@ const vt = ({
|
|
|
574
574
|
shouldShowZeroState: s
|
|
575
575
|
}
|
|
576
576
|
),
|
|
577
|
-
!s && /* @__PURE__ */
|
|
578
|
-
/* @__PURE__ */ e(
|
|
579
|
-
/* @__PURE__ */ e(
|
|
577
|
+
!s && /* @__PURE__ */ m(W, { ml: 16, children: [
|
|
578
|
+
/* @__PURE__ */ e(b, { bold: !0, color: o < 0 ? "error.main" : "success.main", children: T(Math.abs(o), "0,0") }),
|
|
579
|
+
/* @__PURE__ */ e(b, { children: o < 0 ? t.overspent_in_budgets : t.left_in_budgets })
|
|
580
580
|
] })
|
|
581
581
|
] });
|
|
582
|
-
},
|
|
583
|
-
const o =
|
|
584
|
-
|
|
585
|
-
}, v = () =>
|
|
582
|
+
}, Et = (t) => {
|
|
583
|
+
const o = te(), { onEvent: i } = V(), { detailedBudgets: s, isDataLoaded: a, loadBudgetData: n, setTheme: r } = D(), { budgets: c, common: g } = w(), { isCopyLoaded: d, isInitialized: u, selectedAccounts: B } = ae(), { reloadCategoryTotals: h } = z(), f = qe(), p = s.length === 0, [C, y] = l.useState(!1), _ = () => {
|
|
584
|
+
y(!0), i(L.BUDGETS_CLICK_ADD);
|
|
585
|
+
}, v = () => y(!1);
|
|
586
586
|
return l.useEffect(() => {
|
|
587
587
|
r(o);
|
|
588
588
|
}, [o]), l.useEffect(() => {
|
|
589
|
-
u && !a &&
|
|
589
|
+
u && !a && h(B, Q(/* @__PURE__ */ new Date()), pe(/* @__PURE__ */ new Date())).then(
|
|
590
590
|
() => {
|
|
591
591
|
n().finally();
|
|
592
592
|
}
|
|
593
593
|
);
|
|
594
|
-
}, [u,
|
|
595
|
-
|
|
594
|
+
}, [u, B]), d ? /* @__PURE__ */ m(
|
|
595
|
+
Je,
|
|
596
596
|
{
|
|
597
597
|
contentStyles: { height: "calc(100% - 66px)", ":last-child": { pb: 0 } },
|
|
598
598
|
primaryCtaLabel: p ? c.get_started_cta : c.details_cta,
|
|
@@ -601,28 +601,28 @@ const vt = ({
|
|
|
601
601
|
...t,
|
|
602
602
|
children: [
|
|
603
603
|
a ? /* @__PURE__ */ e(
|
|
604
|
-
|
|
604
|
+
It,
|
|
605
605
|
{
|
|
606
606
|
budgetsCopy: c,
|
|
607
|
-
difference:
|
|
608
|
-
handleAddClick:
|
|
607
|
+
difference: f,
|
|
608
|
+
handleAddClick: _,
|
|
609
609
|
shouldShowZeroState: p
|
|
610
610
|
}
|
|
611
|
-
) : /* @__PURE__ */ e(
|
|
611
|
+
) : /* @__PURE__ */ e(j, {}),
|
|
612
612
|
/* @__PURE__ */ e(
|
|
613
|
-
|
|
613
|
+
k,
|
|
614
614
|
{
|
|
615
|
-
ariaLabelClose:
|
|
616
|
-
isOpen:
|
|
617
|
-
onClose: () =>
|
|
615
|
+
ariaLabelClose: g.close_aria,
|
|
616
|
+
isOpen: C,
|
|
617
|
+
onClose: () => y(!1),
|
|
618
618
|
title: c.add_new_title,
|
|
619
|
-
children: /* @__PURE__ */ e(
|
|
619
|
+
children: /* @__PURE__ */ e(Oe, { onRecalculateBudgets: v })
|
|
620
620
|
}
|
|
621
621
|
)
|
|
622
622
|
]
|
|
623
623
|
}
|
|
624
|
-
) : /* @__PURE__ */ e(
|
|
625
|
-
},
|
|
624
|
+
) : /* @__PURE__ */ e(j, {});
|
|
625
|
+
}, $n = I(Et), ke = ({ budget: t }) => {
|
|
626
626
|
const {
|
|
627
627
|
amount: o,
|
|
628
628
|
budgetColors: { background: i },
|
|
@@ -636,20 +636,20 @@ const vt = ({
|
|
|
636
636
|
percentage: `${n}%`
|
|
637
637
|
}
|
|
638
638
|
];
|
|
639
|
-
return /* @__PURE__ */ e(
|
|
640
|
-
/* @__PURE__ */ e(
|
|
641
|
-
/* @__PURE__ */ e(
|
|
642
|
-
/* @__PURE__ */ e(
|
|
643
|
-
/* @__PURE__ */ e(
|
|
639
|
+
return /* @__PURE__ */ e(fe, { sx: { mt: 24, mx: 24 }, children: /* @__PURE__ */ e(be, { children: /* @__PURE__ */ m(S, { alignItems: "center", gap: 16, children: [
|
|
640
|
+
/* @__PURE__ */ e(K, { categoryGuid: a, size: 56 }),
|
|
641
|
+
/* @__PURE__ */ e(Ue, { children: `${T(r, "0,0")} / ${T(o, "0,0")}` }),
|
|
642
|
+
/* @__PURE__ */ e(b, { bold: !0, variant: "XSmall", children: s }),
|
|
643
|
+
/* @__PURE__ */ e(he, { data: c, height: 10 })
|
|
644
644
|
] }) }) });
|
|
645
|
-
},
|
|
645
|
+
}, Ot = I(() => {
|
|
646
646
|
const { budgets: t } = w();
|
|
647
|
-
return /* @__PURE__ */
|
|
648
|
-
/* @__PURE__ */ e(
|
|
649
|
-
/* @__PURE__ */ e(
|
|
650
|
-
/* @__PURE__ */ e(
|
|
647
|
+
return /* @__PURE__ */ m(S, { alignItems: "center", gap: 12, height: "auto", mb: 24, mt: 24, children: [
|
|
648
|
+
/* @__PURE__ */ e(N, { color: "secondary", name: "bubble_chart", sx: { fontSize: 32 } }),
|
|
649
|
+
/* @__PURE__ */ e(b, { bold: !0, color: "secondary", variant: "Small", children: t.zero_state_no_sub_budgets }),
|
|
650
|
+
/* @__PURE__ */ e(b, { color: "text.secondary", variant: "XSmall", children: t.zero_state_no_sub_budgets_description })
|
|
651
651
|
] });
|
|
652
|
-
}),
|
|
652
|
+
}), Mt = I(({ budget: t }) => {
|
|
653
653
|
const {
|
|
654
654
|
amount: o,
|
|
655
655
|
budgetColors: { background: i },
|
|
@@ -657,219 +657,219 @@ const vt = ({
|
|
|
657
657
|
percentage: a,
|
|
658
658
|
transaction_total: n
|
|
659
659
|
} = t, { setSelectedSubBudget: r } = D();
|
|
660
|
-
return /* @__PURE__ */ e(
|
|
661
|
-
/* @__PURE__ */ e(
|
|
660
|
+
return /* @__PURE__ */ e(Y, { children: /* @__PURE__ */ m(Z, { onClick: () => r(t), children: [
|
|
661
|
+
/* @__PURE__ */ e(ie, { sx: { mb: -8, mr: 16 }, children: /* @__PURE__ */ e(Ie, { color: i, percent: a, size: 40, children: /* @__PURE__ */ e(K, { categoryGuid: s.parent_guid, variant: "basic" }) }) }),
|
|
662
662
|
/* @__PURE__ */ e(
|
|
663
|
-
|
|
663
|
+
q,
|
|
664
664
|
{
|
|
665
|
-
primary: /* @__PURE__ */ e(
|
|
666
|
-
secondary: /* @__PURE__ */ e(
|
|
665
|
+
primary: /* @__PURE__ */ e(S, { component: "span", direction: "row", justifyContent: "space-between", children: /* @__PURE__ */ e(b, { bold: !0, variant: "Body", children: t.category.name }) }),
|
|
666
|
+
secondary: /* @__PURE__ */ e(S, { component: "span", direction: "row", justifyContent: "space-between", children: /* @__PURE__ */ e(b, { fontWeight: 400, variant: "Body", children: `
|
|
667
667
|
${T(n, "0,0")} /
|
|
668
668
|
${T(o, "0,0")}
|
|
669
669
|
` }) })
|
|
670
670
|
}
|
|
671
671
|
)
|
|
672
672
|
] }) });
|
|
673
|
-
}),
|
|
674
|
-
const { budgets: i, common: s } = w(), { setExpandedGuid: a, setOnSelect: n } =
|
|
673
|
+
}), Rt = I(({ category: t, parentBudget: o }) => {
|
|
674
|
+
const { budgets: i, common: s } = w(), { setExpandedGuid: a, setOnSelect: n } = rt(), { addBudget: r } = D(), [c, g] = l.useState(!1), [d, u] = l.useState(!1), [B, h] = l.useState(""), [f, p] = l.useState(void 0);
|
|
675
675
|
l.useEffect(() => {
|
|
676
|
-
n((
|
|
677
|
-
const v = t.subCategories.find((A) => A.guid ===
|
|
678
|
-
v && (p(v),
|
|
676
|
+
n((_) => {
|
|
677
|
+
const v = t.subCategories.find((A) => A.guid === _);
|
|
678
|
+
v && (p(v), h(`${v.currentAmount === 0 ? "" : v.currentAmount}`), u(!0));
|
|
679
679
|
});
|
|
680
680
|
}, []);
|
|
681
|
-
const
|
|
682
|
-
a(t.guid),
|
|
683
|
-
},
|
|
684
|
-
|
|
681
|
+
const C = () => {
|
|
682
|
+
a(t.guid), g(!0);
|
|
683
|
+
}, y = async () => {
|
|
684
|
+
f && Number(B) > 0 && (await r(f, Number(B), o.guid), u(!1), g(!1), p(void 0));
|
|
685
685
|
};
|
|
686
|
-
return /* @__PURE__ */
|
|
687
|
-
/* @__PURE__ */ e(
|
|
688
|
-
/* @__PURE__ */
|
|
689
|
-
/* @__PURE__ */ e(
|
|
690
|
-
/* @__PURE__ */ e(
|
|
686
|
+
return /* @__PURE__ */ m(W, { children: [
|
|
687
|
+
/* @__PURE__ */ e(Y, { disableGutters: !0, disablePadding: !0, sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ e(Z, { onClick: C, children: /* @__PURE__ */ e(q, { children: /* @__PURE__ */ m(S, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
|
|
688
|
+
/* @__PURE__ */ m(S, { alignItems: "center", direction: "row", gap: 8, children: [
|
|
689
|
+
/* @__PURE__ */ e(N, { fill: !0, name: "add_box", size: 24, sx: { color: "primary.light" } }),
|
|
690
|
+
/* @__PURE__ */ e(b, { bold: !0, sx: { color: "primary.light" }, variant: "Body", children: i.add_sub_budget_button })
|
|
691
691
|
] }),
|
|
692
|
-
/* @__PURE__ */ e(
|
|
692
|
+
/* @__PURE__ */ e(N, { name: "chevron_right", size: 24, sx: { color: "primary.light" } })
|
|
693
693
|
] }) }) }) }),
|
|
694
|
-
/* @__PURE__ */ e(
|
|
694
|
+
/* @__PURE__ */ e(se, {}),
|
|
695
695
|
/* @__PURE__ */ e(
|
|
696
|
-
|
|
696
|
+
k,
|
|
697
697
|
{
|
|
698
698
|
ariaLabelClose: s.close_aria,
|
|
699
699
|
isOpen: c,
|
|
700
|
-
onClose: () =>
|
|
700
|
+
onClose: () => g(!1),
|
|
701
701
|
title: i.add_sub_budget_title,
|
|
702
|
-
children: /* @__PURE__ */ e(
|
|
702
|
+
children: /* @__PURE__ */ e(X, { children: /* @__PURE__ */ e(st, { category: t, subCategories: t.subCategories }) })
|
|
703
703
|
}
|
|
704
704
|
),
|
|
705
705
|
/* @__PURE__ */ e(
|
|
706
|
-
|
|
706
|
+
G,
|
|
707
707
|
{
|
|
708
708
|
copy: { close_aria: s.close_aria, title: i.add_title },
|
|
709
|
-
disablePrimaryButton: Number(
|
|
710
|
-
isOpen:
|
|
709
|
+
disablePrimaryButton: Number(B) <= 0,
|
|
710
|
+
isOpen: d,
|
|
711
711
|
onClose: () => u(!1),
|
|
712
|
-
onPrimaryAction:
|
|
712
|
+
onPrimaryAction: y,
|
|
713
713
|
primaryText: i.add_save_button,
|
|
714
714
|
children: /* @__PURE__ */ e(
|
|
715
|
-
|
|
715
|
+
le,
|
|
716
716
|
{
|
|
717
|
-
amount:
|
|
718
|
-
categoryName:
|
|
719
|
-
onAmountChanged:
|
|
717
|
+
amount: B,
|
|
718
|
+
categoryName: f?.name || "",
|
|
719
|
+
onAmountChanged: h
|
|
720
720
|
}
|
|
721
721
|
)
|
|
722
722
|
}
|
|
723
723
|
)
|
|
724
724
|
] });
|
|
725
|
-
}),
|
|
726
|
-
const { category: o, subBudgets: i } = t, { budgets: s, common: a } = w(), { deleteBudget: n, selectedSubBudget: r, setSelectedSubBudget: c, updateBudget:
|
|
725
|
+
}), Lt = I(({ budget: t }) => {
|
|
726
|
+
const { category: o, subBudgets: i } = t, { budgets: s, common: a } = w(), { deleteBudget: n, selectedSubBudget: r, setSelectedSubBudget: c, updateBudget: g } = D(), { filter: d, setFilter: u } = re(), [B, h] = l.useState(!1), [f, p] = l.useState(!1), [C, y] = l.useState("");
|
|
727
727
|
l.useEffect(() => {
|
|
728
|
-
r && (
|
|
729
|
-
...
|
|
728
|
+
r && (y(`${r.amount}`), u({
|
|
729
|
+
...d,
|
|
730
730
|
custom: (x) => x.category_guid === r.category_guid
|
|
731
731
|
}));
|
|
732
732
|
}, [r]);
|
|
733
|
-
const
|
|
734
|
-
r && await
|
|
733
|
+
const _ = async () => {
|
|
734
|
+
r && await g({
|
|
735
735
|
...r,
|
|
736
|
-
amount: Number(
|
|
736
|
+
amount: Number(C)
|
|
737
737
|
});
|
|
738
738
|
}, v = async () => {
|
|
739
739
|
r && await n(r.guid), p(!1), A();
|
|
740
740
|
}, A = () => {
|
|
741
741
|
u({
|
|
742
|
-
...
|
|
742
|
+
...d,
|
|
743
743
|
custom: (x) => x.category_guid === t.category_guid || x.top_level_category_guid === t.category_guid
|
|
744
744
|
}), c(void 0);
|
|
745
745
|
};
|
|
746
|
-
return /* @__PURE__ */
|
|
747
|
-
/* @__PURE__ */
|
|
748
|
-
i.length === 0 ? /* @__PURE__ */ e(
|
|
749
|
-
/* @__PURE__ */ e(
|
|
750
|
-
/* @__PURE__ */ e(
|
|
746
|
+
return /* @__PURE__ */ m(l.Fragment, { children: [
|
|
747
|
+
/* @__PURE__ */ m(X, { sx: { bgcolor: "background.paper" }, children: [
|
|
748
|
+
i.length === 0 ? /* @__PURE__ */ e(Ot, {}) : i.map((x) => /* @__PURE__ */ m(l.Fragment, { children: [
|
|
749
|
+
/* @__PURE__ */ e(Mt, { budget: x }),
|
|
750
|
+
/* @__PURE__ */ e(se, {})
|
|
751
751
|
] }, x.guid)),
|
|
752
|
-
/* @__PURE__ */ e(
|
|
752
|
+
/* @__PURE__ */ e(Rt, { category: o, parentBudget: t })
|
|
753
753
|
] }),
|
|
754
754
|
/* @__PURE__ */ e(
|
|
755
|
-
|
|
755
|
+
k,
|
|
756
756
|
{
|
|
757
757
|
ariaLabelClose: a.close_aria,
|
|
758
758
|
isOpen: !!r,
|
|
759
759
|
onClose: A,
|
|
760
|
-
onPrimaryAction: () =>
|
|
760
|
+
onPrimaryAction: () => h(!0),
|
|
761
761
|
onSecondaryAction: () => p(!0),
|
|
762
762
|
primaryText: s.details_edit_button,
|
|
763
763
|
secondaryText: s.details_delete_button,
|
|
764
764
|
title: s.details_title,
|
|
765
|
-
children: r && /* @__PURE__ */
|
|
766
|
-
/* @__PURE__ */ e(
|
|
767
|
-
/* @__PURE__ */ e(
|
|
765
|
+
children: r && /* @__PURE__ */ m(S, { gap: 24, children: [
|
|
766
|
+
/* @__PURE__ */ e(ke, { budget: r }),
|
|
767
|
+
/* @__PURE__ */ e(De, { height: "100%" })
|
|
768
768
|
] })
|
|
769
769
|
}
|
|
770
770
|
),
|
|
771
|
-
r && /* @__PURE__ */
|
|
771
|
+
r && /* @__PURE__ */ m(l.Fragment, { children: [
|
|
772
772
|
/* @__PURE__ */ e(
|
|
773
|
-
|
|
773
|
+
G,
|
|
774
774
|
{
|
|
775
775
|
copy: { close_aria: a.close_aria, title: s.details_edit_title },
|
|
776
|
-
disablePrimaryButton: Number(
|
|
777
|
-
isOpen:
|
|
778
|
-
onClose: () =>
|
|
779
|
-
onPrimaryAction:
|
|
776
|
+
disablePrimaryButton: Number(C) <= 0,
|
|
777
|
+
isOpen: B,
|
|
778
|
+
onClose: () => h(!1),
|
|
779
|
+
onPrimaryAction: _,
|
|
780
780
|
primaryText: s.edit_save_button,
|
|
781
781
|
children: /* @__PURE__ */ e(
|
|
782
|
-
|
|
782
|
+
le,
|
|
783
783
|
{
|
|
784
|
-
amount:
|
|
784
|
+
amount: C,
|
|
785
785
|
categoryName: r.category.name,
|
|
786
|
-
onAmountChanged:
|
|
786
|
+
onAmountChanged: y
|
|
787
787
|
}
|
|
788
788
|
)
|
|
789
789
|
}
|
|
790
790
|
),
|
|
791
791
|
/* @__PURE__ */ e(
|
|
792
|
-
|
|
792
|
+
G,
|
|
793
793
|
{
|
|
794
794
|
copy: { close_aria: a.close_aria, title: s.delete_title },
|
|
795
|
-
isOpen:
|
|
795
|
+
isOpen: f,
|
|
796
796
|
onClose: () => p(!1),
|
|
797
797
|
onPrimaryAction: v,
|
|
798
798
|
primaryColor: "error",
|
|
799
799
|
primaryText: "Delete",
|
|
800
800
|
secondaryColor: "secondary",
|
|
801
|
-
children: /* @__PURE__ */ e(
|
|
801
|
+
children: /* @__PURE__ */ e(b, { variant: "Paragraph", children: R(s.delete_description, r.category.name) })
|
|
802
802
|
}
|
|
803
803
|
)
|
|
804
804
|
] })
|
|
805
805
|
] });
|
|
806
|
-
}),
|
|
807
|
-
const { is_mobile_webview: o } =
|
|
808
|
-
sortedTransactions:
|
|
806
|
+
}), kt = I(({ budget: t }) => {
|
|
807
|
+
const { is_mobile_webview: o } = Fe(), { setAlert: i } = D(), { budgets: s, common: a, transactions: n } = w(), { isDesktop: r, isSmallTablet: c, isTablet: g } = ce(), {
|
|
808
|
+
sortedTransactions: d,
|
|
809
809
|
sortedTransactionsWithSplits: u,
|
|
810
|
-
tags:
|
|
811
|
-
} =
|
|
812
|
-
() =>
|
|
813
|
-
[p,
|
|
814
|
-
),
|
|
815
|
-
|
|
810
|
+
tags: B
|
|
811
|
+
} = re(), [h, f] = l.useState(0), [p, C] = l.useState(""), y = l.useMemo(
|
|
812
|
+
() => d.find((x) => x.guid === p),
|
|
813
|
+
[p, d]
|
|
814
|
+
), _ = (x, E) => {
|
|
815
|
+
f(E);
|
|
816
816
|
}, v = () => {
|
|
817
|
-
|
|
818
|
-
}, A =
|
|
819
|
-
return /* @__PURE__ */
|
|
820
|
-
/* @__PURE__ */ e(
|
|
821
|
-
/* @__PURE__ */
|
|
822
|
-
/* @__PURE__ */
|
|
823
|
-
|
|
817
|
+
ot(u, B), i(s.alert_csv_downloaded);
|
|
818
|
+
}, A = d.length > 0 && !o && (r || g && !c);
|
|
819
|
+
return /* @__PURE__ */ m(S, { gap: 24, children: [
|
|
820
|
+
/* @__PURE__ */ e(ke, { budget: t }),
|
|
821
|
+
/* @__PURE__ */ m(S, { children: [
|
|
822
|
+
/* @__PURE__ */ m(
|
|
823
|
+
nt,
|
|
824
824
|
{
|
|
825
|
-
onChange:
|
|
825
|
+
onChange: _,
|
|
826
826
|
sx: { width: "100%" },
|
|
827
827
|
textColor: "primary",
|
|
828
|
-
value:
|
|
828
|
+
value: h,
|
|
829
829
|
variant: "fullWidth",
|
|
830
830
|
children: [
|
|
831
|
-
/* @__PURE__ */ e(
|
|
832
|
-
/* @__PURE__ */ e(
|
|
831
|
+
/* @__PURE__ */ e(Ce, { label: s.details_transactions_tab }),
|
|
832
|
+
/* @__PURE__ */ e(Ce, { label: s.details_subbudgets_tab })
|
|
833
833
|
]
|
|
834
834
|
}
|
|
835
835
|
),
|
|
836
|
-
|
|
837
|
-
A && /* @__PURE__ */ e(
|
|
838
|
-
|
|
836
|
+
h === 0 && /* @__PURE__ */ m(S, { children: [
|
|
837
|
+
A && /* @__PURE__ */ e(S, { direction: "row", justifyContent: "right", mb: -24, mr: 8, mt: 8, zIndex: 1, children: /* @__PURE__ */ e(
|
|
838
|
+
we,
|
|
839
839
|
{
|
|
840
840
|
onClick: v,
|
|
841
|
-
startIcon: /* @__PURE__ */ e(
|
|
841
|
+
startIcon: /* @__PURE__ */ e(N, { name: "ios_share" }),
|
|
842
842
|
variant: "text",
|
|
843
843
|
children: n.export_csv_btn
|
|
844
844
|
}
|
|
845
845
|
) }),
|
|
846
|
-
/* @__PURE__ */ e(
|
|
846
|
+
/* @__PURE__ */ e(De, { height: "100%", onClick: C })
|
|
847
847
|
] }),
|
|
848
|
-
|
|
848
|
+
h === 1 && /* @__PURE__ */ e(Lt, { budget: t }),
|
|
849
849
|
/* @__PURE__ */ e(
|
|
850
|
-
|
|
850
|
+
k,
|
|
851
851
|
{
|
|
852
852
|
ariaLabelClose: a.close_aria,
|
|
853
|
-
isOpen: !!
|
|
854
|
-
onClose: () =>
|
|
853
|
+
isOpen: !!y,
|
|
854
|
+
onClose: () => C(""),
|
|
855
855
|
title: s.details_transaction_drawer,
|
|
856
|
-
children:
|
|
856
|
+
children: y && /* @__PURE__ */ e(at, { transaction: y })
|
|
857
857
|
}
|
|
858
858
|
)
|
|
859
859
|
] })
|
|
860
860
|
] });
|
|
861
|
-
}),
|
|
862
|
-
const { selectedAccountGuids: t } =
|
|
861
|
+
}), $t = I(() => {
|
|
862
|
+
const { selectedAccountGuids: t } = ae(), { budgets: o, common: i } = w(), {
|
|
863
863
|
dateRange: s,
|
|
864
864
|
deleteBudget: a,
|
|
865
865
|
selectedBudget: n,
|
|
866
866
|
selectedSubBudget: r,
|
|
867
867
|
setAlert: c,
|
|
868
|
-
setSelectedBudget:
|
|
869
|
-
updateBudget:
|
|
870
|
-
} = D(), { setFilter: u } =
|
|
868
|
+
setSelectedBudget: g,
|
|
869
|
+
updateBudget: d
|
|
870
|
+
} = D(), { setFilter: u } = re(), [B, h] = l.useState(!1), [f, p] = l.useState(!1), [C, y] = l.useState(!1), [_, v] = l.useState("");
|
|
871
871
|
l.useEffect(() => {
|
|
872
|
-
n && !r && (v(`${n.amount}`),
|
|
872
|
+
n && !r && (v(`${n.amount}`), h(!0), u({
|
|
873
873
|
accounts: t,
|
|
874
874
|
dateRange: s,
|
|
875
875
|
custom: (M) => M.category_guid === n.category_guid || M.top_level_category_guid === n.category_guid,
|
|
@@ -877,48 +877,48 @@ const vt = ({
|
|
|
877
877
|
}));
|
|
878
878
|
}, [n]);
|
|
879
879
|
const A = async () => {
|
|
880
|
-
n && (await
|
|
880
|
+
n && (await d({
|
|
881
881
|
...n,
|
|
882
|
-
amount: Number(
|
|
883
|
-
percentage: n.category.totalAmount / Number(
|
|
882
|
+
amount: Number(_),
|
|
883
|
+
percentage: n.category.totalAmount / Number(_) * 100
|
|
884
884
|
}), c(R(o.alert_budget_updated, n.category.name)));
|
|
885
885
|
}, x = async () => {
|
|
886
|
-
n && (await a(n.guid), c(R(o.alert_budget_deleted, n.category.name))),
|
|
886
|
+
n && (await a(n.guid), c(R(o.alert_budget_deleted, n.category.name))), y(!1), E();
|
|
887
887
|
}, E = () => {
|
|
888
|
-
|
|
889
|
-
|
|
888
|
+
h(!1), setTimeout(() => {
|
|
889
|
+
g(void 0);
|
|
890
890
|
}, 250);
|
|
891
891
|
};
|
|
892
892
|
if (n)
|
|
893
|
-
return /* @__PURE__ */
|
|
893
|
+
return /* @__PURE__ */ m(l.Fragment, { children: [
|
|
894
894
|
/* @__PURE__ */ e(
|
|
895
|
-
|
|
895
|
+
k,
|
|
896
896
|
{
|
|
897
897
|
ariaLabelClose: i.close_aria,
|
|
898
|
-
isOpen:
|
|
898
|
+
isOpen: B,
|
|
899
899
|
onClose: E,
|
|
900
900
|
onPrimaryAction: () => p(!0),
|
|
901
|
-
onSecondaryAction: () =>
|
|
901
|
+
onSecondaryAction: () => y(!0),
|
|
902
902
|
primaryText: o.details_edit_button,
|
|
903
903
|
secondaryColor: "error",
|
|
904
904
|
secondaryText: o.details_delete_button,
|
|
905
905
|
title: o.details_title,
|
|
906
|
-
children: /* @__PURE__ */ e(
|
|
906
|
+
children: /* @__PURE__ */ e(kt, { budget: n })
|
|
907
907
|
}
|
|
908
908
|
),
|
|
909
909
|
/* @__PURE__ */ e(
|
|
910
|
-
|
|
910
|
+
G,
|
|
911
911
|
{
|
|
912
912
|
copy: { close_aria: i.close_aria, title: o.details_edit_title },
|
|
913
|
-
disablePrimaryButton: Number(
|
|
914
|
-
isOpen:
|
|
913
|
+
disablePrimaryButton: Number(_) <= 0,
|
|
914
|
+
isOpen: f,
|
|
915
915
|
onClose: () => p(!1),
|
|
916
916
|
onPrimaryAction: A,
|
|
917
917
|
primaryText: o.edit_save_button,
|
|
918
918
|
children: /* @__PURE__ */ e(
|
|
919
|
-
|
|
919
|
+
le,
|
|
920
920
|
{
|
|
921
|
-
amount:
|
|
921
|
+
amount: _,
|
|
922
922
|
categoryName: n.category.name,
|
|
923
923
|
onAmountChanged: v
|
|
924
924
|
}
|
|
@@ -926,66 +926,66 @@ const vt = ({
|
|
|
926
926
|
}
|
|
927
927
|
),
|
|
928
928
|
/* @__PURE__ */ e(
|
|
929
|
-
|
|
929
|
+
G,
|
|
930
930
|
{
|
|
931
931
|
copy: { close_aria: i.close_aria, title: o.delete_title },
|
|
932
|
-
isOpen:
|
|
933
|
-
onClose: () =>
|
|
932
|
+
isOpen: C,
|
|
933
|
+
onClose: () => y(!1),
|
|
934
934
|
onPrimaryAction: x,
|
|
935
935
|
primaryColor: "error",
|
|
936
936
|
primaryText: o.details_delete_button,
|
|
937
937
|
secondaryColor: "secondary",
|
|
938
|
-
children: /* @__PURE__ */ e(
|
|
938
|
+
children: /* @__PURE__ */ e(b, { variant: "Paragraph", children: R(o.delete_description, n.category.name) })
|
|
939
939
|
}
|
|
940
940
|
)
|
|
941
941
|
] });
|
|
942
|
-
}),
|
|
942
|
+
}), Nt = ({ budget: t, onClick: o }) => {
|
|
943
943
|
const {
|
|
944
944
|
amount: i,
|
|
945
945
|
budgetColors: { background: s, description: a },
|
|
946
946
|
category_guid: n,
|
|
947
947
|
description: r,
|
|
948
948
|
percentage: c,
|
|
949
|
-
subBudgets:
|
|
950
|
-
transaction_total:
|
|
949
|
+
subBudgets: g,
|
|
950
|
+
transaction_total: d
|
|
951
951
|
} = t;
|
|
952
|
-
return /* @__PURE__ */ e(
|
|
953
|
-
/* @__PURE__ */ e(
|
|
952
|
+
return /* @__PURE__ */ e(Y, { children: /* @__PURE__ */ m(Z, { onClick: () => o?.(t), children: [
|
|
953
|
+
/* @__PURE__ */ e(ie, { sx: { mb: -8, mr: 16 }, children: /* @__PURE__ */ e(Ie, { color: s, percent: c, size: 40, children: /* @__PURE__ */ e(K, { categoryGuid: n, variant: "basic" }) }) }),
|
|
954
954
|
/* @__PURE__ */ e(
|
|
955
|
-
|
|
955
|
+
q,
|
|
956
956
|
{
|
|
957
|
-
primary: /* @__PURE__ */
|
|
958
|
-
/* @__PURE__ */ e(
|
|
959
|
-
/* @__PURE__ */ e(
|
|
960
|
-
${T(
|
|
957
|
+
primary: /* @__PURE__ */ m(S, { component: "span", direction: "row", justifyContent: "space-between", children: [
|
|
958
|
+
/* @__PURE__ */ e(b, { bold: !0, variant: "Body", children: t.category.name }),
|
|
959
|
+
/* @__PURE__ */ e(b, { fontWeight: 400, variant: "Body", children: `
|
|
960
|
+
${T(d, "0,0")} /
|
|
961
961
|
${T(i, "0,0")}
|
|
962
962
|
` })
|
|
963
963
|
] }),
|
|
964
|
-
secondary: /* @__PURE__ */
|
|
965
|
-
/* @__PURE__ */ e(
|
|
966
|
-
/* @__PURE__ */ e(
|
|
964
|
+
secondary: /* @__PURE__ */ m(S, { component: "span", direction: "row", justifyContent: "space-between", children: [
|
|
965
|
+
/* @__PURE__ */ e(b, { variant: "XSmall", children: `${g.length} Sub-budgets` }),
|
|
966
|
+
/* @__PURE__ */ e(b, { bold: c > 100, color: a, variant: "XSmall", children: r })
|
|
967
967
|
] })
|
|
968
968
|
}
|
|
969
969
|
)
|
|
970
970
|
] }) });
|
|
971
|
-
},
|
|
972
|
-
const { onEvent: t } =
|
|
973
|
-
s(n), t(
|
|
971
|
+
}, Pt = I(() => {
|
|
972
|
+
const { onEvent: t } = V(), { budgets: o } = w(), { detailedBudgets: i, setSelectedBudget: s } = D(), a = (n) => {
|
|
973
|
+
s(n), t(L.BUDGETS_CLICK_BUDGET_CATEGORY, {
|
|
974
974
|
budget_category: n.category.name,
|
|
975
975
|
click_type: "list"
|
|
976
976
|
});
|
|
977
977
|
};
|
|
978
|
-
return /* @__PURE__ */
|
|
979
|
-
/* @__PURE__ */ e(
|
|
980
|
-
/* @__PURE__ */ e(
|
|
981
|
-
/* @__PURE__ */ e(
|
|
982
|
-
/* @__PURE__ */ e(
|
|
978
|
+
return /* @__PURE__ */ m(fe, { elevation: 2, children: [
|
|
979
|
+
/* @__PURE__ */ e(Ee, { sx: { pb: 8, pl: 24 }, title: /* @__PURE__ */ e(Ae, { children: o.budget_categories_title }) }),
|
|
980
|
+
/* @__PURE__ */ e(be, { sx: { p: 0, ":last-child": { p: 0 } }, children: /* @__PURE__ */ e(X, { children: i.map((n) => /* @__PURE__ */ m(l.Fragment, { children: [
|
|
981
|
+
/* @__PURE__ */ e(Nt, { budget: n, onClick: a }),
|
|
982
|
+
/* @__PURE__ */ e(se, {})
|
|
983
983
|
] }, n.guid)) }) })
|
|
984
984
|
] });
|
|
985
|
-
}),
|
|
986
|
-
const t =
|
|
987
|
-
const A = c.reduce((
|
|
988
|
-
let x = A /
|
|
985
|
+
}), Gt = I(() => {
|
|
986
|
+
const t = te(), { onEvent: o } = V(), { visibleAccounts: i } = Te(), { budgets: s, common: a, recurring: n } = w(), { incomeCategories: r, spendCategories: c } = z(), { detailedBudgets: g, totalBudgeted: d } = D(), { incomeTotal: u } = ne(), { setFilter: B } = re(), [h, f] = l.useState(!1), [p, C] = l.useMemo(() => {
|
|
987
|
+
const A = c.reduce(($, U) => $ + U.totalAmount, 0);
|
|
988
|
+
let x = A / d;
|
|
989
989
|
x > 1 && (x = 1);
|
|
990
990
|
let E = t.palette.success.main;
|
|
991
991
|
x > 0.8 && x < 1 ? E = t.palette.warning.main : x >= 1 && (E = t.palette.error.main);
|
|
@@ -996,9 +996,9 @@ const vt = ({
|
|
|
996
996
|
}
|
|
997
997
|
];
|
|
998
998
|
return [A, M];
|
|
999
|
-
}, [
|
|
999
|
+
}, [g, c]), [y, _] = l.useMemo(() => {
|
|
1000
1000
|
const A = Math.abs(
|
|
1001
|
-
r.reduce((M,
|
|
1001
|
+
r.reduce((M, $) => M + $.totalAmount, 0)
|
|
1002
1002
|
);
|
|
1003
1003
|
let x = A / u;
|
|
1004
1004
|
x > 1 && (x = 1);
|
|
@@ -1010,166 +1010,168 @@ const vt = ({
|
|
|
1010
1010
|
];
|
|
1011
1011
|
return [A, E];
|
|
1012
1012
|
}, [r, u]), v = () => {
|
|
1013
|
-
|
|
1013
|
+
B({
|
|
1014
1014
|
accounts: i.map((A) => A.guid),
|
|
1015
1015
|
dateRange: {
|
|
1016
|
-
start:
|
|
1016
|
+
start: it(/* @__PURE__ */ new Date(), 90),
|
|
1017
1017
|
end: /* @__PURE__ */ new Date()
|
|
1018
1018
|
}
|
|
1019
|
-
}),
|
|
1019
|
+
}), f(!0), o(L.BUDGETS_CLICK_EDIT_INCOME);
|
|
1020
1020
|
};
|
|
1021
|
-
return /* @__PURE__ */
|
|
1022
|
-
/* @__PURE__ */ e(
|
|
1023
|
-
/* @__PURE__ */ e(
|
|
1024
|
-
/* @__PURE__ */
|
|
1025
|
-
/* @__PURE__ */ e(
|
|
1026
|
-
/* @__PURE__ */ e(
|
|
1027
|
-
/* @__PURE__ */ e(
|
|
1021
|
+
return /* @__PURE__ */ m(fe, { elevation: 2, sx: { overflow: "visible" }, children: [
|
|
1022
|
+
/* @__PURE__ */ e(Ee, { sx: { pb: 8, pl: 24 }, title: /* @__PURE__ */ e(Ae, { children: s.overview_title }) }),
|
|
1023
|
+
/* @__PURE__ */ e(be, { sx: { pt: 12, px: 24 }, children: /* @__PURE__ */ m(S, { gap: 24, children: [
|
|
1024
|
+
/* @__PURE__ */ m(S, { gap: 8, children: [
|
|
1025
|
+
/* @__PURE__ */ e(b, { bold: !0, sx: { mb: 8 }, variant: "Body", children: s.spending_title }),
|
|
1026
|
+
/* @__PURE__ */ e(he, { data: C, height: 16 }),
|
|
1027
|
+
/* @__PURE__ */ e(b, { variant: "Small", children: R(
|
|
1028
1028
|
s.spending_description,
|
|
1029
1029
|
T(p, "0,0"),
|
|
1030
|
-
T(
|
|
1030
|
+
T(d, "0,0")
|
|
1031
1031
|
) })
|
|
1032
1032
|
] }),
|
|
1033
|
-
/* @__PURE__ */
|
|
1034
|
-
/* @__PURE__ */
|
|
1035
|
-
/* @__PURE__ */ e(
|
|
1033
|
+
/* @__PURE__ */ m(S, { gap: 8, children: [
|
|
1034
|
+
/* @__PURE__ */ m(S, { alignItems: "center", direction: "row", gap: 4, mb: -4, children: [
|
|
1035
|
+
/* @__PURE__ */ e(b, { bold: !0, variant: "Body", children: s.income_title }),
|
|
1036
1036
|
/* @__PURE__ */ e(
|
|
1037
|
-
|
|
1037
|
+
ct,
|
|
1038
1038
|
{
|
|
1039
1039
|
"aria-label": n.manage_income,
|
|
1040
1040
|
onClick: v,
|
|
1041
1041
|
sx: { p: 0 },
|
|
1042
|
-
children: /* @__PURE__ */ e(
|
|
1042
|
+
children: /* @__PURE__ */ e(N, { color: "primary", name: "edit" })
|
|
1043
1043
|
}
|
|
1044
1044
|
)
|
|
1045
1045
|
] }),
|
|
1046
|
-
/* @__PURE__ */ e(
|
|
1047
|
-
/* @__PURE__ */ e(
|
|
1046
|
+
/* @__PURE__ */ e(he, { data: _, height: 16 }),
|
|
1047
|
+
/* @__PURE__ */ e(b, { variant: "Small", children: R(
|
|
1048
1048
|
s.income_description,
|
|
1049
|
-
T(
|
|
1049
|
+
T(y, "0,0"),
|
|
1050
1050
|
T(u, "0,0")
|
|
1051
1051
|
) })
|
|
1052
1052
|
] })
|
|
1053
1053
|
] }) }),
|
|
1054
1054
|
/* @__PURE__ */ e(
|
|
1055
|
-
|
|
1055
|
+
k,
|
|
1056
1056
|
{
|
|
1057
1057
|
ariaLabelClose: a.close_aria,
|
|
1058
|
-
isOpen:
|
|
1059
|
-
onClose: () =>
|
|
1058
|
+
isOpen: h,
|
|
1059
|
+
onClose: () => f(!1),
|
|
1060
1060
|
title: n.manage_income,
|
|
1061
|
-
children: /* @__PURE__ */ e(
|
|
1061
|
+
children: /* @__PURE__ */ e(lt, { forOverview: !0 })
|
|
1062
1062
|
}
|
|
1063
1063
|
)
|
|
1064
1064
|
] });
|
|
1065
|
-
}),
|
|
1066
|
-
const i =
|
|
1065
|
+
}), ve = 480, Nn = I(({ onBackClick: t, sx: o }) => {
|
|
1066
|
+
const i = te(), { onEvent: s } = V(), { onLoad: a } = He(), { visibleAccounts: n } = Te(), { budgets: r, common: c } = w(), { isCopyLoaded: g, isInitialized: d, selectedAccounts: u, setDisplayedDate: B, setSelectedAccounts: h } = ae(), {
|
|
1067
1067
|
alert: f,
|
|
1068
|
-
dateRange:
|
|
1069
|
-
isDataLoaded:
|
|
1070
|
-
loadBudgetData:
|
|
1071
|
-
setDateRange:
|
|
1072
|
-
setAlert:
|
|
1073
|
-
setTheme:
|
|
1074
|
-
detailedBudgets:
|
|
1075
|
-
} = D(), { loadRepeatingTransactions:
|
|
1076
|
-
l.useEffect(() => (
|
|
1077
|
-
|
|
1068
|
+
dateRange: p,
|
|
1069
|
+
isDataLoaded: C,
|
|
1070
|
+
loadBudgetData: y,
|
|
1071
|
+
setDateRange: _,
|
|
1072
|
+
setAlert: v,
|
|
1073
|
+
setTheme: A,
|
|
1074
|
+
detailedBudgets: x
|
|
1075
|
+
} = D(), { loadRepeatingTransactions: E, setDateRange: M } = ne(), { reloadCategoryTotals: $ } = z(), { isSmallTablet: U, isMobile: de, isSmallMobile: F } = ce(), H = U || de || F, [$e, ue] = l.useState(!1);
|
|
1076
|
+
l.useEffect(() => (A(i), h(n), _({ start: Q(J()), end: pe(J()) }), s(L.BUDGETS_VIEW), () => {
|
|
1077
|
+
_({ start: Q(J()), end: pe(J()) });
|
|
1078
1078
|
}), []), l.useEffect(() => {
|
|
1079
|
-
|
|
1080
|
-
}, [
|
|
1081
|
-
d && (
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
}, be = () => {
|
|
1088
|
-
de(!0), s(k.BUDGETS_CLICK_ADD);
|
|
1079
|
+
h(n);
|
|
1080
|
+
}, [n]), l.useEffect(() => {
|
|
1081
|
+
d && (B(p.start, p.end), $(u, p.start, p.end).finally(), M(p), C || (E().finally(), y().finally(() => {
|
|
1082
|
+
a?.("BubbleBudgetsWidget");
|
|
1083
|
+
})));
|
|
1084
|
+
}, [d, u, p]);
|
|
1085
|
+
const Ne = (_e) => {
|
|
1086
|
+
_({ start: _e[0] || /* @__PURE__ */ new Date(), end: _e[1] || /* @__PURE__ */ new Date() });
|
|
1089
1087
|
}, Pe = () => {
|
|
1090
|
-
|
|
1091
|
-
},
|
|
1092
|
-
|
|
1093
|
-
|
|
1088
|
+
s(L.BUDGETS_CLICK_FILTER);
|
|
1089
|
+
}, ye = () => {
|
|
1090
|
+
ue(!0), s(L.BUDGETS_CLICK_ADD);
|
|
1091
|
+
}, Ge = () => {
|
|
1092
|
+
ue(!1);
|
|
1093
|
+
}, je = Qe(p.end, Q(/* @__PURE__ */ new Date()));
|
|
1094
|
+
return !g || !d || !C ? /* @__PURE__ */ e(j, {}) : /* @__PURE__ */ m(
|
|
1095
|
+
Ze,
|
|
1094
1096
|
{
|
|
1095
|
-
accountOptions:
|
|
1097
|
+
accountOptions: n,
|
|
1096
1098
|
actions: [
|
|
1097
1099
|
{
|
|
1098
1100
|
iconName: "add",
|
|
1099
|
-
label:
|
|
1100
|
-
onClick:
|
|
1101
|
+
label: r.add_title,
|
|
1102
|
+
onClick: ye
|
|
1101
1103
|
}
|
|
1102
1104
|
],
|
|
1103
1105
|
calendarActions: {
|
|
1104
|
-
onRangeChanged:
|
|
1105
|
-
shouldDisableNext:
|
|
1106
|
+
onRangeChanged: Ne,
|
|
1107
|
+
shouldDisableNext: je,
|
|
1106
1108
|
shouldDisablePicker: !0
|
|
1107
1109
|
},
|
|
1108
|
-
onAccountsFilterClick:
|
|
1110
|
+
onAccountsFilterClick: Pe,
|
|
1109
1111
|
onBackClick: t,
|
|
1110
1112
|
sx: o,
|
|
1111
|
-
title:
|
|
1113
|
+
title: r.budgets_title,
|
|
1112
1114
|
children: [
|
|
1113
|
-
(!d || !
|
|
1114
|
-
d &&
|
|
1115
|
-
|
|
1115
|
+
(!d || !C) && /* @__PURE__ */ e(j, {}),
|
|
1116
|
+
d && C && /* @__PURE__ */ m(
|
|
1117
|
+
S,
|
|
1116
1118
|
{
|
|
1117
|
-
direction:
|
|
1119
|
+
direction: H ? "column" : "row",
|
|
1118
1120
|
height: "100%",
|
|
1119
1121
|
sx: { justifyContent: "center" },
|
|
1120
1122
|
width: "100%",
|
|
1121
1123
|
children: [
|
|
1122
|
-
/* @__PURE__ */ e(
|
|
1123
|
-
|
|
1124
|
+
/* @__PURE__ */ e(S, { height: H ? 450 : "calc(100dvh - 150px)", children: /* @__PURE__ */ e(
|
|
1125
|
+
Le,
|
|
1124
1126
|
{
|
|
1125
|
-
createBudgetOnClick:
|
|
1126
|
-
height:
|
|
1127
|
+
createBudgetOnClick: ye,
|
|
1128
|
+
height: H ? 450 : 800,
|
|
1127
1129
|
isDraggable: !0,
|
|
1128
|
-
shouldShowZeroState:
|
|
1129
|
-
unavailableWidth:
|
|
1130
|
+
shouldShowZeroState: x.length === 0,
|
|
1131
|
+
unavailableWidth: H ? 0 : ve
|
|
1130
1132
|
}
|
|
1131
1133
|
) }),
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
+
x.length !== 0 && /* @__PURE__ */ m(
|
|
1135
|
+
S,
|
|
1134
1136
|
{
|
|
1135
1137
|
gap: 24,
|
|
1136
1138
|
height: "100%",
|
|
1137
1139
|
sx: { mr: 24, mt: 48 },
|
|
1138
|
-
width:
|
|
1140
|
+
width: H ? "100%" : ve,
|
|
1139
1141
|
children: [
|
|
1140
|
-
/* @__PURE__ */ e(
|
|
1141
|
-
/* @__PURE__ */ e(
|
|
1142
|
+
/* @__PURE__ */ e(Gt, {}),
|
|
1143
|
+
/* @__PURE__ */ e(Pt, {})
|
|
1142
1144
|
]
|
|
1143
1145
|
}
|
|
1144
1146
|
)
|
|
1145
1147
|
]
|
|
1146
1148
|
}
|
|
1147
1149
|
),
|
|
1148
|
-
/* @__PURE__ */ e(
|
|
1150
|
+
/* @__PURE__ */ e($t, {}),
|
|
1149
1151
|
/* @__PURE__ */ e(
|
|
1150
|
-
|
|
1152
|
+
k,
|
|
1151
1153
|
{
|
|
1152
|
-
ariaLabelClose:
|
|
1153
|
-
isOpen:
|
|
1154
|
-
onClose: () =>
|
|
1155
|
-
title:
|
|
1156
|
-
children: /* @__PURE__ */ e(
|
|
1154
|
+
ariaLabelClose: c.close_aria,
|
|
1155
|
+
isOpen: $e,
|
|
1156
|
+
onClose: () => ue(!1),
|
|
1157
|
+
title: r.add_new_title,
|
|
1158
|
+
children: /* @__PURE__ */ e(Oe, { onRecalculateBudgets: Ge })
|
|
1157
1159
|
}
|
|
1158
1160
|
),
|
|
1159
1161
|
/* @__PURE__ */ e(
|
|
1160
|
-
|
|
1162
|
+
tt,
|
|
1161
1163
|
{
|
|
1162
1164
|
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
1163
1165
|
autoHideDuration: 3500,
|
|
1164
1166
|
onClose: () => {
|
|
1165
|
-
|
|
1167
|
+
v("");
|
|
1166
1168
|
},
|
|
1167
1169
|
open: !!f,
|
|
1168
1170
|
children: /* @__PURE__ */ e(
|
|
1169
|
-
|
|
1171
|
+
et,
|
|
1170
1172
|
{
|
|
1171
1173
|
onClose: () => {
|
|
1172
|
-
|
|
1174
|
+
v("");
|
|
1173
1175
|
},
|
|
1174
1176
|
severity: "success",
|
|
1175
1177
|
variant: "filled",
|
|
@@ -1183,6 +1185,6 @@ const vt = ({
|
|
|
1183
1185
|
);
|
|
1184
1186
|
});
|
|
1185
1187
|
export {
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
+
$n as BubbleBudgetsMiniWidget,
|
|
1189
|
+
Nn as BubbleBudgetsWidget
|
|
1188
1190
|
};
|