@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.
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +5 -5
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +9 -9
- package/dist/composables/useSave.js +75 -68
- package/dist/composables/validators/useHtmlDocumentCountValidator.js +22 -0
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +22 -22
- package/dist/config/migrator/recommendation/compositionMapper.js +49 -56
- package/dist/config/migrator/recommendation/extractors.js +29 -68
- package/dist/config/migrator/recommendation/htmlBuilder.js +200 -283
- package/dist/config/migrator/recommendation/settingsMapper.js +32 -35
- package/dist/config/migrator/recommendationMigrator.js +29 -32
- package/dist/extensions/Blocks/Recommendation/block.js +24 -33
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +162 -146
- package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMap.js +2 -1
- package/dist/guido.css +1 -1
- package/dist/services/templateLibraryApi.js +36 -31
- package/dist/src/composables/validators/useHtmlDocumentCountValidator.d.ts +3 -0
- package/dist/src/config/migrator/recommendation/compositionMapper.d.ts +1 -3
- package/dist/src/config/migrator/recommendation/extractors.d.ts +0 -20
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +8 -2
- package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.d.ts +2 -3
- package/dist/src/stores/unsubscribe.d.ts +10 -0
- package/dist/src/utils/templatePreparation.d.ts +2 -1
- package/dist/stores/unsubscribe.js +28 -24
- package/dist/utils/pairProductVariables.js +98 -90
- package/dist/utils/templatePreparation.js +30 -30
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { PRE_RRS_CONFIG_VERSION as
|
|
2
|
-
import { DEFAULT_CARDS_IN_ROW as
|
|
3
|
-
import { mapLegacyStrategy as
|
|
4
|
-
function
|
|
1
|
+
import { PRE_RRS_CONFIG_VERSION as s, DEFAULT_CURRENCY as i } from "../../../extensions/Blocks/Recommendation/constants/defaultConfig.js";
|
|
2
|
+
import { DEFAULT_CARDS_IN_ROW as m, DEFAULT_MOBILE_ROW_SPACING as p, DEFAULT_MOBILE_COLUMN_SPACING as d, DEFAULT_ROW_SPACING as S, DEFAULT_COLUMN_SPACING as f, DEFAULT_MOBILE_CARDS_IN_ROW as a } from "../../../extensions/Blocks/Recommendation/constants/layout.js";
|
|
3
|
+
import { mapLegacyStrategy as l } from "../../../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
|
|
4
|
+
function c(t) {
|
|
5
5
|
return t === "0" || t === 0 ? "before" : "after";
|
|
6
6
|
}
|
|
7
|
-
function
|
|
7
|
+
function _(t) {
|
|
8
8
|
if (typeof t == "number" && Number.isFinite(t))
|
|
9
9
|
return t;
|
|
10
10
|
if (typeof t == "string") {
|
|
@@ -14,54 +14,51 @@ function A(t) {
|
|
|
14
14
|
}
|
|
15
15
|
return i.decimalCount;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function I(t) {
|
|
18
18
|
return t === "." || t === "," || t === " " || t === "" ? t : ",";
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function A(t) {
|
|
21
21
|
return t === "." || t === "," || t === " " ? t : ".";
|
|
22
22
|
}
|
|
23
23
|
function L(t) {
|
|
24
24
|
if (!t || typeof t != "object")
|
|
25
25
|
return { ...i };
|
|
26
|
-
const o = t, n = o.value ?? o.name ?? i.code,
|
|
26
|
+
const o = t, n = o.value ?? o.name ?? i.code, r = o.symbol ?? n;
|
|
27
27
|
return {
|
|
28
28
|
code: n,
|
|
29
|
-
symbol:
|
|
30
|
-
alignment:
|
|
31
|
-
decimalCount:
|
|
32
|
-
decimalSeparator:
|
|
33
|
-
thousandSeparator:
|
|
29
|
+
symbol: r,
|
|
30
|
+
alignment: c(o.alignment),
|
|
31
|
+
decimalCount: _(o.decimalCount),
|
|
32
|
+
decimalSeparator: A(o.decimalSeparator),
|
|
33
|
+
thousandSeparator: I(o.thousandSeparator)
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function N(t) {
|
|
37
37
|
return t === "horizontal" || t === "list" ? "list" : "grid";
|
|
38
38
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const o = _(t);
|
|
42
|
-
return o && !D.includes(o) ? o : "mostPopular";
|
|
39
|
+
function R(t) {
|
|
40
|
+
return l(t) || "mostPopular";
|
|
43
41
|
}
|
|
44
|
-
function
|
|
45
|
-
|
|
46
|
-
const e = o.rowCount ?? t.cardsInRow ?? d, m = o.totalCount ?? (typeof t.size == "string" ? parseInt(t.size) : t.size) ?? 6;
|
|
42
|
+
function O(t, o, n) {
|
|
43
|
+
const r = o.rowCount ?? t.cardsInRow ?? m, u = o.totalCount ?? (typeof t.size == "string" ? parseInt(t.size) : t.size) ?? 6;
|
|
47
44
|
return {
|
|
48
45
|
recommendationId: n,
|
|
49
|
-
strategy:
|
|
50
|
-
productIds: (t.productIds ?? []).map((
|
|
51
|
-
size: String(
|
|
46
|
+
strategy: R(t.strategy),
|
|
47
|
+
productIds: (t.productIds ?? []).map((e) => String(e)),
|
|
48
|
+
size: String(u),
|
|
52
49
|
shuffleProducts: !!t.shuffleProducts,
|
|
53
50
|
language: t.language ?? "en_US",
|
|
54
51
|
currency: L(t.currencySettings),
|
|
55
|
-
filters: (t.filters ?? []).map((
|
|
56
|
-
layout:
|
|
57
|
-
cardsInRow:
|
|
58
|
-
mobileCardsInRow:
|
|
59
|
-
mobileLayoutEnabled:
|
|
60
|
-
previousMobileCardsInRow:
|
|
52
|
+
filters: (t.filters ?? []).map((e) => ({ ...e })),
|
|
53
|
+
layout: N(t.orientation ?? o.orientation),
|
|
54
|
+
cardsInRow: r,
|
|
55
|
+
mobileCardsInRow: a,
|
|
56
|
+
mobileLayoutEnabled: !1,
|
|
57
|
+
previousMobileCardsInRow: a,
|
|
61
58
|
columnSpacing: f,
|
|
62
|
-
rowSpacing:
|
|
63
|
-
mobileColumnSpacing:
|
|
64
|
-
mobileRowSpacing:
|
|
59
|
+
rowSpacing: S,
|
|
60
|
+
mobileColumnSpacing: d,
|
|
61
|
+
mobileRowSpacing: p,
|
|
65
62
|
omnibusPrice: { textBefore: "", textAfter: "" },
|
|
66
63
|
omnibusDiscount: { textBefore: "", textAfter: "" },
|
|
67
64
|
// Preserve the legacy price-placement toggles. Absent legacy keys map to
|
|
@@ -69,10 +66,10 @@ function P(t, o, n) {
|
|
|
69
66
|
// gated). New Guido blocks default differently (see DEFAULT_NODE_CONFIG).
|
|
70
67
|
priceMovedToNextLine: !!t.isPriceMovedToNextLine,
|
|
71
68
|
priceHideIfSameAsDiscounted: !!t.isPriceDeletedForZeroSale,
|
|
72
|
-
configVersion:
|
|
69
|
+
configVersion: s
|
|
73
70
|
};
|
|
74
71
|
}
|
|
75
72
|
export {
|
|
76
73
|
L as mapCurrency,
|
|
77
|
-
|
|
74
|
+
O as mapSettings
|
|
78
75
|
};
|
|
@@ -1,51 +1,48 @@
|
|
|
1
|
-
import { BlockId as
|
|
2
|
-
import { DEFAULT_NODE_CONFIG as
|
|
3
|
-
import { ATTR_RECOMMENDATION_TITLE as
|
|
4
|
-
import { useTemplateStore as
|
|
5
|
-
import { mapComposition as
|
|
6
|
-
import { extractCurrencyFromBlock as C,
|
|
7
|
-
import { buildBlockHtml as
|
|
8
|
-
import { parseRecommendationId as
|
|
9
|
-
import { mapSettings as
|
|
10
|
-
const
|
|
11
|
-
function
|
|
1
|
+
import { BlockId as f } from "../../enums/block.js";
|
|
2
|
+
import { DEFAULT_NODE_CONFIG as y } from "../../extensions/Blocks/Recommendation/constants/defaultConfig.js";
|
|
3
|
+
import { ATTR_RECOMMENDATION_TITLE as b } from "../../extensions/Blocks/Recommendation/constants/selectors.js";
|
|
4
|
+
import { useTemplateStore as T } from "../../stores/template.js";
|
|
5
|
+
import { mapComposition as v } from "./recommendation/compositionMapper.js";
|
|
6
|
+
import { extractCurrencyFromBlock as C, extractTitleText as M, hasVisibleTitle as R, extractCardBgColor as S, isPartnerManagedBlock as h } from "./recommendation/extractors.js";
|
|
7
|
+
import { buildBlockHtml as w } from "./recommendation/htmlBuilder.js";
|
|
8
|
+
import { parseRecommendationId as x, parseLegacyConfig as E } from "./recommendation/parseLegacyConfig.js";
|
|
9
|
+
import { mapSettings as A } from "./recommendation/settingsMapper.js";
|
|
10
|
+
const H = 'td[esd-dev-product-config][class*="ins-recommendation-v3-block-"]:not(.recommendation-block-v2), td.product-block[esd-handler-name*="EmailRecommendationV3"][esd-dev-product-config]:not(.recommendation-block-v2)';
|
|
11
|
+
function B(n, t, c) {
|
|
12
12
|
var l;
|
|
13
|
-
const r =
|
|
13
|
+
const r = x(t);
|
|
14
14
|
if (r === null)
|
|
15
15
|
return console.warn(
|
|
16
16
|
"[RecommendationMigrator] Skipping block — missing/invalid `ins-recommendation-v3-campaign-id`"
|
|
17
17
|
), !1;
|
|
18
|
-
const o =
|
|
18
|
+
const o = E(t);
|
|
19
19
|
if (!o)
|
|
20
20
|
return console.warn(
|
|
21
21
|
`[RecommendationMigrator] Aborting block id=${r} — \`esd-dev-product-config\` missing or unable to be parsed`
|
|
22
22
|
), !1;
|
|
23
23
|
const a = c[String(r)] ?? {
|
|
24
24
|
currencySettings: C(t)
|
|
25
|
-
}, i =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
), p = h(t);
|
|
29
|
-
w(t) ? e.visibility[d] = !1 : e.titleVariable || (e.visibility[d] = x(t));
|
|
30
|
-
const g = E(t), u = {
|
|
25
|
+
}, i = A(a, o, r), e = v((l = o.composition) == null ? void 0 : l.variables), d = M(t);
|
|
26
|
+
e.titleVariable || (e.visibility[b] = R(t));
|
|
27
|
+
const p = S(t), g = {
|
|
31
28
|
...i,
|
|
32
29
|
strategyId: "",
|
|
33
30
|
composition: e.composition,
|
|
34
31
|
visibility: e.visibility,
|
|
35
|
-
previousTitleHtml:
|
|
32
|
+
previousTitleHtml: y.previousTitleHtml,
|
|
36
33
|
textTrimming: e.anyTextTrimming
|
|
37
|
-
}, m =
|
|
34
|
+
}, m = h(t), u = `
|
|
38
35
|
<table>
|
|
39
36
|
<tbody>
|
|
40
37
|
<tr>
|
|
41
38
|
<td class="esd-structure" align="left">
|
|
42
39
|
<table width="100%" cellpadding="0" cellspacing="0">
|
|
43
40
|
<tbody>
|
|
44
|
-
<tr>${
|
|
45
|
-
nodeConfig:
|
|
41
|
+
<tr>${w({
|
|
42
|
+
nodeConfig: g,
|
|
46
43
|
composition: e,
|
|
47
|
-
cardBg:
|
|
48
|
-
titleText:
|
|
44
|
+
cardBg: p,
|
|
45
|
+
titleText: d,
|
|
49
46
|
legacyId: t.getAttribute("id") ?? void 0,
|
|
50
47
|
legacyBgColor: t.getAttribute("bgcolor") ?? void 0,
|
|
51
48
|
preserveInnerHtml: m ? t.innerHTML : void 0,
|
|
@@ -57,12 +54,12 @@ function I(n, t, c) {
|
|
|
57
54
|
</tr>
|
|
58
55
|
</tbody>
|
|
59
56
|
</table>
|
|
60
|
-
`, s = n.parseFromString(
|
|
57
|
+
`, s = n.parseFromString(u, "text/html").querySelector("td.esd-structure");
|
|
61
58
|
return !s || !t.parentNode ? (console.warn(
|
|
62
59
|
`[RecommendationMigrator] Aborting block id=${r} — failed to construct new HTML element`
|
|
63
60
|
), !1) : (t.parentNode.replaceChild(s, t), !0);
|
|
64
61
|
}
|
|
65
|
-
function
|
|
62
|
+
function G(n, t = {}) {
|
|
66
63
|
const c = new DOMParser();
|
|
67
64
|
let r;
|
|
68
65
|
try {
|
|
@@ -70,12 +67,12 @@ function K(n, t = {}) {
|
|
|
70
67
|
} catch (i) {
|
|
71
68
|
return console.error("[RecommendationMigrator] Failed to parse template:", i), n;
|
|
72
69
|
}
|
|
73
|
-
const o = Array.from(r.querySelectorAll(
|
|
70
|
+
const o = Array.from(r.querySelectorAll(H));
|
|
74
71
|
try {
|
|
75
|
-
|
|
72
|
+
T().$patch((e) => {
|
|
76
73
|
e.migrations = {
|
|
77
74
|
...e.migrations,
|
|
78
|
-
[
|
|
75
|
+
[f.Recommendation]: o.length
|
|
79
76
|
};
|
|
80
77
|
});
|
|
81
78
|
} catch {
|
|
@@ -85,12 +82,12 @@ function K(n, t = {}) {
|
|
|
85
82
|
let a = 0;
|
|
86
83
|
return o.forEach((i) => {
|
|
87
84
|
try {
|
|
88
|
-
|
|
85
|
+
B(c, i, t) && (a += 1);
|
|
89
86
|
} catch (e) {
|
|
90
87
|
console.error("[RecommendationMigrator] Unexpected error migrating block:", e);
|
|
91
88
|
}
|
|
92
89
|
}), a > 0 && console.info(`[RecommendationMigrator] Migrated ${a} legacy Recommendation block(s)`), r.documentElement.outerHTML;
|
|
93
90
|
}
|
|
94
91
|
export {
|
|
95
|
-
|
|
92
|
+
G as migrateRecommendation
|
|
96
93
|
};
|
|
@@ -2,24 +2,23 @@ var b = Object.defineProperty;
|
|
|
2
2
|
var A = (m, c, e) => c in m ? b(m, c, { enumerable: !0, configurable: !0, writable: !0, value: e }) : m[c] = e;
|
|
3
3
|
var u = (m, c, e) => A(m, typeof c != "symbol" ? c + "" : c, e);
|
|
4
4
|
import { useConfig as g } from "../../../composables/useConfig.js";
|
|
5
|
-
import { BlockId as
|
|
6
|
-
import { getMigrationBannerHtml as
|
|
5
|
+
import { BlockId as D } from "../../../enums/block.js";
|
|
6
|
+
import { getMigrationBannerHtml as E } from "../../../utils/migrationBannerHtml.js";
|
|
7
7
|
import { Block as S, BlockCompositionType as v, ModificationDescription as _ } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
8
|
-
import { CURRENT_CONFIG_VERSION as
|
|
8
|
+
import { CURRENT_CONFIG_VERSION as N, PRE_RRS_CONFIG_VERSION as M } from "./constants/defaultConfig.js";
|
|
9
9
|
import { RECOMMENDATION_ID_ATTR as f } from "./constants/selectors.js";
|
|
10
|
-
import { ensureMobileFitRule as
|
|
11
|
-
import { regenerateMobileProductRows as
|
|
12
|
-
import { ensureMobileCssRulesExist as I, setMobileLayoutOptOut as R, hasMobileLayoutOptOut as
|
|
13
|
-
import { CSS_CLASS_TEXT_TRIM as H, ensureTextTrimCssRulesExist as $ } from "./controls/shared/textTrimCssRules.js";
|
|
10
|
+
import { ensureMobileFitRule as w, syncHeightBound as O } from "./controls/image/index.js";
|
|
11
|
+
import { regenerateMobileProductRows as H } from "./controls/main/utils.js";
|
|
12
|
+
import { ensureMobileCssRulesExist as I, setMobileLayoutOptOut as R, hasMobileLayoutOptOut as T } from "./controls/mobileLayout/cssRules.js";
|
|
14
13
|
import { RecommendationConfigService as a } from "./services/configService.js";
|
|
15
14
|
import { useRecommendationExtensionStore as p } from "./store/recommendation.js";
|
|
16
|
-
import { getDefaultTemplate as
|
|
15
|
+
import { getDefaultTemplate as x } from "./templates/grid/template.js";
|
|
17
16
|
import { useRecommendationBlockWarning as F } from "./useRecommendationBlockWarning.js";
|
|
18
|
-
import { registerNodeConfigWriter as y, readBlockNodeConfigs as
|
|
19
|
-
import { refreshArrivedStrategyBlocks as
|
|
20
|
-
const k =
|
|
17
|
+
import { registerNodeConfigWriter as y, readBlockNodeConfigs as $ } from "./utils/nodeConfigWriter.js";
|
|
18
|
+
import { refreshArrivedStrategyBlocks as q, resolveSourceConfig as L, refreshDuplicatedStrategyBlocks as P } from "./utils/strategyCommit.js";
|
|
19
|
+
const k = D.Recommendation, h = "recommendation-block-v2", C = "hide-price";
|
|
21
20
|
let B = !1;
|
|
22
|
-
class
|
|
21
|
+
class se extends S {
|
|
23
22
|
constructor() {
|
|
24
23
|
super();
|
|
25
24
|
/**
|
|
@@ -53,7 +52,7 @@ class ae extends S {
|
|
|
53
52
|
);
|
|
54
53
|
}
|
|
55
54
|
getSettingsPanelTitleHtml() {
|
|
56
|
-
return
|
|
55
|
+
return E(
|
|
57
56
|
k,
|
|
58
57
|
this.api.translate("Recommendation Block"),
|
|
59
58
|
this.api.translate("This block is switched from the Old Version to the New Version. We recommend you check the Recommendation block and test your message to ensure it works properly.")
|
|
@@ -77,7 +76,7 @@ class ae extends S {
|
|
|
77
76
|
*/
|
|
78
77
|
getTemplate() {
|
|
79
78
|
const e = this._generateNextId();
|
|
80
|
-
return this._pendingBlockId = e,
|
|
79
|
+
return this._pendingBlockId = e, x(e);
|
|
81
80
|
}
|
|
82
81
|
/**
|
|
83
82
|
* Called when a new block is dropped into the template
|
|
@@ -111,7 +110,7 @@ class ae extends S {
|
|
|
111
110
|
e,
|
|
112
111
|
{
|
|
113
112
|
recommendationId: i,
|
|
114
|
-
configVersion: r ?
|
|
113
|
+
configVersion: r ? N : M,
|
|
115
114
|
...s ? { partnerName: g().partnerName.value } : {},
|
|
116
115
|
// An RRS block picks a strategy, not an algorithm, and its algorithm control is
|
|
117
116
|
// hidden. Keeping the `mostPopular` default would bake a most-popular feed URL
|
|
@@ -122,7 +121,7 @@ class ae extends S {
|
|
|
122
121
|
if (l.setCurrentBlock(i), this._stampHidePrice(e, n.priceHideIfSameAsDiscounted), o) {
|
|
123
122
|
I(this.api);
|
|
124
123
|
const d = this._getBlockElement(e);
|
|
125
|
-
d && (R(this.api, d, !0),
|
|
124
|
+
d && (R(this.api, d, !0), H({
|
|
126
125
|
currentNode: e,
|
|
127
126
|
documentModifier: this.api.getDocumentModifier()
|
|
128
127
|
}));
|
|
@@ -156,13 +155,13 @@ class ae extends S {
|
|
|
156
155
|
"Assign recommendation ID to legacy block"
|
|
157
156
|
);
|
|
158
157
|
}
|
|
159
|
-
this._healLingeringDuplicate(e), a.needsMigration(e) && this._migrateFromLegacy(e), this._healHidePriceAttr(e), this._ensureMobileFitRule(e), this._syncHeightBound(e)
|
|
158
|
+
this._healLingeringDuplicate(e), a.needsMigration(e) && this._migrateFromLegacy(e), this._healHidePriceAttr(e), this._ensureMobileFitRule(e), this._syncHeightBound(e);
|
|
160
159
|
try {
|
|
161
160
|
B || (I(this.api), B = !0);
|
|
162
161
|
const t = a.getConfig(e), i = this._getBlockElement(e);
|
|
163
162
|
if (i) {
|
|
164
163
|
const r = !t.mobileLayoutEnabled;
|
|
165
|
-
|
|
164
|
+
T(i) !== r && R(this.api, i, r);
|
|
166
165
|
}
|
|
167
166
|
} catch {
|
|
168
167
|
}
|
|
@@ -180,15 +179,7 @@ class ae extends S {
|
|
|
180
179
|
}
|
|
181
180
|
_ensureMobileFitRule(e) {
|
|
182
181
|
try {
|
|
183
|
-
|
|
184
|
-
} catch {
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
// A migrated block arrives with trimmed cells but without the stylesheet rules the toggle would have added.
|
|
188
|
-
_ensureTextTrimCss(e) {
|
|
189
|
-
var t;
|
|
190
|
-
try {
|
|
191
|
-
(t = this._getBlockElement(e)) != null && t.querySelector(`.${H}`) && $(this.api);
|
|
182
|
+
w(this.api, e);
|
|
192
183
|
} catch {
|
|
193
184
|
}
|
|
194
185
|
}
|
|
@@ -196,7 +187,7 @@ class ae extends S {
|
|
|
196
187
|
const t = this._getBlockElement(e);
|
|
197
188
|
if (t)
|
|
198
189
|
try {
|
|
199
|
-
|
|
190
|
+
O(this.api, t);
|
|
200
191
|
} catch {
|
|
201
192
|
}
|
|
202
193
|
}
|
|
@@ -279,7 +270,7 @@ class ae extends S {
|
|
|
279
270
|
const d = { strategyId: l.strategyId };
|
|
280
271
|
return t.add(n), this._refreshClaims.set(n, d), [{ id: n, config: l, claim: d }];
|
|
281
272
|
});
|
|
282
|
-
i.length &&
|
|
273
|
+
i.length && q(i.map(({ id: r, config: s }) => ({ id: r, config: s }))).catch((r) => console.error("[recommendation] refreshing an arrived strategy failed", r)).finally(() => i.forEach(({ id: r, claim: s }) => this._releaseRefreshClaim(r, s)));
|
|
283
274
|
}
|
|
284
275
|
/**
|
|
285
276
|
* A new document reports each block to onCreated and onDocumentInit, not always in one batch, so a
|
|
@@ -291,7 +282,7 @@ class ae extends S {
|
|
|
291
282
|
return !0;
|
|
292
283
|
if (i.strategyId === t)
|
|
293
284
|
return !1;
|
|
294
|
-
const r =
|
|
285
|
+
const r = $(e);
|
|
295
286
|
return r.length > 0 && r.every((s) => s.strategyId === t);
|
|
296
287
|
}
|
|
297
288
|
_releaseRefreshClaim(e, t) {
|
|
@@ -353,10 +344,10 @@ class ae extends S {
|
|
|
353
344
|
if (r.cloneBlockState(t, i), r.setCurrentBlock(i), g().isFeatureEnabled("reusableRecommendationStrategy")) {
|
|
354
345
|
this._resetSourceIds.add(t), y(this.api);
|
|
355
346
|
const s = a.getConfig(e), n = [
|
|
356
|
-
{ id: t, claim: { strategyId:
|
|
347
|
+
{ id: t, claim: { strategyId: L(t, s).strategyId } },
|
|
357
348
|
{ id: i, claim: { strategyId: s.strategyId } }
|
|
358
349
|
].filter(({ id: o }) => !this._refreshClaims.has(o));
|
|
359
|
-
n.forEach(({ id: o, claim: l }) => this._refreshClaims.set(o, l)),
|
|
350
|
+
n.forEach(({ id: o, claim: l }) => this._refreshClaims.set(o, l)), P(t, i, s).catch((o) => console.error("[recommendation] refreshing a duplicated strategy failed", o)).finally(() => n.forEach(({ id: o, claim: l }) => this._releaseRefreshClaim(o, l)));
|
|
360
351
|
}
|
|
361
352
|
this._warnIfMultipleBlocks();
|
|
362
353
|
}
|
|
@@ -460,5 +451,5 @@ class ae extends S {
|
|
|
460
451
|
}
|
|
461
452
|
export {
|
|
462
453
|
k as BLOCK_ID,
|
|
463
|
-
|
|
454
|
+
se as RecommendationBlock
|
|
464
455
|
};
|