@useinsider/guido 2.0.0-beta.e68b206 → 2.0.0-beta.e980c5b

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.
@@ -1,52 +1,54 @@
1
- import { BlockType as h, BlockAttr as y } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- import { ItemsBlockId as P } from "./enums/controlEnums.js";
3
- import { productPairs as O, templateFirstLine as W } from "./enums/productEnums.js";
1
+ import { BlockType as O, BlockAttr as N } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ import { ItemsBlockId as I } from "./enums/controlEnums.js";
3
+ import { productPairs as R, templateFirstLine as H } from "./enums/productEnums.js";
4
4
  import { ItemInCartOptions as C, SETTINGS_ENUMS as w, DefaultConfigValues as F } from "./enums/settingsEnums.js";
5
- import Q from "./layouts/horizontal.html.js";
6
- import H from "./layouts/vertical.html.js";
7
- let [g] = O.PAIRS_FOR_EXTENSION.imageSrc.CART_ITEMS.DEFAULT, [N] = O.PAIRS_FOR_EXTENSION.name.CART_ITEMS.DEFAULT, [x] = O.PAIRS_FOR_EXTENSION.price.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [S] = O.PAIRS_FOR_EXTENSION.originalPrice.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [k] = O.PAIRS_FOR_EXTENSION.quantity.CART_ITEMS.DEFAULT;
8
- const q = (a, t) => a.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCase().startsWith(t.toLowerCase())).join("; ").replace(/;\s*$/, ""), D = (a) => q(a, "text-align"), m = (a, t) => {
9
- const l = new RegExp(`${t}\\s*:\\s*([^;]+)`, "i"), e = a.match(l);
10
- return e ? e[1].trim() : null;
11
- }, U = (a, t, l) => new RegExp(`(${t}\\s*:\\s*)[^;]+`, "gi").test(a) ? a.replace(
12
- new RegExp(`(${t}\\s*:\\s*)[^;]+`, "gi"),
5
+ import Y from "./layouts/horizontal.html.js";
6
+ import q from "./layouts/vertical.html.js";
7
+ import { escapeReplacement as g } from "./utils/nodeConfigUtils.js";
8
+ let [M] = R.PAIRS_FOR_EXTENSION.imageSrc.CART_ITEMS.DEFAULT, [L] = R.PAIRS_FOR_EXTENSION.name.CART_ITEMS.DEFAULT, [x] = R.PAIRS_FOR_EXTENSION.price.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [S] = R.PAIRS_FOR_EXTENSION.originalPrice.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [D] = R.PAIRS_FOR_EXTENSION.quantity.CART_ITEMS.DEFAULT;
9
+ const j = (s, e) => s.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCase().startsWith(e.toLowerCase())).join("; ").replace(/;\s*$/, ""), U = (s) => j(s, "text-align"), m = (s, e) => {
10
+ const l = new RegExp(`${e}\\s*:\\s*([^;]+)`, "i"), a = s.match(l);
11
+ return a ? a[1].trim() : null;
12
+ }, v = (s, e, l) => new RegExp(`(${e}\\s*:\\s*)[^;]+`, "gi").test(s) ? s.replace(
13
+ new RegExp(`(${e}\\s*:\\s*)[^;]+`, "gi"),
13
14
  `$1${l}`
14
- ) : a, Y = (a, t, l, e) => {
15
- const c = l || F.productImageHeight, n = (e == null ? void 0 : e.imageVisible) === !1 ? "display: none; " : "";
15
+ ) : s, Z = (s, e, l, a) => {
16
+ const c = l || F.productImageHeight, n = (a == null ? void 0 : a.imageVisible) === !1 ? "display: none; " : "";
16
17
  return `
17
18
  <td class="esd-block-image document-node-component default-block-component selectable ng-star-inserted"
18
19
  align="center"
19
- esd-extension-block-id="items-block-image"
20
+ esd-extension-block-id="${I.IMAGE}"
20
21
  data-slot-1=""
21
22
  product-attr="imageSrc"
22
- data-type="${a}"
23
- data-number="${t}"
23
+ data-type="${s}"
24
+ data-number="${e}"
24
25
  style="${n}font-size: 0px;">
25
26
  <a class="document-node-component ng-star-inserted"
26
27
  target="_blank"
27
28
  href="#!">
28
29
  <img class="adapt-img document-node-component ng-star-inserted"
29
- src="${g}"
30
- alt="${N}"
30
+ src="${M}"
31
+ alt="${L}"
32
+ width="${c}"
31
33
  height="${c}">
32
34
  </a>
33
35
  </td>
34
36
  `;
35
- }, j = (a, t) => `
36
- <${h.BLOCK_IMAGE}
37
- ${y.BLOCK_IMAGE.src}="${g}"
38
- ${y.BLOCK_IMAGE.alt}="${N}"
39
- ${y.BLOCK_IMAGE.href}="#!"
40
- ${y.BLOCK_IMAGE.width}="${F.productImageWidth}"
41
- ${y.BLOCK_IMAGE.height}="${F.productImageWidth}"
42
- esd-extension-block-id="${P.IMAGE}"
37
+ }, J = (s, e) => `
38
+ <${O.BLOCK_IMAGE}
39
+ ${N.BLOCK_IMAGE.src}="${M}"
40
+ ${N.BLOCK_IMAGE.alt}="${L}"
41
+ ${N.BLOCK_IMAGE.href}="#!"
42
+ ${N.BLOCK_IMAGE.width}="${F.productImageWidth}"
43
+ ${N.BLOCK_IMAGE.height}="${F.productImageWidth}"
44
+ esd-extension-block-id="${I.IMAGE}"
43
45
  data-slot-1
44
46
  product-attr="imageSrc"
45
- data-type="${a}"
46
- data-number="${t}"
47
+ data-type="${s}"
48
+ data-number="${e}"
47
49
  />
48
- `, Z = (a, t, l, e, c) => {
49
- const o = `
50
+ `, tt = (s, e, l, a, c) => {
51
+ const d = `
50
52
  text-decoration:none;
51
53
  font-size: inherit;
52
54
  font-weight: inherit;
@@ -60,41 +62,41 @@ const q = (a, t) => a.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCa
60
62
  overflow: hidden;
61
63
  text-overflow: ellipsis;
62
64
  `;
63
- if (t) {
64
- const i = m(e || "", "text-align") || "center", r = D(e || o), d = m(r, "color"), s = m(r, "font-size"), p = [
65
- d ? `color: ${d}` : "",
66
- s ? `font-size: ${s}` : ""
67
- ].filter(Boolean).join("; "), E = U(
68
- U(r, "color", "inherit"),
65
+ if (e) {
66
+ const i = m(a || "", "text-align") || "center", r = U(a || d), o = m(r, "color"), t = m(r, "font-size"), p = [
67
+ o ? `color: ${o}` : "",
68
+ t ? `font-size: ${t}` : ""
69
+ ].filter(Boolean).join("; "), T = v(
70
+ v(r, "color", "inherit"),
69
71
  "font-size",
70
72
  "inherit"
71
- ), _ = (c == null ? void 0 : c.nameVisible) === !1 ? "display: none;" : "display: table-cell;";
73
+ ), u = (c == null ? void 0 : c.nameVisible) === !1 ? "display: none;" : "display: table-cell;";
72
74
  return `
73
75
  <td class="esd-block-text es-p10"
74
76
  align="${i}"
75
77
  width="100%"
76
- data-type="${a}"
77
- esd-extension-block-id="${P.NAME}"
78
- style="${_}">
78
+ data-type="${s}"
79
+ esd-extension-block-id="${I.NAME}"
80
+ style="${u}">
79
81
  <p contenteditable="false" path="1"${p ? ` style="${p}"` : ""}>
80
82
  <a
81
83
  href="#!"
82
- style="${E}"
84
+ style="${T}"
83
85
  product-attr="name"
84
86
  data-slot-2
85
87
  width="100%">
86
- ${N}
88
+ ${L}
87
89
  </a>
88
90
  </p>
89
91
  </td>
90
92
  `;
91
93
  }
92
- return `<${h.BLOCK_TEXT}
94
+ return `<${O.BLOCK_TEXT}
93
95
  width="100%"
94
96
  align="center"
95
97
  class="es-p10"
96
- data-type="${a}"
97
- esd-extension-block-id="${P.NAME}"
98
+ data-type="${s}"
99
+ esd-extension-block-id="${I.NAME}"
98
100
  >
99
101
  <p contenteditable="false">
100
102
  <a
@@ -116,43 +118,44 @@ const q = (a, t) => a.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCa
116
118
  product-attr="name"
117
119
  data-slot-2
118
120
  width="100%">
119
- ${N}
121
+ ${L}
120
122
  </a>
121
123
  </p>
122
- </${h.BLOCK_TEXT}>
124
+ </${O.BLOCK_TEXT}>
123
125
  `;
124
- }, J = (a, t, l, e, c, n, o, i, r) => {
125
- let d = x;
126
- if (e && e.trim()) {
127
- const $ = `&nbsp;${e.trim()}&nbsp;`;
128
- d = (c || "0") === "1" ? `${x}${$}` : `${$}${x}`;
126
+ }, et = (s, e, l, a, c, n, d, i, r, o) => {
127
+ let t = x;
128
+ if (a && a.trim()) {
129
+ const E = `${a.trim()}`;
130
+ t = (c || "0") === "1" ? `${x}&nbsp;${E}` : `${E}&nbsp;${x}`;
129
131
  }
130
- const s = c === "1" ? "after" : "before", p = `data-formated="${l ? "true" : "false"}"`, E = `data-curency="${s}"`, _ = e ? `data-currency_symbol="${e}"` : "", b = `data-single_price="${i ? "true" : "false"}"`, I = r === w.ORIENTATION.VERTICAL ? " es-p10b es-p10t" : "";
132
+ const p = c === "1" ? "after" : "before", T = `data-formated="${l ? "true" : "false"}"`, u = `data-curency="${p}"`, P = a ? `data-currency_symbol="${a}"` : "", $ = `data-single_price="${i ? "true" : "false"}"`, _ = r === w.ORIENTATION.VERTICAL ? " es-p10b es-p10t" : "";
131
133
  if (n) {
132
- const T = D(o || "color: #060606; white-space: nowrap; font-size: 20px;");
134
+ const h = U(d || "color: #060606; white-space: nowrap; font-size: 20px;"), y = o ? "" : ' style="display: none;"';
133
135
  return `
134
- <td class="esd-block-text items-block-price${I}"
136
+ <td class="esd-block-text items-block-price${_}"
135
137
  align="center"
136
- esd-extension-block-id="items-block-price"
137
- width="100%">
138
+ esd-extension-block-id="${I.PRICE}"
139
+ width="100%"
140
+ ${y}>
138
141
  <p product-attr="price"
139
142
  contenteditable="false"
140
143
  data-slot-4
141
- data-type="${a}"
142
- data-number="${t}"
143
- ${p}
144
- ${E}
145
- ${_}
146
- ${b}
147
- style="${T}">
148
- ${d}
144
+ data-type="${s}"
145
+ data-number="${e}"
146
+ ${T}
147
+ ${u}
148
+ ${P}
149
+ ${$}
150
+ style="${h}">
151
+ ${t}
149
152
  </p>
150
153
  </td>`;
151
154
  }
152
155
  return `
153
- <${h.BLOCK_TEXT}
154
- esd-extension-block-id="${P.PRICE}"
155
- class="items-block-price ${I}"
156
+ <${O.BLOCK_TEXT}
157
+ esd-extension-block-id="${I.PRICE}"
158
+ class="items-block-price ${_}"
156
159
  width="100%"
157
160
  align="center"
158
161
  >
@@ -160,273 +163,281 @@ const q = (a, t) => a.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCa
160
163
  product-attr="price"
161
164
  contenteditable="false"
162
165
  data-slot-4
163
- data-type="${a}"
164
- data-number="${t}"
165
- ${p}
166
- ${E}
167
- ${e ? `data-currency_symbol="${e}"` : ""}
168
- ${b}
166
+ data-type="${s}"
167
+ data-number="${e}"
168
+ ${T}
169
+ ${u}
170
+ ${a ? `data-currency_symbol="${a}"` : ""}
171
+ ${$}
169
172
  >
170
- ${d}
173
+ ${t}
171
174
  </p>
172
- </${h.BLOCK_TEXT}>
175
+ </${O.BLOCK_TEXT}>
173
176
  `;
174
- }, tt = (a, t, l, e, c, n, o = !0, i, r, d) => {
175
- let s = S;
176
- if (e && e.trim()) {
177
- const T = `&nbsp;${e.trim()}&nbsp;`;
178
- s = (c || "0") === "1" ? `${S}${T}` : `${T}${S}`;
177
+ }, at = (s, e, l, a, c, n, d = !0, i, r, o) => {
178
+ let t = S;
179
+ if (a && a.trim()) {
180
+ const E = `${a.trim()}`;
181
+ t = (c || "0") === "1" ? `${S}&nbsp;${E}` : `${E}&nbsp;${S}`;
179
182
  }
180
- const p = c === "1" ? "after" : "before", E = `data-formated="${l ? "true" : "false"}"`, _ = `data-curency="${p}"`, b = o ? "" : ' style="display: none;"', u = `data-single_price="${r ? "true" : "false"}"`, $ = d === w.ORIENTATION.VERTICAL ? " es-p10b es-p10t" : "";
183
+ const p = c === "1" ? "after" : "before", T = `data-formated="${l ? "true" : "false"}"`, u = `data-curency="${p}"`, P = d ? "" : ' style="display: none;"', $ = `data-single_price="${r ? "true" : "false"}"`, _ = o === w.ORIENTATION.VERTICAL ? " es-p10b es-p10t" : "";
181
184
  if (n) {
182
- const R = D(i || "color: #cc0000; white-space: nowrap; font-size: 19px;");
185
+ const h = U(i || "color: #cc0000; white-space: nowrap; font-size: 19px;");
183
186
  return `
184
- <td class="esd-block-text items-block-price${$}"
185
- esd-extension-block-id="items-block-original-price"
187
+ <td class="esd-block-text items-block-price${_}"
188
+ esd-extension-block-id="${I.ORIGINAL_PRICE}"
186
189
  width="100%"
187
- align="center"${b}>
190
+ align="center"${P}>
188
191
  <p
189
192
  product-attr="originalPrice"
190
193
  contenteditable="false"
191
194
  data-slot-5
192
- data-type="${a}"
193
- data-number="${t}"
194
- ${E}
195
- ${_}
196
- ${e ? `data-currency_symbol="${e}"` : ""}
195
+ data-type="${s}"
196
+ data-number="${e}"
197
+ ${T}
197
198
  ${u}
198
- style="${R}">
199
- <s>${s}</s>
199
+ ${a ? `data-currency_symbol="${a}"` : ""}
200
+ ${$}
201
+ style="${h}">
202
+ <s>${t}</s>
200
203
  </p>
201
204
  </td>
202
205
  `;
203
206
  }
204
207
  return `
205
- <${h.BLOCK_TEXT}
206
- class="items-block-price ${$}"
207
- esd-extension-block-id="${P.ORIGINAL_PRICE}"
208
+ <${O.BLOCK_TEXT}
209
+ class="items-block-price ${_}"
210
+ esd-extension-block-id="${I.ORIGINAL_PRICE}"
208
211
  width="100%"
209
212
  align="center"
210
- ${o ? "" : 'style="display: none;"'}
213
+ ${d ? "" : 'style="display: none;"'}
211
214
  >
212
215
  <p
213
216
  product-attr="originalPrice"
214
217
  contenteditable="false"
215
218
  data-slot-5
216
219
  style="color: #cc0000"
217
- data-type="${a}"
218
- data-number="${t}"
219
- ${E}
220
- ${_}
221
- ${e ? `data-currency_symbol="${e}"` : ""}
220
+ data-type="${s}"
221
+ data-number="${e}"
222
+ ${T}
222
223
  ${u}
224
+ ${a ? `data-currency_symbol="${a}"` : ""}
225
+ ${$}
223
226
  >
224
- <s>${s}</s>
227
+ <s>${t}</s>
225
228
  </p>
226
- </${h.BLOCK_TEXT}>
229
+ </${O.BLOCK_TEXT}>
227
230
  `;
228
- }, et = (a = !0, t, l) => {
229
- const e = a ? "" : 'style="display: none;"';
230
- return t ? `
231
+ }, st = (s = !0, e, l) => {
232
+ const a = s ? "" : 'style="display: none;"';
233
+ if (e) {
234
+ const n = l || "text-align: center; font-size: 14px;";
235
+ return `
231
236
  <td class="esd-block-text es-p10 document-node-component default-block-component selectable"
232
- width="100%" align="center" esd-extension-block-id="items-block-quantity" ${e}>
237
+ width="100%" align="center"
238
+ esd-extension-block-id="${I.QUANTITY}"
239
+ ${a}>
233
240
  <p product-attr="quantity"
234
241
  data-slot-3=""
235
242
  contenteditable="false"
236
243
  width="100%"
237
244
  path="1"
238
- style="${l || "text-align: center; font-size: 14px;"}">
239
- ${k}
245
+ style="${n}">
246
+ ${D}
240
247
  </p>
241
- </td>` : `
242
- <${h.BLOCK_TEXT}
248
+ </td>`;
249
+ }
250
+ return `
251
+ <${O.BLOCK_TEXT}
243
252
  width="100%"
244
253
  align="center"
245
254
  class="es-p10"
246
- esd-extension-block-id="${P.QUANTITY}"
247
- ${a ? "" : 'style="display: none;"'}
255
+ esd-extension-block-id="${I.QUANTITY}"
256
+ ${s ? "" : 'style="display: none;"'}
248
257
  >
249
258
  <p
250
259
  product-attr="quantity"
251
260
  data-slot-3
252
261
  contenteditable="false"
253
262
  width="100%">
254
- ${k}
263
+ ${D}
255
264
  </p>
256
- </${h.BLOCK_TEXT}>
265
+ </${O.BLOCK_TEXT}>
257
266
  `;
258
- }, at = (a, t, l = "Buy", e, c, n = !0) => {
259
- if (e) {
260
- const o = m(c || "", "background") || m(c || "", "background-color"), i = o ? `border-width: 0px; background: ${o};` : "border-width: 0px;", r = n ? "es-fw" : "es-il", d = (c || "").replace("border-width: 0;", "");
267
+ }, lt = (s, e, l = "Buy", a, c, n = !0, d = !0) => {
268
+ if (a) {
269
+ const i = m(c || "", "background") || m(c || "", "background-color"), r = i ? `border-width: 0px; background: ${i};` : "border-width: 0px;", o = n ? "es-fw" : "es-il", t = (c || "").replace("border-width: 0;", "");
261
270
  return `
262
271
  <td class="esd-block-button ins-button default-block-component selectable"
263
272
  align="center" width="100%" name="buy-button" caption="${l}"
264
- esd-extension-block-id="items-block-button"
265
- product-attr="button" data-slot-6="" data-type="${a}" data-number="${t}">
266
- <span class="es-button-border ${r}" style="${i}">
273
+ esd-extension-block-id="${I.BUTTON}"
274
+ product-attr="button" data-slot-6="" data-type="${s}" data-number="${e}"
275
+ ${d ? "" : ' style="display: none;"'}>
276
+ <span class="es-button-border ${o}" style="${r}">
267
277
  <a
268
278
  class="es-button"
269
279
  href="#!"
270
280
  target="_blank"
271
- style="${d} padding: 5px 12px;">
281
+ style="${t} padding: 5px 12px;">
272
282
  ${l}
273
283
  </a>
274
284
  </span>
275
285
  </td>`;
276
286
  }
277
287
  return `
278
- <${h.BLOCK_BUTTON}
288
+ <${O.BLOCK_BUTTON}
279
289
  width="100%"
280
290
  class="ins-button"
281
291
  name="buy-button"
282
292
  caption="${l}"
283
293
  align="center"
284
- esd-extension-block-id="${P.BUTTON}"
294
+ esd-extension-block-id="${I.BUTTON}"
285
295
  product-attr="button"
286
296
  data-slot-6
287
- data-type="${a}"
288
- data-number="${t}"
297
+ data-type="${s}"
298
+ data-number="${e}"
289
299
  >${l}
290
- </${h.BLOCK_BUTTON}>
300
+ </${O.BLOCK_BUTTON}>
291
301
  `;
292
- }, st = (a, t, l, e = !0, c = !0) => {
293
- const n = t === w.ORIENTATION.VERTICAL, o = l === "horizontal";
302
+ }, rt = (s, e, l, a = !0, c = !0) => {
303
+ const n = e === w.ORIENTATION.VERTICAL, d = l === "horizontal";
294
304
  if (n) {
295
- const i = !o, r = i || !c ? "100%" : "50%", d = i || !e ? "100%" : "50%";
296
- let s = a.replace(
305
+ const i = !d, r = i || !c ? "100%" : "50%", o = i || !a ? "100%" : "50%";
306
+ let t = s.replace(
297
307
  /<td\s+[^>]*class="([^"]*product-price-class[^"]*)"[^>]*>/gi,
298
308
  (p) => p.replace(/width="[^"]*"/gi, `width="${r}"`).replace(/width:\s*[^;]+;/gi, `width: ${r};`)
299
309
  );
300
- return s = s.replace(
310
+ return t = t.replace(
301
311
  /<td\s+[^>]*class="([^"]*product-original-price-class[^"]*)"[^>]*>/gi,
302
- (p) => p.replace(/width="[^"]*"/gi, `width="${d}"`).replace(/width:\s*[^;]+;/gi, `width: ${d};`)
303
- ), s;
312
+ (p) => p.replace(/width="[^"]*"/gi, `width="${o}"`).replace(/width:\s*[^;]+;/gi, `width: ${o};`)
313
+ ), t;
304
314
  }
305
- return o ? a : a.replace(
315
+ return d ? s : s.replace(
306
316
  /<td\s+[^>]*class="[^"]*horizontal-price[^"]*"[^>]*>/gi,
307
317
  (i) => /style\s*=\s*"/i.test(i) ? i.replace(/style\s*=\s*"([^"]*)"/i, 'style="display: none; $1"') : i.replace(/>$/, ' style="display: none;">')
308
318
  ).replace(
309
319
  /<td\s+[^>]*class="[^"]*vertical-price[^"]*"[^>]*>/gi,
310
320
  (i) => i.replace(/display:\s*none;?/gi, "display: table-cell;")
311
321
  );
312
- }, lt = (a) => a ? `<td align="center"
322
+ }, it = (s) => s ? `<td align="center"
313
323
  esd-extension-block-id="items-block" width="560"
314
324
  data-number="4"
315
- class="ins-product-td items-block items-block-v2 esd-items-block esd-extension-block esd-container-frame">` : W, f = (a, t, l, e, c, n, o, i, r, d, s, p, E, _ = "horizontal", b, u, I, $) => {
316
- const L = `${`data-type="${t}" data-number="${l}"`} data-orientation="${e}"`, A = a.replace(
325
+ class="ins-product-td items-block items-block-v2 esd-items-block esd-extension-block esd-container-frame">` : H, z = (s, e, l, a, c, n, d, i, r, o, t, p, T, u = "horizontal", P, $, b, _) => {
326
+ const y = `${`data-type="${e}" data-number="${l}"`} data-orientation="${a}"`, A = s.replace(
317
327
  /<td([^>]*class="[^"]*ins-product-td[^"]*"[^>]*)>/,
318
- `<td$1 ${L}>`
319
- ), V = r == null ? void 0 : r["data-product_image_control_image-height"], v = n ? Y(t, l, V, s) : j(t, l), z = (s == null ? void 0 : s.buttonLabel) || "Buy", X = (s == null ? void 0 : s.buttonFullWidth) !== void 0 ? s.buttonFullWidth : !0, B = t === w.ITEMS_TYPE.BROWSED_ITEMS ? !1 : s == null ? void 0 : s.quantityControlEnabled, K = (s == null ? void 0 : s.priceVisible) !== void 0 ? s.priceVisible : (r == null ? void 0 : r["data-product_price_visible"]) !== "false", M = (s == null ? void 0 : s.originalPriceVisible) !== void 0 ? s.originalPriceVisible : (r == null ? void 0 : r["data-product_original_price_control_enabled"]) !== "false", G = A.replace("{-{-TEMPLATE_FIRST_LINE-}-}", lt(n)).replace("{-{-PRODUCT_IMAGE-}-}", v).replace("{-{-PRODUCT_NAME-}-}", Z(t, n, e, p, s)).replaceAll(
328
+ `<td$1 ${y}>`
329
+ ), X = r == null ? void 0 : r["data-product_image_control_image-height"], G = n ? Z(e, l, X, t) : J(e, l), K = (t == null ? void 0 : t.buttonLabel) || "Buy", f = (t == null ? void 0 : t.buttonFullWidth) !== void 0 ? t.buttonFullWidth : !0, B = e === w.ITEMS_TYPE.BROWSED_ITEMS ? !1 : t == null ? void 0 : t.quantityControlEnabled, W = (t == null ? void 0 : t.buttonVisible) !== void 0 ? t.buttonVisible : (r == null ? void 0 : r["data-product_button_control_enabled"]) !== "false", k = (t == null ? void 0 : t.priceVisible) !== void 0 ? t.priceVisible : (r == null ? void 0 : r["data-product_price_control_enabled"]) !== "false", V = (t == null ? void 0 : t.originalPriceVisible) !== void 0 ? t.originalPriceVisible : (r == null ? void 0 : r["data-product_original_price_control_enabled"]) !== "false", Q = A.replace("{-{-TEMPLATE_FIRST_LINE-}-}", it(n)).replace("{-{-PRODUCT_IMAGE-}-}", G).replace("{-{-PRODUCT_NAME-}-}", tt(e, n, a, p, t)).replaceAll(
320
330
  "{-{-PRODUCT_PRICE-}-}",
321
- J(
322
- t,
331
+ g(et(
332
+ e,
323
333
  l,
324
334
  c,
325
- o,
335
+ d,
326
336
  i,
327
337
  n,
328
- b,
329
- $,
330
- e
331
- )
338
+ P,
339
+ _,
340
+ a,
341
+ k
342
+ ))
332
343
  ).replaceAll(
333
344
  "{-{-PRODUCT_ORIGINAL_PRICE-}-}",
334
- tt(
335
- t,
345
+ g(at(
346
+ e,
336
347
  l,
337
348
  c,
338
- o,
349
+ d,
339
350
  i,
340
351
  n,
341
- M,
342
- u,
352
+ V,
343
353
  $,
344
- e
345
- )
346
- ).replace("{-{-PRODUCT_QUANTITY-}-}", et(B, n, I)).replace(
354
+ _,
355
+ a
356
+ ))
357
+ ).replace("{-{-PRODUCT_QUANTITY-}-}", st(B, n, b)).replace(
347
358
  "{-{-PRODUCT_BUTTON-}-}",
348
- at(t, l, z, n, E, X)
359
+ lt(e, l, K, n, T, f, W)
349
360
  );
350
- return st(
351
- G,
352
- e,
353
- _,
354
- K,
355
- M
361
+ return rt(
362
+ Q,
363
+ a,
364
+ u,
365
+ k,
366
+ V
356
367
  );
357
368
  };
358
- function pt({
359
- orientation: a,
360
- itemsType: t = w.ITEMS_TYPE.CART_ITEMS,
369
+ function Tt({
370
+ orientation: s,
371
+ itemsType: e = w.ITEMS_TYPE.CART_ITEMS,
361
372
  itemId: l,
362
- currencySymbol: e,
373
+ currencySymbol: a,
363
374
  currencyLocation: c,
364
375
  migrate: n = !1,
365
- formattedPrice: o = !0,
376
+ formattedPrice: d = !0,
366
377
  configBlockAttributes: i,
367
378
  nodeConfig: r,
368
- nameStyles: d,
369
- buttonStyles: s,
379
+ nameStyles: o,
380
+ buttonStyles: t,
370
381
  priceStyles: p,
371
- originalPriceStyles: E,
372
- quantityStyles: _,
373
- priceOrientation: b
382
+ originalPriceStyles: T,
383
+ quantityStyles: u,
384
+ priceOrientation: P
374
385
  }) {
375
- const u = C[t].findIndex((A) => A.value === l);
376
- let I = "1";
377
- if (u >= 0)
378
- I = String(u + 1);
386
+ const $ = C[e].findIndex((A) => A.value === l);
387
+ let b = "1";
388
+ if ($ >= 0)
389
+ b = String($ + 1);
379
390
  else if (l) {
380
391
  const A = l.match(/\((\d+)\)/);
381
- A && A[1] && ([, I] = A);
392
+ A && A[1] && ([, b] = A);
382
393
  }
383
- const $ = (r == null ? void 0 : r.priceSinglePrice) ?? (i == null ? void 0 : i["data-product_price_control_single_price"]) === "1" ?? !1;
384
- g = O.PAIRS_FOR_EXTENSION.imageSrc[t].DEFAULT[u >= 0 ? u : 0], N = O.PAIRS_FOR_EXTENSION.name[t].DEFAULT[u >= 0 ? u : 0];
385
- const T = O.PAIRS_FOR_EXTENSION.price[t], R = O.PAIRS_FOR_EXTENSION.originalPrice[t];
386
- $ ? (x = o ? T.DEFAULT_SINGLE_PRICE_FORMATTED : T.DEFAULT_SINGLE_PRICE, S = o ? R.DEFAULT_SINGLE_PRICE_FORMATTED : R.DEFAULT_SINGLE_PRICE) : (x = o ? T.DEFAULT_PRICE_FORMATTED : T.DEFAULT_PRICE, S = o ? R.DEFAULT_PRICE_FORMATTED : R.DEFAULT_PRICE), k = O.PAIRS_FOR_EXTENSION.quantity[t].DEFAULT;
387
- const L = b || (r == null ? void 0 : r.priceOrientation) || "horizontal";
388
- return a === w.ORIENTATION.VERTICAL ? f(
389
- H,
390
- t,
391
- I,
392
- a,
393
- o,
394
- n,
394
+ const _ = (r == null ? void 0 : r.priceSinglePrice) ?? (i == null ? void 0 : i["data-product_price_control_single_price"]) === "1" ?? !1;
395
+ M = R.PAIRS_FOR_EXTENSION.imageSrc[e].DEFAULT[$ >= 0 ? $ : 0], L = R.PAIRS_FOR_EXTENSION.name[e].DEFAULT[$ >= 0 ? $ : 0];
396
+ const E = R.PAIRS_FOR_EXTENSION.price[e], h = R.PAIRS_FOR_EXTENSION.originalPrice[e];
397
+ _ ? (x = d ? E.DEFAULT_SINGLE_PRICE_FORMATTED : E.DEFAULT_SINGLE_PRICE, S = d ? h.DEFAULT_SINGLE_PRICE_FORMATTED : h.DEFAULT_SINGLE_PRICE) : (x = d ? E.DEFAULT_PRICE_FORMATTED : E.DEFAULT_PRICE, S = d ? h.DEFAULT_PRICE_FORMATTED : h.DEFAULT_PRICE), D = R.PAIRS_FOR_EXTENSION.quantity[e].DEFAULT;
398
+ const y = P || (r == null ? void 0 : r.priceOrientation) || "horizontal";
399
+ return s === w.ORIENTATION.VERTICAL ? z(
400
+ q,
395
401
  e,
402
+ b,
403
+ s,
404
+ d,
405
+ n,
406
+ a,
396
407
  c,
397
408
  i,
398
409
  void 0,
399
410
  // nodup
400
411
  r,
401
- d,
402
- s,
403
- L,
404
- p,
405
- E,
406
- _,
407
- $
408
- ) : f(
409
- Q,
410
- t,
411
- I,
412
- a,
413
412
  o,
414
- n,
413
+ t,
414
+ y,
415
+ p,
416
+ T,
417
+ u,
418
+ _
419
+ ) : z(
420
+ Y,
415
421
  e,
422
+ b,
423
+ s,
424
+ d,
425
+ n,
426
+ a,
416
427
  c,
417
428
  i,
418
429
  void 0,
419
430
  // nodup
420
431
  r,
421
- d,
422
- s,
423
- L,
432
+ o,
433
+ t,
434
+ y,
424
435
  p,
425
- E,
426
- _,
427
- $
436
+ T,
437
+ u,
438
+ _
428
439
  );
429
440
  }
430
441
  export {
431
- pt as getDefaultTemplate
442
+ Tt as getDefaultTemplate
432
443
  };