@braze/web-sdk 5.6.1 → 5.7.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 +14 -4
- package/package.json +1 -1
- package/shared-lib/encoding-utils.js +1 -1
- package/shared-lib/event-types.js +20 -20
- package/shared-lib/indexed-db-adapter.js +15 -15
- package/shared-lib/logger.js +2 -2
- package/shared-lib/supported-options.js +14 -14
- package/src/Banner/banner-provider.js +53 -50
- package/src/Banner/banner.js +1 -1
- package/src/Banner/get-all-banners.js +2 -2
- package/src/Banner/get-banner.js +2 -2
- 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 +2 -2
- package/src/Banner/subscribe-to-banners-updates.js +5 -5
- package/src/Card/card-manager.js +10 -10
- 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.js +139 -180
- 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 +3 -3
- package/src/Core/disable-sdk.js +3 -3
- package/src/Core/enable-sdk.js +3 -3
- package/src/Core/log-custom-event.js +3 -3
- package/src/Core/log-purchase.js +1 -1
- package/src/Core/open-session.js +6 -6
- package/src/Core/wipe-data.js +4 -4
- package/src/FeatureFlags/feature-flag.js +1 -1
- package/src/FeatureFlags/feature-flags-provider.js +81 -78
- package/src/FeatureFlags/get-all-feature-flags.js +2 -2
- package/src/FeatureFlags/get-feature-flag.js +2 -2
- 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/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 +1 -1
- package/src/InAppMessage/defer-in-app-message.js +1 -1
- package/src/InAppMessage/display/html-message-to-html.js +9 -9
- package/src/InAppMessage/display/in-app-message-to-html.js +16 -16
- package/src/InAppMessage/display/modal-utils.js +5 -5
- package/src/InAppMessage/in-app-message-factory.js +4 -4
- 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 +2 -2
- 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/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 +37 -37
- package/src/InAppMessage/models/modal-message.js +5 -5
- package/src/InAppMessage/models/slide-up-message.js +7 -7
- 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 +14 -14
- 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.js +88 -88
- package/src/Push/utils/push-utils.js +12 -12
- package/src/User/user-manager.js +10 -10
- package/src/User/user.js +46 -34
- package/src/common/constants.js +1 -1
- package/src/common/event-logger.js +3 -3
- package/src/common/feed-display.js +10 -10
- package/src/l10n/l10n-manager.js +1 -1
- package/src/managers/auth-manager.js +10 -10
- package/src/managers/braze-instance.js +110 -110
- package/src/managers/device-manager.js +17 -17
- package/src/managers/network-manager.js +180 -143
- package/src/managers/server-config-manager.js +65 -65
- package/src/managers/session-manager.js +22 -22
- package/src/managers/storage-manager-factory.js +9 -9
- package/src/managers/storage-manager.js +134 -134
- package/src/managers/subscription-manager.js +8 -8
- package/src/managers/utils.js +1 -1
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +8 -8
- package/src/models/device.js +2 -2
- package/src/models/identifier.js +10 -10
- package/src/models/push-token.js +8 -8
- package/src/models/server-config.js +31 -31
- package/src/request-controller.js +158 -146
- 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 +6 -6
- 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 +36 -36
- package/src/triggers/models/trigger-events.js +1 -1
- package/src/triggers/models/trigger.js +11 -11
- package/src/triggers/triggers-provider-factory.js +2 -2
- package/src/triggers/triggers-provider.js +37 -37
- package/src/ui/js/attach-css.js +1 -1
- package/src/ui/js/iam-css.js +1 -1
- package/src/ui/js/load-font-awesome.js +1 -1
- package/src/util/base-device-parser.js +1 -1
- 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 +3 -3
- 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 +23 -20
- package/src/util/user-agent-parser.js +1 -1
- package/src/util/validation-utils.js +14 -14
- package/src/util/window-utils.js +2 -2
|
@@ -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,7 +14,7 @@ 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(
|
|
@@ -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
|
},
|
|
@@ -7,14 +7,14 @@ 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
9
|
import { isArray as w } from "../util/code-utils.js";
|
|
10
|
-
import { KeyCodes as
|
|
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";
|
|
@@ -63,7 +63,7 @@ export function generateFeedBody(e, t) {
|
|
|
63
63
|
for (const r of e.cards) {
|
|
64
64
|
const i = r instanceof ControlCard;
|
|
65
65
|
!i || e.ur()
|
|
66
|
-
? (s.appendChild(Fe(r, logCardClick, t, o.
|
|
66
|
+
? (s.appendChild(Fe(r, logCardClick, t, o.Fo())), (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
|
}
|
|
@@ -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.Lo) || 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.Lo) || d(e);
|
|
170
170
|
}),
|
|
171
171
|
(a.onclick = d),
|
|
172
172
|
n.appendChild(a),
|
|
@@ -188,7 +188,7 @@ export function updateFeedCards(e, t, o, s, n) {
|
|
|
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.Nr, "Content Card"));
|
|
192
192
|
continue;
|
|
193
193
|
}
|
|
194
194
|
}
|
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);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import kt from "./auth-manager.js";
|
|
2
2
|
import s from "../common/base-provider.js";
|
|
3
3
|
import ro from "../util/browser-detector.js";
|
|
4
4
|
import Ot from "./device-manager.js";
|
|
@@ -11,13 +11,13 @@ import {
|
|
|
11
11
|
} from "../util/code-utils.js";
|
|
12
12
|
import Pt from "./network-manager.js";
|
|
13
13
|
import Lt from "../request-controller.js";
|
|
14
|
-
import
|
|
15
|
-
import
|
|
14
|
+
import Mt from "./server-config-manager.js";
|
|
15
|
+
import Wt from "./session-manager.js";
|
|
16
16
|
import ne, { STORAGE_KEYS as t } from "./storage-manager.js";
|
|
17
|
-
import
|
|
17
|
+
import Bt from "./storage-manager-factory.js";
|
|
18
18
|
import u from "./subscription-manager.js";
|
|
19
19
|
import { TriggersProviderFactory as ot } from "../triggers/triggers-provider-factory.js";
|
|
20
|
-
import
|
|
20
|
+
import bt from "../User/user-manager.js";
|
|
21
21
|
import { User } from "../User/index.js";
|
|
22
22
|
import { parseQueryStringKeyValues as ll } from "../util/url-utils.js";
|
|
23
23
|
import { WindowUtils as no } from "../util/window-utils.js";
|
|
@@ -26,68 +26,68 @@ import { SupportedOptions as zt, logger as N } from "../../shared-lib/index.js";
|
|
|
26
26
|
import _t from "../models/identifier.js";
|
|
27
27
|
const z = {
|
|
28
28
|
Oo: "allowCrawlerActivity",
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
Wo: "baseUrl",
|
|
30
|
+
Vo: "noCookies",
|
|
31
|
+
Ko: "devicePropertyAllowlist",
|
|
32
32
|
Da: "disablePushTokenMaintenance",
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
Yo: "enableLogging",
|
|
34
|
+
Ho: "enableSdkAuthentication",
|
|
35
35
|
Ca: "manageServiceWorkerExternally",
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
Xo: "minimumIntervalBetweenTriggerActionsInSeconds",
|
|
37
|
+
Zo: "sessionTimeoutInSeconds",
|
|
38
|
+
Qo: "appVersion",
|
|
39
|
+
Wh: "appVersionNumber",
|
|
40
40
|
_a: "serviceWorkerLocation",
|
|
41
41
|
Ba: "safariWebsitePushId",
|
|
42
42
|
Ea: "localization",
|
|
43
43
|
ir: "contentSecurityNonce",
|
|
44
44
|
er: "allowUserSuppliedJavascript",
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
Do: "inAppMessageZIndex",
|
|
46
|
+
To: "openInAppMessagesInNewTab",
|
|
47
47
|
tn: "openCardsInNewTab",
|
|
48
48
|
en: "openNewsFeedCardsInNewTab",
|
|
49
49
|
mh: "requireExplicitInAppMessageDismissal",
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
Vh: "doNotLoadFontAwesome",
|
|
51
|
+
$h: "deviceId",
|
|
52
52
|
Aa: "serviceWorkerScope",
|
|
53
|
-
|
|
53
|
+
Yh: "sdkFlavor",
|
|
54
54
|
};
|
|
55
55
|
class Vt {
|
|
56
56
|
constructor() {
|
|
57
|
-
(this.
|
|
58
|
-
(this.
|
|
59
|
-
(this
|
|
60
|
-
(this.
|
|
61
|
-
(this.
|
|
57
|
+
(this.fn = ""),
|
|
58
|
+
(this.Xh = ""),
|
|
59
|
+
(this.Zh = void 0),
|
|
60
|
+
(this.Qh = null),
|
|
61
|
+
(this.dn = null),
|
|
62
62
|
(this.S = null),
|
|
63
|
-
(this.
|
|
63
|
+
(this.Bi = null),
|
|
64
64
|
(this.B = null),
|
|
65
65
|
(this.T = null),
|
|
66
66
|
(this.C = null),
|
|
67
67
|
(this.As = null),
|
|
68
|
-
(this.
|
|
68
|
+
(this.Ia = ""),
|
|
69
69
|
(this.isInitialized = !1),
|
|
70
|
-
(this.
|
|
71
|
-
(this.
|
|
72
|
-
(this.
|
|
70
|
+
(this.Na = !1),
|
|
71
|
+
(this.Oa = new u()),
|
|
72
|
+
(this.Ta = new u()),
|
|
73
73
|
(this.options = {}),
|
|
74
|
-
(this.
|
|
75
|
-
(this.
|
|
76
|
-
(this.
|
|
77
|
-
(this.
|
|
74
|
+
(this.Ra = []),
|
|
75
|
+
(this.Pa = []),
|
|
76
|
+
(this._i = []),
|
|
77
|
+
(this.Xh = "5.7.0");
|
|
78
78
|
}
|
|
79
|
-
|
|
80
|
-
this.
|
|
79
|
+
La(t) {
|
|
80
|
+
this.Oa.Fs(t);
|
|
81
81
|
}
|
|
82
82
|
Nh(t) {
|
|
83
|
-
this.
|
|
83
|
+
this.Ta.Fs(t);
|
|
84
84
|
}
|
|
85
85
|
initialize(i, s) {
|
|
86
86
|
if (this.nt())
|
|
87
87
|
return N.info("Braze has already been initialized with an API key."), !0;
|
|
88
88
|
this.options = s || {};
|
|
89
|
-
let e = this.sr(z.
|
|
90
|
-
const r = ll(no.
|
|
89
|
+
let e = this.sr(z.Yo);
|
|
90
|
+
const r = ll(no.Ua());
|
|
91
91
|
if (
|
|
92
92
|
(r && "true" === r.brazeLogging && (e = !0),
|
|
93
93
|
N.init(e),
|
|
@@ -97,8 +97,8 @@ class Vt {
|
|
|
97
97
|
null == i || "" === i || "string" != typeof i)
|
|
98
98
|
)
|
|
99
99
|
return N.error("Braze requires a valid API key to be initialized."), !1;
|
|
100
|
-
this.
|
|
101
|
-
let n = this.sr(z.
|
|
100
|
+
this.fn = i;
|
|
101
|
+
let n = this.sr(z.Wo);
|
|
102
102
|
if (null == n || "" === n || "string" != typeof n)
|
|
103
103
|
return N.error("Braze requires a valid baseUrl to be initialized."), !1;
|
|
104
104
|
!1 === /^https?:/.test(n) && (n = `https://${n}`);
|
|
@@ -107,34 +107,34 @@ class Vt {
|
|
|
107
107
|
((n = document.createElement("a")),
|
|
108
108
|
(n.href = o),
|
|
109
109
|
"/" === n.pathname && (n = `${n}api/v3`),
|
|
110
|
-
(this.
|
|
111
|
-
ro.
|
|
110
|
+
(this.Ia = n.toString()),
|
|
111
|
+
ro.Wa && !this.sr(z.Oo))
|
|
112
112
|
)
|
|
113
113
|
return (
|
|
114
114
|
N.info("Ignoring activity from crawler bot " + navigator.userAgent),
|
|
115
|
-
(this.
|
|
115
|
+
(this.Na = !0),
|
|
116
116
|
!1
|
|
117
117
|
);
|
|
118
|
-
const h = this.sr(z.
|
|
118
|
+
const h = this.sr(z.Vo) || !1;
|
|
119
119
|
if (
|
|
120
|
-
((this.C =
|
|
120
|
+
((this.C = Bt.Va(i, h)), h && this.C.Fa(i), new ne.ne(null, !0).gr(t.ae))
|
|
121
121
|
)
|
|
122
122
|
return (
|
|
123
123
|
N.info("Ignoring all activity due to previous opt out"),
|
|
124
|
-
(this.
|
|
124
|
+
(this.Na = !0),
|
|
125
125
|
!1
|
|
126
126
|
);
|
|
127
127
|
for (const t of y(this.options))
|
|
128
128
|
-1 === Rt(zt).indexOf(t) &&
|
|
129
129
|
N.warn(`Ignoring unknown initialization option '${t}'.`);
|
|
130
130
|
const a = ["mparticle", "wordpress", "tealium"];
|
|
131
|
-
if (null != this.sr(z.
|
|
132
|
-
const t = this.sr(z.
|
|
131
|
+
if (null != this.sr(z.Yh)) {
|
|
132
|
+
const t = this.sr(z.Yh);
|
|
133
133
|
-1 !== a.indexOf(t)
|
|
134
|
-
? (this
|
|
134
|
+
? (this.Zh = t)
|
|
135
135
|
: N.error("Invalid sdk flavor passed: " + t);
|
|
136
136
|
}
|
|
137
|
-
let l = this.sr(zt.
|
|
137
|
+
let l = this.sr(zt.Ko);
|
|
138
138
|
if (null != l)
|
|
139
139
|
if (w(l)) {
|
|
140
140
|
const t = [];
|
|
@@ -151,74 +151,74 @@ class Vt {
|
|
|
151
151
|
"devicePropertyAllowlist must be an array. Defaulting to all properties.",
|
|
152
152
|
),
|
|
153
153
|
(l = null);
|
|
154
|
-
const c = this.sr(z
|
|
154
|
+
const c = this.sr(z.$h);
|
|
155
155
|
if (c) {
|
|
156
156
|
const i = new _t(c);
|
|
157
|
-
this.C.uu(t.iu
|
|
157
|
+
this.C.uu(t.iu.$h, i);
|
|
158
158
|
}
|
|
159
|
-
(this.
|
|
160
|
-
(this.B = new
|
|
161
|
-
(this.As = new
|
|
162
|
-
(this.T = new
|
|
159
|
+
(this.dn = new Ot(this.C, l)),
|
|
160
|
+
(this.B = new Mt(this.C)),
|
|
161
|
+
(this.As = new bt(this.B, this.C)),
|
|
162
|
+
(this.T = new Wt(this.C, this.As, this.B, this.sr(z.Zo)));
|
|
163
163
|
const f = new u();
|
|
164
164
|
return (
|
|
165
|
-
(this.
|
|
165
|
+
(this.Qh = new kt(this.C, this.sr(z.Ho), f)),
|
|
166
166
|
this.N(f),
|
|
167
167
|
(this.S = new Pt(
|
|
168
|
-
this.
|
|
168
|
+
this.dn,
|
|
169
169
|
this.C,
|
|
170
|
-
this.
|
|
170
|
+
this.Qh,
|
|
171
171
|
this.As,
|
|
172
172
|
this.T,
|
|
173
173
|
this.B,
|
|
174
|
-
this.
|
|
174
|
+
this.fn,
|
|
175
|
+
this.Ia,
|
|
175
176
|
this.Xh,
|
|
176
|
-
this.
|
|
177
|
-
this
|
|
178
|
-
this.sr(z.
|
|
179
|
-
this.sr(z.Xo),
|
|
177
|
+
this.Zh || "",
|
|
178
|
+
this.sr(z.Qo),
|
|
179
|
+
this.sr(z.Wh),
|
|
180
180
|
)),
|
|
181
|
-
(this.
|
|
182
|
-
this.
|
|
183
|
-
this.
|
|
181
|
+
(this.Bi = new Lt(
|
|
182
|
+
this.fn,
|
|
183
|
+
this.Ia,
|
|
184
184
|
this.T,
|
|
185
|
-
this.
|
|
185
|
+
this.dn,
|
|
186
186
|
this.As,
|
|
187
187
|
this.B,
|
|
188
188
|
this.C,
|
|
189
189
|
(t) => {
|
|
190
190
|
if (this.nt()) for (const i of this.lr()) i.U(t);
|
|
191
191
|
},
|
|
192
|
-
this.
|
|
192
|
+
this.Qh,
|
|
193
193
|
this.S,
|
|
194
194
|
)),
|
|
195
|
-
this.
|
|
196
|
-
h || this.C.
|
|
195
|
+
this.Bi.initialize(),
|
|
196
|
+
h || this.C.Ka(),
|
|
197
197
|
N.info(
|
|
198
198
|
`Initialized for the Braze backend at "${this.sr(
|
|
199
|
-
z.
|
|
200
|
-
)}" with API key "${this.
|
|
199
|
+
z.Wo,
|
|
200
|
+
)}" with API key "${this.fn}".`,
|
|
201
201
|
),
|
|
202
202
|
ot.p(),
|
|
203
|
-
this.B.
|
|
203
|
+
this.B.Me(() => {
|
|
204
204
|
var t;
|
|
205
205
|
this.isInitialized &&
|
|
206
|
-
(null === (t = this.B) || void 0 === t ? void 0 : t.
|
|
206
|
+
(null === (t = this.B) || void 0 === t ? void 0 : t.De()) &&
|
|
207
207
|
import("../FeatureFlags/refresh-feature-flags.js").then((t) => {
|
|
208
208
|
if (!this.isInitialized) return;
|
|
209
209
|
(0, t.default)();
|
|
210
210
|
});
|
|
211
211
|
}),
|
|
212
|
-
this.
|
|
212
|
+
this.Bi.rn(() => {
|
|
213
213
|
var t;
|
|
214
214
|
this.isInitialized &&
|
|
215
|
-
(null === (t = this.B) || void 0 === t ? void 0 : t.
|
|
215
|
+
(null === (t = this.B) || void 0 === t ? void 0 : t.De()) &&
|
|
216
216
|
import("../FeatureFlags/refresh-feature-flags.js").then((t) => {
|
|
217
217
|
if (!this.isInitialized) return;
|
|
218
218
|
(0, t.default)(void 0, void 0, !0);
|
|
219
219
|
});
|
|
220
220
|
}),
|
|
221
|
-
this.
|
|
221
|
+
this.Oa.X(this.options),
|
|
222
222
|
(this.isInitialized = !0),
|
|
223
223
|
window.dispatchEvent(new CustomEvent("braze.initialized")),
|
|
224
224
|
!0
|
|
@@ -226,42 +226,42 @@ class Vt {
|
|
|
226
226
|
}
|
|
227
227
|
destroy(t) {
|
|
228
228
|
if ((N.destroy(), this.nt())) {
|
|
229
|
-
this.
|
|
230
|
-
for (const t of this.
|
|
231
|
-
this.
|
|
232
|
-
for (const t of this.
|
|
233
|
-
(this.
|
|
229
|
+
this.Ta.X(), this.Ta.removeAllSubscriptions();
|
|
230
|
+
for (const t of this.Ra) t.destroy();
|
|
231
|
+
this.Ra = [];
|
|
232
|
+
for (const t of this.Pa) t.clearData(!1);
|
|
233
|
+
(this.Pa = []),
|
|
234
234
|
this.removeAllSubscriptions(),
|
|
235
|
-
(this.
|
|
236
|
-
null != this.
|
|
237
|
-
(this.
|
|
238
|
-
(this.
|
|
239
|
-
(this.
|
|
235
|
+
(this._i = []),
|
|
236
|
+
null != this.Bi && this.Bi.destroy(),
|
|
237
|
+
(this.Bi = null),
|
|
238
|
+
(this.Qh = null),
|
|
239
|
+
(this.dn = null),
|
|
240
240
|
(this.S = null),
|
|
241
241
|
(this.B = null),
|
|
242
242
|
(this.T = null),
|
|
243
243
|
(this.As = null),
|
|
244
244
|
(this.options = {}),
|
|
245
|
-
(this
|
|
245
|
+
(this.Zh = void 0),
|
|
246
246
|
(this.isInitialized = !1),
|
|
247
|
-
(this.
|
|
247
|
+
(this.Na = !1),
|
|
248
248
|
t && (this.C = null);
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
251
|
rr() {
|
|
252
|
-
return !this.
|
|
252
|
+
return !this.Ga() && (!!this.nt() || (console.warn(p), !1));
|
|
253
253
|
}
|
|
254
254
|
Ma() {
|
|
255
|
-
return this.
|
|
255
|
+
return this.fn;
|
|
256
256
|
}
|
|
257
257
|
Sr() {
|
|
258
|
-
return this.
|
|
258
|
+
return this.Qh;
|
|
259
259
|
}
|
|
260
260
|
Z() {
|
|
261
|
-
return this.
|
|
261
|
+
return this.Ia;
|
|
262
262
|
}
|
|
263
263
|
te() {
|
|
264
|
-
return this.
|
|
264
|
+
return this.dn;
|
|
265
265
|
}
|
|
266
266
|
g() {
|
|
267
267
|
return this.S;
|
|
@@ -270,10 +270,10 @@ class Vt {
|
|
|
270
270
|
return this.options[t];
|
|
271
271
|
}
|
|
272
272
|
lr() {
|
|
273
|
-
return this.
|
|
273
|
+
return this.Pa;
|
|
274
274
|
}
|
|
275
275
|
nn() {
|
|
276
|
-
return this.
|
|
276
|
+
return this.Bi;
|
|
277
277
|
}
|
|
278
278
|
v() {
|
|
279
279
|
return this.B;
|
|
@@ -285,7 +285,7 @@ class Vt {
|
|
|
285
285
|
return this.C;
|
|
286
286
|
}
|
|
287
287
|
cr() {
|
|
288
|
-
if (this.As && this.
|
|
288
|
+
if (this.As && this.Bi) return new User(this.As, this.Bi);
|
|
289
289
|
}
|
|
290
290
|
tr() {
|
|
291
291
|
return this.As;
|
|
@@ -295,34 +295,34 @@ class Vt {
|
|
|
295
295
|
}
|
|
296
296
|
h(t) {
|
|
297
297
|
let i = !1;
|
|
298
|
-
for (const s of this.
|
|
299
|
-
i || this.
|
|
298
|
+
for (const s of this.Ra) s === t && (i = !0);
|
|
299
|
+
i || this.Ra.push(t);
|
|
300
300
|
}
|
|
301
301
|
_(t) {
|
|
302
302
|
let i = !1;
|
|
303
|
-
for (const s of this.
|
|
304
|
-
t instanceof s && !i && this.
|
|
303
|
+
for (const s of this.Pa) s.constructor === t.constructor && (i = !0);
|
|
304
|
+
t instanceof s && !i && this.Pa.push(t);
|
|
305
305
|
}
|
|
306
306
|
N(t) {
|
|
307
|
-
t instanceof u && this.
|
|
307
|
+
t instanceof u && this._i.push(t);
|
|
308
308
|
}
|
|
309
309
|
removeAllSubscriptions() {
|
|
310
|
-
if (this.rr()) for (const t of this.
|
|
310
|
+
if (this.rr()) for (const t of this._i) t.removeAllSubscriptions();
|
|
311
311
|
}
|
|
312
312
|
removeSubscription(t) {
|
|
313
|
-
if (this.rr()) for (const i of this.
|
|
313
|
+
if (this.rr()) for (const i of this._i) i.removeSubscription(t);
|
|
314
314
|
}
|
|
315
315
|
re(t) {
|
|
316
|
-
this.
|
|
316
|
+
this.Na = t;
|
|
317
317
|
}
|
|
318
318
|
nt() {
|
|
319
319
|
return this.isInitialized;
|
|
320
320
|
}
|
|
321
|
-
|
|
322
|
-
return this.
|
|
321
|
+
Ga() {
|
|
322
|
+
return this.Na;
|
|
323
323
|
}
|
|
324
|
-
|
|
325
|
-
return this.
|
|
324
|
+
Si() {
|
|
325
|
+
return this.Xh;
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
328
|
const r = new Vt();
|
|
@@ -9,34 +9,34 @@ import { getErrorMessage as si } from "../util/error-utils.js";
|
|
|
9
9
|
export default class Ot {
|
|
10
10
|
constructor(t, e) {
|
|
11
11
|
(this.C = t),
|
|
12
|
-
(this.
|
|
12
|
+
(this.Ja = e),
|
|
13
13
|
(this.C = t),
|
|
14
14
|
null == e && (e = Rt(DeviceProperties)),
|
|
15
|
-
(this.
|
|
15
|
+
(this.Ja = e);
|
|
16
16
|
}
|
|
17
17
|
ce(e = !0) {
|
|
18
|
-
let r = this.C.tu(t.iu
|
|
19
|
-
null == r && ((r = new _t(G.Rt())), e && this.C.uu(t.iu
|
|
18
|
+
let r = this.C.tu(t.iu.$h);
|
|
19
|
+
null == r && ((r = new _t(G.Rt())), e && this.C.uu(t.iu.$h, r));
|
|
20
20
|
const s = new Gt(r.eu);
|
|
21
|
-
for (let t = 0; t < this.
|
|
22
|
-
switch (this.
|
|
21
|
+
for (let t = 0; t < this.Ja.length; t++) {
|
|
22
|
+
switch (this.Ja[t]) {
|
|
23
23
|
case DeviceProperties.BROWSER:
|
|
24
24
|
s.browser = ro.browser;
|
|
25
25
|
break;
|
|
26
26
|
case DeviceProperties.BROWSER_VERSION:
|
|
27
|
-
s.
|
|
27
|
+
s.Ha = ro.version;
|
|
28
28
|
break;
|
|
29
29
|
case DeviceProperties.OS:
|
|
30
|
-
s.os = this.
|
|
30
|
+
s.os = this.Qa();
|
|
31
31
|
break;
|
|
32
32
|
case DeviceProperties.RESOLUTION:
|
|
33
|
-
s.
|
|
33
|
+
s.Xa = screen.width + "x" + screen.height;
|
|
34
34
|
break;
|
|
35
35
|
case DeviceProperties.LANGUAGE:
|
|
36
36
|
s.language = ro.language;
|
|
37
37
|
break;
|
|
38
38
|
case DeviceProperties.TIME_ZONE:
|
|
39
|
-
s.timeZone = this.
|
|
39
|
+
s.timeZone = this.Ya(new Date());
|
|
40
40
|
break;
|
|
41
41
|
case DeviceProperties.USER_AGENT:
|
|
42
42
|
s.userAgent = ro.userAgent;
|
|
@@ -44,12 +44,12 @@ export default class Ot {
|
|
|
44
44
|
}
|
|
45
45
|
return s;
|
|
46
46
|
}
|
|
47
|
-
|
|
48
|
-
if (ro.
|
|
49
|
-
const e = this.C.
|
|
50
|
-
return e && e.os_version ? e.os_version : ro.
|
|
47
|
+
Qa() {
|
|
48
|
+
if (ro.Za()) return ro.Za();
|
|
49
|
+
const e = this.C.vs(t.gs.$a);
|
|
50
|
+
return e && e.os_version ? e.os_version : ro.Qa();
|
|
51
51
|
}
|
|
52
|
-
|
|
52
|
+
Ya(t) {
|
|
53
53
|
let e = !1;
|
|
54
54
|
if ("undefined" != typeof Intl && "function" == typeof Intl.DateTimeFormat)
|
|
55
55
|
try {
|
|
@@ -66,9 +66,9 @@ export default class Ot {
|
|
|
66
66
|
}
|
|
67
67
|
if (e) return "";
|
|
68
68
|
const r = t.getTimezoneOffset();
|
|
69
|
-
return this.
|
|
69
|
+
return this.tc(r);
|
|
70
70
|
}
|
|
71
|
-
|
|
71
|
+
tc(t) {
|
|
72
72
|
const e = Math.trunc(t / 60),
|
|
73
73
|
r = Math.trunc(t % 60);
|
|
74
74
|
let s = "GMT";
|