@useinsider/guido 3.27.0-beta.3e42e7a → 3.27.0-beta.5a8ee27

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 (37) hide show
  1. package/dist/components/Guido.vue.js +1 -1
  2. package/dist/components/Guido.vue2.js +46 -45
  3. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +5 -6
  4. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +19 -18
  5. package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +5 -5
  6. package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +15 -15
  7. package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +6 -6
  8. package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +28 -27
  9. package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.js +3 -3
  10. package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue2.js +42 -27
  11. package/dist/composables/useCustomInterfaceAppearance.js +50 -50
  12. package/dist/composables/useFullStoryBridge.js +10 -9
  13. package/dist/extensions/Blocks/Recommendation/controls/main/filters.js +14 -14
  14. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +52 -40
  15. package/dist/extensions/Blocks/Recommendation/controls/syncInfoMessage.js +15 -15
  16. package/dist/extensions/Blocks/Recommendation/utils/priceFormatter.js +17 -15
  17. package/dist/extensions/Blocks/common-control.js +25 -25
  18. package/dist/extensions/DynamicContent/dynamic-content.js +15 -17
  19. package/dist/guido.css +1 -1
  20. package/dist/package.json.js +1 -1
  21. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +2 -0
  22. package/dist/src/extensions/Blocks/common-control.d.ts +1 -1
  23. package/dist/src/stores/onboarding.d.ts +1 -0
  24. package/dist/src/utils/editorShadowRoot.d.ts +1 -0
  25. package/dist/stores/onboarding.js +4 -1
  26. package/dist/utils/editorShadowRoot.js +8 -0
  27. package/package.json +11 -3
  28. package/dist/src/extensions/Blocks/_Boilerplate/block.d.ts +0 -11
  29. package/dist/src/extensions/Blocks/_Boilerplate/constants/controlIds.d.ts +0 -7
  30. package/dist/src/extensions/Blocks/_Boilerplate/constants/index.d.ts +0 -10
  31. package/dist/src/extensions/Blocks/_Boilerplate/constants/selectors.d.ts +0 -16
  32. package/dist/src/extensions/Blocks/_Boilerplate/control.d.ts +0 -17
  33. package/dist/src/extensions/Blocks/_Boilerplate/controls/blockBackground/index.d.ts +0 -15
  34. package/dist/src/extensions/Blocks/_Boilerplate/extension.d.ts +0 -2
  35. package/dist/src/extensions/Blocks/_Boilerplate/iconsRegistry.d.ts +0 -4
  36. package/dist/src/extensions/Blocks/_Boilerplate/settingsPanel.d.ts +0 -4
  37. package/dist/src/extensions/Blocks/_Boilerplate/template.d.ts +0 -6
@@ -1,46 +1,61 @@
1
- import { defineComponent as d, computed as g, watch as l } from "vue";
2
- import { useRibbonOffset as b } from "../../../composables/useRibbonOffset.js";
3
- import { useTranslations as p } from "../../../composables/useTranslations.js";
4
- import { ACADEMY_LINKS as u } from "../../../enums/academy.js";
5
- import { useOnboardingStore as y } from "../../../stores/onboarding.js";
6
- import { InOnboard as f } from "@useinsider/design-system-vue";
7
- const A = /* @__PURE__ */ d({
1
+ import { defineComponent as E, computed as _, onMounted as L, onBeforeUnmount as O } from "vue";
2
+ import { useRibbonOffset as S } from "../../../composables/useRibbonOffset.js";
3
+ import { useTranslations as C } from "../../../composables/useTranslations.js";
4
+ import { ACADEMY_LINKS as h } from "../../../enums/academy.js";
5
+ import { useOnboardingStore as k } from "../../../stores/onboarding.js";
6
+ import { findEditorShadowRoot as v } from "../../../utils/editorShadowRoot.js";
7
+ import { InOnboard as B } from "@useinsider/design-system-vue";
8
+ const F = /* @__PURE__ */ E({
8
9
  __name: "RecommendationLegacyStrategyOnboarding",
9
- setup(O) {
10
- const n = "recommendationLegacyStrategyOnboarding", o = p(), t = y(), { getTopPosition: i } = b(), r = `<a href="${u.EMAIL_RECOMMENDATION_BLOCK}" target="_blank" rel="noopener noreferrer">${o("action-builder.visit-academy")}</a>`, a = () => [
10
+ setup(T) {
11
+ const a = "recommendationLegacyStrategyOnboarding", l = "#guido__btn-update-legacy-strategy", i = C(), t = k(), { getTopPosition: m } = S(), u = `<a href="${h.EMAIL_RECOMMENDATION_BLOCK}" target="_blank" rel="noopener noreferrer">${i("action-builder.visit-academy")}</a>`, g = () => [
11
12
  {
12
13
  classes: "guido-recommendation-legacy-strategy-onboarding",
13
14
  right: "40px",
14
- top: i(485),
15
+ top: m(500),
15
16
  position: "Top Right",
16
- title: o("email-editor.onboarding-recommendation-strategy-legacy-title"),
17
- description: o("email-editor.onboarding-recommendation-strategy-legacy-description", {
18
- academyLink: r
17
+ title: i("email-editor.onboarding-recommendation-strategy-legacy-title"),
18
+ description: i("email-editor.onboarding-recommendation-strategy-legacy-description", {
19
+ academyLink: u
19
20
  }),
20
21
  imageSource: "",
21
22
  backButtonClick: () => {
22
23
  },
23
24
  nextButtonType: "text",
24
- nextButtonText: o("action-builder.ok"),
25
+ nextButtonText: i("action-builder.ok"),
25
26
  nextButtonClick: () => {
26
- t.close(n);
27
+ t.close(a);
27
28
  }
28
29
  }
29
- ], s = g(
30
+ ], y = _(
30
31
  () => t.onboardings.recommendationLegacyStrategyOnboarding.config.length > 0 && t.onboardings.recommendationLegacyStrategyOnboarding.isActive
31
- ), m = () => {
32
- var e, c;
33
- (c = (e = t.getRecommendationLegacyStrategyCurrentCard) == null ? void 0 : e.nextButtonClick) == null || c.call(e);
32
+ ), b = () => {
33
+ var n, o;
34
+ (o = (n = t.getRecommendationLegacyStrategyCurrentCard) == null ? void 0 : n.nextButtonClick) == null || o.call(n);
34
35
  };
35
- return l(
36
- () => t.isActive(n),
37
- (e) => {
38
- e && t.setConfig(n, a());
39
- },
40
- { immediate: !0 }
41
- ), { __sfc: !0, ONBOARDING_TYPE: n, trans: o, onboardingStore: t, getTopPosition: i, academyLink: r, buildOnboardingCards: a, isVisible: s, handleNext: m, InOnboard: f };
36
+ let e = null;
37
+ const s = ({ target: n }) => {
38
+ n instanceof Element && n.closest("ue-control-panel") && t.closeForSession(a);
39
+ };
40
+ let r = null;
41
+ const d = (n) => {
42
+ var o;
43
+ return !!((o = n.querySelector(l)) != null && o.getClientRects().length);
44
+ }, c = ({ target: n }) => {
45
+ const o = n instanceof Element ? n.closest("ue-control-panel") : null;
46
+ !o || r !== null || (r = requestAnimationFrame(() => {
47
+ r = null, d(o) || t.closeForSession(a);
48
+ }));
49
+ }, p = () => {
50
+ e == null || e.removeEventListener("scroll", s, !0), e == null || e.removeEventListener("click", c, !0), e == null || e.removeEventListener("keyup", c, !0), e = null, r !== null && (cancelAnimationFrame(r), r = null);
51
+ }, f = () => {
52
+ e = v(), e == null || e.addEventListener("scroll", s, !0), e == null || e.addEventListener("click", c, !0), e == null || e.addEventListener("keyup", c, !0);
53
+ };
54
+ return L(() => {
55
+ t.setConfig(a, g()), f();
56
+ }), O(p), { __sfc: !0, ONBOARDING_TYPE: a, UPDATE_BUTTON_SELECTOR: l, trans: i, onboardingStore: t, getTopPosition: m, academyLink: u, buildOnboardingCards: g, isVisible: y, handleNext: b, editorRoot: e, handlePanelScroll: s, pendingCheck: r, isUpdateButtonVisible: d, handlePanelInteraction: c, stopWatchingPanel: p, startWatchingPanel: f, InOnboard: B };
42
57
  }
43
58
  });
44
59
  export {
45
- A as default
60
+ F as default
46
61
  };
@@ -1,44 +1,46 @@
1
- import p from "../static/assets/icons/filled-arrow-rising.svg.js";
2
- import s from "../static/assets/icons/line-change.svg.js";
3
- import f from "../static/assets/icons/line-delete.svg.js";
4
- import a from "../static/assets/icons/line-info.svg.js";
5
- import c from "../static/assets/icons/line-plus.svg.js";
6
- import l from "../static/styles/base.css.js";
7
- import C from "../static/styles/components/accessibility.css.js";
8
- import d from "../static/styles/components/alert-message.css.js";
9
- import u from "../static/styles/components/amp-block.css.js";
10
- import h from "../static/styles/components/base-input.css.js";
11
- import I from "../static/styles/components/button-group.css.js";
12
- import g from "../static/styles/components/button.css.js";
13
- import w from "../static/styles/components/combobox.css.js";
14
- import y from "../static/styles/components/counter.css.js";
15
- import A from "../static/styles/components/dropdown-menu.css.js";
16
- import $ from "../static/styles/components/loader.css.js";
17
- import b from "../static/styles/components/narrow-panel.css.js";
18
- import B from "../static/styles/components/popup.css.js";
19
- import D from "../static/styles/components/recommendation-strategy.css.js";
20
- import R from "../static/styles/components/skeleton.css.js";
21
- import P from "../static/styles/components/switcher.css.js";
22
- import T from "../static/styles/components/tabs.css.js";
23
- import x from "../static/styles/components/tools.css.js";
24
- import M from "../static/styles/components/version-history.css.js";
25
- import O from "../static/styles/components/wide-panel.css.js";
26
- import V from "../static/styles/variables.css.js";
1
+ import S from "../static/assets/icons/filled-arrow-rising.svg.js";
2
+ import p from "../static/assets/icons/line-change.svg.js";
3
+ import s from "../static/assets/icons/line-delete.svg.js";
4
+ import f from "../static/assets/icons/line-info.svg.js";
5
+ import a from "../static/assets/icons/line-plus.svg.js";
6
+ import c from "../static/styles/base.css.js";
7
+ import l from "../static/styles/components/accessibility.css.js";
8
+ import C from "../static/styles/components/alert-message.css.js";
9
+ import d from "../static/styles/components/amp-block.css.js";
10
+ import u from "../static/styles/components/base-input.css.js";
11
+ import h from "../static/styles/components/button-group.css.js";
12
+ import I from "../static/styles/components/button.css.js";
13
+ import g from "../static/styles/components/combobox.css.js";
14
+ import w from "../static/styles/components/counter.css.js";
15
+ import y from "../static/styles/components/dropdown-menu.css.js";
16
+ import A from "../static/styles/components/loader.css.js";
17
+ import $ from "../static/styles/components/narrow-panel.css.js";
18
+ import b from "../static/styles/components/popup.css.js";
19
+ import B from "../static/styles/components/recommendation-strategy.css.js";
20
+ import D from "../static/styles/components/skeleton.css.js";
21
+ import R from "../static/styles/components/switcher.css.js";
22
+ import P from "../static/styles/components/tabs.css.js";
23
+ import T from "../static/styles/components/tools.css.js";
24
+ import x from "../static/styles/components/version-history.css.js";
25
+ import E from "../static/styles/components/wide-panel.css.js";
26
+ import M from "../static/styles/variables.css.js";
27
+ import { findEditorShadowRoot as O } from "../utils/editorShadowRoot.js";
27
28
  function o(i, r) {
28
29
  return `--guido-icon-${i}: url("data:image/svg+xml,${encodeURIComponent(r.trim())}");`;
29
30
  }
30
- const W = `:host {
31
- ${o("line-change", s)}
32
- ${o("line-delete", f)}
33
- ${o("filled-arrow-rising", p)}
34
- ${o("line-info", a)}
35
- ${o("line-plus", c)}
36
- }`, _ = [
37
- V,
31
+ const V = `:host {
32
+ ${o("line-change", p)}
33
+ ${o("line-delete", s)}
34
+ ${o("filled-arrow-rising", S)}
35
+ ${o("line-info", f)}
36
+ ${o("line-plus", a)}
37
+ }`, W = [
38
+ M,
38
39
  // Must be on top
39
- W,
40
- l,
40
+ V,
41
+ c,
41
42
  // Must be on top
43
+ C,
42
44
  d,
43
45
  u,
44
46
  h,
@@ -49,34 +51,32 @@ const W = `:host {
49
51
  A,
50
52
  $,
51
53
  b,
52
- B,
54
+ D,
53
55
  R,
54
56
  P,
55
57
  T,
56
58
  x,
57
- M,
58
- O,
59
- D,
60
- C
59
+ E,
60
+ B,
61
+ l
61
62
  ].join(`
62
63
 
63
- `), k = 3e4;
64
+ `), _ = 3e4;
64
65
  let e = null;
65
- function q() {
66
- return e || (e = new CSSStyleSheet(), e.replaceSync(_)), e;
66
+ function k() {
67
+ return e || (e = new CSSStyleSheet(), e.replaceSync(W)), e;
67
68
  }
68
- const fo = () => ({ importCss: () => {
69
- const r = q(), S = Date.now() + k, m = () => {
70
- var n;
71
- const t = (n = document.querySelector("ui-editor")) == null ? void 0 : n.shadowRoot;
69
+ const ao = () => ({ importCss: () => {
70
+ const r = k(), n = Date.now() + _, m = () => {
71
+ const t = O();
72
72
  if (t) {
73
73
  t.adoptedStyleSheets.includes(r) || (t.adoptedStyleSheets = [...t.adoptedStyleSheets, r]);
74
74
  return;
75
75
  }
76
- Date.now() < S && requestAnimationFrame(m);
76
+ Date.now() < n && requestAnimationFrame(m);
77
77
  };
78
78
  m();
79
79
  } });
80
80
  export {
81
- fo as useCustomInterfaceAppearance
81
+ ao as useCustomInterfaceAppearance
82
82
  };
@@ -1,15 +1,16 @@
1
+ import { findEditorShadowRoot as i } from "../utils/editorShadowRoot.js";
1
2
  import { FULLSTORY_BRIDGE_SCRIPT_URL as s } from "../utils/fullStoryScripts.js";
2
- const l = () => ({ injectFullStory: () => {
3
- var c;
4
- const n = window;
5
- if (typeof n._fs_org != "string" || !n._fs_org)
3
+ const d = () => ({ injectFullStory: () => {
4
+ var n;
5
+ const e = window;
6
+ if (typeof e._fs_org != "string" || !e._fs_org)
6
7
  return;
7
- const e = document.querySelector("ui-editor"), o = (c = e == null ? void 0 : e.shadowRoot) == null ? void 0 : c.querySelector("iframe"), r = o == null ? void 0 : o.contentDocument;
8
- if (!r || r.querySelector('script[data-fullstory-bridge="true"]'))
8
+ const o = (n = i()) == null ? void 0 : n.querySelector("iframe"), t = o == null ? void 0 : o.contentDocument;
9
+ if (!t || t.querySelector('script[data-fullstory-bridge="true"]'))
9
10
  return;
10
- const t = r.createElement("script");
11
- t.src = s, t.async = !0, t.crossOrigin = "anonymous", t.dataset.fullstoryBridge = "true", r.head.appendChild(t);
11
+ const r = t.createElement("script");
12
+ r.src = s, r.async = !0, r.crossOrigin = "anonymous", r.dataset.fullstoryBridge = "true", t.head.appendChild(r);
12
13
  } });
13
14
  export {
14
- l as useFullStoryBridge
15
+ d as useFullStoryBridge
15
16
  };
@@ -1,21 +1,21 @@
1
- var n = Object.defineProperty;
2
- var o = (i, e, t) => e in i ? n(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
- var r = (i, e, t) => o(i, typeof e != "symbol" ? e + "" : e, t);
4
- import { CommonControl as s } from "../../../common-control.js";
5
- import { useRecommendationExtensionStore as l } from "../../store/recommendation.js";
6
- const d = "recommendation-filters-control", a = {
1
+ var o = Object.defineProperty;
2
+ var s = (i, e, t) => e in i ? o(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
+ var r = (i, e, t) => s(i, typeof e != "symbol" ? e + "" : e, t);
4
+ import { CommonControl as l } from "../../../common-control.js";
5
+ import { useRecommendationExtensionStore as d } from "../../store/recommendation.js";
6
+ const a = "recommendation-filters-control", u = {
7
7
  FILTERS: "filterStatus"
8
8
  };
9
- class h extends s {
9
+ class m extends l {
10
10
  constructor() {
11
11
  super(...arguments);
12
- r(this, "store", l());
12
+ r(this, "store", d());
13
13
  r(this, "addFilterListener", () => {
14
14
  });
15
15
  r(this, "addFilterButton", null);
16
16
  }
17
17
  getId() {
18
- return d;
18
+ return a;
19
19
  }
20
20
  getTemplate() {
21
21
  return `
@@ -23,7 +23,7 @@ class h extends s {
23
23
  ${this._GuTwoColumns([
24
24
  this._GuLabel({ text: this.api.translate("Filters") }),
25
25
  this._GuButton({
26
- name: a.FILTERS,
26
+ name: u.FILTERS,
27
27
  label: this.api.translate("Add Filter"),
28
28
  id: "guido__btn-add-filter"
29
29
  })
@@ -42,11 +42,11 @@ class h extends s {
42
42
  this.store.openFilterDrawer();
43
43
  }
44
44
  _setupButtonListener() {
45
- var t;
46
- this.addFilterListener = this._onFilterSelectClick.bind(this), this.addFilterButton = this.getContainer().querySelector("#guido__btn-add-filter"), (t = this.addFilterButton) == null || t.addEventListener("click", this.addFilterListener);
45
+ var t, n;
46
+ this.addFilterListener = this._onFilterSelectClick.bind(this), this.addFilterButton = (t = this.getContainer()) == null ? void 0 : t.querySelector("#guido__btn-add-filter"), (n = this.addFilterButton) == null || n.addEventListener("click", this.addFilterListener);
47
47
  }
48
48
  }
49
49
  export {
50
- d as FILTERS_CONTROL_ID,
51
- h as FiltersControl
50
+ a as FILTERS_CONTROL_ID,
51
+ m as FiltersControl
52
52
  };
@@ -1,34 +1,34 @@
1
- var w = Object.defineProperty;
2
- var N = (l, o, t) => o in l ? w(l, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[o] = t;
3
- var i = (l, o, t) => N(l, typeof o != "symbol" ? o + "" : o, t);
4
- import { useLegacyStrategyConversion as L } from "../../../../../composables/useLegacyStrategyConversion.js";
5
- import { ACADEMY_LINKS as $ } from "../../../../../enums/academy.js";
6
- import { useOnboardingStore as A } from "../../../../../stores/onboarding.js";
1
+ var A = Object.defineProperty;
2
+ var N = (g, o, t) => o in g ? A(g, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : g[o] = t;
3
+ var r = (g, o, t) => N(g, typeof o != "symbol" ? o + "" : o, t);
4
+ import { useLegacyStrategyConversion as O } from "../../../../../composables/useLegacyStrategyConversion.js";
5
+ import { ACADEMY_LINKS as w } from "../../../../../enums/academy.js";
6
+ import { useOnboardingStore as $ } from "../../../../../stores/onboarding.js";
7
7
  import { CommonControl as R } from "../../../common-control.js";
8
8
  import { RRS_CONFIG_VERSION as E } from "../../constants/defaultConfig.js";
9
- import { RecommendationConfigService as C } from "../../services/configService.js";
10
- import { useRecommendationExtensionStore as O } from "../../store/recommendation.js";
11
- const I = "recommendation-strategy-control";
12
- class P extends R {
9
+ import { RecommendationConfigService as k } from "../../services/configService.js";
10
+ import { useRecommendationExtensionStore as I } from "../../store/recommendation.js";
11
+ const q = "recommendation-strategy-control", y = "recommendationLegacyStrategyOnboarding";
12
+ class Y extends R {
13
13
  constructor() {
14
14
  super(...arguments);
15
- i(this, "store", O());
16
- i(this, "onboardingStore", A());
17
- i(this, "legacyConversion", L());
18
- i(this, "storeUnsubscription", () => {
15
+ r(this, "store", I());
16
+ r(this, "onboardingStore", $());
17
+ r(this, "legacyConversion", O());
18
+ r(this, "storeUnsubscription", () => {
19
19
  });
20
- i(this, "listeners", []);
21
- i(this, "lastPaintedState", null);
20
+ r(this, "listeners", []);
21
+ r(this, "lastPaintedState", null);
22
22
  }
23
23
  getId() {
24
- return I;
24
+ return q;
25
25
  }
26
26
  getTemplate() {
27
27
  const t = this.api.translate(
28
28
  "You can assign a recommendation strategy by selecting an existing one or creating a new one to show specific content."
29
- ), e = this.api.translate("For more information, you can"), a = this.api.translate("visit Academy"), r = this.api.translate("Legacy Strategy"), s = this.api.translate(
29
+ ), e = this.api.translate("For more information, you can"), a = this.api.translate("visit Academy"), i = this.api.translate("Legacy Strategy"), s = this.api.translate(
30
30
  "Note that this is an older version of the Recommendation Strategy. We recommend you update it to the new Recommendation Strategy for an improved experience."
31
- ), g = this.api.translate(
31
+ ), l = this.api.translate(
32
32
  "The recommendation strategy used in the recommendation block is no longer available. You can assign a different strategy to it."
33
33
  );
34
34
  return `
@@ -54,7 +54,7 @@ class P extends R {
54
54
  ${t}
55
55
  ${e}
56
56
  <a
57
- href="${$.EMAIL_RECOMMENDATION_BLOCK}"
57
+ href="${w.EMAIL_RECOMMENDATION_BLOCK}"
58
58
  target="_blank"
59
59
  rel="noopener noreferrer">${a}</a>.
60
60
  </p>
@@ -78,7 +78,7 @@ class P extends R {
78
78
  <div data-strategy-unavailable-state style="display: none;">
79
79
  <div class="strategy-control-notice-row">
80
80
  <div class="strategy-control-notice strategy-control-notice--error" role="alert">
81
- <p class="strategy-control-notice-text">${g}</p>
81
+ <p class="strategy-control-notice-text">${l}</p>
82
82
  </div>
83
83
  </div>
84
84
  ${this._GuTwoColumns([
@@ -103,7 +103,7 @@ class P extends R {
103
103
  </div>
104
104
  </div>
105
105
  <div class="strategy-control-name-band">
106
- <span class="strategy-control-name">${r}</span>
106
+ <span class="strategy-control-name">${i}</span>
107
107
  ${this._strategyAction({
108
108
  id: "guido__btn-update-legacy-strategy",
109
109
  label: this.api.translate("Update"),
@@ -170,13 +170,15 @@ class P extends R {
170
170
  * strategyId) for an assigned block.
171
171
  */
172
172
  _isNodeUnassigned() {
173
- if (!C.hasConfig(this.currentNode))
173
+ if (!k.hasConfig(this.currentNode))
174
174
  return !1;
175
- const t = C.getConfig(this.currentNode);
175
+ const t = k.getConfig(this.currentNode);
176
176
  return !t.strategyId && (t.configVersion ?? 0) >= E;
177
177
  }
178
178
  onDestroy() {
179
- this._teardown();
179
+ this._teardown(), requestAnimationFrame(() => {
180
+ this.store.strategyPanelOpen || this._closeLegacyOnboarding();
181
+ });
180
182
  }
181
183
  _teardown() {
182
184
  this.store.strategyPanelOpen = !1, this.storeUnsubscription(), this.storeUnsubscription = () => {
@@ -186,37 +188,47 @@ class P extends R {
186
188
  const t = this.getContainer();
187
189
  if (!t)
188
190
  return;
189
- const e = (a, r) => {
191
+ const e = (a, i) => {
190
192
  const s = t.querySelector(a);
191
- s && (s.addEventListener("click", r), this.listeners.push({ element: s, handler: r }));
193
+ s && (s.addEventListener("click", i), this.listeners.push({ element: s, handler: i }));
192
194
  };
193
195
  e("#guido__btn-assign-strategy", () => this.store.openAssignStrategyDrawer()), e("#guido__btn-create-strategy", () => this.store.openStrategyCreation()), e("#guido__btn-assign-unavailable-strategy", () => this.store.openAssignStrategyDrawer()), e("#guido__btn-create-unavailable-strategy", () => this.store.openStrategyCreation()), e("#guido__btn-change-strategy", () => this.store.openAssignStrategyDrawer()), e("#guido__btn-change-legacy-strategy", () => this.store.openAssignStrategyDrawer()), e("#guido__btn-remove-strategy", () => this.store.openRemoveStrategyModal()), e("#guido__btn-remove-legacy-strategy", () => this.store.openRemoveStrategyModal()), e("#guido__btn-update-legacy-strategy", () => {
194
196
  this.legacyConversion.convertLegacyStrategy();
195
197
  });
196
198
  }
199
+ _closeLegacyOnboarding() {
200
+ this.onboardingStore.isActive(y) && this.onboardingStore.resetOnboarding(y);
201
+ }
202
+ _syncLegacyOnboarding(t) {
203
+ if (!t) {
204
+ this._closeLegacyOnboarding();
205
+ return;
206
+ }
207
+ this.onboardingStore.closedThisSession.includes(y) || this.onboardingStore.startOnboarding(y);
208
+ }
197
209
  _renderState() {
198
- var f;
199
- const { strategyId: t } = this.store.recommendationConfigs, e = t ? ((f = this.store.assignedStrategy) == null ? void 0 : f.name) ?? "" : "", a = !!t && !e && (this.store.strategiesLoading || !this.store.strategiesSettled), r = !!t && !e && !a && this.store.strategiesFetched, s = this.store.legacyConversionLoading, g = this.store.isLegacyStrategyBlock, p = [t, e, a, r, s, g].join("\0");
200
- if (p === this.lastPaintedState)
210
+ var L;
211
+ const { strategyId: t } = this.store.recommendationConfigs, e = t ? ((L = this.store.assignedStrategy) == null ? void 0 : L.name) ?? "" : "", a = !!t && !e && (this.store.strategiesLoading || !this.store.strategiesSettled), i = !!t && !e && !a && this.store.strategiesFetched, s = this.store.legacyConversionLoading, l = this.store.isLegacyStrategyBlock, v = [t, e, a, i, s, l].join("\0");
212
+ if (v === this.lastPaintedState)
201
213
  return;
202
214
  const n = this.getContainer();
203
215
  if (!n)
204
216
  return;
205
- const y = n.querySelector("[data-strategy-empty-state]"), u = n.querySelector("[data-strategy-assigned-state]"), c = n.querySelector("[data-strategy-legacy-state]"), h = n.querySelector("[data-strategy-unavailable-state]"), v = n.querySelector("[data-strategy-loading-state]"), b = n.querySelector("[data-strategy-content]"), m = n.querySelector("[data-strategy-name]"), _ = n.querySelector("[data-strategy-name-skeleton]");
206
- if (!y || !u || !c || !h)
217
+ const h = n.querySelector("[data-strategy-empty-state]"), u = n.querySelector("[data-strategy-assigned-state]"), c = n.querySelector("[data-strategy-legacy-state]"), m = n.querySelector("[data-strategy-unavailable-state]"), b = n.querySelector("[data-strategy-loading-state]"), _ = n.querySelector("[data-strategy-content]"), p = n.querySelector("[data-strategy-name]"), S = n.querySelector("[data-strategy-name-skeleton]");
218
+ if (!h || !u || !c || !m)
207
219
  return;
208
- v && (v.style.display = "none"), b && (b.style.display = "");
209
- const k = t ? r ? h : u : g ? c : y;
210
- [y, u, c, h].forEach((d) => {
211
- d.style.display = d === k ? "" : "none";
220
+ b && (b.style.display = "none"), _ && (_.style.display = "");
221
+ const f = t ? i ? m : u : l ? c : h;
222
+ [h, u, c, m].forEach((d) => {
223
+ d.style.display = d === f ? "" : "none";
212
224
  }), c.querySelectorAll("button").forEach((d) => {
213
225
  d.disabled = s;
214
226
  }), c.classList.toggle("is-converting", s), !t && this._isNodeUnassigned() && this.onboardingStore.startOnboarding("recommendationStrategyOnboarding");
215
- const S = this.store.currentRecommendationId;
216
- g && S !== null && this.store.blockStates[S] && this.onboardingStore.startOnboarding("recommendationLegacyStrategyOnboarding"), m && (m.style.display = a ? "none" : "", t && !a && (m.textContent = e || `#${t}`)), _ && (_.style.display = a ? "block" : "none"), this.lastPaintedState = p;
227
+ const C = this.store.currentRecommendationId;
228
+ C !== null && this.store.blockStates[C] && this._syncLegacyOnboarding(f === c), p && (p.style.display = a ? "none" : "", t && !a && (p.textContent = e || `#${t}`)), S && (S.style.display = a ? "block" : "none"), this.lastPaintedState = v;
217
229
  }
218
230
  }
219
231
  export {
220
- I as STRATEGY_CONTROL_ID,
221
- P as StrategyControl
232
+ q as STRATEGY_CONTROL_ID,
233
+ Y as StrategyControl
222
234
  };
@@ -1,11 +1,11 @@
1
1
  var m = Object.defineProperty;
2
- var p = (o, e, t) => e in o ? m(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3
- var a = (o, e, t) => p(o, typeof e != "symbol" ? e + "" : e, t);
2
+ var p = (o, t, e) => t in o ? m(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
3
+ var a = (o, t, e) => p(o, typeof t != "symbol" ? t + "" : t, e);
4
4
  import { UIElementType as c, UEAttr as _ } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
5
  import { CommonControl as d } from "../../common-control.js";
6
6
  import { RecommendationControlId as C } from "../constants/controlIds.js";
7
7
  import "../constants/selectors.js";
8
- const S = C.SYNC_INFO_MESSAGE, r = "sync-info-message", u = "Note that changes will be applied to all product cards in your recommendation block.";
8
+ const S = C.SYNC_INFO_MESSAGE, n = "sync-info-message", u = "Note that changes will be applied to all product cards in your recommendation block.";
9
9
  class O extends d {
10
10
  constructor() {
11
11
  super(...arguments);
@@ -16,12 +16,12 @@ class O extends d {
16
16
  }
17
17
  getTemplate() {
18
18
  return `
19
- <div class="${r}">
19
+ <div class="${n}">
20
20
  <${c.ICON}
21
21
  ${_.ICON.src}="migration-info-icon"
22
- class="${r}__icon">
22
+ class="${n}__icon">
23
23
  </${c.ICON}>
24
- <p class="${r}__text">
24
+ <p class="${n}__text">
25
25
  ${this.api.translate(u)}
26
26
  </p>
27
27
  </div>
@@ -31,8 +31,8 @@ class O extends d {
31
31
  this._repositionAboveTabs();
32
32
  }
33
33
  onDestroy() {
34
- var t;
35
- super.onDestroy(), (t = this._repositionedElement) == null || t.remove(), this._repositionedElement = null;
34
+ var e;
35
+ super.onDestroy(), (e = this._repositionedElement) == null || e.remove(), this._repositionedElement = null;
36
36
  }
37
37
  /**
38
38
  * Moves the info message from inside the Settings tab content
@@ -49,15 +49,15 @@ class O extends d {
49
49
  * The element reference is stored so onDestroy() can remove it.
50
50
  */
51
51
  _repositionAboveTabs() {
52
- var l;
53
- const n = this.getContainer().querySelector(`.${r}`);
54
- if (!n)
52
+ var i, l;
53
+ const e = (i = this.getContainer()) == null ? void 0 : i.querySelector(`.${n}`);
54
+ if (!e)
55
55
  return;
56
- const i = n.closest("ue-control-panel");
57
- if (!i)
56
+ const s = e.closest("ue-control-panel");
57
+ if (!s)
58
58
  return;
59
- const s = i.querySelector("ue-tabs-header");
60
- s && ((l = s.parentElement) == null || l.insertBefore(n, s), this._repositionedElement = n);
59
+ const r = s.querySelector("ue-tabs-header");
60
+ r && ((l = r.parentElement) == null || l.insertBefore(e, r), this._repositionedElement = e);
61
61
  }
62
62
  }
63
63
  export {
@@ -1,30 +1,32 @@
1
- function d(c, t) {
2
- const { thousandSeparator: i, decimalSeparator: e, decimalCount: r } = t, [u, o = ""] = String(c).split("."), n = o.slice(0, r).padEnd(r, "0"), a = u.replace(
1
+ function f(t) {
2
+ return typeof t != "number" || !Number.isFinite(t) ? 2 : Math.min(Math.max(Math.trunc(t), 0), 20);
3
+ }
4
+ function d(t, n) {
5
+ const { thousandSeparator: c, decimalSeparator: e, decimalCount: r } = n, [u, i = ""] = String(t).split("."), o = i.slice(0, r).padEnd(r, "0"), a = u.replace(
3
6
  /\B(?=(\d{3})+(?!\d))/g,
4
- i
7
+ c
5
8
  );
6
- return r > 0 && n ? `${a}${e}${n}` : a;
9
+ return r > 0 && o ? `${a}${e}${o}` : a;
7
10
  }
8
- function f(c) {
9
- const { price: t, currency: i } = c, {
11
+ function $(t) {
12
+ const { price: n, currency: c } = t, {
10
13
  symbol: e,
11
14
  alignment: r,
12
15
  thousandSeparator: u,
13
- decimalSeparator: o,
14
- decimalCount: n
15
- } = i;
16
- if (typeof t != "number" || Number.isNaN(t)) {
17
- const s = "0".repeat(n), m = `0${o}${s}`;
16
+ decimalSeparator: i
17
+ } = c, o = f(c.decimalCount);
18
+ if (typeof n != "number" || Number.isNaN(n)) {
19
+ const s = "0".repeat(o), m = `0${i}${s}`;
18
20
  return r === "before" ? `${e} ${m}` : `${m} ${e}`;
19
21
  }
20
- const a = d(t, {
22
+ const a = d(n, {
21
23
  thousandSeparator: u,
22
- decimalSeparator: o,
23
- decimalCount: n
24
+ decimalSeparator: i,
25
+ decimalCount: o
24
26
  });
25
27
  return r === "before" ? `${e} ${a}` : `${a} ${e}`;
26
28
  }
27
29
  export {
28
30
  d as formatNumber,
29
- f as formatPrice
31
+ $ as formatPrice
30
32
  };