@mx-cartographer/experiences 7.4.15 → 7.4.17-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,5 +1,5 @@
1
1
  import { jsx as e, jsxs as s, Fragment as H } from "react/jsx-runtime";
2
- import g from "react";
2
+ import x from "react";
3
3
  import { observer as D } from "mobx-react-lite";
4
4
  import w from "@mui/material/Stack";
5
5
  import { useTheme as X, Card as be, Stack as _, Box as G } from "@mui/material";
@@ -20,9 +20,9 @@ import { A as ke, u as Ne } from "../AccountDetailsHeader-BkG3MNYo.mjs";
20
20
  import Fe from "@mui/material/Card";
21
21
  import Re from "@mui/material/CardContent";
22
22
  import Le from "@mui/material/CardHeader";
23
- import { LineChart as $e } from "@mui/x-charts";
24
23
  import re from "@mui/material/Box";
25
- import { useTheme as He } from "@mui/material/styles";
24
+ import { useTheme as $e } from "@mui/material/styles";
25
+ import { LineChart as He } from "@mui/x-charts/LineChart";
26
26
  import { A as T, W as Oe } from "../WidgetContainer-CoFDmQRE.mjs";
27
27
  import de from "@mui/material/Tab";
28
28
  import We from "@mui/material/Tabs";
@@ -46,17 +46,17 @@ import qe from "@mui/material/ListItem";
46
46
  import Ze from "@mui/material/Popover";
47
47
  import { u as Je } from "../useWidgetLoadTimer-hIOioiKx.mjs";
48
48
  import { L as Qe } from "../Loader-DUaFpDGv.mjs";
49
- const et = (a, n = 0, r = 0) => {
49
+ const et = (a, o = 0, r = 0) => {
50
50
  if (r === 0) return 0;
51
- const t = n / (Ee * Ie);
51
+ const t = o / (Ee * Ie);
52
52
  return Math.ceil(
53
53
  t === 0 ? a / r : -Math.log(1 - t * a / r) / Math.log(1 + t)
54
54
  );
55
- }, tt = (a, n, r, t, o) => {
55
+ }, tt = (a, o, r, t, n) => {
56
56
  const i = [];
57
57
  if (r === 0) {
58
58
  for (let c = 0; c < a; c++) {
59
- const d = n - t * (c + 1), m = n - t * c, b = d >= 0 ? t : m;
59
+ const d = o - t * (c + 1), m = o - t * c, b = d >= 0 ? t : m;
60
60
  i.push({
61
61
  balance: d >= 0 ? d : 0,
62
62
  interest: r,
@@ -64,7 +64,7 @@ const et = (a, n = 0, r = 0) => {
64
64
  principal: b,
65
65
  timestamp: ce(
66
66
  le(
67
- se(o),
67
+ se(n),
68
68
  // convert seconds → Date
69
69
  c + 1
70
70
  // add (index + 1) months
@@ -76,7 +76,7 @@ const et = (a, n = 0, r = 0) => {
76
76
  }
77
77
  const p = r / 1200;
78
78
  for (let c = 0; c < a; c++) {
79
- const d = ce(le(se(o), c + 1)), m = Math.pow(1 + p, c), b = n * m - t * ((m - 1) / p), f = Math.pow(1 + p, c + 1), u = n * f - t * ((f - 1) / p), v = t + Math.min(u, 0), M = b * p;
79
+ const d = ce(le(se(n), c + 1)), m = Math.pow(1 + p, c), b = o * m - t * ((m - 1) / p), f = Math.pow(1 + p, c + 1), u = o * f - t * ((f - 1) / p), v = t + Math.min(u, 0), M = b * p;
80
80
  i.push({
81
81
  balance: Math.max(0, u),
82
82
  interest: M,
@@ -87,47 +87,47 @@ const et = (a, n = 0, r = 0) => {
87
87
  }
88
88
  return i;
89
89
  }, rt = (a) => (a[a.length - 1] || {}).timestamp, at = (a) => {
90
- const { monthly_payment: n, interest_rate: r, balance: t, payment_due_date: o } = a, i = et(t, r ?? 0, n ?? 0), p = tt(
90
+ const { monthly_payment: o, interest_rate: r, balance: t, payment_due_date: n } = a, i = et(t, r ?? 0, o ?? 0), p = tt(
91
91
  i,
92
92
  t,
93
93
  r ?? 0,
94
- n ?? 0,
95
- o
94
+ o ?? 0,
95
+ n
96
96
  ), c = rt(p);
97
97
  return {
98
98
  ...a,
99
99
  minimumFinalPayment: c,
100
100
  minimumPayments: p
101
101
  };
102
- }, xe = (a, n) => {
102
+ }, ge = (a, o) => {
103
103
  const [r, t] = a.reduce(
104
- ([o, i], p) => (p.is_paid_off || p.is_impossible ? i.push({ ...p, minimumPayments: [] }) : o.push(at(p)), [o, i]),
104
+ ([n, i], p) => (p.is_paid_off || p.is_impossible ? i.push({ ...p, minimumPayments: [] }) : n.push(at(p)), [n, i]),
105
105
  [[], []]
106
106
  );
107
- switch (n) {
107
+ switch (o) {
108
108
  case P.FASTEST_PAYOFF_FIRST:
109
- r.sort((o, i) => (o.minimumFinalPayment ?? 0) - (i.minimumFinalPayment ?? 0));
109
+ r.sort((n, i) => (n.minimumFinalPayment ?? 0) - (i.minimumFinalPayment ?? 0));
110
110
  break;
111
111
  case P.HIGHEST_INTEREST:
112
- r.sort((o, i) => (i.interest_rate ?? 0) - (o.interest_rate ?? 0));
112
+ r.sort((n, i) => (i.interest_rate ?? 0) - (n.interest_rate ?? 0));
113
113
  break;
114
114
  case P.LOWEST_BALANCE:
115
- r.sort((o, i) => o.balance - i.balance);
115
+ r.sort((n, i) => n.balance - i.balance);
116
116
  break;
117
117
  case P.HIGHEST_BALANCE:
118
- r.sort((o, i) => i.balance - o.balance);
118
+ r.sort((n, i) => i.balance - n.balance);
119
119
  break;
120
120
  default:
121
- r.sort((o, i) => o.balance - i.balance);
121
+ r.sort((n, i) => n.balance - i.balance);
122
122
  }
123
123
  a.splice(0, a.length, ...r, ...t);
124
124
  };
125
- function nt(a, n, r = 0) {
125
+ function ot(a, o, r = 0) {
126
126
  const t = a.map((b) => ({ ...b })).filter(
127
127
  (b) => b.interest_rate !== void 0 && b.monthly_payment !== void 0 && !b.is_paid_off
128
128
  );
129
- xe(t, n);
130
- let o = 0, i = 0;
129
+ ge(t, o);
130
+ let n = 0, i = 0;
131
131
  const p = /* @__PURE__ */ new Date(), c = /* @__PURE__ */ new Date();
132
132
  for (; t.some((b) => b.balance >= 0.01 && !b.is_impossible); ) {
133
133
  let b = !1;
@@ -141,32 +141,32 @@ function nt(a, n, r = 0) {
141
141
  u.is_impossible = !0;
142
142
  continue;
143
143
  }
144
- u.balance -= B, u.balance = u.balance < 0.01 ? 0 : u.balance, o += I, u.balance <= 0 && (i += C), B > 0 && (b = !0);
144
+ u.balance -= B, u.balance = u.balance < 0.01 ? 0 : u.balance, n += I, u.balance <= 0 && (i += C), B > 0 && (b = !0);
145
145
  }
146
146
  b && c.setMonth(c.getMonth() + 1);
147
147
  }
148
148
  const d = t.some((b) => b.is_impossible && b.balance > 0), m = Te({ start: p, end: c });
149
149
  return {
150
- payoffSavings: d ? "N/A" : k(o, "0,0.00"),
150
+ payoffSavings: d ? "N/A" : k(n, "0,0.00"),
151
151
  payoffDate: d ? "Never" : K(c, U.MONTH_YEAR),
152
152
  payoffDuration: d ? "Stagnant" : Ae(m, { format: ["years", "months"] }) || "0 months"
153
153
  };
154
154
  }
155
155
  const $ = () => {
156
- if (!g.useContext(Me))
156
+ if (!x.useContext(Me))
157
157
  throw new Error("useCateUiStore() must be used within the GlobalDataContext");
158
158
  return q().uiStore;
159
- }, ot = ({ debts: a, onClickCta: n, sx: r }) => {
160
- const t = X(), { isMobile: o } = Y(), { debts: i } = S(), { selectedDebtPriority: p } = $(), { monthlyCashFlowProfile: c } = V(), { payoffDate: d, payoffSavings: m, payoffDuration: b } = g.useMemo(() => {
159
+ }, nt = ({ debts: a, onClickCta: o, sx: r }) => {
160
+ const t = X(), { isMobile: n } = Y(), { debts: i } = S(), { selectedDebtPriority: p } = $(), { monthlyCashFlowProfile: c } = V(), { payoffDate: d, payoffSavings: m, payoffDuration: b } = x.useMemo(() => {
161
161
  const f = c?.extra_payment ?? 0;
162
- return nt(a, p, f);
162
+ return ot(a, p, f);
163
163
  }, [a, p, c]);
164
164
  return /* @__PURE__ */ e(
165
165
  be,
166
166
  {
167
167
  sx: {
168
168
  boxShadow: t.shadows[2],
169
- width: o ? "100%" : "186px",
169
+ width: n ? "100%" : "186px",
170
170
  minWidth: "186px",
171
171
  ...r
172
172
  },
@@ -174,7 +174,7 @@ const $ = () => {
174
174
  /* @__PURE__ */ s(
175
175
  _,
176
176
  {
177
- gap: o ? "4px" : "0",
177
+ gap: n ? "4px" : "0",
178
178
  sx: {
179
179
  borderBottom: "1px solid",
180
180
  borderBottomColor: t.palette.grey[300],
@@ -186,11 +186,11 @@ const $ = () => {
186
186
  ]
187
187
  }
188
188
  ),
189
- /* @__PURE__ */ s(_, { gap: o ? "4px" : "0", children: [
189
+ /* @__PURE__ */ s(_, { gap: n ? "4px" : "0", children: [
190
190
  /* @__PURE__ */ e(l, { bold: !0, variant: "Small", children: m }),
191
191
  /* @__PURE__ */ e(l, { sx: { whiteSpace: "normal" }, variant: "XSmall", children: i.snowball_card_amount_description })
192
192
  ] }),
193
- /* @__PURE__ */ s(_, { gap: o ? "4px" : "0", children: [
193
+ /* @__PURE__ */ s(_, { gap: n ? "4px" : "0", children: [
194
194
  /* @__PURE__ */ e(l, { bold: !0, variant: "Small", children: b }),
195
195
  /* @__PURE__ */ e(l, { variant: "XSmall", children: i.snowball_card_duration_description })
196
196
  ] }),
@@ -199,7 +199,7 @@ const $ = () => {
199
199
  {
200
200
  bold: !0,
201
201
  color: t.palette.primary.main,
202
- onClick: n,
202
+ onClick: o,
203
203
  sx: { cursor: "pointer" },
204
204
  variant: "Small",
205
205
  children: i.snowball_card_cta
@@ -208,14 +208,14 @@ const $ = () => {
208
208
  ] })
209
209
  }
210
210
  );
211
- }, it = D(ot), lt = ({ isOpen: a, onClose: n }) => {
212
- const r = X(), { debts: t } = S(), [o, i] = g.useState(!1);
211
+ }, it = D(nt), lt = ({ isOpen: a, onClose: o }) => {
212
+ const r = X(), { debts: t } = S(), [n, i] = x.useState(!1);
213
213
  return /* @__PURE__ */ e(
214
214
  te,
215
215
  {
216
216
  ariaLabelClose: "",
217
217
  isOpen: a,
218
- onClose: n,
218
+ onClose: o,
219
219
  title: t.snowball_drawer_title,
220
220
  children: /* @__PURE__ */ s(_, { bgcolor: r.palette.background.default, height: "100%", children: [
221
221
  /* @__PURE__ */ s(_, { alignItems: "center", px: 24, py: 24, children: [
@@ -232,7 +232,7 @@ const $ = () => {
232
232
  {
233
233
  color: r.palette.secondary.main,
234
234
  mb: 8,
235
- sx: { whiteSpace: o ? "normal" : "nowrap" },
235
+ sx: { whiteSpace: n ? "normal" : "nowrap" },
236
236
  variant: "ParagraphSmall",
237
237
  children: t.snowball_drawer_answer
238
238
  }
@@ -242,10 +242,10 @@ const $ = () => {
242
242
  {
243
243
  bold: !0,
244
244
  color: r.palette.primary.main,
245
- onClick: () => i(!o),
245
+ onClick: () => i(!n),
246
246
  sx: { cursor: "pointer" },
247
247
  variant: "Small",
248
- children: o ? t.snowball_drawer_less : t.snowball_drawer_more
248
+ children: n ? t.snowball_drawer_less : t.snowball_drawer_more
249
249
  }
250
250
  )
251
251
  ] })
@@ -570,45 +570,45 @@ const $ = () => {
570
570
  }
571
571
  );
572
572
  }, st = D(lt), ct = "#FF7B08";
573
- function dt(a, n) {
574
- const [r, t, o] = a.replace(/^#/, "").match(/.{1,2}/g).map((p) => parseInt(p, 16)), i = [
575
- Math.max(0, Math.min(255, Math.round(r * n))),
576
- Math.max(0, Math.min(255, Math.round(t * n))),
577
- Math.max(0, Math.min(255, Math.round(o * n)))
573
+ function dt(a, o) {
574
+ const [r, t, n] = a.replace(/^#/, "").match(/.{1,2}/g).map((p) => parseInt(p, 16)), i = [
575
+ Math.max(0, Math.min(255, Math.round(r * o))),
576
+ Math.max(0, Math.min(255, Math.round(t * o))),
577
+ Math.max(0, Math.min(255, Math.round(n * o)))
578
578
  ];
579
579
  return `rgb(${i[0]}, ${i[1]}, ${i[2]})`;
580
580
  }
581
- const ge = ({
581
+ const xe = ({
582
582
  sx: a,
583
- height: n = 500,
583
+ height: o = 500,
584
584
  width: r,
585
585
  debts: t,
586
- hoveredDebtGuid: o,
586
+ hoveredDebtGuid: n,
587
587
  onClickArea: i,
588
588
  onHoverArea: p
589
589
  }) => {
590
- const c = He(), { onEvent: d } = F(), m = t.filter((h) => !h.is_impossible), b = [
590
+ const c = $e(), { onEvent: d } = F(), m = t.filter((h) => !h.is_impossible), b = [
591
591
  ...new Set(
592
- m.flatMap((h) => h.dataset.map((x) => new Date(x.x).getTime()))
592
+ m.flatMap((h) => h.dataset.map((g) => new Date(g.x).getTime()))
593
593
  )
594
- ].sort((h, x) => h - x).map((h) => new Date(h)), f = m.map((h) => {
595
- const x = new Map(h.dataset.map((L) => [new Date(L.x).getTime(), L.y]));
596
- let A = x.get(b[0].getTime()) ?? 0;
594
+ ].sort((h, g) => h - g).map((h) => new Date(h)), f = m.map((h) => {
595
+ const g = new Map(h.dataset.map((L) => [new Date(L.x).getTime(), L.y]));
596
+ let A = g.get(b[0].getTime()) ?? 0;
597
597
  const R = b.map((L) => {
598
- const O = x.get(L.getTime()) ?? A;
598
+ const O = g.get(L.getTime()) ?? A;
599
599
  return A = O, { x: L, y: O };
600
600
  });
601
601
  return { ...h, dataset: R };
602
602
  }), u = f.reduce(
603
- (h, x) => h + (x.dataset[0]?.y ?? 0),
603
+ (h, g) => h + (g.dataset[0]?.y ?? 0),
604
604
  0
605
- ), v = b.map((h, x) => {
606
- const A = x / (b.length - 1), R = u * (1 - A);
605
+ ), v = b.map((h, g) => {
606
+ const A = g / (b.length - 1), R = u * (1 - A);
607
607
  return { x: h, y: R };
608
- }), M = Math.ceil(u / 100) * 100, I = b, C = f.map((h, x) => {
609
- const A = 1 - x / f.length * 0.5, R = dt(ct, A);
608
+ }), M = Math.ceil(u / 100) * 100, I = b, C = f.map((h, g) => {
609
+ const A = 1 - g / f.length * 0.5, R = dt(ct, A);
610
610
  return {
611
- id: `debt-${x}`,
611
+ id: `debt-${g}`,
612
612
  guid: h.guid,
613
613
  label: h.name,
614
614
  data: h.dataset.map((L) => L.y),
@@ -631,7 +631,7 @@ const ge = ({
631
631
  showMark: !1,
632
632
  disableHighlight: !0
633
633
  });
634
- const B = (h) => C.findIndex((x) => x?.guid === h);
634
+ const B = (h) => C.findIndex((g) => g?.guid === h);
635
635
  return /* @__PURE__ */ e(
636
636
  re,
637
637
  {
@@ -648,27 +648,25 @@ const ge = ({
648
648
  }
649
649
  },
650
650
  children: /* @__PURE__ */ e(
651
- $e,
651
+ He,
652
652
  {
653
653
  axisHighlight: { x: "none" },
654
654
  disableLineItemHighlight: !0,
655
- height: n,
656
- onAreaClick: (h, x) => {
655
+ height: o,
656
+ hideLegend: !0,
657
+ margin: { bottom: 24, left: 32, right: 72, top: 48 },
658
+ onAreaClick: (h, g) => {
657
659
  i?.();
658
- const A = C.find((R) => R.id === x.seriesId);
660
+ const A = C.find((R) => R.id === g.seriesId);
659
661
  d(T.DEBTS_CLICK_CHART_AREA, { account_guid: A?.guid });
660
662
  },
661
663
  onHighlightChange: (h) => {
662
- const x = C.find((A) => A.id === h?.seriesId)?.guid;
663
- p?.(x ?? "");
664
+ const g = C.find((A) => A.id === h?.seriesId)?.guid;
665
+ p?.(g ?? "");
664
666
  },
665
667
  series: C,
666
668
  skipAnimation: !0,
667
- slotProps: {
668
- legend: {
669
- hidden: !0
670
- }
671
- },
669
+ slotProps: { tooltip: { trigger: "none" } },
672
670
  sx: {
673
671
  p: 4,
674
672
  "& .MuiBarLabel-root": {
@@ -686,10 +684,10 @@ const ge = ({
686
684
  strokeDasharray: "10 5",
687
685
  strokeWidth: 1
688
686
  },
689
- [`& .MuiLineElement-series-debt-${B(o ?? "0")}`]: {
687
+ [`& .MuiLineElement-series-debt-${B(n ?? "0")}`]: {
690
688
  opacity: 1
691
689
  },
692
- [`& .MuiAreaElement-series-debt-${B(o ?? "0")}`]: {
690
+ [`& .MuiAreaElement-series-debt-${B(n ?? "0")}`]: {
693
691
  opacity: 1
694
692
  },
695
693
  "& .MuiChartsAxis-tickLabel > tspan": {
@@ -697,7 +695,6 @@ const ge = ({
697
695
  },
698
696
  ...a
699
697
  },
700
- tooltip: { trigger: "none" },
701
698
  width: r,
702
699
  xAxis: [
703
700
  {
@@ -721,7 +718,7 @@ const ge = ({
721
718
  }
722
719
  );
723
720
  }, pt = () => {
724
- const a = X(), { debts: n } = S(), { selectedDebtChartData: r } = $();
721
+ const a = X(), { debts: o } = S(), { selectedDebtChartData: r } = $();
725
722
  return /* @__PURE__ */ s(H, { children: [
726
723
  /* @__PURE__ */ s(
727
724
  Fe,
@@ -732,8 +729,8 @@ const ge = ({
732
729
  }
733
730
  },
734
731
  children: [
735
- /* @__PURE__ */ e(Le, { sx: { pb: 0 }, title: /* @__PURE__ */ e(ve, { sx: { pb: 4 }, children: n.details_chart_title }) }),
736
- /* @__PURE__ */ e(Re, { sx: { p: 0 }, children: /* @__PURE__ */ e(ge, { debts: [r], height: 250 }) })
732
+ /* @__PURE__ */ e(Le, { sx: { pb: 0 }, title: /* @__PURE__ */ e(ve, { sx: { pb: 4 }, children: o.details_chart_title }) }),
733
+ /* @__PURE__ */ e(Re, { sx: { p: 0 }, children: /* @__PURE__ */ e(xe, { debts: [r], height: 250 }) })
737
734
  ]
738
735
  }
739
736
  ),
@@ -743,13 +740,13 @@ const ge = ({
743
740
  color: a.palette.text.secondary,
744
741
  sx: { whiteSpace: "normal", textAlign: "center", px: 8, py: 12 },
745
742
  variant: "Small",
746
- children: n.details_chart_description
743
+ children: o.details_chart_description
747
744
  }
748
745
  )
749
746
  ] });
750
747
  }, mt = D(pt), ht = () => {
751
- const a = X(), { onEvent: n } = F(), { debts: r } = S(), { selectedDebtChartData: t, showCompleted: o, showError: i } = $();
752
- return g.useEffect(() => n(T.DEBT_SCHEDULE_VIEW), []), /* @__PURE__ */ e(_e, { children: i || o ? /* @__PURE__ */ e(
748
+ const a = X(), { onEvent: o } = F(), { debts: r } = S(), { selectedDebtChartData: t, showCompleted: n, showError: i } = $();
749
+ return x.useEffect(() => o(T.DEBT_SCHEDULE_VIEW), []), /* @__PURE__ */ e(_e, { children: i || n ? /* @__PURE__ */ e(
753
750
  l,
754
751
  {
755
752
  color: a.palette.secondary.main,
@@ -812,8 +809,8 @@ const ge = ({
812
809
  ) })
813
810
  ] }) });
814
811
  }, ut = D(ht), bt = D(({ debt: a }) => {
815
- const { debts: n } = S(), { updateAccount: r } = Z(), { onEvent: t } = F(), [o, i] = g.useState(a.interest_rate ?? 0), p = o < 0, c = async () => {
816
- await r({ ...a.account, interest_rate: o }), a.interest_rate = o, t(T.DEBTS_SAVE_RATE_ACTION, { account_guid: a.guid });
812
+ const { debts: o } = S(), { updateAccount: r } = Z(), { onEvent: t } = F(), [n, i] = x.useState(a.interest_rate ?? 0), p = n < 0, c = async () => {
813
+ await r({ ...a.account, interest_rate: n }), a.interest_rate = n, t(T.DEBTS_SAVE_RATE_ACTION, { account_guid: a.guid });
817
814
  }, d = () => {
818
815
  setTimeout(() => {
819
816
  i(a.interest_rate ?? 0);
@@ -823,12 +820,12 @@ const ge = ({
823
820
  J,
824
821
  {
825
822
  isSaveDisabled: p,
826
- label: `${n.details_interest_rate} (%)`,
823
+ label: `${o.details_interest_rate} (%)`,
827
824
  onCancel: d,
828
825
  onSave: c,
829
- primaryText: n.details_interest_rate,
826
+ primaryText: o.details_interest_rate,
830
827
  secondaryText: Be(Number(a.interest_rate) / 100),
831
- zeroStateText: a.interest_rate ? void 0 : n.add_interest_rate,
828
+ zeroStateText: a.interest_rate ? void 0 : o.add_interest_rate,
832
829
  children: /* @__PURE__ */ e(
833
830
  Xe,
834
831
  {
@@ -836,14 +833,14 @@ const ge = ({
836
833
  fullWidth: !0,
837
834
  onChange: (m) => i(isNaN(parseFloat(m.target.value)) ? 0 : parseFloat(m.target.value)),
838
835
  type: "number",
839
- value: o
836
+ value: n
840
837
  }
841
838
  )
842
839
  }
843
840
  );
844
841
  }), _t = D(({ debt: a }) => {
845
- const { debts: n } = S(), { updateAccount: r } = Z(), { onEvent: t } = F(), [o, i] = g.useState(a.monthly_payment ?? 0), p = o < 0 || o > 9999999999e-2, c = async () => {
846
- await r({ ...a.account, minimum_payment: o }), a.monthly_payment = o, t(T.DEBTS_SAVE_PAYMENT_ACTION, { account_guid: a.guid });
842
+ const { debts: o } = S(), { updateAccount: r } = Z(), { onEvent: t } = F(), [n, i] = x.useState(a.monthly_payment ?? 0), p = n < 0 || n > 9999999999e-2, c = async () => {
843
+ await r({ ...a.account, minimum_payment: n }), a.monthly_payment = n, t(T.DEBTS_SAVE_PAYMENT_ACTION, { account_guid: a.guid });
847
844
  }, d = () => {
848
845
  setTimeout(() => {
849
846
  i(a.monthly_payment ?? 0);
@@ -853,29 +850,29 @@ const ge = ({
853
850
  J,
854
851
  {
855
852
  isSaveDisabled: p,
856
- label: n.details_monthly_payment,
853
+ label: o.details_monthly_payment,
857
854
  onCancel: d,
858
855
  onSave: c,
859
- primaryText: n.details_monthly_payment,
856
+ primaryText: o.details_monthly_payment,
860
857
  secondaryText: k(a.monthly_payment, "0,0"),
861
- zeroStateText: a.monthly_payment ? void 0 : n.add_monthly_payment,
858
+ zeroStateText: a.monthly_payment ? void 0 : o.add_monthly_payment,
862
859
  children: /* @__PURE__ */ e(
863
860
  ae,
864
861
  {
865
- amount: o,
862
+ amount: n,
866
863
  autoFocus: !0,
867
864
  error: p,
868
865
  fullWidth: !0,
869
866
  minAmount: 0,
870
- setAmount: (m) => i(isNaN(Number(m)) ? o : Number(m)),
867
+ setAmount: (m) => i(isNaN(Number(m)) ? n : Number(m)),
871
868
  sx: { ".MuiTypography-Body": { p: 0 } }
872
869
  }
873
870
  )
874
871
  }
875
872
  );
876
873
  }), yt = D(({ debt: a }) => {
877
- const { debts: n } = S(), { updateAccount: r } = Z(), { onEvent: t } = F(), [o, i] = g.useState(a.original_balance ?? 0), p = o < 0 || o > 9999999999e-2, c = async () => {
878
- await r({ ...a.account, original_balance: o }), a.original_balance = o, t(T.DEBTS_SAVE_BALANCE_ACTION, { account_guid: a.guid });
874
+ const { debts: o } = S(), { updateAccount: r } = Z(), { onEvent: t } = F(), [n, i] = x.useState(a.original_balance ?? 0), p = n < 0 || n > 9999999999e-2, c = async () => {
875
+ await r({ ...a.account, original_balance: n }), a.original_balance = n, t(T.DEBTS_SAVE_BALANCE_ACTION, { account_guid: a.guid });
879
876
  }, d = () => {
880
877
  setTimeout(() => {
881
878
  i(a.original_balance ?? 0);
@@ -885,52 +882,52 @@ const ge = ({
885
882
  J,
886
883
  {
887
884
  isSaveDisabled: p,
888
- label: n.details_original_balance,
885
+ label: o.details_original_balance,
889
886
  onCancel: d,
890
887
  onSave: c,
891
- primaryText: n.details_original_balance,
888
+ primaryText: o.details_original_balance,
892
889
  secondaryText: k(a.original_balance, "0,0"),
893
- zeroStateText: a.original_balance ? void 0 : n.add_original_balance,
890
+ zeroStateText: a.original_balance ? void 0 : o.add_original_balance,
894
891
  children: /* @__PURE__ */ e(
895
892
  ae,
896
893
  {
897
- amount: o,
894
+ amount: n,
898
895
  autoFocus: !0,
899
896
  error: p,
900
897
  fullWidth: !0,
901
898
  minAmount: 0,
902
- setAmount: (m) => i(isNaN(Number(m)) ? o : Number(m)),
899
+ setAmount: (m) => i(isNaN(Number(m)) ? n : Number(m)),
903
900
  sx: { ".MuiTypography-Body": { p: 0 } }
904
901
  }
905
902
  )
906
903
  }
907
904
  );
908
905
  }), ft = () => {
909
- const { onEvent: a } = F(), { selectedDebtChartData: n } = $();
910
- return g.useEffect(() => a(T.DEBT_DETAILS_VIEW), []), /* @__PURE__ */ s(w, { bgcolor: "background.paper", children: [
911
- n?.goal && /* @__PURE__ */ s(H, { children: [
912
- /* @__PURE__ */ e(Ge, { goal: n.goal }),
906
+ const { onEvent: a } = F(), { selectedDebtChartData: o } = $();
907
+ return x.useEffect(() => a(T.DEBT_DETAILS_VIEW), []), /* @__PURE__ */ s(w, { bgcolor: "background.paper", children: [
908
+ o?.goal && /* @__PURE__ */ s(H, { children: [
909
+ /* @__PURE__ */ e(Ge, { goal: o.goal }),
913
910
  /* @__PURE__ */ e(j, {}),
914
- /* @__PURE__ */ e(je, { goal: n.goal }),
911
+ /* @__PURE__ */ e(je, { goal: o.goal }),
915
912
  /* @__PURE__ */ e(j, {}),
916
- /* @__PURE__ */ e(ze, { goal: n.goal }),
913
+ /* @__PURE__ */ e(ze, { goal: o.goal }),
917
914
  /* @__PURE__ */ e(j, {})
918
915
  ] }),
919
- !n?.goal && n?.account && /* @__PURE__ */ s(H, { children: [
920
- /* @__PURE__ */ e(_t, { debt: n }),
916
+ !o?.goal && o?.account && /* @__PURE__ */ s(H, { children: [
917
+ /* @__PURE__ */ e(_t, { debt: o }),
921
918
  /* @__PURE__ */ e(j, {}),
922
- /* @__PURE__ */ e(bt, { debt: n }),
919
+ /* @__PURE__ */ e(bt, { debt: o }),
923
920
  /* @__PURE__ */ e(j, {}),
924
- /* @__PURE__ */ e(yt, { debt: n }),
921
+ /* @__PURE__ */ e(yt, { debt: o }),
925
922
  /* @__PURE__ */ e(j, {})
926
923
  ] })
927
924
  ] });
928
- }, xt = D(ft), gt = ({ setTabValue: a, sx: n }) => {
929
- const { debts: r } = S(), { showError: t, showCompleted: o } = $();
930
- return g.useEffect(() => {
925
+ }, gt = D(ft), xt = ({ setTabValue: a, sx: o }) => {
926
+ const { debts: r } = S(), { showError: t, showCompleted: n } = $();
927
+ return x.useEffect(() => {
931
928
  t && a(1);
932
- }, [t]), !t && !o ? /* @__PURE__ */ e(H, {}) : /* @__PURE__ */ s(w, { gap: 16, children: [
933
- /* @__PURE__ */ e(he, { sx: { my: 16, mx: 24, ...n }, children: /* @__PURE__ */ s(
929
+ }, [t]), !t && !n ? /* @__PURE__ */ e(H, {}) : /* @__PURE__ */ s(w, { gap: 16, children: [
930
+ /* @__PURE__ */ e(he, { sx: { my: 16, mx: 24, ...o }, children: /* @__PURE__ */ s(
934
931
  pe,
935
932
  {
936
933
  icon: t ? /* @__PURE__ */ e(Ve, { filled: !0 }) : /* @__PURE__ */ e(ye, { color: "success", filled: !0 }),
@@ -951,7 +948,7 @@ const ge = ({
951
948
  ]
952
949
  }
953
950
  ) }),
954
- t && /* @__PURE__ */ e(he, { sx: { mb: 16, mt: 100, mx: 24, ...n }, children: /* @__PURE__ */ s(
951
+ t && /* @__PURE__ */ e(he, { sx: { mb: 16, mt: 100, mx: 24, ...o }, children: /* @__PURE__ */ s(
955
952
  pe,
956
953
  {
957
954
  icon: /* @__PURE__ */ e(H, {}),
@@ -970,16 +967,16 @@ const ge = ({
970
967
  }
971
968
  ) })
972
969
  ] });
973
- }, wt = D(gt), Ct = () => {
974
- const { debts: a } = S(), { showError: n, showCompleted: r } = $(), [t, o] = g.useState(0);
970
+ }, wt = D(xt), Ct = () => {
971
+ const { debts: a } = S(), { showError: o, showCompleted: r } = $(), [t, n] = x.useState(0);
975
972
  return /* @__PURE__ */ s(H, { children: [
976
- (n || r) && /* @__PURE__ */ e(wt, { setTabValue: o, sx: { mt: -24 } }),
973
+ (o || r) && /* @__PURE__ */ e(wt, { setTabValue: n, sx: { mt: -24 } }),
977
974
  /* @__PURE__ */ s(
978
975
  We,
979
976
  {
980
977
  "aria-label": a.details_tabs_aria_label,
981
978
  centered: !0,
982
- onChange: (i, p) => o(p),
979
+ onChange: (i, p) => n(p),
983
980
  textColor: "primary",
984
981
  value: t,
985
982
  variant: "fullWidth",
@@ -1004,16 +1001,16 @@ const ge = ({
1004
1001
  }
1005
1002
  ),
1006
1003
  /* @__PURE__ */ e(ue, { index: 0, name: "debt-schedule", value: t, children: /* @__PURE__ */ e(ut, {}) }),
1007
- /* @__PURE__ */ e(ue, { index: 1, name: "debt-details", value: t, children: /* @__PURE__ */ e(xt, {}) })
1004
+ /* @__PURE__ */ e(ue, { index: 1, name: "debt-details", value: t, children: /* @__PURE__ */ e(gt, {}) })
1008
1005
  ] });
1009
- }, St = D(Ct), vt = ({ isOpen: a, onClose: n }) => {
1010
- const { debts: r } = S(), { showError: t, showCompleted: o } = $(), i = t || o ? /* @__PURE__ */ e(H, {}) : /* @__PURE__ */ e(mt, {});
1006
+ }, St = D(Ct), vt = ({ isOpen: a, onClose: o }) => {
1007
+ const { debts: r } = S(), { showError: t, showCompleted: n } = $(), i = t || n ? /* @__PURE__ */ e(H, {}) : /* @__PURE__ */ e(mt, {});
1011
1008
  return /* @__PURE__ */ e(
1012
1009
  te,
1013
1010
  {
1014
1011
  ariaLabelClose: r.details_close_aria,
1015
1012
  isOpen: a,
1016
- onClose: n,
1013
+ onClose: o,
1017
1014
  title: r.details_title,
1018
1015
  children: /* @__PURE__ */ s(w, { bgcolor: "background.default", children: [
1019
1016
  /* @__PURE__ */ e(ke, { customDetailsChart: i }),
@@ -1022,13 +1019,13 @@ const ge = ({
1022
1019
  }
1023
1020
  );
1024
1021
  }, Dt = D(() => {
1025
- const { debts: a } = S(), { monthlyCashFlowProfile: n, updateMonthlyCashFlowProfile: r } = V(), { onEvent: t } = F(), [o, i] = g.useState(n?.extra_payment ?? 0), p = o < 0 || o > 9999999999e-2, c = async () => {
1026
- n && (await r({ ...n, extra_payment: o }), n.extra_payment = o, t(T.DEBTS_SAVE_PAYDOWN_ACTION, {
1027
- user_guid: n?.user_guid
1022
+ const { debts: a } = S(), { monthlyCashFlowProfile: o, updateMonthlyCashFlowProfile: r } = V(), { onEvent: t } = F(), [n, i] = x.useState(o?.extra_payment ?? 0), p = n < 0 || n > 9999999999e-2, c = async () => {
1023
+ o && (await r({ ...o, extra_payment: n }), o.extra_payment = n, t(T.DEBTS_SAVE_PAYDOWN_ACTION, {
1024
+ user_guid: o?.user_guid
1028
1025
  }));
1029
1026
  }, d = () => {
1030
1027
  setTimeout(() => {
1031
- i(n?.extra_payment ?? 0);
1028
+ i(o?.extra_payment ?? 0);
1032
1029
  }, 250);
1033
1030
  };
1034
1031
  return /* @__PURE__ */ e(
@@ -1039,29 +1036,29 @@ const ge = ({
1039
1036
  onCancel: d,
1040
1037
  onSave: c,
1041
1038
  primaryText: a.paydown_drawer_extra_payment,
1042
- secondaryText: k(n?.extra_payment, "0,0"),
1043
- zeroStateText: n?.extra_payment ? void 0 : a.add_extra_payment,
1039
+ secondaryText: k(o?.extra_payment, "0,0"),
1040
+ zeroStateText: o?.extra_payment ? void 0 : a.add_extra_payment,
1044
1041
  children: /* @__PURE__ */ e(
1045
1042
  ae,
1046
1043
  {
1047
- amount: o,
1044
+ amount: n,
1048
1045
  autoFocus: !0,
1049
1046
  error: p,
1050
1047
  fullWidth: !0,
1051
1048
  minAmount: 0,
1052
- setAmount: (m) => i(isNaN(Number(m)) ? o : Number(m)),
1049
+ setAmount: (m) => i(isNaN(Number(m)) ? n : Number(m)),
1053
1050
  sx: { ".MuiTypography-Body": { p: 0 } }
1054
1051
  }
1055
1052
  )
1056
1053
  }
1057
1054
  );
1058
1055
  }), Tt = () => {
1059
- const { debts: a } = S(), { totalMonthlyPayments: n } = q(), { monthlyCashFlowProfile: r } = V(), t = n + Number(r?.extra_payment);
1056
+ const { debts: a } = S(), { totalMonthlyPayments: o } = q(), { monthlyCashFlowProfile: r } = V(), t = o + Number(r?.extra_payment);
1060
1057
  return /* @__PURE__ */ s(w, { sx: { backgroundColor: "background.default", height: "100%" }, children: [
1061
1058
  /* @__PURE__ */ s(w, { p: 24, children: [
1062
1059
  /* @__PURE__ */ s(w, { alignItems: "center", gap: 4, mb: 24, children: [
1063
1060
  /* @__PURE__ */ e(l, { variant: "Body", children: a.paydown_drawer_mimimum_label }),
1064
- /* @__PURE__ */ e(l, { bold: !0, variant: "H1", children: k(n, "0,0") }),
1061
+ /* @__PURE__ */ e(l, { bold: !0, variant: "H1", children: k(o, "0,0") }),
1065
1062
  /* @__PURE__ */ e(l, { textAlign: "center", truncate: !1, variant: "Small", width: 208, children: a.paydown_drawer_minimum_info })
1066
1063
  ] }),
1067
1064
  /* @__PURE__ */ s(w, { children: [
@@ -1075,38 +1072,38 @@ const ge = ({
1075
1072
  /* @__PURE__ */ e(l, { bold: !0, textAlign: "right", variant: "Body", children: k(t, "0,0") })
1076
1073
  ] }) })
1077
1074
  ] });
1078
- }, At = D(Tt), Et = ({ isOpen: a, onClose: n }) => {
1075
+ }, At = D(Tt), Et = ({ isOpen: a, onClose: o }) => {
1079
1076
  const { debts: r } = S();
1080
1077
  return /* @__PURE__ */ e(
1081
1078
  te,
1082
1079
  {
1083
1080
  ariaLabelClose: r.paydown_drawer_close_aria,
1084
1081
  isOpen: a,
1085
- onClose: n,
1082
+ onClose: o,
1086
1083
  title: r.paydown_drawer_title,
1087
1084
  children: /* @__PURE__ */ e(At, {})
1088
1085
  }
1089
1086
  );
1090
1087
  };
1091
- function It(a, n) {
1088
+ function It(a, o) {
1092
1089
  const r = (t) => {
1093
1090
  if (typeof t == "number") return t;
1094
1091
  if (t === "!" || t === "✓") return 1 / 0;
1095
1092
  throw new Error("Unsupported value");
1096
1093
  };
1097
- return r(a) - r(n);
1094
+ return r(a) - r(o);
1098
1095
  }
1099
1096
  function Bt(a) {
1100
1097
  return a.is_paid_off ? "✓" : a.priority === void 0 || a.is_impossible ? "!" : a.priority;
1101
1098
  }
1102
1099
  const Mt = (a) => {
1103
- const n = {
1100
+ const o = {
1104
1101
  text: "#121417",
1105
1102
  background: "#FFB252"
1106
1103
  };
1107
- return a === "!" && (n.text = "#FFFFFF", n.background = "#DF320C"), a === "✓" && (n.text = "#FFFFFF", n.background = "#09A57F"), n;
1104
+ return a === "!" && (o.text = "#FFFFFF", o.background = "#DF320C"), a === "✓" && (o.text = "#FFFFFF", o.background = "#09A57F"), o;
1108
1105
  }, Pt = (a) => {
1109
- const n = String(a.formattedValue), r = Mt(n);
1106
+ const o = String(a.formattedValue), r = Mt(o);
1110
1107
  return /* @__PURE__ */ e(
1111
1108
  re,
1112
1109
  {
@@ -1121,32 +1118,32 @@ const Mt = (a) => {
1121
1118
  backgroundColor: r.background,
1122
1119
  marginLeft: "10px"
1123
1120
  },
1124
- children: /* @__PURE__ */ e(l, { color: r.text, fontWeight: 700, variant: "Small", children: n })
1121
+ children: /* @__PURE__ */ e(l, { color: r.text, fontWeight: 700, variant: "Small", children: o })
1125
1122
  }
1126
1123
  );
1127
1124
  }, kt = (a) => {
1128
- const n = a.row.account, r = Ke[n.account_type];
1125
+ const o = a.row.account, r = Ke[o.account_type];
1129
1126
  return /* @__PURE__ */ s(w, { alignItems: "center", flexDirection: "row", children: [
1130
1127
  /* @__PURE__ */ e(
1131
1128
  De,
1132
1129
  {
1133
- alt: `${n.institutionName}`,
1134
- institutionGuid: n.institution_guid || ""
1130
+ alt: `${o.institutionName}`,
1131
+ institutionGuid: o.institution_guid || ""
1135
1132
  }
1136
1133
  ),
1137
1134
  /* @__PURE__ */ s(w, { ml: 12, children: [
1138
- /* @__PURE__ */ e(l, { variant: "Small", children: n.name }),
1135
+ /* @__PURE__ */ e(l, { variant: "Small", children: o.name }),
1139
1136
  /* @__PURE__ */ e(l, { variant: "XSmall", children: r })
1140
1137
  ] })
1141
1138
  ] });
1142
1139
  }, Nt = ({
1143
1140
  sx: a = {},
1144
- debts: n,
1141
+ debts: o,
1145
1142
  hoveredDebtGuid: r,
1146
1143
  onHoverRow: t,
1147
- onClickRow: o
1144
+ onClickRow: n
1148
1145
  }) => {
1149
- const i = X(), { onEvent: p } = F(), { isMobile: c } = Y(), { debts: d } = S(), [m, b] = g.useState([
1146
+ const i = X(), { onEvent: p } = F(), { isMobile: c } = Y(), { debts: d } = S(), [m, b] = x.useState([
1150
1147
  { field: "priority", sort: "asc" }
1151
1148
  ]), f = [
1152
1149
  {
@@ -1241,12 +1238,12 @@ const Mt = (a) => {
1241
1238
  headerAlign: "right",
1242
1239
  width: 20
1243
1240
  }
1244
- ], v = g.useMemo(() => n.map((y, N) => ({
1241
+ ], v = x.useMemo(() => o.map((y, N) => ({
1245
1242
  ...y,
1246
1243
  id: N,
1247
1244
  priority: Bt(y)
1248
- })), [n]), M = (y) => {
1249
- const x = y.target.closest("[data-id]")?.getAttribute("data-id"), A = n[Number(x)];
1245
+ })), [o]), M = (y) => {
1246
+ const g = y.target.closest("[data-id]")?.getAttribute("data-id"), A = o[Number(g)];
1250
1247
  t?.(A?.guid ?? "");
1251
1248
  }, I = (y) => {
1252
1249
  c || M(y);
@@ -1273,7 +1270,7 @@ const Mt = (a) => {
1273
1270
  hideFooter: !0,
1274
1271
  initialState: { sorting: { sortModel: m } },
1275
1272
  onRowClick: (y) => {
1276
- o(), p(T.DEBTS_CLICK_TABLE_ROW, { account_guid: y.row.guid });
1273
+ n(), p(T.DEBTS_CLICK_TABLE_ROW, { account_guid: y.row.guid });
1277
1274
  },
1278
1275
  onSortModelChange: (y) => {
1279
1276
  b(y), p(T.DEBTS_CLICK_TABLE_SORT);
@@ -1300,9 +1297,9 @@ const Mt = (a) => {
1300
1297
  )
1301
1298
  }
1302
1299
  );
1303
- }, Ft = ({ buttonText: a, isOpen: n, onClick: r }) => {
1304
- const { isDesktop: t, isTablet: o } = Y(), i = n ? "unfold_less" : "unfold_more";
1305
- return t || o ? /* @__PURE__ */ e(
1300
+ }, Ft = ({ buttonText: a, isOpen: o, onClick: r }) => {
1301
+ const { isDesktop: t, isTablet: n } = Y(), i = o ? "unfold_less" : "unfold_more";
1302
+ return t || n ? /* @__PURE__ */ e(
1306
1303
  fe,
1307
1304
  {
1308
1305
  "aria-controls": "prioritize-debts",
@@ -1325,8 +1322,8 @@ const Mt = (a) => {
1325
1322
  children: /* @__PURE__ */ e(ee, { name: i })
1326
1323
  }
1327
1324
  );
1328
- }, Rt = D(({ buttonEl: a, onClose: n }) => {
1329
- const { onEvent: r } = F(), { debts: t } = S(), { selectedDebtPriority: o, setSelectedDebtPriority: i } = $(), p = !!a, c = [
1325
+ }, Rt = D(({ buttonEl: a, onClose: o }) => {
1326
+ const { onEvent: r } = F(), { debts: t } = S(), { selectedDebtPriority: n, setSelectedDebtPriority: i } = $(), p = !!a, c = [
1330
1327
  {
1331
1328
  priority: P.FASTEST_PAYOFF_FIRST,
1332
1329
  text: t.priority_sort_fastest_payoff
@@ -1355,7 +1352,7 @@ const Mt = (a) => {
1355
1352
  horizontal: "left"
1356
1353
  },
1357
1354
  id: "prioritize-debts",
1358
- onClose: n,
1355
+ onClose: o,
1359
1356
  open: p,
1360
1357
  transformOrigin: {
1361
1358
  vertical: "top",
@@ -1366,8 +1363,8 @@ const Mt = (a) => {
1366
1363
  {
1367
1364
  onClick: () => d(m),
1368
1365
  sx: {
1369
- bgcolor: o === m ? "primary.main" : void 0,
1370
- color: o === m ? "#fff" : void 0,
1366
+ bgcolor: n === m ? "primary.main" : void 0,
1367
+ color: n === m ? "#fff" : void 0,
1371
1368
  justifyContent: "space-between",
1372
1369
  minHeight: 44,
1373
1370
  minWidth: 268,
@@ -1381,7 +1378,7 @@ const Mt = (a) => {
1381
1378
  },
1382
1379
  children: [
1383
1380
  /* @__PURE__ */ e(l, { color: "inherit", variant: "Small", children: b }),
1384
- o === m && /* @__PURE__ */ e(ye, { color: "inherit", filled: !0, fontSize: "small" })
1381
+ n === m && /* @__PURE__ */ e(ye, { color: "inherit", filled: !0, fontSize: "small" })
1385
1382
  ]
1386
1383
  },
1387
1384
  m
@@ -1389,30 +1386,30 @@ const Mt = (a) => {
1389
1386
  }
1390
1387
  );
1391
1388
  }), Lt = D(() => {
1392
- const { onEvent: a } = F(), { debts: n } = S(), { selectedDebtPriority: r } = $(), [t, o] = g.useState(null), i = (m) => {
1393
- o(m.currentTarget), a(T.DEBTS_CLICK_PRIORITIZE);
1389
+ const { onEvent: a } = F(), { debts: o } = S(), { selectedDebtPriority: r } = $(), [t, n] = x.useState(null), i = (m) => {
1390
+ n(m.currentTarget), a(T.DEBTS_CLICK_PRIORITIZE);
1394
1391
  }, p = () => {
1395
- o(null);
1396
- }, c = !!t, d = g.useMemo(() => ({
1397
- [P.FASTEST_PAYOFF_FIRST]: n.priority_sort_fastest_payoff,
1398
- [P.HIGHEST_INTEREST]: n.priority_sort_highest_interest,
1399
- [P.HIGHEST_BALANCE]: n.priority_sort_highest_balance,
1400
- [P.LOWEST_BALANCE]: n.priority_sort_lowest_balance
1401
- })[r] ?? n.priority_sort_lowest_balance, [r]);
1392
+ n(null);
1393
+ }, c = !!t, d = x.useMemo(() => ({
1394
+ [P.FASTEST_PAYOFF_FIRST]: o.priority_sort_fastest_payoff,
1395
+ [P.HIGHEST_INTEREST]: o.priority_sort_highest_interest,
1396
+ [P.HIGHEST_BALANCE]: o.priority_sort_highest_balance,
1397
+ [P.LOWEST_BALANCE]: o.priority_sort_lowest_balance
1398
+ })[r] ?? o.priority_sort_lowest_balance, [r]);
1402
1399
  return /* @__PURE__ */ s(_, { children: [
1403
1400
  /* @__PURE__ */ e(Ft, { buttonText: d, isOpen: c, onClick: i }),
1404
1401
  /* @__PURE__ */ e(Rt, { buttonEl: t, onClose: p })
1405
1402
  ] });
1406
- }), $t = (a, n, r = 0) => {
1403
+ }), $t = (a, o, r = 0) => {
1407
1404
  const t = a.map((d) => ({ ...d }));
1408
- xe(t, n);
1409
- const o = /* @__PURE__ */ new Date(), i = [];
1405
+ ge(t, o);
1406
+ const n = /* @__PURE__ */ new Date(), i = [];
1410
1407
  let p = 0, c = 1;
1411
1408
  for (const d of t)
1412
1409
  i.push({
1413
1410
  ...d,
1414
1411
  // Start with the initial balance
1415
- dataset: [{ x: new Date(o), y: d.balance }]
1412
+ dataset: [{ x: new Date(n), y: d.balance }]
1416
1413
  });
1417
1414
  for (; t.some((d) => d.balance >= 0.01 && !d.is_impossible); ) {
1418
1415
  let d = !1, m = !1, b = !1;
@@ -1423,17 +1420,17 @@ const Mt = (a) => {
1423
1420
  !b && r > 0 && (y += r, b = !0), !m && p > 0 && (N = p, m = !0), u.balance += C;
1424
1421
  const h = Math.min(u.balance, y + N);
1425
1422
  if (h <= C) {
1426
- u.is_impossible = !0, i[f].is_impossible = !0, i[f].priority = void 0, v.push({ x: new Date(o), y: u.balance });
1423
+ u.is_impossible = !0, i[f].is_impossible = !0, i[f].priority = void 0, v.push({ x: new Date(n), y: u.balance });
1427
1424
  continue;
1428
1425
  }
1429
1426
  u.balance -= h, u.balance = u.balance < 0.01 ? 0 : u.balance, v.push({
1430
- x: new Date(o),
1427
+ x: new Date(n),
1431
1428
  y: Math.max(0, u.balance),
1432
1429
  payment: h,
1433
1430
  extra: N
1434
- }), u.balance <= 0 && (p += B, i[f].projected_payoff_date = new Date(o)), h > 0 && (d = !0);
1431
+ }), u.balance <= 0 && (p += B, i[f].projected_payoff_date = new Date(n)), h > 0 && (d = !0);
1435
1432
  }
1436
- d && o.setMonth(o.getMonth() + 1);
1433
+ d && n.setMonth(n.getMonth() + 1);
1437
1434
  }
1438
1435
  return i.forEach((d) => {
1439
1436
  (d.interest_rate === void 0 || d.monthly_payment === void 0) && (d.projected_payoff_date = void 0);
@@ -1441,7 +1438,7 @@ const Mt = (a) => {
1441
1438
  d.priority = !d.is_paid_off && !d.is_impossible ? c++ : void 0;
1442
1439
  }), i;
1443
1440
  }, Ht = D(({ onClick: a }) => {
1444
- const { debts: n } = S(), { isDesktop: r } = Y(), { totalMonthlyPayments: t } = q(), { monthlyCashFlowProfile: o } = V(), i = t + Number(o?.extra_payment), p = r ? n.paydown_button_long : n.paydown_button_short;
1441
+ const { debts: o } = S(), { isDesktop: r } = Y(), { totalMonthlyPayments: t } = q(), { monthlyCashFlowProfile: n } = V(), i = t + Number(n?.extra_payment), p = r ? o.paydown_button_long : o.paydown_button_short;
1445
1442
  return /* @__PURE__ */ e(
1446
1443
  fe,
1447
1444
  {
@@ -1454,24 +1451,24 @@ const Mt = (a) => {
1454
1451
  children: E(p, k(i, "0,0"))
1455
1452
  }
1456
1453
  );
1457
- }), Ot = ({ onBackClick: a, sx: n }) => {
1458
- const [r, t] = g.useState(!1), [o, i] = g.useState(!1), [p, c] = g.useState(!1), [d, m] = g.useState(""), { isDesktop: b, isMobile: f } = Y(), { debts: u } = S(), { onEvent: v } = F(), { isCopyLoaded: M, isInitialized: I, setSelectedAccounts: C } = Pe(), { setSelectedAccount: B } = Ne(), { selectedDebtPriority: y, setSelectedDebtChartData: N } = $(), { visibleDebtAccounts: h } = Z(), { goalsLoaded: x, loadGoals: A, monthlyCashFlowProfile: R } = V(), { debts: L } = q();
1454
+ }), Ot = ({ onBackClick: a, sx: o }) => {
1455
+ const [r, t] = x.useState(!1), [n, i] = x.useState(!1), [p, c] = x.useState(!1), [d, m] = x.useState(""), { isDesktop: b, isMobile: f } = Y(), { debts: u } = S(), { onEvent: v } = F(), { isCopyLoaded: M, isInitialized: I, setSelectedAccounts: C } = Pe(), { setSelectedAccount: B } = Ne(), { selectedDebtPriority: y, setSelectedDebtChartData: N } = $(), { visibleDebtAccounts: h } = Z(), { goalsLoaded: g, loadGoals: A, monthlyCashFlowProfile: R } = V(), { debts: L } = q();
1459
1456
  Je({
1460
1457
  widgetName: "DebtsWidget",
1461
- isLoaded: x
1458
+ isLoaded: g
1462
1459
  });
1463
- const O = g.useMemo(() => {
1460
+ const O = x.useMemo(() => {
1464
1461
  const W = R?.extra_payment ?? 0;
1465
1462
  return $t(L, y, W);
1466
1463
  }, [L, y, R]);
1467
- g.useEffect(() => {
1464
+ x.useEffect(() => {
1468
1465
  C(h), v(T.DEBTS_VIEW);
1469
- }, []), g.useEffect(() => {
1466
+ }, []), x.useEffect(() => {
1470
1467
  C(h);
1471
- }, [h]), g.useEffect(() => {
1468
+ }, [h]), x.useEffect(() => {
1472
1469
  I && A().finally();
1473
1470
  }, [I]);
1474
- const ne = (W) => m(W), oe = () => {
1471
+ const oe = (W) => m(W), ne = () => {
1475
1472
  const W = h.find((Q) => Q.guid === d), ie = O.find((Q) => Q.guid === d);
1476
1473
  W && B(W), ie && N(ie), t(!0);
1477
1474
  }, we = () => v(T.DEBTS_CLICK_FILTER), Ce = () => {
@@ -1479,7 +1476,7 @@ const Mt = (a) => {
1479
1476
  }, Se = () => {
1480
1477
  i(!0), v(T.DEBTS_CLICK_PAYDOWN);
1481
1478
  };
1482
- return !x || !M || !I ? /* @__PURE__ */ e(Qe, {}) : /* @__PURE__ */ s(
1479
+ return !g || !M || !I ? /* @__PURE__ */ e(Qe, {}) : /* @__PURE__ */ s(
1483
1480
  Oe,
1484
1481
  {
1485
1482
  accountOptions: h,
@@ -1489,7 +1486,7 @@ const Mt = (a) => {
1489
1486
  ],
1490
1487
  onAccountsFilterClick: we,
1491
1488
  onBackClick: a,
1492
- sx: n,
1489
+ sx: o,
1493
1490
  title: u.title,
1494
1491
  children: [
1495
1492
  /* @__PURE__ */ s(w, { sx: { px: b ? "48px" : "24px" }, children: [
@@ -1503,13 +1500,13 @@ const Mt = (a) => {
1503
1500
  },
1504
1501
  children: [
1505
1502
  /* @__PURE__ */ e(
1506
- ge,
1503
+ xe,
1507
1504
  {
1508
1505
  debts: O,
1509
1506
  height: f ? 250 : void 0,
1510
1507
  hoveredDebtGuid: d,
1511
- onClickArea: oe,
1512
- onHoverArea: ne,
1508
+ onClickArea: ne,
1509
+ onHoverArea: oe,
1513
1510
  sx: { mr: f ? "4px" : "-48px" }
1514
1511
  }
1515
1512
  ),
@@ -1529,8 +1526,8 @@ const Mt = (a) => {
1529
1526
  {
1530
1527
  debts: O,
1531
1528
  hoveredDebtGuid: d,
1532
- onClickRow: oe,
1533
- onHoverRow: ne
1529
+ onClickRow: ne,
1530
+ onHoverRow: oe
1534
1531
  }
1535
1532
  ) })
1536
1533
  ] }),
@@ -1542,13 +1539,13 @@ const Mt = (a) => {
1542
1539
  }
1543
1540
  ),
1544
1541
  /* @__PURE__ */ e(vt, { isOpen: r, onClose: () => t(!1) }),
1545
- /* @__PURE__ */ e(Et, { isOpen: o, onClose: () => i(!1) })
1542
+ /* @__PURE__ */ e(Et, { isOpen: n, onClose: () => i(!1) })
1546
1543
  ]
1547
1544
  }
1548
1545
  );
1549
1546
  }, Nr = D(Ot);
1550
1547
  export {
1551
- ge as DebtsChart,
1548
+ xe as DebtsChart,
1552
1549
  Lr as DebtsStore,
1553
1550
  Nt as DebtsTable,
1554
1551
  Nr as DebtsWidget