@useinsider/guido 3.1.0 → 3.1.1-beta.0b09ab4

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.
@@ -61,7 +61,7 @@ const m = {
61
61
  value: t()
62
62
  })
63
63
  )
64
- }), R = o({
64
+ }), A = o({
65
65
  /** Initial HTML content */
66
66
  html: e(t(), ""),
67
67
  /** Initial CSS content */
@@ -71,11 +71,13 @@ const m = {
71
71
  c(f),
72
72
  []
73
73
  ),
74
+ /** Valid custom field attribute names from the partner's categorized fields */
75
+ customFieldAttributes: e(c(t()), []),
74
76
  /** Selected unsubscribe page IDs */
75
77
  selectedUnsubscribePages: e(c(p()), []),
76
78
  /** Force recreate template in Stripo storage (use true when updating externally modified templates) */
77
79
  forceRecreate: e(a(), !1)
78
- }), A = o({
80
+ }), R = o({
79
81
  /** Sender display name */
80
82
  senderName: e(t(), ""),
81
83
  /** Email subject line */
@@ -88,7 +90,7 @@ const m = {
88
90
  /** Migration date for template compatibility */
89
91
  migrationDate: e(p(), 1759696858),
90
92
  /** Email header settings */
91
- emailHeader: e(A, { senderName: "", subject: "" }),
93
+ emailHeader: e(R, { senderName: "", subject: "" }),
92
94
  /** Folder name for user-saved modules (used by Stripo plugin panel for path construction) */
93
95
  savedModulesFolderName: e(t(), b.SAVED_MODULES),
94
96
  /** Folder name for default/prebuilt modules (used by Stripo plugin panel for path construction) */
@@ -205,7 +207,7 @@ const m = {
205
207
  "externalValidation must be a function"
206
208
  )
207
209
  )
208
- }), H = o({
210
+ }), F = o({
209
211
  // Required sections
210
212
  /** Identity configuration (required) */
211
213
  identity: h,
@@ -213,7 +215,7 @@ const m = {
213
215
  partner: y,
214
216
  // Optional sections (with defaults)
215
217
  /** Template content and presets */
216
- template: e(R, {}),
218
+ template: e(A, {}),
217
219
  /** Editor settings */
218
220
  editor: e(C, {}),
219
221
  /** UI configuration */
@@ -237,9 +239,9 @@ export {
237
239
  E as DefaultBlockTypeSchema,
238
240
  f as DynamicContentSchema,
239
241
  C as EditorSchema,
240
- A as EmailHeaderSchema,
242
+ R as EmailHeaderSchema,
241
243
  I as FeaturesSchema,
242
- H as GuidoConfigSchema,
244
+ F as GuidoConfigSchema,
243
245
  h as IdentitySchema,
244
246
  m as MessageType,
245
247
  y as PartnerSchema,
@@ -247,6 +249,6 @@ export {
247
249
  M as RegexRuleSchema,
248
250
  N as RemoveRuleSchema,
249
251
  L as ReplaceRuleSchema,
250
- R as TemplateSchema,
252
+ A as TemplateSchema,
251
253
  T as UISchema
252
254
  };
@@ -9,76 +9,76 @@ import { useHttp as j } from "./useHttp.js";
9
9
  import { useToaster as q } from "./useToaster.js";
10
10
  import { useTranslations as z } from "./useTranslations.js";
11
11
  const K = /recommendation-id="(\d+)"/g;
12
- function U(i) {
13
- return [...i.matchAll(K)].map((u) => u[1]);
12
+ function U(a) {
13
+ return [...a.matchAll(K)].map((u) => u[1]);
14
14
  }
15
- function Y(i, u) {
16
- return u.some((d) => i.startsWith(`${d}_`));
15
+ function Y(a, u) {
16
+ return u.some((d) => a.startsWith(`${d}_`));
17
17
  }
18
18
  const ce = () => {
19
19
  var y, h;
20
- const { showToaster: i } = q(), { post: u } = j(), { config: d } = L(), r = z(), g = $(), p = ((h = (y = d.value) == null ? void 0 : y.partner) == null ? void 0 : h.messageType) === V.transactional, w = async (e) => {
20
+ const { showToaster: a } = q(), { post: u } = j(), { config: d } = L(), r = z(), g = $(), p = ((h = (y = d.value) == null ? void 0 : y.partner) == null ? void 0 : h.messageType) === V.transactional, b = async (e) => {
21
21
  const t = await u(
22
22
  "/newsletter/template-library/check-template-html-body",
23
23
  { html: X(e) }
24
24
  ), { status: n, message: l } = t.data;
25
- return n || i({
25
+ return n || a({
26
26
  type: c.Alert,
27
27
  message: n === void 0 ? l : r("newsletter.invalid-url-link-for-toaster")
28
- }), r(P), l === r(G) && i({
28
+ }), r(P), l === r(G) && a({
29
29
  type: c.Alert,
30
30
  message: r("newsletter.already-in-progress")
31
31
  }), n;
32
- }, b = (e) => !["if", "endif", "else", "elif", "now"].includes(e.toLowerCase()), S = (e) => ["if", "endif"].includes(e.toLowerCase()), E = (e, s) => {
32
+ }, w = (e) => !["if", "endif", "else", "elif", "now"].includes(e.toLowerCase()), S = (e) => ["if", "endif"].includes(e.toLowerCase()), E = (e, s) => {
33
33
  const t = e.match(/({%(.*?)%})/g);
34
34
  let n = !0;
35
35
  return t !== null && !p && t.forEach((l) => {
36
36
  const o = l.slice(2, -2).trim().match(/(".*?"|[^"\s]+)(?=\s*|\s*$)/g);
37
37
  if (o && o.length > 0) {
38
- const [a] = o;
39
- b(a) && !s.includes(a) && (i({
38
+ const [i] = o;
39
+ w(i) && !s.includes(i) && (a({
40
40
  type: c.Warning,
41
41
  message: r("custom-fields.invalid-custom-fields")
42
42
  }), n = !1);
43
43
  }
44
44
  }), n;
45
45
  }, A = async (e, s, t) => {
46
- const n = t ? await w(e) : !0;
46
+ const n = t ? await b(e) : !0;
47
47
  return E(e, s) && n;
48
- }, I = (e) => e.length > 0 ? !0 : (i({
48
+ }, I = (e) => e.length > 0 ? !0 : (a({
49
49
  type: c.Warning,
50
50
  message: r("newsletter.html-content-is-empty")
51
51
  }), !1), k = (e) => {
52
52
  const s = (e.match(/{/gm) || []).length, t = (e.match(/}/gm) || []).length;
53
- return s > t && i({
53
+ return s > t && a({
54
54
  type: c.Warning,
55
55
  message: r("custom-fields.missing-closing-braces")
56
- }), s < t && i({
56
+ }), s < t && a({
57
57
  type: c.Warning,
58
58
  message: r("custom-fields.missing-opening-braces")
59
59
  }), s === t;
60
60
  }, x = (e) => {
61
61
  const s = e.match(/{{\s*(\w+\s+((\w+\|\w+)|(\w+)))\s*}}/gm) === null;
62
- return s || i({
62
+ return s || a({
63
63
  type: c.Warning,
64
64
  message: r("custom-fields.invalid-custom-fields")
65
65
  }), s;
66
66
  }, T = (e, s) => {
67
67
  const t = e.match(/{{([a-zA-Z0-9_\s]*)}}/gm);
68
68
  if (t && !p) {
69
- const n = new Set(s.map((a) => a.toLowerCase())), l = U(e), o = [];
70
- if (t.forEach((a) => {
71
- const m = a.slice(2, -2).trim().toLowerCase();
69
+ const n = new Set(s.map((i) => i.toLowerCase())), l = U(e), o = [];
70
+ if (t.forEach((i) => {
71
+ const m = i.slice(2, -2).trim().toLowerCase();
72
72
  (!n.has(m) || m === "") && !Y(m, l) && o.push(m);
73
73
  }), o.length > 0) {
74
- const a = `
74
+ const i = `
75
75
  <ul>
76
76
  ${o.map((m) => `<li>${m}</li>`).join("")}
77
77
  </ul>
78
78
  `;
79
- return i({
79
+ return a({
80
80
  type: c.Alert,
81
- message: r("custom-fields.invalid-custom-fields") + a
81
+ message: r("custom-fields.invalid-custom-fields") + i
82
82
  }), !1;
83
83
  }
84
84
  }
@@ -87,12 +87,12 @@ const ce = () => {
87
87
  const s = e.match(/{%(.*?)%}/g), t = [];
88
88
  let n = !0;
89
89
  if (s && s.forEach((l) => {
90
- const o = l.match(_), a = l.match(H), m = (o == null ? void 0 : o.join("")) || "";
91
- (!o || l !== m) && !a && (i({
90
+ const o = l.match(_), i = l.match(H), m = (o == null ? void 0 : o.join("")) || "";
91
+ (!o || l !== m) && !i && (a({
92
92
  type: c.Alert,
93
93
  message: r("newsletter.display-conditions-invalid-syntax")
94
94
  }), n = !1), o && o.forEach((f) => {
95
- f.trim() === "=" && (i({
95
+ f.trim() === "=" && (a({
96
96
  type: c.Alert,
97
97
  message: r("custom-conditions.wrong-equality-operators")
98
98
  }), n = !1);
@@ -102,8 +102,8 @@ const ce = () => {
102
102
  });
103
103
  });
104
104
  }), t.length) {
105
- const l = t.filter((a) => a === "if"), o = t.filter((a) => a === "endif");
106
- l.length !== o.length && (i({
105
+ const l = t.filter((i) => i === "if"), o = t.filter((i) => i === "endif");
106
+ l.length !== o.length && (a({
107
107
  type: c.Alert,
108
108
  message: r("custom-conditions.missing-if-endif-tag")
109
109
  }), n = !1);
@@ -111,45 +111,47 @@ const ce = () => {
111
111
  return n;
112
112
  }, W = (e) => {
113
113
  const s = (e.match(/{% /gm) || []).length, t = (e.match(/ %}/gm) || []).length, n = s === t;
114
- return n || i({
114
+ return n || a({
115
115
  type: c.Warning,
116
116
  message: r("custom-conditions.no-space-after-braces")
117
117
  }), n;
118
- }, N = (e) => (e.match(/({%(.*?)%})/g) || []).filter((t) => t.includes("if")).map((t) => (t.match(/{{.*}}/gm) || []).length).reduce((t, n) => t + n, 0) > 0 ? (i({
118
+ }, N = (e) => (e.match(/({%(.*?)%})/g) || []).filter((t) => t.includes("if")).map((t) => (t.match(/{{.*}}/gm) || []).length).reduce((t, n) => t + n, 0) > 0 ? (a({
119
119
  type: c.Warning,
120
120
  message: r("custom-conditions.no-braces-inside-if-tag")
121
- }), !1) : !0, O = () => g.recommendationConfigs && Object.values(g.recommendationConfigs).find((s) => s.filters.find((t) => t.value === "")) !== void 0 ? (i({
121
+ }), !1) : !0, O = () => g.recommendationConfigs && Object.values(g.recommendationConfigs).find((s) => s.filters.find((t) => t.value === "")) !== void 0 ? (a({
122
122
  type: c.Alert,
123
123
  message: r("newsletter.fill-all-necessary-fields")
124
124
  }), !1) : !0, B = (e) => {
125
125
  const s = /src="[^"]*\.(svg|pst)"/gm;
126
- return e.match(s) === null ? !0 : (i({
126
+ return e.match(s) === null ? !0 : (a({
127
127
  type: c.Alert,
128
128
  message: r("newsletter.invalid-image-type")
129
129
  }), !1);
130
130
  }, R = (e) => {
131
131
  const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".checkbox-block-v2");
132
132
  return Array.from(n).find((o) => {
133
- var a;
134
- return !((a = o.id) != null && a.trim());
135
- }) ? (i({
133
+ var i;
134
+ return !((i = o.id) != null && i.trim());
135
+ }) ? (a({
136
136
  type: c.Alert,
137
137
  message: r("unsubscribe-templates.select-checkbox-groups")
138
138
  }), !1) : !0;
139
139
  }, D = (e) => {
140
140
  const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".radio-button-v2");
141
141
  return Array.from(n).find((o) => {
142
- var a;
143
- return !((a = o.id) != null && a.trim());
144
- }) ? (i({
142
+ var i;
143
+ return !((i = o.id) != null && i.trim());
144
+ }) ? (a({
145
145
  type: c.Alert,
146
146
  message: r("unsubscribe-templates.select-radio-button-groups")
147
147
  }), !1) : !0;
148
148
  };
149
149
  return { validateHtml: async (e, s, t = !1) => {
150
+ var o, i;
150
151
  const n = [
151
- ...s.map((o) => o.value),
152
- ...M
152
+ ...s.map((m) => m.value),
153
+ ...M,
154
+ ...((i = (o = d.value) == null ? void 0 : o.template) == null ? void 0 : i.customFieldAttributes) ?? []
153
155
  ];
154
156
  return await A(e, n, t) && I(e) && k(e) && x(e) && T(e, n) && F(e) && W(e) && N(e) && O() && B(e) && R(e) && D(e);
155
157
  } };
@@ -1,31 +1,33 @@
1
1
  import { ToasterTypeOptions as T } from "../enums/toaster.js";
2
- import { useToasterStore as u } from "../stores/toaster.js";
3
- import { watch as c } from "vue";
4
- const d = () => {
5
- const t = u();
2
+ import { useToasterStore as c } from "../stores/toaster.js";
3
+ import { watch as u, nextTick as l } from "vue";
4
+ const p = () => {
5
+ const t = c();
6
6
  let o = null;
7
7
  const s = () => {
8
8
  o && (clearTimeout(o), o = null);
9
9
  };
10
10
  function r(e = { message: "" }) {
11
- s(), t.hideToaster(), t.showToaster(e);
11
+ s(), t.hideToaster(), l(() => {
12
+ t.showToaster(e);
13
+ });
12
14
  }
13
15
  function i() {
14
16
  s(), t.hideToaster();
15
17
  }
16
- function a(e, n) {
18
+ function n(e, a) {
17
19
  const m = e instanceof Error ? e.message : String(e);
18
- r({ type: T.Alert, message: `${n}: ${m}` });
20
+ r({ type: T.Alert, message: `${a}: ${m}` });
19
21
  }
20
- return c(
22
+ return u(
21
23
  () => t.shouldAutoHide,
22
24
  (e) => {
23
25
  s(), e && (o = setTimeout(() => {
24
26
  t.hideToaster(), s();
25
27
  }, 6e3));
26
28
  }
27
- ), { showToaster: r, hideToaster: i, handleError: a };
29
+ ), { showToaster: r, hideToaster: i, handleError: n };
28
30
  };
29
31
  export {
30
- d as useToaster
32
+ p as useToaster
31
33
  };
@@ -75,7 +75,8 @@ const e = {
75
75
  "The image with the invalid link cannot be saved to the image gallery": "Enter a valid image link to continue.",
76
76
  "The data source link is unavailable. Please, make sure there is an access to the data source.": "Enter an accessible Data Source Link to contiue.",
77
77
  "The file should not exceed the maximum resolution of {maxImageResolution}px.": "Upload files up to 1024x512 pixels to continue.",
78
- "The option is disabled because was overridden in the Code editor": "The option is disabled because it was overridden in the Code Editor."
78
+ "The option is disabled because was overridden in the Code editor": "The option is disabled because it was overridden in the Code Editor.",
79
+ "Dropdown with a list of available data services, preliminarily created in the Data section → Services tab of the Account.": "Service for Data Collection lets you enter a form submission URL for the recipients to submit."
79
80
  };
80
81
  export {
81
82
  e as default
@@ -169,7 +169,7 @@ class q extends b {
169
169
  if (e && e.includes(a))
170
170
  return t;
171
171
  }
172
- return "querySelector" in t ? t.querySelector(`.${a}`) : null;
172
+ return "querySelector" in t ? t.querySelector(`.${a}`) ?? null : null;
173
173
  }
174
174
  /**
175
175
  * Migrate configuration from legacy format
@@ -16,7 +16,7 @@ function M(t) {
16
16
  if (e && e.includes(h))
17
17
  return t;
18
18
  }
19
- return "querySelector" in t ? t.querySelector(`.${h}`) : null;
19
+ return "querySelector" in t ? t.querySelector(`.${h}`) ?? null : null;
20
20
  }
21
21
  function g(t) {
22
22
  const e = M(t);
@@ -1,15 +1,15 @@
1
- var G = Object.defineProperty;
2
- var P = (u, c, t) => c in u ? G(u, c, { enumerable: !0, configurable: !0, writable: !0, value: t }) : u[c] = t;
3
- var h = (u, c, t) => P(u, typeof c != "symbol" ? c + "" : c, t);
4
- import { ModificationDescription as g } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
- import { CommonControl as R } from "../../../common-control.js";
6
- import { DESKTOP_CONTAINER_SELECTOR as m, MOBILE_CONTAINER_SELECTOR as M } from "../../constants/selectors.js";
7
- import { SPACING_STEP as S, MAX_SPACING as _, MIN_SPACING as N, DEFAULT_COLUMN_SPACING as C, DEFAULT_ROW_SPACING as E } from "../../constants/layout.js";
1
+ var P = Object.defineProperty;
2
+ var R = (l, s, t) => s in l ? P(l, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[s] = t;
3
+ var C = (l, s, t) => R(l, typeof s != "symbol" ? s + "" : s, t);
4
+ import { ModificationDescription as m } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
+ import { CommonControl as w } from "../../../common-control.js";
6
+ import { DESKTOP_CONTAINER_SELECTOR as S, MOBILE_CONTAINER_SELECTOR as E } from "../../constants/selectors.js";
7
+ import { SPACING_STEP as _, MAX_SPACING as N, MIN_SPACING as b, DEFAULT_COLUMN_SPACING as g, DEFAULT_ROW_SPACING as G } from "../../constants/layout.js";
8
8
  import { RecommendationConfigService as p } from "../../services/configService.js";
9
9
  import { useRecommendationExtensionStore as V } from "../../store/recommendation.js";
10
- import { safeGetStyle as A, safeGetParent as w } from "../../utils/tagName.js";
11
- import { getCurrentLayout as b, getBlockElement as B } from "../main/utils.js";
12
- import { useDebounceFn as f } from "../../../../../node_modules/@vueuse/shared/index.js";
10
+ import { safeGetStyle as L, safeGetParent as I } from "../../utils/tagName.js";
11
+ import { getCurrentLayout as f, getBlockElement as B } from "../main/utils.js";
12
+ import { useDebounceFn as O } from "../../../../../node_modules/@vueuse/shared/index.js";
13
13
  const U = "recommendation-spacing-control", n = {
14
14
  COLUMN_SPACING: "columnSpacing",
15
15
  COLUMN_SPACING_LABEL: "columnSpacingLabel",
@@ -19,46 +19,46 @@ const U = "recommendation-spacing-control", n = {
19
19
  MOBILE_COLUMN_SPACING_LABEL: "mobileColumnSpacingLabel",
20
20
  MOBILE_ROW_SPACING: "mobileRowSpacing",
21
21
  MOBILE_ROW_SPACING_LABEL: "mobileRowSpacingLabel"
22
- }, O = {
22
+ }, A = {
23
23
  COLUMN_SPACING: "data-column-spacing",
24
24
  ROW_SPACING: "data-row-spacing",
25
25
  MOBILE_COLUMN_SPACING: "data-mobile-column-spacing",
26
26
  MOBILE_ROW_SPACING: "data-mobile-row-spacing"
27
27
  };
28
- function L(u, c) {
29
- if (!u)
30
- return c;
31
- const t = parseFloat(u);
32
- return Number.isNaN(t) ? c : t;
28
+ function y(l, s) {
29
+ if (!l)
30
+ return s;
31
+ const t = parseFloat(l);
32
+ return Number.isNaN(t) ? s : t;
33
33
  }
34
- class j extends R {
34
+ class j extends w {
35
35
  constructor() {
36
36
  super(...arguments);
37
- h(this, "store", V());
38
- h(this, "unsubscribeOrientation", null);
37
+ C(this, "store", V());
38
+ C(this, "unsubscribeOrientation", null);
39
39
  /**
40
40
  * Debounced version of _onColumnSpacingChange
41
41
  * Prevents excessive DOM updates when user rapidly adjusts the counter
42
42
  */
43
- h(this, "_debouncedOnColumnSpacingChange", f((t) => {
43
+ C(this, "_debouncedOnColumnSpacingChange", O((t) => {
44
44
  this._onColumnSpacingChange(t);
45
45
  }, 300));
46
46
  /**
47
47
  * Debounced version of _onRowSpacingChange
48
48
  */
49
- h(this, "_debouncedOnRowSpacingChange", f((t) => {
49
+ C(this, "_debouncedOnRowSpacingChange", O((t) => {
50
50
  this._onRowSpacingChange(t);
51
51
  }, 300));
52
52
  /**
53
53
  * Debounced version of _onMobileColumnSpacingChange
54
54
  */
55
- h(this, "_debouncedOnMobileColumnSpacingChange", f((t) => {
55
+ C(this, "_debouncedOnMobileColumnSpacingChange", O((t) => {
56
56
  this._onMobileColumnSpacingChange(t);
57
57
  }, 300));
58
58
  /**
59
59
  * Debounced version of _onMobileRowSpacingChange
60
60
  */
61
- h(this, "_debouncedOnMobileRowSpacingChange", f((t) => {
61
+ C(this, "_debouncedOnMobileRowSpacingChange", O((t) => {
62
62
  this._onMobileRowSpacingChange(t);
63
63
  }, 300));
64
64
  }
@@ -75,9 +75,9 @@ class j extends R {
75
75
  }),
76
76
  this._GuCounter({
77
77
  name: n.COLUMN_SPACING,
78
- minValue: N,
79
- maxValue: _,
80
- step: S
78
+ minValue: b,
79
+ maxValue: N,
80
+ step: _
81
81
  }),
82
82
  this._GuLabel({
83
83
  text: this.api.translate("Row Spacing (px)"),
@@ -85,9 +85,9 @@ class j extends R {
85
85
  }),
86
86
  this._GuCounter({
87
87
  name: n.ROW_SPACING,
88
- minValue: N,
89
- maxValue: _,
90
- step: S
88
+ minValue: b,
89
+ maxValue: N,
90
+ step: _
91
91
  }),
92
92
  this._GuLabel({
93
93
  text: this.api.translate("Column Spacing on Mobile (px)"),
@@ -95,9 +95,9 @@ class j extends R {
95
95
  }),
96
96
  this._GuCounter({
97
97
  name: n.MOBILE_COLUMN_SPACING,
98
- minValue: N,
99
- maxValue: _,
100
- step: S
98
+ minValue: b,
99
+ maxValue: N,
100
+ step: _
101
101
  }),
102
102
  this._GuLabel({
103
103
  text: this.api.translate("Row Spacing on Mobile (px)"),
@@ -105,9 +105,9 @@ class j extends R {
105
105
  }),
106
106
  this._GuCounter({
107
107
  name: n.MOBILE_ROW_SPACING,
108
- minValue: N,
109
- maxValue: _,
110
- step: S
108
+ minValue: b,
109
+ maxValue: N,
110
+ step: _
111
111
  })
112
112
  ])}
113
113
  </div>
@@ -132,13 +132,13 @@ class j extends R {
132
132
  _updateSpacingVisibility() {
133
133
  if (!this.api)
134
134
  return;
135
- const t = p.getConfig(this.currentNode), e = this.store.recommendationConfigs.orientation, i = (t.layout || e || b(this.currentNode)) === "grid", { mobileLayoutEnabled: a } = t, r = t.cardsInRow > 1, l = t.mobileCardsInRow > 1;
135
+ const t = p.getConfig(this.currentNode), e = this.store.recommendationConfigs.orientation, i = (t.layout || e || f(this.currentNode)) === "grid", { mobileLayoutEnabled: a } = t, r = t.cardsInRow > 1, c = t.mobileCardsInRow > 1;
136
136
  this.api.setVisibility(n.COLUMN_SPACING, i && r), this.api.setVisibility(n.COLUMN_SPACING_LABEL, i && r), this.api.setVisibility(n.ROW_SPACING, !0), this.api.setVisibility(n.ROW_SPACING_LABEL, !0), this.api.setVisibility(
137
137
  n.MOBILE_COLUMN_SPACING,
138
- i && a && l
138
+ i && a && c
139
139
  ), this.api.setVisibility(
140
140
  n.MOBILE_COLUMN_SPACING_LABEL,
141
- i && a && l
141
+ i && a && c
142
142
  ), this.api.setVisibility(n.MOBILE_ROW_SPACING, i && a), this.api.setVisibility(n.MOBILE_ROW_SPACING_LABEL, i && a);
143
143
  }
144
144
  /**
@@ -165,20 +165,20 @@ class j extends R {
165
165
  */
166
166
  _getStoredColumnSpacing() {
167
167
  if (!this.currentNode)
168
- return C;
169
- const t = this.currentNode.querySelector(m) ?? this.currentNode;
170
- if (b(this.currentNode) === "grid") {
171
- const d = t.querySelector(".recommendation-attribute-row"), s = d == null ? void 0 : d.querySelector("td"), I = A(s, "padding");
172
- if (!I)
173
- return C;
174
- const y = I.trim().split(/\s+/);
175
- return y.length < 2 ? C : L(y[1], C / 2) * 2;
168
+ return g;
169
+ const t = this.currentNode.querySelector(S) ?? this.currentNode;
170
+ if (f(this.currentNode) === "grid") {
171
+ const h = t.querySelector(".recommendation-attribute-row"), u = h == null ? void 0 : h.querySelector("td"), d = L(u, "padding");
172
+ if (!d)
173
+ return g;
174
+ const M = d.trim().split(/\s+/);
175
+ return M.length < 2 ? g : y(M[1], g / 2) * 2;
176
176
  }
177
- const o = t.querySelector(".product-card-wrapper"), i = w(o), a = A(i, "padding");
177
+ const o = t.querySelector(".product-card-wrapper"), i = I(o), a = L(i, "padding");
178
178
  if (!a)
179
- return C;
179
+ return g;
180
180
  const r = a.trim().split(/\s+/);
181
- return r.length < 2 ? C : L(r[1], C / 2) * 2;
181
+ return r.length < 2 ? g : y(r[1], g / 2) * 2;
182
182
  }
183
183
  /**
184
184
  * Gets stored row spacing from the first spacer element's height style
@@ -186,9 +186,9 @@ class j extends R {
186
186
  */
187
187
  _getStoredRowSpacing() {
188
188
  if (!this.currentNode)
189
- return E;
190
- const e = (this.currentNode.querySelector(m) ?? this.currentNode).querySelector(".spacer"), o = A(e, "height");
191
- return L(o, E);
189
+ return G;
190
+ const e = (this.currentNode.querySelector(S) ?? this.currentNode).querySelector(".spacer"), o = L(e, "height");
191
+ return y(o, G);
192
192
  }
193
193
  // ========================================================================
194
194
  // Desktop Spacing Handlers
@@ -205,17 +205,18 @@ class j extends R {
205
205
  this.currentNode,
206
206
  { columnSpacing: t },
207
207
  `Changed column spacing to ${t}px`
208
- ), this._storeDataAttribute(O.COLUMN_SPACING, t);
209
- const o = p.getConfig(this.currentNode).layout || b(this.currentNode), i = this.api.getDocumentModifier(), r = `0 ${t / 2}px`, l = this.currentNode.querySelector(m);
210
- l && (o === "grid" ? Array.from(
211
- l.querySelectorAll(".attribute-cell")
212
- ).forEach((s) => {
213
- i.modifyHtml(s).setStyle("padding", r);
208
+ ), this._storeDataAttribute(A.COLUMN_SPACING, t);
209
+ const o = p.getConfig(this.currentNode).layout || f(this.currentNode), i = this.api.getDocumentModifier(), r = `0 ${t / 2}px`, c = this.currentNode.querySelector(S);
210
+ c && (o === "grid" ? Array.from(
211
+ c.querySelectorAll(".attribute-cell")
212
+ ).forEach((u) => {
213
+ i.modifyHtml(u).setStyle("padding", r);
214
214
  }) : Array.from(
215
- l.querySelectorAll(".product-card-wrapper")
216
- ).forEach((s) => {
217
- "parent" in s && s.parent() && i.modifyHtml(s.parent()).setStyle("padding", r);
218
- }), i.apply(new g(`Update column spacing to ${t}px`)));
215
+ c.querySelectorAll(".product-card-wrapper")
216
+ ).forEach((u) => {
217
+ const d = I(u);
218
+ d && i.modifyHtml(d).setStyle("padding", r);
219
+ }), i.apply(new m(`Update column spacing to ${t}px`)));
219
220
  }
220
221
  /**
221
222
  * Handles row spacing changes for desktop.
@@ -229,8 +230,8 @@ class j extends R {
229
230
  this.currentNode,
230
231
  { rowSpacing: t },
231
232
  `Changed row spacing to ${t}px`
232
- ), this._storeDataAttribute(O.ROW_SPACING, t);
233
- const e = this.currentNode.querySelector(m);
233
+ ), this._storeDataAttribute(A.ROW_SPACING, t);
234
+ const e = this.currentNode.querySelector(S);
234
235
  if (!e)
235
236
  return;
236
237
  const o = Array.from(
@@ -241,7 +242,7 @@ class j extends R {
241
242
  const i = this.api.getDocumentModifier(), a = `${t}px`;
242
243
  o.forEach((r) => {
243
244
  i.modifyHtml(r).setStyle("height", a);
244
- }), i.apply(new g(`Update row spacing to ${t}px`));
245
+ }), i.apply(new m(`Update row spacing to ${t}px`));
245
246
  }
246
247
  // ========================================================================
247
248
  // Mobile Spacing Handlers
@@ -258,17 +259,18 @@ class j extends R {
258
259
  this.currentNode,
259
260
  { mobileColumnSpacing: t },
260
261
  `Changed mobile column spacing to ${t}px`
261
- ), this._storeDataAttribute(O.MOBILE_COLUMN_SPACING, t);
262
- const o = p.getConfig(this.currentNode).layout || b(this.currentNode), i = this.api.getDocumentModifier(), r = `0 ${t / 2}px`, l = this.currentNode.querySelector(M);
263
- l && (o === "grid" ? Array.from(
264
- l.querySelectorAll(".attribute-cell")
265
- ).forEach((s) => {
266
- i.modifyHtml(s).setStyle("padding", r);
262
+ ), this._storeDataAttribute(A.MOBILE_COLUMN_SPACING, t);
263
+ const o = p.getConfig(this.currentNode).layout || f(this.currentNode), i = this.api.getDocumentModifier(), r = `0 ${t / 2}px`, c = this.currentNode.querySelector(E);
264
+ c && (o === "grid" ? Array.from(
265
+ c.querySelectorAll(".attribute-cell")
266
+ ).forEach((u) => {
267
+ i.modifyHtml(u).setStyle("padding", r);
267
268
  }) : Array.from(
268
- l.querySelectorAll(".product-card-wrapper")
269
- ).forEach((s) => {
270
- "parent" in s && s.parent() && i.modifyHtml(s.parent()).setStyle("padding", r);
271
- }), i.apply(new g(`Update mobile column spacing to ${t}px`)));
269
+ c.querySelectorAll(".product-card-wrapper")
270
+ ).forEach((u) => {
271
+ const d = I(u);
272
+ d && i.modifyHtml(d).setStyle("padding", r);
273
+ }), i.apply(new m(`Update mobile column spacing to ${t}px`)));
272
274
  }
273
275
  /**
274
276
  * Handles row spacing changes for mobile.
@@ -282,8 +284,8 @@ class j extends R {
282
284
  this.currentNode,
283
285
  { mobileRowSpacing: t },
284
286
  `Changed mobile row spacing to ${t}px`
285
- ), this._storeDataAttribute(O.MOBILE_ROW_SPACING, t);
286
- const e = this.currentNode.querySelector(M);
287
+ ), this._storeDataAttribute(A.MOBILE_ROW_SPACING, t);
288
+ const e = this.currentNode.querySelector(E);
287
289
  if (!e)
288
290
  return;
289
291
  const o = Array.from(
@@ -294,7 +296,7 @@ class j extends R {
294
296
  const i = this.api.getDocumentModifier(), a = `${t}px`;
295
297
  o.forEach((r) => {
296
298
  i.modifyHtml(r).setStyle("height", a);
297
- }), i.apply(new g(`Update mobile row spacing to ${t}px`));
299
+ }), i.apply(new m(`Update mobile row spacing to ${t}px`));
298
300
  }
299
301
  // ========================================================================
300
302
  // Data Attribute Storage
@@ -304,7 +306,7 @@ class j extends R {
304
306
  */
305
307
  _storeDataAttribute(t, e) {
306
308
  const o = B(this.currentNode);
307
- o && this.api.getDocumentModifier().modifyHtml(o).setAttribute(t, e.toString()).apply(new g(`Store ${t}`));
309
+ o && this.api.getDocumentModifier().modifyHtml(o).setAttribute(t, e.toString()).apply(new m(`Store ${t}`));
308
310
  }
309
311
  // ========================================================================
310
312
  // Event Listeners