@nextblock-cms/ecom 0.14.3 → 0.14.5

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,22 +1,22 @@
1
1
  'use client';
2
- import { jsxDEV as e, Fragment as je } from "react/jsx-dev-runtime";
3
- import V, { useState as B, useRef as Ue, useEffect as F, useCallback as J } from "react";
4
- import { zodResolver as Ge } from "@hookform/resolvers/zod";
5
- import { AlertCircle as Be, CheckCircle2 as es, Info as ss } from "lucide-react";
6
- import { Select as me, SelectTrigger as le, SelectValue as ne, SelectContent as de, SelectItem as R, Badge as L, Label as x, Input as h, Button as He } from "@nextblock-cms/ui";
2
+ import { jsxDEV as e, Fragment as Pe } from "react/jsx-dev-runtime";
3
+ import M, { useState as U, useRef as Ce, useEffect as F, useCallback as $ } from "react";
4
+ import { zodResolver as Ye } from "@hookform/resolvers/zod";
5
+ import { AlertCircle as Fe, CheckCircle2 as Qe, Info as We } from "lucide-react";
6
+ import { Select as Ze, SelectTrigger as Ge, SelectValue as es, SelectContent as ss, SelectItem as ye, Badge as J, Label as _, Input as x, Button as Re } from "@nextblock-cms/ui";
7
7
  import { productSchema as rs } from "../../../../product-schema.es.js";
8
8
  import { useForm as os } from "react-hook-form";
9
9
  import { ProductMediaManager as ts } from "./ProductMediaManager.es.js";
10
10
  import { SyncFreemiusPricingButton as cs } from "./SyncFreemiusPricingButton.es.js";
11
11
  import { VariationsEditor as is } from "./VariationsEditor.es.js";
12
- import { CurrencyPriceFields as De } from "./CurrencyPriceFields.es.js";
13
- import { SaleScheduleFields as Se } from "./SaleScheduleFields.es.js";
12
+ import { CurrencyPriceFields as je } from "./CurrencyPriceFields.es.js";
13
+ import { SaleScheduleFields as Ue } from "./SaleScheduleFields.es.js";
14
14
  import { ProductCategorySelector as ms } from "./ProductCategorySelector.es.js";
15
- import { getStoreManagedPriceCurrencyCodes as ls, resolveEditorCurrencyPriceMaps as ns, sanitizeProductFormValuesForStoreManagedCurrencies as Ie } from "../product-price-sync.es.js";
15
+ import { getStoreManagedPriceCurrencyCodes as ls, resolveEditorCurrencyPriceMaps as ns, sanitizeProductFormValuesForStoreManagedCurrencies as Me } from "../product-price-sync.es.js";
16
16
  import { derivePaymentProviderFromProductType as ds } from "../../../../types.es.js";
17
- import { convertMinorUnitAmount as we } from "../../../../currency.es.js";
18
- import { majorUnitAmountToMinor as Me, minorUnitAmountToMajor as Ve } from "@nextblock-cms/utils";
19
- function X({ title: s, description: o, action: g, children: p, hideHeader: y }) {
17
+ import { convertMinorUnitAmount as Be } from "../../../../currency.es.js";
18
+ import { majorUnitAmountToMinor as He, minorUnitAmountToMajor as De } from "@nextblock-cms/utils";
19
+ function L({ title: s, description: o, action: h, children: p, hideHeader: y }) {
20
20
  return /* @__PURE__ */ e("section", { className: "rounded-lg border bg-card p-3 shadow-sm space-y-3", children: [
21
21
  !y && /* @__PURE__ */ e("div", { className: "flex items-start justify-between gap-4 flex-wrap border-b border-muted/50 pb-2 mb-1", children: [
22
22
  /* @__PURE__ */ e("div", { className: "space-y-0.5", children: [
@@ -35,7 +35,7 @@ function X({ title: s, description: o, action: g, children: p, hideHeader: y })
35
35
  lineNumber: 120,
36
36
  columnNumber: 11
37
37
  }, this),
38
- g
38
+ h
39
39
  ] }, void 0, !0, {
40
40
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
41
41
  lineNumber: 119,
@@ -52,29 +52,29 @@ function X({ title: s, description: o, action: g, children: p, hideHeader: y })
52
52
  columnNumber: 5
53
53
  }, this);
54
54
  }
55
- function as(s, o, g) {
55
+ function as(s, o, h) {
56
56
  const p = o ? Number.parseInt(o, 10) : void 0;
57
- return s?.language_id || (Number.isFinite(p) ? p : void 0) || g.find((y) => y.is_default)?.id || g[0]?.id || 1;
57
+ return s?.language_id || (Number.isFinite(p) ? p : void 0) || h.find((y) => y.is_default)?.id || h[0]?.id || 1;
58
58
  }
59
- function Ae(s, o, g, p, y) {
60
- const H = (p.find((k) => k.is_default) ?? p[0])?.code || "USD", w = s?.prices && Object.keys(s.prices).length > 0 ? s.prices : {
61
- [H]: typeof s?.price == "number" ? s.price / 100 : 0
62
- }, A = s?.sale_prices && Object.keys(s.sale_prices).length > 0 ? s.sale_prices : typeof s?.sale_price == "number" ? {
63
- [H]: s.sale_price / 100
64
- } : {}, T = s?.product_type || "", D = s?.payment_provider || (s?.product_type ? ds(s.product_type) : "stripe");
59
+ function Se(s, o, h, p, y) {
60
+ const B = (p.find((g) => g.is_default) ?? p[0])?.code || "USD", S = s?.prices && Object.keys(s.prices).length > 0 ? s.prices : {
61
+ [B]: typeof s?.price == "number" ? s.price / 100 : 0
62
+ }, V = s?.sale_prices && Object.keys(s.sale_prices).length > 0 ? s.sale_prices : typeof s?.sale_price == "number" ? {
63
+ [B]: s.sale_price / 100
64
+ } : {}, A = s?.product_type || "", H = s?.payment_provider || (s?.product_type ? ds(s.product_type) : "stripe");
65
65
  return {
66
- ...Ie({
67
- product_type: T || "physical",
68
- payment_provider: D,
66
+ ...Me({
67
+ product_type: A || "physical",
68
+ payment_provider: H,
69
69
  title: s?.title || "",
70
70
  slug: s?.slug || "",
71
71
  sku: s?.sku || "",
72
72
  upc: s?.upc || "",
73
73
  is_taxable: s?.is_taxable ?? !0,
74
74
  price: typeof s?.price == "number" ? s.price / 100 : 0,
75
- prices: w,
75
+ prices: S,
76
76
  sale_price: typeof s?.sale_price == "number" ? s.sale_price / 100 : null,
77
- sale_prices: A,
77
+ sale_prices: V,
78
78
  stock: s?.stock || 0,
79
79
  meta_title: s?.meta_title || "",
80
80
  meta_description: s?.meta_description || "",
@@ -92,32 +92,32 @@ function Ae(s, o, g, p, y) {
92
92
  language_id: as(
93
93
  s,
94
94
  o,
95
- g
95
+ h
96
96
  ),
97
97
  translation_group_id: s?.translation_group_id || y || void 0,
98
- product_media: s?.product_media?.map((k) => ({
99
- media_id: k.media_id
98
+ product_media: s?.product_media?.map((g) => ({
99
+ media_id: g.media_id
100
100
  })) || [],
101
101
  category_ids: s?.category_ids || [],
102
102
  variation_attributes: s?.variation_attributes || [],
103
- variants: s?.variants?.map((k) => ({
104
- ...k,
105
- prices: k.prices || {},
106
- sale_prices: k.sale_prices || {}
103
+ variants: s?.variants?.map((g) => ({
104
+ ...g,
105
+ prices: g.prices || {},
106
+ sale_prices: g.sale_prices || {}
107
107
  })) || []
108
108
  }, p),
109
- product_type: T,
110
- payment_provider: D
109
+ product_type: A,
110
+ payment_provider: H
111
111
  };
112
112
  }
113
- function Te(s) {
113
+ function we(s) {
114
114
  return s ? s.map((o) => ({
115
115
  id: o.id || o.media_id,
116
116
  media_id: o.media_id,
117
117
  file_path: o.media?.file_path || o.media?.object_key || "",
118
118
  alt: o.media?.alt_text || "",
119
119
  sort_order: o.sort_order ?? 0
120
- })).sort((o, g) => o.sort_order - g.sort_order) : [];
120
+ })).sort((o, h) => o.sort_order - h.sort_order) : [];
121
121
  }
122
122
  function us(s) {
123
123
  return s.map((o) => ({ media_id: o.media_id }));
@@ -133,71 +133,71 @@ const Ns = (s) => s.toString().toLowerCase().trim().replace(/\s+/g, "-").replace
133
133
  function Ds({
134
134
  initialData: s,
135
135
  isEdit: o = !1,
136
- mediaPickerNode: g,
136
+ mediaPickerNode: h,
137
137
  availableLanguagesProp: p,
138
138
  globalAttributesProp: y,
139
- currenciesProp: Y,
140
- translationGroupId: H,
141
- targetLanguageId: w,
142
- freemiusDashboardNode: A,
143
- enabledProviders: T,
144
- configStatus: D,
145
- createAction: Q,
146
- updateAction: k,
147
- availableCategoriesProp: Oe = [],
148
- hasOpenDraft: qe = !1
139
+ currenciesProp: X,
140
+ translationGroupId: B,
141
+ targetLanguageId: S,
142
+ freemiusDashboardNode: V,
143
+ enabledProviders: A,
144
+ configStatus: H,
145
+ createAction: Y,
146
+ updateAction: g,
147
+ availableCategoriesProp: Ve = [],
148
+ hasOpenDraft: Ae = !1
149
149
  }) {
150
- const [I, O] = B(!1), [W, Z] = B(() => !!s?.variants?.length), n = V.useMemo(
151
- () => Y.filter((r) => r.is_active !== !1).sort((r, c) => r.is_default !== c.is_default ? r.is_default ? -1 : 1 : r.code.localeCompare(c.code)),
152
- [Y]
153
- ), m = V.useMemo(
150
+ const [T, I] = U(!1), [Q, W] = U(() => !!s?.variants?.length), n = M.useMemo(
151
+ () => X.filter((r) => r.is_active !== !1).sort((r, c) => r.is_default !== c.is_default ? r.is_default ? -1 : 1 : r.code.localeCompare(c.code)),
152
+ [X]
153
+ ), i = M.useMemo(
154
154
  () => n.find((r) => r.is_default) ?? n[0],
155
155
  [n]
156
- ), q = V.useMemo(
156
+ ), O = M.useMemo(
157
157
  () => ls(n),
158
158
  [n]
159
- ), ae = os({
160
- resolver: Ge(rs),
161
- defaultValues: Ae(
159
+ ), ie = os({
160
+ resolver: Ye(rs),
161
+ defaultValues: Se(
162
162
  s,
163
- w,
163
+ S,
164
164
  p,
165
165
  n,
166
- H
166
+ B
167
167
  )
168
168
  }), {
169
- register: l,
170
- handleSubmit: G,
169
+ register: m,
170
+ handleSubmit: Z,
171
171
  setValue: t,
172
- reset: ue,
173
- watch: i,
174
- setError: z,
175
- formState: { errors: N, dirtyFields: pe }
176
- } = ae, Ne = Ue(!0), ee = Ue(null), [ze, E] = B(!1), [be, K] = B(null), [fe, Ee] = B(null), se = i(), xe = ae.formState.isDirty;
172
+ reset: me,
173
+ watch: l,
174
+ setError: q,
175
+ formState: { errors: N, dirtyFields: le }
176
+ } = ie, ne = Ce(!0), G = Ce(null), [Te, z] = U(!1), [de, E] = U(null), [ae, Ie] = U(null), ee = l(), ue = ie.formState.isDirty;
177
177
  F(() => {
178
178
  if (!o) return;
179
- if (Ne.current) {
180
- Ne.current = !1, ee.current = JSON.stringify(se);
179
+ if (ne.current) {
180
+ ne.current = !1, G.current = JSON.stringify(ee);
181
181
  return;
182
182
  }
183
- if (!xe) return;
184
- const r = JSON.stringify(se);
185
- if (r === ee.current) return;
183
+ if (!ue) return;
184
+ const r = JSON.stringify(ee);
185
+ if (r === G.current) return;
186
186
  const c = setTimeout(() => {
187
- I || (ee.current = r, G(Re)());
187
+ T || (G.current = r, Z(_e)());
188
188
  }, 400);
189
189
  return () => clearTimeout(c);
190
- }, [se, o, xe, I, G]);
191
- const he = i("title"), M = i("product_type"), u = M === "digital" ? "freemius" : M === "physical" ? "stripe" : void 0, v = M === "physical", ge = M === "digital", re = u ? T[u] : !1, oe = u ? D[u].hasKeys : !1, Ke = !!i("freemius_product_id"), ke = Number(i("trial_period_days") || 0), ve = !!i("trial_requires_payment_method"), $e = i("variants") || [], j = i("price"), S = i("sale_price"), P = i("prices") || {}, U = i("sale_prices") || {}, _ = ($e?.length || 0) > 0, Je = i("language_id"), Le = p.find((r) => r.id === Je)?.code || p.find((r) => r.is_default)?.code || p[0]?.code, $ = V.useMemo(
190
+ }, [ee, o, ue, T, Z]);
191
+ const pe = l("title"), w = l("product_type"), u = w === "digital" ? "freemius" : w === "physical" ? "stripe" : void 0, k = w === "physical", Ne = w === "digital", se = u ? A[u] : !1, re = u ? H[u].hasKeys : !1, Oe = !!l("freemius_product_id"), be = Number(l("trial_period_days") || 0), fe = !!l("trial_requires_payment_method"), qe = l("variants") || [], R = l("price"), D = l("sale_price"), v = l("prices") || {}, j = l("sale_prices") || {}, P = (qe?.length || 0) > 0, ze = l("language_id"), Ee = p.find((r) => r.id === ze)?.code || p.find((r) => r.is_default)?.code || p[0]?.code, K = M.useMemo(
192
192
  () => ns({
193
193
  currencies: n,
194
- prices: P,
195
- salePrices: U,
196
- fallbackPrice: j,
197
- fallbackSalePrice: S
194
+ prices: v,
195
+ salePrices: j,
196
+ fallbackPrice: R,
197
+ fallbackSalePrice: D
198
198
  }),
199
- [j, S, n, P, U]
200
- ), Xe = V.useMemo(
199
+ [R, D, n, v, j]
200
+ ), Ke = M.useMemo(
201
201
  () => s?.variants?.map((r) => ({
202
202
  ...r,
203
203
  prices: r.prices || {},
@@ -206,145 +206,145 @@ function Ds({
206
206
  [s?.variants]
207
207
  );
208
208
  F(() => {
209
- if (pe.title && !o) {
210
- const r = Ns(he);
209
+ if (le.title && !o) {
210
+ const r = Ns(pe);
211
211
  t("slug", r, { shouldValidate: !0 });
212
212
  }
213
- }, [he, pe.title, t, o]);
214
- const [te, Pe] = B(
215
- () => Te(s?.product_media)
216
- ), [ce, _e] = B(/* @__PURE__ */ new Set());
213
+ }, [pe, le.title, t, o]);
214
+ const [oe, xe] = U(
215
+ () => we(s?.product_media)
216
+ ), [te, he] = U(/* @__PURE__ */ new Set());
217
217
  F(() => {
218
- ue(
219
- Ae(
218
+ me(
219
+ Se(
220
220
  s,
221
- w,
221
+ S,
222
222
  p,
223
223
  n,
224
- H
224
+ B
225
225
  )
226
- ), Pe(Te(s?.product_media)), _e(/* @__PURE__ */ new Set()), Z(!!s?.variants?.length);
226
+ ), xe(we(s?.product_media)), he(/* @__PURE__ */ new Set()), W(!!s?.variants?.length);
227
227
  }, [
228
228
  p,
229
229
  n,
230
230
  s,
231
- ue,
232
- w,
233
- H
231
+ me,
232
+ S,
233
+ B
234
234
  ]);
235
- const Ye = (r) => {
236
- const c = new Set(r.map((a) => a.id)), d = te.filter((a) => !c.has(a.id)), b = new Set(ce);
235
+ const $e = (r) => {
236
+ const c = new Set(r.map((a) => a.id)), d = oe.filter((a) => !c.has(a.id)), b = new Set(te);
237
237
  d.forEach((a) => {
238
238
  a.media_id && b.add(a.media_id);
239
- }), _e(b), Pe(r), t("product_media", us(r), { shouldDirty: !0 }), t("explicitly_removed_media_ids", Array.from(b), {
239
+ }), he(b), xe(r), t("product_media", us(r), { shouldDirty: !0 }), t("explicitly_removed_media_ids", Array.from(b), {
240
240
  shouldDirty: !0
241
241
  });
242
242
  };
243
243
  F(() => {
244
- t("explicitly_removed_media_ids", Array.from(ce));
245
- }, [ce, t]), F(() => {
246
- _ && Z(!0);
247
- }, [_]), F(() => {
248
- l("is_taxable"), l("price"), l("sale_price"), l("payment_provider"), l("trial_requires_payment_method");
249
- }, [l]), F(() => {
250
- if (!ge) {
244
+ t("explicitly_removed_media_ids", Array.from(te));
245
+ }, [te, t]), F(() => {
246
+ P && W(!0);
247
+ }, [P]), F(() => {
248
+ m("is_taxable"), m("price"), m("sale_price"), m("payment_provider"), m("trial_requires_payment_method");
249
+ }, [m]), F(() => {
250
+ if (!Ne) {
251
251
  t("trial_period_days", 0, { shouldDirty: !1, shouldValidate: !0 }), t("trial_requires_payment_method", !1, {
252
252
  shouldDirty: !1,
253
253
  shouldValidate: !0
254
254
  });
255
255
  return;
256
256
  }
257
- ke <= 0 && t("trial_requires_payment_method", !1, {
257
+ be <= 0 && t("trial_requires_payment_method", !1, {
258
258
  shouldDirty: !1,
259
259
  shouldValidate: !0
260
260
  });
261
- }, [ge, t, ke]), F(() => {
261
+ }, [Ne, t, be]), F(() => {
262
262
  u && t("payment_provider", u, {
263
263
  shouldDirty: !1,
264
264
  shouldValidate: !0
265
265
  });
266
266
  }, [u, t]), F(() => {
267
- m && P[m.code] === void 0 && t(
267
+ i && v[i.code] === void 0 && t(
268
268
  "prices",
269
269
  {
270
- ...P,
271
- [m.code]: j || 0
270
+ ...v,
271
+ [i.code]: R || 0
272
272
  },
273
273
  { shouldDirty: !1 }
274
274
  );
275
- }, [j, m, P, t]);
276
- const Ce = J(
275
+ }, [R, i, v, t]);
276
+ const ge = $(
277
277
  (r, c) => {
278
278
  const d = {
279
- ...P,
279
+ ...v,
280
280
  [r]: c
281
281
  };
282
- t("prices", d, { shouldDirty: !0, shouldValidate: !0 }), r === m?.code && t("price", c, { shouldDirty: !0, shouldValidate: !0 });
282
+ t("prices", d, { shouldDirty: !0, shouldValidate: !0 }), r === i?.code && t("price", c, { shouldDirty: !0, shouldValidate: !0 });
283
283
  },
284
- [m?.code, P, t]
285
- ), Fe = J(
284
+ [i?.code, v, t]
285
+ ), ke = $(
286
286
  (r, c) => {
287
287
  const d = {
288
- ...U,
288
+ ...j,
289
289
  [r]: c
290
290
  };
291
291
  t("sale_prices", d, {
292
292
  shouldDirty: !0,
293
293
  shouldValidate: !0
294
- }), r === m?.code && t("sale_price", c, { shouldDirty: !0, shouldValidate: !0 });
294
+ }), r === i?.code && t("sale_price", c, { shouldDirty: !0, shouldValidate: !0 });
295
295
  },
296
- [m?.code, U, t]
297
- ), ye = J(() => {
298
- if (!m)
296
+ [i?.code, j, t]
297
+ ), ve = $(() => {
298
+ if (!i)
299
299
  return;
300
- const r = new Set(q), c = P[m.code] ?? j ?? 0, d = U[m.code] ?? S ?? null, b = n.reduce((C, f) => {
301
- if (f.code !== m.code && r.has(f.code))
300
+ const r = new Set(O), c = v[i.code] ?? R ?? 0, d = j[i.code] ?? D ?? null, b = n.reduce((C, f) => {
301
+ if (f.code !== i.code && r.has(f.code))
302
302
  return C;
303
- const ie = we({
304
- amount: Me(c, m.code),
305
- fromCurrencyCode: m.code,
303
+ const ce = Be({
304
+ amount: He(c, i.code),
305
+ fromCurrencyCode: i.code,
306
306
  toCurrencyCode: f.code,
307
307
  currencies: n,
308
308
  applyRounding: !0
309
309
  });
310
- return C[f.code] = Ve(ie, f.code), C;
310
+ return C[f.code] = De(ce, f.code), C;
311
311
  }, {}), a = n.reduce(
312
312
  (C, f) => {
313
- if (f.code !== m.code && r.has(f.code))
313
+ if (f.code !== i.code && r.has(f.code))
314
314
  return C;
315
315
  if (typeof d != "number")
316
- return (f.code === m.code || !r.has(f.code)) && (C[f.code] = null), C;
317
- const ie = we({
318
- amount: Me(d, m.code),
319
- fromCurrencyCode: m.code,
316
+ return (f.code === i.code || !r.has(f.code)) && (C[f.code] = null), C;
317
+ const ce = Be({
318
+ amount: He(d, i.code),
319
+ fromCurrencyCode: i.code,
320
320
  toCurrencyCode: f.code,
321
321
  currencies: n,
322
322
  applyRounding: !0
323
323
  });
324
- return C[f.code] = Ve(ie, f.code), C;
324
+ return C[f.code] = De(ce, f.code), C;
325
325
  },
326
326
  {}
327
327
  );
328
328
  t("prices", b, { shouldDirty: !0, shouldValidate: !0 }), t("sale_prices", a, {
329
329
  shouldDirty: !0,
330
330
  shouldValidate: !0
331
- }), t("price", b[m.code] ?? c, {
331
+ }), t("price", b[i.code] ?? c, {
332
332
  shouldDirty: !0,
333
333
  shouldValidate: !0
334
- }), t("sale_price", a[m.code] ?? null, {
334
+ }), t("sale_price", a[i.code] ?? null, {
335
335
  shouldDirty: !0,
336
336
  shouldValidate: !0
337
337
  });
338
338
  }, [
339
339
  n,
340
- m,
341
- P,
342
- U,
343
- t,
344
- q,
340
+ i,
341
+ v,
345
342
  j,
346
- S
347
- ]), Qe = J(
343
+ t,
344
+ O,
345
+ R,
346
+ D
347
+ ]), Je = $(
348
348
  ({
349
349
  variationAttributes: r,
350
350
  variants: c
@@ -352,45 +352,45 @@ function Ds({
352
352
  t("variation_attributes", r, { shouldDirty: !0 }), t("variants", c, { shouldDirty: !0, shouldValidate: !0 });
353
353
  },
354
354
  [t]
355
- ), Re = async (r) => {
356
- O(!0), E(!0), K(null);
355
+ ), _e = async (r) => {
356
+ I(!0), z(!0), E(null);
357
357
  try {
358
358
  if (!u) {
359
359
  const a = "Select whether this product is physical or digital before saving.";
360
- z("product_type", {
360
+ q("product_type", {
361
361
  type: "manual",
362
362
  message: a
363
- }), o ? K(a) : alert(a), O(!1), E(!1);
363
+ }), o ? E(a) : alert(a), I(!1), z(!1);
364
364
  return;
365
365
  }
366
- if (r.status === "active" && (!re || !oe)) {
366
+ if (r.status === "active" && (!se || !re)) {
367
367
  const a = `${u === "stripe" ? "Stripe" : "Freemius"} must be enabled and fully configured before this product can be published.`;
368
- z("product_type", {
368
+ q("product_type", {
369
369
  type: "manual",
370
370
  message: a
371
- }), o ? K(a) : alert(a), O(!1), E(!1);
371
+ }), o ? E(a) : alert(a), I(!1), z(!1);
372
372
  return;
373
373
  }
374
- const c = v ? 0 : Math.max(0, Number(r.trial_period_days || 0)), d = {
374
+ const c = k ? 0 : Math.max(0, Number(r.trial_period_days || 0)), d = {
375
375
  ...r,
376
376
  product_type: r.product_type,
377
377
  payment_provider: u,
378
- freemius_product_id: v ? "" : r.freemius_product_id,
379
- freemius_plan_id: v ? "" : r.freemius_plan_id,
378
+ freemius_product_id: k ? "" : r.freemius_product_id,
379
+ freemius_plan_id: k ? "" : r.freemius_plan_id,
380
380
  trial_period_days: c,
381
- trial_requires_payment_method: !v && c > 0 ? r.trial_requires_payment_method : !1,
382
- upc: v ? r.upc : null,
383
- is_taxable: v ? r.is_taxable : !1,
384
- variation_attributes: v ? r.variation_attributes : [],
385
- variants: v ? r.variants : []
386
- }, b = Ie(
381
+ trial_requires_payment_method: !k && c > 0 ? r.trial_requires_payment_method : !1,
382
+ upc: k ? r.upc : null,
383
+ is_taxable: k ? r.is_taxable : !1,
384
+ variation_attributes: k ? r.variation_attributes : [],
385
+ variants: k ? r.variants : []
386
+ }, b = Me(
387
387
  d,
388
388
  n
389
389
  );
390
- if (o && k)
391
- await k(b), Ee(/* @__PURE__ */ new Date());
392
- else if (Q)
393
- await Q(b);
390
+ if (o && g)
391
+ await g(b), Ie(/* @__PURE__ */ new Date());
392
+ else if (Y)
393
+ await Y(b);
394
394
  else
395
395
  throw new Error("Product form action is not configured.");
396
396
  } catch (c) {
@@ -399,26 +399,26 @@ function Ds({
399
399
  let d = c.message || "An error occurred while saving.";
400
400
  if (c.code === "23505") {
401
401
  const b = c.message?.toLowerCase() || "";
402
- b.includes("products_slug_key") || b.includes("slug") ? (d = "This slug is already in use. Please choose another one.", z("slug", {
402
+ b.includes("products_slug_key") || b.includes("slug") ? (d = "This slug is already in use. Please choose another one.", q("slug", {
403
403
  type: "manual",
404
404
  message: d
405
- })) : (b.includes("products_sku_key") || b.includes("sku")) && (d = "This SKU is already in use.", z("sku", {
405
+ })) : (b.includes("products_sku_key") || b.includes("sku")) && (d = "This SKU is already in use.", q("sku", {
406
406
  type: "manual",
407
407
  message: d
408
408
  }));
409
409
  }
410
- o ? K(d) : alert(d);
410
+ o ? E(d) : alert(d);
411
411
  } finally {
412
- O(!1), E(!1);
412
+ I(!1), z(!1);
413
413
  }
414
- }, We = _ ? "bg-muted/60 text-muted-foreground opacity-70" : "", Ze = ps(te);
415
- return /* @__PURE__ */ e("form", { onSubmit: G(Re), className: "space-y-2.5 pb-4", children: [
416
- /* @__PURE__ */ e("input", { type: "hidden", ...l("translation_group_id") }, void 0, !1, {
414
+ }, Le = P ? "bg-muted/60 text-muted-foreground opacity-70" : "", Xe = ps(oe);
415
+ return /* @__PURE__ */ e("form", { onSubmit: Z(_e), className: "space-y-2.5 pb-4", children: [
416
+ /* @__PURE__ */ e("input", { type: "hidden", ...m("translation_group_id") }, void 0, !1, {
417
417
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
418
418
  lineNumber: 811,
419
419
  columnNumber: 7
420
420
  }, this),
421
- /* @__PURE__ */ e("input", { type: "hidden", ...l("payment_provider") }, void 0, !1, {
421
+ /* @__PURE__ */ e("input", { type: "hidden", ...m("payment_provider") }, void 0, !1, {
422
422
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
423
423
  lineNumber: 812,
424
424
  columnNumber: 7
@@ -432,7 +432,7 @@ function Ds({
432
432
  lineNumber: 818,
433
433
  columnNumber: 15
434
434
  }, this),
435
- N.product_type && /* @__PURE__ */ e(Be, { className: "h-4 w-4 text-destructive" }, void 0, !1, {
435
+ N.product_type && /* @__PURE__ */ e(Fe, { className: "h-4 w-4 text-destructive" }, void 0, !1, {
436
436
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
437
437
  lineNumber: 820,
438
438
  columnNumber: 17
@@ -443,15 +443,15 @@ function Ds({
443
443
  columnNumber: 13
444
444
  }, this),
445
445
  /* @__PURE__ */ e("div", { className: "flex h-9 items-center", children: /* @__PURE__ */ e(
446
- me,
446
+ Ze,
447
447
  {
448
448
  onValueChange: (r) => t("product_type", r, {
449
449
  shouldDirty: !0,
450
450
  shouldValidate: !0
451
451
  }),
452
- value: M || void 0,
452
+ value: w || void 0,
453
453
  children: [
454
- /* @__PURE__ */ e(le, { className: "w-[160px] h-9 text-xs", children: /* @__PURE__ */ e(ne, { placeholder: "Select Type" }, void 0, !1, {
454
+ /* @__PURE__ */ e(Ge, { className: "w-[160px] h-9 text-xs", children: /* @__PURE__ */ e(es, { placeholder: "Select Type" }, void 0, !1, {
455
455
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
456
456
  lineNumber: 835,
457
457
  columnNumber: 19
@@ -460,13 +460,13 @@ function Ds({
460
460
  lineNumber: 834,
461
461
  columnNumber: 17
462
462
  }, this),
463
- /* @__PURE__ */ e(de, { children: [
464
- /* @__PURE__ */ e(R, { value: "physical", children: "Physical Product" }, void 0, !1, {
463
+ /* @__PURE__ */ e(ss, { children: [
464
+ /* @__PURE__ */ e(ye, { value: "physical", children: "Physical Product" }, void 0, !1, {
465
465
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
466
466
  lineNumber: 838,
467
467
  columnNumber: 19
468
468
  }, this),
469
- /* @__PURE__ */ e(R, { value: "digital", children: "Digital Product" }, void 0, !1, {
469
+ /* @__PURE__ */ e(ye, { value: "digital", children: "Digital Product" }, void 0, !1, {
470
470
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
471
471
  lineNumber: 839,
472
472
  columnNumber: 19
@@ -503,7 +503,7 @@ function Ds({
503
503
  lineNumber: 847,
504
504
  columnNumber: 15
505
505
  }, this),
506
- /* @__PURE__ */ e(L, { variant: "outline", className: "text-xs py-1 font-bold bg-muted/30 leading-none", children: u ? u === "stripe" ? "Stripe" : "Freemius" : "—" }, void 0, !1, {
506
+ /* @__PURE__ */ e(J, { variant: "outline", className: "text-xs py-1 font-bold bg-muted/30 leading-none", children: u ? u === "stripe" ? "Stripe" : "Freemius" : "—" }, void 0, !1, {
507
507
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
508
508
  lineNumber: 848,
509
509
  columnNumber: 15
@@ -513,8 +513,8 @@ function Ds({
513
513
  lineNumber: 846,
514
514
  columnNumber: 13
515
515
  }, this),
516
- u && /* @__PURE__ */ e("div", { className: "flex h-9 items-center gap-2", children: re && oe ? /* @__PURE__ */ e("span", { className: "flex items-center gap-1.5 text-emerald-600 text-[10px] font-bold bg-emerald-50 px-2 py-1 rounded-full border border-emerald-100 uppercase leading-none", children: [
517
- /* @__PURE__ */ e(es, { className: "h-3 w-3" }, void 0, !1, {
516
+ u && /* @__PURE__ */ e("div", { className: "flex h-9 items-center gap-2", children: se && re ? /* @__PURE__ */ e("span", { className: "flex items-center gap-1.5 text-emerald-600 text-[10px] font-bold bg-emerald-50 px-2 py-1 rounded-full border border-emerald-100 uppercase leading-none", children: [
517
+ /* @__PURE__ */ e(Qe, { className: "h-3 w-3" }, void 0, !1, {
518
518
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
519
519
  lineNumber: 861,
520
520
  columnNumber: 21
@@ -525,12 +525,12 @@ function Ds({
525
525
  lineNumber: 860,
526
526
  columnNumber: 19
527
527
  }, this) : /* @__PURE__ */ e("span", { className: "flex items-center gap-1.5 text-amber-600 text-[10px] font-bold bg-amber-50 px-2 py-1 rounded-full border border-amber-100 uppercase leading-none", children: [
528
- /* @__PURE__ */ e(Be, { className: "h-3 w-3" }, void 0, !1, {
528
+ /* @__PURE__ */ e(Fe, { className: "h-3 w-3" }, void 0, !1, {
529
529
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
530
530
  lineNumber: 866,
531
531
  columnNumber: 21
532
532
  }, this),
533
- re ? "Keys Missing" : "Disabled"
533
+ se ? "Keys Missing" : "Disabled"
534
534
  ] }, void 0, !0, {
535
535
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
536
536
  lineNumber: 865,
@@ -540,14 +540,14 @@ function Ds({
540
540
  lineNumber: 858,
541
541
  columnNumber: 15
542
542
  }, this),
543
- !oe && u && D[u].missing.length > 0 && /* @__PURE__ */ e("div", { className: "hidden xl:flex h-9 items-center gap-1 text-[10px] text-muted-foreground bg-muted/50 px-2 py-1 rounded border border-dashed leading-none", children: [
544
- /* @__PURE__ */ e(ss, { className: "h-3 w-3" }, void 0, !1, {
543
+ !re && u && H[u].missing.length > 0 && /* @__PURE__ */ e("div", { className: "hidden xl:flex h-9 items-center gap-1 text-[10px] text-muted-foreground bg-muted/50 px-2 py-1 rounded border border-dashed leading-none", children: [
544
+ /* @__PURE__ */ e(We, { className: "h-3 w-3" }, void 0, !1, {
545
545
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
546
546
  lineNumber: 875,
547
547
  columnNumber: 17
548
548
  }, this),
549
549
  "Missing: ",
550
- D[u].missing.join(", ")
550
+ H[u].missing.join(", ")
551
551
  ] }, void 0, !0, {
552
552
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
553
553
  lineNumber: 874,
@@ -564,7 +564,7 @@ function Ds({
564
564
  columnNumber: 9
565
565
  }, this),
566
566
  /* @__PURE__ */ e(
567
- X,
567
+ L,
568
568
  {
569
569
  title: "Product Information",
570
570
  hideHeader: !0,
@@ -575,7 +575,7 @@ function Ds({
575
575
  lineNumber: 888,
576
576
  columnNumber: 15
577
577
  }, this),
578
- /* @__PURE__ */ e("div", { className: "flex items-center gap-1.5 min-h-[16px]", children: ze ? /* @__PURE__ */ e(je, { children: [
578
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-1.5 min-h-[16px]", children: Te ? /* @__PURE__ */ e(Pe, { children: [
579
579
  /* @__PURE__ */ e("div", { className: "relative flex h-2 w-2", children: [
580
580
  /* @__PURE__ */ e("span", { className: "animate-ping absolute inline-flex h-full w-full rounded-full bg-amber-400 opacity-75" }, void 0, !1, {
581
581
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
@@ -601,16 +601,16 @@ function Ds({
601
601
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
602
602
  lineNumber: 891,
603
603
  columnNumber: 19
604
- }, this) : be ? /* @__PURE__ */ e("span", { className: "text-red-500 font-medium", children: [
604
+ }, this) : de ? /* @__PURE__ */ e("span", { className: "text-red-500 font-medium", children: [
605
605
  "Error saving settings: ",
606
- be
606
+ de
607
607
  ] }, void 0, !0, {
608
608
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
609
609
  lineNumber: 899,
610
610
  columnNumber: 19
611
- }, this) : fe ? /* @__PURE__ */ e("span", { className: "text-emerald-600 dark:text-emerald-400 font-medium", children: [
611
+ }, this) : ae ? /* @__PURE__ */ e("span", { className: "text-emerald-600 dark:text-emerald-400 font-medium", children: [
612
612
  "Settings autosaved at ",
613
- fe.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", second: "2-digit" })
613
+ ae.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", second: "2-digit" })
614
614
  ] }, void 0, !0, {
615
615
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
616
616
  lineNumber: 901,
@@ -631,12 +631,12 @@ function Ds({
631
631
  }, this),
632
632
  /* @__PURE__ */ e("div", { className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-2.5", children: [
633
633
  /* @__PURE__ */ e("div", { className: "col-span-2 space-y-1", children: [
634
- /* @__PURE__ */ e(x, { htmlFor: "title", className: "text-xs uppercase font-bold text-muted-foreground tracking-wider leading-none", children: "Title" }, void 0, !1, {
634
+ /* @__PURE__ */ e(_, { htmlFor: "title", className: "text-xs uppercase font-bold text-muted-foreground tracking-wider leading-none", children: "Title" }, void 0, !1, {
635
635
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
636
636
  lineNumber: 912,
637
637
  columnNumber: 15
638
638
  }, this),
639
- /* @__PURE__ */ e(h, { id: "title", placeholder: "Product title", ...l("title"), className: "h-8 text-sm" }, void 0, !1, {
639
+ /* @__PURE__ */ e(x, { id: "title", placeholder: "Product title", ...m("title"), className: "h-8 text-sm" }, void 0, !1, {
640
640
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
641
641
  lineNumber: 913,
642
642
  columnNumber: 15
@@ -652,12 +652,12 @@ function Ds({
652
652
  columnNumber: 13
653
653
  }, this),
654
654
  /* @__PURE__ */ e("div", { className: "col-span-2 space-y-1", children: [
655
- /* @__PURE__ */ e(x, { htmlFor: "slug", className: "text-xs uppercase font-bold text-muted-foreground tracking-wider leading-none", children: "Slug" }, void 0, !1, {
655
+ /* @__PURE__ */ e(_, { htmlFor: "slug", className: "text-xs uppercase font-bold text-muted-foreground tracking-wider leading-none", children: "Slug" }, void 0, !1, {
656
656
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
657
657
  lineNumber: 917,
658
658
  columnNumber: 15
659
659
  }, this),
660
- /* @__PURE__ */ e(h, { id: "slug", placeholder: "product-slug", ...l("slug"), className: "h-8 text-sm" }, void 0, !1, {
660
+ /* @__PURE__ */ e(x, { id: "slug", placeholder: "product-slug", ...m("slug"), className: "h-8 text-sm" }, void 0, !1, {
661
661
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
662
662
  lineNumber: 918,
663
663
  columnNumber: 15
@@ -673,12 +673,12 @@ function Ds({
673
673
  columnNumber: 13
674
674
  }, this),
675
675
  /* @__PURE__ */ e("div", { className: "col-span-1 space-y-1", children: [
676
- /* @__PURE__ */ e(x, { htmlFor: "sku", className: "text-xs uppercase font-bold text-muted-foreground tracking-wider leading-none", children: "SKU" }, void 0, !1, {
676
+ /* @__PURE__ */ e(_, { htmlFor: "sku", className: "text-xs uppercase font-bold text-muted-foreground tracking-wider leading-none", children: "SKU" }, void 0, !1, {
677
677
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
678
678
  lineNumber: 922,
679
679
  columnNumber: 15
680
680
  }, this),
681
- /* @__PURE__ */ e(h, { id: "sku", placeholder: "SKU", ...l("sku"), className: "h-8 text-sm font-mono" }, void 0, !1, {
681
+ /* @__PURE__ */ e(x, { id: "sku", placeholder: "SKU", ...m("sku"), className: "h-8 text-sm font-mono" }, void 0, !1, {
682
682
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
683
683
  lineNumber: 923,
684
684
  columnNumber: 15
@@ -694,12 +694,12 @@ function Ds({
694
694
  columnNumber: 13
695
695
  }, this),
696
696
  /* @__PURE__ */ e("div", { className: "col-span-1 space-y-1", children: [
697
- /* @__PURE__ */ e(x, { htmlFor: "upc_ean", className: "text-xs uppercase font-bold text-muted-foreground tracking-wider leading-none", children: "UPC / EAN" }, void 0, !1, {
697
+ /* @__PURE__ */ e(_, { htmlFor: "upc_ean", className: "text-xs uppercase font-bold text-muted-foreground tracking-wider leading-none", children: "UPC / EAN" }, void 0, !1, {
698
698
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
699
699
  lineNumber: 927,
700
700
  columnNumber: 15
701
701
  }, this),
702
- /* @__PURE__ */ e(h, { id: "upc_ean", placeholder: "000000000", ...l("upc"), className: "h-8 text-sm font-mono", readOnly: _ }, void 0, !1, {
702
+ /* @__PURE__ */ e(x, { id: "upc_ean", placeholder: "000000000", ...m("upc"), className: "h-8 text-sm font-mono", readOnly: P }, void 0, !1, {
703
703
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
704
704
  lineNumber: 928,
705
705
  columnNumber: 15
@@ -716,12 +716,12 @@ function Ds({
716
716
  }, this),
717
717
  /* @__PURE__ */ e("div", { className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-12 gap-2.5 mt-2", children: [
718
718
  /* @__PURE__ */ e("div", { className: `${o ? "lg:col-span-3" : "lg:col-span-4"} col-span-2 space-y-1`, children: [
719
- /* @__PURE__ */ e(x, { htmlFor: "meta_title", className: "text-xs uppercase font-bold text-muted-foreground tracking-wider leading-none", children: "Meta Title" }, void 0, !1, {
719
+ /* @__PURE__ */ e(_, { htmlFor: "meta_title", className: "text-xs uppercase font-bold text-muted-foreground tracking-wider leading-none", children: "Meta Title" }, void 0, !1, {
720
720
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
721
721
  lineNumber: 933,
722
722
  columnNumber: 15
723
723
  }, this),
724
- /* @__PURE__ */ e(h, { id: "meta_title", ...l("meta_title"), placeholder: "SEO page title (50-60 chars)", className: "h-8 text-sm" }, void 0, !1, {
724
+ /* @__PURE__ */ e(x, { id: "meta_title", ...m("meta_title"), placeholder: "SEO page title (50-60 chars)", className: "h-8 text-sm" }, void 0, !1, {
725
725
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
726
726
  lineNumber: 934,
727
727
  columnNumber: 15
@@ -732,12 +732,12 @@ function Ds({
732
732
  columnNumber: 13
733
733
  }, this),
734
734
  /* @__PURE__ */ e("div", { className: "lg:col-span-4 col-span-2 space-y-1", children: [
735
- /* @__PURE__ */ e(x, { htmlFor: "meta_description", className: "text-xs uppercase font-bold text-muted-foreground tracking-wider leading-none", children: "Meta Description" }, void 0, !1, {
735
+ /* @__PURE__ */ e(_, { htmlFor: "meta_description", className: "text-xs uppercase font-bold text-muted-foreground tracking-wider leading-none", children: "Meta Description" }, void 0, !1, {
736
736
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
737
737
  lineNumber: 937,
738
738
  columnNumber: 15
739
739
  }, this),
740
- /* @__PURE__ */ e(h, { id: "meta_description", ...l("meta_description"), placeholder: "SEO description (150-160 chars)", className: "h-8 text-sm" }, void 0, !1, {
740
+ /* @__PURE__ */ e(x, { id: "meta_description", ...m("meta_description"), placeholder: "SEO description (150-160 chars)", className: "h-8 text-sm" }, void 0, !1, {
741
741
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
742
742
  lineNumber: 938,
743
743
  columnNumber: 15
@@ -748,12 +748,12 @@ function Ds({
748
748
  columnNumber: 13
749
749
  }, this),
750
750
  /* @__PURE__ */ e("div", { className: `${o ? "lg:col-span-3" : "lg:col-span-4"} col-span-2 space-y-1`, children: [
751
- /* @__PURE__ */ e(x, { htmlFor: "custom_canonical", className: "text-xs uppercase font-bold text-muted-foreground tracking-wider leading-none", children: "Canonical URL (optional)" }, void 0, !1, {
751
+ /* @__PURE__ */ e(_, { htmlFor: "custom_canonical", className: "text-xs uppercase font-bold text-muted-foreground tracking-wider leading-none", children: "Canonical URL (optional)" }, void 0, !1, {
752
752
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
753
753
  lineNumber: 941,
754
754
  columnNumber: 15
755
755
  }, this),
756
- /* @__PURE__ */ e(h, { id: "custom_canonical", ...l("custom_canonical"), placeholder: "Blank = self-referencing. Absolute https://… URL or /relative path to override.", className: "h-8 text-sm" }, void 0, !1, {
756
+ /* @__PURE__ */ e(x, { id: "custom_canonical", ...m("custom_canonical"), placeholder: "Blank = self-referencing. Absolute https://… URL or /relative path to override.", className: "h-8 text-sm" }, void 0, !1, {
757
757
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
758
758
  lineNumber: 942,
759
759
  columnNumber: 15
@@ -762,53 +762,6 @@ function Ds({
762
762
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
763
763
  lineNumber: 940,
764
764
  columnNumber: 13
765
- }, this),
766
- o && /* @__PURE__ */ e("div", { className: "lg:col-span-2 col-span-2 space-y-1", children: [
767
- /* @__PURE__ */ e(x, { htmlFor: "status", className: "text-xs uppercase font-bold text-muted-foreground tracking-wider leading-none", children: "Status" }, void 0, !1, {
768
- fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
769
- lineNumber: 946,
770
- columnNumber: 17
771
- }, this),
772
- /* @__PURE__ */ e(me, { onValueChange: (r) => t("status", r, { shouldDirty: !0 }), value: i("status"), children: [
773
- /* @__PURE__ */ e(le, { className: "h-8 text-xs", children: /* @__PURE__ */ e(ne, { placeholder: "Status" }, void 0, !1, {
774
- fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
775
- lineNumber: 949,
776
- columnNumber: 21
777
- }, this) }, void 0, !1, {
778
- fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
779
- lineNumber: 948,
780
- columnNumber: 19
781
- }, this),
782
- /* @__PURE__ */ e(de, { children: [
783
- /* @__PURE__ */ e(R, { value: "draft", children: "Draft" }, void 0, !1, {
784
- fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
785
- lineNumber: 952,
786
- columnNumber: 21
787
- }, this),
788
- /* @__PURE__ */ e(R, { value: "active", children: "Active" }, void 0, !1, {
789
- fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
790
- lineNumber: 953,
791
- columnNumber: 21
792
- }, this),
793
- /* @__PURE__ */ e(R, { value: "archived", children: "Archived" }, void 0, !1, {
794
- fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
795
- lineNumber: 954,
796
- columnNumber: 21
797
- }, this)
798
- ] }, void 0, !0, {
799
- fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
800
- lineNumber: 951,
801
- columnNumber: 19
802
- }, this)
803
- ] }, void 0, !0, {
804
- fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
805
- lineNumber: 947,
806
- columnNumber: 17
807
- }, this)
808
- ] }, void 0, !0, {
809
- fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
810
- lineNumber: 945,
811
- columnNumber: 15
812
765
  }, this)
813
766
  ] }, void 0, !0, {
814
767
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
@@ -827,22 +780,22 @@ function Ds({
827
780
  this
828
781
  ),
829
782
  /* @__PURE__ */ e(
830
- X,
783
+ L,
831
784
  {
832
785
  title: "Product Categories",
833
786
  description: "Assign this product to one or more categories.",
834
787
  children: /* @__PURE__ */ e(
835
788
  ms,
836
789
  {
837
- categories: Oe,
838
- selectedIds: i("category_ids") || [],
790
+ categories: Ve,
791
+ selectedIds: l("category_ids") || [],
839
792
  onChange: (r) => t("category_ids", r, { shouldDirty: !0, shouldValidate: !0 })
840
793
  },
841
794
  void 0,
842
795
  !1,
843
796
  {
844
797
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
845
- lineNumber: 966,
798
+ lineNumber: 954,
846
799
  columnNumber: 11
847
800
  },
848
801
  this
@@ -852,101 +805,101 @@ function Ds({
852
805
  !1,
853
806
  {
854
807
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
855
- lineNumber: 962,
808
+ lineNumber: 950,
856
809
  columnNumber: 9
857
810
  },
858
811
  this
859
812
  ),
860
813
  /* @__PURE__ */ e("section", { className: "rounded-lg border bg-card p-3 shadow-sm space-y-3", children: [
861
- v && /* @__PURE__ */ e("div", { className: "flex items-center justify-between gap-4 flex-wrap border-b border-muted/50 pb-2", children: [
814
+ k && /* @__PURE__ */ e("div", { className: "flex items-center justify-between gap-4 flex-wrap border-b border-muted/50 pb-2", children: [
862
815
  /* @__PURE__ */ e("div", { className: "flex items-center gap-4", children: /* @__PURE__ */ e("div", { className: "space-y-0.5", children: [
863
816
  /* @__PURE__ */ e("h2", { className: "text-sm font-bold tracking-tight", children: "Pricing & Inventory" }, void 0, !1, {
864
817
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
865
- lineNumber: 978,
818
+ lineNumber: 966,
866
819
  columnNumber: 19
867
820
  }, this),
868
821
  /* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground leading-none", children: "Manage simple or variant pricing." }, void 0, !1, {
869
822
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
870
- lineNumber: 979,
823
+ lineNumber: 967,
871
824
  columnNumber: 19
872
825
  }, this)
873
826
  ] }, void 0, !0, {
874
827
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
875
- lineNumber: 977,
828
+ lineNumber: 965,
876
829
  columnNumber: 17
877
830
  }, this) }, void 0, !1, {
878
831
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
879
- lineNumber: 976,
832
+ lineNumber: 964,
880
833
  columnNumber: 15
881
834
  }, this),
882
835
  /* @__PURE__ */ e("div", { className: "flex items-center gap-3", children: [
883
836
  /* @__PURE__ */ e("div", { className: "flex items-center gap-2 bg-muted/40 rounded-md px-2.5 py-1.5", children: [
884
837
  /* @__PURE__ */ e("span", { className: "text-xs uppercase font-bold text-muted-foreground tracking-wider leading-none", children: "Stock" }, void 0, !1, {
885
838
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
886
- lineNumber: 984,
839
+ lineNumber: 972,
887
840
  columnNumber: 21
888
841
  }, this),
889
842
  /* @__PURE__ */ e(
890
- h,
843
+ x,
891
844
  {
892
845
  id: "stock",
893
846
  type: "number",
894
847
  min: "0",
895
- ...l("stock", { valueAsNumber: !0 }),
848
+ ...m("stock", { valueAsNumber: !0 }),
896
849
  placeholder: "0",
897
- readOnly: _,
898
- className: `${We} h-8 w-20 text-sm text-center font-mono bg-background`
850
+ readOnly: P,
851
+ className: `${Le} h-8 w-20 text-sm text-center font-mono bg-background`
899
852
  },
900
853
  void 0,
901
854
  !1,
902
855
  {
903
856
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
904
- lineNumber: 985,
857
+ lineNumber: 973,
905
858
  columnNumber: 21
906
859
  },
907
860
  this
908
861
  )
909
862
  ] }, void 0, !0, {
910
863
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
911
- lineNumber: 983,
864
+ lineNumber: 971,
912
865
  columnNumber: 19
913
866
  }, this),
914
- _ ? /* @__PURE__ */ e(L, { variant: "secondary", className: "text-[11px] py-0 px-2 h-5", children: "Variant pricing" }, void 0, !1, {
867
+ P ? /* @__PURE__ */ e(J, { variant: "secondary", className: "text-[11px] py-0 px-2 h-5", children: "Variant pricing" }, void 0, !1, {
915
868
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
916
- lineNumber: 996,
869
+ lineNumber: 984,
917
870
  columnNumber: 19
918
871
  }, this) : null
919
872
  ] }, void 0, !0, {
920
873
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
921
- lineNumber: 982,
874
+ lineNumber: 970,
922
875
  columnNumber: 15
923
876
  }, this)
924
877
  ] }, void 0, !0, {
925
878
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
926
- lineNumber: 975,
879
+ lineNumber: 963,
927
880
  columnNumber: 13
928
881
  }, this),
929
- v ? /* @__PURE__ */ e("div", { className: "space-y-3", children: [
882
+ k ? /* @__PURE__ */ e("div", { className: "space-y-3", children: [
930
883
  /* @__PURE__ */ e("div", { className: "w-full", children: [
931
884
  /* @__PURE__ */ e(
932
- De,
885
+ je,
933
886
  {
934
887
  idPrefix: "product",
935
888
  currencies: n,
936
- prices: $.prices,
937
- salePrices: $.salePrices,
938
- managedCurrencyCodes: q,
939
- onPriceChange: Ce,
940
- onSalePriceChange: Fe,
941
- onAutoFill: ye,
942
- readOnly: _,
943
- helperText: _ ? "Parent prices stay as a fallback, but active variants define the live shopper price." : void 0,
889
+ prices: K.prices,
890
+ salePrices: K.salePrices,
891
+ managedCurrencyCodes: O,
892
+ onPriceChange: ge,
893
+ onSalePriceChange: ke,
894
+ onAutoFill: ve,
895
+ readOnly: P,
896
+ helperText: P ? "Parent prices stay as a fallback, but active variants define the live shopper price." : void 0,
944
897
  trailing: /* @__PURE__ */ e(
945
- Se,
898
+ Ue,
946
899
  {
947
900
  idPrefix: "product",
948
- startAt: i("sale_start_at"),
949
- endAt: i("sale_end_at"),
901
+ startAt: l("sale_start_at"),
902
+ endAt: l("sale_end_at"),
950
903
  onChange: (r, c) => t(r, c, { shouldDirty: !0, shouldValidate: !0 }),
951
904
  error: N.sale_end_at?.message,
952
905
  bare: !0
@@ -955,7 +908,7 @@ function Ds({
955
908
  !1,
956
909
  {
957
910
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
958
- lineNumber: 1020,
911
+ lineNumber: 1008,
959
912
  columnNumber: 21
960
913
  },
961
914
  this
@@ -965,147 +918,147 @@ function Ds({
965
918
  !1,
966
919
  {
967
920
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
968
- lineNumber: 1004,
921
+ lineNumber: 992,
969
922
  columnNumber: 17
970
923
  },
971
924
  this
972
925
  ),
973
926
  N.price && /* @__PURE__ */ e("p", { className: "text-destructive text-sm mt-1", children: N.price.message }, void 0, !1, {
974
927
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
975
- lineNumber: 1033,
928
+ lineNumber: 1021,
976
929
  columnNumber: 19
977
930
  }, this),
978
931
  N.sale_price && /* @__PURE__ */ e("p", { className: "text-destructive text-sm mt-1", children: N.sale_price.message }, void 0, !1, {
979
932
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
980
- lineNumber: 1036,
933
+ lineNumber: 1024,
981
934
  columnNumber: 19
982
935
  }, this),
983
936
  N.stock && /* @__PURE__ */ e("p", { className: "text-destructive text-[10px] font-medium leading-none mt-1", children: N.stock.message }, void 0, !1, {
984
937
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
985
- lineNumber: 1039,
938
+ lineNumber: 1027,
986
939
  columnNumber: 19
987
940
  }, this)
988
941
  ] }, void 0, !0, {
989
942
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
990
- lineNumber: 1003,
943
+ lineNumber: 991,
991
944
  columnNumber: 15
992
945
  }, this),
993
946
  /* @__PURE__ */ e("div", { className: "flex items-center justify-between gap-3 rounded border border-dashed p-2.5 bg-muted/5", children: [
994
- /* @__PURE__ */ e("span", { className: "text-xs font-bold uppercase tracking-wider text-muted-foreground", children: _ ? "Variations Active" : "Variations" }, void 0, !1, {
947
+ /* @__PURE__ */ e("span", { className: "text-xs font-bold uppercase tracking-wider text-muted-foreground", children: P ? "Variations Active" : "Variations" }, void 0, !1, {
995
948
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
996
- lineNumber: 1044,
949
+ lineNumber: 1032,
997
950
  columnNumber: 17
998
951
  }, this),
999
952
  /* @__PURE__ */ e(
1000
- He,
953
+ Re,
1001
954
  {
1002
955
  type: "button",
1003
- variant: W ? "outline" : "default",
1004
- onClick: () => Z((r) => !r),
956
+ variant: Q ? "outline" : "default",
957
+ onClick: () => W((r) => !r),
1005
958
  size: "sm",
1006
959
  className: "h-7 text-xs px-3",
1007
- children: W ? "Hide" : "Manage"
960
+ children: Q ? "Hide" : "Manage"
1008
961
  },
1009
962
  void 0,
1010
963
  !1,
1011
964
  {
1012
965
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1013
- lineNumber: 1045,
966
+ lineNumber: 1033,
1014
967
  columnNumber: 17
1015
968
  },
1016
969
  this
1017
970
  )
1018
971
  ] }, void 0, !0, {
1019
972
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1020
- lineNumber: 1043,
973
+ lineNumber: 1031,
1021
974
  columnNumber: 15
1022
975
  }, this),
1023
- W && /* @__PURE__ */ e("div", { className: "border-t pt-3", children: /* @__PURE__ */ e(
976
+ Q && /* @__PURE__ */ e("div", { className: "border-t pt-3", children: /* @__PURE__ */ e(
1024
977
  is,
1025
978
  {
1026
979
  globalAttributes: y,
1027
- currentLanguageCode: Le,
1028
- baseSku: i("sku") || "",
1029
- basePrice: j || 0,
1030
- basePrices: P,
1031
- baseSalePrice: typeof S == "number" ? S : null,
1032
- baseSalePrices: U,
980
+ currentLanguageCode: Ee,
981
+ baseSku: l("sku") || "",
982
+ basePrice: R || 0,
983
+ basePrices: v,
984
+ baseSalePrice: typeof D == "number" ? D : null,
985
+ baseSalePrices: j,
1033
986
  currencies: n,
1034
- availableVariantImages: Ze,
987
+ availableVariantImages: Xe,
1035
988
  initialVariationAttributes: s?.variation_attributes,
1036
- initialVariants: Xe,
1037
- onChange: Qe
989
+ initialVariants: Ke,
990
+ onChange: Je
1038
991
  },
1039
992
  void 0,
1040
993
  !1,
1041
994
  {
1042
995
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1043
- lineNumber: 1058,
996
+ lineNumber: 1046,
1044
997
  columnNumber: 19
1045
998
  },
1046
999
  this
1047
1000
  ) }, void 0, !1, {
1048
1001
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1049
- lineNumber: 1057,
1002
+ lineNumber: 1045,
1050
1003
  columnNumber: 17
1051
1004
  }, this)
1052
1005
  ] }, void 0, !0, {
1053
1006
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1054
- lineNumber: 1002,
1007
+ lineNumber: 990,
1055
1008
  columnNumber: 13
1056
- }, this) : /* @__PURE__ */ e(je, { children: [
1009
+ }, this) : /* @__PURE__ */ e(Pe, { children: [
1057
1010
  /* @__PURE__ */ e("div", { className: "space-y-4", children: [
1058
1011
  /* @__PURE__ */ e("div", { className: "flex items-end gap-4 w-full", children: [
1059
1012
  /* @__PURE__ */ e("div", { className: "flex-1", children: [
1060
- /* @__PURE__ */ e(x, { htmlFor: "freemius_product_id", className: "text-[11px] uppercase tracking-wider text-muted-foreground font-bold mb-1.5 block", children: "Freemius Product ID" }, void 0, !1, {
1013
+ /* @__PURE__ */ e(_, { htmlFor: "freemius_product_id", className: "text-[11px] uppercase tracking-wider text-muted-foreground font-bold mb-1.5 block", children: "Freemius Product ID" }, void 0, !1, {
1061
1014
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1062
- lineNumber: 1082,
1015
+ lineNumber: 1070,
1063
1016
  columnNumber: 19
1064
1017
  }, this),
1065
- /* @__PURE__ */ e(h, { id: "freemius_product_id", ...l("freemius_product_id"), className: "h-9" }, void 0, !1, {
1018
+ /* @__PURE__ */ e(x, { id: "freemius_product_id", ...m("freemius_product_id"), className: "h-9" }, void 0, !1, {
1066
1019
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1067
- lineNumber: 1083,
1020
+ lineNumber: 1071,
1068
1021
  columnNumber: 19
1069
1022
  }, this)
1070
1023
  ] }, void 0, !0, {
1071
1024
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1072
- lineNumber: 1081,
1025
+ lineNumber: 1069,
1073
1026
  columnNumber: 17
1074
1027
  }, this),
1075
1028
  /* @__PURE__ */ e("div", { className: "flex-1", children: [
1076
- /* @__PURE__ */ e(x, { htmlFor: "freemius_plan_id", className: "text-[11px] uppercase tracking-wider text-muted-foreground font-bold mb-1.5 block", children: "Freemius Plan ID" }, void 0, !1, {
1029
+ /* @__PURE__ */ e(_, { htmlFor: "freemius_plan_id", className: "text-[11px] uppercase tracking-wider text-muted-foreground font-bold mb-1.5 block", children: "Freemius Plan ID" }, void 0, !1, {
1077
1030
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1078
- lineNumber: 1086,
1031
+ lineNumber: 1074,
1079
1032
  columnNumber: 19
1080
1033
  }, this),
1081
- /* @__PURE__ */ e(h, { id: "freemius_plan_id", ...l("freemius_plan_id"), className: "h-9" }, void 0, !1, {
1034
+ /* @__PURE__ */ e(x, { id: "freemius_plan_id", ...m("freemius_plan_id"), className: "h-9" }, void 0, !1, {
1082
1035
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1083
- lineNumber: 1087,
1036
+ lineNumber: 1075,
1084
1037
  columnNumber: 19
1085
1038
  }, this)
1086
1039
  ] }, void 0, !0, {
1087
1040
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1088
- lineNumber: 1085,
1041
+ lineNumber: 1073,
1089
1042
  columnNumber: 17
1090
1043
  }, this),
1091
- Ke ? /* @__PURE__ */ e(
1044
+ Oe ? /* @__PURE__ */ e(
1092
1045
  cs,
1093
1046
  {
1094
- productId: i("freemius_product_id"),
1095
- hasOpenDraft: qe
1047
+ productId: l("freemius_product_id"),
1048
+ hasOpenDraft: Ae
1096
1049
  },
1097
1050
  void 0,
1098
1051
  !1,
1099
1052
  {
1100
1053
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1101
- lineNumber: 1090,
1054
+ lineNumber: 1078,
1102
1055
  columnNumber: 19
1103
1056
  },
1104
1057
  this
1105
1058
  ) : null
1106
1059
  ] }, void 0, !0, {
1107
1060
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1108
- lineNumber: 1080,
1061
+ lineNumber: 1068,
1109
1062
  columnNumber: 15
1110
1063
  }, this),
1111
1064
  /* @__PURE__ */ e("div", { className: "bg-muted/10 border rounded-md overflow-hidden", children: [
@@ -1113,72 +1066,72 @@ function Ds({
1113
1066
  /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: [
1114
1067
  /* @__PURE__ */ e("span", { className: "text-[11px] font-bold uppercase tracking-wider text-muted-foreground", children: "Free Trial" }, void 0, !1, {
1115
1068
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1116
- lineNumber: 1100,
1069
+ lineNumber: 1088,
1117
1070
  columnNumber: 21
1118
1071
  }, this),
1119
- /* @__PURE__ */ e(L, { variant: "outline", className: "font-mono text-xs shadow-sm bg-background", children: [
1120
- String(i("trial_period_days") || 0),
1072
+ /* @__PURE__ */ e(J, { variant: "outline", className: "font-mono text-xs shadow-sm bg-background", children: [
1073
+ String(l("trial_period_days") || 0),
1121
1074
  " Days"
1122
1075
  ] }, void 0, !0, {
1123
1076
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1124
- lineNumber: 1101,
1077
+ lineNumber: 1089,
1125
1078
  columnNumber: 21
1126
1079
  }, this)
1127
1080
  ] }, void 0, !0, {
1128
1081
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1129
- lineNumber: 1099,
1082
+ lineNumber: 1087,
1130
1083
  columnNumber: 19
1131
1084
  }, this),
1132
1085
  /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: [
1133
1086
  /* @__PURE__ */ e("span", { className: "text-[11px] font-bold uppercase tracking-wider text-muted-foreground", children: "Card Required" }, void 0, !1, {
1134
1087
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1135
- lineNumber: 1104,
1088
+ lineNumber: 1092,
1136
1089
  columnNumber: 21
1137
1090
  }, this),
1138
- /* @__PURE__ */ e(L, { variant: ve ? "default" : "secondary", className: "text-xs shadow-sm", children: ve ? "Yes" : "No" }, void 0, !1, {
1091
+ /* @__PURE__ */ e(J, { variant: fe ? "default" : "secondary", className: "text-xs shadow-sm", children: fe ? "Yes" : "No" }, void 0, !1, {
1139
1092
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1140
- lineNumber: 1105,
1093
+ lineNumber: 1093,
1141
1094
  columnNumber: 21
1142
1095
  }, this)
1143
1096
  ] }, void 0, !0, {
1144
1097
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1145
- lineNumber: 1103,
1098
+ lineNumber: 1091,
1146
1099
  columnNumber: 19
1147
1100
  }, this),
1148
1101
  /* @__PURE__ */ e("span", { className: "text-[10px] text-muted-foreground ml-auto", children: "Managed in Freemius dashboard" }, void 0, !1, {
1149
1102
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1150
- lineNumber: 1109,
1103
+ lineNumber: 1097,
1151
1104
  columnNumber: 19
1152
1105
  }, this),
1153
- /* @__PURE__ */ e("input", { type: "hidden", ...l("trial_period_days", { valueAsNumber: !0 }) }, void 0, !1, {
1106
+ /* @__PURE__ */ e("input", { type: "hidden", ...m("trial_period_days", { valueAsNumber: !0 }) }, void 0, !1, {
1154
1107
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1155
- lineNumber: 1113,
1108
+ lineNumber: 1101,
1156
1109
  columnNumber: 19
1157
1110
  }, this)
1158
1111
  ] }, void 0, !0, {
1159
1112
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1160
- lineNumber: 1098,
1113
+ lineNumber: 1086,
1161
1114
  columnNumber: 17
1162
1115
  }, this),
1163
1116
  /* @__PURE__ */ e("div", { className: "w-full p-4 pt-3 space-y-2", children: [
1164
1117
  /* @__PURE__ */ e(
1165
- De,
1118
+ je,
1166
1119
  {
1167
1120
  idPrefix: "product",
1168
1121
  currencies: n,
1169
- prices: $.prices,
1170
- salePrices: $.salePrices,
1171
- managedCurrencyCodes: q,
1172
- onPriceChange: Ce,
1173
- onSalePriceChange: Fe,
1174
- onAutoFill: ye,
1122
+ prices: K.prices,
1123
+ salePrices: K.salePrices,
1124
+ managedCurrencyCodes: O,
1125
+ onPriceChange: ge,
1126
+ onSalePriceChange: ke,
1127
+ onAutoFill: ve,
1175
1128
  readOnly: !0,
1176
1129
  trailing: /* @__PURE__ */ e(
1177
- Se,
1130
+ Ue,
1178
1131
  {
1179
1132
  idPrefix: "product",
1180
- startAt: i("sale_start_at"),
1181
- endAt: i("sale_end_at"),
1133
+ startAt: l("sale_start_at"),
1134
+ endAt: l("sale_end_at"),
1182
1135
  onChange: (r, c) => t(r, c, { shouldDirty: !0, shouldValidate: !0 }),
1183
1136
  error: N.sale_end_at?.message,
1184
1137
  bare: !0
@@ -1187,7 +1140,7 @@ function Ds({
1187
1140
  !1,
1188
1141
  {
1189
1142
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1190
- lineNumber: 1128,
1143
+ lineNumber: 1116,
1191
1144
  columnNumber: 23
1192
1145
  },
1193
1146
  this
@@ -1197,153 +1150,111 @@ function Ds({
1197
1150
  !1,
1198
1151
  {
1199
1152
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1200
- lineNumber: 1117,
1153
+ lineNumber: 1105,
1201
1154
  columnNumber: 19
1202
1155
  },
1203
1156
  this
1204
1157
  ),
1205
1158
  /* @__PURE__ */ e("p", { className: "text-[10px] leading-snug text-muted-foreground", children: "Scheduling a sale on a Freemius product generates a time-bounded Freemius coupon so the discount is enforced at Freemius checkout." }, void 0, !1, {
1206
1159
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1207
- lineNumber: 1140,
1160
+ lineNumber: 1128,
1208
1161
  columnNumber: 19
1209
1162
  }, this)
1210
1163
  ] }, void 0, !0, {
1211
1164
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1212
- lineNumber: 1116,
1165
+ lineNumber: 1104,
1213
1166
  columnNumber: 17
1214
1167
  }, this)
1215
1168
  ] }, void 0, !0, {
1216
1169
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1217
- lineNumber: 1097,
1170
+ lineNumber: 1085,
1218
1171
  columnNumber: 15
1219
1172
  }, this)
1220
1173
  ] }, void 0, !0, {
1221
1174
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1222
- lineNumber: 1079,
1175
+ lineNumber: 1067,
1223
1176
  columnNumber: 15
1224
1177
  }, this),
1225
- A && /* @__PURE__ */ e("div", { className: "pt-2 border-t", children: A }, void 0, !1, {
1178
+ V && /* @__PURE__ */ e("div", { className: "pt-2 border-t", children: V }, void 0, !1, {
1226
1179
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1227
- lineNumber: 1148,
1180
+ lineNumber: 1136,
1228
1181
  columnNumber: 17
1229
1182
  }, this)
1230
1183
  ] }, void 0, !0, {
1231
1184
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1232
- lineNumber: 1078,
1185
+ lineNumber: 1066,
1233
1186
  columnNumber: 13
1234
1187
  }, this)
1235
1188
  ] }, void 0, !0, {
1236
1189
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1237
- lineNumber: 973,
1190
+ lineNumber: 961,
1238
1191
  columnNumber: 9
1239
1192
  }, this),
1240
- /* @__PURE__ */ e(X, { title: "Product Description", hideHeader: !0, children: /* @__PURE__ */ e("div", { className: "space-y-2", children: /* @__PURE__ */ e("div", { className: "space-y-1", children: [
1241
- /* @__PURE__ */ e(x, { htmlFor: "short_description", className: "text-xs uppercase font-bold text-muted-foreground tracking-wider leading-none", children: "Short Description" }, void 0, !1, {
1193
+ /* @__PURE__ */ e(L, { title: "Product Description", hideHeader: !0, children: /* @__PURE__ */ e("div", { className: "space-y-2", children: /* @__PURE__ */ e("div", { className: "space-y-1", children: [
1194
+ /* @__PURE__ */ e(_, { htmlFor: "short_description", className: "text-xs uppercase font-bold text-muted-foreground tracking-wider leading-none", children: "Short Description" }, void 0, !1, {
1242
1195
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1243
- lineNumber: 1159,
1196
+ lineNumber: 1147,
1244
1197
  columnNumber: 15
1245
1198
  }, this),
1246
- /* @__PURE__ */ e(h, { id: "short_description", ...l("short_description"), placeholder: "Brief summary for product cards...", className: "h-8 text-sm" }, void 0, !1, {
1199
+ /* @__PURE__ */ e(x, { id: "short_description", ...m("short_description"), placeholder: "Brief summary for product cards...", className: "h-8 text-sm" }, void 0, !1, {
1247
1200
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1248
- lineNumber: 1160,
1201
+ lineNumber: 1148,
1249
1202
  columnNumber: 15
1250
1203
  }, this)
1251
1204
  ] }, void 0, !0, {
1252
1205
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1253
- lineNumber: 1158,
1206
+ lineNumber: 1146,
1254
1207
  columnNumber: 13
1255
1208
  }, this) }, void 0, !1, {
1256
1209
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1257
- lineNumber: 1157,
1210
+ lineNumber: 1145,
1258
1211
  columnNumber: 11
1259
1212
  }, this) }, void 0, !1, {
1260
1213
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1261
- lineNumber: 1156,
1214
+ lineNumber: 1144,
1262
1215
  columnNumber: 9
1263
1216
  }, this),
1264
- /* @__PURE__ */ e(X, { title: "Media Gallery", description: "Drag to reorder. First image is the hero.", children: [
1217
+ /* @__PURE__ */ e(L, { title: "Media Gallery", description: "Drag to reorder. First image is the hero.", children: [
1265
1218
  /* @__PURE__ */ e(
1266
1219
  ts,
1267
1220
  {
1268
- initialMedia: te,
1269
- onUpdate: Ye,
1270
- mediaPickerNode: g
1221
+ initialMedia: oe,
1222
+ onUpdate: $e,
1223
+ mediaPickerNode: h
1271
1224
  },
1272
1225
  void 0,
1273
1226
  !1,
1274
1227
  {
1275
1228
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1276
- lineNumber: 1166,
1229
+ lineNumber: 1154,
1277
1230
  columnNumber: 11
1278
1231
  },
1279
1232
  this
1280
1233
  ),
1281
- /* @__PURE__ */ e("input", { type: "hidden", ...l("product_media") }, void 0, !1, {
1234
+ /* @__PURE__ */ e("input", { type: "hidden", ...m("product_media") }, void 0, !1, {
1282
1235
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1283
- lineNumber: 1171,
1236
+ lineNumber: 1159,
1284
1237
  columnNumber: 11
1285
1238
  }, this)
1286
1239
  ] }, void 0, !0, {
1287
1240
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1288
- lineNumber: 1165,
1241
+ lineNumber: 1153,
1289
1242
  columnNumber: 9
1290
1243
  }, this),
1291
1244
  !o && /* @__PURE__ */ e("div", { className: "rounded-lg border bg-card p-3 px-4 shadow-sm flex items-center justify-between gap-3 flex-wrap", children: [
1292
- /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: [
1293
- /* @__PURE__ */ e("span", { className: "text-xs uppercase font-bold text-muted-foreground tracking-wider leading-none", children: "Status" }, void 0, !1, {
1294
- fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1295
- lineNumber: 1177,
1296
- columnNumber: 15
1297
- }, this),
1298
- /* @__PURE__ */ e(me, { onValueChange: (r) => t("status", r), value: i("status"), children: [
1299
- /* @__PURE__ */ e(le, { className: "h-8 w-[110px] text-sm", children: /* @__PURE__ */ e(ne, { placeholder: "Status" }, void 0, !1, {
1300
- fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1301
- lineNumber: 1180,
1302
- columnNumber: 19
1303
- }, this) }, void 0, !1, {
1304
- fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1305
- lineNumber: 1179,
1306
- columnNumber: 17
1307
- }, this),
1308
- /* @__PURE__ */ e(de, { children: [
1309
- /* @__PURE__ */ e(R, { value: "draft", children: "Draft" }, void 0, !1, {
1310
- fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1311
- lineNumber: 1183,
1312
- columnNumber: 19
1313
- }, this),
1314
- /* @__PURE__ */ e(R, { value: "active", children: "Active" }, void 0, !1, {
1315
- fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1316
- lineNumber: 1184,
1317
- columnNumber: 19
1318
- }, this),
1319
- /* @__PURE__ */ e(R, { value: "archived", children: "Archived" }, void 0, !1, {
1320
- fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1321
- lineNumber: 1185,
1322
- columnNumber: 19
1323
- }, this)
1324
- ] }, void 0, !0, {
1325
- fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1326
- lineNumber: 1182,
1327
- columnNumber: 17
1328
- }, this)
1329
- ] }, void 0, !0, {
1330
- fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1331
- lineNumber: 1178,
1332
- columnNumber: 15
1333
- }, this)
1334
- ] }, void 0, !0, {
1245
+ /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: "New products start as a draft. Publish it from the top bar once it's ready." }, void 0, !1, {
1335
1246
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1336
- lineNumber: 1176,
1247
+ lineNumber: 1164,
1337
1248
  columnNumber: 13
1338
1249
  }, this),
1339
- /* @__PURE__ */ e(He, { disabled: I, type: "submit", size: "sm", className: "h-8 text-sm px-5", children: I ? "Saving..." : "Save Changes" }, void 0, !1, {
1250
+ /* @__PURE__ */ e(Re, { disabled: T, type: "submit", size: "sm", className: "h-8 text-sm px-5", children: T ? "Saving..." : "Save Changes" }, void 0, !1, {
1340
1251
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1341
- lineNumber: 1189,
1252
+ lineNumber: 1167,
1342
1253
  columnNumber: 13
1343
1254
  }, this)
1344
1255
  ] }, void 0, !0, {
1345
1256
  fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/ProductForm.tsx",
1346
- lineNumber: 1175,
1257
+ lineNumber: 1163,
1347
1258
  columnNumber: 11
1348
1259
  }, this)
1349
1260
  ] }, void 0, !0, {