@braze/web-sdk 6.10.2 → 6.12.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 +61 -6
- package/package.json +1 -1
- package/shared-lib/encoding-utils.js +3 -3
- package/shared-lib/event-types.js +12 -12
- package/shared-lib/indexed-db-adapter.js +52 -52
- package/shared-lib/logger.js +7 -7
- package/shared-lib/supported-options.js +10 -10
- package/src/Core/logout.js +2 -2
- package/src/DUST/dust-config-store.js +89 -0
- package/src/DUST/dust-connection-core.js +7 -21
- package/src/DUST/dust-message-dedup.js +33 -0
- package/src/DUST/dust-provider.js +367 -397
- package/src/DUST/dust-tab-identity.js +30 -0
- package/src/DUST/index.js +7 -9
- package/src/DUST/subscribe-to-dust.js +5 -5
- package/src/FeatureFlags/feature-flag-factory.js +4 -4
- package/src/FeatureFlags/feature-flag.js +5 -5
- package/src/FeatureFlags/feature-flags-provider-factory.js +8 -1
- package/src/FeatureFlags/feature-flags-provider.js +74 -74
- 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 +1 -1
- package/src/InAppMessage/constants.js +39 -47
- package/src/InAppMessage/defer-in-app-message.js +2 -2
- package/src/InAppMessage/display/get-animation-effect.js +1 -1
- package/src/InAppMessage/display/html-message-display-utils.js +4 -4
- package/src/InAppMessage/display/html-message-to-html.js +10 -10
- package/src/InAppMessage/display/in-app-message-to-html.js +68 -66
- package/src/InAppMessage/display/modal-utils.js +14 -14
- package/src/InAppMessage/get-deferred-in-app-message.js +2 -2
- package/src/InAppMessage/in-app-message-factory.js +6 -6
- package/src/InAppMessage/in-app-message-manager-factory.js +5 -5
- package/src/InAppMessage/in-app-message-manager.js +101 -80
- 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 +3 -3
- package/src/InAppMessage/models/full-screen-message.js +25 -25
- package/src/InAppMessage/models/html-message.js +14 -14
- package/src/InAppMessage/models/in-app-message-button.js +4 -4
- package/src/InAppMessage/models/in-app-message.js +100 -98
- package/src/InAppMessage/models/modal-message.js +23 -23
- package/src/InAppMessage/models/slide-up-message.js +29 -29
- package/src/InAppMessage/models/templated-in-app-message.js +8 -8
- package/src/InAppMessage/subscribe-to-in-app-message.js +2 -2
- package/src/InAppMessage/ui/automatically-show-in-app-messages.js +2 -2
- package/src/InAppMessage/ui/show-in-app-message.js +42 -40
- package/src/Push/index.js +1 -0
- 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 +6 -6
- package/src/Push/push-manager.js +228 -185
- package/src/Push/register-push.js +9 -0
- package/src/Push/unregister-push-token-on-server.js +4 -4
- package/src/Push/utils/push-utils.js +16 -16
- package/src/User/user-manager.js +19 -19
- package/src/User/user.js +36 -36
- package/src/common/constants.js +1 -1
- package/src/common/content-cards-display.js +21 -21
- package/src/common/event-logger.js +2 -2
- package/src/l10n/l10n-manager-factory.js +7 -7
- package/src/l10n/l10n-manager.js +5 -5
- package/src/managers/auth-manager.js +1 -1
- package/src/managers/braze-instance.js +70 -66
- package/src/managers/device-manager.js +12 -12
- package/src/managers/network-manager.js +118 -118
- package/src/managers/server-config-manager.js +84 -84
- package/src/managers/session-manager.js +10 -10
- package/src/managers/storage-manager-factory.js +4 -4
- package/src/managers/storage-manager.js +138 -136
- package/src/managers/subscription-manager.js +1 -1
- package/src/managers/utils.js +1 -1
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +7 -7
- package/src/models/device.js +2 -2
- package/src/models/identifier.js +6 -6
- package/src/models/push-token.js +6 -6
- package/src/models/server-config.js +31 -31
- package/src/request-controller.js +91 -91
- package/src/triggers/models/filter.js +58 -58
- package/src/triggers/models/in-app-message-click-data.js +4 -4
- package/src/triggers/models/push-click-data.js +2 -2
- package/src/triggers/models/trigger-condition.js +35 -35
- package/src/triggers/models/trigger.js +37 -37
- package/src/triggers/triggers-provider-factory.js +3 -3
- package/src/triggers/triggers-provider.js +61 -53
- package/src/types.js +1 -1
- package/src/ui/js/attach-css.js +1 -1
- package/src/ui/js/feed-css.js +2 -2
- package/src/ui/js/iam-css.js +2 -2
- package/src/util/base-device-parser.js +1 -1
- package/src/util/braze-actions.js +4 -4
- package/src/util/browser-detector.js +13 -13
- package/src/util/client-hints-parser.js +4 -4
- package/src/util/component-utils.js +4 -4
- package/src/util/dom-utils.js +5 -5
- package/src/util/ecommerce-event-validation.js +77 -48
- package/src/util/key-codes.js +1 -1
- package/src/util/net.js +4 -4
- package/src/util/request-header-utils.js +20 -20
- package/src/util/string-utils.js +5 -0
- package/src/util/user-agent-parser.js +15 -15
- package/src/util/validation-utils.js +9 -9
- package/src/util/window-utils.js +2 -2
- package/src/DUST/dust-shared-worker-code.js +0 -2
- package/src/DUST/dust-shared-worker-impl.js +0 -234
- package/src/DUST/dust-worker-bridge.js +0 -151
package/src/models/identifier.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { Guid as V, logger as b } from "../../shared-lib/index.js";
|
|
2
2
|
import { isArray as g } from "../util/code-utils.js";
|
|
3
|
-
import { getErrorMessage as
|
|
3
|
+
import { getErrorMessage as ci } from "../util/error-utils.js";
|
|
4
4
|
export default class _t {
|
|
5
5
|
constructor(t, e, i) {
|
|
6
|
-
(this.
|
|
6
|
+
(this.Iu = t),
|
|
7
7
|
null == t && (t = V.de()),
|
|
8
8
|
!i || isNaN(i) ? (this.lm = new Date().valueOf()) : (this.lm = i),
|
|
9
|
-
(this.
|
|
9
|
+
(this.Iu = t),
|
|
10
10
|
(this.pm = new Date().valueOf()),
|
|
11
11
|
(this.fm = e);
|
|
12
12
|
}
|
|
13
13
|
qt() {
|
|
14
|
-
return `g:${encodeURIComponent(this.
|
|
14
|
+
return `g:${encodeURIComponent(this.Iu)}|e:${this.fm}|c:${this.lm}|l:${
|
|
15
15
|
this.pm
|
|
16
16
|
}`;
|
|
17
17
|
}
|
|
18
|
-
static
|
|
18
|
+
static AS(t) {
|
|
19
19
|
if ("string" != typeof t) return null;
|
|
20
20
|
const e = t.lastIndexOf("|e:"),
|
|
21
21
|
i = t.substring(0, e),
|
|
@@ -41,7 +41,7 @@ export default class _t {
|
|
|
41
41
|
(e.pm = n(i[3]));
|
|
42
42
|
} catch (e) {
|
|
43
43
|
b.info(
|
|
44
|
-
`Unable to parse cookie string ${t}, failed with error: ${
|
|
44
|
+
`Unable to parse cookie string ${t}, failed with error: ${ci(e)}`,
|
|
45
45
|
);
|
|
46
46
|
}
|
|
47
47
|
else {
|
package/src/models/push-token.js
CHANGED
|
@@ -2,23 +2,23 @@ import { rehydrateDateAfterJsonization as ee } from "../util/date-utils.js";
|
|
|
2
2
|
export default class ui {
|
|
3
3
|
constructor(t, i, s, l, h) {
|
|
4
4
|
(this.endpoint = t),
|
|
5
|
-
(this.
|
|
5
|
+
(this.Uu = i),
|
|
6
6
|
(this.publicKey = s),
|
|
7
7
|
(this.sc = l),
|
|
8
|
-
(this.
|
|
8
|
+
(this.ld = h),
|
|
9
9
|
(this.endpoint = t || null),
|
|
10
|
-
(this.
|
|
10
|
+
(this.Uu = i || null),
|
|
11
11
|
(this.publicKey = s || null),
|
|
12
12
|
(this.sc = l || null),
|
|
13
|
-
(this.
|
|
13
|
+
(this.ld = h || null);
|
|
14
14
|
}
|
|
15
15
|
qt() {
|
|
16
16
|
return {
|
|
17
17
|
e: this.endpoint,
|
|
18
|
-
c: this.
|
|
18
|
+
c: this.Uu,
|
|
19
19
|
p: this.publicKey,
|
|
20
20
|
u: this.sc,
|
|
21
|
-
v: this.
|
|
21
|
+
v: this.ld,
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
static _u(t) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
-
GLOBAL_RATE_LIMIT_CAPACITY_DEFAULT as
|
|
3
|
-
GLOBAL_RATE_LIMIT_REFILL_RATE_DEFAULT as
|
|
2
|
+
GLOBAL_RATE_LIMIT_CAPACITY_DEFAULT as _i,
|
|
3
|
+
GLOBAL_RATE_LIMIT_REFILL_RATE_DEFAULT as bi,
|
|
4
4
|
} from "../common/constants.js";
|
|
5
|
-
export default class
|
|
5
|
+
export default class vi {
|
|
6
6
|
constructor(
|
|
7
7
|
t = 0,
|
|
8
8
|
i = [],
|
|
@@ -12,52 +12,52 @@ export default class di {
|
|
|
12
12
|
e = null,
|
|
13
13
|
r = { enabled: !1 },
|
|
14
14
|
n = { enabled: !1, refresh_rate_limit: void 0 },
|
|
15
|
-
a = { enabled: !0, capacity:
|
|
15
|
+
a = { enabled: !0, capacity: _i, refill_rate: bi, endpoint_overrides: {} },
|
|
16
16
|
o = null,
|
|
17
17
|
u = null,
|
|
18
18
|
c = null,
|
|
19
19
|
d = null,
|
|
20
20
|
m = null,
|
|
21
21
|
) {
|
|
22
|
-
(this.
|
|
23
|
-
(this.
|
|
24
|
-
(this.
|
|
25
|
-
(this.
|
|
26
|
-
(this.
|
|
27
|
-
(this.
|
|
28
|
-
(this.
|
|
29
|
-
(this.
|
|
30
|
-
(this.
|
|
22
|
+
(this.ed = t),
|
|
23
|
+
(this.vd = i),
|
|
24
|
+
(this.md = s),
|
|
25
|
+
(this.gd = h),
|
|
26
|
+
(this.fd = l),
|
|
27
|
+
(this.ld = e),
|
|
28
|
+
(this.ud = r),
|
|
29
|
+
(this.Rr = n),
|
|
30
|
+
(this.nd = a),
|
|
31
31
|
(this.banners = o),
|
|
32
32
|
(this.dust = u),
|
|
33
|
-
(this.
|
|
34
|
-
(this.
|
|
35
|
-
(this.
|
|
33
|
+
(this.Cd = c),
|
|
34
|
+
(this.wd = d),
|
|
35
|
+
(this.ad = m);
|
|
36
36
|
}
|
|
37
37
|
qt() {
|
|
38
38
|
return {
|
|
39
|
-
s: "6.
|
|
40
|
-
l: this.
|
|
41
|
-
e: this.
|
|
42
|
-
a: this.
|
|
43
|
-
p: this.
|
|
44
|
-
m: this.
|
|
45
|
-
v: this.
|
|
46
|
-
c: this.
|
|
47
|
-
f: this.
|
|
48
|
-
grl: this.
|
|
39
|
+
s: "6.12.0",
|
|
40
|
+
l: this.ed,
|
|
41
|
+
e: this.vd,
|
|
42
|
+
a: this.md,
|
|
43
|
+
p: this.gd,
|
|
44
|
+
m: this.fd,
|
|
45
|
+
v: this.ld,
|
|
46
|
+
c: this.ud,
|
|
47
|
+
f: this.Rr,
|
|
48
|
+
grl: this.nd,
|
|
49
49
|
b: this.banners,
|
|
50
50
|
d: this.dust,
|
|
51
|
-
rb: this.
|
|
52
|
-
mst: this.
|
|
53
|
-
ch: this.
|
|
51
|
+
rb: this.Cd,
|
|
52
|
+
mst: this.wd,
|
|
53
|
+
ch: this.ad,
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
static _u(t) {
|
|
57
57
|
let i = t.l;
|
|
58
58
|
return (
|
|
59
|
-
"6.
|
|
60
|
-
new
|
|
59
|
+
"6.12.0" !== t.s && (i = 0),
|
|
60
|
+
new vi(
|
|
61
61
|
i,
|
|
62
62
|
t.e,
|
|
63
63
|
t.a,
|
|
@@ -8,34 +8,34 @@ import v from "./common/event-logger.js";
|
|
|
8
8
|
import { removeAllVisibleInAppMessages as gi } from "./InAppMessage/ui/remove-all-visible-in-app-messages.js";
|
|
9
9
|
import { STORAGE_KEYS as s } from "./managers/storage-manager.js";
|
|
10
10
|
import f from "./managers/subscription-manager.js";
|
|
11
|
-
import
|
|
11
|
+
import ve from "./models/braze-event.js";
|
|
12
12
|
import L from "./models/request-result.js";
|
|
13
|
-
import
|
|
13
|
+
import Dt from "./Push/utils/push-utils.js";
|
|
14
14
|
import { randomInclusive as a } from "./util/math.js";
|
|
15
15
|
import l from "./util/net.js";
|
|
16
16
|
import h from "./util/request-header-utils.js";
|
|
17
|
-
export default class
|
|
18
|
-
constructor(t, i, s, e, h,
|
|
19
|
-
(this.
|
|
17
|
+
export default class Zt {
|
|
18
|
+
constructor(t, i, s, e, h, o, n, r, l, u) {
|
|
19
|
+
(this.eu = t),
|
|
20
20
|
(this.baseUrl = i),
|
|
21
21
|
(this.C = s),
|
|
22
|
-
(this.
|
|
22
|
+
(this.tu = e),
|
|
23
23
|
(this.Ss = h),
|
|
24
|
-
(this.h =
|
|
25
|
-
(this.j =
|
|
24
|
+
(this.h = o),
|
|
25
|
+
(this.j = n),
|
|
26
26
|
(this.hc = r),
|
|
27
27
|
(this.Gh = l),
|
|
28
28
|
(this.B = u),
|
|
29
|
-
(this.
|
|
29
|
+
(this.eu = t),
|
|
30
30
|
(this.baseUrl = i),
|
|
31
31
|
(this.nc = 0),
|
|
32
|
-
(this.
|
|
32
|
+
(this.fS = n.bS() || 0),
|
|
33
33
|
(this.lc = null),
|
|
34
34
|
(this.C = s),
|
|
35
|
-
(this.
|
|
35
|
+
(this.tu = e),
|
|
36
36
|
(this.Ss = h),
|
|
37
|
-
(this.h =
|
|
38
|
-
(this.j =
|
|
37
|
+
(this.h = o),
|
|
38
|
+
(this.j = n),
|
|
39
39
|
(this.Gh = l),
|
|
40
40
|
(this.B = u),
|
|
41
41
|
(this.hc = r),
|
|
@@ -59,14 +59,14 @@ export default class Kt {
|
|
|
59
59
|
}
|
|
60
60
|
return i;
|
|
61
61
|
}
|
|
62
|
-
bc(t = !1, i = !0, e,
|
|
62
|
+
bc(t = !1, i = !0, e, o, n, r = !1, u = !1, c = "sdk") {
|
|
63
63
|
i && this.wc();
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
let
|
|
67
|
-
const
|
|
64
|
+
const d = this.j.gS(),
|
|
65
|
+
m = this.j.IS();
|
|
66
|
+
let f = !1;
|
|
67
|
+
const g = (t, r, u = -1) => {
|
|
68
68
|
const c = new Date().valueOf();
|
|
69
|
-
h.nt(this.j, h.it.
|
|
69
|
+
h.nt(this.j, h.it.Cn, c),
|
|
70
70
|
-1 !== u && r.push(["X-Braze-Req-Tokens-Remaining", u.toString()]);
|
|
71
71
|
let d = !1;
|
|
72
72
|
l.ot({
|
|
@@ -79,15 +79,15 @@ export default class Kt {
|
|
|
79
79
|
(this.nc = Math.max(this.nc - 1, 0)),
|
|
80
80
|
this.B.ut(t, i, r)
|
|
81
81
|
? (this.Gh.ct(),
|
|
82
|
-
this.h.
|
|
82
|
+
this.h.sd(i),
|
|
83
83
|
(null != t.respond_with &&
|
|
84
84
|
t.respond_with.user_id != this.Ss.getUserId()) ||
|
|
85
|
-
(null != t.device && this.j.Pt(s.It.
|
|
85
|
+
(null != t.device && this.j.Pt(s.It.Aa, t.device),
|
|
86
86
|
null != t.sdk_metadata &&
|
|
87
|
-
(this.j.Pt(s.It.
|
|
88
|
-
this.j.Pt(s.It.
|
|
87
|
+
(this.j.Pt(s.It.Ka, t.sdk_metadata),
|
|
88
|
+
this.j.Pt(s.It.Pa, this.C.$t())),
|
|
89
89
|
this.hc(i),
|
|
90
|
-
h.
|
|
90
|
+
h.ql(this.j, h.it.Cn, 1),
|
|
91
91
|
"function" == typeof e && e()))
|
|
92
92
|
: i.auth_error && (d = !0);
|
|
93
93
|
},
|
|
@@ -96,60 +96,60 @@ export default class Kt {
|
|
|
96
96
|
null != t.respond_with &&
|
|
97
97
|
t.respond_with.triggers &&
|
|
98
98
|
(this.nc = Math.max(this.nc - 1, 0)),
|
|
99
|
-
this.B.
|
|
100
|
-
"function" == typeof
|
|
99
|
+
this.B.Ua(t.events, t.attributes),
|
|
100
|
+
"function" == typeof o && o();
|
|
101
101
|
},
|
|
102
102
|
ft: (t, s) => {
|
|
103
|
-
"function" == typeof
|
|
104
|
-
const e = this.B.
|
|
105
|
-
let
|
|
103
|
+
"function" == typeof n && n(!d);
|
|
104
|
+
const e = this.B.Bl(s);
|
|
105
|
+
let o = 0;
|
|
106
106
|
if (e)
|
|
107
107
|
switch (e.type) {
|
|
108
108
|
case "date":
|
|
109
|
-
|
|
109
|
+
o = Math.max(e.value - new Date().valueOf(), 0);
|
|
110
110
|
break;
|
|
111
111
|
case "timestamp":
|
|
112
|
-
|
|
112
|
+
o = e.value;
|
|
113
113
|
}
|
|
114
|
-
if (i && !
|
|
114
|
+
if (i && !f) {
|
|
115
115
|
if (d) {
|
|
116
|
-
h.
|
|
116
|
+
h.Sl(this.j, h.it.Cn);
|
|
117
117
|
const t = this.h.vt(),
|
|
118
118
|
i = this.h.gt(),
|
|
119
119
|
s = this.h.bt();
|
|
120
120
|
let e = this.lc;
|
|
121
121
|
(null == e || e < t) && (e = t);
|
|
122
|
-
const
|
|
123
|
-
this.kc(
|
|
124
|
-
} else this.kc(Math.max(1e3 * this.
|
|
125
|
-
|
|
122
|
+
const n = Math.min(s, a(t, e * i)) + o;
|
|
123
|
+
this.kc(n);
|
|
124
|
+
} else this.kc(Math.max(1e3 * this.fS, o));
|
|
125
|
+
f = !0;
|
|
126
126
|
}
|
|
127
127
|
},
|
|
128
128
|
});
|
|
129
129
|
},
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
if (this.gc(r,
|
|
130
|
+
p = this.vc(d),
|
|
131
|
+
v = t || p;
|
|
132
|
+
if (this.gc(r, p))
|
|
133
133
|
return void b.info(
|
|
134
134
|
"Declining to flush data due to 50 consecutive authentication failures",
|
|
135
135
|
);
|
|
136
|
-
if (i && !this.B.
|
|
137
|
-
return this.kc(), void ("function" == typeof
|
|
138
|
-
const
|
|
139
|
-
|
|
140
|
-
let
|
|
141
|
-
if (
|
|
142
|
-
for (const t of
|
|
136
|
+
if (i && !this.B.Za(d, m, v))
|
|
137
|
+
return this.kc(), void ("function" == typeof n && n(!0));
|
|
138
|
+
const w = this.B.dl(v, d, m, u, c);
|
|
139
|
+
v && this.nc++;
|
|
140
|
+
let k = !1;
|
|
141
|
+
if (w)
|
|
142
|
+
for (const t of w)
|
|
143
143
|
this.B.et(
|
|
144
144
|
t.requestData,
|
|
145
|
-
(i) =>
|
|
146
|
-
h.it.
|
|
147
|
-
|
|
145
|
+
(i) => g(t.requestData, t.headers, i),
|
|
146
|
+
h.it.Cn,
|
|
147
|
+
o,
|
|
148
148
|
),
|
|
149
|
-
(
|
|
150
|
-
this.Gh.Fh() && i && !
|
|
149
|
+
(k = !0);
|
|
150
|
+
this.Gh.Fh() && i && !k
|
|
151
151
|
? this.kc()
|
|
152
|
-
:
|
|
152
|
+
: p &&
|
|
153
153
|
(b.info("Invoking new session subscriptions"),
|
|
154
154
|
this.uc.A(),
|
|
155
155
|
(this.fc = !0));
|
|
@@ -157,7 +157,7 @@ export default class Kt {
|
|
|
157
157
|
yc() {
|
|
158
158
|
return this.nc > 0;
|
|
159
159
|
}
|
|
160
|
-
kc(t = 1e3 * this.
|
|
160
|
+
kc(t = 1e3 * this.fS) {
|
|
161
161
|
this.mc ||
|
|
162
162
|
(this.wc(),
|
|
163
163
|
(this.cc = window.setTimeout(() => {
|
|
@@ -193,9 +193,9 @@ export default class Kt {
|
|
|
193
193
|
}
|
|
194
194
|
openSession() {
|
|
195
195
|
const t = this.C.$t() !== this.C.el();
|
|
196
|
-
t && (this.j.
|
|
196
|
+
t && (this.j.hS(s.Ou.Wh), this.j.hS(s.Ou.Cu)),
|
|
197
197
|
this.bc(!1, void 0, () => {
|
|
198
|
-
t && (this.j.Vt(s.It.
|
|
198
|
+
t && (this.j.Vt(s.It.Zr), this.j.Vt(s.It.At));
|
|
199
199
|
}),
|
|
200
200
|
this.Ea(),
|
|
201
201
|
t &&
|
|
@@ -204,10 +204,10 @@ export default class Kt {
|
|
|
204
204
|
const i = t.default.ra();
|
|
205
205
|
if (
|
|
206
206
|
null != i &&
|
|
207
|
-
(
|
|
207
|
+
(Dt.isPushPermissionGranted() || Dt.isPushBlocked())
|
|
208
208
|
) {
|
|
209
209
|
const t = () => {
|
|
210
|
-
i.
|
|
210
|
+
i.lu()
|
|
211
211
|
? b.info(
|
|
212
212
|
"Push token maintenance is disabled, not refreshing token for backend.",
|
|
213
213
|
)
|
|
@@ -217,22 +217,22 @@ export default class Kt {
|
|
|
217
217
|
s && t();
|
|
218
218
|
},
|
|
219
219
|
h = () => {
|
|
220
|
-
const i = this.j.St(s.It.
|
|
220
|
+
const i = this.j.St(s.It.xu);
|
|
221
221
|
(null == i || i) && t();
|
|
222
222
|
},
|
|
223
|
-
|
|
224
|
-
new et(
|
|
223
|
+
o = et._s.Xs;
|
|
224
|
+
new et(o, b).kr(o.Ws.Gu, e, h);
|
|
225
225
|
}
|
|
226
226
|
});
|
|
227
227
|
}
|
|
228
228
|
jc() {
|
|
229
|
-
this.j.Vt(s.It.
|
|
229
|
+
this.j.Vt(s.It.Vr), this.j.Vt(s.It.bi), this.j.Vt(s.It.la);
|
|
230
230
|
}
|
|
231
231
|
Sc() {
|
|
232
|
-
this.j.Vt(s.It.
|
|
233
|
-
this.j.Vt(s.It.
|
|
234
|
-
this.j.Vt(s.It.
|
|
235
|
-
this.j.Vt(s.It.
|
|
232
|
+
this.j.Vt(s.It.wl),
|
|
233
|
+
this.j.Vt(s.It.lS),
|
|
234
|
+
this.j.Vt(s.It.zl),
|
|
235
|
+
this.j.Vt(s.It.Xl);
|
|
236
236
|
}
|
|
237
237
|
changeUser(t, i, e) {
|
|
238
238
|
const h = this.Ss.getUserId();
|
|
@@ -241,13 +241,13 @@ export default class Kt {
|
|
|
241
241
|
this.jc(),
|
|
242
242
|
gi(),
|
|
243
243
|
null != h && this.bc(void 0, !1, void 0, void 0, void 0),
|
|
244
|
-
this.Ss.
|
|
244
|
+
this.Ss.Lu(t),
|
|
245
245
|
e ? this.Gh.setSdkAuthenticationSignature(e) : this.Gh.jh();
|
|
246
246
|
for (let t = 0; t < i.length; t++) i[t].changeUser(null == h);
|
|
247
247
|
this.B.fo(),
|
|
248
|
-
null != h && this.j.Vt(s.It.
|
|
249
|
-
this.j.Vt(s.It.
|
|
250
|
-
this.j.Vt(s.It.
|
|
248
|
+
null != h && this.j.Vt(s.It.rS),
|
|
249
|
+
this.j.Vt(s.It.Aa),
|
|
250
|
+
this.j.Vt(s.It.uS),
|
|
251
251
|
this.Sc(),
|
|
252
252
|
this.openSession(),
|
|
253
253
|
b.info('Changed user to "' + t + '".');
|
|
@@ -273,22 +273,22 @@ export default class Kt {
|
|
|
273
273
|
!0,
|
|
274
274
|
);
|
|
275
275
|
}
|
|
276
|
-
Ar(t, i) {
|
|
276
|
+
Ar(t, i, s = "sdk") {
|
|
277
277
|
this.C.el(),
|
|
278
278
|
b.info("Requesting explicit trigger refresh."),
|
|
279
|
-
this.bc(!0, void 0, t, i);
|
|
279
|
+
this.bc(!0, void 0, t, i, void 0, void 0, void 0, s);
|
|
280
280
|
}
|
|
281
|
-
|
|
281
|
+
Hu(t, i) {
|
|
282
282
|
const e = p.Ac,
|
|
283
283
|
h = { a: t, l: i },
|
|
284
|
-
|
|
284
|
+
o = v.Dt(e, h);
|
|
285
285
|
return (
|
|
286
|
-
|
|
287
|
-
|
|
286
|
+
o && (b.info(`Logged alias ${t} with label ${i}`), this.j.Pt(s.It.uS, h)),
|
|
287
|
+
o
|
|
288
288
|
);
|
|
289
289
|
}
|
|
290
|
-
|
|
291
|
-
if (this.h.
|
|
290
|
+
Yu(t, i, s) {
|
|
291
|
+
if (this.h.zu(i))
|
|
292
292
|
return (
|
|
293
293
|
b.info(`Custom Attribute "${i}" is blocklisted, ignoring.`), new L()
|
|
294
294
|
);
|
|
@@ -300,44 +300,44 @@ export default class Kt {
|
|
|
300
300
|
}
|
|
301
301
|
return h;
|
|
302
302
|
}
|
|
303
|
-
setLastKnownLocation(t, i, s, e, h,
|
|
304
|
-
const
|
|
305
|
-
null != e && (
|
|
306
|
-
null != h && (
|
|
307
|
-
null !=
|
|
308
|
-
const r = v.Dt(p.Dc,
|
|
303
|
+
setLastKnownLocation(t, i, s, e, h, o) {
|
|
304
|
+
const n = { latitude: i, longitude: s };
|
|
305
|
+
null != e && (n.altitude = e),
|
|
306
|
+
null != h && (n.ll_accuracy = h),
|
|
307
|
+
null != o && (n.alt_accuracy = o);
|
|
308
|
+
const r = v.Dt(p.Dc, n, t || void 0);
|
|
309
309
|
return (
|
|
310
310
|
r &&
|
|
311
|
-
b.info(`Set user last known location as ${JSON.stringify(
|
|
311
|
+
b.info(`Set user last known location as ${JSON.stringify(n, null, 2)}`),
|
|
312
312
|
r
|
|
313
313
|
);
|
|
314
314
|
}
|
|
315
315
|
Fr(t, i) {
|
|
316
316
|
const s = this.C.el();
|
|
317
|
-
return new
|
|
317
|
+
return new ve(this.Ss.getUserId(), p.$c, t, s, { cid: i });
|
|
318
318
|
}
|
|
319
319
|
qc(t, i) {
|
|
320
320
|
return new et(t, i);
|
|
321
321
|
}
|
|
322
322
|
Ea() {
|
|
323
323
|
const t = et._s.Xs;
|
|
324
|
-
this.qc(t, b).setItem(t.Ws.
|
|
324
|
+
this.qc(t, b).setItem(t.Ws.Cn, 1, {
|
|
325
325
|
baseUrl: this.baseUrl,
|
|
326
|
-
data: { api_key: this.
|
|
326
|
+
data: { api_key: this.eu, device_id: this.tu.ve().id },
|
|
327
327
|
userId: this.Ss.getUserId(),
|
|
328
328
|
sdkAuthEnabled: this.Gh.Fh(),
|
|
329
329
|
});
|
|
330
330
|
}
|
|
331
331
|
Dr(t) {
|
|
332
332
|
for (const i of t)
|
|
333
|
-
if (i.api_key === this.
|
|
333
|
+
if (i.api_key === this.eu) this.B.Ua(i.events, i.attributes);
|
|
334
334
|
else {
|
|
335
335
|
const t = et._s.Xs;
|
|
336
336
|
new et(t, b).setItem(t.Ws.Br, V.de(), i);
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
|
-
|
|
340
|
-
if (this.h.
|
|
339
|
+
ya(t, i, s) {
|
|
340
|
+
if (this.h.zu(t))
|
|
341
341
|
return (
|
|
342
342
|
b.info(`Custom Attribute "${t}" is blocklisted, ignoring.`), new L()
|
|
343
343
|
);
|
|
@@ -7,61 +7,61 @@ import {
|
|
|
7
7
|
} from "../../util/date-utils.js";
|
|
8
8
|
export default class hr {
|
|
9
9
|
constructor(t, s, e, i) {
|
|
10
|
-
(this.
|
|
11
|
-
(this.
|
|
10
|
+
(this.zE = t),
|
|
11
|
+
(this.kE = s),
|
|
12
12
|
(this.comparator = e),
|
|
13
|
-
(this.
|
|
14
|
-
(this.
|
|
15
|
-
(this.
|
|
13
|
+
(this.vE = i),
|
|
14
|
+
(this.zE = t),
|
|
15
|
+
(this.kE = s),
|
|
16
16
|
(this.comparator = e),
|
|
17
|
-
(this.
|
|
18
|
-
this.
|
|
19
|
-
this.comparator !== hr.
|
|
20
|
-
this.comparator !== hr.
|
|
21
|
-
this.comparator !== hr.
|
|
22
|
-
this.comparator !== hr.
|
|
23
|
-
(this.
|
|
17
|
+
(this.vE = i),
|
|
18
|
+
this.kE === hr.VE.JE &&
|
|
19
|
+
this.comparator !== hr.ZE.qE &&
|
|
20
|
+
this.comparator !== hr.ZE.$E &&
|
|
21
|
+
this.comparator !== hr.ZE.tT &&
|
|
22
|
+
this.comparator !== hr.ZE.sT &&
|
|
23
|
+
(this.vE = Y(this.vE));
|
|
24
24
|
}
|
|
25
25
|
zc(t) {
|
|
26
26
|
let s = null;
|
|
27
|
-
switch ((null != t && (s = t[this.
|
|
28
|
-
case hr.
|
|
29
|
-
return null != s && s.valueOf() === this.
|
|
30
|
-
case hr.
|
|
31
|
-
return null == s || s.valueOf() !== this.
|
|
32
|
-
case hr.
|
|
33
|
-
return null != s && typeof s == typeof this.
|
|
34
|
-
case hr.
|
|
35
|
-
return this.
|
|
36
|
-
? null != s && Nt(s) && hs(s) <= this.
|
|
37
|
-
: null != s && typeof s == typeof this.
|
|
38
|
-
case hr.
|
|
39
|
-
return null != s && typeof s == typeof this.
|
|
40
|
-
case hr.
|
|
41
|
-
return this.
|
|
42
|
-
? null != s && Nt(s) && hs(s) >= this.
|
|
43
|
-
: null != s && typeof s == typeof this.
|
|
44
|
-
case hr.hT
|
|
27
|
+
switch ((null != t && (s = t[this.zE]), this.comparator)) {
|
|
28
|
+
case hr.ZE.eT:
|
|
29
|
+
return null != s && s.valueOf() === this.vE.valueOf();
|
|
30
|
+
case hr.ZE.iT:
|
|
31
|
+
return null == s || s.valueOf() !== this.vE.valueOf();
|
|
32
|
+
case hr.ZE.lT:
|
|
33
|
+
return null != s && typeof s == typeof this.vE && s > this.vE;
|
|
34
|
+
case hr.ZE.qE:
|
|
35
|
+
return this.kE === hr.VE.JE
|
|
36
|
+
? null != s && Nt(s) && hs(s) <= this.vE.valueOf()
|
|
37
|
+
: null != s && typeof s == typeof this.vE && s >= this.vE;
|
|
38
|
+
case hr.ZE.rT:
|
|
39
|
+
return null != s && typeof s == typeof this.vE && s < this.vE;
|
|
40
|
+
case hr.ZE.$E:
|
|
41
|
+
return this.kE === hr.VE.JE
|
|
42
|
+
? null != s && Nt(s) && hs(s) >= this.vE.valueOf()
|
|
43
|
+
: null != s && typeof s == typeof this.vE && s <= this.vE;
|
|
44
|
+
case hr.ZE.hT:
|
|
45
45
|
return (
|
|
46
46
|
null != s &&
|
|
47
47
|
"string" == typeof s &&
|
|
48
|
-
typeof s == typeof this.
|
|
49
|
-
null != s.match(this.
|
|
48
|
+
typeof s == typeof this.vE &&
|
|
49
|
+
null != s.match(this.vE)
|
|
50
50
|
);
|
|
51
|
-
case hr.
|
|
51
|
+
case hr.ZE.nT:
|
|
52
52
|
return null != s;
|
|
53
|
-
case hr.
|
|
53
|
+
case hr.ZE.uT:
|
|
54
54
|
return null == s;
|
|
55
|
-
case hr.
|
|
56
|
-
return null != s && Nt(s) && us(s) < this.
|
|
57
|
-
case hr.
|
|
58
|
-
return null != s && Nt(s) && us(s) > this.
|
|
59
|
-
case hr.
|
|
55
|
+
case hr.ZE.tT:
|
|
56
|
+
return null != s && Nt(s) && us(s) < this.vE;
|
|
57
|
+
case hr.ZE.sT:
|
|
58
|
+
return null != s && Nt(s) && us(s) > this.vE;
|
|
59
|
+
case hr.ZE.oT:
|
|
60
60
|
return (
|
|
61
61
|
null == s ||
|
|
62
|
-
typeof s != typeof this.
|
|
62
|
+
typeof s != typeof this.vE ||
|
|
63
63
|
"string" != typeof s ||
|
|
64
|
-
null == s.match(this.
|
|
64
|
+
null == s.match(this.vE)
|
|
65
65
|
);
|
|
66
66
|
}
|
|
67
67
|
return !1;
|
|
@@ -75,28 +75,28 @@ export default class hr {
|
|
|
75
75
|
);
|
|
76
76
|
}
|
|
77
77
|
qt() {
|
|
78
|
-
let t = this.
|
|
78
|
+
let t = this.vE;
|
|
79
79
|
return (
|
|
80
|
-
Nt(this.
|
|
81
|
-
{ k: this.
|
|
80
|
+
Nt(this.vE) && (t = X(t.valueOf())),
|
|
81
|
+
{ k: this.zE, t: this.kE, c: this.comparator, v: t }
|
|
82
82
|
);
|
|
83
83
|
}
|
|
84
84
|
static _u(t) {
|
|
85
85
|
return new hr(t.k, t.t, t.c, t.v);
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
(hr.
|
|
89
|
-
(hr.
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
88
|
+
(hr.VE = { ET: "boolean", aT: "number", TT: "string", JE: "date" }),
|
|
89
|
+
(hr.ZE = {
|
|
90
|
+
eT: 1,
|
|
91
|
+
iT: 2,
|
|
92
|
+
lT: 3,
|
|
93
|
+
qE: 4,
|
|
94
|
+
rT: 5,
|
|
95
|
+
$E: 6,
|
|
96
|
+
hT: 10,
|
|
97
|
+
nT: 11,
|
|
98
|
+
uT: 12,
|
|
99
|
+
tT: 15,
|
|
100
|
+
sT: 16,
|
|
101
|
+
oT: 17,
|
|
102
102
|
});
|