@useinsider/guido 3.15.0 → 3.16.0-beta.0faee0c

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 (81) hide show
  1. package/dist/@types/config/schemas.js +108 -92
  2. package/dist/components/Guido.vue.js +1 -1
  3. package/dist/components/Guido.vue2.js +78 -75
  4. package/dist/composables/useActionsApi.js +30 -22
  5. package/dist/composables/useEmailTemplateApplier.js +25 -23
  6. package/dist/composables/useHtmlValidator.js +108 -106
  7. package/dist/composables/useStripo.js +30 -29
  8. package/dist/composables/useTimerClone.js +21 -19
  9. package/dist/config/i18n/en/labels.json.js +7 -3
  10. package/dist/config/migrator/checkboxMigrator.js +20 -19
  11. package/dist/config/migrator/radioButtonMigrator.js +26 -25
  12. package/dist/config/migrator/recommendation/compositionMapper.js +26 -23
  13. package/dist/config/migrator/recommendation/htmlBuilder.js +156 -155
  14. package/dist/extensions/Blocks/Checkbox/constants/controlIds.js +4 -0
  15. package/dist/extensions/Blocks/Checkbox/constants/selectors.js +6 -0
  16. package/dist/extensions/Blocks/Checkbox/controls/blockBackground/index.js +10 -0
  17. package/dist/extensions/Blocks/Checkbox/extension.js +6 -5
  18. package/dist/extensions/Blocks/Checkbox/settingsPanel.js +15 -14
  19. package/dist/extensions/Blocks/Checkbox/template.js +10 -9
  20. package/dist/extensions/Blocks/Items/block.js +44 -42
  21. package/dist/extensions/Blocks/Items/template.js +86 -86
  22. package/dist/extensions/Blocks/RadioButton/constants/controlIds.js +4 -0
  23. package/dist/extensions/Blocks/RadioButton/constants/selectors.js +6 -0
  24. package/dist/extensions/Blocks/RadioButton/controls/blockBackground/index.js +10 -0
  25. package/dist/extensions/Blocks/RadioButton/extension.js +5 -4
  26. package/dist/extensions/Blocks/RadioButton/settingsPanel.js +12 -11
  27. package/dist/extensions/Blocks/RadioButton/template.js +16 -9
  28. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +18 -15
  29. package/dist/extensions/Blocks/Recommendation/controls/cardBackground/index.js +5 -9
  30. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +363 -322
  31. package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +8 -8
  32. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +271 -231
  33. package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +98 -113
  34. package/dist/extensions/Blocks/Recommendation/recommendation.css.js +21 -0
  35. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +16 -16
  36. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +16 -16
  37. package/dist/extensions/Blocks/Recommendation/templates/utils.js +120 -120
  38. package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +55 -54
  39. package/dist/extensions/Blocks/Recommendation/utils/compositionKeys.js +89 -0
  40. package/dist/extensions/Blocks/common-control.js +42 -35
  41. package/dist/extensions/Blocks/controlFactories.js +117 -115
  42. package/dist/guido.css +1 -1
  43. package/dist/library.js +11 -7
  44. package/dist/node_modules/valibot/dist/index.js +230 -216
  45. package/dist/public/trackingIds.js +8 -0
  46. package/dist/src/@types/config/schemas.d.ts +20 -0
  47. package/dist/src/composables/useActionsApi.d.ts +1 -1
  48. package/dist/src/composables/useConfig.d.ts +4 -0
  49. package/dist/src/composables/useHtmlValidator.d.ts +3 -2
  50. package/dist/src/config/migrator/recommendation/types.d.ts +1 -0
  51. package/dist/src/extensions/Blocks/Checkbox/constants/controlIds.d.ts +7 -0
  52. package/dist/src/extensions/Blocks/Checkbox/constants/index.d.ts +10 -0
  53. package/dist/src/extensions/Blocks/Checkbox/constants/selectors.d.ts +16 -0
  54. package/dist/src/extensions/Blocks/Checkbox/controls/blockBackground/index.d.ts +14 -0
  55. package/dist/src/extensions/Blocks/RadioButton/constants/controlIds.d.ts +7 -0
  56. package/dist/src/extensions/Blocks/RadioButton/constants/index.d.ts +10 -0
  57. package/dist/src/extensions/Blocks/RadioButton/constants/selectors.d.ts +16 -0
  58. package/dist/src/extensions/Blocks/RadioButton/controls/blockBackground/index.d.ts +14 -0
  59. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  60. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +6 -0
  61. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +27 -5
  62. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +4 -2
  63. package/dist/src/extensions/Blocks/Recommendation/controls/spacing/index.d.ts +5 -0
  64. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +12 -11
  65. package/dist/src/extensions/Blocks/Recommendation/utils/compositionKeys.d.ts +47 -0
  66. package/dist/src/extensions/Blocks/_Boilerplate/constants/controlIds.d.ts +7 -0
  67. package/dist/src/extensions/Blocks/_Boilerplate/constants/index.d.ts +10 -0
  68. package/dist/src/extensions/Blocks/_Boilerplate/constants/selectors.d.ts +16 -0
  69. package/dist/src/extensions/Blocks/_Boilerplate/controls/blockBackground/index.d.ts +14 -0
  70. package/dist/src/extensions/Blocks/common-control.d.ts +3 -1
  71. package/dist/src/library.d.ts +1 -0
  72. package/dist/src/public/trackingIds.d.ts +9 -0
  73. package/dist/src/stores/config.d.ts +36 -0
  74. package/dist/src/stores/editor.d.ts +25 -0
  75. package/dist/src/utils/linkTrackingIds.d.ts +30 -0
  76. package/dist/stores/editor.js +4 -1
  77. package/dist/stores/onboarding.js +11 -7
  78. package/dist/utils/linkTrackingIds.js +56 -0
  79. package/dist/utils/pairProductVariables.js +105 -99
  80. package/dist/utils/templatePreparation.js +72 -61
  81. package/package.json +5 -1
@@ -1,14 +1,15 @@
1
1
  import { RecommendationBlockId as g } from "../../../extensions/Blocks/Recommendation/constants/blockIds.js";
2
- import { CSS_CLASS_SKIP_COMPILE as ot, CURRENCY_ATTR as P, ATTR_PRODUCT_IMAGE as O, ATTR_PRODUCT_BUTTON as k, CSS_CLASS_RECO_BUTTON as H, ATTR_PRODUCT_NAME as j, ATTR_PRODUCT_PRICE as V, ATTR_PRODUCT_OLD_PRICE as Y, ATTR_PRODUCT_OMNIBUS_PRICE as M, ATTR_PRODUCT_OMNIBUS_DISCOUNT as F, ATTR_CUSTOM_PREFIX as E } from "../../../extensions/Blocks/Recommendation/constants/selectors.js";
3
- import { formatPrice as L } from "../../../extensions/Blocks/Recommendation/utils/priceFormatter.js";
4
- import { escapeHtml as c } from "../../../utils/htmlEscape.js";
2
+ import { CSS_CLASS_SKIP_COMPILE as st, CURRENCY_ATTR as _, ATTR_PRODUCT_IMAGE as I, ATTR_PRODUCT_BUTTON as O, CSS_CLASS_RECO_BUTTON as z, ATTR_PRODUCT_NAME as H, ATTR_PRODUCT_PRICE as j, ATTR_PRODUCT_OLD_PRICE as V, ATTR_PRODUCT_OMNIBUS_PRICE as L, ATTR_PRODUCT_OMNIBUS_DISCOUNT as Y, ATTR_CUSTOM_PREFIX as F } from "../../../extensions/Blocks/Recommendation/constants/selectors.js";
3
+ import { compositionKeyToProductAttr as K, bareAttributeName as J } from "../../../extensions/Blocks/Recommendation/utils/compositionKeys.js";
4
+ import { formatPrice as B } from "../../../extensions/Blocks/Recommendation/utils/priceFormatter.js";
5
+ import { escapeHtml as r } from "../../../utils/htmlEscape.js";
5
6
  import { appendStyle as $ } from "./themeMapper.js";
6
- const J = "https://email-static.useinsider.com/stripo/modules/email-recommendation-v3/assets/images/image-placeholder.png", K = "attribute-cell", X = "Buy", q = "border-width: 1px; background: rgb(217, 234, 211); border-color: rgb(106, 168, 79)", Q = "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", nt = "ins-recommendation-product-container ins-recommendation-desktop-container";
7
- function lt(t) {
7
+ const X = "https://email-static.useinsider.com/stripo/modules/email-recommendation-v3/assets/images/image-placeholder.png", q = "attribute-cell", Q = "Buy", Z = "border-width: 1px; background: rgb(217, 234, 211); border-color: rgb(106, 168, 79)", W = "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", lt = "ins-recommendation-product-container ins-recommendation-desktop-container";
8
+ function it(t) {
8
9
  return t.replace(/>\s+</g, "><").trim();
9
10
  }
10
11
  function y(t) {
11
- return t ? ` align="${c(t)}"` : ' align="center"';
12
+ return t ? ` align="${r(t)}"` : ' align="center"';
12
13
  }
13
14
  function R() {
14
15
  return {
@@ -19,25 +20,25 @@ function R() {
19
20
  textTrimming: !1
20
21
  };
21
22
  }
22
- function Z(t) {
23
+ function tt(t) {
23
24
  return t ? { ...t, wrapBold: !0 } : { ...R(), wrapBold: !0 };
24
25
  }
25
- function v(t, o) {
26
- let e = c(t);
26
+ function k(t, o) {
27
+ let e = r(t);
27
28
  return o.wrapBold && o.wrapItalic ? e = `<strong><em>${e}</em></strong>` : o.wrapBold ? e = `<strong>${e}</strong>` : o.wrapItalic && (e = `<em>${e}</em>`), e;
28
29
  }
29
30
  function u(t) {
30
- return t ? ` style="${c(t)}"` : "";
31
+ return t ? ` style="${r(t)}"` : "";
31
32
  }
32
- function I(t, o) {
33
- return `<td width="${t}%" class="${K}" ${o}`;
33
+ function E(t, o) {
34
+ return `<td width="${t}%" class="${q}" ${o}`;
34
35
  }
35
- function st(t, o, e, l) {
36
- const s = t.width ? ` width="${t.width}"` : "", n = t.height ? ` height="${t.height}"` : "", i = ["display: block", "max-width: 100%", "height: auto"];
36
+ function rt(t, o, e, s) {
37
+ const l = t.width ? ` width="${t.width}"` : "", n = t.height ? ` height="${t.height}"` : "", i = ["display: block", "max-width: 100%", "height: auto"];
37
38
  t.width && i.push(`width: ${t.width}px`), t.height && i.push(`height: ${t.height}px`);
38
- const r = i.join("; "), a = e ? ` style="background-color: ${c(e)}"` : "";
39
+ const c = i.join("; "), a = e ? ` style="background-color: ${r(e)}"` : "";
39
40
  return `
40
- ${I(l, 'valign="top" style="padding: 0 5px; height: 100%"')}>
41
+ ${E(s, 'valign="top" style="padding: 0 5px; height: 100%"')}>
41
42
  <table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0"
42
43
  class="product-card-segment"${a}>
43
44
  <tbody>
@@ -46,9 +47,9 @@ function st(t, o, e, l) {
46
47
  class="esd-block-image product-image es-p5"
47
48
  esd-extension-block-id="${g.IMAGE}">
48
49
  <a target="_blank" href="https://example.com/product/${o + 1}">
49
- <img src="${J}" alt="Product Name"
50
- class="adapt-img"${s}${n}
51
- style="${r}">
50
+ <img src="${X}" alt="Product Name"
51
+ class="adapt-img"${l}${n}
52
+ style="${c}">
52
53
  </a>
53
54
  </td>
54
55
  </tr>
@@ -57,10 +58,10 @@ function st(t, o, e, l) {
57
58
  </td>
58
59
  `;
59
60
  }
60
- function G(t, o, e, l, s, n, i) {
61
- const a = `table-layout: fixed${n ? `; background-color: ${c(n)}` : ""}`, d = u(s.tdStyle), p = y(s.align), b = `esd-block-text ${o}`.trim(), m = $(l, s.pStyle);
61
+ function D(t, o, e, s, l, n, i) {
62
+ const a = `table-layout: fixed${n ? `; background-color: ${r(n)}` : ""}`, d = u(l.tdStyle), p = y(l.align), b = `esd-block-text ${o}`.trim(), m = $(s, l.pStyle);
62
63
  return `
63
- ${I(i, 'valign="top" style="padding: 0 5px; height: 100%"')}>
64
+ ${E(i, 'valign="top" style="padding: 0 5px; height: 100%"')}>
64
65
  <table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0"
65
66
  class="product-card-segment" style="${a}">
66
67
  <tbody>
@@ -68,7 +69,7 @@ function G(t, o, e, l, s, n, i) {
68
69
  <td${p}
69
70
  class="${b}"
70
71
  esd-extension-block-id="${t}"${d}>
71
- <p contenteditable="false"${u(m)}>${v(e, s)}</p>
72
+ <p contenteditable="false"${u(m)}>${k(e, l)}</p>
72
73
  </td>
73
74
  </tr>
74
75
  </tbody>
@@ -76,19 +77,19 @@ function G(t, o, e, l, s, n, i) {
76
77
  </td>
77
78
  `;
78
79
  }
79
- function it(t, o, e, l) {
80
- const s = o ? ` style="background-color: ${c(o)}"` : "", n = u(t.tdStyle), i = y(t.align), a = $("font-size: 14px; color: #999999", t.pStyle);
80
+ function ct(t, o, e, s) {
81
+ const l = o ? ` style="background-color: ${r(o)}"` : "", n = u(t.tdStyle), i = y(t.align), a = $("font-size: 14px; color: #999999", t.pStyle);
81
82
  return `
82
- ${I(e, 'valign="top" style="padding: 0 5px; height: 100%"')}>
83
+ ${E(e, 'valign="top" style="padding: 0 5px; height: 100%"')}>
83
84
  <table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0"
84
- class="product-card-segment"${s}>
85
+ class="product-card-segment"${l}>
85
86
  <tbody>
86
87
  <tr valign="top">
87
88
  <td${i}
88
89
  class="esd-block-text product-old-price es-p15l es-p15r"
89
90
  esd-extension-block-id="${g.OLD_PRICE}"${n}>
90
91
  <p contenteditable="false"${u(a)}>
91
- <s>${v(l, t)}</s>
92
+ <s>${k(s, t)}</s>
92
93
  </p>
93
94
  </td>
94
95
  </tr>
@@ -97,12 +98,12 @@ function it(t, o, e, l) {
97
98
  </td>
98
99
  `;
99
100
  }
100
- function z(t, o, e, l, s, n, i) {
101
- const r = s ? `; background-color: ${c(s)}` : "", a = u(l.tdStyle), d = y(l.align), b = $("font-size: 12px; color: #666666", l.pStyle);
101
+ function G(t, o, e, s, l, n, i) {
102
+ const c = l ? `; background-color: ${r(l)}` : "", a = u(s.tdStyle), d = y(s.align), b = $("font-size: 12px; color: #666666", s.pStyle);
102
103
  return `
103
- ${I(i, 'valign="top" style="padding: 0 5px; height: 100%"')}>
104
+ ${E(i, 'valign="top" style="padding: 0 5px; height: 100%"')}>
104
105
  <table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0"
105
- class="product-card-segment" style="table-layout: fixed${r}">
106
+ class="product-card-segment" style="table-layout: fixed${c}">
106
107
  <tbody>
107
108
  <tr valign="top">
108
109
  <td${d}
@@ -111,7 +112,7 @@ function z(t, o, e, l, s, n, i) {
111
112
  esd-extension-block-id="${t}"${a}>
112
113
  <p contenteditable="false"${u(b)}>
113
114
  <span class="omnibus-text-before"></span>
114
- <span class="${o}">${c(e)}</span>
115
+ <span class="${o}">${r(e)}</span>
115
116
  <span class="omnibus-text-after"></span>
116
117
  </p>
117
118
  </td>
@@ -121,21 +122,21 @@ function z(t, o, e, l, s, n, i) {
121
122
  </td>
122
123
  `;
123
124
  }
124
- function ct(t, o, e, l) {
125
- const s = e ? ` style="background-color: ${c(e)}"` : "", n = $("padding: 0 5px; height: 100%", o.tdStyle), i = y(o.align), r = o.text || X, a = $(q, o.spanStyle), d = $(Q, o.aStyle);
125
+ function at(t, o, e, s) {
126
+ const l = e ? ` style="background-color: ${r(e)}"` : "", n = $("padding: 0 5px; height: 100%", o.tdStyle), i = y(o.align), c = o.text || Q, a = $(Z, o.spanStyle), d = $(W, o.aStyle);
126
127
  return `
127
- ${I(l, `valign="top" style="${c(n)}"`)}>
128
+ ${E(s, `valign="top" style="${r(n)}"`)}>
128
129
  <table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0"
129
- class="product-card-segment"${s}>
130
+ class="product-card-segment"${l}>
130
131
  <tbody>
131
132
  <tr valign="top">
132
133
  <td${i}
133
134
  class="esd-block-button product-button es-p10t es-p10b es-p5l es-p5r"
134
135
  esd-extension-block-id="${g.BUTTON}">
135
- <span class="es-button-border" style="${c(a)}">
136
+ <span class="es-button-border" style="${r(a)}">
136
137
  <a href="https://example.com/product/${t + 1}" target="_blank"
137
- class="es-button ${H}"
138
- style="${c(d)}">${c(r)}</a>
138
+ class="es-button ${z}"
139
+ style="${r(d)}">${r(c)}</a>
139
140
  </span>
140
141
  </td>
141
142
  </tr>
@@ -144,18 +145,18 @@ function ct(t, o, e, l) {
144
145
  </td>
145
146
  `;
146
147
  }
147
- function rt(t, o, e, l, s) {
148
- const n = l ? `; background-color: ${c(l)}` : "", i = u(e.tdStyle), r = y(e.align), d = $("font-size: 12px; color: #666666; margin: 0", e.pStyle), p = o.replace(/_/g, " ").replace(/\b\w/g, (b) => b.toUpperCase());
148
+ function dt(t, o, e, s, l) {
149
+ const n = s ? `; background-color: ${r(s)}` : "", i = u(e.tdStyle), c = y(e.align), d = $("font-size: 12px; color: #666666; margin: 0", e.pStyle), p = o.replace(/_/g, " ").replace(/\b\w/g, (b) => b.toUpperCase());
149
150
  return `
150
- ${I(s, 'valign="middle" style="padding: 0 5px; height: 100%"')}>
151
+ ${E(l, 'valign="middle" style="padding: 0 5px; height: 100%"')}>
151
152
  <table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0"
152
153
  class="product-card-segment" style="table-layout: fixed${n}">
153
154
  <tbody>
154
155
  <tr valign="top">
155
- <td product-attr="${c(t)}"${r}
156
+ <td product-attr="${r(t)}"${c}
156
157
  class="esd-block-text product-custom-attribute es-p0t es-p0b es-p15l es-p15r"
157
158
  esd-extension-block-id="${g.CUSTOM_ATTRIBUTE}"${i}>
158
- <p contenteditable="false"${u(d)}>${c(p)}</p>
159
+ <p contenteditable="false"${u(d)}>${r(p)}</p>
159
160
  </td>
160
161
  </tr>
161
162
  </tbody>
@@ -163,109 +164,109 @@ function rt(t, o, e, l, s) {
163
164
  </td>
164
165
  `;
165
166
  }
166
- function at(t, o, e, l, s, n, i) {
167
- const r = o[t], a = r ?? R();
167
+ function pt(t, o, e, s, l, n, i) {
168
+ const c = o[t], a = c ?? R();
168
169
  switch (t) {
169
- case O:
170
- return st(
171
- r ?? {},
172
- s,
170
+ case I:
171
+ return rt(
172
+ c ?? {},
173
173
  l,
174
+ s,
174
175
  n
175
176
  );
176
- case j:
177
- return G(
177
+ case H:
178
+ return D(
178
179
  g.NAME,
179
180
  "product-name es-p10t es-p10b es-p15l es-p15r",
180
181
  "Product Name",
181
182
  "font-size: 16px; color: #333333",
182
183
  a,
183
- l,
184
+ s,
184
185
  n
185
186
  );
186
- case V:
187
- return G(
187
+ case j:
188
+ return D(
188
189
  g.PRICE,
189
190
  "product-price es-p15l es-p15r",
190
191
  i.pricePlaceholder,
191
192
  "font-size: 16px; color: #333333",
192
- Z(r),
193
- l,
193
+ tt(c),
194
+ s,
194
195
  n
195
196
  );
196
- case Y:
197
- return it(a, l, n, i.oldPricePlaceholder);
198
- case M:
199
- return z(
197
+ case V:
198
+ return ct(a, s, n, i.oldPricePlaceholder);
199
+ case L:
200
+ return G(
200
201
  g.OMNIBUS_PRICE,
201
202
  "omnibus-price-value",
202
203
  i.omnibusPricePlaceholder,
203
204
  a,
204
- l,
205
+ s,
205
206
  "product-omnibus-price",
206
207
  n
207
208
  );
208
- case F:
209
- return z(
209
+ case Y:
210
+ return G(
210
211
  g.OMNIBUS_DISCOUNT,
211
212
  "omnibus-discount-value",
212
213
  "-10%",
213
214
  a,
214
- l,
215
+ s,
215
216
  "product-omnibus-discount",
216
217
  n
217
218
  );
218
- case k:
219
- return ct(
220
- s,
221
- r ?? {},
219
+ case O:
220
+ return at(
222
221
  l,
222
+ c ?? {},
223
+ s,
223
224
  n
224
225
  );
225
226
  default:
226
- if (t.startsWith(E)) {
227
- const d = e[t] ?? t.slice(E.length), p = t.slice(E.length);
228
- return rt(d, p, a, l, n);
227
+ if (t.startsWith(F)) {
228
+ const d = e[t] ?? K(t), p = J(d);
229
+ return dt(d, p, a, s, n);
229
230
  }
230
231
  return null;
231
232
  }
232
233
  }
233
- const W = `
234
+ const et = `
234
235
  <tr>
235
236
  <td class="spacer" style="height: 10px"></td>
236
237
  </tr>
237
238
  `;
238
- function dt(t) {
239
+ function ut(t) {
239
240
  return {
240
- pricePlaceholder: L({ price: 18, currency: t }),
241
- oldPricePlaceholder: L({ price: 20, currency: t }),
242
- omnibusPricePlaceholder: L({ price: 20, currency: t })
241
+ pricePlaceholder: B({ price: 18, currency: t }),
242
+ oldPricePlaceholder: B({ price: 20, currency: t }),
243
+ omnibusPricePlaceholder: B({ price: 20, currency: t })
243
244
  };
244
245
  }
245
- function pt(t, o, e, l) {
246
- const { composition: s, visibility: n, perElement: i, customAttrValues: r, cardBg: a } = l, d = (100 / e).toFixed(2), p = e - o, b = `<td class="${K}" style="padding: 0 5px;" width="${d}%"></td>`, m = p > 0 ? b.repeat(p) : "";
246
+ function bt(t, o, e, s) {
247
+ const { composition: l, visibility: n, perElement: i, customAttrValues: c, cardBg: a } = s, d = (100 / e).toFixed(2), p = e - o, b = `<td class="${q}" style="padding: 0 5px;" width="${d}%"></td>`, m = p > 0 ? b.repeat(p) : "";
247
248
  return `
248
249
  <tr class="recommendation-product-row">
249
250
  <td>
250
251
  <table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0"
251
252
  class="product-card-wrapper" style="table-layout: fixed">
252
- <tbody>${s.map((T) => {
253
+ <tbody>${l.map((T) => {
253
254
  const C = n[T] !== !1, f = C ? "" : ' style="display: none"', w = C ? "1" : "0", x = [];
254
255
  for (let A = 0; A < o; A += 1) {
255
- const _ = at(
256
+ const P = pt(
256
257
  T,
257
258
  i,
258
- r,
259
+ c,
259
260
  a,
260
261
  t + A,
261
262
  d,
262
- l
263
+ s
263
264
  );
264
- _ && x.push(_);
265
+ P && x.push(P);
265
266
  }
266
267
  return x.length === 0 ? "" : `
267
268
  <tr class="recommendation-attribute-row"
268
- data-attribute-type="${c(T)}"
269
+ data-attribute-type="${r(T)}"
269
270
  data-visibility="${w}"${f}>
270
271
  ${x.join("")}${m}
271
272
  </tr>
@@ -276,79 +277,79 @@ function pt(t, o, e, l) {
276
277
  </tr>
277
278
  `;
278
279
  }
279
- function ut(t, o, e) {
280
- const l = [];
281
- for (let s = 0; s < t; s += o) {
282
- const n = Math.min(o, t - s);
283
- s > 0 && l.push(W), l.push(pt(s, n, o, e));
280
+ function gt(t, o, e) {
281
+ const s = [];
282
+ for (let l = 0; l < t; l += o) {
283
+ const n = Math.min(o, t - l);
284
+ l > 0 && s.push(et), s.push(bt(l, n, o, e));
284
285
  }
285
- return l.join("");
286
+ return s.join("");
286
287
  }
287
- function bt(t, o, e, l) {
288
- const s = o[t];
289
- if (t === j) {
290
- const n = s ?? R(), i = $("font-size: 16px; color: #333333; margin: 0", n.pStyle), r = y(n.align ?? "left");
288
+ function mt(t, o, e, s) {
289
+ const l = o[t];
290
+ if (t === H) {
291
+ const n = l ?? R(), i = $("font-size: 16px; color: #333333; margin: 0", n.pStyle), c = y(n.align ?? "left");
291
292
  return `
292
293
  <td class="esd-block-text product-name"
293
- esd-extension-block-id="${g.NAME}"${r}${u(n.tdStyle)}>
294
- <p contenteditable="false"${u(i)}>${v("Product Name", n)}</p>
294
+ esd-extension-block-id="${g.NAME}"${c}${u(n.tdStyle)}>
295
+ <p contenteditable="false"${u(i)}>${k("Product Name", n)}</p>
295
296
  </td>
296
297
  `;
297
298
  }
298
- if (t === V) {
299
- const n = Z(s), i = $("font-size: 16px; color: #333333; margin: 0", n.pStyle), r = y(n.align ?? "left");
299
+ if (t === j) {
300
+ const n = tt(l), i = $("font-size: 16px; color: #333333; margin: 0", n.pStyle), c = y(n.align ?? "left");
300
301
  return `
301
302
  <td class="esd-block-text product-price"
302
- esd-extension-block-id="${g.PRICE}"${r}${u(n.tdStyle)}>
303
- <p contenteditable="false"${u(i)}>${v(l.pricePlaceholder, n)}</p>
303
+ esd-extension-block-id="${g.PRICE}"${c}${u(n.tdStyle)}>
304
+ <p contenteditable="false"${u(i)}>${k(s.pricePlaceholder, n)}</p>
304
305
  </td>
305
306
  `;
306
307
  }
307
- if (t === Y) {
308
- const n = s ?? R(), r = $("font-size: 14px; color: #999999; text-decoration: line-through; margin: 0", n.pStyle), a = y(n.align ?? "left");
308
+ if (t === V) {
309
+ const n = l ?? R(), c = $("font-size: 14px; color: #999999; text-decoration: line-through; margin: 0", n.pStyle), a = y(n.align ?? "left");
309
310
  return `
310
311
  <td class="esd-block-text product-old-price"
311
312
  esd-extension-block-id="${g.OLD_PRICE}"${a}${u(n.tdStyle)}>
312
- <p contenteditable="false"${u(r)}><s>${v(l.oldPricePlaceholder, n)}</s></p>
313
+ <p contenteditable="false"${u(c)}><s>${k(s.oldPricePlaceholder, n)}</s></p>
313
314
  </td>
314
315
  `;
315
316
  }
316
- if (t === M || t === F) {
317
- const n = t === M, i = n ? g.OMNIBUS_PRICE : g.OMNIBUS_DISCOUNT, r = n ? "omnibus-price-value" : "omnibus-discount-value", a = n ? l.omnibusPricePlaceholder : "-10%", d = n ? "product-omnibus-price" : "product-omnibus-discount", p = s ?? R(), b = $("font-size: 12px; color: #666666; margin: 0", p.pStyle), m = y(p.align ?? "left");
317
+ if (t === L || t === Y) {
318
+ const n = t === L, i = n ? g.OMNIBUS_PRICE : g.OMNIBUS_DISCOUNT, c = n ? "omnibus-price-value" : "omnibus-discount-value", a = n ? s.omnibusPricePlaceholder : "-10%", d = n ? "product-omnibus-price" : "product-omnibus-discount", p = l ?? R(), b = $("font-size: 12px; color: #666666; margin: 0", p.pStyle), m = y(p.align ?? "left");
318
319
  return `
319
320
  <td class="esd-block-text ${d}"
320
321
  data-text-before="" data-text-after=""
321
322
  esd-extension-block-id="${i}"${m}${u(p.tdStyle)}>
322
323
  <p contenteditable="false"${u(b)}>
323
324
  <span class="omnibus-text-before"></span>
324
- <span class="${r}">${c(a)}</span>
325
+ <span class="${c}">${r(a)}</span>
325
326
  <span class="omnibus-text-after"></span>
326
327
  </p>
327
328
  </td>
328
329
  `;
329
330
  }
330
- if (t.startsWith(E)) {
331
- const n = s ?? R(), i = e[t] ?? t.slice(E.length), a = t.slice(E.length).replace(/_/g, " ").replace(/\b\w/g, (m) => m.toUpperCase()), d = $("font-size: 12px; color: #666666; margin: 0", n.pStyle), p = y(n.align ?? "left"), b = g.CUSTOM_ATTRIBUTE;
331
+ if (t.startsWith(F)) {
332
+ const n = l ?? R(), i = e[t] ?? K(t), a = J(i).replace(/_/g, " ").replace(/\b\w/g, (m) => m.toUpperCase()), d = $("font-size: 12px; color: #666666; margin: 0", n.pStyle), p = y(n.align ?? "left"), b = g.CUSTOM_ATTRIBUTE;
332
333
  return `
333
- <td product-attr="${c(i)}"
334
+ <td product-attr="${r(i)}"
334
335
  class="esd-block-text product-custom-attribute"
335
336
  esd-extension-block-id="${b}"${p}${u(n.tdStyle)}>
336
- <p contenteditable="false"${u(d)}>${c(a)}</p>
337
+ <p contenteditable="false"${u(d)}>${r(a)}</p>
337
338
  </td>
338
339
  `;
339
340
  }
340
341
  return null;
341
342
  }
342
- function gt(t, o) {
343
- const { composition: e, visibility: l, perElement: s, customAttrValues: n, cardBg: i } = o, r = i ? `background-color: ${c(i)}` : "", a = r ? `style="table-layout: fixed; ${r}"` : 'style="table-layout: fixed"', d = s[O] ?? {}, p = l[O] !== !1, b = d.width ? ` width="${d.width}"` : "", m = p ? "" : ' style="display: none"', S = `
343
+ function $t(t, o) {
344
+ const { composition: e, visibility: s, perElement: l, customAttrValues: n, cardBg: i } = o, c = i ? `background-color: ${r(i)}` : "", a = c ? `style="table-layout: fixed; ${c}"` : 'style="table-layout: fixed"', d = l[I] ?? {}, p = s[I] !== !1, b = d.width ? ` width="${d.width}"` : "", m = p ? "" : ' style="display: none"', S = `
344
345
  <td width="120"
345
346
  class="esd-block-image product-image-cell recommendation-attribute-row es-p5"
346
347
  esd-extension-block-id="${g.IMAGE}"
347
- data-attribute-type="${O}"
348
+ data-attribute-type="${I}"
348
349
  data-visibility="${p ? "1" : "0"}"
349
350
  align="center" valign="middle"${m}>
350
351
  <a target="_blank" href="https://example.com/product/${t + 1}">
351
- <img src="${J}" alt="Product Name"
352
+ <img src="${X}" alt="Product Name"
352
353
  class="adapt-img product-image"${b}
353
354
  style="display: block; max-width: 100%; height: auto">
354
355
  </a>
@@ -357,26 +358,26 @@ function gt(t, o) {
357
358
  <td class="product-info-cell" valign="middle" style="padding: 15px">
358
359
  <table cellpadding="0" cellspacing="0" role="presentation" width="100%"
359
360
  style="table-layout: fixed">
360
- <tbody>${e.filter((h) => h !== O && h !== k).map((h) => {
361
- const B = l[h] !== !1, tt = B ? "" : ' style="display: none"', et = B ? "1" : "0", D = bt(h, s, n, o);
362
- return D ? `<tr class="recommendation-attribute-row"
363
- data-attribute-type="${c(h)}"
364
- data-visibility="${et}"${tt}>${D}</tr>` : "";
361
+ <tbody>${e.filter((h) => h !== I && h !== O).map((h) => {
362
+ const U = s[h] !== !1, ot = U ? "" : ' style="display: none"', nt = U ? "1" : "0", M = mt(h, l, n, o);
363
+ return M ? `<tr class="recommendation-attribute-row"
364
+ data-attribute-type="${r(h)}"
365
+ data-visibility="${nt}"${ot}>${M}</tr>` : "";
365
366
  }).filter(Boolean).join(`
366
367
  `)}</tbody>
367
368
  </table>
368
369
  </td>
369
- `, f = s[k] ?? {}, w = l[k] !== !1, x = f.text || X, A = $(q, f.spanStyle ?? ""), _ = $(Q, f.aStyle ?? ""), N = w ? "" : ' style="display: none"', U = `
370
+ `, f = l[O] ?? {}, w = s[O] !== !1, x = f.text || Q, A = $(Z, f.spanStyle ?? ""), P = $(W, f.aStyle ?? ""), N = w ? "" : ' style="display: none"', v = `
370
371
  <td width="100"
371
372
  class="esd-block-button button-cell recommendation-attribute-row product-button es-p5l es-p5r"
372
373
  esd-extension-block-id="${g.BUTTON}"
373
- data-attribute-type="${k}"
374
+ data-attribute-type="${O}"
374
375
  data-visibility="${w ? "1" : "0"}"
375
- align="${c(f.align ?? "center")}" valign="middle"${N}>
376
- <span class="es-button-border" style="${c(A)}">
376
+ align="${r(f.align ?? "center")}" valign="middle"${N}>
377
+ <span class="es-button-border" style="${r(A)}">
377
378
  <a href="https://example.com/product/${t + 1}" target="_blank"
378
- class="es-button ${H}"
379
- style="${c(_)}">${c(x)}</a>
379
+ class="es-button ${z}"
380
+ style="${r(P)}">${r(x)}</a>
380
381
  </span>
381
382
  </td>
382
383
  `;
@@ -386,43 +387,43 @@ function gt(t, o) {
386
387
  <table width="100%" cellpadding="0" cellspacing="0" border="0"
387
388
  class="product-card-wrapper" ${a}>
388
389
  <tbody>
389
- <tr>${S}${C}${U}</tr>
390
+ <tr>${S}${C}${v}</tr>
390
391
  </tbody>
391
392
  </table>
392
393
  </td>
393
394
  </tr>
394
395
  `;
395
396
  }
396
- function mt(t, o) {
397
+ function yt(t, o) {
397
398
  const e = [];
398
- for (let l = 0; l < t; l += 1)
399
- l > 0 && e.push(W), e.push(gt(l, o));
399
+ for (let s = 0; s < t; s += 1)
400
+ s > 0 && e.push(et), e.push($t(s, o));
400
401
  return e.join("");
401
402
  }
402
- function $t(t, o) {
403
+ function ft(t, o) {
403
404
  var a, d, p, b, m, S;
404
- const e = t == null ? void 0 : t.theme, l = [];
405
- (a = e == null ? void 0 : e.textStyle) != null && a["font-family"] && l.push(`font-family: ${e.textStyle["font-family"]}`), l.push(`font-size: ${((d = e == null ? void 0 : e.textStyle) == null ? void 0 : d["font-size"]) ?? "28px"}`), l.push(`color: ${((p = e == null ? void 0 : e.textColor) == null ? void 0 : p.color) ?? "#333333"}`), (b = e == null ? void 0 : e.textStyle) != null && b["font-weight"] && l.push(`font-weight: ${e.textStyle["font-weight"]}`), (m = e == null ? void 0 : e.textStyle) != null && m["font-style"] && l.push(`font-style: ${e.textStyle["font-style"]}`);
406
- const s = l.join("; "), n = ((S = e == null ? void 0 : e.textStyle) == null ? void 0 : S["font-weight"]) !== "normal", i = c(o), r = n ? `<strong>${i}</strong>` : i;
405
+ const e = t == null ? void 0 : t.theme, s = [];
406
+ (a = e == null ? void 0 : e.textStyle) != null && a["font-family"] && s.push(`font-family: ${e.textStyle["font-family"]}`), s.push(`font-size: ${((d = e == null ? void 0 : e.textStyle) == null ? void 0 : d["font-size"]) ?? "28px"}`), s.push(`color: ${((p = e == null ? void 0 : e.textColor) == null ? void 0 : p.color) ?? "#333333"}`), (b = e == null ? void 0 : e.textStyle) != null && b["font-weight"] && s.push(`font-weight: ${e.textStyle["font-weight"]}`), (m = e == null ? void 0 : e.textStyle) != null && m["font-style"] && s.push(`font-style: ${e.textStyle["font-style"]}`);
407
+ const l = s.join("; "), n = ((S = e == null ? void 0 : e.textStyle) == null ? void 0 : S["font-weight"]) !== "normal", i = r(o), c = n ? `<strong>${i}</strong>` : i;
407
408
  return `
408
409
  <td class="esd-block-text es-p10t es-p10b es-p20l es-p20r" align="center">
409
- <p${u(s)}>${r}</p>
410
+ <p${u(l)}>${c}</p>
410
411
  </td>
411
412
  `;
412
413
  }
413
- function yt(t) {
414
+ function ht(t) {
414
415
  const o = t.alignment === "before" ? "0" : "1";
415
- return ` ${P.CURRENCY}="${c(t.code)}" ${P.SYMBOL}="${c(t.symbol)}" ${P.ALIGNMENT}="${o}" ${P.THOUSAND_SEPARATOR}="${c(t.thousandSeparator)}" ${P.DECIMAL_SEPARATOR}="${c(t.decimalSeparator)}" ${P.DECIMAL_COUNT}="${t.decimalCount}"`;
416
+ return ` ${_.CURRENCY}="${r(t.code)}" ${_.SYMBOL}="${r(t.symbol)}" ${_.ALIGNMENT}="${o}" ${_.THOUSAND_SEPARATOR}="${r(t.thousandSeparator)}" ${_.DECIMAL_SEPARATOR}="${r(t.decimalSeparator)}" ${_.DECIMAL_COUNT}="${t.decimalCount}"`;
416
417
  }
417
- function Ct(t) {
418
+ function Pt(t) {
418
419
  const {
419
420
  nodeConfig: o,
420
421
  composition: e,
421
- cardBg: l,
422
- titleText: s,
422
+ cardBg: s,
423
+ titleText: l,
423
424
  extraClasses: n = "",
424
425
  legacyId: i,
425
- legacyBgColor: r,
426
+ legacyBgColor: c,
426
427
  preserveInnerHtml: a,
427
428
  skipCompile: d = !1
428
429
  } = t, p = o.layout === "list" ? ' data-layout="list"' : "", b = o.layout === "list" ? " es-m-p0 ins-recommendation-list-layout" : "", m = e.composition.join(","), S = JSON.stringify(e.customAttributes), T = [
@@ -437,17 +438,17 @@ function Ct(t) {
437
438
  "esd-extension-block",
438
439
  "esd-container-frame",
439
440
  "ins-recommendation-no-mobile-layout",
440
- d ? ot : "",
441
+ d ? st : "",
441
442
  n
442
- ].filter(Boolean).join(" "), C = yt(o.currency), f = ` esd-ext-config="${c(JSON.stringify(o))}"`, w = i ? ` id="${c(i)}"` : "", x = r ? ` bgcolor="${c(r)}"` : "", _ = a ?? (() => {
443
- const N = parseInt(o.size) || 6, U = {
443
+ ].filter(Boolean).join(" "), C = ht(o.currency), f = ` esd-ext-config="${r(JSON.stringify(o))}"`, w = i ? ` id="${r(i)}"` : "", x = c ? ` bgcolor="${r(c)}"` : "", P = a ?? (() => {
444
+ const N = parseInt(o.size) || 6, v = {
444
445
  composition: e.composition,
445
446
  visibility: e.visibility,
446
447
  perElement: e.perElementStyles,
447
448
  customAttrValues: e.customAttrValues,
448
- cardBg: l,
449
- ...dt(o.currency)
450
- }, h = o.layout === "list" ? mt(N, U) : ut(N, o.cardsInRow, U);
449
+ cardBg: s,
450
+ ...ut(o.currency)
451
+ }, h = o.layout === "list" ? yt(N, v) : gt(N, o.cardsInRow, v);
451
452
  return `
452
453
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
453
454
  <tbody>
@@ -459,7 +460,7 @@ function Ct(t) {
459
460
  <td>
460
461
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
461
462
  <tbody>
462
- <tr>${$t(e.titleVariable, s)}</tr>
463
+ <tr>${ft(e.titleVariable, l)}</tr>
463
464
  </tbody>
464
465
  </table>
465
466
  </td>
@@ -470,7 +471,7 @@ function Ct(t) {
470
471
  <tr>
471
472
  <td>
472
473
  <table width="100%" cellpadding="0" cellspacing="0" border="0"
473
- class="${nt}">${h}
474
+ class="${lt}">${h}
474
475
  </table>
475
476
  </td>
476
477
  </tr>
@@ -482,22 +483,22 @@ function Ct(t) {
482
483
  </tbody>
483
484
  </table>`;
484
485
  })();
485
- return lt(`
486
+ return it(`
486
487
  <td align="left"
487
488
  esd-extension-block-id="recommendation-block"
488
489
  width="520"
489
490
  class="${T}"${w}${x}
490
491
  recommendation-id="${o.recommendationId}"${C}
491
- data-card-composition="${c(m)}"
492
- data-custom-attributes="${c(S)}"
492
+ data-card-composition="${r(m)}"
493
+ data-custom-attributes="${r(S)}"
493
494
  data-column-spacing="${o.columnSpacing}"
494
495
  data-row-spacing="${o.rowSpacing}"
495
496
  data-mobile-column-spacing="${o.mobileColumnSpacing}"
496
497
  data-mobile-row-spacing="${o.mobileRowSpacing}"
497
- hide-price="${o.priceHideIfSameAsDiscounted}"${p}${f}>${_}
498
+ hide-price="${o.priceHideIfSameAsDiscounted}"${p}${f}>${P}
498
499
  </td>
499
500
  `);
500
501
  }
501
502
  export {
502
- Ct as buildBlockHtml
503
+ Pt as buildBlockHtml
503
504
  };
@@ -0,0 +1,4 @@
1
+ var r = /* @__PURE__ */ ((o) => (o.BLOCK_BACKGROUND = "checkbox-block-background-color-control", o))(r || {});
2
+ export {
3
+ r as CheckboxControlId
4
+ };