@useinsider/guido 3.19.0-beta.ab4fcb3 → 3.19.0-beta.b05a465
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.
- package/dist/components/Guido.vue.js +6 -6
- package/dist/components/Guido.vue2.js +27 -26
- package/dist/components/organisms/base/AuthErrorModal.vue.js +18 -0
- package/dist/components/organisms/base/AuthErrorModal.vue2.js +42 -0
- package/dist/components/wrappers/WpModal.vue.js +1 -1
- package/dist/components/wrappers/WpModal.vue2.js +4 -3
- package/dist/composables/useAuthError.js +52 -0
- package/dist/composables/useAutoSave.js +11 -11
- package/dist/composables/useHttp.js +64 -54
- package/dist/composables/useLegacyStrategyConversion.js +23 -19
- package/dist/composables/useStripo.js +24 -20
- package/dist/composables/useToaster.js +17 -15
- package/dist/composables/validators/useLiquidValidator.js +15 -15
- package/dist/config/migrator/recommendationMigrator.js +28 -21
- package/dist/config/migrator/recommendationPartnerMigrator.js +36 -30
- package/dist/enums/extensions/recommendationBlock.js +30 -29
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +103 -91
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +29 -29
- package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +72 -70
- package/dist/extensions/Blocks/Recommendation/utils/compositionKeys.js +69 -60
- package/dist/guido.css +1 -1
- package/dist/src/components/organisms/base/AuthErrorModal.vue.d.ts +2 -0
- package/dist/src/components/wrappers/WpModal.vue.d.ts +5 -1
- package/dist/src/composables/useAuthError.d.ts +12 -0
- package/dist/src/composables/useGuidoActions.d.ts +2 -0
- package/dist/src/composables/useHttp.d.ts +2 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +3 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/compositionKeys.d.ts +4 -0
- package/dist/src/mock/cortexChatStore.d.ts +12 -0
- package/dist/src/stores/onboarding.d.ts +4 -0
- package/dist/src/stores/recommendation.d.ts +5 -0
- package/dist/src/utils/dateUtil.d.ts +10 -0
- package/dist/src/utils/genericUtil.d.ts +3 -0
- package/dist/static/styles/components/version-history.css.js +2 -6
- package/dist/stores/onboarding.js +4 -0
- package/package.json +1 -1
|
@@ -17,21 +17,21 @@ import { buildMergeTagEntries as W, flattenDynamicContentList as Y } from "../ut
|
|
|
17
17
|
import Z from "../package.json.js";
|
|
18
18
|
let n = null;
|
|
19
19
|
const he = () => {
|
|
20
|
-
const { features: c, template: u, isFeatureEnabled:
|
|
20
|
+
const { features: c, template: u, isFeatureEnabled: p } = H(), { handleError: m, showToaster: v } = G(), { getToken: B, getCustomFonts: M, getSyncModulesStatus: T } = K(), { handleEvent: F } = z(), { handleModuleAdd: A } = j(), { getStripoBlocksConfig: V } = O(), { getStripoNotifications: _ } = $(), f = () => n || (n = new Promise((r, s) => {
|
|
21
21
|
var d;
|
|
22
22
|
if (document.getElementById("UiEditorScript")) {
|
|
23
|
-
|
|
23
|
+
r();
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
|
-
const o = Z.guido,
|
|
27
|
-
e.id = "UiEditorScript", e.type = "module", e.src =
|
|
28
|
-
e.remove(), s(new Error(`Failed to load Stripo UIEditor script from S3: ${
|
|
26
|
+
const o = Z.guido, i = `https://email-static.useinsider.com/guido/${(d = o == null ? void 0 : o.stripo) == null ? void 0 : d.version}/UIEditor.js`, e = document.createElement("script");
|
|
27
|
+
e.id = "UiEditorScript", e.type = "module", e.src = i, e.onload = () => r(), e.onerror = () => {
|
|
28
|
+
e.remove(), s(new Error(`Failed to load Stripo UIEditor script from S3: ${i}`));
|
|
29
29
|
}, document.body.appendChild(e);
|
|
30
30
|
}), n.catch(() => {
|
|
31
31
|
n = null;
|
|
32
|
-
}), n), D = async (
|
|
32
|
+
}), n), D = async (r, s, o, a = [], i = !1) => {
|
|
33
33
|
var y, E, h, C;
|
|
34
|
-
const e = k(), { html: d, css: R } =
|
|
34
|
+
const e = k(), { html: d, css: R } = r, { baseBlocks: g, extensions: P } = await V(), S = ((y = c.value) == null ? void 0 : y.displayConditions) ?? !0, U = ((E = c.value) == null ? void 0 : E.modulesDisabled) ?? !1, I = !!d || (((h = u.value) == null ? void 0 : h.forceRecreate) ?? !1), q = "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com";
|
|
35
35
|
w().importCss(), await window.UIEditor.initEditor(
|
|
36
36
|
document.querySelector("#guido-editor"),
|
|
37
37
|
{
|
|
@@ -45,7 +45,7 @@ const he = () => {
|
|
|
45
45
|
mobileViewButtonSelector: ".guido__view-option-selection-mobile",
|
|
46
46
|
desktopViewButtonSelector: ".guido__view-option-selection-desktop",
|
|
47
47
|
codeEditorButtonSelector: "#guido__code-button",
|
|
48
|
-
customAppearanceMergetags: !
|
|
48
|
+
customAppearanceMergetags: !p("liquidSyntax"),
|
|
49
49
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
50
50
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
51
51
|
customViewStyles: Q,
|
|
@@ -53,7 +53,7 @@ const he = () => {
|
|
|
53
53
|
customConditionsEnabled: S,
|
|
54
54
|
enableXSSSecurity: !0,
|
|
55
55
|
modulesDisabled: U,
|
|
56
|
-
syncModulesEnabled:
|
|
56
|
+
syncModulesEnabled: i,
|
|
57
57
|
messageSettingsEnabled: !0,
|
|
58
58
|
displayGmailAnnotations: !0,
|
|
59
59
|
displayHiddenPreheader: !1,
|
|
@@ -74,16 +74,16 @@ const he = () => {
|
|
|
74
74
|
entries: W(
|
|
75
75
|
o.preselectedDynamicContentList,
|
|
76
76
|
Y((C = u.value) == null ? void 0 : C.dynamicContentList),
|
|
77
|
-
|
|
77
|
+
p("liquidSyntax")
|
|
78
78
|
)
|
|
79
79
|
}
|
|
80
80
|
],
|
|
81
81
|
async onTokenRefreshRequest(t) {
|
|
82
82
|
try {
|
|
83
|
-
const l = await
|
|
83
|
+
const l = await B();
|
|
84
84
|
t(l);
|
|
85
85
|
} catch (l) {
|
|
86
|
-
|
|
86
|
+
m(l, "Failed to refresh token");
|
|
87
87
|
}
|
|
88
88
|
},
|
|
89
89
|
onTemplateLoaded() {
|
|
@@ -93,7 +93,7 @@ const he = () => {
|
|
|
93
93
|
e.hasChanges = !1;
|
|
94
94
|
}, 1e3);
|
|
95
95
|
} catch (t) {
|
|
96
|
-
|
|
96
|
+
m(t, "Failed to load custom interface appearance");
|
|
97
97
|
}
|
|
98
98
|
},
|
|
99
99
|
onCodeEditorVisibilityChanged(t) {
|
|
@@ -111,27 +111,31 @@ const he = () => {
|
|
|
111
111
|
onEvent: F,
|
|
112
112
|
onModuleAdd: A,
|
|
113
113
|
notifications: _(),
|
|
114
|
+
// Stripo deselects the block on any click outside the canvas, so every surface
|
|
115
|
+
// that belongs to the block's own flow has to be listed here (SD-153273).
|
|
114
116
|
ignoreClickOutsideSelectors: [
|
|
115
117
|
"#guido-dynamic-content-modal",
|
|
116
118
|
".in-on-board-wrapper",
|
|
117
|
-
".in-drawer__container"
|
|
119
|
+
".in-drawer__container",
|
|
120
|
+
".in-modal-v2-wrapper",
|
|
121
|
+
".in-toasts-wrapper"
|
|
118
122
|
],
|
|
119
123
|
extensions: P,
|
|
120
124
|
localePatch: J
|
|
121
125
|
}
|
|
122
126
|
);
|
|
123
127
|
};
|
|
124
|
-
return { initPlugin: async (
|
|
128
|
+
return { initPlugin: async (r, s, o) => {
|
|
125
129
|
const a = k();
|
|
126
130
|
try {
|
|
127
131
|
await f();
|
|
128
|
-
const [
|
|
129
|
-
|
|
130
|
-
|
|
132
|
+
const [i, e] = await Promise.all([
|
|
133
|
+
M(),
|
|
134
|
+
T()
|
|
131
135
|
]);
|
|
132
|
-
a.syncModulesEnabled = e, await D(
|
|
136
|
+
a.syncModulesEnabled = e, await D(r, s, o, i, e);
|
|
133
137
|
} catch {
|
|
134
|
-
a.loadingStatus = !1,
|
|
138
|
+
a.loadingStatus = !1, v({
|
|
135
139
|
type: X.Error,
|
|
136
140
|
message: b["An error has occurred. Please report the error code to support."],
|
|
137
141
|
actionButton: {
|
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
import { ToasterTypeOptions as T } from "../enums/toaster.js";
|
|
2
|
-
import { useToasterStore as
|
|
3
|
-
import { nextTick as
|
|
2
|
+
import { useToasterStore as u } from "../stores/toaster.js";
|
|
3
|
+
import { nextTick as c } from "vue";
|
|
4
4
|
const s = /* @__PURE__ */ new WeakMap(), p = () => {
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
5
|
+
const t = u(), o = () => {
|
|
6
|
+
const e = s.get(t);
|
|
7
|
+
e && (clearTimeout(e), s.delete(t));
|
|
8
8
|
};
|
|
9
|
-
function
|
|
10
|
-
o(),
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
function i(e = { message: "" }) {
|
|
10
|
+
o(), t.hideToaster(), c(() => {
|
|
11
|
+
t.showToaster(e), t.shouldAutoHide && s.set(t, setTimeout(() => {
|
|
12
|
+
t.hideToaster(), o();
|
|
13
13
|
}, 6e3));
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
o(),
|
|
16
|
+
function n() {
|
|
17
|
+
o(), t.hideToaster();
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
function a(e, r) {
|
|
20
|
+
if (e != null && e.authReported)
|
|
21
|
+
return;
|
|
22
|
+
const m = e instanceof Error ? e.message : String(e);
|
|
23
|
+
i({ type: T.Error, message: `${r}: ${m}` });
|
|
22
24
|
}
|
|
23
|
-
return { showToaster:
|
|
25
|
+
return { showToaster: i, hideToaster: n, handleError: a };
|
|
24
26
|
};
|
|
25
27
|
export {
|
|
26
28
|
p as useToaster
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ToasterTypeOptions as
|
|
1
|
+
import { ToasterTypeOptions as r } from "../../enums/toaster.js";
|
|
2
2
|
import { base64EncodeWithSpecialChars as u } from "../../utils/base64.js";
|
|
3
3
|
import { useHttp as d } from "../useHttp.js";
|
|
4
|
-
import { useToaster as
|
|
5
|
-
import { useTranslations as
|
|
4
|
+
import { useToaster as p } from "../useToaster.js";
|
|
5
|
+
import { useTranslations as c } from "../useTranslations.js";
|
|
6
6
|
const v = () => {
|
|
7
|
-
const { post: i } = d(), { showToaster:
|
|
7
|
+
const { post: i } = d(), { showToaster: t } = p(), s = c();
|
|
8
8
|
return { validateLiquidSyntax: async (o) => {
|
|
9
9
|
try {
|
|
10
|
-
const
|
|
10
|
+
const e = await i("/newsletter/contents/validate-syntax", [{
|
|
11
11
|
identifier: "default",
|
|
12
12
|
syntax: "liquid",
|
|
13
13
|
contents: {
|
|
@@ -17,21 +17,21 @@ const v = () => {
|
|
|
17
17
|
ampHtml: null
|
|
18
18
|
}
|
|
19
19
|
}]);
|
|
20
|
-
if (!Array.isArray(
|
|
21
|
-
const l =
|
|
22
|
-
return
|
|
23
|
-
type:
|
|
20
|
+
if (!Array.isArray(e.data)) {
|
|
21
|
+
const l = e.data;
|
|
22
|
+
return t({
|
|
23
|
+
type: r.Warning,
|
|
24
24
|
message: l.message ?? s("journey-builder.liquid-validation-failed")
|
|
25
25
|
}), !1;
|
|
26
26
|
}
|
|
27
|
-
const [
|
|
28
|
-
return n.length ? (
|
|
29
|
-
type:
|
|
27
|
+
const [a] = e.data, n = Object.values((a == null ? void 0 : a.errors) ?? {});
|
|
28
|
+
return n.length ? (t({
|
|
29
|
+
type: r.Warning,
|
|
30
30
|
message: n[0].replace(/^line \d+:\s*/, "")
|
|
31
31
|
}), !1) : !0;
|
|
32
|
-
} catch {
|
|
33
|
-
return e({
|
|
34
|
-
type:
|
|
32
|
+
} catch (e) {
|
|
33
|
+
return e != null && e.authReported || t({
|
|
34
|
+
type: r.Error,
|
|
35
35
|
message: s("journey-builder.liquid-validation-failed")
|
|
36
36
|
}), !1;
|
|
37
37
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BlockId as f } from "../../enums/block.js";
|
|
2
|
-
import { DEFAULT_NODE_CONFIG as
|
|
3
|
-
import { ATTR_RECOMMENDATION_TITLE as
|
|
2
|
+
import { DEFAULT_NODE_CONFIG as y } from "../../extensions/Blocks/Recommendation/constants/defaultConfig.js";
|
|
3
|
+
import { ATTR_RECOMMENDATION_TITLE as b } from "../../extensions/Blocks/Recommendation/constants/selectors.js";
|
|
4
4
|
import { useTemplateStore as T } from "../../stores/template.js";
|
|
5
5
|
import { mapComposition as v } from "./recommendation/compositionMapper.js";
|
|
6
6
|
import { extractCurrencyFromBlock as C, extractTitleText as M, hasVisibleTitle as R, extractCardBgColor as S, isPartnerManagedBlock as h } from "./recommendation/extractors.js";
|
|
@@ -8,28 +8,28 @@ import { buildBlockHtml as w } from "./recommendation/htmlBuilder.js";
|
|
|
8
8
|
import { parseRecommendationId as x, parseLegacyConfig as E } from "./recommendation/parseLegacyConfig.js";
|
|
9
9
|
import { mapSettings as A } from "./recommendation/settingsMapper.js";
|
|
10
10
|
const H = 'td[esd-dev-product-config][class*="ins-recommendation-v3-block-"]:not(.recommendation-block-v2), td.product-block[esd-handler-name*="EmailRecommendationV3"][esd-dev-product-config]:not(.recommendation-block-v2)';
|
|
11
|
-
function B(n, t,
|
|
11
|
+
function B(n, t, c) {
|
|
12
12
|
var l;
|
|
13
|
-
const
|
|
14
|
-
if (
|
|
13
|
+
const r = x(t);
|
|
14
|
+
if (r === null)
|
|
15
15
|
return console.warn(
|
|
16
16
|
"[RecommendationMigrator] Skipping block — missing/invalid `ins-recommendation-v3-campaign-id`"
|
|
17
17
|
), !1;
|
|
18
|
-
const
|
|
19
|
-
if (!
|
|
18
|
+
const o = E(t);
|
|
19
|
+
if (!o)
|
|
20
20
|
return console.warn(
|
|
21
|
-
`[RecommendationMigrator] Aborting block id=${
|
|
21
|
+
`[RecommendationMigrator] Aborting block id=${r} — \`esd-dev-product-config\` missing or unable to be parsed`
|
|
22
22
|
), !1;
|
|
23
|
-
const
|
|
23
|
+
const a = c[String(r)] ?? {
|
|
24
24
|
currencySettings: C(t)
|
|
25
|
-
},
|
|
26
|
-
e.titleVariable || (e.visibility[
|
|
25
|
+
}, i = A(a, o, r), e = v((l = o.composition) == null ? void 0 : l.variables), d = M(t);
|
|
26
|
+
e.titleVariable || (e.visibility[b] = R(t));
|
|
27
27
|
const p = S(t), g = {
|
|
28
|
-
...
|
|
28
|
+
...i,
|
|
29
29
|
strategyId: "",
|
|
30
30
|
composition: e.composition,
|
|
31
31
|
visibility: e.visibility,
|
|
32
|
-
previousTitleHtml:
|
|
32
|
+
previousTitleHtml: y.previousTitleHtml,
|
|
33
33
|
textTrimming: e.anyTextTrimming
|
|
34
34
|
}, m = h(t), u = `
|
|
35
35
|
<table>
|
|
@@ -56,30 +56,37 @@ function B(n, t, a) {
|
|
|
56
56
|
</table>
|
|
57
57
|
`, s = n.parseFromString(u, "text/html").querySelector("td.esd-structure");
|
|
58
58
|
return !s || !t.parentNode ? (console.warn(
|
|
59
|
-
`[RecommendationMigrator] Aborting block id=${
|
|
59
|
+
`[RecommendationMigrator] Aborting block id=${r} — failed to construct new HTML element`
|
|
60
60
|
), !1) : (t.parentNode.replaceChild(s, t), !0);
|
|
61
61
|
}
|
|
62
62
|
function G(n, t = {}) {
|
|
63
|
-
const
|
|
63
|
+
const c = new DOMParser();
|
|
64
|
+
let r;
|
|
65
|
+
try {
|
|
66
|
+
r = c.parseFromString(n, "text/html");
|
|
67
|
+
} catch (i) {
|
|
68
|
+
return console.error("[RecommendationMigrator] Failed to parse template:", i), n;
|
|
69
|
+
}
|
|
70
|
+
const o = Array.from(r.querySelectorAll(H));
|
|
64
71
|
try {
|
|
65
72
|
T().$patch((e) => {
|
|
66
73
|
e.migrations = {
|
|
67
74
|
...e.migrations,
|
|
68
|
-
[f.Recommendation]:
|
|
75
|
+
[f.Recommendation]: o.length
|
|
69
76
|
};
|
|
70
77
|
});
|
|
71
78
|
} catch {
|
|
72
79
|
}
|
|
73
|
-
if (
|
|
80
|
+
if (o.length === 0)
|
|
74
81
|
return n;
|
|
75
|
-
let
|
|
76
|
-
return
|
|
82
|
+
let a = 0;
|
|
83
|
+
return o.forEach((i) => {
|
|
77
84
|
try {
|
|
78
|
-
B(
|
|
85
|
+
B(c, i, t) && (a += 1);
|
|
79
86
|
} catch (e) {
|
|
80
87
|
console.error("[RecommendationMigrator] Unexpected error migrating block:", e);
|
|
81
88
|
}
|
|
82
|
-
}),
|
|
89
|
+
}), a > 0 && console.info(`[RecommendationMigrator] Migrated ${a} legacy Recommendation block(s)`), r.documentElement.outerHTML;
|
|
83
90
|
}
|
|
84
91
|
export {
|
|
85
92
|
G as migrateRecommendation
|
|
@@ -1,50 +1,56 @@
|
|
|
1
|
-
import { RECOMMENDATION_ID_ATTR as
|
|
2
|
-
import { carriesForeignPartnerConfig as
|
|
3
|
-
const
|
|
4
|
-
function
|
|
5
|
-
const
|
|
6
|
-
if (!
|
|
1
|
+
import { RECOMMENDATION_ID_ATTR as a, SELECTOR_ATTRIBUTE_ROW as f, ATTR_DATA_ATTRIBUTE_TYPE as _, ATTR_CUSTOM_PREFIX as g, ATTR_DATA_CARD_COMPOSITION as m, ATTR_DATA_CUSTOM_ATTRIBUTES as R } from "../../extensions/Blocks/Recommendation/constants/selectors.js";
|
|
2
|
+
import { carriesForeignPartnerConfig as O, canJudgeUnstampedBlock as d, withoutCustomAttributes as l } from "../../extensions/Blocks/Recommendation/utils/partnerScope.js";
|
|
3
|
+
const E = ".recommendation-block-v2[esd-ext-config]", T = "esd-ext-config";
|
|
4
|
+
function S(t) {
|
|
5
|
+
const r = t.getAttribute(T);
|
|
6
|
+
if (!r)
|
|
7
7
|
return null;
|
|
8
8
|
try {
|
|
9
|
-
const
|
|
10
|
-
return
|
|
9
|
+
const e = JSON.parse(r);
|
|
10
|
+
return e && typeof e == "object" && !Array.isArray(e) ? e : null;
|
|
11
11
|
} catch {
|
|
12
12
|
return null;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
const
|
|
17
|
-
t.querySelectorAll(
|
|
18
|
-
var
|
|
19
|
-
(
|
|
20
|
-
}), t.setAttribute(
|
|
21
|
-
...
|
|
15
|
+
function p(t, r, e) {
|
|
16
|
+
const s = l(r.composition ?? []);
|
|
17
|
+
t.querySelectorAll(f).forEach((o) => {
|
|
18
|
+
var u;
|
|
19
|
+
(u = o.getAttribute(_)) != null && u.startsWith(g) && o.remove();
|
|
20
|
+
}), t.setAttribute(m, s.join(",")), t.setAttribute(R, "[]"), t.setAttribute(T, JSON.stringify({
|
|
21
|
+
...r,
|
|
22
22
|
strategyId: "",
|
|
23
23
|
strategy: "",
|
|
24
24
|
filters: [],
|
|
25
25
|
productIds: [],
|
|
26
|
-
composition:
|
|
27
|
-
partnerName:
|
|
26
|
+
composition: s,
|
|
27
|
+
partnerName: e
|
|
28
28
|
}));
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
if (!
|
|
30
|
+
function I(t, { partnerName: r, campaignUrls: e, rrsEnabled: s }) {
|
|
31
|
+
if (!r)
|
|
32
32
|
return t;
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
let o;
|
|
34
|
+
try {
|
|
35
|
+
o = new DOMParser().parseFromString(t, "text/html");
|
|
36
|
+
} catch (n) {
|
|
37
|
+
return console.error("[RecommendationPartnerMigrator] Failed to parse template:", n), t;
|
|
38
|
+
}
|
|
39
|
+
const u = Array.from(o.querySelectorAll(E));
|
|
40
|
+
if (u.length === 0)
|
|
35
41
|
return t;
|
|
36
|
-
let
|
|
37
|
-
return
|
|
38
|
-
const
|
|
39
|
-
if (!(!
|
|
40
|
-
if (
|
|
41
|
-
|
|
42
|
+
let c = 0;
|
|
43
|
+
return u.forEach((n) => {
|
|
44
|
+
const i = S(n), A = Number(n.getAttribute(a));
|
|
45
|
+
if (!(!i || !Number.isFinite(A))) {
|
|
46
|
+
if (O({ config: i, blockId: A, partnerName: r, campaignUrls: e, rrsEnabled: s })) {
|
|
47
|
+
p(n, i, r), c += 1;
|
|
42
48
|
return;
|
|
43
49
|
}
|
|
44
|
-
|
|
50
|
+
i.partnerName || !d({ config: i, campaignUrls: e, rrsEnabled: s }) || (n.setAttribute(T, JSON.stringify({ ...i, partnerName: r })), c += 1);
|
|
45
51
|
}
|
|
46
|
-
}),
|
|
52
|
+
}), c > 0 ? o.documentElement.outerHTML : t;
|
|
47
53
|
}
|
|
48
54
|
export {
|
|
49
|
-
|
|
55
|
+
I as migrateRecommendationPartnerScope
|
|
50
56
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useTranslations as s } from "../../composables/useTranslations.js";
|
|
2
|
-
const
|
|
2
|
+
const t = {
|
|
3
3
|
RECOMMENDATION_API_URL: "https://recommendationv2.api.useinsider.com",
|
|
4
4
|
// Relative path → same-origin as the embedding inone dashboard.
|
|
5
5
|
PRODUCT_ATTRIBUTES_PATH: "/product-attributes/get-attributes",
|
|
@@ -9,17 +9,17 @@ const a = {
|
|
|
9
9
|
MIGRATE_STRATEGIES_PATH: "/newsletter/recommendations/migrate-strategies",
|
|
10
10
|
// The template route narrows the recommendations resource before the action: the id
|
|
11
11
|
// travels in the body, not the path.
|
|
12
|
-
TEMPLATE_MIGRATE_STRATEGIES_PATH: "/newsletter/recommendations/template/migrate-strategies"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
const { RECOMMENDATION_STRATEGIES_PANEL_PATH: n } =
|
|
18
|
-
return `${n}/${e}/edit
|
|
19
|
-
}, m = {
|
|
20
|
-
campaign: a.MIGRATE_STRATEGIES_PATH,
|
|
21
|
-
template: a.TEMPLATE_MIGRATE_STRATEGIES_PATH
|
|
12
|
+
TEMPLATE_MIGRATE_STRATEGIES_PATH: "/newsletter/recommendations/template/migrate-strategies"
|
|
13
|
+
}, d = () => {
|
|
14
|
+
const { RECOMMENDATION_STRATEGIES_PANEL_PATH: e } = t;
|
|
15
|
+
return `${e}/create`;
|
|
16
|
+
}, m = (e) => {
|
|
17
|
+
const { RECOMMENDATION_STRATEGIES_PANEL_PATH: n } = t;
|
|
18
|
+
return `${n}/${e}/edit`;
|
|
22
19
|
}, T = {
|
|
20
|
+
campaign: t.MIGRATE_STRATEGIES_PATH,
|
|
21
|
+
template: t.TEMPLATE_MIGRATE_STRATEGIES_PATH
|
|
22
|
+
}, p = {
|
|
23
23
|
CLIENT_ID: "clientId"
|
|
24
24
|
}, E = () => {
|
|
25
25
|
const e = s();
|
|
@@ -85,21 +85,21 @@ const a = {
|
|
|
85
85
|
path: "top-sellers"
|
|
86
86
|
}
|
|
87
87
|
];
|
|
88
|
-
},
|
|
88
|
+
}, A = ["discount", "omnibus_price", "omnibus_discount", "price", "original_price"], v = [
|
|
89
89
|
{ text: "before the amount", value: "0" },
|
|
90
90
|
{ text: "after the amount", value: "1" }
|
|
91
|
-
],
|
|
91
|
+
], _ = [
|
|
92
92
|
{ text: "dot(.)", value: "." },
|
|
93
93
|
{ text: "comma(,)", value: "," },
|
|
94
94
|
{ text: "space( )", value: " " }
|
|
95
|
-
],
|
|
95
|
+
], h = [
|
|
96
96
|
{ text: "0", value: "0" },
|
|
97
97
|
{ text: "1", value: "1" },
|
|
98
98
|
{ text: "2", value: "2" },
|
|
99
99
|
{ text: "3", value: "3" },
|
|
100
100
|
{ text: "4", value: "4" },
|
|
101
101
|
{ text: "5", value: "5" }
|
|
102
|
-
], r = "||",
|
|
102
|
+
], r = "||", a = [
|
|
103
103
|
{ text: "is exactly", value: "=" },
|
|
104
104
|
{ text: "contains", value: "~" },
|
|
105
105
|
{ text: "does not contain", value: "!~" },
|
|
@@ -121,9 +121,9 @@ const a = {
|
|
|
121
121
|
], c = [
|
|
122
122
|
{ text: "true", value: "==" },
|
|
123
123
|
{ text: "false", value: "!=" }
|
|
124
|
-
],
|
|
124
|
+
], x = (e) => {
|
|
125
125
|
if (!e)
|
|
126
|
-
return
|
|
126
|
+
return a;
|
|
127
127
|
switch (e) {
|
|
128
128
|
case "Boolean":
|
|
129
129
|
return c;
|
|
@@ -132,28 +132,29 @@ const a = {
|
|
|
132
132
|
case "Number":
|
|
133
133
|
return i;
|
|
134
134
|
case "String":
|
|
135
|
-
return
|
|
135
|
+
return a;
|
|
136
136
|
case "Strings":
|
|
137
137
|
return o;
|
|
138
138
|
default:
|
|
139
|
-
return
|
|
139
|
+
return a;
|
|
140
140
|
}
|
|
141
141
|
};
|
|
142
142
|
export {
|
|
143
|
-
|
|
143
|
+
T as MIGRATION_PATHS,
|
|
144
144
|
r as OP_ANY_OF,
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
145
|
+
A as PriceAttributes,
|
|
146
|
+
p as QUERY_PARAMS,
|
|
147
|
+
t as URLS,
|
|
148
|
+
h as currencyDecimalCounts,
|
|
149
|
+
v as currencyLocationMaps,
|
|
150
|
+
_ as currencyOperators,
|
|
151
|
+
x as getOperatorOptions,
|
|
152
152
|
E as getRecommendationFeedSourceMaps,
|
|
153
153
|
o as operatorOptionsForArrayOfStrings,
|
|
154
154
|
c as operatorOptionsForBooleans,
|
|
155
155
|
u as operatorOptionsForDates,
|
|
156
156
|
i as operatorOptionsForNumbers,
|
|
157
|
-
|
|
158
|
-
d as
|
|
157
|
+
a as operatorOptionsForStrings,
|
|
158
|
+
d as strategyCreatePath,
|
|
159
|
+
m as strategyEditPath
|
|
159
160
|
};
|