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