@braze/web-sdk 5.8.1 → 5.9.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 -9
- package/package.json +1 -1
- package/shared-lib/encoding-utils.js +1 -1
- package/shared-lib/event-types.js +19 -19
- package/shared-lib/guid.js +2 -2
- package/shared-lib/indexed-db-adapter.js +3 -3
- package/shared-lib/logger.js +2 -2
- package/shared-lib/supported-options.js +11 -11
- package/src/Banner/banner-provider.js +22 -19
- package/src/Banner/display/banner-to-html.js +32 -27
- package/src/Banner/get-all-banners.js +11 -5
- package/src/Banner/get-banner.js +6 -3
- package/src/Banner/log-banner-click.js +2 -2
- package/src/Banner/log-banner-impressions.js +4 -4
- package/src/Banner/request-banners-refresh.js +5 -2
- package/src/Banner/subscribe-to-banners-updates.js +2 -2
- package/src/Banner/ui/insert-banner.js +2 -2
- package/src/Card/card-manager.js +9 -9
- package/src/Card/display/card-display.js +5 -5
- package/src/Card/log-card-click.js +2 -2
- package/src/Card/log-card-dismissal.js +2 -2
- package/src/Card/log-card-impressions.js +2 -2
- package/src/Card/models/captioned-image.js +17 -17
- package/src/Card/models/card.js +58 -58
- package/src/Card/models/classic-card.js +17 -17
- package/src/Card/models/control-card.js +8 -8
- package/src/Card/models/image-only.js +15 -15
- package/src/Card/util/card-factory.js +24 -24
- package/src/ContentCards/content-cards-provider.js +77 -75
- 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 +3 -3
- package/src/ContentCards/ui/show-content-cards.js +3 -3
- package/src/Core/change-user.js +1 -1
- package/src/Core/disable-sdk.js +4 -4
- package/src/Core/enable-sdk.js +3 -3
- package/src/Core/handle-braze-action.js +2 -2
- package/src/Core/is-initialized.js +1 -1
- package/src/Core/open-session.js +4 -4
- package/src/Core/request-immediate-data-flush.js +1 -1
- package/src/Core/wipe-data.js +7 -5
- package/src/FeatureFlags/feature-flag-factory.js +4 -4
- package/src/FeatureFlags/feature-flag.js +3 -3
- package/src/FeatureFlags/feature-flags-provider.js +17 -11
- 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 +1 -1
- package/src/Feed/feed-provider-factory.js +1 -1
- package/src/Feed/feed-provider.js +12 -12
- package/src/Feed/get-cached-feed.js +1 -1
- package/src/Feed/request-feed-refresh.js +1 -1
- package/src/Feed/ui/show-feed.js +1 -1
- package/src/InAppMessage/display/html-message-to-html.js +8 -8
- package/src/InAppMessage/display/in-app-message-to-html.js +18 -18
- package/src/InAppMessage/display/modal-utils.js +7 -7
- package/src/InAppMessage/in-app-message-factory.js +6 -6
- package/src/InAppMessage/in-app-message-manager.js +70 -70
- 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 +2 -2
- package/src/InAppMessage/models/full-screen-message.js +6 -6
- package/src/InAppMessage/models/html-message.js +7 -7
- package/src/InAppMessage/models/in-app-message-button.js +3 -3
- package/src/InAppMessage/models/in-app-message.js +36 -36
- package/src/InAppMessage/models/modal-message.js +6 -6
- package/src/InAppMessage/models/slide-up-message.js +8 -8
- package/src/InAppMessage/models/templated-in-app-message.js +8 -8
- package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
- package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
- package/src/InAppMessage/ui/show-in-app-message.js +13 -13
- package/src/Push/push-manager.js +81 -81
- package/src/Push/request-push-permission.js +1 -1
- package/src/Push/utils/push-utils.js +4 -4
- package/src/User/user-manager.js +10 -10
- package/src/User/user.js +15 -15
- package/src/common/constants.js +2 -0
- package/src/common/event-logger.js +2 -2
- package/src/common/feed-display.js +6 -6
- package/src/l10n/l10n-manager-factory.js +1 -1
- package/src/managers/auth-manager.js +30 -30
- package/src/managers/braze-instance.js +94 -93
- package/src/managers/device-manager.js +14 -14
- package/src/managers/network-manager.js +123 -117
- package/src/managers/server-config-manager.js +91 -79
- package/src/managers/session-manager.js +8 -8
- package/src/managers/storage-manager-factory.js +5 -5
- package/src/managers/storage-manager.js +48 -48
- package/src/managers/subscription-manager.js +4 -4
- package/src/models/backend-errors.js +4 -4
- package/src/models/braze-event.js +9 -9
- package/src/models/device.js +2 -2
- package/src/models/identifier.js +3 -3
- package/src/models/push-token.js +4 -4
- package/src/models/request-result.js +2 -2
- package/src/models/server-config.js +18 -18
- package/src/request-controller.js +86 -85
- package/src/triggers/models/custom-event-data.js +1 -1
- package/src/triggers/models/custom-event-property-data.js +2 -2
- package/src/triggers/models/filter-set.js +4 -4
- 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 +1 -1
- package/src/triggers/models/purchase-property-data.js +2 -2
- package/src/triggers/models/push-click-data.js +1 -1
- package/src/triggers/models/trigger-condition.js +33 -33
- package/src/triggers/models/trigger-events.js +2 -2
- package/src/triggers/models/trigger.js +12 -12
- package/src/triggers/triggers-provider-factory.js +3 -3
- package/src/triggers/triggers-provider.js +17 -17
- package/src/ui/js/attach-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 +5 -5
- 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 +14 -14
- package/src/util/key-codes.js +1 -1
- package/src/util/net.js +2 -2
- package/src/util/request-header-utils.js +13 -13
- package/src/util/user-agent-parser.js +1 -1
- package/src/util/validation-utils.js +2 -2
- package/src/util/window-utils.js +2 -2
package/src/models/identifier.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Guid as
|
|
1
|
+
import { Guid as K, logger as N } from "../../shared-lib/index.js";
|
|
2
2
|
import { isArray as z } from "../util/code-utils.js";
|
|
3
3
|
import { getErrorMessage as si } from "../util/error-utils.js";
|
|
4
4
|
export default class _t {
|
|
5
5
|
constructor(t, e, i) {
|
|
6
6
|
(this.eu = t),
|
|
7
|
-
null == t && (t =
|
|
7
|
+
null == t && (t = K.ce()),
|
|
8
8
|
!i || isNaN(i) ? (this.Gl = new Date().valueOf()) : (this.Gl = i),
|
|
9
9
|
(this.eu = t),
|
|
10
10
|
(this.ql = new Date().valueOf()),
|
|
@@ -26,7 +26,7 @@ export default class _t {
|
|
|
26
26
|
(t = t.replace(i, `g:${n}`))
|
|
27
27
|
);
|
|
28
28
|
}
|
|
29
|
-
static
|
|
29
|
+
static Rn(t) {
|
|
30
30
|
let e;
|
|
31
31
|
if ("string" == typeof t)
|
|
32
32
|
try {
|
package/src/models/push-token.js
CHANGED
|
@@ -2,12 +2,12 @@ import { rehydrateDateAfterJsonization as V } from "../util/date-utils.js";
|
|
|
2
2
|
export default class ti {
|
|
3
3
|
constructor(t, i, s, l, h) {
|
|
4
4
|
(this.endpoint = t),
|
|
5
|
-
(this.
|
|
5
|
+
(this.En = i),
|
|
6
6
|
(this.publicKey = s),
|
|
7
7
|
(this.Vl = l),
|
|
8
8
|
(this.fl = h),
|
|
9
9
|
(this.endpoint = t || null),
|
|
10
|
-
(this.
|
|
10
|
+
(this.En = i || null),
|
|
11
11
|
(this.publicKey = s || null),
|
|
12
12
|
(this.Vl = l || null),
|
|
13
13
|
(this.fl = h || null);
|
|
@@ -15,13 +15,13 @@ export default class ti {
|
|
|
15
15
|
bt() {
|
|
16
16
|
return {
|
|
17
17
|
e: this.endpoint,
|
|
18
|
-
c: this.
|
|
18
|
+
c: this.En,
|
|
19
19
|
p: this.publicKey,
|
|
20
20
|
u: this.Vl,
|
|
21
21
|
v: this.fl,
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
static
|
|
24
|
+
static Rn(t) {
|
|
25
25
|
return new ti(t.e, V(t.c), t.p, t.u, t.v);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -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 hi,
|
|
3
|
+
GLOBAL_RATE_LIMIT_REFILL_RATE_DEFAULT as li,
|
|
4
4
|
} from "../common/constants.js";
|
|
5
|
-
export default class
|
|
5
|
+
export default class Qt {
|
|
6
6
|
constructor(
|
|
7
7
|
t = 0,
|
|
8
8
|
i = [],
|
|
@@ -12,50 +12,50 @@ export default class Jt {
|
|
|
12
12
|
l = null,
|
|
13
13
|
r = { enabled: !1 },
|
|
14
14
|
a = { enabled: !1, refresh_rate_limit: void 0 },
|
|
15
|
-
n = { enabled: !0, capacity:
|
|
16
|
-
o =
|
|
15
|
+
n = { enabled: !0, capacity: hi, refill_rate: li, endpoint_overrides: {} },
|
|
16
|
+
o = null,
|
|
17
17
|
) {
|
|
18
|
-
(this.
|
|
18
|
+
(this.dl = t),
|
|
19
19
|
(this.Rl = i),
|
|
20
20
|
(this.Cl = s),
|
|
21
21
|
(this.El = h),
|
|
22
|
-
(this.
|
|
22
|
+
(this.yl = e),
|
|
23
23
|
(this.fl = l),
|
|
24
|
-
(this.
|
|
24
|
+
(this.vl = r),
|
|
25
25
|
(this.De = a),
|
|
26
26
|
(this.bl = n),
|
|
27
27
|
(this.banners = o),
|
|
28
|
-
(this.
|
|
28
|
+
(this.dl = t),
|
|
29
29
|
(this.Rl = i),
|
|
30
30
|
(this.Cl = s),
|
|
31
31
|
(this.El = h),
|
|
32
|
-
(this.
|
|
32
|
+
(this.yl = e),
|
|
33
33
|
(this.fl = l),
|
|
34
|
-
(this.
|
|
34
|
+
(this.vl = r),
|
|
35
35
|
(this.De = a),
|
|
36
36
|
(this.bl = n),
|
|
37
37
|
(this.banners = o);
|
|
38
38
|
}
|
|
39
39
|
bt() {
|
|
40
40
|
return {
|
|
41
|
-
s: "5.
|
|
42
|
-
l: this.
|
|
41
|
+
s: "5.9.0",
|
|
42
|
+
l: this.dl,
|
|
43
43
|
e: this.Rl,
|
|
44
44
|
a: this.Cl,
|
|
45
45
|
p: this.El,
|
|
46
|
-
m: this.
|
|
46
|
+
m: this.yl,
|
|
47
47
|
v: this.fl,
|
|
48
|
-
c: this.
|
|
48
|
+
c: this.vl,
|
|
49
49
|
f: this.De,
|
|
50
50
|
grl: this.bl,
|
|
51
51
|
b: this.banners,
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
|
-
static
|
|
54
|
+
static Rn(t) {
|
|
55
55
|
let i = t.l;
|
|
56
56
|
return (
|
|
57
|
-
"5.
|
|
58
|
-
new
|
|
57
|
+
"5.9.0" !== t.s && (i = 0),
|
|
58
|
+
new Qt(i, t.e, t.a, t.p, t.m, t.v, t.c, t.f, t.grl, t.b)
|
|
59
59
|
);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
@@ -2,11 +2,11 @@ import l from "./util/net.js";
|
|
|
2
2
|
import ve from "./models/braze-event.js";
|
|
3
3
|
import c from "./common/event-logger.js";
|
|
4
4
|
import { randomInclusive as a } from "./util/math.js";
|
|
5
|
-
import
|
|
5
|
+
import F from "./models/request-result.js";
|
|
6
6
|
import {
|
|
7
7
|
logger as N,
|
|
8
|
-
IndexedDBAdapter as
|
|
9
|
-
Guid as
|
|
8
|
+
IndexedDBAdapter as st,
|
|
9
|
+
Guid as K,
|
|
10
10
|
EventTypes as d,
|
|
11
11
|
} from "../shared-lib/index.js";
|
|
12
12
|
import { STORAGE_KEYS as s } from "./managers/storage-manager.js";
|
|
@@ -15,27 +15,27 @@ import vt from "./Push/utils/push-utils.js";
|
|
|
15
15
|
import h from "./util/request-header-utils.js";
|
|
16
16
|
export default class Lt {
|
|
17
17
|
constructor(t, i, s, e, h, o, n, r, l, a) {
|
|
18
|
-
(this.
|
|
18
|
+
(this.an = t),
|
|
19
19
|
(this.baseUrl = i),
|
|
20
20
|
(this.T = s),
|
|
21
|
-
(this.
|
|
21
|
+
(this.hn = e),
|
|
22
22
|
(this.Cs = h),
|
|
23
23
|
(this.B = o),
|
|
24
24
|
(this.C = n),
|
|
25
25
|
(this.$l = r),
|
|
26
|
-
(this.
|
|
26
|
+
(this.Pa = l),
|
|
27
27
|
(this.S = a),
|
|
28
|
-
(this.
|
|
28
|
+
(this.an = t),
|
|
29
29
|
(this.baseUrl = i),
|
|
30
30
|
(this.Tl = 0),
|
|
31
31
|
(this.dE = n.IE() || 0),
|
|
32
32
|
(this.Ml = null),
|
|
33
33
|
(this.T = s),
|
|
34
|
-
(this.
|
|
34
|
+
(this.hn = e),
|
|
35
35
|
(this.Cs = h),
|
|
36
36
|
(this.B = o),
|
|
37
37
|
(this.C = n),
|
|
38
|
-
(this.
|
|
38
|
+
(this.Pa = l),
|
|
39
39
|
(this.S = a),
|
|
40
40
|
(this.$l = r),
|
|
41
41
|
(this.Pl = new u()),
|
|
@@ -43,22 +43,22 @@ export default class Lt {
|
|
|
43
43
|
(this.Ul = 50),
|
|
44
44
|
(this._l = !1);
|
|
45
45
|
}
|
|
46
|
-
|
|
47
|
-
return !t && !i && this.
|
|
46
|
+
Kl(t, i) {
|
|
47
|
+
return !t && !i && this.Pa.Kh() >= this.Ul;
|
|
48
48
|
}
|
|
49
|
-
|
|
49
|
+
Xl(t) {
|
|
50
50
|
let i = this.T.zl();
|
|
51
51
|
if (t.length > 0) {
|
|
52
52
|
const s = this.Cs.getUserId();
|
|
53
53
|
for (const e of t) {
|
|
54
54
|
const t = (!e.userId && !s) || e.userId === s;
|
|
55
|
-
e.type === d.
|
|
55
|
+
e.type === d.Fl && t && (i = !0);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
return i;
|
|
59
59
|
}
|
|
60
|
-
|
|
61
|
-
e && this.
|
|
60
|
+
Ql(t = !1, i = !1, e = !0, o, n, r, u = !1, c = !1) {
|
|
61
|
+
e && this.Yl();
|
|
62
62
|
const d = this.C.AE(),
|
|
63
63
|
m = this.C.OE();
|
|
64
64
|
let f = !1;
|
|
@@ -76,16 +76,16 @@ export default class Lt {
|
|
|
76
76
|
t.respond_with.triggers &&
|
|
77
77
|
(this.Tl = Math.max(this.Tl - 1, 0)),
|
|
78
78
|
this.S.st(t, e, i)
|
|
79
|
-
? (this.
|
|
79
|
+
? (this.Pa.it(),
|
|
80
80
|
this.B.gl(e),
|
|
81
81
|
(null != t.respond_with &&
|
|
82
82
|
t.respond_with.user_id != this.Cs.getUserId()) ||
|
|
83
|
-
(null != t.device && this.C.Bt(s.gt.
|
|
83
|
+
(null != t.device && this.C.Bt(s.gt.oc, t.device),
|
|
84
84
|
null != t.sdk_metadata &&
|
|
85
|
-
(this.C.Bt(s.gt.
|
|
86
|
-
this.C.Bt(s.gt.
|
|
85
|
+
(this.C.Bt(s.gt.pu, t.sdk_metadata),
|
|
86
|
+
this.C.Bt(s.gt.Ru, this.T.St())),
|
|
87
87
|
this.$l(e),
|
|
88
|
-
h.
|
|
88
|
+
h.Mu(this.C, h.O.Nu, 1),
|
|
89
89
|
"function" == typeof o && o()))
|
|
90
90
|
: e.auth_error && (d = !0);
|
|
91
91
|
},
|
|
@@ -94,12 +94,12 @@ export default class Lt {
|
|
|
94
94
|
null != t.respond_with &&
|
|
95
95
|
t.respond_with.triggers &&
|
|
96
96
|
(this.Tl = Math.max(this.Tl - 1, 0)),
|
|
97
|
-
this.S.
|
|
97
|
+
this.S.gu(t.events, t.attributes),
|
|
98
98
|
"function" == typeof n && n();
|
|
99
99
|
},
|
|
100
100
|
nt: (t, i) => {
|
|
101
101
|
"function" == typeof r && r(!d);
|
|
102
|
-
const s = this.S.
|
|
102
|
+
const s = this.S.Pu(i);
|
|
103
103
|
let o = 0;
|
|
104
104
|
if (s)
|
|
105
105
|
switch (s.type) {
|
|
@@ -111,26 +111,26 @@ export default class Lt {
|
|
|
111
111
|
}
|
|
112
112
|
if (e && !f) {
|
|
113
113
|
if (d) {
|
|
114
|
-
h.
|
|
114
|
+
h.Uu(this.C, h.O.Nu);
|
|
115
115
|
let t = this.Ml;
|
|
116
116
|
(null == t || t < 1e3 * this.dE) && (t = 1e3 * this.dE);
|
|
117
117
|
const i = Math.min(3e5, a(1e3 * this.dE, 3 * t)) + o;
|
|
118
|
-
this.
|
|
119
|
-
} else this.
|
|
118
|
+
this.Zl(i);
|
|
119
|
+
} else this.Zl(Math.max(1e3 * this.dE, o));
|
|
120
120
|
f = !0;
|
|
121
121
|
}
|
|
122
122
|
},
|
|
123
123
|
});
|
|
124
124
|
},
|
|
125
|
-
p = this.
|
|
125
|
+
p = this.Xl(d),
|
|
126
126
|
v = i || p;
|
|
127
|
-
if (this.
|
|
127
|
+
if (this.Kl(u, p))
|
|
128
128
|
return void N.info(
|
|
129
129
|
"Declining to flush data due to 50 consecutive authentication failures",
|
|
130
130
|
);
|
|
131
|
-
if (e && !this.S.
|
|
132
|
-
return this.
|
|
133
|
-
const b = this.S.
|
|
131
|
+
if (e && !this.S.yu(d, m, t, v))
|
|
132
|
+
return this.Zl(), void ("function" == typeof r && r(!0));
|
|
133
|
+
const b = this.S.wu(t, v, d, m, c);
|
|
134
134
|
v && this.Tl++;
|
|
135
135
|
let w = !1;
|
|
136
136
|
if (b)
|
|
@@ -142,52 +142,52 @@ export default class Lt {
|
|
|
142
142
|
n,
|
|
143
143
|
),
|
|
144
144
|
(w = !0);
|
|
145
|
-
this.
|
|
146
|
-
? this.
|
|
145
|
+
this.Pa.jh() && e && !w
|
|
146
|
+
? this.Zl()
|
|
147
147
|
: p && (N.info("Invoking new session subscriptions"), this.Pl.X());
|
|
148
148
|
}
|
|
149
|
-
|
|
149
|
+
dc() {
|
|
150
150
|
return this.Tl > 0;
|
|
151
151
|
}
|
|
152
|
-
|
|
152
|
+
Zl(t = 1e3 * this.dE) {
|
|
153
153
|
this._l ||
|
|
154
|
-
(this.
|
|
154
|
+
(this.Yl(),
|
|
155
155
|
(this.Ol = window.setTimeout(() => {
|
|
156
156
|
if (document.hidden) {
|
|
157
157
|
const t = "visibilitychange",
|
|
158
158
|
i = () => {
|
|
159
159
|
document.hidden ||
|
|
160
|
-
(document.removeEventListener(t, i, !1), this.
|
|
160
|
+
(document.removeEventListener(t, i, !1), this.Ql());
|
|
161
161
|
};
|
|
162
162
|
document.addEventListener(t, i, !1);
|
|
163
|
-
} else this.
|
|
163
|
+
} else this.Ql();
|
|
164
164
|
}, t)),
|
|
165
165
|
(this.Ml = t));
|
|
166
166
|
}
|
|
167
|
-
|
|
167
|
+
Yl() {
|
|
168
168
|
null != this.Ol && (clearTimeout(this.Ol), (this.Ol = null));
|
|
169
169
|
}
|
|
170
170
|
initialize() {
|
|
171
|
-
(this._l = !1), this.
|
|
171
|
+
(this._l = !1), this.Zl();
|
|
172
172
|
}
|
|
173
173
|
destroy() {
|
|
174
174
|
this.Pl.removeAllSubscriptions(),
|
|
175
|
-
this.
|
|
176
|
-
this.
|
|
175
|
+
this.Pa.Hh(),
|
|
176
|
+
this.Yl(),
|
|
177
177
|
(this._l = !0),
|
|
178
|
-
this.
|
|
178
|
+
this.Ql(void 0, void 0, !1, void 0, void 0, void 0, void 0, !0),
|
|
179
179
|
(this.Ol = null);
|
|
180
180
|
}
|
|
181
|
-
|
|
182
|
-
return this.Pl.
|
|
181
|
+
on(t) {
|
|
182
|
+
return this.Pl.Dt(t);
|
|
183
183
|
}
|
|
184
184
|
openSession() {
|
|
185
185
|
const t = this.T.St() !== this.T.Qo();
|
|
186
|
-
t && (this.C.TE(s.iu.
|
|
187
|
-
this.
|
|
186
|
+
t && (this.C.TE(s.iu.Na), this.C.TE(s.iu.su)),
|
|
187
|
+
this.Ql(void 0, !1, void 0, () => {
|
|
188
188
|
this.C.Ut(s.gt.Ge);
|
|
189
189
|
}),
|
|
190
|
-
this.
|
|
190
|
+
this.Qn(),
|
|
191
191
|
t &&
|
|
192
192
|
import("./Push/push-manager-factory.js").then((t) => {
|
|
193
193
|
if (this._l) return;
|
|
@@ -197,7 +197,7 @@ export default class Lt {
|
|
|
197
197
|
(vt.isPushPermissionGranted() || vt.isPushBlocked())
|
|
198
198
|
) {
|
|
199
199
|
const t = () => {
|
|
200
|
-
i.
|
|
200
|
+
i.wn()
|
|
201
201
|
? N.info(
|
|
202
202
|
"Push token maintenance is disabled, not refreshing token for backend.",
|
|
203
203
|
)
|
|
@@ -207,43 +207,44 @@ export default class Lt {
|
|
|
207
207
|
s && t();
|
|
208
208
|
},
|
|
209
209
|
h = () => {
|
|
210
|
-
const i = this.C.ft(s.gt.
|
|
210
|
+
const i = this.C.ft(s.gt.zn);
|
|
211
211
|
(null == i || i) && t();
|
|
212
212
|
},
|
|
213
|
-
o =
|
|
214
|
-
new
|
|
213
|
+
o = st.Ls.Fs;
|
|
214
|
+
new st(o, N).cr(o.Ms.cu, e, h);
|
|
215
215
|
}
|
|
216
216
|
});
|
|
217
217
|
}
|
|
218
|
-
|
|
219
|
-
this.C.Ut(s.gt.Xe), this.C.Ut(s.gt.
|
|
218
|
+
mc() {
|
|
219
|
+
this.C.Ut(s.gt.Xe), this.C.Ut(s.gt.Hs), this.C.Ut(s.gt.Kr);
|
|
220
220
|
}
|
|
221
221
|
changeUser(t, i, e) {
|
|
222
222
|
const h = this.Cs.getUserId();
|
|
223
223
|
if (h !== t) {
|
|
224
|
-
this.T.
|
|
225
|
-
this.
|
|
226
|
-
null != h && this.
|
|
224
|
+
this.T.Il(),
|
|
225
|
+
this.mc(),
|
|
226
|
+
null != h && this.Ql(void 0, !1, void 0, void 0, void 0),
|
|
227
227
|
this.Cs.ou(t),
|
|
228
|
-
e ? this.
|
|
228
|
+
e ? this.Pa.setSdkAuthenticationSignature(e) : this.Pa.Bh();
|
|
229
229
|
for (let t = 0; t < i.length; t++) i[t].changeUser(null == h);
|
|
230
|
-
|
|
231
|
-
this.C.Ut(s.gt.
|
|
230
|
+
this.S.fo(),
|
|
231
|
+
null != h && this.C.Ut(s.gt.Zt),
|
|
232
|
+
this.C.Ut(s.gt.oc),
|
|
232
233
|
this.C.Ut(s.gt._E),
|
|
233
234
|
this.openSession(),
|
|
234
235
|
N.info('Changed user to "' + t + '".');
|
|
235
236
|
} else {
|
|
236
237
|
let i = "Doing nothing.";
|
|
237
238
|
e &&
|
|
238
|
-
this.
|
|
239
|
-
(this.
|
|
239
|
+
this.Pa.xh() !== e &&
|
|
240
|
+
(this.Pa.setSdkAuthenticationSignature(e),
|
|
240
241
|
(i = "Updated SDK authentication signature")),
|
|
241
242
|
N.info(`Current user is already ${t}. ${i}`);
|
|
242
243
|
}
|
|
243
244
|
}
|
|
244
245
|
requestImmediateDataFlush(t) {
|
|
245
|
-
this.
|
|
246
|
-
this.
|
|
246
|
+
this.Yl(), this.T.Qo();
|
|
247
|
+
this.Ql(
|
|
247
248
|
void 0,
|
|
248
249
|
void 0,
|
|
249
250
|
void 0,
|
|
@@ -256,15 +257,15 @@ export default class Lt {
|
|
|
256
257
|
);
|
|
257
258
|
}
|
|
258
259
|
requestFeedRefresh() {
|
|
259
|
-
this.T.Qo(), this.
|
|
260
|
+
this.T.Qo(), this.Ql(!0);
|
|
260
261
|
}
|
|
261
262
|
br(t, i) {
|
|
262
263
|
this.T.Qo(),
|
|
263
264
|
N.info("Requesting explicit trigger refresh."),
|
|
264
|
-
this.
|
|
265
|
+
this.Ql(void 0, !0, void 0, t, i);
|
|
265
266
|
}
|
|
266
267
|
Cn(t, i) {
|
|
267
|
-
const e = d.
|
|
268
|
+
const e = d.fc,
|
|
268
269
|
h = { a: t, l: i },
|
|
269
270
|
o = c.ut(e, h);
|
|
270
271
|
return (
|
|
@@ -275,7 +276,7 @@ export default class Lt {
|
|
|
275
276
|
Ln(t, i, s) {
|
|
276
277
|
if (this.B.hu(i))
|
|
277
278
|
return (
|
|
278
|
-
N.info(`Custom Attribute "${i}" is blocklisted, ignoring.`), new
|
|
279
|
+
N.info(`Custom Attribute "${i}" is blocklisted, ignoring.`), new F()
|
|
279
280
|
);
|
|
280
281
|
const e = { key: i, value: s },
|
|
281
282
|
h = c.ut(t, e);
|
|
@@ -290,7 +291,7 @@ export default class Lt {
|
|
|
290
291
|
null != e && (n.altitude = e),
|
|
291
292
|
null != h && (n.ll_accuracy = h),
|
|
292
293
|
null != o && (n.alt_accuracy = o);
|
|
293
|
-
const r = c.ut(d.
|
|
294
|
+
const r = c.ut(d.vc, n, t || void 0);
|
|
294
295
|
return (
|
|
295
296
|
r &&
|
|
296
297
|
N.info(`Set user last known location as ${JSON.stringify(n, null, 2)}`),
|
|
@@ -299,43 +300,43 @@ export default class Lt {
|
|
|
299
300
|
}
|
|
300
301
|
lr(t, i) {
|
|
301
302
|
const s = this.T.Qo();
|
|
302
|
-
return new ve(this.Cs.getUserId(), d.
|
|
303
|
+
return new ve(this.Cs.getUserId(), d.bc, t, s, { cid: i });
|
|
303
304
|
}
|
|
304
|
-
|
|
305
|
-
return new
|
|
305
|
+
wc(t, i) {
|
|
306
|
+
return new st(t, i);
|
|
306
307
|
}
|
|
307
|
-
|
|
308
|
-
const t =
|
|
309
|
-
this.
|
|
308
|
+
Qn() {
|
|
309
|
+
const t = st.Ls.Fs;
|
|
310
|
+
this.wc(t, N).setItem(t.Ms.Nu, 1, {
|
|
310
311
|
baseUrl: this.baseUrl,
|
|
311
|
-
data: { api_key: this.
|
|
312
|
+
data: { api_key: this.an, device_id: this.hn.ve().id },
|
|
312
313
|
userId: this.Cs.getUserId(),
|
|
313
|
-
sdkAuthEnabled: this.
|
|
314
|
+
sdkAuthEnabled: this.Pa.jh(),
|
|
314
315
|
});
|
|
315
316
|
}
|
|
316
317
|
vr(t) {
|
|
317
318
|
for (const i of t)
|
|
318
|
-
if (i.api_key === this.
|
|
319
|
+
if (i.api_key === this.an) this.S.gu(i.events, i.attributes);
|
|
319
320
|
else {
|
|
320
|
-
const t =
|
|
321
|
-
new
|
|
321
|
+
const t = st.Ls.Fs;
|
|
322
|
+
new st(t, N).setItem(t.Ms.kr, K.ce(), i);
|
|
322
323
|
}
|
|
323
324
|
}
|
|
324
|
-
|
|
325
|
+
Kn(t, i, s) {
|
|
325
326
|
if (this.B.hu(t))
|
|
326
327
|
return (
|
|
327
|
-
N.info(`Custom Attribute "${t}" is blocklisted, ignoring.`), new
|
|
328
|
+
N.info(`Custom Attribute "${t}" is blocklisted, ignoring.`), new F()
|
|
328
329
|
);
|
|
329
330
|
let e, h;
|
|
330
331
|
return (
|
|
331
332
|
null === i && null === s
|
|
332
|
-
? ((e = d.
|
|
333
|
-
: ((e = d.
|
|
333
|
+
? ((e = d.kc), (h = { key: t }))
|
|
334
|
+
: ((e = d.yc), (h = { key: t, latitude: i, longitude: s })),
|
|
334
335
|
c.ut(e, h)
|
|
335
336
|
);
|
|
336
337
|
}
|
|
337
|
-
|
|
338
|
+
Mn(t, i) {
|
|
338
339
|
const s = { group_id: t, status: i };
|
|
339
|
-
return c.ut(d.
|
|
340
|
+
return c.ut(d.jc, s);
|
|
340
341
|
}
|
|
341
342
|
}
|
|
@@ -3,11 +3,11 @@ export default class rs {
|
|
|
3
3
|
constructor(t, s) {
|
|
4
4
|
(this.xc = t), (this.tf = s), (this.xc = t), (this.tf = s);
|
|
5
5
|
}
|
|
6
|
-
|
|
6
|
+
zc(t) {
|
|
7
7
|
if (null == this.xc || null == this.tf) return !1;
|
|
8
8
|
const s = t[0],
|
|
9
9
|
i = t[1];
|
|
10
|
-
return s === this.xc && this.tf.
|
|
10
|
+
return s === this.xc && this.tf.zc(i);
|
|
11
11
|
}
|
|
12
12
|
static fromJson(t) {
|
|
13
13
|
return new rs(
|
|
@@ -4,13 +4,13 @@ export default class is {
|
|
|
4
4
|
constructor(t) {
|
|
5
5
|
(this.filters = t), (this.filters = t);
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
zc(t) {
|
|
8
8
|
let r = !0;
|
|
9
9
|
for (let e = 0; e < this.filters.length; e++) {
|
|
10
10
|
const o = this.filters[e];
|
|
11
11
|
let s = !1;
|
|
12
12
|
for (let r = 0; r < o.length; r++)
|
|
13
|
-
if (o[r].
|
|
13
|
+
if (o[r].zc(t)) {
|
|
14
14
|
s = !0;
|
|
15
15
|
break;
|
|
16
16
|
}
|
|
@@ -42,12 +42,12 @@ export default class is {
|
|
|
42
42
|
}
|
|
43
43
|
return t;
|
|
44
44
|
}
|
|
45
|
-
static
|
|
45
|
+
static Rn(t) {
|
|
46
46
|
const r = [];
|
|
47
47
|
for (let e = 0; e < t.length; e++) {
|
|
48
48
|
const o = [],
|
|
49
49
|
s = t[e];
|
|
50
|
-
for (let t = 0; t < s.length; t++) o.push(fr.
|
|
50
|
+
for (let t = 0; t < s.length; t++) o.push(fr.Rn(s[t]));
|
|
51
51
|
r.push(o);
|
|
52
52
|
}
|
|
53
53
|
return new is(r);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isDate as Nt } from "../../util/code-utils.js";
|
|
2
2
|
import {
|
|
3
|
-
convertMsToSeconds as
|
|
4
|
-
dateFromUnixTimestamp as
|
|
3
|
+
convertMsToSeconds as O,
|
|
4
|
+
dateFromUnixTimestamp as P,
|
|
5
5
|
secondsAgo as es,
|
|
6
6
|
secondsInTheFuture as ls,
|
|
7
7
|
} from "../../util/date-utils.js";
|
|
@@ -20,9 +20,9 @@ export default class fr {
|
|
|
20
20
|
this.comparator !== fr.wE.BE &&
|
|
21
21
|
this.comparator !== fr.wE.jE &&
|
|
22
22
|
this.comparator !== fr.wE.zE &&
|
|
23
|
-
(this.LE =
|
|
23
|
+
(this.LE = P(this.LE));
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
zc(t) {
|
|
26
26
|
let s = null;
|
|
27
27
|
switch ((null != t && (s = t[this.yE]), this.comparator)) {
|
|
28
28
|
case fr.wE.FE:
|
|
@@ -77,11 +77,11 @@ export default class fr {
|
|
|
77
77
|
bt() {
|
|
78
78
|
let t = this.LE;
|
|
79
79
|
return (
|
|
80
|
-
Nt(this.LE) && (t =
|
|
80
|
+
Nt(this.LE) && (t = O(t.valueOf())),
|
|
81
81
|
{ k: this.yE, t: this.HE, c: this.comparator, v: t }
|
|
82
82
|
);
|
|
83
83
|
}
|
|
84
|
-
static
|
|
84
|
+
static Rn(t) {
|
|
85
85
|
return new fr(t.k, t.t, t.c, t.v);
|
|
86
86
|
}
|
|
87
87
|
}
|
|
@@ -3,11 +3,11 @@ export default class hs {
|
|
|
3
3
|
constructor(t, s) {
|
|
4
4
|
(this.productId = t), (this.tf = s), (this.productId = t), (this.tf = s);
|
|
5
5
|
}
|
|
6
|
-
|
|
6
|
+
zc(t) {
|
|
7
7
|
if (null == this.productId || null == this.tf) return !1;
|
|
8
8
|
const s = t[0],
|
|
9
9
|
i = t[1];
|
|
10
|
-
return s === this.productId && this.tf.
|
|
10
|
+
return s === this.productId && this.tf.zc(i);
|
|
11
11
|
}
|
|
12
12
|
static fromJson(t) {
|
|
13
13
|
return new hs(
|