@burdenoff/microfe-movethewheels 2026.929.3 → 2026.930.1

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