@braze/web-sdk 5.6.1 → 5.8.0
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/README.md +1 -1
- package/index.d.ts +15 -5
- package/package.json +1 -1
- package/shared-lib/encoding-utils.js +1 -1
- package/shared-lib/event-types.js +23 -23
- package/shared-lib/indexed-db-adapter.js +20 -20
- package/shared-lib/logger.js +2 -2
- package/shared-lib/supported-options.js +17 -17
- package/src/Banner/banner-provider.js +53 -50
- package/src/Banner/banner.js +1 -1
- package/src/Banner/get-all-banners.js +3 -4
- package/src/Banner/get-banner.js +11 -11
- package/src/Banner/log-banner-click.js +1 -1
- package/src/Banner/log-banner-impressions.js +4 -4
- package/src/Banner/request-banners-refresh.js +21 -13
- package/src/Banner/subscribe-to-banners-updates.js +14 -13
- package/src/Banner/ui/insert-banner.js +11 -9
- package/src/Card/card-manager.js +10 -10
- package/src/Card/log-card-impressions.js +2 -2
- package/src/Card/models/captioned-image.js +1 -1
- package/src/Card/models/card.js +3 -3
- package/src/Card/models/classic-card.js +1 -1
- package/src/Card/models/control-card.js +1 -1
- package/src/Card/models/image-only.js +1 -1
- package/src/ContentCards/content-cards-provider-factory.js +1 -1
- package/src/ContentCards/content-cards-provider.js +139 -180
- package/src/ContentCards/content-cards.js +3 -3
- package/src/ContentCards/get-cached-content-cards.js +1 -1
- package/src/ContentCards/request-content-cards-refresh.js +1 -1
- package/src/ContentCards/subscribe-to-content-cards-updates.js +10 -10
- package/src/ContentCards/ui/show-content-cards.js +8 -8
- package/src/Core/add-sdk-metadata.js +2 -2
- package/src/Core/change-user.js +3 -3
- package/src/Core/disable-sdk.js +7 -7
- package/src/Core/enable-sdk.js +5 -5
- package/src/Core/get-device-id.js +2 -2
- package/src/Core/get-user.js +1 -1
- package/src/Core/is-disabled.js +1 -1
- package/src/Core/log-custom-event.js +3 -3
- package/src/Core/log-purchase.js +1 -1
- package/src/Core/open-session.js +9 -9
- package/src/Core/wipe-data.js +5 -5
- package/src/FeatureFlags/feature-flag-factory.js +4 -4
- package/src/FeatureFlags/feature-flag.js +18 -18
- package/src/FeatureFlags/feature-flags-provider.js +81 -78
- package/src/FeatureFlags/get-all-feature-flags.js +6 -7
- package/src/FeatureFlags/get-feature-flag.js +5 -6
- package/src/FeatureFlags/log-feature-flag-impression.js +4 -4
- package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +2 -2
- package/src/Feed/feed-provider.js +34 -34
- package/src/Feed/feed.js +2 -2
- package/src/Feed/get-cached-feed.js +1 -1
- package/src/Feed/request-feed-refresh.js +1 -1
- package/src/Feed/subscribe-to-feed-updates.js +1 -1
- package/src/Feed/ui/show-feed.js +5 -5
- package/src/InAppMessage/defer-in-app-message.js +1 -1
- package/src/InAppMessage/display/html-message-to-html.js +10 -10
- package/src/InAppMessage/display/in-app-message-to-html.js +21 -21
- package/src/InAppMessage/display/modal-utils.js +6 -6
- package/src/InAppMessage/in-app-message-factory.js +4 -4
- package/src/InAppMessage/in-app-message-manager-factory.js +1 -1
- package/src/InAppMessage/in-app-message-manager.js +115 -91
- package/src/InAppMessage/log-in-app-message-button-click.js +2 -2
- package/src/InAppMessage/log-in-app-message-click.js +3 -3
- package/src/InAppMessage/log-in-app-message-html-click.js +4 -4
- package/src/InAppMessage/log-in-app-message-impression.js +2 -2
- package/src/InAppMessage/models/control-message.js +1 -1
- package/src/InAppMessage/models/full-screen-message.js +5 -5
- package/src/InAppMessage/models/html-message.js +10 -10
- package/src/InAppMessage/models/in-app-message-button.js +5 -5
- package/src/InAppMessage/models/in-app-message.js +42 -42
- package/src/InAppMessage/models/modal-message.js +5 -5
- package/src/InAppMessage/models/slide-up-message.js +8 -8
- package/src/InAppMessage/models/templated-in-app-message.js +8 -8
- package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
- package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
- package/src/InAppMessage/ui/show-in-app-message.js +24 -24
- package/src/Push/is-push-blocked.js +2 -2
- package/src/Push/is-push-permission-granted.js +2 -2
- package/src/Push/is-push-supported.js +2 -2
- package/src/Push/push-manager-factory.js +8 -8
- package/src/Push/push-manager.js +90 -90
- package/src/Push/utils/push-utils.js +12 -12
- package/src/User/user-manager.js +12 -12
- package/src/User/user.js +48 -36
- package/src/common/base-feed.js +3 -3
- package/src/common/constants.js +1 -1
- package/src/common/event-logger.js +4 -4
- package/src/common/feed-display.js +14 -14
- package/src/l10n/l10n-manager-factory.js +2 -2
- package/src/l10n/l10n-manager.js +1 -1
- package/src/managers/auth-manager.js +10 -10
- package/src/managers/braze-instance.js +128 -128
- package/src/managers/device-manager.js +18 -18
- package/src/managers/network-manager.js +184 -147
- package/src/managers/server-config-manager.js +63 -63
- package/src/managers/session-manager.js +27 -27
- package/src/managers/storage-manager-factory.js +10 -10
- package/src/managers/storage-manager.js +146 -146
- package/src/managers/subscription-manager.js +8 -8
- package/src/managers/utils.js +1 -1
- package/src/models/backend-errors.js +4 -4
- package/src/models/braze-event.js +8 -8
- package/src/models/device.js +2 -2
- package/src/models/identifier.js +12 -12
- package/src/models/push-token.js +8 -8
- package/src/models/server-config.js +31 -31
- package/src/request-controller.js +163 -151
- package/src/triggers/models/custom-event-data.js +5 -5
- package/src/triggers/models/custom-event-property-data.js +6 -6
- package/src/triggers/models/filter-set.js +8 -8
- package/src/triggers/models/filter.js +16 -16
- package/src/triggers/models/in-app-message-click-data.js +2 -2
- package/src/triggers/models/purchase-data.js +2 -2
- package/src/triggers/models/purchase-property-data.js +4 -4
- package/src/triggers/models/push-click-data.js +2 -2
- package/src/triggers/models/trigger-condition.js +37 -37
- package/src/triggers/models/trigger-events.js +2 -2
- package/src/triggers/models/trigger.js +11 -11
- package/src/triggers/triggers-provider-factory.js +3 -3
- package/src/triggers/triggers-provider.js +39 -39
- package/src/ui/js/attach-css.js +3 -3
- package/src/ui/js/iam-css.js +1 -1
- package/src/ui/js/load-font-awesome.js +2 -2
- package/src/util/base-device-parser.js +3 -3
- package/src/util/braze-actions.js +4 -4
- package/src/util/browser-detector.js +6 -6
- package/src/util/client-hints-parser.js +1 -1
- package/src/util/component-utils.js +2 -2
- package/src/util/dom-utils.js +6 -6
- package/src/util/html-display-utils.js +1 -0
- package/src/util/key-codes.js +1 -1
- package/src/util/net.js +22 -23
- package/src/util/request-header-utils.js +25 -22
- package/src/util/user-agent-parser.js +1 -1
- package/src/util/validation-utils.js +17 -17
- package/src/util/window-utils.js +2 -2
package/src/User/user.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
|
-
isArray as
|
|
2
|
+
isArray as z,
|
|
3
3
|
isDate as Nt,
|
|
4
|
-
isObject as
|
|
4
|
+
isObject as yt,
|
|
5
5
|
validateValueIsFromEnum as ta,
|
|
6
6
|
} from "../util/code-utils.js";
|
|
7
7
|
import { logger as N, EventTypes as d } from "../../shared-lib/index.js";
|
|
8
8
|
import {
|
|
9
|
-
isValidEmail as
|
|
10
|
-
validateCustomAttributeArrayType as
|
|
11
|
-
validateCustomAttributeKey as
|
|
9
|
+
isValidEmail as Ct,
|
|
10
|
+
validateCustomAttributeArrayType as St,
|
|
11
|
+
validateCustomAttributeKey as At,
|
|
12
12
|
validateCustomProperties as rt,
|
|
13
13
|
validateCustomString as nt,
|
|
14
|
-
validatePropertyType as
|
|
14
|
+
validatePropertyType as Ut,
|
|
15
15
|
validateStandardString as ir,
|
|
16
16
|
} from "../util/validation-utils.js";
|
|
17
|
-
import { SET_CUSTOM_USER_ATTRIBUTE_STRING as
|
|
18
|
-
import { toValidBackendTimeString as
|
|
17
|
+
import { SET_CUSTOM_USER_ATTRIBUTE_STRING as Dt } from "../common/constants.js";
|
|
18
|
+
import { toValidBackendTimeString as Ft } from "../util/date-utils.js";
|
|
19
19
|
export default class User {
|
|
20
20
|
constructor(t, e) {
|
|
21
|
-
(this.As = t), (this.
|
|
21
|
+
(this.As = t), (this.Bi = e), (this.As = t), (this.Bi = e);
|
|
22
22
|
}
|
|
23
23
|
getUserId(t) {
|
|
24
24
|
const e = this.As.getUserId();
|
|
@@ -33,7 +33,7 @@ export default class User {
|
|
|
33
33
|
? (N.error("addAlias requires a non-empty alias"), !1)
|
|
34
34
|
: !ir(e, "add alias", "the label", !1) || e.length <= 0
|
|
35
35
|
? (N.error("addAlias requires a non-empty label"), !1)
|
|
36
|
-
: this.
|
|
36
|
+
: this.Bi.Ln(t, e).ss;
|
|
37
37
|
}
|
|
38
38
|
setFirstName(t) {
|
|
39
39
|
return (
|
|
@@ -47,7 +47,7 @@ export default class User {
|
|
|
47
47
|
);
|
|
48
48
|
}
|
|
49
49
|
setEmail(t) {
|
|
50
|
-
return null === t ||
|
|
50
|
+
return null === t || Ct(t)
|
|
51
51
|
? this.As.nu("email", t)
|
|
52
52
|
: (N.error(
|
|
53
53
|
`Cannot set email address - "${t}" did not pass RFC-5322 validation.`,
|
|
@@ -128,7 +128,7 @@ export default class User {
|
|
|
128
128
|
setPhoneNumber(t) {
|
|
129
129
|
return (
|
|
130
130
|
!!ir(t, "set phone number", "the phoneNumber", !0) &&
|
|
131
|
-
(null === t || t.match(User
|
|
131
|
+
(null === t || t.match(User.$n)
|
|
132
132
|
? this.As.nu("phone", t)
|
|
133
133
|
: (N.error(`Cannot set phone number - "${t}" did not pass validation.`),
|
|
134
134
|
!1))
|
|
@@ -164,33 +164,33 @@ export default class User {
|
|
|
164
164
|
"Cannot set last-known location - accuracy and altitudeAccuracy may not be negative.",
|
|
165
165
|
),
|
|
166
166
|
!1)
|
|
167
|
-
: this.
|
|
167
|
+
: this.Bi.setLastKnownLocation(this.As.getUserId(), t, e, s, r, n)
|
|
168
168
|
.ss);
|
|
169
169
|
}
|
|
170
170
|
setCustomUserAttribute(t, e, r) {
|
|
171
|
-
if (!
|
|
171
|
+
if (!At(t)) return !1;
|
|
172
172
|
const s = (e) => {
|
|
173
173
|
const [r] = rt(
|
|
174
174
|
e,
|
|
175
|
-
|
|
175
|
+
Dt,
|
|
176
176
|
"attribute value",
|
|
177
177
|
`set custom user attribute "${t}"`,
|
|
178
178
|
"custom user attribute",
|
|
179
179
|
);
|
|
180
180
|
return r;
|
|
181
181
|
};
|
|
182
|
-
if (
|
|
183
|
-
const [r, n] =
|
|
182
|
+
if (z(e)) {
|
|
183
|
+
const [r, n] = St(t, e);
|
|
184
184
|
if (!r && !n && 0 !== e.length) return !1;
|
|
185
|
-
if (r || 0 === e.length) return this.
|
|
185
|
+
if (r || 0 === e.length) return this.Bi.Gn(d.Hn, t, e).ss;
|
|
186
186
|
for (const t of e) if (!s(t)) return !1;
|
|
187
|
-
} else if (
|
|
187
|
+
} else if (yt(e)) {
|
|
188
188
|
if (!s(e)) return !1;
|
|
189
|
-
if (r) return this.
|
|
189
|
+
if (r) return this.Bi.Gn(d.Kn, t, e).ss;
|
|
190
190
|
} else {
|
|
191
|
-
if (!(void 0 !== e &&
|
|
191
|
+
if (!(void 0 !== e && Ut(e))) return !1;
|
|
192
192
|
if (
|
|
193
|
-
(Nt(e) && (e =
|
|
193
|
+
(Nt(e) && (e = Ft(e)),
|
|
194
194
|
"string" == typeof e &&
|
|
195
195
|
!nt(
|
|
196
196
|
e,
|
|
@@ -209,7 +209,7 @@ export default class User {
|
|
|
209
209
|
null != e &&
|
|
210
210
|
!nt(e, "add to custom user attribute array", "the given value")
|
|
211
211
|
) &&
|
|
212
|
-
this.
|
|
212
|
+
this.Bi.Gn(d.Mn, t, e).ss
|
|
213
213
|
);
|
|
214
214
|
}
|
|
215
215
|
removeFromCustomAttributeArray(t, e) {
|
|
@@ -219,7 +219,7 @@ export default class User {
|
|
|
219
219
|
null != e &&
|
|
220
220
|
!nt(e, "remove from custom user attribute array", "the given value")
|
|
221
221
|
) &&
|
|
222
|
-
this.
|
|
222
|
+
this.Bi.Gn(d.Yn, t, e).ss
|
|
223
223
|
);
|
|
224
224
|
}
|
|
225
225
|
incrementCustomUserAttribute(t, e) {
|
|
@@ -231,7 +231,7 @@ export default class User {
|
|
|
231
231
|
`Cannot increment custom user attribute because the given incrementValue "${e}" is not an integer.`,
|
|
232
232
|
),
|
|
233
233
|
!1)
|
|
234
|
-
: this.
|
|
234
|
+
: this.Bi.Gn(d.Jn, t, r).ss;
|
|
235
235
|
}
|
|
236
236
|
setCustomLocationAttribute(t, e, r) {
|
|
237
237
|
return (
|
|
@@ -247,7 +247,7 @@ export default class User {
|
|
|
247
247
|
"Received invalid values for latitude and/or longitude. Latitude and longitude are bounded by ±90 and ±180 respectively, or must both be null for removal.",
|
|
248
248
|
),
|
|
249
249
|
!1)
|
|
250
|
-
: this.
|
|
250
|
+
: this.Bi.Qn(t, e, r).ss)
|
|
251
251
|
);
|
|
252
252
|
}
|
|
253
253
|
addToSubscriptionGroup(t) {
|
|
@@ -261,7 +261,7 @@ export default class User {
|
|
|
261
261
|
"addToSubscriptionGroup requires a non-empty subscription group ID",
|
|
262
262
|
),
|
|
263
263
|
!1)
|
|
264
|
-
: this.
|
|
264
|
+
: this.Bi.Xn(t, User.Zn.SUBSCRIBED).ss;
|
|
265
265
|
}
|
|
266
266
|
removeFromSubscriptionGroup(t) {
|
|
267
267
|
return !ir(
|
|
@@ -274,13 +274,24 @@ export default class User {
|
|
|
274
274
|
"removeFromSubscriptionGroup requires a non-empty subscription group ID",
|
|
275
275
|
),
|
|
276
276
|
!1)
|
|
277
|
-
: this.
|
|
277
|
+
: this.Bi.Xn(t, User.Zn.UNSUBSCRIBED).ss;
|
|
278
278
|
}
|
|
279
|
-
|
|
280
|
-
|
|
279
|
+
setLineId(t) {
|
|
280
|
+
return ir(t, "set LINE user ID", "the ID", !0) &&
|
|
281
|
+
0 !== (null == t ? void 0 : t.length)
|
|
282
|
+
? t && t.length > User.au
|
|
283
|
+
? (N.error(
|
|
284
|
+
`Rejected LINE user ID ${t} because it is longer than ${User.au} characters.`,
|
|
285
|
+
),
|
|
286
|
+
!1)
|
|
287
|
+
: this.As.nu("native_line_id", t)
|
|
288
|
+
: (N.error("setLineId requires a non-empty ID"), !1);
|
|
289
|
+
}
|
|
290
|
+
Un(t, e, r, s, n) {
|
|
291
|
+
this.As.Un(t, e, r, s, n), this.Bi.du();
|
|
281
292
|
}
|
|
282
|
-
|
|
283
|
-
this.As.
|
|
293
|
+
_n(t) {
|
|
294
|
+
this.As._n(t);
|
|
284
295
|
}
|
|
285
296
|
}
|
|
286
297
|
(User.Genders = {
|
|
@@ -296,8 +307,9 @@ export default class User {
|
|
|
296
307
|
SUBSCRIBED: "subscribed",
|
|
297
308
|
UNSUBSCRIBED: "unsubscribed",
|
|
298
309
|
}),
|
|
299
|
-
(User
|
|
300
|
-
(User.
|
|
301
|
-
(User.
|
|
310
|
+
(User.$n = /^[0-9 .\\(\\)\\+\\-]+$/),
|
|
311
|
+
(User.Zn = { SUBSCRIBED: "subscribed", UNSUBSCRIBED: "unsubscribed" }),
|
|
312
|
+
(User.pu = "user_id"),
|
|
302
313
|
(User.lu = "custom"),
|
|
303
|
-
(User.
|
|
314
|
+
(User.ur = 997),
|
|
315
|
+
(User.au = 33);
|
package/src/common/base-feed.js
CHANGED
|
@@ -13,7 +13,7 @@ export default class rr {
|
|
|
13
13
|
for (const e of this.cards) e.viewed || e instanceof ControlCard || s++;
|
|
14
14
|
return s;
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
nr() {
|
|
17
17
|
N.error("Must be implemented in a subclass");
|
|
18
18
|
}
|
|
19
19
|
logCardImpressions(s) {
|
|
@@ -22,8 +22,8 @@ export default class rr {
|
|
|
22
22
|
logCardClick(s) {
|
|
23
23
|
N.error("Must be implemented in a subclass");
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
sr() {
|
|
26
26
|
N.error("Must be implemented in a subclass");
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
(rr.
|
|
29
|
+
(rr.dr = 6e4), (rr.Ih = 500), (rr.No = 1e4);
|
package/src/common/constants.js
CHANGED
|
@@ -10,6 +10,6 @@ export const BRAZE_MUST_BE_INITIALIZED_ERROR =
|
|
|
10
10
|
export const GLOBAL_RATE_LIMIT_CAPACITY_DEFAULT = 30;
|
|
11
11
|
export const GLOBAL_RATE_LIMIT_REFILL_RATE_DEFAULT = 30;
|
|
12
12
|
export const LAST_REQUEST_TO_ENDPOINT_MS_AGO_DEFAULT = 72e5;
|
|
13
|
-
export const
|
|
13
|
+
export const MAX_RETRY_COUNT_PER_REQUEST = 15;
|
|
14
14
|
export const REQUEST_ATTEMPT_DEFAULT = 1;
|
|
15
15
|
export const SUBSCRIPTION_ID_DATA_ATTRIBUTE = "data-update-subscription-id";
|
|
@@ -3,7 +3,7 @@ import r from "../managers/braze-instance.js";
|
|
|
3
3
|
import ve from "../models/braze-event.js";
|
|
4
4
|
import E from "../models/request-result.js";
|
|
5
5
|
const c = {
|
|
6
|
-
|
|
6
|
+
cs: (e, o, t) => {
|
|
7
7
|
var n, s;
|
|
8
8
|
const i = new E(),
|
|
9
9
|
l = r.P();
|
|
@@ -14,11 +14,11 @@ const c = {
|
|
|
14
14
|
),
|
|
15
15
|
i
|
|
16
16
|
);
|
|
17
|
-
const d = l.
|
|
17
|
+
const d = l.Eo();
|
|
18
18
|
return (
|
|
19
19
|
i.fe.push(
|
|
20
20
|
new ve(
|
|
21
|
-
t || (null === (n = r.
|
|
21
|
+
t || (null === (n = r.ir()) || void 0 === n ? void 0 : n.getUserId()),
|
|
22
22
|
e,
|
|
23
23
|
new Date().valueOf(),
|
|
24
24
|
d,
|
|
@@ -26,7 +26,7 @@ const c = {
|
|
|
26
26
|
),
|
|
27
27
|
),
|
|
28
28
|
(i.ss =
|
|
29
|
-
(null === (s = r.j()) || void 0 === s ? void 0 : s.
|
|
29
|
+
(null === (s = r.j()) || void 0 === s ? void 0 : s.Go(i.fe)) || !1),
|
|
30
30
|
i
|
|
31
31
|
);
|
|
32
32
|
},
|
|
@@ -6,15 +6,15 @@ import {
|
|
|
6
6
|
import { bottomIsInView as B, topIsInView as x } from "../util/dom-utils.js";
|
|
7
7
|
import { Card, ControlCard } from "../Card/index.js";
|
|
8
8
|
import { cardToHtml as Fe } from "../Card/display/card-display.js";
|
|
9
|
-
import { isArray as
|
|
10
|
-
import { KeyCodes as
|
|
9
|
+
import { isArray as z } from "../util/code-utils.js";
|
|
10
|
+
import { KeyCodes as mt } from "../util/key-codes.js";
|
|
11
11
|
import ge from "../l10n/l10n-manager-factory.js";
|
|
12
12
|
import { removeSubscription } from "../Core/remove-subscription.js";
|
|
13
13
|
import { logger as N, Guid as G } from "../../shared-lib/index.js";
|
|
14
14
|
import { BRAZE_ACTION_URI_REGEX as to } from "../util/validation-utils.js";
|
|
15
15
|
import {
|
|
16
|
-
INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES as
|
|
17
|
-
ineligibleBrazeActionURLErrorMessage as
|
|
16
|
+
INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES as jt,
|
|
17
|
+
ineligibleBrazeActionURLErrorMessage as dt,
|
|
18
18
|
getDecodedBrazeAction as eo,
|
|
19
19
|
containsUnknownBrazeAction as ft,
|
|
20
20
|
} from "../util/braze-actions.js";
|
|
@@ -62,8 +62,8 @@ export function generateFeedBody(e, t) {
|
|
|
62
62
|
const logCardClick = (t) => e.logCardClick(t);
|
|
63
63
|
for (const r of e.cards) {
|
|
64
64
|
const i = r instanceof ControlCard;
|
|
65
|
-
!i || e.
|
|
66
|
-
? (s.appendChild(Fe(r, logCardClick, t, o.
|
|
65
|
+
!i || e.nr()
|
|
66
|
+
? (s.appendChild(Fe(r, logCardClick, t, o.Lo())), (n = n || !i))
|
|
67
67
|
: N.error(
|
|
68
68
|
"Received a control card for a legacy news feed. Control cards are only supported with content cards.",
|
|
69
69
|
);
|
|
@@ -82,12 +82,12 @@ export function detectFeedImpressions(e, t) {
|
|
|
82
82
|
if (null != e && null != t) {
|
|
83
83
|
const o = [],
|
|
84
84
|
s = t.querySelectorAll(".ab-card");
|
|
85
|
-
e.
|
|
85
|
+
e._o || (e._o = {});
|
|
86
86
|
for (let t = 0; t < s.length; t++) {
|
|
87
87
|
const n = be(s[t]),
|
|
88
88
|
r = x(s[t]),
|
|
89
89
|
i = B(s[t]);
|
|
90
|
-
if (e.
|
|
90
|
+
if (e._o[n]) {
|
|
91
91
|
r || i || ye(s[t]);
|
|
92
92
|
continue;
|
|
93
93
|
}
|
|
@@ -101,7 +101,7 @@ export function detectFeedImpressions(e, t) {
|
|
|
101
101
|
if (l && c) continue;
|
|
102
102
|
for (const t of e.cards)
|
|
103
103
|
if (t.id === n) {
|
|
104
|
-
(e.
|
|
104
|
+
(e._o[t.id] = !0), o.push(t);
|
|
105
105
|
break;
|
|
106
106
|
}
|
|
107
107
|
}
|
|
@@ -132,7 +132,7 @@ export function refreshFeed(e, t) {
|
|
|
132
132
|
t.setAttribute("aria-busy", "false");
|
|
133
133
|
}
|
|
134
134
|
}, rr.No),
|
|
135
|
-
e.
|
|
135
|
+
e.sr();
|
|
136
136
|
}
|
|
137
137
|
export function feedToHtml(e, t, o) {
|
|
138
138
|
const s = document.createElement("div");
|
|
@@ -153,7 +153,7 @@ export function feedToHtml(e, t, o) {
|
|
|
153
153
|
destroyFeedHtml(s), e.stopPropagation();
|
|
154
154
|
};
|
|
155
155
|
r.addEventListener("keydown", (e) => {
|
|
156
|
-
(e.keyCode !==
|
|
156
|
+
(e.keyCode !== mt.Ro && e.keyCode !== mt.Oo) || i(e);
|
|
157
157
|
}),
|
|
158
158
|
(r.onclick = i);
|
|
159
159
|
const a = document.createElement("i");
|
|
@@ -166,7 +166,7 @@ export function feedToHtml(e, t, o) {
|
|
|
166
166
|
refreshFeed(e, s), t.stopPropagation();
|
|
167
167
|
};
|
|
168
168
|
a.addEventListener("keydown", (e) => {
|
|
169
|
-
(e.keyCode !==
|
|
169
|
+
(e.keyCode !== mt.Ro && e.keyCode !== mt.Oo) || d(e);
|
|
170
170
|
}),
|
|
171
171
|
(a.onclick = d),
|
|
172
172
|
n.appendChild(a),
|
|
@@ -181,14 +181,14 @@ export function feedToHtml(e, t, o) {
|
|
|
181
181
|
return s;
|
|
182
182
|
}
|
|
183
183
|
export function updateFeedCards(e, t, o, s, n) {
|
|
184
|
-
if (!
|
|
184
|
+
if (!z(t)) return;
|
|
185
185
|
const r = [];
|
|
186
186
|
for (const e of t)
|
|
187
187
|
if (e instanceof Card) {
|
|
188
188
|
if (e.url && to.test(e.url)) {
|
|
189
189
|
const t = eo(e.url);
|
|
190
190
|
if (ft(t)) {
|
|
191
|
-
N.error(jt
|
|
191
|
+
N.error(dt(jt.Gr, "Content Card"));
|
|
192
192
|
continue;
|
|
193
193
|
}
|
|
194
194
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import r, { OPTIONS as
|
|
1
|
+
import r, { OPTIONS as w } from "../managers/braze-instance.js";
|
|
2
2
|
import ro from "../util/browser-detector.js";
|
|
3
3
|
import lr from "./l10n-manager.js";
|
|
4
4
|
const ge = {
|
|
@@ -8,7 +8,7 @@ const ge = {
|
|
|
8
8
|
if ((ge.p(), !ge.aa)) {
|
|
9
9
|
let e = ro.language,
|
|
10
10
|
t = !1;
|
|
11
|
-
r.
|
|
11
|
+
r.ee(w.Ea) && ((e = r.ee(w.Ea)), (t = !0)), (ge.aa = new lr(e, t));
|
|
12
12
|
}
|
|
13
13
|
return ge.aa;
|
|
14
14
|
},
|
package/src/l10n/l10n-manager.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { STORAGE_KEYS as t } from "./storage-manager.js";
|
|
2
2
|
import u from "./subscription-manager.js";
|
|
3
|
-
import { logger as N, IndexedDBAdapter as
|
|
4
|
-
export default class
|
|
3
|
+
import { logger as N, IndexedDBAdapter as tt } from "../../shared-lib/index.js";
|
|
4
|
+
export default class kt {
|
|
5
5
|
constructor(t, i, s) {
|
|
6
6
|
(this.C = t),
|
|
7
7
|
(this.gh = i),
|
|
@@ -17,21 +17,21 @@ export default class qt {
|
|
|
17
17
|
return this.gh;
|
|
18
18
|
}
|
|
19
19
|
xh() {
|
|
20
|
-
return this.C.
|
|
20
|
+
return this.C.vs(t.gs.qh);
|
|
21
21
|
}
|
|
22
22
|
setSdkAuthenticationSignature(i) {
|
|
23
23
|
const s = this.xh();
|
|
24
|
-
this.C.
|
|
25
|
-
const e =
|
|
26
|
-
new
|
|
24
|
+
this.C.Bs(t.gs.qh, i);
|
|
25
|
+
const e = tt._s.Xs;
|
|
26
|
+
new tt(e, N).setItem(e.Ks.yh, this.wh, i), s !== i && this.es();
|
|
27
27
|
}
|
|
28
28
|
Bh() {
|
|
29
|
-
this.C.
|
|
30
|
-
const i =
|
|
31
|
-
new
|
|
29
|
+
this.C.Es(t.gs.qh);
|
|
30
|
+
const i = tt._s.Xs;
|
|
31
|
+
new tt(i, N).me(i.Ks.yh, this.wh);
|
|
32
32
|
}
|
|
33
33
|
subscribeToSdkAuthenticationFailures(t) {
|
|
34
|
-
return this.Fh.
|
|
34
|
+
return this.Fh.Fs(t);
|
|
35
35
|
}
|
|
36
36
|
Gh(t) {
|
|
37
37
|
this.Fh.X(t);
|