@useinsider/guido 3.12.0-beta.840207a → 3.12.0-beta.86e34da

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 (54) hide show
  1. package/dist/@types/config/schemas.js +6 -6
  2. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +1 -1
  3. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +8 -8
  4. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +5 -5
  5. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +10 -10
  6. package/dist/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue.js +8 -6
  7. package/dist/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue2.js +98 -71
  8. package/dist/composables/usePreviewInteractionGuard.js +36 -11
  9. package/dist/composables/useRecommendation.js +63 -78
  10. package/dist/composables/useRecommendationPreview.js +61 -60
  11. package/dist/enums/extensions/filteringV2.js +1017 -1
  12. package/dist/enums/extensions/recommendationBlock.js +34 -19
  13. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
  14. package/dist/extensions/Blocks/Recommendation/controls/blockBackground/index.js +10 -0
  15. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +24 -20
  16. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +245 -106
  17. package/dist/extensions/Blocks/Recommendation/extension.js +23 -21
  18. package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +17 -3
  19. package/dist/extensions/Blocks/Recommendation/recommendation.css.js +257 -0
  20. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +41 -40
  21. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +310 -117
  22. package/dist/extensions/Blocks/Recommendation/utils/strategyNavigation.js +8 -0
  23. package/dist/extensions/Blocks/Recommendation/utils/strategySummary.js +93 -8
  24. package/dist/extensions/Blocks/Recommendation/utils/strategyUrl.js +43 -0
  25. package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +18 -16
  26. package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +3 -2
  27. package/dist/extensions/Blocks/common-control.js +2 -1
  28. package/dist/extensions/Blocks/controlFactories.js +125 -75
  29. package/dist/guido.css +1 -1
  30. package/dist/services/recommendationApi.js +90 -45
  31. package/dist/services/stripoApi.js +18 -18
  32. package/dist/src/@types/config/schemas.d.ts +2 -2
  33. package/dist/src/composables/usePreviewInteractionGuard.d.ts +1 -1
  34. package/dist/src/enums/extensions/recommendationBlock.d.ts +25 -2
  35. package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +1 -0
  36. package/dist/src/extensions/Blocks/Recommendation/controls/blockBackground/index.d.ts +14 -0
  37. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
  38. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +7 -3
  39. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +59 -45
  40. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +301 -4
  41. package/dist/src/extensions/Blocks/Recommendation/utils/strategyNavigation.d.ts +10 -0
  42. package/dist/src/extensions/Blocks/Recommendation/utils/strategyUrl.d.ts +51 -0
  43. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +5 -0
  44. package/dist/src/extensions/Blocks/Unsubscribe/utils/constants.d.ts +1 -0
  45. package/dist/src/extensions/Blocks/common-control.d.ts +2 -1
  46. package/dist/src/extensions/Blocks/controlFactories.d.ts +36 -0
  47. package/dist/src/mock/api/recommendation-strategies.d.ts +2 -0
  48. package/dist/src/services/recommendationApi.d.ts +3 -1
  49. package/dist/src/utils/urlSchemes.d.ts +6 -0
  50. package/dist/static/styles/base.css.js +0 -15
  51. package/dist/static/styles/components/base-input.css.js +6 -7
  52. package/dist/utils/templatePreparation.js +56 -47
  53. package/dist/utils/urlSchemes.js +4 -0
  54. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { ModuleFolderDefaults as y } from "../../enums/defaults.js";
2
- import { object as a, number as n, optional as e, string as t, picklist as l, pipe as p, minLength as b, custom as h, boolean as o, array as c, record as k, fallback as R, literal as i, looseObject as g, variant as C, union as f, unknown as s, lazy as T } from "../../node_modules/valibot/dist/index.js";
2
+ import { object as a, number as n, optional as e, string as t, picklist as l, pipe as p, minLength as b, custom as f, boolean as o, array as c, record as k, fallback as R, literal as i, looseObject as g, variant as C, union as h, unknown as s, lazy as T } from "../../node_modules/valibot/dist/index.js";
3
3
  const d = {
4
4
  /** Promotional/marketing emails */
5
5
  PROMOTIONAL: 1,
@@ -83,7 +83,7 @@ const d = {
83
83
  /** Block ID (matches the dictionary key and the legacy HTML element id) */
84
84
  id: e(n()),
85
85
  /** Decimal places for price display (legacy data may use string or number) */
86
- decimalCount: e(f([t(), n()])),
86
+ decimalCount: e(h([t(), n()])),
87
87
  /** Pinned product IDs (empty array when filter-driven) */
88
88
  productIds: e(c(s())),
89
89
  /** Whether the block requested live products at send time */
@@ -117,7 +117,7 @@ const d = {
117
117
  /** Block type marker used by some legacy variants */
118
118
  blockType: e(t()),
119
119
  /** Size variant marker (legacy data may use string or number) */
120
- size: e(f([t(), n()])),
120
+ size: e(h([t(), n()])),
121
121
  /** Vertical responsiveness flag (legacy size=1 variants) */
122
122
  verticalResponsiveness: e(o()),
123
123
  /** Legacy "Move to next line" price placement toggle (cardPricePlacement.js) */
@@ -206,7 +206,7 @@ const d = {
206
206
  * Select a Reusable Recommendation Strategy (RRS) instead of a per-block algorithm.
207
207
  * Replaces the algorithm dropdown with a strategy dropdown fed from Smart Recommender.
208
208
  */
209
- reusableRecommendationStrategy: e(o(), !1)
209
+ reusableRecommendationStrategy: e(o(), !0)
210
210
  }), U = l([
211
211
  "amp-accordion",
212
212
  "amp-carousel",
@@ -274,7 +274,7 @@ const d = {
274
274
  ...m.entries,
275
275
  type: i("custom"),
276
276
  /** Custom processor function */
277
- processor: h(
277
+ processor: f(
278
278
  (u) => typeof u == "function",
279
279
  "processor must be a function"
280
280
  )
@@ -294,7 +294,7 @@ const d = {
294
294
  * Return false to cancel the save operation.
295
295
  */
296
296
  externalValidation: e(
297
- h(
297
+ f(
298
298
  (u) => typeof u == "function",
299
299
  "externalValidation must be a function"
300
300
  )
@@ -15,7 +15,7 @@ var a = function() {
15
15
  i,
16
16
  !1,
17
17
  null,
18
- "06afaecb"
18
+ "cf946232"
19
19
  );
20
20
  const f = n.exports;
21
21
  export {
@@ -1,24 +1,24 @@
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";
1
+ import { defineComponent as u, ref as a, onMounted as p, onBeforeUnmount as l, nextTick as d } from "vue";
2
+ import { usePreviewInteractionGuard as v } from "../../../../composables/usePreviewInteractionGuard.js";
3
3
  import { useTranslations as _ } from "../../../../composables/useTranslations.js";
4
4
  import { usePreviewStore as w } from "../../../../stores/preview.js";
5
5
  import I from "./DesktopBrowserHeader.vue.js";
6
6
  const C = /* @__PURE__ */ u({
7
7
  __name: "DesktopPreview",
8
- setup(k) {
9
- const i = _(), { blockPreviewInteractions: t } = d(), o = a(), n = a(!1), c = w();
8
+ setup(P) {
9
+ const i = _(), { guardPreviewInteractions: t } = v(), o = a(), r = a(!1), c = w();
10
10
  let e = null;
11
11
  const f = (m) => {
12
12
  t(m.target);
13
- }, r = () => {
13
+ }, n = () => {
14
14
  o.value && (e = new ResizeObserver(() => {
15
- }), e.observe(o.value), v(() => {
16
- n.value = !0;
15
+ }), e.observe(o.value), d(() => {
16
+ r.value = !0;
17
17
  }));
18
18
  }, s = () => {
19
19
  e == null || e.disconnect();
20
20
  };
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 };
21
+ return p(n), l(s), { __sfc: !0, trans: i, guardPreviewInteractions: t, containerRef: o, isContainerReady: r, previewStore: c, resizeObserver: e, onIframeLoad: f, initIframe: n, cleanIframe: s, DesktopBrowserHeader: I };
22
22
  }
23
23
  });
24
24
  export {
@@ -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 c = function() {
4
+ var o = 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
- }, o = [], i = /* @__PURE__ */ n(
9
+ }, i = [], r = /* @__PURE__ */ n(
10
10
  e,
11
- c,
12
11
  o,
12
+ i,
13
13
  !1,
14
14
  null,
15
- "cbafc185"
15
+ "f255b2bb"
16
16
  );
17
- const d = i.exports;
17
+ const d = r.exports;
18
18
  export {
19
19
  d as default
20
20
  };
@@ -1,24 +1,24 @@
1
- import { defineComponent as m, ref as a } from "vue";
1
+ import { defineComponent as c, ref as a } from "vue";
2
2
  import { usePreviewInteractionGuard as f } from "../../../../composables/usePreviewInteractionGuard.js";
3
3
  import { useResponsivePreview as p } from "../../../../composables/useResponsivePreview.js";
4
4
  import { useTranslations as u } from "../../../../composables/useTranslations.js";
5
5
  import { usePreviewStore as v } from "../../../../stores/preview.js";
6
- import { InIcons as P } from "@useinsider/design-system-vue";
7
- const g = /* @__PURE__ */ m({
6
+ import { InIcons as d } from "@useinsider/design-system-vue";
7
+ const b = /* @__PURE__ */ c({
8
8
  __name: "ContentView",
9
9
  emits: ["back-to-inbox"],
10
- setup(_) {
11
- const c = u(), t = v(), r = a(), { setupResponsivePreview: n } = p(), { blockPreviewInteractions: s } = f(), i = (e) => {
10
+ setup(P) {
11
+ const m = u(), r = v(), t = a(), { setupResponsivePreview: n } = p(), { guardPreviewInteractions: s } = f(), i = (e) => {
12
12
  ["transform", "transform-origin", "height"].forEach((o) => {
13
13
  e.documentElement.style.removeProperty(o);
14
14
  });
15
15
  };
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 };
16
+ return { __sfc: !0, trans: m, previewStore: r, iframeRef: t, setupResponsivePreview: n, guardPreviewInteractions: s, clearAMPTransforms: i, onLoad: () => {
17
+ const e = t.value, o = e == null ? void 0 : e.contentDocument;
18
+ o && (n(e), s(e), r.isAMPResponsive && i(o));
19
+ }, InIcons: d };
20
20
  }
21
21
  });
22
22
  export {
23
- g as default
23
+ b as default
24
24
  };
@@ -4,19 +4,21 @@ import l from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
4
  var c = function() {
5
5
  var i;
6
6
  var a = this, s = a._self._c, t = a._self._setupProxy;
7
- return s(t.InDrawer, { attrs: { id: "recommendation-strategy-detail-drawer", "close-button-status": "", "full-width-content-status": "", "overlay-status": "", size: "medium", state: "default", "description-status": !1, "footer-status": !1, status: t.isOpen, "title-text": ((i = t.strategy) == null ? void 0 : i.name) || "" }, on: { onCloseEvent: t.close }, scopedSlots: a._u([{ key: "headerBottomSlot", fn: function() {
7
+ return s(t.InDrawer, { attrs: { id: "recommendation-strategy-detail-drawer", "close-button-status": "", "footer-status": "", "full-width-content-status": "", "overlay-status": "", size: "medium", state: "default", "description-status": !1, "footer-button-group-options": t.footerButtonGroupOptions, status: t.isOpen, "title-text": ((i = t.strategy) == null ? void 0 : i.name) || "" }, on: { cancelOrBackButtonEvent: t.close, onCloseEvent: t.close, primaryButtonEvent: t.onPrimaryAction }, scopedSlots: a._u([{ key: "headerBottomSlot", fn: function() {
8
8
  return [t.strategy ? s(t.InTabs, { staticClass: "p-r z-4 px-5", attrs: { "active-tab": t.activeTab, "add-new-tab-active": !1, draggable: !1, "dropdown-tabs": !1, "tabs-list": t.tabs, "use-router": !1 }, on: { click: function(e) {
9
9
  t.activeTab = e;
10
10
  } } }) : a._e()];
11
11
  }, proxy: !0 }, { key: "contentSlot", fn: function() {
12
- return [t.strategy ? s("div", [t.activeTab === t.DetailTabs.GENERAL ? s("div", [s("div", { staticClass: "px-5 py-5 bor-b-s-s bor-b-c-6 bor-b-w-1" }, [s("div", { staticClass: "f-s-13 f-w-600 mb-3" }, [a._v(" " + a._s(t.trans("discovery-strategy.suitable-page-and-channel-types")) + " ")]), a._l(t.visibleRows(t.pageAndChannelDetails), function(e, r) {
12
+ return [t.strategy ? s("div", [t.isSharedAcrossCampaigns ? s("div", { staticClass: "px-5 pt-5" }, [s(t.InInfoBox, { attrs: { id: "strategy-shared-notice", theme: "light", variant: "information", "description-status": !1, "title-status": !1 } }, [s("ul", { staticClass: "strategy-shared-notice" }, a._l(t.sharedNotice, function(e, r) {
13
+ return s("li", { key: r, domProps: { innerHTML: a._s(e) } });
14
+ }), 0)])], 1) : a._e(), t.activeTab === t.DetailTabs.GENERAL ? s("div", [s("div", { staticClass: "px-5 py-5 bor-b-s-s bor-b-c-6 bor-b-w-1" }, [s("div", { staticClass: "f-s-13 f-w-600 mb-3" }, [a._v(" " + a._s(t.trans("discovery-strategy.suitable-page-and-channel-types")) + " ")]), a._l(t.visibleRows(t.pageAndChannelDetails), function(e, r) {
13
15
  return s(t.InfoDisplayValue, { key: e.title, attrs: { index: r, title: e.title, "translate-value": e.translateValue, value: e.value } });
14
16
  })], 2), s("div", { staticClass: "px-5 py-5 bor-b-s-s bor-b-c-6 bor-b-w-1" }, [s("div", { staticClass: "f-s-13 f-w-600 mb-3" }, [a._v(" " + a._s(t.trans("discovery-strategy.recommendation-widget-preferences")) + " ")]), a._l(t.visibleRows(t.widgetPreferences), function(e, r) {
15
17
  return s(t.InfoDisplayValue, { key: e.title, attrs: { index: r, title: e.title, "translate-value": e.translateValue, value: e.value } });
16
18
  })], 2), s("div", { staticClass: "px-5 py-5 bor-b-s-s bor-b-c-6 bor-b-w-1" }, [s("div", { staticClass: "f-s-13 f-w-600 mb-3" }, [a._v(" " + a._s(t.trans("discovery-strategy.advanced-personalization-criteria")) + " ")]), a._l(t.visibleRows(t.advancedPersonalization), function(e, r) {
17
19
  return s(t.InfoDisplayValue, { key: e.title, attrs: { index: r, title: e.title, "translate-value": e.translateValue, value: e.value } });
18
20
  })], 2), s("div", { staticClass: "px-5 py-5" }, [s("div", { staticClass: "f-s-13 f-w-600 mb-3" }, [a._v(" " + a._s(t.trans("discovery-strategy.filters")) + " ")]), s(t.FilterHumanizer, { attrs: { filters: t.strategy.filters } })], 1)]) : a._e(), t.activeTab === t.DetailTabs.OTHER ? s("div", [s("div", { staticClass: "px-5 py-5 bor-b-s-s bor-b-c-6 bor-b-w-1 other-details" }, a._l(t.visibleRows(t.otherDetails), function(e, r) {
19
- return s(t.InfoDisplayValue, { key: e.title, attrs: { icon: e.icon, "icon-tooltip": e.iconTooltip, "icon-tooltip-after-clicked": e.iconTooltipAfterClicked, index: r, title: e.title, "translate-value": e.translateValue, value: e.value }, on: { iconClick: function(b) {
21
+ return s(t.InfoDisplayValue, { key: e.title, attrs: { icon: e.icon, "icon-tooltip": e.iconTooltip, "icon-tooltip-after-clicked": e.iconTooltipAfterClicked, index: r, title: e.title, "translate-value": e.translateValue, value: e.value }, on: { iconClick: function(f) {
20
22
  var n;
21
23
  (n = e.iconClick) == null || n.call(e, e.value);
22
24
  } } });
@@ -28,9 +30,9 @@ var c = function() {
28
30
  u,
29
31
  !1,
30
32
  null,
31
- "008cf324"
33
+ "30363cc2"
32
34
  );
33
- const d = v.exports;
35
+ const _ = v.exports;
34
36
  export {
35
- d as default
37
+ _ as default
36
38
  };
@@ -1,115 +1,142 @@
1
- import { defineComponent as ee, ref as te, computed as l, watch as G } from "vue";
2
- import { useTranslations as ae } from "../../../../composables/useTranslations.js";
3
- import { DetailTabs as c, EMAIL_CHANNEL as se, PageTypeTranslationKeys as le, TIME as U, COUNT as F } from "../../../../enums/extensions/strategyDetail.js";
4
- import { useRecommendationExtensionStore as ie } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
5
- import { getMethodTranslationKey as re, getAlgorithmTranslationKey as ue } from "../../../../extensions/Blocks/Recommendation/utils/strategySummary.js";
6
- import { formatShortDate as X } from "../../../../utils/dateUtil.js";
7
- import { parseJsonField as w } from "../../../../utils/genericUtil.js";
8
- import { InTabs as oe, InDrawer as ne } from "@useinsider/design-system-vue";
9
- import ce from "./strategy-detail/CampaignTable.vue.js";
10
- import de from "./strategy-detail/FilterHumanizer.vue.js";
11
- import ve from "./strategy-detail/InfoDisplayValue.vue.js";
12
- const Ee = /* @__PURE__ */ ee({
1
+ import { defineComponent as le, ref as ie, computed as l, watch as U } from "vue";
2
+ import { useTranslations as re } from "../../../../composables/useTranslations.js";
3
+ import { STRATEGY_PAGES as oe } from "../../../../enums/extensions/recommendationBlock.js";
4
+ import { DetailTabs as c, EMAIL_CHANNEL as ue, PageTypeTranslationKeys as ne, TIME as F, COUNT as X } from "../../../../enums/extensions/strategyDetail.js";
5
+ import { useRecommendationExtensionStore as ce } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
6
+ import { navigateToStrategyPage as de, buildStrategyEditPath as ve } from "../../../../extensions/Blocks/Recommendation/utils/strategyNavigation.js";
7
+ import { getMethodTranslationKey as ye, getAlgorithmTranslationKey as pe } from "../../../../extensions/Blocks/Recommendation/utils/strategySummary.js";
8
+ import { formatShortDate as J } from "../../../../utils/dateUtil.js";
9
+ import { parseJsonField as T } from "../../../../utils/genericUtil.js";
10
+ import { InTabs as me, InInfoBox as ge, InDrawer as fe } from "@useinsider/design-system-vue";
11
+ import _e from "./strategy-detail/CampaignTable.vue.js";
12
+ import be from "./strategy-detail/FilterHumanizer.vue.js";
13
+ import he from "./strategy-detail/InfoDisplayValue.vue.js";
14
+ const Re = /* @__PURE__ */ le({
13
15
  __name: "StrategyDetailDrawer",
14
- setup(ye) {
15
- const f = "MIXED", T = "CHECKOUT_RECOMMENDATION", r = ae(), u = ie(), p = te(c.GENERAL), t = l(() => u.getSelectedStrategy), _ = l(() => u.strategyDetailDrawerStatus), b = l(() => t.value ? String(t.value.strategy_id) : ""), o = l(() => r("campaign-details-modal.none")), J = l(() => [
16
+ setup(Ve) {
17
+ const _ = "MIXED", C = "CHECKOUT_RECOMMENDATION", i = re(), o = ce(), p = ie(c.GENERAL), t = l(() => o.getSelectedStrategy), b = l(() => o.strategyDetailDrawerStatus), m = l(() => t.value ? String(t.value.strategy_id) : ""), u = l(() => i("campaign-details-modal.none")), Y = l(() => [
16
18
  {
17
19
  value: c.GENERAL,
18
20
  path: "",
19
- text: r("discovery-strategy.recommendation-strategy-details")
21
+ text: i("discovery-strategy.recommendation-strategy-details")
20
22
  },
21
23
  {
22
24
  value: c.OTHER,
23
25
  path: "",
24
- text: r("discovery-strategy.campaign-and-other-details")
26
+ text: i("discovery-strategy.campaign-and-other-details")
25
27
  }
26
28
  ]);
27
- G(
28
- () => [_.value, p.value, b.value],
29
+ U(
30
+ () => [b.value, p.value, m.value],
29
31
  ([e, a, s]) => {
30
- e && a === c.OTHER && s && u.fetchStrategyCampaigns(s);
32
+ e && a === c.OTHER && s && o.fetchStrategyCampaigns(s);
31
33
  },
32
34
  { immediate: !0 }
33
- ), G(_, (e) => {
35
+ ), U(b, (e) => {
34
36
  e || (p.value = c.GENERAL);
35
37
  });
36
38
  const q = () => {
37
- p.value = c.GENERAL, u.closeStrategyDrawer();
38
- }, C = l(() => u.strategyCampaigns.filter((e) => e.status === "Active").reduce((e, a) => {
39
+ p.value = c.GENERAL, o.closeStrategyDrawer();
40
+ }, h = l(() => {
41
+ var e, a;
42
+ return (((a = (e = t.value) == null ? void 0 : e.campaignCount) == null ? void 0 : a.active) ?? 0) > 1;
43
+ }), Q = l(() => [
44
+ i("strategy-details-modal.first-line"),
45
+ i("strategy-details-modal.second-line").replace("{url}", oe.LISTING)
46
+ ]), W = l(() => ({
47
+ primaryButton: {
48
+ styling: "solid",
49
+ type: "primary",
50
+ labelText: h.value ? i("strategy-details-modal.duplicate-and-assign") : i("strategy-details-modal.edit"),
51
+ loadingStatus: o.strategyDuplicating
52
+ },
53
+ cancelOrBackButton: {
54
+ styling: "ghost",
55
+ type: "secondary",
56
+ labelText: i("products.cancel"),
57
+ disabledStatus: o.strategyDuplicating
58
+ }
59
+ })), Z = () => {
60
+ if (h.value) {
61
+ o.duplicateAndAssignStrategy();
62
+ return;
63
+ }
64
+ de(ve(m.value));
65
+ }, E = l(() => o.strategyCampaigns.filter((e) => e.status === "Active").reduce((e, a) => {
39
66
  var s;
40
67
  return e + (((s = a.variants) == null ? void 0 : s.length) ?? 0);
41
- }, 0)), E = l(() => u.strategyCampaigns.filter((e) => e.status !== "Active").reduce((e, a) => {
68
+ }, 0)), S = l(() => o.strategyCampaigns.filter((e) => e.status !== "Active").reduce((e, a) => {
42
69
  var s;
43
70
  return e + (((s = a.variants) == null ? void 0 : s.length) ?? 0);
44
- }, 0)), D = l(() => {
71
+ }, 0)), A = l(() => {
45
72
  var a;
46
- return (((a = t.value) == null ? void 0 : a.suitable_channels) || "").split(",").map((s) => s.trim()).filter(Boolean).map((s) => r(
47
- s.toLowerCase() === se ? "products.newsletter" : `products.${s.toLowerCase()}`
73
+ return (((a = t.value) == null ? void 0 : a.suitable_channels) || "").split(",").map((s) => s.trim()).filter(Boolean).map((s) => i(
74
+ s.toLowerCase() === ue ? "products.newsletter" : `products.${s.toLowerCase()}`
48
75
  )).join(", ");
49
- }), S = l(() => {
76
+ }), D = l(() => {
50
77
  var s;
51
78
  const e = (s = t.value) == null ? void 0 : s.suitable_page_types;
52
- return e ? (typeof e == "string" ? e.split(",").map((i) => i.trim()) : e).filter(Boolean).map((i) => r(le[i] || i)).join(", ") : "";
53
- }), Q = l(() => [
79
+ return e ? (typeof e == "string" ? e.split(",").map((r) => r.trim()) : e).filter(Boolean).map((r) => i(ne[r] || r)).join(", ") : "";
80
+ }), ee = l(() => [
54
81
  {
55
82
  title: "discovery-strategy.channel-types",
56
- value: D.value || o.value,
83
+ value: A.value || u.value,
57
84
  isVisible: !0,
58
85
  translateValue: !1
59
86
  },
60
87
  {
61
88
  title: "discovery-strategy.page-types",
62
- value: S.value || o.value,
89
+ value: D.value || u.value,
63
90
  isVisible: !0,
64
91
  translateValue: !1
65
92
  }
66
- ]), m = l(
93
+ ]), g = l(
67
94
  () => {
68
95
  var e;
69
- return w((e = t.value) == null ? void 0 : e.base_product, null);
96
+ return T((e = t.value) == null ? void 0 : e.base_product, null);
70
97
  }
71
98
  ), V = l(
72
99
  () => {
73
100
  var e;
74
- return ((e = t.value) == null ? void 0 : e.algorithm) !== f && m.value !== null;
101
+ return ((e = t.value) == null ? void 0 : e.algorithm) !== _ && g.value !== null;
75
102
  }
76
- ), A = l(() => {
77
- const e = m.value;
103
+ ), I = l(() => {
104
+ const e = g.value;
78
105
  if (!e)
79
106
  return "";
80
- const a = r(`discovery-strategy.base-product-source-${e.source}`);
81
- return e.source === "page" ? a : `${a} ${r(`discovery-strategy.base-product-count-${e.count}`)}`;
82
- }), I = l(() => t.value ? t.value.algorithm !== f ? w(t.value.manual_merchandising_products, []).filter(Boolean).join(", ") : w(t.value.mixed_strategies, []).map((e) => e == null ? void 0 : e.productId).filter(Boolean).join(", ") : ""), n = (e) => e ? "common.yes" : "common.no", W = l(() => {
83
- var e, a, s, i, d, v, y;
107
+ const a = i(`discovery-strategy.base-product-source-${e.source}`);
108
+ return e.source === "page" ? a : `${a} ${i(`discovery-strategy.base-product-count-${e.count}`)}`;
109
+ }), B = l(() => t.value ? t.value.algorithm !== _ ? T(t.value.manual_merchandising_products, []).filter(Boolean).join(", ") : T(t.value.mixed_strategies, []).map((e) => e == null ? void 0 : e.productId).filter(Boolean).join(", ") : ""), n = (e) => e ? "common.yes" : "common.no", te = l(() => {
110
+ var e, a, s, r, d, v, y;
84
111
  return [
85
112
  {
86
113
  title: "discovery-strategy.method",
87
- value: re(((e = t.value) == null ? void 0 : e.algorithm) || ""),
114
+ value: ye(((e = t.value) == null ? void 0 : e.algorithm) || ""),
88
115
  isVisible: !0,
89
116
  translateValue: !0
90
117
  },
91
118
  {
92
119
  title: "algorithm-panel.algorithm-header",
93
- value: (((a = t.value) == null ? void 0 : a.algorithm_used) || "").split(",").map((g) => ue(g.trim())).join(", "),
120
+ value: (((a = t.value) == null ? void 0 : a.algorithm_used) || "").split(",").map((f) => pe(f.trim())).join(", "),
94
121
  isVisible: !0,
95
122
  translateValue: !0
96
123
  },
97
124
  {
98
125
  title: "discovery-strategy.base-product-label",
99
- value: A.value,
126
+ value: I.value,
100
127
  isVisible: V.value,
101
128
  translateValue: !1
102
129
  },
103
130
  {
104
131
  title: "discovery-strategy.base-product-pin-label",
105
- value: n((s = m.value) == null ? void 0 : s.pin),
132
+ value: n((s = g.value) == null ? void 0 : s.pin),
106
133
  isVisible: V.value,
107
134
  translateValue: !0
108
135
  },
109
136
  {
110
137
  title: "discovery-strategy.checkout-recommendation-cart-value",
111
- value: String(((i = t.value) == null ? void 0 : i.checkout_recommendation_cart_value) ?? ""),
112
- isVisible: ((d = t.value) == null ? void 0 : d.algorithm_used) === T,
138
+ value: String(((r = t.value) == null ? void 0 : r.checkout_recommendation_cart_value) ?? ""),
139
+ isVisible: ((d = t.value) == null ? void 0 : d.algorithm_used) === C,
113
140
  translateValue: !1
114
141
  },
115
142
  {
@@ -120,7 +147,7 @@ const Ee = /* @__PURE__ */ ee({
120
147
  },
121
148
  {
122
149
  title: "discovery-strategy.manual-merchandising-products",
123
- value: I.value || o.value,
150
+ value: B.value || u.value,
124
151
  isVisible: !0,
125
152
  translateValue: !1
126
153
  },
@@ -131,11 +158,11 @@ const Ee = /* @__PURE__ */ ee({
131
158
  translateValue: !0
132
159
  }
133
160
  ];
134
- }), h = (e, a) => {
135
- const s = (a || "").toLowerCase(), i = e === 1 ? `date-time.${s}` : `date-time.${s}s`;
136
- return `${e ?? ""} ${r(i)}`;
137
- }, x = (e) => `${e ?? ""} ${r(e === 1 ? "discovery-strategy.item" : "discovery-strategy.items")}`, Y = l(() => {
138
- var e, a, s, i, d, v, y, g, L, R, $, M, O, B, P, k, H, j, K, z;
161
+ }), x = (e, a) => {
162
+ const s = (a || "").toLowerCase(), r = e === 1 ? `date-time.${s}` : `date-time.${s}s`;
163
+ return `${e ?? ""} ${i(r)}`;
164
+ }, w = (e) => `${e ?? ""} ${i(e === 1 ? "discovery-strategy.item" : "discovery-strategy.items")}`, ae = l(() => {
165
+ var e, a, s, r, d, v, y, f, L, O, P, R, $, M, k, G, H, j, K, z;
139
166
  return [
140
167
  {
141
168
  title: "discovery-strategy.personalize-recommendations-based-on-attribute-affinity",
@@ -151,32 +178,32 @@ const Ee = /* @__PURE__ */ ee({
151
178
  },
152
179
  {
153
180
  title: "discovery-strategy.exclude-items-viewed-in-the-last",
154
- value: h((i = t.value) == null ? void 0 : i.exclude_view_duration, (d = t.value) == null ? void 0 : d.exclude_view_duration_type),
155
- isVisible: !!((v = t.value) != null && v.exclude_view) && ((y = t.value) == null ? void 0 : y.exclude_view_option) === U,
181
+ value: x((r = t.value) == null ? void 0 : r.exclude_view_duration, (d = t.value) == null ? void 0 : d.exclude_view_duration_type),
182
+ isVisible: !!((v = t.value) != null && v.exclude_view) && ((y = t.value) == null ? void 0 : y.exclude_view_option) === F,
156
183
  translateValue: !1
157
184
  },
158
185
  {
159
186
  title: "discovery-strategy.number-of-items-to-exclude-from-recently-viewed",
160
- value: x((g = t.value) == null ? void 0 : g.exclude_view_item_count),
161
- isVisible: !!((L = t.value) != null && L.exclude_view) && ((R = t.value) == null ? void 0 : R.exclude_view_option) === F,
187
+ value: w((f = t.value) == null ? void 0 : f.exclude_view_item_count),
188
+ isVisible: !!((L = t.value) != null && L.exclude_view) && ((O = t.value) == null ? void 0 : O.exclude_view_option) === X,
162
189
  translateValue: !1
163
190
  },
164
191
  {
165
192
  title: "discovery-strategy.exclude-recently-purchased-items",
166
- value: n(($ = t.value) == null ? void 0 : $.exclude_purchase),
167
- isVisible: !((M = t.value) != null && M.exclude_purchase),
193
+ value: n((P = t.value) == null ? void 0 : P.exclude_purchase),
194
+ isVisible: !((R = t.value) != null && R.exclude_purchase),
168
195
  translateValue: !0
169
196
  },
170
197
  {
171
198
  title: "discovery-strategy.exclude-items-purchase-in-the-last",
172
- value: h((O = t.value) == null ? void 0 : O.exclude_purchase_duration, (B = t.value) == null ? void 0 : B.exclude_purchase_duration_type),
173
- isVisible: !!((P = t.value) != null && P.exclude_purchase) && ((k = t.value) == null ? void 0 : k.exclude_purchase_option) === U,
199
+ value: x(($ = t.value) == null ? void 0 : $.exclude_purchase_duration, (M = t.value) == null ? void 0 : M.exclude_purchase_duration_type),
200
+ isVisible: !!((k = t.value) != null && k.exclude_purchase) && ((G = t.value) == null ? void 0 : G.exclude_purchase_option) === F,
174
201
  translateValue: !1
175
202
  },
176
203
  {
177
204
  title: "discovery-strategy.number-of-items-to-exclude-from-recently-purchased",
178
- value: x((H = t.value) == null ? void 0 : H.exclude_purchase_item_count),
179
- isVisible: !!((j = t.value) != null && j.exclude_purchase) && ((K = t.value) == null ? void 0 : K.exclude_purchase_option) === F,
205
+ value: w((H = t.value) == null ? void 0 : H.exclude_purchase_item_count),
206
+ isVisible: !!((j = t.value) != null && j.exclude_purchase) && ((K = t.value) == null ? void 0 : K.exclude_purchase_option) === X,
180
207
  translateValue: !1
181
208
  },
182
209
  {
@@ -191,12 +218,12 @@ const Ee = /* @__PURE__ */ ee({
191
218
  (a = navigator.clipboard) == null || a.writeText(e).catch(() => {
192
219
  console.warn("[StrategyDetailDrawer] Copying the strategy id to the clipboard failed.");
193
220
  });
194
- }, Z = l(() => {
221
+ }, se = l(() => {
195
222
  var e, a, s;
196
223
  return [
197
224
  {
198
225
  title: "discovery-strategy.strategy-id",
199
- value: b.value,
226
+ value: m.value,
200
227
  isVisible: !0,
201
228
  translateValue: !1,
202
229
  icon: "line-copy",
@@ -206,39 +233,39 @@ const Ee = /* @__PURE__ */ ee({
206
233
  },
207
234
  {
208
235
  title: "discovery-strategy.last-updated-by",
209
- value: ((e = t.value) == null ? void 0 : e.last_updated_by) || o.value,
236
+ value: ((e = t.value) == null ? void 0 : e.last_updated_by) || u.value,
210
237
  isVisible: !0,
211
238
  translateValue: !1
212
239
  },
213
240
  {
214
241
  title: "discovery-strategy.last-updated-on",
215
- value: (a = t.value) != null && a.updated_at ? X(t.value.updated_at) : o.value,
242
+ value: (a = t.value) != null && a.updated_at ? J(t.value.updated_at) : u.value,
216
243
  isVisible: !0,
217
244
  translateValue: !1
218
245
  },
219
246
  {
220
247
  title: "discovery-strategy.created-date",
221
- value: (s = t.value) != null && s.created_at ? X(t.value.created_at) : o.value,
248
+ value: (s = t.value) != null && s.created_at ? J(t.value.created_at) : u.value,
222
249
  isVisible: !0,
223
250
  translateValue: !1
224
251
  },
225
252
  {
226
253
  title: "discovery-strategy.variants-with-live-recommendation-strategies",
227
- value: String(C.value),
254
+ value: String(E.value),
228
255
  isVisible: !0,
229
256
  translateValue: !1
230
257
  },
231
258
  {
232
259
  title: "discovery-strategy.variants-with-idle-recommendation-strategies",
233
- value: String(E.value),
260
+ value: String(S.value),
234
261
  isVisible: !0,
235
262
  translateValue: !1
236
263
  }
237
264
  ];
238
265
  });
239
- return { __sfc: !0, MIXED: f, CHECKOUT_RECOMMENDATION: T, trans: r, store: u, activeTab: p, strategy: t, isOpen: _, strategyId: b, none: o, tabs: J, close: q, liveVariantsCount: C, idleVariantsCount: E, suitableChannelTypes: D, suitablePageTypes: S, pageAndChannelDetails: Q, baseProduct: m, isBaseProductVisible: V, baseProductSourceLabel: A, manualMerchandisingProducts: I, yesNo: n, widgetPreferences: W, durationText: h, itemCountText: x, advancedPersonalization: Y, copyStrategyId: N, otherDetails: Z, visibleRows: (e) => e.filter((a) => a.isVisible), DetailTabs: c, InDrawer: ne, InTabs: oe, CampaignTable: ce, FilterHumanizer: de, InfoDisplayValue: ve };
266
+ return { __sfc: !0, MIXED: _, CHECKOUT_RECOMMENDATION: C, trans: i, store: o, activeTab: p, strategy: t, isOpen: b, strategyId: m, none: u, tabs: Y, close: q, isSharedAcrossCampaigns: h, sharedNotice: Q, footerButtonGroupOptions: W, onPrimaryAction: Z, liveVariantsCount: E, idleVariantsCount: S, suitableChannelTypes: A, suitablePageTypes: D, pageAndChannelDetails: ee, baseProduct: g, isBaseProductVisible: V, baseProductSourceLabel: I, manualMerchandisingProducts: B, yesNo: n, widgetPreferences: te, durationText: x, itemCountText: w, advancedPersonalization: ae, copyStrategyId: N, otherDetails: se, visibleRows: (e) => e.filter((a) => a.isVisible), DetailTabs: c, InDrawer: fe, InInfoBox: ge, InTabs: me, CampaignTable: _e, FilterHumanizer: be, InfoDisplayValue: he };
240
267
  }
241
268
  });
242
269
  export {
243
- Ee as default
270
+ Re as default
244
271
  };
@@ -1,17 +1,42 @@
1
- const o = ["click", "auxclick", "submit"], c = (t) => {
2
- t.preventDefault(), t.stopPropagation();
3
- }, a = () => ({ blockPreviewInteractions: (r) => {
1
+ import { URLS as o, MERGE_TAGS as a } from "../enums/unsubscribe.js";
2
+ import { UNSUBSCRIBE_LINK_SELECTOR as i } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
3
+ import { BASE_SAFE_URL_SCHEMES as u } from "../utils/urlSchemes.js";
4
+ const E = ["click", "auxclick"], d = [
5
+ ...Object.values(a),
6
+ o.UNSUBSCRIBE_URL,
7
+ o.PREFERENCES_URL
8
+ ], l = (e) => {
9
+ if (e.matches(i))
10
+ return !0;
11
+ const r = e.getAttribute("href") ?? "";
12
+ return d.some((t) => r.includes(t));
13
+ }, S = [...u, "tel:", "sms:"], f = (e) => {
14
+ const r = (e.getAttribute("href") ?? "").trim();
15
+ return r === "" || r.startsWith("#") || r.startsWith("{{") ? !1 : S.includes(e.protocol);
16
+ }, m = (e) => {
17
+ var t, n;
18
+ const r = (n = (t = e.target) == null ? void 0 : t.closest) == null ? void 0 : n.call(t, "a");
19
+ if (r) {
20
+ if (l(r) || !f(r)) {
21
+ e.preventDefault(), e.stopPropagation();
22
+ return;
23
+ }
24
+ r.setAttribute("target", "_blank"), r.setAttribute("rel", "noopener noreferrer");
25
+ }
26
+ }, R = (e) => {
27
+ e.preventDefault(), e.stopPropagation();
28
+ }, s = /* @__PURE__ */ new WeakSet(), c = "guidoPreviewGuarded", g = () => ({ guardPreviewInteractions: (r) => {
4
29
  try {
5
- const e = r.contentDocument;
6
- if (!e)
30
+ const t = r.contentDocument;
31
+ if (!t || s.has(t))
7
32
  return;
8
- o.forEach((n) => {
9
- e.addEventListener(n, c, !0);
10
- });
11
- } catch (e) {
12
- console.warn("[usePreviewInteractionGuard] Could not guard preview iframe:", e);
33
+ delete t.documentElement.dataset[c], E.forEach((n) => {
34
+ t.addEventListener(n, m, !0);
35
+ }), t.addEventListener("submit", R, !0), s.add(t), t.documentElement.dataset[c] = "true";
36
+ } catch (t) {
37
+ console.warn("[usePreviewInteractionGuard] Could not guard preview iframe:", t);
13
38
  }
14
39
  } });
15
40
  export {
16
- a as usePreviewInteractionGuard
41
+ g as usePreviewInteractionGuard
17
42
  };