@burdenoff/microfe-brainyrich 2026.705.1 → 2026.706.1
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/dist/brainyrich/BrainyRichRoot.js +13 -13
- package/dist/brainyrich/components/ActorName.js +38 -0
- package/dist/brainyrich/components/ActorName.js.map +1 -0
- package/dist/brainyrich/components/ConfirmDialog.js +25 -0
- package/dist/brainyrich/components/ConfirmDialog.js.map +1 -0
- package/dist/brainyrich/components/LoadMore.js +24 -0
- package/dist/brainyrich/components/LoadMore.js.map +1 -0
- package/dist/brainyrich/components/index.js +5 -0
- package/dist/brainyrich/components/notify.js +38 -0
- package/dist/brainyrich/components/notify.js.map +1 -0
- package/dist/brainyrich/components/pickers.js +232 -0
- package/dist/brainyrich/components/pickers.js.map +1 -0
- package/dist/brainyrich/components/reuse/CommentThread.js +208 -0
- package/dist/brainyrich/components/reuse/CommentThread.js.map +1 -0
- package/dist/brainyrich/components/reuse/DocumentsPanel.js +237 -0
- package/dist/brainyrich/components/reuse/DocumentsPanel.js.map +1 -0
- package/dist/brainyrich/components/reuse/TagField.js +206 -0
- package/dist/brainyrich/components/reuse/TagField.js.map +1 -0
- package/dist/brainyrich/components/reuse/transport.js +24 -0
- package/dist/brainyrich/components/reuse/transport.js.map +1 -0
- package/dist/brainyrich/hooks/useBrainyRichApi.js +644 -372
- package/dist/brainyrich/hooks/useBrainyRichApi.js.map +1 -1
- package/dist/brainyrich/pages/AccountsPage.js +346 -293
- package/dist/brainyrich/pages/AccountsPage.js.map +1 -1
- package/dist/brainyrich/pages/AiAssistantPage.js +339 -320
- package/dist/brainyrich/pages/AiAssistantPage.js.map +1 -1
- package/dist/brainyrich/pages/AnalyticsPage.js +178 -164
- package/dist/brainyrich/pages/AnalyticsPage.js.map +1 -1
- package/dist/brainyrich/pages/DashboardPage.js +195 -169
- package/dist/brainyrich/pages/DashboardPage.js.map +1 -1
- package/dist/brainyrich/pages/FamilyPage.js +247 -198
- package/dist/brainyrich/pages/FamilyPage.js.map +1 -1
- package/dist/brainyrich/pages/GoalsPage.js +478 -442
- package/dist/brainyrich/pages/GoalsPage.js.map +1 -1
- package/dist/brainyrich/pages/InvestmentsPage.js.map +1 -1
- package/dist/brainyrich/pages/PortfoliosPage.js +438 -396
- package/dist/brainyrich/pages/PortfoliosPage.js.map +1 -1
- package/dist/brainyrich/pages/ReportsPage.js +246 -213
- package/dist/brainyrich/pages/ReportsPage.js.map +1 -1
- package/dist/brainyrich/pages/RiskPage.js +321 -173
- package/dist/brainyrich/pages/RiskPage.js.map +1 -1
- package/dist/brainyrich/pages/TaxPage.js +258 -225
- package/dist/brainyrich/pages/TaxPage.js.map +1 -1
- package/dist/brainyrich/pages/_shared.js.map +1 -1
- package/dist/node_modules/sonner/dist/index.js +163 -0
- package/dist/node_modules/sonner/dist/index.js.map +1 -0
- package/package.json +3 -2
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import { useAccount as e,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
1
|
+
import { useAccount as e, useAllAccounts as t, useArchiveAccount as n, useCreateAccount as r, usePagedAccounts as i, usePagedTransactions as a, useRecordTransaction as ee, useUpdateAccount as te } from "../hooks/useBrainyRichApi.js";
|
|
2
|
+
import { LoadMore as o } from "../components/LoadMore.js";
|
|
3
|
+
import { ConfirmDialog as ne } from "../components/ConfirmDialog.js";
|
|
4
|
+
import { ActorName as s } from "../components/ActorName.js";
|
|
5
|
+
import { HouseholdPicker as c } from "../components/pickers.js";
|
|
6
|
+
import "../components/index.js";
|
|
7
|
+
import { EmptyState as l, ErrorState as u, KpiGrid as d, LoadingState as f, SectionShell as re, formatDate as p, formatMoney as m, statusBadgeVariant as ie } from "./_shared.js";
|
|
8
|
+
import { DocumentsPanel as h } from "../components/reuse/DocumentsPanel.js";
|
|
9
|
+
import { useState as g } from "react";
|
|
10
|
+
import { Archive as ae, ArrowDownRight as _, ArrowUpRight as v, Landmark as oe, MoreHorizontal as se, Pencil as ce, Plus as y, Receipt as b } from "lucide-react";
|
|
11
|
+
import { jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
12
|
+
import { Badge as C, Button as w, Card as le, CardContent as ue, CardDescription as de, CardHeader as fe, CardTitle as pe, Dialog as T, DialogClose as me, DialogContent as E, DialogDescription as D, DialogFooter as O, DialogHeader as k, DialogTitle as A, DropdownMenu as he, DropdownMenuContent as ge, DropdownMenuItem as j, DropdownMenuTrigger as _e, Input as M, Label as N, Select as P, SelectContent as F, SelectItem as I, SelectTrigger as ve, SelectValue as ye, Sheet as L, SheetContent as R, SheetDescription as z, SheetHeader as B, SheetTitle as V, Table as be, TableBody as xe, TableCell as H, TableHead as U, TableHeader as Se, TableRow as Ce, Textarea as we } from "@burdenoff/fe-libs/ui";
|
|
7
13
|
//#region src/brainyrich/pages/AccountsPage.tsx
|
|
8
|
-
var
|
|
14
|
+
var Te = [
|
|
9
15
|
"BANK",
|
|
10
16
|
"BROKERAGE",
|
|
11
17
|
"RETIREMENT",
|
|
@@ -14,7 +20,7 @@ var B = [
|
|
|
14
20
|
"REAL_ESTATE",
|
|
15
21
|
"ALTERNATIVE",
|
|
16
22
|
"LIABILITY"
|
|
17
|
-
],
|
|
23
|
+
], Ee = [
|
|
18
24
|
"BUY",
|
|
19
25
|
"SELL",
|
|
20
26
|
"DIVIDEND",
|
|
@@ -24,22 +30,23 @@ var B = [
|
|
|
24
30
|
"FEE",
|
|
25
31
|
"TRANSFER"
|
|
26
32
|
];
|
|
27
|
-
function
|
|
33
|
+
function W(e) {
|
|
28
34
|
return e === "DEPOSIT" || e === "DIVIDEND" || e === "INTEREST" || e === "SELL" || e === "TRANSFER";
|
|
29
35
|
}
|
|
30
|
-
function
|
|
36
|
+
function G(e) {
|
|
31
37
|
if (e.trim() === "") return;
|
|
32
38
|
let t = Number(e);
|
|
33
39
|
return Number.isFinite(t) ? t : void 0;
|
|
34
40
|
}
|
|
35
|
-
var
|
|
41
|
+
var K = {
|
|
36
42
|
name: "",
|
|
37
43
|
type: "BANK",
|
|
38
44
|
institution: "",
|
|
39
45
|
currency: "USD",
|
|
40
46
|
cashBalance: "",
|
|
41
|
-
accountMask: ""
|
|
42
|
-
|
|
47
|
+
accountMask: "",
|
|
48
|
+
householdId: null
|
|
49
|
+
}, De = {
|
|
43
50
|
type: "DEPOSIT",
|
|
44
51
|
tradeDate: "",
|
|
45
52
|
symbol: "",
|
|
@@ -49,187 +56,191 @@ var U = {
|
|
|
49
56
|
fee: "",
|
|
50
57
|
notes: ""
|
|
51
58
|
};
|
|
52
|
-
function
|
|
53
|
-
let
|
|
54
|
-
function
|
|
55
|
-
|
|
59
|
+
function q() {
|
|
60
|
+
let e = t().data, a = i(), [s, c] = g(void 0), [p, h] = g(!1), [_, v] = g(K), [b, L] = g(null), [R, z] = g(K), [B, V] = g(null), [Te, W] = g(!1), [q, J] = g(De), Y = r(), X = te(), Ae = n(), Z = ee(), je = e.reduce((e, t) => e + (t.cashBalance ?? 0), 0), Me = e.filter((e) => e.status === "ACTIVE").length, Ne = new Set(e.map((e) => e.institution).filter((e) => !!e)).size, Pe = e[0]?.currency ?? "USD";
|
|
61
|
+
function Fe() {
|
|
62
|
+
v(K), h(!0);
|
|
56
63
|
}
|
|
57
|
-
function
|
|
58
|
-
|
|
59
|
-
name:
|
|
60
|
-
type:
|
|
61
|
-
institution:
|
|
62
|
-
currency:
|
|
63
|
-
cashBalance:
|
|
64
|
-
accountMask:
|
|
65
|
-
|
|
64
|
+
function Ie() {
|
|
65
|
+
_.name.trim() && Y.mutate({
|
|
66
|
+
name: _.name.trim(),
|
|
67
|
+
type: _.type,
|
|
68
|
+
institution: _.institution.trim() || null,
|
|
69
|
+
currency: _.currency.trim() || "USD",
|
|
70
|
+
cashBalance: G(_.cashBalance) ?? 0,
|
|
71
|
+
accountMask: _.accountMask.trim() || null,
|
|
72
|
+
householdId: _.householdId
|
|
73
|
+
}, { onSuccess: () => h(!1) });
|
|
66
74
|
}
|
|
67
|
-
function
|
|
68
|
-
|
|
75
|
+
function Le(e) {
|
|
76
|
+
L(e), z({
|
|
69
77
|
name: e.name,
|
|
70
78
|
type: e.type,
|
|
71
79
|
institution: e.institution ?? "",
|
|
72
80
|
currency: e.currency,
|
|
73
81
|
cashBalance: String(e.cashBalance ?? ""),
|
|
74
|
-
accountMask: e.accountMask ?? ""
|
|
82
|
+
accountMask: e.accountMask ?? "",
|
|
83
|
+
householdId: e.householdId
|
|
75
84
|
});
|
|
76
85
|
}
|
|
77
|
-
function
|
|
78
|
-
!
|
|
79
|
-
id:
|
|
86
|
+
function Re() {
|
|
87
|
+
!b || !R.name.trim() || X.mutate({
|
|
88
|
+
id: b.id,
|
|
80
89
|
input: {
|
|
81
|
-
name:
|
|
82
|
-
type:
|
|
83
|
-
institution:
|
|
84
|
-
currency:
|
|
85
|
-
cashBalance:
|
|
86
|
-
accountMask:
|
|
90
|
+
name: R.name.trim(),
|
|
91
|
+
type: R.type,
|
|
92
|
+
institution: R.institution.trim() || null,
|
|
93
|
+
currency: R.currency.trim() || "USD",
|
|
94
|
+
cashBalance: G(R.cashBalance) ?? 0,
|
|
95
|
+
accountMask: R.accountMask.trim() || null,
|
|
96
|
+
householdId: R.householdId
|
|
87
97
|
}
|
|
88
|
-
}, { onSuccess: () =>
|
|
98
|
+
}, { onSuccess: () => L(null) });
|
|
89
99
|
}
|
|
90
|
-
function
|
|
91
|
-
if (!
|
|
92
|
-
let e =
|
|
93
|
-
|
|
94
|
-
|
|
100
|
+
function ze() {
|
|
101
|
+
if (!B) return;
|
|
102
|
+
let e = B.id;
|
|
103
|
+
Ae.mutate(e, { onSuccess: () => {
|
|
104
|
+
V(null), s === e && c(void 0);
|
|
95
105
|
} });
|
|
96
106
|
}
|
|
97
|
-
function
|
|
98
|
-
|
|
107
|
+
function Be() {
|
|
108
|
+
J(De), W(!0);
|
|
99
109
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
110
|
+
let Q = G(q.amount), $ = Q !== void 0 && Q > 0, Ve = !!(s && q.tradeDate) && $;
|
|
111
|
+
function He() {
|
|
112
|
+
if (!s || !q.tradeDate || !$) return;
|
|
113
|
+
let e = new Date(q.tradeDate);
|
|
114
|
+
Number.isNaN(e.getTime()) || Z.mutate({
|
|
115
|
+
accountId: s,
|
|
116
|
+
type: q.type,
|
|
106
117
|
tradeDate: e.toISOString(),
|
|
107
|
-
symbol:
|
|
108
|
-
quantity:
|
|
109
|
-
price:
|
|
110
|
-
amount:
|
|
111
|
-
fee:
|
|
112
|
-
notes:
|
|
113
|
-
}, { onSuccess: () =>
|
|
118
|
+
symbol: q.symbol.trim() || null,
|
|
119
|
+
quantity: G(q.quantity),
|
|
120
|
+
price: G(q.price),
|
|
121
|
+
amount: Q,
|
|
122
|
+
fee: G(q.fee),
|
|
123
|
+
notes: q.notes.trim() || null
|
|
124
|
+
}, { onSuccess: () => W(!1) });
|
|
114
125
|
}
|
|
115
|
-
return /* @__PURE__ */
|
|
126
|
+
return /* @__PURE__ */ S(re, {
|
|
116
127
|
title: "Accounts",
|
|
117
128
|
description: "Linked bank, brokerage and retirement accounts with recent activity.",
|
|
118
129
|
badges: [`${e.length} account${e.length === 1 ? "" : "s"}`],
|
|
119
130
|
actionLabel: "New account",
|
|
120
|
-
onAction:
|
|
131
|
+
onAction: Fe,
|
|
121
132
|
children: [
|
|
122
|
-
/* @__PURE__ */
|
|
133
|
+
/* @__PURE__ */ x(d, { items: [
|
|
123
134
|
{
|
|
124
135
|
label: "Total accounts",
|
|
125
136
|
value: String(e.length)
|
|
126
137
|
},
|
|
127
138
|
{
|
|
128
139
|
label: "Total cash",
|
|
129
|
-
value:
|
|
140
|
+
value: m(je, Pe)
|
|
130
141
|
},
|
|
131
142
|
{
|
|
132
143
|
label: "Active",
|
|
133
|
-
value: `${
|
|
144
|
+
value: `${Me}/${e.length}`
|
|
134
145
|
},
|
|
135
146
|
{
|
|
136
147
|
label: "Institutions",
|
|
137
|
-
value: String(
|
|
148
|
+
value: String(Ne)
|
|
138
149
|
}
|
|
139
150
|
] }),
|
|
140
|
-
/* @__PURE__ */
|
|
151
|
+
/* @__PURE__ */ S(le, { children: [/* @__PURE__ */ S(fe, { children: [/* @__PURE__ */ S(pe, {
|
|
141
152
|
className: "flex items-center gap-2",
|
|
142
|
-
children: [/* @__PURE__ */
|
|
153
|
+
children: [/* @__PURE__ */ x(oe, {
|
|
143
154
|
className: "h-5 w-5",
|
|
144
155
|
"aria-hidden": "true"
|
|
145
156
|
}), "Linked accounts"]
|
|
146
|
-
}), /* @__PURE__ */
|
|
147
|
-
icon: /* @__PURE__ */
|
|
157
|
+
}), /* @__PURE__ */ x(de, { children: "Select an account to view holdings and transactions." })] }), /* @__PURE__ */ x(ue, { children: a.isLoading ? /* @__PURE__ */ x(f, {}) : a.isError ? /* @__PURE__ */ x(u, { onRetry: () => a.refetch() }) : a.items.length === 0 ? /* @__PURE__ */ x(l, {
|
|
158
|
+
icon: /* @__PURE__ */ x(oe, {
|
|
148
159
|
className: "size-6",
|
|
149
160
|
"aria-hidden": "true"
|
|
150
161
|
}),
|
|
151
162
|
title: "No accounts yet",
|
|
152
163
|
description: "Add your first bank, brokerage or retirement account to start tracking net worth.",
|
|
153
|
-
action: /* @__PURE__ */
|
|
164
|
+
action: /* @__PURE__ */ S(w, {
|
|
154
165
|
size: "sm",
|
|
155
|
-
onClick:
|
|
156
|
-
children: [/* @__PURE__ */
|
|
166
|
+
onClick: Fe,
|
|
167
|
+
children: [/* @__PURE__ */ x(y, {
|
|
157
168
|
className: "size-4",
|
|
158
169
|
"aria-hidden": "true"
|
|
159
170
|
}), "New account"]
|
|
160
171
|
})
|
|
161
|
-
}) : /* @__PURE__ */
|
|
172
|
+
}) : /* @__PURE__ */ S("div", {
|
|
162
173
|
className: "overflow-x-auto",
|
|
163
|
-
children: /* @__PURE__ */
|
|
164
|
-
/* @__PURE__ */
|
|
165
|
-
/* @__PURE__ */
|
|
166
|
-
/* @__PURE__ */
|
|
174
|
+
children: [/* @__PURE__ */ S(be, { children: [/* @__PURE__ */ x(Se, { children: /* @__PURE__ */ S(Ce, { children: [
|
|
175
|
+
/* @__PURE__ */ x(U, { children: "Account" }),
|
|
176
|
+
/* @__PURE__ */ x(U, { children: "Type" }),
|
|
177
|
+
/* @__PURE__ */ x(U, {
|
|
167
178
|
className: "text-right",
|
|
168
179
|
children: "Cash balance"
|
|
169
180
|
}),
|
|
170
|
-
/* @__PURE__ */
|
|
171
|
-
/* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */ x(U, { children: "Status" }),
|
|
182
|
+
/* @__PURE__ */ x(U, {
|
|
172
183
|
className: "w-12 text-right",
|
|
173
184
|
children: "Actions"
|
|
174
185
|
})
|
|
175
|
-
] }) }), /* @__PURE__ */
|
|
186
|
+
] }) }), /* @__PURE__ */ x(xe, { children: a.items.map((e) => /* @__PURE__ */ S(Ce, {
|
|
176
187
|
className: "cursor-pointer",
|
|
177
|
-
onClick: () =>
|
|
188
|
+
onClick: () => c(e.id),
|
|
178
189
|
children: [
|
|
179
|
-
/* @__PURE__ */
|
|
190
|
+
/* @__PURE__ */ x(H, { children: /* @__PURE__ */ S("div", {
|
|
180
191
|
className: "flex items-center gap-3",
|
|
181
|
-
children: [/* @__PURE__ */
|
|
192
|
+
children: [/* @__PURE__ */ x("div", {
|
|
182
193
|
className: "flex h-9 w-9 items-center justify-center rounded-full bg-muted text-xs font-semibold text-muted-foreground",
|
|
183
194
|
children: (e.institution ?? e.name).slice(0, 2).toUpperCase()
|
|
184
|
-
}), /* @__PURE__ */
|
|
195
|
+
}), /* @__PURE__ */ S("div", {
|
|
185
196
|
className: "min-w-0",
|
|
186
|
-
children: [/* @__PURE__ */
|
|
197
|
+
children: [/* @__PURE__ */ x("p", {
|
|
187
198
|
className: "truncate font-medium text-text-primary",
|
|
188
199
|
children: e.name
|
|
189
|
-
}), /* @__PURE__ */
|
|
200
|
+
}), /* @__PURE__ */ S("p", {
|
|
190
201
|
className: "truncate text-xs text-text-secondary",
|
|
191
202
|
children: [e.institution ?? "Manual account", e.accountMask ? ` · ••${e.accountMask}` : ""]
|
|
192
203
|
})]
|
|
193
204
|
})]
|
|
194
205
|
}) }),
|
|
195
|
-
/* @__PURE__ */
|
|
206
|
+
/* @__PURE__ */ x(H, { children: /* @__PURE__ */ x(C, {
|
|
196
207
|
variant: "outline",
|
|
197
208
|
children: e.type.replace(/_/g, " ")
|
|
198
209
|
}) }),
|
|
199
|
-
/* @__PURE__ */
|
|
210
|
+
/* @__PURE__ */ x(H, {
|
|
200
211
|
className: "text-right font-semibold text-text-primary",
|
|
201
|
-
children:
|
|
212
|
+
children: m(e.cashBalance, e.currency)
|
|
202
213
|
}),
|
|
203
|
-
/* @__PURE__ */
|
|
204
|
-
variant:
|
|
214
|
+
/* @__PURE__ */ x(H, { children: /* @__PURE__ */ x(C, {
|
|
215
|
+
variant: ie(e.status),
|
|
205
216
|
children: e.status
|
|
206
217
|
}) }),
|
|
207
|
-
/* @__PURE__ */
|
|
218
|
+
/* @__PURE__ */ x(H, {
|
|
208
219
|
className: "text-right",
|
|
209
220
|
onClick: (e) => e.stopPropagation(),
|
|
210
|
-
children: /* @__PURE__ */
|
|
221
|
+
children: /* @__PURE__ */ S(he, { children: [/* @__PURE__ */ x(_e, {
|
|
211
222
|
asChild: !0,
|
|
212
|
-
children: /* @__PURE__ */
|
|
223
|
+
children: /* @__PURE__ */ x(w, {
|
|
213
224
|
variant: "ghost",
|
|
214
225
|
size: "sm",
|
|
215
226
|
"aria-label": `Actions for ${e.name}`,
|
|
216
|
-
children: /* @__PURE__ */
|
|
227
|
+
children: /* @__PURE__ */ x(se, {
|
|
217
228
|
className: "size-4",
|
|
218
229
|
"aria-hidden": "true"
|
|
219
230
|
})
|
|
220
231
|
})
|
|
221
|
-
}), /* @__PURE__ */
|
|
232
|
+
}), /* @__PURE__ */ S(ge, {
|
|
222
233
|
align: "end",
|
|
223
|
-
children: [/* @__PURE__ */
|
|
224
|
-
onClick: () =>
|
|
225
|
-
children: [/* @__PURE__ */
|
|
234
|
+
children: [/* @__PURE__ */ S(j, {
|
|
235
|
+
onClick: () => Le(e),
|
|
236
|
+
children: [/* @__PURE__ */ x(ce, {
|
|
226
237
|
className: "size-4",
|
|
227
238
|
"aria-hidden": "true"
|
|
228
239
|
}), "Edit"]
|
|
229
|
-
}), /* @__PURE__ */
|
|
240
|
+
}), /* @__PURE__ */ S(j, {
|
|
230
241
|
className: "text-status-error-text",
|
|
231
|
-
onClick: () =>
|
|
232
|
-
children: [/* @__PURE__ */
|
|
242
|
+
onClick: () => V(e),
|
|
243
|
+
children: [/* @__PURE__ */ x(ae, {
|
|
233
244
|
className: "size-4",
|
|
234
245
|
"aria-hidden": "true"
|
|
235
246
|
}), "Archive"]
|
|
@@ -237,189 +248,203 @@ function W() {
|
|
|
237
248
|
})] })
|
|
238
249
|
})
|
|
239
250
|
]
|
|
240
|
-
}, e.id)) })] })
|
|
251
|
+
}, e.id)) })] }), /* @__PURE__ */ x(o, {
|
|
252
|
+
hasMore: a.hasMore,
|
|
253
|
+
onClick: a.loadMore,
|
|
254
|
+
loading: a.isFetchingNextPage,
|
|
255
|
+
className: "mt-4"
|
|
256
|
+
})]
|
|
241
257
|
}) })] }),
|
|
242
|
-
/* @__PURE__ */
|
|
243
|
-
open:
|
|
244
|
-
onOpenChange:
|
|
245
|
-
children: /* @__PURE__ */
|
|
246
|
-
/* @__PURE__ */
|
|
247
|
-
/* @__PURE__ */
|
|
248
|
-
form:
|
|
249
|
-
onChange:
|
|
258
|
+
/* @__PURE__ */ x(T, {
|
|
259
|
+
open: p,
|
|
260
|
+
onOpenChange: h,
|
|
261
|
+
children: /* @__PURE__ */ S(E, { children: [
|
|
262
|
+
/* @__PURE__ */ S(k, { children: [/* @__PURE__ */ x(A, { children: "New account" }), /* @__PURE__ */ x(D, { children: "Add a bank, brokerage or retirement account." })] }),
|
|
263
|
+
/* @__PURE__ */ x(Oe, {
|
|
264
|
+
form: _,
|
|
265
|
+
onChange: v
|
|
250
266
|
}),
|
|
251
|
-
/* @__PURE__ */
|
|
267
|
+
/* @__PURE__ */ S(O, { children: [/* @__PURE__ */ x(me, {
|
|
252
268
|
asChild: !0,
|
|
253
|
-
children: /* @__PURE__ */
|
|
269
|
+
children: /* @__PURE__ */ x(w, {
|
|
254
270
|
variant: "outline",
|
|
255
271
|
children: "Cancel"
|
|
256
272
|
})
|
|
257
|
-
}), /* @__PURE__ */
|
|
258
|
-
onClick:
|
|
259
|
-
disabled: !
|
|
260
|
-
children:
|
|
273
|
+
}), /* @__PURE__ */ x(w, {
|
|
274
|
+
onClick: Ie,
|
|
275
|
+
disabled: !_.name.trim() || Y.isPending,
|
|
276
|
+
children: Y.isPending ? "Creating…" : "Create account"
|
|
261
277
|
})] })
|
|
262
278
|
] })
|
|
263
279
|
}),
|
|
264
|
-
/* @__PURE__ */
|
|
265
|
-
open: !!
|
|
266
|
-
onOpenChange: (e) => !e &&
|
|
267
|
-
children: /* @__PURE__ */
|
|
268
|
-
/* @__PURE__ */
|
|
269
|
-
/* @__PURE__ */
|
|
270
|
-
form:
|
|
271
|
-
onChange:
|
|
280
|
+
/* @__PURE__ */ x(T, {
|
|
281
|
+
open: !!b,
|
|
282
|
+
onOpenChange: (e) => !e && L(null),
|
|
283
|
+
children: /* @__PURE__ */ S(E, { children: [
|
|
284
|
+
/* @__PURE__ */ S(k, { children: [/* @__PURE__ */ x(A, { children: "Edit account" }), /* @__PURE__ */ x(D, { children: "Update account details." })] }),
|
|
285
|
+
/* @__PURE__ */ x(Oe, {
|
|
286
|
+
form: R,
|
|
287
|
+
onChange: z
|
|
272
288
|
}),
|
|
273
|
-
/* @__PURE__ */
|
|
289
|
+
/* @__PURE__ */ S(O, { children: [/* @__PURE__ */ x(w, {
|
|
274
290
|
variant: "outline",
|
|
275
|
-
onClick: () =>
|
|
291
|
+
onClick: () => L(null),
|
|
276
292
|
children: "Cancel"
|
|
277
|
-
}), /* @__PURE__ */
|
|
278
|
-
onClick:
|
|
279
|
-
disabled: !
|
|
280
|
-
children:
|
|
293
|
+
}), /* @__PURE__ */ x(w, {
|
|
294
|
+
onClick: Re,
|
|
295
|
+
disabled: !R.name.trim() || X.isPending,
|
|
296
|
+
children: X.isPending ? "Saving…" : "Save changes"
|
|
281
297
|
})] })
|
|
282
298
|
] })
|
|
283
299
|
}),
|
|
284
|
-
/* @__PURE__ */
|
|
285
|
-
open: !!
|
|
286
|
-
onOpenChange: (e) => !e &&
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
disabled: Q.isPending,
|
|
295
|
-
children: Q.isPending ? "Archiving…" : "Archive account"
|
|
296
|
-
})] })] })
|
|
300
|
+
/* @__PURE__ */ x(ne, {
|
|
301
|
+
open: !!B,
|
|
302
|
+
onOpenChange: (e) => !e && V(null),
|
|
303
|
+
title: "Archive account?",
|
|
304
|
+
description: B ? `“${B.name}” will be archived and hidden from active lists. This does not delete its history.` : void 0,
|
|
305
|
+
confirmLabel: "Archive account",
|
|
306
|
+
pendingLabel: "Archiving…",
|
|
307
|
+
destructive: !0,
|
|
308
|
+
pending: Ae.isPending,
|
|
309
|
+
onConfirm: ze
|
|
297
310
|
}),
|
|
298
|
-
/* @__PURE__ */
|
|
299
|
-
accountId:
|
|
300
|
-
onClose: () =>
|
|
301
|
-
onRecordTransaction:
|
|
311
|
+
/* @__PURE__ */ x(ke, {
|
|
312
|
+
accountId: s,
|
|
313
|
+
onClose: () => c(void 0),
|
|
314
|
+
onRecordTransaction: Be
|
|
302
315
|
}),
|
|
303
|
-
/* @__PURE__ */
|
|
304
|
-
open:
|
|
305
|
-
onOpenChange:
|
|
306
|
-
children: /* @__PURE__ */
|
|
307
|
-
/* @__PURE__ */
|
|
308
|
-
/* @__PURE__ */
|
|
316
|
+
/* @__PURE__ */ x(T, {
|
|
317
|
+
open: Te,
|
|
318
|
+
onOpenChange: W,
|
|
319
|
+
children: /* @__PURE__ */ S(E, { children: [
|
|
320
|
+
/* @__PURE__ */ S(k, { children: [/* @__PURE__ */ x(A, { children: "Record transaction" }), /* @__PURE__ */ x(D, { children: "Log activity against the selected account." })] }),
|
|
321
|
+
/* @__PURE__ */ S("div", {
|
|
309
322
|
className: "grid gap-4",
|
|
310
323
|
children: [
|
|
311
|
-
/* @__PURE__ */
|
|
324
|
+
/* @__PURE__ */ S("div", {
|
|
312
325
|
className: "grid grid-cols-2 gap-4",
|
|
313
|
-
children: [/* @__PURE__ */
|
|
326
|
+
children: [/* @__PURE__ */ S("div", {
|
|
314
327
|
className: "space-y-2",
|
|
315
|
-
children: [/* @__PURE__ */
|
|
328
|
+
children: [/* @__PURE__ */ x(N, {
|
|
316
329
|
htmlFor: "tx-type",
|
|
317
330
|
children: "Type"
|
|
318
|
-
}), /* @__PURE__ */
|
|
319
|
-
value:
|
|
320
|
-
onValueChange: (e) =>
|
|
331
|
+
}), /* @__PURE__ */ S(P, {
|
|
332
|
+
value: q.type,
|
|
333
|
+
onValueChange: (e) => J((t) => ({
|
|
321
334
|
...t,
|
|
322
335
|
type: e
|
|
323
336
|
})),
|
|
324
|
-
children: [/* @__PURE__ */
|
|
337
|
+
children: [/* @__PURE__ */ x(ve, {
|
|
325
338
|
id: "tx-type",
|
|
326
|
-
children: /* @__PURE__ */
|
|
327
|
-
}), /* @__PURE__ */
|
|
339
|
+
children: /* @__PURE__ */ x(ye, {})
|
|
340
|
+
}), /* @__PURE__ */ x(F, { children: Ee.map((e) => /* @__PURE__ */ x(I, {
|
|
328
341
|
value: e,
|
|
329
342
|
children: e.replace(/_/g, " ")
|
|
330
343
|
}, e)) })]
|
|
331
344
|
})]
|
|
332
|
-
}), /* @__PURE__ */
|
|
345
|
+
}), /* @__PURE__ */ S("div", {
|
|
333
346
|
className: "space-y-2",
|
|
334
|
-
children: [/* @__PURE__ */
|
|
347
|
+
children: [/* @__PURE__ */ x(N, {
|
|
335
348
|
htmlFor: "tx-date",
|
|
336
349
|
children: "Trade date"
|
|
337
|
-
}), /* @__PURE__ */
|
|
350
|
+
}), /* @__PURE__ */ x(M, {
|
|
338
351
|
id: "tx-date",
|
|
339
352
|
type: "date",
|
|
340
|
-
value:
|
|
341
|
-
onChange: (e) =>
|
|
353
|
+
value: q.tradeDate,
|
|
354
|
+
onChange: (e) => J((t) => ({
|
|
342
355
|
...t,
|
|
343
356
|
tradeDate: e.target.value
|
|
344
357
|
}))
|
|
345
358
|
})]
|
|
346
359
|
})]
|
|
347
360
|
}),
|
|
348
|
-
/* @__PURE__ */
|
|
361
|
+
/* @__PURE__ */ S("div", {
|
|
349
362
|
className: "grid grid-cols-2 gap-4",
|
|
350
|
-
children: [/* @__PURE__ */
|
|
363
|
+
children: [/* @__PURE__ */ S("div", {
|
|
351
364
|
className: "space-y-2",
|
|
352
|
-
children: [/* @__PURE__ */
|
|
365
|
+
children: [/* @__PURE__ */ x(N, {
|
|
353
366
|
htmlFor: "tx-symbol",
|
|
354
367
|
children: "Symbol"
|
|
355
|
-
}), /* @__PURE__ */
|
|
368
|
+
}), /* @__PURE__ */ x(M, {
|
|
356
369
|
id: "tx-symbol",
|
|
357
|
-
value:
|
|
358
|
-
onChange: (e) =>
|
|
370
|
+
value: q.symbol,
|
|
371
|
+
onChange: (e) => J((t) => ({
|
|
359
372
|
...t,
|
|
360
373
|
symbol: e.target.value
|
|
361
374
|
})),
|
|
362
375
|
placeholder: "e.g. VOO"
|
|
363
376
|
})]
|
|
364
|
-
}), /* @__PURE__ */
|
|
377
|
+
}), /* @__PURE__ */ S("div", {
|
|
365
378
|
className: "space-y-2",
|
|
366
|
-
children: [
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
379
|
+
children: [
|
|
380
|
+
/* @__PURE__ */ x(N, {
|
|
381
|
+
htmlFor: "tx-amount",
|
|
382
|
+
children: "Amount"
|
|
383
|
+
}),
|
|
384
|
+
/* @__PURE__ */ x(M, {
|
|
385
|
+
id: "tx-amount",
|
|
386
|
+
type: "number",
|
|
387
|
+
min: "0",
|
|
388
|
+
step: "any",
|
|
389
|
+
value: q.amount,
|
|
390
|
+
onChange: (e) => J((t) => ({
|
|
391
|
+
...t,
|
|
392
|
+
amount: e.target.value
|
|
393
|
+
})),
|
|
394
|
+
"aria-invalid": q.amount.trim() !== "" && !$,
|
|
395
|
+
"aria-describedby": "tx-amount-hint"
|
|
396
|
+
}),
|
|
397
|
+
/* @__PURE__ */ x("p", {
|
|
398
|
+
id: "tx-amount-hint",
|
|
399
|
+
className: "text-xs text-text-secondary",
|
|
400
|
+
children: q.amount.trim() !== "" && !$ ? "Enter an amount greater than 0." : "Positive amount; direction is set by the type."
|
|
401
|
+
})
|
|
402
|
+
]
|
|
378
403
|
})]
|
|
379
404
|
}),
|
|
380
|
-
/* @__PURE__ */
|
|
405
|
+
/* @__PURE__ */ S("div", {
|
|
381
406
|
className: "grid grid-cols-3 gap-4",
|
|
382
407
|
children: [
|
|
383
|
-
/* @__PURE__ */
|
|
408
|
+
/* @__PURE__ */ S("div", {
|
|
384
409
|
className: "space-y-2",
|
|
385
|
-
children: [/* @__PURE__ */
|
|
410
|
+
children: [/* @__PURE__ */ x(N, {
|
|
386
411
|
htmlFor: "tx-qty",
|
|
387
412
|
children: "Quantity"
|
|
388
|
-
}), /* @__PURE__ */
|
|
413
|
+
}), /* @__PURE__ */ x(M, {
|
|
389
414
|
id: "tx-qty",
|
|
390
415
|
type: "number",
|
|
391
|
-
value:
|
|
392
|
-
onChange: (e) =>
|
|
416
|
+
value: q.quantity,
|
|
417
|
+
onChange: (e) => J((t) => ({
|
|
393
418
|
...t,
|
|
394
419
|
quantity: e.target.value
|
|
395
420
|
}))
|
|
396
421
|
})]
|
|
397
422
|
}),
|
|
398
|
-
/* @__PURE__ */
|
|
423
|
+
/* @__PURE__ */ S("div", {
|
|
399
424
|
className: "space-y-2",
|
|
400
|
-
children: [/* @__PURE__ */
|
|
425
|
+
children: [/* @__PURE__ */ x(N, {
|
|
401
426
|
htmlFor: "tx-price",
|
|
402
427
|
children: "Price"
|
|
403
|
-
}), /* @__PURE__ */
|
|
428
|
+
}), /* @__PURE__ */ x(M, {
|
|
404
429
|
id: "tx-price",
|
|
405
430
|
type: "number",
|
|
406
|
-
value:
|
|
407
|
-
onChange: (e) =>
|
|
431
|
+
value: q.price,
|
|
432
|
+
onChange: (e) => J((t) => ({
|
|
408
433
|
...t,
|
|
409
434
|
price: e.target.value
|
|
410
435
|
}))
|
|
411
436
|
})]
|
|
412
437
|
}),
|
|
413
|
-
/* @__PURE__ */
|
|
438
|
+
/* @__PURE__ */ S("div", {
|
|
414
439
|
className: "space-y-2",
|
|
415
|
-
children: [/* @__PURE__ */
|
|
440
|
+
children: [/* @__PURE__ */ x(N, {
|
|
416
441
|
htmlFor: "tx-fee",
|
|
417
442
|
children: "Fee"
|
|
418
|
-
}), /* @__PURE__ */
|
|
443
|
+
}), /* @__PURE__ */ x(M, {
|
|
419
444
|
id: "tx-fee",
|
|
420
445
|
type: "number",
|
|
421
|
-
value:
|
|
422
|
-
onChange: (e) =>
|
|
446
|
+
value: q.fee,
|
|
447
|
+
onChange: (e) => J((t) => ({
|
|
423
448
|
...t,
|
|
424
449
|
fee: e.target.value
|
|
425
450
|
}))
|
|
@@ -427,15 +452,15 @@ function W() {
|
|
|
427
452
|
})
|
|
428
453
|
]
|
|
429
454
|
}),
|
|
430
|
-
/* @__PURE__ */
|
|
455
|
+
/* @__PURE__ */ S("div", {
|
|
431
456
|
className: "space-y-2",
|
|
432
|
-
children: [/* @__PURE__ */
|
|
457
|
+
children: [/* @__PURE__ */ x(N, {
|
|
433
458
|
htmlFor: "tx-notes",
|
|
434
459
|
children: "Notes"
|
|
435
|
-
}), /* @__PURE__ */
|
|
460
|
+
}), /* @__PURE__ */ x(we, {
|
|
436
461
|
id: "tx-notes",
|
|
437
|
-
value:
|
|
438
|
-
onChange: (e) =>
|
|
462
|
+
value: q.notes,
|
|
463
|
+
onChange: (e) => J((t) => ({
|
|
439
464
|
...t,
|
|
440
465
|
notes: e.target.value
|
|
441
466
|
})),
|
|
@@ -444,30 +469,30 @@ function W() {
|
|
|
444
469
|
})
|
|
445
470
|
]
|
|
446
471
|
}),
|
|
447
|
-
/* @__PURE__ */
|
|
472
|
+
/* @__PURE__ */ S(O, { children: [/* @__PURE__ */ x(w, {
|
|
448
473
|
variant: "outline",
|
|
449
|
-
onClick: () =>
|
|
474
|
+
onClick: () => W(!1),
|
|
450
475
|
children: "Cancel"
|
|
451
|
-
}), /* @__PURE__ */
|
|
452
|
-
onClick:
|
|
453
|
-
disabled: !
|
|
454
|
-
children:
|
|
476
|
+
}), /* @__PURE__ */ x(w, {
|
|
477
|
+
onClick: He,
|
|
478
|
+
disabled: !Ve || Z.isPending,
|
|
479
|
+
children: Z.isPending ? "Saving…" : "Record transaction"
|
|
455
480
|
})] })
|
|
456
481
|
] })
|
|
457
482
|
})
|
|
458
483
|
]
|
|
459
484
|
});
|
|
460
485
|
}
|
|
461
|
-
function
|
|
462
|
-
return /* @__PURE__ */
|
|
486
|
+
function Oe({ form: e, onChange: t }) {
|
|
487
|
+
return /* @__PURE__ */ S("div", {
|
|
463
488
|
className: "grid gap-4",
|
|
464
489
|
children: [
|
|
465
|
-
/* @__PURE__ */
|
|
490
|
+
/* @__PURE__ */ S("div", {
|
|
466
491
|
className: "space-y-2",
|
|
467
|
-
children: [/* @__PURE__ */
|
|
492
|
+
children: [/* @__PURE__ */ x(N, {
|
|
468
493
|
htmlFor: "acct-name",
|
|
469
494
|
children: "Name"
|
|
470
|
-
}), /* @__PURE__ */
|
|
495
|
+
}), /* @__PURE__ */ x(M, {
|
|
471
496
|
id: "acct-name",
|
|
472
497
|
value: e.name,
|
|
473
498
|
onChange: (e) => t((t) => ({
|
|
@@ -477,33 +502,33 @@ function Te({ form: e, onChange: t }) {
|
|
|
477
502
|
placeholder: "e.g. Everyday Checking"
|
|
478
503
|
})]
|
|
479
504
|
}),
|
|
480
|
-
/* @__PURE__ */
|
|
505
|
+
/* @__PURE__ */ S("div", {
|
|
481
506
|
className: "grid grid-cols-2 gap-4",
|
|
482
|
-
children: [/* @__PURE__ */
|
|
507
|
+
children: [/* @__PURE__ */ S("div", {
|
|
483
508
|
className: "space-y-2",
|
|
484
|
-
children: [/* @__PURE__ */
|
|
509
|
+
children: [/* @__PURE__ */ x(N, {
|
|
485
510
|
htmlFor: "acct-type",
|
|
486
511
|
children: "Type"
|
|
487
|
-
}), /* @__PURE__ */
|
|
512
|
+
}), /* @__PURE__ */ S(P, {
|
|
488
513
|
value: e.type,
|
|
489
514
|
onValueChange: (e) => t((t) => ({
|
|
490
515
|
...t,
|
|
491
516
|
type: e
|
|
492
517
|
})),
|
|
493
|
-
children: [/* @__PURE__ */
|
|
518
|
+
children: [/* @__PURE__ */ x(ve, {
|
|
494
519
|
id: "acct-type",
|
|
495
|
-
children: /* @__PURE__ */
|
|
496
|
-
}), /* @__PURE__ */
|
|
520
|
+
children: /* @__PURE__ */ x(ye, {})
|
|
521
|
+
}), /* @__PURE__ */ x(F, { children: Te.map((e) => /* @__PURE__ */ x(I, {
|
|
497
522
|
value: e,
|
|
498
523
|
children: e.replace(/_/g, " ")
|
|
499
524
|
}, e)) })]
|
|
500
525
|
})]
|
|
501
|
-
}), /* @__PURE__ */
|
|
526
|
+
}), /* @__PURE__ */ S("div", {
|
|
502
527
|
className: "space-y-2",
|
|
503
|
-
children: [/* @__PURE__ */
|
|
528
|
+
children: [/* @__PURE__ */ x(N, {
|
|
504
529
|
htmlFor: "acct-currency",
|
|
505
530
|
children: "Currency"
|
|
506
|
-
}), /* @__PURE__ */
|
|
531
|
+
}), /* @__PURE__ */ x(M, {
|
|
507
532
|
id: "acct-currency",
|
|
508
533
|
value: e.currency,
|
|
509
534
|
onChange: (e) => t((t) => ({
|
|
@@ -514,12 +539,12 @@ function Te({ form: e, onChange: t }) {
|
|
|
514
539
|
})]
|
|
515
540
|
})]
|
|
516
541
|
}),
|
|
517
|
-
/* @__PURE__ */
|
|
542
|
+
/* @__PURE__ */ S("div", {
|
|
518
543
|
className: "space-y-2",
|
|
519
|
-
children: [/* @__PURE__ */
|
|
544
|
+
children: [/* @__PURE__ */ x(N, {
|
|
520
545
|
htmlFor: "acct-institution",
|
|
521
546
|
children: "Institution"
|
|
522
|
-
}), /* @__PURE__ */
|
|
547
|
+
}), /* @__PURE__ */ x(M, {
|
|
523
548
|
id: "acct-institution",
|
|
524
549
|
value: e.institution,
|
|
525
550
|
onChange: (e) => t((t) => ({
|
|
@@ -529,14 +554,14 @@ function Te({ form: e, onChange: t }) {
|
|
|
529
554
|
placeholder: "e.g. Chase"
|
|
530
555
|
})]
|
|
531
556
|
}),
|
|
532
|
-
/* @__PURE__ */
|
|
557
|
+
/* @__PURE__ */ S("div", {
|
|
533
558
|
className: "grid grid-cols-2 gap-4",
|
|
534
|
-
children: [/* @__PURE__ */
|
|
559
|
+
children: [/* @__PURE__ */ S("div", {
|
|
535
560
|
className: "space-y-2",
|
|
536
|
-
children: [/* @__PURE__ */
|
|
561
|
+
children: [/* @__PURE__ */ x(N, {
|
|
537
562
|
htmlFor: "acct-balance",
|
|
538
563
|
children: "Cash balance"
|
|
539
|
-
}), /* @__PURE__ */
|
|
564
|
+
}), /* @__PURE__ */ x(M, {
|
|
540
565
|
id: "acct-balance",
|
|
541
566
|
type: "number",
|
|
542
567
|
value: e.cashBalance,
|
|
@@ -545,12 +570,12 @@ function Te({ form: e, onChange: t }) {
|
|
|
545
570
|
cashBalance: e.target.value
|
|
546
571
|
}))
|
|
547
572
|
})]
|
|
548
|
-
}), /* @__PURE__ */
|
|
573
|
+
}), /* @__PURE__ */ S("div", {
|
|
549
574
|
className: "space-y-2",
|
|
550
|
-
children: [/* @__PURE__ */
|
|
575
|
+
children: [/* @__PURE__ */ x(N, {
|
|
551
576
|
htmlFor: "acct-mask",
|
|
552
577
|
children: "Account mask"
|
|
553
|
-
}), /* @__PURE__ */
|
|
578
|
+
}), /* @__PURE__ */ x(M, {
|
|
554
579
|
id: "acct-mask",
|
|
555
580
|
value: e.accountMask,
|
|
556
581
|
onChange: (e) => t((t) => ({
|
|
@@ -560,147 +585,175 @@ function Te({ form: e, onChange: t }) {
|
|
|
560
585
|
placeholder: "Last 4 digits"
|
|
561
586
|
})]
|
|
562
587
|
})]
|
|
588
|
+
}),
|
|
589
|
+
/* @__PURE__ */ x(c, {
|
|
590
|
+
value: e.householdId,
|
|
591
|
+
onChange: (e) => t((t) => ({
|
|
592
|
+
...t,
|
|
593
|
+
householdId: e
|
|
594
|
+
}))
|
|
563
595
|
})
|
|
564
596
|
]
|
|
565
597
|
});
|
|
566
598
|
}
|
|
567
|
-
function
|
|
568
|
-
let { data: i, isLoading:
|
|
569
|
-
return /* @__PURE__ */
|
|
599
|
+
function ke({ accountId: t, onClose: n, onRecordTransaction: r }) {
|
|
600
|
+
let { data: i, isLoading: ee, isError: te, refetch: ne } = e(t), c = a(t ? { accountId: t } : {}), d = t ? c.items : [];
|
|
601
|
+
return /* @__PURE__ */ x(L, {
|
|
570
602
|
open: !!t,
|
|
571
603
|
onOpenChange: (e) => !e && n(),
|
|
572
|
-
children: /* @__PURE__ */
|
|
604
|
+
children: /* @__PURE__ */ S(R, {
|
|
573
605
|
className: "w-full overflow-y-auto sm:max-w-lg",
|
|
574
|
-
children: [/* @__PURE__ */
|
|
606
|
+
children: [/* @__PURE__ */ S(B, { children: [/* @__PURE__ */ x(V, { children: i?.name ?? "Account" }), /* @__PURE__ */ x(z, { children: i ? `${i.institution ?? "Manual account"} · ${i.type.replace(/_/g, " ")}` : "Loading account details…" })] }), ee ? /* @__PURE__ */ x("div", {
|
|
575
607
|
className: "mt-6",
|
|
576
|
-
children: /* @__PURE__ */
|
|
577
|
-
}) :
|
|
608
|
+
children: /* @__PURE__ */ x(f, { rows: 3 })
|
|
609
|
+
}) : te ? /* @__PURE__ */ x("div", {
|
|
578
610
|
className: "mt-6",
|
|
579
|
-
children: /* @__PURE__ */
|
|
580
|
-
}) : i ? /* @__PURE__ */
|
|
611
|
+
children: /* @__PURE__ */ x(u, { onRetry: () => ne() })
|
|
612
|
+
}) : i ? /* @__PURE__ */ S("div", {
|
|
581
613
|
className: "mt-6 space-y-6",
|
|
582
614
|
children: [
|
|
583
|
-
/* @__PURE__ */
|
|
615
|
+
/* @__PURE__ */ S("div", {
|
|
584
616
|
className: "grid grid-cols-2 gap-4",
|
|
585
|
-
children: [/* @__PURE__ */
|
|
617
|
+
children: [/* @__PURE__ */ S("div", {
|
|
586
618
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
587
|
-
children: [/* @__PURE__ */
|
|
619
|
+
children: [/* @__PURE__ */ x("p", {
|
|
588
620
|
className: "text-xs text-text-secondary",
|
|
589
621
|
children: "Cash balance"
|
|
590
|
-
}), /* @__PURE__ */
|
|
622
|
+
}), /* @__PURE__ */ x("p", {
|
|
591
623
|
className: "text-xl font-semibold text-text-primary",
|
|
592
|
-
children:
|
|
624
|
+
children: m(i.cashBalance, i.currency)
|
|
593
625
|
})]
|
|
594
|
-
}), /* @__PURE__ */
|
|
626
|
+
}), /* @__PURE__ */ S("div", {
|
|
595
627
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
596
|
-
children: [/* @__PURE__ */
|
|
628
|
+
children: [/* @__PURE__ */ x("p", {
|
|
597
629
|
className: "text-xs text-text-secondary",
|
|
598
630
|
children: "Status"
|
|
599
|
-
}), /* @__PURE__ */
|
|
600
|
-
variant:
|
|
631
|
+
}), /* @__PURE__ */ x(C, {
|
|
632
|
+
variant: ie(i.status),
|
|
601
633
|
children: i.status
|
|
602
634
|
})]
|
|
603
635
|
})]
|
|
604
636
|
}),
|
|
605
|
-
/* @__PURE__ */
|
|
637
|
+
/* @__PURE__ */ S("div", {
|
|
638
|
+
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
639
|
+
children: [/* @__PURE__ */ x("p", {
|
|
640
|
+
className: "text-xs text-text-secondary",
|
|
641
|
+
children: "Owner"
|
|
642
|
+
}), /* @__PURE__ */ x(s, {
|
|
643
|
+
id: i.ownerId,
|
|
644
|
+
className: "text-sm font-medium text-text-primary"
|
|
645
|
+
})]
|
|
646
|
+
}),
|
|
647
|
+
/* @__PURE__ */ S("div", {
|
|
606
648
|
className: "space-y-3",
|
|
607
|
-
children: [/* @__PURE__ */
|
|
649
|
+
children: [/* @__PURE__ */ x("h3", {
|
|
608
650
|
className: "text-sm font-semibold text-text-primary",
|
|
609
651
|
children: "Holdings"
|
|
610
|
-
}), i.holdings.length === 0 ? /* @__PURE__ */
|
|
652
|
+
}), i.holdings.length === 0 ? /* @__PURE__ */ x(l, {
|
|
611
653
|
title: "No holdings",
|
|
612
654
|
description: "This account has no positions recorded yet."
|
|
613
|
-
}) : /* @__PURE__ */
|
|
655
|
+
}) : /* @__PURE__ */ x("div", {
|
|
614
656
|
className: "space-y-2",
|
|
615
|
-
children: i.holdings.map((e) => /* @__PURE__ */
|
|
657
|
+
children: i.holdings.map((e) => /* @__PURE__ */ S("div", {
|
|
616
658
|
className: "flex items-center justify-between rounded-lg border border-border-subtle bg-bg-surface p-3",
|
|
617
|
-
children: [/* @__PURE__ */
|
|
659
|
+
children: [/* @__PURE__ */ S("div", {
|
|
618
660
|
className: "min-w-0",
|
|
619
|
-
children: [/* @__PURE__ */
|
|
661
|
+
children: [/* @__PURE__ */ x("p", {
|
|
620
662
|
className: "truncate text-sm font-medium text-text-primary",
|
|
621
663
|
children: e.symbol
|
|
622
|
-
}), e.name ? /* @__PURE__ */
|
|
664
|
+
}), e.name ? /* @__PURE__ */ x("p", {
|
|
623
665
|
className: "truncate text-xs text-text-secondary",
|
|
624
666
|
children: e.name
|
|
625
667
|
}) : null]
|
|
626
|
-
}), /* @__PURE__ */
|
|
668
|
+
}), /* @__PURE__ */ x("span", {
|
|
627
669
|
className: "text-sm font-semibold text-text-primary",
|
|
628
|
-
children:
|
|
670
|
+
children: m(e.marketValue, e.currency)
|
|
629
671
|
})]
|
|
630
672
|
}, e.id))
|
|
631
673
|
})]
|
|
632
674
|
}),
|
|
633
|
-
/* @__PURE__ */
|
|
675
|
+
/* @__PURE__ */ S("div", {
|
|
634
676
|
className: "space-y-3",
|
|
635
|
-
children: [/* @__PURE__ */
|
|
677
|
+
children: [/* @__PURE__ */ S("div", {
|
|
636
678
|
className: "flex items-center justify-between",
|
|
637
|
-
children: [/* @__PURE__ */
|
|
679
|
+
children: [/* @__PURE__ */ x("h3", {
|
|
638
680
|
className: "text-sm font-semibold text-text-primary",
|
|
639
681
|
children: "Recent transactions"
|
|
640
|
-
}), /* @__PURE__ */
|
|
682
|
+
}), /* @__PURE__ */ S(w, {
|
|
641
683
|
size: "sm",
|
|
642
684
|
variant: "outline",
|
|
643
685
|
onClick: r,
|
|
644
|
-
children: [/* @__PURE__ */
|
|
686
|
+
children: [/* @__PURE__ */ x(b, {
|
|
645
687
|
className: "size-4",
|
|
646
688
|
"aria-hidden": "true"
|
|
647
689
|
}), "Record"]
|
|
648
690
|
})]
|
|
649
|
-
}),
|
|
650
|
-
icon: /* @__PURE__ */
|
|
691
|
+
}), c.isLoading ? /* @__PURE__ */ x(f, { rows: 2 }) : c.isError ? /* @__PURE__ */ x(u, { onRetry: () => c.refetch() }) : d.length === 0 ? /* @__PURE__ */ x(l, {
|
|
692
|
+
icon: /* @__PURE__ */ x(b, {
|
|
651
693
|
className: "size-6",
|
|
652
694
|
"aria-hidden": "true"
|
|
653
695
|
}),
|
|
654
696
|
title: "No transactions",
|
|
655
697
|
description: "Record a transaction to see activity here.",
|
|
656
|
-
action: /* @__PURE__ */
|
|
698
|
+
action: /* @__PURE__ */ S(w, {
|
|
657
699
|
size: "sm",
|
|
658
700
|
onClick: r,
|
|
659
|
-
children: [/* @__PURE__ */
|
|
701
|
+
children: [/* @__PURE__ */ x(y, {
|
|
660
702
|
className: "size-4",
|
|
661
703
|
"aria-hidden": "true"
|
|
662
704
|
}), "Record transaction"]
|
|
663
705
|
})
|
|
664
|
-
}) : /* @__PURE__ */
|
|
706
|
+
}) : /* @__PURE__ */ S("div", {
|
|
665
707
|
className: "space-y-2",
|
|
666
|
-
children:
|
|
667
|
-
let t =
|
|
668
|
-
return /* @__PURE__ */
|
|
708
|
+
children: [d.map((e) => {
|
|
709
|
+
let t = W(e.type), n = t ? v : _, r = t ? "text-status-success-text" : "text-status-error-text";
|
|
710
|
+
return /* @__PURE__ */ S("div", {
|
|
669
711
|
className: "flex items-center justify-between rounded-lg border border-border-subtle bg-bg-surface p-3",
|
|
670
|
-
children: [/* @__PURE__ */
|
|
712
|
+
children: [/* @__PURE__ */ S("div", {
|
|
671
713
|
className: "min-w-0",
|
|
672
|
-
children: [/* @__PURE__ */
|
|
714
|
+
children: [/* @__PURE__ */ S("div", {
|
|
673
715
|
className: "flex items-center gap-2",
|
|
674
|
-
children: [/* @__PURE__ */
|
|
716
|
+
children: [/* @__PURE__ */ x(C, {
|
|
675
717
|
variant: "outline",
|
|
676
718
|
children: e.type.replace(/_/g, " ")
|
|
677
|
-
}), e.symbol ? /* @__PURE__ */
|
|
719
|
+
}), e.symbol ? /* @__PURE__ */ x("span", {
|
|
678
720
|
className: "truncate text-xs text-text-secondary",
|
|
679
721
|
children: e.symbol
|
|
680
722
|
}) : null]
|
|
681
|
-
}), /* @__PURE__ */
|
|
723
|
+
}), /* @__PURE__ */ x("p", {
|
|
682
724
|
className: "mt-1 text-xs text-text-secondary",
|
|
683
|
-
children:
|
|
725
|
+
children: p(e.tradeDate)
|
|
684
726
|
})]
|
|
685
|
-
}), /* @__PURE__ */
|
|
727
|
+
}), /* @__PURE__ */ S("span", {
|
|
686
728
|
className: `inline-flex items-center gap-1 text-sm font-semibold ${r}`,
|
|
687
729
|
children: [
|
|
688
|
-
/* @__PURE__ */
|
|
730
|
+
/* @__PURE__ */ x(n, {
|
|
689
731
|
className: "size-4",
|
|
690
732
|
"aria-hidden": "true"
|
|
691
733
|
}),
|
|
692
734
|
t ? "+" : "−",
|
|
693
|
-
|
|
735
|
+
m(Math.abs(e.amount), e.currency)
|
|
694
736
|
]
|
|
695
737
|
})]
|
|
696
738
|
}, e.id);
|
|
697
|
-
})
|
|
739
|
+
}), /* @__PURE__ */ x(o, {
|
|
740
|
+
hasMore: c.hasMore,
|
|
741
|
+
onClick: c.loadMore,
|
|
742
|
+
loading: c.isFetchingNextPage
|
|
743
|
+
})]
|
|
698
744
|
})]
|
|
745
|
+
}),
|
|
746
|
+
/* @__PURE__ */ x("div", {
|
|
747
|
+
className: "space-y-3",
|
|
748
|
+
children: /* @__PURE__ */ x(h, {
|
|
749
|
+
entityType: "brainyrich-account",
|
|
750
|
+
entityId: i.id
|
|
751
|
+
})
|
|
699
752
|
})
|
|
700
753
|
]
|
|
701
|
-
}) : /* @__PURE__ */
|
|
754
|
+
}) : /* @__PURE__ */ x("div", {
|
|
702
755
|
className: "mt-6",
|
|
703
|
-
children: /* @__PURE__ */
|
|
756
|
+
children: /* @__PURE__ */ x(l, {
|
|
704
757
|
title: "Account not found",
|
|
705
758
|
description: "This account is no longer available."
|
|
706
759
|
})
|
|
@@ -709,6 +762,6 @@ function Ee({ accountId: t, onClose: n, onRecordTransaction: r }) {
|
|
|
709
762
|
});
|
|
710
763
|
}
|
|
711
764
|
//#endregion
|
|
712
|
-
export {
|
|
765
|
+
export { q as AccountsPage };
|
|
713
766
|
|
|
714
767
|
//# sourceMappingURL=AccountsPage.js.map
|