@useinsider/guido 3.8.2-beta.189e91c → 3.8.2

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 (43) hide show
  1. package/dist/@types/config/schemas.js +66 -70
  2. package/dist/composables/usePreviewMode.js +14 -15
  3. package/dist/config/compiler/recommendationCompilerRules.js +1 -1
  4. package/dist/config/compiler/utils/recommendationCompilerUtils.js +80 -88
  5. package/dist/config/migrator/recommendation/htmlBuilder.js +52 -53
  6. package/dist/config/migrator/recommendation/settingsMapper.js +33 -38
  7. package/dist/extensions/Blocks/Recommendation/block.js +41 -60
  8. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +32 -41
  9. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +264 -345
  10. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +87 -99
  11. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +160 -162
  12. package/dist/extensions/Blocks/Recommendation/extension.js +29 -30
  13. package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +7 -21
  14. package/dist/extensions/Blocks/Recommendation/recommendation.css.js +4 -64
  15. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +1 -3
  16. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +96 -130
  17. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +54 -43
  18. package/dist/extensions/Blocks/Recommendation/templates/index.js +14 -17
  19. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +80 -86
  20. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +40 -31
  21. package/dist/extensions/Blocks/Recommendation/templates/utils.js +102 -155
  22. package/dist/src/@types/config/schemas.d.ts +0 -16
  23. package/dist/src/composables/useConfig.d.ts +0 -4
  24. package/dist/src/config/migrator/recommendation/settingsMapper.d.ts +1 -1
  25. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +0 -10
  26. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +3 -29
  27. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -1
  28. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +1 -3
  29. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -2
  30. package/dist/src/extensions/Blocks/Recommendation/templates/grid/elementRenderer.d.ts +1 -13
  31. package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +4 -4
  32. package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +1 -1
  33. package/dist/src/extensions/Blocks/Recommendation/templates/list/elementRenderer.d.ts +1 -10
  34. package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +3 -3
  35. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +1 -51
  36. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +0 -15
  37. package/dist/src/stores/config.d.ts +0 -36
  38. package/package.json +1 -1
  39. package/dist/composables/useRecommendationPreview.js +0 -111
  40. package/dist/extensions/Blocks/Recommendation/canvasPreview.css.js +0 -16
  41. package/dist/extensions/Blocks/Recommendation/controls/main/pricePlacement.js +0 -133
  42. package/dist/src/composables/useRecommendationPreview.d.ts +0 -10
  43. package/dist/src/extensions/Blocks/Recommendation/controls/main/pricePlacement.d.ts +0 -59
@@ -1,37 +1,34 @@
1
1
  import "../constants/selectors.js";
2
- import { DEFAULT_PRODUCTS_PER_ROW as w } from "../constants/layout.js";
3
- import { prepareProductRows as g } from "./grid/template.js";
4
- import { prepareProductRows as C } from "./list/template.js";
5
- import "../store/recommendation.js";
6
- function b(o, t, r = {}) {
2
+ import { DEFAULT_PRODUCTS_PER_ROW as f } from "../constants/layout.js";
3
+ import { prepareProductRows as w } from "./grid/template.js";
4
+ import { prepareProductRows as g } from "./list/template.js";
5
+ function O(o, t, r = {}) {
7
6
  const {
8
- cellPadding: i,
9
- rowSpacingPx: s,
7
+ cellPadding: s,
8
+ rowSpacingPx: i,
10
9
  styleTemplates: c,
11
10
  cardBackgroundColor: l,
12
11
  cellBackgroundColors: p,
13
12
  cellAlignments: n,
14
13
  cellClasses: a,
15
14
  omnibusTexts: m,
16
- visibility: d,
17
- priceInline: u
15
+ visibility: d
18
16
  } = r, e = {
19
- cellPadding: i,
20
- rowSpacingPx: s,
17
+ cellPadding: s,
18
+ rowSpacingPx: i,
21
19
  styleTemplates: c,
22
20
  cardBackgroundColor: l,
23
21
  cellBackgroundColors: p,
24
22
  cellAlignments: n,
25
23
  cellClasses: a,
26
24
  omnibusTexts: m,
27
- visibility: d,
28
- priceInline: u
25
+ visibility: d
29
26
  };
30
27
  if (t === "list")
31
- return C(o, r.composition, r.filterList, e);
32
- const { productsPerRow: P = w, composition: R, filterList: f } = r;
33
- return g(o, P, R, f, e);
28
+ return g(o, r.composition, r.filterList, e);
29
+ const { productsPerRow: u = f, composition: P, filterList: R } = r;
30
+ return w(o, u, P, R, e);
34
31
  }
35
32
  export {
36
- b as prepareProductRows
33
+ O as prepareProductRows
37
34
  };
@@ -1,60 +1,48 @@
1
1
  import { RecommendationBlockId as t } from "../../constants/blockIds.js";
2
- import { ATTR_PRODUCT_ATTR as U, ATTR_PRODUCT_BUTTON as x, CSS_CLASS_RECO_BUTTON as y, ATTR_PRODUCT_OMNIBUS_DISCOUNT as E, ATTR_PRODUCT_OMNIBUS_PRICE as B, ATTR_PRODUCT_OLD_PRICE as I, ATTR_PRODUCT_PRICE as L, ATTR_PRODUCT_NAME as D, ATTR_PRODUCT_IMAGE as R } from "../../constants/selectors.js";
3
- import { formatProductPrice as m, bgColorFragment as f, renderStyledParagraph as T, CUSTOM_CELL_HTML as P, cellBgStyleAttr as $, DEFAULT_BUTTON_BORDER_STYLE as h, renderButtonLabel as N, DEFAULT_BUTTON_ANCHOR_STYLE as v, resolveButtonBorderClass as M, resolvePStyle as A, getCurrentCurrencyConfig as w, resolveOmnibusText as S, isSamePrice as z, DEFAULT_IMG_STYLE as F, sanitizeImageUrl as G } from "../utils.js";
4
- const H = `${v} padding: 5px 30px;`, k = {
5
- pStyle: "font-size: 16px; color: #333333; font-weight: bold; margin: 0;",
6
- openTags: "<strong>",
7
- closeTags: "</strong>"
8
- }, n = {
9
- pStyle: "font-size: 14px; color: #999999; margin: 0;",
10
- openTags: "<s><strong>",
11
- closeTags: "</strong></s>"
12
- };
13
- function q(a, e = !0, l, r) {
14
- const c = m(a, "price"), d = m(a, "original_price"), b = c === d, s = (g) => `<td
15
- class="esd-block-text product-price"
16
- esd-extension-block-id="${t.PRICE}"
17
- align="${(l == null ? void 0 : l.cellAlignment) ?? "left"}"
18
- valign="middle"
19
- style="width: auto;${g}${f(l == null ? void 0 : l.cellBackgroundColor)}">
20
- ${T(c, k, l == null ? void 0 : l.styleTemplate)}
21
- </td>`, u = (g) => `<td
22
- class="esd-block-text product-old-price"
23
- esd-extension-block-id="${t.OLD_PRICE}"
24
- data-same-price="${b}"
25
- align="${(r == null ? void 0 : r.cellAlignment) ?? "left"}"
26
- valign="middle"
27
- style="width: auto;${g}${f(r == null ? void 0 : r.cellBackgroundColor)}">
28
- ${T(d, n, r == null ? void 0 : r.styleTemplate)}
29
- </td>`, C = e ? u(" padding-right: 8px;") : s(" padding-right: 8px;"), _ = e ? s("") : u("");
30
- return `
31
- <tr>
32
- ${C}
33
- ${_}
34
- </tr>
35
- `;
2
+ import { ATTR_PRODUCT_ATTR as R, ATTR_PRODUCT_BUTTON as C, CSS_CLASS_RECO_BUTTON as _, ATTR_PRODUCT_OMNIBUS_DISCOUNT as A, ATTR_PRODUCT_OMNIBUS_PRICE as U, ATTR_PRODUCT_OLD_PRICE as k, ATTR_PRODUCT_PRICE as B, ATTR_PRODUCT_NAME as E, ATTR_PRODUCT_IMAGE as f } from "../../constants/selectors.js";
3
+ import { useRecommendationExtensionStore as P } from "../../store/recommendation.js";
4
+ import { formatPrice as I } from "../../utils/priceFormatter.js";
5
+ import { CUSTOM_CELL_HTML as h, renderStyledParagraph as u, cellBgStyleAttr as d, DEFAULT_BUTTON_BORDER_STYLE as L, renderButtonLabel as N, DEFAULT_BUTTON_ANCHOR_STYLE as D, resolveButtonBorderClass as v, resolvePStyle as y, resolveOmnibusText as S, DEFAULT_IMG_STYLE as M, sanitizeImageUrl as w } from "../utils.js";
6
+ const z = `${D} padding: 5px 30px;`;
7
+ function x() {
8
+ const r = P(), { currencySettings: e } = r.recommendationConfigs;
9
+ return {
10
+ code: e.value,
11
+ symbol: e.symbol,
12
+ alignment: e.alignment === "0" ? "before" : "after",
13
+ decimalCount: parseInt(e.decimalCount) || 2,
14
+ decimalSeparator: e.decimalSeparator,
15
+ thousandSeparator: e.thousandSeparator
16
+ };
17
+ }
18
+ function T(r, e = "price") {
19
+ const l = x(), a = r[e], c = (a == null ? void 0 : a[l.code]) ?? Object.values(a ?? {})[0] ?? 0;
20
+ return I({
21
+ price: c,
22
+ currency: l
23
+ });
36
24
  }
37
- const J = {
25
+ const V = {
38
26
  /**
39
27
  * Image cell - left column (120px fixed width)
40
28
  * Has recommendation-attribute-row class and data attributes for Card Composition control
41
29
  */
42
- [R]: (a, e) => {
43
- var r;
44
- const l = ((r = e == null ? void 0 : e.styleTemplate) == null ? void 0 : r.imgStyle) ?? F;
30
+ [f]: (r, e) => {
31
+ var a;
32
+ const l = ((a = e == null ? void 0 : e.styleTemplate) == null ? void 0 : a.imgStyle) ?? M;
45
33
  return `
46
34
  <td
47
35
  width="120"
48
36
  class="esd-block-image product-image-cell recommendation-attribute-row es-p5"
49
37
  esd-extension-block-id="${t.IMAGE}"
50
- data-attribute-type="${R}"
38
+ data-attribute-type="${f}"
51
39
  data-visibility="1"
52
40
  align="center"
53
41
  valign="middle">
54
- <a target="_blank" href="${a.url}" class="${y}">
42
+ <a target="_blank" href="${r.url}" class="${_}">
55
43
  <img
56
- src="${G(a.image_url)}"
57
- alt="${a.name}"
44
+ src="${w(r.image_url)}"
45
+ alt="${r.name}"
58
46
  style="${l}"
59
47
  class="adapt-img product-image">
60
48
  </a>
@@ -64,9 +52,9 @@ const J = {
64
52
  /**
65
53
  * Name element - row for info cell table
66
54
  */
67
- [D]: (a, e) => {
68
- const l = T(
69
- a.name,
55
+ [E]: (r, e) => {
56
+ const l = u(
57
+ r.name,
70
58
  {
71
59
  pStyle: "font-size: 16px; color: #333333; font-weight: 600; margin: 0;",
72
60
  openTags: "<strong>",
@@ -78,7 +66,7 @@ const J = {
78
66
  <tr>
79
67
  <td
80
68
  class="esd-block-text product-name${e != null && e.cellClasses ? ` ${e.cellClasses}` : ""}"
81
- esd-extension-block-id="${t.NAME}"${$(e == null ? void 0 : e.cellBackgroundColor)}
69
+ esd-extension-block-id="${t.NAME}"${d(e == null ? void 0 : e.cellBackgroundColor)}
82
70
  align="${(e == null ? void 0 : e.cellAlignment) ?? "left"}">
83
71
  ${l}
84
72
  </td>
@@ -88,17 +76,21 @@ const J = {
88
76
  /**
89
77
  * Price element - row for info cell table
90
78
  */
91
- [L]: (a, e) => {
92
- const l = T(
93
- m(a, "price"),
94
- k,
79
+ [B]: (r, e) => {
80
+ const l = u(
81
+ T(r, "price"),
82
+ {
83
+ pStyle: "font-size: 16px; color: #333333; font-weight: bold; margin: 0;",
84
+ openTags: "<strong>",
85
+ closeTags: "</strong>"
86
+ },
95
87
  e == null ? void 0 : e.styleTemplate
96
88
  );
97
89
  return `
98
90
  <tr>
99
91
  <td
100
92
  class="esd-block-text product-price${e != null && e.cellClasses ? ` ${e.cellClasses}` : ""}"
101
- esd-extension-block-id="${t.PRICE}"${$(e == null ? void 0 : e.cellBackgroundColor)}
93
+ esd-extension-block-id="${t.PRICE}"${d(e == null ? void 0 : e.cellBackgroundColor)}
102
94
  align="${(e == null ? void 0 : e.cellAlignment) ?? "left"}">
103
95
  ${l}
104
96
  </td>
@@ -108,18 +100,21 @@ const J = {
108
100
  /**
109
101
  * Old price element - row for info cell table
110
102
  */
111
- [I]: (a, e) => {
112
- const l = T(
113
- m(a, "original_price"),
114
- n,
103
+ [k]: (r, e) => {
104
+ const l = u(
105
+ T(r, "original_price"),
106
+ {
107
+ pStyle: "font-size: 14px; color: #999999; margin: 0;",
108
+ openTags: "<s><strong>",
109
+ closeTags: "</strong></s>"
110
+ },
115
111
  e == null ? void 0 : e.styleTemplate
116
112
  );
117
113
  return `
118
114
  <tr>
119
115
  <td
120
116
  class="esd-block-text product-old-price${e != null && e.cellClasses ? ` ${e.cellClasses}` : ""}"
121
- esd-extension-block-id="${t.OLD_PRICE}"
122
- data-same-price="${z(a)}"${$(e == null ? void 0 : e.cellBackgroundColor)}
117
+ esd-extension-block-id="${t.OLD_PRICE}"${d(e == null ? void 0 : e.cellBackgroundColor)}
123
118
  align="${(e == null ? void 0 : e.cellAlignment) ?? "left"}">
124
119
  ${l}
125
120
  </td>
@@ -129,19 +124,19 @@ const J = {
129
124
  /**
130
125
  * Omnibus price element - row for info cell table
131
126
  */
132
- [B]: (a, e) => {
133
- const l = A("font-size: 12px; color: #666666; margin: 0;", e == null ? void 0 : e.styleTemplate), { before: r, after: c } = S(e == null ? void 0 : e.omnibusText, "Lowest 30-day price: ");
127
+ [U]: (r, e) => {
128
+ const l = y("font-size: 12px; color: #666666; margin: 0;", e == null ? void 0 : e.styleTemplate), { before: a, after: c } = S(e == null ? void 0 : e.omnibusText, "Lowest 30-day price: ");
134
129
  return `
135
130
  <tr>
136
131
  <td
137
132
  class="esd-block-text product-omnibus-price${e != null && e.cellClasses ? ` ${e.cellClasses}` : ""}"
138
- data-text-before="${r}"
133
+ data-text-before="${a}"
139
134
  data-text-after="${c}"
140
- esd-extension-block-id="${t.OMNIBUS_PRICE}"${$(e == null ? void 0 : e.cellBackgroundColor)}
135
+ esd-extension-block-id="${t.OMNIBUS_PRICE}"${d(e == null ? void 0 : e.cellBackgroundColor)}
141
136
  align="${(e == null ? void 0 : e.cellAlignment) ?? "left"}">
142
137
  <p contenteditable="false" style="${l}">
143
- <span class="omnibus-text-before">${r}</span>
144
- <span class="omnibus-price-value">${m(a, "original_price")}</span>
138
+ <span class="omnibus-text-before">${a}</span>
139
+ <span class="omnibus-price-value">${T(r, "original_price")}</span>
145
140
  <span class="omnibus-text-after">${c}</span>
146
141
  </p>
147
142
  </td>
@@ -151,21 +146,21 @@ const J = {
151
146
  /**
152
147
  * Omnibus discount element - row for info cell table
153
148
  */
154
- [E]: (a, e) => {
155
- var _, g;
156
- const l = A("font-size: 12px; color: #666666; margin: 0;", e == null ? void 0 : e.styleTemplate), r = w(), c = ((_ = a.original_price) == null ? void 0 : _[r.code]) ?? Object.values(a.original_price ?? {})[0] ?? 0, d = ((g = a.price) == null ? void 0 : g[r.code]) ?? Object.values(a.price ?? {})[0] ?? 0, b = c > 0 ? Math.round((c - d) / c * 100) : 0, s = b > 0 ? `-${b}%` : "0%", { before: u, after: C } = S(e == null ? void 0 : e.omnibusText);
149
+ [A]: (r, e) => {
150
+ var b, n;
151
+ const l = y("font-size: 12px; color: #666666; margin: 0;", e == null ? void 0 : e.styleTemplate), a = x(), c = ((b = r.original_price) == null ? void 0 : b[a.code]) ?? Object.values(r.original_price ?? {})[0] ?? 0, s = ((n = r.price) == null ? void 0 : n[a.code]) ?? Object.values(r.price ?? {})[0] ?? 0, g = c > 0 ? Math.round((c - s) / c * 100) : 0, O = g > 0 ? `-${g}%` : "0%", { before: m, after: $ } = S(e == null ? void 0 : e.omnibusText);
157
152
  return `
158
153
  <tr>
159
154
  <td
160
155
  class="esd-block-text product-omnibus-discount${e != null && e.cellClasses ? ` ${e.cellClasses}` : ""}"
161
- data-text-before="${u}"
162
- data-text-after="${C}"
163
- esd-extension-block-id="${t.OMNIBUS_DISCOUNT}"${$(e == null ? void 0 : e.cellBackgroundColor)}
156
+ data-text-before="${m}"
157
+ data-text-after="${$}"
158
+ esd-extension-block-id="${t.OMNIBUS_DISCOUNT}"${d(e == null ? void 0 : e.cellBackgroundColor)}
164
159
  align="${(e == null ? void 0 : e.cellAlignment) ?? "left"}">
165
160
  <p contenteditable="false" style="${l}">
166
- <span class="omnibus-text-before">${u}</span>
167
- <span class="omnibus-discount-value">${s}</span>
168
- <span class="omnibus-text-after">${C}</span>
161
+ <span class="omnibus-text-before">${m}</span>
162
+ <span class="omnibus-discount-value">${O}</span>
163
+ <span class="omnibus-text-after">${$}</span>
169
164
  </p>
170
165
  </td>
171
166
  </tr>
@@ -175,24 +170,24 @@ const J = {
175
170
  * Button cell - right column (100px fixed width)
176
171
  * Has recommendation-attribute-row class and data attributes for Card Composition control
177
172
  */
178
- [x]: (a, e) => {
179
- const l = e == null ? void 0 : e.styleTemplate, r = (l == null ? void 0 : l.buttonBorderStyle) ?? h, c = (l == null ? void 0 : l.buttonAnchorStyle) ?? H, d = N((l == null ? void 0 : l.buttonText) ?? "Buy", l);
173
+ [C]: (r, e) => {
174
+ const l = e == null ? void 0 : e.styleTemplate, a = (l == null ? void 0 : l.buttonBorderStyle) ?? L, c = (l == null ? void 0 : l.buttonAnchorStyle) ?? z, s = N((l == null ? void 0 : l.buttonText) ?? "Buy", l);
180
175
  return `
181
176
  <td
182
177
  width="100"
183
178
  class="esd-block-button button-cell recommendation-attribute-row product-button ${(e == null ? void 0 : e.cellClasses) ?? "es-p5l es-p5r"}"
184
179
  esd-extension-block-id="${t.BUTTON}"
185
- data-attribute-type="${x}"
180
+ data-attribute-type="${C}"
186
181
  data-visibility="1"
187
182
  align="${(e == null ? void 0 : e.cellAlignment) ?? "center"}"
188
183
  valign="middle">
189
- <span class="${M(l)}" style="${r}">
184
+ <span class="${v(l)}" style="${a}">
190
185
  <a
191
- href="${a.url}"
186
+ href="${r.url}"
192
187
  target="_blank"
193
- class="es-button ${y}"
188
+ class="es-button ${_}"
194
189
  style="${c}">
195
- ${d}
190
+ ${s}
196
191
  </a>
197
192
  </span>
198
193
  </td>
@@ -204,8 +199,8 @@ const J = {
204
199
  * @param productAttrValue - Resolved product-attr value (e.g., "brand" for default, "product_attribute.rating_star" for custom)
205
200
  * @param content - Display content for the cell
206
201
  */
207
- [P]: (a, e, l) => {
208
- const r = T(
202
+ [h]: (r, e, l) => {
203
+ const a = u(
209
204
  e,
210
205
  { pStyle: "font-size: 12px; color: #666666; margin: 0;", openTags: "", closeTags: "" },
211
206
  l == null ? void 0 : l.styleTemplate
@@ -213,17 +208,16 @@ const J = {
213
208
  return `
214
209
  <tr>
215
210
  <td
216
- ${U}="${a}"
211
+ ${R}="${r}"
217
212
  class="esd-block-text product-custom-attribute${l != null && l.cellClasses ? ` ${l.cellClasses}` : ""}"
218
- esd-extension-block-id="${t.CUSTOM_ATTRIBUTE}"${$(l == null ? void 0 : l.cellBackgroundColor)}
213
+ esd-extension-block-id="${t.CUSTOM_ATTRIBUTE}"${d(l == null ? void 0 : l.cellBackgroundColor)}
219
214
  align="${(l == null ? void 0 : l.cellAlignment) ?? "left"}">
220
- ${r}
215
+ ${a}
221
216
  </td>
222
217
  </tr>
223
218
  `;
224
219
  }
225
220
  };
226
221
  export {
227
- J as listElementRenderer,
228
- q as renderInlineListPriceRow
222
+ V as listElementRenderer
229
223
  };
@@ -1,15 +1,15 @@
1
- import { ATTR_PRODUCT_IMAGE as p, ATTR_PRODUCT_BUTTON as C, ATTR_PRODUCT_OLD_PRICE as f, ATTR_PRODUCT_PRICE as m } from "../../constants/selectors.js";
2
- import { buildSpacer as I, DEFAULT_CARD_COMPOSITION as g, buildElementRenderer as E, buildCellOptions as a, resolveInlinePriceOrder as w, DEFAULT_CARD_VISIBILITY as y } from "../utils.js";
3
- import { listElementRenderer as L, renderInlineListPriceRow as O } from "./elementRenderer.js";
4
- const S = "0 5px";
5
- function U(l, r, n) {
6
- const e = n ? "" : ' style="display: none;"', o = l.replace(/<tr>/, "").replace(/<\/tr>/, "");
1
+ import { ATTR_PRODUCT_IMAGE as b, ATTR_PRODUCT_BUTTON as s } from "../../constants/selectors.js";
2
+ import { buildSpacer as I, DEFAULT_CARD_COMPOSITION as O, buildElementRenderer as T, DEFAULT_CARD_VISIBILITY as S } from "../utils.js";
3
+ import { listElementRenderer as N } from "./elementRenderer.js";
4
+ const L = "0 5px";
5
+ function U(n, r, e) {
6
+ const l = e ? "" : ' style="display: none;"', a = n.replace(/<tr>/, "").replace(/<\/tr>/, "");
7
7
  return `<tr
8
8
  class="recommendation-attribute-row"
9
9
  data-attribute-type="${r}"
10
- data-visibility="${n ? "1" : "0"}"${e}>${o}</tr>`;
10
+ data-visibility="${e ? "1" : "0"}"${l}>${a}</tr>`;
11
11
  }
12
- const N = `
12
+ const $ = `
13
13
  <tr class="recommendation-product-row">
14
14
  <td style="padding: {-{-CARD_PADDING-}-};">
15
15
  <table
@@ -27,40 +27,49 @@ const N = `
27
27
  </td>
28
28
  </tr>
29
29
  `;
30
- function $(l, r = g, n = {}, e = {}) {
30
+ function x(n, r = O, e = {}, l = {}) {
31
31
  const {
32
- cellPadding: o = S,
33
- cardBackgroundColor: d,
34
- visibility: c,
35
- priceInline: i = !1
36
- } = e, u = d ? ` style="background-color: ${d};"` : "", s = E(L, r, n), P = s[p](l, a(p, e)), R = w(r), T = `
32
+ cellPadding: a = L,
33
+ styleTemplates: o,
34
+ cardBackgroundColor: p,
35
+ cellBackgroundColors: c,
36
+ cellAlignments: d,
37
+ cellClasses: i,
38
+ omnibusTexts: R,
39
+ visibility: C
40
+ } = l, D = p ? ` style="background-color: ${p};"` : "", u = T(N, r, e), _ = { styleTemplate: o == null ? void 0 : o[b] }, P = u[b](n, _), m = `
37
41
  <td class="product-info-cell" valign="middle" style="padding: 15px;">
38
42
  <table cellpadding="0" cellspacing="0" role="presentation" width="100%" style="table-layout: fixed;">
39
43
  <tbody>
40
- ${r.filter((t) => t !== p && t !== C).filter((t) => !(i && t === R.skip)).filter((t) => s[t]).map((t) => {
41
- const b = (c == null ? void 0 : c[t]) ?? y[t] ?? !0, A = i && t === R.anchor ? O(
42
- l,
43
- R.originalFirst,
44
- a(m, e),
45
- a(f, e)
46
- ) : s[t](l, a(t, e));
47
- return U(A, t, b);
44
+ ${r.filter((t) => t !== b && t !== s).filter((t) => u[t]).map((t) => {
45
+ const w = (C == null ? void 0 : C[t]) ?? S[t] ?? !0, E = u[t](n, {
46
+ styleTemplate: o == null ? void 0 : o[t],
47
+ cellBackgroundColor: c == null ? void 0 : c[t],
48
+ cellAlignment: d == null ? void 0 : d[t],
49
+ cellClasses: i == null ? void 0 : i[t],
50
+ omnibusText: R == null ? void 0 : R[t]
51
+ });
52
+ return U(E, t, w);
48
53
  }).join(`
49
54
  `)}
50
55
  </tbody>
51
56
  </table>
52
57
  </td>
53
- `, _ = s[C](l, a(C, e)), D = P + T + _;
54
- return N.replace("{-{-CARD_PADDING-}-}", o).replace("{-{-WRAPPER_STYLE-}-}", u).replace("{-{-PRODUCT_CONTENT-}-}", D);
58
+ `, A = {
59
+ styleTemplate: o == null ? void 0 : o[s],
60
+ cellAlignment: d == null ? void 0 : d[s],
61
+ cellClasses: i == null ? void 0 : i[s]
62
+ }, f = u[s](n, A), g = P + m + f;
63
+ return $.replace("{-{-CARD_PADDING-}-}", a).replace("{-{-WRAPPER_STYLE-}-}", D).replace("{-{-PRODUCT_CONTENT-}-}", g);
55
64
  }
56
- function W(l, r, n = {}, e = {}) {
57
- const o = I(e.rowSpacingPx);
58
- return l.map((d, c) => {
59
- const i = $(d, r, n, e);
60
- return c > 0 ? o + i : i;
65
+ function B(n, r, e = {}, l = {}) {
66
+ const a = I(l.rowSpacingPx);
67
+ return n.map((o, p) => {
68
+ const c = x(o, r, e, l);
69
+ return p > 0 ? a + c : c;
61
70
  }).join("");
62
71
  }
63
72
  export {
64
- $ as getListProductCard,
65
- W as prepareProductRows
73
+ x as getListProductCard,
74
+ B as prepareProductRows
66
75
  };