@burdenoff/microfe-proserviceworld 2026.1014.1 → 2026.1026.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 (28) hide show
  1. package/dist/proserviceworld/hooks/useProServiceWorldApi.d.ts +17 -0
  2. package/dist/proserviceworld/hooks/useProServiceWorldApi.d.ts.map +1 -1
  3. package/dist/proserviceworld/hooks/useProServiceWorldApi.js +70 -48
  4. package/dist/proserviceworld/hooks/useProServiceWorldApi.js.map +1 -1
  5. package/dist/proserviceworld/hooks/useTimeTimer.d.ts +24 -0
  6. package/dist/proserviceworld/hooks/useTimeTimer.d.ts.map +1 -0
  7. package/dist/proserviceworld/hooks/useTimeTimer.js +58 -0
  8. package/dist/proserviceworld/hooks/useTimeTimer.js.map +1 -0
  9. package/dist/proserviceworld/pages/CompliancePage.d.ts.map +1 -1
  10. package/dist/proserviceworld/pages/CompliancePage.js +136 -118
  11. package/dist/proserviceworld/pages/CompliancePage.js.map +1 -1
  12. package/dist/proserviceworld/pages/ConflictsPage.d.ts.map +1 -1
  13. package/dist/proserviceworld/pages/ConflictsPage.js +87 -71
  14. package/dist/proserviceworld/pages/ConflictsPage.js.map +1 -1
  15. package/dist/proserviceworld/pages/DocumentsPage.d.ts.map +1 -1
  16. package/dist/proserviceworld/pages/DocumentsPage.js +104 -86
  17. package/dist/proserviceworld/pages/DocumentsPage.js.map +1 -1
  18. package/dist/proserviceworld/pages/InvoicesPage.d.ts.map +1 -1
  19. package/dist/proserviceworld/pages/InvoicesPage.js +122 -104
  20. package/dist/proserviceworld/pages/InvoicesPage.js.map +1 -1
  21. package/dist/proserviceworld/pages/TimePage.d.ts +7 -0
  22. package/dist/proserviceworld/pages/TimePage.d.ts.map +1 -1
  23. package/dist/proserviceworld/pages/TimePage.js +527 -189
  24. package/dist/proserviceworld/pages/TimePage.js.map +1 -1
  25. package/dist/proserviceworld/pages/TrustPage.d.ts.map +1 -1
  26. package/dist/proserviceworld/pages/TrustPage.js +226 -207
  27. package/dist/proserviceworld/pages/TrustPage.js.map +1 -1
  28. package/package.json +1 -1
@@ -1,55 +1,59 @@
1
1
  import { useClients as e, useCreateTrustAccount as t, useCreateTrustTransfer as n, useReconcileTrustAccount as r, useRecordTrustDeposit as i, useRecordTrustWithdrawal as a, useTrustAccounts as o, useTrustClientBalance as s, useTrustTransactions as c } from "../hooks/useProServiceWorldApi.js";
2
2
  import { cn as l } from "../utils/cn.js";
3
- import { Banner as u, Empty as d, ErrorState as f, Field as p, LoadingBlock as m, MetricCard as h, Modal as g, NativeSelect as _, PageHeader as v, SectionCard as y, StatusPill as b, TableWrap as x, Td as S, TextArea as C, TextInput as w, Th as T, fmtDate as E, fmtMoney as D } from "../components/ui.js";
4
- import { useMemo as O, useState as k } from "react";
5
- import { ArrowDownCircle as A, ArrowUpCircle as j, ClipboardCheck as M, Plus as N, Repeat as P, ShieldAlert as F, Wallet as I } from "lucide-react";
6
- import { Fragment as L, jsx as R, jsxs as z } from "react/jsx-runtime";
7
- import { Button as B } from "@burdenoff/fe-libs/ui";
3
+ import { Banner as u, Empty as d, ErrorState as f, Field as p, LoadingBlock as m, MetricCard as h, Modal as g, NativeSelect as _, PageHeader as v, SectionCard as y, StatusPill as b, TableWrap as x, Td as S, TextArea as C, TextInput as w, Th as T, fmtDate as ee, fmtMoney as E } from "../components/ui.js";
4
+ import { useAnalytics as D } from "../hooks/useAnalytics.js";
5
+ import { useDeferredValue as O, useMemo as k, useState as A } from "react";
6
+ import { ArrowDownCircle as j, ArrowUpCircle as te, ClipboardCheck as M, Plus as N, Repeat as ne, Search as re, ShieldAlert as ie, Wallet as P } from "lucide-react";
7
+ import { Fragment as F, jsx as I, jsxs as L } from "react/jsx-runtime";
8
+ import { Button as R } from "@burdenoff/fe-libs/ui";
8
9
  //#region src/proserviceworld/pages/TrustPage.tsx
9
- var V = () => {
10
- let [t, n] = k(""), [r, i] = k(""), [a, p] = k(null), [g, C] = k(null), [w, V] = k(null), K = o(), q = e({ pagination: { limit: 100 } }), J = O(() => new Map((q.data?.items ?? []).map((e) => [e.id, e.name])), [q.data]), Y = t || K.data?.items[0]?.id || "", X = c({ trustAccountId: Y || void 0 }), Z = s(Y || void 0, r || void 0);
11
- if (K.isLoading) return /* @__PURE__ */ R(m, {});
12
- if (K.error) return /* @__PURE__ */ R(f, {
13
- error: K.error,
14
- onRetry: () => void K.refetch()
10
+ var z = () => {
11
+ let [t, n] = A(""), [r, i] = A(""), [a, p] = A(""), g = O(a), [C, z] = A(null), [W, G] = A(null), [K, ae] = A(null), { emitFact: oe } = D(), q = o(), J = e({ pagination: { limit: 100 } }), Y = k(() => new Map((J.data?.items ?? []).map((e) => [e.id, e.name])), [J.data]), X = t || q.data?.items[0]?.id || "", Z = c({
12
+ trustAccountId: X || void 0,
13
+ search: g.trim() || void 0
14
+ }), Q = s(X || void 0, r || void 0);
15
+ if (q.isLoading) return /* @__PURE__ */ I(m, {});
16
+ if (q.error) return /* @__PURE__ */ I(f, {
17
+ error: q.error,
18
+ onRetry: () => void q.refetch()
15
19
  });
16
- let Q = K.data?.items.find((e) => e.id === Y);
17
- return /* @__PURE__ */ z("div", {
20
+ let $ = q.data?.items.find((e) => e.id === X);
21
+ return /* @__PURE__ */ L("div", {
18
22
  className: "space-y-6",
19
23
  children: [
20
- /* @__PURE__ */ R(v, {
24
+ /* @__PURE__ */ I(v, {
21
25
  title: "Trust Accounting",
22
26
  subtitle: "IOLTA-style trust ledger — client funds held separately from the firm's operating money, reconciled against the bank statement.",
23
- icon: /* @__PURE__ */ R(I, { className: "h-6 w-6" }),
24
- actions: /* @__PURE__ */ z(B, {
25
- onClick: () => p("account"),
26
- children: [/* @__PURE__ */ R(N, { className: "mr-1.5 h-4 w-4" }), "New trust account"]
27
+ icon: /* @__PURE__ */ I(P, { className: "h-6 w-6" }),
28
+ actions: /* @__PURE__ */ L(R, {
29
+ onClick: () => z("account"),
30
+ children: [/* @__PURE__ */ I(N, { className: "mr-1.5 h-4 w-4" }), "New trust account"]
27
31
  })
28
32
  }),
29
- g && /* @__PURE__ */ R(u, {
30
- tone: g.tone,
31
- onClose: () => C(null),
32
- children: g.text
33
+ W && /* @__PURE__ */ I(u, {
34
+ tone: W.tone,
35
+ onClose: () => G(null),
36
+ children: W.text
33
37
  }),
34
- !K.data || K.data.items.length === 0 ? /* @__PURE__ */ R(d, {
38
+ !q.data || q.data.items.length === 0 ? /* @__PURE__ */ I(d, {
35
39
  title: "No trust accounts yet",
36
40
  description: "Open a trust (IOLTA) account to start holding client funds separately from operating money.",
37
- icon: /* @__PURE__ */ R(I, { className: "h-8 w-8" }),
38
- action: /* @__PURE__ */ z(B, {
39
- onClick: () => p("account"),
40
- children: [/* @__PURE__ */ R(N, { className: "mr-1.5 h-4 w-4" }), "New trust account"]
41
+ icon: /* @__PURE__ */ I(P, { className: "h-8 w-8" }),
42
+ action: /* @__PURE__ */ L(R, {
43
+ onClick: () => z("account"),
44
+ children: [/* @__PURE__ */ I(N, { className: "mr-1.5 h-4 w-4" }), "New trust account"]
41
45
  })
42
- }) : /* @__PURE__ */ z(L, { children: [
43
- /* @__PURE__ */ z("div", {
46
+ }) : /* @__PURE__ */ L(F, { children: [
47
+ /* @__PURE__ */ L("div", {
44
48
  className: "flex flex-wrap items-center justify-between gap-3",
45
- children: [/* @__PURE__ */ z("div", {
49
+ children: [/* @__PURE__ */ L("div", {
46
50
  className: "flex flex-wrap items-center gap-2",
47
51
  children: [
48
- /* @__PURE__ */ R(_, {
49
- value: Y,
52
+ /* @__PURE__ */ I(_, {
53
+ value: X,
50
54
  onChange: (e) => n(e.target.value),
51
55
  className: "sm:w-64",
52
- children: K.data.items.map((e) => /* @__PURE__ */ z("option", {
56
+ children: q.data.items.map((e) => /* @__PURE__ */ L("option", {
53
57
  value: e.id,
54
58
  children: [
55
59
  e.name,
@@ -58,244 +62,259 @@ var V = () => {
58
62
  ]
59
63
  }, e.id))
60
64
  }),
61
- Q && /* @__PURE__ */ R(b, { status: Q.status }),
62
- /* @__PURE__ */ z(_, {
65
+ $ && /* @__PURE__ */ I(b, { status: $.status }),
66
+ /* @__PURE__ */ L(_, {
63
67
  value: r,
64
68
  onChange: (e) => i(e.target.value),
65
69
  className: "sm:w-56",
66
- children: [/* @__PURE__ */ R("option", {
70
+ children: [/* @__PURE__ */ I("option", {
67
71
  value: "",
68
72
  children: "All clients"
69
- }), q.data?.items.map((e) => /* @__PURE__ */ R("option", {
73
+ }), J.data?.items.map((e) => /* @__PURE__ */ I("option", {
70
74
  value: e.id,
71
75
  children: e.name
72
76
  }, e.id))]
77
+ }),
78
+ /* @__PURE__ */ L("div", {
79
+ className: "relative w-full sm:w-64",
80
+ children: [/* @__PURE__ */ I(re, { className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-tertiary" }), /* @__PURE__ */ I(w, {
81
+ placeholder: "Search ledger…",
82
+ value: a,
83
+ onChange: (e) => p(e.target.value),
84
+ onKeyDown: (e) => {
85
+ e.key === "Enter" && a.trim() && oe("psw.search.performed", {
86
+ entityType: "trust-transaction",
87
+ queryLength: a.trim().length
88
+ });
89
+ },
90
+ className: "pl-9"
91
+ })]
73
92
  })
74
93
  ]
75
- }), /* @__PURE__ */ z("div", {
94
+ }), /* @__PURE__ */ L("div", {
76
95
  className: "flex flex-wrap gap-2",
77
96
  children: [
78
- /* @__PURE__ */ z(B, {
97
+ /* @__PURE__ */ L(R, {
79
98
  variant: "outline",
80
99
  size: "sm",
81
- onClick: () => p("deposit"),
82
- children: [/* @__PURE__ */ R(A, { className: "mr-1.5 h-4 w-4" }), "Deposit"]
100
+ onClick: () => z("deposit"),
101
+ children: [/* @__PURE__ */ I(j, { className: "mr-1.5 h-4 w-4" }), "Deposit"]
83
102
  }),
84
- /* @__PURE__ */ z(B, {
103
+ /* @__PURE__ */ L(R, {
85
104
  variant: "outline",
86
105
  size: "sm",
87
- onClick: () => p("withdrawal"),
88
- children: [/* @__PURE__ */ R(j, { className: "mr-1.5 h-4 w-4" }), "Withdrawal"]
106
+ onClick: () => z("withdrawal"),
107
+ children: [/* @__PURE__ */ I(te, { className: "mr-1.5 h-4 w-4" }), "Withdrawal"]
89
108
  }),
90
- /* @__PURE__ */ z(B, {
109
+ /* @__PURE__ */ L(R, {
91
110
  variant: "outline",
92
111
  size: "sm",
93
- onClick: () => p("transfer"),
94
- children: [/* @__PURE__ */ R(P, { className: "mr-1.5 h-4 w-4" }), "Transfer to operating"]
112
+ onClick: () => z("transfer"),
113
+ children: [/* @__PURE__ */ I(ne, { className: "mr-1.5 h-4 w-4" }), "Transfer to operating"]
95
114
  }),
96
- /* @__PURE__ */ z(B, {
115
+ /* @__PURE__ */ L(R, {
97
116
  variant: "outline",
98
117
  size: "sm",
99
- onClick: () => p("reconcile"),
100
- children: [/* @__PURE__ */ R(M, { className: "mr-1.5 h-4 w-4" }), "Reconcile"]
118
+ onClick: () => z("reconcile"),
119
+ children: [/* @__PURE__ */ I(M, { className: "mr-1.5 h-4 w-4" }), "Reconcile"]
101
120
  })
102
121
  ]
103
122
  })]
104
123
  }),
105
- /* @__PURE__ */ z("div", {
124
+ /* @__PURE__ */ L("div", {
106
125
  className: "grid grid-cols-1 gap-3 sm:grid-cols-3",
107
126
  children: [
108
- /* @__PURE__ */ R(h, {
127
+ /* @__PURE__ */ I(h, {
109
128
  label: "Trust accounts",
110
- value: K.data.totalCount,
111
- icon: /* @__PURE__ */ R(I, { className: "h-4 w-4" })
129
+ value: q.data.totalCount,
130
+ icon: /* @__PURE__ */ I(P, { className: "h-4 w-4" })
112
131
  }),
113
- /* @__PURE__ */ R(h, {
132
+ /* @__PURE__ */ I(h, {
114
133
  label: "Currency",
115
- value: Q?.currency ?? "—",
116
- icon: /* @__PURE__ */ R(I, { className: "h-4 w-4" })
134
+ value: $?.currency ?? "—",
135
+ icon: /* @__PURE__ */ I(P, { className: "h-4 w-4" })
117
136
  }),
118
- r ? /* @__PURE__ */ R(h, {
119
- label: `Balance — ${J.get(r) ?? "client"}`,
120
- value: Z.isLoading ? "…" : D(Z.data?.balance ?? 0, Q?.currency),
121
- icon: /* @__PURE__ */ R(I, { className: "h-4 w-4" }),
122
- tone: (Z.data?.balance ?? 0) < 0 ? "danger" : "success"
123
- }) : /* @__PURE__ */ R(h, {
137
+ r ? /* @__PURE__ */ I(h, {
138
+ label: `Balance — ${Y.get(r) ?? "client"}`,
139
+ value: Q.isLoading ? "…" : E(Q.data?.balance ?? 0, $?.currency),
140
+ icon: /* @__PURE__ */ I(P, { className: "h-4 w-4" }),
141
+ tone: (Q.data?.balance ?? 0) < 0 ? "danger" : "success"
142
+ }) : /* @__PURE__ */ I(h, {
124
143
  label: "Ledger entries",
125
- value: X.data?.totalCount ?? 0,
126
- icon: /* @__PURE__ */ R(M, { className: "h-4 w-4" })
144
+ value: Z.data?.totalCount ?? 0,
145
+ icon: /* @__PURE__ */ I(M, { className: "h-4 w-4" })
127
146
  })
128
147
  ]
129
148
  }),
130
- w && /* @__PURE__ */ z(y, {
149
+ K && /* @__PURE__ */ L(y, {
131
150
  title: "Reconciliation result",
132
151
  children: [
133
- /* @__PURE__ */ z("div", {
152
+ /* @__PURE__ */ L("div", {
134
153
  className: "grid grid-cols-1 gap-3 sm:grid-cols-4",
135
154
  children: [
136
- /* @__PURE__ */ R(h, {
155
+ /* @__PURE__ */ I(h, {
137
156
  label: "Book balance",
138
- value: D(w.bookBalance, Q?.currency),
139
- icon: /* @__PURE__ */ R(I, { className: "h-4 w-4" })
157
+ value: E(K.bookBalance, $?.currency),
158
+ icon: /* @__PURE__ */ I(P, { className: "h-4 w-4" })
140
159
  }),
141
- /* @__PURE__ */ R(h, {
160
+ /* @__PURE__ */ I(h, {
142
161
  label: "Statement balance",
143
- value: w.statementBalance == null ? "—" : D(w.statementBalance, Q?.currency),
144
- icon: /* @__PURE__ */ R(M, { className: "h-4 w-4" })
162
+ value: K.statementBalance == null ? "—" : E(K.statementBalance, $?.currency),
163
+ icon: /* @__PURE__ */ I(M, { className: "h-4 w-4" })
145
164
  }),
146
- /* @__PURE__ */ R(h, {
165
+ /* @__PURE__ */ I(h, {
147
166
  label: "Difference",
148
- value: w.difference == null ? "—" : D(w.difference, Q?.currency),
149
- tone: w.inBalance ? "success" : "danger",
150
- icon: w.inBalance ? /* @__PURE__ */ R(M, { className: "h-4 w-4" }) : /* @__PURE__ */ R(F, { className: "h-4 w-4" })
167
+ value: K.difference == null ? "—" : E(K.difference, $?.currency),
168
+ tone: K.inBalance ? "success" : "danger",
169
+ icon: K.inBalance ? /* @__PURE__ */ I(M, { className: "h-4 w-4" }) : /* @__PURE__ */ I(ie, { className: "h-4 w-4" })
151
170
  }),
152
- /* @__PURE__ */ R(h, {
171
+ /* @__PURE__ */ I(h, {
153
172
  label: "Reconciled entries",
154
- value: w.reconciledCount,
155
- icon: /* @__PURE__ */ R(M, { className: "h-4 w-4" })
173
+ value: K.reconciledCount,
174
+ icon: /* @__PURE__ */ I(M, { className: "h-4 w-4" })
156
175
  })
157
176
  ]
158
177
  }),
159
- !w.inBalance && /* @__PURE__ */ R("div", {
178
+ !K.inBalance && /* @__PURE__ */ I("div", {
160
179
  className: "mt-3",
161
- children: /* @__PURE__ */ R(u, {
180
+ children: /* @__PURE__ */ I(u, {
162
181
  tone: "danger",
163
182
  children: "Out of balance — the bank statement does not match the book balance. Investigate before closing this reconciliation period."
164
183
  })
165
184
  }),
166
- w.clientBalances.length > 0 && /* @__PURE__ */ R("div", {
185
+ K.clientBalances.length > 0 && /* @__PURE__ */ I("div", {
167
186
  className: "mt-3",
168
- children: /* @__PURE__ */ z(x, { children: [/* @__PURE__ */ R("thead", { children: /* @__PURE__ */ z("tr", { children: [
169
- /* @__PURE__ */ R(T, { children: "Client" }),
170
- /* @__PURE__ */ R(T, { children: "Matter" }),
171
- /* @__PURE__ */ R(T, {
187
+ children: /* @__PURE__ */ L(x, { children: [/* @__PURE__ */ I("thead", { children: /* @__PURE__ */ L("tr", { children: [
188
+ /* @__PURE__ */ I(T, { children: "Client" }),
189
+ /* @__PURE__ */ I(T, { children: "Matter" }),
190
+ /* @__PURE__ */ I(T, {
172
191
  className: "text-right",
173
192
  children: "Balance"
174
193
  })
175
- ] }) }), /* @__PURE__ */ R("tbody", { children: w.clientBalances.map((e, t) => /* @__PURE__ */ z("tr", { children: [
176
- /* @__PURE__ */ R(S, { children: J.get(e.clientId) ?? e.clientId }),
177
- /* @__PURE__ */ R(S, { children: e.matterId ?? "—" }),
178
- /* @__PURE__ */ R(S, {
194
+ ] }) }), /* @__PURE__ */ I("tbody", { children: K.clientBalances.map((e, t) => /* @__PURE__ */ L("tr", { children: [
195
+ /* @__PURE__ */ I(S, { children: Y.get(e.clientId) ?? e.clientId }),
196
+ /* @__PURE__ */ I(S, { children: e.matterId ?? "—" }),
197
+ /* @__PURE__ */ I(S, {
179
198
  className: "text-right font-medium",
180
- children: D(e.balance, Q?.currency)
199
+ children: E(e.balance, $?.currency)
181
200
  })
182
201
  ] }, `${e.clientId}-${e.matterId ?? "none"}-${t}`)) })] })
183
202
  })
184
203
  ]
185
204
  }),
186
- X.isLoading ? /* @__PURE__ */ R(m, {}) : X.error ? /* @__PURE__ */ R(f, {
187
- error: X.error,
188
- onRetry: () => void X.refetch()
189
- }) : !X.data || X.data.items.length === 0 ? /* @__PURE__ */ R(d, {
205
+ Z.isLoading ? /* @__PURE__ */ I(m, {}) : Z.error ? /* @__PURE__ */ I(f, {
206
+ error: Z.error,
207
+ onRetry: () => void Z.refetch()
208
+ }) : !Z.data || Z.data.items.length === 0 ? /* @__PURE__ */ I(d, {
190
209
  title: "No trust ledger entries yet",
191
- icon: /* @__PURE__ */ R(I, { className: "h-8 w-8" })
192
- }) : /* @__PURE__ */ R(y, {
210
+ icon: /* @__PURE__ */ I(P, { className: "h-8 w-8" })
211
+ }) : /* @__PURE__ */ I(y, {
193
212
  title: "Trust ledger",
194
- children: /* @__PURE__ */ z(x, { children: [/* @__PURE__ */ R("thead", { children: /* @__PURE__ */ z("tr", { children: [
195
- /* @__PURE__ */ R(T, { children: "Date" }),
196
- /* @__PURE__ */ R(T, { children: "Client" }),
197
- /* @__PURE__ */ R(T, { children: "Type" }),
198
- /* @__PURE__ */ R(T, {
213
+ children: /* @__PURE__ */ L(x, { children: [/* @__PURE__ */ I("thead", { children: /* @__PURE__ */ L("tr", { children: [
214
+ /* @__PURE__ */ I(T, { children: "Date" }),
215
+ /* @__PURE__ */ I(T, { children: "Client" }),
216
+ /* @__PURE__ */ I(T, { children: "Type" }),
217
+ /* @__PURE__ */ I(T, {
199
218
  className: "text-right",
200
219
  children: "Amount"
201
220
  }),
202
- /* @__PURE__ */ R(T, {
221
+ /* @__PURE__ */ I(T, {
203
222
  className: "text-right",
204
223
  children: "Balance after"
205
224
  }),
206
- /* @__PURE__ */ R(T, { children: "Reference" }),
207
- /* @__PURE__ */ R(T, { children: "Reconciled" })
208
- ] }) }), /* @__PURE__ */ R("tbody", { children: X.data.items.map((e) => /* @__PURE__ */ z("tr", {
225
+ /* @__PURE__ */ I(T, { children: "Reference" }),
226
+ /* @__PURE__ */ I(T, { children: "Reconciled" })
227
+ ] }) }), /* @__PURE__ */ I("tbody", { children: Z.data.items.map((e) => /* @__PURE__ */ L("tr", {
209
228
  className: "transition-colors hover:bg-bg-sunken/60",
210
229
  children: [
211
- /* @__PURE__ */ R(S, {
230
+ /* @__PURE__ */ I(S, {
212
231
  className: "whitespace-nowrap",
213
- children: E(e.createdAt)
232
+ children: ee(e.createdAt)
214
233
  }),
215
- /* @__PURE__ */ R(S, { children: J.get(e.clientId) ?? e.clientId }),
216
- /* @__PURE__ */ R(S, { children: /* @__PURE__ */ R(b, { status: e.type }) }),
217
- /* @__PURE__ */ R(S, {
234
+ /* @__PURE__ */ I(S, { children: Y.get(e.clientId) ?? e.clientId }),
235
+ /* @__PURE__ */ I(S, { children: /* @__PURE__ */ I(b, { status: e.type }) }),
236
+ /* @__PURE__ */ I(S, {
218
237
  className: l("text-right font-medium whitespace-nowrap", e.amount < 0 ? "text-status-error-text" : "text-status-success-text"),
219
- children: D(e.amount, Q?.currency)
238
+ children: E(e.amount, $?.currency)
220
239
  }),
221
- /* @__PURE__ */ R(S, {
240
+ /* @__PURE__ */ I(S, {
222
241
  className: "text-right whitespace-nowrap",
223
- children: D(e.balanceAfter, Q?.currency)
242
+ children: E(e.balanceAfter, $?.currency)
224
243
  }),
225
- /* @__PURE__ */ R(S, { children: e.reference ?? "—" }),
226
- /* @__PURE__ */ R(S, { children: e.reconciled ? /* @__PURE__ */ R(b, { status: "RECONCILED" }) : "—" })
244
+ /* @__PURE__ */ I(S, { children: e.reference ?? "—" }),
245
+ /* @__PURE__ */ I(S, { children: e.reconciled ? /* @__PURE__ */ I(b, { status: "RECONCILED" }) : "—" })
227
246
  ]
228
247
  }, e.id)) })] })
229
248
  })
230
249
  ] }),
231
- a === "account" && /* @__PURE__ */ R(H, {
232
- onClose: () => p(null),
233
- onSaved: (e) => C({
250
+ C === "account" && /* @__PURE__ */ I(B, {
251
+ onClose: () => z(null),
252
+ onSaved: (e) => G({
234
253
  tone: "success",
235
254
  text: `${e} created.`
236
255
  })
237
256
  }),
238
- a === "deposit" && Y && /* @__PURE__ */ R(U, {
257
+ C === "deposit" && X && /* @__PURE__ */ I(V, {
239
258
  kind: "deposit",
240
- trustAccountId: Y,
241
- currency: Q?.currency,
242
- onClose: () => p(null),
243
- onSaved: () => C({
259
+ trustAccountId: X,
260
+ currency: $?.currency,
261
+ onClose: () => z(null),
262
+ onSaved: () => G({
244
263
  tone: "success",
245
264
  text: "Deposit recorded."
246
265
  })
247
266
  }),
248
- a === "withdrawal" && Y && /* @__PURE__ */ R(U, {
267
+ C === "withdrawal" && X && /* @__PURE__ */ I(V, {
249
268
  kind: "withdrawal",
250
- trustAccountId: Y,
251
- currency: Q?.currency,
252
- onClose: () => p(null),
253
- onSaved: () => C({
269
+ trustAccountId: X,
270
+ currency: $?.currency,
271
+ onClose: () => z(null),
272
+ onSaved: () => G({
254
273
  tone: "success",
255
274
  text: "Withdrawal recorded."
256
275
  })
257
276
  }),
258
- a === "transfer" && Y && /* @__PURE__ */ R(W, {
259
- trustAccountId: Y,
260
- currency: Q?.currency,
261
- onClose: () => p(null),
262
- onSaved: () => C({
277
+ C === "transfer" && X && /* @__PURE__ */ I(H, {
278
+ trustAccountId: X,
279
+ currency: $?.currency,
280
+ onClose: () => z(null),
281
+ onSaved: () => G({
263
282
  tone: "success",
264
283
  text: "Transfer to operating recorded."
265
284
  })
266
285
  }),
267
- a === "reconcile" && Y && /* @__PURE__ */ R(G, {
268
- trustAccountId: Y,
269
- onClose: () => p(null),
286
+ C === "reconcile" && X && /* @__PURE__ */ I(U, {
287
+ trustAccountId: X,
288
+ onClose: () => z(null),
270
289
  onSaved: (e) => {
271
- V(e), C({
290
+ ae(e), G({
272
291
  tone: e.inBalance ? "success" : "danger",
273
- text: e.inBalance ? `Reconciled — ${e.reconciledCount} entries, in balance.` : `Reconciled with a difference of ${D(e.difference ?? 0, Q?.currency)} — review before closing the period.`
292
+ text: e.inBalance ? `Reconciled — ${e.reconciledCount} entries, in balance.` : `Reconciled with a difference of ${E(e.difference ?? 0, $?.currency)} — review before closing the period.`
274
293
  });
275
294
  }
276
295
  })
277
296
  ]
278
297
  });
279
- }, H = ({ onClose: e, onSaved: n }) => {
280
- let r = t(), [i, a] = k({
298
+ }, B = ({ onClose: e, onSaved: n }) => {
299
+ let r = t(), [i, a] = A({
281
300
  name: "",
282
301
  institutionName: "",
283
302
  accountNumberLast4: "",
284
303
  currency: "USD"
285
- }), [o, s] = k(null), c = (e) => (t) => a((n) => ({
304
+ }), [o, s] = A(null), c = (e) => (t) => a((n) => ({
286
305
  ...n,
287
306
  [e]: t.target.value
288
307
  }));
289
- return /* @__PURE__ */ R(g, {
308
+ return /* @__PURE__ */ I(g, {
290
309
  open: !0,
291
310
  onClose: e,
292
311
  title: "New trust account",
293
- footer: /* @__PURE__ */ z(L, { children: [/* @__PURE__ */ R(B, {
312
+ footer: /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I(R, {
294
313
  variant: "outline",
295
314
  onClick: e,
296
315
  disabled: r.isPending,
297
316
  children: "Cancel"
298
- }), /* @__PURE__ */ R(B, {
317
+ }), /* @__PURE__ */ I(R, {
299
318
  onClick: () => {
300
319
  if (s(null), !i.name.trim()) return s("Account name is required.");
301
320
  r.mutate({
@@ -313,42 +332,42 @@ var V = () => {
313
332
  disabled: r.isPending,
314
333
  children: r.isPending ? "Creating…" : "Create account"
315
334
  })] }),
316
- children: /* @__PURE__ */ z("div", {
335
+ children: /* @__PURE__ */ L("div", {
317
336
  className: "space-y-3",
318
337
  children: [
319
- o && /* @__PURE__ */ R(u, {
338
+ o && /* @__PURE__ */ I(u, {
320
339
  tone: "danger",
321
340
  children: o
322
341
  }),
323
- /* @__PURE__ */ R(p, {
342
+ /* @__PURE__ */ I(p, {
324
343
  label: "Name",
325
344
  required: !0,
326
- children: /* @__PURE__ */ R(w, {
345
+ children: /* @__PURE__ */ I(w, {
327
346
  value: i.name,
328
347
  onChange: c("name"),
329
348
  placeholder: "IOLTA Main"
330
349
  })
331
350
  }),
332
- /* @__PURE__ */ z("div", {
351
+ /* @__PURE__ */ L("div", {
333
352
  className: "grid grid-cols-2 gap-3",
334
- children: [/* @__PURE__ */ R(p, {
353
+ children: [/* @__PURE__ */ I(p, {
335
354
  label: "Institution (optional)",
336
- children: /* @__PURE__ */ R(w, {
355
+ children: /* @__PURE__ */ I(w, {
337
356
  value: i.institutionName,
338
357
  onChange: c("institutionName")
339
358
  })
340
- }), /* @__PURE__ */ R(p, {
359
+ }), /* @__PURE__ */ I(p, {
341
360
  label: "Currency",
342
- children: /* @__PURE__ */ R(w, {
361
+ children: /* @__PURE__ */ I(w, {
343
362
  value: i.currency,
344
363
  onChange: c("currency"),
345
364
  maxLength: 3
346
365
  })
347
366
  })]
348
367
  }),
349
- /* @__PURE__ */ R(p, {
368
+ /* @__PURE__ */ I(p, {
350
369
  label: "Last 4 of account number (optional)",
351
- children: /* @__PURE__ */ R(w, {
370
+ children: /* @__PURE__ */ I(w, {
352
371
  value: i.accountNumberLast4,
353
372
  onChange: c("accountNumberLast4"),
354
373
  maxLength: 4
@@ -357,27 +376,27 @@ var V = () => {
357
376
  ]
358
377
  })
359
378
  });
360
- }, U = ({ kind: t, trustAccountId: n, currency: r, onClose: o, onSaved: s }) => {
361
- let c = i(), l = a(), d = t === "deposit" ? c : l, f = e({ pagination: { limit: 100 } }), [m, h] = k({
379
+ }, V = ({ kind: t, trustAccountId: n, currency: r, onClose: o, onSaved: s }) => {
380
+ let c = i(), l = a(), d = t === "deposit" ? c : l, f = e({ pagination: { limit: 100 } }), [m, h] = A({
362
381
  clientId: "",
363
382
  matterId: "",
364
383
  amount: "",
365
384
  reference: "",
366
385
  description: ""
367
- }), [v, y] = k(null), b = (e) => (t) => h((n) => ({
386
+ }), [v, y] = A(null), b = (e) => (t) => h((n) => ({
368
387
  ...n,
369
388
  [e]: t.target.value
370
389
  }));
371
- return /* @__PURE__ */ R(g, {
390
+ return /* @__PURE__ */ I(g, {
372
391
  open: !0,
373
392
  onClose: o,
374
393
  title: t === "deposit" ? "Record trust deposit" : "Record trust withdrawal",
375
- footer: /* @__PURE__ */ z(L, { children: [/* @__PURE__ */ R(B, {
394
+ footer: /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I(R, {
376
395
  variant: "outline",
377
396
  onClick: o,
378
397
  disabled: d.isPending,
379
398
  children: "Cancel"
380
- }), /* @__PURE__ */ R(B, {
399
+ }), /* @__PURE__ */ I(R, {
381
400
  onClick: () => {
382
401
  if (y(null), !m.clientId) return y("Select a client.");
383
402
  let e = Number(m.amount);
@@ -399,60 +418,60 @@ var V = () => {
399
418
  disabled: d.isPending,
400
419
  children: d.isPending ? "Saving…" : t === "deposit" ? "Record deposit" : "Record withdrawal"
401
420
  })] }),
402
- children: /* @__PURE__ */ z("div", {
421
+ children: /* @__PURE__ */ L("div", {
403
422
  className: "space-y-3",
404
423
  children: [
405
- v && /* @__PURE__ */ R(u, {
424
+ v && /* @__PURE__ */ I(u, {
406
425
  tone: "danger",
407
426
  children: v
408
427
  }),
409
- t === "withdrawal" && /* @__PURE__ */ R(u, {
428
+ t === "withdrawal" && /* @__PURE__ */ I(u, {
410
429
  tone: "info",
411
430
  children: "A withdrawal that would take this client’s trust balance below zero is rejected — trust funds are never allowed to go negative."
412
431
  }),
413
- /* @__PURE__ */ R(p, {
432
+ /* @__PURE__ */ I(p, {
414
433
  label: "Client",
415
434
  required: !0,
416
- children: /* @__PURE__ */ z(_, {
435
+ children: /* @__PURE__ */ L(_, {
417
436
  value: m.clientId,
418
437
  onChange: b("clientId"),
419
- children: [/* @__PURE__ */ R("option", {
438
+ children: [/* @__PURE__ */ I("option", {
420
439
  value: "",
421
440
  children: "Select…"
422
- }), f.data?.items.map((e) => /* @__PURE__ */ R("option", {
441
+ }), f.data?.items.map((e) => /* @__PURE__ */ I("option", {
423
442
  value: e.id,
424
443
  children: e.name
425
444
  }, e.id))]
426
445
  })
427
446
  }),
428
- /* @__PURE__ */ z("div", {
447
+ /* @__PURE__ */ L("div", {
429
448
  className: "grid grid-cols-2 gap-3",
430
- children: [/* @__PURE__ */ R(p, {
449
+ children: [/* @__PURE__ */ I(p, {
431
450
  label: "Amount",
432
451
  required: !0,
433
- children: /* @__PURE__ */ R(w, {
452
+ children: /* @__PURE__ */ I(w, {
434
453
  type: "number",
435
454
  min: "0.01",
436
455
  step: "0.01",
437
456
  value: m.amount,
438
457
  onChange: b("amount")
439
458
  })
440
- }), /* @__PURE__ */ R(p, {
459
+ }), /* @__PURE__ */ I(p, {
441
460
  label: "Reference (optional)",
442
- children: /* @__PURE__ */ R(w, {
461
+ children: /* @__PURE__ */ I(w, {
443
462
  value: m.reference,
444
463
  onChange: b("reference"),
445
464
  placeholder: "CHK-1042"
446
465
  })
447
466
  })]
448
467
  }),
449
- m.amount && /* @__PURE__ */ R("div", {
468
+ m.amount && /* @__PURE__ */ I("div", {
450
469
  className: "rounded-lg bg-bg-sunken px-3 py-2 text-sm text-text-secondary",
451
- children: D(Number(m.amount) || 0, r)
470
+ children: E(Number(m.amount) || 0, r)
452
471
  }),
453
- /* @__PURE__ */ R(p, {
472
+ /* @__PURE__ */ I(p, {
454
473
  label: "Description (optional)",
455
- children: /* @__PURE__ */ R(C, {
474
+ children: /* @__PURE__ */ I(C, {
456
475
  value: m.description,
457
476
  onChange: b("description")
458
477
  })
@@ -460,25 +479,25 @@ var V = () => {
460
479
  ]
461
480
  })
462
481
  });
463
- }, W = ({ trustAccountId: t, onClose: r, onSaved: i }) => {
464
- let a = n(), o = e({ pagination: { limit: 100 } }), [s, c] = k({
482
+ }, H = ({ trustAccountId: t, onClose: r, onSaved: i }) => {
483
+ let a = n(), o = e({ pagination: { limit: 100 } }), [s, c] = A({
465
484
  clientId: "",
466
485
  amount: "",
467
486
  reason: ""
468
- }), [l, d] = k(null), f = (e) => (t) => c((n) => ({
487
+ }), [l, d] = A(null), f = (e) => (t) => c((n) => ({
469
488
  ...n,
470
489
  [e]: t.target.value
471
490
  }));
472
- return /* @__PURE__ */ R(g, {
491
+ return /* @__PURE__ */ I(g, {
473
492
  open: !0,
474
493
  onClose: r,
475
494
  title: "Transfer to operating",
476
- footer: /* @__PURE__ */ z(L, { children: [/* @__PURE__ */ R(B, {
495
+ footer: /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I(R, {
477
496
  variant: "outline",
478
497
  onClick: r,
479
498
  disabled: a.isPending,
480
499
  children: "Cancel"
481
- }), /* @__PURE__ */ R(B, {
500
+ }), /* @__PURE__ */ I(R, {
482
501
  onClick: () => {
483
502
  if (d(null), !s.clientId) return d("Select a client.");
484
503
  let e = Number(s.amount);
@@ -498,36 +517,36 @@ var V = () => {
498
517
  disabled: a.isPending,
499
518
  children: a.isPending ? "Transferring…" : "Transfer"
500
519
  })] }),
501
- children: /* @__PURE__ */ z("div", {
520
+ children: /* @__PURE__ */ L("div", {
502
521
  className: "space-y-3",
503
522
  children: [
504
- l && /* @__PURE__ */ R(u, {
523
+ l && /* @__PURE__ */ I(u, {
505
524
  tone: "danger",
506
525
  children: l
507
526
  }),
508
- /* @__PURE__ */ R(u, {
527
+ /* @__PURE__ */ I(u, {
509
528
  tone: "info",
510
529
  children: "Moves earned fees from this client’s trust ledger to the firm’s operating account. Rejected if it would take the client’s trust balance below zero."
511
530
  }),
512
- /* @__PURE__ */ R(p, {
531
+ /* @__PURE__ */ I(p, {
513
532
  label: "Client",
514
533
  required: !0,
515
- children: /* @__PURE__ */ z(_, {
534
+ children: /* @__PURE__ */ L(_, {
516
535
  value: s.clientId,
517
536
  onChange: f("clientId"),
518
- children: [/* @__PURE__ */ R("option", {
537
+ children: [/* @__PURE__ */ I("option", {
519
538
  value: "",
520
539
  children: "Select…"
521
- }), o.data?.items.map((e) => /* @__PURE__ */ R("option", {
540
+ }), o.data?.items.map((e) => /* @__PURE__ */ I("option", {
522
541
  value: e.id,
523
542
  children: e.name
524
543
  }, e.id))]
525
544
  })
526
545
  }),
527
- /* @__PURE__ */ R(p, {
546
+ /* @__PURE__ */ I(p, {
528
547
  label: "Amount",
529
548
  required: !0,
530
- children: /* @__PURE__ */ R(w, {
549
+ children: /* @__PURE__ */ I(w, {
531
550
  type: "number",
532
551
  min: "0.01",
533
552
  step: "0.01",
@@ -535,9 +554,9 @@ var V = () => {
535
554
  onChange: f("amount")
536
555
  })
537
556
  }),
538
- /* @__PURE__ */ R(p, {
557
+ /* @__PURE__ */ I(p, {
539
558
  label: "Reason (optional)",
540
- children: /* @__PURE__ */ R(C, {
559
+ children: /* @__PURE__ */ I(C, {
541
560
  value: s.reason,
542
561
  onChange: f("reason"),
543
562
  placeholder: "Invoice INV-2026-0001 paid from trust"
@@ -546,18 +565,18 @@ var V = () => {
546
565
  ]
547
566
  })
548
567
  });
549
- }, G = ({ trustAccountId: e, onClose: t, onSaved: n }) => {
550
- let i = r(), [a, o] = k(""), [s, c] = k(null);
551
- return /* @__PURE__ */ R(g, {
568
+ }, U = ({ trustAccountId: e, onClose: t, onSaved: n }) => {
569
+ let i = r(), [a, o] = A(""), [s, c] = A(null);
570
+ return /* @__PURE__ */ I(g, {
552
571
  open: !0,
553
572
  onClose: t,
554
573
  title: "Reconcile trust account",
555
- footer: /* @__PURE__ */ z(L, { children: [/* @__PURE__ */ R(B, {
574
+ footer: /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I(R, {
556
575
  variant: "outline",
557
576
  onClick: t,
558
577
  disabled: i.isPending,
559
578
  children: "Cancel"
560
- }), /* @__PURE__ */ R(B, {
579
+ }), /* @__PURE__ */ I(R, {
561
580
  onClick: () => {
562
581
  c(null), i.mutate({
563
582
  trustAccountId: e,
@@ -572,20 +591,20 @@ var V = () => {
572
591
  disabled: i.isPending,
573
592
  children: i.isPending ? "Reconciling…" : "Reconcile"
574
593
  })] }),
575
- children: /* @__PURE__ */ z("div", {
594
+ children: /* @__PURE__ */ L("div", {
576
595
  className: "space-y-3",
577
596
  children: [
578
- s && /* @__PURE__ */ R(u, {
597
+ s && /* @__PURE__ */ I(u, {
579
598
  tone: "danger",
580
599
  children: s
581
600
  }),
582
- /* @__PURE__ */ R(u, {
601
+ /* @__PURE__ */ I(u, {
583
602
  tone: "info",
584
603
  children: "Computes the book balance and every client’s subsidiary-ledger balance as of now, compares it against the bank statement balance below, and marks every not-yet-reconciled entry as reconciled."
585
604
  }),
586
- /* @__PURE__ */ R(p, {
605
+ /* @__PURE__ */ I(p, {
587
606
  label: "Bank statement balance (optional)",
588
- children: /* @__PURE__ */ R(w, {
607
+ children: /* @__PURE__ */ I(w, {
589
608
  type: "number",
590
609
  step: "0.01",
591
610
  value: a,
@@ -598,6 +617,6 @@ var V = () => {
598
617
  });
599
618
  };
600
619
  //#endregion
601
- export { V as TrustPage };
620
+ export { z as TrustPage };
602
621
 
603
622
  //# sourceMappingURL=TrustPage.js.map