@burdenoff/microfe-movethewheels 2026.925.2 → 2026.925.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.
Files changed (38) hide show
  1. package/dist/components/StatusBadge.js +30 -30
  2. package/dist/constants/index.js +12 -5
  3. package/dist/hooks/useCustomers.js +0 -3
  4. package/dist/hooks/useFleet.js +144 -131
  5. package/dist/hooks/useInventory.js +144 -145
  6. package/dist/hooks/useRoutes.js +5 -14
  7. package/dist/movethewheels/constants/index.d.ts +1 -0
  8. package/dist/movethewheels/hooks/useFleet.d.ts +13 -1
  9. package/dist/movethewheels/hooks/useInventory.d.ts +10 -0
  10. package/dist/movethewheels/types/index.d.ts +13 -70
  11. package/dist/pages/CustomerDetailsPage.js +666 -344
  12. package/dist/pages/CustomersPage.js +71 -80
  13. package/dist/pages/FleetPage.js +1 -3
  14. package/dist/pages/InventoryPage.js +4 -4
  15. package/dist/pages/RouteDetailsPage.js +273 -248
  16. package/dist/pages/RoutesPage.js +130 -67
  17. package/dist/pages/VehicleDetailsPage.js +506 -391
  18. package/dist/pages/VehiclesPage.js +119 -70
  19. package/dist/pages/WarehouseDetailsPage.js +410 -370
  20. package/dist/pages/WarehousesPage.js +131 -82
  21. package/package.json +1 -1
  22. package/src/movethewheels/components/StatusBadge.tsx +8 -3
  23. package/src/movethewheels/constants/index.ts +9 -0
  24. package/src/movethewheels/hooks/useCustomers.ts +0 -3
  25. package/src/movethewheels/hooks/useFleet.ts +74 -19
  26. package/src/movethewheels/hooks/useInventory.ts +76 -32
  27. package/src/movethewheels/hooks/useRoutes.ts +17 -12
  28. package/src/movethewheels/pages/CustomerDetailsPage.tsx +376 -109
  29. package/src/movethewheels/pages/CustomersPage.tsx +6 -15
  30. package/src/movethewheels/pages/FleetPage.tsx +2 -1
  31. package/src/movethewheels/pages/InventoryPage.tsx +14 -5
  32. package/src/movethewheels/pages/RouteDetailsPage.tsx +74 -34
  33. package/src/movethewheels/pages/RoutesPage.tsx +66 -2
  34. package/src/movethewheels/pages/VehicleDetailsPage.tsx +151 -11
  35. package/src/movethewheels/pages/VehiclesPage.tsx +68 -3
  36. package/src/movethewheels/pages/WarehouseDetailsPage.tsx +213 -135
  37. package/src/movethewheels/pages/WarehousesPage.tsx +77 -16
  38. package/src/movethewheels/types/index.ts +14 -70
@@ -5,27 +5,29 @@ import { MapPin as r } from "../node_modules/lucide-react/dist/esm/icons/map-pin
5
5
  import { Phone as i } from "../node_modules/lucide-react/dist/esm/icons/phone.js";
6
6
  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
- import { Truck as s } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
9
- import { UserRound as c } from "../node_modules/lucide-react/dist/esm/icons/user-round.js";
10
- import { joinPath as l } from "../utils/navigation.js";
11
- import { useMoveTheWheels as u } from "../providers/MoveTheWheelsProvider.js";
12
- import { toApiVehicleStatus as d, useFleet as f, useVehicle as p, useVehicleDrivers as m } from "../hooks/useFleet.js";
13
- import { Avatar as h, AvatarFallback as g, Button as _, Card as v, CardContent as y, CardHeader as b, CardTitle as x, Input as S, Label as C, Progress as w, Select as T, SelectContent as E, SelectItem as D, SelectTrigger as O, SelectValue as k } from "../components/ui.js";
14
- import { ErrorState as A, LoadingState as j, PageLayout as M } from "../components/PageLayout.js";
15
- import { StatusBadge as N, VehicleTypeBadge as P } from "../components/StatusBadge.js";
16
- import { FormError as F } from "../components/FormError.js";
17
- import { Notice as I, useNotice as L } from "../components/Notice.js";
18
- import { formatDate as R, getInitials as z } from "../utils/formatters.js";
19
- import { DocumentsCard as B } from "../components/DocumentsCard.js";
20
- import { useRecordVehicleService as V } from "../hooks/useFleetIntelligence.js";
21
- import { VehicleServiceCard as ee } from "../components/VehicleServiceCard.js";
22
- import { useEffect as H, useState as U } from "react";
23
- import { useLocation as te, useParams as ne } from "react-router";
24
- import { jsx as W, jsxs as G } from "react/jsx-runtime";
25
- import { useI18n as re } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
26
- import { EmphasisPanel as K, NextSteps as ie, PagePurpose as q } from "@burdenoff/fe-libs/ui";
8
+ import { Trash2 as s } from "../node_modules/lucide-react/dist/esm/icons/trash-2.js";
9
+ import { Truck as c } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
10
+ import { UserRound as l } from "../node_modules/lucide-react/dist/esm/icons/user-round.js";
11
+ import { joinPath as u } from "../utils/navigation.js";
12
+ import { useMoveTheWheels as d } from "../providers/MoveTheWheelsProvider.js";
13
+ import { toApiVehicleStatus as f, useFleet as p, useVehicle as m, useVehicleDrivers as h } from "../hooks/useFleet.js";
14
+ import { Avatar as g, AvatarFallback as _, Button as v, Card as y, CardContent as b, CardHeader as x, CardTitle as S, Input as C, Label as w, Progress as T, Select as E, SelectContent as D, SelectItem as O, SelectTrigger as k, SelectValue as A } from "../components/ui.js";
15
+ import { ErrorState as j, LoadingState as M, PageLayout as N } from "../components/PageLayout.js";
16
+ import { VEHICLE_STATUS_LABELS as P } from "../constants/index.js";
17
+ import { StatusBadge as F, VehicleTypeBadge as I } from "../components/StatusBadge.js";
18
+ import { FormError as L } from "../components/FormError.js";
19
+ import { Notice as R, useNotice as z } from "../components/Notice.js";
20
+ import { formatDate as B, getInitials as V } from "../utils/formatters.js";
21
+ import { DocumentsCard as H } from "../components/DocumentsCard.js";
22
+ import { useRecordVehicleService as U } from "../hooks/useFleetIntelligence.js";
23
+ import { VehicleServiceCard as W } from "../components/VehicleServiceCard.js";
24
+ import { useEffect as G, useState as K } from "react";
25
+ import { useLocation as ee, useParams as te } from "react-router";
26
+ import { jsx as q, jsxs as J } from "react/jsx-runtime";
27
+ import { useI18n as ne } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
28
+ import { EmphasisPanel as Y, NextSteps as re, PagePurpose as X, ResponsiveDialog as Z, ResponsiveDialogContent as Q, ResponsiveDialogDescription as $, ResponsiveDialogFooter as ie, ResponsiveDialogHeader as ae, ResponsiveDialogTitle as oe } from "@burdenoff/fe-libs/ui";
27
29
  //#region src/movethewheels/pages/VehicleDetailsPage.tsx
28
- var J = [
30
+ var se = [
29
31
  {
30
32
  value: "TRUCK",
31
33
  label: "Truck"
@@ -58,24 +60,10 @@ var J = [
58
60
  value: "DRONE",
59
61
  label: "Drone"
60
62
  }
61
- ], Y = [
62
- {
63
- value: "available",
64
- label: "Available"
65
- },
66
- {
67
- value: "assigned",
68
- label: "In Transit"
69
- },
70
- {
71
- value: "maintenance",
72
- label: "Maintenance"
73
- },
74
- {
75
- value: "out_of_service",
76
- label: "Out of Service"
77
- }
78
- ], X = [
63
+ ], ce = Object.entries(P).map(([e, t]) => ({
64
+ value: e,
65
+ label: t
66
+ })), le = [
79
67
  {
80
68
  value: "owned",
81
69
  label: "Owned"
@@ -89,8 +77,8 @@ var J = [
89
77
  label: "Rented"
90
78
  }
91
79
  ];
92
- function Z({ editId: t }) {
93
- let { basePath: n, navigate: r } = u(), { createVehicle: i, updateVehicle: o } = f(), { vehicle: c } = p(t), m = !!t, [h, g] = U({
80
+ function ue({ editId: t }) {
81
+ let { basePath: n, navigate: r } = d(), { createVehicle: i, updateVehicle: o, deleteVehicle: l } = p(), { vehicle: h } = m(t), g = !!t, [_, T] = K({
94
82
  vehicleNumber: "",
95
83
  type: "VAN",
96
84
  make: "",
@@ -100,498 +88,625 @@ function Z({ editId: t }) {
100
88
  year: "",
101
89
  status: "available",
102
90
  fuelType: "",
103
- fuelEfficiencyLPer100Km: ""
104
- }), [v, y] = U(!1), [b, x] = U(null);
105
- H(() => {
106
- t && c && g({
107
- vehicleNumber: c.vehicleNumber ?? "",
108
- type: c.type ? c.type.toUpperCase() : "VAN",
109
- make: c.make ?? "",
110
- model: c.model ?? "",
111
- licensePlate: c.licensePlate ?? "",
112
- ownershipType: c.ownershipType ?? "",
113
- year: c.year ? String(c.year) : "",
114
- status: c.status,
115
- fuelType: c.fuelType ?? "",
116
- fuelEfficiencyLPer100Km: c.fuelEfficiencyLPer100Km === void 0 ? "" : String(c.fuelEfficiencyLPer100Km)
91
+ fuelEfficiencyLPer100Km: "",
92
+ capacityWeight: "",
93
+ capacityVolume: "",
94
+ capacityPallets: ""
95
+ }), [j, M] = K(!1), [P, F] = K(null), [I, R] = K(!1), [z, B] = K(!1), [V, H] = K(null);
96
+ G(() => {
97
+ t && h && T({
98
+ vehicleNumber: h.vehicleNumber ?? "",
99
+ type: h.type ? h.type.toUpperCase() : "VAN",
100
+ make: h.make ?? "",
101
+ model: h.model ?? "",
102
+ licensePlate: h.licensePlate ?? "",
103
+ ownershipType: h.ownershipType ?? "",
104
+ year: h.year ? String(h.year) : "",
105
+ status: h.status,
106
+ fuelType: h.fuelType ?? "",
107
+ fuelEfficiencyLPer100Km: h.fuelEfficiencyLPer100Km === void 0 ? "" : String(h.fuelEfficiencyLPer100Km),
108
+ capacityWeight: h.capacity.weight ? String(h.capacity.weight) : "",
109
+ capacityVolume: h.capacity.volume ? String(h.capacity.volume) : "",
110
+ capacityPallets: h.capacity.pallets ? String(h.capacity.pallets) : ""
117
111
  });
118
- }, [t, c]);
119
- let w = () => r?.(l(n, "fleet/vehicles")), A = async (e) => {
120
- if (e.preventDefault(), !h.vehicleNumber.trim()) {
121
- x("Vehicle number is required.");
112
+ }, [t, h]);
113
+ let U = () => r?.(u(n, "fleet/vehicles")), W = async (e) => {
114
+ if (e.preventDefault(), !_.vehicleNumber.trim()) {
115
+ F("Vehicle number is required.");
122
116
  return;
123
117
  }
124
- y(!0), x(null);
118
+ M(!0), F(null);
125
119
  try {
126
120
  let e = {
127
- vehicleNumber: h.vehicleNumber.trim(),
128
- type: h.type,
129
- make: h.make.trim() || void 0,
130
- model: h.model.trim() || void 0,
131
- licensePlate: h.licensePlate.trim() || void 0,
132
- ownershipType: h.ownershipType || void 0,
133
- year: h.year ? Number(h.year) : void 0,
134
- status: d(h.status),
135
- fuelType: h.fuelType || void 0,
136
- fuelEfficiencyLPer100Km: h.fuelEfficiencyLPer100Km ? Number(h.fuelEfficiencyLPer100Km) : void 0
121
+ vehicleNumber: _.vehicleNumber.trim(),
122
+ type: _.type,
123
+ make: _.make.trim() || void 0,
124
+ model: _.model.trim() || void 0,
125
+ licensePlate: _.licensePlate.trim() || void 0,
126
+ ownershipType: _.ownershipType || void 0,
127
+ year: _.year ? Number(_.year) : void 0,
128
+ status: f(_.status),
129
+ fuelType: _.fuelType || void 0,
130
+ fuelEfficiencyLPer100Km: _.fuelEfficiencyLPer100Km ? Number(_.fuelEfficiencyLPer100Km) : void 0,
131
+ capacity: _.capacityWeight || _.capacityVolume || _.capacityPallets ? {
132
+ weight: _.capacityWeight ? Number(_.capacityWeight) : void 0,
133
+ volume: _.capacityVolume ? Number(_.capacityVolume) : void 0,
134
+ pallets: _.capacityPallets ? Number(_.capacityPallets) : void 0
135
+ } : void 0
137
136
  };
138
137
  if (t) {
139
138
  let i = await o(t, e);
140
- r?.(l(n, `fleet/vehicles/${i.id}`));
139
+ r?.(u(n, `fleet/vehicles/${i.id}`));
141
140
  } else {
142
141
  let t = await i(e);
143
- r?.(l(n, `fleet/vehicles/${t.id}`));
142
+ r?.(u(n, `fleet/vehicles/${t.id}`));
144
143
  }
145
144
  } catch (e) {
146
- console.error("Failed to create vehicle:", e), x(e instanceof Error ? e.message : "Failed to create vehicle. Please try again."), y(!1);
145
+ console.error("Failed to create vehicle:", e), F(e instanceof Error ? e.message : "Failed to create vehicle. Please try again."), M(!1);
147
146
  }
148
147
  };
149
- return /* @__PURE__ */ G(M, {
150
- title: m ? "Edit Vehicle" : "Add Vehicle",
148
+ return /* @__PURE__ */ J(N, {
149
+ title: g ? "Edit Vehicle" : "Add Vehicle",
151
150
  subtitle: "Register a new vehicle in your fleet",
152
- icon: /* @__PURE__ */ W(s, { size: 24 }),
153
- headerActions: /* @__PURE__ */ G("div", {
151
+ icon: /* @__PURE__ */ q(c, { size: 24 }),
152
+ headerActions: /* @__PURE__ */ J("div", {
154
153
  className: "flex gap-2",
155
- children: [/* @__PURE__ */ G(_, {
154
+ children: [/* @__PURE__ */ J(v, {
156
155
  variant: "outline",
157
- onClick: w,
158
- disabled: v,
159
- children: [/* @__PURE__ */ W(e, { size: 16 }), " Cancel"]
160
- }), /* @__PURE__ */ G(_, {
161
- onClick: A,
162
- disabled: v,
156
+ onClick: U,
157
+ disabled: j,
158
+ children: [/* @__PURE__ */ q(e, { size: 16 }), " Cancel"]
159
+ }), /* @__PURE__ */ J(v, {
160
+ onClick: W,
161
+ disabled: j,
163
162
  children: [
164
- /* @__PURE__ */ W(a, { size: 16 }),
163
+ /* @__PURE__ */ q(a, { size: 16 }),
165
164
  " ",
166
- m ? v ? "Saving..." : "Save Changes" : v ? "Saving..." : "Add Vehicle"
165
+ g ? j ? "Saving..." : "Save Changes" : j ? "Saving..." : "Add Vehicle"
167
166
  ]
168
167
  })]
169
168
  }),
170
- children: [/* @__PURE__ */ W(q, {
171
- icon: /* @__PURE__ */ W(s, { size: 18 }),
172
- children: "Add a vehicle so it can be assigned to deliveries and routes. Give it a fleet number and type to start — make, model and plate help identify it on the road."
173
- }), /* @__PURE__ */ G("form", {
174
- onSubmit: A,
175
- className: "max-w-2xl space-y-6",
176
- children: [/* @__PURE__ */ W(F, { message: b }), /* @__PURE__ */ G(K, { children: [/* @__PURE__ */ W("h2", {
177
- className: "text-base font-semibold text-text-primary mb-4",
178
- children: "Vehicle Details"
179
- }), /* @__PURE__ */ G("div", {
180
- className: "space-y-4",
169
+ children: [
170
+ /* @__PURE__ */ q(X, {
171
+ icon: /* @__PURE__ */ q(c, { size: 18 }),
172
+ children: "Add a vehicle so it can be assigned to deliveries and routes. Give it a fleet number and type to start — make, model and plate help identify it on the road."
173
+ }),
174
+ /* @__PURE__ */ J("form", {
175
+ onSubmit: W,
176
+ className: "max-w-2xl space-y-6",
181
177
  children: [
182
- /* @__PURE__ */ G("div", {
183
- className: "grid grid-cols-1 md:grid-cols-2 gap-4",
184
- children: [/* @__PURE__ */ G("div", {
185
- className: "space-y-2",
186
- children: [/* @__PURE__ */ G(C, {
187
- htmlFor: "vehicleNumber",
188
- children: ["Vehicle Number ", /* @__PURE__ */ W("span", {
189
- className: "text-status-error-text",
190
- children: "*"
191
- })]
192
- }), /* @__PURE__ */ W(S, {
193
- id: "vehicleNumber",
194
- value: h.vehicleNumber,
195
- onChange: (e) => g((t) => ({
196
- ...t,
197
- vehicleNumber: e.target.value
198
- })),
199
- placeholder: "MTW-001",
200
- required: !0
201
- })]
202
- }), /* @__PURE__ */ G("div", {
203
- className: "space-y-2",
204
- children: [/* @__PURE__ */ G(C, {
205
- htmlFor: "type",
206
- children: ["Type ", /* @__PURE__ */ W("span", {
207
- className: "text-status-error-text",
208
- children: "*"
209
- })]
210
- }), /* @__PURE__ */ G(T, {
211
- value: h.type,
212
- onValueChange: (e) => g((t) => ({
213
- ...t,
214
- type: e
215
- })),
216
- children: [/* @__PURE__ */ W(O, {
217
- id: "type",
218
- children: /* @__PURE__ */ W(k, {})
219
- }), /* @__PURE__ */ W(E, { children: J.map((e) => /* @__PURE__ */ W(D, {
220
- value: e.value,
221
- children: e.label
222
- }, e.value)) })]
223
- })]
224
- })]
225
- }),
226
- /* @__PURE__ */ G("div", {
227
- className: "grid grid-cols-1 md:grid-cols-3 gap-4",
178
+ /* @__PURE__ */ q(L, { message: P }),
179
+ /* @__PURE__ */ J(Y, { children: [/* @__PURE__ */ q("h2", {
180
+ className: "text-base font-semibold text-text-primary mb-4",
181
+ children: "Vehicle Details"
182
+ }), /* @__PURE__ */ J("div", {
183
+ className: "space-y-4",
228
184
  children: [
229
- /* @__PURE__ */ G("div", {
230
- className: "space-y-2",
231
- children: [/* @__PURE__ */ W(C, {
232
- htmlFor: "make",
233
- children: "Make"
234
- }), /* @__PURE__ */ W(S, {
235
- id: "make",
236
- value: h.make,
237
- onChange: (e) => g((t) => ({
238
- ...t,
239
- make: e.target.value
240
- })),
241
- placeholder: "Ford"
185
+ /* @__PURE__ */ J("div", {
186
+ className: "grid grid-cols-1 md:grid-cols-2 gap-4",
187
+ children: [/* @__PURE__ */ J("div", {
188
+ className: "space-y-2",
189
+ children: [/* @__PURE__ */ J(w, {
190
+ htmlFor: "vehicleNumber",
191
+ children: ["Vehicle Number ", /* @__PURE__ */ q("span", {
192
+ className: "text-status-error-text",
193
+ children: "*"
194
+ })]
195
+ }), /* @__PURE__ */ q(C, {
196
+ id: "vehicleNumber",
197
+ value: _.vehicleNumber,
198
+ onChange: (e) => T((t) => ({
199
+ ...t,
200
+ vehicleNumber: e.target.value
201
+ })),
202
+ placeholder: "MTW-001",
203
+ required: !0
204
+ })]
205
+ }), /* @__PURE__ */ J("div", {
206
+ className: "space-y-2",
207
+ children: [/* @__PURE__ */ J(w, {
208
+ htmlFor: "type",
209
+ children: ["Type ", /* @__PURE__ */ q("span", {
210
+ className: "text-status-error-text",
211
+ children: "*"
212
+ })]
213
+ }), /* @__PURE__ */ J(E, {
214
+ value: _.type,
215
+ onValueChange: (e) => T((t) => ({
216
+ ...t,
217
+ type: e
218
+ })),
219
+ children: [/* @__PURE__ */ q(k, {
220
+ id: "type",
221
+ children: /* @__PURE__ */ q(A, {})
222
+ }), /* @__PURE__ */ q(D, { children: se.map((e) => /* @__PURE__ */ q(O, {
223
+ value: e.value,
224
+ children: e.label
225
+ }, e.value)) })]
226
+ })]
242
227
  })]
243
228
  }),
244
- /* @__PURE__ */ G("div", {
245
- className: "space-y-2",
246
- children: [/* @__PURE__ */ W(C, {
247
- htmlFor: "model",
248
- children: "Model"
249
- }), /* @__PURE__ */ W(S, {
250
- id: "model",
251
- value: h.model,
252
- onChange: (e) => g((t) => ({
253
- ...t,
254
- model: e.target.value
255
- })),
256
- placeholder: "Transit"
257
- })]
229
+ /* @__PURE__ */ J("div", {
230
+ className: "grid grid-cols-1 md:grid-cols-3 gap-4",
231
+ children: [
232
+ /* @__PURE__ */ J("div", {
233
+ className: "space-y-2",
234
+ children: [/* @__PURE__ */ q(w, {
235
+ htmlFor: "make",
236
+ children: "Make"
237
+ }), /* @__PURE__ */ q(C, {
238
+ id: "make",
239
+ value: _.make,
240
+ onChange: (e) => T((t) => ({
241
+ ...t,
242
+ make: e.target.value
243
+ })),
244
+ placeholder: "Ford"
245
+ })]
246
+ }),
247
+ /* @__PURE__ */ J("div", {
248
+ className: "space-y-2",
249
+ children: [/* @__PURE__ */ q(w, {
250
+ htmlFor: "model",
251
+ children: "Model"
252
+ }), /* @__PURE__ */ q(C, {
253
+ id: "model",
254
+ value: _.model,
255
+ onChange: (e) => T((t) => ({
256
+ ...t,
257
+ model: e.target.value
258
+ })),
259
+ placeholder: "Transit"
260
+ })]
261
+ }),
262
+ /* @__PURE__ */ J("div", {
263
+ className: "space-y-2",
264
+ children: [/* @__PURE__ */ q(w, {
265
+ htmlFor: "licensePlate",
266
+ children: "License Plate"
267
+ }), /* @__PURE__ */ q(C, {
268
+ id: "licensePlate",
269
+ value: _.licensePlate,
270
+ onChange: (e) => T((t) => ({
271
+ ...t,
272
+ licensePlate: e.target.value
273
+ })),
274
+ placeholder: "ABC-1234"
275
+ })]
276
+ })
277
+ ]
258
278
  }),
259
- /* @__PURE__ */ G("div", {
260
- className: "space-y-2",
261
- children: [/* @__PURE__ */ W(C, {
262
- htmlFor: "licensePlate",
263
- children: "License Plate"
264
- }), /* @__PURE__ */ W(S, {
265
- id: "licensePlate",
266
- value: h.licensePlate,
267
- onChange: (e) => g((t) => ({
268
- ...t,
269
- licensePlate: e.target.value
270
- })),
271
- placeholder: "ABC-1234"
272
- })]
273
- })
274
- ]
275
- }),
276
- /* @__PURE__ */ G("div", {
277
- className: "grid grid-cols-1 md:grid-cols-3 gap-4",
278
- children: [
279
- /* @__PURE__ */ G("div", {
280
- className: "space-y-2",
281
- children: [/* @__PURE__ */ W(C, {
282
- htmlFor: "ownershipType",
283
- children: "Ownership"
284
- }), /* @__PURE__ */ G(T, {
285
- value: h.ownershipType || void 0,
286
- onValueChange: (e) => g((t) => ({
287
- ...t,
288
- ownershipType: e
289
- })),
290
- children: [/* @__PURE__ */ W(O, {
291
- id: "ownershipType",
292
- children: /* @__PURE__ */ W(k, { placeholder: "Select ownership" })
293
- }), /* @__PURE__ */ W(E, { children: X.map((e) => /* @__PURE__ */ W(D, {
294
- value: e.value,
295
- children: e.label
296
- }, e.value)) })]
297
- })]
279
+ /* @__PURE__ */ J("div", {
280
+ className: "grid grid-cols-1 md:grid-cols-3 gap-4",
281
+ children: [
282
+ /* @__PURE__ */ J("div", {
283
+ className: "space-y-2",
284
+ children: [/* @__PURE__ */ q(w, {
285
+ htmlFor: "ownershipType",
286
+ children: "Ownership"
287
+ }), /* @__PURE__ */ J(E, {
288
+ value: _.ownershipType || void 0,
289
+ onValueChange: (e) => T((t) => ({
290
+ ...t,
291
+ ownershipType: e
292
+ })),
293
+ children: [/* @__PURE__ */ q(k, {
294
+ id: "ownershipType",
295
+ children: /* @__PURE__ */ q(A, { placeholder: "Select ownership" })
296
+ }), /* @__PURE__ */ q(D, { children: le.map((e) => /* @__PURE__ */ q(O, {
297
+ value: e.value,
298
+ children: e.label
299
+ }, e.value)) })]
300
+ })]
301
+ }),
302
+ /* @__PURE__ */ J("div", {
303
+ className: "space-y-2",
304
+ children: [/* @__PURE__ */ q(w, {
305
+ htmlFor: "year",
306
+ children: "Year"
307
+ }), /* @__PURE__ */ q(C, {
308
+ id: "year",
309
+ type: "number",
310
+ min: 1980,
311
+ max: (/* @__PURE__ */ new Date()).getFullYear() + 1,
312
+ value: _.year,
313
+ onChange: (e) => T((t) => ({
314
+ ...t,
315
+ year: e.target.value
316
+ })),
317
+ placeholder: String((/* @__PURE__ */ new Date()).getFullYear())
318
+ })]
319
+ }),
320
+ /* @__PURE__ */ J("div", {
321
+ className: "space-y-2",
322
+ children: [/* @__PURE__ */ q(w, {
323
+ htmlFor: "vehicleStatus",
324
+ children: "Status"
325
+ }), /* @__PURE__ */ J(E, {
326
+ value: _.status,
327
+ onValueChange: (e) => T((t) => ({
328
+ ...t,
329
+ status: e
330
+ })),
331
+ children: [/* @__PURE__ */ q(k, {
332
+ id: "vehicleStatus",
333
+ children: /* @__PURE__ */ q(A, {})
334
+ }), /* @__PURE__ */ q(D, { children: ce.map((e) => /* @__PURE__ */ q(O, {
335
+ value: e.value,
336
+ children: e.label
337
+ }, e.value)) })]
338
+ })]
339
+ })
340
+ ]
298
341
  }),
299
- /* @__PURE__ */ G("div", {
300
- className: "space-y-2",
301
- children: [/* @__PURE__ */ W(C, {
302
- htmlFor: "year",
303
- children: "Year"
304
- }), /* @__PURE__ */ W(S, {
305
- id: "year",
306
- type: "number",
307
- min: 1980,
308
- max: (/* @__PURE__ */ new Date()).getFullYear() + 1,
309
- value: h.year,
310
- onChange: (e) => g((t) => ({
311
- ...t,
312
- year: e.target.value
313
- })),
314
- placeholder: String((/* @__PURE__ */ new Date()).getFullYear())
342
+ /* @__PURE__ */ J("div", {
343
+ className: "grid grid-cols-1 md:grid-cols-2 gap-4",
344
+ children: [/* @__PURE__ */ J("div", {
345
+ className: "space-y-2",
346
+ children: [/* @__PURE__ */ q(w, {
347
+ htmlFor: "fuelType",
348
+ children: "Fuel Type"
349
+ }), /* @__PURE__ */ q(C, {
350
+ id: "fuelType",
351
+ value: _.fuelType,
352
+ onChange: (e) => T((t) => ({
353
+ ...t,
354
+ fuelType: e.target.value
355
+ })),
356
+ placeholder: "Diesel"
357
+ })]
358
+ }), /* @__PURE__ */ J("div", {
359
+ className: "space-y-2",
360
+ children: [/* @__PURE__ */ q(w, {
361
+ htmlFor: "fuelEfficiency",
362
+ children: "Fuel Efficiency (L/100km)"
363
+ }), /* @__PURE__ */ q(C, {
364
+ id: "fuelEfficiency",
365
+ type: "number",
366
+ min: 0,
367
+ step: .1,
368
+ value: _.fuelEfficiencyLPer100Km,
369
+ onChange: (e) => T((t) => ({
370
+ ...t,
371
+ fuelEfficiencyLPer100Km: e.target.value
372
+ })),
373
+ placeholder: "12.5"
374
+ })]
315
375
  })]
316
376
  }),
317
- /* @__PURE__ */ G("div", {
318
- className: "space-y-2",
319
- children: [/* @__PURE__ */ W(C, {
320
- htmlFor: "vehicleStatus",
321
- children: "Status"
322
- }), /* @__PURE__ */ G(T, {
323
- value: h.status,
324
- onValueChange: (e) => g((t) => ({
325
- ...t,
326
- status: e
327
- })),
328
- children: [/* @__PURE__ */ W(O, {
329
- id: "vehicleStatus",
330
- children: /* @__PURE__ */ W(k, {})
331
- }), /* @__PURE__ */ W(E, { children: Y.map((e) => /* @__PURE__ */ W(D, {
332
- value: e.value,
333
- children: e.label
334
- }, e.value)) })]
335
- })]
377
+ /* @__PURE__ */ J("div", {
378
+ className: "grid grid-cols-1 md:grid-cols-3 gap-4",
379
+ children: [
380
+ /* @__PURE__ */ J("div", {
381
+ className: "space-y-2",
382
+ children: [/* @__PURE__ */ q(w, {
383
+ htmlFor: "capacityWeight",
384
+ children: "Capacity — Weight (kg)"
385
+ }), /* @__PURE__ */ q(C, {
386
+ id: "capacityWeight",
387
+ type: "number",
388
+ min: 0,
389
+ value: _.capacityWeight,
390
+ onChange: (e) => T((t) => ({
391
+ ...t,
392
+ capacityWeight: e.target.value
393
+ })),
394
+ placeholder: "5000"
395
+ })]
396
+ }),
397
+ /* @__PURE__ */ J("div", {
398
+ className: "space-y-2",
399
+ children: [/* @__PURE__ */ q(w, {
400
+ htmlFor: "capacityVolume",
401
+ children: "Capacity — Volume (m³)"
402
+ }), /* @__PURE__ */ q(C, {
403
+ id: "capacityVolume",
404
+ type: "number",
405
+ min: 0,
406
+ step: .1,
407
+ value: _.capacityVolume,
408
+ onChange: (e) => T((t) => ({
409
+ ...t,
410
+ capacityVolume: e.target.value
411
+ })),
412
+ placeholder: "18"
413
+ })]
414
+ }),
415
+ /* @__PURE__ */ J("div", {
416
+ className: "space-y-2",
417
+ children: [/* @__PURE__ */ q(w, {
418
+ htmlFor: "capacityPallets",
419
+ children: "Capacity — Pallets"
420
+ }), /* @__PURE__ */ q(C, {
421
+ id: "capacityPallets",
422
+ type: "number",
423
+ min: 0,
424
+ value: _.capacityPallets,
425
+ onChange: (e) => T((t) => ({
426
+ ...t,
427
+ capacityPallets: e.target.value
428
+ })),
429
+ placeholder: "12"
430
+ })]
431
+ })
432
+ ]
336
433
  })
337
434
  ]
338
- }),
339
- /* @__PURE__ */ G("div", {
340
- className: "grid grid-cols-1 md:grid-cols-2 gap-4",
341
- children: [/* @__PURE__ */ G("div", {
342
- className: "space-y-2",
343
- children: [/* @__PURE__ */ W(C, {
344
- htmlFor: "fuelType",
345
- children: "Fuel Type"
346
- }), /* @__PURE__ */ W(S, {
347
- id: "fuelType",
348
- value: h.fuelType,
349
- onChange: (e) => g((t) => ({
350
- ...t,
351
- fuelType: e.target.value
352
- })),
353
- placeholder: "Diesel"
354
- })]
355
- }), /* @__PURE__ */ G("div", {
356
- className: "space-y-2",
357
- children: [/* @__PURE__ */ W(C, {
358
- htmlFor: "fuelEfficiency",
359
- children: "Fuel Efficiency (L/100km)"
360
- }), /* @__PURE__ */ W(S, {
361
- id: "fuelEfficiency",
362
- type: "number",
363
- min: 0,
364
- step: .1,
365
- value: h.fuelEfficiencyLPer100Km,
366
- onChange: (e) => g((t) => ({
367
- ...t,
368
- fuelEfficiencyLPer100Km: e.target.value
369
- })),
370
- placeholder: "12.5"
371
- })]
372
- })]
435
+ })] }),
436
+ g && /* @__PURE__ */ J(y, {
437
+ className: "border-status-error-border",
438
+ children: [/* @__PURE__ */ q(x, { children: /* @__PURE__ */ J(S, {
439
+ className: "flex items-center gap-2 text-status-error-text",
440
+ children: [/* @__PURE__ */ q(s, { size: 18 }), " Delete Vehicle"]
441
+ }) }), /* @__PURE__ */ J(b, { children: [/* @__PURE__ */ q("p", {
442
+ className: "mb-3 text-sm text-text-secondary",
443
+ children: "Removes this vehicle from the active fleet. It can no longer be assigned to drivers, orders, or routes. This cannot be undone from here."
444
+ }), /* @__PURE__ */ J(v, {
445
+ type: "button",
446
+ variant: "outline",
447
+ className: "border-status-error-border text-status-error-text hover:bg-status-error-bg-subtle",
448
+ onClick: () => R(!0),
449
+ children: [/* @__PURE__ */ q(s, { size: 16 }), " Delete this vehicle"]
450
+ })] })]
373
451
  })
374
452
  ]
375
- })] })]
376
- })]
453
+ }),
454
+ /* @__PURE__ */ q(Z, {
455
+ open: I,
456
+ onOpenChange: R,
457
+ children: /* @__PURE__ */ J(Q, { children: [
458
+ /* @__PURE__ */ J(ae, { children: [/* @__PURE__ */ q(oe, { children: "Delete this vehicle?" }), /* @__PURE__ */ J($, { children: [
459
+ "This removes ",
460
+ _.vehicleNumber || "this vehicle",
461
+ " from the active fleet. It cannot be undone from here."
462
+ ] })] }),
463
+ /* @__PURE__ */ q("div", {
464
+ className: "px-1",
465
+ children: /* @__PURE__ */ q(L, { message: V })
466
+ }),
467
+ /* @__PURE__ */ J(ie, { children: [/* @__PURE__ */ q(v, {
468
+ variant: "outline",
469
+ onClick: () => R(!1),
470
+ disabled: z,
471
+ children: "Cancel"
472
+ }), /* @__PURE__ */ q(v, {
473
+ className: "bg-status-error-text text-text-inverse hover:opacity-90",
474
+ onClick: async () => {
475
+ if (t) {
476
+ B(!0), H(null);
477
+ try {
478
+ await l(t), R(!1), r?.(u(n, "fleet/vehicles"));
479
+ } catch (e) {
480
+ H(e instanceof Error ? e.message : "Failed to delete vehicle.");
481
+ } finally {
482
+ B(!1);
483
+ }
484
+ }
485
+ },
486
+ disabled: z,
487
+ children: z ? "Deleting..." : "Delete vehicle"
488
+ })] })
489
+ ] })
490
+ })
491
+ ]
377
492
  });
378
493
  }
379
- function Q() {
380
- let { vehicleId: a } = ne(), { basePath: d, navigate: f } = u(), { vehicle: S, isLoading: C, error: T, refetch: E } = p(a), D = V(), { message: O, notify: k } = L(), { t: F } = re(), H = (e, t) => {
381
- let n = F(e);
494
+ function de() {
495
+ let { vehicleId: a } = te(), { basePath: s, navigate: f } = d(), { vehicle: p, isLoading: C, error: w, refetch: E } = m(a), D = U(), { message: O, notify: k } = z(), { t: A } = ne(), P = (e, t) => {
496
+ let n = A(e);
382
497
  return n === e ? t : n;
383
- }, U = te().pathname.endsWith("/edit"), { drivers: J, isLoading: Y, error: X } = m(U ? void 0 : a), Q = () => f?.(l(d, "fleet/vehicles")), $ = (e) => f?.(l(d, e));
384
- return a ? U ? /* @__PURE__ */ W(Z, { editId: a }) : C ? /* @__PURE__ */ W(j, { message: "Loading vehicle details..." }) : T || !S ? /* @__PURE__ */ W(A, {
498
+ }, L = ee().pathname.endsWith("/edit"), { drivers: G, isLoading: K, error: Z } = h(L ? void 0 : a), Q = () => f?.(u(s, "fleet/vehicles")), $ = (e) => f?.(u(s, e));
499
+ return a ? L ? /* @__PURE__ */ q(ue, { editId: a }) : C ? /* @__PURE__ */ q(M, { message: "Loading vehicle details..." }) : w || !p ? /* @__PURE__ */ q(j, {
385
500
  title: "Vehicle not found",
386
501
  onRetry: E
387
- }) : /* @__PURE__ */ G(M, {
388
- title: S.vehicleNumber,
389
- subtitle: `${S.make} ${S.model} (${S.year})`,
390
- icon: /* @__PURE__ */ W(s, { size: 24 }),
391
- headerActions: /* @__PURE__ */ G("div", {
502
+ }) : /* @__PURE__ */ J(N, {
503
+ title: p.vehicleNumber,
504
+ subtitle: `${p.make} ${p.model}${p.year ? ` (${p.year})` : ""}`,
505
+ icon: /* @__PURE__ */ q(c, { size: 24 }),
506
+ headerActions: /* @__PURE__ */ J("div", {
392
507
  className: "flex gap-2",
393
- children: [/* @__PURE__ */ G(_, {
508
+ children: [/* @__PURE__ */ J(v, {
394
509
  variant: "outline",
395
510
  onClick: Q,
396
- children: [/* @__PURE__ */ W(e, { size: 16 }), " Back"]
397
- }), /* @__PURE__ */ G(_, {
398
- onClick: () => f?.(l(d, "fleet/vehicles/" + a + "/edit")),
399
- children: [/* @__PURE__ */ W(o, { size: 16 }), " Edit"]
511
+ children: [/* @__PURE__ */ q(e, { size: 16 }), " Back"]
512
+ }), /* @__PURE__ */ J(v, {
513
+ onClick: () => f?.(u(s, "fleet/vehicles/" + a + "/edit")),
514
+ children: [/* @__PURE__ */ q(o, { size: 16 }), " Edit"]
400
515
  })]
401
516
  }),
402
- headerContent: /* @__PURE__ */ G("div", {
517
+ headerContent: /* @__PURE__ */ J("div", {
403
518
  className: "flex gap-2",
404
- children: [/* @__PURE__ */ W(N, {
405
- status: S.status,
519
+ children: [/* @__PURE__ */ q(F, {
520
+ status: p.status,
406
521
  type: "vehicle"
407
- }), /* @__PURE__ */ W(P, { type: S.type })]
522
+ }), /* @__PURE__ */ q(I, { type: p.type })]
408
523
  }),
409
524
  children: [
410
- /* @__PURE__ */ W(q, {
411
- icon: /* @__PURE__ */ W(s, { size: 18 }),
525
+ /* @__PURE__ */ q(X, {
526
+ icon: /* @__PURE__ */ q(c, { size: 18 }),
412
527
  children: "The full record for this vehicle — specs, capacity, fuel and mileage, who is driving it and where it is right now. Use it to confirm a vehicle is fuelled, crewed and the right size before dispatching it on a delivery."
413
528
  }),
414
- /* @__PURE__ */ W(ie, {
529
+ /* @__PURE__ */ q(re, {
415
530
  storageKey: "movethewheels-vehicle-details",
416
531
  steps: [{
417
532
  id: "assign",
418
533
  label: "Assign to a delivery",
419
534
  description: "Put this vehicle on an order that fits its capacity.",
420
- icon: /* @__PURE__ */ W(r, { size: 16 }),
535
+ icon: /* @__PURE__ */ q(r, { size: 16 }),
421
536
  onClick: () => $("orders")
422
537
  }, {
423
538
  id: "driver",
424
- label: J.length > 0 ? "Review the assigned driver" : "Assign a driver",
539
+ label: G.length > 0 ? "Review the assigned driver" : "Assign a driver",
425
540
  description: "A vehicle needs a driver before it can be dispatched.",
426
- icon: /* @__PURE__ */ W(c, { size: 16 }),
427
- done: J.length > 0,
428
- onClick: () => J[0] ? $(`fleet/drivers/${J[0].id}`) : $("fleet/drivers")
541
+ icon: /* @__PURE__ */ q(l, { size: 16 }),
542
+ done: G.length > 0,
543
+ onClick: () => G[0] ? $(`fleet/drivers/${G[0].id}`) : $("fleet/drivers")
429
544
  }]
430
545
  }),
431
- O && /* @__PURE__ */ W("div", {
546
+ O && /* @__PURE__ */ q("div", {
432
547
  className: "mb-2",
433
- children: /* @__PURE__ */ W(I, { message: O })
548
+ children: /* @__PURE__ */ q(R, { message: O })
434
549
  }),
435
- /* @__PURE__ */ G("div", {
550
+ /* @__PURE__ */ J("div", {
436
551
  className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
437
- children: [/* @__PURE__ */ G("div", {
552
+ children: [/* @__PURE__ */ J("div", {
438
553
  className: "lg:col-span-2 space-y-6",
439
554
  children: [
440
- /* @__PURE__ */ G(K, { children: [/* @__PURE__ */ W("h2", {
555
+ /* @__PURE__ */ J(Y, { children: [/* @__PURE__ */ q("h2", {
441
556
  className: "text-base font-semibold text-text-primary mb-4",
442
557
  children: "Vehicle Information"
443
- }), /* @__PURE__ */ G("div", {
558
+ }), /* @__PURE__ */ J("div", {
444
559
  className: "grid grid-cols-2 md:grid-cols-3 gap-6",
445
560
  children: [
446
- /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W("p", {
561
+ /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
447
562
  className: "text-sm text-text-secondary",
448
563
  children: "Type"
449
- }), /* @__PURE__ */ W("p", {
564
+ }), /* @__PURE__ */ q("p", {
450
565
  className: "font-medium capitalize",
451
- children: S.type
566
+ children: p.type
452
567
  })] }),
453
- /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W("p", {
568
+ /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
454
569
  className: "text-sm text-text-secondary",
455
570
  children: "Make"
456
- }), /* @__PURE__ */ W("p", {
571
+ }), /* @__PURE__ */ q("p", {
457
572
  className: "font-medium",
458
- children: S.make || "—"
573
+ children: p.make || "—"
459
574
  })] }),
460
- /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W("p", {
575
+ /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
461
576
  className: "text-sm text-text-secondary",
462
577
  children: "Model"
463
- }), /* @__PURE__ */ W("p", {
578
+ }), /* @__PURE__ */ q("p", {
464
579
  className: "font-medium",
465
- children: S.model || "—"
580
+ children: p.model || "—"
466
581
  })] }),
467
- /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W("p", {
582
+ /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
468
583
  className: "text-sm text-text-secondary",
469
584
  children: "Year"
470
- }), /* @__PURE__ */ W("p", {
585
+ }), /* @__PURE__ */ q("p", {
471
586
  className: "font-medium",
472
- children: S.year
587
+ children: p.year ?? "—"
473
588
  })] }),
474
- /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W("p", {
589
+ /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
475
590
  className: "text-sm text-text-secondary",
476
591
  children: "License Plate"
477
- }), /* @__PURE__ */ W("p", {
592
+ }), /* @__PURE__ */ q("p", {
478
593
  className: "font-medium",
479
- children: S.licensePlate || "—"
594
+ children: p.licensePlate || "—"
480
595
  })] }),
481
- /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W("p", {
596
+ /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
482
597
  className: "text-sm text-text-secondary",
483
598
  children: "Ownership"
484
- }), /* @__PURE__ */ W("p", {
599
+ }), /* @__PURE__ */ q("p", {
485
600
  className: "font-medium capitalize",
486
- children: S.ownershipType || "—"
601
+ children: p.ownershipType || "—"
487
602
  })] })
488
603
  ]
489
604
  })] }),
490
- /* @__PURE__ */ G(v, { children: [/* @__PURE__ */ W(b, { children: /* @__PURE__ */ W(x, { children: "Capacity" }) }), /* @__PURE__ */ W(y, { children: /* @__PURE__ */ G("div", {
605
+ /* @__PURE__ */ J(y, { children: [/* @__PURE__ */ q(x, { children: /* @__PURE__ */ q(S, { children: "Capacity" }) }), /* @__PURE__ */ q(b, { children: /* @__PURE__ */ J("div", {
491
606
  className: "grid grid-cols-1 sm:grid-cols-3 gap-6",
492
607
  children: [
493
- /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W("p", {
608
+ /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
494
609
  className: "text-sm text-text-secondary",
495
610
  children: "Weight"
496
- }), /* @__PURE__ */ G("p", {
611
+ }), /* @__PURE__ */ J("p", {
497
612
  className: "text-2xl font-bold",
498
- children: [S.capacity.weight, /* @__PURE__ */ W("span", {
613
+ children: [p.capacity.weight, /* @__PURE__ */ q("span", {
499
614
  className: "text-sm font-normal",
500
615
  children: " kg"
501
616
  })]
502
617
  })] }),
503
- /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W("p", {
618
+ /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
504
619
  className: "text-sm text-text-secondary",
505
620
  children: "Volume"
506
- }), /* @__PURE__ */ G("p", {
621
+ }), /* @__PURE__ */ J("p", {
507
622
  className: "text-2xl font-bold",
508
- children: [S.capacity.volume, /* @__PURE__ */ W("span", {
623
+ children: [p.capacity.volume, /* @__PURE__ */ q("span", {
509
624
  className: "text-sm font-normal",
510
625
  children: " m³"
511
626
  })]
512
627
  })] }),
513
- S.capacity.pallets && /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W("p", {
628
+ p.capacity.pallets && /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
514
629
  className: "text-sm text-text-secondary",
515
630
  children: "Pallets"
516
- }), /* @__PURE__ */ W("p", {
631
+ }), /* @__PURE__ */ q("p", {
517
632
  className: "text-2xl font-bold",
518
- children: S.capacity.pallets
633
+ children: p.capacity.pallets
519
634
  })] })
520
635
  ]
521
636
  }) })] }),
522
- /* @__PURE__ */ W(B, {
637
+ /* @__PURE__ */ q(H, {
523
638
  entityType: "vehicle",
524
- entityId: S.id
639
+ entityId: p.id
525
640
  })
526
641
  ]
527
- }), /* @__PURE__ */ G("div", {
642
+ }), /* @__PURE__ */ J("div", {
528
643
  className: "space-y-6",
529
644
  children: [
530
- /* @__PURE__ */ G(v, { children: [/* @__PURE__ */ W(b, { children: /* @__PURE__ */ G(x, {
645
+ /* @__PURE__ */ J(y, { children: [/* @__PURE__ */ q(x, { children: /* @__PURE__ */ J(S, {
531
646
  className: "flex items-center gap-2",
532
- children: [/* @__PURE__ */ W(t, { size: 18 }), " Fuel & Mileage"]
533
- }) }), /* @__PURE__ */ G(y, {
647
+ children: [/* @__PURE__ */ q(t, { size: 18 }), " Fuel & Mileage"]
648
+ }) }), /* @__PURE__ */ J(b, {
534
649
  className: "space-y-4",
535
650
  children: [
536
- S.fuelLevel !== void 0 && /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ G("div", {
651
+ p.fuelLevel !== void 0 && /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ J("div", {
537
652
  className: "flex justify-between text-sm mb-2",
538
- children: [/* @__PURE__ */ W("span", { children: "Fuel Level" }), /* @__PURE__ */ G("span", { children: [S.fuelLevel, "%"] })]
539
- }), /* @__PURE__ */ W(w, { value: S.fuelLevel })] }),
540
- S.mileage !== void 0 && /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W("p", {
653
+ children: [/* @__PURE__ */ q("span", { children: "Fuel Level" }), /* @__PURE__ */ J("span", { children: [p.fuelLevel, "%"] })]
654
+ }), /* @__PURE__ */ q(T, { value: p.fuelLevel })] }),
655
+ p.mileage !== void 0 && /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
541
656
  className: "text-sm text-text-secondary",
542
657
  children: "Total Mileage"
543
- }), /* @__PURE__ */ G("p", {
658
+ }), /* @__PURE__ */ J("p", {
544
659
  className: "text-2xl font-bold",
545
660
  children: [
546
- S.mileage.toLocaleString(),
661
+ p.mileage.toLocaleString(),
547
662
  " ",
548
- /* @__PURE__ */ W("span", {
663
+ /* @__PURE__ */ q("span", {
549
664
  className: "text-sm font-normal",
550
665
  children: "miles"
551
666
  })
552
667
  ]
553
668
  })] }),
554
- (S.fuelType || S.fuelEfficiencyLPer100Km !== void 0) && /* @__PURE__ */ G("div", {
669
+ (p.fuelType || p.fuelEfficiencyLPer100Km !== void 0) && /* @__PURE__ */ J("div", {
555
670
  className: "grid grid-cols-2 gap-4",
556
- children: [S.fuelType && /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W("p", {
671
+ children: [p.fuelType && /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
557
672
  className: "text-sm text-text-secondary",
558
673
  children: "Fuel Type"
559
- }), /* @__PURE__ */ W("p", {
674
+ }), /* @__PURE__ */ q("p", {
560
675
  className: "font-medium",
561
- children: S.fuelType
562
- })] }), S.fuelEfficiencyLPer100Km !== void 0 && /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W("p", {
676
+ children: p.fuelType
677
+ })] }), p.fuelEfficiencyLPer100Km !== void 0 && /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
563
678
  className: "text-sm text-text-secondary",
564
679
  children: "Efficiency"
565
- }), /* @__PURE__ */ G("p", {
680
+ }), /* @__PURE__ */ J("p", {
566
681
  className: "font-medium",
567
- children: [S.fuelEfficiencyLPer100Km, " L/100km"]
682
+ children: [p.fuelEfficiencyLPer100Km, " L/100km"]
568
683
  })] })]
569
684
  })
570
685
  ]
571
686
  })] }),
572
- /* @__PURE__ */ G(v, { children: [/* @__PURE__ */ W(b, { children: /* @__PURE__ */ G(x, {
687
+ /* @__PURE__ */ J(y, { children: [/* @__PURE__ */ q(x, { children: /* @__PURE__ */ J(S, {
573
688
  className: "flex items-center gap-2",
574
- children: [/* @__PURE__ */ W(c, { size: 18 }), " Assigned Driver"]
575
- }) }), /* @__PURE__ */ W(y, {
689
+ children: [/* @__PURE__ */ q(l, { size: 18 }), " Assigned Driver"]
690
+ }) }), /* @__PURE__ */ q(b, {
576
691
  className: "space-y-4",
577
- children: Y ? /* @__PURE__ */ W("p", {
692
+ children: K ? /* @__PURE__ */ q("p", {
578
693
  className: "text-sm text-text-secondary",
579
694
  children: "Loading assignment…"
580
- }) : X ? /* @__PURE__ */ W("p", {
695
+ }) : Z ? /* @__PURE__ */ q("p", {
581
696
  className: "text-sm text-status-error-text",
582
- children: X.message
583
- }) : J.length === 0 ? /* @__PURE__ */ G("div", {
697
+ children: Z.message
698
+ }) : G.length === 0 ? /* @__PURE__ */ J("div", {
584
699
  className: "space-y-3",
585
- children: [/* @__PURE__ */ W("p", {
700
+ children: [/* @__PURE__ */ q("p", {
586
701
  className: "text-sm text-text-secondary",
587
702
  children: "No driver is assigned to this vehicle yet."
588
- }), /* @__PURE__ */ W(_, {
703
+ }), /* @__PURE__ */ q(v, {
589
704
  variant: "outline",
590
705
  size: "sm",
591
706
  onClick: () => $("fleet/drivers"),
592
707
  children: "Assign from the roster"
593
708
  })]
594
- }) : J.map((e) => /* @__PURE__ */ G("div", {
709
+ }) : G.map((e) => /* @__PURE__ */ J("div", {
595
710
  role: "button",
596
711
  tabIndex: 0,
597
712
  className: "flex w-full items-start gap-3 rounded-lg p-2 text-left hover:bg-bg-sunken/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-bg",
@@ -599,34 +714,34 @@ function Q() {
599
714
  onKeyDown: (t) => {
600
715
  (t.key === "Enter" || t.key === " ") && (t.preventDefault(), $(`fleet/drivers/${e.id}`));
601
716
  },
602
- children: [/* @__PURE__ */ W(h, { children: /* @__PURE__ */ W(g, { children: z(e.fullName) }) }), /* @__PURE__ */ G("div", {
717
+ children: [/* @__PURE__ */ q(g, { children: /* @__PURE__ */ q(_, { children: V(e.fullName) }) }), /* @__PURE__ */ J("div", {
603
718
  className: "min-w-0 space-y-1",
604
719
  children: [
605
- /* @__PURE__ */ W("p", {
720
+ /* @__PURE__ */ q("p", {
606
721
  className: "font-medium",
607
722
  children: e.fullName
608
723
  }),
609
- /* @__PURE__ */ W("p", {
724
+ /* @__PURE__ */ q("p", {
610
725
  className: "text-xs text-text-secondary",
611
726
  children: e.employeeId
612
727
  }),
613
- /* @__PURE__ */ W(N, {
728
+ /* @__PURE__ */ q(F, {
614
729
  status: e.status,
615
730
  type: "driver",
616
731
  size: "sm"
617
732
  }),
618
- e.email && /* @__PURE__ */ G("p", {
733
+ e.email && /* @__PURE__ */ J("p", {
619
734
  className: "flex items-center gap-1.5 truncate text-sm text-text-secondary",
620
735
  children: [
621
- /* @__PURE__ */ W(n, { size: 13 }),
736
+ /* @__PURE__ */ q(n, { size: 13 }),
622
737
  " ",
623
738
  e.email
624
739
  ]
625
740
  }),
626
- e.phone && /* @__PURE__ */ G("p", {
741
+ e.phone && /* @__PURE__ */ J("p", {
627
742
  className: "flex items-center gap-1.5 text-sm text-text-secondary",
628
743
  children: [
629
- /* @__PURE__ */ W(i, { size: 13 }),
744
+ /* @__PURE__ */ q(i, { size: 13 }),
630
745
  " ",
631
746
  e.phone
632
747
  ]
@@ -635,28 +750,28 @@ function Q() {
635
750
  })]
636
751
  }, e.id))
637
752
  })] }),
638
- /* @__PURE__ */ W(ee, {
639
- vehicle: S,
640
- t: H,
753
+ /* @__PURE__ */ q(W, {
754
+ vehicle: p,
755
+ t: P,
641
756
  onRecord: async (e) => {
642
- await D(S.id, e), k(H("movethewheels.vehicles.service.saved", "Service recorded.")), E();
757
+ await D(p.id, e), k(P("movethewheels.vehicles.service.saved", "Service recorded.")), E();
643
758
  }
644
759
  }),
645
- S.currentLocation && /* @__PURE__ */ G(v, { children: [/* @__PURE__ */ W(b, { children: /* @__PURE__ */ G(x, {
760
+ p.currentLocation && /* @__PURE__ */ J(y, { children: [/* @__PURE__ */ q(x, { children: /* @__PURE__ */ J(S, {
646
761
  className: "flex items-center gap-2",
647
- children: [/* @__PURE__ */ W(r, { size: 18 }), " Current Location"]
648
- }) }), /* @__PURE__ */ G(y, { children: [/* @__PURE__ */ W("p", {
762
+ children: [/* @__PURE__ */ q(r, { size: 18 }), " Current Location"]
763
+ }) }), /* @__PURE__ */ J(b, { children: [/* @__PURE__ */ q("p", {
649
764
  className: "text-sm",
650
- children: S.currentLocation.address || "Location updating..."
651
- }), /* @__PURE__ */ G("p", {
765
+ children: p.currentLocation.address || "Location updating..."
766
+ }), /* @__PURE__ */ J("p", {
652
767
  className: "text-xs text-text-secondary mt-1",
653
- children: ["Updated ", R(S.currentLocation.timestamp || /* @__PURE__ */ new Date(), "relative")]
768
+ children: ["Updated ", B(p.currentLocation.timestamp || /* @__PURE__ */ new Date(), "relative")]
654
769
  })] })] })
655
770
  ]
656
771
  })]
657
772
  })
658
773
  ]
659
- }) : /* @__PURE__ */ W(Z, {});
774
+ }) : /* @__PURE__ */ q(ue, {});
660
775
  }
661
776
  //#endregion
662
- export { Q as default };
777
+ export { de as default };