@burdenoff/microfe-movethewheels 2026.1031.3 → 2026.1031.5

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 (63) hide show
  1. package/dist/MoveTheWheelsRoot.js +136 -127
  2. package/dist/MoveTheWheelsRoutes.js +143 -135
  3. package/dist/components/DocumentsCard.js +11 -11
  4. package/dist/components/ProofOfDeliveryCard.js +13 -13
  5. package/dist/components/ShipmentRiskDialog.js +24 -24
  6. package/dist/components/ShippingQuoteResults.js +46 -46
  7. package/dist/components/TrackingAlertList.js +17 -17
  8. package/dist/generated/tracking-quality-operations.d.ts +56 -0
  9. package/dist/hooks/useOrderDispatch.js +17 -17
  10. package/dist/movethewheels/pages/SettingsPage.d.ts +1 -0
  11. package/dist/movethewheels/providers/ModuleSettingsProvider.d.ts +17 -0
  12. package/dist/movethewheels/utils/formatters.d.ts +23 -3
  13. package/dist/movethewheels/utils/moduleSettings.d.ts +52 -0
  14. package/dist/node_modules/lucide-react/dist/esm/icons/bell.js +11 -0
  15. package/dist/node_modules/lucide-react/dist/esm/icons/key-round.js +14 -0
  16. package/dist/node_modules/lucide-react/dist/esm/icons/plug.js +22 -0
  17. package/dist/node_modules/lucide-react/dist/esm/icons/rotate-ccw.js +11 -0
  18. package/dist/node_modules/lucide-react/dist/esm/icons/settings.js +13 -0
  19. package/dist/pages/AnalyticsPage.js +27 -27
  20. package/dist/pages/CreateOrderPage.js +340 -317
  21. package/dist/pages/CustomerDetailsPage.js +246 -246
  22. package/dist/pages/CustomersPage.js +19 -19
  23. package/dist/pages/DashboardPage.js +24 -24
  24. package/dist/pages/DeliveryCapturePage.js +74 -74
  25. package/dist/pages/DriverDetailsPage.js +337 -337
  26. package/dist/pages/DriversPage.js +26 -26
  27. package/dist/pages/FinancePage.js +26 -26
  28. package/dist/pages/InventoryPage.js +28 -28
  29. package/dist/pages/LiveTrackingPage.js +108 -108
  30. package/dist/pages/MarketplacePage.js +44 -44
  31. package/dist/pages/OrderDetailsPage.js +306 -306
  32. package/dist/pages/OrdersListPage.js +27 -27
  33. package/dist/pages/ProductDetailsPage.js +89 -89
  34. package/dist/pages/ProductsPage.js +73 -73
  35. package/dist/pages/RouteDetailsPage.js +282 -285
  36. package/dist/pages/RoutesPage.js +78 -78
  37. package/dist/pages/SettingsPage.js +459 -0
  38. package/dist/pages/TrackingPage.js +41 -41
  39. package/dist/pages/VehicleDetailsPage.js +207 -207
  40. package/dist/pages/VehiclesPage.js +17 -16
  41. package/dist/pages/WarehouseDetailsPage.js +132 -132
  42. package/dist/providers/ModuleSettingsProvider.js +74 -0
  43. package/dist/utils/formatters.js +53 -26
  44. package/dist/utils/moduleSettings.js +132 -0
  45. package/package.json +3 -2
  46. package/src/generated/tracking-quality-operations.ts +62 -0
  47. package/src/movethewheels/MoveTheWheelsRoot.tsx +18 -5
  48. package/src/movethewheels/MoveTheWheelsRoutes.tsx +19 -4
  49. package/src/movethewheels/pages/CreateOrderPage.tsx +38 -6
  50. package/src/movethewheels/pages/ProductsPage.tsx +2 -2
  51. package/src/movethewheels/pages/RouteDetailsPage.tsx +3 -6
  52. package/src/movethewheels/pages/RoutesPage.tsx +2 -2
  53. package/src/movethewheels/pages/SettingsPage.tsx +516 -0
  54. package/src/movethewheels/pages/VehicleDetailsPage.tsx +4 -2
  55. package/src/movethewheels/pages/VehiclesPage.tsx +2 -1
  56. package/src/movethewheels/providers/ModuleSettingsProvider.tsx +133 -0
  57. package/src/movethewheels/utils/formatters.ts +69 -10
  58. package/src/movethewheels/utils/moduleSettings.ts +224 -0
  59. package/dist/movethewheels/pages/AIAssistantPage.d.ts +0 -22
  60. package/dist/node_modules/lucide-react/dist/esm/icons/message-circle.js +0 -8
  61. package/dist/node_modules/lucide-react/dist/esm/icons/wallet.js +0 -11
  62. package/dist/pages/AIAssistantPage.js +0 -81
  63. package/src/movethewheels/pages/AIAssistantPage.tsx +0 -123
@@ -7,13 +7,13 @@ import { Upload as a } from "../node_modules/lucide-react/dist/esm/icons/upload.
7
7
  import { Users as o } from "../node_modules/lucide-react/dist/esm/icons/users.js";
8
8
  import { joinPath as s } from "../utils/navigation.js";
9
9
  import { useMoveTheWheels as c } from "../providers/MoveTheWheelsProvider.js";
10
- import { useCustomerStats as l, useCustomers as u } from "../hooks/useCustomers.js";
11
- import { Avatar as d, AvatarFallback as f, Button as p } from "../components/ui.js";
12
- import { PageLayout as m } from "../components/PageLayout.js";
13
- import { MetricCard as h, MetricGrid as g } from "../components/MetricCard.js";
14
- import { TypeBadge as _ } from "../components/StatusBadge.js";
15
- import { DataTable as v } from "../components/DataTable.js";
16
- import { formatDate as y } from "../utils/formatters.js";
10
+ import { formatDate as l } from "../utils/formatters.js";
11
+ import { useCustomerStats as u, useCustomers as d } from "../hooks/useCustomers.js";
12
+ import { Avatar as f, AvatarFallback as p, Button as m } from "../components/ui.js";
13
+ import { PageLayout as h } from "../components/PageLayout.js";
14
+ import { MetricCard as g, MetricGrid as _ } from "../components/MetricCard.js";
15
+ import { TypeBadge as v } from "../components/StatusBadge.js";
16
+ import { DataTable as y } from "../components/DataTable.js";
17
17
  import { useDebouncedValue as b } from "../hooks/useDebouncedValue.js";
18
18
  import { useEntityExport as x } from "../hooks/useEntityExport.js";
19
19
  import { ExportStatusBanner as S } from "../components/ExportStatusBanner.js";
@@ -22,12 +22,12 @@ import { jsx as w, jsxs as T } from "react/jsx-runtime";
22
22
  import { CTAOverflowMenu as E, PagePurpose as D } from "@burdenoff/fe-libs/ui";
23
23
  //#region src/movethewheels/pages/CustomersPage.tsx
24
24
  function O() {
25
- let { basePath: O, navigate: k } = c(), { state: A, isExporting: j, startExport: M, dismiss: N } = x("customers", "customer"), [P, F] = C(0), [I, L] = C(25), [R, z] = C(""), B = b(R), { customers: V, totalCustomers: H, hasMore: U, isLoading: W, error: G, refetch: K } = u({
25
+ let { basePath: O, navigate: k } = c(), { state: A, isExporting: j, startExport: M, dismiss: N } = x("customers", "customer"), [P, F] = C(0), [I, L] = C(25), [R, z] = C(""), B = b(R), { customers: V, totalCustomers: H, hasMore: U, isLoading: W, error: G, refetch: K } = d({
26
26
  limit: I,
27
27
  offset: P * I,
28
28
  filters: { search: B }
29
- }), { stats: q } = l(), J = (e) => k?.(s(O, e));
30
- return /* @__PURE__ */ T(m, {
29
+ }), { stats: q } = u(), J = (e) => k?.(s(O, e));
30
+ return /* @__PURE__ */ T(h, {
31
31
  title: "Customers",
32
32
  subtitle: `${q.total} customers`,
33
33
  icon: /* @__PURE__ */ w(o, { size: 24 }),
@@ -67,23 +67,23 @@ function O() {
67
67
  /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
68
68
  className: "mb-3 text-sm font-medium text-text-secondary",
69
69
  children: "Customer base at a glance"
70
- }), /* @__PURE__ */ T(g, {
70
+ }), /* @__PURE__ */ T(_, {
71
71
  columns: 3,
72
72
  children: [
73
- /* @__PURE__ */ w(h, {
73
+ /* @__PURE__ */ w(g, {
74
74
  label: "Total customers",
75
75
  value: q.total,
76
76
  icon: /* @__PURE__ */ w(o, { size: 20 }),
77
77
  accent: "brand"
78
78
  }),
79
- /* @__PURE__ */ w(h, {
79
+ /* @__PURE__ */ w(g, {
80
80
  label: "Avg. rating",
81
81
  value: q.avgRating > 0 ? q.avgRating.toFixed(1) : "—",
82
82
  icon: /* @__PURE__ */ w(i, { size: 20 }),
83
83
  accent: "success",
84
84
  subtitle: "Across all customers"
85
85
  }),
86
- /* @__PURE__ */ w(h, {
86
+ /* @__PURE__ */ w(g, {
87
87
  label: "Business accounts",
88
88
  value: q.b2b,
89
89
  icon: /* @__PURE__ */ w(e, { size: 20 }),
@@ -92,14 +92,14 @@ function O() {
92
92
  })
93
93
  ]
94
94
  })] }),
95
- /* @__PURE__ */ w(v, {
95
+ /* @__PURE__ */ w(y, {
96
96
  columns: [
97
97
  {
98
98
  id: "customer",
99
99
  header: "Customer",
100
100
  cell: (e) => /* @__PURE__ */ T("div", {
101
101
  className: "flex items-center gap-3",
102
- children: [/* @__PURE__ */ w(d, { children: /* @__PURE__ */ w(f, { children: e.name.split(" ").map((e) => e[0]).join("") }) }), /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
102
+ children: [/* @__PURE__ */ w(f, { children: /* @__PURE__ */ w(p, { children: e.name.split(" ").map((e) => e[0]).join("") }) }), /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
103
103
  className: "font-medium",
104
104
  children: e.name
105
105
  }), /* @__PURE__ */ w("p", {
@@ -112,7 +112,7 @@ function O() {
112
112
  id: "type",
113
113
  header: "Type",
114
114
  accessorKey: "type",
115
- cell: (e) => /* @__PURE__ */ w(_, { type: e.type })
115
+ cell: (e) => /* @__PURE__ */ w(v, { type: e.type })
116
116
  },
117
117
  {
118
118
  id: "company",
@@ -146,7 +146,7 @@ function O() {
146
146
  header: "Created",
147
147
  accessorKey: "createdAt",
148
148
  sortable: !0,
149
- cell: (e) => y(e.createdAt, "short")
149
+ cell: (e) => l(e.createdAt, "short")
150
150
  }
151
151
  ],
152
152
  data: V,
@@ -177,7 +177,7 @@ function O() {
177
177
  emptyIllustration: "empty-people",
178
178
  emptyTitle: "No customers yet",
179
179
  emptyDescription: "Add your first customer to start booking deliveries for them.",
180
- emptyAction: /* @__PURE__ */ T(p, {
180
+ emptyAction: /* @__PURE__ */ T(m, {
181
181
  onClick: () => J("customers/new"),
182
182
  children: [/* @__PURE__ */ w(n, {
183
183
  size: 16,
@@ -11,20 +11,20 @@ import { Truck as l } from "../node_modules/lucide-react/dist/esm/icons/truck.js
11
11
  import { Users as ee } from "../node_modules/lucide-react/dist/esm/icons/users.js";
12
12
  import { joinPath as te } from "../utils/navigation.js";
13
13
  import { useMoveTheWheels as u } from "../providers/MoveTheWheelsProvider.js";
14
- import { useOrderStats as d, useOrders as f } from "../hooks/useOrders.js";
15
- import { useFleetStats as p } from "../hooks/useFleet.js";
16
- import { useAnalytics as ne, useDashboardMetrics as re } from "../hooks/useAnalytics.js";
17
- import { useLiveTracking as ie, useTrackingAlerts as m } from "../hooks/useTracking.js";
18
- import { Badge as h, Button as g, Card as _, CardContent as v, CardHeader as y, CardTitle as b, Progress as x } from "../components/ui.js";
19
- import { PageLayout as ae, PageSection as S } from "../components/PageLayout.js";
14
+ import { formatCurrency as d, formatDate as f } from "../utils/formatters.js";
15
+ import { useOrderStats as p, useOrders as ne } from "../hooks/useOrders.js";
16
+ import { useFleetStats as re } from "../hooks/useFleet.js";
17
+ import { useAnalytics as ie, useDashboardMetrics as m } from "../hooks/useAnalytics.js";
18
+ import { useLiveTracking as ae, useTrackingAlerts as oe } from "../hooks/useTracking.js";
19
+ import { Badge as h, Button as g, Card as _, CardContent as v, CardHeader as y, CardTitle as b, Progress as se } from "../components/ui.js";
20
+ import { PageLayout as x, PageSection as S } from "../components/PageLayout.js";
20
21
  import { MetricCard as C, MetricGrid as w } from "../components/MetricCard.js";
21
- import { VolumeBar as oe } from "../components/charts/VolumeBar.js";
22
+ import { VolumeBar as T } from "../components/charts/VolumeBar.js";
22
23
  import "../components/charts/index.js";
23
- import { LogisticsMap as T } from "../components/maps/LogisticsMap.js";
24
+ import { LogisticsMap as E } from "../components/maps/LogisticsMap.js";
24
25
  import "../components/maps/index.js";
25
- import { StatusBadge as E } from "../components/StatusBadge.js";
26
- import { formatCurrency as D, formatDate as O } from "../utils/formatters.js";
27
- import { TrackingAlertList as se } from "../components/TrackingAlertList.js";
26
+ import { StatusBadge as D } from "../components/StatusBadge.js";
27
+ import { TrackingAlertList as O } from "../components/TrackingAlertList.js";
28
28
  import { deliveryMarkerStatus as ce, firstRealLatLng as le } from "../utils/mapMarkers.js";
29
29
  import { useMemo as k } from "react";
30
30
  import { jsx as A, jsxs as j } from "react/jsx-runtime";
@@ -46,7 +46,7 @@ function L() {
46
46
  let { t: L } = M(), R = (e, t) => {
47
47
  let n = L(e);
48
48
  return n === e ? t : n;
49
- }, { basePath: z, navigate: B } = u(), { metrics: V } = re(), { analytics: H } = ne(), { orders: U } = f({ limit: 5 }), { stats: W } = d(), { stats: G } = p(), { activeDeliveries: K } = ie(), { unacknowledgedAlerts: q, acknowledgeAlert: ue, refetch: de } = m(), J = k(() => H.trends.dailyOrders.map((e) => e.orders), [H.trends.dailyOrders]), Y = k(() => H.trends.dailyOrders.map((e) => e.deliveries), [H.trends.dailyOrders]), X = k(() => H.trends.revenue.map((e) => e.revenue), [H.trends.revenue]), fe = k(() => H.trends.dailyOrders.slice(-7), [H.trends.dailyOrders]), pe = k(() => K.flatMap((e) => {
49
+ }, { basePath: z, navigate: B } = u(), { metrics: V } = m(), { analytics: H } = ie(), { orders: U } = ne({ limit: 5 }), { stats: W } = p(), { stats: G } = re(), { activeDeliveries: K } = ae(), { unacknowledgedAlerts: q, acknowledgeAlert: ue, refetch: de } = oe(), J = k(() => H.trends.dailyOrders.map((e) => e.orders), [H.trends.dailyOrders]), Y = k(() => H.trends.dailyOrders.map((e) => e.deliveries), [H.trends.dailyOrders]), X = k(() => H.trends.revenue.map((e) => e.revenue), [H.trends.revenue]), fe = k(() => H.trends.dailyOrders.slice(-7), [H.trends.dailyOrders]), pe = k(() => K.flatMap((e) => {
50
50
  if (!e.order) return [];
51
51
  let t = le(e.vehicle?.currentLocation, e.driver?.currentLocation, e.tracking?.currentLocation);
52
52
  return t ? [{
@@ -62,7 +62,7 @@ function L() {
62
62
  }, $ = (e, t) => {
63
63
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), t());
64
64
  };
65
- return /* @__PURE__ */ j(ae, {
65
+ return /* @__PURE__ */ j(x, {
66
66
  hero: !0,
67
67
  titleAccent: R("movethewheels.dashboard.title", "Dashboard"),
68
68
  title: R("movethewheels.dashboard.title", "Dashboard"),
@@ -129,7 +129,7 @@ function L() {
129
129
  treatment: "glass",
130
130
  glow: !0,
131
131
  label: R("movethewheels.dashboard.metrics.revenue", "Revenue"),
132
- value: D(V.revenue.total),
132
+ value: d(V.revenue.total),
133
133
  icon: /* @__PURE__ */ A(r, { size: 20 }),
134
134
  accent: "success",
135
135
  sparklineData: X.length >= 2 ? X : void 0,
@@ -159,7 +159,7 @@ function L() {
159
159
  })]
160
160
  }), /* @__PURE__ */ A(v, {
161
161
  className: "p-0",
162
- children: /* @__PURE__ */ A(T, {
162
+ children: /* @__PURE__ */ A(E, {
163
163
  markers: pe,
164
164
  height: 460,
165
165
  emptyMessage: K.length === 0 ? R("movethewheels.dashboard.liveMap.noActive", "No active deliveries right now") : R("movethewheels.dashboard.liveMap.awaitingGps", "Awaiting live GPS positions for active deliveries")
@@ -181,7 +181,7 @@ function L() {
181
181
  children: q.length
182
182
  })
183
183
  ]
184
- }) }), /* @__PURE__ */ A(v, { children: q.length > 0 ? /* @__PURE__ */ A(se, {
184
+ }) }), /* @__PURE__ */ A(v, { children: q.length > 0 ? /* @__PURE__ */ A(O, {
185
185
  alerts: q,
186
186
  limit: 4,
187
187
  t: R,
@@ -218,7 +218,7 @@ function L() {
218
218
  ]
219
219
  }), /* @__PURE__ */ A("p", {
220
220
  className: "text-xs text-text-secondary",
221
- children: O(e.updatedAt ?? e.createdAt, "relative")
221
+ children: f(e.updatedAt ?? e.createdAt, "relative")
222
222
  })]
223
223
  })]
224
224
  }, e.id))
@@ -228,7 +228,7 @@ function L() {
228
228
  }) })] })]
229
229
  })]
230
230
  }),
231
- /* @__PURE__ */ j(_, { children: [/* @__PURE__ */ A(y, { children: /* @__PURE__ */ A(b, { children: R("movethewheels.dashboard.weeklyVolume.title", "Weekly order volume") }) }), /* @__PURE__ */ A(v, { children: /* @__PURE__ */ A(oe, {
231
+ /* @__PURE__ */ j(_, { children: [/* @__PURE__ */ A(y, { children: /* @__PURE__ */ A(b, { children: R("movethewheels.dashboard.weeklyVolume.title", "Weekly order volume") }) }), /* @__PURE__ */ A(v, { children: /* @__PURE__ */ A(T, {
232
232
  xKey: "date",
233
233
  height: 240,
234
234
  data: fe,
@@ -253,7 +253,7 @@ function L() {
253
253
  /* @__PURE__ */ A(C, {
254
254
  size: "sm",
255
255
  label: R("movethewheels.dashboard.stats.avgOrderValue", "Avg Order Value"),
256
- value: D(V.revenue.avgOrderValue)
256
+ value: d(V.revenue.avgOrderValue)
257
257
  }),
258
258
  /* @__PURE__ */ A(C, {
259
259
  size: "sm",
@@ -303,13 +303,13 @@ function L() {
303
303
  children: e.customerInfo.name
304
304
  })] }), /* @__PURE__ */ j("div", {
305
305
  className: "text-right",
306
- children: [/* @__PURE__ */ A(E, {
306
+ children: [/* @__PURE__ */ A(D, {
307
307
  status: e.status,
308
308
  type: "order",
309
309
  size: "sm"
310
310
  }), /* @__PURE__ */ A("p", {
311
311
  className: "text-sm text-text-secondary mt-1",
312
- children: D(e.pricing.total)
312
+ children: d(e.pricing.total)
313
313
  })]
314
314
  })]
315
315
  })
@@ -352,7 +352,7 @@ function L() {
352
352
  children: e.driver?.fullName || R("movethewheels.dashboard.activeDeliveries.unassigned", "Unassigned")
353
353
  })] }), /* @__PURE__ */ j("div", {
354
354
  className: "text-right",
355
- children: [/* @__PURE__ */ A(E, {
355
+ children: [/* @__PURE__ */ A(D, {
356
356
  status: e.order.status,
357
357
  type: "order",
358
358
  size: "sm"
@@ -361,7 +361,7 @@ function L() {
361
361
  children: [
362
362
  R("movethewheels.dashboard.activeDeliveries.eta", "ETA:"),
363
363
  " ",
364
- e.estimatedArrival ? O(e.estimatedArrival, "time") : R("movethewheels.dashboard.activeDeliveries.na", "N/A")
364
+ e.estimatedArrival ? f(e.estimatedArrival, "time") : R("movethewheels.dashboard.activeDeliveries.na", "N/A")
365
365
  ]
366
366
  })]
367
367
  })]
@@ -431,7 +431,7 @@ function L() {
431
431
  children: [/* @__PURE__ */ j("div", {
432
432
  className: "flex justify-between text-sm",
433
433
  children: [/* @__PURE__ */ A("span", { children: R("movethewheels.dashboard.fleetStatus.vehicleUtilization", "Vehicle Utilization") }), /* @__PURE__ */ j("span", { children: [G.utilization.toFixed(0), "%"] })]
434
- }), /* @__PURE__ */ A(x, { value: G.utilization })]
434
+ }), /* @__PURE__ */ A(se, { value: G.utilization })]
435
435
  }), /* @__PURE__ */ j("div", {
436
436
  className: "grid grid-cols-2 gap-4 text-sm",
437
437
  children: [
@@ -6,18 +6,18 @@ import { MapPin as i } from "../node_modules/lucide-react/dist/esm/icons/map-pin
6
6
  import { Package as a } from "../node_modules/lucide-react/dist/esm/icons/package.js";
7
7
  import { PenLine as o } from "../node_modules/lucide-react/dist/esm/icons/pen-line.js";
8
8
  import { Truck as s } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
9
- import { Type as ee } from "../node_modules/lucide-react/dist/esm/icons/type.js";
10
- import { Upload as c } from "../node_modules/lucide-react/dist/esm/icons/upload.js";
11
- import { useMoveTheWheels as l } from "../providers/MoveTheWheelsProvider.js";
12
- import { mapOrderPriority as u, mapOrderStatus as d } from "../hooks/useOrders.js";
13
- import { useShipmentStatusQuery as f } from "../hooks/useShipmentStatusAuthority.js";
14
- import { useCaptureEpod as p, useEpodPhotoUpload as m, useMyPendingEpodDeliveryJobs as h } from "../hooks/useEpod.js";
15
- import { Button as g, Card as _, CardContent as v, CardHeader as y, CardTitle as b, Input as x, Label as S, Textarea as C } from "../components/ui.js";
16
- import { PageLayout as w } from "../components/PageLayout.js";
17
- import { PriorityBadge as T, StatusBadge as E } from "../components/StatusBadge.js";
18
- import { FormError as D } from "../components/FormError.js";
19
- import { Notice as O, useNotice as k } from "../components/Notice.js";
20
- import { formatAddress as A, formatDate as j } from "../utils/formatters.js";
9
+ import { Type as c } from "../node_modules/lucide-react/dist/esm/icons/type.js";
10
+ import { Upload as l } from "../node_modules/lucide-react/dist/esm/icons/upload.js";
11
+ import { useMoveTheWheels as u } from "../providers/MoveTheWheelsProvider.js";
12
+ import { formatAddress as ee, formatDate as d } from "../utils/formatters.js";
13
+ import { mapOrderPriority as f, mapOrderStatus as p } from "../hooks/useOrders.js";
14
+ import { useShipmentStatusQuery as m } from "../hooks/useShipmentStatusAuthority.js";
15
+ import { useCaptureEpod as h, useEpodPhotoUpload as g, useMyPendingEpodDeliveryJobs as _ } from "../hooks/useEpod.js";
16
+ import { Button as v, Card as y, CardContent as b, CardHeader as x, CardTitle as S, Input as C, Label as w, Textarea as T } from "../components/ui.js";
17
+ import { PageLayout as E } from "../components/PageLayout.js";
18
+ import { PriorityBadge as D, StatusBadge as O } from "../components/StatusBadge.js";
19
+ import { FormError as k } from "../components/FormError.js";
20
+ import { Notice as A, useNotice as j } from "../components/Notice.js";
21
21
  import { SignaturePad as M } from "../components/SignaturePad.js";
22
22
  import { StatusAuthorityOwnedDeliveryDocument as N } from "../src/generated/shipment-status-authority-operations.js";
23
23
  import { useEffect as P, useRef as F, useState as I } from "react";
@@ -37,13 +37,13 @@ function ne() {
37
37
  });
38
38
  }
39
39
  function z({ job: e, onCaptured: t, onCancel: a }) {
40
- let { captureEpod: l, isSubmitting: u, error: d, captureFeedback: h } = p(), [w, T] = I(0), E = f(N, { deliveryJobId: e.id }, w), [O, k] = I(!1), j = F(null), z = F(!1), B = F(!0);
40
+ let { captureEpod: u, isSubmitting: d, error: f, captureFeedback: p } = h(), [_, E] = I(0), D = m(N, { deliveryJobId: e.id }, _), [O, A] = I(!1), j = F(null), z = F(!1), B = F(!0);
41
41
  P(() => (B.current = !0, () => {
42
42
  B.current = !1;
43
43
  }), []);
44
- let [re, V] = I(!1), [H, ie] = I(0), { upload: ae, isUploading: oe, error: U } = m(), W = F(null), [G, se] = I(""), [K, q] = I("drawn"), [J, ce] = I(""), [Y, le] = I(null), [X, ue] = I(""), [Z, Q] = I(null), de = async () => {
44
+ let [re, V] = I(!1), [H, ie] = I(0), { upload: ae, isUploading: oe, error: U } = g(), W = F(null), [G, se] = I(""), [K, q] = I("drawn"), [J, ce] = I(""), [Y, le] = I(null), [X, ue] = I(""), [Z, Q] = I(null), de = async () => {
45
45
  if (z.current) return;
46
- if (Q(null), E.loading || E.error || !E.data || w < H || !O || h?.kind === "UNKNOWN") {
46
+ if (Q(null), D.loading || D.error || !D.data || _ < H || !O || p?.kind === "UNKNOWN") {
47
47
  Q("Review the current linked shipment status and confirm completion before capture. Do not resend an uncertain capture.");
48
48
  return;
49
49
  }
@@ -71,9 +71,9 @@ function z({ job: e, onCaptured: t, onCancel: a }) {
71
71
  if (!B.current) return;
72
72
  let a = await ne();
73
73
  if (!B.current) return;
74
- let o = await l({
75
- expectedShipmentId: E.data.myEpodShipmentStatus?.id ?? null,
76
- expectedShipmentStatusRevision: E.data.myEpodShipmentStatus?.statusRevision,
74
+ let o = await u({
75
+ expectedShipmentId: D.data.myEpodShipmentStatus?.id ?? null,
76
+ expectedShipmentStatusRevision: D.data.myEpodShipmentStatus?.statusRevision,
77
77
  completionAttestation: O,
78
78
  deliveryJobId: e.id,
79
79
  recipientName: n,
@@ -88,24 +88,24 @@ function z({ job: e, onCaptured: t, onCancel: a }) {
88
88
  if (!B.current) return;
89
89
  t(o.deliveryJobId);
90
90
  } catch {
91
- k(!1), ie(w + 1);
91
+ A(!1), ie(_ + 1);
92
92
  } finally {
93
93
  z.current = !1, V(!1);
94
94
  }
95
- }, $ = u || oe || re;
96
- return /* @__PURE__ */ R(_, { children: [/* @__PURE__ */ L(y, { children: /* @__PURE__ */ R(b, {
95
+ }, $ = d || oe || re;
96
+ return /* @__PURE__ */ R(y, { children: [/* @__PURE__ */ L(x, { children: /* @__PURE__ */ R(S, {
97
97
  className: "flex items-center gap-2",
98
98
  children: [
99
99
  /* @__PURE__ */ L(s, { size: 18 }),
100
100
  " Capture delivery for ",
101
101
  e.deliveryJobNumber
102
102
  ]
103
- }) }), /* @__PURE__ */ R(v, {
103
+ }) }), /* @__PURE__ */ R(b, {
104
104
  className: "space-y-4",
105
105
  children: [
106
106
  /* @__PURE__ */ R("div", {
107
107
  className: "text-sm text-text-secondary space-y-1",
108
- children: [e.customerName && /* @__PURE__ */ R("p", { children: ["Recipient on file: ", e.customerName] }), e.deliveryAddress && /* @__PURE__ */ L("p", { children: A(e.deliveryAddress) })]
108
+ children: [e.customerName && /* @__PURE__ */ R("p", { children: ["Recipient on file: ", e.customerName] }), e.deliveryAddress && /* @__PURE__ */ L("p", { children: ee(e.deliveryAddress) })]
109
109
  }),
110
110
  /* @__PURE__ */ R("section", {
111
111
  "aria-label": "Linked shipment status",
@@ -114,17 +114,17 @@ function z({ job: e, onCaptured: t, onCancel: a }) {
114
114
  /* @__PURE__ */ R("p", { children: [
115
115
  "Recorded shipment:",
116
116
  " ",
117
- E.data?.myEpodShipmentStatus ? `${E.data.myEpodShipmentStatus.status.toLowerCase().replaceAll("_", " ")} · revision ${E.data.myEpodShipmentStatus.statusRevision}` : E.data ? "No linked shipment" : "Loading current record"
117
+ D.data?.myEpodShipmentStatus ? `${D.data.myEpodShipmentStatus.status.toLowerCase().replaceAll("_", " ")} · revision ${D.data.myEpodShipmentStatus.statusRevision}` : D.data ? "No linked shipment" : "Loading current record"
118
118
  ] }),
119
- E.error && /* @__PURE__ */ L("p", {
119
+ D.error && /* @__PURE__ */ L("p", {
120
120
  role: "alert",
121
- children: E.error
121
+ children: D.error
122
122
  }),
123
- /* @__PURE__ */ L(g, {
123
+ /* @__PURE__ */ L(v, {
124
124
  variant: "outline",
125
- disabled: E.loading || $,
125
+ disabled: D.loading || $,
126
126
  onClick: () => {
127
- k(!1), T((e) => e + 1);
127
+ A(!1), E((e) => e + 1);
128
128
  },
129
129
  children: "Refresh linked status"
130
130
  }),
@@ -133,23 +133,23 @@ function z({ job: e, onCaptured: t, onCancel: a }) {
133
133
  children: [/* @__PURE__ */ L("input", {
134
134
  type: "checkbox",
135
135
  checked: O,
136
- disabled: E.loading || !!E.error || $ || w < H || h?.kind === "UNKNOWN",
137
- onChange: (e) => k(e.target.checked)
136
+ disabled: D.loading || !!D.error || $ || _ < H || p?.kind === "UNKNOWN",
137
+ onChange: (e) => A(e.target.checked)
138
138
  }), "I reviewed the recorded linked status and attest to this delivery completion."]
139
139
  }),
140
140
  /* @__PURE__ */ L("p", { children: "This records an assigned driver's attestation; it does not independently verify physical freight movement." }),
141
- h && /* @__PURE__ */ L("p", {
141
+ p && /* @__PURE__ */ L("p", {
142
142
  role: "status",
143
- children: h.message
143
+ children: p.message
144
144
  })
145
145
  ]
146
146
  }),
147
147
  /* @__PURE__ */ R("div", {
148
148
  className: "space-y-1.5",
149
- children: [/* @__PURE__ */ L(S, {
149
+ children: [/* @__PURE__ */ L(w, {
150
150
  htmlFor: "epod-recipient-name",
151
151
  children: "Recipient name"
152
- }), /* @__PURE__ */ L(x, {
152
+ }), /* @__PURE__ */ L(C, {
153
153
  id: "epod-recipient-name",
154
154
  value: G,
155
155
  onChange: (e) => se(e.target.value),
@@ -159,24 +159,24 @@ function z({ job: e, onCaptured: t, onCancel: a }) {
159
159
  /* @__PURE__ */ R("div", {
160
160
  className: "space-y-1.5",
161
161
  children: [
162
- /* @__PURE__ */ L(S, { children: "Signature" }),
162
+ /* @__PURE__ */ L(w, { children: "Signature" }),
163
163
  /* @__PURE__ */ R("div", {
164
164
  className: "flex gap-2",
165
- children: [/* @__PURE__ */ R(g, {
165
+ children: [/* @__PURE__ */ R(v, {
166
166
  type: "button",
167
167
  variant: K === "drawn" ? "default" : "outline",
168
168
  size: "sm",
169
169
  onClick: () => q("drawn"),
170
170
  children: [/* @__PURE__ */ L(o, { size: 14 }), " Draw"]
171
- }), /* @__PURE__ */ R(g, {
171
+ }), /* @__PURE__ */ R(v, {
172
172
  type: "button",
173
173
  variant: K === "typed" ? "default" : "outline",
174
174
  size: "sm",
175
175
  onClick: () => q("typed"),
176
- children: [/* @__PURE__ */ L(ee, { size: 14 }), " Type name instead"]
176
+ children: [/* @__PURE__ */ L(c, { size: 14 }), " Type name instead"]
177
177
  })]
178
178
  }),
179
- K === "drawn" ? /* @__PURE__ */ L(M, { ref: W }) : /* @__PURE__ */ L(x, {
179
+ K === "drawn" ? /* @__PURE__ */ L(M, { ref: W }) : /* @__PURE__ */ L(C, {
180
180
  value: J,
181
181
  onChange: (e) => ce(e.target.value),
182
182
  placeholder: "Type full name as signature"
@@ -186,7 +186,7 @@ function z({ job: e, onCaptured: t, onCancel: a }) {
186
186
  /* @__PURE__ */ R("div", {
187
187
  className: "space-y-1.5",
188
188
  children: [
189
- /* @__PURE__ */ L(S, {
189
+ /* @__PURE__ */ L(w, {
190
190
  htmlFor: "epod-photo",
191
191
  children: "Delivery photo (optional)"
192
192
  }),
@@ -199,7 +199,7 @@ function z({ job: e, onCaptured: t, onCancel: a }) {
199
199
  capture: "environment",
200
200
  onChange: (e) => le(e.target.files?.[0] ?? null),
201
201
  className: "text-sm"
202
- }), Y && /* @__PURE__ */ L(c, {
202
+ }), Y && /* @__PURE__ */ L(l, {
203
203
  size: 14,
204
204
  className: "text-text-secondary"
205
205
  })]
@@ -212,10 +212,10 @@ function z({ job: e, onCaptured: t, onCancel: a }) {
212
212
  }),
213
213
  /* @__PURE__ */ R("div", {
214
214
  className: "space-y-1.5",
215
- children: [/* @__PURE__ */ L(S, {
215
+ children: [/* @__PURE__ */ L(w, {
216
216
  htmlFor: "epod-notes",
217
217
  children: "Notes (optional)"
218
- }), /* @__PURE__ */ L(C, {
218
+ }), /* @__PURE__ */ L(T, {
219
219
  id: "epod-notes",
220
220
  value: X,
221
221
  onChange: (e) => ue(e.target.value),
@@ -227,21 +227,21 @@ function z({ job: e, onCaptured: t, onCancel: a }) {
227
227
  className: "flex items-center gap-1.5 text-xs text-text-secondary",
228
228
  children: [/* @__PURE__ */ L(i, { size: 12 }), " Device GPS is captured automatically when permitted by the browser."]
229
229
  }),
230
- Z && /* @__PURE__ */ L(D, { message: Z }),
231
- d && /* @__PURE__ */ L(D, { message: d.message }),
232
- U && /* @__PURE__ */ L(D, { message: U.message }),
230
+ Z && /* @__PURE__ */ L(k, { message: Z }),
231
+ f && /* @__PURE__ */ L(k, { message: f.message }),
232
+ U && /* @__PURE__ */ L(k, { message: U.message }),
233
233
  /* @__PURE__ */ R("div", {
234
234
  className: "flex gap-2 justify-end",
235
- children: [/* @__PURE__ */ L(g, {
235
+ children: [/* @__PURE__ */ L(v, {
236
236
  type: "button",
237
237
  variant: "outline",
238
238
  onClick: a,
239
239
  disabled: $,
240
240
  children: "Cancel"
241
- }), /* @__PURE__ */ L(g, {
241
+ }), /* @__PURE__ */ L(v, {
242
242
  type: "button",
243
243
  onClick: () => void de(),
244
- disabled: $ || E.loading || !!E.error || !E.data || w < H || !O || h?.kind === "UNKNOWN",
244
+ disabled: $ || D.loading || !!D.error || !D.data || _ < H || !O || p?.kind === "UNKNOWN",
245
245
  children: $ ? /* @__PURE__ */ R(te, { children: [/* @__PURE__ */ L(r, {
246
246
  size: 14,
247
247
  className: "animate-spin"
@@ -252,28 +252,28 @@ function z({ job: e, onCaptured: t, onCancel: a }) {
252
252
  })] });
253
253
  }
254
254
  function B() {
255
- let { workspaceId: r, tenantId: i, currentUser: o, apiGatewayUrl: ee } = l(), [c, f] = I(0), { jobs: p, hasMore: m, isLoading: y, error: b, refetch: x, retireAcknowledgedJob: S } = h({
255
+ let { workspaceId: r, tenantId: i, currentUser: o, apiGatewayUrl: c } = u(), [l, m] = I(0), { jobs: h, hasMore: g, isLoading: x, error: S, refetch: C, retireAcknowledgedJob: w } = _({
256
256
  limit: 20,
257
- offset: c * 20
258
- }), [C, M] = I(null), { message: N, notify: P } = k();
259
- return /* @__PURE__ */ L(w, {
257
+ offset: l * 20
258
+ }), [T, M] = I(null), { message: N, notify: P } = j();
259
+ return /* @__PURE__ */ L(E, {
260
260
  title: "My Deliveries",
261
261
  subtitle: "Capture proof of delivery for your assigned stops",
262
262
  icon: /* @__PURE__ */ L(s, { size: 24 }),
263
263
  children: /* @__PURE__ */ R("div", {
264
264
  className: "space-y-4",
265
- children: [/* @__PURE__ */ L(O, { message: N }), C ? /* @__PURE__ */ L(z, {
266
- job: C,
265
+ children: [/* @__PURE__ */ L(A, { message: N }), T ? /* @__PURE__ */ L(z, {
266
+ job: T,
267
267
  onCaptured: (e) => {
268
- S(e), P("Proof of delivery captured — delivery marked complete."), M(null), f(0), x();
268
+ w(e), P("Proof of delivery captured — delivery marked complete."), M(null), m(0), C();
269
269
  },
270
270
  onCancel: () => M(null)
271
- }, `${r}:${i}:${o?.id}:${ee}:${C.id}`) : y ? /* @__PURE__ */ L("p", {
271
+ }, `${r}:${i}:${o?.id}:${c}:${T.id}`) : x ? /* @__PURE__ */ L("p", {
272
272
  className: "text-text-secondary text-center py-8",
273
273
  children: "Loading your deliveries…"
274
- }) : b ? /* @__PURE__ */ L(D, { message: b.message }) : p.length > 0 ? /* @__PURE__ */ R("div", {
274
+ }) : S ? /* @__PURE__ */ L(k, { message: S.message }) : h.length > 0 ? /* @__PURE__ */ R("div", {
275
275
  className: "space-y-3",
276
- children: [p.map((e) => /* @__PURE__ */ L(_, { children: /* @__PURE__ */ R(v, {
276
+ children: [h.map((e) => /* @__PURE__ */ L(y, { children: /* @__PURE__ */ R(b, {
277
277
  className: "flex items-center justify-between gap-3 py-4",
278
278
  children: [/* @__PURE__ */ R("div", {
279
279
  className: "min-w-0",
@@ -288,45 +288,45 @@ function B() {
288
288
  }),
289
289
  /* @__PURE__ */ R("div", {
290
290
  className: "flex flex-wrap items-center gap-1.5 py-1",
291
- children: [/* @__PURE__ */ L(E, {
292
- status: d(e.status),
291
+ children: [/* @__PURE__ */ L(O, {
292
+ status: p(e.status),
293
293
  type: "order",
294
294
  size: "sm"
295
- }), /* @__PURE__ */ L(T, {
296
- priority: u(e.priority),
295
+ }), /* @__PURE__ */ L(D, {
296
+ priority: f(e.priority),
297
297
  size: "sm"
298
298
  })]
299
299
  }),
300
300
  e.deliveryAddress && /* @__PURE__ */ L("p", {
301
301
  className: "text-sm text-text-secondary truncate",
302
- children: A(e.deliveryAddress)
302
+ children: ee(e.deliveryAddress)
303
303
  }),
304
304
  e.scheduledDelivery && /* @__PURE__ */ R("p", {
305
305
  className: "text-xs text-text-secondary",
306
- children: ["Scheduled ", j(e.scheduledDelivery, "short")]
306
+ children: ["Scheduled ", d(e.scheduledDelivery, "short")]
307
307
  })
308
308
  ]
309
- }), /* @__PURE__ */ L(g, {
309
+ }), /* @__PURE__ */ L(v, {
310
310
  type: "button",
311
311
  size: "sm",
312
312
  onClick: () => M(e),
313
313
  children: "Capture"
314
314
  })]
315
- }) }, e.id)), (c > 0 || m) && /* @__PURE__ */ R("div", {
315
+ }) }, e.id)), (l > 0 || g) && /* @__PURE__ */ R("div", {
316
316
  className: "flex justify-end gap-2 pt-2",
317
- children: [/* @__PURE__ */ R(g, {
317
+ children: [/* @__PURE__ */ R(v, {
318
318
  type: "button",
319
319
  variant: "outline",
320
320
  size: "sm",
321
- disabled: c === 0 || y,
322
- onClick: () => f((e) => Math.max(0, e - 1)),
321
+ disabled: l === 0 || x,
322
+ onClick: () => m((e) => Math.max(0, e - 1)),
323
323
  children: [/* @__PURE__ */ L(e, { size: 16 }), " Previous"]
324
- }), /* @__PURE__ */ R(g, {
324
+ }), /* @__PURE__ */ R(v, {
325
325
  type: "button",
326
326
  variant: "outline",
327
327
  size: "sm",
328
- disabled: !m || y,
329
- onClick: () => f((e) => e + 1),
328
+ disabled: !g || x,
329
+ onClick: () => m((e) => e + 1),
330
330
  children: ["Next ", /* @__PURE__ */ L(t, { size: 16 })]
331
331
  })]
332
332
  })]