@burdenoff/microfe-govcitizenhub 2026.704.2 → 2026.705.2

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 (69) hide show
  1. package/dist/govcitizenhub/components/Avatar.js +55 -0
  2. package/dist/govcitizenhub/components/Avatar.js.map +1 -0
  3. package/dist/govcitizenhub/components/DocumentUploadField.js +95 -45
  4. package/dist/govcitizenhub/components/DocumentUploadField.js.map +1 -1
  5. package/dist/govcitizenhub/components/FilterTabs.js +5 -4
  6. package/dist/govcitizenhub/components/FilterTabs.js.map +1 -1
  7. package/dist/govcitizenhub/components/KeyValueList.js +23 -0
  8. package/dist/govcitizenhub/components/KeyValueList.js.map +1 -0
  9. package/dist/govcitizenhub/components/MetricsCard.js +51 -26
  10. package/dist/govcitizenhub/components/MetricsCard.js.map +1 -1
  11. package/dist/govcitizenhub/components/PageLayout.js +81 -51
  12. package/dist/govcitizenhub/components/PageLayout.js.map +1 -1
  13. package/dist/govcitizenhub/components/Pagination.js +41 -19
  14. package/dist/govcitizenhub/components/Pagination.js.map +1 -1
  15. package/dist/govcitizenhub/components/SectionCard.js +31 -0
  16. package/dist/govcitizenhub/components/SectionCard.js.map +1 -0
  17. package/dist/govcitizenhub/components/SlaBadge.js +71 -0
  18. package/dist/govcitizenhub/components/SlaBadge.js.map +1 -0
  19. package/dist/govcitizenhub/components/StateViews.js +1 -16
  20. package/dist/govcitizenhub/components/StateViews.js.map +1 -1
  21. package/dist/govcitizenhub/components/StatusBadge.js +23 -10
  22. package/dist/govcitizenhub/components/StatusBadge.js.map +1 -1
  23. package/dist/govcitizenhub/components/StatusStepper.js +55 -0
  24. package/dist/govcitizenhub/components/StatusStepper.js.map +1 -0
  25. package/dist/govcitizenhub/components/SummaryStrip.js +54 -0
  26. package/dist/govcitizenhub/components/SummaryStrip.js.map +1 -0
  27. package/dist/govcitizenhub/components/TagInput.js +2 -2
  28. package/dist/govcitizenhub/components/TagInput.js.map +1 -1
  29. package/dist/govcitizenhub/components/Timeline.js +61 -0
  30. package/dist/govcitizenhub/components/Timeline.js.map +1 -0
  31. package/dist/govcitizenhub/hooks/useFiles.js +50 -22
  32. package/dist/govcitizenhub/hooks/useFiles.js.map +1 -1
  33. package/dist/govcitizenhub/hooks/useGovApi.js +52 -35
  34. package/dist/govcitizenhub/hooks/useGovApi.js.map +1 -1
  35. package/dist/govcitizenhub/pages/DashboardPage.js +166 -111
  36. package/dist/govcitizenhub/pages/DashboardPage.js.map +1 -1
  37. package/dist/govcitizenhub/pages/agencies/AgenciesPage.js +258 -137
  38. package/dist/govcitizenhub/pages/agencies/AgenciesPage.js.map +1 -1
  39. package/dist/govcitizenhub/pages/agencies/AgencyFormDialog.js +103 -90
  40. package/dist/govcitizenhub/pages/agencies/AgencyFormDialog.js.map +1 -1
  41. package/dist/govcitizenhub/pages/applications/ApplicationDetailPage.js +493 -395
  42. package/dist/govcitizenhub/pages/applications/ApplicationDetailPage.js.map +1 -1
  43. package/dist/govcitizenhub/pages/applications/ApplicationsPage.js +266 -80
  44. package/dist/govcitizenhub/pages/applications/ApplicationsPage.js.map +1 -1
  45. package/dist/govcitizenhub/pages/applications/NewApplicationPage.js +412 -174
  46. package/dist/govcitizenhub/pages/applications/NewApplicationPage.js.map +1 -1
  47. package/dist/govcitizenhub/pages/documents/DocumentsPage.js +313 -115
  48. package/dist/govcitizenhub/pages/documents/DocumentsPage.js.map +1 -1
  49. package/dist/govcitizenhub/pages/grievances/GrievanceDetailPage.js +379 -176
  50. package/dist/govcitizenhub/pages/grievances/GrievanceDetailPage.js.map +1 -1
  51. package/dist/govcitizenhub/pages/grievances/GrievancesPage.js +275 -184
  52. package/dist/govcitizenhub/pages/grievances/GrievancesPage.js.map +1 -1
  53. package/dist/govcitizenhub/pages/payments/PaymentsPage.js +251 -133
  54. package/dist/govcitizenhub/pages/payments/PaymentsPage.js.map +1 -1
  55. package/dist/govcitizenhub/pages/permits/IssuePermitDialog.js +175 -105
  56. package/dist/govcitizenhub/pages/permits/IssuePermitDialog.js.map +1 -1
  57. package/dist/govcitizenhub/pages/permits/PermitsPage.js +209 -100
  58. package/dist/govcitizenhub/pages/permits/PermitsPage.js.map +1 -1
  59. package/dist/govcitizenhub/pages/permits/VerifyPermitPage.js +290 -113
  60. package/dist/govcitizenhub/pages/permits/VerifyPermitPage.js.map +1 -1
  61. package/dist/govcitizenhub/pages/services/FormFieldBuilder.js +301 -0
  62. package/dist/govcitizenhub/pages/services/FormFieldBuilder.js.map +1 -0
  63. package/dist/govcitizenhub/pages/services/ServiceDetailPage.js +248 -163
  64. package/dist/govcitizenhub/pages/services/ServiceDetailPage.js.map +1 -1
  65. package/dist/govcitizenhub/pages/services/ServiceFormDialog.js +183 -149
  66. package/dist/govcitizenhub/pages/services/ServiceFormDialog.js.map +1 -1
  67. package/dist/govcitizenhub/pages/services/ServicesPage.js +228 -137
  68. package/dist/govcitizenhub/pages/services/ServicesPage.js.map +1 -1
  69. package/package.json +1 -1
@@ -5,540 +5,638 @@ import { StatusBadge as s } from "../../components/StatusBadge.js";
5
5
  import "../../context/index.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
7
  import "../../hooks/index.js";
8
- import { ErrorView as oe, LoadingView as se, Section as ce } from "../../components/StateViews.js";
9
- import { ConfirmDialog as p } from "../../components/ConfirmDialog.js";
10
- import { describeError as m, notify as h } from "../../lib/toast.js";
11
- import { DocumentUploadField as le } from "../../components/DocumentUploadField.js";
12
- import { IssuePermitDialog as ue } from "../permits/IssuePermitDialog.js";
13
- import { useEffect as g, useMemo as _, useState as v } from "react";
14
- import { BadgeCheck as de, Check as fe, CheckCircle2 as y, CreditCard as b, FileText as pe, HelpCircle as x, MessageSquare as S, PlayCircle as C, Plus as w, Send as me, UserPlus as he, X as ge, XCircle as T } from "lucide-react";
15
- import { useParams as _e } from "react-router-dom";
16
- import { Fragment as ve, jsx as E, jsxs as D } from "react/jsx-runtime";
17
- import { Button as O, GlassCard as k, Input as A, Label as j, ResponsiveDialog as M, ResponsiveDialogContent as N, ResponsiveDialogDescription as P, ResponsiveDialogFooter as F, ResponsiveDialogHeader as I, ResponsiveDialogTitle as L, Select as ye, SelectContent as be, SelectItem as xe, SelectTrigger as Se, SelectValue as Ce, Textarea as we } from "@burdenoff/fe-libs/ui";
8
+ import { ErrorView as oe, LoadingView as se } from "../../components/StateViews.js";
9
+ import { ConfirmDialog as ce } from "../../components/ConfirmDialog.js";
10
+ import { describeError as p, notify as m } from "../../lib/toast.js";
11
+ import { SlaBadge as le } from "../../components/SlaBadge.js";
12
+ import { StatusStepper as ue } from "../../components/StatusStepper.js";
13
+ import { Timeline as de, TimelineItem as fe } from "../../components/Timeline.js";
14
+ import { SectionCard as h } from "../../components/SectionCard.js";
15
+ import { KeyValueList as g } from "../../components/KeyValueList.js";
16
+ import { AssigneeChip as _ } from "../../components/Avatar.js";
17
+ import { DocumentUploadField as pe } from "../../components/DocumentUploadField.js";
18
+ import { IssuePermitDialog as me } from "../permits/IssuePermitDialog.js";
19
+ import { useEffect as v, useMemo as y, useState as b } from "react";
20
+ import { BadgeCheck as he, Check as ge, CheckCircle2 as x, ChevronDown as _e, ClipboardList as ve, CreditCard as ye, Eye as be, FileText as xe, Gavel as S, HelpCircle as C, Lock as w, MessageSquare as T, PlayCircle as E, Plus as D, Route as Se, Send as Ce, UserPlus as we, X as Te, XCircle as O } from "lucide-react";
21
+ import { useParams as Ee } from "react-router-dom";
22
+ import { Fragment as De, jsx as k, jsxs as A } from "react/jsx-runtime";
23
+ import { Button as j, DropdownMenu as Oe, DropdownMenuContent as ke, DropdownMenuItem as Ae, DropdownMenuTrigger as je, Input as M, Label as N, ResponsiveDialog as P, ResponsiveDialogContent as F, ResponsiveDialogDescription as I, ResponsiveDialogFooter as L, ResponsiveDialogHeader as R, ResponsiveDialogTitle as z, Select as Me, SelectContent as Ne, SelectItem as Pe, SelectTrigger as Fe, SelectValue as Ie, Textarea as Le } from "@burdenoff/fe-libs/ui";
18
24
  //#region src/govcitizenhub/pages/applications/ApplicationDetailPage.tsx
19
- var Te = [
25
+ var Re = [
20
26
  "INTERNAL",
21
27
  "CITIZEN_MESSAGE",
22
28
  "INFO_REQUEST",
23
29
  "DECISION"
24
- ];
25
- function Ee(e) {
30
+ ], B = {
31
+ INTERNAL: {
32
+ tone: "default",
33
+ icon: w,
34
+ label: "Internal"
35
+ },
36
+ CITIZEN_MESSAGE: {
37
+ tone: "success",
38
+ icon: T,
39
+ label: "Citizen message"
40
+ },
41
+ INFO_REQUEST: {
42
+ tone: "warning",
43
+ icon: C,
44
+ label: "Info request"
45
+ },
46
+ DECISION: {
47
+ tone: "info",
48
+ icon: S,
49
+ label: "Decision"
50
+ }
51
+ };
52
+ function V(e) {
53
+ if (!e) return;
54
+ let t = [e.firstName, e.lastName].filter(Boolean).join(" ").trim();
55
+ return e.name?.trim() || t || e.username?.trim() || e.email;
56
+ }
57
+ var H = (e) => e.slice(0, 8);
58
+ function ze(e) {
26
59
  switch (e) {
27
60
  case "SUBMITTED": return [
28
61
  {
29
62
  status: "IN_REVIEW",
30
63
  label: "Start review",
31
- icon: C,
64
+ icon: E,
32
65
  reason: "none"
33
66
  },
34
67
  {
35
68
  status: "INFO_REQUESTED",
36
69
  label: "Request info",
37
- icon: x,
38
- reason: "required",
39
- variant: "outline"
70
+ icon: C,
71
+ reason: "required"
40
72
  },
41
73
  {
42
74
  status: "APPROVED",
43
75
  label: "Approve",
44
- icon: y,
76
+ icon: x,
45
77
  reason: "optional"
46
78
  },
47
79
  {
48
80
  status: "REJECTED",
49
81
  label: "Reject",
50
- icon: T,
82
+ icon: O,
51
83
  reason: "required",
52
- variant: "destructive"
84
+ destructive: !0
53
85
  }
54
86
  ];
55
87
  case "IN_REVIEW": return [
56
88
  {
57
89
  status: "INFO_REQUESTED",
58
90
  label: "Request info",
59
- icon: x,
60
- reason: "required",
61
- variant: "outline"
91
+ icon: C,
92
+ reason: "required"
62
93
  },
63
94
  {
64
95
  status: "APPROVED",
65
96
  label: "Approve",
66
- icon: y,
97
+ icon: x,
67
98
  reason: "optional"
68
99
  },
69
100
  {
70
101
  status: "REJECTED",
71
102
  label: "Reject",
72
- icon: T,
103
+ icon: O,
73
104
  reason: "required",
74
- variant: "destructive"
105
+ destructive: !0
75
106
  }
76
107
  ];
77
108
  case "INFO_REQUESTED": return [
78
109
  {
79
110
  status: "IN_REVIEW",
80
111
  label: "Resume review",
81
- icon: C,
112
+ icon: E,
82
113
  reason: "none"
83
114
  },
84
115
  {
85
116
  status: "APPROVED",
86
117
  label: "Approve",
87
- icon: y,
118
+ icon: x,
88
119
  reason: "optional"
89
120
  },
90
121
  {
91
122
  status: "REJECTED",
92
123
  label: "Reject",
93
- icon: T,
124
+ icon: O,
94
125
  reason: "required",
95
- variant: "destructive"
126
+ destructive: !0
96
127
  }
97
128
  ];
98
129
  default: return [];
99
130
  }
100
131
  }
101
- function R() {
102
- let { id: g } = _e(), { navigateTo: y, currentUser: x } = e(), { data: C, isLoading: T, isError: A, refetch: j } = l(g), { data: M } = ne(C?.serviceId), N = f({
103
- applicationId: g,
132
+ function Be(e) {
133
+ let t = e.status === "APPROVED" ? "Approved" : e.status === "REJECTED" ? "Rejected" : e.status === "WITHDRAWN" ? "Withdrawn" : "Decision";
134
+ return {
135
+ steps: [
136
+ {
137
+ key: "submitted",
138
+ label: "Submitted",
139
+ caption: e.submittedAt ? r(e.submittedAt) : e.status === "DRAFT" ? "Not submitted" : void 0
140
+ },
141
+ {
142
+ key: "review",
143
+ label: "In review"
144
+ },
145
+ {
146
+ key: "info",
147
+ label: "Info requested",
148
+ state: e.status === "INFO_REQUESTED" ? "alert" : void 0
149
+ },
150
+ {
151
+ key: "decision",
152
+ label: t,
153
+ caption: e.decidedAt ? r(e.decidedAt) : void 0
154
+ }
155
+ ],
156
+ current: {
157
+ DRAFT: 0,
158
+ SUBMITTED: 1,
159
+ IN_REVIEW: 1,
160
+ INFO_REQUESTED: 2,
161
+ APPROVED: 4,
162
+ REJECTED: 4,
163
+ WITHDRAWN: 4
164
+ }[e.status]
165
+ };
166
+ }
167
+ function Ve({ assignedToId: e, currentUser: t }) {
168
+ return e ? t?.id && e === t.id ? /* @__PURE__ */ k(_, {
169
+ name: V(t) ?? "You",
170
+ src: t.avatar,
171
+ subtitle: "You"
172
+ }) : /* @__PURE__ */ k(_, {
173
+ name: "Assigned officer",
174
+ subtitle: `#${H(e)}`
175
+ }) : /* @__PURE__ */ k("span", {
176
+ className: "text-sm text-text-muted",
177
+ children: "Unassigned"
178
+ });
179
+ }
180
+ function U() {
181
+ let { id: _ } = Ee(), { navigateTo: v, currentUser: x } = e(), { data: S, isLoading: C, isError: w, refetch: E } = l(_), { data: O } = ne(S?.serviceId), M = f({
182
+ applicationId: _,
104
183
  pagination: { limit: 50 }
105
- }), P = re(), F = ie(), I = ae(), L = te(), R = c(), Oe = u(), z = d(), B = ee(), [V, H] = v(null), [U, W] = v(null), [G, K] = v(""), [q, ke] = v("INTERNAL"), [Ae, J] = v(!1), [je, Y] = v(!1), Me = _(() => C ? Ee(C.status) : [], [C]), X = _(() => {
106
- let e = C?.formData;
184
+ }), P = re(), F = ie(), I = ae(), L = te(), R = c(), z = u(), V = d(), U = ee(), [W, G] = b(null), [K, q] = b(null), [J, Y] = b(""), [X, Ue] = b("INTERNAL"), [We, Z] = b(!1), [Ge, Q] = b(!1), Ke = y(() => S ? ze(S.status) : [], [S]), qe = y(() => S ? Be(S) : {
185
+ steps: [],
186
+ current: 0
187
+ }, [S]), Je = y(() => {
188
+ let e = S?.formData;
107
189
  return !e || typeof e != "object" || Array.isArray(e) ? [] : Object.entries(e).filter(([, e]) => e != null && String(e).trim() !== "");
108
- }, [C?.formData]);
109
- if (T) return /* @__PURE__ */ E(t, {
190
+ }, [S?.formData]), $ = y(() => S ? [...S.notes].sort((e, t) => new Date(e.createdAt).getTime() - new Date(t.createdAt).getTime()) : [], [S]);
191
+ if (C) return /* @__PURE__ */ k(t, {
110
192
  title: "Application",
111
193
  back: {
112
194
  label: "Applications",
113
- onClick: () => y("applications")
195
+ onClick: () => v("applications")
114
196
  },
115
- children: /* @__PURE__ */ E(se, { label: "Loading application…" })
197
+ children: /* @__PURE__ */ k(se, { label: "Loading application…" })
116
198
  });
117
- if (A || !C) return /* @__PURE__ */ E(t, {
199
+ if (w || !S) return /* @__PURE__ */ k(t, {
118
200
  title: "Application",
119
201
  back: {
120
202
  label: "Applications",
121
- onClick: () => y("applications")
203
+ onClick: () => v("applications")
122
204
  },
123
- children: /* @__PURE__ */ E(oe, {
205
+ children: /* @__PURE__ */ k(oe, {
124
206
  message: "We couldn't load this application.",
125
- onRetry: () => j()
207
+ onRetry: () => E()
126
208
  })
127
209
  });
128
- let Ne = async () => {
210
+ let Ye = async () => {
129
211
  try {
130
- await P.mutateAsync(C.id), h.success("Application submitted", C.reference);
212
+ await P.mutateAsync(S.id), m.success("Application submitted", S.reference);
131
213
  } catch (e) {
132
- h.error("Could not submit", m(e));
214
+ m.error("Could not submit", p(e));
133
215
  }
134
- }, Z = async (e, t) => {
216
+ }, Xe = async (e, t) => {
135
217
  try {
136
218
  await F.mutateAsync({
137
- id: C.id,
219
+ id: S.id,
138
220
  status: e.status,
139
221
  reason: t.trim() || null
140
- }), h.success("Application updated", `Status is now ${a(e.status)}.`);
222
+ }), m.success("Application updated", `Status is now ${a(e.status)}.`);
141
223
  } catch (e) {
142
- h.error("Could not update the application", m(e));
224
+ m.error("Could not update the application", p(e));
143
225
  }
144
- }, Pe = async () => {
226
+ }, Ze = async () => {
145
227
  if (x?.id) try {
146
228
  await I.mutateAsync({
147
- id: C.id,
229
+ id: S.id,
148
230
  input: { assignedToId: x.id }
149
- }), h.success("Assigned to you");
231
+ }), m.success("Assigned to you");
150
232
  } catch (e) {
151
- h.error("Could not assign", m(e));
233
+ m.error("Could not assign", p(e));
152
234
  }
153
- }, Fe = async (e) => {
235
+ }, Qe = async (e) => {
154
236
  try {
155
237
  await L.mutateAsync({
156
238
  id: e.id,
157
239
  status: "ACCEPTED",
158
- applicationId: C.id
159
- }), h.success("Document accepted", e.name);
240
+ applicationId: S.id
241
+ }), m.success("Document accepted", e.name);
160
242
  } catch (e) {
161
- h.error("Could not accept document", m(e));
243
+ m.error("Could not accept document", p(e));
162
244
  }
163
- }, Ie = async () => {
164
- if (G.trim()) try {
245
+ }, $e = async () => {
246
+ if (J.trim()) try {
165
247
  await R.mutateAsync({
166
- applicationId: C.id,
167
- body: G.trim(),
168
- type: q
169
- }), K(""), h.success("Note added");
248
+ applicationId: S.id,
249
+ body: J.trim(),
250
+ type: X
251
+ }), Y(""), m.success("Note added");
170
252
  } catch (e) {
171
- h.error("Could not add note", m(e));
253
+ m.error("Could not add note", p(e));
172
254
  }
173
- }, Q = P.isPending || F.isPending || I.isPending, $ = C.assignedToId && C.assignedToId === x?.id;
174
- return /* @__PURE__ */ D(t, {
175
- title: C.reference,
255
+ }, et = P.isPending || F.isPending || I.isPending, tt = !!(S.assignedToId && S.assignedToId === x?.id), nt = (e) => {
256
+ e.reason === "none" ? Xe(e, "") : G(e);
257
+ }, rt = [
258
+ {
259
+ label: "Filed",
260
+ value: i(S.createdAt)
261
+ },
262
+ {
263
+ label: "Submitted",
264
+ value: S.submittedAt ? i(S.submittedAt) : "Not submitted"
265
+ },
266
+ {
267
+ label: "Due date",
268
+ value: S.dueDate ? /* @__PURE__ */ A("span", {
269
+ className: "flex flex-col items-end gap-1",
270
+ children: [/* @__PURE__ */ k("span", { children: r(S.dueDate) }), /* @__PURE__ */ k(le, {
271
+ dueDate: S.dueDate,
272
+ status: S.status
273
+ })]
274
+ }) : "—"
275
+ },
276
+ {
277
+ label: "Decided",
278
+ value: S.decidedAt ? i(S.decidedAt) : "—"
279
+ },
280
+ {
281
+ label: "Assigned to",
282
+ value: /* @__PURE__ */ k(Ve, {
283
+ assignedToId: S.assignedToId,
284
+ currentUser: x
285
+ })
286
+ }
287
+ ];
288
+ return /* @__PURE__ */ A(t, {
289
+ title: /* @__PURE__ */ A("span", {
290
+ className: "flex flex-wrap items-center gap-x-3 gap-y-2",
291
+ children: [
292
+ /* @__PURE__ */ k("span", {
293
+ className: "text-text-primary",
294
+ children: S.reference
295
+ }),
296
+ O && /* @__PURE__ */ A("span", {
297
+ className: "text-lg font-normal text-text-secondary",
298
+ children: ["· ", O.name]
299
+ }),
300
+ /* @__PURE__ */ k(s, {
301
+ status: S.status,
302
+ size: "md"
303
+ }),
304
+ /* @__PURE__ */ k(s, {
305
+ status: S.priority,
306
+ size: "md"
307
+ })
308
+ ]
309
+ }),
176
310
  back: {
177
311
  label: "Applications",
178
- onClick: () => y("applications")
312
+ onClick: () => v("applications")
179
313
  },
180
- actions: /* @__PURE__ */ D("div", {
314
+ actions: /* @__PURE__ */ A("div", {
181
315
  className: "flex flex-wrap items-center gap-2",
182
316
  children: [
183
- !$ && x?.id && /* @__PURE__ */ D(O, {
317
+ !tt && x?.id && /* @__PURE__ */ A(j, {
184
318
  variant: "outline",
185
- onClick: Pe,
319
+ onClick: Ze,
186
320
  disabled: I.isPending,
187
- children: [/* @__PURE__ */ E(he, { className: "mr-1.5 h-4 w-4" }), " Assign to me"]
321
+ children: [/* @__PURE__ */ k(we, { className: "mr-1.5 h-4 w-4" }), " Assign to me"]
188
322
  }),
189
- C.status === "DRAFT" && /* @__PURE__ */ D(O, {
190
- onClick: Ne,
191
- disabled: Q,
192
- children: [/* @__PURE__ */ E(me, { className: "mr-1.5 h-4 w-4" }), " Submit"]
323
+ S.status === "DRAFT" && /* @__PURE__ */ A(j, {
324
+ onClick: Ye,
325
+ disabled: et,
326
+ children: [/* @__PURE__ */ k(Ce, { className: "mr-1.5 h-4 w-4" }), " Submit"]
193
327
  }),
194
- Me.map((e) => {
195
- let t = e.icon;
196
- return /* @__PURE__ */ D(O, {
197
- variant: e.variant ?? "default",
198
- disabled: Q,
199
- onClick: () => e.reason === "none" ? Z(e, "") : H(e),
200
- children: [
201
- /* @__PURE__ */ E(t, { className: "mr-1.5 h-4 w-4" }),
202
- " ",
203
- e.label
204
- ]
205
- }, e.status);
206
- })
328
+ Ke.length > 0 && /* @__PURE__ */ A(Oe, { children: [/* @__PURE__ */ A(je, {
329
+ disabled: et,
330
+ 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
+ "aria-label": "Advance status",
332
+ children: ["Advance status ", /* @__PURE__ */ k(_e, { className: "size-4" })]
333
+ }), /* @__PURE__ */ k(ke, {
334
+ align: "end",
335
+ className: "min-w-48",
336
+ children: Ke.map((e) => {
337
+ let t = e.icon;
338
+ return /* @__PURE__ */ A(Ae, {
339
+ className: `gap-2 ${e.destructive ? "text-status-error-text focus:text-status-error-text" : ""}`,
340
+ onSelect: () => nt(e),
341
+ children: [
342
+ /* @__PURE__ */ k(t, { className: "size-4" }),
343
+ " ",
344
+ e.label
345
+ ]
346
+ }, e.status);
347
+ })
348
+ })] })
207
349
  ]
208
350
  }),
209
351
  children: [
210
- /* @__PURE__ */ D("div", {
352
+ /* @__PURE__ */ k(h, {
353
+ title: "Progress",
354
+ icon: /* @__PURE__ */ k(Se, {}),
355
+ className: "mb-4 border-border-seam",
356
+ children: /* @__PURE__ */ k(ue, {
357
+ steps: qe.steps,
358
+ current: qe.current
359
+ })
360
+ }),
361
+ /* @__PURE__ */ A("div", {
211
362
  className: "grid gap-4 lg:grid-cols-3",
212
- children: [/* @__PURE__ */ D("div", {
363
+ children: [/* @__PURE__ */ A("div", {
213
364
  className: "space-y-4 lg:col-span-2",
214
365
  children: [
215
- /* @__PURE__ */ D(k, {
216
- treatment: "plain",
217
- className: "border-border-seam p-5",
218
- children: [
219
- /* @__PURE__ */ D("div", {
220
- className: "flex flex-wrap items-center gap-2",
221
- children: [
222
- /* @__PURE__ */ E(s, { status: C.status }),
223
- /* @__PURE__ */ E(s, { status: C.priority }),
224
- M && /* @__PURE__ */ E("span", {
225
- className: "text-sm text-text-secondary",
226
- children: M.name
227
- })
228
- ]
229
- }),
230
- C.decisionReason && /* @__PURE__ */ D("p", {
231
- className: "mt-3 rounded-lg bg-bg-sunken px-3 py-2 text-sm text-text-secondary",
232
- children: [/* @__PURE__ */ E("span", {
233
- className: "font-medium text-text-primary",
234
- children: "Decision note: "
235
- }), C.decisionReason]
236
- }),
237
- X.length > 0 && /* @__PURE__ */ E(ce, {
238
- title: "Submitted information",
239
- className: "mt-5",
240
- children: /* @__PURE__ */ E("dl", {
241
- className: "grid gap-x-6 gap-y-2 sm:grid-cols-2",
242
- children: X.map(([e, t]) => /* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("dt", {
243
- className: "text-xs text-text-muted",
244
- children: a(e)
245
- }), /* @__PURE__ */ E("dd", {
246
- className: "text-sm text-text-primary",
247
- children: String(t)
248
- })] }, e))
249
- })
250
- })
251
- ]
366
+ S.decisionReason && /* @__PURE__ */ A("div", {
367
+ className: "rounded-card border border-border-seam bg-bg-sunken px-4 py-3 text-sm text-text-secondary",
368
+ children: [/* @__PURE__ */ k("span", {
369
+ className: "font-medium text-text-primary",
370
+ children: "Decision note: "
371
+ }), S.decisionReason]
252
372
  }),
253
- /* @__PURE__ */ D(k, {
254
- treatment: "plain",
255
- className: "border-border-seam p-5",
256
- children: [
257
- /* @__PURE__ */ D("div", {
258
- className: "flex items-center gap-2",
259
- children: [/* @__PURE__ */ E(pe, { className: "h-4 w-4 text-text-muted" }), /* @__PURE__ */ E("h2", {
260
- className: "text-base font-semibold text-text-primary",
261
- children: "Documents"
262
- })]
263
- }),
264
- /* @__PURE__ */ E("div", {
265
- className: "mt-3 space-y-3",
266
- children: C.documents.length === 0 ? /* @__PURE__ */ E("p", {
267
- className: "text-sm text-text-secondary",
268
- children: "No documents attached yet."
269
- }) : C.documents.map((e) => /* @__PURE__ */ D("div", {
270
- className: "flex flex-wrap items-center justify-between gap-3 rounded-lg border border-border-seam px-3 py-2",
271
- children: [/* @__PURE__ */ D("div", {
373
+ /* @__PURE__ */ k(h, {
374
+ title: "Submitted information",
375
+ icon: /* @__PURE__ */ k(ve, {}),
376
+ className: "border-border-seam",
377
+ children: Je.length === 0 ? /* @__PURE__ */ k("p", {
378
+ className: "text-sm text-text-secondary",
379
+ children: "No form data was captured with this application."
380
+ }) : /* @__PURE__ */ k(g, {
381
+ columns: 2,
382
+ variant: "stacked",
383
+ items: Je.map(([e, t]) => ({
384
+ label: a(e),
385
+ value: String(t)
386
+ }))
387
+ })
388
+ }),
389
+ /* @__PURE__ */ A(h, {
390
+ title: "Documents",
391
+ icon: /* @__PURE__ */ k(xe, {}),
392
+ className: "border-border-seam",
393
+ actions: /* @__PURE__ */ A("span", {
394
+ className: "text-xs text-text-muted tabular-nums",
395
+ children: [S.documents.length, " attached"]
396
+ }),
397
+ children: [/* @__PURE__ */ k("div", {
398
+ className: "space-y-2.5",
399
+ children: S.documents.length === 0 ? /* @__PURE__ */ k("p", {
400
+ className: "text-sm text-text-secondary",
401
+ children: "No documents attached yet."
402
+ }) : S.documents.map((e) => /* @__PURE__ */ A("div", {
403
+ 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
+ children: [/* @__PURE__ */ A("div", {
405
+ className: "flex min-w-0 items-center gap-3",
406
+ children: [/* @__PURE__ */ k("span", {
407
+ className: "inline-flex size-9 shrink-0 items-center justify-center rounded-lg bg-bg-sunken text-text-secondary",
408
+ children: /* @__PURE__ */ k(xe, { className: "size-4" })
409
+ }), /* @__PURE__ */ A("div", {
272
410
  className: "min-w-0",
273
411
  children: [
274
- /* @__PURE__ */ E("p", {
412
+ /* @__PURE__ */ k("p", {
275
413
  className: "truncate text-sm font-medium text-text-primary",
276
414
  children: e.name
277
415
  }),
278
- e.requirement && /* @__PURE__ */ D("p", {
416
+ /* @__PURE__ */ A("p", {
279
417
  className: "text-xs text-text-muted",
280
- children: ["for ", e.requirement]
418
+ children: [
419
+ e.requirement ? `${e.requirement} · ` : "",
420
+ "Added ",
421
+ o(e.createdAt)
422
+ ]
281
423
  }),
282
- e.status === "REJECTED" && e.rejectionReason && /* @__PURE__ */ D("p", {
283
- className: "text-xs text-status-error-text",
424
+ e.status === "REJECTED" && e.rejectionReason && /* @__PURE__ */ A("p", {
425
+ className: "mt-0.5 text-xs text-status-error-text",
284
426
  children: ["Rejected: ", e.rejectionReason]
285
427
  })
286
428
  ]
287
- }), /* @__PURE__ */ D("div", {
288
- className: "flex items-center gap-2",
289
- children: [/* @__PURE__ */ E(s, { status: e.status }), e.status === "PENDING" && /* @__PURE__ */ D(ve, { children: [/* @__PURE__ */ E(O, {
290
- size: "sm",
291
- variant: "outline",
292
- onClick: () => Fe(e),
293
- disabled: L.isPending,
294
- "aria-label": `Accept ${e.name}`,
295
- children: /* @__PURE__ */ E(fe, { className: "h-4 w-4" })
296
- }), /* @__PURE__ */ E(O, {
297
- size: "sm",
298
- variant: "outline",
299
- onClick: () => W(e),
300
- "aria-label": `Reject ${e.name}`,
301
- children: /* @__PURE__ */ E(ge, { className: "h-4 w-4" })
302
- })] })]
303
429
  })]
304
- }, e.id))
305
- }),
306
- /* @__PURE__ */ D("div", {
307
- className: "mt-4 border-t border-border-seam pt-4",
308
- children: [/* @__PURE__ */ E(le, {
309
- applicationId: C.id,
310
- onAdded: () => j()
311
- }), M && M.requiredDocuments.length > 0 && /* @__PURE__ */ D("p", {
312
- className: "mt-2 text-xs text-text-muted",
313
- children: ["Required: ", M.requiredDocuments.join(", ")]
430
+ }), /* @__PURE__ */ A("div", {
431
+ className: "flex items-center gap-2",
432
+ children: [/* @__PURE__ */ k(s, { status: e.status }), e.status === "PENDING" && /* @__PURE__ */ A(De, { children: [/* @__PURE__ */ k(j, {
433
+ size: "sm",
434
+ variant: "outline",
435
+ onClick: () => Qe(e),
436
+ disabled: L.isPending,
437
+ "aria-label": `Accept ${e.name}`,
438
+ children: /* @__PURE__ */ k(ge, { className: "h-4 w-4" })
439
+ }), /* @__PURE__ */ k(j, {
440
+ size: "sm",
441
+ variant: "outline",
442
+ onClick: () => q(e),
443
+ disabled: L.isPending,
444
+ "aria-label": `Reject ${e.name}`,
445
+ children: /* @__PURE__ */ k(Te, { className: "h-4 w-4" })
446
+ })] })]
314
447
  })]
315
- })
316
- ]
448
+ }, e.id))
449
+ }), /* @__PURE__ */ A("div", {
450
+ className: "mt-4 border-t border-border-seam pt-4",
451
+ children: [/* @__PURE__ */ k(pe, {
452
+ applicationId: S.id,
453
+ onAdded: () => E()
454
+ }), O && O.requiredDocuments.length > 0 && /* @__PURE__ */ A("p", {
455
+ className: "mt-2 text-xs text-text-muted",
456
+ children: ["Required: ", O.requiredDocuments.join(", ")]
457
+ })]
458
+ })]
317
459
  }),
318
- /* @__PURE__ */ D(k, {
319
- treatment: "plain",
320
- className: "border-border-seam p-5",
321
- children: [
322
- /* @__PURE__ */ D("div", {
323
- className: "flex items-center gap-2",
324
- children: [/* @__PURE__ */ E(S, { className: "h-4 w-4 text-text-muted" }), /* @__PURE__ */ E("h2", {
325
- className: "text-base font-semibold text-text-primary",
326
- children: "Case notes"
327
- })]
328
- }),
329
- /* @__PURE__ */ E("div", {
330
- className: "mt-3 space-y-3",
331
- children: C.notes.length === 0 ? /* @__PURE__ */ E("p", {
332
- className: "text-sm text-text-secondary",
333
- children: "No case notes yet."
334
- }) : [...C.notes].sort((e, t) => new Date(e.createdAt).getTime() - new Date(t.createdAt).getTime()).map((e) => /* @__PURE__ */ D("div", {
335
- className: "rounded-lg border border-border-seam px-3 py-2",
336
- children: [/* @__PURE__ */ D("div", {
337
- className: "flex items-center justify-between gap-2",
338
- children: [/* @__PURE__ */ E(s, { status: e.type }), /* @__PURE__ */ E("span", {
339
- className: "text-xs text-text-muted",
340
- children: o(e.createdAt)
341
- })]
342
- }), /* @__PURE__ */ E("p", {
343
- className: "mt-1.5 whitespace-pre-wrap text-sm text-text-primary",
344
- children: e.body
345
- })]
346
- }, e.id))
347
- }),
348
- /* @__PURE__ */ D("div", {
349
- className: "mt-4 space-y-2 border-t border-border-seam pt-4",
350
- children: [/* @__PURE__ */ E(we, {
351
- value: G,
352
- onChange: (e) => K(e.target.value),
353
- placeholder: "Add a case note…",
354
- rows: 2,
355
- "aria-label": "New case note"
356
- }), /* @__PURE__ */ D("div", {
357
- className: "flex flex-wrap items-center justify-between gap-2",
358
- children: [/* @__PURE__ */ D(ye, {
359
- value: q,
360
- onValueChange: (e) => ke(e),
361
- children: [/* @__PURE__ */ E(Se, {
362
- className: "w-48",
460
+ /* @__PURE__ */ A(h, {
461
+ title: "Case notes",
462
+ icon: /* @__PURE__ */ k(T, {}),
463
+ className: "border-border-seam",
464
+ actions: /* @__PURE__ */ A("span", {
465
+ className: "text-xs text-text-muted tabular-nums",
466
+ children: [
467
+ S.notes.length,
468
+ " ",
469
+ S.notes.length === 1 ? "note" : "notes"
470
+ ]
471
+ }),
472
+ children: [$.length === 0 ? /* @__PURE__ */ k("p", {
473
+ className: "text-sm text-text-secondary",
474
+ children: "No case notes yet."
475
+ }) : /* @__PURE__ */ k(de, { children: $.map((e, t) => {
476
+ let n = B[e.type], r = n.icon, a = x?.id && e.authorId === x.id ? "You" : `#${H(e.authorId)}`;
477
+ return /* @__PURE__ */ k(fe, {
478
+ tone: n.tone,
479
+ icon: /* @__PURE__ */ k(r, {}),
480
+ title: n.label,
481
+ author: a,
482
+ timestamp: i(e.createdAt),
483
+ last: t === $.length - 1,
484
+ children: /* @__PURE__ */ k("p", {
485
+ className: "whitespace-pre-wrap text-text-primary",
486
+ children: e.body
487
+ })
488
+ }, e.id);
489
+ }) }), /* @__PURE__ */ A("div", {
490
+ className: "mt-4 space-y-2 border-t border-border-seam pt-4",
491
+ children: [/* @__PURE__ */ k(Le, {
492
+ value: J,
493
+ onChange: (e) => Y(e.target.value),
494
+ placeholder: "Add a case note…",
495
+ rows: 2,
496
+ "aria-label": "New case note"
497
+ }), /* @__PURE__ */ A("div", {
498
+ className: "flex flex-wrap items-center justify-between gap-2",
499
+ children: [/* @__PURE__ */ A("div", {
500
+ className: "flex items-center gap-2",
501
+ children: [/* @__PURE__ */ k(N, {
502
+ htmlFor: "note-type",
503
+ className: "text-xs text-text-muted",
504
+ children: "Note type"
505
+ }), /* @__PURE__ */ A(Me, {
506
+ value: X,
507
+ onValueChange: (e) => Ue(e),
508
+ children: [/* @__PURE__ */ k(Fe, {
509
+ id: "note-type",
510
+ className: "w-44",
363
511
  "aria-label": "Note type",
364
- children: /* @__PURE__ */ E(Ce, {})
365
- }), /* @__PURE__ */ E(be, { children: Te.map((e) => /* @__PURE__ */ E(xe, {
512
+ children: /* @__PURE__ */ k(Ie, {})
513
+ }), /* @__PURE__ */ k(Ne, { children: Re.map((e) => /* @__PURE__ */ k(Pe, {
366
514
  value: e,
367
- children: a(e)
515
+ children: B[e].label
368
516
  }, e)) })]
369
- }), /* @__PURE__ */ D(O, {
370
- onClick: Ie,
371
- disabled: !G.trim() || R.isPending,
372
- children: [/* @__PURE__ */ E(w, { className: "mr-1.5 h-4 w-4" }), " Add note"]
373
517
  })]
518
+ }), /* @__PURE__ */ A(j, {
519
+ onClick: $e,
520
+ disabled: !J.trim() || R.isPending,
521
+ children: [/* @__PURE__ */ k(D, { className: "mr-1.5 h-4 w-4" }), " Add note"]
374
522
  })]
375
- })
376
- ]
523
+ })]
524
+ })]
377
525
  })
378
526
  ]
379
- }), /* @__PURE__ */ D("div", {
527
+ }), /* @__PURE__ */ A("div", {
380
528
  className: "space-y-4",
381
529
  children: [
382
- /* @__PURE__ */ E(k, {
383
- treatment: "plain",
384
- className: "border-border-seam p-5",
385
- children: /* @__PURE__ */ D("dl", {
386
- className: "space-y-3 text-sm",
387
- children: [
388
- /* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("dt", {
389
- className: "text-text-muted",
390
- children: "Filed"
391
- }), /* @__PURE__ */ E("dd", {
392
- className: "font-medium text-text-primary",
393
- children: i(C.createdAt)
394
- })] }),
395
- /* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("dt", {
396
- className: "text-text-muted",
397
- children: "Submitted"
398
- }), /* @__PURE__ */ E("dd", {
399
- className: "font-medium text-text-primary",
400
- children: C.submittedAt ? i(C.submittedAt) : "Not submitted"
401
- })] }),
402
- /* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("dt", {
403
- className: "text-text-muted",
404
- children: "Due"
405
- }), /* @__PURE__ */ E("dd", {
406
- className: "font-medium text-text-primary",
407
- children: C.dueDate ? r(C.dueDate) : "—"
408
- })] }),
409
- /* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("dt", {
410
- className: "text-text-muted",
411
- children: "Decided"
412
- }), /* @__PURE__ */ E("dd", {
413
- className: "font-medium text-text-primary",
414
- children: C.decidedAt ? i(C.decidedAt) : "—"
415
- })] }),
416
- /* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("dt", {
417
- className: "text-text-muted",
418
- children: "Assigned"
419
- }), /* @__PURE__ */ E("dd", {
420
- className: "font-medium text-text-primary",
421
- children: C.assignedToId ? $ ? "You" : "An officer" : "Unassigned"
422
- })] })
423
- ]
424
- })
530
+ /* @__PURE__ */ k(h, {
531
+ title: "Case details",
532
+ icon: /* @__PURE__ */ k(be, {}),
533
+ className: "border-border-seam",
534
+ children: /* @__PURE__ */ k(g, { items: rt })
425
535
  }),
426
- /* @__PURE__ */ D(k, {
427
- treatment: "plain",
428
- className: "border-border-seam p-5",
429
- children: [/* @__PURE__ */ D("div", {
430
- className: "flex items-center justify-between gap-2",
431
- children: [/* @__PURE__ */ D("div", {
432
- className: "flex items-center gap-2",
433
- children: [/* @__PURE__ */ E(b, { className: "h-4 w-4 text-text-muted" }), /* @__PURE__ */ E("h2", {
434
- className: "text-base font-semibold text-text-primary",
435
- children: "Payments"
436
- })]
437
- }), /* @__PURE__ */ E(O, {
438
- size: "sm",
439
- variant: "outline",
440
- onClick: () => J(!0),
441
- children: /* @__PURE__ */ E(w, { className: "h-4 w-4" })
442
- })]
443
- }), /* @__PURE__ */ E("div", {
444
- className: "mt-3 space-y-2",
445
- children: N.data?.items.length ? N.data.items.map((e) => /* @__PURE__ */ D("div", {
446
- className: "rounded-lg border border-border-seam px-3 py-2",
536
+ /* @__PURE__ */ k(h, {
537
+ title: "Payments",
538
+ icon: /* @__PURE__ */ k(ye, {}),
539
+ className: "border-border-seam",
540
+ actions: /* @__PURE__ */ k(j, {
541
+ size: "sm",
542
+ variant: "outline",
543
+ onClick: () => Z(!0),
544
+ "aria-label": "Record payment",
545
+ children: /* @__PURE__ */ k(D, { className: "h-4 w-4" })
546
+ }),
547
+ children: /* @__PURE__ */ k("div", {
548
+ className: "space-y-2",
549
+ children: M.data?.items.length ? M.data.items.map((e) => /* @__PURE__ */ A("div", {
550
+ className: "rounded-lg border border-border-seam bg-bg-surface px-3 py-2.5",
447
551
  children: [
448
- /* @__PURE__ */ D("div", {
552
+ /* @__PURE__ */ A("div", {
449
553
  className: "flex items-center justify-between gap-2",
450
- children: [/* @__PURE__ */ E("span", {
451
- className: "font-medium text-text-primary",
554
+ children: [/* @__PURE__ */ k("span", {
555
+ className: "font-medium text-text-primary tabular-nums",
452
556
  children: n(e.amount, e.currency)
453
- }), /* @__PURE__ */ E(s, { status: e.status })]
557
+ }), /* @__PURE__ */ k(s, { status: e.status })]
454
558
  }),
455
- e.receiptNumber && /* @__PURE__ */ D("p", {
456
- className: "text-xs text-text-muted",
559
+ e.receiptNumber && /* @__PURE__ */ A("p", {
560
+ className: "mt-0.5 text-xs text-text-muted",
457
561
  children: ["Receipt ", e.receiptNumber]
458
562
  }),
459
- /* @__PURE__ */ D("div", {
563
+ (e.status === "PENDING" || e.status === "PAID") && /* @__PURE__ */ A("div", {
460
564
  className: "mt-2 flex gap-2",
461
- children: [e.status === "PENDING" && /* @__PURE__ */ E(O, {
565
+ children: [e.status === "PENDING" && /* @__PURE__ */ k(j, {
462
566
  size: "sm",
463
567
  variant: "outline",
464
- onClick: () => z.mutateAsync({ id: e.id }).then(() => h.success("Marked as paid")),
465
- disabled: z.isPending,
568
+ onClick: () => V.mutateAsync({ id: e.id }).then(() => m.success("Marked as paid")).catch((e) => m.error("Could not update", p(e))),
569
+ disabled: V.isPending,
466
570
  children: "Mark paid"
467
- }), e.status === "PAID" && /* @__PURE__ */ E(O, {
571
+ }), e.status === "PAID" && /* @__PURE__ */ k(j, {
468
572
  size: "sm",
469
573
  variant: "outline",
470
- onClick: () => B.mutateAsync(e.id).then(() => h.success("Refunded")),
471
- disabled: B.isPending,
574
+ onClick: () => U.mutateAsync(e.id).then(() => m.success("Refunded")).catch((e) => m.error("Could not refund", p(e))),
575
+ disabled: U.isPending,
472
576
  children: "Refund"
473
577
  })]
474
578
  })
475
579
  ]
476
- }, e.id)) : /* @__PURE__ */ E("p", {
580
+ }, e.id)) : /* @__PURE__ */ k("p", {
477
581
  className: "text-sm text-text-secondary",
478
582
  children: "No payments recorded."
479
583
  })
480
- })]
584
+ })
481
585
  }),
482
- /* @__PURE__ */ D(k, {
483
- treatment: "plain",
484
- className: "border-border-seam p-5",
485
- children: [/* @__PURE__ */ D("div", {
486
- className: "flex items-center justify-between gap-2",
487
- children: [/* @__PURE__ */ D("div", {
488
- className: "flex items-center gap-2",
489
- children: [/* @__PURE__ */ E(de, { className: "h-4 w-4 text-text-muted" }), /* @__PURE__ */ E("h2", {
490
- className: "text-base font-semibold text-text-primary",
491
- children: "Permits"
492
- })]
493
- }), /* @__PURE__ */ E(O, {
494
- size: "sm",
495
- variant: "outline",
496
- onClick: () => Y(!0),
497
- children: /* @__PURE__ */ E(w, { className: "h-4 w-4" })
498
- })]
499
- }), /* @__PURE__ */ E("div", {
500
- className: "mt-3 space-y-2",
501
- children: C.permits.length ? C.permits.map((e) => /* @__PURE__ */ D("div", {
502
- className: "rounded-lg border border-border-seam px-3 py-2",
503
- children: [/* @__PURE__ */ D("div", {
586
+ /* @__PURE__ */ k(h, {
587
+ title: "Permits",
588
+ icon: /* @__PURE__ */ k(he, {}),
589
+ className: "border-border-seam",
590
+ actions: /* @__PURE__ */ k(j, {
591
+ size: "sm",
592
+ variant: "outline",
593
+ onClick: () => Q(!0),
594
+ "aria-label": "Issue permit",
595
+ children: /* @__PURE__ */ k(D, { className: "h-4 w-4" })
596
+ }),
597
+ children: /* @__PURE__ */ k("div", {
598
+ className: "space-y-2",
599
+ children: S.permits.length ? S.permits.map((e) => /* @__PURE__ */ A("div", {
600
+ className: "rounded-lg border border-border-seam bg-bg-surface px-3 py-2.5",
601
+ children: [/* @__PURE__ */ A("div", {
504
602
  className: "flex items-center justify-between gap-2",
505
- children: [/* @__PURE__ */ E("span", {
603
+ children: [/* @__PURE__ */ k("span", {
506
604
  className: "truncate font-medium text-text-primary",
507
605
  children: e.title
508
- }), /* @__PURE__ */ E(s, { status: e.status })]
509
- }), /* @__PURE__ */ E("p", {
510
- className: "font-mono text-xs text-text-muted",
606
+ }), /* @__PURE__ */ k(s, { status: e.status })]
607
+ }), /* @__PURE__ */ k("p", {
608
+ className: "mt-0.5 font-mono text-xs text-text-muted",
511
609
  children: e.verificationCode
512
610
  })]
513
- }, e.id)) : /* @__PURE__ */ E("p", {
611
+ }, e.id)) : /* @__PURE__ */ k("p", {
514
612
  className: "text-sm text-text-secondary",
515
- children: "No permits issued."
613
+ children: "No permit issued yet. Approve the application, then issue the permit here."
516
614
  })
517
- })]
615
+ })
518
616
  })
519
617
  ]
520
618
  })]
521
619
  }),
522
- V && /* @__PURE__ */ E(p, {
523
- open: !!V,
524
- onOpenChange: (e) => e ? void 0 : H(null),
525
- title: `${V.label}?`,
526
- description: `This will move the application to ${a(V.status)}.`,
527
- confirmLabel: V.label,
528
- destructive: V.status === "REJECTED",
620
+ W && /* @__PURE__ */ k(ce, {
621
+ open: !!W,
622
+ onOpenChange: (e) => e ? void 0 : G(null),
623
+ title: `${W.label}?`,
624
+ description: `This will move the application to ${a(W.status)}.`,
625
+ confirmLabel: W.label,
626
+ destructive: W.destructive,
529
627
  reason: {
530
- label: V.status === "REJECTED" ? "Reason for rejection" : "Reason / note",
628
+ label: W.status === "REJECTED" ? "Reason for rejection" : "Reason / note",
531
629
  placeholder: "Explain the decision…",
532
- required: V.reason === "required"
630
+ required: W.reason === "required"
533
631
  },
534
632
  onConfirm: async (e) => {
535
- await Z(V, e), H(null);
633
+ await Xe(W, e), G(null);
536
634
  }
537
635
  }),
538
- U && /* @__PURE__ */ E(p, {
539
- open: !!U,
540
- onOpenChange: (e) => e ? void 0 : W(null),
541
- title: `Reject ${U.name}?`,
636
+ K && /* @__PURE__ */ k(ce, {
637
+ open: !!K,
638
+ onOpenChange: (e) => e ? void 0 : q(null),
639
+ title: `Reject ${K.name}?`,
542
640
  confirmLabel: "Reject document",
543
641
  destructive: !0,
544
642
  reason: {
@@ -548,62 +646,62 @@ function R() {
548
646
  },
549
647
  onConfirm: async (e) => {
550
648
  await L.mutateAsync({
551
- id: U.id,
649
+ id: K.id,
552
650
  status: "REJECTED",
553
651
  rejectionReason: e,
554
- applicationId: C.id
555
- }), h.success("Document rejected"), W(null);
652
+ applicationId: S.id
653
+ }), m.success("Document rejected"), q(null);
556
654
  }
557
655
  }),
558
- /* @__PURE__ */ E(De, {
559
- open: Ae,
560
- onOpenChange: J,
561
- defaultAmount: M?.feeAmount ?? 0,
562
- defaultCurrency: M?.currency ?? "INR",
656
+ /* @__PURE__ */ k(He, {
657
+ open: We,
658
+ onOpenChange: Z,
659
+ defaultAmount: O?.feeAmount ?? 0,
660
+ defaultCurrency: O?.currency ?? "INR",
563
661
  onSubmit: async ({ amount: e, currency: t, providerRef: n }) => {
564
- await Oe.mutateAsync({
565
- applicationId: C.id,
662
+ await z.mutateAsync({
663
+ applicationId: S.id,
566
664
  amount: e,
567
665
  currency: t,
568
666
  providerRef: n || null
569
- }), h.success("Payment recorded"), N.refetch();
667
+ }), m.success("Payment recorded"), M.refetch();
570
668
  }
571
669
  }),
572
- /* @__PURE__ */ E(ue, {
573
- open: je,
574
- onOpenChange: Y,
575
- defaultServiceId: C.serviceId,
576
- defaultHolderId: C.citizenId,
577
- applicationId: C.id,
578
- onIssued: () => j()
670
+ /* @__PURE__ */ k(me, {
671
+ open: Ge,
672
+ onOpenChange: Q,
673
+ defaultServiceId: S.serviceId,
674
+ defaultHolderId: S.citizenId,
675
+ applicationId: S.id,
676
+ onIssued: () => E()
579
677
  })
580
678
  ]
581
679
  });
582
680
  }
583
- function De({ open: e, onOpenChange: t, defaultAmount: n, defaultCurrency: r, onSubmit: i }) {
584
- let [a, o] = v(""), [s, c] = v(r), [l, u] = v(""), [d, f] = v(!1);
585
- return g(() => {
681
+ function He({ open: e, onOpenChange: t, defaultAmount: n, defaultCurrency: r, onSubmit: i }) {
682
+ let [a, o] = b(""), [s, c] = b(r), [l, u] = b(""), [d, f] = b(!1);
683
+ return v(() => {
586
684
  e && (o(n ? String(n) : ""), c(r || "INR"), u(""));
587
685
  }, [
588
686
  e,
589
687
  n,
590
688
  r
591
- ]), /* @__PURE__ */ E(M, {
689
+ ]), /* @__PURE__ */ k(P, {
592
690
  open: e,
593
691
  onOpenChange: (e) => d ? void 0 : t(e),
594
- children: /* @__PURE__ */ D(N, {
692
+ children: /* @__PURE__ */ A(F, {
595
693
  className: "sm:max-w-md",
596
694
  children: [
597
- /* @__PURE__ */ D(I, { children: [/* @__PURE__ */ E(L, { children: "Record a payment" }), /* @__PURE__ */ E(P, { children: "Log a fee payment against this application." })] }),
598
- /* @__PURE__ */ D("div", {
695
+ /* @__PURE__ */ A(R, { children: [/* @__PURE__ */ k(z, { children: "Record a payment" }), /* @__PURE__ */ k(I, { children: "Log a fee payment against this application." })] }),
696
+ /* @__PURE__ */ A("div", {
599
697
  className: "grid gap-4 py-2 sm:grid-cols-2",
600
698
  children: [
601
- /* @__PURE__ */ D("div", {
699
+ /* @__PURE__ */ A("div", {
602
700
  className: "grid gap-1.5",
603
- children: [/* @__PURE__ */ E(j, {
701
+ children: [/* @__PURE__ */ k(N, {
604
702
  htmlFor: "pay-amount",
605
703
  children: "Amount"
606
- }), /* @__PURE__ */ E(A, {
704
+ }), /* @__PURE__ */ k(M, {
607
705
  id: "pay-amount",
608
706
  type: "number",
609
707
  min: "0",
@@ -612,24 +710,24 @@ function De({ open: e, onOpenChange: t, defaultAmount: n, defaultCurrency: r, on
612
710
  onChange: (e) => o(e.target.value)
613
711
  })]
614
712
  }),
615
- /* @__PURE__ */ D("div", {
713
+ /* @__PURE__ */ A("div", {
616
714
  className: "grid gap-1.5",
617
- children: [/* @__PURE__ */ E(j, {
715
+ children: [/* @__PURE__ */ k(N, {
618
716
  htmlFor: "pay-currency",
619
717
  children: "Currency"
620
- }), /* @__PURE__ */ E(A, {
718
+ }), /* @__PURE__ */ k(M, {
621
719
  id: "pay-currency",
622
720
  value: s,
623
721
  maxLength: 3,
624
722
  onChange: (e) => c(e.target.value.toUpperCase())
625
723
  })]
626
724
  }),
627
- /* @__PURE__ */ D("div", {
725
+ /* @__PURE__ */ A("div", {
628
726
  className: "grid gap-1.5 sm:col-span-2",
629
- children: [/* @__PURE__ */ E(j, {
727
+ children: [/* @__PURE__ */ k(N, {
630
728
  htmlFor: "pay-ref",
631
729
  children: "Provider reference (optional)"
632
- }), /* @__PURE__ */ E(A, {
730
+ }), /* @__PURE__ */ k(M, {
633
731
  id: "pay-ref",
634
732
  value: l,
635
733
  onChange: (e) => u(e.target.value),
@@ -638,12 +736,12 @@ function De({ open: e, onOpenChange: t, defaultAmount: n, defaultCurrency: r, on
638
736
  })
639
737
  ]
640
738
  }),
641
- /* @__PURE__ */ D(F, { children: [/* @__PURE__ */ E(O, {
739
+ /* @__PURE__ */ A(L, { children: [/* @__PURE__ */ k(j, {
642
740
  variant: "outline",
643
741
  onClick: () => t(!1),
644
742
  disabled: d,
645
743
  children: "Cancel"
646
- }), /* @__PURE__ */ E(O, {
744
+ }), /* @__PURE__ */ k(j, {
647
745
  onClick: async () => {
648
746
  let e = Number(a || 0);
649
747
  if (!(e <= 0)) {
@@ -667,6 +765,6 @@ function De({ open: e, onOpenChange: t, defaultAmount: n, defaultCurrency: r, on
667
765
  });
668
766
  }
669
767
  //#endregion
670
- export { R as ApplicationDetailPage };
768
+ export { U as ApplicationDetailPage };
671
769
 
672
770
  //# sourceMappingURL=ApplicationDetailPage.js.map