@useinsider/guido 3.3.0 → 3.4.0-beta.5d19726

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 (44) 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/migrator/radioButtonMigrator.js +30 -29
  14. package/dist/enums/extensions/recommendationBlock.js +101 -46
  15. package/dist/enums/unsubscribe.js +25 -24
  16. package/dist/extensions/Blocks/Checkbox/control.js +23 -23
  17. package/dist/extensions/Blocks/RadioButton/control.js +15 -15
  18. package/dist/extensions/Blocks/RadioButton/template.js +6 -6
  19. package/dist/extensions/Blocks/Recommendation/block.js +43 -36
  20. package/dist/extensions/Blocks/Recommendation/services/configService.js +33 -26
  21. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +35 -26
  22. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +3 -3
  23. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +3 -3
  24. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +3 -3
  25. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +25 -12
  26. package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +33 -0
  27. package/dist/guido.css +1 -1
  28. package/dist/node_modules/valibot/dist/index.js +252 -329
  29. package/dist/package.json.js +1 -1
  30. package/dist/services/unsubscribeApi.js +6 -6
  31. package/dist/src/composables/useCortexBlueprintBridge.d.ts +25 -0
  32. package/dist/src/composables/useEmailTemplateApplier.d.ts +21 -0
  33. package/dist/src/composables/useGuidoStateBridge.d.ts +22 -0
  34. package/dist/src/enums/extensions/recommendationBlock.d.ts +6 -1
  35. package/dist/src/enums/unsubscribe.d.ts +8 -3
  36. package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
  37. package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +11 -3
  38. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +7 -1
  39. package/dist/src/extensions/Blocks/Recommendation/utils/filterUtil.d.ts +2 -0
  40. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +21 -0
  41. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.test.d.ts +1 -0
  42. package/dist/src/stores/guido-email-editor.d.ts +41 -0
  43. package/dist/stores/guido-email-editor.js +20 -0
  44. package/package.json +5 -4
@@ -1,35 +1,37 @@
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";
1
+ import { useConfig as _ } from "./useConfig.js";
2
+ import { TemplateTypes as H } from "../enums/defaults.js";
3
+ import { DISPLAY_CONDITIONS_REGEX as P, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as G, CampaignCouldNotBeSavedKey as M, CanNotMakeAnyChangesForRunningKey as $ } from "../enums/html-validator.js";
4
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(a) {
13
- return [...a.matchAll(K)].map((u) => u[1]);
5
+ import { itemsBlockDynamicVariables as q } from "../extensions/Blocks/Items/enums/productEnums.js";
6
+ import { useRecommendationExtensionStore as X } from "../extensions/Blocks/Recommendation/store/recommendation.js";
7
+ import { RecommendationRequiredFieldsKey as j } from "../extensions/Blocks/Recommendation/validation/requiredFields.js";
8
+ import { useRecommendationStore as K } from "../stores/recommendation.js";
9
+ import { base64EncodeWithSpecialChars as z } from "../utils/base64.js";
10
+ import { useHttp as U } from "./useHttp.js";
11
+ import { useToaster as Y } from "./useToaster.js";
12
+ import { useTranslations as Z } from "./useTranslations.js";
13
+ const J = /recommendation-id="(\d+)"/g;
14
+ function Q(a) {
15
+ return [...a.matchAll(J)].map((u) => u[1]);
14
16
  }
15
- function Y(a, u) {
17
+ function ee(a, u) {
16
18
  return u.some((d) => a.startsWith(`${d}_`));
17
19
  }
18
- const ce = () => {
20
+ const ge = () => {
19
21
  var y, h;
20
- const { showToaster: a } = 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, b = async (e) => {
22
+ const { showToaster: a } = Y(), { post: u } = U(), { config: d } = _(), r = Z(), g = K(), S = X(), p = ((h = (y = d.value) == null ? void 0 : y.partner) == null ? void 0 : h.messageType) === H.transactional, b = async (e) => {
21
23
  const t = await u(
22
24
  "/newsletter/template-library/check-template-html-body",
23
- { html: X(e) }
25
+ { html: z(e) }
24
26
  ), { status: n, message: l } = t.data;
25
27
  return n || a({
26
28
  type: c.Alert,
27
29
  message: n === void 0 ? l : r("newsletter.invalid-url-link-for-toaster")
28
- }), r(P), l === r(G) && a({
30
+ }), r(M), l === r($) && a({
29
31
  type: c.Alert,
30
32
  message: r("newsletter.already-in-progress")
31
33
  }), n;
32
- }, w = (e) => !["if", "endif", "else", "elif", "now"].includes(e.toLowerCase()), S = (e) => ["if", "endif"].includes(e.toLowerCase()), E = (e, s) => {
34
+ }, w = (e) => !["if", "endif", "else", "elif", "now"].includes(e.toLowerCase()), E = (e) => ["if", "endif"].includes(e.toLowerCase()), A = (e, s) => {
33
35
  const t = e.match(/({%(.*?)%})/g);
34
36
  let n = !0;
35
37
  return t !== null && !p && t.forEach((l) => {
@@ -42,13 +44,13 @@ const ce = () => {
42
44
  }), n = !1);
43
45
  }
44
46
  }), n;
45
- }, A = async (e, s, t) => {
47
+ }, k = async (e, s, t) => {
46
48
  const n = t ? await b(e) : !0;
47
- return E(e, s) && n;
48
- }, I = (e) => e.length > 0 ? !0 : (a({
49
+ return A(e, s) && n;
50
+ }, x = (e) => e.length > 0 ? !0 : (a({
49
51
  type: c.Warning,
50
52
  message: r("newsletter.html-content-is-empty")
51
- }), !1), k = (e) => {
53
+ }), !1), I = (e) => {
52
54
  const s = (e.match(/{/gm) || []).length, t = (e.match(/}/gm) || []).length;
53
55
  return s > t && a({
54
56
  type: c.Warning,
@@ -57,7 +59,7 @@ const ce = () => {
57
59
  type: c.Warning,
58
60
  message: r("custom-fields.missing-opening-braces")
59
61
  }), s === t;
60
- }, x = (e) => {
62
+ }, F = (e) => {
61
63
  const s = e.match(/{{\s*(\w+\s+((\w+\|\w+)|(\w+)))\s*}}/gm) === null;
62
64
  return s || a({
63
65
  type: c.Warning,
@@ -66,10 +68,10 @@ const ce = () => {
66
68
  }, T = (e, s) => {
67
69
  const t = e.match(/{{([a-zA-Z0-9_\s]*)}}/gm);
68
70
  if (t && !p) {
69
- const n = new Set(s.map((i) => i.toLowerCase())), l = U(e), o = [];
71
+ const n = new Set(s.map((i) => i.toLowerCase())), l = Q(e), o = [];
70
72
  if (t.forEach((i) => {
71
73
  const m = i.slice(2, -2).trim().toLowerCase();
72
- (!n.has(m) || m === "") && !Y(m, l) && o.push(m);
74
+ (!n.has(m) || m === "") && !ee(m, l) && o.push(m);
73
75
  }), o.length > 0) {
74
76
  const i = `
75
77
  <ul>
@@ -83,11 +85,11 @@ const ce = () => {
83
85
  }
84
86
  }
85
87
  return !0;
86
- }, F = (e) => {
88
+ }, R = (e) => {
87
89
  const s = e.match(/{%(.*?)%}/g), t = [];
88
90
  let n = !0;
89
91
  if (s && s.forEach((l) => {
90
- const o = l.match(_), i = l.match(H), m = (o == null ? void 0 : o.join("")) || "";
92
+ const o = l.match(P), i = l.match(G), m = (o == null ? void 0 : o.join("")) || "";
91
93
  (!o || l !== m) && !i && (a({
92
94
  type: c.Alert,
93
95
  message: r("newsletter.display-conditions-invalid-syntax")
@@ -98,7 +100,7 @@ const ce = () => {
98
100
  }), n = !1);
99
101
  const v = f.match(/^[a-zA-Z]*$/g);
100
102
  v && v.forEach((C) => {
101
- S(C) && t.push(C);
103
+ E(C) && t.push(C);
102
104
  });
103
105
  });
104
106
  }), t.length) {
@@ -109,25 +111,28 @@ const ce = () => {
109
111
  }), n = !1);
110
112
  }
111
113
  return n;
112
- }, W = (e) => {
114
+ }, B = (e) => {
113
115
  const s = (e.match(/{% /gm) || []).length, t = (e.match(/ %}/gm) || []).length, n = s === t;
114
116
  return n || a({
115
117
  type: c.Warning,
116
118
  message: r("custom-conditions.no-space-after-braces")
117
119
  }), n;
118
- }, N = (e) => (e.match(/({%(.*?)%})/g) || []).filter((t) => t.includes("if")).map((t) => (t.match(/{{.*}}/gm) || []).length).reduce((t, n) => t + n, 0) > 0 ? (a({
120
+ }, W = (e) => (e.match(/({%(.*?)%})/g) || []).filter((t) => t.includes("if")).map((t) => (t.match(/{{.*}}/gm) || []).length).reduce((t, n) => t + n, 0) > 0 ? (a({
119
121
  type: c.Warning,
120
122
  message: r("custom-conditions.no-braces-inside-if-tag")
123
+ }), !1) : !0, N = () => S.hasInvalidBlock() ? (a({
124
+ type: c.Alert,
125
+ message: r(j)
121
126
  }), !1) : !0, O = () => g.recommendationConfigs && Object.values(g.recommendationConfigs).find((s) => s.filters.find((t) => t.value === "")) !== void 0 ? (a({
122
127
  type: c.Alert,
123
128
  message: r("newsletter.fill-all-necessary-fields")
124
- }), !1) : !0, B = (e) => {
129
+ }), !1) : !0, D = (e) => {
125
130
  const s = /src="[^"]*\.(svg|pst)"/gm;
126
131
  return e.match(s) === null ? !0 : (a({
127
132
  type: c.Alert,
128
133
  message: r("newsletter.invalid-image-type")
129
134
  }), !1);
130
- }, R = (e) => {
135
+ }, L = (e) => {
131
136
  const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".checkbox-block-v2");
132
137
  return Array.from(n).find((o) => {
133
138
  var i;
@@ -136,7 +141,7 @@ const ce = () => {
136
141
  type: c.Alert,
137
142
  message: r("unsubscribe-templates.select-checkbox-groups")
138
143
  }), !1) : !0;
139
- }, D = (e) => {
144
+ }, V = (e) => {
140
145
  const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".radio-button-v2");
141
146
  return Array.from(n).find((o) => {
142
147
  var i;
@@ -150,12 +155,12 @@ const ce = () => {
150
155
  var o, i;
151
156
  const n = [
152
157
  ...s.map((m) => m.value),
153
- ...M,
158
+ ...q,
154
159
  ...((i = (o = d.value) == null ? void 0 : o.template) == null ? void 0 : i.customFieldAttributes) ?? []
155
160
  ];
156
- 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);
161
+ return await k(e, n, t) && x(e) && I(e) && F(e) && T(e, n) && R(e) && B(e) && W(e) && N() && O() && D(e) && L(e) && V(e);
157
162
  } };
158
163
  };
159
164
  export {
160
- ce as useHtmlValidator
165
+ ge as useHtmlValidator
161
166
  };
@@ -1,4 +1,4 @@
1
- import { RecommendationFeedSourceMaps as I, URLS as C } from "../enums/extensions/recommendationBlock.js";
1
+ import { getRecommendationFeedSourceMaps as I, URLS as C } from "../enums/extensions/recommendationBlock.js";
2
2
  import { MinDeviceViewport as R, DefaultPadding as b } from "../enums/recommendation.js";
3
3
  import { useRecommendationExtensionStore as m } from "../extensions/Blocks/Recommendation/store/recommendation.js";
4
4
  import { generateCompleteFilterQuery as h } from "../extensions/Blocks/Recommendation/utils/filterUtil.js";
@@ -63,7 +63,7 @@ const w = () => ({
63
63
  shuffleProducts: o.shuffleProducts
64
64
  };
65
65
  }
66
- const f = ((l = I.find((i) => i.key === e.strategy)) == null ? void 0 : l.path) || "", t = new URLSearchParams();
66
+ const f = ((l = I().find((i) => i.key === e.strategy)) == null ? void 0 : l.path) || "", t = new URLSearchParams();
67
67
  if (t.set("locale", e.language), t.set("currency", e.currencyCode), t.set("partnerName", n.partnerName), t.set("size", e.size), t.set("details", "true"), t.set("campaignId", n.variationId), e.strategy === "manualMerchandising") {
68
68
  const i = parseInt(e.size) || 6;
69
69
  t.set("productId", e.productIds.slice(0, i).join(","));
@@ -1,5 +1,5 @@
1
1
  import { useDebounce as p } from "./useDebounce.js";
2
- import { ResponsivePreviewRegex as c, ResponsivePreviewSelectors as v, ResponsivePreviewConfig as a } from "../enums/preview.js";
2
+ import { ResponsivePreviewRegex as c, ResponsivePreviewConfig as a, ResponsivePreviewSelectors as v } from "../enums/preview.js";
3
3
  let i = null, l = null;
4
4
  const { debounce: y } = p(), h = (t) => {
5
5
  if (!t)
@@ -9,14 +9,14 @@ class B {
9
9
  }
10
10
  migrate(e) {
11
11
  try {
12
- const t = this.parser.parseFromString(e, "text/html"), i = t.querySelectorAll("td.radio-button-block"), s = t.querySelectorAll("td.radio-button-v2");
13
- if (i.length === 0 && s.length === 0)
12
+ const t = this.parser.parseFromString(e, "text/html"), s = t.querySelectorAll("td.radio-button-block"), i = t.querySelectorAll("td.radio-button-v2");
13
+ if (s.length === 0 && i.length === 0)
14
14
  return e;
15
15
  let o = !1;
16
- return i.forEach((r) => {
16
+ return s.forEach((r) => {
17
17
  if (r.classList.contains("radio-button-v2"))
18
18
  return;
19
- const n = r.getAttribute("id"), a = this.extractTextFromElement(r, "ins-title"), g = this.extractTextFromElement(r, "ins-description"), c = this.extractTextFromElement(r, "ins-subscribe"), u = this.extractTextFromElement(r, "ins-unsubscribe"), d = this.buildTextBlock(a), p = this.buildTextBlock(g), y = this.buildTextBlock({ ...c, classList: "" }), f = this.buildTextBlock({ ...u, classList: "" }), h = S.replace("{-{-TITLE-}-}", d).replace("{-{-DESCRIPTION-}-}", p).replace("{-{-YES-}-}", y).replace("{-{-NO-}-}", f), m = this.parser.parseFromString(
19
+ const n = r.getAttribute("id"), a = this.extractTextFromElement(r, "ins-title"), g = this.extractTextFromElement(r, "ins-description"), c = this.extractTextFromElement(r, "ins-subscribe"), u = this.extractTextFromElement(r, "ins-unsubscribe"), p = this.buildTextBlock(a), d = this.buildTextBlock(g), y = this.buildTextBlock({ ...c, classList: "" }), f = this.buildTextBlock({ ...u, classList: "" }), h = S.replace("{-{-TITLE-}-}", p).replace("{-{-DESCRIPTION-}-}", d).replace("{-{-YES-}-}", y).replace("{-{-NO-}-}", f), m = this.parser.parseFromString(
20
20
  `<table id="tempDoc"><tbody><tr>${h}</tr></tbody></table>`,
21
21
  "text/html"
22
22
  ).querySelector(".radio-button-v2");
@@ -28,25 +28,26 @@ class B {
28
28
  }
29
29
  healRadioButtonV2(e) {
30
30
  let t = !1;
31
- return e.querySelectorAll("td.radio-button-v2").forEach((i) => {
32
- var p;
33
- const s = i.querySelector("input#radioYes"), o = i.querySelector("input#radioNo");
34
- if (!s || !o)
31
+ return e.querySelectorAll("td.radio-button-v2").forEach((s) => {
32
+ var d;
33
+ s.classList.contains("radio-button-block") || (s.classList.add("radio-button-block"), t = !0);
34
+ const i = s.querySelector("input#radioYes"), o = s.querySelector("input#radioNo");
35
+ if (!i || !o)
35
36
  return;
36
- const r = ((p = s.parentElement) == null ? void 0 : p.querySelector(":scope > p")) || null;
37
- if (!r && !s.hasAttribute("align"))
37
+ const r = ((d = i.parentElement) == null ? void 0 : d.querySelector(":scope > p")) || null;
38
+ if (!r && !i.hasAttribute("align"))
38
39
  return;
39
- const n = s.closest("tr"), a = o.closest("tr");
40
+ const n = i.closest("tr"), a = o.closest("tr");
40
41
  if (!n || !a || n === a || !n.parentNode)
41
42
  return;
42
- const g = (r == null ? void 0 : r.innerHTML.trim()) || "Yes", c = a.cloneNode(!0), u = c.querySelector("input#radioNo"), d = c.querySelector("p");
43
- u && (u.setAttribute("id", "radioYes"), u.removeAttribute("align")), d && (d.innerHTML = g), n.parentNode.replaceChild(c, n), t = !0;
43
+ const g = (r == null ? void 0 : r.innerHTML.trim()) || "Yes", c = a.cloneNode(!0), u = c.querySelector("input#radioNo"), p = c.querySelector("p");
44
+ u && (u.setAttribute("id", "radioYes"), u.removeAttribute("align")), p && (p.innerHTML = g), n.parentNode.replaceChild(c, n), t = !0;
44
45
  }), t;
45
46
  }
46
47
  extractTextFromElement(e, t) {
47
- var p, y;
48
- const i = e.querySelector(`.${t}`);
49
- if (!i)
48
+ var d, y;
49
+ const s = e.querySelector(`.${t}`);
50
+ if (!s)
50
51
  return {
51
52
  text: t === "ins-title" ? "Title" : "Description",
52
53
  isBold: !1,
@@ -55,42 +56,42 @@ class B {
55
56
  styles: "",
56
57
  classList: ""
57
58
  };
58
- const s = i.querySelector("p");
59
- if (!s)
59
+ const i = s.querySelector("p");
60
+ if (!i)
60
61
  return {
61
- text: ((p = i.textContent) == null ? void 0 : p.trim()) || (t === "ins-title" ? "Title" : "Description"),
62
+ text: ((d = s.textContent) == null ? void 0 : d.trim()) || (t === "ins-title" ? "Title" : "Description"),
62
63
  isBold: !1,
63
64
  isItalic: !1,
64
- align: i.getAttribute("align") || "left",
65
+ align: s.getAttribute("align") || "left",
65
66
  styles: "",
66
67
  classList: ""
67
68
  };
68
- const o = ((y = s.textContent) == null ? void 0 : y.trim()) || (t === "ins-title" ? "Title" : "Description"), r = s.getAttribute("style") || "", n = i.getAttribute("align") || s.getAttribute("align") || "left", a = /font-weight\s*:\s*bold/i.test(r) || !!s.querySelector("b, strong"), g = /font-style\s*:\s*italic/i.test(r) || !!s.querySelector("i, em"), c = this.removeStyleProperties(r, ["font-weight", "font-style"]), u = this.convertInlineToBlock(c), d = i.getAttribute("class") || "";
69
+ const o = ((y = i.textContent) == null ? void 0 : y.trim()) || (t === "ins-title" ? "Title" : "Description"), r = i.getAttribute("style") || "", n = s.getAttribute("align") || i.getAttribute("align") || "left", a = /font-weight\s*:\s*bold/i.test(r) || !!i.querySelector("b, strong"), g = /font-style\s*:\s*italic/i.test(r) || !!i.querySelector("i, em"), c = this.removeStyleProperties(r, ["font-weight", "font-style"]), u = this.convertInlineToBlock(c), p = s.getAttribute("class") || "";
69
70
  return {
70
71
  text: o,
71
72
  isBold: a,
72
73
  isItalic: g,
73
74
  align: n,
74
75
  styles: u,
75
- classList: d
76
+ classList: p
76
77
  };
77
78
  }
78
79
  buildTextBlock(e) {
79
80
  let t = e.text;
80
81
  e.isBold && e.isItalic ? t = `<strong path="1,0"><em path="1,0,0">${t}</em></strong>` : e.isBold ? t = `<strong path="1,0">${t}</strong>` : e.isItalic && (t = `<em path="1,0">${t}</em>`);
81
- const i = e.align ? ` align="${e.align}"` : "", s = e.styles ? ` style="${e.styles.replaceAll('"', "'")}"` : "";
82
+ const s = e.align ? ` align="${e.align}"` : "", i = e.styles ? ` style="${e.styles.replaceAll('"', "'")}"` : "";
82
83
  return `
83
- <td class="esd-block-text ${e.classList}" ${i}>
84
- <p path="1" ${s}>
84
+ <td class="esd-block-text ${e.classList}" ${s}>
85
+ <p path="1" ${i}>
85
86
  ${t}
86
87
  </p>
87
88
  </td>
88
89
  `;
89
90
  }
90
91
  removeStyleProperties(e, t) {
91
- return e ? t.reduce((s, o) => {
92
+ return e ? t.reduce((i, o) => {
92
93
  const r = new RegExp(`${o}\\s*:\\s*[^;]*;?`, "gi");
93
- return s.replace(r, "");
94
+ return i.replace(r, "");
94
95
  }, e).replace(/;\s*;/g, ";").replace(/^;|;$/g, "").trim() : "";
95
96
  }
96
97
  convertInlineToBlock(e) {
@@ -100,9 +101,9 @@ class B {
100
101
  return /display\s*:/i.test(t) || (t = t ? `${t}; display: block` : "display: block"), t.replace(/;\s*;/g, ";").replace(/^;|;$/g, "").trim();
101
102
  }
102
103
  }
103
- function q(l) {
104
+ function L(l) {
104
105
  return new B().migrate(l);
105
106
  }
106
107
  export {
107
- q as migrateRadioButton
108
+ L as migrateRadioButton
108
109
  };
@@ -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
  };
@@ -1,32 +1,32 @@
1
1
  import { useTranslations as R } from "../composables/useTranslations.js";
2
- import { ProductType as s } from "../@types/config/schemas.js";
2
+ import { ProductType as n } from "../@types/config/schemas.js";
3
3
  import "../@types/config/defaults.js";
4
4
  import { getEnvironmentPrefix as S } from "../utils/environmentUtil.js";
5
- const B = {
5
+ const i = {
6
6
  UNSUBSCRIBE_LINK_TYPE: 1,
7
7
  PREFERENCES_LINK_TYPE: 3
8
- }, i = {
8
+ }, B = {
9
9
  UNSUBSCRIBE_LINK_REGEX: /{{ins-unsubscribe-link}}/g,
10
10
  DATA_OGSB_BUTTON_CSS_REGEX: "\\[data-ogsb\\]\\s*\\.es-button\\.es-button-[0-9]+\\s*\\{(?:[^\\}]*)\\}",
11
11
  GLOBAL_UNSUBSCRIBE_LINK_REGEX: /{{ins-global-unsubscribe-link}}/g,
12
12
  PREFERENCES_UNSUBSCRIBE_LINK_REGEX: /{{ins-preferences-unsubscribe-link}}/g
13
- }, n = S(), C = {
14
- UNSUBSCRIBE_URL: `https://mail.${n}.com/user/v1/unsub`,
15
- PREFERENCES_URL: `https://mail.${n}.com/user/v1/prefs`
13
+ }, s = S(), C = {
14
+ UNSUBSCRIBE_URL: `https://mail.${s}.com/user/v1/unsub`,
15
+ PREFERENCES_URL: `https://mail.${s}.com/user/v1/prefs`
16
16
  }, U = {
17
- [s.EMAIL]: "email",
18
- [s.ARCHITECT]: "journey",
19
- [s.UNSUBSCRIBE_PAGES]: "email"
20
- }, t = "iid", o = {
21
- name: "Global Unsubscribe",
22
- sendGridId: "G"
23
- }, c = "/email/unsubscribe-pages", E = {
17
+ [n.EMAIL]: "email",
18
+ [n.ARCHITECT]: "journey",
19
+ [n.UNSUBSCRIBE_PAGES]: "email"
20
+ }, o = "iid", r = "G", c = () => ({
21
+ name: R()("onboarding-center.email-subscribers-global-unsub-card-title"),
22
+ sendGridId: r
23
+ }), u = "/email/unsubscribe-pages", E = {
24
24
  GLOBAL_UNSUBSCRIBE: 1,
25
25
  GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE: 2,
26
26
  SUBSCRIPTION_PREFERENCE_CENTER: 3,
27
27
  SUBSCRIPTION_PREFERENCE_CONFIRMATION: 4,
28
28
  RESUBSCRIBE: 5
29
- }, u = {
29
+ }, b = {
30
30
  [E.GLOBAL_UNSUBSCRIBE]: "custom-unsubscribe",
31
31
  [E.SUBSCRIPTION_PREFERENCE_CENTER]: "custom-preferences"
32
32
  }, T = {
@@ -39,7 +39,7 @@ const B = {
39
39
  E.SUBSCRIPTION_PREFERENCE_CENTER,
40
40
  E.SUBSCRIPTION_PREFERENCE_CONFIRMATION
41
41
  ]
42
- }, b = () => {
42
+ }, P = () => {
43
43
  const e = R();
44
44
  return {
45
45
  [E.GLOBAL_UNSUBSCRIBE]: e("unsubscription-preference.type-global-unsubscribe"),
@@ -48,22 +48,23 @@ const B = {
48
48
  [E.SUBSCRIPTION_PREFERENCE_CENTER]: e("unsubscription-preference.type-subscription-preferences-center"),
49
49
  [E.SUBSCRIPTION_PREFERENCE_CONFIRMATION]: e("unsubscription-preference.type-subscription-preferences-confirmation")
50
50
  };
51
- }, P = {
51
+ }, O = {
52
52
  default: "{{ins-unsubscribe-link}}",
53
53
  [E.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
54
54
  [E.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
55
55
  };
56
56
  export {
57
- o as DEFAULT_UNSUBSCRIBE_GROUP,
58
- t as INSIDER_ID,
59
- i as LINK_REGEXES,
60
- B as LINK_TYPES,
61
- P as MERGE_TAGS,
57
+ r as DEFAULT_UNSUBSCRIBE_GROUP_SEND_GRID_ID,
58
+ o as INSIDER_ID,
59
+ B as LINK_REGEXES,
60
+ i as LINK_TYPES,
61
+ O as MERGE_TAGS,
62
62
  E as PAGE_TYPES,
63
63
  U as PRODUCT_TYPE_URL_SEGMENTS,
64
64
  T as TYPE_COLLECTIONS,
65
- c as UNSUBSCRIBE_PAGES_LINK,
66
- u as UNSUBSCRIBE_SYNC_MODULE_TYPES,
65
+ u as UNSUBSCRIBE_PAGES_LINK,
66
+ b as UNSUBSCRIBE_SYNC_MODULE_TYPES,
67
67
  C as URLS,
68
- b as getTypeTranslations
68
+ c as getDefaultUnsubscribeGroup,
69
+ P as getTypeTranslations
69
70
  };