@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/ui.es.js CHANGED
@@ -1,21 +1,21 @@
1
- import { j as t, I as f, c as W, a as ut, S as it, R as kt, B as ot, O as mt, d as at, u as ht, e as pt, P as _t, D as gt, f as ft, v as xt, g as bt, C as jt, h as F, i as wt, k as st, l as $t, m as Bt, n as Pt, o as rt, p as G, L as Mt, r as lt, t as vt, w as H, x as Tt, M as yt, y as Nt, z as qt, A as It, E as At, F as Ot } from "./index-DV89YV-L.js";
2
- import { N as bi, H as ji, K as vi, G as yi, T as ki, J as Ni } from "./index-DV89YV-L.js";
3
- import _ from "react";
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 Et = "_wrapper_1vmyb_2", Dt = "_alignmentBlock_1vmyb_8", Rt = "_title_1vmyb_15", Lt = "_subtitle_1vmyb_22", zt = "_alignmentContent_1vmyb_29", Ut = "_alignments_1vmyb_37", Ht = "_alignment_1vmyb_8", Ft = "_circle_1vmyb_60", Vt = "_paddings_1vmyb_67", Yt = "_padding_1vmyb_67", Gt = "_active_1vmyb_91", Wt = "_input_1vmyb_98", J = {
6
- wrapper: Et,
7
- alignmentBlock: Dt,
8
- title: Rt,
9
- subtitle: Lt,
10
- alignmentContent: zt,
11
- alignments: Ut,
12
- alignment: Ht,
13
- circle: Ft,
14
- paddings: Vt,
15
- padding: Yt,
16
- active: Gt,
17
- input: Wt
18
- }, Jt = [
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
- ], Xt = ["left", "top", "right", "bottom"], ni = (r) => {
29
- const { alignment: s, padding: e, setPadding: n, setAlignment: i } = r;
30
- function d(c) {
31
- switch (c) {
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(c) {
49
- switch (c) {
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 [o, m] = _.useState(null), [g, C] = _.useState(null);
61
- return /* @__PURE__ */ t.jsxs("div", { className: J.layout, children: [
62
- /* @__PURE__ */ t.jsx("h3", { className: J.title, children: "Layout (for Desktop version)" }),
63
- /* @__PURE__ */ t.jsxs("div", { className: J.alignmentBlock, children: [
64
- /* @__PURE__ */ t.jsx("h5", { className: J.subtitle, children: "Alignment" }),
65
- /* @__PURE__ */ t.jsxs("div", { className: J.alignmentContent, children: [
66
- /* @__PURE__ */ t.jsx("div", { className: J.alignments, children: Jt.map((c) => /* @__PURE__ */ t.jsxs(
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(c);
70
+ i(r);
71
71
  },
72
- className: J.alignment,
72
+ className: X.alignment,
73
73
  onMouseEnter: () => {
74
- m(c);
74
+ m(r);
75
75
  },
76
76
  onMouseLeave: () => {
77
77
  m(null);
78
78
  },
79
79
  children: [
80
- c !== s && o !== c && /* @__PURE__ */ t.jsx("div", { className: J.circle }),
81
- c !== s && o === c && /* @__PURE__ */ t.jsx(
82
- f,
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: d(o),
84
+ name: c(l),
85
85
  fill: "#c2c2c2",
86
86
  width: 22,
87
87
  height: 22
88
88
  }
89
89
  ),
90
- c === s && /* @__PURE__ */ t.jsx(
91
- f,
90
+ r === s && /* @__PURE__ */ t.jsx(
91
+ v,
92
92
  {
93
- name: d(s),
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
- c
101
+ r
102
102
  )) }),
103
- /* @__PURE__ */ t.jsx("div", { className: J.paddings, children: Xt.map((c) => /* @__PURE__ */ t.jsxs(
103
+ /* @__PURE__ */ t.jsx("div", { className: X.paddings, children: Zt.map((r) => /* @__PURE__ */ t.jsxs(
104
104
  "label",
105
105
  {
106
- className: W(J.padding, {
107
- [J.active]: g === c
106
+ className: V(X.padding, {
107
+ [X.active]: p === r
108
108
  }),
109
109
  onFocus: () => {
110
- C(c);
110
+ B(r);
111
111
  },
112
112
  onBlur: () => {
113
- C(null);
113
+ B(null);
114
114
  },
115
115
  children: [
116
116
  /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
117
- f,
117
+ v,
118
118
  {
119
- name: u(c),
119
+ name: u(r),
120
120
  width: 20,
121
121
  height: 20
122
122
  }
123
123
  ) }),
124
124
  /* @__PURE__ */ t.jsx(
125
- ut,
125
+ pt,
126
126
  {
127
127
  type: "number",
128
- value: String(e[c]),
129
- onChange: (l) => n({
128
+ value: String(e[r]),
129
+ onChange: (a) => n({
130
130
  ...e,
131
- [c]: Math.min(Number(l), 999)
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
- c
140
+ r
141
141
  )) })
142
142
  ] })
143
143
  ] })
144
144
  ] });
145
- }, Kt = "_title_82zux_1", Qt = "_subtitle_82zux_5", Zt = "_header_82zux_12", te = "_text_82zux_13", ee = "_productsBlock_82zux_14", ne = "_top_82zux_26", se = "_itemsBlock_82zux_35", ie = "_typeTexts_82zux_41", oe = "_block_82zux_48", ae = "_active_82zux_61", ce = "_products_82zux_14", le = "_product_82zux_14", re = "_button_82zux_80", de = "_disabled_82zux_91", ue = "_image_82zux_95", me = "_info_82zux_102", he = "_name_82zux_114", pe = "_buttons_82zux_118", _e = "_modal_82zux_125", ge = "_link_82zux_145", fe = "_modalOptions_82zux_151", xe = "_addButton_82zux_157", be = "_deleteButton_82zux_179", X = {
146
- title: Kt,
147
- subtitle: Qt,
148
- header: Zt,
149
- text: te,
150
- productsBlock: ee,
151
- top: ne,
152
- itemsBlock: se,
153
- typeTexts: ie,
154
- block: oe,
155
- active: ae,
156
- products: ce,
157
- product: le,
158
- button: re,
159
- disabled: de,
160
- image: ue,
161
- info: me,
162
- name: he,
163
- buttons: pe,
164
- modal: _e,
165
- link: ge,
166
- modalOptions: fe,
167
- addButton: xe,
168
- deleteButton: be
169
- }, si = (r) => {
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: d,
175
+ other: c,
176
176
  title: u,
177
- subtitle: o,
177
+ subtitle: l,
178
178
  draggable: m = !1,
179
- withImage: g = !1,
180
- addable: C = !0,
181
- itemsOptions: c,
182
- hasRangeSelector: l = !1,
183
- rangeSelectorOptions: T,
184
- limit: $,
185
- autoScrollInterval: M,
186
- deletable: x
187
- } = r;
188
- function N(j) {
189
- if (g)
190
- return j ? /* @__PURE__ */ t.jsx(
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/${j[0]}/w=1000`,
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
- f,
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 a = (j, R = !1) => {
209
- const w = c.find((S) => S.id === j);
210
- if (!w) return;
211
- const z = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
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
- f,
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
- at,
222
+ lt,
223
223
  {
224
- onChange: (S) => {
225
- const v = [...n], I = c.find((p) => p.name === S);
226
- if (!I) return;
227
- const q = I.id, B = v.map((p) => p === j ? q : p);
228
- i([...B]);
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: w.name,
231
- options: c.filter((S) => !n.find((v) => v === S.id)).map((S) => S.name),
232
- leftAddon: N(w.images)
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
- R && /* @__PURE__ */ t.jsx("div", { className: X.buttons, children: /* @__PURE__ */ t.jsx("div", { className: X.deleteButton, children: /* @__PURE__ */ t.jsx(
236
- f,
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((S) => S !== j))
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: X.product,
251
- children: z
250
+ className: J.product,
251
+ children: R
252
252
  },
253
- j
253
+ k
254
254
  );
255
255
  };
256
- return /* @__PURE__ */ t.jsxs("div", { className: X.productsBlock, children: [
257
- (u || s !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: X.top, children: [
258
- u && /* @__PURE__ */ t.jsx("h3", { className: X.title, children: u }),
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
- it,
260
+ ot,
261
261
  {
262
262
  current: s,
263
- onChange: (j) => e == null ? void 0 : e(j)
263
+ onChange: (k) => e == null ? void 0 : e(k)
264
264
  }
265
265
  )
266
266
  ] }),
267
- l && T && /* @__PURE__ */ t.jsx(kt, { ...T }),
268
- /* @__PURE__ */ t.jsxs("div", { className: X.products, children: [
269
- o && /* @__PURE__ */ t.jsx("h5", { className: X.subtitle, children: o }),
270
- n.map((j) => a(j, x)),
271
- C && /* @__PURE__ */ t.jsx(
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
- ot,
281
+ ct,
282
282
  {
283
283
  withoutHover: !0,
284
- className: W(X.button, {
285
- [X.disabled]: !!($ && $ <= n.length || n.length === c.length)
284
+ className: V(J.button, {
285
+ [J.disabled]: !!(d && d <= n.length || n.length === r.length)
286
286
  }),
287
287
  size: "s",
288
- disabled: !!($ && $ <= n.length || n.length === c.length),
288
+ disabled: !!(d && d <= n.length || n.length === r.length),
289
289
  onClick: () => {
290
- const j = [...n];
291
- let R = null;
292
- if (c) {
293
- for (let w = 0; w < c.length; w++)
294
- if (!n.find((z) => z === c[w].id)) {
295
- R = c[w];
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
- j.push((R == null ? void 0 : R.id) || c[0].id), i(j);
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: X.addButton, children: [
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
- f,
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
- d !== void 0 && /* @__PURE__ */ t.jsx(mt, { items: d }),
321
- M !== void 0 && /* @__PURE__ */ t.jsx(
322
- ut,
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(M.scrollInterval),
327
- onChange: (j) => M.setScrollInterval(Number(j)),
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
- }, je = "_title_roi3a_1", ve = "_subtitle_roi3a_5", ye = "_header_roi3a_12", ke = "_text_roi3a_13", Ne = "_productsBlock_roi3a_14", Ie = "_top_roi3a_26", Se = "_itemsBlock_roi3a_35", Ce = "_typeTexts_roi3a_41", we = "_block_roi3a_48", $e = "_active_roi3a_61", Be = "_products_roi3a_14", Pe = "_product_roi3a_14", Me = "_button_roi3a_80", Te = "_disabled_roi3a_91", qe = "_image_roi3a_95", Ae = "_info_roi3a_102", Oe = "_name_roi3a_114", Ee = "_buttons_roi3a_118", De = "_modal_roi3a_125", Re = "_link_roi3a_145", Le = "_modalOptions_roi3a_151", ze = "_addButton_roi3a_164", Ue = "_deleteButton_roi3a_179", He = "_closeIcon_roi3a_191", V = {
338
- title: je,
339
- subtitle: ve,
340
- header: ye,
341
- text: ke,
342
- productsBlock: Ne,
343
- top: Ie,
344
- itemsBlock: Se,
345
- typeTexts: Ce,
346
- block: we,
347
- active: $e,
348
- products: Be,
349
- product: Pe,
350
- button: Me,
351
- disabled: Te,
352
- image: qe,
353
- info: Ae,
354
- name: Oe,
355
- buttons: Ee,
356
- modal: De,
357
- link: Re,
358
- modalOptions: Le,
359
- addButton: ze,
360
- deleteButton: Ue,
361
- closeIcon: He
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 Fe({ product: r, children: s }) {
363
+ function We({ product: o, children: s }) {
364
364
  const {
365
365
  attributes: e,
366
366
  listeners: n,
367
367
  setNodeRef: i,
368
- transform: d,
368
+ transform: c,
369
369
  transition: u,
370
- isDragging: o
371
- } = bt({
372
- id: r.id
370
+ isDragging: l
371
+ } = yt({
372
+ id: o.id
373
373
  }), m = {
374
- transform: jt.Transform.toString(d),
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: `${V.product} ${o ? V.dragging : ""}`,
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 ii = (r) => {
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: d,
395
+ title: c,
396
396
  subtitle: u,
397
- editable: o = !0,
397
+ editable: l = !0,
398
398
  draggable: m = !1,
399
- deletable: g = !0,
400
- addable: C = !0,
401
- itemsType: c,
402
- itemsOptions: l,
403
- addableOptions: T = {},
404
- limit: $
405
- } = r, [M, x] = _.useState(null), [N, a] = _.useState(null), j = _.useRef(null), R = ht(
406
- pt(_t, {
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
- _.useEffect(() => {
413
- if (M) {
414
- const v = [...n].map((I) => I.id === M.id ? M : I);
415
- i(v);
412
+ x.useEffect(() => {
413
+ if (S) {
414
+ const I = [...n].map((b) => b.id === S.id ? S : b);
415
+ i(I);
416
416
  }
417
- }, [M]), _.useEffect(() => {
418
- j.current && N && (j.current.getBoundingClientRect().height, N.top);
419
- }, [j.current, N]);
420
- const w = (v, I) => {
421
- v.stopPropagation();
422
- const q = v.target.getBoundingClientRect();
423
- a({
424
- top: q.top + window.scrollY,
425
- left: q.left - 30
426
- }), x(I);
427
- }, z = (v) => {
428
- const { active: I, over: q } = v;
429
- if (q && I.id !== q.id) {
430
- const B = n.findIndex((b) => b.id === I.id), p = n.findIndex((b) => b.id === q.id);
431
- if (B !== -1 && p !== -1) {
432
- const b = [...n], [A] = b.splice(B, 1);
433
- b.splice(p, 0, A), i(b);
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
- }, S = (v, I) => {
437
- const q = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
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
- f,
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
- c === "select" && l && /* @__PURE__ */ t.jsx(
448
- at,
447
+ r === "select" && a && /* @__PURE__ */ t.jsx(
448
+ lt,
449
449
  {
450
- onChange: (B) => {
451
- const p = [...n], b = l.find((U) => U.name === B);
452
- if (!b) return;
453
- const A = p.map((U) => U.id === v.id ? {
454
- ...b,
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": B
456
+ "en-US": P
457
457
  }
458
458
  } : U);
459
- x({
460
- ...v,
459
+ g({
460
+ ...I,
461
461
  name: {
462
- "en-US": B
462
+ "en-US": P
463
463
  }
464
464
  }), i([...A]);
465
465
  },
466
- value: v.name,
467
- options: l.filter((B) => !n.find((p) => p.name === B.name)).map((B) => B.name)
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: V.buttons, children: [
471
- o && /* @__PURE__ */ t.jsx("div", { className: V.deleteButton, children: /* @__PURE__ */ t.jsx(
472
- f,
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: (B) => w(B, v)
478
+ onClick: (P) => $(P, I)
479
479
  }
480
480
  ) }),
481
- g && /* @__PURE__ */ t.jsx("div", { className: V.deleteButton, children: /* @__PURE__ */ t.jsx(
482
- f,
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((B) => B.id !== v.id))
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
- Fe,
495
+ We,
496
496
  {
497
- product: v,
498
- index: I,
499
- children: q
497
+ product: I,
498
+ index: b,
499
+ children: M
500
500
  },
501
- v.id
501
+ I.id
502
502
  ) : /* @__PURE__ */ t.jsx(
503
503
  "div",
504
504
  {
505
- className: V.product,
506
- children: q
505
+ className: Y.product,
506
+ children: M
507
507
  },
508
- v.id
508
+ I.id
509
509
  );
510
510
  };
511
- return /* @__PURE__ */ t.jsxs("div", { className: V.productsBlock, children: [
512
- (d || s !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: V.top, children: [
513
- d && /* @__PURE__ */ t.jsx("h3", { className: V.title, children: d }),
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
- it,
515
+ ot,
516
516
  {
517
517
  current: s,
518
- onChange: (v) => e == null ? void 0 : e(v)
518
+ onChange: (I) => e == null ? void 0 : e(I)
519
519
  }
520
520
  )
521
521
  ] }),
522
- /* @__PURE__ */ t.jsxs("div", { className: V.products, children: [
523
- u && /* @__PURE__ */ t.jsx("h5", { className: V.subtitle, children: u }),
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
- gt,
525
+ vt,
526
526
  {
527
- sensors: R,
528
- onDragEnd: z,
527
+ sensors: h,
528
+ onDragEnd: R,
529
529
  children: /* @__PURE__ */ t.jsx(
530
- ft,
530
+ jt,
531
531
  {
532
- items: n.map((v) => v.id),
533
- strategy: xt,
534
- children: n.map((v, I) => S(v, I))
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((v, I) => S(v, I)),
539
- C && /* @__PURE__ */ t.jsx(
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
- ot,
548
+ ct,
549
549
  {
550
550
  withoutHover: !0,
551
- className: W(V.button, {
552
- [V.disabled]: !!($ && $ <= n.length || n.length === (l == null ? void 0 : l.length))
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: !!($ && $ <= n.length || n.length === (l == null ? void 0 : l.length)),
555
+ disabled: !!(d && d <= n.length || n.length === (a == null ? void 0 : a.length)),
556
556
  onClick: () => {
557
- const v = [...n];
558
- let I = null;
559
- if (l) {
560
- for (let q = 0; q < l.length; q++)
561
- if (!n.find((B) => B.id === l[q].id)) {
562
- I = l[q];
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
- c === "select" && l && v.push({
567
- name: I ? I.name : l[0].name,
568
- id: (I == null ? void 0 : I.id) || l[0].id,
569
- ...T
570
- }), i(v);
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: V.addButton, children: [
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
- f,
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 Ve(r) {
594
- const { product: s, children: e } = r, { attributes: n, listeners: i, setNodeRef: d, transform: u, transition: o, isDragging: m } = bt({
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
- }), g = {
597
- transform: jt.Transform.toString(u),
598
- transition: o
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: d,
604
- style: g,
605
- className: `${F.product} ${m ? F.dragging : ""}`,
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 oi = (r) => {
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: d,
618
+ other: c,
619
619
  title: u,
620
- subtitle: o,
620
+ subtitle: l,
621
621
  editable: m = !0,
622
- draggable: g = !1,
623
- withImage: C = !1,
624
- deletable: c = !0,
625
- addable: l = !0,
626
- itemsType: T,
627
- itemsPlaceholder: $ = "",
628
- itemsOptions: M,
629
- hasRangeSelector: x = !1,
630
- rangeSelectorOptions: N,
631
- modalOptions: a,
632
- addableOptions: j = {},
633
- limit: R
634
- } = r, [w, z] = _.useState(null), [S, v] = _.useState({
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
- }), [I, q] = _.useState(null), B = _.useRef(null), [p, b] = _.useState(!1), A = ht(
638
- pt(_t, {
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
- _.useEffect(() => {
645
- const h = () => {
646
- z(null), b(!1);
644
+ x.useEffect(() => {
645
+ const _ = () => {
646
+ R(null), N(!1);
647
647
  };
648
- return document.body.addEventListener("click", h), z(null), b(!1), () => {
649
- z(null), b(!1), document.body.removeEventListener("click", h);
648
+ return document.body.addEventListener("click", _), R(null), N(!1), () => {
649
+ R(null), N(!1), document.body.removeEventListener("click", _);
650
650
  };
651
- }, []), _.useEffect(() => {
652
- if (w) {
653
- const h = [...n].map((E) => E.id === w.id ? w : E);
654
- i(h);
651
+ }, []), x.useEffect(() => {
652
+ if ($) {
653
+ const _ = [...n].map((E) => E.id === $.id ? $ : E);
654
+ i(_);
655
655
  }
656
- }, [w]), _.useEffect(() => {
657
- if (B.current && I) {
658
- const h = B.current.getBoundingClientRect().height, E = window.innerHeight;
659
- let P = I.top;
660
- P + h > E + window.scrollY - 200 && (P = E + window.scrollY - h - 200), P < 0 && (P = 10), v({
661
- top: P,
662
- left: I.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
- }, [B.current, I]);
666
- const U = (h, E) => {
667
- h.stopPropagation();
668
- const P = h.target.getBoundingClientRect();
669
- q({
670
- top: P.top + window.scrollY,
671
- left: P.left - 30
672
- }), z(E), b(!0);
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(h) {
675
- if (C)
676
- return h ? /* @__PURE__ */ t.jsx(
674
+ function O(_) {
675
+ if (B)
676
+ return _ ? /* @__PURE__ */ t.jsx(
677
677
  "img",
678
678
  {
679
- src: `https://imagedelivery.net/${h[0]}/w=1000`,
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
- f,
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 L = (h) => {
695
- const { active: E, over: P } = h;
696
- if (P && E.id !== P.id) {
697
- const D = n.findIndex((Y) => Y.id === E.id), et = n.findIndex((Y) => Y.id === P.id);
698
- if (D !== -1 && et !== -1) {
699
- const Y = [...n], [K] = Y.splice(D, 1);
700
- Y.splice(et, 0, K), i(Y);
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
- }, Q = (h) => {
704
- var P;
703
+ }, Z = (_) => {
704
+ var T;
705
705
  const E = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
706
- g && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
707
- f,
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
- T === "select" && M && /* @__PURE__ */ t.jsx(
716
- at,
715
+ j === "select" && S && /* @__PURE__ */ t.jsx(
716
+ lt,
717
717
  {
718
718
  onChange: (D) => {
719
- const Y = [...n].map((K) => K.id === h.id ? {
720
- ...h,
719
+ const W = [...n].map((K) => K.id === _.id ? {
720
+ ..._,
721
721
  name: {
722
722
  "en-US": D
723
723
  }
724
724
  } : K);
725
- z({
726
- ...h,
725
+ R({
726
+ ..._,
727
727
  name: {
728
728
  "en-US": D
729
729
  }
730
- }), i([...Y]);
730
+ }), i([...W]);
731
731
  },
732
- value: h.name["en-US"],
733
- options: M.filter(
734
- (D) => !n.find((et) => et.name["en-US"] === D)
732
+ value: _.name["en-US"],
733
+ options: S.filter(
734
+ (D) => !n.find((nt) => nt.name["en-US"] === D)
735
735
  ),
736
- leftAddon: O(h.images)
736
+ leftAddon: O(_.images)
737
737
  }
738
738
  ),
739
- T === "input" && /* @__PURE__ */ t.jsx(
740
- ut,
739
+ j === "input" && /* @__PURE__ */ t.jsx(
740
+ pt,
741
741
  {
742
742
  onChange: (D) => {
743
- const Y = [...n].map((K) => K.id === h.id ? {
744
- ...h,
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([...Y]);
749
+ i([...W]);
750
750
  },
751
- value: h.name["en-US"],
752
- placeholder: $
751
+ value: _.name["en-US"],
752
+ placeholder: d
753
753
  }
754
754
  ),
755
- T === "image" && /* @__PURE__ */ t.jsx(
756
- $t,
755
+ j === "image" && /* @__PURE__ */ t.jsx(
756
+ Tt,
757
757
  {
758
758
  onChange: (D) => {
759
- const Y = [...n].map((K) => K.id === h.id ? {
760
- ...h,
759
+ const W = [...n].map((K) => K.id === _.id ? {
760
+ ..._,
761
761
  images: D
762
762
  } : K);
763
- i([...Y]);
763
+ i([...W]);
764
764
  },
765
- activeImage: (P = n.find((D) => D.id === h.id)) == null ? void 0 : P.images[0]
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: F.buttons, children: [
769
- m && /* @__PURE__ */ t.jsx("div", { className: F.deleteButton, children: /* @__PURE__ */ t.jsx(
770
- f,
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, h)
776
+ onClick: (D) => U(D, _)
777
777
  }
778
778
  ) }),
779
- c && /* @__PURE__ */ t.jsx("div", { className: F.deleteButton, children: /* @__PURE__ */ t.jsx(
780
- f,
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 !== h.id))
787
+ onClick: () => i(n.filter((D) => D.id !== _.id))
788
788
  }
789
789
  ) })
790
790
  ] })
791
791
  ] });
792
- return g ? /* @__PURE__ */ t.jsx(
793
- Ve,
792
+ return p ? /* @__PURE__ */ t.jsx(
793
+ Ge,
794
794
  {
795
- product: h,
795
+ product: _,
796
796
  children: E
797
797
  },
798
- h.id
798
+ _.id
799
799
  ) : /* @__PURE__ */ t.jsx(
800
800
  "div",
801
801
  {
802
- className: F.product,
802
+ className: H.product,
803
803
  children: E
804
804
  },
805
- h.id
805
+ _.id
806
806
  );
807
807
  };
808
- return /* @__PURE__ */ t.jsxs("div", { className: F.productsBlock, children: [
809
- (u || s !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: F.top, children: [
810
- u && /* @__PURE__ */ t.jsx("h3", { className: F.title, children: u }),
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
- it,
812
+ ot,
813
813
  {
814
814
  current: s,
815
- onChange: (h) => e == null ? void 0 : e(h)
815
+ onChange: (_) => e == null ? void 0 : e(_)
816
816
  }
817
817
  )
818
818
  ] }),
819
- w && m && a && p && /* @__PURE__ */ t.jsx(
820
- wt,
819
+ $ && m && q && f && /* @__PURE__ */ t.jsx(
820
+ Pt,
821
821
  {
822
- ref: B,
823
- activeItem: w,
824
- setActiveItem: z,
825
- popupPosition: S,
826
- modalOptions: a,
827
- setIsOpenModal: b
822
+ ref: P,
823
+ activeItem: $,
824
+ setActiveItem: R,
825
+ popupPosition: L,
826
+ modalOptions: q,
827
+ setIsOpenModal: N
828
828
  }
829
829
  ),
830
- x && N && /* @__PURE__ */ t.jsx(kt, { ...N }),
831
- /* @__PURE__ */ t.jsxs("div", { className: F.products, children: [
832
- o && /* @__PURE__ */ t.jsx("h5", { className: F.subtitle, children: o }),
833
- g ? /* @__PURE__ */ t.jsx(
834
- gt,
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: L,
837
+ onDragEnd: z,
838
838
  children: /* @__PURE__ */ t.jsx(
839
- ft,
839
+ jt,
840
840
  {
841
- items: n.map((h) => h.id),
842
- strategy: xt,
843
- children: n.map((h) => Q(h))
841
+ items: n.map((_) => _.id),
842
+ strategy: bt,
843
+ children: n.map((_) => Z(_))
844
844
  }
845
845
  )
846
846
  }
847
- ) : n.map((h) => Q(h)),
848
- l && /* @__PURE__ */ t.jsx(
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
- ot,
857
+ ct,
858
858
  {
859
859
  withoutHover: !0,
860
- className: W(F.button, {
861
- [F.disabled]: !!(R && R <= n.length)
860
+ className: V(H.button, {
861
+ [H.disabled]: !!(h && h <= n.length)
862
862
  }),
863
863
  size: "s",
864
- disabled: !!(R && R <= n.length),
864
+ disabled: !!(h && h <= n.length),
865
865
  onClick: () => {
866
- const h = [...n];
866
+ const _ = [...n];
867
867
  let E = null;
868
- if (M) {
869
- for (let P = 0; P < M.length; P++)
870
- if (!n.find((D) => D.name["en-US"] === M[P])) {
871
- E = M[P];
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
- T === "select" && M ? h.push({
875
+ j === "select" && S ? _.push({
876
876
  name: {
877
- "en-US": E || M[0]
877
+ "en-US": E || S[0]
878
878
  },
879
- id: st(),
880
- ...j,
879
+ id: at(),
880
+ ...k,
881
881
  maxSymbols: 100
882
882
  // пример значения
883
- }) : T === "input" ? h.push({
883
+ }) : j === "input" ? _.push({
884
884
  name: {
885
885
  "en-US": ""
886
886
  },
887
- id: st(),
888
- ...j,
887
+ id: at(),
888
+ ...k,
889
889
  maxSymbols: 100
890
- }) : h.push({
890
+ }) : _.push({
891
891
  name: {
892
892
  "en-US": `Image ${n.length + 1}`
893
893
  },
894
- id: st(),
895
- ...j,
894
+ id: at(),
895
+ ...k,
896
896
  maxSymbols: 100
897
- }), i(h);
897
+ }), i(_);
898
898
  },
899
899
  style: {
900
900
  width: "fit-content"
901
901
  },
902
- children: /* @__PURE__ */ t.jsxs("div", { className: F.addButton, children: [
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
- f,
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
- d !== void 0 && /* @__PURE__ */ t.jsx(mt, { items: d })
918
+ c !== void 0 && /* @__PURE__ */ t.jsx(_t, { items: c })
919
919
  ] });
920
- }, Ye = "_subtitle_jql1y_1", Ge = "_header_jql1y_8", We = "_text_jql1y_9", Je = "_productsBlock_jql1y_10", Xe = "_buttonsBlock_jql1y_11", Ke = "_top_jql1y_23", Qe = "_itemsBlock_jql1y_32", Ze = "_typeTexts_jql1y_38", tn = "_block_jql1y_45", en = "_active_jql1y_58", nn = "_products_jql1y_10", sn = "_product_jql1y_10", on = "_button_jql1y_11", an = "_image_jql1y_88", cn = "_info_jql1y_95", ln = "_name_jql1y_107", rn = "_buttons_jql1y_11", dn = "_modal_jql1y_118", un = "_other_jql1y_138", mn = "_options_jql1y_144", hn = "_addButton_jql1y_150", pn = "_deleteButton_jql1y_165", Z = {
921
- subtitle: Ye,
922
- header: Ge,
923
- text: We,
924
- productsBlock: Je,
925
- buttonsBlock: Xe,
926
- top: Ke,
927
- itemsBlock: Qe,
928
- typeTexts: Ze,
929
- block: tn,
930
- active: en,
931
- products: nn,
932
- product: sn,
933
- button: on,
934
- image: an,
935
- info: cn,
936
- name: ln,
937
- buttons: rn,
938
- modal: dn,
939
- other: un,
940
- options: mn,
941
- addButton: hn,
942
- deleteButton: pn
943
- }, _n = (r) => {
944
- const { buttons: s, setButtons: e, deletable: n = !0, addable: i = !0, editableLink: d = !0 } = r, { pages: u } = Bt(), [o, m] = _.useState(null), [g, C] = _.useState({
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
- }), [c, l] = _.useState(null), T = _.useRef(null);
948
- _.useEffect(() => {
949
- if (o) {
950
- const x = [...s].map((N) => N.id === o.id ? o : N);
951
- e(x);
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
- }, [o]), _.useEffect(() => {
954
- if (T.current && c) {
955
- const x = T.current.getBoundingClientRect().height, N = window.innerHeight;
956
- let a = c.top;
957
- a + x > N + window.scrollY - 200 && (a = N + window.scrollY - x - 200), a < 0 && (a = 10), C({
958
- top: a,
959
- left: c.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
- }, [T.current, c]);
963
- const $ = (x, N) => {
964
- x.stopPropagation();
965
- const a = x.target.getBoundingClientRect();
966
- l({
967
- top: a.top + window.scrollY - 70,
968
- left: a.left - (i ? 30 : 65)
969
- }), m(N);
970
- }, M = (x, N) => {
971
- const a = [...s], j = {
972
- ...x,
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
- a.splice(N + 1, 0, j), e(a);
976
+ q.splice(y + 1, 0, k), e(q);
977
977
  };
978
- return /* @__PURE__ */ t.jsxs("div", { className: Z.products, children: [
979
- /* @__PURE__ */ t.jsx("h5", { className: Z.subtitle, children: "Button Type" }),
980
- s.map((x, N) => /* @__PURE__ */ t.jsxs(
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: Z.product,
983
+ className: tt.product,
984
984
  children: [
985
985
  /* @__PURE__ */ t.jsx(
986
- at,
986
+ lt,
987
987
  {
988
- onChange: (a) => {
989
- const R = [...s].map((w) => w.id === x.id ? {
990
- ...x,
991
- type: a
992
- } : w);
993
- e(R);
988
+ onChange: (q) => {
989
+ const h = [...s].map(($) => $.id === g.id ? {
990
+ ...g,
991
+ type: q
992
+ } : $);
993
+ e(h);
994
994
  },
995
- value: x.type,
995
+ value: g.type,
996
996
  options: ["Primary", "Secondary", "Tertiary"]
997
997
  }
998
998
  ),
999
- /* @__PURE__ */ t.jsxs("div", { className: Z.buttons, children: [
1000
- /* @__PURE__ */ t.jsx("div", { className: Z.deleteButton, children: /* @__PURE__ */ t.jsx(
1001
- f,
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
- M(x, N);
1008
+ S(g, y);
1009
1009
  }
1010
1010
  }
1011
1011
  ) }),
1012
- /* @__PURE__ */ t.jsx("div", { className: Z.deleteButton, children: /* @__PURE__ */ t.jsx(
1013
- f,
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: (a) => {
1020
- $(a, x);
1019
+ onClick: (q) => {
1020
+ d(q, g);
1021
1021
  }
1022
1022
  }
1023
1023
  ) }),
1024
- n && /* @__PURE__ */ t.jsx("div", { className: Z.deleteButton, children: /* @__PURE__ */ t.jsx(
1025
- f,
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 a = s.filter((j) => j.id !== x.id);
1031
- e(a);
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
- x.id
1041
+ g.id
1042
1042
  )),
1043
- o && /* @__PURE__ */ t.jsx(
1044
- Pt,
1043
+ l && /* @__PURE__ */ t.jsx(
1044
+ Mt,
1045
1045
  {
1046
- ref: T,
1047
- activeButton: o,
1046
+ ref: j,
1047
+ activeButton: l,
1048
1048
  setActiveButton: m,
1049
- popupPosition: g,
1050
- editableLink: d
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
- ot,
1062
+ ct,
1063
1063
  {
1064
1064
  withoutHover: !0,
1065
- className: Z.button,
1065
+ className: tt.button,
1066
1066
  size: "s",
1067
1067
  onClick: () => {
1068
- const x = [...s];
1069
- d ? x.push({
1068
+ const g = [...s];
1069
+ c ? g.push({
1070
1070
  type: "Primary",
1071
- id: st(),
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
- }) : x.push({
1079
+ }) : g.push({
1080
1080
  type: "Primary",
1081
- id: st(),
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(x);
1089
+ }), e(g);
1090
1090
  },
1091
1091
  style: {
1092
1092
  width: "fit-content"
1093
1093
  },
1094
- children: /* @__PURE__ */ t.jsxs("div", { className: Z.addButton, children: [
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
- f,
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
- }, ai = (r) => {
1110
+ }, Ri = (o) => {
1111
1111
  const {
1112
1112
  isActiveButtons: s,
1113
1113
  setIsActiveButtons: e,
1114
1114
  buttons: n,
1115
1115
  setButtons: i,
1116
- editableLink: d = !0,
1116
+ editableLink: c = !0,
1117
1117
  addable: u = !0,
1118
- deletable: o = !0
1119
- } = r;
1120
- return /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsxs("div", { className: rt.buttonsBlock, children: [
1121
- /* @__PURE__ */ t.jsxs("div", { className: rt.top, children: [
1122
- /* @__PURE__ */ t.jsx("h3", { className: rt.title, children: "Buttons" }),
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
- it,
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
- _n,
1132
+ xn,
1133
1133
  {
1134
1134
  buttons: n,
1135
1135
  setButtons: i,
1136
- editableLink: d,
1136
+ editableLink: c,
1137
1137
  addable: u,
1138
- deletable: o
1138
+ deletable: l
1139
1139
  }
1140
1140
  )
1141
1141
  ] }) });
1142
1142
  };
1143
- function gn(r) {
1144
- const { product: s, children: e } = r, { attributes: n, listeners: i, setNodeRef: d, transform: u, transition: o, isDragging: m } = bt({
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
- }), g = {
1147
- transform: jt.Transform.toString(u),
1148
- transition: o
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: d,
1154
- style: g,
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 ci = (r) => {
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: d,
1168
+ other: c,
1169
1169
  title: u,
1170
- subtitle: o,
1170
+ subtitle: l,
1171
1171
  editable: m = !0,
1172
- draggable: g = !1,
1173
- withImage: C = !1,
1174
- deletable: c = !0,
1175
- addable: l = !0,
1176
- itemsType: T,
1177
- itemsOptions: $,
1178
- limit: M
1179
- } = r, [x, N] = _.useState(
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
- ), [a, j] = _.useState({
1181
+ ), [q, k] = x.useState({
1182
1182
  top: 0,
1183
1183
  left: 0
1184
- }), [R, w] = _.useState(!1), z = ht(
1185
- pt(_t, {
1184
+ }), [h, $] = x.useState(!1), R = gt(
1185
+ ft(xt, {
1186
1186
  activationConstraint: {
1187
1187
  distance: 5
1188
1188
  }
1189
1189
  })
1190
1190
  );
1191
- _.useEffect(() => {
1192
- const p = () => {
1193
- N(null), w(!1);
1191
+ x.useEffect(() => {
1192
+ const f = () => {
1193
+ y(null), $(!1);
1194
1194
  };
1195
- return document.body.addEventListener("click", p), N(null), w(!1), () => {
1196
- N(null), w(!1), document.body.removeEventListener("click", p);
1195
+ return document.body.addEventListener("click", f), y(null), $(!1), () => {
1196
+ y(null), $(!1), document.body.removeEventListener("click", f);
1197
1197
  };
1198
- }, []), _.useEffect(() => {
1199
- if (x) {
1200
- const p = [...n].map((b) => b.listingId === x.listingId ? x : b);
1201
- i(p);
1198
+ }, []), x.useEffect(() => {
1199
+ if (g) {
1200
+ const f = [...n].map((N) => N.listingId === g.listingId ? g : N);
1201
+ i(f);
1202
1202
  }
1203
- }, [x]);
1204
- const S = (p, b) => {
1205
- p.stopPropagation();
1206
- const A = p.target.getBoundingClientRect(), U = 100, O = window.innerHeight;
1207
- let L = A.top + window.scrollY;
1208
- L + U > O && (L = O - U - 20), w(!0), j({
1209
- top: L - 80,
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(b);
1211
+ }), y(N);
1212
1212
  };
1213
- function v(p) {
1214
- if (C)
1215
- return p ? /* @__PURE__ */ t.jsx(
1213
+ function I(f) {
1214
+ if (B)
1215
+ return f ? /* @__PURE__ */ t.jsx(
1216
1216
  "img",
1217
1217
  {
1218
- src: `https://imagedelivery.net/${p}/w=1000`,
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
- f,
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 I = (p) => {
1234
- const { active: b, over: A } = p;
1235
- if (A && b.id !== A.id) {
1236
- const U = n.findIndex((L) => String(L.listingId) === b.id), O = n.findIndex((L) => String(L.listingId) === A.id);
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 L = [...n], [Q] = L.splice(U, 1);
1239
- L.splice(O, 0, Q), i(L);
1238
+ const z = [...n], [Z] = z.splice(U, 1);
1239
+ z.splice(O, 0, Z), i(z);
1240
1240
  }
1241
1241
  }
1242
- }, q = (p, b) => {
1243
- const A = $.find((O) => p.listingId === O.id);
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
- g && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
1247
- f,
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
- T === "select" && /* @__PURE__ */ t.jsx(
1256
- at,
1255
+ j === "select" && /* @__PURE__ */ t.jsx(
1256
+ lt,
1257
1257
  {
1258
1258
  onChange: (O) => {
1259
- const L = [...n], Q = $.find((P) => P.productData.name === O);
1260
- if (!Q) return;
1261
- const h = {
1262
- listingId: Q.id,
1263
- image: Q.productData.images.length > 0 ? Q.productData.images[0].cfId : ""
1264
- }, E = L.map((P) => P.listingId === p.listingId ? h : P);
1265
- N(h), i([...E]);
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
- ...$.filter((O) => !n.find((L) => L.listingId === O.id)).map((O) => O.productData.name)
1269
+ ...d.filter((O) => !n.find((z) => z.listingId === O.id)).map((O) => O.productData.name)
1270
1270
  ],
1271
- leftAddon: v(
1272
- p.image || A.productData.images.length > 0 && A.productData.images[0].cfId || ""
1271
+ leftAddon: I(
1272
+ f.image || A.productData.images.length > 0 && A.productData.images[0].cfId || ""
1273
1273
  )
1274
1274
  },
1275
- b
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
- f,
1279
+ v,
1280
1280
  {
1281
1281
  name: "Sliders",
1282
1282
  hoverable: !0,
1283
1283
  width: 20,
1284
1284
  height: 20,
1285
- onClick: (O) => S(O, p)
1285
+ onClick: (O) => L(O, f)
1286
1286
  }
1287
1287
  ) }),
1288
- c && /* @__PURE__ */ t.jsx("div", { className: G.deleteButton, children: /* @__PURE__ */ t.jsx(
1289
- f,
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 !== p))
1296
+ onClick: () => i(n.filter((O) => O !== f))
1297
1297
  }
1298
1298
  ) })
1299
1299
  ] })
1300
1300
  ] });
1301
- return g ? /* @__PURE__ */ t.jsx(
1302
- gn,
1301
+ return p ? /* @__PURE__ */ t.jsx(
1302
+ vn,
1303
1303
  {
1304
- product: p,
1304
+ product: f,
1305
1305
  children: U
1306
1306
  },
1307
- p.listingId
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
- p.listingId
1314
+ f.listingId
1315
1315
  );
1316
- }, B = _.useRef(null);
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
- it,
1321
+ ot,
1322
1322
  {
1323
1323
  current: s,
1324
- onChange: (p) => e == null ? void 0 : e(p)
1324
+ onChange: (f) => e == null ? void 0 : e(f)
1325
1325
  }
1326
1326
  )
1327
1327
  ] }),
1328
- R && x && /* @__PURE__ */ t.jsx(
1329
- Mt,
1328
+ h && g && /* @__PURE__ */ t.jsx(
1329
+ At,
1330
1330
  {
1331
- ref: B,
1332
- activeItem: x,
1333
- setActiveItem: N,
1334
- setIsOpenModal: w,
1335
- popupPosition: a,
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
- o && /* @__PURE__ */ t.jsx("h5", { className: G.subtitle, children: o }),
1341
- g ? /* @__PURE__ */ t.jsx(
1342
- gt,
1340
+ l && /* @__PURE__ */ t.jsx("h5", { className: G.subtitle, children: l }),
1341
+ p ? /* @__PURE__ */ t.jsx(
1342
+ vt,
1343
1343
  {
1344
- sensors: z,
1345
- onDragEnd: I,
1344
+ sensors: R,
1345
+ onDragEnd: b,
1346
1346
  children: /* @__PURE__ */ t.jsx(
1347
- ft,
1347
+ jt,
1348
1348
  {
1349
- items: n.map((p) => String(p.listingId)),
1350
- strategy: xt,
1351
- children: n.map((p, b) => q(p, b))
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((p, b) => q(p, b)),
1356
- l && /* @__PURE__ */ t.jsx(
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
- ot,
1365
+ ct,
1366
1366
  {
1367
1367
  withoutHover: !0,
1368
1368
  className: G.button,
1369
1369
  size: "s",
1370
1370
  onClick: () => {
1371
- const p = [...n];
1372
- for (let b = 0; b < $.length; b++)
1373
- if (!n.find((A) => A.listingId === $[b].id)) {
1374
- p.push({
1375
- listingId: $[b].id,
1376
- image: $[b].productData.images.length > 0 ? $[b].productData.images[0].cfId : ""
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(p);
1380
+ i(f);
1381
1381
  },
1382
- disabled: n.length === (M || $.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
- f,
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 && d !== void 0 && /* @__PURE__ */ t.jsx(mt, { items: d })
1402
+ s && c !== void 0 && /* @__PURE__ */ t.jsx(_t, { items: c })
1403
1403
  ] });
1404
- }, fn = "_options_6cemk_1", xn = "_price_6cemk_12", bn = "_oldPrice_6cemk_19", jn = "_newPrice_6cemk_27", vn = "_animate_6cemk_34", yn = "_appearAndBounce_6cemk_1", kn = "_meta_6cemk_52", Nn = "_info_6cemk_58", In = "_infoRight_6cemk_66", Sn = "_buttons_6cemk_73", Cn = "_variants_6cemk_80", wn = "_variant_6cemk_80", $n = "_stock_6cemk_98", Bn = "_variantInfo_6cemk_105", Pn = "_quantity_6cemk_111", Mn = "_count_6cemk_118", Tn = "_focused_6cemk_135", qn = "_button_6cemk_73", An = "_activeVariant_6cemk_161", On = "_chargeTypes_6cemk_165", En = "_charge_6cemk_165", Dn = "_chargeActive_6cemk_190", Rn = "_title_6cemk_198", k = {
1405
- options: fn,
1406
- price: xn,
1407
- oldPrice: bn,
1408
- newPrice: jn,
1409
- animate: vn,
1410
- appearAndBounce: yn,
1411
- meta: kn,
1412
- info: Nn,
1413
- infoRight: In,
1414
- buttons: Sn,
1415
- variants: Cn,
1416
- variant: wn,
1417
- stock: $n,
1418
- variantInfo: Bn,
1419
- quantity: Pn,
1420
- count: Mn,
1421
- focused: Tn,
1422
- button: qn,
1423
- activeVariant: An,
1424
- chargeTypes: On,
1425
- charge: En,
1426
- chargeActive: Dn,
1427
- title: Rn
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 St = /* @__PURE__ */ ((r) => (r.ONE_TIME = "One-Time", r.RECURRING = "Subscribe & Save", r))(St || {});
1430
- const li = (r) => {
1431
- var x, N;
1432
- const { variants: s } = r, [e, n] = _.useState(s[0]), [i, d] = _.useState(e.chargeTypes[0]), u = lt(), [o, m] = _.useState(1), { reset: g, addProductToCart: C } = vt(), [c, l] = _.useState(!1);
1433
- _.useEffect(() => {
1434
- l(!0);
1435
- const a = setTimeout(() => l(!1), 600);
1436
- return () => clearTimeout(a);
1437
- }, [o]);
1438
- async function T() {
1439
- await C({
1440
- productId: r.id,
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: o
1444
+ quantity: l
1443
1445
  });
1444
1446
  }
1445
- function $() {
1446
- g(), T(), u("/checkout");
1447
+ function g() {
1448
+ r(), S(), u("/checkout");
1447
1449
  }
1448
- function M(a) {
1449
- if (a >= 864e5) {
1450
- const S = Math.floor(a / 864e5);
1451
- return `${S} ${S === 1 ? "day" : "days"}`;
1452
- } else if (a >= 36e5) {
1453
- const S = Math.floor(a / 36e5);
1454
- return `${S} ${S === 1 ? "hour" : "hours"}`;
1455
- } else if (a >= 6e4) {
1456
- const S = Math.floor(a / 6e4);
1457
- return `${S} ${S === 1 ? "minute" : "minutes"}`;
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 S = Math.floor(a / 1e3);
1460
- return `${S} ${S === 1 ? "second" : "seconds"}`;
1461
+ const b = Math.floor(h / 1e3);
1462
+ return `${b} ${b === 1 ? "second" : "seconds"}`;
1461
1463
  }
1462
1464
  }
1463
- return _.useEffect(() => {
1464
- (e.quantity.available === 0 || !e.quantity.available) && m(0);
1465
- }, [e.quantity.available]), /* @__PURE__ */ t.jsxs("div", { className: k.options, children: [
1466
- e.chargeTypes.length > 1 && /* @__PURE__ */ t.jsx("div", { className: k.chargeTypes, children: e.chargeTypes.map((a) => /* @__PURE__ */ t.jsx(
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: W(k.charge, {
1470
- [k.chargeActive]: i === a
1471
+ className: V(w.charge, {
1472
+ [w.chargeActive]: i === h
1471
1473
  }),
1472
- onClick: () => d(a),
1473
- children: St[a]
1474
+ onClick: () => c(h),
1475
+ children: Ct[h]
1474
1476
  },
1475
- a
1477
+ h
1476
1478
  )) }),
1477
- /* @__PURE__ */ t.jsx("div", { className: k.variants, children: s.map((a) => {
1478
- var j;
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: W(k.variant, {
1483
- [k.activeVariant]: e.id === a.id
1484
+ className: V(w.variant, {
1485
+ [w.activeVariant]: e.id === h.id
1484
1486
  }),
1485
- onClick: () => n(a),
1487
+ onClick: () => n(h),
1486
1488
  children: [
1487
- /* @__PURE__ */ t.jsxs("div", { className: k.variantInfo, children: [
1488
- /* @__PURE__ */ t.jsx("span", { className: k.title, children: a.name }),
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" ? a.price.amount : a.subscriptionSettings ? a.subscriptionSettings.price.amount : "Price Not Found"
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: k.stock, children: [
1495
- ((j = a.quantity.restrictions) == null ? void 0 : j.max) || a.quantity.available || 0,
1496
- " in stock"
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
- a.id
1503
+ h.id
1501
1504
  );
1502
1505
  }) }),
1503
- i === "ONE_TIME" && /* @__PURE__ */ t.jsxs("div", { className: k.quantity, children: [
1506
+ i === "ONE_TIME" && /* @__PURE__ */ t.jsxs("div", { className: w.quantity, children: [
1504
1507
  /* @__PURE__ */ t.jsx(
1505
- H,
1508
+ F,
1506
1509
  {
1507
1510
  type: "Secondary",
1508
1511
  onClick: () => {
1509
- o > 1 ? m((a) => a - 1) : m(1);
1512
+ l > 1 ? m((h) => h - 1) : m(1);
1510
1513
  },
1511
- className: k.button,
1512
- disabled: e.quantity.available === 0 || e.quantity.restrictions && o <= e.quantity.restrictions.min || Object.keys(e.quantity.restrictions || {}).length === 0 && !e.quantity.available,
1513
- children: /* @__PURE__ */ t.jsx(f, { name: "Minus" })
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
- Tt,
1520
+ Ot,
1518
1521
  {
1519
1522
  type: "number",
1520
- value: String(o),
1521
- onChange: (a) => m(Number(a)),
1522
- max: ((x = e.quantity.restrictions) == null ? void 0 : x.max) || e.quantity.available || 1 / 0,
1523
- min: ((N = e.quantity.restrictions) == null ? void 0 : N.min) || 0,
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.available === 0 || !e.quantity.available || Object.keys(e.quantity.restrictions || {}).length === 0 && !e.quantity.available
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
- H,
1532
+ F,
1530
1533
  {
1531
1534
  type: "Secondary",
1532
1535
  onClick: () => {
1533
- m((a) => a + 1);
1536
+ m((h) => h + 1);
1534
1537
  },
1535
- className: k.button,
1536
- disabled: !!(e.quantity.restrictions && o >= e.quantity.restrictions.max || e.quantity.available !== void 0 && o >= e.quantity.available || Object.keys(e.quantity.restrictions || {}).length === 0 && !e.quantity.available),
1537
- children: /* @__PURE__ */ t.jsx(f, { name: "Plus" })
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: k.meta, children: [
1542
- /* @__PURE__ */ t.jsxs("div", { className: k.info, children: [
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: k.infoRight, children: [
1547
+ /* @__PURE__ */ t.jsxs("div", { className: w.infoRight, children: [
1545
1548
  /* @__PURE__ */ t.jsx(
1546
- f,
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" : M(e.deliveryTime) })
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: k.info, children: [
1560
+ /* @__PURE__ */ t.jsxs("div", { className: w.info, children: [
1558
1561
  /* @__PURE__ */ t.jsx("span", { children: "Price" }),
1559
- /* @__PURE__ */ t.jsx("div", { className: k.infoRight, children: i === "ONE_TIME" ? e.compareAtPrice && (e.compareAtPrice.amount || 0) - (e.price.amount || 0) > 0 ? /* @__PURE__ */ t.jsxs("div", { className: k.price, children: [
1560
- /* @__PURE__ */ t.jsxs("span", { className: W(k.newPrice, { [k.animate]: c }), children: [
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) * o
1565
+ (e.price.amount || 0) * l
1563
1566
  ] }),
1564
- /* @__PURE__ */ t.jsxs("span", { className: k.oldPrice, children: [
1567
+ /* @__PURE__ */ t.jsxs("span", { className: w.oldPrice, children: [
1565
1568
  "$ ",
1566
- (e.compareAtPrice.amount || 0) * o
1569
+ (e.compareAtPrice.amount || 0) * l
1567
1570
  ] })
1568
- ] }) : /* @__PURE__ */ t.jsxs("span", { className: W(k.newPrice, { [k.animate]: c }), children: [
1571
+ ] }) : /* @__PURE__ */ t.jsxs("span", { className: V(w.newPrice, { [w.animate]: j }), children: [
1569
1572
  "$ ",
1570
- (e.price.amount || 0) * o
1571
- ] }) : e.subscriptionSettings && e.subscriptionSettings.compareAtPrice && (e.subscriptionSettings.compareAtPrice.amount || 0) - (e.subscriptionSettings.price.amount || 0) > 0 ? /* @__PURE__ */ t.jsxs("div", { className: k.price, children: [
1572
- /* @__PURE__ */ t.jsxs("span", { className: W(k.newPrice, { [k.animate]: c }), children: [
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: k.oldPrice, children: [
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: W(k.newPrice, { [k.animate]: c }), children: [
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: k.buttons, children: [
1589
+ /* @__PURE__ */ t.jsxs("div", { className: w.buttons, children: [
1587
1590
  /* @__PURE__ */ t.jsx(
1588
- H,
1591
+ F,
1589
1592
  {
1590
1593
  type: "Primary",
1591
- onClick: () => $(),
1592
- disabled: e.quantity.available === 0 || !e.quantity.available || Object.keys(e.quantity.restrictions || {}).length === 0 && !e.quantity.available,
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
- H,
1600
+ F,
1598
1601
  {
1599
1602
  type: "Secondary",
1600
- onClick: () => T(),
1601
- disabled: e.quantity.available === 0 || !e.quantity.available || Object.keys(e.quantity.restrictions || {}).length === 0 && !e.quantity.available,
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
- }, Ln = "_button_ekti4_1", zn = "_login_ekti4_14", Un = "_signUp_ekti4_18", Hn = "_buttons_ekti4_23", Fn = "_modal_ekti4_32", Vn = "_closing_ekti4_64", Yn = "_info_ekti4_113", Gn = "_top_ekti4_120", Wn = "_title_ekti4_131", Jn = "_clear_ekti4_138", Xn = "_activeClear_ekti4_145", Kn = "_count_ekti4_149", Qn = "_cart_ekti4_164", Zn = "_empty_ekti4_172", ts = "_product_ekti4_198", es = "_products_ekti4_207", ns = "_image_ekti4_215", ss = "_productInfo_ekti4_221", is = "_content_ekti4_228", os = "_name_ekti4_234", as = "_price_ekti4_240", cs = "_productButtons_ekti4_246", ls = "_productButton_ekti4_246", rs = "_productCount_ekti4_266", ds = "_bottom_ekti4_282", us = "_subtotal_ekti4_290", ms = "_block_ekti4_298", hs = "_shoppingCount_ekti4_305", ps = "_total_ekti4_325", _s = "_link_ekti4_331", gs = "_userInfo_ekti4_338", fs = "_pagesMobileModal_ekti4_349", xs = "_pagesMobileModalContent_ekti4_363", bs = "_pagesMobileModalHeader_ekti4_369", js = "_pagesMobileModalFooter_ekti4_379", y = {
1608
- button: Ln,
1609
- login: zn,
1610
- signUp: Un,
1611
- buttons: Hn,
1612
- modal: Fn,
1613
- "slide-in-fade": "_slide-in-fade_ekti4_1",
1614
- "mobile-slide-in-fade": "_mobile-slide-in-fade_ekti4_1",
1615
- closing: Vn,
1616
- "mobile-slide-out-fade": "_mobile-slide-out-fade_ekti4_1",
1617
- "slide-out-fade": "_slide-out-fade_ekti4_1",
1618
- info: Yn,
1619
- top: Gn,
1620
- title: Wn,
1621
- clear: Jn,
1622
- activeClear: Xn,
1623
- count: Kn,
1624
- cart: Qn,
1625
- empty: Zn,
1626
- product: ts,
1627
- products: es,
1628
- image: ns,
1629
- productInfo: ss,
1630
- content: is,
1631
- name: os,
1632
- price: as,
1633
- productButtons: cs,
1634
- productButton: ls,
1635
- productCount: rs,
1636
- bottom: ds,
1637
- subtotal: us,
1638
- block: ms,
1639
- shoppingCount: hs,
1640
- total: ps,
1641
- link: _s,
1642
- userInfo: gs,
1643
- pagesMobileModal: fs,
1644
- pagesMobileModalContent: xs,
1645
- pagesMobileModalHeader: bs,
1646
- pagesMobileModalFooter: js
1647
- }, ri = (r) => {
1648
- const { shopping: s, signUp: e, isShowUserInfo: n = !0 } = r;
1649
- return /* @__PURE__ */ t.jsxs("div", { className: y.buttons, children: [
1650
- s && /* @__PURE__ */ t.jsx(vs, {}),
1651
- n && /* @__PURE__ */ t.jsx(Ct, { signUp: e })
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
- }, vs = () => {
1654
- const [r, s] = _.useState(!1), [e, n] = _.useState([]), { cart: i } = vt();
1655
- function d(g) {
1656
- var C;
1657
- return !g || !(g != null && g.variants) ? !1 : (C = g.variants.find((c) => c.id === g.activeVariantId)) == null ? void 0 : C.subscriptionSettings;
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
- const u = i.parts.length > 0 && e.length > 0 && !d(e[0]), [o, m] = _.useState(!1);
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
- H,
1691
+ F,
1663
1692
  {
1664
1693
  type: "Secondary",
1665
1694
  style: {
1666
- padding: 10
1695
+ padding: 10,
1696
+ position: "relative"
1667
1697
  },
1668
- onClick: (g) => {
1669
- g.stopPropagation(), window.location.pathname.includes("/admin/builder") || (s(!0), m(!0));
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
- f,
1703
+ v,
1674
1704
  {
1675
1705
  name: "Handbag",
1676
1706
  fill: "var(--text-primary)"
1677
1707
  }
1678
1708
  ),
1679
- u && /* @__PURE__ */ t.jsx("div", { className: y.shoppingCount, children: i.parts.length })
1709
+ p && /* @__PURE__ */ t.jsx("div", { className: C.shoppingCount, children: i.parts.length })
1680
1710
  ]
1681
1711
  }
1682
1712
  ),
1683
- r && /* @__PURE__ */ t.jsx(
1684
- yt,
1713
+ o && /* @__PURE__ */ t.jsx(
1714
+ kt,
1685
1715
  {
1686
1716
  close: () => {
1687
- m(!1), setTimeout(() => {
1717
+ r(!1), setTimeout(() => {
1688
1718
  s(!1);
1689
1719
  }, 300);
1690
1720
  },
1691
1721
  withAnimation: !1,
1692
1722
  children: /* @__PURE__ */ t.jsx(
1693
- ys,
1723
+ Cs,
1694
1724
  {
1695
1725
  activeProducts: e,
1696
- isCartNotEmpty: u,
1697
- isOpen: o
1726
+ isCartNotEmpty: p,
1727
+ isOpen: B
1698
1728
  }
1699
1729
  )
1700
1730
  }
1701
1731
  )
1702
1732
  ] });
1703
- }, ys = (r) => {
1704
- const { activeProducts: s, isCartNotEmpty: e, isOpen: n } = r, { cart: i, reset: d, getTotalAndDiscount: u, updateQuantityOfProduct: o } = vt(), m = lt();
1705
- function g(l) {
1706
- m(l);
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 C(l) {
1709
- o({
1710
- productId: l.id,
1711
- productVariantId: l.activeVariantId,
1712
- quantity: l.quantity + 1
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 c(l) {
1716
- o({
1717
- productId: l.id,
1718
- productVariantId: l.activeVariantId,
1719
- quantity: l.quantity - 1
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: W(y.modal, {
1726
- [y.closing]: !n
1755
+ className: V(C.modal, {
1756
+ [C.closing]: !n
1727
1757
  }),
1728
- onClick: (l) => l.stopPropagation(),
1758
+ onClick: (a) => a.stopPropagation(),
1729
1759
  children: [
1730
- /* @__PURE__ */ t.jsxs("div", { className: y.top, children: [
1731
- /* @__PURE__ */ t.jsxs("div", { className: y.info, children: [
1732
- /* @__PURE__ */ t.jsx("span", { className: y.title, children: "Cart" }),
1733
- e && /* @__PURE__ */ t.jsx("div", { className: y.count, children: i.parts.length })
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: W(y.clear, {
1739
- [y.activeClear]: e
1768
+ className: V(C.clear, {
1769
+ [C.activeClear]: e
1740
1770
  }),
1741
1771
  disabled: !e,
1742
- onClick: d,
1772
+ onClick: c,
1743
1773
  children: "Clear all"
1744
1774
  }
1745
1775
  )
1746
1776
  ] }),
1747
- e ? /* @__PURE__ */ t.jsxs("div", { className: y.cart, children: [
1748
- /* @__PURE__ */ t.jsx("div", { className: y.products, children: s.map((l) => /* @__PURE__ */ t.jsxs(
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: y.product,
1781
+ className: C.product,
1752
1782
  children: [
1753
- /* @__PURE__ */ t.jsxs("div", { className: y.productInfo, children: [
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/${l.images[0].cfId}/w=500`,
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: y.image
1791
+ className: C.image
1762
1792
  }
1763
- ),
1764
- /* @__PURE__ */ t.jsxs("div", { className: y.content, children: [
1765
- /* @__PURE__ */ t.jsx("div", { className: y.name, children: l.name }),
1766
- /* @__PURE__ */ t.jsxs("div", { className: y.price, children: [
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
- l.variants.find((T) => T.id === l.activeVariantId).price.amount * ((l == null ? void 0 : l.quantity) || 1)
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: y.productButtons, children: [
1808
+ /* @__PURE__ */ t.jsxs("div", { className: C.productButtons, children: [
1773
1809
  /* @__PURE__ */ t.jsx(
1774
- "div",
1810
+ F,
1775
1811
  {
1812
+ type: "Secondary",
1776
1813
  onClick: () => {
1777
- l.quantity !== 1 && c(l);
1814
+ a.quantity !== 1 && r(a);
1778
1815
  },
1779
- className: y.productButton,
1816
+ className: C.productButton,
1817
+ disabled: a.quantity === 1,
1780
1818
  children: /* @__PURE__ */ t.jsx(
1781
- f,
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: y.productCount, children: l.quantity }),
1829
+ /* @__PURE__ */ t.jsx("div", { className: C.productCount, children: a.quantity }),
1792
1830
  /* @__PURE__ */ t.jsx(
1793
- "div",
1831
+ F,
1794
1832
  {
1795
- onClick: () => C(l),
1796
- className: y.productButton,
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
- f,
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
- l.id
1851
+ a.id
1812
1852
  )) }),
1813
- /* @__PURE__ */ t.jsxs("div", { className: y.bottom, children: [
1814
- /* @__PURE__ */ t.jsxs("div", { className: y.subtotal, children: [
1815
- /* @__PURE__ */ t.jsxs("div", { className: y.block, children: [
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
- f,
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: y.total, children: [
1867
+ /* @__PURE__ */ t.jsxs("div", { className: C.total, children: [
1828
1868
  "$",
1829
1869
  u().total
1830
1870
  ] })
1831
1871
  ] }),
1832
- /* @__PURE__ */ t.jsx(H, { onClick: () => g("/checkout"), children: "Checkout" })
1872
+ /* @__PURE__ */ t.jsx(F, { onClick: () => p("/checkout"), children: "Checkout" })
1833
1873
  ] })
1834
- ] }) : /* @__PURE__ */ t.jsx(ks, {})
1874
+ ] }) : /* @__PURE__ */ t.jsx(Ss, {})
1835
1875
  ]
1836
1876
  }
1837
1877
  );
1838
- }, ks = () => /* @__PURE__ */ t.jsxs("div", { className: y.empty, children: [
1878
+ }, Ss = () => /* @__PURE__ */ t.jsxs("div", { className: C.empty, children: [
1839
1879
  /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
1840
- f,
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: y.link,
1894
+ className: C.link,
1855
1895
  children: "view products"
1856
1896
  }
1857
1897
  )
1858
1898
  ] })
1859
- ] }), Ct = ({ signUp: r, close: s }) => {
1860
- const e = JSON.parse(localStorage.getItem("token") || "{}"), { data: n } = e, i = lt();
1861
- function d(m) {
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
- H,
1907
+ F,
1868
1908
  {
1869
1909
  onClick: () => {
1870
- d("/customer-dash"), s == null || s();
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
- r && /* @__PURE__ */ t.jsx(
1880
- H,
1919
+ o && /* @__PURE__ */ t.jsx(
1920
+ F,
1881
1921
  {
1882
1922
  onClick: () => {
1883
- d("/customer-dash"), s == null || s();
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, o] = _.useState("test-email@gmail.com");
1895
- return _.useEffect(() => {
1934
+ const [u, l] = x.useState("test-email@gmail.com");
1935
+ return x.useEffect(() => {
1896
1936
  (async () => {
1897
- const g = qt(n);
1898
- o(g.email);
1937
+ const p = Et(n);
1938
+ l(p.email);
1899
1939
  })();
1900
1940
  }, [n]), /* @__PURE__ */ t.jsx(
1901
1941
  "div",
1902
1942
  {
1903
- className: y.userInfo,
1943
+ className: C.userInfo,
1904
1944
  onClick: () => {
1905
- d("/customer-dash"), s == null || s();
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
- }, Ns = ({
1911
- children: r,
1950
+ }, ws = ({
1951
+ children: o,
1912
1952
  logo: s,
1913
1953
  setIsOpen: e,
1914
1954
  signUp: n
1915
1955
  }) => {
1916
- const { setIsOpen: i } = Nt(), d = () => {
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: y.pagesMobileModal,
1964
+ className: C.pagesMobileModal,
1925
1965
  onClick: (u) => u.stopPropagation(),
1926
1966
  children: [
1927
- /* @__PURE__ */ t.jsxs("div", { className: y.pagesMobileModalHeader, children: [
1967
+ /* @__PURE__ */ t.jsxs("div", { className: C.pagesMobileModalHeader, children: [
1928
1968
  /* @__PURE__ */ t.jsx("div", { children: s }),
1929
1969
  /* @__PURE__ */ t.jsx(
1930
- H,
1970
+ F,
1931
1971
  {
1932
1972
  type: "Secondary",
1933
- onClick: d,
1973
+ onClick: c,
1934
1974
  children: /* @__PURE__ */ t.jsx(
1935
- f,
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: y.pagesMobileModalContent, children: r }),
1945
- /* @__PURE__ */ t.jsx("div", { className: y.pagesMobileModalFooter, children: /* @__PURE__ */ t.jsx(
1946
- Ct,
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: d
1989
+ close: c
1950
1990
  }
1951
1991
  ) })
1952
1992
  ]
1953
1993
  }
1954
1994
  );
1955
- }, di = ({
1956
- children: r,
1995
+ }, Fi = ({
1996
+ children: o,
1957
1997
  logo: s,
1958
1998
  signUp: e
1959
1999
  }) => {
1960
- const [n, i] = _.useState(!1);
2000
+ const [n, i] = x.useState(!1);
1961
2001
  return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
1962
- /* @__PURE__ */ t.jsx(Is, { setIsOpenModal: i }),
1963
- n && /* @__PURE__ */ t.jsx(yt, { close: () => i(!1), children: /* @__PURE__ */ t.jsx(
1964
- Ns,
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: r
2009
+ children: o
1970
2010
  }
1971
2011
  ) })
1972
2012
  ] });
1973
- }, Is = (r) => {
1974
- const { setIsOpenModal: s } = r;
2013
+ }, $s = (o) => {
2014
+ const { setIsOpenModal: s } = o;
1975
2015
  return /* @__PURE__ */ t.jsx(
1976
- H,
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
- f,
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
- }, Ss = "_share_10urc_1", Cs = "_modal_10urc_9", ws = "_header_10urc_21", $s = "_socials_10urc_31", Bs = "_social_10urc_31", Ps = "_copy_10urc_41", Ms = "_title_10urc_48", Ts = "_copyWrapper_10urc_54", qs = "_copyText_10urc_63", As = "_copyTextMobile_10urc_76", Os = "_copyTextMiniMobile_10urc_95", tt = {
1995
- share: Ss,
1996
- modal: Cs,
1997
- header: ws,
1998
- socials: $s,
1999
- social: Bs,
2000
- copy: Ps,
2001
- title: Ms,
2002
- copyWrapper: Ts,
2003
- copyText: qs,
2004
- copyTextMobile: As,
2005
- copyTextMiniMobile: Os
2006
- }, ui = ({ title: r = "Copy Product Link" }) => {
2007
- const { isOpenModal: s, setIsOpenModal: e } = It();
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
- H,
2053
+ F,
2014
2054
  {
2015
- className: tt.share,
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
- f,
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(yt, { close: e, children: /* @__PURE__ */ t.jsx(Es, { title: r }) })
2070
+ s && /* @__PURE__ */ t.jsx(kt, { close: e, children: /* @__PURE__ */ t.jsx(zs, { title: o }) })
2031
2071
  ] });
2032
- }, Es = ({ title: r = "Copy Product Link" }) => {
2033
- const { setIsOpenModal: s } = It(), { notification: e, setNotification: n } = At(), { setIsOpen: i } = Nt(), d = window.location.href;
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(d), n({
2075
+ navigator.clipboard.writeText(c), n({
2036
2076
  message: "Link copied to clipboard",
2037
2077
  status: "success"
2038
2078
  });
2039
2079
  }
2040
- function o() {
2080
+ function l() {
2041
2081
  i(!1), setTimeout(() => {
2042
2082
  s(!1), i(!0);
2043
2083
  }, 300);
2044
2084
  }
2045
- function m(g, C) {
2046
- return g.length > C ? g.slice(0, C) + "..." : g;
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: tt.modal,
2052
- onClick: (g) => g.stopPropagation(),
2091
+ className: et.modal,
2092
+ onClick: (p) => p.stopPropagation(),
2053
2093
  children: [
2054
- /* @__PURE__ */ t.jsxs("div", { className: tt.header, children: [
2055
- /* @__PURE__ */ t.jsx("div", { className: tt.title, children: r }),
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
- f,
2097
+ v,
2058
2098
  {
2059
2099
  name: "X",
2060
2100
  fill: "#757575",
2061
- onClick: o,
2101
+ onClick: l,
2062
2102
  hoverable: !0
2063
2103
  }
2064
2104
  )
2065
2105
  ] }),
2066
- /* @__PURE__ */ t.jsxs("div", { className: tt.copyWrapper, children: [
2106
+ /* @__PURE__ */ t.jsxs("div", { className: et.copyWrapper, children: [
2067
2107
  /* @__PURE__ */ t.jsxs(
2068
- H,
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: tt.copyText, children: m(d, 100) }),
2077
- /* @__PURE__ */ t.jsx("div", { className: tt.copyTextMobile, children: m(d, 40) }),
2078
- /* @__PURE__ */ t.jsx("div", { className: tt.copyTextMiniMobile, children: m(d, 20) })
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
- H,
2123
+ F,
2084
2124
  {
2085
2125
  type: "Secondary",
2086
2126
  onClick: u,
2087
- children: e ? /* @__PURE__ */ t.jsx(f, { name: "Check" }) : /* @__PURE__ */ t.jsx(f, { name: "Copy" })
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
- }, Ds = "_accordion_1s1lq_1", Rs = "_header_1s1lq_9", Ls = "_icon_1s1lq_18", zs = "_open_1s1lq_21", Us = "_content_1s1lq_25", nt = {
2095
- accordion: Ds,
2096
- header: Rs,
2097
- icon: Ls,
2098
- open: zs,
2099
- content: Us
2100
- }, mi = ({ title: r, content: s, defaultOpen: e = !1 }) => {
2101
- const [n, i] = _.useState(e), [d, u] = _.useState(0), o = _.useRef(null), m = () => {
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 _.useEffect(() => {
2105
- o.current && u(n ? o.current.scrollHeight : 0);
2106
- }, [n]), /* @__PURE__ */ t.jsxs("div", { className: nt.accordion, children: [
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: nt.header,
2150
+ className: it.header,
2111
2151
  onClick: m,
2112
2152
  children: [
2113
- /* @__PURE__ */ t.jsx("h5", { id: "h5", children: r }),
2114
- /* @__PURE__ */ t.jsx("div", { className: W(nt.icon, { [nt.open]: n }), children: /* @__PURE__ */ t.jsx(f, { name: "CaretDown" }) })
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: o,
2122
- className: nt.content,
2123
- style: { height: `${d}px` },
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
- }, hi = ({ children: r, path: s, className: e, target: n = "_self", id: i }) => {
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: r
2177
+ children: o
2138
2178
  }
2139
2179
  );
2140
- const d = lt(), u = /^https?:\/\//.test(s), o = (m) => {
2141
- u || n === "_blank" ? n === "_blank" ? window.open(s, "_blank") : window.history.pushState({}, "", s) : (m.preventDefault(), d(s));
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: o,
2186
+ onClick: l,
2147
2187
  className: e,
2148
2188
  role: "link",
2149
2189
  style: { cursor: "pointer" },
2150
2190
  id: i,
2151
- children: r
2191
+ children: o
2152
2192
  }
2153
2193
  );
2154
- }, Hs = "_buttonsBlock_1b2rb_1", Fs = "_slideUp_1b2rb_1", Vs = {
2155
- buttonsBlock: Hs,
2156
- slideUp: Fs
2157
- }, pi = () => /* @__PURE__ */ t.jsxs("div", { className: Vs.buttonsBlock, children: [
2158
- /* @__PURE__ */ t.jsx(
2159
- H,
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
- type: "Primary",
2162
- style: {
2163
- width: "100%"
2164
- },
2165
- children: "Add to Cart"
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
- /* @__PURE__ */ t.jsx(H, { type: "Secondary", children: "Buy" })
2169
- ] }), Ys = "_wrapper_27wzz_1", Gs = "_logo_27wzz_8", Ws = "_info_27wzz_12", dt = {
2170
- wrapper: Ys,
2171
- logo: Gs,
2172
- info: Ws
2173
- }, _i = ({ date: r }) => {
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), d = {
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", d);
2256
+ return i.toLocaleDateString("en-US", c);
2186
2257
  }
2187
- return /* @__PURE__ */ t.jsxs("div", { className: dt.wrapper, children: [
2188
- /* @__PURE__ */ t.jsx("div", { className: dt.logo, children: s.info.logo ? /* @__PURE__ */ t.jsx(
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
- f,
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: dt.info, children: [
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(r) })
2276
+ /* @__PURE__ */ t.jsx("p", { id: "p", children: e(o) })
2206
2277
  ] })
2207
2278
  ] });
2208
- }, Js = "_wrapper_st58d_1", Xs = "_label_st58d_10", Ks = "_textarea_st58d_18", Qs = "_length_st58d_33", ct = {
2209
- wrapper: Js,
2210
- label: Xs,
2211
- textarea: Ks,
2212
- length: Qs
2213
- }, gi = (r) => {
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: d = "Type something...",
2457
+ placeholder: c = "Type something...",
2220
2458
  type: u = "text"
2221
- } = r, [o, m] = _.useState(n.length);
2222
- function g(C) {
2223
- return u === "number" ? C.replace(/[^\d\n]+/g, "") : C;
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: ct.wrapper, children: [
2463
+ return /* @__PURE__ */ t.jsxs("div", { className: st.wrapper, children: [
2226
2464
  e && /* @__PURE__ */ t.jsx(
2227
2465
  "label",
2228
2466
  {
2229
- className: ct.label,
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: (C) => {
2240
- const c = g(C.target.value);
2241
- m(c.length), s(c);
2477
+ onChange: (r) => {
2478
+ const a = B(r.target.value);
2479
+ m(a.length), s(a);
2242
2480
  },
2243
- placeholder: d,
2244
- className: ct.textarea,
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: ct.length, children: [
2249
- o,
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
- mi as Accordion,
2257
- Is as BurgerMenuButton,
2258
- H as Button,
2259
- _n as ButtonTypeSettings,
2260
- ai as ButtonsSettings,
2261
- si as CategorySettings,
2262
- $t as ChooseImage,
2263
- bi as ChooseImageModal,
2264
- ks as EmptyCart,
2265
- oi as FormSettings,
2266
- ri as HeaderButtons,
2267
- f as Icon,
2268
- ut as InputSettings,
2269
- Tt as InputUI,
2270
- ji as ItemsSettings,
2271
- ni as LayoutSettings,
2272
- hi as Link,
2273
- ci as ListingSelector,
2274
- vi as Loader,
2275
- _i as MetaInfoPost,
2276
- yt as Modal,
2277
- di as PagesMobileMenu,
2278
- Ns as PagesMobileModal,
2279
- ii as PagesSettings,
2280
- pi as ProductCardButtons,
2281
- li as ProductOptions,
2282
- kt as RangeSelector,
2283
- at as Select,
2284
- ui as ShareLink,
2285
- vs as ShoppingButton,
2286
- ys as ShoppingModalCart,
2287
- it as Switch,
2288
- yi as TextSettings,
2289
- ki as TextareaSettings,
2290
- gi as TextareaUI,
2291
- Ni as TypesText,
2292
- Ct as UserInfo
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
  };