@useinsider/guido 2.1.0-beta.a720424 → 2.1.0-beta.acbfaec

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