@useinsider/guido 3.3.0-beta.c1e1d7e → 3.3.0-beta.ddabd14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/components/Guido.vue.js +1 -1
  2. package/dist/components/Guido.vue2.js +103 -89
  3. package/dist/components/organisms/extensions/recommendation/FilterItem.vue.js +9 -11
  4. package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +70 -35
  5. package/dist/components/organisms/header/MiddleSlot.vue.js +7 -7
  6. package/dist/composables/useCortexBlueprintBridge.js +66 -0
  7. package/dist/composables/useCustomInterfaceAppearance.js +18 -16
  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/useStripo.js +56 -54
  13. package/dist/config/migrator/index.js +21 -10
  14. package/dist/config/migrator/radioButtonMigrator.js +73 -48
  15. package/dist/enums/extensions/recommendationBlock.js +101 -46
  16. package/dist/enums/unsubscribe.js +25 -24
  17. package/dist/extensions/Blocks/Checkbox/control.js +23 -23
  18. package/dist/extensions/Blocks/RadioButton/control.js +15 -15
  19. package/dist/extensions/Blocks/RadioButton/template.js +6 -6
  20. package/dist/extensions/Blocks/Recommendation/block.js +43 -36
  21. package/dist/extensions/Blocks/Recommendation/services/configService.js +33 -26
  22. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +35 -26
  23. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +25 -12
  24. package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +33 -0
  25. package/dist/guido.css +1 -1
  26. package/dist/services/unsubscribeApi.js +6 -6
  27. package/dist/src/composables/useCortexBlueprintBridge.d.ts +25 -0
  28. package/dist/src/composables/useEmailTemplateApplier.d.ts +21 -0
  29. package/dist/src/composables/useGuidoStateBridge.d.ts +22 -0
  30. package/dist/src/enums/extensions/recommendationBlock.d.ts +6 -1
  31. package/dist/src/enums/unsubscribe.d.ts +8 -3
  32. package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
  33. package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +11 -3
  34. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +7 -1
  35. package/dist/src/extensions/Blocks/Recommendation/utils/filterUtil.d.ts +2 -0
  36. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +21 -0
  37. package/dist/src/stores/guido-email-editor.d.ts +41 -0
  38. package/dist/static/styles/components/notification.css.js +74 -0
  39. package/dist/stores/guido-email-editor.js +20 -0
  40. package/dist/utils/templatePreparation.js +57 -50
  41. package/package.json +1 -1
  42. package/dist/composables/useStripoNotifications.js +0 -30
  43. package/dist/src/composables/useStripoNotifications.d.ts +0 -4
@@ -1,52 +1,77 @@
1
- var x = Object.defineProperty;
2
- var T = (l, e, t) => e in l ? x(l, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[e] = t;
3
- var b = (l, e, t) => T(l, typeof e != "symbol" ? e + "" : e, t);
4
- import S from "../../extensions/Blocks/RadioButton/template.js";
5
- class B {
1
+ var L = Object.defineProperty;
2
+ var v = (a, e, t) => e in a ? L(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
3
+ var f = (a, e, t) => v(a, typeof e != "symbol" ? e + "" : e, t);
4
+ import A from "../../extensions/Blocks/RadioButton/template.js";
5
+ class k {
6
6
  constructor() {
7
- b(this, "parser");
7
+ f(this, "parser");
8
8
  this.parser = new DOMParser();
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)
14
- return e;
15
- let o = !1;
16
- return i.forEach((r) => {
17
- if (r.classList.contains("radio-button-v2"))
12
+ const t = this.parser.parseFromString(e, "text/html"), r = t.querySelectorAll("td.radio-button-block"), s = t.querySelectorAll("td.radio-button-v2");
13
+ if (r.length === 0 && s.length === 0)
14
+ return console.debug("[guido:radio-migrator] skip", { reason: "no radio blocks" }), e;
15
+ console.debug("[guido:radio-migrator] entry", {
16
+ v1BlockCount: r.length,
17
+ v2BlockCount: s.length,
18
+ inputLength: e.length
19
+ });
20
+ let n = !1, i = 0;
21
+ r.forEach((o) => {
22
+ if (o.classList.contains("radio-button-v2"))
18
23
  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(
20
- `<table id="tempDoc"><tbody><tr>${h}</tr></tbody></table>`,
24
+ const d = o.getAttribute("id"), p = this.extractTextFromElement(o, "ins-title"), g = this.extractTextFromElement(o, "ins-description"), b = this.extractTextFromElement(o, "ins-subscribe"), m = this.extractTextFromElement(o, "ins-unsubscribe"), y = this.buildTextBlock(p), x = this.buildTextBlock(g), T = this.buildTextBlock({ ...b, classList: "" }), B = this.buildTextBlock({ ...m, classList: "" }), S = A.replace("{-{-TITLE-}-}", y).replace("{-{-DESCRIPTION-}-}", x).replace("{-{-YES-}-}", T).replace("{-{-NO-}-}", B), h = this.parser.parseFromString(
25
+ `<table id="tempDoc"><tbody><tr>${S}</tr></tbody></table>`,
21
26
  "text/html"
22
27
  ).querySelector(".radio-button-v2");
23
- m && r.parentNode && (m.setAttribute("id", n || ""), r.parentNode.replaceChild(m, r), o = !0);
24
- }), o = this.healRadioButtonV2(t) || o, o ? t.documentElement.outerHTML : e;
28
+ h && o.parentNode && (h.setAttribute("id", d || ""), o.parentNode.replaceChild(h, o), n = !0, i++);
29
+ });
30
+ const l = this.healRadioButtonV2(t);
31
+ n = l || n;
32
+ const c = n ? t.documentElement.outerHTML : e, u = (c.match(/<td[^>]*radio-button-v2[^>]*>/gi) ?? []).map((o) => {
33
+ var p;
34
+ return (((p = o.match(/class="([^"]*)"/)) == null ? void 0 : p[1]) ?? "").split(/\s+/).filter(Boolean).includes("radio-button-block");
35
+ });
36
+ return console.debug("[guido:radio-migrator] exit", {
37
+ v1Converted: i,
38
+ healingMutated: l,
39
+ mutated: n,
40
+ finalV2HasBlock: u,
41
+ outputLength: c.length
42
+ }), c;
25
43
  } catch (t) {
26
- return console.error("RadioButtonMigrator failed:", t), e;
44
+ return console.error("[guido:radio-migrator] failed:", t), e;
27
45
  }
28
46
  }
29
47
  healRadioButtonV2(e) {
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)
48
+ let t = !1, r = 0, s = 0;
49
+ const n = e.querySelectorAll("td.radio-button-v2");
50
+ return n.forEach((i) => {
51
+ var y;
52
+ i.classList.contains("radio-button-block") || (i.classList.contains("radio-button") ? i.classList.replace("radio-button", "radio-button-block") : i.classList.add("radio-button-block"), r++, t = !0);
53
+ const l = i.querySelector("input#radioYes"), c = i.querySelector("input#radioNo");
54
+ if (!l || !c)
35
55
  return;
36
- const r = ((p = s.parentElement) == null ? void 0 : p.querySelector(":scope > p")) || null;
37
- if (!r && !s.hasAttribute("align"))
56
+ const u = ((y = l.parentElement) == null ? void 0 : y.querySelector(":scope > p")) || null;
57
+ if (!u && !l.hasAttribute("align"))
38
58
  return;
39
- const n = s.closest("tr"), a = o.closest("tr");
40
- if (!n || !a || n === a || !n.parentNode)
59
+ const o = l.closest("tr"), d = c.closest("tr");
60
+ if (!o || !d || o === d || !o.parentNode)
41
61
  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;
62
+ const p = (u == null ? void 0 : u.innerHTML.trim()) || "Yes", g = d.cloneNode(!0), b = g.querySelector("input#radioNo"), m = g.querySelector("p");
63
+ b && (b.setAttribute("id", "radioYes"), b.removeAttribute("align")), m && (m.innerHTML = p), o.parentNode.replaceChild(g, o), s++, t = !0;
64
+ }), console.debug("[guido:radio-migrator] healing", {
65
+ v2BlockCount: n.length,
66
+ classAddedCount: r,
67
+ rowHealedCount: s,
68
+ mutated: t
44
69
  }), t;
45
70
  }
46
71
  extractTextFromElement(e, t) {
47
- var p, y;
48
- const i = e.querySelector(`.${t}`);
49
- if (!i)
72
+ var g, b;
73
+ const r = e.querySelector(`.${t}`);
74
+ if (!r)
50
75
  return {
51
76
  text: t === "ins-title" ? "Title" : "Description",
52
77
  isBold: !1,
@@ -55,32 +80,32 @@ class B {
55
80
  styles: "",
56
81
  classList: ""
57
82
  };
58
- const s = i.querySelector("p");
83
+ const s = r.querySelector("p");
59
84
  if (!s)
60
85
  return {
61
- text: ((p = i.textContent) == null ? void 0 : p.trim()) || (t === "ins-title" ? "Title" : "Description"),
86
+ text: ((g = r.textContent) == null ? void 0 : g.trim()) || (t === "ins-title" ? "Title" : "Description"),
62
87
  isBold: !1,
63
88
  isItalic: !1,
64
- align: i.getAttribute("align") || "left",
89
+ align: r.getAttribute("align") || "left",
65
90
  styles: "",
66
91
  classList: ""
67
92
  };
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") || "";
93
+ const n = ((b = s.textContent) == null ? void 0 : b.trim()) || (t === "ins-title" ? "Title" : "Description"), i = s.getAttribute("style") || "", l = r.getAttribute("align") || s.getAttribute("align") || "left", c = /font-weight\s*:\s*bold/i.test(i) || !!s.querySelector("b, strong"), u = /font-style\s*:\s*italic/i.test(i) || !!s.querySelector("i, em"), o = this.removeStyleProperties(i, ["font-weight", "font-style"]), d = this.convertInlineToBlock(o), p = r.getAttribute("class") || "";
69
94
  return {
70
- text: o,
71
- isBold: a,
72
- isItalic: g,
73
- align: n,
74
- styles: u,
75
- classList: d
95
+ text: n,
96
+ isBold: c,
97
+ isItalic: u,
98
+ align: l,
99
+ styles: d,
100
+ classList: p
76
101
  };
77
102
  }
78
103
  buildTextBlock(e) {
79
104
  let t = e.text;
80
105
  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('"', "'")}"` : "";
106
+ const r = e.align ? ` align="${e.align}"` : "", s = e.styles ? ` style="${e.styles.replaceAll('"', "'")}"` : "";
82
107
  return `
83
- <td class="esd-block-text ${e.classList}" ${i}>
108
+ <td class="esd-block-text ${e.classList}" ${r}>
84
109
  <p path="1" ${s}>
85
110
  ${t}
86
111
  </p>
@@ -88,9 +113,9 @@ class B {
88
113
  `;
89
114
  }
90
115
  removeStyleProperties(e, t) {
91
- return e ? t.reduce((s, o) => {
92
- const r = new RegExp(`${o}\\s*:\\s*[^;]*;?`, "gi");
93
- return s.replace(r, "");
116
+ return e ? t.reduce((s, n) => {
117
+ const i = new RegExp(`${n}\\s*:\\s*[^;]*;?`, "gi");
118
+ return s.replace(i, "");
94
119
  }, e).replace(/;\s*;/g, ";").replace(/^;|;$/g, "").trim() : "";
95
120
  }
96
121
  convertInlineToBlock(e) {
@@ -100,8 +125,8 @@ class B {
100
125
  return /display\s*:/i.test(t) || (t = t ? `${t}; display: block` : "display: block"), t.replace(/;\s*;/g, ";").replace(/^;|;$/g, "").trim();
101
126
  }
102
127
  }
103
- function q(l) {
104
- return new B().migrate(l);
128
+ function q(a) {
129
+ return new k().migrate(a);
105
130
  }
106
131
  export {
107
132
  q as migrateRadioButton
@@ -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
  };
@@ -1,11 +1,11 @@
1
- var d = Object.defineProperty;
2
- var l = (r, n, e) => n in r ? d(r, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[n] = e;
3
- var o = (r, n, e) => l(r, typeof n != "symbol" ? n + "" : n, e);
4
- import { useHttp as L } from "../../../composables/useHttp.js";
5
- import { DEFAULT_UNSUBSCRIBE_GROUP as c } from "../../../enums/unsubscribe.js";
6
- import { Control as h, UIElementType as i, UEAttr as t, ModificationDescription as p } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
7
- const m = "ui-elements-checkbox", u = "select", { get: C } = L();
8
- class S extends h {
1
+ var E = Object.defineProperty;
2
+ var d = (i, n, e) => n in i ? E(i, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[n] = e;
3
+ var o = (i, n, e) => d(i, typeof n != "symbol" ? n + "" : n, e);
4
+ import { useHttp as l } from "../../../composables/useHttp.js";
5
+ import { getDefaultUnsubscribeGroup as L, DEFAULT_UNSUBSCRIBE_GROUP_SEND_GRID_ID as h } from "../../../enums/unsubscribe.js";
6
+ import { Control as p, UIElementType as r, UEAttr as t, ModificationDescription as m } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
7
+ const b = "ui-elements-checkbox", u = "select", { get: C } = l();
8
+ class I extends p {
9
9
  constructor() {
10
10
  super(...arguments);
11
11
  o(this, "currentNode");
@@ -13,13 +13,13 @@ class S extends h {
13
13
  o(this, "unsubList", []);
14
14
  }
15
15
  getId() {
16
- return m;
16
+ return b;
17
17
  }
18
18
  _setFormValues() {
19
19
  if (this.selectedUnsubGroup = "", this.currentNode && "getAttribute" in this.currentNode) {
20
20
  const e = this.currentNode.getAttribute("id");
21
21
  if (e) {
22
- const s = e === c.sendGridId ? e : Number(e);
22
+ const s = e === h ? e : Number(e);
23
23
  s && (this.selectedUnsubGroup = s);
24
24
  }
25
25
  }
@@ -29,18 +29,18 @@ class S extends h {
29
29
  }
30
30
  _getLabel(e, s = `${Math.random()}`) {
31
31
  return `
32
- <${i.LABEL}
32
+ <${r.LABEL}
33
33
  ${t.LABEL.text}="${e}"
34
34
  ${t.LABEL.name}="${s}">
35
- </${i.LABEL}>
35
+ </${r.LABEL}>
36
36
  `;
37
37
  }
38
38
  _getSelectItem(e, s) {
39
39
  return `
40
- <${i.SELECT_ITEM}
40
+ <${r.SELECT_ITEM}
41
41
  ${t.SELECT_ITEM.text}="${e}"
42
42
  ${t.SELECT_ITEM.value}="${s}">
43
- </${i.SELECT_ITEM}>`;
43
+ </${r.SELECT_ITEM}>`;
44
44
  }
45
45
  _getSelect() {
46
46
  return this.unsubList.map((e) => this._getSelectItem(e.name, e.sendGridId)).join("");
@@ -49,22 +49,22 @@ class S extends h {
49
49
  return `
50
50
  <div class="checkbox-controls-container">
51
51
  <div class="checkbox-select-container container two-columns stretch">
52
- <${i.LABEL}
52
+ <${r.LABEL}
53
53
  ${t.LABEL.text}="${this.api.translate("Unsubscribe Group")}"
54
54
  ${t.LABEL.name}="${Math.random()}">
55
- </${i.LABEL}>
55
+ </${r.LABEL}>
56
56
 
57
- <${i.SELECTPICKER}
57
+ <${r.SELECTPICKER}
58
58
  ${t.SELECTPICKER.name}="${u}"
59
59
  ${t.SELECTPICKER.placeholder}="${this.api.translate("Select Unsubscribe Group")}">
60
60
  ${this._getSelect()}
61
- </${i.SELECTPICKER}>
61
+ </${r.SELECTPICKER}>
62
62
  </div>
63
63
  </div>
64
64
  `;
65
65
  }
66
66
  _onSelectChange(e) {
67
- this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", e.toString()).apply(new p(`Updated text to ${e}`));
67
+ this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", e.toString()).apply(new m(`Updated text to ${e}`));
68
68
  }
69
69
  _listenToFormUpdates() {
70
70
  this.api.onValueChanged(u, (e) => this._onSelectChange(e));
@@ -76,18 +76,18 @@ class S extends h {
76
76
  async onRender() {
77
77
  const e = await C(
78
78
  "/unsubscribe-groups/unsubscribe-list"
79
- ), s = [c, ...e.data], E = s.map((a) => ({
79
+ ), s = [L(), ...e.data], c = s.map((a) => ({
80
80
  [t.SELECT_ITEM.text]: a.name,
81
81
  [t.SELECT_ITEM.value]: a.sendGridId
82
82
  }));
83
83
  this.unsubList = s, this.api.setUIEAttribute(
84
84
  u,
85
85
  t.SELECTPICKER.items,
86
- E
86
+ c
87
87
  ), this._setFormValues(), this._listenToFormUpdates();
88
88
  }
89
89
  }
90
90
  export {
91
- m as CHECKBOX_CONTROL_BLOCK_ID,
92
- S as CheckboxControl
91
+ b as CHECKBOX_CONTROL_BLOCK_ID,
92
+ I as CheckboxControl
93
93
  };
@@ -1,11 +1,11 @@
1
- var d = Object.defineProperty;
2
- var l = (r, n, t) => n in r ? d(r, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[n] = t;
3
- var o = (r, n, t) => l(r, typeof n != "symbol" ? n + "" : n, t);
4
- import { useHttp as L } from "../../../composables/useHttp.js";
5
- import { DEFAULT_UNSUBSCRIBE_GROUP as c } from "../../../enums/unsubscribe.js";
6
- import { Control as p, UIElementType as i, UEAttr as e, ModificationDescription as h } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
7
- const m = "ui-elements-radio-button", u = "select", { get: $ } = L();
8
- class S extends p {
1
+ var E = Object.defineProperty;
2
+ var d = (r, n, t) => n in r ? E(r, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[n] = t;
3
+ var o = (r, n, t) => d(r, typeof n != "symbol" ? n + "" : n, t);
4
+ import { useHttp as l } from "../../../composables/useHttp.js";
5
+ import { getDefaultUnsubscribeGroup as L, DEFAULT_UNSUBSCRIBE_GROUP_SEND_GRID_ID as p } from "../../../enums/unsubscribe.js";
6
+ import { Control as h, UIElementType as i, UEAttr as e, ModificationDescription as m } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
7
+ const b = "ui-elements-radio-button", u = "select", { get: $ } = l();
8
+ class I extends h {
9
9
  constructor() {
10
10
  super(...arguments);
11
11
  o(this, "currentNode");
@@ -13,13 +13,13 @@ class S extends p {
13
13
  o(this, "unsubList", []);
14
14
  }
15
15
  getId() {
16
- return m;
16
+ return b;
17
17
  }
18
18
  _setFormValues() {
19
19
  if (this.selectedUnsubGroup = "", this.currentNode && "getAttribute" in this.currentNode) {
20
20
  const t = this.currentNode.getAttribute("id");
21
21
  if (t) {
22
- const s = t === c.sendGridId ? t : Number(t);
22
+ const s = t === p ? t : Number(t);
23
23
  s && (this.selectedUnsubGroup = s);
24
24
  }
25
25
  }
@@ -64,7 +64,7 @@ class S extends p {
64
64
  `;
65
65
  }
66
66
  _onSelectChange(t) {
67
- this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", t.toString()).apply(new h(`Updated text to ${t}`));
67
+ this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", t.toString()).apply(new m(`Updated text to ${t}`));
68
68
  }
69
69
  _listenToFormUpdates() {
70
70
  this.api.onValueChanged(u, (t) => this._onSelectChange(t));
@@ -76,18 +76,18 @@ class S extends p {
76
76
  async onRender() {
77
77
  const t = await $(
78
78
  "/unsubscribe-groups/unsubscribe-list"
79
- ), s = [c, ...t.data], E = s.map((a) => ({
79
+ ), s = [L(), ...t.data], c = s.map((a) => ({
80
80
  [e.SELECT_ITEM.text]: a.name,
81
81
  [e.SELECT_ITEM.value]: a.sendGridId
82
82
  }));
83
83
  this.unsubList = s, this.api.setUIEAttribute(
84
84
  u,
85
85
  e.SELECTPICKER.items,
86
- E
86
+ c
87
87
  ), this._setFormValues(), this._listenToFormUpdates();
88
88
  }
89
89
  }
90
90
  export {
91
- m as CONTROL_BLOCK_ID,
92
- S as RadioButtonControl
91
+ b as CONTROL_BLOCK_ID,
92
+ I as RadioButtonControl
93
93
  };