@useinsider/guido 3.6.0 → 3.7.0-beta.04f8814

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.
Files changed (41) hide show
  1. package/README.md +14 -0
  2. package/dist/components/Guido.vue.js +1 -1
  3. package/dist/components/Guido.vue2.js +75 -72
  4. package/dist/components/organisms/header/EditorActions.vue.js +1 -1
  5. package/dist/components/organisms/header/EditorActions.vue2.js +6 -6
  6. package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
  7. package/dist/components/organisms/header/LeftSlot.vue2.js +9 -9
  8. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +2 -2
  9. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +24 -22
  10. package/dist/composables/useActionsApi.js +16 -15
  11. package/dist/composables/useHtmlCompiler.js +40 -22
  12. package/dist/composables/useRecommendation.js +34 -33
  13. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +127 -123
  14. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +51 -47
  15. package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +12 -11
  16. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +46 -46
  17. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +13 -9
  18. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +35 -29
  19. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +28 -28
  20. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +8 -8
  21. package/dist/extensions/Blocks/Recommendation/templates/utils.js +56 -49
  22. package/dist/extensions/Blocks/Recommendation/utils/partnerCustomizations.js +21 -0
  23. package/dist/extensions/Blocks/Recommendation/utils/priceFormatter.js +17 -17
  24. package/dist/extensions/Blocks/Unsubscribe/control.js +33 -26
  25. package/dist/guido.css +1 -1
  26. package/dist/src/components/Guido.vue.d.ts +1 -0
  27. package/dist/src/composables/useHtmlCompiler.d.ts +1 -0
  28. package/dist/src/extensions/Blocks/Recommendation/templates/grid/elementRenderer.d.ts +7 -0
  29. package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +1 -1
  30. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +8 -0
  31. package/dist/src/extensions/Blocks/Recommendation/templates/utils.test.d.ts +1 -0
  32. package/dist/src/extensions/Blocks/Recommendation/utils/partnerCustomizations.d.ts +7 -0
  33. package/dist/src/extensions/Blocks/Recommendation/utils/priceFormatter.test.d.ts +1 -0
  34. package/dist/src/extensions/Blocks/Unsubscribe/control.d.ts +1 -0
  35. package/dist/src/utils/ampErrorFilter.d.ts +2 -0
  36. package/dist/src/utils/ampErrorFilter.test.d.ts +1 -0
  37. package/dist/src/utils/templatePreparation.d.ts +16 -0
  38. package/dist/src/utils/templatePreparation.test.d.ts +1 -0
  39. package/dist/utils/ampErrorFilter.js +8 -0
  40. package/dist/utils/templatePreparation.js +59 -58
  41. package/package.json +1 -1
@@ -1,11 +1,14 @@
1
- import { RecommendationBlockId as s } from "../../constants/blockIds.js";
2
- import { ATTR_PRODUCT_ATTR as u, CSS_CLASS_RECO_BUTTON as p, ATTR_PRODUCT_BUTTON as m, ATTR_PRODUCT_OMNIBUS_DISCOUNT as h, ATTR_PRODUCT_OMNIBUS_PRICE as y, ATTR_PRODUCT_OLD_PRICE as T, ATTR_PRODUCT_PRICE as f, ATTR_PRODUCT_NAME as _, ATTR_PRODUCT_IMAGE as x } from "../../constants/selectors.js";
3
- import { useRecommendationExtensionStore as $ } from "../../store/recommendation.js";
1
+ import { RecommendationBlockId as l } from "../../constants/blockIds.js";
2
+ import { ATTR_PRODUCT_ATTR as u, CSS_CLASS_RECO_BUTTON as p, ATTR_PRODUCT_BUTTON as m, ATTR_PRODUCT_OMNIBUS_DISCOUNT as h, ATTR_PRODUCT_OMNIBUS_PRICE as y, ATTR_PRODUCT_OLD_PRICE as T, ATTR_PRODUCT_PRICE as f, ATTR_PRODUCT_NAME as $, ATTR_PRODUCT_IMAGE as _ } from "../../constants/selectors.js";
3
+ import { useRecommendationExtensionStore as x } from "../../store/recommendation.js";
4
4
  import { formatPrice as C } from "../../utils/priceFormatter.js";
5
5
  import { CUSTOM_CELL_HTML as R, sanitizeImageUrl as O } from "../utils.js";
6
- const a = "0 5px", l = "attribute-cell";
6
+ const s = "0 5px", a = "attribute-cell";
7
+ function S(t, e = s) {
8
+ return `<td class="${a}" style="padding: ${e};" width="${t}%"></td>`;
9
+ }
7
10
  function g() {
8
- const t = $(), { currencySettings: e } = t.recommendationConfigs;
11
+ const t = x(), { currencySettings: e } = t.recommendationConfigs;
9
12
  return {
10
13
  code: e.value,
11
14
  symbol: e.symbol,
@@ -22,9 +25,9 @@ function i(t, e = "price") {
22
25
  currency: o
23
26
  });
24
27
  }
25
- const S = {
26
- [x]: (t) => `
27
- <td class="${l}" style="padding: ${a}; height: 100%;" valign="top">
28
+ const A = {
29
+ [_]: (t) => `
30
+ <td class="${a}" style="padding: ${s}; height: 100%;" valign="top">
28
31
  <table
29
32
  class="product-card-segment"
30
33
  width="100%"
@@ -37,7 +40,7 @@ const S = {
37
40
  <td
38
41
  class="esd-block-image product-image"
39
42
  align="center"
40
- esd-extension-block-id="${s.IMAGE}">
43
+ esd-extension-block-id="${l.IMAGE}">
41
44
  <a target="_blank" href="${t.url}" class="${p}">
42
45
  <img
43
46
  src="${O(t.image_url)}"
@@ -51,8 +54,8 @@ const S = {
51
54
  </table>
52
55
  </td>
53
56
  `,
54
- [_]: (t) => `
55
- <td class="${l}" style="padding: ${a}; height: 100%;" valign="middle">
57
+ [$]: (t) => `
58
+ <td class="${a}" style="padding: ${s}; height: 100%;" valign="middle">
56
59
  <table
57
60
  class="product-card-segment"
58
61
  width="100%"
@@ -66,7 +69,7 @@ const S = {
66
69
  <td
67
70
  class="esd-block-text product-name es-p10t es-p10b es-p15l es-p15r"
68
71
  align="center"
69
- esd-extension-block-id="${s.NAME}">
72
+ esd-extension-block-id="${l.NAME}">
70
73
  <p contenteditable="false" style="font-size: 16px; color: #333333;">
71
74
  <strong>${t.name}</strong>
72
75
  </p>
@@ -77,7 +80,7 @@ const S = {
77
80
  </td>
78
81
  `,
79
82
  [f]: (t) => `
80
- <td class="${l}" style="padding: ${a}; height: 100%;" valign="top">
83
+ <td class="${a}" style="padding: ${s}; height: 100%;" valign="top">
81
84
  <table
82
85
  class="product-card-segment"
83
86
  width="100%"
@@ -90,7 +93,7 @@ const S = {
90
93
  <td
91
94
  class="esd-block-text product-price es-p15l es-p15r"
92
95
  align="center"
93
- esd-extension-block-id="${s.PRICE}">
96
+ esd-extension-block-id="${l.PRICE}">
94
97
  <p contenteditable="false" style="font-size: 16px; color: #333333;">
95
98
  <strong>${i(t, "price")}</strong>
96
99
  </p>
@@ -101,7 +104,7 @@ const S = {
101
104
  </td>
102
105
  `,
103
106
  [T]: (t) => `
104
- <td class="${l}" style="padding: ${a}; height: 100%;" valign="top">
107
+ <td class="${a}" style="padding: ${s}; height: 100%;" valign="top">
105
108
  <table
106
109
  class="product-card-segment"
107
110
  width="100%"
@@ -114,9 +117,11 @@ const S = {
114
117
  <td
115
118
  class="esd-block-text product-old-price es-p15l es-p15r"
116
119
  align="center"
117
- esd-extension-block-id="${s.OLD_PRICE}">
118
- <p contenteditable="false" style="font-size: 14px; color: #999999;">
119
- <strong>${i(t, "original_price")}</strong>
120
+ esd-extension-block-id="${l.OLD_PRICE}">
121
+ <p
122
+ contenteditable="false"
123
+ style="font-size: 14px; color: #999999;">
124
+ <s><strong>${i(t, "original_price")}</strong></s>
120
125
  </p>
121
126
  </td>
122
127
  </tr>
@@ -125,7 +130,7 @@ const S = {
125
130
  </td>
126
131
  `,
127
132
  [y]: (t) => `
128
- <td class="${l}" style="padding: ${a}; height: 100%;" valign="top">
133
+ <td class="${a}" style="padding: ${s}; height: 100%;" valign="top">
129
134
  <table
130
135
  class="product-card-segment"
131
136
  width="100%"
@@ -140,7 +145,7 @@ const S = {
140
145
  align="center"
141
146
  data-text-before="Lowest 30-day price: "
142
147
  data-text-after=""
143
- esd-extension-block-id="${s.OMNIBUS_PRICE}">
148
+ esd-extension-block-id="${l.OMNIBUS_PRICE}">
144
149
  <p contenteditable="false" style="font-size: 12px; color: #666666;">
145
150
  <span class="omnibus-text-before">Lowest 30-day price: </span>
146
151
  <span class="omnibus-price-value">${i(t, "original_price")}</span>
@@ -156,7 +161,7 @@ const S = {
156
161
  var r, c;
157
162
  const e = g(), o = ((r = t.original_price) == null ? void 0 : r[e.code]) ?? Object.values(t.original_price ?? {})[0] ?? 0, n = ((c = t.price) == null ? void 0 : c[e.code]) ?? Object.values(t.price ?? {})[0] ?? 0, d = o > 0 ? Math.round((o - n) / o * 100) : 0, b = d > 0 ? `-${d}%` : "0%";
158
163
  return `
159
- <td class="${l}" style="padding: ${a}; height: 100%;" valign="top">
164
+ <td class="${a}" style="padding: ${s}; height: 100%;" valign="top">
160
165
  <table
161
166
  class="product-card-segment"
162
167
  width="100%"
@@ -171,7 +176,7 @@ const S = {
171
176
  align="center"
172
177
  data-text-before=""
173
178
  data-text-after=""
174
- esd-extension-block-id="${s.OMNIBUS_DISCOUNT}">
179
+ esd-extension-block-id="${l.OMNIBUS_DISCOUNT}">
175
180
  <p contenteditable="false" style="font-size: 12px; color: #666666;">
176
181
  <span class="omnibus-text-before"></span>
177
182
  <span class="omnibus-discount-value">${b}</span>
@@ -185,7 +190,7 @@ const S = {
185
190
  `;
186
191
  },
187
192
  [m]: () => `
188
- <td class="${l}" style="padding: ${a}; height: 100%;" valign="top">
193
+ <td class="${a}" style="padding: ${s}; height: 100%;" valign="top">
189
194
  <table
190
195
  class="product-card-segment"
191
196
  width="100%"
@@ -198,7 +203,7 @@ const S = {
198
203
  <td
199
204
  class="esd-block-button product-button es-p10t es-p10b"
200
205
  align="center"
201
- esd-extension-block-id="${s.BUTTON}">
206
+ esd-extension-block-id="${l.BUTTON}">
202
207
  <span
203
208
  class="es-button-border"
204
209
  style="
@@ -237,7 +242,7 @@ const S = {
237
242
  * @param content - Display content for the cell
238
243
  */
239
244
  [R]: (t, e) => `
240
- <td class="${l}" style="padding: ${a}; height: 100%;" valign="middle">
245
+ <td class="${a}" style="padding: ${s}; height: 100%;" valign="middle">
241
246
  <table
242
247
  class="product-card-segment"
243
248
  width="100%"
@@ -252,7 +257,7 @@ const S = {
252
257
  ${u}="${t}"
253
258
  class="esd-block-text product-custom-attribute es-p0t es-p0b es-p15l es-p15r"
254
259
  align="center"
255
- esd-extension-block-id="${s.CUSTOM_ATTRIBUTE}">
260
+ esd-extension-block-id="${l.CUSTOM_ATTRIBUTE}">
256
261
  <p contenteditable="false" style="font-size: 12px; color: #666666;">${e}</p>
257
262
  </td>
258
263
  </tr>
@@ -262,7 +267,8 @@ const S = {
262
267
  `
263
268
  };
264
269
  export {
265
- l as ATTRIBUTE_CELL_CLASS,
266
- a as DEFAULT_CELL_PADDING,
267
- S as gridElementRenderer
270
+ a as ATTRIBUTE_CELL_CLASS,
271
+ s as DEFAULT_CELL_PADDING,
272
+ S as buildFillerCell,
273
+ A as gridElementRenderer
268
274
  };
@@ -1,7 +1,7 @@
1
- import { DEFAULT_PRODUCTS_PER_ROW as L } from "../../constants/layout.js";
2
- import { getDefaultProducts as E, DEFAULTS as I, createBlockTemplate as _, DEFAULT_CARD_COMPOSITION as S, spacer as b, buildElementRenderer as A, DEFAULT_CARD_VISIBILITY as f } from "../utils.js";
3
- import { ATTRIBUTE_CELL_CLASS as w, DEFAULT_CELL_PADDING as D, gridElementRenderer as C } from "./elementRenderer.js";
4
- const O = `
1
+ import { DEFAULT_PRODUCTS_PER_ROW as m } from "../../constants/layout.js";
2
+ import { getDefaultProducts as I, DEFAULTS as b, createBlockTemplate as E, DEFAULT_CARD_COMPOSITION as L, spacer as S, buildElementRenderer as _, DEFAULT_CARD_VISIBILITY as f } from "../utils.js";
3
+ import { buildFillerCell as w, gridElementRenderer as A } from "./elementRenderer.js";
4
+ const D = `
5
5
  <tr class="recommendation-product-row">
6
6
  <td>
7
7
  <table
@@ -18,7 +18,7 @@ const O = `
18
18
  </table>
19
19
  </td>
20
20
  </tr>
21
- `, g = `
21
+ `, C = `
22
22
  <tr
23
23
  class="recommendation-attribute-row"
24
24
  data-attribute-type="{-{-ATTR_TYPE-}-}"
@@ -27,38 +27,38 @@ const O = `
27
27
  {-{-CELLS-}-}
28
28
  </tr>
29
29
  `;
30
- function P(t, e, o, r = S, n = {}) {
31
- const c = (100 / e).toFixed(2), i = e - t.length, l = `<td class="${w}" style="padding: ${D};" width="${c}%"></td>`, d = i > 0 ? l.repeat(i) : "", a = A(o, r, n);
32
- return r.filter((s) => a[s]).map((s) => {
33
- const T = f[s] ?? !0, u = T ? "" : 'style="display: none;"', R = t.map((m) => a[s](m).replace("<td", `<td width="${c}%"`)).join("");
34
- return g.replace("{-{-ATTR_TYPE-}-}", s).replace("{-{-VISIBILITY-}-}", T ? "1" : "0").replace("{-{-DISPLAY_STYLE-}-}", u).replace("{-{-CELLS-}-}", R + d);
30
+ function O(t, e, n, r = L, c = {}) {
31
+ const a = (100 / e).toFixed(2), s = e - t.length, l = s > 0 ? w(a).repeat(s) : "", i = _(n, r, c);
32
+ return r.filter((o) => i[o]).map((o) => {
33
+ const p = f[o] ?? !0, u = p ? "" : 'style="display: none;"', T = t.map((R) => i[o](R).replace("<td", `<td width="${a}%"`)).join("");
34
+ return C.replace("{-{-ATTR_TYPE-}-}", o).replace("{-{-VISIBILITY-}-}", p ? "1" : "0").replace("{-{-DISPLAY_STYLE-}-}", u).replace("{-{-CELLS-}-}", T + l);
35
35
  }).join("");
36
36
  }
37
- function U(t, e, o, r, n = {}) {
38
- const c = [];
37
+ function g(t, e, n, r, c = {}) {
38
+ const a = [];
39
39
  for (let l = 0; l < t.length; l += e)
40
- c.push(t.slice(l, l + e));
41
- return c.map((l, d) => {
42
- const a = P(
40
+ a.push(t.slice(l, l + e));
41
+ return a.map((l, i) => {
42
+ const d = O(
43
43
  l,
44
44
  e,
45
- o,
45
+ n,
46
46
  r,
47
- n
48
- ), p = O.replace("{-{-ATTRIBUTE_ROWS-}-}", a);
49
- return d > 0 ? b + p : p;
47
+ c
48
+ ), o = D.replace("{-{-ATTRIBUTE_ROWS-}-}", d);
49
+ return i > 0 ? S + o : o;
50
50
  }).join("");
51
51
  }
52
- function h(t, e, o, r = {}) {
53
- return U(t, e, C, o, r);
52
+ function P(t, e, n, r = {}) {
53
+ return g(t, e, A, n, r);
54
54
  }
55
- function F(t) {
56
- const e = t ? `ins-recommendation-v3-block-${t}` : void 0, o = _("grid", e), r = E(), n = h(r, L);
57
- return o.replace("{-{-TITLE-}-}", I.TITLE).replace("{-{-PRODUCT_ROWS-}-}", n).replace("{-{-MOBILE_PRODUCT_ROWS-}-}", "");
55
+ function B(t) {
56
+ const e = t ? `ins-recommendation-v3-block-${t}` : void 0, n = E("grid", e), r = I(), c = P(r, m);
57
+ return n.replace("{-{-TITLE-}-}", b.TITLE).replace("{-{-PRODUCT_ROWS-}-}", c).replace("{-{-MOBILE_PRODUCT_ROWS-}-}", "");
58
58
  }
59
59
  export {
60
- F as getDefaultTemplate,
61
- P as prepareGridAttributeRows,
62
- U as prepareGridProductRows,
63
- h as prepareProductRows
60
+ B as getDefaultTemplate,
61
+ O as prepareGridAttributeRows,
62
+ g as prepareGridProductRows,
63
+ P as prepareProductRows
64
64
  };
@@ -14,10 +14,10 @@ function b() {
14
14
  thousandSeparator: e.thousandSeparator
15
15
  };
16
16
  }
17
- function s(t, e = "price") {
18
- const n = b(), a = t[e], r = (a == null ? void 0 : a[n.code]) ?? Object.values(a ?? {})[0] ?? 0;
17
+ function r(t, e = "price") {
18
+ const n = b(), s = t[e], a = (s == null ? void 0 : s[n.code]) ?? Object.values(s ?? {})[0] ?? 0;
19
19
  return R({
20
- price: r,
20
+ price: a,
21
21
  currency: n
22
22
  });
23
23
  }
@@ -69,7 +69,7 @@ const I = {
69
69
  esd-extension-block-id="${o.PRICE}"
70
70
  align="left">
71
71
  <p contenteditable="false" style="font-size: 16px; color: #333333; font-weight: bold; margin: 0;">
72
- <strong>${s(t, "price")}</strong>
72
+ <strong>${r(t, "price")}</strong>
73
73
  </p>
74
74
  </td>
75
75
  </tr>
@@ -85,8 +85,8 @@ const I = {
85
85
  align="left">
86
86
  <p
87
87
  contenteditable="false"
88
- style="font-size: 14px; color: #999999; text-decoration: line-through; margin: 0;">
89
- <strong>${s(t, "original_price")}</strong>
88
+ style="font-size: 14px; color: #999999; margin: 0;">
89
+ <s><strong>${r(t, "original_price")}</strong></s>
90
90
  </p>
91
91
  </td>
92
92
  </tr>
@@ -104,7 +104,7 @@ const I = {
104
104
  align="left">
105
105
  <p contenteditable="false" style="font-size: 12px; color: #666666; margin: 0;">
106
106
  <span class="omnibus-text-before">Lowest 30-day price: </span>
107
- <span class="omnibus-price-value">${s(t, "original_price")}</span>
107
+ <span class="omnibus-price-value">${r(t, "original_price")}</span>
108
108
  <span class="omnibus-text-after"></span>
109
109
  </p>
110
110
  </td>
@@ -115,7 +115,7 @@ const I = {
115
115
  */
116
116
  [g]: (t) => {
117
117
  var i, l;
118
- const e = b(), n = ((i = t.original_price) == null ? void 0 : i[e.code]) ?? Object.values(t.original_price ?? {})[0] ?? 0, a = ((l = t.price) == null ? void 0 : l[e.code]) ?? Object.values(t.price ?? {})[0] ?? 0, r = n > 0 ? Math.round((n - a) / n * 100) : 0, m = r > 0 ? `-${r}%` : "0%";
118
+ const e = b(), n = ((i = t.original_price) == null ? void 0 : i[e.code]) ?? Object.values(t.original_price ?? {})[0] ?? 0, s = ((l = t.price) == null ? void 0 : l[e.code]) ?? Object.values(t.price ?? {})[0] ?? 0, a = n > 0 ? Math.round((n - s) / n * 100) : 0, m = a > 0 ? `-${a}%` : "0%";
119
119
  return `
120
120
  <tr>
121
121
  <td
@@ -1,60 +1,66 @@
1
- import { ATTR_CUSTOM_PREFIX as u, ATTR_PRODUCT_IMAGE as m, ATTR_PRODUCT_NAME as b, ATTR_PRODUCT_OLD_PRICE as T, ATTR_PRODUCT_PRICE as _, ATTR_PRODUCT_OMNIBUS_PRICE as g, ATTR_PRODUCT_OMNIBUS_DISCOUNT as C, ATTR_PRODUCT_BUTTON as f } from "../constants/selectors.js";
2
- function U(t) {
1
+ import { ATTR_CUSTOM_PREFIX as d, ATTR_PRODUCT_IMAGE as u, ATTR_PRODUCT_NAME as p, ATTR_PRODUCT_OLD_PRICE as m, ATTR_PRODUCT_PRICE as b, ATTR_PRODUCT_OMNIBUS_PRICE as T, ATTR_PRODUCT_OMNIBUS_DISCOUNT as _, ATTR_PRODUCT_BUTTON as g } from "../constants/selectors.js";
2
+ function y(t) {
3
3
  return t.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
4
4
  }
5
- function R(t, e) {
5
+ function U(t) {
6
+ const e = Array.isArray(t) ? t[t.length - 1] : t;
7
+ if (typeof e == "string")
8
+ return e;
9
+ if (typeof e == "number")
10
+ return String(e);
11
+ }
12
+ function C(t, e) {
6
13
  const n = Object.values(e).find((r) => r.attributeName === t);
7
14
  return (n == null ? void 0 : n.type) === "defaultAttribute";
8
15
  }
9
- function y(t, e) {
10
- return R(t, e) ? t : `product_attribute.${t}`;
16
+ function h(t, e) {
17
+ return C(t, e) ? t : `product_attribute.${t}`;
11
18
  }
12
19
  const P = Symbol("customCellHtml");
13
- function S(t, e, n = {}) {
20
+ function L(t, e, n = {}) {
14
21
  const r = t[P];
15
22
  if (!r)
16
23
  return { ...t };
17
- const l = { ...t };
18
- return e.filter((o) => o.startsWith(u) && !l[o]).forEach((o) => {
19
- const s = o.substring(u.length), a = U(s), D = y(s, n), O = R(s, n);
20
- l[o] = (d) => {
21
- var p;
22
- const i = O ? d[s] : (p = d.product_attributes) == null ? void 0 : p[s];
23
- let c = a;
24
- return typeof i == "string" ? c = i : typeof i == "number" && (c = String(i)), r(D, c);
24
+ const i = { ...t };
25
+ return e.filter((o) => o.startsWith(d) && !i[o]).forEach((o) => {
26
+ const s = o.substring(d.length), l = y(s), A = h(s, n), R = C(s, n);
27
+ i[o] = (c) => {
28
+ var a;
29
+ const D = R ? c[s] : (a = c.product_attributes) == null ? void 0 : a[s], O = U(D) ?? l;
30
+ return r(A, O);
25
31
  };
26
- }), l;
32
+ }), i;
27
33
  }
28
- const L = {
34
+ const M = {
29
35
  TITLE: "You May Also Like!"
30
- }, M = [
36
+ }, $ = [
37
+ u,
38
+ p,
31
39
  m,
32
40
  b,
33
41
  T,
34
42
  _,
35
- g,
36
- C,
37
- f
38
- ], $ = {
39
- [m]: !0,
43
+ g
44
+ ], w = {
45
+ [u]: !0,
46
+ [p]: !0,
40
47
  [b]: !0,
41
- [_]: !0,
42
- [T]: !0,
43
- [g]: !1,
44
- [C]: !1,
45
- [f]: !0
46
- }, h = `
48
+ [m]: !0,
49
+ [T]: !1,
50
+ [_]: !1,
51
+ [g]: !0
52
+ }, I = `
47
53
  <tr>
48
54
  <td class="spacer" style="height: 10px;"></td>
49
55
  </tr>
50
- `, A = "https://email-static.useinsider.com/stripo/modules/email-recommendation-v3/assets/images/image-placeholder.png";
51
- function w(t) {
52
- return !t || typeof t != "string" || t.trim() === "" ? A : t.startsWith("http://") ? t.replace("http://", "https://") : t;
56
+ `, f = "https://email-static.useinsider.com/stripo/modules/email-recommendation-v3/assets/images/image-placeholder.png";
57
+ function N(t) {
58
+ return !t || typeof t != "string" || t.trim() === "" ? f : t.startsWith("http://") ? t.replace("http://", "https://") : t;
53
59
  }
54
- function I(t) {
60
+ function E(t) {
55
61
  return {
56
62
  name: "Product Name",
57
- image_url: A,
63
+ image_url: f,
58
64
  price: { USD: 18 },
59
65
  original_price: { USD: 20 },
60
66
  discount: { USD: 2 },
@@ -66,13 +72,13 @@ function I(t) {
66
72
  category: []
67
73
  };
68
74
  }
69
- function N(t = 6) {
75
+ function k(t = 6) {
70
76
  return Array.from(
71
77
  { length: t },
72
- (e, n) => I(String(n + 1))
78
+ (e, n) => E(String(n + 1))
73
79
  );
74
80
  }
75
- function k(t = "grid", e) {
81
+ function x(t = "grid", e) {
76
82
  const n = t === "list" ? `
77
83
  data-layout="list"` : "", r = e ? ` ${e}` : "";
78
84
  return `
@@ -110,7 +116,7 @@ function k(t = "grid", e) {
110
116
  </table>
111
117
  </td>
112
118
  </tr>
113
- ${h}
119
+ ${I}
114
120
  <tr>
115
121
  <td>
116
122
  <table
@@ -150,16 +156,17 @@ function k(t = "grid", e) {
150
156
  }
151
157
  export {
152
158
  P as CUSTOM_CELL_HTML,
153
- L as DEFAULTS,
154
- M as DEFAULT_CARD_COMPOSITION,
155
- $ as DEFAULT_CARD_VISIBILITY,
156
- A as PLACEHOLDER_IMAGE,
157
- S as buildElementRenderer,
158
- k as createBlockTemplate,
159
- N as getDefaultProducts,
160
- R as isDefaultAttribute,
161
- y as resolveProductAttrValue,
162
- w as sanitizeImageUrl,
163
- h as spacer,
164
- U as toDisplayName
159
+ M as DEFAULTS,
160
+ $ as DEFAULT_CARD_COMPOSITION,
161
+ w as DEFAULT_CARD_VISIBILITY,
162
+ f as PLACEHOLDER_IMAGE,
163
+ L as buildElementRenderer,
164
+ x as createBlockTemplate,
165
+ k as getDefaultProducts,
166
+ C as isDefaultAttribute,
167
+ h as resolveProductAttrValue,
168
+ N as sanitizeImageUrl,
169
+ I as spacer,
170
+ y as toDisplayName,
171
+ U as toDisplayableAttributeValue
165
172
  };
@@ -0,0 +1,21 @@
1
+ const i = [
2
+ "ozonebg",
3
+ "ozonehr",
4
+ "ozonero",
5
+ "ozoneinfo",
6
+ "babybg",
7
+ "ozongr",
8
+ "iboodat",
9
+ "iboodbe",
10
+ "iboodde",
11
+ "iboodfr",
12
+ "iboodnl",
13
+ "iboodpl"
14
+ ], r = ["interencheres", "interencherespreprod"], d = ["lodenfrey", "lodenfreyuat"], c = "manualMerchandising";
15
+ function s(e, n) {
16
+ const o = {};
17
+ return i.includes(e) && (o.excludePurchaseDay = "30", o.userId = "{user_id}"), r.includes(e) && (o.hp = "1"), d.includes(e) && n === c && (o.includeOutOfStockItems = "true"), o;
18
+ }
19
+ export {
20
+ s as getPartnerRecommendationParams
21
+ };
@@ -1,29 +1,29 @@
1
- function d(a, t) {
2
- const { thousandSeparator: s, decimalSeparator: e, decimalCount: r } = t, u = Math.abs(a).toFixed(r), [c, o] = u.split("."), n = c.replace(
1
+ function d(c, t) {
2
+ const { thousandSeparator: i, decimalSeparator: e, decimalCount: r } = t, [u, o = ""] = String(c).split("."), n = o.slice(0, r).padEnd(r, "0"), a = u.replace(
3
3
  /\B(?=(\d{3})+(?!\d))/g,
4
- s
5
- ), i = a < 0 ? "-" : "";
6
- return r > 0 && o ? `${i}${n}${e}${o}` : `${i}${n}`;
4
+ i
5
+ );
6
+ return r > 0 && n ? `${a}${e}${n}` : a;
7
7
  }
8
- function m(a) {
9
- const { price: t, currency: s } = a, {
8
+ function f(c) {
9
+ const { price: t, currency: i } = c, {
10
10
  symbol: e,
11
11
  alignment: r,
12
12
  thousandSeparator: u,
13
- decimalSeparator: c,
14
- decimalCount: o
15
- } = s;
13
+ decimalSeparator: o,
14
+ decimalCount: n
15
+ } = i;
16
16
  if (typeof t != "number" || Number.isNaN(t)) {
17
- const i = "0".repeat(o), $ = `0${c}${i}`;
18
- return r === "before" ? `${e} ${$}` : `${$} ${e}`;
17
+ const s = "0".repeat(n), m = `0${o}${s}`;
18
+ return r === "before" ? `${e} ${m}` : `${m} ${e}`;
19
19
  }
20
- const n = d(t, {
20
+ const a = d(t, {
21
21
  thousandSeparator: u,
22
- decimalSeparator: c,
23
- decimalCount: o
22
+ decimalSeparator: o,
23
+ decimalCount: n
24
24
  });
25
- return r === "before" ? `${e} ${n}` : `${n} ${e}`;
25
+ return r === "before" ? `${e} ${a}` : `${a} ${e}`;
26
26
  }
27
27
  export {
28
- m as formatPrice
28
+ f as formatPrice
29
29
  };