@burdenoff/microfe-govcitizenhub 2026.720.5 → 2026.720.7

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 (33) hide show
  1. package/dist/govcitizenhub/hooks/index.d.ts +1 -0
  2. package/dist/govcitizenhub/hooks/index.d.ts.map +1 -1
  3. package/dist/govcitizenhub/hooks/index.js +1 -0
  4. package/dist/govcitizenhub/hooks/useGovApi.d.ts +23 -4
  5. package/dist/govcitizenhub/hooks/useGovApi.d.ts.map +1 -1
  6. package/dist/govcitizenhub/hooks/useGovApi.js +28 -11
  7. package/dist/govcitizenhub/hooks/useGovApi.js.map +1 -1
  8. package/dist/govcitizenhub/hooks/useGovCitizenHubAnalytics.d.ts +24 -0
  9. package/dist/govcitizenhub/hooks/useGovCitizenHubAnalytics.d.ts.map +1 -0
  10. package/dist/govcitizenhub/hooks/useGovCitizenHubAnalytics.js +40 -0
  11. package/dist/govcitizenhub/hooks/useGovCitizenHubAnalytics.js.map +1 -0
  12. package/dist/govcitizenhub/pages/agencies/AgenciesPage.d.ts +3 -2
  13. package/dist/govcitizenhub/pages/agencies/AgenciesPage.d.ts.map +1 -1
  14. package/dist/govcitizenhub/pages/agencies/AgenciesPage.js.map +1 -1
  15. package/dist/govcitizenhub/pages/applications/ApplicationDetailPage.d.ts.map +1 -1
  16. package/dist/govcitizenhub/pages/applications/ApplicationDetailPage.js +169 -163
  17. package/dist/govcitizenhub/pages/applications/ApplicationDetailPage.js.map +1 -1
  18. package/dist/govcitizenhub/pages/applications/NewApplicationPage.d.ts.map +1 -1
  19. package/dist/govcitizenhub/pages/applications/NewApplicationPage.js +151 -147
  20. package/dist/govcitizenhub/pages/applications/NewApplicationPage.js.map +1 -1
  21. package/dist/govcitizenhub/pages/grievances/GrievancesPage.d.ts.map +1 -1
  22. package/dist/govcitizenhub/pages/grievances/GrievancesPage.js +173 -169
  23. package/dist/govcitizenhub/pages/grievances/GrievancesPage.js.map +1 -1
  24. package/dist/govcitizenhub/pages/payments/PaymentsPage.d.ts.map +1 -1
  25. package/dist/govcitizenhub/pages/payments/PaymentsPage.js +53 -49
  26. package/dist/govcitizenhub/pages/payments/PaymentsPage.js.map +1 -1
  27. package/dist/govcitizenhub/pages/permits/IssuePermitDialog.d.ts.map +1 -1
  28. package/dist/govcitizenhub/pages/permits/IssuePermitDialog.js +82 -76
  29. package/dist/govcitizenhub/pages/permits/IssuePermitDialog.js.map +1 -1
  30. package/dist/govcitizenhub/pages/permits/PermitsPage.d.ts.map +1 -1
  31. package/dist/govcitizenhub/pages/permits/PermitsPage.js +174 -120
  32. package/dist/govcitizenhub/pages/permits/PermitsPage.js.map +1 -1
  33. package/package.json +1 -1
@@ -4,25 +4,26 @@ import { PageLayout as t } from "../../components/PageLayout.js";
4
4
  import { formatCurrency as n, formatDate as r, formatDateTime as i, formatEnumLabel as a, formatRelativeTime as o } from "../../utils/formatters.js";
5
5
  import { StatusBadge as s } from "../../components/StatusBadge.js";
6
6
  import { useGovAddCaseNote as c, useGovApplication as l, useGovCreatePayment as u, useGovMarkPaymentPaid as d, useGovPayments as f, useGovRefundPayment as ee, useGovReviewDocument as te, useGovService as ne, useGovSubmitApplication as re, useGovTransitionApplication as ie, useGovUpdateApplication as ae } from "../../hooks/useGovApi.js";
7
+ import { useGovCitizenHubAnalytics as oe } from "../../hooks/useGovCitizenHubAnalytics.js";
7
8
  import "../../hooks/index.js";
8
- import { ErrorView as oe, LoadingView as se } from "../../components/StateViews.js";
9
- import { SlaBadge as ce } from "../../components/SlaBadge.js";
9
+ import { ErrorView as se, LoadingView as ce } from "../../components/StateViews.js";
10
+ import { SlaBadge as le } from "../../components/SlaBadge.js";
10
11
  import { AssigneeChip as p } from "../../components/Avatar.js";
11
12
  import { ConfirmDialog as m } from "../../components/ConfirmDialog.js";
12
13
  import { describeError as h, notify as g } from "../../lib/toast.js";
13
- import { StatusStepper as le } from "../../components/StatusStepper.js";
14
- import { Timeline as ue, TimelineItem as de } from "../../components/Timeline.js";
14
+ import { StatusStepper as ue } from "../../components/StatusStepper.js";
15
+ import { Timeline as de, TimelineItem as fe } from "../../components/Timeline.js";
15
16
  import { SectionCard as _ } from "../../components/SectionCard.js";
16
17
  import { KeyValueList as v } from "../../components/KeyValueList.js";
17
- import { DocumentUploadField as fe } from "../../components/DocumentUploadField.js";
18
- import { IssuePermitDialog as pe } from "../permits/IssuePermitDialog.js";
18
+ import { DocumentUploadField as pe } from "../../components/DocumentUploadField.js";
19
+ import { IssuePermitDialog as me } from "../permits/IssuePermitDialog.js";
19
20
  import { useEffect as y, useMemo as b, useState as x } from "react";
20
- import { BadgeCheck as me, Check as he, CheckCircle2 as S, ChevronDown as ge, ClipboardList as _e, CreditCard as ve, Eye as ye, FileText as be, Gavel as C, HelpCircle as w, Lock as T, MessageSquare as E, PlayCircle as D, Plus as O, Route as xe, Send as Se, UserPlus as Ce, X as we, XCircle as k } from "lucide-react";
21
- import { useParams as Te } from "react-router-dom";
22
- import { Fragment as Ee, jsx as A, jsxs as j } from "react/jsx-runtime";
23
- import { Button as M, DropdownMenu as De, DropdownMenuContent as Oe, DropdownMenuItem as ke, DropdownMenuTrigger as Ae, Input as N, Label as P, ResponsiveDialog as F, ResponsiveDialogContent as I, ResponsiveDialogDescription as L, ResponsiveDialogFooter as R, ResponsiveDialogHeader as z, ResponsiveDialogTitle as B, Select as je, SelectContent as Me, SelectItem as Ne, SelectTrigger as Pe, SelectValue as Fe, Textarea as Ie } from "@burdenoff/fe-libs/ui";
21
+ import { BadgeCheck as he, Check as ge, CheckCircle2 as S, ChevronDown as _e, ClipboardList as ve, CreditCard as ye, Eye as be, FileText as xe, Gavel as C, HelpCircle as w, Lock as T, MessageSquare as E, PlayCircle as D, Plus as O, Route as Se, Send as Ce, UserPlus as we, X as Te, XCircle as k } from "lucide-react";
22
+ import { useParams as Ee } from "react-router-dom";
23
+ import { Fragment as De, jsx as A, jsxs as j } from "react/jsx-runtime";
24
+ import { Button as M, DropdownMenu as Oe, DropdownMenuContent as ke, DropdownMenuItem as Ae, DropdownMenuTrigger as je, Input as N, Label as P, ResponsiveDialog as F, ResponsiveDialogContent as I, ResponsiveDialogDescription as L, ResponsiveDialogFooter as R, ResponsiveDialogHeader as z, ResponsiveDialogTitle as B, Select as Me, SelectContent as Ne, SelectItem as Pe, SelectTrigger as Fe, SelectValue as Ie, Textarea as Le } from "@burdenoff/fe-libs/ui";
24
25
  //#region src/govcitizenhub/pages/applications/ApplicationDetailPage.tsx
25
- var Le = [
26
+ var Re = [
26
27
  "INTERNAL",
27
28
  "CITIZEN_MESSAGE",
28
29
  "INFO_REQUEST",
@@ -55,7 +56,7 @@ function H(e) {
55
56
  return e.name?.trim() || t || e.username?.trim() || e.email;
56
57
  }
57
58
  var U = (e) => e.slice(0, 8);
58
- function Re(e) {
59
+ function ze(e) {
59
60
  switch (e) {
60
61
  case "SUBMITTED": return [
61
62
  {
@@ -129,7 +130,7 @@ function Re(e) {
129
130
  default: return [];
130
131
  }
131
132
  }
132
- function ze(e) {
133
+ function Be(e) {
133
134
  let t = e.status === "APPROVED" ? "Approved" : e.status === "REJECTED" ? "Rejected" : e.status === "WITHDRAWN" ? "Withdrawn" : "Decision";
134
135
  return {
135
136
  steps: [
@@ -164,7 +165,7 @@ function ze(e) {
164
165
  }[e.status]
165
166
  };
166
167
  }
167
- function Be({ assignedToId: e, currentUser: t }) {
168
+ function Ve({ assignedToId: e, currentUser: t }) {
168
169
  return e ? t?.id && e === t.id ? /* @__PURE__ */ A(p, {
169
170
  name: H(t) ?? "You",
170
171
  src: t.avatar,
@@ -178,109 +179,109 @@ function Be({ assignedToId: e, currentUser: t }) {
178
179
  });
179
180
  }
180
181
  function W() {
181
- let { id: p } = Te(), { navigateTo: y, currentUser: S } = e(), { data: C, isLoading: w, isError: T, refetch: D } = l(p), { data: k } = ne(C?.serviceId), N = f({
182
+ let { id: p } = Ee(), { navigateTo: y, currentUser: S, workspaceId: C } = e(), { emitPaymentSettled: w } = oe(), { data: T, isLoading: D, isError: k, refetch: N } = l(p), { data: F } = ne(T?.serviceId), I = f({
182
183
  applicationId: p,
183
184
  pagination: { limit: 50 }
184
- }), F = re(), I = ie(), L = ae(), R = te(), z = c(), B = u(), H = d(), W = ee(), [G, K] = x(null), [q, J] = x(null), [Y, X] = x(""), [Z, He] = x("INTERNAL"), [Ue, We] = x(!1), [Ge, Q] = x(!1), Ke = b(() => C ? Re(C.status) : [], [C]), qe = b(() => C ? ze(C) : {
185
+ }), L = re(), R = ie(), z = ae(), B = te(), H = c(), W = u(), G = d(), Ue = ee(), [K, q] = x(null), [J, Y] = x(null), [X, We] = x(""), [Ge, Ke] = x("INTERNAL"), [qe, Je] = x(!1), [Ye, Xe] = x(!1), Z = b(() => T ? ze(T.status) : [], [T]), Ze = b(() => T ? Be(T) : {
185
186
  steps: [],
186
187
  current: 0
187
- }, [C]), Je = b(() => {
188
- let e = C?.formData;
188
+ }, [T]), Qe = b(() => {
189
+ let e = T?.formData;
189
190
  return !e || typeof e != "object" || Array.isArray(e) ? [] : Object.entries(e).filter(([, e]) => e != null && String(e).trim() !== "");
190
- }, [C?.formData]), $ = b(() => C ? [...C.notes].sort((e, t) => new Date(e.createdAt).getTime() - new Date(t.createdAt).getTime()) : [], [C]);
191
- if (w) return /* @__PURE__ */ A(t, {
191
+ }, [T?.formData]), Q = b(() => T ? [...T.notes].sort((e, t) => new Date(e.createdAt).getTime() - new Date(t.createdAt).getTime()) : [], [T]);
192
+ if (D) return /* @__PURE__ */ A(t, {
192
193
  title: "Application",
193
194
  back: {
194
195
  label: "Applications",
195
196
  onClick: () => y("applications")
196
197
  },
197
- children: /* @__PURE__ */ A(se, { label: "Loading application…" })
198
+ children: /* @__PURE__ */ A(ce, { label: "Loading application…" })
198
199
  });
199
- if (T || !C) return /* @__PURE__ */ A(t, {
200
+ if (k || !T) return /* @__PURE__ */ A(t, {
200
201
  title: "Application",
201
202
  back: {
202
203
  label: "Applications",
203
204
  onClick: () => y("applications")
204
205
  },
205
- children: /* @__PURE__ */ A(oe, {
206
+ children: /* @__PURE__ */ A(se, {
206
207
  message: "We couldn't load this application.",
207
- onRetry: () => D()
208
+ onRetry: () => N()
208
209
  })
209
210
  });
210
- let Ye = async () => {
211
+ let $e = async () => {
211
212
  try {
212
- await F.mutateAsync(C.id), g.success("Application submitted", C.reference);
213
+ await L.mutateAsync(T.id), g.success("Application submitted", T.reference);
213
214
  } catch (e) {
214
215
  g.error("Could not submit", h(e));
215
216
  }
216
- }, Xe = async (e, t) => {
217
+ }, et = async (e, t) => {
217
218
  try {
218
- await I.mutateAsync({
219
- id: C.id,
219
+ await R.mutateAsync({
220
+ id: T.id,
220
221
  status: e.status,
221
222
  reason: t.trim() || null
222
223
  }), g.success("Application updated", `Status is now ${a(e.status)}.`);
223
224
  } catch (e) {
224
225
  g.error("Could not update the application", h(e));
225
226
  }
226
- }, Ze = async () => {
227
+ }, tt = async () => {
227
228
  if (S?.id) try {
228
- await L.mutateAsync({
229
- id: C.id,
229
+ await z.mutateAsync({
230
+ id: T.id,
230
231
  input: { assignedToId: S.id }
231
232
  }), g.success("Assigned to you");
232
233
  } catch (e) {
233
234
  g.error("Could not assign", h(e));
234
235
  }
235
- }, Qe = async (e) => {
236
+ }, nt = async (e) => {
236
237
  try {
237
- await R.mutateAsync({
238
+ await B.mutateAsync({
238
239
  id: e.id,
239
240
  status: "ACCEPTED",
240
- applicationId: C.id
241
+ applicationId: T.id
241
242
  }), g.success("Document accepted", e.name);
242
243
  } catch (e) {
243
244
  g.error("Could not accept document", h(e));
244
245
  }
245
- }, $e = async () => {
246
- if (Y.trim()) try {
247
- await z.mutateAsync({
248
- applicationId: C.id,
249
- body: Y.trim(),
250
- type: Z
251
- }), X(""), g.success("Note added");
246
+ }, rt = async () => {
247
+ if (X.trim()) try {
248
+ await H.mutateAsync({
249
+ applicationId: T.id,
250
+ body: X.trim(),
251
+ type: Ge
252
+ }), We(""), g.success("Note added");
252
253
  } catch (e) {
253
254
  g.error("Could not add note", h(e));
254
255
  }
255
- }, et = F.isPending || I.isPending || L.isPending, tt = !!(C.assignedToId && C.assignedToId === S?.id), nt = (e) => {
256
- e.reason === "none" ? Xe(e, "") : K(e);
257
- }, rt = [
256
+ }, $ = L.isPending || R.isPending || z.isPending, it = !!(T.assignedToId && T.assignedToId === S?.id), at = (e) => {
257
+ e.reason === "none" ? et(e, "") : q(e);
258
+ }, ot = [
258
259
  {
259
260
  label: "Filed",
260
- value: i(C.createdAt)
261
+ value: i(T.createdAt)
261
262
  },
262
263
  {
263
264
  label: "Submitted",
264
- value: C.submittedAt ? i(C.submittedAt) : "Not submitted"
265
+ value: T.submittedAt ? i(T.submittedAt) : "Not submitted"
265
266
  },
266
267
  {
267
268
  label: "Due date",
268
- value: C.dueDate ? /* @__PURE__ */ j("span", {
269
+ value: T.dueDate ? /* @__PURE__ */ j("span", {
269
270
  className: "flex flex-col items-end gap-1",
270
- children: [/* @__PURE__ */ A("span", { children: r(C.dueDate) }), /* @__PURE__ */ A(ce, {
271
- dueDate: C.dueDate,
272
- status: C.status
271
+ children: [/* @__PURE__ */ A("span", { children: r(T.dueDate) }), /* @__PURE__ */ A(le, {
272
+ dueDate: T.dueDate,
273
+ status: T.status
273
274
  })]
274
275
  }) : "—"
275
276
  },
276
277
  {
277
278
  label: "Decided",
278
- value: C.decidedAt ? i(C.decidedAt) : "—"
279
+ value: T.decidedAt ? i(T.decidedAt) : "—"
279
280
  },
280
281
  {
281
282
  label: "Assigned to",
282
- value: /* @__PURE__ */ A(Be, {
283
- assignedToId: C.assignedToId,
283
+ value: /* @__PURE__ */ A(Ve, {
284
+ assignedToId: T.assignedToId,
284
285
  currentUser: S
285
286
  })
286
287
  }
@@ -291,18 +292,18 @@ function W() {
291
292
  children: [
292
293
  /* @__PURE__ */ A("span", {
293
294
  className: "text-text-primary",
294
- children: C.reference
295
+ children: T.reference
295
296
  }),
296
- k && /* @__PURE__ */ j("span", {
297
+ F && /* @__PURE__ */ j("span", {
297
298
  className: "text-lg font-normal text-text-secondary",
298
- children: ["· ", k.name]
299
+ children: ["· ", F.name]
299
300
  }),
300
301
  /* @__PURE__ */ A(s, {
301
- status: C.status,
302
+ status: T.status,
302
303
  size: "md"
303
304
  }),
304
305
  /* @__PURE__ */ A(s, {
305
- status: C.priority,
306
+ status: T.priority,
306
307
  size: "md"
307
308
  })
308
309
  ]
@@ -314,30 +315,30 @@ function W() {
314
315
  actions: /* @__PURE__ */ j("div", {
315
316
  className: "flex flex-wrap items-center gap-2",
316
317
  children: [
317
- !tt && S?.id && /* @__PURE__ */ j(M, {
318
+ !it && S?.id && /* @__PURE__ */ j(M, {
318
319
  variant: "outline",
319
- onClick: Ze,
320
- disabled: L.isPending,
321
- children: [/* @__PURE__ */ A(Ce, { className: "mr-1.5 h-4 w-4" }), " Assign to me"]
320
+ onClick: tt,
321
+ disabled: z.isPending,
322
+ children: [/* @__PURE__ */ A(we, { className: "mr-1.5 h-4 w-4" }), " Assign to me"]
322
323
  }),
323
- C.status === "DRAFT" && /* @__PURE__ */ j(M, {
324
- onClick: Ye,
325
- disabled: et,
326
- children: [/* @__PURE__ */ A(Se, { className: "mr-1.5 h-4 w-4" }), " Submit"]
324
+ T.status === "DRAFT" && /* @__PURE__ */ j(M, {
325
+ onClick: $e,
326
+ disabled: $,
327
+ children: [/* @__PURE__ */ A(Ce, { className: "mr-1.5 h-4 w-4" }), " Submit"]
327
328
  }),
328
- Ke.length > 0 && /* @__PURE__ */ j(De, { children: [/* @__PURE__ */ j(Ae, {
329
- disabled: et,
329
+ Z.length > 0 && /* @__PURE__ */ j(Oe, { children: [/* @__PURE__ */ j(je, {
330
+ disabled: $,
330
331
  className: "inline-flex items-center gap-1.5 rounded-button bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-opacity hover:opacity-90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus disabled:opacity-50",
331
332
  "aria-label": "Advance status",
332
- children: ["Advance status ", /* @__PURE__ */ A(ge, { className: "size-4" })]
333
- }), /* @__PURE__ */ A(Oe, {
333
+ children: ["Advance status ", /* @__PURE__ */ A(_e, { className: "size-4" })]
334
+ }), /* @__PURE__ */ A(ke, {
334
335
  align: "end",
335
336
  className: "min-w-48",
336
- children: Ke.map((e) => {
337
+ children: Z.map((e) => {
337
338
  let t = e.icon;
338
- return /* @__PURE__ */ j(ke, {
339
+ return /* @__PURE__ */ j(Ae, {
339
340
  className: `gap-2 ${e.destructive ? "text-status-error-text focus:text-status-error-text" : ""}`,
340
- onSelect: () => nt(e),
341
+ onSelect: () => at(e),
341
342
  children: [
342
343
  /* @__PURE__ */ A(t, { className: "size-4" }),
343
344
  " ",
@@ -351,11 +352,11 @@ function W() {
351
352
  children: [
352
353
  /* @__PURE__ */ A(_, {
353
354
  title: "Progress",
354
- icon: /* @__PURE__ */ A(xe, {}),
355
+ icon: /* @__PURE__ */ A(Se, {}),
355
356
  className: "mb-4 border-border-seam",
356
- children: /* @__PURE__ */ A(le, {
357
- steps: qe.steps,
358
- current: qe.current
357
+ children: /* @__PURE__ */ A(ue, {
358
+ steps: Ze.steps,
359
+ current: Ze.current
359
360
  })
360
361
  }),
361
362
  /* @__PURE__ */ j("div", {
@@ -363,24 +364,24 @@ function W() {
363
364
  children: [/* @__PURE__ */ j("div", {
364
365
  className: "space-y-4 lg:col-span-2",
365
366
  children: [
366
- C.decisionReason && /* @__PURE__ */ j("div", {
367
+ T.decisionReason && /* @__PURE__ */ j("div", {
367
368
  className: "rounded-card border border-border-seam bg-bg-sunken px-4 py-3 text-sm text-text-secondary",
368
369
  children: [/* @__PURE__ */ A("span", {
369
370
  className: "font-medium text-text-primary",
370
371
  children: "Decision note: "
371
- }), C.decisionReason]
372
+ }), T.decisionReason]
372
373
  }),
373
374
  /* @__PURE__ */ A(_, {
374
375
  title: "Submitted information",
375
- icon: /* @__PURE__ */ A(_e, {}),
376
+ icon: /* @__PURE__ */ A(ve, {}),
376
377
  className: "border-border-seam",
377
- children: Je.length === 0 ? /* @__PURE__ */ A("p", {
378
+ children: Qe.length === 0 ? /* @__PURE__ */ A("p", {
378
379
  className: "text-sm text-text-secondary",
379
380
  children: "No form data was captured with this application."
380
381
  }) : /* @__PURE__ */ A(v, {
381
382
  columns: 2,
382
383
  variant: "stacked",
383
- items: Je.map(([e, t]) => ({
384
+ items: Qe.map(([e, t]) => ({
384
385
  label: a(e),
385
386
  value: String(t)
386
387
  }))
@@ -388,24 +389,24 @@ function W() {
388
389
  }),
389
390
  /* @__PURE__ */ j(_, {
390
391
  title: "Documents",
391
- icon: /* @__PURE__ */ A(be, {}),
392
+ icon: /* @__PURE__ */ A(xe, {}),
392
393
  className: "border-border-seam",
393
394
  actions: /* @__PURE__ */ j("span", {
394
395
  className: "text-xs text-text-muted tabular-nums",
395
- children: [C.documents.length, " attached"]
396
+ children: [T.documents.length, " attached"]
396
397
  }),
397
398
  children: [/* @__PURE__ */ A("div", {
398
399
  className: "space-y-2.5",
399
- children: C.documents.length === 0 ? /* @__PURE__ */ A("p", {
400
+ children: T.documents.length === 0 ? /* @__PURE__ */ A("p", {
400
401
  className: "text-sm text-text-secondary",
401
402
  children: "No documents attached yet."
402
- }) : C.documents.map((e) => /* @__PURE__ */ j("div", {
403
+ }) : T.documents.map((e) => /* @__PURE__ */ j("div", {
403
404
  className: "flex flex-wrap items-center justify-between gap-3 rounded-lg border border-border-seam bg-bg-surface px-3 py-2.5",
404
405
  children: [/* @__PURE__ */ j("div", {
405
406
  className: "flex min-w-0 items-center gap-3",
406
407
  children: [/* @__PURE__ */ A("span", {
407
408
  className: "inline-flex size-9 shrink-0 items-center justify-center rounded-lg bg-bg-sunken text-text-secondary",
408
- children: /* @__PURE__ */ A(be, { className: "size-4" })
409
+ children: /* @__PURE__ */ A(xe, { className: "size-4" })
409
410
  }), /* @__PURE__ */ j("div", {
410
411
  className: "min-w-0",
411
412
  children: [
@@ -429,31 +430,31 @@ function W() {
429
430
  })]
430
431
  }), /* @__PURE__ */ j("div", {
431
432
  className: "flex items-center gap-2",
432
- children: [/* @__PURE__ */ A(s, { status: e.status }), e.status === "PENDING" && /* @__PURE__ */ j(Ee, { children: [/* @__PURE__ */ A(M, {
433
+ children: [/* @__PURE__ */ A(s, { status: e.status }), e.status === "PENDING" && /* @__PURE__ */ j(De, { children: [/* @__PURE__ */ A(M, {
433
434
  size: "sm",
434
435
  variant: "outline",
435
- onClick: () => Qe(e),
436
- disabled: R.isPending,
436
+ onClick: () => nt(e),
437
+ disabled: B.isPending,
437
438
  "aria-label": `Accept ${e.name}`,
438
- children: /* @__PURE__ */ A(he, { className: "h-4 w-4" })
439
+ children: /* @__PURE__ */ A(ge, { className: "h-4 w-4" })
439
440
  }), /* @__PURE__ */ A(M, {
440
441
  size: "sm",
441
442
  variant: "outline",
442
- onClick: () => J(e),
443
- disabled: R.isPending,
443
+ onClick: () => Y(e),
444
+ disabled: B.isPending,
444
445
  "aria-label": `Reject ${e.name}`,
445
- children: /* @__PURE__ */ A(we, { className: "h-4 w-4" })
446
+ children: /* @__PURE__ */ A(Te, { className: "h-4 w-4" })
446
447
  })] })]
447
448
  })]
448
449
  }, e.id))
449
450
  }), /* @__PURE__ */ j("div", {
450
451
  className: "mt-4 border-t border-border-seam pt-4",
451
- children: [/* @__PURE__ */ A(fe, {
452
- applicationId: C.id,
453
- onAdded: () => D()
454
- }), k && k.requiredDocuments.length > 0 && /* @__PURE__ */ j("p", {
452
+ children: [/* @__PURE__ */ A(pe, {
453
+ applicationId: T.id,
454
+ onAdded: () => N()
455
+ }), F && F.requiredDocuments.length > 0 && /* @__PURE__ */ j("p", {
455
456
  className: "mt-2 text-xs text-text-muted",
456
- children: ["Required: ", k.requiredDocuments.join(", ")]
457
+ children: ["Required: ", F.requiredDocuments.join(", ")]
457
458
  })]
458
459
  })]
459
460
  }),
@@ -464,23 +465,23 @@ function W() {
464
465
  actions: /* @__PURE__ */ j("span", {
465
466
  className: "text-xs text-text-muted tabular-nums",
466
467
  children: [
467
- C.notes.length,
468
+ T.notes.length,
468
469
  " ",
469
- C.notes.length === 1 ? "note" : "notes"
470
+ T.notes.length === 1 ? "note" : "notes"
470
471
  ]
471
472
  }),
472
- children: [$.length === 0 ? /* @__PURE__ */ A("p", {
473
+ children: [Q.length === 0 ? /* @__PURE__ */ A("p", {
473
474
  className: "text-sm text-text-secondary",
474
475
  children: "No case notes yet."
475
- }) : /* @__PURE__ */ A(ue, { children: $.map((e, t) => {
476
+ }) : /* @__PURE__ */ A(de, { children: Q.map((e, t) => {
476
477
  let n = V[e.type], r = n.icon, a = S?.id && e.authorId === S.id ? "You" : `#${U(e.authorId)}`;
477
- return /* @__PURE__ */ A(de, {
478
+ return /* @__PURE__ */ A(fe, {
478
479
  tone: n.tone,
479
480
  icon: /* @__PURE__ */ A(r, {}),
480
481
  title: n.label,
481
482
  author: a,
482
483
  timestamp: i(e.createdAt),
483
- last: t === $.length - 1,
484
+ last: t === Q.length - 1,
484
485
  children: /* @__PURE__ */ A("p", {
485
486
  className: "whitespace-pre-wrap text-text-primary",
486
487
  children: e.body
@@ -488,9 +489,9 @@ function W() {
488
489
  }, e.id);
489
490
  }) }), /* @__PURE__ */ j("div", {
490
491
  className: "mt-4 space-y-2 border-t border-border-seam pt-4",
491
- children: [/* @__PURE__ */ A(Ie, {
492
- value: Y,
493
- onChange: (e) => X(e.target.value),
492
+ children: [/* @__PURE__ */ A(Le, {
493
+ value: X,
494
+ onChange: (e) => We(e.target.value),
494
495
  placeholder: "Add a case note…",
495
496
  rows: 2,
496
497
  "aria-label": "New case note"
@@ -502,22 +503,22 @@ function W() {
502
503
  htmlFor: "note-type",
503
504
  className: "text-xs text-text-muted",
504
505
  children: "Note type"
505
- }), /* @__PURE__ */ j(je, {
506
- value: Z,
507
- onValueChange: (e) => He(e),
508
- children: [/* @__PURE__ */ A(Pe, {
506
+ }), /* @__PURE__ */ j(Me, {
507
+ value: Ge,
508
+ onValueChange: (e) => Ke(e),
509
+ children: [/* @__PURE__ */ A(Fe, {
509
510
  id: "note-type",
510
511
  className: "w-44",
511
512
  "aria-label": "Note type",
512
- children: /* @__PURE__ */ A(Fe, {})
513
- }), /* @__PURE__ */ A(Me, { children: Le.map((e) => /* @__PURE__ */ A(Ne, {
513
+ children: /* @__PURE__ */ A(Ie, {})
514
+ }), /* @__PURE__ */ A(Ne, { children: Re.map((e) => /* @__PURE__ */ A(Pe, {
514
515
  value: e,
515
516
  children: V[e].label
516
517
  }, e)) })]
517
518
  })]
518
519
  }), /* @__PURE__ */ j(M, {
519
- onClick: $e,
520
- disabled: !Y.trim() || z.isPending,
520
+ onClick: rt,
521
+ disabled: !X.trim() || H.isPending,
521
522
  children: [/* @__PURE__ */ A(O, { className: "mr-1.5 h-4 w-4" }), " Add note"]
522
523
  })]
523
524
  })]
@@ -529,24 +530,24 @@ function W() {
529
530
  children: [
530
531
  /* @__PURE__ */ A(_, {
531
532
  title: "Case details",
532
- icon: /* @__PURE__ */ A(ye, {}),
533
+ icon: /* @__PURE__ */ A(be, {}),
533
534
  className: "border-border-seam",
534
- children: /* @__PURE__ */ A(v, { items: rt })
535
+ children: /* @__PURE__ */ A(v, { items: ot })
535
536
  }),
536
537
  /* @__PURE__ */ A(_, {
537
538
  title: "Payments",
538
- icon: /* @__PURE__ */ A(ve, {}),
539
+ icon: /* @__PURE__ */ A(ye, {}),
539
540
  className: "border-border-seam",
540
541
  actions: /* @__PURE__ */ A(M, {
541
542
  size: "sm",
542
543
  variant: "outline",
543
- onClick: () => We(!0),
544
+ onClick: () => Je(!0),
544
545
  "aria-label": "Record payment",
545
546
  children: /* @__PURE__ */ A(O, { className: "h-4 w-4" })
546
547
  }),
547
548
  children: /* @__PURE__ */ A("div", {
548
549
  className: "space-y-2",
549
- children: N.data?.items.length ? N.data.items.map((e) => /* @__PURE__ */ j("div", {
550
+ children: I.data?.items.length ? I.data.items.map((e) => /* @__PURE__ */ j("div", {
550
551
  className: "rounded-lg border border-border-seam bg-bg-surface px-3 py-2.5",
551
552
  children: [
552
553
  /* @__PURE__ */ j("div", {
@@ -565,14 +566,19 @@ function W() {
565
566
  children: [e.status === "PENDING" && /* @__PURE__ */ A(M, {
566
567
  size: "sm",
567
568
  variant: "outline",
568
- onClick: () => H.mutateAsync({ id: e.id }).then(() => g.success("Marked as paid")).catch((e) => g.error("Could not update", h(e))),
569
- disabled: H.isPending,
569
+ onClick: () => G.mutateAsync({ id: e.id }).then(() => {
570
+ g.success("Marked as paid"), w({
571
+ workspaceId: C,
572
+ id: e.id
573
+ });
574
+ }).catch((e) => g.error("Could not update", h(e))),
575
+ disabled: G.isPending,
570
576
  children: "Mark paid"
571
577
  }), e.status === "PAID" && /* @__PURE__ */ A(M, {
572
578
  size: "sm",
573
579
  variant: "outline",
574
- onClick: () => W.mutateAsync(e.id).then(() => g.success("Refunded")).catch((e) => g.error("Could not refund", h(e))),
575
- disabled: W.isPending,
580
+ onClick: () => Ue.mutateAsync(e.id).then(() => g.success("Refunded")).catch((e) => g.error("Could not refund", h(e))),
581
+ disabled: Ue.isPending,
576
582
  children: "Refund"
577
583
  })]
578
584
  })
@@ -585,18 +591,18 @@ function W() {
585
591
  }),
586
592
  /* @__PURE__ */ A(_, {
587
593
  title: "Permits",
588
- icon: /* @__PURE__ */ A(me, {}),
594
+ icon: /* @__PURE__ */ A(he, {}),
589
595
  className: "border-border-seam",
590
596
  actions: /* @__PURE__ */ A(M, {
591
597
  size: "sm",
592
598
  variant: "outline",
593
- onClick: () => Q(!0),
599
+ onClick: () => Xe(!0),
594
600
  "aria-label": "Issue permit",
595
601
  children: /* @__PURE__ */ A(O, { className: "h-4 w-4" })
596
602
  }),
597
603
  children: /* @__PURE__ */ A("div", {
598
604
  className: "space-y-2",
599
- children: C.permits.length ? C.permits.map((e) => /* @__PURE__ */ j("div", {
605
+ children: T.permits.length ? T.permits.map((e) => /* @__PURE__ */ j("div", {
600
606
  className: "rounded-lg border border-border-seam bg-bg-surface px-3 py-2.5",
601
607
  children: [/* @__PURE__ */ j("div", {
602
608
  className: "flex items-center justify-between gap-2",
@@ -617,26 +623,26 @@ function W() {
617
623
  ]
618
624
  })]
619
625
  }),
620
- G && /* @__PURE__ */ A(m, {
621
- open: !!G,
622
- onOpenChange: (e) => e ? void 0 : K(null),
623
- title: `${G.label}?`,
624
- description: `This will move the application to ${a(G.status)}.`,
625
- confirmLabel: G.label,
626
- destructive: G.destructive,
626
+ K && /* @__PURE__ */ A(m, {
627
+ open: !!K,
628
+ onOpenChange: (e) => e ? void 0 : q(null),
629
+ title: `${K.label}?`,
630
+ description: `This will move the application to ${a(K.status)}.`,
631
+ confirmLabel: K.label,
632
+ destructive: K.destructive,
627
633
  reason: {
628
- label: G.status === "REJECTED" ? "Reason for rejection" : "Reason / note",
634
+ label: K.status === "REJECTED" ? "Reason for rejection" : "Reason / note",
629
635
  placeholder: "Explain the decision…",
630
- required: G.reason === "required"
636
+ required: K.reason === "required"
631
637
  },
632
638
  onConfirm: async (e) => {
633
- await Xe(G, e), K(null);
639
+ await et(K, e), q(null);
634
640
  }
635
641
  }),
636
- q && /* @__PURE__ */ A(m, {
637
- open: !!q,
638
- onOpenChange: (e) => e ? void 0 : J(null),
639
- title: `Reject ${q.name}?`,
642
+ J && /* @__PURE__ */ A(m, {
643
+ open: !!J,
644
+ onOpenChange: (e) => e ? void 0 : Y(null),
645
+ title: `Reject ${J.name}?`,
640
646
  confirmLabel: "Reject document",
641
647
  destructive: !0,
642
648
  reason: {
@@ -645,40 +651,40 @@ function W() {
645
651
  required: !0
646
652
  },
647
653
  onConfirm: async (e) => {
648
- await R.mutateAsync({
649
- id: q.id,
654
+ await B.mutateAsync({
655
+ id: J.id,
650
656
  status: "REJECTED",
651
657
  rejectionReason: e,
652
- applicationId: C.id
653
- }), g.success("Document rejected"), J(null);
658
+ applicationId: T.id
659
+ }), g.success("Document rejected"), Y(null);
654
660
  }
655
661
  }),
656
- /* @__PURE__ */ A(Ve, {
657
- open: Ue,
658
- onOpenChange: We,
659
- defaultAmount: k?.feeAmount ?? 0,
660
- defaultCurrency: k?.currency ?? "INR",
662
+ /* @__PURE__ */ A(He, {
663
+ open: qe,
664
+ onOpenChange: Je,
665
+ defaultAmount: F?.feeAmount ?? 0,
666
+ defaultCurrency: F?.currency ?? "INR",
661
667
  onSubmit: async ({ amount: e, currency: t, providerRef: n }) => {
662
- await B.mutateAsync({
663
- applicationId: C.id,
668
+ await W.mutateAsync({
669
+ applicationId: T.id,
664
670
  amount: e,
665
671
  currency: t,
666
672
  providerRef: n || null
667
- }), g.success("Payment recorded"), N.refetch();
673
+ }), g.success("Payment recorded"), I.refetch();
668
674
  }
669
675
  }),
670
- /* @__PURE__ */ A(pe, {
671
- open: Ge,
672
- onOpenChange: Q,
673
- defaultServiceId: C.serviceId,
674
- defaultHolderId: C.citizenId,
675
- applicationId: C.id,
676
- onIssued: () => D()
676
+ /* @__PURE__ */ A(me, {
677
+ open: Ye,
678
+ onOpenChange: Xe,
679
+ defaultServiceId: T.serviceId,
680
+ defaultHolderId: T.citizenId,
681
+ applicationId: T.id,
682
+ onIssued: () => N()
677
683
  })
678
684
  ]
679
685
  });
680
686
  }
681
- function Ve({ open: e, onOpenChange: t, defaultAmount: n, defaultCurrency: r, onSubmit: i }) {
687
+ function He({ open: e, onOpenChange: t, defaultAmount: n, defaultCurrency: r, onSubmit: i }) {
682
688
  let [a, o] = x(""), [s, c] = x(r), [l, u] = x(""), [d, f] = x(!1);
683
689
  return y(() => {
684
690
  e && (o(n ? String(n) : ""), c(r || "INR"), u(""));