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