@useinsider/guido 2.1.0-beta.411f2a9 → 2.1.0-beta.425dfd0

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