@burdenoff/microfe-brainyrich 2026.512.1 → 2026.705.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 +53 -88
- package/dist/brainyrich/BrainyRichRoot.js.map +1 -1
- package/dist/brainyrich/BrainyRichRoutes.js +15 -35
- package/dist/brainyrich/BrainyRichRoutes.js.map +1 -1
- package/dist/brainyrich/hooks/useBrainyRichApi.js +543 -0
- package/dist/brainyrich/hooks/useBrainyRichApi.js.map +1 -0
- package/dist/brainyrich/index.js +0 -1
- package/dist/brainyrich/pages/AccountsPage.js +690 -160
- package/dist/brainyrich/pages/AccountsPage.js.map +1 -1
- package/dist/brainyrich/pages/AiAssistantPage.js +537 -363
- package/dist/brainyrich/pages/AiAssistantPage.js.map +1 -1
- package/dist/brainyrich/pages/AnalyticsPage.js +587 -268
- package/dist/brainyrich/pages/AnalyticsPage.js.map +1 -1
- package/dist/brainyrich/pages/DashboardPage.js +350 -232
- package/dist/brainyrich/pages/DashboardPage.js.map +1 -1
- package/dist/brainyrich/pages/FamilyPage.js +550 -337
- package/dist/brainyrich/pages/FamilyPage.js.map +1 -1
- package/dist/brainyrich/pages/GoalsPage.js +775 -142
- package/dist/brainyrich/pages/GoalsPage.js.map +1 -1
- package/dist/brainyrich/pages/InvestmentsPage.js +410 -311
- package/dist/brainyrich/pages/InvestmentsPage.js.map +1 -1
- package/dist/brainyrich/pages/PortfoliosPage.js +823 -154
- package/dist/brainyrich/pages/PortfoliosPage.js.map +1 -1
- package/dist/brainyrich/pages/ReportsPage.js +388 -251
- package/dist/brainyrich/pages/ReportsPage.js.map +1 -1
- package/dist/brainyrich/pages/RiskPage.js +411 -196
- package/dist/brainyrich/pages/RiskPage.js.map +1 -1
- package/dist/brainyrich/pages/TaxPage.js +622 -221
- package/dist/brainyrich/pages/TaxPage.js.map +1 -1
- package/dist/brainyrich/pages/_shared.js +222 -41
- package/dist/brainyrich/pages/_shared.js.map +1 -1
- package/dist/index.js +2 -3
- package/package.json +1 -1
- package/dist/brainyrich/BrainyRichRoot.d.ts +0 -5
- package/dist/brainyrich/BrainyRichRoot.d.ts.map +0 -1
- package/dist/brainyrich/BrainyRichRoutes.d.ts +0 -2
- package/dist/brainyrich/BrainyRichRoutes.d.ts.map +0 -1
- package/dist/brainyrich/index.d.ts +0 -5
- package/dist/brainyrich/index.d.ts.map +0 -1
- package/dist/brainyrich/pages/AccountsPage.d.ts +0 -2
- package/dist/brainyrich/pages/AccountsPage.d.ts.map +0 -1
- package/dist/brainyrich/pages/AdvisorsPage.d.ts +0 -2
- package/dist/brainyrich/pages/AdvisorsPage.d.ts.map +0 -1
- package/dist/brainyrich/pages/AdvisorsPage.js +0 -375
- package/dist/brainyrich/pages/AdvisorsPage.js.map +0 -1
- package/dist/brainyrich/pages/AiAssistantPage.d.ts +0 -2
- package/dist/brainyrich/pages/AiAssistantPage.d.ts.map +0 -1
- package/dist/brainyrich/pages/AnalyticsPage.d.ts +0 -2
- package/dist/brainyrich/pages/AnalyticsPage.d.ts.map +0 -1
- package/dist/brainyrich/pages/AssistantPage.d.ts +0 -2
- package/dist/brainyrich/pages/AssistantPage.d.ts.map +0 -1
- package/dist/brainyrich/pages/AssistantPage.js +0 -332
- package/dist/brainyrich/pages/AssistantPage.js.map +0 -1
- package/dist/brainyrich/pages/DashboardPage.d.ts +0 -2
- package/dist/brainyrich/pages/DashboardPage.d.ts.map +0 -1
- package/dist/brainyrich/pages/EstatePage.d.ts +0 -2
- package/dist/brainyrich/pages/EstatePage.d.ts.map +0 -1
- package/dist/brainyrich/pages/EstatePage.js +0 -269
- package/dist/brainyrich/pages/EstatePage.js.map +0 -1
- package/dist/brainyrich/pages/FamilyPage.d.ts +0 -2
- package/dist/brainyrich/pages/FamilyPage.d.ts.map +0 -1
- package/dist/brainyrich/pages/GoalsPage.d.ts +0 -2
- package/dist/brainyrich/pages/GoalsPage.d.ts.map +0 -1
- package/dist/brainyrich/pages/InsurancePage.d.ts +0 -2
- package/dist/brainyrich/pages/InsurancePage.d.ts.map +0 -1
- package/dist/brainyrich/pages/InsurancePage.js +0 -181
- package/dist/brainyrich/pages/InsurancePage.js.map +0 -1
- package/dist/brainyrich/pages/InvestmentsPage.d.ts +0 -2
- package/dist/brainyrich/pages/InvestmentsPage.d.ts.map +0 -1
- package/dist/brainyrich/pages/MarketplacePage.d.ts +0 -2
- package/dist/brainyrich/pages/MarketplacePage.d.ts.map +0 -1
- package/dist/brainyrich/pages/MarketplacePage.js +0 -450
- package/dist/brainyrich/pages/MarketplacePage.js.map +0 -1
- package/dist/brainyrich/pages/PortfoliosPage.d.ts +0 -2
- package/dist/brainyrich/pages/PortfoliosPage.d.ts.map +0 -1
- package/dist/brainyrich/pages/ReportsPage.d.ts +0 -2
- package/dist/brainyrich/pages/ReportsPage.d.ts.map +0 -1
- package/dist/brainyrich/pages/RiskPage.d.ts +0 -2
- package/dist/brainyrich/pages/RiskPage.d.ts.map +0 -1
- package/dist/brainyrich/pages/TaxPage.d.ts +0 -2
- package/dist/brainyrich/pages/TaxPage.d.ts.map +0 -1
- package/dist/brainyrich/pages/_shared.d.ts +0 -21
- package/dist/brainyrich/pages/_shared.d.ts.map +0 -1
- package/dist/brainyrich/providers/BrainyRichProvider.d.ts +0 -6
- package/dist/brainyrich/providers/BrainyRichProvider.d.ts.map +0 -1
- package/dist/brainyrich/store/brainyrichStore.d.ts +0 -19
- package/dist/brainyrich/store/brainyrichStore.d.ts.map +0 -1
- package/dist/brainyrich/store/brainyrichStore.js +0 -272
- package/dist/brainyrich/store/brainyrichStore.js.map +0 -1
- package/dist/brainyrich/types/index.d.ts +0 -116
- package/dist/brainyrich/types/index.d.ts.map +0 -1
- package/dist/brainyrich/utils/cn.d.ts +0 -4
- package/dist/brainyrich/utils/cn.d.ts.map +0 -1
- package/dist/brainyrich/utils/i18n.d.ts +0 -6
- package/dist/brainyrich/utils/i18n.d.ts.map +0 -1
- package/dist/brainyrich/utils/navigation.d.ts +0 -2
- package/dist/brainyrich/utils/navigation.d.ts.map +0 -1
- package/dist/dev/main.d.ts +0 -2
- package/dist/dev/main.d.ts.map +0 -1
- package/dist/generated/global-operations.d.ts +0 -2
- package/dist/generated/global-operations.d.ts.map +0 -1
- package/dist/generated/global-types.d.ts +0 -18199
- package/dist/generated/global-types.d.ts.map +0 -1
- package/dist/generated/wspace-operations.d.ts +0 -2
- package/dist/generated/wspace-operations.d.ts.map +0 -1
- package/dist/generated/wspace-types.d.ts +0 -43046
- package/dist/generated/wspace-types.d.ts.map +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +0 -1
|
@@ -1,389 +1,563 @@
|
|
|
1
1
|
import { tWithFallback as e } from "../utils/i18n.js";
|
|
2
|
-
import {
|
|
3
|
-
import { SectionShell as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { useI18n as
|
|
7
|
-
import { jsx as
|
|
8
|
-
import { Badge as
|
|
2
|
+
import { useAcknowledgeInsight as t, useCreateInsight as n, useDismissInsight as r, useInsights as i, useResolveInsight as a } from "../hooks/useBrainyRichApi.js";
|
|
3
|
+
import { EmptyState as o, ErrorState as s, KpiGrid as c, LoadingState as l, SectionShell as u, formatDate as d, statusBadgeVariant as f } from "./_shared.js";
|
|
4
|
+
import { useMemo as p, useState as m } from "react";
|
|
5
|
+
import { AlertTriangle as h, BellRing as g, CheckCircle2 as _, Info as v, Lightbulb as y, MoreHorizontal as b, Plus as ee, ShieldAlert as x, XCircle as S } from "lucide-react";
|
|
6
|
+
import { useI18n as te } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
7
|
+
import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
8
|
+
import { Badge as E, Button as D, Card as O, CardContent as k, CardDescription as ne, CardHeader as re, CardTitle as A, Dialog as j, DialogContent as M, DialogDescription as N, DialogFooter as P, DialogHeader as F, DialogTitle as I, DropdownMenu as L, DropdownMenuContent as R, DropdownMenuItem as z, DropdownMenuSeparator as B, DropdownMenuTrigger as V, Input as H, Label as U, Select as W, SelectContent as G, SelectItem as K, SelectTrigger as q, SelectValue as J, Textarea as Y } from "@burdenoff/fe-libs/ui";
|
|
9
9
|
//#region src/brainyrich/pages/AiAssistantPage.tsx
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
var X = [
|
|
11
|
+
"REBALANCE_DUE",
|
|
12
|
+
"DRIFT",
|
|
13
|
+
"CONCENTRATION_RISK",
|
|
14
|
+
"CASH_DRAG",
|
|
15
|
+
"FEE_ANOMALY",
|
|
16
|
+
"TAX_OPPORTUNITY",
|
|
17
|
+
"GOAL_AT_RISK"
|
|
18
|
+
], ie = [
|
|
19
|
+
"INFO",
|
|
20
|
+
"LOW",
|
|
21
|
+
"MEDIUM",
|
|
22
|
+
"HIGH",
|
|
23
|
+
"CRITICAL"
|
|
24
|
+
], ae = [
|
|
25
|
+
"OPEN",
|
|
26
|
+
"ACKNOWLEDGED",
|
|
27
|
+
"RESOLVED",
|
|
28
|
+
"DISMISSED"
|
|
29
|
+
], Z = "__all__";
|
|
30
|
+
function Q(e) {
|
|
31
|
+
return e.toLowerCase().split("_").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join(" ");
|
|
13
32
|
}
|
|
14
|
-
|
|
15
|
-
{
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
lastMessage: /* @__PURE__ */ new Date(Date.now() - 1e3 * 60 * 60 * 24),
|
|
37
|
-
messageCount: 15
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
id: "4",
|
|
41
|
-
titleKey: "brainyrich.aiAssistant.sessions.retirementCorpusReview",
|
|
42
|
-
titleFallback: "Retirement Corpus Review",
|
|
43
|
-
title: "Retirement Corpus Review",
|
|
44
|
-
lastMessage: /* @__PURE__ */ new Date(Date.now() - 1e3 * 60 * 60 * 48),
|
|
45
|
-
messageCount: 6
|
|
46
|
-
}
|
|
47
|
-
], P = [
|
|
48
|
-
{
|
|
49
|
-
key: "brainyrich.aiAssistant.suggestions.portfolioPerformance",
|
|
50
|
-
fallback: "Analyze my portfolio performance",
|
|
51
|
-
icon: v
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
key: "brainyrich.aiAssistant.suggestions.taxOptimization",
|
|
55
|
-
fallback: "Tax optimization strategies for FY 2026-27",
|
|
56
|
-
icon: c
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
key: "brainyrich.aiAssistant.suggestions.retirementCorpus",
|
|
60
|
-
fallback: "Review my retirement corpus projections",
|
|
61
|
-
icon: m
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
key: "brainyrich.aiAssistant.suggestions.estateChecklist",
|
|
65
|
-
fallback: "Estate planning checklist for nominees",
|
|
66
|
-
icon: u
|
|
33
|
+
function oe(e) {
|
|
34
|
+
switch (e) {
|
|
35
|
+
case "CRITICAL": return {
|
|
36
|
+
icon: x,
|
|
37
|
+
tone: "text-status-error-text"
|
|
38
|
+
};
|
|
39
|
+
case "HIGH": return {
|
|
40
|
+
icon: h,
|
|
41
|
+
tone: "text-status-error-text"
|
|
42
|
+
};
|
|
43
|
+
case "MEDIUM": return {
|
|
44
|
+
icon: g,
|
|
45
|
+
tone: "text-status-warning-text"
|
|
46
|
+
};
|
|
47
|
+
case "LOW": return {
|
|
48
|
+
icon: y,
|
|
49
|
+
tone: "text-status-warning-text"
|
|
50
|
+
};
|
|
51
|
+
default: return {
|
|
52
|
+
icon: v,
|
|
53
|
+
tone: "text-text-secondary"
|
|
54
|
+
};
|
|
67
55
|
}
|
|
68
|
-
];
|
|
69
|
-
function F(e) {
|
|
70
|
-
let t = Date.now() - e.getTime(), n = Math.floor(t / 6e4);
|
|
71
|
-
if (n < 60) return `${n}m ago`;
|
|
72
|
-
let r = Math.floor(n / 60);
|
|
73
|
-
return r < 24 ? `${r}h ago` : `${Math.floor(r / 24)}d ago`;
|
|
74
56
|
}
|
|
75
|
-
function
|
|
76
|
-
|
|
77
|
-
|
|
57
|
+
function se() {
|
|
58
|
+
return {
|
|
59
|
+
title: "",
|
|
60
|
+
type: "DRIFT",
|
|
61
|
+
severity: "MEDIUM",
|
|
62
|
+
subjectType: "PORTFOLIO",
|
|
63
|
+
subjectId: "",
|
|
64
|
+
detail: "",
|
|
65
|
+
metrics: "",
|
|
66
|
+
ownerId: ""
|
|
67
|
+
};
|
|
78
68
|
}
|
|
79
|
-
function
|
|
80
|
-
let { t:
|
|
81
|
-
...
|
|
82
|
-
|
|
83
|
-
})),
|
|
84
|
-
...
|
|
85
|
-
|
|
86
|
-
})),
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
},
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
69
|
+
function $() {
|
|
70
|
+
let { t: d } = te(), f = (t, n, r) => e(d, t, n, r), [h, _] = m(Z), [v, y] = m(Z), [b, x] = m(Z), { data: S, isLoading: E, isError: ne, refetch: re } = i({
|
|
71
|
+
...h === Z ? {} : { severity: h },
|
|
72
|
+
...v === Z ? {} : { status: v }
|
|
73
|
+
}), A = t(), j = r(), M = a(), N = n(), [P, F] = m(!1), [I, L] = m(se), R = (e, t) => L((n) => ({
|
|
74
|
+
...n,
|
|
75
|
+
[e]: t
|
|
76
|
+
})), z = p(() => b === Z ? S : S.filter((e) => e.type === b), [S, b]), B = p(() => ({
|
|
77
|
+
open: S.filter((e) => e.status === "OPEN").length,
|
|
78
|
+
urgent: S.filter((e) => e.severity === "HIGH" || e.severity === "CRITICAL").length,
|
|
79
|
+
resolved: S.filter((e) => e.status === "RESOLVED").length
|
|
80
|
+
}), [S]), V = p(() => {
|
|
81
|
+
if (!I.metrics.trim()) return !0;
|
|
82
|
+
try {
|
|
83
|
+
return JSON.parse(I.metrics), !0;
|
|
84
|
+
} catch {
|
|
85
|
+
return !1;
|
|
86
|
+
}
|
|
87
|
+
}, [I.metrics]), H = I.title.trim().length > 0 && I.subjectType.trim().length > 0 && I.subjectId.trim().length > 0 && V, Y = () => {
|
|
88
|
+
L(se()), F(!0);
|
|
89
|
+
}, oe = () => {
|
|
90
|
+
if (!H) return;
|
|
91
|
+
let e;
|
|
92
|
+
if (I.metrics.trim()) try {
|
|
93
|
+
e = JSON.parse(I.metrics);
|
|
94
|
+
} catch {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
let t = {
|
|
98
|
+
title: I.title.trim(),
|
|
99
|
+
type: I.type,
|
|
100
|
+
severity: I.severity,
|
|
101
|
+
subjectType: I.subjectType.trim(),
|
|
102
|
+
subjectId: I.subjectId.trim(),
|
|
103
|
+
detail: I.detail.trim() || null,
|
|
104
|
+
...e ? { metrics: e } : {},
|
|
105
|
+
...I.ownerId.trim() ? { ownerId: I.ownerId.trim() } : {}
|
|
108
106
|
};
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
107
|
+
N.mutate(t, { onSuccess: () => F(!1) });
|
|
108
|
+
}, $ = h !== Z || v !== Z || b !== Z;
|
|
109
|
+
return /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(u, {
|
|
110
|
+
title: f("brainyrich.insights.title", "Insights"),
|
|
111
|
+
description: f("brainyrich.insights.description", "Advisory insights across portfolios, accounts and goals — triage, acknowledge and resolve."),
|
|
112
|
+
badges: [f("brainyrich.insights.badges.advisory", "Advisory")],
|
|
113
|
+
actionLabel: f("brainyrich.insights.actions.create", "New insight"),
|
|
114
|
+
onAction: Y,
|
|
115
|
+
children: E ? /* @__PURE__ */ w(l, { rows: 4 }) : ne ? /* @__PURE__ */ w(s, {
|
|
116
|
+
title: f("brainyrich.insights.error.title", "Could not load insights"),
|
|
117
|
+
description: f("brainyrich.insights.error.description", "We could not reach the insights service. Please try again."),
|
|
118
|
+
onRetry: () => re()
|
|
119
|
+
}) : /* @__PURE__ */ T(C, { children: [
|
|
120
|
+
/* @__PURE__ */ w(c, { items: [
|
|
121
|
+
{
|
|
122
|
+
label: f("brainyrich.insights.metrics.total", "Insights"),
|
|
123
|
+
value: String(S.length),
|
|
124
|
+
trend: f("brainyrich.insights.metrics.totalTrend", "In your inbox")
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
label: f("brainyrich.insights.metrics.open", "Open"),
|
|
128
|
+
value: String(B.open),
|
|
129
|
+
trend: f("brainyrich.insights.metrics.openTrend", "Awaiting action"),
|
|
130
|
+
deltaTone: B.open > 0 ? "negative" : "positive"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
label: f("brainyrich.insights.metrics.urgent", "High priority"),
|
|
134
|
+
value: String(B.urgent),
|
|
135
|
+
trend: f("brainyrich.insights.metrics.urgentTrend", "High or critical"),
|
|
136
|
+
deltaTone: B.urgent > 0 ? "negative" : "positive"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
label: f("brainyrich.insights.metrics.resolved", "Resolved"),
|
|
140
|
+
value: String(B.resolved),
|
|
141
|
+
trend: f("brainyrich.insights.metrics.resolvedTrend", "Closed out"),
|
|
142
|
+
deltaTone: "positive"
|
|
127
143
|
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}, $ = (e) => {
|
|
132
|
-
G(e), Z.current?.focus();
|
|
133
|
-
};
|
|
134
|
-
return /* @__PURE__ */ x(n, {
|
|
135
|
-
title: L("brainyrich.aiAssistant.title", "AI Wealth Assistant"),
|
|
136
|
-
description: L("brainyrich.aiAssistant.description", "Personalized financial advice powered by artificial intelligence"),
|
|
137
|
-
badges: [L("brainyrich.aiAssistant.badges.aiPowered", "AI Powered")],
|
|
138
|
-
actionLabel: L("brainyrich.aiAssistant.actions.exportChat", "Export Chat"),
|
|
139
|
-
children: /* @__PURE__ */ S("div", {
|
|
140
|
-
className: "grid grid-cols-1 gap-6 lg:grid-cols-4",
|
|
141
|
-
style: { minHeight: "calc(100vh - 280px)" },
|
|
142
|
-
children: [/* @__PURE__ */ S("div", {
|
|
143
|
-
className: "space-y-3 lg:col-span-1",
|
|
144
|
+
] }),
|
|
145
|
+
/* @__PURE__ */ w(O, { children: /* @__PURE__ */ T(k, {
|
|
146
|
+
className: "flex flex-col gap-3 p-4 sm:flex-row sm:items-end",
|
|
144
147
|
children: [
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
148
|
+
/* @__PURE__ */ T("div", {
|
|
149
|
+
className: "w-full space-y-1.5 sm:w-48",
|
|
150
|
+
children: [/* @__PURE__ */ w(U, {
|
|
151
|
+
htmlFor: "insight-filter-severity",
|
|
152
|
+
children: f("brainyrich.insights.filters.severity", "Severity")
|
|
153
|
+
}), /* @__PURE__ */ T(W, {
|
|
154
|
+
value: h,
|
|
155
|
+
onValueChange: _,
|
|
156
|
+
children: [/* @__PURE__ */ w(q, {
|
|
157
|
+
id: "insight-filter-severity",
|
|
158
|
+
children: /* @__PURE__ */ w(J, {})
|
|
159
|
+
}), /* @__PURE__ */ T(G, { children: [/* @__PURE__ */ w(K, {
|
|
160
|
+
value: Z,
|
|
161
|
+
children: f("brainyrich.insights.filters.all", "All")
|
|
162
|
+
}), ie.map((e) => /* @__PURE__ */ w(K, {
|
|
163
|
+
value: e,
|
|
164
|
+
children: Q(e)
|
|
165
|
+
}, e))] })]
|
|
166
|
+
})]
|
|
150
167
|
}),
|
|
151
|
-
/* @__PURE__ */
|
|
152
|
-
className: "
|
|
153
|
-
children: /* @__PURE__ */
|
|
154
|
-
|
|
155
|
-
children:
|
|
156
|
-
})
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
168
|
+
/* @__PURE__ */ T("div", {
|
|
169
|
+
className: "w-full space-y-1.5 sm:w-48",
|
|
170
|
+
children: [/* @__PURE__ */ w(U, {
|
|
171
|
+
htmlFor: "insight-filter-status",
|
|
172
|
+
children: f("brainyrich.insights.filters.status", "Status")
|
|
173
|
+
}), /* @__PURE__ */ T(W, {
|
|
174
|
+
value: v,
|
|
175
|
+
onValueChange: y,
|
|
176
|
+
children: [/* @__PURE__ */ w(q, {
|
|
177
|
+
id: "insight-filter-status",
|
|
178
|
+
children: /* @__PURE__ */ w(J, {})
|
|
179
|
+
}), /* @__PURE__ */ T(G, { children: [/* @__PURE__ */ w(K, {
|
|
180
|
+
value: Z,
|
|
181
|
+
children: f("brainyrich.insights.filters.all", "All")
|
|
182
|
+
}), ae.map((e) => /* @__PURE__ */ w(K, {
|
|
183
|
+
value: e,
|
|
184
|
+
children: Q(e)
|
|
185
|
+
}, e))] })]
|
|
186
|
+
})]
|
|
187
|
+
}),
|
|
188
|
+
/* @__PURE__ */ T("div", {
|
|
189
|
+
className: "w-full space-y-1.5 sm:w-56",
|
|
190
|
+
children: [/* @__PURE__ */ w(U, {
|
|
191
|
+
htmlFor: "insight-filter-type",
|
|
192
|
+
children: f("brainyrich.insights.filters.type", "Type")
|
|
193
|
+
}), /* @__PURE__ */ T(W, {
|
|
194
|
+
value: b,
|
|
195
|
+
onValueChange: x,
|
|
196
|
+
children: [/* @__PURE__ */ w(q, {
|
|
197
|
+
id: "insight-filter-type",
|
|
198
|
+
children: /* @__PURE__ */ w(J, {})
|
|
199
|
+
}), /* @__PURE__ */ T(G, { children: [/* @__PURE__ */ w(K, {
|
|
200
|
+
value: Z,
|
|
201
|
+
children: f("brainyrich.insights.filters.all", "All")
|
|
202
|
+
}), X.map((e) => /* @__PURE__ */ w(K, {
|
|
203
|
+
value: e,
|
|
204
|
+
children: Q(e)
|
|
205
|
+
}, e))] })]
|
|
206
|
+
})]
|
|
207
|
+
})
|
|
208
|
+
]
|
|
209
|
+
}) }),
|
|
210
|
+
z.length === 0 ? /* @__PURE__ */ w(o, {
|
|
211
|
+
icon: /* @__PURE__ */ w(g, {
|
|
212
|
+
className: "size-6",
|
|
213
|
+
"aria-hidden": "true"
|
|
214
|
+
}),
|
|
215
|
+
title: $ ? f("brainyrich.insights.empty.filteredTitle", "No matching insights") : f("brainyrich.insights.empty.title", "No advisory insights yet"),
|
|
216
|
+
description: $ ? f("brainyrich.insights.empty.filteredDescription", "No insights match the selected filters. Adjust or clear them to see more.") : f("brainyrich.insights.empty.description", "Advisory insights flag rebalancing, drift, concentration and other opportunities. Create one to get started."),
|
|
217
|
+
action: $ ? /* @__PURE__ */ w(D, {
|
|
218
|
+
variant: "outline",
|
|
219
|
+
size: "sm",
|
|
220
|
+
onClick: () => {
|
|
221
|
+
_(Z), y(Z), x(Z);
|
|
222
|
+
},
|
|
223
|
+
children: f("brainyrich.insights.actions.clearFilters", "Clear filters")
|
|
224
|
+
}) : /* @__PURE__ */ T(D, {
|
|
225
|
+
size: "sm",
|
|
226
|
+
onClick: Y,
|
|
227
|
+
children: [/* @__PURE__ */ w(ee, {
|
|
228
|
+
className: "size-4",
|
|
229
|
+
"aria-hidden": "true"
|
|
230
|
+
}), f("brainyrich.insights.actions.create", "New insight")]
|
|
231
|
+
})
|
|
232
|
+
}) : /* @__PURE__ */ w("div", {
|
|
233
|
+
className: "space-y-3",
|
|
234
|
+
children: z.map((e) => /* @__PURE__ */ w(ce, {
|
|
235
|
+
insight: e,
|
|
236
|
+
translate: f,
|
|
237
|
+
onAcknowledge: () => A.mutate(e.id),
|
|
238
|
+
onDismiss: () => j.mutate(e.id),
|
|
239
|
+
onResolve: () => M.mutate(e.id),
|
|
240
|
+
acknowledgePending: A.isPending,
|
|
241
|
+
dismissPending: j.isPending,
|
|
242
|
+
resolvePending: M.isPending
|
|
243
|
+
}, e.id))
|
|
244
|
+
})
|
|
245
|
+
] })
|
|
246
|
+
}), /* @__PURE__ */ w(le, {
|
|
247
|
+
open: P,
|
|
248
|
+
form: I,
|
|
249
|
+
setField: R,
|
|
250
|
+
metricsValid: V,
|
|
251
|
+
valid: H,
|
|
252
|
+
pending: N.isPending,
|
|
253
|
+
onSubmit: oe,
|
|
254
|
+
onOpenChange: (e) => F(e),
|
|
255
|
+
translate: f
|
|
256
|
+
})] });
|
|
257
|
+
}
|
|
258
|
+
function ce({ insight: e, translate: t, onAcknowledge: n, onDismiss: r, onResolve: i, acknowledgePending: a, dismissPending: o, resolvePending: s }) {
|
|
259
|
+
let c = oe(e.severity), l = c.icon, u = e.status === "RESOLVED" || e.status === "DISMISSED";
|
|
260
|
+
return /* @__PURE__ */ T(O, { children: [/* @__PURE__ */ w(re, {
|
|
261
|
+
className: "pb-3",
|
|
262
|
+
children: /* @__PURE__ */ T("div", {
|
|
263
|
+
className: "flex items-start justify-between gap-3",
|
|
264
|
+
children: [/* @__PURE__ */ T("div", {
|
|
265
|
+
className: "flex min-w-0 items-start gap-3",
|
|
266
|
+
children: [/* @__PURE__ */ w("span", {
|
|
267
|
+
className: `mt-0.5 flex size-9 shrink-0 items-center justify-center rounded-full bg-bg-sunken ${c.tone}`,
|
|
268
|
+
children: /* @__PURE__ */ w(l, {
|
|
269
|
+
className: "size-5",
|
|
270
|
+
"aria-hidden": "true"
|
|
271
|
+
})
|
|
272
|
+
}), /* @__PURE__ */ T("div", {
|
|
273
|
+
className: "min-w-0",
|
|
274
|
+
children: [/* @__PURE__ */ w(A, {
|
|
275
|
+
className: "text-base",
|
|
276
|
+
children: e.title
|
|
277
|
+
}), /* @__PURE__ */ T(ne, {
|
|
278
|
+
className: "mt-1 flex flex-wrap items-center gap-2",
|
|
180
279
|
children: [
|
|
181
|
-
/* @__PURE__ */
|
|
182
|
-
|
|
183
|
-
children:
|
|
184
|
-
className: "text-muted-foreground",
|
|
185
|
-
children: L("brainyrich.aiAssistant.context.netWorth", "Net Worth")
|
|
186
|
-
}), /* @__PURE__ */ x("span", {
|
|
187
|
-
className: "font-medium",
|
|
188
|
-
children: V
|
|
189
|
-
})]
|
|
280
|
+
/* @__PURE__ */ w(E, {
|
|
281
|
+
variant: "outline",
|
|
282
|
+
children: Q(e.type)
|
|
190
283
|
}),
|
|
191
|
-
/* @__PURE__ */
|
|
192
|
-
|
|
193
|
-
children:
|
|
194
|
-
className:
|
|
195
|
-
children:
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
})
|
|
284
|
+
/* @__PURE__ */ w(E, {
|
|
285
|
+
variant: f(e.severity),
|
|
286
|
+
children: /* @__PURE__ */ T("span", {
|
|
287
|
+
className: `inline-flex items-center gap-1 ${c.tone}`,
|
|
288
|
+
children: [/* @__PURE__ */ w(l, {
|
|
289
|
+
className: "size-3",
|
|
290
|
+
"aria-hidden": "true"
|
|
291
|
+
}), Q(e.severity)]
|
|
292
|
+
})
|
|
200
293
|
}),
|
|
201
|
-
/* @__PURE__ */
|
|
202
|
-
|
|
203
|
-
children:
|
|
204
|
-
className: "text-muted-foreground",
|
|
205
|
-
children: L("brainyrich.aiAssistant.context.portfolios", "Portfolios")
|
|
206
|
-
}), /* @__PURE__ */ x("span", {
|
|
207
|
-
className: "font-medium",
|
|
208
|
-
children: m.length
|
|
209
|
-
})]
|
|
210
|
-
}),
|
|
211
|
-
/* @__PURE__ */ S("div", {
|
|
212
|
-
className: "flex items-center justify-between text-sm",
|
|
213
|
-
children: [/* @__PURE__ */ x("span", {
|
|
214
|
-
className: "text-muted-foreground",
|
|
215
|
-
children: L("brainyrich.aiAssistant.context.riskAlerts", "Risk Alerts")
|
|
216
|
-
}), /* @__PURE__ */ x(C, {
|
|
217
|
-
variant: v.some((e) => e.severity === "High") ? "destructive" : "secondary",
|
|
218
|
-
className: "text-[10px]",
|
|
219
|
-
children: L("brainyrich.aiAssistant.context.activeAlerts", "{count} active", { count: v.length })
|
|
220
|
-
})]
|
|
294
|
+
/* @__PURE__ */ w(E, {
|
|
295
|
+
variant: f(e.status),
|
|
296
|
+
children: Q(e.status)
|
|
221
297
|
})
|
|
222
298
|
]
|
|
299
|
+
})]
|
|
300
|
+
})]
|
|
301
|
+
}), /* @__PURE__ */ T(L, { children: [/* @__PURE__ */ w(V, {
|
|
302
|
+
asChild: !0,
|
|
303
|
+
children: /* @__PURE__ */ w(D, {
|
|
304
|
+
variant: "ghost",
|
|
305
|
+
size: "icon",
|
|
306
|
+
"aria-label": t("brainyrich.insights.actions.menu", "Insight actions"),
|
|
307
|
+
children: /* @__PURE__ */ w(b, {
|
|
308
|
+
className: "size-4",
|
|
309
|
+
"aria-hidden": "true"
|
|
310
|
+
})
|
|
311
|
+
})
|
|
312
|
+
}), /* @__PURE__ */ T(R, {
|
|
313
|
+
align: "end",
|
|
314
|
+
children: [
|
|
315
|
+
/* @__PURE__ */ T(z, {
|
|
316
|
+
disabled: a || e.status === "ACKNOWLEDGED" || u,
|
|
317
|
+
onSelect: n,
|
|
318
|
+
children: [/* @__PURE__ */ w(_, {
|
|
319
|
+
className: "size-4",
|
|
320
|
+
"aria-hidden": "true"
|
|
321
|
+
}), t("brainyrich.insights.actions.acknowledge", "Acknowledge")]
|
|
322
|
+
}),
|
|
323
|
+
/* @__PURE__ */ T(z, {
|
|
324
|
+
disabled: s || e.status === "RESOLVED",
|
|
325
|
+
onSelect: i,
|
|
326
|
+
children: [/* @__PURE__ */ w(_, {
|
|
327
|
+
className: "size-4",
|
|
328
|
+
"aria-hidden": "true"
|
|
329
|
+
}), t("brainyrich.insights.actions.resolve", "Resolve")]
|
|
330
|
+
}),
|
|
331
|
+
/* @__PURE__ */ w(B, {}),
|
|
332
|
+
/* @__PURE__ */ T(z, {
|
|
333
|
+
className: "text-status-error-text focus:text-status-error-text",
|
|
334
|
+
disabled: o || e.status === "DISMISSED",
|
|
335
|
+
onSelect: r,
|
|
336
|
+
children: [/* @__PURE__ */ w(S, {
|
|
337
|
+
className: "size-4",
|
|
338
|
+
"aria-hidden": "true"
|
|
339
|
+
}), t("brainyrich.insights.actions.dismiss", "Dismiss")]
|
|
340
|
+
})
|
|
341
|
+
]
|
|
342
|
+
})] })]
|
|
343
|
+
})
|
|
344
|
+
}), /* @__PURE__ */ T(k, {
|
|
345
|
+
className: "space-y-3",
|
|
346
|
+
children: [
|
|
347
|
+
e.detail ? /* @__PURE__ */ w("p", {
|
|
348
|
+
className: "text-sm text-text-secondary",
|
|
349
|
+
children: e.detail
|
|
350
|
+
}) : null,
|
|
351
|
+
/* @__PURE__ */ T("dl", {
|
|
352
|
+
className: "grid grid-cols-2 gap-3 rounded-lg bg-bg-sunken p-3 text-sm sm:grid-cols-3",
|
|
353
|
+
children: [
|
|
354
|
+
/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("dt", {
|
|
355
|
+
className: "text-xs text-text-secondary",
|
|
356
|
+
children: t("brainyrich.insights.card.subjectType", "Subject")
|
|
357
|
+
}), /* @__PURE__ */ w("dd", {
|
|
358
|
+
className: "font-medium text-text-primary",
|
|
359
|
+
children: Q(e.subjectType)
|
|
360
|
+
})] }),
|
|
361
|
+
/* @__PURE__ */ T("div", {
|
|
362
|
+
className: "min-w-0",
|
|
363
|
+
children: [/* @__PURE__ */ w("dt", {
|
|
364
|
+
className: "text-xs text-text-secondary",
|
|
365
|
+
children: t("brainyrich.insights.card.subjectId", "Subject ID")
|
|
366
|
+
}), /* @__PURE__ */ w("dd", {
|
|
367
|
+
className: "truncate font-medium text-text-primary",
|
|
368
|
+
title: e.subjectId,
|
|
369
|
+
children: e.subjectId
|
|
370
|
+
})]
|
|
371
|
+
}),
|
|
372
|
+
/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("dt", {
|
|
373
|
+
className: "text-xs text-text-secondary",
|
|
374
|
+
children: t("brainyrich.insights.card.created", "Created")
|
|
375
|
+
}), /* @__PURE__ */ w("dd", {
|
|
376
|
+
className: "font-medium text-text-primary",
|
|
377
|
+
children: d(e.createdAt)
|
|
223
378
|
})] })
|
|
224
379
|
]
|
|
225
|
-
}),
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
children: [/* @__PURE__ */ x("div", {
|
|
293
|
-
className: "rounded-full bg-blue-100 p-2",
|
|
294
|
-
children: /* @__PURE__ */ x(s, { className: "h-4 w-4 text-blue-600" })
|
|
295
|
-
}), /* @__PURE__ */ x("div", {
|
|
296
|
-
className: "rounded-lg bg-muted p-3",
|
|
297
|
-
children: /* @__PURE__ */ S("div", {
|
|
298
|
-
className: "flex space-x-1",
|
|
299
|
-
children: [
|
|
300
|
-
/* @__PURE__ */ x("div", { className: "h-2 w-2 animate-bounce rounded-full bg-muted-foreground/40" }),
|
|
301
|
-
/* @__PURE__ */ x("div", {
|
|
302
|
-
className: "h-2 w-2 animate-bounce rounded-full bg-muted-foreground/40",
|
|
303
|
-
style: { animationDelay: "0.1s" }
|
|
304
|
-
}),
|
|
305
|
-
/* @__PURE__ */ x("div", {
|
|
306
|
-
className: "h-2 w-2 animate-bounce rounded-full bg-muted-foreground/40",
|
|
307
|
-
style: { animationDelay: "0.2s" }
|
|
308
|
-
})
|
|
309
|
-
]
|
|
310
|
-
})
|
|
311
|
-
})]
|
|
312
|
-
}) : null,
|
|
313
|
-
/* @__PURE__ */ x("div", { ref: X })
|
|
314
|
-
]
|
|
315
|
-
}),
|
|
316
|
-
H.length <= 1 ? /* @__PURE__ */ S("div", {
|
|
317
|
-
className: "border-t px-4 py-3",
|
|
318
|
-
children: [/* @__PURE__ */ S("p", {
|
|
319
|
-
className: "mb-2 flex items-center gap-1 text-xs text-muted-foreground",
|
|
320
|
-
children: [/* @__PURE__ */ x(_, { className: "h-3 w-3" }), L("brainyrich.aiAssistant.sections.suggestedQuestions", "Suggested questions")]
|
|
321
|
-
}), /* @__PURE__ */ x("div", {
|
|
322
|
-
className: "grid gap-2 sm:grid-cols-2",
|
|
323
|
-
children: B.map((e) => /* @__PURE__ */ S("button", {
|
|
324
|
-
type: "button",
|
|
325
|
-
className: "flex items-center gap-2 rounded-md border p-2 text-left text-sm transition-colors hover:bg-accent",
|
|
326
|
-
onClick: () => $(e.text),
|
|
327
|
-
children: [/* @__PURE__ */ x(e.icon, { className: "h-4 w-4 shrink-0 text-muted-foreground" }), e.text]
|
|
328
|
-
}, e.text))
|
|
380
|
+
}),
|
|
381
|
+
/* @__PURE__ */ T("div", {
|
|
382
|
+
className: "flex flex-wrap items-center gap-2",
|
|
383
|
+
children: [/* @__PURE__ */ T(D, {
|
|
384
|
+
variant: "outline",
|
|
385
|
+
size: "sm",
|
|
386
|
+
disabled: a || e.status === "ACKNOWLEDGED" || u,
|
|
387
|
+
onClick: n,
|
|
388
|
+
children: [/* @__PURE__ */ w(_, {
|
|
389
|
+
className: "size-4",
|
|
390
|
+
"aria-hidden": "true"
|
|
391
|
+
}), t("brainyrich.insights.actions.acknowledge", "Acknowledge")]
|
|
392
|
+
}), /* @__PURE__ */ T(D, {
|
|
393
|
+
size: "sm",
|
|
394
|
+
disabled: s || e.status === "RESOLVED",
|
|
395
|
+
onClick: i,
|
|
396
|
+
children: [/* @__PURE__ */ w(_, {
|
|
397
|
+
className: "size-4",
|
|
398
|
+
"aria-hidden": "true"
|
|
399
|
+
}), t("brainyrich.insights.actions.resolve", "Resolve")]
|
|
400
|
+
})]
|
|
401
|
+
})
|
|
402
|
+
]
|
|
403
|
+
})] });
|
|
404
|
+
}
|
|
405
|
+
function le({ open: e, form: t, setField: n, metricsValid: r, valid: i, pending: a, onSubmit: o, onOpenChange: s, translate: c }) {
|
|
406
|
+
return /* @__PURE__ */ w(j, {
|
|
407
|
+
open: e,
|
|
408
|
+
onOpenChange: s,
|
|
409
|
+
children: /* @__PURE__ */ T(M, {
|
|
410
|
+
className: "max-h-[90vh] overflow-y-auto sm:max-w-lg",
|
|
411
|
+
children: [/* @__PURE__ */ T(F, { children: [/* @__PURE__ */ w(I, { children: c("brainyrich.insights.form.createTitle", "New insight") }), /* @__PURE__ */ w(N, { children: c("brainyrich.insights.form.subtitle", "Flag an advisory insight against a portfolio, account, goal or household.") })] }), /* @__PURE__ */ T("form", {
|
|
412
|
+
className: "space-y-4",
|
|
413
|
+
onSubmit: (e) => {
|
|
414
|
+
e.preventDefault(), o();
|
|
415
|
+
},
|
|
416
|
+
children: [
|
|
417
|
+
/* @__PURE__ */ T("div", {
|
|
418
|
+
className: "space-y-1.5",
|
|
419
|
+
children: [/* @__PURE__ */ w(U, {
|
|
420
|
+
htmlFor: "insight-title",
|
|
421
|
+
children: c("brainyrich.insights.form.title", "Title")
|
|
422
|
+
}), /* @__PURE__ */ w(H, {
|
|
423
|
+
id: "insight-title",
|
|
424
|
+
value: t.title,
|
|
425
|
+
onChange: (e) => n("title", e.target.value),
|
|
426
|
+
placeholder: c("brainyrich.insights.form.titlePlaceholder", "e.g. Technology concentration above threshold"),
|
|
427
|
+
required: !0
|
|
428
|
+
})]
|
|
429
|
+
}),
|
|
430
|
+
/* @__PURE__ */ T("div", {
|
|
431
|
+
className: "grid grid-cols-2 gap-3",
|
|
432
|
+
children: [/* @__PURE__ */ T("div", {
|
|
433
|
+
className: "space-y-1.5",
|
|
434
|
+
children: [/* @__PURE__ */ w(U, {
|
|
435
|
+
htmlFor: "insight-type",
|
|
436
|
+
children: c("brainyrich.insights.form.type", "Type")
|
|
437
|
+
}), /* @__PURE__ */ T(W, {
|
|
438
|
+
value: t.type,
|
|
439
|
+
onValueChange: (e) => n("type", e),
|
|
440
|
+
children: [/* @__PURE__ */ w(q, {
|
|
441
|
+
id: "insight-type",
|
|
442
|
+
children: /* @__PURE__ */ w(J, {})
|
|
443
|
+
}), /* @__PURE__ */ w(G, { children: X.map((e) => /* @__PURE__ */ w(K, {
|
|
444
|
+
value: e,
|
|
445
|
+
children: Q(e)
|
|
446
|
+
}, e)) })]
|
|
329
447
|
})]
|
|
330
|
-
})
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
className: "pr-20"
|
|
346
|
-
}), /* @__PURE__ */ S("div", {
|
|
347
|
-
className: "absolute right-2 top-1/2 flex -translate-y-1/2 items-center gap-1",
|
|
348
|
-
children: [/* @__PURE__ */ x(w, {
|
|
349
|
-
variant: "ghost",
|
|
350
|
-
size: "icon",
|
|
351
|
-
className: "h-7 w-7",
|
|
352
|
-
children: /* @__PURE__ */ x(p, { className: "h-4 w-4" })
|
|
353
|
-
}), /* @__PURE__ */ x(w, {
|
|
354
|
-
variant: "ghost",
|
|
355
|
-
size: "icon",
|
|
356
|
-
className: "h-7 w-7",
|
|
357
|
-
children: /* @__PURE__ */ x(f, { className: "h-4 w-4" })
|
|
358
|
-
})]
|
|
359
|
-
})]
|
|
360
|
-
}), /* @__PURE__ */ x(w, {
|
|
361
|
-
onClick: Q,
|
|
362
|
-
disabled: !W.trim() || K,
|
|
363
|
-
size: "sm",
|
|
364
|
-
children: /* @__PURE__ */ x(g, { className: "h-4 w-4" })
|
|
365
|
-
})]
|
|
366
|
-
}), /* @__PURE__ */ S("div", {
|
|
367
|
-
className: "mt-2 flex items-center justify-between text-xs text-muted-foreground",
|
|
368
|
-
children: [/* @__PURE__ */ S("span", {
|
|
369
|
-
className: "flex items-center gap-1",
|
|
370
|
-
children: [/* @__PURE__ */ x(d, { className: "h-3 w-3" }), L("brainyrich.aiAssistant.disclaimer", "AI can make mistakes. Always verify important financial information.")]
|
|
371
|
-
}), /* @__PURE__ */ S("span", {
|
|
372
|
-
className: "flex items-center gap-1",
|
|
373
|
-
children: [/* @__PURE__ */ x("kbd", {
|
|
374
|
-
className: "rounded bg-muted px-1.5 py-0.5 text-[10px]",
|
|
375
|
-
children: "Enter"
|
|
376
|
-
}), L("brainyrich.aiAssistant.input.toSend", "to send")]
|
|
377
|
-
})]
|
|
448
|
+
}), /* @__PURE__ */ T("div", {
|
|
449
|
+
className: "space-y-1.5",
|
|
450
|
+
children: [/* @__PURE__ */ w(U, {
|
|
451
|
+
htmlFor: "insight-severity",
|
|
452
|
+
children: c("brainyrich.insights.form.severity", "Severity")
|
|
453
|
+
}), /* @__PURE__ */ T(W, {
|
|
454
|
+
value: t.severity,
|
|
455
|
+
onValueChange: (e) => n("severity", e),
|
|
456
|
+
children: [/* @__PURE__ */ w(q, {
|
|
457
|
+
id: "insight-severity",
|
|
458
|
+
children: /* @__PURE__ */ w(J, {})
|
|
459
|
+
}), /* @__PURE__ */ w(G, { children: ie.map((e) => /* @__PURE__ */ w(K, {
|
|
460
|
+
value: e,
|
|
461
|
+
children: Q(e)
|
|
462
|
+
}, e)) })]
|
|
378
463
|
})]
|
|
379
|
-
})
|
|
380
|
-
|
|
381
|
-
|
|
464
|
+
})]
|
|
465
|
+
}),
|
|
466
|
+
/* @__PURE__ */ T("div", {
|
|
467
|
+
className: "grid grid-cols-2 gap-3",
|
|
468
|
+
children: [/* @__PURE__ */ T("div", {
|
|
469
|
+
className: "space-y-1.5",
|
|
470
|
+
children: [/* @__PURE__ */ w(U, {
|
|
471
|
+
htmlFor: "insight-subject-type",
|
|
472
|
+
children: c("brainyrich.insights.form.subjectType", "Subject type")
|
|
473
|
+
}), /* @__PURE__ */ w(H, {
|
|
474
|
+
id: "insight-subject-type",
|
|
475
|
+
value: t.subjectType,
|
|
476
|
+
onChange: (e) => n("subjectType", e.target.value),
|
|
477
|
+
placeholder: c("brainyrich.insights.form.subjectTypePlaceholder", "e.g. PORTFOLIO"),
|
|
478
|
+
required: !0
|
|
479
|
+
})]
|
|
480
|
+
}), /* @__PURE__ */ T("div", {
|
|
481
|
+
className: "space-y-1.5",
|
|
482
|
+
children: [/* @__PURE__ */ w(U, {
|
|
483
|
+
htmlFor: "insight-subject-id",
|
|
484
|
+
children: c("brainyrich.insights.form.subjectId", "Subject ID")
|
|
485
|
+
}), /* @__PURE__ */ w(H, {
|
|
486
|
+
id: "insight-subject-id",
|
|
487
|
+
value: t.subjectId,
|
|
488
|
+
onChange: (e) => n("subjectId", e.target.value),
|
|
489
|
+
placeholder: c("brainyrich.insights.form.subjectIdPlaceholder", "Referenced entity ID"),
|
|
490
|
+
required: !0
|
|
491
|
+
})]
|
|
492
|
+
})]
|
|
493
|
+
}),
|
|
494
|
+
/* @__PURE__ */ T("div", {
|
|
495
|
+
className: "space-y-1.5",
|
|
496
|
+
children: [/* @__PURE__ */ w(U, {
|
|
497
|
+
htmlFor: "insight-owner",
|
|
498
|
+
children: c("brainyrich.insights.form.ownerId", "Owner ID (optional)")
|
|
499
|
+
}), /* @__PURE__ */ w(H, {
|
|
500
|
+
id: "insight-owner",
|
|
501
|
+
value: t.ownerId,
|
|
502
|
+
onChange: (e) => n("ownerId", e.target.value),
|
|
503
|
+
placeholder: c("brainyrich.insights.form.ownerIdPlaceholder", "Defaults to the current owner")
|
|
504
|
+
})]
|
|
505
|
+
}),
|
|
506
|
+
/* @__PURE__ */ T("div", {
|
|
507
|
+
className: "space-y-1.5",
|
|
508
|
+
children: [/* @__PURE__ */ w(U, {
|
|
509
|
+
htmlFor: "insight-detail",
|
|
510
|
+
children: c("brainyrich.insights.form.detail", "Detail")
|
|
511
|
+
}), /* @__PURE__ */ w(Y, {
|
|
512
|
+
id: "insight-detail",
|
|
513
|
+
value: t.detail,
|
|
514
|
+
onChange: (e) => n("detail", e.target.value),
|
|
515
|
+
rows: 3,
|
|
516
|
+
placeholder: c("brainyrich.insights.form.detailPlaceholder", "Explain the finding and recommended action.")
|
|
517
|
+
})]
|
|
518
|
+
}),
|
|
519
|
+
/* @__PURE__ */ T("div", {
|
|
520
|
+
className: "space-y-1.5",
|
|
521
|
+
children: [
|
|
522
|
+
/* @__PURE__ */ w(U, {
|
|
523
|
+
htmlFor: "insight-metrics",
|
|
524
|
+
children: c("brainyrich.insights.form.metrics", "Metrics JSON (optional)")
|
|
525
|
+
}),
|
|
526
|
+
/* @__PURE__ */ w(Y, {
|
|
527
|
+
id: "insight-metrics",
|
|
528
|
+
value: t.metrics,
|
|
529
|
+
onChange: (e) => n("metrics", e.target.value),
|
|
530
|
+
rows: 3,
|
|
531
|
+
className: "font-mono text-xs",
|
|
532
|
+
placeholder: "{ \"driftPct\": 8.2 }",
|
|
533
|
+
"aria-invalid": !r
|
|
534
|
+
}),
|
|
535
|
+
r ? null : /* @__PURE__ */ T("p", {
|
|
536
|
+
className: "flex items-center gap-1 text-xs text-status-error-text",
|
|
537
|
+
children: [/* @__PURE__ */ w(h, {
|
|
538
|
+
className: "size-3.5",
|
|
539
|
+
"aria-hidden": "true"
|
|
540
|
+
}), c("brainyrich.insights.form.metricsInvalid", "Enter valid JSON or leave blank.")]
|
|
541
|
+
})
|
|
542
|
+
]
|
|
543
|
+
}),
|
|
544
|
+
/* @__PURE__ */ T(P, { children: [/* @__PURE__ */ w(D, {
|
|
545
|
+
type: "button",
|
|
546
|
+
variant: "outline",
|
|
547
|
+
onClick: () => s(!1),
|
|
548
|
+
disabled: a,
|
|
549
|
+
children: c("brainyrich.insights.form.cancel", "Cancel")
|
|
550
|
+
}), /* @__PURE__ */ w(D, {
|
|
551
|
+
type: "submit",
|
|
552
|
+
disabled: !i || a,
|
|
553
|
+
children: a ? c("brainyrich.insights.form.saving", "Saving…") : c("brainyrich.insights.form.create", "Create insight")
|
|
554
|
+
})] })
|
|
555
|
+
]
|
|
382
556
|
})]
|
|
383
557
|
})
|
|
384
558
|
});
|
|
385
559
|
}
|
|
386
560
|
//#endregion
|
|
387
|
-
export {
|
|
561
|
+
export { $ as AiAssistantPage };
|
|
388
562
|
|
|
389
563
|
//# sourceMappingURL=AiAssistantPage.js.map
|