@burdenoff/microfe-movethewheels 2026.930.1 → 2026.930.3

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.
@@ -7,30 +7,32 @@ import { Save as a } from "../node_modules/lucide-react/dist/esm/icons/save.js";
7
7
  import { SquarePen as o } from "../node_modules/lucide-react/dist/esm/icons/square-pen.js";
8
8
  import { Star as s } from "../node_modules/lucide-react/dist/esm/icons/star.js";
9
9
  import { StickyNote as ee } from "../node_modules/lucide-react/dist/esm/icons/sticky-note.js";
10
- import { Truck as c } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
11
- import { UserX as l } from "../node_modules/lucide-react/dist/esm/icons/user-x.js";
12
- import { Users as u } from "../node_modules/lucide-react/dist/esm/icons/users.js";
13
- import { joinPath as d } from "../utils/navigation.js";
10
+ import { Trash2 as c } from "../node_modules/lucide-react/dist/esm/icons/trash-2.js";
11
+ import { Truck as l } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
12
+ import { UserX as u } from "../node_modules/lucide-react/dist/esm/icons/user-x.js";
13
+ import { Users as d } from "../node_modules/lucide-react/dist/esm/icons/users.js";
14
+ import { joinPath as f } from "../utils/navigation.js";
14
15
  import { useMoveTheWheels as te } from "../providers/MoveTheWheelsProvider.js";
15
- import { toApiDriverStatus as f, useDriver as p, useFleet as m, useVehicle as h, useVehicles as g } from "../hooks/useFleet.js";
16
- import { Button as _, Card as v, CardContent as y, CardHeader as b, CardTitle as x, Input as S, Label as C, Select as ne, SelectContent as w, SelectItem as T, SelectTrigger as E, SelectValue as D, Textarea as O } from "../components/ui.js";
17
- import { ErrorState as k, LoadingState as A, PageLayout as j } from "../components/PageLayout.js";
18
- import { DRIVER_STATUS_LABELS as M } from "../constants/index.js";
19
- import { StatusBadge as N } from "../components/StatusBadge.js";
20
- import { FormError as P } from "../components/FormError.js";
21
- import { formatCurrency as F, formatDate as I } from "../utils/formatters.js";
22
- import { DocumentsCard as L } from "../components/DocumentsCard.js";
23
- import { useDebouncedValue as re } from "../hooks/useDebouncedValue.js";
24
- import { EntityCombobox as ie } from "../components/EntityCombobox.js";
25
- import { useEffect as ae, useState as R } from "react";
26
- import { useLocation as z, useParams as B } from "react-router";
27
- import { Fragment as oe, jsx as V, jsxs as H } from "react/jsx-runtime";
28
- import { EmphasisPanel as se, NextSteps as U, PagePurpose as W, ResponsiveDialog as ce, ResponsiveDialogContent as le, ResponsiveDialogDescription as ue, ResponsiveDialogFooter as de, ResponsiveDialogHeader as fe, ResponsiveDialogTitle as pe } from "@burdenoff/fe-libs/ui";
16
+ import { toApiDriverStatus as p, useDriver as ne, useFleet as m, useVehicle as re, useVehicles as ie } from "../hooks/useFleet.js";
17
+ import { Button as h, Card as g, CardContent as _, CardHeader as v, CardTitle as y, Input as b, Label as x, Select as S, SelectContent as C, SelectItem as w, SelectTrigger as T, SelectValue as E, Textarea as D } from "../components/ui.js";
18
+ import { ErrorState as ae, LoadingState as O, PageLayout as oe } from "../components/PageLayout.js";
19
+ import { DRIVER_STATUS_LABELS as k } from "../constants/index.js";
20
+ import { StatusBadge as A } from "../components/StatusBadge.js";
21
+ import { FormError as j } from "../components/FormError.js";
22
+ import { formatCurrency as M, formatDate as N } from "../utils/formatters.js";
23
+ import { DocumentsCard as P } from "../components/DocumentsCard.js";
24
+ import { useDebouncedValue as se } from "../hooks/useDebouncedValue.js";
25
+ import { EntityCombobox as ce } from "../components/EntityCombobox.js";
26
+ import { useRefetchOnLeaveEdit as F } from "../hooks/useRefetchOnLeaveEdit.js";
27
+ import { useEffect as le, useState as I } from "react";
28
+ import { useLocation as L, useParams as R } from "react-router";
29
+ import { Fragment as ue, jsx as z, jsxs as B } from "react/jsx-runtime";
30
+ import { EmphasisPanel as de, NextSteps as V, PagePurpose as H, ResponsiveDialog as U, ResponsiveDialogContent as fe, ResponsiveDialogDescription as pe, ResponsiveDialogFooter as me, ResponsiveDialogHeader as he, ResponsiveDialogTitle as ge } from "@burdenoff/fe-libs/ui";
29
31
  //#region src/movethewheels/pages/DriverDetailsPage.tsx
30
- var me = Object.entries(M).map(([e, t]) => ({
32
+ var _e = Object.entries(k).map(([e, t]) => ({
31
33
  value: e,
32
34
  label: t
33
- })), G = (e) => e ? e.toISOString().slice(0, 10) : "", K = (e) => e ? `${e}T12:00:00.000Z` : void 0, he = {
35
+ })), W = (e) => e ? e.toISOString().slice(0, 10) : "", G = (e) => e ? `${e}T12:00:00.000Z` : void 0, ve = {
34
36
  employeeId: "",
35
37
  firstName: "",
36
38
  lastName: "",
@@ -50,186 +52,197 @@ var me = Object.entries(M).map(([e, t]) => ({
50
52
  payCurrency: "",
51
53
  onLeaveUntil: ""
52
54
  };
53
- function q({ editId: t }) {
54
- let { basePath: r, navigate: i } = te(), { createDriver: o, updateDriver: s } = m(), { driver: k, refetch: A } = p(t), M = !!t, [N, F] = R(he), [L, z] = R(!1), [B, U] = R(null), [q, J] = R(!1), [Y, ge] = R(""), [X, _e] = R(!1), [ve, Z] = R(null), [Q, ye] = R(""), { vehicles: be, isLoading: xe, isLoadingMore: Se, hasMore: Ce, totalVehicles: we, loadMore: Te } = g({
55
+ function K({ editId: t }) {
56
+ let { basePath: r, navigate: i } = te(), { createDriver: o, updateDriver: s, deleteDriver: ae } = m(), { driver: O, refetch: k } = ne(t), A = !!t, [M, P] = I(ve), [F, L] = I(!1), [R, V] = I(null), [K, q] = I(!1), [J, ye] = I(""), [Y, be] = I(!1), [xe, X] = I(null), [Se, Z] = I(!1), [Q, Ce] = I(!1), [we, Te] = I(null), [Ee, De] = I(""), { vehicles: Oe, isLoading: ke, isLoadingMore: Ae, hasMore: je, totalVehicles: Me, loadMore: Ne } = ie({
55
57
  limit: 20,
56
- search: re(Q) || void 0
57
- }), { vehicle: Ee, isLoading: De } = h(N.vehicleId || void 0);
58
- ae(() => {
59
- if (!t || !k) return;
60
- let [e, ...n] = k.fullName.trim().split(/\s+/);
61
- F({
62
- employeeId: k.employeeId || "",
58
+ search: se(Ee) || void 0
59
+ }), { vehicle: Pe, isLoading: Fe } = re(M.vehicleId || void 0);
60
+ le(() => {
61
+ if (!t || !O) return;
62
+ let [e, ...n] = O.fullName.trim().split(/\s+/);
63
+ P({
64
+ employeeId: O.employeeId || "",
63
65
  firstName: e || "",
64
66
  lastName: n.join(" "),
65
- email: k.email || "",
66
- phone: k.phone || "",
67
- licenseNumber: k.licenseNumber || "",
68
- licenseClass: k.licenseType || "",
69
- licenseExpiry: G(k.licenseExpiry),
70
- status: k.status,
71
- vehicleId: k.assignedVehicle || "",
72
- vehicleIds: k.vehicleIds,
73
- rating: k.rating ? String(k.rating) : "",
74
- notes: k.notes || "",
75
- hireDate: G(k.hireDate),
76
- baseSalary: k.baseSalary === void 0 ? "" : String(k.baseSalary),
77
- bonusYtd: k.bonusYtd === void 0 ? "" : String(k.bonusYtd),
78
- payCurrency: k.payCurrency || "",
79
- onLeaveUntil: G(k.onLeaveUntil)
67
+ email: O.email || "",
68
+ phone: O.phone || "",
69
+ licenseNumber: O.licenseNumber || "",
70
+ licenseClass: O.licenseType || "",
71
+ licenseExpiry: W(O.licenseExpiry),
72
+ status: O.status,
73
+ vehicleId: O.assignedVehicle || "",
74
+ vehicleIds: O.vehicleIds,
75
+ rating: O.rating ? String(O.rating) : "",
76
+ notes: O.notes || "",
77
+ hireDate: W(O.hireDate),
78
+ baseSalary: O.baseSalary === void 0 ? "" : String(O.baseSalary),
79
+ bonusYtd: O.bonusYtd === void 0 ? "" : String(O.bonusYtd),
80
+ payCurrency: O.payCurrency || "",
81
+ onLeaveUntil: W(O.onLeaveUntil)
80
82
  });
81
- }, [t, k]);
82
- let Oe = () => i?.(d(r, "fleet/drivers")), $ = (e = !0) => ({
83
- firstName: N.firstName.trim(),
84
- lastName: N.lastName.trim(),
85
- email: N.email.trim() || void 0,
86
- phone: N.phone.trim() || void 0,
87
- licenseNumber: N.licenseNumber.trim() || void 0,
88
- licenseClass: N.licenseClass.trim() || void 0,
89
- licenseExpiry: K(N.licenseExpiry),
90
- status: f(N.status),
91
- vehicleId: N.vehicleId || null,
92
- vehicleIds: N.vehicleIds,
93
- rating: N.rating.trim() ? Number(N.rating) : void 0,
94
- notes: N.notes.trim() || void 0,
95
- hireDate: K(N.hireDate),
96
- baseSalary: N.baseSalary.trim() ? Number(N.baseSalary) : void 0,
97
- bonusYtd: N.bonusYtd.trim() ? Number(N.bonusYtd) : void 0,
98
- payCurrency: N.payCurrency.trim() || void 0,
99
- ...e ? { onLeaveUntil: K(N.onLeaveUntil) ?? null } : {}
100
- }), ke = () => ({
101
- employeeId: N.employeeId.trim(),
83
+ }, [t, O]);
84
+ let Ie = () => i?.(f(r, "fleet/drivers")), $ = (e = !0) => ({
85
+ firstName: M.firstName.trim(),
86
+ lastName: M.lastName.trim(),
87
+ email: M.email.trim() || void 0,
88
+ phone: M.phone.trim() || void 0,
89
+ licenseNumber: M.licenseNumber.trim() || void 0,
90
+ licenseClass: M.licenseClass.trim() || void 0,
91
+ licenseExpiry: G(M.licenseExpiry),
92
+ status: p(M.status),
93
+ vehicleId: M.vehicleId || null,
94
+ vehicleIds: M.vehicleIds,
95
+ rating: M.rating.trim() ? Number(M.rating) : void 0,
96
+ notes: M.notes.trim() || void 0,
97
+ hireDate: G(M.hireDate),
98
+ baseSalary: M.baseSalary.trim() ? Number(M.baseSalary) : void 0,
99
+ bonusYtd: M.bonusYtd.trim() ? Number(M.bonusYtd) : void 0,
100
+ payCurrency: M.payCurrency.trim() || void 0,
101
+ ...e ? { onLeaveUntil: G(M.onLeaveUntil) ?? null } : {}
102
+ }), Le = () => ({
103
+ employeeId: M.employeeId.trim(),
102
104
  ...$(!1)
103
- }), Ae = async (e) => {
104
- if (e.preventDefault(), !N.employeeId.trim() || !N.firstName.trim() || !N.lastName.trim()) {
105
- U("Employee ID, first name and last name are required.");
105
+ }), Re = async (e) => {
106
+ if (e.preventDefault(), !M.employeeId.trim() || !M.firstName.trim() || !M.lastName.trim()) {
107
+ V("Employee ID, first name and last name are required.");
106
108
  return;
107
109
  }
108
- if (!N.phone.trim()) {
109
- U("Phone is required so this driver can be reached.");
110
+ if (!M.phone.trim()) {
111
+ V("Phone is required so this driver can be reached.");
110
112
  return;
111
113
  }
112
- z(!0), U(null);
114
+ L(!0), V(null);
113
115
  try {
114
116
  if (t) {
115
117
  let e = await s(t, $());
116
- i?.(d(r, `fleet/drivers/${e.id}`));
118
+ i?.(f(r, `fleet/drivers/${e.id}`));
117
119
  } else {
118
- let e = await o(ke());
119
- i?.(d(r, `fleet/drivers/${e.id}`));
120
+ let e = await o(Le());
121
+ i?.(f(r, `fleet/drivers/${e.id}`));
120
122
  }
121
123
  } catch (e) {
122
- console.error("Failed to save driver:", e), U(e instanceof Error ? e.message : "Failed to save driver. Please try again."), z(!1);
124
+ console.error("Failed to save driver:", e), V(e instanceof Error ? e.message : "Failed to save driver. Please try again."), L(!1);
123
125
  }
124
- }, je = async () => {
125
- if (!t || !Y.trim()) {
126
- Z("A reason is required to dismiss a driver.");
126
+ }, ze = async () => {
127
+ if (!t || !J.trim()) {
128
+ X("A reason is required to dismiss a driver.");
127
129
  return;
128
130
  }
129
- _e(!0), Z(null);
131
+ be(!0), X(null);
130
132
  try {
131
133
  await s(t, {
132
134
  ...$(),
133
135
  terminatedAt: (/* @__PURE__ */ new Date()).toISOString(),
134
- terminationReason: Y.trim()
135
- }), J(!1), await A(), i?.(d(r, `fleet/drivers/${t}`));
136
+ terminationReason: J.trim()
137
+ }), q(!1), await k(), i?.(f(r, `fleet/drivers/${t}`));
136
138
  } catch (e) {
137
- Z(e instanceof Error ? e.message : "Failed to dismiss driver.");
139
+ X(e instanceof Error ? e.message : "Failed to dismiss driver.");
138
140
  } finally {
139
- _e(!1);
141
+ be(!1);
140
142
  }
141
- }, Me = M && !!k?.terminatedAt;
142
- return /* @__PURE__ */ H(j, {
143
- title: M ? "Edit Driver" : "Add Driver",
143
+ }, Be = async () => {
144
+ if (t) {
145
+ Ce(!0), Te(null);
146
+ try {
147
+ await ae(t), Z(!1), i?.(f(r, "fleet/drivers"));
148
+ } catch (e) {
149
+ Te(e instanceof Error ? e.message : "Failed to delete driver.");
150
+ } finally {
151
+ Ce(!1);
152
+ }
153
+ }
154
+ }, Ve = A && !!O?.terminatedAt;
155
+ return /* @__PURE__ */ B(oe, {
156
+ title: A ? "Edit Driver" : "Add Driver",
144
157
  subtitle: "Add a driver to your workforce",
145
- icon: /* @__PURE__ */ V(u, { size: 24 }),
146
- headerActions: /* @__PURE__ */ H("div", {
158
+ icon: /* @__PURE__ */ z(d, { size: 24 }),
159
+ headerActions: /* @__PURE__ */ B("div", {
147
160
  className: "flex gap-2",
148
- children: [/* @__PURE__ */ H(_, {
161
+ children: [/* @__PURE__ */ B(h, {
149
162
  variant: "outline",
150
- onClick: Oe,
151
- disabled: L,
152
- children: [/* @__PURE__ */ V(e, { size: 16 }), " Cancel"]
153
- }), /* @__PURE__ */ H(_, {
154
- onClick: Ae,
155
- disabled: L,
163
+ onClick: Ie,
164
+ disabled: F,
165
+ children: [/* @__PURE__ */ z(e, { size: 16 }), " Cancel"]
166
+ }), /* @__PURE__ */ B(h, {
167
+ onClick: Re,
168
+ disabled: F,
156
169
  children: [
157
- /* @__PURE__ */ V(a, { size: 16 }),
170
+ /* @__PURE__ */ z(a, { size: 16 }),
158
171
  " ",
159
- M ? L ? "Saving..." : "Save Changes" : L ? "Saving..." : "Add Driver"
172
+ A ? F ? "Saving..." : "Save Changes" : F ? "Saving..." : "Add Driver"
160
173
  ]
161
174
  })]
162
175
  }),
163
176
  children: [
164
- /* @__PURE__ */ V(W, {
165
- icon: /* @__PURE__ */ V(u, { size: 18 }),
177
+ /* @__PURE__ */ z(H, {
178
+ icon: /* @__PURE__ */ z(d, { size: 18 }),
166
179
  children: "Add a driver so they can be assigned to orders and routes. An employee ID, name and phone get them on the roster — add licensing, a vehicle and HR details to keep the record complete."
167
180
  }),
168
- Me && k?.terminatedAt && /* @__PURE__ */ H("div", {
181
+ Ve && O?.terminatedAt && /* @__PURE__ */ B("div", {
169
182
  className: "rounded-card border border-status-error-border bg-status-error-bg-subtle p-4 text-sm text-status-error-text",
170
- children: [/* @__PURE__ */ H("p", {
183
+ children: [/* @__PURE__ */ B("p", {
171
184
  className: "font-medium",
172
185
  children: [
173
186
  "This driver was dismissed on ",
174
- I(k.terminatedAt, "full"),
187
+ N(O.terminatedAt, "full"),
175
188
  "."
176
189
  ]
177
- }), k.terminationReason && /* @__PURE__ */ H("p", {
190
+ }), O.terminationReason && /* @__PURE__ */ B("p", {
178
191
  className: "mt-1",
179
- children: ["Reason: ", k.terminationReason]
192
+ children: ["Reason: ", O.terminationReason]
180
193
  })]
181
194
  }),
182
- /* @__PURE__ */ H("form", {
183
- onSubmit: Ae,
195
+ /* @__PURE__ */ B("form", {
196
+ onSubmit: Re,
184
197
  className: "max-w-3xl space-y-6",
185
198
  children: [
186
- /* @__PURE__ */ V(P, { message: B }),
187
- /* @__PURE__ */ H(se, { children: [/* @__PURE__ */ V("h2", {
199
+ /* @__PURE__ */ z(j, { message: R }),
200
+ /* @__PURE__ */ B(de, { children: [/* @__PURE__ */ z("h2", {
188
201
  className: "text-base font-semibold text-text-primary mb-4",
189
202
  children: "Driver Details"
190
- }), /* @__PURE__ */ H("div", {
203
+ }), /* @__PURE__ */ B("div", {
191
204
  className: "space-y-4",
192
205
  children: [
193
- /* @__PURE__ */ H("div", {
206
+ /* @__PURE__ */ B("div", {
194
207
  className: "grid grid-cols-1 md:grid-cols-3 gap-4",
195
208
  children: [
196
- /* @__PURE__ */ H("div", {
209
+ /* @__PURE__ */ B("div", {
197
210
  className: "space-y-2",
198
- children: [/* @__PURE__ */ H(C, {
211
+ children: [/* @__PURE__ */ B(x, {
199
212
  htmlFor: "employeeId",
200
213
  children: [
201
214
  "Employee ID ",
202
- M ? "(immutable)" : "",
215
+ A ? "(immutable)" : "",
203
216
  " ",
204
- /* @__PURE__ */ V("span", {
217
+ /* @__PURE__ */ z("span", {
205
218
  className: "text-status-error-text",
206
- children: !M && "*"
219
+ children: !A && "*"
207
220
  })
208
221
  ]
209
- }), /* @__PURE__ */ V(S, {
222
+ }), /* @__PURE__ */ z(b, {
210
223
  id: "employeeId",
211
- value: N.employeeId,
212
- onChange: (e) => F((t) => ({
224
+ value: M.employeeId,
225
+ onChange: (e) => P((t) => ({
213
226
  ...t,
214
227
  employeeId: e.target.value
215
228
  })),
216
229
  placeholder: "EMP-001",
217
230
  required: !0,
218
- disabled: M
231
+ disabled: A
219
232
  })]
220
233
  }),
221
- /* @__PURE__ */ H("div", {
234
+ /* @__PURE__ */ B("div", {
222
235
  className: "space-y-2",
223
- children: [/* @__PURE__ */ H(C, {
236
+ children: [/* @__PURE__ */ B(x, {
224
237
  htmlFor: "firstName",
225
- children: ["First Name ", /* @__PURE__ */ V("span", {
238
+ children: ["First Name ", /* @__PURE__ */ z("span", {
226
239
  className: "text-status-error-text",
227
240
  children: "*"
228
241
  })]
229
- }), /* @__PURE__ */ V(S, {
242
+ }), /* @__PURE__ */ z(b, {
230
243
  id: "firstName",
231
- value: N.firstName,
232
- onChange: (e) => F((t) => ({
244
+ value: M.firstName,
245
+ onChange: (e) => P((t) => ({
233
246
  ...t,
234
247
  firstName: e.target.value
235
248
  })),
@@ -237,18 +250,18 @@ function q({ editId: t }) {
237
250
  required: !0
238
251
  })]
239
252
  }),
240
- /* @__PURE__ */ H("div", {
253
+ /* @__PURE__ */ B("div", {
241
254
  className: "space-y-2",
242
- children: [/* @__PURE__ */ H(C, {
255
+ children: [/* @__PURE__ */ B(x, {
243
256
  htmlFor: "lastName",
244
- children: ["Last Name ", /* @__PURE__ */ V("span", {
257
+ children: ["Last Name ", /* @__PURE__ */ z("span", {
245
258
  className: "text-status-error-text",
246
259
  children: "*"
247
260
  })]
248
- }), /* @__PURE__ */ V(S, {
261
+ }), /* @__PURE__ */ z(b, {
249
262
  id: "lastName",
250
- value: N.lastName,
251
- onChange: (e) => F((t) => ({
263
+ value: M.lastName,
264
+ onChange: (e) => P((t) => ({
252
265
  ...t,
253
266
  lastName: e.target.value
254
267
  })),
@@ -258,37 +271,37 @@ function q({ editId: t }) {
258
271
  })
259
272
  ]
260
273
  }),
261
- /* @__PURE__ */ H("div", {
274
+ /* @__PURE__ */ B("div", {
262
275
  className: "grid grid-cols-1 md:grid-cols-3 gap-4",
263
276
  children: [
264
- /* @__PURE__ */ H("div", {
277
+ /* @__PURE__ */ B("div", {
265
278
  className: "space-y-2",
266
- children: [/* @__PURE__ */ V(C, {
279
+ children: [/* @__PURE__ */ z(x, {
267
280
  htmlFor: "email",
268
281
  children: "Email"
269
- }), /* @__PURE__ */ V(S, {
282
+ }), /* @__PURE__ */ z(b, {
270
283
  id: "email",
271
284
  type: "email",
272
- value: N.email,
273
- onChange: (e) => F((t) => ({
285
+ value: M.email,
286
+ onChange: (e) => P((t) => ({
274
287
  ...t,
275
288
  email: e.target.value
276
289
  })),
277
290
  placeholder: "jane.doe@example.com"
278
291
  })]
279
292
  }),
280
- /* @__PURE__ */ H("div", {
293
+ /* @__PURE__ */ B("div", {
281
294
  className: "space-y-2",
282
- children: [/* @__PURE__ */ H(C, {
295
+ children: [/* @__PURE__ */ B(x, {
283
296
  htmlFor: "phone",
284
- children: ["Phone ", /* @__PURE__ */ V("span", {
297
+ children: ["Phone ", /* @__PURE__ */ z("span", {
285
298
  className: "text-status-error-text",
286
299
  children: "*"
287
300
  })]
288
- }), /* @__PURE__ */ V(S, {
301
+ }), /* @__PURE__ */ z(b, {
289
302
  id: "phone",
290
- value: N.phone,
291
- onChange: (e) => F((t) => ({
303
+ value: M.phone,
304
+ onChange: (e) => P((t) => ({
292
305
  ...t,
293
306
  phone: e.target.value
294
307
  })),
@@ -296,21 +309,21 @@ function q({ editId: t }) {
296
309
  required: !0
297
310
  })]
298
311
  }),
299
- /* @__PURE__ */ H("div", {
312
+ /* @__PURE__ */ B("div", {
300
313
  className: "space-y-2",
301
- children: [/* @__PURE__ */ V(C, {
314
+ children: [/* @__PURE__ */ z(x, {
302
315
  htmlFor: "status",
303
316
  children: "Status"
304
- }), /* @__PURE__ */ H(ne, {
305
- value: N.status,
306
- onValueChange: (e) => F((t) => ({
317
+ }), /* @__PURE__ */ B(S, {
318
+ value: M.status,
319
+ onValueChange: (e) => P((t) => ({
307
320
  ...t,
308
321
  status: e
309
322
  })),
310
- children: [/* @__PURE__ */ V(E, {
323
+ children: [/* @__PURE__ */ z(T, {
311
324
  id: "status",
312
- children: /* @__PURE__ */ V(D, {})
313
- }), /* @__PURE__ */ V(w, { children: me.map((e) => /* @__PURE__ */ V(T, {
325
+ children: /* @__PURE__ */ z(E, {})
326
+ }), /* @__PURE__ */ z(C, { children: _e.map((e) => /* @__PURE__ */ z(w, {
314
327
  value: e.value,
315
328
  children: e.label
316
329
  }, e.value)) })]
@@ -318,49 +331,49 @@ function q({ editId: t }) {
318
331
  })
319
332
  ]
320
333
  }),
321
- /* @__PURE__ */ H("div", {
334
+ /* @__PURE__ */ B("div", {
322
335
  className: "grid grid-cols-1 md:grid-cols-3 gap-4",
323
336
  children: [
324
- /* @__PURE__ */ H("div", {
337
+ /* @__PURE__ */ B("div", {
325
338
  className: "space-y-2",
326
- children: [/* @__PURE__ */ V(C, {
339
+ children: [/* @__PURE__ */ z(x, {
327
340
  htmlFor: "licenseNumber",
328
341
  children: "License Number"
329
- }), /* @__PURE__ */ V(S, {
342
+ }), /* @__PURE__ */ z(b, {
330
343
  id: "licenseNumber",
331
- value: N.licenseNumber,
332
- onChange: (e) => F((t) => ({
344
+ value: M.licenseNumber,
345
+ onChange: (e) => P((t) => ({
333
346
  ...t,
334
347
  licenseNumber: e.target.value
335
348
  })),
336
349
  placeholder: "D1234567"
337
350
  })]
338
351
  }),
339
- /* @__PURE__ */ H("div", {
352
+ /* @__PURE__ */ B("div", {
340
353
  className: "space-y-2",
341
- children: [/* @__PURE__ */ V(C, {
354
+ children: [/* @__PURE__ */ z(x, {
342
355
  htmlFor: "licenseClass",
343
356
  children: "License Class"
344
- }), /* @__PURE__ */ V(S, {
357
+ }), /* @__PURE__ */ z(b, {
345
358
  id: "licenseClass",
346
- value: N.licenseClass,
347
- onChange: (e) => F((t) => ({
359
+ value: M.licenseClass,
360
+ onChange: (e) => P((t) => ({
348
361
  ...t,
349
362
  licenseClass: e.target.value
350
363
  })),
351
364
  placeholder: "Class A"
352
365
  })]
353
366
  }),
354
- /* @__PURE__ */ H("div", {
367
+ /* @__PURE__ */ B("div", {
355
368
  className: "space-y-2",
356
- children: [/* @__PURE__ */ V(C, {
369
+ children: [/* @__PURE__ */ z(x, {
357
370
  htmlFor: "licenseExpiry",
358
371
  children: "License Expiry"
359
- }), /* @__PURE__ */ V(S, {
372
+ }), /* @__PURE__ */ z(b, {
360
373
  id: "licenseExpiry",
361
374
  type: "date",
362
- value: N.licenseExpiry,
363
- onChange: (e) => F((t) => ({
375
+ value: M.licenseExpiry,
376
+ onChange: (e) => P((t) => ({
364
377
  ...t,
365
378
  licenseExpiry: e.target.value
366
379
  }))
@@ -368,38 +381,38 @@ function q({ editId: t }) {
368
381
  })
369
382
  ]
370
383
  }),
371
- /* @__PURE__ */ H("div", {
384
+ /* @__PURE__ */ B("div", {
372
385
  className: "grid grid-cols-1 md:grid-cols-2 gap-4",
373
- children: [/* @__PURE__ */ H("div", {
386
+ children: [/* @__PURE__ */ B("div", {
374
387
  className: "space-y-2",
375
- children: [/* @__PURE__ */ V(C, {
388
+ children: [/* @__PURE__ */ z(x, {
376
389
  htmlFor: "vehicleSearch",
377
390
  children: "Search vehicles"
378
- }), /* @__PURE__ */ V(S, {
391
+ }), /* @__PURE__ */ z(b, {
379
392
  id: "vehicleSearch",
380
- value: Q,
381
- onChange: (e) => ye(e.target.value),
393
+ value: Ee,
394
+ onChange: (e) => De(e.target.value),
382
395
  placeholder: "Vehicle number or type"
383
396
  })]
384
- }), /* @__PURE__ */ H("div", {
397
+ }), /* @__PURE__ */ B("div", {
385
398
  className: "space-y-2",
386
- children: [/* @__PURE__ */ V(C, {
399
+ children: [/* @__PURE__ */ z(x, {
387
400
  htmlFor: "vehicle",
388
401
  children: "Assigned Vehicle"
389
- }), /* @__PURE__ */ V(ie, {
402
+ }), /* @__PURE__ */ z(ce, {
390
403
  id: "vehicle",
391
- value: N.vehicleId,
392
- onChange: (e) => F((t) => ({
404
+ value: M.vehicleId,
405
+ onChange: (e) => P((t) => ({
393
406
  ...t,
394
407
  vehicleId: e,
395
408
  vehicleIds: e ? [e] : []
396
409
  })),
397
- options: be,
398
- loading: xe,
410
+ options: Oe,
411
+ loading: ke,
399
412
  getId: (e) => e.id,
400
413
  getLabel: (e) => `${e.vehicleNumber} (${e.type})`,
401
- renderOption: (e) => /* @__PURE__ */ H(oe, { children: [
402
- /* @__PURE__ */ V(c, {
414
+ renderOption: (e) => /* @__PURE__ */ B(ue, { children: [
415
+ /* @__PURE__ */ z(l, {
403
416
  size: 14,
404
417
  className: "mr-2 inline text-text-secondary"
405
418
  }),
@@ -408,76 +421,76 @@ function q({ editId: t }) {
408
421
  e.type,
409
422
  ")"
410
423
  ] }),
411
- selectedOption: Ee,
412
- selectedLoading: De,
413
- hasMore: Ce,
414
- totalCount: we,
415
- onLoadMore: Te,
416
- loadingMore: Se,
424
+ selectedOption: Pe,
425
+ selectedLoading: Fe,
426
+ hasMore: je,
427
+ totalCount: Me,
428
+ onLoadMore: Ne,
429
+ loadingMore: Ae,
417
430
  placeholder: "Unassigned",
418
431
  emptyText: "No vehicles match that search."
419
432
  })]
420
433
  })]
421
434
  }),
422
- /* @__PURE__ */ H("div", {
435
+ /* @__PURE__ */ B("div", {
423
436
  className: "grid grid-cols-1 md:grid-cols-3 gap-4",
424
437
  children: [
425
- /* @__PURE__ */ H("div", {
438
+ /* @__PURE__ */ B("div", {
426
439
  className: "space-y-2",
427
- children: [/* @__PURE__ */ V(C, {
440
+ children: [/* @__PURE__ */ z(x, {
428
441
  htmlFor: "rating",
429
442
  children: "Rating (0–5)"
430
- }), /* @__PURE__ */ V(S, {
443
+ }), /* @__PURE__ */ z(b, {
431
444
  id: "rating",
432
445
  type: "number",
433
446
  min: 0,
434
447
  max: 5,
435
448
  step: .1,
436
- value: N.rating,
437
- onChange: (e) => F((t) => ({
449
+ value: M.rating,
450
+ onChange: (e) => P((t) => ({
438
451
  ...t,
439
452
  rating: e.target.value
440
453
  })),
441
454
  placeholder: "4.8"
442
455
  })]
443
456
  }),
444
- /* @__PURE__ */ H("div", {
457
+ /* @__PURE__ */ B("div", {
445
458
  className: "space-y-2",
446
- children: [/* @__PURE__ */ V(C, {
459
+ children: [/* @__PURE__ */ z(x, {
447
460
  htmlFor: "hireDate",
448
461
  children: "Hire Date"
449
- }), /* @__PURE__ */ V(S, {
462
+ }), /* @__PURE__ */ z(b, {
450
463
  id: "hireDate",
451
464
  type: "date",
452
- value: N.hireDate,
453
- onChange: (e) => F((t) => ({
465
+ value: M.hireDate,
466
+ onChange: (e) => P((t) => ({
454
467
  ...t,
455
468
  hireDate: e.target.value
456
469
  }))
457
470
  })]
458
471
  }),
459
- /* @__PURE__ */ H("div", {
472
+ /* @__PURE__ */ B("div", {
460
473
  className: "space-y-2",
461
- children: [/* @__PURE__ */ H("div", {
474
+ children: [/* @__PURE__ */ B("div", {
462
475
  className: "flex items-center justify-between gap-2",
463
- children: [/* @__PURE__ */ V(C, {
476
+ children: [/* @__PURE__ */ z(x, {
464
477
  htmlFor: "onLeaveUntil",
465
478
  children: "On Leave Until"
466
- }), N.onLeaveUntil && /* @__PURE__ */ V(_, {
479
+ }), M.onLeaveUntil && /* @__PURE__ */ z(h, {
467
480
  type: "button",
468
481
  variant: "ghost",
469
482
  size: "sm",
470
- onClick: () => F((e) => ({
483
+ onClick: () => P((e) => ({
471
484
  ...e,
472
485
  onLeaveUntil: ""
473
486
  })),
474
487
  children: "Clear"
475
488
  })]
476
- }), /* @__PURE__ */ V(S, {
489
+ }), /* @__PURE__ */ z(b, {
477
490
  id: "onLeaveUntil",
478
491
  type: "date",
479
- value: N.onLeaveUntil,
480
- onChange: (e) => F((t) => ({
492
+ value: M.onLeaveUntil,
493
+ onChange: (e) => P((t) => ({
481
494
  ...t,
482
495
  onLeaveUntil: e.target.value
483
496
  }))
@@ -487,57 +500,57 @@ function q({ editId: t }) {
487
500
  })
488
501
  ]
489
502
  })] }),
490
- /* @__PURE__ */ H(v, { children: [/* @__PURE__ */ V(b, { children: /* @__PURE__ */ H(x, {
503
+ /* @__PURE__ */ B(g, { children: [/* @__PURE__ */ z(v, { children: /* @__PURE__ */ B(y, {
491
504
  className: "flex items-center gap-2",
492
- children: [/* @__PURE__ */ V(n, { size: 18 }), " Compensation"]
493
- }) }), /* @__PURE__ */ V(y, { children: /* @__PURE__ */ H("div", {
505
+ children: [/* @__PURE__ */ z(n, { size: 18 }), " Compensation"]
506
+ }) }), /* @__PURE__ */ z(_, { children: /* @__PURE__ */ B("div", {
494
507
  className: "grid grid-cols-1 md:grid-cols-3 gap-4",
495
508
  children: [
496
- /* @__PURE__ */ H("div", {
509
+ /* @__PURE__ */ B("div", {
497
510
  className: "space-y-2",
498
- children: [/* @__PURE__ */ V(C, {
511
+ children: [/* @__PURE__ */ z(x, {
499
512
  htmlFor: "baseSalary",
500
513
  children: "Base Salary (annual)"
501
- }), /* @__PURE__ */ V(S, {
514
+ }), /* @__PURE__ */ z(b, {
502
515
  id: "baseSalary",
503
516
  type: "number",
504
517
  min: 0,
505
518
  step: .01,
506
- value: N.baseSalary,
507
- onChange: (e) => F((t) => ({
519
+ value: M.baseSalary,
520
+ onChange: (e) => P((t) => ({
508
521
  ...t,
509
522
  baseSalary: e.target.value
510
523
  })),
511
524
  placeholder: "55000"
512
525
  })]
513
526
  }),
514
- /* @__PURE__ */ H("div", {
527
+ /* @__PURE__ */ B("div", {
515
528
  className: "space-y-2",
516
- children: [/* @__PURE__ */ V(C, {
529
+ children: [/* @__PURE__ */ z(x, {
517
530
  htmlFor: "bonusYtd",
518
531
  children: "Bonus (YTD)"
519
- }), /* @__PURE__ */ V(S, {
532
+ }), /* @__PURE__ */ z(b, {
520
533
  id: "bonusYtd",
521
534
  type: "number",
522
535
  min: 0,
523
536
  step: .01,
524
- value: N.bonusYtd,
525
- onChange: (e) => F((t) => ({
537
+ value: M.bonusYtd,
538
+ onChange: (e) => P((t) => ({
526
539
  ...t,
527
540
  bonusYtd: e.target.value
528
541
  })),
529
542
  placeholder: "1200"
530
543
  })]
531
544
  }),
532
- /* @__PURE__ */ H("div", {
545
+ /* @__PURE__ */ B("div", {
533
546
  className: "space-y-2",
534
- children: [/* @__PURE__ */ V(C, {
547
+ children: [/* @__PURE__ */ z(x, {
535
548
  htmlFor: "payCurrency",
536
549
  children: "Currency"
537
- }), /* @__PURE__ */ V(S, {
550
+ }), /* @__PURE__ */ z(b, {
538
551
  id: "payCurrency",
539
- value: N.payCurrency,
540
- onChange: (e) => F((t) => ({
552
+ value: M.payCurrency,
553
+ onChange: (e) => P((t) => ({
541
554
  ...t,
542
555
  payCurrency: e.target.value
543
556
  })),
@@ -547,110 +560,154 @@ function q({ editId: t }) {
547
560
  })
548
561
  ]
549
562
  }) })] }),
550
- /* @__PURE__ */ H(v, { children: [/* @__PURE__ */ V(b, { children: /* @__PURE__ */ H(x, {
563
+ /* @__PURE__ */ B(g, { children: [/* @__PURE__ */ z(v, { children: /* @__PURE__ */ B(y, {
551
564
  className: "flex items-center gap-2",
552
- children: [/* @__PURE__ */ V(ee, { size: 18 }), " HR Notes"]
553
- }) }), /* @__PURE__ */ V(y, { children: /* @__PURE__ */ V(O, {
554
- value: N.notes,
555
- onChange: (e) => F((t) => ({
565
+ children: [/* @__PURE__ */ z(ee, { size: 18 }), " HR Notes"]
566
+ }) }), /* @__PURE__ */ z(_, { children: /* @__PURE__ */ z(D, {
567
+ value: M.notes,
568
+ onChange: (e) => P((t) => ({
556
569
  ...t,
557
570
  notes: e.target.value
558
571
  })),
559
572
  placeholder: "Performance notes, disciplinary history, anything worth tracking for this driver...",
560
573
  rows: 4
561
574
  }) })] }),
562
- M && !Me && /* @__PURE__ */ H(v, {
575
+ A && !Ve && /* @__PURE__ */ B(g, {
563
576
  className: "border-status-error-border",
564
- children: [/* @__PURE__ */ V(b, { children: /* @__PURE__ */ H(x, {
577
+ children: [/* @__PURE__ */ z(v, { children: /* @__PURE__ */ B(y, {
565
578
  className: "flex items-center gap-2 text-status-error-text",
566
- children: [/* @__PURE__ */ V(l, { size: 18 }), " Dismiss Driver"]
567
- }) }), /* @__PURE__ */ H(y, { children: [/* @__PURE__ */ V("p", {
579
+ children: [/* @__PURE__ */ z(u, { size: 18 }), " Dismiss Driver"]
580
+ }) }), /* @__PURE__ */ B(_, { children: [/* @__PURE__ */ z("p", {
568
581
  className: "mb-3 text-sm text-text-secondary",
569
582
  children: "Dismissing a driver marks them as no longer employed. Their delivery and route history stays visible; they can no longer be assigned new work. This cannot be undone from here."
570
- }), /* @__PURE__ */ H(_, {
583
+ }), /* @__PURE__ */ B(h, {
571
584
  type: "button",
572
585
  variant: "outline",
573
586
  className: "border-status-error-border text-status-error-text hover:bg-status-error-bg-subtle",
574
- onClick: () => J(!0),
575
- children: [/* @__PURE__ */ V(l, { size: 16 }), " Dismiss this driver"]
587
+ onClick: () => q(!0),
588
+ children: [/* @__PURE__ */ z(u, { size: 16 }), " Dismiss this driver"]
589
+ })] })]
590
+ }),
591
+ A && /* @__PURE__ */ B(g, {
592
+ className: "border-status-error-border",
593
+ children: [/* @__PURE__ */ z(v, { children: /* @__PURE__ */ B(y, {
594
+ className: "flex items-center gap-2 text-status-error-text",
595
+ children: [/* @__PURE__ */ z(c, { size: 18 }), " Delete Driver"]
596
+ }) }), /* @__PURE__ */ B(_, { children: [/* @__PURE__ */ z("p", {
597
+ className: "mb-3 text-sm text-text-secondary",
598
+ children: "Removes this driver record, for example one entered by mistake, and unlinks them from any vehicle. To keep delivery history for someone who has left, dismiss them instead. This cannot be undone from here."
599
+ }), /* @__PURE__ */ B(h, {
600
+ type: "button",
601
+ variant: "outline",
602
+ className: "border-status-error-border text-status-error-text hover:bg-status-error-bg-subtle",
603
+ onClick: () => Z(!0),
604
+ children: [/* @__PURE__ */ z(c, { size: 16 }), " Delete this driver"]
576
605
  })] })]
577
606
  })
578
607
  ]
579
608
  }),
580
- /* @__PURE__ */ V(ce, {
581
- open: q,
582
- onOpenChange: J,
583
- children: /* @__PURE__ */ H(le, { children: [
584
- /* @__PURE__ */ H(fe, { children: [/* @__PURE__ */ V(pe, { children: "Dismiss this driver?" }), /* @__PURE__ */ V(ue, { children: "This records the driver as dismissed and requires a reason. It cannot be undone from here." })] }),
585
- /* @__PURE__ */ H("div", {
609
+ /* @__PURE__ */ z(U, {
610
+ open: Se,
611
+ onOpenChange: Z,
612
+ children: /* @__PURE__ */ B(fe, { children: [
613
+ /* @__PURE__ */ B(he, { children: [/* @__PURE__ */ z(ge, { children: "Delete this driver?" }), /* @__PURE__ */ B(pe, { children: [
614
+ "This removes ",
615
+ `${M.firstName} ${M.lastName}`.trim() || "this driver",
616
+ " and unlinks them from any vehicle. It cannot be undone from here."
617
+ ] })] }),
618
+ /* @__PURE__ */ z("div", {
619
+ className: "px-1",
620
+ children: /* @__PURE__ */ z(j, { message: we })
621
+ }),
622
+ /* @__PURE__ */ B(me, { children: [/* @__PURE__ */ z(h, {
623
+ variant: "outline",
624
+ onClick: () => Z(!1),
625
+ disabled: Q,
626
+ children: "Cancel"
627
+ }), /* @__PURE__ */ z(h, {
628
+ className: "bg-status-error-text text-text-inverse hover:opacity-90",
629
+ onClick: Be,
630
+ disabled: Q,
631
+ children: Q ? "Deleting..." : "Delete driver"
632
+ })] })
633
+ ] })
634
+ }),
635
+ /* @__PURE__ */ z(U, {
636
+ open: K,
637
+ onOpenChange: q,
638
+ children: /* @__PURE__ */ B(fe, { children: [
639
+ /* @__PURE__ */ B(he, { children: [/* @__PURE__ */ z(ge, { children: "Dismiss this driver?" }), /* @__PURE__ */ z(pe, { children: "This records the driver as dismissed and requires a reason. It cannot be undone from here." })] }),
640
+ /* @__PURE__ */ B("div", {
586
641
  className: "space-y-2 px-1",
587
642
  children: [
588
- /* @__PURE__ */ H(C, {
643
+ /* @__PURE__ */ B(x, {
589
644
  htmlFor: "dismissReason",
590
- children: ["Reason ", /* @__PURE__ */ V("span", {
645
+ children: ["Reason ", /* @__PURE__ */ z("span", {
591
646
  className: "text-status-error-text",
592
647
  children: "*"
593
648
  })]
594
649
  }),
595
- /* @__PURE__ */ V(O, {
650
+ /* @__PURE__ */ z(D, {
596
651
  id: "dismissReason",
597
- value: Y,
598
- onChange: (e) => ge(e.target.value),
652
+ value: J,
653
+ onChange: (e) => ye(e.target.value),
599
654
  placeholder: "e.g. Repeated policy violations, voluntary resignation, performance...",
600
655
  rows: 3
601
656
  }),
602
- /* @__PURE__ */ V(P, { message: ve })
657
+ /* @__PURE__ */ z(j, { message: xe })
603
658
  ]
604
659
  }),
605
- /* @__PURE__ */ H(de, { children: [/* @__PURE__ */ V(_, {
660
+ /* @__PURE__ */ B(me, { children: [/* @__PURE__ */ z(h, {
606
661
  variant: "outline",
607
- onClick: () => J(!1),
608
- disabled: X,
662
+ onClick: () => q(!1),
663
+ disabled: Y,
609
664
  children: "Cancel"
610
- }), /* @__PURE__ */ V(_, {
665
+ }), /* @__PURE__ */ z(h, {
611
666
  className: "bg-status-error-text text-text-inverse hover:opacity-90",
612
- onClick: je,
613
- disabled: X,
614
- children: X ? "Dismissing..." : "Confirm dismissal"
667
+ onClick: ze,
668
+ disabled: Y,
669
+ children: Y ? "Dismissing..." : "Confirm dismissal"
615
670
  })] })
616
671
  ] })
617
672
  })
618
673
  ]
619
674
  });
620
675
  }
621
- function J() {
622
- let { driverId: a } = B(), l = z().pathname.endsWith("/edit"), { basePath: f, navigate: m } = te(), { driver: g, isLoading: S, error: C, refetch: ne } = p(a), { vehicle: w } = h(g?.assignedVehicle), T = () => m?.(d(f, "fleet/drivers")), E = (e) => m?.(d(f, e));
623
- if (!a) return /* @__PURE__ */ V(q, {});
624
- if (l) return /* @__PURE__ */ V(q, { editId: a });
625
- if (S) return /* @__PURE__ */ V(A, { message: "Loading driver details..." });
626
- if (C || !g) return /* @__PURE__ */ V(k, {
676
+ function q() {
677
+ let { driverId: a } = R(), c = L().pathname.endsWith("/edit"), { basePath: u, navigate: p } = te(), { driver: m, isLoading: ie, error: b, refetch: x } = ne(a);
678
+ F(c, x);
679
+ let { vehicle: S } = re(m?.assignedVehicle), C = () => p?.(f(u, "fleet/drivers")), w = (e) => p?.(f(u, e));
680
+ if (!a) return /* @__PURE__ */ z(K, {});
681
+ if (c) return /* @__PURE__ */ z(K, { editId: a });
682
+ if (ie) return /* @__PURE__ */ z(O, { message: "Loading driver details..." });
683
+ if (b || !m) return /* @__PURE__ */ z(ae, {
627
684
  title: "Driver not found",
628
- onRetry: ne
685
+ onRetry: x
629
686
  });
630
- let D = !!g.terminatedAt, O = g.onLeaveUntil && g.onLeaveUntil.getTime() > (/* @__PURE__ */ new Date()).getTime() ? g.onLeaveUntil : void 0, M = g.baseSalary !== void 0 || g.bonusYtd !== void 0;
631
- return /* @__PURE__ */ H(j, {
632
- title: g.fullName,
633
- subtitle: `Employee ID: ${g.employeeId}`,
634
- icon: /* @__PURE__ */ V(u, { size: 24 }),
635
- headerActions: /* @__PURE__ */ H("div", {
687
+ let T = !!m.terminatedAt, E = m.onLeaveUntil && m.onLeaveUntil.getTime() > (/* @__PURE__ */ new Date()).getTime() ? m.onLeaveUntil : void 0, D = m.baseSalary !== void 0 || m.bonusYtd !== void 0;
688
+ return /* @__PURE__ */ B(oe, {
689
+ title: m.fullName,
690
+ subtitle: `Employee ID: ${m.employeeId}`,
691
+ icon: /* @__PURE__ */ z(d, { size: 24 }),
692
+ headerActions: /* @__PURE__ */ B("div", {
636
693
  className: "flex gap-2",
637
- children: [/* @__PURE__ */ H(_, {
694
+ children: [/* @__PURE__ */ B(h, {
638
695
  variant: "outline",
639
- onClick: T,
640
- children: [/* @__PURE__ */ V(e, { size: 16 }), " Back"]
641
- }), /* @__PURE__ */ H(_, {
642
- onClick: () => m?.(d(f, "fleet/drivers/" + a + "/edit")),
643
- children: [/* @__PURE__ */ V(o, { size: 16 }), " Edit"]
696
+ onClick: C,
697
+ children: [/* @__PURE__ */ z(e, { size: 16 }), " Back"]
698
+ }), /* @__PURE__ */ B(h, {
699
+ onClick: () => p?.(f(u, "fleet/drivers/" + a + "/edit")),
700
+ children: [/* @__PURE__ */ z(o, { size: 16 }), " Edit"]
644
701
  })]
645
702
  }),
646
- headerContent: /* @__PURE__ */ H("div", {
703
+ headerContent: /* @__PURE__ */ B("div", {
647
704
  className: "flex flex-wrap items-center gap-4",
648
705
  children: [
649
- /* @__PURE__ */ V(N, {
650
- status: g.status,
706
+ /* @__PURE__ */ z(A, {
707
+ status: m.status,
651
708
  type: "driver"
652
709
  }),
653
- D && /* @__PURE__ */ V(N, {
710
+ T && /* @__PURE__ */ z(A, {
654
711
  status: "dismissed",
655
712
  label: "Dismissed",
656
713
  customColors: {
@@ -658,168 +715,168 @@ function J() {
658
715
  text: "text-status-error-text"
659
716
  }
660
717
  }),
661
- O && !D && /* @__PURE__ */ V(N, {
718
+ E && !T && /* @__PURE__ */ z(A, {
662
719
  status: "on_leave",
663
- label: `On leave until ${I(O, "short")}`,
720
+ label: `On leave until ${N(E, "short")}`,
664
721
  customColors: {
665
722
  bg: "bg-status-warning-bg-subtle",
666
723
  text: "text-status-warning-text"
667
724
  }
668
725
  }),
669
- g.rating !== void 0 && /* @__PURE__ */ H("div", {
726
+ m.rating !== void 0 && /* @__PURE__ */ B("div", {
670
727
  className: "flex items-center gap-1",
671
- children: [/* @__PURE__ */ V(s, {
728
+ children: [/* @__PURE__ */ z(s, {
672
729
  size: 16,
673
730
  className: "text-status-warning-text fill-current"
674
- }), /* @__PURE__ */ V("span", {
731
+ }), /* @__PURE__ */ z("span", {
675
732
  className: "font-medium",
676
- children: g.rating.toFixed(1)
733
+ children: m.rating.toFixed(1)
677
734
  })]
678
735
  })
679
736
  ]
680
737
  }),
681
738
  children: [
682
- /* @__PURE__ */ V(W, {
683
- icon: /* @__PURE__ */ V(u, { size: 18 }),
739
+ /* @__PURE__ */ z(H, {
740
+ icon: /* @__PURE__ */ z(d, { size: 18 }),
684
741
  children: "A driver's full profile — licensing, assigned vehicle, documents and HR record. Use it to confirm someone is road-ready and compliant before assigning them an order or route."
685
742
  }),
686
- /* @__PURE__ */ V(U, {
743
+ /* @__PURE__ */ z(V, {
687
744
  storageKey: "movethewheels-driver-details",
688
745
  steps: [
689
746
  {
690
747
  id: "assign",
691
748
  label: "Assign to an order",
692
749
  description: "Hand a pending delivery to this driver.",
693
- icon: /* @__PURE__ */ V(i, { size: 16 }),
694
- onClick: () => E("orders")
750
+ icon: /* @__PURE__ */ z(i, { size: 16 }),
751
+ onClick: () => w("orders")
695
752
  },
696
753
  {
697
754
  id: "routes",
698
755
  label: "Plan their route",
699
756
  description: "Batch nearby drop-offs into an optimized itinerary.",
700
- icon: /* @__PURE__ */ V(t, { size: 16 }),
701
- onClick: () => E("routes")
757
+ icon: /* @__PURE__ */ z(t, { size: 16 }),
758
+ onClick: () => w("routes")
702
759
  },
703
760
  {
704
761
  id: "edit",
705
762
  label: "Update driver record",
706
763
  description: "Refresh documents, license or HR details.",
707
- icon: /* @__PURE__ */ V(o, { size: 16 }),
764
+ icon: /* @__PURE__ */ z(o, { size: 16 }),
708
765
  onClick: () => {}
709
766
  }
710
767
  ]
711
768
  }),
712
- D && /* @__PURE__ */ H("div", {
769
+ T && /* @__PURE__ */ B("div", {
713
770
  className: "rounded-card border border-status-error-border bg-status-error-bg-subtle p-4 text-sm text-status-error-text",
714
- children: [/* @__PURE__ */ H("p", {
771
+ children: [/* @__PURE__ */ B("p", {
715
772
  className: "font-medium",
716
- children: ["Dismissed ", g.terminatedAt && I(g.terminatedAt, "full")]
717
- }), g.terminationReason && /* @__PURE__ */ H("p", {
773
+ children: ["Dismissed ", m.terminatedAt && N(m.terminatedAt, "full")]
774
+ }), m.terminationReason && /* @__PURE__ */ B("p", {
718
775
  className: "mt-1",
719
- children: ["Reason: ", g.terminationReason]
776
+ children: ["Reason: ", m.terminationReason]
720
777
  })]
721
778
  }),
722
- /* @__PURE__ */ H("div", {
779
+ /* @__PURE__ */ B("div", {
723
780
  className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
724
- children: [/* @__PURE__ */ H("div", {
781
+ children: [/* @__PURE__ */ B("div", {
725
782
  className: "lg:col-span-2 space-y-6",
726
783
  children: [
727
- /* @__PURE__ */ H(v, { children: [/* @__PURE__ */ V(b, { children: /* @__PURE__ */ H(x, {
784
+ /* @__PURE__ */ B(g, { children: [/* @__PURE__ */ z(v, { children: /* @__PURE__ */ B(y, {
728
785
  className: "flex items-center gap-2",
729
- children: [/* @__PURE__ */ V(r, { size: 18 }), " License"]
730
- }) }), /* @__PURE__ */ V(y, { children: /* @__PURE__ */ V("div", {
786
+ children: [/* @__PURE__ */ z(r, { size: 18 }), " License"]
787
+ }) }), /* @__PURE__ */ z(_, { children: /* @__PURE__ */ z("div", {
731
788
  className: "flex items-center justify-between p-3 border rounded-lg",
732
- children: /* @__PURE__ */ H("div", { children: [
733
- /* @__PURE__ */ V("p", {
789
+ children: /* @__PURE__ */ B("div", { children: [
790
+ /* @__PURE__ */ z("p", {
734
791
  className: "font-medium",
735
792
  children: "Driver's License"
736
793
  }),
737
- /* @__PURE__ */ H("p", {
794
+ /* @__PURE__ */ B("p", {
738
795
  className: "text-sm text-text-secondary",
739
- children: [g.licenseNumber || "—", g.licenseType ? ` - ${g.licenseType}` : ""]
796
+ children: [m.licenseNumber || "—", m.licenseType ? ` - ${m.licenseType}` : ""]
740
797
  }),
741
- /* @__PURE__ */ V("p", {
798
+ /* @__PURE__ */ z("p", {
742
799
  className: "text-sm text-text-secondary",
743
- children: g.licenseExpiry ? `Expires: ${I(g.licenseExpiry)}` : "Expiry not recorded"
800
+ children: m.licenseExpiry ? `Expires: ${N(m.licenseExpiry)}` : "Expiry not recorded"
744
801
  })
745
802
  ] })
746
803
  }) })] }),
747
- g.notes && /* @__PURE__ */ H(v, { children: [/* @__PURE__ */ V(b, { children: /* @__PURE__ */ H(x, {
804
+ m.notes && /* @__PURE__ */ B(g, { children: [/* @__PURE__ */ z(v, { children: /* @__PURE__ */ B(y, {
748
805
  className: "flex items-center gap-2",
749
- children: [/* @__PURE__ */ V(ee, { size: 18 }), " HR Notes"]
750
- }) }), /* @__PURE__ */ V(y, { children: /* @__PURE__ */ V("p", {
806
+ children: [/* @__PURE__ */ z(ee, { size: 18 }), " HR Notes"]
807
+ }) }), /* @__PURE__ */ z(_, { children: /* @__PURE__ */ z("p", {
751
808
  className: "text-sm whitespace-pre-wrap",
752
- children: g.notes
809
+ children: m.notes
753
810
  }) })] }),
754
- /* @__PURE__ */ V(L, {
811
+ /* @__PURE__ */ z(P, {
755
812
  entityType: "driver",
756
- entityId: g.id
813
+ entityId: m.id
757
814
  })
758
815
  ]
759
- }), /* @__PURE__ */ H("div", {
816
+ }), /* @__PURE__ */ B("div", {
760
817
  className: "space-y-6",
761
818
  children: [
762
- /* @__PURE__ */ H(v, { children: [/* @__PURE__ */ V(b, { children: /* @__PURE__ */ H(x, {
819
+ /* @__PURE__ */ B(g, { children: [/* @__PURE__ */ z(v, { children: /* @__PURE__ */ B(y, {
763
820
  className: "flex items-center gap-2",
764
- children: [/* @__PURE__ */ V(c, { size: 18 }), " Assigned Vehicle"]
765
- }) }), /* @__PURE__ */ V(y, { children: g.assignedVehicle ? w ? /* @__PURE__ */ H("button", {
821
+ children: [/* @__PURE__ */ z(l, { size: 18 }), " Assigned Vehicle"]
822
+ }) }), /* @__PURE__ */ z(_, { children: m.assignedVehicle ? S ? /* @__PURE__ */ B("button", {
766
823
  type: "button",
767
824
  className: "text-sm font-medium text-primary hover:underline",
768
- onClick: () => E(`fleet/vehicles/${w.id}`),
825
+ onClick: () => w(`fleet/vehicles/${S.id}`),
769
826
  children: [
770
- w.vehicleNumber,
827
+ S.vehicleNumber,
771
828
  " (",
772
- w.type,
829
+ S.type,
773
830
  ")"
774
831
  ]
775
- }) : /* @__PURE__ */ V("p", {
832
+ }) : /* @__PURE__ */ z("p", {
776
833
  className: "text-sm text-text-secondary",
777
834
  children: "Loading…"
778
- }) : /* @__PURE__ */ V("p", {
835
+ }) : /* @__PURE__ */ z("p", {
779
836
  className: "text-sm text-text-secondary",
780
837
  children: "No vehicle assigned"
781
838
  }) })] }),
782
- /* @__PURE__ */ H(v, { children: [/* @__PURE__ */ V(b, { children: /* @__PURE__ */ V(x, { children: "Record" }) }), /* @__PURE__ */ V(y, {
839
+ /* @__PURE__ */ B(g, { children: [/* @__PURE__ */ z(v, { children: /* @__PURE__ */ z(y, { children: "Record" }) }), /* @__PURE__ */ z(_, {
783
840
  className: "space-y-4",
784
- children: /* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V("p", {
841
+ children: /* @__PURE__ */ B("div", { children: [/* @__PURE__ */ z("p", {
785
842
  className: "text-sm text-text-secondary",
786
843
  children: "Hire Date"
787
- }), /* @__PURE__ */ V("p", {
844
+ }), /* @__PURE__ */ z("p", {
788
845
  className: "font-medium",
789
- children: g.hireDate ? I(g.hireDate) : "Not recorded"
846
+ children: m.hireDate ? N(m.hireDate) : "Not recorded"
790
847
  })] })
791
848
  })] }),
792
- /* @__PURE__ */ H(v, { children: [/* @__PURE__ */ V(b, { children: /* @__PURE__ */ H(x, {
849
+ /* @__PURE__ */ B(g, { children: [/* @__PURE__ */ z(v, { children: /* @__PURE__ */ B(y, {
793
850
  className: "flex items-center gap-2",
794
- children: [/* @__PURE__ */ V(n, { size: 18 }), " Compensation"]
795
- }) }), /* @__PURE__ */ V(y, {
851
+ children: [/* @__PURE__ */ z(n, { size: 18 }), " Compensation"]
852
+ }) }), /* @__PURE__ */ z(_, {
796
853
  className: "space-y-3",
797
- children: M ? /* @__PURE__ */ H(oe, { children: [g.baseSalary !== void 0 && /* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V("p", {
854
+ children: D ? /* @__PURE__ */ B(ue, { children: [m.baseSalary !== void 0 && /* @__PURE__ */ B("div", { children: [/* @__PURE__ */ z("p", {
798
855
  className: "text-sm text-text-secondary",
799
856
  children: "Base Salary"
800
- }), /* @__PURE__ */ H("p", {
857
+ }), /* @__PURE__ */ B("p", {
801
858
  className: "font-medium",
802
- children: [F(g.baseSalary, g.payCurrency || void 0), "/year"]
803
- })] }), g.bonusYtd !== void 0 && /* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V("p", {
859
+ children: [M(m.baseSalary, m.payCurrency || void 0), "/year"]
860
+ })] }), m.bonusYtd !== void 0 && /* @__PURE__ */ B("div", { children: [/* @__PURE__ */ z("p", {
804
861
  className: "text-sm text-text-secondary",
805
862
  children: "Bonus (YTD)"
806
- }), /* @__PURE__ */ V("p", {
863
+ }), /* @__PURE__ */ z("p", {
807
864
  className: "font-medium",
808
- children: F(g.bonusYtd, g.payCurrency || void 0)
809
- })] })] }) : /* @__PURE__ */ V("p", {
865
+ children: M(m.bonusYtd, m.payCurrency || void 0)
866
+ })] })] }) : /* @__PURE__ */ z("p", {
810
867
  className: "text-sm text-text-secondary",
811
868
  children: "Not recorded"
812
869
  })
813
870
  })] }),
814
- g.currentLocation && /* @__PURE__ */ H(v, { children: [/* @__PURE__ */ V(b, { children: /* @__PURE__ */ H(x, {
871
+ m.currentLocation && /* @__PURE__ */ B(g, { children: [/* @__PURE__ */ z(v, { children: /* @__PURE__ */ B(y, {
815
872
  className: "flex items-center gap-2",
816
- children: [/* @__PURE__ */ V(i, { size: 18 }), " Current Location"]
817
- }) }), /* @__PURE__ */ H(y, { children: [/* @__PURE__ */ V("p", {
873
+ children: [/* @__PURE__ */ z(i, { size: 18 }), " Current Location"]
874
+ }) }), /* @__PURE__ */ B(_, { children: [/* @__PURE__ */ z("p", {
818
875
  className: "text-sm",
819
- children: g.currentLocation.address || "Location updating..."
820
- }), /* @__PURE__ */ V("p", {
876
+ children: m.currentLocation.address || "Location updating..."
877
+ }), /* @__PURE__ */ z("p", {
821
878
  className: "text-xs text-text-secondary mt-1",
822
- children: g.currentLocation.timestamp ? `Updated ${I(g.currentLocation.timestamp, "relative")}` : "Update time not recorded"
879
+ children: m.currentLocation.timestamp ? `Updated ${N(m.currentLocation.timestamp, "relative")}` : "Update time not recorded"
823
880
  })] })] })
824
881
  ]
825
882
  })]
@@ -828,4 +885,4 @@ function J() {
828
885
  });
829
886
  }
830
887
  //#endregion
831
- export { J as default };
888
+ export { q as default };