@useinsider/guido 3.6.0-beta.dc3a2aa → 3.6.0-beta.ee02cfc

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,50 +1,50 @@
1
1
  import { ModificationDescription as p } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
2
  import { RecommendationBlockId as m } from "../../constants/blockIds.js";
3
- import { CURRENCY_ATTR as y, MOBILE_CONTAINER_SELECTOR as q, MOBILE_ROW_SELECTOR as k, DESKTOP_CONTAINER_SELECTOR as P, CONTAINER_SELECTOR as v, ATTR_PRODUCT_ATTR as W } from "../../constants/selectors.js";
4
- import { RecommendationConfigService as E } from "../../services/configService.js";
3
+ import { CURRENCY_ATTR as g, MOBILE_CONTAINER_SELECTOR as q, MOBILE_ROW_SELECTOR as k, DESKTOP_CONTAINER_SELECTOR as P, CONTAINER_SELECTOR as v, ATTR_PRODUCT_ATTR as j } from "../../constants/selectors.js";
4
+ import { RecommendationConfigService as b } from "../../services/configService.js";
5
5
  import { useRecommendationExtensionStore as C } from "../../store/recommendation.js";
6
6
  import { prepareProductRows as _ } from "../../templates/index.js";
7
- import { formatPrice as j } from "../../utils/priceFormatter.js";
7
+ import { formatPrice as W } from "../../utils/priceFormatter.js";
8
8
  import { isTdNode as F } from "../../utils/tagName.js";
9
9
  import { getDefaultProducts as L, DEFAULT_CARD_COMPOSITION as R, sanitizeImageUrl as V } from "../../templates/utils.js";
10
- const M = "recommendation-block-v2";
10
+ const T = "recommendation-block-v2";
11
11
  function h(t) {
12
12
  if (!t)
13
13
  return null;
14
14
  if ("getAttribute" in t) {
15
15
  const e = t.getAttribute("class");
16
- if (e && e.includes(M))
16
+ if (e && e.includes(T))
17
17
  return t;
18
18
  }
19
- return "querySelector" in t ? t.querySelector(`.${M}`) ?? null : null;
19
+ return "querySelector" in t ? t.querySelector(`.${T}`) ?? null : null;
20
20
  }
21
- function b(t) {
21
+ function E(t) {
22
22
  const e = h(t);
23
23
  if (!e || !("getAttribute" in e))
24
24
  return "grid";
25
25
  const o = e.getAttribute("data-layout");
26
26
  return o === "list" || o === "horizontal" ? "list" : "grid";
27
27
  }
28
- function x(t) {
28
+ function H(t) {
29
29
  const e = h(t);
30
30
  if (!e || !("getAttribute" in e))
31
31
  return R;
32
32
  const o = e.getAttribute("data-card-composition");
33
33
  return o ? o.split(",").filter(Boolean) : R;
34
34
  }
35
- function D(t) {
35
+ function x(t) {
36
36
  if (!t || !("childNodes" in t))
37
37
  return null;
38
38
  const e = t.childNodes(), o = e.find(
39
39
  (n) => "getType" in n && n.getType() === "text"
40
40
  );
41
- return o || e.reduce((n, i) => n || !("getType" in i) || i.getType() === "text" ? n : D(i), null);
41
+ return o || e.reduce((n, r) => n || !("getType" in r) || r.getType() === "text" ? n : x(r), null);
42
42
  }
43
43
  function S(t, e, o) {
44
- const n = D(e);
44
+ const n = x(e);
45
45
  return n ? (t.modifyHtml(n).setText(o), !0) : !1;
46
46
  }
47
- function U(t, e) {
47
+ function D(t, e) {
48
48
  return t && t.length > 0 ? t : e.length > 0 ? e : L();
49
49
  }
50
50
  function G(t) {
@@ -55,130 +55,145 @@ function G(t) {
55
55
  n && (o.modifyHtml(n).setInnerHtml(""), o.apply(new p("Cleared mobile row content")));
56
56
  }
57
57
  function Y(t) {
58
+ return "getOuterHTML" in t && typeof t.getOuterHTML == "function" ? t.getOuterHTML() : "";
59
+ }
60
+ function K(t) {
61
+ const e = t.querySelector(".container");
62
+ return !e || !("childNodes" in e) ? null : e.childNodes().find((n) => "getTagName" in n && n.getTagName() === "tbody") ?? e.querySelector("tbody") ?? null;
63
+ }
64
+ function X(t, e, o) {
65
+ const n = K(t);
66
+ if (!n || !("childNodes" in n))
67
+ return;
68
+ const r = n.childNodes().map(Y).join(""), l = `<tr class="ins-recommendation-mobile-row">${o}</tr>`;
69
+ e.modifyHtml(n).setInnerHtml(r + l), e.apply(new p("Added mobile product row"));
70
+ }
71
+ function z(t) {
58
72
  const {
59
73
  currentNode: e,
60
74
  documentModifier: o,
61
75
  products: n,
62
- layout: i,
63
- composition: c
76
+ layout: r,
77
+ composition: l
64
78
  } = t;
65
79
  if (!e || !("querySelector" in e))
66
80
  return;
67
- const r = i ?? b(e), s = E.getConfig(e);
68
- if (r === "list" || !s.mobileLayoutEnabled) {
81
+ const i = r ?? E(e), s = b.getConfig(e);
82
+ if (i === "list" || !s.mobileLayoutEnabled) {
69
83
  G({ currentNode: e, documentModifier: o });
70
84
  return;
71
85
  }
72
- const u = e.querySelector(k);
73
- if (!u)
74
- return;
75
- const l = C(), d = U(n, l.recommendationProducts), a = c ?? x(e), g = `<td><table class="ins-recommendation-product-container ins-recommendation-mobile-container" width="100%" cellpadding="0" cellspacing="0" border="0">${_(d, r, {
86
+ const u = C(), c = D(n, u.recommendationProducts), d = l ?? H(e), a = `<td><table class="ins-recommendation-product-container ins-recommendation-mobile-container" width="100%" cellpadding="0" cellspacing="0" border="0">${_(c, i, {
76
87
  productsPerRow: s.mobileCardsInRow,
77
- composition: a,
78
- filterList: l.filterList
79
- })}</table></td>`;
80
- o.modifyHtml(u).setInnerHtml(g), o.apply(new p("Updated mobile product rows"));
88
+ composition: d,
89
+ filterList: u.filterList
90
+ })}</table></td>`, y = e.querySelector(k);
91
+ if (!y) {
92
+ X(e, o, a);
93
+ return;
94
+ }
95
+ o.modifyHtml(y).setInnerHtml(a), o.apply(new p("Updated mobile product rows"));
81
96
  }
82
- function K(t) {
97
+ function J(t) {
83
98
  const {
84
99
  currentNode: e,
85
100
  documentModifier: o,
86
101
  afterRegenerate: n,
87
- products: i,
88
- layout: c,
89
- composition: r
102
+ products: r,
103
+ layout: l,
104
+ composition: i
90
105
  } = t;
91
106
  if (!e || !("querySelector" in e))
92
107
  return;
93
108
  const s = e.querySelector(P) ?? e.querySelector(v);
94
109
  if (!s)
95
110
  return;
96
- const u = C(), l = U(i, u.recommendationProducts), { cardsInRow: d } = u.recommendationConfigs, a = r ?? x(e), f = c ?? b(e), g = _(l, f, {
111
+ const u = C(), c = D(r, u.recommendationProducts), { cardsInRow: d } = b.getConfig(e), f = i ?? H(e), a = l ?? E(e), y = _(c, a, {
97
112
  productsPerRow: d,
98
- composition: a,
113
+ composition: f,
99
114
  filterList: u.filterList
100
115
  });
101
- o.modifyHtml(s).setInnerHtml(g).apply(new p("Updated product")), Y(t), n == null || n();
116
+ o.modifyHtml(s).setInnerHtml(y).apply(new p("Updated product")), z(t), n == null || n();
102
117
  }
103
- function T(t, e, o, n) {
104
- const c = `0 ${Math.floor(o / 2)}px`;
105
- let r = !1;
118
+ function M(t, e, o, n) {
119
+ const l = `0 ${Math.floor(o / 2)}px`;
120
+ let i = !1;
106
121
  return n === "grid" ? Array.from(
107
122
  t.querySelectorAll(".attribute-cell")
108
123
  ).forEach((u) => {
109
- e.modifyHtml(u).setStyle("padding", c), r = !0;
124
+ e.modifyHtml(u).setStyle("padding", l), i = !0;
110
125
  }) : Array.from(
111
126
  t.querySelectorAll(".product-card-wrapper")
112
127
  ).forEach((u) => {
113
- const l = "parentNode" in u ? u.parentNode : null;
114
- l && F(l) && (e.modifyHtml(l).setStyle("padding", c), r = !0);
115
- }), r;
128
+ const c = "parentNode" in u ? u.parentNode : null;
129
+ c && F(c) && (e.modifyHtml(c).setStyle("padding", l), i = !0);
130
+ }), i;
116
131
  }
117
132
  function I(t, e, o) {
118
- const n = `${o}px`, i = Array.from(t.querySelectorAll(".spacer"));
119
- let c = !1;
120
- return i.forEach((r) => {
121
- e.modifyHtml(r).setStyle("height", n), c = !0;
122
- }), c;
133
+ const n = `${o}px`, r = Array.from(t.querySelectorAll(".spacer"));
134
+ let l = !1;
135
+ return r.forEach((i) => {
136
+ e.modifyHtml(i).setStyle("height", n), l = !0;
137
+ }), l;
123
138
  }
124
- function X(t) {
139
+ function Q(t) {
125
140
  const { currentNode: e, documentModifier: o } = t;
126
141
  if (!e)
127
142
  return;
128
- const n = E.getConfig(e), i = b(e);
129
- let c = !1;
130
- const r = e.querySelector(P);
131
- if (r) {
132
- c = T(
133
- r,
143
+ const n = b.getConfig(e), r = E(e);
144
+ let l = !1;
145
+ const i = e.querySelector(P);
146
+ if (i) {
147
+ l = M(
148
+ i,
134
149
  o,
135
150
  n.columnSpacing,
136
- i
151
+ r
137
152
  );
138
- const l = I(
139
- r,
153
+ const c = I(
154
+ i,
140
155
  o,
141
156
  n.rowSpacing
142
157
  );
143
- c = c || l;
158
+ l = l || c;
144
159
  }
145
160
  const s = e.querySelector(q);
146
161
  if (s) {
147
- const u = T(
162
+ const u = M(
148
163
  s,
149
164
  o,
150
165
  n.mobileColumnSpacing,
151
- i
166
+ r
152
167
  );
153
- c = c || u;
154
- const l = I(
168
+ l = l || u;
169
+ const c = I(
155
170
  s,
156
171
  o,
157
172
  n.mobileRowSpacing
158
173
  );
159
- c = c || l;
174
+ l = l || c;
160
175
  }
161
- c && o.apply(new p("Reapply spacing after regeneration"));
176
+ l && o.apply(new p("Reapply spacing after regeneration"));
162
177
  }
163
- function se(t) {
164
- const { currentNode: e, documentModifier: o, afterRegenerate: n, products: i, layout: c, composition: r } = t;
165
- e && K({
178
+ function fe(t) {
179
+ const { currentNode: e, documentModifier: o, afterRegenerate: n, products: r, layout: l, composition: i } = t;
180
+ e && J({
166
181
  currentNode: e,
167
182
  documentModifier: o,
168
- products: i,
169
- layout: c,
170
- composition: r,
183
+ products: r,
184
+ layout: l,
185
+ composition: i,
171
186
  afterRegenerate: () => {
172
187
  setTimeout(() => {
173
- X({ currentNode: e, documentModifier: o });
188
+ Q({ currentNode: e, documentModifier: o });
174
189
  }, 0), n == null || n();
175
190
  }
176
191
  });
177
192
  }
178
- function ae(t, e) {
193
+ function me(t, e) {
179
194
  return t.length === e ? t : t.length > e ? t.slice(0, e) : [...t, ...L(e - t.length)];
180
195
  }
181
- function H() {
196
+ function U() {
182
197
  const t = C(), { currencySettings: e } = t.recommendationConfigs, o = parseInt(e.decimalCount);
183
198
  return {
184
199
  code: e.value,
@@ -190,71 +205,71 @@ function H() {
190
205
  };
191
206
  }
192
207
  function A(t, e = "price") {
193
- const o = H(), n = t[e], i = (n == null ? void 0 : n[o.code]) ?? Object.values(n ?? {})[0] ?? 0;
194
- return j({
195
- price: i,
208
+ const o = U(), n = t[e], r = (n == null ? void 0 : n[o.code]) ?? Object.values(n ?? {})[0] ?? 0;
209
+ return W({
210
+ price: r,
196
211
  currency: o
197
212
  });
198
213
  }
199
- function z(t) {
200
- var c, r;
201
- const e = H(), o = ((c = t.original_price) == null ? void 0 : c[e.code]) ?? Object.values(t.original_price ?? {})[0] ?? 0, n = ((r = t.price) == null ? void 0 : r[e.code]) ?? Object.values(t.price ?? {})[0] ?? 0, i = o > 0 ? Math.round((o - n) / o * 100) : 0;
202
- return i > 0 ? `-${i}%` : "0%";
214
+ function Z(t) {
215
+ var l, i;
216
+ const e = U(), o = ((l = t.original_price) == null ? void 0 : l[e.code]) ?? Object.values(t.original_price ?? {})[0] ?? 0, n = ((i = t.price) == null ? void 0 : i[e.code]) ?? Object.values(t.price ?? {})[0] ?? 0, r = o > 0 ? Math.round((o - n) / o * 100) : 0;
217
+ return r > 0 ? `-${r}%` : "0%";
203
218
  }
204
219
  function $(t) {
205
- const { documentModifier: e, product: o, priceEl: n, oldPriceEl: i, omnibusPriceEl: c, omnibusDiscountEl: r } = t;
220
+ const { documentModifier: e, product: o, priceEl: n, oldPriceEl: r, omnibusPriceEl: l, omnibusDiscountEl: i } = t;
206
221
  let s = !1;
207
222
  if (n && "querySelector" in n) {
208
- const u = n.querySelector("strong") ?? n.querySelector("p"), l = A(o, "price");
209
- S(e, u ?? null, l) && (s = !0);
223
+ const u = n.querySelector("strong") ?? n.querySelector("p"), c = A(o, "price");
224
+ S(e, u ?? null, c) && (s = !0);
210
225
  }
211
- if (i && "querySelector" in i) {
212
- const u = i.querySelector("strong") ?? i.querySelector("p"), l = A(o, "original_price");
213
- S(e, u ?? null, l) && (s = !0);
226
+ if (r && "querySelector" in r) {
227
+ const u = r.querySelector("strong") ?? r.querySelector("p"), c = A(o, "original_price");
228
+ S(e, u ?? null, c) && (s = !0);
214
229
  }
215
- if (c && "querySelector" in c) {
216
- const u = c.querySelector(".omnibus-price-value") ?? null, l = A(o, "original_price");
217
- S(e, u, l) && (s = !0);
230
+ if (l && "querySelector" in l) {
231
+ const u = l.querySelector(".omnibus-price-value") ?? null, c = A(o, "original_price");
232
+ S(e, u, c) && (s = !0);
218
233
  }
219
- if (r && "querySelector" in r) {
220
- const u = r.querySelector(".omnibus-discount-value") ?? null, l = z(o);
221
- S(e, u, l) && (s = !0);
234
+ if (i && "querySelector" in i) {
235
+ const u = i.querySelector(".omnibus-discount-value") ?? null, c = Z(o);
236
+ S(e, u, c) && (s = !0);
222
237
  }
223
238
  return s;
224
239
  }
225
- function J(t) {
240
+ function ee(t) {
226
241
  const {
227
242
  documentModifier: e,
228
243
  product: o,
229
244
  imageEl: n,
230
- nameEl: i,
231
- priceEl: c,
232
- oldPriceEl: r,
245
+ nameEl: r,
246
+ priceEl: l,
247
+ oldPriceEl: i,
233
248
  omnibusPriceEl: s,
234
249
  omnibusDiscountEl: u,
235
- buttonEl: l
250
+ buttonEl: c
236
251
  } = t;
237
252
  let d = !1;
238
253
  if (n && "querySelector" in n) {
239
- const a = n.querySelector("img");
240
- a && (e.modifyHtml(a).setAttribute("src", V(o.image_url)).setAttribute("alt", o.name), d = !0);
241
- const f = n.querySelector("a");
242
- f && (e.modifyHtml(f).setAttribute("href", o.url), d = !0);
254
+ const f = n.querySelector("img");
255
+ f && (e.modifyHtml(f).setAttribute("src", V(o.image_url)).setAttribute("alt", o.name), d = !0);
256
+ const a = n.querySelector("a");
257
+ a && (e.modifyHtml(a).setAttribute("href", o.url), d = !0);
243
258
  }
244
- if (i && "querySelector" in i) {
245
- const a = i.querySelector("strong") ?? i.querySelector("p");
246
- S(e, a ?? null, o.name) && (d = !0);
259
+ if (r && "querySelector" in r) {
260
+ const f = r.querySelector("strong") ?? r.querySelector("p");
261
+ S(e, f ?? null, o.name) && (d = !0);
247
262
  }
248
263
  if ($({
249
264
  documentModifier: e,
250
265
  product: o,
251
- priceEl: c,
252
- oldPriceEl: r,
266
+ priceEl: l,
267
+ oldPriceEl: i,
253
268
  omnibusPriceEl: s,
254
269
  omnibusDiscountEl: u
255
- }) && (d = !0), l && "querySelector" in l) {
256
- const a = l.querySelector("a.es-button") || l.querySelector("a");
257
- a && (e.modifyHtml(a).setAttribute("href", o.url), d = !0);
270
+ }) && (d = !0), c && "querySelector" in c) {
271
+ const f = c.querySelector("a.es-button") || c.querySelector("a");
272
+ f && (e.modifyHtml(f).setAttribute("href", o.url), d = !0);
258
273
  }
259
274
  return d;
260
275
  }
@@ -262,17 +277,17 @@ function B(t) {
262
277
  return "querySelector" in t ? t.querySelector(P) ?? t : t;
263
278
  }
264
279
  const O = "product_attribute.";
265
- function Q(t, e) {
280
+ function te(t, e) {
266
281
  var n;
267
282
  let o;
268
283
  if (t.startsWith(O)) {
269
- const i = t.slice(O.length);
270
- o = (n = e.product_attributes) == null ? void 0 : n[i];
284
+ const r = t.slice(O.length);
285
+ o = (n = e.product_attributes) == null ? void 0 : n[r];
271
286
  } else
272
287
  o = e[t];
273
288
  return typeof o == "string" && o.length > 0 ? o : typeof o == "number" ? String(o) : null;
274
289
  }
275
- function Z(t, e, o) {
290
+ function oe(t, e, o) {
276
291
  if (!("querySelectorAll" in t))
277
292
  return !1;
278
293
  const n = t.querySelectorAll(
@@ -280,153 +295,153 @@ function Z(t, e, o) {
280
295
  );
281
296
  if (n.length === 0)
282
297
  return !1;
283
- const i = /* @__PURE__ */ new Map();
284
- n.forEach((r) => {
285
- if (!("getAttribute" in r))
298
+ const r = /* @__PURE__ */ new Map();
299
+ n.forEach((i) => {
300
+ if (!("getAttribute" in i))
286
301
  return;
287
- const s = r.getAttribute(W);
302
+ const s = i.getAttribute(j);
288
303
  if (!s)
289
304
  return;
290
- const u = i.get(s) ?? [];
291
- u.push(r), i.set(s, u);
305
+ const u = r.get(s) ?? [];
306
+ u.push(i), r.set(s, u);
292
307
  });
293
- let c = !1;
294
- return i.forEach((r, s) => {
295
- const u = Math.min(r.length, o.length);
296
- r.slice(0, u).forEach((l, d) => {
297
- if (!("querySelector" in l))
308
+ let l = !1;
309
+ return r.forEach((i, s) => {
310
+ const u = Math.min(i.length, o.length);
311
+ i.slice(0, u).forEach((c, d) => {
312
+ if (!("querySelector" in c))
298
313
  return;
299
- const a = Q(s, o[d]);
300
- if (a === null)
314
+ const f = te(s, o[d]);
315
+ if (f === null)
301
316
  return;
302
- const f = l.querySelector("p") ?? null;
303
- S(e, f, a) && (c = !0);
317
+ const a = c.querySelector("p") ?? null;
318
+ S(e, a, f) && (l = !0);
304
319
  });
305
- }), c;
320
+ }), l;
306
321
  }
307
322
  function w(t, e, o) {
308
323
  if (!("querySelectorAll" in t))
309
324
  return !1;
310
325
  const n = t.querySelectorAll(
311
326
  `[esd-extension-block-id="${m.IMAGE}"]`
312
- ), i = t.querySelectorAll(
327
+ ), r = t.querySelectorAll(
313
328
  `[esd-extension-block-id="${m.NAME}"]`
314
- ), c = t.querySelectorAll(
329
+ ), l = t.querySelectorAll(
315
330
  `[esd-extension-block-id="${m.PRICE}"]`
316
- ), r = t.querySelectorAll(
331
+ ), i = t.querySelectorAll(
317
332
  `[esd-extension-block-id="${m.OLD_PRICE}"]`
318
333
  ), s = t.querySelectorAll(
319
334
  `[esd-extension-block-id="${m.OMNIBUS_PRICE}"]`
320
335
  ), u = t.querySelectorAll(
321
336
  `[esd-extension-block-id="${m.OMNIBUS_DISCOUNT}"]`
322
- ), l = t.querySelectorAll(
337
+ ), c = t.querySelectorAll(
323
338
  `[esd-extension-block-id="${m.BUTTON}"]`
324
339
  ), d = Math.min(n.length, o.length);
325
- let a = !1;
326
- for (let f = 0; f < d; f++) {
327
- const g = J({
340
+ let f = !1;
341
+ for (let a = 0; a < d; a++) {
342
+ const y = ee({
328
343
  documentModifier: e,
329
- product: o[f],
330
- imageEl: n[f] ?? null,
331
- nameEl: i[f] ?? null,
332
- priceEl: c[f] ?? null,
333
- oldPriceEl: r[f] ?? null,
334
- omnibusPriceEl: s[f] ?? null,
335
- omnibusDiscountEl: u[f] ?? null,
336
- buttonEl: l[f] ?? null
344
+ product: o[a],
345
+ imageEl: n[a] ?? null,
346
+ nameEl: r[a] ?? null,
347
+ priceEl: l[a] ?? null,
348
+ oldPriceEl: i[a] ?? null,
349
+ omnibusPriceEl: s[a] ?? null,
350
+ omnibusDiscountEl: u[a] ?? null,
351
+ buttonEl: c[a] ?? null
337
352
  });
338
- a = a || g;
353
+ f = f || y;
339
354
  }
340
- return Z(t, e, o) && (a = !0), a;
355
+ return oe(t, e, o) && (f = !0), f;
341
356
  }
342
- function de(t) {
357
+ function pe(t) {
343
358
  const { currentNode: e, documentModifier: o, products: n } = t;
344
359
  if (!e || !("querySelectorAll" in e))
345
360
  return !1;
346
- const i = B(e);
347
- if (!("querySelectorAll" in i) || i.querySelectorAll(
361
+ const r = B(e);
362
+ if (!("querySelectorAll" in r) || r.querySelectorAll(
348
363
  `[esd-extension-block-id="${m.IMAGE}"]`
349
364
  ).length !== n.length)
350
365
  return !1;
351
- let r = w(i, o, n);
352
- const s = b(e), u = E.getConfig(e);
366
+ let i = w(r, o, n);
367
+ const s = E(e), u = b.getConfig(e);
353
368
  if (s !== "list" && u.mobileLayoutEnabled && "querySelector" in e) {
354
- const l = e.querySelector(q);
355
- if (l) {
369
+ const c = e.querySelector(q);
370
+ if (c) {
356
371
  const d = w(
357
- l,
372
+ c,
358
373
  o,
359
374
  n
360
375
  );
361
- r = r || d;
376
+ i = i || d;
362
377
  }
363
378
  }
364
- return r && o.apply(new p("Updated product content in-place")), !0;
379
+ return i && o.apply(new p("Updated product content in-place")), !0;
365
380
  }
366
381
  function N(t, e, o) {
367
382
  if (!("querySelectorAll" in t))
368
383
  return !1;
369
384
  const n = t.querySelectorAll(
370
385
  `[esd-extension-block-id="${m.PRICE}"]`
371
- ), i = t.querySelectorAll(
386
+ ), r = t.querySelectorAll(
372
387
  `[esd-extension-block-id="${m.OLD_PRICE}"]`
373
- ), c = t.querySelectorAll(
388
+ ), l = t.querySelectorAll(
374
389
  `[esd-extension-block-id="${m.OMNIBUS_PRICE}"]`
375
- ), r = t.querySelectorAll(
390
+ ), i = t.querySelectorAll(
376
391
  `[esd-extension-block-id="${m.OMNIBUS_DISCOUNT}"]`
377
392
  ), s = Math.min(n.length, o.length);
378
393
  let u = !1;
379
- for (let l = 0; l < s; l++)
394
+ for (let c = 0; c < s; c++)
380
395
  $({
381
396
  documentModifier: e,
382
- product: o[l],
383
- priceEl: n[l] ?? null,
384
- oldPriceEl: i[l] ?? null,
385
- omnibusPriceEl: c[l] ?? null,
386
- omnibusDiscountEl: r[l] ?? null
397
+ product: o[c],
398
+ priceEl: n[c] ?? null,
399
+ oldPriceEl: r[c] ?? null,
400
+ omnibusPriceEl: l[c] ?? null,
401
+ omnibusDiscountEl: i[c] ?? null
387
402
  }) && (u = !0);
388
403
  return u;
389
404
  }
390
- function fe(t) {
405
+ function ye(t) {
391
406
  const { currentNode: e, documentModifier: o } = t;
392
407
  if (!e || !("querySelectorAll" in e))
393
408
  return !1;
394
- const i = C().recommendationProducts;
395
- if (i.length === 0)
409
+ const r = C().recommendationProducts;
410
+ if (r.length === 0)
396
411
  return !1;
397
- const c = B(e);
398
- let r = N(c, o, i);
399
- const s = b(e), u = E.getConfig(e);
412
+ const l = B(e);
413
+ let i = N(l, o, r);
414
+ const s = E(e), u = b.getConfig(e);
400
415
  if (s !== "list" && u.mobileLayoutEnabled && "querySelector" in e) {
401
- const l = e.querySelector(q);
402
- if (l) {
403
- const d = N(l, o, i);
404
- r = r || d;
416
+ const c = e.querySelector(q);
417
+ if (c) {
418
+ const d = N(c, o, r);
419
+ i = i || d;
405
420
  }
406
421
  }
407
- return r && o.apply(new p("Updated price formatting in-place")), r;
422
+ return i && o.apply(new p("Updated price formatting in-place")), i;
408
423
  }
409
- function me(t) {
410
- const { currentNode: e, documentModifier: o, currency: n } = t, i = h(e);
411
- if (!i)
424
+ function ge(t) {
425
+ const { currentNode: e, documentModifier: o, currency: n } = t, r = h(e);
426
+ if (!r)
412
427
  return;
413
- const c = n.alignment === "before" ? "0" : "1", r = (s, u) => {
414
- o.modifyHtml(i).setAttribute(s, u);
428
+ const l = n.alignment === "before" ? "0" : "1", i = (s, u) => {
429
+ o.modifyHtml(r).setAttribute(s, u);
415
430
  };
416
- r(y.CURRENCY, n.code), r(y.SYMBOL, n.symbol), r(y.ALIGNMENT, c), r(y.THOUSAND_SEPARATOR, n.thousandSeparator), r(y.DECIMAL_SEPARATOR, n.decimalSeparator), r(y.DECIMAL_COUNT, n.decimalCount.toString()), o.apply(new p("Update currency attributes"));
431
+ i(g.CURRENCY, n.code), i(g.SYMBOL, n.symbol), i(g.ALIGNMENT, l), i(g.THOUSAND_SEPARATOR, n.thousandSeparator), i(g.DECIMAL_SEPARATOR, n.decimalSeparator), i(g.DECIMAL_COUNT, n.decimalCount.toString()), o.apply(new p("Update currency attributes"));
417
432
  }
418
433
  export {
419
- ae as adjustProductsToSize,
434
+ me as adjustProductsToSize,
420
435
  A as formatProductPrice,
421
436
  h as getBlockElement,
422
- x as getCardComposition,
423
- b as getCurrentLayout,
424
- X as reapplySpacing,
425
- Y as regenerateMobileProductRows,
426
- K as regenerateProductRows,
427
- se as regenerateProductRowsWithStyles,
428
- me as setCurrencyAttributes,
429
- fe as updatePricesInPlace,
430
- de as updateProductContentInPlace,
431
- J as updateSingleProductContent
437
+ H as getCardComposition,
438
+ E as getCurrentLayout,
439
+ Q as reapplySpacing,
440
+ z as regenerateMobileProductRows,
441
+ J as regenerateProductRows,
442
+ fe as regenerateProductRowsWithStyles,
443
+ ge as setCurrencyAttributes,
444
+ ye as updatePricesInPlace,
445
+ pe as updateProductContentInPlace,
446
+ ee as updateSingleProductContent
432
447
  };