@useinsider/guido 3.8.1-beta.2ee94c2 → 3.8.1-beta.34bf80d

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 (51) hide show
  1. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +8 -8
  2. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +15 -12
  3. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +5 -5
  4. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +16 -15
  5. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +5 -5
  6. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +42 -37
  7. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +3 -3
  8. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +40 -37
  9. package/dist/composables/useHtmlValidator.js +180 -133
  10. package/dist/composables/usePreviewInteractionGuard.js +17 -0
  11. package/dist/composables/useSave.js +14 -14
  12. package/dist/composables/validators/useUnsubscribeBlockValidator.js +26 -17
  13. package/dist/config/compiler/utils/recommendationCompilerUtils.js +58 -57
  14. package/dist/config/compiler/utils/recommendationIgnoreUtils.js +15 -0
  15. package/dist/config/migrator/recommendation/extractors.js +44 -22
  16. package/dist/config/migrator/recommendation/htmlBuilder.js +175 -169
  17. package/dist/config/migrator/recommendationMigrator.js +30 -31
  18. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +26 -20
  19. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +55 -41
  20. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +58 -57
  21. package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +43 -31
  22. package/dist/extensions/Blocks/Recommendation/controls/main/productCount.js +3 -2
  23. package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +55 -45
  24. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +63 -56
  25. package/dist/extensions/Blocks/Recommendation/controls/syncInfoMessage.js +7 -6
  26. package/dist/extensions/Blocks/Recommendation/extension.js +3 -2
  27. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +3 -2
  28. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +3 -2
  29. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +13 -12
  30. package/dist/extensions/Blocks/Recommendation/templates/index.js +7 -6
  31. package/dist/extensions/Blocks/Recommendation/templates/utils.js +1 -1
  32. package/dist/extensions/Blocks/Unsubscribe/block.js +40 -37
  33. package/dist/extensions/Blocks/Unsubscribe/control.js +19 -16
  34. package/dist/guido.css +1 -1
  35. package/dist/src/composables/useHtmlValidator.d.ts +27 -0
  36. package/dist/src/composables/useHtmlValidator.test.d.ts +1 -0
  37. package/dist/src/composables/usePreviewInteractionGuard.d.ts +3 -0
  38. package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +1 -0
  39. package/dist/src/config/compiler/utils/recommendationIgnoreUtils.d.ts +17 -0
  40. package/dist/src/config/compiler/utils/recommendationIgnoreUtils.test.d.ts +1 -0
  41. package/dist/src/config/migrator/recommendation/extractors.d.ts +15 -0
  42. package/dist/src/config/migrator/recommendation/htmlBuilder.d.ts +8 -0
  43. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  44. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +21 -0
  45. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +7 -0
  46. package/dist/src/extensions/Blocks/Recommendation/controls/main/layoutOrientation.d.ts +5 -0
  47. package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +6 -0
  48. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +9 -0
  49. package/dist/src/stores/unsubscribe.d.ts +11 -1
  50. package/dist/stores/unsubscribe.js +8 -7
  51. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
- import r from "./DesktopPreview.vue2.js";
1
+ import o from "./DesktopPreview.vue2.js";
2
2
  /* empty css */
3
- import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
3
+ import r from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
4
  var a = function() {
5
5
  var s = this, e = s._self._c, t = s._self._setupProxy;
6
6
  return e("div", { staticClass: "desktop-preview-wrapper" }, [e("p", { staticClass: "f-s-1 f-w-600 l-h-1 t-t-u t-c-53 mb-6 l-s-5" }, [s._v(" " + s._s(t.trans("email-editor.desktop-preview")) + " ")]), e("div", { ref: "containerRef", staticClass: "desktop-preview d-f f-d-c o-h s-1" }, [e(t.DesktopBrowserHeader), e("div", { staticClass: "desktop-preview__content d-f f-g-1 o-h b-c-5 min-h-0" }, [e("div", { staticClass: "f-g-1 h-1 o-h b-c-4 min-w-0" }, [t.isContainerReady ? e("iframe", { staticClass: "desktop-preview__iframe d-b w-1 h-1 b-c-4 bor-s-n", attrs: { sandbox: `
@@ -8,16 +8,16 @@ var a = function() {
8
8
  allow-popups
9
9
  allow-forms
10
10
  allow-scripts
11
- allow-popups-to-escape-sandbox`, srcdoc: t.previewStore.previewHtml } }) : s._e()])])], 1)]);
12
- }, i = [], p = /* @__PURE__ */ o(
13
- r,
11
+ allow-popups-to-escape-sandbox`, srcdoc: t.previewStore.previewHtml }, on: { load: t.onIframeLoad } }) : s._e()])])], 1)]);
12
+ }, i = [], n = /* @__PURE__ */ r(
13
+ o,
14
14
  a,
15
15
  i,
16
16
  !1,
17
17
  null,
18
- "988f8da6"
18
+ "06afaecb"
19
19
  );
20
- const _ = p.exports;
20
+ const f = n.exports;
21
21
  export {
22
- _ as default
22
+ f as default
23
23
  };
@@ -1,23 +1,26 @@
1
- import { defineComponent as f, ref as s, onMounted as c, onBeforeUnmount as m, nextTick as u } from "vue";
2
- import { useTranslations as p } from "../../../../composables/useTranslations.js";
3
- import { usePreviewStore as l } from "../../../../stores/preview.js";
4
- import _ from "./DesktopBrowserHeader.vue.js";
5
- const x = /* @__PURE__ */ f({
1
+ import { defineComponent as u, ref as a, onMounted as p, onBeforeUnmount as l, nextTick as v } from "vue";
2
+ import { usePreviewInteractionGuard as d } from "../../../../composables/usePreviewInteractionGuard.js";
3
+ import { useTranslations as _ } from "../../../../composables/useTranslations.js";
4
+ import { usePreviewStore as w } from "../../../../stores/preview.js";
5
+ import I from "./DesktopBrowserHeader.vue.js";
6
+ const C = /* @__PURE__ */ u({
6
7
  __name: "DesktopPreview",
7
- setup(v) {
8
- const a = p(), o = s(), n = s(!1), i = l();
8
+ setup(k) {
9
+ const i = _(), { blockPreviewInteractions: t } = d(), o = a(), n = a(!1), c = w();
9
10
  let e = null;
10
- const t = () => {
11
+ const f = (m) => {
12
+ t(m.target);
13
+ }, r = () => {
11
14
  o.value && (e = new ResizeObserver(() => {
12
- }), e.observe(o.value), u(() => {
15
+ }), e.observe(o.value), v(() => {
13
16
  n.value = !0;
14
17
  }));
15
- }, r = () => {
18
+ }, s = () => {
16
19
  e == null || e.disconnect();
17
20
  };
18
- return c(t), m(r), { __sfc: !0, trans: a, containerRef: o, isContainerReady: n, previewStore: i, resizeObserver: e, initIframe: t, cleanIframe: r, DesktopBrowserHeader: _ };
21
+ return p(r), l(s), { __sfc: !0, trans: i, blockPreviewInteractions: t, containerRef: o, isContainerReady: n, previewStore: c, resizeObserver: e, onIframeLoad: f, initIframe: r, cleanIframe: s, DesktopBrowserHeader: I };
19
22
  }
20
23
  });
21
24
  export {
22
- x as default
25
+ C as default
23
26
  };
@@ -1,20 +1,20 @@
1
1
  import e from "./ContentView.vue2.js";
2
2
  /* empty css */
3
3
  import n from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
- var o = function() {
4
+ var c = function() {
5
5
  var t = this, s = t._self._c, a = t._self._setupProxy;
6
6
  return s("div", { staticClass: "w-1 h-1 b-c-4 d-f f-d-c" }, [s("div", { staticClass: "d-f j-c-s-b a-i-c p-2 h-6-s" }, [s("div", { staticClass: "d-f a-i-c cur-p", on: { click: function(l) {
7
7
  return t.$emit("back-to-inbox");
8
8
  } } }, [s(a.InIcons, { staticClass: "f-s-3 i-c-7", attrs: { name: "line-chevron-left" } }), s("span", { staticClass: "ml-2 f-s-1 f-w-400 l-h-1 t-c-7" }, [t._v(t._s(a.trans("newsletter.inbox")))])], 1), s("div", { staticClass: "d-f a-i-c" }, [s(a.InIcons, { staticClass: "i-c-52", attrs: { name: "line-chevron-down" } }), s(a.InIcons, { staticClass: "ml-1 i-c-52", attrs: { name: "line-chevron-up" } })], 1)]), s("div", { staticClass: "iframe-wrapper f-g-1 o-h" }, [s("iframe", { ref: "iframeRef", staticClass: "iframe-scaled d-b b-c-4 bor-s-n", attrs: { sandbox: "allow-same-origin allow-popups allow-forms allow-scripts allow-popups-to-escape-sandbox", srcdoc: a.previewStore.previewHtml }, on: { load: a.onLoad } })])]);
9
- }, i = [], r = /* @__PURE__ */ n(
9
+ }, o = [], i = /* @__PURE__ */ n(
10
10
  e,
11
+ c,
11
12
  o,
12
- i,
13
13
  !1,
14
14
  null,
15
- "e0424e99"
15
+ "cbafc185"
16
16
  );
17
- const d = r.exports;
17
+ const d = i.exports;
18
18
  export {
19
19
  d as default
20
20
  };
@@ -1,23 +1,24 @@
1
- import { defineComponent as m, ref as c } from "vue";
2
- import { useResponsivePreview as f } from "../../../../composables/useResponsivePreview.js";
3
- import { useTranslations as a } from "../../../../composables/useTranslations.js";
4
- import { usePreviewStore as p } from "../../../../stores/preview.js";
5
- import { InIcons as u } from "@useinsider/design-system-vue";
6
- const h = /* @__PURE__ */ m({
1
+ import { defineComponent as m, ref as a } from "vue";
2
+ import { usePreviewInteractionGuard as f } from "../../../../composables/usePreviewInteractionGuard.js";
3
+ import { useResponsivePreview as p } from "../../../../composables/useResponsivePreview.js";
4
+ import { useTranslations as u } from "../../../../composables/useTranslations.js";
5
+ import { usePreviewStore as v } from "../../../../stores/preview.js";
6
+ import { InIcons as P } from "@useinsider/design-system-vue";
7
+ const g = /* @__PURE__ */ m({
7
8
  __name: "ContentView",
8
9
  emits: ["back-to-inbox"],
9
- setup(v) {
10
- const i = a(), t = p(), n = c(), { setupResponsivePreview: r } = f(), s = (o) => {
11
- ["transform", "transform-origin", "height"].forEach((e) => {
12
- o.documentElement.style.removeProperty(e);
10
+ setup(_) {
11
+ const c = u(), t = v(), r = a(), { setupResponsivePreview: n } = p(), { blockPreviewInteractions: s } = f(), i = (e) => {
12
+ ["transform", "transform-origin", "height"].forEach((o) => {
13
+ e.documentElement.style.removeProperty(o);
13
14
  });
14
15
  };
15
- return { __sfc: !0, trans: i, previewStore: t, iframeRef: n, setupResponsivePreview: r, clearAMPTransforms: s, onLoad: () => {
16
- const o = n.value, e = o == null ? void 0 : o.contentDocument;
17
- e && (r(o), t.isAMPResponsive && s(e));
18
- }, InIcons: u };
16
+ return { __sfc: !0, trans: c, previewStore: t, iframeRef: r, setupResponsivePreview: n, blockPreviewInteractions: s, clearAMPTransforms: i, onLoad: () => {
17
+ const e = r.value, o = e == null ? void 0 : e.contentDocument;
18
+ o && (n(e), s(e), t.isAMPResponsive && i(o));
19
+ }, InIcons: P };
19
20
  }
20
21
  });
21
22
  export {
22
- h as default
23
+ g as default
23
24
  };
@@ -1,6 +1,6 @@
1
- import a from "./UnsubscribePageSelection.vue2.js";
1
+ import n from "./UnsubscribePageSelection.vue2.js";
2
2
  /* empty css */
3
- import n from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ import a from "../../../_virtual/_plugin-vue2_normalizer.js";
4
4
  var o = function() {
5
5
  var r = this, e = r._self._c, t = r._self._setupProxy;
6
6
  return e(t.WpDrawer, { attrs: { id: "unsubscribe-modal", "description-status": "", size: "large", "footer-button-group-options": t.footerButtonGroupOptions, status: t.unsubscribeStore.pageSelectionDrawerStatus, "title-text": t.trans("newsletter.select-a-template") }, on: { cancelOrBackButtonEvent: t.handleBack, onCloseEvent: t.handleClose, primaryButtonEvent: t.handleSave }, scopedSlots: r._u([{ key: "headerBottomSlot", fn: function() {
@@ -10,13 +10,13 @@ var o = function() {
10
10
  return t.selectTemplate(s.id);
11
11
  } } }, [e(t.InContainer, { staticClass: "template-container o-h", class: { selected: t.unsubscribeStore.getSelectedTemplateByActiveType === s.id }, attrs: { border: t.getBorderClass(s.id) } }, [e("div", { staticClass: "w-1 h-1 d-f j-c-c a-i-c" }, [e("img", { staticClass: "w-1 h-1 thumbnail o-h", attrs: { alt: s.name, src: s.thumbnail } })])]), e("div", { staticClass: "mt-1 f-s-1" }, [r._v(" " + r._s(s.name) + " ")])], 1);
12
12
  }), 0)]);
13
- }, i = [], c = /* @__PURE__ */ n(
14
- a,
13
+ }, i = [], c = /* @__PURE__ */ a(
14
+ n,
15
15
  o,
16
16
  i,
17
17
  !1,
18
18
  null,
19
- "f6a8cb4c"
19
+ "669fe7cf"
20
20
  );
21
21
  const _ = c.exports;
22
22
  export {
@@ -1,66 +1,71 @@
1
- import { defineComponent as y, ref as S, computed as a, watch as T } from "vue";
2
- import v from "../../wrappers/WpDrawer.vue.js";
3
- import { useToaster as C } from "../../../composables/useToaster.js";
4
- import { useTranslations as B } from "../../../composables/useTranslations.js";
5
- import { ToasterTypeOptions as w } from "../../../enums/toaster.js";
6
- import { useUnsubscribeStore as h } from "../../../stores/unsubscribe.js";
7
- import { InContainer as U } from "@useinsider/design-system-vue";
8
- import P from "./UnsubscribeBreadcrumb.vue.js";
9
- const L = /* @__PURE__ */ y({
1
+ import { defineComponent as y, ref as T, computed as a, watch as v } from "vue";
2
+ import w from "../../wrappers/WpDrawer.vue.js";
3
+ import { useToaster as B } from "../../../composables/useToaster.js";
4
+ import { useTranslations as C } from "../../../composables/useTranslations.js";
5
+ import { ToasterTypeOptions as h } from "../../../enums/toaster.js";
6
+ import { useEditorStore as P } from "../../../stores/editor.js";
7
+ import { useUnsubscribeStore as U } from "../../../stores/unsubscribe.js";
8
+ import { InContainer as _ } from "@useinsider/design-system-vue";
9
+ import I from "./UnsubscribeBreadcrumb.vue.js";
10
+ const N = /* @__PURE__ */ y({
10
11
  __name: "UnsubscribePageSelection",
11
- setup(_) {
12
- const s = B(), e = h(), { showToaster: r } = C(), o = S(!1), c = a(() => e.isActiveTypeLastInCollection ? o.value ? s("unsubscription-preference.applying-changes") : s("statistics.apply") : s("products.select-and-continue")), i = a(() => e.pageSelectionUpdateStatus && e.isActiveTypeFirstInCollection ? s("products.cancel") : s("newsletter.back")), u = a(() => ({
12
+ setup(x) {
13
+ const s = C(), e = U(), r = P(), { showToaster: c } = B(), o = T(!1), i = a(() => e.isActiveTypeLastInCollection ? o.value ? s("unsubscription-preference.applying-changes") : s("statistics.apply") : s("products.select-and-continue")), l = a(() => e.pageSelectionUpdateStatus && e.isActiveTypeFirstInCollection ? s("products.cancel") : s("newsletter.back")), p = a(() => ({
13
14
  primaryButton: {
14
15
  styling: "solid",
15
16
  type: "primary",
16
- labelText: c.value,
17
+ labelText: i.value,
17
18
  loadingStatus: o.value,
18
19
  disabledStatus: !1
19
20
  },
20
21
  cancelOrBackButton: {
21
22
  styling: "ghost",
22
23
  type: "secondary",
23
- labelText: i.value,
24
+ labelText: l.value,
24
25
  disabledStatus: o.value
25
26
  }
26
- })), p = (t) => e.getSelectedTemplateByActiveType === t ? "bor-w-3 bor-s-s bor-c-7" : "bor-w-1 bor-s-s bor-c-6", n = (t) => {
27
+ })), d = (t) => e.getSelectedTemplateByActiveType === t ? "bor-w-3 bor-s-s bor-c-7" : "bor-w-1 bor-s-s bor-c-6", n = (t) => {
27
28
  e.pageSelectionDrawerStatus = !1, t && setTimeout(() => {
28
29
  t();
29
30
  }, 500);
30
- }, d = () => {
31
- n(), e.pageSelectionUpdateStatus || document.dispatchEvent(new CustomEvent("unsubscribe:cancel"));
32
31
  }, m = () => {
32
+ n(), e.pageSelectionUpdateStatus || document.dispatchEvent(new CustomEvent("unsubscribe:cancel", {
33
+ detail: { blockId: e.pendingBlockId }
34
+ }));
35
+ }, b = () => {
33
36
  if (e.isActiveTypeFirstInCollection) {
34
37
  n(), e.pageSelectionUpdateStatus || (e.typeSelectionDrawerStatus = !0);
35
38
  return;
36
39
  }
37
40
  e.setPreviousType();
38
- }, b = () => {
39
- if (e.isActiveTypeLastInCollection) {
40
- o.value = !0;
41
- const t = e.selectedCollectionType, l = e.getSelectedTemplatesByCollection(t), g = e.getSelectedUnsubscribePagesByCollection(t);
42
- e.removeUnsubscribePages(g), e.addUnsubscribePages(l), document.dispatchEvent(new CustomEvent("unsubscribe:select", {
43
- detail: {
44
- collectionType: t,
45
- selectedPages: l
46
- }
47
- })), n(() => {
48
- o.value = !1, r({
49
- type: w.Success,
50
- message: s("global-unsubscribe.pages-were-attached")
41
+ }, f = () => {
42
+ if (!r.isPreviewModeOpen) {
43
+ if (e.isActiveTypeLastInCollection) {
44
+ o.value = !0;
45
+ const t = e.selectedCollectionType, u = e.getSelectedTemplatesByCollection(t), S = e.getSelectedUnsubscribePagesByCollection(t);
46
+ e.removeUnsubscribePages(S), e.addUnsubscribePages(u), document.dispatchEvent(new CustomEvent("unsubscribe:select", {
47
+ detail: {
48
+ collectionType: t,
49
+ selectedPages: u
50
+ }
51
+ })), n(() => {
52
+ o.value = !1, c({
53
+ type: h.Success,
54
+ message: s("global-unsubscribe.pages-were-attached")
55
+ });
51
56
  });
52
- });
53
- return;
57
+ return;
58
+ }
59
+ e.setNextType();
54
60
  }
55
- e.setNextType();
56
- }, f = (t) => {
57
- e.setSelectedTemplate(t);
61
+ }, g = (t) => {
62
+ r.isPreviewModeOpen || e.setSelectedTemplate(t);
58
63
  };
59
- return T(() => e.pageSelectionDrawerStatus, (t) => {
64
+ return v(() => e.pageSelectionDrawerStatus, (t) => {
60
65
  t && e.pageSelectionUpdateStatus && e.fetchTemplates();
61
- }), { __sfc: !0, trans: s, unsubscribeStore: e, showToaster: r, isApplying: o, getPrimaryButtonText: c, getCancelOrBackButtonText: i, footerButtonGroupOptions: u, getBorderClass: p, closeModal: n, handleClose: d, handleBack: m, handleSave: b, selectTemplate: f, WpDrawer: v, InContainer: U, UnsubscribeBreadcrumb: P };
66
+ }), { __sfc: !0, trans: s, unsubscribeStore: e, editorStore: r, showToaster: c, isApplying: o, getPrimaryButtonText: i, getCancelOrBackButtonText: l, footerButtonGroupOptions: p, getBorderClass: d, closeModal: n, handleClose: m, handleBack: b, handleSave: f, selectTemplate: g, WpDrawer: w, InContainer: _, UnsubscribeBreadcrumb: I };
62
67
  }
63
68
  });
64
69
  export {
65
- L as default
70
+ N as default
66
71
  };
@@ -2,15 +2,15 @@ import n from "./UnsubscribeTypeSelection.vue2.js";
2
2
  /* empty css */
3
3
  import o from "../../../_virtual/_plugin-vue2_normalizer.js";
4
4
  var i = function() {
5
- var t = this, s = t._self._c, e = t._self._setupProxy;
6
- return s(e.WpDrawer, { attrs: { id: "unsubscribe-modal", "description-status": "", "description-text": e.descriptionText, "footer-button-group-options": e.footerButtonGroupOptions, status: e.unsubscribeStore.typeSelectionDrawerStatus, "title-text": e.trans("unsubscription-preference.select-unsubscribe-page-title") }, on: { cancelOrBackButtonEvent: e.closeModal, onCloseEvent: e.closeModal, primaryButtonEvent: e.selectCollection } }, [s(e.InSegments, { staticClass: "w-1", attrs: { "with-icon": "", align: "vertical", disable: e.isSelecting, "segment-list": e.segmentList, selected: e.selectedCollection, "skeleton-sizing": { width: 495, height: 180 }, "skeleton-status": e.skeletonStatus }, on: { click: e.changeCollection } })], 1);
5
+ var e = this, s = e._self._c, t = e._self._setupProxy;
6
+ return s(t.WpDrawer, { attrs: { id: "unsubscribe-modal", "description-status": "", "description-text": t.descriptionText, "footer-button-group-options": t.footerButtonGroupOptions, status: t.unsubscribeStore.typeSelectionDrawerStatus, "title-text": t.trans("unsubscription-preference.select-unsubscribe-page-title") }, on: { cancelOrBackButtonEvent: t.closeModal, onCloseEvent: t.closeModal, primaryButtonEvent: t.selectCollection } }, [s(t.InSegments, { staticClass: "w-1", attrs: { "with-icon": "", align: "vertical", disable: t.isSelecting, "segment-list": t.segmentList, selected: t.selectedCollection, "skeleton-sizing": { width: 495, height: 180 }, "skeleton-status": t.skeletonStatus }, on: { click: t.changeCollection } })], 1);
7
7
  }, r = [], c = /* @__PURE__ */ o(
8
8
  n,
9
9
  i,
10
10
  r,
11
11
  !1,
12
12
  null,
13
- "18e1220a"
13
+ "7a305bb2"
14
14
  );
15
15
  const _ = c.exports;
16
16
  export {
@@ -1,16 +1,16 @@
1
- import { defineComponent as v, ref as b, computed as f, watch as _ } from "vue";
1
+ import { defineComponent as _, ref as b, computed as f, watch as v } from "vue";
2
2
  import U from "../../wrappers/WpDrawer.vue.js";
3
- import { useToaster as N } from "../../../composables/useToaster.js";
4
- import { useTranslations as w } from "../../../composables/useTranslations.js";
3
+ import { useToaster as w } from "../../../composables/useToaster.js";
4
+ import { useTranslations as N } from "../../../composables/useTranslations.js";
5
5
  import { ACADEMY_LINKS as D } from "../../../enums/academy.js";
6
- import { ToasterTypeOptions as P } from "../../../enums/toaster.js";
7
- import { PAGE_TYPES as l, getTypeTranslations as R, UNSUBSCRIBE_PAGES_LINK as G } from "../../../enums/unsubscribe.js";
8
- import { useUnsubscribeStore as I } from "../../../stores/unsubscribe.js";
6
+ import { ToasterTypeOptions as I } from "../../../enums/toaster.js";
7
+ import { PAGE_TYPES as l, getTypeTranslations as R, UNSUBSCRIBE_PAGES_LINK as P } from "../../../enums/unsubscribe.js";
8
+ import { useUnsubscribeStore as G } from "../../../stores/unsubscribe.js";
9
9
  import { InSegments as L } from "@useinsider/design-system-vue";
10
- const W = /* @__PURE__ */ v({
10
+ const W = /* @__PURE__ */ _({
11
11
  __name: "UnsubscribeTypeSelection",
12
- setup(O) {
13
- const t = w(), { showToaster: d } = N(), e = I(), n = b(!1), i = b(!0), o = b(l.GLOBAL_UNSUBSCRIBE), T = t(
12
+ setup(k) {
13
+ const t = N(), { showToaster: d } = w(), e = G(), n = b(!1), o = b(!0), r = b(l.GLOBAL_UNSUBSCRIBE), T = t(
14
14
  "unsubscription-preference.select-unsubscribe-page-description",
15
15
  { action: `<a href="${D.GLOBAL_UNSUBSCRIBE}" target="_blank">${t("ds-rules.visit-academy")}</a>` }
16
16
  ), y = f(() => [
@@ -31,7 +31,7 @@ const W = /* @__PURE__ */ v({
31
31
  disable: e.isSubscriptionPreferencesCenterDisabled,
32
32
  tooltipText: e.isSubscriptionPreferencesCenterDisabled ? t("unsubscription-preference.pref-center-added") : ""
33
33
  }
34
- ]), S = f(
34
+ ]), g = f(
35
35
  () => e.isGlobalUnsubscribeDisabled && e.isSubscriptionPreferencesCenterDisabled
36
36
  ), C = f(() => ({
37
37
  primaryButton: {
@@ -41,8 +41,8 @@ const W = /* @__PURE__ */ v({
41
41
  n.value ? "unsubscription-preference.selecting-type" : "products.select-and-continue"
42
42
  ),
43
43
  loadingStatus: n.value,
44
- disabledStatus: S.value,
45
- skeletonStatus: i.value,
44
+ disabledStatus: g.value,
45
+ skeletonStatus: o.value,
46
46
  skeletonSizing: { width: 168, height: 40 }
47
47
  },
48
48
  cancelOrBackButton: {
@@ -50,59 +50,62 @@ const W = /* @__PURE__ */ v({
50
50
  type: "secondary",
51
51
  labelText: t("products.cancel"),
52
52
  disabledStatus: n.value,
53
- skeletonStatus: i.value,
53
+ skeletonStatus: o.value,
54
54
  skeletonSizing: { width: 78, height: 40 }
55
55
  }
56
- })), m = (s) => {
57
- e.typeSelectionDrawerStatus = !1, document.dispatchEvent(new CustomEvent("unsubscribe:cancel")), s && setTimeout(() => {
56
+ })), S = (s) => {
57
+ e.typeSelectionDrawerStatus = !1, document.dispatchEvent(new CustomEvent("unsubscribe:cancel", {
58
+ detail: { blockId: e.pendingBlockId }
59
+ })), s && setTimeout(() => {
58
60
  s();
59
61
  }, 500);
60
62
  }, E = (s) => {
61
- o.value = s;
62
- }, g = () => {
63
- const s = e.hasTemplatesByCollectionType, r = [];
64
- if (Object.entries(s).forEach(([c, p]) => {
65
- p || r.push(Number(c));
66
- }), r.length === 0)
63
+ r.value = s;
64
+ }, m = () => {
65
+ const s = e.hasTemplatesByCollectionType, a = [];
66
+ if (Object.entries(s).forEach(([i, p]) => {
67
+ p || a.push(Number(i));
68
+ }), a.length === 0)
67
69
  return !0;
68
- const B = R(), a = r.map((c) => B[c]);
70
+ const h = R(), c = a.map((i) => h[i]);
69
71
  let u = "";
70
- if (r.length === 1)
72
+ if (a.length === 1)
71
73
  u = t("unsubscription-preference.create-page-to-continue", {
72
- page: a[0]
74
+ page: c[0]
73
75
  });
74
- else if (r.length === 2)
76
+ else if (a.length === 2)
75
77
  u = t("unsubscription-preference.create-pages-to-continue", {
76
- page1: a[0],
77
- page2: a[1]
78
+ page1: c[0],
79
+ page2: c[1]
78
80
  });
79
81
  else {
80
- const c = a.pop() ?? "", p = a.join(", ");
82
+ const i = c.pop() ?? "", p = c.join(", ");
81
83
  u = t("unsubscription-preference.create-multiple-pages-to-continue", {
82
84
  pages: p,
83
- lastPage: c
85
+ lastPage: i
84
86
  });
85
87
  }
86
88
  return d({
87
- type: P.Warning,
89
+ type: I.Warning,
88
90
  message: u,
89
91
  actionButton: {
90
92
  text: "Go to Unsubscribe Pages",
91
93
  onClick: () => {
92
- window.location.href = G;
94
+ const i = new URL(P, window.location.origin).href;
95
+ window.open(i, "_blank", "noopener");
93
96
  }
94
97
  }
95
98
  }), !1;
96
- }, h = async () => {
97
- if (n.value = !0, await e.fetchTemplates(), e.setCollection(o.value), !g()) {
98
- n.value = !1, m();
99
+ }, B = async () => {
100
+ if (n.value = !0, await e.fetchTemplates(!0), e.setCollection(r.value), !m()) {
101
+ n.value = !1, S();
99
102
  return;
100
103
  }
101
104
  n.value = !1, e.typeSelectionDrawerStatus = !1, e.pageSelectionDrawerStatus = !0;
102
105
  };
103
- return _(() => e.typeSelectionDrawerStatus, (s) => {
104
- s && (i.value = !0, o.value = l.GLOBAL_UNSUBSCRIBE, e.isGlobalUnsubscribeDisabled && (o.value = e.isSubscriptionPreferencesCenterDisabled ? 0 : l.SUBSCRIPTION_PREFERENCE_CENTER), i.value = !1);
105
- }), { __sfc: !0, trans: t, showToaster: d, unsubscribeStore: e, isSelecting: n, skeletonStatus: i, selectedCollection: o, descriptionText: T, segmentList: y, hasNoSelectableType: S, footerButtonGroupOptions: C, closeModal: m, changeCollection: E, validateTemplates: g, selectCollection: h, WpDrawer: U, InSegments: L };
106
+ return v(() => e.typeSelectionDrawerStatus, (s) => {
107
+ s && (o.value = !0, r.value = l.GLOBAL_UNSUBSCRIBE, e.isGlobalUnsubscribeDisabled && (r.value = e.isSubscriptionPreferencesCenterDisabled ? 0 : l.SUBSCRIPTION_PREFERENCE_CENTER), o.value = !1);
108
+ }), { __sfc: !0, trans: t, showToaster: d, unsubscribeStore: e, isSelecting: n, skeletonStatus: o, selectedCollection: r, descriptionText: T, segmentList: y, hasNoSelectableType: g, footerButtonGroupOptions: C, closeModal: S, changeCollection: E, validateTemplates: m, selectCollection: B, WpDrawer: U, InSegments: L };
106
109
  }
107
110
  });
108
111
  export {