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