@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.
@@ -10,22 +10,22 @@ import { SquarePen as c } from "../node_modules/lucide-react/dist/esm/icons/squa
10
10
  import { Star as l } from "../node_modules/lucide-react/dist/esm/icons/star.js";
11
11
  import { Users as u } from "../node_modules/lucide-react/dist/esm/icons/users.js";
12
12
  import { X as d } from "../node_modules/lucide-react/dist/esm/icons/x.js";
13
- import { joinPath as f } from "../utils/navigation.js";
14
- import { useMoveTheWheels as p } from "../providers/MoveTheWheelsProvider.js";
15
- import { useOrders as m } from "../hooks/useOrders.js";
16
- import { useCustomer as h, useCustomers as g } from "../hooks/useCustomers.js";
17
- import { Badge as _, Button as v, Card as y, CardContent as b, CardHeader as x, CardTitle as S, Input as C, Label as w, Select as T, SelectContent as E, SelectItem as D, SelectTrigger as O, SelectValue as k } from "../components/ui.js";
18
- import { ErrorState as ee, LoadingState as te, PageLayout as A } from "../components/PageLayout.js";
13
+ import { buildOrderCustomerPath as f, getSafeCustomerReturnPath as p, joinPath as m } from "../utils/navigation.js";
14
+ import { useMoveTheWheels as h } from "../providers/MoveTheWheelsProvider.js";
15
+ import { useOrders as g } from "../hooks/useOrders.js";
16
+ import { useCustomer as _, useCustomers as v } from "../hooks/useCustomers.js";
17
+ import { Badge as y, Button as b, Card as x, CardContent as S, CardHeader as C, CardTitle as w, Input as T, Label as E, Select as D, SelectContent as O, SelectItem as k, SelectTrigger as A, SelectValue as j } from "../components/ui.js";
18
+ import { ErrorState as ee, LoadingState as te, PageLayout as M } from "../components/PageLayout.js";
19
19
  import { StatusBadge as ne, TypeBadge as re } from "../components/StatusBadge.js";
20
- import { FormError as j } from "../components/FormError.js";
20
+ import { FormError as N } from "../components/FormError.js";
21
21
  import { Notice as ie, useNotice as ae } from "../components/Notice.js";
22
- import { formatAddress as M, formatCurrency as N, formatDate as P } from "../utils/formatters.js";
23
- import { useEffect as oe, useState as F } from "react";
24
- import { useParams as se } from "react-router";
25
- import { Fragment as ce, jsx as I, jsxs as L } from "react/jsx-runtime";
26
- import { EmphasisPanel as R, NextSteps as le, PagePurpose as z } from "@burdenoff/fe-libs/ui";
22
+ import { formatAddress as oe, formatCurrency as se, formatDate as P } from "../utils/formatters.js";
23
+ import { useEffect as ce, useState as F } from "react";
24
+ import { useParams as le, useSearchParams as I } from "react-router";
25
+ import { Fragment as ue, jsx as L, jsxs as R } from "react/jsx-runtime";
26
+ import { EmphasisPanel as z, NextSteps as de, PagePurpose as B } from "@burdenoff/fe-libs/ui";
27
27
  //#region src/movethewheels/pages/CustomerDetailsPage.tsx
28
- function ue(e) {
28
+ function fe(e) {
29
29
  if (!e) return null;
30
30
  let t = e.trim(), n = /^https?:\/\//i.test(t) ? t : `https://${t}`;
31
31
  try {
@@ -35,135 +35,135 @@ function ue(e) {
35
35
  return null;
36
36
  }
37
37
  }
38
- function de() {
39
- let { basePath: t, navigate: n } = p(), { createCustomer: r } = g(), [i, a] = F({
38
+ function V() {
39
+ let { basePath: t, navigate: n } = h(), [r] = I(), i = p(r.get("returnTo")), { createCustomer: a } = v(), [o, c] = F({
40
40
  name: "",
41
41
  type: "b2c",
42
42
  email: "",
43
43
  phone: "",
44
44
  company: ""
45
- }), [o, c] = F(!1), [l, d] = F(null), m = () => n?.(f(t, "customers")), h = async (e) => {
46
- if (e.preventDefault(), !i.name.trim()) {
47
- d("Customer name is required.");
45
+ }), [l, d] = F(!1), [g, _] = F(null), y = () => n?.(m(t, "customers")), x = async (e) => {
46
+ if (e.preventDefault(), !o.name.trim()) {
47
+ _("Customer name is required.");
48
48
  return;
49
49
  }
50
- c(!0), d(null);
50
+ d(!0), _(null);
51
51
  try {
52
- let e = await r({
53
- name: i.name.trim(),
54
- type: i.type,
55
- email: i.email.trim() || void 0,
56
- phone: i.phone.trim() || void 0,
57
- company: i.company.trim() || void 0
58
- });
59
- n?.(f(t, `customers/${e.id}`));
52
+ let e = await a({
53
+ name: o.name.trim(),
54
+ type: o.type,
55
+ email: o.email.trim() || void 0,
56
+ phone: o.phone.trim() || void 0,
57
+ company: o.company.trim() || void 0
58
+ }), r = i ? f(i, e.id) : `customers/${e.id}`;
59
+ n?.(m(t, r));
60
60
  } catch (e) {
61
- console.error("Failed to create customer:", e), d(e instanceof Error ? e.message : "Failed to create customer. Please try again."), c(!1);
61
+ console.error("Failed to create customer:", e), _(e instanceof Error ? e.message : "Failed to create customer. Please try again."), d(!1);
62
62
  }
63
63
  };
64
- return /* @__PURE__ */ L(A, {
64
+ return /* @__PURE__ */ R(M, {
65
65
  title: "New Customer",
66
66
  subtitle: "Add a new customer to your account",
67
- icon: /* @__PURE__ */ I(u, { size: 24 }),
68
- headerActions: /* @__PURE__ */ L("div", {
67
+ icon: /* @__PURE__ */ L(u, { size: 24 }),
68
+ headerActions: /* @__PURE__ */ R("div", {
69
69
  className: "flex gap-2",
70
- children: [/* @__PURE__ */ L(v, {
70
+ children: [/* @__PURE__ */ R(b, {
71
71
  variant: "outline",
72
- onClick: m,
73
- disabled: o,
74
- children: [/* @__PURE__ */ I(e, { size: 16 }), " Cancel"]
75
- }), /* @__PURE__ */ L(v, {
76
- onClick: h,
77
- disabled: o,
72
+ onClick: y,
73
+ disabled: l,
74
+ children: [/* @__PURE__ */ L(e, { size: 16 }), " Cancel"]
75
+ }), /* @__PURE__ */ R(b, {
76
+ onClick: x,
77
+ disabled: l,
78
78
  children: [
79
- /* @__PURE__ */ I(s, { size: 16 }),
79
+ /* @__PURE__ */ L(s, { size: 16 }),
80
80
  " ",
81
- o ? "Saving..." : "Create Customer"
81
+ l ? "Saving..." : "Create Customer"
82
82
  ]
83
83
  })]
84
84
  }),
85
- children: [/* @__PURE__ */ I(z, {
86
- icon: /* @__PURE__ */ I(u, { size: 18 }),
85
+ children: [/* @__PURE__ */ L(B, {
86
+ icon: /* @__PURE__ */ L(u, { size: 18 }),
87
87
  children: "Add a customer once and their contact details auto-fill every future order you book for them. Only a name is required — add email, phone and company to make deliveries easier to arrange."
88
- }), /* @__PURE__ */ L("form", {
89
- onSubmit: h,
88
+ }), /* @__PURE__ */ R("form", {
89
+ onSubmit: x,
90
90
  className: "max-w-2xl space-y-6",
91
- children: [/* @__PURE__ */ I(j, { message: l }), /* @__PURE__ */ L(R, { children: [/* @__PURE__ */ I("h2", {
91
+ children: [/* @__PURE__ */ L(N, { message: g }), /* @__PURE__ */ R(z, { children: [/* @__PURE__ */ L("h2", {
92
92
  className: "text-base font-semibold text-text-primary mb-4",
93
93
  children: "Customer Details"
94
- }), /* @__PURE__ */ L("div", {
94
+ }), /* @__PURE__ */ R("div", {
95
95
  className: "space-y-4",
96
96
  children: [
97
- /* @__PURE__ */ L("div", {
97
+ /* @__PURE__ */ R("div", {
98
98
  className: "grid grid-cols-1 md:grid-cols-2 gap-4",
99
- children: [/* @__PURE__ */ L("div", {
99
+ children: [/* @__PURE__ */ R("div", {
100
100
  className: "space-y-2",
101
- children: [/* @__PURE__ */ L(w, {
101
+ children: [/* @__PURE__ */ R(E, {
102
102
  htmlFor: "name",
103
- children: ["Name ", /* @__PURE__ */ I("span", {
103
+ children: ["Name ", /* @__PURE__ */ L("span", {
104
104
  className: "text-status-error-text",
105
105
  children: "*"
106
106
  })]
107
- }), /* @__PURE__ */ I(C, {
107
+ }), /* @__PURE__ */ L(T, {
108
108
  id: "name",
109
- value: i.name,
110
- onChange: (e) => a((t) => ({
109
+ value: o.name,
110
+ onChange: (e) => c((t) => ({
111
111
  ...t,
112
112
  name: e.target.value
113
113
  })),
114
114
  placeholder: "Acme Corp or Jane Doe",
115
115
  required: !0
116
116
  })]
117
- }), /* @__PURE__ */ L("div", {
117
+ }), /* @__PURE__ */ R("div", {
118
118
  className: "space-y-2",
119
- children: [/* @__PURE__ */ I(w, {
119
+ children: [/* @__PURE__ */ L(E, {
120
120
  htmlFor: "type",
121
121
  children: "Customer Type"
122
- }), /* @__PURE__ */ L(T, {
123
- value: i.type,
124
- onValueChange: (e) => a((t) => ({
122
+ }), /* @__PURE__ */ R(D, {
123
+ value: o.type,
124
+ onValueChange: (e) => c((t) => ({
125
125
  ...t,
126
126
  type: e
127
127
  })),
128
- children: [/* @__PURE__ */ I(O, {
128
+ children: [/* @__PURE__ */ L(A, {
129
129
  id: "type",
130
- children: /* @__PURE__ */ I(k, {})
131
- }), /* @__PURE__ */ L(E, { children: [/* @__PURE__ */ I(D, {
130
+ children: /* @__PURE__ */ L(j, {})
131
+ }), /* @__PURE__ */ R(O, { children: [/* @__PURE__ */ L(k, {
132
132
  value: "b2c",
133
133
  children: "B2C (Individual)"
134
- }), /* @__PURE__ */ I(D, {
134
+ }), /* @__PURE__ */ L(k, {
135
135
  value: "b2b",
136
136
  children: "B2B (Business)"
137
137
  })] })]
138
138
  })]
139
139
  })]
140
140
  }),
141
- /* @__PURE__ */ L("div", {
141
+ /* @__PURE__ */ R("div", {
142
142
  className: "grid grid-cols-1 md:grid-cols-2 gap-4",
143
- children: [/* @__PURE__ */ L("div", {
143
+ children: [/* @__PURE__ */ R("div", {
144
144
  className: "space-y-2",
145
- children: [/* @__PURE__ */ I(w, {
145
+ children: [/* @__PURE__ */ L(E, {
146
146
  htmlFor: "email",
147
147
  children: "Email"
148
- }), /* @__PURE__ */ I(C, {
148
+ }), /* @__PURE__ */ L(T, {
149
149
  id: "email",
150
150
  type: "email",
151
- value: i.email,
152
- onChange: (e) => a((t) => ({
151
+ value: o.email,
152
+ onChange: (e) => c((t) => ({
153
153
  ...t,
154
154
  email: e.target.value
155
155
  })),
156
156
  placeholder: "customer@example.com"
157
157
  })]
158
- }), /* @__PURE__ */ L("div", {
158
+ }), /* @__PURE__ */ R("div", {
159
159
  className: "space-y-2",
160
- children: [/* @__PURE__ */ I(w, {
160
+ children: [/* @__PURE__ */ L(E, {
161
161
  htmlFor: "phone",
162
162
  children: "Phone"
163
- }), /* @__PURE__ */ I(C, {
163
+ }), /* @__PURE__ */ L(T, {
164
164
  id: "phone",
165
- value: i.phone,
166
- onChange: (e) => a((t) => ({
165
+ value: o.phone,
166
+ onChange: (e) => c((t) => ({
167
167
  ...t,
168
168
  phone: e.target.value
169
169
  })),
@@ -171,15 +171,15 @@ function de() {
171
171
  })]
172
172
  })]
173
173
  }),
174
- /* @__PURE__ */ L("div", {
174
+ /* @__PURE__ */ R("div", {
175
175
  className: "space-y-2",
176
- children: [/* @__PURE__ */ I(w, {
176
+ children: [/* @__PURE__ */ L(E, {
177
177
  htmlFor: "company",
178
178
  children: "Company"
179
- }), /* @__PURE__ */ I(C, {
179
+ }), /* @__PURE__ */ L(T, {
180
180
  id: "company",
181
- value: i.company,
182
- onChange: (e) => a((t) => ({
181
+ value: o.company,
182
+ onChange: (e) => c((t) => ({
183
183
  ...t,
184
184
  company: e.target.value
185
185
  })),
@@ -191,149 +191,149 @@ function de() {
191
191
  })]
192
192
  });
193
193
  }
194
- function B() {
195
- let { customerId: T } = se(), { basePath: E, navigate: D } = p(), { customer: O, isLoading: k, error: B, refetch: V } = h(T), { updateCustomer: fe } = g(), { orders: H, isLoading: pe } = m({ filters: { customerId: T } }), { message: U, notify: me } = ae(), [W, G] = F(!1), [K, q] = F(!1), [J, Y] = F(null), [X, Z] = F({
194
+ function H() {
195
+ let { customerId: p } = le(), { basePath: D, navigate: O } = h(), { customer: k, isLoading: A, error: j, refetch: I } = _(p), { updateCustomer: H } = v(), { orders: U, isLoading: pe } = g({ filters: { customerId: p } }), { message: W, notify: me } = ae(), [G, K] = F(!1), [q, J] = F(!1), [he, Y] = F(null), [X, Z] = F({
196
196
  name: "",
197
197
  email: "",
198
198
  phone: "",
199
199
  company: ""
200
200
  });
201
- oe(() => {
202
- O && Z({
203
- name: O.name,
204
- email: O.email,
205
- phone: O.phone,
206
- company: O.company ?? ""
201
+ ce(() => {
202
+ k && Z({
203
+ name: k.name,
204
+ email: k.email,
205
+ phone: k.phone,
206
+ company: k.company ?? ""
207
207
  });
208
- }, [O]);
209
- let he = () => D?.(f(E, "customers")), Q = (e) => D?.(f(E, e)), $ = () => {
210
- Y(null), G(!0);
208
+ }, [k]);
209
+ let ge = () => O?.(m(D, "customers")), Q = (e) => O?.(m(D, e)), $ = () => {
210
+ Y(null), K(!0);
211
211
  };
212
- return T ? k ? /* @__PURE__ */ I(te, { message: "Loading customer details..." }) : B || !O ? /* @__PURE__ */ I(ee, {
212
+ return p ? A ? /* @__PURE__ */ L(te, { message: "Loading customer details..." }) : j || !k ? /* @__PURE__ */ L(ee, {
213
213
  title: "Customer not found",
214
- onRetry: V
215
- }) : /* @__PURE__ */ L(A, {
216
- title: O.name,
217
- subtitle: O.company || O.email,
218
- icon: /* @__PURE__ */ I(u, { size: 24 }),
219
- headerActions: /* @__PURE__ */ L("div", {
214
+ onRetry: I
215
+ }) : /* @__PURE__ */ R(M, {
216
+ title: k.name,
217
+ subtitle: k.company || k.email,
218
+ icon: /* @__PURE__ */ L(u, { size: 24 }),
219
+ headerActions: /* @__PURE__ */ R("div", {
220
220
  className: "flex gap-2",
221
- children: [/* @__PURE__ */ L(v, {
221
+ children: [/* @__PURE__ */ R(b, {
222
222
  variant: "outline",
223
- onClick: he,
224
- children: [/* @__PURE__ */ I(e, { size: 16 }), " Back"]
225
- }), W ? /* @__PURE__ */ L(ce, { children: [/* @__PURE__ */ L(v, {
223
+ onClick: ge,
224
+ children: [/* @__PURE__ */ L(e, { size: 16 }), " Back"]
225
+ }), G ? /* @__PURE__ */ R(ue, { children: [/* @__PURE__ */ R(b, {
226
226
  variant: "outline",
227
227
  onClick: () => {
228
- Y(null), G(!1), O && Z({
229
- name: O.name,
230
- email: O.email,
231
- phone: O.phone,
232
- company: O.company ?? ""
228
+ Y(null), K(!1), k && Z({
229
+ name: k.name,
230
+ email: k.email,
231
+ phone: k.phone,
232
+ company: k.company ?? ""
233
233
  });
234
234
  },
235
- disabled: K,
236
- children: [/* @__PURE__ */ I(d, { size: 16 }), " Cancel"]
237
- }), /* @__PURE__ */ L(v, {
235
+ disabled: q,
236
+ children: [/* @__PURE__ */ L(d, { size: 16 }), " Cancel"]
237
+ }), /* @__PURE__ */ R(b, {
238
238
  onClick: async () => {
239
- if (T) {
239
+ if (p) {
240
240
  if (!X.name.trim()) {
241
241
  Y("Customer name is required.");
242
242
  return;
243
243
  }
244
- q(!0), Y(null);
244
+ J(!0), Y(null);
245
245
  try {
246
- await fe(T, {
246
+ await H(p, {
247
247
  name: X.name.trim(),
248
248
  email: X.email.trim(),
249
249
  phone: X.phone.trim(),
250
250
  company: X.company.trim() || void 0
251
- }), me("Customer updated."), G(!1), V();
251
+ }), me("Customer updated."), K(!1), I();
252
252
  } catch (e) {
253
253
  Y(e instanceof Error ? e.message : "Failed to update customer.");
254
254
  } finally {
255
- q(!1);
255
+ J(!1);
256
256
  }
257
257
  }
258
258
  },
259
- disabled: K,
259
+ disabled: q,
260
260
  children: [
261
- /* @__PURE__ */ I(s, { size: 16 }),
261
+ /* @__PURE__ */ L(s, { size: 16 }),
262
262
  " ",
263
- K ? "Saving…" : "Save"
263
+ q ? "Saving…" : "Save"
264
264
  ]
265
- })] }) : /* @__PURE__ */ L(v, {
265
+ })] }) : /* @__PURE__ */ R(b, {
266
266
  onClick: $,
267
- children: [/* @__PURE__ */ I(c, { size: 16 }), " Edit"]
267
+ children: [/* @__PURE__ */ L(c, { size: 16 }), " Edit"]
268
268
  })]
269
269
  }),
270
- headerContent: /* @__PURE__ */ L("div", {
270
+ headerContent: /* @__PURE__ */ R("div", {
271
271
  className: "flex items-center gap-4",
272
272
  children: [
273
- /* @__PURE__ */ I(re, { type: O.type }),
274
- /* @__PURE__ */ I(_, {
275
- variant: O.isActive ? "default" : "secondary",
276
- children: O.isActive ? "Active" : "Inactive"
273
+ /* @__PURE__ */ L(re, { type: k.type }),
274
+ /* @__PURE__ */ L(y, {
275
+ variant: k.isActive ? "default" : "secondary",
276
+ children: k.isActive ? "Active" : "Inactive"
277
277
  }),
278
- /* @__PURE__ */ L("div", {
278
+ /* @__PURE__ */ R("div", {
279
279
  className: "flex items-center gap-1",
280
- children: [/* @__PURE__ */ I(l, {
280
+ children: [/* @__PURE__ */ L(l, {
281
281
  size: 16,
282
282
  className: "text-status-warning-text fill-current"
283
- }), /* @__PURE__ */ I("span", {
283
+ }), /* @__PURE__ */ L("span", {
284
284
  className: "font-medium",
285
- children: O.rating.toFixed(1)
285
+ children: k.rating.toFixed(1)
286
286
  })]
287
287
  })
288
288
  ]
289
289
  }),
290
290
  children: [
291
- /* @__PURE__ */ I(z, {
292
- icon: /* @__PURE__ */ I(u, { size: 18 }),
291
+ /* @__PURE__ */ L(B, {
292
+ icon: /* @__PURE__ */ L(u, { size: 18 }),
293
293
  children: "Everything you know about this customer — how to reach them, where they are, and their account standing. Use it to confirm contact details before a delivery, check their rating, or book their next order."
294
294
  }),
295
- /* @__PURE__ */ I(le, {
295
+ /* @__PURE__ */ L(de, {
296
296
  storageKey: "movethewheels-customer-details",
297
297
  steps: [{
298
298
  id: "new-order",
299
299
  label: "Book a delivery for this customer",
300
300
  description: "Start a new order pre-filled for this account.",
301
- icon: /* @__PURE__ */ I(n, { size: 16 }),
302
- onClick: () => Q("orders/new")
301
+ icon: /* @__PURE__ */ L(n, { size: 16 }),
302
+ onClick: () => Q(f("orders/new", k.id))
303
303
  }, {
304
304
  id: "edit",
305
305
  label: "Update contact details",
306
306
  description: "Keep email, phone and address current.",
307
- icon: /* @__PURE__ */ I(c, { size: 16 }),
307
+ icon: /* @__PURE__ */ L(c, { size: 16 }),
308
308
  onClick: $
309
309
  }]
310
310
  }),
311
- U && /* @__PURE__ */ I("div", {
311
+ W && /* @__PURE__ */ L("div", {
312
312
  className: "mb-2",
313
- children: /* @__PURE__ */ I(ie, { message: U })
313
+ children: /* @__PURE__ */ L(ie, { message: W })
314
314
  }),
315
- /* @__PURE__ */ L("div", {
315
+ /* @__PURE__ */ R("div", {
316
316
  className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
317
- children: [/* @__PURE__ */ L("div", {
317
+ children: [/* @__PURE__ */ R("div", {
318
318
  className: "lg:col-span-2 space-y-6",
319
319
  children: [
320
- /* @__PURE__ */ L(R, { children: [/* @__PURE__ */ I("h2", {
320
+ /* @__PURE__ */ R(z, { children: [/* @__PURE__ */ L("h2", {
321
321
  className: "text-base font-semibold text-text-primary mb-4",
322
322
  children: "Contact Information"
323
- }), W ? /* @__PURE__ */ L("div", {
323
+ }), G ? /* @__PURE__ */ R("div", {
324
324
  className: "space-y-4",
325
- children: [/* @__PURE__ */ I(j, { message: J }), /* @__PURE__ */ L("div", {
325
+ children: [/* @__PURE__ */ L(N, { message: he }), /* @__PURE__ */ R("div", {
326
326
  className: "grid grid-cols-1 md:grid-cols-2 gap-4",
327
327
  children: [
328
- /* @__PURE__ */ L("div", {
328
+ /* @__PURE__ */ R("div", {
329
329
  className: "space-y-2",
330
- children: [/* @__PURE__ */ L(w, {
330
+ children: [/* @__PURE__ */ R(E, {
331
331
  htmlFor: "edit-name",
332
- children: ["Name ", /* @__PURE__ */ I("span", {
332
+ children: ["Name ", /* @__PURE__ */ L("span", {
333
333
  className: "text-status-error-text",
334
334
  children: "*"
335
335
  })]
336
- }), /* @__PURE__ */ I(C, {
336
+ }), /* @__PURE__ */ L(T, {
337
337
  id: "edit-name",
338
338
  value: X.name,
339
339
  onChange: (e) => Z((t) => ({
@@ -342,12 +342,12 @@ function B() {
342
342
  }))
343
343
  })]
344
344
  }),
345
- /* @__PURE__ */ L("div", {
345
+ /* @__PURE__ */ R("div", {
346
346
  className: "space-y-2",
347
- children: [/* @__PURE__ */ I(w, {
347
+ children: [/* @__PURE__ */ L(E, {
348
348
  htmlFor: "edit-company",
349
349
  children: "Company"
350
- }), /* @__PURE__ */ I(C, {
350
+ }), /* @__PURE__ */ L(T, {
351
351
  id: "edit-company",
352
352
  value: X.company,
353
353
  onChange: (e) => Z((t) => ({
@@ -357,12 +357,12 @@ function B() {
357
357
  placeholder: "Company name (for B2B accounts)"
358
358
  })]
359
359
  }),
360
- /* @__PURE__ */ L("div", {
360
+ /* @__PURE__ */ R("div", {
361
361
  className: "space-y-2",
362
- children: [/* @__PURE__ */ I(w, {
362
+ children: [/* @__PURE__ */ L(E, {
363
363
  htmlFor: "edit-email",
364
364
  children: "Email"
365
- }), /* @__PURE__ */ I(C, {
365
+ }), /* @__PURE__ */ L(T, {
366
366
  id: "edit-email",
367
367
  type: "email",
368
368
  value: X.email,
@@ -372,12 +372,12 @@ function B() {
372
372
  }))
373
373
  })]
374
374
  }),
375
- /* @__PURE__ */ L("div", {
375
+ /* @__PURE__ */ R("div", {
376
376
  className: "space-y-2",
377
- children: [/* @__PURE__ */ I(w, {
377
+ children: [/* @__PURE__ */ L(E, {
378
378
  htmlFor: "edit-phone",
379
379
  children: "Phone"
380
- }), /* @__PURE__ */ I(C, {
380
+ }), /* @__PURE__ */ L(T, {
381
381
  id: "edit-phone",
382
382
  value: X.phone,
383
383
  onChange: (e) => Z((t) => ({
@@ -388,55 +388,55 @@ function B() {
388
388
  })
389
389
  ]
390
390
  })]
391
- }) : /* @__PURE__ */ L("div", {
391
+ }) : /* @__PURE__ */ R("div", {
392
392
  className: "grid grid-cols-1 md:grid-cols-2 gap-6",
393
- children: [/* @__PURE__ */ L("div", {
393
+ children: [/* @__PURE__ */ R("div", {
394
394
  className: "space-y-4",
395
- children: [/* @__PURE__ */ L("div", {
395
+ children: [/* @__PURE__ */ R("div", {
396
396
  className: "flex items-center gap-3",
397
- children: [/* @__PURE__ */ I(r, {
397
+ children: [/* @__PURE__ */ L(r, {
398
398
  size: 18,
399
399
  className: "text-text-secondary"
400
- }), /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
400
+ }), /* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L("p", {
401
401
  className: "text-sm text-text-secondary",
402
402
  children: "Email"
403
- }), /* @__PURE__ */ I("p", {
403
+ }), /* @__PURE__ */ L("p", {
404
404
  className: "font-medium",
405
- children: O.email || "—"
405
+ children: k.email || "—"
406
406
  })] })]
407
- }), /* @__PURE__ */ L("div", {
407
+ }), /* @__PURE__ */ R("div", {
408
408
  className: "flex items-center gap-3",
409
- children: [/* @__PURE__ */ I(o, {
409
+ children: [/* @__PURE__ */ L(o, {
410
410
  size: 18,
411
411
  className: "text-text-secondary"
412
- }), /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
412
+ }), /* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L("p", {
413
413
  className: "text-sm text-text-secondary",
414
414
  children: "Phone"
415
- }), /* @__PURE__ */ I("p", {
415
+ }), /* @__PURE__ */ L("p", {
416
416
  className: "font-medium",
417
- children: O.phone || "—"
417
+ children: k.phone || "—"
418
418
  })] })]
419
419
  })]
420
- }), /* @__PURE__ */ L("div", {
420
+ }), /* @__PURE__ */ R("div", {
421
421
  className: "space-y-4",
422
- children: [O.company && /* @__PURE__ */ L("div", {
422
+ children: [k.company && /* @__PURE__ */ R("div", {
423
423
  className: "flex items-center gap-3",
424
- children: [/* @__PURE__ */ I(t, {
424
+ children: [/* @__PURE__ */ L(t, {
425
425
  size: 18,
426
426
  className: "text-text-secondary"
427
- }), /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
427
+ }), /* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L("p", {
428
428
  className: "text-sm text-text-secondary",
429
429
  children: "Company"
430
- }), /* @__PURE__ */ I("p", {
430
+ }), /* @__PURE__ */ L("p", {
431
431
  className: "font-medium",
432
- children: O.company
432
+ children: k.company
433
433
  })] })]
434
434
  }), (() => {
435
- let e = ue(O.website);
436
- return e ? /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
435
+ let e = fe(k.website);
436
+ return e ? /* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L("p", {
437
437
  className: "text-sm text-text-secondary",
438
438
  children: "Website"
439
- }), /* @__PURE__ */ I("a", {
439
+ }), /* @__PURE__ */ L("a", {
440
440
  href: e,
441
441
  target: "_blank",
442
442
  rel: "noopener noreferrer",
@@ -446,122 +446,122 @@ function B() {
446
446
  })()]
447
447
  })]
448
448
  })] }),
449
- /* @__PURE__ */ L(y, { children: [/* @__PURE__ */ I(x, { children: /* @__PURE__ */ L(S, {
449
+ /* @__PURE__ */ R(x, { children: [/* @__PURE__ */ L(C, { children: /* @__PURE__ */ R(w, {
450
450
  className: "flex items-center gap-2",
451
- children: [/* @__PURE__ */ I(i, { size: 18 }), " Address"]
452
- }) }), /* @__PURE__ */ I(b, { children: /* @__PURE__ */ I("p", { children: M(O.address) }) })] }),
453
- O.notes && /* @__PURE__ */ L(y, { children: [/* @__PURE__ */ I(x, { children: /* @__PURE__ */ L(S, {
451
+ children: [/* @__PURE__ */ L(i, { size: 18 }), " Address"]
452
+ }) }), /* @__PURE__ */ L(S, { children: /* @__PURE__ */ L("p", { children: oe(k.address) }) })] }),
453
+ k.notes && /* @__PURE__ */ R(x, { children: [/* @__PURE__ */ L(C, { children: /* @__PURE__ */ R(w, {
454
454
  className: "flex items-center gap-2",
455
- children: [/* @__PURE__ */ I(n, { size: 18 }), " Notes"]
456
- }) }), /* @__PURE__ */ I(b, { children: /* @__PURE__ */ I("p", { children: O.notes }) })] }),
457
- /* @__PURE__ */ L(y, { children: [/* @__PURE__ */ L(x, {
455
+ children: [/* @__PURE__ */ L(n, { size: 18 }), " Notes"]
456
+ }) }), /* @__PURE__ */ L(S, { children: /* @__PURE__ */ L("p", { children: k.notes }) })] }),
457
+ /* @__PURE__ */ R(x, { children: [/* @__PURE__ */ R(C, {
458
458
  className: "flex flex-row items-center justify-between",
459
- children: [/* @__PURE__ */ L(S, {
459
+ children: [/* @__PURE__ */ R(w, {
460
460
  className: "flex items-center gap-2",
461
- children: [/* @__PURE__ */ I(a, { size: 18 }), " Orders"]
462
- }), /* @__PURE__ */ L(v, {
461
+ children: [/* @__PURE__ */ L(a, { size: 18 }), " Orders"]
462
+ }), /* @__PURE__ */ R(b, {
463
463
  variant: "outline",
464
464
  size: "sm",
465
- onClick: () => Q("orders/new"),
466
- children: [/* @__PURE__ */ I(n, { size: 14 }), " New order"]
465
+ onClick: () => Q(f("orders/new", k.id)),
466
+ children: [/* @__PURE__ */ L(n, { size: 14 }), " New order"]
467
467
  })]
468
- }), /* @__PURE__ */ I(b, { children: pe ? /* @__PURE__ */ I("p", {
468
+ }), /* @__PURE__ */ L(S, { children: pe ? /* @__PURE__ */ L("p", {
469
469
  className: "text-text-secondary text-center py-4",
470
470
  children: "Loading orders…"
471
- }) : H.length > 0 ? /* @__PURE__ */ I("div", {
471
+ }) : U.length > 0 ? /* @__PURE__ */ L("div", {
472
472
  className: "space-y-2",
473
- children: H.map((e) => /* @__PURE__ */ L("button", {
473
+ children: U.map((e) => /* @__PURE__ */ R("button", {
474
474
  type: "button",
475
475
  onClick: () => Q(`orders/${e.id}`),
476
476
  className: "w-full flex items-center justify-between gap-3 p-3 border rounded-lg text-left hover:bg-bg-sunken/50 transition-colors",
477
- children: [/* @__PURE__ */ L("div", {
477
+ children: [/* @__PURE__ */ R("div", {
478
478
  className: "min-w-0",
479
- children: [/* @__PURE__ */ I("p", {
479
+ children: [/* @__PURE__ */ L("p", {
480
480
  className: "font-medium truncate",
481
481
  children: e.orderNumber
482
- }), /* @__PURE__ */ L("p", {
482
+ }), /* @__PURE__ */ R("p", {
483
483
  className: "text-sm text-text-secondary",
484
484
  children: [
485
485
  P(e.createdAt, "relative"),
486
486
  " ·",
487
487
  " ",
488
- N(e.pricing.total)
488
+ se(e.pricing.total)
489
489
  ]
490
490
  })]
491
- }), /* @__PURE__ */ I(ne, {
491
+ }), /* @__PURE__ */ L(ne, {
492
492
  status: e.status,
493
493
  type: "order",
494
494
  size: "sm"
495
495
  })]
496
496
  }, e.id))
497
- }) : /* @__PURE__ */ L("div", {
497
+ }) : /* @__PURE__ */ R("div", {
498
498
  className: "text-center py-6",
499
499
  children: [
500
- /* @__PURE__ */ I(a, {
500
+ /* @__PURE__ */ L(a, {
501
501
  size: 32,
502
502
  className: "mx-auto mb-2 text-text-secondary opacity-50"
503
503
  }),
504
- /* @__PURE__ */ I("p", {
504
+ /* @__PURE__ */ L("p", {
505
505
  className: "text-text-secondary",
506
506
  children: "No orders yet for this customer"
507
507
  }),
508
- /* @__PURE__ */ I("button", {
508
+ /* @__PURE__ */ L("button", {
509
509
  type: "button",
510
- onClick: () => Q("orders/new"),
510
+ onClick: () => Q(f("orders/new", k.id)),
511
511
  className: "mt-1 text-sm text-primary hover:underline",
512
512
  children: "Book their first delivery"
513
513
  })
514
514
  ]
515
515
  }) })] })
516
516
  ]
517
- }), /* @__PURE__ */ L("div", {
517
+ }), /* @__PURE__ */ R("div", {
518
518
  className: "space-y-6",
519
- children: [/* @__PURE__ */ L(y, { children: [/* @__PURE__ */ I(x, { children: /* @__PURE__ */ I(S, { children: "Business Details" }) }), /* @__PURE__ */ L(b, {
519
+ children: [/* @__PURE__ */ R(x, { children: [/* @__PURE__ */ L(C, { children: /* @__PURE__ */ L(w, { children: "Business Details" }) }), /* @__PURE__ */ R(S, {
520
520
  className: "space-y-3",
521
521
  children: [
522
- O.businessLicense && /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
522
+ k.businessLicense && /* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L("p", {
523
523
  className: "text-sm text-text-secondary",
524
524
  children: "Business License"
525
- }), /* @__PURE__ */ I("p", {
525
+ }), /* @__PURE__ */ L("p", {
526
526
  className: "font-mono",
527
- children: O.businessLicense
527
+ children: k.businessLicense
528
528
  })] }),
529
- O.taxId && /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
529
+ k.taxId && /* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L("p", {
530
530
  className: "text-sm text-text-secondary",
531
531
  children: "Tax ID"
532
- }), /* @__PURE__ */ I("p", {
532
+ }), /* @__PURE__ */ L("p", {
533
533
  className: "font-mono",
534
- children: O.taxId
534
+ children: k.taxId
535
535
  })] }),
536
- /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
536
+ /* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L("p", {
537
537
  className: "text-sm text-text-secondary",
538
538
  children: "Preferred Contact"
539
- }), /* @__PURE__ */ I("p", {
539
+ }), /* @__PURE__ */ L("p", {
540
540
  className: "capitalize",
541
- children: O.preferredContactMethod
541
+ children: k.preferredContactMethod
542
542
  })] }),
543
- /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
543
+ /* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L("p", {
544
544
  className: "text-sm text-text-secondary",
545
545
  children: "Marketing Opt-in"
546
- }), /* @__PURE__ */ I(_, {
547
- variant: O.marketingOptIn ? "default" : "secondary",
548
- children: O.marketingOptIn ? "Yes" : "No"
546
+ }), /* @__PURE__ */ L(y, {
547
+ variant: k.marketingOptIn ? "default" : "secondary",
548
+ children: k.marketingOptIn ? "Yes" : "No"
549
549
  })] })
550
550
  ]
551
- })] }), /* @__PURE__ */ L(y, { children: [/* @__PURE__ */ I(x, { children: /* @__PURE__ */ I(S, { children: "Account Info" }) }), /* @__PURE__ */ L(b, {
551
+ })] }), /* @__PURE__ */ R(x, { children: [/* @__PURE__ */ L(C, { children: /* @__PURE__ */ L(w, { children: "Account Info" }) }), /* @__PURE__ */ R(S, {
552
552
  className: "space-y-3",
553
- children: [/* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
553
+ children: [/* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L("p", {
554
554
  className: "text-sm text-text-secondary",
555
555
  children: "Created"
556
- }), /* @__PURE__ */ I("p", { children: P(O.createdAt, "full") })] }), /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
556
+ }), /* @__PURE__ */ L("p", { children: P(k.createdAt, "full") })] }), /* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L("p", {
557
557
  className: "text-sm text-text-secondary",
558
558
  children: "Last Updated"
559
- }), /* @__PURE__ */ I("p", { children: P(O.updatedAt, "relative") })] })]
559
+ }), /* @__PURE__ */ L("p", { children: P(k.updatedAt, "relative") })] })]
560
560
  })] })]
561
561
  })]
562
562
  })
563
563
  ]
564
- }) : /* @__PURE__ */ I(de, {});
564
+ }) : /* @__PURE__ */ L(V, {});
565
565
  }
566
566
  //#endregion
567
- export { B as default };
567
+ export { H as default };