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