@useinsider/guido 3.18.1-beta.d82285c → 3.18.1-beta.d931f79

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 (25) hide show
  1. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +1 -1
  2. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +65 -61
  3. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +23 -37
  4. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.js +3 -3
  5. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue2.js +21 -20
  6. package/dist/composables/useCustomInterfaceAppearance.js +56 -46
  7. package/dist/composables/useRecommendation.js +38 -36
  8. package/dist/composables/useStripo.js +30 -30
  9. package/dist/enums/extensions/recommendationBlock.js +5 -5
  10. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +21 -20
  11. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +58 -53
  12. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +81 -62
  13. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +159 -138
  14. package/dist/extensions/Blocks/Recommendation/utils/strategyDetach.js +19 -0
  15. package/dist/guido.css +1 -1
  16. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +1 -0
  17. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  18. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +2 -0
  19. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +8 -0
  20. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +30 -4
  21. package/dist/src/extensions/Blocks/Recommendation/utils/strategyDetach.d.ts +12 -0
  22. package/dist/static/styles/components/recommendation-strategy.css.js +19 -21
  23. package/dist/static/styles/components/skeleton.css.js +23 -0
  24. package/dist/utils/templatePreparation.js +10 -10
  25. package/package.json +1 -1
@@ -15,7 +15,7 @@ var a = function() {
15
15
  n,
16
16
  !1,
17
17
  null,
18
- "3bcefe18"
18
+ "6c26ded2"
19
19
  );
20
20
  const y = i.exports;
21
21
  export {
@@ -1,48 +1,47 @@
1
- import { defineComponent as E, defineAsyncComponent as u, ref as f, computed as c, watch as O } from "vue";
1
+ import { defineComponent as I, defineAsyncComponent as S, ref as T, computed as l, watch as h } from "vue";
2
2
  import "@useinsider/design-system-organisms/style";
3
- import { useToaster as h } from "../../../../composables/useToaster.js";
4
- import { useTranslations as A } from "../../../../composables/useTranslations.js";
5
- import { DOTTED_DATE_LOCALE as I } from "../../../../enums/date.js";
6
- import { URLS as C } from "../../../../enums/extensions/recommendationBlock.js";
7
- import { ToasterTypeOptions as d } from "../../../../enums/toaster.js";
8
- import { useRecommendationExtensionStore as B } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
9
- import b from "./StrategyInfoBoxContent.vue.js";
10
- import { formatShortDate as N } from "../../../../utils/dateUtil.js";
11
- import { asText as S } from "../../../../utils/genericUtil.js";
12
- import { escapeHtml as k } from "../../../../utils/htmlEscape.js";
13
- import { InSkeleton as P } from "@useinsider/design-system-vue";
14
- const Y = /* @__PURE__ */ E({
3
+ import { useToaster as A } from "../../../../composables/useToaster.js";
4
+ import { useTranslations as C } from "../../../../composables/useTranslations.js";
5
+ import { DOTTED_DATE_LOCALE as B } from "../../../../enums/date.js";
6
+ import { URLS as b } from "../../../../enums/extensions/recommendationBlock.js";
7
+ import { ToasterTypeOptions as m } from "../../../../enums/toaster.js";
8
+ import { useRecommendationExtensionStore as k } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
9
+ import { commitStrategyDetach as N } from "../../../../extensions/Blocks/Recommendation/utils/strategyDetach.js";
10
+ import R from "./StrategyInfoBoxContent.vue.js";
11
+ import { formatShortDate as P } from "../../../../utils/dateUtil.js";
12
+ import { asText as _ } from "../../../../utils/genericUtil.js";
13
+ import { escapeHtml as U } from "../../../../utils/htmlEscape.js";
14
+ import { InSkeleton as L } from "@useinsider/design-system-vue";
15
+ const rt = /* @__PURE__ */ I({
15
16
  __name: "AssignStrategyDrawer",
16
- setup(R) {
17
- const g = () => import("@useinsider/design-system-organisms"), m = (t, e) => ({
18
- render: (a) => a(P, { props: { sizing: { width: t, height: e } } })
19
- }), T = u({
17
+ setup(M) {
18
+ const g = () => import("@useinsider/design-system-organisms"), d = (t, r) => ({
19
+ render: (o) => o(L, { props: { sizing: { width: t, height: r } } })
20
+ }), D = S({
20
21
  loader: async () => (await g()).OrgStrategyDetailModal,
21
- loadingComponent: m(480, 240),
22
+ loadingComponent: d(480, 240),
22
23
  delay: 0
23
- }), _ = u({
24
- loader: async () => (await g()).OrgStrategyDropdown,
25
- loadingComponent: m(240, 42),
26
- delay: 0
27
- }), o = "guido-edit-strategy-", s = A(), r = B(), { showToaster: n } = h(), i = f(null), l = f(!1), D = c(() => r.assignStrategyDrawerStatus ? s("email-editor.assign-strategy-description", { url: C.RECOMMENDATION_STRATEGIES_PANEL_PATH }) : "");
28
- O(() => r.assignStrategyDrawerStatus, (t) => {
24
+ }), v = S({
25
+ loader: async () => (await g()).OrgStrategyDropdown
26
+ }), n = "guido-edit-strategy-", s = C(), e = k(), { showToaster: i } = A(), a = T(null), c = T(!1), w = l(() => e.assignStrategyDrawerStatus ? s("email-editor.assign-strategy-description", { url: b.RECOMMENDATION_STRATEGIES_PANEL_PATH }) : "");
27
+ h(() => e.assignStrategyDrawerStatus, (t) => {
29
28
  if (!t)
30
29
  return;
31
- const { strategyId: e } = r.recommendationConfigs;
32
- i.value = e || null, l.value = !1, r.fetchStrategies().catch(() => {
33
- n({
34
- type: d.Error,
30
+ const { strategyId: r } = e.recommendationConfigs;
31
+ a.value = r || null, c.value = !1, e.fetchStrategies().catch(() => {
32
+ i({
33
+ type: m.Error,
35
34
  message: s("discovery-strategy.error-description")
36
35
  });
37
36
  });
38
37
  });
39
- const p = (t) => {
40
- const e = S(t.updated_at || t.created_at);
41
- if (!e)
38
+ const u = (t) => {
39
+ const r = _(t.updated_at || t.created_at);
40
+ if (!r)
42
41
  return "";
43
- const a = N(e, I);
44
- return s("recommendation-strategy.last-updated-on", { value: a });
45
- }, w = c(() => r.strategies.map((t) => ({
42
+ const o = P(r, B);
43
+ return s("recommendation-strategy.last-updated-on", { value: o });
44
+ }, x = l(() => e.strategies.map((t) => ({
46
45
  text: t.name,
47
46
  value: t.strategy_id,
48
47
  infoBoxProps: {
@@ -50,15 +49,15 @@ const Y = /* @__PURE__ */ E({
50
49
  theme: "light",
51
50
  variant: "information",
52
51
  className: "assign-strategy-info-box",
53
- titleText: k(S(t.name)),
52
+ titleText: U(_(t.name)),
54
53
  descriptionStatus: !0,
55
- descriptionText: p(t),
56
- slot: b,
54
+ descriptionText: u(t),
55
+ slot: R,
57
56
  slotProps: { strategy: t },
58
57
  // The info box drops the option's value/text, so the id is the only channel
59
58
  // that can carry the strategy back to the click handler.
60
59
  buttonOptions: [{
61
- id: `${o}${t.strategy_id}`,
60
+ id: `${n}${t.strategy_id}`,
62
61
  text: s("eureka.edit-strategy"),
63
62
  type: "text",
64
63
  // Resolved from Guido's own public/sprite.svg by InIcons; an unknown name would
@@ -66,14 +65,19 @@ const Y = /* @__PURE__ */ E({
66
65
  icon: "line-open-website"
67
66
  }]
68
67
  }
69
- }))), v = (t) => {
70
- var a;
71
- const e = (a = t == null ? void 0 : t.id) != null && a.startsWith(o) ? t.id.slice(o.length) : "";
72
- e && r.openStrategyEdit(e);
73
- }, y = c(() => {
74
- const t = r.strategies.find((e) => String(e.strategy_id) === String(i.value ?? ""));
68
+ }))), E = (t) => {
69
+ var f;
70
+ const r = (f = t == null ? void 0 : t.id) != null && f.startsWith(n) ? t.id.slice(n.length) : "";
71
+ if (!r)
72
+ return;
73
+ const o = e.currentRecommendationId;
74
+ String(a.value ?? "") === r && (a.value = null);
75
+ const y = e.recommendationConfigs.strategyId === r;
76
+ y && e.removeStrategy(), e.openStrategyEdit(r), y && o !== null && N(o);
77
+ }, p = l(() => {
78
+ const t = e.strategies.find((r) => String(r.strategy_id) === String(a.value ?? ""));
75
79
  return t ? { ...t, fallback_config: null } : null;
76
- }), x = c(() => ({
80
+ }), O = l(() => ({
77
81
  primaryButton: {
78
82
  styling: "solid",
79
83
  type: "primary",
@@ -85,36 +89,36 @@ const Y = /* @__PURE__ */ E({
85
89
  labelText: s("products.cancel")
86
90
  }
87
91
  }));
88
- return { __sfc: !0, loadOrganisms: g, skeleton: m, OrgStrategyDetailModal: T, OrgStrategyDropdown: _, EDIT_BUTTON_ID_PREFIX: o, trans: s, store: r, showToaster: n, selectedStrategyId: i, showSelectionError: l, drawerDescription: D, lastUpdatedText: p, strategyOptions: w, onInfoBoxButtonClick: v, selectedStrategy: y, footerButtonGroupOptions: x, closeDrawer: () => {
89
- r.closeAssignStrategyDrawer();
92
+ return { __sfc: !0, loadOrganisms: g, skeleton: d, OrgStrategyDetailModal: D, OrgStrategyDropdown: v, EDIT_BUTTON_ID_PREFIX: n, trans: s, store: e, showToaster: i, selectedStrategyId: a, showSelectionError: c, drawerDescription: w, lastUpdatedText: u, strategyOptions: x, onInfoBoxButtonClick: E, selectedStrategy: p, footerButtonGroupOptions: O, closeDrawer: () => {
93
+ e.closeAssignStrategyDrawer();
90
94
  }, assignStrategy: async () => {
91
- const t = y.value;
95
+ const t = p.value;
92
96
  if (!t) {
93
- l.value = !0;
97
+ c.value = !0;
94
98
  return;
95
99
  }
96
- let e = "";
100
+ let r = "";
97
101
  try {
98
- e = await r.resolveStrategyUrlTemplate(t, r.recommendationConfigs.currencySettings.value);
99
- } catch (a) {
100
- console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed", a);
102
+ r = await e.resolveStrategyUrlTemplate(t, e.recommendationConfigs.currencySettings.value);
103
+ } catch (o) {
104
+ console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed", o);
101
105
  }
102
- if (!e) {
103
- n({
104
- type: d.Error,
106
+ if (!r) {
107
+ i({
108
+ type: m.Error,
105
109
  message: s("email-editor.strategy-assign-failed", { strategyName: t.name })
106
110
  });
107
111
  return;
108
112
  }
109
- r.assignStrategy(t), n({
110
- type: d.Success,
113
+ e.assignStrategy(t), i({
114
+ type: m.Success,
111
115
  message: s("email-editor.strategy-assigned-success", { strategyName: t.name })
112
- }), r.closeAssignStrategyDrawer();
116
+ }), e.closeAssignStrategyDrawer();
113
117
  }, onSelect: (t) => {
114
- i.value = t.value, l.value = !1;
118
+ a.value = t.value, c.value = !1;
115
119
  } };
116
120
  }
117
121
  });
118
122
  export {
119
- Y as default
123
+ rt as default
120
124
  };
@@ -1,15 +1,15 @@
1
- import { defineComponent as u, computed as n } from "vue";
2
- import y from "../../../wrappers/WpModal.vue.js";
3
- import { useToaster as f } from "../../../../composables/useToaster.js";
4
- import { useTranslations as _ } from "../../../../composables/useTranslations.js";
5
- import { ToasterTypeOptions as v } from "../../../../enums/toaster.js";
6
- import { useRecommendationExtensionStore as T } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
7
- import { commitBlockChangeOutsidePanel as h } from "../../../../extensions/Blocks/Recommendation/utils/nodeConfigWriter.js";
8
- import { escapeHtml as R } from "../../../../utils/htmlEscape.js";
9
- const P = /* @__PURE__ */ u({
1
+ import { defineComponent as l, computed as a } from "vue";
2
+ import d from "../../../wrappers/WpModal.vue.js";
3
+ import { useToaster as g } from "../../../../composables/useToaster.js";
4
+ import { useTranslations as y } from "../../../../composables/useTranslations.js";
5
+ import { ToasterTypeOptions as u } from "../../../../enums/toaster.js";
6
+ import { useRecommendationExtensionStore as f } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
7
+ import { commitStrategyDetach as _ } from "../../../../extensions/Blocks/Recommendation/utils/strategyDetach.js";
8
+ import { escapeHtml as T } from "../../../../utils/htmlEscape.js";
9
+ const C = /* @__PURE__ */ l({
10
10
  __name: "RemoveStrategyModal",
11
- setup(S) {
12
- const t = _(), e = T(), { showToaster: a } = f(), i = n(() => ({
11
+ setup(v) {
12
+ const t = y(), e = f(), { showToaster: n } = g(), i = a(() => ({
13
13
  cancelOrBackButton: {
14
14
  type: "secondary",
15
15
  labelText: t("products.cancel"),
@@ -19,39 +19,25 @@ const P = /* @__PURE__ */ u({
19
19
  type: "danger",
20
20
  labelText: t("discovery-strategy.remove")
21
21
  }
22
- })), m = n(() => {
22
+ })), m = a(() => {
23
23
  var o;
24
- const { strategyId: r } = e.recommendationConfigs;
25
- return ((o = e.assignedStrategy) == null ? void 0 : o.name) || `#${r}`;
26
- }), s = "__STRATEGY_NAME__", d = n(() => t("email-editor.remove-strategy-confirm-message", { strategyName: s }).split(s)), c = () => {
24
+ const { strategyId: s } = e.recommendationConfigs;
25
+ return ((o = e.assignedStrategy) == null ? void 0 : o.name) || `#${s}`;
26
+ }), r = "__STRATEGY_NAME__", p = a(() => t("email-editor.remove-strategy-confirm-message", { strategyName: r }).split(r)), c = () => {
27
27
  e.closeRemoveStrategyModal();
28
28
  };
29
- return { __sfc: !0, trans: t, store: e, showToaster: a, footerButtonOptions: i, strategyName: m, NAME_TOKEN: s, messageParts: d, close: c, handleConfirm: async () => {
30
- const r = m.value, o = e.currentRecommendationId;
31
- e.removeStrategy(), c();
32
- const { strategyId: l, size: g } = e.recommendationConfigs;
33
- if (a({
34
- type: v.Success,
29
+ return { __sfc: !0, trans: t, store: e, showToaster: n, footerButtonOptions: i, strategyName: m, NAME_TOKEN: r, messageParts: p, close: c, handleConfirm: async () => {
30
+ const s = m.value, o = e.currentRecommendationId;
31
+ e.removeStrategy(), c(), n({
32
+ type: u.Success,
35
33
  // The toast renders through a sanitizing v-html, so the name is escaped first.
36
34
  message: t("email-editor.strategy-removed-success", {
37
- strategyName: `<b>${R(r)}</b>`
35
+ strategyName: `<b>${T(s)}</b>`
38
36
  })
39
- }), o !== null) {
40
- try {
41
- await e.fetchRecommendationProducts();
42
- } catch (p) {
43
- console.error("[RemoveStrategyModal] product refetch failed", p);
44
- }
45
- h(
46
- o,
47
- { strategyId: l, size: g },
48
- e.recommendationProducts,
49
- "Removed recommendation strategy"
50
- );
51
- }
52
- }, WpModal: y };
37
+ }), o !== null && await _(o);
38
+ }, WpModal: d };
53
39
  }
54
40
  });
55
41
  export {
56
- P as default
42
+ C as default
57
43
  };
@@ -2,9 +2,9 @@ import d from "./RecommendationStrategyOnboarding.vue2.js";
2
2
  /* empty css */
3
3
  import g from "../../../_virtual/_plugin-vue2_normalizer.js";
4
4
  var m = function() {
5
- var e, n, r, a, i;
5
+ var e, n, r, i, a;
6
6
  var t = this, s = t._self._c, o = t._self._setupProxy;
7
- return o.isVisible ? s(o.InOnboard, { key: "guido__recommendation-strategy-onboard", staticClass: "w-21-s p-a z-11", class: (e = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : e.classes, attrs: { id: "guido__recommendation-strategy-onboard", "is-multiple-page": "", visible: "", "image-source": "", title: "", "left-position": (n = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : n.left, "pages-config": o.onboardingStore.onboardings.recommendationStrategyOnboarding.config, "pointer-position": (r = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : r.position, "right-position": (a = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : a.right, "top-position": (i = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : i.top }, on: { close: function(p) {
7
+ return o.isVisible ? s(o.InOnboard, { key: "guido__recommendation-strategy-onboard", staticClass: "w-21-s p-a z-11", class: (e = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : e.classes, attrs: { id: "guido__recommendation-strategy-onboard", "is-multiple-page": "", visible: "", "image-source": "", title: "", "left-position": (n = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : n.left, "pages-config": o.onboardingStore.onboardings.recommendationStrategyOnboarding.config, "pointer-position": (r = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : r.position, "right-position": (i = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : i.right, "top-position": (a = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : a.top }, on: { close: function(p) {
8
8
  return o.onboardingStore.close(o.ONBOARDING_TYPE);
9
9
  }, nextButtonClick: o.handleNext } }) : t._e();
10
10
  }, c = [], _ = /* @__PURE__ */ g(
@@ -13,7 +13,7 @@ var m = function() {
13
13
  c,
14
14
  !1,
15
15
  null,
16
- "1f4a4044"
16
+ "ec2027ff"
17
17
  );
18
18
  const S = _.exports;
19
19
  export {
@@ -1,46 +1,47 @@
1
- import { defineComponent as c, computed as g, watch as b } from "vue";
2
- import { useRibbonOffset as p } from "../../../composables/useRibbonOffset.js";
3
- import { useTranslations as u } from "../../../composables/useTranslations.js";
4
- import { ACADEMY_LINKS as l } from "../../../enums/academy.js";
5
- import { useOnboardingStore as f } from "../../../stores/onboarding.js";
6
- import { InOnboard as O } from "@useinsider/design-system-vue";
7
- const B = /* @__PURE__ */ c({
1
+ import { defineComponent as g, computed as p, watch as b } from "vue";
2
+ import { useRibbonOffset as u } from "../../../composables/useRibbonOffset.js";
3
+ import { useTranslations as l } from "../../../composables/useTranslations.js";
4
+ import { ACADEMY_LINKS as f } from "../../../enums/academy.js";
5
+ import { useRecommendationExtensionStore as O } from "../../../extensions/Blocks/Recommendation/store/recommendation.js";
6
+ import { useOnboardingStore as _ } from "../../../stores/onboarding.js";
7
+ import { InOnboard as y } from "@useinsider/design-system-vue";
8
+ const h = /* @__PURE__ */ g({
8
9
  __name: "RecommendationStrategyOnboarding",
9
- setup(_) {
10
- const e = "recommendationStrategyOnboarding", n = u(), t = f(), { getTopPosition: i } = p(), r = `<a href="${l.EMAIL_RECOMMENDATION_BLOCK}" target="_blank" rel="noopener noreferrer">${n("action-builder.visit-academy")}</a>`, a = () => [
10
+ setup(C) {
11
+ const n = "recommendationStrategyOnboarding", e = l(), t = _(), i = O(), { getTopPosition: r } = u(), a = `<a href="${f.EMAIL_RECOMMENDATION_BLOCK}" target="_blank" rel="noopener noreferrer">${e("action-builder.visit-academy")}</a>`, m = () => [
11
12
  {
12
13
  classes: "guido-recommendation-strategy-onboarding",
13
14
  // Sits in the gap left of the settings panel and points at the strategy section, which
14
15
  // starts 208px down: the panel header and its tab row are fixed chrome above it.
15
16
  right: "426px",
16
- top: i(208),
17
+ top: r(208),
17
18
  position: "Right Top",
18
- title: n("email-editor.onboarding-recommendation-strategy-title"),
19
- description: n("email-editor.onboarding-recommendation-strategy-description", {
20
- academyLink: r
19
+ title: e("email-editor.onboarding-recommendation-strategy-title"),
20
+ description: e("email-editor.onboarding-recommendation-strategy-description", {
21
+ academyLink: a
21
22
  }),
22
23
  imageSource: "",
23
24
  backButtonClick: () => {
24
25
  },
25
26
  nextButtonType: "text",
26
- nextButtonText: n("action-builder.ok"),
27
+ nextButtonText: e("action-builder.ok"),
27
28
  nextButtonClick: () => {
28
- t.close(e);
29
+ t.close(n);
29
30
  }
30
31
  }
31
- ], m = g(() => t.onboardings.recommendationStrategyOnboarding.config.length > 0 && t.onboardings.recommendationStrategyOnboarding.isActive), d = () => {
32
+ ], c = p(() => i.strategyPanelOpen && t.onboardings.recommendationStrategyOnboarding.config.length > 0 && t.onboardings.recommendationStrategyOnboarding.isActive), d = () => {
32
33
  var o, s;
33
34
  (s = (o = t.getRecommendationStrategyCurrentCard) == null ? void 0 : o.nextButtonClick) == null || s.call(o);
34
35
  };
35
36
  return b(
36
- () => t.isActive(e),
37
+ () => t.isActive(n),
37
38
  (o) => {
38
- o && t.setConfig(e, a());
39
+ o && t.setConfig(n, m());
39
40
  },
40
41
  { immediate: !0 }
41
- ), { __sfc: !0, ONBOARDING_TYPE: e, trans: n, onboardingStore: t, getTopPosition: i, academyLink: r, buildOnboardingCards: a, isVisible: m, handleNext: d, InOnboard: O };
42
+ ), { __sfc: !0, ONBOARDING_TYPE: n, trans: e, onboardingStore: t, recommendationStore: i, getTopPosition: r, academyLink: a, buildOnboardingCards: m, isVisible: c, handleNext: d, InOnboard: y };
42
43
  }
43
44
  });
44
45
  export {
45
- B as default
46
+ h as default
46
47
  };
@@ -1,67 +1,77 @@
1
- import S from "../static/assets/icons/line-change.svg.js";
2
- import i from "../static/assets/icons/line-delete.svg.js";
3
- import n from "../static/assets/icons/line-plus.svg.js";
4
- import p from "../static/styles/base.css.js";
5
- import s from "../static/styles/components/alert-message.css.js";
6
- import C from "../static/styles/components/amp-block.css.js";
7
- import a from "../static/styles/components/base-input.css.js";
8
- import f from "../static/styles/components/button-group.css.js";
9
- import c from "../static/styles/components/button.css.js";
10
- import u from "../static/styles/components/combobox.css.js";
11
- import l from "../static/styles/components/counter.css.js";
12
- import d from "../static/styles/components/dropdown-menu.css.js";
13
- import h from "../static/styles/components/loader.css.js";
14
- import g from "../static/styles/components/narrow-panel.css.js";
15
- import I from "../static/styles/components/popup.css.js";
16
- import w from "../static/styles/components/recommendation-strategy.css.js";
17
- import y from "../static/styles/components/switcher.css.js";
18
- import b from "../static/styles/components/tabs.css.js";
19
- import B from "../static/styles/components/tools.css.js";
20
- import $ from "../static/styles/components/version-history.css.js";
21
- import P from "../static/styles/components/wide-panel.css.js";
1
+ import p from "../static/assets/icons/line-change.svg.js";
2
+ import s from "../static/assets/icons/line-delete.svg.js";
3
+ import a from "../static/assets/icons/line-plus.svg.js";
4
+ import f from "../static/styles/base.css.js";
5
+ import C from "../static/styles/components/alert-message.css.js";
6
+ import c from "../static/styles/components/amp-block.css.js";
7
+ import l from "../static/styles/components/base-input.css.js";
8
+ import d from "../static/styles/components/button-group.css.js";
9
+ import u from "../static/styles/components/button.css.js";
10
+ import h from "../static/styles/components/combobox.css.js";
11
+ import g from "../static/styles/components/counter.css.js";
12
+ import w from "../static/styles/components/dropdown-menu.css.js";
13
+ import y from "../static/styles/components/loader.css.js";
14
+ import I from "../static/styles/components/narrow-panel.css.js";
15
+ import A from "../static/styles/components/popup.css.js";
16
+ import b from "../static/styles/components/recommendation-strategy.css.js";
17
+ import B from "../static/styles/components/skeleton.css.js";
18
+ import D from "../static/styles/components/switcher.css.js";
19
+ import $ from "../static/styles/components/tabs.css.js";
20
+ import P from "../static/styles/components/tools.css.js";
21
+ import R from "../static/styles/components/version-history.css.js";
22
+ import T from "../static/styles/components/wide-panel.css.js";
22
23
  import x from "../static/styles/variables.css.js";
23
- function r(t, o) {
24
- return `--guido-icon-${t}: url("data:image/svg+xml,${encodeURIComponent(o.trim())}");`;
24
+ function r(S, o) {
25
+ return `--guido-icon-${S}: url("data:image/svg+xml,${encodeURIComponent(o.trim())}");`;
25
26
  }
26
- const A = `:host {
27
- ${r("line-change", S)}
28
- ${r("line-delete", i)}
29
- ${r("line-plus", n)}
30
- }`, R = [
27
+ const M = `:host {
28
+ ${r("line-change", p)}
29
+ ${r("line-delete", s)}
30
+ ${r("line-plus", a)}
31
+ }`, O = [
31
32
  x,
32
33
  // Must be on top
33
- A,
34
- p,
34
+ M,
35
+ f,
35
36
  // Must be on top
36
- s,
37
37
  C,
38
- a,
39
- f,
40
38
  c,
41
- u,
42
39
  l,
43
40
  d,
41
+ u,
44
42
  h,
45
43
  g,
46
- I,
44
+ w,
47
45
  y,
48
- b,
46
+ I,
47
+ A,
49
48
  B,
49
+ D,
50
50
  $,
51
51
  P,
52
- w
52
+ R,
53
+ T,
54
+ b
53
55
  // Last: overrides button.css / wide-panel.css defaults
54
56
  ].join(`
55
57
 
56
- `), Y = () => ({ importCss: () => {
57
- const o = new CSSStyleSheet();
58
- o.replaceSync(R);
59
- const e = document.querySelector("ui-editor");
60
- if (!e)
61
- return;
62
- const m = e.shadowRoot;
63
- m && (m.adoptedStyleSheets = [o]);
58
+ `), V = 3e4;
59
+ let e = null;
60
+ function W() {
61
+ return e || (e = new CSSStyleSheet(), e.replaceSync(O)), e;
62
+ }
63
+ const So = () => ({ importCss: () => {
64
+ const o = W(), i = Date.now() + V, m = () => {
65
+ var n;
66
+ const t = (n = document.querySelector("ui-editor")) == null ? void 0 : n.shadowRoot;
67
+ if (t) {
68
+ t.adoptedStyleSheets.includes(o) || (t.adoptedStyleSheets = [...t.adoptedStyleSheets, o]);
69
+ return;
70
+ }
71
+ Date.now() < i && requestAnimationFrame(m);
72
+ };
73
+ m();
64
74
  } });
65
75
  export {
66
- Y as useCustomInterfaceAppearance
76
+ So as useCustomInterfaceAppearance
67
77
  };
@@ -1,23 +1,23 @@
1
1
  import { getRecommendationFeedSourceMaps as y, URLS as I } from "../enums/extensions/recommendationBlock.js";
2
2
  import { MinDeviceViewport as C, DefaultPadding as R } from "../enums/recommendation.js";
3
- import { useRecommendationExtensionStore as f } from "../extensions/Blocks/Recommendation/store/recommendation.js";
3
+ import { useRecommendationExtensionStore as g } from "../extensions/Blocks/Recommendation/store/recommendation.js";
4
4
  import { generateCompleteFilterQuery as b } from "../extensions/Blocks/Recommendation/utils/filterUtil.js";
5
5
  import { getPartnerRecommendationParams as h } from "../extensions/Blocks/Recommendation/utils/partnerCustomizations.js";
6
6
  import { sanitizeProductIds as x } from "../extensions/Blocks/Recommendation/utils/productIds.js";
7
7
  import { useConfigStore as P } from "../stores/config.js";
8
8
  const B = () => ({
9
9
  calculateCardWidth: ({
10
- mobileLeftPadding: a,
10
+ mobileLeftPadding: s,
11
11
  mobileRightPadding: c,
12
- cardsInRow: i,
13
- unresponsive: n
12
+ cardsInRow: o,
13
+ unresponsive: a
14
14
  }) => {
15
- const o = n ? i : 1, e = a + c + (o - 1) * R;
16
- return (C - e) / o;
15
+ const i = a ? o : 1, e = s + c + (i - 1) * R;
16
+ return (C - e) / i;
17
17
  },
18
- getRecommendationCampaignData: (a) => {
19
- const c = f(), i = Number(a), n = c.blockStates[i];
20
- if (!n)
18
+ getRecommendationCampaignData: (s) => {
19
+ const c = g(), o = Number(s), a = c.blockStates[o];
20
+ if (!a)
21
21
  return {
22
22
  textTrimming: !1,
23
23
  orientation: "vertical",
@@ -30,57 +30,59 @@ const B = () => ({
30
30
  discountBeforeTextValue: "",
31
31
  discountAfterTextValue: ""
32
32
  };
33
- const { recommendationConfigs: o } = n, e = o.orientation === "grid" ? "vertical" : "horizontal";
33
+ const { recommendationConfigs: i } = a, e = i.orientation === "grid" ? "vertical" : "horizontal";
34
34
  return {
35
- textTrimming: o.textTrimming,
35
+ textTrimming: i.textTrimming,
36
36
  orientation: e,
37
37
  mobileLeftPadding: 0,
38
38
  mobileRightPadding: 0,
39
- cardsInRow: o.cardsInRow,
40
- unresponsive: o.unresponsive,
39
+ cardsInRow: i.cardsInRow,
40
+ unresponsive: i.unresponsive,
41
41
  priceBeforeTextValue: "",
42
42
  priceAfterTextValue: "",
43
43
  discountBeforeTextValue: "",
44
44
  discountAfterTextValue: ""
45
45
  };
46
46
  },
47
- buildCampaignUrl: (a, c) => {
47
+ buildCampaignUrl: (s, c) => {
48
48
  var l;
49
- const i = f(), n = P(), o = Number(a);
49
+ const o = g(), a = P(), i = Number(s);
50
50
  let e;
51
51
  if (c)
52
52
  e = c;
53
53
  else {
54
- const s = i.blockStates[o];
55
- if (!s)
54
+ const r = o.blockStates[i];
55
+ if (!r)
56
56
  return "";
57
- const { recommendationConfigs: r } = s;
57
+ const { recommendationConfigs: n } = r;
58
58
  e = {
59
- strategy: r.strategy,
60
- strategyId: r.strategyId,
61
- language: r.language,
62
- currencyCode: r.currencySettings.value,
63
- size: r.size,
64
- productIds: r.productIds,
65
- filters: r.filters,
66
- shuffleProducts: r.shuffleProducts
59
+ strategy: n.strategy,
60
+ strategyId: n.strategyId,
61
+ language: n.language,
62
+ currencyCode: n.currencySettings.value,
63
+ size: n.size,
64
+ productIds: n.productIds,
65
+ filters: n.filters,
66
+ shuffleProducts: n.shuffleProducts
67
67
  };
68
68
  }
69
- if (e.strategyId && n.isFeatureEnabled("reusableRecommendationStrategy"))
70
- return i.recommendationCampaignUrls[a] = {
69
+ if (e.strategyId && a.isFeatureEnabled("reusableRecommendationStrategy"))
70
+ return o.recommendationCampaignUrls[s] = {
71
71
  strategyId: e.strategyId,
72
72
  locale: e.language,
73
73
  currency: e.currencyCode
74
74
  }, "";
75
- const d = ((l = y().find((s) => s.key === e.strategy)) == null ? void 0 : l.path) || "";
76
- if (!d)
77
- return delete i.recommendationCampaignUrls[a], "";
75
+ const d = ((l = y().find((r) => r.key === e.strategy)) == null ? void 0 : l.path) || "";
76
+ if (!d) {
77
+ const r = { ...o.recommendationCampaignUrls };
78
+ return delete r[s], o.recommendationCampaignUrls = r, "";
79
+ }
78
80
  const t = new URLSearchParams();
79
- t.set("locale", e.language), t.set("currency", e.currencyCode), t.set("partnerName", n.partnerName), t.set("size", e.size), t.set("details", "true"), t.set("campaignId", n.variationId), e.strategy === "manualMerchandising" ? t.set("productId", x(e.productIds)) : e.strategy === "similarViewed" && t.set("productId", "{itemId}"), e.strategy === "userBased" && t.set("userId", "{user_id}");
80
- const g = e.filters.filter((s) => s.isValid), u = b(g);
81
- u && t.set("filter", u), e.shuffleProducts && t.set("shuffle", "true"), Object.entries(h(n.partnerName, e.strategy)).forEach(([s, r]) => t.set(s, r));
82
- const p = decodeURIComponent(t.toString()), m = `${I.RECOMMENDATION_API_URL}/v2/${d}?${p}`;
83
- return i.recommendationCampaignUrls[a] = m, m;
81
+ t.set("locale", e.language), t.set("currency", e.currencyCode), t.set("partnerName", a.partnerName), t.set("size", e.size), t.set("details", "true"), t.set("campaignId", a.variationId), e.strategy === "manualMerchandising" ? t.set("productId", x(e.productIds)) : e.strategy === "similarViewed" && t.set("productId", "{itemId}"), e.strategy === "userBased" && t.set("userId", "{user_id}");
82
+ const f = e.filters.filter((r) => r.isValid), m = b(f);
83
+ m && t.set("filter", m), e.shuffleProducts && t.set("shuffle", "true"), Object.entries(h(a.partnerName, e.strategy)).forEach(([r, n]) => t.set(r, n));
84
+ const p = decodeURIComponent(t.toString()), u = `${I.RECOMMENDATION_API_URL}/v2/${d}?${p}`;
85
+ return o.recommendationCampaignUrls[s] = u, u;
84
86
  }
85
87
  });
86
88
  export {