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