@mx-cartographer/experiences 7.10.22 → 7.10.23-alpha.al0

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,73 +1,75 @@
1
- import { jsx as e, jsxs as s, Fragment as O } from "react/jsx-runtime";
2
- import g from "react";
1
+ import { jsx as e, jsxs as s, Fragment as H } from "react/jsx-runtime";
2
+ import f from "react";
3
3
  import { observer as v } from "mobx-react-lite";
4
- import f from "@mui/material/Stack";
5
- import { useTheme as V, Card as _e, Stack as _, Box as W } from "@mui/material";
6
- import { Text as l, P as ye, H3 as Te, InstitutionLogo as Ae, Icon as te } from "@mxenabled/mxui";
7
- import { intervalToDuration as Ee, formatDuration as Ie } from "date-fns";
8
- import { addMonths as se } from "date-fns/addMonths";
9
- import { fromUnixTime as ce } from "date-fns/fromUnixTime";
10
- import { getUnixTime as de } from "date-fns/getUnixTime";
11
- import { D as k, M as Be, I as Me } from "../DebtsStore-BIbOVCPe.mjs";
12
- import { a as Hr } from "../DebtsStore-BIbOVCPe.mjs";
13
- import { f as N, a as Pe } from "../NumberFormatting-DjTD0t3W.mjs";
14
- import { f as U, D as q } from "../DateFormats-Cs-NbEZ7.mjs";
15
- import { G as ke, w as Z, u as C, l as Y, g as R, d as J, b as Ne } from "../hooks-DWJQ4phS.mjs";
4
+ import x from "@mui/material/Stack";
5
+ import { useTheme as V, Card as ge, Stack as _, Box as G } from "@mui/material";
6
+ import { Text as l, P as we, H3 as ke, InstitutionLogo as Pe, Icon as ae } from "@mxenabled/mxui";
7
+ import { intervalToDuration as Ne, formatDuration as Re } from "date-fns";
8
+ import { addMonths as me } from "date-fns/addMonths";
9
+ import { fromUnixTime as he } from "date-fns/fromUnixTime";
10
+ import { getUnixTime as ue } from "date-fns/getUnixTime";
11
+ import { D as k, M as Fe, I as Le } from "../DebtsStore-BIbOVCPe.mjs";
12
+ import { a as Jr } from "../DebtsStore-BIbOVCPe.mjs";
13
+ import { f as P, a as $e } from "../NumberFormatting-DjTD0t3W.mjs";
14
+ import { f as Z, D as J } from "../DateFormats-Cs-NbEZ7.mjs";
15
+ import { G as He, w as Q, u as C, l as Y, g as R, d as ee, a as Oe, b as We } from "../hooks-DWJQ4phS.mjs";
16
16
  import { u as K } from "../useScreenSize-B6JyS_Lj.mjs";
17
- import { D as re } from "../Drawer-DV4NTsFg.mjs";
18
- import { b as I } from "../Localization-2MODESHW.mjs";
19
- import { A as Re, u as Fe } from "../AccountDetailsHeader-BQCtsUCR.mjs";
20
- import Le from "@mui/material/Card";
21
- import $e from "@mui/material/CardContent";
22
- import Oe from "@mui/material/CardHeader";
23
- import ae from "@mui/material/Box";
24
- import { useTheme as He } from "@mui/material/styles";
25
- import { LineChart as Ge } from "@mui/x-charts/LineChart";
26
- import { A as T } from "../Analytics-i5h6BxR1.mjs";
27
- import pe from "@mui/material/Tab";
28
- import We from "@mui/material/Tabs";
29
- import fe from "@mui/material/List";
17
+ import { D as oe } from "../Drawer-DV4NTsFg.mjs";
18
+ import { b as E } from "../Localization-2MODESHW.mjs";
19
+ import { A as Ge, u as je } from "../AccountDetailsHeader-BQCtsUCR.mjs";
20
+ import ze from "@mui/material/Card";
21
+ import Xe from "@mui/material/CardContent";
22
+ import Ve from "@mui/material/CardHeader";
23
+ import ne from "@mui/material/Box";
24
+ import { useTheme as Ye } from "@mui/material/styles";
25
+ import { LineChart as Ke } from "@mui/x-charts/LineChart";
26
+ import { A } from "../Analytics-i5h6BxR1.mjs";
27
+ import be from "@mui/material/Tab";
28
+ import Ue from "@mui/material/Tabs";
29
+ import Ce from "@mui/material/List";
30
30
  import j from "@mui/material/Divider";
31
- import { M as je, I as ze, O as Xe } from "../OriginalBalanceAction-BaJhCWa3.mjs";
32
- import Ve from "@mui/material/TextField";
33
- import { L as Q } from "../ListItemAction-DrDDQgt7.mjs";
34
- import { C as oe } from "../CurrencyInput-niY2izw5.mjs";
35
- import me from "@mui/material/Alert";
36
- import he from "@mui/material/AlertTitle";
37
- import ue from "@mui/material/Paper";
38
- import { Error as Ye, CheckCircle as xe } from "@mxenabled/mx-icons";
39
- import { T as be } from "../TabContentContainer-j01JYR_7.mjs";
40
- import { DataGridPro as Ke } from "@mui/x-data-grid-pro";
31
+ import { M as qe, I as Ze, O as Je } from "../OriginalBalanceAction-BaJhCWa3.mjs";
32
+ import Qe from "@mui/material/TextField";
33
+ import { L as te } from "../ListItemAction-DrDDQgt7.mjs";
34
+ import { C as ie } from "../CurrencyInput-niY2izw5.mjs";
35
+ import _e from "@mui/material/Alert";
36
+ import ye from "@mui/material/AlertTitle";
37
+ import fe from "@mui/material/Paper";
38
+ import { Error as et, CheckCircle as Se } from "@mxenabled/mx-icons";
39
+ import { T as xe } from "../TabContentContainer-j01JYR_7.mjs";
40
+ import { DataGridPro as tt } from "@mui/x-data-grid-pro";
41
41
  import { H as z } from "../HeaderCell-DjuifqHJ.mjs";
42
- import { f as Ue, A as X } from "../Account-BiB1F8lL.mjs";
43
- import ge from "@mui/material/Button";
44
- import qe from "@mui/material/IconButton";
45
- import Ze from "@mui/material/ListItem";
46
- import Je from "@mui/material/Popover";
47
- import { u as Qe } from "../useWidgetLoadTimer-BbV8q0k6.mjs";
48
- import { L as et } from "../Loader-DUaFpDGv.mjs";
49
- import { W as tt } from "../WidgetContainer-CiyWaTc1.mjs";
50
- const rt = (a, o = 0, r = 0) => {
42
+ import { f as rt, A as X } from "../Account-BiB1F8lL.mjs";
43
+ import ve from "@mui/material/Button";
44
+ import at from "@mui/material/IconButton";
45
+ import ot from "@mui/material/ListItem";
46
+ import nt from "@mui/material/Popover";
47
+ import { b as it } from "../GlobalAccountFilter-CjTLppI0.mjs";
48
+ import { u as lt } from "../useWidgetLoadTimer-BbV8q0k6.mjs";
49
+ import { L as st } from "../Loader-DUaFpDGv.mjs";
50
+ import { W as ct } from "../WidgetContainer-CiyWaTc1.mjs";
51
+ import { E as dt } from "../EmptyState-DHAkGsjk.mjs";
52
+ const pt = (a, o = 0, r = 0) => {
51
53
  if (r === 0) return 0;
52
- const t = o / (Be * Me);
54
+ const t = o / (Fe * Le);
53
55
  return Math.ceil(
54
56
  t === 0 ? a / r : -Math.log(1 - t * a / r) / Math.log(1 + t)
55
57
  );
56
- }, at = (a, o, r, t, n) => {
58
+ }, mt = (a, o, r, t, n) => {
57
59
  const i = [];
58
60
  if (r === 0) {
59
- for (let c = 0; c < a; c++) {
60
- const p = o - t * (c + 1), m = o - t * c, b = p >= 0 ? t : m;
61
+ for (let d = 0; d < a; d++) {
62
+ const p = o - t * (d + 1), m = o - t * d, u = p >= 0 ? t : m;
61
63
  i.push({
62
64
  balance: p >= 0 ? p : 0,
63
65
  interest: r,
64
- payment: b,
65
- principal: b,
66
- timestamp: de(
67
- se(
68
- ce(n),
66
+ payment: u,
67
+ principal: u,
68
+ timestamp: ue(
69
+ me(
70
+ he(n),
69
71
  // convert seconds → Date
70
- c + 1
72
+ d + 1
71
73
  // add (index + 1) months
72
74
  )
73
75
  )
@@ -75,34 +77,34 @@ const rt = (a, o = 0, r = 0) => {
75
77
  }
76
78
  return i;
77
79
  }
78
- const d = r / 1200;
79
- for (let c = 0; c < a; c++) {
80
- const p = de(se(ce(n), c + 1)), m = Math.pow(1 + d, c), b = o * m - t * ((m - 1) / d), w = Math.pow(1 + d, c + 1), u = o * w - t * ((w - 1) / d), B = t + Math.min(u, 0), P = b * d;
80
+ const c = r / 1200;
81
+ for (let d = 0; d < a; d++) {
82
+ const p = ue(me(he(n), d + 1)), m = Math.pow(1 + c, d), u = o * m - t * ((m - 1) / c), w = Math.pow(1 + c, d + 1), b = o * w - t * ((w - 1) / c), B = t + Math.min(b, 0), M = u * c;
81
83
  i.push({
82
- balance: Math.max(0, u),
83
- interest: P,
84
+ balance: Math.max(0, b),
85
+ interest: M,
84
86
  payment: B,
85
- principal: B - P,
87
+ principal: B - M,
86
88
  timestamp: p
87
89
  });
88
90
  }
89
91
  return i;
90
- }, ot = (a) => (a[a.length - 1] || {}).timestamp, nt = (a) => {
91
- const { monthly_payment: o, interest_rate: r, balance: t, payment_due_date: n } = a, i = rt(t, r ?? 0, o ?? 0), d = at(
92
+ }, ht = (a) => (a[a.length - 1] || {}).timestamp, ut = (a) => {
93
+ const { monthly_payment: o, interest_rate: r, balance: t, payment_due_date: n } = a, i = pt(t, r ?? 0, o ?? 0), c = mt(
92
94
  i,
93
95
  t,
94
96
  r ?? 0,
95
97
  o ?? 0,
96
98
  n
97
- ), c = ot(d);
99
+ ), d = ht(c);
98
100
  return {
99
101
  ...a,
100
- minimumFinalPayment: c,
101
- minimumPayments: d
102
+ minimumFinalPayment: d,
103
+ minimumPayments: c
102
104
  };
103
- }, we = (a, o) => {
105
+ }, De = (a, o) => {
104
106
  const [r, t] = a.reduce(
105
- ([n, i], d) => (d.is_paid_off || d.is_impossible ? i.push({ ...d, minimumPayments: [] }) : n.push(nt(d)), [n, i]),
107
+ ([n, i], c) => (c.is_paid_off || c.is_impossible ? i.push({ ...c, minimumPayments: [] }) : n.push(ut(c)), [n, i]),
106
108
  [[], []]
107
109
  );
108
110
  switch (o) {
@@ -123,47 +125,47 @@ const rt = (a, o = 0, r = 0) => {
123
125
  }
124
126
  a.splice(0, a.length, ...r, ...t);
125
127
  };
126
- function it(a, o, r = 0) {
127
- const t = a.map((b) => ({ ...b })).filter(
128
- (b) => b.interest_rate !== void 0 && b.monthly_payment !== void 0 && !b.is_paid_off
128
+ function bt(a, o, r = 0) {
129
+ const t = a.map((u) => ({ ...u })).filter(
130
+ (u) => u.interest_rate !== void 0 && u.monthly_payment !== void 0 && !u.is_paid_off
129
131
  );
130
- we(t, o);
132
+ De(t, o);
131
133
  let n = 0, i = 0;
132
- const d = /* @__PURE__ */ new Date(), c = /* @__PURE__ */ new Date();
133
- for (; t.some((b) => b.balance >= 0.01 && !b.is_impossible); ) {
134
- let b = !1;
135
- for (const [w, u] of t.entries()) {
136
- if (u.balance <= 0.01 || u.is_impossible) continue;
137
- const P = (u.interest_rate ?? 0) / 100 / 12, M = u.balance * P;
138
- let S = u.monthly_payment ?? 0;
139
- w === 0 && r && (S += r), u.balance += M;
140
- const A = Math.min(u.balance, S + i);
141
- if (A <= M) {
142
- u.is_impossible = !0;
134
+ const c = /* @__PURE__ */ new Date(), d = /* @__PURE__ */ new Date();
135
+ for (; t.some((u) => u.balance >= 0.01 && !u.is_impossible); ) {
136
+ let u = !1;
137
+ for (const [w, b] of t.entries()) {
138
+ if (b.balance <= 0.01 || b.is_impossible) continue;
139
+ const M = (b.interest_rate ?? 0) / 100 / 12, I = b.balance * M;
140
+ let S = b.monthly_payment ?? 0;
141
+ w === 0 && r && (S += r), b.balance += I;
142
+ const D = Math.min(b.balance, S + i);
143
+ if (D <= I) {
144
+ b.is_impossible = !0;
143
145
  continue;
144
146
  }
145
- u.balance -= A, u.balance = u.balance < 0.01 ? 0 : u.balance, n += M, u.balance <= 0 && (i += S), A > 0 && (b = !0);
147
+ b.balance -= D, b.balance = b.balance < 0.01 ? 0 : b.balance, n += I, b.balance <= 0 && (i += S), D > 0 && (u = !0);
146
148
  }
147
- b && c.setMonth(c.getMonth() + 1);
149
+ u && d.setMonth(d.getMonth() + 1);
148
150
  }
149
- const p = t.some((b) => b.is_impossible && b.balance > 0), m = Ee({ start: d, end: c });
151
+ const p = t.some((u) => u.is_impossible && u.balance > 0), m = Ne({ start: c, end: d });
150
152
  return {
151
- payoffSavings: p ? "N/A" : N(n, "0,0.00"),
152
- payoffDate: p ? "Never" : U(c, q.MONTH_YEAR),
153
- payoffDuration: p ? "Stagnant" : Ie(m, { format: ["years", "months"] }) || "0 months"
153
+ payoffSavings: p ? "N/A" : P(n, "0,0.00"),
154
+ payoffDate: p ? "Never" : Z(d, J.MONTH_YEAR),
155
+ payoffDuration: p ? "Stagnant" : Re(m, { format: ["years", "months"] }) || "0 months"
154
156
  };
155
157
  }
156
- const F = () => {
157
- if (!g.useContext(ke))
158
+ const L = () => {
159
+ if (!f.useContext(He))
158
160
  throw new Error("useCateUiStore() must be used within the GlobalDataContext");
159
- return Z().uiStore;
160
- }, lt = ({ debts: a, onClickCta: o, sx: r }) => {
161
- const t = V(), { isMobile: n } = K(), { debts: i } = C(), { selectedDebtPriority: d } = F(), { monthlyCashFlowProfile: c } = Y(), { payoffDate: p, payoffSavings: m, payoffDuration: b } = g.useMemo(() => {
162
- const w = c?.extra_payment ?? 0;
163
- return it(a, d, w);
164
- }, [a, d, c]);
161
+ return Q().uiStore;
162
+ }, _t = ({ debts: a, onClickCta: o, sx: r }) => {
163
+ const t = V(), { isMobile: n } = K(), { debts: i } = C(), { selectedDebtPriority: c } = L(), { monthlyCashFlowProfile: d } = Y(), { payoffDate: p, payoffSavings: m, payoffDuration: u } = f.useMemo(() => {
164
+ const w = d?.extra_payment ?? 0;
165
+ return bt(a, c, w);
166
+ }, [a, c, d]);
165
167
  return /* @__PURE__ */ e(
166
- _e,
168
+ ge,
167
169
  {
168
170
  sx: {
169
171
  boxShadow: t.shadows[2],
@@ -192,7 +194,7 @@ const F = () => {
192
194
  /* @__PURE__ */ e(l, { sx: { whiteSpace: "normal" }, variant: "XSmall", children: i.snowball_card_amount_description })
193
195
  ] }),
194
196
  /* @__PURE__ */ s(_, { gap: n ? "4px" : "0", children: [
195
- /* @__PURE__ */ e(l, { bold: !0, variant: "Small", children: b }),
197
+ /* @__PURE__ */ e(l, { bold: !0, variant: "Small", children: u }),
196
198
  /* @__PURE__ */ e(l, { variant: "XSmall", children: i.snowball_card_duration_description })
197
199
  ] }),
198
200
  /* @__PURE__ */ e(
@@ -209,10 +211,10 @@ const F = () => {
209
211
  ] })
210
212
  }
211
213
  );
212
- }, st = v(lt), ct = ({ isOpen: a, onClose: o }) => {
213
- const r = V(), { debts: t } = C(), [n, i] = g.useState(!1);
214
+ }, yt = v(_t), ft = ({ isOpen: a, onClose: o }) => {
215
+ const r = V(), { debts: t } = C(), [n, i] = f.useState(!1);
214
216
  return /* @__PURE__ */ e(
215
- re,
217
+ oe,
216
218
  {
217
219
  ariaLabelClose: "",
218
220
  isOpen: a,
@@ -223,10 +225,10 @@ const F = () => {
223
225
  /* @__PURE__ */ s(_, { alignItems: "center", pb: 24, children: [
224
226
  /* @__PURE__ */ e(l, { mb: 12, variant: "H3", children: t.snowball_drawer_subtitle }),
225
227
  /* @__PURE__ */ e(l, { color: r.palette.secondary.main, variant: "Small", children: t.snowball_drawer_amount_description }),
226
- /* @__PURE__ */ e(ye, { variant: "H1", children: t.snowball_drawer_savings }),
228
+ /* @__PURE__ */ e(we, { variant: "H1", children: t.snowball_drawer_savings }),
227
229
  /* @__PURE__ */ e(l, { color: r.palette.secondary.main, variant: "Small", children: t.snowball_drawer_duration_description })
228
230
  ] }),
229
- /* @__PURE__ */ s(_e, { sx: { display: "grid", py: 16, px: 24 }, children: [
231
+ /* @__PURE__ */ s(ge, { sx: { display: "grid", py: 16, px: 24 }, children: [
230
232
  /* @__PURE__ */ e(l, { mb: 4, variant: "H3", children: t.snowball_drawer_question }),
231
233
  /* @__PURE__ */ e(
232
234
  l,
@@ -263,13 +265,13 @@ const F = () => {
263
265
  }
264
266
  ),
265
267
  /* @__PURE__ */ s(_, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
266
- /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: I(t.snowball_drawer_month_header, 1) }),
268
+ /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: E(t.snowball_drawer_month_header, 1) }),
267
269
  /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: t.snowball_drawer_payment_header })
268
270
  ] }),
269
271
  /* @__PURE__ */ s(_, { bgcolor: r.palette.background.paper, mb: 24, children: [
270
272
  /* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, children: [
271
273
  /* @__PURE__ */ e(
272
- W,
274
+ G,
273
275
  {
274
276
  sx: {
275
277
  display: "flex",
@@ -296,13 +298,13 @@ const F = () => {
296
298
  },
297
299
  children: [
298
300
  /* @__PURE__ */ s(_, { flexGrow: 1, children: [
299
- /* @__PURE__ */ e(l, { variant: "Body", children: I(t.snowball_drawer_debt_label, "A") }),
301
+ /* @__PURE__ */ e(l, { variant: "Body", children: E(t.snowball_drawer_debt_label, "A") }),
300
302
  /* @__PURE__ */ s(l, { color: r.palette.secondary.main, variant: "XSmall", children: [
301
- I(
303
+ E(
302
304
  t.snowball_drawer_rollover_explainer_pt1,
303
305
  "$100"
304
306
  ),
305
- /* @__PURE__ */ e("strong", { children: I(t.snowball_drawer_debt_label, "B") }),
307
+ /* @__PURE__ */ e("strong", { children: E(t.snowball_drawer_debt_label, "B") }),
306
308
  t.snowball_drawer_rollover_explainer_pt2
307
309
  ] })
308
310
  ] }),
@@ -325,7 +327,7 @@ const F = () => {
325
327
  ] }),
326
328
  /* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, children: [
327
329
  /* @__PURE__ */ e(
328
- W,
330
+ G,
329
331
  {
330
332
  sx: {
331
333
  width: 20,
@@ -347,7 +349,7 @@ const F = () => {
347
349
  pr: 24
348
350
  },
349
351
  children: [
350
- /* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children: I(t.snowball_drawer_debt_label, "B") }),
352
+ /* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children: E(t.snowball_drawer_debt_label, "B") }),
351
353
  /* @__PURE__ */ e(l, { variant: "Body", children: "$400.00" })
352
354
  ]
353
355
  }
@@ -355,7 +357,7 @@ const F = () => {
355
357
  ] }),
356
358
  /* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, py: 14, children: [
357
359
  /* @__PURE__ */ e(
358
- W,
360
+ G,
359
361
  {
360
362
  sx: {
361
363
  width: 20,
@@ -367,7 +369,7 @@ const F = () => {
367
369
  }
368
370
  ),
369
371
  /* @__PURE__ */ s(_, { flexDirection: "row", flexGrow: 1, pr: 24, children: [
370
- /* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children: I(t.snowball_drawer_debt_label, "C") }),
372
+ /* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children: E(t.snowball_drawer_debt_label, "C") }),
371
373
  /* @__PURE__ */ e(l, { variant: "Body", children: "$1,000.00" })
372
374
  ] })
373
375
  ] }),
@@ -390,13 +392,13 @@ const F = () => {
390
392
  )
391
393
  ] }),
392
394
  /* @__PURE__ */ s(_, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
393
- /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: I(t.snowball_drawer_month_header, 2) }),
395
+ /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: E(t.snowball_drawer_month_header, 2) }),
394
396
  /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: t.snowball_drawer_payment_header })
395
397
  ] }),
396
398
  /* @__PURE__ */ s(_, { bgcolor: r.palette.background.paper, mb: 24, children: [
397
399
  /* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, children: [
398
400
  /* @__PURE__ */ e(
399
- W,
401
+ G,
400
402
  {
401
403
  sx: {
402
404
  display: "flex",
@@ -423,13 +425,13 @@ const F = () => {
423
425
  },
424
426
  children: [
425
427
  /* @__PURE__ */ s(_, { flexGrow: 1, children: [
426
- /* @__PURE__ */ e(l, { variant: "Body", children: I(t.snowball_drawer_debt_label, "B") }),
428
+ /* @__PURE__ */ e(l, { variant: "Body", children: E(t.snowball_drawer_debt_label, "B") }),
427
429
  /* @__PURE__ */ s(l, { color: r.palette.secondary.main, variant: "XSmall", children: [
428
- I(
430
+ E(
429
431
  t.snowball_drawer_rollover_explainer_pt1,
430
432
  "$500"
431
433
  ),
432
- /* @__PURE__ */ e("strong", { children: I(t.snowball_drawer_debt_label, "C") }),
434
+ /* @__PURE__ */ e("strong", { children: E(t.snowball_drawer_debt_label, "C") }),
433
435
  t.snowball_drawer_rollover_explainer_pt2
434
436
  ] })
435
437
  ] }),
@@ -452,7 +454,7 @@ const F = () => {
452
454
  ] }),
453
455
  /* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, children: [
454
456
  /* @__PURE__ */ e(
455
- W,
457
+ G,
456
458
  {
457
459
  sx: {
458
460
  width: 20,
@@ -473,7 +475,7 @@ const F = () => {
473
475
  pr: 24
474
476
  },
475
477
  children: [
476
- /* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children: I(t.snowball_drawer_debt_label, "C") }),
478
+ /* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children: E(t.snowball_drawer_debt_label, "C") }),
477
479
  /* @__PURE__ */ e(l, { variant: "Body", children: "$1,000.00" })
478
480
  ]
479
481
  }
@@ -498,13 +500,13 @@ const F = () => {
498
500
  )
499
501
  ] }),
500
502
  /* @__PURE__ */ s(_, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
501
- /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: I(t.snowball_drawer_month_header, 3) }),
503
+ /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: E(t.snowball_drawer_month_header, 3) }),
502
504
  /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: t.snowball_drawer_payment_header })
503
505
  ] }),
504
506
  /* @__PURE__ */ s(_, { bgcolor: r.palette.background.paper, mb: 24, children: [
505
507
  /* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, children: [
506
508
  /* @__PURE__ */ e(
507
- W,
509
+ G,
508
510
  {
509
511
  sx: {
510
512
  display: "flex",
@@ -530,7 +532,7 @@ const F = () => {
530
532
  pr: 24
531
533
  },
532
534
  children: [
533
- /* @__PURE__ */ e(_, { flexGrow: 1, children: /* @__PURE__ */ e(l, { variant: "Body", children: I(t.snowball_drawer_debt_label, "C") }) }),
535
+ /* @__PURE__ */ e(_, { flexGrow: 1, children: /* @__PURE__ */ e(l, { variant: "Body", children: E(t.snowball_drawer_debt_label, "C") }) }),
534
536
  /* @__PURE__ */ s(_, { children: [
535
537
  /* @__PURE__ */ e(l, { variant: "Body", children: "$1,500.00" }),
536
538
  /* @__PURE__ */ e(
@@ -570,50 +572,50 @@ const F = () => {
570
572
  ] })
571
573
  }
572
574
  );
573
- }, dt = v(ct), pt = "#FF7B08";
574
- function mt(a, o) {
575
- const [r, t, n] = a.replace(/^#/, "").match(/.{1,2}/g).map((d) => parseInt(d, 16)), i = [
575
+ }, xt = v(ft), gt = "#FF7B08";
576
+ function wt(a, o) {
577
+ const [r, t, n] = a.replace(/^#/, "").match(/.{1,2}/g).map((c) => parseInt(c, 16)), i = [
576
578
  Math.max(0, Math.min(255, Math.round(r * o))),
577
579
  Math.max(0, Math.min(255, Math.round(t * o))),
578
580
  Math.max(0, Math.min(255, Math.round(n * o)))
579
581
  ];
580
582
  return `rgb(${i[0]}, ${i[1]}, ${i[2]})`;
581
583
  }
582
- const Ce = ({
584
+ const Te = ({
583
585
  sx: a,
584
586
  height: o = 500,
585
587
  width: r,
586
588
  debts: t,
587
589
  hoveredDebtGuid: n,
588
590
  onClickArea: i,
589
- onHoverArea: d
591
+ onHoverArea: c
590
592
  }) => {
591
- const c = He(), { onEvent: p } = R(), m = t.filter((h) => !h.is_impossible), b = [
593
+ const d = Ye(), { onEvent: p } = R(), m = t.filter((h) => !h.is_impossible), u = [
592
594
  ...new Set(
593
- m.flatMap((h) => h.dataset.map((x) => new Date(x.x).getTime()))
595
+ m.flatMap((h) => h.dataset.map((g) => new Date(g.x).getTime()))
594
596
  )
595
- ].sort((h, x) => h - x).map((h) => new Date(h)), w = m.map((h) => {
596
- const x = new Map(h.dataset.map((L) => [new Date(L.x).getTime(), L.y]));
597
- let D = x.get(b[0].getTime()) ?? 0;
598
- const E = b.map((L) => {
599
- const H = x.get(L.getTime()) ?? D;
600
- return D = H, { x: L, y: H };
597
+ ].sort((h, g) => h - g).map((h) => new Date(h)), w = m.map((h) => {
598
+ const g = new Map(h.dataset.map((F) => [new Date(F.x).getTime(), F.y]));
599
+ let T = g.get(u[0].getTime()) ?? 0;
600
+ const N = u.map((F) => {
601
+ const O = g.get(F.getTime()) ?? T;
602
+ return T = O, { x: F, y: O };
601
603
  });
602
- return { ...h, dataset: E };
603
- }), u = w.reduce(
604
- (h, x) => h + (x.dataset[0]?.y ?? 0),
604
+ return { ...h, dataset: N };
605
+ }), b = w.reduce(
606
+ (h, g) => h + (g.dataset[0]?.y ?? 0),
605
607
  0
606
- ), B = b.map((h, x) => {
607
- const D = x / (b.length - 1), E = u * (1 - D);
608
- return { x: h, y: E };
609
- }), P = Math.ceil(u / 100) * 100, M = b, S = w.map((h, x) => {
610
- const D = 1 - x / w.length * 0.5, E = mt(pt, D);
608
+ ), B = u.map((h, g) => {
609
+ const T = g / (u.length - 1), N = b * (1 - T);
610
+ return { x: h, y: N };
611
+ }), M = Math.ceil(b / 100) * 100, I = u, S = w.map((h, g) => {
612
+ const T = 1 - g / w.length * 0.5, N = wt(gt, T);
611
613
  return {
612
- id: `debt-${x}`,
614
+ id: `debt-${g}`,
613
615
  guid: h.guid,
614
616
  label: h.name,
615
- data: h.dataset.map((L) => L.y),
616
- color: E,
617
+ data: h.dataset.map((F) => F.y),
618
+ color: N,
617
619
  curve: "linear",
618
620
  type: "line",
619
621
  area: !0,
@@ -625,16 +627,16 @@ const Ce = ({
625
627
  id: "payoff-line",
626
628
  label: "Payoff Line",
627
629
  data: B.map((h) => h.y),
628
- color: c.palette.grey[700],
630
+ color: d.palette.grey[700],
629
631
  curve: "linear",
630
632
  type: "line",
631
633
  stack: void 0,
632
634
  showMark: !1,
633
635
  disableHighlight: !0
634
636
  });
635
- const A = (h) => S.findIndex((x) => x?.guid === h);
637
+ const D = (h) => S.findIndex((g) => g?.guid === h);
636
638
  return /* @__PURE__ */ e(
637
- ae,
639
+ ne,
638
640
  {
639
641
  sx: {
640
642
  width: "100%",
@@ -649,21 +651,21 @@ const Ce = ({
649
651
  }
650
652
  },
651
653
  children: /* @__PURE__ */ e(
652
- Ge,
654
+ Ke,
653
655
  {
654
656
  axisHighlight: { x: "none" },
655
657
  disableLineItemHighlight: !0,
656
658
  height: o,
657
659
  hideLegend: !0,
658
660
  margin: { bottom: 24, left: 32, right: 72, top: 48 },
659
- onAreaClick: (h, x) => {
661
+ onAreaClick: (h, g) => {
660
662
  i?.();
661
- const D = S.find((E) => E.id === x.seriesId);
662
- p(T.DEBTS_CLICK_CHART_AREA, { account_guid: D?.guid });
663
+ const T = S.find((N) => N.id === g.seriesId);
664
+ p(A.DEBTS_CLICK_CHART_AREA, { account_guid: T?.guid });
663
665
  },
664
666
  onHighlightChange: (h) => {
665
- const x = S.find((D) => D.id === h?.seriesId)?.guid;
666
- d?.(x ?? "");
667
+ const g = S.find((T) => T.id === h?.seriesId)?.guid;
668
+ c?.(g ?? "");
667
669
  },
668
670
  series: S,
669
671
  skipAnimation: !0,
@@ -685,45 +687,45 @@ const Ce = ({
685
687
  strokeDasharray: "10 5",
686
688
  strokeWidth: 1
687
689
  },
688
- [`& .MuiLineElement-series-debt-${A(n ?? "0")}`]: {
690
+ [`& .MuiLineElement-series-debt-${D(n ?? "0")}`]: {
689
691
  opacity: 1
690
692
  },
691
- [`& .MuiAreaElement-series-debt-${A(n ?? "0")}`]: {
693
+ [`& .MuiAreaElement-series-debt-${D(n ?? "0")}`]: {
692
694
  opacity: 1
693
695
  },
694
696
  "& .MuiChartsAxis-tickLabel > tspan": {
695
- fontFamily: c.typography.Small.fontFamily
697
+ fontFamily: d.typography.Small.fontFamily
696
698
  },
697
699
  ...a
698
700
  },
699
701
  width: r,
700
702
  xAxis: [
701
703
  {
702
- data: M,
704
+ data: I,
703
705
  disableTicks: !0,
704
- min: b[0],
706
+ min: u[0],
705
707
  scaleType: "time",
706
708
  tickLabelMinGap: 24,
707
- valueFormatter: (h) => U(h, q.MONTH_SHORT_YEAR)
709
+ valueFormatter: (h) => Z(h, J.MONTH_SHORT_YEAR)
708
710
  }
709
711
  ],
710
712
  yAxis: [
711
713
  {
712
714
  min: 0,
713
- max: P,
715
+ max: M,
714
716
  disableTicks: !0,
715
- valueFormatter: (h) => N(h, "0a")
717
+ valueFormatter: (h) => P(h, "0a")
716
718
  }
717
719
  ]
718
720
  }
719
721
  )
720
722
  }
721
723
  );
722
- }, ht = () => {
723
- const a = V(), { debts: o } = C(), { selectedDebtChartData: r } = F();
724
- return /* @__PURE__ */ s(O, { children: [
724
+ }, Ct = () => {
725
+ const a = V(), { debts: o } = C(), { selectedDebtChartData: r } = L();
726
+ return /* @__PURE__ */ s(H, { children: [
725
727
  /* @__PURE__ */ s(
726
- Le,
728
+ ze,
727
729
  {
728
730
  sx: {
729
731
  "& .MuiCardContent-root:last-child": {
@@ -731,8 +733,8 @@ const Ce = ({
731
733
  }
732
734
  },
733
735
  children: [
734
- /* @__PURE__ */ e(Oe, { sx: { pb: 0 }, title: /* @__PURE__ */ e(Te, { sx: { pb: 4 }, children: o.details_chart_title }) }),
735
- /* @__PURE__ */ e($e, { sx: { p: 0 }, children: /* @__PURE__ */ e(Ce, { debts: [r], height: 250 }) })
736
+ /* @__PURE__ */ e(Ve, { sx: { pb: 0 }, title: /* @__PURE__ */ e(ke, { sx: { pb: 4 }, children: o.details_chart_title }) }),
737
+ /* @__PURE__ */ e(Xe, { sx: { p: 0 }, children: /* @__PURE__ */ e(Te, { debts: [r], height: 250 }) })
736
738
  ]
737
739
  }
738
740
  ),
@@ -746,9 +748,9 @@ const Ce = ({
746
748
  }
747
749
  )
748
750
  ] });
749
- }, ut = v(ht), bt = () => {
750
- const a = V(), { onEvent: o } = R(), { debts: r } = C(), { selectedDebtChartData: t, showCompleted: n, showError: i } = F();
751
- return g.useEffect(() => o(T.DEBT_SCHEDULE_VIEW), []), /* @__PURE__ */ e(fe, { children: i || n ? /* @__PURE__ */ e(
751
+ }, St = v(Ct), vt = () => {
752
+ const a = V(), { onEvent: o } = R(), { debts: r } = C(), { selectedDebtChartData: t, showCompleted: n, showError: i } = L();
753
+ return f.useEffect(() => o(A.DEBT_SCHEDULE_VIEW), []), /* @__PURE__ */ e(Ce, { children: i || n ? /* @__PURE__ */ e(
752
754
  l,
753
755
  {
754
756
  color: a.palette.secondary.main,
@@ -757,13 +759,13 @@ const Ce = ({
757
759
  variant: "Small",
758
760
  children: i ? r.schedule_error_message : r.schedule_complete_message
759
761
  }
760
- ) : /* @__PURE__ */ s(O, { children: [
761
- /* @__PURE__ */ s(f, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
762
+ ) : /* @__PURE__ */ s(H, { children: [
763
+ /* @__PURE__ */ s(x, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
762
764
  /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: r.schedule_month_heading }),
763
765
  /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: r.schedule_amount_heading })
764
766
  ] }),
765
- t.dataset.slice(1).map(({ x: d, y: c, payment: p }) => /* @__PURE__ */ e(f, { bgcolor: a.palette.background.paper, children: /* @__PURE__ */ e(f, { alignItems: "center", flexDirection: "row", pl: 24, children: /* @__PURE__ */ s(
766
- f,
767
+ t.dataset.slice(1).map(({ x: c, y: d, payment: p }) => /* @__PURE__ */ e(x, { bgcolor: a.palette.background.paper, children: /* @__PURE__ */ e(x, { alignItems: "center", flexDirection: "row", pl: 24, children: /* @__PURE__ */ s(
768
+ x,
767
769
  {
768
770
  sx: {
769
771
  borderBottom: `1px solid ${a.palette.border.light}`,
@@ -773,12 +775,12 @@ const Ce = ({
773
775
  pr: 24
774
776
  },
775
777
  children: [
776
- /* @__PURE__ */ s(f, { flexGrow: 1, children: [
777
- /* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: U(d, q.MONTH_YEAR) }),
778
+ /* @__PURE__ */ s(x, { flexGrow: 1, children: [
779
+ /* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: Z(c, J.MONTH_YEAR) }),
778
780
  /* @__PURE__ */ e(l, { color: a.palette.secondary.main, variant: "XSmall", children: r.schedule_month_label })
779
781
  ] }),
780
- /* @__PURE__ */ s(f, { children: [
781
- /* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: N(c, "0,0.00") }),
782
+ /* @__PURE__ */ s(x, { children: [
783
+ /* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: P(d, "0,0.00") }),
782
784
  /* @__PURE__ */ e(
783
785
  l,
784
786
  {
@@ -786,15 +788,15 @@ const Ce = ({
786
788
  color: a.palette.success.main,
787
789
  textAlign: "end",
788
790
  variant: "Tiny",
789
- children: `+${N(p, "0,0")}`
791
+ children: `+${P(p, "0,0")}`
790
792
  }
791
793
  )
792
794
  ] })
793
795
  ]
794
796
  }
795
- ) }) }, String(d))),
796
- /* @__PURE__ */ e(f, { bgcolor: "background.paper", children: /* @__PURE__ */ s(
797
- f,
797
+ ) }) }, String(c))),
798
+ /* @__PURE__ */ e(x, { bgcolor: "background.paper", children: /* @__PURE__ */ s(
799
+ x,
798
800
  {
799
801
  sx: {
800
802
  alignItems: "center",
@@ -810,28 +812,28 @@ const Ce = ({
810
812
  }
811
813
  ) })
812
814
  ] }) });
813
- }, _t = v(bt), yt = v(({ debt: a }) => {
814
- const { debts: o } = C(), { updateAccount: r } = J(), { onEvent: t } = R(), [n, i] = g.useState(a.interest_rate ?? 0), d = n < 0, c = async () => {
815
- await r({ ...a.account, interest_rate: n }), a.interest_rate = n, t(T.DEBTS_SAVE_RATE_ACTION, { account_guid: a.guid });
815
+ }, Dt = v(vt), Tt = v(({ debt: a }) => {
816
+ const { debts: o } = C(), { updateAccount: r } = ee(), { onEvent: t } = R(), [n, i] = f.useState(a.interest_rate ?? 0), c = n < 0, d = async () => {
817
+ await r({ ...a.account, interest_rate: n }), a.interest_rate = n, t(A.DEBTS_SAVE_RATE_ACTION, { account_guid: a.guid });
816
818
  }, p = () => {
817
819
  setTimeout(() => {
818
820
  i(a.interest_rate ?? 0);
819
821
  }, 250);
820
822
  };
821
823
  return /* @__PURE__ */ e(
822
- Q,
824
+ te,
823
825
  {
824
- isSaveDisabled: d,
826
+ isSaveDisabled: c,
825
827
  label: `${o.details_interest_rate} (%)`,
826
828
  onCancel: p,
827
- onSave: c,
829
+ onSave: d,
828
830
  primaryText: o.details_interest_rate,
829
- secondaryText: Pe(Number(a.interest_rate) / 100),
831
+ secondaryText: $e(Number(a.interest_rate) / 100),
830
832
  zeroStateText: a.interest_rate ? void 0 : o.add_interest_rate,
831
833
  children: /* @__PURE__ */ e(
832
- Ve,
834
+ Qe,
833
835
  {
834
- error: d,
836
+ error: c,
835
837
  fullWidth: !0,
836
838
  onChange: (m) => i(isNaN(parseFloat(m.target.value)) ? 0 : parseFloat(m.target.value)),
837
839
  type: "number",
@@ -840,30 +842,30 @@ const Ce = ({
840
842
  )
841
843
  }
842
844
  );
843
- }), ft = v(({ debt: a }) => {
844
- const { debts: o } = C(), { updateAccount: r } = J(), { onEvent: t } = R(), [n, i] = g.useState(a.monthly_payment ?? 0), d = n < 0 || n > 9999999999e-2, c = async () => {
845
- await r({ ...a.account, minimum_payment: n }), a.monthly_payment = n, t(T.DEBTS_SAVE_PAYMENT_ACTION, { account_guid: a.guid });
845
+ }), At = v(({ debt: a }) => {
846
+ const { debts: o } = C(), { updateAccount: r } = ee(), { onEvent: t } = R(), [n, i] = f.useState(a.monthly_payment ?? 0), c = n < 0 || n > 9999999999e-2, d = async () => {
847
+ await r({ ...a.account, minimum_payment: n }), a.monthly_payment = n, t(A.DEBTS_SAVE_PAYMENT_ACTION, { account_guid: a.guid });
846
848
  }, p = () => {
847
849
  setTimeout(() => {
848
850
  i(a.monthly_payment ?? 0);
849
851
  }, 250);
850
852
  };
851
853
  return /* @__PURE__ */ e(
852
- Q,
854
+ te,
853
855
  {
854
- isSaveDisabled: d,
856
+ isSaveDisabled: c,
855
857
  label: o.details_monthly_payment,
856
858
  onCancel: p,
857
- onSave: c,
859
+ onSave: d,
858
860
  primaryText: o.details_monthly_payment,
859
- secondaryText: N(a.monthly_payment, "0,0"),
861
+ secondaryText: P(a.monthly_payment, "0,0"),
860
862
  zeroStateText: a.monthly_payment ? void 0 : o.add_monthly_payment,
861
863
  children: /* @__PURE__ */ e(
862
- oe,
864
+ ie,
863
865
  {
864
866
  amount: n,
865
867
  autoFocus: !0,
866
- error: d,
868
+ error: c,
867
869
  fullWidth: !0,
868
870
  minAmount: 0,
869
871
  setAmount: (m) => i(isNaN(Number(m)) ? n : Number(m)),
@@ -872,30 +874,30 @@ const Ce = ({
872
874
  )
873
875
  }
874
876
  );
875
- }), xt = v(({ debt: a }) => {
876
- const { debts: o } = C(), { updateAccount: r } = J(), { onEvent: t } = R(), [n, i] = g.useState(a.original_balance ?? 0), d = n < 0 || n > 9999999999e-2, c = async () => {
877
- await r({ ...a.account, original_balance: n }), a.original_balance = n, t(T.DEBTS_SAVE_BALANCE_ACTION, { account_guid: a.guid });
877
+ }), Et = v(({ debt: a }) => {
878
+ const { debts: o } = C(), { updateAccount: r } = ee(), { onEvent: t } = R(), [n, i] = f.useState(a.original_balance ?? 0), c = n < 0 || n > 9999999999e-2, d = async () => {
879
+ await r({ ...a.account, original_balance: n }), a.original_balance = n, t(A.DEBTS_SAVE_BALANCE_ACTION, { account_guid: a.guid });
878
880
  }, p = () => {
879
881
  setTimeout(() => {
880
882
  i(a.original_balance ?? 0);
881
883
  }, 250);
882
884
  };
883
885
  return /* @__PURE__ */ e(
884
- Q,
886
+ te,
885
887
  {
886
- isSaveDisabled: d,
888
+ isSaveDisabled: c,
887
889
  label: o.details_original_balance,
888
890
  onCancel: p,
889
- onSave: c,
891
+ onSave: d,
890
892
  primaryText: o.details_original_balance,
891
- secondaryText: N(a.original_balance, "0,0"),
893
+ secondaryText: P(a.original_balance, "0,0"),
892
894
  zeroStateText: a.original_balance ? void 0 : o.add_original_balance,
893
895
  children: /* @__PURE__ */ e(
894
- oe,
896
+ ie,
895
897
  {
896
898
  amount: n,
897
899
  autoFocus: !0,
898
- error: d,
900
+ error: c,
899
901
  fullWidth: !0,
900
902
  minAmount: 0,
901
903
  setAmount: (m) => i(isNaN(Number(m)) ? n : Number(m)),
@@ -904,35 +906,35 @@ const Ce = ({
904
906
  )
905
907
  }
906
908
  );
907
- }), gt = () => {
908
- const { onEvent: a } = R(), { selectedDebtChartData: o } = F();
909
- return g.useEffect(() => a(T.DEBT_DETAILS_VIEW), []), /* @__PURE__ */ s(f, { bgcolor: "background.paper", children: [
910
- o?.goal && /* @__PURE__ */ s(O, { children: [
911
- /* @__PURE__ */ e(je, { goal: o.goal }),
909
+ }), It = () => {
910
+ const { onEvent: a } = R(), { selectedDebtChartData: o } = L();
911
+ return f.useEffect(() => a(A.DEBT_DETAILS_VIEW), []), /* @__PURE__ */ s(x, { bgcolor: "background.paper", children: [
912
+ o?.goal && /* @__PURE__ */ s(H, { children: [
913
+ /* @__PURE__ */ e(qe, { goal: o.goal }),
912
914
  /* @__PURE__ */ e(j, {}),
913
- /* @__PURE__ */ e(ze, { goal: o.goal }),
915
+ /* @__PURE__ */ e(Ze, { goal: o.goal }),
914
916
  /* @__PURE__ */ e(j, {}),
915
- /* @__PURE__ */ e(Xe, { goal: o.goal }),
917
+ /* @__PURE__ */ e(Je, { goal: o.goal }),
916
918
  /* @__PURE__ */ e(j, {})
917
919
  ] }),
918
- !o?.goal && o?.account && /* @__PURE__ */ s(O, { children: [
919
- /* @__PURE__ */ e(ft, { debt: o }),
920
+ !o?.goal && o?.account && /* @__PURE__ */ s(H, { children: [
921
+ /* @__PURE__ */ e(At, { debt: o }),
920
922
  /* @__PURE__ */ e(j, {}),
921
- /* @__PURE__ */ e(yt, { debt: o }),
923
+ /* @__PURE__ */ e(Tt, { debt: o }),
922
924
  /* @__PURE__ */ e(j, {}),
923
- /* @__PURE__ */ e(xt, { debt: o }),
925
+ /* @__PURE__ */ e(Et, { debt: o }),
924
926
  /* @__PURE__ */ e(j, {})
925
927
  ] })
926
928
  ] });
927
- }, wt = v(gt), Ct = ({ setTabValue: a, sx: o }) => {
928
- const { debts: r } = C(), { showError: t, showCompleted: n } = F();
929
- return g.useEffect(() => {
929
+ }, Bt = v(It), Mt = ({ setTabValue: a, sx: o }) => {
930
+ const { debts: r } = C(), { showError: t, showCompleted: n } = L();
931
+ return f.useEffect(() => {
930
932
  t && a(1);
931
- }, [t]), !t && !n ? /* @__PURE__ */ e(O, {}) : /* @__PURE__ */ s(f, { gap: 16, children: [
932
- /* @__PURE__ */ e(ue, { sx: { my: 16, mx: 24, ...o }, children: /* @__PURE__ */ s(
933
- me,
933
+ }, [t]), !t && !n ? /* @__PURE__ */ e(H, {}) : /* @__PURE__ */ s(x, { gap: 16, children: [
934
+ /* @__PURE__ */ e(fe, { sx: { my: 16, mx: 24, ...o }, children: /* @__PURE__ */ s(
935
+ _e,
934
936
  {
935
- icon: t ? /* @__PURE__ */ e(Ye, { filled: !0 }) : /* @__PURE__ */ e(xe, { color: "success", filled: !0 }),
937
+ icon: t ? /* @__PURE__ */ e(et, { filled: !0 }) : /* @__PURE__ */ e(Se, { color: "success", filled: !0 }),
936
938
  severity: "error",
937
939
  sx: {
938
940
  alignItems: "start",
@@ -945,15 +947,15 @@ const Ce = ({
945
947
  }
946
948
  },
947
949
  children: [
948
- /* @__PURE__ */ e(he, { sx: { fontWeight: 600, marginTop: 2 }, variant: "Body", children: t ? r.status_error_title : r.status_complete_title }),
950
+ /* @__PURE__ */ e(ye, { sx: { fontWeight: 600, marginTop: 2 }, variant: "Body", children: t ? r.status_error_title : r.status_complete_title }),
949
951
  /* @__PURE__ */ e(l, { component: "p", sx: { whiteSpace: "wrap" }, variant: "ParagraphSmall", children: t ? r.status_error_description : r.status_complete_description })
950
952
  ]
951
953
  }
952
954
  ) }),
953
- t && /* @__PURE__ */ e(ue, { sx: { mb: 16, mt: 100, mx: 24, ...o }, children: /* @__PURE__ */ s(
954
- me,
955
+ t && /* @__PURE__ */ e(fe, { sx: { mb: 16, mt: 100, mx: 24, ...o }, children: /* @__PURE__ */ s(
956
+ _e,
955
957
  {
956
- icon: /* @__PURE__ */ e(O, {}),
958
+ icon: /* @__PURE__ */ e(H, {}),
957
959
  severity: "error",
958
960
  sx: {
959
961
  borderRadius: 2,
@@ -963,28 +965,28 @@ const Ce = ({
963
965
  }
964
966
  },
965
967
  children: [
966
- /* @__PURE__ */ e(he, { sx: { fontWeight: 600, marginTop: 2 }, variant: "Body", children: r.status_info_title }),
968
+ /* @__PURE__ */ e(ye, { sx: { fontWeight: 600, marginTop: 2 }, variant: "Body", children: r.status_info_title }),
967
969
  /* @__PURE__ */ e(l, { component: "p", sx: { whiteSpace: "wrap" }, variant: "ParagraphSmall", children: r.status_info_description })
968
970
  ]
969
971
  }
970
972
  ) })
971
973
  ] });
972
- }, St = v(Ct), vt = () => {
973
- const { debts: a } = C(), { showError: o, showCompleted: r } = F(), [t, n] = g.useState(0);
974
- return /* @__PURE__ */ s(O, { children: [
975
- (o || r) && /* @__PURE__ */ e(St, { setTabValue: n, sx: { mt: -24 } }),
974
+ }, kt = v(Mt), Pt = () => {
975
+ const { debts: a } = C(), { showError: o, showCompleted: r } = L(), [t, n] = f.useState(0);
976
+ return /* @__PURE__ */ s(H, { children: [
977
+ (o || r) && /* @__PURE__ */ e(kt, { setTabValue: n, sx: { mt: -24 } }),
976
978
  /* @__PURE__ */ s(
977
- We,
979
+ Ue,
978
980
  {
979
981
  "aria-label": a.details_tabs_aria_label,
980
982
  centered: !0,
981
- onChange: (i, d) => n(d),
983
+ onChange: (i, c) => n(c),
982
984
  textColor: "primary",
983
985
  value: t,
984
986
  variant: "fullWidth",
985
987
  children: [
986
988
  /* @__PURE__ */ e(
987
- pe,
989
+ be,
988
990
  {
989
991
  "aria-controls": "debt-schedule-tabpanel-0",
990
992
  id: "debt-schedule-tab-0",
@@ -992,7 +994,7 @@ const Ce = ({
992
994
  }
993
995
  ),
994
996
  /* @__PURE__ */ e(
995
- pe,
997
+ be,
996
998
  {
997
999
  "aria-controls": "debt-details-tabpanel-1",
998
1000
  id: "debt-details-tab-1",
@@ -1002,27 +1004,27 @@ const Ce = ({
1002
1004
  ]
1003
1005
  }
1004
1006
  ),
1005
- /* @__PURE__ */ e(be, { index: 0, name: "debt-schedule", value: t, children: /* @__PURE__ */ e(_t, {}) }),
1006
- /* @__PURE__ */ e(be, { index: 1, name: "debt-details", value: t, children: /* @__PURE__ */ e(wt, {}) })
1007
+ /* @__PURE__ */ e(xe, { index: 0, name: "debt-schedule", value: t, children: /* @__PURE__ */ e(Dt, {}) }),
1008
+ /* @__PURE__ */ e(xe, { index: 1, name: "debt-details", value: t, children: /* @__PURE__ */ e(Bt, {}) })
1007
1009
  ] });
1008
- }, Dt = v(vt), Tt = ({ isOpen: a, onClose: o }) => {
1009
- const { debts: r } = C(), { showError: t, showCompleted: n } = F(), i = t || n ? /* @__PURE__ */ e(O, {}) : /* @__PURE__ */ e(ut, {});
1010
+ }, Nt = v(Pt), Rt = ({ isOpen: a, onClose: o }) => {
1011
+ const { debts: r } = C(), { showError: t, showCompleted: n } = L(), i = t || n ? /* @__PURE__ */ e(H, {}) : /* @__PURE__ */ e(St, {});
1010
1012
  return /* @__PURE__ */ e(
1011
- re,
1013
+ oe,
1012
1014
  {
1013
1015
  ariaLabelClose: r.details_close_aria,
1014
1016
  isOpen: a,
1015
1017
  onClose: o,
1016
1018
  title: r.details_title,
1017
- children: /* @__PURE__ */ s(f, { bgcolor: "background.default", children: [
1018
- /* @__PURE__ */ e(Re, { customDetailsChart: i }),
1019
- /* @__PURE__ */ e(Dt, {})
1019
+ children: /* @__PURE__ */ s(x, { bgcolor: "background.default", children: [
1020
+ /* @__PURE__ */ e(Ge, { customDetailsChart: i }),
1021
+ /* @__PURE__ */ e(Nt, {})
1020
1022
  ] })
1021
1023
  }
1022
1024
  );
1023
- }, At = v(() => {
1024
- const { debts: a } = C(), { monthlyCashFlowProfile: o, updateMonthlyCashFlowProfile: r } = Y(), { onEvent: t } = R(), [n, i] = g.useState(o?.extra_payment ?? 0), d = n < 0 || n > 9999999999e-2, c = async () => {
1025
- o && (await r({ ...o, extra_payment: n }), o.extra_payment = n, t(T.DEBTS_SAVE_PAYDOWN_ACTION, {
1025
+ }, Ft = v(() => {
1026
+ const { debts: a } = C(), { monthlyCashFlowProfile: o, updateMonthlyCashFlowProfile: r } = Y(), { onEvent: t } = R(), [n, i] = f.useState(o?.extra_payment ?? 0), c = n < 0 || n > 9999999999e-2, d = async () => {
1027
+ o && (await r({ ...o, extra_payment: n }), o.extra_payment = n, t(A.DEBTS_SAVE_PAYDOWN_ACTION, {
1026
1028
  user_guid: o?.user_guid
1027
1029
  }));
1028
1030
  }, p = () => {
@@ -1031,21 +1033,21 @@ const Ce = ({
1031
1033
  }, 250);
1032
1034
  };
1033
1035
  return /* @__PURE__ */ e(
1034
- Q,
1036
+ te,
1035
1037
  {
1036
- isSaveDisabled: d,
1038
+ isSaveDisabled: c,
1037
1039
  label: a.paydown_drawer_extra_payment,
1038
1040
  onCancel: p,
1039
- onSave: c,
1041
+ onSave: d,
1040
1042
  primaryText: a.paydown_drawer_extra_payment,
1041
- secondaryText: N(o?.extra_payment, "0,0"),
1043
+ secondaryText: P(o?.extra_payment, "0,0"),
1042
1044
  zeroStateText: o?.extra_payment ? void 0 : a.add_extra_payment,
1043
1045
  children: /* @__PURE__ */ e(
1044
- oe,
1046
+ ie,
1045
1047
  {
1046
1048
  amount: n,
1047
1049
  autoFocus: !0,
1048
- error: d,
1050
+ error: c,
1049
1051
  fullWidth: !0,
1050
1052
  minAmount: 0,
1051
1053
  setAmount: (m) => i(isNaN(Number(m)) ? n : Number(m)),
@@ -1054,40 +1056,40 @@ const Ce = ({
1054
1056
  )
1055
1057
  }
1056
1058
  );
1057
- }), Et = () => {
1058
- const { debts: a } = C(), { totalMonthlyPayments: o } = Z(), { monthlyCashFlowProfile: r } = Y(), t = o + Number(r?.extra_payment);
1059
- return /* @__PURE__ */ s(f, { sx: { backgroundColor: "background.default", height: "100%" }, children: [
1060
- /* @__PURE__ */ s(f, { p: 24, children: [
1061
- /* @__PURE__ */ s(f, { alignItems: "center", gap: 4, mb: 24, children: [
1059
+ }), Lt = () => {
1060
+ const { debts: a } = C(), { totalMonthlyPayments: o } = Q(), { monthlyCashFlowProfile: r } = Y(), t = o + Number(r?.extra_payment);
1061
+ return /* @__PURE__ */ s(x, { sx: { backgroundColor: "background.default", height: "100%" }, children: [
1062
+ /* @__PURE__ */ s(x, { p: 24, children: [
1063
+ /* @__PURE__ */ s(x, { alignItems: "center", gap: 4, mb: 24, children: [
1062
1064
  /* @__PURE__ */ e(l, { variant: "Body", children: a.paydown_drawer_mimimum_label }),
1063
- /* @__PURE__ */ e(ye, { bold: !0, variant: "H1", children: N(o, "0,0") }),
1065
+ /* @__PURE__ */ e(we, { bold: !0, variant: "H1", children: P(o, "0,0") }),
1064
1066
  /* @__PURE__ */ e(l, { textAlign: "center", truncate: !1, variant: "Small", width: 208, children: a.paydown_drawer_minimum_info })
1065
1067
  ] }),
1066
- /* @__PURE__ */ s(f, { children: [
1068
+ /* @__PURE__ */ s(x, { children: [
1067
1069
  /* @__PURE__ */ e(l, { variant: "H3", children: a.paydown_drawer_subtitle }),
1068
1070
  /* @__PURE__ */ e(l, { truncate: !1, variant: "ParagraphSmall", children: a.paydown_drawer_description })
1069
1071
  ] })
1070
1072
  ] }),
1071
- /* @__PURE__ */ e(f, { sx: { backgroundColor: "background.paper" }, children: /* @__PURE__ */ e(At, {}) }),
1072
- /* @__PURE__ */ e(f, { flexDirection: "row-reverse", px: 24, py: 12, children: /* @__PURE__ */ s(f, { gap: 4, children: [
1073
+ /* @__PURE__ */ e(x, { sx: { backgroundColor: "background.paper" }, children: /* @__PURE__ */ e(Ft, {}) }),
1074
+ /* @__PURE__ */ e(x, { flexDirection: "row-reverse", px: 24, py: 12, children: /* @__PURE__ */ s(x, { gap: 4, children: [
1073
1075
  /* @__PURE__ */ e(l, { variant: "Small", children: a.paydown_drawer_total_payment }),
1074
- /* @__PURE__ */ e(l, { bold: !0, textAlign: "right", variant: "Body", children: N(t, "0,0") })
1076
+ /* @__PURE__ */ e(l, { bold: !0, textAlign: "right", variant: "Body", children: P(t, "0,0") })
1075
1077
  ] }) })
1076
1078
  ] });
1077
- }, It = v(Et), Bt = ({ isOpen: a, onClose: o }) => {
1079
+ }, $t = v(Lt), Ht = ({ isOpen: a, onClose: o }) => {
1078
1080
  const { debts: r } = C();
1079
1081
  return /* @__PURE__ */ e(
1080
- re,
1082
+ oe,
1081
1083
  {
1082
1084
  ariaLabelClose: r.paydown_drawer_close_aria,
1083
1085
  isOpen: a,
1084
1086
  onClose: o,
1085
1087
  title: r.paydown_drawer_title,
1086
- children: /* @__PURE__ */ e(It, {})
1088
+ children: /* @__PURE__ */ e($t, {})
1087
1089
  }
1088
1090
  );
1089
1091
  };
1090
- function Mt(a, o) {
1092
+ function Ot(a, o) {
1091
1093
  const r = (t) => {
1092
1094
  if (typeof t == "number") return t;
1093
1095
  if (t === "!" || t === "✓") return 1 / 0;
@@ -1095,19 +1097,19 @@ function Mt(a, o) {
1095
1097
  };
1096
1098
  return r(a) - r(o);
1097
1099
  }
1098
- function Pt(a) {
1100
+ function Wt(a) {
1099
1101
  return a.is_paid_off ? "✓" : a.priority === void 0 || a.is_impossible ? "!" : a.priority;
1100
1102
  }
1101
- const kt = (a) => {
1103
+ const Gt = (a) => {
1102
1104
  const o = {
1103
1105
  text: "#121417",
1104
1106
  background: "#FFB252"
1105
1107
  };
1106
1108
  return a === "!" && (o.text = "#FFFFFF", o.background = "#DF320C"), a === "✓" && (o.text = "#FFFFFF", o.background = "#09A57F"), o;
1107
- }, Nt = (a) => {
1108
- const o = String(a.formattedValue), r = kt(o);
1109
+ }, jt = (a) => {
1110
+ const o = String(a.formattedValue), r = Gt(o);
1109
1111
  return /* @__PURE__ */ e(
1110
- ae,
1112
+ ne,
1111
1113
  {
1112
1114
  sx: {
1113
1115
  display: "flex",
@@ -1123,69 +1125,69 @@ const kt = (a) => {
1123
1125
  children: /* @__PURE__ */ e(l, { color: r.text, fontWeight: 700, variant: "Small", children: o })
1124
1126
  }
1125
1127
  );
1126
- }, Rt = (a) => {
1127
- const o = a.row.account, r = Ue[o.account_type];
1128
- return /* @__PURE__ */ s(f, { alignItems: "center", flexDirection: "row", children: [
1128
+ }, zt = (a) => {
1129
+ const o = a.row.account, r = rt[o.account_type];
1130
+ return /* @__PURE__ */ s(x, { alignItems: "center", flexDirection: "row", children: [
1129
1131
  /* @__PURE__ */ e(
1130
- Ae,
1132
+ Pe,
1131
1133
  {
1132
1134
  alt: `${o.institutionName}`,
1133
1135
  institutionGuid: o.institution_guid || ""
1134
1136
  }
1135
1137
  ),
1136
- /* @__PURE__ */ s(f, { ml: 12, children: [
1138
+ /* @__PURE__ */ s(x, { ml: 12, children: [
1137
1139
  /* @__PURE__ */ e(l, { variant: "Small", children: o.name }),
1138
1140
  /* @__PURE__ */ e(l, { variant: "XSmall", children: r })
1139
1141
  ] })
1140
1142
  ] });
1141
- }, Ft = ({
1143
+ }, Xt = ({
1142
1144
  sx: a = {},
1143
1145
  debts: o,
1144
1146
  hoveredDebtGuid: r,
1145
1147
  onHoverRow: t,
1146
1148
  onClickRow: n
1147
1149
  }) => {
1148
- const i = V(), { onEvent: d } = R(), { isMobile: c } = K(), { debts: p, common: m } = C(), [b, w] = g.useState([
1150
+ const i = V(), { onEvent: c } = R(), { isMobile: d } = K(), { debts: p, common: m } = C(), [u, w] = f.useState([
1149
1151
  { field: "priority", sort: "asc" }
1150
- ]), u = [
1152
+ ]), b = [
1151
1153
  {
1152
1154
  field: "priority",
1153
1155
  headerName: p.table_column_priority,
1154
1156
  renderHeader: z,
1155
- renderCell: Nt,
1156
- sortComparator: Mt,
1157
+ renderCell: jt,
1158
+ sortComparator: Ot,
1157
1159
  sortable: !0,
1158
1160
  hideSortIcons: !0,
1159
1161
  type: "custom",
1160
1162
  align: "left",
1161
1163
  headerAlign: "left",
1162
- minWidth: c ? 67 : 72,
1163
- flex: c ? 0.2 : 0.4
1164
+ minWidth: d ? 67 : 72,
1165
+ flex: d ? 0.2 : 0.4
1164
1166
  },
1165
1167
  {
1166
1168
  field: "account",
1167
1169
  headerName: p.table_column_account,
1168
1170
  renderHeader: z,
1169
- renderCell: Rt,
1171
+ renderCell: zt,
1170
1172
  sortable: !1,
1171
1173
  type: "custom",
1172
1174
  align: "left",
1173
1175
  headerAlign: "left",
1174
- minWidth: c ? 180 : 225,
1176
+ minWidth: d ? 180 : 225,
1175
1177
  flex: 1
1176
1178
  },
1177
1179
  {
1178
1180
  field: "balance",
1179
1181
  headerName: p.table_column_balance,
1180
1182
  renderHeader: z,
1181
- renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: N(y.value, "0,0") }),
1183
+ renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: P(y.value, "0,0") }),
1182
1184
  sortable: !0,
1183
- hideSortIcons: c,
1185
+ hideSortIcons: d,
1184
1186
  type: "number",
1185
1187
  align: "left",
1186
1188
  headerAlign: "left",
1187
- minWidth: c ? 70 : 122,
1188
- flex: c ? 0.4 : 0.6
1189
+ minWidth: d ? 70 : 122,
1190
+ flex: d ? 0.4 : 0.6
1189
1191
  },
1190
1192
  {
1191
1193
  field: "interest_rate",
@@ -1193,7 +1195,7 @@ const kt = (a) => {
1193
1195
  renderHeader: z,
1194
1196
  renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: isNaN(y.value) ? "---" : `${Number(y.value).toFixed(2)}%` }),
1195
1197
  sortable: !0,
1196
- hideSortIcons: c,
1198
+ hideSortIcons: d,
1197
1199
  type: "number",
1198
1200
  align: "left",
1199
1201
  headerAlign: "left",
@@ -1204,9 +1206,9 @@ const kt = (a) => {
1204
1206
  field: "projected_payoff_date",
1205
1207
  headerName: p.table_column_payoff_date,
1206
1208
  renderHeader: z,
1207
- renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: y.value ? U(y.value, q.MONTH_SHORT_YEAR) : "---" }),
1209
+ renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: y.value ? Z(y.value, J.MONTH_SHORT_YEAR) : "---" }),
1208
1210
  sortable: !0,
1209
- hideSortIcons: c,
1211
+ hideSortIcons: d,
1210
1212
  type: "number",
1211
1213
  align: "left",
1212
1214
  headerAlign: "left",
@@ -1217,9 +1219,9 @@ const kt = (a) => {
1217
1219
  field: "monthly_payment",
1218
1220
  headerName: p.table_column_amount_due,
1219
1221
  renderHeader: z,
1220
- renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: typeof y.value == "number" ? N(y.value, "0,0") : "---" }),
1222
+ renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: typeof y.value == "number" ? P(y.value, "0,0") : "---" }),
1221
1223
  sortable: !0,
1222
- hideSortIcons: c,
1224
+ hideSortIcons: d,
1223
1225
  type: "number",
1224
1226
  align: "left",
1225
1227
  headerAlign: "left",
@@ -1227,12 +1229,12 @@ const kt = (a) => {
1227
1229
  flex: 0.6
1228
1230
  }
1229
1231
  ], B = [
1230
- ...u.slice(0, 3),
1232
+ ...b.slice(0, 3),
1231
1233
  {
1232
1234
  field: "chevron",
1233
1235
  headerClassName: "chevron-header",
1234
1236
  headerName: "",
1235
- renderCell: () => /* @__PURE__ */ e(_, { "aria-label": m.see_details, role: "button", children: /* @__PURE__ */ e(te, { name: "chevron_right" }) }),
1237
+ renderCell: () => /* @__PURE__ */ e(_, { "aria-label": m.see_details, role: "button", children: /* @__PURE__ */ e(ae, { name: "chevron_right" }) }),
1236
1238
  sortable: !1,
1237
1239
  hideSortIcons: !0,
1238
1240
  type: "custom",
@@ -1240,20 +1242,20 @@ const kt = (a) => {
1240
1242
  headerAlign: "right",
1241
1243
  width: 20
1242
1244
  }
1243
- ], P = g.useMemo(() => o.map((y, h) => ({
1245
+ ], M = f.useMemo(() => o.map((y, h) => ({
1244
1246
  ...y,
1245
1247
  id: h,
1246
- priority: Pt(y)
1247
- })), [o]), M = (y) => {
1248
- const D = y.target.closest("[data-id]")?.getAttribute("data-id"), E = o[Number(D)];
1249
- t?.(E?.guid ?? "");
1248
+ priority: Wt(y)
1249
+ })), [o]), I = (y) => {
1250
+ const T = y.target.closest("[data-id]")?.getAttribute("data-id"), N = o[Number(T)];
1251
+ t?.(N?.guid ?? "");
1250
1252
  }, S = (y) => {
1251
- c || M(y);
1252
- }, A = (y) => {
1253
- c && M(y);
1254
- }, $ = (y) => P.find((h) => h.guid === y)?.id;
1253
+ d || I(y);
1254
+ }, D = (y) => {
1255
+ d && I(y);
1256
+ }, $ = (y) => M.find((h) => h.guid === y)?.id;
1255
1257
  return /* @__PURE__ */ e(
1256
- ae,
1258
+ ne,
1257
1259
  {
1258
1260
  sx: {
1259
1261
  height: "100dvh",
@@ -1264,30 +1266,30 @@ const kt = (a) => {
1264
1266
  ...a
1265
1267
  },
1266
1268
  children: /* @__PURE__ */ e(
1267
- Ke,
1269
+ tt,
1268
1270
  {
1269
- columns: c ? B : u,
1271
+ columns: d ? B : b,
1270
1272
  disableColumnFilter: !0,
1271
1273
  disableColumnMenu: !0,
1272
1274
  hideFooter: !0,
1273
- initialState: { sorting: { sortModel: b } },
1275
+ initialState: { sorting: { sortModel: u } },
1274
1276
  onRowClick: (y) => {
1275
- n(), d(T.DEBTS_CLICK_TABLE_ROW, { account_guid: y.row.guid });
1277
+ n(), c(A.DEBTS_CLICK_TABLE_ROW, { account_guid: y.row.guid });
1276
1278
  },
1277
1279
  onSortModelChange: (y) => {
1278
- w(y), d(T.DEBTS_CLICK_TABLE_SORT);
1280
+ w(y), c(A.DEBTS_CLICK_TABLE_SORT);
1279
1281
  },
1280
- rows: P,
1282
+ rows: M,
1281
1283
  slotProps: {
1282
1284
  baseIconButton: { color: "secondary", sx: { ml: 8 } },
1283
1285
  row: {
1284
1286
  onMouseEnter: S,
1285
- onMouseLeave: () => !c && t?.(""),
1286
- onTouchStart: A,
1287
- onClick: c ? A : void 0
1287
+ onMouseLeave: () => !d && t?.(""),
1288
+ onTouchStart: D,
1289
+ onClick: d ? D : void 0
1288
1290
  }
1289
1291
  },
1290
- sortModel: b,
1292
+ sortModel: u,
1291
1293
  sortingOrder: ["asc", "desc"],
1292
1294
  sx: {
1293
1295
  "& .chevron-header": { display: "none" },
@@ -1300,33 +1302,33 @@ const kt = (a) => {
1300
1302
  )
1301
1303
  }
1302
1304
  );
1303
- }, Lt = ({ buttonText: a, isOpen: o, onClick: r }) => {
1305
+ }, Vt = ({ buttonText: a, isOpen: o, onClick: r }) => {
1304
1306
  const { isDesktop: t, isTablet: n } = K(), i = o ? "unfold_less" : "unfold_more";
1305
1307
  return t || n ? /* @__PURE__ */ e(
1306
- ge,
1308
+ ve,
1307
1309
  {
1308
1310
  "aria-controls": "prioritize-debts",
1309
1311
  "aria-describedby": "prioritize-debts",
1310
1312
  "aria-haspopup": !0,
1311
1313
  "aria-label": "prioritize-debts",
1312
1314
  onClick: r,
1313
- startIcon: /* @__PURE__ */ e(te, { name: i }),
1315
+ startIcon: /* @__PURE__ */ e(ae, { name: i }),
1314
1316
  sx: { justifyContent: "start", minWidth: 214, mx: 4 },
1315
1317
  children: a
1316
1318
  }
1317
1319
  ) : /* @__PURE__ */ e(
1318
- qe,
1320
+ at,
1319
1321
  {
1320
1322
  "aria-controls": "prioritize-debts",
1321
1323
  "aria-describedby": "prioritize-debts",
1322
1324
  "aria-haspopup": !0,
1323
1325
  "aria-label": "prioritize-debts",
1324
1326
  onClick: r,
1325
- children: /* @__PURE__ */ e(te, { name: i })
1327
+ children: /* @__PURE__ */ e(ae, { name: i })
1326
1328
  }
1327
1329
  );
1328
- }, $t = v(({ buttonEl: a, onClose: o }) => {
1329
- const { onEvent: r } = R(), { debts: t } = C(), { selectedDebtPriority: n, setSelectedDebtPriority: i } = F(), d = !!a, c = [
1330
+ }, Yt = v(({ buttonEl: a, onClose: o }) => {
1331
+ const { onEvent: r } = R(), { debts: t } = C(), { selectedDebtPriority: n, setSelectedDebtPriority: i } = L(), c = !!a, d = [
1330
1332
  {
1331
1333
  priority: k.FASTEST_PAYOFF_FIRST,
1332
1334
  text: t.priority_sort_fastest_payoff
@@ -1344,10 +1346,10 @@ const kt = (a) => {
1344
1346
  text: t.priority_sort_highest_balance
1345
1347
  }
1346
1348
  ], p = (m) => {
1347
- i(m), r(T.DEBTS_CLICK_PRIORITY, { debts_priority: m });
1349
+ i(m), r(A.DEBTS_CLICK_PRIORITY, { debts_priority: m });
1348
1350
  };
1349
1351
  return /* @__PURE__ */ e(
1350
- Je,
1352
+ nt,
1351
1353
  {
1352
1354
  anchorEl: a,
1353
1355
  anchorOrigin: {
@@ -1356,13 +1358,13 @@ const kt = (a) => {
1356
1358
  },
1357
1359
  id: "prioritize-debts",
1358
1360
  onClose: o,
1359
- open: d,
1361
+ open: c,
1360
1362
  transformOrigin: {
1361
1363
  vertical: "top",
1362
1364
  horizontal: "left"
1363
1365
  },
1364
- children: /* @__PURE__ */ e(fe, { children: c.map(({ priority: m, text: b }) => /* @__PURE__ */ s(
1365
- Ze,
1366
+ children: /* @__PURE__ */ e(Ce, { children: d.map(({ priority: m, text: u }) => /* @__PURE__ */ s(
1367
+ ot,
1366
1368
  {
1367
1369
  onClick: () => p(m),
1368
1370
  sx: {
@@ -1380,34 +1382,34 @@ const kt = (a) => {
1380
1382
  }
1381
1383
  },
1382
1384
  children: [
1383
- /* @__PURE__ */ e(l, { color: "inherit", variant: "Small", children: b }),
1384
- n === m && /* @__PURE__ */ e(xe, { color: "inherit", filled: !0, fontSize: "small" })
1385
+ /* @__PURE__ */ e(l, { color: "inherit", variant: "Small", children: u }),
1386
+ n === m && /* @__PURE__ */ e(Se, { color: "inherit", filled: !0, fontSize: "small" })
1385
1387
  ]
1386
1388
  },
1387
1389
  m
1388
1390
  )) })
1389
1391
  }
1390
1392
  );
1391
- }), Ot = v(() => {
1392
- const { onEvent: a } = R(), { debts: o } = C(), { selectedDebtPriority: r } = F(), [t, n] = g.useState(null), i = (m) => {
1393
- n(m.currentTarget), a(T.DEBTS_CLICK_PRIORITIZE);
1394
- }, d = () => {
1393
+ }), Kt = v(() => {
1394
+ const { onEvent: a } = R(), { debts: o } = C(), { selectedDebtPriority: r } = L(), [t, n] = f.useState(null), i = (m) => {
1395
+ n(m.currentTarget), a(A.DEBTS_CLICK_PRIORITIZE);
1396
+ }, c = () => {
1395
1397
  n(null);
1396
- }, c = !!t, p = g.useMemo(() => ({
1398
+ }, d = !!t, p = f.useMemo(() => ({
1397
1399
  [k.FASTEST_PAYOFF_FIRST]: o.priority_sort_fastest_payoff,
1398
1400
  [k.HIGHEST_INTEREST]: o.priority_sort_highest_interest,
1399
1401
  [k.HIGHEST_BALANCE]: o.priority_sort_highest_balance,
1400
1402
  [k.LOWEST_BALANCE]: o.priority_sort_lowest_balance
1401
1403
  })[r] ?? o.priority_sort_lowest_balance, [r]);
1402
1404
  return /* @__PURE__ */ s(_, { children: [
1403
- /* @__PURE__ */ e(Lt, { buttonText: p, isOpen: c, onClick: i }),
1404
- /* @__PURE__ */ e($t, { buttonEl: t, onClose: d })
1405
+ /* @__PURE__ */ e(Vt, { buttonText: p, isOpen: d, onClick: i }),
1406
+ /* @__PURE__ */ e(Yt, { buttonEl: t, onClose: c })
1405
1407
  ] });
1406
- }), Ht = (a, o, r = 0) => {
1408
+ }), Ut = (a, o, r = 0) => {
1407
1409
  const t = a.map((p) => ({ ...p }));
1408
- we(t, o);
1410
+ De(t, o);
1409
1411
  const n = /* @__PURE__ */ new Date(), i = [];
1410
- let d = 0, c = 1;
1412
+ let c = 0, d = 1;
1411
1413
  for (const p of t)
1412
1414
  i.push({
1413
1415
  ...p,
@@ -1415,35 +1417,40 @@ const kt = (a) => {
1415
1417
  dataset: [{ x: new Date(n), y: p.balance }]
1416
1418
  });
1417
1419
  for (; t.some((p) => p.balance >= 0.01 && !p.is_impossible); ) {
1418
- let p = !1, m = !1, b = !1;
1419
- for (const [w, u] of t.entries()) {
1420
- if (u.balance <= 0.01) continue;
1421
- const B = i[w].dataset, M = (u.interest_rate ?? 0) / 100 / 12, S = u.balance * M, A = u.monthly_payment ?? 0;
1422
- let $ = A, y = 0;
1423
- !b && r > 0 && ($ += r, b = !0), !m && d > 0 && (y = d, m = !0), u.balance += S;
1424
- const h = Math.min(u.balance, $ + y);
1420
+ let p = !1, m = !1, u = !1;
1421
+ for (const [w, b] of t.entries()) {
1422
+ if (b.balance <= 0.01) continue;
1423
+ const B = i[w].dataset, I = (b.interest_rate ?? 0) / 100 / 12, S = b.balance * I, D = b.monthly_payment ?? 0;
1424
+ let $ = D, y = 0;
1425
+ !u && r > 0 && ($ += r, u = !0), !m && c > 0 && (y = c, m = !0), b.balance += S;
1426
+ const h = Math.min(b.balance, $ + y);
1425
1427
  if (h <= S) {
1426
- u.is_impossible = !0, i[w].is_impossible = !0, i[w].priority = void 0, B.push({ x: new Date(n), y: u.balance });
1428
+ b.is_impossible = !0, i[w].is_impossible = !0, i[w].priority = void 0, B.push({ x: new Date(n), y: b.balance });
1427
1429
  continue;
1428
1430
  }
1429
- u.balance -= h, u.balance = u.balance < 0.01 ? 0 : u.balance, B.push({
1431
+ b.balance -= h, b.balance = b.balance < 0.01 ? 0 : b.balance, B.push({
1430
1432
  x: new Date(n),
1431
- y: Math.max(0, u.balance),
1433
+ y: Math.max(0, b.balance),
1432
1434
  payment: h,
1433
1435
  extra: y
1434
- }), u.balance <= 0 && (d += A, i[w].projected_payoff_date = new Date(n)), h > 0 && (p = !0);
1436
+ }), b.balance <= 0 && (c += D, i[w].projected_payoff_date = new Date(n)), h > 0 && (p = !0);
1435
1437
  }
1436
1438
  p && n.setMonth(n.getMonth() + 1);
1437
1439
  }
1438
1440
  return i.forEach((p) => {
1439
1441
  (p.interest_rate === void 0 || p.monthly_payment === void 0) && (p.projected_payoff_date = void 0);
1440
1442
  }), i.forEach((p) => {
1441
- p.priority = !p.is_paid_off && !p.is_impossible ? c++ : void 0;
1443
+ p.priority = !p.is_paid_off && !p.is_impossible ? d++ : void 0;
1442
1444
  }), i;
1443
- }, Gt = v(({ onClick: a }) => {
1444
- const { debts: o } = C(), { isDesktop: r } = K(), { totalMonthlyPayments: t } = Z(), { monthlyCashFlowProfile: n } = Y(), i = t + Number(n?.extra_payment), d = r ? o.paydown_button_long : o.paydown_button_short;
1445
+ }, qt = (a, o, r) => ({
1446
+ description: o ? a.empty_state_description : a.empty_state_description_no_aggregation,
1447
+ header: o ? a.empty_state_header : a.empty_state_header_no_aggregation,
1448
+ onClickHandler: o ? r : void 0,
1449
+ primaryButton: o ? a.connect_accounts : void 0
1450
+ }), Zt = v(({ onClick: a }) => {
1451
+ const { debts: o } = C(), { isDesktop: r } = K(), { totalMonthlyPayments: t } = Q(), { monthlyCashFlowProfile: n } = Y(), i = t + Number(n?.extra_payment), c = r ? o.paydown_button_long : o.paydown_button_short;
1445
1452
  return /* @__PURE__ */ e(
1446
- ge,
1453
+ ve,
1447
1454
  {
1448
1455
  "aria-controls": "extra-paydown",
1449
1456
  "aria-describedby": "extra-paydown",
@@ -1451,38 +1458,47 @@ const kt = (a) => {
1451
1458
  "aria-label": "extra-paydown",
1452
1459
  onClick: a,
1453
1460
  sx: { justifyContent: "start", minWidth: 100, mx: 4 },
1454
- children: I(d, N(i, "0,0"))
1461
+ children: E(c, P(i, "0,0"))
1455
1462
  }
1456
1463
  );
1457
- }), Wt = ({ onBackClick: a, sx: o }) => {
1458
- const { isDesktop: r, isMobile: t } = K(), { debts: n } = C(), { onEvent: i } = R(), { isInitialized: d } = Ne(), { setSelectedAccount: c } = Fe(), { selectedDebtPriority: p, setSelectedDebtChartData: m } = F(), { isAccountDataLoaded: b, loadAccountData: w, visibleDebtAccounts: u } = J(), { isAllGoalDataLoaded: B, loadGoalData: P, monthlyCashFlowProfile: M } = Y(), { debts: S } = Z(), [A, $] = g.useState(!1), [y, h] = g.useState(!1), [x, D] = g.useState(!1), [E, L] = g.useState("");
1459
- Qe({
1464
+ }), Jt = ({ onBackClick: a, sx: o }) => {
1465
+ const { isDesktop: r, isMobile: t } = K(), { connect: n, debts: i } = C(), { onEvent: c } = R(), {
1466
+ config: { show_connections_widget_in_master: d }
1467
+ } = Oe(), { isInitialized: p } = We(), { setSelectedAccount: m } = je(), { selectedDebtPriority: u, setSelectedDebtChartData: w } = L(), { isAccountDataLoaded: b, loadAccountData: B, visibleDebtAccounts: M } = ee(), { isAllGoalDataLoaded: I, loadGoalData: S, monthlyCashFlowProfile: D } = Y(), { debts: $ } = Q(), [y, h] = f.useState(!1), [g, T] = f.useState(!1), [N, F] = f.useState(!1), [O, Ae] = f.useState(""), [Ee, le] = f.useState(!1);
1468
+ lt({
1460
1469
  widgetName: "DebtsWidget",
1461
- isLoaded: B
1470
+ isLoaded: I
1462
1471
  });
1463
- const H = g.useMemo(() => {
1464
- const G = M?.extra_payment ?? 0;
1465
- return Ht(S, p, G);
1466
- }, [S, p, M]);
1467
- g.useEffect(() => {
1468
- b || w().finally(), i(T.DEBTS_VIEW);
1469
- }, []), g.useEffect(() => {
1470
- d && P().finally();
1471
- }, [d]);
1472
- const ne = (G) => L(G), ie = () => {
1473
- const G = u.find((ee) => ee.guid === E), le = H.find((ee) => ee.guid === E);
1474
- G && c(G), le && m(le), $(!0);
1475
- }, Se = () => i(T.DEBTS_CLICK_FILTER), ve = () => {
1476
- D(!0), i(T.DEBTS_CLICK_SNOWBALL_CTA);
1477
- }, De = () => {
1478
- h(!0), i(T.DEBTS_CLICK_PAYDOWN);
1472
+ const U = f.useMemo(() => {
1473
+ const W = D?.extra_payment ?? 0;
1474
+ return Ut($, u, W);
1475
+ }, [$, u, D]);
1476
+ f.useEffect(() => {
1477
+ b || B().finally(), c(A.DEBTS_VIEW);
1478
+ }, []), f.useEffect(() => {
1479
+ p && S().finally();
1480
+ }, [p]);
1481
+ const se = (W) => Ae(W), ce = () => {
1482
+ const W = M.find((re) => re.guid === O), pe = U.find((re) => re.guid === O);
1483
+ W && m(W), pe && w(pe), h(!0);
1484
+ }, Ie = () => c(A.DEBTS_CLICK_FILTER), Be = () => {
1485
+ F(!0), c(A.DEBTS_CLICK_SNOWBALL_CTA);
1486
+ }, Me = () => {
1487
+ T(!0), c(A.DEBTS_CLICK_PAYDOWN);
1479
1488
  };
1480
- return !d || !B ? /* @__PURE__ */ e(et, {}) : /* @__PURE__ */ s(
1481
- tt,
1489
+ if (!p || !I)
1490
+ return /* @__PURE__ */ e(st, {});
1491
+ const de = $.length === 0, q = qt(
1492
+ i,
1493
+ d,
1494
+ () => le(!0)
1495
+ );
1496
+ return /* @__PURE__ */ s(
1497
+ ct,
1482
1498
  {
1483
1499
  actions: [
1484
- /* @__PURE__ */ e(Ot, {}, "prioritize-debts"),
1485
- /* @__PURE__ */ e(Gt, { onClick: De }, "extra-paydown")
1500
+ /* @__PURE__ */ e(Kt, {}, "prioritize-debts"),
1501
+ /* @__PURE__ */ e(Zt, { onClick: Me }, "extra-paydown")
1486
1502
  ],
1487
1503
  allowedAccountTypes: [
1488
1504
  X.CREDIT_CARD,
@@ -1491,69 +1507,90 @@ const kt = (a) => {
1491
1507
  X.LINE_OF_CREDIT,
1492
1508
  X.CHECKING_LINE_OF_CREDIT
1493
1509
  ],
1494
- onAccountsFilterClick: Se,
1510
+ onAccountsFilterClick: Ie,
1495
1511
  onBackClick: a,
1496
1512
  sx: o,
1497
- title: n.title,
1513
+ title: i.title,
1498
1514
  children: [
1499
- /* @__PURE__ */ s(f, { sx: { px: r ? "48px" : "24px" }, children: [
1500
- /* @__PURE__ */ s(
1501
- f,
1515
+ /* @__PURE__ */ s(x, { sx: { pt: 48, px: r ? "48px" : "24px" }, children: [
1516
+ de && /* @__PURE__ */ e(
1517
+ dt,
1502
1518
  {
1503
- sx: {
1504
- alignItems: t ? "flex-start" : "flex-end",
1505
- flexDirection: t ? "column" : "row",
1506
- mx: t ? "-12px" : 0
1507
- },
1508
- children: [
1509
- /* @__PURE__ */ e(
1510
- Ce,
1511
- {
1512
- debts: H,
1513
- height: t ? 250 : void 0,
1514
- hoveredDebtGuid: E,
1515
- onClickArea: ie,
1516
- onHoverArea: ne,
1517
- sx: { mr: t ? "4px" : "-48px" }
1518
- }
1519
- ),
1520
- /* @__PURE__ */ e(
1521
- st,
1522
- {
1523
- debts: H,
1524
- onClickCta: ve,
1525
- sx: { mb: t ? "0px" : "64px" }
1526
- }
1527
- )
1528
- ]
1519
+ header: q.header,
1520
+ icon: "note_stack",
1521
+ onClick: q.onClickHandler,
1522
+ primaryButton: q.primaryButton,
1523
+ subText: q.description,
1524
+ sx: { maxWidth: 400 }
1529
1525
  }
1530
1526
  ),
1531
- /* @__PURE__ */ e(f, { sx: { mx: t ? "-24px" : 0 }, children: /* @__PURE__ */ e(
1532
- Ft,
1533
- {
1534
- debts: H,
1535
- hoveredDebtGuid: E,
1536
- onClickRow: ie,
1537
- onHoverRow: ne
1538
- }
1539
- ) })
1527
+ !de && /* @__PURE__ */ s(H, { children: [
1528
+ /* @__PURE__ */ s(
1529
+ x,
1530
+ {
1531
+ sx: {
1532
+ alignItems: t ? "flex-start" : "flex-end",
1533
+ flexDirection: t ? "column" : "row",
1534
+ mx: t ? "-12px" : 0
1535
+ },
1536
+ children: [
1537
+ /* @__PURE__ */ e(
1538
+ Te,
1539
+ {
1540
+ debts: U,
1541
+ height: t ? 250 : void 0,
1542
+ hoveredDebtGuid: O,
1543
+ onClickArea: ce,
1544
+ onHoverArea: se,
1545
+ sx: { mr: t ? "4px" : "-48px" }
1546
+ }
1547
+ ),
1548
+ /* @__PURE__ */ e(
1549
+ yt,
1550
+ {
1551
+ debts: U,
1552
+ onClickCta: Be,
1553
+ sx: { mb: t ? "0px" : "64px" }
1554
+ }
1555
+ )
1556
+ ]
1557
+ }
1558
+ ),
1559
+ /* @__PURE__ */ e(x, { sx: { mx: t ? "-24px" : 0 }, children: /* @__PURE__ */ e(
1560
+ Xt,
1561
+ {
1562
+ debts: U,
1563
+ hoveredDebtGuid: O,
1564
+ onClickRow: ce,
1565
+ onHoverRow: se
1566
+ }
1567
+ ) })
1568
+ ] })
1540
1569
  ] }),
1541
1570
  /* @__PURE__ */ e(
1542
- dt,
1571
+ xt,
1543
1572
  {
1544
- isOpen: x,
1545
- onClose: () => D(!1)
1573
+ isOpen: N,
1574
+ onClose: () => F(!1)
1546
1575
  }
1547
1576
  ),
1548
- /* @__PURE__ */ e(Tt, { isOpen: A, onClose: () => $(!1) }),
1549
- /* @__PURE__ */ e(Bt, { isOpen: y, onClose: () => h(!1) })
1577
+ /* @__PURE__ */ e(Rt, { isOpen: y, onClose: () => h(!1) }),
1578
+ /* @__PURE__ */ e(Ht, { isOpen: g, onClose: () => T(!1) }),
1579
+ /* @__PURE__ */ e(
1580
+ it,
1581
+ {
1582
+ onClose: () => le(!1),
1583
+ showConnectWidget: Ee,
1584
+ title: n.mini_title
1585
+ }
1586
+ )
1550
1587
  ]
1551
1588
  }
1552
1589
  );
1553
- }, Lr = v(Wt);
1590
+ }, Ur = v(Jt);
1554
1591
  export {
1555
- Ce as DebtsChart,
1556
- Hr as DebtsStore,
1557
- Ft as DebtsTable,
1558
- Lr as DebtsWidget
1592
+ Te as DebtsChart,
1593
+ Jr as DebtsStore,
1594
+ Xt as DebtsTable,
1595
+ Ur as DebtsWidget
1559
1596
  };