@burdenoff/microfe-movethewheels 2026.1030.1 → 2026.1031.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 (44) hide show
  1. package/dist/components/ExportStatusBanner.js +53 -0
  2. package/dist/components/ShipmentRiskDialog.js +228 -0
  3. package/dist/components/TrackingAlertList.js +149 -0
  4. package/dist/generated/tracking-quality-operations.d.ts +1070 -2
  5. package/dist/generated/wspace-types.d.ts +2895 -50
  6. package/dist/hooks/useEntityExport.js +85 -0
  7. package/dist/hooks/useShipmentRisk.js +72 -0
  8. package/dist/hooks/useTracking.js +96 -82
  9. package/dist/movethewheels/components/ExportStatusBanner.d.ts +7 -0
  10. package/dist/movethewheels/components/ShipmentRiskDialog.d.ts +20 -0
  11. package/dist/movethewheels/components/TrackingAlertList.d.ts +14 -0
  12. package/dist/movethewheels/hooks/useEntityExport.d.ts +32 -0
  13. package/dist/movethewheels/hooks/useShipmentRisk.d.ts +41 -0
  14. package/dist/movethewheels/types/index.d.ts +15 -1
  15. package/dist/movethewheels/utils/entityExport.d.ts +64 -0
  16. package/dist/movethewheels/utils/trackingAlerts.d.ts +36 -0
  17. package/dist/pages/CustomersPage.js +64 -58
  18. package/dist/pages/DashboardPage.js +147 -151
  19. package/dist/pages/DriversPage.js +113 -107
  20. package/dist/pages/LiveTrackingPage.js +169 -169
  21. package/dist/pages/OrdersListPage.js +85 -79
  22. package/dist/pages/ProductsPage.js +63 -57
  23. package/dist/pages/VehiclesPage.js +91 -85
  24. package/dist/utils/entityExport.js +54 -0
  25. package/dist/utils/trackingAlerts.js +86 -0
  26. package/package.json +4 -2
  27. package/src/generated/tracking-quality-operations.ts +1409 -13
  28. package/src/generated/wspace-types.ts +3248 -51
  29. package/src/movethewheels/components/ExportStatusBanner.tsx +78 -0
  30. package/src/movethewheels/components/ShipmentRiskDialog.tsx +315 -0
  31. package/src/movethewheels/components/TrackingAlertList.tsx +188 -0
  32. package/src/movethewheels/hooks/useEntityExport.ts +130 -0
  33. package/src/movethewheels/hooks/useShipmentRisk.ts +195 -0
  34. package/src/movethewheels/hooks/useTracking.ts +66 -22
  35. package/src/movethewheels/pages/CustomersPage.tsx +11 -2
  36. package/src/movethewheels/pages/DashboardPage.tsx +10 -20
  37. package/src/movethewheels/pages/DriversPage.tsx +11 -2
  38. package/src/movethewheels/pages/LiveTrackingPage.tsx +20 -22
  39. package/src/movethewheels/pages/OrdersListPage.tsx +13 -2
  40. package/src/movethewheels/pages/ProductsPage.tsx +11 -2
  41. package/src/movethewheels/pages/VehiclesPage.tsx +11 -2
  42. package/src/movethewheels/types/index.ts +16 -1
  43. package/src/movethewheels/utils/entityExport.ts +140 -0
  44. package/src/movethewheels/utils/trackingAlerts.ts +151 -0
@@ -2,142 +2,147 @@ import { List as e } from "../node_modules/lucide-react/dist/esm/icons/list.js";
2
2
  import { MapPin as t } from "../node_modules/lucide-react/dist/esm/icons/map-pin.js";
3
3
  import { Map as n } from "../node_modules/lucide-react/dist/esm/icons/map.js";
4
4
  import { Package as r } from "../node_modules/lucide-react/dist/esm/icons/package.js";
5
- import { RefreshCw as i } from "../node_modules/lucide-react/dist/esm/icons/refresh-cw.js";
6
- import { Truck as a } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
7
- import { joinPath as o } from "../utils/navigation.js";
8
- import { useMoveTheWheels as s } from "../providers/MoveTheWheelsProvider.js";
9
- import { useLiveTracking as c, useTrackingAlerts as l } from "../hooks/useTracking.js";
10
- import { Badge as u, Button as d, Card as f, CardContent as p, CardHeader as m, CardTitle as h, ScrollArea as g, Tabs as _, TabsList as v, TabsTrigger as y } from "../components/ui.js";
11
- import { EmptyState as b, PageLayout as x } from "../components/PageLayout.js";
12
- import { MetricCard as S, MetricGrid as C } from "../components/MetricCard.js";
13
- import { LogisticsMap as w } from "../components/maps/LogisticsMap.js";
5
+ import { RefreshCw as ee } from "../node_modules/lucide-react/dist/esm/icons/refresh-cw.js";
6
+ import { Truck as i } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
7
+ import { joinPath as a } from "../utils/navigation.js";
8
+ import { useMoveTheWheels as o } from "../providers/MoveTheWheelsProvider.js";
9
+ import { useLiveTracking as s, useTrackingAlerts as c } from "../hooks/useTracking.js";
10
+ import { Badge as l, Button as u, Card as d, CardContent as f, CardHeader as p, CardTitle as m, ScrollArea as h, Tabs as g, TabsList as _, TabsTrigger as v } from "../components/ui.js";
11
+ import { EmptyState as y, PageLayout as b } from "../components/PageLayout.js";
12
+ import { MetricCard as x, MetricGrid as te } from "../components/MetricCard.js";
13
+ import { LogisticsMap as S } from "../components/maps/LogisticsMap.js";
14
14
  import "../components/maps/index.js";
15
- import { StatusBadge as T } from "../components/StatusBadge.js";
16
- import { formatDate as E } from "../utils/formatters.js";
17
- import { deliveryMarkerStatus as D, firstRealLatLng as O } from "../utils/mapMarkers.js";
18
- import { useMemo as k, useState as A } from "react";
19
- import { jsx as j, jsxs as M } from "react/jsx-runtime";
20
- import { EmphasisPanel as N, NextSteps as P, PagePurpose as F } from "@burdenoff/fe-libs/ui";
15
+ import { StatusBadge as C } from "../components/StatusBadge.js";
16
+ import { formatDate as w } from "../utils/formatters.js";
17
+ import { TrackingAlertList as T } from "../components/TrackingAlertList.js";
18
+ import { deliveryMarkerStatus as E, firstRealLatLng as D } from "../utils/mapMarkers.js";
19
+ import { useMemo as O, useState as k } from "react";
20
+ import { jsx as A, jsxs as j } from "react/jsx-runtime";
21
+ import { useI18n as M } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
22
+ import { EmphasisPanel as N, NextSteps as ne, PagePurpose as re } from "@burdenoff/fe-libs/ui";
21
23
  //#region src/movethewheels/pages/LiveTrackingPage.tsx
22
- function I() {
23
- let { basePath: I, navigate: L } = s(), { activeDeliveries: R, isLoading: z, refetch: B } = c(), { unacknowledgedAlerts: V } = l(), [H, U] = A("map"), [W, G] = A(null), [K, q] = A("all"), J = (e) => {
24
- L && L(o(I, e));
25
- }, Y = W ? R.find((e) => e.order?.id === W) : null, X = k(() => R.filter((e) => {
24
+ function P() {
25
+ let { basePath: P, navigate: F } = o(), { activeDeliveries: I, isLoading: L, refetch: R } = s(), { t: z } = M(), B = (e, t) => {
26
+ let n = z(e);
27
+ return n === e ? t : n;
28
+ }, { unacknowledgedAlerts: V, acknowledgeAlert: H, refetch: U } = c(), [W, G] = k("map"), [K, q] = k(null), [J, Y] = k("all"), X = (e) => {
29
+ F && F(a(P, e));
30
+ }, Z = K ? I.find((e) => e.order?.id === K) : null, Q = O(() => I.filter((e) => {
26
31
  let t = e.order?.status;
27
- return K === "all" ? !0 : K === "in_transit" ? t === "in_transit" : K === "out_for_delivery" ? t === "out_for_delivery" : t !== "in_transit" && t !== "out_for_delivery";
28
- }), [R, K]), Z = k(() => X.flatMap((e) => {
32
+ return J === "all" ? !0 : J === "in_transit" ? t === "in_transit" : J === "out_for_delivery" ? t === "out_for_delivery" : t !== "in_transit" && t !== "out_for_delivery";
33
+ }), [I, J]), $ = O(() => Q.flatMap((e) => {
29
34
  if (!e.order) return [];
30
- let t = O(e.vehicle?.currentLocation, e.driver?.currentLocation, e.tracking?.currentLocation);
35
+ let t = D(e.vehicle?.currentLocation, e.driver?.currentLocation, e.tracking?.currentLocation);
31
36
  return t ? [{
32
37
  id: e.order.id,
33
38
  lat: t.lat,
34
39
  lng: t.lng,
35
40
  label: e.order.orderNumber,
36
- status: D(e.order.status),
41
+ status: E(e.order.status),
37
42
  sublabel: e.driver?.fullName || e.vehicle?.vehicleNumber || e.tracking?.currentLocation?.address || void 0
38
43
  }] : [];
39
- }), [X]), Q = Z.length, $ = [
44
+ }), [Q]), ie = $.length, ae = [
40
45
  {
41
46
  value: "all",
42
47
  label: "All",
43
- count: R.length
48
+ count: I.length
44
49
  },
45
50
  {
46
51
  value: "in_transit",
47
52
  label: "In transit",
48
- count: R.filter((e) => e.order?.status === "in_transit").length
53
+ count: I.filter((e) => e.order?.status === "in_transit").length
49
54
  },
50
55
  {
51
56
  value: "out_for_delivery",
52
57
  label: "Out for delivery",
53
- count: R.filter((e) => e.order?.status === "out_for_delivery").length
58
+ count: I.filter((e) => e.order?.status === "out_for_delivery").length
54
59
  },
55
60
  {
56
61
  value: "other",
57
62
  label: "Other",
58
- count: R.filter((e) => e.order?.status !== "in_transit" && e.order?.status !== "out_for_delivery").length
63
+ count: I.filter((e) => e.order?.status !== "in_transit" && e.order?.status !== "out_for_delivery").length
59
64
  }
60
65
  ];
61
- return /* @__PURE__ */ M(x, {
66
+ return /* @__PURE__ */ j(b, {
62
67
  title: "Live Tracking",
63
- subtitle: `${R.length} active deliveries`,
64
- icon: /* @__PURE__ */ j(t, { size: 24 }),
65
- headerActions: /* @__PURE__ */ M("div", {
68
+ subtitle: `${I.length} active deliveries`,
69
+ icon: /* @__PURE__ */ A(t, { size: 24 }),
70
+ headerActions: /* @__PURE__ */ j("div", {
66
71
  className: "flex gap-2",
67
- children: [/* @__PURE__ */ M(d, {
72
+ children: [/* @__PURE__ */ j(u, {
68
73
  variant: "outline",
69
- onClick: B,
70
- disabled: z,
71
- children: [/* @__PURE__ */ j(i, {
74
+ onClick: R,
75
+ disabled: L,
76
+ children: [/* @__PURE__ */ A(ee, {
72
77
  size: 16,
73
- className: z ? "animate-spin" : ""
78
+ className: L ? "animate-spin" : ""
74
79
  }), "Refresh"]
75
- }), /* @__PURE__ */ j(_, {
76
- value: H,
77
- onValueChange: (e) => U(e),
78
- children: /* @__PURE__ */ M(v, { children: [/* @__PURE__ */ j(y, {
80
+ }), /* @__PURE__ */ A(g, {
81
+ value: W,
82
+ onValueChange: (e) => G(e),
83
+ children: /* @__PURE__ */ j(_, { children: [/* @__PURE__ */ A(v, {
79
84
  value: "map",
80
- children: /* @__PURE__ */ j(n, { size: 16 })
81
- }), /* @__PURE__ */ j(y, {
85
+ children: /* @__PURE__ */ A(n, { size: 16 })
86
+ }), /* @__PURE__ */ A(v, {
82
87
  value: "list",
83
- children: /* @__PURE__ */ j(e, { size: 16 })
88
+ children: /* @__PURE__ */ A(e, { size: 16 })
84
89
  })] })
85
90
  })]
86
91
  }),
87
92
  children: [
88
- /* @__PURE__ */ j(F, {
89
- icon: /* @__PURE__ */ j(t, { size: 18 }),
93
+ /* @__PURE__ */ A(re, {
94
+ icon: /* @__PURE__ */ A(t, { size: 18 }),
90
95
  children: "A real-time operations board for every delivery currently on the road. Watch where drivers are, which orders are out for delivery, and react to alerts — switch to the map for a bird's-eye view or the list to drill into a single shipment."
91
96
  }),
92
- /* @__PURE__ */ j(P, {
97
+ /* @__PURE__ */ A(ne, {
93
98
  storageKey: "movethewheels-live-tracking",
94
99
  steps: [
95
100
  {
96
101
  id: "select",
97
102
  label: "Open a delivery",
98
103
  description: "Switch to the list and pick a shipment to see full details.",
99
- icon: /* @__PURE__ */ j(e, { size: 16 }),
100
- onClick: () => U("list")
104
+ icon: /* @__PURE__ */ A(e, { size: 16 }),
105
+ onClick: () => G("list")
101
106
  },
102
107
  {
103
108
  id: "alerts",
104
109
  label: "Clear outstanding alerts",
105
110
  description: "Review delays and exceptions that need attention.",
106
- icon: /* @__PURE__ */ j(a, { size: 16 }),
111
+ icon: /* @__PURE__ */ A(i, { size: 16 }),
107
112
  done: V.length === 0,
108
- onClick: () => U("list")
113
+ onClick: () => G("list")
109
114
  },
110
115
  {
111
116
  id: "new-order",
112
117
  label: "Create another order",
113
118
  description: "Add a new delivery to the pipeline.",
114
- icon: /* @__PURE__ */ j(r, { size: 16 }),
115
- onClick: () => J("orders/new")
119
+ icon: /* @__PURE__ */ A(r, { size: 16 }),
120
+ onClick: () => X("orders/new")
116
121
  }
117
122
  ]
118
123
  }),
119
- /* @__PURE__ */ M(C, {
124
+ /* @__PURE__ */ j(te, {
120
125
  columns: 4,
121
126
  children: [
122
- /* @__PURE__ */ j(S, {
127
+ /* @__PURE__ */ A(x, {
123
128
  size: "sm",
124
129
  label: "Active Deliveries",
125
- value: R.length,
126
- icon: /* @__PURE__ */ j(a, { size: 18 })
130
+ value: I.length,
131
+ icon: /* @__PURE__ */ A(i, { size: 18 })
127
132
  }),
128
- /* @__PURE__ */ j(S, {
133
+ /* @__PURE__ */ A(x, {
129
134
  size: "sm",
130
135
  label: "In Transit",
131
- value: R.filter((e) => e.order?.status === "in_transit").length,
132
- icon: /* @__PURE__ */ j(r, { size: 18 })
136
+ value: I.filter((e) => e.order?.status === "in_transit").length,
137
+ icon: /* @__PURE__ */ A(r, { size: 18 })
133
138
  }),
134
- /* @__PURE__ */ j(S, {
139
+ /* @__PURE__ */ A(x, {
135
140
  size: "sm",
136
141
  label: "Out for Delivery",
137
- value: R.filter((e) => e.order?.status === "out_for_delivery").length,
138
- icon: /* @__PURE__ */ j(t, { size: 18 })
142
+ value: I.filter((e) => e.order?.status === "out_for_delivery").length,
143
+ icon: /* @__PURE__ */ A(t, { size: 18 })
139
144
  }),
140
- /* @__PURE__ */ j(S, {
145
+ /* @__PURE__ */ A(x, {
141
146
  size: "sm",
142
147
  label: "Alerts",
143
148
  value: V.length,
@@ -145,92 +150,92 @@ function I() {
145
150
  })
146
151
  ]
147
152
  }),
148
- /* @__PURE__ */ M("div", {
153
+ /* @__PURE__ */ j("div", {
149
154
  className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
150
- children: [/* @__PURE__ */ j("div", {
155
+ children: [/* @__PURE__ */ A("div", {
151
156
  className: "lg:col-span-2",
152
- children: H === "map" ? /* @__PURE__ */ j(f, {
157
+ children: W === "map" ? /* @__PURE__ */ A(d, {
153
158
  className: "overflow-hidden",
154
- children: /* @__PURE__ */ M(p, {
159
+ children: /* @__PURE__ */ j(f, {
155
160
  className: "p-0",
156
- children: [/* @__PURE__ */ M("div", {
161
+ children: [/* @__PURE__ */ j("div", {
157
162
  className: "flex flex-wrap items-center gap-2 border-b border-border-seam p-3",
158
- children: [$.map((e) => /* @__PURE__ */ M("button", {
163
+ children: [ae.map((e) => /* @__PURE__ */ j("button", {
159
164
  type: "button",
160
- onClick: () => q(e.value),
161
- className: `inline-flex items-center gap-1.5 rounded-full border px-3 py-1 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-bg ${K === e.value ? "border-transparent bg-action-primary-bg text-action-primary-text" : "border-border-seam text-text-secondary hover:bg-bg-sunken/60"}`,
162
- children: [e.label, /* @__PURE__ */ j("span", {
165
+ onClick: () => Y(e.value),
166
+ className: `inline-flex items-center gap-1.5 rounded-full border px-3 py-1 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-bg ${J === e.value ? "border-transparent bg-action-primary-bg text-action-primary-text" : "border-border-seam text-text-secondary hover:bg-bg-sunken/60"}`,
167
+ children: [e.label, /* @__PURE__ */ A("span", {
163
168
  className: "tabular-nums opacity-80",
164
169
  children: e.count
165
170
  })]
166
- }, e.value)), /* @__PURE__ */ M("span", {
171
+ }, e.value)), /* @__PURE__ */ j("span", {
167
172
  className: "ml-auto text-xs text-text-secondary",
168
173
  children: [
169
- Q,
174
+ ie,
170
175
  " of ",
171
- X.length,
176
+ Q.length,
172
177
  " located"
173
178
  ]
174
179
  })]
175
- }), /* @__PURE__ */ j(w, {
176
- markers: Z,
180
+ }), /* @__PURE__ */ A(S, {
181
+ markers: $,
177
182
  height: 560,
178
- emptyMessage: X.length === 0 ? "No active deliveries to plot" : "Awaiting live GPS positions for these deliveries"
183
+ emptyMessage: Q.length === 0 ? "No active deliveries to plot" : "Awaiting live GPS positions for these deliveries"
179
184
  })]
180
185
  })
181
- }) : /* @__PURE__ */ M(f, { children: [/* @__PURE__ */ j(m, { children: /* @__PURE__ */ j(h, { children: "Active Deliveries" }) }), /* @__PURE__ */ j(p, {
186
+ }) : /* @__PURE__ */ j(d, { children: [/* @__PURE__ */ A(p, { children: /* @__PURE__ */ A(m, { children: "Active Deliveries" }) }), /* @__PURE__ */ A(f, {
182
187
  className: "p-0",
183
- children: /* @__PURE__ */ j(g, {
188
+ children: /* @__PURE__ */ A(h, {
184
189
  className: "h-[550px]",
185
- children: /* @__PURE__ */ M("div", {
190
+ children: /* @__PURE__ */ j("div", {
186
191
  className: "divide-y",
187
- children: [X.map((e) => e.order ? /* @__PURE__ */ j("div", {
192
+ children: [Q.map((e) => e.order ? /* @__PURE__ */ A("div", {
188
193
  role: "button",
189
194
  tabIndex: 0,
190
195
  "aria-label": `Select delivery ${e.order.orderNumber}`,
191
- className: `p-4 hover:bg-bg-sunken/50 cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-bg ${W === e.order.id ? "bg-bg-sunken/50" : ""}`,
192
- onClick: () => G(e.order.id),
196
+ className: `p-4 hover:bg-bg-sunken/50 cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-bg ${K === e.order.id ? "bg-bg-sunken/50" : ""}`,
197
+ onClick: () => q(e.order.id),
193
198
  onKeyDown: (t) => {
194
- (t.key === "Enter" || t.key === " ") && e.order && (t.preventDefault(), G(e.order.id));
199
+ (t.key === "Enter" || t.key === " ") && e.order && (t.preventDefault(), q(e.order.id));
195
200
  },
196
- children: /* @__PURE__ */ M("div", {
201
+ children: /* @__PURE__ */ j("div", {
197
202
  className: "flex items-start justify-between",
198
- children: [/* @__PURE__ */ M("div", { children: [
199
- /* @__PURE__ */ M("div", {
203
+ children: [/* @__PURE__ */ j("div", { children: [
204
+ /* @__PURE__ */ j("div", {
200
205
  className: "flex items-center gap-2 mb-1",
201
- children: [/* @__PURE__ */ j("span", {
206
+ children: [/* @__PURE__ */ A("span", {
202
207
  className: "font-medium",
203
208
  children: e.order.orderNumber
204
- }), /* @__PURE__ */ j(T, {
209
+ }), /* @__PURE__ */ A(C, {
205
210
  status: e.order.status,
206
211
  type: "order",
207
212
  size: "sm"
208
213
  })]
209
214
  }),
210
- /* @__PURE__ */ j("p", {
215
+ /* @__PURE__ */ A("p", {
211
216
  className: "text-sm text-text-secondary",
212
217
  children: e.order.customerInfo.name
213
218
  }),
214
- /* @__PURE__ */ M("p", {
219
+ /* @__PURE__ */ j("p", {
215
220
  className: "text-sm text-text-secondary",
216
221
  children: [e.driver?.fullName || "Unassigned", e.vehicle && ` - ${e.vehicle.vehicleNumber}`]
217
222
  })
218
- ] }), /* @__PURE__ */ M("div", {
223
+ ] }), /* @__PURE__ */ j("div", {
219
224
  className: "text-right",
220
- children: [/* @__PURE__ */ M("p", {
225
+ children: [/* @__PURE__ */ j("p", {
221
226
  className: "text-sm font-medium",
222
227
  children: [
223
228
  "ETA:",
224
229
  " ",
225
- e.estimatedArrival ? E(e.estimatedArrival, "time") : "N/A"
230
+ e.estimatedArrival ? w(e.estimatedArrival, "time") : "N/A"
226
231
  ]
227
- }), /* @__PURE__ */ j("p", {
232
+ }), /* @__PURE__ */ A("p", {
228
233
  className: "text-xs text-text-secondary",
229
234
  children: e.tracking?.currentLocation?.address || "Location updating..."
230
235
  })]
231
236
  })]
232
237
  })
233
- }, e.order.id) : null), X.length === 0 && /* @__PURE__ */ j(b, {
238
+ }, e.order.id) : null), Q.length === 0 && /* @__PURE__ */ A(y, {
234
239
  illustration: "empty-sessions",
235
240
  title: "No active deliveries",
236
241
  description: "When orders are dispatched they'll appear here in real time."
@@ -238,161 +243,156 @@ function I() {
238
243
  })
239
244
  })
240
245
  })] })
241
- }), /* @__PURE__ */ M("div", {
246
+ }), /* @__PURE__ */ j("div", {
242
247
  className: "space-y-6",
243
248
  children: [
244
- Y ? /* @__PURE__ */ M(N, {
249
+ Z ? /* @__PURE__ */ j(N, {
245
250
  className: "space-y-4",
246
- children: [/* @__PURE__ */ M("div", {
251
+ children: [/* @__PURE__ */ j("div", {
247
252
  className: "flex items-center justify-between",
248
- children: [/* @__PURE__ */ j("h2", {
253
+ children: [/* @__PURE__ */ A("h2", {
249
254
  className: "text-base font-semibold text-text-primary",
250
255
  children: "Delivery Details"
251
- }), /* @__PURE__ */ j(d, {
256
+ }), /* @__PURE__ */ A(u, {
252
257
  variant: "ghost",
253
258
  size: "sm",
254
- onClick: () => G(null),
259
+ onClick: () => q(null),
255
260
  children: "Clear"
256
261
  })]
257
- }), /* @__PURE__ */ M("div", {
262
+ }), /* @__PURE__ */ j("div", {
258
263
  className: "space-y-4",
259
264
  children: [
260
- /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
265
+ /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("p", {
261
266
  className: "text-sm text-text-secondary",
262
267
  children: "Order"
263
- }), /* @__PURE__ */ j("p", {
268
+ }), /* @__PURE__ */ A("p", {
264
269
  className: "font-medium",
265
- children: Y.order?.orderNumber ?? "-"
270
+ children: Z.order?.orderNumber ?? "-"
266
271
  })] }),
267
- /* @__PURE__ */ M("div", { children: [
268
- /* @__PURE__ */ j("p", {
272
+ /* @__PURE__ */ j("div", { children: [
273
+ /* @__PURE__ */ A("p", {
269
274
  className: "text-sm text-text-secondary",
270
275
  children: "Customer"
271
276
  }),
272
- /* @__PURE__ */ j("p", {
277
+ /* @__PURE__ */ A("p", {
273
278
  className: "font-medium",
274
- children: Y.order?.customerInfo.name ?? "-"
279
+ children: Z.order?.customerInfo.name ?? "-"
275
280
  }),
276
- /* @__PURE__ */ j("p", {
281
+ /* @__PURE__ */ A("p", {
277
282
  className: "text-sm text-text-secondary",
278
- children: Y.order?.customerInfo.phone ?? "-"
283
+ children: Z.order?.customerInfo.phone ?? "-"
279
284
  })
280
285
  ] }),
281
- /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
286
+ /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("p", {
282
287
  className: "text-sm text-text-secondary",
283
288
  children: "Driver"
284
- }), /* @__PURE__ */ j("p", {
289
+ }), /* @__PURE__ */ A("p", {
285
290
  className: "font-medium",
286
- children: Y.driver?.fullName || "Unassigned"
291
+ children: Z.driver?.fullName || "Unassigned"
287
292
  })] }),
288
- /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
293
+ /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("p", {
289
294
  className: "text-sm text-text-secondary",
290
295
  children: "Vehicle"
291
- }), /* @__PURE__ */ j("p", {
296
+ }), /* @__PURE__ */ A("p", {
292
297
  className: "font-medium",
293
- children: Y.vehicle ? `${Y.vehicle.vehicleNumber} - ${Y.vehicle.make} ${Y.vehicle.model}` : "Not assigned"
298
+ children: Z.vehicle ? `${Z.vehicle.vehicleNumber} - ${Z.vehicle.make} ${Z.vehicle.model}` : "Not assigned"
294
299
  })] }),
295
- /* @__PURE__ */ M("div", { children: [
296
- /* @__PURE__ */ j("p", {
300
+ /* @__PURE__ */ j("div", { children: [
301
+ /* @__PURE__ */ A("p", {
297
302
  className: "text-sm text-text-secondary",
298
303
  children: "Current Location"
299
304
  }),
300
- /* @__PURE__ */ j("p", {
305
+ /* @__PURE__ */ A("p", {
301
306
  className: "text-sm",
302
- children: Y.tracking?.currentLocation?.address || "Updating..."
307
+ children: Z.tracking?.currentLocation?.address || "Updating..."
303
308
  }),
304
309
  (() => {
305
- let e = O(Y.vehicle?.currentLocation, Y.driver?.currentLocation, Y.tracking?.currentLocation);
306
- return e ? /* @__PURE__ */ j(w, {
310
+ let e = D(Z.vehicle?.currentLocation, Z.driver?.currentLocation, Z.tracking?.currentLocation);
311
+ return e ? /* @__PURE__ */ A(S, {
307
312
  className: "mt-3 overflow-hidden rounded-lg border border-border-seam",
308
313
  height: 160,
309
314
  markers: [{
310
- id: Y.order?.id ?? "selected",
315
+ id: Z.order?.id ?? "selected",
311
316
  lat: e.lat,
312
317
  lng: e.lng,
313
- label: Y.order?.orderNumber ?? "Delivery",
314
- status: D(Y.order?.status)
318
+ label: Z.order?.orderNumber ?? "Delivery",
319
+ status: E(Z.order?.status)
315
320
  }]
316
321
  }) : null;
317
322
  })()
318
323
  ] }),
319
- /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
324
+ /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("p", {
320
325
  className: "text-sm text-text-secondary",
321
326
  children: "Estimated Arrival"
322
- }), /* @__PURE__ */ j("p", {
327
+ }), /* @__PURE__ */ A("p", {
323
328
  className: "font-medium",
324
- children: Y.estimatedArrival ? E(Y.estimatedArrival, "full") : "Calculating..."
329
+ children: Z.estimatedArrival ? w(Z.estimatedArrival, "full") : "Calculating..."
325
330
  })] }),
326
- /* @__PURE__ */ M("div", {
331
+ /* @__PURE__ */ j("div", {
327
332
  className: "pt-2 space-y-2",
328
- children: [/* @__PURE__ */ j(d, {
333
+ children: [/* @__PURE__ */ A(u, {
329
334
  className: "w-full",
330
- onClick: () => Y.order && J(`orders/${Y.order.id}`),
331
- disabled: !Y.order,
335
+ onClick: () => Z.order && X(`orders/${Z.order.id}`),
336
+ disabled: !Z.order,
332
337
  children: "View Order"
333
- }), /* @__PURE__ */ j(d, {
338
+ }), /* @__PURE__ */ A(u, {
334
339
  variant: "outline",
335
340
  className: "w-full",
336
- onClick: () => Y.order && J(`tracking?order=${Y.order.id}`),
337
- disabled: !Y.order,
341
+ onClick: () => Z.order && X(`tracking?order=${Z.order.id}`),
342
+ disabled: !Z.order,
338
343
  children: "Track Details"
339
344
  })]
340
345
  })
341
346
  ]
342
347
  })]
343
- }) : /* @__PURE__ */ j(f, { children: /* @__PURE__ */ j(p, {
348
+ }) : /* @__PURE__ */ A(d, { children: /* @__PURE__ */ A(f, {
344
349
  className: "p-6",
345
- children: /* @__PURE__ */ j(b, {
350
+ children: /* @__PURE__ */ A(y, {
346
351
  illustration: "empty-generic",
347
352
  title: "No delivery selected",
348
353
  description: "Pick a delivery from the list to see its driver, vehicle, ETA and live location."
349
354
  })
350
355
  }) }),
351
- /* @__PURE__ */ M(f, { children: [/* @__PURE__ */ j(m, { children: /* @__PURE__ */ M(h, {
356
+ /* @__PURE__ */ j(d, { children: [/* @__PURE__ */ A(p, { children: /* @__PURE__ */ j(m, {
352
357
  className: "flex items-center gap-2",
353
- children: ["Alerts", V.length > 0 && /* @__PURE__ */ j(u, {
358
+ children: [B("movethewheels.tracking.live.alerts", "Alerts"), V.length > 0 && /* @__PURE__ */ A(l, {
354
359
  variant: "destructive",
355
360
  children: V.length
356
361
  })]
357
- }) }), /* @__PURE__ */ j(p, { children: V.length > 0 ? /* @__PURE__ */ j("div", {
358
- className: "space-y-3",
359
- children: V.slice(0, 5).map((e) => /* @__PURE__ */ M("div", {
360
- className: `p-3 rounded-lg text-sm ${e.severity === "critical" || e.severity === "high" ? "bg-status-error-bg-subtle" : "bg-status-warning-bg-subtle"}`,
361
- children: [/* @__PURE__ */ j("p", {
362
- className: "font-medium",
363
- children: e.message
364
- }), /* @__PURE__ */ j("p", {
365
- className: "text-xs text-text-secondary mt-1",
366
- children: e.timestamp ? E(e.timestamp, "relative") : "Time not recorded"
367
- })]
368
- }, e.id))
369
- }) : /* @__PURE__ */ j("div", {
362
+ }) }), /* @__PURE__ */ A(f, { children: V.length > 0 ? /* @__PURE__ */ A(T, {
363
+ alerts: V,
364
+ limit: 5,
365
+ t: B,
366
+ onAcknowledge: H,
367
+ onOpenOrder: (e) => X(`orders/${e}`),
368
+ onChanged: U
369
+ }) : /* @__PURE__ */ A("div", {
370
370
  className: "text-center text-text-secondary py-4",
371
- children: /* @__PURE__ */ j("p", {
371
+ children: /* @__PURE__ */ A("p", {
372
372
  className: "text-sm",
373
- children: "No active alerts"
373
+ children: B("movethewheels.tracking.live.noAlerts", "No active alerts")
374
374
  })
375
375
  }) })] }),
376
- /* @__PURE__ */ M(f, { children: [/* @__PURE__ */ j(m, { children: /* @__PURE__ */ j(h, { children: "Quick Actions" }) }), /* @__PURE__ */ M(p, {
376
+ /* @__PURE__ */ j(d, { children: [/* @__PURE__ */ A(p, { children: /* @__PURE__ */ A(m, { children: "Quick Actions" }) }), /* @__PURE__ */ j(f, {
377
377
  className: "space-y-2",
378
378
  children: [
379
- /* @__PURE__ */ M(d, {
379
+ /* @__PURE__ */ j(u, {
380
380
  variant: "outline",
381
381
  className: "w-full",
382
- onClick: () => J("orders/new"),
383
- children: [/* @__PURE__ */ j(r, { size: 16 }), "Create Order"]
382
+ onClick: () => X("orders/new"),
383
+ children: [/* @__PURE__ */ A(r, { size: 16 }), "Create Order"]
384
384
  }),
385
- /* @__PURE__ */ M(d, {
385
+ /* @__PURE__ */ j(u, {
386
386
  variant: "outline",
387
387
  className: "w-full",
388
- onClick: () => J("routes"),
389
- children: [/* @__PURE__ */ j(t, { size: 16 }), "Manage Routes"]
388
+ onClick: () => X("routes"),
389
+ children: [/* @__PURE__ */ A(t, { size: 16 }), "Manage Routes"]
390
390
  }),
391
- /* @__PURE__ */ M(d, {
391
+ /* @__PURE__ */ j(u, {
392
392
  variant: "outline",
393
393
  className: "w-full",
394
- onClick: () => J("fleet"),
395
- children: [/* @__PURE__ */ j(a, { size: 16 }), "Fleet Status"]
394
+ onClick: () => X("fleet"),
395
+ children: [/* @__PURE__ */ A(i, { size: 16 }), "Fleet Status"]
396
396
  })
397
397
  ]
398
398
  })] })
@@ -403,4 +403,4 @@ function I() {
403
403
  });
404
404
  }
405
405
  //#endregion
406
- export { I as default };
406
+ export { P as default };