@useinsider/guido 3.30.0-beta.949c781 → 3.30.0-beta.94a3b3b

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.
@@ -2,17 +2,17 @@ import i from "./EditorActionsMenu.vue2.js";
2
2
  /* empty css */
3
3
  import s from "../../../_virtual/_plugin-vue2_normalizer.js";
4
4
  var n = function() {
5
- var e = this, o = e._self._c, t = e._self._setupProxy;
6
- return o("div", { staticClass: "editor-actions-menu p-r" }, [o(t.InButtonV2, { attrs: { id: "guido__kebab-button", "data-testid": "Editor Actions Menu", "left-icon": "line-more-vertical", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.loadingStatus, "label-text-status": !1, "selected-status": t.isPanelOpen, "tooltip-options": t.getTooltipOptions("guido__kebab-button"), "tooltip-text": t.trans("email-editor.more-actions") }, on: { click: function(d) {
5
+ var o = this, e = o._self._c, t = o._self._setupProxy;
6
+ return e("div", { staticClass: "editor-actions-menu p-r" }, [e(t.InButtonV2, { attrs: { id: "guido__kebab-button", "data-testid": "Editor Actions Menu", "left-icon": "line-more-vertical", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isEditorUnavailable, "label-text-status": !1, "selected-status": t.isPanelOpen, "tooltip-options": t.getTooltipOptions("guido__kebab-button"), "tooltip-text": t.trans("email-editor.more-actions") }, on: { click: function(c) {
7
7
  t.isOpen = !t.isOpen;
8
- } } }), o(t.InDropdownMenu, { staticClass: "editor-actions-menu__dropdown", attrs: { id: "guido__kebab-menu", "box-width": "basedOnLongestItem", "static-position": "bottom right", "dynamic-position": !1, "max-height": 400, options: t.options, "select-all-option-status": !1, status: t.isPanelOpen }, on: { clickOutside: t.close, optionClick: t.handleOptionClick } })], 1);
8
+ } } }), e(t.InDropdownMenu, { staticClass: "editor-actions-menu__dropdown", attrs: { id: "guido__kebab-menu", "box-width": "basedOnLongestItem", "static-position": "bottom right", "dynamic-position": !1, "max-height": 400, options: t.options, "select-all-option-status": !1, status: t.isPanelOpen }, on: { clickOutside: t.close, optionClick: t.handleOptionClick } })], 1);
9
9
  }, a = [], r = /* @__PURE__ */ s(
10
10
  i,
11
11
  n,
12
12
  a,
13
13
  !1,
14
14
  null,
15
- "bdb3b37a"
15
+ "0e63ebe1"
16
16
  );
17
17
  const _ = r.exports;
18
18
  export {
@@ -1,9 +1,9 @@
1
- import { defineComponent as D, ref as C, computed as i, watch as L } from "vue";
2
- import { useAccessibilityApi as R } from "../../../composables/useAccessibilityApi.js";
3
- import { useConfig as Y } from "../../../composables/useConfig.js";
4
- import { useExport as F } from "../../../composables/useExport.js";
5
- import { useTranslations as N } from "../../../composables/useTranslations.js";
6
- import { useVersionHistoryApi as U } from "../../../composables/useVersionHistoryApi.js";
1
+ import { defineComponent as D, ref as C, computed as s, watch as L } from "vue";
2
+ import { useAccessibilityApi as U } from "../../../composables/useAccessibilityApi.js";
3
+ import { useConfig as R } from "../../../composables/useConfig.js";
4
+ import { useExport as Y } from "../../../composables/useExport.js";
5
+ import { useTranslations as F } from "../../../composables/useTranslations.js";
6
+ import { useVersionHistoryApi as N } from "../../../composables/useVersionHistoryApi.js";
7
7
  import { useAutosaveStore as X } from "../../../stores/autosave.js";
8
8
  import { useEditorStore as j } from "../../../stores/editor.js";
9
9
  import { useOnboardingStore as q } from "../../../stores/onboarding.js";
@@ -12,22 +12,22 @@ import { InToggle as G, InDropdownMenu as J, InButtonV2 as K } from "@useinsider
12
12
  const ce = /* @__PURE__ */ D({
13
13
  __name: "EditorActionsMenu",
14
14
  setup(Q) {
15
- const c = "guido__kebab-autosave", u = "guido__kebab-version-history", p = "guido__kebab-accessibility", d = "guido__kebab-save-as", v = "guido__kebab-export", { config: m, isFeatureEnabled: b } = Y(), { exportHtml: y } = F(), { openVersionHistory: A, closeVersionHistory: S } = U(), { toggleAccessibilityTestingMode: _ } = R(), e = j(), a = X(), f = q(), o = N(), g = C(!1), M = i(() => g.value || f.isEditorActionsMenuPinned), r = C(!1), O = i(() => b("autosave")), x = i(
15
+ const c = "guido__kebab-autosave", u = "guido__kebab-version-history", p = "guido__kebab-accessibility", d = "guido__kebab-save-as", v = "guido__kebab-export", { config: b, isFeatureEnabled: m } = R(), { exportHtml: y } = Y(), { openVersionHistory: A, closeVersionHistory: _ } = N(), { toggleAccessibilityTestingMode: O } = U(), e = j(), a = X(), f = q(), o = F(), g = C(!1), M = s(() => g.value || f.isEditorActionsMenuPinned), r = C(!1), S = s(() => m("autosave")), E = s(
16
16
  () => {
17
- var t, s;
18
- return !!((s = (t = m.value) == null ? void 0 : t.features) != null && s.versionHistory) && !e.isPreviewModeOpen;
17
+ var t, i;
18
+ return !!((i = (t = b.value) == null ? void 0 : t.features) != null && i.versionHistory) && !e.isPreviewModeOpen;
19
19
  }
20
- ), h = i(
21
- () => b("accessibilityTesting") && !e.isPreviewModeOpen
22
- ), V = i(() => {
23
- var t, s;
24
- return !!((s = (t = m.value) == null ? void 0 : t.features) != null && s.saveAsTemplate);
25
- }), E = i(() => O.value ? [
20
+ ), x = s(
21
+ () => m("accessibilityTesting") && !e.isPreviewModeOpen
22
+ ), h = s(() => {
23
+ var t, i;
24
+ return !!((i = (t = b.value) == null ? void 0 : t.features) != null && i.saveAsTemplate);
25
+ }), V = s(() => S.value ? [
26
26
  { categoryText: o("email-editor.preferences") },
27
27
  {
28
28
  text: o("email-editor.auto-save"),
29
29
  value: c,
30
- disable: e.loadingStatus,
30
+ disable: e.isEditorUnavailable,
31
31
  rightSlotComponent: G,
32
32
  rightSlotProps: {
33
33
  // InDropdownMenu fills attrs.id with its own positional test id, and v-bind
@@ -35,25 +35,25 @@ const ce = /* @__PURE__ */ D({
35
35
  name: "guido-kebab-autosave-toggle",
36
36
  class: "p-e-n",
37
37
  checked: a.isOn,
38
- disable: e.loadingStatus
38
+ disable: e.isEditorUnavailable
39
39
  }
40
40
  },
41
41
  { divider: "solid" }
42
- ] : []), T = i(() => [
42
+ ] : []), T = s(() => [
43
43
  { categoryText: o("email-editor.actions") },
44
- ...x.value ? [{
44
+ ...E.value ? [{
45
45
  text: o("newsletter.version-history"),
46
46
  value: u,
47
47
  iconLeft: "line-architect-version-history",
48
48
  disable: e.isVersionHistoryButtonDisabled
49
49
  }] : [],
50
- ...h.value ? [{
50
+ ...x.value ? [{
51
51
  text: o("email-editor.accessibility-test"),
52
52
  value: p,
53
53
  iconLeft: "line-accessibility",
54
- disable: e.loadingStatus
54
+ disable: e.isEditorUnavailable
55
55
  }] : [],
56
- ...V.value ? [{
56
+ ...h.value ? [{
57
57
  text: o("newsletter.save-templates"),
58
58
  value: d,
59
59
  iconLeft: "line-newsletter-save-as-template",
@@ -65,7 +65,7 @@ const ce = /* @__PURE__ */ D({
65
65
  iconLeft: "line-export",
66
66
  disable: r.value || e.isExportButtonDisabled
67
67
  }
68
- ]), P = i(() => [...E.value, ...T.value]), n = () => {
68
+ ]), P = s(() => [...V.value, ...T.value]), n = () => {
69
69
  g.value = !1;
70
70
  };
71
71
  L(() => f.isEditorActionsMenuPinned, (t) => {
@@ -74,9 +74,9 @@ const ce = /* @__PURE__ */ D({
74
74
  const k = () => {
75
75
  a.isOn = !a.isOn;
76
76
  }, w = () => {
77
- e.isVersionHistoryOpen ? S() : A(), n();
77
+ e.isVersionHistoryOpen ? _() : A(), n();
78
78
  }, H = () => {
79
- _(), n();
79
+ O(), n();
80
80
  }, I = () => {
81
81
  e.isSaveAsTemplateDrawerOpen = !0, n();
82
82
  }, B = async () => {
@@ -88,9 +88,9 @@ const ce = /* @__PURE__ */ D({
88
88
  [d]: I,
89
89
  [v]: B
90
90
  };
91
- return { __sfc: !0, AUTOSAVE: c, VERSION_HISTORY: u, ACCESSIBILITY: p, SAVE_AS: d, EXPORT: v, config: m, isFeatureEnabled: b, exportHtml: y, openVersionHistory: A, closeVersionHistory: S, toggleAccessibilityTestingMode: _, editorStore: e, autosaveStore: a, onboardingStore: f, trans: o, isOpen: g, isPanelOpen: M, isExporting: r, isAutosaveVisible: O, isVersionHistoryVisible: x, isAccessibilityVisible: h, isSaveAsVisible: V, preferenceOptions: E, actionOptions: T, options: P, close: n, toggleAutosave: k, handleVersionHistory: w, handleAccessibility: H, handleSaveAs: I, handleExport: B, optionHandlers: l, handleOptionClick: ({ value: t }) => {
92
- var s;
93
- return (s = l[t]) == null ? void 0 : s.call(l);
91
+ return { __sfc: !0, AUTOSAVE: c, VERSION_HISTORY: u, ACCESSIBILITY: p, SAVE_AS: d, EXPORT: v, config: b, isFeatureEnabled: m, exportHtml: y, openVersionHistory: A, closeVersionHistory: _, toggleAccessibilityTestingMode: O, editorStore: e, autosaveStore: a, onboardingStore: f, trans: o, isOpen: g, isPanelOpen: M, isExporting: r, isAutosaveVisible: S, isVersionHistoryVisible: E, isAccessibilityVisible: x, isSaveAsVisible: h, preferenceOptions: V, actionOptions: T, options: P, close: n, toggleAutosave: k, handleVersionHistory: w, handleAccessibility: H, handleSaveAs: I, handleExport: B, optionHandlers: l, handleOptionClick: ({ value: t }) => {
92
+ var i;
93
+ return (i = l[t]) == null ? void 0 : i.call(l);
94
94
  }, getTooltipOptions: z, InButtonV2: K, InDropdownMenu: J };
95
95
  }
96
96
  });
@@ -3,9 +3,9 @@ import { useEditorLock as y } from "./useEditorLock.js";
3
3
  import { useAutosaveStore as I, AUTOSAVE_STATUS as a } from "../stores/autosave.js";
4
4
  import { useEditorStore as L } from "../stores/editor.js";
5
5
  import { computed as w, watch as V, onUnmounted as k } from "vue";
6
- const D = 18e4, b = 6e4, _ = (g, { clearsChanges: h = () => !0 } = {}) => {
6
+ const D = 18e4, b = 6e4, U = (g, { clearsChanges: h = () => !0 } = {}) => {
7
7
  const { isFeatureEnabled: m } = p(), s = L(), t = I(), { isEditorBusy: f } = y();
8
- let o = null, l = 0, u = -1;
8
+ let i = null, l = 0, u = -1;
9
9
  const d = w(
10
10
  () => m("autosave") && t.isOn
11
11
  ), A = () => s.hasChanges && s.isInSaveableState && s.changeSeq !== u, E = () => ({
@@ -30,43 +30,43 @@ const D = 18e4, b = 6e4, _ = (g, { clearsChanges: h = () => !0 } = {}) => {
30
30
  return;
31
31
  }
32
32
  e === "visibility" && (l = Date.now()), console.debug("guido:autosave:save-start", { trigger: e }), t.status = a.SAVING;
33
- const n = s.changeSeq;
33
+ const o = s.changeSeq;
34
34
  try {
35
35
  if (await g() === void 0) {
36
36
  console.debug("guido:autosave:blocked", { trigger: e, reason: "save-returned-undefined" }), t.status = a.ERROR;
37
37
  return;
38
38
  }
39
- u = n, h() && (s.hasChanges = !1), t.status = a.SAVED, t.lastSavedAt = /* @__PURE__ */ new Date(), console.debug("guido:autosave:save-complete", { trigger: e, at: t.lastSavedAt });
39
+ u = o, h() && s.changeSeq === o && (s.hasChanges = !1), t.status = a.SAVED, t.lastSavedAt = /* @__PURE__ */ new Date(), console.debug("guido:autosave:save-complete", { trigger: e, at: t.lastSavedAt });
40
40
  } catch (S) {
41
41
  console.debug("guido:autosave:error", { trigger: e, error: S }), t.status = a.ERROR;
42
42
  }
43
- }, i = () => {
43
+ }, n = () => {
44
44
  const { visibilityState: e } = document;
45
45
  if (console.debug("guido:autosave:visibility-change", {
46
46
  visibilityState: e,
47
47
  isActive: d.value
48
48
  }), e !== "hidden")
49
49
  return;
50
- const n = Date.now() - l;
51
- if (n < b) {
50
+ const o = Date.now() - l;
51
+ if (o < b) {
52
52
  console.debug("guido:autosave:visibility-debounced", {
53
- sinceLastMs: n,
53
+ sinceLastMs: o,
54
54
  debounceMs: b
55
55
  });
56
56
  return;
57
57
  }
58
58
  r("visibility");
59
59
  }, c = () => {
60
- o && (clearInterval(o), o = null);
60
+ i && (clearInterval(i), i = null);
61
61
  }, v = () => {
62
- document.removeEventListener("visibilitychange", i), window.removeEventListener("pagehide", i);
62
+ document.removeEventListener("visibilitychange", n), window.removeEventListener("pagehide", n);
63
63
  };
64
64
  V(
65
65
  d,
66
66
  (e) => {
67
- console.debug("guido:autosave:active-changed", { active: e }), e ? (c(), o = setInterval(() => {
67
+ console.debug("guido:autosave:active-changed", { active: e }), e ? (c(), i = setInterval(() => {
68
68
  console.debug("guido:autosave:interval-tick"), r("interval");
69
- }, D), document.addEventListener("visibilitychange", i), window.addEventListener("pagehide", i)) : (c(), v(), t.status = a.IDLE);
69
+ }, D), document.addEventListener("visibilitychange", n), window.addEventListener("pagehide", n)) : (c(), v(), t.status = a.IDLE);
70
70
  },
71
71
  { immediate: !0 }
72
72
  ), k(() => {
@@ -74,5 +74,5 @@ const D = 18e4, b = 6e4, _ = (g, { clearsChanges: h = () => !0 } = {}) => {
74
74
  });
75
75
  };
76
76
  export {
77
- _ as useAutoSave
77
+ U as useAutoSave
78
78
  };
@@ -1,9 +1,9 @@
1
1
  var V = Object.defineProperty;
2
- var N = (o, t, e) => t in o ? V(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
3
- var w = (o, t, e) => N(o, typeof t != "symbol" ? t + "" : t, e);
2
+ var N = (r, t, e) => t in r ? V(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
+ var w = (r, t, e) => N(r, typeof t != "symbol" ? t + "" : t, e);
4
4
  import { BLOCK_ID as H } from "../../extensions/Blocks/Items/block.js";
5
5
  import { hasZeroWidthDeclaration as U, withoutZeroWidth as W } from "../../extensions/Blocks/Items/constants/cardWidth.js";
6
- import { ItemInCartOptions as E, DefaultConfigValues as S, SETTINGS_ENUMS as p } from "../../extensions/Blocks/Items/enums/settingsEnums.js";
6
+ import { ItemInCartOptions as h, DefaultConfigValues as S, SETTINGS_ENUMS as p } from "../../extensions/Blocks/Items/enums/settingsEnums.js";
7
7
  import { getDefaultTemplate as $ } from "../../extensions/Blocks/Items/template.js";
8
8
  import { useTemplateStore as F } from "../../stores/template.js";
9
9
  import { protectLiquid as P, restoreLiquid as D } from "../../utils/liquidProtection.js";
@@ -17,107 +17,107 @@ const Y = /\{%-?\s*(\w+)(?:(?!\{%)[\s\S])*?%\}/g, z = [
17
17
  "td.esd-browsed-items-block",
18
18
  "td.esd-purchased-items-block"
19
19
  ].join(", ");
20
- function h(o) {
21
- const t = Number(o.getAttribute("width"));
20
+ function I(r) {
21
+ const t = Number(r.getAttribute("width"));
22
22
  return Number.isFinite(t) && t > 0 ? t : 0;
23
23
  }
24
- function k(o) {
25
- return Array.from(o.children).filter((t) => t.tagName === "TBODY").flatMap((t) => Array.from(t.children)).flatMap((t) => Array.from(t.children).filter((e) => e.tagName === "TD"));
24
+ function k(r) {
25
+ return Array.from(r.children).filter((t) => t.tagName === "TBODY").flatMap((t) => Array.from(t.children)).flatMap((t) => Array.from(t.children).filter((e) => e.tagName === "TD"));
26
26
  }
27
- function J(o) {
28
- var e, u;
29
- let t = (e = o.parentElement) == null ? void 0 : e.closest("table");
27
+ function J(r) {
28
+ var e, l;
29
+ let t = (e = r.parentElement) == null ? void 0 : e.closest("table");
30
30
  for (; t; ) {
31
- const a = h(t);
31
+ const a = I(t);
32
32
  if (a)
33
33
  return a;
34
- t = (u = t.parentElement) == null ? void 0 : u.closest("table");
34
+ t = (l = t.parentElement) == null ? void 0 : l.closest("table");
35
35
  }
36
36
  return 0;
37
37
  }
38
- function q(o) {
39
- var c, r;
40
- const t = (r = (c = o.parentElement) == null ? void 0 : c.parentElement) == null ? void 0 : r.parentElement, e = t == null ? void 0 : t.parentElement;
41
- if (!t || !e || !t.matches(R) || !h(o))
38
+ function q(r) {
39
+ var u, o;
40
+ const t = (o = (u = r.parentElement) == null ? void 0 : u.parentElement) == null ? void 0 : o.parentElement, e = t == null ? void 0 : t.parentElement;
41
+ if (!t || !e || !t.matches(R) || !I(r))
42
42
  return !1;
43
- const u = k(t), a = u.some((i) => !i.matches(j) && h(i));
44
- if (!u.includes(o) || a)
43
+ const l = k(t), a = l.some((n) => !n.matches(j) && I(n));
44
+ if (!l.includes(r) || a)
45
45
  return !1;
46
- const l = Array.from(e.children).filter((i) => i.matches(R)).reduce((i, d) => i + Math.max(0, ...k(d).map(h)), 0), n = J(e);
47
- return n > 0 && l <= n;
46
+ const i = Array.from(e.children).filter((n) => n.matches(R)).reduce((n, d) => n + Math.max(0, ...k(d).map(I)), 0), c = J(e);
47
+ return c > 0 && i <= c;
48
48
  }
49
49
  function Z() {
50
50
  return String(Date.now() + Math.floor(Math.random() * 1e3));
51
51
  }
52
- function L(o) {
53
- return o ? {
52
+ function B(r) {
53
+ return r ? {
54
54
  CartItems: p.ITEMS_TYPE.CART_ITEMS,
55
55
  BrowsedItems: p.ITEMS_TYPE.BROWSED_ITEMS,
56
56
  PurchasedItems: p.ITEMS_TYPE.PURCHASED_ITEMS,
57
57
  CART_ITEMS: p.ITEMS_TYPE.CART_ITEMS,
58
58
  BROWSED_ITEMS: p.ITEMS_TYPE.BROWSED_ITEMS,
59
59
  PURCHASED_ITEMS: p.ITEMS_TYPE.PURCHASED_ITEMS
60
- }[o] || p.ITEMS_TYPE.CART_ITEMS : p.ITEMS_TYPE.CART_ITEMS;
60
+ }[r] || p.ITEMS_TYPE.CART_ITEMS : p.ITEMS_TYPE.CART_ITEMS;
61
61
  }
62
- function K(o) {
63
- return o.classList.contains("esd-browsed-items-block") ? p.ITEMS_TYPE.BROWSED_ITEMS : o.classList.contains("esd-purchased-items-block") ? p.ITEMS_TYPE.PURCHASED_ITEMS : p.ITEMS_TYPE.CART_ITEMS;
62
+ function K(r) {
63
+ return r.classList.contains("esd-browsed-items-block") ? p.ITEMS_TYPE.BROWSED_ITEMS : r.classList.contains("esd-purchased-items-block") ? p.ITEMS_TYPE.PURCHASED_ITEMS : p.ITEMS_TYPE.CART_ITEMS;
64
64
  }
65
- function B(o) {
66
- var c;
67
- const t = (r, i) => r == null ? i : r === "1" || r === "true", e = (r, i) => r || i, u = o["data-type"] || o["data-source"], a = L(u), l = E[a];
68
- let n = o["data-cart_items_select_control_value"] || ((c = l == null ? void 0 : l[0]) == null ? void 0 : c.value) || S.cartItemsSelectControlValue;
69
- if (n && !n.includes("{{") && /^\d+$/.test(n)) {
70
- const r = parseInt(n) - 1, i = E[a];
71
- i && i[r] && (n = i[r].value);
65
+ function v(r) {
66
+ var u;
67
+ const t = (o, n) => o == null ? n : o === "1" || o === "true", e = (o, n) => o || n, l = r["data-type"] || r["data-source"], a = B(l), i = h[a];
68
+ let c = r["data-cart_items_select_control_value"] || ((u = i == null ? void 0 : i[0]) == null ? void 0 : u.value) || S.cartItemsSelectControlValue;
69
+ if (c && !c.includes("{{") && /^\d+$/.test(c)) {
70
+ const o = parseInt(c) - 1, n = h[a];
71
+ n && n[o] && (c = n[o].value);
72
72
  }
73
73
  return {
74
74
  initialized: !0,
75
- blockInstanceId: e(o["data-block-instance-id"], Z()),
75
+ blockInstanceId: e(r["data-block-instance-id"], Z()),
76
76
  source: a,
77
77
  type: a,
78
- itemsSelectValue: n,
79
- orientation: o["data-card_orientation_control_value"] || p.ORIENTATION.VERTICAL,
80
- nameTrimming: t(o["data-product_name_control_trim"], !0),
81
- priceHideDiscount: t(o["data-product_price_control_nodup"], !0),
82
- priceFormatted: t(o["data-product_price_control_formated"], !0),
83
- priceSinglePrice: t(o["data-product_price_control_single_price"], !1),
78
+ itemsSelectValue: c,
79
+ orientation: r["data-card_orientation_control_value"] || p.ORIENTATION.VERTICAL,
80
+ nameTrimming: t(r["data-product_name_control_trim"], !0),
81
+ priceHideDiscount: t(r["data-product_price_control_nodup"], !0),
82
+ priceFormatted: t(r["data-product_price_control_formated"], !0),
83
+ priceSinglePrice: t(r["data-product_price_control_single_price"], !1),
84
84
  priceCurrencySymbol: e(
85
- o["data-product_price_control_currency_symbol"],
85
+ r["data-product_price_control_currency_symbol"],
86
86
  S.productPriceCurrencySymbolControlValue
87
87
  ),
88
88
  priceCurrencyLocation: e(
89
- o["data-product_price_currency_location"],
89
+ r["data-product_price_currency_location"],
90
90
  S.productPriceCurrencyLocationControlValue
91
91
  ),
92
- priceOrientation: o["data-product_original_price_control_orientation"] || "horizontal",
93
- quantityControlEnabled: t(o["data-product_quantity_control_enabled"], !0),
94
- buttonLink: e(o["data-product_button_link"], S.productButtonLinkControlValue),
95
- imageLink: e(o["data-product_image_link"], S.productImageLinkControlValue),
96
- buttonLabel: e(o["data-product_button_control_label"], "Buy"),
97
- buttonFullWidth: t(o["data-product_button_control_atw"], !0),
98
- imageVisible: t(o["data-product_image_control_enabled"], !0),
99
- nameVisible: t(o["data-product_name_control_enabled"], !0),
100
- quantityVisible: t(o["data-product_quantity_control_enabled"], !0),
101
- priceVisible: t(o["data-product_price_control_enabled"], !0),
102
- originalPriceVisible: t(o["data-product_original_price_control_enabled"], !0),
103
- buttonVisible: t(o["data-product_button_control_enabled"], !0)
92
+ priceOrientation: r["data-product_original_price_control_orientation"] || "horizontal",
93
+ quantityControlEnabled: t(r["data-product_quantity_control_enabled"], !0),
94
+ buttonLink: e(r["data-product_button_link"], S.productButtonLinkControlValue),
95
+ imageLink: e(r["data-product_image_link"], S.productImageLinkControlValue),
96
+ buttonLabel: e(r["data-product_button_control_label"], "Buy"),
97
+ buttonFullWidth: t(r["data-product_button_control_atw"], !0),
98
+ imageVisible: t(r["data-product_image_control_enabled"], !0),
99
+ nameVisible: t(r["data-product_name_control_enabled"], !0),
100
+ quantityVisible: t(r["data-product_quantity_control_enabled"], !0),
101
+ priceVisible: t(r["data-product_price_control_enabled"], !0),
102
+ originalPriceVisible: t(r["data-product_original_price_control_enabled"], !0),
103
+ buttonVisible: t(r["data-product_button_control_enabled"], !0)
104
104
  };
105
105
  }
106
- function Q(o, t) {
106
+ function Q(r, t) {
107
107
  const e = {
108
108
  CART_ITEMS: `{{Abandoned Cart Item (${t}) Image}}`,
109
109
  BROWSED_ITEMS: `{{Browsed Item (${t}) Image}}`,
110
110
  PURCHASED_ITEMS: `{{Purchased Item (${t}) Image}}`
111
111
  };
112
- return e[o] || e.CART_ITEMS;
112
+ return e[r] || e.CART_ITEMS;
113
113
  }
114
- function X(o, t) {
114
+ function X(r, t) {
115
115
  const e = {
116
116
  CART_ITEMS: `{{Abandoned Cart Item (${t}) Url}}`,
117
117
  BROWSED_ITEMS: `{{Browsed Item (${t}) Url}}`,
118
118
  PURCHASED_ITEMS: `{{Purchased Item (${t}) Url}}`
119
119
  };
120
- return e[o] || e.CART_ITEMS;
120
+ return e[r] || e.CART_ITEMS;
121
121
  }
122
122
  class tt {
123
123
  constructor() {
@@ -128,41 +128,41 @@ class tt {
128
128
  try {
129
129
  if (!this.containsItemsBlock(t))
130
130
  return this.backfillV2ProductTdAttributes(t);
131
- const e = this.removeJinjaConditionals(t), u = this.parser.parseFromString(P(e), "text/html"), a = u.querySelectorAll(
131
+ const e = this.removeJinjaConditionals(t), l = this.parser.parseFromString(P(e), "text/html"), a = l.querySelectorAll(
132
132
  "td.esd-cart-items-block, td.esd-browsed-items-block, td.esd-purchased-items-block"
133
133
  );
134
- if (F().$patch((c) => {
135
- c.migrations = { ...c.migrations, [H]: a.length };
134
+ if (F().$patch((u) => {
135
+ u.migrations = { ...u.migrations, [H]: a.length };
136
136
  }), a.length === 0)
137
- return console.warn("ItemsBlockMigrator: No blocks found with items block selectors"), this.backfillV2ProductTdAttributes(e);
138
- const n = new Set(Array.from(a).filter(q));
139
- return a.forEach((c) => {
140
- const r = this.extractConfiguration(c), i = $({
141
- orientation: r.orientation,
142
- itemsType: r.itemsType,
143
- itemId: r.itemId,
144
- currencySymbol: r.currencySymbol,
145
- currencyLocation: r.currencyLocation,
146
- formattedPrice: r.formattedPrice,
147
- configBlockAttributes: r.configBlockAttributes,
137
+ return console.warn("ItemsBlockMigrator: No blocks found with items block selectors"), this.backfillV2ProductTdAttributes(t);
138
+ const c = new Set(Array.from(a).filter(q));
139
+ return a.forEach((u) => {
140
+ const o = this.extractConfiguration(u), n = $({
141
+ orientation: o.orientation,
142
+ itemsType: o.itemsType,
143
+ itemId: o.itemId,
144
+ currencySymbol: o.currencySymbol,
145
+ currencyLocation: o.currencyLocation,
146
+ formattedPrice: o.formattedPrice,
147
+ configBlockAttributes: o.configBlockAttributes,
148
148
  migrate: !0,
149
- nameStyles: r.nameStyles,
150
- buttonStyles: r.buttonStyles,
151
- priceStyles: r.priceStyles,
152
- originalPriceStyles: r.originalPriceStyles,
153
- quantityStyles: r.quantityStyles,
154
- nodeConfig: B(r.configBlockAttributes)
149
+ nameStyles: o.nameStyles,
150
+ buttonStyles: o.buttonStyles,
151
+ priceStyles: o.priceStyles,
152
+ originalPriceStyles: o.originalPriceStyles,
153
+ quantityStyles: o.quantityStyles,
154
+ nodeConfig: v(o.configBlockAttributes)
155
155
  }), s = this.parser.parseFromString(
156
- `<table><tbody><tr>${i}</tr></tbody></table>`,
156
+ `<table><tbody><tr>${n}</tr></tbody></table>`,
157
157
  "text/html"
158
158
  ).querySelector("td");
159
- if (s && c.parentNode) {
160
- const _ = B(r.configBlockAttributes);
159
+ if (s && u.parentNode) {
160
+ const _ = v(o.configBlockAttributes);
161
161
  s.setAttribute("esd-ext-config", JSON.stringify(_)), s.setAttribute("data-type", _.type);
162
162
  const m = s.querySelector("esd-config-block");
163
- m && m.remove(), n.has(c) && (s.setAttribute("width", String(h(c))), s.classList.add("esd-container-frame")), c.parentNode.replaceChild(s, c);
163
+ m && m.remove(), c.has(u) && (s.setAttribute("width", String(I(u))), s.classList.add("esd-container-frame")), u.parentNode.replaceChild(s, u);
164
164
  }
165
- }), this.backfillV2ProductTdAttributes(D(u.documentElement.outerHTML));
165
+ }), this.backfillV2ProductTdAttributes(D(l.documentElement.outerHTML));
166
166
  } catch (e) {
167
167
  return console.error("ItemsBlockMigrator failed:", e), t;
168
168
  }
@@ -175,24 +175,24 @@ class tt {
175
175
  */
176
176
  extractConfiguration(t) {
177
177
  var M;
178
- const e = L(
178
+ const e = B(
179
179
  this.readSelfOrDescendantAttribute(t, "data-type") || K(t)
180
- ), u = this.readSelfOrDescendantAttribute(t, "data-number") || "1", a = parseInt(u) - 1, l = E[e], n = ((M = l == null ? void 0 : l[a]) == null ? void 0 : M.value) || l[0].value, c = this.extractConfigBlockAttributes(t, e, u);
181
- this.applyDomFallbacks(t, c);
182
- const r = t.querySelector('[product-attr="price"]'), i = c["data-product_price_control_currency_symbol"], d = c["data-product_price_currency_location"] || "0", s = c["data-product_price_control_formated"], _ = s !== "false" && s !== "0", A = c["data-card_orientation_control_value"] === "horizontal" ? "horizontal" : "vertical", g = t.querySelector('a[product-attr="name"]'), y = (g == null ? void 0 : g.getAttribute("style")) || void 0, b = t.querySelector('a[product-attr="button"]') ?? t.querySelector('[product-attr="button"]'), I = (b == null ? void 0 : b.getAttribute("style")) || void 0, v = (r == null ? void 0 : r.getAttribute("style")) || void 0, f = t.querySelector("p.original-price") ?? t.querySelector('[product-attr="originalPrice"]'), T = f != null && f.getAttribute("style") ? f : (f == null ? void 0 : f.closest("p")) ?? f, x = (T == null ? void 0 : T.getAttribute("style")) || void 0, C = t.querySelector('[product-attr="quantity"]'), O = (C == null ? void 0 : C.getAttribute("style")) || void 0;
180
+ ), l = this.readSelfOrDescendantAttribute(t, "data-number") || "1", a = parseInt(l) - 1, i = h[e], c = ((M = i == null ? void 0 : i[a]) == null ? void 0 : M.value) || i[0].value, u = this.extractConfigBlockAttributes(t, e, l);
181
+ this.applyDomFallbacks(t, u);
182
+ const o = t.querySelector('[product-attr="price"]'), n = u["data-product_price_control_currency_symbol"], d = u["data-product_price_currency_location"] || "0", s = u["data-product_price_control_formated"], _ = s !== "false" && s !== "0", A = u["data-card_orientation_control_value"] === "horizontal" ? "horizontal" : "vertical", g = t.querySelector('a[product-attr="name"]'), y = (g == null ? void 0 : g.getAttribute("style")) || void 0, b = t.querySelector('a[product-attr="button"]') ?? t.querySelector('[product-attr="button"]'), E = (b == null ? void 0 : b.getAttribute("style")) || void 0, L = (o == null ? void 0 : o.getAttribute("style")) || void 0, f = t.querySelector("p.original-price") ?? t.querySelector('[product-attr="originalPrice"]'), T = f != null && f.getAttribute("style") ? f : (f == null ? void 0 : f.closest("p")) ?? f, O = (T == null ? void 0 : T.getAttribute("style")) || void 0, C = t.querySelector('[product-attr="quantity"]'), x = (C == null ? void 0 : C.getAttribute("style")) || void 0;
183
183
  return {
184
184
  orientation: A,
185
185
  itemsType: e,
186
- itemId: n,
187
- currencySymbol: i,
186
+ itemId: c,
187
+ currencySymbol: n,
188
188
  currencyLocation: d,
189
189
  formattedPrice: _,
190
- configBlockAttributes: c,
190
+ configBlockAttributes: u,
191
191
  nameStyles: y,
192
- buttonStyles: I,
193
- priceStyles: v,
194
- originalPriceStyles: x,
195
- quantityStyles: O
192
+ buttonStyles: E,
193
+ priceStyles: L,
194
+ originalPriceStyles: O,
195
+ quantityStyles: x
196
196
  };
197
197
  }
198
198
  /**
@@ -204,7 +204,7 @@ class tt {
204
204
  */
205
205
  applyDomFallbacks(t, e) {
206
206
  var A, g;
207
- const u = t.querySelector("esd-config-block"), a = (...y) => !u || y.every((b) => !(u.getAttribute(b) ?? "").trim());
207
+ const l = t.querySelector("esd-config-block"), a = (...y) => !l || y.every((b) => !(l.getAttribute(b) ?? "").trim());
208
208
  Object.entries({
209
209
  image: '[product-attr="imageSrc"]',
210
210
  name: '[product-attr="name"]',
@@ -213,14 +213,14 @@ class tt {
213
213
  quantity: '[product-attr="quantity"]',
214
214
  button: '[product-attr="button"]'
215
215
  }).forEach(([y, b]) => {
216
- const I = `data-product_${y}_control_enabled`;
217
- a(I) && (e[I] = t.querySelector(b) ? "true" : "false");
216
+ const E = `data-product_${y}_control_enabled`;
217
+ a(E) && (e[E] = t.querySelector(b) ? "true" : "false");
218
218
  }), a("data-card_orientation_control_value") && (e["data-card_orientation_control_value"] = t.querySelector('[colspan="2"]') ? "vertical" : "horizontal");
219
- const n = t.querySelector('a[product-attr="button"]') ?? t.querySelector('[product-attr="button"]'), c = (A = n == null ? void 0 : n.textContent) == null ? void 0 : A.replace(/\s+/g, " ").trim();
220
- c && a("data-product_button_control_label") && (e["data-product_button_control_label"] = c);
221
- const r = (n == null ? void 0 : n.getAttribute("style")) || "";
222
- a("data-product_button_control_atw") && /display:\s*inline/.test(r) && !/(?:^|;)\s*width\s*:\s*100%/.test(r) && (e["data-product_button_control_atw"] = "false");
223
- const i = t.querySelector('[product-attr="imageSrc"]'), d = i ? this.readImageSize(i) : null, s = (d == null ? void 0 : d.height) ?? (d == null ? void 0 : d.width), _ = (d == null ? void 0 : d.width) ?? (d == null ? void 0 : d.height);
219
+ const c = t.querySelector('a[product-attr="button"]') ?? t.querySelector('[product-attr="button"]'), u = (A = c == null ? void 0 : c.textContent) == null ? void 0 : A.replace(/\s+/g, " ").trim();
220
+ u && a("data-product_button_control_label") && (e["data-product_button_control_label"] = u);
221
+ const o = (c == null ? void 0 : c.getAttribute("style")) || "";
222
+ a("data-product_button_control_atw") && /display:\s*inline/.test(o) && !/(?:^|;)\s*width\s*:\s*100%/.test(o) && (e["data-product_button_control_atw"] = "false");
223
+ const n = t.querySelector('[product-attr="imageSrc"]'), d = n ? this.readImageSize(n) : null, s = (d == null ? void 0 : d.height) ?? (d == null ? void 0 : d.width), _ = (d == null ? void 0 : d.width) ?? (d == null ? void 0 : d.height);
224
224
  s && a("data-product_image_control_image-height") && (e["data-product_image_control_image-height"] = s), _ && a("data-product_image_control_image-width") && (e["data-product_image_control_image-width"] = _), this.applyPriceDomFallbacks(t, e, a);
225
225
  const m = ((g = t.querySelector('[product-attr="name"]')) == null ? void 0 : g.getAttribute("style")) || "";
226
226
  a("data-product_name_control_trim") && /white-space:\s*normal/.test(m) && (e["data-product_name_control_trim"] = "0");
@@ -232,22 +232,22 @@ class tt {
232
232
  * ₺ but reporting USD/before to the settings panel, and the first unrelated price edit wrote
233
233
  * the default back over the real value.
234
234
  */
235
- applyPriceDomFallbacks(t, e, u) {
236
- var i;
235
+ applyPriceDomFallbacks(t, e, l) {
236
+ var n;
237
237
  const a = t.querySelector('[product-attr="price"]') ?? t.querySelector('[product-attr="originalPrice"]');
238
238
  if (!a)
239
239
  return;
240
- const l = (i = a.getAttribute("data-currency_symbol")) == null ? void 0 : i.trim();
241
- l && u("data-product_price_control_currency_symbol") && (e["data-product_price_control_currency_symbol"] = l);
242
- const n = a.getAttribute("data-curency");
243
- if (n && u("data-product_price_currency_location", "data-product_price_control_curency")) {
244
- const d = n === "after" ? "1" : "0";
240
+ const i = (n = a.getAttribute("data-currency_symbol")) == null ? void 0 : n.trim();
241
+ i && l("data-product_price_control_currency_symbol") && (e["data-product_price_control_currency_symbol"] = i);
242
+ const c = a.getAttribute("data-curency");
243
+ if (c && l("data-product_price_currency_location", "data-product_price_control_curency")) {
244
+ const d = c === "after" ? "1" : "0";
245
245
  e["data-product_price_currency_location"] = d, e["data-product_price_control_curency"] = d;
246
246
  }
247
- const c = a.getAttribute("data-formated");
248
- c && u("data-product_price_control_formated") && (e["data-product_price_control_formated"] = c);
249
- const r = a.getAttribute("data-single_price");
250
- r && u("data-product_price_control_single_price") && (e["data-product_price_control_single_price"] = r);
247
+ const u = a.getAttribute("data-formated");
248
+ u && l("data-product_price_control_formated") && (e["data-product_price_control_formated"] = u);
249
+ const o = a.getAttribute("data-single_price");
250
+ o && l("data-product_price_control_single_price") && (e["data-product_price_control_single_price"] = o);
251
251
  }
252
252
  /**
253
253
  * Reads an attribute from the block element itself before falling back to a descendant.
@@ -255,8 +255,8 @@ class tt {
255
255
  * esd-config-block; when an author deletes the config block only the td's copy survives.
256
256
  */
257
257
  readSelfOrDescendantAttribute(t, e) {
258
- var u;
259
- return t.getAttribute(e) || ((u = t.querySelector(`[${e}]`)) == null ? void 0 : u.getAttribute(e)) || null;
258
+ var l;
259
+ return t.getAttribute(e) || ((l = t.querySelector(`[${e}]`)) == null ? void 0 : l.getAttribute(e)) || null;
260
260
  }
261
261
  /**
262
262
  * Reads the product image's pixel size — `width`/`height` attributes first, then px values
@@ -276,15 +276,15 @@ class tt {
276
276
  * to nothing, so only a positive integer counts as an answer.
277
277
  */
278
278
  readImageDimension(t, e) {
279
- var i;
280
- const u = (d) => {
279
+ var n;
280
+ const l = (d) => {
281
281
  const s = (d ?? "").trim().match(/^(\d+(?:\.\d+)?)(?:px)?$/i), _ = s ? Math.floor(parseFloat(s[1])) : 0;
282
282
  return _ > 0 ? String(_) : null;
283
- }, a = u((i = t.getAttribute(e)) == null ? void 0 : i.trim());
283
+ }, a = l((n = t.getAttribute(e)) == null ? void 0 : n.trim());
284
284
  if (a)
285
285
  return a;
286
- const l = t.getAttribute("style") || "", n = new RegExp(`(?:^|;)\\s*${e}:\\s*(\\d+(?:\\.\\d+)?)px`), c = new RegExp(`max-${e}:\\s*(\\d+(?:\\.\\d+)?)px`), r = l.match(n) || l.match(c);
287
- return u(r == null ? void 0 : r[1]);
286
+ const i = t.getAttribute("style") || "", c = new RegExp(`(?:^|;)\\s*${e}:\\s*(\\d+(?:\\.\\d+)?)px`), u = new RegExp(`max-${e}:\\s*(\\d+(?:\\.\\d+)?)px`), o = i.match(c) || i.match(u);
287
+ return l(o == null ? void 0 : o[1]);
288
288
  }
289
289
  /**
290
290
  * Extracts all data-* attributes from the esd-config-block element
@@ -293,27 +293,30 @@ class tt {
293
293
  * @param itemsType - The type of items (CART_ITEMS, BROWSED_ITEMS, PURCHASED_ITEMS)
294
294
  * @param itemNumber - The item number (1-based index)
295
295
  */
296
- extractConfigBlockAttributes(t, e, u) {
297
- const a = t.querySelector("esd-config-block"), l = {};
296
+ extractConfigBlockAttributes(t, e, l) {
297
+ var o;
298
+ const a = t.querySelector("esd-config-block"), i = {};
298
299
  if (a) {
299
- if (Array.from(a.attributes).forEach((c) => {
300
- c.name.startsWith("data-") && (l[c.name] = c.value);
301
- }), l["data-cart_items_select_control_value"]) {
302
- const c = l["data-cart_items_select_control_value"];
303
- if (/^\d+$/.test(c)) {
304
- const r = parseInt(c) - 1, i = E[e];
305
- i && i[r] && (l["data-cart_items_select_control_value"] = i[r].value);
300
+ if (Array.from(a.attributes).forEach((n) => {
301
+ n.name.startsWith("data-") && (i[n.name] = n.value);
302
+ }), i["data-cart_items_select_control_value"]) {
303
+ const n = i["data-cart_items_select_control_value"];
304
+ if (/^\d+$/.test(n)) {
305
+ const d = parseInt(n) - 1, s = h[e];
306
+ s && s[d] && (i["data-cart_items_select_control_value"] = s[d].value);
306
307
  }
307
308
  }
308
- if (l["data-product_price_control_curency"]) {
309
- const c = l["data-product_price_control_curency"];
310
- let r = c;
311
- c === "before" ? r = "0" : c === "after" && (r = "1"), l["data-product_price_control_curency"] = r, l["data-product_price_currency_location"] = r;
309
+ if (i["data-product_price_control_curency"]) {
310
+ const n = i["data-product_price_control_curency"];
311
+ let d = n;
312
+ n === "before" ? d = "0" : n === "after" && (d = "1"), i["data-product_price_control_curency"] = d, i["data-product_price_currency_location"] = d;
312
313
  }
313
- (!l["data-product_price_control_currency_symbol"] || l["data-product_price_control_currency_symbol"].trim() === "") && (l["data-product_price_control_currency_symbol"] = "USD");
314
+ (!i["data-product_price_control_currency_symbol"] || i["data-product_price_control_currency_symbol"].trim() === "") && (i["data-product_price_control_currency_symbol"] = "USD");
314
315
  }
315
- const n = { ...this.getDefaultConfigBlockAttributes(), ...l };
316
- return n["data-type"] = e, n["data-source"] = e, n["data-product_image_link"] = Q(e, u), n["data-product_button_link"] = X(e, u), n;
316
+ const c = { ...this.getDefaultConfigBlockAttributes(), ...i };
317
+ c["data-type"] = e, c["data-source"] = e, c["data-product_image_link"] = Q(e, l), c["data-product_button_link"] = X(e, l);
318
+ const u = (o = h[e]) == null ? void 0 : o[parseInt(l) - 1];
319
+ return !c["data-cart_items_select_control_value"] && u && (c["data-cart_items_select_control_value"] = u.value), c;
317
320
  }
318
321
  /**
319
322
  * Returns default esd-config-block attributes based on the old template structure
@@ -389,30 +392,30 @@ class tt {
389
392
  if (!t.includes("ins-product-td") || !t.includes("esd-ext-config"))
390
393
  return t;
391
394
  const e = this.parser.parseFromString(P(t), "text/html");
392
- let u = !1;
393
- const a = Array.from(e.querySelectorAll(".ins-product-td")), l = new Set(a.filter(q));
394
- return a.forEach((n) => {
395
- const c = l.has(n);
396
- !c && n.hasAttribute("width") && (n.removeAttribute("width"), u = !0), !c && n.classList.contains("esd-container-frame") && (n.classList.remove("esd-container-frame"), u = !0), n.querySelectorAll("table.ins-product-wrapper").forEach((_) => {
397
- !c && _.hasAttribute("width") && _.getAttribute("width") !== "100%" && (_.setAttribute("width", "100%"), u = !0);
395
+ let l = !1;
396
+ const a = Array.from(e.querySelectorAll(".ins-product-td")), i = new Set(a.filter(q));
397
+ return a.forEach((c) => {
398
+ const u = i.has(c);
399
+ !u && c.hasAttribute("width") && (c.removeAttribute("width"), l = !0), !u && c.classList.contains("esd-container-frame") && (c.classList.remove("esd-container-frame"), l = !0), c.querySelectorAll("table.ins-product-wrapper").forEach((_) => {
400
+ !u && _.hasAttribute("width") && _.getAttribute("width") !== "100%" && (_.setAttribute("width", "100%"), l = !0);
398
401
  const m = _.getAttribute("style");
399
- m && U(m) && (_.setAttribute("style", W(m)), _.setAttribute("width", "100%"), u = !0);
402
+ m && U(m) && (_.setAttribute("style", W(m)), _.setAttribute("width", "100%"), l = !0);
400
403
  });
401
- const r = n.getAttribute("esd-ext-config");
402
- let i = null;
404
+ const o = c.getAttribute("esd-ext-config");
405
+ let n = null;
403
406
  try {
404
- i = r ? JSON.parse(r) : null;
407
+ n = o ? JSON.parse(o) : null;
405
408
  } catch {
406
409
  }
407
- if (!i || (!n.getAttribute("data-nodup") && typeof i.priceHideDiscount == "boolean" && (n.setAttribute("data-nodup", String(i.priceHideDiscount)), u = !0), n.getAttribute("data-type")))
410
+ if (!n || (!c.getAttribute("data-nodup") && typeof n.priceHideDiscount == "boolean" && (c.setAttribute("data-nodup", String(n.priceHideDiscount)), l = !0), c.getAttribute("data-type")))
408
411
  return;
409
- const d = i.type || i.source;
412
+ const d = n.type || n.source;
410
413
  if (!d)
411
414
  return;
412
- n.setAttribute("data-type", d), u = !0;
413
- const s = typeof i.itemsSelectValue == "string" ? i.itemsSelectValue.match(/\((\d+)\)/) : null;
414
- s && n.getAttribute("data-number") !== s[1] && n.setAttribute("data-number", s[1]);
415
- }), u ? D(e.documentElement.outerHTML) : t;
415
+ c.setAttribute("data-type", d), l = !0;
416
+ const s = typeof n.itemsSelectValue == "string" ? n.itemsSelectValue.match(/\((\d+)\)/) : null;
417
+ s && c.getAttribute("data-number") !== s[1] && c.setAttribute("data-number", s[1]);
418
+ }), l ? D(e.documentElement.outerHTML) : t;
416
419
  }
417
420
  /**
418
421
  * Fast check for the presence of any items block (cart / browsed / purchased)
@@ -427,23 +430,23 @@ class tt {
427
430
  * Liquid inside esd-custom-display-condition(s) attribute values is skipped.
428
431
  */
429
432
  removeJinjaConditionals(t) {
430
- const e = [...t.matchAll(G)].map((l) => ({ start: l.index, end: l.index + l[0].length })), u = [];
431
- let a = t.replace(Y, (l, n, c) => {
432
- if (e.some(({ start: r, end: i }) => c >= r && c < i))
433
- return l;
434
- if (n === "if") {
435
- const r = z.some((i) => i.test(l));
436
- return u.push(r), r ? "" : l;
433
+ const e = [...t.matchAll(G)].map((i) => ({ start: i.index, end: i.index + i[0].length })), l = [];
434
+ let a = t.replace(Y, (i, c, u) => {
435
+ if (e.some(({ start: o, end: n }) => u >= o && u < n))
436
+ return i;
437
+ if (c === "if") {
438
+ const o = z.some((n) => n.test(i));
439
+ return l.push(o), o ? "" : i;
437
440
  }
438
- return n === "endif" && u.pop() ? "" : l;
441
+ return c === "endif" && l.pop() ? "" : i;
439
442
  });
440
443
  return a = a.replace(/\n\s*\n\s*\n/g, `
441
444
 
442
445
  `), a;
443
446
  }
444
447
  }
445
- function lt(o) {
446
- return new tt().migrate(o);
448
+ function lt(r) {
449
+ return new tt().migrate(r);
447
450
  }
448
451
  export {
449
452
  lt as migrateItemsBlock
package/dist/guido.css CHANGED
@@ -1 +1 @@
1
- @charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-9d988e4b] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.color-vision-select__dropdown[data-v-64cb50da]{z-index:20;width:387px}.accessibility-toolbar[data-v-391019bc]{gap:16px}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button svg{margin-right:0}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button .clearfix:after{content:none}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-actions-menu__dropdown[data-v-bdb3b37a]{z-index:20;width:222px}.editor-actions[data-v-9a028d08]{gap:16px}.editor-actions__divider[data-v-9a028d08]{width:1px;height:40px;background-color:#e1e1e1}.right-slot[data-v-77451c9a]{gap:16px}.header-wrapper[data-v-3c713746]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-e48cebe9]{gap:16px}.validation-error-row[data-v-e48cebe9]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-e48cebe9]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-e48cebe9]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-0c5f11a1]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-0c5f11a1]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-0c5f11a1]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-eaf8e461]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-eaf8e461]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-eaf8e461]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-eaf8e461]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-eaf8e461]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.guido-tab-bar-onboarding[data-v-219b4f7c]{z-index:21}[data-v-fcba7e99] .vueperslides__bullets{pointer-events:none!important}[data-v-fcba7e99] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-1a34025a] .vueperslides__bullets{pointer-events:none!important}[data-v-1a34025a] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-8fc96a58] .vueperslides__bullets,[data-v-ec2027ff] .vueperslides__bullets,[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}.guido-display-condition-create__separator[data-v-929822bc]{height:1px;margin:0 0 24px;background-image:linear-gradient(to right,currentColor 1px,transparent 1px);background-size:5px 1px}.guido-display-condition-create__methods[data-v-929822bc]{gap:16px}.guido-display-condition-select-root[data-v-0d740001] .in-drawer__footer{justify-content:flex-start}.guido-display-condition-select__delete-modal[data-v-0d740001]{position:relative;z-index:145}.guido-display-condition-select__delete-modal[data-v-0d740001] .in-modal-v2-wrapper__header-title{margin-bottom:0}.guido-display-condition-select-root[data-v-0d740001] .in-drawer__content>div{display:flex;flex-direction:column;min-height:100%}.guido-display-condition-select__list[data-v-0d740001]{display:flex;flex-direction:column;gap:24px;margin:0;padding:0;list-style:none}.guido-display-condition-card__header[data-v-0d740001]{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:15px}.guido-display-condition-card__text[data-v-0d740001]{min-width:0}.guido-display-condition-card__name[data-v-0d740001],.guido-display-condition-card__description[data-v-0d740001]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.guido-display-condition-card__actions[data-v-0d740001]{display:flex;flex-shrink:0;align-items:center;gap:16px}.guido-display-condition-card__split[data-v-0d740001]{position:relative;display:flex;gap:1px}.guido-display-condition-card__menu[data-v-0d740001]{z-index:2;min-width:115px}.guido-display-condition-card__divider[data-v-0d740001]{width:1px;height:24px}.guido-display-condition-card__code[data-v-0d740001]{margin:1px 15px 15px;padding:8px;font-family:inherit;white-space:pre-wrap;word-break:break-word}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}.ambiguous-dynamic-content-modal__content[data-v-2643213c]{padding-bottom:150px}
1
+ @charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-9d988e4b] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.color-vision-select__dropdown[data-v-64cb50da]{z-index:20;width:387px}.accessibility-toolbar[data-v-391019bc]{gap:16px}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button svg{margin-right:0}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button .clearfix:after{content:none}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-actions-menu__dropdown[data-v-0e63ebe1]{z-index:20;width:222px}.editor-actions[data-v-9a028d08]{gap:16px}.editor-actions__divider[data-v-9a028d08]{width:1px;height:40px;background-color:#e1e1e1}.right-slot[data-v-77451c9a]{gap:16px}.header-wrapper[data-v-3c713746]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-e48cebe9]{gap:16px}.validation-error-row[data-v-e48cebe9]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-e48cebe9]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-e48cebe9]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-0c5f11a1]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-0c5f11a1]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-0c5f11a1]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-eaf8e461]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-eaf8e461]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-eaf8e461]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-eaf8e461]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-eaf8e461]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.guido-tab-bar-onboarding[data-v-219b4f7c]{z-index:21}[data-v-fcba7e99] .vueperslides__bullets{pointer-events:none!important}[data-v-fcba7e99] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-1a34025a] .vueperslides__bullets{pointer-events:none!important}[data-v-1a34025a] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-8fc96a58] .vueperslides__bullets,[data-v-ec2027ff] .vueperslides__bullets,[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}.guido-display-condition-create__separator[data-v-929822bc]{height:1px;margin:0 0 24px;background-image:linear-gradient(to right,currentColor 1px,transparent 1px);background-size:5px 1px}.guido-display-condition-create__methods[data-v-929822bc]{gap:16px}.guido-display-condition-select-root[data-v-0d740001] .in-drawer__footer{justify-content:flex-start}.guido-display-condition-select__delete-modal[data-v-0d740001]{position:relative;z-index:145}.guido-display-condition-select__delete-modal[data-v-0d740001] .in-modal-v2-wrapper__header-title{margin-bottom:0}.guido-display-condition-select-root[data-v-0d740001] .in-drawer__content>div{display:flex;flex-direction:column;min-height:100%}.guido-display-condition-select__list[data-v-0d740001]{display:flex;flex-direction:column;gap:24px;margin:0;padding:0;list-style:none}.guido-display-condition-card__header[data-v-0d740001]{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:15px}.guido-display-condition-card__text[data-v-0d740001]{min-width:0}.guido-display-condition-card__name[data-v-0d740001],.guido-display-condition-card__description[data-v-0d740001]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.guido-display-condition-card__actions[data-v-0d740001]{display:flex;flex-shrink:0;align-items:center;gap:16px}.guido-display-condition-card__split[data-v-0d740001]{position:relative;display:flex;gap:1px}.guido-display-condition-card__menu[data-v-0d740001]{z-index:2;min-width:115px}.guido-display-condition-card__divider[data-v-0d740001]{width:1px;height:24px}.guido-display-condition-card__code[data-v-0d740001]{margin:1px 15px 15px;padding:8px;font-family:inherit;white-space:pre-wrap;word-break:break-word}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}.ambiguous-dynamic-content-modal__content[data-v-2643213c]{padding-bottom:150px}
@@ -1,4 +1,4 @@
1
- const o = "3.30.0-beta.949c781", s = { stripo: { version: "2.87.0" } }, t = {
1
+ const o = "3.30.0-beta.94a3b3b", s = { stripo: { version: "2.87.0" } }, t = {
2
2
  version: o,
3
3
  guido: s
4
4
  };
@@ -1,4 +1,8 @@
1
1
  import type { ColorVisionDeficiency } from '@@/Types/api/accessibility-api';
2
+ type EditorReadiness = {
3
+ loadingStatus: boolean;
4
+ isStripoInitialized: boolean;
5
+ };
2
6
  export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEditor", {
3
7
  loadingStatus: boolean;
4
8
  isCodeEditorOpen: boolean;
@@ -17,6 +21,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
17
21
  syncModulesEnabled: boolean;
18
22
  trackIdSessionFloor: number;
19
23
  }, {
24
+ isEditorUnavailable: (state: EditorReadiness) => boolean;
20
25
  isEditorToolbarVisible: (state: {
21
26
  loadingStatus: boolean;
22
27
  isCodeEditorOpen: boolean;
@@ -473,3 +478,4 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
473
478
  trackIdSessionFloor: number;
474
479
  }>) => boolean;
475
480
  }, {}>;
481
+ export {};
@@ -1,5 +1,5 @@
1
- import { defineStore as e } from "pinia";
2
- const o = e("guidoEditor", {
1
+ import { defineStore as s } from "pinia";
2
+ const e = (i) => i.loadingStatus || !i.isStripoInitialized, n = s("guidoEditor", {
3
3
  state: () => ({
4
4
  loadingStatus: !0,
5
5
  isCodeEditorOpen: !1,
@@ -24,25 +24,26 @@ const o = e("guidoEditor", {
24
24
  trackIdSessionFloor: 0
25
25
  }),
26
26
  getters: {
27
+ isEditorUnavailable: e,
27
28
  // Middle Slot
28
29
  isEditorToolbarVisible: (i) => !i.isVersionHistoryOpen && !i.isPreviewModeOpen && !i.isAccessibilityTestingOpen,
29
- isUndoButtonDisabled: (i) => i.loadingStatus || i.isPreviewModeOpen,
30
- isRedoButtonDisabled: (i) => i.loadingStatus || i.isPreviewModeOpen,
31
- isCodeEditorButtonDisabled: (i) => i.loadingStatus || i.isPreviewModeOpen,
32
- isPreviewButtonDisabled: (i) => i.loadingStatus,
33
- isViewOptionsDisabled: (i) => i.loadingStatus || i.isPreviewModeOpen,
30
+ isUndoButtonDisabled: (i) => e(i) || i.isPreviewModeOpen,
31
+ isRedoButtonDisabled: (i) => e(i) || i.isPreviewModeOpen,
32
+ isCodeEditorButtonDisabled: (i) => e(i) || i.isPreviewModeOpen,
33
+ isPreviewButtonDisabled: (i) => e(i),
34
+ isViewOptionsDisabled: (i) => e(i) || i.isPreviewModeOpen,
34
35
  // Right Slot
35
36
  isNormalMode: (i) => !i.isVersionHistoryOpen && !i.isAccessibilityTestingOpen,
36
- isVersionHistoryButtonDisabled: (i) => i.loadingStatus || i.isPreviewModeOpen,
37
- isExportButtonDisabled: (i) => i.loadingStatus || i.isVersionHistoryOpen,
38
- isSaveAsButtonDisabled: (i) => i.loadingStatus || i.isVersionHistoryOpen,
39
- isTestButtonDisabled: (i) => i.loadingStatus || i.isVersionHistoryOpen,
40
- isSaveButtonDisabled: (i) => i.loadingStatus || i.isVersionHistoryOpen || i.isPreviewModeOpen || i.isAccessibilityTestingOpen,
37
+ isVersionHistoryButtonDisabled: (i) => e(i) || i.isPreviewModeOpen,
38
+ isExportButtonDisabled: (i) => e(i) || i.isVersionHistoryOpen,
39
+ isSaveAsButtonDisabled: (i) => e(i) || i.isVersionHistoryOpen,
40
+ isTestButtonDisabled: (i) => e(i) || i.isVersionHistoryOpen,
41
+ isSaveButtonDisabled: (i) => e(i) || i.isVersionHistoryOpen || i.isPreviewModeOpen || i.isAccessibilityTestingOpen,
41
42
  // Accessibility Test is absent on purpose: it only simulates, but its Apply / Auto-tune
42
43
  // edit the document, so pausing autosave there would lose those fixes.
43
- isInSaveableState: (i) => !i.loadingStatus && !i.isVersionHistoryOpen && !i.isPreviewModeOpen && !i.isCodeEditorOpen
44
+ isInSaveableState: (i) => !e(i) && !i.isVersionHistoryOpen && !i.isPreviewModeOpen && !i.isCodeEditorOpen
44
45
  }
45
46
  });
46
47
  export {
47
- o as useEditorStore
48
+ n as useEditorStore
48
49
  };
@@ -1,129 +1,128 @@
1
- import { isNewPriceFormatRoot as G, ITEMS_PRICE_FORMAT_ATTR as N, currencyPositionFromLocation as Y, ITEMS_CURRENCY_ATTR as U, isCustomCurrencySymbol as B } from "../extensions/Blocks/Items/constants/currency.js";
2
- import { productPairs as k } from "../extensions/Blocks/Items/enums/productEnums.js";
3
- import { escapeReplacement as v } from "../extensions/Blocks/Items/utils/nodeConfigUtils.js";
4
- import { preserveTextStyles as w } from "./preserveTextStyles.js";
5
- import { protectTableText as X, restoreTableText as j } from "./protectTableText.js";
6
- import { unwrapProductNameLinks as Q } from "./unwrapProductNameLink.js";
7
- const q = {
1
+ import { isNewPriceFormatRoot as W, ITEMS_PRICE_FORMAT_ATTR as w, currencyPositionFromLocation as V, ITEMS_CURRENCY_ATTR as x, isCustomCurrencySymbol as G } from "../extensions/Blocks/Items/constants/currency.js";
2
+ import { productPairs as N } from "../extensions/Blocks/Items/enums/productEnums.js";
3
+ import { preserveTextStyles as H } from "./preserveTextStyles.js";
4
+ import { protectTableText as Y, restoreTableText as B } from "./protectTableText.js";
5
+ import { unwrapProductNameLinks as X } from "./unwrapProductNameLink.js";
6
+ const D = {
8
7
  CART_ITEMS: "ins_apr",
9
8
  BROWSED_ITEMS: "browsed_item",
10
9
  PURCHASED_ITEMS: "purchased_item"
11
- }, W = (r) => r.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->");
12
- function z(r, h, p) {
13
- let u = h;
14
- for (; u > 0 && /\s/.test(r[u - 1]); )
15
- u -= 1;
16
- return p.some((A) => r.endsWith(A, u));
10
+ }, U = (r) => r.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->");
11
+ function v(r, _, u) {
12
+ let l = _;
13
+ for (; l > 0 && /\s/.test(r[l - 1]); )
14
+ l -= 1;
15
+ return u.some((p) => r.endsWith(p, l));
17
16
  }
18
- const J = /(\s)href=(["'])(?:[^"']*#!|#)?\2/gi;
19
- function K(r, h) {
20
- var u;
21
- const p = r.ownerDocument.createTreeWalker(r, NodeFilter.SHOW_COMMENT);
22
- for (let A = p.nextNode(); A; A = p.nextNode())
23
- (u = A.nodeValue) != null && u.includes("[if mso]") && (A.nodeValue = A.nodeValue.replace(J, (L, P) => `${P}href="${h}"`));
17
+ const j = /(\s)href=(["'])(?:[^"']*#!|#)?\2/gi;
18
+ function Q(r, _) {
19
+ var l;
20
+ const u = r.ownerDocument.createTreeWalker(r, NodeFilter.SHOW_COMMENT);
21
+ for (let p = u.nextNode(); p; p = u.nextNode())
22
+ (l = p.nodeValue) != null && l.includes("[if mso]") && (p.nodeValue = p.nodeValue.replace(j, (I, E) => `${E}href="${_}"`));
24
23
  }
25
- function Z(r) {
24
+ function z(r) {
26
25
  return {
27
26
  isFormatted: r.getAttribute("data-formated") === "true",
28
27
  isSinglePrice: r.getAttribute("data-single_price") === "true",
29
- currencyPosition: r.getAttribute(U.POSITION) || "before",
30
- configuredSymbol: (r.getAttribute(U.SYMBOL) || "").trim()
28
+ currencyPosition: r.getAttribute(x.POSITION) || "before",
29
+ configuredSymbol: (r.getAttribute(x.SYMBOL) || "").trim()
31
30
  };
32
31
  }
33
- function tt(r) {
32
+ function J(r) {
34
33
  return {
35
34
  isFormatted: !1,
36
- isSinglePrice: r.getAttribute(N.SINGLE_PRICE) === "true",
37
- currencyPosition: Y(
38
- r.getAttribute(N.ALIGNMENT) ?? void 0
35
+ isSinglePrice: r.getAttribute(w.SINGLE_PRICE) === "true",
36
+ currencyPosition: V(
37
+ r.getAttribute(w.ALIGNMENT) ?? void 0
39
38
  ),
40
- configuredSymbol: (r.getAttribute(N.SYMBOL) || "").trim()
39
+ configuredSymbol: (r.getAttribute(w.SYMBOL) || "").trim()
41
40
  };
42
41
  }
43
- function et(r, h, p) {
44
- const { isFormatted: u, isSinglePrice: A, currencyPosition: L, configuredSymbol: P } = p;
42
+ function K(r, _, u) {
43
+ const { isFormatted: l, isSinglePrice: p, currencyPosition: I, configuredSymbol: E } = u;
45
44
  let y;
46
- A ? y = u ? r.SINGLE_PRICE_FORMATTED : r.SINGLE_PRICE : y = u ? r.PRICE_FORMATTED : r.PRICE;
47
- const E = r.CURRENCY;
48
- let F = `{{${y}_${h}}}`, R = "";
49
- return B(P) ? R = P : E && (R = `{{${E}_${h}}}`), R && (F = L === "after" ? `${F} ${R}` : `${R} ${F}`), F;
45
+ p ? y = l ? r.SINGLE_PRICE_FORMATTED : r.SINGLE_PRICE : y = l ? r.PRICE_FORMATTED : r.PRICE;
46
+ const b = r.CURRENCY;
47
+ let S = `{{${y}_${_}}}`, o = "";
48
+ return G(E) ? o = E : b && (o = `{{${b}_${_}}}`), o && (S = I === "after" ? `${S} ${o}` : `${o} ${S}`), S;
50
49
  }
51
- function at(r) {
52
- const h = W(X(r)), p = new DOMParser().parseFromString(h, "text/html");
53
- Q(p);
54
- const u = k.PAIRS_FOR_EXTENSION;
55
- Object.entries(u).forEach(([o, T]) => {
56
- p.querySelectorAll(".ins-product-td").forEach((n) => {
57
- const S = n.getAttribute("data-number") || "1", I = n.getAttribute("data-type") || "CART_ITEMS";
50
+ function nt(r) {
51
+ const _ = U(Y(r)), u = new DOMParser().parseFromString(_, "text/html");
52
+ X(u);
53
+ const l = N.PAIRS_FOR_EXTENSION;
54
+ Object.entries(l).forEach(([o, R]) => {
55
+ u.querySelectorAll(".ins-product-td").forEach((n) => {
56
+ const m = n.getAttribute("data-number") || "1", C = n.getAttribute("data-type") || "CART_ITEMS";
58
57
  n.querySelectorAll(`[product-attr="${o}"]`).forEach((t) => {
59
- var g, M, x, D;
60
- const m = t.getAttribute("data-type") || I, c = t.getAttribute("data-number") || S, f = T[m];
61
- if (f)
58
+ var h, L, k, O;
59
+ const P = t.getAttribute("data-type") || C, c = t.getAttribute("data-number") || m, d = R[P];
60
+ if (d)
62
61
  switch (o) {
63
62
  case "imageSrc": {
64
63
  let e = null, i = null;
65
64
  if (t.tagName === "IMG" ? (e = t, i = e.closest("a")) : (e = t.querySelector("img"), i = t.querySelector("a") || t.closest("a")), !e)
66
65
  break;
67
- const d = f.DEFAULT, a = f.ATTR;
68
- if (d && e.src) {
69
- const l = e.src;
70
- d.some((C) => {
71
- const $ = C.split("/").pop() || "", V = l.split("/").pop() || "";
72
- return l.includes(C) || l.includes($) || V === $;
66
+ const A = d.DEFAULT, a = d.ATTR;
67
+ if (A && e.src) {
68
+ const f = e.src;
69
+ A.some((F) => {
70
+ const T = F.split("/").pop() || "", q = f.split("/").pop() || "";
71
+ return f.includes(F) || f.includes(T) || q === T;
73
72
  }) && (e.src = `{{${a}_${c}}}`);
74
73
  }
75
- const s = (M = (g = u.name) == null ? void 0 : g[m]) == null ? void 0 : M.ATTR;
74
+ const s = (L = (h = l.name) == null ? void 0 : h[P]) == null ? void 0 : L.ATTR;
76
75
  if (s && e.setAttribute("alt", `{{${s}_${c}}}`), i) {
77
- const l = (x = u.itemLink) == null ? void 0 : x[m];
78
- if (l) {
79
- const H = l.HREF, C = l.DEFAULT_HREF || "#!", $ = i.href;
80
- ($ === "#" || $ === "" || $.endsWith("#!") || $.endsWith(C) || $ === `${window.location.href}${C}` || !$ || $ === window.location.href) && (i.href = `{{${H}_${c}}}`);
76
+ const f = (k = l.itemLink) == null ? void 0 : k[P];
77
+ if (f) {
78
+ const M = f.HREF, F = f.DEFAULT_HREF || "#!", T = i.href;
79
+ (T === "#" || T === "" || T.endsWith("#!") || T.endsWith(F) || T === `${window.location.href}${F}` || !T || T === window.location.href) && (i.href = `{{${M}_${c}}}`);
81
80
  }
82
81
  }
83
82
  break;
84
83
  }
85
84
  case "name": {
86
- const e = f, i = e.ATTR, d = e.DEFAULT_HREF || "#!", a = e.HREF;
87
- t.textContent && (t.innerHTML = w(t, `{{${i}_${c}}}`));
85
+ const e = d, i = e.ATTR, A = e.DEFAULT_HREF || "#!", a = e.HREF;
86
+ t.textContent && (t.innerHTML = H(t, `{{${i}_${c}}}`));
88
87
  const s = t.closest("a") || (t.tagName === "A" ? t : null);
89
88
  if (s && a) {
90
- const l = s.href, H = `${window.location.href}${d}`;
91
- (l === H || l.endsWith(d)) && (s.href = `{{${a}_${c}}}`);
89
+ const f = s.href, M = `${window.location.href}${A}`;
90
+ (f === M || f.endsWith(A)) && (s.href = `{{${a}_${c}}}`);
92
91
  }
93
92
  break;
94
93
  }
95
94
  case "price":
96
95
  case "originalPrice": {
97
- const e = f, i = G(n) ? tt(n) : Z(t);
98
- t.innerHTML = w(t, et(e, c, i));
96
+ const e = d, i = W(n) ? J(n) : z(t);
97
+ t.innerHTML = H(t, K(e, c, i));
99
98
  break;
100
99
  }
101
100
  case "quantity": {
102
- const e = f, i = e.ATTR, d = [e.DEFAULT, ...e.LEGACY_DEFAULTS], a = (D = t.textContent) == null ? void 0 : D.trim();
103
- a && d.includes(a) && (t.innerHTML = w(t, `{{${i}_${c}}}`));
101
+ const e = d, i = e.ATTR, A = [e.DEFAULT, ...e.LEGACY_DEFAULTS], a = (O = t.textContent) == null ? void 0 : O.trim();
102
+ a && A.includes(a) && (t.innerHTML = H(t, `{{${i}_${c}}}`));
104
103
  break;
105
104
  }
106
105
  case "button": {
107
- const e = f, i = e.HREF, d = e.DEFAULT_HREF || "#!", a = t.tagName === "A" ? t : t.querySelector("a");
106
+ const e = d, i = e.HREF, A = e.DEFAULT_HREF || "#!", a = t.tagName === "A" ? t : t.querySelector("a");
108
107
  if (a) {
109
- const s = a.href || "", l = `${window.location.href}${d}`;
110
- (s === "" || s === "#" || s === l || s.endsWith(d) || s.endsWith("#!") || s === window.location.href) && (a.href = `{{${i}_${c}}}`);
108
+ const s = a.href || "", f = `${window.location.href}${A}`;
109
+ (s === "" || s === "#" || s === f || s.endsWith(A) || s.endsWith("#!") || s === window.location.href) && (a.href = `{{${i}_${c}}}`);
111
110
  }
112
- K(t, `{{${i}_${c}}}`);
111
+ Q(t, `{{${i}_${c}}}`);
113
112
  break;
114
113
  }
115
114
  case "itemLink": {
116
- const e = f, i = e.HREF, d = e.DEFAULT_HREF || "#!", a = t;
115
+ const e = d, i = e.HREF, A = e.DEFAULT_HREF || "#!", a = t;
117
116
  if (a.href) {
118
- const s = a.href, l = `${window.location.href}${d}`;
119
- (s === l || s.endsWith(d)) && (a.href = `{{${i}_${c}}}`);
117
+ const s = a.href, f = `${window.location.href}${A}`;
118
+ (s === f || s.endsWith(A)) && (a.href = `{{${i}_${c}}}`);
120
119
  }
121
120
  break;
122
121
  }
123
122
  default: {
124
- if ("ATTR" in f) {
125
- const e = f.ATTR;
126
- t.textContent && (t.innerHTML = w(t, `{{${e}_${c}}}`));
123
+ if ("ATTR" in d) {
124
+ const e = d.ATTR;
125
+ t.textContent && (t.innerHTML = H(t, `{{${e}_${c}}}`));
127
126
  }
128
127
  break;
129
128
  }
@@ -131,49 +130,40 @@ function at(r) {
131
130
  });
132
131
  });
133
132
  });
134
- const A = h.match(/<!DOCTYPE[^>]*>/i), L = A ? `${A[0]}
135
- ` : "", P = p.querySelectorAll(".ins-product-td"), y = [];
136
- P.forEach((o) => {
137
- const T = o.getAttribute("data-type") || "CART_ITEMS", _ = o.getAttribute("data-number") || "1", n = o.outerHTML;
138
- y.push({
139
- element: o,
140
- outerHtml: n,
141
- type: T,
142
- number: _
143
- });
144
- });
145
- let E = L + p.documentElement.outerHTML;
146
- y.reverse().forEach(({ outerHtml: o, type: T, number: _ }) => {
147
- const n = q[T], S = n ? `${n}_total_product_kind` : "";
148
- if (S) {
149
- const b = parseInt(_) - 1, c = `${`{% if ${S} > ${b} %}`}${o}{% endif %}`;
150
- E = E.replace(o, v(c));
151
- }
133
+ const p = _.match(/<!DOCTYPE[^>]*>/i), I = p ? `${p[0]}
134
+ ` : "";
135
+ u.querySelectorAll(".ins-product-td").forEach((o) => {
136
+ const R = o.getAttribute("data-type") || "CART_ITEMS", $ = D[R];
137
+ if (!$)
138
+ return;
139
+ const n = parseInt(o.getAttribute("data-number") || "1") - 1;
140
+ o.before(u.createComment(`{% if ${$}_total_product_kind > ${n} %}`)), o.after(u.createComment("{% endif %}"));
152
141
  });
153
- const F = p.querySelectorAll('[product-attr="originalPrice"][data-type]'), R = /* @__PURE__ */ new Map(), O = /* @__PURE__ */ new Set();
154
- return F.forEach((o) => {
142
+ let E = I + u.documentElement.outerHTML;
143
+ const y = u.querySelectorAll('[product-attr="originalPrice"][data-type]'), b = /* @__PURE__ */ new Map(), S = /* @__PURE__ */ new Set();
144
+ return y.forEach((o) => {
155
145
  var t;
156
- const T = o.getAttribute("data-number"), _ = o.getAttribute("data-type");
157
- if (!T || !q[_])
146
+ const R = o.getAttribute("data-number"), $ = o.getAttribute("data-type");
147
+ if (!R || !D[$])
158
148
  return;
159
149
  const n = o.closest(".product-original-price-class");
160
- if (!n || O.has(n))
150
+ if (!n || S.has(n))
161
151
  return;
162
- O.add(n);
163
- const S = n.outerHTML, I = (t = o.closest(".ins-product-td")) == null ? void 0 : t.getAttribute("data-nodup"), b = R.get(S) ?? { number: T, type: _, wrap: [] };
164
- b.wrap.push(I !== "false"), R.set(S, b);
165
- }), R.forEach(({ number: o, type: T, wrap: _ }, n) => {
166
- if (n.includes("{% if") || !_.some(Boolean))
152
+ S.add(n);
153
+ const m = n.outerHTML, C = (t = o.closest(".ins-product-td")) == null ? void 0 : t.getAttribute("data-nodup"), g = b.get(m) ?? { number: R, type: $, wrap: [] };
154
+ g.wrap.push(C !== "false"), b.set(m, g);
155
+ }), b.forEach(({ number: o, type: R, wrap: $ }, n) => {
156
+ if (n.includes("{% if") || !$.some(Boolean))
167
157
  return;
168
- const S = k.PAIRS_FOR_EXTENSION.price[T].PRICE, I = k.PAIRS_FOR_EXTENSION.originalPrice[T].PRICE, b = `{% if ${S}_${o} != ${I}_${o} %}`, t = [b, W(b)];
169
- let m = "", c = 0, f = 0, g = E.indexOf(n);
170
- for (; g !== -1; ) {
171
- const M = _[f] === !0 && !z(E, g, t);
172
- m += E.slice(c, g) + (M ? `${b}${n}{% endif %}` : n), c = g + n.length, f += 1, g = E.indexOf(n, c);
158
+ const m = N.PAIRS_FOR_EXTENSION.price[R].PRICE, C = N.PAIRS_FOR_EXTENSION.originalPrice[R].PRICE, g = `{% if ${m}_${o} != ${C}_${o} %}`, t = [g, U(g)];
159
+ let P = "", c = 0, d = 0, h = E.indexOf(n);
160
+ for (; h !== -1; ) {
161
+ const L = $[d] === !0 && !v(E, h, t);
162
+ P += E.slice(c, h) + (L ? `${g}${n}{% endif %}` : n), c = h + n.length, d += 1, h = E.indexOf(n, c);
173
163
  }
174
- E = m + E.slice(c);
175
- }), j(E.replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("&lt;!--{%", "{%").replaceAll("%}--&gt;", "%}"));
164
+ E = P + E.slice(c);
165
+ }), B(E.replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("&lt;!--{%", "{%").replaceAll("%}--&gt;", "%}"));
176
166
  }
177
167
  export {
178
- at as pairProductVariables
168
+ nt as pairProductVariables
179
169
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.30.0-beta.949c781",
3
+ "version": "3.30.0-beta.94a3b3b",
4
4
  "description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
5
5
  "main": "./dist/guido.umd.cjs",
6
6
  "module": "./dist/library.js",