@burdenoff/microfe-movethewheels 2026.920.3 → 2026.921.1

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 (77) hide show
  1. package/dist/components/CarbonFootprintPanel.js +1 -1
  2. package/dist/components/CustomerPicker.js +76 -65
  3. package/dist/components/DataTable.js +140 -139
  4. package/dist/components/DocumentsCard.js +14 -8
  5. package/dist/generated/wspace-types.d.ts +1043 -5
  6. package/dist/hooks/useAnalytics.js +21 -1
  7. package/dist/hooks/useCustomers.js +94 -78
  8. package/dist/hooks/useDebouncedValue.js +11 -0
  9. package/dist/hooks/useEntityDocuments.js +28 -18
  10. package/dist/hooks/useEpod.js +24 -17
  11. package/dist/hooks/useFleet.js +146 -125
  12. package/dist/hooks/useInventory.js +255 -186
  13. package/dist/hooks/useMultiModalShipments.js +35 -27
  14. package/dist/hooks/useOrders.js +73 -73
  15. package/dist/hooks/useRoutes.js +97 -75
  16. package/dist/hooks/useTracking.js +100 -88
  17. package/dist/movethewheels/components/CustomerPicker.d.ts +3 -1
  18. package/dist/movethewheels/components/DataTable.d.ts +5 -1
  19. package/dist/movethewheels/hooks/useCustomers.d.ts +0 -1
  20. package/dist/movethewheels/hooks/useDebouncedValue.d.ts +1 -0
  21. package/dist/movethewheels/hooks/useEntityDocuments.d.ts +2 -0
  22. package/dist/movethewheels/hooks/useEpod.d.ts +6 -1
  23. package/dist/movethewheels/hooks/useFleet.d.ts +49 -5
  24. package/dist/movethewheels/hooks/useInventory.d.ts +24 -17
  25. package/dist/movethewheels/hooks/useMultiModalShipments.d.ts +6 -1
  26. package/dist/movethewheels/hooks/useOrders.d.ts +33 -5
  27. package/dist/movethewheels/hooks/useRoutes.d.ts +2 -1
  28. package/dist/movethewheels/hooks/useTracking.d.ts +12 -11
  29. package/dist/movethewheels/types/index.d.ts +7 -5
  30. package/dist/pages/CreateOrderPage.js +207 -201
  31. package/dist/pages/CustomersPage.js +61 -54
  32. package/dist/pages/DeliveryCapturePage.js +131 -109
  33. package/dist/pages/DriversPage.js +100 -92
  34. package/dist/pages/InventoryPage.js +239 -236
  35. package/dist/pages/MultiModalShipmentPage.js +163 -130
  36. package/dist/pages/OrderDetailsPage.js +224 -208
  37. package/dist/pages/OrdersListPage.js +66 -60
  38. package/dist/pages/ProductDetailsPage.js +241 -200
  39. package/dist/pages/ProductsPage.js +59 -52
  40. package/dist/pages/RouteDetailsPage.js +343 -321
  41. package/dist/pages/RoutesPage.js +55 -48
  42. package/dist/pages/VehiclesPage.js +63 -56
  43. package/dist/pages/WarehousesPage.js +60 -53
  44. package/package.json +1 -1
  45. package/src/generated/wspace-types.ts +1188 -5
  46. package/src/movethewheels/components/CarbonFootprintPanel.tsx +0 -1
  47. package/src/movethewheels/components/CustomerPicker.tsx +14 -0
  48. package/src/movethewheels/components/DataTable.tsx +34 -18
  49. package/src/movethewheels/components/DocumentsCard.tsx +6 -1
  50. package/src/movethewheels/components/maps/leaflet-setup.ts +1 -8
  51. package/src/movethewheels/hooks/useAnalytics.ts +27 -0
  52. package/src/movethewheels/hooks/useCustomers.ts +64 -24
  53. package/src/movethewheels/hooks/useDebouncedValue.ts +12 -0
  54. package/src/movethewheels/hooks/useEntityDocuments.ts +43 -25
  55. package/src/movethewheels/hooks/useEpod.ts +14 -7
  56. package/src/movethewheels/hooks/useFleet.ts +58 -37
  57. package/src/movethewheels/hooks/useFleetIntelligence.ts +1 -4
  58. package/src/movethewheels/hooks/useInventory.ts +211 -90
  59. package/src/movethewheels/hooks/useMultiModalShipments.ts +15 -11
  60. package/src/movethewheels/hooks/useOrders.ts +13 -14
  61. package/src/movethewheels/hooks/useRoutes.ts +80 -23
  62. package/src/movethewheels/hooks/useTracking.ts +130 -98
  63. package/src/movethewheels/pages/CreateOrderPage.tsx +9 -1
  64. package/src/movethewheels/pages/CustomersPage.tsx +11 -1
  65. package/src/movethewheels/pages/DeliveryCapturePage.tsx +31 -1
  66. package/src/movethewheels/pages/DriversPage.tsx +24 -12
  67. package/src/movethewheels/pages/InventoryPage.tsx +57 -32
  68. package/src/movethewheels/pages/MultiModalShipmentPage.tsx +52 -3
  69. package/src/movethewheels/pages/OrderDetailsPage.tsx +17 -1
  70. package/src/movethewheels/pages/OrdersListPage.tsx +20 -3
  71. package/src/movethewheels/pages/ProductDetailsPage.tsx +52 -3
  72. package/src/movethewheels/pages/ProductsPage.tsx +11 -1
  73. package/src/movethewheels/pages/RouteDetailsPage.tsx +35 -5
  74. package/src/movethewheels/pages/RoutesPage.tsx +11 -1
  75. package/src/movethewheels/pages/VehiclesPage.tsx +19 -2
  76. package/src/movethewheels/pages/WarehousesPage.tsx +11 -1
  77. package/src/movethewheels/types/index.ts +7 -5
@@ -4,8 +4,8 @@ import { MapPin as n } from "../node_modules/lucide-react/dist/esm/icons/map-pin
4
4
  import { Package as r } from "../node_modules/lucide-react/dist/esm/icons/package.js";
5
5
  import { Plus as i } from "../node_modules/lucide-react/dist/esm/icons/plus.js";
6
6
  import { Save as a } from "../node_modules/lucide-react/dist/esm/icons/save.js";
7
- import { Trash2 as o } from "../node_modules/lucide-react/dist/esm/icons/trash-2.js";
8
- import { Users as ee } from "../node_modules/lucide-react/dist/esm/icons/users.js";
7
+ import { Trash2 as ee } from "../node_modules/lucide-react/dist/esm/icons/trash-2.js";
8
+ import { Users as o } from "../node_modules/lucide-react/dist/esm/icons/users.js";
9
9
  import { buildCustomerCreatePath as te, joinPath as s } from "../utils/navigation.js";
10
10
  import { useMoveTheWheels as c } from "../providers/MoveTheWheelsProvider.js";
11
11
  import { useOrder as l, useOrders as u } from "../hooks/useOrders.js";
@@ -13,117 +13,121 @@ import { useCustomer as ne, useCustomers as re } from "../hooks/useCustomers.js"
13
13
  import { Button as d, Card as f, CardContent as p, CardHeader as m, CardTitle as h, Input as g, Label as _, Select as v, SelectContent as ie, SelectItem as y, SelectTrigger as ae, SelectValue as oe, Separator as se, Textarea as ce } from "../components/ui.js";
14
14
  import { EmptyState as le, PageLayout as ue } from "../components/PageLayout.js";
15
15
  import { FormError as de } from "../components/FormError.js";
16
- import { CustomerPicker as fe } from "../components/CustomerPicker.js";
16
+ import { useDebouncedValue as fe } from "../hooks/useDebouncedValue.js";
17
+ import { CustomerPicker as pe } from "../components/CustomerPicker.js";
17
18
  import { useEffect as b, useState as x } from "react";
18
- import { useParams as pe, useSearchParams as S } from "react-router";
19
- import { jsx as C, jsxs as w } from "react/jsx-runtime";
20
- import { EmphasisPanel as T, NextSteps as me, PagePurpose as he } from "@burdenoff/fe-libs/ui";
19
+ import { useParams as me, useSearchParams as he } from "react-router";
20
+ import { jsx as S, jsxs as C } from "react/jsx-runtime";
21
+ import { EmphasisPanel as ge, NextSteps as _e, PagePurpose as ve } from "@burdenoff/fe-libs/ui";
21
22
  //#region src/movethewheels/pages/CreateOrderPage.tsx
22
- function E(e) {
23
+ function w(e) {
23
24
  if (!e || Number.isNaN(e.getTime())) return "";
24
25
  let t = (e) => String(e).padStart(2, "0");
25
26
  return `${e.getFullYear()}-${t(e.getMonth() + 1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}`;
26
27
  }
27
- function D() {
28
- let { orderId: D } = pe(), [ge] = S(), O = ge.get("customerId")?.trim() || void 0, { basePath: k, navigate: A } = c(), { order: j } = l(D), { createOrder: M, updateOrder: N } = u(), { customers: P, createCustomer: F, isLoading: I, error: L, refetch: _e } = re({ limit: 100 }), { customer: R } = ne(O ?? j?.customerId), z = !!D && !!j, [B, V] = x(null), [H, U] = x({
29
- customerId: O || j?.customerId || "",
30
- priority: j?.priority || "normal",
28
+ function T() {
29
+ let { orderId: T } = me(), [ye] = he(), E = ye.get("customerId")?.trim() || void 0, { basePath: D, navigate: O } = c(), { order: k } = l(T), { createOrder: A, updateOrder: j } = u(), [M, N] = x(""), { customers: P, createCustomer: be, isLoading: F, error: I, refetch: xe } = re({
30
+ limit: 20,
31
+ filters: { search: fe(M) || void 0 }
32
+ }), { customer: L } = ne(E ?? k?.customerId), R = !!T && !!k, [z, B] = x(null), [V, H] = x({
33
+ customerId: E || k?.customerId || "",
34
+ priority: k?.priority || "normal",
31
35
  pickupAddress: {
32
- street: j?.pickupAddress.street || "",
33
- city: j?.pickupAddress.city || "",
34
- state: j?.pickupAddress.state || "",
35
- postalCode: j?.pickupAddress.postalCode || "",
36
- country: j?.pickupAddress.country || "USA"
36
+ street: k?.pickupAddress.street || "",
37
+ city: k?.pickupAddress.city || "",
38
+ state: k?.pickupAddress.state || "",
39
+ postalCode: k?.pickupAddress.postalCode || "",
40
+ country: k?.pickupAddress.country || "USA"
37
41
  },
38
42
  deliveryAddress: {
39
- street: j?.deliveryAddress.street || "",
40
- city: j?.deliveryAddress.city || "",
41
- state: j?.deliveryAddress.state || "",
42
- postalCode: j?.deliveryAddress.postalCode || "",
43
- country: j?.deliveryAddress.country || "USA"
43
+ street: k?.deliveryAddress.street || "",
44
+ city: k?.deliveryAddress.city || "",
45
+ state: k?.deliveryAddress.state || "",
46
+ postalCode: k?.deliveryAddress.postalCode || "",
47
+ country: k?.deliveryAddress.country || "USA"
44
48
  },
45
- items: j?.items || [],
46
- scheduledDelivery: E(j?.scheduledDelivery),
47
- specialInstructions: j?.specialInstructions || ""
48
- }), [W, G] = x(!1), [ve, K] = x(null);
49
+ items: k?.items || [],
50
+ scheduledDelivery: w(k?.scheduledDelivery),
51
+ specialInstructions: k?.specialInstructions || ""
52
+ }), [U, W] = x(!1), [Se, G] = x(null);
49
53
  b(() => {
50
- R && (V((e) => e?.id === R.id ? e : R), U((e) => e.customerId ? e : {
54
+ L && (B((e) => e?.id === L.id ? e : L), H((e) => e.customerId ? e : {
51
55
  ...e,
52
- customerId: R.id
56
+ customerId: L.id
53
57
  }));
54
- }, [R]), b(() => {
55
- j && U({
56
- customerId: j.customerId || "",
57
- priority: j.priority || "normal",
58
+ }, [L]), b(() => {
59
+ k && H({
60
+ customerId: k.customerId || "",
61
+ priority: k.priority || "normal",
58
62
  pickupAddress: {
59
- street: j.pickupAddress.street || "",
60
- city: j.pickupAddress.city || "",
61
- state: j.pickupAddress.state || "",
62
- postalCode: j.pickupAddress.postalCode || "",
63
- country: j.pickupAddress.country || "USA"
63
+ street: k.pickupAddress.street || "",
64
+ city: k.pickupAddress.city || "",
65
+ state: k.pickupAddress.state || "",
66
+ postalCode: k.pickupAddress.postalCode || "",
67
+ country: k.pickupAddress.country || "USA"
64
68
  },
65
69
  deliveryAddress: {
66
- street: j.deliveryAddress.street || "",
67
- city: j.deliveryAddress.city || "",
68
- state: j.deliveryAddress.state || "",
69
- postalCode: j.deliveryAddress.postalCode || "",
70
- country: j.deliveryAddress.country || "USA"
70
+ street: k.deliveryAddress.street || "",
71
+ city: k.deliveryAddress.city || "",
72
+ state: k.deliveryAddress.state || "",
73
+ postalCode: k.deliveryAddress.postalCode || "",
74
+ country: k.deliveryAddress.country || "USA"
71
75
  },
72
- items: j.items || [],
73
- scheduledDelivery: E(j.scheduledDelivery),
74
- specialInstructions: j.specialInstructions || ""
76
+ items: k.items || [],
77
+ scheduledDelivery: w(k.scheduledDelivery),
78
+ specialInstructions: k.specialInstructions || ""
75
79
  });
76
- }, [j]);
77
- let q = () => {
78
- if (A) {
79
- if (!z && O) {
80
- A(s(k, `customers/${O}`));
80
+ }, [k]);
81
+ let K = () => {
82
+ if (O) {
83
+ if (!R && E) {
84
+ O(s(D, `customers/${E}`));
81
85
  return;
82
86
  }
83
- A(s(k, "orders"));
87
+ O(s(D, "orders"));
84
88
  }
85
- }, J = () => B ?? P.find((e) => e.id === H.customerId), ye = () => !H.customerId || !J() ? L ? "Customers could not be loaded. Retry or create a customer before continuing." : "Select a customer for this order." : H.pickupAddress.street.trim() ? H.deliveryAddress.street.trim() ? H.items.length === 0 ? "Add at least one item to the order." : H.scheduledDelivery && Number.isNaN(Date.parse(H.scheduledDelivery)) ? "Enter a valid scheduled delivery date and time." : null : "Enter a delivery street address." : "Enter a pickup street address.", Y = async (e) => {
86
- e.preventDefault(), K(null);
87
- let t = ye();
89
+ }, q = () => z ?? P.find((e) => e.id === V.customerId), J = () => !V.customerId || !q() ? I ? "Customers could not be loaded. Retry or create a customer before continuing." : "Select a customer for this order." : V.pickupAddress.street.trim() ? V.deliveryAddress.street.trim() ? V.items.length === 0 ? "Add at least one item to the order." : V.scheduledDelivery && Number.isNaN(Date.parse(V.scheduledDelivery)) ? "Enter a valid scheduled delivery date and time." : null : "Enter a delivery street address." : "Enter a pickup street address.", Y = async (e) => {
90
+ e.preventDefault(), G(null);
91
+ let t = J();
88
92
  if (t) {
89
- K(t);
93
+ G(t);
90
94
  return;
91
95
  }
92
- let n = J();
96
+ let n = q();
93
97
  if (!n) {
94
- K(L ? "Customers could not be loaded. Retry or create a customer before continuing." : "Select a customer for this order.");
98
+ G(I ? "Customers could not be loaded. Retry or create a customer before continuing." : "Select a customer for this order.");
95
99
  return;
96
100
  }
97
- G(!0);
101
+ W(!0);
98
102
  try {
99
103
  let e = {
100
- customerId: H.customerId,
104
+ customerId: V.customerId,
101
105
  customerInfo: {
102
106
  name: n.name,
103
107
  email: n.email,
104
108
  phone: n.phone,
105
109
  company: n.company
106
110
  },
107
- priority: H.priority,
108
- pickupAddress: H.pickupAddress,
109
- deliveryAddress: H.deliveryAddress,
110
- items: H.items,
111
- scheduledDelivery: H.scheduledDelivery ? new Date(H.scheduledDelivery) : null,
112
- specialInstructions: H.specialInstructions
111
+ priority: V.priority,
112
+ pickupAddress: V.pickupAddress,
113
+ deliveryAddress: V.deliveryAddress,
114
+ items: V.items,
115
+ scheduledDelivery: V.scheduledDelivery ? new Date(V.scheduledDelivery) : null,
116
+ specialInstructions: V.specialInstructions
113
117
  };
114
- z && D ? (await N(D, e), A && A(s(k, `orders/${D}`))) : (await M(e), q());
118
+ R && T ? (await j(T, e), O && O(s(D, `orders/${T}`))) : (await A(e), K());
115
119
  } catch (e) {
116
- K(e instanceof Error ? e.message : z ? "Could not update the order. Please try again." : "Could not create the order. Please try again.");
120
+ G(e instanceof Error ? e.message : R ? "Could not update the order. Please try again." : "Could not create the order. Please try again.");
117
121
  } finally {
118
- G(!1);
122
+ W(!1);
119
123
  }
120
124
  }, X = (e, t) => {
121
- U((n) => ({
125
+ H((n) => ({
122
126
  ...n,
123
127
  [e]: t
124
128
  }));
125
129
  }, Z = (e, t, n) => {
126
- U((r) => ({
130
+ H((r) => ({
127
131
  ...r,
128
132
  [e]: {
129
133
  ...r[e],
@@ -131,7 +135,7 @@ function D() {
131
135
  }
132
136
  }));
133
137
  }, Q = () => {
134
- U((e) => ({
138
+ H((e) => ({
135
139
  ...e,
136
140
  items: [...e.items, {
137
141
  id: `item-${Date.now()}`,
@@ -149,13 +153,13 @@ function D() {
149
153
  sku: ""
150
154
  }]
151
155
  }));
152
- }, be = (e) => {
153
- U((t) => ({
156
+ }, Ce = (e) => {
157
+ H((t) => ({
154
158
  ...t,
155
159
  items: t.items.filter((t, n) => n !== e)
156
160
  }));
157
161
  }, $ = (e, t, n) => {
158
- U((r) => ({
162
+ H((r) => ({
159
163
  ...r,
160
164
  items: r.items.map((r, i) => i === e ? {
161
165
  ...r,
@@ -163,110 +167,112 @@ function D() {
163
167
  } : r)
164
168
  }));
165
169
  };
166
- return /* @__PURE__ */ w(ue, {
167
- title: z ? "Edit Order" : "Create Order",
168
- subtitle: z ? `Editing ${j?.orderNumber}` : "Create a new delivery order",
169
- icon: /* @__PURE__ */ C(r, { size: 24 }),
170
- headerActions: /* @__PURE__ */ w("div", {
170
+ return /* @__PURE__ */ C(ue, {
171
+ title: R ? "Edit Order" : "Create Order",
172
+ subtitle: R ? `Editing ${k?.orderNumber}` : "Create a new delivery order",
173
+ icon: /* @__PURE__ */ S(r, { size: 24 }),
174
+ headerActions: /* @__PURE__ */ C("div", {
171
175
  className: "flex gap-2",
172
- children: [/* @__PURE__ */ w(d, {
176
+ children: [/* @__PURE__ */ C(d, {
173
177
  variant: "outline",
174
- onClick: q,
175
- children: [/* @__PURE__ */ C(e, { size: 16 }), "Cancel"]
176
- }), /* @__PURE__ */ w(d, {
178
+ onClick: K,
179
+ children: [/* @__PURE__ */ S(e, { size: 16 }), "Cancel"]
180
+ }), /* @__PURE__ */ C(d, {
177
181
  onClick: Y,
178
- disabled: W || I,
179
- children: [/* @__PURE__ */ C(a, { size: 16 }), W ? "Saving..." : z ? "Save Changes" : "Create Order"]
182
+ disabled: U || F,
183
+ children: [/* @__PURE__ */ S(a, { size: 16 }), U ? "Saving..." : R ? "Save Changes" : "Create Order"]
180
184
  })]
181
185
  }),
182
186
  children: [
183
- /* @__PURE__ */ C(he, {
184
- icon: /* @__PURE__ */ C(r, { size: 18 }),
185
- children: z ? "Update this delivery before it goes out — change the customer, addresses, items or handling notes, then save." : "Book a new delivery in a few steps: choose who it’s for, set pickup and drop-off addresses, list what’s being shipped, and add any handling notes. Once created it joins the orders pipeline ready to assign and track."
187
+ /* @__PURE__ */ S(ve, {
188
+ icon: /* @__PURE__ */ S(r, { size: 18 }),
189
+ children: R ? "Update this delivery before it goes out — change the customer, addresses, items or handling notes, then save." : "Book a new delivery in a few steps: choose who it’s for, set pickup and drop-off addresses, list what’s being shipped, and add any handling notes. Once created it joins the orders pipeline ready to assign and track."
186
190
  }),
187
- /* @__PURE__ */ C(me, {
191
+ /* @__PURE__ */ S(_e, {
188
192
  storageKey: "movethewheels-create-order",
189
193
  steps: [
190
194
  {
191
195
  id: "customer",
192
196
  label: "Pick the customer first",
193
197
  description: "Their saved contact details auto-fill the order.",
194
- icon: /* @__PURE__ */ C(ee, { size: 16 }),
195
- done: !!H.customerId,
198
+ icon: /* @__PURE__ */ S(o, { size: 16 }),
199
+ done: !!V.customerId,
196
200
  onClick: () => document.getElementById("customer")?.focus()
197
201
  },
198
202
  {
199
203
  id: "addresses",
200
204
  label: "Set pickup & delivery addresses",
201
205
  description: "Where the shipment is collected and dropped off.",
202
- icon: /* @__PURE__ */ C(n, { size: 16 }),
203
- done: !!H.pickupAddress.street && !!H.deliveryAddress.street,
206
+ icon: /* @__PURE__ */ S(n, { size: 16 }),
207
+ done: !!V.pickupAddress.street && !!V.deliveryAddress.street,
204
208
  onClick: () => document.getElementById("pickupStreet")?.focus()
205
209
  },
206
210
  {
207
211
  id: "items",
208
212
  label: "Add the items to ship",
209
213
  description: "List each product with its quantity and value.",
210
- icon: /* @__PURE__ */ C(r, { size: 16 }),
211
- done: H.items.length > 0,
214
+ icon: /* @__PURE__ */ S(r, { size: 16 }),
215
+ done: V.items.length > 0,
212
216
  onClick: Q
213
217
  }
214
218
  ]
215
219
  }),
216
- /* @__PURE__ */ w("form", {
220
+ /* @__PURE__ */ C("form", {
217
221
  onSubmit: Y,
218
222
  className: "space-y-6",
219
223
  children: [
220
- /* @__PURE__ */ C(de, { message: ve }),
221
- /* @__PURE__ */ w(T, { children: [/* @__PURE__ */ C("h2", {
224
+ /* @__PURE__ */ S(de, { message: Se }),
225
+ /* @__PURE__ */ C(ge, { children: [/* @__PURE__ */ S("h2", {
222
226
  className: "text-base font-semibold text-text-primary mb-4",
223
227
  children: "Order Details"
224
- }), /* @__PURE__ */ C("div", {
228
+ }), /* @__PURE__ */ S("div", {
225
229
  className: "space-y-4",
226
- children: /* @__PURE__ */ w("div", {
230
+ children: /* @__PURE__ */ C("div", {
227
231
  className: "grid grid-cols-1 md:grid-cols-2 gap-4",
228
- children: [/* @__PURE__ */ C(fe, {
232
+ children: [/* @__PURE__ */ S(pe, {
229
233
  customers: P,
230
- value: H.customerId,
234
+ value: V.customerId,
231
235
  onValueChange: (e) => {
232
- e && (X("customerId", e), V(P.find((t) => t.id === e) ?? (B?.id === e ? B : null)), K(null));
236
+ e && (X("customerId", e), B(P.find((t) => t.id === e) ?? (z?.id === e ? z : null)), G(null));
233
237
  },
234
238
  onCreated: (e) => {
235
- V(e), X("customerId", e.id), K(null);
239
+ B(e), X("customerId", e.id), G(null);
236
240
  },
237
- createCustomer: F,
238
- isLoading: I,
239
- error: L,
240
- onRetry: _e,
241
+ createCustomer: be,
242
+ isLoading: F,
243
+ error: I,
244
+ onRetry: xe,
241
245
  onOpenCustomers: () => {
242
- A && A(s(k, te(z && D ? `orders/${D}/edit` : "orders/new")));
246
+ O && O(s(D, te(R && T ? `orders/${T}/edit` : "orders/new")));
243
247
  },
244
- selectedCustomer: B
245
- }), /* @__PURE__ */ w("div", {
248
+ selectedCustomer: z,
249
+ searchQuery: M,
250
+ onSearchQueryChange: N
251
+ }), /* @__PURE__ */ C("div", {
246
252
  className: "space-y-2",
247
- children: [/* @__PURE__ */ C(_, {
253
+ children: [/* @__PURE__ */ S(_, {
248
254
  htmlFor: "priority",
249
255
  children: "Priority"
250
- }), /* @__PURE__ */ w(v, {
251
- value: H.priority,
256
+ }), /* @__PURE__ */ C(v, {
257
+ value: V.priority,
252
258
  onValueChange: (e) => X("priority", e),
253
- children: [/* @__PURE__ */ C(ae, {
259
+ children: [/* @__PURE__ */ S(ae, {
254
260
  id: "priority",
255
- children: /* @__PURE__ */ C(oe, {})
256
- }), /* @__PURE__ */ w(ie, { children: [
257
- /* @__PURE__ */ C(y, {
261
+ children: /* @__PURE__ */ S(oe, {})
262
+ }), /* @__PURE__ */ C(ie, { children: [
263
+ /* @__PURE__ */ S(y, {
258
264
  value: "low",
259
265
  children: "Low"
260
266
  }),
261
- /* @__PURE__ */ C(y, {
267
+ /* @__PURE__ */ S(y, {
262
268
  value: "normal",
263
269
  children: "Normal"
264
270
  }),
265
- /* @__PURE__ */ C(y, {
271
+ /* @__PURE__ */ S(y, {
266
272
  value: "high",
267
273
  children: "High"
268
274
  }),
269
- /* @__PURE__ */ C(y, {
275
+ /* @__PURE__ */ S(y, {
270
276
  value: "urgent",
271
277
  children: "Urgent"
272
278
  })
@@ -275,138 +281,138 @@ function D() {
275
281
  })]
276
282
  })
277
283
  })] }),
278
- /* @__PURE__ */ w("div", {
284
+ /* @__PURE__ */ C("div", {
279
285
  className: "grid grid-cols-1 md:grid-cols-2 gap-6",
280
- children: [/* @__PURE__ */ w(f, { children: [/* @__PURE__ */ C(m, { children: /* @__PURE__ */ C(h, { children: "Pickup Address" }) }), /* @__PURE__ */ w(p, {
286
+ children: [/* @__PURE__ */ C(f, { children: [/* @__PURE__ */ S(m, { children: /* @__PURE__ */ S(h, { children: "Pickup Address" }) }), /* @__PURE__ */ C(p, {
281
287
  className: "space-y-4",
282
288
  children: [
283
- /* @__PURE__ */ w("div", {
289
+ /* @__PURE__ */ C("div", {
284
290
  className: "space-y-2",
285
- children: [/* @__PURE__ */ C(_, {
291
+ children: [/* @__PURE__ */ S(_, {
286
292
  htmlFor: "pickupStreet",
287
293
  children: "Street Address"
288
- }), /* @__PURE__ */ C(g, {
294
+ }), /* @__PURE__ */ S(g, {
289
295
  id: "pickupStreet",
290
- value: H.pickupAddress.street,
296
+ value: V.pickupAddress.street,
291
297
  onChange: (e) => Z("pickupAddress", "street", e.target.value),
292
298
  placeholder: "123 Main St"
293
299
  })]
294
300
  }),
295
- /* @__PURE__ */ w("div", {
301
+ /* @__PURE__ */ C("div", {
296
302
  className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
297
- children: [/* @__PURE__ */ w("div", {
303
+ children: [/* @__PURE__ */ C("div", {
298
304
  className: "space-y-2",
299
- children: [/* @__PURE__ */ C(_, {
305
+ children: [/* @__PURE__ */ S(_, {
300
306
  htmlFor: "pickupCity",
301
307
  children: "City"
302
- }), /* @__PURE__ */ C(g, {
308
+ }), /* @__PURE__ */ S(g, {
303
309
  id: "pickupCity",
304
- value: H.pickupAddress.city,
310
+ value: V.pickupAddress.city,
305
311
  onChange: (e) => Z("pickupAddress", "city", e.target.value),
306
312
  placeholder: "San Francisco"
307
313
  })]
308
- }), /* @__PURE__ */ w("div", {
314
+ }), /* @__PURE__ */ C("div", {
309
315
  className: "space-y-2",
310
- children: [/* @__PURE__ */ C(_, {
316
+ children: [/* @__PURE__ */ S(_, {
311
317
  htmlFor: "pickupState",
312
318
  children: "State"
313
- }), /* @__PURE__ */ C(g, {
319
+ }), /* @__PURE__ */ S(g, {
314
320
  id: "pickupState",
315
- value: H.pickupAddress.state,
321
+ value: V.pickupAddress.state,
316
322
  onChange: (e) => Z("pickupAddress", "state", e.target.value),
317
323
  placeholder: "CA"
318
324
  })]
319
325
  })]
320
326
  }),
321
- /* @__PURE__ */ w("div", {
327
+ /* @__PURE__ */ C("div", {
322
328
  className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
323
- children: [/* @__PURE__ */ w("div", {
329
+ children: [/* @__PURE__ */ C("div", {
324
330
  className: "space-y-2",
325
- children: [/* @__PURE__ */ C(_, {
331
+ children: [/* @__PURE__ */ S(_, {
326
332
  htmlFor: "pickupPostal",
327
333
  children: "Postal Code"
328
- }), /* @__PURE__ */ C(g, {
334
+ }), /* @__PURE__ */ S(g, {
329
335
  id: "pickupPostal",
330
- value: H.pickupAddress.postalCode,
336
+ value: V.pickupAddress.postalCode,
331
337
  onChange: (e) => Z("pickupAddress", "postalCode", e.target.value),
332
338
  placeholder: "94103"
333
339
  })]
334
- }), /* @__PURE__ */ w("div", {
340
+ }), /* @__PURE__ */ C("div", {
335
341
  className: "space-y-2",
336
- children: [/* @__PURE__ */ C(_, {
342
+ children: [/* @__PURE__ */ S(_, {
337
343
  htmlFor: "pickupCountry",
338
344
  children: "Country"
339
- }), /* @__PURE__ */ C(g, {
345
+ }), /* @__PURE__ */ S(g, {
340
346
  id: "pickupCountry",
341
- value: H.pickupAddress.country,
347
+ value: V.pickupAddress.country,
342
348
  onChange: (e) => Z("pickupAddress", "country", e.target.value),
343
349
  placeholder: "USA"
344
350
  })]
345
351
  })]
346
352
  })
347
353
  ]
348
- })] }), /* @__PURE__ */ w(f, { children: [/* @__PURE__ */ C(m, { children: /* @__PURE__ */ C(h, { children: "Delivery Address" }) }), /* @__PURE__ */ w(p, {
354
+ })] }), /* @__PURE__ */ C(f, { children: [/* @__PURE__ */ S(m, { children: /* @__PURE__ */ S(h, { children: "Delivery Address" }) }), /* @__PURE__ */ C(p, {
349
355
  className: "space-y-4",
350
356
  children: [
351
- /* @__PURE__ */ w("div", {
357
+ /* @__PURE__ */ C("div", {
352
358
  className: "space-y-2",
353
- children: [/* @__PURE__ */ C(_, {
359
+ children: [/* @__PURE__ */ S(_, {
354
360
  htmlFor: "deliveryStreet",
355
361
  children: "Street Address"
356
- }), /* @__PURE__ */ C(g, {
362
+ }), /* @__PURE__ */ S(g, {
357
363
  id: "deliveryStreet",
358
- value: H.deliveryAddress.street,
364
+ value: V.deliveryAddress.street,
359
365
  onChange: (e) => Z("deliveryAddress", "street", e.target.value),
360
366
  placeholder: "456 Oak Ave"
361
367
  })]
362
368
  }),
363
- /* @__PURE__ */ w("div", {
369
+ /* @__PURE__ */ C("div", {
364
370
  className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
365
- children: [/* @__PURE__ */ w("div", {
371
+ children: [/* @__PURE__ */ C("div", {
366
372
  className: "space-y-2",
367
- children: [/* @__PURE__ */ C(_, {
373
+ children: [/* @__PURE__ */ S(_, {
368
374
  htmlFor: "deliveryCity",
369
375
  children: "City"
370
- }), /* @__PURE__ */ C(g, {
376
+ }), /* @__PURE__ */ S(g, {
371
377
  id: "deliveryCity",
372
- value: H.deliveryAddress.city,
378
+ value: V.deliveryAddress.city,
373
379
  onChange: (e) => Z("deliveryAddress", "city", e.target.value),
374
380
  placeholder: "Los Angeles"
375
381
  })]
376
- }), /* @__PURE__ */ w("div", {
382
+ }), /* @__PURE__ */ C("div", {
377
383
  className: "space-y-2",
378
- children: [/* @__PURE__ */ C(_, {
384
+ children: [/* @__PURE__ */ S(_, {
379
385
  htmlFor: "deliveryState",
380
386
  children: "State"
381
- }), /* @__PURE__ */ C(g, {
387
+ }), /* @__PURE__ */ S(g, {
382
388
  id: "deliveryState",
383
- value: H.deliveryAddress.state,
389
+ value: V.deliveryAddress.state,
384
390
  onChange: (e) => Z("deliveryAddress", "state", e.target.value),
385
391
  placeholder: "CA"
386
392
  })]
387
393
  })]
388
394
  }),
389
- /* @__PURE__ */ w("div", {
395
+ /* @__PURE__ */ C("div", {
390
396
  className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
391
- children: [/* @__PURE__ */ w("div", {
397
+ children: [/* @__PURE__ */ C("div", {
392
398
  className: "space-y-2",
393
- children: [/* @__PURE__ */ C(_, {
399
+ children: [/* @__PURE__ */ S(_, {
394
400
  htmlFor: "deliveryPostal",
395
401
  children: "Postal Code"
396
- }), /* @__PURE__ */ C(g, {
402
+ }), /* @__PURE__ */ S(g, {
397
403
  id: "deliveryPostal",
398
- value: H.deliveryAddress.postalCode,
404
+ value: V.deliveryAddress.postalCode,
399
405
  onChange: (e) => Z("deliveryAddress", "postalCode", e.target.value),
400
406
  placeholder: "90210"
401
407
  })]
402
- }), /* @__PURE__ */ w("div", {
408
+ }), /* @__PURE__ */ C("div", {
403
409
  className: "space-y-2",
404
- children: [/* @__PURE__ */ C(_, {
410
+ children: [/* @__PURE__ */ S(_, {
405
411
  htmlFor: "deliveryCountry",
406
412
  children: "Country"
407
- }), /* @__PURE__ */ C(g, {
413
+ }), /* @__PURE__ */ S(g, {
408
414
  id: "deliveryCountry",
409
- value: H.deliveryAddress.country,
415
+ value: V.deliveryAddress.country,
410
416
  onChange: (e) => Z("deliveryAddress", "country", e.target.value),
411
417
  placeholder: "USA"
412
418
  })]
@@ -415,61 +421,61 @@ function D() {
415
421
  ]
416
422
  })] })]
417
423
  }),
418
- /* @__PURE__ */ w(f, { children: [/* @__PURE__ */ w(m, {
424
+ /* @__PURE__ */ C(f, { children: [/* @__PURE__ */ C(m, {
419
425
  className: "flex flex-row items-center justify-between",
420
- children: [/* @__PURE__ */ C(h, { children: "Order Items" }), /* @__PURE__ */ w(d, {
426
+ children: [/* @__PURE__ */ S(h, { children: "Order Items" }), /* @__PURE__ */ C(d, {
421
427
  type: "button",
422
428
  variant: "outline",
423
429
  size: "sm",
424
430
  onClick: Q,
425
- children: [/* @__PURE__ */ C(i, { size: 16 }), "Add Item"]
431
+ children: [/* @__PURE__ */ S(i, { size: 16 }), "Add Item"]
426
432
  })]
427
- }), /* @__PURE__ */ C(p, { children: H.items.length === 0 ? /* @__PURE__ */ C(le, {
433
+ }), /* @__PURE__ */ S(p, { children: V.items.length === 0 ? /* @__PURE__ */ S(le, {
428
434
  illustration: "empty-files",
429
435
  title: "No items added yet",
430
436
  description: "Add the products this order will ship — each with a name, SKU, quantity and value.",
431
- action: /* @__PURE__ */ w(d, {
437
+ action: /* @__PURE__ */ C(d, {
432
438
  type: "button",
433
439
  variant: "outline",
434
440
  onClick: Q,
435
- children: [/* @__PURE__ */ C(i, {
441
+ children: [/* @__PURE__ */ S(i, {
436
442
  size: 16,
437
443
  className: "mr-1.5"
438
444
  }), "Add your first item"]
439
445
  })
440
- }) : /* @__PURE__ */ C("div", {
446
+ }) : /* @__PURE__ */ S("div", {
441
447
  className: "space-y-4",
442
- children: H.items.map((e, t) => /* @__PURE__ */ w("div", { children: [t > 0 && /* @__PURE__ */ C(se, { className: "my-4" }), /* @__PURE__ */ w("div", {
448
+ children: V.items.map((e, t) => /* @__PURE__ */ C("div", { children: [t > 0 && /* @__PURE__ */ S(se, { className: "my-4" }), /* @__PURE__ */ C("div", {
443
449
  className: "grid grid-cols-1 md:grid-cols-7 gap-4",
444
450
  children: [
445
- /* @__PURE__ */ w("div", {
451
+ /* @__PURE__ */ C("div", {
446
452
  className: "md:col-span-2 space-y-2",
447
- children: [/* @__PURE__ */ C(_, { children: "Item Name" }), /* @__PURE__ */ C(g, {
453
+ children: [/* @__PURE__ */ S(_, { children: "Item Name" }), /* @__PURE__ */ S(g, {
448
454
  value: e.name,
449
455
  onChange: (e) => $(t, "name", e.target.value),
450
456
  placeholder: "Product name"
451
457
  })]
452
458
  }),
453
- /* @__PURE__ */ w("div", {
459
+ /* @__PURE__ */ C("div", {
454
460
  className: "space-y-2",
455
- children: [/* @__PURE__ */ C(_, { children: "SKU" }), /* @__PURE__ */ C(g, {
461
+ children: [/* @__PURE__ */ S(_, { children: "SKU" }), /* @__PURE__ */ S(g, {
456
462
  value: e.sku,
457
463
  onChange: (e) => $(t, "sku", e.target.value),
458
464
  placeholder: "SKU-001"
459
465
  })]
460
466
  }),
461
- /* @__PURE__ */ w("div", {
467
+ /* @__PURE__ */ C("div", {
462
468
  className: "space-y-2",
463
- children: [/* @__PURE__ */ C(_, { children: "Quantity" }), /* @__PURE__ */ C(g, {
469
+ children: [/* @__PURE__ */ S(_, { children: "Quantity" }), /* @__PURE__ */ S(g, {
464
470
  type: "number",
465
471
  min: "1",
466
472
  value: e.quantity,
467
473
  onChange: (e) => $(t, "quantity", parseInt(e.target.value) || 1)
468
474
  })]
469
475
  }),
470
- /* @__PURE__ */ w("div", {
476
+ /* @__PURE__ */ C("div", {
471
477
  className: "space-y-2",
472
- children: [/* @__PURE__ */ C(_, { children: "Weight (kg)" }), /* @__PURE__ */ C(g, {
478
+ children: [/* @__PURE__ */ S(_, { children: "Weight (kg)" }), /* @__PURE__ */ S(g, {
473
479
  type: "number",
474
480
  min: "0",
475
481
  step: "0.1",
@@ -477,9 +483,9 @@ function D() {
477
483
  onChange: (e) => $(t, "weight", parseFloat(e.target.value) || 0)
478
484
  })]
479
485
  }),
480
- /* @__PURE__ */ w("div", {
486
+ /* @__PURE__ */ C("div", {
481
487
  className: "space-y-2",
482
- children: [/* @__PURE__ */ C(_, { children: "Value ($)" }), /* @__PURE__ */ C(g, {
488
+ children: [/* @__PURE__ */ S(_, { children: "Value ($)" }), /* @__PURE__ */ S(g, {
483
489
  type: "number",
484
490
  min: "0",
485
491
  step: "0.01",
@@ -487,52 +493,52 @@ function D() {
487
493
  onChange: (e) => $(t, "value", parseFloat(e.target.value) || 0)
488
494
  })]
489
495
  }),
490
- /* @__PURE__ */ C("div", {
496
+ /* @__PURE__ */ S("div", {
491
497
  className: "flex items-end",
492
- children: /* @__PURE__ */ C(d, {
498
+ children: /* @__PURE__ */ S(d, {
493
499
  type: "button",
494
500
  variant: "ghost",
495
501
  size: "icon",
496
502
  className: "text-status-error-text",
497
- onClick: () => be(t),
498
- children: /* @__PURE__ */ C(o, { size: 16 })
503
+ onClick: () => Ce(t),
504
+ children: /* @__PURE__ */ S(ee, { size: 16 })
499
505
  })
500
506
  })
501
507
  ]
502
508
  })] }, e.id))
503
509
  }) })] }),
504
- /* @__PURE__ */ w(f, { children: [/* @__PURE__ */ C(m, { children: /* @__PURE__ */ C(h, { children: "Scheduling & Handling" }) }), /* @__PURE__ */ C(p, { children: /* @__PURE__ */ w("div", {
510
+ /* @__PURE__ */ C(f, { children: [/* @__PURE__ */ S(m, { children: /* @__PURE__ */ S(h, { children: "Scheduling & Handling" }) }), /* @__PURE__ */ S(p, { children: /* @__PURE__ */ C("div", {
505
511
  className: "grid grid-cols-1 md:grid-cols-3 gap-6",
506
- children: [/* @__PURE__ */ w("div", {
512
+ children: [/* @__PURE__ */ C("div", {
507
513
  className: "space-y-2",
508
514
  children: [
509
- /* @__PURE__ */ w(_, {
515
+ /* @__PURE__ */ C(_, {
510
516
  htmlFor: "scheduledDelivery",
511
517
  className: "flex items-center gap-1.5",
512
- children: [/* @__PURE__ */ C(t, {
518
+ children: [/* @__PURE__ */ S(t, {
513
519
  size: 14,
514
520
  className: "text-text-secondary"
515
521
  }), "Scheduled Delivery"]
516
522
  }),
517
- /* @__PURE__ */ C(g, {
523
+ /* @__PURE__ */ S(g, {
518
524
  id: "scheduledDelivery",
519
525
  type: "datetime-local",
520
- value: H.scheduledDelivery,
526
+ value: V.scheduledDelivery,
521
527
  onChange: (e) => X("scheduledDelivery", e.target.value)
522
528
  }),
523
- /* @__PURE__ */ C("p", {
529
+ /* @__PURE__ */ S("p", {
524
530
  className: "text-xs text-text-secondary",
525
531
  children: "The delivery window promised to the customer. Leave blank to dispatch as soon as a driver is free."
526
532
  })
527
533
  ]
528
- }), /* @__PURE__ */ w("div", {
534
+ }), /* @__PURE__ */ C("div", {
529
535
  className: "md:col-span-2 space-y-2",
530
- children: [/* @__PURE__ */ C(_, {
536
+ children: [/* @__PURE__ */ S(_, {
531
537
  htmlFor: "specialInstructions",
532
538
  children: "Special Instructions"
533
- }), /* @__PURE__ */ C(ce, {
539
+ }), /* @__PURE__ */ S(ce, {
534
540
  id: "specialInstructions",
535
- value: H.specialInstructions,
541
+ value: V.specialInstructions,
536
542
  onChange: (e) => X("specialInstructions", e.target.value),
537
543
  placeholder: "Any special handling or delivery instructions...",
538
544
  rows: 4
@@ -545,4 +551,4 @@ function D() {
545
551
  });
546
552
  }
547
553
  //#endregion
548
- export { D as default };
554
+ export { T as default };