@burdenoff/microfe-devportal 2026.916.6 → 2026.916.8

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.
@@ -1,14 +1,17 @@
1
1
  import { useDevportal as e } from "../providers/DevportalProvider.js";
2
2
  import { cn as t } from "../utils/cn.js";
3
3
  import { PageLayout as n, PageSection as r } from "../components/PageLayout.js";
4
- import { CheckboxField as i, InputField as a, SelectField as o, TextareaField as s } from "../components/FormField.js";
5
- import { usePackageUpload as ee } from "../hooks/usePackageUpload.js";
6
- import { useCallback as c, useEffect as te, useRef as ne, useState as l } from "react";
7
- import { AlertCircle as u, AlertTriangle as d, Info as re, Loader2 as f, RotateCw as ie, Upload as ae, X as oe } from "lucide-react";
8
- import { useParams as se } from "react-router";
4
+ import { DetailList as i } from "../components/DataTable.js";
5
+ import { CheckboxField as a, InputField as o, SelectField as s, TextareaField as c } from "../components/FormField.js";
6
+ import { ImageUploadField as l, ScreenshotGallery as ee } from "../components/ImageUploadField.js";
7
+ import { usePackageUpload as u } from "../hooks/usePackageUpload.js";
8
+ import { useEffect as te, useState as d } from "react";
9
+ import { AlertCircle as ne, CheckCircle as re, Clock as ie, Edit as ae, ImageOff as oe, Info as se, Loader2 as f, XCircle as ce } from "lucide-react";
10
+ import { useParams as le } from "react-router";
9
11
  import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
12
+ import { EmphasisPanel as ue, GlassCard as g } from "@burdenoff/fe-libs/ui";
10
13
  //#region src/devportal/pages/EditPhysicalItemPage.tsx
11
- var g = [
14
+ var de = [
12
15
  {
13
16
  value: "USD",
14
17
  label: "USD — US Dollar"
@@ -33,7 +36,7 @@ var g = [
33
36
  value: "AED",
34
37
  label: "AED — UAE Dirham"
35
38
  }
36
- ], _ = [
39
+ ], fe = [
37
40
  {
38
41
  value: "GRAM",
39
42
  label: "Grams (g)"
@@ -50,7 +53,7 @@ var g = [
50
53
  value: "POUND",
51
54
  label: "Pounds (lb)"
52
55
  }
53
- ], v = [
56
+ ], pe = [
54
57
  {
55
58
  value: "CENTIMETER",
56
59
  label: "Centimeters (cm)"
@@ -63,21 +66,61 @@ var g = [
63
66
  value: "METER",
64
67
  label: "Meters (m)"
65
68
  }
66
- ], y = [
69
+ ], _ = [
67
70
  "name",
68
71
  "shortDescription",
69
72
  "price",
70
73
  "currency",
71
74
  "stockQuantity"
72
- ], b = "\n query GetPhysicalProduct($id: ID!) {\n product(id: $id) {\n id\n name\n slug\n type\n status\n nature\n description\n longDescription\n price\n currency\n tags\n stockQuantity\n sku\n trackInventory\n allowBackorder\n lowStockThreshold\n requiresShipping\n weight\n weightUnit\n length\n width\n height\n dimensionUnit\n brand\n manufacturer\n countryOfOrigin\n warrantyInfo\n returnPolicy\n icon\n screenshots\n }\n }\n", x = "\n mutation UpdatePhysicalProduct(\n $id: ID!\n $input: UpdatePhysicalProductInput!\n ) {\n updatePhysicalProduct(id: $id, input: $input) {\n id\n name\n status\n }\n }\n", S = "\n mutation SubmitProductForReview($id: ID!, $notes: String) {\n submitProduct(id: $id, notes: $notes) {\n id\n status\n }\n }\n";
73
- function ce(e) {
74
- return y.every((t) => {
75
+ ], me = {
76
+ MERCHANDISE: "Merchandise",
77
+ HARDWARE: "Hardware",
78
+ ACCESSORY: "Accessory",
79
+ BOOK: "Book",
80
+ EQUIPMENT: "Equipment",
81
+ APPAREL: "Apparel",
82
+ COLLECTIBLE: "Collectible",
83
+ CONSUMABLE: "Consumable"
84
+ }, he = {
85
+ PUBLISHED: {
86
+ label: "Published",
87
+ className: "text-status-success-text bg-status-success-bg-subtle"
88
+ },
89
+ PENDING_REVIEW: {
90
+ label: "Pending Review",
91
+ className: "text-status-warning-text bg-status-warning-bg-subtle"
92
+ },
93
+ DRAFT: {
94
+ label: "Draft",
95
+ className: "text-text-muted bg-bg-muted"
96
+ },
97
+ REJECTED: {
98
+ label: "Rejected",
99
+ className: "text-status-error-text bg-status-error-bg/10"
100
+ },
101
+ INACTIVE: {
102
+ label: "Inactive",
103
+ className: "text-text-muted bg-bg-muted"
104
+ }
105
+ }, ge = "\n query GetPhysicalProduct($id: ID!) {\n product(id: $id) {\n id\n name\n slug\n type\n status\n nature\n description\n longDescription\n price\n currency\n tags\n stockQuantity\n sku\n trackInventory\n allowBackorder\n lowStockThreshold\n requiresShipping\n weight\n weightUnit\n length\n width\n height\n dimensionUnit\n brand\n manufacturer\n countryOfOrigin\n warrantyInfo\n returnPolicy\n icon\n bannerUrl\n screenshots\n category\n viewCount\n rating\n reviewCount\n createdAt\n updatedAt\n submittedAt\n reviewedAt\n reviewNotes\n rejectedReason\n publishedAt\n }\n }\n", _e = "\n mutation UpdatePhysicalProduct(\n $id: ID!\n $input: UpdatePhysicalProductInput!\n ) {\n updatePhysicalProduct(id: $id, input: $input) {\n id\n name\n status\n }\n }\n", ve = "\n mutation SubmitProductForReview($id: ID!, $notes: String) {\n submitProduct(id: $id, notes: $notes) {\n id\n status\n }\n }\n";
106
+ function ye(e) {
107
+ return _.every((t) => {
75
108
  let n = e[t];
76
109
  return typeof n == "boolean" ? !0 : String(n).trim() !== "";
77
110
  });
78
111
  }
79
- var C = () => {
80
- let { navigate: y, basePath: C, apiGatewayUrl: le, authToken: w, workspacesGatewayUrl: ue, workspaceId: de, getWorkspaceToken: fe } = e(), { itemId: T } = se(), E = `${le || ""}/global/graphql`, [pe, D] = l(!0), [O, k] = l(null), [A, j] = l(null), [M, N] = l({
112
+ var v = ({ label: e, value: t }) => /* @__PURE__ */ h(g, {
113
+ treatment: "metric",
114
+ className: "p-4",
115
+ children: [/* @__PURE__ */ m("p", {
116
+ className: "text-sm text-text-secondary",
117
+ children: e
118
+ }), /* @__PURE__ */ m("p", {
119
+ className: "text-2xl font-bold tabular-nums",
120
+ children: t
121
+ })]
122
+ }), y = () => {
123
+ let { navigate: g, basePath: _, apiGatewayUrl: y, authToken: b, workspacesGatewayUrl: x, workspaceId: S, getWorkspaceToken: C } = e(), { itemId: w } = le(), T = `${y || ""}/global/graphql`, [be, E] = d(!0), [D, O] = d(null), [k, xe] = d(null), [A, j] = d("overview"), [M, Se] = d(null), [N, P] = d({
81
124
  name: "",
82
125
  shortDescription: "",
83
126
  longDescription: "",
@@ -101,13 +144,13 @@ var C = () => {
101
144
  countryOfOrigin: "",
102
145
  warrantyInfo: "",
103
146
  returnPolicy: ""
104
- }), [P, F] = l([]), [I, L] = l(!1), R = ne(null), { upload: z } = ee(ue, w, de, fe, "/DevPortal/Assets"), [B, V] = l(!1), [H, U] = l(null), [me, W] = l(!1), he = P.some((e) => e.uploading), G = ce(M) && !he;
105
- async function K(e, t) {
106
- let n = await (await fetch(E, {
147
+ }), [F, I] = d(""), [L, Ce] = d(""), [R, z] = d([]), { upload: we, uploading: B, progress: Te, error: Ee } = u(x, b, S, C, "/DevPortal/Assets"), { upload: De, uploading: V, progress: Oe, error: ke } = u(x, b, S, C, "/DevPortal/Assets"), { upload: Ae, uploading: H, progress: je, error: Me } = u(x, b, S, C, "/DevPortal/Assets"), [U, W] = d(!1), [G, K] = d(null), [Ne, q] = d(!1), Pe = B || V || H, J = ye(N) && !Pe;
148
+ async function Y(e, t) {
149
+ let n = await (await fetch(T, {
107
150
  method: "POST",
108
151
  headers: {
109
152
  "Content-Type": "application/json",
110
- ...w ? { Authorization: `Bearer ${w}` } : {}
153
+ ...b ? { Authorization: `Bearer ${b}` } : {}
111
154
  },
112
155
  credentials: "include",
113
156
  body: JSON.stringify({
@@ -119,18 +162,18 @@ var C = () => {
119
162
  return n.data;
120
163
  }
121
164
  te(() => {
122
- if (!T) return;
165
+ if (!w) return;
123
166
  let e = !1;
124
- return D(!0), k(null), (async () => {
167
+ return E(!0), O(null), (async () => {
125
168
  try {
126
- let t = await K(b, { id: T });
169
+ let t = await Y(ge, { id: w });
127
170
  if (e) return;
128
171
  let n = t.product;
129
172
  if (!n) {
130
- k("Product not found.");
173
+ O("Product not found.");
131
174
  return;
132
175
  }
133
- j(n.status), N({
176
+ xe(n.status), P({
134
177
  name: n.name,
135
178
  shortDescription: n.description ?? "",
136
179
  longDescription: n.longDescription ?? "",
@@ -154,121 +197,90 @@ var C = () => {
154
197
  countryOfOrigin: n.countryOfOrigin ?? "",
155
198
  warrantyInfo: n.warrantyInfo ?? "",
156
199
  returnPolicy: n.returnPolicy ?? ""
157
- }), F([n.icon, ...n.screenshots ?? []].filter((e) => !!e).map((e) => ({
158
- id: crypto.randomUUID(),
159
- url: e,
160
- downloadUrl: e,
161
- uploading: !1
162
- })));
200
+ }), Se({
201
+ slug: n.slug,
202
+ type: n.type,
203
+ category: n.category,
204
+ viewCount: n.viewCount,
205
+ rating: n.rating,
206
+ reviewCount: n.reviewCount,
207
+ createdAt: n.createdAt,
208
+ updatedAt: n.updatedAt,
209
+ submittedAt: n.submittedAt,
210
+ reviewedAt: n.reviewedAt,
211
+ reviewNotes: n.reviewNotes,
212
+ rejectedReason: n.rejectedReason,
213
+ publishedAt: n.publishedAt
214
+ }), I(n.icon ?? ""), Ce(n.bannerUrl ?? ""), z(n.screenshots ?? []);
163
215
  } catch (t) {
164
- e || k(t instanceof Error ? t.message : "Failed to load product");
216
+ e || O(t instanceof Error ? t.message : "Failed to load product");
165
217
  } finally {
166
- e || D(!1);
218
+ e || E(!1);
167
219
  }
168
220
  })(), () => {
169
221
  e = !0;
170
222
  };
171
223
  }, [
224
+ w,
172
225
  T,
173
- E,
174
- w
226
+ b
175
227
  ]);
176
- let q = (e, t) => {
177
- N((n) => ({
228
+ let X = (e, t) => {
229
+ P((n) => ({
178
230
  ...n,
179
231
  [e]: t
180
232
  }));
181
- }, J = (e) => (t) => {
182
- q(e, t.target.checked);
183
- }, Y = c((e, t) => {
184
- z(t).then((t) => {
185
- F((n) => n.map((n) => n.id === e ? {
186
- ...n,
187
- uploading: !1,
188
- downloadUrl: t.downloadUrl,
189
- error: void 0
190
- } : n));
191
- }).catch((t) => {
192
- F((n) => n.map((n) => n.id === e ? {
193
- ...n,
194
- uploading: !1,
195
- error: t instanceof Error ? t.message : "Upload failed"
196
- } : n));
197
- });
198
- }, [z]), X = c((e) => {
199
- let t = Array.from(e).filter((e) => e.type.startsWith("image/")).map((e) => ({
200
- id: crypto.randomUUID(),
201
- file: e,
202
- url: URL.createObjectURL(e),
203
- uploading: !0
204
- }));
205
- F((e) => [...e, ...t]), t.forEach((e) => Y(e.id, e.file));
206
- }, [Y]), ge = (e) => {
207
- e.target.files && X(e.target.files), e.target.value = "";
208
- }, _e = (e) => {
209
- e.preventDefault(), L(!1), e.dataTransfer.files && X(e.dataTransfer.files);
210
- }, ve = (e) => {
211
- e.preventDefault(), L(!0);
212
- }, Z = () => L(!1), ye = (e) => {
213
- F((t) => {
214
- let n = t.find((t) => t.id === e);
215
- return n?.file && URL.revokeObjectURL(n.url), t.filter((t) => t.id !== e);
216
- });
217
- }, be = (e) => {
218
- let t = P.find((t) => t.id === e);
219
- t?.file && (F((t) => t.map((t) => t.id === e ? {
220
- ...t,
221
- uploading: !0,
222
- error: void 0
223
- } : t)), Y(e, t.file));
224
- }, Q = async (e = !1) => {
225
- if (!(!G || B || !T)) {
226
- V(!0), U(null), W(!1);
233
+ }, Z = (e) => (t) => {
234
+ X(e, t.target.checked);
235
+ }, Fe = async (e = !1) => {
236
+ if (!(!J || U || !w)) {
237
+ W(!0), K(null), q(!1);
227
238
  try {
228
- let t = M.tags.split(",").map((e) => e.trim()).filter(Boolean), n = P.map((e) => e.downloadUrl).filter((e) => !!e), r = M.length.trim() || M.width.trim() || M.height.trim();
229
- await K(x, {
230
- id: T,
239
+ let t = N.tags.split(",").map((e) => e.trim()).filter(Boolean), n = N.length.trim() || N.width.trim() || N.height.trim();
240
+ await Y(_e, {
241
+ id: w,
231
242
  input: {
232
- name: M.name.trim(),
233
- description: M.shortDescription.trim(),
234
- longDescription: M.longDescription.trim() || null,
235
- price: parseFloat(M.price),
236
- currency: M.currency,
243
+ name: N.name.trim(),
244
+ description: N.shortDescription.trim(),
245
+ longDescription: N.longDescription.trim() || null,
246
+ price: parseFloat(N.price),
247
+ currency: N.currency,
237
248
  tags: t.length > 0 ? t : null,
238
- stockQuantity: parseInt(M.stockQuantity, 10),
239
- sku: M.sku.trim() || null,
240
- trackInventory: M.trackInventory,
241
- allowBackorder: M.allowBackorder,
242
- lowStockThreshold: M.lowStockThreshold.trim() ? parseInt(M.lowStockThreshold, 10) : null,
243
- requiresShipping: M.requiresShipping,
244
- weight: M.requiresShipping && M.weightKg.trim() ? parseFloat(M.weightKg) : null,
245
- weightUnit: M.requiresShipping && M.weightKg.trim() ? M.weightUnit : null,
246
- length: M.requiresShipping && M.length.trim() ? parseFloat(M.length) : null,
247
- width: M.requiresShipping && M.width.trim() ? parseFloat(M.width) : null,
248
- height: M.requiresShipping && M.height.trim() ? parseFloat(M.height) : null,
249
- dimensionUnit: M.requiresShipping && r ? M.dimensionUnit : null,
250
- brand: M.brand.trim() || null,
251
- manufacturer: M.manufacturer.trim() || null,
252
- countryOfOrigin: M.countryOfOrigin.trim() || null,
253
- warrantyInfo: M.warrantyInfo.trim() || null,
254
- returnPolicy: M.returnPolicy.trim() || null,
255
- icon: n[0] ?? null,
256
- screenshots: n.length > 1 ? n.slice(1) : null
249
+ stockQuantity: parseInt(N.stockQuantity, 10),
250
+ sku: N.sku.trim() || null,
251
+ trackInventory: N.trackInventory,
252
+ allowBackorder: N.allowBackorder,
253
+ lowStockThreshold: N.lowStockThreshold.trim() ? parseInt(N.lowStockThreshold, 10) : null,
254
+ requiresShipping: N.requiresShipping,
255
+ weight: N.requiresShipping && N.weightKg.trim() ? parseFloat(N.weightKg) : null,
256
+ weightUnit: N.requiresShipping && N.weightKg.trim() ? N.weightUnit : null,
257
+ length: N.requiresShipping && N.length.trim() ? parseFloat(N.length) : null,
258
+ width: N.requiresShipping && N.width.trim() ? parseFloat(N.width) : null,
259
+ height: N.requiresShipping && N.height.trim() ? parseFloat(N.height) : null,
260
+ dimensionUnit: N.requiresShipping && n ? N.dimensionUnit : null,
261
+ brand: N.brand.trim() || null,
262
+ manufacturer: N.manufacturer.trim() || null,
263
+ countryOfOrigin: N.countryOfOrigin.trim() || null,
264
+ warrantyInfo: N.warrantyInfo.trim() || null,
265
+ returnPolicy: N.returnPolicy.trim() || null,
266
+ icon: F || null,
267
+ bannerUrl: L || null,
268
+ screenshots: R.length > 0 ? R : null
257
269
  }
258
- }), e && await K(S, {
259
- id: T,
270
+ }), e && await Y(ve, {
271
+ id: w,
260
272
  notes: "Resubmitted after edits"
261
- }), W(!0), setTimeout(() => {
262
- y?.(`${C}/seller/items`);
273
+ }), q(!0), setTimeout(() => {
274
+ g?.(`${_}/seller/items`);
263
275
  }, 1500);
264
276
  } catch (e) {
265
- U(e instanceof Error ? e.message : "Save failed. Please try again.");
277
+ K(e instanceof Error ? e.message : "Save failed. Please try again.");
266
278
  } finally {
267
- V(!1);
279
+ W(!1);
268
280
  }
269
281
  }
270
282
  };
271
- if (pe) return /* @__PURE__ */ m(n, {
283
+ if (be) return /* @__PURE__ */ m(n, {
272
284
  title: "Edit Item",
273
285
  backLink: "/seller/items",
274
286
  backLabel: "Back to My Items",
@@ -277,395 +289,643 @@ var C = () => {
277
289
  children: /* @__PURE__ */ m(f, { className: "h-8 w-8 animate-spin text-text-secondary" })
278
290
  })
279
291
  });
280
- if (O) return /* @__PURE__ */ m(n, {
292
+ if (D) return /* @__PURE__ */ m(n, {
281
293
  title: "Edit Item",
282
294
  backLink: "/seller/items",
283
295
  backLabel: "Back to My Items",
284
296
  children: /* @__PURE__ */ h("div", {
285
297
  className: "flex items-center gap-3 rounded-lg border border-status-error-border/50 bg-status-error-bg/10 px-4 py-3 text-sm",
286
- children: [/* @__PURE__ */ m(u, {
298
+ children: [/* @__PURE__ */ m(ne, {
287
299
  size: 16,
288
300
  className: "shrink-0 text-status-error-text"
289
301
  }), /* @__PURE__ */ m("span", {
290
302
  className: "text-status-error-text",
291
- children: O
303
+ children: D
292
304
  })]
293
305
  })
294
306
  });
295
- let $ = A === "DRAFT" || A === "REJECTED";
307
+ let Q = k === "DRAFT" || k === "REJECTED", $ = k ? he[k] : void 0;
296
308
  return /* @__PURE__ */ m(n, {
297
- title: `Edit: ${M.name || "Item"}`,
298
- description: "Update your listing details. Changes take effect immediately for drafts; published items may require re-review.",
309
+ title: /* @__PURE__ */ h("div", {
310
+ className: "flex items-center gap-3",
311
+ children: [F ? /* @__PURE__ */ m("img", {
312
+ src: F,
313
+ alt: "",
314
+ className: "h-10 w-10 shrink-0 rounded-input border border-border-subtle object-cover"
315
+ }) : /* @__PURE__ */ m("div", {
316
+ className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-input border border-border-subtle bg-bg-sunken",
317
+ children: /* @__PURE__ */ m(oe, {
318
+ size: 16,
319
+ className: "text-text-muted"
320
+ })
321
+ }), /* @__PURE__ */ m("span", { children: N.name || "Item" })]
322
+ }),
323
+ description: N.shortDescription || void 0,
324
+ purpose: "Everything about this listing in one place — its performance, its store presence, and its editable details. Use the tabs to review or update it.",
299
325
  backLink: "/seller/items",
300
326
  backLabel: "Back to My Items",
327
+ actions: A === "overview" ? /* @__PURE__ */ h("button", {
328
+ type: "button",
329
+ onClick: () => j("edit"),
330
+ className: "inline-flex items-center gap-2 rounded-button bg-action-primary-bg px-5 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 transition-colors",
331
+ children: [/* @__PURE__ */ m(ae, { size: 15 }), "Edit Listing"]
332
+ }) : void 0,
301
333
  children: /* @__PURE__ */ h("div", {
302
- className: "space-y-8 max-w-3xl",
334
+ className: "space-y-6",
303
335
  children: [
304
- me && /* @__PURE__ */ m("div", {
336
+ Ne && /* @__PURE__ */ m("div", {
305
337
  className: "rounded-card border border-status-success-text/30 bg-status-success-bg-subtle px-4 py-3 text-sm text-status-success-text",
306
338
  children: "Saved successfully! Redirecting to your items..."
307
339
  }),
308
- H && /* @__PURE__ */ m("div", {
340
+ G && /* @__PURE__ */ m("div", {
309
341
  className: "rounded-card border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-3 text-sm text-status-error-text",
310
- children: H
342
+ children: G
311
343
  }),
312
- A && /* @__PURE__ */ h("div", {
313
- className: "flex items-start gap-2 rounded-input border border-border-subtle bg-bg-sunken px-3 py-2 text-xs text-text-secondary",
344
+ /* @__PURE__ */ h("div", {
345
+ className: "flex flex-wrap items-center gap-2",
314
346
  children: [
315
- /* @__PURE__ */ m(re, {
316
- size: 13,
317
- className: "mt-0.5 shrink-0 text-text-muted"
347
+ $ && /* @__PURE__ */ m("span", {
348
+ className: t("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium", $.className),
349
+ children: $.label
318
350
  }),
319
- "Current status:",
320
- " ",
321
351
  /* @__PURE__ */ m("span", {
322
- className: "font-medium text-text-primary",
323
- children: A.replace(/_/g, " ")
352
+ className: "text-sm text-text-secondary",
353
+ children: me[M?.type ?? ""] || M?.type
324
354
  }),
325
- $ && /* @__PURE__ */ m("span", {
326
- className: "ml-1",
327
- children: "— use \"Save & Resubmit\" to send it for review again."
355
+ M?.category && /* @__PURE__ */ m("span", {
356
+ className: "rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs text-text-secondary",
357
+ children: M.category
328
358
  })
329
359
  ]
330
360
  }),
331
- /* @__PURE__ */ m(r, {
332
- title: "Basic Information",
333
- description: "Core details shown in the store listing.",
334
- children: /* @__PURE__ */ h("div", {
335
- className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
361
+ k === "PENDING_REVIEW" && /* @__PURE__ */ h("div", {
362
+ className: "flex items-start gap-3 rounded-lg border border-border-subtle bg-status-warning-bg-subtle p-4",
363
+ children: [/* @__PURE__ */ m(ie, {
364
+ size: 18,
365
+ className: "text-status-warning-text mt-0.5 flex-shrink-0"
366
+ }), /* @__PURE__ */ h("div", {
367
+ className: "text-sm",
368
+ children: [/* @__PURE__ */ m("p", {
369
+ className: "font-medium text-status-warning-text",
370
+ children: "Under Review"
371
+ }), /* @__PURE__ */ h("p", {
372
+ className: "mt-0.5 text-text-secondary",
373
+ children: ["Your listing is being reviewed by our team. You'll be notified of the outcome.", M?.submittedAt && /* @__PURE__ */ h("span", {
374
+ className: "ml-1",
375
+ children: [
376
+ "Submitted",
377
+ " ",
378
+ new Date(M.submittedAt).toLocaleDateString(),
379
+ "."
380
+ ]
381
+ })]
382
+ })]
383
+ })]
384
+ }),
385
+ k === "REJECTED" && /* @__PURE__ */ h("div", {
386
+ className: "flex items-start gap-3 rounded-lg border border-status-error-bg bg-status-error-bg-subtle p-4",
387
+ children: [/* @__PURE__ */ m(ce, {
388
+ size: 18,
389
+ className: "text-status-error-text mt-0.5 flex-shrink-0"
390
+ }), /* @__PURE__ */ h("div", {
391
+ className: "text-sm",
336
392
  children: [
337
- /* @__PURE__ */ m(a, {
338
- label: "Name",
339
- required: !0,
340
- value: M.name,
341
- onChange: (e) => q("name", e.target.value),
342
- placeholder: "e.g. Wireless Ergonomic Keyboard",
343
- maxLength: 120
393
+ /* @__PURE__ */ m("p", {
394
+ className: "font-medium text-status-error-text",
395
+ children: "Review Rejected"
344
396
  }),
345
- /* @__PURE__ */ m(a, {
346
- label: "Short Description",
347
- required: !0,
348
- value: M.shortDescription,
349
- onChange: (e) => q("shortDescription", e.target.value),
350
- placeholder: "One-line summary shown on the store card",
351
- maxLength: 160,
352
- hint: `${M.shortDescription.length}/160`
397
+ /* @__PURE__ */ m("p", {
398
+ className: "mt-0.5 text-text-secondary",
399
+ children: M?.rejectedReason || M?.reviewNotes || "Your submission was not approved. Please review the feedback, update your listing, and re-submit."
353
400
  }),
354
- /* @__PURE__ */ m(s, {
355
- label: "Long Description",
356
- value: M.longDescription,
357
- onChange: (e) => q("longDescription", e.target.value),
358
- rows: 5,
359
- placeholder: "Detailed product description, features, specs…"
401
+ /* @__PURE__ */ m("button", {
402
+ type: "button",
403
+ onClick: () => j("edit"),
404
+ className: "mt-2 inline-flex items-center gap-1 text-xs font-medium text-primary underline",
405
+ children: "Edit listing and re-submit →"
360
406
  })
361
407
  ]
362
- })
408
+ })]
363
409
  }),
364
- /* @__PURE__ */ m(r, {
365
- title: "Product Images",
366
- description: "The first image is used as the main icon.",
367
- children: /* @__PURE__ */ h("div", {
368
- className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-4",
369
- children: [/* @__PURE__ */ h("div", {
370
- onDrop: _e,
371
- onDragOver: ve,
372
- onDragLeave: Z,
373
- onClick: () => R.current?.click(),
374
- className: t("flex flex-col items-center justify-center gap-3 rounded-input border-2 border-dashed px-6 py-10 cursor-pointer transition-colors", I ? "border-action-primary-bg bg-action-primary-bg/5" : "border-border-subtle hover:border-border-strong"),
375
- children: [
376
- /* @__PURE__ */ m(ae, {
377
- size: 28,
378
- className: I ? "text-action-primary-bg" : "text-text-muted"
379
- }),
380
- /* @__PURE__ */ h("div", {
381
- className: "text-center space-y-1",
382
- children: [/* @__PURE__ */ m("p", {
383
- className: "text-sm font-medium text-text-primary",
384
- children: "Drag and drop images here"
385
- }), /* @__PURE__ */ m("p", {
386
- className: "text-xs text-text-muted",
387
- children: "or click to browse — accepts any image format, multiple files"
388
- })]
389
- }),
390
- /* @__PURE__ */ m("input", {
391
- ref: R,
392
- type: "file",
393
- accept: "image/*",
394
- multiple: !0,
395
- className: "sr-only",
396
- onChange: ge
397
- })
398
- ]
399
- }), P.length > 0 && /* @__PURE__ */ m("div", {
400
- className: "flex flex-wrap gap-3",
401
- children: (() => {
402
- let e = P.find((e) => e.downloadUrl)?.id;
403
- return P.map((n, r) => /* @__PURE__ */ h("div", {
404
- className: "relative group",
405
- children: [
406
- /* @__PURE__ */ m("img", {
407
- src: n.url,
408
- alt: `Product image ${r + 1}`,
409
- className: t("h-20 w-20 rounded-input object-cover border", n.error ? "border-status-error-text/50" : "border-border-subtle")
410
- }),
411
- n.uploading && /* @__PURE__ */ m("div", {
412
- className: "absolute inset-0 flex items-center justify-center rounded-input bg-bg-overlay",
413
- children: /* @__PURE__ */ m(f, {
414
- size: 16,
415
- className: "animate-spin text-white"
416
- })
417
- }),
418
- n.error && /* @__PURE__ */ h("button", {
419
- type: "button",
420
- onClick: (e) => {
421
- e.stopPropagation(), be(n.id);
422
- },
423
- title: `${n.error} — click to retry`,
424
- className: "absolute inset-0 flex flex-col items-center justify-center gap-0.5 rounded-input bg-status-error-bg/80 text-status-error-text",
425
- children: [/* @__PURE__ */ m(d, { size: 14 }), /* @__PURE__ */ m(ie, { size: 11 })]
426
- }),
427
- n.id === e && /* @__PURE__ */ m("span", {
428
- className: "absolute bottom-0 left-0 right-0 rounded-b-input bg-bg-surface/80 text-center text-[10px] font-medium py-0.5 text-text-secondary",
429
- children: "Main"
430
- }),
431
- /* @__PURE__ */ m("button", {
432
- type: "button",
433
- onClick: (e) => {
434
- e.stopPropagation(), ye(n.id);
435
- },
436
- className: "absolute -top-1.5 -right-1.5 hidden group-hover:flex h-5 w-5 items-center justify-center rounded-full bg-bg-surface border border-border-subtle text-text-muted hover:text-status-error-text hover:border-status-error-text/40 transition-colors",
437
- "aria-label": "Remove image",
438
- children: /* @__PURE__ */ m(oe, { size: 11 })
439
- })
440
- ]
441
- }, n.id));
442
- })()
410
+ k === "PUBLISHED" && /* @__PURE__ */ h("div", {
411
+ className: "flex items-start gap-3 rounded-lg border border-status-success-bg bg-status-success-bg-subtle p-4",
412
+ children: [/* @__PURE__ */ m(re, {
413
+ size: 18,
414
+ className: "text-status-success-text mt-0.5 flex-shrink-0"
415
+ }), /* @__PURE__ */ h("div", {
416
+ className: "text-sm",
417
+ children: [/* @__PURE__ */ m("p", {
418
+ className: "font-medium text-status-success-text",
419
+ children: "Live in the Store"
420
+ }), /* @__PURE__ */ m("p", {
421
+ className: "mt-0.5 text-text-secondary",
422
+ children: "Your listing is published and visible to buyers in the marketplace."
443
423
  })]
444
- })
424
+ })]
445
425
  }),
446
- /* @__PURE__ */ m(r, {
447
- title: "Pricing",
448
- children: /* @__PURE__ */ h("div", {
449
- className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
450
- children: [/* @__PURE__ */ h("div", {
451
- className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
452
- children: [/* @__PURE__ */ m(a, {
453
- label: "Price",
454
- required: !0,
455
- type: "number",
456
- value: M.price,
457
- onChange: (e) => q("price", e.target.value),
458
- placeholder: "0.00",
459
- min: .01,
460
- step: "0.01"
461
- }), /* @__PURE__ */ m(o, {
462
- label: "Currency",
463
- required: !0,
464
- value: M.currency,
465
- onChange: (e) => q("currency", e.target.value),
466
- options: g,
467
- placeholder: "Select currency"
468
- })]
469
- }), /* @__PURE__ */ m(a, {
470
- label: "Tags",
471
- value: M.tags,
472
- onChange: (e) => q("tags", e.target.value),
473
- placeholder: "mechanical, wireless, ergonomic",
474
- hint: "Comma-separated keywords."
475
- })]
426
+ /* @__PURE__ */ m("div", {
427
+ className: "border-b",
428
+ children: /* @__PURE__ */ m("nav", {
429
+ className: "-mb-px flex gap-4 overflow-x-auto",
430
+ role: "tablist",
431
+ "aria-label": "Item sections",
432
+ children: [{
433
+ id: "overview",
434
+ label: "Overview"
435
+ }, {
436
+ id: "edit",
437
+ label: "Edit Listing"
438
+ }].map((e) => /* @__PURE__ */ m("button", {
439
+ id: `item-tab-${e.id}`,
440
+ role: "tab",
441
+ "aria-selected": A === e.id,
442
+ "aria-controls": `item-panel-${e.id}`,
443
+ onClick: () => j(e.id),
444
+ className: t("flex items-center gap-2 border-b-2 px-1 py-3 text-sm font-medium transition-colors", A === e.id ? "border-primary text-primary" : "border-transparent text-text-secondary hover:text-text-primary hover:border-muted-foreground"),
445
+ children: e.label
446
+ }, e.id))
476
447
  })
477
448
  }),
478
- /* @__PURE__ */ m(r, {
479
- title: "Inventory",
480
- children: /* @__PURE__ */ h("div", {
481
- className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
449
+ A === "overview" && /* @__PURE__ */ h("div", {
450
+ id: "item-panel-overview",
451
+ role: "tabpanel",
452
+ "aria-labelledby": "item-tab-overview",
453
+ className: "grid gap-6 lg:grid-cols-3",
454
+ children: [/* @__PURE__ */ h("div", {
455
+ className: "lg:col-span-2 space-y-6",
482
456
  children: [
483
- /* @__PURE__ */ h("div", {
484
- className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
485
- children: [/* @__PURE__ */ m(a, {
486
- label: "Stock Quantity",
487
- required: !0,
488
- type: "number",
489
- value: M.stockQuantity,
490
- onChange: (e) => q("stockQuantity", e.target.value),
491
- min: 0,
492
- step: 1
493
- }), /* @__PURE__ */ m(a, {
494
- label: "SKU",
495
- value: M.sku,
496
- onChange: (e) => q("sku", e.target.value),
497
- placeholder: "e.g. KB-WL-001",
498
- hint: "Your internal stock-keeping unit reference."
499
- })]
500
- }),
501
- /* @__PURE__ */ m(a, {
502
- label: "Low Stock Threshold",
503
- type: "number",
504
- value: M.lowStockThreshold,
505
- onChange: (e) => q("lowStockThreshold", e.target.value),
506
- placeholder: "e.g. 5",
507
- min: 0,
508
- step: 1,
509
- hint: "Get flagged when stock falls to or below this number."
457
+ /* @__PURE__ */ m(ue, { children: /* @__PURE__ */ h("div", {
458
+ className: "grid gap-4 sm:grid-cols-4",
459
+ children: [
460
+ /* @__PURE__ */ m(v, {
461
+ label: "Price",
462
+ value: `${N.currency} ${Number(N.price || 0).toFixed(2)}`
463
+ }),
464
+ /* @__PURE__ */ m(v, {
465
+ label: "Stock",
466
+ value: N.stockQuantity || "0"
467
+ }),
468
+ /* @__PURE__ */ m(v, {
469
+ label: "Views",
470
+ value: (M?.viewCount ?? 0).toLocaleString()
471
+ }),
472
+ /* @__PURE__ */ m(v, {
473
+ label: "Rating",
474
+ value: M?.rating ? `${M.rating.toFixed(1)} ★` : "N/A"
475
+ })
476
+ ]
477
+ }) }),
478
+ /* @__PURE__ */ m(r, {
479
+ title: "Product Images",
480
+ children: F || L || R.length > 0 ? /* @__PURE__ */ h("div", {
481
+ className: "space-y-4",
482
+ children: [/* @__PURE__ */ h("div", {
483
+ className: "flex flex-wrap gap-4",
484
+ children: [F && /* @__PURE__ */ h("div", {
485
+ className: "space-y-1",
486
+ children: [/* @__PURE__ */ m("img", {
487
+ src: F,
488
+ alt: "Icon",
489
+ className: "h-24 w-24 rounded-input border border-border-subtle object-cover"
490
+ }), /* @__PURE__ */ m("p", {
491
+ className: "text-xs text-text-muted",
492
+ children: "Icon"
493
+ })]
494
+ }), L && /* @__PURE__ */ h("div", {
495
+ className: "space-y-1",
496
+ children: [/* @__PURE__ */ m("img", {
497
+ src: L,
498
+ alt: "Banner",
499
+ className: "h-24 w-24 rounded-input border border-border-subtle object-cover"
500
+ }), /* @__PURE__ */ m("p", {
501
+ className: "text-xs text-text-muted",
502
+ children: "Banner"
503
+ })]
504
+ })]
505
+ }), R.length > 0 && /* @__PURE__ */ h("div", {
506
+ className: "space-y-1",
507
+ children: [/* @__PURE__ */ m("p", {
508
+ className: "text-xs text-text-muted",
509
+ children: "Screenshots"
510
+ }), /* @__PURE__ */ m("div", {
511
+ className: "flex flex-wrap gap-3",
512
+ children: R.map((e, t) => /* @__PURE__ */ m("img", {
513
+ src: e,
514
+ alt: `Screenshot ${t + 1}`,
515
+ className: "h-24 w-36 rounded-input border border-border-subtle object-cover"
516
+ }, e))
517
+ })]
518
+ })]
519
+ }) : /* @__PURE__ */ m("p", {
520
+ className: "text-sm text-text-secondary",
521
+ children: "No images uploaded yet."
522
+ })
510
523
  }),
511
- /* @__PURE__ */ m(i, {
512
- label: "Track Inventory",
513
- description: "Automatically reduce stock when orders are placed.",
514
- checked: M.trackInventory,
515
- onChange: J("trackInventory")
524
+ /* @__PURE__ */ h(r, {
525
+ title: "Description",
526
+ children: [N.shortDescription && /* @__PURE__ */ m("p", {
527
+ className: "text-sm font-medium text-text-primary",
528
+ children: N.shortDescription
529
+ }), N.longDescription ? /* @__PURE__ */ m("p", {
530
+ className: "mt-2 whitespace-pre-wrap text-sm text-text-secondary",
531
+ children: N.longDescription
532
+ }) : !N.shortDescription && /* @__PURE__ */ m("p", {
533
+ className: "text-sm text-text-secondary",
534
+ children: "No description provided."
535
+ })]
516
536
  }),
517
- /* @__PURE__ */ m(i, {
518
- label: "Allow Backorder",
519
- description: "Let buyers order even when stock quantity is zero.",
520
- checked: M.allowBackorder,
521
- onChange: J("allowBackorder")
537
+ N.tags && /* @__PURE__ */ m(r, {
538
+ title: "Tags",
539
+ children: /* @__PURE__ */ m("div", {
540
+ className: "flex flex-wrap gap-2",
541
+ children: N.tags.split(",").map((e) => e.trim()).filter(Boolean).map((e) => /* @__PURE__ */ m("span", {
542
+ className: "rounded-full bg-action-primary-bg/10 px-3 py-1 text-xs font-medium text-primary",
543
+ children: e
544
+ }, e))
545
+ })
522
546
  })
523
547
  ]
524
- })
525
- }),
526
- /* @__PURE__ */ m(r, {
527
- title: "Shipping",
528
- children: /* @__PURE__ */ h("div", {
529
- className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
530
- children: [/* @__PURE__ */ m(i, {
531
- label: "Requires Shipping",
532
- description: "This item will be physically shipped to the buyer.",
533
- checked: M.requiresShipping,
534
- onChange: J("requiresShipping")
535
- }), M.requiresShipping && /* @__PURE__ */ h(p, { children: [
536
- /* @__PURE__ */ h("div", {
537
- className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
538
- children: [/* @__PURE__ */ m(a, {
548
+ }), /* @__PURE__ */ h("div", {
549
+ className: "space-y-6",
550
+ children: [/* @__PURE__ */ m(r, {
551
+ title: "Details",
552
+ children: /* @__PURE__ */ m(i, { items: [
553
+ {
554
+ label: "Item ID",
555
+ value: /* @__PURE__ */ m("code", {
556
+ className: "text-xs",
557
+ children: w
558
+ })
559
+ },
560
+ {
561
+ label: "Slug",
562
+ value: M?.slug ?? "—"
563
+ },
564
+ {
565
+ label: "SKU",
566
+ value: N.sku || "—"
567
+ },
568
+ {
569
+ label: "Brand",
570
+ value: N.brand || "—"
571
+ },
572
+ {
573
+ label: "Created",
574
+ value: M?.createdAt ? new Date(M.createdAt).toLocaleDateString() : "—"
575
+ },
576
+ {
577
+ label: "Updated",
578
+ value: M?.updatedAt ? new Date(M.updatedAt).toLocaleDateString() : "—"
579
+ },
580
+ ...M?.publishedAt ? [{
581
+ label: "Published",
582
+ value: new Date(M.publishedAt).toLocaleDateString()
583
+ }] : []
584
+ ] })
585
+ }), /* @__PURE__ */ m(r, {
586
+ title: "Inventory & Shipping",
587
+ children: /* @__PURE__ */ m(i, { items: [
588
+ {
589
+ label: "Stock quantity",
590
+ value: N.stockQuantity || "0"
591
+ },
592
+ {
593
+ label: "Track inventory",
594
+ value: N.trackInventory ? "Yes" : "No"
595
+ },
596
+ {
597
+ label: "Requires shipping",
598
+ value: N.requiresShipping ? "Yes" : "No"
599
+ },
600
+ ...N.requiresShipping && N.weightKg ? [{
539
601
  label: "Weight",
540
- type: "number",
541
- value: M.weightKg,
542
- onChange: (e) => q("weightKg", e.target.value),
543
- placeholder: "0.0",
544
- min: 0,
545
- step: "0.01",
546
- hint: "Used to calculate shipping costs."
602
+ value: `${N.weightKg} ${N.weightUnit.toLowerCase()}`
603
+ }] : []
604
+ ] })
605
+ })]
606
+ })]
607
+ }),
608
+ A === "edit" && /* @__PURE__ */ h("div", {
609
+ id: "item-panel-edit",
610
+ role: "tabpanel",
611
+ "aria-labelledby": "item-tab-edit",
612
+ className: "space-y-8 max-w-3xl",
613
+ children: [
614
+ k && /* @__PURE__ */ h("div", {
615
+ className: "flex items-start gap-2 rounded-input border border-border-subtle bg-bg-sunken px-3 py-2 text-xs text-text-secondary",
616
+ children: [
617
+ /* @__PURE__ */ m(se, {
618
+ size: 13,
619
+ className: "mt-0.5 shrink-0 text-text-muted"
620
+ }),
621
+ "Current status:",
622
+ " ",
623
+ /* @__PURE__ */ m("span", {
624
+ className: "font-medium text-text-primary",
625
+ children: k.replace(/_/g, " ")
626
+ }),
627
+ Q && /* @__PURE__ */ m("span", {
628
+ className: "ml-1",
629
+ children: "— use \"Save & Resubmit\" to send it for review again."
630
+ })
631
+ ]
632
+ }),
633
+ /* @__PURE__ */ m(r, {
634
+ title: "Basic Information",
635
+ description: "Core details shown in the store listing.",
636
+ children: /* @__PURE__ */ h("div", {
637
+ className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
638
+ children: [
639
+ /* @__PURE__ */ m(o, {
640
+ label: "Name",
641
+ required: !0,
642
+ value: N.name,
643
+ onChange: (e) => X("name", e.target.value),
644
+ placeholder: "e.g. Wireless Ergonomic Keyboard",
645
+ maxLength: 120
646
+ }),
647
+ /* @__PURE__ */ m(o, {
648
+ label: "Short Description",
649
+ required: !0,
650
+ value: N.shortDescription,
651
+ onChange: (e) => X("shortDescription", e.target.value),
652
+ placeholder: "One-line summary shown on the store card",
653
+ maxLength: 160,
654
+ hint: `${N.shortDescription.length}/160`
655
+ }),
656
+ /* @__PURE__ */ m(c, {
657
+ label: "Long Description",
658
+ value: N.longDescription,
659
+ onChange: (e) => X("longDescription", e.target.value),
660
+ rows: 5,
661
+ placeholder: "Detailed product description, features, specs…"
662
+ })
663
+ ]
664
+ })
665
+ }),
666
+ /* @__PURE__ */ m(r, {
667
+ title: "Product Images",
668
+ description: "Visual assets shown to buyers browsing the store.",
669
+ children: /* @__PURE__ */ h("div", {
670
+ className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
671
+ children: [/* @__PURE__ */ h("div", {
672
+ className: "grid gap-5 sm:grid-cols-2",
673
+ children: [/* @__PURE__ */ m(l, {
674
+ label: "Icon",
675
+ value: F,
676
+ onChange: I,
677
+ hint: "Shown in marketplace cards and search — square proportions (1:1)",
678
+ aspectClass: "aspect-square",
679
+ upload: we,
680
+ uploading: B,
681
+ progress: Te,
682
+ error: Ee
683
+ }), /* @__PURE__ */ m(l, {
684
+ label: "Banner",
685
+ value: L,
686
+ onChange: Ce,
687
+ hint: "Fills the right panel on the product page — square or portrait works best on all screen sizes (1:1)",
688
+ aspectClass: "aspect-square",
689
+ upload: De,
690
+ uploading: V,
691
+ progress: Oe,
692
+ error: ke
693
+ })]
694
+ }), /* @__PURE__ */ m(ee, {
695
+ urls: R,
696
+ onChange: z,
697
+ upload: Ae,
698
+ uploading: H,
699
+ progress: je,
700
+ error: Me
701
+ })]
702
+ })
703
+ }),
704
+ /* @__PURE__ */ m(r, {
705
+ title: "Pricing",
706
+ children: /* @__PURE__ */ h("div", {
707
+ className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
708
+ children: [/* @__PURE__ */ h("div", {
709
+ className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
710
+ children: [/* @__PURE__ */ m(o, {
711
+ label: "Price",
712
+ required: !0,
713
+ type: "number",
714
+ value: N.price,
715
+ onChange: (e) => X("price", e.target.value),
716
+ placeholder: "0.00",
717
+ min: .01,
718
+ step: "0.01"
719
+ }), /* @__PURE__ */ m(s, {
720
+ label: "Currency",
721
+ required: !0,
722
+ value: N.currency,
723
+ onChange: (e) => X("currency", e.target.value),
724
+ options: de,
725
+ placeholder: "Select currency"
726
+ })]
547
727
  }), /* @__PURE__ */ m(o, {
548
- label: "Weight Unit",
549
- value: M.weightUnit,
550
- onChange: (e) => q("weightUnit", e.target.value),
551
- options: _
728
+ label: "Tags",
729
+ value: N.tags,
730
+ onChange: (e) => X("tags", e.target.value),
731
+ placeholder: "mechanical, wireless, ergonomic",
732
+ hint: "Comma-separated keywords."
552
733
  })]
553
- }),
554
- /* @__PURE__ */ h("div", {
555
- className: "grid grid-cols-1 gap-5 sm:grid-cols-3",
734
+ })
735
+ }),
736
+ /* @__PURE__ */ m(r, {
737
+ title: "Inventory",
738
+ children: /* @__PURE__ */ h("div", {
739
+ className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
556
740
  children: [
557
- /* @__PURE__ */ m(a, {
558
- label: "Length",
741
+ /* @__PURE__ */ h("div", {
742
+ className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
743
+ children: [/* @__PURE__ */ m(o, {
744
+ label: "Stock Quantity",
745
+ required: !0,
746
+ type: "number",
747
+ value: N.stockQuantity,
748
+ onChange: (e) => X("stockQuantity", e.target.value),
749
+ min: 0,
750
+ step: 1
751
+ }), /* @__PURE__ */ m(o, {
752
+ label: "SKU",
753
+ value: N.sku,
754
+ onChange: (e) => X("sku", e.target.value),
755
+ placeholder: "e.g. KB-WL-001",
756
+ hint: "Your internal stock-keeping unit reference."
757
+ })]
758
+ }),
759
+ /* @__PURE__ */ m(o, {
760
+ label: "Low Stock Threshold",
559
761
  type: "number",
560
- value: M.length,
561
- onChange: (e) => q("length", e.target.value),
562
- placeholder: "0.0",
762
+ value: N.lowStockThreshold,
763
+ onChange: (e) => X("lowStockThreshold", e.target.value),
764
+ placeholder: "e.g. 5",
563
765
  min: 0,
564
- step: "0.01"
766
+ step: 1,
767
+ hint: "Get flagged when stock falls to or below this number."
565
768
  }),
566
769
  /* @__PURE__ */ m(a, {
567
- label: "Width",
568
- type: "number",
569
- value: M.width,
570
- onChange: (e) => q("width", e.target.value),
571
- placeholder: "0.0",
572
- min: 0,
573
- step: "0.01"
770
+ label: "Track Inventory",
771
+ description: "Automatically reduce stock when orders are placed.",
772
+ checked: N.trackInventory,
773
+ onChange: Z("trackInventory")
574
774
  }),
575
775
  /* @__PURE__ */ m(a, {
576
- label: "Height",
577
- type: "number",
578
- value: M.height,
579
- onChange: (e) => q("height", e.target.value),
580
- placeholder: "0.0",
581
- min: 0,
582
- step: "0.01"
776
+ label: "Allow Backorder",
777
+ description: "Let buyers order even when stock quantity is zero.",
778
+ checked: N.allowBackorder,
779
+ onChange: Z("allowBackorder")
583
780
  })
584
781
  ]
585
- }),
586
- /* @__PURE__ */ m(o, {
587
- label: "Dimension Unit",
588
- value: M.dimensionUnit,
589
- onChange: (e) => q("dimensionUnit", e.target.value),
590
- options: v,
591
- hint: "Applies to length, width, and height above."
592
782
  })
593
- ] })]
594
- })
595
- }),
596
- /* @__PURE__ */ m(r, {
597
- title: "Product Details",
598
- description: "Optional supplemental information for buyers.",
599
- children: /* @__PURE__ */ h("div", {
600
- className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
601
- children: [
602
- /* @__PURE__ */ h("div", {
603
- className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
783
+ }),
784
+ /* @__PURE__ */ m(r, {
785
+ title: "Shipping",
786
+ children: /* @__PURE__ */ h("div", {
787
+ className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
604
788
  children: [/* @__PURE__ */ m(a, {
605
- label: "Brand",
606
- value: M.brand,
607
- onChange: (e) => q("brand", e.target.value),
608
- placeholder: "e.g. Logitech"
609
- }), /* @__PURE__ */ m(a, {
610
- label: "Manufacturer",
611
- value: M.manufacturer,
612
- onChange: (e) => q("manufacturer", e.target.value),
613
- placeholder: "e.g. Logitech Manufacturing Ltd."
614
- })]
615
- }),
616
- /* @__PURE__ */ m(a, {
617
- label: "Country of Origin",
618
- value: M.countryOfOrigin,
619
- onChange: (e) => q("countryOfOrigin", e.target.value),
620
- placeholder: "e.g. China"
621
- }),
622
- /* @__PURE__ */ m(a, {
623
- label: "Warranty Info",
624
- value: M.warrantyInfo,
625
- onChange: (e) => q("warrantyInfo", e.target.value),
626
- placeholder: "e.g. 1-year limited manufacturer warranty"
627
- }),
628
- /* @__PURE__ */ m(s, {
629
- label: "Return Policy",
630
- value: M.returnPolicy,
631
- onChange: (e) => q("returnPolicy", e.target.value),
632
- rows: 3,
633
- placeholder: "e.g. 30-day returns accepted"
789
+ label: "Requires Shipping",
790
+ description: "This item will be physically shipped to the buyer.",
791
+ checked: N.requiresShipping,
792
+ onChange: Z("requiresShipping")
793
+ }), N.requiresShipping && /* @__PURE__ */ h(p, { children: [
794
+ /* @__PURE__ */ h("div", {
795
+ className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
796
+ children: [/* @__PURE__ */ m(o, {
797
+ label: "Weight",
798
+ type: "number",
799
+ value: N.weightKg,
800
+ onChange: (e) => X("weightKg", e.target.value),
801
+ placeholder: "0.0",
802
+ min: 0,
803
+ step: "0.01",
804
+ hint: "Used to calculate shipping costs."
805
+ }), /* @__PURE__ */ m(s, {
806
+ label: "Weight Unit",
807
+ value: N.weightUnit,
808
+ onChange: (e) => X("weightUnit", e.target.value),
809
+ options: fe
810
+ })]
811
+ }),
812
+ /* @__PURE__ */ h("div", {
813
+ className: "grid grid-cols-1 gap-5 sm:grid-cols-3",
814
+ children: [
815
+ /* @__PURE__ */ m(o, {
816
+ label: "Length",
817
+ type: "number",
818
+ value: N.length,
819
+ onChange: (e) => X("length", e.target.value),
820
+ placeholder: "0.0",
821
+ min: 0,
822
+ step: "0.01"
823
+ }),
824
+ /* @__PURE__ */ m(o, {
825
+ label: "Width",
826
+ type: "number",
827
+ value: N.width,
828
+ onChange: (e) => X("width", e.target.value),
829
+ placeholder: "0.0",
830
+ min: 0,
831
+ step: "0.01"
832
+ }),
833
+ /* @__PURE__ */ m(o, {
834
+ label: "Height",
835
+ type: "number",
836
+ value: N.height,
837
+ onChange: (e) => X("height", e.target.value),
838
+ placeholder: "0.0",
839
+ min: 0,
840
+ step: "0.01"
841
+ })
842
+ ]
843
+ }),
844
+ /* @__PURE__ */ m(s, {
845
+ label: "Dimension Unit",
846
+ value: N.dimensionUnit,
847
+ onChange: (e) => X("dimensionUnit", e.target.value),
848
+ options: pe,
849
+ hint: "Applies to length, width, and height above."
850
+ })
851
+ ] })]
634
852
  })
635
- ]
636
- })
637
- }),
638
- /* @__PURE__ */ h("div", {
639
- className: "flex flex-wrap items-center gap-3 pb-8",
640
- children: [
641
- /* @__PURE__ */ m("button", {
642
- type: "button",
643
- onClick: () => y?.(`${C}/seller/items`),
644
- className: "rounded-button border border-border-strong px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken transition-colors",
645
- children: "Cancel"
646
853
  }),
647
- /* @__PURE__ */ m("button", {
648
- type: "button",
649
- onClick: () => void Q(!1),
650
- disabled: !G || B,
651
- "aria-disabled": !G || B,
652
- title: G ? void 0 : "Fill in all required fields to continue",
653
- className: t("inline-flex items-center gap-2 rounded-button px-5 py-2 text-sm font-medium transition-colors", "border border-border-strong bg-bg-surface text-text-primary", "hover:bg-bg-sunken", "disabled:opacity-50 disabled:cursor-not-allowed"),
654
- children: B ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(f, {
655
- size: 15,
656
- className: "animate-spin"
657
- }), "Saving..."] }) : "Save Changes"
854
+ /* @__PURE__ */ m(r, {
855
+ title: "Product Details",
856
+ description: "Optional supplemental information for buyers.",
857
+ children: /* @__PURE__ */ h("div", {
858
+ className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
859
+ children: [
860
+ /* @__PURE__ */ h("div", {
861
+ className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
862
+ children: [/* @__PURE__ */ m(o, {
863
+ label: "Brand",
864
+ value: N.brand,
865
+ onChange: (e) => X("brand", e.target.value),
866
+ placeholder: "e.g. Logitech"
867
+ }), /* @__PURE__ */ m(o, {
868
+ label: "Manufacturer",
869
+ value: N.manufacturer,
870
+ onChange: (e) => X("manufacturer", e.target.value),
871
+ placeholder: "e.g. Logitech Manufacturing Ltd."
872
+ })]
873
+ }),
874
+ /* @__PURE__ */ m(o, {
875
+ label: "Country of Origin",
876
+ value: N.countryOfOrigin,
877
+ onChange: (e) => X("countryOfOrigin", e.target.value),
878
+ placeholder: "e.g. China"
879
+ }),
880
+ /* @__PURE__ */ m(o, {
881
+ label: "Warranty Info",
882
+ value: N.warrantyInfo,
883
+ onChange: (e) => X("warrantyInfo", e.target.value),
884
+ placeholder: "e.g. 1-year limited manufacturer warranty"
885
+ }),
886
+ /* @__PURE__ */ m(c, {
887
+ label: "Return Policy",
888
+ value: N.returnPolicy,
889
+ onChange: (e) => X("returnPolicy", e.target.value),
890
+ rows: 3,
891
+ placeholder: "e.g. 30-day returns accepted"
892
+ })
893
+ ]
894
+ })
658
895
  }),
659
- $ && /* @__PURE__ */ m("button", {
660
- type: "button",
661
- onClick: () => void Q(!0),
662
- disabled: !G || B,
663
- "aria-disabled": !G || B,
664
- className: t("inline-flex items-center gap-2 rounded-button px-5 py-2 text-sm font-medium transition-colors", "bg-action-primary-bg text-action-primary-text", "hover:bg-action-primary-bg/90", "disabled:opacity-50 disabled:cursor-not-allowed"),
665
- children: B ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(f, {
666
- size: 15,
667
- className: "animate-spin"
668
- }), "Saving..."] }) : "Save & Resubmit for Review"
896
+ /* @__PURE__ */ h("div", {
897
+ className: "flex flex-wrap items-center gap-3 pb-8",
898
+ children: [
899
+ /* @__PURE__ */ m("button", {
900
+ type: "button",
901
+ onClick: () => g?.(`${_}/seller/items`),
902
+ className: "rounded-button border border-border-strong px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken transition-colors",
903
+ children: "Cancel"
904
+ }),
905
+ /* @__PURE__ */ m("button", {
906
+ type: "button",
907
+ onClick: () => void Fe(!1),
908
+ disabled: !J || U,
909
+ "aria-disabled": !J || U,
910
+ title: J ? void 0 : "Fill in all required fields to continue",
911
+ className: t("inline-flex items-center gap-2 rounded-button px-5 py-2 text-sm font-medium transition-colors", "border border-border-strong bg-bg-surface text-text-primary", "hover:bg-bg-sunken", "disabled:opacity-50 disabled:cursor-not-allowed"),
912
+ children: U ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(f, {
913
+ size: 15,
914
+ className: "animate-spin"
915
+ }), "Saving..."] }) : "Save Changes"
916
+ }),
917
+ Q && /* @__PURE__ */ m("button", {
918
+ type: "button",
919
+ onClick: () => void Fe(!0),
920
+ disabled: !J || U,
921
+ "aria-disabled": !J || U,
922
+ className: t("inline-flex items-center gap-2 rounded-button px-5 py-2 text-sm font-medium transition-colors", "bg-action-primary-bg text-action-primary-text", "hover:bg-action-primary-bg/90", "disabled:opacity-50 disabled:cursor-not-allowed"),
923
+ children: U ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(f, {
924
+ size: 15,
925
+ className: "animate-spin"
926
+ }), "Saving..."] }) : "Save & Resubmit for Review"
927
+ })
928
+ ]
669
929
  })
670
930
  ]
671
931
  })
@@ -674,6 +934,6 @@ var C = () => {
674
934
  });
675
935
  };
676
936
  //#endregion
677
- export { C as EditPhysicalItemPage };
937
+ export { y as EditPhysicalItemPage };
678
938
 
679
939
  //# sourceMappingURL=EditPhysicalItemPage.js.map