@mx-cartographer/experiences 7.7.2 → 7.8.0-alpha-ram-goal-bug
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.
- package/CHANGELOG.md +18 -0
- package/dist/Account-BiB1F8lL.mjs +118 -0
- package/dist/{Account-BfkKlfsW.mjs → Account-DuOz1a27.mjs} +1 -1
- package/dist/AccountApi-DgZ8ILj1.mjs +19 -0
- package/dist/{AccountDetailsHeader-DqYIuhOs.mjs → AccountDetailsHeader-Cf2TUJnM.mjs} +4 -4
- package/dist/AccountDisplayName-CO7z3v99.mjs +11 -0
- package/dist/{AccountFields-yP8QdgPd.mjs → AccountFields-UdOvbQ5H.mjs} +7 -6
- package/dist/{AccountListItem-DMbu9ehd.mjs → AccountListItem-BPVxmNT_.mjs} +7 -7
- package/dist/AccountStore-BbPWe2C9.mjs +244 -0
- package/dist/Accounts-M-LTzStv.mjs +27 -0
- package/dist/{CategoryStore-Cnw9yUys.mjs → CategoryStore-BYICdb9m.mjs} +73 -73
- package/dist/CategoryUtil-meuejJqP.mjs +80 -0
- package/dist/{ConnectionsDrawer-BqR6FWJO.mjs → ConnectionsDrawer-BDpVTTSe.mjs} +1 -1
- package/dist/{DebtsStore-DuSdXM1k.mjs → DebtsStore-BIbOVCPe.mjs} +12 -12
- package/dist/{ExportCsvAction-HK5CeZWR.mjs → ExportCsvAction-CDuzTva1.mjs} +2 -2
- package/dist/GlobalAccountFilter-DQCPNc95.mjs +316 -0
- package/dist/GoalStore-B4LVt_kH.mjs +422 -0
- package/dist/{ManageIncome-BrTrlplL.mjs → ManageIncome-CL3hv8i9.mjs} +44 -44
- package/dist/NetWorthStore-yV43kJro.mjs +168 -0
- package/dist/{NotificationSettings-D4Vh3z8I.mjs → NotificationSettings-SPg3pwbX.mjs} +171 -169
- package/dist/{NotificationStore-CDX_kqHa.mjs → NotificationStore-Ck2KdNmT.mjs} +22 -14
- package/dist/{RecurringSettings-D2V6l77l.mjs → RecurringSettings-Bmnnpb48.mjs} +16 -16
- package/dist/{RecurringTransactionsStore-Caf1cq4v.mjs → RecurringTransactionsStore-BQBEJOPP.mjs} +91 -81
- package/dist/{RecurringTransactions-Bf4lX0Cn.mjs → RepeatingTransaction-miZVnk_A.mjs} +4 -4
- package/dist/{SettingsStore-krIRNwHK.mjs → SettingsStore-BHpuyujx.mjs} +1 -1
- package/dist/SkeletonLoader-BaNboJjD.mjs +38 -0
- package/dist/{SpendingLegend-gTCJLLkV.mjs → SpendingLegend-CD60HCYS.mjs} +33 -33
- package/dist/{TransactionDetails-7MHOshKQ.mjs → TransactionDetails-BDhz3DLT.mjs} +2 -2
- package/dist/TransactionStore-BSp5bOKg.mjs +705 -0
- package/dist/{User-LJpEwPtn.mjs → User-B0LnmiKO.mjs} +21 -20
- package/dist/WidgetContainer-BbPS3Yxz.mjs +555 -0
- package/dist/accounts/index.es.js +421 -391
- package/dist/accounts/stores/AccountStore.d.ts +30 -23
- package/dist/accounts/utils/Accounts.d.ts +2 -1
- package/dist/budgets/index.es.js +546 -540
- package/dist/budgets/store/BudgetsStore.d.ts +1 -0
- package/dist/cashflow/index.es.js +444 -457
- package/dist/categories/index.es.js +1 -1
- package/dist/categories/stores/CategoryStore.d.ts +10 -5
- package/dist/categories/util/CategoryUtil.d.ts +3 -2
- package/dist/common/components/GlobalAccountFilter.d.ts +11 -0
- package/dist/common/components/SkeletonLoader.d.ts +7 -0
- package/dist/common/components/WidgetContainer.d.ts +7 -6
- package/dist/common/components/globalaccountfilter/GlobalAccountFilterList.d.ts +7 -0
- package/dist/common/components/index.d.ts +2 -2
- package/dist/common/hooks/useAriaLive.d.ts +1 -1
- package/dist/common/index.es.js +459 -445
- package/dist/common/stores/AppDataStore.d.ts +3 -1
- package/dist/common/stores/GlobalCopyStore.d.ts +0 -1
- package/dist/common/stores/GlobalStore.d.ts +3 -3
- package/dist/common/stores/GlobalUiStore.d.ts +10 -6
- package/dist/common/stores/UserStore.d.ts +3 -2
- package/dist/common/types/Account.d.ts +9 -6
- package/dist/dashboard/index.es.js +84 -116
- package/dist/debts/index.es.js +417 -413
- package/dist/{exportTransactionsToCSV-BrTYdSgJ.mjs → exportTransactionsToCSV-DtQ7ovAR.mjs} +1 -1
- package/dist/finstrong/index.es.js +1167 -1110
- package/dist/goals/index.es.js +618 -598
- package/dist/goals/stores/GoalStore.d.ts +19 -4
- package/dist/help/index.es.js +13 -13
- package/dist/investments/index.es.js +330 -325
- package/dist/investments/stores/HoldingStore.d.ts +1 -0
- package/dist/networth/components/NetWorthChart.d.ts +3 -2
- package/dist/networth/components/NetWorthList.d.ts +3 -3
- package/dist/networth/index.es.js +423 -433
- package/dist/networth/stores/NetWorthStore.d.ts +20 -9
- package/dist/networth/utils/NetWorthUtils.d.ts +2 -2
- package/dist/notifications/index.es.js +90 -91
- package/dist/notifications/stores/NotificationStore.d.ts +3 -1
- package/dist/recurringtransactions/components/MicroWidgetContent.d.ts +3 -0
- package/dist/recurringtransactions/index.es.js +543 -562
- package/dist/recurringtransactions/stores/RecurringTransactionsStore.d.ts +4 -2
- package/dist/settings/index.es.js +253 -248
- package/dist/spending/index.es.js +282 -301
- package/dist/transactions/index.es.js +269 -263
- package/dist/transactions/stores/TransactionStore.d.ts +26 -77
- package/dist/transactions/stores/UiStore.d.ts +0 -2
- package/dist/trends/index.es.js +708 -699
- package/dist/{useAccountDisplayName-BTvP_pw6.mjs → useAccountDisplayName-Bot2tb4n.mjs} +1 -1
- package/package.json +3 -3
- package/dist/AccountStore-CWFzg8-E.mjs +0 -260
- package/dist/Accounts-CWt-NRq8.mjs +0 -9
- package/dist/CategoryUtil-DZflYFam.mjs +0 -78
- package/dist/ConnectDrawer-BOjfI6rz.mjs +0 -563
- package/dist/GoalStore-C7ahxxLi.mjs +0 -364
- package/dist/NetWorthStore-xWIo9CYU.mjs +0 -150
- package/dist/TransactionStore-DJwPaZuM.mjs +0 -677
- package/dist/WidgetContainer-CrK6tyHr.mjs +0 -572
- package/dist/common/components/accountfilter/AccountFilter.d.ts +0 -20
- package/dist/common/components/accountfilter/AccountFilterOptions.d.ts +0 -31
- package/dist/common/components/accountfilter/index.d.ts +0 -1
- package/dist/{ToggleListItem-ciFTiqRS.mjs → Notification-Bs1fdbzI.mjs} +1 -1
|
@@ -4,20 +4,20 @@ import { observer as P } from "mobx-react-lite";
|
|
|
4
4
|
import _ from "@mui/material/Stack";
|
|
5
5
|
import Fe from "@mui/material/Tab";
|
|
6
6
|
import Ee from "@mui/material/Tabs";
|
|
7
|
-
import { C as pe } from "../ConnectionsDrawer-
|
|
7
|
+
import { C as pe } from "../ConnectionsDrawer-BDpVTTSe.mjs";
|
|
8
8
|
import xe from "@mui/material/useMediaQuery";
|
|
9
9
|
import Ne from "@mui/material/Box";
|
|
10
|
-
import
|
|
10
|
+
import Me from "@mui/material/Collapse";
|
|
11
11
|
import K from "@mui/material/Divider";
|
|
12
12
|
import te from "@mui/material/List";
|
|
13
13
|
import ne from "@mui/material/ListItem";
|
|
14
|
-
import
|
|
14
|
+
import Ge from "@mui/material/ListItemButton";
|
|
15
15
|
import ye from "@mui/material/ToggleButton";
|
|
16
16
|
import fe from "@mui/material/ToggleButtonGroup";
|
|
17
17
|
import { Text as r, P as J, InstitutionLogo as oe } from "@mxenabled/mxui";
|
|
18
18
|
import He from "@mui/material/Button";
|
|
19
|
-
import { u as
|
|
20
|
-
import { A as z, W as Ue } from "../WidgetContainer-
|
|
19
|
+
import { u as M, g as ve, s as H, b as Q, d as le } from "../hooks-ZMp65DFz.mjs";
|
|
20
|
+
import { A as z, W as Ue } from "../WidgetContainer-BbPS3Yxz.mjs";
|
|
21
21
|
import { a as je, f as ie } from "../NumberFormatting-DjTD0t3W.mjs";
|
|
22
22
|
import { u as U } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
23
23
|
import ce from "@mui/material/styles/useTheme";
|
|
@@ -32,16 +32,17 @@ import be from "@mui/material/Accordion";
|
|
|
32
32
|
import _e from "@mui/material/AccordionDetails";
|
|
33
33
|
import we from "@mui/material/AccordionSummary";
|
|
34
34
|
import re from "@mui/material/Paper";
|
|
35
|
-
import
|
|
35
|
+
import y from "@mui/system/Stack";
|
|
36
36
|
import Ce from "@mui/material/TextField";
|
|
37
37
|
import { D as Xe } from "../Drawer-DV4NTsFg.mjs";
|
|
38
38
|
import { DataGridPro as $e } from "@mui/x-data-grid-pro";
|
|
39
39
|
import { Stack as qe } from "@mui/material";
|
|
40
40
|
import { L as Se } from "../Loader-DUaFpDGv.mjs";
|
|
41
41
|
import { u as Ke } from "../useWidgetLoadTimer-hIOioiKx.mjs";
|
|
42
|
-
import {
|
|
42
|
+
import { A as Ye } from "../Account-BiB1F8lL.mjs";
|
|
43
|
+
import { E as Qe } from "../EmptyState-DoxNUae-.mjs";
|
|
43
44
|
const me = ({ sx: t = {} }) => {
|
|
44
|
-
const { investments: h } =
|
|
45
|
+
const { investments: h } = M(), { onEvent: c } = ve(), { setShowConnectionsWidget: m } = H();
|
|
45
46
|
return /* @__PURE__ */ o(_, { sx: { alignItems: "center", gap: 24, height: 164, p: 24, width: "100%", ...t }, children: [
|
|
46
47
|
/* @__PURE__ */ o(
|
|
47
48
|
_,
|
|
@@ -74,7 +75,7 @@ const me = ({ sx: t = {} }) => {
|
|
|
74
75
|
He,
|
|
75
76
|
{
|
|
76
77
|
onClick: () => {
|
|
77
|
-
|
|
78
|
+
m(!0), c(z.ACCOUNTS_CLICK_CONNECT);
|
|
78
79
|
},
|
|
79
80
|
sx: { fontWeight: 600 },
|
|
80
81
|
variant: "outlined",
|
|
@@ -82,7 +83,7 @@ const me = ({ sx: t = {} }) => {
|
|
|
82
83
|
}
|
|
83
84
|
)
|
|
84
85
|
] });
|
|
85
|
-
},
|
|
86
|
+
}, Je = {
|
|
86
87
|
allocations_cash: "#AEDCCC",
|
|
87
88
|
allocations_convertible: "#80CAD0",
|
|
88
89
|
allocations_foreign_bond: "#51B9D4",
|
|
@@ -92,7 +93,7 @@ const me = ({ sx: t = {} }) => {
|
|
|
92
93
|
allocations_unknown: "#161D6A",
|
|
93
94
|
allocations_us_bond: "#254995",
|
|
94
95
|
allocations_us_stock: "#1E2D84"
|
|
95
|
-
},
|
|
96
|
+
}, Ze = [
|
|
96
97
|
{
|
|
97
98
|
name: "allocations_cash"
|
|
98
99
|
},
|
|
@@ -120,122 +121,122 @@ const me = ({ sx: t = {} }) => {
|
|
|
120
121
|
{
|
|
121
122
|
name: "allocations_unknown"
|
|
122
123
|
}
|
|
123
|
-
],
|
|
124
|
-
const
|
|
125
|
-
return t >= Math.min(
|
|
126
|
-
},
|
|
127
|
-
const
|
|
124
|
+
], et = (t, h, c) => {
|
|
125
|
+
const m = h, v = c;
|
|
126
|
+
return t >= Math.min(m, v) && t < Math.max(m, v);
|
|
127
|
+
}, tt = (t, h, c) => {
|
|
128
|
+
const m = [
|
|
128
129
|
...new Set(t.map((d) => d.name.toLowerCase()))
|
|
129
130
|
];
|
|
130
|
-
let
|
|
131
|
-
return
|
|
132
|
-
const
|
|
133
|
-
const
|
|
134
|
-
return
|
|
131
|
+
let v;
|
|
132
|
+
return m.map((d) => {
|
|
133
|
+
const s = t.reduce((g, f) => {
|
|
134
|
+
const p = f.name;
|
|
135
|
+
return p.toLowerCase() === d ? (v = p, Y(f) * f[h] / 100 + g) : g;
|
|
135
136
|
}, 0);
|
|
136
137
|
return {
|
|
137
|
-
displayName:
|
|
138
|
-
name:
|
|
139
|
-
value:
|
|
140
|
-
percentage:
|
|
138
|
+
displayName: v,
|
|
139
|
+
name: v,
|
|
140
|
+
value: s,
|
|
141
|
+
percentage: s / c
|
|
141
142
|
};
|
|
142
143
|
});
|
|
143
|
-
}, Y = (t) => t.calculated_market_value ? t.calculated_market_value : t.market_value,
|
|
144
|
-
const
|
|
145
|
-
let
|
|
146
|
-
const d = t.map(({ guid: n }) => n),
|
|
144
|
+
}, Y = (t) => t.calculated_market_value ? t.calculated_market_value : t.market_value, nt = (t, h, c) => {
|
|
145
|
+
const m = Object.values(h.allocations_list), v = [];
|
|
146
|
+
let b = 0;
|
|
147
|
+
const d = t.map(({ guid: n }) => n), s = c.filter(({ account_guid: n }) => d.includes(n)).map((n) => ({
|
|
147
148
|
...n,
|
|
148
149
|
name: n.symbol || n.description,
|
|
149
150
|
gainLoss: n.cost_basis || n.cost_basis === 0 ? Y(n) - n.cost_basis : 0
|
|
150
|
-
})), { cashBalance:
|
|
151
|
-
(n,
|
|
152
|
-
cashBalance: n.cashBalance + (
|
|
153
|
-
totalAccountBalance: n.totalAccountBalance + (
|
|
151
|
+
})), { cashBalance: g, totalAccountBalance: f } = t.reduce(
|
|
152
|
+
(n, x) => ({
|
|
153
|
+
cashBalance: n.cashBalance + (x.cash_balance || 0),
|
|
154
|
+
totalAccountBalance: n.totalAccountBalance + (x.balance || 0)
|
|
154
155
|
}),
|
|
155
156
|
{ cashBalance: 0, totalAccountBalance: 0 }
|
|
156
|
-
), { marketValue:
|
|
157
|
-
(n,
|
|
158
|
-
marketValue: n.marketValue + Y(
|
|
159
|
-
totalGainLoss: n.totalGainLoss +
|
|
157
|
+
), { marketValue: p, totalGainLoss: l } = s.reduce(
|
|
158
|
+
(n, x) => ({
|
|
159
|
+
marketValue: n.marketValue + Y(x),
|
|
160
|
+
totalGainLoss: n.totalGainLoss + x.gainLoss
|
|
160
161
|
}),
|
|
161
162
|
{ marketValue: 0, totalGainLoss: 0 }
|
|
162
|
-
),
|
|
163
|
-
|
|
164
|
-
const
|
|
163
|
+
), u = p + g;
|
|
164
|
+
Ze.forEach((n, x) => {
|
|
165
|
+
const w = s.filter(
|
|
165
166
|
(I) => !!I[n.name]
|
|
166
167
|
);
|
|
167
|
-
let S =
|
|
168
|
+
let S = w.reduce(
|
|
168
169
|
(I, W) => I + Y(W) * W[n.name] / 100,
|
|
169
170
|
0
|
|
170
171
|
);
|
|
171
|
-
const B =
|
|
172
|
-
|
|
172
|
+
const B = tt(
|
|
173
|
+
w,
|
|
173
174
|
n.name,
|
|
174
175
|
S
|
|
175
176
|
);
|
|
176
|
-
if (n.name === "allocations_cash" &&
|
|
177
|
-
S +=
|
|
177
|
+
if (n.name === "allocations_cash" && g > 0) {
|
|
178
|
+
S += g;
|
|
178
179
|
const I = {
|
|
179
180
|
displayName: h.cash_balance_display_name,
|
|
180
181
|
name: "allocations_name",
|
|
181
|
-
value:
|
|
182
|
-
percentage:
|
|
182
|
+
value: g,
|
|
183
|
+
percentage: g / u
|
|
183
184
|
};
|
|
184
185
|
B.push(I);
|
|
185
186
|
}
|
|
186
|
-
S > 0 && (
|
|
187
|
+
S > 0 && (v.push({
|
|
187
188
|
name: n.name,
|
|
188
|
-
displayName:
|
|
189
|
-
guid: `${n.name}-${
|
|
189
|
+
displayName: m[x],
|
|
190
|
+
guid: `${n.name}-${x}`,
|
|
190
191
|
holdings: B,
|
|
191
|
-
percentage: S /
|
|
192
|
+
percentage: S / u,
|
|
192
193
|
value: S,
|
|
193
|
-
color:
|
|
194
|
-
}),
|
|
194
|
+
color: Je[n.name]
|
|
195
|
+
}), b += S);
|
|
195
196
|
});
|
|
196
|
-
const i =
|
|
197
|
-
({ displayName: n, guid:
|
|
198
|
-
id:
|
|
199
|
-
color:
|
|
197
|
+
const i = v.map(
|
|
198
|
+
({ displayName: n, guid: x, color: w, value: S }) => ({
|
|
199
|
+
id: x,
|
|
200
|
+
color: w,
|
|
200
201
|
label: n,
|
|
201
|
-
value: S /
|
|
202
|
+
value: S / b * 100
|
|
202
203
|
})
|
|
203
204
|
);
|
|
204
205
|
return {
|
|
205
|
-
investmentsData:
|
|
206
|
+
investmentsData: v,
|
|
206
207
|
donutData: i,
|
|
207
|
-
totalAmount:
|
|
208
|
-
totalGainLoss:
|
|
209
|
-
totalMarketValue:
|
|
210
|
-
totalGainLossPercentage:
|
|
208
|
+
totalAmount: b,
|
|
209
|
+
totalGainLoss: l,
|
|
210
|
+
totalMarketValue: u,
|
|
211
|
+
totalGainLossPercentage: l / f
|
|
211
212
|
};
|
|
212
|
-
}, ae = (t) => t < 1e-3 ? "< 0.1%" : je(t), R = (t) => t === 0 ? ie(t, "0,0.00") :
|
|
213
|
+
}, ae = (t) => t < 1e-3 ? "< 0.1%" : je(t), R = (t) => t === 0 ? ie(t, "0,0.00") : et(t, -0.01, 0.01) ? "< $0.01" : ie(t, "0,0.00"), ot = ({
|
|
213
214
|
data: t,
|
|
214
215
|
onSelected: h,
|
|
215
216
|
selectedId: c,
|
|
216
|
-
selectedTabs:
|
|
217
|
-
setSelectedTabs:
|
|
217
|
+
selectedTabs: m,
|
|
218
|
+
setSelectedTabs: v
|
|
218
219
|
}) => {
|
|
219
|
-
const
|
|
220
|
-
|
|
220
|
+
const b = (l, u) => {
|
|
221
|
+
u !== null && v(u);
|
|
221
222
|
}, { isMobile: d } = U(), {
|
|
222
|
-
investments: { allocation:
|
|
223
|
-
} =
|
|
224
|
-
{ label:
|
|
225
|
-
{ label:
|
|
226
|
-
],
|
|
223
|
+
investments: { allocation: s }
|
|
224
|
+
} = M(), g = [
|
|
225
|
+
{ label: s.tabs_label_dollar, value: 0 },
|
|
226
|
+
{ label: s.tabs_label_percent, value: 1 }
|
|
227
|
+
], f = !t?.investmentsData.length, { isSmallMobile: p } = U();
|
|
227
228
|
return /* @__PURE__ */ o(_, { sx: { mt: 15, gap: 12, width: d ? 250 : 412 }, children: [
|
|
228
229
|
/* @__PURE__ */ e(
|
|
229
230
|
fe,
|
|
230
231
|
{
|
|
231
232
|
exclusive: !0,
|
|
232
233
|
fullWidth: !0,
|
|
233
|
-
onChange:
|
|
234
|
-
value:
|
|
235
|
-
children:
|
|
234
|
+
onChange: b,
|
|
235
|
+
value: f ? -1 : m,
|
|
236
|
+
children: g.map(({ label: l, value: u }) => /* @__PURE__ */ e(ye, { color: "primary", value: u, children: /* @__PURE__ */ e(r, { bold: !0, textTransform: "capitalize", variant: "Body", children: l }) }, l))
|
|
236
237
|
}
|
|
237
238
|
),
|
|
238
|
-
/* @__PURE__ */ e(te, { sx: { px: 12 }, children: t.investmentsData.map((
|
|
239
|
+
/* @__PURE__ */ e(te, { sx: { px: 12 }, children: t.investmentsData.map((l) => /* @__PURE__ */ o(A.Fragment, { children: [
|
|
239
240
|
/* @__PURE__ */ e(
|
|
240
241
|
ne,
|
|
241
242
|
{
|
|
@@ -245,10 +246,10 @@ const me = ({ sx: t = {} }) => {
|
|
|
245
246
|
minHeight: 44
|
|
246
247
|
},
|
|
247
248
|
children: /* @__PURE__ */ o(
|
|
248
|
-
|
|
249
|
+
Ge,
|
|
249
250
|
{
|
|
250
|
-
"aria-expanded": c ===
|
|
251
|
-
onClick: () => h(
|
|
251
|
+
"aria-expanded": c === l.guid,
|
|
252
|
+
onClick: () => h(l.guid),
|
|
252
253
|
sx: { minHeight: 44, px: 12, py: 0 },
|
|
253
254
|
children: [
|
|
254
255
|
/* @__PURE__ */ e(
|
|
@@ -257,7 +258,7 @@ const me = ({ sx: t = {} }) => {
|
|
|
257
258
|
borderRadius: 4,
|
|
258
259
|
flexShrink: 0,
|
|
259
260
|
height: 8,
|
|
260
|
-
sx: { backgroundColor:
|
|
261
|
+
sx: { backgroundColor: l.color, mr: 8 },
|
|
261
262
|
width: 8
|
|
262
263
|
}
|
|
263
264
|
),
|
|
@@ -269,8 +270,8 @@ const me = ({ sx: t = {} }) => {
|
|
|
269
270
|
justifyContent: "space-between",
|
|
270
271
|
width: "100%",
|
|
271
272
|
children: [
|
|
272
|
-
/* @__PURE__ */ e(r, { bold: c ===
|
|
273
|
-
/* @__PURE__ */ e(r, { bold: c ===
|
|
273
|
+
/* @__PURE__ */ e(r, { bold: c === l.guid, children: l.displayName }),
|
|
274
|
+
/* @__PURE__ */ e(r, { bold: c === l.guid, variant: "Body", children: m === 0 ? R(l.value) : ae(l.percentage) })
|
|
274
275
|
]
|
|
275
276
|
}
|
|
276
277
|
)
|
|
@@ -280,8 +281,8 @@ const me = ({ sx: t = {} }) => {
|
|
|
280
281
|
}
|
|
281
282
|
),
|
|
282
283
|
/* @__PURE__ */ e(K, {}),
|
|
283
|
-
|
|
284
|
-
|
|
284
|
+
l.holdings && l.holdings.length > 0 && /* @__PURE__ */ e(Me, { in: c === l.guid, unmountOnExit: !0, children: /* @__PURE__ */ o(te, { children: [
|
|
285
|
+
l?.holdings?.map((u) => /* @__PURE__ */ e(
|
|
285
286
|
ne,
|
|
286
287
|
{
|
|
287
288
|
sx: {
|
|
@@ -291,62 +292,62 @@ const me = ({ sx: t = {} }) => {
|
|
|
291
292
|
},
|
|
292
293
|
children: /* @__PURE__ */ o(_, { direction: "row", justifyContent: "space-between", width: "100%", children: [
|
|
293
294
|
/* @__PURE__ */ o(r, { children: [
|
|
294
|
-
|
|
295
|
+
u.displayName,
|
|
295
296
|
" "
|
|
296
297
|
] }),
|
|
297
|
-
/* @__PURE__ */ e(r, { children:
|
|
298
|
+
/* @__PURE__ */ e(r, { children: m === 0 ? R(u.value) : ae(u.percentage) })
|
|
298
299
|
] })
|
|
299
300
|
},
|
|
300
|
-
|
|
301
|
+
u.displayName
|
|
301
302
|
)),
|
|
302
303
|
/* @__PURE__ */ e(K, {})
|
|
303
304
|
] }) })
|
|
304
|
-
] },
|
|
305
|
-
|
|
306
|
-
/* @__PURE__ */ e(r, { sx: { color: "secondary.main", p: 8, textAlign: "center" }, children:
|
|
305
|
+
] }, l.guid)) }),
|
|
306
|
+
f ? /* @__PURE__ */ o(se, { children: [
|
|
307
|
+
/* @__PURE__ */ e(r, { sx: { color: "secondary.main", p: 8, textAlign: "center" }, children: s.empty_data }),
|
|
307
308
|
/* @__PURE__ */ e(K, { sx: { borderColor: "border.light" } }),
|
|
308
309
|
/* @__PURE__ */ e(
|
|
309
310
|
me,
|
|
310
311
|
{
|
|
311
312
|
sx: {
|
|
312
|
-
".inner-container": { width:
|
|
313
|
+
".inner-container": { width: p ? "100%" : 364 }
|
|
313
314
|
}
|
|
314
315
|
}
|
|
315
316
|
)
|
|
316
|
-
] }) :
|
|
317
|
+
] }) : m === 0 && /* @__PURE__ */ e(r, { bold: !0, sx: { textAlign: "right", pr: 24 }, children: `${s.total_label_text} ${R(t.totalAmount)}` })
|
|
317
318
|
] });
|
|
318
|
-
},
|
|
319
|
+
}, it = ({
|
|
319
320
|
data: t,
|
|
320
321
|
hoveredId: h,
|
|
321
322
|
isPercentage: c,
|
|
322
|
-
onMouseEnter:
|
|
323
|
-
onMouseLeave:
|
|
324
|
-
onSelected:
|
|
323
|
+
onMouseEnter: m,
|
|
324
|
+
onMouseLeave: v,
|
|
325
|
+
onSelected: b,
|
|
325
326
|
selectedId: d,
|
|
326
|
-
size:
|
|
327
|
-
totalLabel:
|
|
327
|
+
size: s = 150,
|
|
328
|
+
totalLabel: g
|
|
328
329
|
}) => {
|
|
329
|
-
const
|
|
330
|
+
const f = ce(), p = f.palette.mode === "dark", l = A.useMemo(
|
|
330
331
|
() => d ? t.investmentsData.find(({ guid: B }) => B === d) : void 0,
|
|
331
332
|
[d]
|
|
332
333
|
), {
|
|
333
|
-
investments: { allocation:
|
|
334
|
-
} =
|
|
334
|
+
investments: { allocation: u }
|
|
335
|
+
} = M(), i = A.useMemo(() => t.donutData.length > 0 ? t.donutData : [{ id: "0", color: f.palette.border.light, value: 100 }], [t, f]), n = p ? "#0AC295" : "#09A57F", x = p ? "grey.300" : "grey.700", w = () => l ? u.pie_chart_centered_click_for_details : c ? ae(t.totalGainLossPercentage) : R(t.totalGainLoss), S = t.totalGainLoss >= 0 ? n : x;
|
|
335
336
|
return /* @__PURE__ */ e(
|
|
336
337
|
ze,
|
|
337
338
|
{
|
|
338
339
|
data: i,
|
|
339
340
|
hoveredId: h,
|
|
340
|
-
onClick:
|
|
341
|
-
onMouseEnter:
|
|
342
|
-
onMouseLeave:
|
|
341
|
+
onClick: b,
|
|
342
|
+
onMouseEnter: m,
|
|
343
|
+
onMouseLeave: v,
|
|
343
344
|
selectedId: d,
|
|
344
|
-
size:
|
|
345
|
-
children: /* @__PURE__ */ e(_, { alignItems: "center", height: "100%", justifyContent: "center", width: "100%", children: /* @__PURE__ */ e(_, { alignItems: "center", justifyContent: "center", minHeight:
|
|
346
|
-
/* @__PURE__ */ e(r, { color: "text.secondary", noWrap: !0, children:
|
|
347
|
-
/* @__PURE__ */ e(J, { color: "text.primary", variant: "H1", children: R(
|
|
345
|
+
size: s,
|
|
346
|
+
children: /* @__PURE__ */ e(_, { alignItems: "center", height: "100%", justifyContent: "center", width: "100%", children: /* @__PURE__ */ e(_, { alignItems: "center", justifyContent: "center", minHeight: s, minWidth: s, children: /* @__PURE__ */ o(_, { alignItems: "center", sx: { gap: { xs: 4, xl: 8 }, mb: { xs: 4, xl: 8 } }, children: [
|
|
347
|
+
/* @__PURE__ */ e(r, { color: "text.secondary", noWrap: !0, children: l?.displayName ?? g }),
|
|
348
|
+
/* @__PURE__ */ e(J, { color: "text.primary", variant: "H1", children: R(l?.value ?? t.totalMarketValue) }),
|
|
348
349
|
/* @__PURE__ */ o(_, { sx: { alignItems: "center", flexDirection: "row", gap: 4 }, children: [
|
|
349
|
-
!
|
|
350
|
+
!l && /* @__PURE__ */ e(
|
|
350
351
|
k,
|
|
351
352
|
{
|
|
352
353
|
name: t.totalGainLoss >= 0 ? "trending_up" : "trending_down",
|
|
@@ -362,23 +363,23 @@ const me = ({ sx: t = {} }) => {
|
|
|
362
363
|
fontWeight: 700
|
|
363
364
|
},
|
|
364
365
|
variant: "Small",
|
|
365
|
-
children:
|
|
366
|
+
children: w()
|
|
366
367
|
}
|
|
367
368
|
)
|
|
368
369
|
] })
|
|
369
370
|
] }) }) })
|
|
370
371
|
}
|
|
371
372
|
);
|
|
372
|
-
},
|
|
373
|
-
const [t, h] = A.useState(0), [c,
|
|
374
|
-
c !== n ?
|
|
375
|
-
}, { selectedAccountGuids:
|
|
376
|
-
investments: { allocation:
|
|
377
|
-
} =
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
), { isMobile:
|
|
373
|
+
}, rt = () => {
|
|
374
|
+
const [t, h] = A.useState(0), [c, m] = A.useState(""), [v, b] = A.useState(""), d = (n) => {
|
|
375
|
+
c !== n ? m(n) : (m(""), b(""));
|
|
376
|
+
}, { selectedAccountGuids: s } = Q(), { visibleHoldings: g } = H(), { visibleInvestmentAccounts: f } = le(), {
|
|
377
|
+
investments: { allocation: p }
|
|
378
|
+
} = M(), l = nt(
|
|
379
|
+
f.filter(({ guid: n }) => s.includes(n)),
|
|
380
|
+
p,
|
|
381
|
+
g
|
|
382
|
+
), { isMobile: u } = U(), i = xe("(max-width:768px)");
|
|
382
383
|
return /* @__PURE__ */ o(
|
|
383
384
|
_,
|
|
384
385
|
{
|
|
@@ -392,27 +393,27 @@ const me = ({ sx: t = {} }) => {
|
|
|
392
393
|
},
|
|
393
394
|
children: [
|
|
394
395
|
/* @__PURE__ */ e(
|
|
395
|
-
|
|
396
|
+
it,
|
|
396
397
|
{
|
|
397
|
-
data:
|
|
398
|
-
hoveredId:
|
|
398
|
+
data: l,
|
|
399
|
+
hoveredId: v,
|
|
399
400
|
isPercentage: t === 1,
|
|
400
401
|
onMouseEnter: (n) => {
|
|
401
|
-
c === n ?
|
|
402
|
+
c === n ? b("") : c || b(n);
|
|
402
403
|
},
|
|
403
404
|
onMouseLeave: () => {
|
|
404
|
-
|
|
405
|
+
b("");
|
|
405
406
|
},
|
|
406
407
|
onSelected: d,
|
|
407
408
|
selectedId: c,
|
|
408
|
-
size:
|
|
409
|
-
totalLabel:
|
|
409
|
+
size: u ? 280 : 400,
|
|
410
|
+
totalLabel: p.pie_chart_centered_text
|
|
410
411
|
}
|
|
411
412
|
),
|
|
412
413
|
/* @__PURE__ */ e(
|
|
413
|
-
|
|
414
|
+
ot,
|
|
414
415
|
{
|
|
415
|
-
data:
|
|
416
|
+
data: l,
|
|
416
417
|
onSelected: d,
|
|
417
418
|
selectedId: c,
|
|
418
419
|
selectedTabs: t,
|
|
@@ -422,16 +423,16 @@ const me = ({ sx: t = {} }) => {
|
|
|
422
423
|
]
|
|
423
424
|
}
|
|
424
425
|
);
|
|
425
|
-
},
|
|
426
|
+
}, at = P(rt), st = ({
|
|
426
427
|
analysisDetails: t,
|
|
427
428
|
analysisType: h,
|
|
428
429
|
copy: c,
|
|
429
|
-
setAnalysisType:
|
|
430
|
+
setAnalysisType: m
|
|
430
431
|
}) => {
|
|
431
|
-
const { isSmallMobile:
|
|
432
|
-
key:
|
|
433
|
-
value: ie(t[
|
|
434
|
-
formattedKey: Ve(
|
|
432
|
+
const { isSmallMobile: v } = U(), b = A.useMemo(() => Object.keys(t).filter((s) => t[s] >= 1).map((s) => ({
|
|
433
|
+
key: s,
|
|
434
|
+
value: ie(t[s], "0,0"),
|
|
435
|
+
formattedKey: Ve(s)
|
|
435
436
|
})), [t]), d = [
|
|
436
437
|
{ label: c.equities, value: V.Stocks },
|
|
437
438
|
{ label: c.bonds, value: V.Bonds }
|
|
@@ -442,7 +443,7 @@ const me = ({ sx: t = {} }) => {
|
|
|
442
443
|
{
|
|
443
444
|
color: "primary",
|
|
444
445
|
exclusive: !0,
|
|
445
|
-
onChange: (
|
|
446
|
+
onChange: (s, g) => g && m(g),
|
|
446
447
|
sx: {
|
|
447
448
|
width: "100%",
|
|
448
449
|
"& .MuiToggleButton-root": {
|
|
@@ -451,11 +452,11 @@ const me = ({ sx: t = {} }) => {
|
|
|
451
452
|
textTransform: "capitalize"
|
|
452
453
|
}
|
|
453
454
|
},
|
|
454
|
-
value:
|
|
455
|
-
children: d.map(({ label:
|
|
455
|
+
value: b.length ? h : -1,
|
|
456
|
+
children: d.map(({ label: s, value: g }) => /* @__PURE__ */ e(ye, { sx: { width: "100%" }, value: g, children: s }, g))
|
|
456
457
|
}
|
|
457
458
|
),
|
|
458
|
-
|
|
459
|
+
b.length ? /* @__PURE__ */ e(
|
|
459
460
|
te,
|
|
460
461
|
{
|
|
461
462
|
sx: {
|
|
@@ -463,13 +464,13 @@ const me = ({ sx: t = {} }) => {
|
|
|
463
464
|
"& .MuiListItem-divider": { borderColor: "border.light" },
|
|
464
465
|
"& .MuiListItem-root": { minHeight: 44, px: 12 }
|
|
465
466
|
},
|
|
466
|
-
children:
|
|
467
|
+
children: b.map(({ value: s, formattedKey: g }) => /* @__PURE__ */ e(ne, { divider: !0, secondaryAction: /* @__PURE__ */ e(r, { children: s }), children: /* @__PURE__ */ e(
|
|
467
468
|
Re,
|
|
468
469
|
{
|
|
469
|
-
primary:
|
|
470
|
+
primary: g,
|
|
470
471
|
primaryTypographyProps: { fontStyle: "normal" }
|
|
471
472
|
}
|
|
472
|
-
) },
|
|
473
|
+
) }, g))
|
|
473
474
|
}
|
|
474
475
|
) : /* @__PURE__ */ o(se, { children: [
|
|
475
476
|
/* @__PURE__ */ e(r, { sx: { color: "secondary.main", p: 8, textAlign: "center" }, children: c.empty_data }),
|
|
@@ -478,16 +479,16 @@ const me = ({ sx: t = {} }) => {
|
|
|
478
479
|
me,
|
|
479
480
|
{
|
|
480
481
|
sx: {
|
|
481
|
-
".inner-container": { width:
|
|
482
|
+
".inner-container": { width: v ? "100%" : 364 }
|
|
482
483
|
}
|
|
483
484
|
}
|
|
484
485
|
)
|
|
485
486
|
] })
|
|
486
487
|
] });
|
|
487
|
-
},
|
|
488
|
+
}, lt = ({ body: t, title: h }) => /* @__PURE__ */ o(_, { sx: { gap: 4, p: 12 }, children: [
|
|
488
489
|
/* @__PURE__ */ e(r, { bold: !0, variant: "Body", children: h }),
|
|
489
490
|
/* @__PURE__ */ e(J, { variant: "ParagraphSmall", children: t })
|
|
490
|
-
] }),
|
|
491
|
+
] }), ct = ({
|
|
491
492
|
placement: t = "bottom",
|
|
492
493
|
tooltip_info_body: h,
|
|
493
494
|
tooltip_info_title: c
|
|
@@ -496,16 +497,16 @@ const me = ({ sx: t = {} }) => {
|
|
|
496
497
|
{
|
|
497
498
|
enterTouchDelay: 500,
|
|
498
499
|
placement: t,
|
|
499
|
-
title: /* @__PURE__ */ e(
|
|
500
|
+
title: /* @__PURE__ */ e(lt, { body: h, title: c }),
|
|
500
501
|
children: /* @__PURE__ */ e(de, { "aria-label": c, sx: { minHeight: 0, minWidth: 0, p: 0 }, children: /* @__PURE__ */ e(k, { name: "info", sx: { color: "info.main" } }) })
|
|
501
502
|
}
|
|
502
|
-
),
|
|
503
|
+
), dt = () => {
|
|
503
504
|
const {
|
|
504
505
|
investments: { analysis: t }
|
|
505
|
-
} =
|
|
506
|
-
const i =
|
|
507
|
-
return { cellDimension: d ? 72 : 100, columns: n, rows:
|
|
508
|
-
}, [t, d,
|
|
506
|
+
} = M(), { analysisChartData: h, analysisDetails: c, analysisType: m, setAnalysisType: v } = H(), b = xe("(min-width:320px) and (max-width:375px)"), { isMobile: d } = U(), g = Oe().palette.mode === "dark", { cellDimension: f, columns: p, rows: l, textVariant: u } = A.useMemo(() => {
|
|
507
|
+
const i = m === V.Stocks, n = Object.values(i ? t.stock_column_labels : t.bond_column_labels), x = Object.values(i ? t.stock_row_labels : t.bond_row_labels);
|
|
508
|
+
return { cellDimension: d ? 72 : 100, columns: n, rows: x, textVariant: d ? "XSmall" : "Body" };
|
|
509
|
+
}, [t, d, m]);
|
|
509
510
|
return /* @__PURE__ */ o(
|
|
510
511
|
_,
|
|
511
512
|
{
|
|
@@ -539,7 +540,7 @@ const me = ({ sx: t = {} }) => {
|
|
|
539
540
|
writingMode: "vertical-rl"
|
|
540
541
|
},
|
|
541
542
|
children: [
|
|
542
|
-
/* @__PURE__ */ e(J, { bold: !0, color: "secondary.main", variant:
|
|
543
|
+
/* @__PURE__ */ e(J, { bold: !0, color: "secondary.main", variant: u, children: m === V.Stocks ? t.market_capitalization : t.credit_quality }),
|
|
543
544
|
/* @__PURE__ */ e(
|
|
544
545
|
_,
|
|
545
546
|
{
|
|
@@ -548,7 +549,7 @@ const me = ({ sx: t = {} }) => {
|
|
|
548
549
|
height: d ? 224 : 308,
|
|
549
550
|
justifyContent: "space-around"
|
|
550
551
|
},
|
|
551
|
-
children:
|
|
552
|
+
children: p.map((i) => /* @__PURE__ */ e(
|
|
552
553
|
r,
|
|
553
554
|
{
|
|
554
555
|
sx: {
|
|
@@ -556,7 +557,7 @@ const me = ({ sx: t = {} }) => {
|
|
|
556
557
|
pl: 12,
|
|
557
558
|
pr: d ? 4 : 0
|
|
558
559
|
},
|
|
559
|
-
variant:
|
|
560
|
+
variant: u,
|
|
560
561
|
children: i
|
|
561
562
|
},
|
|
562
563
|
i
|
|
@@ -571,7 +572,7 @@ const me = ({ sx: t = {} }) => {
|
|
|
571
572
|
_,
|
|
572
573
|
{
|
|
573
574
|
sx: {
|
|
574
|
-
alignSelf:
|
|
575
|
+
alignSelf: b ? "start" : "center",
|
|
575
576
|
flexDirection: "row",
|
|
576
577
|
gap: 8,
|
|
577
578
|
pb: 12
|
|
@@ -579,7 +580,7 @@ const me = ({ sx: t = {} }) => {
|
|
|
579
580
|
children: [
|
|
580
581
|
/* @__PURE__ */ e(r, { bold: !0, children: t.invest_analysis }),
|
|
581
582
|
/* @__PURE__ */ e(
|
|
582
|
-
|
|
583
|
+
ct,
|
|
583
584
|
{
|
|
584
585
|
tooltip_info_body: t.tooltip_info_body,
|
|
585
586
|
tooltip_info_title: t.tooltip_info_title
|
|
@@ -588,10 +589,10 @@ const me = ({ sx: t = {} }) => {
|
|
|
588
589
|
]
|
|
589
590
|
}
|
|
590
591
|
),
|
|
591
|
-
h.map((i, n,
|
|
592
|
-
const B = n === 0, I = n ===
|
|
592
|
+
h.map((i, n, x) => /* @__PURE__ */ e(_, { sx: { flexDirection: "row", gap: 4 }, children: i.map((w, S) => {
|
|
593
|
+
const B = n === 0, I = n === x.length - 1, W = S === 0, N = S === i.length - 1, F = Number(w.replace("%", "")) >= 25;
|
|
593
594
|
let T = "grey.200", j = "grey.900";
|
|
594
|
-
return
|
|
595
|
+
return g ? (T = F ? "grey.200" : "grey.700", j = F ? "grey.900" : "common.white") : (T = F ? "grey.700" : "grey.200", j = F ? "common.white" : "grey.900"), /* @__PURE__ */ e(
|
|
595
596
|
_,
|
|
596
597
|
{
|
|
597
598
|
sx: {
|
|
@@ -603,9 +604,9 @@ const me = ({ sx: t = {} }) => {
|
|
|
603
604
|
},
|
|
604
605
|
alignItems: "center",
|
|
605
606
|
bgcolor: T,
|
|
606
|
-
height:
|
|
607
|
+
height: f,
|
|
607
608
|
justifyContent: "center",
|
|
608
|
-
width:
|
|
609
|
+
width: f
|
|
609
610
|
},
|
|
610
611
|
children: /* @__PURE__ */ e(
|
|
611
612
|
r,
|
|
@@ -615,21 +616,21 @@ const me = ({ sx: t = {} }) => {
|
|
|
615
616
|
fontWeight: d ? 600 : 700
|
|
616
617
|
},
|
|
617
618
|
variant: d ? "Body" : "H3",
|
|
618
|
-
children:
|
|
619
|
+
children: w
|
|
619
620
|
}
|
|
620
621
|
)
|
|
621
622
|
},
|
|
622
623
|
S
|
|
623
624
|
);
|
|
624
625
|
}) }, n)),
|
|
625
|
-
/* @__PURE__ */ e(_, { sx: { alignSelf: "center", flexDirection: "row", pt: 12 }, children:
|
|
626
|
+
/* @__PURE__ */ e(_, { sx: { alignSelf: "center", flexDirection: "row", pt: 12 }, children: l.map((i) => /* @__PURE__ */ e(_, { sx: { alignItems: "center", width: f }, children: /* @__PURE__ */ e(r, { color: "secondary.main", variant: u, children: i }) }, i)) }),
|
|
626
627
|
/* @__PURE__ */ e(
|
|
627
628
|
r,
|
|
628
629
|
{
|
|
629
630
|
bold: !0,
|
|
630
631
|
sx: { color: "secondary.main", pt: d ? 4 : 24, textAlign: "center" },
|
|
631
|
-
variant:
|
|
632
|
-
children:
|
|
632
|
+
variant: u,
|
|
633
|
+
children: m === V.Stocks ? t.valuation : t.duration
|
|
633
634
|
}
|
|
634
635
|
)
|
|
635
636
|
] })
|
|
@@ -637,47 +638,47 @@ const me = ({ sx: t = {} }) => {
|
|
|
637
638
|
}
|
|
638
639
|
),
|
|
639
640
|
/* @__PURE__ */ e(
|
|
640
|
-
|
|
641
|
+
st,
|
|
641
642
|
{
|
|
642
643
|
analysisDetails: c,
|
|
643
|
-
analysisType:
|
|
644
|
+
analysisType: m,
|
|
644
645
|
copy: {
|
|
645
646
|
empty_data: t.empty_data,
|
|
646
647
|
equities: t.equities,
|
|
647
648
|
bonds: t.bonds
|
|
648
649
|
},
|
|
649
|
-
setAnalysisType:
|
|
650
|
+
setAnalysisType: v
|
|
650
651
|
}
|
|
651
652
|
)
|
|
652
653
|
]
|
|
653
654
|
}
|
|
654
655
|
);
|
|
655
|
-
},
|
|
656
|
+
}, mt = P(dt), ut = ({
|
|
656
657
|
accountHoldingsData: t,
|
|
657
658
|
currentEditedCostBasis: h,
|
|
658
659
|
editingHoldingId: c,
|
|
659
|
-
handleCostBasisBlur:
|
|
660
|
-
handleCostBasisClick:
|
|
661
|
-
handleCostBasisChange:
|
|
660
|
+
handleCostBasisBlur: m,
|
|
661
|
+
handleCostBasisClick: v,
|
|
662
|
+
handleCostBasisChange: b,
|
|
662
663
|
handleCostBasisKeyDown: d,
|
|
663
|
-
isOpen:
|
|
664
|
-
onClose:
|
|
664
|
+
isOpen: s,
|
|
665
|
+
onClose: g
|
|
665
666
|
}) => {
|
|
666
|
-
const { investments:
|
|
667
|
-
|
|
668
|
-
...
|
|
669
|
-
[i]:
|
|
667
|
+
const { investments: f } = M(), [p, l] = A.useState({}), u = (i) => (n, x) => {
|
|
668
|
+
l((w) => ({
|
|
669
|
+
...w,
|
|
670
|
+
[i]: x
|
|
670
671
|
}));
|
|
671
672
|
};
|
|
672
673
|
return /* @__PURE__ */ o(
|
|
673
674
|
Xe,
|
|
674
675
|
{
|
|
675
|
-
ariaLabelClose:
|
|
676
|
-
isOpen:
|
|
677
|
-
onClose:
|
|
678
|
-
title:
|
|
676
|
+
ariaLabelClose: f.overview.close_investment_drawer,
|
|
677
|
+
isOpen: s,
|
|
678
|
+
onClose: g,
|
|
679
|
+
title: f.overview.investment_details,
|
|
679
680
|
children: [
|
|
680
|
-
/* @__PURE__ */ o(
|
|
681
|
+
/* @__PURE__ */ o(y, { sx: { gap: 8, p: 24 }, children: [
|
|
681
682
|
/* @__PURE__ */ e(
|
|
682
683
|
oe,
|
|
683
684
|
{
|
|
@@ -688,8 +689,8 @@ const me = ({ sx: t = {} }) => {
|
|
|
688
689
|
),
|
|
689
690
|
/* @__PURE__ */ e(r, { sx: { color: "text.primary" }, variant: "Small", children: t.accounts.memberName }),
|
|
690
691
|
/* @__PURE__ */ e(r, { sx: { color: "text.primary" }, variant: "H2", children: t.accounts.user_name || t.accounts.name }),
|
|
691
|
-
/* @__PURE__ */ o(
|
|
692
|
-
/* @__PURE__ */ e(r, { sx: { color: "text.primary", fontWeight: 600 }, variant: "Body", children:
|
|
692
|
+
/* @__PURE__ */ o(y, { sx: { alignItems: "center", flexDirection: "row", justifyContent: "space-between" }, children: [
|
|
693
|
+
/* @__PURE__ */ e(r, { sx: { color: "text.primary", fontWeight: 600 }, variant: "Body", children: f.overview.current_balance }),
|
|
693
694
|
/* @__PURE__ */ e(r, { sx: { color: "text.primary", fontWeight: 600 }, variant: "Body", children: t.accounts.balance?.toLocaleString("en-US", {
|
|
694
695
|
currency: "USD",
|
|
695
696
|
maximumFractionDigits: 2,
|
|
@@ -699,7 +700,7 @@ const me = ({ sx: t = {} }) => {
|
|
|
699
700
|
] })
|
|
700
701
|
] }),
|
|
701
702
|
/* @__PURE__ */ o(
|
|
702
|
-
|
|
703
|
+
y,
|
|
703
704
|
{
|
|
704
705
|
sx: {
|
|
705
706
|
bgcolor: "background.default",
|
|
@@ -709,19 +710,19 @@ const me = ({ sx: t = {} }) => {
|
|
|
709
710
|
py: 10
|
|
710
711
|
},
|
|
711
712
|
children: [
|
|
712
|
-
/* @__PURE__ */ e(r, { sx: { color: "text.primary", fontWeight: 700 }, variant: "XSmall", children:
|
|
713
|
-
/* @__PURE__ */ e(r, { sx: { color: "text.primary", fontWeight: 700 }, variant: "XSmall", children:
|
|
713
|
+
/* @__PURE__ */ e(r, { sx: { color: "text.primary", fontWeight: 700 }, variant: "XSmall", children: f.overview.holding }),
|
|
714
|
+
/* @__PURE__ */ e(r, { sx: { color: "text.primary", fontWeight: 700 }, variant: "XSmall", children: f.overview.market_value })
|
|
714
715
|
]
|
|
715
716
|
}
|
|
716
717
|
),
|
|
717
718
|
t.holdings?.map((i, n) => {
|
|
718
|
-
const
|
|
719
|
+
const x = c === i.id;
|
|
719
720
|
return /* @__PURE__ */ o(
|
|
720
721
|
be,
|
|
721
722
|
{
|
|
722
723
|
disableGutters: !0,
|
|
723
|
-
expanded:
|
|
724
|
-
onChange: i ?
|
|
724
|
+
expanded: p[i.id] === !0,
|
|
725
|
+
onChange: i ? u(i?.id) : () => {
|
|
725
726
|
},
|
|
726
727
|
sx: {
|
|
727
728
|
":before": n === 0 ? { opacity: 0 } : {},
|
|
@@ -735,15 +736,15 @@ const me = ({ sx: t = {} }) => {
|
|
|
735
736
|
id: "panel1a-header",
|
|
736
737
|
sx: [
|
|
737
738
|
{ height: 64 },
|
|
738
|
-
|
|
739
|
+
p[i.id] && n > 0 && {
|
|
739
740
|
borderTop: 1,
|
|
740
741
|
borderColor: "border.main"
|
|
741
742
|
}
|
|
742
743
|
],
|
|
743
|
-
children: /* @__PURE__ */ o(
|
|
744
|
+
children: /* @__PURE__ */ o(y, { sx: { flexDirection: "row", width: "100%" }, children: [
|
|
744
745
|
/* @__PURE__ */ e("div", { style: { width: 24 } }),
|
|
745
746
|
/* @__PURE__ */ o(
|
|
746
|
-
|
|
747
|
+
y,
|
|
747
748
|
{
|
|
748
749
|
sx: [
|
|
749
750
|
{
|
|
@@ -754,28 +755,28 @@ const me = ({ sx: t = {} }) => {
|
|
|
754
755
|
py: 14,
|
|
755
756
|
width: "100%"
|
|
756
757
|
},
|
|
757
|
-
|
|
758
|
+
p[i.id] && {
|
|
758
759
|
borderBottom: 1,
|
|
759
760
|
borderColor: "border.main"
|
|
760
761
|
}
|
|
761
762
|
],
|
|
762
763
|
children: [
|
|
763
764
|
/* @__PURE__ */ e(
|
|
764
|
-
|
|
765
|
+
y,
|
|
765
766
|
{
|
|
766
767
|
sx: {
|
|
767
768
|
alignItems: "center",
|
|
768
769
|
flexDirection: "row",
|
|
769
770
|
gap: 12
|
|
770
771
|
},
|
|
771
|
-
children: /* @__PURE__ */ o(
|
|
772
|
+
children: /* @__PURE__ */ o(y, { sx: { overflow: "hidden", width: 98 }, children: [
|
|
772
773
|
/* @__PURE__ */ e(r, { sx: { fontWeight: 600 }, variant: "Body", children: i.holding }),
|
|
773
774
|
/* @__PURE__ */ e(r, { variant: "XSmall", children: i.description })
|
|
774
775
|
] })
|
|
775
776
|
}
|
|
776
777
|
),
|
|
777
778
|
/* @__PURE__ */ o(
|
|
778
|
-
|
|
779
|
+
y,
|
|
779
780
|
{
|
|
780
781
|
sx: {
|
|
781
782
|
alignItems: "center",
|
|
@@ -785,14 +786,14 @@ const me = ({ sx: t = {} }) => {
|
|
|
785
786
|
justifyContent: "flex-end"
|
|
786
787
|
},
|
|
787
788
|
children: [
|
|
788
|
-
/* @__PURE__ */ o(
|
|
789
|
+
/* @__PURE__ */ o(y, { children: [
|
|
789
790
|
/* @__PURE__ */ e(r, { sx: { fontWeight: 600, textAlign: "right" }, variant: "Body", children: i.marketValue?.toLocaleString("en-US", {
|
|
790
791
|
currency: "USD",
|
|
791
792
|
maximumFractionDigits: 2,
|
|
792
793
|
minimumFractionDigits: 2,
|
|
793
794
|
style: "currency"
|
|
794
795
|
}) }),
|
|
795
|
-
/* @__PURE__ */ o(
|
|
796
|
+
/* @__PURE__ */ o(y, { sx: { alignItems: "center", gap: 2, flexDirection: "row" }, children: [
|
|
796
797
|
i.totalGainLoss !== 0 && /* @__PURE__ */ e(
|
|
797
798
|
k,
|
|
798
799
|
{
|
|
@@ -838,7 +839,7 @@ const me = ({ sx: t = {} }) => {
|
|
|
838
839
|
/* @__PURE__ */ e(
|
|
839
840
|
k,
|
|
840
841
|
{
|
|
841
|
-
name:
|
|
842
|
+
name: p[i.id] ? "expand_less" : "expand_more",
|
|
842
843
|
size: 20
|
|
843
844
|
}
|
|
844
845
|
)
|
|
@@ -852,7 +853,7 @@ const me = ({ sx: t = {} }) => {
|
|
|
852
853
|
}
|
|
853
854
|
),
|
|
854
855
|
/* @__PURE__ */ e(_e, { children: /* @__PURE__ */ o(
|
|
855
|
-
|
|
856
|
+
y,
|
|
856
857
|
{
|
|
857
858
|
sx: {
|
|
858
859
|
alignItems: "center",
|
|
@@ -861,10 +862,10 @@ const me = ({ sx: t = {} }) => {
|
|
|
861
862
|
pl: 24
|
|
862
863
|
},
|
|
863
864
|
children: [
|
|
864
|
-
/* @__PURE__ */ e(
|
|
865
|
-
/* @__PURE__ */ o(
|
|
865
|
+
/* @__PURE__ */ e(y, { sx: { width: 32 } }),
|
|
866
|
+
/* @__PURE__ */ o(y, { sx: { flex: 1 }, children: [
|
|
866
867
|
/* @__PURE__ */ o(
|
|
867
|
-
|
|
868
|
+
y,
|
|
868
869
|
{
|
|
869
870
|
sx: {
|
|
870
871
|
alignItems: "center",
|
|
@@ -876,13 +877,13 @@ const me = ({ sx: t = {} }) => {
|
|
|
876
877
|
pr: 24
|
|
877
878
|
},
|
|
878
879
|
children: [
|
|
879
|
-
/* @__PURE__ */ e(r, { sx: { color: "text.primary" }, variant: "Body", children:
|
|
880
|
+
/* @__PURE__ */ e(r, { sx: { color: "text.primary" }, variant: "Body", children: f.overview.quantity }),
|
|
880
881
|
/* @__PURE__ */ e(r, { sx: { color: "text.primary" }, variant: "Small", children: i.qty })
|
|
881
882
|
]
|
|
882
883
|
}
|
|
883
884
|
),
|
|
884
885
|
/* @__PURE__ */ o(
|
|
885
|
-
|
|
886
|
+
y,
|
|
886
887
|
{
|
|
887
888
|
sx: {
|
|
888
889
|
alignItems: "center",
|
|
@@ -892,9 +893,9 @@ const me = ({ sx: t = {} }) => {
|
|
|
892
893
|
pr: 24
|
|
893
894
|
},
|
|
894
895
|
children: [
|
|
895
|
-
/* @__PURE__ */ e(r, { sx: { color: "text.primary" }, variant: "Body", children:
|
|
896
|
+
/* @__PURE__ */ e(r, { sx: { color: "text.primary" }, variant: "Body", children: f.overview.cost_basis_header }),
|
|
896
897
|
/* @__PURE__ */ o(
|
|
897
|
-
|
|
898
|
+
y,
|
|
898
899
|
{
|
|
899
900
|
direction: "row",
|
|
900
901
|
sx: {
|
|
@@ -902,13 +903,13 @@ const me = ({ sx: t = {} }) => {
|
|
|
902
903
|
gap: 4
|
|
903
904
|
},
|
|
904
905
|
children: [
|
|
905
|
-
|
|
906
|
+
x ? /* @__PURE__ */ e(
|
|
906
907
|
Ce,
|
|
907
908
|
{
|
|
908
909
|
autoFocus: !0,
|
|
909
|
-
onBlur: () =>
|
|
910
|
-
onChange:
|
|
911
|
-
onKeyDown: (
|
|
910
|
+
onBlur: () => m(i.id),
|
|
911
|
+
onChange: b,
|
|
912
|
+
onKeyDown: (w) => d(w, i.id),
|
|
912
913
|
size: "small",
|
|
913
914
|
sx: {
|
|
914
915
|
fontSize: 14,
|
|
@@ -934,7 +935,7 @@ const me = ({ sx: t = {} }) => {
|
|
|
934
935
|
/* @__PURE__ */ e(
|
|
935
936
|
de,
|
|
936
937
|
{
|
|
937
|
-
onClick: () =>
|
|
938
|
+
onClick: () => v(i.id, i.costBasis),
|
|
938
939
|
sx: { minWidth: 16, minHeight: 16 },
|
|
939
940
|
children: /* @__PURE__ */ e(k, { name: "stylus", size: 16, sx: { color: "grey.700" } })
|
|
940
941
|
}
|
|
@@ -957,22 +958,22 @@ const me = ({ sx: t = {} }) => {
|
|
|
957
958
|
]
|
|
958
959
|
}
|
|
959
960
|
);
|
|
960
|
-
},
|
|
961
|
+
}, ht = P(ut), q = (t) => /* @__PURE__ */ o(qe, { sx: { alignItems: "center", flexDirection: "row", gap: 4 }, children: [
|
|
961
962
|
/* @__PURE__ */ e(r, { sx: { color: "text.primary", fontWeight: 600, fontSize: 14 }, variant: "Small", children: t.colDef.headerName }),
|
|
962
963
|
/* @__PURE__ */ e(k, { name: "expand_all", size: 12 })
|
|
963
|
-
] }),
|
|
964
|
+
] }), gt = ({
|
|
964
965
|
data: t,
|
|
965
966
|
editingHoldingId: h,
|
|
966
967
|
currentEditedCostBasis: c,
|
|
967
|
-
handleCostBasisClick:
|
|
968
|
-
handleCostBasisChange:
|
|
969
|
-
handleCostBasisKeyDown:
|
|
968
|
+
handleCostBasisClick: m,
|
|
969
|
+
handleCostBasisChange: v,
|
|
970
|
+
handleCostBasisKeyDown: b,
|
|
970
971
|
handleCostBasisBlur: d
|
|
971
972
|
}) => {
|
|
972
|
-
const { investments:
|
|
973
|
+
const { investments: s } = M(), f = ce().palette.mode === "dark", p = "success.main", l = f ? "grey.300" : "grey.700", u = (n, x = "lesserThan") => x === "greaterThan" ? n >= 0 ? p : l : n <= 0 ? l : p, i = [
|
|
973
974
|
{
|
|
974
975
|
field: "qty",
|
|
975
|
-
headerName:
|
|
976
|
+
headerName: s.overview.qty_header,
|
|
976
977
|
sortable: !1,
|
|
977
978
|
width: 48,
|
|
978
979
|
align: "center",
|
|
@@ -980,7 +981,7 @@ const me = ({ sx: t = {} }) => {
|
|
|
980
981
|
},
|
|
981
982
|
{
|
|
982
983
|
field: "holding",
|
|
983
|
-
headerName:
|
|
984
|
+
headerName: s.overview.holding_header,
|
|
984
985
|
flex: 1,
|
|
985
986
|
renderHeader: q,
|
|
986
987
|
renderCell: (n) => /* @__PURE__ */ e(_, { sx: { alignItems: "center", gap: 16, flexDirection: "row" }, children: /* @__PURE__ */ o(_, { children: [
|
|
@@ -990,19 +991,19 @@ const me = ({ sx: t = {} }) => {
|
|
|
990
991
|
},
|
|
991
992
|
{
|
|
992
993
|
field: "costBasis",
|
|
993
|
-
headerName:
|
|
994
|
+
headerName: s.overview.cost_basis_header,
|
|
994
995
|
width: 132,
|
|
995
996
|
renderHeader: q,
|
|
996
997
|
renderCell: (n) => {
|
|
997
|
-
const
|
|
998
|
+
const x = h === n.row.id;
|
|
998
999
|
return /* @__PURE__ */ o(_, { sx: { alignItems: "center", flexDirection: "row", gap: 4 }, children: [
|
|
999
|
-
|
|
1000
|
+
x ? /* @__PURE__ */ e(
|
|
1000
1001
|
Ce,
|
|
1001
1002
|
{
|
|
1002
1003
|
autoFocus: !0,
|
|
1003
1004
|
onBlur: () => d(n.row.id),
|
|
1004
|
-
onChange:
|
|
1005
|
-
onKeyDown: (
|
|
1005
|
+
onChange: v,
|
|
1006
|
+
onKeyDown: (w) => b(w, n.row.id),
|
|
1006
1007
|
size: "small",
|
|
1007
1008
|
sx: {
|
|
1008
1009
|
fontSize: 14,
|
|
@@ -1028,7 +1029,7 @@ const me = ({ sx: t = {} }) => {
|
|
|
1028
1029
|
/* @__PURE__ */ e(
|
|
1029
1030
|
de,
|
|
1030
1031
|
{
|
|
1031
|
-
onClick: () =>
|
|
1032
|
+
onClick: () => m(n.row.id, n.row.costBasis),
|
|
1032
1033
|
sx: { minWidth: 12, minHeight: 12 },
|
|
1033
1034
|
children: /* @__PURE__ */ e(k, { name: "stylus", size: 12, sx: { color: "grey.700" } })
|
|
1034
1035
|
}
|
|
@@ -1040,11 +1041,11 @@ const me = ({ sx: t = {} }) => {
|
|
|
1040
1041
|
},
|
|
1041
1042
|
{
|
|
1042
1043
|
field: "totalGainLoss",
|
|
1043
|
-
headerName:
|
|
1044
|
+
headerName: s.overview.total_gain_loss_header,
|
|
1044
1045
|
width: 196,
|
|
1045
1046
|
renderHeader: q,
|
|
1046
1047
|
renderCell: (n) => {
|
|
1047
|
-
const
|
|
1048
|
+
const x = n.row.costBasis, w = x ? n.row.totalGainLoss / x * 100 : 0;
|
|
1048
1049
|
return /* @__PURE__ */ o(_, { sx: { alignItems: "center", flexDirection: "row", gap: 2 }, children: [
|
|
1049
1050
|
n.value !== 0 && /* @__PURE__ */ e(
|
|
1050
1051
|
k,
|
|
@@ -1052,7 +1053,7 @@ const me = ({ sx: t = {} }) => {
|
|
|
1052
1053
|
name: n.value > 0 ? "trending_up" : "trending_down",
|
|
1053
1054
|
size: 16,
|
|
1054
1055
|
sx: {
|
|
1055
|
-
color:
|
|
1056
|
+
color: u(n.value),
|
|
1056
1057
|
mr: 1,
|
|
1057
1058
|
verticalAlign: "middle"
|
|
1058
1059
|
}
|
|
@@ -1062,11 +1063,11 @@ const me = ({ sx: t = {} }) => {
|
|
|
1062
1063
|
r,
|
|
1063
1064
|
{
|
|
1064
1065
|
sx: {
|
|
1065
|
-
color:
|
|
1066
|
+
color: u(n.value),
|
|
1066
1067
|
fontWeight: n.value > 0 ? 700 : 400
|
|
1067
1068
|
},
|
|
1068
1069
|
variant: "Small",
|
|
1069
|
-
children:
|
|
1070
|
+
children: x ? `${w.toFixed(2)}%` : "0.00%"
|
|
1070
1071
|
}
|
|
1071
1072
|
),
|
|
1072
1073
|
/* @__PURE__ */ e(r, { sx: { color: "text.secondary" }, variant: "XSmall", children: "|" }),
|
|
@@ -1074,7 +1075,7 @@ const me = ({ sx: t = {} }) => {
|
|
|
1074
1075
|
r,
|
|
1075
1076
|
{
|
|
1076
1077
|
sx: {
|
|
1077
|
-
color:
|
|
1078
|
+
color: u(n.value),
|
|
1078
1079
|
fontWeight: n.value > 0 ? 700 : 400
|
|
1079
1080
|
},
|
|
1080
1081
|
variant: "Small",
|
|
@@ -1094,7 +1095,7 @@ const me = ({ sx: t = {} }) => {
|
|
|
1094
1095
|
},
|
|
1095
1096
|
{
|
|
1096
1097
|
field: "marketValue",
|
|
1097
|
-
headerName:
|
|
1098
|
+
headerName: s.overview.market_value_header,
|
|
1098
1099
|
width: 132,
|
|
1099
1100
|
renderHeader: q,
|
|
1100
1101
|
renderCell: (n) => /* @__PURE__ */ e(r, { sx: { fontWeight: 700 }, variant: "Small", children: n.value?.toLocaleString("en-US", {
|
|
@@ -1128,48 +1129,48 @@ const me = ({ sx: t = {} }) => {
|
|
|
1128
1129
|
)
|
|
1129
1130
|
}
|
|
1130
1131
|
);
|
|
1131
|
-
},
|
|
1132
|
-
const { isMobile: t } = U(), [h, c] = O({}), [
|
|
1132
|
+
}, pt = () => {
|
|
1133
|
+
const { isMobile: t } = U(), [h, c] = O({}), [m, v] = O(!1), { selectedAccountGuids: b } = Q(), { visibleHoldings: d, updateHoldings: s } = H(), [g, f] = A.useState(!1), [p, l] = O({
|
|
1133
1134
|
accounts: [],
|
|
1134
1135
|
holdings: []
|
|
1135
|
-
}), { accounts:
|
|
1136
|
-
|
|
1136
|
+
}), { accounts: u, investments: i } = M(), { isCopyLoaded: n } = Q(), [x, w] = O(null), [S, B] = O(""), W = ce().palette.mode === "dark", N = W ? "#0AC295" : "#09A57F", F = W ? "grey.300" : "grey.700", T = (a, C = "lesserThan") => C === "greaterThan" ? a >= 0 ? N : F : a <= 0 ? F : N, j = (a, C) => {
|
|
1137
|
+
w(a), B(C.toFixed(2));
|
|
1137
1138
|
}, Z = (a) => {
|
|
1138
|
-
const
|
|
1139
|
-
/^\d*\.?\d*$/.test(
|
|
1140
|
-
}, ue = (a,
|
|
1141
|
-
a.key === "Enter" ? ee(
|
|
1139
|
+
const C = a.target.value;
|
|
1140
|
+
/^\d*\.?\d*$/.test(C) && B(C);
|
|
1141
|
+
}, ue = (a, C) => {
|
|
1142
|
+
a.key === "Enter" ? ee(C) : a.key === "Escape" && w(null);
|
|
1142
1143
|
}, ee = (a) => {
|
|
1143
|
-
const
|
|
1144
|
-
if (!
|
|
1145
|
-
const
|
|
1146
|
-
if (
|
|
1147
|
-
const E =
|
|
1148
|
-
(D) => D.id === a ? { ...D, costBasis:
|
|
1144
|
+
const C = d.find(({ guid: E }) => E === a);
|
|
1145
|
+
if (!C) return;
|
|
1146
|
+
const G = Number(S);
|
|
1147
|
+
if (s({ ...C, cost_basis: G }), t) {
|
|
1148
|
+
const E = p.holdings.map(
|
|
1149
|
+
(D) => D.id === a ? { ...D, costBasis: G } : D
|
|
1149
1150
|
);
|
|
1150
|
-
|
|
1151
|
+
l((D) => ({
|
|
1151
1152
|
...D,
|
|
1152
1153
|
holdings: E
|
|
1153
1154
|
}));
|
|
1154
1155
|
}
|
|
1155
|
-
|
|
1156
|
-
}, De = (a) => (
|
|
1156
|
+
w(null);
|
|
1157
|
+
}, De = (a) => (C, G) => {
|
|
1157
1158
|
c((E) => ({
|
|
1158
1159
|
...E,
|
|
1159
|
-
[a]:
|
|
1160
|
+
[a]: G
|
|
1160
1161
|
}));
|
|
1161
1162
|
}, { visibleHoldings: he } = H(), { visibleInvestmentAccounts: Le } = le(), X = Le.filter(
|
|
1162
|
-
({ guid: a }) =>
|
|
1163
|
-
), Ie = X.reduce((a,
|
|
1163
|
+
({ guid: a }) => b.includes(a)
|
|
1164
|
+
), Ie = X.reduce((a, C) => a + (C.balance || 0), 0), Ae = X.map(({ guid: a }) => a), $ = he.filter(
|
|
1164
1165
|
({ account_guid: a }) => Ae.includes(a)
|
|
1165
|
-
).reduce((a,
|
|
1166
|
-
const
|
|
1167
|
-
return a +
|
|
1166
|
+
).reduce((a, C) => {
|
|
1167
|
+
const G = C.market_value ? C.market_value - (C.cost_basis || 0) : 0;
|
|
1168
|
+
return a + G;
|
|
1168
1169
|
}, 0), Be = () => {
|
|
1169
|
-
|
|
1170
|
+
v(!1);
|
|
1170
1171
|
};
|
|
1171
|
-
return n ? /* @__PURE__ */ o(
|
|
1172
|
-
!!X.length && /* @__PURE__ */ o(
|
|
1172
|
+
return n ? /* @__PURE__ */ o(y, { sx: { alignItems: "center", gap: 48, pt: 48, width: "100%" }, children: [
|
|
1173
|
+
!!X.length && /* @__PURE__ */ o(y, { sx: { alignItems: "center" }, children: [
|
|
1173
1174
|
/* @__PURE__ */ e(r, { sx: { color: "text.secondary" }, children: i.overview.total_portfolio }),
|
|
1174
1175
|
/* @__PURE__ */ e(J, { variant: "H1", children: Ie.toLocaleString("en-US", {
|
|
1175
1176
|
currency: "USD",
|
|
@@ -1177,7 +1178,7 @@ const me = ({ sx: t = {} }) => {
|
|
|
1177
1178
|
minimumFractionDigits: 2,
|
|
1178
1179
|
style: "currency"
|
|
1179
1180
|
}) }),
|
|
1180
|
-
/* @__PURE__ */ o(
|
|
1181
|
+
/* @__PURE__ */ o(y, { sx: { alignItems: "center", flexDirection: "row", gap: 8 }, children: [
|
|
1181
1182
|
/* @__PURE__ */ e(
|
|
1182
1183
|
k,
|
|
1183
1184
|
{
|
|
@@ -1202,7 +1203,7 @@ const me = ({ sx: t = {} }) => {
|
|
|
1202
1203
|
] })
|
|
1203
1204
|
] }),
|
|
1204
1205
|
X.map((a) => {
|
|
1205
|
-
const
|
|
1206
|
+
const C = he.filter((L) => L.account_guid === a.guid).map((L) => ({
|
|
1206
1207
|
id: L.guid,
|
|
1207
1208
|
qty: L.shares || 0,
|
|
1208
1209
|
holding: L.symbol || L.description || "Unknown",
|
|
@@ -1210,7 +1211,7 @@ const me = ({ sx: t = {} }) => {
|
|
|
1210
1211
|
totalGainLoss: L.market_value ? L.market_value - (L.cost_basis || 0) : 0,
|
|
1211
1212
|
marketValue: L.market_value || 0,
|
|
1212
1213
|
description: L.description || ""
|
|
1213
|
-
})),
|
|
1214
|
+
})), G = C.length > 0, E = a.balance, D = C.reduce(
|
|
1214
1215
|
(L, We) => We.totalGainLoss + L,
|
|
1215
1216
|
0
|
|
1216
1217
|
), ge = E ? D / E * 100 : 0;
|
|
@@ -1218,9 +1219,9 @@ const me = ({ sx: t = {} }) => {
|
|
|
1218
1219
|
return /* @__PURE__ */ e(
|
|
1219
1220
|
re,
|
|
1220
1221
|
{
|
|
1221
|
-
onClick:
|
|
1222
|
-
|
|
1223
|
-
holdings:
|
|
1222
|
+
onClick: C.length ? () => {
|
|
1223
|
+
v(!0), l({
|
|
1224
|
+
holdings: C,
|
|
1224
1225
|
accounts: a
|
|
1225
1226
|
});
|
|
1226
1227
|
} : void 0,
|
|
@@ -1229,7 +1230,7 @@ const me = ({ sx: t = {} }) => {
|
|
|
1229
1230
|
overflow: "hidden"
|
|
1230
1231
|
},
|
|
1231
1232
|
children: /* @__PURE__ */ o(
|
|
1232
|
-
|
|
1233
|
+
y,
|
|
1233
1234
|
{
|
|
1234
1235
|
sx: {
|
|
1235
1236
|
border: 1,
|
|
@@ -1242,7 +1243,7 @@ const me = ({ sx: t = {} }) => {
|
|
|
1242
1243
|
},
|
|
1243
1244
|
children: [
|
|
1244
1245
|
/* @__PURE__ */ o(
|
|
1245
|
-
|
|
1246
|
+
y,
|
|
1246
1247
|
{
|
|
1247
1248
|
sx: {
|
|
1248
1249
|
alignItems: "center",
|
|
@@ -1262,7 +1263,7 @@ const me = ({ sx: t = {} }) => {
|
|
|
1262
1263
|
size: 32
|
|
1263
1264
|
}
|
|
1264
1265
|
),
|
|
1265
|
-
/* @__PURE__ */ o(
|
|
1266
|
+
/* @__PURE__ */ o(y, { sx: { overflow: "hidden", pl: 13, pr: 13 }, children: [
|
|
1266
1267
|
/* @__PURE__ */ e(r, { sx: { color: "text.secondary" }, variant: "XSmall", children: a.memberName }),
|
|
1267
1268
|
/* @__PURE__ */ e(r, { sx: { color: "text.primary", fontWeight: 600 }, variant: "Body", children: a.user_name || a.name })
|
|
1268
1269
|
] })
|
|
@@ -1270,7 +1271,7 @@ const me = ({ sx: t = {} }) => {
|
|
|
1270
1271
|
}
|
|
1271
1272
|
),
|
|
1272
1273
|
/* @__PURE__ */ o(
|
|
1273
|
-
|
|
1274
|
+
y,
|
|
1274
1275
|
{
|
|
1275
1276
|
sx: {
|
|
1276
1277
|
alignItems: "center",
|
|
@@ -1281,7 +1282,7 @@ const me = ({ sx: t = {} }) => {
|
|
|
1281
1282
|
},
|
|
1282
1283
|
children: [
|
|
1283
1284
|
/* @__PURE__ */ o(
|
|
1284
|
-
|
|
1285
|
+
y,
|
|
1285
1286
|
{
|
|
1286
1287
|
sx: {
|
|
1287
1288
|
alignItems: "center",
|
|
@@ -1297,7 +1298,7 @@ const me = ({ sx: t = {} }) => {
|
|
|
1297
1298
|
children: [
|
|
1298
1299
|
/* @__PURE__ */ e(r, { sx: { color: "text.secondary", fontSize: 11 }, variant: "Small", children: i.overview.total_gain_Loss }),
|
|
1299
1300
|
/* @__PURE__ */ o(
|
|
1300
|
-
|
|
1301
|
+
y,
|
|
1301
1302
|
{
|
|
1302
1303
|
sx: {
|
|
1303
1304
|
alignItems: "center",
|
|
@@ -1352,7 +1353,7 @@ const me = ({ sx: t = {} }) => {
|
|
|
1352
1353
|
}
|
|
1353
1354
|
),
|
|
1354
1355
|
/* @__PURE__ */ o(
|
|
1355
|
-
|
|
1356
|
+
y,
|
|
1356
1357
|
{
|
|
1357
1358
|
sx: {
|
|
1358
1359
|
alignItems: "center",
|
|
@@ -1383,12 +1384,12 @@ const me = ({ sx: t = {} }) => {
|
|
|
1383
1384
|
},
|
|
1384
1385
|
a.guid
|
|
1385
1386
|
);
|
|
1386
|
-
const Te = W ? "grey.700" : "grey.400", ke =
|
|
1387
|
+
const Te = W ? "grey.700" : "grey.400", ke = C.length ? "text.primary" : Te;
|
|
1387
1388
|
return /* @__PURE__ */ o(
|
|
1388
1389
|
be,
|
|
1389
1390
|
{
|
|
1390
1391
|
expanded: h[a.guid] === !0,
|
|
1391
|
-
onChange:
|
|
1392
|
+
onChange: G ? De(a.guid) : () => {
|
|
1392
1393
|
},
|
|
1393
1394
|
sx: {
|
|
1394
1395
|
border: 1,
|
|
@@ -1411,7 +1412,7 @@ const me = ({ sx: t = {} }) => {
|
|
|
1411
1412
|
],
|
|
1412
1413
|
children: [
|
|
1413
1414
|
/* @__PURE__ */ o(
|
|
1414
|
-
|
|
1415
|
+
y,
|
|
1415
1416
|
{
|
|
1416
1417
|
sx: {
|
|
1417
1418
|
alignItems: "center",
|
|
@@ -1430,18 +1431,18 @@ const me = ({ sx: t = {} }) => {
|
|
|
1430
1431
|
size: 32
|
|
1431
1432
|
}
|
|
1432
1433
|
),
|
|
1433
|
-
/* @__PURE__ */ o(
|
|
1434
|
+
/* @__PURE__ */ o(y, { sx: { alignItems: "flex-start" }, children: [
|
|
1434
1435
|
/* @__PURE__ */ e(r, { sx: { color: "text.secondary" }, variant: "XSmall", children: a.memberName }),
|
|
1435
1436
|
/* @__PURE__ */ e(r, { sx: { color: "text.primary", fontWeight: 600 }, variant: "Body", children: a.user_name || a.name })
|
|
1436
1437
|
] })
|
|
1437
1438
|
]
|
|
1438
1439
|
}
|
|
1439
1440
|
),
|
|
1440
|
-
/* @__PURE__ */ o(
|
|
1441
|
-
/* @__PURE__ */ o(
|
|
1441
|
+
/* @__PURE__ */ o(y, { sx: { flexDirection: "row" }, children: [
|
|
1442
|
+
/* @__PURE__ */ o(y, { sx: { alignItems: "flex-end", pb: 14, pl: 24, pr: 24, pt: 14 }, children: [
|
|
1442
1443
|
/* @__PURE__ */ e(r, { sx: { color: "text.secondary" }, variant: "XSmall", children: i.overview.total_gain_Loss }),
|
|
1443
1444
|
/* @__PURE__ */ o(
|
|
1444
|
-
|
|
1445
|
+
y,
|
|
1445
1446
|
{
|
|
1446
1447
|
sx: {
|
|
1447
1448
|
alignItems: "center",
|
|
@@ -1493,7 +1494,7 @@ const me = ({ sx: t = {} }) => {
|
|
|
1493
1494
|
}
|
|
1494
1495
|
)
|
|
1495
1496
|
] }),
|
|
1496
|
-
/* @__PURE__ */ e(
|
|
1497
|
+
/* @__PURE__ */ e(y, { sx: { alignItems: "flex-end", gap: 12, pb: 14, pl: 16, pr: 16, pt: 14 }, children: /* @__PURE__ */ o(y, { sx: { alignItems: "flex-end" }, children: [
|
|
1497
1498
|
/* @__PURE__ */ e(r, { sx: { color: "text.secondary" }, variant: "XSmall", children: i.overview.total_value }),
|
|
1498
1499
|
/* @__PURE__ */ e(r, { sx: { color: "text.primary", fontWeight: 600 }, variant: "Body", children: E?.toLocaleString("en-US", {
|
|
1499
1500
|
currency: "USD",
|
|
@@ -1507,11 +1508,11 @@ const me = ({ sx: t = {} }) => {
|
|
|
1507
1508
|
}
|
|
1508
1509
|
),
|
|
1509
1510
|
/* @__PURE__ */ e(_e, { sx: { bgcolor: "background.default", p: 12 }, children: /* @__PURE__ */ e(re, { sx: { border: 1, borderColor: "border.light" }, children: /* @__PURE__ */ e(
|
|
1510
|
-
|
|
1511
|
+
gt,
|
|
1511
1512
|
{
|
|
1512
1513
|
currentEditedCostBasis: S,
|
|
1513
|
-
data:
|
|
1514
|
-
editingHoldingId:
|
|
1514
|
+
data: C,
|
|
1515
|
+
editingHoldingId: x,
|
|
1515
1516
|
handleCostBasisBlur: ee,
|
|
1516
1517
|
handleCostBasisChange: Z,
|
|
1517
1518
|
handleCostBasisClick: j,
|
|
@@ -1525,65 +1526,69 @@ const me = ({ sx: t = {} }) => {
|
|
|
1525
1526
|
}),
|
|
1526
1527
|
/* @__PURE__ */ e(me, {}),
|
|
1527
1528
|
/* @__PURE__ */ e(
|
|
1528
|
-
|
|
1529
|
+
ht,
|
|
1529
1530
|
{
|
|
1530
|
-
accountHoldingsData:
|
|
1531
|
+
accountHoldingsData: p,
|
|
1531
1532
|
currentEditedCostBasis: S,
|
|
1532
|
-
editingHoldingId:
|
|
1533
|
+
editingHoldingId: x,
|
|
1533
1534
|
handleCostBasisBlur: ee,
|
|
1534
1535
|
handleCostBasisChange: Z,
|
|
1535
1536
|
handleCostBasisClick: j,
|
|
1536
1537
|
handleCostBasisKeyDown: ue,
|
|
1537
|
-
isOpen:
|
|
1538
|
+
isOpen: m,
|
|
1538
1539
|
onClose: Be
|
|
1539
1540
|
}
|
|
1540
1541
|
),
|
|
1541
1542
|
/* @__PURE__ */ e(
|
|
1542
1543
|
pe,
|
|
1543
1544
|
{
|
|
1544
|
-
onClose: () =>
|
|
1545
|
-
showConnectionsWidget:
|
|
1546
|
-
title:
|
|
1545
|
+
onClose: () => f(!1),
|
|
1546
|
+
showConnectionsWidget: g,
|
|
1547
|
+
title: u.manage_connections
|
|
1547
1548
|
}
|
|
1548
1549
|
)
|
|
1549
1550
|
] }) : /* @__PURE__ */ e(Se, {});
|
|
1550
|
-
},
|
|
1551
|
-
const { onEvent: c } = ve(), { isMobile:
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
} =
|
|
1551
|
+
}, xt = P(pt), yt = ({ title: t }) => /* @__PURE__ */ e(r, { bold: !0, variant: "Body", children: t }), cn = P(({ onBackClick: t, sx: h }) => {
|
|
1552
|
+
const { onEvent: c } = ve(), { isMobile: m } = U(), {
|
|
1553
|
+
isAccountDataLoaded: v,
|
|
1554
|
+
loadAccountData: b,
|
|
1555
|
+
visibleInvestmentAccounts: d
|
|
1556
|
+
} = le(), {
|
|
1557
|
+
visibleHoldings: s,
|
|
1558
|
+
setShowConnectionsWidget: g,
|
|
1559
|
+
showConnectionsWidget: f
|
|
1560
|
+
} = H(), { investments: p, accounts: l } = M(), { isInitialized: u } = Q(), [i, n] = A.useState(0), { loadHoldings: x, holdingsLoaded: w } = H();
|
|
1556
1561
|
Ke({
|
|
1557
1562
|
widgetName: "InvestmentsWidget",
|
|
1558
|
-
isLoaded:
|
|
1563
|
+
isLoaded: w
|
|
1559
1564
|
}), A.useEffect(() => {
|
|
1560
|
-
|
|
1561
|
-
}, [
|
|
1562
|
-
|
|
1563
|
-
}, [
|
|
1565
|
+
v || b().finally();
|
|
1566
|
+
}, []), A.useEffect(() => {
|
|
1567
|
+
u && x().finally();
|
|
1568
|
+
}, [u]);
|
|
1564
1569
|
const S = () => {
|
|
1565
1570
|
c(z.INVESTMENT_WIDGET_ACCOUNT_FILTER_CLICK);
|
|
1566
1571
|
};
|
|
1567
|
-
if (!
|
|
1572
|
+
if (!u || !w) return /* @__PURE__ */ e(Se, {});
|
|
1568
1573
|
const B = [
|
|
1569
1574
|
z.INVESTMENT_WIDGET_DETAILS_CLICK,
|
|
1570
1575
|
z.INVESTMENT_WIDGET_ALLOCATION_CLICK,
|
|
1571
1576
|
z.INVESTMENT_WIDGET_ANALYSIS_CLICK
|
|
1572
|
-
], I =
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1577
|
+
], I = d.length === 0 && s.length === 0, W = [
|
|
1578
|
+
p.tab_overview_title,
|
|
1579
|
+
p.tab_allocation_title,
|
|
1580
|
+
p.tab_analysis_title
|
|
1576
1581
|
];
|
|
1577
1582
|
return /* @__PURE__ */ o(
|
|
1578
1583
|
Ue,
|
|
1579
1584
|
{
|
|
1580
|
-
|
|
1585
|
+
allowedAccountTypes: [Ye.INVESTMENT],
|
|
1581
1586
|
onAccountsFilterClick: S,
|
|
1582
1587
|
onBackClick: t,
|
|
1583
1588
|
sx: h,
|
|
1584
|
-
title:
|
|
1589
|
+
title: p.title,
|
|
1585
1590
|
children: [
|
|
1586
|
-
/* @__PURE__ */ o(_, { mx:
|
|
1591
|
+
/* @__PURE__ */ o(_, { mx: m ? 0 : 48, my: 24, children: [
|
|
1587
1592
|
/* @__PURE__ */ e(
|
|
1588
1593
|
Ee,
|
|
1589
1594
|
{
|
|
@@ -1594,19 +1599,19 @@ const me = ({ sx: t = {} }) => {
|
|
|
1594
1599
|
textColor: "primary",
|
|
1595
1600
|
value: I ? -1 : i,
|
|
1596
1601
|
variant: "fullWidth",
|
|
1597
|
-
children: W.map((N) => /* @__PURE__ */ e(Fe, { disabled: I, label: /* @__PURE__ */ e(
|
|
1602
|
+
children: W.map((N) => /* @__PURE__ */ e(Fe, { disabled: I, label: /* @__PURE__ */ e(yt, { title: N }) }, N))
|
|
1598
1603
|
}
|
|
1599
1604
|
),
|
|
1600
1605
|
I ? /* @__PURE__ */ e(
|
|
1601
|
-
|
|
1606
|
+
Qe,
|
|
1602
1607
|
{
|
|
1603
|
-
header:
|
|
1608
|
+
header: p.empty_state_header,
|
|
1604
1609
|
icon: "bid_landscape",
|
|
1605
1610
|
onClick: () => {
|
|
1606
|
-
|
|
1611
|
+
g(!0), c(z.ACCOUNTS_CLICK_CONNECT);
|
|
1607
1612
|
},
|
|
1608
|
-
primaryButton:
|
|
1609
|
-
subText:
|
|
1613
|
+
primaryButton: p.overview.connect_accounts,
|
|
1614
|
+
subText: p.empty_state_description,
|
|
1610
1615
|
sx: {
|
|
1611
1616
|
width: { sm: 432 },
|
|
1612
1617
|
".buttons-footer": {
|
|
@@ -1620,17 +1625,17 @@ const me = ({ sx: t = {} }) => {
|
|
|
1620
1625
|
}
|
|
1621
1626
|
}
|
|
1622
1627
|
) : /* @__PURE__ */ o(se, { children: [
|
|
1623
|
-
i === 0 && /* @__PURE__ */ e(
|
|
1624
|
-
i === 1 && /* @__PURE__ */ e(
|
|
1625
|
-
i === 2 && /* @__PURE__ */ e(
|
|
1628
|
+
i === 0 && /* @__PURE__ */ e(xt, {}),
|
|
1629
|
+
i === 1 && /* @__PURE__ */ e(at, {}),
|
|
1630
|
+
i === 2 && /* @__PURE__ */ e(mt, {})
|
|
1626
1631
|
] })
|
|
1627
1632
|
] }),
|
|
1628
1633
|
/* @__PURE__ */ e(
|
|
1629
1634
|
pe,
|
|
1630
1635
|
{
|
|
1631
|
-
onClose: () =>
|
|
1632
|
-
showConnectionsWidget:
|
|
1633
|
-
title:
|
|
1636
|
+
onClose: () => g(!1),
|
|
1637
|
+
showConnectionsWidget: f,
|
|
1638
|
+
title: l.manage_connections
|
|
1634
1639
|
}
|
|
1635
1640
|
)
|
|
1636
1641
|
]
|
|
@@ -1638,5 +1643,5 @@ const me = ({ sx: t = {} }) => {
|
|
|
1638
1643
|
);
|
|
1639
1644
|
});
|
|
1640
1645
|
export {
|
|
1641
|
-
|
|
1646
|
+
cn as InvestmentsWidget
|
|
1642
1647
|
};
|