@mx-cartographer/experiences 7.0.29-alpha.mega2 → 7.0.29

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,7 +1,7 @@
1
1
  import { jsx as e, jsxs as s, Fragment as L } from "react/jsx-runtime";
2
- import x from "react";
2
+ import g from "react";
3
3
  import { observer as S } from "mobx-react-lite";
4
- import g from "@mui/material/Stack";
4
+ import x from "@mui/material/Stack";
5
5
  import { useTheme as j, Card as be, Stack as _, Box as O } from "@mui/material";
6
6
  import { Text as l, H3 as De, InstitutionLogo as ve, Icon as ee } from "@mxenabled/mxui";
7
7
  import { intervalToDuration as Te, formatDuration as Ae } from "date-fns";
@@ -23,7 +23,7 @@ import Le from "@mui/material/CardHeader";
23
23
  import { LineChart as $e } from "@mui/x-charts";
24
24
  import re from "@mui/material/Box";
25
25
  import { useTheme as He } from "@mui/material/styles";
26
- import { A as T, W as Oe } from "../WidgetContainer-D3Y1NrBT.mjs";
26
+ import { A as T, W as Oe } from "../WidgetContainer-Bn6JPnY3.mjs";
27
27
  import de from "@mui/material/Tab";
28
28
  import We from "@mui/material/Tabs";
29
29
  import _e from "@mui/material/List";
@@ -45,27 +45,27 @@ import Ue from "@mui/material/IconButton";
45
45
  import qe from "@mui/material/ListItem";
46
46
  import Ze from "@mui/material/Popover";
47
47
  import { L as Je } from "../Loader-DUaFpDGv.mjs";
48
- const Qe = (a, o = 0, n = 0) => {
49
- if (n === 0) return 0;
50
- const r = o / (Ee * Ie);
48
+ const Qe = (a, o = 0, r = 0) => {
49
+ if (r === 0) return 0;
50
+ const t = o / (Ee * Ie);
51
51
  return Math.ceil(
52
- r === 0 ? a / n : -Math.log(1 - r * a / n) / Math.log(1 + r)
52
+ t === 0 ? a / r : -Math.log(1 - t * a / r) / Math.log(1 + t)
53
53
  );
54
- }, et = (a, o, n, r, t) => {
54
+ }, et = (a, o, r, t, n) => {
55
55
  const i = [];
56
- if (n === 0) {
57
- for (let p = 0; p < a; p++) {
58
- const d = o - r * (p + 1), h = o - r * p, m = d >= 0 ? r : h;
56
+ if (r === 0) {
57
+ for (let d = 0; d < a; d++) {
58
+ const c = o - t * (d + 1), h = o - t * d, m = c >= 0 ? t : h;
59
59
  i.push({
60
- balance: d >= 0 ? d : 0,
61
- interest: n,
60
+ balance: c >= 0 ? c : 0,
61
+ interest: r,
62
62
  payment: m,
63
63
  principal: m,
64
64
  timestamp: ce(
65
65
  le(
66
- se(t),
66
+ se(n),
67
67
  // convert seconds → Date
68
- p + 1
68
+ d + 1
69
69
  // add (index + 1) months
70
70
  )
71
71
  )
@@ -73,123 +73,123 @@ const Qe = (a, o = 0, n = 0) => {
73
73
  }
74
74
  return i;
75
75
  }
76
- const c = n / 1200;
77
- for (let p = 0; p < a; p++) {
78
- const d = ce(le(se(t), p + 1)), h = Math.pow(1 + c, p), m = o * h - r * ((h - 1) / c), y = Math.pow(1 + c, p + 1), f = o * y - r * ((y - 1) / c), D = r + Math.min(f, 0), E = m * c;
76
+ const p = r / 1200;
77
+ for (let d = 0; d < a; d++) {
78
+ const c = ce(le(se(n), d + 1)), h = Math.pow(1 + p, d), m = o * h - t * ((h - 1) / p), y = Math.pow(1 + p, d + 1), f = o * y - t * ((y - 1) / p), D = t + Math.min(f, 0), E = m * p;
79
79
  i.push({
80
80
  balance: Math.max(0, f),
81
81
  interest: E,
82
82
  payment: D,
83
83
  principal: D - E,
84
- timestamp: d
84
+ timestamp: c
85
85
  });
86
86
  }
87
87
  return i;
88
88
  }, tt = (a) => (a[a.length - 1] || {}).timestamp, rt = (a) => {
89
- const { monthly_payment: o, interest_rate: n, balance: r, payment_due_date: t } = a, i = Qe(r, n ?? 0, o ?? 0), c = et(
89
+ const { monthly_payment: o, interest_rate: r, balance: t, payment_due_date: n } = a, i = Qe(t, r ?? 0, o ?? 0), p = et(
90
90
  i,
91
- r,
92
- n ?? 0,
91
+ t,
92
+ r ?? 0,
93
93
  o ?? 0,
94
- t
95
- ), p = tt(c);
94
+ n
95
+ ), d = tt(p);
96
96
  return {
97
97
  ...a,
98
- minimumFinalPayment: p,
99
- minimumPayments: c
98
+ minimumFinalPayment: d,
99
+ minimumPayments: p
100
100
  };
101
- }, xe = (a, o) => {
102
- const [n, r] = a.reduce(
103
- ([t, i], c) => (c.is_paid_off || c.is_impossible ? i.push({ ...c, minimumPayments: [] }) : t.push(rt(c)), [t, i]),
101
+ }, ge = (a, o) => {
102
+ const [r, t] = a.reduce(
103
+ ([n, i], p) => (p.is_paid_off || p.is_impossible ? i.push({ ...p, minimumPayments: [] }) : n.push(rt(p)), [n, i]),
104
104
  [[], []]
105
105
  );
106
106
  switch (o) {
107
107
  case M.FASTEST_PAYOFF_FIRST:
108
- n.sort((t, i) => (t.minimumFinalPayment ?? 0) - (i.minimumFinalPayment ?? 0));
108
+ r.sort((n, i) => (n.minimumFinalPayment ?? 0) - (i.minimumFinalPayment ?? 0));
109
109
  break;
110
110
  case M.HIGHEST_INTEREST:
111
- n.sort((t, i) => (i.interest_rate ?? 0) - (t.interest_rate ?? 0));
111
+ r.sort((n, i) => (i.interest_rate ?? 0) - (n.interest_rate ?? 0));
112
112
  break;
113
113
  case M.LOWEST_BALANCE:
114
- n.sort((t, i) => t.balance - i.balance);
114
+ r.sort((n, i) => n.balance - i.balance);
115
115
  break;
116
116
  case M.HIGHEST_BALANCE:
117
- n.sort((t, i) => i.balance - t.balance);
117
+ r.sort((n, i) => i.balance - n.balance);
118
118
  break;
119
119
  default:
120
- n.sort((t, i) => t.balance - i.balance);
120
+ r.sort((n, i) => n.balance - i.balance);
121
121
  }
122
- a.splice(0, a.length, ...n, ...r);
122
+ a.splice(0, a.length, ...r, ...t);
123
123
  };
124
- function at(a, o, n = 0) {
125
- const r = a.map((m) => ({ ...m })).filter(
124
+ function at(a, o, r = 0) {
125
+ const t = a.map((m) => ({ ...m })).filter(
126
126
  (m) => m.interest_rate !== void 0 && m.monthly_payment !== void 0 && !m.is_paid_off
127
127
  );
128
- xe(r, o);
129
- let t = 0, i = 0;
130
- const c = /* @__PURE__ */ new Date(), p = /* @__PURE__ */ new Date();
131
- for (; r.some((m) => m.balance >= 0.01 && !m.is_impossible); ) {
128
+ ge(t, o);
129
+ let n = 0, i = 0;
130
+ const p = /* @__PURE__ */ new Date(), d = /* @__PURE__ */ new Date();
131
+ for (; t.some((m) => m.balance >= 0.01 && !m.is_impossible); ) {
132
132
  let m = !1;
133
- for (const [y, f] of r.entries()) {
133
+ for (const [y, f] of t.entries()) {
134
134
  if (f.balance <= 0.01 || f.is_impossible) continue;
135
135
  const E = (f.interest_rate ?? 0) / 100 / 12, v = f.balance * E;
136
136
  let u = f.monthly_payment ?? 0;
137
- y === 0 && n && (u += n), f.balance += v;
137
+ y === 0 && r && (u += r), f.balance += v;
138
138
  const I = Math.min(f.balance, u + i);
139
139
  if (I <= v) {
140
140
  f.is_impossible = !0;
141
141
  continue;
142
142
  }
143
- f.balance -= I, f.balance = f.balance < 0.01 ? 0 : f.balance, t += v, f.balance <= 0 && (i += u), I > 0 && (m = !0);
143
+ f.balance -= I, f.balance = f.balance < 0.01 ? 0 : f.balance, n += v, f.balance <= 0 && (i += u), I > 0 && (m = !0);
144
144
  }
145
- m && p.setMonth(p.getMonth() + 1);
145
+ m && d.setMonth(d.getMonth() + 1);
146
146
  }
147
- const d = r.some((m) => m.is_impossible && m.balance > 0), h = Te({ start: c, end: p });
147
+ const c = t.some((m) => m.is_impossible && m.balance > 0), h = Te({ start: p, end: d });
148
148
  return {
149
- payoffSavings: d ? "N/A" : P(t, "0,0.00"),
150
- payoffDate: d ? "Never" : K(p, U.MONTH_YEAR),
151
- payoffDuration: d ? "Stagnant" : Ae(h, { format: ["years", "months"] }) || "0 months"
149
+ payoffSavings: c ? "N/A" : P(n, "0,0.00"),
150
+ payoffDate: c ? "Never" : K(d, U.MONTH_YEAR),
151
+ payoffDuration: c ? "Stagnant" : Ae(h, { format: ["years", "months"] }) || "0 months"
152
152
  };
153
153
  }
154
154
  const R = () => {
155
- if (!x.useContext(Me))
155
+ if (!g.useContext(Me))
156
156
  throw new Error("useCateUiStore() must be used within the GlobalDataContext");
157
157
  return q().uiStore;
158
- }, ot = ({ debts: a, onClickCta: o, sx: n }) => {
159
- const r = j(), { isMobile: t } = X(), { debts: i } = C(), { selectedDebtPriority: c } = R(), { monthlyCashFlowProfile: p } = z(), { payoffDate: d, payoffSavings: h, payoffDuration: m } = x.useMemo(() => {
160
- const y = p?.extra_payment ?? 0;
161
- return at(a, c, y);
162
- }, [a, c, p]);
158
+ }, ot = ({ debts: a, onClickCta: o, sx: r }) => {
159
+ const t = j(), { isMobile: n } = X(), { debts: i } = C(), { selectedDebtPriority: p } = R(), { monthlyCashFlowProfile: d } = z(), { payoffDate: c, payoffSavings: h, payoffDuration: m } = g.useMemo(() => {
160
+ const y = d?.extra_payment ?? 0;
161
+ return at(a, p, y);
162
+ }, [a, p, d]);
163
163
  return /* @__PURE__ */ e(
164
164
  be,
165
165
  {
166
166
  sx: {
167
- boxShadow: r.shadows[2],
168
- width: t ? "100%" : "186px",
167
+ boxShadow: t.shadows[2],
168
+ width: n ? "100%" : "186px",
169
169
  minWidth: "186px",
170
- ...n
170
+ ...r
171
171
  },
172
172
  children: /* @__PURE__ */ s(_, { sx: { gap: "12px", p: "16px" }, children: [
173
173
  /* @__PURE__ */ s(
174
174
  _,
175
175
  {
176
- gap: t ? "4px" : "0",
176
+ gap: n ? "4px" : "0",
177
177
  sx: {
178
178
  borderBottom: "1px solid",
179
- borderBottomColor: r.palette.grey[300],
179
+ borderBottomColor: t.palette.grey[300],
180
180
  pb: "8px"
181
181
  },
182
182
  children: [
183
183
  /* @__PURE__ */ e(l, { variant: "XSmall", children: i.snowball_card_date_description }),
184
- /* @__PURE__ */ e(l, { bold: !0, color: r.palette.primary.main, variant: "Small", children: d })
184
+ /* @__PURE__ */ e(l, { bold: !0, color: t.palette.primary.main, variant: "Small", children: c })
185
185
  ]
186
186
  }
187
187
  ),
188
- /* @__PURE__ */ s(_, { gap: t ? "4px" : "0", children: [
188
+ /* @__PURE__ */ s(_, { gap: n ? "4px" : "0", children: [
189
189
  /* @__PURE__ */ e(l, { bold: !0, variant: "Small", children: h }),
190
190
  /* @__PURE__ */ e(l, { sx: { whiteSpace: "normal" }, variant: "XSmall", children: i.snowball_card_amount_description })
191
191
  ] }),
192
- /* @__PURE__ */ s(_, { gap: t ? "4px" : "0", children: [
192
+ /* @__PURE__ */ s(_, { gap: n ? "4px" : "0", children: [
193
193
  /* @__PURE__ */ e(l, { bold: !0, variant: "Small", children: m }),
194
194
  /* @__PURE__ */ e(l, { variant: "XSmall", children: i.snowball_card_duration_description })
195
195
  ] }),
@@ -197,7 +197,7 @@ const R = () => {
197
197
  l,
198
198
  {
199
199
  bold: !0,
200
- color: r.palette.primary.main,
200
+ color: t.palette.primary.main,
201
201
  onClick: o,
202
202
  sx: { cursor: "pointer" },
203
203
  variant: "Small",
@@ -207,15 +207,14 @@ const R = () => {
207
207
  ] })
208
208
  }
209
209
  );
210
- }, nt = S(ot), it = ({ isOpen: a, onClose: o, sx: n }) => {
211
- const r = j(), { debts: t } = C(), [i, c] = x.useState(!1);
210
+ }, nt = S(ot), it = ({ isOpen: a, onClose: o }) => {
211
+ const r = j(), { debts: t } = C(), [n, i] = g.useState(!1);
212
212
  return /* @__PURE__ */ e(
213
213
  te,
214
214
  {
215
215
  ariaLabelClose: "",
216
216
  isOpen: a,
217
217
  onClose: o,
218
- sx: { ...n },
219
218
  title: t.snowball_drawer_title,
220
219
  children: /* @__PURE__ */ s(_, { bgcolor: r.palette.background.default, height: "100%", children: [
221
220
  /* @__PURE__ */ s(_, { alignItems: "center", px: 24, py: 24, children: [
@@ -232,7 +231,7 @@ const R = () => {
232
231
  {
233
232
  color: r.palette.secondary.main,
234
233
  mb: 8,
235
- sx: { whiteSpace: i ? "normal" : "nowrap" },
234
+ sx: { whiteSpace: n ? "normal" : "nowrap" },
236
235
  variant: "ParagraphSmall",
237
236
  children: t.snowball_drawer_answer
238
237
  }
@@ -242,10 +241,10 @@ const R = () => {
242
241
  {
243
242
  bold: !0,
244
243
  color: r.palette.primary.main,
245
- onClick: () => c(!i),
244
+ onClick: () => i(!n),
246
245
  sx: { cursor: "pointer" },
247
246
  variant: "Small",
248
- children: i ? t.snowball_drawer_less : t.snowball_drawer_more
247
+ children: n ? t.snowball_drawer_less : t.snowball_drawer_more
249
248
  }
250
249
  )
251
250
  ] })
@@ -571,23 +570,23 @@ const R = () => {
571
570
  );
572
571
  }, lt = S(it), st = "#FF7B08";
573
572
  function ct(a, o) {
574
- const [n, r, t] = a.replace(/^#/, "").match(/.{1,2}/g).map((c) => parseInt(c, 16)), i = [
575
- Math.max(0, Math.min(255, Math.round(n * o))),
573
+ const [r, t, n] = a.replace(/^#/, "").match(/.{1,2}/g).map((p) => parseInt(p, 16)), i = [
576
574
  Math.max(0, Math.min(255, Math.round(r * o))),
577
- Math.max(0, Math.min(255, Math.round(t * o)))
575
+ Math.max(0, Math.min(255, Math.round(t * o))),
576
+ Math.max(0, Math.min(255, Math.round(n * o)))
578
577
  ];
579
578
  return `rgb(${i[0]}, ${i[1]}, ${i[2]})`;
580
579
  }
581
- const ge = ({
580
+ const xe = ({
582
581
  sx: a,
583
582
  height: o = 500,
584
- width: n,
585
- debts: r,
586
- hoveredDebtGuid: t,
583
+ width: r,
584
+ debts: t,
585
+ hoveredDebtGuid: n,
587
586
  onClickArea: i,
588
- onHoverArea: c
587
+ onHoverArea: p
589
588
  }) => {
590
- const p = He(), { onEvent: d } = k(), h = r.filter((b) => !b.is_impossible), m = [
589
+ const d = He(), { onEvent: c } = k(), h = t.filter((b) => !b.is_impossible), m = [
591
590
  ...new Set(
592
591
  h.flatMap((b) => b.dataset.map((w) => new Date(w.x).getTime()))
593
592
  )
@@ -624,7 +623,7 @@ const ge = ({
624
623
  id: "payoff-line",
625
624
  label: "Payoff Line",
626
625
  data: D.map((b) => b.y),
627
- color: p.palette.grey[700],
626
+ color: d.palette.grey[700],
628
627
  curve: "linear",
629
628
  type: "line",
630
629
  stack: void 0,
@@ -656,11 +655,11 @@ const ge = ({
656
655
  onAreaClick: (b, w) => {
657
656
  i?.();
658
657
  const B = u.find((F) => F.id === w.seriesId);
659
- d(T.DEBTS_CLICK_CHART_AREA, { account_guid: B?.guid });
658
+ c(T.DEBTS_CLICK_CHART_AREA, { account_guid: B?.guid });
660
659
  },
661
660
  onHighlightChange: (b) => {
662
661
  const w = u.find((B) => B.id === b?.seriesId)?.guid;
663
- c?.(w ?? "");
662
+ p?.(w ?? "");
664
663
  },
665
664
  series: u,
666
665
  skipAnimation: !0,
@@ -686,16 +685,16 @@ const ge = ({
686
685
  strokeDasharray: "10 5",
687
686
  strokeWidth: 1
688
687
  },
689
- [`& .MuiLineElement-series-debt-${I(t ?? "0")}`]: {
688
+ [`& .MuiLineElement-series-debt-${I(n ?? "0")}`]: {
690
689
  opacity: 1
691
690
  },
692
- [`& .MuiAreaElement-series-debt-${I(t ?? "0")}`]: {
691
+ [`& .MuiAreaElement-series-debt-${I(n ?? "0")}`]: {
693
692
  opacity: 1
694
693
  },
695
694
  ...a
696
695
  },
697
696
  tooltip: { trigger: "none" },
698
- width: n,
697
+ width: r,
699
698
  xAxis: [
700
699
  {
701
700
  data: v,
@@ -718,7 +717,7 @@ const ge = ({
718
717
  }
719
718
  );
720
719
  }, dt = () => {
721
- const a = j(), { debts: o } = C(), { selectedDebtChartData: n } = R();
720
+ const a = j(), { debts: o } = C(), { selectedDebtChartData: r } = R();
722
721
  return /* @__PURE__ */ s(L, { children: [
723
722
  /* @__PURE__ */ s(
724
723
  Ne,
@@ -730,7 +729,7 @@ const ge = ({
730
729
  },
731
730
  children: [
732
731
  /* @__PURE__ */ e(Le, { sx: { pb: 0 }, title: /* @__PURE__ */ e(De, { sx: { pb: 4 }, children: o.details_chart_title }) }),
733
- /* @__PURE__ */ e(Re, { sx: { p: 0 }, children: /* @__PURE__ */ e(ge, { debts: [n], height: 250 }) })
732
+ /* @__PURE__ */ e(Re, { sx: { p: 0 }, children: /* @__PURE__ */ e(xe, { debts: [r], height: 250 }) })
734
733
  ]
735
734
  }
736
735
  ),
@@ -745,23 +744,23 @@ const ge = ({
745
744
  )
746
745
  ] });
747
746
  }, pt = S(dt), mt = () => {
748
- const a = j(), { onEvent: o } = k(), { debts: n } = C(), { selectedDebtChartData: r, showCompleted: t, showError: i } = R();
749
- return x.useEffect(() => o(T.DEBT_SCHEDULE_VIEW), []), /* @__PURE__ */ e(_e, { children: i || t ? /* @__PURE__ */ e(
747
+ const a = j(), { onEvent: o } = k(), { debts: r } = C(), { selectedDebtChartData: t, showCompleted: n, showError: i } = R();
748
+ return g.useEffect(() => o(T.DEBT_SCHEDULE_VIEW), []), /* @__PURE__ */ e(_e, { children: i || n ? /* @__PURE__ */ e(
750
749
  l,
751
750
  {
752
751
  color: a.palette.secondary.main,
753
752
  component: "div",
754
753
  sx: { p: 32, textAlign: "center", whiteSpace: "normal" },
755
754
  variant: "Small",
756
- children: i ? n.schedule_error_message : n.schedule_complete_message
755
+ children: i ? r.schedule_error_message : r.schedule_complete_message
757
756
  }
758
757
  ) : /* @__PURE__ */ s(L, { children: [
759
- /* @__PURE__ */ s(g, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
760
- /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: n.schedule_month_heading }),
761
- /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: n.schedule_amount_heading })
758
+ /* @__PURE__ */ s(x, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
759
+ /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: r.schedule_month_heading }),
760
+ /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: r.schedule_amount_heading })
762
761
  ] }),
763
- r.dataset.slice(1).map(({ x: c, y: p, payment: d }) => /* @__PURE__ */ e(g, { bgcolor: a.palette.background.paper, children: /* @__PURE__ */ e(g, { alignItems: "center", flexDirection: "row", pl: 24, children: /* @__PURE__ */ s(
764
- g,
762
+ t.dataset.slice(1).map(({ x: p, y: d, payment: c }) => /* @__PURE__ */ e(x, { bgcolor: a.palette.background.paper, children: /* @__PURE__ */ e(x, { alignItems: "center", flexDirection: "row", pl: 24, children: /* @__PURE__ */ s(
763
+ x,
765
764
  {
766
765
  sx: {
767
766
  borderBottom: `1px solid ${a.palette.border.light}`,
@@ -771,12 +770,12 @@ const ge = ({
771
770
  pr: 24
772
771
  },
773
772
  children: [
774
- /* @__PURE__ */ s(g, { flexGrow: 1, children: [
775
- /* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: K(c, U.MONTH_YEAR) }),
776
- /* @__PURE__ */ e(l, { color: a.palette.secondary.main, variant: "XSmall", children: n.schedule_month_label })
773
+ /* @__PURE__ */ s(x, { flexGrow: 1, children: [
774
+ /* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: K(p, U.MONTH_YEAR) }),
775
+ /* @__PURE__ */ e(l, { color: a.palette.secondary.main, variant: "XSmall", children: r.schedule_month_label })
777
776
  ] }),
778
- /* @__PURE__ */ s(g, { children: [
779
- /* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: P(p, "0,0.00") }),
777
+ /* @__PURE__ */ s(x, { children: [
778
+ /* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: P(d, "0,0.00") }),
780
779
  /* @__PURE__ */ e(
781
780
  l,
782
781
  {
@@ -784,15 +783,15 @@ const ge = ({
784
783
  color: a.palette.success.main,
785
784
  textAlign: "end",
786
785
  variant: "Tiny",
787
- children: `+${P(d, "0,0")}`
786
+ children: `+${P(c, "0,0")}`
788
787
  }
789
788
  )
790
789
  ] })
791
790
  ]
792
791
  }
793
- ) }) }, String(c))),
794
- /* @__PURE__ */ e(g, { bgcolor: "background.paper", children: /* @__PURE__ */ s(
795
- g,
792
+ ) }) }, String(p))),
793
+ /* @__PURE__ */ e(x, { bgcolor: "background.paper", children: /* @__PURE__ */ s(
794
+ x,
796
795
  {
797
796
  sx: {
798
797
  alignItems: "center",
@@ -802,16 +801,16 @@ const ge = ({
802
801
  px: 24
803
802
  },
804
803
  children: [
805
- /* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children: n.schedule_payoff_label }),
804
+ /* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children: r.schedule_payoff_label }),
806
805
  /* @__PURE__ */ e(l, { variant: "Body", children: "-" })
807
806
  ]
808
807
  }
809
808
  ) })
810
809
  ] }) });
811
810
  }, ht = S(mt), ut = S(({ debt: a }) => {
812
- const { debts: o } = C(), { updateAccount: n } = Z(), { onEvent: r } = k(), [t, i] = x.useState(a.interest_rate ?? 0), c = t < 0, p = async () => {
813
- await n({ ...a.account, interest_rate: t }), a.interest_rate = t, r(T.DEBTS_SAVE_RATE_ACTION, { account_guid: a.guid });
814
- }, d = () => {
811
+ const { debts: o } = C(), { updateAccount: r } = Z(), { onEvent: t } = k(), [n, i] = g.useState(a.interest_rate ?? 0), p = n < 0, d = async () => {
812
+ await r({ ...a.account, interest_rate: n }), a.interest_rate = n, t(T.DEBTS_SAVE_RATE_ACTION, { account_guid: a.guid });
813
+ }, c = () => {
815
814
  setTimeout(() => {
816
815
  i(a.interest_rate ?? 0);
817
816
  }, 250);
@@ -819,29 +818,29 @@ const ge = ({
819
818
  return /* @__PURE__ */ e(
820
819
  J,
821
820
  {
822
- isSaveDisabled: c,
821
+ isSaveDisabled: p,
823
822
  label: `${o.details_interest_rate} (%)`,
824
- onCancel: d,
825
- onSave: p,
823
+ onCancel: c,
824
+ onSave: d,
826
825
  primaryText: o.details_interest_rate,
827
826
  secondaryText: Be(Number(a.interest_rate) / 100),
828
827
  zeroStateText: a.interest_rate ? void 0 : o.add_interest_rate,
829
828
  children: /* @__PURE__ */ e(
830
829
  Xe,
831
830
  {
832
- error: c,
831
+ error: p,
833
832
  fullWidth: !0,
834
833
  onChange: (h) => i(isNaN(parseFloat(h.target.value)) ? 0 : parseFloat(h.target.value)),
835
834
  type: "number",
836
- value: t
835
+ value: n
837
836
  }
838
837
  )
839
838
  }
840
839
  );
841
840
  }), bt = S(({ debt: a }) => {
842
- const { debts: o } = C(), { updateAccount: n } = Z(), { onEvent: r } = k(), [t, i] = x.useState(a.monthly_payment ?? 0), c = t < 0 || t > 9999999999e-2, p = async () => {
843
- await n({ ...a.account, minimum_payment: t }), a.monthly_payment = t, r(T.DEBTS_SAVE_PAYMENT_ACTION, { account_guid: a.guid });
844
- }, d = () => {
841
+ const { debts: o } = C(), { updateAccount: r } = Z(), { onEvent: t } = k(), [n, i] = g.useState(a.monthly_payment ?? 0), p = n < 0 || n > 9999999999e-2, d = async () => {
842
+ await r({ ...a.account, minimum_payment: n }), a.monthly_payment = n, t(T.DEBTS_SAVE_PAYMENT_ACTION, { account_guid: a.guid });
843
+ }, c = () => {
845
844
  setTimeout(() => {
846
845
  i(a.monthly_payment ?? 0);
847
846
  }, 250);
@@ -849,31 +848,31 @@ const ge = ({
849
848
  return /* @__PURE__ */ e(
850
849
  J,
851
850
  {
852
- isSaveDisabled: c,
851
+ isSaveDisabled: p,
853
852
  label: o.details_monthly_payment,
854
- onCancel: d,
855
- onSave: p,
853
+ onCancel: c,
854
+ onSave: d,
856
855
  primaryText: o.details_monthly_payment,
857
856
  secondaryText: P(a.monthly_payment, "0,0"),
858
857
  zeroStateText: a.monthly_payment ? void 0 : o.add_monthly_payment,
859
858
  children: /* @__PURE__ */ e(
860
859
  ae,
861
860
  {
862
- amount: t,
861
+ amount: n,
863
862
  autoFocus: !0,
864
- error: c,
863
+ error: p,
865
864
  fullWidth: !0,
866
865
  minAmount: 0,
867
- setAmount: (h) => i(isNaN(Number(h)) ? t : Number(h)),
866
+ setAmount: (h) => i(isNaN(Number(h)) ? n : Number(h)),
868
867
  sx: { ".MuiTypography-Body": { p: 0 } }
869
868
  }
870
869
  )
871
870
  }
872
871
  );
873
872
  }), _t = S(({ debt: a }) => {
874
- const { debts: o } = C(), { updateAccount: n } = Z(), { onEvent: r } = k(), [t, i] = x.useState(a.original_balance ?? 0), c = t < 0 || t > 9999999999e-2, p = async () => {
875
- await n({ ...a.account, original_balance: t }), a.original_balance = t, r(T.DEBTS_SAVE_BALANCE_ACTION, { account_guid: a.guid });
876
- }, d = () => {
873
+ const { debts: o } = C(), { updateAccount: r } = Z(), { onEvent: t } = k(), [n, i] = g.useState(a.original_balance ?? 0), p = n < 0 || n > 9999999999e-2, d = async () => {
874
+ await r({ ...a.account, original_balance: n }), a.original_balance = n, t(T.DEBTS_SAVE_BALANCE_ACTION, { account_guid: a.guid });
875
+ }, c = () => {
877
876
  setTimeout(() => {
878
877
  i(a.original_balance ?? 0);
879
878
  }, 250);
@@ -881,22 +880,22 @@ const ge = ({
881
880
  return /* @__PURE__ */ e(
882
881
  J,
883
882
  {
884
- isSaveDisabled: c,
883
+ isSaveDisabled: p,
885
884
  label: o.details_original_balance,
886
- onCancel: d,
887
- onSave: p,
885
+ onCancel: c,
886
+ onSave: d,
888
887
  primaryText: o.details_original_balance,
889
888
  secondaryText: P(a.original_balance, "0,0"),
890
889
  zeroStateText: a.original_balance ? void 0 : o.add_original_balance,
891
890
  children: /* @__PURE__ */ e(
892
891
  ae,
893
892
  {
894
- amount: t,
893
+ amount: n,
895
894
  autoFocus: !0,
896
- error: c,
895
+ error: p,
897
896
  fullWidth: !0,
898
897
  minAmount: 0,
899
- setAmount: (h) => i(isNaN(Number(h)) ? t : Number(h)),
898
+ setAmount: (h) => i(isNaN(Number(h)) ? n : Number(h)),
900
899
  sx: { ".MuiTypography-Body": { p: 0 } }
901
900
  }
902
901
  )
@@ -904,7 +903,7 @@ const ge = ({
904
903
  );
905
904
  }), yt = () => {
906
905
  const { onEvent: a } = k(), { selectedDebtChartData: o } = R();
907
- return x.useEffect(() => a(T.DEBT_DETAILS_VIEW), []), /* @__PURE__ */ s(g, { bgcolor: "background.paper", children: [
906
+ return g.useEffect(() => a(T.DEBT_DETAILS_VIEW), []), /* @__PURE__ */ s(x, { bgcolor: "background.paper", children: [
908
907
  o?.goal && /* @__PURE__ */ s(L, { children: [
909
908
  /* @__PURE__ */ e(Ge, { goal: o.goal }),
910
909
  /* @__PURE__ */ e(W, {}),
@@ -922,33 +921,33 @@ const ge = ({
922
921
  /* @__PURE__ */ e(W, {})
923
922
  ] })
924
923
  ] });
925
- }, ft = S(yt), xt = ({ setTabValue: a, sx: o }) => {
926
- const { debts: n } = C(), { showError: r, showCompleted: t } = R();
927
- return x.useEffect(() => {
928
- r && a(1);
929
- }, [r]), !r && !t ? /* @__PURE__ */ e(L, {}) : /* @__PURE__ */ s(g, { gap: 16, children: [
924
+ }, ft = S(yt), gt = ({ setTabValue: a, sx: o }) => {
925
+ const { debts: r } = C(), { showError: t, showCompleted: n } = R();
926
+ return g.useEffect(() => {
927
+ t && a(1);
928
+ }, [t]), !t && !n ? /* @__PURE__ */ e(L, {}) : /* @__PURE__ */ s(x, { gap: 16, children: [
930
929
  /* @__PURE__ */ e(he, { sx: { my: 16, mx: 24, ...o }, children: /* @__PURE__ */ s(
931
930
  pe,
932
931
  {
933
- icon: r ? /* @__PURE__ */ e(Ve, { filled: !0 }) : /* @__PURE__ */ e(ye, { color: "success", filled: !0 }),
932
+ icon: t ? /* @__PURE__ */ e(Ve, { filled: !0 }) : /* @__PURE__ */ e(ye, { color: "success", filled: !0 }),
934
933
  severity: "error",
935
934
  sx: {
936
935
  alignItems: "start",
937
936
  borderLeft: 5,
938
937
  borderRadius: 1,
939
- borderColor: r ? "error.main" : "success.main",
938
+ borderColor: t ? "error.main" : "success.main",
940
939
  color: "text.primary",
941
940
  "&.MuiPaper-root": {
942
941
  backgroundColor: "background.paper"
943
942
  }
944
943
  },
945
944
  children: [
946
- /* @__PURE__ */ e(me, { sx: { fontWeight: 600, marginTop: 2 }, variant: "Body", children: r ? n.status_error_title : n.status_complete_title }),
947
- /* @__PURE__ */ e(l, { component: "p", sx: { whiteSpace: "wrap" }, variant: "ParagraphSmall", children: r ? n.status_error_description : n.status_complete_description })
945
+ /* @__PURE__ */ e(me, { sx: { fontWeight: 600, marginTop: 2 }, variant: "Body", children: t ? r.status_error_title : r.status_complete_title }),
946
+ /* @__PURE__ */ e(l, { component: "p", sx: { whiteSpace: "wrap" }, variant: "ParagraphSmall", children: t ? r.status_error_description : r.status_complete_description })
948
947
  ]
949
948
  }
950
949
  ) }),
951
- r && /* @__PURE__ */ e(he, { sx: { mb: 16, mt: 100, mx: 24, ...o }, children: /* @__PURE__ */ s(
950
+ t && /* @__PURE__ */ e(he, { sx: { mb: 16, mt: 100, mx: 24, ...o }, children: /* @__PURE__ */ s(
952
951
  pe,
953
952
  {
954
953
  icon: /* @__PURE__ */ e(L, {}),
@@ -961,24 +960,24 @@ const ge = ({
961
960
  }
962
961
  },
963
962
  children: [
964
- /* @__PURE__ */ e(me, { sx: { fontWeight: 600, marginTop: 2 }, variant: "Body", children: n.status_info_title }),
965
- /* @__PURE__ */ e(l, { component: "p", sx: { whiteSpace: "wrap" }, variant: "ParagraphSmall", children: n.status_info_description })
963
+ /* @__PURE__ */ e(me, { sx: { fontWeight: 600, marginTop: 2 }, variant: "Body", children: r.status_info_title }),
964
+ /* @__PURE__ */ e(l, { component: "p", sx: { whiteSpace: "wrap" }, variant: "ParagraphSmall", children: r.status_info_description })
966
965
  ]
967
966
  }
968
967
  ) })
969
968
  ] });
970
- }, gt = S(xt), wt = () => {
971
- const { debts: a } = C(), { showError: o, showCompleted: n } = R(), [r, t] = x.useState(0);
969
+ }, xt = S(gt), wt = () => {
970
+ const { debts: a } = C(), { showError: o, showCompleted: r } = R(), [t, n] = g.useState(0);
972
971
  return /* @__PURE__ */ s(L, { children: [
973
- (o || n) && /* @__PURE__ */ e(gt, { setTabValue: t, sx: { mt: -24 } }),
972
+ (o || r) && /* @__PURE__ */ e(xt, { setTabValue: n, sx: { mt: -24 } }),
974
973
  /* @__PURE__ */ s(
975
974
  We,
976
975
  {
977
976
  "aria-label": a.details_tabs_aria_label,
978
977
  centered: !0,
979
- onChange: (i, c) => t(c),
978
+ onChange: (i, p) => n(p),
980
979
  textColor: "primary",
981
- value: r,
980
+ value: t,
982
981
  variant: "fullWidth",
983
982
  children: [
984
983
  /* @__PURE__ */ e(
@@ -1000,31 +999,30 @@ const ge = ({
1000
999
  ]
1001
1000
  }
1002
1001
  ),
1003
- /* @__PURE__ */ e(ue, { index: 0, name: "debt-schedule", value: r, children: /* @__PURE__ */ e(ht, {}) }),
1004
- /* @__PURE__ */ e(ue, { index: 1, name: "debt-details", value: r, children: /* @__PURE__ */ e(ft, {}) })
1002
+ /* @__PURE__ */ e(ue, { index: 0, name: "debt-schedule", value: t, children: /* @__PURE__ */ e(ht, {}) }),
1003
+ /* @__PURE__ */ e(ue, { index: 1, name: "debt-details", value: t, children: /* @__PURE__ */ e(ft, {}) })
1005
1004
  ] });
1006
- }, Ct = S(wt), St = ({ isOpen: a, onClose: o, sx: n }) => {
1007
- const { debts: r } = C(), { showError: t, showCompleted: i } = R(), c = t || i ? /* @__PURE__ */ e(L, {}) : /* @__PURE__ */ e(pt, {});
1005
+ }, Ct = S(wt), St = ({ isOpen: a, onClose: o }) => {
1006
+ const { debts: r } = C(), { showError: t, showCompleted: n } = R(), i = t || n ? /* @__PURE__ */ e(L, {}) : /* @__PURE__ */ e(pt, {});
1008
1007
  return /* @__PURE__ */ e(
1009
1008
  te,
1010
1009
  {
1011
1010
  ariaLabelClose: r.details_close_aria,
1012
1011
  isOpen: a,
1013
1012
  onClose: o,
1014
- sx: { ...n },
1015
1013
  title: r.details_title,
1016
- children: /* @__PURE__ */ s(g, { bgcolor: "background.default", children: [
1017
- /* @__PURE__ */ e(ke, { customDetailsChart: c }),
1014
+ children: /* @__PURE__ */ s(x, { bgcolor: "background.default", children: [
1015
+ /* @__PURE__ */ e(ke, { customDetailsChart: i }),
1018
1016
  /* @__PURE__ */ e(Ct, {})
1019
1017
  ] })
1020
1018
  }
1021
1019
  );
1022
1020
  }, Dt = S(() => {
1023
- const { debts: a } = C(), { monthlyCashFlowProfile: o, updateMonthlyCashFlowProfile: n } = z(), { onEvent: r } = k(), [t, i] = x.useState(o?.extra_payment ?? 0), c = t < 0 || t > 9999999999e-2, p = async () => {
1024
- o && (await n({ ...o, extra_payment: t }), o.extra_payment = t, r(T.DEBTS_SAVE_PAYDOWN_ACTION, {
1021
+ const { debts: a } = C(), { monthlyCashFlowProfile: o, updateMonthlyCashFlowProfile: r } = z(), { onEvent: t } = k(), [n, i] = g.useState(o?.extra_payment ?? 0), p = n < 0 || n > 9999999999e-2, d = async () => {
1022
+ o && (await r({ ...o, extra_payment: n }), o.extra_payment = n, t(T.DEBTS_SAVE_PAYDOWN_ACTION, {
1025
1023
  user_guid: o?.user_guid
1026
1024
  }));
1027
- }, d = () => {
1025
+ }, c = () => {
1028
1026
  setTimeout(() => {
1029
1027
  i(o?.extra_payment ?? 0);
1030
1028
  }, 250);
@@ -1032,48 +1030,48 @@ const ge = ({
1032
1030
  return /* @__PURE__ */ e(
1033
1031
  J,
1034
1032
  {
1035
- isSaveDisabled: c,
1033
+ isSaveDisabled: p,
1036
1034
  label: a.paydown_drawer_extra_payment,
1037
- onCancel: d,
1038
- onSave: p,
1035
+ onCancel: c,
1036
+ onSave: d,
1039
1037
  primaryText: a.paydown_drawer_extra_payment,
1040
1038
  secondaryText: P(o?.extra_payment, "0,0"),
1041
1039
  zeroStateText: o?.extra_payment ? void 0 : a.add_extra_payment,
1042
1040
  children: /* @__PURE__ */ e(
1043
1041
  ae,
1044
1042
  {
1045
- amount: t,
1043
+ amount: n,
1046
1044
  autoFocus: !0,
1047
- error: c,
1045
+ error: p,
1048
1046
  fullWidth: !0,
1049
1047
  minAmount: 0,
1050
- setAmount: (h) => i(isNaN(Number(h)) ? t : Number(h)),
1048
+ setAmount: (h) => i(isNaN(Number(h)) ? n : Number(h)),
1051
1049
  sx: { ".MuiTypography-Body": { p: 0 } }
1052
1050
  }
1053
1051
  )
1054
1052
  }
1055
1053
  );
1056
1054
  }), vt = () => {
1057
- const { debts: a } = C(), { totalMonthlyPayments: o } = q(), { monthlyCashFlowProfile: n } = z(), r = o + Number(n?.extra_payment);
1058
- return /* @__PURE__ */ s(g, { sx: { backgroundColor: "background.default", height: "100%" }, children: [
1059
- /* @__PURE__ */ s(g, { p: 24, children: [
1060
- /* @__PURE__ */ s(g, { alignItems: "center", gap: 4, mb: 24, children: [
1055
+ const { debts: a } = C(), { totalMonthlyPayments: o } = q(), { monthlyCashFlowProfile: r } = z(), t = o + Number(r?.extra_payment);
1056
+ return /* @__PURE__ */ s(x, { sx: { backgroundColor: "background.default", height: "100%" }, children: [
1057
+ /* @__PURE__ */ s(x, { p: 24, children: [
1058
+ /* @__PURE__ */ s(x, { alignItems: "center", gap: 4, mb: 24, children: [
1061
1059
  /* @__PURE__ */ e(l, { variant: "Body", children: a.paydown_drawer_mimimum_label }),
1062
1060
  /* @__PURE__ */ e(l, { bold: !0, variant: "H1", children: P(o, "0,0") }),
1063
1061
  /* @__PURE__ */ e(l, { textAlign: "center", truncate: !1, variant: "Small", width: 208, children: a.paydown_drawer_minimum_info })
1064
1062
  ] }),
1065
- /* @__PURE__ */ s(g, { children: [
1063
+ /* @__PURE__ */ s(x, { children: [
1066
1064
  /* @__PURE__ */ e(l, { variant: "H3", children: a.paydown_drawer_subtitle }),
1067
1065
  /* @__PURE__ */ e(l, { truncate: !1, variant: "ParagraphSmall", children: a.paydown_drawer_description })
1068
1066
  ] })
1069
1067
  ] }),
1070
- /* @__PURE__ */ e(g, { sx: { backgroundColor: "background.paper" }, children: /* @__PURE__ */ e(Dt, {}) }),
1071
- /* @__PURE__ */ e(g, { flexDirection: "row-reverse", px: 24, py: 12, children: /* @__PURE__ */ s(g, { gap: 4, children: [
1068
+ /* @__PURE__ */ e(x, { sx: { backgroundColor: "background.paper" }, children: /* @__PURE__ */ e(Dt, {}) }),
1069
+ /* @__PURE__ */ e(x, { flexDirection: "row-reverse", px: 24, py: 12, children: /* @__PURE__ */ s(x, { gap: 4, children: [
1072
1070
  /* @__PURE__ */ e(l, { variant: "Small", children: a.paydown_drawer_total_payment }),
1073
- /* @__PURE__ */ e(l, { bold: !0, textAlign: "right", variant: "Body", children: P(r, "0,0") })
1071
+ /* @__PURE__ */ e(l, { bold: !0, textAlign: "right", variant: "Body", children: P(t, "0,0") })
1074
1072
  ] }) })
1075
1073
  ] });
1076
- }, Tt = S(vt), At = ({ isOpen: a, onClose: o, sx: n }) => {
1074
+ }, Tt = S(vt), At = ({ isOpen: a, onClose: o }) => {
1077
1075
  const { debts: r } = C();
1078
1076
  return /* @__PURE__ */ e(
1079
1077
  te,
@@ -1081,19 +1079,18 @@ const ge = ({
1081
1079
  ariaLabelClose: r.paydown_drawer_close_aria,
1082
1080
  isOpen: a,
1083
1081
  onClose: o,
1084
- sx: { ...n },
1085
1082
  title: r.paydown_drawer_title,
1086
1083
  children: /* @__PURE__ */ e(Tt, {})
1087
1084
  }
1088
1085
  );
1089
1086
  };
1090
1087
  function Et(a, o) {
1091
- const n = (r) => {
1092
- if (typeof r == "number") return r;
1093
- if (r === "!" || r === "✓") return 1 / 0;
1088
+ const r = (t) => {
1089
+ if (typeof t == "number") return t;
1090
+ if (t === "!" || t === "✓") return 1 / 0;
1094
1091
  throw new Error("Unsupported value");
1095
1092
  };
1096
- return n(a) - n(o);
1093
+ return r(a) - r(o);
1097
1094
  }
1098
1095
  function It(a) {
1099
1096
  return a.is_paid_off ? "✓" : a.priority === void 0 || a.is_impossible ? "!" : a.priority;
@@ -1105,7 +1102,7 @@ const Bt = (a) => {
1105
1102
  };
1106
1103
  return a === "!" && (o.text = "#FFFFFF", o.background = "#DF320C"), a === "✓" && (o.text = "#FFFFFF", o.background = "#09A57F"), o;
1107
1104
  }, Mt = (a) => {
1108
- const o = String(a.formattedValue), n = Bt(o);
1105
+ const o = String(a.formattedValue), r = Bt(o);
1109
1106
  return /* @__PURE__ */ e(
1110
1107
  re,
1111
1108
  {
@@ -1117,15 +1114,15 @@ const Bt = (a) => {
1117
1114
  // Adjust the size as needed
1118
1115
  height: 20,
1119
1116
  borderRadius: "50%",
1120
- backgroundColor: n.background,
1117
+ backgroundColor: r.background,
1121
1118
  marginLeft: "10px"
1122
1119
  },
1123
- children: /* @__PURE__ */ e(l, { color: n.text, fontWeight: 700, variant: "Small", children: o })
1120
+ children: /* @__PURE__ */ e(l, { color: r.text, fontWeight: 700, variant: "Small", children: o })
1124
1121
  }
1125
1122
  );
1126
1123
  }, Pt = (a) => {
1127
- const o = a.row.account, n = Ke[o.account_type];
1128
- return /* @__PURE__ */ s(g, { alignItems: "center", flexDirection: "row", children: [
1124
+ const o = a.row.account, r = Ke[o.account_type];
1125
+ return /* @__PURE__ */ s(x, { alignItems: "center", flexDirection: "row", children: [
1129
1126
  /* @__PURE__ */ e(
1130
1127
  ve,
1131
1128
  {
@@ -1133,24 +1130,24 @@ const Bt = (a) => {
1133
1130
  institutionGuid: o.institution_guid || ""
1134
1131
  }
1135
1132
  ),
1136
- /* @__PURE__ */ s(g, { ml: 12, children: [
1133
+ /* @__PURE__ */ s(x, { ml: 12, children: [
1137
1134
  /* @__PURE__ */ e(l, { variant: "Small", children: o.name }),
1138
- /* @__PURE__ */ e(l, { variant: "XSmall", children: n })
1135
+ /* @__PURE__ */ e(l, { variant: "XSmall", children: r })
1139
1136
  ] })
1140
1137
  ] });
1141
1138
  }, kt = ({
1142
1139
  sx: a = {},
1143
1140
  debts: o,
1144
- hoveredDebtGuid: n,
1145
- onHoverRow: r,
1146
- onClickRow: t
1141
+ hoveredDebtGuid: r,
1142
+ onHoverRow: t,
1143
+ onClickRow: n
1147
1144
  }) => {
1148
- const i = j(), { onEvent: c } = k(), { isMobile: p } = X(), { debts: d } = C(), [h, m] = x.useState([
1145
+ const i = j(), { onEvent: p } = k(), { isMobile: d } = X(), { debts: c } = C(), [h, m] = g.useState([
1149
1146
  { field: "priority", sort: "asc" }
1150
1147
  ]), y = [
1151
1148
  {
1152
1149
  field: "priority",
1153
- headerName: d.table_column_priority,
1150
+ headerName: c.table_column_priority,
1154
1151
  renderHeader: G,
1155
1152
  renderCell: Mt,
1156
1153
  sortComparator: Et,
@@ -1159,41 +1156,41 @@ const Bt = (a) => {
1159
1156
  type: "custom",
1160
1157
  align: "left",
1161
1158
  headerAlign: "left",
1162
- minWidth: p ? 67 : 72,
1163
- flex: p ? 0.2 : 0.4
1159
+ minWidth: d ? 67 : 72,
1160
+ flex: d ? 0.2 : 0.4
1164
1161
  },
1165
1162
  {
1166
1163
  field: "account",
1167
- headerName: d.table_column_account,
1164
+ headerName: c.table_column_account,
1168
1165
  renderHeader: G,
1169
1166
  renderCell: Pt,
1170
1167
  sortable: !1,
1171
1168
  type: "custom",
1172
1169
  align: "left",
1173
1170
  headerAlign: "left",
1174
- minWidth: p ? 180 : 225,
1171
+ minWidth: d ? 180 : 225,
1175
1172
  flex: 1
1176
1173
  },
1177
1174
  {
1178
1175
  field: "balance",
1179
- headerName: d.table_column_balance,
1176
+ headerName: c.table_column_balance,
1180
1177
  renderHeader: G,
1181
1178
  valueFormatter: (u) => P(u, "0,0"),
1182
1179
  sortable: !0,
1183
- hideSortIcons: p,
1180
+ hideSortIcons: d,
1184
1181
  type: "number",
1185
- align: p ? "right" : "left",
1186
- headerAlign: p ? "right" : "left",
1187
- minWidth: p ? 70 : 122,
1188
- flex: p ? 0.4 : 0.6
1182
+ align: d ? "right" : "left",
1183
+ headerAlign: d ? "right" : "left",
1184
+ minWidth: d ? 70 : 122,
1185
+ flex: d ? 0.4 : 0.6
1189
1186
  },
1190
1187
  {
1191
1188
  field: "interest_rate",
1192
- headerName: d.table_column_interest_rate,
1189
+ headerName: c.table_column_interest_rate,
1193
1190
  renderHeader: G,
1194
1191
  valueFormatter: (u) => isNaN(u) ? "---" : `${Number(u).toFixed(2)}%`,
1195
1192
  sortable: !0,
1196
- hideSortIcons: p,
1193
+ hideSortIcons: d,
1197
1194
  type: "number",
1198
1195
  align: "left",
1199
1196
  headerAlign: "left",
@@ -1202,11 +1199,11 @@ const Bt = (a) => {
1202
1199
  },
1203
1200
  {
1204
1201
  field: "projected_payoff_date",
1205
- headerName: d.table_column_payoff_date,
1202
+ headerName: c.table_column_payoff_date,
1206
1203
  renderHeader: G,
1207
1204
  valueFormatter: (u) => u ? K(u, U.MONTH_SHORT_YEAR) : "---",
1208
1205
  sortable: !0,
1209
- hideSortIcons: p,
1206
+ hideSortIcons: d,
1210
1207
  type: "number",
1211
1208
  align: "left",
1212
1209
  headerAlign: "left",
@@ -1215,11 +1212,11 @@ const Bt = (a) => {
1215
1212
  },
1216
1213
  {
1217
1214
  field: "monthly_payment",
1218
- headerName: d.table_column_amount_due,
1215
+ headerName: c.table_column_amount_due,
1219
1216
  renderHeader: G,
1220
1217
  valueFormatter: (u) => typeof u == "number" ? P(u, "0,0") : "---",
1221
1218
  sortable: !0,
1222
- hideSortIcons: p,
1219
+ hideSortIcons: d,
1223
1220
  type: "number",
1224
1221
  align: "left",
1225
1222
  headerAlign: "left",
@@ -1240,13 +1237,13 @@ const Bt = (a) => {
1240
1237
  headerAlign: "right",
1241
1238
  width: 20
1242
1239
  }
1243
- ], D = x.useMemo(() => o.map((u, I) => ({
1240
+ ], D = g.useMemo(() => o.map((u, I) => ({
1244
1241
  ...u,
1245
1242
  id: I,
1246
1243
  priority: It(u)
1247
1244
  })), [o]), E = (u) => {
1248
1245
  const Y = u.target.closest("[data-id]")?.getAttribute("data-id"), b = o[Number(Y)];
1249
- r?.(b?.guid ?? "");
1246
+ t?.(b?.guid ?? "");
1250
1247
  }, v = (u) => D.find((I) => I.guid === u)?.id;
1251
1248
  return /* @__PURE__ */ e(
1252
1249
  re,
@@ -1262,29 +1259,29 @@ const Bt = (a) => {
1262
1259
  children: /* @__PURE__ */ e(
1263
1260
  Ye,
1264
1261
  {
1265
- columns: p ? f : y,
1262
+ columns: d ? f : y,
1266
1263
  disableColumnFilter: !0,
1267
1264
  disableColumnMenu: !0,
1268
1265
  hideFooter: !0,
1269
1266
  initialState: { sorting: { sortModel: h } },
1270
1267
  onRowClick: (u) => {
1271
- t(), c(T.DEBTS_CLICK_TABLE_ROW, { account_guid: u.row.guid });
1268
+ n(), p(T.DEBTS_CLICK_TABLE_ROW, { account_guid: u.row.guid });
1272
1269
  },
1273
1270
  onSortModelChange: (u) => {
1274
- m(u), c(T.DEBTS_CLICK_TABLE_SORT);
1271
+ m(u), p(T.DEBTS_CLICK_TABLE_SORT);
1275
1272
  },
1276
1273
  rows: D,
1277
1274
  slotProps: {
1278
1275
  baseIconButton: { color: "secondary", sx: { ml: 8 } },
1279
1276
  row: {
1280
1277
  onMouseEnter: E,
1281
- onMouseLeave: () => r?.("")
1278
+ onMouseLeave: () => t?.("")
1282
1279
  }
1283
1280
  },
1284
1281
  sortModel: h,
1285
1282
  sortingOrder: ["asc", "desc"],
1286
1283
  sx: {
1287
- [`& .MuiDataGrid-row[data-id="${v(n)}"]`]: {
1284
+ [`& .MuiDataGrid-row[data-id="${v(r)}"]`]: {
1288
1285
  backgroundColor: i.palette.mode === "light" ? "#f8f9fb" : "#1f2329",
1289
1286
  filter: "brightness(98%)"
1290
1287
  }
@@ -1293,16 +1290,16 @@ const Bt = (a) => {
1293
1290
  )
1294
1291
  }
1295
1292
  );
1296
- }, Ft = ({ buttonText: a, isOpen: o, onClick: n }) => {
1297
- const { isDesktop: r, isTablet: t } = X(), i = o ? "unfold_less" : "unfold_more";
1298
- return r || t ? /* @__PURE__ */ e(
1293
+ }, Ft = ({ buttonText: a, isOpen: o, onClick: r }) => {
1294
+ const { isDesktop: t, isTablet: n } = X(), i = o ? "unfold_less" : "unfold_more";
1295
+ return t || n ? /* @__PURE__ */ e(
1299
1296
  fe,
1300
1297
  {
1301
1298
  "aria-controls": "prioritize-debts",
1302
1299
  "aria-describedby": "prioritize-debts",
1303
1300
  "aria-haspopup": !0,
1304
1301
  "aria-label": "prioritize-debts",
1305
- onClick: n,
1302
+ onClick: r,
1306
1303
  startIcon: /* @__PURE__ */ e(ee, { name: i }),
1307
1304
  sx: { justifyContent: "start", minWidth: 214, mx: 4 },
1308
1305
  children: a
@@ -1314,30 +1311,30 @@ const Bt = (a) => {
1314
1311
  "aria-describedby": "prioritize-debts",
1315
1312
  "aria-haspopup": !0,
1316
1313
  "aria-label": "prioritize-debts",
1317
- onClick: n,
1314
+ onClick: r,
1318
1315
  children: /* @__PURE__ */ e(ee, { name: i })
1319
1316
  }
1320
1317
  );
1321
1318
  }, Nt = S(({ buttonEl: a, onClose: o }) => {
1322
- const { onEvent: n } = k(), { debts: r } = C(), { selectedDebtPriority: t, setSelectedDebtPriority: i } = R(), c = !!a, p = [
1319
+ const { onEvent: r } = k(), { debts: t } = C(), { selectedDebtPriority: n, setSelectedDebtPriority: i } = R(), p = !!a, d = [
1323
1320
  {
1324
1321
  priority: M.FASTEST_PAYOFF_FIRST,
1325
- text: r.priority_sort_fastest_payoff
1322
+ text: t.priority_sort_fastest_payoff
1326
1323
  },
1327
1324
  {
1328
1325
  priority: M.HIGHEST_INTEREST,
1329
- text: r.priority_sort_highest_interest
1326
+ text: t.priority_sort_highest_interest
1330
1327
  },
1331
1328
  {
1332
1329
  priority: M.LOWEST_BALANCE,
1333
- text: r.priority_sort_lowest_balance
1330
+ text: t.priority_sort_lowest_balance
1334
1331
  },
1335
1332
  {
1336
1333
  priority: M.HIGHEST_BALANCE,
1337
- text: r.priority_sort_highest_balance
1334
+ text: t.priority_sort_highest_balance
1338
1335
  }
1339
- ], d = (h) => {
1340
- i(h), n(T.DEBTS_CLICK_PRIORITY, { debts_priority: h });
1336
+ ], c = (h) => {
1337
+ i(h), r(T.DEBTS_CLICK_PRIORITY, { debts_priority: h });
1341
1338
  };
1342
1339
  return /* @__PURE__ */ e(
1343
1340
  Ze,
@@ -1349,18 +1346,18 @@ const Bt = (a) => {
1349
1346
  },
1350
1347
  id: "prioritize-debts",
1351
1348
  onClose: o,
1352
- open: c,
1349
+ open: p,
1353
1350
  transformOrigin: {
1354
1351
  vertical: "top",
1355
1352
  horizontal: "left"
1356
1353
  },
1357
- children: /* @__PURE__ */ e(_e, { children: p.map(({ priority: h, text: m }) => /* @__PURE__ */ s(
1354
+ children: /* @__PURE__ */ e(_e, { children: d.map(({ priority: h, text: m }) => /* @__PURE__ */ s(
1358
1355
  qe,
1359
1356
  {
1360
- onClick: () => d(h),
1357
+ onClick: () => c(h),
1361
1358
  sx: {
1362
- bgcolor: t === h ? "primary.main" : void 0,
1363
- color: t === h ? "#fff" : void 0,
1359
+ bgcolor: n === h ? "primary.main" : void 0,
1360
+ color: n === h ? "#fff" : void 0,
1364
1361
  justifyContent: "space-between",
1365
1362
  minHeight: 44,
1366
1363
  minWidth: 268,
@@ -1374,7 +1371,7 @@ const Bt = (a) => {
1374
1371
  },
1375
1372
  children: [
1376
1373
  /* @__PURE__ */ e(l, { color: "inherit", variant: "Small", children: m }),
1377
- t === h && /* @__PURE__ */ e(ye, { color: "inherit", filled: !0, fontSize: "small" })
1374
+ n === h && /* @__PURE__ */ e(ye, { color: "inherit", filled: !0, fontSize: "small" })
1378
1375
  ]
1379
1376
  },
1380
1377
  h
@@ -1382,59 +1379,59 @@ const Bt = (a) => {
1382
1379
  }
1383
1380
  );
1384
1381
  }), Rt = S(() => {
1385
- const { onEvent: a } = k(), { debts: o } = C(), { selectedDebtPriority: n } = R(), [r, t] = x.useState(null), i = (h) => {
1386
- t(h.currentTarget), a(T.DEBTS_CLICK_PRIORITIZE);
1387
- }, c = () => {
1388
- t(null);
1389
- }, p = !!r, d = x.useMemo(() => ({
1382
+ const { onEvent: a } = k(), { debts: o } = C(), { selectedDebtPriority: r } = R(), [t, n] = g.useState(null), i = (h) => {
1383
+ n(h.currentTarget), a(T.DEBTS_CLICK_PRIORITIZE);
1384
+ }, p = () => {
1385
+ n(null);
1386
+ }, d = !!t, c = g.useMemo(() => ({
1390
1387
  [M.FASTEST_PAYOFF_FIRST]: o.priority_sort_fastest_payoff,
1391
1388
  [M.HIGHEST_INTEREST]: o.priority_sort_highest_interest,
1392
1389
  [M.HIGHEST_BALANCE]: o.priority_sort_highest_balance,
1393
1390
  [M.LOWEST_BALANCE]: o.priority_sort_lowest_balance
1394
- })[n] ?? o.priority_sort_lowest_balance, [n]);
1391
+ })[r] ?? o.priority_sort_lowest_balance, [r]);
1395
1392
  return /* @__PURE__ */ s(_, { children: [
1396
- /* @__PURE__ */ e(Ft, { buttonText: d, isOpen: p, onClick: i }),
1397
- /* @__PURE__ */ e(Nt, { buttonEl: r, onClose: c })
1393
+ /* @__PURE__ */ e(Ft, { buttonText: c, isOpen: d, onClick: i }),
1394
+ /* @__PURE__ */ e(Nt, { buttonEl: t, onClose: p })
1398
1395
  ] });
1399
- }), Lt = (a, o, n = 0) => {
1400
- const r = a.map((d) => ({ ...d }));
1401
- xe(r, o);
1402
- const t = /* @__PURE__ */ new Date(), i = [];
1403
- let c = 0, p = 1;
1404
- for (const d of r)
1396
+ }), Lt = (a, o, r = 0) => {
1397
+ const t = a.map((c) => ({ ...c }));
1398
+ ge(t, o);
1399
+ const n = /* @__PURE__ */ new Date(), i = [];
1400
+ let p = 0, d = 1;
1401
+ for (const c of t)
1405
1402
  i.push({
1406
- ...d,
1403
+ ...c,
1407
1404
  // Start with the initial balance
1408
- dataset: [{ x: new Date(t), y: d.balance }]
1405
+ dataset: [{ x: new Date(n), y: c.balance }]
1409
1406
  });
1410
- for (; r.some((d) => d.balance >= 0.01 && !d.is_impossible); ) {
1411
- let d = !1;
1412
- for (const [h, m] of r.entries()) {
1407
+ for (; t.some((c) => c.balance >= 0.01 && !c.is_impossible); ) {
1408
+ let c = !1;
1409
+ for (const [h, m] of t.entries()) {
1413
1410
  if (m.balance <= 0.01) continue;
1414
1411
  const y = i[h].dataset, D = (m.interest_rate ?? 0) / 100 / 12, E = m.balance * D;
1415
1412
  let v = m.monthly_payment ?? 0;
1416
- h === 0 && (v += n), m.balance += E;
1417
- const u = Math.min(m.balance, v + c);
1413
+ h === 0 && (v += r), m.balance += E;
1414
+ const u = Math.min(m.balance, v + p);
1418
1415
  if (u <= E) {
1419
- m.is_impossible = !0, i[h].is_impossible = !0, i[h].priority = void 0, y.push({ x: new Date(t), y: m.balance });
1416
+ m.is_impossible = !0, i[h].is_impossible = !0, i[h].priority = void 0, y.push({ x: new Date(n), y: m.balance });
1420
1417
  continue;
1421
1418
  }
1422
1419
  m.balance -= u, m.balance = m.balance < 0.01 ? 0 : m.balance, y.push({
1423
- x: new Date(t),
1420
+ x: new Date(n),
1424
1421
  y: Math.max(0, m.balance),
1425
1422
  payment: u,
1426
- extra: c
1427
- }), m.balance <= 0 && (c += v, i[h].projected_payoff_date = new Date(t)), u > 0 && (d = !0);
1423
+ extra: p
1424
+ }), m.balance <= 0 && (p += v, i[h].projected_payoff_date = new Date(n)), u > 0 && (c = !0);
1428
1425
  }
1429
- d && t.setMonth(t.getMonth() + 1);
1426
+ c && n.setMonth(n.getMonth() + 1);
1430
1427
  }
1431
- return i.forEach((d) => {
1432
- (d.interest_rate === void 0 || d.interest_rate === void 0) && (d.projected_payoff_date = void 0);
1433
- }), i.forEach((d) => {
1434
- d.priority = !d.is_paid_off && !d.is_impossible ? p++ : void 0;
1428
+ return i.forEach((c) => {
1429
+ (c.interest_rate === void 0 || c.interest_rate === void 0) && (c.projected_payoff_date = void 0);
1430
+ }), i.forEach((c) => {
1431
+ c.priority = !c.is_paid_off && !c.is_impossible ? d++ : void 0;
1435
1432
  }), i;
1436
1433
  }, $t = S(({ onClick: a }) => {
1437
- const { debts: o } = C(), { isDesktop: n } = X(), { totalMonthlyPayments: r } = q(), { monthlyCashFlowProfile: t } = z(), i = r + Number(t?.extra_payment), c = n ? o.paydown_button_long : o.paydown_button_short;
1434
+ const { debts: o } = C(), { isDesktop: r } = X(), { totalMonthlyPayments: t } = q(), { monthlyCashFlowProfile: n } = z(), i = t + Number(n?.extra_payment), p = r ? o.paydown_button_long : o.paydown_button_short;
1438
1435
  return /* @__PURE__ */ e(
1439
1436
  fe,
1440
1437
  {
@@ -1444,26 +1441,26 @@ const Bt = (a) => {
1444
1441
  "aria-label": "extra-paydown",
1445
1442
  onClick: a,
1446
1443
  sx: { justifyContent: "start", minWidth: 100, mx: 4 },
1447
- children: A(c, P(i, "0,0"))
1444
+ children: A(p, P(i, "0,0"))
1448
1445
  }
1449
1446
  );
1450
1447
  }), Ht = ({ onBackClick: a, sx: o }) => {
1451
- const [n, r] = x.useState(!1), [t, i] = x.useState(!1), [c, p] = x.useState(!1), [d, h] = x.useState(""), { isDesktop: m, isMobile: y } = X(), { debts: f } = C(), { onEvent: D } = k(), { isCopyLoaded: E, isInitialized: v, setSelectedAccounts: u } = Pe(), { setSelectedAccount: I } = Fe(), { selectedDebtPriority: V, setSelectedDebtChartData: Y } = R(), { visibleDebtAccounts: b } = Z(), { goalsLoaded: w, loadGoals: B, monthlyCashFlowProfile: F } = z(), { debts: N } = q(), $ = x.useMemo(() => {
1448
+ const [r, t] = g.useState(!1), [n, i] = g.useState(!1), [p, d] = g.useState(!1), [c, h] = g.useState(""), { isDesktop: m, isMobile: y } = X(), { debts: f } = C(), { onEvent: D } = k(), { isCopyLoaded: E, isInitialized: v, setSelectedAccounts: u } = Pe(), { setSelectedAccount: I } = Fe(), { selectedDebtPriority: V, setSelectedDebtChartData: Y } = R(), { visibleDebtAccounts: b } = Z(), { goalsLoaded: w, loadGoals: B, monthlyCashFlowProfile: F } = z(), { debts: N } = q(), $ = g.useMemo(() => {
1452
1449
  const H = F?.extra_payment ?? 0;
1453
1450
  return Lt(N, V, H);
1454
1451
  }, [N, V, F]);
1455
- x.useEffect(() => {
1452
+ g.useEffect(() => {
1456
1453
  u(b), D(T.DEBTS_VIEW);
1457
- }, []), x.useEffect(() => {
1454
+ }, []), g.useEffect(() => {
1458
1455
  u(b);
1459
- }, [b]), x.useEffect(() => {
1456
+ }, [b]), g.useEffect(() => {
1460
1457
  v && B().finally();
1461
1458
  }, [v]);
1462
1459
  const oe = (H) => h(H), ne = () => {
1463
- const H = b.find((Q) => Q.guid === d), ie = $.find((Q) => Q.guid === d);
1464
- H && I(H), ie && Y(ie), r(!0);
1460
+ const H = b.find((Q) => Q.guid === c), ie = $.find((Q) => Q.guid === c);
1461
+ H && I(H), ie && Y(ie), t(!0);
1465
1462
  }, we = () => D(T.DEBTS_CLICK_FILTER), Ce = () => {
1466
- p(!0), D(T.DEBTS_CLICK_SNOWBALL_CTA);
1463
+ d(!0), D(T.DEBTS_CLICK_SNOWBALL_CTA);
1467
1464
  }, Se = () => {
1468
1465
  i(!0), D(T.DEBTS_CLICK_PAYDOWN);
1469
1466
  };
@@ -1480,9 +1477,9 @@ const Bt = (a) => {
1480
1477
  sx: o,
1481
1478
  title: f.title,
1482
1479
  children: [
1483
- /* @__PURE__ */ s(g, { sx: { px: m ? "48px" : "24px" }, children: [
1480
+ /* @__PURE__ */ s(x, { sx: { px: m ? "48px" : "24px" }, children: [
1484
1481
  /* @__PURE__ */ s(
1485
- g,
1482
+ x,
1486
1483
  {
1487
1484
  sx: {
1488
1485
  alignItems: y ? "flex-start" : "flex-end",
@@ -1491,11 +1488,11 @@ const Bt = (a) => {
1491
1488
  },
1492
1489
  children: [
1493
1490
  /* @__PURE__ */ e(
1494
- ge,
1491
+ xe,
1495
1492
  {
1496
1493
  debts: $,
1497
1494
  height: y ? 250 : void 0,
1498
- hoveredDebtGuid: d,
1495
+ hoveredDebtGuid: c,
1499
1496
  onClickArea: ne,
1500
1497
  onHoverArea: oe,
1501
1498
  sx: { mr: y ? "4px" : "-48px" }
@@ -1512,11 +1509,11 @@ const Bt = (a) => {
1512
1509
  ]
1513
1510
  }
1514
1511
  ),
1515
- /* @__PURE__ */ e(g, { sx: { mx: y ? "-24px" : 0 }, children: /* @__PURE__ */ e(
1512
+ /* @__PURE__ */ e(x, { sx: { mx: y ? "-24px" : 0 }, children: /* @__PURE__ */ e(
1516
1513
  kt,
1517
1514
  {
1518
1515
  debts: $,
1519
- hoveredDebtGuid: d,
1516
+ hoveredDebtGuid: c,
1520
1517
  onClickRow: ne,
1521
1518
  onHoverRow: oe
1522
1519
  }
@@ -1525,18 +1522,18 @@ const Bt = (a) => {
1525
1522
  /* @__PURE__ */ e(
1526
1523
  lt,
1527
1524
  {
1528
- isOpen: c,
1529
- onClose: () => p(!1)
1525
+ isOpen: p,
1526
+ onClose: () => d(!1)
1530
1527
  }
1531
1528
  ),
1532
- /* @__PURE__ */ e(St, { isOpen: n, onClose: () => r(!1) }),
1533
- /* @__PURE__ */ e(At, { isOpen: t, onClose: () => i(!1) })
1529
+ /* @__PURE__ */ e(St, { isOpen: r, onClose: () => t(!1) }),
1530
+ /* @__PURE__ */ e(At, { isOpen: n, onClose: () => i(!1) })
1534
1531
  ]
1535
1532
  }
1536
1533
  );
1537
1534
  }, Pr = S(Ht);
1538
1535
  export {
1539
- ge as DebtsChart,
1536
+ xe as DebtsChart,
1540
1537
  Nr as DebtsStore,
1541
1538
  kt as DebtsTable,
1542
1539
  Pr as DebtsWidget