@braze/web-sdk 5.2.0 → 5.3.1
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 +54 -5
- package/package.json +1 -1
- package/shared-lib/event-types.js +14 -14
- package/shared-lib/indexed-db-adapter.js +51 -51
- package/shared-lib/logger.js +7 -7
- package/shared-lib/supported-options.js +7 -7
- package/src/ContentCards/content-cards-provider.js +107 -135
- 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 +2 -2
- package/src/ContentCards/ui/show-content-cards.js +1 -1
- package/src/FeatureFlags/feature-flag.js +41 -30
- package/src/FeatureFlags/feature-flags-provider.js +88 -84
- 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 +3 -3
- package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +2 -2
- package/src/Feed/feed-provider.js +24 -24
- package/src/Feed/get-cached-feed.js +1 -1
- package/src/Feed/log-feed-displayed.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 +20 -20
- package/src/InAppMessage/display/modal-utils.js +5 -5
- package/src/InAppMessage/get-deferred-in-app-message.js +1 -1
- package/src/InAppMessage/in-app-message-factory.js +4 -4
- package/src/InAppMessage/in-app-message-manager.js +78 -75
- 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/full-screen-message.js +12 -12
- package/src/InAppMessage/models/html-message.js +9 -9
- package/src/InAppMessage/models/in-app-message-button.js +2 -2
- package/src/InAppMessage/models/in-app-message.js +84 -82
- package/src/InAppMessage/models/modal-message.js +12 -12
- package/src/InAppMessage/models/slide-up-message.js +17 -17
- 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 +17 -17
- package/src/Push/push-manager-factory.js +6 -6
- package/src/Push/push-manager.js +2 -2
- package/src/Push/utils/push-utils.js +1 -1
- package/src/User/user.js +12 -12
- package/src/common/base-provider.js +1 -1
- package/src/common/constants.js +0 -2
- package/src/common/event-logger.js +2 -2
- package/src/common/feed-display.js +1 -1
- package/src/managers/auth-manager.js +3 -3
- package/src/managers/braze-instance.js +73 -73
- package/src/managers/device-manager.js +15 -15
- package/src/managers/network-manager.js +190 -145
- package/src/managers/server-config-manager.js +43 -47
- package/src/managers/session-manager.js +21 -21
- package/src/managers/storage-manager-factory.js +1 -1
- package/src/managers/storage-manager.js +107 -107
- package/src/managers/utils.js +1 -1
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +6 -6
- package/src/models/device.js +2 -2
- package/src/models/identifier.js +8 -8
- package/src/models/server-config.js +25 -25
- package/src/request-controller.js +115 -108
- 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 +3 -3
- package/src/triggers/models/filter.js +55 -55
- package/src/triggers/models/in-app-message-click-data.js +8 -8
- 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 +3 -3
- package/src/triggers/models/trigger-condition.js +40 -40
- package/src/triggers/models/trigger-events.js +1 -1
- package/src/triggers/models/trigger.js +31 -31
- package/src/triggers/triggers-provider-factory.js +1 -1
- package/src/triggers/triggers-provider.js +40 -40
- package/src/ui/js/attach-css.js +2 -2
- package/src/util/base-device-parser.js +7 -7
- package/src/util/braze-actions.js +4 -4
- package/src/util/browser-detector.js +23 -23
- package/src/util/client-hints-parser.js +4 -4
- package/src/util/dom-utils.js +6 -6
- package/src/util/net.js +4 -4
- package/src/util/request-header-utils.js +36 -37
- package/src/util/user-agent-parser.js +7 -7
- package/src/util/window-utils.js +1 -1
package/src/User/user.js
CHANGED
|
@@ -18,7 +18,7 @@ import { SET_CUSTOM_USER_ATTRIBUTE_STRING as Ft } from "../common/constants.js";
|
|
|
18
18
|
import { toValidBackendTimeString as $t } from "../util/date-utils.js";
|
|
19
19
|
export default class User {
|
|
20
20
|
constructor(t, e) {
|
|
21
|
-
(this.wt = t), (this.
|
|
21
|
+
(this.wt = t), (this.zi = e), (this.wt = t), (this.zi = e);
|
|
22
22
|
}
|
|
23
23
|
getUserId(t) {
|
|
24
24
|
const e = this.wt.getUserId();
|
|
@@ -33,7 +33,7 @@ export default class User {
|
|
|
33
33
|
? (r.error("addAlias requires a non-empty alias"), !1)
|
|
34
34
|
: !P(e, "add alias", "the label", !1) || e.length <= 0
|
|
35
35
|
? (r.error("addAlias requires a non-empty label"), !1)
|
|
36
|
-
: this.
|
|
36
|
+
: this.zi.Cn(t, e).L;
|
|
37
37
|
}
|
|
38
38
|
setFirstName(t) {
|
|
39
39
|
return (
|
|
@@ -162,7 +162,7 @@ export default class User {
|
|
|
162
162
|
"Cannot set last-known location - accuracy and altitudeAccuracy may not be negative.",
|
|
163
163
|
),
|
|
164
164
|
!1)
|
|
165
|
-
: this.
|
|
165
|
+
: this.zi.setLastKnownLocation(this.wt.getUserId(), t, e, n, s, i).L);
|
|
166
166
|
}
|
|
167
167
|
setCustomUserAttribute(t, e, r) {
|
|
168
168
|
if (!At(t)) return !1;
|
|
@@ -179,11 +179,11 @@ export default class User {
|
|
|
179
179
|
if (j(e)) {
|
|
180
180
|
const [r, n] = St(t, e);
|
|
181
181
|
if (!r && !n && 0 !== e.length) return !1;
|
|
182
|
-
if (r || 0 === e.length) return this.
|
|
182
|
+
if (r || 0 === e.length) return this.zi.Fn(i.$n, t, e).L;
|
|
183
183
|
for (const t of e) if (!s(t)) return !1;
|
|
184
184
|
} else if (Nt(e)) {
|
|
185
185
|
if (!s(e)) return !1;
|
|
186
|
-
if (r) return this.
|
|
186
|
+
if (r) return this.zi.Fn(i.Bn, t, e).L;
|
|
187
187
|
} else {
|
|
188
188
|
if (!(void 0 !== e && Ut(e))) return !1;
|
|
189
189
|
if (
|
|
@@ -206,7 +206,7 @@ export default class User {
|
|
|
206
206
|
null != e &&
|
|
207
207
|
!rt(e, "add to custom user attribute array", "the given value")
|
|
208
208
|
) &&
|
|
209
|
-
this.
|
|
209
|
+
this.zi.Fn(i.Ln, t, e).L
|
|
210
210
|
);
|
|
211
211
|
}
|
|
212
212
|
removeFromCustomAttributeArray(t, e) {
|
|
@@ -216,7 +216,7 @@ export default class User {
|
|
|
216
216
|
null != e &&
|
|
217
217
|
!rt(e, "remove from custom user attribute array", "the given value")
|
|
218
218
|
) &&
|
|
219
|
-
this.
|
|
219
|
+
this.zi.Fn(i.Rn, t, e).L
|
|
220
220
|
);
|
|
221
221
|
}
|
|
222
222
|
incrementCustomUserAttribute(t, e) {
|
|
@@ -228,7 +228,7 @@ export default class User {
|
|
|
228
228
|
`Cannot increment custom user attribute because the given incrementValue "${e}" is not an integer.`,
|
|
229
229
|
),
|
|
230
230
|
!1)
|
|
231
|
-
: this.
|
|
231
|
+
: this.zi.Fn(i.On, t, s).L;
|
|
232
232
|
}
|
|
233
233
|
setCustomLocationAttribute(t, e, s) {
|
|
234
234
|
return (
|
|
@@ -244,7 +244,7 @@ export default class User {
|
|
|
244
244
|
"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.",
|
|
245
245
|
),
|
|
246
246
|
!1)
|
|
247
|
-
: this.
|
|
247
|
+
: this.zi.Gn(t, e, s).L)
|
|
248
248
|
);
|
|
249
249
|
}
|
|
250
250
|
addToSubscriptionGroup(t) {
|
|
@@ -258,7 +258,7 @@ export default class User {
|
|
|
258
258
|
"addToSubscriptionGroup requires a non-empty subscription group ID",
|
|
259
259
|
),
|
|
260
260
|
!1)
|
|
261
|
-
: this.
|
|
261
|
+
: this.zi.Hn(t, User.Kn.SUBSCRIBED).L;
|
|
262
262
|
}
|
|
263
263
|
removeFromSubscriptionGroup(t) {
|
|
264
264
|
return !P(
|
|
@@ -271,10 +271,10 @@ export default class User {
|
|
|
271
271
|
"removeFromSubscriptionGroup requires a non-empty subscription group ID",
|
|
272
272
|
),
|
|
273
273
|
!1)
|
|
274
|
-
: this.
|
|
274
|
+
: this.zi.Hn(t, User.Kn.UNSUBSCRIBED).L;
|
|
275
275
|
}
|
|
276
276
|
kn(t, e, r, s, n) {
|
|
277
|
-
this.wt.kn(t, e, r, s, n), this.
|
|
277
|
+
this.wt.kn(t, e, r, s, n), this.zi.Mn();
|
|
278
278
|
}
|
|
279
279
|
Dn(t) {
|
|
280
280
|
this.wt.Dn(t);
|
package/src/common/constants.js
CHANGED
|
@@ -7,8 +7,6 @@ export const LOG_CUSTOM_EVENT_STRING = "logCustomEvent";
|
|
|
7
7
|
export const SET_CUSTOM_USER_ATTRIBUTE_STRING = "setCustomUserAttribute";
|
|
8
8
|
export const BRAZE_MUST_BE_INITIALIZED_ERROR =
|
|
9
9
|
"Braze must be initialized before calling methods.";
|
|
10
|
-
export const CONTENT_CARDS_RATE_LIMIT_CAPACITY_DEFAULT = 5;
|
|
11
|
-
export const CONTENT_CARDS_RATE_LIMIT_REFILL_RATE_DEFAULT = 90;
|
|
12
10
|
export const GLOBAL_RATE_LIMIT_CAPACITY_DEFAULT = 30;
|
|
13
11
|
export const GLOBAL_RATE_LIMIT_REFILL_RATE_DEFAULT = 30;
|
|
14
12
|
export const LAST_REQUEST_TO_ENDPOINT_MS_AGO_DEFAULT = 72e5;
|
|
@@ -14,7 +14,7 @@ const s = {
|
|
|
14
14
|
),
|
|
15
15
|
d
|
|
16
16
|
);
|
|
17
|
-
const u = m.
|
|
17
|
+
const u = m.wo();
|
|
18
18
|
return (
|
|
19
19
|
d.ge.push(
|
|
20
20
|
new ue(
|
|
@@ -26,7 +26,7 @@ const s = {
|
|
|
26
26
|
),
|
|
27
27
|
),
|
|
28
28
|
(d.L =
|
|
29
|
-
(null === (l = e.l()) || void 0 === l ? void 0 : l.
|
|
29
|
+
(null === (l = e.l()) || void 0 === l ? void 0 : l.xo(d.ge)) || !1),
|
|
30
30
|
d
|
|
31
31
|
);
|
|
32
32
|
},
|
|
@@ -23,10 +23,10 @@ export default class kt {
|
|
|
23
23
|
const i = this.kh();
|
|
24
24
|
this.u.k(o.C.wh, t);
|
|
25
25
|
const s = A.Yt.Qt;
|
|
26
|
-
new A(s, r).setItem(s.ss.jh, this.gh, t), i !== t && this.
|
|
26
|
+
new A(s, r).setItem(s.ss.jh, this.gh, t), i !== t && this.Os();
|
|
27
27
|
}
|
|
28
28
|
xh() {
|
|
29
|
-
this.u.
|
|
29
|
+
this.u.ti(o.C.wh);
|
|
30
30
|
const t = A.Yt.Qt;
|
|
31
31
|
new A(t, r).re(t.ss.jh, this.gh);
|
|
32
32
|
}
|
|
@@ -45,7 +45,7 @@ export default class kt {
|
|
|
45
45
|
Gh() {
|
|
46
46
|
return this.Zn;
|
|
47
47
|
}
|
|
48
|
-
|
|
48
|
+
Os() {
|
|
49
49
|
this.Zn = 0;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -29,21 +29,21 @@ const L = {
|
|
|
29
29
|
_o: "baseUrl",
|
|
30
30
|
Io: "noCookies",
|
|
31
31
|
Ao: "devicePropertyAllowlist",
|
|
32
|
-
|
|
32
|
+
_a: "disablePushTokenMaintenance",
|
|
33
33
|
So: "enableLogging",
|
|
34
34
|
No: "enableSdkAuthentication",
|
|
35
|
-
|
|
35
|
+
Ma: "manageServiceWorkerExternally",
|
|
36
36
|
Oo: "minimumIntervalBetweenTriggerActionsInSeconds",
|
|
37
37
|
Po: "sessionTimeoutInSeconds",
|
|
38
38
|
Ro: "appVersion",
|
|
39
39
|
Lo: "appVersionNumber",
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
wa: "serviceWorkerLocation",
|
|
41
|
+
ya: "safariWebsitePushId",
|
|
42
42
|
zn: "localization",
|
|
43
|
-
|
|
43
|
+
bo: "contentSecurityNonce",
|
|
44
44
|
Do: "allowUserSuppliedJavascript",
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
jo: "inAppMessageZIndex",
|
|
46
|
+
ho: "openInAppMessagesInNewTab",
|
|
47
47
|
tn: "openCardsInNewTab",
|
|
48
48
|
en: "openNewsFeedCardsInNewTab",
|
|
49
49
|
Lh: "requireExplicitInAppMessageDismissal",
|
|
@@ -56,30 +56,30 @@ class Vt {
|
|
|
56
56
|
(this.rn = ""),
|
|
57
57
|
(this.Wo = ""),
|
|
58
58
|
(this.Vo = void 0),
|
|
59
|
-
(this.
|
|
59
|
+
(this.zo = null),
|
|
60
60
|
(this.on = null),
|
|
61
61
|
(this.qt = null),
|
|
62
|
-
(this.
|
|
62
|
+
(this.zi = null),
|
|
63
63
|
(this.yt = null),
|
|
64
|
-
(this.
|
|
64
|
+
(this.ri = null),
|
|
65
65
|
(this.u = null),
|
|
66
66
|
(this.wt = null),
|
|
67
|
-
(this.
|
|
67
|
+
(this.Go = ""),
|
|
68
|
+
(this.Ko = !1),
|
|
68
69
|
(this.$o = !1),
|
|
69
|
-
(this.qo =
|
|
70
|
+
(this.qo = new T()),
|
|
70
71
|
(this.Jo = new T()),
|
|
71
|
-
(this.Yo = new T()),
|
|
72
72
|
(this.options = {}),
|
|
73
|
+
(this.Yo = []),
|
|
73
74
|
(this.Ho = []),
|
|
74
|
-
(this.Xo = []),
|
|
75
75
|
(this._e = []),
|
|
76
|
-
(this.Wo = "5.
|
|
76
|
+
(this.Wo = "5.3.1");
|
|
77
77
|
}
|
|
78
|
-
|
|
79
|
-
this.
|
|
78
|
+
Xo(t) {
|
|
79
|
+
this.qo.It(t);
|
|
80
80
|
}
|
|
81
81
|
Sh(t) {
|
|
82
|
-
this.
|
|
82
|
+
this.Jo.It(t);
|
|
83
83
|
}
|
|
84
84
|
initialize(t, i) {
|
|
85
85
|
if (this.so())
|
|
@@ -106,21 +106,21 @@ class Vt {
|
|
|
106
106
|
((n = document.createElement("a")),
|
|
107
107
|
(n.href = h),
|
|
108
108
|
"/" === n.pathname && (n = `${n}api/v3`),
|
|
109
|
-
(this.
|
|
110
|
-
X.
|
|
109
|
+
(this.Go = n.toString()),
|
|
110
|
+
X.Zo && !this.nn(L.Eo))
|
|
111
111
|
)
|
|
112
112
|
return (
|
|
113
113
|
r.info("Ignoring activity from crawler bot " + navigator.userAgent),
|
|
114
|
-
(this
|
|
114
|
+
(this.$o = !0),
|
|
115
115
|
!1
|
|
116
116
|
);
|
|
117
117
|
const a = this.nn(L.Io) || !1;
|
|
118
118
|
if (
|
|
119
|
-
((this.u = Bt.
|
|
119
|
+
((this.u = Bt.Qo(t, a)), a && this.u.Wh(t), new Q.ee(null, !0).br(o.se))
|
|
120
120
|
)
|
|
121
121
|
return (
|
|
122
122
|
r.info("Ignoring all activity due to previous opt out"),
|
|
123
|
-
(this
|
|
123
|
+
(this.$o = !0),
|
|
124
124
|
!1
|
|
125
125
|
);
|
|
126
126
|
for (const t of to(this.options))
|
|
@@ -158,105 +158,105 @@ class Vt {
|
|
|
158
158
|
(this.on = new Ot(this.u, u)),
|
|
159
159
|
(this.yt = new Dt(this.u)),
|
|
160
160
|
(this.wt = new bt(this.yt, this.u)),
|
|
161
|
-
(this.
|
|
161
|
+
(this.ri = new Mt(this.u, this.wt, this.yt, this.nn(L.Po)));
|
|
162
162
|
const c = new T();
|
|
163
163
|
return (
|
|
164
|
-
(this.
|
|
164
|
+
(this.zo = new kt(this.u, this.nn(L.No), c)),
|
|
165
165
|
this.$t(c),
|
|
166
166
|
(this.qt = new Rt(
|
|
167
167
|
this.on,
|
|
168
168
|
this.u,
|
|
169
|
-
this.
|
|
169
|
+
this.zo,
|
|
170
170
|
this.wt,
|
|
171
|
-
this.
|
|
171
|
+
this.ri,
|
|
172
172
|
this.yt,
|
|
173
173
|
this.rn,
|
|
174
|
-
this.
|
|
174
|
+
this.Go,
|
|
175
175
|
this.Wo,
|
|
176
176
|
this.Vo || "",
|
|
177
177
|
this.nn(L.Ro),
|
|
178
178
|
this.nn(L.Lo),
|
|
179
179
|
)),
|
|
180
|
-
(this.
|
|
180
|
+
(this.zi = new Lt(
|
|
181
181
|
this.rn,
|
|
182
|
-
this.
|
|
183
|
-
this.
|
|
182
|
+
this.Go,
|
|
183
|
+
this.ri,
|
|
184
184
|
this.on,
|
|
185
185
|
this.wt,
|
|
186
186
|
this.yt,
|
|
187
187
|
this.u,
|
|
188
188
|
(t) => {
|
|
189
|
-
if (this.so()) for (const i of this.gr()) i.
|
|
189
|
+
if (this.so()) for (const i of this.gr()) i.Ns(t);
|
|
190
190
|
},
|
|
191
|
-
this.
|
|
191
|
+
this.zo,
|
|
192
192
|
this.qt,
|
|
193
193
|
)),
|
|
194
|
-
this.
|
|
195
|
-
a || this.u.
|
|
194
|
+
this.zi.initialize(),
|
|
195
|
+
a || this.u.Vh(),
|
|
196
196
|
r.info(
|
|
197
197
|
`Initialized for the Braze backend at "${this.nn(
|
|
198
198
|
L._o,
|
|
199
199
|
)}" with API key "${this.rn}".`,
|
|
200
200
|
),
|
|
201
201
|
et.o(),
|
|
202
|
-
this.yt.
|
|
202
|
+
this.yt.ji(() => {
|
|
203
203
|
var t;
|
|
204
|
-
this
|
|
205
|
-
(null === (t = this.yt) || void 0 === t ? void 0 : t.
|
|
204
|
+
this.Ko &&
|
|
205
|
+
(null === (t = this.yt) || void 0 === t ? void 0 : t.ci()) &&
|
|
206
206
|
import("../FeatureFlags/refresh-feature-flags.js").then((t) => {
|
|
207
|
-
if (!this
|
|
207
|
+
if (!this.Ko) return;
|
|
208
208
|
(0, t.default)();
|
|
209
209
|
});
|
|
210
210
|
}),
|
|
211
|
-
this.
|
|
211
|
+
this.zi.mr(() => {
|
|
212
212
|
var t;
|
|
213
|
-
this
|
|
214
|
-
(null === (t = this.yt) || void 0 === t ? void 0 : t.
|
|
213
|
+
this.Ko &&
|
|
214
|
+
(null === (t = this.yt) || void 0 === t ? void 0 : t.ci()) &&
|
|
215
215
|
import("../FeatureFlags/refresh-feature-flags.js").then((t) => {
|
|
216
|
-
if (!this
|
|
216
|
+
if (!this.Ko) return;
|
|
217
217
|
(0, t.default)(void 0, void 0, !0);
|
|
218
218
|
});
|
|
219
219
|
}),
|
|
220
|
-
this.
|
|
221
|
-
(this
|
|
220
|
+
this.qo.Dt(this.options),
|
|
221
|
+
(this.Ko = !0),
|
|
222
222
|
!0
|
|
223
223
|
);
|
|
224
224
|
}
|
|
225
225
|
destroy(t) {
|
|
226
226
|
if ((r.destroy(), this.so())) {
|
|
227
|
-
this.
|
|
228
|
-
for (const t of this.
|
|
229
|
-
this.
|
|
230
|
-
for (const t of this.
|
|
231
|
-
(this.
|
|
227
|
+
this.Jo.Dt(), this.Jo.removeAllSubscriptions();
|
|
228
|
+
for (const t of this.Yo) t.destroy();
|
|
229
|
+
this.Yo = [];
|
|
230
|
+
for (const t of this.Ho) t.clearData(!1);
|
|
231
|
+
(this.Ho = []),
|
|
232
232
|
this.removeAllSubscriptions(),
|
|
233
233
|
(this._e = []),
|
|
234
|
-
null != this.
|
|
235
|
-
(this.
|
|
236
|
-
(this.
|
|
234
|
+
null != this.zi && this.zi.destroy(),
|
|
235
|
+
(this.zi = null),
|
|
236
|
+
(this.zo = null),
|
|
237
237
|
(this.on = null),
|
|
238
238
|
(this.qt = null),
|
|
239
239
|
(this.yt = null),
|
|
240
|
-
(this.
|
|
240
|
+
(this.ri = null),
|
|
241
241
|
(this.wt = null),
|
|
242
242
|
(this.options = {}),
|
|
243
243
|
(this.Vo = void 0),
|
|
244
|
+
(this.Ko = !1),
|
|
244
245
|
(this.$o = !1),
|
|
245
|
-
(this.qo = !1),
|
|
246
246
|
t && (this.u = null);
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
249
|
X() {
|
|
250
|
-
return !this
|
|
250
|
+
return !this.Kh() && (!!this.so() || (console.warn(_), !1));
|
|
251
251
|
}
|
|
252
|
-
|
|
252
|
+
ba() {
|
|
253
253
|
return this.rn;
|
|
254
254
|
}
|
|
255
255
|
Sr() {
|
|
256
|
-
return this.
|
|
256
|
+
return this.zo;
|
|
257
257
|
}
|
|
258
|
-
|
|
259
|
-
return this.
|
|
258
|
+
Hs() {
|
|
259
|
+
return this.Go;
|
|
260
260
|
}
|
|
261
261
|
te() {
|
|
262
262
|
return this.on;
|
|
@@ -268,22 +268,22 @@ class Vt {
|
|
|
268
268
|
return this.options[t];
|
|
269
269
|
}
|
|
270
270
|
gr() {
|
|
271
|
-
return this.
|
|
271
|
+
return this.Ho;
|
|
272
272
|
}
|
|
273
273
|
cr() {
|
|
274
|
-
return this.
|
|
274
|
+
return this.zi;
|
|
275
275
|
}
|
|
276
276
|
ir() {
|
|
277
277
|
return this.yt;
|
|
278
278
|
}
|
|
279
279
|
zr() {
|
|
280
|
-
return this.
|
|
280
|
+
return this.ri;
|
|
281
281
|
}
|
|
282
282
|
l() {
|
|
283
283
|
return this.u;
|
|
284
284
|
}
|
|
285
285
|
pr() {
|
|
286
|
-
if (this.wt && this.
|
|
286
|
+
if (this.wt && this.zi) return new User(this.wt, this.zi);
|
|
287
287
|
}
|
|
288
288
|
er() {
|
|
289
289
|
return this.wt;
|
|
@@ -293,13 +293,13 @@ class Vt {
|
|
|
293
293
|
}
|
|
294
294
|
g(t) {
|
|
295
295
|
let i = !1;
|
|
296
|
-
for (const s of this.
|
|
297
|
-
i || this.
|
|
296
|
+
for (const s of this.Yo) s === t && (i = !0);
|
|
297
|
+
i || this.Yo.push(t);
|
|
298
298
|
}
|
|
299
299
|
ar(t) {
|
|
300
300
|
let i = !1;
|
|
301
|
-
for (const s of this.
|
|
302
|
-
t instanceof y && !i && this.
|
|
301
|
+
for (const s of this.Ho) s.constructor === t.constructor && (i = !0);
|
|
302
|
+
t instanceof y && !i && this.Ho.push(t);
|
|
303
303
|
}
|
|
304
304
|
$t(t) {
|
|
305
305
|
t instanceof T && this._e.push(t);
|
|
@@ -311,15 +311,15 @@ class Vt {
|
|
|
311
311
|
if (this.X()) for (const i of this._e) i.removeSubscription(t);
|
|
312
312
|
}
|
|
313
313
|
oe(t) {
|
|
314
|
-
this
|
|
314
|
+
this.$o = t;
|
|
315
315
|
}
|
|
316
316
|
so() {
|
|
317
|
-
return this
|
|
317
|
+
return this.Ko;
|
|
318
318
|
}
|
|
319
|
-
|
|
320
|
-
return this
|
|
319
|
+
Kh() {
|
|
320
|
+
return this.$o;
|
|
321
321
|
}
|
|
322
|
-
|
|
322
|
+
Ds() {
|
|
323
323
|
return this.Wo;
|
|
324
324
|
}
|
|
325
325
|
}
|
|
@@ -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.u = t),
|
|
12
|
-
(this.
|
|
12
|
+
(this.ka = e),
|
|
13
13
|
(this.u = t),
|
|
14
14
|
null == e && (e = Pt(DeviceProperties)),
|
|
15
|
-
(this.
|
|
15
|
+
(this.ka = e);
|
|
16
16
|
}
|
|
17
17
|
ce(t = !0) {
|
|
18
18
|
let e = this.u.tu(o.iu.Uo);
|
|
19
19
|
null == e && ((e = new _t(p.W())), t && this.u.uu(o.iu.Uo, e));
|
|
20
20
|
const r = new zt(e.eu);
|
|
21
|
-
for (let t = 0; t < this.
|
|
22
|
-
switch (this.
|
|
21
|
+
for (let t = 0; t < this.ka.length; t++) {
|
|
22
|
+
switch (this.ka[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.Ia = X.version;
|
|
28
28
|
break;
|
|
29
29
|
case DeviceProperties.OS:
|
|
30
|
-
r.os = this.
|
|
30
|
+
r.os = this.Ta();
|
|
31
31
|
break;
|
|
32
32
|
case DeviceProperties.RESOLUTION:
|
|
33
|
-
r.
|
|
33
|
+
r.Da = 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.Sa(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
|
+
Ta() {
|
|
48
|
+
if (X.Oa()) return X.Oa();
|
|
49
|
+
const t = this.u.j(o.C.Ca);
|
|
50
|
+
return t && t.os_version ? t.os_version : X.Ta();
|
|
51
51
|
}
|
|
52
|
-
|
|
52
|
+
Sa(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.Fa(s);
|
|
70
70
|
}
|
|
71
|
-
|
|
71
|
+
Fa(t) {
|
|
72
72
|
const e = Math.trunc(t / 60),
|
|
73
73
|
r = Math.trunc(t % 60);
|
|
74
74
|
let s = "GMT";
|