@useinsider/guido 3.30.0-beta.23d415d → 3.30.0-beta.25ed52c

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 (35) hide show
  1. package/README.md +35 -0
  2. package/dist/@types/config/schemas.js +42 -37
  3. package/dist/components/Guido.vue.js +8 -8
  4. package/dist/components/Guido.vue2.js +129 -115
  5. package/dist/components/organisms/dynamic-content/DynamicContentAooRuleConfig.vue.js +34 -0
  6. package/dist/components/organisms/dynamic-content/DynamicContentAooRuleConfig.vue2.js +76 -0
  7. package/dist/components/organisms/dynamic-content/DynamicContentCustomFormat.vue.js +21 -0
  8. package/dist/components/organisms/dynamic-content/DynamicContentCustomFormat.vue2.js +33 -0
  9. package/dist/components/organisms/dynamic-content/DynamicContentPicker.vue.js +42 -0
  10. package/dist/components/organisms/dynamic-content/DynamicContentPicker.vue2.js +216 -0
  11. package/dist/composables/useDynamicContentFormat.js +10 -0
  12. package/dist/composables/useDynamicContentPicker.js +36 -0
  13. package/dist/composables/useInfoBoxPosition.js +16 -0
  14. package/dist/config/migrator/itemsBlockMigrator.js +164 -161
  15. package/dist/enums/dynamic-content.js +180 -2
  16. package/dist/guido.css +1 -1
  17. package/dist/package.json.js +2 -2
  18. package/dist/src/@types/config/schemas.d.ts +12 -0
  19. package/dist/src/@types/generic.d.ts +1 -0
  20. package/dist/src/components/organisms/dynamic-content/DynamicContentAooRuleConfig.vue.d.ts +48 -0
  21. package/dist/src/components/organisms/dynamic-content/DynamicContentCustomFormat.vue.d.ts +44 -0
  22. package/dist/src/components/organisms/dynamic-content/DynamicContentPicker.vue.d.ts +67 -0
  23. package/dist/src/components/wrappers/WpDrawer.vue.d.ts +1 -1
  24. package/dist/src/composables/useConfig.d.ts +4 -0
  25. package/dist/src/composables/useDynamicContentFormat.d.ts +5 -0
  26. package/dist/src/composables/useDynamicContentPicker.d.ts +35 -0
  27. package/dist/src/composables/useInfoBoxPosition.d.ts +24 -0
  28. package/dist/src/enums/dynamic-content.d.ts +21 -0
  29. package/dist/src/stores/config.d.ts +42 -0
  30. package/dist/src/utils/dynamicContentPicker.d.ts +43 -0
  31. package/dist/src/utils/genericUtil.d.ts +1 -1
  32. package/dist/utils/dynamicContentPicker.js +88 -0
  33. package/dist/utils/genericUtil.js +21 -21
  34. package/dist/utils/pairProductVariables.js +98 -108
  35. package/package.json +1 -1
@@ -1,83 +1,85 @@
1
- import { defineComponent as Se, defineAsyncComponent as a, ref as W, computed as l, watch as $, onMounted as he, onUnmounted as Ee } from "vue";
2
- import { useCortexBlueprintBridge as Ce } from "../composables/useCortexBlueprintBridge.js";
3
- import { useEditorLock as De } from "../composables/useEditorLock.js";
4
- import { startEditorOpenMetrics as ke } from "../composables/useEditorOpenMetrics.js";
5
- import { provideGuidoActions as Te } from "../composables/useGuidoActions.js";
6
- import { useGuidoStateBridge as we } from "../composables/useGuidoStateBridge.js";
7
- import { usePartner as Fe } from "../composables/usePartner.js";
8
- import { useSaveValidationRollout as Me } from "../composables/useSaveValidationRollout.js";
9
- import { useStripo as Le } from "../composables/useStripo.js";
10
- import { useTimerClone as Ie } from "../composables/useTimerClone.js";
11
- import { useToaster as Re } from "../composables/useToaster.js";
12
- import { useTranslations as Oe } from "../composables/useTranslations.js";
13
- import { migrate as Ue } from "../config/migrator/index.js";
14
- import { ModuleFolderDefaults as G } from "../enums/defaults.js";
15
- import { RIBBON_SELECTOR as Ae } from "../enums/onboarding.js";
16
- import { ToasterTypeOptions as Ne } from "../enums/toaster.js";
17
- import { useRecommendationExtensionStore as z, disposeStrategyPageReturnListeners as Pe } from "../extensions/Blocks/Recommendation/store/recommendation.js";
18
- import { disposeUnsubscribeListeners as _e } from "../extensions/Blocks/Unsubscribe/block.js";
19
- import { disposeDisplayConditionRequest as xe } from "../extensions/DisplayConditions/bridge.js";
20
- import Be from "./organisms/AutoSaveController.vue.js";
21
- import He from "./organisms/base/AuthErrorModal.vue.js";
22
- import Ve from "./organisms/base/Toaster.vue.js";
23
- import We from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
24
- import $e from "./organisms/header/HeaderWrapper.vue.js";
25
- import Ge from "./organisms/LoadingWrapper.vue.js";
26
- import ze from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
27
- import qe from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
28
- import Ke from "./organisms/validation/ValidationErrorDrawer.vue.js";
29
- import { useStripoApi as je } from "../services/stripoApi.js";
30
- import { useConfigStore as Je } from "../stores/config.js";
31
- import { useDynamicContentStore as Qe } from "../stores/dynamic-content.js";
32
- import { useEditorStore as C } from "../stores/editor.js";
33
- import { useModuleDynamicContentStore as q } from "../stores/module-dynamic-content.js";
34
- import { useOnboardingStore as Xe } from "../stores/onboarding.js";
35
- import { usePreviewStore as Ye } from "../stores/preview.js";
36
- import { useSaveValidationStore as Ze } from "../stores/save-validation.js";
37
- import { useTemplateStore as et } from "../stores/template.js";
38
- import { useUnsubscribeStore as tt } from "../stores/unsubscribe.js";
39
- import { disposeLinkTokenPaste as ot } from "../utils/linkTokenPaste.js";
40
- import { readTrackFloor as K } from "../utils/linkTrackingIds.js";
41
- const $t = /* @__PURE__ */ Se({
1
+ import { defineComponent as we, defineAsyncComponent as a, ref as G, computed as p, watch as z, onMounted as Fe, onUnmounted as Me } from "vue";
2
+ import { useCortexBlueprintBridge as Ie } from "../composables/useCortexBlueprintBridge.js";
3
+ import { useDynamicContentPicker as Le } from "../composables/useDynamicContentPicker.js";
4
+ import { useEditorLock as Re } from "../composables/useEditorLock.js";
5
+ import { startEditorOpenMetrics as Oe } from "../composables/useEditorOpenMetrics.js";
6
+ import { provideGuidoActions as Pe } from "../composables/useGuidoActions.js";
7
+ import { useGuidoStateBridge as Ue } from "../composables/useGuidoStateBridge.js";
8
+ import { usePartner as Ae } from "../composables/usePartner.js";
9
+ import { useSaveValidationRollout as Ne } from "../composables/useSaveValidationRollout.js";
10
+ import { useStripo as _e } from "../composables/useStripo.js";
11
+ import { useTimerClone as He } from "../composables/useTimerClone.js";
12
+ import { useToaster as xe } from "../composables/useToaster.js";
13
+ import { useTranslations as Be } from "../composables/useTranslations.js";
14
+ import { migrate as Ve } from "../config/migrator/index.js";
15
+ import { ModuleFolderDefaults as q } from "../enums/defaults.js";
16
+ import { RIBBON_SELECTOR as We } from "../enums/onboarding.js";
17
+ import { ToasterTypeOptions as $e } from "../enums/toaster.js";
18
+ import { useRecommendationExtensionStore as K, disposeStrategyPageReturnListeners as Ge } from "../extensions/Blocks/Recommendation/store/recommendation.js";
19
+ import { disposeUnsubscribeListeners as ze } from "../extensions/Blocks/Unsubscribe/block.js";
20
+ import { disposeDisplayConditionRequest as qe } from "../extensions/DisplayConditions/bridge.js";
21
+ import Ke from "./organisms/AutoSaveController.vue.js";
22
+ import je from "./organisms/base/AuthErrorModal.vue.js";
23
+ import Je from "./organisms/base/Toaster.vue.js";
24
+ import Qe from "./organisms/dynamic-content/DynamicContentPicker.vue.js";
25
+ import Xe from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
26
+ import Ye from "./organisms/header/HeaderWrapper.vue.js";
27
+ import Ze from "./organisms/LoadingWrapper.vue.js";
28
+ import et from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
29
+ import tt from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
30
+ import ot from "./organisms/validation/ValidationErrorDrawer.vue.js";
31
+ import { useStripoApi as nt } from "../services/stripoApi.js";
32
+ import { useConfigStore as rt } from "../stores/config.js";
33
+ import { useDynamicContentStore as it } from "../stores/dynamic-content.js";
34
+ import { useEditorStore as D } from "../stores/editor.js";
35
+ import { useModuleDynamicContentStore as j } from "../stores/module-dynamic-content.js";
36
+ import { useOnboardingStore as st } from "../stores/onboarding.js";
37
+ import { usePreviewStore as at } from "../stores/preview.js";
38
+ import { useSaveValidationStore as ct } from "../stores/save-validation.js";
39
+ import { useTemplateStore as dt } from "../stores/template.js";
40
+ import { useUnsubscribeStore as mt } from "../stores/unsubscribe.js";
41
+ import { disposeLinkTokenPaste as lt } from "../utils/linkTokenPaste.js";
42
+ import { readTrackFloor as J } from "../utils/linkTrackingIds.js";
43
+ const eo = /* @__PURE__ */ we({
42
44
  __name: "Guido",
43
45
  props: {
44
46
  config: null,
45
47
  ready: { type: Boolean, default: !0 }
46
48
  },
47
49
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
48
- setup(j, { expose: J, emit: i }) {
49
- const c = j, r = ke(), Q = a(
50
+ setup(Q, { expose: X, emit: s }) {
51
+ const c = Q, r = Oe(), Y = a(
50
52
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
51
- ), X = a(
53
+ ), Z = a(
52
54
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
53
- ), Y = a(
55
+ ), ee = a(
54
56
  () => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
55
- ), Z = a(
57
+ ), te = a(
56
58
  () => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
57
- ), ee = a(
59
+ ), oe = a(
58
60
  () => import("./organisms/display-conditions/DisplayConditionsHost.vue.js")
59
- ), D = W(), te = a(
61
+ ), T = G(), ne = a(
60
62
  () => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
61
- ), oe = a(
63
+ ), re = a(
62
64
  () => import("./organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.js")
63
- ), ne = a(
65
+ ), ie = a(
64
66
  () => import("./organisms/dynamic-content/AmbiguousDynamicContentModal.vue.js")
65
- ), y = W(), g = Qe(), k = tt(), re = q(), o = Je();
67
+ ), y = G(), g = it(), w = mt(), se = j(), o = rt();
66
68
  c.ready && o.init(c.config);
67
- const d = C(), ie = Ye(), p = l(() => d.hasChanges), { isTestPartner: se } = Fe(), { isEnabled: ae, loadRollout: T } = Me(), { showToaster: w } = Re(), F = Oe(), M = () => {
69
+ const d = D(), ae = at(), u = p(() => d.hasChanges), { isTestPartner: ce } = Ae(), { isEnabled: de, loadRollout: F } = Ne(), { showToaster: M } = xe(), I = Be(), L = () => {
68
70
  var t;
69
71
  if (d.isVersionHistoryOpen) {
70
- console.debug("guido:save:silent:blocked", { isVersionHistoryOpen: !0 }), w({
71
- type: Ne.Warning,
72
- message: F("email-editor.save-blocked-outside-editor")
72
+ console.debug("guido:save:silent:blocked", { isVersionHistoryOpen: !0 }), M({
73
+ type: $e.Warning,
74
+ message: I("email-editor.save-blocked-outside-editor")
73
75
  });
74
76
  return;
75
77
  }
76
- return (t = D.value) == null ? void 0 : t.saveSilent();
77
- }, L = (t) => {
78
+ return (t = T.value) == null ? void 0 : t.saveSilent();
79
+ }, R = (t) => {
78
80
  d.loadingStatus = t;
79
81
  };
80
- Ce(), we();
82
+ Ie(), Ue();
81
83
  const b = () => {
82
84
  var t, e;
83
85
  return {
@@ -85,52 +87,64 @@ const $t = /* @__PURE__ */ Se({
85
87
  userId: o.userId,
86
88
  username: o.username,
87
89
  partnerName: o.partnerName,
88
- savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || G.SAVED_MODULES,
89
- defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || G.DEFAULT_MODULES
90
+ savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || q.SAVED_MODULES,
91
+ defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || q.DEFAULT_MODULES
90
92
  };
91
- }, { initPlugin: I, preloadRuntime: R } = Le(r), { runExclusive: O, beginMount: U, isCurrentMount: v } = De();
93
+ }, { initPlugin: O, preloadRuntime: P } = _e(r), { runExclusive: U, beginMount: A, isCurrentMount: v } = Re();
92
94
  let f = 0;
93
- const { getDefaultTemplate: A } = je(), { cloneTimersOnSave: N, hasTimerBlocks: P } = Ie(), ce = l(() => {
95
+ const { getDefaultTemplate: N } = nt(), { cloneTimersOnSave: _, hasTimerBlocks: H } = He(), me = p(() => {
94
96
  var t;
95
97
  return !((t = o.ui) != null && t.showHeader);
96
- }), de = l(() => o.isFeatureEnabled("reusableRecommendationStrategy")), me = l(() => o.externalDisplayConditions), le = l(
98
+ }), le = p(() => o.isFeatureEnabled("reusableRecommendationStrategy")), pe = p(() => o.externalDisplayConditions), ue = p(
97
99
  () => o.isFeatureEnabled("legacyUnsubscribeConversion")
98
- ), ue = l(
99
- () => !!z().recommendationConfigs.strategyId
100
+ ), fe = p(
101
+ () => !!K().recommendationConfigs.strategyId
100
102
  );
101
- Te({
103
+ Pe({
102
104
  onBack: () => {
103
- console.debug("guido:back"), i("back");
105
+ console.debug("guido:back"), s("back");
104
106
  },
105
107
  onSaveStart: () => {
106
- console.debug("guido:save:start"), i("save:start");
108
+ console.debug("guido:save:start"), s("save:start");
107
109
  },
108
110
  onSaveComplete: (t) => {
109
111
  const e = { ...t, metadata: b() };
110
- console.debug("guido:save:complete", e), i("save:complete", e);
112
+ console.debug("guido:save:complete", e), s("save:complete", e);
111
113
  },
112
114
  onTestEmailClick: () => {
113
- console.debug("guido:test-email:click"), i("test-email:click");
115
+ console.debug("guido:test-email:click"), s("test-email:click");
114
116
  }
115
117
  });
116
- const _ = (t) => {
118
+ const S = (t) => {
117
119
  console.debug("dynamic-content:close", t), g.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
118
- }, x = () => {
120
+ }, E = () => {
119
121
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
120
122
  };
121
- $(() => p.value, () => {
122
- i("on-change", p.value);
123
+ z(() => u.value, () => {
124
+ s("on-change", u.value);
123
125
  });
124
- const S = (t) => {
125
- const e = t, { attribute: s, position: u } = e.detail;
126
- console.debug("dynamic-content:open", e.detail), i("dynamic-content:open", s, u);
126
+ const {
127
+ isPickerEnabled: x,
128
+ picker: ye,
129
+ pickerOptions: ge,
130
+ pickerAooScanContent: be,
131
+ openPicker: B,
132
+ pickerSaveHandler: ve,
133
+ pickerCloseHandler: Se
134
+ } = Le({ onInsert: S, onClose: E }), h = (t) => {
135
+ const e = t, { attribute: i, position: l } = e.detail;
136
+ if (console.debug("dynamic-content:open", e.detail), x.value) {
137
+ B(i, l);
138
+ return;
139
+ }
140
+ s("dynamic-content:open", i, l);
127
141
  };
128
142
  let m = null;
129
- const h = () => {
143
+ const C = () => {
130
144
  var e;
131
- const t = document.querySelector(Ae);
145
+ const t = document.querySelector(We);
132
146
  (e = y.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
133
- }, E = async () => {
147
+ }, k = async () => {
134
148
  var t;
135
149
  r.mark("host_ready");
136
150
  try {
@@ -140,59 +154,59 @@ const $t = /* @__PURE__ */ Se({
140
154
  templateId: o.templateId,
141
155
  variationId: o.variationId
142
156
  });
143
- const e = o.template, s = (e == null ? void 0 : e.html) || "", u = (e == null ? void 0 : e.css) || "", B = (e == null ? void 0 : e.preselectedDynamicContent) || [];
144
- k.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
145
- const pe = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, H = o.isFeatureEnabled("linkTrackingIds"), fe = {
157
+ const e = o.template, i = (e == null ? void 0 : e.html) || "", l = (e == null ? void 0 : e.css) || "", V = (e == null ? void 0 : e.preselectedDynamicContent) || [];
158
+ w.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
159
+ const Ee = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, W = o.isFeatureEnabled("linkTrackingIds"), he = {
146
160
  partnerName: o.partnerName,
147
161
  campaignUrls: e == null ? void 0 : e.recommendationCampaignUrls,
148
162
  rrsEnabled: o.isFeatureEnabled("reusableRecommendationStrategy")
149
- }, ye = {
163
+ }, Ce = {
150
164
  itemsPriceFormatting: o.isFeatureEnabled("itemsPriceFormatting")
151
- }, V = (ve) => r.timed(
165
+ }, $ = (Te) => r.timed(
152
166
  "migration",
153
- () => Ue(ve, pe, fe, ye)
167
+ () => Ve(Te, Ee, he, Ce)
154
168
  );
155
169
  let n = {
156
- html: s && await V(s),
157
- css: u
170
+ html: i && await $(i),
171
+ css: l
158
172
  };
159
- n.html || (n = await r.timed("default_template", () => A()), n.html = await V(n.html));
160
- const ge = H ? K(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
161
- P(n.html) && (n.html = await r.timed("timer_clone", () => N(n.html))), H && (d.trackIdSessionFloor = Math.max(ge, K(n.html)));
162
- const be = {
163
- preselectedDynamicContentList: B,
173
+ n.html || (n = await r.timed("default_template", () => N()), n.html = await $(n.html));
174
+ const ke = W ? J(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
175
+ H(n.html) && (n.html = await r.timed("timer_clone", () => _(n.html))), W && (d.trackIdSessionFloor = Math.max(ke, J(n.html)));
176
+ const De = {
177
+ preselectedDynamicContentList: V,
164
178
  onReady: () => {
165
- console.debug("guido:ready"), i("ready");
179
+ console.debug("guido:ready"), s("ready");
166
180
  }
167
181
  };
168
- f = U(), await I(n, b(), be, n.html !== s), g.selectedDynamicContentList = B;
182
+ f = A(), await O(n, b(), De, n.html !== i), g.selectedDynamicContentList = V;
169
183
  } catch (e) {
170
184
  console.error("Failed to initialize Stripo editor:", e), r.markFailed();
171
185
  }
172
186
  };
173
- return he(async () => {
187
+ return Fe(async () => {
174
188
  var e;
175
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), z().$reset(), C().$reset(), et().$reset(), Ze().$reset(), q().$reset(), Xe().resetOnboarding("recommendationLegacyStrategyOnboarding"), T(), h();
189
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), K().$reset(), D().$reset(), dt().$reset(), ct().$reset(), j().$reset(), st().resetOnboarding("recommendationLegacyStrategyOnboarding"), F(), C();
176
190
  const t = (e = y.value) == null ? void 0 : e.parentElement;
177
- if (t && (m = new ResizeObserver(h), m.observe(t)), R(), c.ready)
178
- await E();
191
+ if (t && (m = new ResizeObserver(C), m.observe(t)), P(), c.ready)
192
+ await k();
179
193
  else {
180
- const s = $(() => c.ready, (u) => {
181
- u && (s(), E());
194
+ const i = z(() => c.ready, (l) => {
195
+ l && (i(), k());
182
196
  });
183
197
  }
184
- document.addEventListener("dynamic-content:open", S);
185
- }), Ee(() => {
186
- if (_e(), Pe(), r.dispose(), m == null || m.disconnect(), document.removeEventListener("dynamic-content:open", S), v(f)) {
187
- xe(), ot();
198
+ document.addEventListener("dynamic-content:open", h);
199
+ }), Me(() => {
200
+ if (ze(), Ge(), r.dispose(), m == null || m.disconnect(), document.removeEventListener("dynamic-content:open", h), v(f)) {
201
+ qe(), lt();
188
202
  try {
189
- const t = C();
203
+ const t = D();
190
204
  t.isStripoInitialized = !1, t.isAccessibilityTestingOpen = !1, t.imagesHidden = !1, t.colorVisionDeficiency = "";
191
205
  } catch (t) {
192
206
  console.debug("Failed to close the editor readiness gate on unmount", t);
193
207
  }
194
208
  }
195
- O(async () => {
209
+ U(async () => {
196
210
  if (v(f))
197
211
  try {
198
212
  window.UIEditor.removeEditor();
@@ -200,17 +214,17 @@ const $t = /* @__PURE__ */ Se({
200
214
  console.debug("Failed to remove Stripo editor: No editor found");
201
215
  }
202
216
  }), o.reset();
203
- }), J({
217
+ }), X({
204
218
  dynamicContent: {
205
- insert: _,
206
- close: x
219
+ insert: S,
220
+ close: E
207
221
  },
208
- hasChanges: p,
209
- saveSilent: M,
210
- setLoading: L
211
- }), { __sfc: !0, openMetrics: r, PreviewContainer: Q, OnboardingWrapper: X, AssignStrategyDrawer: Y, RemoveStrategyModal: Z, DisplayConditionsHost: ee, autoSaveControllerRef: D, LegacyStrategyUpdatedModal: te, LegacyUnsubscribeConvertedModal: oe, AmbiguousDynamicContentModal: ne, wrapperRef: y, dynamicContentStore: g, unsubscribeStore: k, moduleDynamicContentStore: re, props: c, configStore: o, editorStore: d, previewStore: ie, hasChanges: p, isTestPartner: se, isSaveValidationEnabled: ae, loadRollout: T, showToaster: w, trans: F, saveSilent: M, setLoading: L, emit: i, buildMetadata: b, initPlugin: I, preloadRuntime: R, runExclusive: O, beginMount: U, isCurrentMount: v, mountGeneration: f, getDefaultTemplate: A, cloneTimersOnSave: N, hasTimerBlocks: P, noHeader: ce, isRrsEnabled: de, isExternalDisplayConditionsEnabled: me, isLegacyUnsubscribeConversionEnabled: le, hasAssignedStrategy: ue, insertDynamicContent: _, closeDynamicContent: x, handleDynamicContentOpen: S, ribbonObserver: m, updateRibbonOffset: h, startEditor: E, AutoSaveController: Be, AuthErrorModal: He, Toaster: Ve, FilterSelectionDrawer: We, HeaderWrapper: $e, LoadingWrapper: Ge, SaveAsTemplateDrawer: ze, UnsubscribeWrapper: qe, ValidationErrorDrawer: Ke };
222
+ hasChanges: u,
223
+ saveSilent: L,
224
+ setLoading: R
225
+ }), { __sfc: !0, openMetrics: r, PreviewContainer: Y, OnboardingWrapper: Z, AssignStrategyDrawer: ee, RemoveStrategyModal: te, DisplayConditionsHost: oe, autoSaveControllerRef: T, LegacyStrategyUpdatedModal: ne, LegacyUnsubscribeConvertedModal: re, AmbiguousDynamicContentModal: ie, wrapperRef: y, dynamicContentStore: g, unsubscribeStore: w, moduleDynamicContentStore: se, props: c, configStore: o, editorStore: d, previewStore: ae, hasChanges: u, isTestPartner: ce, isSaveValidationEnabled: de, loadRollout: F, showToaster: M, trans: I, saveSilent: L, setLoading: R, emit: s, buildMetadata: b, initPlugin: O, preloadRuntime: P, runExclusive: U, beginMount: A, isCurrentMount: v, mountGeneration: f, getDefaultTemplate: N, cloneTimersOnSave: _, hasTimerBlocks: H, noHeader: me, isRrsEnabled: le, isExternalDisplayConditionsEnabled: pe, isLegacyUnsubscribeConversionEnabled: ue, hasAssignedStrategy: fe, insertDynamicContent: S, closeDynamicContent: E, isPickerEnabled: x, picker: ye, pickerOptions: ge, pickerAooScanContent: be, openPicker: B, pickerSaveHandler: ve, pickerCloseHandler: Se, handleDynamicContentOpen: h, ribbonObserver: m, updateRibbonOffset: C, startEditor: k, AutoSaveController: Ke, AuthErrorModal: je, Toaster: Je, DynamicContentPicker: Qe, FilterSelectionDrawer: Xe, HeaderWrapper: Ye, LoadingWrapper: Ze, SaveAsTemplateDrawer: et, UnsubscribeWrapper: tt, ValidationErrorDrawer: ot };
212
226
  }
213
227
  });
214
228
  export {
215
- $t as default
229
+ eo as default
216
230
  };
@@ -0,0 +1,34 @@
1
+ import l from "./DynamicContentAooRuleConfig.vue2.js";
2
+ /* empty css */
3
+ import n from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var c = function() {
5
+ var s = this, o = s._self._c, e = s._self._setupProxy;
6
+ return o("div", [o(e.InSelect, { staticClass: "aoo-config-select", attrs: { id: "aoo-rule-select", "dynamic-position": "", "search-status": "", "floating-strategy": "fixed", "button-status": !1, "label-text": e.trans(`${e.ARRAY_OF_OBJECTS_LABEL_BASE}-rule-label`), options: e.ruleOptions, "placeholder-text": e.trans(`${e.ARRAY_OF_OBJECTS_LABEL_BASE}-rule-placeholder`), state: e.selectState(e.selectedRule), "state-message": e.selectStateMessage(e.selectedRule, `${e.ARRAY_OF_OBJECTS_LABEL_BASE}-rule-validation`), value: e.selectedRule }, on: { "hook:beforeDestroy": function(t) {
7
+ return e.emit("openList", "aoo-rule", !1);
8
+ }, openList: function(t) {
9
+ return e.emit("openList", "aoo-rule", t);
10
+ }, select: e.selectRuleHandler } }), e.activeRule ? o(e.InOnPageMessage, { staticClass: "mt-3", attrs: { size: "small", type: "default", text: e.infoText }, scopedSlots: s._u([{ key: "extraMessage", fn: function() {
11
+ return [o("ul", { staticClass: "ml-6 pl-3 f-s-1 f-w-400 mt-0 mb-0" }, s._l(e.filtersDescription, function(t, a) {
12
+ return o("li", { key: a, staticClass: "l-h-1" }, [o("span", { staticClass: "t-c-55" }, [s._v(s._s(e.getFilterText(t)))])]);
13
+ }), 0)];
14
+ }, proxy: !0 }], null, !1, 2503373205) }) : s._e(), e.activeRule ? o(e.InSelect, { staticClass: "aoo-config-select mt-3", attrs: { id: "aoo-object-select", "dynamic-position": "", "floating-strategy": "fixed", "button-status": !1, "label-text": e.trans(`${e.ARRAY_OF_OBJECTS_LABEL_BASE}-object-label`), options: e.objectOptions, "placeholder-text": e.trans(`${e.ARRAY_OF_OBJECTS_LABEL_BASE}-object-placeholder`), state: e.selectState(e.selectedObject), "state-message": e.selectStateMessage(e.selectedObject, `${e.ARRAY_OF_OBJECTS_LABEL_BASE}-object-validation`), value: e.selectedObject }, on: { "hook:beforeDestroy": function(t) {
15
+ return e.emit("openList", "aoo-object", !1);
16
+ }, openList: function(t) {
17
+ return e.emit("openList", "aoo-object", t);
18
+ }, select: e.selectObjectHandler } }) : s._e(), e.selectedObject.length ? o(e.InSelect, { staticClass: "aoo-config-select mt-3", attrs: { id: "aoo-object-key-select", "dynamic-position": "", "search-status": "", "floating-strategy": "fixed", "button-status": !1, "label-text": e.trans(`${e.ARRAY_OF_OBJECTS_LABEL_BASE}-object-key-label`), options: e.keyOptions, "placeholder-text": e.trans(`${e.ARRAY_OF_OBJECTS_LABEL_BASE}-object-key-placeholder`), state: e.selectState(e.selectedKey), "state-message": e.selectStateMessage(e.selectedKey, `${e.ARRAY_OF_OBJECTS_LABEL_BASE}-object-key-validation`), value: e.selectedKey }, on: { "hook:beforeDestroy": function(t) {
19
+ return e.emit("openList", "aoo-object-key", !1);
20
+ }, openList: function(t) {
21
+ return e.emit("openList", "aoo-object-key", t);
22
+ }, select: e.selectKeyHandler } }) : s._e()], 1);
23
+ }, i = [], r = /* @__PURE__ */ n(
24
+ l,
25
+ c,
26
+ i,
27
+ !1,
28
+ null,
29
+ "6073170a"
30
+ );
31
+ const d = r.exports;
32
+ export {
33
+ d as default
34
+ };
@@ -0,0 +1,76 @@
1
+ import { defineComponent as V, ref as _, computed as r, watch as k } from "vue";
2
+ import { useTranslations as K } from "../../../composables/useTranslations.js";
3
+ import { ARRAY_OF_OBJECTS_LABEL_BASE as E, AOO_INFO_TEXT_KEY as h, AOO_INFO_TEXT_TEMPLATE as M } from "../../../enums/dynamic-content.js";
4
+ import { applyAooDisabledState as X } from "../../../utils/dynamicContentPicker.js";
5
+ import { escapeHtml as O } from "../../../utils/htmlEscape.js";
6
+ import { InSelect as j, InOnPageMessage as N } from "@useinsider/design-system-vue";
7
+ const Q = /* @__PURE__ */ V({
8
+ __name: "DynamicContentAooRuleConfig",
9
+ props: {
10
+ categories: { default: () => [] },
11
+ usedPatterns: { default: () => [] },
12
+ initialValue: { default: null },
13
+ validationActive: { type: Boolean, default: !1 }
14
+ },
15
+ emits: ["openList", "select", "clear"],
16
+ setup(x, { emit: f }) {
17
+ const a = x, T = { desc: "descending", asc: "ascending" }, m = K(), p = _([]), c = _([]), s = _([]), y = r(() => X(
18
+ a.categories,
19
+ a.usedPatterns,
20
+ m(`${E}-disabled-tooltip`)
21
+ )), o = r(() => p.value[0] || null), A = r(() => {
22
+ const e = m(h);
23
+ return !e || e === h ? M : e;
24
+ }), R = r(() => {
25
+ var v;
26
+ const { key: e = "", order: t = "", limit: n = "", operator: l = "" } = ((v = o.value) == null ? void 0 : v.rules) || {}, i = {
27
+ key: O(String(e)),
28
+ order: T[String(t)] || "",
29
+ limit: O(String(n)),
30
+ operator: O(String(l))
31
+ };
32
+ return Object.entries(i).reduce((d, [g, P]) => d.replace(`{${g}}`, P), A.value);
33
+ }), D = r(() => {
34
+ var e;
35
+ return ((e = o.value) == null ? void 0 : e.filtersDescription) || [];
36
+ }), F = r(() => {
37
+ var e;
38
+ return (((e = o.value) == null ? void 0 : e.select_items) || []).map((t) => ({ text: t.text, value: t.value }));
39
+ }), $ = r(() => {
40
+ var n, l;
41
+ const e = (n = c.value[0]) == null ? void 0 : n.value, t = (((l = o.value) == null ? void 0 : l.select_items) || []).find((i) => i.value === e);
42
+ return (t == null ? void 0 : t.children) || [];
43
+ }), b = (e) => a.validationActive && !e.length ? "error" : "default", B = (e, t) => a.validationActive && !e.length ? m(t) : "", C = (e) => {
44
+ const { parameter: t = "", operator: n = "", value: l = "" } = e || {};
45
+ return `${t} ${n} ${l}`;
46
+ }, u = () => {
47
+ const [e] = s.value;
48
+ e && o.value ? f("select", { leaf: e, rule: o.value }) : f("clear");
49
+ }, H = (e) => {
50
+ p.value = [e], c.value = [], s.value = [], u();
51
+ }, I = (e) => {
52
+ c.value = [e], s.value = [], u();
53
+ }, L = (e) => {
54
+ s.value = [e], u();
55
+ }, S = (e) => {
56
+ a.categories.some((t) => (t.children || []).some((n) => {
57
+ var v;
58
+ const l = (n.select_items || []).find(
59
+ (d) => (d.children || []).some((g) => g.value === e)
60
+ ), i = (v = l == null ? void 0 : l.children) == null ? void 0 : v.find((d) => d.value === e);
61
+ return !l || !i ? !1 : (p.value = [n], c.value = [{ text: l.text, value: l.value }], s.value = [i], u(), !0);
62
+ }));
63
+ };
64
+ return k(
65
+ () => [a.initialValue, a.categories],
66
+ () => {
67
+ var e;
68
+ (e = a.initialValue) != null && e.value && a.categories.length && !s.value.length && S(a.initialValue.value);
69
+ },
70
+ { immediate: !0 }
71
+ ), { __sfc: !0, ORDER_TEXTS: T, props: a, emit: f, trans: m, selectedRule: p, selectedObject: c, selectedKey: s, ruleOptions: y, activeRule: o, infoTemplate: A, infoText: R, filtersDescription: D, objectOptions: F, keyOptions: $, selectState: b, selectStateMessage: B, getFilterText: C, emitSelection: u, selectRuleHandler: H, selectObjectHandler: I, selectKeyHandler: L, restoreFromToken: S, ARRAY_OF_OBJECTS_LABEL_BASE: E, InOnPageMessage: N, InSelect: j };
72
+ }
73
+ });
74
+ export {
75
+ Q as default
76
+ };
@@ -0,0 +1,21 @@
1
+ import r from "./DynamicContentCustomFormat.vue2.js";
2
+ import a from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var n = function() {
4
+ var e = this, o = e._self._c, t = e._self._setupProxy;
5
+ return o("div", [o(t.InCheckBoxV2, { attrs: { id: `dynamic-content-custom-format-checkbox-${t.props.formatType}`, checked: t.isCustomFormatEnabled, "label-text": t.props.checkboxLabelText }, on: { click: t.handleCheckboxClick } }), t.isCustomFormatEnabled ? o(t.InSelect, { staticClass: "mt-3", attrs: { id: `dynamic-content-custom-format-input-${t.props.formatType}`, "dynamic-position": "", "search-status": "", "floating-strategy": "fixed", "button-status": !1, "label-text": t.props.selectLabelText, options: t.props.formatOptions, "placeholder-text": t.props.selectPlaceholderText, state: t.errorMessage ? "error" : "default", "state-message": t.errorMessage, value: t.customFormatInput }, on: { "hook:beforeDestroy": function(s) {
6
+ return t.emit("openList", "custom-format", !1);
7
+ }, openList: function(s) {
8
+ return t.emit("openList", "custom-format", s);
9
+ }, select: t.handleSelect } }) : e._e()], 1);
10
+ }, c = [], l = /* @__PURE__ */ a(
11
+ r,
12
+ n,
13
+ c,
14
+ !1,
15
+ null,
16
+ null
17
+ );
18
+ const u = l.exports;
19
+ export {
20
+ u as default
21
+ };
@@ -0,0 +1,33 @@
1
+ import { defineComponent as x, ref as n, computed as b } from "vue";
2
+ import { useTranslations as h } from "../../../composables/useTranslations.js";
3
+ import { getIndefiniteArticle as T } from "../../../utils/dynamicContentPicker.js";
4
+ import { InSelect as C, InCheckBoxV2 as S } from "@useinsider/design-system-vue";
5
+ const y = /* @__PURE__ */ x({
6
+ __name: "DynamicContentCustomFormat",
7
+ props: {
8
+ checkboxLabelText: null,
9
+ selectLabelText: null,
10
+ selectPlaceholderText: null,
11
+ formatType: null,
12
+ formatOptions: { default: () => [] }
13
+ },
14
+ emits: ["openList", "select", "updateStatus"],
15
+ setup(f, { expose: m, emit: s }) {
16
+ const o = f, u = h(), t = n([]), l = n(!1), a = n(!1), p = b(() => !a.value || !l.value || t.value.length ? "" : u("validations.select-a-field-to-continue", {
17
+ article: T(o.selectLabelText),
18
+ field: o.selectLabelText
19
+ })), d = (e) => {
20
+ s("updateStatus", e), l.value = e, e || (t.value = [], a.value = !1);
21
+ }, v = (e) => {
22
+ t.value = [e], s("select", { key: o.formatType, value: e.value });
23
+ }, r = () => (a.value = !0, !l.value || t.value.length > 0), c = () => {
24
+ a.value = !1, t.value = [], l.value = !1;
25
+ }, i = (e) => {
26
+ t.value = [e], l.value = !0, s("updateStatus", !0);
27
+ };
28
+ return m({ resetState: c, setFormat: i, validate: r }), { __sfc: !0, props: o, emit: s, trans: u, customFormatInput: t, isCustomFormatEnabled: l, isSubmitted: a, errorMessage: p, handleCheckboxClick: d, handleSelect: v, validate: r, resetState: c, setFormat: i, InCheckBoxV2: S, InSelect: C };
29
+ }
30
+ });
31
+ export {
32
+ y as default
33
+ };
@@ -0,0 +1,42 @@
1
+ import o from "./DynamicContentPicker.vue2.js";
2
+ /* empty css */
3
+ import s from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var l = function() {
5
+ var a = this, n = a._self._c, t = a._self._setupProxy;
6
+ return t.props.visible ? n("div", { ref: "layerRef", staticClass: "dynamic-content-layer", attrs: { tabindex: "-1" }, on: { click: function(e) {
7
+ return e.target !== e.currentTarget ? null : t.layerClickHandler.apply(null, arguments);
8
+ }, mousedown: t.layerMousedownHandler, touchmove: function(e) {
9
+ if (e.target !== e.currentTarget) return null;
10
+ e.preventDefault();
11
+ }, wheel: function(e) {
12
+ if (e.target !== e.currentTarget) return null;
13
+ e.preventDefault();
14
+ } } }, [n("div", { ref: "boxRef", staticClass: "dynamic-content-layer__box", class: { "dynamic-content-layer__box--scrollable": !t.isSettingsStep }, style: t.positionStyle, on: { "!click": function(e) {
15
+ return t.clickCaptureHandler.apply(null, arguments);
16
+ } } }, [n(t.InInfoBox, { staticClass: "dynamic-content-layer__card", attrs: { id: "dynamic-content-modal", "button-options": t.buttonOptions, "description-status": t.isSettingsStep, "description-text": t.descriptionText, "title-text": t.titleText }, on: { click: t.buttonClickHandler } }, [t.isSettingsStep ? n("div", { key: "settings-step", staticClass: "mt-3" }, [t.hasSelectedDynamicContent ? n(t.InBasicTextInput, { attrs: { id: "dynamic-content-fallback-input", "tooltip-status": "", "character-counter-status": !1, "label-text": t.trans("newsletter.email-subject-fall-back-label"), name: t.trans("newsletter.email-subject-fall-back-label"), "placeholder-text": t.trans("newsletter.email-subject-fall-back-placeholder"), "tooltip-text": t.trans("newsletter.email-subject-fall-back-tooltip") }, model: { value: t.state.dynamicContentFallbackInput, callback: function(e) {
17
+ a.$set(t.state, "dynamicContentFallbackInput", e);
18
+ }, expression: "state.dynamicContentFallbackInput" } }) : a._e()], 1) : n("div", { key: "attribute-step", staticClass: "mt-3" }, [n(t.InSelect, { staticClass: "dynamic-content-input", attrs: { "dynamic-position": "", "search-status": "", "floating-strategy": "fixed", "button-status": !1, "label-text": t.trans("dynamic-content.dynamic-contents-label"), options: t.formattedDynamicContentOptions, "placeholder-text": t.trans("dynamic-content.dynamic-contents-placeholder"), state: t.errors.dynamicContentInput ? "error" : "default", "state-message": t.errors.dynamicContentInput, value: t.state.dynamicContentInput }, on: { "hook:beforeDestroy": function(e) {
19
+ return t.openListHandler("attribute", !1);
20
+ }, openList: function(e) {
21
+ return t.openListHandler("attribute", e);
22
+ }, select: t.selectDynamicContentHandler } }), t.isAooSelected ? n(t.DynamicContentAooRuleConfig, { staticClass: "mt-3", attrs: { categories: t.props.aooOptions, "initial-value": t.props.initialData, "used-patterns": t.usedAooPatterns, "validation-active": !!t.errors.aooLeafInput }, on: { clear: t.clearAooLeafHandler, openList: t.openListHandler, select: t.selectAooLeafHandler } }) : a._e(), t.isLookupSelected ? n(t.InSelect, { staticClass: "dynamic-content-input mt-3", attrs: { id: "dynamic-content-lookup-column-input", "dynamic-position": "", "search-status": "", "floating-strategy": "fixed", "button-status": !1, "label-text": t.lookupBindingLabel, options: t.lookupColumnOptions, "placeholder-text": t.lookupColumnPlaceholder, state: t.errors.lookupColumnInput ? "error" : "default", "state-message": t.errors.lookupColumnInput, value: t.state.lookupColumnInput }, on: { "hook:beforeDestroy": function(e) {
23
+ return t.openListHandler("lookup-column", !1);
24
+ }, openList: function(e) {
25
+ return t.openListHandler("lookup-column", e);
26
+ }, select: t.selectLookupColumnHandler } }) : a._e(), t.hasCustomFormat ? n(t.DynamicContentCustomFormat, { ref: "customFormatRef", staticClass: "mt-3", attrs: { "checkbox-label-text": t.customFormatConfig.checkboxLabel, "format-options": t.customFormatConfig.options, "format-type": t.customFormatConfig.type, "select-label-text": t.customFormatConfig.selectLabel, "select-placeholder-text": t.customFormatConfig.selectPlaceholder }, on: { openList: t.openListHandler, select: function(e) {
27
+ t.state.customFormat = e;
28
+ }, updateStatus: function(e) {
29
+ t.state.isCustomFormatEnabled = e;
30
+ } } }) : a._e()], 1)])], 1)]) : a._e();
31
+ }, r = [], i = /* @__PURE__ */ s(
32
+ o,
33
+ l,
34
+ r,
35
+ !1,
36
+ null,
37
+ "687d286f"
38
+ );
39
+ const d = i.exports;
40
+ export {
41
+ d as default
42
+ };