@burdenoff/microfe-movethewheels 2026.1114.1 → 2026.1123.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 (70) hide show
  1. package/dist/MoveTheWheelsRoot.js +149 -133
  2. package/dist/MoveTheWheelsRoutes.js +157 -139
  3. package/dist/components/EntityConversationsCard.js +145 -0
  4. package/dist/components/maps/MapCanvas.js +4 -3
  5. package/dist/events/rybbit.js +87 -0
  6. package/dist/generated/tracking-quality-operations.d.ts +342 -0
  7. package/dist/hooks/useEntityComments.js +111 -0
  8. package/dist/hooks/useFleet.js +394 -311
  9. package/dist/hooks/useInventory.js +378 -313
  10. package/dist/hooks/useMultiModalShipments.js +58 -53
  11. package/dist/hooks/useOrders.js +178 -158
  12. package/dist/hooks/useRoutes.js +146 -130
  13. package/dist/index.js +35 -34
  14. package/dist/movethewheels/components/EntityConversationsCard.d.ts +8 -0
  15. package/dist/movethewheels/events/rybbit.d.ts +27 -0
  16. package/dist/movethewheels/hooks/useEntityComments.d.ts +26 -0
  17. package/dist/movethewheels/hooks/useFleet.d.ts +73 -1
  18. package/dist/movethewheels/hooks/useInventory.d.ts +19 -0
  19. package/dist/movethewheels/index.d.ts +1 -0
  20. package/dist/movethewheels/pages/DocumentsLibraryPage.d.ts +1 -0
  21. package/dist/movethewheels/pages/NotificationsCenterPage.d.ts +1 -0
  22. package/dist/movethewheels/types/index.d.ts +95 -2
  23. package/dist/node_modules/lucide-react/dist/esm/icons/check-check.js +10 -0
  24. package/dist/node_modules/lucide-react/dist/esm/icons/layers.js +17 -0
  25. package/dist/node_modules/lucide-react/dist/esm/icons/message-square.js +7 -0
  26. package/dist/node_modules/lucide-react/dist/esm/icons/send.js +10 -0
  27. package/dist/pages/DocumentsLibraryPage.js +235 -0
  28. package/dist/pages/DriverDetailsPage.js +625 -351
  29. package/dist/pages/NotificationsCenterPage.js +310 -0
  30. package/dist/pages/OrderDetailsPage.js +48 -42
  31. package/dist/pages/RouteDetailsPage.js +257 -251
  32. package/dist/pages/TrackingPage.js +202 -196
  33. package/dist/pages/VehicleDetailsPage.js +616 -314
  34. package/dist/pages/WarehouseDetailsPage.js +539 -253
  35. package/dist/stories/ControlTowerWidgets.stories.d.ts +10 -0
  36. package/dist/stories/DataTable.stories.d.ts +15 -0
  37. package/dist/stories/FleetCards.stories.d.ts +9 -0
  38. package/dist/stories/OrderForms.stories.d.ts +8 -0
  39. package/dist/stories/RouteMap.stories.d.ts +7 -0
  40. package/dist/stories/ShipmentTimeline.stories.d.ts +6 -0
  41. package/package.json +3 -2
  42. package/src/generated/tracking-quality-operations.ts +407 -0
  43. package/src/movethewheels/MoveTheWheelsRoot.tsx +16 -0
  44. package/src/movethewheels/MoveTheWheelsRoutes.tsx +17 -2
  45. package/src/movethewheels/components/EntityConversationsCard.tsx +143 -0
  46. package/src/movethewheels/components/maps/MapCanvas.tsx +3 -3
  47. package/src/movethewheels/events/__tests__/rybbit.test.ts +98 -0
  48. package/src/movethewheels/events/rybbit.ts +191 -0
  49. package/src/movethewheels/hooks/useEntityComments.ts +258 -0
  50. package/src/movethewheels/hooks/useFleet.ts +300 -5
  51. package/src/movethewheels/hooks/useInventory.ts +231 -3
  52. package/src/movethewheels/hooks/useMultiModalShipments.ts +8 -1
  53. package/src/movethewheels/hooks/useOrders.ts +19 -3
  54. package/src/movethewheels/hooks/useRoutes.ts +14 -2
  55. package/src/movethewheels/index.ts +1 -0
  56. package/src/movethewheels/pages/DocumentsLibraryPage.tsx +229 -0
  57. package/src/movethewheels/pages/DriverDetailsPage.tsx +250 -1
  58. package/src/movethewheels/pages/NotificationsCenterPage.tsx +331 -0
  59. package/src/movethewheels/pages/OrderDetailsPage.tsx +8 -0
  60. package/src/movethewheels/pages/RouteDetailsPage.tsx +6 -0
  61. package/src/movethewheels/pages/TrackingPage.tsx +8 -0
  62. package/src/movethewheels/pages/VehicleDetailsPage.tsx +255 -1
  63. package/src/movethewheels/pages/WarehouseDetailsPage.tsx +266 -2
  64. package/src/movethewheels/types/index.ts +103 -2
  65. package/src/stories/ControlTowerWidgets.stories.tsx +150 -0
  66. package/src/stories/DataTable.stories.tsx +94 -0
  67. package/src/stories/FleetCards.stories.tsx +77 -0
  68. package/src/stories/OrderForms.stories.tsx +84 -0
  69. package/src/stories/RouteMap.stories.tsx +43 -0
  70. package/src/stories/ShipmentTimeline.stories.tsx +128 -0
@@ -2,23 +2,26 @@ import e from "../node_modules/lucide-react/dist/esm/icons/warehouse.js";
2
2
  import t from "../node_modules/lucide-react/dist/esm/icons/arrow-left.js";
3
3
  import n from "../node_modules/lucide-react/dist/esm/icons/square-pen.js";
4
4
  import r from "../node_modules/lucide-react/dist/esm/icons/map-pin.js";
5
- import i from "../node_modules/lucide-react/dist/esm/icons/clock.js";
6
- import a from "../node_modules/lucide-react/dist/esm/icons/box.js";
7
- import o from "../node_modules/lucide-react/dist/esm/icons/save.js";
8
- import s from "../node_modules/lucide-react/dist/esm/icons/trash-2.js";
9
- import { ErrorState as c, LoadingState as l, PageLayout as u } from "../components/PageLayout.js";
5
+ import ee from "../node_modules/lucide-react/dist/esm/icons/clock.js";
6
+ import i from "../node_modules/lucide-react/dist/esm/icons/box.js";
7
+ import a from "../node_modules/lucide-react/dist/esm/icons/save.js";
8
+ import o from "../node_modules/lucide-react/dist/esm/icons/trash-2.js";
9
+ import s from "../node_modules/lucide-react/dist/esm/icons/layers.js";
10
+ import te from "../node_modules/lucide-react/dist/esm/icons/users.js";
11
+ import c from "../node_modules/lucide-react/dist/esm/icons/plus.js";
12
+ import { ErrorState as ne, LoadingState as l, PageLayout as u } from "../components/PageLayout.js";
10
13
  import { Badge as d, Button as f, Card as p, CardContent as m, CardHeader as h, CardTitle as g, Input as _, Label as v, Progress as y, Select as b, SelectContent as x, SelectItem as S, SelectTrigger as C, SelectValue as w } from "../components/ui.js";
11
- import { useInventory as T, useWarehouse as E } from "../hooks/useInventory.js";
12
- import { useMoveTheWheels as D } from "../providers/MoveTheWheelsProvider.js";
13
- import { formatAddress as O } from "../utils/formatters.js";
14
- import { joinPath as k } from "../utils/navigation.js";
15
- import { FormError as A } from "../components/FormError.js";
16
- import { useEffect as j, useState as M } from "react";
17
- import { useLocation as N, useParams as P } from "react-router";
18
- import { Fragment as F, jsx as I, jsxs as L } from "react/jsx-runtime";
19
- import { EmphasisPanel as R, NextSteps as z, PagePurpose as B, ResponsiveDialog as V, ResponsiveDialogContent as H, ResponsiveDialogDescription as U, ResponsiveDialogFooter as ee, ResponsiveDialogHeader as te, ResponsiveDialogTitle as ne } from "@burdenoff/fe-libs/ui";
14
+ import { useInventory as T, useWarehouse as re } from "../hooks/useInventory.js";
15
+ import { useMoveTheWheels as E } from "../providers/MoveTheWheelsProvider.js";
16
+ import { formatAddress as D } from "../utils/formatters.js";
17
+ import { joinPath as O } from "../utils/navigation.js";
18
+ import { FormError as k } from "../components/FormError.js";
19
+ import { useEffect as A, useState as j } from "react";
20
+ import { useLocation as M, useParams as N } from "react-router";
21
+ import { Fragment as ie, jsx as P, jsxs as F } from "react/jsx-runtime";
22
+ import { EmphasisPanel as I, NextSteps as L, PagePurpose as R, ResponsiveDialog as z, ResponsiveDialogContent as B, ResponsiveDialogDescription as V, ResponsiveDialogFooter as H, ResponsiveDialogHeader as U, ResponsiveDialogTitle as W } from "@burdenoff/fe-libs/ui";
20
23
  // src/movethewheels/pages/WarehouseDetailsPage.tsx
21
- var re = [
24
+ var ae = [
22
25
  {
23
26
  value: "DISTRIBUTION",
24
27
  label: "Distribution"
@@ -39,15 +42,15 @@ var re = [
39
42
  value: "RETAIL",
40
43
  label: "Retail"
41
44
  }
42
- ], ie = [{
45
+ ], oe = [{
43
46
  value: "ACTIVE",
44
47
  label: "Active"
45
48
  }, {
46
49
  value: "INACTIVE",
47
50
  label: "Inactive"
48
51
  }];
49
- function W({ editId: n, onSaved: i }) {
50
- let { basePath: a, navigate: c } = D(), { createWarehouse: l, updateWarehouse: d, deleteWarehouse: y } = T(), { warehouse: O } = E(n), N = !!n, [P, F] = M({
52
+ function G({ editId: n, onSaved: ee }) {
53
+ let { basePath: i, navigate: s } = E(), { createWarehouse: te, updateWarehouse: c, deleteWarehouse: ne } = T(), { warehouse: l } = re(n), d = !!n, [y, D] = j({
51
54
  code: "",
52
55
  name: "",
53
56
  type: "DISTRIBUTION",
@@ -61,149 +64,149 @@ function W({ editId: n, onSaved: i }) {
61
64
  usedCapacity: "",
62
65
  contactEmail: "",
63
66
  contactPhone: ""
64
- }), [z, W] = M(!1), [G, K] = M(null), [ae, q] = M(!1), [J, Y] = M(!1), [oe, X] = M(null);
65
- j(() => {
66
- n && O && F({
67
- code: O.code || "",
68
- name: O.name || "",
69
- type: O.type ? O.type.toUpperCase() : "DISTRIBUTION",
70
- status: O.status ?? "",
71
- street: O.address.street ?? "",
72
- city: O.address.city ?? "",
73
- state: O.address.state ?? "",
74
- postalCode: O.address.postalCode ?? "",
75
- country: O.address.country ?? "",
76
- totalCapacity: O.capacity.totalSpace === void 0 ? "" : String(O.capacity.totalSpace),
77
- usedCapacity: O.capacity.usedSpace === void 0 ? "" : String(O.capacity.usedSpace),
78
- contactEmail: O.contactInfo?.email || "",
79
- contactPhone: O.contactInfo?.phone || ""
67
+ }), [M, N] = j(!1), [ie, L] = j(null), [G, K] = j(!1), [q, J] = j(!1), [Y, X] = j(null);
68
+ A(() => {
69
+ n && l && D({
70
+ code: l.code || "",
71
+ name: l.name || "",
72
+ type: l.type ? l.type.toUpperCase() : "DISTRIBUTION",
73
+ status: l.status ?? "",
74
+ street: l.address.street ?? "",
75
+ city: l.address.city ?? "",
76
+ state: l.address.state ?? "",
77
+ postalCode: l.address.postalCode ?? "",
78
+ country: l.address.country ?? "",
79
+ totalCapacity: l.capacity.totalSpace === void 0 ? "" : String(l.capacity.totalSpace),
80
+ usedCapacity: l.capacity.usedSpace === void 0 ? "" : String(l.capacity.usedSpace),
81
+ contactEmail: l.contactInfo?.email || "",
82
+ contactPhone: l.contactInfo?.phone || ""
80
83
  });
81
- }, [n, O]);
82
- let Z = () => c?.(k(a, "inventory/warehouses")), Q = (e, t) => F((n) => ({
84
+ }, [n, l]);
85
+ let Z = () => s?.(O(i, "inventory/warehouses")), Q = (e, t) => D((n) => ({
83
86
  ...n,
84
87
  [e]: t
85
88
  })), $ = async (e) => {
86
- if (e.preventDefault(), !P.code.trim() || !P.name.trim()) K("Warehouse code and name are required.");
87
- else if (!P.street.trim() || !P.city.trim()) K("A street and city are required for the warehouse address.");
89
+ if (e.preventDefault(), !y.code.trim() || !y.name.trim()) L("Warehouse code and name are required.");
90
+ else if (!y.street.trim() || !y.city.trim()) L("A street and city are required for the warehouse address.");
88
91
  else {
89
- W(!0), K(null);
92
+ N(!0), L(null);
90
93
  try {
91
- let e = P.totalCapacity.trim() ? Number(P.totalCapacity) : void 0, t = P.usedCapacity.trim() ? Number(P.usedCapacity) : void 0, r = Object.fromEntries(Object.entries({
92
- street: P.street.trim(),
93
- city: P.city.trim(),
94
- state: P.state.trim(),
95
- postalCode: P.postalCode.trim(),
96
- country: P.country.trim()
97
- }).filter(([, e]) => e.length > 0)), o = {
98
- code: P.code.trim(),
99
- name: P.name.trim(),
100
- type: P.type,
101
- status: P.status.trim() || void 0,
94
+ let e = y.totalCapacity.trim() ? Number(y.totalCapacity) : void 0, t = y.usedCapacity.trim() ? Number(y.usedCapacity) : void 0, r = Object.fromEntries(Object.entries({
95
+ street: y.street.trim(),
96
+ city: y.city.trim(),
97
+ state: y.state.trim(),
98
+ postalCode: y.postalCode.trim(),
99
+ country: y.country.trim()
100
+ }).filter(([, e]) => e.length > 0)), a = {
101
+ code: y.code.trim(),
102
+ name: y.name.trim(),
103
+ type: y.type,
104
+ status: y.status.trim() || void 0,
102
105
  address: r,
103
- contactInfo: P.contactEmail.trim() || P.contactPhone.trim() ? {
104
- email: P.contactEmail.trim() || void 0,
105
- phone: P.contactPhone.trim() || void 0
106
+ contactInfo: y.contactEmail.trim() || y.contactPhone.trim() ? {
107
+ email: y.contactEmail.trim() || void 0,
108
+ phone: y.contactPhone.trim() || void 0
106
109
  } : void 0,
107
110
  totalCapacity: e !== void 0 && !Number.isNaN(e) ? e : void 0,
108
111
  usedCapacity: t !== void 0 && !Number.isNaN(t) ? t : void 0
109
112
  };
110
- if (n) await d(n, o), await i?.(), c?.(k(a, `inventory/warehouses/${n}`));
113
+ if (n) await c(n, a), await ee?.(), s?.(O(i, `inventory/warehouses/${n}`));
111
114
  else {
112
- let e = await l(o);
113
- c?.(k(a, `inventory/warehouses/${e.id}`));
115
+ let e = await te(a);
116
+ s?.(O(i, `inventory/warehouses/${e.id}`));
114
117
  }
115
118
  } catch (e) {
116
- console.error("Failed to create warehouse:", e), K(e instanceof Error ? e.message : "Failed to create warehouse. Please try again."), W(!1);
119
+ console.error("Failed to create warehouse:", e), L(e instanceof Error ? e.message : "Failed to create warehouse. Please try again."), N(!1);
117
120
  }
118
121
  }
119
122
  };
120
- return /* @__PURE__ */ L(u, {
121
- title: N ? "Edit Warehouse" : "Add Warehouse",
123
+ return /* @__PURE__ */ F(u, {
124
+ title: d ? "Edit Warehouse" : "Add Warehouse",
122
125
  subtitle: "Register a storage and fulfilment site",
123
- icon: /* @__PURE__ */ I(e, { size: 24 }),
124
- headerActions: /* @__PURE__ */ L("div", {
126
+ icon: /* @__PURE__ */ P(e, { size: 24 }),
127
+ headerActions: /* @__PURE__ */ F("div", {
125
128
  className: "flex gap-2",
126
- children: [/* @__PURE__ */ L(f, {
129
+ children: [/* @__PURE__ */ F(f, {
127
130
  variant: "outline",
128
131
  onClick: Z,
129
- disabled: z,
130
- children: [/* @__PURE__ */ I(t, { size: 16 }), " Cancel"]
131
- }), /* @__PURE__ */ L(f, {
132
+ disabled: M,
133
+ children: [/* @__PURE__ */ P(t, { size: 16 }), " Cancel"]
134
+ }), /* @__PURE__ */ F(f, {
132
135
  onClick: $,
133
- disabled: z,
136
+ disabled: M,
134
137
  children: [
135
- /* @__PURE__ */ I(o, { size: 16 }),
138
+ /* @__PURE__ */ P(a, { size: 16 }),
136
139
  " ",
137
- N ? z ? "Saving..." : "Save Changes" : z ? "Saving..." : "Add Warehouse"
140
+ d ? M ? "Saving..." : "Save Changes" : M ? "Saving..." : "Add Warehouse"
138
141
  ]
139
142
  })]
140
143
  }),
141
144
  children: [
142
- /* @__PURE__ */ I(B, {
143
- icon: /* @__PURE__ */ I(e, { size: 18 }),
145
+ /* @__PURE__ */ P(R, {
146
+ icon: /* @__PURE__ */ P(e, { size: 18 }),
144
147
  children: "Add a warehouse so you can store inventory and fulfil orders from it. A code, name, type and location get it on the network — set a total capacity to track utilization."
145
148
  }),
146
- /* @__PURE__ */ L("form", {
149
+ /* @__PURE__ */ F("form", {
147
150
  onSubmit: $,
148
151
  className: "max-w-2xl space-y-6",
149
152
  children: [
150
- /* @__PURE__ */ I(A, { message: G }),
151
- /* @__PURE__ */ L(R, { children: [/* @__PURE__ */ I("h2", {
153
+ /* @__PURE__ */ P(k, { message: ie }),
154
+ /* @__PURE__ */ F(I, { children: [/* @__PURE__ */ P("h2", {
152
155
  className: "text-base font-semibold text-text-primary mb-4",
153
156
  children: "Warehouse Details"
154
- }), /* @__PURE__ */ L("div", {
157
+ }), /* @__PURE__ */ F("div", {
155
158
  className: "space-y-4",
156
159
  children: [
157
- /* @__PURE__ */ L("div", {
160
+ /* @__PURE__ */ F("div", {
158
161
  className: "grid grid-cols-1 md:grid-cols-3 gap-4",
159
162
  children: [
160
- /* @__PURE__ */ L("div", {
163
+ /* @__PURE__ */ F("div", {
161
164
  className: "space-y-2",
162
- children: [/* @__PURE__ */ L(v, {
165
+ children: [/* @__PURE__ */ F(v, {
163
166
  htmlFor: "code",
164
- children: ["Code ", /* @__PURE__ */ I("span", {
167
+ children: ["Code ", /* @__PURE__ */ P("span", {
165
168
  className: "text-status-error-text",
166
169
  children: "*"
167
170
  })]
168
- }), /* @__PURE__ */ I(_, {
171
+ }), /* @__PURE__ */ P(_, {
169
172
  id: "code",
170
- value: P.code,
173
+ value: y.code,
171
174
  onChange: (e) => Q("code", e.target.value),
172
175
  placeholder: "WH-SF-01",
173
176
  required: !0
174
177
  })]
175
178
  }),
176
- /* @__PURE__ */ L("div", {
179
+ /* @__PURE__ */ F("div", {
177
180
  className: "space-y-2",
178
- children: [/* @__PURE__ */ L(v, {
181
+ children: [/* @__PURE__ */ F(v, {
179
182
  htmlFor: "name",
180
- children: ["Name ", /* @__PURE__ */ I("span", {
183
+ children: ["Name ", /* @__PURE__ */ P("span", {
181
184
  className: "text-status-error-text",
182
185
  children: "*"
183
186
  })]
184
- }), /* @__PURE__ */ I(_, {
187
+ }), /* @__PURE__ */ P(_, {
185
188
  id: "name",
186
- value: P.name,
189
+ value: y.name,
187
190
  onChange: (e) => Q("name", e.target.value),
188
191
  placeholder: "San Francisco DC",
189
192
  required: !0
190
193
  })]
191
194
  }),
192
- /* @__PURE__ */ L("div", {
195
+ /* @__PURE__ */ F("div", {
193
196
  className: "space-y-2",
194
- children: [/* @__PURE__ */ L(v, {
197
+ children: [/* @__PURE__ */ F(v, {
195
198
  htmlFor: "type",
196
- children: ["Type ", /* @__PURE__ */ I("span", {
199
+ children: ["Type ", /* @__PURE__ */ P("span", {
197
200
  className: "text-status-error-text",
198
201
  children: "*"
199
202
  })]
200
- }), /* @__PURE__ */ L(b, {
201
- value: P.type,
203
+ }), /* @__PURE__ */ F(b, {
204
+ value: y.type,
202
205
  onValueChange: (e) => Q("type", e),
203
- children: [/* @__PURE__ */ I(C, {
206
+ children: [/* @__PURE__ */ P(C, {
204
207
  id: "type",
205
- children: /* @__PURE__ */ I(w, {})
206
- }), /* @__PURE__ */ I(x, { children: re.map((e) => /* @__PURE__ */ I(S, {
208
+ children: /* @__PURE__ */ P(w, {})
209
+ }), /* @__PURE__ */ P(x, { children: ae.map((e) => /* @__PURE__ */ P(S, {
207
210
  value: e.value,
208
211
  children: e.label
209
212
  }, e.value)) })]
@@ -211,78 +214,78 @@ function W({ editId: n, onSaved: i }) {
211
214
  })
212
215
  ]
213
216
  }),
214
- /* @__PURE__ */ L("div", {
217
+ /* @__PURE__ */ F("div", {
215
218
  className: "grid grid-cols-1 md:grid-cols-3 gap-4",
216
219
  children: [
217
- /* @__PURE__ */ L("div", {
220
+ /* @__PURE__ */ F("div", {
218
221
  className: "space-y-2",
219
- children: [/* @__PURE__ */ I(v, {
222
+ children: [/* @__PURE__ */ P(v, {
220
223
  htmlFor: "status",
221
224
  children: "Status"
222
- }), /* @__PURE__ */ L(b, {
223
- value: P.status,
225
+ }), /* @__PURE__ */ F(b, {
226
+ value: y.status,
224
227
  onValueChange: (e) => Q("status", e),
225
- children: [/* @__PURE__ */ I(C, {
228
+ children: [/* @__PURE__ */ P(C, {
226
229
  id: "status",
227
- children: /* @__PURE__ */ I(w, {})
228
- }), /* @__PURE__ */ I(x, { children: ie.map((e) => /* @__PURE__ */ I(S, {
230
+ children: /* @__PURE__ */ P(w, {})
231
+ }), /* @__PURE__ */ P(x, { children: oe.map((e) => /* @__PURE__ */ P(S, {
229
232
  value: e.value,
230
233
  children: e.label
231
234
  }, e.value)) })]
232
235
  })]
233
236
  }),
234
- /* @__PURE__ */ L("div", {
237
+ /* @__PURE__ */ F("div", {
235
238
  className: "space-y-2",
236
- children: [/* @__PURE__ */ I(v, {
239
+ children: [/* @__PURE__ */ P(v, {
237
240
  htmlFor: "totalCapacity",
238
241
  children: "Total Capacity (sq ft)"
239
- }), /* @__PURE__ */ I(_, {
242
+ }), /* @__PURE__ */ P(_, {
240
243
  id: "totalCapacity",
241
244
  type: "number",
242
245
  min: "0",
243
- value: P.totalCapacity,
246
+ value: y.totalCapacity,
244
247
  onChange: (e) => Q("totalCapacity", e.target.value),
245
248
  placeholder: "50000"
246
249
  })]
247
250
  }),
248
- /* @__PURE__ */ L("div", {
251
+ /* @__PURE__ */ F("div", {
249
252
  className: "space-y-2",
250
- children: [/* @__PURE__ */ I(v, {
253
+ children: [/* @__PURE__ */ P(v, {
251
254
  htmlFor: "usedCapacity",
252
255
  children: "Used Capacity (sq ft)"
253
- }), /* @__PURE__ */ I(_, {
256
+ }), /* @__PURE__ */ P(_, {
254
257
  id: "usedCapacity",
255
258
  type: "number",
256
259
  min: "0",
257
- value: P.usedCapacity,
260
+ value: y.usedCapacity,
258
261
  onChange: (e) => Q("usedCapacity", e.target.value),
259
262
  placeholder: "0"
260
263
  })]
261
264
  })
262
265
  ]
263
266
  }),
264
- /* @__PURE__ */ L("div", {
267
+ /* @__PURE__ */ F("div", {
265
268
  className: "grid grid-cols-1 md:grid-cols-2 gap-4",
266
- children: [/* @__PURE__ */ L("div", {
269
+ children: [/* @__PURE__ */ F("div", {
267
270
  className: "space-y-2",
268
- children: [/* @__PURE__ */ I(v, {
271
+ children: [/* @__PURE__ */ P(v, {
269
272
  htmlFor: "contactEmail",
270
273
  children: "Contact Email"
271
- }), /* @__PURE__ */ I(_, {
274
+ }), /* @__PURE__ */ P(_, {
272
275
  id: "contactEmail",
273
276
  type: "email",
274
- value: P.contactEmail,
277
+ value: y.contactEmail,
275
278
  onChange: (e) => Q("contactEmail", e.target.value),
276
279
  placeholder: "dc-sf@example.com"
277
280
  })]
278
- }), /* @__PURE__ */ L("div", {
281
+ }), /* @__PURE__ */ F("div", {
279
282
  className: "space-y-2",
280
- children: [/* @__PURE__ */ I(v, {
283
+ children: [/* @__PURE__ */ P(v, {
281
284
  htmlFor: "contactPhone",
282
285
  children: "Contact Phone"
283
- }), /* @__PURE__ */ I(_, {
286
+ }), /* @__PURE__ */ P(_, {
284
287
  id: "contactPhone",
285
- value: P.contactPhone,
288
+ value: y.contactPhone,
286
289
  onChange: (e) => Q("contactPhone", e.target.value),
287
290
  placeholder: "+1-555-0100"
288
291
  })]
@@ -290,78 +293,78 @@ function W({ editId: n, onSaved: i }) {
290
293
  })
291
294
  ]
292
295
  })] }),
293
- /* @__PURE__ */ L(p, { children: [/* @__PURE__ */ I(h, { children: /* @__PURE__ */ L(g, {
296
+ /* @__PURE__ */ F(p, { children: [/* @__PURE__ */ P(h, { children: /* @__PURE__ */ F(g, {
294
297
  className: "flex items-center gap-2",
295
298
  children: [
296
- /* @__PURE__ */ I(r, { size: 18 }),
299
+ /* @__PURE__ */ P(r, { size: 18 }),
297
300
  " Address ",
298
- /* @__PURE__ */ I("span", {
301
+ /* @__PURE__ */ P("span", {
299
302
  className: "text-status-error-text",
300
303
  children: "*"
301
304
  })
302
305
  ]
303
- }) }), /* @__PURE__ */ L(m, {
306
+ }) }), /* @__PURE__ */ F(m, {
304
307
  className: "space-y-4",
305
308
  children: [
306
- /* @__PURE__ */ L("div", {
309
+ /* @__PURE__ */ F("div", {
307
310
  className: "space-y-2",
308
- children: [/* @__PURE__ */ I(v, {
311
+ children: [/* @__PURE__ */ P(v, {
309
312
  htmlFor: "street",
310
313
  children: "Street"
311
- }), /* @__PURE__ */ I(_, {
314
+ }), /* @__PURE__ */ P(_, {
312
315
  id: "street",
313
- value: P.street,
316
+ value: y.street,
314
317
  onChange: (e) => Q("street", e.target.value),
315
318
  placeholder: "500 Industrial Way"
316
319
  })]
317
320
  }),
318
- /* @__PURE__ */ L("div", {
321
+ /* @__PURE__ */ F("div", {
319
322
  className: "grid grid-cols-1 md:grid-cols-2 gap-4",
320
- children: [/* @__PURE__ */ L("div", {
323
+ children: [/* @__PURE__ */ F("div", {
321
324
  className: "space-y-2",
322
- children: [/* @__PURE__ */ I(v, {
325
+ children: [/* @__PURE__ */ P(v, {
323
326
  htmlFor: "city",
324
327
  children: "City"
325
- }), /* @__PURE__ */ I(_, {
328
+ }), /* @__PURE__ */ P(_, {
326
329
  id: "city",
327
- value: P.city,
330
+ value: y.city,
328
331
  onChange: (e) => Q("city", e.target.value),
329
332
  placeholder: "San Francisco"
330
333
  })]
331
- }), /* @__PURE__ */ L("div", {
334
+ }), /* @__PURE__ */ F("div", {
332
335
  className: "space-y-2",
333
- children: [/* @__PURE__ */ I(v, {
336
+ children: [/* @__PURE__ */ P(v, {
334
337
  htmlFor: "state",
335
338
  children: "State"
336
- }), /* @__PURE__ */ I(_, {
339
+ }), /* @__PURE__ */ P(_, {
337
340
  id: "state",
338
- value: P.state,
341
+ value: y.state,
339
342
  onChange: (e) => Q("state", e.target.value),
340
343
  placeholder: "CA"
341
344
  })]
342
345
  })]
343
346
  }),
344
- /* @__PURE__ */ L("div", {
347
+ /* @__PURE__ */ F("div", {
345
348
  className: "grid grid-cols-1 md:grid-cols-2 gap-4",
346
- children: [/* @__PURE__ */ L("div", {
349
+ children: [/* @__PURE__ */ F("div", {
347
350
  className: "space-y-2",
348
- children: [/* @__PURE__ */ I(v, {
351
+ children: [/* @__PURE__ */ P(v, {
349
352
  htmlFor: "postalCode",
350
353
  children: "ZIP / Postal Code"
351
- }), /* @__PURE__ */ I(_, {
354
+ }), /* @__PURE__ */ P(_, {
352
355
  id: "postalCode",
353
- value: P.postalCode,
356
+ value: y.postalCode,
354
357
  onChange: (e) => Q("postalCode", e.target.value),
355
358
  placeholder: "94103"
356
359
  })]
357
- }), /* @__PURE__ */ L("div", {
360
+ }), /* @__PURE__ */ F("div", {
358
361
  className: "space-y-2",
359
- children: [/* @__PURE__ */ I(v, {
362
+ children: [/* @__PURE__ */ P(v, {
360
363
  htmlFor: "country",
361
364
  children: "Country"
362
- }), /* @__PURE__ */ I(_, {
365
+ }), /* @__PURE__ */ P(_, {
363
366
  id: "country",
364
- value: P.country,
367
+ value: y.country,
365
368
  onChange: (e) => Q("country", e.target.value),
366
369
  placeholder: "USA"
367
370
  })]
@@ -369,186 +372,469 @@ function W({ editId: n, onSaved: i }) {
369
372
  })
370
373
  ]
371
374
  })] }),
372
- N && /* @__PURE__ */ L(p, {
375
+ d && /* @__PURE__ */ F(p, {
373
376
  className: "border-status-error-border",
374
- children: [/* @__PURE__ */ I(h, { children: /* @__PURE__ */ L(g, {
377
+ children: [/* @__PURE__ */ P(h, { children: /* @__PURE__ */ F(g, {
375
378
  className: "flex items-center gap-2 text-status-error-text",
376
- children: [/* @__PURE__ */ I(s, { size: 18 }), " Delete Warehouse"]
377
- }) }), /* @__PURE__ */ L(m, { children: [/* @__PURE__ */ I("p", {
379
+ children: [/* @__PURE__ */ P(o, { size: 18 }), " Delete Warehouse"]
380
+ }) }), /* @__PURE__ */ F(m, { children: [/* @__PURE__ */ P("p", {
378
381
  className: "mb-3 text-sm text-text-secondary",
379
382
  children: "Removes this warehouse from your network. This cannot be undone from here."
380
- }), /* @__PURE__ */ L(f, {
383
+ }), /* @__PURE__ */ F(f, {
381
384
  type: "button",
382
385
  variant: "outline",
383
386
  className: "border-status-error-border text-status-error-text hover:bg-status-error-bg-subtle",
384
- onClick: () => q(!0),
385
- children: [/* @__PURE__ */ I(s, { size: 16 }), " Delete this warehouse"]
387
+ onClick: () => K(!0),
388
+ children: [/* @__PURE__ */ P(o, { size: 16 }), " Delete this warehouse"]
386
389
  })] })]
387
390
  })
388
391
  ]
389
392
  }),
390
- /* @__PURE__ */ I(V, {
391
- open: ae,
392
- onOpenChange: q,
393
- children: /* @__PURE__ */ L(H, { children: [
394
- /* @__PURE__ */ L(te, { children: [/* @__PURE__ */ I(ne, { children: "Delete this warehouse?" }), /* @__PURE__ */ L(U, { children: [
393
+ /* @__PURE__ */ P(z, {
394
+ open: G,
395
+ onOpenChange: K,
396
+ children: /* @__PURE__ */ F(B, { children: [
397
+ /* @__PURE__ */ F(U, { children: [/* @__PURE__ */ P(W, { children: "Delete this warehouse?" }), /* @__PURE__ */ F(V, { children: [
395
398
  "This removes ",
396
- P.name || "this warehouse",
399
+ y.name || "this warehouse",
397
400
  " and cannot be undone from here."
398
401
  ] })] }),
399
- /* @__PURE__ */ I("div", {
402
+ /* @__PURE__ */ P("div", {
400
403
  className: "px-1",
401
- children: /* @__PURE__ */ I(A, { message: oe })
404
+ children: /* @__PURE__ */ P(k, { message: Y })
402
405
  }),
403
- /* @__PURE__ */ L(ee, { children: [/* @__PURE__ */ I(f, {
406
+ /* @__PURE__ */ F(H, { children: [/* @__PURE__ */ P(f, {
404
407
  variant: "outline",
405
- onClick: () => q(!1),
406
- disabled: J,
408
+ onClick: () => K(!1),
409
+ disabled: q,
407
410
  children: "Cancel"
408
- }), /* @__PURE__ */ I(f, {
411
+ }), /* @__PURE__ */ P(f, {
409
412
  className: "bg-status-error-text text-text-inverse hover:opacity-90",
410
413
  onClick: async () => {
411
414
  if (n) {
412
- Y(!0), X(null);
415
+ J(!0), X(null);
413
416
  try {
414
- await y(n), q(!1), Z();
417
+ await ne(n), K(!1), Z();
415
418
  } catch (e) {
416
- X(e instanceof Error ? e.message : "Failed to delete warehouse."), Y(!1);
419
+ X(e instanceof Error ? e.message : "Failed to delete warehouse."), J(!1);
417
420
  }
418
421
  }
419
422
  },
420
- disabled: J,
421
- children: J ? "Deleting..." : "Delete warehouse"
423
+ disabled: q,
424
+ children: q ? "Deleting..." : "Delete warehouse"
422
425
  })] })
423
426
  ] })
424
427
  })
425
428
  ]
426
429
  });
427
430
  }
428
- function G() {
429
- let { warehouseId: o } = P(), { basePath: s, navigate: _ } = D(), v = N().pathname.endsWith("/edit"), { warehouse: b, isLoading: x, error: S, refetch: C, reload: w } = E(o), T = () => _?.(k(s, "inventory/warehouses")), A = (e) => _?.(k(s, e));
430
- if (!o) return /* @__PURE__ */ I(W, {});
431
- if (v) return /* @__PURE__ */ I(W, {
432
- editId: o,
433
- onSaved: w
431
+ function K() {
432
+ let { warehouseId: a } = N(), { basePath: v, navigate: T } = E(), k = M().pathname.endsWith("/edit"), { warehouse: A, isLoading: z, error: B, refetch: V, reload: H, addZone: U, removeZone: W, addStaff: ae, removeStaff: oe } = re(a), [K, q] = j(!1), [J, Y] = j({
433
+ code: "",
434
+ name: "",
435
+ zoneType: "STORAGE"
436
+ }), [X, Z] = j(!1), [Q, $] = j({
437
+ name: "",
438
+ role: "PICKER",
439
+ shift: "DAY"
440
+ }), se = () => T?.(O(v, "inventory/warehouses")), ce = (e) => T?.(O(v, e));
441
+ if (!a) return /* @__PURE__ */ P(G, {});
442
+ if (k) return /* @__PURE__ */ P(G, {
443
+ editId: a,
444
+ onSaved: H
434
445
  });
435
- if (x) return /* @__PURE__ */ I(l, { message: "Loading warehouse details..." });
436
- if (S || !b) return /* @__PURE__ */ I(c, {
446
+ if (z) return /* @__PURE__ */ P(l, { message: "Loading warehouse details..." });
447
+ if (B || !A) return /* @__PURE__ */ P(ne, {
437
448
  title: "Warehouse not found",
438
- onRetry: C
449
+ onRetry: V
439
450
  });
440
- let j = b.status?.toUpperCase() === "ACTIVE";
441
- return /* @__PURE__ */ L(u, {
442
- title: b.name,
443
- subtitle: `Code: ${b.code}`,
444
- icon: /* @__PURE__ */ I(e, { size: 24 }),
445
- headerActions: /* @__PURE__ */ L("div", {
451
+ let le = A.status?.toUpperCase() === "ACTIVE";
452
+ return /* @__PURE__ */ F(u, {
453
+ title: A.name,
454
+ subtitle: `Code: ${A.code}`,
455
+ icon: /* @__PURE__ */ P(e, { size: 24 }),
456
+ headerActions: /* @__PURE__ */ F("div", {
446
457
  className: "flex gap-2",
447
- children: [/* @__PURE__ */ L(f, {
458
+ children: [/* @__PURE__ */ F(f, {
448
459
  variant: "outline",
449
- onClick: T,
450
- children: [/* @__PURE__ */ I(t, { size: 16 }), " Back"]
451
- }), /* @__PURE__ */ L(f, {
452
- onClick: () => _?.(k(s, `inventory/warehouses/${o}/edit`)),
453
- children: [/* @__PURE__ */ I(n, { size: 16 }), " Edit"]
460
+ onClick: se,
461
+ children: [/* @__PURE__ */ P(t, { size: 16 }), " Back"]
462
+ }), /* @__PURE__ */ F(f, {
463
+ onClick: () => T?.(O(v, `inventory/warehouses/${a}/edit`)),
464
+ children: [/* @__PURE__ */ P(n, { size: 16 }), " Edit"]
454
465
  })]
455
466
  }),
456
- headerContent: /* @__PURE__ */ L("div", {
467
+ headerContent: /* @__PURE__ */ F("div", {
457
468
  className: "flex gap-2",
458
- children: [/* @__PURE__ */ I(d, {
459
- variant: b.status ? j ? "default" : "secondary" : "outline",
460
- children: b.status ? j ? "Active" : "Inactive" : "Not provided"
461
- }), /* @__PURE__ */ I(d, {
469
+ children: [/* @__PURE__ */ P(d, {
470
+ variant: A.status ? le ? "default" : "secondary" : "outline",
471
+ children: A.status ? le ? "Active" : "Inactive" : "Not provided"
472
+ }), /* @__PURE__ */ P(d, {
462
473
  variant: "outline",
463
474
  className: "capitalize",
464
- children: b.type.replace("_", " ")
475
+ children: A.type.replace("_", " ")
465
476
  })]
466
477
  }),
467
478
  children: [
468
- /* @__PURE__ */ I(B, {
469
- icon: /* @__PURE__ */ I(e, { size: 18 }),
479
+ /* @__PURE__ */ P(R, {
480
+ icon: /* @__PURE__ */ P(e, { size: 18 }),
470
481
  children: "A storage and fulfilment site at a glance — how full it is, its operating hours and how to reach it. Use it to decide whether this warehouse has the space and hours to fulfil an order."
471
482
  }),
472
- /* @__PURE__ */ I(z, {
483
+ /* @__PURE__ */ P(L, {
473
484
  storageKey: "movethewheels-warehouse-details",
474
485
  steps: [{
475
486
  id: "inventory",
476
487
  label: "Review stock here",
477
488
  description: "See which products are stored at this site.",
478
- icon: /* @__PURE__ */ I(a, { size: 16 }),
479
- onClick: () => A("inventory/products")
489
+ icon: /* @__PURE__ */ P(i, { size: 16 }),
490
+ onClick: () => ce("inventory/products")
480
491
  }, {
481
492
  id: "fulfil",
482
493
  label: "Fulfil an order from this site",
483
494
  description: "Pick a pending order to ship out of this warehouse.",
484
- icon: /* @__PURE__ */ I(r, { size: 16 }),
485
- onClick: () => A("orders")
495
+ icon: /* @__PURE__ */ P(r, { size: 16 }),
496
+ onClick: () => ce("orders")
486
497
  }]
487
498
  }),
488
- /* @__PURE__ */ L("div", {
499
+ /* @__PURE__ */ F("div", {
489
500
  className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
490
- children: [/* @__PURE__ */ L("div", {
501
+ children: [/* @__PURE__ */ F("div", {
491
502
  className: "lg:col-span-2 space-y-6",
492
- children: [/* @__PURE__ */ L(R, { children: [/* @__PURE__ */ L("h2", {
493
- className: "flex items-center gap-2 text-base font-semibold text-text-primary mb-4",
494
- children: [/* @__PURE__ */ I(a, { size: 18 }), " Capacity"]
495
- }), /* @__PURE__ */ I("div", { children: b.utilization !== void 0 && b.capacity.usedSpace !== void 0 && b.capacity.totalSpace !== void 0 ? /* @__PURE__ */ L(F, { children: [
496
- /* @__PURE__ */ L("div", {
497
- className: "flex justify-between text-sm mb-2",
498
- children: [/* @__PURE__ */ I("span", { children: "Space Utilization" }), /* @__PURE__ */ L("span", { children: [b.utilization.toFixed(0), "%"] })]
499
- }),
500
- /* @__PURE__ */ I(y, { value: b.utilization }),
501
- /* @__PURE__ */ L("p", {
502
- className: "text-sm text-text-secondary mt-1",
503
+ children: [
504
+ /* @__PURE__ */ F(I, { children: [/* @__PURE__ */ F("h2", {
505
+ className: "flex items-center gap-2 text-base font-semibold text-text-primary mb-4",
506
+ children: [/* @__PURE__ */ P(i, { size: 18 }), " Capacity"]
507
+ }), /* @__PURE__ */ P("div", { children: A.utilization !== void 0 && A.capacity.usedSpace !== void 0 && A.capacity.totalSpace !== void 0 ? /* @__PURE__ */ F(ie, { children: [
508
+ /* @__PURE__ */ F("div", {
509
+ className: "flex justify-between text-sm mb-2",
510
+ children: [/* @__PURE__ */ P("span", { children: "Space Utilization" }), /* @__PURE__ */ F("span", { children: [A.utilization.toFixed(0), "%"] })]
511
+ }),
512
+ /* @__PURE__ */ P(y, { value: A.utilization }),
513
+ /* @__PURE__ */ F("p", {
514
+ className: "text-sm text-text-secondary mt-1",
515
+ children: [
516
+ A.capacity.usedSpace.toLocaleString(),
517
+ " /",
518
+ " ",
519
+ A.capacity.totalSpace.toLocaleString(),
520
+ " sq ft"
521
+ ]
522
+ })
523
+ ] }) : /* @__PURE__ */ P("p", {
524
+ className: "text-sm text-text-secondary",
525
+ children: "Not provided"
526
+ }) })] }),
527
+ /* @__PURE__ */ F(p, { children: [/* @__PURE__ */ P(h, { children: /* @__PURE__ */ F(g, {
528
+ className: "flex items-center gap-2",
529
+ children: [/* @__PURE__ */ P(ee, { size: 18 }), " Operating Hours"]
530
+ }) }), /* @__PURE__ */ P(m, { children: Object.keys(A.operatingHours).length > 0 ? /* @__PURE__ */ P("div", {
531
+ className: "grid grid-cols-2 md:grid-cols-4 gap-4",
532
+ children: Object.entries(A.operatingHours).map(([e, t]) => /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("p", {
533
+ className: "text-sm font-medium",
534
+ children: e
535
+ }), /* @__PURE__ */ P("p", {
536
+ className: "text-sm text-text-secondary",
537
+ children: t ? `${t.open} - ${t.close}` : "Closed"
538
+ })] }, e))
539
+ }) : /* @__PURE__ */ P("p", {
540
+ className: "text-sm text-text-secondary",
541
+ children: "Not recorded"
542
+ }) })] }),
543
+ A.metrics && /* @__PURE__ */ F(p, { children: [/* @__PURE__ */ P(h, { children: /* @__PURE__ */ P(g, { children: "Facility Metrics" }) }), /* @__PURE__ */ P(m, { children: /* @__PURE__ */ F("div", {
544
+ className: "grid grid-cols-2 sm:grid-cols-4 gap-4 text-sm",
503
545
  children: [
504
- b.capacity.usedSpace.toLocaleString(),
505
- " /",
506
- " ",
507
- b.capacity.totalSpace.toLocaleString(),
508
- " sq ft"
546
+ /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("p", {
547
+ className: "text-xs text-text-secondary",
548
+ children: "Active Locations"
549
+ }), /* @__PURE__ */ F("p", {
550
+ className: "text-lg font-semibold",
551
+ children: [
552
+ A.metrics.activeLocations,
553
+ "/",
554
+ A.metrics.totalLocations
555
+ ]
556
+ })] }),
557
+ /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("p", {
558
+ className: "text-xs text-text-secondary",
559
+ children: "Zones"
560
+ }), /* @__PURE__ */ P("p", {
561
+ className: "text-lg font-semibold",
562
+ children: A.metrics.zoneCount
563
+ })] }),
564
+ /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("p", {
565
+ className: "text-xs text-text-secondary",
566
+ children: "Active Staff"
567
+ }), /* @__PURE__ */ P("p", {
568
+ className: "text-lg font-semibold",
569
+ children: A.metrics.staffCount
570
+ })] }),
571
+ /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("p", {
572
+ className: "text-xs text-text-secondary",
573
+ children: "SKUs / On Hand"
574
+ }), /* @__PURE__ */ F("p", {
575
+ className: "text-lg font-semibold",
576
+ children: [
577
+ A.metrics.totalSkus,
578
+ " (",
579
+ A.metrics.totalOnHand.toLocaleString(),
580
+ ")"
581
+ ]
582
+ })] })
509
583
  ]
510
- })
511
- ] }) : /* @__PURE__ */ I("p", {
512
- className: "text-sm text-text-secondary",
513
- children: "Not provided"
514
- }) })] }), /* @__PURE__ */ L(p, { children: [/* @__PURE__ */ I(h, { children: /* @__PURE__ */ L(g, {
515
- className: "flex items-center gap-2",
516
- children: [/* @__PURE__ */ I(i, { size: 18 }), " Operating Hours"]
517
- }) }), /* @__PURE__ */ I(m, { children: Object.keys(b.operatingHours).length > 0 ? /* @__PURE__ */ I("div", {
518
- className: "grid grid-cols-2 md:grid-cols-4 gap-4",
519
- children: Object.entries(b.operatingHours).map(([e, t]) => /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
520
- className: "text-sm font-medium",
521
- children: e
522
- }), /* @__PURE__ */ I("p", {
523
- className: "text-sm text-text-secondary",
524
- children: t ? `${t.open} - ${t.close}` : "Closed"
525
- })] }, e))
526
- }) : /* @__PURE__ */ I("p", {
527
- className: "text-sm text-text-secondary",
528
- children: "Not recorded"
529
- }) })] })]
530
- }), /* @__PURE__ */ L("div", {
584
+ }) })] }),
585
+ /* @__PURE__ */ F(p, { children: [/* @__PURE__ */ F(h, {
586
+ className: "flex flex-row items-center justify-between gap-2",
587
+ children: [/* @__PURE__ */ F(g, {
588
+ className: "flex items-center gap-2",
589
+ children: [/* @__PURE__ */ P(s, {
590
+ size: 18,
591
+ "aria-hidden": "true"
592
+ }), " Zones"]
593
+ }), /* @__PURE__ */ F(f, {
594
+ variant: "outline",
595
+ size: "sm",
596
+ onClick: () => q((e) => !e),
597
+ children: [
598
+ /* @__PURE__ */ P(c, {
599
+ size: 14,
600
+ "aria-hidden": "true"
601
+ }),
602
+ " ",
603
+ K ? "Close" : "Add zone"
604
+ ]
605
+ })]
606
+ }), /* @__PURE__ */ F(m, {
607
+ className: "space-y-4",
608
+ children: [K && /* @__PURE__ */ F("form", {
609
+ className: "space-y-3 rounded-lg border border-border-seam p-3",
610
+ onSubmit: async (e) => {
611
+ e.preventDefault(), J.code.trim() && J.name.trim() && (await U({
612
+ code: J.code.trim(),
613
+ name: J.name.trim(),
614
+ zoneType: J.zoneType
615
+ }), Y({
616
+ code: "",
617
+ name: "",
618
+ zoneType: "STORAGE"
619
+ }), q(!1));
620
+ },
621
+ children: [/* @__PURE__ */ F("div", {
622
+ className: "grid grid-cols-1 sm:grid-cols-3 gap-3",
623
+ children: [
624
+ /* @__PURE__ */ P(_, {
625
+ placeholder: "Code (e.g. Z-A1)",
626
+ required: !0,
627
+ value: J.code,
628
+ onChange: (e) => Y((t) => ({
629
+ ...t,
630
+ code: e.target.value
631
+ }))
632
+ }),
633
+ /* @__PURE__ */ P(_, {
634
+ placeholder: "Zone name",
635
+ required: !0,
636
+ value: J.name,
637
+ onChange: (e) => Y((t) => ({
638
+ ...t,
639
+ name: e.target.value
640
+ }))
641
+ }),
642
+ /* @__PURE__ */ F(b, {
643
+ value: J.zoneType,
644
+ onValueChange: (e) => Y((t) => ({
645
+ ...t,
646
+ zoneType: e
647
+ })),
648
+ children: [/* @__PURE__ */ P(C, { children: /* @__PURE__ */ P(w, {}) }), /* @__PURE__ */ P(x, { children: [
649
+ "STORAGE",
650
+ "RECEIVING",
651
+ "SHIPPING",
652
+ "COLD",
653
+ "HAZMAT",
654
+ "STAGING",
655
+ "RETURNS"
656
+ ].map((e) => /* @__PURE__ */ P(S, {
657
+ value: e,
658
+ children: e
659
+ }, e)) })]
660
+ })
661
+ ]
662
+ }), /* @__PURE__ */ P(f, {
663
+ type: "submit",
664
+ size: "sm",
665
+ children: "Save zone"
666
+ })]
667
+ }), A.zones && A.zones.length > 0 ? /* @__PURE__ */ P("ul", {
668
+ className: "divide-y divide-border-seam",
669
+ children: A.zones.map((e) => /* @__PURE__ */ F("li", {
670
+ className: "flex items-center justify-between gap-3 py-2 text-sm",
671
+ children: [/* @__PURE__ */ F("div", { children: [/* @__PURE__ */ F("p", {
672
+ className: "font-medium",
673
+ children: [
674
+ e.code,
675
+ " — ",
676
+ e.name
677
+ ]
678
+ }), /* @__PURE__ */ F("p", {
679
+ className: "text-xs text-text-secondary",
680
+ children: [
681
+ e.zoneType,
682
+ " · ",
683
+ e.status,
684
+ e.temperatureRange ? ` · ${e.temperatureRange}` : ""
685
+ ]
686
+ })] }), /* @__PURE__ */ P(f, {
687
+ variant: "ghost",
688
+ size: "sm",
689
+ className: "text-status-error-text",
690
+ "aria-label": `Delete zone ${e.code}`,
691
+ onClick: () => void W(e.id),
692
+ children: /* @__PURE__ */ P(o, {
693
+ size: 14,
694
+ "aria-hidden": "true"
695
+ })
696
+ })]
697
+ }, e.id))
698
+ }) : /* @__PURE__ */ P("p", {
699
+ className: "text-sm text-text-secondary",
700
+ children: "No warehouse zones configured yet."
701
+ })]
702
+ })] }),
703
+ /* @__PURE__ */ F(p, { children: [/* @__PURE__ */ F(h, {
704
+ className: "flex flex-row items-center justify-between gap-2",
705
+ children: [/* @__PURE__ */ F(g, {
706
+ className: "flex items-center gap-2",
707
+ children: [/* @__PURE__ */ P(te, {
708
+ size: 18,
709
+ "aria-hidden": "true"
710
+ }), " Staff Roster"]
711
+ }), /* @__PURE__ */ F(f, {
712
+ variant: "outline",
713
+ size: "sm",
714
+ onClick: () => Z((e) => !e),
715
+ children: [
716
+ /* @__PURE__ */ P(c, {
717
+ size: 14,
718
+ "aria-hidden": "true"
719
+ }),
720
+ " ",
721
+ X ? "Close" : "Add staff"
722
+ ]
723
+ })]
724
+ }), /* @__PURE__ */ F(m, {
725
+ className: "space-y-4",
726
+ children: [X && /* @__PURE__ */ F("form", {
727
+ className: "space-y-3 rounded-lg border border-border-seam p-3",
728
+ onSubmit: async (e) => {
729
+ e.preventDefault(), Q.name.trim() && (await ae({
730
+ name: Q.name.trim(),
731
+ role: Q.role,
732
+ shift: Q.shift.trim() || void 0
733
+ }), $({
734
+ name: "",
735
+ role: "PICKER",
736
+ shift: "DAY"
737
+ }), Z(!1));
738
+ },
739
+ children: [/* @__PURE__ */ F("div", {
740
+ className: "grid grid-cols-1 sm:grid-cols-3 gap-3",
741
+ children: [
742
+ /* @__PURE__ */ P(_, {
743
+ placeholder: "Full name",
744
+ required: !0,
745
+ value: Q.name,
746
+ onChange: (e) => $((t) => ({
747
+ ...t,
748
+ name: e.target.value
749
+ }))
750
+ }),
751
+ /* @__PURE__ */ F(b, {
752
+ value: Q.role,
753
+ onValueChange: (e) => $((t) => ({
754
+ ...t,
755
+ role: e
756
+ })),
757
+ children: [/* @__PURE__ */ P(C, { children: /* @__PURE__ */ P(w, {}) }), /* @__PURE__ */ P(x, { children: [
758
+ "MANAGER",
759
+ "SUPERVISOR",
760
+ "PICKER",
761
+ "PACKER",
762
+ "LOADER",
763
+ "INVENTORY_CLERK"
764
+ ].map((e) => /* @__PURE__ */ P(S, {
765
+ value: e,
766
+ children: e.replace("_", " ")
767
+ }, e)) })]
768
+ }),
769
+ /* @__PURE__ */ P(_, {
770
+ placeholder: "Shift (e.g. DAY)",
771
+ value: Q.shift,
772
+ onChange: (e) => $((t) => ({
773
+ ...t,
774
+ shift: e.target.value
775
+ }))
776
+ })
777
+ ]
778
+ }), /* @__PURE__ */ P(f, {
779
+ type: "submit",
780
+ size: "sm",
781
+ children: "Save staff member"
782
+ })]
783
+ }), A.staff && A.staff.length > 0 ? /* @__PURE__ */ P("ul", {
784
+ className: "divide-y divide-border-seam",
785
+ children: A.staff.map((e) => /* @__PURE__ */ F("li", {
786
+ className: "flex items-center justify-between gap-3 py-2 text-sm",
787
+ children: [/* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("p", {
788
+ className: "font-medium",
789
+ children: e.name
790
+ }), /* @__PURE__ */ F("p", {
791
+ className: "text-xs text-text-secondary",
792
+ children: [
793
+ e.role.replace("_", " "),
794
+ " · ",
795
+ e.status,
796
+ e.shift ? ` · ${e.shift}` : ""
797
+ ]
798
+ })] }), /* @__PURE__ */ P(f, {
799
+ variant: "ghost",
800
+ size: "sm",
801
+ className: "text-status-error-text",
802
+ "aria-label": `Delete staff member ${e.name}`,
803
+ onClick: () => void oe(e.id),
804
+ children: /* @__PURE__ */ P(o, {
805
+ size: 14,
806
+ "aria-hidden": "true"
807
+ })
808
+ })]
809
+ }, e.id))
810
+ }) : /* @__PURE__ */ P("p", {
811
+ className: "text-sm text-text-secondary",
812
+ children: "No staff assigned to this warehouse yet."
813
+ })]
814
+ })] })
815
+ ]
816
+ }), /* @__PURE__ */ F("div", {
531
817
  className: "space-y-6",
532
- children: [/* @__PURE__ */ L(p, { children: [/* @__PURE__ */ I(h, { children: /* @__PURE__ */ L(g, {
818
+ children: [/* @__PURE__ */ F(p, { children: [/* @__PURE__ */ P(h, { children: /* @__PURE__ */ F(g, {
533
819
  className: "flex items-center gap-2",
534
- children: [/* @__PURE__ */ I(r, { size: 18 }), " Location"]
535
- }) }), /* @__PURE__ */ I(m, { children: /* @__PURE__ */ I("p", {
820
+ children: [/* @__PURE__ */ P(r, { size: 18 }), " Location"]
821
+ }) }), /* @__PURE__ */ P(m, { children: /* @__PURE__ */ P("p", {
536
822
  className: "text-sm",
537
- children: O(b.address) || "—"
538
- }) })] }), (b.contactInfo?.email || b.contactInfo?.phone) && /* @__PURE__ */ L(p, { children: [/* @__PURE__ */ I(h, { children: /* @__PURE__ */ I(g, { children: "Contact" }) }), /* @__PURE__ */ L(m, {
823
+ children: D(A.address) || "—"
824
+ }) })] }), (A.contactInfo?.email || A.contactInfo?.phone) && /* @__PURE__ */ F(p, { children: [/* @__PURE__ */ P(h, { children: /* @__PURE__ */ P(g, { children: "Contact" }) }), /* @__PURE__ */ F(m, {
539
825
  className: "space-y-3",
540
- children: [b.contactInfo?.email && /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
826
+ children: [A.contactInfo?.email && /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("p", {
541
827
  className: "text-sm text-text-secondary",
542
828
  children: "Email"
543
- }), /* @__PURE__ */ I("p", {
829
+ }), /* @__PURE__ */ P("p", {
544
830
  className: "font-medium",
545
- children: b.contactInfo.email
546
- })] }), b.contactInfo?.phone && /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
831
+ children: A.contactInfo.email
832
+ })] }), A.contactInfo?.phone && /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("p", {
547
833
  className: "text-sm text-text-secondary",
548
834
  children: "Phone"
549
- }), /* @__PURE__ */ I("p", {
835
+ }), /* @__PURE__ */ P("p", {
550
836
  className: "font-medium",
551
- children: b.contactInfo.phone
837
+ children: A.contactInfo.phone
552
838
  })] })]
553
839
  })] })]
554
840
  })]
@@ -556,4 +842,4 @@ function G() {
556
842
  ]
557
843
  });
558
844
  }
559
- export { G as default };
845
+ export { K as default };