@burdenoff/microfe-devportal 2026.914.5 → 2026.914.7

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 (35) hide show
  1. package/dist/devportal/hooks/usePackageUpload.d.ts.map +1 -1
  2. package/dist/devportal/hooks/usePackageUpload.js.map +1 -1
  3. package/dist/devportal/pages/CreateOrganizationPage.d.ts.map +1 -1
  4. package/dist/devportal/pages/CreateOrganizationPage.js +11 -2
  5. package/dist/devportal/pages/CreateOrganizationPage.js.map +1 -1
  6. package/dist/devportal/pages/CreatePhysicalItemPage.d.ts.map +1 -1
  7. package/dist/devportal/pages/CreatePhysicalItemPage.js +237 -236
  8. package/dist/devportal/pages/CreatePhysicalItemPage.js.map +1 -1
  9. package/dist/devportal/pages/EditApplicationPage.d.ts.map +1 -1
  10. package/dist/devportal/pages/EditApplicationPage.js +4 -0
  11. package/dist/devportal/pages/EditApplicationPage.js.map +1 -1
  12. package/dist/devportal/pages/OrganizationDetailPage.js +144 -109
  13. package/dist/devportal/pages/OrganizationDetailPage.js.map +1 -1
  14. package/dist/devportal/pages/PublishPage.d.ts.map +1 -1
  15. package/dist/devportal/pages/PublishPage.js.map +1 -1
  16. package/dist/devportal/pages/RevenueDashboardPage.d.ts.map +1 -1
  17. package/dist/devportal/pages/RevenueDashboardPage.js +478 -258
  18. package/dist/devportal/pages/RevenueDashboardPage.js.map +1 -1
  19. package/dist/devportal/pages/SellerItemsPage.d.ts.map +1 -1
  20. package/dist/devportal/pages/SellerItemsPage.js.map +1 -1
  21. package/dist/devportal/providers/DevportalProvider.d.ts.map +1 -1
  22. package/dist/devportal/providers/DevportalProvider.js +31 -30
  23. package/dist/devportal/providers/DevportalProvider.js.map +1 -1
  24. package/dist/devportal/types/index.d.ts +10 -0
  25. package/dist/devportal/types/index.d.ts.map +1 -1
  26. package/dist/devportal/types/index.js.map +1 -1
  27. package/dist/generated/global-operations.d.ts +16 -0
  28. package/dist/generated/global-operations.d.ts.map +1 -1
  29. package/dist/generated/global-operations.js +74 -46
  30. package/dist/generated/global-operations.js.map +1 -1
  31. package/dist/generated/global-types.d.ts +15 -0
  32. package/dist/generated/global-types.d.ts.map +1 -1
  33. package/dist/generated/global-types.js +8 -0
  34. package/dist/generated/global-types.js.map +1 -0
  35. package/package.json +1 -1
@@ -2,13 +2,13 @@ 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
4
  import { CheckboxField as i, InputField as a, SelectField as o, TextareaField as s } from "../components/FormField.js";
5
- import { usePackageUpload as c } from "../hooks/usePackageUpload.js";
6
- import { useSellerOrganization as ee } from "../hooks/useSellerOrganization.js";
7
- import { useCallback as l, useRef as te, useState as u } from "react";
8
- import { AlertTriangle as d, Info as f, Loader2 as p, RotateCw as m, Upload as ne, X as re } from "lucide-react";
9
- import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
5
+ import { usePackageUpload as ee } from "../hooks/usePackageUpload.js";
6
+ import { useSellerOrganization as c } from "../hooks/useSellerOrganization.js";
7
+ import { useCallback as l, useRef as u, useState as d } from "react";
8
+ import { AlertTriangle as f, Info as p, Loader2 as m, RotateCw as te, Upload as h, X as g } from "lucide-react";
9
+ import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
10
10
  //#region src/devportal/pages/CreatePhysicalItemPage.tsx
11
- var v = [
11
+ var b = [
12
12
  {
13
13
  value: "MERCHANDISE",
14
14
  label: "Merchandise"
@@ -41,7 +41,7 @@ var v = [
41
41
  value: "CONSUMABLE",
42
42
  label: "Consumable"
43
43
  }
44
- ], y = [
44
+ ], ne = [
45
45
  {
46
46
  value: "agri-seeds",
47
47
  label: "Agri-Inputs — Seeds"
@@ -62,7 +62,7 @@ var v = [
62
62
  value: "agri-irrigation",
63
63
  label: "Agri-Inputs — Irrigation"
64
64
  }
65
- ], ie = [
65
+ ], re = [
66
66
  {
67
67
  value: "USD",
68
68
  label: "USD — US Dollar"
@@ -87,7 +87,7 @@ var v = [
87
87
  value: "AED",
88
88
  label: "AED — UAE Dirham"
89
89
  }
90
- ], ae = [
90
+ ], ie = [
91
91
  {
92
92
  value: "GRAM",
93
93
  label: "Grams (g)"
@@ -104,7 +104,7 @@ var v = [
104
104
  value: "POUND",
105
105
  label: "Pounds (lb)"
106
106
  }
107
- ], b = [
107
+ ], ae = [
108
108
  {
109
109
  value: "CENTIMETER",
110
110
  label: "Centimeters (cm)"
@@ -125,18 +125,18 @@ var v = [
125
125
  "price",
126
126
  "currency",
127
127
  "stockQuantity"
128
- ], S = "\n query SellerMyPublisher {\n myPublisher {\n id\n }\n }\n", C = "\n mutation RegisterPublisher($input: RegisterPublisherInput!) {\n registerPublisher(input: $input) {\n id\n name\n email\n }\n }\n", w = "\n mutation CreatePhysicalProduct($input: CreatePhysicalProductInput!) {\n createPhysicalProduct(input: $input) {\n id\n name\n slug\n status\n nature\n type\n price\n currency\n }\n }\n", T = "\n mutation SubmitProduct($id: ID!, $notes: String) {\n submitProduct(id: $id, notes: $notes) {\n id\n status\n }\n }\n";
129
- function E(e) {
128
+ ], oe = "\n query SellerMyPublisher {\n myPublisher {\n id\n }\n }\n", se = "\n mutation RegisterPublisher($input: RegisterPublisherInput!) {\n registerPublisher(input: $input) {\n id\n name\n email\n }\n }\n", ce = "\n mutation CreatePhysicalProduct($input: CreatePhysicalProductInput!) {\n createPhysicalProduct(input: $input) {\n id\n name\n slug\n status\n nature\n type\n price\n currency\n }\n }\n", S = "\n mutation SubmitProduct($id: ID!, $notes: String) {\n submitProduct(id: $id, notes: $notes) {\n id\n status\n }\n }\n";
129
+ function C(e) {
130
130
  return e.toLowerCase().replace(/[^a-z0-9]+/g, "-");
131
131
  }
132
- function D(e) {
132
+ function w(e) {
133
133
  return x.every((t) => {
134
134
  let n = e[t];
135
135
  return typeof n == "boolean" ? !0 : n.trim() !== "";
136
136
  });
137
137
  }
138
- var O = () => {
139
- let { navigate: x, basePath: O, apiGatewayUrl: k, authToken: A, workspacesGatewayUrl: oe, workspaceId: se, getWorkspaceToken: ce } = e(), { organization: j, organizations: M, loading: N, error: P, selectOrganization: F } = ee(), [I, L] = u({
138
+ var T = () => {
139
+ let { navigate: x, basePath: T, productId: E, apiGatewayUrl: D, authToken: O, workspacesGatewayUrl: k, workspaceId: le, getWorkspaceToken: ue } = e(), { organization: A, organizations: j, loading: M, error: N, selectOrganization: P } = c(), [F, I] = d({
140
140
  name: "",
141
141
  slug: "",
142
142
  type: "",
@@ -163,68 +163,68 @@ var O = () => {
163
163
  countryOfOrigin: "",
164
164
  warrantyInfo: "",
165
165
  returnPolicy: ""
166
- }), [R, z] = u([]), [B, V] = u(!1), H = te(null), { upload: U } = c(oe, A, se, ce, "/DevPortal/Assets"), [W, G] = u(!1), [K, q] = u(null), [le, ue] = u(!1), de = R.some((e) => e.uploading), J = D(I) && !!j && !de, fe = `${k || ""}/global/graphql`, Y = (e, t) => {
167
- L((n) => ({
166
+ }), [L, R] = d([]), [z, B] = d(!1), V = u(null), { upload: H } = ee(k, O, le, ue, "/DevPortal/Assets"), [U, W] = d(!1), [G, K] = d(null), [de, fe] = d(!1), pe = L.some((e) => e.uploading), q = w(F) && !!A && !pe, me = `${D || ""}/global/graphql`, J = (e, t) => {
167
+ I((n) => ({
168
168
  ...n,
169
169
  [e]: t
170
170
  }));
171
- }, pe = (e) => {
171
+ }, Y = (e) => {
172
172
  let t = e.target.value;
173
- L((e) => ({
173
+ I((e) => ({
174
174
  ...e,
175
175
  name: t,
176
- slug: E(t)
176
+ slug: C(t)
177
177
  }));
178
178
  }, X = (e) => (t) => {
179
- Y(e, t.target.checked);
179
+ J(e, t.target.checked);
180
180
  }, Z = l((e, t) => {
181
- U(t).then((t) => {
182
- z((n) => n.map((n) => n.id === e ? {
181
+ H(t).then((t) => {
182
+ R((n) => n.map((n) => n.id === e ? {
183
183
  ...n,
184
184
  uploading: !1,
185
185
  downloadUrl: t.downloadUrl,
186
186
  error: void 0
187
187
  } : n));
188
188
  }).catch((t) => {
189
- z((n) => n.map((n) => n.id === e ? {
189
+ R((n) => n.map((n) => n.id === e ? {
190
190
  ...n,
191
191
  uploading: !1,
192
192
  error: t instanceof Error ? t.message : "Upload failed"
193
193
  } : n));
194
194
  });
195
- }, [U]), Q = l((e) => {
195
+ }, [H]), Q = l((e) => {
196
196
  let t = Array.from(e).filter((e) => e.type.startsWith("image/")).map((e) => ({
197
197
  id: crypto.randomUUID(),
198
198
  file: e,
199
199
  url: URL.createObjectURL(e),
200
200
  uploading: !0
201
201
  }));
202
- z((e) => [...e, ...t]), t.forEach((e) => Z(e.id, e.file));
203
- }, [Z]), me = (e) => {
202
+ R((e) => [...e, ...t]), t.forEach((e) => Z(e.id, e.file));
203
+ }, [Z]), he = (e) => {
204
204
  e.target.files && Q(e.target.files), e.target.value = "";
205
- }, he = (e) => {
206
- e.preventDefault(), V(!1), e.dataTransfer.files && Q(e.dataTransfer.files);
207
205
  }, ge = (e) => {
208
- e.preventDefault(), V(!0);
209
- }, _e = () => V(!1), ve = (e) => {
210
- z((t) => {
206
+ e.preventDefault(), B(!1), e.dataTransfer.files && Q(e.dataTransfer.files);
207
+ }, _e = (e) => {
208
+ e.preventDefault(), B(!0);
209
+ }, ve = () => B(!1), ye = (e) => {
210
+ R((t) => {
211
211
  let n = t.find((t) => t.id === e);
212
212
  return n && URL.revokeObjectURL(n.url), t.filter((t) => t.id !== e);
213
213
  });
214
- }, ye = (e) => {
215
- let t = R.find((t) => t.id === e);
216
- t && (z((t) => t.map((t) => t.id === e ? {
214
+ }, be = (e) => {
215
+ let t = L.find((t) => t.id === e);
216
+ t && (R((t) => t.map((t) => t.id === e ? {
217
217
  ...t,
218
218
  uploading: !0,
219
219
  error: void 0
220
220
  } : t)), Z(e, t.file));
221
221
  };
222
222
  async function $(e, t) {
223
- let n = await (await fetch(fe, {
223
+ let n = await (await fetch(me, {
224
224
  method: "POST",
225
225
  headers: {
226
226
  "Content-Type": "application/json",
227
- ...A ? { Authorization: `Bearer ${A}` } : {}
227
+ ...O ? { Authorization: `Bearer ${O}` } : {}
228
228
  },
229
229
  credentials: "include",
230
230
  body: JSON.stringify({
@@ -235,188 +235,188 @@ var O = () => {
235
235
  if (n.errors?.length) throw Error(n.errors.map((e) => e.message).join("; "));
236
236
  return n.data;
237
237
  }
238
- return /* @__PURE__ */ g(n, {
238
+ return /* @__PURE__ */ v(n, {
239
239
  title: "List a Physical Item",
240
240
  description: "Fill in all required details. Your listing will be reviewed before it appears in the store.",
241
241
  backLink: "/seller/items",
242
242
  backLabel: "Back to My Items",
243
- children: /* @__PURE__ */ _("div", {
243
+ children: /* @__PURE__ */ y("div", {
244
244
  className: "space-y-8 max-w-3xl",
245
245
  children: [
246
- le && /* @__PURE__ */ g("div", {
246
+ de && /* @__PURE__ */ v("div", {
247
247
  className: "rounded-card border border-status-success-text/30 bg-status-success-bg-subtle px-4 py-3 text-sm text-status-success-text",
248
248
  children: "Your listing has been submitted for review! Redirecting..."
249
249
  }),
250
- K && /* @__PURE__ */ g("div", {
250
+ G && /* @__PURE__ */ v("div", {
251
251
  className: "rounded-card border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-3 text-sm text-status-error-text",
252
- children: K
252
+ children: G
253
253
  }),
254
- P && /* @__PURE__ */ _("div", {
254
+ N && /* @__PURE__ */ y("div", {
255
255
  className: "rounded-card border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-3 text-sm text-status-error-text",
256
- children: ["Couldn't set up your seller organization: ", P]
256
+ children: ["Couldn't set up your seller organization: ", N]
257
257
  }),
258
- /* @__PURE__ */ g(r, {
258
+ /* @__PURE__ */ v(r, {
259
259
  title: "Seller Organization",
260
260
  description: "The seller organization this item will be listed under.",
261
- children: /* @__PURE__ */ g("div", {
261
+ children: /* @__PURE__ */ v("div", {
262
262
  className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-3",
263
- children: /* @__PURE__ */ g(o, {
263
+ children: /* @__PURE__ */ v(o, {
264
264
  label: "Organization",
265
265
  required: !0,
266
- value: j?.id ?? "",
267
- onChange: (e) => F(e.target.value),
268
- options: M.map((e) => ({
266
+ value: A?.id ?? "",
267
+ onChange: (e) => P(e.target.value),
268
+ options: j.map((e) => ({
269
269
  value: e.id,
270
270
  label: e.name
271
271
  })),
272
- placeholder: N ? "Resolving your seller organization…" : "Select an organization",
273
- disabled: N || M.length <= 1,
274
- hint: M.length > 1 ? "You have more than one seller organization — pick the one this item belongs to." : j ? `Automatically set to your only seller organization, "${j.name}".` : void 0
272
+ placeholder: M ? "Resolving your seller organization…" : "Select an organization",
273
+ disabled: M || j.length <= 1,
274
+ hint: j.length > 1 ? "You have more than one seller organization — pick the one this item belongs to." : A ? `Automatically set to your only seller organization, "${A.name}".` : void 0
275
275
  })
276
276
  })
277
277
  }),
278
- /* @__PURE__ */ g(r, {
278
+ /* @__PURE__ */ v(r, {
279
279
  title: "Basic Information",
280
280
  description: "Core details shown in the store listing.",
281
- children: /* @__PURE__ */ _("div", {
281
+ children: /* @__PURE__ */ y("div", {
282
282
  className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
283
283
  children: [
284
- /* @__PURE__ */ g(a, {
284
+ /* @__PURE__ */ v(a, {
285
285
  label: "Name",
286
286
  required: !0,
287
- value: I.name,
288
- onChange: pe,
287
+ value: F.name,
288
+ onChange: Y,
289
289
  placeholder: "e.g. Wireless Ergonomic Keyboard",
290
290
  maxLength: 120
291
291
  }),
292
- /* @__PURE__ */ g(a, {
292
+ /* @__PURE__ */ v(a, {
293
293
  label: "Slug",
294
294
  required: !0,
295
- value: I.slug,
296
- onChange: (e) => Y("slug", e.target.value),
295
+ value: F.slug,
296
+ onChange: (e) => J("slug", e.target.value),
297
297
  placeholder: "auto-derived-from-name",
298
298
  hint: "URL-friendly identifier. Auto-derived from name; you can edit it."
299
299
  }),
300
- /* @__PURE__ */ g(o, {
300
+ /* @__PURE__ */ v(o, {
301
301
  label: "Product Type",
302
302
  required: !0,
303
- value: I.type,
304
- onChange: (e) => Y("type", e.target.value),
305
- options: v,
303
+ value: F.type,
304
+ onChange: (e) => J("type", e.target.value),
305
+ options: b,
306
306
  placeholder: "Select a type"
307
307
  }),
308
- /* @__PURE__ */ g(o, {
308
+ /* @__PURE__ */ v(o, {
309
309
  label: "Store Category",
310
- value: I.category,
311
- onChange: (e) => Y("category", e.target.value),
312
- options: y,
310
+ value: F.category,
311
+ onChange: (e) => J("category", e.target.value),
312
+ options: ne,
313
313
  placeholder: "General / uncategorised",
314
314
  hint: "Pick an Agri-Inputs category to list this item in the HealthyBowl Agri-Inputs Store. Leave blank for a general store listing."
315
315
  }),
316
- /* @__PURE__ */ g(a, {
316
+ /* @__PURE__ */ v(a, {
317
317
  label: "Short Description",
318
318
  required: !0,
319
- value: I.shortDescription,
320
- onChange: (e) => Y("shortDescription", e.target.value),
319
+ value: F.shortDescription,
320
+ onChange: (e) => J("shortDescription", e.target.value),
321
321
  placeholder: "One-line summary shown on the store card",
322
322
  maxLength: 160,
323
- hint: `${I.shortDescription.length}/160`
323
+ hint: `${F.shortDescription.length}/160`
324
324
  }),
325
- /* @__PURE__ */ g(s, {
325
+ /* @__PURE__ */ v(s, {
326
326
  label: "Long Description",
327
- value: I.longDescription,
328
- onChange: (e) => Y("longDescription", e.target.value),
327
+ value: F.longDescription,
328
+ onChange: (e) => J("longDescription", e.target.value),
329
329
  rows: 5,
330
330
  placeholder: "Detailed product description, features, specs…"
331
331
  })
332
332
  ]
333
333
  })
334
334
  }),
335
- /* @__PURE__ */ g(r, {
335
+ /* @__PURE__ */ v(r, {
336
336
  title: "Product Images",
337
337
  description: "The first image is used as the main icon.",
338
- children: /* @__PURE__ */ _("div", {
338
+ children: /* @__PURE__ */ y("div", {
339
339
  className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-4",
340
340
  children: [
341
- /* @__PURE__ */ _("div", {
342
- onDrop: he,
343
- onDragOver: ge,
344
- onDragLeave: _e,
345
- onClick: () => H.current?.click(),
346
- 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", B ? "border-action-primary-bg bg-action-primary-bg/5" : "border-border-subtle hover:border-border-strong"),
341
+ /* @__PURE__ */ y("div", {
342
+ onDrop: ge,
343
+ onDragOver: _e,
344
+ onDragLeave: ve,
345
+ onClick: () => V.current?.click(),
346
+ 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", z ? "border-action-primary-bg bg-action-primary-bg/5" : "border-border-subtle hover:border-border-strong"),
347
347
  children: [
348
- /* @__PURE__ */ g(ne, {
348
+ /* @__PURE__ */ v(h, {
349
349
  size: 28,
350
- className: B ? "text-action-primary-bg" : "text-text-muted"
350
+ className: z ? "text-action-primary-bg" : "text-text-muted"
351
351
  }),
352
- /* @__PURE__ */ _("div", {
352
+ /* @__PURE__ */ y("div", {
353
353
  className: "text-center space-y-1",
354
- children: [/* @__PURE__ */ g("p", {
354
+ children: [/* @__PURE__ */ v("p", {
355
355
  className: "text-sm font-medium text-text-primary",
356
356
  children: "Drag and drop images here"
357
- }), /* @__PURE__ */ g("p", {
357
+ }), /* @__PURE__ */ v("p", {
358
358
  className: "text-xs text-text-muted",
359
359
  children: "or click to browse — accepts any image format, multiple files"
360
360
  })]
361
361
  }),
362
- /* @__PURE__ */ g("input", {
363
- ref: H,
362
+ /* @__PURE__ */ v("input", {
363
+ ref: V,
364
364
  type: "file",
365
365
  accept: "image/*",
366
366
  multiple: !0,
367
367
  className: "sr-only",
368
- onChange: me
368
+ onChange: he
369
369
  })
370
370
  ]
371
371
  }),
372
- R.length > 0 && /* @__PURE__ */ g("div", {
372
+ L.length > 0 && /* @__PURE__ */ v("div", {
373
373
  className: "flex flex-wrap gap-3",
374
374
  children: (() => {
375
- let e = R.find((e) => e.downloadUrl)?.id;
376
- return R.map((n, r) => /* @__PURE__ */ _("div", {
375
+ let e = L.find((e) => e.downloadUrl)?.id;
376
+ return L.map((n, r) => /* @__PURE__ */ y("div", {
377
377
  className: "relative group",
378
378
  children: [
379
- /* @__PURE__ */ g("img", {
379
+ /* @__PURE__ */ v("img", {
380
380
  src: n.url,
381
381
  alt: `Product image ${r + 1}`,
382
382
  className: t("h-20 w-20 rounded-input object-cover border", n.error ? "border-status-error-text/50" : "border-border-subtle")
383
383
  }),
384
- n.uploading && /* @__PURE__ */ g("div", {
384
+ n.uploading && /* @__PURE__ */ v("div", {
385
385
  className: "absolute inset-0 flex items-center justify-center rounded-input bg-bg-overlay",
386
- children: /* @__PURE__ */ g(p, {
386
+ children: /* @__PURE__ */ v(m, {
387
387
  size: 16,
388
388
  className: "animate-spin text-white"
389
389
  })
390
390
  }),
391
- n.error && /* @__PURE__ */ _("button", {
391
+ n.error && /* @__PURE__ */ y("button", {
392
392
  type: "button",
393
393
  onClick: (e) => {
394
- e.stopPropagation(), ye(n.id);
394
+ e.stopPropagation(), be(n.id);
395
395
  },
396
396
  title: `${n.error} — click to retry`,
397
397
  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",
398
- children: [/* @__PURE__ */ g(d, { size: 14 }), /* @__PURE__ */ g(m, { size: 11 })]
398
+ children: [/* @__PURE__ */ v(f, { size: 14 }), /* @__PURE__ */ v(te, { size: 11 })]
399
399
  }),
400
- n.id === e && /* @__PURE__ */ g("span", {
400
+ n.id === e && /* @__PURE__ */ v("span", {
401
401
  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",
402
402
  children: "Main"
403
403
  }),
404
- /* @__PURE__ */ g("button", {
404
+ /* @__PURE__ */ v("button", {
405
405
  type: "button",
406
406
  onClick: (e) => {
407
- e.stopPropagation(), ve(n.id);
407
+ e.stopPropagation(), ye(n.id);
408
408
  },
409
409
  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",
410
410
  "aria-label": "Remove image",
411
- children: /* @__PURE__ */ g(re, { size: 11 })
411
+ children: /* @__PURE__ */ v(g, { size: 11 })
412
412
  })
413
413
  ]
414
414
  }, n.id));
415
415
  })()
416
416
  }),
417
- /* @__PURE__ */ _("p", {
417
+ /* @__PURE__ */ y("p", {
418
418
  className: "flex items-start gap-2 rounded-input border border-border-subtle bg-bg-sunken px-3 py-2 text-xs text-text-secondary",
419
- children: [/* @__PURE__ */ g(f, {
419
+ children: [/* @__PURE__ */ v(p, {
420
420
  size: 13,
421
421
  className: "mt-0.5 shrink-0 text-text-muted"
422
422
  }), "At least 1 image helps buyers — high quality photos increase conversions. The first image becomes the main icon."]
@@ -424,159 +424,159 @@ var O = () => {
424
424
  ]
425
425
  })
426
426
  }),
427
- /* @__PURE__ */ g(r, {
427
+ /* @__PURE__ */ v(r, {
428
428
  title: "Pricing",
429
- children: /* @__PURE__ */ _("div", {
429
+ children: /* @__PURE__ */ y("div", {
430
430
  className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
431
- children: [/* @__PURE__ */ _("div", {
431
+ children: [/* @__PURE__ */ y("div", {
432
432
  className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
433
- children: [/* @__PURE__ */ g(a, {
433
+ children: [/* @__PURE__ */ v(a, {
434
434
  label: "Price",
435
435
  required: !0,
436
436
  type: "number",
437
- value: I.price,
438
- onChange: (e) => Y("price", e.target.value),
437
+ value: F.price,
438
+ onChange: (e) => J("price", e.target.value),
439
439
  placeholder: "0.00",
440
440
  min: .01,
441
441
  step: "0.01"
442
- }), /* @__PURE__ */ g(o, {
442
+ }), /* @__PURE__ */ v(o, {
443
443
  label: "Currency",
444
444
  required: !0,
445
- value: I.currency,
446
- onChange: (e) => Y("currency", e.target.value),
447
- options: ie,
445
+ value: F.currency,
446
+ onChange: (e) => J("currency", e.target.value),
447
+ options: re,
448
448
  placeholder: "Select currency"
449
449
  })]
450
- }), /* @__PURE__ */ g(a, {
450
+ }), /* @__PURE__ */ v(a, {
451
451
  label: "Tags",
452
- value: I.tags,
453
- onChange: (e) => Y("tags", e.target.value),
452
+ value: F.tags,
453
+ onChange: (e) => J("tags", e.target.value),
454
454
  placeholder: "mechanical, wireless, ergonomic",
455
455
  hint: "Comma-separated keywords to help buyers find your item."
456
456
  })]
457
457
  })
458
458
  }),
459
- /* @__PURE__ */ g(r, {
459
+ /* @__PURE__ */ v(r, {
460
460
  title: "Inventory",
461
- children: /* @__PURE__ */ _("div", {
461
+ children: /* @__PURE__ */ y("div", {
462
462
  className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
463
463
  children: [
464
- /* @__PURE__ */ _("div", {
464
+ /* @__PURE__ */ y("div", {
465
465
  className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
466
- children: [/* @__PURE__ */ g(a, {
466
+ children: [/* @__PURE__ */ v(a, {
467
467
  label: "Stock Quantity",
468
468
  required: !0,
469
469
  type: "number",
470
- value: I.stockQuantity,
471
- onChange: (e) => Y("stockQuantity", e.target.value),
470
+ value: F.stockQuantity,
471
+ onChange: (e) => J("stockQuantity", e.target.value),
472
472
  min: 0,
473
473
  step: 1
474
- }), /* @__PURE__ */ g(a, {
474
+ }), /* @__PURE__ */ v(a, {
475
475
  label: "SKU",
476
- value: I.sku,
477
- onChange: (e) => Y("sku", e.target.value),
476
+ value: F.sku,
477
+ onChange: (e) => J("sku", e.target.value),
478
478
  placeholder: "e.g. KB-WL-001",
479
479
  hint: "Your internal stock-keeping unit reference."
480
480
  })]
481
481
  }),
482
- /* @__PURE__ */ g(a, {
482
+ /* @__PURE__ */ v(a, {
483
483
  label: "Low Stock Threshold",
484
484
  type: "number",
485
- value: I.lowStockThreshold,
486
- onChange: (e) => Y("lowStockThreshold", e.target.value),
485
+ value: F.lowStockThreshold,
486
+ onChange: (e) => J("lowStockThreshold", e.target.value),
487
487
  placeholder: "e.g. 5",
488
488
  min: 0,
489
489
  step: 1,
490
490
  hint: "Get flagged when stock falls to or below this number."
491
491
  }),
492
- /* @__PURE__ */ g(i, {
492
+ /* @__PURE__ */ v(i, {
493
493
  label: "Track Inventory",
494
494
  description: "Automatically reduce stock when orders are placed.",
495
- checked: I.trackInventory,
495
+ checked: F.trackInventory,
496
496
  onChange: X("trackInventory")
497
497
  }),
498
- /* @__PURE__ */ g(i, {
498
+ /* @__PURE__ */ v(i, {
499
499
  label: "Allow Backorder",
500
500
  description: "Let buyers order even when stock quantity is zero.",
501
- checked: I.allowBackorder,
501
+ checked: F.allowBackorder,
502
502
  onChange: X("allowBackorder")
503
503
  })
504
504
  ]
505
505
  })
506
506
  }),
507
- /* @__PURE__ */ g(r, {
507
+ /* @__PURE__ */ v(r, {
508
508
  title: "Shipping",
509
- children: /* @__PURE__ */ _("div", {
509
+ children: /* @__PURE__ */ y("div", {
510
510
  className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
511
511
  children: [
512
- /* @__PURE__ */ g(i, {
512
+ /* @__PURE__ */ v(i, {
513
513
  label: "Requires Shipping",
514
514
  description: "This item will be physically shipped to the buyer.",
515
- checked: I.requiresShipping,
515
+ checked: F.requiresShipping,
516
516
  onChange: X("requiresShipping")
517
517
  }),
518
- I.requiresShipping && /* @__PURE__ */ _(h, { children: [
519
- /* @__PURE__ */ _("div", {
518
+ F.requiresShipping && /* @__PURE__ */ y(_, { children: [
519
+ /* @__PURE__ */ y("div", {
520
520
  className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
521
- children: [/* @__PURE__ */ g(a, {
521
+ children: [/* @__PURE__ */ v(a, {
522
522
  label: "Weight",
523
523
  type: "number",
524
- value: I.weightKg,
525
- onChange: (e) => Y("weightKg", e.target.value),
524
+ value: F.weightKg,
525
+ onChange: (e) => J("weightKg", e.target.value),
526
526
  placeholder: "0.0",
527
527
  min: 0,
528
528
  step: "0.01",
529
529
  hint: "Used to calculate shipping costs."
530
- }), /* @__PURE__ */ g(o, {
530
+ }), /* @__PURE__ */ v(o, {
531
531
  label: "Weight Unit",
532
- value: I.weightUnit,
533
- onChange: (e) => Y("weightUnit", e.target.value),
534
- options: ae
532
+ value: F.weightUnit,
533
+ onChange: (e) => J("weightUnit", e.target.value),
534
+ options: ie
535
535
  })]
536
536
  }),
537
- /* @__PURE__ */ _("div", {
537
+ /* @__PURE__ */ y("div", {
538
538
  className: "grid grid-cols-1 gap-5 sm:grid-cols-3",
539
539
  children: [
540
- /* @__PURE__ */ g(a, {
540
+ /* @__PURE__ */ v(a, {
541
541
  label: "Length",
542
542
  type: "number",
543
- value: I.length,
544
- onChange: (e) => Y("length", e.target.value),
543
+ value: F.length,
544
+ onChange: (e) => J("length", e.target.value),
545
545
  placeholder: "0.0",
546
546
  min: 0,
547
547
  step: "0.01"
548
548
  }),
549
- /* @__PURE__ */ g(a, {
549
+ /* @__PURE__ */ v(a, {
550
550
  label: "Width",
551
551
  type: "number",
552
- value: I.width,
553
- onChange: (e) => Y("width", e.target.value),
552
+ value: F.width,
553
+ onChange: (e) => J("width", e.target.value),
554
554
  placeholder: "0.0",
555
555
  min: 0,
556
556
  step: "0.01"
557
557
  }),
558
- /* @__PURE__ */ g(a, {
558
+ /* @__PURE__ */ v(a, {
559
559
  label: "Height",
560
560
  type: "number",
561
- value: I.height,
562
- onChange: (e) => Y("height", e.target.value),
561
+ value: F.height,
562
+ onChange: (e) => J("height", e.target.value),
563
563
  placeholder: "0.0",
564
564
  min: 0,
565
565
  step: "0.01"
566
566
  })
567
567
  ]
568
568
  }),
569
- /* @__PURE__ */ g(o, {
569
+ /* @__PURE__ */ v(o, {
570
570
  label: "Dimension Unit",
571
- value: I.dimensionUnit,
572
- onChange: (e) => Y("dimensionUnit", e.target.value),
573
- options: b,
571
+ value: F.dimensionUnit,
572
+ onChange: (e) => J("dimensionUnit", e.target.value),
573
+ options: ae,
574
574
  hint: "Applies to length, width, and height above."
575
575
  })
576
576
  ] }),
577
- /* @__PURE__ */ _("p", {
577
+ /* @__PURE__ */ y("p", {
578
578
  className: "flex items-start gap-2 rounded-input border border-border-subtle bg-bg-sunken px-3 py-2 text-xs text-text-secondary",
579
- children: [/* @__PURE__ */ g(f, {
579
+ children: [/* @__PURE__ */ v(p, {
580
580
  size: 13,
581
581
  className: "mt-0.5 shrink-0 text-text-muted"
582
582
  }), "Delivery fees are configured at the organization level in store settings."]
@@ -584,124 +584,125 @@ var O = () => {
584
584
  ]
585
585
  })
586
586
  }),
587
- /* @__PURE__ */ g(r, {
587
+ /* @__PURE__ */ v(r, {
588
588
  title: "Product Details",
589
589
  description: "Optional supplemental information for buyers.",
590
- children: /* @__PURE__ */ _("div", {
590
+ children: /* @__PURE__ */ y("div", {
591
591
  className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
592
592
  children: [
593
- /* @__PURE__ */ _("div", {
593
+ /* @__PURE__ */ y("div", {
594
594
  className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
595
- children: [/* @__PURE__ */ g(a, {
595
+ children: [/* @__PURE__ */ v(a, {
596
596
  label: "Brand",
597
- value: I.brand,
598
- onChange: (e) => Y("brand", e.target.value),
597
+ value: F.brand,
598
+ onChange: (e) => J("brand", e.target.value),
599
599
  placeholder: "e.g. Logitech"
600
- }), /* @__PURE__ */ g(a, {
600
+ }), /* @__PURE__ */ v(a, {
601
601
  label: "Manufacturer",
602
- value: I.manufacturer,
603
- onChange: (e) => Y("manufacturer", e.target.value),
602
+ value: F.manufacturer,
603
+ onChange: (e) => J("manufacturer", e.target.value),
604
604
  placeholder: "e.g. Logitech Manufacturing Ltd."
605
605
  })]
606
606
  }),
607
- /* @__PURE__ */ g(a, {
607
+ /* @__PURE__ */ v(a, {
608
608
  label: "Country of Origin",
609
- value: I.countryOfOrigin,
610
- onChange: (e) => Y("countryOfOrigin", e.target.value),
609
+ value: F.countryOfOrigin,
610
+ onChange: (e) => J("countryOfOrigin", e.target.value),
611
611
  placeholder: "e.g. China"
612
612
  }),
613
- /* @__PURE__ */ g(a, {
613
+ /* @__PURE__ */ v(a, {
614
614
  label: "Warranty Info",
615
- value: I.warrantyInfo,
616
- onChange: (e) => Y("warrantyInfo", e.target.value),
615
+ value: F.warrantyInfo,
616
+ onChange: (e) => J("warrantyInfo", e.target.value),
617
617
  placeholder: "e.g. 1-year limited manufacturer warranty"
618
618
  }),
619
- /* @__PURE__ */ g(s, {
619
+ /* @__PURE__ */ v(s, {
620
620
  label: "Return Policy",
621
- value: I.returnPolicy,
622
- onChange: (e) => Y("returnPolicy", e.target.value),
621
+ value: F.returnPolicy,
622
+ onChange: (e) => J("returnPolicy", e.target.value),
623
623
  rows: 3,
624
624
  placeholder: "e.g. 30-day returns accepted"
625
625
  })
626
626
  ]
627
627
  })
628
628
  }),
629
- /* @__PURE__ */ _("div", {
629
+ /* @__PURE__ */ y("div", {
630
630
  className: "flex items-center gap-3 pb-8",
631
- children: [/* @__PURE__ */ g("button", {
631
+ children: [/* @__PURE__ */ v("button", {
632
632
  type: "button",
633
- onClick: () => x?.(`${O}/seller/items`),
633
+ onClick: () => x?.(`${T}/seller/items`),
634
634
  className: "rounded-button border border-border-strong px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken transition-colors",
635
635
  children: "Cancel"
636
- }), /* @__PURE__ */ g("div", {
636
+ }), /* @__PURE__ */ v("div", {
637
637
  className: "relative",
638
- children: /* @__PURE__ */ g("button", {
638
+ children: /* @__PURE__ */ v("button", {
639
639
  type: "button",
640
640
  onClick: async () => {
641
- if (!(!J || W || !j)) {
642
- G(!0), q(null);
641
+ if (!(!q || U || !A)) {
642
+ W(!0), K(null);
643
643
  try {
644
- let e = (await $(S)).myPublisher?.id ?? null;
645
- e ||= (await $(C, { input: {
646
- name: j.legalEntityName ?? j.name,
647
- email: j.contactEmail ?? "seller@burdenoff.com",
648
- websiteUrl: j.websiteUrl ?? null,
649
- legalName: j.legalEntityName ?? j.name,
650
- country: j.taxCountry ?? null,
651
- contactEmail: j.contactEmail ?? null
644
+ let e = (await $(oe)).myPublisher?.id ?? null;
645
+ e ||= (await $(se, { input: {
646
+ name: A.legalEntityName ?? A.name,
647
+ email: A.contactEmail ?? "seller@burdenoff.com",
648
+ websiteUrl: A.websiteUrl ?? null,
649
+ legalName: A.legalEntityName ?? A.name,
650
+ country: A.taxCountry ?? null,
651
+ contactEmail: A.contactEmail ?? null
652
652
  } })).registerPublisher.id;
653
- let t = I.tags.split(",").map((e) => e.trim()).filter(Boolean), n = R.map((e) => e.downloadUrl).filter((e) => !!e), r = I.length.trim() || I.width.trim() || I.height.trim(), i = (await $(w, { input: {
654
- name: I.name.trim(),
655
- slug: I.slug.trim(),
656
- type: I.type,
657
- category: I.category.trim() || null,
658
- description: I.shortDescription.trim(),
659
- longDescription: I.longDescription.trim() || null,
660
- price: parseFloat(I.price),
661
- currency: I.currency,
653
+ let t = F.tags.split(",").map((e) => e.trim()).filter(Boolean), n = L.map((e) => e.downloadUrl).filter((e) => !!e), r = F.length.trim() || F.width.trim() || F.height.trim(), i = (await $(ce, { input: {
654
+ name: F.name.trim(),
655
+ slug: F.slug.trim(),
656
+ type: F.type,
657
+ category: F.category.trim() || null,
658
+ description: F.shortDescription.trim(),
659
+ longDescription: F.longDescription.trim() || null,
660
+ price: parseFloat(F.price),
661
+ currency: F.currency,
662
662
  tags: t.length > 0 ? t : null,
663
- stockQuantity: parseInt(I.stockQuantity, 10),
664
- sku: I.sku.trim() || null,
665
- trackInventory: I.trackInventory,
666
- allowBackorder: I.allowBackorder,
667
- lowStockThreshold: I.lowStockThreshold.trim() ? parseInt(I.lowStockThreshold, 10) : null,
668
- requiresShipping: I.requiresShipping,
669
- weight: I.requiresShipping && I.weightKg.trim() ? parseFloat(I.weightKg) : null,
670
- weightUnit: I.requiresShipping && I.weightKg.trim() ? I.weightUnit : null,
671
- length: I.requiresShipping && I.length.trim() ? parseFloat(I.length) : null,
672
- width: I.requiresShipping && I.width.trim() ? parseFloat(I.width) : null,
673
- height: I.requiresShipping && I.height.trim() ? parseFloat(I.height) : null,
674
- dimensionUnit: I.requiresShipping && r ? I.dimensionUnit : null,
675
- brand: I.brand.trim() || null,
676
- manufacturer: I.manufacturer.trim() || null,
677
- countryOfOrigin: I.countryOfOrigin.trim() || null,
678
- warrantyInfo: I.warrantyInfo.trim() || null,
679
- returnPolicy: I.returnPolicy.trim() || null,
663
+ stockQuantity: parseInt(F.stockQuantity, 10),
664
+ sku: F.sku.trim() || null,
665
+ trackInventory: F.trackInventory,
666
+ allowBackorder: F.allowBackorder,
667
+ lowStockThreshold: F.lowStockThreshold.trim() ? parseInt(F.lowStockThreshold, 10) : null,
668
+ requiresShipping: F.requiresShipping,
669
+ weight: F.requiresShipping && F.weightKg.trim() ? parseFloat(F.weightKg) : null,
670
+ weightUnit: F.requiresShipping && F.weightKg.trim() ? F.weightUnit : null,
671
+ length: F.requiresShipping && F.length.trim() ? parseFloat(F.length) : null,
672
+ width: F.requiresShipping && F.width.trim() ? parseFloat(F.width) : null,
673
+ height: F.requiresShipping && F.height.trim() ? parseFloat(F.height) : null,
674
+ dimensionUnit: F.requiresShipping && r ? F.dimensionUnit : null,
675
+ brand: F.brand.trim() || null,
676
+ manufacturer: F.manufacturer.trim() || null,
677
+ countryOfOrigin: F.countryOfOrigin.trim() || null,
678
+ warrantyInfo: F.warrantyInfo.trim() || null,
679
+ returnPolicy: F.returnPolicy.trim() || null,
680
680
  icon: n[0] ?? null,
681
681
  screenshots: n.length > 1 ? n.slice(1) : null,
682
- organizationId: j.id
682
+ compatibleProducts: E ? [E] : null,
683
+ organizationId: A.id
683
684
  } })).createPhysicalProduct.id;
684
- await $(T, {
685
+ await $(S, {
685
686
  id: i,
686
687
  notes: "Submitted from seller portal"
687
- }), ue(!0), setTimeout(() => {
688
- x?.(`${O}/seller/items`);
688
+ }), fe(!0), setTimeout(() => {
689
+ x?.(`${T}/seller/items`);
689
690
  }, 2e3);
690
691
  } catch (e) {
691
- q(e instanceof Error ? e.message : "Submission failed. Please try again.");
692
+ K(e instanceof Error ? e.message : "Submission failed. Please try again.");
692
693
  } finally {
693
- G(!1);
694
+ W(!1);
694
695
  }
695
696
  }
696
697
  },
697
- disabled: !J || W,
698
- "aria-disabled": !J || W,
699
- title: N ? "Setting up your seller organization..." : J ? void 0 : "Fill in all required fields to continue",
698
+ disabled: !q || U,
699
+ "aria-disabled": !q || U,
700
+ title: M ? "Setting up your seller organization..." : q ? void 0 : "Fill in all required fields to continue",
700
701
  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", "focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2"),
701
- children: W ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(p, {
702
+ children: U ? /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(m, {
702
703
  size: 15,
703
704
  className: "animate-spin"
704
- }), "Submitting..."] }) : N ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(p, {
705
+ }), "Submitting..."] }) : M ? /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(m, {
705
706
  size: 15,
706
707
  className: "animate-spin"
707
708
  }), "Setting up your store..."] }) : "Create & Submit for Review"
@@ -713,6 +714,6 @@ var O = () => {
713
714
  });
714
715
  };
715
716
  //#endregion
716
- export { O as CreatePhysicalItemPage };
717
+ export { T as CreatePhysicalItemPage };
717
718
 
718
719
  //# sourceMappingURL=CreatePhysicalItemPage.js.map