@useinsider/guido 3.3.0-beta.c1e1d7e → 3.3.0-beta.ddabd14

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 (43) hide show
  1. package/dist/components/Guido.vue.js +1 -1
  2. package/dist/components/Guido.vue2.js +103 -89
  3. package/dist/components/organisms/extensions/recommendation/FilterItem.vue.js +9 -11
  4. package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +70 -35
  5. package/dist/components/organisms/header/MiddleSlot.vue.js +7 -7
  6. package/dist/composables/useCortexBlueprintBridge.js +66 -0
  7. package/dist/composables/useCustomInterfaceAppearance.js +18 -16
  8. package/dist/composables/useEmailTemplateApplier.js +41 -0
  9. package/dist/composables/useGuidoStateBridge.js +48 -0
  10. package/dist/composables/useHtmlValidator.js +41 -36
  11. package/dist/composables/useRecommendation.js +2 -2
  12. package/dist/composables/useStripo.js +56 -54
  13. package/dist/config/migrator/index.js +21 -10
  14. package/dist/config/migrator/radioButtonMigrator.js +73 -48
  15. package/dist/enums/extensions/recommendationBlock.js +101 -46
  16. package/dist/enums/unsubscribe.js +25 -24
  17. package/dist/extensions/Blocks/Checkbox/control.js +23 -23
  18. package/dist/extensions/Blocks/RadioButton/control.js +15 -15
  19. package/dist/extensions/Blocks/RadioButton/template.js +6 -6
  20. package/dist/extensions/Blocks/Recommendation/block.js +43 -36
  21. package/dist/extensions/Blocks/Recommendation/services/configService.js +33 -26
  22. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +35 -26
  23. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +25 -12
  24. package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +33 -0
  25. package/dist/guido.css +1 -1
  26. package/dist/services/unsubscribeApi.js +6 -6
  27. package/dist/src/composables/useCortexBlueprintBridge.d.ts +25 -0
  28. package/dist/src/composables/useEmailTemplateApplier.d.ts +21 -0
  29. package/dist/src/composables/useGuidoStateBridge.d.ts +22 -0
  30. package/dist/src/enums/extensions/recommendationBlock.d.ts +6 -1
  31. package/dist/src/enums/unsubscribe.d.ts +8 -3
  32. package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
  33. package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +11 -3
  34. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +7 -1
  35. package/dist/src/extensions/Blocks/Recommendation/utils/filterUtil.d.ts +2 -0
  36. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +21 -0
  37. package/dist/src/stores/guido-email-editor.d.ts +41 -0
  38. package/dist/static/styles/components/notification.css.js +74 -0
  39. package/dist/stores/guido-email-editor.js +20 -0
  40. package/dist/utils/templatePreparation.js +57 -50
  41. package/package.json +1 -1
  42. package/dist/composables/useStripoNotifications.js +0 -30
  43. package/dist/src/composables/useStripoNotifications.d.ts +0 -4
@@ -12,7 +12,7 @@ var t = function() {
12
12
  n,
13
13
  !1,
14
14
  null,
15
- "1a4e7084"
15
+ "fcccebf6"
16
16
  );
17
17
  const l = s.exports;
18
18
  export {
@@ -1,133 +1,147 @@
1
- import { defineComponent as J, defineAsyncComponent as I, ref as W, computed as B, watch as Q, onMounted as X, onUnmounted as Y } from "vue";
2
- import { provideGuidoActions as Z } from "../composables/useGuidoActions.js";
3
- import { usePartner as ee } from "../composables/usePartner.js";
4
- import { useStripo as oe } from "../composables/useStripo.js";
5
- import { useTimerClone as te } from "../composables/useTimerClone.js";
6
- import { migrate as H } from "../config/migrator/index.js";
7
- import { ModuleFolderDefaults as x } from "../enums/defaults.js";
8
- import { RIBBON_SELECTOR as ne } from "../enums/onboarding.js";
9
- import re from "./organisms/AutoSaveController.vue.js";
10
- import se from "./organisms/base/Toaster.vue.js";
11
- import ce from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
12
- import ae from "./organisms/header/HeaderWrapper.vue.js";
13
- import ie from "./organisms/LoadingWrapper.vue.js";
14
- import me from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
15
- import de from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
16
- import { useStripoApi as le } from "../services/stripoApi.js";
17
- import { useConfigStore as ue } from "../stores/config.js";
18
- import { useDynamicContentStore as pe } from "../stores/dynamic-content.js";
19
- import { useEditorStore as fe } from "../stores/editor.js";
20
- import { usePreviewStore as ve } from "../stores/preview.js";
21
- import { useUnsubscribeStore as ye } from "../stores/unsubscribe.js";
22
- const We = /* @__PURE__ */ J({
1
+ import { defineComponent as ee, defineAsyncComponent as G, ref as z, computed as q, watch as oe, onMounted as te, onUnmounted as ne } from "vue";
2
+ import { useCortexBlueprintBridge as se } from "../composables/useCortexBlueprintBridge.js";
3
+ import { provideGuidoActions as re } from "../composables/useGuidoActions.js";
4
+ import { useGuidoStateBridge as ce } from "../composables/useGuidoStateBridge.js";
5
+ import { usePartner as ae } from "../composables/usePartner.js";
6
+ import { useStripo as ie } from "../composables/useStripo.js";
7
+ import { useTimerClone as de } from "../composables/useTimerClone.js";
8
+ import { migrate as K } from "../config/migrator/index.js";
9
+ import { ModuleFolderDefaults as V } from "../enums/defaults.js";
10
+ import { RIBBON_SELECTOR as me } from "../enums/onboarding.js";
11
+ import le from "./organisms/AutoSaveController.vue.js";
12
+ import ue from "./organisms/base/Toaster.vue.js";
13
+ import pe from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
14
+ import fe from "./organisms/header/HeaderWrapper.vue.js";
15
+ import ve from "./organisms/LoadingWrapper.vue.js";
16
+ import be from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
17
+ import ge from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
18
+ import { useStripoApi as ye } from "../services/stripoApi.js";
19
+ import { useConfigStore as Se } from "../stores/config.js";
20
+ import { useDynamicContentStore as he } from "../stores/dynamic-content.js";
21
+ import { useEditorStore as we } from "../stores/editor.js";
22
+ import { usePreviewStore as Ee } from "../stores/preview.js";
23
+ import { useUnsubscribeStore as De } from "../stores/unsubscribe.js";
24
+ const je = /* @__PURE__ */ ee({
23
25
  __name: "Guido",
24
26
  props: {
25
27
  config: null
26
28
  },
27
29
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
28
- setup(G, { expose: z, emit: n }) {
29
- const g = G, q = I(
30
+ setup($, { expose: j, emit: r }) {
31
+ const D = $, J = G(
30
32
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
31
- ), K = I(
33
+ ), Q = G(
32
34
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
33
- ), w = W(), u = W(), p = pe(), E = ye(), i = ue();
34
- i.init(g.config);
35
- const f = fe(), V = ve(), m = B(() => f.hasChanges), { isTestPartner: $ } = ee(), D = () => {
35
+ ), C = z(), v = z(), b = he(), k = De(), m = Se();
36
+ m.init(D.config);
37
+ const g = we(), X = Ee(), f = q(() => g.hasChanges), { isTestPartner: Y } = ae(), T = () => {
36
38
  var e;
37
- return (e = w.value) == null ? void 0 : e.handleSave(!0);
39
+ return (e = C.value) == null ? void 0 : e.handleSave(!0);
38
40
  }, {
39
- templateId: v,
40
- userId: C,
41
- partnerName: T,
42
- username: k,
41
+ templateId: y,
42
+ userId: A,
43
+ partnerName: B,
44
+ username: F,
43
45
  template: o,
44
- editor: s
45
- } = i, d = (o == null ? void 0 : o.html) || "", F = (o == null ? void 0 : o.css) || "", y = (o == null ? void 0 : o.preselectedDynamicContent) || [], L = (s == null ? void 0 : s.savedModulesFolderName) || x.SAVED_MODULES, U = (s == null ? void 0 : s.defaultModulesFolderName) || x.DEFAULT_MODULES;
46
- f.templateId = v;
46
+ editor: c
47
+ } = m, l = (o == null ? void 0 : o.html) || "", L = (o == null ? void 0 : o.css) || "", S = (o == null ? void 0 : o.preselectedDynamicContent) || [], U = (c == null ? void 0 : c.savedModulesFolderName) || V.SAVED_MODULES, _ = (c == null ? void 0 : c.defaultModulesFolderName) || V.DEFAULT_MODULES;
48
+ g.templateId = y, se(), ce();
47
49
  const h = {
48
- emailId: v,
49
- userId: C,
50
- username: k,
51
- partnerName: T,
52
- savedModulesFolderName: L,
53
- defaultModulesFolderName: U
54
- }, _ = {
55
- preselectedDynamicContentList: y,
50
+ emailId: y,
51
+ userId: A,
52
+ username: F,
53
+ partnerName: B,
54
+ savedModulesFolderName: U,
55
+ defaultModulesFolderName: _
56
+ }, H = {
57
+ preselectedDynamicContentList: S,
56
58
  onReady: () => {
57
- console.debug("guido:ready"), n("ready");
59
+ console.debug("guido:ready"), r("ready");
58
60
  }
59
- }, { initPlugin: M } = oe(h, _), { getDefaultTemplate: O } = le(), { cloneTimersOnSave: P, hasTimerBlocks: A } = te(), j = B(() => {
61
+ }, { initPlugin: M } = ie(h, H), { getDefaultTemplate: O } = ye(), { cloneTimersOnSave: P, hasTimerBlocks: N } = de(), Z = q(() => {
60
62
  var e;
61
- return !((e = i.ui) != null && e.showHeader);
63
+ return !((e = m.ui) != null && e.showHeader);
62
64
  });
63
- Z({
65
+ re({
64
66
  onBack: () => {
65
- console.debug("guido:back"), n("back");
67
+ console.debug("guido:back"), r("back");
66
68
  },
67
69
  onSaveStart: () => {
68
- console.debug("guido:save:start"), n("save:start");
70
+ console.debug("guido:save:start"), r("save:start");
69
71
  },
70
72
  onSaveComplete: (e) => {
71
- const t = { ...e, metadata: h };
72
- console.debug("guido:save:complete", t), n("save:complete", t);
73
+ const t = { ...e, metadata: h }, a = (n) => ((n == null ? void 0 : n.match(/<td[^>]*radio-button-v2[^>]*>/gi)) ?? []).map((u) => {
74
+ var p;
75
+ const d = (((p = u.match(/class="([^"]*)"/)) == null ? void 0 : p[1]) ?? "").split(/\s+/).filter(Boolean);
76
+ return { classes: d, hasBlock: d.includes("radio-button-block"), tag: u };
77
+ });
78
+ console.debug("guido:save:complete", t), console.debug("guido:save:radio-tds", {
79
+ rawHtml: a(e.rawHtml),
80
+ compiledHtml: a(e.compiledHtml)
81
+ }), r("save:complete", t);
73
82
  },
74
83
  onTestEmailClick: () => {
75
- console.debug("guido:test-email:click"), n("test-email:click");
84
+ console.debug("guido:test-email:click"), r("test-email:click");
76
85
  }
77
86
  });
78
- const N = (e) => {
79
- console.debug("dynamic-content:close", e), p.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
80
- }, R = () => {
87
+ const R = (e) => {
88
+ console.debug("dynamic-content:close", e), b.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
89
+ }, I = () => {
81
90
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
82
91
  };
83
- Q(() => m.value, () => {
84
- n("on-change", m.value);
92
+ oe(() => f.value, () => {
93
+ r("on-change", f.value);
85
94
  });
86
- const S = (e) => {
87
- const t = e, { attribute: l, position: a } = t.detail;
88
- console.debug("dynamic-content:open", t.detail), n("dynamic-content:open", l, a);
95
+ const w = (e) => {
96
+ const t = e, { attribute: a, position: n } = t.detail;
97
+ console.debug("dynamic-content:open", t.detail), r("dynamic-content:open", a, n);
89
98
  };
90
- let c = null;
91
- const b = () => {
99
+ let i = null;
100
+ const E = () => {
92
101
  var t;
93
- const e = document.querySelector(ne);
94
- (t = u.value) == null || t.style.setProperty("--ribbon-offset", `${(e == null ? void 0 : e.offsetHeight) ?? 0}px`);
102
+ const e = document.querySelector(me);
103
+ (t = v.value) == null || t.style.setProperty("--ribbon-offset", `${(e == null ? void 0 : e.offsetHeight) ?? 0}px`);
95
104
  };
96
- return X(async () => {
97
- var t, l;
98
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), b();
99
- const e = (t = u.value) == null ? void 0 : t.parentElement;
100
- e && (c = new ResizeObserver(b), c.observe(e));
105
+ return te(async () => {
106
+ var t, a;
107
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), E();
108
+ const e = (t = v.value) == null ? void 0 : t.parentElement;
109
+ e && (i = new ResizeObserver(E), i.observe(e));
101
110
  try {
102
- E.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
103
- const a = ((l = o == null ? void 0 : o.migration) == null ? void 0 : l.recommendationConfigs) ?? {};
104
- let r = {
105
- html: d && await H(d, a),
106
- css: F
111
+ k.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
112
+ const n = ((a = o == null ? void 0 : o.migration) == null ? void 0 : a.recommendationConfigs) ?? {}, u = (d) => ((d == null ? void 0 : d.match(/<td[^>]*radio-button-v2[^>]*>/gi)) ?? []).map((p) => {
113
+ var x;
114
+ const W = (((x = p.match(/class="([^"]*)"/)) == null ? void 0 : x[1]) ?? "").split(/\s+/).filter(Boolean);
115
+ return { classes: W, hasBlock: W.includes("radio-button-block"), tag: p };
116
+ });
117
+ console.debug("guido:pre-migrate radio-tds", u(l));
118
+ let s = {
119
+ html: l && await K(l, n),
120
+ css: L
107
121
  };
108
- r.html || (r = await O(), r.html = await H(r.html, a)), A(r.html) && (r.html = await P(r.html)), await M(r), p.selectedDynamicContentList = y;
109
- } catch (a) {
110
- console.error("Failed to initialize Stripo editor:", a);
122
+ console.debug("guido:post-migrate radio-tds", u(s.html)), s.html || (s = await O(), s.html = await K(s.html, n)), N(s.html) && (s.html = await P(s.html)), await M(s), b.selectedDynamicContentList = S;
123
+ } catch (n) {
124
+ console.error("Failed to initialize Stripo editor:", n);
111
125
  }
112
- document.addEventListener("dynamic-content:open", S);
113
- }), Y(() => {
114
- c == null || c.disconnect(), document.removeEventListener("dynamic-content:open", S);
126
+ document.addEventListener("dynamic-content:open", w);
127
+ }), ne(() => {
128
+ i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", w);
115
129
  try {
116
130
  window.UIEditor.removeEditor();
117
131
  } catch {
118
132
  console.debug("Failed to remove Stripo editor: No editor found");
119
133
  }
120
- i.reset();
121
- }), z({
134
+ m.reset();
135
+ }), j({
122
136
  dynamicContent: {
123
- insert: N,
124
- close: R
137
+ insert: R,
138
+ close: I
125
139
  },
126
- hasChanges: m,
127
- saveSilent: D
128
- }), { __sfc: !0, PreviewContainer: q, OnboardingWrapper: K, headerWrapperRef: w, wrapperRef: u, dynamicContentStore: p, unsubscribeStore: E, props: g, configStore: i, editorStore: f, previewStore: V, hasChanges: m, isTestPartner: $, saveSilent: D, templateId: v, userId: C, partnerName: T, username: k, templateConfig: o, editorConfig: s, html: d, css: F, preselectedDynamicContentList: y, savedModulesFolderName: L, defaultModulesFolderName: U, emit: n, metadata: h, options: _, initPlugin: M, getDefaultTemplate: O, cloneTimersOnSave: P, hasTimerBlocks: A, noHeader: j, insertDynamicContent: N, closeDynamicContent: R, handleDynamicContentOpen: S, ribbonObserver: c, updateRibbonOffset: b, AutoSaveController: re, Toaster: se, FilterSelectionDrawer: ce, HeaderWrapper: ae, LoadingWrapper: ie, SaveAsTemplateDrawer: me, UnsubscribeWrapper: de };
140
+ hasChanges: f,
141
+ saveSilent: T
142
+ }), { __sfc: !0, PreviewContainer: J, OnboardingWrapper: Q, headerWrapperRef: C, wrapperRef: v, dynamicContentStore: b, unsubscribeStore: k, props: D, configStore: m, editorStore: g, previewStore: X, hasChanges: f, isTestPartner: Y, saveSilent: T, templateId: y, userId: A, partnerName: B, username: F, templateConfig: o, editorConfig: c, html: l, css: L, preselectedDynamicContentList: S, savedModulesFolderName: U, defaultModulesFolderName: _, emit: r, metadata: h, options: H, initPlugin: M, getDefaultTemplate: O, cloneTimersOnSave: P, hasTimerBlocks: N, noHeader: Z, insertDynamicContent: R, closeDynamicContent: I, handleDynamicContentOpen: w, ribbonObserver: i, updateRibbonOffset: E, AutoSaveController: le, Toaster: ue, FilterSelectionDrawer: pe, HeaderWrapper: fe, LoadingWrapper: ve, SaveAsTemplateDrawer: be, UnsubscribeWrapper: ge };
129
143
  }
130
144
  });
131
145
  export {
132
- We as default
146
+ je as default
133
147
  };
@@ -1,26 +1,24 @@
1
- import r from "./FilterItem.vue2.js";
1
+ import l from "./FilterItem.vue2.js";
2
2
  /* empty css */
3
- import l from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
- var i = function() {
3
+ import i from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var r = function() {
5
5
  var a = this, e = a._self._c, t = a._self._setupProxy;
6
6
  return e("div", { staticClass: "d-f f-d-c w-1 gap-16", attrs: { "data-filter-group": a.filter.filterGroup, "data-filter-number": a.filter.filterNumber } }, [e("div", { staticClass: "d-f a-i-c j-c-s-b pt-4", class: { "bor-t-s-s bor-t-w-1 bor-t-c-50": a.index === 0 } }, [e("p", [a._v(" " + a._s(t.trans("newsletter.filter")) + " " + a._s(a.index + 1) + " ")]), e(t.InButtonV2, { attrs: { id: "guido__delete-filter-group-button", "left-icon": "line-delete", styling: "text", type: "danger", "label-text-status": !1 }, on: { click: function(s) {
7
7
  return t.emit("delete-filter", t.props.filter);
8
- } } })], 1), e("div", { staticClass: "w-1 d-f a-i-s j-c-s-b gap-16" }, [e(t.InSelect, { staticClass: "w-2", attrs: { "disabled-status": "", "search-status": "", "button-status": !1, "label-text": t.trans("action-builder.filter-type"), options: t.filterTypeOptions, value: [t.filterTypeOptions[0]] } }), e(t.InSelect, { staticClass: "w-2", attrs: { id: "filter-item-input--attribute-type", "search-status": "", "static-position": "bottom right", "button-status": !1, "label-text": t.trans("condition.attribute"), options: t.store.getFilterList, state: t.getFieldState("attribute"), value: [t.selectedAttributeType] }, on: { select: t.handleAttributeChange } })], 1), e("div", { staticClass: "w-1 d-f a-i-s j-c-s-b gap-16" }, [t.isBooleanAttribute ? e(t.InSelect, { staticClass: "w-2", attrs: { "button-status": !1, "label-text": t.trans("condition.operator"), options: t.booleanValueOptions, state: t.getFieldState("value"), value: [t.selectedBooleanValue] }, on: { select: t.handleBooleanValueChange } }) : [e(t.InSelect, { staticClass: "w-2", attrs: { "button-status": !1, "label-text": t.trans("condition.operator"), options: t.getOperatorOptions(t.selectedAttributeType.type), state: t.getFieldState("operator"), value: [t.selectedOperatorType] }, on: { select: function(s) {
9
- return t.updateFilter({ text: "operator", value: s.value });
10
- } } }), e(t.InBasicTextInput, { staticClass: "w-2", attrs: { id: "filter-item-input--value", name: "imageUrl", "character-counter-status": !1, "label-text": t.trans("condition.value"), "max-character-length": 25, "placeholder-text": t.trans("condition.enter-value-placeholder"), "state-message": t.valueErrorMessage, states: t.getFieldState("value"), "tooltip-status": !1, type: t.valueInputType, value: decodeURIComponent(t.props.filter.value) }, on: { input: function(s) {
8
+ } } })], 1), e("div", { staticClass: "w-1 d-f a-i-s j-c-s-b gap-16" }, [e(t.InSelect, { staticClass: "w-2", attrs: { "disabled-status": "", "search-status": "", "button-status": !1, "label-text": t.trans("action-builder.filter-type"), options: t.filterTypeOptions, value: [t.filterTypeOptions[0]] } }), e(t.InSelect, { staticClass: "w-2", attrs: { id: "filter-item-input--attribute-type", "search-status": "", "static-position": "bottom right", "button-status": !1, "label-text": t.trans("condition.attribute"), options: t.store.getFilterList, state: t.getFieldState("attribute"), value: [t.selectedAttributeType] }, on: { select: t.handleAttributeChange } })], 1), e("div", { staticClass: "w-1 d-f a-i-s j-c-s-b gap-16" }, [t.isBooleanAttribute ? e(t.InSelect, { staticClass: "w-2", attrs: { "button-status": !1, "label-text": t.trans("condition.operator"), options: t.booleanValueOptions, state: t.getFieldState("value"), value: [t.selectedBooleanValue] }, on: { select: t.handleBooleanValueChange } }) : [e(t.InSelect, { staticClass: "w-2", attrs: { "button-status": !1, "label-text": t.trans("condition.operator"), options: t.getOperatorOptions(t.selectedAttributeType.type), state: t.getFieldState("operator"), value: [t.selectedOperatorType] }, on: { select: t.handleOperatorChange } }), t.isAnyOfOperator ? e(t.InTags, { staticClass: "w-2", attrs: { "allow-bulk-paste": "", validate: "text", "allow-duplicates": !1, invalid: t.invalidFields.has("value"), "invalid-message": t.valueErrorMessage, label: t.trans("condition.value"), placeholder: t.trans("condition.enter-value-placeholder"), value: t.tagValues }, on: { input: t.onTagsInput } }) : t.isDateAttribute ? e(t.InDatePickerV2, { staticClass: "w-2", attrs: { id: `filter-item-input--value-${a.index}`, "single-date-picker-status": "", "label-text": t.trans("condition.value"), locale: t.datePickerLocale, name: `filter-item-input--value-${a.index}`, "placeholder-text": t.trans("condition.enter-value-placeholder"), state: t.getFieldState("value"), "state-message": t.valueErrorMessage, value: t.datePickerValue }, on: { apply: t.onDatePickerApply } }) : e(t.InBasicTextInput, { staticClass: "w-2", attrs: { id: `filter-item-input--value-${a.index}`, name: "imageUrl", "character-counter-status": !1, "label-text": t.trans("condition.value"), "max-character-length": 25, "placeholder-text": t.trans("condition.enter-value-placeholder"), "state-message": t.valueErrorMessage, states: t.getFieldState("value"), "tooltip-status": !1, type: t.valueInputType, value: t.safeDecodeURIComponent(t.props.filter.value) }, on: { input: function(s) {
11
9
  t.updateFilter({ text: "value", value: encodeURIComponent(s) });
12
10
  } } })]], 2), t.props.hasLogicAdapter ? e("div", { staticClass: "w-1 d-f a-i-c j-c-c p-r bor-b-s-s bor-b-w-1 bor-b-c-50 mt-4" }, [e(t.LogicAdapter, { staticClass: "p-a", attrs: { logic: t.props.filter.innerGroupOperator }, on: { change: function(s) {
13
11
  return t.updateFilter({ text: "innerGroupOperator", value: s });
14
12
  } } })], 1) : a._e()]);
15
- }, o = [], n = /* @__PURE__ */ l(
13
+ }, n = [], o = /* @__PURE__ */ i(
14
+ l,
16
15
  r,
17
- i,
18
- o,
16
+ n,
19
17
  !1,
20
18
  null,
21
- "3b53a736"
19
+ "8053a037"
22
20
  );
23
- const f = n.exports;
21
+ const f = o.exports;
24
22
  export {
25
23
  f as default
26
24
  };
@@ -1,12 +1,14 @@
1
- import { defineComponent as _, computed as l } from "vue";
2
- import { useTranslations as C } from "../../../../composables/useTranslations.js";
3
- import { getOperatorOptions as p } from "../../../../enums/extensions/recommendationBlock.js";
4
- import { useRecommendationExtensionStore as V } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
5
- import { getInvalidFilterFields as A } from "../../../../extensions/Blocks/Recommendation/validation/filterSchema.js";
6
- import { InButtonV2 as L, InSelect as O, InBasicTextInput as S } from "@useinsider/design-system-vue";
7
- import E from "./LogicAdapter.vue.js";
8
- import { useDebounceFn as N } from "../../../../node_modules/@vueuse/shared/index.js";
9
- const K = /* @__PURE__ */ _({
1
+ import { defineComponent as N, computed as r } from "vue";
2
+ import { useTranslations as U } from "../../../../composables/useTranslations.js";
3
+ import { getOperatorOptions as f, OP_ANY_OF as d } from "../../../../enums/extensions/recommendationBlock.js";
4
+ import { useRecommendationExtensionStore as E } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
5
+ import { parseTagList as j, safeDecodeURIComponent as g } from "../../../../extensions/Blocks/Recommendation/utils/filterUtil.js";
6
+ import { getInvalidFilterFields as w } from "../../../../extensions/Blocks/Recommendation/validation/filterSchema.js";
7
+ import { locale as M } from "../../../../utils/dateUtil.js";
8
+ import { InTags as Y, InButtonV2 as q, InSelect as z, InDatePickerV2 as G, InBasicTextInput as H } from "@useinsider/design-system-vue";
9
+ import J from "./LogicAdapter.vue.js";
10
+ import { useDebounceFn as K } from "../../../../node_modules/@vueuse/shared/index.js";
11
+ const se = /* @__PURE__ */ N({
10
12
  __name: "FilterItem",
11
13
  props: {
12
14
  filter: null,
@@ -15,55 +17,88 @@ const K = /* @__PURE__ */ _({
15
17
  submitted: { type: Boolean }
16
18
  },
17
19
  emits: ["delete-filter"],
18
- setup(f, { emit: v }) {
19
- const t = f, n = C(), a = V(), y = [
20
+ setup(I, { emit: O }) {
21
+ const t = I, s = U(), n = E(), T = [
20
22
  {
21
- text: n("email-editor.standard-filter"),
23
+ text: s("email-editor.standard-filter"),
22
24
  value: "standardFilter"
23
25
  }
24
- ], i = [
26
+ ], u = [
25
27
  { text: "True", value: "true" },
26
28
  { text: "False", value: "false" }
27
- ], d = l(() => t.filter.attribute || ""), r = l(() => a.getFilterList.find((e) => e.value === d.value) || { text: "", value: "", type: "" }), F = l(
29
+ ], m = r(() => t.filter.attribute || ""), i = r(() => n.getFilterList.find((e) => e.value === m.value) || { text: "", value: "", type: "" }), h = r(
28
30
  () => {
29
31
  var e;
30
- return ((e = r.value) == null ? void 0 : e.type) === "Boolean";
32
+ return ((e = i.value) == null ? void 0 : e.type) === "Boolean";
31
33
  }
32
- ), b = l(() => {
34
+ ), b = r(() => {
33
35
  var e;
34
- return p((e = r.value) == null ? void 0 : e.type).find((o) => o.value === t.filter.operator);
35
- }), g = l(
36
- () => i.find((e) => e.value === t.filter.value) || i[0]
37
- ), u = l(() => t.submitted ? A(t.filter) : /* @__PURE__ */ new Set()), h = (e) => u.value.has(e) ? "error" : "default", B = l(
38
- () => u.value.has("value") ? n("action-builder.filter-empty-value-error") : ""
39
- ), c = l(
36
+ return f((e = i.value) == null ? void 0 : e.type).find((o) => o.value === t.filter.operator);
37
+ }), A = r(
38
+ () => u.find((e) => e.value === t.filter.value) || u[0]
39
+ ), p = r(() => t.submitted ? w(t.filter) : /* @__PURE__ */ new Set()), x = (e) => p.value.has(e) ? "error" : "default", B = r(
40
+ () => p.value.has("value") ? s("action-builder.filter-empty-value-error") : ""
41
+ ), v = r(
40
42
  () => {
41
43
  var e;
42
- return ((e = r.value) == null ? void 0 : e.type) === "Number";
44
+ return ((e = i.value) == null ? void 0 : e.type) === "Number";
43
45
  }
44
- ), x = l(() => c.value ? "number" : "text"), T = N((e) => {
45
- a.updateFilter({
46
+ ), D = r(() => v.value ? "number" : "text"), C = r(
47
+ () => {
48
+ var e;
49
+ return ((e = i.value) == null ? void 0 : e.type) === "Date";
50
+ }
51
+ ), _ = r(() => t.filter.operator === d), k = r(() => j(t.filter.value)), P = K((e) => {
52
+ n.updateFilter({
46
53
  ...t.filter,
47
54
  [e.text]: e.value
48
55
  });
49
- }, 500);
50
- return { __sfc: !0, trans: n, store: a, props: t, filterTypeOptions: y, booleanValueOptions: i, attributeType: d, selectedAttributeType: r, isBooleanAttribute: F, selectedOperatorType: b, selectedBooleanValue: g, emit: v, invalidFields: u, getFieldState: h, valueErrorMessage: B, isNumericAttribute: c, valueInputType: x, updateFilter: T, handleAttributeChange: (e) => {
51
- const o = a.getFilterList.find((I) => I.value === e.value), m = (o == null ? void 0 : o.type) === "Boolean", [s] = p(o == null ? void 0 : o.type);
52
- a.updateFilter({
56
+ }, 500), V = (e) => {
57
+ const o = n.getFilterList.find((c) => c.value === e.value), l = (o == null ? void 0 : o.type) === "Boolean", [a] = f(o == null ? void 0 : o.type);
58
+ n.updateFilter({
53
59
  ...t.filter,
54
60
  attribute: e.value,
55
- operator: m ? "=" : (s == null ? void 0 : s.value) ?? "",
56
- value: m ? "true" : ""
61
+ operator: l ? "=" : (a == null ? void 0 : a.value) ?? "",
62
+ value: l ? "true" : ""
57
63
  });
58
- }, handleBooleanValueChange: (e) => {
59
- a.updateFilter({
64
+ }, L = (e) => {
65
+ n.updateFilter({
60
66
  ...t.filter,
61
67
  operator: "=",
62
68
  value: e.value
63
69
  });
64
- }, getOperatorOptions: p, InBasicTextInput: S, InSelect: O, InButtonV2: L, LogicAdapter: E };
70
+ }, S = (e) => {
71
+ const o = e.value;
72
+ if (o === t.filter.operator)
73
+ return;
74
+ const c = t.filter.operator === d !== (o === d);
75
+ n.updateFilter({
76
+ ...t.filter,
77
+ operator: o,
78
+ value: c ? "" : t.filter.value
79
+ });
80
+ }, $ = M(), y = (e) => {
81
+ const [o, l, a] = e.split("-");
82
+ return !o || !l || !a ? "" : `${l}/${a}/${o}`;
83
+ }, F = (e) => {
84
+ const [o, l, a] = e.split("/");
85
+ return !a || !o || !l ? "" : `${a}-${o.padStart(2, "0")}-${l.padStart(2, "0")}`;
86
+ }, R = r(
87
+ () => y(g(t.filter.value))
88
+ );
89
+ return { __sfc: !0, trans: s, store: n, props: t, filterTypeOptions: T, booleanValueOptions: u, attributeType: m, selectedAttributeType: i, isBooleanAttribute: h, selectedOperatorType: b, selectedBooleanValue: A, emit: O, invalidFields: p, getFieldState: x, valueErrorMessage: B, isNumericAttribute: v, valueInputType: D, isDateAttribute: C, isAnyOfOperator: _, tagValues: k, updateFilter: P, handleAttributeChange: V, handleBooleanValueChange: L, handleOperatorChange: S, datePickerLocale: $, isoToPickerDate: y, pickerDateToIso: F, datePickerValue: R, onDatePickerApply: (e) => {
90
+ n.updateFilter({
91
+ ...t.filter,
92
+ value: encodeURIComponent(F(e))
93
+ });
94
+ }, onTagsInput: (e) => {
95
+ n.updateFilter({
96
+ ...t.filter,
97
+ value: e.map(encodeURIComponent).join(",")
98
+ });
99
+ }, getOperatorOptions: f, safeDecodeURIComponent: g, InBasicTextInput: H, InDatePickerV2: G, InSelect: z, InButtonV2: q, InTags: Y, LogicAdapter: J };
65
100
  }
66
101
  });
67
102
  export {
68
- K as default
103
+ se as default
69
104
  };
@@ -1,17 +1,17 @@
1
- import i from "./MiddleSlot.vue2.js";
1
+ import r from "./MiddleSlot.vue2.js";
2
2
  import s from "../../../_virtual/_plugin-vue2_normalizer.js";
3
3
  var t = function() {
4
- var r = this, e = r._self._c, o = r._self._setupProxy;
5
- return e("div", [o.editorStore.isVersionHistoryOpen ? e("div", { staticClass: "d-f" }, [e(o.VersionHistory), e(o.VersionHistoryViewOptions)], 1) : o.editorStore.isPreviewModeOpen ? e("div", { staticClass: "d-f" }, [e(o.EmailSizeIndicator), e(o.AmpToggle)], 1) : r._e(), e(o.EditorToolbar, { directives: [{ name: "show", rawName: "v-show", value: o.editorStore.isEditorToolbarVisible, expression: "editorStore.isEditorToolbarVisible" }] })], 1);
6
- }, n = [], a = /* @__PURE__ */ s(
7
- i,
4
+ var o = this, e = o._self._c, i = o._self._setupProxy;
5
+ return e("div", { staticClass: "d-f a-i-c" }, [i.editorStore.isVersionHistoryOpen ? e("div", { staticClass: "d-f" }, [e(i.VersionHistory), e(i.VersionHistoryViewOptions)], 1) : i.editorStore.isPreviewModeOpen ? e("div", { staticClass: "d-f" }, [e(i.EmailSizeIndicator), e(i.AmpToggle)], 1) : o._e(), e(i.EditorToolbar, { directives: [{ name: "show", rawName: "v-show", value: i.editorStore.isEditorToolbarVisible, expression: "editorStore.isEditorToolbarVisible" }] })], 1);
6
+ }, a = [], n = /* @__PURE__ */ s(
7
+ r,
8
8
  t,
9
- n,
9
+ a,
10
10
  !1,
11
11
  null,
12
12
  null
13
13
  );
14
- const c = a.exports;
14
+ const c = n.exports;
15
15
  export {
16
16
  c as default
17
17
  };
@@ -0,0 +1,66 @@
1
+ import { useEmailTemplateApplier as m, resetEmailTemplateApplier as w } from "./useEmailTemplateApplier.js";
2
+ import { useToaster as _ } from "./useToaster.js";
3
+ import { useTranslations as I } from "./useTranslations.js";
4
+ import { ToasterTypeOptions as S } from "../enums/toaster.js";
5
+ import { getActivePinia as v } from "pinia";
6
+ import { watch as B, onUnmounted as D } from "vue";
7
+ const P = "email_template", x = "chat", L = "guido:debug:ai", M = () => {
8
+ if (typeof window > "u")
9
+ return !1;
10
+ try {
11
+ return window.localStorage.getItem(L) === "1";
12
+ } catch {
13
+ return !1;
14
+ }
15
+ }, O = () => {
16
+ const a = v();
17
+ if (!a)
18
+ return;
19
+ const l = a._s, p = l == null ? void 0 : l.get(x);
20
+ if (!p)
21
+ return;
22
+ const { applyTemplate: d, applyTemplateDebounced: f } = m(), { showToaster: T } = _(), h = I(), A = (e, t) => {
23
+ const r = h(e);
24
+ return r === e ? t : r;
25
+ }, i = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Set(), u = M(), E = (e, t) => {
26
+ u && console.debug(`[guido:cortex] msg=${e ?? "?"} type=${(t == null ? void 0 : t.type) ?? "?"}`, t);
27
+ }, y = (e) => {
28
+ if (e.blueprintType !== P)
29
+ return;
30
+ const t = e.blueprintId, r = e.blueprintData;
31
+ if (!t || !(r != null && r.html))
32
+ return;
33
+ const o = i.get(t);
34
+ o === void 0 ? (i.set(t, r.html), d(t, r)) : o !== r.html && (i.set(t, r.html), f(t, r));
35
+ }, s = (e) => e === void 0 || c.has(e) ? !1 : (c.add(e), T({
36
+ type: S.Alert,
37
+ message: A("newsletter.ai-template-failed", "AI couldn't generate the template. Please try again.")
38
+ }), !0), b = B(
39
+ () => p.messages,
40
+ (e) => {
41
+ Array.isArray(e) && e.forEach((t) => {
42
+ const r = t == null ? void 0 : t.id;
43
+ (t == null ? void 0 : t.isError) === !0 && s(r) && u && console.debug(`[guido:cortex] message-level error id=${r}`, t);
44
+ const o = t == null ? void 0 : t.segments;
45
+ Array.isArray(o) && o.forEach((n) => {
46
+ if (n)
47
+ switch (E(r, n), n.type) {
48
+ case "blueprint":
49
+ y(n);
50
+ break;
51
+ case "error":
52
+ s(r);
53
+ break;
54
+ }
55
+ });
56
+ });
57
+ },
58
+ { deep: !0, immediate: !0 }
59
+ );
60
+ D(() => {
61
+ b(), i.clear(), c.clear(), w();
62
+ });
63
+ };
64
+ export {
65
+ O as useCortexBlueprintBridge
66
+ };
@@ -4,20 +4,21 @@ import e from "../static/styles/components/amp-block.css.js";
4
4
  import i from "../static/styles/components/base-input.css.js";
5
5
  import p from "../static/styles/components/button-group.css.js";
6
6
  import n from "../static/styles/components/button.css.js";
7
- import s from "../static/styles/components/combobox.css.js";
8
- import C from "../static/styles/components/counter.css.js";
7
+ import C from "../static/styles/components/combobox.css.js";
8
+ import s from "../static/styles/components/counter.css.js";
9
9
  import f from "../static/styles/components/dropdown-menu.css.js";
10
10
  import a from "../static/styles/components/loader.css.js";
11
11
  import u from "../static/styles/components/narrow-panel.css.js";
12
- import c from "../static/styles/components/popup.css.js";
13
- import d from "../static/styles/components/switcher.css.js";
14
- import l from "../static/styles/components/tabs.css.js";
15
- import h from "../static/styles/components/tools.css.js";
16
- import w from "../static/styles/components/version-history.css.js";
17
- import y from "../static/styles/components/wide-panel.css.js";
18
- import B from "../static/styles/variables.css.js";
19
- const b = [
20
- B,
12
+ import c from "../static/styles/components/notification.css.js";
13
+ import d from "../static/styles/components/popup.css.js";
14
+ import l from "../static/styles/components/switcher.css.js";
15
+ import h from "../static/styles/components/tabs.css.js";
16
+ import w from "../static/styles/components/tools.css.js";
17
+ import y from "../static/styles/components/version-history.css.js";
18
+ import B from "../static/styles/components/wide-panel.css.js";
19
+ import b from "../static/styles/variables.css.js";
20
+ const A = [
21
+ b,
21
22
  // Must be on top
22
23
  S,
23
24
  // Must be on top
@@ -26,8 +27,8 @@ const b = [
26
27
  i,
27
28
  p,
28
29
  n,
29
- s,
30
30
  C,
31
+ s,
31
32
  f,
32
33
  a,
33
34
  u,
@@ -36,12 +37,13 @@ const b = [
36
37
  l,
37
38
  h,
38
39
  w,
39
- y
40
+ y,
41
+ B
40
42
  ].join(`
41
43
 
42
- `), v = () => ({ importCss: () => {
44
+ `), F = () => ({ importCss: () => {
43
45
  const o = new CSSStyleSheet();
44
- o.replaceSync(b);
46
+ o.replaceSync(A);
45
47
  const r = document.querySelector("ui-editor");
46
48
  if (!r)
47
49
  return;
@@ -49,5 +51,5 @@ const b = [
49
51
  t && (t.adoptedStyleSheets = [o]);
50
52
  } });
51
53
  export {
52
- v as useCustomInterfaceAppearance
54
+ F as useCustomInterfaceAppearance
53
55
  };