@burdenoff/microfe-movethewheels 2026.920.3 → 2026.923.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 (79) hide show
  1. package/dist/components/CarbonFootprintPanel.js +1 -1
  2. package/dist/components/CustomerPicker.js +76 -65
  3. package/dist/components/DataTable.js +140 -139
  4. package/dist/components/DocumentsCard.js +14 -8
  5. package/dist/generated/wspace-types.d.ts +2719 -8
  6. package/dist/hooks/index.js +1 -1
  7. package/dist/hooks/useAnalytics.js +21 -1
  8. package/dist/hooks/useCustomers.js +94 -78
  9. package/dist/hooks/useDebouncedValue.js +11 -0
  10. package/dist/hooks/useEntityDocuments.js +28 -18
  11. package/dist/hooks/useEpod.js +24 -17
  12. package/dist/hooks/useFleet.js +148 -125
  13. package/dist/hooks/useInventory.js +255 -186
  14. package/dist/hooks/useMultiModalShipments.js +35 -27
  15. package/dist/hooks/useOrders.js +139 -134
  16. package/dist/hooks/useRoutes.js +97 -75
  17. package/dist/hooks/useTracking.js +100 -88
  18. package/dist/index.js +6 -6
  19. package/dist/movethewheels/components/CustomerPicker.d.ts +3 -1
  20. package/dist/movethewheels/components/DataTable.d.ts +5 -1
  21. package/dist/movethewheels/hooks/useCustomers.d.ts +0 -1
  22. package/dist/movethewheels/hooks/useDebouncedValue.d.ts +1 -0
  23. package/dist/movethewheels/hooks/useEntityDocuments.d.ts +2 -0
  24. package/dist/movethewheels/hooks/useEpod.d.ts +6 -1
  25. package/dist/movethewheels/hooks/useFleet.d.ts +49 -5
  26. package/dist/movethewheels/hooks/useInventory.d.ts +24 -17
  27. package/dist/movethewheels/hooks/useMultiModalShipments.d.ts +6 -1
  28. package/dist/movethewheels/hooks/useOrders.d.ts +48 -5
  29. package/dist/movethewheels/hooks/useRoutes.d.ts +18 -1
  30. package/dist/movethewheels/hooks/useTracking.d.ts +12 -11
  31. package/dist/movethewheels/types/index.d.ts +12 -5
  32. package/dist/pages/CreateOrderPage.js +191 -129
  33. package/dist/pages/CustomersPage.js +61 -54
  34. package/dist/pages/DeliveryCapturePage.js +131 -109
  35. package/dist/pages/DriversPage.js +100 -92
  36. package/dist/pages/InventoryPage.js +239 -236
  37. package/dist/pages/MultiModalShipmentPage.js +163 -130
  38. package/dist/pages/OrderDetailsPage.js +190 -106
  39. package/dist/pages/OrdersListPage.js +66 -60
  40. package/dist/pages/ProductDetailsPage.js +241 -200
  41. package/dist/pages/ProductsPage.js +59 -52
  42. package/dist/pages/RouteDetailsPage.js +324 -293
  43. package/dist/pages/RoutesPage.js +55 -48
  44. package/dist/pages/VehiclesPage.js +63 -56
  45. package/dist/pages/WarehousesPage.js +60 -53
  46. package/package.json +1 -1
  47. package/src/generated/wspace-types.ts +3136 -8
  48. package/src/movethewheels/components/CarbonFootprintPanel.tsx +0 -1
  49. package/src/movethewheels/components/CustomerPicker.tsx +14 -0
  50. package/src/movethewheels/components/DataTable.tsx +34 -18
  51. package/src/movethewheels/components/DocumentsCard.tsx +6 -1
  52. package/src/movethewheels/components/maps/leaflet-setup.ts +1 -8
  53. package/src/movethewheels/hooks/useAnalytics.ts +27 -0
  54. package/src/movethewheels/hooks/useCustomers.ts +64 -24
  55. package/src/movethewheels/hooks/useDebouncedValue.ts +12 -0
  56. package/src/movethewheels/hooks/useEntityDocuments.ts +43 -25
  57. package/src/movethewheels/hooks/useEpod.ts +14 -7
  58. package/src/movethewheels/hooks/useFleet.ts +66 -38
  59. package/src/movethewheels/hooks/useFleetIntelligence.ts +1 -4
  60. package/src/movethewheels/hooks/useInventory.ts +211 -90
  61. package/src/movethewheels/hooks/useMultiModalShipments.ts +15 -11
  62. package/src/movethewheels/hooks/useOrders.ts +48 -14
  63. package/src/movethewheels/hooks/useRoutes.ts +81 -24
  64. package/src/movethewheels/hooks/useTracking.ts +130 -98
  65. package/src/movethewheels/pages/CreateOrderPage.tsx +93 -2
  66. package/src/movethewheels/pages/CustomersPage.tsx +11 -1
  67. package/src/movethewheels/pages/DeliveryCapturePage.tsx +31 -1
  68. package/src/movethewheels/pages/DriversPage.tsx +24 -12
  69. package/src/movethewheels/pages/InventoryPage.tsx +57 -32
  70. package/src/movethewheels/pages/MultiModalShipmentPage.tsx +52 -3
  71. package/src/movethewheels/pages/OrderDetailsPage.tsx +91 -6
  72. package/src/movethewheels/pages/OrdersListPage.tsx +20 -3
  73. package/src/movethewheels/pages/ProductDetailsPage.tsx +52 -3
  74. package/src/movethewheels/pages/ProductsPage.tsx +11 -1
  75. package/src/movethewheels/pages/RouteDetailsPage.tsx +45 -5
  76. package/src/movethewheels/pages/RoutesPage.tsx +11 -1
  77. package/src/movethewheels/pages/VehiclesPage.tsx +19 -2
  78. package/src/movethewheels/pages/WarehousesPage.tsx +11 -1
  79. package/src/movethewheels/types/index.ts +12 -5
@@ -12,28 +12,32 @@ import { SquarePen as u } from "../node_modules/lucide-react/dist/esm/icons/squa
12
12
  import { Trash2 as d } from "../node_modules/lucide-react/dist/esm/icons/trash-2.js";
13
13
  import { Zap as f } from "../node_modules/lucide-react/dist/esm/icons/zap.js";
14
14
  import { joinPath as p } from "../utils/navigation.js";
15
- import { useMoveTheWheels as m } from "../providers/MoveTheWheelsProvider.js";
16
- import { useFleet as h } from "../hooks/useFleet.js";
17
- import { useRoute as ee, useRoutes as g } from "../hooks/useRoutes.js";
15
+ import { useMoveTheWheels as ee } from "../providers/MoveTheWheelsProvider.js";
16
+ import { useRoute as m, useRoutes as te } from "../hooks/useRoutes.js";
17
+ import { useDriver as ne, useFleet as h, useVehicle as g } from "../hooks/useFleet.js";
18
18
  import { Badge as _, 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 } from "../components/ui.js";
19
- import { ErrorState as A, LoadingState as j, PageLayout as M } from "../components/PageLayout.js";
20
- import { RouteMap as N } from "../components/maps/RouteMap.js";
19
+ import { ErrorState as re, LoadingState as A, PageLayout as ie } from "../components/PageLayout.js";
20
+ import { RouteMap as j } from "../components/maps/RouteMap.js";
21
21
  import "../components/maps/index.js";
22
- import { ROUTE_STATUS_COLORS as P } from "../constants/index.js";
23
- import { StatusBadge as F } from "../components/StatusBadge.js";
24
- import { FormError as I } from "../components/FormError.js";
25
- import { Notice as L, useNotice as R } from "../components/Notice.js";
26
- import { formatAddress as z, formatCurrency as B, formatDate as V } from "../utils/formatters.js";
27
- import { firstRealLatLng as te } from "../utils/mapMarkers.js";
28
- import { useAssignmentSuggestions as H } from "../hooks/useFleetIntelligence.js";
29
- import { AssignmentSuggestions as U } from "../components/AssignmentSuggestions.js";
30
- import { useEffect as W, useState as G } from "react";
31
- import { useLocation as K, useParams as q } from "react-router";
32
- import { jsx as J, jsxs as Y } from "react/jsx-runtime";
33
- import { useI18n as ne } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
34
- import { EmphasisPanel as X, NextSteps as re, PagePurpose as Z } from "@burdenoff/fe-libs/ui";
22
+ import { ROUTE_STATUS_COLORS as M } from "../constants/index.js";
23
+ import { StatusBadge as N } from "../components/StatusBadge.js";
24
+ import { FormError as ae } from "../components/FormError.js";
25
+ import { Notice as oe, useNotice as P } from "../components/Notice.js";
26
+ import { formatAddress as F, formatCurrency as se, formatDate as I } from "../utils/formatters.js";
27
+ import { useDebouncedValue as L } from "../hooks/useDebouncedValue.js";
28
+ import { firstRealLatLng as ce } from "../utils/mapMarkers.js";
29
+ import { useAssignmentSuggestions as le } from "../hooks/useFleetIntelligence.js";
30
+ import { AssignmentSuggestions as R } from "../components/AssignmentSuggestions.js";
31
+ import { useEffect as z, useState as B } from "react";
32
+ import { useLocation as V, useParams as H } from "react-router";
33
+ import { jsx as U, jsxs as W } from "react/jsx-runtime";
34
+ import { useI18n as G } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
35
+ import { EmphasisPanel as K, NextSteps as ue, PagePurpose as de } from "@burdenoff/fe-libs/ui";
35
36
  //#region src/movethewheels/pages/RouteDetailsPage.tsx
36
- var Q = [
37
+ function q(e, t) {
38
+ return !t || e.some((e) => e.id === t.id) ? e : [t, ...e];
39
+ }
40
+ var J = [
37
41
  {
38
42
  value: "planned",
39
43
  label: "Planned"
@@ -51,8 +55,8 @@ var Q = [
51
55
  label: "Cancelled"
52
56
  }
53
57
  ];
54
- function ie({ editId: r }) {
55
- let { basePath: i, navigate: a } = m(), { createRoute: o, updateRoute: u } = g(), { route: f } = ee(r), { vehicles: _, drivers: A } = h(), j = !!r, [N, P] = G({
58
+ function Y({ editId: r }) {
59
+ let { basePath: i, navigate: a } = ee(), { createRoute: o, updateRoute: u } = te(), { route: f } = m(r), [_, re] = B(""), A = L(_), j = !!r, [M, N] = B({
56
60
  name: "",
57
61
  status: "planned",
58
62
  vehicleId: "",
@@ -61,15 +65,27 @@ function ie({ editId: r }) {
61
65
  address: "",
62
66
  type: "delivery"
63
67
  }]
64
- }), [F, L] = G(!1), [R, B] = G(null);
65
- W(() => {
66
- !r || !f || P({
68
+ }), { vehicles: oe } = h({
69
+ limit: 20,
70
+ filters: {
71
+ search: A || void 0,
72
+ driverId: M.driverId || void 0
73
+ }
74
+ }), { drivers: P } = h({
75
+ limit: 20,
76
+ filters: {
77
+ search: A || void 0,
78
+ vehicleId: M.vehicleId || void 0
79
+ }
80
+ }), { vehicle: se } = g(M.vehicleId || void 0), { driver: I } = ne(M.driverId || void 0), ce = q(oe, se), le = q(P, I), [R, V] = B(!1), [H, G] = B(null);
81
+ z(() => {
82
+ !r || !f || N({
67
83
  name: f.name || "",
68
84
  status: f.status,
69
85
  vehicleId: f.vehicleId || "",
70
86
  driverId: f.driverId || "",
71
87
  stops: f.stops.length > 0 ? f.stops.map((e) => ({
72
- address: z(e.address) || e.address.street || "",
88
+ address: F(e.address) || e.address.street || "",
73
89
  type: e.type
74
90
  })) : [{
75
91
  address: "",
@@ -77,22 +93,22 @@ function ie({ editId: r }) {
77
93
  }]
78
94
  });
79
95
  }, [r, f]);
80
- let V = () => a?.(p(i, "routes")), te = () => P((e) => ({
96
+ let ue = () => a?.(p(i, "routes")), Y = () => N((e) => ({
81
97
  ...e,
82
98
  stops: [...e.stops, {
83
99
  address: "",
84
100
  type: "delivery"
85
101
  }]
86
- })), H = (e) => P((t) => ({
102
+ })), X = (e) => N((t) => ({
87
103
  ...t,
88
104
  stops: t.stops.filter((t, n) => n !== e)
89
- })), U = (e, t, n) => P((r) => ({
105
+ })), Z = (e, t, n) => N((r) => ({
90
106
  ...r,
91
107
  stops: r.stops.map((r, i) => i === e ? {
92
108
  ...r,
93
109
  [t]: n
94
110
  } : r)
95
- })), K = (e, t) => P((n) => {
111
+ })), Q = (e, t) => N((n) => {
96
112
  let r = e + t;
97
113
  if (r < 0 || r >= n.stops.length) return n;
98
114
  let i = [...n.stops];
@@ -100,17 +116,17 @@ function ie({ editId: r }) {
100
116
  ...n,
101
117
  stops: i
102
118
  };
103
- }), q = async (e) => {
104
- if (e.preventDefault(), !N.name.trim()) {
105
- B("Route name is required.");
119
+ }), $ = async (e) => {
120
+ if (e.preventDefault(), !M.name.trim()) {
121
+ G("Route name is required.");
106
122
  return;
107
123
  }
108
- let t = N.stops.filter((e) => e.address.trim());
124
+ let t = M.stops.filter((e) => e.address.trim());
109
125
  if (t.length === 0) {
110
- B("Add at least one stop with an address.");
126
+ G("Add at least one stop with an address.");
111
127
  return;
112
128
  }
113
- L(!0), B(null);
129
+ V(!0), G(null);
114
130
  try {
115
131
  let e = t.map((e, t) => ({
116
132
  id: `stop-${t + 1}`,
@@ -130,237 +146,252 @@ function ie({ editId: r }) {
130
146
  }));
131
147
  if (j) {
132
148
  let t = await u(r, {
133
- name: N.name.trim(),
134
- status: N.status,
135
- vehicleId: N.vehicleId || void 0,
136
- driverId: N.driverId || void 0,
149
+ name: M.name.trim(),
150
+ status: M.status,
151
+ vehicleId: M.vehicleId || void 0,
152
+ driverId: M.driverId || void 0,
137
153
  stops: e
138
154
  });
139
155
  a?.(p(i, `routes/${t.id}`));
140
156
  return;
141
157
  }
142
158
  let n = await o({
143
- name: N.name.trim(),
144
- status: N.status,
145
- vehicleId: N.vehicleId || void 0,
146
- driverId: N.driverId || void 0,
159
+ name: M.name.trim(),
160
+ status: M.status,
161
+ vehicleId: M.vehicleId || void 0,
162
+ driverId: M.driverId || void 0,
147
163
  stops: e
148
164
  });
149
165
  a?.(p(i, `routes/${n.id}`));
150
166
  } catch (e) {
151
- console.error("Failed to create route:", e), B(e instanceof Error ? e.message : "Failed to create route. Please try again."), L(!1);
167
+ console.error("Failed to create route:", e), G(e instanceof Error ? e.message : "Failed to create route. Please try again."), V(!1);
152
168
  }
153
169
  };
154
- return /* @__PURE__ */ Y(M, {
170
+ return /* @__PURE__ */ W(ie, {
155
171
  title: j ? "Edit Route" : "Create Route",
156
172
  subtitle: "Plan a new delivery route",
157
- icon: /* @__PURE__ */ J(s, { size: 24 }),
158
- headerActions: /* @__PURE__ */ Y("div", {
173
+ icon: /* @__PURE__ */ U(s, { size: 24 }),
174
+ headerActions: /* @__PURE__ */ W("div", {
159
175
  className: "flex gap-2",
160
- children: [/* @__PURE__ */ Y(v, {
176
+ children: [/* @__PURE__ */ W(v, {
161
177
  variant: "outline",
162
- onClick: V,
163
- disabled: F,
164
- children: [/* @__PURE__ */ J(t, { size: 16 }), " Cancel"]
165
- }), /* @__PURE__ */ Y(v, {
166
- onClick: q,
167
- disabled: F,
178
+ onClick: ue,
179
+ disabled: R,
180
+ children: [/* @__PURE__ */ U(t, { size: 16 }), " Cancel"]
181
+ }), /* @__PURE__ */ W(v, {
182
+ onClick: $,
183
+ disabled: R,
168
184
  children: [
169
- /* @__PURE__ */ J(l, { size: 16 }),
185
+ /* @__PURE__ */ U(l, { size: 16 }),
170
186
  " ",
171
- j ? F ? "Saving..." : "Save Changes" : F ? "Saving..." : "Create Route"
187
+ j ? R ? "Saving..." : "Save Changes" : R ? "Saving..." : "Create Route"
172
188
  ]
173
189
  })]
174
190
  }),
175
- children: [/* @__PURE__ */ J(Z, {
176
- icon: /* @__PURE__ */ J(s, { size: 18 }),
191
+ children: [/* @__PURE__ */ U(de, {
192
+ icon: /* @__PURE__ */ U(s, { size: 18 }),
177
193
  children: "Plan a new delivery route — name it, list the stops to visit, and optionally assign a vehicle and driver. Once created you can optimize it to sequence the stops into the shortest run."
178
- }), /* @__PURE__ */ Y("form", {
179
- onSubmit: q,
194
+ }), /* @__PURE__ */ W("form", {
195
+ onSubmit: $,
180
196
  className: "max-w-3xl space-y-6",
181
197
  children: [
182
- /* @__PURE__ */ J(I, { message: R }),
183
- /* @__PURE__ */ Y(X, { children: [/* @__PURE__ */ J("h2", {
198
+ /* @__PURE__ */ U(ae, { message: H }),
199
+ /* @__PURE__ */ W(K, { children: [/* @__PURE__ */ U("h2", {
184
200
  className: "text-base font-semibold text-text-primary mb-4",
185
201
  children: "Route Details"
186
- }), /* @__PURE__ */ Y("div", {
202
+ }), /* @__PURE__ */ W("div", {
187
203
  className: "space-y-4",
188
- children: [/* @__PURE__ */ Y("div", {
189
- className: "grid grid-cols-1 md:grid-cols-2 gap-4",
190
- children: [/* @__PURE__ */ Y("div", {
191
- className: "space-y-2",
192
- children: [/* @__PURE__ */ Y(w, {
193
- htmlFor: "name",
194
- children: ["Route Name ", /* @__PURE__ */ J("span", {
195
- className: "text-status-error-text",
196
- children: "*"
204
+ children: [
205
+ /* @__PURE__ */ W("div", {
206
+ className: "grid grid-cols-1 md:grid-cols-2 gap-4",
207
+ children: [/* @__PURE__ */ W("div", {
208
+ className: "space-y-2",
209
+ children: [/* @__PURE__ */ W(w, {
210
+ htmlFor: "name",
211
+ children: ["Route Name ", /* @__PURE__ */ U("span", {
212
+ className: "text-status-error-text",
213
+ children: "*"
214
+ })]
215
+ }), /* @__PURE__ */ U(C, {
216
+ id: "name",
217
+ value: M.name,
218
+ onChange: (e) => N((t) => ({
219
+ ...t,
220
+ name: e.target.value
221
+ })),
222
+ placeholder: "Downtown morning run",
223
+ required: !0
224
+ })]
225
+ }), /* @__PURE__ */ W("div", {
226
+ className: "space-y-2",
227
+ children: [/* @__PURE__ */ U(w, {
228
+ htmlFor: "status",
229
+ children: "Status"
230
+ }), /* @__PURE__ */ W(T, {
231
+ value: M.status,
232
+ onValueChange: (e) => N((t) => ({
233
+ ...t,
234
+ status: e
235
+ })),
236
+ children: [/* @__PURE__ */ U(O, {
237
+ id: "status",
238
+ children: /* @__PURE__ */ U(k, {})
239
+ }), /* @__PURE__ */ U(E, { children: J.map((e) => /* @__PURE__ */ U(D, {
240
+ value: e.value,
241
+ children: e.label
242
+ }, e.value)) })]
197
243
  })]
198
- }), /* @__PURE__ */ J(C, {
199
- id: "name",
200
- value: N.name,
201
- onChange: (e) => P((t) => ({
202
- ...t,
203
- name: e.target.value
204
- })),
205
- placeholder: "Downtown morning run",
206
- required: !0
207
- })]
208
- }), /* @__PURE__ */ Y("div", {
209
- className: "space-y-2",
210
- children: [/* @__PURE__ */ J(w, {
211
- htmlFor: "status",
212
- children: "Status"
213
- }), /* @__PURE__ */ Y(T, {
214
- value: N.status,
215
- onValueChange: (e) => P((t) => ({
216
- ...t,
217
- status: e
218
- })),
219
- children: [/* @__PURE__ */ J(O, {
220
- id: "status",
221
- children: /* @__PURE__ */ J(k, {})
222
- }), /* @__PURE__ */ J(E, { children: Q.map((e) => /* @__PURE__ */ J(D, {
223
- value: e.value,
224
- children: e.label
225
- }, e.value)) })]
226
244
  })]
227
- })]
228
- }), /* @__PURE__ */ Y("div", {
229
- className: "grid grid-cols-1 md:grid-cols-2 gap-4",
230
- children: [/* @__PURE__ */ Y("div", {
245
+ }),
246
+ /* @__PURE__ */ W("div", {
231
247
  className: "space-y-2",
232
- children: [/* @__PURE__ */ J(w, {
233
- htmlFor: "vehicle",
234
- children: "Vehicle (optional)"
235
- }), /* @__PURE__ */ Y(T, {
236
- value: N.vehicleId,
237
- onValueChange: (e) => P((t) => ({
238
- ...t,
239
- vehicleId: e
240
- })),
241
- children: [/* @__PURE__ */ J(O, {
242
- id: "vehicle",
243
- children: /* @__PURE__ */ J(k, { placeholder: "Assign later" })
244
- }), /* @__PURE__ */ J(E, { children: _.map((e) => /* @__PURE__ */ Y(D, {
245
- value: e.id,
246
- children: [
247
- e.vehicleNumber,
248
- " (",
249
- e.type,
250
- ")"
251
- ]
252
- }, e.id)) })]
248
+ children: [/* @__PURE__ */ U(w, {
249
+ htmlFor: "fleet-search",
250
+ children: "Search fleet"
251
+ }), /* @__PURE__ */ U(C, {
252
+ id: "fleet-search",
253
+ value: _,
254
+ onChange: (e) => re(e.target.value),
255
+ placeholder: "Vehicle number, driver name or ID"
253
256
  })]
254
- }), /* @__PURE__ */ Y("div", {
255
- className: "space-y-2",
256
- children: [/* @__PURE__ */ J(w, {
257
- htmlFor: "driver",
258
- children: "Driver (optional)"
259
- }), /* @__PURE__ */ Y(T, {
260
- value: N.driverId,
261
- onValueChange: (e) => P((t) => ({
262
- ...t,
263
- driverId: e
264
- })),
265
- children: [/* @__PURE__ */ J(O, {
266
- id: "driver",
267
- children: /* @__PURE__ */ J(k, { placeholder: "Assign later" })
268
- }), /* @__PURE__ */ J(E, { children: A.map((e) => /* @__PURE__ */ Y(D, {
269
- value: e.id,
270
- children: [
271
- e.fullName,
272
- " (",
273
- e.employeeId,
274
- ")"
275
- ]
276
- }, e.id)) })]
257
+ }),
258
+ /* @__PURE__ */ W("div", {
259
+ className: "grid grid-cols-1 md:grid-cols-2 gap-4",
260
+ children: [/* @__PURE__ */ W("div", {
261
+ className: "space-y-2",
262
+ children: [/* @__PURE__ */ U(w, {
263
+ htmlFor: "vehicle",
264
+ children: "Vehicle (optional)"
265
+ }), /* @__PURE__ */ W(T, {
266
+ value: M.vehicleId,
267
+ onValueChange: (e) => N((t) => ({
268
+ ...t,
269
+ vehicleId: e
270
+ })),
271
+ children: [/* @__PURE__ */ U(O, {
272
+ id: "vehicle",
273
+ children: /* @__PURE__ */ U(k, { placeholder: "Assign later" })
274
+ }), /* @__PURE__ */ U(E, { children: ce.map((e) => /* @__PURE__ */ W(D, {
275
+ value: e.id,
276
+ children: [
277
+ e.vehicleNumber,
278
+ " (",
279
+ e.type,
280
+ ")"
281
+ ]
282
+ }, e.id)) })]
283
+ })]
284
+ }), /* @__PURE__ */ W("div", {
285
+ className: "space-y-2",
286
+ children: [/* @__PURE__ */ U(w, {
287
+ htmlFor: "driver",
288
+ children: "Driver (optional)"
289
+ }), /* @__PURE__ */ W(T, {
290
+ value: M.driverId,
291
+ onValueChange: (e) => N((t) => ({
292
+ ...t,
293
+ driverId: e
294
+ })),
295
+ children: [/* @__PURE__ */ U(O, {
296
+ id: "driver",
297
+ children: /* @__PURE__ */ U(k, { placeholder: "Assign later" })
298
+ }), /* @__PURE__ */ U(E, { children: le.map((e) => /* @__PURE__ */ W(D, {
299
+ value: e.id,
300
+ children: [
301
+ e.fullName,
302
+ " (",
303
+ e.employeeId,
304
+ ")"
305
+ ]
306
+ }, e.id)) })]
307
+ })]
277
308
  })]
278
- })]
279
- })]
309
+ })
310
+ ]
280
311
  })] }),
281
- /* @__PURE__ */ Y(y, { children: [/* @__PURE__ */ Y(x, {
312
+ /* @__PURE__ */ W(y, { children: [/* @__PURE__ */ W(x, {
282
313
  className: "flex flex-row items-center justify-between",
283
- children: [/* @__PURE__ */ Y(S, { children: ["Stops ", /* @__PURE__ */ J("span", {
314
+ children: [/* @__PURE__ */ W(S, { children: ["Stops ", /* @__PURE__ */ U("span", {
284
315
  className: "text-status-error-text",
285
316
  children: "*"
286
- })] }), /* @__PURE__ */ Y(v, {
317
+ })] }), /* @__PURE__ */ W(v, {
287
318
  type: "button",
288
319
  variant: "outline",
289
320
  size: "sm",
290
- onClick: te,
291
- children: [/* @__PURE__ */ J(c, { size: 16 }), " Add Stop"]
321
+ onClick: Y,
322
+ children: [/* @__PURE__ */ U(c, { size: 16 }), " Add Stop"]
292
323
  })]
293
- }), /* @__PURE__ */ J(b, {
324
+ }), /* @__PURE__ */ U(b, {
294
325
  className: "space-y-4",
295
- children: N.stops.map((t, r) => /* @__PURE__ */ Y("div", {
326
+ children: M.stops.map((t, r) => /* @__PURE__ */ W("div", {
296
327
  className: "grid grid-cols-1 md:grid-cols-12 gap-3 items-end",
297
328
  children: [
298
- /* @__PURE__ */ Y("div", {
329
+ /* @__PURE__ */ W("div", {
299
330
  className: "md:col-span-7 space-y-2",
300
- children: [/* @__PURE__ */ Y(w, {
331
+ children: [/* @__PURE__ */ W(w, {
301
332
  htmlFor: `stop-address-${r}`,
302
333
  children: [
303
334
  "Stop ",
304
335
  r + 1,
305
336
  " address"
306
337
  ]
307
- }), /* @__PURE__ */ J(C, {
338
+ }), /* @__PURE__ */ U(C, {
308
339
  id: `stop-address-${r}`,
309
340
  value: t.address,
310
- onChange: (e) => U(r, "address", e.target.value),
341
+ onChange: (e) => Z(r, "address", e.target.value),
311
342
  placeholder: "123 Main St, San Francisco, CA"
312
343
  })]
313
344
  }),
314
- /* @__PURE__ */ Y("div", {
345
+ /* @__PURE__ */ W("div", {
315
346
  className: "md:col-span-4 space-y-2",
316
- children: [/* @__PURE__ */ J(w, {
347
+ children: [/* @__PURE__ */ U(w, {
317
348
  htmlFor: `stop-type-${r}`,
318
349
  children: "Type"
319
- }), /* @__PURE__ */ Y(T, {
350
+ }), /* @__PURE__ */ W(T, {
320
351
  value: t.type,
321
- onValueChange: (e) => U(r, "type", e),
322
- children: [/* @__PURE__ */ J(O, {
352
+ onValueChange: (e) => Z(r, "type", e),
353
+ children: [/* @__PURE__ */ U(O, {
323
354
  id: `stop-type-${r}`,
324
- children: /* @__PURE__ */ J(k, {})
325
- }), /* @__PURE__ */ Y(E, { children: [/* @__PURE__ */ J(D, {
355
+ children: /* @__PURE__ */ U(k, {})
356
+ }), /* @__PURE__ */ W(E, { children: [/* @__PURE__ */ U(D, {
326
357
  value: "pickup",
327
358
  children: "Pickup"
328
- }), /* @__PURE__ */ J(D, {
359
+ }), /* @__PURE__ */ U(D, {
329
360
  value: "delivery",
330
361
  children: "Delivery"
331
362
  })] })]
332
363
  })]
333
364
  }),
334
- /* @__PURE__ */ Y("div", {
365
+ /* @__PURE__ */ W("div", {
335
366
  className: "md:col-span-1 flex justify-end gap-1",
336
367
  children: [
337
- /* @__PURE__ */ J(v, {
368
+ /* @__PURE__ */ U(v, {
338
369
  type: "button",
339
370
  variant: "ghost",
340
371
  size: "icon",
341
- onClick: () => K(r, -1),
372
+ onClick: () => Q(r, -1),
342
373
  disabled: r === 0,
343
374
  "aria-label": `Move stop ${r + 1} up`,
344
- children: /* @__PURE__ */ J(n, { size: 16 })
375
+ children: /* @__PURE__ */ U(n, { size: 16 })
345
376
  }),
346
- /* @__PURE__ */ J(v, {
377
+ /* @__PURE__ */ U(v, {
347
378
  type: "button",
348
379
  variant: "ghost",
349
380
  size: "icon",
350
- onClick: () => K(r, 1),
351
- disabled: r === N.stops.length - 1,
381
+ onClick: () => Q(r, 1),
382
+ disabled: r === M.stops.length - 1,
352
383
  "aria-label": `Move stop ${r + 1} down`,
353
- children: /* @__PURE__ */ J(e, { size: 16 })
384
+ children: /* @__PURE__ */ U(e, { size: 16 })
354
385
  }),
355
- /* @__PURE__ */ J(v, {
386
+ /* @__PURE__ */ U(v, {
356
387
  type: "button",
357
388
  variant: "ghost",
358
389
  size: "icon",
359
390
  className: "text-status-error-text",
360
- onClick: () => H(r),
361
- disabled: N.stops.length === 1,
391
+ onClick: () => X(r),
392
+ disabled: M.stops.length === 1,
362
393
  "aria-label": `Remove stop ${r + 1}`,
363
- children: /* @__PURE__ */ J(d, { size: 16 })
394
+ children: /* @__PURE__ */ U(d, { size: 16 })
364
395
  })
365
396
  ]
366
397
  })
@@ -371,186 +402,186 @@ function ie({ editId: r }) {
371
402
  })]
372
403
  });
373
404
  }
374
- function $() {
375
- let { routeId: e } = q(), n = K().pathname.endsWith("/edit"), { basePath: c, navigate: l } = m(), { route: d, isLoading: h, error: C, refetch: w } = ee(e), { optimizeRoute: T, updateRoute: E } = g(), D = H(e), { t: O } = ne(), k = (e, t) => {
376
- let n = O(e);
405
+ function X() {
406
+ let { routeId: e } = H(), n = V().pathname.endsWith("/edit"), { basePath: c, navigate: l } = ee(), { route: d, isLoading: ne, error: h, refetch: g } = m(e), { optimizeRoute: C, updateRoute: w } = te(), T = le(e), { t: E } = G(), D = (e, t) => {
407
+ let n = E(e);
377
408
  return n === e ? t : n;
378
- }, { message: W, notify: Q } = R(), [$, ae] = G(null), [oe, se] = G(!1), ce = () => l?.(p(c, "routes")), le = (e) => l?.(p(c, e)), ue = async () => {
409
+ }, { message: O, notify: k } = P(), [L, z] = B(null), [q, J] = B(!1), X = () => l?.(p(c, "routes")), Z = (e) => l?.(p(c, e)), Q = async () => {
379
410
  if (e) {
380
- se(!0), ae(null);
411
+ J(!0), z(null);
381
412
  try {
382
- await T(e), Q("Route optimized — stops resequenced for the shortest run."), w();
413
+ await C(e), k("Route optimized — stops resequenced for the shortest run."), g();
383
414
  } catch (e) {
384
- ae(e instanceof Error ? e.message : "Failed to optimize route.");
415
+ z(e instanceof Error ? e.message : "Failed to optimize route.");
385
416
  } finally {
386
- se(!1);
417
+ J(!1);
387
418
  }
388
419
  }
389
- }, de = async (t) => {
390
- e && (await E(e, t), Q(k("movethewheels.routes.suggest.done", "Assignment saved.")), w(), D.refetch());
420
+ }, $ = async (t) => {
421
+ e && (await w(e, t), k(D("movethewheels.routes.suggest.done", "Assignment saved.")), g(), T.refetch());
391
422
  };
392
- if (!e) return /* @__PURE__ */ J(ie, {});
393
- if (n) return /* @__PURE__ */ J(ie, { editId: e });
394
- if (h) return /* @__PURE__ */ J(j, { message: "Loading route details..." });
395
- if (C || !d) return /* @__PURE__ */ J(A, {
423
+ if (!e) return /* @__PURE__ */ U(Y, {});
424
+ if (n) return /* @__PURE__ */ U(Y, { editId: e });
425
+ if (ne) return /* @__PURE__ */ U(A, { message: "Loading route details..." });
426
+ if (h || !d) return /* @__PURE__ */ U(re, {
396
427
  title: "Route not found",
397
- onRetry: w
428
+ onRetry: g
398
429
  });
399
430
  let fe = d.stops.map((e) => {
400
- let t = te(e.address);
431
+ let t = ce(e.address);
401
432
  return t ? {
402
433
  lat: t.lat,
403
434
  lng: t.lng,
404
435
  sequence: e.sequence,
405
- label: z(e.address) || `Order #${e.orderId || e.sequence}`
436
+ label: F(e.address) || `Order #${e.orderId || e.sequence}`
406
437
  } : null;
407
438
  }).filter((e) => e !== null);
408
- return /* @__PURE__ */ Y(M, {
439
+ return /* @__PURE__ */ W(ie, {
409
440
  title: d.name,
410
441
  subtitle: `${d.stops.length} stops - ${d.distance.toFixed(1)} km`,
411
- icon: /* @__PURE__ */ J(s, { size: 24 }),
412
- headerActions: /* @__PURE__ */ Y("div", {
442
+ icon: /* @__PURE__ */ U(s, { size: 24 }),
443
+ headerActions: /* @__PURE__ */ W("div", {
413
444
  className: "flex gap-2",
414
445
  children: [
415
- /* @__PURE__ */ Y(v, {
446
+ /* @__PURE__ */ W(v, {
416
447
  variant: "outline",
417
- onClick: ce,
418
- children: [/* @__PURE__ */ J(t, { size: 16 }), " Back"]
448
+ onClick: X,
449
+ children: [/* @__PURE__ */ U(t, { size: 16 }), " Back"]
419
450
  }),
420
- !d.optimized && /* @__PURE__ */ Y(v, {
451
+ !d.optimized && /* @__PURE__ */ W(v, {
421
452
  variant: "outline",
422
- onClick: ue,
423
- disabled: oe,
453
+ onClick: Q,
454
+ disabled: q,
424
455
  children: [
425
- /* @__PURE__ */ J(f, { size: 16 }),
456
+ /* @__PURE__ */ U(f, { size: 16 }),
426
457
  " ",
427
- oe ? "Optimizing…" : "Optimize"
458
+ q ? "Optimizing…" : "Optimize"
428
459
  ]
429
460
  }),
430
- /* @__PURE__ */ Y(v, {
461
+ /* @__PURE__ */ W(v, {
431
462
  onClick: () => l?.(p(c, `routes/${e}/edit`)),
432
- children: [/* @__PURE__ */ J(u, { size: 16 }), " Edit"]
463
+ children: [/* @__PURE__ */ U(u, { size: 16 }), " Edit"]
433
464
  })
434
465
  ]
435
466
  }),
436
- headerContent: /* @__PURE__ */ Y("div", {
467
+ headerContent: /* @__PURE__ */ W("div", {
437
468
  className: "flex gap-2",
438
- children: [/* @__PURE__ */ J(F, {
469
+ children: [/* @__PURE__ */ U(N, {
439
470
  status: d.status,
440
- customColors: P[d.status]
441
- }), /* @__PURE__ */ J(_, {
471
+ customColors: M[d.status]
472
+ }), /* @__PURE__ */ U(_, {
442
473
  variant: d.optimized ? "default" : "secondary",
443
474
  children: d.optimized ? "Optimized" : "Not Optimized"
444
475
  })]
445
476
  }),
446
477
  children: [
447
- /* @__PURE__ */ J(Z, {
448
- icon: /* @__PURE__ */ J(s, { size: 18 }),
478
+ /* @__PURE__ */ U(de, {
479
+ icon: /* @__PURE__ */ U(s, { size: 18 }),
449
480
  children: "A single optimized driving plan that chains together this route's stops. Review the sequence, distance and timing here, re-optimize if traffic or stops change, then hand the itinerary to a driver."
450
481
  }),
451
- /* @__PURE__ */ J(re, {
482
+ /* @__PURE__ */ U(ue, {
452
483
  storageKey: "movethewheels-route-details",
453
484
  steps: [
454
485
  ...d.optimized ? [] : [{
455
486
  id: "optimize",
456
487
  label: "Optimize this route",
457
488
  description: "Reorder stops to cut distance and driving time.",
458
- icon: /* @__PURE__ */ J(f, { size: 16 }),
459
- onClick: ue
489
+ icon: /* @__PURE__ */ U(f, { size: 16 }),
490
+ onClick: Q
460
491
  }],
461
492
  {
462
493
  id: "edit",
463
494
  label: "Adjust stops",
464
495
  description: "Add, remove or reorder the delivery stops.",
465
- icon: /* @__PURE__ */ J(u, { size: 16 }),
496
+ icon: /* @__PURE__ */ U(u, { size: 16 }),
466
497
  onClick: () => {}
467
498
  },
468
499
  {
469
500
  id: "orders",
470
501
  label: "Review the orders on this route",
471
502
  description: "Check the deliveries bundled into this run.",
472
- icon: /* @__PURE__ */ J(o, { size: 16 }),
473
- onClick: () => le("orders")
503
+ icon: /* @__PURE__ */ U(o, { size: 16 }),
504
+ onClick: () => Z("orders")
474
505
  }
475
506
  ]
476
507
  }),
477
- $ && /* @__PURE__ */ J("div", {
508
+ L && /* @__PURE__ */ U("div", {
478
509
  className: "mb-2",
479
- children: /* @__PURE__ */ J(I, { message: $ })
510
+ children: /* @__PURE__ */ U(ae, { message: L })
480
511
  }),
481
- W && /* @__PURE__ */ J("div", {
512
+ O && /* @__PURE__ */ U("div", {
482
513
  className: "mb-2",
483
- children: /* @__PURE__ */ J(L, { message: W })
514
+ children: /* @__PURE__ */ U(oe, { message: O })
484
515
  }),
485
- /* @__PURE__ */ Y("div", {
516
+ /* @__PURE__ */ W("div", {
486
517
  className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
487
- children: [/* @__PURE__ */ Y("div", {
518
+ children: [/* @__PURE__ */ W("div", {
488
519
  className: "lg:col-span-2 space-y-6",
489
- children: [/* @__PURE__ */ Y(y, { children: [/* @__PURE__ */ J(x, { children: /* @__PURE__ */ J(S, { children: "Route Map" }) }), /* @__PURE__ */ J(b, { children: fe.length > 0 ? /* @__PURE__ */ J(N, {
520
+ children: [/* @__PURE__ */ W(y, { children: [/* @__PURE__ */ U(x, { children: /* @__PURE__ */ U(S, { children: "Route Map" }) }), /* @__PURE__ */ U(b, { children: fe.length > 0 ? /* @__PURE__ */ U(j, {
490
521
  className: "overflow-hidden rounded-lg border border-border-seam",
491
522
  height: 360,
492
523
  stops: fe
493
- }) : /* @__PURE__ */ Y("div", {
524
+ }) : /* @__PURE__ */ W("div", {
494
525
  className: "rounded-lg border border-border-seam bg-bg-sunken/40 p-4",
495
- children: [/* @__PURE__ */ J("p", {
526
+ children: [/* @__PURE__ */ U("p", {
496
527
  className: "mb-3 text-sm text-text-secondary",
497
528
  children: "These stops don't have map coordinates yet — showing the planned sequence instead."
498
- }), /* @__PURE__ */ J("ol", {
529
+ }), /* @__PURE__ */ U("ol", {
499
530
  className: "space-y-2",
500
- children: d.stops.map((e) => /* @__PURE__ */ Y("li", {
531
+ children: d.stops.map((e) => /* @__PURE__ */ W("li", {
501
532
  className: "flex items-start gap-3",
502
- children: [/* @__PURE__ */ J("span", {
533
+ children: [/* @__PURE__ */ U("span", {
503
534
  className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-action-primary-bg/10 text-xs font-semibold text-primary",
504
535
  children: e.sequence
505
- }), /* @__PURE__ */ J("span", {
536
+ }), /* @__PURE__ */ U("span", {
506
537
  className: "text-sm",
507
- children: z(e.address) || `Order #${e.orderId || e.sequence}`
538
+ children: F(e.address) || `Order #${e.orderId || e.sequence}`
508
539
  })]
509
540
  }, e.id))
510
541
  })]
511
- }) })] }), /* @__PURE__ */ Y(y, { children: [/* @__PURE__ */ J(x, { children: /* @__PURE__ */ Y(S, { children: [
542
+ }) })] }), /* @__PURE__ */ W(y, { children: [/* @__PURE__ */ U(x, { children: /* @__PURE__ */ W(S, { children: [
512
543
  "Stops (",
513
544
  d.stops.length,
514
545
  ")"
515
- ] }) }), /* @__PURE__ */ J(b, { children: /* @__PURE__ */ J("div", {
546
+ ] }) }), /* @__PURE__ */ U(b, { children: /* @__PURE__ */ U("div", {
516
547
  className: "space-y-4",
517
- children: d.stops.map((e, t) => /* @__PURE__ */ Y("div", {
548
+ children: d.stops.map((e, t) => /* @__PURE__ */ W("div", {
518
549
  className: "flex gap-4",
519
- children: [/* @__PURE__ */ Y("div", {
550
+ children: [/* @__PURE__ */ W("div", {
520
551
  className: "relative",
521
- children: [/* @__PURE__ */ J("div", {
552
+ children: [/* @__PURE__ */ U("div", {
522
553
  className: `w-8 h-8 rounded-full flex items-center justify-center ${e.status === "completed" ? "bg-status-success-text text-text-inverse" : "bg-bg-sunken"}`,
523
- children: e.status === "completed" ? /* @__PURE__ */ J(r, { size: 16 }) : e.sequence
524
- }), t < d.stops.length - 1 && /* @__PURE__ */ J("div", { className: "absolute top-8 left-4 w-px h-12 bg-border" })]
525
- }), /* @__PURE__ */ J("div", {
554
+ children: e.status === "completed" ? /* @__PURE__ */ U(r, { size: 16 }) : e.sequence
555
+ }), t < d.stops.length - 1 && /* @__PURE__ */ U("div", { className: "absolute top-8 left-4 w-px h-12 bg-border" })]
556
+ }), /* @__PURE__ */ U("div", {
526
557
  className: "flex-1 pb-4",
527
- children: /* @__PURE__ */ Y("div", {
558
+ children: /* @__PURE__ */ W("div", {
528
559
  className: "flex items-center justify-between",
529
- children: [/* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ Y("div", {
560
+ children: [/* @__PURE__ */ W("div", { children: [/* @__PURE__ */ W("div", {
530
561
  className: "flex items-center gap-2",
531
- children: [/* @__PURE__ */ J(_, {
562
+ children: [/* @__PURE__ */ U(_, {
532
563
  variant: e.type === "pickup" ? "secondary" : "default",
533
564
  className: "capitalize",
534
565
  children: e.type
535
- }), /* @__PURE__ */ Y("span", {
566
+ }), /* @__PURE__ */ W("span", {
536
567
  className: "font-medium",
537
568
  children: ["Order #", e.orderId]
538
569
  })]
539
- }), /* @__PURE__ */ J("p", {
570
+ }), /* @__PURE__ */ U("p", {
540
571
  className: "text-sm text-text-secondary mt-1",
541
- children: z(e.address)
542
- })] }), /* @__PURE__ */ Y("div", {
572
+ children: F(e.address)
573
+ })] }), /* @__PURE__ */ W("div", {
543
574
  className: "text-right",
544
575
  children: [
545
- /* @__PURE__ */ Y("p", {
576
+ /* @__PURE__ */ W("p", {
546
577
  className: "text-sm",
547
- children: ["Scheduled: ", V(e.scheduledTime, "time")]
578
+ children: ["Scheduled: ", I(e.scheduledTime, "time")]
548
579
  }),
549
- e.actualTime && /* @__PURE__ */ Y("p", {
580
+ e.actualTime && /* @__PURE__ */ W("p", {
550
581
  className: "text-sm text-status-success-text",
551
- children: ["Actual: ", V(e.actualTime, "time")]
582
+ children: ["Actual: ", I(e.actualTime, "time")]
552
583
  }),
553
- /* @__PURE__ */ Y("p", {
584
+ /* @__PURE__ */ W("p", {
554
585
  className: "text-xs text-text-secondary",
555
586
  children: [e.duration, " min stop"]
556
587
  })
@@ -560,91 +591,91 @@ function $() {
560
591
  })]
561
592
  }, e.id))
562
593
  }) })] })]
563
- }), /* @__PURE__ */ Y("div", {
594
+ }), /* @__PURE__ */ W("div", {
564
595
  className: "space-y-6",
565
596
  children: [
566
- (d.status === "planned" || d.status === "in_progress") && /* @__PURE__ */ J(U, {
567
- suggestions: D.data,
568
- isLoading: D.isLoading,
569
- error: D.error,
570
- onRetry: D.refetch,
597
+ (d.status === "planned" || d.status === "in_progress") && /* @__PURE__ */ U(R, {
598
+ suggestions: T.data,
599
+ isLoading: T.isLoading,
600
+ error: T.error,
601
+ onRetry: T.refetch,
571
602
  assignedVehicleId: d.vehicleId || void 0,
572
603
  assignedDriverId: d.driverId || void 0,
573
- onAssign: de,
574
- t: k
604
+ onAssign: $,
605
+ t: D
575
606
  }),
576
- /* @__PURE__ */ Y(X, {
607
+ /* @__PURE__ */ W(K, {
577
608
  className: "space-y-4",
578
609
  children: [
579
- /* @__PURE__ */ J("h2", {
610
+ /* @__PURE__ */ U("h2", {
580
611
  className: "text-base font-semibold text-text-primary",
581
612
  children: "Route Info"
582
613
  }),
583
- /* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ J("p", {
614
+ /* @__PURE__ */ W("div", { children: [/* @__PURE__ */ U("p", {
584
615
  className: "text-sm text-text-secondary",
585
616
  children: "Total Distance"
586
- }), /* @__PURE__ */ Y("p", {
617
+ }), /* @__PURE__ */ W("p", {
587
618
  className: "text-2xl font-bold",
588
- children: [d.distance.toFixed(1), /* @__PURE__ */ J("span", {
619
+ children: [d.distance.toFixed(1), /* @__PURE__ */ U("span", {
589
620
  className: "text-sm font-normal",
590
621
  children: " km"
591
622
  })]
592
623
  })] }),
593
- /* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ J("p", {
624
+ /* @__PURE__ */ W("div", { children: [/* @__PURE__ */ U("p", {
594
625
  className: "text-sm text-text-secondary",
595
626
  children: "Est. Duration"
596
- }), /* @__PURE__ */ Y("p", {
627
+ }), /* @__PURE__ */ W("p", {
597
628
  className: "text-2xl font-bold",
598
- children: [d.estimatedDuration, /* @__PURE__ */ J("span", {
629
+ children: [d.estimatedDuration, /* @__PURE__ */ U("span", {
599
630
  className: "text-sm font-normal",
600
631
  children: " min"
601
632
  })]
602
633
  })] }),
603
- d.fuelCost !== void 0 && /* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ Y("p", {
634
+ d.fuelCost !== void 0 && /* @__PURE__ */ W("div", { children: [/* @__PURE__ */ W("p", {
604
635
  className: "text-sm text-text-secondary flex items-center gap-1",
605
- children: [/* @__PURE__ */ J(a, { size: 14 }), " Est. Fuel Cost"]
606
- }), /* @__PURE__ */ J("p", {
636
+ children: [/* @__PURE__ */ U(a, { size: 14 }), " Est. Fuel Cost"]
637
+ }), /* @__PURE__ */ U("p", {
607
638
  className: "text-2xl font-bold",
608
- children: B(d.fuelCost)
639
+ children: se(d.fuelCost)
609
640
  })] }),
610
- d.actualDuration && /* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ J("p", {
641
+ d.actualDuration && /* @__PURE__ */ W("div", { children: [/* @__PURE__ */ U("p", {
611
642
  className: "text-sm text-text-secondary",
612
643
  children: "Actual Duration"
613
- }), /* @__PURE__ */ Y("p", {
644
+ }), /* @__PURE__ */ W("p", {
614
645
  className: "text-2xl font-bold",
615
- children: [d.actualDuration, /* @__PURE__ */ J("span", {
646
+ children: [d.actualDuration, /* @__PURE__ */ U("span", {
616
647
  className: "text-sm font-normal",
617
648
  children: " min"
618
649
  })]
619
650
  })] })
620
651
  ]
621
652
  }),
622
- /* @__PURE__ */ Y(y, { children: [/* @__PURE__ */ J(x, { children: /* @__PURE__ */ Y(S, {
653
+ /* @__PURE__ */ W(y, { children: [/* @__PURE__ */ U(x, { children: /* @__PURE__ */ W(S, {
623
654
  className: "flex items-center gap-2",
624
- children: [/* @__PURE__ */ J(i, { size: 18 }), " Timeline"]
625
- }) }), /* @__PURE__ */ Y(b, {
655
+ children: [/* @__PURE__ */ U(i, { size: 18 }), " Timeline"]
656
+ }) }), /* @__PURE__ */ W(b, {
626
657
  className: "space-y-3",
627
658
  children: [
628
- d.startTime && /* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ J("p", {
659
+ d.startTime && /* @__PURE__ */ W("div", { children: [/* @__PURE__ */ U("p", {
629
660
  className: "text-sm text-text-secondary",
630
661
  children: "Started"
631
- }), /* @__PURE__ */ J("p", { children: V(d.startTime, "full") })] }),
632
- d.endTime && /* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ J("p", {
662
+ }), /* @__PURE__ */ U("p", { children: I(d.startTime, "full") })] }),
663
+ d.endTime && /* @__PURE__ */ W("div", { children: [/* @__PURE__ */ U("p", {
633
664
  className: "text-sm text-text-secondary",
634
665
  children: "Completed"
635
- }), /* @__PURE__ */ J("p", { children: V(d.endTime, "full") })] }),
636
- /* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ J("p", {
666
+ }), /* @__PURE__ */ U("p", { children: I(d.endTime, "full") })] }),
667
+ /* @__PURE__ */ W("div", { children: [/* @__PURE__ */ U("p", {
637
668
  className: "text-sm text-text-secondary",
638
669
  children: "Created"
639
- }), /* @__PURE__ */ J("p", { children: V(d.createdAt, "full") })] })
670
+ }), /* @__PURE__ */ U("p", { children: I(d.createdAt, "full") })] })
640
671
  ]
641
672
  })] }),
642
- d.trafficConditions.length > 0 && /* @__PURE__ */ Y(y, { children: [/* @__PURE__ */ J(x, { children: /* @__PURE__ */ J(S, { children: "Traffic Conditions" }) }), /* @__PURE__ */ J(b, { children: d.trafficConditions.map((e, t) => /* @__PURE__ */ Y("div", {
673
+ d.trafficConditions.length > 0 && /* @__PURE__ */ W(y, { children: [/* @__PURE__ */ U(x, { children: /* @__PURE__ */ U(S, { children: "Traffic Conditions" }) }), /* @__PURE__ */ U(b, { children: d.trafficConditions.map((e, t) => /* @__PURE__ */ W("div", {
643
674
  className: `p-2 rounded mb-2 ${e.condition === "severe" ? "bg-status-error-bg-subtle" : (e.condition, "bg-status-warning-bg-subtle")}`,
644
- children: [/* @__PURE__ */ Y("p", {
675
+ children: [/* @__PURE__ */ W("p", {
645
676
  className: "text-sm font-medium capitalize",
646
677
  children: [e.condition, " traffic"]
647
- }), /* @__PURE__ */ Y("p", {
678
+ }), /* @__PURE__ */ W("p", {
648
679
  className: "text-xs text-text-secondary",
649
680
  children: [
650
681
  e.location,
@@ -661,4 +692,4 @@ function $() {
661
692
  });
662
693
  }
663
694
  //#endregion
664
- export { $ as default };
695
+ export { X as default };