@useinsider/guido 3.18.1-beta.178a3ec → 3.18.1-beta.20bdab6

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