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