@burdenoff/microfe-movethewheels 2026.1108.2 → 2026.1108.3
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/components/DocumentsCard.js +183 -55
- package/dist/generated/wspace-types.d.ts +1479 -10
- package/dist/hooks/useDocumentExtractions.js +100 -0
- package/dist/movethewheels/hooks/useDocumentExtractions.d.ts +49 -0
- package/dist/movethewheels/hooks/useEntityDocuments.d.ts +5 -5
- package/dist/node_modules/lucide-react/dist/esm/icons/file-search.js +24 -0
- package/dist/pages/MultiModalShipmentPage.js +125 -121
- package/dist/pages/RouteDetailsPage.js +212 -207
- package/package.json +1 -1
- package/src/generated/wspace-types.ts +1672 -10
- package/src/movethewheels/components/DocumentsCard.tsx +174 -29
- package/src/movethewheels/hooks/useDocumentExtractions.ts +246 -0
- package/src/movethewheels/hooks/useEntityDocuments.ts +5 -5
- package/src/movethewheels/pages/MultiModalShipmentPage.tsx +2 -0
- package/src/movethewheels/pages/RouteDetailsPage.tsx +2 -0
|
@@ -7,33 +7,34 @@ import { Ship as a } from "../node_modules/lucide-react/dist/esm/icons/ship.js";
|
|
|
7
7
|
import { TrainFront as o } from "../node_modules/lucide-react/dist/esm/icons/train-front.js";
|
|
8
8
|
import { Trash2 as ee } from "../node_modules/lucide-react/dist/esm/icons/trash-2.js";
|
|
9
9
|
import { Truck as s } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
|
|
10
|
-
import { Badge as c, Button as l, Card as u, CardContent as d, CardHeader as f, CardTitle as p, Input as m, Label as h, Select as g, SelectContent as _, SelectItem as v, SelectTrigger as y, SelectValue as b, Separator as
|
|
11
|
-
import { EmptyState as
|
|
10
|
+
import { Badge as c, Button as l, Card as u, CardContent as d, CardHeader as f, CardTitle as p, Input as m, Label as h, Select as g, SelectContent as _, SelectItem as v, SelectTrigger as y, SelectValue as b, Separator as x } from "../components/ui.js";
|
|
11
|
+
import { EmptyState as te, LoadingState as ne, PageLayout as re, PageSection as S } from "../components/PageLayout.js";
|
|
12
12
|
import { FormError as C } from "../components/FormError.js";
|
|
13
|
-
import {
|
|
13
|
+
import { DocumentsCard as ie } from "../components/DocumentsCard.js";
|
|
14
|
+
import { useMultiModalShipments as ae } from "../hooks/useMultiModalShipments.js";
|
|
14
15
|
import { useState as w } from "react";
|
|
15
|
-
import { Fragment as
|
|
16
|
-
import { EmphasisPanel as
|
|
16
|
+
import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
17
|
+
import { EmphasisPanel as O, PagePurpose as oe } from "@burdenoff/fe-libs/ui";
|
|
17
18
|
//#region src/movethewheels/pages/MultiModalShipmentPage.tsx
|
|
18
|
-
var
|
|
19
|
+
var k = {
|
|
19
20
|
ROAD: s,
|
|
20
21
|
AIR: r,
|
|
21
22
|
OCEAN: a,
|
|
22
23
|
RAIL: o
|
|
23
|
-
},
|
|
24
|
+
}, A = {
|
|
24
25
|
ROAD: "Road",
|
|
25
26
|
AIR: "Air",
|
|
26
27
|
OCEAN: "Ocean",
|
|
27
28
|
RAIL: "Rail"
|
|
28
29
|
};
|
|
29
|
-
function
|
|
30
|
+
function j(e = "ROAD") {
|
|
30
31
|
return {
|
|
31
32
|
mode: e,
|
|
32
33
|
origin: {},
|
|
33
34
|
destination: {}
|
|
34
35
|
};
|
|
35
36
|
}
|
|
36
|
-
function
|
|
37
|
+
function M(e, t) {
|
|
37
38
|
if (e == null) return "—";
|
|
38
39
|
try {
|
|
39
40
|
return new Intl.NumberFormat("en-US", {
|
|
@@ -44,12 +45,12 @@ function j(e, t) {
|
|
|
44
45
|
return `${e.toFixed(2)} ${t ?? "USD"}`;
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
|
-
function
|
|
48
|
-
let [r, o] = w(0), [s,
|
|
48
|
+
function N() {
|
|
49
|
+
let [r, o] = w(0), [s, N] = w(""), [P, se] = w(""), { shipments: F, totalShipments: I, hasMore: ce, isLoading: L, error: R, calculateFreightRate: le, planMultiModalShipment: ue } = ae({
|
|
49
50
|
limit: 10,
|
|
50
51
|
offset: r * 10,
|
|
51
|
-
search:
|
|
52
|
-
}), [z, B] = w(""), [V, H] = w(""), [U, W] = w([
|
|
52
|
+
search: P
|
|
53
|
+
}), [z, B] = w(""), [V, H] = w(""), [U, W] = w([j()]), [G, K] = w({}), [de, q] = w({}), [J, Y] = w(!1), [fe, X] = w(null), [Z, Q] = w(null), $ = (e, t) => {
|
|
53
54
|
W((n) => n.map((n, r) => r === e ? {
|
|
54
55
|
...n,
|
|
55
56
|
...t
|
|
@@ -57,12 +58,12 @@ function M() {
|
|
|
57
58
|
...t,
|
|
58
59
|
[e]: null
|
|
59
60
|
}));
|
|
60
|
-
},
|
|
61
|
+
}, pe = () => W((e) => [...e, j()]), me = (e) => {
|
|
61
62
|
W((t) => t.filter((t, n) => n !== e)), K((t) => {
|
|
62
63
|
let n = { ...t };
|
|
63
64
|
return delete n[e], n;
|
|
64
65
|
});
|
|
65
|
-
},
|
|
66
|
+
}, he = async (e) => {
|
|
66
67
|
let t = U[e];
|
|
67
68
|
if (t) {
|
|
68
69
|
q((t) => ({
|
|
@@ -70,7 +71,7 @@ function M() {
|
|
|
70
71
|
[e]: null
|
|
71
72
|
}));
|
|
72
73
|
try {
|
|
73
|
-
let n = await
|
|
74
|
+
let n = await le(t);
|
|
74
75
|
K((t) => ({
|
|
75
76
|
...t,
|
|
76
77
|
[e]: n
|
|
@@ -82,22 +83,22 @@ function M() {
|
|
|
82
83
|
}));
|
|
83
84
|
}
|
|
84
85
|
}
|
|
85
|
-
},
|
|
86
|
-
return /* @__PURE__ */
|
|
86
|
+
}, ge = Object.values(G).reduce((e, t) => e + (t?.calculatedCost ?? 0), 0), _e = new Set(U.map((e) => e.mode));
|
|
87
|
+
return /* @__PURE__ */ D(re, {
|
|
87
88
|
hero: !0,
|
|
88
89
|
titleAccent: "Multi-Modal Freight",
|
|
89
90
|
title: "Multi-Modal Freight",
|
|
90
91
|
subtitle: "Plan a shipment across road, air, ocean and rail legs with real per-mode rate calculation",
|
|
91
|
-
icon: /* @__PURE__ */
|
|
92
|
+
icon: /* @__PURE__ */ E(a, { size: 24 }),
|
|
92
93
|
children: [
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
-
icon: /* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ E(oe, {
|
|
95
|
+
icon: /* @__PURE__ */ E(a, { size: 18 }),
|
|
95
96
|
children: "Compose a single shipment from multiple real transport legs — each leg picks its own mode (road/air/ocean/rail) and gets priced with that mode's real pricing driver (air: chargeable weight; ocean: revenue-ton or per-container; rail: tonne-km; road: distance + weight). Calculate a leg's rate before booking, then plan the full multi-leg shipment in one step."
|
|
96
97
|
}),
|
|
97
|
-
/* @__PURE__ */
|
|
98
|
-
/* @__PURE__ */
|
|
98
|
+
/* @__PURE__ */ E(O, { children: "Live carrier booking/API integration is out of scope for this core (it needs named-carrier partnership agreements) — this plans the shipment and its legs with real calculated costs that your ops team can then execute against your chosen carriers." }),
|
|
99
|
+
/* @__PURE__ */ E(S, {
|
|
99
100
|
title: "Plan a New Multi-Modal Shipment",
|
|
100
|
-
children: /* @__PURE__ */
|
|
101
|
+
children: /* @__PURE__ */ E(u, { children: /* @__PURE__ */ E(d, { children: /* @__PURE__ */ D("form", {
|
|
101
102
|
onSubmit: async (e) => {
|
|
102
103
|
if (e.preventDefault(), X(null), Q(null), !s.trim()) {
|
|
103
104
|
X("Shipment number is required.");
|
|
@@ -109,13 +110,13 @@ function M() {
|
|
|
109
110
|
}
|
|
110
111
|
Y(!0);
|
|
111
112
|
try {
|
|
112
|
-
let e = await
|
|
113
|
+
let e = await ue({
|
|
113
114
|
shipmentNumber: s.trim(),
|
|
114
115
|
origin: { address: z },
|
|
115
116
|
destination: { address: V },
|
|
116
117
|
legs: U
|
|
117
118
|
});
|
|
118
|
-
Q(`Shipment ${e.shipmentNumber} planned with ${e.legs.length} leg(s).`),
|
|
119
|
+
Q(`Shipment ${e.shipmentNumber} planned with ${e.legs.length} leg(s).`), N(""), B(""), H(""), W([j()]), K({}), o(0);
|
|
119
120
|
} catch (e) {
|
|
120
121
|
X(e instanceof Error ? e.message : "Failed to plan shipment");
|
|
121
122
|
} finally {
|
|
@@ -124,37 +125,37 @@ function M() {
|
|
|
124
125
|
},
|
|
125
126
|
className: "space-y-6 pt-4",
|
|
126
127
|
children: [
|
|
127
|
-
/* @__PURE__ */
|
|
128
|
-
Z && /* @__PURE__ */
|
|
128
|
+
/* @__PURE__ */ E(C, { message: fe }),
|
|
129
|
+
Z && /* @__PURE__ */ E("div", {
|
|
129
130
|
className: "rounded-lg border border-status-success-border bg-status-success-bg-subtle px-4 py-3 text-sm text-status-success-text",
|
|
130
131
|
children: Z
|
|
131
132
|
}),
|
|
132
|
-
/* @__PURE__ */
|
|
133
|
+
/* @__PURE__ */ D("div", {
|
|
133
134
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
|
|
134
135
|
children: [
|
|
135
|
-
/* @__PURE__ */
|
|
136
|
+
/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E(h, {
|
|
136
137
|
htmlFor: "shipmentNumber",
|
|
137
138
|
children: "Shipment Number"
|
|
138
|
-
}), /* @__PURE__ */
|
|
139
|
+
}), /* @__PURE__ */ E(m, {
|
|
139
140
|
id: "shipmentNumber",
|
|
140
141
|
value: s,
|
|
141
|
-
onChange: (e) =>
|
|
142
|
+
onChange: (e) => N(e.target.value),
|
|
142
143
|
placeholder: "SHP-MM-0001",
|
|
143
144
|
required: !0
|
|
144
145
|
})] }),
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
+
/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E(h, {
|
|
146
147
|
htmlFor: "originAddress",
|
|
147
148
|
children: "Origin"
|
|
148
|
-
}), /* @__PURE__ */
|
|
149
|
+
}), /* @__PURE__ */ E(m, {
|
|
149
150
|
id: "originAddress",
|
|
150
151
|
value: z,
|
|
151
152
|
onChange: (e) => B(e.target.value),
|
|
152
153
|
placeholder: "Shanghai, CN"
|
|
153
154
|
})] }),
|
|
154
|
-
/* @__PURE__ */
|
|
155
|
+
/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E(h, {
|
|
155
156
|
htmlFor: "destinationAddress",
|
|
156
157
|
children: "Destination"
|
|
157
|
-
}), /* @__PURE__ */
|
|
158
|
+
}), /* @__PURE__ */ E(m, {
|
|
158
159
|
id: "destinationAddress",
|
|
159
160
|
value: V,
|
|
160
161
|
onChange: (e) => H(e.target.value),
|
|
@@ -162,97 +163,97 @@ function M() {
|
|
|
162
163
|
})] })
|
|
163
164
|
]
|
|
164
165
|
}),
|
|
165
|
-
/* @__PURE__ */
|
|
166
|
-
/* @__PURE__ */
|
|
166
|
+
/* @__PURE__ */ E(x, {}),
|
|
167
|
+
/* @__PURE__ */ E("div", {
|
|
167
168
|
className: "space-y-4",
|
|
168
169
|
children: U.map((t, n) => {
|
|
169
|
-
let r =
|
|
170
|
-
return /* @__PURE__ */
|
|
170
|
+
let r = k[t.mode], i = G[n], a = de[n];
|
|
171
|
+
return /* @__PURE__ */ D(u, {
|
|
171
172
|
className: "border-border-subtle",
|
|
172
|
-
children: [/* @__PURE__ */
|
|
173
|
+
children: [/* @__PURE__ */ D(f, {
|
|
173
174
|
className: "flex flex-row items-center justify-between",
|
|
174
|
-
children: [/* @__PURE__ */
|
|
175
|
+
children: [/* @__PURE__ */ D(p, {
|
|
175
176
|
className: "flex items-center gap-2 text-base",
|
|
176
177
|
children: [
|
|
177
|
-
/* @__PURE__ */
|
|
178
|
+
/* @__PURE__ */ E(r, { size: 16 }),
|
|
178
179
|
" Leg ",
|
|
179
180
|
n + 1
|
|
180
181
|
]
|
|
181
|
-
}), U.length > 1 && /* @__PURE__ */
|
|
182
|
+
}), U.length > 1 && /* @__PURE__ */ E(l, {
|
|
182
183
|
type: "button",
|
|
183
184
|
variant: "ghost",
|
|
184
185
|
size: "sm",
|
|
185
|
-
onClick: () =>
|
|
186
|
+
onClick: () => me(n),
|
|
186
187
|
"aria-label": `Remove leg ${n + 1}`,
|
|
187
|
-
children: /* @__PURE__ */
|
|
188
|
+
children: /* @__PURE__ */ E(ee, { size: 14 })
|
|
188
189
|
})]
|
|
189
|
-
}), /* @__PURE__ */
|
|
190
|
+
}), /* @__PURE__ */ D(d, {
|
|
190
191
|
className: "space-y-4",
|
|
191
192
|
children: [
|
|
192
|
-
/* @__PURE__ */
|
|
193
|
+
/* @__PURE__ */ D("div", {
|
|
193
194
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
|
|
194
195
|
children: [
|
|
195
|
-
/* @__PURE__ */
|
|
196
|
+
/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E(h, { children: "Mode" }), /* @__PURE__ */ D(g, {
|
|
196
197
|
value: t.mode,
|
|
197
198
|
onValueChange: (e) => $(n, { mode: e }),
|
|
198
|
-
children: [/* @__PURE__ */
|
|
199
|
+
children: [/* @__PURE__ */ E(y, { children: /* @__PURE__ */ E(b, {}) }), /* @__PURE__ */ E(_, { children: [
|
|
199
200
|
"ROAD",
|
|
200
201
|
"AIR",
|
|
201
202
|
"OCEAN",
|
|
202
203
|
"RAIL"
|
|
203
|
-
].map((e) => /* @__PURE__ */
|
|
204
|
+
].map((e) => /* @__PURE__ */ E(v, {
|
|
204
205
|
value: e,
|
|
205
|
-
children:
|
|
206
|
+
children: A[e]
|
|
206
207
|
}, e)) })]
|
|
207
208
|
})] }),
|
|
208
|
-
/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E(h, { children: "Leg Origin" }), /* @__PURE__ */ E(m, {
|
|
209
210
|
value: t.origin.address ?? "",
|
|
210
211
|
onChange: (e) => $(n, { origin: { address: e.target.value } }),
|
|
211
212
|
placeholder: "Origin port/airport/terminal"
|
|
212
213
|
})] }),
|
|
213
|
-
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E(h, { children: "Leg Destination" }), /* @__PURE__ */ E(m, {
|
|
214
215
|
value: t.destination.address ?? "",
|
|
215
216
|
onChange: (e) => $(n, { destination: { address: e.target.value } }),
|
|
216
217
|
placeholder: "Destination port/airport/terminal"
|
|
217
218
|
})] })
|
|
218
219
|
]
|
|
219
220
|
}),
|
|
220
|
-
(t.mode === "ROAD" || t.mode === "RAIL") && /* @__PURE__ */
|
|
221
|
+
(t.mode === "ROAD" || t.mode === "RAIL") && /* @__PURE__ */ D("div", {
|
|
221
222
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
222
|
-
children: [/* @__PURE__ */
|
|
223
|
+
children: [/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E(h, { children: "Distance (km)" }), /* @__PURE__ */ E(m, {
|
|
223
224
|
type: "number",
|
|
224
225
|
min: 0,
|
|
225
226
|
value: t.distanceKm ?? "",
|
|
226
227
|
onChange: (e) => $(n, { distanceKm: Number(e.target.value) || void 0 })
|
|
227
|
-
})] }), /* @__PURE__ */
|
|
228
|
+
})] }), /* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E(h, { children: "Weight (kg)" }), /* @__PURE__ */ E(m, {
|
|
228
229
|
type: "number",
|
|
229
230
|
min: 0,
|
|
230
231
|
value: t.weightKg ?? "",
|
|
231
232
|
onChange: (e) => $(n, { weightKg: Number(e.target.value) || void 0 })
|
|
232
233
|
})] })]
|
|
233
234
|
}),
|
|
234
|
-
t.mode === "AIR" && /* @__PURE__ */
|
|
235
|
+
t.mode === "AIR" && /* @__PURE__ */ D("div", {
|
|
235
236
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-4",
|
|
236
237
|
children: [
|
|
237
|
-
/* @__PURE__ */
|
|
238
|
+
/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E(h, { children: "Weight (kg)" }), /* @__PURE__ */ E(m, {
|
|
238
239
|
type: "number",
|
|
239
240
|
min: 0,
|
|
240
241
|
value: t.weightKg ?? "",
|
|
241
242
|
onChange: (e) => $(n, { weightKg: Number(e.target.value) || void 0 })
|
|
242
243
|
})] }),
|
|
243
|
-
/* @__PURE__ */
|
|
244
|
+
/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E(h, { children: "Length (cm)" }), /* @__PURE__ */ E(m, {
|
|
244
245
|
type: "number",
|
|
245
246
|
min: 0,
|
|
246
247
|
value: t.lengthCm ?? "",
|
|
247
248
|
onChange: (e) => $(n, { lengthCm: Number(e.target.value) || void 0 })
|
|
248
249
|
})] }),
|
|
249
|
-
/* @__PURE__ */
|
|
250
|
+
/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E(h, { children: "Width (cm)" }), /* @__PURE__ */ E(m, {
|
|
250
251
|
type: "number",
|
|
251
252
|
min: 0,
|
|
252
253
|
value: t.widthCm ?? "",
|
|
253
254
|
onChange: (e) => $(n, { widthCm: Number(e.target.value) || void 0 })
|
|
254
255
|
})] }),
|
|
255
|
-
/* @__PURE__ */
|
|
256
|
+
/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E(h, { children: "Height (cm)" }), /* @__PURE__ */ E(m, {
|
|
256
257
|
type: "number",
|
|
257
258
|
min: 0,
|
|
258
259
|
value: t.heightCm ?? "",
|
|
@@ -260,62 +261,62 @@ function M() {
|
|
|
260
261
|
})] })
|
|
261
262
|
]
|
|
262
263
|
}),
|
|
263
|
-
t.mode === "OCEAN" && /* @__PURE__ */
|
|
264
|
+
t.mode === "OCEAN" && /* @__PURE__ */ D("div", {
|
|
264
265
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-4",
|
|
265
|
-
children: [/* @__PURE__ */
|
|
266
|
+
children: [/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E(h, { children: "Container Type" }), /* @__PURE__ */ D(g, {
|
|
266
267
|
value: t.containerType ?? "LCL",
|
|
267
268
|
onValueChange: (e) => $(n, { containerType: e }),
|
|
268
|
-
children: [/* @__PURE__ */
|
|
269
|
-
/* @__PURE__ */
|
|
269
|
+
children: [/* @__PURE__ */ E(y, { children: /* @__PURE__ */ E(b, {}) }), /* @__PURE__ */ D(_, { children: [
|
|
270
|
+
/* @__PURE__ */ E(v, {
|
|
270
271
|
value: "LCL",
|
|
271
272
|
children: "LCL (shared container)"
|
|
272
273
|
}),
|
|
273
|
-
/* @__PURE__ */
|
|
274
|
+
/* @__PURE__ */ E(v, {
|
|
274
275
|
value: "FCL_20FT",
|
|
275
276
|
children: "FCL 20ft"
|
|
276
277
|
}),
|
|
277
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ E(v, {
|
|
278
279
|
value: "FCL_40FT",
|
|
279
280
|
children: "FCL 40ft"
|
|
280
281
|
}),
|
|
281
|
-
/* @__PURE__ */
|
|
282
|
+
/* @__PURE__ */ E(v, {
|
|
282
283
|
value: "FCL_40FT_HC",
|
|
283
284
|
children: "FCL 40ft High-Cube"
|
|
284
285
|
})
|
|
285
286
|
] })]
|
|
286
|
-
})] }), (t.containerType ?? "LCL") === "LCL" ? /* @__PURE__ */
|
|
287
|
+
})] }), (t.containerType ?? "LCL") === "LCL" ? /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E(h, { children: "Weight (kg)" }), /* @__PURE__ */ E(m, {
|
|
287
288
|
type: "number",
|
|
288
289
|
min: 0,
|
|
289
290
|
value: t.weightKg ?? "",
|
|
290
291
|
onChange: (e) => $(n, { weightKg: Number(e.target.value) || void 0 })
|
|
291
|
-
})] }), /* @__PURE__ */
|
|
292
|
+
})] }), /* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E(h, { children: "Volume (CBM)" }), /* @__PURE__ */ E(m, {
|
|
292
293
|
type: "number",
|
|
293
294
|
min: 0,
|
|
294
295
|
value: t.volumeCbm ?? "",
|
|
295
296
|
onChange: (e) => $(n, { volumeCbm: Number(e.target.value) || void 0 })
|
|
296
|
-
})] })] }) : /* @__PURE__ */
|
|
297
|
+
})] })] }) : /* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E(h, { children: "Container Count" }), /* @__PURE__ */ E(m, {
|
|
297
298
|
type: "number",
|
|
298
299
|
min: 1,
|
|
299
300
|
value: t.containerCount ?? 1,
|
|
300
301
|
onChange: (e) => $(n, { containerCount: Number(e.target.value) || 1 })
|
|
301
302
|
})] })]
|
|
302
303
|
}),
|
|
303
|
-
/* @__PURE__ */
|
|
304
|
+
/* @__PURE__ */ D("div", {
|
|
304
305
|
className: "flex items-center gap-3",
|
|
305
306
|
children: [
|
|
306
|
-
/* @__PURE__ */
|
|
307
|
+
/* @__PURE__ */ D(l, {
|
|
307
308
|
type: "button",
|
|
308
309
|
variant: "secondary",
|
|
309
310
|
size: "sm",
|
|
310
|
-
onClick: () => void
|
|
311
|
-
children: [/* @__PURE__ */
|
|
311
|
+
onClick: () => void he(n),
|
|
312
|
+
children: [/* @__PURE__ */ E(e, {
|
|
312
313
|
size: 14,
|
|
313
314
|
className: "mr-1.5"
|
|
314
315
|
}), " Calculate Rate"]
|
|
315
316
|
}),
|
|
316
|
-
i && /* @__PURE__ */
|
|
317
|
+
i && /* @__PURE__ */ D("span", {
|
|
317
318
|
className: "text-sm font-medium text-text-primary",
|
|
318
|
-
children: [
|
|
319
|
+
children: [M(i.calculatedCost, i.currency), i.chargeableWeightKg != null && /* @__PURE__ */ D("span", {
|
|
319
320
|
className: "ml-2 text-xs text-text-secondary",
|
|
320
321
|
children: [
|
|
321
322
|
"(",
|
|
@@ -324,17 +325,17 @@ function M() {
|
|
|
324
325
|
]
|
|
325
326
|
})]
|
|
326
327
|
}),
|
|
327
|
-
a && /* @__PURE__ */
|
|
328
|
+
a && /* @__PURE__ */ E("span", {
|
|
328
329
|
className: "text-sm text-status-error-text",
|
|
329
330
|
children: a
|
|
330
331
|
})
|
|
331
332
|
]
|
|
332
333
|
}),
|
|
333
|
-
i && i.breakdown.length > 0 && /* @__PURE__ */
|
|
334
|
+
i && i.breakdown.length > 0 && /* @__PURE__ */ E("ul", {
|
|
334
335
|
className: "space-y-1 rounded-md bg-surface-subtle px-3 py-2 text-xs text-text-secondary",
|
|
335
|
-
children: i.breakdown.map((e) => /* @__PURE__ */
|
|
336
|
+
children: i.breakdown.map((e) => /* @__PURE__ */ D("li", {
|
|
336
337
|
className: "flex justify-between",
|
|
337
|
-
children: [/* @__PURE__ */
|
|
338
|
+
children: [/* @__PURE__ */ E("span", { children: e.label }), /* @__PURE__ */ E("span", { children: M(e.amount, i.currency) })]
|
|
338
339
|
}, e.label))
|
|
339
340
|
})
|
|
340
341
|
]
|
|
@@ -342,33 +343,33 @@ function M() {
|
|
|
342
343
|
}, n);
|
|
343
344
|
})
|
|
344
345
|
}),
|
|
345
|
-
/* @__PURE__ */
|
|
346
|
+
/* @__PURE__ */ D("div", {
|
|
346
347
|
className: "flex items-center justify-between",
|
|
347
|
-
children: [/* @__PURE__ */
|
|
348
|
+
children: [/* @__PURE__ */ D(l, {
|
|
348
349
|
type: "button",
|
|
349
350
|
variant: "outline",
|
|
350
351
|
size: "sm",
|
|
351
|
-
onClick:
|
|
352
|
-
children: [/* @__PURE__ */
|
|
352
|
+
onClick: pe,
|
|
353
|
+
children: [/* @__PURE__ */ E(i, {
|
|
353
354
|
size: 14,
|
|
354
355
|
className: "mr-1.5"
|
|
355
356
|
}), " Add Leg"]
|
|
356
|
-
}), /* @__PURE__ */
|
|
357
|
+
}), /* @__PURE__ */ D("div", {
|
|
357
358
|
className: "flex items-center gap-3",
|
|
358
|
-
children: [
|
|
359
|
+
children: [_e.size > 1 && /* @__PURE__ */ E(c, {
|
|
359
360
|
variant: "secondary",
|
|
360
361
|
children: "Multi-modal"
|
|
361
|
-
}), /* @__PURE__ */
|
|
362
|
+
}), /* @__PURE__ */ D("span", {
|
|
362
363
|
className: "text-sm text-text-secondary",
|
|
363
364
|
children: [
|
|
364
365
|
"Estimated total:",
|
|
365
366
|
" ",
|
|
366
|
-
/* @__PURE__ */
|
|
367
|
+
/* @__PURE__ */ E("strong", { children: M(ge, G[0]?.currency ?? "USD") })
|
|
367
368
|
]
|
|
368
369
|
})]
|
|
369
370
|
})]
|
|
370
371
|
}),
|
|
371
|
-
/* @__PURE__ */
|
|
372
|
+
/* @__PURE__ */ E(l, {
|
|
372
373
|
type: "submit",
|
|
373
374
|
disabled: J,
|
|
374
375
|
children: J ? "Planning shipment..." : "Plan Shipment"
|
|
@@ -376,62 +377,65 @@ function M() {
|
|
|
376
377
|
]
|
|
377
378
|
}) }) })
|
|
378
379
|
}),
|
|
379
|
-
/* @__PURE__ */
|
|
380
|
+
/* @__PURE__ */ D(S, {
|
|
380
381
|
title: "Planned Multi-Modal Shipments",
|
|
381
|
-
children: [/* @__PURE__ */
|
|
382
|
+
children: [/* @__PURE__ */ D("div", {
|
|
382
383
|
className: "mb-4 max-w-xl space-y-2",
|
|
383
|
-
children: [/* @__PURE__ */
|
|
384
|
+
children: [/* @__PURE__ */ E(h, {
|
|
384
385
|
htmlFor: "planned-shipment-search",
|
|
385
386
|
children: "Search planned shipments"
|
|
386
|
-
}), /* @__PURE__ */
|
|
387
|
+
}), /* @__PURE__ */ E(m, {
|
|
387
388
|
id: "planned-shipment-search",
|
|
388
|
-
value:
|
|
389
|
+
value: P,
|
|
389
390
|
onChange: (e) => {
|
|
390
|
-
|
|
391
|
+
se(e.target.value), o(0);
|
|
391
392
|
},
|
|
392
393
|
placeholder: "Search by shipment or tracking number"
|
|
393
394
|
})]
|
|
394
|
-
}), L ? /* @__PURE__ */
|
|
395
|
-
icon: /* @__PURE__ */
|
|
395
|
+
}), L ? /* @__PURE__ */ E(ne, { message: "Loading multi-modal shipments..." }) : R ? /* @__PURE__ */ E(C, { message: R.message }) : F.length === 0 ? /* @__PURE__ */ E(te, {
|
|
396
|
+
icon: /* @__PURE__ */ E(a, { size: 32 }),
|
|
396
397
|
title: "No multi-modal shipments yet",
|
|
397
398
|
description: "Plan a shipment above to see it here once it spans more than one transport mode."
|
|
398
|
-
}) : /* @__PURE__ */
|
|
399
|
+
}) : /* @__PURE__ */ D("div", {
|
|
399
400
|
className: "space-y-4",
|
|
400
|
-
children: [F.map((e) => /* @__PURE__ */
|
|
401
|
+
children: [F.map((e) => /* @__PURE__ */ D(u, { children: [/* @__PURE__ */ D(f, {
|
|
401
402
|
className: "flex flex-row items-center justify-between",
|
|
402
|
-
children: [/* @__PURE__ */
|
|
403
|
+
children: [/* @__PURE__ */ E(p, {
|
|
403
404
|
className: "text-base",
|
|
404
405
|
children: e.shipmentNumber
|
|
405
|
-
}), /* @__PURE__ */
|
|
406
|
+
}), /* @__PURE__ */ D("div", {
|
|
406
407
|
className: "flex items-center gap-2",
|
|
407
|
-
children: [/* @__PURE__ */
|
|
408
|
+
children: [/* @__PURE__ */ E(c, {
|
|
408
409
|
variant: "outline",
|
|
409
410
|
children: e.status
|
|
410
|
-
}), /* @__PURE__ */
|
|
411
|
+
}), /* @__PURE__ */ E("span", {
|
|
411
412
|
className: "text-sm font-medium",
|
|
412
|
-
children:
|
|
413
|
+
children: M(e.totalFreightCost, e.freightCurrency)
|
|
413
414
|
})]
|
|
414
415
|
})]
|
|
415
|
-
}), /* @__PURE__ */
|
|
416
|
+
}), /* @__PURE__ */ D(d, { children: [/* @__PURE__ */ E("div", {
|
|
416
417
|
className: "flex flex-wrap gap-2",
|
|
417
418
|
children: e.legs.map((e) => {
|
|
418
|
-
let t =
|
|
419
|
-
return /* @__PURE__ */
|
|
419
|
+
let t = k[e.mode];
|
|
420
|
+
return /* @__PURE__ */ D(c, {
|
|
420
421
|
variant: "secondary",
|
|
421
422
|
className: "flex items-center gap-1",
|
|
422
423
|
children: [
|
|
423
|
-
/* @__PURE__ */
|
|
424
|
+
/* @__PURE__ */ E(t, { size: 12 }),
|
|
424
425
|
" ",
|
|
425
|
-
|
|
426
|
+
A[e.mode],
|
|
426
427
|
":",
|
|
427
428
|
" ",
|
|
428
|
-
|
|
429
|
+
M(e.calculatedCost, e.currency)
|
|
429
430
|
]
|
|
430
431
|
}, e.id);
|
|
431
432
|
})
|
|
432
|
-
})
|
|
433
|
+
}), /* @__PURE__ */ E(ie, {
|
|
434
|
+
entityType: "shipment",
|
|
435
|
+
entityId: e.id
|
|
436
|
+
})] })] }, e.id)), I > 10 && /* @__PURE__ */ D("div", {
|
|
433
437
|
className: "flex items-center justify-between border-t border-border-seam pt-4",
|
|
434
|
-
children: [/* @__PURE__ */
|
|
438
|
+
children: [/* @__PURE__ */ D("span", {
|
|
435
439
|
className: "text-sm text-text-secondary",
|
|
436
440
|
children: [
|
|
437
441
|
"Showing ",
|
|
@@ -441,20 +445,20 @@ function M() {
|
|
|
441
445
|
" of ",
|
|
442
446
|
I
|
|
443
447
|
]
|
|
444
|
-
}), /* @__PURE__ */
|
|
448
|
+
}), /* @__PURE__ */ D("div", {
|
|
445
449
|
className: "flex gap-2",
|
|
446
|
-
children: [/* @__PURE__ */
|
|
450
|
+
children: [/* @__PURE__ */ D(l, {
|
|
447
451
|
variant: "outline",
|
|
448
452
|
size: "sm",
|
|
449
453
|
disabled: r === 0 || L,
|
|
450
454
|
onClick: () => o((e) => Math.max(0, e - 1)),
|
|
451
|
-
children: [/* @__PURE__ */
|
|
452
|
-
}), /* @__PURE__ */
|
|
455
|
+
children: [/* @__PURE__ */ E(t, { size: 16 }), " Previous"]
|
|
456
|
+
}), /* @__PURE__ */ D(l, {
|
|
453
457
|
variant: "outline",
|
|
454
458
|
size: "sm",
|
|
455
|
-
disabled: !
|
|
459
|
+
disabled: !ce || L,
|
|
456
460
|
onClick: () => o((e) => e + 1),
|
|
457
|
-
children: ["Next ", /* @__PURE__ */
|
|
461
|
+
children: ["Next ", /* @__PURE__ */ E(n, { size: 16 })]
|
|
458
462
|
})]
|
|
459
463
|
})]
|
|
460
464
|
})]
|
|
@@ -464,4 +468,4 @@ function M() {
|
|
|
464
468
|
});
|
|
465
469
|
}
|
|
466
470
|
//#endregion
|
|
467
|
-
export {
|
|
471
|
+
export { N as default };
|