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

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