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