@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.
Files changed (47) hide show
  1. package/dist/brainyrich/BrainyRichRoot.js +13 -13
  2. package/dist/brainyrich/components/ActorName.js +38 -0
  3. package/dist/brainyrich/components/ActorName.js.map +1 -0
  4. package/dist/brainyrich/components/ConfirmDialog.js +25 -0
  5. package/dist/brainyrich/components/ConfirmDialog.js.map +1 -0
  6. package/dist/brainyrich/components/LoadMore.js +24 -0
  7. package/dist/brainyrich/components/LoadMore.js.map +1 -0
  8. package/dist/brainyrich/components/index.js +5 -0
  9. package/dist/brainyrich/components/notify.js +38 -0
  10. package/dist/brainyrich/components/notify.js.map +1 -0
  11. package/dist/brainyrich/components/pickers.js +232 -0
  12. package/dist/brainyrich/components/pickers.js.map +1 -0
  13. package/dist/brainyrich/components/reuse/CommentThread.js +208 -0
  14. package/dist/brainyrich/components/reuse/CommentThread.js.map +1 -0
  15. package/dist/brainyrich/components/reuse/DocumentsPanel.js +237 -0
  16. package/dist/brainyrich/components/reuse/DocumentsPanel.js.map +1 -0
  17. package/dist/brainyrich/components/reuse/TagField.js +206 -0
  18. package/dist/brainyrich/components/reuse/TagField.js.map +1 -0
  19. package/dist/brainyrich/components/reuse/transport.js +24 -0
  20. package/dist/brainyrich/components/reuse/transport.js.map +1 -0
  21. package/dist/brainyrich/hooks/useBrainyRichApi.js +644 -372
  22. package/dist/brainyrich/hooks/useBrainyRichApi.js.map +1 -1
  23. package/dist/brainyrich/pages/AccountsPage.js +346 -293
  24. package/dist/brainyrich/pages/AccountsPage.js.map +1 -1
  25. package/dist/brainyrich/pages/AiAssistantPage.js +339 -320
  26. package/dist/brainyrich/pages/AiAssistantPage.js.map +1 -1
  27. package/dist/brainyrich/pages/AnalyticsPage.js +178 -164
  28. package/dist/brainyrich/pages/AnalyticsPage.js.map +1 -1
  29. package/dist/brainyrich/pages/DashboardPage.js +195 -169
  30. package/dist/brainyrich/pages/DashboardPage.js.map +1 -1
  31. package/dist/brainyrich/pages/FamilyPage.js +247 -198
  32. package/dist/brainyrich/pages/FamilyPage.js.map +1 -1
  33. package/dist/brainyrich/pages/GoalsPage.js +478 -442
  34. package/dist/brainyrich/pages/GoalsPage.js.map +1 -1
  35. package/dist/brainyrich/pages/InvestmentsPage.js.map +1 -1
  36. package/dist/brainyrich/pages/PortfoliosPage.js +438 -396
  37. package/dist/brainyrich/pages/PortfoliosPage.js.map +1 -1
  38. package/dist/brainyrich/pages/ReportsPage.js +246 -213
  39. package/dist/brainyrich/pages/ReportsPage.js.map +1 -1
  40. package/dist/brainyrich/pages/RiskPage.js +321 -173
  41. package/dist/brainyrich/pages/RiskPage.js.map +1 -1
  42. package/dist/brainyrich/pages/TaxPage.js +258 -225
  43. package/dist/brainyrich/pages/TaxPage.js.map +1 -1
  44. package/dist/brainyrich/pages/_shared.js.map +1 -1
  45. package/dist/node_modules/sonner/dist/index.js +163 -0
  46. package/dist/node_modules/sonner/dist/index.js.map +1 -0
  47. package/package.json +3 -2
@@ -1,31 +1,38 @@
1
1
  import { tWithFallback as e } from "../utils/i18n.js";
2
- import { useAccounts as t, useArchiveHousehold as n, useCreateHousehold as r, useGoals as i, useHousehold as a, useHouseholds as o, usePortfolios as s, useUpdateHousehold as c } from "../hooks/useBrainyRichApi.js";
3
- import { EmptyState as l, ErrorState as u, KpiGrid as d, LoadingState as f, SectionShell as p, formatDate as m, formatMoney as h, statusBadgeVariant as g } from "./_shared.js";
4
- import { useMemo as _, useState as v } from "react";
5
- import { Archive as y, Briefcase as b, Eye as ee, Mail as te, MoreHorizontal as ne, Pencil as x, Target as S, Users as C, Wallet as w } from "lucide-react";
6
- import { useI18n as re } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
7
- import { jsx as T, jsxs as E } from "react/jsx-runtime";
8
- import { Badge as D, Button as O, Card as k, CardContent as A, Dialog as j, DialogClose as M, DialogContent as N, DialogDescription as P, DialogFooter as F, DialogHeader as I, DialogTitle as L, DropdownMenu as ie, DropdownMenuContent as ae, DropdownMenuItem as R, DropdownMenuSeparator as oe, DropdownMenuTrigger as se, Input as z, Label as B, Select as V, SelectContent as H, SelectItem as U, SelectTrigger as W, SelectValue as G, Sheet as K, SheetContent as ce, SheetDescription as le, SheetHeader as ue, SheetTitle as de, Table as fe, TableBody as pe, TableCell as q, TableHead as J, TableHeader as me, TableRow as Y, Textarea as he } from "@burdenoff/fe-libs/ui";
2
+ import { useAccounts as t, useArchiveHousehold as n, useCreateHousehold as r, useGoals as i, useHousehold as a, usePagedHouseholds as o, usePortfolios as s, useUpdateHousehold as c } from "../hooks/useBrainyRichApi.js";
3
+ import { LoadMore as l } from "../components/LoadMore.js";
4
+ import { ConfirmDialog as u } from "../components/ConfirmDialog.js";
5
+ import { ActorName as d } from "../components/ActorName.js";
6
+ import "../components/index.js";
7
+ import { EmptyState as f, ErrorState as p, KpiGrid as m, LoadingState as h, SectionShell as g, formatDate as _, formatMoney as v, statusBadgeVariant as ee } from "./_shared.js";
8
+ import { DocumentsPanel as y } from "../components/reuse/DocumentsPanel.js";
9
+ import { TagField as b } from "../components/reuse/TagField.js";
10
+ import { CommentThread as x } from "../components/reuse/CommentThread.js";
11
+ import { useMemo as S, useState as C } from "react";
12
+ import { Archive as te, Briefcase as w, Eye as ne, Mail as re, MoreHorizontal as ie, Pencil as T, Target as E, Users as D, Wallet as O } from "lucide-react";
13
+ import { useI18n as ae } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
14
+ import { jsx as k, jsxs as A } from "react/jsx-runtime";
15
+ import { Badge as j, Button as M, Card as oe, CardContent as se, Dialog as N, DialogClose as P, DialogContent as F, DialogDescription as I, DialogFooter as L, DialogHeader as R, DialogTitle as z, DropdownMenu as ce, DropdownMenuContent as le, DropdownMenuItem as B, DropdownMenuSeparator as ue, DropdownMenuTrigger as de, Input as V, Label as H, Select as U, SelectContent as W, SelectItem as G, SelectTrigger as K, SelectValue as q, Sheet as J, SheetContent as Y, SheetDescription as fe, SheetHeader as pe, SheetTitle as me, Table as he, TableBody as ge, TableCell as X, TableHead as Z, TableHeader as _e, TableRow as ve, Textarea as ye } from "@burdenoff/fe-libs/ui";
9
16
  //#region src/brainyrich/pages/FamilyPage.tsx
10
- var ge = [
17
+ var be = [
11
18
  "PROSPECT",
12
19
  "ONBOARDING",
13
20
  "ACTIVE",
14
21
  "INACTIVE"
15
- ], _e = [
22
+ ], xe = [
16
23
  "CONSERVATIVE",
17
24
  "MODERATE",
18
25
  "BALANCED",
19
26
  "GROWTH",
20
27
  "AGGRESSIVE"
21
- ], ve = [
28
+ ], Se = [
22
29
  "USD",
23
30
  "EUR",
24
31
  "GBP",
25
32
  "INR",
26
33
  "AED",
27
34
  "SGD"
28
- ], X = {
35
+ ], Ce = {
29
36
  name: "",
30
37
  status: "PROSPECT",
31
38
  riskProfile: "BALANCED",
@@ -36,17 +43,17 @@ var ge = [
36
43
  notes: "",
37
44
  tags: ""
38
45
  };
39
- function Z(e) {
46
+ function we(e) {
40
47
  return e.split(",").map((e) => e.trim()).filter(Boolean);
41
48
  }
42
- function ye() {
43
- let { t } = re(), i = (n, r, i) => e(t, n, r, i), { data: a, isLoading: s, isError: m, refetch: b } = o(), S = r(), w = c(), j = n(), [M, N] = v(!1), [P, F] = v(null), [I, L] = v(X), [z, B] = v(void 0), V = (e, t) => L((n) => ({
49
+ function Te() {
50
+ let { t } = ae(), i = (n, r, i) => e(t, n, r, i), { items: a, hasMore: s, loadMore: d, isLoading: _, isFetchingNextPage: y, isError: b, refetch: x } = o(), w = r(), E = c(), O = n(), [N, P] = C(!1), [F, I] = C(null), [L, R] = C(Ce), [z, V] = C(void 0), [H, U] = C(null), W = (e, t) => R((n) => ({
44
51
  ...n,
45
52
  [e]: t
46
- })), H = () => {
47
- F(null), L(X), N(!0);
48
- }, U = (e) => {
49
- F(e), L({
53
+ })), G = () => {
54
+ I(null), R(Ce), P(!0);
55
+ }, K = (e) => {
56
+ I(e), R({
50
57
  name: e.name,
51
58
  status: e.status,
52
59
  riskProfile: e.riskProfile,
@@ -56,153 +63,152 @@ function ye() {
56
63
  primaryContactEmail: e.primaryContactEmail ?? "",
57
64
  notes: e.notes ?? "",
58
65
  tags: e.tags.join(", ")
59
- }), N(!0);
60
- }, W = _(() => ({
66
+ }), P(!0);
67
+ }, q = S(() => ({
61
68
  total: a.length,
62
69
  active: a.filter((e) => e.status === "ACTIVE").length,
63
70
  pipeline: a.filter((e) => e.status === "PROSPECT" || e.status === "ONBOARDING").length,
64
71
  aum: a.reduce((e, t) => e + (Number.isFinite(t.aum) ? t.aum : 0), 0),
65
72
  currency: a[0]?.currency ?? "USD"
66
- }), [a]), G = S.isPending || w.isPending, K = I.name.trim().length > 0 && !G;
67
- return /* @__PURE__ */ E(p, {
73
+ }), [a]), J = w.isPending || E.isPending, Y = L.name.trim().length > 0 && !J;
74
+ return /* @__PURE__ */ A(g, {
68
75
  title: i("brainyrich.households.title", "Households"),
69
76
  description: i("brainyrich.households.description", "Client households and family units under advisement"),
70
77
  badges: a.length ? [i("brainyrich.households.count", "{count} households", { count: a.length })] : [],
71
78
  actionLabel: i("brainyrich.households.new", "New household"),
72
- onAction: H,
79
+ onAction: G,
73
80
  children: [
74
- /* @__PURE__ */ T(d, { items: [
81
+ /* @__PURE__ */ k(m, { items: [
75
82
  {
76
83
  label: i("brainyrich.households.kpi.total", "Households"),
77
- value: String(W.total)
84
+ value: String(q.total)
78
85
  },
79
86
  {
80
87
  label: i("brainyrich.households.kpi.active", "Active"),
81
- value: String(W.active)
88
+ value: String(q.active)
82
89
  },
83
90
  {
84
91
  label: i("brainyrich.households.kpi.pipeline", "In pipeline"),
85
- value: String(W.pipeline),
92
+ value: String(q.pipeline),
86
93
  trend: i("brainyrich.households.kpi.pipelineHint", "Prospect + onboarding")
87
94
  },
88
95
  {
89
96
  label: i("brainyrich.households.kpi.aum", "Total AUM"),
90
- value: h(W.aum, W.currency)
97
+ value: v(q.aum, q.currency)
91
98
  }
92
99
  ] }),
93
- s ? /* @__PURE__ */ T(f, { rows: 5 }) : m ? /* @__PURE__ */ T(u, {
100
+ _ ? /* @__PURE__ */ k(h, { rows: 5 }) : b ? /* @__PURE__ */ k(p, {
94
101
  title: i("brainyrich.households.error.title", "Could not load households"),
95
- onRetry: () => b()
96
- }) : a.length === 0 ? /* @__PURE__ */ T(l, {
97
- icon: /* @__PURE__ */ T(C, {
102
+ onRetry: () => x()
103
+ }) : a.length === 0 ? /* @__PURE__ */ k(f, {
104
+ icon: /* @__PURE__ */ k(D, {
98
105
  className: "size-6",
99
106
  "aria-hidden": "true"
100
107
  }),
101
108
  title: i("brainyrich.households.empty.title", "No households yet"),
102
109
  description: i("brainyrich.households.empty.description", "Create your first client household to start organizing accounts, portfolios and goals."),
103
- action: /* @__PURE__ */ T(O, {
110
+ action: /* @__PURE__ */ k(M, {
104
111
  size: "sm",
105
- onClick: H,
112
+ onClick: G,
106
113
  children: i("brainyrich.households.new", "New household")
107
114
  })
108
- }) : /* @__PURE__ */ T(k, { children: /* @__PURE__ */ T(A, {
115
+ }) : /* @__PURE__ */ k(oe, { children: /* @__PURE__ */ k(se, {
109
116
  className: "p-0",
110
- children: /* @__PURE__ */ T("div", {
117
+ children: /* @__PURE__ */ k("div", {
111
118
  className: "overflow-x-auto",
112
- children: /* @__PURE__ */ E(fe, { children: [/* @__PURE__ */ T(me, { children: /* @__PURE__ */ E(Y, { children: [
113
- /* @__PURE__ */ T(J, { children: i("brainyrich.households.col.name", "Household") }),
114
- /* @__PURE__ */ T(J, { children: i("brainyrich.households.col.status", "Status") }),
115
- /* @__PURE__ */ T(J, { children: i("brainyrich.households.col.risk", "Risk profile") }),
116
- /* @__PURE__ */ T(J, { children: i("brainyrich.households.col.contact", "Primary contact") }),
117
- /* @__PURE__ */ T(J, {
119
+ children: /* @__PURE__ */ A(he, { children: [/* @__PURE__ */ k(_e, { children: /* @__PURE__ */ A(ve, { children: [
120
+ /* @__PURE__ */ k(Z, { children: i("brainyrich.households.col.name", "Household") }),
121
+ /* @__PURE__ */ k(Z, { children: i("brainyrich.households.col.status", "Status") }),
122
+ /* @__PURE__ */ k(Z, { children: i("brainyrich.households.col.risk", "Risk profile") }),
123
+ /* @__PURE__ */ k(Z, { children: i("brainyrich.households.col.contact", "Primary contact") }),
124
+ /* @__PURE__ */ k(Z, {
118
125
  className: "text-right",
119
126
  children: i("brainyrich.households.col.aum", "AUM")
120
127
  }),
121
- /* @__PURE__ */ T(J, {
128
+ /* @__PURE__ */ k(Z, {
122
129
  className: "w-12 text-right",
123
- children: /* @__PURE__ */ T("span", {
130
+ children: /* @__PURE__ */ k("span", {
124
131
  className: "sr-only",
125
132
  children: i("brainyrich.households.col.actions", "Actions")
126
133
  })
127
134
  })
128
- ] }) }), /* @__PURE__ */ T(pe, { children: a.map((e) => /* @__PURE__ */ E(Y, { children: [
129
- /* @__PURE__ */ E(q, { children: [/* @__PURE__ */ T("button", {
135
+ ] }) }), /* @__PURE__ */ k(ge, { children: a.map((e) => /* @__PURE__ */ A(ve, { children: [
136
+ /* @__PURE__ */ A(X, { children: [/* @__PURE__ */ k("button", {
130
137
  type: "button",
131
138
  className: "text-left font-medium text-text-primary hover:underline",
132
- onClick: () => B(e.id),
139
+ onClick: () => V(e.id),
133
140
  children: e.name
134
- }), e.tags.length > 0 ? /* @__PURE__ */ T("div", {
141
+ }), e.tags.length > 0 ? /* @__PURE__ */ k("div", {
135
142
  className: "mt-1 flex flex-wrap gap-1",
136
- children: e.tags.map((e) => /* @__PURE__ */ T(D, {
143
+ children: e.tags.map((e) => /* @__PURE__ */ k(j, {
137
144
  variant: "outline",
138
145
  className: "text-xs",
139
146
  children: e
140
147
  }, e))
141
148
  }) : null] }),
142
- /* @__PURE__ */ T(q, { children: /* @__PURE__ */ T(D, {
143
- variant: g(e.status),
149
+ /* @__PURE__ */ k(X, { children: /* @__PURE__ */ k(j, {
150
+ variant: ee(e.status),
144
151
  children: e.status
145
152
  }) }),
146
- /* @__PURE__ */ T(q, { children: /* @__PURE__ */ T(D, {
153
+ /* @__PURE__ */ k(X, { children: /* @__PURE__ */ k(j, {
147
154
  variant: "secondary",
148
155
  children: e.riskProfile
149
156
  }) }),
150
- /* @__PURE__ */ T(q, { children: e.primaryContactName ? /* @__PURE__ */ E("div", {
157
+ /* @__PURE__ */ k(X, { children: e.primaryContactName ? /* @__PURE__ */ A("div", {
151
158
  className: "space-y-0.5",
152
- children: [/* @__PURE__ */ T("p", {
159
+ children: [/* @__PURE__ */ k("p", {
153
160
  className: "text-sm text-text-primary",
154
161
  children: e.primaryContactName
155
- }), e.primaryContactEmail ? /* @__PURE__ */ E("p", {
162
+ }), e.primaryContactEmail ? /* @__PURE__ */ A("p", {
156
163
  className: "flex items-center gap-1 text-xs text-text-secondary",
157
- children: [/* @__PURE__ */ T(te, {
164
+ children: [/* @__PURE__ */ k(re, {
158
165
  className: "size-3",
159
166
  "aria-hidden": "true"
160
167
  }), e.primaryContactEmail]
161
168
  }) : null]
162
- }) : /* @__PURE__ */ T("span", {
169
+ }) : /* @__PURE__ */ k("span", {
163
170
  className: "text-sm text-text-muted",
164
171
  children: "—"
165
172
  }) }),
166
- /* @__PURE__ */ T(q, {
173
+ /* @__PURE__ */ k(X, {
167
174
  className: "text-right font-medium text-text-primary",
168
- children: h(e.aum, e.currency)
175
+ children: v(e.aum, e.currency)
169
176
  }),
170
- /* @__PURE__ */ T(q, {
177
+ /* @__PURE__ */ k(X, {
171
178
  className: "text-right",
172
- children: /* @__PURE__ */ E(ie, { children: [/* @__PURE__ */ T(se, {
179
+ children: /* @__PURE__ */ A(ce, { children: [/* @__PURE__ */ k(de, {
173
180
  asChild: !0,
174
- children: /* @__PURE__ */ T(O, {
181
+ children: /* @__PURE__ */ k(M, {
175
182
  variant: "ghost",
176
183
  size: "icon",
177
184
  "aria-label": i("brainyrich.households.rowMenu", "Household actions"),
178
- children: /* @__PURE__ */ T(ne, {
185
+ children: /* @__PURE__ */ k(ie, {
179
186
  className: "size-4",
180
187
  "aria-hidden": "true"
181
188
  })
182
189
  })
183
- }), /* @__PURE__ */ E(ae, {
190
+ }), /* @__PURE__ */ A(le, {
184
191
  align: "end",
185
192
  children: [
186
- /* @__PURE__ */ E(R, {
187
- onClick: () => B(e.id),
188
- children: [/* @__PURE__ */ T(ee, {
193
+ /* @__PURE__ */ A(B, {
194
+ onClick: () => V(e.id),
195
+ children: [/* @__PURE__ */ k(ne, {
189
196
  className: "size-4",
190
197
  "aria-hidden": "true"
191
198
  }), i("brainyrich.households.action.view", "View details")]
192
199
  }),
193
- /* @__PURE__ */ E(R, {
194
- onClick: () => U(e),
195
- children: [/* @__PURE__ */ T(x, {
200
+ /* @__PURE__ */ A(B, {
201
+ onClick: () => K(e),
202
+ children: [/* @__PURE__ */ k(T, {
196
203
  className: "size-4",
197
204
  "aria-hidden": "true"
198
205
  }), i("brainyrich.households.action.edit", "Edit")]
199
206
  }),
200
- /* @__PURE__ */ T(oe, {}),
201
- /* @__PURE__ */ E(R, {
207
+ /* @__PURE__ */ k(ue, {}),
208
+ /* @__PURE__ */ A(B, {
202
209
  className: "text-status-error-text focus:text-status-error-text",
203
- disabled: j.isPending,
204
- onClick: () => j.mutate(e.id),
205
- children: [/* @__PURE__ */ T(y, {
210
+ onClick: () => U(e),
211
+ children: [/* @__PURE__ */ k(te, {
206
212
  className: "size-4",
207
213
  "aria-hidden": "true"
208
214
  }), i("brainyrich.households.action.archive", "Archive")]
@@ -213,75 +219,94 @@ function ye() {
213
219
  ] }, e.id)) })] })
214
220
  })
215
221
  }) }),
216
- /* @__PURE__ */ T(be, {
217
- open: M,
218
- onOpenChange: N,
219
- editing: P,
220
- form: I,
221
- setField: V,
222
+ !_ && !b && a.length > 0 ? /* @__PURE__ */ k(l, {
223
+ hasMore: s,
224
+ onClick: d,
225
+ loading: y,
226
+ label: i("brainyrich.households.loadMore", "Load more households")
227
+ }) : null,
228
+ /* @__PURE__ */ k(Ee, {
229
+ open: N,
230
+ onOpenChange: P,
231
+ editing: F,
232
+ form: L,
233
+ setField: W,
222
234
  onSubmit: () => {
223
- if (K) if (P) {
235
+ if (Y) if (F) {
224
236
  let e = {
225
- name: I.name.trim(),
226
- status: I.status,
227
- riskProfile: I.riskProfile,
228
- currency: I.currency,
229
- primaryContactName: I.primaryContactName.trim() || null,
230
- primaryContactEmail: I.primaryContactEmail.trim() || null,
231
- notes: I.notes.trim() || null,
232
- tags: Z(I.tags)
237
+ name: L.name.trim(),
238
+ status: L.status,
239
+ riskProfile: L.riskProfile,
240
+ currency: L.currency,
241
+ primaryContactName: L.primaryContactName.trim() || null,
242
+ primaryContactEmail: L.primaryContactEmail.trim() || null,
243
+ notes: L.notes.trim() || null,
244
+ tags: we(L.tags)
233
245
  };
234
- w.mutate({
235
- id: P.id,
246
+ E.mutate({
247
+ id: F.id,
236
248
  input: e
237
- }, { onSuccess: () => N(!1) });
249
+ }, { onSuccess: () => P(!1) });
238
250
  } else {
239
251
  let e = {
240
- name: I.name.trim(),
241
- status: I.status,
242
- riskProfile: I.riskProfile,
243
- currency: I.currency,
244
- primaryContactName: I.primaryContactName.trim() || null,
245
- primaryContactEmail: I.primaryContactEmail.trim() || null,
246
- notes: I.notes.trim() || null,
247
- tags: Z(I.tags)
252
+ name: L.name.trim(),
253
+ status: L.status,
254
+ riskProfile: L.riskProfile,
255
+ currency: L.currency,
256
+ primaryContactName: L.primaryContactName.trim() || null,
257
+ primaryContactEmail: L.primaryContactEmail.trim() || null,
258
+ notes: L.notes.trim() || null,
259
+ tags: we(L.tags)
248
260
  };
249
- I.advisorId.trim() && (e.advisorId = I.advisorId.trim()), S.mutate(e, { onSuccess: () => N(!1) });
261
+ L.advisorId.trim() && (e.advisorId = L.advisorId.trim()), w.mutate(e, { onSuccess: () => P(!1) });
250
262
  }
251
263
  },
252
- canSubmit: K,
253
- submitting: G,
264
+ canSubmit: Y,
265
+ submitting: J,
254
266
  tr: i
255
267
  }),
256
- /* @__PURE__ */ T(xe, {
268
+ /* @__PURE__ */ k(De, {
257
269
  householdId: z,
258
- onClose: () => B(void 0),
270
+ onClose: () => V(void 0),
259
271
  onEdit: (e) => {
260
- B(void 0), U(e);
272
+ V(void 0), K(e);
261
273
  },
262
274
  tr: i
275
+ }),
276
+ /* @__PURE__ */ k(u, {
277
+ open: !!H,
278
+ onOpenChange: (e) => e ? void 0 : U(null),
279
+ title: i("brainyrich.households.archive.title", "Archive household?"),
280
+ description: i("brainyrich.households.archive.description", "Archiving “{name}” removes it from the active list. You can still access its records, but it will no longer appear here.", { name: H?.name ?? "" }),
281
+ confirmLabel: i("brainyrich.households.action.archive", "Archive"),
282
+ pendingLabel: i("brainyrich.households.archive.pending", "Archiving…"),
283
+ destructive: !0,
284
+ pending: O.isPending,
285
+ onConfirm: () => {
286
+ H && O.mutate(H.id, { onSuccess: () => U(null) });
287
+ }
263
288
  })
264
289
  ]
265
290
  });
266
291
  }
267
- function be({ open: e, onOpenChange: t, editing: n, form: r, setField: i, onSubmit: a, canSubmit: o, submitting: s, tr: c }) {
268
- return /* @__PURE__ */ T(j, {
292
+ function Ee({ open: e, onOpenChange: t, editing: n, form: r, setField: i, onSubmit: a, canSubmit: o, submitting: s, tr: c }) {
293
+ return /* @__PURE__ */ k(N, {
269
294
  open: e,
270
295
  onOpenChange: t,
271
- children: /* @__PURE__ */ E(N, {
296
+ children: /* @__PURE__ */ A(F, {
272
297
  className: "max-h-[90vh] overflow-y-auto sm:max-w-lg",
273
- children: [/* @__PURE__ */ E(I, { children: [/* @__PURE__ */ T(L, { children: n ? c("brainyrich.households.form.editTitle", "Edit household") : c("brainyrich.households.form.createTitle", "New household") }), /* @__PURE__ */ T(P, { children: c("brainyrich.households.form.subtitle", "A household groups a client family’s accounts, portfolios and goals.") })] }), /* @__PURE__ */ E("form", {
298
+ children: [/* @__PURE__ */ A(R, { children: [/* @__PURE__ */ k(z, { children: n ? c("brainyrich.households.form.editTitle", "Edit household") : c("brainyrich.households.form.createTitle", "New household") }), /* @__PURE__ */ k(I, { children: c("brainyrich.households.form.subtitle", "A household groups a client family’s accounts, portfolios and goals.") })] }), /* @__PURE__ */ A("form", {
274
299
  className: "space-y-4",
275
300
  onSubmit: (e) => {
276
301
  e.preventDefault(), a();
277
302
  },
278
303
  children: [
279
- /* @__PURE__ */ E("div", {
304
+ /* @__PURE__ */ A("div", {
280
305
  className: "space-y-2",
281
- children: [/* @__PURE__ */ E(B, {
306
+ children: [/* @__PURE__ */ A(H, {
282
307
  htmlFor: "hh-name",
283
308
  children: [c("brainyrich.households.form.name", "Name"), " *"]
284
- }), /* @__PURE__ */ T(z, {
309
+ }), /* @__PURE__ */ k(V, {
285
310
  id: "hh-name",
286
311
  value: r.name,
287
312
  onChange: (e) => i("name", e.target.value),
@@ -289,49 +314,49 @@ function be({ open: e, onOpenChange: t, editing: n, form: r, setField: i, onSubm
289
314
  required: !0
290
315
  })]
291
316
  }),
292
- /* @__PURE__ */ E("div", {
317
+ /* @__PURE__ */ A("div", {
293
318
  className: "grid gap-4 sm:grid-cols-2",
294
- children: [/* @__PURE__ */ E("div", {
319
+ children: [/* @__PURE__ */ A("div", {
295
320
  className: "space-y-2",
296
- children: [/* @__PURE__ */ T(B, { children: c("brainyrich.households.form.status", "Status") }), /* @__PURE__ */ E(V, {
321
+ children: [/* @__PURE__ */ k(H, { children: c("brainyrich.households.form.status", "Status") }), /* @__PURE__ */ A(U, {
297
322
  value: r.status,
298
323
  onValueChange: (e) => i("status", e),
299
- children: [/* @__PURE__ */ T(W, { children: /* @__PURE__ */ T(G, {}) }), /* @__PURE__ */ T(H, { children: ge.map((e) => /* @__PURE__ */ T(U, {
324
+ children: [/* @__PURE__ */ k(K, { children: /* @__PURE__ */ k(q, {}) }), /* @__PURE__ */ k(W, { children: be.map((e) => /* @__PURE__ */ k(G, {
300
325
  value: e,
301
326
  children: e
302
327
  }, e)) })]
303
328
  })]
304
- }), /* @__PURE__ */ E("div", {
329
+ }), /* @__PURE__ */ A("div", {
305
330
  className: "space-y-2",
306
- children: [/* @__PURE__ */ T(B, { children: c("brainyrich.households.form.risk", "Risk profile") }), /* @__PURE__ */ E(V, {
331
+ children: [/* @__PURE__ */ k(H, { children: c("brainyrich.households.form.risk", "Risk profile") }), /* @__PURE__ */ A(U, {
307
332
  value: r.riskProfile,
308
333
  onValueChange: (e) => i("riskProfile", e),
309
- children: [/* @__PURE__ */ T(W, { children: /* @__PURE__ */ T(G, {}) }), /* @__PURE__ */ T(H, { children: _e.map((e) => /* @__PURE__ */ T(U, {
334
+ children: [/* @__PURE__ */ k(K, { children: /* @__PURE__ */ k(q, {}) }), /* @__PURE__ */ k(W, { children: xe.map((e) => /* @__PURE__ */ k(G, {
310
335
  value: e,
311
336
  children: e
312
337
  }, e)) })]
313
338
  })]
314
339
  })]
315
340
  }),
316
- /* @__PURE__ */ E("div", {
341
+ /* @__PURE__ */ A("div", {
317
342
  className: "grid gap-4 sm:grid-cols-2",
318
- children: [/* @__PURE__ */ E("div", {
343
+ children: [/* @__PURE__ */ A("div", {
319
344
  className: "space-y-2",
320
- children: [/* @__PURE__ */ T(B, {
345
+ children: [/* @__PURE__ */ k(H, {
321
346
  htmlFor: "hh-contact-name",
322
347
  children: c("brainyrich.households.form.contactName", "Primary contact")
323
- }), /* @__PURE__ */ T(z, {
348
+ }), /* @__PURE__ */ k(V, {
324
349
  id: "hh-contact-name",
325
350
  value: r.primaryContactName,
326
351
  onChange: (e) => i("primaryContactName", e.target.value),
327
352
  placeholder: c("brainyrich.households.form.contactNamePh", "Full name")
328
353
  })]
329
- }), /* @__PURE__ */ E("div", {
354
+ }), /* @__PURE__ */ A("div", {
330
355
  className: "space-y-2",
331
- children: [/* @__PURE__ */ T(B, {
356
+ children: [/* @__PURE__ */ k(H, {
332
357
  htmlFor: "hh-contact-email",
333
358
  children: c("brainyrich.households.form.contactEmail", "Contact email")
334
- }), /* @__PURE__ */ T(z, {
359
+ }), /* @__PURE__ */ k(V, {
335
360
  id: "hh-contact-email",
336
361
  type: "email",
337
362
  value: r.primaryContactEmail,
@@ -340,24 +365,24 @@ function be({ open: e, onOpenChange: t, editing: n, form: r, setField: i, onSubm
340
365
  })]
341
366
  })]
342
367
  }),
343
- /* @__PURE__ */ E("div", {
368
+ /* @__PURE__ */ A("div", {
344
369
  className: "grid gap-4 sm:grid-cols-2",
345
- children: [/* @__PURE__ */ E("div", {
370
+ children: [/* @__PURE__ */ A("div", {
346
371
  className: "space-y-2",
347
- children: [/* @__PURE__ */ T(B, { children: c("brainyrich.households.form.currency", "Currency") }), /* @__PURE__ */ E(V, {
372
+ children: [/* @__PURE__ */ k(H, { children: c("brainyrich.households.form.currency", "Currency") }), /* @__PURE__ */ A(U, {
348
373
  value: r.currency,
349
374
  onValueChange: (e) => i("currency", e),
350
- children: [/* @__PURE__ */ T(W, { children: /* @__PURE__ */ T(G, {}) }), /* @__PURE__ */ T(H, { children: ve.map((e) => /* @__PURE__ */ T(U, {
375
+ children: [/* @__PURE__ */ k(K, { children: /* @__PURE__ */ k(q, {}) }), /* @__PURE__ */ k(W, { children: Se.map((e) => /* @__PURE__ */ k(G, {
351
376
  value: e,
352
377
  children: e
353
378
  }, e)) })]
354
379
  })]
355
- }), n ? null : /* @__PURE__ */ E("div", {
380
+ }), n ? null : /* @__PURE__ */ A("div", {
356
381
  className: "space-y-2",
357
- children: [/* @__PURE__ */ T(B, {
382
+ children: [/* @__PURE__ */ k(H, {
358
383
  htmlFor: "hh-advisor",
359
384
  children: c("brainyrich.households.form.advisor", "Advisor ID")
360
- }), /* @__PURE__ */ T(z, {
385
+ }), /* @__PURE__ */ k(V, {
361
386
  id: "hh-advisor",
362
387
  value: r.advisorId,
363
388
  onChange: (e) => i("advisorId", e.target.value),
@@ -365,38 +390,42 @@ function be({ open: e, onOpenChange: t, editing: n, form: r, setField: i, onSubm
365
390
  })]
366
391
  })]
367
392
  }),
368
- /* @__PURE__ */ E("div", {
393
+ n ? /* @__PURE__ */ k(b, {
394
+ entityType: "brainyrich-household",
395
+ entityId: n.id,
396
+ label: c("brainyrich.households.form.tags", "Tags")
397
+ }) : /* @__PURE__ */ A("div", {
369
398
  className: "space-y-2",
370
- children: [/* @__PURE__ */ T(B, {
399
+ children: [/* @__PURE__ */ k(H, {
371
400
  htmlFor: "hh-tags",
372
401
  children: c("brainyrich.households.form.tags", "Tags")
373
- }), /* @__PURE__ */ T(z, {
402
+ }), /* @__PURE__ */ k(V, {
374
403
  id: "hh-tags",
375
404
  value: r.tags,
376
405
  onChange: (e) => i("tags", e.target.value),
377
406
  placeholder: c("brainyrich.households.form.tagsPh", "Comma-separated")
378
407
  })]
379
408
  }),
380
- /* @__PURE__ */ E("div", {
409
+ /* @__PURE__ */ A("div", {
381
410
  className: "space-y-2",
382
- children: [/* @__PURE__ */ T(B, {
411
+ children: [/* @__PURE__ */ k(H, {
383
412
  htmlFor: "hh-notes",
384
413
  children: c("brainyrich.households.form.notes", "Notes")
385
- }), /* @__PURE__ */ T(he, {
414
+ }), /* @__PURE__ */ k(ye, {
386
415
  id: "hh-notes",
387
416
  value: r.notes,
388
417
  onChange: (e) => i("notes", e.target.value),
389
418
  rows: 3
390
419
  })]
391
420
  }),
392
- /* @__PURE__ */ E(F, { children: [/* @__PURE__ */ T(M, {
421
+ /* @__PURE__ */ A(L, { children: [/* @__PURE__ */ k(P, {
393
422
  asChild: !0,
394
- children: /* @__PURE__ */ T(O, {
423
+ children: /* @__PURE__ */ k(M, {
395
424
  type: "button",
396
425
  variant: "outline",
397
426
  children: c("brainyrich.common.cancel", "Cancel")
398
427
  })
399
- }), /* @__PURE__ */ T(O, {
428
+ }), /* @__PURE__ */ k(M, {
400
429
  type: "submit",
401
430
  disabled: !o,
402
431
  children: s ? c("brainyrich.common.saving", "Saving…") : n ? c("brainyrich.common.save", "Save changes") : c("brainyrich.households.form.create", "Create household")
@@ -406,126 +435,146 @@ function be({ open: e, onOpenChange: t, editing: n, form: r, setField: i, onSubm
406
435
  })
407
436
  });
408
437
  }
409
- function xe({ householdId: e, onClose: n, onEdit: r, tr: o }) {
410
- let { data: c, isLoading: d, isError: p, refetch: _ } = a(e), { data: v } = t(e ? { householdId: e } : {}), { data: y } = s(e ? { householdId: e } : {}), { data: ee } = i(e ? { householdId: e } : {});
411
- return /* @__PURE__ */ T(K, {
438
+ function De({ householdId: e, onClose: n, onEdit: r, tr: o }) {
439
+ let { data: c, isLoading: l, isError: u, refetch: m } = a(e), { data: g } = t(e ? { householdId: e } : {}), { data: b } = s(e ? { householdId: e } : {}), { data: S } = i(e ? { householdId: e } : {});
440
+ return /* @__PURE__ */ k(J, {
412
441
  open: !!e,
413
442
  onOpenChange: (e) => e ? void 0 : n(),
414
- children: /* @__PURE__ */ T(ce, {
443
+ children: /* @__PURE__ */ k(Y, {
415
444
  className: "w-full overflow-y-auto sm:max-w-md",
416
- children: d ? /* @__PURE__ */ T("div", {
445
+ children: l ? /* @__PURE__ */ k("div", {
417
446
  className: "p-2",
418
- children: /* @__PURE__ */ T(f, { rows: 4 })
419
- }) : p ? /* @__PURE__ */ T(u, {
447
+ children: /* @__PURE__ */ k(h, { rows: 4 })
448
+ }) : u ? /* @__PURE__ */ k(p, {
420
449
  title: o("brainyrich.households.detail.error", "Could not load household"),
421
- onRetry: () => _()
422
- }) : c ? /* @__PURE__ */ E("div", {
450
+ onRetry: () => m()
451
+ }) : c ? /* @__PURE__ */ A("div", {
423
452
  className: "space-y-6",
424
453
  children: [
425
- /* @__PURE__ */ E(ue, {
454
+ /* @__PURE__ */ A(pe, {
426
455
  className: "space-y-2",
427
456
  children: [
428
- /* @__PURE__ */ T(de, { children: c.name }),
429
- /* @__PURE__ */ T(le, { children: o("brainyrich.households.detail.subtitle", "Household overview") }),
430
- /* @__PURE__ */ E("div", {
457
+ /* @__PURE__ */ k(me, { children: c.name }),
458
+ /* @__PURE__ */ k(fe, { children: o("brainyrich.households.detail.subtitle", "Household overview") }),
459
+ /* @__PURE__ */ A("div", {
431
460
  className: "flex flex-wrap items-center gap-2 pt-1",
432
- children: [/* @__PURE__ */ T(D, {
433
- variant: g(c.status),
461
+ children: [/* @__PURE__ */ k(j, {
462
+ variant: ee(c.status),
434
463
  children: c.status
435
- }), /* @__PURE__ */ T(D, {
464
+ }), /* @__PURE__ */ k(j, {
436
465
  variant: "secondary",
437
466
  children: c.riskProfile
438
467
  })]
439
468
  })
440
469
  ]
441
470
  }),
442
- /* @__PURE__ */ E("div", {
471
+ /* @__PURE__ */ A("div", {
443
472
  className: "grid grid-cols-3 gap-3",
444
473
  children: [
445
- /* @__PURE__ */ T(Q, {
446
- icon: /* @__PURE__ */ T(w, {
474
+ /* @__PURE__ */ k(Q, {
475
+ icon: /* @__PURE__ */ k(O, {
447
476
  className: "size-4",
448
477
  "aria-hidden": "true"
449
478
  }),
450
479
  label: o("brainyrich.households.detail.accounts", "Accounts"),
451
- value: String(v.length)
480
+ value: String(g.length)
452
481
  }),
453
- /* @__PURE__ */ T(Q, {
454
- icon: /* @__PURE__ */ T(b, {
482
+ /* @__PURE__ */ k(Q, {
483
+ icon: /* @__PURE__ */ k(w, {
455
484
  className: "size-4",
456
485
  "aria-hidden": "true"
457
486
  }),
458
487
  label: o("brainyrich.households.detail.portfolios", "Portfolios"),
459
- value: String(y.length)
488
+ value: String(b.length)
460
489
  }),
461
- /* @__PURE__ */ T(Q, {
462
- icon: /* @__PURE__ */ T(S, {
490
+ /* @__PURE__ */ k(Q, {
491
+ icon: /* @__PURE__ */ k(E, {
463
492
  className: "size-4",
464
493
  "aria-hidden": "true"
465
494
  }),
466
495
  label: o("brainyrich.households.detail.goals", "Goals"),
467
- value: String(ee.length)
496
+ value: String(S.length)
468
497
  })
469
498
  ]
470
499
  }),
471
- /* @__PURE__ */ T(k, { children: /* @__PURE__ */ E(A, {
500
+ /* @__PURE__ */ k(oe, { children: /* @__PURE__ */ A(se, {
472
501
  className: "space-y-3 p-4 text-sm",
473
502
  children: [
474
- /* @__PURE__ */ T($, {
503
+ /* @__PURE__ */ k($, {
475
504
  label: o("brainyrich.households.detail.aum", "AUM"),
476
- value: h(c.aum, c.currency)
505
+ value: v(c.aum, c.currency)
477
506
  }),
478
- /* @__PURE__ */ T($, {
507
+ /* @__PURE__ */ k($, {
479
508
  label: o("brainyrich.households.form.currency", "Currency"),
480
509
  value: c.currency
481
510
  }),
482
- /* @__PURE__ */ T($, {
511
+ /* @__PURE__ */ k($, {
483
512
  label: o("brainyrich.households.detail.contact", "Primary contact"),
484
513
  value: c.primaryContactName ?? "—"
485
514
  }),
486
- /* @__PURE__ */ T($, {
515
+ /* @__PURE__ */ k($, {
487
516
  label: o("brainyrich.households.form.contactEmail", "Contact email"),
488
517
  value: c.primaryContactEmail ?? "—"
489
518
  }),
490
- /* @__PURE__ */ T($, {
519
+ /* @__PURE__ */ A("div", {
520
+ className: "flex items-center justify-between gap-4",
521
+ children: [/* @__PURE__ */ k("span", {
522
+ className: "text-text-secondary",
523
+ children: o("brainyrich.households.detail.advisor", "Advisor")
524
+ }), /* @__PURE__ */ k("span", {
525
+ className: "text-right font-medium text-text-primary",
526
+ children: c.advisorId ? /* @__PURE__ */ k(d, { id: c.advisorId }) : o("brainyrich.common.unassigned", "Unassigned")
527
+ })]
528
+ }),
529
+ /* @__PURE__ */ k($, {
491
530
  label: o("brainyrich.households.detail.created", "Created"),
492
- value: m(c.createdAt)
531
+ value: _(c.createdAt)
493
532
  }),
494
- /* @__PURE__ */ T($, {
533
+ /* @__PURE__ */ k($, {
495
534
  label: o("brainyrich.households.detail.updated", "Last updated"),
496
- value: m(c.updatedAt)
535
+ value: _(c.updatedAt)
497
536
  })
498
537
  ]
499
538
  }) }),
500
- c.tags.length > 0 ? /* @__PURE__ */ T("div", {
539
+ c.tags.length > 0 ? /* @__PURE__ */ k("div", {
501
540
  className: "flex flex-wrap gap-1",
502
- children: c.tags.map((e) => /* @__PURE__ */ T(D, {
541
+ children: c.tags.map((e) => /* @__PURE__ */ k(j, {
503
542
  variant: "outline",
504
543
  children: e
505
544
  }, e))
506
545
  }) : null,
507
- c.notes ? /* @__PURE__ */ E("div", {
546
+ c.notes ? /* @__PURE__ */ A("div", {
508
547
  className: "space-y-1",
509
- children: [/* @__PURE__ */ T("p", {
548
+ children: [/* @__PURE__ */ k("p", {
510
549
  className: "text-xs font-medium text-text-secondary",
511
- children: o("brainyrich.households.form.notes", "Notes")
512
- }), /* @__PURE__ */ T("p", {
550
+ children: o("brainyrich.households.detail.summary", "Summary")
551
+ }), /* @__PURE__ */ k("p", {
513
552
  className: "text-sm text-text-primary",
514
553
  children: c.notes
515
554
  })]
516
555
  }) : null,
517
- /* @__PURE__ */ E(O, {
556
+ /* @__PURE__ */ k(y, {
557
+ entityType: "brainyrich-household",
558
+ entityId: c.id,
559
+ heading: o("brainyrich.households.detail.documents", "Documents")
560
+ }),
561
+ /* @__PURE__ */ k(x, {
562
+ entityType: "brainyrich-household",
563
+ entityId: c.id,
564
+ heading: o("brainyrich.households.detail.discussion", "Discussion")
565
+ }),
566
+ /* @__PURE__ */ A(M, {
518
567
  variant: "outline",
519
568
  className: "w-full",
520
569
  onClick: () => r(c),
521
- children: [/* @__PURE__ */ T(x, {
570
+ children: [/* @__PURE__ */ k(T, {
522
571
  className: "size-4",
523
572
  "aria-hidden": "true"
524
573
  }), o("brainyrich.households.action.edit", "Edit")]
525
574
  })
526
575
  ]
527
- }) : /* @__PURE__ */ T(l, {
528
- icon: /* @__PURE__ */ T(C, {
576
+ }) : /* @__PURE__ */ k(f, {
577
+ icon: /* @__PURE__ */ k(D, {
529
578
  className: "size-6",
530
579
  "aria-hidden": "true"
531
580
  }),
@@ -535,18 +584,18 @@ function xe({ householdId: e, onClose: n, onEdit: r, tr: o }) {
535
584
  });
536
585
  }
537
586
  function Q({ icon: e, label: t, value: n }) {
538
- return /* @__PURE__ */ E("div", {
587
+ return /* @__PURE__ */ A("div", {
539
588
  className: "rounded-lg border border-border-subtle bg-bg-surface p-3 text-center",
540
589
  children: [
541
- /* @__PURE__ */ T("div", {
590
+ /* @__PURE__ */ k("div", {
542
591
  className: "mx-auto mb-1 flex size-8 items-center justify-center rounded-full bg-bg-sunken text-text-secondary",
543
592
  children: e
544
593
  }),
545
- /* @__PURE__ */ T("p", {
594
+ /* @__PURE__ */ k("p", {
546
595
  className: "text-lg font-semibold text-text-primary",
547
596
  children: n
548
597
  }),
549
- /* @__PURE__ */ T("p", {
598
+ /* @__PURE__ */ k("p", {
550
599
  className: "text-xs text-text-secondary",
551
600
  children: t
552
601
  })
@@ -554,18 +603,18 @@ function Q({ icon: e, label: t, value: n }) {
554
603
  });
555
604
  }
556
605
  function $({ label: e, value: t }) {
557
- return /* @__PURE__ */ E("div", {
606
+ return /* @__PURE__ */ A("div", {
558
607
  className: "flex items-center justify-between gap-4",
559
- children: [/* @__PURE__ */ T("span", {
608
+ children: [/* @__PURE__ */ k("span", {
560
609
  className: "text-text-secondary",
561
610
  children: e
562
- }), /* @__PURE__ */ T("span", {
611
+ }), /* @__PURE__ */ k("span", {
563
612
  className: "text-right font-medium text-text-primary",
564
613
  children: t
565
614
  })]
566
615
  });
567
616
  }
568
617
  //#endregion
569
- export { ye as FamilyPage };
618
+ export { Te as FamilyPage };
570
619
 
571
620
  //# sourceMappingURL=FamilyPage.js.map