@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.
- package/dist/config/migrator/itemsBlockMigrator.js +123 -140
- package/dist/extensions/Blocks/Items/block.js +28 -19
- package/dist/extensions/Blocks/Items/controls/button/link.js +31 -19
- package/dist/extensions/Blocks/Items/controls/cardComposition.js +81 -97
- package/dist/extensions/Blocks/Items/controls/image/link.js +31 -19
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +40 -28
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +46 -34
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +50 -45
- package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +51 -40
- package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +35 -23
- package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +57 -45
- package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +62 -42
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +191 -184
- package/dist/extensions/Blocks/Items/enums/settingsEnums.js +2 -0
- package/dist/extensions/Blocks/Items/extension.js +9 -8
- package/dist/extensions/Blocks/Items/store/items-block.js +79 -0
- package/dist/extensions/Blocks/Items/template.js +175 -181
- package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +65 -65
- package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +3 -3
- package/dist/extensions/Blocks/common-control.js +92 -91
- package/dist/src/extensions/Blocks/Items/block.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/controls/button/link.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/controls/image/link.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/controls/name/trimming.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/controls/price/currencyLocation.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/controls/price/currencySymbol.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/controls/price/formattedPrice.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/controls/price/hideDiscount.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/controls/price/priceOrientation.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/controls/price/singlePrice.d.ts +5 -0
- package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +12 -10
- package/dist/src/extensions/Blocks/Items/store/items-block.d.ts +45 -0
- package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +1 -2
- package/dist/src/extensions/Blocks/common-control.d.ts +5 -4
- package/package.json +1 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { BlockType as
|
|
2
|
-
import { ItemsBlockId as
|
|
3
|
-
import { productPairs as
|
|
4
|
-
import { ItemInCartOptions as
|
|
5
|
-
import
|
|
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
|
|
8
|
-
let [
|
|
9
|
-
const
|
|
10
|
-
const
|
|
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,
|
|
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${
|
|
15
|
-
) : s, Z = (s, e,
|
|
16
|
-
const
|
|
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="${
|
|
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
|
-
|
|
31
|
-
src="${g}"
|
|
30
|
+
src="${M}"
|
|
32
31
|
alt="${L}"
|
|
33
|
-
width="${
|
|
34
|
-
height="${
|
|
32
|
+
width="${c}"
|
|
33
|
+
height="${c}">
|
|
35
34
|
</a>
|
|
36
35
|
</td>
|
|
37
36
|
`;
|
|
38
37
|
}, J = (s, e) => `
|
|
39
|
-
<${
|
|
40
|
-
${N.BLOCK_IMAGE.src}="${
|
|
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}="${
|
|
44
|
-
${N.BLOCK_IMAGE.height}="${
|
|
45
|
-
esd-extension-block-id="${
|
|
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,
|
|
52
|
-
const
|
|
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: ${
|
|
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
|
|
68
|
-
|
|
69
|
-
t ? `font-size: ${t}` : ""
|
|
70
|
-
|
|
71
|
-
|
|
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
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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="${
|
|
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 `<${
|
|
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="${
|
|
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
|
-
</${
|
|
124
|
+
</${O.BLOCK_TEXT}>
|
|
131
125
|
`;
|
|
132
|
-
}, et = (s, e,
|
|
133
|
-
let t =
|
|
126
|
+
}, et = (s, e, l, a, c, n, d, i, r, o) => {
|
|
127
|
+
let t = x;
|
|
134
128
|
if (a && a.trim()) {
|
|
135
|
-
const
|
|
136
|
-
t = (
|
|
129
|
+
const E = `${a.trim()}`;
|
|
130
|
+
t = (c || "0") === "1" ? `${x} ${E}` : `${E} ${x}`;
|
|
137
131
|
}
|
|
138
|
-
const
|
|
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
|
|
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${
|
|
136
|
+
<td class="esd-block-text items-block-price${_}"
|
|
143
137
|
align="center"
|
|
144
|
-
esd-extension-block-id="${
|
|
138
|
+
esd-extension-block-id="${I.PRICE}"
|
|
145
139
|
width="100%"
|
|
146
|
-
${
|
|
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
|
-
${
|
|
156
|
-
style="${
|
|
149
|
+
${$}
|
|
150
|
+
style="${h}">
|
|
157
151
|
${t}
|
|
158
152
|
</p>
|
|
159
153
|
</td>`;
|
|
160
154
|
}
|
|
161
155
|
return `
|
|
162
|
-
<${
|
|
163
|
-
esd-extension-block-id="${
|
|
164
|
-
class="items-block-price ${
|
|
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
|
-
${
|
|
171
|
+
${$}
|
|
178
172
|
>
|
|
179
173
|
${t}
|
|
180
174
|
</p>
|
|
181
|
-
</${
|
|
175
|
+
</${O.BLOCK_TEXT}>
|
|
182
176
|
`;
|
|
183
|
-
}, at = (s, e,
|
|
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
|
|
187
|
-
t = (
|
|
180
|
+
const E = `${a.trim()}`;
|
|
181
|
+
t = (c || "0") === "1" ? `${S} ${E}` : `${E} ${S}`;
|
|
188
182
|
}
|
|
189
|
-
const
|
|
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
|
|
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${
|
|
194
|
-
esd-extension-block-id="${
|
|
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
|
-
${
|
|
207
|
-
style="${
|
|
200
|
+
${$}
|
|
201
|
+
style="${h}">
|
|
208
202
|
<s>${t}</s>
|
|
209
203
|
</p>
|
|
210
204
|
</td>
|
|
211
205
|
`;
|
|
212
206
|
}
|
|
213
207
|
return `
|
|
214
|
-
<${
|
|
215
|
-
class="items-block-price ${
|
|
216
|
-
esd-extension-block-id="${
|
|
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
|
-
${
|
|
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
|
-
${
|
|
225
|
+
${$}
|
|
232
226
|
>
|
|
233
227
|
<s>${t}</s>
|
|
234
228
|
</p>
|
|
235
|
-
</${
|
|
229
|
+
</${O.BLOCK_TEXT}>
|
|
236
230
|
`;
|
|
237
|
-
}, st = (s = !0, e,
|
|
231
|
+
}, st = (s = !0, e, l) => {
|
|
238
232
|
const a = s ? "" : 'style="display: none;"';
|
|
239
233
|
if (e) {
|
|
240
|
-
const
|
|
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="
|
|
244
|
-
esd-extension-block-id="${
|
|
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="${
|
|
252
|
-
${
|
|
245
|
+
style="${n}">
|
|
246
|
+
${D}
|
|
253
247
|
</p>
|
|
254
248
|
</td>`;
|
|
255
249
|
}
|
|
256
250
|
return `
|
|
257
|
-
<${
|
|
251
|
+
<${O.BLOCK_TEXT}
|
|
258
252
|
width="100%"
|
|
259
253
|
align="center"
|
|
260
254
|
class="es-p10"
|
|
261
|
-
esd-extension-block-id="${
|
|
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
|
-
${
|
|
263
|
+
${D}
|
|
270
264
|
</p>
|
|
271
|
-
</${
|
|
265
|
+
</${O.BLOCK_TEXT}>
|
|
272
266
|
`;
|
|
273
|
-
}, lt = (s, e,
|
|
267
|
+
}, lt = (s, e, l = "Buy", a, c, n = !0, d = !0) => {
|
|
274
268
|
if (a) {
|
|
275
|
-
const
|
|
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="${
|
|
279
|
-
esd-extension-block-id="${
|
|
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
|
-
${
|
|
282
|
-
<span class="es-button-border ${
|
|
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
|
-
${
|
|
282
|
+
${l}
|
|
289
283
|
</a>
|
|
290
284
|
</span>
|
|
291
285
|
</td>`;
|
|
292
286
|
}
|
|
293
287
|
return `
|
|
294
|
-
<${
|
|
288
|
+
<${O.BLOCK_BUTTON}
|
|
295
289
|
width="100%"
|
|
296
290
|
class="ins-button"
|
|
297
291
|
name="buy-button"
|
|
298
|
-
caption="${
|
|
292
|
+
caption="${l}"
|
|
299
293
|
align="center"
|
|
300
|
-
esd-extension-block-id="${
|
|
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
|
-
>${
|
|
306
|
-
</${
|
|
299
|
+
>${l}
|
|
300
|
+
</${O.BLOCK_BUTTON}>
|
|
307
301
|
`;
|
|
308
|
-
}, rt = (s, e,
|
|
309
|
-
const n = e ===
|
|
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
|
|
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
|
-
(
|
|
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
|
-
(
|
|
312
|
+
(p) => p.replace(/width="[^"]*"/gi, `width="${o}"`).replace(/width:\s*[^;]+;/gi, `width: ${o};`)
|
|
319
313
|
), t;
|
|
320
314
|
}
|
|
321
|
-
return
|
|
315
|
+
return d ? s : s.replace(
|
|
322
316
|
/<td\s+[^>]*class="[^"]*horizontal-price[^"]*"[^>]*>/gi,
|
|
323
|
-
(
|
|
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
|
-
(
|
|
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">` :
|
|
332
|
-
const
|
|
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 ${
|
|
335
|
-
), X =
|
|
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
|
-
|
|
331
|
+
g(et(
|
|
338
332
|
e,
|
|
339
|
-
|
|
340
|
-
i,
|
|
341
|
-
o,
|
|
333
|
+
l,
|
|
342
334
|
c,
|
|
335
|
+
d,
|
|
336
|
+
i,
|
|
343
337
|
n,
|
|
344
338
|
P,
|
|
345
|
-
|
|
339
|
+
_,
|
|
346
340
|
a,
|
|
347
341
|
k
|
|
348
342
|
))
|
|
349
343
|
).replaceAll(
|
|
350
344
|
"{-{-PRODUCT_ORIGINAL_PRICE-}-}",
|
|
351
|
-
|
|
345
|
+
g(at(
|
|
352
346
|
e,
|
|
353
|
-
|
|
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(
|
|
357
|
+
).replace("{-{-PRODUCT_QUANTITY-}-}", st(B, n, b)).replace(
|
|
364
358
|
"{-{-PRODUCT_BUTTON-}-}",
|
|
365
|
-
lt(e,
|
|
359
|
+
lt(e, l, K, n, T, f, W)
|
|
366
360
|
);
|
|
367
361
|
return rt(
|
|
368
|
-
|
|
362
|
+
Q,
|
|
369
363
|
a,
|
|
370
364
|
u,
|
|
371
365
|
k,
|
|
372
|
-
|
|
366
|
+
V
|
|
373
367
|
);
|
|
374
368
|
};
|
|
375
369
|
function Tt({
|
|
376
370
|
orientation: s,
|
|
377
|
-
itemsType: e =
|
|
378
|
-
itemId:
|
|
371
|
+
itemsType: e = w.ITEMS_TYPE.CART_ITEMS,
|
|
372
|
+
itemId: l,
|
|
379
373
|
currencySymbol: a,
|
|
380
|
-
currencyLocation:
|
|
374
|
+
currencyLocation: c,
|
|
381
375
|
migrate: n = !1,
|
|
382
|
-
formattedPrice:
|
|
383
|
-
configBlockAttributes:
|
|
384
|
-
nodeConfig:
|
|
385
|
-
nameStyles:
|
|
376
|
+
formattedPrice: d = !0,
|
|
377
|
+
configBlockAttributes: i,
|
|
378
|
+
nodeConfig: r,
|
|
379
|
+
nameStyles: o,
|
|
386
380
|
buttonStyles: t,
|
|
387
|
-
priceStyles:
|
|
388
|
-
originalPriceStyles:
|
|
381
|
+
priceStyles: p,
|
|
382
|
+
originalPriceStyles: T,
|
|
389
383
|
quantityStyles: u,
|
|
390
384
|
priceOrientation: P
|
|
391
385
|
}) {
|
|
392
|
-
const
|
|
393
|
-
let
|
|
394
|
-
if (
|
|
395
|
-
|
|
396
|
-
else if (
|
|
397
|
-
const
|
|
398
|
-
|
|
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
|
|
401
|
-
|
|
402
|
-
const
|
|
403
|
-
|
|
404
|
-
const
|
|
405
|
-
return s ===
|
|
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
|
-
|
|
402
|
+
b,
|
|
409
403
|
s,
|
|
410
|
-
|
|
404
|
+
d,
|
|
411
405
|
n,
|
|
412
406
|
a,
|
|
413
|
-
i,
|
|
414
407
|
c,
|
|
408
|
+
i,
|
|
415
409
|
void 0,
|
|
416
410
|
// nodup
|
|
417
|
-
|
|
418
|
-
|
|
411
|
+
r,
|
|
412
|
+
o,
|
|
419
413
|
t,
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
414
|
+
y,
|
|
415
|
+
p,
|
|
416
|
+
T,
|
|
423
417
|
u,
|
|
424
|
-
|
|
418
|
+
_
|
|
425
419
|
) : z(
|
|
426
|
-
|
|
420
|
+
Y,
|
|
427
421
|
e,
|
|
428
|
-
|
|
422
|
+
b,
|
|
429
423
|
s,
|
|
430
|
-
|
|
424
|
+
d,
|
|
431
425
|
n,
|
|
432
426
|
a,
|
|
433
|
-
i,
|
|
434
427
|
c,
|
|
428
|
+
i,
|
|
435
429
|
void 0,
|
|
436
430
|
// nodup
|
|
437
|
-
|
|
438
|
-
|
|
431
|
+
r,
|
|
432
|
+
o,
|
|
439
433
|
t,
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
434
|
+
y,
|
|
435
|
+
p,
|
|
436
|
+
T,
|
|
443
437
|
u,
|
|
444
|
-
|
|
438
|
+
_
|
|
445
439
|
);
|
|
446
440
|
}
|
|
447
441
|
export {
|