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