@useinsider/guido 2.1.0-beta.07fb1d6 → 2.1.0-beta.0e87316

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 (50) hide show
  1. package/README.md +36 -0
  2. package/dist/@types/config/schemas.js +70 -65
  3. package/dist/components/Guido.vue.js +1 -1
  4. package/dist/components/Guido.vue2.js +69 -58
  5. package/dist/components/organisms/base/Toaster.vue.js +4 -4
  6. package/dist/components/organisms/base/Toaster.vue2.js +12 -9
  7. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +5 -5
  8. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +2 -2
  9. package/dist/composables/useBlocksConfig.js +26 -16
  10. package/dist/composables/useHtmlValidator.js +102 -100
  11. package/dist/config/compiler/utils/recommendationCompilerUtils.js +22 -17
  12. package/dist/config/migrator/itemsBlockMigrator.js +101 -97
  13. package/dist/enums/defaults.js +8 -4
  14. package/dist/extensions/Blocks/Recommendation/block.js +24 -23
  15. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +27 -26
  16. package/dist/extensions/Blocks/Recommendation/constants/layout.js +6 -4
  17. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +12 -10
  18. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +80 -47
  19. package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +87 -37
  20. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +138 -117
  21. package/dist/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.js +21 -0
  22. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +11 -13
  23. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +25 -30
  24. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +27 -30
  25. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +20 -25
  26. package/dist/extensions/Blocks/Recommendation/templates/utils.js +31 -15
  27. package/dist/extensions/ModulesTabIcons/extension.js +17 -0
  28. package/dist/guido.css +1 -1
  29. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +257 -187
  30. package/dist/services/stripoApi.js +20 -17
  31. package/dist/src/@types/config/schemas.d.ts +8 -0
  32. package/dist/src/composables/useConfig.d.ts +4 -0
  33. package/dist/src/enums/defaults.d.ts +4 -0
  34. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +2 -2
  35. package/dist/src/extensions/Blocks/Recommendation/constants/layout.d.ts +6 -0
  36. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +4 -0
  37. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +12 -0
  38. package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +22 -4
  39. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +9 -2
  40. package/dist/src/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.d.ts +29 -0
  41. package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +1 -1
  42. package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +2 -0
  43. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +11 -2
  44. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -0
  45. package/dist/src/extensions/ModulesTabIcons/extension.d.ts +2 -0
  46. package/dist/src/stores/config.d.ts +36 -0
  47. package/dist/static/styles/customEditorStyle.css.js +10 -9
  48. package/dist/static/templates/empty/index.html.js +74 -0
  49. package/dist/static/templates/empty/style.css.js +779 -0
  50. package/package.json +1 -1
@@ -1,5 +1,6 @@
1
+ import r from "../extensions/ModulesTabIcons/extension.js";
1
2
  import { useConfigStore as l } from "../stores/config.js";
2
- const r = {
3
+ const a = {
3
4
  "amp-accordion": "ampAccordionEnabled",
4
5
  "amp-carousel": "ampCarouselEnabled",
5
6
  "amp-form-controls": "ampFormControlsEnabled",
@@ -13,7 +14,7 @@ const r = {
13
14
  "text-block": "textEnabled",
14
15
  "timer-block": "timerEnabled",
15
16
  "video-block": "videoEnabled"
16
- }, c = {
17
+ }, s = {
17
18
  "dynamic-content": () => import("../extensions/DynamicContent/extension.js"),
18
19
  "checkbox-block": () => import("../extensions/Blocks/Checkbox/extension.js"),
19
20
  "radio-button-block": () => import("../extensions/Blocks/RadioButton/extension.js"),
@@ -21,31 +22,40 @@ const r = {
21
22
  "unsubscribe-block": () => import("../extensions/Blocks/Unsubscribe/extension.js"),
22
23
  "coupon-block": () => import("../extensions/Blocks/CouponBlock/extension.js"),
23
24
  "items-block": () => import("../extensions/Blocks/Items/extension.js")
24
- }, a = (n) => {
25
+ }, i = (n) => {
25
26
  if (!n || !n.length)
26
27
  return {};
27
- const e = {};
28
+ const t = {};
28
29
  return n.forEach((o) => {
29
- const t = r[o];
30
- t && (e[t] = !1);
31
- }), e;
32
- }, i = async (n) => !n || !n.length ? [] : (await Promise.all(
33
- n.map(async (o) => {
34
- const t = c[o];
35
- return t ? (await t()).default : null;
36
- })
37
- )).filter((o) => o !== null), m = () => {
30
+ const e = a[o];
31
+ e && (t[e] = !1);
32
+ }), t;
33
+ }, b = () => [r], m = async (n) => {
34
+ const t = b();
35
+ if (!n || !n.length)
36
+ return t;
37
+ const o = await Promise.all(
38
+ n.map(async (e) => {
39
+ const c = s[e];
40
+ return c ? (await c()).default : null;
41
+ })
42
+ );
43
+ return [
44
+ ...t,
45
+ ...o.filter((e) => e !== null)
46
+ ];
47
+ }, E = () => {
38
48
  const n = l();
39
49
  return {
40
50
  getStripoBlocksConfig: async () => {
41
51
  const o = n.blocks;
42
52
  return {
43
- baseBlocks: a(o == null ? void 0 : o.excludeDefaults),
44
- extensions: await i(o == null ? void 0 : o.includeCustoms)
53
+ baseBlocks: i(o == null ? void 0 : o.excludeDefaults),
54
+ extensions: await m(o == null ? void 0 : o.includeCustoms)
45
55
  };
46
56
  }
47
57
  };
48
58
  };
49
59
  export {
50
- m as useBlocksConfig
60
+ E as useBlocksConfig
51
61
  };
@@ -1,155 +1,157 @@
1
- import { useConfig as R } from "./useConfig.js";
2
- import { TemplateTypes as D } from "../enums/defaults.js";
3
- import { DISPLAY_CONDITIONS_REGEX as H, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as _, CampaignCouldNotBeSavedKey as P, CanNotMakeAnyChangesForRunningKey as $ } from "../enums/html-validator.js";
4
- import { ToasterTypeOptions as l } from "../enums/toaster.js";
5
- import { itemsBlockDynamicVariables as j } from "../extensions/Blocks/Items/enums/productEnums.js";
6
- import { useRecommendationExtensionStore as G } from "../extensions/Blocks/Recommendation/store/recommendation.js";
7
- import { useRecommendationStore as q } from "../stores/recommendation.js";
8
- import { base64EncodeWithSpecialChars as M } from "../utils/base64.js";
9
- import { useHttp as X } from "./useHttp.js";
10
- import { useToaster as z } from "./useToaster.js";
11
- import { useTranslations as K } from "./useTranslations.js";
12
- function U(r) {
13
- const m = G();
14
- return Object.keys(m.blockStates).some((i) => r.startsWith(`${i}_`));
1
+ import { useConfig as L } from "./useConfig.js";
2
+ import { TemplateTypes as V } from "../enums/defaults.js";
3
+ import { DISPLAY_CONDITIONS_REGEX as _, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as H, CampaignCouldNotBeSavedKey as P, CanNotMakeAnyChangesForRunningKey as G } from "../enums/html-validator.js";
4
+ import { ToasterTypeOptions as c } from "../enums/toaster.js";
5
+ import { itemsBlockDynamicVariables as M } from "../extensions/Blocks/Items/enums/productEnums.js";
6
+ import { useRecommendationStore as $ } from "../stores/recommendation.js";
7
+ import { base64EncodeWithSpecialChars as X } from "../utils/base64.js";
8
+ import { useHttp as j } from "./useHttp.js";
9
+ import { useToaster as q } from "./useToaster.js";
10
+ import { useTranslations as z } from "./useTranslations.js";
11
+ const K = /recommendation-id="(\d+)"/g;
12
+ function U(i) {
13
+ return [...i.matchAll(K)].map((u) => u[1]);
14
+ }
15
+ function Y(i, u) {
16
+ return u.some((d) => i.startsWith(`${d}_`));
15
17
  }
16
18
  const ce = () => {
17
- var g, p;
18
- const { showToaster: r } = z(), { post: m } = X(), { config: u } = R(), i = K(), d = q(), f = ((p = (g = u.value) == null ? void 0 : g.partner) == null ? void 0 : p.messageType) === D.transactional, C = async (e) => {
19
- const t = await m(
19
+ var y, h;
20
+ const { showToaster: i } = q(), { post: u } = j(), { config: d } = L(), r = z(), g = $(), p = ((h = (y = d.value) == null ? void 0 : y.partner) == null ? void 0 : h.messageType) === V.transactional, w = async (e) => {
21
+ const t = await u(
20
22
  "/newsletter/template-library/check-template-html-body",
21
- { html: M(e) }
22
- ), { status: n, message: c } = t.data;
23
- return n || r({
24
- type: l.Alert,
25
- message: n === void 0 ? c : i("newsletter.invalid-url-link-for-toaster")
26
- }), i(P), c === i($) && r({
27
- type: l.Alert,
28
- message: i("newsletter.already-in-progress")
23
+ { html: X(e) }
24
+ ), { status: n, message: l } = t.data;
25
+ return n || i({
26
+ type: c.Alert,
27
+ message: n === void 0 ? l : r("newsletter.invalid-url-link-for-toaster")
28
+ }), r(P), l === r(G) && i({
29
+ type: c.Alert,
30
+ message: r("newsletter.already-in-progress")
29
31
  }), n;
30
- }, b = (e) => !["if", "endif", "else", "elif", "now"].includes(e.toLowerCase()), S = (e) => ["if", "endif"].includes(e.toLowerCase()), w = (e, s) => {
32
+ }, b = (e) => !["if", "endif", "else", "elif", "now"].includes(e.toLowerCase()), S = (e) => ["if", "endif"].includes(e.toLowerCase()), E = (e, s) => {
31
33
  const t = e.match(/({%(.*?)%})/g);
32
34
  let n = !0;
33
- return t !== null && !f && t.forEach((c) => {
34
- const o = c.slice(2, -2).trim().match(/(".*?"|[^"\s]+)(?=\s*|\s*$)/g);
35
+ return t !== null && !p && t.forEach((l) => {
36
+ const o = l.slice(2, -2).trim().match(/(".*?"|[^"\s]+)(?=\s*|\s*$)/g);
35
37
  if (o && o.length > 0) {
36
38
  const [a] = o;
37
- b(a) && !s.includes(a) && (r({
38
- type: l.Warning,
39
- message: i("custom-fields.invalid-custom-fields")
39
+ b(a) && !s.includes(a) && (i({
40
+ type: c.Warning,
41
+ message: r("custom-fields.invalid-custom-fields")
40
42
  }), n = !1);
41
43
  }
42
44
  }), n;
43
- }, E = async (e, s, t) => {
44
- const n = t ? await C(e) : !0;
45
- return w(e, s) && n;
46
- }, k = (e) => e.length > 0 ? !0 : (r({
47
- type: l.Warning,
48
- message: i("newsletter.html-content-is-empty")
49
- }), !1), A = (e) => {
45
+ }, A = async (e, s, t) => {
46
+ const n = t ? await w(e) : !0;
47
+ return E(e, s) && n;
48
+ }, I = (e) => e.length > 0 ? !0 : (i({
49
+ type: c.Warning,
50
+ message: r("newsletter.html-content-is-empty")
51
+ }), !1), k = (e) => {
50
52
  const s = (e.match(/{/gm) || []).length, t = (e.match(/}/gm) || []).length;
51
- return s > t && r({
52
- type: l.Warning,
53
- message: i("custom-fields.missing-closing-braces")
54
- }), s < t && r({
55
- type: l.Warning,
56
- message: i("custom-fields.missing-opening-braces")
53
+ return s > t && i({
54
+ type: c.Warning,
55
+ message: r("custom-fields.missing-closing-braces")
56
+ }), s < t && i({
57
+ type: c.Warning,
58
+ message: r("custom-fields.missing-opening-braces")
57
59
  }), s === t;
58
60
  }, x = (e) => {
59
61
  const s = e.match(/{{\s*(\w+\s+((\w+\|\w+)|(\w+)))\s*}}/gm) === null;
60
- return s || r({
61
- type: l.Warning,
62
- message: i("custom-fields.invalid-custom-fields")
62
+ return s || i({
63
+ type: c.Warning,
64
+ message: r("custom-fields.invalid-custom-fields")
63
65
  }), s;
64
- }, I = (e, s) => {
66
+ }, T = (e, s) => {
65
67
  const t = e.match(/{{([a-zA-Z0-9_\s]*)}}/gm);
66
- if (t && !f) {
67
- const n = new Set(s.map((o) => o.toLowerCase())), c = [];
68
- if (t.forEach((o) => {
69
- const a = o.slice(2, -2).trim().toLowerCase();
70
- (!n.has(a) || a === "") && !U(a) && c.push(a);
71
- }), c.length > 0) {
72
- const o = `
68
+ if (t && !p) {
69
+ const n = new Set(s.map((a) => a.toLowerCase())), l = U(e), o = [];
70
+ if (t.forEach((a) => {
71
+ const m = a.slice(2, -2).trim().toLowerCase();
72
+ (!n.has(m) || m === "") && !Y(m, l) && o.push(m);
73
+ }), o.length > 0) {
74
+ const a = `
73
75
  <ul>
74
- ${c.map((a) => `<li>${a}</li>`).join("")}
76
+ ${o.map((m) => `<li>${m}</li>`).join("")}
75
77
  </ul>
76
78
  `;
77
- return r({
78
- type: l.Alert,
79
- message: i("custom-fields.invalid-custom-fields") + o
79
+ return i({
80
+ type: c.Alert,
81
+ message: r("custom-fields.invalid-custom-fields") + a
80
82
  }), !1;
81
83
  }
82
84
  }
83
85
  return !0;
84
- }, T = (e) => {
86
+ }, F = (e) => {
85
87
  const s = e.match(/{%(.*?)%}/g), t = [];
86
88
  let n = !0;
87
- if (s && s.forEach((c) => {
88
- const o = c.match(H), a = c.match(_), B = (o == null ? void 0 : o.join("")) || "";
89
- (!o || c !== B) && !a && (r({
90
- type: l.Alert,
91
- message: i("newsletter.display-conditions-invalid-syntax")
92
- }), n = !1), o && o.forEach((y) => {
93
- y.trim() === "=" && (r({
94
- type: l.Alert,
95
- message: i("custom-conditions.wrong-equality-operators")
89
+ if (s && s.forEach((l) => {
90
+ const o = l.match(_), a = l.match(H), m = (o == null ? void 0 : o.join("")) || "";
91
+ (!o || l !== m) && !a && (i({
92
+ type: c.Alert,
93
+ message: r("newsletter.display-conditions-invalid-syntax")
94
+ }), n = !1), o && o.forEach((f) => {
95
+ f.trim() === "=" && (i({
96
+ type: c.Alert,
97
+ message: r("custom-conditions.wrong-equality-operators")
96
98
  }), n = !1);
97
- const h = y.match(/^[a-zA-Z]*$/g);
98
- h && h.forEach((v) => {
99
- S(v) && t.push(v);
99
+ const v = f.match(/^[a-zA-Z]*$/g);
100
+ v && v.forEach((C) => {
101
+ S(C) && t.push(C);
100
102
  });
101
103
  });
102
104
  }), t.length) {
103
- const c = t.filter((a) => a === "if"), o = t.filter((a) => a === "endif");
104
- c.length !== o.length && (r({
105
- type: l.Alert,
106
- message: i("custom-conditions.missing-if-endif-tag")
105
+ const l = t.filter((a) => a === "if"), o = t.filter((a) => a === "endif");
106
+ l.length !== o.length && (i({
107
+ type: c.Alert,
108
+ message: r("custom-conditions.missing-if-endif-tag")
107
109
  }), n = !1);
108
110
  }
109
111
  return n;
110
- }, F = (e) => {
112
+ }, W = (e) => {
111
113
  const s = (e.match(/{% /gm) || []).length, t = (e.match(/ %}/gm) || []).length, n = s === t;
112
- return n || r({
113
- type: l.Warning,
114
- message: i("custom-conditions.no-space-after-braces")
114
+ return n || i({
115
+ type: c.Warning,
116
+ message: r("custom-conditions.no-space-after-braces")
115
117
  }), n;
116
- }, W = (e) => (e.match(/({%(.*?)%})/g) || []).filter((t) => t.includes("if")).map((t) => (t.match(/{{.*}}/gm) || []).length).reduce((t, n) => t + n, 0) > 0 ? (r({
117
- type: l.Warning,
118
- message: i("custom-conditions.no-braces-inside-if-tag")
119
- }), !1) : !0, O = () => d.recommendationConfigs && Object.values(d.recommendationConfigs).find((s) => s.filters.find((t) => t.value === "")) !== void 0 ? (r({
120
- type: l.Alert,
121
- message: i("newsletter.fill-all-necessary-fields")
122
- }), !1) : !0, L = (e) => {
118
+ }, N = (e) => (e.match(/({%(.*?)%})/g) || []).filter((t) => t.includes("if")).map((t) => (t.match(/{{.*}}/gm) || []).length).reduce((t, n) => t + n, 0) > 0 ? (i({
119
+ type: c.Warning,
120
+ message: r("custom-conditions.no-braces-inside-if-tag")
121
+ }), !1) : !0, O = () => g.recommendationConfigs && Object.values(g.recommendationConfigs).find((s) => s.filters.find((t) => t.value === "")) !== void 0 ? (i({
122
+ type: c.Alert,
123
+ message: r("newsletter.fill-all-necessary-fields")
124
+ }), !1) : !0, B = (e) => {
123
125
  const s = /src="[^"]*\.(svg|pst)"/gm;
124
- return e.match(s) === null ? !0 : (r({
125
- type: l.Alert,
126
- message: i("newsletter.invalid-image-type")
126
+ return e.match(s) === null ? !0 : (i({
127
+ type: c.Alert,
128
+ message: r("newsletter.invalid-image-type")
127
129
  }), !1);
128
- }, N = (e) => {
130
+ }, R = (e) => {
129
131
  const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".checkbox-block-v2");
130
132
  return Array.from(n).find((o) => {
131
133
  var a;
132
134
  return !((a = o.id) != null && a.trim());
133
- }) ? (r({
134
- type: l.Alert,
135
- message: i("unsubscribe-templates.select-checkbox-groups")
135
+ }) ? (i({
136
+ type: c.Alert,
137
+ message: r("unsubscribe-templates.select-checkbox-groups")
136
138
  }), !1) : !0;
137
- }, V = (e) => {
139
+ }, D = (e) => {
138
140
  const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".radio-button-v2");
139
141
  return Array.from(n).find((o) => {
140
142
  var a;
141
143
  return !((a = o.id) != null && a.trim());
142
- }) ? (r({
143
- type: l.Alert,
144
- message: i("unsubscribe-templates.select-radio-button-groups")
144
+ }) ? (i({
145
+ type: c.Alert,
146
+ message: r("unsubscribe-templates.select-radio-button-groups")
145
147
  }), !1) : !0;
146
148
  };
147
149
  return { validateHtml: async (e, s, t = !1) => {
148
150
  const n = [
149
151
  ...s.map((o) => o.value),
150
- ...j
152
+ ...M
151
153
  ];
152
- return await E(e, n, t) && k(e) && A(e) && x(e) && I(e, n) && T(e) && F(e) && W(e) && O() && L(e) && N(e) && V(e);
154
+ return await A(e, n, t) && I(e) && k(e) && x(e) && T(e, n) && F(e) && W(e) && N(e) && O() && B(e) && R(e) && D(e);
153
155
  } };
154
156
  };
155
157
  export {
@@ -1,9 +1,9 @@
1
1
  import { useRecommendation as _ } from "../../../composables/useRecommendation.js";
2
2
  function b(e, u, r, o) {
3
- const s = `{{${e}_${u}_${r}}}`, t = `{{${e}_${u}_currency}}`;
4
- return o === "before" ? `${t} ${s}` : `${s} ${t}`;
3
+ const n = `{{${e}_${u}_${r}}}`, t = `{{${e}_${u}_currency}}`;
4
+ return o === "before" ? `${t} ${n}` : `${n} ${t}`;
5
5
  }
6
- function p(e, u, r, o, s) {
6
+ function p(e, u, r, o, n) {
7
7
  switch (u) {
8
8
  case "productImage": {
9
9
  const t = e.querySelector("img");
@@ -24,7 +24,7 @@ function p(e, u, r, o, s) {
24
24
  const t = e.querySelector("p");
25
25
  if (t) {
26
26
  const c = t.querySelector("strong") || t;
27
- c.textContent = b(r, o, "price", s);
27
+ c.textContent = b(r, o, "price", n);
28
28
  }
29
29
  break;
30
30
  }
@@ -36,7 +36,7 @@ function p(e, u, r, o, s) {
36
36
  r,
37
37
  o,
38
38
  "original_price",
39
- s
39
+ n
40
40
  ), t.setAttribute("product-attr", "discount");
41
41
  }
42
42
  break;
@@ -67,12 +67,12 @@ function p(e, u, r, o, s) {
67
67
  }
68
68
  }
69
69
  function $(e, u, r) {
70
- e.querySelectorAll(".recommendation-product-row").forEach((s, t) => {
71
- s.querySelectorAll("[data-attribute-type]").forEach((n) => {
72
- const i = n.getAttribute("data-attribute-type") || "", a = n.querySelectorAll(".attribute-cell");
70
+ e.querySelectorAll(".recommendation-product-row").forEach((n, t) => {
71
+ n.querySelectorAll("[data-attribute-type]").forEach((s) => {
72
+ const i = s.getAttribute("data-attribute-type") || "", a = s.querySelectorAll(".attribute-cell");
73
73
  a.length > 0 ? a.forEach((l) => {
74
74
  p(l, i, u, t, r);
75
- }) : p(n, i, u, t, r);
75
+ }) : p(s, i, u, t, r);
76
76
  });
77
77
  });
78
78
  }
@@ -80,9 +80,9 @@ function S(e, u, r) {
80
80
  const o = e.querySelectorAll(".recommendation-product-row");
81
81
  if (!o.length)
82
82
  return;
83
- const [s] = o, t = s.querySelector("[data-attribute-type]"), c = t ? t.querySelectorAll(".attribute-cell").length : 1;
84
- o.forEach((n, i) => {
85
- n.querySelectorAll("[data-attribute-type]").forEach((l) => {
83
+ const [n] = o, t = n.querySelector("[data-attribute-type]"), c = t ? t.querySelectorAll(".attribute-cell").length : 1;
84
+ o.forEach((s, i) => {
85
+ s.querySelectorAll("[data-attribute-type]").forEach((l) => {
86
86
  const f = l.getAttribute("data-attribute-type") || "";
87
87
  l.querySelectorAll(".attribute-cell").forEach((y, m) => {
88
88
  const A = i * c + m;
@@ -91,9 +91,14 @@ function S(e, u, r) {
91
91
  });
92
92
  });
93
93
  }
94
- function q(e, u) {
94
+ function q(e, u, r) {
95
+ e.querySelectorAll(".ins-recommendation-product-container").forEach((n) => {
96
+ S(n, u, r);
97
+ });
98
+ }
99
+ function d(e, u) {
95
100
  const r = e.getAttribute("data-layout") || "grid", o = e.getAttribute("currency-alignment") || "after";
96
- r === "list" ? $(e, u, o) : S(e, u, o);
101
+ r === "list" ? $(e, u, o) : q(e, u, o);
97
102
  }
98
103
  function h(e, u) {
99
104
  const r = e.match(/<!DOCTYPE[^>]*>/i);
@@ -104,10 +109,10 @@ function w(e) {
104
109
  const u = e.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), r = new DOMParser().parseFromString(u, "text/html"), o = r.querySelectorAll(".ins-recommendation-v3-block-v2");
105
110
  if (!o.length)
106
111
  return e;
107
- const { buildCampaignUrl: s } = _();
112
+ const { buildCampaignUrl: n } = _();
108
113
  return o.forEach((c) => {
109
- const n = c.getAttribute("recommendation-id");
110
- n && (s(n), q(c, n));
114
+ const s = c.getAttribute("recommendation-id");
115
+ s && (n(s), d(c, s));
111
116
  }), h(u, r).replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("&lt;!--{%", "{%").replaceAll("%}--&gt;", "%}");
112
117
  }
113
118
  export {