@mx-cartographer/experiences 7.3.3-alpha.mega1 → 7.4.0

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.
Files changed (131) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/{Account-YwUMFz93.mjs → Account-01wOyrH1.mjs} +1 -1
  3. package/dist/{AccountDetailsContent-BgCST7mK.mjs → AccountDetailsContent-gke-5zMF.mjs} +10 -10
  4. package/dist/{AccountDetailsHeader-jAFWoHj7.mjs → AccountDetailsHeader-CRzfuFA2.mjs} +7 -7
  5. package/dist/{AccountFields-DPxMPBF0.mjs → AccountFields-CPkGZ3SD.mjs} +5 -5
  6. package/dist/{AccountListItem-D6rWAreC.mjs → AccountListItem-D4uG9yC-.mjs} +4 -4
  7. package/dist/{AccountStore-B5E98oM1.mjs → AccountStore-C1zMBzHq.mjs} +40 -29
  8. package/dist/{Accounts-UIlYCmHb.mjs → Accounts-D7QljYas.mjs} +1 -1
  9. package/dist/{BudgetUtil-CXvenbdN.mjs → BudgetUtil-wjoNuj7B.mjs} +1 -1
  10. package/dist/{CategorySelectorDrawer-Buy70Y3V.mjs → CategorySelectorDrawer-DqJK_rrL.mjs} +3 -3
  11. package/dist/{CategoryStore-BEdFs69_.mjs → CategoryStore-U7hOZAbP.mjs} +1 -1
  12. package/dist/{CategoryUtil-BR3H5i6n.mjs → CategoryUtil-DUM8NuGO.mjs} +1 -1
  13. package/dist/{ConnectDrawer-CbxHKlRv.mjs → ConnectDrawer-CuUj16NH.mjs} +2 -2
  14. package/dist/{ConnectionsDrawer-C6kanU7I.mjs → ConnectionsDrawer-Bz4uwdFE.mjs} +3 -3
  15. package/dist/{CurrencyInput-lSC7oPDg.mjs → CurrencyInput-xH-hqry9.mjs} +1 -1
  16. package/dist/{DateUtil-BcuH7ErC.mjs → DateUtil-CBdcsyuk.mjs} +3 -3
  17. package/dist/{DebtsStore-DgIcphe_.mjs → DebtsStore-Bu8rRRSL.mjs} +1 -1
  18. package/dist/{Dialog-CWW597AF.mjs → Dialog-BPTr3qHE.mjs} +2 -2
  19. package/dist/Drawer-BEtCk82g.mjs +163 -0
  20. package/dist/{EmptyState-DA_lfRBv.mjs → EmptyState-DoxNUae-.mjs} +24 -22
  21. package/dist/{ExportCsvAction-DNSgmdyv.mjs → ExportCsvAction-DzTrtPzk.mjs} +3 -3
  22. package/dist/FinstrongStore-CfD6bbJk.mjs +441 -0
  23. package/dist/{GoalStore-CAlmSu4U.mjs → GoalStore-j6QYHgEa.mjs} +3 -3
  24. package/dist/{Help-hi9I9EYP.mjs → Help-BnPXM_N2.mjs} +2 -2
  25. package/dist/LineChart-DttMO7uS.mjs +581 -0
  26. package/dist/{ListItemAction-BmL5buOf.mjs → ListItemAction-uobBrm_a.mjs} +10 -10
  27. package/dist/{ManageIncome-Cypo9qY4.mjs → ManageIncome-CU5C0AeO.mjs} +97 -95
  28. package/dist/{MicroWidgetContainer-CFdMGJKg.mjs → MicroWidgetContainer-DEiRnYVa.mjs} +1 -1
  29. package/dist/{MiniWidgetContainer-BdgBvpga.mjs → MiniWidgetContainer-CmXpTylX.mjs} +1 -1
  30. package/dist/{NetWorthStore-CxqIxAgN.mjs → NetWorthStore-CpL_kqvx.mjs} +2 -2
  31. package/dist/{NotificationSettings-DxytNHlN.mjs → NotificationSettings-DI5B1spM.mjs} +5 -5
  32. package/dist/{OriginalBalanceAction-V6FEoIDe.mjs → OriginalBalanceAction-CCmnsd7y.mjs} +3 -3
  33. package/dist/{RecurringSettings-iIupYxJW.mjs → RecurringSettings-Cm5Bqcai.mjs} +4 -4
  34. package/dist/{RecurringTransactions-ej39mgA6.mjs → RecurringTransactions-CngsRZ3K.mjs} +45 -44
  35. package/dist/{RecurringTransactionsStore-BiwCzScZ.mjs → RecurringTransactionsStore-Bc1wCiNB.mjs} +1 -1
  36. package/dist/{SpendingData-D5vsfYKo.mjs → SpendingData-BuJ03S9d.mjs} +16 -16
  37. package/dist/SpendingLegend-B2BYr8B4.mjs +193 -0
  38. package/dist/{TransactionDetails-BUoNbsu-.mjs → TransactionDetails-CtbBBSoU.mjs} +396 -386
  39. package/dist/{TransactionStore-CtGTg0XS.mjs → TransactionStore-Dz-G8Wd0.mjs} +3 -3
  40. package/dist/{TrendsStore-5PvDT_o6.mjs → TrendsStore-BW9FGQeE.mjs} +1 -1
  41. package/dist/{User-Bj34_i8g.mjs → User-wXzDI4M8.mjs} +2 -2
  42. package/dist/{WidgetContainer-BnTgAfQn.mjs → WidgetContainer-6dsjtOVg.mjs} +4 -4
  43. package/dist/accounts/components/AccountsListCompact.d.ts +10 -0
  44. package/dist/accounts/index.es.js +17 -17
  45. package/dist/accounts/stores/AccountStore.d.ts +2 -0
  46. package/dist/analytics/index.es.js +2 -2
  47. package/dist/budgets/index.es.js +13 -13
  48. package/dist/cashflow/index.es.js +49 -49
  49. package/dist/categories/index.es.js +2 -2
  50. package/dist/common/components/Select.d.ts +4 -2
  51. package/dist/common/components/charts/LineChart.d.ts +12 -2
  52. package/dist/common/components/charts/linechart/CustomLegend.d.ts +3 -1
  53. package/dist/common/components/charts/linechart/CustomMark.d.ts +4 -0
  54. package/dist/common/components/drawer/Drawer.d.ts +3 -0
  55. package/dist/common/components/drawer/Footer.d.ts +17 -0
  56. package/dist/common/index.es.js +33 -33
  57. package/dist/common/types/Finstrong.d.ts +54 -0
  58. package/dist/common/types/Widgets.d.ts +1 -0
  59. package/dist/common/types/index.d.ts +1 -1
  60. package/dist/common/types/localization/FinstrongCopy.d.ts +105 -2
  61. package/dist/common/types/localization/GoalsCopy.d.ts +1 -0
  62. package/dist/dashboard/index.es.js +2 -2
  63. package/dist/debts/index.es.js +11 -11
  64. package/dist/{exportTransactionsToCSV-C4PkIYP6.mjs → exportTransactionsToCSV-Cz2t0lmA.mjs} +2 -2
  65. package/dist/finstrong/FinstrongWidget.d.ts +1 -1
  66. package/dist/finstrong/api/FinstrongApi.d.ts +5 -0
  67. package/dist/finstrong/components/ConnectMoreAccountsCard.d.ts +3 -1
  68. package/dist/finstrong/components/CreditScore/CreditScoreContent.d.ts +4 -0
  69. package/dist/finstrong/components/CreditScore/CreditScoreHeader.d.ts +4 -0
  70. package/dist/finstrong/components/FinancialStrengthGraph.d.ts +7 -1
  71. package/dist/finstrong/components/HaveManageableDebt/DebtPaymentTabContent.d.ts +3 -0
  72. package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtComponent.d.ts +3 -0
  73. package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtProgressBar.d.ts +4 -0
  74. package/dist/finstrong/components/HaveManageableDebt/IncomeTabContent.d.ts +3 -0
  75. package/dist/finstrong/components/KeyIndicatorsBorrowTab.d.ts +2 -2
  76. package/dist/finstrong/components/KeyIndicatorsDrawer.d.ts +4 -1
  77. package/dist/finstrong/components/KeyIndicatorsSaveTab.d.ts +2 -2
  78. package/dist/finstrong/components/KeyIndicatorsSpendTab.d.ts +2 -2
  79. package/dist/finstrong/components/KeyIndicatorsTabItem.d.ts +4 -3
  80. package/dist/finstrong/components/KeyIndicatorsTabItemDrawer.d.ts +10 -0
  81. package/dist/finstrong/components/KeyIndicatorsTabsWidget.d.ts +2 -2
  82. package/dist/finstrong/components/MaintainingEmergencySavings/EstimatedContributionCalculator.d.ts +6 -0
  83. package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsContent.d.ts +4 -0
  84. package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsSticky.d.ts +4 -0
  85. package/dist/finstrong/components/ProgressBar.d.ts +15 -0
  86. package/dist/finstrong/components/SaveEnoughToLiveOn/AvailableTabContent.d.ts +3 -0
  87. package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnDrawerContent.d.ts +3 -0
  88. package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnProgressBar.d.ts +4 -0
  89. package/dist/finstrong/components/SaveEnoughToLiveOn/SpendingTabContent.d.ts +3 -0
  90. package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeComponent.d.ts +3 -0
  91. package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeProgressBar.d.ts +4 -0
  92. package/dist/finstrong/components/StatusChip.d.ts +5 -0
  93. package/dist/finstrong/components/onboarding/Onboarding.d.ts +2 -0
  94. package/dist/finstrong/components/onboarding/OnboardingAddMonthlyIncome.d.ts +17 -0
  95. package/dist/finstrong/components/onboarding/OnboardingBirthday.d.ts +8 -0
  96. package/dist/finstrong/components/onboarding/OnboardingCreditScore.d.ts +8 -0
  97. package/dist/finstrong/components/onboarding/OnboardingStepsDrawer.d.ts +14 -0
  98. package/dist/finstrong/components/onboarding/OnboardingStepsHeader.d.ts +8 -0
  99. package/dist/finstrong/components/paybillsontime/PayBillsOnTimeDrawerComponent.d.ts +4 -0
  100. package/dist/finstrong/components/paybillsontime/PayBillsOnTimeStickyComponent.d.ts +4 -0
  101. package/dist/finstrong/components/shared/Accounts.d.ts +8 -0
  102. package/dist/finstrong/components/shared/CustomDoubleBarPlot.d.ts +25 -0
  103. package/dist/finstrong/components/shared/DialScoreCard.d.ts +7 -1
  104. package/dist/finstrong/components/shared/DoubleBarChart.d.ts +28 -0
  105. package/dist/finstrong/components/shared/LineGraph.d.ts +7 -0
  106. package/dist/finstrong/components/shared/TotalCard.d.ts +8 -0
  107. package/dist/finstrong/components/shared/Transactions.d.ts +11 -0
  108. package/dist/finstrong/constants/index.d.ts +20 -0
  109. package/dist/finstrong/index.es.js +3174 -1069
  110. package/dist/finstrong/stores/FinstrongStore.d.ts +21 -2
  111. package/dist/finstrong/util/finstrongUtils.d.ts +58 -1
  112. package/dist/goals/index.es.js +15 -15
  113. package/dist/help/index.es.js +3 -3
  114. package/dist/{hooks-Cy8JnjCg.mjs → hooks-C41HAxM5.mjs} +4 -4
  115. package/dist/investments/index.es.js +5 -5
  116. package/dist/merchants/index.es.js +1 -1
  117. package/dist/networth/index.es.js +33 -33
  118. package/dist/notifications/index.es.js +4 -4
  119. package/dist/recurringtransactions/index.es.js +43 -43
  120. package/dist/settings/index.es.js +8 -8
  121. package/dist/spending/index.es.js +261 -436
  122. package/dist/transactions/components/shared/TransactionList.d.ts +1 -0
  123. package/dist/transactions/index.es.js +15 -15
  124. package/dist/trends/index.es.js +16 -16
  125. package/dist/{useAccountDisplayName-D6sQsNNQ.mjs → useAccountDisplayName-CMMlIOXF.mjs} +2 -2
  126. package/dist/{useInsightsEnabled-BxytCjq5.mjs → useInsightsEnabled-CNjP5cfR.mjs} +1 -1
  127. package/package.json +1 -1
  128. package/dist/Drawer-kEE73B87.mjs +0 -113
  129. package/dist/FinstrongStore-CL7t5lBL.mjs +0 -101
  130. package/dist/LineChart-eK4IQImU.mjs +0 -541
  131. package/dist/finstrong/utils/Finstrong.d.ts +0 -6
@@ -1,280 +1,180 @@
1
- import { jsx as e, jsxs as u, Fragment as ie } from "react/jsx-runtime";
2
- import x from "@mui/material/Box";
3
- import _ from "@mui/material/Stack";
4
- import { useTheme as E, alpha as oe } from "@mui/material/styles";
5
- import { PieChart as Oe } from "@mui/x-charts";
6
- import { ChevronRight as j, Check as De, TrendingUp as Me, ArrowRightAlt as Te, TrendingDown as we, AccountBalance as ue, ExpandMore as Fe, Payments as Re, CalendarMonth as Pe, CreditCard as he, Savings as Ge, ContentCopy as Le, MultilineChart as Ee } from "@mxenabled/mx-icons";
7
- import { Text as W, P as y, H3 as H, Icon as _e } from "@mxenabled/mxui";
8
- import { format as ge } from "date-fns/format";
9
- import C from "react";
10
- import We from "@mui/material/Avatar";
11
- import fe from "@mui/material/Divider";
12
- import Be from "@mui/material/List";
13
- import He from "@mui/material/ListItem";
14
- import ze from "@mui/material/ListItemAvatar";
15
- import $e from "@mui/material/ListItemButton";
16
- import Ne from "@mui/material/ListItemText";
17
- import { b } from "../Localization-2MODESHW.mjs";
18
- import * as le from "d3";
19
- import { observer as I } from "mobx-react-lite";
20
- import { u as S, b as z, w as $, p as Y, d as ye, i as be, n as Ke, m as Xe } from "../hooks-Cy8JnjCg.mjs";
21
- import { L as N } from "../Loader-DUaFpDGv.mjs";
22
- import { F as Ko, a as Xo } from "../FinstrongStore-CL7t5lBL.mjs";
23
- import q from "@mui/material/Button";
24
- import J from "@mui/material/Card";
25
- import { L as xe } from "../LineChart-eK4IQImU.mjs";
26
- import { l as Ce } from "../ConnectDrawer-CbxHKlRv.mjs";
27
- import je from "@mui/material/Accordion";
28
- import Ue from "@mui/material/AccordionDetails";
29
- import Ve from "@mui/material/AccordionSummary";
30
- import Ye from "@mui/material/CardHeader";
31
- import { u as qe } from "../useDimensions-27p2evRx.mjs";
32
- import { C as Je } from "../ConnectionsDrawer-C6kanU7I.mjs";
33
- import { R as Qe } from "../RecurringSettings-iIupYxJW.mjs";
34
- import Ze from "@mui/material/TextField";
35
- import { u as Se } from "../useScreenSize-B6JyS_Lj.mjs";
36
- import { a as et } from "../Dialog-CWW597AF.mjs";
37
- import { AdapterDateFns as tt } from "@mui/x-date-pickers/AdapterDateFnsV3";
38
- import { StaticDatePicker as ot } from "@mui/x-date-pickers";
39
- import { LocalizationProvider as nt } from "@mui/x-date-pickers/LocalizationProvider";
40
- import { D as V } from "../Drawer-kEE73B87.mjs";
41
- import ne from "@mui/material/Tab";
42
- import rt from "@mui/material/Tabs";
43
- import { f as it } from "../NumberFormatting-Buh7u8Oi.mjs";
44
- import { T as re } from "../TabContentContainer-j01JYR_7.mjs";
45
- import st from "@mui/lab/Timeline";
46
- import at, { timelineItemClasses as ct } from "@mui/lab/TimelineItem";
47
- import lt from "@mui/lab/TimelineConnector";
48
- import dt from "@mui/lab/TimelineContent";
49
- import pt from "@mui/lab/TimelineDot";
50
- import mt from "@mui/lab/TimelineSeparator";
51
- import { W as ut } from "../WidgetContainer-BnTgAfQn.mjs";
52
- var A = /* @__PURE__ */ ((n) => (n.Connections = "connections", n.CreditScore = "credit_score", n.DateOfBirth = "date_of_birth", n.MonthlyIncome = "monthly_income", n))(A || {});
53
- const ht = ({ list: n, onClickItem: o }) => /* @__PURE__ */ e(x, { sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ e(
54
- Be,
55
- {
56
- sx: {
57
- "& .MuiListItemSecondaryAction-root": {
58
- color: "text.primary",
59
- pr: 24
60
- }
61
- },
62
- children: n.map((t, a) => /* @__PURE__ */ u(C.Fragment, { children: [
63
- /* @__PURE__ */ e(He, { secondaryAction: /* @__PURE__ */ e(j, {}), children: /* @__PURE__ */ u($e, { onClick: () => o(t.key), children: [
64
- /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(
65
- We,
66
- {
67
- sx: {
68
- bgcolor: "primary.main",
69
- ...!t.isComplete && {
70
- bgcolor: "transparent",
71
- borderColor: "action.active",
72
- borderStyle: "solid",
73
- borderWidth: 1,
74
- color: "action.active"
75
- }
76
- },
77
- children: t.icon
78
- }
79
- ) }),
80
- /* @__PURE__ */ e(
81
- Ne,
82
- {
83
- primary: /* @__PURE__ */ e(W, { sx: { color: "text.secondary" }, variant: "caption", children: t.primaryText }),
84
- secondary: /* @__PURE__ */ e(W, { sx: { color: "text.primary", fontWeight: 600 }, variant: "body1", children: t.secondaryText })
85
- }
86
- )
87
- ] }) }),
88
- a < n.length - 1 && /* @__PURE__ */ e(fe, { sx: { color: "divider", ml: 68 } })
89
- ] }, t.key))
90
- }
91
- ) }), _t = ht, de = (n) => n * (180 / Math.PI), se = (n, o) => [
92
- {
93
- description: o.vulnerable_description,
94
- max: 25,
95
- scoreContent: o.accordion_details_text.vulnerable,
96
- status: o.vulnerable
97
- },
98
- {
99
- description: o.building_description,
100
- max: 50,
101
- scoreContent: o.accordion_details_text.building,
102
- status: o.building
103
- },
104
- {
105
- description: o.stable_description,
106
- max: 75,
107
- scoreContent: o.accordion_details_text.stable,
108
- status: o.stable
109
- },
110
- {
111
- description: o.strong_description,
112
- max: 100,
113
- scoreContent: o.accordion_details_text.strong,
114
- status: o.strong
115
- }
116
- ].find((d) => n > 0 && n <= d.max) || { status: o.insufficient_data, description: "", scoreContent: "" }, D = {
117
- POOR: "#8C0E0E",
118
- FAIR: "#E32727",
119
- GOOD: "#FFB70D",
120
- VERY_GOOD: "#0EA26C",
121
- EXCEPTIONAL: "#005C3D"
122
- }, M = {
123
- POOR: "#B21C1C",
124
- FAIR: "#FF3232",
125
- GOOD: "#FFC02C",
126
- VERY_GOOD: "#29C76B",
127
- EXCEPTIONAL: "#008A5A"
128
- }, gt = (n, o, t) => n >= 300 && n < 580 ? {
129
- status: t.poor,
130
- color: o ? M.POOR : D.POOR
131
- } : n >= 580 && n < 670 ? {
132
- status: t.fair,
133
- color: o ? M.FAIR : D.FAIR
134
- } : n >= 670 && n < 740 ? {
135
- status: t.good,
136
- color: o ? M.GOOD : D.GOOD
137
- } : n >= 740 && n < 800 ? {
138
- status: t.very_good,
139
- color: o ? M.VERY_GOOD : D.VERY_GOOD
140
- } : n >= 800 && n <= 850 ? {
141
- status: t.exceptional,
142
- color: o ? M.EXCEPTIONAL : D.EXCEPTIONAL
143
- } : { status: t.missing_data }, ft = (n, o, t, a) => {
144
- const d = n.reduce((r, s) => r + s.value, 0);
145
- let l = 0;
146
- const i = n.map((r) => {
147
- const s = r.value / d * o, c = t + l, p = c + s;
148
- return l += s, {
149
- ...r,
150
- startAngle: c,
151
- endAngle: p
152
- };
153
- });
154
- return [i[a].startAngle, i[a].endAngle];
155
- }, yt = (n, o, t, a, d) => {
156
- let l = 0, i = 0;
157
- const r = Math.floor(a), s = a - r;
158
- return r > t ? (l = n, i = o) : r === t && s > 0 && (l = n, i = d), [l, i];
159
- }, bt = (n, o, t = 0) => {
160
- const a = n * Math.sin(o - t), d = -n * Math.cos(o - t);
161
- return [a, d];
162
- }, xt = ({
163
- dynamicCopy: n,
164
- fallbackLabel: o,
165
- icon: t,
166
- key: a,
167
- label: d,
168
- value: l
169
- }) => {
170
- const i = !!l, r = i ? Ct(a, l) : n && b(n, o) || o;
171
- return {
172
- icon: i ? /* @__PURE__ */ e(De, {}) : t,
173
- isComplete: i,
174
- key: a,
175
- primaryText: d,
176
- secondaryText: r
177
- };
178
- }, Ct = (n, o) => ({
179
- [A.DateOfBirth]: (a) => ge(new Date(Number(a) * 1e3), "MMM d, yyyy"),
180
- [A.MonthlyIncome]: (a) => `$${a}`
181
- })[n]?.(o) ?? String(o), pe = (n) => n !== null ? Math.round(n * 100) : null, St = ({
182
- dialScoreData: n,
1
+ import { jsxs as a, Fragment as W, jsx as e } from "react/jsx-runtime";
2
+ import k from "@mui/material/Box";
3
+ import p from "@mui/material/Stack";
4
+ import { useTheme as $, alpha as be } from "@mui/material/styles";
5
+ import { PieChart as rn, BarPlot as an } from "@mui/x-charts";
6
+ import { TrendingUp as _t, ArrowRightAlt as sn, TrendingDown as cn, AccountBalance as ut, ChevronRight as Z, MultilineChart as ht, CreditCard as Ke, CheckCircle as ln, Cancel as dn, Savings as pn, ContentCopy as _n, Add as mt, Cardiology as un, Payments as hn, CalendarMonth as mn, ExpandMore as gn } from "@mxenabled/mx-icons";
7
+ import { P as M, H3 as Y, Text as I, InstitutionLogo as gt, H2 as Be, MerchantLogo as yn, Icon as bn } from "@mxenabled/mxui";
8
+ import { g as fn, a as xn, r as nt, b as Sn, c as je, d as yt, C as ke, e as Me, f as Cn, h as vn, i as wn, j as bt, k as ot, l as kn, m as rt, n as Mn, o as ft, p as Dn, q as xt, s as Re, t as In, u as Tn, v as An, w as On, A as te, x as Fn, P as Rn } from "../FinstrongStore-CfD6bbJk.mjs";
9
+ import { y as Ci, F as vi } from "../FinstrongStore-CfD6bbJk.mjs";
10
+ import * as at from "d3";
11
+ import { observer as v } from "mobx-react-lite";
12
+ import { u as x, b as X, a as Ye, p as J, z as R, q as Pn, d as xe, m as Ve, f as Ln, j as Xe, h as Bn, i as Wn, n as $n } from "../hooks-C41HAxM5.mjs";
13
+ import { L as oe } from "../Loader-DUaFpDGv.mjs";
14
+ import m from "react";
15
+ import P from "@mui/material/Button";
16
+ import V from "@mui/material/Card";
17
+ import { L as qe } from "../LineChart-DttMO7uS.mjs";
18
+ import { C as St } from "../ConnectionsDrawer-Bz4uwdFE.mjs";
19
+ import { l as re, g as Ct, A as He } from "../ConnectDrawer-CuUj16NH.mjs";
20
+ import se from "@mui/material/Tab";
21
+ import Ue from "@mui/material/Tabs";
22
+ import Pe from "@mui/material/TextField";
23
+ import { u as Qe } from "../useScreenSize-B6JyS_Lj.mjs";
24
+ import { D as Gn, f as zn, a as En } from "../Dialog-BPTr3qHE.mjs";
25
+ import { u as vt } from "../useDimensions-27p2evRx.mjs";
26
+ import Hn from "@mui/material/Chip";
27
+ import { D as ne } from "../Drawer-BEtCk82g.mjs";
28
+ import le from "@mui/material/Divider";
29
+ import ge from "@mui/material/ListItem";
30
+ import wt from "@mui/material/ListItemAvatar";
31
+ import ye from "@mui/material/ListItemText";
32
+ import { g as kt } from "../AccountFields-CPkGZ3SD.mjs";
33
+ import Ne from "@mui/material/List";
34
+ import Nn from "@mui/material/ListItemButton";
35
+ import Kn from "@mui/material/ListSubheader";
36
+ import { f as B } from "../NumberFormatting-Buh7u8Oi.mjs";
37
+ import { b as j } from "../Localization-2MODESHW.mjs";
38
+ import { S as it, F as Mt, e as jn, R as Dt } from "../RecurringTransactions-CngsRZ3K.mjs";
39
+ import { S as Yn } from "../StatusBar-BK_uYHAB.mjs";
40
+ import { h as It } from "../DateUtil-CBdcsyuk.mjs";
41
+ import { T as Vn, s as Xn, h as qn, S as Un, c as Qn } from "../TransactionDetails-CtbBBSoU.mjs";
42
+ import { T as ce } from "../TabContentContainer-j01JYR_7.mjs";
43
+ import { E as Le } from "../EmptyState-DoxNUae-.mjs";
44
+ import Zn from "@mui/material/useMediaQuery";
45
+ import { ChartsXAxis as Jn } from "@mui/x-charts/ChartsXAxis";
46
+ import { ChartsYAxis as eo } from "@mui/x-charts/ChartsYAxis";
47
+ import { ResponsiveChartContainer as to } from "@mui/x-charts/ResponsiveChartContainer";
48
+ import { useSpring as no, animated as st } from "@react-spring/web";
49
+ import { startOfMonth as Tt } from "date-fns/startOfMonth";
50
+ import { endOfMonth as At } from "date-fns/endOfMonth";
51
+ import { g as oo, S as ro, b as ao } from "../SpendingLegend-B2BYr8B4.mjs";
52
+ import { formatISO as io } from "date-fns/formatISO";
53
+ import { fromUnixTime as so } from "date-fns/fromUnixTime";
54
+ import { startOfToday as ct } from "date-fns/startOfToday";
55
+ import { subDays as co } from "date-fns/subDays";
56
+ import { c as lo, d as lt, S as po, i as _o } from "../ManageIncome-CU5C0AeO.mjs";
57
+ import { LocalizationProvider as uo, DatePicker as ho, StaticDatePicker as mo } from "@mui/x-date-pickers";
58
+ import { AdapterDateFns as Ot } from "@mui/x-date-pickers/AdapterDateFnsV3";
59
+ import { R as go } from "../RecurringSettings-Cm5Bqcai.mjs";
60
+ import { LocalizationProvider as yo } from "@mui/x-date-pickers/LocalizationProvider";
61
+ import { format as bo } from "date-fns/format";
62
+ import fo from "@mui/lab/Timeline";
63
+ import xo, { timelineItemClasses as So } from "@mui/lab/TimelineItem";
64
+ import Co from "@mui/lab/TimelineConnector";
65
+ import vo from "@mui/lab/TimelineContent";
66
+ import wo from "@mui/lab/TimelineDot";
67
+ import ko from "@mui/lab/TimelineSeparator";
68
+ import Mo from "@mui/material/Accordion";
69
+ import Do from "@mui/material/AccordionDetails";
70
+ import Io from "@mui/material/AccordionSummary";
71
+ import To from "@mui/material/CardHeader";
72
+ import { W as Ao } from "../WidgetContainer-6dsjtOVg.mjs";
73
+ const Oo = ({
74
+ dialScoreData: t,
183
75
  dataIndex: o,
184
- arcColor: t,
185
- arcStartAngle: a,
186
- totalAngularSpan: d,
187
- centerX: l,
188
- centerY: i,
189
- arcRadius: r,
190
- innerArcRadius: s,
191
- outterArcRadius: c,
192
- progressEndAngle: p,
76
+ arcColor: n,
77
+ arcStartAngle: r,
78
+ totalAngularSpan: s,
79
+ centerX: i,
80
+ centerY: c,
81
+ arcRadius: l,
82
+ innerArcRadius: _,
83
+ outterArcRadius: d,
84
+ progressEndAngle: u,
193
85
  unitsPerSegment: h,
194
- isFinacialStrengthGraph: m
86
+ isFinacialStrengthGraph: y
195
87
  }) => {
196
- const f = E(), v = [
88
+ const f = $(), C = [
197
89
  { offset: "13.62%", color: f.palette.chartMono.chartMono2 },
198
90
  { offset: "36.67%", color: f.palette.chartMono.chartMono3 },
199
91
  { offset: "59.72%", color: f.palette.chartMono.chartMono4 },
200
92
  { offset: "83.46%", color: f.palette.chartMono.chartMono5 }
201
- ], [T, R] = ft(
202
- n,
203
- d,
204
- a,
93
+ ], [S, D] = fn(
94
+ t,
95
+ s,
96
+ r,
205
97
  o
206
- ), [w, L] = yt(
207
- T,
208
- R,
98
+ ), [g, b] = xn(
99
+ S,
100
+ D,
209
101
  o,
210
102
  h,
211
- p
212
- ), K = le.arc().innerRadius(s).outerRadius(c).startAngle(T).endAngle(R).padAngle(0.02).cornerRadius(8), P = le.arc().innerRadius(s).outerRadius(c).startAngle(w).endAngle(L).padAngle(0.02).cornerRadius(8);
213
- return /* @__PURE__ */ u(ie, { children: [
103
+ u
104
+ ), w = at.arc().innerRadius(_).outerRadius(d).startAngle(S).endAngle(D).padAngle(0.02).cornerRadius(8), H = at.arc().innerRadius(_).outerRadius(d).startAngle(g).endAngle(b).padAngle(0.02).cornerRadius(8);
105
+ return /* @__PURE__ */ a(W, { children: [
214
106
  /* @__PURE__ */ e(
215
107
  "path",
216
108
  {
217
- d: K({}),
218
- fill: m ? f.palette.divider : t
109
+ d: w({}),
110
+ fill: y ? f.palette.divider : n
219
111
  }
220
112
  ),
221
- m && /* @__PURE__ */ e("path", { d: P({}), fill: "url(#arcGradient)" }),
113
+ y && /* @__PURE__ */ e("path", { d: H({}), fill: "url(#arcGradient)" }),
222
114
  /* @__PURE__ */ e("defs", { children: /* @__PURE__ */ e(
223
115
  "linearGradient",
224
116
  {
225
- gradientTransform: `rotate(5, ${l}, ${i})`,
117
+ gradientTransform: `rotate(5, ${i}, ${c})`,
226
118
  gradientUnits: "userSpaceOnUse",
227
119
  id: "arcGradient",
228
- x1: l + r * 0.8 * Math.cos(Math.PI / 1.35),
229
- x2: l - r * 0.8 * Math.cos(Math.PI / 1.35),
230
- y1: i + r * 0.8 * Math.sin(Math.PI / 1.35),
231
- y2: i - r * 0.8 * Math.sin(Math.PI / 1.35),
232
- children: v.map((G, k) => /* @__PURE__ */ e("stop", { offset: G.offset, stopColor: G.color }, k))
120
+ x1: i + l * 0.8 * Math.cos(Math.PI / 1.35),
121
+ x2: i - l * 0.8 * Math.cos(Math.PI / 1.35),
122
+ y1: c + l * 0.8 * Math.sin(Math.PI / 1.35),
123
+ y2: c - l * 0.8 * Math.sin(Math.PI / 1.35),
124
+ children: C.map((N, U) => /* @__PURE__ */ e("stop", { offset: N.offset, stopColor: N.color }, U))
233
125
  }
234
126
  ) })
235
127
  ] });
236
- }, ve = ({
237
- arcRadius: n = 100,
128
+ }, Ft = ({
129
+ arcRadius: t = 100,
238
130
  healthScore: o,
239
- size: t = "L",
240
- dialScoreData: a,
241
- minValue: d = 0,
242
- maxValue: l = 100,
243
- markerColor: i,
244
- healthScoreStatus: r,
245
- footerCenterContent: s,
246
- footerLeftContent: c,
247
- footerRightContent: p,
248
- isFinacialStrengthGraph: h = !1
131
+ size: n = "L",
132
+ dialScoreData: r,
133
+ minValue: s = 0,
134
+ maxValue: i = 100,
135
+ margin: c,
136
+ markerColor: l,
137
+ healthScoreStatus: _,
138
+ footerCenterContent: d,
139
+ footerLeftContent: u,
140
+ footerRightContent: h,
141
+ isFinacialStrengthGraph: y = !1
249
142
  }) => {
250
- const m = E(), f = -Math.PI / 1.35, v = Math.PI / 1.35, T = v - f, R = T / (l - d), w = (o - d) * R, L = f + w + 0.02, K = t !== "SM" ? 0.1 : 0.12, P = n, G = n * (1 - K), k = P * 2.5, O = k / 2, F = k / 2, Z = (G + P) / 2, U = o !== 25 && o !== 50 && o !== 75 && o !== 100 ? 0 : 0.12, [ee, te] = bt(Z, L, U), Ae = o / 25, ae = {
143
+ const f = $(), C = -Math.PI / 1.35, S = Math.PI / 1.35, D = S - C, g = D / (i - s), b = (o - s) * g, w = C + b + 0.02, H = n !== "SM" ? 0.1 : 0.12, N = t, U = t * (1 - H), L = N * 2, O = L / 2, G = L / 2, pe = (U + N) / 2, Ce = o !== 25 && o !== 50 && o !== 75 && o !== 100 ? 0 : 0.12, [ee, K] = Sn(pe, w, Ce), ve = o / 25, z = {
251
144
  L: { markerSize: 12, healthScoreFontSize: 64 },
252
- M: { markerSize: 10, healthScoreFontSize: 48 },
145
+ M: { markerSize: 8, healthScoreFontSize: 48 },
253
146
  SM: { markerSize: 3, healthScoreFontSize: 14 }
254
- }, Ie = s === 0 ? Te : we;
255
- return /* @__PURE__ */ u(
256
- _,
147
+ }, we = {
148
+ top: 0,
149
+ right: 0,
150
+ bottom: 0,
151
+ left: 0,
152
+ ...c
153
+ }, E = d === 0 ? sn : cn, ae = n !== "SM" ? 3 : 1, _e = ae * 4, ue = z[n].markerSize * 2 + _e;
154
+ return /* @__PURE__ */ a(
155
+ p,
257
156
  {
258
157
  sx: {
259
- width: k,
260
- height: k,
158
+ width: L,
159
+ height: n === "SM" ? L - 7 : L,
261
160
  position: "relative",
262
- alignSelf: "center"
161
+ alignSelf: "center",
162
+ overflow: "visible"
263
163
  },
264
164
  children: [
265
165
  /* @__PURE__ */ e(
266
- Oe,
166
+ rn,
267
167
  {
268
- height: k,
269
- margin: { top: 0, right: 0, bottom: 0, left: 0 },
168
+ height: n === "SM" ? L - 7 : L,
169
+ margin: we,
270
170
  series: [
271
171
  {
272
- data: a,
273
- innerRadius: G,
274
- outerRadius: P,
275
- startAngle: Math.round(de(f)),
172
+ data: r,
173
+ innerRadius: U,
174
+ outerRadius: N,
175
+ startAngle: Math.round(nt(C)),
276
176
  // Use Math.degrees to convert
277
- endAngle: Math.round(de(v))
177
+ endAngle: Math.round(nt(S))
278
178
  // Use Math.degrees to convert
279
179
  }
280
180
  ],
@@ -283,22 +183,22 @@ const ht = ({ list: n, onClickItem: o }) => /* @__PURE__ */ e(x, { sx: { bgcolor
283
183
  legend: { hidden: !0 }
284
184
  },
285
185
  slots: {
286
- pieArc: (ce) => /* @__PURE__ */ e(
287
- St,
186
+ pieArc: (q) => /* @__PURE__ */ e(
187
+ Oo,
288
188
  {
289
- arcColor: ce.color,
290
- arcRadius: n,
291
- arcStartAngle: f,
189
+ arcColor: q.color,
190
+ arcRadius: t,
191
+ arcStartAngle: C,
292
192
  centerX: O,
293
- centerY: F,
294
- dataIndex: ce.dataIndex,
295
- dialScoreData: a,
296
- innerArcRadius: G,
297
- isFinacialStrengthGraph: h,
298
- outterArcRadius: P,
299
- progressEndAngle: L,
300
- totalAngularSpan: T,
301
- unitsPerSegment: Ae
193
+ centerY: G,
194
+ dataIndex: q.dataIndex,
195
+ dialScoreData: r,
196
+ innerArcRadius: U,
197
+ isFinacialStrengthGraph: y,
198
+ outterArcRadius: N,
199
+ progressEndAngle: w,
200
+ totalAngularSpan: D,
201
+ unitsPerSegment: ve
302
202
  }
303
203
  )
304
204
  },
@@ -307,205 +207,239 @@ const ht = ({ list: n, onClickItem: o }) => /* @__PURE__ */ e(x, { sx: { bgcolor
307
207
  stroke: "none"
308
208
  }
309
209
  },
310
- width: k,
311
- children: o >= d && o <= l && /* @__PURE__ */ e(
210
+ width: L
211
+ }
212
+ ),
213
+ o >= s && o <= i && /* @__PURE__ */ e(
214
+ "svg",
215
+ {
216
+ height: ue,
217
+ style: {
218
+ position: "absolute",
219
+ left: O + ee - z[n].markerSize - 5,
220
+ top: G + K - z[n].markerSize - 5,
221
+ overflow: "visible"
222
+ },
223
+ viewBox: `${O + ee - z[n].markerSize - 5} ${G + K - z[n].markerSize - 5} ${ue} ${ue}`,
224
+ width: ue,
225
+ children: /* @__PURE__ */ e(
312
226
  "circle",
313
227
  {
314
228
  cx: O + ee,
315
- cy: F + te,
316
- fill: m.palette.common.white,
317
- r: ae[t].markerSize,
318
- stroke: h ? "url(#arcGradient)" : i,
319
- strokeWidth: t !== "SM" ? 3 : 1
229
+ cy: G + K,
230
+ fill: f.palette.common.white,
231
+ r: z[n].markerSize,
232
+ stroke: y ? "url(#arcGradient)" : l,
233
+ strokeWidth: ae
320
234
  }
321
235
  )
322
236
  }
323
237
  ),
324
238
  /* @__PURE__ */ e(
325
- x,
239
+ k,
326
240
  {
327
241
  sx: {
328
242
  position: "absolute",
329
- top: `${F}px`,
243
+ top: `${G}px`,
330
244
  left: `${O}px`,
331
245
  transform: "translate(-50%, -50%)",
332
246
  textAlign: "center"
333
247
  },
334
- children: /* @__PURE__ */ u(
335
- _,
248
+ children: /* @__PURE__ */ a(
249
+ p,
336
250
  {
337
251
  spacing: 1,
338
- sx: { alignItems: "center", justifyContent: "center", gap: t !== "M" ? 10 : 3 },
252
+ sx: { alignItems: "center", justifyContent: "center", gap: n !== "M" ? 10 : 3 },
339
253
  children: [
340
254
  /* @__PURE__ */ e(
341
- y,
255
+ M,
342
256
  {
343
257
  sx: {
344
- fontSize: ae[t].healthScoreFontSize,
345
- lineHeight: t !== "SM" ? "48px" : "100%"
258
+ fontSize: z[n].healthScoreFontSize,
259
+ lineHeight: n !== "SM" ? "48px" : "100%"
346
260
  },
347
261
  variant: "H1",
348
262
  children: o
349
263
  }
350
264
  ),
351
- t !== "SM" && /* @__PURE__ */ e(y, { sx: { fontWeight: 600 }, variant: t === "L" ? "body1" : "body2", children: r })
265
+ n !== "SM" && /* @__PURE__ */ e(M, { sx: { fontWeight: 600 }, variant: n === "L" ? "body1" : "body2", children: _ })
352
266
  ]
353
267
  }
354
268
  )
355
269
  }
356
270
  ),
357
- s !== void 0 && /* @__PURE__ */ e(
358
- x,
271
+ d !== void 0 && /* @__PURE__ */ e(
272
+ k,
359
273
  {
360
274
  sx: {
361
275
  position: "absolute",
362
- top: `${F * 2 * 0.83}px`,
276
+ top: `${G * 2 * 0.83}px`,
363
277
  left: `${O}px`,
364
278
  transform: "translate(-50%, -50%)",
365
279
  textAlign: "center"
366
280
  },
367
- children: typeof s == "number" ? /* @__PURE__ */ u(_, { sx: { flexDirection: "row", alignItems: "center", gap: 4 }, children: [
368
- s > 0 ? /* @__PURE__ */ e(Me, { size: 16, sx: { color: "success.main" } }) : /* @__PURE__ */ e(Ie, { size: 16, sx: { color: "text.secondary" } }),
369
- /* @__PURE__ */ e(
370
- y,
371
- {
372
- sx: {
373
- fontWeight: 600,
374
- color: s > 0 ? "success.main" : "text.secondary"
375
- },
376
- variant: "body1",
377
- children: s
378
- }
379
- )
380
- ] }) : /* @__PURE__ */ e(y, { sx: { color: "text.secondary" }, variant: "subtitle2", children: s })
281
+ children: typeof d == "number" ? /* @__PURE__ */ a(
282
+ p,
283
+ {
284
+ sx: {
285
+ flexDirection: "row",
286
+ alignItems: "center",
287
+ gap: 4,
288
+ mt: 24
289
+ },
290
+ children: [
291
+ d > 0 ? /* @__PURE__ */ e(_t, { size: 16, sx: { color: "success.main" } }) : /* @__PURE__ */ e(E, { size: 16, sx: { color: "text.secondary" } }),
292
+ /* @__PURE__ */ e(
293
+ M,
294
+ {
295
+ sx: {
296
+ fontWeight: 600,
297
+ color: d > 0 ? "success.main" : "text.secondary"
298
+ },
299
+ variant: "body1",
300
+ children: d
301
+ }
302
+ )
303
+ ]
304
+ }
305
+ ) : /* @__PURE__ */ e(M, { sx: { color: "text.secondary" }, variant: "subtitle2", children: d })
381
306
  }
382
307
  ),
383
- c !== void 0 && /* @__PURE__ */ e(
384
- x,
308
+ u !== void 0 && /* @__PURE__ */ e(
309
+ k,
385
310
  {
386
311
  sx: {
387
312
  position: "absolute",
388
- top: `${F * 2 * 0.83}px`,
313
+ top: `${G * 2 * 0.83}px`,
389
314
  left: `${O - O / 2}px`,
390
315
  // shift left from center
391
316
  transform: "translate(-50%, -50%)",
392
317
  textAlign: "left"
393
318
  },
394
- children: /* @__PURE__ */ e(y, { variant: "body1", children: c })
319
+ children: /* @__PURE__ */ e(M, { variant: "body1", children: u })
395
320
  }
396
321
  ),
397
- p !== void 0 && /* @__PURE__ */ e(
398
- x,
322
+ h !== void 0 && /* @__PURE__ */ e(
323
+ k,
399
324
  {
400
325
  sx: {
401
326
  position: "absolute",
402
- top: `${F * 2 * 0.83}px`,
327
+ top: `${G * 2 * 0.83}px`,
403
328
  left: `${O + O / 2}px`,
404
329
  transform: "translate(-50%, -50%)",
405
330
  textAlign: "right"
406
331
  },
407
- children: /* @__PURE__ */ e(y, { variant: "body1", children: p })
332
+ children: /* @__PURE__ */ e(M, { variant: "body1", children: h })
408
333
  }
409
334
  )
410
335
  ]
411
336
  }
412
337
  );
413
- }, ke = I(
414
- ({ arcRadius: n, size: o = "L", healthScore: t, footerCenterContent: a }) => {
415
- const d = [
338
+ }, Rt = v(
339
+ ({
340
+ arcRadius: t,
341
+ size: o = "L",
342
+ healthScore: n,
343
+ footerCenterContent: r,
344
+ margin: s
345
+ }) => {
346
+ const i = [
416
347
  { id: 1, label: "Group A", value: 25 },
417
348
  { id: 2, label: "Group B", value: 25 },
418
349
  { id: 3, label: "Group C", value: 25 },
419
350
  { id: 4, label: "Group D", value: 25 }
420
- ], { finstrong: l } = S(), i = se(t, l);
351
+ ], { finstrong: c } = x(), l = je(n, c);
421
352
  return /* @__PURE__ */ e(
422
- ve,
353
+ Ft,
423
354
  {
424
- arcRadius: n,
425
- dialScoreData: d,
426
- footerCenterContent: o === "L" ? l.footer_center_content_updated_just_now : a,
427
- healthScore: t,
428
- healthScoreStatus: i.status,
355
+ arcRadius: t,
356
+ dialScoreData: i,
357
+ footerCenterContent: o === "L" ? c.footer_center_content_updated_just_now : r,
358
+ healthScore: n,
359
+ healthScoreStatus: l.status,
429
360
  isFinacialStrengthGraph: !0,
361
+ margin: s,
430
362
  size: o
431
363
  }
432
364
  );
433
365
  }
434
- ), Ho = I(
366
+ ), Fo = v(
435
367
  ({
436
- arcRadius: n,
368
+ arcRadius: t,
437
369
  size: o = "L",
438
- healthScore: t,
439
- maxValue: a = 850,
440
- minValue: d = 300,
441
- footerCenterContent: l
370
+ healthScore: n,
371
+ maxValue: r = 850,
372
+ minValue: s = 300,
373
+ footerCenterContent: i
442
374
  }) => {
443
- const r = E().palette.mode === "dark", s = [
375
+ const l = $().palette.mode === "dark", _ = [
444
376
  {
445
377
  id: 1,
446
378
  label: "Poor",
447
- value: 279,
448
- color: r ? M.POOR : D.POOR
379
+ value: 29,
380
+ color: l ? ke.POOR : Me.POOR
449
381
  },
450
382
  {
451
383
  id: 2,
452
384
  label: "Fair",
453
- value: 89,
454
- color: r ? M.FAIR : D.FAIR
385
+ value: 25,
386
+ color: l ? ke.FAIR : Me.FAIR
455
387
  },
456
388
  {
457
389
  id: 3,
458
390
  label: "Good",
459
- value: 69,
460
- color: r ? M.GOOD : D.GOOD
391
+ value: 17,
392
+ color: l ? ke.GOOD : Me.GOOD
461
393
  },
462
394
  {
463
395
  id: 4,
464
396
  label: "Very Good",
465
- value: 59,
466
- color: r ? M.VERY_GOOD : D.VERY_GOOD
397
+ value: 17,
398
+ color: l ? ke.VERY_GOOD : Me.VERY_GOOD
467
399
  },
468
400
  {
469
401
  id: 5,
470
402
  label: "Exceptional",
471
- value: 50,
472
- color: r ? M.EXCEPTIONAL : D.EXCEPTIONAL
403
+ value: 12,
404
+ color: l ? ke.EXCEPTIONAL : Me.EXCEPTIONAL
473
405
  }
474
- ], { finstrong: c } = S(), { isCopyLoaded: p } = z();
475
- if (!p) return /* @__PURE__ */ e(N, {});
476
- const { status: h, color: m = "none" } = gt(
477
- t,
478
- r,
479
- c.credit_score_status
406
+ ], { finstrong: d } = x(), { isCopyLoaded: u } = X();
407
+ if (!u) return /* @__PURE__ */ e(oe, {});
408
+ const { status: h, color: y = "none" } = yt(
409
+ n,
410
+ l,
411
+ d.credit_score_status
480
412
  );
481
413
  return /* @__PURE__ */ e(
482
- ve,
414
+ Ft,
483
415
  {
484
- arcRadius: n,
485
- dialScoreData: s,
486
- footerCenterContent: l,
487
- footerLeftContent: d,
488
- footerRightContent: a,
489
- healthScore: t,
416
+ arcRadius: t,
417
+ dialScoreData: _,
418
+ footerCenterContent: i,
419
+ footerLeftContent: s,
420
+ footerRightContent: r,
421
+ healthScore: n,
490
422
  healthScoreStatus: h,
491
- markerColor: m,
492
- maxValue: a,
493
- minValue: d,
423
+ markerColor: y,
424
+ maxValue: r,
425
+ minValue: s,
494
426
  size: o
495
427
  }
496
428
  );
497
429
  }
498
- ), Q = ({
499
- isDashboard: n = !1,
500
- hasIcon: o = !0,
501
- buttonText: t,
502
- title: a,
503
- description: d,
430
+ ), We = ({
431
+ drawerType: t,
432
+ isDashboard: o = !1,
433
+ hasIcon: n = !0,
434
+ buttonText: r,
435
+ title: s,
436
+ titleDrawer: i,
437
+ description: c,
504
438
  sx: l
505
439
  }) => {
506
- const [i, r] = C.useState(!1), { connect: s, finstrong: c } = S();
507
- return /* @__PURE__ */ u(
508
- J,
440
+ const [_, d] = m.useState(!1), { connect: u, finstrong: h } = x(), { config: y } = Ye();
441
+ return t && y.show_connections_widget_in_master ? /* @__PURE__ */ a(
442
+ V,
509
443
  {
510
444
  sx: {
511
445
  pb: 24,
@@ -515,715 +449,2649 @@ const ht = ({ list: n, onClickItem: o }) => /* @__PURE__ */ e(x, { sx: { bgcolor
515
449
  ...l
516
450
  },
517
451
  children: [
518
- /* @__PURE__ */ u(
519
- _,
452
+ /* @__PURE__ */ a(
453
+ p,
520
454
  {
521
455
  sx: {
522
456
  gap: 8,
523
- ...n && { flexDirection: "row", alignItems: "center" }
457
+ ...o && { flexDirection: "row", alignItems: "center" }
524
458
  },
525
459
  children: [
526
- o && /* @__PURE__ */ e(ue, { sx: { height: 20, width: 20 } }),
527
- /* @__PURE__ */ e(H, { className: "connect-more-accounts-title", sx: { ...n && { fontSize: 15 } }, children: a || c.connect_more_accounts_title })
460
+ n && /* @__PURE__ */ e(ut, { sx: { height: 20, width: 20 } }),
461
+ /* @__PURE__ */ e(Y, { className: "connect-more-accounts-title", sx: { ...o && { fontSize: 15 } }, children: s || h.connect_more_accounts_title })
528
462
  ]
529
463
  }
530
464
  ),
531
465
  /* @__PURE__ */ e(
532
- y,
466
+ M,
533
467
  {
534
468
  className: "connect-more-accounts-description",
535
469
  sx: { color: "text.secondary", mt: 8 },
536
470
  variant: "subtitle1",
537
- children: d || c.connect_more_accounts_description
471
+ children: c || h.connect_more_accounts_description
538
472
  }
539
473
  ),
540
474
  /* @__PURE__ */ e(
541
- q,
475
+ P,
542
476
  {
543
- endIcon: /* @__PURE__ */ e(j, {}),
544
- onClick: () => r(!0),
477
+ endIcon: /* @__PURE__ */ e(Z, {}),
478
+ onClick: () => d(!0),
545
479
  size: "small",
546
480
  sx: { p: 0, mt: 8, "&:hover": { backgroundColor: "transparent" } },
547
- children: /* @__PURE__ */ e(W, { sx: { fontWeight: 600 }, variant: "body2", children: t || c.connect_more_accounts_button })
481
+ children: /* @__PURE__ */ e(I, { sx: { fontWeight: 600 }, variant: "body2", children: r || h.connect_more_accounts_button })
548
482
  }
549
483
  ),
550
- /* @__PURE__ */ e(
551
- Ce,
484
+ t === "connectDrawer" && /* @__PURE__ */ e(
485
+ re,
486
+ {
487
+ onClose: () => d(!1),
488
+ showConnectWidget: _,
489
+ title: i || u.mini_title
490
+ }
491
+ ),
492
+ t === "connectionsDrawer" && /* @__PURE__ */ e(
493
+ St,
552
494
  {
553
- onClose: () => r(!1),
554
- showConnectWidget: i,
555
- title: s.mini_title
495
+ onClose: () => d(!1),
496
+ showConnectionsWidget: _,
497
+ title: i || u.mini_title
556
498
  }
557
499
  )
558
500
  ]
559
501
  }
560
- );
561
- }, vt = I(() => {
562
- const n = E(), [o, { width: t }] = qe(), { finstrong: a } = S(), { isCopyLoaded: d, isInitialized: l } = z(), { healthScore: i, healthScoreChange: r } = $(), s = n.palette.mode === "dark", c = se(i?.health_score, a);
563
- return !d || !l ? /* @__PURE__ */ e(N, {}) : /* @__PURE__ */ u(J, { ref: o, sx: { p: 16 }, children: [
564
- /* @__PURE__ */ e(
565
- Ye,
566
- {
567
- action: /* @__PURE__ */ e(
568
- q,
569
- {
570
- endIcon: /* @__PURE__ */ e(j, {}),
571
- sx: {
572
- fontSize: 13,
573
- lineHeight: "16px",
574
- fontWeight: 600,
575
- color: "primary.main"
576
- },
577
- variant: "text",
578
- children: a.financial_strength_header_action
579
- }
580
- ),
581
- subheader: /* @__PURE__ */ e(H, { color: "text.primary", children: a.financial_strength_header }),
582
- sx: {
583
- p: 0,
584
- "& .MuiCardHeader-content": {
585
- overflow: "hidden"
586
- }
587
- }
588
- }
589
- ),
590
- /* @__PURE__ */ e(_, { sx: { justifyContent: "center", alignItems: "center" }, children: /* @__PURE__ */ e(
591
- ke,
592
- {
593
- arcRadius: t <= 323 ? 73 : 154,
594
- footerCenterContent: r,
595
- healthScore: i?.health_score || 0,
596
- size: t <= 323 ? "M" : "L"
597
- }
598
- ) }),
599
- i?.health_score ? /* @__PURE__ */ u(
600
- je,
601
- {
602
- sx: {
603
- px: 16,
604
- backgroundColor: s ? "grey.800" : "grey.50",
605
- //TODO: Need to change the background color to palette (supporting both darkmode and lightmode)
606
- "&.Mui-expanded": {
607
- m: 0
608
- },
609
- "&::before": {
610
- display: "none"
611
- }
612
- },
613
- children: [
614
- /* @__PURE__ */ e(
615
- Ve,
616
- {
617
- expandIcon: /* @__PURE__ */ e(Fe, { size: 20 }),
618
- sx: {
619
- height: 52,
620
- p: 0,
621
- "&.Mui-expanded": {
622
- minHeight: 0
623
- }
624
- },
625
- children: /* @__PURE__ */ e(y, { sx: { fontWeight: 600 }, variant: "body1", children: a.accordion_title_text })
626
- }
627
- ),
628
- /* @__PURE__ */ e(Ue, { sx: { "&.MuiAccordionDetails-root": { padding: 0, pb: 16 } }, children: /* @__PURE__ */ e(y, { variant: "subtitle1", children: c.scoreContent }) })
629
- ]
630
- }
631
- ) : /* @__PURE__ */ e(
632
- Q,
633
- {
634
- buttonText: a.connect_more_accounts_title,
635
- description: a.health_score_zero_description,
636
- hasIcon: !1,
637
- isDashboard: !0,
638
- sx: {
639
- backgroundColor: s ? "grey.800" : "grey.50",
640
- //TODO: Need to change the background color to palette (supporting both darkmode and lightmode)
641
- ".connect-more-accounts-title": {
642
- fontWeight: 600,
643
- lineHeight: "20px",
644
- color: "text.primary"
645
- },
646
- ".connect-more-accounts-description": { color: "text.primary" }
647
- },
648
- title: a.health_score_zero_title
649
- }
650
- )
651
- ] });
652
- }), kt = ({ isOpen: n, onClose: o }) => {
653
- const { common: t, finstrong: a } = S(), { isMobile: d } = Se(), { updateUser: l, user: i } = Y(), [r, s] = C.useState(i.credit_score || 0), c = !isNaN(r), p = () => {
654
- o(), setTimeout(() => s(i.credit_score || 0), 300);
502
+ ) : null;
503
+ };
504
+ var de = /* @__PURE__ */ ((t) => (t.SpendLessThanYouMake = "spendLessThanYouMake", t.PayBillsOnTime = "payBillsOnTime", t.SaveEnoughToLiveOn = "saveEnoughToLiveOn", t.MaintainEmergencySavings = "maintainEmergencySavings", t.HaveManageableDebt = "haveManageableDebt", t.HaveAGoodCreditScore = "haveAGoodCreditScore", t))(de || {});
505
+ const Ro = "https://content.moneydesktop.com/storage/MD_Assets/serenity/loading_animation_final.gif", Ae = {
506
+ Good: 30,
507
+ FairMin: 31,
508
+ FairMax: 39,
509
+ OffTrack: 40
510
+ }, Oe = {
511
+ Good: 100,
512
+ Fair: 109,
513
+ OffTrack: 110
514
+ }, Po = ({ isOpen: t, onClose: o }) => {
515
+ const { common: n, finstrong: r } = x(), { isMobile: s } = Qe(), { updateUser: i, user: c } = J(), [l, _] = m.useState(c.credit_score || 0), d = !isNaN(l), u = () => {
516
+ o(), setTimeout(() => _(c.credit_score || 0), 300);
655
517
  }, h = () => {
656
- !r || r === i.credit_score || l({ ...i, credit_score: r });
518
+ !l || l === c.credit_score || i({ ...c, credit_score: l });
657
519
  };
658
520
  return /* @__PURE__ */ e(
659
- et,
521
+ Gn,
660
522
  {
661
- copy: { close_aria: t.close_aria, title: a.edit_credit_score },
662
- disablePrimaryButton: !r || !c,
663
- isOpen: n,
523
+ copy: { close_aria: n.close_aria, title: r.edit_credit_score },
524
+ disablePrimaryButton: !l || !d,
525
+ isOpen: t,
664
526
  maxWidth: "xs",
665
- onClose: p,
527
+ onClose: u,
666
528
  onPrimaryAction: h,
667
529
  primaryColor: "primary",
668
- primaryText: t.save_button,
530
+ primaryText: n.save_button,
669
531
  sx: {
670
532
  "& .MuiDialog-paper": {
671
- minWidth: d ? "100%" : 400
533
+ minWidth: s ? "100%" : 400
672
534
  }
673
535
  },
674
536
  children: /* @__PURE__ */ e(
675
- Ze,
676
- {
677
- error: !c,
678
- fullWidth: !0,
679
- inputMode: "numeric",
680
- inputProps: {
681
- noValidate: !0,
682
- pattern: "[0-9]*"
683
- },
684
- onChange: (m) => s(Number(m.target.value)),
685
- value: c ? r : ""
686
- }
687
- )
688
- }
689
- );
690
- }, At = I(kt), It = ({ isOpen: n, onClose: o }) => {
691
- const { finstrong: t } = S(), a = E(), { updateUser: d, user: l } = Y(), [i, r] = C.useState(l.birthday), s = (p) => {
692
- r(Math.floor(new Date(p).getTime() / 1e3));
693
- };
694
- return /* @__PURE__ */ e(
695
- V,
696
- {
697
- isOpen: n,
698
- onClose: o,
699
- onPrimaryAction: () => {
700
- !i || i === l.birthday || (d({ ...l, birthday: i }), o());
701
- },
702
- onSecondaryAction: o,
703
- title: t.date_of_birth,
704
- children: /* @__PURE__ */ e(nt, { dateAdapter: tt, children: /* @__PURE__ */ e(
705
- ot,
537
+ "form",
706
538
  {
707
- disableFuture: !0,
708
- onChange: s,
709
- slotProps: {
710
- nextIconButton: {
711
- sx: {
712
- color: "primary.main",
713
- "&:hover": { bgcolor: oe(a.palette.primary.light, 0.1) }
714
- }
715
- },
716
- previousIconButton: {
717
- sx: {
718
- color: "primary.main",
719
- "&:hover": { bgcolor: oe(a.palette.primary.light, 0.1) }
720
- }
721
- }
722
- },
723
- slots: {
724
- actionBar: () => null,
725
- toolbar: () => null
539
+ onSubmit: (y) => {
540
+ y.preventDefault(), h(), u();
726
541
  },
727
- sx: {
728
- width: "100%",
729
- "& .MuiIconButton-edgeEnd": {
730
- color: "primary.main",
731
- "&:hover": { bgcolor: oe(a.palette.primary.light, 0.1) }
542
+ children: /* @__PURE__ */ e(
543
+ Pe,
544
+ {
545
+ error: !d,
546
+ fullWidth: !0,
547
+ inputMode: "numeric",
548
+ inputProps: {
549
+ noValidate: !0,
550
+ pattern: "[0-9]*"
551
+ },
552
+ onChange: (y) => _(Number(y.target.value)),
553
+ value: d ? l : ""
732
554
  }
733
- },
734
- value: i ? new Date(i * 1e3) : /* @__PURE__ */ new Date()
555
+ )
735
556
  }
736
- ) })
557
+ )
737
558
  }
738
559
  );
739
- }, Ot = I(It), Dt = ({ value: n, completeCopy: o }) => /* @__PURE__ */ u(_, { sx: { gap: 8 }, children: [
740
- /* @__PURE__ */ e(_, { sx: { flexDirection: "row", gap: 4 }, children: Array.from({ length: 4 }).map((t, a) => /* @__PURE__ */ e(
741
- x,
742
- {
743
- sx: {
744
- bgcolor: a < n ? "primary.main" : "neutral.light",
745
- borderRadius: "24px",
746
- height: 4,
747
- width: "100%"
748
- }
560
+ }, Pt = v(Po), Ee = {
561
+ credit_over_time_title: "Your Credit Over Time",
562
+ credit_over_time_zero_state_desc: "Add your credit score to start building a full picture of your credit health."
563
+ }, Lo = ({ chartFor: t }) => {
564
+ const o = $(), n = o.palette.mode === "dark", { monthlySummaries: r } = R(), { user: s } = J(), { finstrong: i } = x(), [c, { width: l }] = vt(), _ = {
565
+ savingsOverTime: {
566
+ icon: /* @__PURE__ */ e(_t, { size: 48, sx: { marginBottom: 8 } }),
567
+ title: i.key_indicators_save.zero_state_title,
568
+ description: i.key_indicators_save.zero_state_description
749
569
  },
750
- a
751
- )) }),
752
- /* @__PURE__ */ u(W, { sx: { color: "text.secondary" }, variant: "body2", children: [
753
- n / 4 * 100,
754
- "% ",
755
- o
756
- ] })
757
- ] }), Mt = ({ isOpen: n, onClose: o }) => {
758
- const { visibleFinstrongAccounts: t } = ye(), { incomeBudget: a } = be(), {
759
- accounts: d,
760
- common: l,
761
- finstrong: i
762
- } = S(), { user: r } = Y(), [s, c] = C.useState(null), h = [
763
- {
764
- dynamicCopy: i.add_profile_item,
765
- fallbackLabel: i.monthly_income,
766
- icon: /* @__PURE__ */ e(Re, {}),
767
- key: A.MonthlyIncome,
768
- label: i.monthly_income,
769
- value: a
570
+ debtOverTime: {
571
+ icon: /* @__PURE__ */ e(ht, { size: 48, sx: { marginBottom: 8 } }),
572
+ title: "",
573
+ description: ""
770
574
  },
771
- {
772
- dynamicCopy: i.add_profile_item,
773
- fallbackLabel: i.date_of_birth,
774
- icon: /* @__PURE__ */ e(Pe, {}),
775
- key: A.DateOfBirth,
776
- label: i.date_of_birth,
777
- value: r.birthday
575
+ creditOverTime: {
576
+ icon: /* @__PURE__ */ e(Ke, { size: 48, sx: { marginBottom: 8 } }),
577
+ title: Ee.credit_over_time_title,
578
+ description: Ee.credit_over_time_zero_state_desc
579
+ }
580
+ }[t], u = {
581
+ savingsOverTime: {
582
+ title: i.key_indicators_save.savings_over_time,
583
+ valueKey: "available_cash"
778
584
  },
779
- {
780
- dynamicCopy: i.add_profile_item,
781
- fallbackLabel: i.credit_score,
782
- icon: /* @__PURE__ */ e(he, {}),
783
- key: A.CreditScore,
784
- label: i.credit_score,
785
- value: r.credit_score
585
+ debtOverTime: {
586
+ title: i.key_indicators_borrow.have_manageable_debt_drawer.debt_over_time,
587
+ valueKey: "debt_balance"
786
588
  },
787
- {
788
- fallbackLabel: i.connect_your_accounts,
789
- icon: /* @__PURE__ */ e(ue, {}),
790
- key: A.Connections,
791
- label: i.connections,
792
- value: t.length > 0 ? b(
793
- i.connected_account,
794
- String(t.length),
795
- t.length > 1 ? i.accounts : i.account
796
- ) : void 0
589
+ creditOverTime: {
590
+ title: Ee.credit_over_time_title,
591
+ valueKey: "credit_score"
797
592
  }
798
- ].map((m) => xt(m));
799
- return /* @__PURE__ */ u(V, { isOpen: n, onClose: o, title: i.financial_profile, children: [
800
- /* @__PURE__ */ u(_, { sx: { gap: 20, p: 24 }, children: [
801
- /* @__PURE__ */ u(_, { sx: { gap: 8 }, children: [
802
- /* @__PURE__ */ e(H, { children: i.your_financial_profile }),
803
- /* @__PURE__ */ e(y, { children: i.financial_profile_description })
804
- ] }),
805
- /* @__PURE__ */ e(
806
- Dt,
807
- {
808
- completeCopy: i.complete,
809
- value: h.reduce((m, f) => m + (f.isComplete ? 1 : 0), 0)
810
- }
811
- )
812
- ] }),
813
- /* @__PURE__ */ e(_t, { list: h, onClickItem: c }),
814
- /* @__PURE__ */ e(x, { sx: { p: 24 }, children: /* @__PURE__ */ e(
815
- Q,
816
- {
817
- description: i.connect_more_accounts_to_view_more_accurate_financial_picture,
818
- isDashboard: !0,
819
- title: i.dont_see_all_your_accounts
820
- }
821
- ) }),
822
- /* @__PURE__ */ e(
823
- V,
824
- {
825
- isOpen: s === A.MonthlyIncome,
826
- onClose: () => c(null),
827
- title: l.settings,
828
- children: /* @__PURE__ */ e(Qe, {})
829
- }
830
- ),
831
- /* @__PURE__ */ e(Ot, { isOpen: s === A.DateOfBirth, onClose: () => c(null) }),
832
- /* @__PURE__ */ e(At, { isOpen: s === A.CreditScore, onClose: () => c(null) }),
593
+ }[t], h = Cn(r, u.valueKey), y = Math.max(...r.map((w) => w[u.valueKey])), f = () => y >= 1e6 ? { formatter: "0.000a", leftMargin: 55 } : y >= 1e3 ? { formatter: "0a", leftMargin: 35 } : { formatter: "0a", leftMargin: 30 }, { formatter: C, leftMargin: S } = f(), D = u.title, g = t === "creditOverTime";
594
+ let b;
595
+ if (g) {
596
+ const { color: w } = yt(
597
+ s?.credit_score ?? 0,
598
+ n,
599
+ i.credit_score_status
600
+ );
601
+ b = w;
602
+ }
603
+ return /* @__PURE__ */ e(V, { ref: c, sx: { backgroundColor: "background.paper" }, children: h.length >= 1 ? /* @__PURE__ */ a(p, { gap: 8, sx: { pl: 18 }, children: [
604
+ /* @__PURE__ */ e(M, { sx: { pb: 8, pt: 16 }, variant: "h3", children: D }),
833
605
  /* @__PURE__ */ e(
834
- Je,
606
+ qe,
835
607
  {
836
- onClose: () => c(null),
837
- showConnectionsWidget: s === A.Connections,
838
- title: d.manage_connections
608
+ areaColor: b,
609
+ axisColor: o.palette.divider,
610
+ baseline: "min",
611
+ chartFor: t,
612
+ colors: [o.palette.primary.main],
613
+ curveType: g ? "linear" : "natural",
614
+ datasets: h ? [h] : [],
615
+ height: 244,
616
+ labelFontColor: g ? "text.primary" : "",
617
+ labelFontSize: g ? 13 : void 0,
618
+ labels: [i.key_indicators_label],
619
+ margin: { left: S, top: g ? 25 : 15, right: 20 },
620
+ markStyles: (w) => g ? {
621
+ markLabelStyles: {
622
+ marginLeft: 16,
623
+ transform: w === h.length - 1 ? "translateX(-16px)" : "translateX(16px)",
624
+ fontWeight: 600
625
+ },
626
+ stroke: b
627
+ } : {},
628
+ maxRange: g ? 850 : void 0,
629
+ minRange: g ? 300 : void 0,
630
+ showArea: !0,
631
+ showAverage: !g,
632
+ showMark: !g,
633
+ showMarkLabel: g,
634
+ showXAxis: !0,
635
+ showYAxis: g,
636
+ showYAxisTicks: g,
637
+ useCustomMark: !0,
638
+ valueFormatterString: g ? void 0 : C,
639
+ width: l < 342 ? l - 48 : 342
839
640
  }
840
641
  )
642
+ ] }) : /* @__PURE__ */ a(p, { gap: 8, sx: { alignItems: "center", p: 24, pb: 48 }, children: [
643
+ _.icon,
644
+ /* @__PURE__ */ e(M, { fontWeight: 600, variant: "body1", children: _.title }),
645
+ /* @__PURE__ */ e(M, { align: "center", variant: "subtitle1", children: _.description })
646
+ ] }) });
647
+ }, Ze = v(Lo), Bo = () => {
648
+ const { healthScoreChange: t } = R(), { finstrong: o } = x(), { user: n } = J(), { availableWidth: r } = Pn(), { isSmallMobile: s } = Qe(r), [i, c] = m.useState(!1);
649
+ return /* @__PURE__ */ a(k, { children: [
650
+ /* @__PURE__ */ a(p, { sx: { gap: 28 }, children: [
651
+ /* @__PURE__ */ e(
652
+ Fo,
653
+ {
654
+ arcRadius: s ? 124 : 154,
655
+ footerCenterContent: t,
656
+ healthScore: n.credit_score ?? 0,
657
+ size: s ? "M" : "L"
658
+ }
659
+ ),
660
+ /* @__PURE__ */ e(P, { onClick: () => c(!0), variant: "contained", children: o.credit_score_updated_score }),
661
+ /* @__PURE__ */ e(Ze, { chartFor: "creditOverTime" })
662
+ ] }),
663
+ /* @__PURE__ */ e(Pt, { isOpen: i, onClose: () => c(!1) })
841
664
  ] });
842
- }, Tt = I(Mt), X = {
843
- creditScore: {
844
- poor: 600,
845
- good: 720
846
- },
847
- daysOfCashOnHand: {
848
- poor: 30,
849
- good: 90
850
- },
851
- debtToIncomeRatio: {
852
- poor: 40,
853
- good: 30
854
- },
855
- emergencySavings: {
856
- poor: 750,
857
- good: 1e3
858
- },
859
- spendToIncomeRatio: {
860
- poor: 110,
861
- good: 100
862
- }
863
- }, g = {
864
- GOOD: "Good",
865
- FAIR: "Fair",
866
- OFF_TRACK: "Off Track",
867
- MISSING: "Missing"
868
- }, B = ({
869
- title: n,
870
- description: o,
871
- cardState: t = g.MISSING,
872
- stateTitle: a
873
- }) => {
874
- const d = {
875
- [g.GOOD]: { backgroundColor: "success.lighter", color: "success.main" },
876
- [g.FAIR]: { backgroundColor: "warning.lighter", color: "warning.main" },
877
- [g.OFF_TRACK]: { backgroundColor: "error.lighter", color: "error.main" },
878
- [g.MISSING]: { backgroundColor: "divider", color: "text.secondary" }
665
+ }, Wo = v(Bo), $e = ({ status: t }) => {
666
+ const { finstrong: o } = x(), n = vn(wn[t]), r = {
667
+ GOOD: o.key_indicators_good,
668
+ FAIR: o.key_indicators_fair,
669
+ OFF_TRACK: o.key_indicators_off_track,
670
+ MISSING: o.key_indicators_missing
879
671
  }[t];
880
- return /* @__PURE__ */ u(
881
- _,
672
+ return /* @__PURE__ */ e(
673
+ Hn,
882
674
  {
883
- alignItems: "center",
884
- flexDirection: "row",
885
- gap: 12,
886
- justifyContent: "space-between",
675
+ label: /* @__PURE__ */ e(
676
+ M,
677
+ {
678
+ fontWeight: 700,
679
+ sx: { color: n.color, minHeight: 12 },
680
+ uppercase: !0,
681
+ variant: "tiny",
682
+ children: r
683
+ }
684
+ ),
685
+ size: "small",
887
686
  sx: {
888
- p: 16,
889
- border: "1px solid",
890
- borderColor: "divider",
891
- borderRadius: 2
687
+ bgcolor: n.backgroundColor,
688
+ height: 16
892
689
  },
893
- children: [
894
- /* @__PURE__ */ u(x, { sx: { minHeight: 48 }, children: [
895
- /* @__PURE__ */ u(_, { flexDirection: "row", gap: 4, children: [
896
- /* @__PURE__ */ e(y, { fontWeight: 600, sx: { mb: 8 }, truncate: !0, variant: "body1", children: n }),
897
- /* @__PURE__ */ e(
898
- x,
899
- {
900
- sx: {
901
- borderRadius: 3,
902
- backgroundColor: d.backgroundColor,
903
- px: 8,
904
- py: 2,
905
- height: 16
906
- },
907
- children: /* @__PURE__ */ e(y, { fontWeight: 700, sx: { minHeight: 12 }, uppercase: !0, variant: "tiny", children: a })
908
- }
909
- )
910
- ] }),
911
- /* @__PURE__ */ e(y, { color: "secondary", variant: "subtitle2", children: o })
912
- ] }),
913
- /* @__PURE__ */ e(x, { children: /* @__PURE__ */ e(_e, { color: "secondary", name: "chevron_right", size: 24 }) })
914
- ]
690
+ variant: "filled"
915
691
  }
916
692
  );
917
- }, wt = () => {
918
- const { healthScore: n } = $(), { finstrong: o } = S(), { key_indicators_spend: t } = o, a = (r) => {
919
- const { good: s, poor: c } = X.spendToIncomeRatio;
920
- let p = g.MISSING, h = t.ratio_missing_description, m = o.key_indicators_missing;
921
- return r !== null && (r < s ? (p = g.GOOD, h = b(t.ratio_good_description, r), m = o.key_indicators_good) : r >= s && r < c ? (p = g.FAIR, h = b(t.ratio_fair_description, r), m = o.key_indicators_fair) : r >= c && (p = g.OFF_TRACK, h = b(t.ratio_off_track_description, r), m = o.key_indicators_off_track)), {
922
- cardState: p,
923
- description: h,
924
- title: t.ratio_card_title,
925
- stateTitle: m
926
- };
927
- }, d = (r) => {
928
- let s = g.MISSING, c = t.count_missing_description, p = o.key_indicators_missing;
929
- return r !== null && (r === 0 ? (s = g.GOOD, c = t.count_good_description, p = o.key_indicators_good) : r >= 1 && (s = g.OFF_TRACK, c = t.count_off_track_description, p = o.key_indicators_off_track)), {
930
- cardState: s,
931
- description: c,
932
- title: t.count_card_title,
933
- stateTitle: p
934
- };
935
- }, { spendToIncomeRatio: l, spendFeeCount: i } = C.useMemo(() => {
936
- const r = n.spend_to_income_ratio !== null ? Math.round(n.spend_to_income_ratio * 100) : null, s = a(r), c = d(n.spending_fee_transaction_count);
937
- return { spendToIncomeRatio: s, spendFeeCount: c };
938
- }, [
939
- n.spend_to_income_ratio,
940
- n.spending_fee_transaction_count,
941
- t,
942
- o
943
- ]);
944
- return /* @__PURE__ */ u(_, { direction: "column", gap: 24, sx: { p: 8, pt: 24 }, children: [
945
- /* @__PURE__ */ e(
946
- B,
693
+ }, $o = () => {
694
+ const { finstrong: t } = x(), { user: o } = J(), n = bt(o.credit_score ?? null);
695
+ return /* @__PURE__ */ a(p, { sx: { flexDirection: "row", justifyContent: "space-between" }, children: [
696
+ /* @__PURE__ */ e(Y, { children: t.credit_score_keep_strong_credit_score }),
697
+ /* @__PURE__ */ e($e, { status: n })
698
+ ] });
699
+ }, Go = v($o), zo = ({
700
+ additionalContent: t,
701
+ connectTitle: o,
702
+ connectDescription: n,
703
+ children: r,
704
+ description: s,
705
+ drawerTitle: i,
706
+ isOpen: c,
707
+ loadConnectAccountsCard: l = !0,
708
+ onClose: _,
709
+ stickyComponent: d,
710
+ title: u,
711
+ drawerType: h
712
+ }) => {
713
+ const { finstrong: y } = x(), { isCopyLoaded: f } = X();
714
+ return f ? /* @__PURE__ */ e(ne, { isOpen: c, onClose: _, title: i || y.key_indicators, children: /* @__PURE__ */ a(p, { sx: { backgroundColor: "background.default", height: "100%" }, children: [
715
+ (u || s) && /* @__PURE__ */ a(
716
+ p,
947
717
  {
948
- cardState: l.cardState,
949
- description: l.description,
950
- stateTitle: l.stateTitle,
951
- title: l.title
718
+ sx: {
719
+ backgroundColor: "background.paper",
720
+ gap: 8,
721
+ p: 24
722
+ },
723
+ children: [
724
+ u && typeof u == "string" ? /* @__PURE__ */ e(Y, { children: u }) : u,
725
+ s && /* @__PURE__ */ e(M, { sx: { lineHeight: "24px" }, children: s })
726
+ ]
727
+ }
728
+ ),
729
+ d && /* @__PURE__ */ e(
730
+ k,
731
+ {
732
+ sx: {
733
+ position: "sticky",
734
+ top: 0,
735
+ zIndex: 1
736
+ },
737
+ children: d
738
+ }
739
+ ),
740
+ t && /* @__PURE__ */ e(k, { children: t }),
741
+ /* @__PURE__ */ a(p, { sx: { bgcolor: "background.default", gap: 24, p: 24 }, children: [
742
+ r,
743
+ l && /* @__PURE__ */ e(
744
+ We,
745
+ {
746
+ description: n,
747
+ drawerType: h,
748
+ isDashboard: !0,
749
+ sx: { backgroundColor: "background.paper" },
750
+ title: o
751
+ }
752
+ )
753
+ ] })
754
+ ] }) }) : /* @__PURE__ */ e(oe, {});
755
+ }, Lt = v(zo), Eo = ({
756
+ onClick: t,
757
+ shouldShowBalance: o = !0,
758
+ loadAccounts: n
759
+ }) => {
760
+ const { config: r } = Ye(), { accounts: s } = x(), { selectedAccounts: i } = X(), c = m.useCallback(
761
+ (_) => {
762
+ t?.(_);
763
+ },
764
+ [t]
765
+ ), l = m.useMemo(
766
+ () => Array.from(new Set(i.map((_) => _.account_type))).filter(
767
+ (_) => n ? n.includes(_) : !0
768
+ ),
769
+ [i, n]
770
+ );
771
+ return i.length ? /* @__PURE__ */ e(m.Fragment, { children: l.map((_) => {
772
+ const { accountsForType: d, totalBalanceForType: u } = i.reduce(
773
+ (h, y) => (y.account_type === _ && (h.accountsForType.push(y), h.totalBalanceForType += y.balance || 0), h),
774
+ { accountsForType: [], totalBalanceForType: 0 }
775
+ );
776
+ return /* @__PURE__ */ a(
777
+ Ne,
778
+ {
779
+ subheader: /* @__PURE__ */ e(Kn, { sx: { pb: 4, position: "static", pt: 12, px: 24 }, children: /* @__PURE__ */ a(p, { sx: { flexDirection: "row", justifyContent: "space-between" }, children: [
780
+ /* @__PURE__ */ e(I, { bold: !0, variant: "caption", children: s.account_types[_] }),
781
+ o && /* @__PURE__ */ e(I, { bold: !0, variant: "caption", children: B(u, "0,0.00") })
782
+ ] }) }),
783
+ sx: { bgcolor: "background.paper" },
784
+ children: [
785
+ d.map((h, y) => {
786
+ const { firstValue: f } = kt(h, s), C = Ct(h, {
787
+ allowNickname: r?.show_account_nicknames_in_master
788
+ }), S = /* @__PURE__ */ a(W, { children: [
789
+ /* @__PURE__ */ e(wt, { children: /* @__PURE__ */ e(gt, { alt: "MX", institutionGuid: h.institution_guid ?? "" }) }),
790
+ /* @__PURE__ */ e(
791
+ ye,
792
+ {
793
+ primary: `${C}${h.account_number ? ` *${h.account_number}` : ""}`,
794
+ primaryTypographyProps: { noWrap: !0, pr: 4, variant: "body1" }
795
+ }
796
+ ),
797
+ o && /* @__PURE__ */ e(M, { bold: !0, variant: "body2", children: B(f ?? 0, "0,0.00") })
798
+ ] });
799
+ return /* @__PURE__ */ a(m.Fragment, { children: [
800
+ /* @__PURE__ */ e(ge, { sx: { px: t ? 0 : 24 }, children: t ? /* @__PURE__ */ e(Nn, { onClick: () => c(h), children: S }) : S }),
801
+ y !== d.length - 1 && /* @__PURE__ */ e(le, { variant: "inset" })
802
+ ] }, h.guid);
803
+ }),
804
+ /* @__PURE__ */ e(le, {})
805
+ ]
806
+ },
807
+ _
808
+ );
809
+ }) }) : null;
810
+ }, Bt = v(Eo), Ho = ({ loadAccounts: t, loadMoreLabel: o }) => {
811
+ const n = $(), { config: r } = Ye(), { connect: s, finstrong: i } = x(), { accounts: c } = x(), { selectedAccounts: l } = X(), [_, d] = m.useState(!1), [u, h] = m.useState(!1), y = m.useMemo(
812
+ () => l.filter(
813
+ (S) => t ? t.includes(S.account_type) : !0
814
+ ),
815
+ [l, t]
816
+ ), f = m.useMemo(() => y.slice(0, 3), [y]), C = (S) => {
817
+ const { firstValue: D } = kt(S, c);
818
+ return D;
819
+ };
820
+ return y.length >= 1 ? /* @__PURE__ */ a(W, { children: [
821
+ /* @__PURE__ */ e(k, { sx: { border: `1px solid ${n.palette.divider}`, borderRadius: 2 }, children: f.map((S, D) => /* @__PURE__ */ a(m.Fragment, { children: [
822
+ /* @__PURE__ */ a(ge, { sx: { px: 24 }, children: [
823
+ /* @__PURE__ */ e(wt, { children: /* @__PURE__ */ e(gt, { alt: "MX", institutionGuid: S.institution_guid ?? "" }) }),
824
+ /* @__PURE__ */ e(
825
+ ye,
826
+ {
827
+ primary: `${Ct(S, {
828
+ allowNickname: r?.show_account_nicknames_in_master
829
+ })}
830
+ ${S.account_number ? ` *${S.account_number}` : ""}`,
831
+ primaryTypographyProps: { noWrap: !0, pr: 4, variant: "body1" }
832
+ }
833
+ ),
834
+ /* @__PURE__ */ e(M, { bold: !0, variant: "body2", children: B(C(S), "0,0.00") })
835
+ ] }),
836
+ D < f.length - 1 && /* @__PURE__ */ e(le, { variant: "inset" })
837
+ ] }, S.guid)) }),
838
+ y.length > 3 && /* @__PURE__ */ a(W, { children: [
839
+ /* @__PURE__ */ e(k, { children: /* @__PURE__ */ e(
840
+ P,
841
+ {
842
+ endIcon: /* @__PURE__ */ e(Z, {}),
843
+ onClick: () => d(!0),
844
+ size: "small",
845
+ sx: { my: 0, px: 16, py: 12, width: "100%" },
846
+ children: /* @__PURE__ */ a(I, { bold: !0, variant: "body1", children: [
847
+ y.length - 3,
848
+ " ",
849
+ o
850
+ ] })
851
+ }
852
+ ) }),
853
+ /* @__PURE__ */ e(ne, { isOpen: _, onClose: () => d(!1), title: i.accounts, children: /* @__PURE__ */ e(Bt, { loadAccounts: t }) })
854
+ ] })
855
+ ] }) : /* @__PURE__ */ a(W, { children: [
856
+ /* @__PURE__ */ e(k, { children: /* @__PURE__ */ e(
857
+ P,
858
+ {
859
+ onClick: () => h(!0),
860
+ size: "small",
861
+ sx: { my: 0, px: 16, py: 12, width: "100%" },
862
+ variant: "contained",
863
+ children: /* @__PURE__ */ e(I, { bold: !0, variant: "body1", children: i.connect_more_accounts_button })
864
+ }
865
+ ) }),
866
+ /* @__PURE__ */ e(
867
+ re,
868
+ {
869
+ onClose: () => h(!1),
870
+ showConnectWidget: u,
871
+ title: s.mini_title
872
+ }
873
+ )
874
+ ] });
875
+ }, Wt = v(Ho), Se = ({ balance: t, title: o, sx: n }) => /* @__PURE__ */ a(
876
+ p,
877
+ {
878
+ sx: {
879
+ alignItems: "center",
880
+ backgroundColor: "background.default",
881
+ borderRadius: 2,
882
+ height: 72,
883
+ justifyContent: "center",
884
+ p: 12,
885
+ ...n
886
+ },
887
+ children: [
888
+ typeof t == "number" ? /* @__PURE__ */ e(M, { variant: "h2", children: B(t, "0,0.00") }) : t,
889
+ /* @__PURE__ */ e(M, { color: "text.secondary", fontWeight: "400", variant: "subtitle2", children: o })
890
+ ]
891
+ }
892
+ );
893
+ var A = /* @__PURE__ */ ((t) => (t[t.ConnectAccounts = 1] = "ConnectAccounts", t[t.MonthlyIncome = 2] = "MonthlyIncome", t[t.Birthday = 3] = "Birthday", t[t.CreditScore = 4] = "CreditScore", t))(A || {}), De = /* @__PURE__ */ ((t) => (t[t.Months = 1] = "Months", t[t.Years = 2] = "Years", t[t.Days = 3] = "Days", t))(De || {}), Q = /* @__PURE__ */ ((t) => (t[t.Monthly = 1] = "Monthly", t[t.BiWeekly = 2] = "BiWeekly", t[t.Weekly = 3] = "Weekly", t[t.Daily = 4] = "Daily", t))(Q || {});
894
+ const No = ({ total: t }) => {
895
+ const { finstrong: o } = x(), n = [
896
+ { id: Q.Monthly, label: o.maintain_emergency_savings_monthly },
897
+ { id: Q.BiWeekly, label: o.maintain_emergency_savings_bi_weekly },
898
+ { id: Q.Weekly, label: o.maintain_emergency_savings_weekly },
899
+ { id: Q.Daily, label: o.maintain_emergency_savings_daily }
900
+ ], r = {
901
+ [Q.Monthly]: o.maintain_emergency_savings_estimated_period_monthly,
902
+ [Q.BiWeekly]: o.maintain_emergency_savings_estimated_period_bi_weekly,
903
+ [Q.Weekly]: o.maintain_emergency_savings_estimated_period_weekly,
904
+ [Q.Daily]: o.maintain_emergency_savings_estimated_period_daily
905
+ }, s = [
906
+ { id: De.Months, label: o.maintain_emergency_savings_months },
907
+ { id: De.Years, label: o.maintain_emergency_savings_years },
908
+ { id: De.Days, label: o.maintain_emergency_savings_days }
909
+ ], i = Math.ceil((t + 1) / 1e3) * 1e3, [c, l] = m.useState(0), [_, d] = m.useState(ot(t)), [u, h] = m.useState(
910
+ ot(t)
911
+ ), [y, f] = m.useState(i), [C, S] = m.useState(kn(t)), [D, g] = m.useState(De.Months);
912
+ m.useEffect(() => {
913
+ l(
914
+ rt({
915
+ contribution: u,
916
+ goalAmount: y,
917
+ goalPeriod: C,
918
+ targetPeriod: D,
919
+ totalSaved: t
920
+ })
921
+ ), d(u);
922
+ }, []);
923
+ const b = (w) => {
924
+ w.preventDefault(), l(
925
+ rt({
926
+ contribution: u,
927
+ goalAmount: y,
928
+ goalPeriod: C,
929
+ targetPeriod: D,
930
+ totalSaved: t
931
+ })
932
+ ), d(u);
933
+ };
934
+ return /* @__PURE__ */ e(V, { children: /* @__PURE__ */ e("form", { onSubmit: b, children: /* @__PURE__ */ a(p, { sx: { gap: 24, pb: 24, pt: 16, px: 16 }, children: [
935
+ /* @__PURE__ */ e(
936
+ Se,
937
+ {
938
+ balance: /* @__PURE__ */ a(p, { sx: { flexDirection: "row", height: 32 }, children: [
939
+ /* @__PURE__ */ e(I, { variant: "h2", children: B(c, "0,0") }),
940
+ /* @__PURE__ */ a(I, { sx: { alignSelf: "end", height: 24 }, variant: "subtitle2", children: [
941
+ "/",
942
+ r[_]
943
+ ] })
944
+ ] }),
945
+ title: o.maintain_emergency_savings_estimated_contribution
946
+ }
947
+ ),
948
+ /* @__PURE__ */ e(
949
+ Pe,
950
+ {
951
+ "aria-label": o.maintain_emergency_savings_savings_goal,
952
+ helperText: j(
953
+ o.maintain_emergency_savings_suggested_goal,
954
+ B(i, "0,0")
955
+ ),
956
+ inputProps: {
957
+ noValidate: !0,
958
+ pattern: "[0-9]*"
959
+ },
960
+ label: o.maintain_emergency_savings_savings_goal,
961
+ onChange: (w) => {
962
+ w.target.value && f(Number(w.target.value.replace(/[^0-9]/g, "")));
963
+ },
964
+ value: y ? B(y, "0,0") : ""
965
+ }
966
+ ),
967
+ /* @__PURE__ */ e(
968
+ it,
969
+ {
970
+ label: o.maintain_emergency_savings_how_often_contribute,
971
+ onChange: h,
972
+ options: n,
973
+ required: !0,
974
+ value: u
975
+ }
976
+ ),
977
+ /* @__PURE__ */ a(p, { sx: { flexDirection: "row" }, children: [
978
+ /* @__PURE__ */ e(
979
+ Pe,
980
+ {
981
+ "aria-label": o.maintain_emergency_savings_meet_your_goal_within,
982
+ fullWidth: !0,
983
+ inputProps: {
984
+ noValidate: !0,
985
+ pattern: "[0-9]*"
986
+ },
987
+ label: o.maintain_emergency_savings_meet_your_goal_within,
988
+ onChange: (w) => {
989
+ isNaN(Number(w.target.value)) || S(Number(w.target.value));
990
+ },
991
+ sx: {
992
+ "& .MuiInputBase-root": {
993
+ borderBottomRightRadius: 0,
994
+ borderTopRightRadius: 0,
995
+ fieldset: {
996
+ borderRightWidth: 0.5
997
+ }
998
+ }
999
+ },
1000
+ value: C
1001
+ }
1002
+ ),
1003
+ /* @__PURE__ */ e(
1004
+ k,
1005
+ {
1006
+ sx: {
1007
+ "& .MuiInputBase-root": {
1008
+ borderBottomLeftRadius: 0,
1009
+ borderTopLeftRadius: 0,
1010
+ fieldset: {
1011
+ borderLeftWidth: 0.5
1012
+ }
1013
+ }
1014
+ },
1015
+ children: /* @__PURE__ */ e(it, { label: "", onChange: g, options: s, value: D })
1016
+ }
1017
+ )
1018
+ ] }),
1019
+ /* @__PURE__ */ e(P, { fullWidth: !0, onClick: b, type: "submit", variant: "contained", children: o.maintain_emergency_savings_calculate })
1020
+ ] }) }) });
1021
+ }, Ko = v(No), jo = () => {
1022
+ const { savingsAccounts: t } = xe(), { finstrong: o } = x(), [n, r] = m.useState(!1), s = m.useMemo(
1023
+ () => t.reduce((i, c) => i + (c.balance ?? 0), 0),
1024
+ [t]
1025
+ );
1026
+ return /* @__PURE__ */ a(p, { sx: { gap: 24 }, children: [
1027
+ /* @__PURE__ */ e(V, { sx: { bgcolor: "background.paper", p: 16 }, children: /* @__PURE__ */ a(p, { sx: { gap: 16 }, children: [
1028
+ /* @__PURE__ */ e(Se, { balance: s, title: o.maintain_emergency_savings_your_savings }),
1029
+ t.length ? /* @__PURE__ */ e(
1030
+ Wt,
1031
+ {
1032
+ loadAccounts: [He.SAVINGS],
1033
+ loadMoreLabel: o.connect_more_accounts_button
1034
+ }
1035
+ ) : /* @__PURE__ */ e(P, { onClick: () => r(!0), variant: "contained", children: o.connect_more_accounts_button })
1036
+ ] }) }),
1037
+ /* @__PURE__ */ e(Ko, { total: s }),
1038
+ /* @__PURE__ */ e(
1039
+ re,
1040
+ {
1041
+ onClose: () => r(!1),
1042
+ showConnectWidget: n,
1043
+ title: o.connect_more_accounts_button
1044
+ }
1045
+ )
1046
+ ] });
1047
+ }, Yo = v(jo), Ge = v(
1048
+ ({ label: t, value: o, status: n, bottomComponent: r, statusBarData: s = [] }) => {
1049
+ const i = {
1050
+ GOOD: {
1051
+ progressBarColor: "primary.main"
1052
+ },
1053
+ FAIR: {
1054
+ progressBarColor: "warning.main"
1055
+ },
1056
+ OFF_TRACK: {
1057
+ progressBarColor: "error.main"
1058
+ },
1059
+ MISSING: {
1060
+ progressBarColor: "text.secondary"
1061
+ }
1062
+ }[n], c = s.map((l, _) => s.length === 2 ? {
1063
+ color: _ === 0 ? "primary.main" : l.color || i?.progressBarColor,
1064
+ percentage: l.percentage
1065
+ } : {
1066
+ color: l.color || i?.progressBarColor,
1067
+ percentage: l.percentage
1068
+ });
1069
+ return /* @__PURE__ */ a(
1070
+ p,
1071
+ {
1072
+ sx: {
1073
+ backgroundColor: "background.paper",
1074
+ gap: 8,
1075
+ p: 24,
1076
+ pt: 0,
1077
+ borderBottom: "1px solid",
1078
+ borderColor: "divider"
1079
+ },
1080
+ children: [
1081
+ /* @__PURE__ */ a(p, { sx: { gap: 2 }, children: [
1082
+ /* @__PURE__ */ e(I, { variant: "body2", children: t }),
1083
+ /* @__PURE__ */ a(
1084
+ p,
1085
+ {
1086
+ sx: {
1087
+ alignItems: "center",
1088
+ flexDirection: "row",
1089
+ gap: 12,
1090
+ justifyContent: "space-between"
1091
+ },
1092
+ children: [
1093
+ /* @__PURE__ */ e(Be, { children: o }),
1094
+ /* @__PURE__ */ e($e, { status: n })
1095
+ ]
1096
+ }
1097
+ )
1098
+ ] }),
1099
+ /* @__PURE__ */ a(p, { children: [
1100
+ /* @__PURE__ */ e(Yn, { data: c, height: 16 }),
1101
+ r
1102
+ ] })
1103
+ ]
1104
+ }
1105
+ );
1106
+ }
1107
+ ), Vo = {
1108
+ sticky_label: "You have saved"
1109
+ }, Xo = ["$0", "$250", "$500", "$750", "$1k"], qo = () => {
1110
+ const { healthScore: t } = R(), o = Math.round(t.emergency_savings_on_hand ?? NaN) || null, n = Mn(o), r = ft(o);
1111
+ return /* @__PURE__ */ e(
1112
+ Ge,
1113
+ {
1114
+ bottomComponent: /* @__PURE__ */ e(p, { sx: { flexDirection: "row", justifyContent: "space-between" }, children: Xo.map((s) => /* @__PURE__ */ a(p, { sx: { alignItems: "center", height: 24, width: 30 }, children: [
1115
+ /* @__PURE__ */ e(
1116
+ le,
1117
+ {
1118
+ orientation: "vertical",
1119
+ sx: {
1120
+ borderWidth: 0.5,
1121
+ height: 8,
1122
+ mt: 2
1123
+ }
1124
+ }
1125
+ ),
1126
+ /* @__PURE__ */ e(I, { variant: "caption", children: s })
1127
+ ] }, s)) }),
1128
+ label: Vo.sticky_label,
1129
+ status: r,
1130
+ statusBarData: [
1131
+ {
1132
+ percentage: n
1133
+ }
1134
+ ],
1135
+ value: B(o ?? 0, "0,0.00")
1136
+ }
1137
+ );
1138
+ }, Uo = v(qo), ze = ({
1139
+ transactions: t = [],
1140
+ amountColor: o = "success.main",
1141
+ amountPosition: n = "center",
1142
+ formatDate: r = It,
1143
+ secondaryIcon: s
1144
+ }) => {
1145
+ const i = $(), { connect: c, finstrong: l, categories: _ } = x(), [d, u] = m.useState(!1), [h, y] = m.useState(!1), { getCategoryName: f } = Ve(), C = 3, S = t.length > C, D = t.length - C;
1146
+ let g = t;
1147
+ return S && (g = t.map((b) => ({
1148
+ ...b,
1149
+ category: _.default_categories[b.top_level_category_guid]?.replace(
1150
+ /&amp;/g,
1151
+ "&"
1152
+ ) ?? f(b.top_level_category_guid)
1153
+ })).sort((b, w) => w.date - b.date)), !t || t.length === 0 ? /* @__PURE__ */ a(W, { children: [
1154
+ /* @__PURE__ */ e(k, { children: /* @__PURE__ */ e(
1155
+ P,
1156
+ {
1157
+ onClick: () => y(!0),
1158
+ size: "small",
1159
+ sx: { my: 0, px: 16, py: 12, width: "100%" },
1160
+ variant: "contained",
1161
+ children: /* @__PURE__ */ e(I, { bold: !0, variant: "body1", children: l.connect_more_accounts_button })
1162
+ }
1163
+ ) }),
1164
+ /* @__PURE__ */ e(
1165
+ re,
1166
+ {
1167
+ onClose: () => y(!1),
1168
+ showConnectWidget: h,
1169
+ title: c.mini_title
1170
+ }
1171
+ )
1172
+ ] }) : /* @__PURE__ */ a(p, { sx: { gap: 16 }, children: [
1173
+ /* @__PURE__ */ e(k, { sx: { border: `1px solid ${i.palette.divider}`, borderRadius: 2 }, children: t.slice(0, C).sort((b, w) => w.date - b.date).map((b, w) => /* @__PURE__ */ a(
1174
+ p,
1175
+ {
1176
+ sx: {
1177
+ alignItems: "center",
1178
+ flexDirection: "row",
1179
+ gap: 16,
1180
+ pl: 24,
1181
+ pt: 14
1182
+ },
1183
+ children: [
1184
+ /* @__PURE__ */ e(p, { sx: { pb: 14 }, children: /* @__PURE__ */ e(
1185
+ yn,
1186
+ {
1187
+ categoryGuid: b.top_level_category_guid || "",
1188
+ merchantGuid: b.merchant_guid || "",
1189
+ size: 32
1190
+ }
1191
+ ) }),
1192
+ /* @__PURE__ */ a(
1193
+ p,
1194
+ {
1195
+ sx: {
1196
+ alignItems: n,
1197
+ flexDirection: "row",
1198
+ gap: 12,
1199
+ justifyContent: "space-between",
1200
+ ...w < Math.min(t.length, C) - 1 && {
1201
+ borderBottom: `1px solid ${i.palette.divider}`
1202
+ },
1203
+ pb: 14,
1204
+ pr: 24,
1205
+ width: "100%"
1206
+ },
1207
+ children: [
1208
+ /* @__PURE__ */ a(p, { sx: { gap: 4 }, children: [
1209
+ /* @__PURE__ */ e(M, { bold: !0, variant: "body1", children: b.description }),
1210
+ /* @__PURE__ */ a(p, { sx: { flexDirection: "row", alignItems: "center", gap: 4 }, children: [
1211
+ !!s && s,
1212
+ /* @__PURE__ */ e(I, { variant: "caption", children: r(b.date) })
1213
+ ] })
1214
+ ] }),
1215
+ /* @__PURE__ */ e(M, { bold: !0, sx: { color: o, flexShrink: 0 }, variant: "body1", children: B(b.amount, "0,0.00") })
1216
+ ]
1217
+ },
1218
+ b.guid || w
1219
+ )
1220
+ ]
1221
+ },
1222
+ w
1223
+ )) }),
1224
+ S && /* @__PURE__ */ a(W, { children: [
1225
+ /* @__PURE__ */ e(k, { children: /* @__PURE__ */ e(
1226
+ P,
1227
+ {
1228
+ endIcon: /* @__PURE__ */ e(Z, {}),
1229
+ onClick: () => u(!0),
1230
+ size: "small",
1231
+ sx: { my: 0, px: 16, py: 12, width: "100%" },
1232
+ children: /* @__PURE__ */ a(I, { bold: !0, variant: "body1", children: [
1233
+ D,
1234
+ " ",
1235
+ l.key_indicators_borrow.have_manageable_debt_drawer.have_manageable_debt_more_transactions
1236
+ ] })
1237
+ }
1238
+ ) }),
1239
+ /* @__PURE__ */ e(
1240
+ ne,
1241
+ {
1242
+ isOpen: d,
1243
+ onClose: () => u(!1),
1244
+ title: l.key_indicators_borrow.have_manageable_debt_drawer.have_manageable_debt_transactions,
1245
+ children: /* @__PURE__ */ e(Vn, { transaction: g })
1246
+ }
1247
+ )
1248
+ ] })
1249
+ ] });
1250
+ }, Qo = () => {
1251
+ const {
1252
+ finstrong: {
1253
+ key_indicators_spend: { pay_bills_on_time_drawer: t }
1254
+ }
1255
+ } = x(), { getSpendingFeeTransactions: o, allTransactions: n } = R();
1256
+ return m.useEffect(() => {
1257
+ o().finally();
1258
+ }, []), /* @__PURE__ */ e(W, { children: n.spendingFee.length === 0 ? /* @__PURE__ */ a(
1259
+ V,
1260
+ {
1261
+ sx: {
1262
+ backgroundColor: "background.paper",
1263
+ pb: 48,
1264
+ pt: 32,
1265
+ px: 24,
1266
+ textAlign: "center",
1267
+ width: "100%"
1268
+ },
1269
+ children: [
1270
+ /* @__PURE__ */ e(ln, { filled: !0, size: 48, sx: { color: "success.main" } }),
1271
+ /* @__PURE__ */ a(p, { sx: { alignItems: "center", gap: 4, pt: 24 }, children: [
1272
+ /* @__PURE__ */ e(Y, { children: t.pay_bills_on_time_zero_fees_title }),
1273
+ /* @__PURE__ */ e(M, { variant: "subtitle1", children: t.pay_bills_on_time_zero_fees_description })
1274
+ ] })
1275
+ ]
1276
+ }
1277
+ ) : /* @__PURE__ */ a(
1278
+ V,
1279
+ {
1280
+ sx: {
1281
+ p: 16,
1282
+ width: "100%",
1283
+ backgroundColor: "background.paper"
1284
+ },
1285
+ children: [
1286
+ /* @__PURE__ */ e(Y, { sx: { textAlign: "left", pb: 8 }, children: t.pay_bills_on_time_sticky_fee_count }),
1287
+ /* @__PURE__ */ e(
1288
+ ze,
1289
+ {
1290
+ amountColor: "text.primary",
1291
+ amountPosition: "flex-start",
1292
+ formatDate: (r) => zn(new Date(r * 1e3), En.MONTH_DAY),
1293
+ secondaryIcon: /* @__PURE__ */ e(dn, { color: "error", filled: !0, size: 12 }),
1294
+ transactions: n.spendingFee
1295
+ }
1296
+ )
1297
+ ]
1298
+ }
1299
+ ) });
1300
+ }, Zo = v(Qo), Jo = () => {
1301
+ const { healthScore: t } = R(), { finstrong: o } = x(), { key_indicators_spend: n } = o, { pay_bills_on_time_drawer: r } = n, s = Dn(t.spending_fee_transaction_count);
1302
+ return /* @__PURE__ */ a(
1303
+ p,
1304
+ {
1305
+ sx: {
1306
+ px: 24,
1307
+ pb: 24,
1308
+ backgroundColor: "background.paper",
1309
+ borderBottom: "1px solid",
1310
+ borderColor: "divider"
1311
+ },
1312
+ children: [
1313
+ /* @__PURE__ */ e(M, { variant: "body2", children: r.pay_bills_on_time_sticky_description }),
1314
+ /* @__PURE__ */ a(p, { direction: "row", sx: { alignItems: "center", justifyContent: "space-between" }, children: [
1315
+ /* @__PURE__ */ a(Be, { children: [
1316
+ t.spending_fee_transaction_count,
1317
+ " ",
1318
+ r.pay_bills_on_time_sticky_fee_count
1319
+ ] }),
1320
+ /* @__PURE__ */ e($e, { status: s })
1321
+ ] })
1322
+ ]
1323
+ }
1324
+ );
1325
+ }, er = v(Jo), tr = () => {
1326
+ const { savingsAndCheckingAccountsBalance: t } = xe(), { finstrong: o } = x();
1327
+ return /* @__PURE__ */ a(p, { gap: 16, sx: { p: 16 }, children: [
1328
+ /* @__PURE__ */ e(
1329
+ Se,
1330
+ {
1331
+ balance: t,
1332
+ title: o.key_indicators_save.drawer_available_balance
1333
+ }
1334
+ ),
1335
+ /* @__PURE__ */ e(
1336
+ Wt,
1337
+ {
1338
+ loadAccounts: [He.SAVINGS, He.CHECKING],
1339
+ loadMoreLabel: o.more_accounts
1340
+ }
1341
+ )
1342
+ ] });
1343
+ }, nr = v(tr), or = () => {
1344
+ const { finstrong: t } = x(), { healthScore: o, allTransactions: n, loadSpendTransactions: r, loadDebtSpend: s } = R(), { isInitialized: i } = X();
1345
+ m.useEffect(() => {
1346
+ i && (r().finally(), s().finally());
1347
+ }, [i]);
1348
+ const c = m.useMemo(() => {
1349
+ const l = n.spend.map((d) => d.transaction), _ = n.debtSpend.map((d) => d.transaction);
1350
+ return [...l, ..._];
1351
+ }, [n.spend, n.debtSpend]);
1352
+ return i ? /* @__PURE__ */ a(p, { gap: 16, sx: { p: 16 }, children: [
1353
+ /* @__PURE__ */ e(
1354
+ Se,
1355
+ {
1356
+ balance: o.ninety_day_spend / 90,
1357
+ title: t.key_indicators_save.drawer_daily_spend
1358
+ }
1359
+ ),
1360
+ /* @__PURE__ */ e(ze, { amountColor: "text.primary", transactions: c })
1361
+ ] }) : /* @__PURE__ */ e(oe, {});
1362
+ }, rr = v(or), ar = () => {
1363
+ const [t, o] = m.useState(0), { finstrong: n } = x();
1364
+ return /* @__PURE__ */ a(W, { children: [
1365
+ /* @__PURE__ */ a(V, { children: [
1366
+ /* @__PURE__ */ a(
1367
+ Ue,
1368
+ {
1369
+ "aria-label": n.key_indicators_save.drawer_title,
1370
+ centered: !0,
1371
+ onChange: (r, s) => o(s),
1372
+ selectionFollowsFocus: !0,
1373
+ sx: { mb: 0 },
1374
+ value: t,
1375
+ variant: "fullWidth",
1376
+ children: [
1377
+ /* @__PURE__ */ e(
1378
+ se,
1379
+ {
1380
+ "aria-controls": "available-details-tabpanel-0",
1381
+ label: n.key_indicators_save.drawer_available,
1382
+ sx: { minHeight: 44 }
1383
+ }
1384
+ ),
1385
+ /* @__PURE__ */ e(
1386
+ se,
1387
+ {
1388
+ "aria-controls": "spending-details-tabpanel-1",
1389
+ label: n.key_indicators_save.drawer_spending,
1390
+ sx: { minHeight: 44 }
1391
+ }
1392
+ )
1393
+ ]
1394
+ }
1395
+ ),
1396
+ /* @__PURE__ */ e(ce, { index: 0, name: "available-details", value: t, children: /* @__PURE__ */ e(nr, {}) }),
1397
+ /* @__PURE__ */ e(ce, { index: 1, name: "spending-details", value: t, children: /* @__PURE__ */ e(rr, {}) })
1398
+ ] }),
1399
+ /* @__PURE__ */ e(Ze, { chartFor: "savingsOverTime" })
1400
+ ] });
1401
+ }, ir = v(ar), sr = () => {
1402
+ const { finstrong: t } = x(), { healthScore: o } = R(), n = o.months_of_cash_on_hand, r = xt(n ? n * 30 : null), s = 183 / 6, i = Math.floor(n), c = Math.round((n - i) * s), l = n / 6 * 100;
1403
+ return /* @__PURE__ */ e(
1404
+ Ge,
1405
+ {
1406
+ bottomComponent: /* @__PURE__ */ e(
1407
+ p,
1408
+ {
1409
+ sx: {
1410
+ flexDirection: "row",
1411
+ height: 24,
1412
+ justifyContent: "space-between",
1413
+ mt: 2,
1414
+ px: 1
1415
+ },
1416
+ children: ["0 Mo", "1 Mo", "2 Mo", "3 Mo", "4 Mo", "5 Mo", "6 Mo"].map((d) => /* @__PURE__ */ a(
1417
+ p,
1418
+ {
1419
+ sx: {
1420
+ alignItems: "center",
1421
+ height: 24
1422
+ },
1423
+ children: [
1424
+ /* @__PURE__ */ e(
1425
+ le,
1426
+ {
1427
+ orientation: "vertical",
1428
+ sx: {
1429
+ borderWidth: 1,
1430
+ height: 8
1431
+ }
1432
+ }
1433
+ ),
1434
+ /* @__PURE__ */ e(I, { variant: "XSmall", children: d })
1435
+ ]
1436
+ },
1437
+ d
1438
+ ))
1439
+ }
1440
+ ),
1441
+ label: t.key_indicators_save.drawer_progress_bar_label,
1442
+ status: r,
1443
+ statusBarData: [
1444
+ {
1445
+ percentage: `${l}%`
1446
+ }
1447
+ ],
1448
+ value: j(t.key_indicators_save.drawer_progress_bar_value, i, c)
1449
+ }
1450
+ );
1451
+ }, cr = v(sr), lr = () => {
1452
+ const { healthScore: t } = R(), { finstrong: o } = x(), n = Re(t.debt_to_income_ratio) ?? 0, r = Object.keys(t).length === 0, i = ((c) => r ? "MISSING" : c <= Ae.Good ? "GOOD" : c >= Ae.FairMin && c <= Ae.FairMax ? "FAIR" : c >= Ae.OffTrack ? "OFF_TRACK" : "MISSING")(n);
1453
+ return /* @__PURE__ */ e(
1454
+ Ge,
1455
+ {
1456
+ bottomComponent: /* @__PURE__ */ a(
1457
+ p,
1458
+ {
1459
+ sx: {
1460
+ alignItems: "flex-end",
1461
+ flexDirection: "row",
1462
+ height: 24,
1463
+ justifyContent: "space-between",
1464
+ mt: 2,
1465
+ position: "relative"
1466
+ },
1467
+ children: [
1468
+ /* @__PURE__ */ e(
1469
+ k,
1470
+ {
1471
+ sx: {
1472
+ left: "30%",
1473
+ position: "absolute",
1474
+ transform: "translateX(-50%)"
1475
+ },
1476
+ children: /* @__PURE__ */ a(
1477
+ p,
1478
+ {
1479
+ sx: {
1480
+ alignItems: "center",
1481
+ flexDirection: "column",
1482
+ height: 24,
1483
+ justifyContent: "flex-end"
1484
+ },
1485
+ children: [
1486
+ /* @__PURE__ */ e(
1487
+ le,
1488
+ {
1489
+ orientation: "vertical",
1490
+ sx: {
1491
+ borderWidth: 1,
1492
+ height: 8
1493
+ }
1494
+ }
1495
+ ),
1496
+ /* @__PURE__ */ e(I, { sx: { color: "text.primary" }, variant: "XSmall", children: "30%" })
1497
+ ]
1498
+ }
1499
+ )
1500
+ }
1501
+ ),
1502
+ /* @__PURE__ */ e(
1503
+ k,
1504
+ {
1505
+ sx: {
1506
+ display: "flex",
1507
+ flexDirection: "column",
1508
+ height: 24,
1509
+ justifyContent: "center",
1510
+ marginLeft: "auto"
1511
+ },
1512
+ children: /* @__PURE__ */ e(I, { variant: "Small", children: j(
1513
+ o.key_indicators_borrow.have_manageable_debt_drawer.have_manageable_debt_sticky_description,
1514
+ n
1515
+ ) })
1516
+ }
1517
+ )
1518
+ ]
1519
+ }
1520
+ ),
1521
+ label: o.key_indicators_borrow.have_manageable_debt_drawer.have_manageable_debt_sticky_title,
1522
+ status: i,
1523
+ statusBarData: [
1524
+ {
1525
+ percentage: `${n}%`
1526
+ }
1527
+ ],
1528
+ value: B(t.ninety_day_debt_spend, "0,0.00")
1529
+ }
1530
+ );
1531
+ }, dr = v(lr), pr = () => {
1532
+ const { healthScore: t, allTransactions: o } = R(), { connect: n, finstrong: r } = x(), [s, i] = m.useState(!1);
1533
+ return /* @__PURE__ */ a(p, { gap: 16, sx: { p: 16 }, children: [
1534
+ /* @__PURE__ */ e(
1535
+ Se,
1536
+ {
1537
+ balance: t.ninety_day_income,
1538
+ sx: { flexDirection: "column-reverse" },
1539
+ title: r.key_indicators_borrow.have_manageable_debt_drawer.have_manageable_debt_income
1540
+ }
1541
+ ),
1542
+ o.income.length ? (
1543
+ // TODO: Need to add More Transactions functionality
1544
+ /* @__PURE__ */ e(ze, { transactions: o.income.map((c) => c.transaction) })
1545
+ ) : /* @__PURE__ */ e(
1546
+ P,
1547
+ {
1548
+ onClick: () => {
1549
+ i(!0);
1550
+ },
1551
+ variant: "contained",
1552
+ children: r.connect_more_accounts_button
1553
+ }
1554
+ ),
1555
+ /* @__PURE__ */ e(
1556
+ re,
1557
+ {
1558
+ onClose: () => i(!1),
1559
+ showConnectWidget: s,
1560
+ title: n.mini_title
1561
+ }
1562
+ )
1563
+ ] });
1564
+ }, _r = v(pr), ur = () => {
1565
+ const { allTransactions: t, healthScore: o } = R(), { connect: n, finstrong: r } = x(), [s, i] = m.useState(!1);
1566
+ return /* @__PURE__ */ a(p, { gap: 16, sx: { p: 16 }, children: [
1567
+ /* @__PURE__ */ e(
1568
+ Se,
1569
+ {
1570
+ balance: o.ninety_day_debt_spend,
1571
+ sx: { flexDirection: "column-reverse" },
1572
+ title: r.key_indicators_borrow.have_manageable_debt_drawer.have_manageable_debt_payments
1573
+ }
1574
+ ),
1575
+ t.debtSpend.length ? (
1576
+ //TODO: Need to add More Transactions functionality
1577
+ /* @__PURE__ */ e(
1578
+ ze,
1579
+ {
1580
+ amountColor: "text.primary",
1581
+ transactions: t.debtSpend.map((c) => c.transaction)
1582
+ }
1583
+ )
1584
+ ) : /* @__PURE__ */ e(
1585
+ P,
1586
+ {
1587
+ onClick: () => {
1588
+ i(!0);
1589
+ },
1590
+ variant: "contained",
1591
+ children: r.connect_more_accounts_button
1592
+ }
1593
+ ),
1594
+ /* @__PURE__ */ e(
1595
+ re,
1596
+ {
1597
+ onClose: () => i(!1),
1598
+ showConnectWidget: s,
1599
+ title: n.mini_title
1600
+ }
1601
+ )
1602
+ ] });
1603
+ }, hr = v(ur), mr = ({
1604
+ color: t,
1605
+ data: o,
1606
+ series: n,
1607
+ style: r,
1608
+ ...s
1609
+ }) => {
1610
+ const i = $(), c = m.useRef(null), { width: l } = no({
1611
+ width: r.width
1612
+ });
1613
+ m.useLayoutEffect(() => {
1614
+ const h = new ResizeObserver(() => {
1615
+ window.requestAnimationFrame(() => {
1616
+ if (c.current) {
1617
+ const { width: y } = c.current.getBoundingClientRect(), f = y / 2, C = c.current.querySelector("text");
1618
+ C && C.setAttribute("transform", `translate(${f}, -8)`);
1619
+ }
1620
+ });
1621
+ });
1622
+ return c.current && h.observe(c.current), () => {
1623
+ c.current && h.unobserve(c.current);
1624
+ };
1625
+ }, []);
1626
+ const { formattedComparison: _, formattedMain: d } = o[n.index], u = n.type === 0 ? d : _;
1627
+ return /* @__PURE__ */ a("g", { children: [
1628
+ /* @__PURE__ */ e(st.rect, { ...s, fill: t, ref: c, rx: 2, style: r }),
1629
+ /* @__PURE__ */ e(
1630
+ st.text,
1631
+ {
1632
+ fill: i.palette.text.secondary,
1633
+ fontSize: 9,
1634
+ fontWeight: 400,
1635
+ textAnchor: "middle",
1636
+ transform: l.to((h) => `translate(${h / 2}, -5)`),
1637
+ x: r.x,
1638
+ y: r.y,
1639
+ children: u
1640
+ }
1641
+ )
1642
+ ] });
1643
+ }, Fe = (t, o = 1e3) => {
1644
+ const n = Math.abs(t) >= o ? "0.[0]a" : "0";
1645
+ return B(t, n);
1646
+ }, $t = ({
1647
+ chartFor: t,
1648
+ data: o,
1649
+ title: n,
1650
+ buttonLabel: r,
1651
+ onClick: s,
1652
+ legendLabelMain: i,
1653
+ legendLabelComparison: c,
1654
+ totalComparison: l,
1655
+ totalMain: _
1656
+ }) => {
1657
+ const d = $(), u = Zn(d.breakpoints.down("xs")), h = m.useMemo(
1658
+ () => o.sort((g, b) => g.month - b.month).map((g) => {
1659
+ const b = In(g.month), w = {
1660
+ spending_vs_income: {
1661
+ main: g.standard_spend,
1662
+ comparison: g.income,
1663
+ formattedMain: Fe(g.standard_spend),
1664
+ formattedComparison: Fe(g.income)
1665
+ },
1666
+ debt_payment_vs_income: {
1667
+ main: g.income,
1668
+ comparison: g.debt_spend,
1669
+ formattedMain: Fe(g.income),
1670
+ formattedComparison: Fe(g.debt_spend)
1671
+ }
1672
+ };
1673
+ return {
1674
+ label: b,
1675
+ ...w[t]
1676
+ };
1677
+ }),
1678
+ [o, t]
1679
+ ), y = {
1680
+ dataKey: "label",
1681
+ scaleType: "band"
1682
+ }, f = Math.max(...h.map((g) => Math.max(g.main, g.comparison))), C = Math.ceil(f * 1.2 / 1e3) * 1e3, S = C / 3, D = {
1683
+ scaleType: "linear",
1684
+ min: 0,
1685
+ max: C,
1686
+ tickNumber: 4,
1687
+ tickMinStep: S,
1688
+ valueFormatter: (g) => g === 0 ? "$0" : `$${(g / 1e3).toFixed(0)}K`
1689
+ };
1690
+ return /* @__PURE__ */ a(
1691
+ V,
1692
+ {
1693
+ sx: {
1694
+ px: 16,
1695
+ py: 24
1696
+ },
1697
+ children: [
1698
+ /* @__PURE__ */ a(
1699
+ p,
1700
+ {
1701
+ sx: {
1702
+ alignItems: "center",
1703
+ flexDirection: "row",
1704
+ justifyContent: "space-between",
1705
+ gap: 12,
1706
+ pb: 8
1707
+ },
1708
+ children: [
1709
+ /* @__PURE__ */ e(Y, { children: n }),
1710
+ r && /* @__PURE__ */ e(
1711
+ P,
1712
+ {
1713
+ endIcon: /* @__PURE__ */ e(Z, {}),
1714
+ onClick: s,
1715
+ size: "small",
1716
+ sx: {
1717
+ pl: 8,
1718
+ height: 24
1719
+ },
1720
+ variant: "text",
1721
+ children: r
1722
+ }
1723
+ )
1724
+ ]
1725
+ }
1726
+ ),
1727
+ /* @__PURE__ */ a(p, { sx: { alignItems: "center", flexDirection: "row", gap: 24, py: 4 }, children: [
1728
+ /* @__PURE__ */ a(p, { sx: { gap: 8, alignItems: "center", flexDirection: "row" }, children: [
1729
+ /* @__PURE__ */ e(
1730
+ k,
1731
+ {
1732
+ sx: {
1733
+ width: 10,
1734
+ height: 10,
1735
+ backgroundColor: "chartMono.chartMono3",
1736
+ borderRadius: "2px"
1737
+ }
1738
+ }
1739
+ ),
1740
+ /* @__PURE__ */ a(p, { sx: { alignItems: "center", flexDirection: "row" }, children: [
1741
+ /* @__PURE__ */ a(I, { variant: "subtitle2", children: [
1742
+ i,
1743
+ " "
1744
+ ] }),
1745
+ !u && _ && /* @__PURE__ */ e(I, { sx: { fontWeight: 700 }, variant: "subtitle2", children: _ })
1746
+ ] })
1747
+ ] }),
1748
+ /* @__PURE__ */ a(p, { alignItems: "center", direction: "row", spacing: 8, children: [
1749
+ /* @__PURE__ */ e(
1750
+ k,
1751
+ {
1752
+ sx: {
1753
+ width: 10,
1754
+ height: 10,
1755
+ backgroundColor: "chartMono.chartMono5",
1756
+ borderRadius: "2px"
1757
+ }
1758
+ }
1759
+ ),
1760
+ /* @__PURE__ */ a(p, { sx: { alignItems: "center", flexDirection: "row" }, children: [
1761
+ /* @__PURE__ */ a(I, { variant: "subtitle2", children: [
1762
+ c,
1763
+ " "
1764
+ ] }),
1765
+ !u && l && /* @__PURE__ */ e(I, { sx: { fontWeight: 700 }, variant: "subtitle2", children: l })
1766
+ ] })
1767
+ ] })
1768
+ ] }),
1769
+ /* @__PURE__ */ a(
1770
+ to,
1771
+ {
1772
+ colors: [`${d.palette.chartMono.chartMono3}`, `${d.palette.chartMono.chartMono5}`],
1773
+ dataset: h,
1774
+ height: 240,
1775
+ margin: { top: 20, bottom: 30, right: 10, left: 42 },
1776
+ series: [
1777
+ { dataKey: "main", type: "bar" },
1778
+ { dataKey: "comparison", type: "bar" }
1779
+ ],
1780
+ xAxis: [y],
1781
+ yAxis: [D],
1782
+ children: [
1783
+ /* @__PURE__ */ e(
1784
+ an,
1785
+ {
1786
+ slots: {
1787
+ bar: (g) => {
1788
+ const { ownerState: b, style: w, ...H } = g;
1789
+ return /* @__PURE__ */ e(
1790
+ mr,
1791
+ {
1792
+ ...H,
1793
+ color: b.color,
1794
+ data: h,
1795
+ series: {
1796
+ index: b.dataIndex,
1797
+ type: Number(b.id.toString().split("-").pop())
1798
+ },
1799
+ style: w
1800
+ }
1801
+ );
1802
+ }
1803
+ }
1804
+ }
1805
+ ),
1806
+ /* @__PURE__ */ e(
1807
+ Jn,
1808
+ {
1809
+ sx: () => ({
1810
+ ".MuiChartsAxis-line": {
1811
+ stroke: d.palette.divider
1812
+ },
1813
+ ".MuiChartsAxis-tick": {
1814
+ stroke: d.palette.divider
1815
+ },
1816
+ ".MuiChartsAxis-tickLabel": {
1817
+ transform: "translateY(10px)"
1818
+ }
1819
+ }),
1820
+ tickLabelStyle: {
1821
+ fontSize: 11,
1822
+ fill: "text.secondary"
1823
+ }
1824
+ }
1825
+ ),
1826
+ /* @__PURE__ */ e(
1827
+ eo,
1828
+ {
1829
+ sx: () => ({
1830
+ ".MuiChartsAxis-line": {
1831
+ stroke: d.palette.divider
1832
+ },
1833
+ ".MuiChartsAxis-tick": {
1834
+ stroke: d.palette.divider
1835
+ },
1836
+ ".MuiChartsAxis-tickLabel": {
1837
+ transform: "translateX(-8px)"
1838
+ }
1839
+ }),
1840
+ tickLabelStyle: {
1841
+ fontSize: 11,
1842
+ fill: "text.secondary"
1843
+ }
1844
+ }
1845
+ )
1846
+ ]
1847
+ }
1848
+ )
1849
+ ]
1850
+ }
1851
+ );
1852
+ }, gr = () => {
1853
+ const { loadDebtSpend: t, loadIncome: o, monthlySummaries: n } = R(), { isInitialized: r } = X(), [s, i] = m.useState(0), { finstrong: c } = x();
1854
+ return m.useEffect(() => {
1855
+ r && (t().finally(), o().finally());
1856
+ }, [r]), /* @__PURE__ */ a(W, { children: [
1857
+ /* @__PURE__ */ a(V, { children: [
1858
+ /* @__PURE__ */ a(
1859
+ Ue,
1860
+ {
1861
+ "aria-label": c.key_indicators_save.drawer_title,
1862
+ centered: !0,
1863
+ onChange: (l, _) => i(_),
1864
+ selectionFollowsFocus: !0,
1865
+ sx: { mb: 0 },
1866
+ value: s,
1867
+ variant: "fullWidth",
1868
+ children: [
1869
+ /* @__PURE__ */ e(
1870
+ se,
1871
+ {
1872
+ "aria-controls": "income-details-tabpanel-0",
1873
+ id: "income-details-tab-0",
1874
+ label: c.key_indicators_borrow.have_manageable_debt_drawer.income,
1875
+ sx: { minHeight: 44 }
1876
+ }
1877
+ ),
1878
+ /* @__PURE__ */ e(
1879
+ se,
1880
+ {
1881
+ "aria-controls": "debt-payment-details-tabpanel-1",
1882
+ id: "debt-payment-details-tab-1",
1883
+ label: c.key_indicators_borrow.have_manageable_debt_drawer.debt_payment,
1884
+ sx: { minHeight: 44 }
1885
+ }
1886
+ )
1887
+ ]
1888
+ }
1889
+ ),
1890
+ /* @__PURE__ */ e(
1891
+ ce,
1892
+ {
1893
+ "aria-labelledby": "income-details-tab-0",
1894
+ index: 0,
1895
+ name: "income-details",
1896
+ value: s,
1897
+ children: /* @__PURE__ */ e(_r, {})
1898
+ }
1899
+ ),
1900
+ /* @__PURE__ */ e(
1901
+ ce,
1902
+ {
1903
+ "aria-labelledby": "debt-payment-details-tab-1",
1904
+ index: 1,
1905
+ name: "debt-payment-details",
1906
+ value: s,
1907
+ children: /* @__PURE__ */ e(hr, {})
1908
+ }
1909
+ )
1910
+ ] }),
1911
+ n.length ? /* @__PURE__ */ a(W, { children: [
1912
+ /* @__PURE__ */ e(
1913
+ $t,
1914
+ {
1915
+ chartFor: "debt_payment_vs_income",
1916
+ data: n,
1917
+ legendLabelComparison: c.key_indicators_borrow.have_manageable_debt_drawer.debt_payment,
1918
+ legendLabelMain: c.key_indicators_borrow.have_manageable_debt_drawer.income,
1919
+ title: c.key_indicators_borrow.have_manageable_debt_drawer.debt_payment
1920
+ }
1921
+ ),
1922
+ /* @__PURE__ */ e(Ze, { chartFor: "debtOverTime" })
1923
+ ] }) : /* @__PURE__ */ a(W, { children: [
1924
+ /* @__PURE__ */ e(
1925
+ Le,
1926
+ {
1927
+ header: c.key_indicators_borrow.have_manageable_debt_drawer.have_manageable_debt_double_bar_chart_empty_state_header,
1928
+ icon: "multiline_chart",
1929
+ subText: c.key_indicators_borrow.have_manageable_debt_drawer.have_manageable_debt_double_bar_chart_empty_state_description,
1930
+ sx: {
1931
+ backgroundColor: "background.paper",
1932
+ borderRadius: "8px",
1933
+ boxShadow: 1,
1934
+ p: 24,
1935
+ pb: 48
1936
+ },
1937
+ variant: "no-buttons"
1938
+ }
1939
+ ),
1940
+ /* @__PURE__ */ e(
1941
+ Le,
1942
+ {
1943
+ header: c.key_indicators_borrow.have_manageable_debt_drawer.have_manageable_debt_line_chart_empty_state_header,
1944
+ icon: "multiline_chart",
1945
+ subText: c.key_indicators_borrow.have_manageable_debt_drawer.have_manageable_debt_line_chart_empty_state_description,
1946
+ sx: {
1947
+ backgroundColor: "background.paper",
1948
+ borderRadius: "8px",
1949
+ boxShadow: 1,
1950
+ p: 24,
1951
+ pb: 48
1952
+ },
1953
+ variant: "no-buttons"
1954
+ }
1955
+ )
1956
+ ] })
1957
+ ] });
1958
+ }, yr = v(gr), br = () => {
1959
+ const { healthScore: t } = R(), { finstrong: o } = x(), n = Re(t.spend_to_income_ratio) ?? 0, r = Object.keys(t).length === 0, i = ((l) => r ? "MISSING" : l < Oe.Good ? "GOOD" : l >= Oe.Good && l <= Oe.Fair ? "FAIR" : l >= Oe.OffTrack ? "OFF_TRACK" : "MISSING")(n), c = {
1960
+ GOOD: [{ percentage: `${n}%` }],
1961
+ FAIR: [{ percentage: "100%" }, { percentage: `${n - 100}%` }],
1962
+ OFF_TRACK: [{ percentage: "100%" }, { percentage: `${n - 100}%` }],
1963
+ MISSING: [{ percentage: "0%" }]
1964
+ }[i];
1965
+ return /* @__PURE__ */ e(
1966
+ Ge,
1967
+ {
1968
+ bottomComponent: /* @__PURE__ */ a(
1969
+ p,
1970
+ {
1971
+ sx: {
1972
+ flexDirection: "row",
1973
+ justifyContent: "space-between",
1974
+ alignItems: "center",
1975
+ mt: 8
1976
+ },
1977
+ children: [
1978
+ /* @__PURE__ */ a(I, { variant: "body2", children: [
1979
+ r ? "-" : B(t.ninety_day_income, "0,0.00"),
1980
+ " ",
1981
+ o?.key_indicators_spend.spend_less_than_you_make_drawer.income
1982
+ ] }),
1983
+ /* @__PURE__ */ a(I, { variant: "body2", children: [
1984
+ r ? "-%" : `${n}%`,
1985
+ " ",
1986
+ o?.key_indicators_spend.spend_less_than_you_make_drawer.spent
1987
+ ] })
1988
+ ]
1989
+ }
1990
+ ),
1991
+ label: o?.key_indicators_spend.spend_less_than_you_make_drawer.spend_less_than_you_make_sticky_description,
1992
+ status: i,
1993
+ statusBarData: c,
1994
+ value: r ? "$0" : B(t.ninety_day_spend, "0,0.00")
1995
+ }
1996
+ );
1997
+ }, fr = v(br), xr = () => {
1998
+ const { accounts: t } = xe(), { categories: o, dateRangeCategoryTotals: n, loadDateRangeCategoryTotals: r } = Ve(), { monthlySummaries: s, handleFinstrongWidgetPrimaryCtaClick: i } = R(), { appDataStore: c } = Ln(), { finstrong: l, goals: _, spending: d } = x(), u = $(), [h, y] = m.useState("");
1999
+ m.useEffect(() => {
2000
+ r(
2001
+ t,
2002
+ Tt(/* @__PURE__ */ new Date()),
2003
+ At(/* @__PURE__ */ new Date())
2004
+ ).finally();
2005
+ }, [t]);
2006
+ const f = m.useMemo(
2007
+ () => oo(o, _, u, n),
2008
+ [o, n]
2009
+ ), C = (g) => {
2010
+ y(h === g ? "" : g);
2011
+ }, { totalSpending: S, totalIncome: D } = m.useMemo(() => s?.reduce(
2012
+ (g, { standard_spend: b = 0, income: w = 0 }) => ({
2013
+ totalSpending: g.totalSpending + b,
2014
+ totalIncome: g.totalIncome + w
2015
+ }),
2016
+ { totalSpending: 0, totalIncome: 0 }
2017
+ ), [s]);
2018
+ return /* @__PURE__ */ a(p, { sx: { gap: 24 }, children: [
2019
+ s.length ? /* @__PURE__ */ e(
2020
+ $t,
2021
+ {
2022
+ ...c.appData.client_profile?.allow_trends_widget && {
2023
+ buttonLabel: l.key_indicators_spend.spend_less_than_you_make_drawer.view_more
2024
+ },
2025
+ chartFor: "spending_vs_income",
2026
+ data: s,
2027
+ legendLabelComparison: l.key_indicators_spend.spend_less_than_you_make_drawer.income,
2028
+ legendLabelMain: l.key_indicators_spend.spend_less_than_you_make_drawer.spending,
2029
+ onClick: () => i("trends")(),
2030
+ title: l.key_indicators_spend.spend_less_than_you_make_drawer.trends,
2031
+ totalComparison: B(D, "0,0.00"),
2032
+ totalMain: B(S, "0,0.00")
2033
+ }
2034
+ ) : /* @__PURE__ */ e(
2035
+ Le,
2036
+ {
2037
+ header: l.key_indicators_spend.spend_less_than_you_make_drawer.trends_zero_state_title,
2038
+ icon: "multiline_chart",
2039
+ subText: l.key_indicators_spend.spend_less_than_you_make_drawer.trends_zero_state_description,
2040
+ sx: {
2041
+ backgroundColor: "background.paper",
2042
+ borderRadius: "8px",
2043
+ boxShadow: 1,
2044
+ p: 24,
2045
+ pb: 48,
2046
+ ".empty-state-subtext": {
2047
+ fontSize: 15,
2048
+ lineHeight: "24px",
2049
+ mt: 8
2050
+ }
2051
+ },
2052
+ variant: "no-buttons"
2053
+ }
2054
+ ),
2055
+ f ? /* @__PURE__ */ a(
2056
+ V,
2057
+ {
2058
+ sx: {
2059
+ px: 16,
2060
+ py: 24
2061
+ },
2062
+ children: [
2063
+ /* @__PURE__ */ a(
2064
+ p,
2065
+ {
2066
+ sx: {
2067
+ alignItems: "center",
2068
+ flexDirection: "row",
2069
+ justifyContent: "space-between",
2070
+ gap: 12,
2071
+ pb: 8
2072
+ },
2073
+ children: [
2074
+ /* @__PURE__ */ e(Y, { children: l.key_indicators_spend.spend_less_than_you_make_drawer.spending }),
2075
+ c.appData.client_profile?.allow_spending_widget && /* @__PURE__ */ e(
2076
+ P,
2077
+ {
2078
+ endIcon: /* @__PURE__ */ e(Z, {}),
2079
+ onClick: () => i("spending")(),
2080
+ size: "small",
2081
+ sx: {
2082
+ pl: 8,
2083
+ height: 24
2084
+ },
2085
+ variant: "text",
2086
+ children: l.key_indicators_spend.spend_less_than_you_make_drawer.view_more
2087
+ }
2088
+ )
2089
+ ]
2090
+ }
2091
+ ),
2092
+ /* @__PURE__ */ a(p, { sx: { gap: 12, py: 16, flexDirection: "row", justifyContent: "center" }, children: [
2093
+ /* @__PURE__ */ e(
2094
+ ro,
2095
+ {
2096
+ data: f,
2097
+ onSelected: C,
2098
+ selectedId: h,
2099
+ totalLabel: d.total_spending
2100
+ }
2101
+ ),
2102
+ /* @__PURE__ */ e(
2103
+ ao,
2104
+ {
2105
+ data: f,
2106
+ onSelected: C,
2107
+ selectedId: h
2108
+ }
2109
+ )
2110
+ ] })
2111
+ ]
2112
+ }
2113
+ ) : /* @__PURE__ */ e(
2114
+ Le,
2115
+ {
2116
+ header: l.key_indicators_spend.spend_less_than_you_make_drawer.spending_zero_state_title,
2117
+ icon: "donut_small",
2118
+ subText: l.key_indicators_spend.spend_less_than_you_make_drawer.spending_zero_state_description,
2119
+ sx: {
2120
+ backgroundColor: "background.paper",
2121
+ borderRadius: "8px",
2122
+ boxShadow: 1,
2123
+ p: 24,
2124
+ pb: 48,
2125
+ ".empty-state-subtext": {
2126
+ fontSize: 15,
2127
+ lineHeight: "24px",
2128
+ mt: 8
2129
+ }
2130
+ },
2131
+ variant: "no-buttons"
2132
+ }
2133
+ )
2134
+ ] });
2135
+ }, Sr = v(xr), Cr = ({
2136
+ drawerFor: t,
2137
+ isOpen: o,
2138
+ onClose: n
2139
+ }) => {
2140
+ const { finstrong: r } = x(), i = {
2141
+ spendLessThanYouMake: {
2142
+ title: r.key_indicators_spend.spend_less_than_you_make_drawer.spend_less_than_you_make_title,
2143
+ description: r.key_indicators_spend.spend_less_than_you_make_drawer.spend_less_than_you_make_description,
2144
+ stickyComponent: /* @__PURE__ */ e(fr, {}),
2145
+ content: /* @__PURE__ */ e(Sr, {}),
2146
+ drawerType: "connectDrawer",
2147
+ connectTitle: r.connect_your_accounts,
2148
+ connectDescription: r.connect_more_accounts_to_unlock_a_fuller_understanding_of_your_finances
2149
+ },
2150
+ payBillsOnTime: {
2151
+ title: r.key_indicators_spend.pay_bills_on_time_drawer.pay_bills_on_time_title,
2152
+ description: r.key_indicators_spend.pay_bills_on_time_drawer.pay_bills_on_time_description,
2153
+ stickyComponent: /* @__PURE__ */ e(er, {}),
2154
+ content: /* @__PURE__ */ e(Zo, {}),
2155
+ drawerType: "connectDrawer",
2156
+ connectTitle: r.connect_your_accounts,
2157
+ connectDescription: r.connect_more_accounts_to_unlock_a_fuller_understanding_of_your_finances
2158
+ },
2159
+ maintainEmergencySavings: {
2160
+ content: /* @__PURE__ */ e(Yo, {}),
2161
+ description: r.maintain_emergency_savings_description,
2162
+ stickyComponent: /* @__PURE__ */ e(Uo, {}),
2163
+ title: r.maintain_emergency_savings_title,
2164
+ drawerType: "connectDrawer",
2165
+ connectTitle: r.connect_your_accounts,
2166
+ connectDescription: r.connect_more_accounts_to_unlock_a_fuller_understanding_of_your_finances
2167
+ },
2168
+ haveManageableDebt: {
2169
+ title: r.key_indicators_borrow.have_manageable_debt_drawer.have_manageable_debt_title,
2170
+ description: r.key_indicators_borrow.have_manageable_debt_drawer.have_manageable_debt_description,
2171
+ stickyComponent: /* @__PURE__ */ e(dr, {}),
2172
+ content: /* @__PURE__ */ e(yr, {}),
2173
+ drawerType: "connectDrawer",
2174
+ connectTitle: r.dont_see_all_your_accounts,
2175
+ connectDescription: r.connect_more_accounts_to_view_more_accurate_financial_picture
2176
+ },
2177
+ haveAGoodCreditScore: {
2178
+ title: /* @__PURE__ */ e(Go, {}),
2179
+ description: r.credit_score_description,
2180
+ stickyComponent: null,
2181
+ content: /* @__PURE__ */ e(Wo, {})
2182
+ },
2183
+ saveEnoughToLiveOn: {
2184
+ title: r.key_indicators_save.drawer_title,
2185
+ description: r.key_indicators_save.drawer_description,
2186
+ stickyComponent: /* @__PURE__ */ e(cr, {}),
2187
+ content: /* @__PURE__ */ e(ir, {}),
2188
+ drawerType: "connectDrawer",
2189
+ connectTitle: r.dont_see_all_your_accounts,
2190
+ connectDescription: r.connect_more_accounts_to_view_more_accurate_financial_picture
2191
+ }
2192
+ }[t];
2193
+ return /* @__PURE__ */ e(
2194
+ Lt,
2195
+ {
2196
+ connectDescription: i?.connectDescription,
2197
+ connectTitle: i?.connectTitle,
2198
+ description: i?.description,
2199
+ drawerTitle: r.key_indicators,
2200
+ drawerType: i.drawerType,
2201
+ isOpen: o,
2202
+ loadConnectAccountsCard: !0,
2203
+ onClose: n,
2204
+ stickyComponent: i.stickyComponent,
2205
+ title: i.title,
2206
+ children: /* @__PURE__ */ e(p, { sx: { gap: 16 }, children: i.content })
2207
+ }
2208
+ );
2209
+ }, vr = v(Cr), fe = ({
2210
+ drawerFor: t,
2211
+ title: o,
2212
+ description: n,
2213
+ cardState: r = "MISSING"
2214
+ }) => {
2215
+ const { finstrong: s } = x(), [i, c] = m.useState(!1), l = (_) => {
2216
+ (_.key === "Enter" || _.key === " ") && (_.preventDefault(), c(!0));
2217
+ };
2218
+ return /* @__PURE__ */ a(W, { children: [
2219
+ /* @__PURE__ */ a(
2220
+ p,
2221
+ {
2222
+ "aria-label": `${s.key_indicators_open} ${o}`,
2223
+ onClick: () => c(!0),
2224
+ onKeyDown: l,
2225
+ role: "button",
2226
+ sx: {
2227
+ alignItems: "center",
2228
+ borderRadius: 2,
2229
+ cursor: "pointer",
2230
+ flexDirection: "row",
2231
+ gap: 12,
2232
+ justifyContent: "space-between",
2233
+ outline: "1px solid",
2234
+ outlineColor: "divider",
2235
+ p: 16
2236
+ },
2237
+ tabIndex: 0,
2238
+ children: [
2239
+ /* @__PURE__ */ a(p, { sx: { gap: 8, minWidth: 0 }, children: [
2240
+ /* @__PURE__ */ a(p, { sx: { alignItems: "center", flexDirection: "row", gap: 8 }, children: [
2241
+ /* @__PURE__ */ e(I, { sx: { fontWeight: 600 }, variant: "body1", children: o }),
2242
+ /* @__PURE__ */ e($e, { status: r })
2243
+ ] }),
2244
+ /* @__PURE__ */ e(M, { color: "secondary", variant: "subtitle2", children: n })
2245
+ ] }),
2246
+ /* @__PURE__ */ e(Z, { color: "secondary", size: 24 })
2247
+ ]
2248
+ }
2249
+ ),
2250
+ /* @__PURE__ */ e(
2251
+ vr,
2252
+ {
2253
+ drawerFor: t,
2254
+ isOpen: i,
2255
+ onClose: () => c(!1)
2256
+ }
2257
+ )
2258
+ ] });
2259
+ }, wr = () => {
2260
+ const { finstrong: t } = x(), { key_indicators_spend: o } = t, { healthScore: n } = R(), r = (c) => {
2261
+ const l = An(c), _ = {
2262
+ GOOD: o.ratio_good_description,
2263
+ FAIR: o.ratio_fair_description,
2264
+ OFF_TRACK: o.ratio_off_track_description,
2265
+ MISSING: o.ratio_missing_description
2266
+ }, d = l === "MISSING" ? _[l] : j(_[l], c);
2267
+ return {
2268
+ cardState: l,
2269
+ description: d,
2270
+ title: o.ratio_card_title
2271
+ };
2272
+ }, { spendToIncomeRatio: s, spendFeeCount: i } = m.useMemo(() => {
2273
+ const c = n.spend_to_income_ratio !== null ? Math.round(n.spend_to_income_ratio * 100) : null, l = r(c), _ = Tn(
2274
+ n.spending_fee_transaction_count,
2275
+ o
2276
+ );
2277
+ return { spendToIncomeRatio: l, spendFeeCount: _ };
2278
+ }, [
2279
+ n.spend_to_income_ratio,
2280
+ n.spending_fee_transaction_count,
2281
+ o,
2282
+ t
2283
+ ]);
2284
+ return /* @__PURE__ */ a(p, { sx: { gap: 24, p: 8, pt: 24 }, children: [
2285
+ /* @__PURE__ */ e(
2286
+ fe,
2287
+ {
2288
+ cardState: s.cardState,
2289
+ description: s.description,
2290
+ drawerFor: de.SpendLessThanYouMake,
2291
+ title: s.title
952
2292
  }
953
2293
  ),
954
2294
  /* @__PURE__ */ e(
955
- B,
2295
+ fe,
956
2296
  {
957
2297
  cardState: i.cardState,
958
2298
  description: i.description,
959
- stateTitle: i.stateTitle,
2299
+ drawerFor: de.PayBillsOnTime,
960
2300
  title: i.title
961
2301
  }
962
2302
  )
963
2303
  ] });
964
- }, Ft = () => {
965
- const { healthScore: n } = $(), { finstrong: o } = S(), { key_indicators_save: t } = o, a = (r) => {
966
- const { good: s, poor: c } = X.daysOfCashOnHand;
967
- let p = g.MISSING, h = t.days_of_cash_missing_description, m = o.key_indicators_missing;
968
- return r !== null && (r >= s ? (p = g.GOOD, h = b(t.days_of_cash_good_description, r), m = o.key_indicators_good) : r < s && r >= c ? (p = g.FAIR, h = b(t.days_of_cash_fair_description, r), m = o.key_indicators_fair) : r < c && (p = g.OFF_TRACK, h = b(t.days_of_cash_off_track_description, r), m = o.key_indicators_off_track)), {
969
- cardState: p,
970
- description: h,
971
- title: t.days_of_cash_title,
972
- stateTitle: m
2304
+ }, kr = v(wr), Mr = () => {
2305
+ const { healthScore: t } = R(), { finstrong: o } = x(), { key_indicators_save: n } = o, r = (l) => {
2306
+ const _ = xt(l), d = {
2307
+ GOOD: n.days_of_cash_good_description,
2308
+ FAIR: n.days_of_cash_fair_description,
2309
+ OFF_TRACK: n.days_of_cash_off_track_description,
2310
+ MISSING: n.days_of_cash_missing_description
2311
+ }, u = _ === "MISSING" ? d[_] : j(d[_], l);
2312
+ return {
2313
+ cardState: _,
2314
+ description: u,
2315
+ title: n.days_of_cash_title
973
2316
  };
974
- }, d = (r) => {
975
- const { good: s, poor: c } = X.emergencySavings;
976
- let p = g.MISSING, h = t.emergency_savings_missing_description, m = o.key_indicators_missing;
977
- return r !== null && (r >= s ? (p = g.GOOD, h = t.emergency_savings_good_description, m = o.key_indicators_good) : r < s && r >= c ? (p = g.FAIR, h = b(
978
- t.emergency_savings_fair_description,
979
- it(r, "0,0.00")
980
- ), m = o.key_indicators_fair) : r < c && (p = g.OFF_TRACK, h = t.emergency_savings_off_track_description, m = o.key_indicators_off_track)), {
981
- cardState: p,
982
- description: h,
983
- title: t.emergency_savings_title,
984
- stateTitle: m
2317
+ }, s = (l) => {
2318
+ const _ = ft(l), d = {
2319
+ GOOD: n.emergency_savings_good_description,
2320
+ FAIR: n.emergency_savings_fair_description,
2321
+ OFF_TRACK: n.emergency_savings_off_track_description,
2322
+ MISSING: n.emergency_savings_missing_description
2323
+ };
2324
+ let u;
2325
+ return _ === "FAIR" && l !== null ? u = j(
2326
+ d[_],
2327
+ B(l, "0,0.00")
2328
+ ) : u = d[_], {
2329
+ cardState: _,
2330
+ description: u,
2331
+ title: n.emergency_savings_title
985
2332
  };
986
- }, { daysOfCashOnHand: l, emergencySavings: i } = C.useMemo(() => {
987
- const r = n.months_of_cash_on_hand !== null ? Math.round(n.months_of_cash_on_hand * 30) : null, s = a(r), c = n.emergency_savings_on_hand !== null ? Math.round(n.emergency_savings_on_hand) : null, p = d(c);
988
- return { daysOfCashOnHand: s, emergencySavings: p };
2333
+ }, { daysOfCashOnHand: i, emergencySavings: c } = m.useMemo(() => {
2334
+ const l = t.months_of_cash_on_hand !== null ? Math.round(t.months_of_cash_on_hand * 30) : null, _ = r(l), d = t.emergency_savings_on_hand !== null ? Math.round(t.emergency_savings_on_hand) : null, u = s(d);
2335
+ return { daysOfCashOnHand: _, emergencySavings: u };
989
2336
  }, [
990
- n.months_of_cash_on_hand,
991
- n.emergency_savings_on_hand,
992
- t,
2337
+ t.months_of_cash_on_hand,
2338
+ t.emergency_savings_on_hand,
2339
+ n,
993
2340
  o
994
2341
  ]);
995
- return /* @__PURE__ */ u(_, { direction: "column", gap: 24, sx: { p: 8, pt: 24 }, children: [
2342
+ return /* @__PURE__ */ a(p, { direction: "column", gap: 24, sx: { p: 8, pt: 24 }, children: [
996
2343
  /* @__PURE__ */ e(
997
- B,
2344
+ fe,
998
2345
  {
999
- cardState: l.cardState,
1000
- description: l.description,
1001
- stateTitle: l.stateTitle,
1002
- title: l.title
2346
+ cardState: i.cardState,
2347
+ description: i.description,
2348
+ drawerFor: de.SaveEnoughToLiveOn,
2349
+ title: i.title
1003
2350
  }
1004
2351
  ),
1005
2352
  /* @__PURE__ */ e(
1006
- B,
2353
+ fe,
1007
2354
  {
1008
- cardState: i.cardState,
1009
- description: i.description,
1010
- stateTitle: i.stateTitle,
1011
- title: i.title
2355
+ cardState: c.cardState,
2356
+ description: c.description,
2357
+ drawerFor: de.MaintainEmergencySavings,
2358
+ title: c.title
1012
2359
  }
1013
2360
  )
1014
2361
  ] });
1015
- }, Rt = () => {
1016
- const { healthScore: n } = $(), { finstrong: o } = S(), { key_indicators_borrow: t } = o, { user: a } = Y(), d = (s) => {
1017
- const { good: c, poor: p } = X.debtToIncomeRatio;
1018
- let h = g.MISSING, m = t.manage_debit_missing_description, f = o.key_indicators_missing;
1019
- return s != null && (s <= c ? (h = g.GOOD, m = t.manage_debit_good_description, f = o.key_indicators_good) : s > c && s <= p ? (h = g.FAIR, m = b(t.manage_debit_fair_description, s), f = o.key_indicators_fair) : s > p && (h = g.OFF_TRACK, m = b(
1020
- t.manage_debit_off_track_description,
1021
- s
1022
- ), f = o.key_indicators_off_track)), {
1023
- cardState: h,
1024
- description: m,
1025
- title: t.manage_debit_title,
1026
- stateTitle: f
2362
+ }, Dr = v(Mr), Ir = () => {
2363
+ const { healthScore: t } = R(), { finstrong: o } = x(), { key_indicators_borrow: n } = o, { user: r } = J(), s = (_) => {
2364
+ const d = On(_), u = {
2365
+ GOOD: n.manage_debit_good_description,
2366
+ FAIR: n.manage_debit_fair_description,
2367
+ OFF_TRACK: n.manage_debit_off_track_description,
2368
+ MISSING: n.manage_debit_missing_description
2369
+ }, h = d === "FAIR" || d === "OFF_TRACK" ? j(u[d], _) : u[d];
2370
+ return {
2371
+ cardState: d,
2372
+ description: h,
2373
+ title: n.manage_debit_title
1027
2374
  };
1028
- }, l = (s) => {
1029
- const { good: c, poor: p } = X.creditScore;
1030
- let h = g.MISSING, m = t.credit_score_missing_description, f = o.key_indicators_missing;
1031
- return s !== null && (s >= c ? (h = g.GOOD, m = b(t.credit_score_good_description, s), f = o.key_indicators_good) : s < c && s >= p ? (h = g.FAIR, m = b(t.credit_score_fair_description, s), f = o.key_indicators_fair) : s < p && (h = g.OFF_TRACK, m = b(
1032
- t.credit_score_off_track_description,
1033
- s
1034
- ), f = o.key_indicators_off_track)), {
1035
- cardState: h,
1036
- description: m,
1037
- title: t.credit_score_title,
1038
- stateTitle: f
2375
+ }, i = (_) => {
2376
+ const d = bt(_), u = {
2377
+ GOOD: n.credit_score_good_description,
2378
+ FAIR: n.credit_score_fair_description,
2379
+ OFF_TRACK: n.credit_score_off_track_description,
2380
+ MISSING: n.credit_score_missing_description
2381
+ }, h = d === "MISSING" ? u[d] : j(u[d], _);
2382
+ return {
2383
+ cardState: d,
2384
+ description: h,
2385
+ title: n.credit_score_title
1039
2386
  };
1040
- }, { manageDebtStatus: i, creditScoreStatus: r } = C.useMemo(() => {
1041
- const s = n.debt_to_income_ratio !== null ? Math.round(n.debt_to_income_ratio * 100) : null, c = d(s), p = l(a.credit_score || null);
2387
+ }, { manageDebtStatus: c, creditScoreStatus: l } = m.useMemo(() => {
2388
+ const _ = t.debt_to_income_ratio !== null ? Math.round(t.debt_to_income_ratio * 100) : null, d = s(_), u = i(r.credit_score || null);
1042
2389
  return {
1043
- manageDebtStatus: c,
1044
- creditScoreStatus: p
2390
+ manageDebtStatus: d,
2391
+ creditScoreStatus: u
1045
2392
  };
1046
- }, [n.debt_to_income_ratio, a.credit_score, t, o]);
1047
- return /* @__PURE__ */ u(_, { direction: "column", gap: 24, sx: { p: 8, pt: 24 }, children: [
2393
+ }, [t.debt_to_income_ratio, r.credit_score, n, o]);
2394
+ return /* @__PURE__ */ a(p, { direction: "column", gap: 24, sx: { p: 8, pt: 24 }, children: [
2395
+ /* @__PURE__ */ e(
2396
+ fe,
2397
+ {
2398
+ cardState: c.cardState,
2399
+ description: c.description,
2400
+ drawerFor: de.HaveManageableDebt,
2401
+ title: c.title
2402
+ }
2403
+ ),
2404
+ /* @__PURE__ */ e(
2405
+ fe,
2406
+ {
2407
+ cardState: l.cardState,
2408
+ description: l.description,
2409
+ drawerFor: de.HaveAGoodCreditScore,
2410
+ title: l.title
2411
+ }
2412
+ )
2413
+ ] });
2414
+ }, Tr = v(Ir), Ar = () => {
2415
+ const [t, o] = m.useState(0), { finstrong: n } = x();
2416
+ return /* @__PURE__ */ a(W, { children: [
2417
+ /* @__PURE__ */ a(
2418
+ Ue,
2419
+ {
2420
+ "aria-label": "Key Indicators",
2421
+ centered: !0,
2422
+ onChange: (r, s) => o(s),
2423
+ selectionFollowsFocus: !0,
2424
+ sx: {
2425
+ mb: 0,
2426
+ "& .MuiTab-root": {
2427
+ minWidth: 0
2428
+ }
2429
+ },
2430
+ textColor: "primary",
2431
+ value: t,
2432
+ variant: "fullWidth",
2433
+ children: [
2434
+ /* @__PURE__ */ e(
2435
+ se,
2436
+ {
2437
+ "aria-controls": "spend-details-tabpanel-0",
2438
+ icon: /* @__PURE__ */ e(Ke, { sx: { mr: 8 } }),
2439
+ iconPosition: "start",
2440
+ id: "spend-details-tab-0",
2441
+ label: n.key_indicators_spend.title,
2442
+ sx: { minHeight: 44 }
2443
+ }
2444
+ ),
2445
+ /* @__PURE__ */ e(
2446
+ se,
2447
+ {
2448
+ "aria-controls": "save-details-tabpanel-1",
2449
+ icon: /* @__PURE__ */ e(pn, { sx: { mr: 8 } }),
2450
+ iconPosition: "start",
2451
+ id: "save-details-tab-1",
2452
+ label: n.key_indicators_save.title,
2453
+ sx: { minHeight: 44 }
2454
+ }
2455
+ ),
2456
+ /* @__PURE__ */ e(
2457
+ se,
2458
+ {
2459
+ "aria-controls": "borrow-details-tabpanel-2",
2460
+ icon: /* @__PURE__ */ e(_n, { sx: { mr: 8 } }),
2461
+ iconPosition: "start",
2462
+ id: "borrow-details-tab-2",
2463
+ label: n.key_indicators_borrow.title,
2464
+ sx: { minHeight: 44 }
2465
+ }
2466
+ )
2467
+ ]
2468
+ }
2469
+ ),
2470
+ /* @__PURE__ */ e(ce, { index: 0, name: "spend-details", value: t, children: /* @__PURE__ */ e(kr, {}) }),
2471
+ /* @__PURE__ */ e(ce, { index: 1, name: "save-details", value: t, children: /* @__PURE__ */ e(Dr, {}) }),
2472
+ /* @__PURE__ */ e(ce, { index: 2, name: "borrow-details", value: t, children: /* @__PURE__ */ e(Tr, {}) })
2473
+ ] });
2474
+ }, Or = v(Ar), Fr = ({ onClick: t }) => {
2475
+ const { finstrong: o } = x(), { isCopyLoaded: n } = X();
2476
+ return n ? /* @__PURE__ */ a(p, { sx: { alignItems: "center", gap: 12, pt: 12, pb: 32 }, children: [
2477
+ /* @__PURE__ */ e(ht, { size: 48 }),
2478
+ /* @__PURE__ */ a(p, { sx: { alignItems: "center", gap: 4, textAlign: "center" }, children: [
2479
+ /* @__PURE__ */ e(Y, { children: o.missing_data_title }),
2480
+ /* @__PURE__ */ e(M, { sx: { width: { sm: 348 } }, variant: "subtitle1", children: o.missing_data_description })
2481
+ ] }),
2482
+ /* @__PURE__ */ e(k, { children: /* @__PURE__ */ e(
2483
+ P,
2484
+ {
2485
+ endIcon: /* @__PURE__ */ e(Z, {}),
2486
+ onClick: t,
2487
+ size: "small",
2488
+ sx: {
2489
+ fontSize: 13,
2490
+ ":hover": {
2491
+ bgcolor: "transparent"
2492
+ }
2493
+ },
2494
+ variant: "text",
2495
+ children: o.connect_more_accounts_button
2496
+ }
2497
+ ) })
2498
+ ] }) : /* @__PURE__ */ e(oe, {});
2499
+ }, Rr = v(Fr), Pr = ({
2500
+ firstDay: t,
2501
+ frequency: o,
2502
+ secondDay: n,
2503
+ incomeTransactions: r,
2504
+ setCurrentStep: s,
2505
+ setFirstDay: i,
2506
+ setFrequency: c,
2507
+ setSecondDay: l,
2508
+ transaction: _
2509
+ }) => {
2510
+ const { finstrong: d } = x();
2511
+ return /* @__PURE__ */ a(m.Fragment, { children: [
2512
+ /* @__PURE__ */ a(p, { children: [
2513
+ !!r.length && /* @__PURE__ */ e(k, { sx: { pb: 24 }, children: r.reduce((u, h, y) => {
2514
+ if (h.guid === _.guid) return u;
2515
+ const f = Xn(y, r), C = qn(y, r);
2516
+ return u.push(
2517
+ /* @__PURE__ */ a(m.Fragment, { children: [
2518
+ f && /* @__PURE__ */ e(Un, { children: It(h.date) }),
2519
+ /* @__PURE__ */ e(Qn, { transaction: h }),
2520
+ /* @__PURE__ */ e(le, { sx: { ml: C ? 44 : 0 } })
2521
+ ] }, h.guid)
2522
+ ), u;
2523
+ }, []) }),
2524
+ /* @__PURE__ */ e(
2525
+ lo,
2526
+ {
2527
+ firstDay: t,
2528
+ frequency: o,
2529
+ onFirstDayChange: i,
2530
+ onFrequencyChange: c,
2531
+ onSecondDayChange: l,
2532
+ secondDay: n,
2533
+ transaction: _
2534
+ }
2535
+ )
2536
+ ] }),
2537
+ /* @__PURE__ */ e(k, { sx: { px: 24 }, children: /* @__PURE__ */ e(
2538
+ P,
2539
+ {
2540
+ fullWidth: !0,
2541
+ onClick: () => s({ step: A.MonthlyIncome, type: "main" }),
2542
+ startIcon: /* @__PURE__ */ e(mt, {}),
2543
+ children: d.onboarding_add_more_income
2544
+ }
2545
+ ) })
2546
+ ] });
2547
+ }, Lr = v(Pr), Br = ({ selectedDate: t, setSelectedDate: o }) => {
2548
+ const { finstrong: n } = x(), r = $(), s = (i) => {
2549
+ o(Math.floor(new Date(i).getTime() / 1e3));
2550
+ };
2551
+ return /* @__PURE__ */ e(k, { sx: { p: 24 }, children: /* @__PURE__ */ e(uo, { dateAdapter: Ot, children: /* @__PURE__ */ e(
2552
+ ho,
2553
+ {
2554
+ disableFuture: !0,
2555
+ label: n.onboarding_select_date,
2556
+ onChange: s,
2557
+ slotProps: {
2558
+ nextIconButton: {
2559
+ sx: {
2560
+ color: "primary.main",
2561
+ "&:hover": { bgcolor: be(r.palette.primary.light, 0.1) }
2562
+ }
2563
+ },
2564
+ previousIconButton: {
2565
+ sx: {
2566
+ color: "primary.main",
2567
+ "&:hover": { bgcolor: be(r.palette.primary.light, 0.1) }
2568
+ }
2569
+ }
2570
+ },
2571
+ sx: {
2572
+ width: "100%",
2573
+ "& .MuiIconButton-edgeEnd": {
2574
+ color: "primary.main",
2575
+ "&:hover": { bgcolor: be(r.palette.primary.light, 0.1) }
2576
+ }
2577
+ },
2578
+ value: t ? new Date(t * 1e3) : null
2579
+ }
2580
+ ) }) });
2581
+ }, Wr = v(Br), $r = ({ creditScore: t, setCreditScore: o }) => {
2582
+ const { finstrong: n } = x(), r = !isNaN(t);
2583
+ return /* @__PURE__ */ e(k, { sx: { p: 24 }, children: /* @__PURE__ */ e(
2584
+ Pe,
2585
+ {
2586
+ error: !r,
2587
+ fullWidth: !0,
2588
+ inputMode: "numeric",
2589
+ inputProps: {
2590
+ noValidate: !0,
2591
+ pattern: "[0-9]*"
2592
+ },
2593
+ label: n.credit_score,
2594
+ onChange: (s) => o(Number(s.target.value)),
2595
+ value: r ? t : ""
2596
+ }
2597
+ ) });
2598
+ }, Gr = v($r), Gt = ({ value: t, completeCopy: o }) => /* @__PURE__ */ a(p, { sx: { gap: 8 }, children: [
2599
+ /* @__PURE__ */ e(p, { sx: { flexDirection: "row", gap: 4 }, children: Array.from({ length: 4 }).map((n, r) => /* @__PURE__ */ e(
2600
+ k,
2601
+ {
2602
+ sx: {
2603
+ bgcolor: r < t ? "primary.main" : "neutral.light",
2604
+ borderRadius: "24px",
2605
+ height: 4,
2606
+ width: "100%"
2607
+ }
2608
+ },
2609
+ r
2610
+ )) }),
2611
+ /* @__PURE__ */ a(I, { sx: { color: "text.secondary" }, variant: "body2", children: [
2612
+ t / 4 * 100,
2613
+ "% ",
2614
+ o
2615
+ ] })
2616
+ ] }), zr = ({
2617
+ completeCopy: t,
2618
+ primaryText: o,
2619
+ secondaryText: n,
2620
+ value: r
2621
+ }) => /* @__PURE__ */ a(p, { sx: { gap: 20, p: 24 }, children: [
2622
+ /* @__PURE__ */ a(p, { sx: { gap: 8 }, children: [
2623
+ /* @__PURE__ */ e(Y, { children: o }),
2624
+ /* @__PURE__ */ e(M, { variant: "subtitle1", children: n })
2625
+ ] }),
2626
+ /* @__PURE__ */ e(Gt, { completeCopy: t, value: r })
2627
+ ] }), dt = {
2628
+ step: A.ConnectAccounts,
2629
+ type: "main"
2630
+ }, Er = ({ isOpen: t, onClose: o }) => {
2631
+ const { visibleAccounts: n } = xe(), { calculateHealthScore: r } = R(), { finstrong: s } = x(), { setSelectedAccounts: i } = X(), { addRepeatingTransaction: c, setDateRange: l } = Xe(), { filter: _, setFilter: d, transactions: u } = Bn(), { user: h, userProfile: y, updateUser: f, updateUserProfile: C } = J(), [S, D] = m.useState(h.credit_score || 0), [g, b] = m.useState(
2632
+ dt
2633
+ ), [w, H] = m.useState(1), [N, U] = m.useState(Mt.EveryMonth), [L, O] = m.useState([]), [G, pe] = m.useState(!1), [Ce, ee] = m.useState(!1), [K, ve] = m.useState(h.birthday), [z, we] = m.useState(15), [E, ae] = m.useState("");
2634
+ m.useEffect(() => {
2635
+ l({ start: Tt(ct()), end: At(ct()) });
2636
+ }, []), m.useEffect(() => {
2637
+ d({
2638
+ accounts: n.map((T) => T.guid),
2639
+ dateRange: {
2640
+ start: co(/* @__PURE__ */ new Date(), 90),
2641
+ end: /* @__PURE__ */ new Date()
2642
+ },
2643
+ custom: lt
2644
+ }), i(n);
2645
+ }, [n]);
2646
+ const _e = m.useMemo(
2647
+ () => u.find((T) => T.guid === E),
2648
+ [E, u]
2649
+ ), ue = m.useMemo(() => ({
2650
+ [A.ConnectAccounts]: !0,
2651
+ [A.MonthlyIncome]: !!E,
2652
+ [A.Birthday]: !!h.birthday || !!K,
2653
+ [A.CreditScore]: !!h.credit_score || !!S
2654
+ })[g.step], [S, g, K, E, h]), q = n.length > 0, zt = m.useMemo(() => {
2655
+ const { step: T } = g;
2656
+ let F = 0;
2657
+ return T >= A.MonthlyIncome && q && F++, T >= A.Birthday && L.length && F++, T >= A.CreditScore && (h.birthday || h.credit_score) && F++, F;
2658
+ }, [g.step, q, L.length, h.birthday, h.credit_score]), Et = (T) => {
2659
+ d({
2660
+ ..._,
2661
+ custom: (F) => T ? _o(F, T) : lt(F)
2662
+ });
2663
+ }, Ht = {
2664
+ [A.ConnectAccounts]: {
2665
+ main: q ? /* @__PURE__ */ e(Bt, { shouldShowBalance: !1 }) : null,
2666
+ mainActionContent: q ? s.onboarding_next : s.onboarding_add_accounts,
2667
+ primaryText: s.connect_your_accounts,
2668
+ secondaryText: s.onboarding_connect_your_accounts_secondary
2669
+ },
2670
+ [A.MonthlyIncome]: {
2671
+ detail: /* @__PURE__ */ e(
2672
+ Lr,
2673
+ {
2674
+ firstDay: w,
2675
+ frequency: N,
2676
+ incomeTransactions: L,
2677
+ secondDay: z,
2678
+ setCurrentStep: (T) => {
2679
+ b(T), O((F) => {
2680
+ if (F.some((ie) => ie.guid === E)) return F.filter((ie) => ie.guid !== E);
2681
+ const Te = u.find((ie) => ie.guid === E);
2682
+ return Te ? [...F, { ...Te, firstDay: w, frequency: N, secondDay: z }] : F;
2683
+ });
2684
+ },
2685
+ setFirstDay: H,
2686
+ setFrequency: U,
2687
+ setSecondDay: we,
2688
+ transaction: _e
2689
+ }
2690
+ ),
2691
+ detailActionContent: s.onboarding_confirm_income,
2692
+ main: /* @__PURE__ */ e(
2693
+ po,
2694
+ {
2695
+ onSearch: Et,
2696
+ onSelected: (T) => {
2697
+ b({ step: A.MonthlyIncome, type: "detail" }), ae(T);
2698
+ }
2699
+ }
2700
+ ),
2701
+ mainActionContent: s.onboarding_confirm_income,
2702
+ primaryText: s.onboarding_add_income_primary,
2703
+ secondaryText: s.onboarding_add_income_secondary
2704
+ },
2705
+ [A.Birthday]: {
2706
+ main: /* @__PURE__ */ e(Wr, { selectedDate: K, setSelectedDate: ve }),
2707
+ mainActionContent: s.onboarding_next,
2708
+ primaryText: s.onboarding_birthday_primary,
2709
+ secondaryText: s.onboarding_birthday_secondary
2710
+ },
2711
+ [A.CreditScore]: {
2712
+ main: /* @__PURE__ */ e(Gr, { creditScore: S, setCreditScore: D }),
2713
+ mainActionContent: s.onboarding_next,
2714
+ primaryText: s.onboarding_credit_score_primary,
2715
+ secondaryText: s.onboarding_credit_score_secondary
2716
+ }
2717
+ }, Je = () => {
2718
+ b(dt), pe(!1), ae(""), o();
2719
+ }, et = async () => {
2720
+ pe(!0), await Yt(L), await r(), await C({ ...y, has_completed_finstrong_onboarding: !0 }), Je();
2721
+ }, Nt = () => {
2722
+ if (g.step === A.CreditScore) {
2723
+ et();
2724
+ return;
2725
+ }
2726
+ b({ step: g.step + 1, type: "main" });
2727
+ }, Kt = () => {
2728
+ const { step: T } = g, F = T + 1;
2729
+ switch (T) {
2730
+ case A.Birthday:
2731
+ K && K !== h.birthday && f({ ...h, birthday: K });
2732
+ break;
2733
+ case A.CreditScore:
2734
+ S && S !== h.credit_score && f({ ...h, credit_score: S }), et();
2735
+ return;
2736
+ case A.MonthlyIncome:
2737
+ E && L.findIndex(({ guid: me }) => me === E) === -1 && O((me) => [
2738
+ ...me,
2739
+ { ..._e, firstDay: w, frequency: N, secondDay: z }
2740
+ ]);
2741
+ break;
2742
+ case A.ConnectAccounts:
2743
+ if (!q) {
2744
+ ee(!0);
2745
+ return;
2746
+ }
2747
+ break;
2748
+ }
2749
+ F in A && b({ step: F, type: "main" });
2750
+ }, jt = () => {
2751
+ const { step: T, type: F } = g;
2752
+ if (F === "detail") {
2753
+ b({ step: T, type: "main" });
2754
+ return;
2755
+ }
2756
+ if (T === A.Birthday && L.length) {
2757
+ b({ step: T - 1, type: "detail" });
2758
+ return;
2759
+ }
2760
+ T > A.ConnectAccounts && b({ step: T - 1, type: "main" });
2761
+ }, Yt = async (T) => {
2762
+ for (const F of T) {
2763
+ const {
2764
+ account_guid: me,
2765
+ amount: Te,
2766
+ date: ie,
2767
+ description: qt,
2768
+ feed_description: Ut,
2769
+ firstDay: Qt,
2770
+ frequency: tt,
2771
+ secondDay: Zt,
2772
+ merchant_guid: Jt,
2773
+ payee: en,
2774
+ transaction_type: tn
2775
+ } = F, nn = jn(tt, so(ie)), on = {
2776
+ account_guid: me,
2777
+ amount: Te,
2778
+ created_by: 0,
2779
+ description: en || qt || Ut,
2780
+ merchant_guid: Jt,
2781
+ predicted_occurs_on: io(nn, { representation: "date" }),
2782
+ recurrence_day: Qt,
2783
+ recurrence_type: tt,
2784
+ repeating_transaction_type: Dt.Income,
2785
+ second_recurrence_day: Zt,
2786
+ transaction_type: tn,
2787
+ user_guid: h.guid
2788
+ };
2789
+ await c(on, F);
2790
+ }
2791
+ }, he = Ht[g.step], Ie = g.step === A.ConnectAccounts, Vt = {
2792
+ fullWidth: !0,
2793
+ ...Ie && !q && { startIcon: /* @__PURE__ */ e(mt, {}) }
2794
+ }, Xt = !Ie || Ie && !q;
2795
+ return /* @__PURE__ */ a(m.Fragment, { children: [
2796
+ /* @__PURE__ */ e(
2797
+ ne,
2798
+ {
2799
+ footerStyles: { px: 24, py: 16 },
2800
+ hasSecondaryAction: !Ie,
2801
+ isOpen: t,
2802
+ isPrimaryDisabled: !ue,
2803
+ onClose: Je,
2804
+ onSecondaryAction: jt,
2805
+ primaryButtonProps: Vt,
2806
+ primaryText: he?.mainActionContent,
2807
+ secondaryColor: "primary",
2808
+ secondaryText: s.onboarding_back,
2809
+ title: s.title,
2810
+ ...!G && { onPrimaryAction: Kt },
2811
+ children: /* @__PURE__ */ a(p, { sx: { bgcolor: "background.default", height: "100%" }, children: [
2812
+ G && /* @__PURE__ */ a(p, { sx: { alignItems: "center", gap: 24, position: "relative", px: 16, top: 126 }, children: [
2813
+ /* @__PURE__ */ e("img", { alt: "", src: Ro, style: { minHeight: 100, width: 211 } }),
2814
+ /* @__PURE__ */ e(Be, { children: s.onboarding_calculate_primary }),
2815
+ /* @__PURE__ */ e(M, { sx: { textAlign: "center" }, variant: "subtitle1", children: s.onboarding_calculate_secondary })
2816
+ ] }),
2817
+ he && !G && /* @__PURE__ */ a(m.Fragment, { children: [
2818
+ /* @__PURE__ */ e(
2819
+ zr,
2820
+ {
2821
+ completeCopy: s.complete,
2822
+ primaryText: he.primaryText,
2823
+ secondaryText: he.secondaryText,
2824
+ value: zt
2825
+ }
2826
+ ),
2827
+ g.type === "main" && /* @__PURE__ */ a(k, { sx: { bgcolor: "background.default" }, children: [
2828
+ he.main,
2829
+ Xt && /* @__PURE__ */ e(p, { sx: { alignItems: "center", px: 24, py: 12 }, children: /* @__PURE__ */ e(P, { fullWidth: !0, onClick: Nt, children: s.onboarding_do_it_later }) })
2830
+ ] }),
2831
+ g.type === "detail" && he.detail
2832
+ ] })
2833
+ ] })
2834
+ }
2835
+ ),
2836
+ /* @__PURE__ */ e(
2837
+ re,
2838
+ {
2839
+ onClose: () => ee(!1),
2840
+ showConnectWidget: Ce,
2841
+ title: s.connect_more_accounts_button
2842
+ }
2843
+ )
2844
+ ] });
2845
+ }, Hr = v(Er), Nr = () => {
2846
+ const { finstrong: t } = x(), [o, n] = m.useState(!1);
2847
+ return /* @__PURE__ */ a(m.Fragment, { children: [
2848
+ /* @__PURE__ */ a(
2849
+ p,
2850
+ {
2851
+ sx: {
2852
+ alignItems: "center",
2853
+ gap: 48,
2854
+ pb: 24,
2855
+ pt: 72,
2856
+ px: 16
2857
+ },
2858
+ children: [
2859
+ /* @__PURE__ */ a(p, { sx: { alignItems: { sm: "center" }, gap: 24, width: "100%" }, children: [
2860
+ /* @__PURE__ */ e(k, { sx: { textAlign: "center" }, children: /* @__PURE__ */ e(un, { size: 72 }) }),
2861
+ /* @__PURE__ */ a(p, { sx: { gap: 4, textAlign: "center", width: { sm: 400 } }, children: [
2862
+ /* @__PURE__ */ e(Be, { children: t.onboarding_title }),
2863
+ /* @__PURE__ */ e(M, { sx: { color: "text.secondary" }, variant: "subtitle1", children: t.onboarding_subtitle })
2864
+ ] })
2865
+ ] }),
2866
+ /* @__PURE__ */ e(P, { onClick: () => n(!0), variant: "contained", children: t.onboarding_get_started })
2867
+ ]
2868
+ }
2869
+ ),
2870
+ /* @__PURE__ */ e(Hr, { isOpen: o, onClose: () => n(!1) })
2871
+ ] });
2872
+ }, Kr = ({ isOpen: t, onClose: o }) => {
2873
+ const { finstrong: n } = x(), r = $(), { updateUser: s, user: i } = J(), [c, l] = m.useState(i.birthday), _ = (u) => {
2874
+ l(Math.floor(new Date(u).getTime() / 1e3));
2875
+ };
2876
+ return /* @__PURE__ */ e(
2877
+ ne,
2878
+ {
2879
+ isOpen: t,
2880
+ onClose: o,
2881
+ onPrimaryAction: () => {
2882
+ !c || c === i.birthday || (s({ ...i, birthday: c }), o());
2883
+ },
2884
+ onSecondaryAction: o,
2885
+ title: n.date_of_birth,
2886
+ children: /* @__PURE__ */ e(p, { sx: { bgcolor: "background.default", height: "100%" }, children: /* @__PURE__ */ e(yo, { dateAdapter: Ot, children: /* @__PURE__ */ e(
2887
+ mo,
2888
+ {
2889
+ disableFuture: !0,
2890
+ onChange: _,
2891
+ slotProps: {
2892
+ nextIconButton: {
2893
+ sx: {
2894
+ color: "primary.main",
2895
+ "&:hover": { bgcolor: be(r.palette.primary.light, 0.1) }
2896
+ }
2897
+ },
2898
+ previousIconButton: {
2899
+ sx: {
2900
+ color: "primary.main",
2901
+ "&:hover": { bgcolor: be(r.palette.primary.light, 0.1) }
2902
+ }
2903
+ }
2904
+ },
2905
+ slots: {
2906
+ actionBar: () => null,
2907
+ toolbar: () => null
2908
+ },
2909
+ sx: {
2910
+ width: "100%",
2911
+ "& .MuiIconButton-edgeEnd": {
2912
+ color: "primary.main",
2913
+ "&:hover": { bgcolor: be(r.palette.primary.light, 0.1) }
2914
+ }
2915
+ },
2916
+ value: c ? new Date(c * 1e3) : /* @__PURE__ */ new Date()
2917
+ }
2918
+ ) }) })
2919
+ }
2920
+ );
2921
+ }, jr = v(Kr), Yr = ({ isOpen: t, onClose: o }) => {
2922
+ const { visibleFinstrongAccounts: n } = xe(), {
2923
+ accounts: r,
2924
+ common: s,
2925
+ finstrong: i
2926
+ } = x(), { repeatingTransactions: c } = Xe(), { user: l } = J(), _ = c.reduce((f, C) => {
2927
+ const { repeating_transaction_type: S, transactions: D, recurrence_type: g, amount: b } = C;
2928
+ return S === Dt.Income && (D.length > 0 || g === Mt.EveryYear) ? f + b : f;
2929
+ }, 0), [d, u] = m.useState(null), y = [
2930
+ {
2931
+ dynamicCopy: i.add_profile_item,
2932
+ fallbackLabel: i.monthly_income,
2933
+ icon: /* @__PURE__ */ e(hn, {}),
2934
+ key: te.MonthlyIncome,
2935
+ label: i.monthly_income,
2936
+ value: _
2937
+ },
2938
+ {
2939
+ dynamicCopy: i.add_profile_item,
2940
+ fallbackLabel: i.date_of_birth,
2941
+ icon: /* @__PURE__ */ e(mn, {}),
2942
+ key: te.DateOfBirth,
2943
+ label: i.date_of_birth,
2944
+ value: l.birthday
2945
+ },
2946
+ {
2947
+ dynamicCopy: i.add_profile_item,
2948
+ fallbackLabel: i.credit_score,
2949
+ icon: /* @__PURE__ */ e(Ke, {}),
2950
+ key: te.CreditScore,
2951
+ label: i.credit_score,
2952
+ value: l.credit_score
2953
+ },
2954
+ {
2955
+ fallbackLabel: i.connect_your_accounts,
2956
+ icon: /* @__PURE__ */ e(ut, {}),
2957
+ key: te.Connections,
2958
+ label: i.connections,
2959
+ value: n.length > 0 ? j(
2960
+ i.connected_account,
2961
+ String(n.length),
2962
+ n.length > 1 ? i.accounts : i.account
2963
+ ) : void 0
2964
+ }
2965
+ ].map((f) => Fn(f));
2966
+ return /* @__PURE__ */ a(ne, { isOpen: t, onClose: o, title: i.financial_profile, children: [
2967
+ /* @__PURE__ */ a(p, { sx: { bgcolor: "background.default", height: "100%" }, children: [
2968
+ /* @__PURE__ */ a(p, { sx: { gap: 20, p: 24 }, children: [
2969
+ /* @__PURE__ */ a(p, { sx: { gap: 8 }, children: [
2970
+ /* @__PURE__ */ e(Y, { children: i.your_financial_profile }),
2971
+ /* @__PURE__ */ e(M, { children: i.financial_profile_description })
2972
+ ] }),
2973
+ /* @__PURE__ */ e(
2974
+ Gt,
2975
+ {
2976
+ completeCopy: i.complete,
2977
+ value: y.reduce((f, C) => f + (C.isComplete ? 1 : 0), 0)
2978
+ }
2979
+ )
2980
+ ] }),
2981
+ /* @__PURE__ */ e(Rn, { list: y, onClickItem: u }),
2982
+ /* @__PURE__ */ e(k, { sx: { p: 24 }, children: /* @__PURE__ */ e(
2983
+ We,
2984
+ {
2985
+ description: i.connect_more_accounts_to_view_more_accurate_financial_picture,
2986
+ drawerType: "connectDrawer",
2987
+ isDashboard: !0,
2988
+ title: i.dont_see_all_your_accounts,
2989
+ titleDrawer: s.add_accounts
2990
+ }
2991
+ ) })
2992
+ ] }),
1048
2993
  /* @__PURE__ */ e(
1049
- B,
2994
+ ne,
1050
2995
  {
1051
- cardState: i.cardState,
1052
- description: i.description,
1053
- stateTitle: i.stateTitle,
1054
- title: i.title
2996
+ isOpen: d === te.MonthlyIncome,
2997
+ onClose: () => u(null),
2998
+ title: s.settings,
2999
+ children: /* @__PURE__ */ e(go, {})
1055
3000
  }
1056
3001
  ),
3002
+ /* @__PURE__ */ e(jr, { isOpen: d === te.DateOfBirth, onClose: () => u(null) }),
3003
+ /* @__PURE__ */ e(Pt, { isOpen: d === te.CreditScore, onClose: () => u(null) }),
1057
3004
  /* @__PURE__ */ e(
1058
- B,
3005
+ St,
1059
3006
  {
1060
- cardState: r.cardState,
1061
- description: r.description,
1062
- stateTitle: r.stateTitle,
1063
- title: r.title
3007
+ onClose: () => u(null),
3008
+ showConnectionsWidget: d === te.Connections,
3009
+ title: r.manage_connections
1064
3010
  }
1065
3011
  )
1066
3012
  ] });
1067
- }, Pt = () => {
1068
- const [n, o] = C.useState(0), { finstrong: t } = S();
1069
- return /* @__PURE__ */ u(ie, { children: [
1070
- /* @__PURE__ */ u(
1071
- rt,
1072
- {
1073
- "aria-label": "Key Indicators",
1074
- centered: !0,
1075
- onChange: (a, d) => o(d),
1076
- sx: { mb: 0 },
1077
- textColor: "primary",
1078
- value: n,
1079
- variant: "fullWidth",
1080
- children: [
1081
- /* @__PURE__ */ e(
1082
- ne,
1083
- {
1084
- "aria-controls": "spend-details-tabpanel-0",
1085
- icon: /* @__PURE__ */ e(he, { sx: { mr: 8 } }),
1086
- iconPosition: "start",
1087
- id: "spend-details-tab-0",
1088
- label: t.key_indicators_spend.title,
1089
- sx: { minHeight: 44 }
1090
- }
1091
- ),
1092
- /* @__PURE__ */ e(
1093
- ne,
1094
- {
1095
- "aria-controls": "save-details-tabpanel-1",
1096
- icon: /* @__PURE__ */ e(Ge, { sx: { mr: 8 } }),
1097
- iconPosition: "start",
1098
- id: "save-details-tab-1",
1099
- label: t.key_indicators_save.title,
1100
- sx: { minHeight: 44 }
1101
- }
1102
- ),
1103
- /* @__PURE__ */ e(
1104
- ne,
1105
- {
1106
- "aria-controls": "borrow-details-tabpanel-2",
1107
- icon: /* @__PURE__ */ e(Le, { sx: { mr: 8 } }),
1108
- iconPosition: "start",
1109
- id: "borrow-details-tab-2",
1110
- label: t.key_indicators_borrow.title,
1111
- sx: { minHeight: 44 }
1112
- }
1113
- )
1114
- ]
1115
- }
1116
- ),
1117
- /* @__PURE__ */ e(re, { index: 0, name: "spend-details", value: n, children: /* @__PURE__ */ e(wt, {}) }),
1118
- /* @__PURE__ */ e(re, { index: 1, name: "save-details", value: n, children: /* @__PURE__ */ e(Ft, {}) }),
1119
- /* @__PURE__ */ e(re, { index: 2, name: "borrow-details", value: n, children: /* @__PURE__ */ e(Rt, {}) })
1120
- ] });
1121
- }, Gt = ({
1122
- additionalContent: n,
1123
- children: o,
1124
- description: t,
1125
- drawerTitle: a,
1126
- isOpen: d,
1127
- loadConnectAccountsCard: l = !0,
1128
- onClose: i,
1129
- stickyComponent: r,
1130
- title: s
1131
- }) => {
1132
- const { finstrong: c } = S(), { isCopyLoaded: p } = z();
1133
- return p ? /* @__PURE__ */ u(V, { isOpen: d, onClose: i, title: a || c.key_indicators, children: [
1134
- (s || t) && /* @__PURE__ */ u(_, { sx: { p: 24, pb: 0, gap: 8, backgroundColor: "background.paper" }, children: [
1135
- s && /* @__PURE__ */ e(H, { children: s }),
1136
- t && /* @__PURE__ */ e(y, { children: t })
1137
- ] }),
1138
- r && /* @__PURE__ */ e(
1139
- x,
1140
- {
1141
- sx: {
1142
- position: "sticky",
1143
- top: 0,
1144
- zIndex: 1
1145
- },
1146
- children: r
1147
- }
1148
- ),
1149
- n && /* @__PURE__ */ e(x, { children: n }),
1150
- /* @__PURE__ */ e(fe, {}),
1151
- /* @__PURE__ */ u(_, { sx: { p: 24, gap: 24 }, children: [
1152
- o,
1153
- l && /* @__PURE__ */ e(Q, { isDashboard: !0 })
1154
- ] })
1155
- ] }) : /* @__PURE__ */ e(N, {});
1156
- }, Lt = I(Gt), me = ({
1157
- content: n,
3013
+ }, Vr = v(Yr), pt = ({
3014
+ content: t,
1158
3015
  islast: o = !1
1159
- }) => /* @__PURE__ */ u(at, { sx: { minHeight: 0 }, children: [
1160
- /* @__PURE__ */ u(mt, { children: [
1161
- /* @__PURE__ */ e(pt, { sx: { bgcolor: "divider", borderWidth: 1, p: 3 } }),
1162
- !o && /* @__PURE__ */ e(lt, { sx: { bgcolor: "divider", width: 0.1 } })
3016
+ }) => /* @__PURE__ */ a(xo, { sx: { minHeight: 0 }, children: [
3017
+ /* @__PURE__ */ a(ko, { children: [
3018
+ /* @__PURE__ */ e(wo, { sx: { bgcolor: "divider", borderWidth: 1, p: 3 } }),
3019
+ !o && /* @__PURE__ */ e(Co, { sx: { bgcolor: "divider", width: 0.1 } })
1163
3020
  ] }),
1164
- /* @__PURE__ */ e(dt, { sx: { pb: 16, pl: 12, pr: 0, pt: 5 }, children: /* @__PURE__ */ e(y, { fontSize: 13, fontWeight: 400, variant: "subtitle2", children: n }) })
1165
- ] }), Et = ({ report: n }) => {
1166
- const { finstrong: o } = S(), { score_history_drawer_timeline: t } = o, {
1167
- health_score_point_difference: a,
1168
- newer_credit_score: d,
1169
- older_credit_score: l,
1170
- older_spend_to_income_ratio: i,
1171
- newer_spend_to_income_ratio: r,
1172
- older_health_score: s,
1173
- newer_health_score: c,
1174
- newer_score_calculated_at: p
1175
- } = n, h = ge(new Date(p), "MMM d"), m = () => a === 0 ? "info.lighter" : a > 0 ? "success.lighter" : "error.lighter", f = () => a === 0 ? b(t.stayed_at, s) : a > 0 ? t.less_spending : t.more_spending, v = () => {
1176
- if (a === 0) return null;
1177
- const T = a > 0 ? t.up_from : t.down_from, R = b(T, s, c);
1178
- return /* @__PURE__ */ u(ie, { children: [
3021
+ /* @__PURE__ */ e(vo, { sx: { pb: 16, pl: 12, pr: 0, pt: 5 }, children: /* @__PURE__ */ e(M, { fontSize: 13, fontWeight: 400, variant: "subtitle2", children: t }) })
3022
+ ] }), Xr = ({ report: t }) => {
3023
+ const { finstrong: o } = x(), { score_history_drawer_timeline: n } = o, {
3024
+ health_score_point_difference: r,
3025
+ newer_credit_score: s,
3026
+ older_credit_score: i,
3027
+ older_spend_to_income_ratio: c,
3028
+ newer_spend_to_income_ratio: l,
3029
+ older_health_score: _,
3030
+ newer_health_score: d,
3031
+ newer_score_calculated_at: u
3032
+ } = t, h = bo(new Date(u), "MMM d"), y = () => r === 0 ? "info.lighter" : r > 0 ? "success.lighter" : "error.lighter", f = () => r === 0 ? j(n.stayed_at, _) : r > 0 ? n.less_spending : n.more_spending, C = () => {
3033
+ if (r === 0) return null;
3034
+ const S = r > 0 ? n.up_from : n.down_from, D = j(S, _, d);
3035
+ return /* @__PURE__ */ a(W, { children: [
1179
3036
  /* @__PURE__ */ e(
1180
- _e,
3037
+ bn,
1181
3038
  {
1182
3039
  fill: !0,
1183
3040
  name: "circle",
1184
3041
  sx: { color: "text.secondary", fontSize: 8, mx: 4, p: 1 }
1185
3042
  }
1186
3043
  ),
1187
- R
3044
+ D
1188
3045
  ] });
1189
3046
  };
1190
- return /* @__PURE__ */ e(J, { children: /* @__PURE__ */ u(_, { sx: { backgroundColor: "background.paper" }, children: [
1191
- /* @__PURE__ */ e(x, { sx: { borderBottom: "1px solid", borderBottomColor: "divider", p: 16 }, children: /* @__PURE__ */ u(
1192
- _,
3047
+ return /* @__PURE__ */ a(V, { children: [
3048
+ /* @__PURE__ */ e(
3049
+ k,
1193
3050
  {
1194
- flexDirection: "row",
1195
- sx: { alignItems: "center", gap: 16, height: 48, width: "100%" },
1196
- children: [
1197
- /* @__PURE__ */ e(
1198
- _,
1199
- {
1200
- sx: {
1201
- alignItems: "center",
1202
- backgroundColor: m(),
1203
- borderRadius: 999,
1204
- height: 48,
1205
- justifyContent: "center",
1206
- minWidth: 48
1207
- },
1208
- children: /* @__PURE__ */ e(y, { sx: { fontWeight: 600 }, variant: "Body", children: a > 0 ? `+${a}` : a })
1209
- }
1210
- ),
1211
- /* @__PURE__ */ u(_, { sx: { gap: 2, width: "80%" }, children: [
1212
- /* @__PURE__ */ e(W, { fontWeight: 600, variant: "Body", children: f() }),
1213
- /* @__PURE__ */ u(W, { sx: { color: "text.secondary" }, variant: "subtitle2", children: [
1214
- h,
1215
- " ",
1216
- v()
1217
- ] })
1218
- ] })
1219
- ]
3051
+ sx: {
3052
+ borderBottomColor: "divider",
3053
+ borderBottomStyle: "solid",
3054
+ borderBottomWidth: r !== 0 ? 1 : 0,
3055
+ p: 16
3056
+ },
3057
+ children: /* @__PURE__ */ a(
3058
+ p,
3059
+ {
3060
+ flexDirection: "row",
3061
+ sx: { alignItems: "center", gap: 16, height: 48, width: "100%" },
3062
+ children: [
3063
+ /* @__PURE__ */ e(
3064
+ p,
3065
+ {
3066
+ sx: {
3067
+ alignItems: "center",
3068
+ backgroundColor: y(),
3069
+ borderRadius: 999,
3070
+ height: 48,
3071
+ justifyContent: "center",
3072
+ width: 48
3073
+ },
3074
+ children: /* @__PURE__ */ e(M, { sx: { fontWeight: 600 }, variant: "Body", children: r > 0 ? `+${r}` : r })
3075
+ }
3076
+ ),
3077
+ /* @__PURE__ */ a(p, { sx: { gap: 2, width: "80%" }, children: [
3078
+ /* @__PURE__ */ e(I, { fontWeight: 600, variant: "Body", children: f() }),
3079
+ /* @__PURE__ */ a(I, { sx: { color: "text.secondary" }, variant: "subtitle2", children: [
3080
+ h,
3081
+ " ",
3082
+ C()
3083
+ ] })
3084
+ ] })
3085
+ ]
3086
+ }
3087
+ )
1220
3088
  }
1221
- ) }),
1222
- a !== 0 && /* @__PURE__ */ e(x, { sx: { color: "text.secondary", pb: 8, pl: 32, pr: 16, pt: 12 }, children: /* @__PURE__ */ u(
1223
- st,
3089
+ ),
3090
+ r !== 0 && /* @__PURE__ */ e(k, { sx: { color: "text.secondary", pb: 8, pl: 32, pr: 16, pt: 12 }, children: /* @__PURE__ */ a(
3091
+ fo,
1224
3092
  {
1225
3093
  sx: {
1226
- [`& .${ct.root}:before`]: {
3094
+ [`& .${So.root}:before`]: {
1227
3095
  flex: 0,
1228
3096
  padding: 0
1229
3097
  },
@@ -1232,22 +3100,22 @@ const ht = ({ list: n, onClickItem: o }) => /* @__PURE__ */ e(x, { sx: { bgcolor
1232
3100
  },
1233
3101
  children: [
1234
3102
  /* @__PURE__ */ e(
1235
- me,
3103
+ pt,
1236
3104
  {
1237
- content: b(
1238
- t.spend_to_income_description,
1239
- pe(i),
1240
- pe(r)
3105
+ content: j(
3106
+ n.spend_to_income_description,
3107
+ Re(c),
3108
+ Re(l)
1241
3109
  )
1242
3110
  }
1243
3111
  ),
1244
3112
  /* @__PURE__ */ e(
1245
- me,
3113
+ pt,
1246
3114
  {
1247
- content: b(
1248
- t.credit_score_description,
1249
- l,
1250
- d
3115
+ content: j(
3116
+ n.credit_score_description,
3117
+ i,
3118
+ s
1251
3119
  ),
1252
3120
  islast: !0
1253
3121
  }
@@ -1255,208 +3123,445 @@ const ht = ({ list: n, onClickItem: o }) => /* @__PURE__ */ e(x, { sx: { bgcolor
1255
3123
  ]
1256
3124
  }
1257
3125
  ) })
1258
- ] }) });
1259
- }, Wt = I(Et), Bt = ({ isOpen: n, onClose: o }) => {
1260
- const t = E(), { finstrong: a } = S(), { isCopyLoaded: d, isInitialized: l } = z(), { healthScore: i, healthScoreChangeReports: r, augmentedChartData: s } = $();
1261
- if (!d || !l) return /* @__PURE__ */ e(N, {});
1262
- const c = se(i.health_score || 0, a), p = r.slice().reverse();
3126
+ ] });
3127
+ }, qr = v(Xr), Ur = ({ isOpen: t, onClose: o }) => {
3128
+ const n = $(), { finstrong: r } = x(), { isCopyLoaded: s, isInitialized: i } = X(), { augmentedChartData: c, healthScore: l, healthScoreChangeReports: _, peerScore: d } = R();
3129
+ if (!s || !i) return /* @__PURE__ */ e(oe, {});
3130
+ const u = je(l.health_score || 0, r), h = _.slice().reverse();
1263
3131
  return /* @__PURE__ */ e(
1264
3132
  Lt,
1265
3133
  {
1266
- additionalContent: /* @__PURE__ */ e(_, { sx: { pl: 18, backgroundColor: "background.paper" }, children: /* @__PURE__ */ e(
1267
- xe,
3134
+ additionalContent: /* @__PURE__ */ e(p, { sx: { backgroundColor: "background.paper" }, children: /* @__PURE__ */ e(
3135
+ qe,
1268
3136
  {
1269
- axisColor: t.palette.divider,
3137
+ axisColor: n.palette.divider,
1270
3138
  baseline: "min",
1271
- colors: [t.palette.primary.main],
3139
+ colors: [n.palette.primary.main],
1272
3140
  curveType: "natural",
1273
- datasets: [s],
3141
+ datasets: [c],
1274
3142
  height: 160,
1275
- labels: [a.key_indicators_label],
1276
- margin: { top: 12, left: 24 },
3143
+ isGraphClippingXAxis: !0,
3144
+ labels: [r.key_indicators_label],
3145
+ margin: { top: 24, bottom: 32, right: 24, left: 45 },
3146
+ peerAverage: Math.round(d?.average_health_score?.average_health_score || 0),
1277
3147
  showArea: !0,
1278
3148
  showAverage: !0,
1279
- title: a.peer_average,
3149
+ title: r.peer_average,
1280
3150
  useCustomMark: !0
1281
3151
  }
1282
3152
  ) }),
1283
- drawerTitle: a.score_history,
1284
- isOpen: n,
3153
+ drawerTitle: r.score_history,
3154
+ isOpen: t,
1285
3155
  loadConnectAccountsCard: !1,
1286
3156
  onClose: o,
1287
- stickyComponent: /* @__PURE__ */ u(
1288
- _,
3157
+ stickyComponent: /* @__PURE__ */ e(
3158
+ p,
1289
3159
  {
1290
- direction: "row",
1291
- sx: { backgroundColor: "background.paper", gap: 16, pb: 12, pt: 8, px: 24 },
1292
- children: [
1293
- /* @__PURE__ */ e(x, { children: /* @__PURE__ */ e(
1294
- ke,
3160
+ sx: {
3161
+ backgroundColor: "background.paper",
3162
+ borderBottom: "1px solid",
3163
+ borderColor: "divider",
3164
+ pb: 11,
3165
+ pt: 8,
3166
+ px: 24
3167
+ },
3168
+ children: /* @__PURE__ */ a(p, { sx: { alignItems: "center", flexDirection: "row", gap: 16 }, children: [
3169
+ /* @__PURE__ */ e(
3170
+ Rt,
1295
3171
  {
1296
- arcRadius: 20,
1297
- healthScore: i?.health_score,
3172
+ arcRadius: 24,
3173
+ healthScore: l?.health_score,
3174
+ margin: { top: 9 },
1298
3175
  size: "SM"
1299
3176
  }
1300
- ) }),
1301
- /* @__PURE__ */ u(x, { children: [
1302
- /* @__PURE__ */ e(y, { fontSize: 18, fontWeight: 700, sx: { mb: 4 }, variant: "subtitle1", children: c.status }),
1303
- /* @__PURE__ */ e(y, { variant: "caption", children: c.description })
3177
+ ),
3178
+ /* @__PURE__ */ a(p, { sx: { gap: 4 }, children: [
3179
+ /* @__PURE__ */ e(M, { variant: "h3", children: u.status }),
3180
+ /* @__PURE__ */ e(M, { variant: "XSmall", children: u.description })
1304
3181
  ] })
1305
- ]
3182
+ ] })
1306
3183
  }
1307
3184
  ),
1308
- children: /* @__PURE__ */ e(_, { sx: { gap: 16 }, children: p.map((h, m) => /* @__PURE__ */ e(Wt, { report: h }, m)) })
3185
+ children: /* @__PURE__ */ e(p, { sx: { gap: 16 }, children: h.map((y, f) => /* @__PURE__ */ e(qr, { report: y }, f)) })
1309
3186
  }
1310
3187
  );
1311
- }, Ht = I(Bt), zt = ({ onClick: n }) => {
1312
- const { finstrong: o } = S(), { isCopyLoaded: t } = z();
1313
- return t ? /* @__PURE__ */ u(_, { sx: { alignItems: "center", gap: 12, pt: 12, pb: 32 }, children: [
1314
- /* @__PURE__ */ e(Ee, { size: 48 }),
1315
- /* @__PURE__ */ u(_, { sx: { alignItems: "center", gap: 4, textAlign: "center" }, children: [
1316
- /* @__PURE__ */ e(H, { children: o.missing_data_title }),
1317
- /* @__PURE__ */ e(y, { sx: { width: { sm: 348 } }, variant: "subtitle1", children: o.missing_data_description })
3188
+ }, Qr = v(Ur), Zr = ({ copy: t }) => {
3189
+ const o = $(), n = [
3190
+ o.palette.chartMono.chartMono5,
3191
+ o.palette.chartMono.chartMono4,
3192
+ o.palette.chartMono.chartMono3,
3193
+ o.palette.chartMono.chartMono2
3194
+ ];
3195
+ return /* @__PURE__ */ a(p, { sx: { gap: 8 }, children: [
3196
+ /* @__PURE__ */ e(p, { sx: { flexDirection: "row", gap: 8, px: 2 }, children: [
3197
+ { color: "chartMono.chartMono2", text: t.vulnerable, value: "0-25" },
3198
+ { color: "chartMono.chartMono3", text: t.building, value: "26-50" },
3199
+ { color: "chartMono.chartMono4", text: t.stable, value: "51-75" },
3200
+ { color: "chartMono.chartMono5", text: t.strong, value: "76-100" }
3201
+ ].map(({ color: r, text: s, value: i }) => /* @__PURE__ */ a(p, { sx: { gap: 4, textAlign: "center", width: "100%" }, children: [
3202
+ /* @__PURE__ */ a(k, { children: [
3203
+ /* @__PURE__ */ e(M, { sx: { fontWeight: 700, textTransform: "uppercase" }, variant: "caption", children: s }),
3204
+ /* @__PURE__ */ a(I, { sx: { color: "text.secondary" }, variant: "caption", children: [
3205
+ "(",
3206
+ i,
3207
+ ")"
3208
+ ] })
3209
+ ] }),
3210
+ /* @__PURE__ */ e(k, { sx: { border: "2px solid", borderColor: r, borderRadius: "3px" } })
3211
+ ] }, s)) }),
3212
+ /* @__PURE__ */ a(k, { children: [
3213
+ /* @__PURE__ */ e(
3214
+ k,
3215
+ {
3216
+ sx: {
3217
+ background: `linear-gradient(to left, ${n.join(", ")})`,
3218
+ borderRadius: "4px",
3219
+ height: 16
3220
+ }
3221
+ }
3222
+ ),
3223
+ /* @__PURE__ */ e(p, { sx: { flexDirection: "row", justifyContent: "space-between" }, children: [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100].map((r) => /* @__PURE__ */ a(
3224
+ p,
3225
+ {
3226
+ sx: { alignItems: "center", height: 20, justifyContent: "space-between", width: 24 },
3227
+ children: [
3228
+ /* @__PURE__ */ e(
3229
+ k,
3230
+ {
3231
+ sx: {
3232
+ borderBottom: "1px solid",
3233
+ borderColor: "divider",
3234
+ position: "relative",
3235
+ rotate: "90deg",
3236
+ top: 3.5,
3237
+ width: 8
3238
+ }
3239
+ }
3240
+ ),
3241
+ /* @__PURE__ */ e(I, { sx: { color: "text.secondary" }, variant: "tiny", children: r })
3242
+ ]
3243
+ },
3244
+ r
3245
+ )) })
3246
+ ] })
3247
+ ] });
3248
+ }, Jr = ({ isOpen: t, onClose: o }) => {
3249
+ const { finstrong: n } = x(), { isCopyLoaded: r } = X();
3250
+ return r ? /* @__PURE__ */ e(ne, { isOpen: t, onClose: o, title: n.score_rubric, children: /* @__PURE__ */ a(p, { sx: { bgcolor: "background.default", gap: 36, height: "100%", p: 24 }, children: [
3251
+ /* @__PURE__ */ a(p, { sx: { gap: 20 }, children: [
3252
+ /* @__PURE__ */ a(p, { sx: { gap: 8 }, children: [
3253
+ /* @__PURE__ */ e(Y, { sx: { textWrap: "wrap" }, children: n.your_path_to_financial_freedom }),
3254
+ /* @__PURE__ */ e(M, { variant: "subtitle1", children: n.finstrong_freedom_description })
3255
+ ] }),
3256
+ /* @__PURE__ */ e(k, { children: /* @__PURE__ */ e(Zr, { copy: n }) })
3257
+ ] }),
3258
+ /* @__PURE__ */ a(p, { sx: { gap: 12 }, children: [
3259
+ /* @__PURE__ */ e(I, { sx: { fontWeight: 600 }, variant: "body1", children: n.how_do_we_do_this }),
3260
+ /* @__PURE__ */ a(
3261
+ Ne,
3262
+ {
3263
+ component: "ol",
3264
+ sx: {
3265
+ listStyleType: "decimal",
3266
+ pl: 20,
3267
+ pr: 16,
3268
+ "& li": {
3269
+ "::marker": {
3270
+ fontWeight: 600
3271
+ }
3272
+ },
3273
+ "& .MuiListItemText-secondary": {
3274
+ fontSize: 15,
3275
+ lineHeight: "24px",
3276
+ pt: 4
3277
+ }
3278
+ },
3279
+ children: [
3280
+ /* @__PURE__ */ e(ge, { sx: { display: "list-item" }, children: /* @__PURE__ */ e(
3281
+ ye,
3282
+ {
3283
+ primary: n.understand_your_habits,
3284
+ secondary: n.understand_your_habits_description
3285
+ }
3286
+ ) }),
3287
+ /* @__PURE__ */ e(ge, { sx: { display: "list-item", pt: 16 }, children: /* @__PURE__ */ e(
3288
+ ye,
3289
+ {
3290
+ primary: n.see_whats_possible,
3291
+ secondary: n.see_whats_possible_description
3292
+ }
3293
+ ) })
3294
+ ]
3295
+ }
3296
+ )
1318
3297
  ] }),
1319
- /* @__PURE__ */ e(x, { children: /* @__PURE__ */ e(
1320
- q,
3298
+ /* @__PURE__ */ a(p, { sx: { gap: 4 }, children: [
3299
+ /* @__PURE__ */ e(I, { sx: { fontWeight: 600, pb: 4 }, variant: "body1", children: n.we_ask_questions }),
3300
+ /* @__PURE__ */ a(
3301
+ Ne,
3302
+ {
3303
+ component: "ol",
3304
+ sx: {
3305
+ listStyleType: "initial",
3306
+ pl: 20,
3307
+ pr: 16,
3308
+ "& li": {
3309
+ minHeight: "max-content",
3310
+ "::marker": {
3311
+ color: "text.secondary",
3312
+ fontWeight: 600
3313
+ }
3314
+ },
3315
+ "& .MuiListItemText-secondary": {
3316
+ fontSize: 15,
3317
+ lineHeight: "24px"
3318
+ }
3319
+ },
3320
+ children: [
3321
+ /* @__PURE__ */ e(ge, { sx: { display: "list-item" }, children: /* @__PURE__ */ e(ye, { secondary: n.we_ask_questions_description_1 }) }),
3322
+ /* @__PURE__ */ e(ge, { sx: { display: "list-item" }, children: /* @__PURE__ */ e(ye, { secondary: n.we_ask_questions_description_2 }) })
3323
+ ]
3324
+ }
3325
+ )
3326
+ ] })
3327
+ ] }) }) : /* @__PURE__ */ e(oe, {});
3328
+ }, ea = v(Jr), ta = v(() => {
3329
+ const [t, o] = m.useState(!1), n = $(), [r, { width: s }] = vt(), { finstrong: i } = x(), { isCopyLoaded: c, isInitialized: l } = X(), { healthScore: _, healthScoreChange: d } = R(), u = n.palette.mode === "dark", h = je(_?.health_score, i);
3330
+ return !c || !l ? /* @__PURE__ */ e(oe, {}) : /* @__PURE__ */ a(V, { ref: r, sx: { p: 16, display: "flex", flexDirection: "column", gap: 8 }, children: [
3331
+ /* @__PURE__ */ e(
3332
+ To,
1321
3333
  {
1322
- endIcon: /* @__PURE__ */ e(j, {}),
1323
- onClick: n,
1324
- size: "small",
3334
+ action: /* @__PURE__ */ e(
3335
+ P,
3336
+ {
3337
+ endIcon: /* @__PURE__ */ e(Z, {}),
3338
+ onClick: () => o(!0),
3339
+ sx: {
3340
+ fontSize: 13,
3341
+ lineHeight: "16px",
3342
+ fontWeight: 600,
3343
+ color: "primary.main"
3344
+ },
3345
+ variant: "text",
3346
+ children: i.financial_strength_header_action
3347
+ }
3348
+ ),
3349
+ subheader: /* @__PURE__ */ e(Y, { color: "text.primary", children: i.financial_strength_header }),
1325
3350
  sx: {
1326
- fontSize: 13,
1327
- ":hover": {
1328
- bgcolor: "transparent"
3351
+ p: 0,
3352
+ "& .MuiCardHeader-content": {
3353
+ overflow: "hidden"
3354
+ }
3355
+ }
3356
+ }
3357
+ ),
3358
+ /* @__PURE__ */ e(p, { sx: { justifyContent: "center", alignItems: "center", pb: 4, pt: 20, px: 16 }, children: /* @__PURE__ */ e(
3359
+ Rt,
3360
+ {
3361
+ arcRadius: s <= 323 ? 72.5 : 154,
3362
+ footerCenterContent: d,
3363
+ healthScore: _?.health_score || 0,
3364
+ size: s <= 323 ? "M" : "L"
3365
+ }
3366
+ ) }),
3367
+ _?.health_score ? /* @__PURE__ */ a(
3368
+ Mo,
3369
+ {
3370
+ sx: {
3371
+ px: 16,
3372
+ backgroundColor: u ? "grey.800" : "grey.50",
3373
+ //TODO: Need to change the background color to palette (supporting both darkmode and lightmode)
3374
+ "&.Mui-expanded": {
3375
+ m: 0
3376
+ },
3377
+ "&::before": {
3378
+ display: "none"
1329
3379
  }
1330
3380
  },
1331
- variant: "text",
1332
- children: o.connect_more_accounts_button
3381
+ children: [
3382
+ /* @__PURE__ */ e(
3383
+ Io,
3384
+ {
3385
+ expandIcon: /* @__PURE__ */ e(gn, { size: 20 }),
3386
+ sx: {
3387
+ height: 52,
3388
+ p: 0,
3389
+ "&.Mui-expanded": {
3390
+ minHeight: 0
3391
+ }
3392
+ },
3393
+ children: /* @__PURE__ */ e(M, { sx: { fontWeight: 600 }, variant: "body1", children: i.accordion_title_text })
3394
+ }
3395
+ ),
3396
+ /* @__PURE__ */ e(Do, { sx: { "&.MuiAccordionDetails-root": { padding: 0, pb: 16 } }, children: /* @__PURE__ */ e(M, { variant: "subtitle1", children: h.scoreContent }) })
3397
+ ]
1333
3398
  }
1334
- ) })
1335
- ] }) : /* @__PURE__ */ e(N, {});
1336
- }, $t = I(zt), Nt = ({ onBackClick: n, sx: o }) => {
1337
- const t = E(), { onLoad: a } = Ke(), { visibleAccounts: d } = ye(), { dateRange: l, isDataLoaded: i, loadBudgetData: r, setTheme: s } = be(), { reloadCategoryTotals: c } = Xe(), { augmentedChartData: p, calculateHealthScore: h, healthScore: m, loadAugmentedChartData: f } = $(), { finstrong: v, connect: T } = S(), { isCopyLoaded: R, isInitialized: w, selectedAccounts: L, setSelectedAccounts: K } = z(), { isMobile: P } = Se(), [G, k] = C.useState(!1);
1338
- C.useEffect(() => {
1339
- s(t);
1340
- }, []), C.useEffect(() => K(d), [d]), C.useEffect(() => {
1341
- w && (h().finally(), f().finally(() => {
1342
- a?.("FinstrongWidget");
3399
+ ) : /* @__PURE__ */ e(
3400
+ We,
3401
+ {
3402
+ buttonText: i.connect_more_accounts_title,
3403
+ description: i.health_score_zero_description,
3404
+ drawerType: "connectDrawer",
3405
+ hasIcon: !1,
3406
+ isDashboard: !0,
3407
+ sx: {
3408
+ backgroundColor: u ? "grey.800" : "grey.50",
3409
+ //TODO: Need to change the background color to palette (supporting both darkmode and lightmode)
3410
+ ".connect-more-accounts-title": {
3411
+ fontWeight: 600,
3412
+ lineHeight: "20px",
3413
+ color: "text.primary"
3414
+ },
3415
+ ".connect-more-accounts-description": { color: "text.primary" }
3416
+ },
3417
+ title: i.health_score_zero_title
3418
+ }
3419
+ ),
3420
+ /* @__PURE__ */ e(
3421
+ ea,
3422
+ {
3423
+ isOpen: t,
3424
+ onClose: () => o(!1)
3425
+ }
3426
+ )
3427
+ ] });
3428
+ }), na = ({ onBackClick: t, sx: o, onPrimaryCtaClick: n }) => {
3429
+ const { visibleAccounts: r } = xe(), { dateRange: s, isDataLoaded: i, loadBudgetData: c, setTheme: l } = Wn(), { reloadCategoryTotals: _ } = Ve(), d = R(), {
3430
+ augmentedChartData: u,
3431
+ calculateHealthScore: h,
3432
+ healthScore: y,
3433
+ loadAugmentedChartData: f,
3434
+ loadMonthlySummaries: C,
3435
+ loadPeerScore: S,
3436
+ peerScore: D
3437
+ } = d, { finstrong: g, connect: b } = x(), { isCopyLoaded: w, isInitialized: H } = X(), { onLoad: N } = $n(), { loadRepeatingTransactions: U } = Xe(), { isMobile: L } = Qe(), O = $(), { userProfile: G } = J(), [pe, Ce] = m.useState(!1), [ee, K] = m.useState(!1), [ve, z] = m.useState(!1), [we, E] = m.useState(!1);
3438
+ if (m.useEffect(() => {
3439
+ l(O);
3440
+ }, []), m.useEffect(() => {
3441
+ n && (d.handleFinstrongWidgetPrimaryCtaClick = n);
3442
+ }, [n, d]), m.useEffect(() => {
3443
+ H && (C().finally(), S().finally(), h().finally(), f().finally(() => {
3444
+ N?.("FinstrongWidget");
1343
3445
  }));
1344
- }, [w]), C.useEffect(() => {
1345
- w && (c(L, l.start, l.end), i || r());
1346
- }, [l, i, w, L]);
1347
- const [O, F] = C.useState(!1), [Z, U] = C.useState(!1);
1348
- if (!R || !w) return /* @__PURE__ */ e(N, {});
1349
- const ee = () => {
1350
- }, te = () => F(!0);
1351
- return /* @__PURE__ */ u(
1352
- ut,
3446
+ }, [H]), m.useEffect(() => {
3447
+ H && (_(r, s.start, s.end).finally(() => {
3448
+ Ce(!0);
3449
+ }), i || (c(), U().finally()));
3450
+ }, [s, i, H, r]), !w || !H || !pe) return /* @__PURE__ */ e(oe, {});
3451
+ const ae = () => K(!0), _e = Math.round(D?.average_health_score?.average_health_score || 0);
3452
+ return /* @__PURE__ */ a(
3453
+ Ao,
1353
3454
  {
1354
- accountOptions: d,
1355
3455
  actions: [
1356
3456
  {
1357
3457
  iconName: "person",
1358
- label: v.profile,
1359
- onClick: te
3458
+ label: g.profile,
3459
+ onClick: ae
1360
3460
  }
1361
3461
  ],
1362
3462
  hasDivider: !0,
1363
- onAccountsFilterClick: ee,
1364
- onBackClick: n,
3463
+ onBackClick: t,
1365
3464
  sx: o,
1366
- title: v.title,
3465
+ title: g.title,
1367
3466
  children: [
1368
- /* @__PURE__ */ u(
1369
- _,
3467
+ G.has_completed_finstrong_onboarding ? /* @__PURE__ */ a(
3468
+ p,
1370
3469
  {
1371
3470
  sx: {
3471
+ bgcolor: "background.default",
1372
3472
  flexDirection: { md: "row" },
1373
3473
  gap: 24,
1374
3474
  justifyContent: "center",
1375
- pt: P ? 24 : 16,
3475
+ pt: L ? 24 : 16,
1376
3476
  px: 24
1377
3477
  },
1378
3478
  children: [
1379
- /* @__PURE__ */ u(_, { sx: { gap: 24, width: { md: 432 } }, children: [
1380
- /* @__PURE__ */ e(vt, {}),
3479
+ /* @__PURE__ */ a(p, { sx: { gap: 24, width: { md: 432 }, height: "100%" }, children: [
3480
+ /* @__PURE__ */ e(ta, {}),
1381
3481
  /* @__PURE__ */ e(
1382
- Q,
3482
+ We,
1383
3483
  {
1384
- description: v.connect_more_accounts_description,
1385
- title: v.connect_more_accounts_title
3484
+ description: g.connect_more_accounts_description,
3485
+ drawerType: "connectDrawer",
3486
+ title: g.connect_more_accounts_title
1386
3487
  }
1387
3488
  )
1388
3489
  ] }),
1389
- /* @__PURE__ */ e(_, { sx: { maxWidth: 848, minWidth: 288, width: { md: 720 } }, children: /* @__PURE__ */ u(J, { sx: { background: t.palette.background.paper, p: 16 }, children: [
1390
- /* @__PURE__ */ u(_, { direction: "row", sx: { alignItems: "center", justifyContent: "space-between" }, children: [
1391
- /* @__PURE__ */ e(H, { children: v.key_indicators }),
3490
+ /* @__PURE__ */ e(p, { sx: { maxWidth: 848, minWidth: 288, width: { md: 720 } }, children: /* @__PURE__ */ a(V, { sx: { height: "100%", p: 16 }, children: [
3491
+ /* @__PURE__ */ a(p, { direction: "row", sx: { alignItems: "center", justifyContent: "space-between" }, children: [
3492
+ /* @__PURE__ */ e(Y, { children: g.key_indicators }),
1392
3493
  /* @__PURE__ */ e(
1393
- q,
3494
+ P,
1394
3495
  {
1395
- endIcon: /* @__PURE__ */ e(j, {}),
1396
- onClick: () => U(!0),
3496
+ endIcon: /* @__PURE__ */ e(Z, {}),
3497
+ onClick: () => z(!0),
1397
3498
  sx: {
1398
3499
  fontSize: 13
1399
3500
  },
1400
3501
  variant: "text",
1401
- children: v.whats_changed
3502
+ children: g.whats_changed
1402
3503
  }
1403
3504
  )
1404
3505
  ] }),
1405
- p.length ? /* @__PURE__ */ e(
1406
- xe,
3506
+ u.length ? /* @__PURE__ */ e(
3507
+ qe,
1407
3508
  {
1408
- axisColor: t.palette.divider,
3509
+ axisColor: O.palette.divider,
1409
3510
  baseline: "min",
1410
- colors: [t.palette.primary.main],
3511
+ colors: [O.palette.primary.main],
1411
3512
  curveType: "natural",
3513
+ customLegendBoxSx: { borderRadius: "2px" },
3514
+ customLegendSx: { left: 0 },
1412
3515
  customLegendVariant: "XSmall",
1413
- datasets: [p],
3516
+ datasets: [u],
1414
3517
  height: 300,
1415
3518
  isGraphClippingXAxis: !0,
1416
- labelBackgroundColor: t.palette.border.dark,
1417
- labelFontColor: t.palette.common.white,
1418
- labelFontSize: typeof t.typography.XSmall?.fontSize == "string" ? parseFloat(t.typography.XSmall.fontSize) : t.typography.XSmall?.fontSize,
1419
- labels: [v.key_indicators_label],
1420
- margin: { right: 20, left: 25 },
3519
+ labelBackgroundColor: O.palette.border.dark,
3520
+ labelFontColor: O.palette.common.white,
3521
+ labelFontSize: typeof O.typography.XSmall?.fontSize == "string" ? parseFloat(O.typography.XSmall.fontSize) : O.typography.XSmall?.fontSize,
3522
+ labels: [g.key_indicators_label],
3523
+ margin: { right: 0, left: 25 },
3524
+ peerAverage: _e,
1421
3525
  showArea: !0,
1422
3526
  showAverage: !0,
1423
3527
  showLegend: !0,
1424
3528
  showMarkLabel: !0,
1425
3529
  showXAxis: !0,
1426
- title: v.peer_average,
1427
- useCustomMark: !0
3530
+ title: g.peer_average,
3531
+ useCustomMark: !0,
3532
+ xAxisScaleType: "band"
1428
3533
  }
1429
- ) : /* @__PURE__ */ e($t, { onClick: () => k(!0) }),
1430
- m.health_score !== null && /* @__PURE__ */ e(Pt, {})
3534
+ ) : /* @__PURE__ */ e(Rr, { onClick: () => E(!0) }),
3535
+ y.health_score !== null && /* @__PURE__ */ e(Or, {})
1431
3536
  ] }) })
1432
3537
  ]
1433
3538
  }
1434
- ),
1435
- /* @__PURE__ */ e(Tt, { isOpen: O, onClose: () => F(!1) }),
3539
+ ) : /* @__PURE__ */ e(Nr, {}),
3540
+ /* @__PURE__ */ e(Vr, { isOpen: ee, onClose: () => K(!1) }),
1436
3541
  /* @__PURE__ */ e(
1437
- Ce,
3542
+ re,
1438
3543
  {
1439
- onClose: () => k(!1),
1440
- showConnectWidget: G,
1441
- title: T.mini_title
3544
+ onClose: () => E(!1),
3545
+ showConnectWidget: we,
3546
+ title: b.mini_title
1442
3547
  }
1443
3548
  ),
1444
3549
  /* @__PURE__ */ e(
1445
- Ht,
3550
+ Qr,
1446
3551
  {
1447
- isOpen: Z,
1448
- onClose: () => U(!1)
3552
+ isOpen: ve,
3553
+ onClose: () => z(!1)
1449
3554
  }
1450
3555
  )
1451
3556
  ]
1452
3557
  }
1453
3558
  );
1454
- }, zo = I(Nt);
3559
+ }, fi = v(na);
1455
3560
  export {
1456
- Ho as CreditScoreGraph,
1457
- ve as DialScoreCard,
1458
- ke as FinancialStrengthGraph,
1459
- Ko as FinstrongApi,
1460
- Xo as FinstrongStore,
1461
- zo as FinstrongWidget
3561
+ Fo as CreditScoreGraph,
3562
+ Ft as DialScoreCard,
3563
+ Rt as FinancialStrengthGraph,
3564
+ Ci as FinstrongApi,
3565
+ vi as FinstrongStore,
3566
+ fi as FinstrongWidget
1462
3567
  };