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