@mx-cartographer/experiences 7.2.12 → 7.2.13

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