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