@useinsider/guido 3.3.0 → 3.4.0-beta.0ec3bc7

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 (46) hide show
  1. package/dist/@types/config/schemas.js +1 -1
  2. package/dist/components/Guido.vue.js +1 -1
  3. package/dist/components/Guido.vue2.js +42 -40
  4. package/dist/components/organisms/extensions/recommendation/FilterItem.vue.js +9 -11
  5. package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +70 -35
  6. package/dist/components/organisms/header/MiddleSlot.vue.js +7 -7
  7. package/dist/composables/useCortexBlueprintBridge.js +66 -0
  8. package/dist/composables/useEmailTemplateApplier.js +41 -0
  9. package/dist/composables/useGuidoStateBridge.js +48 -0
  10. package/dist/composables/useHtmlValidator.js +41 -36
  11. package/dist/composables/useRecommendation.js +2 -2
  12. package/dist/composables/useResponsivePreview.js +1 -1
  13. package/dist/config/compiler/recommendationCompilerRules.js +10 -10
  14. package/dist/config/migrator/radioButtonMigrator.js +30 -29
  15. package/dist/config/migrator/recommendation/htmlBuilder.js +65 -65
  16. package/dist/enums/extensions/recommendationBlock.js +101 -46
  17. package/dist/enums/unsubscribe.js +25 -24
  18. package/dist/extensions/Blocks/Checkbox/control.js +23 -23
  19. package/dist/extensions/Blocks/RadioButton/control.js +15 -15
  20. package/dist/extensions/Blocks/RadioButton/template.js +6 -6
  21. package/dist/extensions/Blocks/Recommendation/block.js +43 -36
  22. package/dist/extensions/Blocks/Recommendation/services/configService.js +33 -26
  23. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +35 -26
  24. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +10 -10
  25. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +3 -3
  26. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +5 -5
  27. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +26 -13
  28. package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +33 -0
  29. package/dist/guido.css +1 -1
  30. package/dist/node_modules/valibot/dist/index.js +252 -329
  31. package/dist/package.json.js +1 -1
  32. package/dist/services/unsubscribeApi.js +6 -6
  33. package/dist/src/composables/useCortexBlueprintBridge.d.ts +25 -0
  34. package/dist/src/composables/useEmailTemplateApplier.d.ts +21 -0
  35. package/dist/src/composables/useGuidoStateBridge.d.ts +22 -0
  36. package/dist/src/enums/extensions/recommendationBlock.d.ts +6 -1
  37. package/dist/src/enums/unsubscribe.d.ts +8 -3
  38. package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
  39. package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +11 -3
  40. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +7 -1
  41. package/dist/src/extensions/Blocks/Recommendation/utils/filterUtil.d.ts +2 -0
  42. package/dist/src/extensions/Blocks/Recommendation/utils/filterUtil.test.d.ts +1 -0
  43. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +21 -0
  44. package/dist/src/stores/guido-email-editor.d.ts +41 -0
  45. package/dist/stores/guido-email-editor.js +20 -0
  46. package/package.json +5 -4
@@ -1,5 +1,5 @@
1
1
  import { RecommendationBlockId as g } from "../../../extensions/Blocks/Recommendation/constants/blockIds.js";
2
- import { CURRENCY_ATTR as R, ATTR_PRODUCT_IMAGE as I, ATTR_PRODUCT_BUTTON as k, ATTR_PRODUCT_NAME as z, ATTR_PRODUCT_PRICE as G, ATTR_PRODUCT_OLD_PRICE as H, ATTR_PRODUCT_OMNIBUS_PRICE as U, ATTR_PRODUCT_OMNIBUS_DISCOUNT as j, ATTR_CUSTOM_PREFIX as E } from "../../../extensions/Blocks/Recommendation/constants/selectors.js";
2
+ import { CURRENCY_ATTR as R, ATTR_PRODUCT_IMAGE as v, ATTR_PRODUCT_BUTTON as I, ATTR_PRODUCT_NAME as z, ATTR_PRODUCT_PRICE as G, ATTR_PRODUCT_OLD_PRICE as H, ATTR_PRODUCT_OMNIBUS_PRICE as U, ATTR_PRODUCT_OMNIBUS_DISCOUNT as j, ATTR_CUSTOM_PREFIX as E } from "../../../extensions/Blocks/Recommendation/constants/selectors.js";
3
3
  import { formatPrice as N } from "../../../extensions/Blocks/Recommendation/utils/priceFormatter.js";
4
4
  import { escapeHtml as c } from "../../../utils/htmlEscape.js";
5
5
  import { appendStyle as $ } from "./themeMapper.js";
@@ -22,7 +22,7 @@ function _() {
22
22
  function K(t) {
23
23
  return t ? { ...t, wrapBold: !0 } : { ..._(), wrapBold: !0 };
24
24
  }
25
- function v(t, o) {
25
+ function k(t, o) {
26
26
  let e = c(t);
27
27
  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
28
  }
@@ -35,11 +35,11 @@ function O(t, o) {
35
35
  function nt(t, o, e, l) {
36
36
  const s = t.width ? ` width="${t.width}"` : "", n = t.height ? ` height="${t.height}"` : "", i = ["display: block", "max-width: 100%", "height: auto"];
37
37
  t.width && i.push(`width: ${t.width}px`), t.height && i.push(`height: ${t.height}px`);
38
- const a = i.join("; "), r = e ? ` style="background-color: ${c(e)}"` : "";
38
+ const r = i.join("; "), a = e ? ` style="background-color: ${c(e)}"` : "";
39
39
  return `
40
40
  ${O(l, 'valign="top" style="padding: 0 5px; height: 100%"')}>
41
41
  <table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0"
42
- class="product-card-segment"${r}>
42
+ class="product-card-segment"${a}>
43
43
  <tbody>
44
44
  <tr valign="top">
45
45
  <td align="center"
@@ -48,7 +48,7 @@ function nt(t, o, e, l) {
48
48
  <a target="_blank" href="https://example.com/product/${o + 1}">
49
49
  <img src="${V}" alt="Product Name"
50
50
  class="adapt-img"${s}${n}
51
- style="${a}">
51
+ style="${r}">
52
52
  </a>
53
53
  </td>
54
54
  </tr>
@@ -58,17 +58,17 @@ function nt(t, o, e, l) {
58
58
  `;
59
59
  }
60
60
  function D(t, o, e, l, s, n, i) {
61
- const r = `table-layout: fixed${n ? `; background-color: ${c(n)}` : ""}`, d = b(s.tdStyle), p = y(s.align), u = `esd-block-text ${o}`.trim(), m = $(l, s.pStyle);
61
+ const a = `table-layout: fixed${n ? `; background-color: ${c(n)}` : ""}`, d = b(s.tdStyle), p = y(s.align), u = `esd-block-text ${o}`.trim(), m = $(l, s.pStyle);
62
62
  return `
63
63
  ${O(i, 'valign="top" style="padding: 0 5px; height: 100%"')}>
64
64
  <table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0"
65
- class="product-card-segment" style="${r}">
65
+ class="product-card-segment" style="${a}">
66
66
  <tbody>
67
67
  <tr valign="top">
68
68
  <td${p}
69
69
  class="${u}"
70
70
  esd-extension-block-id="${t}"${d}>
71
- <p contenteditable="false"${b(m)}>${v(e, s)}</p>
71
+ <p contenteditable="false"${b(m)}>${k(e, s)}</p>
72
72
  </td>
73
73
  </tr>
74
74
  </tbody>
@@ -77,7 +77,7 @@ function D(t, o, e, l, s, n, i) {
77
77
  `;
78
78
  }
79
79
  function lt(t, o, e, l) {
80
- const s = o ? ` style="background-color: ${c(o)}"` : "", n = b(t.tdStyle), i = y(t.align), r = $("font-size: 14px; color: #999999", t.pStyle);
80
+ const s = o ? ` style="background-color: ${c(o)}"` : "", n = b(t.tdStyle), i = y(t.align), a = $("font-size: 14px; color: #999999", t.pStyle);
81
81
  return `
82
82
  ${O(e, 'valign="top" style="padding: 0 5px; height: 100%"')}>
83
83
  <table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0"
@@ -87,8 +87,8 @@ function lt(t, o, e, l) {
87
87
  <td${i}
88
88
  class="esd-block-text product-old-price es-p15l es-p15r"
89
89
  esd-extension-block-id="${g.OLD_PRICE}"${n}>
90
- <p contenteditable="false"${b(r)}>
91
- <s>${v(l, t)}</s>
90
+ <p contenteditable="false"${b(a)}>
91
+ <s>${k(l, t)}</s>
92
92
  </p>
93
93
  </td>
94
94
  </tr>
@@ -98,17 +98,17 @@ function lt(t, o, e, l) {
98
98
  `;
99
99
  }
100
100
  function L(t, o, e, l, s, n, i) {
101
- const a = s ? `; background-color: ${c(s)}` : "", r = b(l.tdStyle), d = y(l.align), u = $("font-size: 12px; color: #666666", l.pStyle);
101
+ const r = s ? `; background-color: ${c(s)}` : "", a = b(l.tdStyle), d = y(l.align), u = $("font-size: 12px; color: #666666", l.pStyle);
102
102
  return `
103
103
  ${O(i, 'valign="top" style="padding: 0 5px; height: 100%"')}>
104
104
  <table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0"
105
- class="product-card-segment" style="table-layout: fixed${a}">
105
+ class="product-card-segment" style="table-layout: fixed${r}">
106
106
  <tbody>
107
107
  <tr valign="top">
108
108
  <td${d}
109
109
  data-text-before="" data-text-after=""
110
110
  class="esd-block-text ${n} es-p15l es-p15r"
111
- esd-extension-block-id="${t}"${r}>
111
+ esd-extension-block-id="${t}"${a}>
112
112
  <p contenteditable="false"${b(u)}>
113
113
  <span class="omnibus-text-before"></span>
114
114
  <span class="${o}">${c(e)}</span>
@@ -122,7 +122,7 @@ function L(t, o, e, l, s, n, i) {
122
122
  `;
123
123
  }
124
124
  function st(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), a = o.text || F, r = $(J, o.spanStyle), d = $(X, o.aStyle);
125
+ const s = e ? ` style="background-color: ${c(e)}"` : "", n = $("padding: 0 5px; height: 100%", o.tdStyle), i = y(o.align), r = o.text || F, a = $(J, o.spanStyle), d = $(X, o.aStyle);
126
126
  return `
127
127
  ${O(l, `valign="top" style="${c(n)}"`)}>
128
128
  <table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0"
@@ -132,10 +132,10 @@ function st(t, o, e, l) {
132
132
  <td${i}
133
133
  class="esd-block-button product-button es-p10t es-p10b es-p5l es-p5r"
134
134
  esd-extension-block-id="${g.BUTTON}">
135
- <span class="es-button-border" style="${c(r)}">
135
+ <span class="es-button-border" style="${c(a)}">
136
136
  <a href="https://example.com/product/${t + 1}" target="_blank"
137
- class="es-button buy-button"
138
- style="${c(d)}">${c(a)}</a>
137
+ class="es-button reco-v3-button"
138
+ style="${c(d)}">${c(r)}</a>
139
139
  </span>
140
140
  </td>
141
141
  </tr>
@@ -145,14 +145,14 @@ function st(t, o, e, l) {
145
145
  `;
146
146
  }
147
147
  function it(t, o, e, l, s) {
148
- const n = l ? `; background-color: ${c(l)}` : "", i = b(e.tdStyle), a = y(e.align), d = $("font-size: 12px; color: #666666; margin: 0", e.pStyle), p = o.replace(/_/g, " ").replace(/\b\w/g, (u) => u.toUpperCase());
148
+ const n = l ? `; background-color: ${c(l)}` : "", i = b(e.tdStyle), r = y(e.align), d = $("font-size: 12px; color: #666666; margin: 0", e.pStyle), p = o.replace(/_/g, " ").replace(/\b\w/g, (u) => u.toUpperCase());
149
149
  return `
150
150
  ${O(s, 'valign="middle" style="padding: 0 5px; height: 100%"')}>
151
151
  <table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0"
152
152
  class="product-card-segment" style="table-layout: fixed${n}">
153
153
  <tbody>
154
154
  <tr valign="top">
155
- <td product-attr="${c(t)}"${a}
155
+ <td product-attr="${c(t)}"${r}
156
156
  class="esd-block-text product-custom-attribute es-p0t es-p0b es-p15l es-p15r"
157
157
  esd-extension-block-id="${g.CUSTOM_ATTRIBUTE}"${i}>
158
158
  <p contenteditable="false"${b(d)}>${c(p)}</p>
@@ -164,11 +164,11 @@ function it(t, o, e, l, s) {
164
164
  `;
165
165
  }
166
166
  function ct(t, o, e, l, s, n, i) {
167
- const a = o[t], r = a ?? _();
167
+ const r = o[t], a = r ?? _();
168
168
  switch (t) {
169
- case I:
169
+ case v:
170
170
  return nt(
171
- a ?? {},
171
+ r ?? {},
172
172
  s,
173
173
  l,
174
174
  n
@@ -179,7 +179,7 @@ function ct(t, o, e, l, s, n, i) {
179
179
  "product-name es-p10t es-p10b es-p15l es-p15r",
180
180
  "Product Name",
181
181
  "font-size: 16px; color: #333333",
182
- r,
182
+ a,
183
183
  l,
184
184
  n
185
185
  );
@@ -189,18 +189,18 @@ function ct(t, o, e, l, s, n, i) {
189
189
  "product-price es-p15l es-p15r",
190
190
  i.pricePlaceholder,
191
191
  "font-size: 16px; color: #333333",
192
- K(a),
192
+ K(r),
193
193
  l,
194
194
  n
195
195
  );
196
196
  case H:
197
- return lt(r, l, n, i.oldPricePlaceholder);
197
+ return lt(a, l, n, i.oldPricePlaceholder);
198
198
  case U:
199
199
  return L(
200
200
  g.OMNIBUS_PRICE,
201
201
  "omnibus-price-value",
202
202
  i.omnibusPricePlaceholder,
203
- r,
203
+ a,
204
204
  l,
205
205
  "product-omnibus-price",
206
206
  n
@@ -210,22 +210,22 @@ function ct(t, o, e, l, s, n, i) {
210
210
  g.OMNIBUS_DISCOUNT,
211
211
  "omnibus-discount-value",
212
212
  "-10%",
213
- r,
213
+ a,
214
214
  l,
215
215
  "product-omnibus-discount",
216
216
  n
217
217
  );
218
- case k:
218
+ case I:
219
219
  return st(
220
220
  s,
221
- a ?? {},
221
+ r ?? {},
222
222
  l,
223
223
  n
224
224
  );
225
225
  default:
226
226
  if (t.startsWith(E)) {
227
227
  const d = e[t] ?? t.slice(E.length), p = t.slice(E.length);
228
- return it(d, p, r, l, n);
228
+ return it(d, p, a, l, n);
229
229
  }
230
230
  return null;
231
231
  }
@@ -235,15 +235,15 @@ const q = `
235
235
  <td class="spacer" style="height: 10px"></td>
236
236
  </tr>
237
237
  `;
238
- function at(t) {
238
+ function rt(t) {
239
239
  return {
240
240
  pricePlaceholder: N({ price: 18, currency: t }),
241
241
  oldPricePlaceholder: N({ price: 20, currency: t }),
242
242
  omnibusPricePlaceholder: N({ price: 20, currency: t })
243
243
  };
244
244
  }
245
- function rt(t, o, e, l) {
246
- const { composition: s, visibility: n, perElement: i, customAttrValues: a, cardBg: r } = l, d = (100 / e).toFixed(2), p = e - o, u = `<td class="${Y}" style="padding: 0 5px;" width="${d}%"></td>`, m = p > 0 ? u.repeat(p) : "";
245
+ function at(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, u = `<td class="${Y}" style="padding: 0 5px;" width="${d}%"></td>`, m = p > 0 ? u.repeat(p) : "";
247
247
  return `
248
248
  <tr class="recommendation-product-row">
249
249
  <td>
@@ -255,8 +255,8 @@ function rt(t, o, e, l) {
255
255
  const A = ct(
256
256
  T,
257
257
  i,
258
- a,
259
258
  r,
259
+ a,
260
260
  t + x,
261
261
  d,
262
262
  l
@@ -280,71 +280,71 @@ function dt(t, o, e) {
280
280
  const l = [];
281
281
  for (let s = 0; s < t; s += o) {
282
282
  const n = Math.min(o, t - s);
283
- s > 0 && l.push(q), l.push(rt(s, n, o, e));
283
+ s > 0 && l.push(q), l.push(at(s, n, o, e));
284
284
  }
285
285
  return l.join("");
286
286
  }
287
287
  function pt(t, o, e, l) {
288
288
  const s = o[t];
289
289
  if (t === z) {
290
- const n = s ?? _(), i = $("font-size: 16px; color: #333333; margin: 0", n.pStyle), a = y(n.align ?? "left");
290
+ const n = s ?? _(), i = $("font-size: 16px; color: #333333; margin: 0", n.pStyle), r = y(n.align ?? "left");
291
291
  return `
292
292
  <td class="esd-block-text product-name"
293
- esd-extension-block-id="${g.NAME}"${a}${b(n.tdStyle)}>
294
- <p contenteditable="false"${b(i)}>${v("Product Name", n)}</p>
293
+ esd-extension-block-id="${g.NAME}"${r}${b(n.tdStyle)}>
294
+ <p contenteditable="false"${b(i)}>${k("Product Name", n)}</p>
295
295
  </td>
296
296
  `;
297
297
  }
298
298
  if (t === G) {
299
- const n = K(s), i = $("font-size: 16px; color: #333333; margin: 0", n.pStyle), a = y(n.align ?? "left");
299
+ const n = K(s), i = $("font-size: 16px; color: #333333; margin: 0", n.pStyle), r = y(n.align ?? "left");
300
300
  return `
301
301
  <td class="esd-block-text product-price"
302
- esd-extension-block-id="${g.PRICE}"${a}${b(n.tdStyle)}>
303
- <p contenteditable="false"${b(i)}>${v(l.pricePlaceholder, n)}</p>
302
+ esd-extension-block-id="${g.PRICE}"${r}${b(n.tdStyle)}>
303
+ <p contenteditable="false"${b(i)}>${k(l.pricePlaceholder, n)}</p>
304
304
  </td>
305
305
  `;
306
306
  }
307
307
  if (t === H) {
308
- const n = s ?? _(), a = $("font-size: 14px; color: #999999; text-decoration: line-through; margin: 0", n.pStyle), r = y(n.align ?? "left");
308
+ const n = s ?? _(), r = $("font-size: 14px; color: #999999; text-decoration: line-through; margin: 0", n.pStyle), a = y(n.align ?? "left");
309
309
  return `
310
310
  <td class="esd-block-text product-old-price"
311
- esd-extension-block-id="${g.OLD_PRICE}"${r}${b(n.tdStyle)}>
312
- <p contenteditable="false"${b(a)}><s>${v(l.oldPricePlaceholder, n)}</s></p>
311
+ esd-extension-block-id="${g.OLD_PRICE}"${a}${b(n.tdStyle)}>
312
+ <p contenteditable="false"${b(r)}><s>${k(l.oldPricePlaceholder, n)}</s></p>
313
313
  </td>
314
314
  `;
315
315
  }
316
316
  if (t === U || t === j) {
317
- const n = t === U, i = n ? g.OMNIBUS_PRICE : g.OMNIBUS_DISCOUNT, a = n ? "omnibus-price-value" : "omnibus-discount-value", r = n ? l.omnibusPricePlaceholder : "-10%", d = n ? "product-omnibus-price" : "product-omnibus-discount", p = s ?? _(), u = $("font-size: 12px; color: #666666; margin: 0", p.pStyle), m = y(p.align ?? "left");
317
+ const n = t === U, 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 ?? _(), u = $("font-size: 12px; color: #666666; margin: 0", p.pStyle), m = y(p.align ?? "left");
318
318
  return `
319
319
  <td class="esd-block-text ${d}"
320
320
  data-text-before="" data-text-after=""
321
321
  esd-extension-block-id="${i}"${m}${b(p.tdStyle)}>
322
322
  <p contenteditable="false"${b(u)}>
323
323
  <span class="omnibus-text-before"></span>
324
- <span class="${a}">${c(r)}</span>
324
+ <span class="${r}">${c(a)}</span>
325
325
  <span class="omnibus-text-after"></span>
326
326
  </p>
327
327
  </td>
328
328
  `;
329
329
  }
330
330
  if (t.startsWith(E)) {
331
- const n = s ?? _(), i = e[t] ?? t.slice(E.length), r = 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"), u = g.CUSTOM_ATTRIBUTE;
331
+ const n = s ?? _(), 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"), u = g.CUSTOM_ATTRIBUTE;
332
332
  return `
333
333
  <td product-attr="${c(i)}"
334
334
  class="esd-block-text product-custom-attribute"
335
335
  esd-extension-block-id="${u}"${p}${b(n.tdStyle)}>
336
- <p contenteditable="false"${b(d)}>${c(r)}</p>
336
+ <p contenteditable="false"${b(d)}>${c(a)}</p>
337
337
  </td>
338
338
  `;
339
339
  }
340
340
  return null;
341
341
  }
342
342
  function ut(t, o) {
343
- const { composition: e, visibility: l, perElement: s, customAttrValues: n, cardBg: i } = o, a = i ? `background-color: ${c(i)}` : "", r = a ? `style="table-layout: fixed; ${a}"` : 'style="table-layout: fixed"', d = s[I] ?? {}, p = l[I] !== !1, u = d.width ? ` width="${d.width}"` : "", m = p ? "" : ' style="display: none"', h = `
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[v] ?? {}, p = l[v] !== !1, u = d.width ? ` width="${d.width}"` : "", m = p ? "" : ' style="display: none"', h = `
344
344
  <td width="120"
345
345
  class="esd-block-image product-image-cell recommendation-attribute-row es-p5"
346
346
  esd-extension-block-id="${g.IMAGE}"
347
- data-attribute-type="${I}"
347
+ data-attribute-type="${v}"
348
348
  data-visibility="${p ? "1" : "0"}"
349
349
  align="center" valign="middle"${m}>
350
350
  <a target="_blank" href="https://example.com/product/${t + 1}">
@@ -357,7 +357,7 @@ function ut(t, o) {
357
357
  <td class="product-info-cell" valign="middle" style="padding: 15px">
358
358
  <table cellpadding="0" cellspacing="0" role="presentation" width="100%"
359
359
  style="table-layout: fixed">
360
- <tbody>${e.filter((P) => P !== I && P !== k).map((P) => {
360
+ <tbody>${e.filter((P) => P !== v && P !== I).map((P) => {
361
361
  const B = l[P] !== !1, W = B ? "" : ' style="display: none"', tt = B ? "1" : "0", M = pt(P, s, n, o);
362
362
  return M ? `<tr class="recommendation-attribute-row"
363
363
  data-attribute-type="${c(P)}"
@@ -366,16 +366,16 @@ function ut(t, o) {
366
366
  `)}</tbody>
367
367
  </table>
368
368
  </td>
369
- `, f = s[k] ?? {}, C = l[k] !== !1, S = f.text || F, x = $(J, f.spanStyle ?? ""), A = $(X, f.aStyle ?? ""), Q = C ? "" : ' style="display: none"', Z = `
369
+ `, f = s[I] ?? {}, C = l[I] !== !1, S = f.text || F, x = $(J, f.spanStyle ?? ""), A = $(X, f.aStyle ?? ""), Q = C ? "" : ' style="display: none"', Z = `
370
370
  <td width="100"
371
371
  class="esd-block-button button-cell recommendation-attribute-row product-button es-p5l es-p5r"
372
372
  esd-extension-block-id="${g.BUTTON}"
373
- data-attribute-type="${k}"
373
+ data-attribute-type="${I}"
374
374
  data-visibility="${C ? "1" : "0"}"
375
375
  align="${c(f.align ?? "center")}" valign="middle"${Q}>
376
376
  <span class="es-button-border" style="${c(x)}">
377
377
  <a href="https://example.com/product/${t + 1}" target="_blank"
378
- class="es-button buy-button"
378
+ class="es-button reco-v3-button"
379
379
  style="${c(A)}">${c(S)}</a>
380
380
  </span>
381
381
  </td>
@@ -384,7 +384,7 @@ function ut(t, o) {
384
384
  <tr class="recommendation-product-row">
385
385
  <td style="padding: 0 5px">
386
386
  <table width="100%" cellpadding="0" cellspacing="0" border="0"
387
- class="product-card-wrapper" ${r}>
387
+ class="product-card-wrapper" ${a}>
388
388
  <tbody>
389
389
  <tr>${h}${w}${Z}</tr>
390
390
  </tbody>
@@ -400,13 +400,13 @@ function bt(t, o) {
400
400
  return e.join("");
401
401
  }
402
402
  function gt(t, o) {
403
- var r, d, p, u, m, h;
403
+ var a, d, p, u, m, h;
404
404
  const e = t == null ? void 0 : t.theme, l = [];
405
- (r = e == null ? void 0 : e.textStyle) != null && r["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"}`), (u = e == null ? void 0 : e.textStyle) != null && u["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 = ((h = e == null ? void 0 : e.textStyle) == null ? void 0 : h["font-weight"]) !== "normal", i = c(o), a = n ? `<strong>${i}</strong>` : i;
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"}`), (u = e == null ? void 0 : e.textStyle) != null && u["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 = ((h = e == null ? void 0 : e.textStyle) == null ? void 0 : h["font-weight"]) !== "normal", i = c(o), r = n ? `<strong>${i}</strong>` : i;
407
407
  return `
408
408
  <td class="esd-block-text es-p10t es-p10b es-p20l es-p20r" align="center">
409
- <p${b(s)}>${a}</p>
409
+ <p${b(s)}>${r}</p>
410
410
  </td>
411
411
  `;
412
412
  }
@@ -422,15 +422,15 @@ function xt(t) {
422
422
  titleText: s,
423
423
  extraClasses: n = "",
424
424
  legacyId: i,
425
- legacyBgColor: a
426
- } = t, r = parseInt(o.size) || 6, d = o.layout === "list" ? ' data-layout="list"' : "", p = o.layout === "list" ? " es-m-p0 ins-recommendation-list-layout" : "", u = {
425
+ legacyBgColor: r
426
+ } = t, a = parseInt(o.size) || 6, d = o.layout === "list" ? ' data-layout="list"' : "", p = o.layout === "list" ? " es-m-p0 ins-recommendation-list-layout" : "", u = {
427
427
  composition: e.composition,
428
428
  visibility: e.visibility,
429
429
  perElement: e.perElementStyles,
430
430
  customAttrValues: e.customAttrValues,
431
431
  cardBg: l,
432
- ...at(o.currency)
433
- }, m = o.layout === "list" ? bt(r, u) : dt(r, o.cardsInRow, u), h = gt(e.titleVariable, s), T = e.composition.join(","), w = JSON.stringify(e.customAttributes), f = [
432
+ ...rt(o.currency)
433
+ }, m = o.layout === "list" ? bt(a, u) : dt(a, o.cardsInRow, u), h = gt(e.titleVariable, s), T = e.composition.join(","), w = JSON.stringify(e.customAttributes), f = [
434
434
  "recommendation-block-v2",
435
435
  "esd-block-recommendation-v3-block",
436
436
  `es-p20${p}`,
@@ -443,7 +443,7 @@ function xt(t) {
443
443
  "esd-container-frame",
444
444
  "ins-recommendation-no-mobile-layout",
445
445
  n
446
- ].filter(Boolean).join(" "), C = mt(o.currency), S = ` esd-ext-config="${c(JSON.stringify(o))}"`, x = i ? ` id="${c(i)}"` : "", A = a ? ` bgcolor="${c(a)}"` : "";
446
+ ].filter(Boolean).join(" "), C = mt(o.currency), S = ` esd-ext-config="${c(JSON.stringify(o))}"`, x = i ? ` id="${c(i)}"` : "", A = r ? ` bgcolor="${c(r)}"` : "";
447
447
  return ot(`
448
448
  <td align="left"
449
449
  esd-extension-block-id="recommendation-block"
@@ -1,84 +1,139 @@
1
- const s = {
1
+ import { useTranslations as r } from "../../composables/useTranslations.js";
2
+ const l = {
2
3
  RECOMMENDATION_API_URL: "https://recommendationv2.api.useinsider.com"
3
- }, i = {
4
+ }, c = {
4
5
  CLIENT_ID: "clientId"
5
- }, u = [
6
- { id: 11, key: "similarViewed", name: "Viewed Together", path: "viewed-together" },
7
- { id: 12, key: "similarBought", name: "Purchased Together", path: "purchased-together" },
8
- { id: 13, key: "userBased", name: "User Based", path: "user-based" },
9
- { id: 36, key: "highestDiscounted", name: "Highest Discounted Items", path: "highest-discounted" },
10
- { id: 38, key: "manualMerchandising", name: "Manual Merchandising", path: "manual-merchandising" },
11
- { id: 39, key: "newArrivals", name: "New Arrivals", path: "new-arrivals" },
12
- { id: 40, key: "trendingProducts", name: "Trending Products", path: "trending" },
13
- { id: 46, key: "mostValuableOfPartner", name: "Most Valuable Products", path: "most-valuable" },
14
- { id: 61, key: "mostPopular", name: "Most Popular Items", path: "most-popular" },
15
- { id: 62, key: "mostPurchased", name: "Top Sellers", path: "top-sellers" }
16
- ], l = ["discount", "omnibus_price", "omnibus_discount", "price", "original_price"], c = [
6
+ }, d = () => {
7
+ const e = r();
8
+ return [
9
+ {
10
+ id: 11,
11
+ key: "similarViewed",
12
+ name: e("action-builder.similar-viewed"),
13
+ path: "viewed-together"
14
+ },
15
+ {
16
+ id: 12,
17
+ key: "similarBought",
18
+ name: e("action-builder.similar-bought"),
19
+ path: "purchased-together"
20
+ },
21
+ {
22
+ id: 13,
23
+ key: "userBased",
24
+ name: e("action-builder.user-based"),
25
+ path: "user-based"
26
+ },
27
+ {
28
+ id: 36,
29
+ key: "highestDiscounted",
30
+ name: e("journey-builder.highest-discounted-items"),
31
+ path: "highest-discounted"
32
+ },
33
+ {
34
+ id: 38,
35
+ key: "manualMerchandising",
36
+ name: e("action-builder.manual-merchandising"),
37
+ path: "manual-merchandising"
38
+ },
39
+ {
40
+ id: 39,
41
+ key: "newArrivals",
42
+ name: e("action-builder.new-arrivals"),
43
+ path: "new-arrivals"
44
+ },
45
+ {
46
+ id: 40,
47
+ key: "trendingProducts",
48
+ name: e("journey-builder.trending-products"),
49
+ path: "trending"
50
+ },
51
+ {
52
+ id: 46,
53
+ key: "mostValuableOfPartner",
54
+ name: e("journey-builder.most-valuable-products"),
55
+ path: "most-valuable"
56
+ },
57
+ {
58
+ id: 61,
59
+ key: "mostPopular",
60
+ name: e("journey-builder.most-popular-items"),
61
+ path: "most-popular"
62
+ },
63
+ {
64
+ id: 62,
65
+ key: "mostPurchased",
66
+ name: e("action-builder.most-purchased"),
67
+ path: "top-sellers"
68
+ }
69
+ ];
70
+ }, m = ["discount", "omnibus_price", "omnibus_discount", "price", "original_price"], p = [
17
71
  { text: "before the amount", value: "0" },
18
72
  { text: "after the amount", value: "1" }
19
- ], d = [
73
+ ], v = [
20
74
  { text: "dot(.)", value: "." },
21
75
  { text: "comma(,)", value: "," },
22
76
  { text: "space( )", value: " " }
23
- ], p = [
77
+ ], h = [
24
78
  { text: "0", value: "0" },
25
79
  { text: "1", value: "1" },
26
80
  { text: "2", value: "2" },
27
81
  { text: "3", value: "3" },
28
82
  { text: "4", value: "4" },
29
83
  { text: "5", value: "5" }
30
- ], e = [
84
+ ], a = "||", t = [
31
85
  { text: "is exactly", value: "=" },
32
86
  { text: "contains", value: "~" },
33
87
  { text: "does not contain", value: "!~" },
34
- { text: "any of", value: "||" }
35
- ], a = [
88
+ { text: "any of", value: a }
89
+ ], n = [
36
90
  { text: "is exactly", value: "=" },
37
91
  { text: "is not exactly", value: "!==" },
38
92
  { text: "contains", value: "~" },
39
93
  { text: "does not contain", value: "!~" },
40
- { text: "any of", value: "||" }
41
- ], r = [
94
+ { text: "any of", value: a }
95
+ ], o = [
42
96
  { text: "is equal to", value: "=" },
43
97
  { text: "is greater than", value: ">" },
44
98
  { text: "is less than", value: "<" }
45
- ], o = [
99
+ ], s = [
46
100
  { text: "is equal to", value: "=" },
47
101
  { text: "after", value: ">" },
48
102
  { text: "before", value: "<" }
49
- ], n = [
103
+ ], i = [
50
104
  { text: "true", value: "==" },
51
105
  { text: "false", value: "!=" }
52
- ], m = (t) => {
53
- if (!t)
54
- return e;
55
- switch (t) {
106
+ ], x = (e) => {
107
+ if (!e)
108
+ return t;
109
+ switch (e) {
56
110
  case "Boolean":
57
- return n;
111
+ return i;
58
112
  case "Date":
59
- return o;
113
+ return s;
60
114
  case "Number":
61
- return r;
115
+ return o;
62
116
  case "String":
63
- return e;
117
+ return t;
64
118
  case "Strings":
65
- return a;
119
+ return n;
66
120
  default:
67
- return e;
121
+ return t;
68
122
  }
69
123
  };
70
124
  export {
71
- l as PriceAttributes,
72
- i as QUERY_PARAMS,
73
- u as RecommendationFeedSourceMaps,
74
- s as URLS,
75
- p as currencyDecimalCounts,
76
- c as currencyLocationMaps,
77
- d as currencyOperators,
78
- m as getOperatorOptions,
79
- a as operatorOptionsForArrayOfStrings,
80
- n as operatorOptionsForBooleans,
81
- o as operatorOptionsForDates,
82
- r as operatorOptionsForNumbers,
83
- e as operatorOptionsForStrings
125
+ a as OP_ANY_OF,
126
+ m as PriceAttributes,
127
+ c as QUERY_PARAMS,
128
+ l as URLS,
129
+ h as currencyDecimalCounts,
130
+ p as currencyLocationMaps,
131
+ v as currencyOperators,
132
+ x as getOperatorOptions,
133
+ d as getRecommendationFeedSourceMaps,
134
+ n as operatorOptionsForArrayOfStrings,
135
+ i as operatorOptionsForBooleans,
136
+ s as operatorOptionsForDates,
137
+ o as operatorOptionsForNumbers,
138
+ t as operatorOptionsForStrings
84
139
  };