@burdenoff/microfe-brainyrich 2026.525.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.
Files changed (66) hide show
  1. package/dist/brainyrich/BrainyRichRoot.js +55 -90
  2. package/dist/brainyrich/BrainyRichRoot.js.map +1 -1
  3. package/dist/brainyrich/BrainyRichRoutes.js +15 -35
  4. package/dist/brainyrich/BrainyRichRoutes.js.map +1 -1
  5. package/dist/brainyrich/components/ActorName.js +38 -0
  6. package/dist/brainyrich/components/ActorName.js.map +1 -0
  7. package/dist/brainyrich/components/ConfirmDialog.js +25 -0
  8. package/dist/brainyrich/components/ConfirmDialog.js.map +1 -0
  9. package/dist/brainyrich/components/LoadMore.js +24 -0
  10. package/dist/brainyrich/components/LoadMore.js.map +1 -0
  11. package/dist/brainyrich/components/index.js +5 -0
  12. package/dist/brainyrich/components/notify.js +38 -0
  13. package/dist/brainyrich/components/notify.js.map +1 -0
  14. package/dist/brainyrich/components/pickers.js +232 -0
  15. package/dist/brainyrich/components/pickers.js.map +1 -0
  16. package/dist/brainyrich/components/reuse/CommentThread.js +208 -0
  17. package/dist/brainyrich/components/reuse/CommentThread.js.map +1 -0
  18. package/dist/brainyrich/components/reuse/DocumentsPanel.js +237 -0
  19. package/dist/brainyrich/components/reuse/DocumentsPanel.js.map +1 -0
  20. package/dist/brainyrich/components/reuse/TagField.js +206 -0
  21. package/dist/brainyrich/components/reuse/TagField.js.map +1 -0
  22. package/dist/brainyrich/components/reuse/transport.js +24 -0
  23. package/dist/brainyrich/components/reuse/transport.js.map +1 -0
  24. package/dist/brainyrich/hooks/useBrainyRichApi.js +815 -0
  25. package/dist/brainyrich/hooks/useBrainyRichApi.js.map +1 -0
  26. package/dist/brainyrich/index.js +0 -1
  27. package/dist/brainyrich/pages/AccountsPage.js +743 -160
  28. package/dist/brainyrich/pages/AccountsPage.js.map +1 -1
  29. package/dist/brainyrich/pages/AiAssistantPage.js +556 -363
  30. package/dist/brainyrich/pages/AiAssistantPage.js.map +1 -1
  31. package/dist/brainyrich/pages/AnalyticsPage.js +601 -268
  32. package/dist/brainyrich/pages/AnalyticsPage.js.map +1 -1
  33. package/dist/brainyrich/pages/DashboardPage.js +375 -231
  34. package/dist/brainyrich/pages/DashboardPage.js.map +1 -1
  35. package/dist/brainyrich/pages/FamilyPage.js +599 -337
  36. package/dist/brainyrich/pages/FamilyPage.js.map +1 -1
  37. package/dist/brainyrich/pages/GoalsPage.js +810 -141
  38. package/dist/brainyrich/pages/GoalsPage.js.map +1 -1
  39. package/dist/brainyrich/pages/InvestmentsPage.js +410 -311
  40. package/dist/brainyrich/pages/InvestmentsPage.js.map +1 -1
  41. package/dist/brainyrich/pages/PortfoliosPage.js +867 -156
  42. package/dist/brainyrich/pages/PortfoliosPage.js.map +1 -1
  43. package/dist/brainyrich/pages/ReportsPage.js +421 -251
  44. package/dist/brainyrich/pages/ReportsPage.js.map +1 -1
  45. package/dist/brainyrich/pages/RiskPage.js +557 -194
  46. package/dist/brainyrich/pages/RiskPage.js.map +1 -1
  47. package/dist/brainyrich/pages/TaxPage.js +655 -221
  48. package/dist/brainyrich/pages/TaxPage.js.map +1 -1
  49. package/dist/brainyrich/pages/_shared.js +222 -41
  50. package/dist/brainyrich/pages/_shared.js.map +1 -1
  51. package/dist/index.js +2 -3
  52. package/dist/node_modules/sonner/dist/index.js +163 -0
  53. package/dist/node_modules/sonner/dist/index.js.map +1 -0
  54. package/package.json +3 -2
  55. package/dist/brainyrich/pages/AdvisorsPage.js +0 -375
  56. package/dist/brainyrich/pages/AdvisorsPage.js.map +0 -1
  57. package/dist/brainyrich/pages/AssistantPage.js +0 -332
  58. package/dist/brainyrich/pages/AssistantPage.js.map +0 -1
  59. package/dist/brainyrich/pages/EstatePage.js +0 -269
  60. package/dist/brainyrich/pages/EstatePage.js.map +0 -1
  61. package/dist/brainyrich/pages/InsurancePage.js +0 -181
  62. package/dist/brainyrich/pages/InsurancePage.js.map +0 -1
  63. package/dist/brainyrich/pages/MarketplacePage.js +0 -450
  64. package/dist/brainyrich/pages/MarketplacePage.js.map +0 -1
  65. package/dist/brainyrich/store/brainyrichStore.js +0 -272
  66. package/dist/brainyrich/store/brainyrichStore.js.map +0 -1
@@ -1,258 +1,402 @@
1
1
  import { tWithFallback as e } from "../utils/i18n.js";
2
- import { useBrainyRichStore as t } from "../store/brainyrichStore.js";
3
- import { KpiGrid as n, SectionShell as r, formatMoney as i, statusBadgeVariant as a } from "./_shared.js";
4
- import { ArrowDownRight as o, ArrowUpRight as s, BarChart3 as c, Bell as l, Briefcase as u, Target as d, TrendingUp as f, Wallet as p } from "lucide-react";
5
- import { useI18n as m } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
6
- import { jsx as h, jsxs as g } from "react/jsx-runtime";
7
- import { Badge as _, Button as v, Card as y, CardContent as b, CardDescription as x, CardHeader as S, CardTitle as C } from "@burdenoff/fe-libs/ui";
2
+ import { useAcknowledgeInsight as t, useCreateAccount as n, useDismissInsight as r, useGoals as i, useInsights as a, useNetWorthSummary as o, usePortfolios as s, useResolveInsight as c } from "../hooks/useBrainyRichApi.js";
3
+ import { ConfirmDialog as l } from "../components/ConfirmDialog.js";
4
+ import { HouseholdPicker as u } from "../components/pickers.js";
5
+ import "../components/index.js";
6
+ import { AllocationBars as d, EmptyState as f, ErrorState as p, KpiGrid as m, LoadingState as h, SectionShell as g, formatDate as _, formatMoney as v, statusBadgeVariant as y } from "./_shared.js";
7
+ import { useMemo as b, useState as x } from "react";
8
+ import { Bell as S, Briefcase as C, Check as w, CircleCheck as T, MoreHorizontal as E, PlusCircle as D, Target as O, Wallet as k, X as A } from "lucide-react";
9
+ import { useI18n as j } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
10
+ import { jsx as M, jsxs as N } from "react/jsx-runtime";
11
+ import { Badge as P, Button as F, Card as I, CardContent as L, CardDescription as R, CardHeader as z, CardTitle as B, Dialog as V, DialogContent as H, DialogDescription as U, DialogFooter as W, DialogHeader as G, DialogTitle as K, DropdownMenu as q, DropdownMenuContent as J, DropdownMenuItem as Y, DropdownMenuTrigger as X, Input as Z, Label as Q, Select as $, SelectContent as ee, SelectItem as te, SelectTrigger as ne, SelectValue as re } from "@burdenoff/fe-libs/ui";
8
12
  //#region src/brainyrich/pages/DashboardPage.tsx
9
- var w = [
10
- {
11
- name: "S&P 500",
12
- value: "5,321.08",
13
- change: "+1.2%",
14
- positive: !0
15
- },
16
- {
17
- name: "NIFTY 50",
18
- value: "23,851.40",
19
- change: "+0.8%",
20
- positive: !0
21
- },
22
- {
23
- name: "NASDAQ",
24
- value: "16,742.39",
25
- change: "-0.3%",
26
- positive: !1
27
- }
13
+ var ie = [
14
+ "BANK",
15
+ "BROKERAGE",
16
+ "RETIREMENT",
17
+ "CASH",
18
+ "CRYPTO",
19
+ "REAL_ESTATE",
20
+ "ALTERNATIVE",
21
+ "LIABILITY"
28
22
  ];
29
- function T() {
30
- let { t: T } = m(), { metrics: E, workItems: D, portfolios: O, holdings: k, goals: A } = t(), j = (t, n, r) => e(T, t, n, r), M = E.map((e) => ({
31
- ...e,
32
- label: e.label === "Net Worth" ? j("brainyrich.dashboard.metrics.netWorth", "Net Worth") : e.label === "Invested Assets" ? j("brainyrich.dashboard.metrics.investedAssets", "Invested Assets") : e.label === "Liquidity" ? j("brainyrich.dashboard.metrics.liquidity", "Liquidity") : e.label === "Goal Completion" ? j("brainyrich.dashboard.metrics.goalCompletion", "Goal Completion") : e.label
33
- })), N = O.reduce((e, t) => e + t.value, 0), P = A.length ? Math.round(A.reduce((e, t) => e + t.currentAmount / t.targetAmount * 100, 0) / A.length) : 0;
34
- return /* @__PURE__ */ g(r, {
35
- title: j("brainyrich.dashboard.title", "Wealth Dashboard"),
36
- description: j("brainyrich.dashboard.description", "Your consolidated financial overview at a glance"),
37
- actionLabel: j("brainyrich.dashboard.actions.healthCheck", "Run Health Check"),
38
- badges: [j("brainyrich.dashboard.badges.liveData", "Live Data")],
23
+ function ae() {
24
+ let { t } = j(), n = (n, r, i) => e(t, n, r, i), r = o(), c = s(), l = i(), u = a({ status: "OPEN" }), x = r.data, w = x?.currency ?? "USD", E = x ? [
25
+ {
26
+ label: n("brainyrich.dashboard.metrics.netWorth", "Net Worth"),
27
+ value: v(x.totalNetWorth, w)
28
+ },
29
+ {
30
+ label: n("brainyrich.dashboard.metrics.investedAssets", "Invested Assets"),
31
+ value: v(x.totalMarketValue, w)
32
+ },
33
+ {
34
+ label: n("brainyrich.dashboard.metrics.liquidity", "Cash & Liquidity"),
35
+ value: v(x.totalCash, w)
36
+ },
37
+ {
38
+ label: n("brainyrich.dashboard.metrics.accounts", "Linked Accounts"),
39
+ value: String(x.accountCount)
40
+ }
41
+ ] : [], D = b(() => {
42
+ if (!x) return [];
43
+ let e = x.byAssetClass.reduce((e, t) => e + t.marketValue, 0);
44
+ return e <= 0 ? [] : x.byAssetClass.slice().sort((e, t) => t.marketValue - e.marketValue).map((t) => ({
45
+ label: t.assetClass.replace(/_/g, " "),
46
+ value: t.marketValue / e * 100,
47
+ caption: v(t.marketValue, w)
48
+ }));
49
+ }, [x, w]), A = c.data.slice(0, 5), F = l.data.slice(0, 5), V = u.data.slice(0, 6);
50
+ return /* @__PURE__ */ N(g, {
51
+ title: n("brainyrich.dashboard.title", "Wealth Dashboard"),
52
+ description: n("brainyrich.dashboard.description", "Your consolidated financial overview at a glance"),
53
+ actions: /* @__PURE__ */ M(se, { translate: n }),
39
54
  children: [
40
- /* @__PURE__ */ h(n, { items: M }),
41
- /* @__PURE__ */ g("div", {
55
+ r.isLoading ? /* @__PURE__ */ M(h, { rows: 1 }) : r.isError ? /* @__PURE__ */ M(p, {
56
+ title: n("brainyrich.dashboard.netWorthError", "Could not load net worth"),
57
+ onRetry: () => r.refetch()
58
+ }) : x ? /* @__PURE__ */ M(m, { items: E }) : /* @__PURE__ */ M(f, {
59
+ icon: /* @__PURE__ */ M(k, {
60
+ className: "size-6",
61
+ "aria-hidden": "true"
62
+ }),
63
+ title: n("brainyrich.dashboard.noSummary", "No financial data yet"),
64
+ description: n("brainyrich.dashboard.noSummaryDesc", "Link your first account to see your net worth here.")
65
+ }),
66
+ /* @__PURE__ */ N("div", {
42
67
  className: "grid gap-6 lg:grid-cols-3",
43
- children: [/* @__PURE__ */ g(y, {
68
+ children: [/* @__PURE__ */ N(I, {
44
69
  className: "lg:col-span-2",
45
- children: [/* @__PURE__ */ g(S, { children: [/* @__PURE__ */ g(C, {
70
+ children: [/* @__PURE__ */ N(z, { children: [/* @__PURE__ */ N(B, {
46
71
  className: "flex items-center gap-2",
47
- children: [/* @__PURE__ */ h(u, { className: "h-5 w-5" }), j("brainyrich.dashboard.sections.portfolioSnapshot", "Portfolio Snapshot")]
48
- }), /* @__PURE__ */ h(x, { children: j("brainyrich.dashboard.sections.portfolioSnapshotDescription", "Current allocation across strategies") })] }), /* @__PURE__ */ g(b, {
49
- className: "space-y-4",
50
- children: [/* @__PURE__ */ g("div", {
51
- className: "flex items-baseline justify-between",
52
- children: [/* @__PURE__ */ h("span", {
53
- className: "text-2xl font-bold",
54
- children: i(N)
55
- }), /* @__PURE__ */ g("span", {
56
- className: "text-sm text-emerald-600 flex items-center gap-1",
57
- children: [
58
- /* @__PURE__ */ h(f, { className: "h-3 w-3" }),
59
- j("brainyrich.dashboard.weightedYtdPrefix", "Weighted YTD +"),
60
- (O.reduce((e, t) => e + t.ytdReturnPct * t.value, 0) / N).toFixed(1),
61
- "%"
62
- ]
63
- })]
64
- }), O.map((e) => {
65
- let t = Math.round(e.value / N * 100);
66
- return /* @__PURE__ */ g("div", {
67
- className: "space-y-1",
72
+ children: [/* @__PURE__ */ M(C, {
73
+ className: "h-5 w-5",
74
+ "aria-hidden": "true"
75
+ }), n("brainyrich.dashboard.sections.assetAllocation", "Asset Allocation")]
76
+ }), /* @__PURE__ */ M(R, { children: n("brainyrich.dashboard.sections.assetAllocationDescription", "Market value distributed across asset classes") })] }), /* @__PURE__ */ M(L, { children: r.isLoading ? /* @__PURE__ */ M(h, { rows: 3 }) : r.isError ? /* @__PURE__ */ M(p, { onRetry: () => r.refetch() }) : D.length > 0 ? /* @__PURE__ */ M(d, { data: D }) : /* @__PURE__ */ M(f, {
77
+ icon: /* @__PURE__ */ M(C, {
78
+ className: "size-6",
79
+ "aria-hidden": "true"
80
+ }),
81
+ title: n("brainyrich.dashboard.noAllocation", "No holdings to allocate"),
82
+ description: n("brainyrich.dashboard.noAllocationDesc", "Add holdings to your accounts to see how your wealth is allocated.")
83
+ }) })]
84
+ }), /* @__PURE__ */ N(I, { children: [/* @__PURE__ */ M(z, {
85
+ className: "pb-3",
86
+ children: /* @__PURE__ */ N(B, {
87
+ className: "flex items-center gap-2 text-base",
88
+ children: [/* @__PURE__ */ M(O, {
89
+ className: "h-4 w-4",
90
+ "aria-hidden": "true"
91
+ }), n("brainyrich.dashboard.sections.goals", "Goals")]
92
+ })
93
+ }), /* @__PURE__ */ M(L, {
94
+ className: "space-y-3",
95
+ children: l.isLoading ? /* @__PURE__ */ M(h, { rows: 3 }) : l.isError ? /* @__PURE__ */ M(p, { onRetry: () => l.refetch() }) : F.length > 0 ? F.map((e) => /* @__PURE__ */ N("div", {
96
+ className: "flex items-start justify-between gap-2 rounded-lg border border-border-subtle p-3",
97
+ children: [/* @__PURE__ */ N("div", {
98
+ className: "min-w-0 space-y-0.5",
99
+ children: [/* @__PURE__ */ M("p", {
100
+ className: "truncate text-sm font-medium text-text-primary",
101
+ children: e.name
102
+ }), /* @__PURE__ */ N("p", {
103
+ className: "text-xs text-text-secondary",
68
104
  children: [
69
- /* @__PURE__ */ g("div", {
70
- className: "flex items-center justify-between text-sm",
71
- children: [/* @__PURE__ */ h("span", {
72
- className: "font-medium",
73
- children: e.name
74
- }), /* @__PURE__ */ g("span", { children: [
75
- i(e.value),
76
- " (",
77
- t,
78
- "%)"
79
- ] })]
80
- }),
81
- /* @__PURE__ */ h("div", {
82
- className: "h-2 rounded bg-muted overflow-hidden",
83
- children: /* @__PURE__ */ h("div", {
84
- className: "h-2 rounded bg-primary",
85
- style: { width: `${t}%` }
86
- })
87
- }),
88
- /* @__PURE__ */ g("div", {
89
- className: "flex items-center justify-between text-xs text-muted-foreground",
90
- children: [/* @__PURE__ */ g("span", { children: [
91
- j("brainyrich.dashboard.portfolio.ytdPrefix", "YTD +"),
92
- e.ytdReturnPct,
93
- "%"
94
- ] }), /* @__PURE__ */ h(_, {
95
- variant: e.risk === "High" ? "destructive" : e.risk === "Moderate" ? "secondary" : "outline",
96
- className: "text-[10px]",
97
- children: e.risk
98
- })]
99
- })
105
+ v(e.targetAmount, e.currency),
106
+ " · ",
107
+ _(e.targetDate)
100
108
  ]
101
- }, e.id);
102
- })]
103
- })]
104
- }), /* @__PURE__ */ g("div", {
105
- className: "space-y-4",
106
- children: [/* @__PURE__ */ g(y, { children: [/* @__PURE__ */ h(S, {
107
- className: "pb-3",
108
- children: /* @__PURE__ */ g(C, {
109
- className: "flex items-center gap-2 text-base",
110
- children: [/* @__PURE__ */ h(c, { className: "h-4 w-4" }), j("brainyrich.dashboard.sections.marketSummary", "Market Summary")]
111
- })
112
- }), /* @__PURE__ */ h(b, {
113
- className: "space-y-3",
114
- children: w.map((e) => /* @__PURE__ */ g("div", {
115
- className: "flex items-center justify-between",
116
- children: [/* @__PURE__ */ h("span", {
117
- className: "text-sm font-medium",
118
- children: e.name
119
- }), /* @__PURE__ */ g("div", {
120
- className: "text-right",
121
- children: [/* @__PURE__ */ h("div", {
122
- className: "text-sm",
123
- children: e.value
124
- }), /* @__PURE__ */ g("div", {
125
- className: `text-xs flex items-center gap-0.5 ${e.positive ? "text-emerald-600" : "text-red-600"}`,
126
- children: [e.positive ? /* @__PURE__ */ h(s, { className: "h-3 w-3" }) : /* @__PURE__ */ h(o, { className: "h-3 w-3" }), e.change]
127
- })]
128
109
  })]
129
- }, e.name))
130
- })] }), /* @__PURE__ */ g(y, { children: [/* @__PURE__ */ h(S, {
131
- className: "pb-3",
132
- children: /* @__PURE__ */ g(C, {
133
- className: "flex items-center gap-2 text-base",
134
- children: [/* @__PURE__ */ h(d, { className: "h-4 w-4" }), j("brainyrich.dashboard.sections.goalProgress", "Goal Progress")]
135
- })
136
- }), /* @__PURE__ */ g(b, {
137
- className: "space-y-3",
138
- children: [/* @__PURE__ */ g("div", {
139
- className: "text-center",
140
- children: [/* @__PURE__ */ g("span", {
141
- className: "text-3xl font-bold",
142
- children: [P, "%"]
143
- }), /* @__PURE__ */ h("p", {
144
- className: "text-xs text-muted-foreground mt-1",
145
- children: j("brainyrich.dashboard.goalProgress.averageCompletion", "Average goal completion")
146
- })]
147
- }), A.map((e) => {
148
- let t = Math.round(e.currentAmount / e.targetAmount * 100);
149
- return /* @__PURE__ */ g("div", {
150
- className: "space-y-1",
151
- children: [/* @__PURE__ */ g("div", {
152
- className: "flex justify-between text-xs",
153
- children: [/* @__PURE__ */ h("span", { children: e.title }), /* @__PURE__ */ g("span", { children: [t, "%"] })]
154
- }), /* @__PURE__ */ h("div", {
155
- className: "h-1.5 rounded bg-muted overflow-hidden",
156
- children: /* @__PURE__ */ h("div", {
157
- className: "h-1.5 rounded bg-emerald-500",
158
- style: { width: `${t}%` }
159
- })
160
- })]
161
- }, e.id);
110
+ }), /* @__PURE__ */ M(P, {
111
+ variant: y(e.projection),
112
+ className: "shrink-0",
113
+ children: e.projection.replace(/_/g, " ")
162
114
  })]
163
- })] })]
164
- })]
115
+ }, e.id)) : /* @__PURE__ */ M(f, {
116
+ icon: /* @__PURE__ */ M(O, {
117
+ className: "size-6",
118
+ "aria-hidden": "true"
119
+ }),
120
+ title: n("brainyrich.dashboard.noGoals", "No goals yet"),
121
+ description: n("brainyrich.dashboard.noGoalsDesc", "Set a financial goal to start tracking progress.")
122
+ })
123
+ })] })]
165
124
  }),
166
- /* @__PURE__ */ g(y, { children: [/* @__PURE__ */ g(S, { children: [/* @__PURE__ */ g(C, {
125
+ /* @__PURE__ */ N(I, { children: [/* @__PURE__ */ N(z, { children: [/* @__PURE__ */ N(B, {
167
126
  className: "flex items-center gap-2",
168
- children: [/* @__PURE__ */ h(p, { className: "h-5 w-5" }), j("brainyrich.dashboard.sections.topHoldings", "Top Holdings")]
169
- }), /* @__PURE__ */ h(x, { children: j("brainyrich.dashboard.sections.topHoldingsDescription", "Highest-value positions across all portfolios") })] }), /* @__PURE__ */ h(b, { children: /* @__PURE__ */ h("div", {
170
- className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-4",
171
- children: k.map((e) => /* @__PURE__ */ g("div", {
172
- className: "flex items-center justify-between rounded-lg border p-3",
173
- children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("p", {
174
- className: "font-semibold text-sm",
175
- children: e.symbol
176
- }), /* @__PURE__ */ h("p", {
177
- className: "text-xs text-muted-foreground",
178
- children: e.sector
179
- })] }), /* @__PURE__ */ g("div", {
180
- className: "text-right",
181
- children: [/* @__PURE__ */ h("p", {
182
- className: "text-sm font-medium",
183
- children: i(e.marketValue)
184
- }), /* @__PURE__ */ g("p", {
185
- className: `text-xs ${e.changePct >= 0 ? "text-emerald-600" : "text-red-600"}`,
186
- children: [
187
- e.changePct >= 0 ? "+" : "",
188
- e.changePct,
189
- "%"
190
- ]
127
+ children: [/* @__PURE__ */ M(k, {
128
+ className: "h-5 w-5",
129
+ "aria-hidden": "true"
130
+ }), n("brainyrich.dashboard.sections.portfolios", "Portfolios")]
131
+ }), /* @__PURE__ */ M(R, { children: n("brainyrich.dashboard.sections.portfoliosDescription", "Your active investment strategies") })] }), /* @__PURE__ */ M(L, { children: c.isLoading ? /* @__PURE__ */ M(h, { rows: 3 }) : c.isError ? /* @__PURE__ */ M(p, { onRetry: () => c.refetch() }) : A.length > 0 ? /* @__PURE__ */ M("div", {
132
+ className: "grid gap-3 sm:grid-cols-2",
133
+ children: A.map((e) => /* @__PURE__ */ N("div", {
134
+ className: "flex items-start justify-between gap-2 rounded-lg border border-border-subtle p-3",
135
+ children: [/* @__PURE__ */ N("div", {
136
+ className: "min-w-0 space-y-0.5",
137
+ children: [/* @__PURE__ */ M("p", {
138
+ className: "truncate text-sm font-medium text-text-primary",
139
+ children: e.name
140
+ }), e.description ? /* @__PURE__ */ M("p", {
141
+ className: "truncate text-xs text-text-secondary",
142
+ children: e.description
143
+ }) : /* @__PURE__ */ M("p", {
144
+ className: "text-xs text-text-secondary",
145
+ children: e.baseCurrency
191
146
  })]
147
+ }), /* @__PURE__ */ M(P, {
148
+ variant: y(e.status),
149
+ className: "shrink-0",
150
+ children: e.status
192
151
  })]
193
- }, e.symbol))
152
+ }, e.id))
153
+ }) : /* @__PURE__ */ M(f, {
154
+ icon: /* @__PURE__ */ M(k, {
155
+ className: "size-6",
156
+ "aria-hidden": "true"
157
+ }),
158
+ title: n("brainyrich.dashboard.noPortfolios", "No portfolios yet"),
159
+ description: n("brainyrich.dashboard.noPortfoliosDesc", "Create a portfolio to organize your investment strategy.")
194
160
  }) })] }),
195
- /* @__PURE__ */ g(y, { children: [/* @__PURE__ */ g(S, { children: [/* @__PURE__ */ g(C, {
161
+ /* @__PURE__ */ N(I, { children: [/* @__PURE__ */ N(z, { children: [/* @__PURE__ */ N(B, {
196
162
  className: "flex items-center gap-2",
197
- children: [/* @__PURE__ */ h(l, { className: "h-5 w-5" }), j("brainyrich.dashboard.sections.activeWorkItems", "Active Work Items")]
198
- }), /* @__PURE__ */ h(x, { children: j("brainyrich.dashboard.sections.activeWorkItemsDescription", "Tasks and initiatives from your wealth operations teams") })] }), /* @__PURE__ */ h(b, {
163
+ children: [/* @__PURE__ */ M(S, {
164
+ className: "h-5 w-5",
165
+ "aria-hidden": "true"
166
+ }), n("brainyrich.dashboard.sections.needsAttention", "Needs Attention")]
167
+ }), /* @__PURE__ */ M(R, { children: n("brainyrich.dashboard.sections.needsAttentionDescription", "Open insights that may require action") })] }), /* @__PURE__ */ M(L, {
199
168
  className: "space-y-3",
200
- children: D.map((e) => /* @__PURE__ */ g("div", {
201
- className: "flex items-center justify-between rounded-lg border p-3",
202
- children: [/* @__PURE__ */ g("div", {
203
- className: "space-y-0.5",
204
- children: [/* @__PURE__ */ h("p", {
205
- className: "text-sm font-medium",
206
- children: e.title
207
- }), /* @__PURE__ */ g("p", {
208
- className: "text-xs text-muted-foreground",
209
- children: [
210
- e.owner,
211
- " · ",
212
- e.updatedAt
213
- ]
169
+ children: u.isLoading ? /* @__PURE__ */ M(h, { rows: 3 }) : u.isError ? /* @__PURE__ */ M(p, { onRetry: () => u.refetch() }) : V.length > 0 ? V.map((e) => /* @__PURE__ */ M(oe, {
170
+ insight: e,
171
+ translate: n
172
+ }, e.id)) : /* @__PURE__ */ M(f, {
173
+ icon: /* @__PURE__ */ M(T, {
174
+ className: "size-6",
175
+ "aria-hidden": "true"
176
+ }),
177
+ title: n("brainyrich.dashboard.noInsights", "All clear"),
178
+ description: n("brainyrich.dashboard.noInsightsDesc", "There are no open insights that need your attention.")
179
+ })
180
+ })] })
181
+ ]
182
+ });
183
+ }
184
+ function oe({ insight: e, translate: n }) {
185
+ let i = t(), a = r(), o = c(), [s, u] = x(!1), d = i.isPending || a.isPending || o.isPending;
186
+ return /* @__PURE__ */ N("div", {
187
+ className: "flex items-start justify-between gap-3 rounded-lg border border-border-subtle p-3",
188
+ children: [
189
+ /* @__PURE__ */ N("div", {
190
+ className: "min-w-0 space-y-1",
191
+ children: [
192
+ /* @__PURE__ */ N("div", {
193
+ className: "flex items-center gap-2",
194
+ children: [/* @__PURE__ */ M(P, {
195
+ variant: y(e.severity),
196
+ children: e.severity
197
+ }), /* @__PURE__ */ M("span", {
198
+ className: "text-xs text-text-secondary",
199
+ children: e.type.replace(/_/g, " ")
214
200
  })]
215
- }), /* @__PURE__ */ h(_, {
216
- variant: a(e.status),
217
- children: e.status.replace("_", " ")
218
- })]
219
- }, e.id))
220
- })] }),
221
- /* @__PURE__ */ h("div", {
222
- className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-4",
201
+ }),
202
+ /* @__PURE__ */ M("p", {
203
+ className: "text-sm font-medium text-text-primary",
204
+ children: e.title
205
+ }),
206
+ e.detail ? /* @__PURE__ */ M("p", {
207
+ className: "text-xs text-text-secondary",
208
+ children: e.detail
209
+ }) : null
210
+ ]
211
+ }),
212
+ /* @__PURE__ */ N(q, { children: [/* @__PURE__ */ M(X, {
213
+ asChild: !0,
214
+ children: /* @__PURE__ */ M(F, {
215
+ variant: "ghost",
216
+ size: "icon",
217
+ className: "shrink-0",
218
+ disabled: d,
219
+ "aria-label": n("brainyrich.dashboard.insightActions", "Insight actions"),
220
+ children: /* @__PURE__ */ M(E, {
221
+ className: "size-4",
222
+ "aria-hidden": "true"
223
+ })
224
+ })
225
+ }), /* @__PURE__ */ N(J, {
226
+ align: "end",
223
227
  children: [
224
- {
225
- label: j("brainyrich.dashboard.quickActions.placeTradeOrder", "Place Trade Order"),
226
- desc: j("brainyrich.dashboard.quickActions.placeTradeOrderDesc", "Buy or sell securities")
227
- },
228
- {
229
- label: j("brainyrich.dashboard.quickActions.linkNewAccount", "Link New Account"),
230
- desc: j("brainyrich.dashboard.quickActions.linkNewAccountDesc", "Connect a financial account")
231
- },
232
- {
233
- label: j("brainyrich.dashboard.quickActions.generateReport", "Generate Report"),
234
- desc: j("brainyrich.dashboard.quickActions.generateReportDesc", "Create a wealth snapshot")
235
- },
236
- {
237
- label: j("brainyrich.dashboard.quickActions.askWealthAi", "Ask Wealth AI"),
238
- desc: j("brainyrich.dashboard.quickActions.askWealthAiDesc", "Get personalized advice")
239
- }
240
- ].map((e) => /* @__PURE__ */ g(v, {
241
- variant: "outline",
242
- className: "h-auto flex-col items-start p-4 text-left",
243
- children: [/* @__PURE__ */ h("span", {
244
- className: "font-medium text-sm",
245
- children: e.label
246
- }), /* @__PURE__ */ h("span", {
247
- className: "text-xs text-muted-foreground",
248
- children: e.desc
249
- })]
250
- }, e.label))
228
+ /* @__PURE__ */ N(Y, {
229
+ onSelect: () => i.mutate(e.id),
230
+ children: [/* @__PURE__ */ M(w, {
231
+ className: "size-4",
232
+ "aria-hidden": "true"
233
+ }), n("brainyrich.dashboard.insight.acknowledge", "Acknowledge")]
234
+ }),
235
+ /* @__PURE__ */ N(Y, {
236
+ onSelect: () => o.mutate(e.id),
237
+ children: [/* @__PURE__ */ M(T, {
238
+ className: "size-4",
239
+ "aria-hidden": "true"
240
+ }), n("brainyrich.dashboard.insight.resolve", "Resolve")]
241
+ }),
242
+ /* @__PURE__ */ N(Y, {
243
+ onSelect: () => u(!0),
244
+ children: [/* @__PURE__ */ M(A, {
245
+ className: "size-4",
246
+ "aria-hidden": "true"
247
+ }), n("brainyrich.dashboard.insight.dismiss", "Dismiss")]
248
+ })
249
+ ]
250
+ })] }),
251
+ /* @__PURE__ */ M(l, {
252
+ open: s,
253
+ onOpenChange: u,
254
+ title: n("brainyrich.dashboard.insight.dismissTitle", "Dismiss this insight?"),
255
+ description: n("brainyrich.dashboard.insight.dismissDescription", "It will be removed from Needs Attention. You can still find it in the full insights list."),
256
+ confirmLabel: n("brainyrich.dashboard.insight.dismiss", "Dismiss"),
257
+ pendingLabel: n("brainyrich.dashboard.insight.dismissing", "Dismissing…"),
258
+ destructive: !0,
259
+ pending: a.isPending,
260
+ onConfirm: () => a.mutate(e.id, { onSuccess: () => u(!1) })
251
261
  })
252
262
  ]
253
263
  });
254
264
  }
265
+ function se({ translate: e }) {
266
+ let [t, r] = x(!1), [i, a] = x(""), [o, s] = x("BROKERAGE"), [c, l] = x(""), [d, f] = x(""), [p, m] = x("USD"), [h, g] = x(null), _ = n(), v = i.trim(), y = v.length > 0 && !_.isPending, b = () => {
267
+ a(""), s("BROKERAGE"), l(""), f(""), m("USD"), g(null), _.reset();
268
+ };
269
+ return /* @__PURE__ */ N(V, {
270
+ open: t,
271
+ onOpenChange: (e) => {
272
+ r(e), e || b();
273
+ },
274
+ children: [/* @__PURE__ */ N(F, {
275
+ size: "sm",
276
+ onClick: () => r(!0),
277
+ children: [/* @__PURE__ */ M(D, {
278
+ className: "size-4",
279
+ "aria-hidden": "true"
280
+ }), e("brainyrich.dashboard.actions.newAccount", "New Account")]
281
+ }), /* @__PURE__ */ M(H, { children: /* @__PURE__ */ N("form", {
282
+ onSubmit: (e) => {
283
+ if (e.preventDefault(), !y) return;
284
+ let t = Number.parseFloat(d), n = {
285
+ name: v,
286
+ type: o,
287
+ currency: p.trim() || "USD",
288
+ isManual: !0,
289
+ ...c.trim() ? { institution: c.trim() } : {},
290
+ ...Number.isFinite(t) ? { cashBalance: t } : {},
291
+ ...h ? { householdId: h } : {}
292
+ };
293
+ _.mutate(n, { onSuccess: () => {
294
+ b(), r(!1);
295
+ } });
296
+ },
297
+ className: "space-y-4",
298
+ children: [
299
+ /* @__PURE__ */ N(G, { children: [/* @__PURE__ */ M(K, { children: e("brainyrich.dashboard.newAccount.title", "New Account") }), /* @__PURE__ */ M(U, { children: e("brainyrich.dashboard.newAccount.description", "Add a manual account to track alongside your linked institutions.") })] }),
300
+ /* @__PURE__ */ N("div", {
301
+ className: "space-y-2",
302
+ children: [/* @__PURE__ */ M(Q, {
303
+ htmlFor: "bra-account-name",
304
+ children: e("brainyrich.dashboard.newAccount.name", "Account name")
305
+ }), /* @__PURE__ */ M(Z, {
306
+ id: "bra-account-name",
307
+ value: i,
308
+ onChange: (e) => a(e.target.value),
309
+ placeholder: e("brainyrich.dashboard.newAccount.namePlaceholder", "e.g. Fidelity Brokerage"),
310
+ required: !0,
311
+ autoFocus: !0
312
+ })]
313
+ }),
314
+ /* @__PURE__ */ N("div", {
315
+ className: "grid gap-4 sm:grid-cols-2",
316
+ children: [/* @__PURE__ */ N("div", {
317
+ className: "space-y-2",
318
+ children: [/* @__PURE__ */ M(Q, {
319
+ htmlFor: "bra-account-type",
320
+ children: e("brainyrich.dashboard.newAccount.type", "Type")
321
+ }), /* @__PURE__ */ N($, {
322
+ value: o,
323
+ onValueChange: (e) => s(e),
324
+ children: [/* @__PURE__ */ M(ne, {
325
+ id: "bra-account-type",
326
+ children: /* @__PURE__ */ M(re, {})
327
+ }), /* @__PURE__ */ M(ee, { children: ie.map((e) => /* @__PURE__ */ M(te, {
328
+ value: e,
329
+ children: e.replace(/_/g, " ")
330
+ }, e)) })]
331
+ })]
332
+ }), /* @__PURE__ */ N("div", {
333
+ className: "space-y-2",
334
+ children: [/* @__PURE__ */ M(Q, {
335
+ htmlFor: "bra-account-currency",
336
+ children: e("brainyrich.dashboard.newAccount.currency", "Currency")
337
+ }), /* @__PURE__ */ M(Z, {
338
+ id: "bra-account-currency",
339
+ value: p,
340
+ onChange: (e) => m(e.target.value.toUpperCase()),
341
+ maxLength: 3
342
+ })]
343
+ })]
344
+ }),
345
+ /* @__PURE__ */ N("div", {
346
+ className: "space-y-2",
347
+ children: [/* @__PURE__ */ M(Q, {
348
+ htmlFor: "bra-account-institution",
349
+ children: e("brainyrich.dashboard.newAccount.institution", "Institution (optional)")
350
+ }), /* @__PURE__ */ M(Z, {
351
+ id: "bra-account-institution",
352
+ value: c,
353
+ onChange: (e) => l(e.target.value),
354
+ placeholder: e("brainyrich.dashboard.newAccount.institutionPlaceholder", "e.g. Fidelity")
355
+ })]
356
+ }),
357
+ /* @__PURE__ */ M(u, {
358
+ id: "bra-account-household",
359
+ value: h,
360
+ onChange: g,
361
+ label: e("brainyrich.dashboard.newAccount.household", "Household (optional)"),
362
+ noneLabel: e("brainyrich.dashboard.newAccount.noHousehold", "No household"),
363
+ disabled: _.isPending
364
+ }),
365
+ /* @__PURE__ */ N("div", {
366
+ className: "space-y-2",
367
+ children: [/* @__PURE__ */ M(Q, {
368
+ htmlFor: "bra-account-cash",
369
+ children: e("brainyrich.dashboard.newAccount.cash", "Cash balance (optional)")
370
+ }), /* @__PURE__ */ M(Z, {
371
+ id: "bra-account-cash",
372
+ type: "number",
373
+ inputMode: "decimal",
374
+ step: "0.01",
375
+ value: d,
376
+ onChange: (e) => f(e.target.value),
377
+ placeholder: "0.00"
378
+ })]
379
+ }),
380
+ _.isError ? /* @__PURE__ */ M("p", {
381
+ className: "text-sm text-status-error-text",
382
+ children: _.error instanceof Error ? _.error.message : e("brainyrich.dashboard.newAccount.error", "Could not create account.")
383
+ }) : null,
384
+ /* @__PURE__ */ N(W, { children: [/* @__PURE__ */ M(F, {
385
+ type: "button",
386
+ variant: "outline",
387
+ onClick: () => r(!1),
388
+ disabled: _.isPending,
389
+ children: e("brainyrich.common.cancel", "Cancel")
390
+ }), /* @__PURE__ */ M(F, {
391
+ type: "submit",
392
+ disabled: !y,
393
+ children: _.isPending ? e("brainyrich.dashboard.newAccount.creating", "Creating…") : e("brainyrich.dashboard.newAccount.create", "Create account")
394
+ })] })
395
+ ]
396
+ }) })]
397
+ });
398
+ }
255
399
  //#endregion
256
- export { T as DashboardPage };
400
+ export { ae as DashboardPage };
257
401
 
258
402
  //# sourceMappingURL=DashboardPage.js.map