@burdenoff/microfe-proserviceworld 2026.801.1 → 2026.830.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 (37) hide show
  1. package/dist/index.js +4 -4
  2. package/dist/proserviceworld/hooks/useActorNames.d.ts +16 -0
  3. package/dist/proserviceworld/hooks/useActorNames.d.ts.map +1 -0
  4. package/dist/proserviceworld/hooks/useActorNames.js +18 -0
  5. package/dist/proserviceworld/hooks/useActorNames.js.map +1 -0
  6. package/dist/proserviceworld/hooks/useProServiceWorldApi.d.ts +53 -0
  7. package/dist/proserviceworld/hooks/useProServiceWorldApi.d.ts.map +1 -1
  8. package/dist/proserviceworld/hooks/useProServiceWorldApi.js +289 -227
  9. package/dist/proserviceworld/hooks/useProServiceWorldApi.js.map +1 -1
  10. package/dist/proserviceworld/hooks/useTr.d.ts +19 -0
  11. package/dist/proserviceworld/hooks/useTr.d.ts.map +1 -0
  12. package/dist/proserviceworld/hooks/useTr.js +33 -0
  13. package/dist/proserviceworld/hooks/useTr.js.map +1 -0
  14. package/dist/proserviceworld/i18n/index.d.ts +1 -1
  15. package/dist/proserviceworld/i18n/index.d.ts.map +1 -1
  16. package/dist/proserviceworld/i18n/index.js +723 -18
  17. package/dist/proserviceworld/i18n/index.js.map +1 -1
  18. package/dist/proserviceworld/index.js +4 -4
  19. package/dist/proserviceworld/pages/ClientDetailPage.d.ts.map +1 -1
  20. package/dist/proserviceworld/pages/ClientDetailPage.js +268 -144
  21. package/dist/proserviceworld/pages/ClientDetailPage.js.map +1 -1
  22. package/dist/proserviceworld/pages/ClientsPage.d.ts.map +1 -1
  23. package/dist/proserviceworld/pages/ClientsPage.js +324 -241
  24. package/dist/proserviceworld/pages/ClientsPage.js.map +1 -1
  25. package/dist/proserviceworld/pages/DashboardPage.d.ts.map +1 -1
  26. package/dist/proserviceworld/pages/DashboardPage.js +152 -142
  27. package/dist/proserviceworld/pages/DashboardPage.js.map +1 -1
  28. package/dist/proserviceworld/pages/EngagementDetailPage.d.ts.map +1 -1
  29. package/dist/proserviceworld/pages/EngagementDetailPage.js +420 -186
  30. package/dist/proserviceworld/pages/EngagementDetailPage.js.map +1 -1
  31. package/dist/proserviceworld/pages/EngagementsPage.d.ts.map +1 -1
  32. package/dist/proserviceworld/pages/EngagementsPage.js +135 -135
  33. package/dist/proserviceworld/pages/EngagementsPage.js.map +1 -1
  34. package/dist/proserviceworld/pages/MattersPage.d.ts.map +1 -1
  35. package/dist/proserviceworld/pages/MattersPage.js +204 -197
  36. package/dist/proserviceworld/pages/MattersPage.js.map +1 -1
  37. package/package.json +2 -2
@@ -1,274 +1,398 @@
1
- import { useClient as e, useConflictChecks as t, useCreateConflictCheck as n } from "../hooks/useProServiceWorldApi.js";
2
- import { useNav as r } from "../utils/nav.js";
3
- import { cn as i } from "../utils/cn.js";
4
- import { Banner as a, Empty as o, ErrorState as s, Field as c, LoadingBlock as l, Modal as u, PageHeader as d, SectionCard as f, StatusPill as p, TableWrap as m, Td as h, TextArea as g, TextInput as _, Th as v, fmtDate as y, fmtMoney as b, humanize as x } from "../components/ui.js";
5
- import { DiscussionThread as S } from "../components/DiscussionThread.js";
6
- import { useState as C } from "react";
7
- import { ArrowLeft as w, Briefcase as T, ChevronRight as E, FolderKanban as D, GitBranch as O, Mail as k, MapPin as A, Phone as j, Plus as M, StickyNote as N } from "lucide-react";
8
- import { useParams as P } from "react-router";
9
- import { Fragment as F, jsx as I, jsxs as L } from "react/jsx-runtime";
10
- import { Button as R } from "@burdenoff/fe-libs/ui";
1
+ import { useClient as e, useClientTeamAssignments as t, useConflictChecks as n, useCreateConflictCheck as r } from "../hooks/useProServiceWorldApi.js";
2
+ import { useNav as i } from "../utils/nav.js";
3
+ import { cn as a } from "../utils/cn.js";
4
+ import { Banner as o, Empty as s, ErrorState as c, Field as l, LoadingBlock as u, Modal as d, PageHeader as f, SectionCard as p, StatusPill as m, TableWrap as h, Td as g, TextArea as _, TextInput as v, Th as y, fmtDate as b, fmtMoney as x, humanize as S } from "../components/ui.js";
5
+ import { useActorNames as C } from "../hooks/useActorNames.js";
6
+ import { DiscussionThread as w } from "../components/DiscussionThread.js";
7
+ import { useMemo as T, useState as E } from "react";
8
+ import { ArrowLeft as D, Briefcase as O, ChevronRight as k, FolderKanban as A, GitBranch as j, Mail as M, MapPin as N, Phone as P, Plus as F, StickyNote as I, UserRoundCheck as L, Users as R } from "lucide-react";
9
+ import { useParams as z } from "react-router";
10
+ import { Fragment as B, jsx as V, jsxs as H } from "react/jsx-runtime";
11
+ import { Button as U } from "@burdenoff/fe-libs/ui";
11
12
  //#region src/proserviceworld/pages/ClientDetailPage.tsx
12
- var z = (e) => e.split(/\s+/).filter(Boolean).slice(0, 2).map((e) => e[0]?.toUpperCase() ?? "").join("") || "?", B = () => {
13
- let { id: n = "" } = P(), i = r(), { data: a, isLoading: c, error: u, refetch: g } = e(n), _ = t({ clientId: n }), [F, B] = C(!1);
14
- if (c) return /* @__PURE__ */ I(l, {});
15
- if (u) return /* @__PURE__ */ I(s, {
16
- error: u,
17
- onRetry: () => void g()
13
+ var W = (e) => e.split(/\s+/).filter(Boolean).slice(0, 2).map((e) => e[0]?.toUpperCase() ?? "").join("") || "?", G = () => {
14
+ let { id: r = "" } = z(), a = i(), { data: o, isLoading: l, error: d, refetch: _ } = e(r), v = n({ clientId: r }), [R, B] = E(!1), G = T(() => [...(o?.engagements ?? []).map((e) => ({
15
+ type: "engagement",
16
+ id: e.id,
17
+ name: e.name
18
+ })), ...(o?.matters ?? []).map((e) => ({
19
+ type: "matter",
20
+ id: e.id,
21
+ name: e.reference || e.title
22
+ }))], [o]), K = t(G), X = C([
23
+ o?.relationshipOwnerId,
24
+ ...(o?.engagements ?? []).map((e) => e.responsiblePartnerId),
25
+ ...(o?.matters ?? []).map((e) => e.leadPractitionerId),
26
+ ...(K.data ?? []).map((e) => e.practitionerId)
27
+ ]);
28
+ if (l) return /* @__PURE__ */ V(u, {});
29
+ if (d) return /* @__PURE__ */ V(c, {
30
+ error: d,
31
+ onRetry: () => void _()
18
32
  });
19
- if (!a) return /* @__PURE__ */ I(o, {
33
+ if (!o) return /* @__PURE__ */ V(s, {
20
34
  title: "Client not found",
21
35
  description: "It may have been archived or belongs to another workspace."
22
36
  });
23
- let U = a.contactName || a.name;
24
- return /* @__PURE__ */ L("div", {
37
+ let Z = o.contactName || o.name;
38
+ return /* @__PURE__ */ H("div", {
25
39
  className: "space-y-6",
26
40
  children: [
27
- /* @__PURE__ */ L("button", {
41
+ /* @__PURE__ */ H("button", {
28
42
  type: "button",
29
- onClick: () => i("clients"),
43
+ onClick: () => a("clients"),
30
44
  className: "flex items-center gap-1.5 text-sm text-text-secondary transition-colors hover:text-accent",
31
- children: [/* @__PURE__ */ I(w, { className: "h-4 w-4" }), " Back to clients"]
45
+ children: [/* @__PURE__ */ V(D, { className: "h-4 w-4" }), " Back to clients"]
32
46
  }),
33
- /* @__PURE__ */ I(d, {
34
- title: a.name,
35
- subtitle: [a.type === "ORGANIZATION" ? "Organization" : "Individual", a.industry].filter(Boolean).join(" · "),
36
- actions: /* @__PURE__ */ I(p, { status: a.status })
47
+ /* @__PURE__ */ V(f, {
48
+ title: o.name,
49
+ subtitle: [o.type === "ORGANIZATION" ? "Organization" : "Individual", o.industry].filter(Boolean).join(" · "),
50
+ actions: /* @__PURE__ */ V(m, { status: o.status })
37
51
  }),
38
- a.tags.length > 0 && /* @__PURE__ */ I("div", {
52
+ o.tags.length > 0 && /* @__PURE__ */ V("div", {
39
53
  className: "flex flex-wrap gap-2",
40
- children: a.tags.map((e) => /* @__PURE__ */ I("span", {
54
+ children: o.tags.map((e) => /* @__PURE__ */ V("span", {
41
55
  className: "rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary",
42
56
  children: e
43
57
  }, e))
44
58
  }),
45
- /* @__PURE__ */ L("div", {
59
+ /* @__PURE__ */ H("div", {
46
60
  className: "grid grid-cols-1 gap-4 lg:grid-cols-3",
47
- children: [/* @__PURE__ */ I(f, {
61
+ children: [/* @__PURE__ */ V(p, {
48
62
  title: "Contact",
49
63
  className: "lg:col-span-1",
50
- children: /* @__PURE__ */ L("div", {
64
+ children: /* @__PURE__ */ H("div", {
51
65
  className: "space-y-4",
52
- children: [/* @__PURE__ */ L("div", {
66
+ children: [/* @__PURE__ */ H("div", {
53
67
  className: "flex items-center gap-3",
54
- children: [/* @__PURE__ */ I("span", {
68
+ children: [/* @__PURE__ */ V("span", {
55
69
  className: "flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-accent/10 text-sm font-semibold text-accent ring-1 ring-inset ring-accent/15",
56
- children: z(U)
57
- }), /* @__PURE__ */ L("div", {
70
+ children: W(Z)
71
+ }), /* @__PURE__ */ H("div", {
58
72
  className: "min-w-0",
59
- children: [/* @__PURE__ */ I("div", {
73
+ children: [/* @__PURE__ */ V("div", {
60
74
  className: "truncate text-sm font-semibold text-text-primary",
61
- children: a.contactName || a.name
62
- }), /* @__PURE__ */ I("div", {
75
+ children: o.contactName || o.name
76
+ }), /* @__PURE__ */ V("div", {
63
77
  className: "truncate text-xs text-text-tertiary",
64
- children: a.contactName ? "Primary contact" : "Client record"
78
+ children: o.contactName ? "Primary contact" : "Client record"
65
79
  })]
66
80
  })]
67
- }), /* @__PURE__ */ L("dl", {
81
+ }), /* @__PURE__ */ H("dl", {
68
82
  className: "space-y-2.5 text-sm",
69
83
  children: [
70
- a.contactEmail && /* @__PURE__ */ I(V, {
71
- icon: /* @__PURE__ */ I(k, { className: "h-4 w-4" }),
72
- value: a.contactEmail
84
+ o.contactEmail && /* @__PURE__ */ V(J, {
85
+ icon: /* @__PURE__ */ V(M, { className: "h-4 w-4" }),
86
+ value: o.contactEmail
73
87
  }),
74
- a.contactPhone && /* @__PURE__ */ I(V, {
75
- icon: /* @__PURE__ */ I(j, { className: "h-4 w-4" }),
76
- value: a.contactPhone
88
+ o.contactPhone && /* @__PURE__ */ V(J, {
89
+ icon: /* @__PURE__ */ V(P, { className: "h-4 w-4" }),
90
+ value: o.contactPhone
77
91
  }),
78
- a.address && /* @__PURE__ */ I(V, {
79
- icon: /* @__PURE__ */ I(A, { className: "h-4 w-4" }),
80
- value: a.address
92
+ o.address && /* @__PURE__ */ V(J, {
93
+ icon: /* @__PURE__ */ V(N, { className: "h-4 w-4" }),
94
+ value: o.address
81
95
  }),
82
- a.notes && /* @__PURE__ */ I(V, {
83
- icon: /* @__PURE__ */ I(N, { className: "h-4 w-4" }),
84
- value: a.notes,
96
+ o.notes && /* @__PURE__ */ V(J, {
97
+ icon: /* @__PURE__ */ V(I, { className: "h-4 w-4" }),
98
+ value: o.notes,
85
99
  multiline: !0
86
100
  }),
87
- !a.contactEmail && !a.contactPhone && !a.address && !a.notes && /* @__PURE__ */ I("p", {
101
+ o.relationshipOwnerId && /* @__PURE__ */ V(J, {
102
+ icon: /* @__PURE__ */ V(L, { className: "h-4 w-4" }),
103
+ value: `${X.nameOf(o.relationshipOwnerId)} · relationship owner`
104
+ }),
105
+ !o.contactEmail && !o.contactPhone && !o.address && !o.notes && !o.relationshipOwnerId && /* @__PURE__ */ V("p", {
88
106
  className: "text-sm text-text-tertiary",
89
107
  children: "No contact details recorded yet."
90
108
  })
91
109
  ]
92
110
  })]
93
111
  })
94
- }), /* @__PURE__ */ I(f, {
112
+ }), /* @__PURE__ */ V(p, {
95
113
  title: "Conflict checks",
96
114
  className: "lg:col-span-2",
97
- action: /* @__PURE__ */ L(R, {
115
+ action: /* @__PURE__ */ H(U, {
98
116
  size: "sm",
99
117
  variant: "outline",
100
118
  onClick: () => B(!0),
101
- children: [/* @__PURE__ */ I(O, { className: "mr-1.5 h-4 w-4" }), " Run check"]
119
+ children: [/* @__PURE__ */ V(j, { className: "mr-1.5 h-4 w-4" }), " Run check"]
102
120
  }),
103
- children: _.isLoading ? /* @__PURE__ */ I(l, { label: "Loading…" }) : !_.data || _.data.items.length === 0 ? /* @__PURE__ */ I(o, {
121
+ children: v.isLoading ? /* @__PURE__ */ V(u, { label: "Loading…" }) : !v.data || v.data.items.length === 0 ? /* @__PURE__ */ V(s, {
104
122
  title: "No conflict checks",
105
123
  description: "Run a conflict check before accepting new work for this client.",
106
- icon: /* @__PURE__ */ I(O, { className: "h-7 w-7" })
107
- }) : /* @__PURE__ */ L(m, { children: [/* @__PURE__ */ I("thead", { children: /* @__PURE__ */ L("tr", { children: [
108
- /* @__PURE__ */ I(v, { children: "Parties searched" }),
109
- /* @__PURE__ */ I(v, { children: "Date" }),
110
- /* @__PURE__ */ I(v, {
124
+ icon: /* @__PURE__ */ V(j, { className: "h-7 w-7" })
125
+ }) : /* @__PURE__ */ H(h, { children: [/* @__PURE__ */ V("thead", { children: /* @__PURE__ */ H("tr", { children: [
126
+ /* @__PURE__ */ V(y, { children: "Parties searched" }),
127
+ /* @__PURE__ */ V(y, { children: "Date" }),
128
+ /* @__PURE__ */ V(y, {
111
129
  className: "text-right",
112
130
  children: "Status"
113
131
  })
114
- ] }) }), /* @__PURE__ */ I("tbody", { children: _.data.items.map((e) => /* @__PURE__ */ L("tr", {
132
+ ] }) }), /* @__PURE__ */ V("tbody", { children: v.data.items.map((e) => /* @__PURE__ */ H("tr", {
115
133
  className: "transition-colors hover:bg-bg-sunken/60",
116
134
  children: [
117
- /* @__PURE__ */ L(h, { children: [/* @__PURE__ */ I("div", {
135
+ /* @__PURE__ */ H(g, { children: [/* @__PURE__ */ V("div", {
118
136
  className: "font-medium text-text-primary",
119
137
  children: e.searchedParties.join(", ") || "Conflict search"
120
- }), e.findings ? /* @__PURE__ */ I("div", {
138
+ }), e.findings ? /* @__PURE__ */ V("div", {
121
139
  className: "text-xs text-text-tertiary",
122
140
  children: e.findings
123
141
  }) : null] }),
124
- /* @__PURE__ */ I(h, {
142
+ /* @__PURE__ */ V(g, {
125
143
  className: "whitespace-nowrap",
126
- children: y(e.createdAt)
144
+ children: b(e.createdAt)
127
145
  }),
128
- /* @__PURE__ */ I(h, {
146
+ /* @__PURE__ */ V(g, {
129
147
  className: "text-right",
130
- children: /* @__PURE__ */ I(p, { status: e.status })
148
+ children: /* @__PURE__ */ V(m, { status: e.status })
131
149
  })
132
150
  ]
133
151
  }, e.id)) })] })
134
152
  })]
135
153
  }),
136
- /* @__PURE__ */ I(f, {
154
+ /* @__PURE__ */ V(q, {
155
+ rows: K.data ?? [],
156
+ loading: K.isLoading,
157
+ error: K.error,
158
+ hasScopes: G.length > 0,
159
+ actors: X
160
+ }),
161
+ /* @__PURE__ */ V(p, {
137
162
  title: "Engagements",
138
- description: `${a.engagements.length} scoped for this client`,
139
- action: /* @__PURE__ */ L(R, {
163
+ description: `${o.engagements.length} scoped for this client`,
164
+ action: /* @__PURE__ */ H(U, {
140
165
  size: "sm",
141
166
  variant: "outline",
142
- onClick: () => i("engagements"),
143
- children: [/* @__PURE__ */ I(M, { className: "mr-1.5 h-4 w-4" }), "Manage"]
167
+ onClick: () => a("engagements"),
168
+ children: [/* @__PURE__ */ V(F, { className: "mr-1.5 h-4 w-4" }), "Manage"]
144
169
  }),
145
- children: a.engagements.length === 0 ? /* @__PURE__ */ I(o, {
170
+ children: o.engagements.length === 0 ? /* @__PURE__ */ V(s, {
146
171
  title: "No engagements",
147
172
  description: "Scope the first engagement for this client.",
148
- icon: /* @__PURE__ */ I(T, { className: "h-7 w-7" })
149
- }) : /* @__PURE__ */ L(m, { children: [/* @__PURE__ */ I("thead", { children: /* @__PURE__ */ L("tr", { children: [
150
- /* @__PURE__ */ I(v, { children: "Engagement" }),
151
- /* @__PURE__ */ I(v, { children: "Fee" }),
152
- /* @__PURE__ */ I(v, { children: "Started" }),
153
- /* @__PURE__ */ I(v, {
173
+ icon: /* @__PURE__ */ V(O, { className: "h-7 w-7" })
174
+ }) : /* @__PURE__ */ H(h, { children: [/* @__PURE__ */ V("thead", { children: /* @__PURE__ */ H("tr", { children: [
175
+ /* @__PURE__ */ V(y, { children: "Engagement" }),
176
+ /* @__PURE__ */ V(y, { children: "Partner" }),
177
+ /* @__PURE__ */ V(y, { children: "Fee" }),
178
+ /* @__PURE__ */ V(y, { children: "Started" }),
179
+ /* @__PURE__ */ V(y, {
154
180
  className: "text-right",
155
181
  children: "Status"
156
182
  })
157
- ] }) }), /* @__PURE__ */ I("tbody", { children: a.engagements.map((e) => /* @__PURE__ */ L("tr", {
183
+ ] }) }), /* @__PURE__ */ V("tbody", { children: o.engagements.map((e) => /* @__PURE__ */ H("tr", {
158
184
  className: "group cursor-pointer transition-colors hover:bg-bg-sunken/60",
159
- onClick: () => i(`engagements/${e.id}`),
185
+ onClick: () => a(`engagements/${e.id}`),
160
186
  children: [
161
- /* @__PURE__ */ I(h, { children: /* @__PURE__ */ L("div", {
187
+ /* @__PURE__ */ V(g, { children: /* @__PURE__ */ H("div", {
162
188
  className: "flex items-center gap-1 font-medium text-text-primary transition-colors group-hover:text-accent",
163
- children: [/* @__PURE__ */ I("span", { children: e.name }), /* @__PURE__ */ I(E, { className: "h-3.5 w-3.5 shrink-0 text-text-tertiary opacity-0 transition-opacity group-hover:opacity-100" })]
189
+ children: [/* @__PURE__ */ V("span", { children: e.name }), /* @__PURE__ */ V(k, { className: "h-3.5 w-3.5 shrink-0 text-text-tertiary opacity-0 transition-opacity group-hover:opacity-100" })]
164
190
  }) }),
165
- /* @__PURE__ */ L(h, {
191
+ /* @__PURE__ */ V(g, {
192
+ className: "whitespace-nowrap",
193
+ children: e.responsiblePartnerId ? X.nameOf(e.responsiblePartnerId) : /* @__PURE__ */ V("span", {
194
+ className: "text-text-tertiary",
195
+ children: "Unassigned"
196
+ })
197
+ }),
198
+ /* @__PURE__ */ H(g, {
166
199
  className: "whitespace-nowrap",
167
200
  children: [
168
- b(e.feeAmount, e.currency),
201
+ x(e.feeAmount, e.currency),
169
202
  " ",
170
- /* @__PURE__ */ L("span", {
203
+ /* @__PURE__ */ H("span", {
171
204
  className: "text-xs text-text-tertiary",
172
- children: ["/ ", x(e.feeArrangement)]
205
+ children: ["/ ", S(e.feeArrangement)]
173
206
  })
174
207
  ]
175
208
  }),
176
- /* @__PURE__ */ I(h, {
209
+ /* @__PURE__ */ V(g, {
177
210
  className: "whitespace-nowrap",
178
- children: y(e.startDate)
211
+ children: b(e.startDate)
179
212
  }),
180
- /* @__PURE__ */ I(h, {
213
+ /* @__PURE__ */ V(g, {
181
214
  className: "text-right",
182
- children: /* @__PURE__ */ I(p, { status: e.status })
215
+ children: /* @__PURE__ */ V(m, { status: e.status })
183
216
  })
184
217
  ]
185
218
  }, e.id)) })] })
186
219
  }),
187
- /* @__PURE__ */ I(f, {
220
+ /* @__PURE__ */ V(p, {
188
221
  title: "Matters",
189
- description: `${a.matters.length} tracked for this client`,
190
- action: /* @__PURE__ */ L(R, {
222
+ description: `${o.matters.length} tracked for this client`,
223
+ action: /* @__PURE__ */ H(U, {
191
224
  size: "sm",
192
225
  variant: "outline",
193
- onClick: () => i("matters"),
194
- children: [/* @__PURE__ */ I(M, { className: "mr-1.5 h-4 w-4" }), "Manage"]
226
+ onClick: () => a("matters"),
227
+ children: [/* @__PURE__ */ V(F, { className: "mr-1.5 h-4 w-4" }), "Manage"]
195
228
  }),
196
- children: a.matters.length === 0 ? /* @__PURE__ */ I(o, {
229
+ children: o.matters.length === 0 ? /* @__PURE__ */ V(s, {
197
230
  title: "No matters",
198
231
  description: "Open a matter to track regulated work for this client.",
199
- icon: /* @__PURE__ */ I(D, { className: "h-7 w-7" })
200
- }) : /* @__PURE__ */ L(m, { children: [/* @__PURE__ */ I("thead", { children: /* @__PURE__ */ L("tr", { children: [
201
- /* @__PURE__ */ I(v, { children: "Reference" }),
202
- /* @__PURE__ */ I(v, { children: "Title" }),
203
- /* @__PURE__ */ I(v, { children: "Due" }),
204
- /* @__PURE__ */ I(v, { children: "Priority" }),
205
- /* @__PURE__ */ I(v, {
232
+ icon: /* @__PURE__ */ V(A, { className: "h-7 w-7" })
233
+ }) : /* @__PURE__ */ H(h, { children: [/* @__PURE__ */ V("thead", { children: /* @__PURE__ */ H("tr", { children: [
234
+ /* @__PURE__ */ V(y, { children: "Reference" }),
235
+ /* @__PURE__ */ V(y, { children: "Title" }),
236
+ /* @__PURE__ */ V(y, { children: "Lead" }),
237
+ /* @__PURE__ */ V(y, { children: "Due" }),
238
+ /* @__PURE__ */ V(y, { children: "Priority" }),
239
+ /* @__PURE__ */ V(y, {
206
240
  className: "text-right",
207
241
  children: "Status"
208
242
  })
209
- ] }) }), /* @__PURE__ */ I("tbody", { children: a.matters.map((e) => /* @__PURE__ */ L("tr", {
243
+ ] }) }), /* @__PURE__ */ V("tbody", { children: o.matters.map((e) => /* @__PURE__ */ H("tr", {
210
244
  className: "transition-colors hover:bg-bg-sunken/60",
211
245
  children: [
212
- /* @__PURE__ */ I(h, {
246
+ /* @__PURE__ */ V(g, {
213
247
  className: "whitespace-nowrap font-medium text-text-primary",
214
248
  children: e.reference || "—"
215
249
  }),
216
- /* @__PURE__ */ I(h, { children: e.title }),
217
- /* @__PURE__ */ I(h, {
250
+ /* @__PURE__ */ V(g, { children: e.title }),
251
+ /* @__PURE__ */ V(g, {
218
252
  className: "whitespace-nowrap",
219
- children: y(e.dueDate)
253
+ children: e.leadPractitionerId ? X.nameOf(e.leadPractitionerId) : /* @__PURE__ */ V("span", {
254
+ className: "text-text-tertiary",
255
+ children: "Unassigned"
256
+ })
220
257
  }),
221
- /* @__PURE__ */ I(h, { children: /* @__PURE__ */ I(p, { status: e.priority }) }),
222
- /* @__PURE__ */ I(h, {
258
+ /* @__PURE__ */ V(g, {
259
+ className: "whitespace-nowrap",
260
+ children: b(e.dueDate)
261
+ }),
262
+ /* @__PURE__ */ V(g, { children: /* @__PURE__ */ V(m, { status: e.priority }) }),
263
+ /* @__PURE__ */ V(g, {
223
264
  className: "text-right",
224
- children: /* @__PURE__ */ I(p, { status: e.status })
265
+ children: /* @__PURE__ */ V(m, { status: e.status })
225
266
  })
226
267
  ]
227
268
  }, e.id)) })] })
228
269
  }),
229
- /* @__PURE__ */ I(S, {
270
+ /* @__PURE__ */ V(w, {
230
271
  entityType: "proserviceworld-client",
231
- entityId: n
272
+ entityId: r
232
273
  }),
233
- F && /* @__PURE__ */ I(H, {
234
- clientId: n,
274
+ R && /* @__PURE__ */ V(Y, {
275
+ clientId: r,
235
276
  onClose: () => B(!1),
236
- onDone: () => void _.refetch()
277
+ onDone: () => void v.refetch()
237
278
  })
238
279
  ]
239
280
  });
240
- }, V = ({ icon: e, value: t, multiline: n }) => /* @__PURE__ */ L("div", {
241
- className: i("flex gap-2.5 text-text-secondary", n ? "items-start" : "items-center"),
242
- children: [/* @__PURE__ */ I("span", {
281
+ };
282
+ function K(e) {
283
+ let t = /* @__PURE__ */ new Map();
284
+ for (let n of e) {
285
+ let e = t.get(n.practitionerId) ?? {
286
+ practitionerId: n.practitionerId,
287
+ roles: [],
288
+ isLead: !1,
289
+ scopes: []
290
+ }, r = S(n.role);
291
+ e.roles.includes(r) || e.roles.push(r), e.isLead = e.isLead || n.isLead, e.scopes.some((e) => e.id === n.scopeId) || e.scopes.push({
292
+ id: n.scopeId,
293
+ name: n.scopeName,
294
+ type: n.scopeType
295
+ }), t.set(n.practitionerId, e);
296
+ }
297
+ return [...t.values()].sort((e, t) => Number(t.isLead) - Number(e.isLead));
298
+ }
299
+ var q = ({ rows: e, loading: t, error: n, hasScopes: r, actors: i }) => {
300
+ let a = K(e);
301
+ return /* @__PURE__ */ V(p, {
302
+ title: "Client team",
303
+ description: "Everyone staffed on this client's engagements and matters.",
304
+ children: t ? /* @__PURE__ */ V(u, { label: "Loading…" }) : n ? /* @__PURE__ */ V(c, { error: n }) : r ? a.length === 0 ? /* @__PURE__ */ V(s, {
305
+ title: "No one assigned",
306
+ description: "Staff practitioners from an engagement's Team section to see them here.",
307
+ icon: /* @__PURE__ */ V(R, { className: "h-7 w-7" })
308
+ }) : /* @__PURE__ */ V("ul", {
309
+ className: "grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-3",
310
+ children: a.map((e) => {
311
+ let t = i.nameOf(e.practitionerId), n = i.profiles[e.practitionerId]?.email;
312
+ return /* @__PURE__ */ H("li", {
313
+ className: "flex items-start gap-3 rounded-xl border border-border-seam bg-bg-canvas p-3.5",
314
+ children: [
315
+ /* @__PURE__ */ V("span", {
316
+ className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-accent/10 text-xs font-semibold text-accent ring-1 ring-inset ring-accent/15",
317
+ children: W(t)
318
+ }),
319
+ /* @__PURE__ */ H("div", {
320
+ className: "min-w-0 flex-1",
321
+ children: [
322
+ /* @__PURE__ */ H("div", {
323
+ className: "flex items-center gap-2",
324
+ children: [/* @__PURE__ */ V("span", {
325
+ className: "truncate text-sm font-medium text-text-primary",
326
+ children: t
327
+ }), e.isLead && /* @__PURE__ */ V("span", {
328
+ className: "shrink-0 rounded-full bg-bg-sunken px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-accent",
329
+ children: "Lead"
330
+ })]
331
+ }),
332
+ /* @__PURE__ */ V("div", {
333
+ className: "mt-0.5 truncate text-xs text-text-tertiary",
334
+ children: e.roles.join(" · ")
335
+ }),
336
+ /* @__PURE__ */ V("div", {
337
+ className: "mt-2 flex flex-wrap gap-1.5",
338
+ children: e.scopes.map((e) => /* @__PURE__ */ H("span", {
339
+ className: "inline-flex max-w-full items-center gap-1 rounded-md bg-bg-sunken px-1.5 py-0.5 text-[11px] text-text-secondary",
340
+ children: [e.type === "engagement" ? /* @__PURE__ */ V(O, { className: "h-3 w-3 shrink-0 text-text-tertiary" }) : /* @__PURE__ */ V(A, { className: "h-3 w-3 shrink-0 text-text-tertiary" }), /* @__PURE__ */ V("span", {
341
+ className: "truncate",
342
+ children: e.name
343
+ })]
344
+ }, e.id))
345
+ })
346
+ ]
347
+ }),
348
+ n ? /* @__PURE__ */ V("a", {
349
+ href: `mailto:${n}`,
350
+ className: "shrink-0 rounded-lg p-1.5 text-text-tertiary transition-colors hover:bg-bg-sunken hover:text-accent",
351
+ "aria-label": `Email ${t}`,
352
+ title: n,
353
+ children: /* @__PURE__ */ V(M, { className: "h-4 w-4" })
354
+ }) : null
355
+ ]
356
+ }, e.practitionerId);
357
+ })
358
+ }) : /* @__PURE__ */ V(s, {
359
+ title: "Nothing to staff yet",
360
+ description: "Scope an engagement or open a matter, then assign the team that will deliver it.",
361
+ icon: /* @__PURE__ */ V(R, { className: "h-7 w-7" })
362
+ })
363
+ });
364
+ }, J = ({ icon: e, value: t, multiline: n }) => /* @__PURE__ */ H("div", {
365
+ className: a("flex gap-2.5 text-text-secondary", n ? "items-start" : "items-center"),
366
+ children: [/* @__PURE__ */ V("span", {
243
367
  className: "mt-0.5 flex h-7 w-7 shrink-0 items-center justify-center rounded-lg bg-bg-sunken text-text-tertiary",
244
368
  children: e
245
- }), /* @__PURE__ */ I("span", {
246
- className: i("min-w-0 break-words", n ? "leading-relaxed" : "truncate"),
369
+ }), /* @__PURE__ */ V("span", {
370
+ className: a("min-w-0 break-words", n ? "leading-relaxed" : "truncate"),
247
371
  children: t
248
372
  })]
249
- }), H = ({ clientId: e, onClose: t, onDone: r }) => {
250
- let i = n(), [o, s] = C(""), [l, d] = C(""), [f, p] = C(null);
251
- return /* @__PURE__ */ I(u, {
373
+ }), Y = ({ clientId: e, onClose: t, onDone: n }) => {
374
+ let i = r(), [a, s] = E(""), [c, u] = E(""), [f, p] = E(null);
375
+ return /* @__PURE__ */ V(d, {
252
376
  open: !0,
253
377
  onClose: t,
254
378
  title: "Run conflict check",
255
- footer: /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I(R, {
379
+ footer: /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V(U, {
256
380
  variant: "outline",
257
381
  onClick: t,
258
382
  disabled: i.isPending,
259
383
  children: "Cancel"
260
- }), /* @__PURE__ */ I(R, {
384
+ }), /* @__PURE__ */ V(U, {
261
385
  onClick: () => {
262
386
  p(null);
263
- let n = o.split(",").map((e) => e.trim()).filter(Boolean);
264
- if (n.length === 0) return p("Add at least one party to search.");
387
+ let r = a.split(",").map((e) => e.trim()).filter(Boolean);
388
+ if (r.length === 0) return p("Add at least one party to search.");
265
389
  i.mutate({
266
390
  clientId: e,
267
- searchedParties: n,
268
- findings: l.trim() || null
391
+ searchedParties: r,
392
+ findings: c.trim() || null
269
393
  }, {
270
394
  onSuccess: () => {
271
- r(), t();
395
+ n(), t();
272
396
  },
273
397
  onError: (e) => p(e instanceof Error ? e.message : "Failed.")
274
398
  });
@@ -276,28 +400,28 @@ var z = (e) => e.split(/\s+/).filter(Boolean).slice(0, 2).map((e) => e[0]?.toUpp
276
400
  disabled: i.isPending,
277
401
  children: i.isPending ? "Running…" : "Record check"
278
402
  })] }),
279
- children: /* @__PURE__ */ L("div", {
403
+ children: /* @__PURE__ */ H("div", {
280
404
  className: "space-y-3",
281
405
  children: [
282
- f && /* @__PURE__ */ I(a, {
406
+ f && /* @__PURE__ */ V(o, {
283
407
  tone: "danger",
284
408
  children: f
285
409
  }),
286
- /* @__PURE__ */ I(c, {
410
+ /* @__PURE__ */ V(l, {
287
411
  label: "Parties searched",
288
412
  required: !0,
289
413
  hint: "Comma-separated — counterparties, related entities, principals.",
290
- children: /* @__PURE__ */ I(_, {
291
- value: o,
414
+ children: /* @__PURE__ */ V(v, {
415
+ value: a,
292
416
  onChange: (e) => s(e.target.value),
293
417
  placeholder: "Beta Corp, John Roe, Gamma LLP"
294
418
  })
295
419
  }),
296
- /* @__PURE__ */ I(c, {
420
+ /* @__PURE__ */ V(l, {
297
421
  label: "Findings",
298
- children: /* @__PURE__ */ I(g, {
299
- value: l,
300
- onChange: (e) => d(e.target.value),
422
+ children: /* @__PURE__ */ V(_, {
423
+ value: c,
424
+ onChange: (e) => u(e.target.value),
301
425
  placeholder: "Notes on any potential conflicts…"
302
426
  })
303
427
  })
@@ -306,6 +430,6 @@ var z = (e) => e.split(/\s+/).filter(Boolean).slice(0, 2).map((e) => e[0]?.toUpp
306
430
  });
307
431
  };
308
432
  //#endregion
309
- export { B as ClientDetailPage };
433
+ export { G as ClientDetailPage };
310
434
 
311
435
  //# sourceMappingURL=ClientDetailPage.js.map