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