@mx-cartographer/experiences 7.0.52-alpha.mega6 → 7.0.52-alpha.mega8

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