@useinsider/guido 3.6.0-beta.4f2bf14 → 3.6.0-beta.596b70e

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 (39) hide show
  1. package/dist/composables/useRecommendation.js +34 -33
  2. package/dist/composables/useStripoEventHandler.js +11 -13
  3. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +50 -48
  4. package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +24 -32
  5. package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +34 -40
  6. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +310 -338
  7. package/dist/extensions/Blocks/Recommendation/extension.js +6 -5
  8. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +3 -2
  9. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +13 -9
  10. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +117 -146
  11. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +49 -30
  12. package/dist/extensions/Blocks/Recommendation/templates/index.js +9 -8
  13. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +110 -83
  14. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +31 -21
  15. package/dist/extensions/Blocks/Recommendation/templates/utils.js +90 -54
  16. package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +139 -0
  17. package/dist/extensions/Blocks/Recommendation/utils/partnerCustomizations.js +21 -0
  18. package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +24 -19
  19. package/dist/extensions/Blocks/Recommendation/utils/tagName.js +20 -16
  20. package/dist/extensions/Blocks/controlFactories.js +159 -133
  21. package/dist/src/extensions/Blocks/Items/controls/index.d.ts +1 -1
  22. package/dist/src/extensions/Blocks/Recommendation/controls/button/index.d.ts +1 -1
  23. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +20 -47
  24. package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +4 -4
  25. package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +1 -1
  26. package/dist/src/extensions/Blocks/Recommendation/templates/list/elementRenderer.test.d.ts +1 -0
  27. package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +3 -2
  28. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +127 -11
  29. package/dist/src/extensions/Blocks/Recommendation/templates/utils.test.d.ts +1 -0
  30. package/dist/src/extensions/Blocks/Recommendation/utils/captureStyleTemplates.d.ts +44 -0
  31. package/dist/src/extensions/Blocks/Recommendation/utils/captureStyleTemplates.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/preserveTextStyles.d.ts +15 -0
  34. package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.test.d.ts +1 -0
  35. package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +20 -9
  36. package/dist/src/extensions/Blocks/controlFactories.d.ts +11 -1
  37. package/package.json +1 -1
  38. package/dist/src/extensions/Blocks/Recommendation/utils/stylePreserver.d.ts +0 -113
  39. /package/dist/src/{composables/useStripoEventHandler.test.d.ts → extensions/Blocks/Recommendation/templates/grid/elementRenderer.test.d.ts} +0 -0
@@ -1,10 +1,11 @@
1
- import { RecommendationBlockId as o } from "../../constants/blockIds.js";
2
- import { ATTR_PRODUCT_ATTR as u, ATTR_PRODUCT_BUTTON as c, CSS_CLASS_RECO_BUTTON as d, ATTR_PRODUCT_IMAGE as p, ATTR_PRODUCT_OMNIBUS_DISCOUNT as g, ATTR_PRODUCT_OMNIBUS_PRICE as f, ATTR_PRODUCT_OLD_PRICE as T, ATTR_PRODUCT_PRICE as x, ATTR_PRODUCT_NAME as _ } from "../../constants/selectors.js";
3
- import { useRecommendationExtensionStore as C } from "../../store/recommendation.js";
4
- import { formatPrice as R } from "../../utils/priceFormatter.js";
5
- import { CUSTOM_CELL_HTML as O, sanitizeImageUrl as $ } from "../utils.js";
6
- function b() {
7
- const t = C(), { currencySettings: e } = t.recommendationConfigs;
1
+ import { RecommendationBlockId as l } from "../../constants/blockIds.js";
2
+ import { ATTR_PRODUCT_ATTR as $, ATTR_PRODUCT_BUTTON as g, CSS_CLASS_RECO_BUTTON as m, ATTR_PRODUCT_OMNIBUS_DISCOUNT as S, ATTR_PRODUCT_OMNIBUS_PRICE as C, ATTR_PRODUCT_OLD_PRICE as x, ATTR_PRODUCT_PRICE as R, ATTR_PRODUCT_NAME as O, ATTR_PRODUCT_IMAGE as b } from "../../constants/selectors.js";
3
+ import { useRecommendationExtensionStore as U } from "../../store/recommendation.js";
4
+ import { formatPrice as k } from "../../utils/priceFormatter.js";
5
+ import { CUSTOM_CELL_HTML as p, renderStyledParagraph as s, cellBgStyleAttr as n, DEFAULT_BUTTON_BORDER_STYLE as B, renderButtonLabel as E, DEFAULT_BUTTON_ANCHOR_STYLE as A, resolveButtonBorderClass as P, resolvePStyle as _, DEFAULT_IMG_STYLE as I, sanitizeImageUrl as h } from "../utils.js";
6
+ const L = `${A} padding: 5px 30px;`;
7
+ function y() {
8
+ const r = U(), { currencySettings: e } = r.recommendationConfigs;
8
9
  return {
9
10
  code: e.value,
10
11
  symbol: e.symbol,
@@ -14,119 +15,151 @@ function b() {
14
15
  thousandSeparator: e.thousandSeparator
15
16
  };
16
17
  }
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;
19
- return R({
20
- price: r,
21
- currency: n
18
+ function o(r, e = "price") {
19
+ const t = y(), a = r[e], c = (a == null ? void 0 : a[t.code]) ?? Object.values(a ?? {})[0] ?? 0;
20
+ return k({
21
+ price: c,
22
+ currency: t
22
23
  });
23
24
  }
24
- const I = {
25
+ const z = {
25
26
  /**
26
27
  * Image cell - left column (120px fixed width)
27
28
  * Has recommendation-attribute-row class and data attributes for Card Composition control
28
29
  */
29
- [p]: (t) => `
30
+ [b]: (r, e) => {
31
+ var a;
32
+ const t = ((a = e == null ? void 0 : e.styleTemplate) == null ? void 0 : a.imgStyle) ?? I;
33
+ return `
30
34
  <td
31
35
  width="120"
32
36
  class="esd-block-image product-image-cell recommendation-attribute-row es-p5"
33
- esd-extension-block-id="${o.IMAGE}"
34
- data-attribute-type="${p}"
37
+ esd-extension-block-id="${l.IMAGE}"
38
+ data-attribute-type="${b}"
35
39
  data-visibility="1"
36
40
  align="center"
37
41
  valign="middle">
38
- <a target="_blank" href="${t.url}" class="${d}">
42
+ <a target="_blank" href="${r.url}" class="${m}">
39
43
  <img
40
- src="${$(t.image_url)}"
41
- alt="${t.name}"
42
- style="display: block; max-width: 100%; height: auto;"
44
+ src="${h(r.image_url)}"
45
+ alt="${r.name}"
46
+ style="${t}"
43
47
  class="adapt-img product-image">
44
48
  </a>
45
49
  </td>
46
- `,
50
+ `;
51
+ },
47
52
  /**
48
53
  * Name element - row for info cell table
49
54
  */
50
- [_]: (t) => `
55
+ [O]: (r, e) => {
56
+ const t = s(
57
+ r.name,
58
+ {
59
+ pStyle: "font-size: 16px; color: #333333; font-weight: 600; margin: 0;",
60
+ openTags: "<strong>",
61
+ closeTags: "</strong>"
62
+ },
63
+ e == null ? void 0 : e.styleTemplate
64
+ );
65
+ return `
51
66
  <tr>
52
67
  <td
53
68
  class="esd-block-text product-name"
54
- esd-extension-block-id="${o.NAME}"
69
+ esd-extension-block-id="${l.NAME}"${n(e == null ? void 0 : e.cellBackgroundColor)}
55
70
  align="left">
56
- <p contenteditable="false" style="font-size: 16px; color: #333333; font-weight: 600; margin: 0;">
57
- <strong>${t.name}</strong>
58
- </p>
71
+ ${t}
59
72
  </td>
60
73
  </tr>
61
- `,
74
+ `;
75
+ },
62
76
  /**
63
77
  * Price element - row for info cell table
64
78
  */
65
- [x]: (t) => `
79
+ [R]: (r, e) => {
80
+ const t = s(
81
+ o(r, "price"),
82
+ {
83
+ pStyle: "font-size: 16px; color: #333333; font-weight: bold; margin: 0;",
84
+ openTags: "<strong>",
85
+ closeTags: "</strong>"
86
+ },
87
+ e == null ? void 0 : e.styleTemplate
88
+ );
89
+ return `
66
90
  <tr>
67
91
  <td
68
92
  class="esd-block-text product-price"
69
- esd-extension-block-id="${o.PRICE}"
93
+ esd-extension-block-id="${l.PRICE}"${n(e == null ? void 0 : e.cellBackgroundColor)}
70
94
  align="left">
71
- <p contenteditable="false" style="font-size: 16px; color: #333333; font-weight: bold; margin: 0;">
72
- <strong>${s(t, "price")}</strong>
73
- </p>
95
+ ${t}
74
96
  </td>
75
97
  </tr>
76
- `,
98
+ `;
99
+ },
77
100
  /**
78
101
  * Old price element - row for info cell table
79
102
  */
80
- [T]: (t) => `
103
+ [x]: (r, e) => {
104
+ const t = s(
105
+ o(r, "original_price"),
106
+ {
107
+ pStyle: "font-size: 14px; color: #999999; text-decoration: line-through; margin: 0;",
108
+ openTags: "<strong>",
109
+ closeTags: "</strong>"
110
+ },
111
+ e == null ? void 0 : e.styleTemplate
112
+ );
113
+ return `
81
114
  <tr>
82
115
  <td
83
116
  class="esd-block-text product-old-price"
84
- esd-extension-block-id="${o.OLD_PRICE}"
117
+ esd-extension-block-id="${l.OLD_PRICE}"${n(e == null ? void 0 : e.cellBackgroundColor)}
85
118
  align="left">
86
- <p
87
- contenteditable="false"
88
- style="font-size: 14px; color: #999999; text-decoration: line-through; margin: 0;">
89
- <strong>${s(t, "original_price")}</strong>
90
- </p>
119
+ ${t}
91
120
  </td>
92
121
  </tr>
93
- `,
122
+ `;
123
+ },
94
124
  /**
95
125
  * Omnibus price element - row for info cell table
96
126
  */
97
- [f]: (t) => `
127
+ [C]: (r, e) => {
128
+ const t = _("font-size: 12px; color: #666666; margin: 0;", e == null ? void 0 : e.styleTemplate);
129
+ return `
98
130
  <tr>
99
131
  <td
100
132
  class="esd-block-text product-omnibus-price"
101
133
  data-text-before="Lowest 30-day price: "
102
134
  data-text-after=""
103
- esd-extension-block-id="${o.OMNIBUS_PRICE}"
135
+ esd-extension-block-id="${l.OMNIBUS_PRICE}"${n(e == null ? void 0 : e.cellBackgroundColor)}
104
136
  align="left">
105
- <p contenteditable="false" style="font-size: 12px; color: #666666; margin: 0;">
137
+ <p contenteditable="false" style="${t}">
106
138
  <span class="omnibus-text-before">Lowest 30-day price: </span>
107
- <span class="omnibus-price-value">${s(t, "original_price")}</span>
139
+ <span class="omnibus-price-value">${o(r, "original_price")}</span>
108
140
  <span class="omnibus-text-after"></span>
109
141
  </p>
110
142
  </td>
111
143
  </tr>
112
- `,
144
+ `;
145
+ },
113
146
  /**
114
147
  * Omnibus discount element - row for info cell table
115
148
  */
116
- [g]: (t) => {
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%";
149
+ [S]: (r, e) => {
150
+ var u, T;
151
+ const t = _("font-size: 12px; color: #666666; margin: 0;", e == null ? void 0 : e.styleTemplate), a = y(), c = ((u = r.original_price) == null ? void 0 : u[a.code]) ?? Object.values(r.original_price ?? {})[0] ?? 0, d = ((T = r.price) == null ? void 0 : T[a.code]) ?? Object.values(r.price ?? {})[0] ?? 0, i = c > 0 ? Math.round((c - d) / c * 100) : 0, f = i > 0 ? `-${i}%` : "0%";
119
152
  return `
120
153
  <tr>
121
154
  <td
122
155
  class="esd-block-text product-omnibus-discount"
123
156
  data-text-before=""
124
157
  data-text-after=""
125
- esd-extension-block-id="${o.OMNIBUS_DISCOUNT}"
158
+ esd-extension-block-id="${l.OMNIBUS_DISCOUNT}"${n(e == null ? void 0 : e.cellBackgroundColor)}
126
159
  align="left">
127
- <p contenteditable="false" style="font-size: 12px; color: #666666; margin: 0;">
160
+ <p contenteditable="false" style="${t}">
128
161
  <span class="omnibus-text-before"></span>
129
- <span class="omnibus-discount-value">${m}</span>
162
+ <span class="omnibus-discount-value">${f}</span>
130
163
  <span class="omnibus-text-after"></span>
131
164
  </p>
132
165
  </td>
@@ -137,60 +170,54 @@ const I = {
137
170
  * Button cell - right column (100px fixed width)
138
171
  * Has recommendation-attribute-row class and data attributes for Card Composition control
139
172
  */
140
- [c]: (t) => `
173
+ [g]: (r, e) => {
174
+ const t = e == null ? void 0 : e.styleTemplate, a = (t == null ? void 0 : t.buttonBorderStyle) ?? B, c = (t == null ? void 0 : t.buttonAnchorStyle) ?? L, d = E("Buy", t);
175
+ return `
141
176
  <td
142
177
  width="100"
143
178
  class="esd-block-button button-cell recommendation-attribute-row product-button es-p5l es-p5r"
144
- esd-extension-block-id="${o.BUTTON}"
145
- data-attribute-type="${c}"
179
+ esd-extension-block-id="${l.BUTTON}"
180
+ data-attribute-type="${g}"
146
181
  data-visibility="1"
147
182
  align="center"
148
183
  valign="middle">
149
- <span
150
- class="es-button-border"
151
- style="
152
- border-width: 1px;
153
- background: rgb(217, 234, 211);
154
- border-color: rgb(106, 168, 79);
155
- ">
184
+ <span class="${P(t)}" style="${a}">
156
185
  <a
157
- href="${t.url}"
186
+ href="${r.url}"
158
187
  target="_blank"
159
- class="es-button ${d}"
160
- style="
161
- color: rgb(56, 118, 29);
162
- background: rgb(217, 234, 211);
163
- font-family: arial, 'helvetica neue', helvetica, sans-serif;
164
- font-size: 16px;
165
- font-weight: normal;
166
- line-height: 120%;
167
- padding: 5px 30px;
168
- mso-border-alt: 10px solid rgb(217, 234, 211);
169
- mso-padding-alt: 0;
170
- ">
171
- Buy
188
+ class="es-button ${m}"
189
+ style="${c}">
190
+ ${d}
172
191
  </a>
173
192
  </span>
174
193
  </td>
175
- `,
194
+ `;
195
+ },
176
196
  /**
177
197
  * Custom attribute row template — same tr-td structure as Name, Price, etc.
178
198
  * Used by `buildElementRenderer` for `customAttr:*` composition entries.
179
199
  * @param productAttrValue - Resolved product-attr value (e.g., "brand" for default, "product_attribute.rating_star" for custom)
180
200
  * @param content - Display content for the cell
181
201
  */
182
- [O]: (t, e) => `
202
+ [p]: (r, e, t) => {
203
+ const a = s(
204
+ e,
205
+ { pStyle: "font-size: 12px; color: #666666; margin: 0;", openTags: "", closeTags: "" },
206
+ t == null ? void 0 : t.styleTemplate
207
+ );
208
+ return `
183
209
  <tr>
184
210
  <td
185
- ${u}="${t}"
211
+ ${$}="${r}"
186
212
  class="esd-block-text product-custom-attribute"
187
- esd-extension-block-id="${o.CUSTOM_ATTRIBUTE}"
213
+ esd-extension-block-id="${l.CUSTOM_ATTRIBUTE}"${n(t == null ? void 0 : t.cellBackgroundColor)}
188
214
  align="left">
189
- <p contenteditable="false" style="font-size: 12px; color: #666666; margin: 0;">${e}</p>
215
+ ${a}
190
216
  </td>
191
217
  </tr>
192
- `
218
+ `;
219
+ }
193
220
  };
194
221
  export {
195
- I as listElementRenderer
222
+ z as listElementRenderer
196
223
  };
@@ -1,22 +1,23 @@
1
- import { ATTR_PRODUCT_IMAGE as a, ATTR_PRODUCT_BUTTON as d } from "../../constants/selectors.js";
2
- import { DEFAULT_CARD_COMPOSITION as b, spacer as m, buildElementRenderer as C, DEFAULT_CARD_VISIBILITY as T } from "../utils.js";
3
- import { listElementRenderer as f } from "./elementRenderer.js";
4
- function R(r, n, l) {
5
- const t = l ? "" : ' style="display: none;"', o = r.replace(/<tr>/, "").replace(/<\/tr>/, "");
1
+ import { ATTR_PRODUCT_IMAGE as s, ATTR_PRODUCT_BUTTON as p } from "../../constants/selectors.js";
2
+ import { buildSpacer as T, DEFAULT_CARD_COMPOSITION as f, buildElementRenderer as g, DEFAULT_CARD_VISIBILITY as w } from "../utils.js";
3
+ import { listElementRenderer as E } from "./elementRenderer.js";
4
+ const I = "0 5px";
5
+ function O(e, n, o) {
6
+ const l = o ? "" : ' style="display: none;"', i = e.replace(/<tr>/, "").replace(/<\/tr>/, "");
6
7
  return `<tr
7
8
  class="recommendation-attribute-row"
8
9
  data-attribute-type="${n}"
9
- data-visibility="${l ? "1" : "0"}"${t}>${o}</tr>`;
10
+ data-visibility="${o ? "1" : "0"}"${l}>${i}</tr>`;
10
11
  }
11
12
  const y = `
12
13
  <tr class="recommendation-product-row">
13
- <td style="padding: 0 5px;">
14
+ <td style="padding: {-{-CARD_PADDING-}-};">
14
15
  <table
15
16
  width="100%"
16
17
  cellpadding="0"
17
18
  cellspacing="0"
18
19
  border="0"
19
- class="product-card-wrapper">
20
+ class="product-card-wrapper"{-{-WRAPPER_STYLE-}-}>
20
21
  <tbody>
21
22
  <tr>
22
23
  {-{-PRODUCT_CONTENT-}-}
@@ -26,29 +27,38 @@ const y = `
26
27
  </td>
27
28
  </tr>
28
29
  `;
29
- function O(r, n = b, l = {}) {
30
- const t = C(f, n, l), o = t[a](r), c = `
30
+ function S(e, n = f, o = {}, l = {}) {
31
+ const {
32
+ cellPadding: i = I,
33
+ styleTemplates: t,
34
+ cardBackgroundColor: a,
35
+ cellBackgroundColors: c
36
+ } = l, u = a ? ` style="background-color: ${a};"` : "", d = g(E, n, o), R = { styleTemplate: t == null ? void 0 : t[s] }, C = d[s](e, R), b = `
31
37
  <td class="product-info-cell" valign="middle" style="padding: 15px;">
32
38
  <table cellpadding="0" cellspacing="0" role="presentation" width="100%" style="table-layout: fixed;">
33
39
  <tbody>
34
- ${n.filter((e) => e !== a && e !== d).filter((e) => t[e]).map((e) => {
35
- const u = T[e] ?? !0;
36
- return R(t[e](r), e, u);
40
+ ${n.filter((r) => r !== s && r !== p).filter((r) => d[r]).map((r) => {
41
+ const A = w[r] ?? !0, P = d[r](e, {
42
+ styleTemplate: t == null ? void 0 : t[r],
43
+ cellBackgroundColor: c == null ? void 0 : c[r]
44
+ });
45
+ return O(P, r, A);
37
46
  }).join(`
38
47
  `)}
39
48
  </tbody>
40
49
  </table>
41
50
  </td>
42
- `, s = t[d](r), p = o + c + s;
43
- return y.replace("{-{-PRODUCT_CONTENT-}-}", p);
51
+ `, D = { styleTemplate: t == null ? void 0 : t[p] }, _ = d[p](e, D), m = C + b + _;
52
+ return y.replace("{-{-CARD_PADDING-}-}", i).replace("{-{-WRAPPER_STYLE-}-}", u).replace("{-{-PRODUCT_CONTENT-}-}", m);
44
53
  }
45
- function D(r, n, l = {}) {
46
- return r.map((t, o) => {
47
- const i = O(t, n, l);
48
- return o > 0 ? m + i : i;
54
+ function x(e, n, o = {}, l = {}) {
55
+ const i = T(l.rowSpacingPx);
56
+ return e.map((t, a) => {
57
+ const c = S(t, n, o, l);
58
+ return a > 0 ? i + c : c;
49
59
  }).join("");
50
60
  }
51
61
  export {
52
- O as getListProductCard,
53
- D as prepareProductRows
62
+ S as getListProductCard,
63
+ x as prepareProductRows
54
64
  };
@@ -1,57 +1,82 @@
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 b, ATTR_PRODUCT_IMAGE as T, ATTR_PRODUCT_NAME as g, ATTR_PRODUCT_OLD_PRICE as p, ATTR_PRODUCT_PRICE as _, ATTR_PRODUCT_OMNIBUS_PRICE as f, ATTR_PRODUCT_OMNIBUS_DISCOUNT as m, ATTR_PRODUCT_BUTTON as C } from "../constants/selectors.js";
2
+ function D(t) {
3
3
  return t.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
4
4
  }
5
- function R(t, e) {
6
- const n = Object.values(e).find((r) => r.attributeName === t);
5
+ function h(t, e) {
6
+ const n = Object.values(e).find((o) => o.attributeName === t);
7
7
  return (n == null ? void 0 : n.type) === "defaultAttribute";
8
8
  }
9
- function y(t, e) {
10
- return R(t, e) ? t : `product_attribute.${t}`;
9
+ function O(t, e) {
10
+ return h(t, e) ? t : `product_attribute.${t}`;
11
11
  }
12
- const P = Symbol("customCellHtml");
13
- function S(t, e, n = {}) {
14
- const r = t[P];
15
- if (!r)
12
+ const U = Symbol("customCellHtml");
13
+ function N(t, e, n = {}) {
14
+ const o = t[U];
15
+ if (!o)
16
16
  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);
17
+ const s = { ...t };
18
+ return e.filter((r) => r.startsWith(b) && !s[r]).forEach((r) => {
19
+ const i = r.substring(b.length), a = D(i), R = O(i, n), y = h(i, n);
20
+ s[r] = (d, S) => {
21
+ var u;
22
+ const c = y ? d[i] : (u = d.product_attributes) == null ? void 0 : u[i];
23
+ let l = a;
24
+ return typeof c == "string" ? l = c : typeof c == "number" && (l = String(c)), o(R, l, S);
25
25
  };
26
- }), l;
26
+ }), s;
27
27
  }
28
- const L = {
28
+ const B = {
29
29
  TITLE: "You May Also Like!"
30
30
  }, M = [
31
- m,
32
- b,
33
31
  T,
34
- _,
35
32
  g,
36
- C,
37
- f
38
- ], $ = {
39
- [m]: !0,
40
- [b]: !0,
41
- [_]: !0,
33
+ p,
34
+ _,
35
+ f,
36
+ m,
37
+ C
38
+ ], k = {
42
39
  [T]: !0,
43
- [g]: !1,
44
- [C]: !1,
45
- [f]: !0
46
- }, h = `
40
+ [g]: !0,
41
+ [_]: !0,
42
+ [p]: !0,
43
+ [f]: !1,
44
+ [m]: !1,
45
+ [C]: !0
46
+ }, E = 10;
47
+ function P(t = E) {
48
+ return `
47
49
  <tr>
48
- <td class="spacer" style="height: 10px;"></td>
50
+ <td class="spacer" style="height: ${t}px;"></td>
49
51
  </tr>
50
- `, A = "https://email-static.useinsider.com/stripo/modules/email-recommendation-v3/assets/images/image-placeholder.png";
51
- function w(t) {
52
+ `;
53
+ }
54
+ const I = P();
55
+ function L(t, e) {
56
+ return e ? e.pStyle ?? "" : t;
57
+ }
58
+ function v(t, e, n) {
59
+ const o = L(e.pStyle, n), s = n ? n.openTags ?? "" : e.openTags, r = n ? n.closeTags ?? "" : e.closeTags;
60
+ return `<p contenteditable="false" style="${o}">${s}${t}${r}</p>`;
61
+ }
62
+ function x(t, e) {
63
+ const n = [];
64
+ return t && n.push(t), e && n.push(`background-color: ${e};`), n.join(" ");
65
+ }
66
+ function F(t) {
67
+ return t ? ` style="background-color: ${t};"` : "";
68
+ }
69
+ function H(t, e) {
70
+ return `${(e == null ? void 0 : e.openTags) ?? ""}${t}${(e == null ? void 0 : e.closeTags) ?? ""}`;
71
+ }
72
+ function W(t) {
73
+ return t != null && t.buttonFitToContainer ? "es-button-border es-fw" : "es-button-border";
74
+ }
75
+ const Y = "display: block; max-width: 100%; height: auto;", G = "border-width: 1px; background: rgb(217, 234, 211); border-color: rgb(106, 168, 79);", z = "color: rgb(56, 118, 29); background: rgb(217, 234, 211); font-family: arial, 'helvetica neue', helvetica, sans-serif; font-size: 16px; font-weight: normal; line-height: 120%; mso-border-alt: 10px solid rgb(217, 234, 211); mso-padding-alt: 0;", A = "https://email-static.useinsider.com/stripo/modules/email-recommendation-v3/assets/images/image-placeholder.png";
76
+ function V(t) {
52
77
  return !t || typeof t != "string" || t.trim() === "" ? A : t.startsWith("http://") ? t.replace("http://", "https://") : t;
53
78
  }
54
- function I(t) {
79
+ function $(t) {
55
80
  return {
56
81
  name: "Product Name",
57
82
  image_url: A,
@@ -66,19 +91,19 @@ function I(t) {
66
91
  category: []
67
92
  };
68
93
  }
69
- function N(t = 6) {
94
+ function j(t = 6) {
70
95
  return Array.from(
71
96
  { length: t },
72
- (e, n) => I(String(n + 1))
97
+ (e, n) => $(String(n + 1))
73
98
  );
74
99
  }
75
- function k(t = "grid", e) {
100
+ function X(t = "grid", e) {
76
101
  const n = t === "list" ? `
77
- data-layout="list"` : "", r = e ? ` ${e}` : "";
102
+ data-layout="list"` : "", o = e ? ` ${e}` : "";
78
103
  return `
79
104
  <td
80
105
  align="left"
81
- class="${`recommendation-block-v2 esd-block-recommendation-v3-block es-p20${t === "list" ? " es-m-p0 ins-recommendation-list-layout" : ""}${r}`}"${n}>
106
+ class="${`recommendation-block-v2 esd-block-recommendation-v3-block es-p20${t === "list" ? " es-m-p0 ins-recommendation-list-layout" : ""}${o}`}"${n}>
82
107
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
83
108
  <tr>
84
109
  <td align="center">
@@ -110,7 +135,7 @@ function k(t = "grid", e) {
110
135
  </table>
111
136
  </td>
112
137
  </tr>
113
- ${h}
138
+ ${I}
114
139
  <tr>
115
140
  <td>
116
141
  <table
@@ -149,17 +174,28 @@ function k(t = "grid", e) {
149
174
  `;
150
175
  }
151
176
  export {
152
- P as CUSTOM_CELL_HTML,
153
- L as DEFAULTS,
177
+ U as CUSTOM_CELL_HTML,
178
+ B as DEFAULTS,
179
+ z as DEFAULT_BUTTON_ANCHOR_STYLE,
180
+ G as DEFAULT_BUTTON_BORDER_STYLE,
154
181
  M as DEFAULT_CARD_COMPOSITION,
155
- $ as DEFAULT_CARD_VISIBILITY,
182
+ k as DEFAULT_CARD_VISIBILITY,
183
+ Y as DEFAULT_IMG_STYLE,
184
+ E as DEFAULT_ROW_SPACING_PX,
156
185
  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
186
+ N as buildElementRenderer,
187
+ P as buildSpacer,
188
+ F as cellBgStyleAttr,
189
+ X as createBlockTemplate,
190
+ j as getDefaultProducts,
191
+ h as isDefaultAttribute,
192
+ H as renderButtonLabel,
193
+ v as renderStyledParagraph,
194
+ W as resolveButtonBorderClass,
195
+ L as resolvePStyle,
196
+ O as resolveProductAttrValue,
197
+ x as resolveSegmentBgStyle,
198
+ V as sanitizeImageUrl,
199
+ I as spacer,
200
+ D as toDisplayName
165
201
  };