@useinsider/guido 1.0.3-beta.d8a9e56 → 1.0.3-beta.dbf4a88

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 (189) hide show
  1. package/dist/components/Guido.vue.js +8 -8
  2. package/dist/components/Guido.vue2.js +74 -69
  3. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.js +18 -0
  4. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue2.js +16 -0
  5. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +24 -0
  6. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +64 -0
  7. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +18 -0
  8. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +107 -0
  9. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +18 -0
  10. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue2.js +12 -0
  11. package/dist/components/wrappers/WpDrawer.vue.js +6 -4
  12. package/dist/composables/useStripo.js +41 -34
  13. package/dist/config/compiler/unsubscribeCompilerRules.js +42 -29
  14. package/dist/config/migrator/index.js +7 -6
  15. package/dist/config/migrator/unsubscribeMigrator.js +124 -0
  16. package/dist/enums/defaults.js +6 -3
  17. package/dist/enums/unsubscribe.js +43 -6
  18. package/dist/extensions/Blocks/Checkbox/control.js +55 -53
  19. package/dist/extensions/Blocks/RadioButton/control.js +44 -42
  20. package/dist/extensions/Blocks/Unsubscribe/block.js +131 -0
  21. package/dist/extensions/Blocks/Unsubscribe/control.js +167 -0
  22. package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +42 -0
  23. package/dist/extensions/Blocks/Unsubscribe/extension.js +21 -0
  24. package/dist/extensions/Blocks/Unsubscribe/iconsRegistry.js +21 -0
  25. package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +35 -0
  26. package/dist/extensions/Blocks/Unsubscribe/styles.css.js +42 -0
  27. package/dist/extensions/Blocks/Unsubscribe/tagRegistry.js +10 -0
  28. package/dist/extensions/Blocks/Unsubscribe/template.js +22 -0
  29. package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +11 -0
  30. package/dist/extensions/Blocks/Unsubscribe/utils/utils.js +6 -0
  31. package/dist/guido.css +1 -1
  32. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +2 -1
  33. package/dist/package.json.js +7 -0
  34. package/dist/services/unsubscribeApi.js +16 -0
  35. package/dist/{@types → src/@types}/generic.d.ts +9 -0
  36. package/dist/{components → src/components}/Guido.vue.d.ts +2 -2
  37. package/dist/src/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.d.ts +2 -0
  38. package/dist/src/components/organisms/unsubscribe/UnsubscribePageSelection.vue.d.ts +2 -0
  39. package/dist/src/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.d.ts +2 -0
  40. package/dist/src/components/organisms/unsubscribe/UnsubscribeWrapper.vue.d.ts +2 -0
  41. package/dist/{components → src/components}/wrappers/WpDrawer.vue.d.ts +6 -4
  42. package/dist/src/config/migrator/index.d.ts +1 -0
  43. package/dist/src/config/migrator/unsubscribeMigrator.d.ts +1 -0
  44. package/dist/src/enums/unsubscribe.d.ts +38 -0
  45. package/dist/src/extensions/Blocks/Unsubscribe/block.d.ts +32 -0
  46. package/dist/src/extensions/Blocks/Unsubscribe/control.d.ts +29 -0
  47. package/dist/src/extensions/Blocks/Unsubscribe/elements/preview.d.ts +11 -0
  48. package/dist/src/extensions/Blocks/Unsubscribe/iconsRegistry.d.ts +4 -0
  49. package/dist/src/extensions/Blocks/Unsubscribe/tagRegistry.d.ts +4 -0
  50. package/dist/src/extensions/Blocks/Unsubscribe/template.d.ts +12 -0
  51. package/dist/src/extensions/Blocks/Unsubscribe/utils/constants.d.ts +9 -0
  52. package/dist/src/extensions/Blocks/Unsubscribe/utils/utils.d.ts +7 -0
  53. package/dist/src/extensions/Blocks/_Boilerplate/settingsPanel.d.ts +4 -0
  54. package/dist/src/extensions/DynamicContent/extension.d.ts +2 -0
  55. package/dist/src/services/unsubscribeApi.d.ts +4 -0
  56. package/dist/src/stores/config.d.ts +96 -0
  57. package/dist/src/stores/unsubscribe.d.ts +256 -0
  58. package/dist/stores/config.js +17 -0
  59. package/dist/stores/unsubscribe.js +126 -6
  60. package/dist/utils/templatePreparation.js +17 -16
  61. package/package.json +6 -1
  62. package/dist/config/migrator/index.d.ts +0 -1
  63. package/dist/enums/unsubscribe.d.ts +0 -15
  64. package/dist/stores/unsubscribe.d.ts +0 -8
  65. /package/dist/{@types → src/@types}/events.d.ts +0 -0
  66. /package/dist/{@types → src/@types}/save-as-template.d.ts +0 -0
  67. /package/dist/{App.vue.d.ts → src/App.vue.d.ts} +0 -0
  68. /package/dist/{components → src/components}/organisms/LoadingWrapper.vue.d.ts +0 -0
  69. /package/dist/{components → src/components}/organisms/base/Toaster.vue.d.ts +0 -0
  70. /package/dist/{components → src/components}/organisms/email-preview/PreviewContainer.vue.d.ts +0 -0
  71. /package/dist/{components → src/components}/organisms/email-preview/amp/AmpErrorModal.vue.d.ts +0 -0
  72. /package/dist/{components → src/components}/organisms/email-preview/amp/AmpToggle.vue.d.ts +0 -0
  73. /package/dist/{components → src/components}/organisms/email-preview/desktop-preview/DesktopPreview.vue.d.ts +0 -0
  74. /package/dist/{components → src/components}/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.d.ts +0 -0
  75. /package/dist/{components → src/components}/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.d.ts +0 -0
  76. /package/dist/{components → src/components}/organisms/email-preview/mobile-preview/ContentView.vue.d.ts +0 -0
  77. /package/dist/{components → src/components}/organisms/email-preview/mobile-preview/InboxView.vue.d.ts +0 -0
  78. /package/dist/{components → src/components}/organisms/email-preview/mobile-preview/MobilePreview.vue.d.ts +0 -0
  79. /package/dist/{components → src/components}/organisms/header/HeaderWrapper.vue.d.ts +0 -0
  80. /package/dist/{components → src/components}/organisms/header/LeftSlot.vue.d.ts +0 -0
  81. /package/dist/{components → src/components}/organisms/header/MiddleSlot.vue.d.ts +0 -0
  82. /package/dist/{components → src/components}/organisms/header/RightSlot.vue.d.ts +0 -0
  83. /package/dist/{components → src/components}/organisms/header/ViewOptions.vue.d.ts +0 -0
  84. /package/dist/{components → src/components}/organisms/header/version-history/RestoreButton.vue.d.ts +0 -0
  85. /package/dist/{components → src/components}/organisms/header/version-history/VersionHistory.vue.d.ts +0 -0
  86. /package/dist/{components → src/components}/organisms/header/version-history/VersionHistoryItem.vue.d.ts +0 -0
  87. /package/dist/{components → src/components}/organisms/header/version-history/ViewOptions.vue.d.ts +0 -0
  88. /package/dist/{components → src/components}/organisms/onboarding/AMPOnboarding.vue.d.ts +0 -0
  89. /package/dist/{components → src/components}/organisms/onboarding/GenericOnboarding.vue.d.ts +0 -0
  90. /package/dist/{components → src/components}/organisms/onboarding/NewVersionPopup.vue.d.ts +0 -0
  91. /package/dist/{components → src/components}/organisms/onboarding/OnboardingWrapper.vue.d.ts +0 -0
  92. /package/dist/{components → src/components}/organisms/onboarding/TextBlockOnboarding.vue.d.ts +0 -0
  93. /package/dist/{components → src/components}/organisms/onboarding/VersionHistoryOnboarding.vue.d.ts +0 -0
  94. /package/dist/{components → src/components}/organisms/save-as-template/SaveAsTemplateDrawer.vue.d.ts +0 -0
  95. /package/dist/{components → src/components}/wrappers/WpModal.vue.d.ts +0 -0
  96. /package/dist/{composables → src/composables}/useActionsApi.d.ts +0 -0
  97. /package/dist/{composables → src/composables}/useApiExample.d.ts +0 -0
  98. /package/dist/{composables → src/composables}/useCodeEditorApi.d.ts +0 -0
  99. /package/dist/{composables → src/composables}/useConfig.d.ts +0 -0
  100. /package/dist/{composables → src/composables}/useCustomInterfaceAppearance.d.ts +0 -0
  101. /package/dist/{composables → src/composables}/useDebounce.d.ts +0 -0
  102. /package/dist/{composables → src/composables}/useExport.d.ts +0 -0
  103. /package/dist/{composables → src/composables}/useGuidoActions.d.ts +0 -0
  104. /package/dist/{composables → src/composables}/useHtmlCompiler.d.ts +0 -0
  105. /package/dist/{composables → src/composables}/useHtmlValidator.d.ts +0 -0
  106. /package/dist/{composables → src/composables}/useHttp.d.ts +0 -0
  107. /package/dist/{composables → src/composables}/usePartner.d.ts +0 -0
  108. /package/dist/{composables → src/composables}/usePreviewMode.d.ts +0 -0
  109. /package/dist/{composables → src/composables}/useProvideInject.d.ts +0 -0
  110. /package/dist/{composables → src/composables}/useRecommendation.d.ts +0 -0
  111. /package/dist/{composables → src/composables}/useResponsivePreview.d.ts +0 -0
  112. /package/dist/{composables → src/composables}/useSave.d.ts +0 -0
  113. /package/dist/{composables → src/composables}/useStripo.d.ts +0 -0
  114. /package/dist/{composables → src/composables}/useStripoEventHandler.d.ts +0 -0
  115. /package/dist/{composables → src/composables}/useToaster.d.ts +0 -0
  116. /package/dist/{composables → src/composables}/useTranslations.d.ts +0 -0
  117. /package/dist/{composables → src/composables}/useValidation.d.ts +0 -0
  118. /package/dist/{composables → src/composables}/useVersionHistoryApi.d.ts +0 -0
  119. /package/dist/{composables → src/composables}/validators/saveAsTemplate.d.ts +0 -0
  120. /package/dist/{config → src/config}/compiler/htmlCompilerRules.d.ts +0 -0
  121. /package/dist/{config → src/config}/compiler/outlookCompilerRules.d.ts +0 -0
  122. /package/dist/{config → src/config}/compiler/recommendationCompilerRules.d.ts +0 -0
  123. /package/dist/{config → src/config}/compiler/socialCompilerRules.d.ts +0 -0
  124. /package/dist/{config → src/config}/compiler/unsubscribeCompilerRules.d.ts +0 -0
  125. /package/dist/{config → src/config}/migrator/checkboxMigrator.d.ts +0 -0
  126. /package/dist/{config → src/config}/migrator/couponBlockMigrator.d.ts +0 -0
  127. /package/dist/{config → src/config}/migrator/radioButtonMigrator.d.ts +0 -0
  128. /package/dist/{enums → src/enums}/defaults.d.ts +0 -0
  129. /package/dist/{enums → src/enums}/displayConditions.d.ts +0 -0
  130. /package/dist/{enums → src/enums}/html-validator.d.ts +0 -0
  131. /package/dist/{enums → src/enums}/onboarding.d.ts +0 -0
  132. /package/dist/{enums → src/enums}/preview.d.ts +0 -0
  133. /package/dist/{enums → src/enums}/recommendation.d.ts +0 -0
  134. /package/dist/{enums → src/enums}/toaster.d.ts +0 -0
  135. /package/dist/{extensions → src/extensions}/Blocks/Checkbox/block.d.ts +0 -0
  136. /package/dist/{extensions → src/extensions}/Blocks/Checkbox/control.d.ts +0 -0
  137. /package/dist/{extensions → src/extensions}/Blocks/Checkbox/extension.d.ts +0 -0
  138. /package/dist/{extensions → src/extensions}/Blocks/Checkbox/iconsRegistry.d.ts +0 -0
  139. /package/dist/{extensions → src/extensions}/Blocks/Checkbox/settingsPanel.d.ts +0 -0
  140. /package/dist/{extensions → src/extensions}/Blocks/Checkbox/template.d.ts +0 -0
  141. /package/dist/{extensions → src/extensions}/Blocks/CouponBlock/block.d.ts +0 -0
  142. /package/dist/{extensions → src/extensions}/Blocks/CouponBlock/extension.d.ts +0 -0
  143. /package/dist/{extensions → src/extensions}/Blocks/CouponBlock/iconsRegistry.d.ts +0 -0
  144. /package/dist/{extensions → src/extensions}/Blocks/CouponBlock/settingsPanel.d.ts +0 -0
  145. /package/dist/{extensions → src/extensions}/Blocks/CouponBlock/template.d.ts +0 -0
  146. /package/dist/{extensions → src/extensions}/Blocks/RadioButton/block.d.ts +0 -0
  147. /package/dist/{extensions → src/extensions}/Blocks/RadioButton/control.d.ts +0 -0
  148. /package/dist/{extensions → src/extensions}/Blocks/RadioButton/extension.d.ts +0 -0
  149. /package/dist/{extensions → src/extensions}/Blocks/RadioButton/iconsRegistry.d.ts +0 -0
  150. /package/dist/{extensions → src/extensions}/Blocks/RadioButton/settingsPanel.d.ts +0 -0
  151. /package/dist/{extensions → src/extensions}/Blocks/RadioButton/template.d.ts +0 -0
  152. /package/dist/{extensions/Blocks/_Boilerplate → src/extensions/Blocks/Unsubscribe}/extension.d.ts +0 -0
  153. /package/dist/{extensions/Blocks/_Boilerplate → src/extensions/Blocks/Unsubscribe}/settingsPanel.d.ts +0 -0
  154. /package/dist/{extensions → src/extensions}/Blocks/_Boilerplate/block.d.ts +0 -0
  155. /package/dist/{extensions → src/extensions}/Blocks/_Boilerplate/control.d.ts +0 -0
  156. /package/dist/{extensions/DynamicContent → src/extensions/Blocks/_Boilerplate}/extension.d.ts +0 -0
  157. /package/dist/{extensions → src/extensions}/Blocks/_Boilerplate/iconsRegistry.d.ts +0 -0
  158. /package/dist/{extensions → src/extensions}/Blocks/_Boilerplate/template.d.ts +0 -0
  159. /package/dist/{extensions → src/extensions}/DynamicContent/dynamic-content-modal.d.ts +0 -0
  160. /package/dist/{extensions → src/extensions}/DynamicContent/dynamic-content.d.ts +0 -0
  161. /package/dist/{library.d.ts → src/library.d.ts} +0 -0
  162. /package/dist/{main.d.ts → src/main.d.ts} +0 -0
  163. /package/dist/{mock → src/mock}/api/auth.d.ts +0 -0
  164. /package/dist/{mock → src/mock}/api/custom-fonts.d.ts +0 -0
  165. /package/dist/{mock → src/mock}/api/default-template.d.ts +0 -0
  166. /package/dist/{mock → src/mock}/api/template-library.d.ts +0 -0
  167. /package/dist/{mock → src/mock}/api/unsubscribe.d.ts +0 -0
  168. /package/dist/{mock → src/mock}/api/user-modal-state.d.ts +0 -0
  169. /package/dist/{mock → src/mock}/api/validator.d.ts +0 -0
  170. /package/dist/{mock → src/mock}/browser.d.ts +0 -0
  171. /package/dist/{mock → src/mock}/handlers.d.ts +0 -0
  172. /package/dist/{services → src/services}/onboardingApi.d.ts +0 -0
  173. /package/dist/{services → src/services}/stripoApi.d.ts +0 -0
  174. /package/dist/{services → src/services}/templateLibraryApi.d.ts +0 -0
  175. /package/dist/{stores → src/stores}/dynamic-content.d.ts +0 -0
  176. /package/dist/{stores → src/stores}/editor.d.ts +0 -0
  177. /package/dist/{stores → src/stores}/onboarding.d.ts +0 -0
  178. /package/dist/{stores → src/stores}/preview.d.ts +0 -0
  179. /package/dist/{stores → src/stores}/recommendation.d.ts +0 -0
  180. /package/dist/{stores → src/stores}/save-as-template.d.ts +0 -0
  181. /package/dist/{stores → src/stores}/toaster.d.ts +0 -0
  182. /package/dist/{stores → src/stores}/version-history.d.ts +0 -0
  183. /package/dist/{utils → src/utils}/arrayUtil.d.ts +0 -0
  184. /package/dist/{utils → src/utils}/base64.d.ts +0 -0
  185. /package/dist/{utils → src/utils}/dateUtil.d.ts +0 -0
  186. /package/dist/{utils → src/utils}/genericUtil.d.ts +0 -0
  187. /package/dist/{utils → src/utils}/htmlCompiler.d.ts +0 -0
  188. /package/dist/{utils → src/utils}/templatePreparation.d.ts +0 -0
  189. /package/dist/{utils → src/utils}/tooltipUtils.d.ts +0 -0
@@ -6,21 +6,23 @@ import { displayConditions as y } from "../enums/displayConditions.js";
6
6
  import h from "../extensions/Blocks/Checkbox/extension.js";
7
7
  import w from "../extensions/Blocks/CouponBlock/extension.js";
8
8
  import b from "../extensions/Blocks/RadioButton/extension.js";
9
- import k from "../extensions/DynamicContent/extension.js";
10
- import { useStripoApi as B } from "../services/stripoApi.js";
11
- import V from "../static/styles/customEditorStyle.css.js";
12
- import { useEditorStore as _ } from "../stores/editor.js";
13
- import { dynamicContentToMergeTags as F } from "../utils/genericUtil.js";
14
- const j = (s) => {
15
- const { handleError: d } = C(), { getToken: c, getCustomFonts: u } = B(), { handleEvent: l } = E(), m = (r, i = []) => {
16
- const t = _(), { html: e, css: a, forceRecreate: g } = r;
9
+ import V from "../extensions/Blocks/Unsubscribe/extension.js";
10
+ import _ from "../extensions/DynamicContent/extension.js";
11
+ import { useStripoApi as k } from "../services/stripoApi.js";
12
+ import B from "../static/styles/customEditorStyle.css.js";
13
+ import { useEditorStore as F } from "../stores/editor.js";
14
+ import { dynamicContentToMergeTags as x } from "../utils/genericUtil.js";
15
+ import A from "../package.json.js";
16
+ const N = (a) => {
17
+ const { handleError: d } = C(), { getToken: u, getCustomFonts: m } = k(), { handleEvent: p } = E(), l = (r, i = []) => {
18
+ const t = F(), { html: n, css: c, forceRecreate: s } = r;
17
19
  window.UIEditor.initEditor(
18
20
  document.querySelector("#guido-editor"),
19
21
  {
20
- metadata: s,
21
- html: e,
22
- css: a,
23
- forceRecreate: g,
22
+ metadata: a,
23
+ html: n,
24
+ css: c,
25
+ forceRecreate: s,
24
26
  locale: "en",
25
27
  undoButtonSelector: "#guido__undo-button",
26
28
  redoButtonSelector: "#guido__redo-button",
@@ -30,7 +32,7 @@ const j = (s) => {
30
32
  customAppearanceMergetags: !0,
31
33
  customAppearanceMergetagsBorderColor: "#f1f3fe",
32
34
  customAppearanceMergetagsBackgroundColor: "#f1f3fe",
33
- customViewStyles: V,
35
+ customViewStyles: B,
34
36
  conditionsEnabled: !0,
35
37
  customConditionsEnabled: !0,
36
38
  conditionCategories: y,
@@ -44,21 +46,21 @@ const j = (s) => {
44
46
  },
45
47
  mergeTags: [
46
48
  {
47
- entries: F(s.preselectedDynamicContentList)
49
+ entries: x(a.preselectedDynamicContentList)
48
50
  }
49
51
  ],
50
52
  async onTokenRefreshRequest(o) {
51
53
  try {
52
- const n = await c();
53
- o(n);
54
- } catch (n) {
55
- d(n, "Failed to refresh token");
54
+ const e = await u();
55
+ o(e);
56
+ } catch (e) {
57
+ d(e, "Failed to refresh token");
56
58
  }
57
59
  },
58
60
  onTemplateLoaded() {
59
61
  try {
60
- const { importCss: o } = S(), { activateCustomViewStyles: n } = f();
61
- o(), n(), s.onReady(), t.isStripoInitialized = !0, t.loadingStatus = !1, setTimeout(() => {
62
+ const { importCss: o } = S(), { activateCustomViewStyles: e } = f();
63
+ o(), e(), a.onReady(), t.isStripoInitialized = !0, t.loadingStatus = !1, setTimeout(() => {
62
64
  t.hasChanges = !1;
63
65
  }, 1e3);
64
66
  } catch (o) {
@@ -77,36 +79,41 @@ const j = (s) => {
77
79
  onDataChanged() {
78
80
  t.hasChanges = !0;
79
81
  },
80
- onEvent: l,
81
- ignoreClickOutsideSelectors: ["#guido-dynamic-content-modal", ".in-on-board-wrapper"],
82
+ onEvent: p,
83
+ ignoreClickOutsideSelectors: [
84
+ "#guido-dynamic-content-modal",
85
+ ".in-on-board-wrapper",
86
+ ".in-drawer__container"
87
+ ],
82
88
  extensions: [
83
- k,
89
+ _,
84
90
  h,
85
91
  b,
92
+ V,
86
93
  w
87
94
  ]
88
95
  }
89
96
  );
90
- }, p = (r) => new Promise((i, t) => {
97
+ }, g = (r) => new Promise((i, t) => {
98
+ var e;
91
99
  if (document.getElementById("UiEditorScript")) {
92
100
  r(), i();
93
101
  return;
94
102
  }
95
- const e = document.createElement("script");
96
- e.id = "UiEditorScript", e.type = "module", e.src = "https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js", e.onload = () => {
103
+ const n = A.guido, s = `https://email-static.useinsider.com/guido/${(e = n == null ? void 0 : n.stripo) == null ? void 0 : e.version}/UIEditor.js`, o = document.createElement("script");
104
+ o.id = "UiEditorScript", o.type = "module", o.src = s, o.onload = () => {
97
105
  r(), i();
98
- }, e.onerror = () => {
99
- const a = new Error("Failed to load Stripo UIEditor script");
100
- t(a);
101
- }, document.body.appendChild(e);
106
+ }, o.onerror = () => {
107
+ t(new Error(`Failed to load Stripo UIEditor script from S3: ${s}`));
108
+ }, document.body.appendChild(o);
102
109
  });
103
110
  return { initPlugin: async (r) => {
104
- await p(async () => {
105
- const i = await u();
106
- m(r, i);
111
+ await g(async () => {
112
+ const i = await m();
113
+ l(r, i);
107
114
  });
108
115
  } };
109
116
  };
110
117
  export {
111
- j as useStripo
118
+ N as useStripo
112
119
  };
@@ -1,23 +1,36 @@
1
- import { usePartner as m } from "../../composables/usePartner.js";
2
- import { LINK_REGEXES as c, LINK_TYPES as p, URLS as E } from "../../enums/unsubscribe.js";
3
- import { useUnsubscribeStore as b } from "../../stores/unsubscribe.js";
4
- const S = [
1
+ import { usePartner as U } from "../../composables/usePartner.js";
2
+ import { LINK_REGEXES as l, LINK_TYPES as b, URLS as f } from "../../enums/unsubscribe.js";
3
+ import { parsePageList as B } from "../../extensions/Blocks/Unsubscribe/utils/utils.js";
4
+ import { useConfigStore as N } from "../../stores/config.js";
5
+ import { useUnsubscribeStore as I } from "../../stores/unsubscribe.js";
6
+ const T = [
5
7
  {
6
8
  id: "add-unsubscribe-link-values",
7
9
  description: "Adding unsubscribe link values",
8
10
  type: "custom",
9
- processor: (n) => {
10
- var a, u;
11
- const { getPartnerName: i } = m(), t = b();
12
- let e = n;
13
- const o = `/${i()}/email/0?user={{iid}}`, r = (a = t.selectedUnsubscribePages) == null ? void 0 : a.find((l) => l.type === p.UNSUBSCRIBE_LINK_TYPE), s = (u = t.selectedUnsubscribePages) == null ? void 0 : u.find((l) => l.type === p.PREFERENCES_LINK_TYPE);
14
- return r && (e = e.replace(
15
- c.GLOBAL_UNSUBSCRIBE_LINK_REGEX,
16
- E.UNSUBSCRIBE_URL + o
17
- )), s && (e = e.replace(
18
- c.PREFERENCES_UNSUBSCRIBE_LINK_REGEX,
19
- E.PREFERENCES_URL + o
20
- )), e.replace(c.UNSUBSCRIBE_LINK_REGEX, "");
11
+ processor: (t) => {
12
+ const { getPartnerName: i } = U(), a = N(), n = I(), u = a.getVariationId;
13
+ if (!u)
14
+ return t;
15
+ let o = t;
16
+ const e = `/${i()}/email/${u}?user={{iid}}`;
17
+ return new DOMParser().parseFromString(o, "text/html").querySelectorAll(".unsubscribe-block-v2[data-unsubscribe-page-list]").forEach((p) => {
18
+ var g;
19
+ const d = p.getAttribute("data-unsubscribe-page-list");
20
+ if (!d)
21
+ return;
22
+ const S = B(d), m = ((g = n.templates) == null ? void 0 : g.filter(
23
+ (c) => S.includes(c.id)
24
+ )) ?? [], R = m.some((c) => c.type === b.UNSUBSCRIBE_LINK_TYPE), _ = m.some((c) => c.type === b.PREFERENCES_LINK_TYPE), E = p.outerHTML;
25
+ let s = E;
26
+ R && (s = s.replace(
27
+ l.GLOBAL_UNSUBSCRIBE_LINK_REGEX,
28
+ f.UNSUBSCRIBE_URL + e
29
+ )), _ && (s = s.replace(
30
+ l.PREFERENCES_UNSUBSCRIBE_LINK_REGEX,
31
+ f.PREFERENCES_URL + e
32
+ )), s = s.replace(l.UNSUBSCRIBE_LINK_REGEX, ""), o = o.replace(E, s);
33
+ }), o;
21
34
  },
22
35
  priority: 60
23
36
  },
@@ -25,7 +38,7 @@ const S = [
25
38
  id: "remove-data-ogsb-button-styles",
26
39
  description: "Removing styles like [data-ogsb] .es-button.es-button-123 { background: red; }",
27
40
  type: "regex",
28
- pattern: c.DATA_OGSB_BUTTON_CSS_REGEX,
41
+ pattern: l.DATA_OGSB_BUTTON_CSS_REGEX,
29
42
  replacement: "",
30
43
  flags: "g",
31
44
  priority: 61
@@ -34,25 +47,25 @@ const S = [
34
47
  id: "format-comment-braces",
35
48
  description: "Adding spaces around comment braces for proper formatting",
36
49
  type: "custom",
37
- processor: (n) => n.replace(/{#/g, "{ #").replace(/#}/g, "# }"),
50
+ processor: (t) => t.replace(/{#/g, "{ #").replace(/#}/g, "# }"),
38
51
  priority: 62
39
52
  },
40
53
  {
41
54
  id: "add-universal-link-flags",
42
55
  description: "Adding universal link flags",
43
56
  type: "custom",
44
- processor: (n) => {
45
- let i = n;
46
- const t = i.match(/<a[^>]+>(.*?)<\/a>/gm);
47
- return t && t.forEach((e) => {
48
- if (e.includes("insEmail=1"))
57
+ processor: (t) => {
58
+ let i = t;
59
+ const a = i.match(/<a[^>]+>(.*?)<\/a>/gm);
60
+ return a && a.forEach((n) => {
61
+ if (n.includes("insEmail=1"))
49
62
  return;
50
- if (e.match(/<a\s+(?:[^>]*?\s+)?href=(["'`”])(.*?)\1\s+(?:[^>]*?\s+)?universal=(["'`”])true\3/gm)) {
51
- const o = e.replace(/href=(["'`”])(.*?)\1/gm, (r) => {
52
- const s = r.slice(6, r.length - 1).trim();
53
- return r.includes("?") || r.includes("#") ? s.slice(-1) === "&" ? r.replace(s, `${s}insEmail=1`) : r.replace(s, `${s}&insEmail=1`) : r.replace(s, `${s}?insEmail=1`);
63
+ if (n.match(/<a\s+(?:[^>]*?\s+)?href=(["'`”])(.*?)\1\s+(?:[^>]*?\s+)?universal=(["'`”])true\3/gm)) {
64
+ const o = n.replace(/href=(["'`”])(.*?)\1/gm, (e) => {
65
+ const r = e.slice(6, e.length - 1).trim();
66
+ return e.includes("?") || e.includes("#") ? r.slice(-1) === "&" ? e.replace(r, `${r}insEmail=1`) : e.replace(r, `${r}&insEmail=1`) : e.replace(r, `${r}?insEmail=1`);
54
67
  });
55
- i = i.replace(e, o);
68
+ i = i.replace(n, o);
56
69
  }
57
70
  }), i;
58
71
  },
@@ -60,5 +73,5 @@ const S = [
60
73
  }
61
74
  ];
62
75
  export {
63
- S as unsubscribeCompilerRules
76
+ T as unsubscribeCompilerRules
64
77
  };
@@ -1,10 +1,11 @@
1
- import { migrateCheckbox as r } from "./checkboxMigrator.js";
1
+ import { migrateCheckbox as o } from "./checkboxMigrator.js";
2
2
  import { migrateCouponBlock as m } from "./couponBlockMigrator.js";
3
- import { migrateRadioButton as e } from "./radioButtonMigrator.js";
4
- const p = (o) => {
5
- let t = o;
6
- return t = r(t), t = e(t), t = m(t), t;
3
+ import { migrateRadioButton as i } from "./radioButtonMigrator.js";
4
+ import { migrateUnsubscribe as e } from "./unsubscribeMigrator.js";
5
+ const c = async (t) => {
6
+ let r = t;
7
+ return r = o(r), r = i(r), r = await e(r), r = m(r), r;
7
8
  };
8
9
  export {
9
- p as migrate
10
+ c as migrate
10
11
  };
@@ -0,0 +1,124 @@
1
+ var h = Object.defineProperty;
2
+ var x = (l, e, t) => e in l ? h(l, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[e] = t;
3
+ var S = (l, e, t) => x(l, typeof e != "symbol" ? e + "" : e, t);
4
+ import { MERGE_TAGS as k, PAGE_TYPES as p } from "../../enums/unsubscribe.js";
5
+ import { DATA_ATTRIBUTES as A } from "../../extensions/Blocks/Unsubscribe/utils/constants.js";
6
+ import { useUnsubscribeStore as T } from "../../stores/unsubscribe.js";
7
+ class C {
8
+ constructor() {
9
+ S(this, "parser");
10
+ this.parser = new DOMParser();
11
+ }
12
+ async migrate(e) {
13
+ try {
14
+ const t = this.parser.parseFromString(e, "text/html"), i = t.querySelectorAll("td.unsubscribe-block");
15
+ if (!i.length)
16
+ return e;
17
+ const o = T();
18
+ return await o.fetchTemplates(), i.forEach((r) => {
19
+ const c = r.getAttribute("id"), g = this.extractPaddingClass(r), u = r.getAttribute("bgcolor") || "", n = this.extractUnsubscribeContent(r), s = this.getCollectionTypeFromMergeTag(n.linkHref), b = o.getSelectedUnsubscribePagesByCollection(s);
20
+ console.debug("[UnsubscribeMigrator]", {
21
+ mergeTag: n.linkHref,
22
+ collectionType: s,
23
+ pageIds: b,
24
+ paddingClass: g,
25
+ bgColor: u
26
+ });
27
+ const f = this.buildUnsubscribeBlock(
28
+ n,
29
+ s,
30
+ b,
31
+ g,
32
+ u
33
+ ), a = this.parser.parseFromString(
34
+ `<table id="tempDoc"><tbody><tr>${f}</tr></tbody></table>`,
35
+ "text/html"
36
+ ).querySelector(".unsubscribe-block-v2");
37
+ a && r.parentNode && (a.setAttribute("id", c || ""), r.parentNode.replaceChild(a, r));
38
+ }), t.documentElement.outerHTML;
39
+ } catch (t) {
40
+ return console.error("UnsubscribeMigrator failed:", t), e;
41
+ }
42
+ }
43
+ extractPaddingClass(e) {
44
+ const i = (e.getAttribute("class") || "").match(/\bes-p\d+\b/);
45
+ return i ? i[0] : "";
46
+ }
47
+ extractUnsubscribeContent(e) {
48
+ var m;
49
+ const t = e.querySelector("p");
50
+ if (!t)
51
+ return {
52
+ textBefore: "You can ",
53
+ linkText: "unsubscribe",
54
+ linkHref: "{{ins-unsubscribe-link}}",
55
+ linkStyle: "",
56
+ textAfter: " from our emails, if you need to.",
57
+ isBold: !1,
58
+ isItalic: !1,
59
+ align: "center",
60
+ paragraphStyle: ""
61
+ };
62
+ const i = e.getAttribute("align") || t.getAttribute("align") || "center", o = t.getAttribute("style") || "", r = t.querySelector("a.unsubscribe-link") || t.querySelector('a[href*="unsubscribe"]');
63
+ if (!r)
64
+ return {
65
+ textBefore: "You can ",
66
+ linkText: "unsubscribe",
67
+ linkHref: "{{ins-unsubscribe-link}}",
68
+ linkStyle: "",
69
+ textAfter: " from our emails, if you need to.",
70
+ isBold: !1,
71
+ isItalic: !1,
72
+ align: i,
73
+ paragraphStyle: o
74
+ };
75
+ const c = ((m = r.textContent) == null ? void 0 : m.trim()) || "unsubscribe", g = r.getAttribute("href") || "{{ins-unsubscribe-link}}", u = r.getAttribute("style") || "", n = t.textContent || "", s = n.indexOf(c), b = s >= 0 ? n.substring(0, s).trim() : "You can ", f = s >= 0 ? n.substring(s + c.length).trim() : " from our emails, if you need to.", d = !!t.querySelector("b, strong"), a = !!t.querySelector("i, em");
76
+ return {
77
+ textBefore: b,
78
+ linkText: c,
79
+ linkHref: this.normalizeUnsubscribeHref(g),
80
+ linkStyle: u,
81
+ textAfter: f,
82
+ isBold: d,
83
+ isItalic: a,
84
+ align: i,
85
+ paragraphStyle: o
86
+ };
87
+ }
88
+ buildUnsubscribeBlock(e, t, i, o, r) {
89
+ const c = e.linkStyle ? ` style="${e.linkStyle}"` : "", u = `<a ${`href="${e.linkHref}" class="unsubscribe-link" target="_blank" data-unsubscribe-link="true"`}${c}>${e.linkText}</a>`, n = [];
90
+ e.textBefore && n.push(e.textBefore), n.push(u), e.textAfter && n.push(e.textAfter);
91
+ let s = n.join(" ");
92
+ e.isBold && e.isItalic ? s = `<strong path="1,0"><em path="1,0,0">${s}</em></strong>` : e.isBold ? s = `<strong path="1,0">${s}</strong>` : e.isItalic && (s = `<em path="1,0">${s}</em>`);
93
+ const b = e.align ? ` align="${e.align}"` : "", f = r ? ` bgcolor="${r}"` : "", d = e.paragraphStyle ? ` style="${e.paragraphStyle}"` : "", a = i.length > 0 ? ` ${A.PAGE_LIST}="${i.join(",")}"` : "", m = ` ${A.PAGE_TYPE}="${t}"`, y = "esd-block-text unsubscribe-block-v2 esd-block-unsubscribe esd-unsubscribe-block esd-extension-block";
94
+ return `
95
+ <td
96
+ data-migration="true"
97
+ esd-extension-block-id="unsubscribe-block"
98
+ class="${o ? `${y} ${o}` : y}"
99
+ ${b}${f}${m}${a}
100
+ >
101
+ <p path="1"${d}>
102
+ ${s}
103
+ </p>
104
+ </td>
105
+ `;
106
+ }
107
+ getCollectionTypeFromMergeTag(e) {
108
+ return e === k[p.SUBSCRIPTION_PREFERENCE_CENTER] ? p.SUBSCRIPTION_PREFERENCE_CENTER : e === k[p.GLOBAL_UNSUBSCRIBE] ? p.GLOBAL_UNSUBSCRIBE : p.GLOBAL_UNSUBSCRIBE;
109
+ }
110
+ normalizeUnsubscribeHref(e) {
111
+ if (Object.values(k).includes(e))
112
+ return e;
113
+ const i = e.match(/{{ins-(?:global-)?(?:preferences-)?unsubscribe-link}}/);
114
+ return i ? i[0] : e.includes("unsubscribe") || e.includes("unsub") ? (console.warn(
115
+ `[UnsubscribeMigrator] Unrecognized unsubscribe href format: "${e}". Defaulting to {{ins-unsubscribe-link}}`
116
+ ), "{{ins-unsubscribe-link}}") : e;
117
+ }
118
+ }
119
+ async function M(l) {
120
+ return new C().migrate(l);
121
+ }
122
+ export {
123
+ M as migrateUnsubscribe
124
+ };
@@ -4,6 +4,9 @@ const a = {
4
4
  senderName: "",
5
5
  subject: ""
6
6
  },
7
+ extensions: {
8
+ unsubscribe: !0
9
+ },
7
10
  features: {
8
11
  dynamicContent: !0,
9
12
  saveAsTemplate: !0,
@@ -13,7 +16,7 @@ const a = {
13
16
  }, t = {
14
17
  promotional: 1,
15
18
  transactional: 2
16
- }, e = "email", o = "Guido User", n = t.promotional, i = 2, s = {
19
+ }, e = "email", o = "Guido User", n = t.promotional, s = 2, i = {
17
20
  email: 60,
18
21
  architect: 49
19
22
  }, u = [
@@ -53,8 +56,8 @@ export {
53
56
  n as DefaultMessageType,
54
57
  e as DefaultProductType,
55
58
  o as DefaultUsername,
56
- i as EditorType,
57
- s as ProductIds,
59
+ s as EditorType,
60
+ i as ProductIds,
58
61
  u as TEST_PARTNER_LIST,
59
62
  t as TemplateTypes
60
63
  };
@@ -1,17 +1,54 @@
1
- const E = {
1
+ import { useTranslations as e } from "../composables/useTranslations.js";
2
+ const s = e(), R = {
2
3
  UNSUBSCRIBE_LINK_TYPE: 1,
3
4
  PREFERENCES_LINK_TYPE: 3
4
- }, s = {
5
+ }, S = {
5
6
  UNSUBSCRIBE_LINK_REGEX: /{{ins-unsubscribe-link}}/g,
6
7
  DATA_OGSB_BUTTON_CSS_REGEX: "\\[data-ogsb\\]\\s*\\.es-button\\.es-button-[0-9]+\\s*\\{(?:[^\\}]*)\\}",
7
8
  GLOBAL_UNSUBSCRIBE_LINK_REGEX: /{{ins-global-unsubscribe-link}}/g,
8
9
  PREFERENCES_UNSUBSCRIBE_LINK_REGEX: /{{ins-preferences-unsubscribe-link}}/g
9
- }, _ = {
10
+ }, N = {
10
11
  UNSUBSCRIBE_URL: "https://mail.useinsider.com/user/v1/unsub",
11
12
  PREFERENCES_URL: "https://mail.useinsider.com/user/v1/prefs"
13
+ }, _ = {
14
+ name: "Global Unsubscribe",
15
+ sendGridId: "G"
16
+ }, I = "https://academy.useinsider.com/docs/global-unsubscribe-preference-center", r = "/email/unsubscribe-pages", E = {
17
+ GLOBAL_UNSUBSCRIBE: 1,
18
+ GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE: 2,
19
+ SUBSCRIPTION_PREFERENCE_CENTER: 3,
20
+ SUBSCRIPTION_PREFERENCE_CONFIRMATION: 4,
21
+ RESUBSCRIBE: 5
22
+ }, i = {
23
+ [E.GLOBAL_UNSUBSCRIBE]: [
24
+ E.GLOBAL_UNSUBSCRIBE,
25
+ E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE,
26
+ E.RESUBSCRIBE
27
+ ],
28
+ [E.SUBSCRIPTION_PREFERENCE_CENTER]: [
29
+ E.SUBSCRIPTION_PREFERENCE_CENTER,
30
+ E.SUBSCRIPTION_PREFERENCE_CONFIRMATION
31
+ ]
32
+ }, B = {
33
+ [E.GLOBAL_UNSUBSCRIBE]: s("unsubscription-preference.type-global-unsubscribe"),
34
+ [E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE]: s("unsubscription-preference.type-global-unsubscription-confirmation"),
35
+ [E.RESUBSCRIBE]: s("unsubscription-preference.type-resubscribe"),
36
+ [E.SUBSCRIPTION_PREFERENCE_CENTER]: s("unsubscription-preference.type-subscription-preferences-center"),
37
+ [E.SUBSCRIPTION_PREFERENCE_CONFIRMATION]: s("unsubscription-preference.type-subscription-preferences-confirmation")
38
+ }, C = {
39
+ default: "{{ins-unsubscribe-link}}",
40
+ [E.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
41
+ [E.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
12
42
  };
13
43
  export {
14
- s as LINK_REGEXES,
15
- E as LINK_TYPES,
16
- _ as URLS
44
+ I as ACADEMY_LINK,
45
+ _ as DEFAULT_UNSUBSCRIBE_GROUP,
46
+ S as LINK_REGEXES,
47
+ R as LINK_TYPES,
48
+ C as MERGE_TAGS,
49
+ E as PAGE_TYPES,
50
+ i as TYPE_COLLECTIONS,
51
+ B as TYPE_TRANSLATIONS,
52
+ r as UNSUBSCRIBE_PAGES_LINK,
53
+ N as URLS
17
54
  };
@@ -1,90 +1,92 @@
1
- var E = Object.defineProperty;
2
- var c = (r, s, t) => s in r ? E(r, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[s] = t;
3
- var a = (r, s, t) => c(r, typeof s != "symbol" ? s + "" : s, t);
4
- import { useHttp as l } from "../../../composables/useHttp.js";
5
- import { Control as d, UIElementType as n, UEAttr as e, ModificationDescription as L } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
6
- const p = "ui-elements-checkbox", o = "select", { get: h } = l();
7
- class b extends d {
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 u } 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", a = "select", { get: C } = L();
8
+ class S extends h {
8
9
  constructor() {
9
10
  super(...arguments);
10
- a(this, "currentNode");
11
- a(this, "selectedUnsubGroup");
12
- a(this, "unsubList", []);
11
+ o(this, "currentNode");
12
+ o(this, "selectedUnsubGroup");
13
+ o(this, "unsubList", []);
13
14
  }
14
15
  getId() {
15
- return p;
16
+ return m;
16
17
  }
17
18
  _setFormValues() {
18
- this.api.updateValues({
19
- [o]: ""
20
- });
19
+ if (this.currentNode && "getAttribute" in this.currentNode) {
20
+ const e = this.currentNode.getAttribute("id");
21
+ if (e) {
22
+ const s = e === u.sendGridId ? e : Number(e);
23
+ s && (this.selectedUnsubGroup = s, this.api.updateValues({
24
+ [a]: this.selectedUnsubGroup
25
+ }));
26
+ }
27
+ }
21
28
  }
22
- _getLabel(t, i = `${Math.random()}`) {
29
+ _getLabel(e, s = `${Math.random()}`) {
23
30
  return `
24
- <${n.LABEL}
25
- ${e.LABEL.text}="${t}"
26
- ${e.LABEL.name}="${i}">
27
- </${n.LABEL}>
31
+ <${i.LABEL}
32
+ ${t.LABEL.text}="${e}"
33
+ ${t.LABEL.name}="${s}">
34
+ </${i.LABEL}>
28
35
  `;
29
36
  }
30
- _getSelectItem(t, i) {
37
+ _getSelectItem(e, s) {
31
38
  return `
32
- <${n.SELECT_ITEM}
33
- ${e.SELECT_ITEM.text}="${t}"
34
- ${e.SELECT_ITEM.value}="${i}">
35
- </${n.SELECT_ITEM}>`;
39
+ <${i.SELECT_ITEM}
40
+ ${t.SELECT_ITEM.text}="${e}"
41
+ ${t.SELECT_ITEM.value}="${s}">
42
+ </${i.SELECT_ITEM}>`;
36
43
  }
37
44
  _getSelect() {
38
- return this.unsubList.map((t) => this._getSelectItem(t.name, t.sendGridId)).join("");
45
+ return this.unsubList.map((e) => this._getSelectItem(e.name, e.sendGridId)).join("");
39
46
  }
40
47
  getTemplate() {
41
48
  return `
42
49
  <div class="checkbox-controls-container">
43
50
  <div class="checkbox-select-container container two-columns stretch">
44
- <${n.LABEL}
45
- ${e.LABEL.text}="${this.api.translate("Unsubscribe Group")}"
46
- ${e.LABEL.name}="${Math.random()}">
47
- </${n.LABEL}>
51
+ <${i.LABEL}
52
+ ${t.LABEL.text}="${this.api.translate("Unsubscribe Group")}"
53
+ ${t.LABEL.name}="${Math.random()}">
54
+ </${i.LABEL}>
48
55
 
49
- <${n.SELECTPICKER}
50
- ${e.SELECTPICKER.name}="${o}"
51
- ${e.SELECTPICKER.placeholder}="${this.api.translate("Select Unsubscribe Group")}">
56
+ <${i.SELECTPICKER}
57
+ ${t.SELECTPICKER.name}="${a}"
58
+ ${t.SELECTPICKER.placeholder}="${this.api.translate("Select Unsubscribe Group")}">
52
59
  ${this._getSelect()}
53
- </${n.SELECTPICKER}>
60
+ </${i.SELECTPICKER}>
54
61
  </div>
55
62
  </div>
56
63
  `;
57
64
  }
58
- _onSelectChange(t) {
59
- this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", t.toString()).apply(new L(`Updated text to ${t}`));
65
+ _onSelectChange(e) {
66
+ this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", e.toString()).apply(new p(`Updated text to ${e}`));
60
67
  }
61
68
  _listenToFormUpdates() {
62
- this.api.onValueChanged(o, (t) => this._onSelectChange(t));
69
+ this.api.onValueChanged(a, (e) => this._onSelectChange(e));
63
70
  }
64
- onTemplateNodeUpdated(t) {
65
- if (this.currentNode = t, "getAttribute" in t) {
66
- const i = Number(t.getAttribute("id"));
67
- i && (this.selectedUnsubGroup = i, this.api.updateValues({
68
- [o]: this.selectedUnsubGroup
69
- }));
70
- }
71
+ onTemplateNodeUpdated(e) {
72
+ this.currentNode = e;
71
73
  }
72
74
  // eslint-disable-next-line @typescript-eslint/no-misused-promises
73
75
  async onRender() {
74
- const t = await h(
76
+ const e = await C(
75
77
  "/unsubscribe-groups/unsubscribe-list"
76
- ), i = t.data.map((u) => ({
77
- [e.SELECT_ITEM.text]: u.name,
78
- [e.SELECT_ITEM.value]: u.sendGridId
78
+ ), s = [u, ...e.data], E = s.map((c) => ({
79
+ [t.SELECT_ITEM.text]: c.name,
80
+ [t.SELECT_ITEM.value]: c.sendGridId
79
81
  }));
80
- this.unsubList = t.data, this.api.setUIEAttribute(
81
- o,
82
- e.SELECTPICKER.items,
83
- i
82
+ this.unsubList = s, this.api.setUIEAttribute(
83
+ a,
84
+ t.SELECTPICKER.items,
85
+ E
84
86
  ), this._setFormValues(), this._listenToFormUpdates();
85
87
  }
86
88
  }
87
89
  export {
88
- p as CHECKBOX_CONTROL_BLOCK_ID,
89
- b as CheckboxControl
90
+ m as CHECKBOX_CONTROL_BLOCK_ID,
91
+ S as CheckboxControl
90
92
  };