@burdenoff/microfe-movethewheels 2026.924.2 → 2026.925.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/components/OrderItemRow.js +195 -109
  2. package/dist/components/StatusBadge.js +31 -31
  3. package/dist/constants/index.js +11 -3
  4. package/dist/generated/wspace-operations.d.ts +7 -0
  5. package/dist/hooks/useFleet.js +85 -76
  6. package/dist/hooks/useOrders.js +8 -4
  7. package/dist/hooks/useTracking.js +127 -66
  8. package/dist/movethewheels/components/OrderItemRow.d.ts +1 -2
  9. package/dist/movethewheels/components/StatusBadge.d.ts +3 -1
  10. package/dist/movethewheels/constants/index.d.ts +1 -0
  11. package/dist/movethewheels/hooks/useFleet.d.ts +41 -1
  12. package/dist/movethewheels/hooks/useOrders.d.ts +1 -0
  13. package/dist/movethewheels/hooks/useTracking.d.ts +2 -2
  14. package/dist/movethewheels/types/index.d.ts +17 -39
  15. package/dist/node_modules/lucide-react/dist/esm/icons/sticky-note.js +11 -0
  16. package/dist/node_modules/lucide-react/dist/esm/icons/user-x.js +30 -0
  17. package/dist/pages/CreateOrderPage.js +597 -420
  18. package/dist/pages/DriverDetailsPage.js +702 -421
  19. package/dist/pages/DriversPage.js +106 -117
  20. package/dist/pages/FleetPage.js +4 -10
  21. package/dist/pages/OrderDetailsPage.js +290 -262
  22. package/dist/pages/OrdersListPage.js +4 -0
  23. package/dist/pages/RouteDetailsPage.js +264 -252
  24. package/dist/pages/TrackingPage.js +205 -195
  25. package/dist/pages/VehicleDetailsPage.js +403 -243
  26. package/dist/utils/mapMarkers.js +2 -1
  27. package/package.json +1 -1
  28. package/src/generated/wspace-operations.ts +10 -3
  29. package/src/movethewheels/components/OrderItemRow.tsx +162 -99
  30. package/src/movethewheels/components/StatusBadge.tsx +11 -2
  31. package/src/movethewheels/constants/index.ts +13 -0
  32. package/src/movethewheels/hooks/useFleet.ts +163 -44
  33. package/src/movethewheels/hooks/useOrders.ts +17 -3
  34. package/src/movethewheels/hooks/useTracking.ts +208 -27
  35. package/src/movethewheels/pages/CreateOrderPage.tsx +372 -263
  36. package/src/movethewheels/pages/DriverDetailsPage.tsx +516 -156
  37. package/src/movethewheels/pages/DriversPage.tsx +28 -11
  38. package/src/movethewheels/pages/FleetPage.tsx +7 -10
  39. package/src/movethewheels/pages/OrderDetailsPage.tsx +67 -30
  40. package/src/movethewheels/pages/OrdersListPage.tsx +1 -0
  41. package/src/movethewheels/pages/RouteDetailsPage.tsx +15 -7
  42. package/src/movethewheels/pages/TrackingPage.tsx +44 -14
  43. package/src/movethewheels/pages/VehicleDetailsPage.tsx +137 -15
  44. package/src/movethewheels/types/index.ts +17 -38
  45. package/src/movethewheels/utils/mapMarkers.ts +1 -0
  46. package/src/operations/wspace/movethewheels/queries/dashboard.graphql +5 -0
  47. package/src/operations/wspace/movethewheels/queries/logistics.graphql +2 -2
@@ -10,30 +10,31 @@ import { MapPin as r } from "../node_modules/lucide-react/dist/esm/icons/map-pin
10
10
  import { Package as i } from "../node_modules/lucide-react/dist/esm/icons/package.js";
11
11
  import { Phone as ae } from "../node_modules/lucide-react/dist/esm/icons/phone.js";
12
12
  import { Printer as a } from "../node_modules/lucide-react/dist/esm/icons/printer.js";
13
+ import { Search as oe } from "../node_modules/lucide-react/dist/esm/icons/search.js";
13
14
  import { SquarePen as o } from "../node_modules/lucide-react/dist/esm/icons/square-pen.js";
14
- import { Truck as s } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
15
- import { UserCheck as oe } from "../node_modules/lucide-react/dist/esm/icons/user-check.js";
16
- import { User as se } from "../node_modules/lucide-react/dist/esm/icons/user.js";
17
- import { joinPath as c } from "../utils/navigation.js";
18
- import { useMoveTheWheels as ce } from "../providers/MoveTheWheelsProvider.js";
19
- import { useOrder as le, useOrders as ue } from "../hooks/useOrders.js";
20
- import { useDriver as de, useDrivers as fe, useVehicle as pe, useVehicles as me } from "../hooks/useFleet.js";
21
- import { Badge as l, Button as u, Card as d, CardContent as f, CardHeader as p, CardTitle as m, Input as he, Label as h, Separator as g, Table as ge, TableBody as _e, TableCell as _, TableHead as v, TableHeader as ve, TableRow as y } from "../components/ui.js";
22
- import { ErrorState as ye, LoadingState as be, PageLayout as xe } from "../components/PageLayout.js";
23
- import { PaymentStatusBadge as Se, PriorityBadge as Ce, StatusBadge as b } from "../components/StatusBadge.js";
24
- import { FormError as we } from "../components/FormError.js";
25
- import { Notice as Te, useNotice as Ee } from "../components/Notice.js";
26
- import { formatAddress as x, formatCurrency as S, formatDate as C } from "../utils/formatters.js";
27
- import { DocumentsCard as De } from "../components/DocumentsCard.js";
28
- import { useDebouncedValue as Oe } from "../hooks/useDebouncedValue.js";
29
- import { EntityCombobox as w } from "../components/EntityCombobox.js";
30
- import { ProofOfDeliveryCard as ke } from "../components/ProofOfDeliveryCard.js";
31
- import { useEffect as T, useState as E } from "react";
32
- import { useParams as Ae } from "react-router";
33
- import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
34
- import { EmphasisPanel as je, NextSteps as Me, PagePurpose as Ne } from "@burdenoff/fe-libs/ui";
15
+ import { Truck as se } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
16
+ import { UserCheck as ce } from "../node_modules/lucide-react/dist/esm/icons/user-check.js";
17
+ import { User as le } from "../node_modules/lucide-react/dist/esm/icons/user.js";
18
+ import { joinPath as s } from "../utils/navigation.js";
19
+ import { useMoveTheWheels as ue } from "../providers/MoveTheWheelsProvider.js";
20
+ import { useOrder as de, useOrders as fe } from "../hooks/useOrders.js";
21
+ import { useDriver as pe, useDrivers as me, useVehicle as he, useVehicles as ge } from "../hooks/useFleet.js";
22
+ import { Badge as c, Button as l, Card as u, CardContent as d, CardHeader as f, CardTitle as p, Input as _e, Label as m, Separator as h, Table as ve, TableBody as ye, TableCell as g, TableHead as _, TableHeader as be, TableRow as v } from "../components/ui.js";
23
+ import { ErrorState as xe, LoadingState as Se, PageLayout as Ce } from "../components/PageLayout.js";
24
+ import { PaymentStatusBadge as we, PriorityBadge as Te, StatusBadge as y } from "../components/StatusBadge.js";
25
+ import { FormError as Ee } from "../components/FormError.js";
26
+ import { Notice as De, useNotice as Oe } from "../components/Notice.js";
27
+ import { formatAddress as b, formatCurrency as x, formatDate as S } from "../utils/formatters.js";
28
+ import { DocumentsCard as ke } from "../components/DocumentsCard.js";
29
+ import { useDebouncedValue as Ae } from "../hooks/useDebouncedValue.js";
30
+ import { EntityCombobox as C } from "../components/EntityCombobox.js";
31
+ import { ProofOfDeliveryCard as je } from "../components/ProofOfDeliveryCard.js";
32
+ import { useEffect as w, useState as T } from "react";
33
+ import { useParams as Me } from "react-router";
34
+ import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
35
+ import { EmphasisPanel as Ne, NextSteps as Pe, PagePurpose as Fe } from "@burdenoff/fe-libs/ui";
35
36
  //#region src/movethewheels/pages/OrderDetailsPage.tsx
36
- var A = [
37
+ var k = [
37
38
  "pending",
38
39
  "confirmed",
39
40
  "assigned",
@@ -41,7 +42,7 @@ var A = [
41
42
  "in_transit",
42
43
  "out_for_delivery",
43
44
  "delivered"
44
- ], j = {
45
+ ], A = {
45
46
  pending: "Pending",
46
47
  confirmed: "Confirmed",
47
48
  assigned: "Assigned",
@@ -49,261 +50,279 @@ var A = [
49
50
  in_transit: "In Transit",
50
51
  out_for_delivery: "Out for Delivery",
51
52
  delivered: "Delivered",
53
+ returned: "Returned",
52
54
  cancelled: "Cancelled",
53
55
  failed: "Failed"
54
- };
55
- function Pe(e) {
56
- let t = A.indexOf(e);
57
- return t === -1 || t >= A.length - 1 ? null : A[t + 1];
56
+ }, j = new Set([
57
+ "delivered",
58
+ "returned",
59
+ "cancelled",
60
+ "failed"
61
+ ]);
62
+ function Ie(e) {
63
+ let t = k.indexOf(e);
64
+ return t === -1 || t >= k.length - 1 ? null : k[t + 1];
58
65
  }
59
66
  function M() {
60
- let { orderId: A } = Ae(), { basePath: M, navigate: N } = ce(), { order: P, isLoading: Fe, error: Ie, refetch: F } = le(A), { updateOrder: Le, updateOrderStatus: Re } = ue(), [I, ze] = E(""), [L, R] = E(""), [z, B] = E(""), [V, H] = E(!1), [U, W] = E(!1), [G, K] = E(null), q = Oe(I), { vehicles: J, isLoading: Y } = me({
67
+ let { orderId: k } = Me(), { basePath: M, navigate: N } = ue(), { order: P, isLoading: Le, error: Re, refetch: F } = de(k), { updateOrder: ze, updateOrderStatus: I } = fe(), [L, Be] = T(""), [R, z] = T(""), [B, V] = T(""), [H, U] = T(!1), [W, G] = T(!1), [K, q] = T(null), J = Ae(L), { vehicles: Y, isLoading: X } = ge({
61
68
  limit: 20,
62
- search: q || void 0,
63
- driverId: z || void 0
64
- }), { drivers: X, isLoading: Z } = fe({
69
+ search: J || void 0,
70
+ driverId: B || void 0
71
+ }), { drivers: Z, isLoading: Q } = me({
65
72
  limit: 20,
66
- search: q || void 0,
67
- vehicleId: L || void 0
68
- }), { vehicle: Be, isLoading: Ve } = pe(L || void 0), { driver: He, isLoading: Ue } = de(z || void 0), { message: We, notify: Ge } = Ee(), Ke = J.filter((e) => e.status === "available" || e.id === P?.vehicleId), qe = X.filter((e) => e.status === "available" || e.id === P?.driverId);
69
- T(() => {
70
- !Z && z && !X.some((e) => e.id === z) && B("");
73
+ search: J || void 0,
74
+ vehicleId: R || void 0
75
+ }), { vehicle: Ve, isLoading: He } = he(R || void 0), { driver: Ue, isLoading: We } = pe(B || void 0), { message: Ge, notify: Ke } = Oe(), qe = Y.filter((e) => e.status === "available" || e.id === P?.vehicleId), Je = Z.filter((e) => e.status === "available" || e.id === P?.driverId);
76
+ w(() => {
77
+ !Q && B && !Z.some((e) => e.id === B) && V("");
71
78
  }, [
72
- X,
73
79
  Z,
74
- z
75
- ]), T(() => {
76
- !Y && L && !J.some((e) => e.id === L) && R("");
80
+ Q,
81
+ B
82
+ ]), w(() => {
83
+ !X && R && !Y.some((e) => e.id === R) && z("");
77
84
  }, [
78
- L,
79
- J,
80
- Y
85
+ R,
86
+ Y,
87
+ X
81
88
  ]);
82
- let Je = async () => {
83
- if (!A || !L && !z) {
84
- K("Pick a vehicle and/or a driver to assign.");
89
+ let Ye = async () => {
90
+ if (!k || !P) {
91
+ q("This order is no longer available. Refresh and try again.");
85
92
  return;
86
93
  }
87
- H(!0), K(null);
94
+ let e = R || P.vehicleId, t = B || P.driverId;
95
+ if (!e || !t) {
96
+ q("Select both a compatible vehicle and driver before dispatching.");
97
+ return;
98
+ }
99
+ let n = !!(P.vehicleId && P.driverId);
100
+ U(!0), q(null);
88
101
  try {
89
- await Le(A, {
90
- vehicleId: L || void 0,
91
- driverId: z || void 0
92
- }), Ge("Assignment updated."), R(""), B(""), F();
102
+ await ze(k, {
103
+ vehicleId: e,
104
+ driverId: t
105
+ }), !n && P.status === "confirmed" && await I(k, "assigned"), Ke(!n && P.status === "confirmed" ? "Fleet assigned and order advanced to Assigned." : "Assignment updated."), z(""), V(""), F();
93
106
  } catch (e) {
94
- K(e instanceof Error ? e.message : "Failed to update assignment.");
107
+ q(e instanceof Error ? e.message : "Failed to update assignment.");
95
108
  } finally {
96
- H(!1);
109
+ U(!1);
97
110
  }
98
- }, Q = async (e, t) => {
99
- if (A) {
100
- W(!0), K(null);
101
- try {
102
- await Re(A, e), Ge(t), F();
103
- } catch (e) {
104
- K(e instanceof Error ? e.message : "Failed to update status.");
105
- } finally {
106
- W(!1);
111
+ }, Xe = async (e, t) => {
112
+ if (!(!k || !P)) {
113
+ if (e === "assigned" && (!P.vehicleId || !P.driverId)) {
114
+ q("Assign both a compatible vehicle and driver before advancing to Assigned.");
115
+ return;
116
+ }
117
+ if (!j.has(P.status)) {
118
+ G(!0), q(null);
119
+ try {
120
+ await I(k, e), Ke(t), F();
121
+ } catch (e) {
122
+ q(e instanceof Error ? e.message : "Failed to update status.");
123
+ } finally {
124
+ G(!1);
125
+ }
107
126
  }
108
127
  }
109
128
  }, $ = (e) => {
110
- N && N(c(M, e));
129
+ N && N(s(M, e));
111
130
  };
112
- return Fe ? /* @__PURE__ */ O(be, { message: "Loading order details..." }) : Ie || !P ? /* @__PURE__ */ O(ye, {
131
+ return Le ? /* @__PURE__ */ D(Se, { message: "Loading order details..." }) : Re || !P ? /* @__PURE__ */ D(xe, {
113
132
  title: "Order not found",
114
133
  message: "The order you're looking for doesn't exist or has been removed.",
115
134
  onRetry: F
116
- }) : /* @__PURE__ */ k(xe, {
135
+ }) : /* @__PURE__ */ O(Ce, {
117
136
  title: P.orderNumber,
118
- subtitle: `Created ${C(P.createdAt, "full")}`,
119
- icon: /* @__PURE__ */ O(i, { size: 24 }),
120
- headerActions: /* @__PURE__ */ k("div", {
137
+ subtitle: `Created ${S(P.createdAt, "full")}`,
138
+ icon: /* @__PURE__ */ D(i, { size: 24 }),
139
+ headerActions: /* @__PURE__ */ O("div", {
121
140
  className: "flex gap-2",
122
141
  children: [
123
- /* @__PURE__ */ k(u, {
142
+ /* @__PURE__ */ O(l, {
124
143
  variant: "outline",
125
144
  onClick: () => {
126
- N && N(c(M, "orders"));
145
+ N && N(s(M, "orders"));
127
146
  },
128
- children: [/* @__PURE__ */ O(e, { size: 16 }), "Back"]
147
+ children: [/* @__PURE__ */ D(e, { size: 16 }), "Back"]
129
148
  }),
130
- /* @__PURE__ */ k(u, {
149
+ /* @__PURE__ */ O(l, {
131
150
  variant: "outline",
132
151
  onClick: () => window.print(),
133
- children: [/* @__PURE__ */ O(a, { size: 16 }), "Print"]
152
+ children: [/* @__PURE__ */ D(a, { size: 16 }), "Print"]
134
153
  }),
135
- /* @__PURE__ */ k(u, {
136
- onClick: () => $(`orders/${A}/edit`),
137
- children: [/* @__PURE__ */ O(o, { size: 16 }), "Edit"]
154
+ /* @__PURE__ */ O(l, {
155
+ onClick: () => $(`orders/${k}/edit`),
156
+ children: [/* @__PURE__ */ D(o, { size: 16 }), "Edit"]
138
157
  })
139
158
  ]
140
159
  }),
141
- headerContent: /* @__PURE__ */ k("div", {
160
+ headerContent: /* @__PURE__ */ O("div", {
142
161
  className: "flex flex-wrap gap-2",
143
162
  children: [
144
- /* @__PURE__ */ O(b, {
163
+ /* @__PURE__ */ D(y, {
145
164
  status: P.status,
146
165
  type: "order"
147
166
  }),
148
- /* @__PURE__ */ O(Ce, { priority: P.priority }),
149
- /* @__PURE__ */ O(Se, { status: P.pricing.paymentStatus })
167
+ /* @__PURE__ */ D(Te, { priority: P.priority }),
168
+ /* @__PURE__ */ D(we, { status: P.pricing.paymentStatus })
150
169
  ]
151
170
  }),
152
171
  children: [
153
- /* @__PURE__ */ O(Ne, {
154
- icon: /* @__PURE__ */ O(i, { size: 18 }),
172
+ /* @__PURE__ */ D(Fe, {
173
+ icon: /* @__PURE__ */ D(i, { size: 18 }),
155
174
  children: "Everything about this one delivery in a single place — who it's for, where it's going, what's inside, the running cost and the full status history. Use this page to review the order, hand it to a driver, print the docket, or jump into live tracking."
156
175
  }),
157
- /* @__PURE__ */ O(Me, {
176
+ /* @__PURE__ */ D(Pe, {
158
177
  storageKey: "movethewheels-order-details",
159
178
  steps: [
160
179
  {
161
180
  id: "track",
162
181
  label: "Track this order live",
163
182
  description: "See where the shipment is right now on the map.",
164
- icon: /* @__PURE__ */ O(r, { size: 16 }),
183
+ icon: /* @__PURE__ */ D(r, { size: 16 }),
165
184
  onClick: () => $(`tracking?order=${P.id}`)
166
185
  },
167
186
  {
168
187
  id: "edit",
169
188
  label: "Edit order details",
170
189
  description: "Update items, addresses or instructions before dispatch.",
171
- icon: /* @__PURE__ */ O(o, { size: 16 }),
172
- onClick: () => $(`orders/${A}/edit`)
190
+ icon: /* @__PURE__ */ D(o, { size: 16 }),
191
+ onClick: () => $(`orders/${k}/edit`)
173
192
  },
174
193
  {
175
194
  id: "print",
176
195
  label: "Print the delivery docket",
177
196
  description: "Generate a printable copy for the driver or warehouse.",
178
- icon: /* @__PURE__ */ O(a, { size: 16 }),
197
+ icon: /* @__PURE__ */ D(a, { size: 16 }),
179
198
  onClick: () => window.print()
180
199
  }
181
200
  ]
182
201
  }),
183
- /* @__PURE__ */ k("div", {
202
+ /* @__PURE__ */ O("div", {
184
203
  className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
185
- children: [/* @__PURE__ */ k("div", {
204
+ children: [/* @__PURE__ */ O("div", {
186
205
  className: "lg:col-span-2 space-y-6",
187
206
  children: [
188
- /* @__PURE__ */ k(d, { children: [/* @__PURE__ */ O(p, { children: /* @__PURE__ */ k(m, {
207
+ /* @__PURE__ */ O(u, { children: [/* @__PURE__ */ D(f, { children: /* @__PURE__ */ O(p, {
189
208
  className: "flex items-center gap-2",
190
- children: [/* @__PURE__ */ O(se, { size: 18 }), "Customer Information"]
191
- }) }), /* @__PURE__ */ O(f, { children: /* @__PURE__ */ k("div", {
209
+ children: [/* @__PURE__ */ D(le, { size: 18 }), "Customer Information"]
210
+ }) }), /* @__PURE__ */ D(d, { children: /* @__PURE__ */ O("div", {
192
211
  className: "grid grid-cols-1 md:grid-cols-2 gap-6",
193
- children: [/* @__PURE__ */ k("div", { children: [
194
- /* @__PURE__ */ O("h4", {
212
+ children: [/* @__PURE__ */ O("div", { children: [
213
+ /* @__PURE__ */ D("h4", {
195
214
  className: "font-medium mb-2",
196
215
  children: P.customerInfo.name
197
216
  }),
198
- P.customerInfo.company && /* @__PURE__ */ O("p", {
217
+ P.customerInfo.company && /* @__PURE__ */ D("p", {
199
218
  className: "text-sm text-text-secondary mb-2",
200
219
  children: P.customerInfo.company
201
220
  }),
202
- /* @__PURE__ */ k("div", {
221
+ /* @__PURE__ */ O("div", {
203
222
  className: "space-y-1 text-sm",
204
- children: [/* @__PURE__ */ k("p", {
223
+ children: [/* @__PURE__ */ O("p", {
205
224
  className: "flex items-center gap-2",
206
- children: [/* @__PURE__ */ O(ie, {
225
+ children: [/* @__PURE__ */ D(ie, {
207
226
  size: 14,
208
227
  className: "text-text-secondary"
209
228
  }), P.customerInfo.email]
210
- }), /* @__PURE__ */ k("p", {
229
+ }), /* @__PURE__ */ O("p", {
211
230
  className: "flex items-center gap-2",
212
- children: [/* @__PURE__ */ O(ae, {
231
+ children: [/* @__PURE__ */ D(ae, {
213
232
  size: 14,
214
233
  className: "text-text-secondary"
215
234
  }), P.customerInfo.phone]
216
235
  })]
217
236
  })
218
- ] }), /* @__PURE__ */ k("div", { children: [P.customerInfo.preferredDeliveryTime && /* @__PURE__ */ k("div", {
237
+ ] }), /* @__PURE__ */ O("div", { children: [P.customerInfo.preferredDeliveryTime && /* @__PURE__ */ O("div", {
219
238
  className: "mb-2",
220
- children: [/* @__PURE__ */ O("p", {
239
+ children: [/* @__PURE__ */ D("p", {
221
240
  className: "text-sm text-text-secondary",
222
241
  children: "Preferred Delivery Time"
223
- }), /* @__PURE__ */ O("p", {
242
+ }), /* @__PURE__ */ D("p", {
224
243
  className: "text-sm",
225
244
  children: P.customerInfo.preferredDeliveryTime
226
245
  })]
227
- }), P.customerInfo.deliveryInstructions && /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
246
+ }), P.customerInfo.deliveryInstructions && /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("p", {
228
247
  className: "text-sm text-text-secondary",
229
248
  children: "Delivery Instructions"
230
- }), /* @__PURE__ */ O("p", {
249
+ }), /* @__PURE__ */ D("p", {
231
250
  className: "text-sm",
232
251
  children: P.customerInfo.deliveryInstructions
233
252
  })] })] })]
234
253
  }) })] }),
235
- /* @__PURE__ */ k(d, { children: [/* @__PURE__ */ O(p, { children: /* @__PURE__ */ k(m, {
254
+ /* @__PURE__ */ O(u, { children: [/* @__PURE__ */ D(f, { children: /* @__PURE__ */ O(p, {
236
255
  className: "flex items-center gap-2",
237
- children: [/* @__PURE__ */ O(r, { size: 18 }), "Addresses"]
238
- }) }), /* @__PURE__ */ O(f, { children: /* @__PURE__ */ k("div", {
256
+ children: [/* @__PURE__ */ D(r, { size: 18 }), "Addresses"]
257
+ }) }), /* @__PURE__ */ D(d, { children: /* @__PURE__ */ O("div", {
239
258
  className: "grid grid-cols-1 md:grid-cols-2 gap-6",
240
- children: [/* @__PURE__ */ k("div", { children: [
241
- /* @__PURE__ */ O("h4", {
259
+ children: [/* @__PURE__ */ O("div", { children: [
260
+ /* @__PURE__ */ D("h4", {
242
261
  className: "font-medium mb-2 flex items-center gap-2",
243
- children: /* @__PURE__ */ O(l, {
262
+ children: /* @__PURE__ */ D(c, {
244
263
  variant: "outline",
245
264
  children: "Pickup"
246
265
  })
247
266
  }),
248
- /* @__PURE__ */ O("p", {
267
+ /* @__PURE__ */ D("p", {
249
268
  className: "text-sm",
250
- children: x(P.pickupAddress)
269
+ children: b(P.pickupAddress)
251
270
  }),
252
- P.scheduledPickup && /* @__PURE__ */ k("p", {
271
+ P.scheduledPickup && /* @__PURE__ */ O("p", {
253
272
  className: "text-sm text-text-secondary mt-2",
254
- children: ["Scheduled: ", C(P.scheduledPickup, "full")]
273
+ children: ["Scheduled: ", S(P.scheduledPickup, "full")]
255
274
  }),
256
- P.actualPickup && /* @__PURE__ */ k("p", {
275
+ P.actualPickup && /* @__PURE__ */ O("p", {
257
276
  className: "text-sm text-status-success-text mt-1",
258
277
  children: [
259
- /* @__PURE__ */ O(n, {
278
+ /* @__PURE__ */ D(n, {
260
279
  size: 14,
261
280
  className: "inline mr-1"
262
281
  }),
263
282
  "Picked up: ",
264
- C(P.actualPickup, "full")
283
+ S(P.actualPickup, "full")
265
284
  ]
266
285
  })
267
- ] }), /* @__PURE__ */ k("div", { children: [
268
- /* @__PURE__ */ O("h4", {
286
+ ] }), /* @__PURE__ */ O("div", { children: [
287
+ /* @__PURE__ */ D("h4", {
269
288
  className: "font-medium mb-2 flex items-center gap-2",
270
- children: /* @__PURE__ */ O(l, {
289
+ children: /* @__PURE__ */ D(c, {
271
290
  variant: "outline",
272
291
  children: "Delivery"
273
292
  })
274
293
  }),
275
- /* @__PURE__ */ O("p", {
294
+ /* @__PURE__ */ D("p", {
276
295
  className: "text-sm",
277
- children: x(P.deliveryAddress)
296
+ children: b(P.deliveryAddress)
278
297
  }),
279
- P.scheduledDelivery && /* @__PURE__ */ k("p", {
298
+ P.scheduledDelivery && /* @__PURE__ */ O("p", {
280
299
  className: "text-sm text-text-secondary mt-2",
281
- children: ["Scheduled: ", C(P.scheduledDelivery, "full")]
300
+ children: ["Scheduled: ", S(P.scheduledDelivery, "full")]
282
301
  }),
283
- P.actualDelivery && /* @__PURE__ */ k("p", {
302
+ P.actualDelivery && /* @__PURE__ */ O("p", {
284
303
  className: "text-sm text-status-success-text mt-1",
285
304
  children: [
286
- /* @__PURE__ */ O(n, {
305
+ /* @__PURE__ */ D(n, {
287
306
  size: 14,
288
307
  className: "inline mr-1"
289
308
  }),
290
309
  "Delivered: ",
291
- C(P.actualDelivery, "full")
310
+ S(P.actualDelivery, "full")
292
311
  ]
293
312
  })
294
313
  ] })]
295
314
  }) })] }),
296
- /* @__PURE__ */ k(d, { children: [/* @__PURE__ */ O(p, { children: /* @__PURE__ */ k(m, {
315
+ /* @__PURE__ */ O(u, { children: [/* @__PURE__ */ D(f, { children: /* @__PURE__ */ O(p, {
297
316
  className: "flex items-center gap-2",
298
- children: [/* @__PURE__ */ O(s, { size: 18 }), "Saved Route"]
299
- }) }), /* @__PURE__ */ O(f, { children: P.route ? /* @__PURE__ */ k("div", {
317
+ children: [/* @__PURE__ */ D(se, { size: 18 }), "Saved Route"]
318
+ }) }), /* @__PURE__ */ D(d, { children: P.route ? /* @__PURE__ */ O("div", {
300
319
  className: "space-y-3",
301
- children: [/* @__PURE__ */ k("div", {
320
+ children: [/* @__PURE__ */ O("div", {
302
321
  className: "flex items-center justify-between gap-3",
303
- children: [/* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
322
+ children: [/* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("p", {
304
323
  className: "font-medium",
305
324
  children: P.route.name
306
- }), /* @__PURE__ */ k("p", {
325
+ }), /* @__PURE__ */ O("p", {
307
326
  className: "text-sm text-text-secondary",
308
327
  children: [
309
328
  P.route.stops.length,
@@ -311,112 +330,112 @@ function M() {
311
330
  " ",
312
331
  P.route.status.replace("_", " ").toLowerCase()
313
332
  ]
314
- })] }), /* @__PURE__ */ O(l, {
333
+ })] }), /* @__PURE__ */ D(c, {
315
334
  variant: "outline",
316
335
  children: "Reusable route"
317
336
  })]
318
- }), /* @__PURE__ */ O("div", {
337
+ }), /* @__PURE__ */ D("div", {
319
338
  className: "space-y-2",
320
- children: P.route.stops.map((e, t) => /* @__PURE__ */ k("div", {
339
+ children: P.route.stops.map((e, t) => /* @__PURE__ */ O("div", {
321
340
  className: "flex items-start gap-2 text-sm",
322
- children: [/* @__PURE__ */ k("span", {
341
+ children: [/* @__PURE__ */ O("span", {
323
342
  className: "text-text-secondary",
324
343
  children: [t + 1, "."]
325
- }), /* @__PURE__ */ k("span", { children: [
326
- /* @__PURE__ */ O("span", {
344
+ }), /* @__PURE__ */ O("span", { children: [
345
+ /* @__PURE__ */ D("span", {
327
346
  className: "font-medium capitalize",
328
347
  children: e.type
329
348
  }),
330
349
  " ·",
331
350
  " ",
332
- x(e.address)
351
+ b(e.address)
333
352
  ] })]
334
353
  }, e.id))
335
354
  })]
336
- }) : /* @__PURE__ */ O("p", {
355
+ }) : /* @__PURE__ */ D("p", {
337
356
  className: "text-sm text-text-secondary",
338
357
  children: "No saved route was selected for this order."
339
358
  }) })] }),
340
- /* @__PURE__ */ k(d, { children: [/* @__PURE__ */ O(p, { children: /* @__PURE__ */ k(m, {
359
+ /* @__PURE__ */ O(u, { children: [/* @__PURE__ */ D(f, { children: /* @__PURE__ */ O(p, {
341
360
  className: "flex items-center gap-2",
342
361
  children: [
343
- /* @__PURE__ */ O(i, { size: 18 }),
362
+ /* @__PURE__ */ D(i, { size: 18 }),
344
363
  "Order Items (",
345
364
  P.items.length,
346
365
  ")"
347
366
  ]
348
- }) }), /* @__PURE__ */ O(f, {
367
+ }) }), /* @__PURE__ */ D(d, {
349
368
  className: "p-0",
350
- children: /* @__PURE__ */ k(ge, { children: [/* @__PURE__ */ O(ve, { children: /* @__PURE__ */ k(y, { children: [
351
- /* @__PURE__ */ O(v, { children: "Item" }),
352
- /* @__PURE__ */ O(v, { children: "SKU" }),
353
- /* @__PURE__ */ O(v, {
369
+ children: /* @__PURE__ */ O(ve, { children: [/* @__PURE__ */ D(be, { children: /* @__PURE__ */ O(v, { children: [
370
+ /* @__PURE__ */ D(_, { children: "Item" }),
371
+ /* @__PURE__ */ D(_, { children: "SKU" }),
372
+ /* @__PURE__ */ D(_, {
354
373
  className: "text-center",
355
374
  children: "Qty"
356
375
  }),
357
- /* @__PURE__ */ O(v, {
376
+ /* @__PURE__ */ D(_, {
358
377
  className: "text-right",
359
378
  children: "Unit Price"
360
379
  }),
361
- /* @__PURE__ */ O(v, {
380
+ /* @__PURE__ */ D(_, {
362
381
  className: "text-right",
363
382
  children: "Total"
364
383
  })
365
- ] }) }), /* @__PURE__ */ O(_e, { children: P.items.map((e) => /* @__PURE__ */ k(y, { children: [
366
- /* @__PURE__ */ O(_, { children: /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
384
+ ] }) }), /* @__PURE__ */ D(ye, { children: P.items.map((e) => /* @__PURE__ */ O(v, { children: [
385
+ /* @__PURE__ */ D(g, { children: /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("p", {
367
386
  className: "font-medium",
368
387
  children: e.name
369
- }), e.description && /* @__PURE__ */ O("p", {
388
+ }), e.description && /* @__PURE__ */ D("p", {
370
389
  className: "text-sm text-text-secondary",
371
390
  children: e.description
372
391
  })] }) }),
373
- /* @__PURE__ */ O(_, {
392
+ /* @__PURE__ */ D(g, {
374
393
  className: "font-mono text-sm",
375
394
  children: e.sku
376
395
  }),
377
- /* @__PURE__ */ O(_, {
396
+ /* @__PURE__ */ D(g, {
378
397
  className: "text-center",
379
398
  children: e.quantity
380
399
  }),
381
- /* @__PURE__ */ O(_, {
400
+ /* @__PURE__ */ D(g, {
382
401
  className: "text-right",
383
- children: S(e.value)
402
+ children: x(e.value)
384
403
  }),
385
- /* @__PURE__ */ O(_, {
404
+ /* @__PURE__ */ D(g, {
386
405
  className: "text-right font-medium",
387
- children: S(e.value * e.quantity)
406
+ children: x(e.value * e.quantity)
388
407
  })
389
408
  ] }, e.id)) })] })
390
409
  })] }),
391
- /* @__PURE__ */ k(d, { children: [/* @__PURE__ */ O(p, { children: /* @__PURE__ */ k(m, {
410
+ /* @__PURE__ */ O(u, { children: [/* @__PURE__ */ D(f, { children: /* @__PURE__ */ O(p, {
392
411
  className: "flex items-center gap-2",
393
- children: [/* @__PURE__ */ O(te, { size: 18 }), "Order Timeline"]
394
- }) }), /* @__PURE__ */ O(f, { children: /* @__PURE__ */ O("div", {
412
+ children: [/* @__PURE__ */ D(te, { size: 18 }), "Order Timeline"]
413
+ }) }), /* @__PURE__ */ D(d, { children: /* @__PURE__ */ D("div", {
395
414
  className: "relative",
396
- children: P.timeline.map((e, t) => /* @__PURE__ */ k("div", {
415
+ children: P.timeline.map((e, t) => /* @__PURE__ */ O("div", {
397
416
  className: "flex gap-4 pb-6 last:pb-0",
398
- children: [/* @__PURE__ */ k("div", {
417
+ children: [/* @__PURE__ */ O("div", {
399
418
  className: "relative",
400
- children: [/* @__PURE__ */ O("div", { className: "w-3 h-3 rounded-full bg-action-primary-bg mt-1.5" }), t < P.timeline.length - 1 && /* @__PURE__ */ O("div", { className: "absolute top-4 left-1.5 w-px h-full -ml-px bg-border" })]
401
- }), /* @__PURE__ */ k("div", {
419
+ children: [/* @__PURE__ */ D("div", { className: "w-3 h-3 rounded-full bg-action-primary-bg mt-1.5" }), t < P.timeline.length - 1 && /* @__PURE__ */ D("div", { className: "absolute top-4 left-1.5 w-px h-full -ml-px bg-border" })]
420
+ }), /* @__PURE__ */ O("div", {
402
421
  className: "flex-1",
403
422
  children: [
404
- /* @__PURE__ */ k("div", {
423
+ /* @__PURE__ */ O("div", {
405
424
  className: "flex items-center gap-2 mb-1",
406
- children: [/* @__PURE__ */ O(b, {
425
+ children: [/* @__PURE__ */ D(y, {
407
426
  status: e.status,
408
427
  type: "order",
409
428
  size: "sm"
410
- }), /* @__PURE__ */ O("span", {
429
+ }), /* @__PURE__ */ D("span", {
411
430
  className: "text-sm text-text-secondary",
412
- children: C(e.timestamp, "full")
431
+ children: S(e.timestamp, "full")
413
432
  })]
414
433
  }),
415
- e.notes && /* @__PURE__ */ O("p", {
434
+ e.notes && /* @__PURE__ */ D("p", {
416
435
  className: "text-sm",
417
436
  children: e.notes
418
437
  }),
419
- /* @__PURE__ */ k("p", {
438
+ /* @__PURE__ */ O("p", {
420
439
  className: "text-xs text-text-secondary",
421
440
  children: ["by ", e.performedBy]
422
441
  })
@@ -425,212 +444,221 @@ function M() {
425
444
  }, t))
426
445
  }) })] })
427
446
  ]
428
- }), /* @__PURE__ */ k("div", {
447
+ }), /* @__PURE__ */ O("div", {
429
448
  className: "space-y-6",
430
449
  children: [
431
- /* @__PURE__ */ k(je, { children: [/* @__PURE__ */ k("h2", {
450
+ /* @__PURE__ */ O(Ne, { children: [/* @__PURE__ */ O("h2", {
432
451
  className: "flex items-center gap-2 text-base font-semibold text-text-primary mb-4",
433
- children: [/* @__PURE__ */ O(ne, { size: 18 }), "Order Summary"]
434
- }), /* @__PURE__ */ k("div", {
452
+ children: [/* @__PURE__ */ D(ne, { size: 18 }), "Order Summary"]
453
+ }), /* @__PURE__ */ O("div", {
435
454
  className: "space-y-3",
436
455
  children: [
437
- /* @__PURE__ */ k("div", {
456
+ /* @__PURE__ */ O("div", {
438
457
  className: "flex justify-between text-sm",
439
- children: [/* @__PURE__ */ O("span", {
458
+ children: [/* @__PURE__ */ D("span", {
440
459
  className: "text-text-secondary",
441
460
  children: "Subtotal"
442
- }), /* @__PURE__ */ O("span", { children: S(P.pricing.subtotal) })]
461
+ }), /* @__PURE__ */ D("span", { children: x(P.pricing.subtotal) })]
443
462
  }),
444
- /* @__PURE__ */ k("div", {
463
+ /* @__PURE__ */ O("div", {
445
464
  className: "flex justify-between text-sm",
446
- children: [/* @__PURE__ */ O("span", {
465
+ children: [/* @__PURE__ */ D("span", {
447
466
  className: "text-text-secondary",
448
467
  children: "Delivery"
449
- }), /* @__PURE__ */ O("span", { children: S(P.pricing.fees.delivery) })]
468
+ }), /* @__PURE__ */ D("span", { children: x(P.pricing.fees.delivery) })]
450
469
  }),
451
- /* @__PURE__ */ k("div", {
470
+ /* @__PURE__ */ O("div", {
452
471
  className: "flex justify-between text-sm",
453
- children: [/* @__PURE__ */ O("span", {
472
+ children: [/* @__PURE__ */ D("span", {
454
473
  className: "text-text-secondary",
455
474
  children: "Handling"
456
- }), /* @__PURE__ */ O("span", { children: S(P.pricing.fees.handling) })]
475
+ }), /* @__PURE__ */ D("span", { children: x(P.pricing.fees.handling) })]
457
476
  }),
458
- P.pricing.fees.insurance && /* @__PURE__ */ k("div", {
477
+ P.pricing.fees.insurance && /* @__PURE__ */ O("div", {
459
478
  className: "flex justify-between text-sm",
460
- children: [/* @__PURE__ */ O("span", {
479
+ children: [/* @__PURE__ */ D("span", {
461
480
  className: "text-text-secondary",
462
481
  children: "Insurance"
463
- }), /* @__PURE__ */ O("span", { children: S(P.pricing.fees.insurance) })]
482
+ }), /* @__PURE__ */ D("span", { children: x(P.pricing.fees.insurance) })]
464
483
  }),
465
- /* @__PURE__ */ k("div", {
484
+ /* @__PURE__ */ O("div", {
466
485
  className: "flex justify-between text-sm",
467
- children: [/* @__PURE__ */ O("span", {
486
+ children: [/* @__PURE__ */ D("span", {
468
487
  className: "text-text-secondary",
469
488
  children: "Taxes"
470
- }), /* @__PURE__ */ O("span", { children: S(P.pricing.taxes) })]
489
+ }), /* @__PURE__ */ D("span", { children: x(P.pricing.taxes) })]
471
490
  }),
472
- /* @__PURE__ */ O(g, {}),
473
- /* @__PURE__ */ k("div", {
491
+ /* @__PURE__ */ D(h, {}),
492
+ /* @__PURE__ */ O("div", {
474
493
  className: "flex justify-between font-medium",
475
- children: [/* @__PURE__ */ O("span", { children: "Total" }), /* @__PURE__ */ O("span", {
494
+ children: [/* @__PURE__ */ D("span", { children: "Total" }), /* @__PURE__ */ D("span", {
476
495
  className: "text-lg",
477
- children: S(P.pricing.total)
496
+ children: x(P.pricing.total)
478
497
  })]
479
498
  }),
480
- /* @__PURE__ */ k("div", {
499
+ /* @__PURE__ */ O("div", {
481
500
  className: "pt-2",
482
- children: [/* @__PURE__ */ O("p", {
501
+ children: [/* @__PURE__ */ D("p", {
483
502
  className: "text-sm text-text-secondary",
484
503
  children: "Payment Method"
485
- }), /* @__PURE__ */ O("p", {
504
+ }), /* @__PURE__ */ D("p", {
486
505
  className: "text-sm capitalize",
487
506
  children: P.pricing.paymentMethod.replace("_", " ")
488
507
  })]
489
508
  })
490
509
  ]
491
510
  })] }),
492
- /* @__PURE__ */ k(d, { children: [/* @__PURE__ */ O(p, { children: /* @__PURE__ */ k(m, {
511
+ /* @__PURE__ */ O(u, { children: [/* @__PURE__ */ D(f, { children: /* @__PURE__ */ O(p, {
493
512
  className: "flex items-center gap-2",
494
- children: [/* @__PURE__ */ O(s, { size: 18 }), "Assignment"]
495
- }) }), /* @__PURE__ */ O(f, { children: /* @__PURE__ */ k("div", {
513
+ children: [/* @__PURE__ */ D(se, { size: 18 }), "Assignment"]
514
+ }) }), /* @__PURE__ */ D(d, { children: /* @__PURE__ */ O("div", {
496
515
  className: "space-y-4",
497
516
  children: [
498
- G && /* @__PURE__ */ O(we, { message: G }),
499
- We && /* @__PURE__ */ O(Te, { message: We }),
500
- /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
517
+ K && /* @__PURE__ */ D(Ee, { message: K }),
518
+ Ge && /* @__PURE__ */ D(De, { message: Ge }),
519
+ /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("p", {
501
520
  className: "text-sm text-text-secondary",
502
521
  children: "Tracking Number"
503
- }), /* @__PURE__ */ O("p", {
522
+ }), /* @__PURE__ */ D("p", {
504
523
  className: "text-sm font-mono",
505
524
  children: P.trackingNumber || "—"
506
525
  })] }),
507
- /* @__PURE__ */ O(g, {}),
508
- /* @__PURE__ */ k("div", {
526
+ /* @__PURE__ */ D(h, {}),
527
+ /* @__PURE__ */ O("div", {
509
528
  className: "space-y-3",
510
529
  children: [
511
- /* @__PURE__ */ k("div", {
530
+ /* @__PURE__ */ O("div", {
512
531
  className: "space-y-1.5",
513
- children: [/* @__PURE__ */ O(h, {
532
+ children: [/* @__PURE__ */ D(m, {
514
533
  htmlFor: "assign-fleet-search",
515
- children: "Search fleet"
516
- }), /* @__PURE__ */ O(he, {
517
- id: "assign-fleet-search",
518
- value: I,
519
- onChange: (e) => ze(e.target.value),
520
- placeholder: "Vehicle number, driver name or ID"
534
+ children: "Search vehicles & drivers"
535
+ }), /* @__PURE__ */ O("div", {
536
+ className: "relative",
537
+ children: [/* @__PURE__ */ D(oe, { className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }), /* @__PURE__ */ D(_e, {
538
+ id: "assign-fleet-search",
539
+ value: L,
540
+ onChange: (e) => Be(e.target.value),
541
+ placeholder: "Vehicle number, driver name or employee ID",
542
+ className: "pl-9"
543
+ })]
521
544
  })]
522
545
  }),
523
- /* @__PURE__ */ k("div", {
546
+ /* @__PURE__ */ O("div", {
524
547
  className: "space-y-1.5",
525
- children: [/* @__PURE__ */ O(h, {
548
+ children: [/* @__PURE__ */ D(m, {
526
549
  htmlFor: "assign-vehicle",
527
550
  children: "Vehicle"
528
- }), /* @__PURE__ */ O(w, {
551
+ }), /* @__PURE__ */ D(C, {
529
552
  id: "assign-vehicle",
530
- value: L,
531
- onChange: R,
532
- options: Ke,
533
- loading: Y,
553
+ value: R,
554
+ onChange: z,
555
+ options: qe,
556
+ loading: X,
534
557
  getId: (e) => e.id,
535
558
  getLabel: (e) => `${e.vehicleNumber} (${e.type})`,
536
- renderOption: (e) => /* @__PURE__ */ k(D, { children: [
559
+ renderOption: (e) => /* @__PURE__ */ O(E, { children: [
537
560
  e.vehicleNumber,
538
561
  " (",
539
562
  e.type,
540
563
  ")"
541
564
  ] }),
542
- selectedOption: Be,
543
- selectedLoading: Ve,
565
+ selectedOption: Ve,
566
+ selectedLoading: He,
544
567
  required: !0,
545
568
  placeholder: P.vehicleId ? `Current: ${P.vehicleId}` : "Select a vehicle",
546
569
  emptyText: "No available vehicles."
547
570
  })]
548
571
  }),
549
- /* @__PURE__ */ k("div", {
572
+ /* @__PURE__ */ O("div", {
550
573
  className: "space-y-1.5",
551
- children: [/* @__PURE__ */ O(h, {
574
+ children: [/* @__PURE__ */ D(m, {
552
575
  htmlFor: "assign-driver",
553
576
  children: "Driver"
554
- }), /* @__PURE__ */ O(w, {
577
+ }), /* @__PURE__ */ D(C, {
555
578
  id: "assign-driver",
556
- value: z,
557
- onChange: B,
558
- options: qe,
559
- loading: Z,
579
+ value: B,
580
+ onChange: V,
581
+ options: Je,
582
+ loading: Q,
560
583
  getId: (e) => e.id,
561
584
  getLabel: (e) => `${e.fullName} (${e.employeeId})`,
562
- renderOption: (e) => /* @__PURE__ */ k(D, { children: [
585
+ renderOption: (e) => /* @__PURE__ */ O(E, { children: [
563
586
  e.fullName,
564
587
  " (",
565
588
  e.employeeId,
566
589
  ")"
567
590
  ] }),
568
- selectedOption: He,
569
- selectedLoading: Ue,
591
+ selectedOption: Ue,
592
+ selectedLoading: We,
570
593
  required: !0,
571
594
  placeholder: P.driverId ? `Current: ${P.driverId}` : "Select a driver",
572
595
  emptyText: "No available drivers."
573
596
  })]
574
597
  }),
575
- /* @__PURE__ */ k(u, {
598
+ /* @__PURE__ */ O(l, {
576
599
  className: "w-full",
577
- onClick: Je,
578
- disabled: V || !L && !z,
579
- children: [/* @__PURE__ */ O(oe, { size: 16 }), V ? "Assigning…" : "Assign driver & vehicle"]
600
+ onClick: Ye,
601
+ disabled: H || !R && !B,
602
+ children: [/* @__PURE__ */ D(ce, { size: 16 }), H ? "Assigning…" : "Assign driver & vehicle"]
580
603
  })
581
604
  ]
582
605
  }),
583
- /* @__PURE__ */ O(g, {}),
584
- /* @__PURE__ */ k("div", {
606
+ /* @__PURE__ */ D(h, {}),
607
+ /* @__PURE__ */ O("div", {
585
608
  className: "space-y-2",
586
609
  children: [
587
- /* @__PURE__ */ k("p", {
610
+ /* @__PURE__ */ O("p", {
588
611
  className: "text-sm text-text-secondary",
589
612
  children: [
590
613
  "Current status:",
591
614
  " ",
592
- /* @__PURE__ */ O("span", {
615
+ /* @__PURE__ */ D("span", {
593
616
  className: "font-medium",
594
- children: j[P.status]
617
+ children: A[P.status]
595
618
  })
596
619
  ]
597
620
  }),
598
621
  (() => {
599
- let e = Pe(P.status);
600
- return e ? /* @__PURE__ */ k(u, {
622
+ let e = Ie(P.status);
623
+ if (!e) return null;
624
+ let n = e === "assigned" && (!P.vehicleId || !P.driverId);
625
+ return /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ O(l, {
601
626
  variant: "outline",
602
627
  className: "w-full",
603
- onClick: () => Q(e, `Order advanced to ${j[e]}.`),
604
- disabled: U,
605
- children: [/* @__PURE__ */ O(t, { size: 16 }), U ? "Updating…" : `Advance to ${j[e]}`]
606
- }) : null;
628
+ onClick: () => Xe(e, `Order advanced to ${A[e]}.`),
629
+ disabled: W || n,
630
+ children: [/* @__PURE__ */ D(t, { size: 16 }), W ? "Updating…" : `Advance to ${A[e]}`]
631
+ }), n && /* @__PURE__ */ D("p", {
632
+ className: "text-xs text-text-secondary",
633
+ children: "Assign both a compatible vehicle and driver before dispatching this order."
634
+ })] });
607
635
  })(),
608
- P.status !== "cancelled" && P.status !== "delivered" && /* @__PURE__ */ k(u, {
636
+ P.status !== "cancelled" && !j.has(P.status) && /* @__PURE__ */ O(l, {
609
637
  variant: "outline",
610
638
  className: "w-full text-status-error-text",
611
- onClick: () => Q("cancelled", "Order cancelled."),
612
- disabled: U,
613
- children: [/* @__PURE__ */ O(ee, { size: 16 }), "Cancel order"]
639
+ onClick: () => Xe("cancelled", "Order cancelled."),
640
+ disabled: W,
641
+ children: [/* @__PURE__ */ D(ee, { size: 16 }), "Cancel order"]
614
642
  })
615
643
  ]
616
644
  }),
617
- /* @__PURE__ */ k(u, {
645
+ /* @__PURE__ */ O(l, {
618
646
  variant: "outline",
619
647
  className: "w-full",
620
648
  onClick: () => $(`tracking?order=${P.id}`),
621
- children: [/* @__PURE__ */ O(r, { size: 16 }), "Track Order"]
649
+ children: [/* @__PURE__ */ D(r, { size: 16 }), "Track Order"]
622
650
  })
623
651
  ]
624
652
  }) })] }),
625
- /* @__PURE__ */ O(De, {
653
+ /* @__PURE__ */ D(ke, {
626
654
  entityType: "order",
627
655
  entityId: P.id
628
656
  }),
629
- /* @__PURE__ */ O(ke, { deliveryJobId: P.id }),
630
- P.specialInstructions && /* @__PURE__ */ k(d, { children: [/* @__PURE__ */ O(p, { children: /* @__PURE__ */ k(m, {
657
+ /* @__PURE__ */ D(je, { deliveryJobId: P.id }),
658
+ P.specialInstructions && /* @__PURE__ */ O(u, { children: [/* @__PURE__ */ D(f, { children: /* @__PURE__ */ O(p, {
631
659
  className: "flex items-center gap-2",
632
- children: [/* @__PURE__ */ O(re, { size: 18 }), "Special Instructions"]
633
- }) }), /* @__PURE__ */ O(f, { children: /* @__PURE__ */ O("p", {
660
+ children: [/* @__PURE__ */ D(re, { size: 18 }), "Special Instructions"]
661
+ }) }), /* @__PURE__ */ D(d, { children: /* @__PURE__ */ D("p", {
634
662
  className: "text-sm",
635
663
  children: P.specialInstructions
636
664
  }) })] })