@useinsider/guido 3.18.1-beta.636c82d → 3.18.1-beta.64e6209

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 (28) hide show
  1. package/dist/components/Guido.vue.js +1 -1
  2. package/dist/components/Guido.vue2.js +60 -54
  3. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +11 -13
  4. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +56 -72
  5. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +18 -20
  6. package/dist/composables/useActionsApi.js +24 -20
  7. package/dist/composables/useCortexBlueprintBridge.js +115 -54
  8. package/dist/composables/useEmailTemplateApplier.js +93 -50
  9. package/dist/composables/useTranslations.js +15 -8
  10. package/dist/enums/extensions/recommendationBlock.js +31 -38
  11. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +31 -35
  12. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +68 -129
  13. package/dist/guido.css +1 -1
  14. package/dist/src/composables/useCortexBlueprintBridge.d.ts +4 -3
  15. package/dist/src/composables/useEmailTemplateApplier.d.ts +22 -2
  16. package/dist/src/composables/useTranslations.d.ts +5 -0
  17. package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -2
  18. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -1
  19. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -49
  20. package/dist/src/stores/guido-email-editor.d.ts +29 -7
  21. package/dist/src/stores/onboarding.d.ts +0 -377
  22. package/dist/static/styles/components/recommendation-strategy.css.js +4 -21
  23. package/dist/stores/guido-email-editor.js +5 -1
  24. package/dist/stores/onboarding.js +36 -41
  25. package/package.json +1 -1
  26. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.js +0 -21
  27. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue2.js +0 -46
  28. package/dist/src/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.d.ts +0 -2
@@ -12,7 +12,7 @@ var t = function() {
12
12
  s,
13
13
  !1,
14
14
  null,
15
- "cc5ee925"
15
+ "7674b645"
16
16
  );
17
17
  const v = n.exports;
18
18
  export {
@@ -1,6 +1,6 @@
1
- import { defineComponent as ne, defineAsyncComponent as l, ref as O, computed as u, watch as x, onMounted as re, onUnmounted as se } from "vue";
2
- import { useCortexBlueprintBridge as ae } from "../composables/useCortexBlueprintBridge.js";
3
- import { useEditorLock as ie } from "../composables/useEditorLock.js";
1
+ import { defineComponent as ne, defineAsyncComponent as u, ref as P, computed as p, watch as x, onMounted as re, onUnmounted as se } from "vue";
2
+ import { useCortexBlueprintBridge as ie } from "../composables/useCortexBlueprintBridge.js";
3
+ import { useEditorLock as ae } from "../composables/useEditorLock.js";
4
4
  import { provideGuidoActions as ce } from "../composables/useGuidoActions.js";
5
5
  import { useGuidoStateBridge as de } from "../composables/useGuidoStateBridge.js";
6
6
  import { usePartner as me } from "../composables/usePartner.js";
@@ -9,22 +9,22 @@ import { useTimerClone as ue } from "../composables/useTimerClone.js";
9
9
  import { migrate as W } from "../config/migrator/index.js";
10
10
  import { ModuleFolderDefaults as G } from "../enums/defaults.js";
11
11
  import { RIBBON_SELECTOR as pe } from "../enums/onboarding.js";
12
- import { useRecommendationExtensionStore as h } from "../extensions/Blocks/Recommendation/store/recommendation.js";
12
+ import { useRecommendationExtensionStore as z } from "../extensions/Blocks/Recommendation/store/recommendation.js";
13
13
  import fe from "./organisms/AutoSaveController.vue.js";
14
14
  import ye from "./organisms/base/Toaster.vue.js";
15
15
  import ge from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
16
16
  import ve from "./organisms/header/HeaderWrapper.vue.js";
17
17
  import Se from "./organisms/LoadingWrapper.vue.js";
18
- import be from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
19
- import he from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
18
+ import he from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
19
+ import be from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
20
20
  import { useStripoApi as Ee } from "../services/stripoApi.js";
21
21
  import { useConfigStore as we } from "../stores/config.js";
22
22
  import { useDynamicContentStore as Ce } from "../stores/dynamic-content.js";
23
- import { useEditorStore as H } from "../stores/editor.js";
23
+ import { useEditorStore as E } from "../stores/editor.js";
24
24
  import { usePreviewStore as De } from "../stores/preview.js";
25
25
  import { useTemplateStore as ke } from "../stores/template.js";
26
- import { useUnsubscribeStore as Te } from "../stores/unsubscribe.js";
27
- import { readTrackFloor as $ } from "../utils/linkTrackingIds.js";
26
+ import { useUnsubscribeStore as Fe } from "../stores/unsubscribe.js";
27
+ import { readTrackFloor as H } from "../utils/linkTrackingIds.js";
28
28
  const et = /* @__PURE__ */ ne({
29
29
  __name: "Guido",
30
30
  props: {
@@ -32,25 +32,25 @@ const et = /* @__PURE__ */ ne({
32
32
  ready: { type: Boolean, default: !0 }
33
33
  },
34
34
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
35
- setup(z, { expose: q, emit: r }) {
36
- const a = z, K = l(
35
+ setup($, { expose: q, emit: r }) {
36
+ const i = $, K = u(
37
37
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
38
- ), V = l(
38
+ ), V = u(
39
39
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
40
- ), j = l(
40
+ ), j = u(
41
41
  () => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
42
- ), J = l(
42
+ ), J = u(
43
43
  () => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
44
- ), E = O(), p = O(), f = Ce(), w = Te(), o = we();
45
- a.ready && o.init(a.config);
46
- const c = H(), Q = De(), m = u(() => c.hasChanges), { isTestPartner: X } = me(), C = () => {
44
+ ), w = P(), f = P(), y = Ce(), C = Fe(), o = we();
45
+ i.ready && o.init(i.config);
46
+ const c = E(), Q = De(), m = p(() => c.hasChanges), { isTestPartner: X } = me(), D = () => {
47
47
  var t;
48
- return (t = E.value) == null ? void 0 : t.handleSave(!0);
49
- }, D = (t) => {
48
+ return (t = w.value) == null ? void 0 : t.handleSave(!0);
49
+ }, k = (t) => {
50
50
  c.loadingStatus = t;
51
51
  };
52
- ae(), de();
53
- const y = () => {
52
+ ie(), de();
53
+ const g = () => {
54
54
  var t, e;
55
55
  return {
56
56
  emailId: o.templateId,
@@ -60,13 +60,13 @@ const et = /* @__PURE__ */ ne({
60
60
  savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || G.SAVED_MODULES,
61
61
  defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || G.DEFAULT_MODULES
62
62
  };
63
- }, { initPlugin: k, preloadRuntime: T } = le(), { runExclusive: F, beginMount: R, isCurrentMount: I } = ie();
64
- let g = 0;
65
- const { getDefaultTemplate: M } = Ee(), { cloneTimersOnSave: L, hasTimerBlocks: B } = ue(), Y = u(() => {
63
+ }, { initPlugin: F, preloadRuntime: T } = le(), { runExclusive: I, beginMount: M, isCurrentMount: v } = ae();
64
+ let l = 0;
65
+ const { getDefaultTemplate: R } = Ee(), { cloneTimersOnSave: L, hasTimerBlocks: B } = ue(), Y = p(() => {
66
66
  var t;
67
67
  return !((t = o.ui) != null && t.showHeader);
68
- }), Z = u(() => o.isFeatureEnabled("reusableRecommendationStrategy")), ee = u(
69
- () => !!h().recommendationConfigs.strategyId
68
+ }), Z = p(() => o.isFeatureEnabled("reusableRecommendationStrategy")), ee = p(
69
+ () => !!z().recommendationConfigs.strategyId
70
70
  );
71
71
  ce({
72
72
  onBack: () => {
@@ -76,7 +76,7 @@ const et = /* @__PURE__ */ ne({
76
76
  console.debug("guido:save:start"), r("save:start");
77
77
  },
78
78
  onSaveComplete: (t) => {
79
- const e = { ...t, metadata: y() };
79
+ const e = { ...t, metadata: g() };
80
80
  console.debug("guido:save:complete", e), r("save:complete", e);
81
81
  },
82
82
  onTestEmailClick: () => {
@@ -84,62 +84,68 @@ const et = /* @__PURE__ */ ne({
84
84
  }
85
85
  });
86
86
  const A = (t) => {
87
- console.debug("dynamic-content:close", t), f.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
88
- }, P = () => {
87
+ console.debug("dynamic-content:close", t), y.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
88
+ }, U = () => {
89
89
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
90
90
  };
91
91
  x(() => m.value, () => {
92
92
  r("on-change", m.value);
93
93
  });
94
- const v = (t) => {
94
+ const S = (t) => {
95
95
  const e = t, { attribute: s, position: d } = e.detail;
96
96
  console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", s, d);
97
97
  };
98
- let i = null;
99
- const S = () => {
98
+ let a = null;
99
+ const h = () => {
100
100
  var e;
101
101
  const t = document.querySelector(pe);
102
- (e = p.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
102
+ (e = f.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
103
103
  }, b = async () => {
104
104
  var t;
105
105
  try {
106
- o.initialized || o.init(a.config), c.templateId = o.templateId;
107
- const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", U = (e == null ? void 0 : e.preselectedDynamicContent) || [];
108
- w.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
109
- const _ = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, N = o.isFeatureEnabled("linkTrackingIds");
106
+ o.initialized || o.init(i.config), c.templateId = o.templateId;
107
+ const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", _ = (e == null ? void 0 : e.preselectedDynamicContent) || [];
108
+ C.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
109
+ const N = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, O = o.isFeatureEnabled("linkTrackingIds");
110
110
  let n = {
111
- html: s && await W(s, _),
111
+ html: s && await W(s, N),
112
112
  css: d
113
113
  };
114
- n.html || (n = await M(), n.html = await W(n.html, _));
115
- const te = N ? $(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
116
- B(n.html) && (n.html = await L(n.html)), N && (c.trackIdSessionFloor = Math.max(te, $(n.html)));
114
+ n.html || (n = await R(), n.html = await W(n.html, N));
115
+ const te = O ? H(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
116
+ B(n.html) && (n.html = await L(n.html)), O && (c.trackIdSessionFloor = Math.max(te, H(n.html)));
117
117
  const oe = {
118
- preselectedDynamicContentList: U,
118
+ preselectedDynamicContentList: _,
119
119
  onReady: () => {
120
120
  console.debug("guido:ready"), r("ready");
121
121
  }
122
122
  };
123
- g = R(), await k(n, y(), oe), f.selectedDynamicContentList = U;
123
+ l = M(), await F(n, g(), oe), y.selectedDynamicContentList = _;
124
124
  } catch (e) {
125
125
  console.error("Failed to initialize Stripo editor:", e);
126
126
  }
127
127
  };
128
128
  return re(async () => {
129
129
  var e;
130
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), h().$reset(), H().$reset(), ke().$reset(), S();
131
- const t = (e = p.value) == null ? void 0 : e.parentElement;
132
- if (t && (i = new ResizeObserver(S), i.observe(t)), T(), a.ready)
130
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), z().$reset(), E().$reset(), ke().$reset(), h();
131
+ const t = (e = f.value) == null ? void 0 : e.parentElement;
132
+ if (t && (a = new ResizeObserver(h), a.observe(t)), T(), i.ready)
133
133
  await b();
134
134
  else {
135
- const s = x(() => a.ready, (d) => {
135
+ const s = x(() => i.ready, (d) => {
136
136
  d && (s(), b());
137
137
  });
138
138
  }
139
- document.addEventListener("dynamic-content:open", v);
139
+ document.addEventListener("dynamic-content:open", S);
140
140
  }), se(() => {
141
- i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", v), h().disposeStrategyPageReturn(), F(async () => {
142
- if (I(g))
141
+ if (a == null || a.disconnect(), document.removeEventListener("dynamic-content:open", S), v(l))
142
+ try {
143
+ E().isStripoInitialized = !1;
144
+ } catch (t) {
145
+ console.debug("Failed to close the editor readiness gate on unmount", t);
146
+ }
147
+ I(async () => {
148
+ if (v(l))
143
149
  try {
144
150
  window.UIEditor.removeEditor();
145
151
  } catch {
@@ -149,12 +155,12 @@ const et = /* @__PURE__ */ ne({
149
155
  }), q({
150
156
  dynamicContent: {
151
157
  insert: A,
152
- close: P
158
+ close: U
153
159
  },
154
160
  hasChanges: m,
155
- saveSilent: C,
156
- setLoading: D
157
- }), { __sfc: !0, PreviewContainer: K, OnboardingWrapper: V, AssignStrategyDrawer: j, RemoveStrategyModal: J, headerWrapperRef: E, wrapperRef: p, dynamicContentStore: f, unsubscribeStore: w, props: a, configStore: o, editorStore: c, previewStore: Q, hasChanges: m, isTestPartner: X, saveSilent: C, setLoading: D, emit: r, buildMetadata: y, initPlugin: k, preloadRuntime: T, runExclusive: F, beginMount: R, isCurrentMount: I, mountGeneration: g, getDefaultTemplate: M, cloneTimersOnSave: L, hasTimerBlocks: B, noHeader: Y, isRrsEnabled: Z, hasAssignedStrategy: ee, insertDynamicContent: A, closeDynamicContent: P, handleDynamicContentOpen: v, ribbonObserver: i, updateRibbonOffset: S, startEditor: b, AutoSaveController: fe, Toaster: ye, FilterSelectionDrawer: ge, HeaderWrapper: ve, LoadingWrapper: Se, SaveAsTemplateDrawer: be, UnsubscribeWrapper: he };
161
+ saveSilent: D,
162
+ setLoading: k
163
+ }), { __sfc: !0, PreviewContainer: K, OnboardingWrapper: V, AssignStrategyDrawer: j, RemoveStrategyModal: J, headerWrapperRef: w, wrapperRef: f, dynamicContentStore: y, unsubscribeStore: C, props: i, configStore: o, editorStore: c, previewStore: Q, hasChanges: m, isTestPartner: X, saveSilent: D, setLoading: k, emit: r, buildMetadata: g, initPlugin: F, preloadRuntime: T, runExclusive: I, beginMount: M, isCurrentMount: v, mountGeneration: l, getDefaultTemplate: R, cloneTimersOnSave: L, hasTimerBlocks: B, noHeader: Y, isRrsEnabled: Z, hasAssignedStrategy: ee, insertDynamicContent: A, closeDynamicContent: U, handleDynamicContentOpen: S, ribbonObserver: a, updateRibbonOffset: h, startEditor: b, AutoSaveController: fe, Toaster: ye, FilterSelectionDrawer: ge, HeaderWrapper: ve, LoadingWrapper: Se, SaveAsTemplateDrawer: he, UnsubscribeWrapper: be };
158
164
  }
159
165
  });
160
166
  export {
@@ -1,21 +1,19 @@
1
- import s from "./AssignStrategyDrawer.vue2.js";
1
+ import r from "./AssignStrategyDrawer.vue2.js";
2
2
  /* empty css */
3
3
  /* empty css */
4
- import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
5
- var a = function() {
6
- var e = this, r = e._self._c, t = e._self._setupProxy;
7
- return t.store.assignStrategyDrawerStatus ? r(t.OrgStrategyDetailModal, { staticClass: "assign-strategy-drawer", attrs: { "description-status": "", show: "", "description-text": t.drawerDescription, "footer-button-group-options": t.footerButtonGroupOptions, strategy: t.selectedStrategy ?? {}, "title-text": t.trans("gpt-app-builder.assign-recommendation-strategy") }, on: { close: t.closeDrawer, primaryClick: t.assignStrategy }, scopedSlots: e._u([{ key: "contentTop", fn: function() {
8
- return [r("div", { staticClass: "assign-strategy-drawer-content px-5 py-5" }, [r(t.OrgStrategyDropdown, { staticClass: "assign-strategy-select", attrs: { id: "assign-strategy-select", "create-button-visible": "", "info-box-position": "bottom right", loading: t.store.strategiesLoading, "placeholder-text": t.trans("smart-recommender.select-recommendation-strategy"), "selected-strategy-id": t.selectedStrategyId, state: t.showSelectionError ? "error" : "default", "state-message": t.showSelectionError ? t.trans("ds-steps.select-strategy-tooltip") : "", strategies: t.strategyOptions }, on: { create: function(l) {
9
- return t.store.openStrategyCreation();
10
- }, infoBoxButtonClick: t.onInfoBoxButtonClick, select: t.onSelect } })], 1)];
11
- }, proxy: !0 }], null, !1, 1517791821) }) : e._e();
12
- }, n = [], i = /* @__PURE__ */ o(
13
- s,
14
- a,
4
+ import a from "../../../../_virtual/_plugin-vue2_normalizer.js";
5
+ var o = function() {
6
+ var e = this, s = e._self._c, t = e._self._setupProxy;
7
+ return t.store.assignStrategyDrawerStatus ? s(t.OrgStrategyDetailModal, { staticClass: "assign-strategy-drawer", attrs: { "description-status": "", show: "", "description-text": t.drawerDescription, "footer-button-group-options": t.footerButtonGroupOptions, strategy: t.selectedStrategy ?? {}, "title-text": t.trans("gpt-app-builder.assign-recommendation-strategy") }, on: { close: t.closeDrawer, primaryClick: t.assignStrategy }, scopedSlots: e._u([{ key: "contentTop", fn: function() {
8
+ return [s("div", { staticClass: "assign-strategy-drawer-content px-5 py-5" }, [s(t.OrgStrategyDropdown, { staticClass: "assign-strategy-select", attrs: { id: "assign-strategy-select", "info-box-position": "bottom right", "create-button-visible": !1, loading: t.store.strategiesLoading, "placeholder-text": t.trans("smart-recommender.select-recommendation-strategy"), "selected-strategy-id": t.selectedStrategyId, state: t.showSelectionError ? "error" : "default", "state-message": t.showSelectionError ? t.trans("ds-steps.select-strategy-tooltip") : "", strategies: t.strategyOptions }, on: { select: t.onSelect } })], 1)];
9
+ }, proxy: !0 }], null, !1, 2542767044) }) : e._e();
10
+ }, n = [], i = /* @__PURE__ */ a(
11
+ r,
12
+ o,
15
13
  n,
16
14
  !1,
17
15
  null,
18
- "a90e37f5"
16
+ "2580a7d9"
19
17
  );
20
18
  const y = i.exports;
21
19
  export {
@@ -1,50 +1,48 @@
1
- import { defineComponent as I, defineAsyncComponent as f, ref as S, computed as c, watch as T } from "vue";
1
+ import { defineComponent as v, defineAsyncComponent as y, ref as u, computed as l, watch as O } from "vue";
2
2
  import "@useinsider/design-system-organisms/style";
3
- import { useToaster as O } from "../../../../composables/useToaster.js";
4
- import { useTranslations as h } from "../../../../composables/useTranslations.js";
5
- import { DOTTED_DATE_LOCALE as A } from "../../../../enums/date.js";
6
- import { URLS as B } from "../../../../enums/extensions/recommendationBlock.js";
7
- import { ToasterTypeOptions as y } from "../../../../enums/toaster.js";
8
- import { useRecommendationExtensionStore as b } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
9
- import N from "./StrategyInfoBoxContent.vue.js";
10
- import { formatShortDate as k } from "../../../../utils/dateUtil.js";
11
- import { asText as _ } from "../../../../utils/genericUtil.js";
12
- import { escapeHtml as L } from "../../../../utils/htmlEscape.js";
13
- import { InSkeleton as P } from "@useinsider/design-system-vue";
14
- const Z = /* @__PURE__ */ I({
3
+ import { useToaster as x } from "../../../../composables/useToaster.js";
4
+ import { useTranslations as A } from "../../../../composables/useTranslations.js";
5
+ import { DOTTED_DATE_LOCALE as E } from "../../../../enums/date.js";
6
+ import { URLS as h } from "../../../../enums/extensions/recommendationBlock.js";
7
+ import { ToasterTypeOptions as m } from "../../../../enums/toaster.js";
8
+ import { useRecommendationExtensionStore as C } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
9
+ import B from "./StrategyInfoBoxContent.vue.js";
10
+ import { formatShortDate as I } from "../../../../utils/dateUtil.js";
11
+ import { asText as f } from "../../../../utils/genericUtil.js";
12
+ import { escapeHtml as N } from "../../../../utils/htmlEscape.js";
13
+ import { InSkeleton as b } from "@useinsider/design-system-vue";
14
+ const W = /* @__PURE__ */ v({
15
15
  __name: "AssignStrategyDrawer",
16
- setup(R) {
17
- const g = () => import("@useinsider/design-system-organisms"), d = (t, r) => ({
18
- render: (s) => s(P, { props: { sizing: { width: t, height: r } } })
19
- }), D = f({
20
- loader: async () => (await g()).OrgStrategyDetailModal,
21
- loadingComponent: d(480, 240),
16
+ setup(k) {
17
+ const c = () => import("@useinsider/design-system-organisms"), g = (t, r) => ({
18
+ render: (a) => a(b, { props: { sizing: { width: t, height: r } } })
19
+ }), S = y({
20
+ loader: async () => (await c()).OrgStrategyDetailModal,
21
+ loadingComponent: g(480, 240),
22
22
  delay: 0
23
- }), w = f({
24
- loader: async () => (await g()).OrgStrategyDropdown,
25
- loadingComponent: d(240, 42),
23
+ }), T = y({
24
+ loader: async () => (await c()).OrgStrategyDropdown,
25
+ loadingComponent: g(240, 42),
26
26
  delay: 0
27
- }), i = "guido-edit-strategy-", a = h(), e = b(), { showToaster: l } = O(), o = S(null), n = S(!1), v = c(() => e.assignStrategyDrawerStatus ? a("email-editor.assign-strategy-description", { url: B.RECOMMENDATION_STRATEGIES_PANEL_PATH }) : ""), m = () => {
28
- !e.assignStrategyDrawerStatus || !e.lastCreatedStrategyId || (o.value = e.lastCreatedStrategyId, n.value = !1, e.lastCreatedStrategyId = null);
29
- };
30
- T(() => e.assignStrategyDrawerStatus, (t) => {
27
+ }), o = A(), e = C(), { showToaster: s } = x(), n = u(null), i = u(!1), _ = l(() => e.assignStrategyDrawerStatus ? o("email-editor.assign-strategy-description", { url: h.RECOMMENDATION_STRATEGIES_PANEL_PATH }) : "");
28
+ O(() => e.assignStrategyDrawerStatus, (t) => {
31
29
  if (!t)
32
30
  return;
33
31
  const { strategyId: r } = e.recommendationConfigs;
34
- o.value = r || null, n.value = !1, e.fetchStrategies().then(m).catch(() => {
35
- l({
36
- type: y.Error,
37
- message: a("discovery-strategy.error-description")
32
+ n.value = r || null, i.value = !1, e.fetchStrategies().catch(() => {
33
+ s({
34
+ type: m.Error,
35
+ message: o("discovery-strategy.error-description")
38
36
  });
39
37
  });
40
- }), T(() => e.lastCreatedStrategyId, m);
41
- const u = (t) => {
42
- const r = _(t.updated_at || t.created_at);
38
+ });
39
+ const p = (t) => {
40
+ const r = f(t.updated_at || t.created_at);
43
41
  if (!r)
44
42
  return "";
45
- const s = k(r, A);
46
- return a("recommendation-strategy.last-updated-on", { value: s });
47
- }, x = c(() => e.strategies.map((t) => ({
43
+ const a = I(r, E);
44
+ return o("recommendation-strategy.last-updated-on", { value: a });
45
+ }, D = l(() => e.strategies.map((t) => ({
48
46
  text: t.name,
49
47
  value: t.strategy_id,
50
48
  infoBoxProps: {
@@ -52,71 +50,57 @@ const Z = /* @__PURE__ */ I({
52
50
  theme: "light",
53
51
  variant: "information",
54
52
  className: "assign-strategy-info-box",
55
- titleText: L(_(t.name)),
53
+ titleText: N(f(t.name)),
56
54
  descriptionStatus: !0,
57
- descriptionText: u(t),
58
- slot: N,
59
- slotProps: { strategy: t },
60
- // The info box drops the option's value/text, so the id is the only channel
61
- // that can carry the strategy back to the click handler.
62
- buttonOptions: [{
63
- id: `${i}${t.strategy_id}`,
64
- text: a("eureka.edit-strategy"),
65
- type: "text",
66
- // Resolved from Guido's own public/sprite.svg by InIcons; an unknown name would
67
- // silently render blank space instead of failing.
68
- icon: "line-open-website"
69
- }]
55
+ descriptionText: p(t),
56
+ slot: B,
57
+ slotProps: { strategy: t }
70
58
  }
71
- }))), C = (t) => {
72
- var s;
73
- const r = (s = t == null ? void 0 : t.id) != null && s.startsWith(i) ? t.id.slice(i.length) : "";
74
- r && e.openStrategyEdit(r);
75
- }, p = c(() => {
76
- const t = e.strategies.find((r) => String(r.strategy_id) === String(o.value ?? ""));
59
+ }))), d = l(() => {
60
+ const t = e.strategies.find((r) => String(r.strategy_id) === String(n.value ?? ""));
77
61
  return t ? { ...t, fallback_config: null } : null;
78
- }), E = c(() => ({
62
+ }), w = l(() => ({
79
63
  primaryButton: {
80
64
  styling: "solid",
81
65
  type: "primary",
82
- labelText: a("products.assign-btn")
66
+ labelText: o("products.assign-btn")
83
67
  },
84
68
  cancelOrBackButton: {
85
69
  styling: "ghost",
86
70
  type: "secondary",
87
- labelText: a("products.cancel")
71
+ labelText: o("products.cancel")
88
72
  }
89
73
  }));
90
- return { __sfc: !0, loadOrganisms: g, skeleton: d, OrgStrategyDetailModal: D, OrgStrategyDropdown: w, EDIT_BUTTON_ID_PREFIX: i, trans: a, store: e, showToaster: l, selectedStrategyId: o, showSelectionError: n, drawerDescription: v, consumeLastCreatedStrategy: m, lastUpdatedText: u, strategyOptions: x, onInfoBoxButtonClick: C, selectedStrategy: p, footerButtonGroupOptions: E, closeDrawer: () => {
74
+ return { __sfc: !0, loadOrganisms: c, skeleton: g, OrgStrategyDetailModal: S, OrgStrategyDropdown: T, trans: o, store: e, showToaster: s, selectedStrategyId: n, showSelectionError: i, drawerDescription: _, lastUpdatedText: p, strategyOptions: D, selectedStrategy: d, footerButtonGroupOptions: w, closeDrawer: () => {
91
75
  e.closeAssignStrategyDrawer();
92
76
  }, assignStrategy: async () => {
93
- const t = p.value;
77
+ const t = d.value;
94
78
  if (!t) {
95
- n.value = !0;
79
+ i.value = !0;
96
80
  return;
97
81
  }
98
82
  let r = "";
99
83
  try {
100
84
  r = await e.resolveStrategyUrlTemplate(t, e.recommendationConfigs.currencySettings.value);
101
- } catch (s) {
102
- console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed", s);
85
+ } catch (a) {
86
+ console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed", a);
103
87
  }
104
88
  if (!r) {
105
- l({
106
- type: y.Error,
107
- message: a("email-editor.strategy-assign-failed", { strategyName: t.name })
89
+ s({
90
+ type: m.Error,
91
+ message: o("email-editor.strategy-assign-failed", { strategyName: t.name })
108
92
  });
109
93
  return;
110
94
  }
111
- e.assignStrategy(t), l({
112
- type: y.Success,
113
- message: a("email-editor.strategy-assigned-success", { strategyName: t.name })
95
+ e.assignStrategy(t), s({
96
+ type: m.Success,
97
+ message: o("email-editor.strategy-assigned-success", { strategyName: t.name })
114
98
  }), e.closeAssignStrategyDrawer();
115
99
  }, onSelect: (t) => {
116
- o.value = t.value, n.value = !1;
100
+ n.value = t.value, i.value = !1;
117
101
  } };
118
102
  }
119
103
  });
120
104
  export {
121
- Z as default
105
+ W as default
122
106
  };
@@ -1,28 +1,26 @@
1
1
  import { defineComponent as b, computed as e, onMounted as O, watch as t } from "vue";
2
2
  import u from "./AMPOnboarding.vue.js";
3
3
  import v from "./GenericOnboarding.vue.js";
4
- import y from "./ItemsOnboarding.vue.js";
5
- import l from "./NewVersionPopup.vue.js";
6
- import S from "./RecommendationStrategyOnboarding.vue.js";
7
- import h from "./TextBlockOnboarding.vue.js";
8
- import w from "./VersionHistoryOnboarding.vue.js";
9
- import { usePartner as P } from "../../../composables/usePartner.js";
10
- import { useEditorStore as _ } from "../../../stores/editor.js";
11
- import { useOnboardingStore as A } from "../../../stores/onboarding.js";
12
- import { usePreviewStore as H } from "../../../stores/preview.js";
13
- const N = /* @__PURE__ */ b({
4
+ import l from "./ItemsOnboarding.vue.js";
5
+ import y from "./NewVersionPopup.vue.js";
6
+ import S from "./TextBlockOnboarding.vue.js";
7
+ import h from "./VersionHistoryOnboarding.vue.js";
8
+ import { usePartner as w } from "../../../composables/usePartner.js";
9
+ import { useEditorStore as P } from "../../../stores/editor.js";
10
+ import { useOnboardingStore as _ } from "../../../stores/onboarding.js";
11
+ import { usePreviewStore as A } from "../../../stores/preview.js";
12
+ const G = /* @__PURE__ */ b({
14
13
  __name: "OnboardingWrapper",
15
14
  emits: ["onboarding-finished"],
16
- setup(M, { emit: g }) {
17
- const o = A(), r = _(), s = H(), { isTestPartner: a } = P(), m = e(() => r.isStripoInitialized), p = e(() => a()), d = [
18
- { type: "newVersionPopup", component: l },
15
+ setup(H, { emit: f }) {
16
+ const o = _(), r = P(), s = A(), { isTestPartner: a } = w(), p = e(() => r.isStripoInitialized), d = e(() => a()), m = [
17
+ { type: "newVersionPopup", component: y },
19
18
  { type: "genericOnboarding", component: v },
20
- { type: "textBlockOnboarding", component: h },
21
- { type: "versionHistoryOnboarding", component: w },
19
+ { type: "textBlockOnboarding", component: S },
20
+ { type: "versionHistoryOnboarding", component: h },
22
21
  { type: "ampOnboarding", component: u },
23
- { type: "itemsOnboarding", component: y },
24
- { type: "recommendationStrategyOnboarding", component: S }
25
- ], c = (n) => p.value || !m.value ? !1 : n === "newVersionPopup" ? o.shouldShowOnboarding(n) : o.isActive(n), f = e(() => d.filter((n) => c(n.type)));
22
+ { type: "itemsOnboarding", component: l }
23
+ ], c = (n) => d.value || !p.value ? !1 : n === "newVersionPopup" ? o.shouldShowOnboarding(n) : o.isActive(n), g = e(() => m.filter((n) => c(n.type)));
26
24
  return O(async () => {
27
25
  await o.fetchUserModalState();
28
26
  }), t(
@@ -40,9 +38,9 @@ const N = /* @__PURE__ */ b({
40
38
  (n) => {
41
39
  !n && o.isActive("ampOnboarding") && o.close("ampOnboarding");
42
40
  }
43
- ), { __sfc: !0, emit: g, onboardingStore: o, editorStore: r, previewStore: s, isTestPartner: a, isStripoReady: m, isTestPartnerActive: p, onboardingConfigs: d, shouldShow: c, visibleOnboardings: f };
41
+ ), { __sfc: !0, emit: f, onboardingStore: o, editorStore: r, previewStore: s, isTestPartner: a, isStripoReady: p, isTestPartnerActive: d, onboardingConfigs: m, shouldShow: c, visibleOnboardings: g };
44
42
  }
45
43
  });
46
44
  export {
47
- N as default
45
+ G as default
48
46
  };
@@ -1,17 +1,21 @@
1
1
  import { filterAmpErrors as v } from "../utils/ampErrorFilter.js";
2
2
  import { useToaster as y } from "./useToaster.js";
3
- const D = 1e4, d = 3e4, s = (n, l, u) => new Promise((T, m) => {
4
- const w = setTimeout(
5
- () => m(new Error(`${n} did not report completion within ${l}ms`)),
3
+ const D = 1e4, T = 3e4, p = (n, l, w) => new Promise((A, s) => {
4
+ const c = setTimeout(
5
+ () => s(new Error(`${n} did not report completion within ${l}ms`)),
6
6
  l
7
- ), p = (A) => (t) => {
8
- clearTimeout(w), A(t);
7
+ ), d = (r) => (t) => {
8
+ clearTimeout(c), r(t);
9
9
  };
10
- u(p(T), p(m));
10
+ try {
11
+ w(d(A), d(s));
12
+ } catch (r) {
13
+ clearTimeout(c), s(r instanceof Error ? r : new Error(String(r)));
14
+ }
11
15
  }), I = () => {
12
- const { handleError: n } = y(), l = (t = {}) => s(
16
+ const { handleError: n } = y(), l = (t = {}) => p(
13
17
  "compileEmail",
14
- d,
18
+ T,
15
19
  (e, a) => {
16
20
  const o = { ...{
17
21
  minimize: !0,
@@ -32,9 +36,9 @@ const D = 1e4, d = 3e4, s = (n, l, u) => new Promise((T, m) => {
32
36
  forceAmp: !1,
33
37
  resetDataSavedFlag: !1,
34
38
  disableLineHeightsReplace: !0
35
- }, ...t }, c = {
36
- callback: (r, C, f, S, g) => {
37
- r ? a(r) : e({
39
+ }, ...t }, u = {
40
+ callback: (m, C, f, S, g) => {
41
+ m ? a(m) : e({
38
42
  html: C,
39
43
  ampHtml: f,
40
44
  ampErrors: v(S ?? []),
@@ -43,22 +47,22 @@ const D = 1e4, d = 3e4, s = (n, l, u) => new Promise((T, m) => {
43
47
  },
44
48
  ...o
45
49
  };
46
- window.StripoEditorApi.actionsApi.compileEmail(c);
50
+ window.StripoEditorApi.actionsApi.compileEmail(u);
47
51
  }
48
52
  );
49
53
  return {
50
54
  getCompiledEmail: l,
51
- getTemplateData: () => s(
55
+ getTemplateData: () => p(
52
56
  "getTemplateData",
53
- d,
57
+ T,
54
58
  (t) => {
55
- const e = ({ html: a, css: i, width: o, height: E, utmParams: c, syncModulesIds: r }) => t({
59
+ const e = ({ html: a, css: i, width: o, height: E, utmParams: u, syncModulesIds: m }) => t({
56
60
  html: a,
57
61
  css: i,
58
62
  width: o,
59
63
  height: E,
60
- utmParams: c,
61
- syncModulesIds: r
64
+ utmParams: u,
65
+ syncModulesIds: m
62
66
  });
63
67
  window.StripoEditorApi.actionsApi.getTemplateData(e);
64
68
  }
@@ -105,13 +109,13 @@ const D = 1e4, d = 3e4, s = (n, l, u) => new Promise((T, m) => {
105
109
  }),
106
110
  updateHtmlAndCss: (t, e) => {
107
111
  const { actionsApi: a } = window.StripoEditorApi;
108
- return s("updateHtmlAndCss", D, (i) => {
112
+ return p("updateHtmlAndCss", D, (i) => {
109
113
  a.updateHtmlAndCss(t, e, () => i());
110
114
  });
111
115
  },
112
- editorSave: () => s(
116
+ editorSave: () => p(
113
117
  "save",
114
- d,
118
+ T,
115
119
  (t) => {
116
120
  window.StripoEditorApi.actionsApi.save((e) => {
117
121
  if (e) {