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