@useinsider/guido 3.21.2-beta.4b0fed7 → 3.21.2-beta.928b4a8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +5 -5
  2. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +9 -9
  3. package/dist/composables/useSave.js +75 -68
  4. package/dist/composables/validators/useHtmlDocumentCountValidator.js +22 -0
  5. package/dist/config/compiler/utils/recommendationCompilerUtils.js +22 -22
  6. package/dist/config/migrator/recommendation/compositionMapper.js +49 -56
  7. package/dist/config/migrator/recommendation/extractors.js +29 -68
  8. package/dist/config/migrator/recommendation/htmlBuilder.js +200 -283
  9. package/dist/config/migrator/recommendation/settingsMapper.js +32 -35
  10. package/dist/config/migrator/recommendationMigrator.js +29 -32
  11. package/dist/extensions/Blocks/Recommendation/block.js +24 -33
  12. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +162 -146
  13. package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMap.js +2 -1
  14. package/dist/guido.css +1 -1
  15. package/dist/services/templateLibraryApi.js +36 -31
  16. package/dist/src/composables/validators/useHtmlDocumentCountValidator.d.ts +3 -0
  17. package/dist/src/config/migrator/recommendation/compositionMapper.d.ts +1 -3
  18. package/dist/src/config/migrator/recommendation/extractors.d.ts +0 -20
  19. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +0 -1
  20. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +8 -2
  21. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.d.ts +2 -3
  22. package/dist/src/stores/unsubscribe.d.ts +10 -0
  23. package/dist/src/utils/templatePreparation.d.ts +2 -1
  24. package/dist/stores/unsubscribe.js +28 -24
  25. package/dist/utils/pairProductVariables.js +98 -90
  26. package/dist/utils/templatePreparation.js +30 -30
  27. package/package.json +1 -1
@@ -1,72 +1,72 @@
1
- var N = Object.defineProperty;
2
- var y = (u, c, e) => c in u ? N(u, c, { enumerable: !0, configurable: !0, writable: !0, value: e }) : u[c] = e;
3
- var r = (u, c, e) => y(u, typeof c != "symbol" ? c + "" : c, e);
1
+ var _ = Object.defineProperty;
2
+ var N = (u, d, e) => d in u ? _(u, d, { enumerable: !0, configurable: !0, writable: !0, value: e }) : u[d] = e;
3
+ var s = (u, d, e) => N(u, typeof d != "symbol" ? d + "" : d, e);
4
4
  import { useConfig as g } from "../../../../../composables/useConfig.js";
5
- import { ModificationDescription as P } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
6
- import { CommonControl as R } from "../../../common-control.js";
7
- import { RRS_CONFIG_VERSION as I, DEFAULT_NODE_CONFIG as m } from "../../constants/defaultConfig.js";
8
- import { RECOMMENDATION_ID_ATTR as k } from "../../constants/selectors.js";
9
- import { RecommendationConfigService as d } from "../../services/configService.js";
10
- import { useRecommendationExtensionStore as S } from "../../store/recommendation.js";
11
- import { refreshBlockOutsidePanel as T } from "../../utils/blockRefresh.js";
12
- import { registerNodeConfigWriter as O, writeBlockConfigOutsidePanel as C, hasEditedConfigChange as b, pickConfigDescription as B, isProductIdsChange as F, PRODUCT_IDS_DESCRIPTION as D } from "../../utils/nodeConfigWriter.js";
13
- import { AlgorithmControl as L } from "./algorithm.js";
14
- import { ALGORITHM_CONTROL_ID as Ne } from "./algorithm.js";
15
- import { CurrencyControl as E } from "./currency.js";
16
- import { CURRENCY_CONTROL_ID as Pe } from "./currency.js";
17
- import { FiltersControl as U } from "./filters.js";
18
- import { FILTERS_CONTROL_ID as Ie } from "./filters.js";
19
- import { LayoutOrientationControl as v } from "./layoutOrientation.js";
20
- import { LAYOUT_ORIENTATION_CONTROL_ID as Se } from "./layoutOrientation.js";
21
- import { LocaleControl as w } from "./locale.js";
22
- import { LOCALE_CONTROL_ID as Oe } from "./locale.js";
23
- import { PricePlacementControl as A } from "./pricePlacement.js";
24
- import { PRICE_PLACEMENT_CONTROL_ID as Be } from "./pricePlacement.js";
25
- import { ProductCountControl as V } from "./productCount.js";
26
- import { PRODUCT_COUNT_CONTROL_ID as De } from "./productCount.js";
27
- import { ProductLayoutControl as W } from "./productLayout.js";
28
- import { PRODUCT_LAYOUT_CONTROL_ID as Ee } from "./productLayout.js";
29
- import { ShuffleControl as x } from "./shuffle.js";
30
- import { SHUFFLE_CONTROL_ID as ve } from "./shuffle.js";
31
- import { StrategyControl as M } from "./strategy.js";
32
- import { STRATEGY_CONTROL_ID as Ae } from "./strategy.js";
33
- import { setCurrencyAttributes as G, getBlockElement as z, isPartnerManagedBlock as $, updateProductContentInPlace as H, regenerateProductRowsWithStyles as Y } from "./utils.js";
34
- import { adjustProductsToSize as We, formatProductPrice as xe, getCardComposition as Me, getCurrentLayout as Ge, getMainContainerTbody as ze, regenerateMobileProductRows as $e, updatePricesInPlace as He, updateSingleProductContent as Ye } from "./utils.js";
35
- import { useDebounceFn as p } from "../../../../../node_modules/@vueuse/shared/index.js";
36
- const h = "Update recommendation filters", j = "ui-elements-recommendation-block";
37
- class Ce extends R {
5
+ import { ModificationDescription as y } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
6
+ import { CommonControl as P } from "../../../common-control.js";
7
+ import { RRS_CONFIG_VERSION as R, DEFAULT_NODE_CONFIG as a } from "../../constants/defaultConfig.js";
8
+ import { RECOMMENDATION_ID_ATTR as I } from "../../constants/selectors.js";
9
+ import { RecommendationConfigService as l } from "../../services/configService.js";
10
+ import { useRecommendationExtensionStore as k } from "../../store/recommendation.js";
11
+ import { refreshBlockOutsidePanel as S } from "../../utils/blockRefresh.js";
12
+ import { registerNodeConfigWriter as T, writeBlockConfigOutsidePanel as m, hasEditedConfigChange as O, pickConfigDescription as b, isProductIdsChange as B, PRODUCT_IDS_DESCRIPTION as F } from "../../utils/nodeConfigWriter.js";
13
+ import { AlgorithmControl as E } from "./algorithm.js";
14
+ import { ALGORITHM_CONTROL_ID as _e } from "./algorithm.js";
15
+ import { CurrencyControl as L } from "./currency.js";
16
+ import { CURRENCY_CONTROL_ID as ye } from "./currency.js";
17
+ import { FiltersControl as D } from "./filters.js";
18
+ import { FILTERS_CONTROL_ID as Re } from "./filters.js";
19
+ import { LayoutOrientationControl as U } from "./layoutOrientation.js";
20
+ import { LAYOUT_ORIENTATION_CONTROL_ID as ke } from "./layoutOrientation.js";
21
+ import { LocaleControl as v } from "./locale.js";
22
+ import { LOCALE_CONTROL_ID as Te } from "./locale.js";
23
+ import { PricePlacementControl as w } from "./pricePlacement.js";
24
+ import { PRICE_PLACEMENT_CONTROL_ID as be } from "./pricePlacement.js";
25
+ import { ProductCountControl as A } from "./productCount.js";
26
+ import { PRODUCT_COUNT_CONTROL_ID as Fe } from "./productCount.js";
27
+ import { ProductLayoutControl as V } from "./productLayout.js";
28
+ import { PRODUCT_LAYOUT_CONTROL_ID as Le } from "./productLayout.js";
29
+ import { ShuffleControl as W } from "./shuffle.js";
30
+ import { SHUFFLE_CONTROL_ID as Ue } from "./shuffle.js";
31
+ import { StrategyControl as x } from "./strategy.js";
32
+ import { STRATEGY_CONTROL_ID as we } from "./strategy.js";
33
+ import { setCurrencyAttributes as M, getBlockElement as G, isPartnerManagedBlock as z, updateProductContentInPlace as $, regenerateProductRowsWithStyles as H } from "./utils.js";
34
+ import { adjustProductsToSize as Ve, formatProductPrice as We, getCardComposition as xe, getCurrentLayout as Me, getMainContainerTbody as Ge, regenerateMobileProductRows as ze, updatePricesInPlace as $e, updateSingleProductContent as He } from "./utils.js";
35
+ import { useDebounceFn as C } from "../../../../../node_modules/@vueuse/shared/index.js";
36
+ const f = "Update recommendation filters", Y = "ui-elements-recommendation-block";
37
+ class me extends P {
38
38
  constructor() {
39
39
  super(...arguments);
40
- r(this, "store", S());
41
- r(this, "storeUnsubscription", () => {
40
+ s(this, "store", k());
41
+ s(this, "storeUnsubscription", () => {
42
42
  });
43
43
  // A config change waiting to reach the node config. Deferred so it can ride the
44
44
  // re-render's single apply() — one user action must cost one undo press.
45
- r(this, "pendingNodeConfigWrite", null);
46
- r(this, "pendingConfigFlushTimer", null);
45
+ s(this, "pendingNodeConfigWrite", null);
46
+ s(this, "pendingConfigFlushTimer", null);
47
47
  // What the panel still owes the block it watches — finished outside the panel on teardown
48
48
  // and block switch. A new generation tells debounced work queued for the old one to stand down.
49
- r(this, "trackedBlockId", null);
50
- r(this, "fetchedConfigVersion", 0);
51
- r(this, "hasUnrenderedProducts", !1);
52
- r(this, "panelGeneration", 0);
53
- r(this, "isPanelAlive", !0);
49
+ s(this, "trackedBlockId", null);
50
+ s(this, "fetchedConfigVersion", 0);
51
+ s(this, "hasUnrenderedProducts", !1);
52
+ s(this, "panelGeneration", 0);
53
+ s(this, "isPanelAlive", !0);
54
54
  // Sub-control instances for lifecycle management
55
- r(this, "algorithmControl", null);
56
- r(this, "localeControl", null);
57
- r(this, "currencyControl", null);
58
- r(this, "productCountControl", null);
59
- r(this, "productLayoutControl", null);
60
- r(this, "filtersControl", null);
61
- r(this, "shuffleControl", null);
62
- r(this, "pricePlacementControl", null);
63
- r(this, "layoutOrientationControl", null);
64
- r(this, "strategyControl", null);
65
- r(this, "rrsEnabled", !1);
55
+ s(this, "algorithmControl", null);
56
+ s(this, "localeControl", null);
57
+ s(this, "currencyControl", null);
58
+ s(this, "productCountControl", null);
59
+ s(this, "productLayoutControl", null);
60
+ s(this, "filtersControl", null);
61
+ s(this, "shuffleControl", null);
62
+ s(this, "pricePlacementControl", null);
63
+ s(this, "layoutOrientationControl", null);
64
+ s(this, "strategyControl", null);
65
+ s(this, "rrsEnabled", !1);
66
66
  /**
67
67
  * Debounced product fetch to prevent rapid API calls during config changes
68
68
  */
69
- r(this, "_debouncedFetchProducts", p(async (e, t) => {
69
+ s(this, "_debouncedFetchProducts", C(async (e, t) => {
70
70
  if (t !== this.panelGeneration)
71
71
  return;
72
72
  const o = this._getBlockConfigVersion(e);
@@ -87,7 +87,7 @@ class Ce extends R {
87
87
  * count. The store pads products to the configured size, so in-place only
88
88
  * fails when the size actually changed.
89
89
  */
90
- r(this, "_debouncedRegenerateWithProducts", p((e) => {
90
+ s(this, "_debouncedRegenerateWithProducts", C((e) => {
91
91
  if (e !== this.panelGeneration || !this.currentNode || !this.api)
92
92
  return;
93
93
  const t = this._getRecommendationIdFromNode(this.currentNode), o = this.store.currentRecommendationId;
@@ -106,7 +106,7 @@ class Ce extends R {
106
106
  }, 100));
107
107
  }
108
108
  getId() {
109
- return j;
109
+ return Y;
110
110
  }
111
111
  get _subControls() {
112
112
  return [
@@ -127,7 +127,7 @@ class Ce extends R {
127
127
  return this.rrsEnabled = g().isFeatureEnabled("reusableRecommendationStrategy"), this._subControls.forEach((t) => {
128
128
  var o;
129
129
  return (o = t == null ? void 0 : t.onDestroy) == null ? void 0 : o.call(t);
130
- }), this.algorithmControl = new L(), this.localeControl = new w(), this.currencyControl = new E(), this.productCountControl = new V(), this.productLayoutControl = new W(), this.filtersControl = new U(), this.shuffleControl = new x(), this.pricePlacementControl = new A(), this.layoutOrientationControl = new v(), this.strategyControl = this.rrsEnabled ? new M() : null, this._subControls.forEach((t) => {
130
+ }), this.algorithmControl = new E(), this.localeControl = new v(), this.currencyControl = new L(), this.productCountControl = new A(), this.productLayoutControl = new V(), this.filtersControl = new D(), this.shuffleControl = new W(), this.pricePlacementControl = new w(), this.layoutOrientationControl = new U(), this.strategyControl = this.rrsEnabled ? new x() : null, this._subControls.forEach((t) => {
131
131
  t && (t.api = this.api);
132
132
  }), `
133
133
  <div class="recommendation-controls-container">
@@ -145,16 +145,16 @@ class Ce extends R {
145
145
  `;
146
146
  }
147
147
  _showControlsForBlock(e) {
148
- var s;
149
- const t = (s = this.getContainer()) == null ? void 0 : s.querySelector(".recommendation-controls-container");
148
+ var r;
149
+ const t = (r = this.getContainer()) == null ? void 0 : r.querySelector(".recommendation-controls-container");
150
150
  if (!t)
151
151
  return;
152
- const o = this._getRecommendationIdFromNode(e) === null ? null : d.getConfig(e), n = this.rrsEnabled && !!o && (!!(o != null && o.strategyId) || ((o == null ? void 0 : o.configVersion) ?? 0) >= I), i = this.rrsEnabled && !!o && !n;
152
+ const o = this._getRecommendationIdFromNode(e) === null ? null : l.getConfig(e), n = this.rrsEnabled && !!o && (!!(o != null && o.strategyId) || ((o == null ? void 0 : o.configVersion) ?? 0) >= R), i = this.rrsEnabled && !!o && !n;
153
153
  t.classList.toggle("strategy-block", n), t.classList.toggle("legacy-strategy-block", i);
154
154
  }
155
155
  async onRender() {
156
156
  var o;
157
- O(this.api);
157
+ T(this.api);
158
158
  const e = this._getRecommendationIdFromNode(this.currentNode), t = e ?? this.store.currentRecommendationId;
159
159
  if (t !== null && this.store.setCurrentBlock(t), e !== null && this._syncNodeConfigIfChanged(e), this._listenStateUpdates(), this._showControlsForBlock(this.currentNode), e !== null && this.strategyControl && (this.strategyControl.api = this.api, this.strategyControl.currentNode = this.currentNode, this.strategyControl.onRender()), t !== null && ((o = this.store.blockStates[t]) != null && o.isInitialized)) {
160
160
  this._initializeSubControls();
@@ -219,13 +219,13 @@ class Ce extends R {
219
219
  const t = this.store.blockStates[e];
220
220
  if (!t)
221
221
  return;
222
- const o = JSON.stringify(d.getConfig(this.currentNode)), n = t.syncedConfigFingerprint;
222
+ const o = JSON.stringify(l.getConfig(this.currentNode)), n = t.syncedConfigFingerprint;
223
223
  t.syncedConfigFingerprint = o, n !== o && ((i = this.pendingNodeConfigWrite) == null ? void 0 : i.blockId) !== e && this._syncNodeConfigToStore();
224
224
  }
225
225
  /** Whether the deferred write would move the node's strategyId — see the caller (SD-149916). */
226
226
  _isPendingStrategyIdChange() {
227
227
  const e = this.pendingNodeConfigWrite;
228
- return e ? d.getConfig(this.currentNode).strategyId !== e.updates.strategyId : !1;
228
+ return e ? l.getConfig(this.currentNode).strategyId !== e.updates.strategyId : !1;
229
229
  }
230
230
  _capturePendingNodeConfigWrite() {
231
231
  const e = this.store.currentRecommendationId, t = e === null ? void 0 : this.store.blockStates[e];
@@ -240,15 +240,15 @@ class Ce extends R {
240
240
  return !e || t !== null && e.blockId !== t ? null : e;
241
241
  }
242
242
  _getNodeConfigUpdates(e) {
243
- const { filters: t, strategy: o, strategyId: n, size: i, productIds: s, nodeConfigVersion: l } = e, { partnerName: a } = g();
243
+ const { filters: t, strategy: o, strategyId: n, size: i, productIds: r, nodeConfigVersion: h } = e, { partnerName: c } = g();
244
244
  return {
245
245
  filters: t,
246
246
  strategy: o,
247
247
  strategyId: n,
248
248
  size: i,
249
- productIds: s,
250
- configVersion: l,
251
- ...a.value ? { partnerName: a.value } : {}
249
+ productIds: r,
250
+ configVersion: h,
251
+ ...c.value ? { partnerName: c.value } : {}
252
252
  };
253
253
  }
254
254
  /**
@@ -263,7 +263,7 @@ class Ce extends R {
263
263
  */
264
264
  _stagePendingNodeConfig(e) {
265
265
  const t = this._pendingWriteForNode();
266
- return !t || !this.currentNode ? !1 : (d.stageConfig(e, this.currentNode, t.updates), !0);
266
+ return !t || !this.currentNode ? !1 : (l.stageConfig(e, this.currentNode, t.updates), !0);
267
267
  }
268
268
  /**
269
269
  * Arms the guaranteed fallback write, once the product fetch has settled. The
@@ -288,14 +288,14 @@ class Ce extends R {
288
288
  if (this.pendingNodeConfigWrite = null, this._clearConfigFlush(), !(!e || !this.api)) {
289
289
  if (e.blockId !== this.store.currentRecommendationId || !this.currentNode) {
290
290
  const { blockId: t, updates: o } = e;
291
- !C(t, o, h) && this.store.blockStates[t] && console.error("[recommendation] pending config write did not reach a node", { blockId: t });
291
+ !m(t, o, f) && this.store.blockStates[t] && console.error("[recommendation] pending config write did not reach a node", { blockId: t });
292
292
  return;
293
293
  }
294
- b(this.currentNode, e.updates) && d.updateConfig(
294
+ O(this.currentNode, e.updates) && l.updateConfig(
295
295
  this.api,
296
296
  this.currentNode,
297
297
  e.updates,
298
- B(this.currentNode, e.updates, h)
298
+ b(this.currentNode, e.updates, f)
299
299
  );
300
300
  }
301
301
  }
@@ -306,12 +306,12 @@ class Ce extends R {
306
306
  /** The Product Ids label when the pending write moves the node's ids; the caller's default otherwise. */
307
307
  _pendingDescription() {
308
308
  const e = this._pendingWriteForNode();
309
- if (!(!e || !this.currentNode || !F(this.currentNode, e.updates)))
310
- return D;
309
+ if (!(!e || !this.currentNode || !B(this.currentNode, e.updates)))
310
+ return F;
311
311
  }
312
312
  _syncNodeConfigToStore() {
313
313
  var n;
314
- const e = d.getConfig(this.currentNode), t = this.store.currentRecommendationId, o = t !== null && ((n = this.store.blockStates[t]) == null ? void 0 : n.isInitialized);
314
+ const e = l.getConfig(this.currentNode), t = this.store.currentRecommendationId, o = t !== null && ((n = this.store.blockStates[t]) == null ? void 0 : n.isInitialized);
315
315
  this.store.patchCurrentBlockConfig({
316
316
  strategy: e.strategy,
317
317
  strategyId: e.strategyId,
@@ -373,45 +373,61 @@ class Ce extends R {
373
373
  return this.isPanelAlive && this.store.currentRecommendationId === e;
374
374
  }
375
375
  /**
376
- * Falls back to the first available option when the block's currency or locale is not offered (a new block on
377
- * the hard-coded default, or a block copied from another account). The algorithm falls back only on new blocks.
376
+ * Applies smart defaults for newly dropped blocks.
377
+ *
378
+ * For new blocks (config still matches hardcoded defaults), validates that
379
+ * the default currency and algorithm are available from the API response.
380
+ * If not, falls back to the first available option.
381
+ *
382
+ * Saved templates with user-customized config are left unchanged because
383
+ * their values won't match the hardcoded defaults.
378
384
  */
379
385
  _applySmartDefaults() {
380
386
  if (!this.currentNode || !this.api)
381
387
  return;
382
- const e = d.getConfig(this.currentNode), t = {};
388
+ const e = l.getConfig(this.currentNode), t = {};
383
389
  let o = null, n = null, i = null;
384
- const { currencyList: s } = this.store;
385
- if (s.length > 0 && !s.some((a) => a.value === `price.${e.currency.code}`) && (o = s[0].value.replace("price.", ""), t.currency = {
386
- ...e.currency,
387
- code: o,
388
- symbol: o
389
- }), e.strategy === m.strategy) {
390
- const a = this.store.getActivePredictiveAlgorithms;
391
- a.length > 0 && (a.some(
392
- (_) => _.value === m.strategy
393
- ) || (n = a[0].value, t.strategy = n));
390
+ if (e.currency.code === a.currency.code) {
391
+ const { currencyList: r } = this.store;
392
+ r.length > 0 && (r.some(
393
+ (c) => c.value === `price.${a.currency.code}`
394
+ ) || (o = r[0].value.replace("price.", ""), t.currency = {
395
+ ...a.currency,
396
+ code: o,
397
+ symbol: o
398
+ }));
399
+ }
400
+ if (e.strategy === a.strategy) {
401
+ const r = this.store.getActivePredictiveAlgorithms;
402
+ r.length > 0 && (r.some(
403
+ (c) => c.value === a.strategy
404
+ ) || (n = r[0].value, t.strategy = n));
405
+ }
406
+ if (e.language === a.language) {
407
+ const r = this.store.getLanguages;
408
+ r.length > 0 && (r.some(
409
+ (c) => c.value === a.language
410
+ ) || (i = r[0].value, t.language = i));
394
411
  }
395
- const l = this.store.getLanguages;
396
- l.length > 0 && !l.some((a) => a.value === e.language) && (i = l[0].value, t.language = i), !(!o && !n && !i) && (d.updateConfig(
412
+ !o && !n && !i || (l.updateConfig(
397
413
  this.api,
398
414
  this.currentNode,
399
415
  t,
400
416
  "Applied smart defaults"
401
- ), o && t.currency && G({
417
+ ), o && t.currency && M({
402
418
  currentNode: this.currentNode,
403
419
  documentModifier: this.api.getDocumentModifier(),
404
420
  currency: t.currency
405
421
  }), this.store.patchCurrentBlockConfig({
406
- ...o && t.currency ? {
422
+ ...o ? {
407
423
  currencySettings: {
408
424
  name: o,
409
425
  value: o,
410
426
  symbol: o,
411
- alignment: t.currency.alignment === "before" ? "0" : "1",
412
- decimalCount: t.currency.decimalCount.toString(),
413
- decimalSeparator: t.currency.decimalSeparator,
414
- thousandSeparator: t.currency.thousandSeparator
427
+ alignment: a.currency.alignment === "before" ? "0" : "1",
428
+ decimalCount: a.currency.decimalCount.toString(),
429
+ decimalSeparator: a.currency.decimalSeparator,
430
+ thousandSeparator: a.currency.thousandSeparator
415
431
  }
416
432
  } : {},
417
433
  ...n ? { strategy: n } : {},
@@ -422,10 +438,10 @@ class Ce extends R {
422
438
  * Reads the recommendation-id attribute from the block element within the node
423
439
  */
424
440
  _getRecommendationIdFromNode(e) {
425
- const t = z(e);
441
+ const t = G(e);
426
442
  if (!t || !("getAttribute" in t))
427
443
  return null;
428
- const o = t.getAttribute(k);
444
+ const o = t.getAttribute(I);
429
445
  if (!o)
430
446
  return null;
431
447
  const n = parseInt(o);
@@ -442,10 +458,10 @@ class Ce extends R {
442
458
  if (e === null || !n)
443
459
  return;
444
460
  const i = t !== n.configVersion;
445
- i && !C(
461
+ i && !m(
446
462
  e,
447
463
  this._getNodeConfigUpdates(n.recommendationConfigs),
448
- h
464
+ f
449
465
  ) && console.error("[recommendation] config write outside the panel did not reach a node", { blockId: e }), (i || o) && this._refreshOutsidePanel(e, i);
450
466
  } catch (n) {
451
467
  console.error("[recommendation] finishing the block outside the panel failed", n);
@@ -459,7 +475,7 @@ class Ce extends R {
459
475
  };
460
476
  }
461
477
  _refreshOutsidePanel(e, t) {
462
- T(e, {
478
+ S(e, {
463
479
  pickUpdates: (o) => this._getNodeConfigUpdates(o),
464
480
  description: "Update recommendation configuration",
465
481
  fetch: t
@@ -482,19 +498,19 @@ class Ce extends R {
482
498
  return;
483
499
  }
484
500
  const e = this.store.recommendationProducts, t = this.api.getDocumentModifier(), o = this._pendingDescription(), n = this._stagePendingNodeConfig(t);
485
- if ($(this.currentNode)) {
501
+ if (z(this.currentNode)) {
486
502
  n && (t.apply(
487
- new P(o ?? "Update recommendation configuration")
503
+ new y(o ?? "Update recommendation configuration")
488
504
  ), this._consumePendingNodeConfig());
489
505
  return;
490
506
  }
491
- H({
507
+ $({
492
508
  currentNode: this.currentNode,
493
509
  documentModifier: t,
494
510
  products: e,
495
511
  description: o,
496
512
  onApplied: n ? () => this._consumePendingNodeConfig() : void 0
497
- }) || Y({
513
+ }) || H({
498
514
  currentNode: this.currentNode,
499
515
  documentModifier: t,
500
516
  products: e,
@@ -525,51 +541,51 @@ class Ce extends R {
525
541
  this.panelGeneration++, this.isPanelAlive = !0, this.trackedBlockId = e.currentRecommendationId, this.fetchedConfigVersion = o, this.hasUnrenderedProducts = !1, this.storeUnsubscription = e.$subscribe(() => {
526
542
  const n = e.currentRecommendationId;
527
543
  if (n !== this.trackedBlockId) {
528
- const f = this._trackedBlockSnapshot();
529
- this.panelGeneration++, this.trackedBlockId = n, t = e.recommendationProducts, o = this._getBlockConfigVersion(n), this.fetchedConfigVersion = o, this.hasUnrenderedProducts = !1, this._finishBlockOutsidePanel(f);
544
+ const p = this._trackedBlockSnapshot();
545
+ this.panelGeneration++, this.trackedBlockId = n, t = e.recommendationProducts, o = this._getBlockConfigVersion(n), this.fetchedConfigVersion = o, this.hasUnrenderedProducts = !1, this._finishBlockOutsidePanel(p);
530
546
  return;
531
547
  }
532
548
  const i = this._getBlockConfigVersion(n);
533
549
  i !== o && (o = i, this._capturePendingNodeConfigWrite(), this._isPendingStrategyIdChange() && this._flushPendingNodeConfig(), this._debouncedFetchProducts(n, this.panelGeneration));
534
- const s = e.recommendationProducts, l = s !== t, a = Array.isArray(s) && s.length > 0;
535
- l && a && (t = s, this.hasUnrenderedProducts = !0, this._debouncedRegenerateWithProducts(this.panelGeneration));
550
+ const r = e.recommendationProducts, h = r !== t, c = Array.isArray(r) && r.length > 0;
551
+ h && c && (t = r, this.hasUnrenderedProducts = !0, this._debouncedRegenerateWithProducts(this.panelGeneration));
536
552
  });
537
553
  }
538
554
  }
539
555
  export {
540
- Ne as ALGORITHM_CONTROL_ID,
541
- L as AlgorithmControl,
542
- j as CONTROL_BLOCK_ID,
543
- Pe as CURRENCY_CONTROL_ID,
544
- E as CurrencyControl,
545
- Ie as FILTERS_CONTROL_ID,
546
- U as FiltersControl,
547
- Se as LAYOUT_ORIENTATION_CONTROL_ID,
548
- Oe as LOCALE_CONTROL_ID,
549
- v as LayoutOrientationControl,
550
- w as LocaleControl,
551
- Be as PRICE_PLACEMENT_CONTROL_ID,
552
- De as PRODUCT_COUNT_CONTROL_ID,
553
- Ee as PRODUCT_LAYOUT_CONTROL_ID,
554
- A as PricePlacementControl,
555
- V as ProductCountControl,
556
- W as ProductLayoutControl,
557
- Ce as RecommendationBlockControl,
558
- ve as SHUFFLE_CONTROL_ID,
559
- Ae as STRATEGY_CONTROL_ID,
560
- x as ShuffleControl,
561
- M as StrategyControl,
562
- We as adjustProductsToSize,
563
- xe as formatProductPrice,
564
- z as getBlockElement,
565
- Me as getCardComposition,
566
- Ge as getCurrentLayout,
567
- ze as getMainContainerTbody,
568
- $ as isPartnerManagedBlock,
569
- $e as regenerateMobileProductRows,
570
- Y as regenerateProductRowsWithStyles,
571
- G as setCurrencyAttributes,
572
- He as updatePricesInPlace,
573
- H as updateProductContentInPlace,
574
- Ye as updateSingleProductContent
556
+ _e as ALGORITHM_CONTROL_ID,
557
+ E as AlgorithmControl,
558
+ Y as CONTROL_BLOCK_ID,
559
+ ye as CURRENCY_CONTROL_ID,
560
+ L as CurrencyControl,
561
+ Re as FILTERS_CONTROL_ID,
562
+ D as FiltersControl,
563
+ ke as LAYOUT_ORIENTATION_CONTROL_ID,
564
+ Te as LOCALE_CONTROL_ID,
565
+ U as LayoutOrientationControl,
566
+ v as LocaleControl,
567
+ be as PRICE_PLACEMENT_CONTROL_ID,
568
+ Fe as PRODUCT_COUNT_CONTROL_ID,
569
+ Le as PRODUCT_LAYOUT_CONTROL_ID,
570
+ w as PricePlacementControl,
571
+ A as ProductCountControl,
572
+ V as ProductLayoutControl,
573
+ me as RecommendationBlockControl,
574
+ Ue as SHUFFLE_CONTROL_ID,
575
+ we as STRATEGY_CONTROL_ID,
576
+ W as ShuffleControl,
577
+ x as StrategyControl,
578
+ Ve as adjustProductsToSize,
579
+ We as formatProductPrice,
580
+ G as getBlockElement,
581
+ xe as getCardComposition,
582
+ Me as getCurrentLayout,
583
+ Ge as getMainContainerTbody,
584
+ z as isPartnerManagedBlock,
585
+ ze as regenerateMobileProductRows,
586
+ H as regenerateProductRowsWithStyles,
587
+ M as setCurrencyAttributes,
588
+ $e as updatePricesInPlace,
589
+ $ as updateProductContentInPlace,
590
+ He as updateSingleProductContent
575
591
  };
@@ -3,8 +3,9 @@ function r(e) {
3
3
  return e;
4
4
  switch (e) {
5
5
  case "viewedTogether":
6
+ return "similarViewed";
6
7
  case "purchasedTogether":
7
- return "mostPopular";
8
+ return "similarBought";
8
9
  case "trending":
9
10
  return "trendingProducts";
10
11
  case "mostValuable":
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-b8f24f34] .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}.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}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-baf7a5dd]{gap:4px}.header-wrapper[data-v-d11dd577]{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-c5146fc5]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-c5146fc5]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-c5146fc5]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-91a26acd]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-91a26acd]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-91a26acd]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-91a26acd]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-91a26acd]{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}[data-v-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-19d8cb42] .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-content .assign-strategy-select[data-v-6ce48dfd]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-skeleton{width:100%!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-dropdown-box__container{width:413px}.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}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}
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-b8f24f34] .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}.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}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-baf7a5dd]{gap:4px}.header-wrapper[data-v-d11dd577]{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-c5146fc5]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-c5146fc5]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-c5146fc5]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-6750a053]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-6750a053]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-6750a053]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-6750a053]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-6750a053]{object-fit:cover;transform:scale(1)}.templates-wrapper .template-wrapper .template-container .default-chip[data-v-6750a053]{top:14px;right:10px}[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}[data-v-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-19d8cb42] .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-content .assign-strategy-select[data-v-6ce48dfd]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-skeleton{width:100%!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-dropdown-box__container{width:413px}.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}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}