@burdenoff/microfe-movethewheels 2026.1031.2 → 2026.1031.4
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.
- package/dist/MoveTheWheelsRoot.js +121 -104
- package/dist/MoveTheWheelsRoutes.js +142 -133
- package/dist/components/DocumentsCard.js +11 -11
- package/dist/components/ProofOfDeliveryCard.js +13 -13
- package/dist/components/ShipmentRiskDialog.js +24 -24
- package/dist/components/ShippingQuoteResults.js +46 -46
- package/dist/components/TrackingAlertList.js +17 -17
- package/dist/generated/tracking-quality-operations.d.ts +140 -0
- package/dist/hooks/useEntityImport.js +68 -0
- package/dist/hooks/useOrderDispatch.js +17 -17
- package/dist/movethewheels/hooks/useEntityImport.d.ts +19 -0
- package/dist/movethewheels/pages/ImportExportPage.d.ts +9 -0
- package/dist/movethewheels/pages/SettingsPage.d.ts +1 -0
- package/dist/movethewheels/providers/ModuleSettingsProvider.d.ts +17 -0
- package/dist/movethewheels/utils/entityImport.d.ts +109 -0
- package/dist/movethewheels/utils/formatters.d.ts +23 -3
- package/dist/movethewheels/utils/moduleSettings.d.ts +52 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/arrow-down-up.js +22 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/bell.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/file-spreadsheet.js +30 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/file-up.js +22 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/key-round.js +14 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/plug.js +22 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/rotate-ccw.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/settings.js +13 -0
- package/dist/pages/AnalyticsPage.js +27 -27
- package/dist/pages/CreateOrderPage.js +340 -317
- package/dist/pages/CustomerDetailsPage.js +246 -246
- package/dist/pages/CustomersPage.js +88 -79
- package/dist/pages/DashboardPage.js +24 -24
- package/dist/pages/DeliveryCapturePage.js +74 -74
- package/dist/pages/DriverDetailsPage.js +337 -337
- package/dist/pages/DriversPage.js +119 -110
- package/dist/pages/FinancePage.js +26 -26
- package/dist/pages/ImportExportPage.js +435 -0
- package/dist/pages/InventoryPage.js +28 -28
- package/dist/pages/LiveTrackingPage.js +108 -108
- package/dist/pages/MarketplacePage.js +44 -44
- package/dist/pages/OrderDetailsPage.js +306 -306
- package/dist/pages/OrdersListPage.js +27 -27
- package/dist/pages/ProductDetailsPage.js +89 -89
- package/dist/pages/ProductsPage.js +86 -77
- package/dist/pages/RouteDetailsPage.js +282 -285
- package/dist/pages/RoutesPage.js +78 -78
- package/dist/pages/SettingsPage.js +459 -0
- package/dist/pages/TrackingPage.js +41 -41
- package/dist/pages/VehicleDetailsPage.js +207 -207
- package/dist/pages/VehiclesPage.js +100 -90
- package/dist/pages/WarehouseDetailsPage.js +132 -132
- package/dist/pages/WarehousesPage.js +97 -88
- package/dist/providers/ModuleSettingsProvider.js +74 -0
- package/dist/utils/entityImport.js +73 -0
- package/dist/utils/formatters.js +53 -26
- package/dist/utils/moduleSettings.js +132 -0
- package/package.json +4 -2
- package/src/generated/tracking-quality-operations.ts +184 -0
- package/src/movethewheels/MoveTheWheelsRoot.tsx +22 -3
- package/src/movethewheels/MoveTheWheelsRoutes.tsx +13 -0
- package/src/movethewheels/hooks/useEntityImport.ts +108 -0
- package/src/movethewheels/pages/CreateOrderPage.tsx +38 -6
- package/src/movethewheels/pages/CustomersPage.tsx +6 -1
- package/src/movethewheels/pages/DriversPage.tsx +6 -0
- package/src/movethewheels/pages/ImportExportPage.tsx +483 -0
- package/src/movethewheels/pages/ProductsPage.tsx +16 -3
- package/src/movethewheels/pages/RouteDetailsPage.tsx +3 -6
- package/src/movethewheels/pages/RoutesPage.tsx +2 -2
- package/src/movethewheels/pages/SettingsPage.tsx +516 -0
- package/src/movethewheels/pages/VehicleDetailsPage.tsx +4 -2
- package/src/movethewheels/pages/VehiclesPage.tsx +8 -1
- package/src/movethewheels/pages/WarehousesPage.tsx +6 -1
- package/src/movethewheels/providers/ModuleSettingsProvider.tsx +133 -0
- package/src/movethewheels/utils/entityImport.ts +239 -0
- package/src/movethewheels/utils/formatters.ts +69 -10
- package/src/movethewheels/utils/moduleSettings.ts +224 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { formatDateTime as e } from "../utils/formatters.js";
|
|
2
|
+
import { formatSlip as t, riskSignalLabel as n } from "../utils/trackingAlerts.js";
|
|
3
|
+
import { Badge as r, Button as i, Dialog as a, DialogContent as o, DialogDescription as s, DialogHeader as c, DialogTitle as l, Skeleton as u, Textarea as d } from "./ui.js";
|
|
4
4
|
import { useShipmentRisk as f } from "../hooks/useShipmentRisk.js";
|
|
5
5
|
import { useEffect as p, useState as m } from "react";
|
|
6
6
|
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
@@ -44,8 +44,8 @@ var _ = {
|
|
|
44
44
|
fallback: "Reassign the vehicle on this order"
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
|
-
function y(
|
|
48
|
-
return
|
|
47
|
+
function y(e, n) {
|
|
48
|
+
return e.ratio === null ? e.minutes !== null && e.minutes > 0 ? t(e.minutes) : null : `${Math.round(e.ratio * 100)}% ${n("movethewheels.risk.lateRate", "late recently")}`;
|
|
49
49
|
}
|
|
50
50
|
function b({ shipmentId: b, shipmentNumber: x, open: S, onOpenChange: C, t: w, onOpenOrder: T, onChanged: E }) {
|
|
51
51
|
let { forecast: D, shipment: O, isLoading: k, error: A, refetch: j, repromise: M, recordTrackingUpdate: N } = f(S ? b : void 0), [P, F] = m(null), [I, L] = m(null), [R, z] = m(!1), [B, V] = m("");
|
|
@@ -62,17 +62,17 @@ function b({ shipmentId: b, shipmentNumber: x, open: S, onOpenChange: C, t: w, o
|
|
|
62
62
|
z(!1);
|
|
63
63
|
}
|
|
64
64
|
}, U = D?.predictedDeliveryLatest ?? D?.predictedDeliveryEarliest, W = O?.deliveryJobId ?? null;
|
|
65
|
-
return /* @__PURE__ */ h(
|
|
65
|
+
return /* @__PURE__ */ h(a, {
|
|
66
66
|
open: S,
|
|
67
67
|
onOpenChange: C,
|
|
68
|
-
children: /* @__PURE__ */ g(
|
|
68
|
+
children: /* @__PURE__ */ g(o, {
|
|
69
69
|
className: "max-w-lg",
|
|
70
70
|
children: [
|
|
71
|
-
/* @__PURE__ */ g(
|
|
71
|
+
/* @__PURE__ */ g(c, { children: [/* @__PURE__ */ g(l, { children: [w("movethewheels.risk.title", "Delivery risk"), x ? ` · ${x}` : ""] }), /* @__PURE__ */ h(s, { children: w("movethewheels.risk.description", "Forecast from this shipment’s legs, route, tracking, vehicle and carrier history.") })] }),
|
|
72
72
|
k && !D && /* @__PURE__ */ g("div", {
|
|
73
73
|
className: "space-y-2",
|
|
74
74
|
"aria-busy": "true",
|
|
75
|
-
children: [/* @__PURE__ */ h(
|
|
75
|
+
children: [/* @__PURE__ */ h(u, { className: "h-6 w-1/2" }), /* @__PURE__ */ h(u, { className: "h-16 w-full" })]
|
|
76
76
|
}),
|
|
77
77
|
A && !k && /* @__PURE__ */ g("div", {
|
|
78
78
|
role: "alert",
|
|
@@ -80,7 +80,7 @@ function b({ shipmentId: b, shipmentNumber: x, open: S, onOpenChange: C, t: w, o
|
|
|
80
80
|
children: [/* @__PURE__ */ h("p", {
|
|
81
81
|
className: "text-status-error-text",
|
|
82
82
|
children: A.message
|
|
83
|
-
}), /* @__PURE__ */ h(
|
|
83
|
+
}), /* @__PURE__ */ h(i, {
|
|
84
84
|
size: "sm",
|
|
85
85
|
variant: "outline",
|
|
86
86
|
onClick: j,
|
|
@@ -94,7 +94,7 @@ function b({ shipmentId: b, shipmentNumber: x, open: S, onOpenChange: C, t: w, o
|
|
|
94
94
|
/* @__PURE__ */ g("div", {
|
|
95
95
|
className: "flex flex-wrap items-center gap-2",
|
|
96
96
|
children: [
|
|
97
|
-
/* @__PURE__ */ h(
|
|
97
|
+
/* @__PURE__ */ h(r, {
|
|
98
98
|
variant: D.riskLevel === "HIGH" ? "destructive" : "secondary",
|
|
99
99
|
children: w(_[D.riskLevel].key, _[D.riskLevel].fallback)
|
|
100
100
|
}),
|
|
@@ -110,7 +110,7 @@ function b({ shipmentId: b, shipmentNumber: x, open: S, onOpenChange: C, t: w, o
|
|
|
110
110
|
})
|
|
111
111
|
]
|
|
112
112
|
}),
|
|
113
|
-
D.breached && /* @__PURE__ */ h(
|
|
113
|
+
D.breached && /* @__PURE__ */ h(r, {
|
|
114
114
|
variant: "destructive",
|
|
115
115
|
children: w("movethewheels.risk.breached", "Promise missed")
|
|
116
116
|
})
|
|
@@ -121,14 +121,14 @@ function b({ shipmentId: b, shipmentNumber: x, open: S, onOpenChange: C, t: w, o
|
|
|
121
121
|
children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("dt", {
|
|
122
122
|
className: "text-xs text-text-secondary",
|
|
123
123
|
children: w("movethewheels.alerts.promised", "Promised")
|
|
124
|
-
}), /* @__PURE__ */ h("dd", { children: D.promisedDelivery ?
|
|
124
|
+
}), /* @__PURE__ */ h("dd", { children: D.promisedDelivery ? e(D.promisedDelivery) : w("movethewheels.risk.noPromise", "No promised time") })] }), /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("dt", {
|
|
125
125
|
className: "text-xs text-text-secondary",
|
|
126
126
|
children: w("movethewheels.risk.window", "Predicted window")
|
|
127
|
-
}), /* @__PURE__ */ g("dd", { children: [D.predictedDeliveryEarliest ? `${
|
|
127
|
+
}), /* @__PURE__ */ g("dd", { children: [D.predictedDeliveryEarliest ? `${e(D.predictedDeliveryEarliest)}${D.predictedDeliveryLatest && D.predictedDeliveryLatest !== D.predictedDeliveryEarliest ? ` – ${e(D.predictedDeliveryLatest)}` : ""}` : w("movethewheels.risk.noPrediction", "Not enough data to predict"), D.predictedSlipMinutes > 0 && /* @__PURE__ */ g("span", {
|
|
128
128
|
className: "ml-1 text-status-error-text",
|
|
129
129
|
children: [
|
|
130
130
|
"(+",
|
|
131
|
-
|
|
131
|
+
t(D.predictedSlipMinutes),
|
|
132
132
|
")"
|
|
133
133
|
]
|
|
134
134
|
})] })] })]
|
|
@@ -139,12 +139,12 @@ function b({ shipmentId: b, shipmentNumber: x, open: S, onOpenChange: C, t: w, o
|
|
|
139
139
|
}), D.signals.length > 0 ? /* @__PURE__ */ h("ul", {
|
|
140
140
|
className: "space-y-1",
|
|
141
141
|
children: D.signals.map((e) => {
|
|
142
|
-
let
|
|
142
|
+
let t = y(e, w);
|
|
143
143
|
return /* @__PURE__ */ g("li", {
|
|
144
144
|
className: "flex items-center justify-between rounded border border-border-primary px-2 py-1",
|
|
145
|
-
children: [/* @__PURE__ */ g("span", { children: [
|
|
145
|
+
children: [/* @__PURE__ */ g("span", { children: [n(e.code, w), t && /* @__PURE__ */ g("span", {
|
|
146
146
|
className: "ml-1 text-text-secondary",
|
|
147
|
-
children: ["· ",
|
|
147
|
+
children: ["· ", t]
|
|
148
148
|
})] }), /* @__PURE__ */ g("span", {
|
|
149
149
|
className: "text-xs text-text-secondary",
|
|
150
150
|
children: ["+", e.weight]
|
|
@@ -166,7 +166,7 @@ function b({ shipmentId: b, shipmentNumber: x, open: S, onOpenChange: C, t: w, o
|
|
|
166
166
|
className: "font-medium",
|
|
167
167
|
children: w(v[D.recommendedAction].key, v[D.recommendedAction].fallback)
|
|
168
168
|
}),
|
|
169
|
-
D.recommendedAction === "REPROMISE_DELIVERY" && U && /* @__PURE__ */ g(
|
|
169
|
+
D.recommendedAction === "REPROMISE_DELIVERY" && U && /* @__PURE__ */ g(i, {
|
|
170
170
|
size: "sm",
|
|
171
171
|
className: "mt-2",
|
|
172
172
|
disabled: R,
|
|
@@ -174,25 +174,25 @@ function b({ shipmentId: b, shipmentNumber: x, open: S, onOpenChange: C, t: w, o
|
|
|
174
174
|
children: [
|
|
175
175
|
w("movethewheels.risk.repromiseTo", "Re-promise to"),
|
|
176
176
|
" ",
|
|
177
|
-
|
|
177
|
+
e(U)
|
|
178
178
|
]
|
|
179
179
|
}),
|
|
180
180
|
D.recommendedAction === "REQUEST_TRACKING_UPDATE" && /* @__PURE__ */ g("div", {
|
|
181
181
|
className: "mt-2 space-y-2",
|
|
182
|
-
children: [/* @__PURE__ */ h(
|
|
182
|
+
children: [/* @__PURE__ */ h(d, {
|
|
183
183
|
value: B,
|
|
184
184
|
onChange: (e) => V(e.target.value),
|
|
185
185
|
maxLength: 500,
|
|
186
186
|
"aria-label": w("movethewheels.risk.updateDetails", "Tracking update"),
|
|
187
187
|
placeholder: w("movethewheels.risk.updatePlaceholder", "What did the driver or carrier report?")
|
|
188
|
-
}), /* @__PURE__ */ h(
|
|
188
|
+
}), /* @__PURE__ */ h(i, {
|
|
189
189
|
size: "sm",
|
|
190
190
|
disabled: R || B.trim().length === 0,
|
|
191
191
|
onClick: () => void H(() => N(B.trim()), w("movethewheels.risk.updateRecorded", "Tracking update recorded")),
|
|
192
192
|
children: w("movethewheels.risk.recordUpdate", "Record tracking update")
|
|
193
193
|
})]
|
|
194
194
|
}),
|
|
195
|
-
D.recommendedAction === "REASSIGN_VEHICLE" && W && /* @__PURE__ */ h(
|
|
195
|
+
D.recommendedAction === "REASSIGN_VEHICLE" && W && /* @__PURE__ */ h(i, {
|
|
196
196
|
size: "sm",
|
|
197
197
|
className: "mt-2",
|
|
198
198
|
onClick: () => T(W),
|
|
@@ -215,7 +215,7 @@ function b({ shipmentId: b, shipmentNumber: x, open: S, onOpenChange: C, t: w, o
|
|
|
215
215
|
children: [
|
|
216
216
|
w("movethewheels.risk.evaluated", "Evaluated"),
|
|
217
217
|
" ",
|
|
218
|
-
|
|
218
|
+
e(D.evaluatedAt)
|
|
219
219
|
]
|
|
220
220
|
})
|
|
221
221
|
]
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TriangleAlert as e } from "../node_modules/lucide-react/dist/esm/icons/triangle-alert.js";
|
|
2
2
|
import { Truck as t } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { formatCurrency as n } from "../utils/formatters.js";
|
|
4
|
+
import { Card as r, CardContent as i, CardHeader as a, CardTitle as o, Table as s, TableBody as c, TableCell as l, TableHead as u, TableHeader as d, TableRow as f } from "./ui.js";
|
|
5
|
+
import { StatusBadge as p } from "./StatusBadge.js";
|
|
6
6
|
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
7
7
|
//#region src/movethewheels/components/ShippingQuoteResults.tsx
|
|
8
8
|
var _ = {
|
|
@@ -22,19 +22,19 @@ function b(e, t) {
|
|
|
22
22
|
}
|
|
23
23
|
function x({ quote: e, t }) {
|
|
24
24
|
return /* @__PURE__ */ g(m, { children: [
|
|
25
|
-
e.isCheapest && /* @__PURE__ */ h(
|
|
25
|
+
e.isCheapest && /* @__PURE__ */ h(p, {
|
|
26
26
|
status: t("movethewheels.shipping.results.cheapest", "Cheapest"),
|
|
27
27
|
customColors: _,
|
|
28
28
|
size: "sm",
|
|
29
29
|
showDot: !1
|
|
30
30
|
}),
|
|
31
|
-
e.isFastest && /* @__PURE__ */ h(
|
|
31
|
+
e.isFastest && /* @__PURE__ */ h(p, {
|
|
32
32
|
status: t("movethewheels.shipping.results.fastest", "Fastest"),
|
|
33
33
|
customColors: v,
|
|
34
34
|
size: "sm",
|
|
35
35
|
showDot: !1
|
|
36
36
|
}),
|
|
37
|
-
e.isRecommended && /* @__PURE__ */ h(
|
|
37
|
+
e.isRecommended && /* @__PURE__ */ h(p, {
|
|
38
38
|
status: t("movethewheels.shipping.results.recommended", "Recommended"),
|
|
39
39
|
customColors: v,
|
|
40
40
|
size: "sm",
|
|
@@ -42,52 +42,52 @@ function x({ quote: e, t }) {
|
|
|
42
42
|
})
|
|
43
43
|
] });
|
|
44
44
|
}
|
|
45
|
-
function S({ estimate: e, t:
|
|
46
|
-
let
|
|
47
|
-
return /* @__PURE__ */ g(
|
|
45
|
+
function S({ estimate: e, t: s }) {
|
|
46
|
+
let c = e.savingsVsCheapestCourier;
|
|
47
|
+
return /* @__PURE__ */ g(r, { children: [/* @__PURE__ */ h(a, { children: /* @__PURE__ */ g(o, {
|
|
48
48
|
className: "flex items-center gap-2",
|
|
49
49
|
children: [
|
|
50
50
|
/* @__PURE__ */ h(t, {
|
|
51
51
|
size: 18,
|
|
52
52
|
"aria-hidden": "true"
|
|
53
53
|
}),
|
|
54
|
-
|
|
55
|
-
/* @__PURE__ */ h(
|
|
56
|
-
status:
|
|
54
|
+
s("movethewheels.shipping.ownFleet.title", "Your own vehicle"),
|
|
55
|
+
/* @__PURE__ */ h(p, {
|
|
56
|
+
status: s("movethewheels.shipping.ownFleet.estimate", "Your estimate"),
|
|
57
57
|
customColors: v,
|
|
58
58
|
size: "sm",
|
|
59
59
|
showDot: !1
|
|
60
60
|
})
|
|
61
61
|
]
|
|
62
|
-
}) }), /* @__PURE__ */ g(
|
|
62
|
+
}) }), /* @__PURE__ */ g(i, {
|
|
63
63
|
className: "space-y-2",
|
|
64
64
|
children: [
|
|
65
65
|
/* @__PURE__ */ h("p", {
|
|
66
66
|
className: "text-2xl font-semibold",
|
|
67
|
-
children:
|
|
67
|
+
children: n(e.cost, e.currency)
|
|
68
68
|
}),
|
|
69
69
|
/* @__PURE__ */ g("p", {
|
|
70
70
|
className: "text-sm text-text-secondary",
|
|
71
71
|
children: [
|
|
72
72
|
e.distanceKm,
|
|
73
73
|
" km × ",
|
|
74
|
-
|
|
74
|
+
n(e.costPerKm, e.currency),
|
|
75
75
|
"/km",
|
|
76
|
-
e.fixedCost > 0 && ` + ${
|
|
76
|
+
e.fixedCost > 0 && ` + ${n(e.fixedCost, e.currency)}`
|
|
77
77
|
]
|
|
78
78
|
}),
|
|
79
|
-
|
|
79
|
+
c !== null && /* @__PURE__ */ h("p", {
|
|
80
80
|
className: `text-sm font-medium ${e.isCheaperThanCouriers ? "text-status-success-text" : "text-status-warning-text"}`,
|
|
81
|
-
children: e.isCheaperThanCouriers ? `${
|
|
81
|
+
children: e.isCheaperThanCouriers ? `${s("movethewheels.shipping.ownFleet.cheaper", "Your own vehicle is cheaper than the cheapest courier by")} ${n(c, e.currency)}` : c === 0 ? s("movethewheels.shipping.ownFleet.same", "Same cost as the cheapest courier") : `${s("movethewheels.shipping.ownFleet.dearer", "The cheapest courier is cheaper by")} ${n(-c, e.currency)}`
|
|
82
82
|
}),
|
|
83
83
|
/* @__PURE__ */ h("p", {
|
|
84
84
|
className: "text-xs text-text-secondary",
|
|
85
|
-
children:
|
|
85
|
+
children: s("movethewheels.shipping.ownFleet.note", "Based only on the distance and cost per km you entered — not a quote.")
|
|
86
86
|
})
|
|
87
87
|
]
|
|
88
88
|
})] });
|
|
89
89
|
}
|
|
90
|
-
function C({ result: t, t:
|
|
90
|
+
function C({ result: t, t: p }) {
|
|
91
91
|
let _ = t.providers.filter((e) => !e.ok);
|
|
92
92
|
return /* @__PURE__ */ g("div", {
|
|
93
93
|
className: "space-y-4",
|
|
@@ -103,29 +103,29 @@ function C({ result: t, t: f }) {
|
|
|
103
103
|
}, t.provider)),
|
|
104
104
|
t.ownFleet && /* @__PURE__ */ h(S, {
|
|
105
105
|
estimate: t.ownFleet,
|
|
106
|
-
t:
|
|
106
|
+
t: p
|
|
107
107
|
}),
|
|
108
|
-
/* @__PURE__ */ g(
|
|
109
|
-
|
|
108
|
+
/* @__PURE__ */ g(r, { children: [/* @__PURE__ */ g(a, { children: [/* @__PURE__ */ g(o, { children: [
|
|
109
|
+
p("movethewheels.shipping.results.title", "Courier options"),
|
|
110
110
|
" (",
|
|
111
111
|
t.quotes.length,
|
|
112
112
|
")"
|
|
113
113
|
] }), /* @__PURE__ */ g("p", {
|
|
114
114
|
className: "text-sm text-text-secondary",
|
|
115
115
|
children: [
|
|
116
|
-
|
|
116
|
+
p("movethewheels.shipping.results.chargeableWeight", "Charged on"),
|
|
117
117
|
" ",
|
|
118
118
|
t.chargeableWeightKg,
|
|
119
119
|
" kg"
|
|
120
120
|
]
|
|
121
|
-
})] }), /* @__PURE__ */ h(
|
|
121
|
+
})] }), /* @__PURE__ */ h(i, {
|
|
122
122
|
className: "p-0",
|
|
123
123
|
children: t.quotes.length === 0 ? /* @__PURE__ */ h("p", {
|
|
124
124
|
className: "px-6 pb-6 text-sm text-text-secondary",
|
|
125
|
-
children: _.length > 0 ?
|
|
125
|
+
children: _.length > 0 ? p("movethewheels.shipping.results.allFailed", "No rates could be fetched — see the message above.") : p("movethewheels.shipping.results.noServiceable", "No courier serves this pincode pair.")
|
|
126
126
|
}) : /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("ul", {
|
|
127
127
|
className: "divide-y md:hidden",
|
|
128
|
-
"aria-label":
|
|
128
|
+
"aria-label": p("movethewheels.shipping.results.title", "Courier options"),
|
|
129
129
|
children: t.quotes.map((e) => /* @__PURE__ */ g("li", {
|
|
130
130
|
className: "space-y-2 px-4 py-4",
|
|
131
131
|
children: [
|
|
@@ -136,21 +136,21 @@ function C({ result: t, t: f }) {
|
|
|
136
136
|
children: e.courierName
|
|
137
137
|
}), /* @__PURE__ */ h("span", {
|
|
138
138
|
className: "shrink-0 text-lg font-semibold",
|
|
139
|
-
children:
|
|
139
|
+
children: n(e.price, e.currency)
|
|
140
140
|
})]
|
|
141
141
|
}),
|
|
142
142
|
/* @__PURE__ */ h("div", {
|
|
143
143
|
className: "flex flex-wrap items-center gap-2",
|
|
144
144
|
children: /* @__PURE__ */ h(x, {
|
|
145
145
|
quote: e,
|
|
146
|
-
t:
|
|
146
|
+
t: p
|
|
147
147
|
})
|
|
148
148
|
}),
|
|
149
149
|
/* @__PURE__ */ h("p", {
|
|
150
150
|
className: "text-sm text-text-secondary",
|
|
151
151
|
children: [
|
|
152
|
-
b(e,
|
|
153
|
-
y(e,
|
|
152
|
+
b(e, p),
|
|
153
|
+
y(e, p),
|
|
154
154
|
e.rating === null ? null : `${e.rating.toFixed(1)} ★`
|
|
155
155
|
].filter((e) => e !== "—" && e !== null).join(" · ")
|
|
156
156
|
})
|
|
@@ -158,32 +158,32 @@ function C({ result: t, t: f }) {
|
|
|
158
158
|
}, `${e.provider}:${e.courierId}`))
|
|
159
159
|
}), /* @__PURE__ */ h("div", {
|
|
160
160
|
className: "hidden md:block",
|
|
161
|
-
children: /* @__PURE__ */ g(
|
|
162
|
-
/* @__PURE__ */ h(
|
|
163
|
-
/* @__PURE__ */ h(
|
|
164
|
-
/* @__PURE__ */ h(
|
|
165
|
-
/* @__PURE__ */ h(
|
|
166
|
-
/* @__PURE__ */ h(
|
|
161
|
+
children: /* @__PURE__ */ g(s, { children: [/* @__PURE__ */ h(d, { children: /* @__PURE__ */ g(f, { children: [
|
|
162
|
+
/* @__PURE__ */ h(u, { children: p("movethewheels.shipping.results.courier", "Courier") }),
|
|
163
|
+
/* @__PURE__ */ h(u, { children: p("movethewheels.shipping.results.mode", "Mode") }),
|
|
164
|
+
/* @__PURE__ */ h(u, { children: p("movethewheels.shipping.results.transit", "Estimated delivery") }),
|
|
165
|
+
/* @__PURE__ */ h(u, { children: p("movethewheels.shipping.results.rating", "Rating") }),
|
|
166
|
+
/* @__PURE__ */ h(u, {
|
|
167
167
|
className: "text-right",
|
|
168
|
-
children:
|
|
168
|
+
children: p("movethewheels.shipping.results.price", "Price")
|
|
169
169
|
})
|
|
170
|
-
] }) }), /* @__PURE__ */ h(
|
|
171
|
-
/* @__PURE__ */ h(
|
|
170
|
+
] }) }), /* @__PURE__ */ h(c, { children: t.quotes.map((e) => /* @__PURE__ */ g(f, { children: [
|
|
171
|
+
/* @__PURE__ */ h(l, { children: /* @__PURE__ */ g("div", {
|
|
172
172
|
className: "flex flex-wrap items-center gap-2",
|
|
173
173
|
children: [/* @__PURE__ */ h("span", {
|
|
174
174
|
className: "font-medium",
|
|
175
175
|
children: e.courierName
|
|
176
176
|
}), /* @__PURE__ */ h(x, {
|
|
177
177
|
quote: e,
|
|
178
|
-
t:
|
|
178
|
+
t: p
|
|
179
179
|
})]
|
|
180
180
|
}) }),
|
|
181
|
-
/* @__PURE__ */ h(
|
|
182
|
-
/* @__PURE__ */ h(
|
|
183
|
-
/* @__PURE__ */ h(
|
|
184
|
-
/* @__PURE__ */ h(
|
|
181
|
+
/* @__PURE__ */ h(l, { children: b(e, p) }),
|
|
182
|
+
/* @__PURE__ */ h(l, { children: y(e, p) }),
|
|
183
|
+
/* @__PURE__ */ h(l, { children: e.rating === null ? "—" : e.rating.toFixed(1) }),
|
|
184
|
+
/* @__PURE__ */ h(l, {
|
|
185
185
|
className: "text-right font-medium",
|
|
186
|
-
children:
|
|
186
|
+
children: n(e.price, e.currency)
|
|
187
187
|
})
|
|
188
188
|
] }, `${e.provider}:${e.courierId}`)) })] })
|
|
189
189
|
})] })
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { CircleCheck as e } from "../node_modules/lucide-react/dist/esm/icons/circle-check.js";
|
|
2
2
|
import { Clock as t } from "../node_modules/lucide-react/dist/esm/icons/clock.js";
|
|
3
3
|
import { Gauge as n } from "../node_modules/lucide-react/dist/esm/icons/gauge.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { formatDateTime as r } from "../utils/formatters.js";
|
|
5
|
+
import { formatSlip as i, predictedSlipMinutes as a, riskSignalLabel as o } from "../utils/trackingAlerts.js";
|
|
6
|
+
import { Badge as s, Button as c } from "./ui.js";
|
|
7
7
|
import { ShipmentRiskDialog as l } from "./ShipmentRiskDialog.js";
|
|
8
8
|
import { useState as u } from "react";
|
|
9
9
|
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
@@ -16,14 +16,14 @@ var m = {
|
|
|
16
16
|
};
|
|
17
17
|
function h({ alert: e, t }) {
|
|
18
18
|
let n = e.severity === "high" || e.severity === "critical", r = e.kind === "AT_RISK" ? t("movethewheels.alerts.kind.atRisk", "At risk") : t("movethewheels.alerts.kind.delayed", "Delayed");
|
|
19
|
-
return /* @__PURE__ */ p(
|
|
19
|
+
return /* @__PURE__ */ p(s, {
|
|
20
20
|
variant: n ? "destructive" : "secondary",
|
|
21
21
|
className: "shrink-0",
|
|
22
22
|
children: [r, e.kind === "AT_RISK" && typeof e.riskScore == "number" ? ` · ${e.riskScore}` : ""]
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
function g({ alert: e, t:
|
|
26
|
-
let
|
|
25
|
+
function g({ alert: e, t: o }) {
|
|
26
|
+
let s = a(e);
|
|
27
27
|
return !e.promisedDelivery && !e.predictedDelivery ? null : /* @__PURE__ */ p("dl", {
|
|
28
28
|
className: "mt-2 grid grid-cols-1 gap-x-4 gap-y-1 text-xs text-text-secondary sm:grid-cols-2",
|
|
29
29
|
children: [e.promisedDelivery && /* @__PURE__ */ p("div", {
|
|
@@ -33,10 +33,10 @@ function g({ alert: e, t: a }) {
|
|
|
33
33
|
size: 12,
|
|
34
34
|
"aria-hidden": "true"
|
|
35
35
|
}),
|
|
36
|
-
/* @__PURE__ */ p("dt", { children: [
|
|
36
|
+
/* @__PURE__ */ p("dt", { children: [o("movethewheels.alerts.promised", "Promised"), ":"] }),
|
|
37
37
|
/* @__PURE__ */ f("dd", {
|
|
38
38
|
className: "text-text-primary",
|
|
39
|
-
children:
|
|
39
|
+
children: r(e.promisedDelivery)
|
|
40
40
|
})
|
|
41
41
|
]
|
|
42
42
|
}), e.predictedDelivery && /* @__PURE__ */ p("div", {
|
|
@@ -46,14 +46,14 @@ function g({ alert: e, t: a }) {
|
|
|
46
46
|
size: 12,
|
|
47
47
|
"aria-hidden": "true"
|
|
48
48
|
}),
|
|
49
|
-
/* @__PURE__ */ p("dt", { children: [
|
|
49
|
+
/* @__PURE__ */ p("dt", { children: [o("movethewheels.alerts.predicted", "Predicted"), ":"] }),
|
|
50
50
|
/* @__PURE__ */ p("dd", {
|
|
51
51
|
className: "text-text-primary",
|
|
52
|
-
children: [
|
|
52
|
+
children: [r(e.predictedDelivery), s !== null && /* @__PURE__ */ p("span", {
|
|
53
53
|
className: "ml-1 text-status-error-text",
|
|
54
54
|
children: [
|
|
55
55
|
"(+",
|
|
56
|
-
|
|
56
|
+
i(s),
|
|
57
57
|
")"
|
|
58
58
|
]
|
|
59
59
|
})]
|
|
@@ -62,7 +62,7 @@ function g({ alert: e, t: a }) {
|
|
|
62
62
|
})]
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
|
-
function _({ alerts: t, limit: n, t: r, onAcknowledge: i, onOpenOrder:
|
|
65
|
+
function _({ alerts: t, limit: n, t: r, onAcknowledge: i, onOpenOrder: a, onChanged: s }) {
|
|
66
66
|
let [_, v] = u(null), [y, b] = u(null), [x, S] = u(null), C = async (e) => {
|
|
67
67
|
v(e), b(null);
|
|
68
68
|
try {
|
|
@@ -106,17 +106,17 @@ function _({ alerts: t, limit: n, t: r, onAcknowledge: i, onOpenOrder: o, onChan
|
|
|
106
106
|
"aria-label": r("movethewheels.alerts.signals", "Risk signals"),
|
|
107
107
|
children: t.signals.map((e) => /* @__PURE__ */ f("li", {
|
|
108
108
|
className: "rounded-full border border-border-primary bg-surface-primary px-2 py-0.5 text-xs text-text-secondary",
|
|
109
|
-
children:
|
|
109
|
+
children: o(e, r)
|
|
110
110
|
}, e))
|
|
111
111
|
}),
|
|
112
112
|
/* @__PURE__ */ p("div", {
|
|
113
113
|
className: "mt-3 flex flex-wrap gap-2",
|
|
114
|
-
children: [t.shipmentId && /* @__PURE__ */ f(
|
|
114
|
+
children: [t.shipmentId && /* @__PURE__ */ f(c, {
|
|
115
115
|
size: "sm",
|
|
116
116
|
variant: "outline",
|
|
117
117
|
onClick: () => S(t),
|
|
118
118
|
children: r("movethewheels.alerts.viewRisk", "View risk")
|
|
119
|
-
}), t.shipmentId && t.kind && /* @__PURE__ */ p(
|
|
119
|
+
}), t.shipmentId && t.kind && /* @__PURE__ */ p(c, {
|
|
120
120
|
size: "sm",
|
|
121
121
|
variant: "ghost",
|
|
122
122
|
disabled: _ === t.id,
|
|
@@ -139,9 +139,9 @@ function _({ alerts: t, limit: n, t: r, onAcknowledge: i, onOpenOrder: o, onChan
|
|
|
139
139
|
},
|
|
140
140
|
t: r,
|
|
141
141
|
onOpenOrder: (e) => {
|
|
142
|
-
S(null),
|
|
142
|
+
S(null), a(e);
|
|
143
143
|
},
|
|
144
|
-
onChanged:
|
|
144
|
+
onChanged: s
|
|
145
145
|
})
|
|
146
146
|
] });
|
|
147
147
|
}
|