@billgangcom/theme-lib 1.70.4 → 1.71.0

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.
package/dist/ui.es.js CHANGED
@@ -1,9 +1,9 @@
1
- import { j as t, I, c as V, d as Nt, e as pt, g as mt, P as gt, S as lt, h as Pt, D as ft, i as xt, v as _t, B as dt, k as it, a as wt, l as Tt, O as ht, m as J, n as jt, C as vt, o as H, p as At, q as Et, r as yt, t as qt, w as bt, x as W, L as Dt, y as Ct, z as St, A as ot, s as at, f as tt, E as Rt, F as D, G as Lt, M as ut, H as Ut, J as ct, K as Mt, N as zt, Q as Bt, T as Vt, U as $t, V as Ht } from "./index-DKsAy9m5.js";
2
- import { a3 as Kn, $ as Zn, Z as ti, a2 as ei, Y as si, _ as ni, W as ii, X as ai, a0 as oi, a1 as ci } from "./index-DKsAy9m5.js";
3
- import x from "react";
1
+ import { j as t, I as b, c as H, d as Nt, e as pt, g as mt, P as gt, S as lt, h as kt, D as ft, i as xt, v as _t, B as dt, k as it, a as wt, l as Pt, O as ht, m as Q, n as jt, C as vt, o as F, p as qt, q as At, r as yt, t as Et, w as bt, x as W, L as zt, y as Ct, z as St, A as ot, s as at, f as Z, E as Dt, F as z, G as Rt, M as ut, H as Lt, J as ct, K as Tt, N as Ut, Q as Mt, T as Ht, U as Bt, V as Ft } from "./index-DmoEjH7_.js";
2
+ import { a3 as Qn, $ as Jn, Z as Kn, a2 as Zn, Y as ti, _ as ei, W as si, X as ni, a0 as ii, a1 as ai } from "./index-DmoEjH7_.js";
3
+ import f from "react";
4
4
  import "react-dom";
5
- const Ft = "_block_kh9z8_8", Yt = "_title_kh9z8_16", Gt = "_subtitle_kh9z8_23", Wt = "_alignmentContent_kh9z8_30", Xt = "_alignments_kh9z8_39", Qt = "_alignment_kh9z8_30", Jt = "_circle_kh9z8_64", Kt = "_paddings_kh9z8_71", Zt = "_padding_kh9z8_71", te = "_active_kh9z8_97", Y = {
6
- block: Ft,
5
+ const Vt = "_block_kh9z8_8", Yt = "_title_kh9z8_16", Gt = "_subtitle_kh9z8_23", Wt = "_alignmentContent_kh9z8_30", Xt = "_alignments_kh9z8_39", Qt = "_alignment_kh9z8_30", Jt = "_circle_kh9z8_64", Kt = "_paddings_kh9z8_71", Zt = "_padding_kh9z8_71", te = "_active_kh9z8_97", Y = {
6
+ block: Vt,
7
7
  title: Yt,
8
8
  subtitle: Gt,
9
9
  alignmentContent: Wt,
@@ -23,17 +23,17 @@ const Ft = "_block_kh9z8_8", Yt = "_title_kh9z8_16", Gt = "_subtitle_kh9z8_23",
23
23
  "bottomLeft",
24
24
  "bottom",
25
25
  "bottomRight"
26
- ], se = ["left", "top", "right", "bottom"], En = (u) => {
26
+ ], se = ["left", "top", "right", "bottom"], On = (u) => {
27
27
  const {
28
- alignment: n,
29
- padding: i,
28
+ alignment: i,
29
+ padding: a,
30
30
  setPadding: s,
31
31
  setAlignment: e,
32
- isAlignment: c = !0,
33
- isPadding: a = !0
32
+ isAlignment: l = !0,
33
+ isPadding: r = !0
34
34
  } = u;
35
- function m(l) {
36
- switch (l) {
35
+ function g(v) {
36
+ switch (v) {
37
37
  case "left":
38
38
  case "topLeft":
39
39
  case "bottomLeft":
@@ -50,8 +50,8 @@ const Ft = "_block_kh9z8_8", Yt = "_title_kh9z8_16", Gt = "_subtitle_kh9z8_23",
50
50
  return "TextAlignCenter";
51
51
  }
52
52
  }
53
- function _(l) {
54
- switch (l) {
53
+ function _(v) {
54
+ switch (v) {
55
55
  case "left":
56
56
  return "AlignLeft";
57
57
  case "right":
@@ -62,40 +62,40 @@ const Ft = "_block_kh9z8_8", Yt = "_title_kh9z8_16", Gt = "_subtitle_kh9z8_23",
62
62
  return "AlignBottom";
63
63
  }
64
64
  }
65
- const [b, M] = x.useState(null), [y, g] = x.useState(null);
65
+ const [j, T] = f.useState(null), [x, p] = f.useState(null);
66
66
  return /* @__PURE__ */ t.jsxs("div", { className: Y.layout, children: [
67
67
  /* @__PURE__ */ t.jsx("h3", { className: Y.title, children: "Layout (for Desktop version)" }),
68
68
  /* @__PURE__ */ t.jsxs("div", { className: Y.alignmentContent, children: [
69
- c && /* @__PURE__ */ t.jsxs("div", { className: Y.block, children: [
69
+ l && /* @__PURE__ */ t.jsxs("div", { className: Y.block, children: [
70
70
  /* @__PURE__ */ t.jsx("h5", { className: Y.subtitle, children: "Alignment" }),
71
- /* @__PURE__ */ t.jsx("div", { className: Y.alignments, children: ee.map((l) => /* @__PURE__ */ t.jsxs(
71
+ /* @__PURE__ */ t.jsx("div", { className: Y.alignments, children: ee.map((v) => /* @__PURE__ */ t.jsxs(
72
72
  "div",
73
73
  {
74
74
  onClick: () => {
75
- e(l);
75
+ e(v);
76
76
  },
77
77
  className: Y.alignment,
78
78
  onMouseEnter: () => {
79
- M(l);
79
+ T(v);
80
80
  },
81
81
  onMouseLeave: () => {
82
- M(null);
82
+ T(null);
83
83
  },
84
84
  children: [
85
- l !== n && b !== l && /* @__PURE__ */ t.jsx("div", { className: Y.circle }),
86
- l !== n && b === l && /* @__PURE__ */ t.jsx(
87
- I,
85
+ v !== i && j !== v && /* @__PURE__ */ t.jsx("div", { className: Y.circle }),
86
+ v !== i && j === v && /* @__PURE__ */ t.jsx(
87
+ b,
88
88
  {
89
- name: m(b),
89
+ name: g(j),
90
90
  fill: "#c2c2c2",
91
91
  width: 22,
92
92
  height: 22
93
93
  }
94
94
  ),
95
- l === n && /* @__PURE__ */ t.jsx(
96
- I,
95
+ v === i && /* @__PURE__ */ t.jsx(
96
+ b,
97
97
  {
98
- name: m(n),
98
+ name: g(i),
99
99
  fill: "#FF3F19",
100
100
  width: 22,
101
101
  height: 22
@@ -103,28 +103,28 @@ const Ft = "_block_kh9z8_8", Yt = "_title_kh9z8_16", Gt = "_subtitle_kh9z8_23",
103
103
  )
104
104
  ]
105
105
  },
106
- l
106
+ v
107
107
  )) })
108
108
  ] }),
109
- a && /* @__PURE__ */ t.jsxs("div", { className: Y.block, children: [
109
+ r && /* @__PURE__ */ t.jsxs("div", { className: Y.block, children: [
110
110
  /* @__PURE__ */ t.jsx("h5", { className: Y.subtitle, children: "Paddings" }),
111
- /* @__PURE__ */ t.jsx("div", { className: Y.paddings, children: se.map((l) => /* @__PURE__ */ t.jsxs(
111
+ /* @__PURE__ */ t.jsx("div", { className: Y.paddings, children: se.map((v) => /* @__PURE__ */ t.jsxs(
112
112
  "label",
113
113
  {
114
- className: V(Y.padding, {
115
- [Y.active]: y === l
114
+ className: H(Y.padding, {
115
+ [Y.active]: x === v
116
116
  }),
117
117
  onFocus: () => {
118
- g(l);
118
+ p(v);
119
119
  },
120
120
  onBlur: () => {
121
- g(null);
121
+ p(null);
122
122
  },
123
123
  children: [
124
124
  /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
125
- I,
125
+ b,
126
126
  {
127
- name: _(l),
127
+ name: _(v),
128
128
  width: 20,
129
129
  height: 20
130
130
  }
@@ -133,10 +133,10 @@ const Ft = "_block_kh9z8_8", Yt = "_title_kh9z8_16", Gt = "_subtitle_kh9z8_23",
133
133
  Nt,
134
134
  {
135
135
  type: "number",
136
- value: String(i[l]),
137
- onChange: (r) => s({
138
- ...i,
139
- [l]: Math.min(Number(r), 999)
136
+ value: String(a[v]),
137
+ onChange: (c) => s({
138
+ ...a,
139
+ [v]: Math.min(Number(c), 999)
140
140
  }),
141
141
  max: 999,
142
142
  paddingless: !0,
@@ -145,7 +145,7 @@ const Ft = "_block_kh9z8_8", Yt = "_title_kh9z8_16", Gt = "_subtitle_kh9z8_23",
145
145
  )
146
146
  ]
147
147
  },
148
- l
148
+ v
149
149
  )) })
150
150
  ] })
151
151
  ] })
@@ -163,81 +163,81 @@ const Ft = "_block_kh9z8_8", Yt = "_title_kh9z8_16", Gt = "_subtitle_kh9z8_23",
163
163
  addButton: he,
164
164
  deleteButton: pe
165
165
  };
166
- function me({ id: u, children: n }) {
166
+ function me({ id: u, children: i }) {
167
167
  const {
168
- attributes: i,
168
+ attributes: a,
169
169
  listeners: s,
170
170
  setNodeRef: e,
171
- transform: c,
172
- transition: a,
173
- isDragging: m
171
+ transform: l,
172
+ transition: r,
173
+ isDragging: g
174
174
  } = jt({
175
175
  id: u
176
176
  }), _ = {
177
- transform: vt.Transform.toString(c),
178
- transition: a
177
+ transform: vt.Transform.toString(l),
178
+ transition: r
179
179
  };
180
180
  return /* @__PURE__ */ t.jsx(
181
181
  "div",
182
182
  {
183
183
  ref: e,
184
184
  style: _,
185
- className: `${X.product} ${m ? X.dragging : ""}`,
186
- ...i,
185
+ className: `${X.product} ${g ? X.dragging : ""}`,
186
+ ...a,
187
187
  ...s,
188
- children: n
188
+ children: i
189
189
  }
190
190
  );
191
191
  }
192
192
  const qn = (u) => {
193
193
  const {
194
- isActiveItems: n,
195
- setIsActiveItems: i,
194
+ isActiveItems: i,
195
+ setIsActiveItems: a,
196
196
  items: s,
197
197
  setItems: e,
198
- other: c,
199
- tags: a,
200
- title: m,
198
+ other: l,
199
+ tags: r,
200
+ title: g,
201
201
  subtitle: _,
202
- draggable: b = !1,
203
- withImage: M = !1,
204
- addable: y = !0,
205
- itemsOptions: g,
206
- hasRangeSelector: l = !1,
207
- rangeSelectorOptions: r,
208
- limit: o,
209
- autoScrollInterval: h,
210
- deletable: j,
211
- aspectRatio: v,
212
- setAspectRatio: T
213
- } = u, R = pt(
202
+ draggable: j = !1,
203
+ withImage: T = !1,
204
+ addable: x = !0,
205
+ itemsOptions: p,
206
+ hasRangeSelector: v = !1,
207
+ rangeSelectorOptions: c,
208
+ limit: n,
209
+ autoScrollInterval: o,
210
+ deletable: C,
211
+ aspectRatio: y,
212
+ setAspectRatio: M
213
+ } = u, L = pt(
214
214
  mt(gt, {
215
215
  activationConstraint: {
216
216
  distance: 5
217
217
  }
218
218
  })
219
- ), L = (p) => {
220
- const { active: S, over: w } = p;
221
- if (w && S.id !== w.id) {
222
- const O = s.findIndex((A) => A === S.id), C = s.findIndex((A) => A === w.id);
223
- if (O !== -1 && C !== -1) {
224
- const A = [...s], [N] = A.splice(O, 1);
225
- A.splice(C, 0, N), e(A);
219
+ ), D = (h) => {
220
+ const { active: S, over: P } = h;
221
+ if (P && S.id !== P.id) {
222
+ const O = s.findIndex((q) => q === S.id), N = s.findIndex((q) => q === P.id);
223
+ if (O !== -1 && N !== -1) {
224
+ const q = [...s], [I] = q.splice(O, 1);
225
+ q.splice(N, 0, I), e(q);
226
226
  }
227
227
  }
228
228
  };
229
- function K(p) {
230
- if (M)
231
- return p ? /* @__PURE__ */ t.jsx(
229
+ function J(h) {
230
+ if (T)
231
+ return h ? /* @__PURE__ */ t.jsx(
232
232
  "img",
233
233
  {
234
- src: `https://imagedelivery.net/${p[0]}/w=1000`,
234
+ src: `https://imagedelivery.net/${h[0]}/w=1000`,
235
235
  alt: "image",
236
236
  width: 16,
237
237
  height: 16
238
238
  }
239
239
  ) : /* @__PURE__ */ t.jsx(
240
- I,
240
+ b,
241
241
  {
242
242
  name: "Image",
243
243
  width: 16,
@@ -246,12 +246,12 @@ const qn = (u) => {
246
246
  }
247
247
  );
248
248
  }
249
- const f = (p, S = !1) => {
250
- const w = g.find((C) => C.id === p);
251
- if (!w) return;
249
+ const m = (h, S = !1) => {
250
+ const P = p.find((N) => N.id === h);
251
+ if (!P) return;
252
252
  const O = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
253
- b && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
254
- I,
253
+ j && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
254
+ b,
255
255
  {
256
256
  name: "DotsSixVertical",
257
257
  hoverable: !0,
@@ -262,78 +262,78 @@ const qn = (u) => {
262
262
  /* @__PURE__ */ t.jsx(
263
263
  it,
264
264
  {
265
- onChange: (C) => {
266
- const A = [...s], N = g.find((d) => d.name === C);
267
- if (!N) return;
268
- const E = N.id, z = A.map((d) => d === p ? E : d);
269
- e([...z]);
265
+ onChange: (N) => {
266
+ const q = [...s], I = p.find((d) => d.name === N);
267
+ if (!I) return;
268
+ const A = I.id, U = q.map((d) => d === h ? A : d);
269
+ e([...U]);
270
270
  },
271
- value: w.name,
272
- options: g.filter((C) => !s.find((A) => A === C.id)).map((C) => C.name),
273
- leftAddonOptions: g.map((C) => ({
274
- value: C.name,
275
- addon: K(C.images)
271
+ value: P.name,
272
+ options: p.filter((N) => !s.find((q) => q === N.id)).map((N) => N.name),
273
+ leftAddonOptions: p.map((N) => ({
274
+ value: N.name,
275
+ addon: J(N.images)
276
276
  }))
277
277
  }
278
278
  ),
279
279
  S && /* @__PURE__ */ t.jsx("div", { className: X.buttons, children: /* @__PURE__ */ t.jsx("div", { className: X.deleteButton, children: /* @__PURE__ */ t.jsx(
280
- I,
280
+ b,
281
281
  {
282
282
  name: "Trash",
283
283
  hoverable: !0,
284
284
  width: 20,
285
285
  height: 20,
286
286
  fill: "#C12A2A",
287
- onClick: () => e(s.filter((C) => C !== p))
287
+ onClick: () => e(s.filter((N) => N !== h))
288
288
  }
289
289
  ) }) })
290
290
  ] });
291
- return b ? /* @__PURE__ */ t.jsx(
291
+ return j ? /* @__PURE__ */ t.jsx(
292
292
  me,
293
293
  {
294
- id: p,
294
+ id: h,
295
295
  children: O
296
296
  },
297
- J()
297
+ Q()
298
298
  ) : /* @__PURE__ */ t.jsx(
299
299
  "div",
300
300
  {
301
301
  className: X.product,
302
302
  children: O
303
303
  },
304
- J()
304
+ Q()
305
305
  );
306
306
  };
307
307
  return /* @__PURE__ */ t.jsxs("div", { className: X.productsBlock, children: [
308
- (m || n !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: X.top, children: [
309
- m && /* @__PURE__ */ t.jsx("h3", { className: X.title, children: m }),
310
- n !== void 0 && /* @__PURE__ */ t.jsx(
308
+ (g || i !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: X.top, children: [
309
+ g && /* @__PURE__ */ t.jsx("h3", { className: X.title, children: g }),
310
+ i !== void 0 && /* @__PURE__ */ t.jsx(
311
311
  lt,
312
312
  {
313
- current: n,
314
- onChange: (p) => i == null ? void 0 : i(p)
313
+ current: i,
314
+ onChange: (h) => a == null ? void 0 : a(h)
315
315
  }
316
316
  )
317
317
  ] }),
318
- l && r && /* @__PURE__ */ t.jsx(Pt, { ...r }),
318
+ v && c && /* @__PURE__ */ t.jsx(kt, { ...c }),
319
319
  /* @__PURE__ */ t.jsxs("div", { className: X.products, children: [
320
320
  _ && /* @__PURE__ */ t.jsx("h5", { className: X.subtitle, children: _ }),
321
- b ? /* @__PURE__ */ t.jsx(
321
+ j ? /* @__PURE__ */ t.jsx(
322
322
  ft,
323
323
  {
324
- sensors: R,
325
- onDragEnd: L,
324
+ sensors: L,
325
+ onDragEnd: D,
326
326
  children: /* @__PURE__ */ t.jsx(
327
327
  xt,
328
328
  {
329
329
  items: s,
330
330
  strategy: _t,
331
- children: s.map((p) => f(p, j))
331
+ children: s.map((h) => m(h, C))
332
332
  }
333
333
  )
334
334
  }
335
- ) : s.map((p) => f(p, j)),
336
- y && /* @__PURE__ */ t.jsx(
335
+ ) : s.map((h) => m(h, C)),
336
+ x && /* @__PURE__ */ t.jsx(
337
337
  "div",
338
338
  {
339
339
  style: {
@@ -346,22 +346,22 @@ const qn = (u) => {
346
346
  dt,
347
347
  {
348
348
  withoutHover: !0,
349
- className: V(X.button, {
350
- [X.disabled]: !!(o && o <= s.length || s.length === g.length)
349
+ className: H(X.button, {
350
+ [X.disabled]: !!(n && n <= s.length || s.length === p.length)
351
351
  }),
352
352
  size: "s",
353
- disabled: !!(o && o <= s.length || s.length === g.length),
353
+ disabled: !!(n && n <= s.length || s.length === p.length),
354
354
  onClick: () => {
355
- const p = [...s];
355
+ const h = [...s];
356
356
  let S = null;
357
- if (g) {
358
- for (let w = 0; w < g.length; w++)
359
- if (!s.find((O) => O === g[w].id)) {
360
- S = g[w];
357
+ if (p) {
358
+ for (let P = 0; P < p.length; P++)
359
+ if (!s.find((O) => O === p[P].id)) {
360
+ S = p[P];
361
361
  break;
362
362
  }
363
363
  }
364
- p.push((S == null ? void 0 : S.id) || g[0].id), e(p);
364
+ h.push((S == null ? void 0 : S.id) || p[0].id), e(h);
365
365
  },
366
366
  style: {
367
367
  width: "fit-content"
@@ -369,7 +369,7 @@ const qn = (u) => {
369
369
  children: /* @__PURE__ */ t.jsxs("div", { className: X.addButton, children: [
370
370
  /* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
371
371
  /* @__PURE__ */ t.jsx(
372
- I,
372
+ b,
373
373
  {
374
374
  name: "Plus",
375
375
  width: 16,
@@ -382,37 +382,37 @@ const qn = (u) => {
382
382
  }
383
383
  )
384
384
  ] }),
385
- v && T && /* @__PURE__ */ t.jsx(
385
+ y && M && /* @__PURE__ */ t.jsx(
386
386
  it,
387
387
  {
388
- value: v,
388
+ value: y,
389
389
  label: "Aspect Ratio",
390
- options: Object.keys(Tt),
391
- onChange: (p) => T(p),
390
+ options: Object.keys(Pt),
391
+ onChange: (h) => M(h),
392
392
  leftAddonOptions: wt
393
393
  }
394
394
  ),
395
- a !== void 0 && /* @__PURE__ */ t.jsx(
395
+ r !== void 0 && /* @__PURE__ */ t.jsx(
396
396
  ht,
397
397
  {
398
398
  tagsTitle: "Tags",
399
- items: a
399
+ items: r
400
400
  }
401
401
  ),
402
- c !== void 0 && /* @__PURE__ */ t.jsx(
402
+ l !== void 0 && /* @__PURE__ */ t.jsx(
403
403
  ht,
404
404
  {
405
405
  otherTitle: "Other",
406
- items: c
406
+ items: l
407
407
  }
408
408
  ),
409
- h !== void 0 && /* @__PURE__ */ t.jsx(
409
+ o !== void 0 && /* @__PURE__ */ t.jsx(
410
410
  Nt,
411
411
  {
412
412
  label: "Auto scroll interval",
413
413
  type: "number",
414
- value: String(h.scrollInterval),
415
- onChange: (p) => h.setScrollInterval(Number(p)),
414
+ value: String(o.scrollInterval),
415
+ onChange: (h) => o.setScrollInterval(Number(h)),
416
416
  min: 0.1,
417
417
  max: 100,
418
418
  style: {
@@ -422,7 +422,7 @@ const qn = (u) => {
422
422
  }
423
423
  )
424
424
  ] });
425
- }, ge = "_title_roi3a_1", fe = "_subtitle_roi3a_5", xe = "_productsBlock_roi3a_14", _e = "_top_roi3a_26", je = "_products_roi3a_14", ve = "_product_roi3a_14", ye = "_button_roi3a_80", be = "_disabled_roi3a_91", Ie = "_buttons_roi3a_118", Ne = "_addButton_roi3a_164", Ce = "_deleteButton_roi3a_179", F = {
425
+ }, ge = "_title_roi3a_1", fe = "_subtitle_roi3a_5", xe = "_productsBlock_roi3a_14", _e = "_top_roi3a_26", je = "_products_roi3a_14", ve = "_product_roi3a_14", ye = "_button_roi3a_80", be = "_disabled_roi3a_91", Ie = "_buttons_roi3a_118", Ne = "_addButton_roi3a_164", Ce = "_deleteButton_roi3a_179", V = {
426
426
  title: ge,
427
427
  subtitle: fe,
428
428
  productsBlock: xe,
@@ -435,83 +435,83 @@ const qn = (u) => {
435
435
  addButton: Ne,
436
436
  deleteButton: Ce
437
437
  };
438
- function Se({ product: u, children: n }) {
438
+ function Se({ product: u, children: i }) {
439
439
  const {
440
- attributes: i,
440
+ attributes: a,
441
441
  listeners: s,
442
442
  setNodeRef: e,
443
- transform: c,
444
- transition: a,
445
- isDragging: m
443
+ transform: l,
444
+ transition: r,
445
+ isDragging: g
446
446
  } = jt({
447
447
  id: u.id
448
448
  }), _ = {
449
- transform: vt.Transform.toString(c),
450
- transition: a
449
+ transform: vt.Transform.toString(l),
450
+ transition: r
451
451
  };
452
452
  return /* @__PURE__ */ t.jsx(
453
453
  "div",
454
454
  {
455
455
  ref: e,
456
456
  style: _,
457
- className: `${F.product} ${m ? F.dragging : ""}`,
458
- ...i,
457
+ className: `${V.product} ${g ? V.dragging : ""}`,
458
+ ...a,
459
459
  ...s,
460
- children: n
460
+ children: i
461
461
  }
462
462
  );
463
463
  }
464
- const Dn = (u) => {
464
+ const An = (u) => {
465
465
  const {
466
- isActiveItems: n,
467
- setIsActiveItems: i,
466
+ isActiveItems: i,
467
+ setIsActiveItems: a,
468
468
  items: s,
469
469
  setItems: e,
470
- title: c,
471
- subtitle: a,
472
- editable: m = !0,
470
+ title: l,
471
+ subtitle: r,
472
+ editable: g = !0,
473
473
  draggable: _ = !1,
474
- deletable: b = !0,
475
- addable: M = !0,
476
- itemsType: y,
477
- itemsOptions: g,
478
- addableOptions: l = {},
479
- limit: r
480
- } = u, [o, h] = x.useState(null), [j, v] = x.useState(null), T = x.useRef(null), R = pt(
474
+ deletable: j = !0,
475
+ addable: T = !0,
476
+ itemsType: x,
477
+ itemsOptions: p,
478
+ addableOptions: v = {},
479
+ limit: c
480
+ } = u, [n, o] = f.useState(null), [C, y] = f.useState(null), M = f.useRef(null), L = pt(
481
481
  mt(gt, {
482
482
  activationConstraint: {
483
483
  distance: 5
484
484
  }
485
485
  })
486
486
  );
487
- x.useEffect(() => {
488
- if (o) {
489
- const p = [...s].map((S) => S.id === o.id ? o : S);
490
- e(p);
487
+ f.useEffect(() => {
488
+ if (n) {
489
+ const h = [...s].map((S) => S.id === n.id ? n : S);
490
+ e(h);
491
491
  }
492
- }, [o]), x.useEffect(() => {
493
- T.current && j && (T.current.getBoundingClientRect().height, j.top);
494
- }, [T.current, j]);
495
- const L = (p, S) => {
496
- p.stopPropagation();
497
- const w = p.target.getBoundingClientRect();
498
- v({
499
- top: w.top + window.scrollY,
500
- left: w.left - 30
501
- }), h(S);
502
- }, K = (p) => {
503
- const { active: S, over: w } = p;
504
- if (w && S.id !== w.id) {
505
- const O = s.findIndex((A) => A.id === S.id), C = s.findIndex((A) => A.id === w.id);
506
- if (O !== -1 && C !== -1) {
507
- const A = [...s], [N] = A.splice(O, 1);
508
- A.splice(C, 0, N), e(A);
492
+ }, [n]), f.useEffect(() => {
493
+ M.current && C && (M.current.getBoundingClientRect().height, C.top);
494
+ }, [M.current, C]);
495
+ const D = (h, S) => {
496
+ h.stopPropagation();
497
+ const P = h.target.getBoundingClientRect();
498
+ y({
499
+ top: P.top + window.scrollY,
500
+ left: P.left - 30
501
+ }), o(S);
502
+ }, J = (h) => {
503
+ const { active: S, over: P } = h;
504
+ if (P && S.id !== P.id) {
505
+ const O = s.findIndex((q) => q.id === S.id), N = s.findIndex((q) => q.id === P.id);
506
+ if (O !== -1 && N !== -1) {
507
+ const q = [...s], [I] = q.splice(O, 1);
508
+ q.splice(N, 0, I), e(q);
509
509
  }
510
510
  }
511
- }, f = (p, S) => {
512
- const w = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
511
+ }, m = (h, S) => {
512
+ const P = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
513
513
  _ && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
514
- I,
514
+ b,
515
515
  {
516
516
  name: "DotsSixVertical",
517
517
  hoverable: !0,
@@ -519,49 +519,49 @@ const Dn = (u) => {
519
519
  height: 20
520
520
  }
521
521
  ) }),
522
- y === "select" && g && /* @__PURE__ */ t.jsx(
522
+ x === "select" && p && /* @__PURE__ */ t.jsx(
523
523
  it,
524
524
  {
525
525
  onChange: (O) => {
526
- const C = [...s], A = g.find((E) => E.name === O);
527
- if (!A) return;
528
- const N = C.map((E) => E.id === p.id ? {
529
- ...A,
526
+ const N = [...s], q = p.find((A) => A.name === O);
527
+ if (!q) return;
528
+ const I = N.map((A) => A.id === h.id ? {
529
+ ...q,
530
530
  name: {
531
531
  "en-US": O
532
532
  }
533
- } : E);
534
- h({
535
- ...p,
533
+ } : A);
534
+ o({
535
+ ...h,
536
536
  name: {
537
537
  "en-US": O
538
538
  }
539
- }), e([...N]);
539
+ }), e([...I]);
540
540
  },
541
- value: p.name,
542
- options: g.filter((O) => !s.find((C) => C.name === O.name)).map((O) => O.name)
541
+ value: h.name,
542
+ options: p.filter((O) => !s.find((N) => N.name === O.name)).map((O) => O.name)
543
543
  }
544
544
  ),
545
- /* @__PURE__ */ t.jsxs("div", { className: F.buttons, children: [
546
- m && /* @__PURE__ */ t.jsx("div", { className: F.deleteButton, children: /* @__PURE__ */ t.jsx(
547
- I,
545
+ /* @__PURE__ */ t.jsxs("div", { className: V.buttons, children: [
546
+ g && /* @__PURE__ */ t.jsx("div", { className: V.deleteButton, children: /* @__PURE__ */ t.jsx(
547
+ b,
548
548
  {
549
549
  name: "Sliders",
550
550
  hoverable: !0,
551
551
  width: 20,
552
552
  height: 20,
553
- onClick: (O) => L(O, p)
553
+ onClick: (O) => D(O, h)
554
554
  }
555
555
  ) }),
556
- b && /* @__PURE__ */ t.jsx("div", { className: F.deleteButton, children: /* @__PURE__ */ t.jsx(
557
- I,
556
+ j && /* @__PURE__ */ t.jsx("div", { className: V.deleteButton, children: /* @__PURE__ */ t.jsx(
557
+ b,
558
558
  {
559
559
  name: "Trash",
560
560
  hoverable: !0,
561
561
  width: 20,
562
562
  height: 20,
563
563
  fill: "#C12A2A",
564
- onClick: () => e(s.filter((O) => O.id !== p.id))
564
+ onClick: () => e(s.filter((O) => O.id !== h.id))
565
565
  }
566
566
  ) })
567
567
  ] })
@@ -569,49 +569,49 @@ const Dn = (u) => {
569
569
  return _ ? /* @__PURE__ */ t.jsx(
570
570
  Se,
571
571
  {
572
- product: p,
572
+ product: h,
573
573
  index: S,
574
- children: w
574
+ children: P
575
575
  },
576
- p.id
576
+ h.id
577
577
  ) : /* @__PURE__ */ t.jsx(
578
578
  "div",
579
579
  {
580
- className: F.product,
581
- children: w
580
+ className: V.product,
581
+ children: P
582
582
  },
583
- p.id
583
+ h.id
584
584
  );
585
585
  };
586
- return /* @__PURE__ */ t.jsxs("div", { className: F.productsBlock, children: [
587
- (c || n !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: F.top, children: [
588
- c && /* @__PURE__ */ t.jsx("h3", { className: F.title, children: c }),
589
- n !== void 0 && /* @__PURE__ */ t.jsx(
586
+ return /* @__PURE__ */ t.jsxs("div", { className: V.productsBlock, children: [
587
+ (l || i !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: V.top, children: [
588
+ l && /* @__PURE__ */ t.jsx("h3", { className: V.title, children: l }),
589
+ i !== void 0 && /* @__PURE__ */ t.jsx(
590
590
  lt,
591
591
  {
592
- current: n,
593
- onChange: (p) => i == null ? void 0 : i(p)
592
+ current: i,
593
+ onChange: (h) => a == null ? void 0 : a(h)
594
594
  }
595
595
  )
596
596
  ] }),
597
- /* @__PURE__ */ t.jsxs("div", { className: F.products, children: [
598
- a && /* @__PURE__ */ t.jsx("h5", { className: F.subtitle, children: a }),
597
+ /* @__PURE__ */ t.jsxs("div", { className: V.products, children: [
598
+ r && /* @__PURE__ */ t.jsx("h5", { className: V.subtitle, children: r }),
599
599
  _ ? /* @__PURE__ */ t.jsx(
600
600
  ft,
601
601
  {
602
- sensors: R,
603
- onDragEnd: K,
602
+ sensors: L,
603
+ onDragEnd: J,
604
604
  children: /* @__PURE__ */ t.jsx(
605
605
  xt,
606
606
  {
607
- items: s.map((p) => p.id),
607
+ items: s.map((h) => h.id),
608
608
  strategy: _t,
609
- children: s.map((p, S) => f(p, S))
609
+ children: s.map((h, S) => m(h, S))
610
610
  }
611
611
  )
612
612
  }
613
- ) : s.map((p, S) => f(p, S)),
614
- M && /* @__PURE__ */ t.jsx(
613
+ ) : s.map((h, S) => m(h, S)),
614
+ T && /* @__PURE__ */ t.jsx(
615
615
  "div",
616
616
  {
617
617
  style: {
@@ -623,34 +623,34 @@ const Dn = (u) => {
623
623
  dt,
624
624
  {
625
625
  withoutHover: !0,
626
- className: V(F.button, {
627
- [F.disabled]: !!(r && r <= s.length || s.length === (g == null ? void 0 : g.length))
626
+ className: H(V.button, {
627
+ [V.disabled]: !!(c && c <= s.length || s.length === (p == null ? void 0 : p.length))
628
628
  }),
629
629
  size: "s",
630
- disabled: !!(r && r <= s.length || s.length === (g == null ? void 0 : g.length)),
630
+ disabled: !!(c && c <= s.length || s.length === (p == null ? void 0 : p.length)),
631
631
  onClick: () => {
632
- const p = [...s];
632
+ const h = [...s];
633
633
  let S = null;
634
- if (g) {
635
- for (let w = 0; w < g.length; w++)
636
- if (!s.find((O) => O.id === g[w].id)) {
637
- S = g[w];
634
+ if (p) {
635
+ for (let P = 0; P < p.length; P++)
636
+ if (!s.find((O) => O.id === p[P].id)) {
637
+ S = p[P];
638
638
  break;
639
639
  }
640
640
  }
641
- y === "select" && g && p.push({
642
- name: S ? S.name : g[0].name,
643
- id: (S == null ? void 0 : S.id) || g[0].id,
644
- ...l
645
- }), e(p);
641
+ x === "select" && p && h.push({
642
+ name: S ? S.name : p[0].name,
643
+ id: (S == null ? void 0 : S.id) || p[0].id,
644
+ ...v
645
+ }), e(h);
646
646
  },
647
647
  style: {
648
648
  width: "fit-content"
649
649
  },
650
- children: /* @__PURE__ */ t.jsxs("div", { className: F.addButton, children: [
650
+ children: /* @__PURE__ */ t.jsxs("div", { className: V.addButton, children: [
651
651
  /* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
652
652
  /* @__PURE__ */ t.jsx(
653
- I,
653
+ b,
654
654
  {
655
655
  name: "Plus",
656
656
  width: 16,
@@ -666,98 +666,98 @@ const Dn = (u) => {
666
666
  ] });
667
667
  };
668
668
  function ke(u) {
669
- const { product: n, children: i } = u, { attributes: s, listeners: e, setNodeRef: c, transform: a, transition: m, isDragging: _ } = jt({
670
- id: n.id
671
- }), b = {
672
- transform: vt.Transform.toString(a),
673
- transition: m
669
+ const { product: i, children: a } = u, { attributes: s, listeners: e, setNodeRef: l, transform: r, transition: g, isDragging: _ } = jt({
670
+ id: i.id
671
+ }), j = {
672
+ transform: vt.Transform.toString(r),
673
+ transition: g
674
674
  };
675
675
  return /* @__PURE__ */ t.jsx(
676
676
  "div",
677
677
  {
678
- ref: c,
679
- style: b,
680
- className: `${H.product} ${_ ? H.dragging : ""}`,
678
+ ref: l,
679
+ style: j,
680
+ className: `${F.product} ${_ ? F.dragging : ""}`,
681
681
  ...s,
682
682
  ...e,
683
- children: i
683
+ children: a
684
684
  }
685
685
  );
686
686
  }
687
- const Rn = (u) => {
687
+ const En = (u) => {
688
688
  const {
689
- isActiveItems: n,
690
- setIsActiveItems: i,
689
+ isActiveItems: i,
690
+ setIsActiveItems: a,
691
691
  items: s,
692
692
  setItems: e,
693
- other: c,
694
- title: a,
695
- subtitle: m,
693
+ other: l,
694
+ title: r,
695
+ subtitle: g,
696
696
  editable: _ = !0,
697
- draggable: b = !1,
698
- deletable: M = !0,
699
- addable: y = !0,
700
- itemsType: g,
701
- itemsPlaceholder: l = "",
702
- itemsOptions: r,
703
- hasRangeSelector: o = !1,
704
- rangeSelectorOptions: h,
705
- modalOptions: j,
706
- addableOptions: v = {},
707
- limit: T
708
- } = u, [R, L] = x.useState(null), [K, f] = x.useState({
697
+ draggable: j = !1,
698
+ deletable: T = !0,
699
+ addable: x = !0,
700
+ itemsType: p,
701
+ itemsPlaceholder: v = "",
702
+ itemsOptions: c,
703
+ hasRangeSelector: n = !1,
704
+ rangeSelectorOptions: o,
705
+ modalOptions: C,
706
+ addableOptions: y = {},
707
+ limit: M
708
+ } = u, [L, D] = f.useState(null), [J, m] = f.useState({
709
709
  top: 0,
710
710
  left: 0
711
- }), [p, S] = x.useState(null), w = x.useRef(null), [O, C] = x.useState(!1), A = pt(
711
+ }), [h, S] = f.useState(null), P = f.useRef(null), [O, N] = f.useState(!1), q = pt(
712
712
  mt(gt, {
713
713
  activationConstraint: {
714
714
  distance: 5
715
715
  }
716
716
  })
717
717
  );
718
- x.useEffect(() => {
718
+ f.useEffect(() => {
719
719
  const d = () => {
720
- L(null), C(!1);
720
+ D(null), N(!1);
721
721
  };
722
- return document.body.addEventListener("click", d), L(null), C(!1), () => {
723
- L(null), C(!1), document.body.removeEventListener("click", d);
722
+ return document.body.addEventListener("click", d), D(null), N(!1), () => {
723
+ D(null), N(!1), document.body.removeEventListener("click", d);
724
724
  };
725
- }, []), x.useEffect(() => {
726
- if (R) {
727
- const d = [...s].map(($) => $.id === R.id ? R : $);
725
+ }, []), f.useEffect(() => {
726
+ if (L) {
727
+ const d = [...s].map(($) => $.id === L.id ? L : $);
728
728
  e(d);
729
729
  }
730
- }, [R]), x.useEffect(() => {
731
- if (w.current && p) {
732
- const d = w.current.getBoundingClientRect().height, $ = window.innerHeight;
733
- let k = p.top;
734
- k + d > $ + window.scrollY - 200 && (k = $ + window.scrollY - d - 200), k < 0 && (k = 10), f({
730
+ }, [L]), f.useEffect(() => {
731
+ if (P.current && h) {
732
+ const d = P.current.getBoundingClientRect().height, $ = window.innerHeight;
733
+ let k = h.top;
734
+ k + d > $ + window.scrollY - 200 && (k = $ + window.scrollY - d - 200), k < 0 && (k = 10), m({
735
735
  top: k,
736
- left: p.left
736
+ left: h.left
737
737
  });
738
738
  }
739
- }, [w.current, p]);
740
- const N = (d, $) => {
739
+ }, [P.current, h]);
740
+ const I = (d, $) => {
741
741
  d.stopPropagation();
742
742
  const k = d.target.getBoundingClientRect();
743
743
  S({
744
744
  top: k.top + window.scrollY,
745
745
  left: k.left - 30
746
- }), L($), C(!0);
747
- }, E = (d) => {
746
+ }), D($), N(!0);
747
+ }, A = (d) => {
748
748
  const { active: $, over: k } = d;
749
749
  if (k && $.id !== k.id) {
750
- const q = s.findIndex((U) => U.id === $.id), et = s.findIndex((U) => U.id === k.id);
751
- if (q !== -1 && et !== -1) {
752
- const U = [...s], [Z] = U.splice(q, 1);
753
- U.splice(et, 0, Z), e(U);
750
+ const E = s.findIndex((R) => R.id === $.id), et = s.findIndex((R) => R.id === k.id);
751
+ if (E !== -1 && et !== -1) {
752
+ const R = [...s], [K] = R.splice(E, 1);
753
+ R.splice(et, 0, K), e(R);
754
754
  }
755
755
  }
756
- }, z = (d) => {
756
+ }, U = (d) => {
757
757
  var k;
758
758
  const $ = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
759
- b && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
760
- I,
759
+ j && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
760
+ b,
761
761
  {
762
762
  name: "DotsSixVertical",
763
763
  hoverable: !0,
@@ -765,83 +765,83 @@ const Rn = (u) => {
765
765
  height: 20
766
766
  }
767
767
  ) }),
768
- g === "select" && r && /* @__PURE__ */ t.jsx(
768
+ p === "select" && c && /* @__PURE__ */ t.jsx(
769
769
  it,
770
770
  {
771
- onChange: (q) => {
772
- const U = [...s].map((Z) => Z.id === d.id ? {
771
+ onChange: (E) => {
772
+ const R = [...s].map((K) => K.id === d.id ? {
773
773
  ...d,
774
774
  name: {
775
- "en-US": q
775
+ "en-US": E
776
776
  }
777
- } : Z);
778
- L({
777
+ } : K);
778
+ D({
779
779
  ...d,
780
780
  name: {
781
- "en-US": q
781
+ "en-US": E
782
782
  }
783
- }), e([...U]);
783
+ }), e([...R]);
784
784
  },
785
785
  value: d.name["en-US"],
786
- options: r.filter(
787
- (q) => !s.find((et) => et.name["en-US"] === q)
786
+ options: c.filter(
787
+ (E) => !s.find((et) => et.name["en-US"] === E)
788
788
  )
789
789
  }
790
790
  ),
791
- g === "input" && /* @__PURE__ */ t.jsx(
791
+ p === "input" && /* @__PURE__ */ t.jsx(
792
792
  Nt,
793
793
  {
794
- onChange: (q) => {
795
- const U = [...s].map((Z) => Z.id === d.id ? {
794
+ onChange: (E) => {
795
+ const R = [...s].map((K) => K.id === d.id ? {
796
796
  ...d,
797
797
  name: {
798
- "en-US": q
798
+ "en-US": E
799
799
  }
800
- } : Z);
801
- e([...U]);
800
+ } : K);
801
+ e([...R]);
802
802
  },
803
803
  value: d.name["en-US"],
804
- placeholder: l
804
+ placeholder: v
805
805
  }
806
806
  ),
807
- g === "image" && /* @__PURE__ */ t.jsx(
808
- Et,
807
+ p === "image" && /* @__PURE__ */ t.jsx(
808
+ At,
809
809
  {
810
- onChange: (q) => {
811
- const U = [...s].map((Z) => Z.id === d.id ? {
810
+ onChange: (E) => {
811
+ const R = [...s].map((K) => K.id === d.id ? {
812
812
  ...d,
813
- images: q
814
- } : Z);
815
- e([...U]);
813
+ images: E
814
+ } : K);
815
+ e([...R]);
816
816
  },
817
- activeImage: (k = s.find((q) => q.id === d.id)) == null ? void 0 : k.images[0]
817
+ activeImage: (k = s.find((E) => E.id === d.id)) == null ? void 0 : k.images[0]
818
818
  }
819
819
  ),
820
- /* @__PURE__ */ t.jsxs("div", { className: H.buttons, children: [
821
- _ && /* @__PURE__ */ t.jsx("div", { className: H.deleteButton, children: /* @__PURE__ */ t.jsx(
822
- I,
820
+ /* @__PURE__ */ t.jsxs("div", { className: F.buttons, children: [
821
+ _ && /* @__PURE__ */ t.jsx("div", { className: F.deleteButton, children: /* @__PURE__ */ t.jsx(
822
+ b,
823
823
  {
824
824
  name: "Sliders",
825
825
  hoverable: !0,
826
826
  width: 20,
827
827
  height: 20,
828
- onClick: (q) => N(q, d)
828
+ onClick: (E) => I(E, d)
829
829
  }
830
830
  ) }),
831
- M && /* @__PURE__ */ t.jsx("div", { className: H.deleteButton, children: /* @__PURE__ */ t.jsx(
832
- I,
831
+ T && /* @__PURE__ */ t.jsx("div", { className: F.deleteButton, children: /* @__PURE__ */ t.jsx(
832
+ b,
833
833
  {
834
834
  name: "Trash",
835
835
  hoverable: !0,
836
836
  width: 20,
837
837
  height: 20,
838
838
  fill: "#C12A2A",
839
- onClick: () => e(s.filter((q) => q.id !== d.id))
839
+ onClick: () => e(s.filter((E) => E.id !== d.id))
840
840
  }
841
841
  ) })
842
842
  ] })
843
843
  ] });
844
- return b ? /* @__PURE__ */ t.jsx(
844
+ return j ? /* @__PURE__ */ t.jsx(
845
845
  ke,
846
846
  {
847
847
  product: d,
@@ -851,53 +851,53 @@ const Rn = (u) => {
851
851
  ) : /* @__PURE__ */ t.jsx(
852
852
  "div",
853
853
  {
854
- className: H.product,
854
+ className: F.product,
855
855
  children: $
856
856
  },
857
857
  d.id
858
858
  );
859
859
  };
860
- return /* @__PURE__ */ t.jsxs("div", { className: H.productsBlock, children: [
861
- (a || n !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: H.top, children: [
862
- a && /* @__PURE__ */ t.jsx("h3", { className: H.title, children: a }),
863
- n !== void 0 && /* @__PURE__ */ t.jsx(
860
+ return /* @__PURE__ */ t.jsxs("div", { className: F.productsBlock, children: [
861
+ (r || i !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: F.top, children: [
862
+ r && /* @__PURE__ */ t.jsx("h3", { className: F.title, children: r }),
863
+ i !== void 0 && /* @__PURE__ */ t.jsx(
864
864
  lt,
865
865
  {
866
- current: n,
867
- onChange: (d) => i == null ? void 0 : i(d)
866
+ current: i,
867
+ onChange: (d) => a == null ? void 0 : a(d)
868
868
  }
869
869
  )
870
870
  ] }),
871
- R && _ && j && O && /* @__PURE__ */ t.jsx(
872
- At,
871
+ L && _ && C && O && /* @__PURE__ */ t.jsx(
872
+ qt,
873
873
  {
874
- ref: w,
875
- activeItem: R,
876
- setActiveItem: L,
877
- popupPosition: K,
878
- modalOptions: j,
879
- setIsOpenModal: C
874
+ ref: P,
875
+ activeItem: L,
876
+ setActiveItem: D,
877
+ popupPosition: J,
878
+ modalOptions: C,
879
+ setIsOpenModal: N
880
880
  }
881
881
  ),
882
- o && h && /* @__PURE__ */ t.jsx(Pt, { ...h }),
883
- /* @__PURE__ */ t.jsxs("div", { className: H.products, children: [
884
- m && /* @__PURE__ */ t.jsx("h5", { className: H.subtitle, children: m }),
885
- b ? /* @__PURE__ */ t.jsx(
882
+ n && o && /* @__PURE__ */ t.jsx(kt, { ...o }),
883
+ /* @__PURE__ */ t.jsxs("div", { className: F.products, children: [
884
+ g && /* @__PURE__ */ t.jsx("h5", { className: F.subtitle, children: g }),
885
+ j ? /* @__PURE__ */ t.jsx(
886
886
  ft,
887
887
  {
888
- sensors: A,
889
- onDragEnd: E,
888
+ sensors: q,
889
+ onDragEnd: A,
890
890
  children: /* @__PURE__ */ t.jsx(
891
891
  xt,
892
892
  {
893
893
  items: s.map((d) => d.id),
894
894
  strategy: _t,
895
- children: s.map((d) => z(d))
895
+ children: s.map((d) => U(d))
896
896
  }
897
897
  )
898
898
  }
899
- ) : s.map((d) => z(d)),
900
- y && /* @__PURE__ */ t.jsx(
899
+ ) : s.map((d) => U(d)),
900
+ x && /* @__PURE__ */ t.jsx(
901
901
  "div",
902
902
  {
903
903
  style: {
@@ -909,52 +909,52 @@ const Rn = (u) => {
909
909
  dt,
910
910
  {
911
911
  withoutHover: !0,
912
- className: V(H.button, {
913
- [H.disabled]: !!(T && T <= s.length)
912
+ className: H(F.button, {
913
+ [F.disabled]: !!(M && M <= s.length)
914
914
  }),
915
915
  size: "s",
916
- disabled: !!(T && T <= s.length),
916
+ disabled: !!(M && M <= s.length),
917
917
  onClick: () => {
918
918
  const d = [...s];
919
919
  let $ = null;
920
- if (r) {
921
- for (let k = 0; k < r.length; k++)
922
- if (!s.find((q) => q.name["en-US"] === r[k])) {
923
- $ = r[k];
920
+ if (c) {
921
+ for (let k = 0; k < c.length; k++)
922
+ if (!s.find((E) => E.name["en-US"] === c[k])) {
923
+ $ = c[k];
924
924
  break;
925
925
  }
926
926
  }
927
- g === "select" && r ? d.push({
927
+ p === "select" && c ? d.push({
928
928
  name: {
929
- "en-US": $ || r[0]
929
+ "en-US": $ || c[0]
930
930
  },
931
- id: J(),
932
- ...v,
931
+ id: Q(),
932
+ ...y,
933
933
  maxSymbols: 100
934
934
  // пример значения
935
- }) : g === "input" ? d.push({
935
+ }) : p === "input" ? d.push({
936
936
  name: {
937
937
  "en-US": ""
938
938
  },
939
- id: J(),
940
- ...v,
939
+ id: Q(),
940
+ ...y,
941
941
  maxSymbols: 100
942
942
  }) : d.push({
943
943
  name: {
944
944
  "en-US": `Image ${s.length + 1}`
945
945
  },
946
- id: J(),
947
- ...v,
946
+ id: Q(),
947
+ ...y,
948
948
  maxSymbols: 100
949
949
  }), e(d);
950
950
  },
951
951
  style: {
952
952
  width: "fit-content"
953
953
  },
954
- children: /* @__PURE__ */ t.jsxs("div", { className: H.addButton, children: [
954
+ children: /* @__PURE__ */ t.jsxs("div", { className: F.addButton, children: [
955
955
  /* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
956
956
  /* @__PURE__ */ t.jsx(
957
- I,
957
+ b,
958
958
  {
959
959
  name: "Plus",
960
960
  width: 16,
@@ -967,60 +967,60 @@ const Rn = (u) => {
967
967
  }
968
968
  )
969
969
  ] }),
970
- c !== void 0 && /* @__PURE__ */ t.jsx(
970
+ l !== void 0 && /* @__PURE__ */ t.jsx(
971
971
  ht,
972
972
  {
973
973
  otherTitle: "Other",
974
- items: c
974
+ items: l
975
975
  }
976
976
  )
977
977
  ] });
978
- }, Pe = "_subtitle_jql1y_1", we = "_products_jql1y_10", Te = "_product_jql1y_10", Me = "_button_jql1y_11", Be = "_buttons_jql1y_11", $e = "_addButton_jql1y_150", Oe = "_deleteButton_jql1y_165", st = {
979
- subtitle: Pe,
980
- products: we,
978
+ }, we = "_subtitle_jql1y_1", Pe = "_products_jql1y_10", Te = "_product_jql1y_10", Me = "_button_jql1y_11", Be = "_buttons_jql1y_11", $e = "_addButton_jql1y_150", Oe = "_deleteButton_jql1y_165", st = {
979
+ subtitle: we,
980
+ products: Pe,
981
981
  product: Te,
982
982
  button: Me,
983
983
  buttons: Be,
984
984
  addButton: $e,
985
985
  deleteButton: Oe
986
- }, Ae = (u) => {
987
- const { buttons: n, setButtons: i, deletable: s = !0, addable: e = !0, editableLink: c = !0 } = u, { pages: a } = yt(), [m, _] = x.useState(null), [b, M] = x.useState({
986
+ }, qe = (u) => {
987
+ const { buttons: i, setButtons: a, deletable: s = !0, addable: e = !0, editableLink: l = !0 } = u, { pages: r } = yt(), [g, _] = f.useState(null), [j, T] = f.useState({
988
988
  top: 0,
989
989
  left: 0
990
- }), [y, g] = x.useState(null), l = x.useRef(null);
991
- x.useEffect(() => {
992
- if (m) {
993
- const h = [...n].map((j) => j.id === m.id ? m : j);
994
- i(h);
990
+ }), [x, p] = f.useState(null), v = f.useRef(null);
991
+ f.useEffect(() => {
992
+ if (g) {
993
+ const o = [...i].map((C) => C.id === g.id ? g : C);
994
+ a(o);
995
995
  }
996
- }, [m]), x.useEffect(() => {
997
- if (l.current && y) {
998
- const h = l.current.getBoundingClientRect().height, j = window.innerHeight;
999
- let v = y.top;
1000
- v + h > j + window.scrollY - 200 && (v = j + window.scrollY - h - 200), v < 0 && (v = 10), M({
1001
- top: v,
1002
- left: y.left
996
+ }, [g]), f.useEffect(() => {
997
+ if (v.current && x) {
998
+ const o = v.current.getBoundingClientRect().height, C = window.innerHeight;
999
+ let y = x.top;
1000
+ y + o > C + window.scrollY - 200 && (y = C + window.scrollY - o - 200), y < 0 && (y = 10), T({
1001
+ top: y,
1002
+ left: x.left
1003
1003
  });
1004
1004
  }
1005
- }, [l.current, y]);
1006
- const r = (h, j) => {
1007
- h.stopPropagation();
1008
- const v = h.target.getBoundingClientRect();
1009
- g({
1010
- top: v.top + window.scrollY - 70,
1011
- left: v.left - (e ? 30 : 65)
1012
- }), _(j);
1013
- }, o = (h, j) => {
1014
- const v = [...n], T = {
1015
- ...h,
1005
+ }, [v.current, x]);
1006
+ const c = (o, C) => {
1007
+ o.stopPropagation();
1008
+ const y = o.target.getBoundingClientRect();
1009
+ p({
1010
+ top: y.top + window.scrollY - 70,
1011
+ left: y.left - (e ? 30 : 65)
1012
+ }), _(C);
1013
+ }, n = (o, C) => {
1014
+ const y = [...i], M = {
1015
+ ...o,
1016
1016
  id: Math.random().toString(36).substr(2, 9)
1017
1017
  // Генерируем новый уникальный ID
1018
1018
  };
1019
- v.splice(j + 1, 0, T), i(v);
1019
+ y.splice(C + 1, 0, M), a(y);
1020
1020
  };
1021
1021
  return /* @__PURE__ */ t.jsxs("div", { className: st.products, children: [
1022
1022
  /* @__PURE__ */ t.jsx("h5", { className: st.subtitle, children: "Button Type" }),
1023
- n.map((h, j) => /* @__PURE__ */ t.jsxs(
1023
+ i.map((o, C) => /* @__PURE__ */ t.jsxs(
1024
1024
  "div",
1025
1025
  {
1026
1026
  className: st.product,
@@ -1028,50 +1028,50 @@ const Rn = (u) => {
1028
1028
  /* @__PURE__ */ t.jsx(
1029
1029
  it,
1030
1030
  {
1031
- onChange: (v) => {
1032
- const R = [...n].map((L) => L.id === h.id ? {
1033
- ...h,
1034
- type: v
1035
- } : L);
1036
- i(R);
1031
+ onChange: (y) => {
1032
+ const L = [...i].map((D) => D.id === o.id ? {
1033
+ ...o,
1034
+ type: y
1035
+ } : D);
1036
+ a(L);
1037
1037
  },
1038
- value: h.type,
1038
+ value: o.type,
1039
1039
  options: ["Primary", "Secondary", "Tertiary"]
1040
1040
  }
1041
1041
  ),
1042
1042
  /* @__PURE__ */ t.jsxs("div", { className: st.buttons, children: [
1043
1043
  /* @__PURE__ */ t.jsx("div", { className: st.deleteButton, children: /* @__PURE__ */ t.jsx(
1044
- I,
1044
+ b,
1045
1045
  {
1046
1046
  name: "Copy",
1047
1047
  hoverable: !0,
1048
1048
  width: 20,
1049
1049
  height: 20,
1050
1050
  onClick: () => {
1051
- o(h, j);
1051
+ n(o, C);
1052
1052
  }
1053
1053
  }
1054
1054
  ) }),
1055
1055
  /* @__PURE__ */ t.jsx("div", { className: st.deleteButton, children: /* @__PURE__ */ t.jsx(
1056
- I,
1056
+ b,
1057
1057
  {
1058
1058
  name: "Sliders",
1059
1059
  hoverable: !0,
1060
1060
  width: 20,
1061
1061
  height: 20,
1062
- onClick: (v) => {
1063
- r(v, h);
1062
+ onClick: (y) => {
1063
+ c(y, o);
1064
1064
  }
1065
1065
  }
1066
1066
  ) }),
1067
1067
  s && /* @__PURE__ */ t.jsx("div", { className: st.deleteButton, children: /* @__PURE__ */ t.jsx(
1068
- I,
1068
+ b,
1069
1069
  {
1070
1070
  name: "Trash",
1071
1071
  hoverable: !0,
1072
1072
  onClick: () => {
1073
- const v = n.filter((T) => T.id !== h.id);
1074
- i(v);
1073
+ const y = i.filter((M) => M.id !== o.id);
1074
+ a(y);
1075
1075
  },
1076
1076
  width: 20,
1077
1077
  height: 20,
@@ -1081,16 +1081,16 @@ const Rn = (u) => {
1081
1081
  ] })
1082
1082
  ]
1083
1083
  },
1084
- h.id
1084
+ o.id
1085
1085
  )),
1086
- m && /* @__PURE__ */ t.jsx(
1087
- qt,
1086
+ g && /* @__PURE__ */ t.jsx(
1087
+ Et,
1088
1088
  {
1089
- ref: l,
1090
- activeButton: m,
1089
+ ref: v,
1090
+ activeButton: g,
1091
1091
  setActiveButton: _,
1092
- popupPosition: b,
1093
- editableLink: c
1092
+ popupPosition: j,
1093
+ editableLink: l
1094
1094
  }
1095
1095
  ),
1096
1096
  e && /* @__PURE__ */ t.jsx(
@@ -1108,28 +1108,28 @@ const Rn = (u) => {
1108
1108
  className: st.button,
1109
1109
  size: "s",
1110
1110
  onClick: () => {
1111
- const h = [...n];
1112
- c ? h.push({
1111
+ const o = [...i];
1112
+ l ? o.push({
1113
1113
  type: "Primary",
1114
- id: J(),
1114
+ id: Q(),
1115
1115
  typesText: [],
1116
1116
  text: {
1117
1117
  "en-US": "Button Name"
1118
1118
  },
1119
1119
  destination: "Go to Page",
1120
- page: a ? Object.values(a)[0].path : "/",
1120
+ page: r ? Object.values(r)[0].path : "/",
1121
1121
  openInNewTab: !1
1122
- }) : h.push({
1122
+ }) : o.push({
1123
1123
  type: "Primary",
1124
- id: J(),
1124
+ id: Q(),
1125
1125
  typesText: [],
1126
1126
  text: {
1127
1127
  "en-US": "Create Ticket"
1128
1128
  },
1129
1129
  destination: "Go to Page",
1130
- page: a ? Object.values(a)[0].path : "/",
1130
+ page: r ? Object.values(r)[0].path : "/",
1131
1131
  openInNewTab: !1
1132
- }), i(h);
1132
+ }), a(o);
1133
1133
  },
1134
1134
  style: {
1135
1135
  width: "fit-content"
@@ -1137,7 +1137,7 @@ const Rn = (u) => {
1137
1137
  children: /* @__PURE__ */ t.jsxs("div", { className: st.addButton, children: [
1138
1138
  /* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
1139
1139
  /* @__PURE__ */ t.jsx(
1140
- I,
1140
+ b,
1141
1141
  {
1142
1142
  name: "Plus",
1143
1143
  width: 16,
@@ -1150,15 +1150,15 @@ const Rn = (u) => {
1150
1150
  }
1151
1151
  )
1152
1152
  ] });
1153
- }, Ln = (u) => {
1153
+ }, zn = (u) => {
1154
1154
  const {
1155
- isActiveButtons: n,
1156
- setIsActiveButtons: i,
1155
+ isActiveButtons: i,
1156
+ setIsActiveButtons: a,
1157
1157
  buttons: s,
1158
1158
  setButtons: e,
1159
- editableLink: c = !0,
1160
- addable: a = !0,
1161
- deletable: m = !0
1159
+ editableLink: l = !0,
1160
+ addable: r = !0,
1161
+ deletable: g = !0
1162
1162
  } = u;
1163
1163
  return /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsxs("div", { className: bt.buttonsBlock, children: [
1164
1164
  /* @__PURE__ */ t.jsxs("div", { className: bt.top, children: [
@@ -1166,107 +1166,107 @@ const Rn = (u) => {
1166
1166
  /* @__PURE__ */ t.jsx(
1167
1167
  lt,
1168
1168
  {
1169
- current: n,
1170
- onChange: (_) => i(_)
1169
+ current: i,
1170
+ onChange: (_) => a(_)
1171
1171
  }
1172
1172
  )
1173
1173
  ] }),
1174
- n && /* @__PURE__ */ t.jsx(
1175
- Ae,
1174
+ i && /* @__PURE__ */ t.jsx(
1175
+ qe,
1176
1176
  {
1177
1177
  buttons: s,
1178
1178
  setButtons: e,
1179
- editableLink: c,
1180
- addable: a,
1181
- deletable: m
1179
+ editableLink: l,
1180
+ addable: r,
1181
+ deletable: g
1182
1182
  }
1183
1183
  )
1184
1184
  ] }) });
1185
1185
  };
1186
- function Ee(u) {
1187
- const { product: n, children: i } = u, { attributes: s, listeners: e, setNodeRef: c, transform: a, transition: m, isDragging: _ } = jt({
1188
- id: String(n.listingId)
1189
- }), b = {
1190
- transform: vt.Transform.toString(a),
1191
- transition: m
1186
+ function Ae(u) {
1187
+ const { product: i, children: a } = u, { attributes: s, listeners: e, setNodeRef: l, transform: r, transition: g, isDragging: _ } = jt({
1188
+ id: String(i.listingId)
1189
+ }), j = {
1190
+ transform: vt.Transform.toString(r),
1191
+ transition: g
1192
1192
  };
1193
1193
  return /* @__PURE__ */ t.jsx(
1194
1194
  "div",
1195
1195
  {
1196
- ref: c,
1197
- style: b,
1196
+ ref: l,
1197
+ style: j,
1198
1198
  className: `${W.product} ${_ ? W.dragging : ""}`,
1199
1199
  ...s,
1200
1200
  ...e,
1201
- children: i
1201
+ children: a
1202
1202
  }
1203
1203
  );
1204
1204
  }
1205
- const Un = (u) => {
1205
+ const Dn = (u) => {
1206
1206
  const {
1207
- isActiveItems: n,
1208
- setIsActiveItems: i,
1207
+ isActiveItems: i,
1208
+ setIsActiveItems: a,
1209
1209
  items: s,
1210
1210
  setItems: e,
1211
- other: c,
1212
- title: a,
1213
- subtitle: m,
1211
+ other: l,
1212
+ title: r,
1213
+ subtitle: g,
1214
1214
  editable: _ = !0,
1215
- draggable: b = !1,
1216
- withImage: M = !1,
1217
- deletable: y = !0,
1218
- addable: g = !0,
1219
- itemsType: l,
1220
- itemsOptions: r,
1221
- limit: o,
1222
- aspectRatio: h,
1223
- setAspectRatio: j
1224
- } = u, [v, T] = x.useState(
1215
+ draggable: j = !1,
1216
+ withImage: T = !1,
1217
+ deletable: x = !0,
1218
+ addable: p = !0,
1219
+ itemsType: v,
1220
+ itemsOptions: c,
1221
+ limit: n,
1222
+ aspectRatio: o,
1223
+ setAspectRatio: C
1224
+ } = u, [y, M] = f.useState(
1225
1225
  null
1226
- ), [R, L] = x.useState({
1226
+ ), [L, D] = f.useState({
1227
1227
  top: 0,
1228
1228
  left: 0
1229
- }), [K, f] = x.useState(!1), p = pt(
1229
+ }), [J, m] = f.useState(!1), h = pt(
1230
1230
  mt(gt, {
1231
1231
  activationConstraint: {
1232
1232
  distance: 5
1233
1233
  }
1234
1234
  })
1235
1235
  );
1236
- x.useEffect(() => {
1237
- const N = () => {
1238
- T(null), f(!1);
1236
+ f.useEffect(() => {
1237
+ const I = () => {
1238
+ M(null), m(!1);
1239
1239
  };
1240
- return document.body.addEventListener("click", N), T(null), f(!1), () => {
1241
- T(null), f(!1), document.body.removeEventListener("click", N);
1240
+ return document.body.addEventListener("click", I), M(null), m(!1), () => {
1241
+ M(null), m(!1), document.body.removeEventListener("click", I);
1242
1242
  };
1243
- }, []), x.useEffect(() => {
1244
- if (v) {
1245
- const N = [...s].map((E) => E.listingId === v.listingId ? v : E);
1246
- e(N);
1243
+ }, []), f.useEffect(() => {
1244
+ if (y) {
1245
+ const I = [...s].map((A) => A.listingId === y.listingId ? y : A);
1246
+ e(I);
1247
1247
  }
1248
- }, [v]);
1249
- const S = (N, E) => {
1250
- N.stopPropagation();
1251
- const z = N.target.getBoundingClientRect(), d = 100, $ = window.innerHeight;
1252
- let k = z.top + window.scrollY;
1253
- k + d > $ && (k = $ - d - 20), f(!0), L({
1248
+ }, [y]);
1249
+ const S = (I, A) => {
1250
+ I.stopPropagation();
1251
+ const U = I.target.getBoundingClientRect(), d = 100, $ = window.innerHeight;
1252
+ let k = U.top + window.scrollY;
1253
+ k + d > $ && (k = $ - d - 20), m(!0), D({
1254
1254
  top: k - 80,
1255
- left: z.left - 30
1256
- }), T(E);
1255
+ left: U.left - 30
1256
+ }), M(A);
1257
1257
  };
1258
- function w(N) {
1259
- if (M)
1260
- return N ? /* @__PURE__ */ t.jsx(
1258
+ function P(I) {
1259
+ if (T)
1260
+ return I ? /* @__PURE__ */ t.jsx(
1261
1261
  "img",
1262
1262
  {
1263
- src: `https://imagedelivery.net/${N}/w=1000`,
1263
+ src: `https://imagedelivery.net/${I}/w=1000`,
1264
1264
  alt: "image",
1265
1265
  width: 16,
1266
1266
  height: 16
1267
1267
  }
1268
1268
  ) : /* @__PURE__ */ t.jsx(
1269
- I,
1269
+ b,
1270
1270
  {
1271
1271
  name: "Image",
1272
1272
  width: 16,
@@ -1275,21 +1275,21 @@ const Un = (u) => {
1275
1275
  }
1276
1276
  );
1277
1277
  }
1278
- const O = (N) => {
1279
- const { active: E, over: z } = N;
1280
- if (z && E.id !== z.id) {
1281
- const d = s.findIndex((k) => String(k.listingId) === E.id), $ = s.findIndex((k) => String(k.listingId) === z.id);
1278
+ const O = (I) => {
1279
+ const { active: A, over: U } = I;
1280
+ if (U && A.id !== U.id) {
1281
+ const d = s.findIndex((k) => String(k.listingId) === A.id), $ = s.findIndex((k) => String(k.listingId) === U.id);
1282
1282
  if (d !== -1 && $ !== -1) {
1283
- const k = [...s], [q] = k.splice(d, 1);
1284
- k.splice($, 0, q), e(k);
1283
+ const k = [...s], [E] = k.splice(d, 1);
1284
+ k.splice($, 0, E), e(k);
1285
1285
  }
1286
1286
  }
1287
- }, C = (N) => {
1288
- const E = r.find((d) => N.listingId === d.id);
1289
- if (!E) return null;
1290
- const z = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
1291
- b && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
1292
- I,
1287
+ }, N = (I) => {
1288
+ const A = c.find((d) => I.listingId === d.id);
1289
+ if (!A) return null;
1290
+ const U = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
1291
+ j && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
1292
+ b,
1293
1293
  {
1294
1294
  name: "DotsSixVertical",
1295
1295
  hoverable: !0,
@@ -1297,111 +1297,111 @@ const Un = (u) => {
1297
1297
  height: 20
1298
1298
  }
1299
1299
  ) }),
1300
- l === "select" && /* @__PURE__ */ t.jsx(
1300
+ v === "select" && /* @__PURE__ */ t.jsx(
1301
1301
  it,
1302
1302
  {
1303
1303
  onChange: (d) => {
1304
- const $ = [...s], k = r.find((U) => U.productData.name === d);
1304
+ const $ = [...s], k = c.find((R) => R.productData.name === d);
1305
1305
  if (!k) return;
1306
- const q = {
1306
+ const E = {
1307
1307
  listingId: k.id,
1308
1308
  image: k.productData.images.length > 0 ? k.productData.images[0].cfId : ""
1309
- }, et = $.map((U) => U.listingId === N.listingId ? q : U);
1310
- T(q), e([...et]);
1309
+ }, et = $.map((R) => R.listingId === I.listingId ? E : R);
1310
+ M(E), e([...et]);
1311
1311
  },
1312
- value: E.productData.name,
1312
+ value: A.productData.name,
1313
1313
  options: [
1314
- ...r.filter((d) => !s.find(($) => $.listingId === d.id)).map((d) => d.productData.name)
1314
+ ...c.filter((d) => !s.find(($) => $.listingId === d.id)).map((d) => d.productData.name)
1315
1315
  ],
1316
- leftAddonOptions: r.map((d) => {
1316
+ leftAddonOptions: c.map((d) => {
1317
1317
  var $;
1318
1318
  return {
1319
1319
  value: d.productData.name,
1320
- addon: w((($ = d.productData.images[0]) == null ? void 0 : $.cfId) || "")
1320
+ addon: P((($ = d.productData.images[0]) == null ? void 0 : $.cfId) || "")
1321
1321
  };
1322
1322
  })
1323
1323
  }
1324
1324
  ),
1325
1325
  /* @__PURE__ */ t.jsxs("div", { className: W.buttons, children: [
1326
1326
  _ && /* @__PURE__ */ t.jsx("div", { className: W.deleteButton, children: /* @__PURE__ */ t.jsx(
1327
- I,
1327
+ b,
1328
1328
  {
1329
1329
  name: "Sliders",
1330
1330
  hoverable: !0,
1331
1331
  width: 20,
1332
1332
  height: 20,
1333
- onClick: (d) => S(d, N)
1333
+ onClick: (d) => S(d, I)
1334
1334
  }
1335
1335
  ) }),
1336
- y && /* @__PURE__ */ t.jsx("div", { className: W.deleteButton, children: /* @__PURE__ */ t.jsx(
1337
- I,
1336
+ x && /* @__PURE__ */ t.jsx("div", { className: W.deleteButton, children: /* @__PURE__ */ t.jsx(
1337
+ b,
1338
1338
  {
1339
1339
  name: "Trash",
1340
1340
  hoverable: !0,
1341
1341
  width: 20,
1342
1342
  height: 20,
1343
1343
  fill: "#C12A2A",
1344
- onClick: () => e(s.filter((d) => d !== N))
1344
+ onClick: () => e(s.filter((d) => d !== I))
1345
1345
  }
1346
1346
  ) })
1347
1347
  ] })
1348
1348
  ] });
1349
- return b ? /* @__PURE__ */ t.jsx(
1350
- Ee,
1349
+ return j ? /* @__PURE__ */ t.jsx(
1350
+ Ae,
1351
1351
  {
1352
- product: N,
1353
- children: z
1352
+ product: I,
1353
+ children: U
1354
1354
  },
1355
- N.listingId
1355
+ I.listingId
1356
1356
  ) : /* @__PURE__ */ t.jsx(
1357
1357
  "div",
1358
1358
  {
1359
1359
  className: W.product,
1360
- children: z
1360
+ children: U
1361
1361
  },
1362
- N.listingId
1362
+ I.listingId
1363
1363
  );
1364
- }, A = x.useRef(null);
1364
+ }, q = f.useRef(null);
1365
1365
  return /* @__PURE__ */ t.jsxs("div", { className: W.productsBlock, children: [
1366
- (a || n !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: W.top, children: [
1367
- a && /* @__PURE__ */ t.jsx("h3", { className: W.title, children: a }),
1368
- n !== void 0 && /* @__PURE__ */ t.jsx(
1366
+ (r || i !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: W.top, children: [
1367
+ r && /* @__PURE__ */ t.jsx("h3", { className: W.title, children: r }),
1368
+ i !== void 0 && /* @__PURE__ */ t.jsx(
1369
1369
  lt,
1370
1370
  {
1371
- current: n,
1372
- onChange: (N) => i == null ? void 0 : i(N)
1371
+ current: i,
1372
+ onChange: (I) => a == null ? void 0 : a(I)
1373
1373
  }
1374
1374
  )
1375
1375
  ] }),
1376
- K && v && /* @__PURE__ */ t.jsx(
1377
- Dt,
1376
+ J && y && /* @__PURE__ */ t.jsx(
1377
+ zt,
1378
1378
  {
1379
- ref: A,
1380
- activeItem: v,
1381
- setActiveItem: T,
1382
- setIsOpenModal: f,
1383
- popupPosition: R,
1384
- itemsOptions: r
1379
+ ref: q,
1380
+ activeItem: y,
1381
+ setActiveItem: M,
1382
+ setIsOpenModal: m,
1383
+ popupPosition: L,
1384
+ itemsOptions: c
1385
1385
  }
1386
1386
  ),
1387
- n && /* @__PURE__ */ t.jsxs("div", { className: W.products, children: [
1388
- m && /* @__PURE__ */ t.jsx("h5", { className: W.subtitle, children: m }),
1389
- b ? /* @__PURE__ */ t.jsx(
1387
+ i && /* @__PURE__ */ t.jsxs("div", { className: W.products, children: [
1388
+ g && /* @__PURE__ */ t.jsx("h5", { className: W.subtitle, children: g }),
1389
+ j ? /* @__PURE__ */ t.jsx(
1390
1390
  ft,
1391
1391
  {
1392
- sensors: p,
1392
+ sensors: h,
1393
1393
  onDragEnd: O,
1394
1394
  children: /* @__PURE__ */ t.jsx(
1395
1395
  xt,
1396
1396
  {
1397
- items: s.map((N) => String(N.listingId)),
1397
+ items: s.map((I) => String(I.listingId)),
1398
1398
  strategy: _t,
1399
- children: s.map((N) => C(N))
1399
+ children: s.map((I) => N(I))
1400
1400
  }
1401
1401
  )
1402
1402
  }
1403
- ) : s.map((N) => C(N)),
1404
- g && /* @__PURE__ */ t.jsx(
1403
+ ) : s.map((I) => N(I)),
1404
+ p && /* @__PURE__ */ t.jsx(
1405
1405
  "div",
1406
1406
  {
1407
1407
  style: {
@@ -1416,25 +1416,25 @@ const Un = (u) => {
1416
1416
  className: W.button,
1417
1417
  size: "s",
1418
1418
  onClick: () => {
1419
- const N = [...s];
1420
- for (let E = 0; E < r.length; E++)
1421
- if (!s.find((z) => z.listingId === r[E].id)) {
1422
- N.push({
1423
- listingId: r[E].id,
1424
- image: r[E].productData.images.length > 0 ? r[E].productData.images[0].cfId : ""
1419
+ const I = [...s];
1420
+ for (let A = 0; A < c.length; A++)
1421
+ if (!s.find((U) => U.listingId === c[A].id)) {
1422
+ I.push({
1423
+ listingId: c[A].id,
1424
+ image: c[A].productData.images.length > 0 ? c[A].productData.images[0].cfId : ""
1425
1425
  });
1426
1426
  break;
1427
1427
  }
1428
- e(N);
1428
+ e(I);
1429
1429
  },
1430
- disabled: s.length === (o || r.length),
1430
+ disabled: s.length === (n || c.length),
1431
1431
  style: {
1432
1432
  width: "fit-content"
1433
1433
  },
1434
1434
  children: /* @__PURE__ */ t.jsxs("div", { className: W.addButton, children: [
1435
1435
  /* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
1436
1436
  /* @__PURE__ */ t.jsx(
1437
- I,
1437
+ b,
1438
1438
  {
1439
1439
  name: "Plus",
1440
1440
  width: 16,
@@ -1447,33 +1447,33 @@ const Un = (u) => {
1447
1447
  }
1448
1448
  )
1449
1449
  ] }),
1450
- h && j && /* @__PURE__ */ t.jsx(
1450
+ o && C && /* @__PURE__ */ t.jsx(
1451
1451
  it,
1452
1452
  {
1453
- value: h,
1454
- options: Object.keys(Tt),
1455
- onChange: (N) => j(N),
1453
+ value: o,
1454
+ options: Object.keys(Pt),
1455
+ onChange: (I) => C(I),
1456
1456
  leftAddonOptions: wt
1457
1457
  }
1458
1458
  ),
1459
- n && c !== void 0 && /* @__PURE__ */ t.jsx(
1459
+ i && l !== void 0 && /* @__PURE__ */ t.jsx(
1460
1460
  ht,
1461
1461
  {
1462
1462
  otherTitle: "Other",
1463
- items: c
1463
+ items: l
1464
1464
  }
1465
1465
  )
1466
1466
  ] });
1467
- }, qe = "_options_167h8_1", De = "_price_167h8_18", Re = "_oldPrice_167h8_25", Le = "_newPrice_167h8_33", Ue = "_animate_167h8_40", ze = "_meta_167h8_58", Ve = "_info_167h8_64", He = "_infoRight_167h8_73", Fe = "_buttons_167h8_80", Ye = "_variants_167h8_87", Ge = "_variant_167h8_87", We = "_stock_167h8_105", Xe = "_variantInfo_167h8_112", Qe = "_quantity_167h8_119", Je = "_button_167h8_80", Ke = "_activeVariant_167h8_165", Ze = "_chargeTypes_167h8_169", ts = "_charge_167h8_169", es = "_chargeActive_167h8_194", ss = "_title_167h8_202", B = {
1468
- options: qe,
1469
- price: De,
1470
- oldPrice: Re,
1471
- newPrice: Le,
1472
- animate: Ue,
1473
- meta: ze,
1474
- info: Ve,
1475
- infoRight: He,
1476
- buttons: Fe,
1467
+ }, Ee = "_options_167h8_1", ze = "_price_167h8_18", De = "_oldPrice_167h8_25", Re = "_newPrice_167h8_33", Le = "_animate_167h8_40", Ue = "_meta_167h8_58", He = "_info_167h8_64", Fe = "_infoRight_167h8_73", Ve = "_buttons_167h8_80", Ye = "_variants_167h8_87", Ge = "_variant_167h8_87", We = "_stock_167h8_105", Xe = "_variantInfo_167h8_112", Qe = "_quantity_167h8_119", Je = "_button_167h8_80", Ke = "_activeVariant_167h8_165", Ze = "_chargeTypes_167h8_169", ts = "_charge_167h8_169", es = "_chargeActive_167h8_194", ss = "_title_167h8_202", B = {
1468
+ options: Ee,
1469
+ price: ze,
1470
+ oldPrice: De,
1471
+ newPrice: Re,
1472
+ animate: Le,
1473
+ meta: Ue,
1474
+ info: He,
1475
+ infoRight: Fe,
1476
+ buttons: Ve,
1477
1477
  variants: Ye,
1478
1478
  variant: Ge,
1479
1479
  stock: We,
@@ -1486,151 +1486,151 @@ const Un = (u) => {
1486
1486
  chargeActive: es,
1487
1487
  title: ss
1488
1488
  };
1489
- var kt = /* @__PURE__ */ ((u) => (u.ONE_TIME = "One-Time", u.RECURRING = "Subscribe & Save", u))(kt || {});
1489
+ var $t = /* @__PURE__ */ ((u) => (u.ONE_TIME = "One-Time", u.RECURRING = "Subscribe & Save", u))($t || {});
1490
1490
  const ns = (u) => {
1491
- var L, K;
1492
- const { product: n, setIsOpen: i } = u, { variants: s } = n, [e, c] = x.useState(s[0]), [a, m] = x.useState(
1491
+ var D, J;
1492
+ const { product: i, setIsOpen: a } = u, { variants: s } = i, [e, l] = f.useState(s[0]), [r, g] = f.useState(
1493
1493
  e.chargeTypes ? e.chargeTypes[0] : "ONE_TIME"
1494
- ), { notifications: _, setNotifications: b } = Ct(), M = St(), [y, g] = x.useState(1), { cart: l, reset: r, addProductToCart: o } = ot(), [h, j] = x.useState(!1);
1495
- x.useEffect(() => {
1496
- j(!0);
1497
- const f = setTimeout(() => j(!1), 600);
1498
- return () => clearTimeout(f);
1499
- }, [y]);
1500
- async function v() {
1494
+ ), { notifications: _, setNotifications: j } = Ct(), T = St(), [x, p] = f.useState(1), { cart: v, reset: c, addProductToCart: n } = ot(), [o, C] = f.useState(!1);
1495
+ f.useEffect(() => {
1496
+ C(!0);
1497
+ const m = setTimeout(() => C(!1), 600);
1498
+ return () => clearTimeout(m);
1499
+ }, [x]);
1500
+ async function y() {
1501
1501
  try {
1502
- o({
1503
- productId: n.id,
1502
+ n({
1503
+ productId: i.id,
1504
1504
  productVariantId: e.id,
1505
- chargeType: a,
1506
- quantity: y
1507
- }), b([
1505
+ chargeType: r,
1506
+ quantity: x
1507
+ }), j([
1508
1508
  ..._,
1509
1509
  {
1510
- id: J(),
1510
+ id: Q(),
1511
1511
  message: "Product added to cart",
1512
1512
  status: "success"
1513
1513
  }
1514
1514
  ]);
1515
- } catch (f) {
1516
- b([
1515
+ } catch (m) {
1516
+ j([
1517
1517
  ..._,
1518
1518
  {
1519
- id: J(),
1520
- message: `Product failed to add to cart: ${f}`,
1519
+ id: Q(),
1520
+ message: `Product failed to add to cart: ${m}`,
1521
1521
  status: "error"
1522
1522
  }
1523
1523
  ]);
1524
1524
  }
1525
- i == null || i(!1);
1525
+ a == null || a(!1);
1526
1526
  }
1527
- function T() {
1528
- r(), v(), M("/checkout");
1527
+ function M() {
1528
+ c(), y(), T("/checkout");
1529
1529
  }
1530
- function R(f) {
1531
- if (f >= 864e5) {
1532
- const C = Math.floor(f / 864e5);
1533
- return `${C} ${C === 1 ? "day" : "days"}`;
1534
- } else if (f >= 36e5) {
1535
- const C = Math.floor(f / 36e5);
1536
- return `${C} ${C === 1 ? "hour" : "hours"}`;
1537
- } else if (f >= 6e4) {
1538
- const C = Math.floor(f / 6e4);
1539
- return `${C} ${C === 1 ? "minute" : "minutes"}`;
1530
+ function L(m) {
1531
+ if (m >= 864e5) {
1532
+ const N = Math.floor(m / 864e5);
1533
+ return `${N} ${N === 1 ? "day" : "days"}`;
1534
+ } else if (m >= 36e5) {
1535
+ const N = Math.floor(m / 36e5);
1536
+ return `${N} ${N === 1 ? "hour" : "hours"}`;
1537
+ } else if (m >= 6e4) {
1538
+ const N = Math.floor(m / 6e4);
1539
+ return `${N} ${N === 1 ? "minute" : "minutes"}`;
1540
1540
  } else {
1541
- const C = Math.floor(f / 1e3);
1542
- return `${C} ${C === 1 ? "second" : "seconds"}`;
1541
+ const N = Math.floor(m / 1e3);
1542
+ return `${N} ${N === 1 ? "second" : "seconds"}`;
1543
1543
  }
1544
1544
  }
1545
- return x.useEffect(() => {
1546
- e.quantity && e.quantity.available === 0 ? g(0) : g(1);
1547
- }, [e.quantity.available]), x.useEffect(() => {
1548
- e.chargeTypes && m(
1549
- e.chargeTypes.includes(a) ? a : e.chargeTypes[0]
1545
+ return f.useEffect(() => {
1546
+ e.quantity && e.quantity.available === 0 ? p(0) : p(1);
1547
+ }, [e.quantity.available]), f.useEffect(() => {
1548
+ e.chargeTypes && g(
1549
+ e.chargeTypes.includes(r) ? r : e.chargeTypes[0]
1550
1550
  );
1551
1551
  }, [e.chargeTypes]), /* @__PURE__ */ t.jsxs("div", { className: B.options, children: [
1552
- e.chargeTypes && e.chargeTypes.length > 1 && /* @__PURE__ */ t.jsx("div", { className: B.chargeTypes, children: e.chargeTypes.map((f) => /* @__PURE__ */ t.jsx(
1552
+ e.chargeTypes && e.chargeTypes.length > 1 && /* @__PURE__ */ t.jsx("div", { className: B.chargeTypes, children: e.chargeTypes.map((m) => /* @__PURE__ */ t.jsx(
1553
1553
  "div",
1554
1554
  {
1555
- className: V(B.charge, {
1556
- [B.chargeActive]: a === f
1555
+ className: H(B.charge, {
1556
+ [B.chargeActive]: r === m
1557
1557
  }),
1558
- onClick: () => m(f),
1559
- children: kt[f]
1558
+ onClick: () => g(m),
1559
+ children: $t[m]
1560
1560
  },
1561
- f
1561
+ m
1562
1562
  )) }),
1563
- /* @__PURE__ */ t.jsx("div", { className: B.variants, children: s.filter((f) => {
1564
- var p;
1565
- return (p = f.chargeTypes) == null ? void 0 : p.includes(a);
1566
- }).map((f) => {
1567
- var p, S;
1563
+ /* @__PURE__ */ t.jsx("div", { className: B.variants, children: s.filter((m) => {
1564
+ var h;
1565
+ return (h = m.chargeTypes) == null ? void 0 : h.includes(r);
1566
+ }).map((m) => {
1567
+ var h, S;
1568
1568
  return /* @__PURE__ */ t.jsxs(
1569
1569
  "div",
1570
1570
  {
1571
- className: V(B.variant, {
1572
- [B.activeVariant]: e.id === f.id
1571
+ className: H(B.variant, {
1572
+ [B.activeVariant]: e.id === m.id
1573
1573
  }),
1574
- onClick: () => c(f),
1574
+ onClick: () => l(m),
1575
1575
  children: [
1576
1576
  /* @__PURE__ */ t.jsxs("div", { className: B.variantInfo, children: [
1577
- /* @__PURE__ */ t.jsx("span", { className: B.title, children: at(f.name) }),
1577
+ /* @__PURE__ */ t.jsx("span", { className: B.title, children: at(m.name) }),
1578
1578
  /* @__PURE__ */ t.jsxs("span", { children: [
1579
- tt({
1580
- amount: a === "ONE_TIME" ? f.price.amount : f.subscriptionSettings ? f.subscriptionSettings.price.amount : 0,
1581
- currency: a === "ONE_TIME" ? f.price.currency : f.subscriptionSettings ? f.subscriptionSettings.price.currency : "USD"
1579
+ Z({
1580
+ amount: r === "ONE_TIME" ? m.price.amount : m.subscriptionSettings ? m.subscriptionSettings.price.amount : 0,
1581
+ currency: r === "ONE_TIME" ? m.price.currency : m.subscriptionSettings ? m.subscriptionSettings.price.currency : "USD"
1582
1582
  }),
1583
1583
  " ",
1584
- a === "RECURRING" && f.subscriptionSettings && ` / ${Rt(f.subscriptionSettings.recurringIntervalDays || 0)}`
1584
+ r === "RECURRING" && m.subscriptionSettings && ` / ${Dt(m.subscriptionSettings.recurringIntervalDays || 0)}`
1585
1585
  ] })
1586
1586
  ] }),
1587
- /* @__PURE__ */ t.jsx("div", { children: a === "ONE_TIME" && /* @__PURE__ */ t.jsxs("span", { className: B.stock, children: [
1588
- (p = f.quantity.restrictions) != null && p.max || f.quantity.available !== void 0 ? ((S = f.quantity.restrictions) == null ? void 0 : S.max) || f.quantity.available : "∞",
1587
+ /* @__PURE__ */ t.jsx("div", { children: r === "ONE_TIME" && /* @__PURE__ */ t.jsxs("span", { className: B.stock, children: [
1588
+ (h = m.quantity.restrictions) != null && h.max || m.quantity.available !== void 0 ? ((S = m.quantity.restrictions) == null ? void 0 : S.max) || m.quantity.available : "∞",
1589
1589
  " ",
1590
1590
  "in stock"
1591
1591
  ] }) })
1592
1592
  ]
1593
1593
  },
1594
- f.id
1594
+ m.id
1595
1595
  );
1596
1596
  }) }),
1597
- a === "ONE_TIME" && /* @__PURE__ */ t.jsxs("div", { className: B.quantity, children: [
1597
+ r === "ONE_TIME" && /* @__PURE__ */ t.jsxs("div", { className: B.quantity, children: [
1598
1598
  /* @__PURE__ */ t.jsx(
1599
- D,
1599
+ z,
1600
1600
  {
1601
1601
  type: "Secondary",
1602
1602
  onClick: () => {
1603
- y > 1 ? g((f) => f - 1) : g(1);
1603
+ x > 1 ? p((m) => m - 1) : p(1);
1604
1604
  },
1605
1605
  className: B.button,
1606
- disabled: e.quantity.available && e.quantity.restrictions && y <= e.quantity.restrictions.min || e.quantity.available === 0,
1607
- children: /* @__PURE__ */ t.jsx(I, { name: "Minus" })
1606
+ disabled: e.quantity.available && e.quantity.restrictions && x <= e.quantity.restrictions.min || e.quantity.available === 0,
1607
+ children: /* @__PURE__ */ t.jsx(b, { name: "Minus" })
1608
1608
  }
1609
1609
  ),
1610
1610
  /* @__PURE__ */ t.jsx(
1611
- Lt,
1611
+ Rt,
1612
1612
  {
1613
1613
  type: "number",
1614
- value: String(y),
1615
- onChange: (f) => {
1616
- e.quantity.available && Number(f) > e.quantity.available ? g(e.quantity.available) : g(Number(f));
1614
+ value: String(x),
1615
+ onChange: (m) => {
1616
+ e.quantity.available && Number(m) > e.quantity.available ? p(e.quantity.available) : p(Number(m));
1617
1617
  },
1618
- max: ((L = e.quantity.restrictions) == null ? void 0 : L.max) || e.quantity.available || Number.POSITIVE_INFINITY,
1619
- min: ((K = e.quantity.restrictions) == null ? void 0 : K.min) || 0,
1618
+ max: ((D = e.quantity.restrictions) == null ? void 0 : D.max) || e.quantity.available || Number.POSITIVE_INFINITY,
1619
+ min: ((J = e.quantity.restrictions) == null ? void 0 : J.min) || 0,
1620
1620
  centered: !0,
1621
- disabled: e.quantity && e.quantity.available === 0 || Object.keys(e.quantity.restrictions || {}).length !== 0 && y >= e.quantity.restrictions.max
1621
+ disabled: e.quantity && e.quantity.available === 0 || Object.keys(e.quantity.restrictions || {}).length !== 0 && x >= e.quantity.restrictions.max
1622
1622
  }
1623
1623
  ),
1624
1624
  /* @__PURE__ */ t.jsx(
1625
- D,
1625
+ z,
1626
1626
  {
1627
1627
  type: "Secondary",
1628
1628
  onClick: () => {
1629
- g((f) => f + 1);
1629
+ p((m) => m + 1);
1630
1630
  },
1631
1631
  className: B.button,
1632
- disabled: !!(e.quantity.available && e.quantity.restrictions && y >= e.quantity.restrictions.max || e.quantity.available === 0 || e.quantity.available && y >= e.quantity.available),
1633
- children: /* @__PURE__ */ t.jsx(I, { name: "Plus" })
1632
+ disabled: !!(e.quantity.available && e.quantity.restrictions && x >= e.quantity.restrictions.max || e.quantity.available === 0 || e.quantity.available && x >= e.quantity.available),
1633
+ children: /* @__PURE__ */ t.jsx(b, { name: "Plus" })
1634
1634
  }
1635
1635
  )
1636
1636
  ] }),
@@ -1639,7 +1639,7 @@ const ns = (u) => {
1639
1639
  /* @__PURE__ */ t.jsx("span", { children: "Delivery" }),
1640
1640
  /* @__PURE__ */ t.jsxs("div", { className: B.infoRight, children: [
1641
1641
  /* @__PURE__ */ t.jsx(
1642
- I,
1642
+ b,
1643
1643
  {
1644
1644
  name: "Lightning",
1645
1645
  fill: "var(--text-action)",
@@ -1647,62 +1647,62 @@ const ns = (u) => {
1647
1647
  height: 20
1648
1648
  }
1649
1649
  ),
1650
- /* @__PURE__ */ t.jsx("span", { children: !e.deliveryTime || e.deliveryTime === 0 ? "Instant" : R(e.deliveryTime) })
1650
+ /* @__PURE__ */ t.jsx("span", { children: !e.deliveryTime || e.deliveryTime === 0 ? "Instant" : L(e.deliveryTime) })
1651
1651
  ] })
1652
1652
  ] }),
1653
1653
  /* @__PURE__ */ t.jsxs("div", { className: B.info, children: [
1654
1654
  /* @__PURE__ */ t.jsx("span", { children: "Price" }),
1655
- /* @__PURE__ */ t.jsx("div", { className: B.infoRight, children: a === "ONE_TIME" ? e.compareAtPrice && (e.compareAtPrice.amount || 0) - (e.price.amount || 0) > 0 ? /* @__PURE__ */ t.jsxs("div", { className: B.price, children: [
1656
- /* @__PURE__ */ t.jsx("span", { className: V(B.newPrice, { [B.animate]: h }), children: tt({
1657
- amount: e.price.amount * y,
1655
+ /* @__PURE__ */ t.jsx("div", { className: B.infoRight, children: r === "ONE_TIME" ? e.compareAtPrice && (e.compareAtPrice.amount || 0) - (e.price.amount || 0) > 0 ? /* @__PURE__ */ t.jsxs("div", { className: B.price, children: [
1656
+ /* @__PURE__ */ t.jsx("span", { className: H(B.newPrice, { [B.animate]: o }), children: Z({
1657
+ amount: e.price.amount * x,
1658
1658
  currency: e.price.currency
1659
1659
  }) }),
1660
- /* @__PURE__ */ t.jsx("span", { className: B.oldPrice, children: tt({
1661
- amount: e.compareAtPrice.amount * y,
1660
+ /* @__PURE__ */ t.jsx("span", { className: B.oldPrice, children: Z({
1661
+ amount: e.compareAtPrice.amount * x,
1662
1662
  currency: e.compareAtPrice.currency
1663
1663
  }) })
1664
- ] }) : /* @__PURE__ */ t.jsx("span", { className: V(B.newPrice, { [B.animate]: h }), children: tt({
1665
- amount: e.price.amount * y,
1664
+ ] }) : /* @__PURE__ */ t.jsx("span", { className: H(B.newPrice, { [B.animate]: o }), children: Z({
1665
+ amount: e.price.amount * x,
1666
1666
  currency: e.price.currency
1667
1667
  }) }) : e.subscriptionSettings && e.subscriptionSettings.compareAtPrice && (e.subscriptionSettings.compareAtPrice.amount || 0) - (e.subscriptionSettings.price.amount || 0) > 0 ? /* @__PURE__ */ t.jsxs("div", { className: B.price, children: [
1668
- /* @__PURE__ */ t.jsx("span", { className: V(B.newPrice, { [B.animate]: h }), children: tt({
1669
- amount: e.subscriptionSettings.price.amount * y,
1668
+ /* @__PURE__ */ t.jsx("span", { className: H(B.newPrice, { [B.animate]: o }), children: Z({
1669
+ amount: e.subscriptionSettings.price.amount * x,
1670
1670
  currency: e.subscriptionSettings.price.currency
1671
1671
  }) }),
1672
- /* @__PURE__ */ t.jsx("span", { className: B.oldPrice, children: tt({
1673
- amount: e.subscriptionSettings.compareAtPrice.amount * y,
1672
+ /* @__PURE__ */ t.jsx("span", { className: B.oldPrice, children: Z({
1673
+ amount: e.subscriptionSettings.compareAtPrice.amount * x,
1674
1674
  currency: e.subscriptionSettings.compareAtPrice.currency
1675
1675
  }) })
1676
- ] }) : e.subscriptionSettings && /* @__PURE__ */ t.jsx("span", { className: V(B.newPrice, { [B.animate]: h }), children: tt({
1677
- amount: e.subscriptionSettings.price.amount * y,
1676
+ ] }) : e.subscriptionSettings && /* @__PURE__ */ t.jsx("span", { className: H(B.newPrice, { [B.animate]: o }), children: Z({
1677
+ amount: e.subscriptionSettings.price.amount * x,
1678
1678
  currency: e.subscriptionSettings.price.currency
1679
1679
  }) }) })
1680
1680
  ] })
1681
1681
  ] }),
1682
1682
  /* @__PURE__ */ t.jsxs("div", { className: B.buttons, children: [
1683
1683
  /* @__PURE__ */ t.jsx(
1684
- D,
1684
+ z,
1685
1685
  {
1686
1686
  type: "Primary",
1687
- onClick: () => T(),
1687
+ onClick: () => M(),
1688
1688
  disabled: e.quantity && e.quantity.available === 0,
1689
- children: a === "ONE_TIME" ? "Buy Now" : "Subscribe Now"
1689
+ children: r === "ONE_TIME" ? "Buy Now" : "Subscribe Now"
1690
1690
  }
1691
1691
  ),
1692
- a === "ONE_TIME" && /* @__PURE__ */ t.jsx(
1693
- D,
1692
+ r === "ONE_TIME" && /* @__PURE__ */ t.jsx(
1693
+ z,
1694
1694
  {
1695
1695
  type: "Secondary",
1696
- onClick: () => v(),
1696
+ onClick: () => y(),
1697
1697
  disabled: e.quantity && e.quantity.available === 0,
1698
- children: l.parts.some(
1699
- (f) => f.productId === n.id && f.productVariantId === e.id
1698
+ children: v.parts.some(
1699
+ (m) => m.productId === i.id && m.productVariantId === e.id
1700
1700
  ) ? "Add More" : "Add to Cart"
1701
1701
  }
1702
1702
  )
1703
1703
  ] })
1704
1704
  ] });
1705
- }, is = "_buttons_1p8jm_23", as = "_modal_1p8jm_32", os = "_closing_1p8jm_64", cs = "_info_1p8jm_113", rs = "_top_1p8jm_120", ls = "_title_1p8jm_131", ds = "_clear_1p8jm_138", us = "_activeClear_1p8jm_145", hs = "_count_1p8jm_149", ps = "_cart_1p8jm_164", ms = "_empty_1p8jm_172", gs = "_product_1p8jm_198", fs = "_products_1p8jm_207", xs = "_image_1p8jm_215", _s = "_productInfo_1p8jm_231", js = "_content_1p8jm_238", vs = "_name_1p8jm_244", ys = "_price_1p8jm_250", bs = "_productButtons_1p8jm_256", Is = "_productButton_1p8jm_256", Ns = "_productCount_1p8jm_273", Cs = "_bottom_1p8jm_290", Ss = "_subtotal_1p8jm_298", ks = "_block_1p8jm_306", Ps = "_shoppingCount_1p8jm_313", ws = "_total_1p8jm_333", Ts = "_link_1p8jm_339", Ms = "_userInfo_1p8jm_346", Bs = "_pagesMobileModal_1p8jm_358", $s = "_pagesMobileModalContent_1p8jm_372", Os = "_pagesMobileModalHeader_1p8jm_378", As = "_pagesMobileModalFooter_1p8jm_388", Es = "_pageLink_1p8jm_395", qs = "_rightButtons_1p8jm_404", P = {
1705
+ }, is = "_buttons_3z0t7_23", as = "_modal_3z0t7_32", os = "_closing_3z0t7_65", cs = "_info_3z0t7_114", rs = "_top_3z0t7_121", ls = "_title_3z0t7_132", ds = "_clear_3z0t7_139", us = "_activeClear_3z0t7_146", hs = "_count_3z0t7_150", ps = "_cart_3z0t7_165", ms = "_empty_3z0t7_173", gs = "_product_3z0t7_199", fs = "_products_3z0t7_208", xs = "_image_3z0t7_216", _s = "_productInfo_3z0t7_233", js = "_content_3z0t7_240", vs = "_name_3z0t7_246", ys = "_price_3z0t7_252", bs = "_productButtons_3z0t7_258", Is = "_productButton_3z0t7_258", Ns = "_productCount_3z0t7_275", Cs = "_bottom_3z0t7_292", Ss = "_subtotal_3z0t7_300", ks = "_block_3z0t7_308", ws = "_shoppingCount_3z0t7_315", Ps = "_total_3z0t7_335", Ts = "_link_3z0t7_341", Ms = "_userInfo_3z0t7_348", Bs = "_pagesMobileModal_3z0t7_360", $s = "_pagesMobileModalContent_3z0t7_374", Os = "_pagesMobileModalHeader_3z0t7_380", qs = "_pagesMobileModalFooter_3z0t7_390", As = "_pageLink_3z0t7_397", Es = "_rightButtons_3z0t7_406", w = {
1706
1706
  buttons: is,
1707
1707
  modal: as,
1708
1708
  closing: os,
@@ -1727,212 +1727,213 @@ const ns = (u) => {
1727
1727
  bottom: Cs,
1728
1728
  subtotal: Ss,
1729
1729
  block: ks,
1730
- shoppingCount: Ps,
1731
- total: ws,
1730
+ shoppingCount: ws,
1731
+ total: Ps,
1732
1732
  link: Ts,
1733
1733
  userInfo: Ms,
1734
1734
  pagesMobileModal: Bs,
1735
1735
  pagesMobileModalContent: $s,
1736
1736
  pagesMobileModalHeader: Os,
1737
- pagesMobileModalFooter: As,
1738
- pageLink: Es,
1739
- rightButtons: qs
1740
- }, zn = (u) => {
1741
- const { shopping: n, signUp: i, isShowUserInfo: s = !0 } = u;
1742
- return /* @__PURE__ */ t.jsxs("div", { className: P.buttons, children: [
1743
- n && /* @__PURE__ */ t.jsx(Ds, {}),
1744
- s && /* @__PURE__ */ t.jsx(Ot, { signUp: i })
1737
+ pagesMobileModalFooter: qs,
1738
+ pageLink: As,
1739
+ rightButtons: Es
1740
+ }, Rn = (u) => {
1741
+ const { shopping: i, signUp: a, isShowUserInfo: s = !0 } = u;
1742
+ return /* @__PURE__ */ t.jsxs("div", { className: w.buttons, children: [
1743
+ i && /* @__PURE__ */ t.jsx(zs, {}),
1744
+ s && /* @__PURE__ */ t.jsx(Ot, { signUp: a })
1745
1745
  ] });
1746
- }, Ds = () => {
1747
- const [u, n] = x.useState(!1), [i, s] = x.useState([]), [e, c] = x.useState(!1), { cart: a, products: m } = ot();
1748
- function _(r) {
1749
- if (r.variants.length > 0) {
1750
- for (let o = 0; o < a.parts.length; o++)
1751
- for (let h = 0; h < r.variants.length; h++)
1752
- if (r.variants[h] && a.parts[o].productVariantId === r.variants[h].id)
1753
- return a.parts[o].productVariantId;
1746
+ }, zs = () => {
1747
+ const [u, i] = f.useState(!1), [a, s] = f.useState([]), [e, l] = f.useState(!1), { cart: r, products: g } = ot();
1748
+ function _(c) {
1749
+ if (c.variants.length > 0) {
1750
+ for (let n = 0; n < r.parts.length; n++)
1751
+ for (let o = 0; o < c.variants.length; o++)
1752
+ if (c.variants[o] && r.parts[n].productVariantId === c.variants[o].id)
1753
+ return r.parts[n].productVariantId;
1754
1754
  }
1755
- return r.variants[0].id;
1755
+ return c.variants[0].id;
1756
1756
  }
1757
- function b(r) {
1758
- for (let o = 0; o < a.parts.length; o++)
1759
- for (let h = 0; h < r.variants.length; h++)
1760
- if (r.variants[h] && a.parts[o].productVariantId === r.variants[h].id)
1761
- return a.parts[o].quantity;
1757
+ function j(c) {
1758
+ for (let n = 0; n < r.parts.length; n++)
1759
+ for (let o = 0; o < c.variants.length; o++)
1760
+ if (c.variants[o] && r.parts[n].productVariantId === c.variants[o].id)
1761
+ return r.parts[n].quantity;
1762
1762
  }
1763
- const M = (r) => {
1764
- for (let o = 0; o < a.parts.length; o++)
1765
- for (let h = 0; h < r.variants.length; h++)
1766
- if (r.variants[h] && a.parts[o].productVariantId === r.variants[h].id)
1767
- return a.parts[o].chargeType;
1763
+ const T = (c) => {
1764
+ for (let n = 0; n < r.parts.length; n++)
1765
+ for (let o = 0; o < c.variants.length; o++)
1766
+ if (c.variants[o] && r.parts[n].productVariantId === c.variants[o].id)
1767
+ return r.parts[n].chargeType;
1768
1768
  return "ONE_TIME";
1769
1769
  };
1770
- x.useEffect(() => {
1770
+ f.useEffect(() => {
1771
1771
  (async () => {
1772
- const o = a.parts.map((v) => String(v.productId)), j = (m.filter((v) => o.includes(String(v.id))) || []).map((v) => ({
1773
- ...v,
1774
- activeVariantId: _(v),
1775
- quantity: b(v),
1776
- chargeType: M(v)
1772
+ const n = r.parts.map((y) => String(y.productId)), C = (g.filter((y) => n.includes(String(y.id))) || []).map((y) => ({
1773
+ ...y,
1774
+ activeVariantId: _(y),
1775
+ quantity: j(y),
1776
+ chargeType: T(y)
1777
1777
  }));
1778
- s(j);
1778
+ s(C);
1779
1779
  })();
1780
- }, [a.parts]);
1781
- function y(r) {
1782
- return !r || !(r != null && r.variants) ? !1 : r.chargeType === "RECURRING";
1780
+ }, [r.parts]);
1781
+ function x(c) {
1782
+ return !c || !(c != null && c.variants) ? !1 : c.chargeType === "RECURRING";
1783
1783
  }
1784
- const g = a.parts.length > 0 && i.length > 0 && !y(i[0]);
1785
- function l() {
1786
- c(!1), setTimeout(() => {
1787
- n(!1);
1784
+ const p = r.parts.length > 0 && a.length > 0 && !x(a[0]);
1785
+ function v() {
1786
+ l(!1), setTimeout(() => {
1787
+ i(!1);
1788
1788
  }, 300);
1789
1789
  }
1790
1790
  return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
1791
1791
  /* @__PURE__ */ t.jsxs(
1792
- D,
1792
+ z,
1793
1793
  {
1794
1794
  type: "Secondary",
1795
1795
  style: {
1796
1796
  padding: 10,
1797
1797
  position: "relative"
1798
1798
  },
1799
- onClick: (r) => {
1800
- r.stopPropagation(), window.location.pathname.includes("/admin/builder") || (n(!0), c(!0));
1799
+ onClick: (c) => {
1800
+ c.stopPropagation(), window.location.pathname.includes("/admin/builder") || (i(!0), l(!0));
1801
1801
  },
1802
1802
  children: [
1803
1803
  /* @__PURE__ */ t.jsx(
1804
- I,
1804
+ b,
1805
1805
  {
1806
1806
  name: "Handbag"
1807
1807
  }
1808
1808
  ),
1809
- g && /* @__PURE__ */ t.jsx("div", { className: P.shoppingCount, children: a.parts.length })
1809
+ p && /* @__PURE__ */ t.jsx("div", { className: w.shoppingCount, children: r.parts.length })
1810
1810
  ]
1811
1811
  }
1812
1812
  ),
1813
1813
  u && /* @__PURE__ */ t.jsx(
1814
1814
  ut,
1815
1815
  {
1816
- close: l,
1816
+ close: v,
1817
1817
  withAnimation: !1,
1818
1818
  children: /* @__PURE__ */ t.jsx(
1819
- Rs,
1819
+ Ds,
1820
1820
  {
1821
- activeProducts: i,
1822
- isCartNotEmpty: g,
1821
+ activeProducts: a,
1822
+ isCartNotEmpty: p,
1823
1823
  isOpen: e,
1824
- close: l
1824
+ close: v
1825
1825
  }
1826
1826
  )
1827
1827
  }
1828
1828
  )
1829
1829
  ] });
1830
- }, Rs = (u) => {
1831
- var l, r;
1832
- const { activeProducts: n, isCartNotEmpty: i, isOpen: s, close: e } = u, { cart: c, reset: a, getTotalAndDiscount: m, updateQuantityOfProduct: _ } = ot(), b = St();
1833
- function M(o, h) {
1834
- b(o, { replace: h });
1830
+ }, Ds = (u) => {
1831
+ var v, c;
1832
+ const { activeProducts: i, isCartNotEmpty: a, isOpen: s, close: e } = u, { cart: l, reset: r, getTotalAndDiscount: g, updateQuantityOfProduct: _ } = ot(), j = St();
1833
+ function T(n, o) {
1834
+ j(n, { replace: o });
1835
1835
  }
1836
- function y(o) {
1837
- o.quantity && _({
1838
- productId: o.id,
1839
- productVariantId: o.activeVariantId,
1840
- quantity: o.quantity + 1,
1841
- chargeType: o.chargeType
1836
+ function x(n) {
1837
+ n.quantity && _({
1838
+ productId: n.id,
1839
+ productVariantId: n.activeVariantId,
1840
+ quantity: n.quantity + 1,
1841
+ chargeType: n.chargeType
1842
1842
  });
1843
1843
  }
1844
- function g(o) {
1845
- o.quantity && _({
1846
- productId: o.id,
1847
- productVariantId: o.activeVariantId,
1848
- quantity: o.quantity - 1,
1849
- chargeType: o.chargeType
1844
+ function p(n) {
1845
+ n.quantity && _({
1846
+ productId: n.id,
1847
+ productVariantId: n.activeVariantId,
1848
+ quantity: n.quantity - 1,
1849
+ chargeType: n.chargeType
1850
1850
  });
1851
1851
  }
1852
1852
  return /* @__PURE__ */ t.jsxs(
1853
1853
  "div",
1854
1854
  {
1855
- className: V(P.modal, {
1856
- [P.closing]: !s
1855
+ className: H(w.modal, {
1856
+ [w.closing]: !s
1857
1857
  }),
1858
- onClick: (o) => o.stopPropagation(),
1858
+ onClick: (n) => n.stopPropagation(),
1859
1859
  children: [
1860
- /* @__PURE__ */ t.jsxs("div", { className: P.top, children: [
1861
- /* @__PURE__ */ t.jsxs("div", { className: P.info, children: [
1862
- /* @__PURE__ */ t.jsx("span", { className: P.title, children: "Cart" }),
1863
- i && /* @__PURE__ */ t.jsx("div", { className: P.count, children: c.parts.length })
1860
+ /* @__PURE__ */ t.jsxs("div", { className: w.top, children: [
1861
+ /* @__PURE__ */ t.jsxs("div", { className: w.info, children: [
1862
+ /* @__PURE__ */ t.jsx("span", { className: w.title, children: "Cart" }),
1863
+ a && /* @__PURE__ */ t.jsx("div", { className: w.count, children: l.parts.length })
1864
1864
  ] }),
1865
- /* @__PURE__ */ t.jsxs("div", { className: P.rightButtons, children: [
1866
- i && /* @__PURE__ */ t.jsx(
1865
+ /* @__PURE__ */ t.jsxs("div", { className: w.rightButtons, children: [
1866
+ a && /* @__PURE__ */ t.jsx(
1867
1867
  "button",
1868
1868
  {
1869
- className: V(P.clear, {
1870
- [P.activeClear]: i
1869
+ className: H(w.clear, {
1870
+ [w.activeClear]: a
1871
1871
  }),
1872
- disabled: !i,
1873
- onClick: a,
1872
+ disabled: !a,
1873
+ onClick: r,
1874
1874
  children: "Clear all"
1875
1875
  }
1876
1876
  ),
1877
1877
  /* @__PURE__ */ t.jsx(
1878
- I,
1878
+ b,
1879
1879
  {
1880
1880
  name: "X",
1881
1881
  onClick: e,
1882
1882
  hoverable: !0,
1883
1883
  width: 24,
1884
- height: 24
1884
+ height: 24,
1885
+ fill: "var(--text-primary)"
1885
1886
  }
1886
1887
  )
1887
1888
  ] })
1888
1889
  ] }),
1889
- i ? /* @__PURE__ */ t.jsxs("div", { className: P.cart, children: [
1890
- /* @__PURE__ */ t.jsx("div", { className: P.products, children: [...new Map(n.map((o) => [o.id, o])).values()].map((o) => /* @__PURE__ */ t.jsxs(
1890
+ a ? /* @__PURE__ */ t.jsxs("div", { className: w.cart, children: [
1891
+ /* @__PURE__ */ t.jsx("div", { className: w.products, children: [...new Map(i.map((n) => [n.id, n])).values()].map((n) => /* @__PURE__ */ t.jsxs(
1891
1892
  "div",
1892
1893
  {
1893
- className: P.product,
1894
+ className: w.product,
1894
1895
  children: [
1895
- /* @__PURE__ */ t.jsxs("div", { className: P.productInfo, children: [
1896
- o.images.length > 0 ? /* @__PURE__ */ t.jsx(
1896
+ /* @__PURE__ */ t.jsxs("div", { className: w.productInfo, children: [
1897
+ n.images.length > 0 ? /* @__PURE__ */ t.jsx(
1897
1898
  "img",
1898
1899
  {
1899
- src: `https://imagedelivery.net/${o.images[0].cfId}/w=500`,
1900
+ src: `https://imagedelivery.net/${n.images[0].cfId}/w=500`,
1900
1901
  alt: "image",
1901
1902
  width: "100%",
1902
1903
  height: "100%",
1903
- className: P.image
1904
+ className: w.image
1904
1905
  }
1905
- ) : /* @__PURE__ */ t.jsx("div", { className: P.image, children: /* @__PURE__ */ t.jsx(
1906
- I,
1906
+ ) : /* @__PURE__ */ t.jsx("div", { className: w.image, children: /* @__PURE__ */ t.jsx(
1907
+ b,
1907
1908
  {
1908
1909
  name: "Image",
1909
1910
  fill: "var(--text-secondary)"
1910
1911
  }
1911
1912
  ) }),
1912
- /* @__PURE__ */ t.jsxs("div", { className: P.content, children: [
1913
- /* @__PURE__ */ t.jsx("div", { className: P.name, children: at(o.name) }),
1914
- /* @__PURE__ */ t.jsx("div", { className: P.price, children: tt({
1915
- amount: o.variants.find(
1916
- (h) => h.id === o.activeVariantId
1917
- ).price.amount * ((o == null ? void 0 : o.quantity) || 1),
1918
- currency: o.variants.find(
1919
- (h) => h.id === o.activeVariantId
1913
+ /* @__PURE__ */ t.jsxs("div", { className: w.content, children: [
1914
+ /* @__PURE__ */ t.jsx("div", { className: w.name, children: at(n.name) }),
1915
+ /* @__PURE__ */ t.jsx("div", { className: w.price, children: Z({
1916
+ amount: n.variants.find(
1917
+ (o) => o.id === n.activeVariantId
1918
+ ).price.amount * ((n == null ? void 0 : n.quantity) || 1),
1919
+ currency: n.variants.find(
1920
+ (o) => o.id === n.activeVariantId
1920
1921
  ).price.currency
1921
1922
  }) })
1922
1923
  ] })
1923
1924
  ] }),
1924
- /* @__PURE__ */ t.jsxs("div", { className: P.productButtons, children: [
1925
+ /* @__PURE__ */ t.jsxs("div", { className: w.productButtons, children: [
1925
1926
  /* @__PURE__ */ t.jsx(
1926
- D,
1927
+ z,
1927
1928
  {
1928
1929
  type: "Secondary",
1929
1930
  onClick: () => {
1930
- o.quantity !== 1 && g(o);
1931
+ n.quantity !== 1 && p(n);
1931
1932
  },
1932
- className: P.productButton,
1933
- disabled: o.quantity === 1,
1933
+ className: w.productButton,
1934
+ disabled: n.quantity === 1,
1934
1935
  children: /* @__PURE__ */ t.jsx(
1935
- I,
1936
+ b,
1936
1937
  {
1937
1938
  name: "Minus",
1938
1939
  fill: "#757575",
@@ -1942,16 +1943,16 @@ const ns = (u) => {
1942
1943
  )
1943
1944
  }
1944
1945
  ),
1945
- /* @__PURE__ */ t.jsx("div", { className: P.productCount, children: o.quantity }),
1946
+ /* @__PURE__ */ t.jsx("div", { className: w.productCount, children: n.quantity }),
1946
1947
  /* @__PURE__ */ t.jsx(
1947
- D,
1948
+ z,
1948
1949
  {
1949
1950
  type: "Secondary",
1950
- onClick: () => y(o),
1951
- className: P.productButton,
1952
- disabled: o.quantity === o.variants.find((h) => h.id === o.activeVariantId).quantity.available,
1951
+ onClick: () => x(n),
1952
+ className: w.productButton,
1953
+ disabled: n.quantity === n.variants.find((o) => o.id === n.activeVariantId).quantity.available,
1953
1954
  children: /* @__PURE__ */ t.jsx(
1954
- I,
1955
+ b,
1955
1956
  {
1956
1957
  name: "Plus",
1957
1958
  fill: "#757575",
@@ -1964,14 +1965,14 @@ const ns = (u) => {
1964
1965
  ] })
1965
1966
  ]
1966
1967
  },
1967
- o.id
1968
+ n.id
1968
1969
  )) }),
1969
- /* @__PURE__ */ t.jsxs("div", { className: P.bottom, children: [
1970
- /* @__PURE__ */ t.jsxs("div", { className: P.subtotal, children: [
1971
- /* @__PURE__ */ t.jsxs("div", { className: P.block, children: [
1970
+ /* @__PURE__ */ t.jsxs("div", { className: w.bottom, children: [
1971
+ /* @__PURE__ */ t.jsxs("div", { className: w.subtotal, children: [
1972
+ /* @__PURE__ */ t.jsxs("div", { className: w.block, children: [
1972
1973
  /* @__PURE__ */ t.jsx("span", { children: "Subtotal" }),
1973
1974
  /* @__PURE__ */ t.jsx(
1974
- I,
1975
+ b,
1975
1976
  {
1976
1977
  name: "Info",
1977
1978
  width: 20,
@@ -1980,20 +1981,20 @@ const ns = (u) => {
1980
1981
  }
1981
1982
  )
1982
1983
  ] }),
1983
- /* @__PURE__ */ t.jsx("div", { className: P.total, children: tt({
1984
- amount: m().total,
1985
- currency: c.parts.length > 0 && ((r = (l = n.find((o) => o.id === c.parts[0].productId)) == null ? void 0 : l.variants.find((o) => o.id === c.parts[0].productVariantId)) == null ? void 0 : r.price.currency) || "USD"
1984
+ /* @__PURE__ */ t.jsx("div", { className: w.total, children: Z({
1985
+ amount: g().total,
1986
+ currency: l.parts.length > 0 && ((c = (v = i.find((n) => n.id === l.parts[0].productId)) == null ? void 0 : v.variants.find((n) => n.id === l.parts[0].productVariantId)) == null ? void 0 : c.price.currency) || "USD"
1986
1987
  }) })
1987
1988
  ] }),
1988
- /* @__PURE__ */ t.jsx(D, { onClick: () => M("/checkout", !1), children: "Checkout" })
1989
+ /* @__PURE__ */ t.jsx(z, { onClick: () => T("/checkout", !1), children: "Checkout" })
1989
1990
  ] })
1990
- ] }) : /* @__PURE__ */ t.jsx(Ls, {})
1991
+ ] }) : /* @__PURE__ */ t.jsx(Rs, {})
1991
1992
  ]
1992
1993
  }
1993
1994
  );
1994
- }, Ls = () => /* @__PURE__ */ t.jsxs("div", { className: P.empty, children: [
1995
+ }, Rs = () => /* @__PURE__ */ t.jsxs("div", { className: w.empty, children: [
1995
1996
  /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
1996
- I,
1997
+ b,
1997
1998
  {
1998
1999
  name: "Handbag",
1999
2000
  fill: "var(--text-secondary)"
@@ -2007,39 +2008,39 @@ const ns = (u) => {
2007
2008
  "a",
2008
2009
  {
2009
2010
  href: "/products",
2010
- className: P.link,
2011
+ className: w.link,
2011
2012
  children: "view products"
2012
2013
  }
2013
2014
  )
2014
2015
  ] })
2015
- ] }), Ot = ({ signUp: u, close: n }) => {
2016
- const { token: i } = Ut(), s = St(), [e, c] = x.useState("test-email@gmail.com");
2017
- x.useEffect(() => {
2018
- i && (async () => {
2019
- if (!i) return;
2020
- const _ = zt(i);
2021
- c(_.email);
2016
+ ] }), Ot = ({ signUp: u, close: i }) => {
2017
+ const { token: a } = Lt(), s = St(), [e, l] = f.useState("test-email@gmail.com");
2018
+ f.useEffect(() => {
2019
+ a && (async () => {
2020
+ if (!a) return;
2021
+ const _ = Ut(a);
2022
+ l(_.email);
2022
2023
  })();
2023
- }, [i]);
2024
- function a(m) {
2025
- window.location.pathname.includes("/admin/builder") || s(m);
2024
+ }, [a]);
2025
+ function r(g) {
2026
+ window.location.pathname.includes("/admin/builder") || s(g);
2026
2027
  }
2027
- return i ? /* @__PURE__ */ t.jsx(
2028
- D,
2028
+ return a ? /* @__PURE__ */ t.jsx(
2029
+ z,
2029
2030
  {
2030
2031
  type: "Secondary",
2031
- className: P.userInfo,
2032
+ className: w.userInfo,
2032
2033
  onClick: () => {
2033
- a("/customer-dash"), n == null || n();
2034
+ r("/customer-dash"), i == null || i();
2034
2035
  },
2035
2036
  children: /* @__PURE__ */ t.jsx("div", { children: e || "test-email@gmail.com" })
2036
2037
  }
2037
2038
  ) : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
2038
2039
  /* @__PURE__ */ t.jsx(
2039
- D,
2040
+ z,
2040
2041
  {
2041
2042
  onClick: () => {
2042
- a("/customer-dash"), n == null || n();
2043
+ r("/customer-dash"), i == null || i();
2043
2044
  },
2044
2045
  type: "Secondary",
2045
2046
  style: {
@@ -2049,10 +2050,10 @@ const ns = (u) => {
2049
2050
  }
2050
2051
  ),
2051
2052
  u && /* @__PURE__ */ t.jsx(
2052
- D,
2053
+ z,
2053
2054
  {
2054
2055
  onClick: () => {
2055
- a("/customer-dash"), n == null || n();
2056
+ r("/customer-dash"), i == null || i();
2056
2057
  },
2057
2058
  type: "Primary",
2058
2059
  style: {
@@ -2063,112 +2064,112 @@ const ns = (u) => {
2063
2064
  }
2064
2065
  )
2065
2066
  ] });
2066
- }, Us = ({
2067
+ }, Ls = ({
2067
2068
  logo: u,
2068
- setIsOpen: n,
2069
- signUp: i,
2069
+ setIsOpen: i,
2070
+ signUp: a,
2070
2071
  pages: s
2071
2072
  }) => {
2072
- const { setIsOpen: e } = ct(), c = () => {
2073
+ const { setIsOpen: e } = ct(), l = () => {
2073
2074
  e(!1), setTimeout(() => {
2074
- n(!1), e(!0);
2075
+ i(!1), e(!0);
2075
2076
  }, 300);
2076
2077
  };
2077
2078
  return /* @__PURE__ */ t.jsxs(
2078
2079
  "div",
2079
2080
  {
2080
- className: P.pagesMobileModal,
2081
- onClick: (a) => a.stopPropagation(),
2081
+ className: w.pagesMobileModal,
2082
+ onClick: (r) => r.stopPropagation(),
2082
2083
  children: [
2083
- /* @__PURE__ */ t.jsxs("div", { className: P.pagesMobileModalHeader, children: [
2084
+ /* @__PURE__ */ t.jsxs("div", { className: w.pagesMobileModalHeader, children: [
2084
2085
  /* @__PURE__ */ t.jsx("div", { children: u }),
2085
2086
  /* @__PURE__ */ t.jsx(
2086
- D,
2087
+ z,
2087
2088
  {
2088
2089
  type: "Secondary",
2089
- onClick: c,
2090
- children: /* @__PURE__ */ t.jsx(I, { name: "X" })
2090
+ onClick: l,
2091
+ children: /* @__PURE__ */ t.jsx(b, { name: "X" })
2091
2092
  }
2092
2093
  )
2093
2094
  ] }),
2094
- /* @__PURE__ */ t.jsx("div", { className: P.pagesMobileModalContent, children: s.length > 0 && s.map((a) => /* @__PURE__ */ t.jsx(
2095
+ /* @__PURE__ */ t.jsx("div", { className: w.pagesMobileModalContent, children: s.length > 0 && s.map((r) => /* @__PURE__ */ t.jsx(
2095
2096
  "div",
2096
2097
  {
2097
- className: P.pageLink,
2098
- onClick: c,
2098
+ className: w.pageLink,
2099
+ onClick: l,
2099
2100
  children: /* @__PURE__ */ t.jsx(
2100
- Mt,
2101
+ Tt,
2101
2102
  {
2102
- path: a.path,
2103
- children: a.name["en-US"]
2103
+ path: r.path,
2104
+ children: r.name["en-US"]
2104
2105
  },
2105
- a.id
2106
+ r.id
2106
2107
  )
2107
2108
  }
2108
2109
  )) }),
2109
- /* @__PURE__ */ t.jsx("div", { className: P.pagesMobileModalFooter, children: /* @__PURE__ */ t.jsx(
2110
+ /* @__PURE__ */ t.jsx("div", { className: w.pagesMobileModalFooter, children: /* @__PURE__ */ t.jsx(
2110
2111
  Ot,
2111
2112
  {
2112
- signUp: i,
2113
- close: c
2113
+ signUp: a,
2114
+ close: l
2114
2115
  }
2115
2116
  ) })
2116
2117
  ]
2117
2118
  }
2118
2119
  );
2119
- }, Vn = ({ logo: u, signUp: n, pages: i }) => {
2120
- const [s, e] = x.useState(!1);
2120
+ }, Ln = ({ logo: u, signUp: i, pages: a }) => {
2121
+ const [s, e] = f.useState(!1);
2121
2122
  return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
2122
- /* @__PURE__ */ t.jsx(zs, { setIsOpenModal: e }),
2123
+ /* @__PURE__ */ t.jsx(Us, { setIsOpenModal: e }),
2123
2124
  s && /* @__PURE__ */ t.jsx(
2124
2125
  ut,
2125
2126
  {
2126
2127
  close: () => e(!1),
2127
2128
  hasPadding: !1,
2128
2129
  children: /* @__PURE__ */ t.jsx(
2129
- Us,
2130
+ Ls,
2130
2131
  {
2131
2132
  logo: u,
2132
2133
  setIsOpen: e,
2133
- signUp: n,
2134
- pages: i
2134
+ signUp: i,
2135
+ pages: a
2135
2136
  }
2136
2137
  )
2137
2138
  }
2138
2139
  )
2139
2140
  ] });
2140
- }, zs = (u) => {
2141
- const { setIsOpenModal: n } = u;
2141
+ }, Us = (u) => {
2142
+ const { setIsOpenModal: i } = u;
2142
2143
  return /* @__PURE__ */ t.jsx(
2143
- D,
2144
+ z,
2144
2145
  {
2145
2146
  type: "Secondary",
2146
2147
  style: {
2147
2148
  padding: 10
2148
2149
  },
2149
- onClick: (i) => {
2150
- i.stopPropagation(), window.location.pathname.includes("/admin/builder") || n(!0);
2150
+ onClick: (a) => {
2151
+ a.stopPropagation(), window.location.pathname.includes("/admin/builder") || i(!0);
2151
2152
  },
2152
- children: /* @__PURE__ */ t.jsx(I, { name: "List" })
2153
+ children: /* @__PURE__ */ t.jsx(b, { name: "List" })
2153
2154
  }
2154
2155
  );
2155
- }, Vs = "_share_rlgln_1", Hs = "_modal_rlgln_8", Fs = "_header_rlgln_20", Ys = "_title_rlgln_46", Gs = "_copyWrapper_rlgln_52", Ws = "_copyText_rlgln_61", Xs = "_copyTextMobile_rlgln_74", Qs = "_copyTextMiniMobile_rlgln_93", nt = {
2156
- share: Vs,
2157
- modal: Hs,
2158
- header: Fs,
2156
+ }, Hs = "_share_rlgln_1", Fs = "_modal_rlgln_8", Vs = "_header_rlgln_20", Ys = "_title_rlgln_46", Gs = "_copyWrapper_rlgln_52", Ws = "_copyText_rlgln_61", Xs = "_copyTextMobile_rlgln_74", Qs = "_copyTextMiniMobile_rlgln_93", nt = {
2157
+ share: Hs,
2158
+ modal: Fs,
2159
+ header: Vs,
2159
2160
  title: Ys,
2160
2161
  copyWrapper: Gs,
2161
2162
  copyText: Ws,
2162
2163
  copyTextMobile: Xs,
2163
2164
  copyTextMiniMobile: Qs
2164
- }, Hn = ({ title: u = "Copy Product Link" }) => {
2165
- const { isOpenModal: n, setIsOpenModal: i } = Bt();
2165
+ }, Un = ({ title: u = "Copy Product Link" }) => {
2166
+ const { isOpenModal: i, setIsOpenModal: a } = Mt();
2166
2167
  function s() {
2167
- i(!0);
2168
+ a(!0);
2168
2169
  }
2169
2170
  return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
2170
2171
  /* @__PURE__ */ t.jsx(
2171
- D,
2172
+ z,
2172
2173
  {
2173
2174
  className: nt.share,
2174
2175
  onClick: (e) => {
@@ -2176,7 +2177,7 @@ const ns = (u) => {
2176
2177
  },
2177
2178
  type: "Secondary",
2178
2179
  children: /* @__PURE__ */ t.jsx(
2179
- I,
2180
+ b,
2180
2181
  {
2181
2182
  name: "Share",
2182
2183
  fill: "#757575",
@@ -2185,70 +2186,70 @@ const ns = (u) => {
2185
2186
  )
2186
2187
  }
2187
2188
  ),
2188
- n && /* @__PURE__ */ t.jsx(ut, { close: i, children: /* @__PURE__ */ t.jsx(Js, { title: u }) })
2189
+ i && /* @__PURE__ */ t.jsx(ut, { close: a, children: /* @__PURE__ */ t.jsx(Js, { title: u }) })
2189
2190
  ] });
2190
2191
  }, Js = ({ title: u = "Copy Product Link" }) => {
2191
- const { setIsOpenModal: n } = Bt(), { notifications: i, setNotifications: s } = Ct(), { setIsOpen: e } = ct(), c = window.location.href;
2192
- function a() {
2193
- navigator.clipboard.writeText(c), s([
2194
- ...i,
2192
+ const { setIsOpenModal: i } = Mt(), { notifications: a, setNotifications: s } = Ct(), { setIsOpen: e } = ct(), l = window.location.href;
2193
+ function r() {
2194
+ navigator.clipboard.writeText(l), s([
2195
+ ...a,
2195
2196
  {
2196
- id: J(),
2197
+ id: Q(),
2197
2198
  message: "Link copied to clipboard",
2198
2199
  status: "success"
2199
2200
  }
2200
2201
  ]);
2201
2202
  }
2202
- function m() {
2203
+ function g() {
2203
2204
  e(!1), setTimeout(() => {
2204
- n(!1), e(!0);
2205
+ i(!1), e(!0);
2205
2206
  }, 300);
2206
2207
  }
2207
- function _(b, M) {
2208
- return b.length > M ? b.slice(0, M) + "..." : b;
2208
+ function _(j, T) {
2209
+ return j.length > T ? j.slice(0, T) + "..." : j;
2209
2210
  }
2210
2211
  return /* @__PURE__ */ t.jsxs(
2211
2212
  "div",
2212
2213
  {
2213
2214
  className: nt.modal,
2214
- onClick: (b) => b.stopPropagation(),
2215
+ onClick: (j) => j.stopPropagation(),
2215
2216
  children: [
2216
2217
  /* @__PURE__ */ t.jsxs("div", { className: nt.header, children: [
2217
2218
  /* @__PURE__ */ t.jsx("div", { className: nt.title, children: u }),
2218
2219
  /* @__PURE__ */ t.jsx(
2219
- I,
2220
+ b,
2220
2221
  {
2221
2222
  name: "X",
2222
2223
  fill: "#757575",
2223
- onClick: m,
2224
+ onClick: g,
2224
2225
  hoverable: !0
2225
2226
  }
2226
2227
  )
2227
2228
  ] }),
2228
2229
  /* @__PURE__ */ t.jsxs("div", { className: nt.copyWrapper, children: [
2229
2230
  /* @__PURE__ */ t.jsxs(
2230
- D,
2231
+ z,
2231
2232
  {
2232
2233
  type: "Secondary",
2233
- onClick: a,
2234
+ onClick: r,
2234
2235
  style: {
2235
2236
  flex: 1
2236
2237
  },
2237
2238
  children: [
2238
- /* @__PURE__ */ t.jsx("div", { className: nt.copyText, children: _(c, 100) }),
2239
- /* @__PURE__ */ t.jsx("div", { className: nt.copyTextMobile, children: _(c, 40) }),
2240
- /* @__PURE__ */ t.jsx("div", { className: nt.copyTextMiniMobile, children: _(c, 20) })
2239
+ /* @__PURE__ */ t.jsx("div", { className: nt.copyText, children: _(l, 100) }),
2240
+ /* @__PURE__ */ t.jsx("div", { className: nt.copyTextMobile, children: _(l, 40) }),
2241
+ /* @__PURE__ */ t.jsx("div", { className: nt.copyTextMiniMobile, children: _(l, 20) })
2241
2242
  ]
2242
2243
  }
2243
2244
  ),
2244
2245
  /* @__PURE__ */ t.jsx(
2245
- D,
2246
+ z,
2246
2247
  {
2247
2248
  type: "Secondary",
2248
- onClick: a,
2249
- children: i.find(
2250
- (b) => b.message === "Link copied to clipboard"
2251
- ) ? /* @__PURE__ */ t.jsx(I, { name: "Check" }) : /* @__PURE__ */ t.jsx(I, { name: "Copy" })
2249
+ onClick: r,
2250
+ children: a.find(
2251
+ (j) => j.message === "Link copied to clipboard"
2252
+ ) ? /* @__PURE__ */ t.jsx(b, { name: "Check" }) : /* @__PURE__ */ t.jsx(b, { name: "Copy" })
2252
2253
  }
2253
2254
  )
2254
2255
  ] })
@@ -2261,12 +2262,12 @@ const ns = (u) => {
2261
2262
  icon: tn,
2262
2263
  open: en,
2263
2264
  content: sn
2264
- }, Fn = ({ title: u, content: n, defaultOpen: i = !1 }) => {
2265
- const [s, e] = x.useState(i), [c, a] = x.useState(0), m = x.useRef(null), _ = () => {
2265
+ }, Hn = ({ title: u, content: i, defaultOpen: a = !1 }) => {
2266
+ const [s, e] = f.useState(a), [l, r] = f.useState(0), g = f.useRef(null), _ = () => {
2266
2267
  e(!s);
2267
2268
  };
2268
- return x.useEffect(() => {
2269
- m.current && a(s ? m.current.scrollHeight : 0);
2269
+ return f.useEffect(() => {
2270
+ g.current && r(s ? g.current.scrollHeight : 0);
2270
2271
  }, [s]), /* @__PURE__ */ t.jsxs("div", { className: rt.accordion, children: [
2271
2272
  /* @__PURE__ */ t.jsxs(
2272
2273
  "div",
@@ -2275,58 +2276,58 @@ const ns = (u) => {
2275
2276
  onClick: _,
2276
2277
  children: [
2277
2278
  /* @__PURE__ */ t.jsx("h5", { id: "h5", children: u }),
2278
- /* @__PURE__ */ t.jsx("div", { className: V(rt.icon, { [rt.open]: s }), children: /* @__PURE__ */ t.jsx(I, { name: "CaretDown" }) })
2279
+ /* @__PURE__ */ t.jsx("div", { className: H(rt.icon, { [rt.open]: s }), children: /* @__PURE__ */ t.jsx(b, { name: "CaretDown" }) })
2279
2280
  ]
2280
2281
  }
2281
2282
  ),
2282
2283
  /* @__PURE__ */ t.jsx(
2283
2284
  "div",
2284
2285
  {
2285
- ref: m,
2286
+ ref: g,
2286
2287
  className: rt.content,
2287
- style: { height: `${c}px` },
2288
- children: /* @__PURE__ */ t.jsx("p", { id: "p", children: n })
2288
+ style: { height: `${l}px` },
2289
+ children: /* @__PURE__ */ t.jsx("p", { id: "p", children: i })
2289
2290
  }
2290
2291
  )
2291
2292
  ] });
2292
2293
  }, nn = "_buttonsBlock_1b2rb_1", an = {
2293
2294
  buttonsBlock: nn
2294
- }, Yn = (u) => {
2295
- var b, M;
2296
- const { setIsOpen: n, setModalType: i, productId: s } = u, { cart: e } = ot(), { pageContext: c } = yt(), a = (b = c == null ? void 0 : c.listings) == null ? void 0 : b.find((y) => y.id === s);
2297
- if (!a)
2295
+ }, Fn = (u) => {
2296
+ var j, T;
2297
+ const { setIsOpen: i, setModalType: a, productId: s } = u, { cart: e } = ot(), { pageContext: l } = yt(), r = (j = l == null ? void 0 : l.listings) == null ? void 0 : j.find((x) => x.id === s);
2298
+ if (!r)
2298
2299
  return null;
2299
- const m = (M = c == null ? void 0 : c.products) == null ? void 0 : M.find(
2300
- (y) => y.uniquePath === a.productData.uniquePath
2300
+ const g = (T = l == null ? void 0 : l.products) == null ? void 0 : T.find(
2301
+ (x) => x.uniquePath === r.productData.uniquePath
2301
2302
  );
2302
- if (!m)
2303
+ if (!g)
2303
2304
  return null;
2304
- const _ = e.parts.find((y) => y.productId === m.id);
2305
+ const _ = e.parts.find((x) => x.productId === g.id);
2305
2306
  return /* @__PURE__ */ t.jsxs(
2306
2307
  "div",
2307
2308
  {
2308
2309
  className: an.buttonsBlock,
2309
- onClick: (y) => y.stopPropagation(),
2310
+ onClick: (x) => x.stopPropagation(),
2310
2311
  children: [
2311
2312
  /* @__PURE__ */ t.jsx(
2312
- D,
2313
+ z,
2313
2314
  {
2314
2315
  type: "Secondary",
2315
2316
  style: {
2316
2317
  width: "100%"
2317
2318
  },
2318
2319
  onClick: () => {
2319
- i("Add To Cart"), n(!0);
2320
+ a("Add To Cart"), i(!0);
2320
2321
  },
2321
2322
  children: _ ? "Add More" : "Add To Cart"
2322
2323
  }
2323
2324
  ),
2324
2325
  /* @__PURE__ */ t.jsx(
2325
- D,
2326
+ z,
2326
2327
  {
2327
2328
  type: "Primary",
2328
2329
  onClick: () => {
2329
- i("Buy Now"), n(!0);
2330
+ a("Buy Now"), i(!0);
2330
2331
  },
2331
2332
  children: "Buy"
2332
2333
  }
@@ -2338,11 +2339,11 @@ const ns = (u) => {
2338
2339
  wrapper: on,
2339
2340
  logo: cn,
2340
2341
  info: rn
2341
- }, Gn = ({ date: u }) => {
2342
- const { general: n } = Vt();
2343
- if (!n) return /* @__PURE__ */ t.jsx(t.Fragment, {});
2344
- function i(s) {
2345
- const e = new Date(s), c = {
2342
+ }, Vn = ({ date: u }) => {
2343
+ const { general: i } = Ht();
2344
+ if (!i) return /* @__PURE__ */ t.jsx(t.Fragment, {});
2345
+ function a(s) {
2346
+ const e = new Date(s), l = {
2346
2347
  month: "short",
2347
2348
  day: "2-digit",
2348
2349
  year: "numeric",
@@ -2350,18 +2351,18 @@ const ns = (u) => {
2350
2351
  minute: "2-digit",
2351
2352
  hour12: !1
2352
2353
  };
2353
- return e.toLocaleDateString("en-US", c);
2354
+ return e.toLocaleDateString("en-US", l);
2354
2355
  }
2355
2356
  return /* @__PURE__ */ t.jsxs("div", { className: It.wrapper, children: [
2356
- /* @__PURE__ */ t.jsx("div", { className: It.logo, children: n.info.logo ? /* @__PURE__ */ t.jsx(
2357
+ /* @__PURE__ */ t.jsx("div", { className: It.logo, children: i.info.logo ? /* @__PURE__ */ t.jsx(
2357
2358
  "img",
2358
2359
  {
2359
- src: `https://imagedelivery.net/${n.info.logo.cfId}/w=500,h=500`,
2360
+ src: `https://imagedelivery.net/${i.info.logo.cfId}/w=500,h=500`,
2360
2361
  alt: "image",
2361
2362
  style: { objectFit: "contain", width: "48px", height: "48px" }
2362
2363
  }
2363
2364
  ) : /* @__PURE__ */ t.jsx(
2364
- I,
2365
+ b,
2365
2366
  {
2366
2367
  name: "Image",
2367
2368
  width: 48,
@@ -2369,107 +2370,111 @@ const ns = (u) => {
2369
2370
  }
2370
2371
  ) }),
2371
2372
  /* @__PURE__ */ t.jsxs("div", { className: It.info, children: [
2372
- /* @__PURE__ */ t.jsx("h3", { id: "h4", children: n.info.name }),
2373
- /* @__PURE__ */ t.jsx("p", { id: "p", children: i(u) })
2373
+ /* @__PURE__ */ t.jsx("h3", { id: "h4", children: i.info.name }),
2374
+ /* @__PURE__ */ t.jsx("p", { id: "p", children: a(u) })
2374
2375
  ] })
2375
2376
  ] });
2376
- }, ln = "_variants_puxd1_80", dn = "_variant_puxd1_80", un = "_stock_puxd1_98", hn = "_variantInfo_puxd1_105", pn = "_chargeTypes_puxd1_165", mn = "_charge_puxd1_165", gn = "_chargeActive_puxd1_190", fn = "_title_puxd1_198", xn = "_modal_puxd1_204", _n = "_header_puxd1_224", jn = "_productOptions_puxd1_232", vn = "_loading_puxd1_236", Q = {
2377
+ }, ln = "_variants_hphv8_80", dn = "_variant_hphv8_80", un = "_stock_hphv8_98", hn = "_variantInfo_hphv8_105", pn = "_title_hphv8_199", mn = "_modal_hphv8_205", gn = "_header_hphv8_225", fn = "_productOptions_hphv8_233", xn = "_loading_hphv8_237", tt = {
2377
2378
  variants: ln,
2378
2379
  variant: dn,
2379
2380
  stock: un,
2380
2381
  variantInfo: hn,
2381
- chargeTypes: pn,
2382
- charge: mn,
2383
- chargeActive: gn,
2384
- title: fn,
2385
- modal: xn,
2386
- header: _n,
2387
- productOptions: jn,
2388
- loading: vn
2389
- }, Wn = (u) => {
2390
- var g;
2391
- const { pageContext: n } = yt(), i = (g = n == null ? void 0 : n.listings) == null ? void 0 : g.find((l) => l.id === u.productId), [s, e] = x.useState(!0), [c, a] = x.useState(null), m = (c == null ? void 0 : c.variants[0]) || null, [_, b] = x.useState(
2392
- m != null && m.chargeTypes && m.chargeTypes.length > 1 ? m.chargeTypes[0] : "ONE_TIME"
2393
- ), { addProducts: M } = ot(), { setIsOpen: y } = ct();
2394
- return x.useEffect(() => {
2382
+ title: pn,
2383
+ modal: mn,
2384
+ header: gn,
2385
+ productOptions: fn,
2386
+ loading: xn
2387
+ }, Yn = (u) => {
2388
+ var p;
2389
+ const { pageContext: i } = yt(), a = (p = i == null ? void 0 : i.listings) == null ? void 0 : p.find((v) => v.id === u.productId), [s, e] = f.useState(!0), [l, r] = f.useState(null), g = (l == null ? void 0 : l.variants[0]) || null, [_, j] = f.useState(
2390
+ "ONE_TIME"
2391
+ ), { addProducts: T } = ot(), { setIsOpen: x } = ct();
2392
+ return f.useEffect(() => {
2395
2393
  (async () => {
2396
2394
  e(!0);
2397
- const r = await Ht(
2395
+ const c = await Ft(
2398
2396
  encodeURIComponent(
2399
- `/product/${i.productData.uniquePath}`
2397
+ `/product/${a.productData.uniquePath}`
2400
2398
  )
2401
2399
  );
2402
- M(r == null ? void 0 : r.data.products), a(r == null ? void 0 : r.data.products[0]), e(!1);
2400
+ T(c == null ? void 0 : c.data.products), r(c == null ? void 0 : c.data.products[0]), e(!1);
2403
2401
  })();
2404
- }, []), x.useEffect(() => {
2405
- y(!0);
2402
+ }, []), f.useEffect(() => {
2403
+ x(!0);
2406
2404
  }, []), /* @__PURE__ */ t.jsx(ut, { close: u.setIsOpen, children: /* @__PURE__ */ t.jsxs(
2407
2405
  "div",
2408
2406
  {
2409
- className: Q.modal,
2410
- onClick: (l) => l.stopPropagation(),
2407
+ className: tt.modal,
2408
+ onClick: (v) => v.stopPropagation(),
2411
2409
  children: [
2412
- s && /* @__PURE__ */ t.jsx("div", { className: Q.loading, children: /* @__PURE__ */ t.jsx($t, {}) }),
2413
- u.type === "Add To Cart" && c && m && !s && /* @__PURE__ */ t.jsx(
2414
- yn,
2410
+ s && /* @__PURE__ */ t.jsx("div", { className: tt.loading, children: /* @__PURE__ */ t.jsx(Bt, {}) }),
2411
+ u.type === "Add To Cart" && l && g && !s && /* @__PURE__ */ t.jsx(
2412
+ _n,
2415
2413
  {
2416
- variants: c.variants,
2417
- activeVariant: m,
2414
+ variants: l.variants,
2415
+ activeVariant: g,
2418
2416
  activeChargeType: _,
2419
- setActiveChargeType: b,
2420
- productId: c.id,
2417
+ setActiveChargeType: j,
2418
+ productId: l.id,
2421
2419
  setIsOpen: u.setIsOpen
2422
2420
  }
2423
2421
  ),
2424
- u.type === "Buy Now" && c && !s && /* @__PURE__ */ t.jsx(
2425
- bn,
2422
+ u.type === "Buy Now" && l && !s && /* @__PURE__ */ t.jsx(
2423
+ jn,
2426
2424
  {
2427
- product: c,
2425
+ product: l,
2428
2426
  setIsOpen: u.setIsOpen
2429
2427
  }
2430
2428
  )
2431
2429
  ]
2432
2430
  }
2433
2431
  ) });
2434
- }, yn = (u) => {
2435
- const { variants: n, activeChargeType: i, setActiveChargeType: s, activeVariant: e, productId: c, setIsOpen: a } = u, { cart: m, addProductToCart: _, addProducts: b, updateQuantityOfProduct: M } = ot(), { notifications: y, setNotifications: g } = Ct(), { pageContext: l } = yt(), { setIsOpen: r } = ct(), o = () => {
2436
- r(!1), setTimeout(() => {
2437
- a(!1);
2432
+ }, _n = (u) => {
2433
+ const { variants: i, activeChargeType: a, productId: s, setIsOpen: e } = u, { cart: l, addProductToCart: r, addProducts: g, updateQuantityOfProduct: _ } = ot(), { notifications: j, setNotifications: T } = Ct(), { pageContext: x } = yt(), { setIsOpen: p } = ct(), v = () => {
2434
+ p(!1), setTimeout(() => {
2435
+ e(!1);
2438
2436
  }, 300);
2439
2437
  };
2440
- async function h(j) {
2441
- const v = m.parts.find(
2442
- (T) => T.productId === u.productId && T.productVariantId === j
2438
+ async function c(n) {
2439
+ const o = i.find((M) => M.id === n), C = l.parts.find(
2440
+ (M) => M.productId === u.productId && M.productVariantId === n
2443
2441
  );
2444
- if (v)
2445
- M({
2446
- productId: c,
2447
- productVariantId: j,
2448
- quantity: v.quantity + 1,
2449
- chargeType: i
2442
+ if ((o == null ? void 0 : o.quantity.available) && (o == null ? void 0 : o.quantity.restrictions) && ((C == null ? void 0 : C.quantity) || 0) + 1 > (o == null ? void 0 : o.quantity.restrictions.max) || (o == null ? void 0 : o.quantity.available) === 0 || (o == null ? void 0 : o.quantity.available) && ((C == null ? void 0 : C.quantity) || 0) + 1 > (o == null ? void 0 : o.quantity.available)) {
2443
+ T([
2444
+ ...j,
2445
+ { id: Q(), message: "Product is out of stock", status: "error" }
2446
+ ]);
2447
+ return;
2448
+ }
2449
+ if (C)
2450
+ _({
2451
+ productId: s,
2452
+ productVariantId: n,
2453
+ quantity: C.quantity + 1,
2454
+ chargeType: a
2450
2455
  });
2451
2456
  else {
2452
- l != null && l.products && b(l.products);
2457
+ x != null && x.products && g(x.products);
2453
2458
  try {
2454
- _({
2455
- productId: c,
2456
- productVariantId: j,
2459
+ r({
2460
+ productId: s,
2461
+ productVariantId: n,
2457
2462
  quantity: 1,
2458
- chargeType: i
2459
- }), g([
2460
- ...y,
2463
+ chargeType: a
2464
+ }), T([
2465
+ ...j,
2461
2466
  {
2462
- id: J(),
2467
+ id: Q(),
2463
2468
  message: "Product added to cart",
2464
2469
  status: "success"
2465
2470
  }
2466
2471
  ]);
2467
- } catch (T) {
2468
- g([
2469
- ...y,
2472
+ } catch (M) {
2473
+ T([
2474
+ ...j,
2470
2475
  {
2471
- id: J(),
2472
- message: `Product failed to add to cart: ${T}`,
2476
+ id: Q(),
2477
+ message: `Product failed to add to cart: ${M}`,
2473
2478
  status: "error"
2474
2479
  }
2475
2480
  ]);
@@ -2477,73 +2482,65 @@ const ns = (u) => {
2477
2482
  }
2478
2483
  }
2479
2484
  return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
2480
- /* @__PURE__ */ t.jsxs("div", { className: Q.header, children: [
2485
+ /* @__PURE__ */ t.jsxs("div", { className: tt.header, children: [
2481
2486
  /* @__PURE__ */ t.jsx("div", { id: "h3", children: "Choose a Variant" }),
2482
2487
  /* @__PURE__ */ t.jsx(
2483
- I,
2488
+ b,
2484
2489
  {
2485
2490
  name: "X",
2486
2491
  width: 24,
2487
2492
  height: 24,
2488
2493
  fill: "var(--text-secondary)",
2489
2494
  hoverable: !0,
2490
- onClick: o
2495
+ onClick: v
2491
2496
  }
2492
2497
  )
2493
2498
  ] }),
2494
- e.chargeTypes && e.chargeTypes.length > 1 && /* @__PURE__ */ t.jsx("div", { className: Q.chargeTypes, children: e.chargeTypes.map((j) => /* @__PURE__ */ t.jsx(
2495
- "div",
2496
- {
2497
- className: V(Q.charge, {
2498
- [Q.chargeActive]: i === j
2499
- }),
2500
- onClick: () => s(j),
2501
- children: kt[j]
2502
- },
2503
- j
2504
- )) }),
2505
- /* @__PURE__ */ t.jsx("div", { className: Q.variants, children: n.map((j) => {
2506
- var v, T, R;
2499
+ /* @__PURE__ */ t.jsx("div", { className: tt.variants, children: i.filter((n) => {
2500
+ var o;
2501
+ return (o = n.chargeTypes) == null ? void 0 : o.includes(a);
2502
+ }).map((n) => {
2503
+ var o, C, y;
2507
2504
  return /* @__PURE__ */ t.jsxs(
2508
2505
  "div",
2509
2506
  {
2510
- className: V(Q.variant),
2507
+ className: H(tt.variant),
2511
2508
  onClick: () => {
2512
- h(j.id), a(!1);
2509
+ c(n.id), e(!1);
2513
2510
  },
2514
2511
  children: [
2515
- /* @__PURE__ */ t.jsxs("div", { className: Q.variantInfo, children: [
2516
- /* @__PURE__ */ t.jsx("span", { className: Q.title, children: j.name }),
2517
- /* @__PURE__ */ t.jsx("span", { children: tt({
2518
- amount: i === "ONE_TIME" ? j.price.amount : j.subscriptionSettings ? j.subscriptionSettings.price.amount : 0,
2519
- currency: i === "ONE_TIME" ? j.price.currency : ((v = j.subscriptionSettings) == null ? void 0 : v.price.currency) || "USD"
2512
+ /* @__PURE__ */ t.jsxs("div", { className: tt.variantInfo, children: [
2513
+ /* @__PURE__ */ t.jsx("span", { className: tt.title, children: n.name }),
2514
+ /* @__PURE__ */ t.jsx("span", { children: Z({
2515
+ amount: a === "ONE_TIME" ? n.price.amount : n.subscriptionSettings ? n.subscriptionSettings.price.amount : 0,
2516
+ currency: a === "ONE_TIME" ? n.price.currency : ((o = n.subscriptionSettings) == null ? void 0 : o.price.currency) || "USD"
2520
2517
  }) })
2521
2518
  ] }),
2522
- /* @__PURE__ */ t.jsx("div", { children: i === "ONE_TIME" && /* @__PURE__ */ t.jsxs("span", { className: Q.stock, children: [
2523
- (T = j.quantity.restrictions) != null && T.max || j.quantity.available !== void 0 ? ((R = j.quantity.restrictions) == null ? void 0 : R.max) || j.quantity.available : "∞",
2519
+ /* @__PURE__ */ t.jsx("div", { children: a === "ONE_TIME" && /* @__PURE__ */ t.jsxs("span", { className: tt.stock, children: [
2520
+ (C = n.quantity.restrictions) != null && C.max || n.quantity.available !== void 0 ? ((y = n.quantity.restrictions) == null ? void 0 : y.max) || n.quantity.available : "∞",
2524
2521
  " ",
2525
2522
  "in stock"
2526
2523
  ] }) })
2527
2524
  ]
2528
2525
  },
2529
- j.id
2526
+ n.id
2530
2527
  );
2531
2528
  }) })
2532
2529
  ] });
2533
- }, bn = (u) => {
2534
- const { product: n, setIsOpen: i } = u, { setIsOpen: s } = ct(), e = () => {
2530
+ }, jn = (u) => {
2531
+ const { product: i, setIsOpen: a } = u, { setIsOpen: s } = ct(), e = () => {
2535
2532
  s(!1), setTimeout(() => {
2536
- i(!1);
2533
+ a(!1);
2537
2534
  }, 300);
2538
2535
  };
2539
2536
  return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
2540
- /* @__PURE__ */ t.jsxs("div", { className: Q.header, children: [
2537
+ /* @__PURE__ */ t.jsxs("div", { className: tt.header, children: [
2541
2538
  /* @__PURE__ */ t.jsxs("div", { id: "h3", children: [
2542
2539
  "Buy ",
2543
- at(n.name)
2540
+ at(i.name)
2544
2541
  ] }),
2545
2542
  /* @__PURE__ */ t.jsx(
2546
- I,
2543
+ b,
2547
2544
  {
2548
2545
  name: "X",
2549
2546
  width: 24,
@@ -2558,50 +2555,58 @@ const ns = (u) => {
2558
2555
  }
2559
2556
  )
2560
2557
  ] }),
2561
- /* @__PURE__ */ t.jsx("div", { className: Q.productOptions, children: /* @__PURE__ */ t.jsx(
2558
+ /* @__PURE__ */ t.jsx("div", { className: tt.productOptions, children: /* @__PURE__ */ t.jsx(
2562
2559
  ns,
2563
2560
  {
2564
- product: n,
2565
- setIsOpen: i
2561
+ product: i,
2562
+ setIsOpen: a
2566
2563
  }
2567
2564
  ) })
2568
2565
  ] });
2569
- }, In = "_contentModal_2a136_1", Nn = "_modalTop_2a136_13", Cn = "_loading_2a136_19", Sn = "_modalCards_2a136_27", kn = "_modalImage_2a136_32", Pn = "_card_2a136_37", wn = "_cardInfo_2a136_48", Tn = "_cardButtons_2a136_55", Mn = "_title_2a136_61", Bn = "_blockImage_2a136_68", G = {
2570
- contentModal: In,
2571
- modalTop: Nn,
2572
- loading: Cn,
2573
- modalCards: Sn,
2574
- modalImage: kn,
2575
- card: Pn,
2576
- cardInfo: wn,
2577
- cardButtons: Tn,
2578
- title: Mn,
2579
- blockImage: Bn
2580
- }, Xn = (u) => {
2581
- const { setIsOpen: n, pageContext: i, groupData: s, setProductId: e, setIsProductModalOpen: c } = u, [a, m] = x.useState(null), [_, b] = x.useState(!0), { setIsOpen: M } = ct();
2582
- x.useEffect(() => {
2583
- var r;
2584
- b(!0);
2585
- const l = (r = i.listings) == null ? void 0 : r.filter(
2566
+ }, vn = "_contentModal_1bixq_1", yn = "_modalTop_1bixq_13", bn = "_loading_1bixq_19", In = "_modalCards_1bixq_27", Nn = "_modalImage_1bixq_32", Cn = "_card_1bixq_37", Sn = "_cardInfo_1bixq_49", kn = "_cardButtons_1bixq_56", wn = "_title_1bixq_62", Pn = "_blockImage_1bixq_69", Tn = "_short_1bixq_78", G = {
2567
+ contentModal: vn,
2568
+ modalTop: yn,
2569
+ loading: bn,
2570
+ modalCards: In,
2571
+ modalImage: Nn,
2572
+ card: Cn,
2573
+ cardInfo: Sn,
2574
+ cardButtons: kn,
2575
+ title: wn,
2576
+ blockImage: Pn,
2577
+ short: Tn
2578
+ }, Gn = (u) => {
2579
+ const {
2580
+ setIsOpen: i,
2581
+ pageContext: a,
2582
+ groupData: s,
2583
+ setProductId: e,
2584
+ setIsProductModalOpen: l,
2585
+ setShowDropdown: r
2586
+ } = u, [g, _] = f.useState(null), [j, T] = f.useState(!0), { setIsOpen: x } = ct();
2587
+ f.useEffect(() => {
2588
+ var n;
2589
+ T(!0);
2590
+ const c = (n = a.listings) == null ? void 0 : n.filter(
2586
2591
  (o) => s.listingIdList.includes(o.id)
2587
2592
  );
2588
- l && m([...l]), b(!1);
2589
- }, [i]), x.useEffect(() => {
2590
- M(!0);
2593
+ c && _([...c]), T(!1);
2594
+ }, [a]), f.useEffect(() => {
2595
+ x(!0);
2591
2596
  }, []);
2592
- const y = () => {
2593
- M(!1), setTimeout(() => {
2594
- n(!1);
2597
+ const p = () => {
2598
+ x(!1), setTimeout(() => {
2599
+ i(!1);
2595
2600
  }, 300);
2596
2601
  };
2597
- function g(l) {
2598
- return l.productData.compareAtPrice ? l.productData.compareAtPrice.amount : 0;
2602
+ function v(c) {
2603
+ return c.productData.compareAtPrice ? c.productData.compareAtPrice.amount : 0;
2599
2604
  }
2600
- return /* @__PURE__ */ t.jsx(ut, { close: () => n(!1), children: /* @__PURE__ */ t.jsxs(
2605
+ return /* @__PURE__ */ t.jsx(ut, { close: () => i(!1), children: /* @__PURE__ */ t.jsxs(
2601
2606
  "div",
2602
2607
  {
2603
2608
  className: G.contentModal,
2604
- onClick: (l) => l.stopPropagation(),
2609
+ onClick: (c) => c.stopPropagation(),
2605
2610
  children: [
2606
2611
  /* @__PURE__ */ t.jsxs("div", { className: G.modalTop, children: [
2607
2612
  /* @__PURE__ */ t.jsx(
@@ -2613,29 +2618,30 @@ const ns = (u) => {
2613
2618
  }
2614
2619
  ),
2615
2620
  /* @__PURE__ */ t.jsx(
2616
- I,
2621
+ b,
2617
2622
  {
2618
2623
  name: "X",
2619
2624
  hoverable: !0,
2620
- onClick: y
2625
+ onClick: p,
2626
+ fill: "var(--text-primary)"
2621
2627
  }
2622
2628
  )
2623
2629
  ] }),
2624
- !_ && a && /* @__PURE__ */ t.jsx("div", { className: G.modalCards, children: a.map((l) => /* @__PURE__ */ t.jsxs(
2630
+ !j && g && /* @__PURE__ */ t.jsx("div", { className: G.modalCards, children: g.map((c) => /* @__PURE__ */ t.jsxs(
2625
2631
  "div",
2626
2632
  {
2627
2633
  className: G.card,
2628
2634
  children: [
2629
- /* @__PURE__ */ t.jsx("div", { children: l.productData.images[0] ? /* @__PURE__ */ t.jsx(
2635
+ /* @__PURE__ */ t.jsx("div", { children: c.productData.images[0] ? /* @__PURE__ */ t.jsx(
2630
2636
  "img",
2631
2637
  {
2632
- src: `https://imagedelivery.net/${l.productData.images[0].cfId}/w=500`,
2638
+ src: `https://imagedelivery.net/${c.productData.images[0].cfId}/w=500`,
2633
2639
  alt: "",
2634
2640
  width: 64,
2635
2641
  height: 64,
2636
2642
  className: G.modalImage
2637
2643
  }
2638
- ) : /* @__PURE__ */ t.jsx("div", { className: V(G.blockImage, G.modalImage), children: /* @__PURE__ */ t.jsx(I, { name: "Image" }) }) }),
2644
+ ) : /* @__PURE__ */ t.jsx("div", { className: H(G.blockImage, G.modalImage), children: /* @__PURE__ */ t.jsx(b, { name: "Image" }) }) }),
2639
2645
  /* @__PURE__ */ t.jsxs("div", { className: G.cardInfo, children: [
2640
2646
  /* @__PURE__ */ t.jsxs(
2641
2647
  "span",
@@ -2643,90 +2649,100 @@ const ns = (u) => {
2643
2649
  className: G.name,
2644
2650
  id: "h5",
2645
2651
  children: [
2646
- at(l.productData.name),
2652
+ at(c.productData.name),
2647
2653
  " $",
2648
- l.productData.minPrice.amount,
2654
+ c.productData.minPrice.amount,
2649
2655
  " ",
2650
2656
  "- $",
2651
- g(l)
2657
+ v(c)
2652
2658
  ]
2653
2659
  }
2654
2660
  ),
2655
- l.productData.shortDescription && /* @__PURE__ */ t.jsx(
2661
+ c.productData.shortDescription && /* @__PURE__ */ t.jsx(
2656
2662
  "span",
2657
2663
  {
2658
2664
  className: G.short,
2659
2665
  id: "md",
2660
- children: at(l.productData.shortDescription)
2666
+ children: at(c.productData.shortDescription)
2661
2667
  }
2662
2668
  ),
2663
2669
  /* @__PURE__ */ t.jsx("span", {})
2664
2670
  ] }),
2665
2671
  /* @__PURE__ */ t.jsxs("div", { className: G.cardButtons, children: [
2666
2672
  /* @__PURE__ */ t.jsx(
2667
- D,
2673
+ z,
2668
2674
  {
2669
2675
  type: "Secondary",
2670
2676
  onClick: () => {
2671
- e(l.id), n(!1), c(!0);
2677
+ e(c.id), i(!1), l(!0);
2672
2678
  },
2673
2679
  children: "Buy"
2674
2680
  }
2675
2681
  ),
2676
- /* @__PURE__ */ t.jsx(Mt, { path: `/product/${l.productData.uniquePath}`, children: /* @__PURE__ */ t.jsx(D, { type: "Primary", children: "View Details" }) })
2682
+ /* @__PURE__ */ t.jsx(Tt, { path: `/product/${c.productData.uniquePath}`, children: /* @__PURE__ */ t.jsx(
2683
+ z,
2684
+ {
2685
+ type: "Primary",
2686
+ style: { whiteSpace: "nowrap" },
2687
+ onClick: () => {
2688
+ r(!1), p();
2689
+ },
2690
+ children: "View Details"
2691
+ }
2692
+ ) })
2677
2693
  ] })
2678
2694
  ]
2679
2695
  },
2680
- l.id
2696
+ c.id
2681
2697
  )) }),
2682
- _ && /* @__PURE__ */ t.jsx("div", { className: G.loading, children: /* @__PURE__ */ t.jsx($t, {}) })
2698
+ j && /* @__PURE__ */ t.jsx("div", { className: G.loading, children: /* @__PURE__ */ t.jsx(Bt, {}) })
2683
2699
  ]
2684
2700
  }
2685
2701
  ) });
2686
2702
  };
2687
2703
  export {
2688
- Fn as Accordion,
2689
- zs as BurgerMenuButton,
2690
- D as Button,
2691
- Ae as ButtonTypeSettings,
2692
- Ln as ButtonsSettings,
2704
+ Hn as Accordion,
2705
+ Us as BurgerMenuButton,
2706
+ z as Button,
2707
+ qe as ButtonTypeSettings,
2708
+ zn as ButtonsSettings,
2693
2709
  qn as CategorySettings,
2694
- kt as ChargeTypes,
2695
- Et as ChooseImage,
2696
- Kn as ChooseImageModal,
2697
- Ls as EmptyCart,
2698
- Rn as FormSettings,
2699
- Xn as GroupCardModal,
2700
- zn as HeaderButtons,
2701
- I as Icon,
2710
+ $t as ChargeTypes,
2711
+ At as ChooseImage,
2712
+ Qn as ChooseImageModal,
2713
+ Rs as EmptyCart,
2714
+ En as FormSettings,
2715
+ Gn as GroupCardModal,
2716
+ Rn as HeaderButtons,
2717
+ b as Icon,
2702
2718
  Nt as InputSettings,
2703
- Lt as InputUI,
2704
- Zn as ItemsSettings,
2705
- En as LayoutSettings,
2706
- Mt as Link,
2707
- Un as ListingSelector,
2708
- $t as Loader,
2709
- Gn as MetaInfoPost,
2719
+ Rt as InputUI,
2720
+ Jn as ItemsSettings,
2721
+ On as LayoutSettings,
2722
+ Tt as Link,
2723
+ Dn as ListingSelector,
2724
+ Bt as Loader,
2725
+ Vn as MetaInfoPost,
2710
2726
  ut as Modal,
2711
- Vn as PagesMobileMenu,
2712
- Us as PagesMobileModal,
2713
- Dn as PagesSettings,
2714
- Yn as ProductCardButtons,
2715
- Wn as ProductCardModal,
2727
+ Ln as PagesMobileMenu,
2728
+ Ls as PagesMobileModal,
2729
+ An as PagesSettings,
2730
+ Fn as ProductCardButtons,
2731
+ Yn as ProductCardModal,
2716
2732
  ns as ProductOptions,
2717
- ti as RadioUI,
2718
- Pt as RangeSelector,
2733
+ Kn as RadioUI,
2734
+ kt as RangeSelector,
2719
2735
  it as Select,
2720
- ei as SelectInfiniteList,
2721
- si as SelectUI,
2722
- Hn as ShareLink,
2723
- Ds as ShoppingButton,
2724
- Rs as ShoppingModalCart,
2736
+ Zn as SelectInfiniteList,
2737
+ ti as SelectUI,
2738
+ Un as ShareLink,
2739
+ zs as ShoppingButton,
2740
+ Ds as ShoppingModalCart,
2725
2741
  lt as Switch,
2726
- ni as TextSettings,
2727
- ii as TextareaSettings,
2728
- ai as TextareaUI,
2729
- oi as TypesText,
2742
+ ei as TextSettings,
2743
+ si as TextareaSettings,
2744
+ ni as TextareaUI,
2745
+ ii as TypesText,
2730
2746
  Ot as UserInfo,
2731
- ci as Wrapper
2747
+ ai as Wrapper
2732
2748
  };