@billgangcom/theme-lib 1.63.0 → 1.64.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/abstractions/PageContext.d.ts +2 -1
- package/dist/builder.cjs.js +4 -4
- package/dist/builder.es.js +498 -502
- package/dist/{index-DnpjVF1z.cjs → index-CWZkhE-z.cjs} +21 -21
- package/dist/{index-DV89YV-L.js → index-Dg3k5gYy.js} +3850 -3846
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +1 -1
- package/dist/ui/ProductCardButtons/index.d.ts +9 -1
- package/dist/ui/ProductCardModal/index.d.ts +9 -0
- package/dist/ui/ProductOptions/index.d.ts +4 -0
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +1286 -1043
- package/package.json +2 -2
package/dist/ui.es.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { j as t, I as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
import { j as t, I as v, c as V, a as pt, S as ot, R as St, B as ct, O as _t, d as lt, u as gt, e as ft, P as xt, D as vt, f as jt, v as bt, g as yt, C as Nt, h as H, i as Pt, k as at, l as Tt, m as rt, n as Mt, o as mt, p as G, L as At, r as ut, t as dt, s as It, w as F, x as Ot, M as kt, y as wt, z as Et, A as $t, E as qt, F as Dt, G as Rt } from "./index-Dg3k5gYy.js";
|
|
2
|
+
import { Q as Ki, J as Zi, N as ta, H as ea, T as na, K as sa } from "./index-Dg3k5gYy.js";
|
|
3
|
+
import x from "react";
|
|
4
4
|
import "@phosphor-icons/react";
|
|
5
|
-
const
|
|
6
|
-
wrapper:
|
|
7
|
-
alignmentBlock:
|
|
8
|
-
title:
|
|
9
|
-
subtitle:
|
|
10
|
-
alignmentContent:
|
|
11
|
-
alignments:
|
|
12
|
-
alignment:
|
|
13
|
-
circle:
|
|
14
|
-
paddings:
|
|
15
|
-
padding:
|
|
16
|
-
active:
|
|
17
|
-
input:
|
|
18
|
-
},
|
|
5
|
+
const Lt = "_wrapper_1vmyb_2", zt = "_alignmentBlock_1vmyb_8", Ft = "_title_1vmyb_15", Vt = "_subtitle_1vmyb_22", Ut = "_alignmentContent_1vmyb_29", Ht = "_alignments_1vmyb_37", Yt = "_alignment_1vmyb_8", Wt = "_circle_1vmyb_60", Gt = "_paddings_1vmyb_67", Qt = "_padding_1vmyb_67", Xt = "_active_1vmyb_91", Jt = "_input_1vmyb_98", X = {
|
|
6
|
+
wrapper: Lt,
|
|
7
|
+
alignmentBlock: zt,
|
|
8
|
+
title: Ft,
|
|
9
|
+
subtitle: Vt,
|
|
10
|
+
alignmentContent: Ut,
|
|
11
|
+
alignments: Ht,
|
|
12
|
+
alignment: Yt,
|
|
13
|
+
circle: Wt,
|
|
14
|
+
paddings: Gt,
|
|
15
|
+
padding: Qt,
|
|
16
|
+
active: Xt,
|
|
17
|
+
input: Jt
|
|
18
|
+
}, Kt = [
|
|
19
19
|
"topLeft",
|
|
20
20
|
"top",
|
|
21
21
|
"topRight",
|
|
@@ -25,10 +25,10 @@ const Et = "_wrapper_1vmyb_2", Dt = "_alignmentBlock_1vmyb_8", Rt = "_title_1vmy
|
|
|
25
25
|
"bottomLeft",
|
|
26
26
|
"bottom",
|
|
27
27
|
"bottomRight"
|
|
28
|
-
],
|
|
29
|
-
const { alignment: s, padding: e, setPadding: n, setAlignment: i } =
|
|
30
|
-
function
|
|
31
|
-
switch (
|
|
28
|
+
], Zt = ["left", "top", "right", "bottom"], Ai = (o) => {
|
|
29
|
+
const { alignment: s, padding: e, setPadding: n, setAlignment: i } = o;
|
|
30
|
+
function c(r) {
|
|
31
|
+
switch (r) {
|
|
32
32
|
case "left":
|
|
33
33
|
case "topLeft":
|
|
34
34
|
case "bottomLeft":
|
|
@@ -45,8 +45,8 @@ const Et = "_wrapper_1vmyb_2", Dt = "_alignmentBlock_1vmyb_8", Rt = "_title_1vmy
|
|
|
45
45
|
return "TextAlignCenter";
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
function u(
|
|
49
|
-
switch (
|
|
48
|
+
function u(r) {
|
|
49
|
+
switch (r) {
|
|
50
50
|
case "left":
|
|
51
51
|
return "AlignLeft";
|
|
52
52
|
case "right":
|
|
@@ -57,40 +57,40 @@ const Et = "_wrapper_1vmyb_2", Dt = "_alignmentBlock_1vmyb_8", Rt = "_title_1vmy
|
|
|
57
57
|
return "AlignBottom";
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
const [
|
|
61
|
-
return /* @__PURE__ */ t.jsxs("div", { className:
|
|
62
|
-
/* @__PURE__ */ t.jsx("h3", { className:
|
|
63
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
64
|
-
/* @__PURE__ */ t.jsx("h5", { className:
|
|
65
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
66
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
60
|
+
const [l, m] = x.useState(null), [p, B] = x.useState(null);
|
|
61
|
+
return /* @__PURE__ */ t.jsxs("div", { className: X.layout, children: [
|
|
62
|
+
/* @__PURE__ */ t.jsx("h3", { className: X.title, children: "Layout (for Desktop version)" }),
|
|
63
|
+
/* @__PURE__ */ t.jsxs("div", { className: X.alignmentBlock, children: [
|
|
64
|
+
/* @__PURE__ */ t.jsx("h5", { className: X.subtitle, children: "Alignment" }),
|
|
65
|
+
/* @__PURE__ */ t.jsxs("div", { className: X.alignmentContent, children: [
|
|
66
|
+
/* @__PURE__ */ t.jsx("div", { className: X.alignments, children: Kt.map((r) => /* @__PURE__ */ t.jsxs(
|
|
67
67
|
"div",
|
|
68
68
|
{
|
|
69
69
|
onClick: () => {
|
|
70
|
-
i(
|
|
70
|
+
i(r);
|
|
71
71
|
},
|
|
72
|
-
className:
|
|
72
|
+
className: X.alignment,
|
|
73
73
|
onMouseEnter: () => {
|
|
74
|
-
m(
|
|
74
|
+
m(r);
|
|
75
75
|
},
|
|
76
76
|
onMouseLeave: () => {
|
|
77
77
|
m(null);
|
|
78
78
|
},
|
|
79
79
|
children: [
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
r !== s && l !== r && /* @__PURE__ */ t.jsx("div", { className: X.circle }),
|
|
81
|
+
r !== s && l === r && /* @__PURE__ */ t.jsx(
|
|
82
|
+
v,
|
|
83
83
|
{
|
|
84
|
-
name:
|
|
84
|
+
name: c(l),
|
|
85
85
|
fill: "#c2c2c2",
|
|
86
86
|
width: 22,
|
|
87
87
|
height: 22
|
|
88
88
|
}
|
|
89
89
|
),
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
r === s && /* @__PURE__ */ t.jsx(
|
|
91
|
+
v,
|
|
92
92
|
{
|
|
93
|
-
name:
|
|
93
|
+
name: c(s),
|
|
94
94
|
fill: "#FF3F19",
|
|
95
95
|
width: 22,
|
|
96
96
|
height: 22
|
|
@@ -98,37 +98,37 @@ const Et = "_wrapper_1vmyb_2", Dt = "_alignmentBlock_1vmyb_8", Rt = "_title_1vmy
|
|
|
98
98
|
)
|
|
99
99
|
]
|
|
100
100
|
},
|
|
101
|
-
|
|
101
|
+
r
|
|
102
102
|
)) }),
|
|
103
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
103
|
+
/* @__PURE__ */ t.jsx("div", { className: X.paddings, children: Zt.map((r) => /* @__PURE__ */ t.jsxs(
|
|
104
104
|
"label",
|
|
105
105
|
{
|
|
106
|
-
className:
|
|
107
|
-
[
|
|
106
|
+
className: V(X.padding, {
|
|
107
|
+
[X.active]: p === r
|
|
108
108
|
}),
|
|
109
109
|
onFocus: () => {
|
|
110
|
-
|
|
110
|
+
B(r);
|
|
111
111
|
},
|
|
112
112
|
onBlur: () => {
|
|
113
|
-
|
|
113
|
+
B(null);
|
|
114
114
|
},
|
|
115
115
|
children: [
|
|
116
116
|
/* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
117
|
-
|
|
117
|
+
v,
|
|
118
118
|
{
|
|
119
|
-
name: u(
|
|
119
|
+
name: u(r),
|
|
120
120
|
width: 20,
|
|
121
121
|
height: 20
|
|
122
122
|
}
|
|
123
123
|
) }),
|
|
124
124
|
/* @__PURE__ */ t.jsx(
|
|
125
|
-
|
|
125
|
+
pt,
|
|
126
126
|
{
|
|
127
127
|
type: "number",
|
|
128
|
-
value: String(e[
|
|
129
|
-
onChange: (
|
|
128
|
+
value: String(e[r]),
|
|
129
|
+
onChange: (a) => n({
|
|
130
130
|
...e,
|
|
131
|
-
[
|
|
131
|
+
[r]: Math.min(Number(a), 999)
|
|
132
132
|
}),
|
|
133
133
|
max: 999,
|
|
134
134
|
paddingless: !0,
|
|
@@ -137,66 +137,66 @@ const Et = "_wrapper_1vmyb_2", Dt = "_alignmentBlock_1vmyb_8", Rt = "_title_1vmy
|
|
|
137
137
|
)
|
|
138
138
|
]
|
|
139
139
|
},
|
|
140
|
-
|
|
140
|
+
r
|
|
141
141
|
)) })
|
|
142
142
|
] })
|
|
143
143
|
] })
|
|
144
144
|
] });
|
|
145
|
-
},
|
|
146
|
-
title:
|
|
147
|
-
subtitle:
|
|
148
|
-
header:
|
|
149
|
-
text:
|
|
150
|
-
productsBlock:
|
|
151
|
-
top:
|
|
152
|
-
itemsBlock:
|
|
153
|
-
typeTexts:
|
|
154
|
-
block:
|
|
155
|
-
active:
|
|
156
|
-
products:
|
|
157
|
-
product:
|
|
158
|
-
button:
|
|
159
|
-
disabled:
|
|
160
|
-
image:
|
|
161
|
-
info:
|
|
162
|
-
name:
|
|
163
|
-
buttons:
|
|
164
|
-
modal:
|
|
165
|
-
link:
|
|
166
|
-
modalOptions:
|
|
167
|
-
addButton:
|
|
168
|
-
deleteButton:
|
|
169
|
-
},
|
|
145
|
+
}, te = "_title_82zux_1", ee = "_subtitle_82zux_5", ne = "_header_82zux_12", se = "_text_82zux_13", ie = "_productsBlock_82zux_14", ae = "_top_82zux_26", oe = "_itemsBlock_82zux_35", ce = "_typeTexts_82zux_41", le = "_block_82zux_48", re = "_active_82zux_61", de = "_products_82zux_14", ue = "_product_82zux_14", me = "_button_82zux_80", he = "_disabled_82zux_91", pe = "_image_82zux_95", _e = "_info_82zux_102", ge = "_name_82zux_114", fe = "_buttons_82zux_118", xe = "_modal_82zux_125", ve = "_link_82zux_145", je = "_modalOptions_82zux_151", be = "_addButton_82zux_157", ye = "_deleteButton_82zux_179", J = {
|
|
146
|
+
title: te,
|
|
147
|
+
subtitle: ee,
|
|
148
|
+
header: ne,
|
|
149
|
+
text: se,
|
|
150
|
+
productsBlock: ie,
|
|
151
|
+
top: ae,
|
|
152
|
+
itemsBlock: oe,
|
|
153
|
+
typeTexts: ce,
|
|
154
|
+
block: le,
|
|
155
|
+
active: re,
|
|
156
|
+
products: de,
|
|
157
|
+
product: ue,
|
|
158
|
+
button: me,
|
|
159
|
+
disabled: he,
|
|
160
|
+
image: pe,
|
|
161
|
+
info: _e,
|
|
162
|
+
name: ge,
|
|
163
|
+
buttons: fe,
|
|
164
|
+
modal: xe,
|
|
165
|
+
link: ve,
|
|
166
|
+
modalOptions: je,
|
|
167
|
+
addButton: be,
|
|
168
|
+
deleteButton: ye
|
|
169
|
+
}, Oi = (o) => {
|
|
170
170
|
const {
|
|
171
171
|
isActiveItems: s,
|
|
172
172
|
setIsActiveItems: e,
|
|
173
173
|
items: n,
|
|
174
174
|
setItems: i,
|
|
175
|
-
other:
|
|
175
|
+
other: c,
|
|
176
176
|
title: u,
|
|
177
|
-
subtitle:
|
|
177
|
+
subtitle: l,
|
|
178
178
|
draggable: m = !1,
|
|
179
|
-
withImage:
|
|
180
|
-
addable:
|
|
181
|
-
itemsOptions:
|
|
182
|
-
hasRangeSelector:
|
|
183
|
-
rangeSelectorOptions:
|
|
184
|
-
limit:
|
|
185
|
-
autoScrollInterval:
|
|
186
|
-
deletable:
|
|
187
|
-
} =
|
|
188
|
-
function
|
|
189
|
-
if (
|
|
190
|
-
return
|
|
179
|
+
withImage: p = !1,
|
|
180
|
+
addable: B = !0,
|
|
181
|
+
itemsOptions: r,
|
|
182
|
+
hasRangeSelector: a = !1,
|
|
183
|
+
rangeSelectorOptions: j,
|
|
184
|
+
limit: d,
|
|
185
|
+
autoScrollInterval: S,
|
|
186
|
+
deletable: g
|
|
187
|
+
} = o;
|
|
188
|
+
function y(k) {
|
|
189
|
+
if (p)
|
|
190
|
+
return k ? /* @__PURE__ */ t.jsx(
|
|
191
191
|
"img",
|
|
192
192
|
{
|
|
193
|
-
src: `https://imagedelivery.net/${
|
|
193
|
+
src: `https://imagedelivery.net/${k[0]}/w=1000`,
|
|
194
194
|
alt: "image",
|
|
195
195
|
width: 16,
|
|
196
196
|
height: 16
|
|
197
197
|
}
|
|
198
198
|
) : /* @__PURE__ */ t.jsx(
|
|
199
|
-
|
|
199
|
+
v,
|
|
200
200
|
{
|
|
201
201
|
name: "Image",
|
|
202
202
|
width: 16,
|
|
@@ -205,12 +205,12 @@ const Et = "_wrapper_1vmyb_2", Dt = "_alignmentBlock_1vmyb_8", Rt = "_title_1vmy
|
|
|
205
205
|
}
|
|
206
206
|
);
|
|
207
207
|
}
|
|
208
|
-
const
|
|
209
|
-
const
|
|
210
|
-
if (
|
|
211
|
-
const
|
|
208
|
+
const q = (k, h = !1) => {
|
|
209
|
+
const $ = r.find((L) => L.id === k);
|
|
210
|
+
if (!$) return;
|
|
211
|
+
const R = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
212
212
|
m && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
213
|
-
|
|
213
|
+
v,
|
|
214
214
|
{
|
|
215
215
|
name: "DotsSixVertical",
|
|
216
216
|
hoverable: !0,
|
|
@@ -219,56 +219,56 @@ const Et = "_wrapper_1vmyb_2", Dt = "_alignmentBlock_1vmyb_8", Rt = "_title_1vmy
|
|
|
219
219
|
}
|
|
220
220
|
) }),
|
|
221
221
|
/* @__PURE__ */ t.jsx(
|
|
222
|
-
|
|
222
|
+
lt,
|
|
223
223
|
{
|
|
224
|
-
onChange: (
|
|
225
|
-
const
|
|
226
|
-
if (!
|
|
227
|
-
const
|
|
228
|
-
i([...
|
|
224
|
+
onChange: (L) => {
|
|
225
|
+
const I = [...n], b = r.find((f) => f.name === L);
|
|
226
|
+
if (!b) return;
|
|
227
|
+
const M = b.id, P = I.map((f) => f === k ? M : f);
|
|
228
|
+
i([...P]);
|
|
229
229
|
},
|
|
230
|
-
value:
|
|
231
|
-
options:
|
|
232
|
-
leftAddon:
|
|
230
|
+
value: $.name,
|
|
231
|
+
options: r.filter((L) => !n.find((I) => I === L.id)).map((L) => L.name),
|
|
232
|
+
leftAddon: y($.images)
|
|
233
233
|
}
|
|
234
234
|
),
|
|
235
|
-
|
|
236
|
-
|
|
235
|
+
h && /* @__PURE__ */ t.jsx("div", { className: J.buttons, children: /* @__PURE__ */ t.jsx("div", { className: J.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
236
|
+
v,
|
|
237
237
|
{
|
|
238
238
|
name: "Trash",
|
|
239
239
|
hoverable: !0,
|
|
240
240
|
width: 20,
|
|
241
241
|
height: 20,
|
|
242
242
|
fill: "#C12A2A",
|
|
243
|
-
onClick: () => i(n.filter((
|
|
243
|
+
onClick: () => i(n.filter((L) => L !== k))
|
|
244
244
|
}
|
|
245
245
|
) }) })
|
|
246
246
|
] });
|
|
247
247
|
return /* @__PURE__ */ t.jsx(
|
|
248
248
|
"div",
|
|
249
249
|
{
|
|
250
|
-
className:
|
|
251
|
-
children:
|
|
250
|
+
className: J.product,
|
|
251
|
+
children: R
|
|
252
252
|
},
|
|
253
|
-
|
|
253
|
+
k
|
|
254
254
|
);
|
|
255
255
|
};
|
|
256
|
-
return /* @__PURE__ */ t.jsxs("div", { className:
|
|
257
|
-
(u || s !== void 0) && /* @__PURE__ */ t.jsxs("div", { className:
|
|
258
|
-
u && /* @__PURE__ */ t.jsx("h3", { className:
|
|
256
|
+
return /* @__PURE__ */ t.jsxs("div", { className: J.productsBlock, children: [
|
|
257
|
+
(u || s !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: J.top, children: [
|
|
258
|
+
u && /* @__PURE__ */ t.jsx("h3", { className: J.title, children: u }),
|
|
259
259
|
s !== void 0 && /* @__PURE__ */ t.jsx(
|
|
260
|
-
|
|
260
|
+
ot,
|
|
261
261
|
{
|
|
262
262
|
current: s,
|
|
263
|
-
onChange: (
|
|
263
|
+
onChange: (k) => e == null ? void 0 : e(k)
|
|
264
264
|
}
|
|
265
265
|
)
|
|
266
266
|
] }),
|
|
267
|
-
|
|
268
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
269
|
-
|
|
270
|
-
n.map((
|
|
271
|
-
|
|
267
|
+
a && j && /* @__PURE__ */ t.jsx(St, { ...j }),
|
|
268
|
+
/* @__PURE__ */ t.jsxs("div", { className: J.products, children: [
|
|
269
|
+
l && /* @__PURE__ */ t.jsx("h5", { className: J.subtitle, children: l }),
|
|
270
|
+
n.map((k) => q(k, g)),
|
|
271
|
+
B && /* @__PURE__ */ t.jsx(
|
|
272
272
|
"div",
|
|
273
273
|
{
|
|
274
274
|
style: {
|
|
@@ -278,33 +278,33 @@ const Et = "_wrapper_1vmyb_2", Dt = "_alignmentBlock_1vmyb_8", Rt = "_title_1vmy
|
|
|
278
278
|
gap: 5
|
|
279
279
|
},
|
|
280
280
|
children: /* @__PURE__ */ t.jsx(
|
|
281
|
-
|
|
281
|
+
ct,
|
|
282
282
|
{
|
|
283
283
|
withoutHover: !0,
|
|
284
|
-
className:
|
|
285
|
-
[
|
|
284
|
+
className: V(J.button, {
|
|
285
|
+
[J.disabled]: !!(d && d <= n.length || n.length === r.length)
|
|
286
286
|
}),
|
|
287
287
|
size: "s",
|
|
288
|
-
disabled: !!(
|
|
288
|
+
disabled: !!(d && d <= n.length || n.length === r.length),
|
|
289
289
|
onClick: () => {
|
|
290
|
-
const
|
|
291
|
-
let
|
|
292
|
-
if (
|
|
293
|
-
for (let
|
|
294
|
-
if (!n.find((
|
|
295
|
-
|
|
290
|
+
const k = [...n];
|
|
291
|
+
let h = null;
|
|
292
|
+
if (r) {
|
|
293
|
+
for (let $ = 0; $ < r.length; $++)
|
|
294
|
+
if (!n.find((R) => R === r[$].id)) {
|
|
295
|
+
h = r[$];
|
|
296
296
|
break;
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
|
-
|
|
299
|
+
k.push((h == null ? void 0 : h.id) || r[0].id), i(k);
|
|
300
300
|
},
|
|
301
301
|
style: {
|
|
302
302
|
width: "fit-content"
|
|
303
303
|
},
|
|
304
|
-
children: /* @__PURE__ */ t.jsxs("div", { className:
|
|
304
|
+
children: /* @__PURE__ */ t.jsxs("div", { className: J.addButton, children: [
|
|
305
305
|
/* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
|
|
306
306
|
/* @__PURE__ */ t.jsx(
|
|
307
|
-
|
|
307
|
+
v,
|
|
308
308
|
{
|
|
309
309
|
name: "Plus",
|
|
310
310
|
width: 16,
|
|
@@ -317,14 +317,14 @@ const Et = "_wrapper_1vmyb_2", Dt = "_alignmentBlock_1vmyb_8", Rt = "_title_1vmy
|
|
|
317
317
|
}
|
|
318
318
|
)
|
|
319
319
|
] }),
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
320
|
+
c !== void 0 && /* @__PURE__ */ t.jsx(_t, { items: c }),
|
|
321
|
+
S !== void 0 && /* @__PURE__ */ t.jsx(
|
|
322
|
+
pt,
|
|
323
323
|
{
|
|
324
324
|
label: "Auto scroll interval",
|
|
325
325
|
type: "number",
|
|
326
|
-
value: String(
|
|
327
|
-
onChange: (
|
|
326
|
+
value: String(S.scrollInterval),
|
|
327
|
+
onChange: (k) => S.setScrollInterval(Number(k)),
|
|
328
328
|
min: 0.1,
|
|
329
329
|
max: 100,
|
|
330
330
|
style: {
|
|
@@ -334,44 +334,44 @@ const Et = "_wrapper_1vmyb_2", Dt = "_alignmentBlock_1vmyb_8", Rt = "_title_1vmy
|
|
|
334
334
|
}
|
|
335
335
|
)
|
|
336
336
|
] });
|
|
337
|
-
},
|
|
338
|
-
title:
|
|
339
|
-
subtitle:
|
|
340
|
-
header:
|
|
341
|
-
text:
|
|
342
|
-
productsBlock:
|
|
343
|
-
top:
|
|
344
|
-
itemsBlock:
|
|
345
|
-
typeTexts:
|
|
346
|
-
block:
|
|
347
|
-
active:
|
|
348
|
-
products:
|
|
349
|
-
product:
|
|
350
|
-
button:
|
|
351
|
-
disabled:
|
|
352
|
-
image:
|
|
353
|
-
info:
|
|
354
|
-
name:
|
|
355
|
-
buttons:
|
|
356
|
-
modal:
|
|
357
|
-
link:
|
|
358
|
-
modalOptions:
|
|
359
|
-
addButton:
|
|
360
|
-
deleteButton:
|
|
361
|
-
closeIcon:
|
|
337
|
+
}, Ne = "_title_roi3a_1", Ie = "_subtitle_roi3a_5", ke = "_header_roi3a_12", Ce = "_text_roi3a_13", Se = "_productsBlock_roi3a_14", we = "_top_roi3a_26", $e = "_itemsBlock_roi3a_35", qe = "_typeTexts_roi3a_41", Be = "_block_roi3a_48", Pe = "_active_roi3a_61", Te = "_products_roi3a_14", Me = "_product_roi3a_14", Ae = "_button_roi3a_80", Oe = "_disabled_roi3a_91", Ee = "_image_roi3a_95", De = "_info_roi3a_102", Re = "_name_roi3a_114", Le = "_buttons_roi3a_118", ze = "_modal_roi3a_125", Fe = "_link_roi3a_145", Ve = "_modalOptions_roi3a_151", Ue = "_addButton_roi3a_164", He = "_deleteButton_roi3a_179", Ye = "_closeIcon_roi3a_191", Y = {
|
|
338
|
+
title: Ne,
|
|
339
|
+
subtitle: Ie,
|
|
340
|
+
header: ke,
|
|
341
|
+
text: Ce,
|
|
342
|
+
productsBlock: Se,
|
|
343
|
+
top: we,
|
|
344
|
+
itemsBlock: $e,
|
|
345
|
+
typeTexts: qe,
|
|
346
|
+
block: Be,
|
|
347
|
+
active: Pe,
|
|
348
|
+
products: Te,
|
|
349
|
+
product: Me,
|
|
350
|
+
button: Ae,
|
|
351
|
+
disabled: Oe,
|
|
352
|
+
image: Ee,
|
|
353
|
+
info: De,
|
|
354
|
+
name: Re,
|
|
355
|
+
buttons: Le,
|
|
356
|
+
modal: ze,
|
|
357
|
+
link: Fe,
|
|
358
|
+
modalOptions: Ve,
|
|
359
|
+
addButton: Ue,
|
|
360
|
+
deleteButton: He,
|
|
361
|
+
closeIcon: Ye
|
|
362
362
|
};
|
|
363
|
-
function
|
|
363
|
+
function We({ product: o, children: s }) {
|
|
364
364
|
const {
|
|
365
365
|
attributes: e,
|
|
366
366
|
listeners: n,
|
|
367
367
|
setNodeRef: i,
|
|
368
|
-
transform:
|
|
368
|
+
transform: c,
|
|
369
369
|
transition: u,
|
|
370
|
-
isDragging:
|
|
371
|
-
} =
|
|
372
|
-
id:
|
|
370
|
+
isDragging: l
|
|
371
|
+
} = yt({
|
|
372
|
+
id: o.id
|
|
373
373
|
}), m = {
|
|
374
|
-
transform:
|
|
374
|
+
transform: Nt.Transform.toString(c),
|
|
375
375
|
transition: u
|
|
376
376
|
};
|
|
377
377
|
return /* @__PURE__ */ t.jsx(
|
|
@@ -379,64 +379,64 @@ function Fe({ product: r, children: s }) {
|
|
|
379
379
|
{
|
|
380
380
|
ref: i,
|
|
381
381
|
style: m,
|
|
382
|
-
className: `${
|
|
382
|
+
className: `${Y.product} ${l ? Y.dragging : ""}`,
|
|
383
383
|
...e,
|
|
384
384
|
...n,
|
|
385
385
|
children: s
|
|
386
386
|
}
|
|
387
387
|
);
|
|
388
388
|
}
|
|
389
|
-
const
|
|
389
|
+
const Ei = (o) => {
|
|
390
390
|
const {
|
|
391
391
|
isActiveItems: s,
|
|
392
392
|
setIsActiveItems: e,
|
|
393
393
|
items: n,
|
|
394
394
|
setItems: i,
|
|
395
|
-
title:
|
|
395
|
+
title: c,
|
|
396
396
|
subtitle: u,
|
|
397
|
-
editable:
|
|
397
|
+
editable: l = !0,
|
|
398
398
|
draggable: m = !1,
|
|
399
|
-
deletable:
|
|
400
|
-
addable:
|
|
401
|
-
itemsType:
|
|
402
|
-
itemsOptions:
|
|
403
|
-
addableOptions:
|
|
404
|
-
limit:
|
|
405
|
-
} =
|
|
406
|
-
|
|
399
|
+
deletable: p = !0,
|
|
400
|
+
addable: B = !0,
|
|
401
|
+
itemsType: r,
|
|
402
|
+
itemsOptions: a,
|
|
403
|
+
addableOptions: j = {},
|
|
404
|
+
limit: d
|
|
405
|
+
} = o, [S, g] = x.useState(null), [y, q] = x.useState(null), k = x.useRef(null), h = gt(
|
|
406
|
+
ft(xt, {
|
|
407
407
|
activationConstraint: {
|
|
408
408
|
distance: 5
|
|
409
409
|
}
|
|
410
410
|
})
|
|
411
411
|
);
|
|
412
|
-
|
|
413
|
-
if (
|
|
414
|
-
const
|
|
415
|
-
i(
|
|
412
|
+
x.useEffect(() => {
|
|
413
|
+
if (S) {
|
|
414
|
+
const I = [...n].map((b) => b.id === S.id ? S : b);
|
|
415
|
+
i(I);
|
|
416
416
|
}
|
|
417
|
-
}, [
|
|
418
|
-
|
|
419
|
-
}, [
|
|
420
|
-
const
|
|
421
|
-
|
|
422
|
-
const
|
|
423
|
-
|
|
424
|
-
top:
|
|
425
|
-
left:
|
|
426
|
-
}),
|
|
427
|
-
},
|
|
428
|
-
const { active:
|
|
429
|
-
if (
|
|
430
|
-
const
|
|
431
|
-
if (
|
|
432
|
-
const
|
|
433
|
-
|
|
417
|
+
}, [S]), x.useEffect(() => {
|
|
418
|
+
k.current && y && (k.current.getBoundingClientRect().height, y.top);
|
|
419
|
+
}, [k.current, y]);
|
|
420
|
+
const $ = (I, b) => {
|
|
421
|
+
I.stopPropagation();
|
|
422
|
+
const M = I.target.getBoundingClientRect();
|
|
423
|
+
q({
|
|
424
|
+
top: M.top + window.scrollY,
|
|
425
|
+
left: M.left - 30
|
|
426
|
+
}), g(b);
|
|
427
|
+
}, R = (I) => {
|
|
428
|
+
const { active: b, over: M } = I;
|
|
429
|
+
if (M && b.id !== M.id) {
|
|
430
|
+
const P = n.findIndex((N) => N.id === b.id), f = n.findIndex((N) => N.id === M.id);
|
|
431
|
+
if (P !== -1 && f !== -1) {
|
|
432
|
+
const N = [...n], [A] = N.splice(P, 1);
|
|
433
|
+
N.splice(f, 0, A), i(N);
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
|
-
},
|
|
437
|
-
const
|
|
436
|
+
}, L = (I, b) => {
|
|
437
|
+
const M = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
438
438
|
m && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
439
|
-
|
|
439
|
+
v,
|
|
440
440
|
{
|
|
441
441
|
name: "DotsSixVertical",
|
|
442
442
|
hoverable: !0,
|
|
@@ -444,99 +444,99 @@ const ii = (r) => {
|
|
|
444
444
|
height: 20
|
|
445
445
|
}
|
|
446
446
|
) }),
|
|
447
|
-
|
|
448
|
-
|
|
447
|
+
r === "select" && a && /* @__PURE__ */ t.jsx(
|
|
448
|
+
lt,
|
|
449
449
|
{
|
|
450
|
-
onChange: (
|
|
451
|
-
const
|
|
452
|
-
if (!
|
|
453
|
-
const A =
|
|
454
|
-
...
|
|
450
|
+
onChange: (P) => {
|
|
451
|
+
const f = [...n], N = a.find((U) => U.name === P);
|
|
452
|
+
if (!N) return;
|
|
453
|
+
const A = f.map((U) => U.id === I.id ? {
|
|
454
|
+
...N,
|
|
455
455
|
name: {
|
|
456
|
-
"en-US":
|
|
456
|
+
"en-US": P
|
|
457
457
|
}
|
|
458
458
|
} : U);
|
|
459
|
-
|
|
460
|
-
...
|
|
459
|
+
g({
|
|
460
|
+
...I,
|
|
461
461
|
name: {
|
|
462
|
-
"en-US":
|
|
462
|
+
"en-US": P
|
|
463
463
|
}
|
|
464
464
|
}), i([...A]);
|
|
465
465
|
},
|
|
466
|
-
value:
|
|
467
|
-
options:
|
|
466
|
+
value: I.name,
|
|
467
|
+
options: a.filter((P) => !n.find((f) => f.name === P.name)).map((P) => P.name)
|
|
468
468
|
}
|
|
469
469
|
),
|
|
470
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
471
|
-
|
|
472
|
-
|
|
470
|
+
/* @__PURE__ */ t.jsxs("div", { className: Y.buttons, children: [
|
|
471
|
+
l && /* @__PURE__ */ t.jsx("div", { className: Y.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
472
|
+
v,
|
|
473
473
|
{
|
|
474
474
|
name: "Sliders",
|
|
475
475
|
hoverable: !0,
|
|
476
476
|
width: 20,
|
|
477
477
|
height: 20,
|
|
478
|
-
onClick: (
|
|
478
|
+
onClick: (P) => $(P, I)
|
|
479
479
|
}
|
|
480
480
|
) }),
|
|
481
|
-
|
|
482
|
-
|
|
481
|
+
p && /* @__PURE__ */ t.jsx("div", { className: Y.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
482
|
+
v,
|
|
483
483
|
{
|
|
484
484
|
name: "Trash",
|
|
485
485
|
hoverable: !0,
|
|
486
486
|
width: 20,
|
|
487
487
|
height: 20,
|
|
488
488
|
fill: "#C12A2A",
|
|
489
|
-
onClick: () => i(n.filter((
|
|
489
|
+
onClick: () => i(n.filter((P) => P.id !== I.id))
|
|
490
490
|
}
|
|
491
491
|
) })
|
|
492
492
|
] })
|
|
493
493
|
] });
|
|
494
494
|
return m ? /* @__PURE__ */ t.jsx(
|
|
495
|
-
|
|
495
|
+
We,
|
|
496
496
|
{
|
|
497
|
-
product:
|
|
498
|
-
index:
|
|
499
|
-
children:
|
|
497
|
+
product: I,
|
|
498
|
+
index: b,
|
|
499
|
+
children: M
|
|
500
500
|
},
|
|
501
|
-
|
|
501
|
+
I.id
|
|
502
502
|
) : /* @__PURE__ */ t.jsx(
|
|
503
503
|
"div",
|
|
504
504
|
{
|
|
505
|
-
className:
|
|
506
|
-
children:
|
|
505
|
+
className: Y.product,
|
|
506
|
+
children: M
|
|
507
507
|
},
|
|
508
|
-
|
|
508
|
+
I.id
|
|
509
509
|
);
|
|
510
510
|
};
|
|
511
|
-
return /* @__PURE__ */ t.jsxs("div", { className:
|
|
512
|
-
(
|
|
513
|
-
|
|
511
|
+
return /* @__PURE__ */ t.jsxs("div", { className: Y.productsBlock, children: [
|
|
512
|
+
(c || s !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: Y.top, children: [
|
|
513
|
+
c && /* @__PURE__ */ t.jsx("h3", { className: Y.title, children: c }),
|
|
514
514
|
s !== void 0 && /* @__PURE__ */ t.jsx(
|
|
515
|
-
|
|
515
|
+
ot,
|
|
516
516
|
{
|
|
517
517
|
current: s,
|
|
518
|
-
onChange: (
|
|
518
|
+
onChange: (I) => e == null ? void 0 : e(I)
|
|
519
519
|
}
|
|
520
520
|
)
|
|
521
521
|
] }),
|
|
522
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
523
|
-
u && /* @__PURE__ */ t.jsx("h5", { className:
|
|
522
|
+
/* @__PURE__ */ t.jsxs("div", { className: Y.products, children: [
|
|
523
|
+
u && /* @__PURE__ */ t.jsx("h5", { className: Y.subtitle, children: u }),
|
|
524
524
|
m ? /* @__PURE__ */ t.jsx(
|
|
525
|
-
|
|
525
|
+
vt,
|
|
526
526
|
{
|
|
527
|
-
sensors:
|
|
528
|
-
onDragEnd:
|
|
527
|
+
sensors: h,
|
|
528
|
+
onDragEnd: R,
|
|
529
529
|
children: /* @__PURE__ */ t.jsx(
|
|
530
|
-
|
|
530
|
+
jt,
|
|
531
531
|
{
|
|
532
|
-
items: n.map((
|
|
533
|
-
strategy:
|
|
534
|
-
children: n.map((
|
|
532
|
+
items: n.map((I) => I.id),
|
|
533
|
+
strategy: bt,
|
|
534
|
+
children: n.map((I, b) => L(I, b))
|
|
535
535
|
}
|
|
536
536
|
)
|
|
537
537
|
}
|
|
538
|
-
) : n.map((
|
|
539
|
-
|
|
538
|
+
) : n.map((I, b) => L(I, b)),
|
|
539
|
+
B && /* @__PURE__ */ t.jsx(
|
|
540
540
|
"div",
|
|
541
541
|
{
|
|
542
542
|
style: {
|
|
@@ -545,37 +545,37 @@ const ii = (r) => {
|
|
|
545
545
|
justifyContent: "center"
|
|
546
546
|
},
|
|
547
547
|
children: /* @__PURE__ */ t.jsx(
|
|
548
|
-
|
|
548
|
+
ct,
|
|
549
549
|
{
|
|
550
550
|
withoutHover: !0,
|
|
551
|
-
className:
|
|
552
|
-
[
|
|
551
|
+
className: V(Y.button, {
|
|
552
|
+
[Y.disabled]: !!(d && d <= n.length || n.length === (a == null ? void 0 : a.length))
|
|
553
553
|
}),
|
|
554
554
|
size: "s",
|
|
555
|
-
disabled: !!(
|
|
555
|
+
disabled: !!(d && d <= n.length || n.length === (a == null ? void 0 : a.length)),
|
|
556
556
|
onClick: () => {
|
|
557
|
-
const
|
|
558
|
-
let
|
|
559
|
-
if (
|
|
560
|
-
for (let
|
|
561
|
-
if (!n.find((
|
|
562
|
-
|
|
557
|
+
const I = [...n];
|
|
558
|
+
let b = null;
|
|
559
|
+
if (a) {
|
|
560
|
+
for (let M = 0; M < a.length; M++)
|
|
561
|
+
if (!n.find((P) => P.id === a[M].id)) {
|
|
562
|
+
b = a[M];
|
|
563
563
|
break;
|
|
564
564
|
}
|
|
565
565
|
}
|
|
566
|
-
|
|
567
|
-
name:
|
|
568
|
-
id: (
|
|
569
|
-
...
|
|
570
|
-
}), i(
|
|
566
|
+
r === "select" && a && I.push({
|
|
567
|
+
name: b ? b.name : a[0].name,
|
|
568
|
+
id: (b == null ? void 0 : b.id) || a[0].id,
|
|
569
|
+
...j
|
|
570
|
+
}), i(I);
|
|
571
571
|
},
|
|
572
572
|
style: {
|
|
573
573
|
width: "fit-content"
|
|
574
574
|
},
|
|
575
|
-
children: /* @__PURE__ */ t.jsxs("div", { className:
|
|
575
|
+
children: /* @__PURE__ */ t.jsxs("div", { className: Y.addButton, children: [
|
|
576
576
|
/* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
|
|
577
577
|
/* @__PURE__ */ t.jsx(
|
|
578
|
-
|
|
578
|
+
v,
|
|
579
579
|
{
|
|
580
580
|
name: "Plus",
|
|
581
581
|
width: 16,
|
|
@@ -590,99 +590,99 @@ const ii = (r) => {
|
|
|
590
590
|
] })
|
|
591
591
|
] });
|
|
592
592
|
};
|
|
593
|
-
function
|
|
594
|
-
const { product: s, children: e } =
|
|
593
|
+
function Ge(o) {
|
|
594
|
+
const { product: s, children: e } = o, { attributes: n, listeners: i, setNodeRef: c, transform: u, transition: l, isDragging: m } = yt({
|
|
595
595
|
id: s.id
|
|
596
|
-
}),
|
|
597
|
-
transform:
|
|
598
|
-
transition:
|
|
596
|
+
}), p = {
|
|
597
|
+
transform: Nt.Transform.toString(u),
|
|
598
|
+
transition: l
|
|
599
599
|
};
|
|
600
600
|
return /* @__PURE__ */ t.jsx(
|
|
601
601
|
"div",
|
|
602
602
|
{
|
|
603
|
-
ref:
|
|
604
|
-
style:
|
|
605
|
-
className: `${
|
|
603
|
+
ref: c,
|
|
604
|
+
style: p,
|
|
605
|
+
className: `${H.product} ${m ? H.dragging : ""}`,
|
|
606
606
|
...n,
|
|
607
607
|
...i,
|
|
608
608
|
children: e
|
|
609
609
|
}
|
|
610
610
|
);
|
|
611
611
|
}
|
|
612
|
-
const
|
|
612
|
+
const Di = (o) => {
|
|
613
613
|
const {
|
|
614
614
|
isActiveItems: s,
|
|
615
615
|
setIsActiveItems: e,
|
|
616
616
|
items: n,
|
|
617
617
|
setItems: i,
|
|
618
|
-
other:
|
|
618
|
+
other: c,
|
|
619
619
|
title: u,
|
|
620
|
-
subtitle:
|
|
620
|
+
subtitle: l,
|
|
621
621
|
editable: m = !0,
|
|
622
|
-
draggable:
|
|
623
|
-
withImage:
|
|
624
|
-
deletable:
|
|
625
|
-
addable:
|
|
626
|
-
itemsType:
|
|
627
|
-
itemsPlaceholder:
|
|
628
|
-
itemsOptions:
|
|
629
|
-
hasRangeSelector:
|
|
630
|
-
rangeSelectorOptions:
|
|
631
|
-
modalOptions:
|
|
632
|
-
addableOptions:
|
|
633
|
-
limit:
|
|
634
|
-
} =
|
|
622
|
+
draggable: p = !1,
|
|
623
|
+
withImage: B = !1,
|
|
624
|
+
deletable: r = !0,
|
|
625
|
+
addable: a = !0,
|
|
626
|
+
itemsType: j,
|
|
627
|
+
itemsPlaceholder: d = "",
|
|
628
|
+
itemsOptions: S,
|
|
629
|
+
hasRangeSelector: g = !1,
|
|
630
|
+
rangeSelectorOptions: y,
|
|
631
|
+
modalOptions: q,
|
|
632
|
+
addableOptions: k = {},
|
|
633
|
+
limit: h
|
|
634
|
+
} = o, [$, R] = x.useState(null), [L, I] = x.useState({
|
|
635
635
|
top: 0,
|
|
636
636
|
left: 0
|
|
637
|
-
}), [
|
|
638
|
-
|
|
637
|
+
}), [b, M] = x.useState(null), P = x.useRef(null), [f, N] = x.useState(!1), A = gt(
|
|
638
|
+
ft(xt, {
|
|
639
639
|
activationConstraint: {
|
|
640
640
|
distance: 5
|
|
641
641
|
}
|
|
642
642
|
})
|
|
643
643
|
);
|
|
644
|
-
|
|
645
|
-
const
|
|
646
|
-
|
|
644
|
+
x.useEffect(() => {
|
|
645
|
+
const _ = () => {
|
|
646
|
+
R(null), N(!1);
|
|
647
647
|
};
|
|
648
|
-
return document.body.addEventListener("click",
|
|
649
|
-
|
|
648
|
+
return document.body.addEventListener("click", _), R(null), N(!1), () => {
|
|
649
|
+
R(null), N(!1), document.body.removeEventListener("click", _);
|
|
650
650
|
};
|
|
651
|
-
}, []),
|
|
652
|
-
if (
|
|
653
|
-
const
|
|
654
|
-
i(
|
|
651
|
+
}, []), x.useEffect(() => {
|
|
652
|
+
if ($) {
|
|
653
|
+
const _ = [...n].map((E) => E.id === $.id ? $ : E);
|
|
654
|
+
i(_);
|
|
655
655
|
}
|
|
656
|
-
}, [
|
|
657
|
-
if (
|
|
658
|
-
const
|
|
659
|
-
let
|
|
660
|
-
|
|
661
|
-
top:
|
|
662
|
-
left:
|
|
656
|
+
}, [$]), x.useEffect(() => {
|
|
657
|
+
if (P.current && b) {
|
|
658
|
+
const _ = P.current.getBoundingClientRect().height, E = window.innerHeight;
|
|
659
|
+
let T = b.top;
|
|
660
|
+
T + _ > E + window.scrollY - 200 && (T = E + window.scrollY - _ - 200), T < 0 && (T = 10), I({
|
|
661
|
+
top: T,
|
|
662
|
+
left: b.left
|
|
663
663
|
});
|
|
664
664
|
}
|
|
665
|
-
}, [
|
|
666
|
-
const U = (
|
|
667
|
-
|
|
668
|
-
const
|
|
669
|
-
|
|
670
|
-
top:
|
|
671
|
-
left:
|
|
672
|
-
}),
|
|
665
|
+
}, [P.current, b]);
|
|
666
|
+
const U = (_, E) => {
|
|
667
|
+
_.stopPropagation();
|
|
668
|
+
const T = _.target.getBoundingClientRect();
|
|
669
|
+
M({
|
|
670
|
+
top: T.top + window.scrollY,
|
|
671
|
+
left: T.left - 30
|
|
672
|
+
}), R(E), N(!0);
|
|
673
673
|
};
|
|
674
|
-
function O(
|
|
675
|
-
if (
|
|
676
|
-
return
|
|
674
|
+
function O(_) {
|
|
675
|
+
if (B)
|
|
676
|
+
return _ ? /* @__PURE__ */ t.jsx(
|
|
677
677
|
"img",
|
|
678
678
|
{
|
|
679
|
-
src: `https://imagedelivery.net/${
|
|
679
|
+
src: `https://imagedelivery.net/${_[0]}/w=1000`,
|
|
680
680
|
alt: "image",
|
|
681
681
|
width: 16,
|
|
682
682
|
height: 16
|
|
683
683
|
}
|
|
684
684
|
) : /* @__PURE__ */ t.jsx(
|
|
685
|
-
|
|
685
|
+
v,
|
|
686
686
|
{
|
|
687
687
|
name: "Image",
|
|
688
688
|
width: 16,
|
|
@@ -691,20 +691,20 @@ const oi = (r) => {
|
|
|
691
691
|
}
|
|
692
692
|
);
|
|
693
693
|
}
|
|
694
|
-
const
|
|
695
|
-
const { active: E, over:
|
|
696
|
-
if (
|
|
697
|
-
const D = n.findIndex((
|
|
698
|
-
if (D !== -1 &&
|
|
699
|
-
const
|
|
700
|
-
|
|
694
|
+
const z = (_) => {
|
|
695
|
+
const { active: E, over: T } = _;
|
|
696
|
+
if (T && E.id !== T.id) {
|
|
697
|
+
const D = n.findIndex((W) => W.id === E.id), nt = n.findIndex((W) => W.id === T.id);
|
|
698
|
+
if (D !== -1 && nt !== -1) {
|
|
699
|
+
const W = [...n], [K] = W.splice(D, 1);
|
|
700
|
+
W.splice(nt, 0, K), i(W);
|
|
701
701
|
}
|
|
702
702
|
}
|
|
703
|
-
},
|
|
704
|
-
var
|
|
703
|
+
}, Z = (_) => {
|
|
704
|
+
var T;
|
|
705
705
|
const E = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
706
|
-
|
|
707
|
-
|
|
706
|
+
p && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
707
|
+
v,
|
|
708
708
|
{
|
|
709
709
|
name: "DotsSixVertical",
|
|
710
710
|
hoverable: !0,
|
|
@@ -712,140 +712,140 @@ const oi = (r) => {
|
|
|
712
712
|
height: 20
|
|
713
713
|
}
|
|
714
714
|
) }),
|
|
715
|
-
|
|
716
|
-
|
|
715
|
+
j === "select" && S && /* @__PURE__ */ t.jsx(
|
|
716
|
+
lt,
|
|
717
717
|
{
|
|
718
718
|
onChange: (D) => {
|
|
719
|
-
const
|
|
720
|
-
...
|
|
719
|
+
const W = [...n].map((K) => K.id === _.id ? {
|
|
720
|
+
..._,
|
|
721
721
|
name: {
|
|
722
722
|
"en-US": D
|
|
723
723
|
}
|
|
724
724
|
} : K);
|
|
725
|
-
|
|
726
|
-
...
|
|
725
|
+
R({
|
|
726
|
+
..._,
|
|
727
727
|
name: {
|
|
728
728
|
"en-US": D
|
|
729
729
|
}
|
|
730
|
-
}), i([...
|
|
730
|
+
}), i([...W]);
|
|
731
731
|
},
|
|
732
|
-
value:
|
|
733
|
-
options:
|
|
734
|
-
(D) => !n.find((
|
|
732
|
+
value: _.name["en-US"],
|
|
733
|
+
options: S.filter(
|
|
734
|
+
(D) => !n.find((nt) => nt.name["en-US"] === D)
|
|
735
735
|
),
|
|
736
|
-
leftAddon: O(
|
|
736
|
+
leftAddon: O(_.images)
|
|
737
737
|
}
|
|
738
738
|
),
|
|
739
|
-
|
|
740
|
-
|
|
739
|
+
j === "input" && /* @__PURE__ */ t.jsx(
|
|
740
|
+
pt,
|
|
741
741
|
{
|
|
742
742
|
onChange: (D) => {
|
|
743
|
-
const
|
|
744
|
-
...
|
|
743
|
+
const W = [...n].map((K) => K.id === _.id ? {
|
|
744
|
+
..._,
|
|
745
745
|
name: {
|
|
746
746
|
"en-US": D
|
|
747
747
|
}
|
|
748
748
|
} : K);
|
|
749
|
-
i([...
|
|
749
|
+
i([...W]);
|
|
750
750
|
},
|
|
751
|
-
value:
|
|
752
|
-
placeholder:
|
|
751
|
+
value: _.name["en-US"],
|
|
752
|
+
placeholder: d
|
|
753
753
|
}
|
|
754
754
|
),
|
|
755
|
-
|
|
756
|
-
|
|
755
|
+
j === "image" && /* @__PURE__ */ t.jsx(
|
|
756
|
+
Tt,
|
|
757
757
|
{
|
|
758
758
|
onChange: (D) => {
|
|
759
|
-
const
|
|
760
|
-
...
|
|
759
|
+
const W = [...n].map((K) => K.id === _.id ? {
|
|
760
|
+
..._,
|
|
761
761
|
images: D
|
|
762
762
|
} : K);
|
|
763
|
-
i([...
|
|
763
|
+
i([...W]);
|
|
764
764
|
},
|
|
765
|
-
activeImage: (
|
|
765
|
+
activeImage: (T = n.find((D) => D.id === _.id)) == null ? void 0 : T.images[0]
|
|
766
766
|
}
|
|
767
767
|
),
|
|
768
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
769
|
-
m && /* @__PURE__ */ t.jsx("div", { className:
|
|
770
|
-
|
|
768
|
+
/* @__PURE__ */ t.jsxs("div", { className: H.buttons, children: [
|
|
769
|
+
m && /* @__PURE__ */ t.jsx("div", { className: H.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
770
|
+
v,
|
|
771
771
|
{
|
|
772
772
|
name: "Sliders",
|
|
773
773
|
hoverable: !0,
|
|
774
774
|
width: 20,
|
|
775
775
|
height: 20,
|
|
776
|
-
onClick: (D) => U(D,
|
|
776
|
+
onClick: (D) => U(D, _)
|
|
777
777
|
}
|
|
778
778
|
) }),
|
|
779
|
-
|
|
780
|
-
|
|
779
|
+
r && /* @__PURE__ */ t.jsx("div", { className: H.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
780
|
+
v,
|
|
781
781
|
{
|
|
782
782
|
name: "Trash",
|
|
783
783
|
hoverable: !0,
|
|
784
784
|
width: 20,
|
|
785
785
|
height: 20,
|
|
786
786
|
fill: "#C12A2A",
|
|
787
|
-
onClick: () => i(n.filter((D) => D.id !==
|
|
787
|
+
onClick: () => i(n.filter((D) => D.id !== _.id))
|
|
788
788
|
}
|
|
789
789
|
) })
|
|
790
790
|
] })
|
|
791
791
|
] });
|
|
792
|
-
return
|
|
793
|
-
|
|
792
|
+
return p ? /* @__PURE__ */ t.jsx(
|
|
793
|
+
Ge,
|
|
794
794
|
{
|
|
795
|
-
product:
|
|
795
|
+
product: _,
|
|
796
796
|
children: E
|
|
797
797
|
},
|
|
798
|
-
|
|
798
|
+
_.id
|
|
799
799
|
) : /* @__PURE__ */ t.jsx(
|
|
800
800
|
"div",
|
|
801
801
|
{
|
|
802
|
-
className:
|
|
802
|
+
className: H.product,
|
|
803
803
|
children: E
|
|
804
804
|
},
|
|
805
|
-
|
|
805
|
+
_.id
|
|
806
806
|
);
|
|
807
807
|
};
|
|
808
|
-
return /* @__PURE__ */ t.jsxs("div", { className:
|
|
809
|
-
(u || s !== void 0) && /* @__PURE__ */ t.jsxs("div", { className:
|
|
810
|
-
u && /* @__PURE__ */ t.jsx("h3", { className:
|
|
808
|
+
return /* @__PURE__ */ t.jsxs("div", { className: H.productsBlock, children: [
|
|
809
|
+
(u || s !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: H.top, children: [
|
|
810
|
+
u && /* @__PURE__ */ t.jsx("h3", { className: H.title, children: u }),
|
|
811
811
|
s !== void 0 && /* @__PURE__ */ t.jsx(
|
|
812
|
-
|
|
812
|
+
ot,
|
|
813
813
|
{
|
|
814
814
|
current: s,
|
|
815
|
-
onChange: (
|
|
815
|
+
onChange: (_) => e == null ? void 0 : e(_)
|
|
816
816
|
}
|
|
817
817
|
)
|
|
818
818
|
] }),
|
|
819
|
-
|
|
820
|
-
|
|
819
|
+
$ && m && q && f && /* @__PURE__ */ t.jsx(
|
|
820
|
+
Pt,
|
|
821
821
|
{
|
|
822
|
-
ref:
|
|
823
|
-
activeItem:
|
|
824
|
-
setActiveItem:
|
|
825
|
-
popupPosition:
|
|
826
|
-
modalOptions:
|
|
827
|
-
setIsOpenModal:
|
|
822
|
+
ref: P,
|
|
823
|
+
activeItem: $,
|
|
824
|
+
setActiveItem: R,
|
|
825
|
+
popupPosition: L,
|
|
826
|
+
modalOptions: q,
|
|
827
|
+
setIsOpenModal: N
|
|
828
828
|
}
|
|
829
829
|
),
|
|
830
|
-
|
|
831
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
830
|
+
g && y && /* @__PURE__ */ t.jsx(St, { ...y }),
|
|
831
|
+
/* @__PURE__ */ t.jsxs("div", { className: H.products, children: [
|
|
832
|
+
l && /* @__PURE__ */ t.jsx("h5", { className: H.subtitle, children: l }),
|
|
833
|
+
p ? /* @__PURE__ */ t.jsx(
|
|
834
|
+
vt,
|
|
835
835
|
{
|
|
836
836
|
sensors: A,
|
|
837
|
-
onDragEnd:
|
|
837
|
+
onDragEnd: z,
|
|
838
838
|
children: /* @__PURE__ */ t.jsx(
|
|
839
|
-
|
|
839
|
+
jt,
|
|
840
840
|
{
|
|
841
|
-
items: n.map((
|
|
842
|
-
strategy:
|
|
843
|
-
children: n.map((
|
|
841
|
+
items: n.map((_) => _.id),
|
|
842
|
+
strategy: bt,
|
|
843
|
+
children: n.map((_) => Z(_))
|
|
844
844
|
}
|
|
845
845
|
)
|
|
846
846
|
}
|
|
847
|
-
) : n.map((
|
|
848
|
-
|
|
847
|
+
) : n.map((_) => Z(_)),
|
|
848
|
+
a && /* @__PURE__ */ t.jsx(
|
|
849
849
|
"div",
|
|
850
850
|
{
|
|
851
851
|
style: {
|
|
@@ -854,55 +854,55 @@ const oi = (r) => {
|
|
|
854
854
|
justifyContent: "center"
|
|
855
855
|
},
|
|
856
856
|
children: /* @__PURE__ */ t.jsx(
|
|
857
|
-
|
|
857
|
+
ct,
|
|
858
858
|
{
|
|
859
859
|
withoutHover: !0,
|
|
860
|
-
className:
|
|
861
|
-
[
|
|
860
|
+
className: V(H.button, {
|
|
861
|
+
[H.disabled]: !!(h && h <= n.length)
|
|
862
862
|
}),
|
|
863
863
|
size: "s",
|
|
864
|
-
disabled: !!(
|
|
864
|
+
disabled: !!(h && h <= n.length),
|
|
865
865
|
onClick: () => {
|
|
866
|
-
const
|
|
866
|
+
const _ = [...n];
|
|
867
867
|
let E = null;
|
|
868
|
-
if (
|
|
869
|
-
for (let
|
|
870
|
-
if (!n.find((D) => D.name["en-US"] ===
|
|
871
|
-
E =
|
|
868
|
+
if (S) {
|
|
869
|
+
for (let T = 0; T < S.length; T++)
|
|
870
|
+
if (!n.find((D) => D.name["en-US"] === S[T])) {
|
|
871
|
+
E = S[T];
|
|
872
872
|
break;
|
|
873
873
|
}
|
|
874
874
|
}
|
|
875
|
-
|
|
875
|
+
j === "select" && S ? _.push({
|
|
876
876
|
name: {
|
|
877
|
-
"en-US": E ||
|
|
877
|
+
"en-US": E || S[0]
|
|
878
878
|
},
|
|
879
|
-
id:
|
|
880
|
-
...
|
|
879
|
+
id: at(),
|
|
880
|
+
...k,
|
|
881
881
|
maxSymbols: 100
|
|
882
882
|
// пример значения
|
|
883
|
-
}) :
|
|
883
|
+
}) : j === "input" ? _.push({
|
|
884
884
|
name: {
|
|
885
885
|
"en-US": ""
|
|
886
886
|
},
|
|
887
|
-
id:
|
|
888
|
-
...
|
|
887
|
+
id: at(),
|
|
888
|
+
...k,
|
|
889
889
|
maxSymbols: 100
|
|
890
|
-
}) :
|
|
890
|
+
}) : _.push({
|
|
891
891
|
name: {
|
|
892
892
|
"en-US": `Image ${n.length + 1}`
|
|
893
893
|
},
|
|
894
|
-
id:
|
|
895
|
-
...
|
|
894
|
+
id: at(),
|
|
895
|
+
...k,
|
|
896
896
|
maxSymbols: 100
|
|
897
|
-
}), i(
|
|
897
|
+
}), i(_);
|
|
898
898
|
},
|
|
899
899
|
style: {
|
|
900
900
|
width: "fit-content"
|
|
901
901
|
},
|
|
902
|
-
children: /* @__PURE__ */ t.jsxs("div", { className:
|
|
902
|
+
children: /* @__PURE__ */ t.jsxs("div", { className: H.addButton, children: [
|
|
903
903
|
/* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
|
|
904
904
|
/* @__PURE__ */ t.jsx(
|
|
905
|
-
|
|
905
|
+
v,
|
|
906
906
|
{
|
|
907
907
|
name: "Plus",
|
|
908
908
|
width: 16,
|
|
@@ -915,120 +915,120 @@ const oi = (r) => {
|
|
|
915
915
|
}
|
|
916
916
|
)
|
|
917
917
|
] }),
|
|
918
|
-
|
|
918
|
+
c !== void 0 && /* @__PURE__ */ t.jsx(_t, { items: c })
|
|
919
919
|
] });
|
|
920
|
-
},
|
|
921
|
-
subtitle:
|
|
922
|
-
header:
|
|
923
|
-
text:
|
|
924
|
-
productsBlock:
|
|
925
|
-
buttonsBlock:
|
|
926
|
-
top:
|
|
927
|
-
itemsBlock:
|
|
928
|
-
typeTexts:
|
|
929
|
-
block:
|
|
930
|
-
active:
|
|
931
|
-
products:
|
|
932
|
-
product:
|
|
933
|
-
button:
|
|
934
|
-
image:
|
|
935
|
-
info:
|
|
936
|
-
name:
|
|
937
|
-
buttons:
|
|
938
|
-
modal:
|
|
939
|
-
other:
|
|
940
|
-
options:
|
|
941
|
-
addButton:
|
|
942
|
-
deleteButton:
|
|
943
|
-
},
|
|
944
|
-
const { buttons: s, setButtons: e, deletable: n = !0, addable: i = !0, editableLink:
|
|
920
|
+
}, Qe = "_subtitle_jql1y_1", Xe = "_header_jql1y_8", Je = "_text_jql1y_9", Ke = "_productsBlock_jql1y_10", Ze = "_buttonsBlock_jql1y_11", tn = "_top_jql1y_23", en = "_itemsBlock_jql1y_32", nn = "_typeTexts_jql1y_38", sn = "_block_jql1y_45", an = "_active_jql1y_58", on = "_products_jql1y_10", cn = "_product_jql1y_10", ln = "_button_jql1y_11", rn = "_image_jql1y_88", dn = "_info_jql1y_95", un = "_name_jql1y_107", mn = "_buttons_jql1y_11", hn = "_modal_jql1y_118", pn = "_other_jql1y_138", _n = "_options_jql1y_144", gn = "_addButton_jql1y_150", fn = "_deleteButton_jql1y_165", tt = {
|
|
921
|
+
subtitle: Qe,
|
|
922
|
+
header: Xe,
|
|
923
|
+
text: Je,
|
|
924
|
+
productsBlock: Ke,
|
|
925
|
+
buttonsBlock: Ze,
|
|
926
|
+
top: tn,
|
|
927
|
+
itemsBlock: en,
|
|
928
|
+
typeTexts: nn,
|
|
929
|
+
block: sn,
|
|
930
|
+
active: an,
|
|
931
|
+
products: on,
|
|
932
|
+
product: cn,
|
|
933
|
+
button: ln,
|
|
934
|
+
image: rn,
|
|
935
|
+
info: dn,
|
|
936
|
+
name: un,
|
|
937
|
+
buttons: mn,
|
|
938
|
+
modal: hn,
|
|
939
|
+
other: pn,
|
|
940
|
+
options: _n,
|
|
941
|
+
addButton: gn,
|
|
942
|
+
deleteButton: fn
|
|
943
|
+
}, xn = (o) => {
|
|
944
|
+
const { buttons: s, setButtons: e, deletable: n = !0, addable: i = !0, editableLink: c = !0 } = o, { pages: u } = rt(), [l, m] = x.useState(null), [p, B] = x.useState({
|
|
945
945
|
top: 0,
|
|
946
946
|
left: 0
|
|
947
|
-
}), [
|
|
948
|
-
|
|
949
|
-
if (
|
|
950
|
-
const
|
|
951
|
-
e(
|
|
947
|
+
}), [r, a] = x.useState(null), j = x.useRef(null);
|
|
948
|
+
x.useEffect(() => {
|
|
949
|
+
if (l) {
|
|
950
|
+
const g = [...s].map((y) => y.id === l.id ? l : y);
|
|
951
|
+
e(g);
|
|
952
952
|
}
|
|
953
|
-
}, [
|
|
954
|
-
if (
|
|
955
|
-
const
|
|
956
|
-
let
|
|
957
|
-
|
|
958
|
-
top:
|
|
959
|
-
left:
|
|
953
|
+
}, [l]), x.useEffect(() => {
|
|
954
|
+
if (j.current && r) {
|
|
955
|
+
const g = j.current.getBoundingClientRect().height, y = window.innerHeight;
|
|
956
|
+
let q = r.top;
|
|
957
|
+
q + g > y + window.scrollY - 200 && (q = y + window.scrollY - g - 200), q < 0 && (q = 10), B({
|
|
958
|
+
top: q,
|
|
959
|
+
left: r.left
|
|
960
960
|
});
|
|
961
961
|
}
|
|
962
|
-
}, [
|
|
963
|
-
const
|
|
964
|
-
|
|
965
|
-
const
|
|
966
|
-
|
|
967
|
-
top:
|
|
968
|
-
left:
|
|
969
|
-
}), m(
|
|
970
|
-
},
|
|
971
|
-
const
|
|
972
|
-
...
|
|
962
|
+
}, [j.current, r]);
|
|
963
|
+
const d = (g, y) => {
|
|
964
|
+
g.stopPropagation();
|
|
965
|
+
const q = g.target.getBoundingClientRect();
|
|
966
|
+
a({
|
|
967
|
+
top: q.top + window.scrollY - 70,
|
|
968
|
+
left: q.left - (i ? 30 : 65)
|
|
969
|
+
}), m(y);
|
|
970
|
+
}, S = (g, y) => {
|
|
971
|
+
const q = [...s], k = {
|
|
972
|
+
...g,
|
|
973
973
|
id: Math.random().toString(36).substr(2, 9)
|
|
974
974
|
// Генерируем новый уникальный ID
|
|
975
975
|
};
|
|
976
|
-
|
|
976
|
+
q.splice(y + 1, 0, k), e(q);
|
|
977
977
|
};
|
|
978
|
-
return /* @__PURE__ */ t.jsxs("div", { className:
|
|
979
|
-
/* @__PURE__ */ t.jsx("h5", { className:
|
|
980
|
-
s.map((
|
|
978
|
+
return /* @__PURE__ */ t.jsxs("div", { className: tt.products, children: [
|
|
979
|
+
/* @__PURE__ */ t.jsx("h5", { className: tt.subtitle, children: "Button Type" }),
|
|
980
|
+
s.map((g, y) => /* @__PURE__ */ t.jsxs(
|
|
981
981
|
"div",
|
|
982
982
|
{
|
|
983
|
-
className:
|
|
983
|
+
className: tt.product,
|
|
984
984
|
children: [
|
|
985
985
|
/* @__PURE__ */ t.jsx(
|
|
986
|
-
|
|
986
|
+
lt,
|
|
987
987
|
{
|
|
988
|
-
onChange: (
|
|
989
|
-
const
|
|
990
|
-
...
|
|
991
|
-
type:
|
|
992
|
-
} :
|
|
993
|
-
e(
|
|
988
|
+
onChange: (q) => {
|
|
989
|
+
const h = [...s].map(($) => $.id === g.id ? {
|
|
990
|
+
...g,
|
|
991
|
+
type: q
|
|
992
|
+
} : $);
|
|
993
|
+
e(h);
|
|
994
994
|
},
|
|
995
|
-
value:
|
|
995
|
+
value: g.type,
|
|
996
996
|
options: ["Primary", "Secondary", "Tertiary"]
|
|
997
997
|
}
|
|
998
998
|
),
|
|
999
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1000
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
1001
|
-
|
|
999
|
+
/* @__PURE__ */ t.jsxs("div", { className: tt.buttons, children: [
|
|
1000
|
+
/* @__PURE__ */ t.jsx("div", { className: tt.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
1001
|
+
v,
|
|
1002
1002
|
{
|
|
1003
1003
|
name: "Copy",
|
|
1004
1004
|
hoverable: !0,
|
|
1005
1005
|
width: 20,
|
|
1006
1006
|
height: 20,
|
|
1007
1007
|
onClick: () => {
|
|
1008
|
-
|
|
1008
|
+
S(g, y);
|
|
1009
1009
|
}
|
|
1010
1010
|
}
|
|
1011
1011
|
) }),
|
|
1012
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
1013
|
-
|
|
1012
|
+
/* @__PURE__ */ t.jsx("div", { className: tt.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
1013
|
+
v,
|
|
1014
1014
|
{
|
|
1015
1015
|
name: "Sliders",
|
|
1016
1016
|
hoverable: !0,
|
|
1017
1017
|
width: 20,
|
|
1018
1018
|
height: 20,
|
|
1019
|
-
onClick: (
|
|
1020
|
-
|
|
1019
|
+
onClick: (q) => {
|
|
1020
|
+
d(q, g);
|
|
1021
1021
|
}
|
|
1022
1022
|
}
|
|
1023
1023
|
) }),
|
|
1024
|
-
n && /* @__PURE__ */ t.jsx("div", { className:
|
|
1025
|
-
|
|
1024
|
+
n && /* @__PURE__ */ t.jsx("div", { className: tt.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
1025
|
+
v,
|
|
1026
1026
|
{
|
|
1027
1027
|
name: "Trash",
|
|
1028
1028
|
hoverable: !0,
|
|
1029
1029
|
onClick: () => {
|
|
1030
|
-
const
|
|
1031
|
-
e(
|
|
1030
|
+
const q = s.filter((k) => k.id !== g.id);
|
|
1031
|
+
e(q);
|
|
1032
1032
|
},
|
|
1033
1033
|
width: 20,
|
|
1034
1034
|
height: 20,
|
|
@@ -1038,16 +1038,16 @@ const oi = (r) => {
|
|
|
1038
1038
|
] })
|
|
1039
1039
|
]
|
|
1040
1040
|
},
|
|
1041
|
-
|
|
1041
|
+
g.id
|
|
1042
1042
|
)),
|
|
1043
|
-
|
|
1044
|
-
|
|
1043
|
+
l && /* @__PURE__ */ t.jsx(
|
|
1044
|
+
Mt,
|
|
1045
1045
|
{
|
|
1046
|
-
ref:
|
|
1047
|
-
activeButton:
|
|
1046
|
+
ref: j,
|
|
1047
|
+
activeButton: l,
|
|
1048
1048
|
setActiveButton: m,
|
|
1049
|
-
popupPosition:
|
|
1050
|
-
editableLink:
|
|
1049
|
+
popupPosition: p,
|
|
1050
|
+
editableLink: c
|
|
1051
1051
|
}
|
|
1052
1052
|
),
|
|
1053
1053
|
i && /* @__PURE__ */ t.jsx(
|
|
@@ -1059,16 +1059,16 @@ const oi = (r) => {
|
|
|
1059
1059
|
justifyContent: "center"
|
|
1060
1060
|
},
|
|
1061
1061
|
children: /* @__PURE__ */ t.jsx(
|
|
1062
|
-
|
|
1062
|
+
ct,
|
|
1063
1063
|
{
|
|
1064
1064
|
withoutHover: !0,
|
|
1065
|
-
className:
|
|
1065
|
+
className: tt.button,
|
|
1066
1066
|
size: "s",
|
|
1067
1067
|
onClick: () => {
|
|
1068
|
-
const
|
|
1069
|
-
|
|
1068
|
+
const g = [...s];
|
|
1069
|
+
c ? g.push({
|
|
1070
1070
|
type: "Primary",
|
|
1071
|
-
id:
|
|
1071
|
+
id: at(),
|
|
1072
1072
|
typesText: [],
|
|
1073
1073
|
text: {
|
|
1074
1074
|
"en-US": "Button Name"
|
|
@@ -1076,9 +1076,9 @@ const oi = (r) => {
|
|
|
1076
1076
|
destination: "Go to Page",
|
|
1077
1077
|
page: u ? Object.values(u)[0].path : "/",
|
|
1078
1078
|
openInNewTab: !1
|
|
1079
|
-
}) :
|
|
1079
|
+
}) : g.push({
|
|
1080
1080
|
type: "Primary",
|
|
1081
|
-
id:
|
|
1081
|
+
id: at(),
|
|
1082
1082
|
typesText: [],
|
|
1083
1083
|
text: {
|
|
1084
1084
|
"en-US": "Create Ticket"
|
|
@@ -1086,15 +1086,15 @@ const oi = (r) => {
|
|
|
1086
1086
|
destination: "Go to Page",
|
|
1087
1087
|
page: u ? Object.values(u)[0].path : "/",
|
|
1088
1088
|
openInNewTab: !1
|
|
1089
|
-
}), e(
|
|
1089
|
+
}), e(g);
|
|
1090
1090
|
},
|
|
1091
1091
|
style: {
|
|
1092
1092
|
width: "fit-content"
|
|
1093
1093
|
},
|
|
1094
|
-
children: /* @__PURE__ */ t.jsxs("div", { className:
|
|
1094
|
+
children: /* @__PURE__ */ t.jsxs("div", { className: tt.addButton, children: [
|
|
1095
1095
|
/* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
|
|
1096
1096
|
/* @__PURE__ */ t.jsx(
|
|
1097
|
-
|
|
1097
|
+
v,
|
|
1098
1098
|
{
|
|
1099
1099
|
name: "Plus",
|
|
1100
1100
|
width: 16,
|
|
@@ -1107,21 +1107,21 @@ const oi = (r) => {
|
|
|
1107
1107
|
}
|
|
1108
1108
|
)
|
|
1109
1109
|
] });
|
|
1110
|
-
},
|
|
1110
|
+
}, Ri = (o) => {
|
|
1111
1111
|
const {
|
|
1112
1112
|
isActiveButtons: s,
|
|
1113
1113
|
setIsActiveButtons: e,
|
|
1114
1114
|
buttons: n,
|
|
1115
1115
|
setButtons: i,
|
|
1116
|
-
editableLink:
|
|
1116
|
+
editableLink: c = !0,
|
|
1117
1117
|
addable: u = !0,
|
|
1118
|
-
deletable:
|
|
1119
|
-
} =
|
|
1120
|
-
return /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsxs("div", { className:
|
|
1121
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1122
|
-
/* @__PURE__ */ t.jsx("h3", { className:
|
|
1118
|
+
deletable: l = !0
|
|
1119
|
+
} = o;
|
|
1120
|
+
return /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsxs("div", { className: mt.buttonsBlock, children: [
|
|
1121
|
+
/* @__PURE__ */ t.jsxs("div", { className: mt.top, children: [
|
|
1122
|
+
/* @__PURE__ */ t.jsx("h3", { className: mt.title, children: "Buttons" }),
|
|
1123
1123
|
/* @__PURE__ */ t.jsx(
|
|
1124
|
-
|
|
1124
|
+
ot,
|
|
1125
1125
|
{
|
|
1126
1126
|
current: s,
|
|
1127
1127
|
onChange: (m) => e(m)
|
|
@@ -1129,29 +1129,29 @@ const oi = (r) => {
|
|
|
1129
1129
|
)
|
|
1130
1130
|
] }),
|
|
1131
1131
|
s && /* @__PURE__ */ t.jsx(
|
|
1132
|
-
|
|
1132
|
+
xn,
|
|
1133
1133
|
{
|
|
1134
1134
|
buttons: n,
|
|
1135
1135
|
setButtons: i,
|
|
1136
|
-
editableLink:
|
|
1136
|
+
editableLink: c,
|
|
1137
1137
|
addable: u,
|
|
1138
|
-
deletable:
|
|
1138
|
+
deletable: l
|
|
1139
1139
|
}
|
|
1140
1140
|
)
|
|
1141
1141
|
] }) });
|
|
1142
1142
|
};
|
|
1143
|
-
function
|
|
1144
|
-
const { product: s, children: e } =
|
|
1143
|
+
function vn(o) {
|
|
1144
|
+
const { product: s, children: e } = o, { attributes: n, listeners: i, setNodeRef: c, transform: u, transition: l, isDragging: m } = yt({
|
|
1145
1145
|
id: String(s.listingId)
|
|
1146
|
-
}),
|
|
1147
|
-
transform:
|
|
1148
|
-
transition:
|
|
1146
|
+
}), p = {
|
|
1147
|
+
transform: Nt.Transform.toString(u),
|
|
1148
|
+
transition: l
|
|
1149
1149
|
};
|
|
1150
1150
|
return /* @__PURE__ */ t.jsx(
|
|
1151
1151
|
"div",
|
|
1152
1152
|
{
|
|
1153
|
-
ref:
|
|
1154
|
-
style:
|
|
1153
|
+
ref: c,
|
|
1154
|
+
style: p,
|
|
1155
1155
|
className: `${G.product} ${m ? G.dragging : ""}`,
|
|
1156
1156
|
...n,
|
|
1157
1157
|
...i,
|
|
@@ -1159,69 +1159,69 @@ function gn(r) {
|
|
|
1159
1159
|
}
|
|
1160
1160
|
);
|
|
1161
1161
|
}
|
|
1162
|
-
const
|
|
1162
|
+
const Li = (o) => {
|
|
1163
1163
|
const {
|
|
1164
1164
|
isActiveItems: s,
|
|
1165
1165
|
setIsActiveItems: e,
|
|
1166
1166
|
items: n,
|
|
1167
1167
|
setItems: i,
|
|
1168
|
-
other:
|
|
1168
|
+
other: c,
|
|
1169
1169
|
title: u,
|
|
1170
|
-
subtitle:
|
|
1170
|
+
subtitle: l,
|
|
1171
1171
|
editable: m = !0,
|
|
1172
|
-
draggable:
|
|
1173
|
-
withImage:
|
|
1174
|
-
deletable:
|
|
1175
|
-
addable:
|
|
1176
|
-
itemsType:
|
|
1177
|
-
itemsOptions:
|
|
1178
|
-
limit:
|
|
1179
|
-
} =
|
|
1172
|
+
draggable: p = !1,
|
|
1173
|
+
withImage: B = !1,
|
|
1174
|
+
deletable: r = !0,
|
|
1175
|
+
addable: a = !0,
|
|
1176
|
+
itemsType: j,
|
|
1177
|
+
itemsOptions: d,
|
|
1178
|
+
limit: S
|
|
1179
|
+
} = o, [g, y] = x.useState(
|
|
1180
1180
|
null
|
|
1181
|
-
), [
|
|
1181
|
+
), [q, k] = x.useState({
|
|
1182
1182
|
top: 0,
|
|
1183
1183
|
left: 0
|
|
1184
|
-
}), [
|
|
1185
|
-
|
|
1184
|
+
}), [h, $] = x.useState(!1), R = gt(
|
|
1185
|
+
ft(xt, {
|
|
1186
1186
|
activationConstraint: {
|
|
1187
1187
|
distance: 5
|
|
1188
1188
|
}
|
|
1189
1189
|
})
|
|
1190
1190
|
);
|
|
1191
|
-
|
|
1192
|
-
const
|
|
1193
|
-
|
|
1191
|
+
x.useEffect(() => {
|
|
1192
|
+
const f = () => {
|
|
1193
|
+
y(null), $(!1);
|
|
1194
1194
|
};
|
|
1195
|
-
return document.body.addEventListener("click",
|
|
1196
|
-
|
|
1195
|
+
return document.body.addEventListener("click", f), y(null), $(!1), () => {
|
|
1196
|
+
y(null), $(!1), document.body.removeEventListener("click", f);
|
|
1197
1197
|
};
|
|
1198
|
-
}, []),
|
|
1199
|
-
if (
|
|
1200
|
-
const
|
|
1201
|
-
i(
|
|
1198
|
+
}, []), x.useEffect(() => {
|
|
1199
|
+
if (g) {
|
|
1200
|
+
const f = [...n].map((N) => N.listingId === g.listingId ? g : N);
|
|
1201
|
+
i(f);
|
|
1202
1202
|
}
|
|
1203
|
-
}, [
|
|
1204
|
-
const
|
|
1205
|
-
|
|
1206
|
-
const A =
|
|
1207
|
-
let
|
|
1208
|
-
|
|
1209
|
-
top:
|
|
1203
|
+
}, [g]);
|
|
1204
|
+
const L = (f, N) => {
|
|
1205
|
+
f.stopPropagation();
|
|
1206
|
+
const A = f.target.getBoundingClientRect(), U = 100, O = window.innerHeight;
|
|
1207
|
+
let z = A.top + window.scrollY;
|
|
1208
|
+
z + U > O && (z = O - U - 20), $(!0), k({
|
|
1209
|
+
top: z - 80,
|
|
1210
1210
|
left: A.left - 30
|
|
1211
|
-
}), N
|
|
1211
|
+
}), y(N);
|
|
1212
1212
|
};
|
|
1213
|
-
function
|
|
1214
|
-
if (
|
|
1215
|
-
return
|
|
1213
|
+
function I(f) {
|
|
1214
|
+
if (B)
|
|
1215
|
+
return f ? /* @__PURE__ */ t.jsx(
|
|
1216
1216
|
"img",
|
|
1217
1217
|
{
|
|
1218
|
-
src: `https://imagedelivery.net/${
|
|
1218
|
+
src: `https://imagedelivery.net/${f}/w=1000`,
|
|
1219
1219
|
alt: "image",
|
|
1220
1220
|
width: 16,
|
|
1221
1221
|
height: 16
|
|
1222
1222
|
}
|
|
1223
1223
|
) : /* @__PURE__ */ t.jsx(
|
|
1224
|
-
|
|
1224
|
+
v,
|
|
1225
1225
|
{
|
|
1226
1226
|
name: "Image",
|
|
1227
1227
|
width: 16,
|
|
@@ -1230,21 +1230,21 @@ const ci = (r) => {
|
|
|
1230
1230
|
}
|
|
1231
1231
|
);
|
|
1232
1232
|
}
|
|
1233
|
-
const
|
|
1234
|
-
const { active:
|
|
1235
|
-
if (A &&
|
|
1236
|
-
const U = n.findIndex((
|
|
1233
|
+
const b = (f) => {
|
|
1234
|
+
const { active: N, over: A } = f;
|
|
1235
|
+
if (A && N.id !== A.id) {
|
|
1236
|
+
const U = n.findIndex((z) => String(z.listingId) === N.id), O = n.findIndex((z) => String(z.listingId) === A.id);
|
|
1237
1237
|
if (U !== -1 && O !== -1) {
|
|
1238
|
-
const
|
|
1239
|
-
|
|
1238
|
+
const z = [...n], [Z] = z.splice(U, 1);
|
|
1239
|
+
z.splice(O, 0, Z), i(z);
|
|
1240
1240
|
}
|
|
1241
1241
|
}
|
|
1242
|
-
},
|
|
1243
|
-
const A =
|
|
1242
|
+
}, M = (f, N) => {
|
|
1243
|
+
const A = d.find((O) => f.listingId === O.id);
|
|
1244
1244
|
if (!A) return null;
|
|
1245
1245
|
const U = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1246
|
-
|
|
1247
|
-
|
|
1246
|
+
p && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
1247
|
+
v,
|
|
1248
1248
|
{
|
|
1249
1249
|
name: "DotsSixVertical",
|
|
1250
1250
|
hoverable: !0,
|
|
@@ -1252,108 +1252,108 @@ const ci = (r) => {
|
|
|
1252
1252
|
height: 20
|
|
1253
1253
|
}
|
|
1254
1254
|
) }),
|
|
1255
|
-
|
|
1256
|
-
|
|
1255
|
+
j === "select" && /* @__PURE__ */ t.jsx(
|
|
1256
|
+
lt,
|
|
1257
1257
|
{
|
|
1258
1258
|
onChange: (O) => {
|
|
1259
|
-
const
|
|
1260
|
-
if (!
|
|
1261
|
-
const
|
|
1262
|
-
listingId:
|
|
1263
|
-
image:
|
|
1264
|
-
}, E =
|
|
1265
|
-
|
|
1259
|
+
const z = [...n], Z = d.find((T) => T.productData.name === O);
|
|
1260
|
+
if (!Z) return;
|
|
1261
|
+
const _ = {
|
|
1262
|
+
listingId: Z.id,
|
|
1263
|
+
image: Z.productData.images.length > 0 ? Z.productData.images[0].cfId : ""
|
|
1264
|
+
}, E = z.map((T) => T.listingId === f.listingId ? _ : T);
|
|
1265
|
+
y(_), i([...E]);
|
|
1266
1266
|
},
|
|
1267
1267
|
value: A.productData.name,
|
|
1268
1268
|
options: [
|
|
1269
|
-
|
|
1269
|
+
...d.filter((O) => !n.find((z) => z.listingId === O.id)).map((O) => O.productData.name)
|
|
1270
1270
|
],
|
|
1271
|
-
leftAddon:
|
|
1272
|
-
|
|
1271
|
+
leftAddon: I(
|
|
1272
|
+
f.image || A.productData.images.length > 0 && A.productData.images[0].cfId || ""
|
|
1273
1273
|
)
|
|
1274
1274
|
},
|
|
1275
|
-
|
|
1275
|
+
N
|
|
1276
1276
|
),
|
|
1277
1277
|
/* @__PURE__ */ t.jsxs("div", { className: G.buttons, children: [
|
|
1278
1278
|
m && /* @__PURE__ */ t.jsx("div", { className: G.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
1279
|
-
|
|
1279
|
+
v,
|
|
1280
1280
|
{
|
|
1281
1281
|
name: "Sliders",
|
|
1282
1282
|
hoverable: !0,
|
|
1283
1283
|
width: 20,
|
|
1284
1284
|
height: 20,
|
|
1285
|
-
onClick: (O) =>
|
|
1285
|
+
onClick: (O) => L(O, f)
|
|
1286
1286
|
}
|
|
1287
1287
|
) }),
|
|
1288
|
-
|
|
1289
|
-
|
|
1288
|
+
r && /* @__PURE__ */ t.jsx("div", { className: G.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
1289
|
+
v,
|
|
1290
1290
|
{
|
|
1291
1291
|
name: "Trash",
|
|
1292
1292
|
hoverable: !0,
|
|
1293
1293
|
width: 20,
|
|
1294
1294
|
height: 20,
|
|
1295
1295
|
fill: "#C12A2A",
|
|
1296
|
-
onClick: () => i(n.filter((O) => O !==
|
|
1296
|
+
onClick: () => i(n.filter((O) => O !== f))
|
|
1297
1297
|
}
|
|
1298
1298
|
) })
|
|
1299
1299
|
] })
|
|
1300
1300
|
] });
|
|
1301
|
-
return
|
|
1302
|
-
|
|
1301
|
+
return p ? /* @__PURE__ */ t.jsx(
|
|
1302
|
+
vn,
|
|
1303
1303
|
{
|
|
1304
|
-
product:
|
|
1304
|
+
product: f,
|
|
1305
1305
|
children: U
|
|
1306
1306
|
},
|
|
1307
|
-
|
|
1307
|
+
f.listingId
|
|
1308
1308
|
) : /* @__PURE__ */ t.jsx(
|
|
1309
1309
|
"div",
|
|
1310
1310
|
{
|
|
1311
1311
|
className: G.product,
|
|
1312
1312
|
children: U
|
|
1313
1313
|
},
|
|
1314
|
-
|
|
1314
|
+
f.listingId
|
|
1315
1315
|
);
|
|
1316
|
-
},
|
|
1316
|
+
}, P = x.useRef(null);
|
|
1317
1317
|
return /* @__PURE__ */ t.jsxs("div", { className: G.productsBlock, children: [
|
|
1318
1318
|
(u || s !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: G.top, children: [
|
|
1319
1319
|
u && /* @__PURE__ */ t.jsx("h3", { className: G.title, children: u }),
|
|
1320
1320
|
s !== void 0 && /* @__PURE__ */ t.jsx(
|
|
1321
|
-
|
|
1321
|
+
ot,
|
|
1322
1322
|
{
|
|
1323
1323
|
current: s,
|
|
1324
|
-
onChange: (
|
|
1324
|
+
onChange: (f) => e == null ? void 0 : e(f)
|
|
1325
1325
|
}
|
|
1326
1326
|
)
|
|
1327
1327
|
] }),
|
|
1328
|
-
|
|
1329
|
-
|
|
1328
|
+
h && g && /* @__PURE__ */ t.jsx(
|
|
1329
|
+
At,
|
|
1330
1330
|
{
|
|
1331
|
-
ref:
|
|
1332
|
-
activeItem:
|
|
1333
|
-
setActiveItem:
|
|
1334
|
-
setIsOpenModal:
|
|
1335
|
-
popupPosition:
|
|
1336
|
-
itemsOptions:
|
|
1331
|
+
ref: P,
|
|
1332
|
+
activeItem: g,
|
|
1333
|
+
setActiveItem: y,
|
|
1334
|
+
setIsOpenModal: $,
|
|
1335
|
+
popupPosition: q,
|
|
1336
|
+
itemsOptions: d
|
|
1337
1337
|
}
|
|
1338
1338
|
),
|
|
1339
1339
|
s && /* @__PURE__ */ t.jsxs("div", { className: G.products, children: [
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1340
|
+
l && /* @__PURE__ */ t.jsx("h5", { className: G.subtitle, children: l }),
|
|
1341
|
+
p ? /* @__PURE__ */ t.jsx(
|
|
1342
|
+
vt,
|
|
1343
1343
|
{
|
|
1344
|
-
sensors:
|
|
1345
|
-
onDragEnd:
|
|
1344
|
+
sensors: R,
|
|
1345
|
+
onDragEnd: b,
|
|
1346
1346
|
children: /* @__PURE__ */ t.jsx(
|
|
1347
|
-
|
|
1347
|
+
jt,
|
|
1348
1348
|
{
|
|
1349
|
-
items: n.map((
|
|
1350
|
-
strategy:
|
|
1351
|
-
children: n.map((
|
|
1349
|
+
items: n.map((f) => String(f.listingId)),
|
|
1350
|
+
strategy: bt,
|
|
1351
|
+
children: n.map((f, N) => M(f, N))
|
|
1352
1352
|
}
|
|
1353
1353
|
)
|
|
1354
1354
|
}
|
|
1355
|
-
) : n.map((
|
|
1356
|
-
|
|
1355
|
+
) : n.map((f, N) => M(f, N)),
|
|
1356
|
+
a && /* @__PURE__ */ t.jsx(
|
|
1357
1357
|
"div",
|
|
1358
1358
|
{
|
|
1359
1359
|
style: {
|
|
@@ -1362,31 +1362,31 @@ const ci = (r) => {
|
|
|
1362
1362
|
justifyContent: "center"
|
|
1363
1363
|
},
|
|
1364
1364
|
children: /* @__PURE__ */ t.jsx(
|
|
1365
|
-
|
|
1365
|
+
ct,
|
|
1366
1366
|
{
|
|
1367
1367
|
withoutHover: !0,
|
|
1368
1368
|
className: G.button,
|
|
1369
1369
|
size: "s",
|
|
1370
1370
|
onClick: () => {
|
|
1371
|
-
const
|
|
1372
|
-
for (let
|
|
1373
|
-
if (!n.find((A) => A.listingId ===
|
|
1374
|
-
|
|
1375
|
-
listingId:
|
|
1376
|
-
image:
|
|
1371
|
+
const f = [...n];
|
|
1372
|
+
for (let N = 0; N < d.length; N++)
|
|
1373
|
+
if (!n.find((A) => A.listingId === d[N].id)) {
|
|
1374
|
+
f.push({
|
|
1375
|
+
listingId: d[N].id,
|
|
1376
|
+
image: d[N].productData.images.length > 0 ? d[N].productData.images[0].cfId : ""
|
|
1377
1377
|
});
|
|
1378
1378
|
break;
|
|
1379
1379
|
}
|
|
1380
|
-
i(
|
|
1380
|
+
i(f);
|
|
1381
1381
|
},
|
|
1382
|
-
disabled: n.length === (
|
|
1382
|
+
disabled: n.length === (S || d.length),
|
|
1383
1383
|
style: {
|
|
1384
1384
|
width: "fit-content"
|
|
1385
1385
|
},
|
|
1386
1386
|
children: /* @__PURE__ */ t.jsxs("div", { className: G.addButton, children: [
|
|
1387
1387
|
/* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
|
|
1388
1388
|
/* @__PURE__ */ t.jsx(
|
|
1389
|
-
|
|
1389
|
+
v,
|
|
1390
1390
|
{
|
|
1391
1391
|
name: "Plus",
|
|
1392
1392
|
width: 16,
|
|
@@ -1399,151 +1399,154 @@ const ci = (r) => {
|
|
|
1399
1399
|
}
|
|
1400
1400
|
)
|
|
1401
1401
|
] }),
|
|
1402
|
-
s &&
|
|
1402
|
+
s && c !== void 0 && /* @__PURE__ */ t.jsx(_t, { items: c })
|
|
1403
1403
|
] });
|
|
1404
|
-
},
|
|
1405
|
-
options:
|
|
1406
|
-
price:
|
|
1407
|
-
oldPrice:
|
|
1408
|
-
newPrice:
|
|
1409
|
-
animate:
|
|
1410
|
-
appearAndBounce:
|
|
1411
|
-
meta:
|
|
1412
|
-
info:
|
|
1413
|
-
infoRight:
|
|
1414
|
-
buttons:
|
|
1415
|
-
variants:
|
|
1416
|
-
variant:
|
|
1417
|
-
stock:
|
|
1418
|
-
variantInfo:
|
|
1419
|
-
quantity:
|
|
1420
|
-
count:
|
|
1421
|
-
focused:
|
|
1422
|
-
button:
|
|
1423
|
-
activeVariant:
|
|
1424
|
-
chargeTypes:
|
|
1425
|
-
charge:
|
|
1426
|
-
chargeActive:
|
|
1427
|
-
title:
|
|
1404
|
+
}, jn = "_options_1vlf9_1", bn = "_price_1vlf9_13", yn = "_oldPrice_1vlf9_20", Nn = "_newPrice_1vlf9_28", In = "_animate_1vlf9_35", kn = "_appearAndBounce_1vlf9_1", Cn = "_meta_1vlf9_53", Sn = "_info_1vlf9_59", wn = "_infoRight_1vlf9_67", $n = "_buttons_1vlf9_74", qn = "_variants_1vlf9_81", Bn = "_variant_1vlf9_81", Pn = "_stock_1vlf9_99", Tn = "_variantInfo_1vlf9_106", Mn = "_quantity_1vlf9_112", An = "_count_1vlf9_119", On = "_focused_1vlf9_136", En = "_button_1vlf9_74", Dn = "_activeVariant_1vlf9_162", Rn = "_chargeTypes_1vlf9_166", Ln = "_charge_1vlf9_166", zn = "_chargeActive_1vlf9_191", Fn = "_title_1vlf9_199", w = {
|
|
1405
|
+
options: jn,
|
|
1406
|
+
price: bn,
|
|
1407
|
+
oldPrice: yn,
|
|
1408
|
+
newPrice: Nn,
|
|
1409
|
+
animate: In,
|
|
1410
|
+
appearAndBounce: kn,
|
|
1411
|
+
meta: Cn,
|
|
1412
|
+
info: Sn,
|
|
1413
|
+
infoRight: wn,
|
|
1414
|
+
buttons: $n,
|
|
1415
|
+
variants: qn,
|
|
1416
|
+
variant: Bn,
|
|
1417
|
+
stock: Pn,
|
|
1418
|
+
variantInfo: Tn,
|
|
1419
|
+
quantity: Mn,
|
|
1420
|
+
count: An,
|
|
1421
|
+
focused: On,
|
|
1422
|
+
button: En,
|
|
1423
|
+
activeVariant: Dn,
|
|
1424
|
+
chargeTypes: Rn,
|
|
1425
|
+
charge: Ln,
|
|
1426
|
+
chargeActive: zn,
|
|
1427
|
+
title: Fn
|
|
1428
1428
|
};
|
|
1429
|
-
var
|
|
1430
|
-
const
|
|
1431
|
-
var
|
|
1432
|
-
const { variants: s } =
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1429
|
+
var Ct = /* @__PURE__ */ ((o) => (o.ONE_TIME = "One-Time", o.RECURRING = "Subscribe & Save", o))(Ct || {});
|
|
1430
|
+
const Vn = (o) => {
|
|
1431
|
+
var q, k;
|
|
1432
|
+
const { variants: s } = o, [e, n] = x.useState(s[0]), [i, c] = x.useState(
|
|
1433
|
+
e.chargeTypes ? e.chargeTypes[0] : "ONE_TIME"
|
|
1434
|
+
), u = ut(), [l, m] = x.useState(1), { products: p, cart: B, reset: r, addProductToCart: a } = dt(), [j, d] = x.useState(!1);
|
|
1435
|
+
console.log(B), x.useEffect(() => {
|
|
1436
|
+
d(!0);
|
|
1437
|
+
const h = setTimeout(() => d(!1), 600);
|
|
1438
|
+
return () => clearTimeout(h);
|
|
1439
|
+
}, [l]);
|
|
1440
|
+
async function S() {
|
|
1441
|
+
console.log("Products P", p), await a({
|
|
1442
|
+
productId: o.id,
|
|
1441
1443
|
productVariantId: e.id,
|
|
1442
|
-
quantity:
|
|
1444
|
+
quantity: l
|
|
1443
1445
|
});
|
|
1444
1446
|
}
|
|
1445
|
-
function
|
|
1446
|
-
|
|
1447
|
+
function g() {
|
|
1448
|
+
r(), S(), u("/checkout");
|
|
1447
1449
|
}
|
|
1448
|
-
function
|
|
1449
|
-
if (
|
|
1450
|
-
const
|
|
1451
|
-
return `${
|
|
1452
|
-
} else if (
|
|
1453
|
-
const
|
|
1454
|
-
return `${
|
|
1455
|
-
} else if (
|
|
1456
|
-
const
|
|
1457
|
-
return `${
|
|
1450
|
+
function y(h) {
|
|
1451
|
+
if (h >= 864e5) {
|
|
1452
|
+
const b = Math.floor(h / 864e5);
|
|
1453
|
+
return `${b} ${b === 1 ? "day" : "days"}`;
|
|
1454
|
+
} else if (h >= 36e5) {
|
|
1455
|
+
const b = Math.floor(h / 36e5);
|
|
1456
|
+
return `${b} ${b === 1 ? "hour" : "hours"}`;
|
|
1457
|
+
} else if (h >= 6e4) {
|
|
1458
|
+
const b = Math.floor(h / 6e4);
|
|
1459
|
+
return `${b} ${b === 1 ? "minute" : "minutes"}`;
|
|
1458
1460
|
} else {
|
|
1459
|
-
const
|
|
1460
|
-
return `${
|
|
1461
|
+
const b = Math.floor(h / 1e3);
|
|
1462
|
+
return `${b} ${b === 1 ? "second" : "seconds"}`;
|
|
1461
1463
|
}
|
|
1462
1464
|
}
|
|
1463
|
-
return
|
|
1464
|
-
|
|
1465
|
-
}, [e.quantity.available]), /* @__PURE__ */ t.jsxs("div", { className:
|
|
1466
|
-
e.chargeTypes.length > 1 && /* @__PURE__ */ t.jsx("div", { className:
|
|
1465
|
+
return x.useEffect(() => {
|
|
1466
|
+
e.quantity && e.quantity.available === 0 && m(0);
|
|
1467
|
+
}, [e.quantity.available]), /* @__PURE__ */ t.jsxs("div", { className: w.options, children: [
|
|
1468
|
+
e.chargeTypes && e.chargeTypes.length > 1 && /* @__PURE__ */ t.jsx("div", { className: w.chargeTypes, children: e.chargeTypes.map((h) => /* @__PURE__ */ t.jsx(
|
|
1467
1469
|
"div",
|
|
1468
1470
|
{
|
|
1469
|
-
className:
|
|
1470
|
-
[
|
|
1471
|
+
className: V(w.charge, {
|
|
1472
|
+
[w.chargeActive]: i === h
|
|
1471
1473
|
}),
|
|
1472
|
-
onClick: () =>
|
|
1473
|
-
children:
|
|
1474
|
+
onClick: () => c(h),
|
|
1475
|
+
children: Ct[h]
|
|
1474
1476
|
},
|
|
1475
|
-
|
|
1477
|
+
h
|
|
1476
1478
|
)) }),
|
|
1477
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
1478
|
-
var
|
|
1479
|
+
/* @__PURE__ */ t.jsx("div", { className: w.variants, children: s.map((h) => {
|
|
1480
|
+
var $, R;
|
|
1479
1481
|
return /* @__PURE__ */ t.jsxs(
|
|
1480
1482
|
"div",
|
|
1481
1483
|
{
|
|
1482
|
-
className:
|
|
1483
|
-
[
|
|
1484
|
+
className: V(w.variant, {
|
|
1485
|
+
[w.activeVariant]: e.id === h.id
|
|
1484
1486
|
}),
|
|
1485
|
-
onClick: () => n(
|
|
1487
|
+
onClick: () => n(h),
|
|
1486
1488
|
children: [
|
|
1487
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1488
|
-
/* @__PURE__ */ t.jsx("span", { className:
|
|
1489
|
+
/* @__PURE__ */ t.jsxs("div", { className: w.variantInfo, children: [
|
|
1490
|
+
/* @__PURE__ */ t.jsx("span", { className: w.title, children: It(h.name) }),
|
|
1489
1491
|
/* @__PURE__ */ t.jsxs("span", { children: [
|
|
1490
1492
|
"$",
|
|
1491
|
-
i === "ONE_TIME" ?
|
|
1493
|
+
i === "ONE_TIME" ? h.price.amount : h.subscriptionSettings ? h.subscriptionSettings.price.amount : "Price Not Found"
|
|
1492
1494
|
] })
|
|
1493
1495
|
] }),
|
|
1494
|
-
/* @__PURE__ */ t.jsx("div", { children: i === "ONE_TIME" && /* @__PURE__ */ t.jsxs("span", { className:
|
|
1495
|
-
((
|
|
1496
|
-
"
|
|
1496
|
+
/* @__PURE__ */ t.jsx("div", { children: i === "ONE_TIME" && /* @__PURE__ */ t.jsxs("span", { className: w.stock, children: [
|
|
1497
|
+
($ = h.quantity.restrictions) != null && $.max || h.quantity.available !== void 0 ? ((R = h.quantity.restrictions) == null ? void 0 : R.max) || h.quantity.available : "∞",
|
|
1498
|
+
" ",
|
|
1499
|
+
"in stock"
|
|
1497
1500
|
] }) })
|
|
1498
1501
|
]
|
|
1499
1502
|
},
|
|
1500
|
-
|
|
1503
|
+
h.id
|
|
1501
1504
|
);
|
|
1502
1505
|
}) }),
|
|
1503
|
-
i === "ONE_TIME" && /* @__PURE__ */ t.jsxs("div", { className:
|
|
1506
|
+
i === "ONE_TIME" && /* @__PURE__ */ t.jsxs("div", { className: w.quantity, children: [
|
|
1504
1507
|
/* @__PURE__ */ t.jsx(
|
|
1505
|
-
|
|
1508
|
+
F,
|
|
1506
1509
|
{
|
|
1507
1510
|
type: "Secondary",
|
|
1508
1511
|
onClick: () => {
|
|
1509
|
-
|
|
1512
|
+
l > 1 ? m((h) => h - 1) : m(1);
|
|
1510
1513
|
},
|
|
1511
|
-
className:
|
|
1512
|
-
disabled: e.quantity.available
|
|
1513
|
-
children: /* @__PURE__ */ t.jsx(
|
|
1514
|
+
className: w.button,
|
|
1515
|
+
disabled: e.quantity.available && e.quantity.restrictions && l <= e.quantity.restrictions.min || e.quantity.available === 0,
|
|
1516
|
+
children: /* @__PURE__ */ t.jsx(v, { name: "Minus" })
|
|
1514
1517
|
}
|
|
1515
1518
|
),
|
|
1516
1519
|
/* @__PURE__ */ t.jsx(
|
|
1517
|
-
|
|
1520
|
+
Ot,
|
|
1518
1521
|
{
|
|
1519
1522
|
type: "number",
|
|
1520
|
-
value: String(
|
|
1521
|
-
onChange: (
|
|
1522
|
-
max: ((
|
|
1523
|
-
min: ((
|
|
1523
|
+
value: String(l),
|
|
1524
|
+
onChange: (h) => m(Number(h)),
|
|
1525
|
+
max: ((q = e.quantity.restrictions) == null ? void 0 : q.max) || e.quantity.available || Number.POSITIVE_INFINITY,
|
|
1526
|
+
min: ((k = e.quantity.restrictions) == null ? void 0 : k.min) || 0,
|
|
1524
1527
|
centered: !0,
|
|
1525
|
-
disabled: e.quantity
|
|
1528
|
+
disabled: e.quantity && e.quantity.available === 0 || Object.keys(e.quantity.restrictions || {}).length !== 0 && l >= e.quantity.restrictions.max
|
|
1526
1529
|
}
|
|
1527
1530
|
),
|
|
1528
1531
|
/* @__PURE__ */ t.jsx(
|
|
1529
|
-
|
|
1532
|
+
F,
|
|
1530
1533
|
{
|
|
1531
1534
|
type: "Secondary",
|
|
1532
1535
|
onClick: () => {
|
|
1533
|
-
m((
|
|
1536
|
+
m((h) => h + 1);
|
|
1534
1537
|
},
|
|
1535
|
-
className:
|
|
1536
|
-
disabled: !!(e.quantity.
|
|
1537
|
-
children: /* @__PURE__ */ t.jsx(
|
|
1538
|
+
className: w.button,
|
|
1539
|
+
disabled: !!(e.quantity.available && e.quantity.restrictions && l >= e.quantity.restrictions.max || e.quantity.available === 0),
|
|
1540
|
+
children: /* @__PURE__ */ t.jsx(v, { name: "Plus" })
|
|
1538
1541
|
}
|
|
1539
1542
|
)
|
|
1540
1543
|
] }),
|
|
1541
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1542
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1544
|
+
/* @__PURE__ */ t.jsxs("div", { className: w.meta, children: [
|
|
1545
|
+
/* @__PURE__ */ t.jsxs("div", { className: w.info, children: [
|
|
1543
1546
|
/* @__PURE__ */ t.jsx("span", { children: "Delivery" }),
|
|
1544
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1547
|
+
/* @__PURE__ */ t.jsxs("div", { className: w.infoRight, children: [
|
|
1545
1548
|
/* @__PURE__ */ t.jsx(
|
|
1546
|
-
|
|
1549
|
+
v,
|
|
1547
1550
|
{
|
|
1548
1551
|
name: "Lightning",
|
|
1549
1552
|
fill: "#FF3F19",
|
|
@@ -1551,234 +1554,269 @@ const li = (r) => {
|
|
|
1551
1554
|
height: 20
|
|
1552
1555
|
}
|
|
1553
1556
|
),
|
|
1554
|
-
/* @__PURE__ */ t.jsx("span", { children: !e.deliveryTime || e.deliveryTime === 0 ? "Instant" :
|
|
1557
|
+
/* @__PURE__ */ t.jsx("span", { children: !e.deliveryTime || e.deliveryTime === 0 ? "Instant" : y(e.deliveryTime) })
|
|
1555
1558
|
] })
|
|
1556
1559
|
] }),
|
|
1557
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1560
|
+
/* @__PURE__ */ t.jsxs("div", { className: w.info, children: [
|
|
1558
1561
|
/* @__PURE__ */ t.jsx("span", { children: "Price" }),
|
|
1559
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
1560
|
-
/* @__PURE__ */ t.jsxs("span", { className:
|
|
1562
|
+
/* @__PURE__ */ t.jsx("div", { className: w.infoRight, children: i === "ONE_TIME" ? e.compareAtPrice && (e.compareAtPrice.amount || 0) - (e.price.amount || 0) > 0 ? /* @__PURE__ */ t.jsxs("div", { className: w.price, children: [
|
|
1563
|
+
/* @__PURE__ */ t.jsxs("span", { className: V(w.newPrice, { [w.animate]: j }), children: [
|
|
1561
1564
|
"$ ",
|
|
1562
|
-
(e.price.amount || 0) *
|
|
1565
|
+
(e.price.amount || 0) * l
|
|
1563
1566
|
] }),
|
|
1564
|
-
/* @__PURE__ */ t.jsxs("span", { className:
|
|
1567
|
+
/* @__PURE__ */ t.jsxs("span", { className: w.oldPrice, children: [
|
|
1565
1568
|
"$ ",
|
|
1566
|
-
(e.compareAtPrice.amount || 0) *
|
|
1569
|
+
(e.compareAtPrice.amount || 0) * l
|
|
1567
1570
|
] })
|
|
1568
|
-
] }) : /* @__PURE__ */ t.jsxs("span", { className:
|
|
1571
|
+
] }) : /* @__PURE__ */ t.jsxs("span", { className: V(w.newPrice, { [w.animate]: j }), children: [
|
|
1569
1572
|
"$ ",
|
|
1570
|
-
(e.price.amount || 0) *
|
|
1571
|
-
] }) : e.subscriptionSettings && e.subscriptionSettings.compareAtPrice && (e.subscriptionSettings.compareAtPrice.amount || 0) - (e.subscriptionSettings.price.amount || 0) > 0 ? /* @__PURE__ */ t.jsxs("div", { className:
|
|
1572
|
-
/* @__PURE__ */ t.jsxs("span", { className:
|
|
1573
|
+
(e.price.amount || 0) * l
|
|
1574
|
+
] }) : e.subscriptionSettings && e.subscriptionSettings.compareAtPrice && (e.subscriptionSettings.compareAtPrice.amount || 0) - (e.subscriptionSettings.price.amount || 0) > 0 ? /* @__PURE__ */ t.jsxs("div", { className: w.price, children: [
|
|
1575
|
+
/* @__PURE__ */ t.jsxs("span", { className: V(w.newPrice, { [w.animate]: j }), children: [
|
|
1573
1576
|
"$ ",
|
|
1574
1577
|
e.subscriptionSettings.price.amount || 0
|
|
1575
1578
|
] }),
|
|
1576
|
-
/* @__PURE__ */ t.jsxs("span", { className:
|
|
1579
|
+
/* @__PURE__ */ t.jsxs("span", { className: w.oldPrice, children: [
|
|
1577
1580
|
"$ ",
|
|
1578
1581
|
e.subscriptionSettings.compareAtPrice.amount || 0
|
|
1579
1582
|
] })
|
|
1580
|
-
] }) : e.subscriptionSettings && /* @__PURE__ */ t.jsxs("span", { className:
|
|
1583
|
+
] }) : e.subscriptionSettings && /* @__PURE__ */ t.jsxs("span", { className: V(w.newPrice, { [w.animate]: j }), children: [
|
|
1581
1584
|
"$ ",
|
|
1582
1585
|
e.subscriptionSettings.price.amount || 0
|
|
1583
1586
|
] }) })
|
|
1584
1587
|
] })
|
|
1585
1588
|
] }),
|
|
1586
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1589
|
+
/* @__PURE__ */ t.jsxs("div", { className: w.buttons, children: [
|
|
1587
1590
|
/* @__PURE__ */ t.jsx(
|
|
1588
|
-
|
|
1591
|
+
F,
|
|
1589
1592
|
{
|
|
1590
1593
|
type: "Primary",
|
|
1591
|
-
onClick: () =>
|
|
1592
|
-
disabled: e.quantity
|
|
1594
|
+
onClick: () => g(),
|
|
1595
|
+
disabled: e.quantity && e.quantity.available === 0,
|
|
1593
1596
|
children: i === "ONE_TIME" ? "Buy Now" : "Subscribe Now"
|
|
1594
1597
|
}
|
|
1595
1598
|
),
|
|
1596
1599
|
i === "ONE_TIME" && /* @__PURE__ */ t.jsx(
|
|
1597
|
-
|
|
1600
|
+
F,
|
|
1598
1601
|
{
|
|
1599
1602
|
type: "Secondary",
|
|
1600
|
-
onClick: () =>
|
|
1601
|
-
disabled: e.quantity
|
|
1603
|
+
onClick: () => S(),
|
|
1604
|
+
disabled: e.quantity && e.quantity.available === 0,
|
|
1602
1605
|
children: "Add to Cart"
|
|
1603
1606
|
}
|
|
1604
1607
|
)
|
|
1605
1608
|
] })
|
|
1606
1609
|
] });
|
|
1607
|
-
},
|
|
1608
|
-
button:
|
|
1609
|
-
login:
|
|
1610
|
-
signUp:
|
|
1611
|
-
buttons:
|
|
1612
|
-
modal:
|
|
1613
|
-
"slide-in-fade": "_slide-in-
|
|
1614
|
-
"mobile-slide-in-fade": "_mobile-slide-in-
|
|
1615
|
-
closing:
|
|
1616
|
-
"mobile-slide-out-fade": "_mobile-slide-out-
|
|
1617
|
-
"slide-out-fade": "_slide-out-
|
|
1618
|
-
info:
|
|
1619
|
-
top:
|
|
1620
|
-
title:
|
|
1621
|
-
clear:
|
|
1622
|
-
activeClear:
|
|
1623
|
-
count:
|
|
1624
|
-
cart:
|
|
1625
|
-
empty:
|
|
1626
|
-
product:
|
|
1627
|
-
products:
|
|
1628
|
-
image:
|
|
1629
|
-
productInfo:
|
|
1630
|
-
content:
|
|
1631
|
-
name:
|
|
1632
|
-
price:
|
|
1633
|
-
productButtons:
|
|
1634
|
-
productButton:
|
|
1635
|
-
productCount:
|
|
1636
|
-
bottom:
|
|
1637
|
-
subtotal:
|
|
1638
|
-
block:
|
|
1639
|
-
shoppingCount:
|
|
1640
|
-
total:
|
|
1641
|
-
link:
|
|
1642
|
-
userInfo:
|
|
1643
|
-
pagesMobileModal:
|
|
1644
|
-
pagesMobileModalContent:
|
|
1645
|
-
pagesMobileModalHeader:
|
|
1646
|
-
pagesMobileModalFooter:
|
|
1647
|
-
},
|
|
1648
|
-
const { shopping: s, signUp: e, isShowUserInfo: n = !0 } =
|
|
1649
|
-
return /* @__PURE__ */ t.jsxs("div", { className:
|
|
1650
|
-
s && /* @__PURE__ */ t.jsx(
|
|
1651
|
-
n && /* @__PURE__ */ t.jsx(
|
|
1610
|
+
}, Un = "_button_14q75_1", Hn = "_login_14q75_14", Yn = "_signUp_14q75_18", Wn = "_buttons_14q75_23", Gn = "_modal_14q75_32", Qn = "_closing_14q75_64", Xn = "_info_14q75_113", Jn = "_top_14q75_120", Kn = "_title_14q75_131", Zn = "_clear_14q75_138", ts = "_activeClear_14q75_145", es = "_count_14q75_149", ns = "_cart_14q75_164", ss = "_empty_14q75_172", is = "_product_14q75_198", as = "_products_14q75_207", os = "_image_14q75_215", cs = "_productInfo_14q75_230", ls = "_content_14q75_237", rs = "_name_14q75_243", ds = "_price_14q75_249", us = "_productButtons_14q75_255", ms = "_productButton_14q75_255", hs = "_productCount_14q75_272", ps = "_bottom_14q75_289", _s = "_subtotal_14q75_297", gs = "_block_14q75_305", fs = "_shoppingCount_14q75_312", xs = "_total_14q75_332", vs = "_link_14q75_338", js = "_userInfo_14q75_345", bs = "_pagesMobileModal_14q75_356", ys = "_pagesMobileModalContent_14q75_370", Ns = "_pagesMobileModalHeader_14q75_376", Is = "_pagesMobileModalFooter_14q75_386", C = {
|
|
1611
|
+
button: Un,
|
|
1612
|
+
login: Hn,
|
|
1613
|
+
signUp: Yn,
|
|
1614
|
+
buttons: Wn,
|
|
1615
|
+
modal: Gn,
|
|
1616
|
+
"slide-in-fade": "_slide-in-fade_14q75_1",
|
|
1617
|
+
"mobile-slide-in-fade": "_mobile-slide-in-fade_14q75_1",
|
|
1618
|
+
closing: Qn,
|
|
1619
|
+
"mobile-slide-out-fade": "_mobile-slide-out-fade_14q75_1",
|
|
1620
|
+
"slide-out-fade": "_slide-out-fade_14q75_1",
|
|
1621
|
+
info: Xn,
|
|
1622
|
+
top: Jn,
|
|
1623
|
+
title: Kn,
|
|
1624
|
+
clear: Zn,
|
|
1625
|
+
activeClear: ts,
|
|
1626
|
+
count: es,
|
|
1627
|
+
cart: ns,
|
|
1628
|
+
empty: ss,
|
|
1629
|
+
product: is,
|
|
1630
|
+
products: as,
|
|
1631
|
+
image: os,
|
|
1632
|
+
productInfo: cs,
|
|
1633
|
+
content: ls,
|
|
1634
|
+
name: rs,
|
|
1635
|
+
price: ds,
|
|
1636
|
+
productButtons: us,
|
|
1637
|
+
productButton: ms,
|
|
1638
|
+
productCount: hs,
|
|
1639
|
+
bottom: ps,
|
|
1640
|
+
subtotal: _s,
|
|
1641
|
+
block: gs,
|
|
1642
|
+
shoppingCount: fs,
|
|
1643
|
+
total: xs,
|
|
1644
|
+
link: vs,
|
|
1645
|
+
userInfo: js,
|
|
1646
|
+
pagesMobileModal: bs,
|
|
1647
|
+
pagesMobileModalContent: ys,
|
|
1648
|
+
pagesMobileModalHeader: Ns,
|
|
1649
|
+
pagesMobileModalFooter: Is
|
|
1650
|
+
}, zi = (o) => {
|
|
1651
|
+
const { shopping: s, signUp: e, isShowUserInfo: n = !0 } = o;
|
|
1652
|
+
return /* @__PURE__ */ t.jsxs("div", { className: C.buttons, children: [
|
|
1653
|
+
s && /* @__PURE__ */ t.jsx(ks, {}),
|
|
1654
|
+
n && /* @__PURE__ */ t.jsx(Bt, { signUp: e })
|
|
1652
1655
|
] });
|
|
1653
|
-
},
|
|
1654
|
-
const [
|
|
1655
|
-
function
|
|
1656
|
-
|
|
1657
|
-
|
|
1656
|
+
}, ks = () => {
|
|
1657
|
+
const [o, s] = x.useState(!1), [e, n] = x.useState([]), { cart: i } = dt(), { pageContext: c } = rt();
|
|
1658
|
+
function u(a) {
|
|
1659
|
+
if (a.variants.length > 0) {
|
|
1660
|
+
for (let j = 0; j < i.parts.length; j++)
|
|
1661
|
+
for (let d = 0; d < a.variants.length; d++)
|
|
1662
|
+
if (a.variants[d] && i.parts[j].productVariantId === a.variants[d].id)
|
|
1663
|
+
return i.parts[j].productVariantId;
|
|
1664
|
+
}
|
|
1665
|
+
return a.variants[0].id;
|
|
1658
1666
|
}
|
|
1659
|
-
|
|
1667
|
+
function l(a) {
|
|
1668
|
+
for (let j = 0; j < i.parts.length; j++)
|
|
1669
|
+
for (let d = 0; d < a.variants.length; d++)
|
|
1670
|
+
if (a.variants[d] && i.parts[j].productVariantId === a.variants[d].id)
|
|
1671
|
+
return i.parts[j].quantity;
|
|
1672
|
+
}
|
|
1673
|
+
x.useEffect(() => {
|
|
1674
|
+
(async () => {
|
|
1675
|
+
var g;
|
|
1676
|
+
const j = i.parts.map((y) => String(y.productId)), S = (((g = c == null ? void 0 : c.products) == null ? void 0 : g.filter((y) => j.includes(String(y.id)))) || []).map((y) => ({
|
|
1677
|
+
...y,
|
|
1678
|
+
activeVariantId: u(y),
|
|
1679
|
+
quantity: l(y)
|
|
1680
|
+
}));
|
|
1681
|
+
n(S);
|
|
1682
|
+
})();
|
|
1683
|
+
}, [i.parts]);
|
|
1684
|
+
function m(a) {
|
|
1685
|
+
var j;
|
|
1686
|
+
return !a || !(a != null && a.variants) ? !1 : (j = a.variants.find((d) => d.id === a.activeVariantId)) == null ? void 0 : j.subscriptionSettings;
|
|
1687
|
+
}
|
|
1688
|
+
const p = i.parts.length > 0 && e.length > 0 && !m(e[0]), [B, r] = x.useState(!1);
|
|
1660
1689
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1661
1690
|
/* @__PURE__ */ t.jsxs(
|
|
1662
|
-
|
|
1691
|
+
F,
|
|
1663
1692
|
{
|
|
1664
1693
|
type: "Secondary",
|
|
1665
1694
|
style: {
|
|
1666
|
-
padding: 10
|
|
1695
|
+
padding: 10,
|
|
1696
|
+
position: "relative"
|
|
1667
1697
|
},
|
|
1668
|
-
onClick: (
|
|
1669
|
-
|
|
1698
|
+
onClick: (a) => {
|
|
1699
|
+
a.stopPropagation(), window.location.pathname.includes("/admin/builder") || (s(!0), r(!0));
|
|
1670
1700
|
},
|
|
1671
1701
|
children: [
|
|
1672
1702
|
/* @__PURE__ */ t.jsx(
|
|
1673
|
-
|
|
1703
|
+
v,
|
|
1674
1704
|
{
|
|
1675
1705
|
name: "Handbag",
|
|
1676
1706
|
fill: "var(--text-primary)"
|
|
1677
1707
|
}
|
|
1678
1708
|
),
|
|
1679
|
-
|
|
1709
|
+
p && /* @__PURE__ */ t.jsx("div", { className: C.shoppingCount, children: i.parts.length })
|
|
1680
1710
|
]
|
|
1681
1711
|
}
|
|
1682
1712
|
),
|
|
1683
|
-
|
|
1684
|
-
|
|
1713
|
+
o && /* @__PURE__ */ t.jsx(
|
|
1714
|
+
kt,
|
|
1685
1715
|
{
|
|
1686
1716
|
close: () => {
|
|
1687
|
-
|
|
1717
|
+
r(!1), setTimeout(() => {
|
|
1688
1718
|
s(!1);
|
|
1689
1719
|
}, 300);
|
|
1690
1720
|
},
|
|
1691
1721
|
withAnimation: !1,
|
|
1692
1722
|
children: /* @__PURE__ */ t.jsx(
|
|
1693
|
-
|
|
1723
|
+
Cs,
|
|
1694
1724
|
{
|
|
1695
1725
|
activeProducts: e,
|
|
1696
|
-
isCartNotEmpty:
|
|
1697
|
-
isOpen:
|
|
1726
|
+
isCartNotEmpty: p,
|
|
1727
|
+
isOpen: B
|
|
1698
1728
|
}
|
|
1699
1729
|
)
|
|
1700
1730
|
}
|
|
1701
1731
|
)
|
|
1702
1732
|
] });
|
|
1703
|
-
},
|
|
1704
|
-
const { activeProducts: s, isCartNotEmpty: e, isOpen: n } =
|
|
1705
|
-
function
|
|
1706
|
-
m(
|
|
1733
|
+
}, Cs = (o) => {
|
|
1734
|
+
const { activeProducts: s, isCartNotEmpty: e, isOpen: n } = o, { cart: i, reset: c, getTotalAndDiscount: u, updateQuantityOfProduct: l } = dt(), m = ut();
|
|
1735
|
+
function p(a) {
|
|
1736
|
+
m(a);
|
|
1707
1737
|
}
|
|
1708
|
-
function
|
|
1709
|
-
|
|
1710
|
-
productId:
|
|
1711
|
-
productVariantId:
|
|
1712
|
-
quantity:
|
|
1738
|
+
function B(a) {
|
|
1739
|
+
a.quantity && l({
|
|
1740
|
+
productId: a.id,
|
|
1741
|
+
productVariantId: a.activeVariantId,
|
|
1742
|
+
quantity: a.quantity + 1
|
|
1713
1743
|
});
|
|
1714
1744
|
}
|
|
1715
|
-
function
|
|
1716
|
-
|
|
1717
|
-
productId:
|
|
1718
|
-
productVariantId:
|
|
1719
|
-
quantity:
|
|
1745
|
+
function r(a) {
|
|
1746
|
+
a.quantity && l({
|
|
1747
|
+
productId: a.id,
|
|
1748
|
+
productVariantId: a.activeVariantId,
|
|
1749
|
+
quantity: a.quantity - 1
|
|
1720
1750
|
});
|
|
1721
1751
|
}
|
|
1722
1752
|
return /* @__PURE__ */ t.jsxs(
|
|
1723
1753
|
"div",
|
|
1724
1754
|
{
|
|
1725
|
-
className:
|
|
1726
|
-
[
|
|
1755
|
+
className: V(C.modal, {
|
|
1756
|
+
[C.closing]: !n
|
|
1727
1757
|
}),
|
|
1728
|
-
onClick: (
|
|
1758
|
+
onClick: (a) => a.stopPropagation(),
|
|
1729
1759
|
children: [
|
|
1730
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1731
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1732
|
-
/* @__PURE__ */ t.jsx("span", { className:
|
|
1733
|
-
e && /* @__PURE__ */ t.jsx("div", { className:
|
|
1760
|
+
/* @__PURE__ */ t.jsxs("div", { className: C.top, children: [
|
|
1761
|
+
/* @__PURE__ */ t.jsxs("div", { className: C.info, children: [
|
|
1762
|
+
/* @__PURE__ */ t.jsx("span", { className: C.title, children: "Cart" }),
|
|
1763
|
+
e && /* @__PURE__ */ t.jsx("div", { className: C.count, children: i.parts.length })
|
|
1734
1764
|
] }),
|
|
1735
1765
|
/* @__PURE__ */ t.jsx(
|
|
1736
1766
|
"button",
|
|
1737
1767
|
{
|
|
1738
|
-
className:
|
|
1739
|
-
[
|
|
1768
|
+
className: V(C.clear, {
|
|
1769
|
+
[C.activeClear]: e
|
|
1740
1770
|
}),
|
|
1741
1771
|
disabled: !e,
|
|
1742
|
-
onClick:
|
|
1772
|
+
onClick: c,
|
|
1743
1773
|
children: "Clear all"
|
|
1744
1774
|
}
|
|
1745
1775
|
)
|
|
1746
1776
|
] }),
|
|
1747
|
-
e ? /* @__PURE__ */ t.jsxs("div", { className:
|
|
1748
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
1777
|
+
e ? /* @__PURE__ */ t.jsxs("div", { className: C.cart, children: [
|
|
1778
|
+
/* @__PURE__ */ t.jsx("div", { className: C.products, children: s.map((a) => /* @__PURE__ */ t.jsxs(
|
|
1749
1779
|
"div",
|
|
1750
1780
|
{
|
|
1751
|
-
className:
|
|
1781
|
+
className: C.product,
|
|
1752
1782
|
children: [
|
|
1753
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1754
|
-
/* @__PURE__ */ t.jsx(
|
|
1783
|
+
/* @__PURE__ */ t.jsxs("div", { className: C.productInfo, children: [
|
|
1784
|
+
a.images.length > 0 ? /* @__PURE__ */ t.jsx(
|
|
1755
1785
|
"img",
|
|
1756
1786
|
{
|
|
1757
|
-
src: `https://imagedelivery.net/${
|
|
1787
|
+
src: `https://imagedelivery.net/${a.images[0].cfId}/w=500`,
|
|
1758
1788
|
alt: "image",
|
|
1759
1789
|
width: "100%",
|
|
1760
1790
|
height: "100%",
|
|
1761
|
-
className:
|
|
1791
|
+
className: C.image
|
|
1762
1792
|
}
|
|
1763
|
-
),
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1793
|
+
) : /* @__PURE__ */ t.jsx("div", { className: C.image, children: /* @__PURE__ */ t.jsx(
|
|
1794
|
+
v,
|
|
1795
|
+
{
|
|
1796
|
+
name: "Image",
|
|
1797
|
+
fill: "var(--text-secondary)"
|
|
1798
|
+
}
|
|
1799
|
+
) }),
|
|
1800
|
+
/* @__PURE__ */ t.jsxs("div", { className: C.content, children: [
|
|
1801
|
+
/* @__PURE__ */ t.jsx("div", { className: C.name, children: It(a.name) }),
|
|
1802
|
+
/* @__PURE__ */ t.jsxs("div", { className: C.price, children: [
|
|
1767
1803
|
"$",
|
|
1768
|
-
|
|
1804
|
+
a.variants.find((j) => j.id === a.activeVariantId).price.amount * ((a == null ? void 0 : a.quantity) || 1)
|
|
1769
1805
|
] })
|
|
1770
1806
|
] })
|
|
1771
1807
|
] }),
|
|
1772
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1808
|
+
/* @__PURE__ */ t.jsxs("div", { className: C.productButtons, children: [
|
|
1773
1809
|
/* @__PURE__ */ t.jsx(
|
|
1774
|
-
|
|
1810
|
+
F,
|
|
1775
1811
|
{
|
|
1812
|
+
type: "Secondary",
|
|
1776
1813
|
onClick: () => {
|
|
1777
|
-
|
|
1814
|
+
a.quantity !== 1 && r(a);
|
|
1778
1815
|
},
|
|
1779
|
-
className:
|
|
1816
|
+
className: C.productButton,
|
|
1817
|
+
disabled: a.quantity === 1,
|
|
1780
1818
|
children: /* @__PURE__ */ t.jsx(
|
|
1781
|
-
|
|
1819
|
+
v,
|
|
1782
1820
|
{
|
|
1783
1821
|
name: "Minus",
|
|
1784
1822
|
fill: "#757575",
|
|
@@ -1788,14 +1826,16 @@ const li = (r) => {
|
|
|
1788
1826
|
)
|
|
1789
1827
|
}
|
|
1790
1828
|
),
|
|
1791
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
1829
|
+
/* @__PURE__ */ t.jsx("div", { className: C.productCount, children: a.quantity }),
|
|
1792
1830
|
/* @__PURE__ */ t.jsx(
|
|
1793
|
-
|
|
1831
|
+
F,
|
|
1794
1832
|
{
|
|
1795
|
-
|
|
1796
|
-
|
|
1833
|
+
type: "Secondary",
|
|
1834
|
+
onClick: () => B(a),
|
|
1835
|
+
className: C.productButton,
|
|
1836
|
+
disabled: a.quantity === a.variants.find((j) => j.id === a.activeVariantId).quantity.available,
|
|
1797
1837
|
children: /* @__PURE__ */ t.jsx(
|
|
1798
|
-
|
|
1838
|
+
v,
|
|
1799
1839
|
{
|
|
1800
1840
|
name: "Plus",
|
|
1801
1841
|
fill: "#757575",
|
|
@@ -1808,14 +1848,14 @@ const li = (r) => {
|
|
|
1808
1848
|
] })
|
|
1809
1849
|
]
|
|
1810
1850
|
},
|
|
1811
|
-
|
|
1851
|
+
a.id
|
|
1812
1852
|
)) }),
|
|
1813
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1814
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1815
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1853
|
+
/* @__PURE__ */ t.jsxs("div", { className: C.bottom, children: [
|
|
1854
|
+
/* @__PURE__ */ t.jsxs("div", { className: C.subtotal, children: [
|
|
1855
|
+
/* @__PURE__ */ t.jsxs("div", { className: C.block, children: [
|
|
1816
1856
|
/* @__PURE__ */ t.jsx("span", { children: "Subtotal" }),
|
|
1817
1857
|
/* @__PURE__ */ t.jsx(
|
|
1818
|
-
|
|
1858
|
+
v,
|
|
1819
1859
|
{
|
|
1820
1860
|
name: "Info",
|
|
1821
1861
|
width: 20,
|
|
@@ -1824,20 +1864,20 @@ const li = (r) => {
|
|
|
1824
1864
|
}
|
|
1825
1865
|
)
|
|
1826
1866
|
] }),
|
|
1827
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1867
|
+
/* @__PURE__ */ t.jsxs("div", { className: C.total, children: [
|
|
1828
1868
|
"$",
|
|
1829
1869
|
u().total
|
|
1830
1870
|
] })
|
|
1831
1871
|
] }),
|
|
1832
|
-
/* @__PURE__ */ t.jsx(
|
|
1872
|
+
/* @__PURE__ */ t.jsx(F, { onClick: () => p("/checkout"), children: "Checkout" })
|
|
1833
1873
|
] })
|
|
1834
|
-
] }) : /* @__PURE__ */ t.jsx(
|
|
1874
|
+
] }) : /* @__PURE__ */ t.jsx(Ss, {})
|
|
1835
1875
|
]
|
|
1836
1876
|
}
|
|
1837
1877
|
);
|
|
1838
|
-
},
|
|
1878
|
+
}, Ss = () => /* @__PURE__ */ t.jsxs("div", { className: C.empty, children: [
|
|
1839
1879
|
/* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
1840
|
-
|
|
1880
|
+
v,
|
|
1841
1881
|
{
|
|
1842
1882
|
name: "Handbag",
|
|
1843
1883
|
fill: "var(--text-secondary)"
|
|
@@ -1851,23 +1891,23 @@ const li = (r) => {
|
|
|
1851
1891
|
"a",
|
|
1852
1892
|
{
|
|
1853
1893
|
href: "/products",
|
|
1854
|
-
className:
|
|
1894
|
+
className: C.link,
|
|
1855
1895
|
children: "view products"
|
|
1856
1896
|
}
|
|
1857
1897
|
)
|
|
1858
1898
|
] })
|
|
1859
|
-
] }),
|
|
1860
|
-
const e = JSON.parse(localStorage.getItem("token") || "{}"), { data: n } = e, i =
|
|
1861
|
-
function
|
|
1899
|
+
] }), Bt = ({ signUp: o, close: s }) => {
|
|
1900
|
+
const e = JSON.parse(localStorage.getItem("token") || "{}"), { data: n } = e, i = ut();
|
|
1901
|
+
function c(m) {
|
|
1862
1902
|
window.location.pathname.includes("/admin/builder") || i(m);
|
|
1863
1903
|
}
|
|
1864
1904
|
if (!n)
|
|
1865
1905
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1866
1906
|
/* @__PURE__ */ t.jsx(
|
|
1867
|
-
|
|
1907
|
+
F,
|
|
1868
1908
|
{
|
|
1869
1909
|
onClick: () => {
|
|
1870
|
-
|
|
1910
|
+
c("/customer-dash"), s == null || s();
|
|
1871
1911
|
},
|
|
1872
1912
|
type: "Secondary",
|
|
1873
1913
|
style: {
|
|
@@ -1876,11 +1916,11 @@ const li = (r) => {
|
|
|
1876
1916
|
children: "Login"
|
|
1877
1917
|
}
|
|
1878
1918
|
),
|
|
1879
|
-
|
|
1880
|
-
|
|
1919
|
+
o && /* @__PURE__ */ t.jsx(
|
|
1920
|
+
F,
|
|
1881
1921
|
{
|
|
1882
1922
|
onClick: () => {
|
|
1883
|
-
|
|
1923
|
+
c("/customer-dash"), s == null || s();
|
|
1884
1924
|
},
|
|
1885
1925
|
type: "Primary",
|
|
1886
1926
|
style: {
|
|
@@ -1891,29 +1931,29 @@ const li = (r) => {
|
|
|
1891
1931
|
}
|
|
1892
1932
|
)
|
|
1893
1933
|
] });
|
|
1894
|
-
const [u,
|
|
1895
|
-
return
|
|
1934
|
+
const [u, l] = x.useState("test-email@gmail.com");
|
|
1935
|
+
return x.useEffect(() => {
|
|
1896
1936
|
(async () => {
|
|
1897
|
-
const
|
|
1898
|
-
|
|
1937
|
+
const p = Et(n);
|
|
1938
|
+
l(p.email);
|
|
1899
1939
|
})();
|
|
1900
1940
|
}, [n]), /* @__PURE__ */ t.jsx(
|
|
1901
1941
|
"div",
|
|
1902
1942
|
{
|
|
1903
|
-
className:
|
|
1943
|
+
className: C.userInfo,
|
|
1904
1944
|
onClick: () => {
|
|
1905
|
-
|
|
1945
|
+
c("/customer-dash"), s == null || s();
|
|
1906
1946
|
},
|
|
1907
1947
|
children: /* @__PURE__ */ t.jsx("div", { children: u || "test-email@gmail.com" })
|
|
1908
1948
|
}
|
|
1909
1949
|
);
|
|
1910
|
-
},
|
|
1911
|
-
children:
|
|
1950
|
+
}, ws = ({
|
|
1951
|
+
children: o,
|
|
1912
1952
|
logo: s,
|
|
1913
1953
|
setIsOpen: e,
|
|
1914
1954
|
signUp: n
|
|
1915
1955
|
}) => {
|
|
1916
|
-
const { setIsOpen: i } =
|
|
1956
|
+
const { setIsOpen: i } = wt(), c = () => {
|
|
1917
1957
|
i(!1), setTimeout(() => {
|
|
1918
1958
|
e(!1), i(!0);
|
|
1919
1959
|
}, 300);
|
|
@@ -1921,18 +1961,18 @@ const li = (r) => {
|
|
|
1921
1961
|
return /* @__PURE__ */ t.jsxs(
|
|
1922
1962
|
"div",
|
|
1923
1963
|
{
|
|
1924
|
-
className:
|
|
1964
|
+
className: C.pagesMobileModal,
|
|
1925
1965
|
onClick: (u) => u.stopPropagation(),
|
|
1926
1966
|
children: [
|
|
1927
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1967
|
+
/* @__PURE__ */ t.jsxs("div", { className: C.pagesMobileModalHeader, children: [
|
|
1928
1968
|
/* @__PURE__ */ t.jsx("div", { children: s }),
|
|
1929
1969
|
/* @__PURE__ */ t.jsx(
|
|
1930
|
-
|
|
1970
|
+
F,
|
|
1931
1971
|
{
|
|
1932
1972
|
type: "Secondary",
|
|
1933
|
-
onClick:
|
|
1973
|
+
onClick: c,
|
|
1934
1974
|
children: /* @__PURE__ */ t.jsx(
|
|
1935
|
-
|
|
1975
|
+
v,
|
|
1936
1976
|
{
|
|
1937
1977
|
name: "X",
|
|
1938
1978
|
fill: "var(--text-primary)"
|
|
@@ -1941,39 +1981,39 @@ const li = (r) => {
|
|
|
1941
1981
|
}
|
|
1942
1982
|
)
|
|
1943
1983
|
] }),
|
|
1944
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
1945
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
1946
|
-
|
|
1984
|
+
/* @__PURE__ */ t.jsx("div", { className: C.pagesMobileModalContent, children: o }),
|
|
1985
|
+
/* @__PURE__ */ t.jsx("div", { className: C.pagesMobileModalFooter, children: /* @__PURE__ */ t.jsx(
|
|
1986
|
+
Bt,
|
|
1947
1987
|
{
|
|
1948
1988
|
signUp: n,
|
|
1949
|
-
close:
|
|
1989
|
+
close: c
|
|
1950
1990
|
}
|
|
1951
1991
|
) })
|
|
1952
1992
|
]
|
|
1953
1993
|
}
|
|
1954
1994
|
);
|
|
1955
|
-
},
|
|
1956
|
-
children:
|
|
1995
|
+
}, Fi = ({
|
|
1996
|
+
children: o,
|
|
1957
1997
|
logo: s,
|
|
1958
1998
|
signUp: e
|
|
1959
1999
|
}) => {
|
|
1960
|
-
const [n, i] =
|
|
2000
|
+
const [n, i] = x.useState(!1);
|
|
1961
2001
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1962
|
-
/* @__PURE__ */ t.jsx(
|
|
1963
|
-
n && /* @__PURE__ */ t.jsx(
|
|
1964
|
-
|
|
2002
|
+
/* @__PURE__ */ t.jsx($s, { setIsOpenModal: i }),
|
|
2003
|
+
n && /* @__PURE__ */ t.jsx(kt, { close: () => i(!1), children: /* @__PURE__ */ t.jsx(
|
|
2004
|
+
ws,
|
|
1965
2005
|
{
|
|
1966
2006
|
logo: s,
|
|
1967
2007
|
setIsOpen: i,
|
|
1968
2008
|
signUp: e,
|
|
1969
|
-
children:
|
|
2009
|
+
children: o
|
|
1970
2010
|
}
|
|
1971
2011
|
) })
|
|
1972
2012
|
] });
|
|
1973
|
-
},
|
|
1974
|
-
const { setIsOpenModal: s } =
|
|
2013
|
+
}, $s = (o) => {
|
|
2014
|
+
const { setIsOpenModal: s } = o;
|
|
1975
2015
|
return /* @__PURE__ */ t.jsx(
|
|
1976
|
-
|
|
2016
|
+
F,
|
|
1977
2017
|
{
|
|
1978
2018
|
type: "Secondary",
|
|
1979
2019
|
style: {
|
|
@@ -1983,7 +2023,7 @@ const li = (r) => {
|
|
|
1983
2023
|
e.stopPropagation(), window.location.pathname.includes("/admin/builder") || s(!0);
|
|
1984
2024
|
},
|
|
1985
2025
|
children: /* @__PURE__ */ t.jsx(
|
|
1986
|
-
|
|
2026
|
+
v,
|
|
1987
2027
|
{
|
|
1988
2028
|
name: "List",
|
|
1989
2029
|
fill: "var(--text-primary)"
|
|
@@ -1991,34 +2031,34 @@ const li = (r) => {
|
|
|
1991
2031
|
)
|
|
1992
2032
|
}
|
|
1993
2033
|
);
|
|
1994
|
-
},
|
|
1995
|
-
share:
|
|
1996
|
-
modal:
|
|
1997
|
-
header:
|
|
1998
|
-
socials:
|
|
1999
|
-
social:
|
|
2000
|
-
copy:
|
|
2001
|
-
title:
|
|
2002
|
-
copyWrapper:
|
|
2003
|
-
copyText:
|
|
2004
|
-
copyTextMobile:
|
|
2005
|
-
copyTextMiniMobile:
|
|
2006
|
-
},
|
|
2007
|
-
const { isOpenModal: s, setIsOpenModal: e } =
|
|
2034
|
+
}, qs = "_share_10urc_1", Bs = "_modal_10urc_9", Ps = "_header_10urc_21", Ts = "_socials_10urc_31", Ms = "_social_10urc_31", As = "_copy_10urc_41", Os = "_title_10urc_48", Es = "_copyWrapper_10urc_54", Ds = "_copyText_10urc_63", Rs = "_copyTextMobile_10urc_76", Ls = "_copyTextMiniMobile_10urc_95", et = {
|
|
2035
|
+
share: qs,
|
|
2036
|
+
modal: Bs,
|
|
2037
|
+
header: Ps,
|
|
2038
|
+
socials: Ts,
|
|
2039
|
+
social: Ms,
|
|
2040
|
+
copy: As,
|
|
2041
|
+
title: Os,
|
|
2042
|
+
copyWrapper: Es,
|
|
2043
|
+
copyText: Ds,
|
|
2044
|
+
copyTextMobile: Rs,
|
|
2045
|
+
copyTextMiniMobile: Ls
|
|
2046
|
+
}, Vi = ({ title: o = "Copy Product Link" }) => {
|
|
2047
|
+
const { isOpenModal: s, setIsOpenModal: e } = $t();
|
|
2008
2048
|
function n() {
|
|
2009
2049
|
e(!0);
|
|
2010
2050
|
}
|
|
2011
2051
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
2012
2052
|
/* @__PURE__ */ t.jsx(
|
|
2013
|
-
|
|
2053
|
+
F,
|
|
2014
2054
|
{
|
|
2015
|
-
className:
|
|
2055
|
+
className: et.share,
|
|
2016
2056
|
onClick: (i) => {
|
|
2017
2057
|
i.stopPropagation(), n();
|
|
2018
2058
|
},
|
|
2019
2059
|
type: "Secondary",
|
|
2020
2060
|
children: /* @__PURE__ */ t.jsx(
|
|
2021
|
-
|
|
2061
|
+
v,
|
|
2022
2062
|
{
|
|
2023
2063
|
name: "Share",
|
|
2024
2064
|
fill: "#757575",
|
|
@@ -2027,45 +2067,45 @@ const li = (r) => {
|
|
|
2027
2067
|
)
|
|
2028
2068
|
}
|
|
2029
2069
|
),
|
|
2030
|
-
s && /* @__PURE__ */ t.jsx(
|
|
2070
|
+
s && /* @__PURE__ */ t.jsx(kt, { close: e, children: /* @__PURE__ */ t.jsx(zs, { title: o }) })
|
|
2031
2071
|
] });
|
|
2032
|
-
},
|
|
2033
|
-
const { setIsOpenModal: s } =
|
|
2072
|
+
}, zs = ({ title: o = "Copy Product Link" }) => {
|
|
2073
|
+
const { setIsOpenModal: s } = $t(), { notification: e, setNotification: n } = qt(), { setIsOpen: i } = wt(), c = window.location.href;
|
|
2034
2074
|
function u() {
|
|
2035
|
-
navigator.clipboard.writeText(
|
|
2075
|
+
navigator.clipboard.writeText(c), n({
|
|
2036
2076
|
message: "Link copied to clipboard",
|
|
2037
2077
|
status: "success"
|
|
2038
2078
|
});
|
|
2039
2079
|
}
|
|
2040
|
-
function
|
|
2080
|
+
function l() {
|
|
2041
2081
|
i(!1), setTimeout(() => {
|
|
2042
2082
|
s(!1), i(!0);
|
|
2043
2083
|
}, 300);
|
|
2044
2084
|
}
|
|
2045
|
-
function m(
|
|
2046
|
-
return
|
|
2085
|
+
function m(p, B) {
|
|
2086
|
+
return p.length > B ? p.slice(0, B) + "..." : p;
|
|
2047
2087
|
}
|
|
2048
2088
|
return /* @__PURE__ */ t.jsxs(
|
|
2049
2089
|
"div",
|
|
2050
2090
|
{
|
|
2051
|
-
className:
|
|
2052
|
-
onClick: (
|
|
2091
|
+
className: et.modal,
|
|
2092
|
+
onClick: (p) => p.stopPropagation(),
|
|
2053
2093
|
children: [
|
|
2054
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2055
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
2094
|
+
/* @__PURE__ */ t.jsxs("div", { className: et.header, children: [
|
|
2095
|
+
/* @__PURE__ */ t.jsx("div", { className: et.title, children: o }),
|
|
2056
2096
|
/* @__PURE__ */ t.jsx(
|
|
2057
|
-
|
|
2097
|
+
v,
|
|
2058
2098
|
{
|
|
2059
2099
|
name: "X",
|
|
2060
2100
|
fill: "#757575",
|
|
2061
|
-
onClick:
|
|
2101
|
+
onClick: l,
|
|
2062
2102
|
hoverable: !0
|
|
2063
2103
|
}
|
|
2064
2104
|
)
|
|
2065
2105
|
] }),
|
|
2066
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2106
|
+
/* @__PURE__ */ t.jsxs("div", { className: et.copyWrapper, children: [
|
|
2067
2107
|
/* @__PURE__ */ t.jsxs(
|
|
2068
|
-
|
|
2108
|
+
F,
|
|
2069
2109
|
{
|
|
2070
2110
|
type: "Secondary",
|
|
2071
2111
|
onClick: u,
|
|
@@ -2073,59 +2113,59 @@ const li = (r) => {
|
|
|
2073
2113
|
flex: 1
|
|
2074
2114
|
},
|
|
2075
2115
|
children: [
|
|
2076
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
2077
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
2078
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
2116
|
+
/* @__PURE__ */ t.jsx("div", { className: et.copyText, children: m(c, 100) }),
|
|
2117
|
+
/* @__PURE__ */ t.jsx("div", { className: et.copyTextMobile, children: m(c, 40) }),
|
|
2118
|
+
/* @__PURE__ */ t.jsx("div", { className: et.copyTextMiniMobile, children: m(c, 20) })
|
|
2079
2119
|
]
|
|
2080
2120
|
}
|
|
2081
2121
|
),
|
|
2082
2122
|
/* @__PURE__ */ t.jsx(
|
|
2083
|
-
|
|
2123
|
+
F,
|
|
2084
2124
|
{
|
|
2085
2125
|
type: "Secondary",
|
|
2086
2126
|
onClick: u,
|
|
2087
|
-
children: e ? /* @__PURE__ */ t.jsx(
|
|
2127
|
+
children: e ? /* @__PURE__ */ t.jsx(v, { name: "Check" }) : /* @__PURE__ */ t.jsx(v, { name: "Copy" })
|
|
2088
2128
|
}
|
|
2089
2129
|
)
|
|
2090
2130
|
] })
|
|
2091
2131
|
]
|
|
2092
2132
|
}
|
|
2093
2133
|
);
|
|
2094
|
-
},
|
|
2095
|
-
accordion:
|
|
2096
|
-
header:
|
|
2097
|
-
icon:
|
|
2098
|
-
open:
|
|
2099
|
-
content:
|
|
2100
|
-
},
|
|
2101
|
-
const [n, i] =
|
|
2134
|
+
}, Fs = "_accordion_1s1lq_1", Vs = "_header_1s1lq_9", Us = "_icon_1s1lq_18", Hs = "_open_1s1lq_21", Ys = "_content_1s1lq_25", it = {
|
|
2135
|
+
accordion: Fs,
|
|
2136
|
+
header: Vs,
|
|
2137
|
+
icon: Us,
|
|
2138
|
+
open: Hs,
|
|
2139
|
+
content: Ys
|
|
2140
|
+
}, Ui = ({ title: o, content: s, defaultOpen: e = !1 }) => {
|
|
2141
|
+
const [n, i] = x.useState(e), [c, u] = x.useState(0), l = x.useRef(null), m = () => {
|
|
2102
2142
|
i(!n);
|
|
2103
2143
|
};
|
|
2104
|
-
return
|
|
2105
|
-
|
|
2106
|
-
}, [n]), /* @__PURE__ */ t.jsxs("div", { className:
|
|
2144
|
+
return x.useEffect(() => {
|
|
2145
|
+
l.current && u(n ? l.current.scrollHeight : 0);
|
|
2146
|
+
}, [n]), /* @__PURE__ */ t.jsxs("div", { className: it.accordion, children: [
|
|
2107
2147
|
/* @__PURE__ */ t.jsxs(
|
|
2108
2148
|
"div",
|
|
2109
2149
|
{
|
|
2110
|
-
className:
|
|
2150
|
+
className: it.header,
|
|
2111
2151
|
onClick: m,
|
|
2112
2152
|
children: [
|
|
2113
|
-
/* @__PURE__ */ t.jsx("h5", { id: "h5", children:
|
|
2114
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
2153
|
+
/* @__PURE__ */ t.jsx("h5", { id: "h5", children: o }),
|
|
2154
|
+
/* @__PURE__ */ t.jsx("div", { className: V(it.icon, { [it.open]: n }), children: /* @__PURE__ */ t.jsx(v, { name: "CaretDown" }) })
|
|
2115
2155
|
]
|
|
2116
2156
|
}
|
|
2117
2157
|
),
|
|
2118
2158
|
/* @__PURE__ */ t.jsx(
|
|
2119
2159
|
"div",
|
|
2120
2160
|
{
|
|
2121
|
-
ref:
|
|
2122
|
-
className:
|
|
2123
|
-
style: { height: `${
|
|
2161
|
+
ref: l,
|
|
2162
|
+
className: it.content,
|
|
2163
|
+
style: { height: `${c}px` },
|
|
2124
2164
|
children: /* @__PURE__ */ t.jsx("p", { id: "p", children: s })
|
|
2125
2165
|
}
|
|
2126
2166
|
)
|
|
2127
2167
|
] });
|
|
2128
|
-
},
|
|
2168
|
+
}, Hi = ({ children: o, path: s, className: e, target: n = "_self", id: i }) => {
|
|
2129
2169
|
if (window.location.pathname.includes("/admin/builder"))
|
|
2130
2170
|
return /* @__PURE__ */ t.jsx(
|
|
2131
2171
|
"div",
|
|
@@ -2134,47 +2174,78 @@ const li = (r) => {
|
|
|
2134
2174
|
role: "link",
|
|
2135
2175
|
style: { cursor: "pointer" },
|
|
2136
2176
|
id: i,
|
|
2137
|
-
children:
|
|
2177
|
+
children: o
|
|
2138
2178
|
}
|
|
2139
2179
|
);
|
|
2140
|
-
const
|
|
2141
|
-
u || n === "_blank" ? n === "_blank" ? window.open(s, "_blank") : window.
|
|
2180
|
+
const c = ut(), u = /^https?:\/\//.test(s), l = (m) => {
|
|
2181
|
+
u || n === "_blank" ? n === "_blank" ? window.open(s, "_blank") : window.open(s, "_self") : (m.preventDefault(), c(s));
|
|
2142
2182
|
};
|
|
2143
2183
|
return /* @__PURE__ */ t.jsx(
|
|
2144
2184
|
"div",
|
|
2145
2185
|
{
|
|
2146
|
-
onClick:
|
|
2186
|
+
onClick: l,
|
|
2147
2187
|
className: e,
|
|
2148
2188
|
role: "link",
|
|
2149
2189
|
style: { cursor: "pointer" },
|
|
2150
2190
|
id: i,
|
|
2151
|
-
children:
|
|
2191
|
+
children: o
|
|
2152
2192
|
}
|
|
2153
2193
|
);
|
|
2154
|
-
},
|
|
2155
|
-
buttonsBlock:
|
|
2156
|
-
slideUp:
|
|
2157
|
-
},
|
|
2158
|
-
|
|
2159
|
-
|
|
2194
|
+
}, Ws = "_buttonsBlock_1b2rb_1", Gs = "_slideUp_1b2rb_1", Qs = {
|
|
2195
|
+
buttonsBlock: Ws,
|
|
2196
|
+
slideUp: Gs
|
|
2197
|
+
}, Yi = (o) => {
|
|
2198
|
+
var p, B;
|
|
2199
|
+
const { setIsOpen: s, setModalType: e, productId: n } = o, { cart: i } = dt(), { pageContext: c } = rt(), u = (p = c == null ? void 0 : c.listings) == null ? void 0 : p.find((r) => r.id === n);
|
|
2200
|
+
if (!u)
|
|
2201
|
+
return null;
|
|
2202
|
+
const l = (B = c == null ? void 0 : c.products) == null ? void 0 : B.find(
|
|
2203
|
+
(r) => r.uniquePath === u.productData.uniquePath
|
|
2204
|
+
);
|
|
2205
|
+
if (!l)
|
|
2206
|
+
return null;
|
|
2207
|
+
const m = i.parts.find((r) => r.productId === l.id);
|
|
2208
|
+
return /* @__PURE__ */ t.jsxs(
|
|
2209
|
+
"div",
|
|
2160
2210
|
{
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2211
|
+
className: Qs.buttonsBlock,
|
|
2212
|
+
onClick: (r) => r.stopPropagation(),
|
|
2213
|
+
children: [
|
|
2214
|
+
/* @__PURE__ */ t.jsx(
|
|
2215
|
+
F,
|
|
2216
|
+
{
|
|
2217
|
+
type: "Secondary",
|
|
2218
|
+
style: {
|
|
2219
|
+
width: "100%"
|
|
2220
|
+
},
|
|
2221
|
+
onClick: () => {
|
|
2222
|
+
e("Add To Cart"), s(!0);
|
|
2223
|
+
},
|
|
2224
|
+
children: m ? "Add More" : "Add To Cart"
|
|
2225
|
+
}
|
|
2226
|
+
),
|
|
2227
|
+
/* @__PURE__ */ t.jsx(
|
|
2228
|
+
F,
|
|
2229
|
+
{
|
|
2230
|
+
type: "Primary",
|
|
2231
|
+
onClick: () => {
|
|
2232
|
+
e("Buy Now"), s(!0);
|
|
2233
|
+
},
|
|
2234
|
+
children: "Buy"
|
|
2235
|
+
}
|
|
2236
|
+
)
|
|
2237
|
+
]
|
|
2166
2238
|
}
|
|
2167
|
-
)
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
const { general: s } = Ot();
|
|
2239
|
+
);
|
|
2240
|
+
}, Xs = "_wrapper_27wzz_1", Js = "_logo_27wzz_8", Ks = "_info_27wzz_12", ht = {
|
|
2241
|
+
wrapper: Xs,
|
|
2242
|
+
logo: Js,
|
|
2243
|
+
info: Ks
|
|
2244
|
+
}, Wi = ({ date: o }) => {
|
|
2245
|
+
const { general: s } = Dt();
|
|
2175
2246
|
if (!s) return /* @__PURE__ */ t.jsx(t.Fragment, {});
|
|
2176
2247
|
function e(n) {
|
|
2177
|
-
const i = new Date(n),
|
|
2248
|
+
const i = new Date(n), c = {
|
|
2178
2249
|
month: "short",
|
|
2179
2250
|
day: "2-digit",
|
|
2180
2251
|
year: "numeric",
|
|
@@ -2182,10 +2253,10 @@ const li = (r) => {
|
|
|
2182
2253
|
minute: "2-digit",
|
|
2183
2254
|
hour12: !1
|
|
2184
2255
|
};
|
|
2185
|
-
return i.toLocaleDateString("en-US",
|
|
2256
|
+
return i.toLocaleDateString("en-US", c);
|
|
2186
2257
|
}
|
|
2187
|
-
return /* @__PURE__ */ t.jsxs("div", { className:
|
|
2188
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
2258
|
+
return /* @__PURE__ */ t.jsxs("div", { className: ht.wrapper, children: [
|
|
2259
|
+
/* @__PURE__ */ t.jsx("div", { className: ht.logo, children: s.info.logo ? /* @__PURE__ */ t.jsx(
|
|
2189
2260
|
"img",
|
|
2190
2261
|
{
|
|
2191
2262
|
src: `https://imagedelivery.net/${s.info.logo.cfId}/w=500,h=500`,
|
|
@@ -2193,40 +2264,207 @@ const li = (r) => {
|
|
|
2193
2264
|
style: { objectFit: "contain", width: "48px", height: "48px" }
|
|
2194
2265
|
}
|
|
2195
2266
|
) : /* @__PURE__ */ t.jsx(
|
|
2196
|
-
|
|
2267
|
+
v,
|
|
2197
2268
|
{
|
|
2198
2269
|
name: "Image",
|
|
2199
2270
|
width: 48,
|
|
2200
2271
|
height: 48
|
|
2201
2272
|
}
|
|
2202
2273
|
) }),
|
|
2203
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2274
|
+
/* @__PURE__ */ t.jsxs("div", { className: ht.info, children: [
|
|
2204
2275
|
/* @__PURE__ */ t.jsx("h3", { id: "h4", children: s.info.name }),
|
|
2205
|
-
/* @__PURE__ */ t.jsx("p", { id: "p", children: e(
|
|
2276
|
+
/* @__PURE__ */ t.jsx("p", { id: "p", children: e(o) })
|
|
2206
2277
|
] })
|
|
2207
2278
|
] });
|
|
2208
|
-
},
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2279
|
+
}, Zs = "_options_mju90_1", ti = "_price_mju90_12", ei = "_oldPrice_mju90_19", ni = "_newPrice_mju90_27", si = "_animate_mju90_34", ii = "_appearAndBounce_mju90_1", ai = "_meta_mju90_52", oi = "_info_mju90_58", ci = "_infoRight_mju90_66", li = "_buttons_mju90_73", ri = "_variants_mju90_80", di = "_variant_mju90_80", ui = "_stock_mju90_98", mi = "_variantInfo_mju90_105", hi = "_quantity_mju90_111", pi = "_count_mju90_118", _i = "_focused_mju90_135", gi = "_button_mju90_73", fi = "_activeVariant_mju90_161", xi = "_chargeTypes_mju90_165", vi = "_charge_mju90_165", ji = "_chargeActive_mju90_190", bi = "_title_mju90_198", yi = "_modal_mju90_204", Ni = "_header_mju90_218", Q = {
|
|
2280
|
+
options: Zs,
|
|
2281
|
+
price: ti,
|
|
2282
|
+
oldPrice: ei,
|
|
2283
|
+
newPrice: ni,
|
|
2284
|
+
animate: si,
|
|
2285
|
+
appearAndBounce: ii,
|
|
2286
|
+
meta: ai,
|
|
2287
|
+
info: oi,
|
|
2288
|
+
infoRight: ci,
|
|
2289
|
+
buttons: li,
|
|
2290
|
+
variants: ri,
|
|
2291
|
+
variant: di,
|
|
2292
|
+
stock: ui,
|
|
2293
|
+
variantInfo: mi,
|
|
2294
|
+
quantity: hi,
|
|
2295
|
+
count: pi,
|
|
2296
|
+
focused: _i,
|
|
2297
|
+
button: gi,
|
|
2298
|
+
activeVariant: fi,
|
|
2299
|
+
chargeTypes: xi,
|
|
2300
|
+
charge: vi,
|
|
2301
|
+
chargeActive: ji,
|
|
2302
|
+
title: bi,
|
|
2303
|
+
modal: yi,
|
|
2304
|
+
header: Ni
|
|
2305
|
+
}, Gi = (o) => {
|
|
2306
|
+
var l, m;
|
|
2307
|
+
const { pageContext: s } = rt(), e = (l = s == null ? void 0 : s.listings) == null ? void 0 : l.find((p) => p.id === o.productId);
|
|
2308
|
+
if (!e)
|
|
2309
|
+
return;
|
|
2310
|
+
const n = (m = s == null ? void 0 : s.products) == null ? void 0 : m.find(
|
|
2311
|
+
(p) => p.uniquePath === e.productData.uniquePath
|
|
2312
|
+
);
|
|
2313
|
+
if (!n)
|
|
2314
|
+
return;
|
|
2315
|
+
const i = n.variants[0], [c, u] = x.useState(
|
|
2316
|
+
i.chargeTypes && i.chargeTypes.length > 1 ? i.chargeTypes[0] : "ONE_TIME"
|
|
2317
|
+
);
|
|
2318
|
+
return /* @__PURE__ */ t.jsxs(
|
|
2319
|
+
"div",
|
|
2320
|
+
{
|
|
2321
|
+
className: Q.modal,
|
|
2322
|
+
onClick: (p) => p.stopPropagation(),
|
|
2323
|
+
children: [
|
|
2324
|
+
o.type === "Add To Cart" && /* @__PURE__ */ t.jsx(
|
|
2325
|
+
Ii,
|
|
2326
|
+
{
|
|
2327
|
+
variants: n.variants,
|
|
2328
|
+
activeVariant: i,
|
|
2329
|
+
activeChargeType: c,
|
|
2330
|
+
setActiveChargeType: u,
|
|
2331
|
+
productId: n.id,
|
|
2332
|
+
setIsOpen: o.setIsOpen
|
|
2333
|
+
}
|
|
2334
|
+
),
|
|
2335
|
+
o.type === "Buy Now" && /* @__PURE__ */ t.jsx(
|
|
2336
|
+
ki,
|
|
2337
|
+
{
|
|
2338
|
+
product: n,
|
|
2339
|
+
setIsOpen: o.setIsOpen
|
|
2340
|
+
}
|
|
2341
|
+
)
|
|
2342
|
+
]
|
|
2343
|
+
}
|
|
2344
|
+
);
|
|
2345
|
+
}, Ii = (o) => {
|
|
2346
|
+
const { variants: s, activeChargeType: e, setActiveChargeType: n, activeVariant: i, productId: c, setIsOpen: u } = o, { cart: l, addProductToCart: m, addProducts: p, updateQuantityOfProduct: B } = dt(), { setNotification: r } = qt(), { pageContext: a } = rt();
|
|
2347
|
+
async function j(d) {
|
|
2348
|
+
const S = l.parts.find(
|
|
2349
|
+
(g) => g.productId === o.productId && g.productVariantId === d
|
|
2350
|
+
);
|
|
2351
|
+
S ? B({
|
|
2352
|
+
productId: c,
|
|
2353
|
+
productVariantId: d,
|
|
2354
|
+
quantity: S.quantity + 1
|
|
2355
|
+
}) : (a != null && a.products && await p(a.products), await m({
|
|
2356
|
+
productId: c,
|
|
2357
|
+
productVariantId: d,
|
|
2358
|
+
quantity: 1
|
|
2359
|
+
})), r({
|
|
2360
|
+
message: "Product added to cart",
|
|
2361
|
+
status: "success"
|
|
2362
|
+
});
|
|
2363
|
+
}
|
|
2364
|
+
return /* @__PURE__ */ t.jsxs("div", { className: Q.modal, children: [
|
|
2365
|
+
/* @__PURE__ */ t.jsxs("div", { className: Q.header, children: [
|
|
2366
|
+
/* @__PURE__ */ t.jsx("div", { id: "h3", children: "Choose a variant" }),
|
|
2367
|
+
/* @__PURE__ */ t.jsx(
|
|
2368
|
+
v,
|
|
2369
|
+
{
|
|
2370
|
+
name: "X",
|
|
2371
|
+
width: 24,
|
|
2372
|
+
height: 24,
|
|
2373
|
+
fill: "var(--text-secondary)",
|
|
2374
|
+
hoverable: !0,
|
|
2375
|
+
onClick: () => u(!1)
|
|
2376
|
+
}
|
|
2377
|
+
)
|
|
2378
|
+
] }),
|
|
2379
|
+
i.chargeTypes && i.chargeTypes.length > 1 && /* @__PURE__ */ t.jsx("div", { className: Q.chargeTypes, children: i.chargeTypes.map((d) => /* @__PURE__ */ t.jsx(
|
|
2380
|
+
"div",
|
|
2381
|
+
{
|
|
2382
|
+
className: V(Q.charge, {
|
|
2383
|
+
[Q.chargeActive]: e === d
|
|
2384
|
+
}),
|
|
2385
|
+
onClick: () => n(d),
|
|
2386
|
+
children: Ct[d]
|
|
2387
|
+
},
|
|
2388
|
+
d
|
|
2389
|
+
)) }),
|
|
2390
|
+
/* @__PURE__ */ t.jsx("div", { className: Q.variants, children: s.map((d) => {
|
|
2391
|
+
var S, g;
|
|
2392
|
+
return /* @__PURE__ */ t.jsxs(
|
|
2393
|
+
"div",
|
|
2394
|
+
{
|
|
2395
|
+
className: V(Q.variant),
|
|
2396
|
+
onClick: () => {
|
|
2397
|
+
j(d.id), u(!1);
|
|
2398
|
+
},
|
|
2399
|
+
children: [
|
|
2400
|
+
/* @__PURE__ */ t.jsxs("div", { className: Q.variantInfo, children: [
|
|
2401
|
+
/* @__PURE__ */ t.jsx("span", { className: Q.title, children: d.name }),
|
|
2402
|
+
/* @__PURE__ */ t.jsxs("span", { children: [
|
|
2403
|
+
"$",
|
|
2404
|
+
e === "ONE_TIME" ? d.price.amount : d.subscriptionSettings ? d.subscriptionSettings.price.amount : "Price Not Found"
|
|
2405
|
+
] })
|
|
2406
|
+
] }),
|
|
2407
|
+
/* @__PURE__ */ t.jsx("div", { children: e === "ONE_TIME" && /* @__PURE__ */ t.jsxs("span", { className: Q.stock, children: [
|
|
2408
|
+
(S = d.quantity.restrictions) != null && S.max || d.quantity.available !== void 0 ? ((g = d.quantity.restrictions) == null ? void 0 : g.max) || d.quantity.available : "∞",
|
|
2409
|
+
" ",
|
|
2410
|
+
"in stock"
|
|
2411
|
+
] }) })
|
|
2412
|
+
]
|
|
2413
|
+
},
|
|
2414
|
+
d.id
|
|
2415
|
+
);
|
|
2416
|
+
}) })
|
|
2417
|
+
] });
|
|
2418
|
+
}, ki = (o) => {
|
|
2419
|
+
const { product: s, setIsOpen: e } = o;
|
|
2420
|
+
return /* @__PURE__ */ t.jsxs("div", { className: Q.modal, children: [
|
|
2421
|
+
/* @__PURE__ */ t.jsxs("div", { className: Q.header, children: [
|
|
2422
|
+
/* @__PURE__ */ t.jsxs("div", { id: "h3", children: [
|
|
2423
|
+
"Buy ",
|
|
2424
|
+
It(s.name)
|
|
2425
|
+
] }),
|
|
2426
|
+
/* @__PURE__ */ t.jsx(
|
|
2427
|
+
v,
|
|
2428
|
+
{
|
|
2429
|
+
name: "X",
|
|
2430
|
+
width: 24,
|
|
2431
|
+
height: 24,
|
|
2432
|
+
fill: "var(--text-secondary)",
|
|
2433
|
+
hoverable: !0,
|
|
2434
|
+
onClick: () => e(!1),
|
|
2435
|
+
style: {
|
|
2436
|
+
minWidth: 24,
|
|
2437
|
+
minHeight: 24
|
|
2438
|
+
}
|
|
2439
|
+
}
|
|
2440
|
+
)
|
|
2441
|
+
] }),
|
|
2442
|
+
/* @__PURE__ */ t.jsx(Vn, { ...s })
|
|
2443
|
+
] });
|
|
2444
|
+
}, Ci = "_wrapper_1efqk_1", Si = "_label_1efqk_10", wi = "_contentBorder_1efqk_19", $i = "_contentField_1efqk_23", qi = "_textarea_1efqk_27", Bi = "_length_1efqk_42", st = {
|
|
2445
|
+
wrapper: Ci,
|
|
2446
|
+
label: Si,
|
|
2447
|
+
contentBorder: wi,
|
|
2448
|
+
contentField: $i,
|
|
2449
|
+
textarea: qi,
|
|
2450
|
+
length: Bi
|
|
2451
|
+
}, Qi = (o) => {
|
|
2214
2452
|
const {
|
|
2215
2453
|
onChange: s,
|
|
2216
2454
|
label: e,
|
|
2217
2455
|
value: n,
|
|
2218
2456
|
maxLength: i,
|
|
2219
|
-
placeholder:
|
|
2457
|
+
placeholder: c = "Type something...",
|
|
2220
2458
|
type: u = "text"
|
|
2221
|
-
} =
|
|
2222
|
-
function
|
|
2223
|
-
return u === "number" ?
|
|
2459
|
+
} = o, [l, m] = x.useState(n.length), { themeSettings: p } = Rt();
|
|
2460
|
+
function B(r) {
|
|
2461
|
+
return u === "number" ? r.replace(/[^\d\n]+/g, "") : r;
|
|
2224
2462
|
}
|
|
2225
|
-
return /* @__PURE__ */ t.jsxs("div", { className:
|
|
2463
|
+
return /* @__PURE__ */ t.jsxs("div", { className: st.wrapper, children: [
|
|
2226
2464
|
e && /* @__PURE__ */ t.jsx(
|
|
2227
2465
|
"label",
|
|
2228
2466
|
{
|
|
2229
|
-
className:
|
|
2467
|
+
className: st.label,
|
|
2230
2468
|
htmlFor: e,
|
|
2231
2469
|
children: e
|
|
2232
2470
|
}
|
|
@@ -2236,58 +2474,63 @@ const li = (r) => {
|
|
|
2236
2474
|
{
|
|
2237
2475
|
id: e,
|
|
2238
2476
|
value: n,
|
|
2239
|
-
onChange: (
|
|
2240
|
-
const
|
|
2241
|
-
m(
|
|
2477
|
+
onChange: (r) => {
|
|
2478
|
+
const a = B(r.target.value);
|
|
2479
|
+
m(a.length), s(a);
|
|
2242
2480
|
},
|
|
2243
|
-
placeholder:
|
|
2244
|
-
className:
|
|
2481
|
+
placeholder: c,
|
|
2482
|
+
className: V(st.textarea, {
|
|
2483
|
+
[st.contentBorder]: p.inputs.border.active,
|
|
2484
|
+
[st.contentField]: p.inputs.field.active
|
|
2485
|
+
}),
|
|
2245
2486
|
maxLength: i
|
|
2246
2487
|
}
|
|
2247
2488
|
),
|
|
2248
|
-
i && /* @__PURE__ */ t.jsxs("div", { className:
|
|
2249
|
-
|
|
2489
|
+
i && /* @__PURE__ */ t.jsxs("div", { className: st.length, children: [
|
|
2490
|
+
l,
|
|
2250
2491
|
"/",
|
|
2251
2492
|
i
|
|
2252
2493
|
] })
|
|
2253
2494
|
] });
|
|
2254
2495
|
};
|
|
2255
2496
|
export {
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2497
|
+
Ui as Accordion,
|
|
2498
|
+
$s as BurgerMenuButton,
|
|
2499
|
+
F as Button,
|
|
2500
|
+
xn as ButtonTypeSettings,
|
|
2501
|
+
Ri as ButtonsSettings,
|
|
2502
|
+
Oi as CategorySettings,
|
|
2503
|
+
Ct as ChargeTypes,
|
|
2504
|
+
Tt as ChooseImage,
|
|
2505
|
+
Ki as ChooseImageModal,
|
|
2506
|
+
Ss as EmptyCart,
|
|
2507
|
+
Di as FormSettings,
|
|
2508
|
+
zi as HeaderButtons,
|
|
2509
|
+
v as Icon,
|
|
2510
|
+
pt as InputSettings,
|
|
2511
|
+
Ot as InputUI,
|
|
2512
|
+
Zi as ItemsSettings,
|
|
2513
|
+
Ai as LayoutSettings,
|
|
2514
|
+
Hi as Link,
|
|
2515
|
+
Li as ListingSelector,
|
|
2516
|
+
ta as Loader,
|
|
2517
|
+
Wi as MetaInfoPost,
|
|
2518
|
+
kt as Modal,
|
|
2519
|
+
Fi as PagesMobileMenu,
|
|
2520
|
+
ws as PagesMobileModal,
|
|
2521
|
+
Ei as PagesSettings,
|
|
2522
|
+
Yi as ProductCardButtons,
|
|
2523
|
+
Gi as ProductCardModal,
|
|
2524
|
+
Vn as ProductOptions,
|
|
2525
|
+
St as RangeSelector,
|
|
2526
|
+
lt as Select,
|
|
2527
|
+
Vi as ShareLink,
|
|
2528
|
+
ks as ShoppingButton,
|
|
2529
|
+
Cs as ShoppingModalCart,
|
|
2530
|
+
ot as Switch,
|
|
2531
|
+
ea as TextSettings,
|
|
2532
|
+
na as TextareaSettings,
|
|
2533
|
+
Qi as TextareaUI,
|
|
2534
|
+
sa as TypesText,
|
|
2535
|
+
Bt as UserInfo
|
|
2293
2536
|
};
|