@braze/web-sdk 5.1.0 → 5.2.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/index.d.ts +14 -8
- package/package.json +1 -1
- package/shared-lib/encoding-utils.js +1 -1
- package/shared-lib/event-types.js +18 -18
- package/shared-lib/indexed-db-adapter.js +32 -32
- package/shared-lib/logger.js +2 -2
- package/shared-lib/supported-options.js +22 -21
- package/src/InAppMessage/display/html-message-to-html.js +38 -35
- package/src/InAppMessage/display/in-app-message-to-html.js +2 -2
- package/src/InAppMessage/display/modal-utils.js +2 -2
- package/src/InAppMessage/in-app-message-factory.js +21 -19
- package/src/InAppMessage/in-app-message-manager.js +58 -78
- 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 +3 -3
- package/src/InAppMessage/log-in-app-message-impression.js +1 -1
- package/src/InAppMessage/models/control-message.js +4 -2
- package/src/InAppMessage/models/full-screen-message.js +5 -2
- package/src/InAppMessage/models/html-message.js +6 -4
- package/src/InAppMessage/models/in-app-message-button.js +2 -2
- package/src/InAppMessage/models/in-app-message.js +51 -46
- package/src/InAppMessage/models/modal-message.js +5 -2
- package/src/InAppMessage/models/slide-up-message.js +33 -8
- package/src/InAppMessage/models/templated-in-app-message.js +8 -8
- package/src/InAppMessage/ui/show-in-app-message.js +28 -34
- package/src/InAppMessage/utils/in-app-message-utils.js +18 -1
- package/src/Push/push-manager-factory.js +3 -3
- package/src/Push/push-manager.js +118 -110
- package/src/Push/utils/push-utils.js +4 -4
- package/src/User/user-manager.js +4 -4
- package/src/User/user.js +17 -17
- package/src/common/base-feed.js +1 -1
- package/src/common/feed-display.js +12 -12
- package/src/l10n/l10n-manager-factory.js +1 -1
- package/src/l10n/l10n-manager.js +4 -4
- package/src/managers/auth-manager.js +26 -26
- package/src/managers/braze-instance.js +59 -52
- package/src/managers/device-manager.js +15 -15
- package/src/managers/network-manager.js +98 -93
- package/src/managers/server-config-manager.js +9 -9
- package/src/managers/storage-manager.js +99 -96
- package/src/managers/utils.js +6 -0
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +20 -12
- package/src/models/device.js +3 -3
- package/src/models/identifier.js +33 -19
- package/src/models/push-token.js +4 -4
- package/src/models/server-config.js +6 -6
- package/src/request-controller.js +77 -73
- package/src/triggers/models/custom-event-data.js +2 -2
- package/src/triggers/models/custom-event-property-data.js +4 -4
- package/src/triggers/models/filter-set.js +5 -5
- package/src/triggers/models/filter.js +6 -6
- package/src/triggers/models/in-app-message-click-data.js +1 -1
- 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 +1 -1
- package/src/triggers/models/trigger-condition.js +41 -41
- package/src/triggers/models/trigger-events.js +1 -1
- package/src/triggers/models/trigger.js +36 -36
- package/src/triggers/triggers-provider-factory.js +1 -1
- package/src/triggers/triggers-provider.js +71 -82
- package/src/ui/js/attach-css.js +2 -2
- 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 +9 -8
- package/src/util/client-hints-parser.js +1 -1
- package/src/util/component-utils.js +2 -2
- package/src/util/device-constants.js +2 -2
- package/src/util/key-codes.js +1 -1
- package/src/util/net.js +1 -1
- package/src/util/request-header-utils.js +6 -6
- package/src/util/user-agent-parser.js +5 -5
- package/src/util/validation-utils.js +2 -0
- package/src/util/window-utils.js +3 -3
|
@@ -11,16 +11,16 @@ import { bottomIsInView as he, topIsInView as Se } from "../util/dom-utils.js";
|
|
|
11
11
|
import { Card, ControlCard } from "../Card/index.js";
|
|
12
12
|
import { cardToHtml as _e } from "../Card/display/card-display.js";
|
|
13
13
|
import { isArray as j } from "../util/code-utils.js";
|
|
14
|
-
import { KeyCodes as
|
|
14
|
+
import { KeyCodes as lt } from "../util/key-codes.js";
|
|
15
15
|
import je from "../l10n/l10n-manager-factory.js";
|
|
16
16
|
import { removeSubscription } from "../Core/remove-subscription.js";
|
|
17
17
|
import { logger as r, Guid as p } from "../../shared-lib/index.js";
|
|
18
18
|
import { BRAZE_ACTION_URI_REGEX as Z } from "../util/validation-utils.js";
|
|
19
19
|
import {
|
|
20
|
-
INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES as
|
|
21
|
-
ineligibleBrazeActionURLErrorMessage as
|
|
20
|
+
INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES as jt,
|
|
21
|
+
ineligibleBrazeActionURLErrorMessage as dt,
|
|
22
22
|
getDecodedBrazeAction as W,
|
|
23
|
-
containsUnknownBrazeAction as
|
|
23
|
+
containsUnknownBrazeAction as ft,
|
|
24
24
|
} from "../util/braze-actions.js";
|
|
25
25
|
export const LAST_REQUESTED_REFRESH_DATA_ATTRIBUTE =
|
|
26
26
|
"data-last-requested-refresh";
|
|
@@ -32,7 +32,7 @@ export function destroyFeedHtml(e) {
|
|
|
32
32
|
((e.className = e.className.replace("ab-show", "ab-hide")),
|
|
33
33
|
setTimeout(() => {
|
|
34
34
|
e && e.parentNode && e.parentNode.removeChild(e);
|
|
35
|
-
}, x.
|
|
35
|
+
}, x.Ah));
|
|
36
36
|
const t = e.getAttribute("data-update-subscription-id");
|
|
37
37
|
null != t && removeSubscription(t);
|
|
38
38
|
const o = e.getAttribute("data-listener-id");
|
|
@@ -79,12 +79,12 @@ export function detectFeedImpressions(e, t) {
|
|
|
79
79
|
if (null != e && null != t) {
|
|
80
80
|
const o = [],
|
|
81
81
|
s = t.querySelectorAll(".ab-card");
|
|
82
|
-
e.
|
|
82
|
+
e.yo || (e.yo = {});
|
|
83
83
|
for (let t = 0; t < s.length; t++) {
|
|
84
84
|
const n = ye(s[t]),
|
|
85
85
|
r = Se(s[t]),
|
|
86
86
|
i = he(s[t]);
|
|
87
|
-
if (e.
|
|
87
|
+
if (e.yo[n]) {
|
|
88
88
|
r || i || Te(s[t]);
|
|
89
89
|
continue;
|
|
90
90
|
}
|
|
@@ -100,7 +100,7 @@ export function detectFeedImpressions(e, t) {
|
|
|
100
100
|
if (l && c) continue;
|
|
101
101
|
for (const t of e.cards)
|
|
102
102
|
if (t.id === n) {
|
|
103
|
-
(e.
|
|
103
|
+
(e.yo[t.id] = !0), o.push(t);
|
|
104
104
|
break;
|
|
105
105
|
}
|
|
106
106
|
}
|
|
@@ -152,7 +152,7 @@ export function feedToHtml(e, t, o) {
|
|
|
152
152
|
destroyFeedHtml(s), e.stopPropagation();
|
|
153
153
|
};
|
|
154
154
|
r.addEventListener("keydown", (e) => {
|
|
155
|
-
(e.keyCode !==
|
|
155
|
+
(e.keyCode !== lt.Fo && e.keyCode !== lt.To) || i(e);
|
|
156
156
|
}),
|
|
157
157
|
(r.onclick = i);
|
|
158
158
|
const a = document.createElement("i");
|
|
@@ -165,7 +165,7 @@ export function feedToHtml(e, t, o) {
|
|
|
165
165
|
refreshFeed(e, s), t.stopPropagation();
|
|
166
166
|
};
|
|
167
167
|
a.addEventListener("keydown", (e) => {
|
|
168
|
-
(e.keyCode !==
|
|
168
|
+
(e.keyCode !== lt.Fo && e.keyCode !== lt.To) || d(e);
|
|
169
169
|
}),
|
|
170
170
|
(a.onclick = d),
|
|
171
171
|
n.appendChild(a),
|
|
@@ -186,8 +186,8 @@ export function updateFeedCards(e, t, o, s, n) {
|
|
|
186
186
|
if (e instanceof Card) {
|
|
187
187
|
if (e.url && Z.test(e.url)) {
|
|
188
188
|
const t = W(e.url);
|
|
189
|
-
if (
|
|
190
|
-
r.error(
|
|
189
|
+
if (ft(t)) {
|
|
190
|
+
r.error(dt(jt.Vi, "Content Card"));
|
|
191
191
|
continue;
|
|
192
192
|
}
|
|
193
193
|
}
|
package/src/l10n/l10n-manager.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { logger as r } from "../../shared-lib/index.js";
|
|
2
|
-
import
|
|
2
|
+
import xt from "../common/translations.js";
|
|
3
3
|
export default class nr {
|
|
4
4
|
constructor(t, l = !1) {
|
|
5
5
|
if (
|
|
6
6
|
((this.language = t),
|
|
7
7
|
null != t && (t = t.toLowerCase()),
|
|
8
|
-
null != t && null ==
|
|
8
|
+
null != t && null == xt[t])
|
|
9
9
|
) {
|
|
10
10
|
const l = t.indexOf("-");
|
|
11
11
|
l > 0 && (t = t.substring(0, l));
|
|
12
12
|
}
|
|
13
|
-
if (null ==
|
|
13
|
+
if (null == xt[t]) {
|
|
14
14
|
const n =
|
|
15
15
|
"Braze does not yet have a localization for language " +
|
|
16
16
|
t +
|
|
@@ -20,6 +20,6 @@ export default class nr {
|
|
|
20
20
|
this.language = t;
|
|
21
21
|
}
|
|
22
22
|
get(t) {
|
|
23
|
-
return
|
|
23
|
+
return xt[this.language][t];
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -4,48 +4,48 @@ import { logger as r, IndexedDBAdapter as A } from "../../shared-lib/index.js";
|
|
|
4
4
|
export default class kt {
|
|
5
5
|
constructor(t, i, s) {
|
|
6
6
|
(this.u = t),
|
|
7
|
-
(this.
|
|
8
|
-
(this.
|
|
7
|
+
(this.Jn = i),
|
|
8
|
+
(this.Qn = s),
|
|
9
9
|
(this.u = t),
|
|
10
|
-
(this.
|
|
11
|
-
(this.
|
|
12
|
-
(this.
|
|
13
|
-
(this.
|
|
14
|
-
(this.
|
|
10
|
+
(this.Jn = i || !1),
|
|
11
|
+
(this.Qn = s),
|
|
12
|
+
(this.Xn = new T()),
|
|
13
|
+
(this.Zn = 0),
|
|
14
|
+
(this.gh = 1);
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
return this.
|
|
16
|
+
Fh() {
|
|
17
|
+
return this.Jn;
|
|
18
18
|
}
|
|
19
|
-
|
|
20
|
-
return this.u.j(o.C.
|
|
19
|
+
kh() {
|
|
20
|
+
return this.u.j(o.C.wh);
|
|
21
21
|
}
|
|
22
22
|
setSdkAuthenticationSignature(t) {
|
|
23
|
-
const i = this.
|
|
24
|
-
this.u.k(o.C.
|
|
23
|
+
const i = this.kh();
|
|
24
|
+
this.u.k(o.C.wh, t);
|
|
25
25
|
const s = A.Yt.Qt;
|
|
26
|
-
new A(s, r).setItem(s.ss.
|
|
26
|
+
new A(s, r).setItem(s.ss.jh, this.gh, t), i !== t && this.Xs();
|
|
27
27
|
}
|
|
28
|
-
|
|
29
|
-
this.u.hi(o.C.
|
|
28
|
+
xh() {
|
|
29
|
+
this.u.hi(o.C.wh);
|
|
30
30
|
const t = A.Yt.Qt;
|
|
31
|
-
new A(t, r).re(t.ss.
|
|
31
|
+
new A(t, r).re(t.ss.jh, this.gh);
|
|
32
32
|
}
|
|
33
33
|
subscribeToSdkAuthenticationFailures(t) {
|
|
34
|
-
return this.
|
|
34
|
+
return this.Qn.It(t);
|
|
35
|
+
}
|
|
36
|
+
qh(t) {
|
|
37
|
+
this.Qn.Dt(t);
|
|
35
38
|
}
|
|
36
|
-
yh(
|
|
37
|
-
this.
|
|
39
|
+
yh() {
|
|
40
|
+
this.Xn.removeAllSubscriptions();
|
|
38
41
|
}
|
|
39
42
|
Bh() {
|
|
40
|
-
this.
|
|
43
|
+
this.Zn += 1;
|
|
41
44
|
}
|
|
42
45
|
Gh() {
|
|
43
|
-
this.
|
|
44
|
-
}
|
|
45
|
-
Hh() {
|
|
46
|
-
return this.Fh;
|
|
46
|
+
return this.Zn;
|
|
47
47
|
}
|
|
48
48
|
Xs() {
|
|
49
|
-
this.
|
|
49
|
+
this.Zn = 0;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -23,39 +23,41 @@ import { parseQueryStringKeyValues as ut } from "../util/url-utils.js";
|
|
|
23
23
|
import { WindowUtils as eo } from "../util/window-utils.js";
|
|
24
24
|
import { BRAZE_MUST_BE_INITIALIZED_ERROR as _ } from "../common/constants.js";
|
|
25
25
|
import { SupportedOptions as Wt, logger as r } from "../../shared-lib/index.js";
|
|
26
|
+
import _t from "../models/identifier.js";
|
|
26
27
|
const L = {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
28
|
+
Eo: "allowCrawlerActivity",
|
|
29
|
+
_o: "baseUrl",
|
|
30
|
+
Io: "noCookies",
|
|
31
|
+
Ao: "devicePropertyAllowlist",
|
|
32
|
+
Aa: "disablePushTokenMaintenance",
|
|
33
|
+
So: "enableLogging",
|
|
34
|
+
No: "enableSdkAuthentication",
|
|
35
|
+
qa: "manageServiceWorkerExternally",
|
|
36
|
+
Oo: "minimumIntervalBetweenTriggerActionsInSeconds",
|
|
37
|
+
Po: "sessionTimeoutInSeconds",
|
|
38
|
+
Ro: "appVersion",
|
|
39
|
+
Lo: "appVersionNumber",
|
|
40
|
+
_a: "serviceWorkerLocation",
|
|
41
|
+
ka: "safariWebsitePushId",
|
|
42
|
+
zn: "localization",
|
|
43
|
+
ho: "contentSecurityNonce",
|
|
44
|
+
Do: "allowUserSuppliedJavascript",
|
|
45
|
+
bo: "inAppMessageZIndex",
|
|
46
|
+
wo: "openInAppMessagesInNewTab",
|
|
46
47
|
tn: "openCardsInNewTab",
|
|
47
48
|
en: "openNewsFeedCardsInNewTab",
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
Lh: "requireExplicitInAppMessageDismissal",
|
|
50
|
+
Mo: "doNotLoadFontAwesome",
|
|
51
|
+
Uo: "deviceId",
|
|
50
52
|
Bo: "sdkFlavor",
|
|
51
53
|
};
|
|
52
|
-
class
|
|
54
|
+
class Vt {
|
|
53
55
|
constructor() {
|
|
54
|
-
(this.
|
|
56
|
+
(this.rn = ""),
|
|
55
57
|
(this.Wo = ""),
|
|
56
58
|
(this.Vo = void 0),
|
|
57
59
|
(this.Go = null),
|
|
58
|
-
(this.
|
|
60
|
+
(this.on = null),
|
|
59
61
|
(this.qt = null),
|
|
60
62
|
(this.Ei = null),
|
|
61
63
|
(this.yt = null),
|
|
@@ -71,20 +73,20 @@ class zt {
|
|
|
71
73
|
(this.Ho = []),
|
|
72
74
|
(this.Xo = []),
|
|
73
75
|
(this._e = []),
|
|
74
|
-
(this.Wo = "5.
|
|
76
|
+
(this.Wo = "5.2.0");
|
|
75
77
|
}
|
|
76
78
|
Zo(t) {
|
|
77
79
|
this.Jo.It(t);
|
|
78
80
|
}
|
|
79
|
-
|
|
81
|
+
Sh(t) {
|
|
80
82
|
this.Yo.It(t);
|
|
81
83
|
}
|
|
82
84
|
initialize(t, i) {
|
|
83
85
|
if (this.so())
|
|
84
86
|
return r.info("Braze has already been initialized with an API key."), !0;
|
|
85
87
|
this.options = i || {};
|
|
86
|
-
let s = this.nn(L.
|
|
87
|
-
const e = ut(eo.
|
|
88
|
+
let s = this.nn(L.So);
|
|
89
|
+
const e = ut(eo.Un());
|
|
88
90
|
if (
|
|
89
91
|
(e && "true" === e.brazeLogging && (s = !0),
|
|
90
92
|
r.init(s),
|
|
@@ -94,8 +96,8 @@ class zt {
|
|
|
94
96
|
null == t || "" === t || "string" != typeof t)
|
|
95
97
|
)
|
|
96
98
|
return r.error("Braze requires a valid API key to be initialized."), !1;
|
|
97
|
-
this.
|
|
98
|
-
let n = this.nn(L.
|
|
99
|
+
this.rn = t;
|
|
100
|
+
let n = this.nn(L._o);
|
|
99
101
|
if (null == n || "" === n || "string" != typeof n)
|
|
100
102
|
return r.error("Braze requires a valid baseUrl to be initialized."), !1;
|
|
101
103
|
!1 === /^https?:/.test(n) && (n = `https://${n}`);
|
|
@@ -105,14 +107,14 @@ class zt {
|
|
|
105
107
|
(n.href = h),
|
|
106
108
|
"/" === n.pathname && (n = `${n}api/v3`),
|
|
107
109
|
(this.Ko = n.toString()),
|
|
108
|
-
X.Qo && !this.nn(L.
|
|
110
|
+
X.Qo && !this.nn(L.Eo))
|
|
109
111
|
)
|
|
110
112
|
return (
|
|
111
113
|
r.info("Ignoring activity from crawler bot " + navigator.userAgent),
|
|
112
114
|
(this.qo = !0),
|
|
113
115
|
!1
|
|
114
116
|
);
|
|
115
|
-
const a = this.nn(L.
|
|
117
|
+
const a = this.nn(L.Io) || !1;
|
|
116
118
|
if (
|
|
117
119
|
((this.u = Bt.Wh(t, a)), a && this.u.Vh(t), new Q.ee(null, !0).br(o.se))
|
|
118
120
|
)
|
|
@@ -131,7 +133,7 @@ class zt {
|
|
|
131
133
|
? (this.Vo = t)
|
|
132
134
|
: r.error("Invalid sdk flavor passed: " + t);
|
|
133
135
|
}
|
|
134
|
-
let u = this.nn(Wt.
|
|
136
|
+
let u = this.nn(Wt.Ao);
|
|
135
137
|
if (null != u)
|
|
136
138
|
if (j(u)) {
|
|
137
139
|
const t = [];
|
|
@@ -148,33 +150,38 @@ class zt {
|
|
|
148
150
|
"devicePropertyAllowlist must be an array. Defaulting to all properties.",
|
|
149
151
|
),
|
|
150
152
|
(u = null);
|
|
151
|
-
|
|
153
|
+
const f = this.nn(L.Uo);
|
|
154
|
+
if (f) {
|
|
155
|
+
const t = new _t(f);
|
|
156
|
+
this.u.uu(o.iu.Uo, t);
|
|
157
|
+
}
|
|
158
|
+
(this.on = new Ot(this.u, u)),
|
|
152
159
|
(this.yt = new Dt(this.u)),
|
|
153
160
|
(this.wt = new bt(this.yt, this.u)),
|
|
154
|
-
(this.di = new Mt(this.u, this.wt, this.yt, this.nn(L.
|
|
155
|
-
const
|
|
161
|
+
(this.di = new Mt(this.u, this.wt, this.yt, this.nn(L.Po)));
|
|
162
|
+
const c = new T();
|
|
156
163
|
return (
|
|
157
|
-
(this.Go = new kt(this.u, this.nn(L.
|
|
158
|
-
this.$t(
|
|
164
|
+
(this.Go = new kt(this.u, this.nn(L.No), c)),
|
|
165
|
+
this.$t(c),
|
|
159
166
|
(this.qt = new Rt(
|
|
160
|
-
this.
|
|
167
|
+
this.on,
|
|
161
168
|
this.u,
|
|
162
169
|
this.Go,
|
|
163
170
|
this.wt,
|
|
164
171
|
this.di,
|
|
165
172
|
this.yt,
|
|
166
|
-
this.
|
|
173
|
+
this.rn,
|
|
167
174
|
this.Ko,
|
|
168
175
|
this.Wo,
|
|
169
176
|
this.Vo || "",
|
|
177
|
+
this.nn(L.Ro),
|
|
170
178
|
this.nn(L.Lo),
|
|
171
|
-
this.nn(L.Do),
|
|
172
179
|
)),
|
|
173
180
|
(this.Ei = new Lt(
|
|
174
|
-
this.
|
|
181
|
+
this.rn,
|
|
175
182
|
this.Ko,
|
|
176
183
|
this.di,
|
|
177
|
-
this.
|
|
184
|
+
this.on,
|
|
178
185
|
this.wt,
|
|
179
186
|
this.yt,
|
|
180
187
|
this.u,
|
|
@@ -188,8 +195,8 @@ class zt {
|
|
|
188
195
|
a || this.u.Kh(),
|
|
189
196
|
r.info(
|
|
190
197
|
`Initialized for the Braze backend at "${this.nn(
|
|
191
|
-
L.
|
|
192
|
-
)}" with API key "${this.
|
|
198
|
+
L._o,
|
|
199
|
+
)}" with API key "${this.rn}".`,
|
|
193
200
|
),
|
|
194
201
|
et.o(),
|
|
195
202
|
this.yt.xi(() => {
|
|
@@ -227,7 +234,7 @@ class zt {
|
|
|
227
234
|
null != this.Ei && this.Ei.destroy(),
|
|
228
235
|
(this.Ei = null),
|
|
229
236
|
(this.Go = null),
|
|
230
|
-
(this.
|
|
237
|
+
(this.on = null),
|
|
231
238
|
(this.qt = null),
|
|
232
239
|
(this.yt = null),
|
|
233
240
|
(this.di = null),
|
|
@@ -242,8 +249,8 @@ class zt {
|
|
|
242
249
|
X() {
|
|
243
250
|
return !this.$h() && (!!this.so() || (console.warn(_), !1));
|
|
244
251
|
}
|
|
245
|
-
|
|
246
|
-
return this.
|
|
252
|
+
Ma() {
|
|
253
|
+
return this.rn;
|
|
247
254
|
}
|
|
248
255
|
Sr() {
|
|
249
256
|
return this.Go;
|
|
@@ -252,7 +259,7 @@ class zt {
|
|
|
252
259
|
return this.Ko;
|
|
253
260
|
}
|
|
254
261
|
te() {
|
|
255
|
-
return this.
|
|
262
|
+
return this.on;
|
|
256
263
|
}
|
|
257
264
|
nr() {
|
|
258
265
|
return this.qt;
|
|
@@ -282,7 +289,7 @@ class zt {
|
|
|
282
289
|
return this.wt;
|
|
283
290
|
}
|
|
284
291
|
tr() {
|
|
285
|
-
return !0 === this.nn(L.
|
|
292
|
+
return !0 === this.nn(L.Do);
|
|
286
293
|
}
|
|
287
294
|
g(t) {
|
|
288
295
|
let i = !1;
|
|
@@ -316,5 +323,5 @@ class zt {
|
|
|
316
323
|
return this.Wo;
|
|
317
324
|
}
|
|
318
325
|
}
|
|
319
|
-
const e = new
|
|
320
|
-
export { e as default,
|
|
326
|
+
const e = new Vt();
|
|
327
|
+
export { e as default, Vt as BrazeSdkInstance, L as OPTIONS };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import X from "../util/browser-detector.js";
|
|
2
|
-
import
|
|
2
|
+
import zt from "../models/device.js";
|
|
3
3
|
import DeviceProperties from "../Core/device-properties.js";
|
|
4
4
|
import _t from "../models/identifier.js";
|
|
5
5
|
import { logger as r, Guid as p } from "../../shared-lib/index.js";
|
|
@@ -15,28 +15,28 @@ export default class Ot {
|
|
|
15
15
|
(this.Ia = e);
|
|
16
16
|
}
|
|
17
17
|
ce(t = !0) {
|
|
18
|
-
let e = this.u.tu(o.iu.
|
|
19
|
-
null == e && ((e = new _t(p.W())), t && this.u.uu(o.iu.
|
|
20
|
-
const r = new
|
|
18
|
+
let e = this.u.tu(o.iu.Uo);
|
|
19
|
+
null == e && ((e = new _t(p.W())), t && this.u.uu(o.iu.Uo, e));
|
|
20
|
+
const r = new zt(e.eu);
|
|
21
21
|
for (let t = 0; t < this.Ia.length; t++) {
|
|
22
22
|
switch (this.Ia[t]) {
|
|
23
23
|
case DeviceProperties.BROWSER:
|
|
24
24
|
r.browser = X.browser;
|
|
25
25
|
break;
|
|
26
26
|
case DeviceProperties.BROWSER_VERSION:
|
|
27
|
-
r.
|
|
27
|
+
r.Ta = X.version;
|
|
28
28
|
break;
|
|
29
29
|
case DeviceProperties.OS:
|
|
30
|
-
r.os = this.
|
|
30
|
+
r.os = this.Da();
|
|
31
31
|
break;
|
|
32
32
|
case DeviceProperties.RESOLUTION:
|
|
33
|
-
r.
|
|
33
|
+
r.Oa = screen.width + "x" + screen.height;
|
|
34
34
|
break;
|
|
35
35
|
case DeviceProperties.LANGUAGE:
|
|
36
36
|
r.language = X.language;
|
|
37
37
|
break;
|
|
38
38
|
case DeviceProperties.TIME_ZONE:
|
|
39
|
-
r.timeZone = this.
|
|
39
|
+
r.timeZone = this.Ca(new Date());
|
|
40
40
|
break;
|
|
41
41
|
case DeviceProperties.USER_AGENT:
|
|
42
42
|
r.userAgent = X.userAgent;
|
|
@@ -44,12 +44,12 @@ export default class Ot {
|
|
|
44
44
|
}
|
|
45
45
|
return r;
|
|
46
46
|
}
|
|
47
|
-
|
|
48
|
-
if (X.
|
|
49
|
-
const t = this.u.j(o.C.
|
|
50
|
-
return t && t.os_version ? t.os_version : X.
|
|
47
|
+
Da() {
|
|
48
|
+
if (X.Fa()) return X.Fa();
|
|
49
|
+
const t = this.u.j(o.C.Ga);
|
|
50
|
+
return t && t.os_version ? t.os_version : X.Da();
|
|
51
51
|
}
|
|
52
|
-
|
|
52
|
+
Ca(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 s = t.getTimezoneOffset();
|
|
69
|
-
return this.
|
|
69
|
+
return this.Ja(s);
|
|
70
70
|
}
|
|
71
|
-
|
|
71
|
+
Ja(t) {
|
|
72
72
|
const e = Math.trunc(t / 60),
|
|
73
73
|
r = Math.trunc(t % 60);
|
|
74
74
|
let s = "GMT";
|