@billgangcom/theme-lib 1.77.0 → 1.77.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App.d.ts +1 -0
- package/dist/builder/store/useGeneralStore.d.ts +2 -0
- package/dist/builder.cjs.js +22 -22
- package/dist/builder.es.js +3985 -3983
- package/dist/{index-BvC-uIgG.cjs → index-DTMfv6J4.cjs} +23 -23
- package/dist/{index-DgKrIThY.js → index-hOdaaB_D.js} +3350 -3340
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +1 -1
- package/dist/pages/checkout/index.d.ts +1 -5
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +381 -378
- package/package.json +1 -1
package/dist/ui.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { j as t, I as j, d as U, e as Nt, g as mt, h as pt, P as gt, S as lt, i as
|
|
2
|
-
import { a1 as si, a5 as ni, $ as ii, Z as ai, a4 as oi, a3 as ci, Y as ri, _ as li, W as di, X as ui, a0 as hi, a2 as mi } from "./index-
|
|
1
|
+
import { j as t, I as j, d as U, e as Nt, g as mt, h as pt, P as gt, S as lt, i as kt, D as ft, k as xt, v as _t, B as dt, l as ot, a as wt, m as Tt, O as ht, n as J, o as yt, C as jt, p as V, q as At, r as Dt, t as bt, w as Et, x as vt, y as W, L as Rt, z as St, A as Ct, b as ct, s as at, f as Q, E as Lt, F as R, G as Ut, M as ut, H as Ht, J as rt, K as Mt, N as zt, Q as Bt, T as Ft, U as $t, V as Vt } from "./index-hOdaaB_D.js";
|
|
2
|
+
import { a1 as si, a5 as ni, $ as ii, Z as ai, a4 as oi, a3 as ci, Y as ri, _ as li, W as di, X as ui, a0 as hi, a2 as mi } from "./index-hOdaaB_D.js";
|
|
3
3
|
import g from "react";
|
|
4
4
|
import "react-dom";
|
|
5
5
|
const Yt = "_block_kh9z8_8", Gt = "_title_kh9z8_16", Wt = "_subtitle_kh9z8_23", Xt = "_alignmentContent_kh9z8_30", Qt = "_alignments_kh9z8_39", Jt = "_alignment_kh9z8_30", Kt = "_circle_kh9z8_64", Zt = "_paddings_kh9z8_71", te = "_padding_kh9z8_71", ee = "_active_kh9z8_97", G = {
|
|
@@ -62,7 +62,7 @@ const Yt = "_block_kh9z8_8", Gt = "_title_kh9z8_16", Wt = "_subtitle_kh9z8_23",
|
|
|
62
62
|
return "AlignBottom";
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
const [_,
|
|
65
|
+
const [_, M] = g.useState(null), [I, c] = g.useState(null);
|
|
66
66
|
return /* @__PURE__ */ t.jsxs("div", { className: G.layout, children: [
|
|
67
67
|
/* @__PURE__ */ t.jsx("h3", { className: G.title, children: "Layout (for Desktop version)" }),
|
|
68
68
|
/* @__PURE__ */ t.jsxs("div", { className: G.alignmentContent, children: [
|
|
@@ -76,10 +76,10 @@ const Yt = "_block_kh9z8_8", Gt = "_title_kh9z8_16", Wt = "_subtitle_kh9z8_23",
|
|
|
76
76
|
},
|
|
77
77
|
className: G.alignment,
|
|
78
78
|
onMouseEnter: () => {
|
|
79
|
-
|
|
79
|
+
M(l);
|
|
80
80
|
},
|
|
81
81
|
onMouseLeave: () => {
|
|
82
|
-
|
|
82
|
+
M(null);
|
|
83
83
|
},
|
|
84
84
|
children: [
|
|
85
85
|
l !== a && _ !== l && /* @__PURE__ */ t.jsx("div", { className: G.circle }),
|
|
@@ -200,7 +200,7 @@ const Un = (h) => {
|
|
|
200
200
|
title: d,
|
|
201
201
|
subtitle: f,
|
|
202
202
|
draggable: _ = !1,
|
|
203
|
-
withImage:
|
|
203
|
+
withImage: M = !1,
|
|
204
204
|
addable: I = !0,
|
|
205
205
|
itemsOptions: c,
|
|
206
206
|
hasRangeSelector: l = !1,
|
|
@@ -209,25 +209,25 @@ const Un = (h) => {
|
|
|
209
209
|
autoScrollInterval: m,
|
|
210
210
|
deletable: i,
|
|
211
211
|
aspectRatio: b,
|
|
212
|
-
setAspectRatio:
|
|
213
|
-
} = h,
|
|
212
|
+
setAspectRatio: P
|
|
213
|
+
} = h, A = mt(
|
|
214
214
|
pt(gt, {
|
|
215
215
|
activationConstraint: {
|
|
216
216
|
distance: 5
|
|
217
217
|
}
|
|
218
218
|
})
|
|
219
219
|
), E = (n) => {
|
|
220
|
-
const { active: N, over:
|
|
221
|
-
if (
|
|
222
|
-
const
|
|
223
|
-
if (
|
|
224
|
-
const
|
|
225
|
-
|
|
220
|
+
const { active: N, over: k } = n;
|
|
221
|
+
if (k && N.id !== k.id) {
|
|
222
|
+
const q = s.findIndex((S) => S === N.id), $ = s.findIndex((S) => S === k.id);
|
|
223
|
+
if (q !== -1 && $ !== -1) {
|
|
224
|
+
const S = [...s], [Z] = S.splice(q, 1);
|
|
225
|
+
S.splice($, 0, Z), r(S);
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
};
|
|
229
229
|
function K(n) {
|
|
230
|
-
if (
|
|
230
|
+
if (M)
|
|
231
231
|
return n ? /* @__PURE__ */ t.jsx(
|
|
232
232
|
"img",
|
|
233
233
|
{
|
|
@@ -246,10 +246,10 @@ const Un = (h) => {
|
|
|
246
246
|
}
|
|
247
247
|
);
|
|
248
248
|
}
|
|
249
|
-
const
|
|
250
|
-
const
|
|
251
|
-
if (!
|
|
252
|
-
const
|
|
249
|
+
const L = (n, N = !1) => {
|
|
250
|
+
const k = c.find(($) => $.id === n);
|
|
251
|
+
if (!k) return;
|
|
252
|
+
const q = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
253
253
|
_ && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
254
254
|
j,
|
|
255
255
|
{
|
|
@@ -262,17 +262,17 @@ const Un = (h) => {
|
|
|
262
262
|
/* @__PURE__ */ t.jsx(
|
|
263
263
|
ot,
|
|
264
264
|
{
|
|
265
|
-
onChange: (
|
|
266
|
-
const
|
|
267
|
-
if (!
|
|
268
|
-
const
|
|
269
|
-
r([...
|
|
265
|
+
onChange: ($) => {
|
|
266
|
+
const S = [...s], Z = c.find((p) => p.name === $);
|
|
267
|
+
if (!Z) return;
|
|
268
|
+
const v = Z.id, D = S.map((p) => p === n ? v : p);
|
|
269
|
+
r([...D]);
|
|
270
270
|
},
|
|
271
|
-
value:
|
|
272
|
-
options: c.filter((
|
|
273
|
-
leftAddonOptions: c.map((
|
|
274
|
-
value:
|
|
275
|
-
addon: K(
|
|
271
|
+
value: k.name,
|
|
272
|
+
options: c.filter(($) => !s.find((S) => S === $.id)).map(($) => $.name),
|
|
273
|
+
leftAddonOptions: c.map(($) => ({
|
|
274
|
+
value: $.name,
|
|
275
|
+
addon: K($.images)
|
|
276
276
|
}))
|
|
277
277
|
}
|
|
278
278
|
),
|
|
@@ -284,7 +284,7 @@ const Un = (h) => {
|
|
|
284
284
|
width: 20,
|
|
285
285
|
height: 20,
|
|
286
286
|
fill: "#C12A2A",
|
|
287
|
-
onClick: () => r(s.filter((
|
|
287
|
+
onClick: () => r(s.filter(($) => $ !== n))
|
|
288
288
|
}
|
|
289
289
|
) }) })
|
|
290
290
|
] });
|
|
@@ -292,14 +292,14 @@ const Un = (h) => {
|
|
|
292
292
|
ge,
|
|
293
293
|
{
|
|
294
294
|
id: n,
|
|
295
|
-
children:
|
|
295
|
+
children: q
|
|
296
296
|
},
|
|
297
297
|
J()
|
|
298
298
|
) : /* @__PURE__ */ t.jsx(
|
|
299
299
|
"div",
|
|
300
300
|
{
|
|
301
301
|
className: X.product,
|
|
302
|
-
children:
|
|
302
|
+
children: q
|
|
303
303
|
},
|
|
304
304
|
J()
|
|
305
305
|
);
|
|
@@ -315,24 +315,24 @@ const Un = (h) => {
|
|
|
315
315
|
}
|
|
316
316
|
)
|
|
317
317
|
] }),
|
|
318
|
-
l && y && /* @__PURE__ */ t.jsx(
|
|
318
|
+
l && y && /* @__PURE__ */ t.jsx(kt, { ...y }),
|
|
319
319
|
/* @__PURE__ */ t.jsxs("div", { className: X.products, children: [
|
|
320
320
|
f && /* @__PURE__ */ t.jsx("h5", { className: X.subtitle, children: f }),
|
|
321
321
|
_ ? /* @__PURE__ */ t.jsx(
|
|
322
322
|
ft,
|
|
323
323
|
{
|
|
324
|
-
sensors:
|
|
324
|
+
sensors: A,
|
|
325
325
|
onDragEnd: E,
|
|
326
326
|
children: /* @__PURE__ */ t.jsx(
|
|
327
327
|
xt,
|
|
328
328
|
{
|
|
329
329
|
items: s,
|
|
330
330
|
strategy: _t,
|
|
331
|
-
children: s.map((n) =>
|
|
331
|
+
children: s.map((n) => L(n, i))
|
|
332
332
|
}
|
|
333
333
|
)
|
|
334
334
|
}
|
|
335
|
-
) : s.map((n) =>
|
|
335
|
+
) : s.map((n) => L(n, i)),
|
|
336
336
|
I && /* @__PURE__ */ t.jsx(
|
|
337
337
|
"div",
|
|
338
338
|
{
|
|
@@ -355,9 +355,9 @@ const Un = (h) => {
|
|
|
355
355
|
const n = [...s];
|
|
356
356
|
let N = null;
|
|
357
357
|
if (c) {
|
|
358
|
-
for (let
|
|
359
|
-
if (!s.find((
|
|
360
|
-
N = c[
|
|
358
|
+
for (let k = 0; k < c.length; k++)
|
|
359
|
+
if (!s.find((q) => q === c[k].id)) {
|
|
360
|
+
N = c[k];
|
|
361
361
|
break;
|
|
362
362
|
}
|
|
363
363
|
}
|
|
@@ -382,13 +382,13 @@ const Un = (h) => {
|
|
|
382
382
|
}
|
|
383
383
|
)
|
|
384
384
|
] }),
|
|
385
|
-
b &&
|
|
385
|
+
b && P && /* @__PURE__ */ t.jsx(
|
|
386
386
|
ot,
|
|
387
387
|
{
|
|
388
388
|
value: b,
|
|
389
389
|
label: "Aspect Ratio",
|
|
390
390
|
options: Object.keys(Tt),
|
|
391
|
-
onChange: (n) =>
|
|
391
|
+
onChange: (n) => P(n),
|
|
392
392
|
leftAddonOptions: wt
|
|
393
393
|
}
|
|
394
394
|
),
|
|
@@ -422,7 +422,7 @@ const Un = (h) => {
|
|
|
422
422
|
}
|
|
423
423
|
)
|
|
424
424
|
] });
|
|
425
|
-
}, fe = "_title_roi3a_1", xe = "_subtitle_roi3a_5", _e = "_productsBlock_roi3a_14", ye = "_top_roi3a_26", je = "_products_roi3a_14", be = "_product_roi3a_14", ve = "_button_roi3a_80", Ie = "_disabled_roi3a_91", Ne = "_buttons_roi3a_118",
|
|
425
|
+
}, fe = "_title_roi3a_1", xe = "_subtitle_roi3a_5", _e = "_productsBlock_roi3a_14", ye = "_top_roi3a_26", je = "_products_roi3a_14", be = "_product_roi3a_14", ve = "_button_roi3a_80", Ie = "_disabled_roi3a_91", Ne = "_buttons_roi3a_118", Se = "_addButton_roi3a_164", Ce = "_deleteButton_roi3a_179", Y = {
|
|
426
426
|
title: fe,
|
|
427
427
|
subtitle: xe,
|
|
428
428
|
productsBlock: _e,
|
|
@@ -432,10 +432,10 @@ const Un = (h) => {
|
|
|
432
432
|
button: ve,
|
|
433
433
|
disabled: Ie,
|
|
434
434
|
buttons: Ne,
|
|
435
|
-
addButton:
|
|
436
|
-
deleteButton:
|
|
435
|
+
addButton: Se,
|
|
436
|
+
deleteButton: Ce
|
|
437
437
|
};
|
|
438
|
-
function
|
|
438
|
+
function Pe({ product: h, children: a }) {
|
|
439
439
|
const {
|
|
440
440
|
attributes: o,
|
|
441
441
|
listeners: s,
|
|
@@ -472,12 +472,12 @@ const Hn = (h) => {
|
|
|
472
472
|
editable: d = !0,
|
|
473
473
|
draggable: f = !1,
|
|
474
474
|
deletable: _ = !0,
|
|
475
|
-
addable:
|
|
475
|
+
addable: M = !0,
|
|
476
476
|
itemsType: I,
|
|
477
477
|
itemsOptions: c,
|
|
478
478
|
addableOptions: l = {},
|
|
479
479
|
limit: y
|
|
480
|
-
} = h, [x, m] = g.useState(null), [i, b] = g.useState(null),
|
|
480
|
+
} = h, [x, m] = g.useState(null), [i, b] = g.useState(null), P = g.useRef(null), A = mt(
|
|
481
481
|
pt(gt, {
|
|
482
482
|
activationConstraint: {
|
|
483
483
|
distance: 5
|
|
@@ -490,26 +490,26 @@ const Hn = (h) => {
|
|
|
490
490
|
r(n);
|
|
491
491
|
}
|
|
492
492
|
}, [x]), g.useEffect(() => {
|
|
493
|
-
|
|
494
|
-
}, [
|
|
493
|
+
P.current && i && (P.current.getBoundingClientRect().height, i.top);
|
|
494
|
+
}, [P.current, i]);
|
|
495
495
|
const E = (n, N) => {
|
|
496
496
|
n.stopPropagation();
|
|
497
|
-
const
|
|
497
|
+
const k = n.target.getBoundingClientRect();
|
|
498
498
|
b({
|
|
499
|
-
top:
|
|
500
|
-
left:
|
|
499
|
+
top: k.top + window.scrollY,
|
|
500
|
+
left: k.left - 30
|
|
501
501
|
}), m(N);
|
|
502
502
|
}, K = (n) => {
|
|
503
|
-
const { active: N, over:
|
|
504
|
-
if (
|
|
505
|
-
const
|
|
506
|
-
if (
|
|
507
|
-
const
|
|
508
|
-
|
|
503
|
+
const { active: N, over: k } = n;
|
|
504
|
+
if (k && N.id !== k.id) {
|
|
505
|
+
const q = s.findIndex((S) => S.id === N.id), $ = s.findIndex((S) => S.id === k.id);
|
|
506
|
+
if (q !== -1 && $ !== -1) {
|
|
507
|
+
const S = [...s], [Z] = S.splice(q, 1);
|
|
508
|
+
S.splice($, 0, Z), r(S);
|
|
509
509
|
}
|
|
510
510
|
}
|
|
511
|
-
},
|
|
512
|
-
const
|
|
511
|
+
}, L = (n, N) => {
|
|
512
|
+
const k = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
513
513
|
f && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
514
514
|
j,
|
|
515
515
|
{
|
|
@@ -522,24 +522,24 @@ const Hn = (h) => {
|
|
|
522
522
|
I === "select" && c && /* @__PURE__ */ t.jsx(
|
|
523
523
|
ot,
|
|
524
524
|
{
|
|
525
|
-
onChange: (
|
|
526
|
-
const
|
|
527
|
-
if (!
|
|
528
|
-
const
|
|
529
|
-
...
|
|
525
|
+
onChange: (q) => {
|
|
526
|
+
const $ = [...s], S = c.find((v) => v.name === q);
|
|
527
|
+
if (!S) return;
|
|
528
|
+
const Z = $.map((v) => v.id === n.id ? {
|
|
529
|
+
...S,
|
|
530
530
|
name: {
|
|
531
|
-
"en-US":
|
|
531
|
+
"en-US": q
|
|
532
532
|
}
|
|
533
|
-
} :
|
|
533
|
+
} : v);
|
|
534
534
|
m({
|
|
535
535
|
...n,
|
|
536
536
|
name: {
|
|
537
|
-
"en-US":
|
|
537
|
+
"en-US": q
|
|
538
538
|
}
|
|
539
|
-
}), r([...
|
|
539
|
+
}), r([...Z]);
|
|
540
540
|
},
|
|
541
541
|
value: n.name,
|
|
542
|
-
options: c.filter((
|
|
542
|
+
options: c.filter((q) => !s.find(($) => $.name === q.name)).map((q) => q.name)
|
|
543
543
|
}
|
|
544
544
|
),
|
|
545
545
|
/* @__PURE__ */ t.jsxs("div", { className: Y.buttons, children: [
|
|
@@ -550,7 +550,7 @@ const Hn = (h) => {
|
|
|
550
550
|
hoverable: !0,
|
|
551
551
|
width: 20,
|
|
552
552
|
height: 20,
|
|
553
|
-
onClick: (
|
|
553
|
+
onClick: (q) => E(q, n)
|
|
554
554
|
}
|
|
555
555
|
) }),
|
|
556
556
|
_ && /* @__PURE__ */ t.jsx("div", { className: Y.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
@@ -561,24 +561,24 @@ const Hn = (h) => {
|
|
|
561
561
|
width: 20,
|
|
562
562
|
height: 20,
|
|
563
563
|
fill: "#C12A2A",
|
|
564
|
-
onClick: () => r(s.filter((
|
|
564
|
+
onClick: () => r(s.filter((q) => q.id !== n.id))
|
|
565
565
|
}
|
|
566
566
|
) })
|
|
567
567
|
] })
|
|
568
568
|
] });
|
|
569
569
|
return f ? /* @__PURE__ */ t.jsx(
|
|
570
|
-
|
|
570
|
+
Pe,
|
|
571
571
|
{
|
|
572
572
|
product: n,
|
|
573
573
|
index: N,
|
|
574
|
-
children:
|
|
574
|
+
children: k
|
|
575
575
|
},
|
|
576
576
|
n.id
|
|
577
577
|
) : /* @__PURE__ */ t.jsx(
|
|
578
578
|
"div",
|
|
579
579
|
{
|
|
580
580
|
className: Y.product,
|
|
581
|
-
children:
|
|
581
|
+
children: k
|
|
582
582
|
},
|
|
583
583
|
n.id
|
|
584
584
|
);
|
|
@@ -599,19 +599,19 @@ const Hn = (h) => {
|
|
|
599
599
|
f ? /* @__PURE__ */ t.jsx(
|
|
600
600
|
ft,
|
|
601
601
|
{
|
|
602
|
-
sensors:
|
|
602
|
+
sensors: A,
|
|
603
603
|
onDragEnd: K,
|
|
604
604
|
children: /* @__PURE__ */ t.jsx(
|
|
605
605
|
xt,
|
|
606
606
|
{
|
|
607
607
|
items: s.map((n) => n.id),
|
|
608
608
|
strategy: _t,
|
|
609
|
-
children: s.map((n, N) =>
|
|
609
|
+
children: s.map((n, N) => L(n, N))
|
|
610
610
|
}
|
|
611
611
|
)
|
|
612
612
|
}
|
|
613
|
-
) : s.map((n, N) =>
|
|
614
|
-
|
|
613
|
+
) : s.map((n, N) => L(n, N)),
|
|
614
|
+
M && /* @__PURE__ */ t.jsx(
|
|
615
615
|
"div",
|
|
616
616
|
{
|
|
617
617
|
style: {
|
|
@@ -632,9 +632,9 @@ const Hn = (h) => {
|
|
|
632
632
|
const n = [...s];
|
|
633
633
|
let N = null;
|
|
634
634
|
if (c) {
|
|
635
|
-
for (let
|
|
636
|
-
if (!s.find((
|
|
637
|
-
N = c[
|
|
635
|
+
for (let k = 0; k < c.length; k++)
|
|
636
|
+
if (!s.find((q) => q.id === c[k].id)) {
|
|
637
|
+
N = c[k];
|
|
638
638
|
break;
|
|
639
639
|
}
|
|
640
640
|
}
|
|
@@ -665,7 +665,7 @@ const Hn = (h) => {
|
|
|
665
665
|
] })
|
|
666
666
|
] });
|
|
667
667
|
};
|
|
668
|
-
function
|
|
668
|
+
function ke(h) {
|
|
669
669
|
const { product: a, children: o } = h, { attributes: s, listeners: r, setNodeRef: e, transform: u, transition: d, isDragging: f } = yt({
|
|
670
670
|
id: a.id
|
|
671
671
|
}), _ = {
|
|
@@ -695,7 +695,7 @@ const zn = (h) => {
|
|
|
695
695
|
subtitle: d,
|
|
696
696
|
editable: f = !0,
|
|
697
697
|
draggable: _ = !1,
|
|
698
|
-
deletable:
|
|
698
|
+
deletable: M = !0,
|
|
699
699
|
addable: I = !0,
|
|
700
700
|
itemsType: c,
|
|
701
701
|
itemsPlaceholder: l = "",
|
|
@@ -704,11 +704,11 @@ const zn = (h) => {
|
|
|
704
704
|
rangeSelectorOptions: m,
|
|
705
705
|
modalOptions: i,
|
|
706
706
|
addableOptions: b = {},
|
|
707
|
-
limit:
|
|
708
|
-
} = h, [
|
|
707
|
+
limit: P
|
|
708
|
+
} = h, [A, E] = g.useState(null), [K, L] = g.useState({
|
|
709
709
|
top: 0,
|
|
710
710
|
left: 0
|
|
711
|
-
}), [n, N] = g.useState(null),
|
|
711
|
+
}), [n, N] = g.useState(null), k = g.useRef(null), [q, $] = g.useState(!1), S = mt(
|
|
712
712
|
pt(gt, {
|
|
713
713
|
activationConstraint: {
|
|
714
714
|
distance: 5
|
|
@@ -717,45 +717,45 @@ const zn = (h) => {
|
|
|
717
717
|
);
|
|
718
718
|
g.useEffect(() => {
|
|
719
719
|
const p = () => {
|
|
720
|
-
E(null),
|
|
720
|
+
E(null), $(!1);
|
|
721
721
|
};
|
|
722
|
-
return document.body.addEventListener("click", p), E(null),
|
|
723
|
-
E(null),
|
|
722
|
+
return document.body.addEventListener("click", p), E(null), $(!1), () => {
|
|
723
|
+
E(null), $(!1), document.body.removeEventListener("click", p);
|
|
724
724
|
};
|
|
725
725
|
}, []), g.useEffect(() => {
|
|
726
|
-
if (
|
|
727
|
-
const p = [...s].map((
|
|
726
|
+
if (A) {
|
|
727
|
+
const p = [...s].map((C) => C.id === A.id ? A : C);
|
|
728
728
|
r(p);
|
|
729
729
|
}
|
|
730
|
-
}, [
|
|
731
|
-
if (
|
|
732
|
-
const p =
|
|
733
|
-
let
|
|
734
|
-
|
|
735
|
-
top:
|
|
730
|
+
}, [A]), g.useEffect(() => {
|
|
731
|
+
if (k.current && n) {
|
|
732
|
+
const p = k.current.getBoundingClientRect().height, C = window.innerHeight;
|
|
733
|
+
let B = n.top;
|
|
734
|
+
B + p > C + window.scrollY - 200 && (B = C + window.scrollY - p - 200), B < 0 && (B = 10), L({
|
|
735
|
+
top: B,
|
|
736
736
|
left: n.left
|
|
737
737
|
});
|
|
738
738
|
}
|
|
739
|
-
}, [
|
|
740
|
-
const
|
|
739
|
+
}, [k.current, n]);
|
|
740
|
+
const Z = (p, C) => {
|
|
741
741
|
p.stopPropagation();
|
|
742
|
-
const
|
|
742
|
+
const B = p.target.getBoundingClientRect();
|
|
743
743
|
N({
|
|
744
|
-
top:
|
|
745
|
-
left:
|
|
746
|
-
}), E(
|
|
747
|
-
},
|
|
748
|
-
const { active:
|
|
749
|
-
if (
|
|
750
|
-
const
|
|
751
|
-
if (
|
|
752
|
-
const
|
|
753
|
-
|
|
744
|
+
top: B.top + window.scrollY,
|
|
745
|
+
left: B.left - 30
|
|
746
|
+
}), E(C), $(!0);
|
|
747
|
+
}, v = (p) => {
|
|
748
|
+
const { active: C, over: B } = p;
|
|
749
|
+
if (B && C.id !== B.id) {
|
|
750
|
+
const T = s.findIndex((z) => z.id === C.id), tt = s.findIndex((z) => z.id === B.id);
|
|
751
|
+
if (T !== -1 && tt !== -1) {
|
|
752
|
+
const z = [...s], [F] = z.splice(T, 1);
|
|
753
|
+
z.splice(tt, 0, F), r(z);
|
|
754
754
|
}
|
|
755
755
|
}
|
|
756
|
-
},
|
|
757
|
-
var
|
|
758
|
-
const
|
|
756
|
+
}, D = (p) => {
|
|
757
|
+
var B;
|
|
758
|
+
const C = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
759
759
|
_ && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
760
760
|
j,
|
|
761
761
|
{
|
|
@@ -768,37 +768,37 @@ const zn = (h) => {
|
|
|
768
768
|
c === "select" && y && /* @__PURE__ */ t.jsx(
|
|
769
769
|
ot,
|
|
770
770
|
{
|
|
771
|
-
onChange: (
|
|
772
|
-
const
|
|
771
|
+
onChange: (T) => {
|
|
772
|
+
const z = [...s].map((F) => F.id === p.id ? {
|
|
773
773
|
...p,
|
|
774
774
|
name: {
|
|
775
|
-
"en-US":
|
|
775
|
+
"en-US": T
|
|
776
776
|
}
|
|
777
|
-
} :
|
|
777
|
+
} : F);
|
|
778
778
|
E({
|
|
779
779
|
...p,
|
|
780
780
|
name: {
|
|
781
|
-
"en-US":
|
|
781
|
+
"en-US": T
|
|
782
782
|
}
|
|
783
|
-
}), r([...
|
|
783
|
+
}), r([...z]);
|
|
784
784
|
},
|
|
785
785
|
value: p.name["en-US"],
|
|
786
786
|
options: y.filter(
|
|
787
|
-
(
|
|
787
|
+
(T) => !s.find((tt) => tt.name["en-US"] === T)
|
|
788
788
|
)
|
|
789
789
|
}
|
|
790
790
|
),
|
|
791
791
|
c === "input" && /* @__PURE__ */ t.jsx(
|
|
792
792
|
Nt,
|
|
793
793
|
{
|
|
794
|
-
onChange: (
|
|
795
|
-
const
|
|
794
|
+
onChange: (T) => {
|
|
795
|
+
const z = [...s].map((F) => F.id === p.id ? {
|
|
796
796
|
...p,
|
|
797
797
|
name: {
|
|
798
|
-
"en-US":
|
|
798
|
+
"en-US": T
|
|
799
799
|
}
|
|
800
|
-
} :
|
|
801
|
-
r([...
|
|
800
|
+
} : F);
|
|
801
|
+
r([...z]);
|
|
802
802
|
},
|
|
803
803
|
value: p.name["en-US"],
|
|
804
804
|
placeholder: l
|
|
@@ -807,14 +807,14 @@ const zn = (h) => {
|
|
|
807
807
|
c === "image" && /* @__PURE__ */ t.jsx(
|
|
808
808
|
Dt,
|
|
809
809
|
{
|
|
810
|
-
onChange: (
|
|
811
|
-
const
|
|
810
|
+
onChange: (T) => {
|
|
811
|
+
const z = [...s].map((F) => F.id === p.id ? {
|
|
812
812
|
...p,
|
|
813
|
-
images:
|
|
814
|
-
} :
|
|
815
|
-
r([...
|
|
813
|
+
images: T
|
|
814
|
+
} : F);
|
|
815
|
+
r([...z]);
|
|
816
816
|
},
|
|
817
|
-
activeImage: (
|
|
817
|
+
activeImage: (B = s.find((T) => T.id === p.id)) == null ? void 0 : B.images[0]
|
|
818
818
|
}
|
|
819
819
|
),
|
|
820
820
|
/* @__PURE__ */ t.jsxs("div", { className: V.buttons, children: [
|
|
@@ -825,10 +825,10 @@ const zn = (h) => {
|
|
|
825
825
|
hoverable: !0,
|
|
826
826
|
width: 20,
|
|
827
827
|
height: 20,
|
|
828
|
-
onClick: (
|
|
828
|
+
onClick: (T) => Z(T, p)
|
|
829
829
|
}
|
|
830
830
|
) }),
|
|
831
|
-
|
|
831
|
+
M && /* @__PURE__ */ t.jsx("div", { className: V.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
832
832
|
j,
|
|
833
833
|
{
|
|
834
834
|
name: "Trash",
|
|
@@ -836,23 +836,23 @@ const zn = (h) => {
|
|
|
836
836
|
width: 20,
|
|
837
837
|
height: 20,
|
|
838
838
|
fill: "#C12A2A",
|
|
839
|
-
onClick: () => r(s.filter((
|
|
839
|
+
onClick: () => r(s.filter((T) => T.id !== p.id))
|
|
840
840
|
}
|
|
841
841
|
) })
|
|
842
842
|
] })
|
|
843
843
|
] });
|
|
844
844
|
return _ ? /* @__PURE__ */ t.jsx(
|
|
845
|
-
|
|
845
|
+
ke,
|
|
846
846
|
{
|
|
847
847
|
product: p,
|
|
848
|
-
children:
|
|
848
|
+
children: C
|
|
849
849
|
},
|
|
850
850
|
p.id
|
|
851
851
|
) : /* @__PURE__ */ t.jsx(
|
|
852
852
|
"div",
|
|
853
853
|
{
|
|
854
854
|
className: V.product,
|
|
855
|
-
children:
|
|
855
|
+
children: C
|
|
856
856
|
},
|
|
857
857
|
p.id
|
|
858
858
|
);
|
|
@@ -868,35 +868,35 @@ const zn = (h) => {
|
|
|
868
868
|
}
|
|
869
869
|
)
|
|
870
870
|
] }),
|
|
871
|
-
|
|
871
|
+
A && f && i && q && /* @__PURE__ */ t.jsx(
|
|
872
872
|
At,
|
|
873
873
|
{
|
|
874
|
-
ref:
|
|
875
|
-
activeItem:
|
|
874
|
+
ref: k,
|
|
875
|
+
activeItem: A,
|
|
876
876
|
setActiveItem: E,
|
|
877
877
|
popupPosition: K,
|
|
878
878
|
modalOptions: i,
|
|
879
|
-
setIsOpenModal:
|
|
879
|
+
setIsOpenModal: $
|
|
880
880
|
}
|
|
881
881
|
),
|
|
882
|
-
x && m && /* @__PURE__ */ t.jsx(
|
|
882
|
+
x && m && /* @__PURE__ */ t.jsx(kt, { ...m }),
|
|
883
883
|
/* @__PURE__ */ t.jsxs("div", { className: V.products, children: [
|
|
884
884
|
d && /* @__PURE__ */ t.jsx("h5", { className: V.subtitle, children: d }),
|
|
885
885
|
_ ? /* @__PURE__ */ t.jsx(
|
|
886
886
|
ft,
|
|
887
887
|
{
|
|
888
|
-
sensors:
|
|
889
|
-
onDragEnd:
|
|
888
|
+
sensors: S,
|
|
889
|
+
onDragEnd: v,
|
|
890
890
|
children: /* @__PURE__ */ t.jsx(
|
|
891
891
|
xt,
|
|
892
892
|
{
|
|
893
893
|
items: s.map((p) => p.id),
|
|
894
894
|
strategy: _t,
|
|
895
|
-
children: s.map((p) =>
|
|
895
|
+
children: s.map((p) => D(p))
|
|
896
896
|
}
|
|
897
897
|
)
|
|
898
898
|
}
|
|
899
|
-
) : s.map((p) =>
|
|
899
|
+
) : s.map((p) => D(p)),
|
|
900
900
|
I && /* @__PURE__ */ t.jsx(
|
|
901
901
|
"div",
|
|
902
902
|
{
|
|
@@ -910,23 +910,23 @@ const zn = (h) => {
|
|
|
910
910
|
{
|
|
911
911
|
withoutHover: !0,
|
|
912
912
|
className: U(V.button, {
|
|
913
|
-
[V.disabled]: !!(
|
|
913
|
+
[V.disabled]: !!(P && P <= s.length)
|
|
914
914
|
}),
|
|
915
915
|
size: "s",
|
|
916
|
-
disabled: !!(
|
|
916
|
+
disabled: !!(P && P <= s.length),
|
|
917
917
|
onClick: () => {
|
|
918
918
|
const p = [...s];
|
|
919
|
-
let
|
|
919
|
+
let C = null;
|
|
920
920
|
if (y) {
|
|
921
|
-
for (let
|
|
922
|
-
if (!s.find((
|
|
923
|
-
|
|
921
|
+
for (let B = 0; B < y.length; B++)
|
|
922
|
+
if (!s.find((T) => T.name["en-US"] === y[B])) {
|
|
923
|
+
C = y[B];
|
|
924
924
|
break;
|
|
925
925
|
}
|
|
926
926
|
}
|
|
927
927
|
c === "select" && y ? p.push({
|
|
928
928
|
name: {
|
|
929
|
-
"en-US":
|
|
929
|
+
"en-US": C || y[0]
|
|
930
930
|
},
|
|
931
931
|
id: J(),
|
|
932
932
|
...b,
|
|
@@ -984,7 +984,7 @@ const zn = (h) => {
|
|
|
984
984
|
addButton: Oe,
|
|
985
985
|
deleteButton: qe
|
|
986
986
|
}, Ae = (h) => {
|
|
987
|
-
const { buttons: a, setButtons: o, deletable: s = !0, addable: r = !0, editableLink: e = !0 } = h, { pages: u } = bt(), [d, f] = g.useState(null), [_,
|
|
987
|
+
const { buttons: a, setButtons: o, deletable: s = !0, addable: r = !0, editableLink: e = !0 } = h, { pages: u } = bt(), [d, f] = g.useState(null), [_, M] = g.useState({
|
|
988
988
|
top: 0,
|
|
989
989
|
left: 0
|
|
990
990
|
}), [I, c] = g.useState(null), l = g.useRef(null);
|
|
@@ -997,7 +997,7 @@ const zn = (h) => {
|
|
|
997
997
|
if (l.current && I) {
|
|
998
998
|
const m = l.current.getBoundingClientRect().height, i = window.innerHeight;
|
|
999
999
|
let b = I.top;
|
|
1000
|
-
b + m > i + window.scrollY - 200 && (b = i + window.scrollY - m - 200), b < 0 && (b = 10),
|
|
1000
|
+
b + m > i + window.scrollY - 200 && (b = i + window.scrollY - m - 200), b < 0 && (b = 10), M({
|
|
1001
1001
|
top: b,
|
|
1002
1002
|
left: I.left
|
|
1003
1003
|
});
|
|
@@ -1011,12 +1011,12 @@ const zn = (h) => {
|
|
|
1011
1011
|
left: b.left - (r ? 30 : 65)
|
|
1012
1012
|
}), f(i);
|
|
1013
1013
|
}, x = (m, i) => {
|
|
1014
|
-
const b = [...a],
|
|
1014
|
+
const b = [...a], P = {
|
|
1015
1015
|
...m,
|
|
1016
1016
|
id: Math.random().toString(36).substr(2, 9)
|
|
1017
1017
|
// Генерируем новый уникальный ID
|
|
1018
1018
|
};
|
|
1019
|
-
b.splice(i + 1, 0,
|
|
1019
|
+
b.splice(i + 1, 0, P), o(b);
|
|
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" }),
|
|
@@ -1029,11 +1029,11 @@ const zn = (h) => {
|
|
|
1029
1029
|
ot,
|
|
1030
1030
|
{
|
|
1031
1031
|
onChange: (b) => {
|
|
1032
|
-
const
|
|
1032
|
+
const A = [...a].map((E) => E.id === m.id ? {
|
|
1033
1033
|
...m,
|
|
1034
1034
|
type: b
|
|
1035
1035
|
} : E);
|
|
1036
|
-
o(
|
|
1036
|
+
o(A);
|
|
1037
1037
|
},
|
|
1038
1038
|
value: m.type,
|
|
1039
1039
|
options: ["Primary", "Secondary", "Tertiary"]
|
|
@@ -1070,7 +1070,7 @@ const zn = (h) => {
|
|
|
1070
1070
|
name: "Trash",
|
|
1071
1071
|
hoverable: !0,
|
|
1072
1072
|
onClick: () => {
|
|
1073
|
-
const b = a.filter((
|
|
1073
|
+
const b = a.filter((P) => P.id !== m.id);
|
|
1074
1074
|
o(b);
|
|
1075
1075
|
},
|
|
1076
1076
|
width: 20,
|
|
@@ -1213,7 +1213,7 @@ const Vn = (h) => {
|
|
|
1213
1213
|
subtitle: d,
|
|
1214
1214
|
editable: f = !0,
|
|
1215
1215
|
draggable: _ = !1,
|
|
1216
|
-
withImage:
|
|
1216
|
+
withImage: M = !1,
|
|
1217
1217
|
deletable: I = !0,
|
|
1218
1218
|
addable: c = !0,
|
|
1219
1219
|
itemsType: l,
|
|
@@ -1221,12 +1221,12 @@ const Vn = (h) => {
|
|
|
1221
1221
|
limit: x,
|
|
1222
1222
|
aspectRatio: m,
|
|
1223
1223
|
setAspectRatio: i
|
|
1224
|
-
} = h, [b,
|
|
1224
|
+
} = h, [b, P] = g.useState(
|
|
1225
1225
|
null
|
|
1226
|
-
), [
|
|
1226
|
+
), [A, E] = g.useState({
|
|
1227
1227
|
top: 0,
|
|
1228
1228
|
left: 0
|
|
1229
|
-
}), [K,
|
|
1229
|
+
}), [K, L] = g.useState(!1), n = mt(
|
|
1230
1230
|
pt(gt, {
|
|
1231
1231
|
activationConstraint: {
|
|
1232
1232
|
distance: 5
|
|
@@ -1235,28 +1235,28 @@ const Vn = (h) => {
|
|
|
1235
1235
|
);
|
|
1236
1236
|
g.useEffect(() => {
|
|
1237
1237
|
const v = () => {
|
|
1238
|
-
|
|
1238
|
+
P(null), L(!1);
|
|
1239
1239
|
};
|
|
1240
|
-
return document.body.addEventListener("click", v),
|
|
1241
|
-
|
|
1240
|
+
return document.body.addEventListener("click", v), P(null), L(!1), () => {
|
|
1241
|
+
P(null), L(!1), document.body.removeEventListener("click", v);
|
|
1242
1242
|
};
|
|
1243
1243
|
}, []), g.useEffect(() => {
|
|
1244
1244
|
if (b) {
|
|
1245
|
-
const v = [...s].map((
|
|
1245
|
+
const v = [...s].map((D) => D.listingId === b.listingId ? b : D);
|
|
1246
1246
|
r(v);
|
|
1247
1247
|
}
|
|
1248
1248
|
}, [b]);
|
|
1249
|
-
const N = (v,
|
|
1249
|
+
const N = (v, D) => {
|
|
1250
1250
|
v.stopPropagation();
|
|
1251
|
-
const
|
|
1252
|
-
let
|
|
1253
|
-
|
|
1254
|
-
top:
|
|
1255
|
-
left:
|
|
1256
|
-
}),
|
|
1251
|
+
const p = v.target.getBoundingClientRect(), C = 100, B = window.innerHeight;
|
|
1252
|
+
let T = p.top + window.scrollY;
|
|
1253
|
+
T + C > B && (T = B - C - 20), L(!0), E({
|
|
1254
|
+
top: T - 80,
|
|
1255
|
+
left: p.left - 30
|
|
1256
|
+
}), P(D);
|
|
1257
1257
|
};
|
|
1258
|
-
function
|
|
1259
|
-
if (
|
|
1258
|
+
function k(v) {
|
|
1259
|
+
if (M)
|
|
1260
1260
|
return v ? /* @__PURE__ */ t.jsx(
|
|
1261
1261
|
"img",
|
|
1262
1262
|
{
|
|
@@ -1275,19 +1275,21 @@ const Vn = (h) => {
|
|
|
1275
1275
|
}
|
|
1276
1276
|
);
|
|
1277
1277
|
}
|
|
1278
|
-
const
|
|
1279
|
-
const { active:
|
|
1280
|
-
if (
|
|
1281
|
-
const
|
|
1282
|
-
if (
|
|
1283
|
-
const
|
|
1284
|
-
|
|
1278
|
+
const q = (v) => {
|
|
1279
|
+
const { active: D, over: p } = v;
|
|
1280
|
+
if (p && D.id !== p.id) {
|
|
1281
|
+
const C = s.findIndex((T) => String(T.listingId) === D.id), B = s.findIndex((T) => String(T.listingId) === p.id);
|
|
1282
|
+
if (C !== -1 && B !== -1) {
|
|
1283
|
+
const T = [...s], [tt] = T.splice(C, 1);
|
|
1284
|
+
T.splice(B, 0, tt), r(T);
|
|
1285
1285
|
}
|
|
1286
1286
|
}
|
|
1287
|
-
},
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
const
|
|
1287
|
+
}, $ = () => {
|
|
1288
|
+
L(!1), P(null);
|
|
1289
|
+
}, S = (v) => {
|
|
1290
|
+
const D = y.find((C) => v.listingId === C.id);
|
|
1291
|
+
if (!D) return null;
|
|
1292
|
+
const p = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1291
1293
|
_ && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
1292
1294
|
j,
|
|
1293
1295
|
{
|
|
@@ -1300,24 +1302,24 @@ const Vn = (h) => {
|
|
|
1300
1302
|
l === "select" && /* @__PURE__ */ t.jsx(
|
|
1301
1303
|
ot,
|
|
1302
1304
|
{
|
|
1303
|
-
onChange: (
|
|
1304
|
-
const
|
|
1305
|
-
if (!
|
|
1306
|
-
const
|
|
1307
|
-
listingId:
|
|
1308
|
-
image:
|
|
1309
|
-
},
|
|
1310
|
-
|
|
1305
|
+
onChange: (C) => {
|
|
1306
|
+
const B = [...s], T = y.find((F) => F.productData.name === C);
|
|
1307
|
+
if (!T) return;
|
|
1308
|
+
const tt = {
|
|
1309
|
+
listingId: T.id,
|
|
1310
|
+
image: T.productData.images.length > 0 ? T.productData.images[0].cfId : ""
|
|
1311
|
+
}, z = B.map((F) => F.listingId === v.listingId ? tt : F);
|
|
1312
|
+
P(tt), r([...z]);
|
|
1311
1313
|
},
|
|
1312
|
-
value:
|
|
1314
|
+
value: D.productData.name,
|
|
1313
1315
|
options: [
|
|
1314
|
-
...y.filter((
|
|
1316
|
+
...y.filter((C) => !s.find((B) => B.listingId === C.id)).map((C) => C.productData.name)
|
|
1315
1317
|
],
|
|
1316
|
-
leftAddonOptions: y.map((
|
|
1317
|
-
var
|
|
1318
|
+
leftAddonOptions: y.map((C) => {
|
|
1319
|
+
var B;
|
|
1318
1320
|
return {
|
|
1319
|
-
value:
|
|
1320
|
-
addon:
|
|
1321
|
+
value: C.productData.name,
|
|
1322
|
+
addon: k(((B = C.productData.images[0]) == null ? void 0 : B.cfId) || "")
|
|
1321
1323
|
};
|
|
1322
1324
|
})
|
|
1323
1325
|
}
|
|
@@ -1330,7 +1332,7 @@ const Vn = (h) => {
|
|
|
1330
1332
|
hoverable: !0,
|
|
1331
1333
|
width: 20,
|
|
1332
1334
|
height: 20,
|
|
1333
|
-
onClick: (
|
|
1335
|
+
onClick: (C) => N(C, v)
|
|
1334
1336
|
}
|
|
1335
1337
|
) }),
|
|
1336
1338
|
I && /* @__PURE__ */ t.jsx("div", { className: W.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
@@ -1341,7 +1343,7 @@ const Vn = (h) => {
|
|
|
1341
1343
|
width: 20,
|
|
1342
1344
|
height: 20,
|
|
1343
1345
|
fill: "#C12A2A",
|
|
1344
|
-
onClick: () => r(s.filter((
|
|
1346
|
+
onClick: () => r(s.filter((C) => C !== v))
|
|
1345
1347
|
}
|
|
1346
1348
|
) })
|
|
1347
1349
|
] })
|
|
@@ -1350,18 +1352,18 @@ const Vn = (h) => {
|
|
|
1350
1352
|
De,
|
|
1351
1353
|
{
|
|
1352
1354
|
product: v,
|
|
1353
|
-
children:
|
|
1355
|
+
children: p
|
|
1354
1356
|
},
|
|
1355
1357
|
v.listingId
|
|
1356
1358
|
) : /* @__PURE__ */ t.jsx(
|
|
1357
1359
|
"div",
|
|
1358
1360
|
{
|
|
1359
1361
|
className: W.product,
|
|
1360
|
-
children:
|
|
1362
|
+
children: p
|
|
1361
1363
|
},
|
|
1362
1364
|
v.listingId
|
|
1363
1365
|
);
|
|
1364
|
-
},
|
|
1366
|
+
}, Z = g.useRef(null);
|
|
1365
1367
|
return /* @__PURE__ */ t.jsxs("div", { className: W.productsBlock, children: [
|
|
1366
1368
|
(u || a !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: W.top, children: [
|
|
1367
1369
|
u && /* @__PURE__ */ t.jsx("h3", { className: W.title, children: u }),
|
|
@@ -1376,11 +1378,11 @@ const Vn = (h) => {
|
|
|
1376
1378
|
K && b && /* @__PURE__ */ t.jsx(
|
|
1377
1379
|
Rt,
|
|
1378
1380
|
{
|
|
1379
|
-
ref:
|
|
1381
|
+
ref: Z,
|
|
1380
1382
|
activeItem: b,
|
|
1381
|
-
setActiveItem:
|
|
1382
|
-
setIsOpenModal:
|
|
1383
|
-
popupPosition:
|
|
1383
|
+
setActiveItem: P,
|
|
1384
|
+
setIsOpenModal: L,
|
|
1385
|
+
popupPosition: A,
|
|
1384
1386
|
itemsOptions: y
|
|
1385
1387
|
}
|
|
1386
1388
|
),
|
|
@@ -1390,17 +1392,18 @@ const Vn = (h) => {
|
|
|
1390
1392
|
ft,
|
|
1391
1393
|
{
|
|
1392
1394
|
sensors: n,
|
|
1393
|
-
onDragEnd:
|
|
1395
|
+
onDragEnd: q,
|
|
1396
|
+
onDragStart: $,
|
|
1394
1397
|
children: /* @__PURE__ */ t.jsx(
|
|
1395
1398
|
xt,
|
|
1396
1399
|
{
|
|
1397
1400
|
items: s.map((v) => String(v.listingId)),
|
|
1398
1401
|
strategy: _t,
|
|
1399
|
-
children: s.map((v) =>
|
|
1402
|
+
children: s.map((v) => S(v))
|
|
1400
1403
|
}
|
|
1401
1404
|
)
|
|
1402
1405
|
}
|
|
1403
|
-
) : s.map((v) =>
|
|
1406
|
+
) : s.map((v) => S(v)),
|
|
1404
1407
|
c && /* @__PURE__ */ t.jsx(
|
|
1405
1408
|
"div",
|
|
1406
1409
|
{
|
|
@@ -1417,11 +1420,11 @@ const Vn = (h) => {
|
|
|
1417
1420
|
size: "s",
|
|
1418
1421
|
onClick: () => {
|
|
1419
1422
|
const v = [...s];
|
|
1420
|
-
for (let
|
|
1421
|
-
if (!s.find((
|
|
1423
|
+
for (let D = 0; D < y.length; D++)
|
|
1424
|
+
if (!s.find((p) => p.listingId === y[D].id)) {
|
|
1422
1425
|
v.push({
|
|
1423
|
-
listingId: y[
|
|
1424
|
-
image: y[
|
|
1426
|
+
listingId: y[D].id,
|
|
1427
|
+
image: y[D].productData.images.length > 0 ? y[D].productData.images[0].cfId : ""
|
|
1425
1428
|
});
|
|
1426
1429
|
break;
|
|
1427
1430
|
}
|
|
@@ -1464,7 +1467,7 @@ const Vn = (h) => {
|
|
|
1464
1467
|
}
|
|
1465
1468
|
)
|
|
1466
1469
|
] });
|
|
1467
|
-
}, Ee = "_options_s4lx3_1", Re = "_price_s4lx3_18", Le = "_oldPrice_s4lx3_25", Ue = "_newPrice_s4lx3_34", He = "_animate_s4lx3_42", ze = "_meta_s4lx3_60", Fe = "_info_s4lx3_66", Ve = "_infoRight_s4lx3_75", Ye = "_buttons_s4lx3_82", Ge = "_variants_s4lx3_89", We = "_variant_s4lx3_89", Xe = "_stock_s4lx3_107", Qe = "_variantInfo_s4lx3_115", Je = "_quantity_s4lx3_122", Ke = "_button_s4lx3_82", Ze = "_activeVariant_s4lx3_168", ts = "_chargeTypes_s4lx3_172", es = "_charge_s4lx3_172", ss = "_chargeActive_s4lx3_197", ns = "_title_s4lx3_205",
|
|
1470
|
+
}, Ee = "_options_s4lx3_1", Re = "_price_s4lx3_18", Le = "_oldPrice_s4lx3_25", Ue = "_newPrice_s4lx3_34", He = "_animate_s4lx3_42", ze = "_meta_s4lx3_60", Fe = "_info_s4lx3_66", Ve = "_infoRight_s4lx3_75", Ye = "_buttons_s4lx3_82", Ge = "_variants_s4lx3_89", We = "_variant_s4lx3_89", Xe = "_stock_s4lx3_107", Qe = "_variantInfo_s4lx3_115", Je = "_quantity_s4lx3_122", Ke = "_button_s4lx3_82", Ze = "_activeVariant_s4lx3_168", ts = "_chargeTypes_s4lx3_172", es = "_charge_s4lx3_172", ss = "_chargeActive_s4lx3_197", ns = "_title_s4lx3_205", O = {
|
|
1468
1471
|
options: Ee,
|
|
1469
1472
|
price: Re,
|
|
1470
1473
|
oldPrice: Le,
|
|
@@ -1488,23 +1491,23 @@ const Vn = (h) => {
|
|
|
1488
1491
|
};
|
|
1489
1492
|
var Ot = /* @__PURE__ */ ((h) => (h.ONE_TIME = "One-Time", h.RECURRING = "Subscribe & Save", h))(Ot || {});
|
|
1490
1493
|
const is = (h) => {
|
|
1491
|
-
var K,
|
|
1494
|
+
var K, L;
|
|
1492
1495
|
const { product: a, setIsOpen: o, isCartEnabled: s = !0 } = h, { variants: r } = a, [e, u] = g.useState(r[0]), [d, f] = g.useState(
|
|
1493
1496
|
e.chargeTypes ? e.chargeTypes[0] : "ONE_TIME"
|
|
1494
|
-
), { notifications: _, setNotifications:
|
|
1497
|
+
), { notifications: _, setNotifications: M } = St(), I = Ct(), [c, l] = g.useState(1), { cart: y, reset: x, addProductToCart: m } = ct(), [i, b] = g.useState(!1);
|
|
1495
1498
|
g.useEffect(() => {
|
|
1496
1499
|
b(!0);
|
|
1497
1500
|
const n = setTimeout(() => b(!1), 600);
|
|
1498
1501
|
return () => clearTimeout(n);
|
|
1499
1502
|
}, [c]);
|
|
1500
|
-
async function
|
|
1503
|
+
async function P() {
|
|
1501
1504
|
try {
|
|
1502
1505
|
m({
|
|
1503
1506
|
productId: a.id,
|
|
1504
1507
|
productVariantId: e.id,
|
|
1505
1508
|
chargeType: d,
|
|
1506
1509
|
quantity: c
|
|
1507
|
-
}),
|
|
1510
|
+
}), M([
|
|
1508
1511
|
..._,
|
|
1509
1512
|
{
|
|
1510
1513
|
id: J(),
|
|
@@ -1513,7 +1516,7 @@ const is = (h) => {
|
|
|
1513
1516
|
}
|
|
1514
1517
|
]);
|
|
1515
1518
|
} catch (n) {
|
|
1516
|
-
|
|
1519
|
+
M([
|
|
1517
1520
|
..._,
|
|
1518
1521
|
{
|
|
1519
1522
|
id: J(),
|
|
@@ -1524,22 +1527,22 @@ const is = (h) => {
|
|
|
1524
1527
|
}
|
|
1525
1528
|
o == null || o(!1);
|
|
1526
1529
|
}
|
|
1527
|
-
function
|
|
1528
|
-
x(),
|
|
1530
|
+
function A() {
|
|
1531
|
+
x(), P(), I("/checkout");
|
|
1529
1532
|
}
|
|
1530
1533
|
function E(n) {
|
|
1531
1534
|
if (n >= 864e5) {
|
|
1532
|
-
const
|
|
1533
|
-
return `${
|
|
1535
|
+
const S = Math.floor(n / 864e5);
|
|
1536
|
+
return `${S} ${S === 1 ? "day" : "days"}`;
|
|
1534
1537
|
} else if (n >= 36e5) {
|
|
1535
|
-
const
|
|
1536
|
-
return `${
|
|
1538
|
+
const S = Math.floor(n / 36e5);
|
|
1539
|
+
return `${S} ${S === 1 ? "hour" : "hours"}`;
|
|
1537
1540
|
} else if (n >= 6e4) {
|
|
1538
|
-
const
|
|
1539
|
-
return `${
|
|
1541
|
+
const S = Math.floor(n / 6e4);
|
|
1542
|
+
return `${S} ${S === 1 ? "minute" : "minutes"}`;
|
|
1540
1543
|
} else {
|
|
1541
|
-
const
|
|
1542
|
-
return `${
|
|
1544
|
+
const S = Math.floor(n / 1e3);
|
|
1545
|
+
return `${S} ${S === 1 ? "second" : "seconds"}`;
|
|
1543
1546
|
}
|
|
1544
1547
|
}
|
|
1545
1548
|
return g.useEffect(() => {
|
|
@@ -1548,38 +1551,38 @@ const is = (h) => {
|
|
|
1548
1551
|
e.chargeTypes && f(
|
|
1549
1552
|
e.chargeTypes.includes(d) ? d : e.chargeTypes[0]
|
|
1550
1553
|
);
|
|
1551
|
-
}, [e.chargeTypes]), /* @__PURE__ */ t.jsxs("div", { className:
|
|
1552
|
-
e.chargeTypes && e.chargeTypes.length > 1 && /* @__PURE__ */ t.jsx("div", { className:
|
|
1554
|
+
}, [e.chargeTypes]), /* @__PURE__ */ t.jsxs("div", { className: O.options, children: [
|
|
1555
|
+
e.chargeTypes && e.chargeTypes.length > 1 && /* @__PURE__ */ t.jsx("div", { className: O.chargeTypes, children: e.chargeTypes.map((n) => /* @__PURE__ */ t.jsx(
|
|
1553
1556
|
"div",
|
|
1554
1557
|
{
|
|
1555
|
-
className: U(
|
|
1556
|
-
[
|
|
1558
|
+
className: U(O.charge, {
|
|
1559
|
+
[O.chargeActive]: d === n
|
|
1557
1560
|
}),
|
|
1558
1561
|
onClick: () => f(n),
|
|
1559
1562
|
children: Ot[n]
|
|
1560
1563
|
},
|
|
1561
1564
|
n
|
|
1562
1565
|
)) }),
|
|
1563
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
1566
|
+
/* @__PURE__ */ t.jsx("div", { className: O.variants, children: r.filter((n) => {
|
|
1564
1567
|
var N;
|
|
1565
1568
|
return (N = n.chargeTypes) == null ? void 0 : N.includes(d);
|
|
1566
1569
|
}).map((n) => {
|
|
1567
|
-
var N,
|
|
1570
|
+
var N, k;
|
|
1568
1571
|
return /* @__PURE__ */ t.jsxs(
|
|
1569
1572
|
"div",
|
|
1570
1573
|
{
|
|
1571
|
-
className: U(
|
|
1572
|
-
[
|
|
1574
|
+
className: U(O.variant, {
|
|
1575
|
+
[O.activeVariant]: e.id === n.id
|
|
1573
1576
|
}),
|
|
1574
1577
|
onClick: () => {
|
|
1575
1578
|
u(n), l(1);
|
|
1576
1579
|
},
|
|
1577
1580
|
children: [
|
|
1578
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1581
|
+
/* @__PURE__ */ t.jsxs("div", { className: O.variantInfo, children: [
|
|
1579
1582
|
/* @__PURE__ */ t.jsx(
|
|
1580
1583
|
"span",
|
|
1581
1584
|
{
|
|
1582
|
-
className:
|
|
1585
|
+
className: O.title,
|
|
1583
1586
|
id: "h4",
|
|
1584
1587
|
dangerouslySetInnerHTML: {
|
|
1585
1588
|
__html: at(n.name)
|
|
@@ -1598,10 +1601,10 @@ const is = (h) => {
|
|
|
1598
1601
|
/* @__PURE__ */ t.jsx("div", { id: "md", children: d === "ONE_TIME" && /* @__PURE__ */ t.jsxs(
|
|
1599
1602
|
"span",
|
|
1600
1603
|
{
|
|
1601
|
-
className:
|
|
1604
|
+
className: O.stock,
|
|
1602
1605
|
id: "md",
|
|
1603
1606
|
children: [
|
|
1604
|
-
(N = n.quantity.restrictions) != null && N.max || n.quantity.available !== void 0 ? ((
|
|
1607
|
+
(N = n.quantity.restrictions) != null && N.max || n.quantity.available !== void 0 ? ((k = n.quantity.restrictions) == null ? void 0 : k.max) || n.quantity.available : "∞",
|
|
1605
1608
|
" ",
|
|
1606
1609
|
"in stock"
|
|
1607
1610
|
]
|
|
@@ -1615,7 +1618,7 @@ const is = (h) => {
|
|
|
1615
1618
|
d === "ONE_TIME" && /* @__PURE__ */ t.jsxs(
|
|
1616
1619
|
"div",
|
|
1617
1620
|
{
|
|
1618
|
-
className:
|
|
1621
|
+
className: O.quantity,
|
|
1619
1622
|
id: "md",
|
|
1620
1623
|
children: [
|
|
1621
1624
|
/* @__PURE__ */ t.jsx(
|
|
@@ -1625,7 +1628,7 @@ const is = (h) => {
|
|
|
1625
1628
|
onClick: () => {
|
|
1626
1629
|
c > 1 ? l((n) => n - 1) : l(1);
|
|
1627
1630
|
},
|
|
1628
|
-
className:
|
|
1631
|
+
className: O.button,
|
|
1629
1632
|
disabled: e.quantity.available && e.quantity.restrictions && c <= e.quantity.restrictions.min || e.quantity.available === 0,
|
|
1630
1633
|
children: /* @__PURE__ */ t.jsx(j, { name: "Minus" })
|
|
1631
1634
|
}
|
|
@@ -1639,7 +1642,7 @@ const is = (h) => {
|
|
|
1639
1642
|
e.quantity.available && Number(n) > e.quantity.available ? l(e.quantity.available) : l(Number(n));
|
|
1640
1643
|
},
|
|
1641
1644
|
max: ((K = e.quantity.restrictions) == null ? void 0 : K.max) || e.quantity.available || Number.POSITIVE_INFINITY,
|
|
1642
|
-
min: ((
|
|
1645
|
+
min: ((L = e.quantity.restrictions) == null ? void 0 : L.min) || 0,
|
|
1643
1646
|
centered: !0,
|
|
1644
1647
|
disabled: e.quantity && e.quantity.available === 0 || Object.keys(e.quantity.restrictions || {}).length !== 0 && c >= e.quantity.restrictions.max
|
|
1645
1648
|
}
|
|
@@ -1651,7 +1654,7 @@ const is = (h) => {
|
|
|
1651
1654
|
onClick: () => {
|
|
1652
1655
|
l((n) => n + 1);
|
|
1653
1656
|
},
|
|
1654
|
-
className:
|
|
1657
|
+
className: O.button,
|
|
1655
1658
|
disabled: !!(e.quantity.available && e.quantity.restrictions && c >= e.quantity.restrictions.max || e.quantity.available === 0 || e.quantity.available && c >= e.quantity.available),
|
|
1656
1659
|
children: /* @__PURE__ */ t.jsx(j, { name: "Plus" })
|
|
1657
1660
|
}
|
|
@@ -1659,10 +1662,10 @@ const is = (h) => {
|
|
|
1659
1662
|
]
|
|
1660
1663
|
}
|
|
1661
1664
|
),
|
|
1662
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1663
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1665
|
+
/* @__PURE__ */ t.jsxs("div", { className: O.meta, children: [
|
|
1666
|
+
/* @__PURE__ */ t.jsxs("div", { className: O.info, children: [
|
|
1664
1667
|
/* @__PURE__ */ t.jsx("span", { id: "md", children: "Delivery" }),
|
|
1665
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1668
|
+
/* @__PURE__ */ t.jsxs("div", { className: O.infoRight, children: [
|
|
1666
1669
|
/* @__PURE__ */ t.jsx(
|
|
1667
1670
|
j,
|
|
1668
1671
|
{
|
|
@@ -1675,22 +1678,22 @@ const is = (h) => {
|
|
|
1675
1678
|
/* @__PURE__ */ t.jsx("span", { id: "md", children: !e.deliveryTime || e.deliveryTime === 0 ? "Instant" : E(e.deliveryTime) })
|
|
1676
1679
|
] })
|
|
1677
1680
|
] }),
|
|
1678
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1681
|
+
/* @__PURE__ */ t.jsxs("div", { className: O.info, children: [
|
|
1679
1682
|
/* @__PURE__ */ t.jsx("span", { id: "md", children: "Price" }),
|
|
1680
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
1683
|
+
/* @__PURE__ */ t.jsx("div", { className: O.infoRight, children: d === "ONE_TIME" ? e.compareAtPrice && (e.compareAtPrice.amount || 0) - (e.price.amount || 0) > 0 ? /* @__PURE__ */ t.jsxs(
|
|
1681
1684
|
"div",
|
|
1682
1685
|
{
|
|
1683
|
-
className:
|
|
1686
|
+
className: O.price,
|
|
1684
1687
|
id: "md",
|
|
1685
1688
|
children: [
|
|
1686
|
-
/* @__PURE__ */ t.jsx("span", { className: U(
|
|
1689
|
+
/* @__PURE__ */ t.jsx("span", { className: U(O.newPrice, { [O.animate]: i }), children: Q({
|
|
1687
1690
|
amount: e.price.amount * c,
|
|
1688
1691
|
currency: e.price.currency
|
|
1689
1692
|
}) }),
|
|
1690
1693
|
/* @__PURE__ */ t.jsx(
|
|
1691
1694
|
"span",
|
|
1692
1695
|
{
|
|
1693
|
-
className:
|
|
1696
|
+
className: O.oldPrice,
|
|
1694
1697
|
id: "md",
|
|
1695
1698
|
children: Q({
|
|
1696
1699
|
amount: e.compareAtPrice.amount * c,
|
|
@@ -1703,7 +1706,7 @@ const is = (h) => {
|
|
|
1703
1706
|
) : /* @__PURE__ */ t.jsx(
|
|
1704
1707
|
"span",
|
|
1705
1708
|
{
|
|
1706
|
-
className: U(
|
|
1709
|
+
className: U(O.newPrice, { [O.animate]: i }),
|
|
1707
1710
|
id: "md",
|
|
1708
1711
|
children: Q({
|
|
1709
1712
|
amount: e.price.amount * c,
|
|
@@ -1713,13 +1716,13 @@ const is = (h) => {
|
|
|
1713
1716
|
) : e.subscriptionSettings && e.subscriptionSettings.compareAtPrice && (e.subscriptionSettings.compareAtPrice.amount || 0) - (e.subscriptionSettings.price.amount || 0) > 0 ? /* @__PURE__ */ t.jsxs(
|
|
1714
1717
|
"div",
|
|
1715
1718
|
{
|
|
1716
|
-
className:
|
|
1719
|
+
className: O.price,
|
|
1717
1720
|
id: "md",
|
|
1718
1721
|
children: [
|
|
1719
1722
|
/* @__PURE__ */ t.jsx(
|
|
1720
1723
|
"span",
|
|
1721
1724
|
{
|
|
1722
|
-
className: U(
|
|
1725
|
+
className: U(O.newPrice, { [O.animate]: i }),
|
|
1723
1726
|
id: "md",
|
|
1724
1727
|
children: Q({
|
|
1725
1728
|
amount: e.subscriptionSettings.price.amount * c,
|
|
@@ -1730,7 +1733,7 @@ const is = (h) => {
|
|
|
1730
1733
|
/* @__PURE__ */ t.jsx(
|
|
1731
1734
|
"span",
|
|
1732
1735
|
{
|
|
1733
|
-
className:
|
|
1736
|
+
className: O.oldPrice,
|
|
1734
1737
|
id: "md",
|
|
1735
1738
|
children: Q({
|
|
1736
1739
|
amount: e.subscriptionSettings.compareAtPrice.amount * c,
|
|
@@ -1743,7 +1746,7 @@ const is = (h) => {
|
|
|
1743
1746
|
) : e.subscriptionSettings && /* @__PURE__ */ t.jsx(
|
|
1744
1747
|
"span",
|
|
1745
1748
|
{
|
|
1746
|
-
className: U(
|
|
1749
|
+
className: U(O.newPrice, { [O.animate]: i }),
|
|
1747
1750
|
id: "md",
|
|
1748
1751
|
children: Q({
|
|
1749
1752
|
amount: e.subscriptionSettings.price.amount * c,
|
|
@@ -1753,12 +1756,12 @@ const is = (h) => {
|
|
|
1753
1756
|
) })
|
|
1754
1757
|
] })
|
|
1755
1758
|
] }),
|
|
1756
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1759
|
+
/* @__PURE__ */ t.jsxs("div", { className: O.buttons, children: [
|
|
1757
1760
|
/* @__PURE__ */ t.jsx(
|
|
1758
1761
|
R,
|
|
1759
1762
|
{
|
|
1760
1763
|
type: "Primary",
|
|
1761
|
-
onClick: () =>
|
|
1764
|
+
onClick: () => A(),
|
|
1762
1765
|
disabled: e.quantity && e.quantity.available === 0 || c === 0,
|
|
1763
1766
|
children: d === "ONE_TIME" ? "Buy Now" : "Subscribe Now"
|
|
1764
1767
|
}
|
|
@@ -1767,7 +1770,7 @@ const is = (h) => {
|
|
|
1767
1770
|
R,
|
|
1768
1771
|
{
|
|
1769
1772
|
type: "Secondary",
|
|
1770
|
-
onClick: () =>
|
|
1773
|
+
onClick: () => P(),
|
|
1771
1774
|
disabled: e.quantity && e.quantity.available === 0 || c === 0,
|
|
1772
1775
|
children: y.parts.some(
|
|
1773
1776
|
(n) => n.productId === a.id && n.productVariantId === e.id
|
|
@@ -1776,7 +1779,7 @@ const is = (h) => {
|
|
|
1776
1779
|
)
|
|
1777
1780
|
] })
|
|
1778
1781
|
] });
|
|
1779
|
-
}, as = "_buttons_1uy6y_23", os = "_modal_1uy6y_32", cs = "_closing_1uy6y_65", rs = "_info_1uy6y_114", ls = "_top_1uy6y_121", ds = "_title_1uy6y_132", us = "_clear_1uy6y_139", hs = "_activeClear_1uy6y_146", ms = "_count_1uy6y_150", ps = "_cart_1uy6y_165", gs = "_empty_1uy6y_173", fs = "_product_1uy6y_199", xs = "_products_1uy6y_208", _s = "_image_1uy6y_216", ys = "_productInfo_1uy6y_233", js = "_content_1uy6y_240", bs = "_name_1uy6y_246", vs = "_price_1uy6y_252", Is = "_productButtons_1uy6y_258", Ns = "_productButton_1uy6y_258",
|
|
1782
|
+
}, as = "_buttons_1uy6y_23", os = "_modal_1uy6y_32", cs = "_closing_1uy6y_65", rs = "_info_1uy6y_114", ls = "_top_1uy6y_121", ds = "_title_1uy6y_132", us = "_clear_1uy6y_139", hs = "_activeClear_1uy6y_146", ms = "_count_1uy6y_150", ps = "_cart_1uy6y_165", gs = "_empty_1uy6y_173", fs = "_product_1uy6y_199", xs = "_products_1uy6y_208", _s = "_image_1uy6y_216", ys = "_productInfo_1uy6y_233", js = "_content_1uy6y_240", bs = "_name_1uy6y_246", vs = "_price_1uy6y_252", Is = "_productButtons_1uy6y_258", Ns = "_productButton_1uy6y_258", Ss = "_productCount_1uy6y_275", Cs = "_bottom_1uy6y_292", Ps = "_subtotal_1uy6y_300", ks = "_block_1uy6y_308", ws = "_shoppingCount_1uy6y_315", Ts = "_total_1uy6y_335", Ms = "_link_1uy6y_341", Bs = "_userInfo_1uy6y_348", $s = "_pagesMobileModal_1uy6y_360", Os = "_pagesMobileModalContent_1uy6y_374", qs = "_pagesMobileModalHeader_1uy6y_380", As = "_pagesMobileModalFooter_1uy6y_390", Ds = "_pageLink_1uy6y_397", Es = "_rightButtons_1uy6y_406", w = {
|
|
1780
1783
|
buttons: as,
|
|
1781
1784
|
modal: os,
|
|
1782
1785
|
closing: cs,
|
|
@@ -1797,10 +1800,10 @@ const is = (h) => {
|
|
|
1797
1800
|
price: vs,
|
|
1798
1801
|
productButtons: Is,
|
|
1799
1802
|
productButton: Ns,
|
|
1800
|
-
productCount:
|
|
1801
|
-
bottom:
|
|
1802
|
-
subtotal:
|
|
1803
|
-
block:
|
|
1803
|
+
productCount: Ss,
|
|
1804
|
+
bottom: Cs,
|
|
1805
|
+
subtotal: Ps,
|
|
1806
|
+
block: ks,
|
|
1804
1807
|
shoppingCount: ws,
|
|
1805
1808
|
total: Ts,
|
|
1806
1809
|
link: Ms,
|
|
@@ -1814,7 +1817,7 @@ const is = (h) => {
|
|
|
1814
1817
|
delete: "_delete_1uy6y_413"
|
|
1815
1818
|
}, Yn = (h) => {
|
|
1816
1819
|
const { shopping: a, signUp: o, isShowUserInfo: s = !0 } = h;
|
|
1817
|
-
return /* @__PURE__ */ t.jsx(t.Fragment, { children: (a || s) && /* @__PURE__ */ t.jsxs("div", { className:
|
|
1820
|
+
return /* @__PURE__ */ t.jsx(t.Fragment, { children: (a || s) && /* @__PURE__ */ t.jsxs("div", { className: w.buttons, children: [
|
|
1818
1821
|
a && /* @__PURE__ */ t.jsx(Rs, {}),
|
|
1819
1822
|
s && /* @__PURE__ */ t.jsx(qt, { signUp: o })
|
|
1820
1823
|
] }) });
|
|
@@ -1838,7 +1841,7 @@ const is = (h) => {
|
|
|
1838
1841
|
return !I || !(I != null && I.variants) ? !1 : I.chargeType === "RECURRING";
|
|
1839
1842
|
}
|
|
1840
1843
|
const _ = u.parts.length > 0 && o.length > 0 && !f(o[0]);
|
|
1841
|
-
function
|
|
1844
|
+
function M() {
|
|
1842
1845
|
e(!1), setTimeout(() => {
|
|
1843
1846
|
a(!1);
|
|
1844
1847
|
}, 300);
|
|
@@ -1862,14 +1865,14 @@ const is = (h) => {
|
|
|
1862
1865
|
name: "Handbag"
|
|
1863
1866
|
}
|
|
1864
1867
|
),
|
|
1865
|
-
_ && /* @__PURE__ */ t.jsx("div", { className:
|
|
1868
|
+
_ && /* @__PURE__ */ t.jsx("div", { className: w.shoppingCount, children: u.parts.length })
|
|
1866
1869
|
]
|
|
1867
1870
|
}
|
|
1868
1871
|
),
|
|
1869
1872
|
h && /* @__PURE__ */ t.jsx(
|
|
1870
1873
|
ut,
|
|
1871
1874
|
{
|
|
1872
|
-
close:
|
|
1875
|
+
close: M,
|
|
1873
1876
|
withAnimation: !1,
|
|
1874
1877
|
children: /* @__PURE__ */ t.jsx(
|
|
1875
1878
|
Ls,
|
|
@@ -1877,7 +1880,7 @@ const is = (h) => {
|
|
|
1877
1880
|
activeProducts: o,
|
|
1878
1881
|
isCartNotEmpty: _,
|
|
1879
1882
|
isOpen: r,
|
|
1880
|
-
close:
|
|
1883
|
+
close: M
|
|
1881
1884
|
}
|
|
1882
1885
|
)
|
|
1883
1886
|
}
|
|
@@ -1885,9 +1888,9 @@ const is = (h) => {
|
|
|
1885
1888
|
] });
|
|
1886
1889
|
}, Ls = (h) => {
|
|
1887
1890
|
var x, m;
|
|
1888
|
-
const { activeProducts: a, isCartNotEmpty: o, isOpen: s, close: r } = h, { cart: e, reset: u, getTotalAndDiscount: d, updateQuantityOfProduct: f, removeProduct: _ } = ct(),
|
|
1891
|
+
const { activeProducts: a, isCartNotEmpty: o, isOpen: s, close: r } = h, { cart: e, reset: u, getTotalAndDiscount: d, updateQuantityOfProduct: f, removeProduct: _ } = ct(), M = Ct();
|
|
1889
1892
|
function I(i, b) {
|
|
1890
|
-
|
|
1893
|
+
M(i, { replace: b });
|
|
1891
1894
|
}
|
|
1892
1895
|
function c(i) {
|
|
1893
1896
|
i.quantity && f({
|
|
@@ -1916,17 +1919,17 @@ const is = (h) => {
|
|
|
1916
1919
|
return /* @__PURE__ */ t.jsxs(
|
|
1917
1920
|
"div",
|
|
1918
1921
|
{
|
|
1919
|
-
className: U(
|
|
1920
|
-
[
|
|
1922
|
+
className: U(w.modal, {
|
|
1923
|
+
[w.closing]: !s
|
|
1921
1924
|
}),
|
|
1922
1925
|
onClick: (i) => i.stopPropagation(),
|
|
1923
1926
|
children: [
|
|
1924
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1925
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1927
|
+
/* @__PURE__ */ t.jsxs("div", { className: w.top, children: [
|
|
1928
|
+
/* @__PURE__ */ t.jsxs("div", { className: w.info, children: [
|
|
1926
1929
|
/* @__PURE__ */ t.jsx(
|
|
1927
1930
|
"span",
|
|
1928
1931
|
{
|
|
1929
|
-
className:
|
|
1932
|
+
className: w.title,
|
|
1930
1933
|
id: "h4",
|
|
1931
1934
|
children: "Cart"
|
|
1932
1935
|
}
|
|
@@ -1934,18 +1937,18 @@ const is = (h) => {
|
|
|
1934
1937
|
o && /* @__PURE__ */ t.jsx(
|
|
1935
1938
|
"div",
|
|
1936
1939
|
{
|
|
1937
|
-
className:
|
|
1940
|
+
className: w.count,
|
|
1938
1941
|
id: "md",
|
|
1939
1942
|
children: e.parts.length
|
|
1940
1943
|
}
|
|
1941
1944
|
)
|
|
1942
1945
|
] }),
|
|
1943
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1946
|
+
/* @__PURE__ */ t.jsxs("div", { className: w.rightButtons, children: [
|
|
1944
1947
|
o && /* @__PURE__ */ t.jsx(
|
|
1945
1948
|
"button",
|
|
1946
1949
|
{
|
|
1947
|
-
className: U(
|
|
1948
|
-
[
|
|
1950
|
+
className: U(w.clear, {
|
|
1951
|
+
[w.activeClear]: o
|
|
1949
1952
|
}),
|
|
1950
1953
|
disabled: !o,
|
|
1951
1954
|
onClick: u,
|
|
@@ -1966,15 +1969,15 @@ const is = (h) => {
|
|
|
1966
1969
|
)
|
|
1967
1970
|
] })
|
|
1968
1971
|
] }),
|
|
1969
|
-
o ? /* @__PURE__ */ t.jsxs("div", { className:
|
|
1970
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
1971
|
-
var b,
|
|
1972
|
+
o ? /* @__PURE__ */ t.jsxs("div", { className: w.cart, children: [
|
|
1973
|
+
/* @__PURE__ */ t.jsx("div", { className: w.products, children: a.map((i) => {
|
|
1974
|
+
var b, P;
|
|
1972
1975
|
return /* @__PURE__ */ t.jsxs(
|
|
1973
1976
|
"div",
|
|
1974
1977
|
{
|
|
1975
|
-
className:
|
|
1978
|
+
className: w.product,
|
|
1976
1979
|
children: [
|
|
1977
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1980
|
+
/* @__PURE__ */ t.jsxs("div", { className: w.productInfo, children: [
|
|
1978
1981
|
i.images.length > 0 ? /* @__PURE__ */ t.jsx(
|
|
1979
1982
|
"img",
|
|
1980
1983
|
{
|
|
@@ -1982,40 +1985,40 @@ const is = (h) => {
|
|
|
1982
1985
|
alt: "image",
|
|
1983
1986
|
width: "100%",
|
|
1984
1987
|
height: "100%",
|
|
1985
|
-
className:
|
|
1988
|
+
className: w.image
|
|
1986
1989
|
}
|
|
1987
|
-
) : /* @__PURE__ */ t.jsx("div", { className:
|
|
1990
|
+
) : /* @__PURE__ */ t.jsx("div", { className: w.image, children: /* @__PURE__ */ t.jsx(
|
|
1988
1991
|
j,
|
|
1989
1992
|
{
|
|
1990
1993
|
name: "Image",
|
|
1991
1994
|
fill: "var(--text-secondary)"
|
|
1992
1995
|
}
|
|
1993
1996
|
) }),
|
|
1994
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1997
|
+
/* @__PURE__ */ t.jsxs("div", { className: w.content, children: [
|
|
1995
1998
|
/* @__PURE__ */ t.jsx(
|
|
1996
1999
|
"div",
|
|
1997
2000
|
{
|
|
1998
|
-
className:
|
|
2001
|
+
className: w.name,
|
|
1999
2002
|
dangerouslySetInnerHTML: {
|
|
2000
2003
|
__html: at(
|
|
2001
2004
|
((b = i.variants.find(
|
|
2002
|
-
(
|
|
2005
|
+
(A) => A.id === i.activeVariantId
|
|
2003
2006
|
)) == null ? void 0 : b.name) || i.name
|
|
2004
2007
|
)
|
|
2005
2008
|
}
|
|
2006
2009
|
}
|
|
2007
2010
|
),
|
|
2008
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
2011
|
+
/* @__PURE__ */ t.jsx("div", { className: w.price, children: Q({
|
|
2009
2012
|
amount: i.variants.find(
|
|
2010
|
-
(
|
|
2013
|
+
(A) => A.id === i.activeVariantId
|
|
2011
2014
|
).price.amount * ((i == null ? void 0 : i.quantity) || 1),
|
|
2012
2015
|
currency: i.variants.find(
|
|
2013
|
-
(
|
|
2016
|
+
(A) => A.id === i.activeVariantId
|
|
2014
2017
|
).price.currency
|
|
2015
2018
|
}) })
|
|
2016
2019
|
] })
|
|
2017
2020
|
] }),
|
|
2018
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2021
|
+
/* @__PURE__ */ t.jsxs("div", { className: w.productButtons, children: [
|
|
2019
2022
|
/* @__PURE__ */ t.jsx(
|
|
2020
2023
|
R,
|
|
2021
2024
|
{
|
|
@@ -2023,7 +2026,7 @@ const is = (h) => {
|
|
|
2023
2026
|
onClick: () => {
|
|
2024
2027
|
i.quantity !== 1 && l(i);
|
|
2025
2028
|
},
|
|
2026
|
-
className:
|
|
2029
|
+
className: w.productButton,
|
|
2027
2030
|
disabled: i.quantity === 1,
|
|
2028
2031
|
children: /* @__PURE__ */ t.jsx(
|
|
2029
2032
|
j,
|
|
@@ -2039,12 +2042,12 @@ const is = (h) => {
|
|
|
2039
2042
|
/* @__PURE__ */ t.jsx(
|
|
2040
2043
|
"input",
|
|
2041
2044
|
{
|
|
2042
|
-
className:
|
|
2045
|
+
className: w.productCount,
|
|
2043
2046
|
type: "number",
|
|
2044
|
-
value: ((
|
|
2045
|
-
onChange: (
|
|
2047
|
+
value: ((P = i.quantity) == null ? void 0 : P.toString()) || "",
|
|
2048
|
+
onChange: (A) => {
|
|
2046
2049
|
const E = Math.min(
|
|
2047
|
-
Number(
|
|
2050
|
+
Number(A.target.value),
|
|
2048
2051
|
i.variants.find((K) => K.id === i.activeVariantId).quantity.available || 1 / 0
|
|
2049
2052
|
);
|
|
2050
2053
|
E < 1 || f({
|
|
@@ -2055,7 +2058,7 @@ const is = (h) => {
|
|
|
2055
2058
|
});
|
|
2056
2059
|
},
|
|
2057
2060
|
min: 1,
|
|
2058
|
-
max: i.variants.find((
|
|
2061
|
+
max: i.variants.find((A) => A.id === i.activeVariantId).quantity.available || 1 / 0
|
|
2059
2062
|
}
|
|
2060
2063
|
),
|
|
2061
2064
|
/* @__PURE__ */ t.jsx(
|
|
@@ -2063,8 +2066,8 @@ const is = (h) => {
|
|
|
2063
2066
|
{
|
|
2064
2067
|
type: "Secondary",
|
|
2065
2068
|
onClick: () => c(i),
|
|
2066
|
-
className:
|
|
2067
|
-
disabled: i.quantity === i.variants.find((
|
|
2069
|
+
className: w.productButton,
|
|
2070
|
+
disabled: i.quantity === i.variants.find((A) => A.id === i.activeVariantId).quantity.available,
|
|
2068
2071
|
children: /* @__PURE__ */ t.jsx(
|
|
2069
2072
|
j,
|
|
2070
2073
|
{
|
|
@@ -2076,7 +2079,7 @@ const is = (h) => {
|
|
|
2076
2079
|
)
|
|
2077
2080
|
}
|
|
2078
2081
|
),
|
|
2079
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
2082
|
+
/* @__PURE__ */ t.jsx("div", { className: w.delete, children: /* @__PURE__ */ t.jsx(
|
|
2080
2083
|
j,
|
|
2081
2084
|
{
|
|
2082
2085
|
name: "Trash",
|
|
@@ -2093,9 +2096,9 @@ const is = (h) => {
|
|
|
2093
2096
|
i.id
|
|
2094
2097
|
);
|
|
2095
2098
|
}) }),
|
|
2096
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2097
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2098
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2099
|
+
/* @__PURE__ */ t.jsxs("div", { className: w.bottom, children: [
|
|
2100
|
+
/* @__PURE__ */ t.jsxs("div", { className: w.subtotal, children: [
|
|
2101
|
+
/* @__PURE__ */ t.jsxs("div", { className: w.block, children: [
|
|
2099
2102
|
/* @__PURE__ */ t.jsx("span", { children: "Subtotal" }),
|
|
2100
2103
|
/* @__PURE__ */ t.jsx(
|
|
2101
2104
|
j,
|
|
@@ -2107,7 +2110,7 @@ const is = (h) => {
|
|
|
2107
2110
|
}
|
|
2108
2111
|
)
|
|
2109
2112
|
] }),
|
|
2110
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
2113
|
+
/* @__PURE__ */ t.jsx("div", { className: w.total, children: Q({
|
|
2111
2114
|
amount: d().total,
|
|
2112
2115
|
currency: e.parts.length > 0 && ((m = (x = a.find((i) => i.id === e.parts[0].productId)) == null ? void 0 : x.variants.find((i) => i.id === e.parts[0].productVariantId)) == null ? void 0 : m.price.currency) || "USD"
|
|
2113
2116
|
}) })
|
|
@@ -2118,7 +2121,7 @@ const is = (h) => {
|
|
|
2118
2121
|
]
|
|
2119
2122
|
}
|
|
2120
2123
|
);
|
|
2121
|
-
}, Us = () => /* @__PURE__ */ t.jsxs("div", { className:
|
|
2124
|
+
}, Us = () => /* @__PURE__ */ t.jsxs("div", { className: w.empty, children: [
|
|
2122
2125
|
/* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
2123
2126
|
j,
|
|
2124
2127
|
{
|
|
@@ -2134,14 +2137,14 @@ const is = (h) => {
|
|
|
2134
2137
|
"a",
|
|
2135
2138
|
{
|
|
2136
2139
|
href: "/products",
|
|
2137
|
-
className:
|
|
2140
|
+
className: w.link,
|
|
2138
2141
|
id: "md",
|
|
2139
2142
|
children: "view products"
|
|
2140
2143
|
}
|
|
2141
2144
|
)
|
|
2142
2145
|
] })
|
|
2143
2146
|
] }), qt = ({ signUp: h, close: a }) => {
|
|
2144
|
-
const { token: o } = Ht(), s =
|
|
2147
|
+
const { token: o } = Ht(), s = Ct(), [r, e] = g.useState("test-email@gmail.com");
|
|
2145
2148
|
g.useEffect(() => {
|
|
2146
2149
|
o && (async () => {
|
|
2147
2150
|
if (!o) return;
|
|
@@ -2156,7 +2159,7 @@ const is = (h) => {
|
|
|
2156
2159
|
R,
|
|
2157
2160
|
{
|
|
2158
2161
|
type: "Secondary",
|
|
2159
|
-
className:
|
|
2162
|
+
className: w.userInfo,
|
|
2160
2163
|
onClick: () => {
|
|
2161
2164
|
u("/customer-dash"), a == null || a();
|
|
2162
2165
|
},
|
|
@@ -2205,10 +2208,10 @@ const is = (h) => {
|
|
|
2205
2208
|
return /* @__PURE__ */ t.jsxs(
|
|
2206
2209
|
"div",
|
|
2207
2210
|
{
|
|
2208
|
-
className:
|
|
2211
|
+
className: w.pagesMobileModal,
|
|
2209
2212
|
onClick: (u) => u.stopPropagation(),
|
|
2210
2213
|
children: [
|
|
2211
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2214
|
+
/* @__PURE__ */ t.jsxs("div", { className: w.pagesMobileModalHeader, children: [
|
|
2212
2215
|
/* @__PURE__ */ t.jsx("div", { children: h }),
|
|
2213
2216
|
/* @__PURE__ */ t.jsx(
|
|
2214
2217
|
R,
|
|
@@ -2219,10 +2222,10 @@ const is = (h) => {
|
|
|
2219
2222
|
}
|
|
2220
2223
|
)
|
|
2221
2224
|
] }),
|
|
2222
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
2225
|
+
/* @__PURE__ */ t.jsx("div", { className: w.pagesMobileModalContent, children: s.length > 0 && s.map((u) => /* @__PURE__ */ t.jsx(
|
|
2223
2226
|
"div",
|
|
2224
2227
|
{
|
|
2225
|
-
className:
|
|
2228
|
+
className: w.pageLink,
|
|
2226
2229
|
onClick: e,
|
|
2227
2230
|
children: /* @__PURE__ */ t.jsx(
|
|
2228
2231
|
Mt,
|
|
@@ -2234,7 +2237,7 @@ const is = (h) => {
|
|
|
2234
2237
|
)
|
|
2235
2238
|
}
|
|
2236
2239
|
)) }),
|
|
2237
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
2240
|
+
/* @__PURE__ */ t.jsx("div", { className: w.pagesMobileModalFooter, children: /* @__PURE__ */ t.jsx(
|
|
2238
2241
|
qt,
|
|
2239
2242
|
{
|
|
2240
2243
|
signUp: o,
|
|
@@ -2316,7 +2319,7 @@ const is = (h) => {
|
|
|
2316
2319
|
a && /* @__PURE__ */ t.jsx(ut, { close: o, children: /* @__PURE__ */ t.jsx(Ks, { title: h }) })
|
|
2317
2320
|
] });
|
|
2318
2321
|
}, Ks = ({ title: h = "Copy Product Link" }) => {
|
|
2319
|
-
const { setIsOpenModal: a } = Bt(), { notifications: o, setNotifications: s } =
|
|
2322
|
+
const { setIsOpenModal: a } = Bt(), { notifications: o, setNotifications: s } = St(), { setIsOpen: r } = rt(), e = window.location.href;
|
|
2320
2323
|
function u() {
|
|
2321
2324
|
navigator.clipboard.writeText(e), s([
|
|
2322
2325
|
...o,
|
|
@@ -2332,8 +2335,8 @@ const is = (h) => {
|
|
|
2332
2335
|
a(!1), r(!0);
|
|
2333
2336
|
}, 300);
|
|
2334
2337
|
}
|
|
2335
|
-
function f(_,
|
|
2336
|
-
return _.length >
|
|
2338
|
+
function f(_, M) {
|
|
2339
|
+
return _.length > M ? _.slice(0, M) + "..." : _;
|
|
2337
2340
|
}
|
|
2338
2341
|
return /* @__PURE__ */ t.jsxs(
|
|
2339
2342
|
"div",
|
|
@@ -2448,12 +2451,12 @@ const is = (h) => {
|
|
|
2448
2451
|
}
|
|
2449
2452
|
) })
|
|
2450
2453
|
] });
|
|
2451
|
-
}, cn = "_buttonsBlock_1x6xf_1", rn = "_cartDisabled_1x6xf_25",
|
|
2454
|
+
}, cn = "_buttonsBlock_1x6xf_1", rn = "_cartDisabled_1x6xf_25", Pt = {
|
|
2452
2455
|
buttonsBlock: cn,
|
|
2453
2456
|
cartDisabled: rn
|
|
2454
2457
|
}, Qn = (h) => {
|
|
2455
|
-
var
|
|
2456
|
-
const { setIsOpen: a, setModalType: o, productId: s, isCartEnabled: r = !0 } = h, { cart: e } = ct(), { pageContext: u } = bt(), d = (
|
|
2458
|
+
var M, I;
|
|
2459
|
+
const { setIsOpen: a, setModalType: o, productId: s, isCartEnabled: r = !0 } = h, { cart: e } = ct(), { pageContext: u } = bt(), d = (M = u == null ? void 0 : u.listings) == null ? void 0 : M.find((c) => c.id === s);
|
|
2457
2460
|
if (!d)
|
|
2458
2461
|
return null;
|
|
2459
2462
|
const f = (I = u == null ? void 0 : u.products) == null ? void 0 : I.find(
|
|
@@ -2465,8 +2468,8 @@ const is = (h) => {
|
|
|
2465
2468
|
return /* @__PURE__ */ t.jsxs(
|
|
2466
2469
|
"div",
|
|
2467
2470
|
{
|
|
2468
|
-
className: U(
|
|
2469
|
-
[
|
|
2471
|
+
className: U(Pt.buttonsBlock, {
|
|
2472
|
+
[Pt.cartDisabled]: !r
|
|
2470
2473
|
}),
|
|
2471
2474
|
onClick: (c) => c.stopPropagation(),
|
|
2472
2475
|
children: [
|
|
@@ -2538,7 +2541,7 @@ const is = (h) => {
|
|
|
2538
2541
|
/* @__PURE__ */ t.jsx("p", { id: "p", children: o(h) })
|
|
2539
2542
|
] })
|
|
2540
2543
|
] });
|
|
2541
|
-
}, hn = "_variants_18tbu_82", mn = "_variant_18tbu_82", pn = "_stock_18tbu_100", gn = "_variantInfo_18tbu_108", fn = "_title_18tbu_202", xn = "_modal_18tbu_208", _n = "_header_18tbu_228", yn = "_productOptions_18tbu_236", jn = "_loading_18tbu_244",
|
|
2544
|
+
}, hn = "_variants_18tbu_82", mn = "_variant_18tbu_82", pn = "_stock_18tbu_100", gn = "_variantInfo_18tbu_108", fn = "_title_18tbu_202", xn = "_modal_18tbu_208", _n = "_header_18tbu_228", yn = "_productOptions_18tbu_236", jn = "_loading_18tbu_244", et = {
|
|
2542
2545
|
variants: hn,
|
|
2543
2546
|
variant: mn,
|
|
2544
2547
|
stock: pn,
|
|
@@ -2552,7 +2555,7 @@ const is = (h) => {
|
|
|
2552
2555
|
var c;
|
|
2553
2556
|
const { pageContext: a } = bt(), o = (c = a == null ? void 0 : a.listings) == null ? void 0 : c.find((l) => l.id === h.productId), [s, r] = g.useState(!0), [e, u] = g.useState(null), d = (e == null ? void 0 : e.variants[0]) || null, [f, _] = g.useState(
|
|
2554
2557
|
"ONE_TIME"
|
|
2555
|
-
), { addProducts:
|
|
2558
|
+
), { addProducts: M } = ct(), { setIsOpen: I } = rt();
|
|
2556
2559
|
return g.useEffect(() => {
|
|
2557
2560
|
(async () => {
|
|
2558
2561
|
r(!0);
|
|
@@ -2561,17 +2564,17 @@ const is = (h) => {
|
|
|
2561
2564
|
`/product/${o.productData.uniquePath}`
|
|
2562
2565
|
)
|
|
2563
2566
|
);
|
|
2564
|
-
|
|
2567
|
+
M(y == null ? void 0 : y.data.products), u(y == null ? void 0 : y.data.products[0]), r(!1);
|
|
2565
2568
|
})();
|
|
2566
2569
|
}, []), g.useEffect(() => {
|
|
2567
2570
|
I(!0);
|
|
2568
2571
|
}, []), /* @__PURE__ */ t.jsx(ut, { close: h.setIsOpen, children: /* @__PURE__ */ t.jsxs(
|
|
2569
2572
|
"div",
|
|
2570
2573
|
{
|
|
2571
|
-
className:
|
|
2574
|
+
className: et.modal,
|
|
2572
2575
|
onClick: (l) => l.stopPropagation(),
|
|
2573
2576
|
children: [
|
|
2574
|
-
s && /* @__PURE__ */ t.jsx("div", { className:
|
|
2577
|
+
s && /* @__PURE__ */ t.jsx("div", { className: et.loading, children: /* @__PURE__ */ t.jsx($t, {}) }),
|
|
2575
2578
|
h.type === "Add To Cart" && h.isCartEnabled && e && d && !s && /* @__PURE__ */ t.jsx(
|
|
2576
2579
|
bn,
|
|
2577
2580
|
{
|
|
@@ -2595,17 +2598,17 @@ const is = (h) => {
|
|
|
2595
2598
|
}
|
|
2596
2599
|
) });
|
|
2597
2600
|
}, bn = (h) => {
|
|
2598
|
-
const { variants: a, activeChargeType: o, productId: s, setIsOpen: r } = h, { cart: e, addProductToCart: u, addProducts: d, updateQuantityOfProduct: f } = ct(), { notifications: _, setNotifications:
|
|
2601
|
+
const { variants: a, activeChargeType: o, productId: s, setIsOpen: r } = h, { cart: e, addProductToCart: u, addProducts: d, updateQuantityOfProduct: f } = ct(), { notifications: _, setNotifications: M } = St(), { pageContext: I } = bt(), { setIsOpen: c } = rt(), l = () => {
|
|
2599
2602
|
c(!1), setTimeout(() => {
|
|
2600
2603
|
r(!1);
|
|
2601
2604
|
}, 300);
|
|
2602
2605
|
};
|
|
2603
2606
|
async function y(x) {
|
|
2604
|
-
const m = a.find((
|
|
2605
|
-
(
|
|
2607
|
+
const m = a.find((P) => P.id === x), i = e.parts.find(
|
|
2608
|
+
(P) => P.productId === h.productId && P.productVariantId === x
|
|
2606
2609
|
);
|
|
2607
2610
|
if ((m == null ? void 0 : m.quantity.available) && (m == null ? void 0 : m.quantity.restrictions) && ((i == null ? void 0 : i.quantity) || 0) + 1 > (m == null ? void 0 : m.quantity.restrictions.max) || (m == null ? void 0 : m.quantity.available) === 0 || (m == null ? void 0 : m.quantity.available) && ((i == null ? void 0 : i.quantity) || 0) + 1 > (m == null ? void 0 : m.quantity.available)) {
|
|
2608
|
-
|
|
2611
|
+
M([
|
|
2609
2612
|
..._,
|
|
2610
2613
|
{ id: J(), message: "Product is out of stock", status: "error" }
|
|
2611
2614
|
]);
|
|
@@ -2626,7 +2629,7 @@ const is = (h) => {
|
|
|
2626
2629
|
productVariantId: x,
|
|
2627
2630
|
quantity: 1,
|
|
2628
2631
|
chargeType: o
|
|
2629
|
-
}),
|
|
2632
|
+
}), M([
|
|
2630
2633
|
..._,
|
|
2631
2634
|
{
|
|
2632
2635
|
id: J(),
|
|
@@ -2634,12 +2637,12 @@ const is = (h) => {
|
|
|
2634
2637
|
status: "success"
|
|
2635
2638
|
}
|
|
2636
2639
|
]);
|
|
2637
|
-
} catch (
|
|
2638
|
-
|
|
2640
|
+
} catch (P) {
|
|
2641
|
+
M([
|
|
2639
2642
|
..._,
|
|
2640
2643
|
{
|
|
2641
2644
|
id: J(),
|
|
2642
|
-
message: `Product failed to add to cart: ${
|
|
2645
|
+
message: `Product failed to add to cart: ${P}`,
|
|
2643
2646
|
status: "error"
|
|
2644
2647
|
}
|
|
2645
2648
|
]);
|
|
@@ -2647,7 +2650,7 @@ const is = (h) => {
|
|
|
2647
2650
|
}
|
|
2648
2651
|
}
|
|
2649
2652
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
2650
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2653
|
+
/* @__PURE__ */ t.jsxs("div", { className: et.header, children: [
|
|
2651
2654
|
/* @__PURE__ */ t.jsx("div", { id: "h3", children: "Choose a Variant" }),
|
|
2652
2655
|
/* @__PURE__ */ t.jsx(
|
|
2653
2656
|
j,
|
|
@@ -2661,7 +2664,7 @@ const is = (h) => {
|
|
|
2661
2664
|
}
|
|
2662
2665
|
)
|
|
2663
2666
|
] }),
|
|
2664
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
2667
|
+
/* @__PURE__ */ t.jsx("div", { className: et.variants, children: a.filter((x) => {
|
|
2665
2668
|
var m;
|
|
2666
2669
|
return (m = x.chargeTypes) == null ? void 0 : m.includes(o);
|
|
2667
2670
|
}).map((x) => {
|
|
@@ -2669,16 +2672,16 @@ const is = (h) => {
|
|
|
2669
2672
|
return /* @__PURE__ */ t.jsxs(
|
|
2670
2673
|
"div",
|
|
2671
2674
|
{
|
|
2672
|
-
className: U(
|
|
2675
|
+
className: U(et.variant),
|
|
2673
2676
|
onClick: () => {
|
|
2674
2677
|
y(x.id), r(!1);
|
|
2675
2678
|
},
|
|
2676
2679
|
children: [
|
|
2677
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2680
|
+
/* @__PURE__ */ t.jsxs("div", { className: et.variantInfo, children: [
|
|
2678
2681
|
/* @__PURE__ */ t.jsx(
|
|
2679
2682
|
"span",
|
|
2680
2683
|
{
|
|
2681
|
-
className:
|
|
2684
|
+
className: et.title,
|
|
2682
2685
|
id: "h4",
|
|
2683
2686
|
children: x.name
|
|
2684
2687
|
}
|
|
@@ -2691,7 +2694,7 @@ const is = (h) => {
|
|
|
2691
2694
|
/* @__PURE__ */ t.jsx("div", { id: "md", children: o === "ONE_TIME" && /* @__PURE__ */ t.jsxs(
|
|
2692
2695
|
"span",
|
|
2693
2696
|
{
|
|
2694
|
-
className:
|
|
2697
|
+
className: et.stock,
|
|
2695
2698
|
id: "md",
|
|
2696
2699
|
children: [
|
|
2697
2700
|
(i = x.quantity.restrictions) != null && i.max || x.quantity.available !== void 0 ? ((b = x.quantity.restrictions) == null ? void 0 : b.max) || x.quantity.available : "∞",
|
|
@@ -2713,12 +2716,12 @@ const is = (h) => {
|
|
|
2713
2716
|
}, 300);
|
|
2714
2717
|
};
|
|
2715
2718
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
2716
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2719
|
+
/* @__PURE__ */ t.jsxs("div", { className: et.header, children: [
|
|
2717
2720
|
/* @__PURE__ */ t.jsx(
|
|
2718
2721
|
"div",
|
|
2719
2722
|
{
|
|
2720
2723
|
id: "h3",
|
|
2721
|
-
className:
|
|
2724
|
+
className: et.title,
|
|
2722
2725
|
dangerouslySetInnerHTML: {
|
|
2723
2726
|
__html: `Buy ${at(a.name)}`
|
|
2724
2727
|
}
|
|
@@ -2740,7 +2743,7 @@ const is = (h) => {
|
|
|
2740
2743
|
}
|
|
2741
2744
|
)
|
|
2742
2745
|
] }),
|
|
2743
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
2746
|
+
/* @__PURE__ */ t.jsx("div", { className: et.productOptions, children: /* @__PURE__ */ t.jsx(
|
|
2744
2747
|
is,
|
|
2745
2748
|
{
|
|
2746
2749
|
product: a,
|
|
@@ -2749,13 +2752,13 @@ const is = (h) => {
|
|
|
2749
2752
|
}
|
|
2750
2753
|
) })
|
|
2751
2754
|
] });
|
|
2752
|
-
}, In = "
|
|
2755
|
+
}, In = "_contentModal_m2tf9_1", Nn = "_modalTop_m2tf9_12", Sn = "_loading_m2tf9_19", Cn = "_modalCards_m2tf9_28", Pn = "_modalImage_m2tf9_34", kn = "_card_m2tf9_39", wn = "_cardInfo_m2tf9_51", Tn = "_cardButtons_m2tf9_58", Mn = "_title_m2tf9_64", Bn = "_blockImage_m2tf9_71", $n = "_short_m2tf9_80", On = "_price_m2tf9_84", qn = "_oldPrice_m2tf9_91", An = "_newPrice_m2tf9_100", H = {
|
|
2753
2756
|
contentModal: In,
|
|
2754
2757
|
modalTop: Nn,
|
|
2755
|
-
loading:
|
|
2756
|
-
modalCards:
|
|
2757
|
-
modalImage:
|
|
2758
|
-
card:
|
|
2758
|
+
loading: Sn,
|
|
2759
|
+
modalCards: Cn,
|
|
2760
|
+
modalImage: Pn,
|
|
2761
|
+
card: kn,
|
|
2759
2762
|
cardInfo: wn,
|
|
2760
2763
|
cardButtons: Tn,
|
|
2761
2764
|
title: Mn,
|
|
@@ -2772,14 +2775,14 @@ const is = (h) => {
|
|
|
2772
2775
|
setProductId: r,
|
|
2773
2776
|
setIsProductModalOpen: e,
|
|
2774
2777
|
setShowDropdown: u
|
|
2775
|
-
} = h, [d, f] = g.useState(null), [_,
|
|
2778
|
+
} = h, [d, f] = g.useState(null), [_, M] = g.useState(!0), { setIsOpen: I } = rt();
|
|
2776
2779
|
g.useEffect(() => {
|
|
2777
2780
|
var y;
|
|
2778
|
-
|
|
2781
|
+
M(!0);
|
|
2779
2782
|
const l = (y = o.listings) == null ? void 0 : y.filter(
|
|
2780
2783
|
(x) => s.listingIdList.includes(x.id)
|
|
2781
2784
|
);
|
|
2782
|
-
l && f([...l]),
|
|
2785
|
+
l && f([...l]), M(!1);
|
|
2783
2786
|
}, [o]), g.useEffect(() => {
|
|
2784
2787
|
I(!0);
|
|
2785
2788
|
}, []);
|
|
@@ -2791,14 +2794,14 @@ const is = (h) => {
|
|
|
2791
2794
|
return /* @__PURE__ */ t.jsx(ut, { close: () => a(!1), children: /* @__PURE__ */ t.jsxs(
|
|
2792
2795
|
"div",
|
|
2793
2796
|
{
|
|
2794
|
-
className:
|
|
2797
|
+
className: H.contentModal,
|
|
2795
2798
|
onClick: (l) => l.stopPropagation(),
|
|
2796
2799
|
children: [
|
|
2797
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2800
|
+
/* @__PURE__ */ t.jsxs("div", { className: H.modalTop, children: [
|
|
2798
2801
|
/* @__PURE__ */ t.jsx(
|
|
2799
2802
|
"span",
|
|
2800
2803
|
{
|
|
2801
|
-
className:
|
|
2804
|
+
className: H.title,
|
|
2802
2805
|
id: "h4",
|
|
2803
2806
|
dangerouslySetInnerHTML: {
|
|
2804
2807
|
__html: at(s.name)
|
|
@@ -2815,10 +2818,10 @@ const is = (h) => {
|
|
|
2815
2818
|
}
|
|
2816
2819
|
)
|
|
2817
2820
|
] }),
|
|
2818
|
-
!_ && d && /* @__PURE__ */ t.jsx("div", { className:
|
|
2821
|
+
!_ && d && /* @__PURE__ */ t.jsx("div", { className: H.modalCards, children: d.map((l) => /* @__PURE__ */ t.jsxs(
|
|
2819
2822
|
"div",
|
|
2820
2823
|
{
|
|
2821
|
-
className:
|
|
2824
|
+
className: H.card,
|
|
2822
2825
|
children: [
|
|
2823
2826
|
/* @__PURE__ */ t.jsx("div", { children: l.productData.images[0] ? /* @__PURE__ */ t.jsx(
|
|
2824
2827
|
"img",
|
|
@@ -2827,22 +2830,22 @@ const is = (h) => {
|
|
|
2827
2830
|
alt: "",
|
|
2828
2831
|
width: 64,
|
|
2829
2832
|
height: 64,
|
|
2830
|
-
className:
|
|
2833
|
+
className: H.modalImage
|
|
2831
2834
|
}
|
|
2832
|
-
) : /* @__PURE__ */ t.jsx("div", { className: U(
|
|
2833
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2835
|
+
) : /* @__PURE__ */ t.jsx("div", { className: U(H.blockImage, H.modalImage), children: /* @__PURE__ */ t.jsx(j, { name: "Image" }) }) }),
|
|
2836
|
+
/* @__PURE__ */ t.jsxs("div", { className: H.cardInfo, children: [
|
|
2834
2837
|
/* @__PURE__ */ t.jsx("div", { id: "h5", children: l.productData.compareAtPrice && (l.productData.compareAtPrice.amount || 0) - (l.productData.minPrice.amount || 0) > 0 ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
2835
2838
|
at(l.productData.name, !1),
|
|
2836
2839
|
/* @__PURE__ */ t.jsxs(
|
|
2837
2840
|
"span",
|
|
2838
2841
|
{
|
|
2839
|
-
className:
|
|
2842
|
+
className: H.price,
|
|
2840
2843
|
id: "md",
|
|
2841
2844
|
children: [
|
|
2842
2845
|
/* @__PURE__ */ t.jsx(
|
|
2843
2846
|
"span",
|
|
2844
2847
|
{
|
|
2845
|
-
className:
|
|
2848
|
+
className: H.newPrice,
|
|
2846
2849
|
id: "md",
|
|
2847
2850
|
children: Q({
|
|
2848
2851
|
amount: l.productData.minPrice.amount,
|
|
@@ -2853,7 +2856,7 @@ const is = (h) => {
|
|
|
2853
2856
|
/* @__PURE__ */ t.jsx(
|
|
2854
2857
|
"span",
|
|
2855
2858
|
{
|
|
2856
|
-
className:
|
|
2859
|
+
className: H.oldPrice,
|
|
2857
2860
|
id: "md",
|
|
2858
2861
|
children: Q({
|
|
2859
2862
|
amount: l.productData.compareAtPrice.amount,
|
|
@@ -2869,7 +2872,7 @@ const is = (h) => {
|
|
|
2869
2872
|
/* @__PURE__ */ t.jsx(
|
|
2870
2873
|
"span",
|
|
2871
2874
|
{
|
|
2872
|
-
className:
|
|
2875
|
+
className: H.newPrice,
|
|
2873
2876
|
id: "md",
|
|
2874
2877
|
children: Q({
|
|
2875
2878
|
amount: l.productData.minPrice.amount,
|
|
@@ -2881,7 +2884,7 @@ const is = (h) => {
|
|
|
2881
2884
|
l.productData.shortDescription && /* @__PURE__ */ t.jsx(
|
|
2882
2885
|
"span",
|
|
2883
2886
|
{
|
|
2884
|
-
className:
|
|
2887
|
+
className: H.short,
|
|
2885
2888
|
id: "md",
|
|
2886
2889
|
dangerouslySetInnerHTML: {
|
|
2887
2890
|
__html: at(l.productData.shortDescription)
|
|
@@ -2889,7 +2892,7 @@ const is = (h) => {
|
|
|
2889
2892
|
}
|
|
2890
2893
|
)
|
|
2891
2894
|
] }),
|
|
2892
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2895
|
+
/* @__PURE__ */ t.jsxs("div", { className: H.cardButtons, children: [
|
|
2893
2896
|
/* @__PURE__ */ t.jsx(
|
|
2894
2897
|
R,
|
|
2895
2898
|
{
|
|
@@ -2916,7 +2919,7 @@ const is = (h) => {
|
|
|
2916
2919
|
},
|
|
2917
2920
|
l.id
|
|
2918
2921
|
)) }),
|
|
2919
|
-
_ && /* @__PURE__ */ t.jsx("div", { className:
|
|
2922
|
+
_ && /* @__PURE__ */ t.jsx("div", { className: H.loading, children: /* @__PURE__ */ t.jsx($t, {}) })
|
|
2920
2923
|
]
|
|
2921
2924
|
}
|
|
2922
2925
|
) });
|
|
@@ -2953,7 +2956,7 @@ export {
|
|
|
2953
2956
|
Kn as ProductCardModal,
|
|
2954
2957
|
is as ProductOptions,
|
|
2955
2958
|
ai as RadioUI,
|
|
2956
|
-
|
|
2959
|
+
kt as RangeSelector,
|
|
2957
2960
|
ot as Select,
|
|
2958
2961
|
oi as SelectInfiniteList,
|
|
2959
2962
|
ci as SelectTypeText,
|