@mx-cartographer/experiences 7.0.48 → 7.0.49-alpha.mega1

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