@braze/web-sdk 4.7.1 → 4.7.2
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 +1 -1
- package/package.json +1 -1
- package/shared-lib/braze-shared-lib.js +1 -1
- package/shared-lib/event-types.js +7 -7
- package/shared-lib/indexed-db-adapter.js +1 -1
- package/shared-lib/logger.js +2 -2
- package/src/managers/braze-instance.js +19 -17
- package/src/managers/device-manager.js +5 -5
- package/src/managers/network-manager.js +32 -32
- package/src/managers/session-manager.js +1 -1
- package/src/managers/storage-manager.js +73 -66
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +1 -1
- package/src/models/server-config.js +2 -2
- package/src/request-controller.js +70 -70
- package/src/triggers/models/custom-event-data.js +1 -1
- package/src/triggers/models/custom-event-property-data.js +5 -5
- package/src/triggers/models/filter-set.js +2 -2
- package/src/triggers/models/filter.js +56 -56
- package/src/triggers/models/in-app-message-click-data.js +9 -9
- package/src/triggers/models/purchase-data.js +1 -1
- package/src/triggers/models/purchase-property-data.js +5 -5
- package/src/triggers/models/push-click-data.js +4 -4
- package/src/triggers/models/trigger-condition.js +2 -2
- package/src/triggers/models/trigger.js +20 -20
- package/src/triggers/triggers-provider.js +37 -37
- package/src/ui/js/attach-css.js +1 -1
- package/src/util/base-device-parser.js +1 -1
- package/src/util/browser-detector.js +4 -4
- package/src/util/client-hints-parser.js +1 -1
- package/src/util/net.js +1 -1
- package/src/util/user-agent-parser.js +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import Gt from "./filter-set.js";
|
|
2
2
|
export default class Ht {
|
|
3
3
|
constructor(t, s) {
|
|
4
|
-
(this.Bl = t), (this.
|
|
4
|
+
(this.Bl = t), (this.Hl = s);
|
|
5
5
|
}
|
|
6
|
-
|
|
7
|
-
if (null == this.Bl || null == this.
|
|
6
|
+
Gl(t) {
|
|
7
|
+
if (null == this.Bl || null == this.Hl) return !1;
|
|
8
8
|
const s = t[0],
|
|
9
9
|
r = t[1];
|
|
10
|
-
return s === this.Bl && this.Gl
|
|
10
|
+
return s === this.Bl && this.Hl.Gl(r);
|
|
11
11
|
}
|
|
12
12
|
static fromJson(t) {
|
|
13
13
|
return new Ht(
|
|
@@ -16,6 +16,6 @@ export default class Ht {
|
|
|
16
16
|
);
|
|
17
17
|
}
|
|
18
18
|
ss() {
|
|
19
|
-
return { e: this.Bl, pf: this.
|
|
19
|
+
return { e: this.Bl, pf: this.Hl.ss() };
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -4,13 +4,13 @@ export default class Gt {
|
|
|
4
4
|
constructor(t) {
|
|
5
5
|
this.filters = t;
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
Gl(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].Gl(t)) {
|
|
14
14
|
s = !0;
|
|
15
15
|
break;
|
|
16
16
|
}
|
|
@@ -7,57 +7,57 @@ import {
|
|
|
7
7
|
} from "../../util/date-utils.js";
|
|
8
8
|
export default class Vt {
|
|
9
9
|
constructor(t, s, e, i) {
|
|
10
|
-
(this.
|
|
11
|
-
(this.
|
|
10
|
+
(this.Ql = t),
|
|
11
|
+
(this.Xl = s),
|
|
12
12
|
(this.comparator = e),
|
|
13
|
-
(this.
|
|
14
|
-
this.
|
|
15
|
-
this.comparator !== Vt.Yl
|
|
16
|
-
this.comparator !== Vt.
|
|
17
|
-
this.comparator !== Vt.
|
|
18
|
-
this.comparator !== Vt.
|
|
19
|
-
(this.
|
|
13
|
+
(this.Vl = i),
|
|
14
|
+
this.Xl === Vt.Wl.Kl &&
|
|
15
|
+
this.comparator !== Vt.Zl.Yl &&
|
|
16
|
+
this.comparator !== Vt.Zl.Uh &&
|
|
17
|
+
this.comparator !== Vt.Zl.Qh &&
|
|
18
|
+
this.comparator !== Vt.Zl.Xh &&
|
|
19
|
+
(this.Vl = h(this.Vl));
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
Gl(t) {
|
|
22
22
|
let s = null;
|
|
23
|
-
switch ((null != t && (s = t[this.
|
|
24
|
-
case Vt.
|
|
25
|
-
return null != s && s.valueOf() === this.
|
|
26
|
-
case Vt.
|
|
27
|
-
return null == s || s.valueOf() !== this.
|
|
28
|
-
case Vt.
|
|
29
|
-
return typeof s == typeof this.
|
|
30
|
-
case Vt.Yl
|
|
31
|
-
return this.
|
|
32
|
-
? null != s && Nt(s) && Qt(s) <= this.
|
|
33
|
-
: typeof s == typeof this.
|
|
34
|
-
case Vt.
|
|
35
|
-
return typeof s == typeof this.
|
|
36
|
-
case Vt.
|
|
37
|
-
return this.
|
|
38
|
-
? null != s && Nt(s) && Qt(s) >= this.
|
|
39
|
-
: typeof s == typeof this.
|
|
40
|
-
case Vt.
|
|
23
|
+
switch ((null != t && (s = t[this.Ql]), this.comparator)) {
|
|
24
|
+
case Vt.Zl.Vh:
|
|
25
|
+
return null != s && s.valueOf() === this.Vl.valueOf();
|
|
26
|
+
case Vt.Zl.Kh:
|
|
27
|
+
return null == s || s.valueOf() !== this.Vl.valueOf();
|
|
28
|
+
case Vt.Zl.Yh:
|
|
29
|
+
return typeof s == typeof this.Vl && s > this.Vl;
|
|
30
|
+
case Vt.Zl.Yl:
|
|
31
|
+
return this.Xl === Vt.Wl.Kl
|
|
32
|
+
? null != s && Nt(s) && Qt(s) <= this.Vl
|
|
33
|
+
: typeof s == typeof this.Vl && s >= this.Vl;
|
|
34
|
+
case Vt.Zl.Zh:
|
|
35
|
+
return typeof s == typeof this.Vl && s < this.Vl;
|
|
36
|
+
case Vt.Zl.Uh:
|
|
37
|
+
return this.Xl === Vt.Wl.Kl
|
|
38
|
+
? null != s && Nt(s) && Qt(s) >= this.Vl
|
|
39
|
+
: typeof s == typeof this.Vl && s <= this.Vl;
|
|
40
|
+
case Vt.Zl.$h:
|
|
41
41
|
return (
|
|
42
42
|
null != s &&
|
|
43
43
|
"string" == typeof s &&
|
|
44
|
-
typeof s == typeof this.
|
|
45
|
-
null != s.match(this.
|
|
44
|
+
typeof s == typeof this.Vl &&
|
|
45
|
+
null != s.match(this.Vl)
|
|
46
46
|
);
|
|
47
|
-
case Vt.
|
|
47
|
+
case Vt.Zl.Eu:
|
|
48
48
|
return null != s;
|
|
49
|
-
case Vt.
|
|
49
|
+
case Vt.Zl.au:
|
|
50
50
|
return null == s;
|
|
51
|
-
case Vt.
|
|
52
|
-
return null != s && Nt(s) && Wt(s) < this.
|
|
53
|
-
case Vt.
|
|
54
|
-
return null != s && Nt(s) && Wt(s) > this.
|
|
55
|
-
case Vt.
|
|
51
|
+
case Vt.Zl.Qh:
|
|
52
|
+
return null != s && Nt(s) && Wt(s) < this.Vl;
|
|
53
|
+
case Vt.Zl.Xh:
|
|
54
|
+
return null != s && Nt(s) && Wt(s) > this.Vl;
|
|
55
|
+
case Vt.Zl.Tu:
|
|
56
56
|
return (
|
|
57
57
|
null == s ||
|
|
58
|
-
typeof s != typeof this.
|
|
58
|
+
typeof s != typeof this.Vl ||
|
|
59
59
|
"string" != typeof s ||
|
|
60
|
-
null == s.match(this.
|
|
60
|
+
null == s.match(this.Vl)
|
|
61
61
|
);
|
|
62
62
|
}
|
|
63
63
|
return !1;
|
|
@@ -71,28 +71,28 @@ export default class Vt {
|
|
|
71
71
|
);
|
|
72
72
|
}
|
|
73
73
|
ss() {
|
|
74
|
-
let t = this.
|
|
74
|
+
let t = this.Vl;
|
|
75
75
|
return (
|
|
76
|
-
Nt(this.
|
|
77
|
-
{ k: this.
|
|
76
|
+
Nt(this.Vl) && (t = l(t.valueOf())),
|
|
77
|
+
{ k: this.Ql, t: this.Xl, c: this.comparator, v: t }
|
|
78
78
|
);
|
|
79
79
|
}
|
|
80
80
|
static Pn(t) {
|
|
81
81
|
return new Vt(t.k, t.t, t.c, t.v);
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
-
(Vt.
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
84
|
+
(Vt.Zl = {
|
|
85
|
+
Vh: 1,
|
|
86
|
+
Kh: 2,
|
|
87
|
+
Yh: 3,
|
|
88
|
+
Yl: 4,
|
|
89
|
+
Zh: 5,
|
|
90
|
+
Uh: 6,
|
|
91
|
+
$h: 10,
|
|
92
|
+
Eu: 11,
|
|
93
|
+
au: 12,
|
|
94
|
+
Qh: 15,
|
|
95
|
+
Xh: 16,
|
|
96
|
+
Tu: 17
|
|
97
97
|
}),
|
|
98
|
-
(Vt.
|
|
98
|
+
(Vt.Wl = { Au: "boolean", _u: "number", fu: "string", Kl: "date" });
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import Yt from "./trigger-condition.js";
|
|
2
2
|
export default class Zt {
|
|
3
3
|
constructor(t, i) {
|
|
4
|
-
(this.
|
|
4
|
+
(this.du = t), (this.gu = i);
|
|
5
5
|
}
|
|
6
|
-
|
|
7
|
-
if (null == this.
|
|
8
|
-
const i = Yt.
|
|
6
|
+
Gl(t) {
|
|
7
|
+
if (null == this.du) return !1;
|
|
8
|
+
const i = Yt.pu(t[0], this.du);
|
|
9
9
|
if (!i) return !1;
|
|
10
|
-
let r = null == this.
|
|
11
|
-
if (null != this.
|
|
12
|
-
for (let i = 0; i < this.
|
|
13
|
-
if (this.
|
|
10
|
+
let r = null == this.gu || 0 === this.gu.length;
|
|
11
|
+
if (null != this.gu)
|
|
12
|
+
for (let i = 0; i < this.gu.length; i++)
|
|
13
|
+
if (this.gu[i] === t[1]) {
|
|
14
14
|
r = !0;
|
|
15
15
|
break;
|
|
16
16
|
}
|
|
@@ -20,6 +20,6 @@ export default class Zt {
|
|
|
20
20
|
return new Zt(t ? t.id : null, t ? t.buttons : null);
|
|
21
21
|
}
|
|
22
22
|
ss() {
|
|
23
|
-
return this.
|
|
23
|
+
return this.du;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import Gt from "./filter-set.js";
|
|
2
2
|
export default class ts {
|
|
3
3
|
constructor(t, s) {
|
|
4
|
-
(this.productId = t), (this.
|
|
4
|
+
(this.productId = t), (this.Hl = s);
|
|
5
5
|
}
|
|
6
|
-
|
|
7
|
-
if (null == this.productId || null == this.
|
|
6
|
+
Gl(t) {
|
|
7
|
+
if (null == this.productId || null == this.Hl) return !1;
|
|
8
8
|
const s = t[0],
|
|
9
9
|
i = t[1];
|
|
10
|
-
return s === this.productId && this.Gl
|
|
10
|
+
return s === this.productId && this.Hl.Gl(i);
|
|
11
11
|
}
|
|
12
12
|
static fromJson(t) {
|
|
13
13
|
return new ts(
|
|
@@ -16,6 +16,6 @@ export default class ts {
|
|
|
16
16
|
);
|
|
17
17
|
}
|
|
18
18
|
ss() {
|
|
19
|
-
return { id: this.productId, pf: this.
|
|
19
|
+
return { id: this.productId, pf: this.Hl.ss() };
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import Yt from "./trigger-condition.js";
|
|
2
2
|
export default class lr {
|
|
3
3
|
constructor(t) {
|
|
4
|
-
this.
|
|
4
|
+
this.du = t;
|
|
5
5
|
}
|
|
6
|
-
|
|
7
|
-
return null == this.
|
|
6
|
+
Gl(t) {
|
|
7
|
+
return null == this.du || Yt.pu(t[0], this.du);
|
|
8
8
|
}
|
|
9
9
|
static fromJson(t) {
|
|
10
10
|
return new lr(t ? t.campaign_id : null);
|
|
11
11
|
}
|
|
12
12
|
ss() {
|
|
13
|
-
return this.
|
|
13
|
+
return this.du;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -12,9 +12,9 @@ export default class Yt {
|
|
|
12
12
|
(this.type = e), (this.data = t);
|
|
13
13
|
}
|
|
14
14
|
ec(e, t) {
|
|
15
|
-
return Yt.tc[this.type] === e && (null == this.data || this.data.
|
|
15
|
+
return Yt.tc[this.type] === e && (null == this.data || this.data.Gl(t));
|
|
16
16
|
}
|
|
17
|
-
static
|
|
17
|
+
static pu(e, t) {
|
|
18
18
|
let a = null;
|
|
19
19
|
try {
|
|
20
20
|
a = window.atob(e);
|
|
@@ -8,35 +8,35 @@ import { validateValueIsFromEnum as F } from "../../util/code-utils.js";
|
|
|
8
8
|
export default class pt {
|
|
9
9
|
constructor(t, i, s, e, r, l, o, n, h, a, u, d) {
|
|
10
10
|
(this.id = t),
|
|
11
|
-
(this.
|
|
11
|
+
(this.Du = i || []),
|
|
12
12
|
void 0 === s && (s = null),
|
|
13
13
|
(this.startTime = s),
|
|
14
14
|
void 0 === e && (e = null),
|
|
15
15
|
(this.endTime = e),
|
|
16
16
|
(this.priority = r || 0),
|
|
17
17
|
(this.type = l),
|
|
18
|
-
(this.
|
|
19
|
-
null == a && (a = 1e3 * (this.
|
|
18
|
+
(this.Pu = n || 0),
|
|
19
|
+
null == a && (a = 1e3 * (this.Pu + 30)),
|
|
20
20
|
(this.Vi = a),
|
|
21
21
|
(this.data = o),
|
|
22
|
-
null == h && (h = pt.
|
|
23
|
-
(this.
|
|
24
|
-
(this.
|
|
25
|
-
(this.
|
|
22
|
+
null == h && (h = pt.yu),
|
|
23
|
+
(this.ju = h),
|
|
24
|
+
(this.wu = u),
|
|
25
|
+
(this.Nu = d || null);
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
vu(t) {
|
|
28
28
|
return (
|
|
29
|
-
null == this.
|
|
29
|
+
null == this.Nu || (this.ju !== pt.yu && t - this.Nu >= 1e3 * this.ju)
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
|
-
vu(t) {
|
|
33
|
-
this.wu = t;
|
|
34
|
-
}
|
|
35
32
|
zu(t) {
|
|
36
|
-
|
|
37
|
-
return Math.max(i - new Date().valueOf(), 0);
|
|
33
|
+
this.Nu = t;
|
|
38
34
|
}
|
|
39
35
|
Iu(t) {
|
|
36
|
+
const i = t + 1e3 * this.Pu;
|
|
37
|
+
return Math.max(i - new Date().valueOf(), 0);
|
|
38
|
+
}
|
|
39
|
+
$u(t) {
|
|
40
40
|
const i = new Date().valueOf() - t,
|
|
41
41
|
s = null == t || isNaN(i) || null == this.Vi || i < this.Vi;
|
|
42
42
|
return (
|
|
@@ -72,7 +72,7 @@ export default class pt {
|
|
|
72
72
|
}
|
|
73
73
|
ss() {
|
|
74
74
|
const t = [];
|
|
75
|
-
for (let i = 0; i < this.
|
|
75
|
+
for (let i = 0; i < this.Du.length; i++) t.push(this.Du[i].ss());
|
|
76
76
|
return {
|
|
77
77
|
i: this.id,
|
|
78
78
|
c: t,
|
|
@@ -81,11 +81,11 @@ export default class pt {
|
|
|
81
81
|
p: this.priority,
|
|
82
82
|
t: this.type,
|
|
83
83
|
da: this.data,
|
|
84
|
-
d: this.
|
|
85
|
-
r: this.
|
|
84
|
+
d: this.Pu,
|
|
85
|
+
r: this.ju,
|
|
86
86
|
tm: this.Vi,
|
|
87
|
-
ss: this.
|
|
88
|
-
ld: this.
|
|
87
|
+
ss: this.wu,
|
|
88
|
+
ld: this.Nu
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
91
|
static Pn(t) {
|
|
@@ -107,4 +107,4 @@ export default class pt {
|
|
|
107
107
|
);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
(pt.
|
|
110
|
+
(pt.yu = -1), (pt.Ki = { Ji: "inapp", Mu: "templated_iam" });
|
|
@@ -29,17 +29,17 @@ export default class gr extends y {
|
|
|
29
29
|
this.ag();
|
|
30
30
|
}
|
|
31
31
|
gg() {
|
|
32
|
-
(this.hg = this.h.I(o.q.
|
|
33
|
-
(this.og = this.h.I(o.q.
|
|
34
|
-
(this.ng = this.h.I(o.q.
|
|
32
|
+
(this.hg = this.h.I(o.q.Na) || this.hg),
|
|
33
|
+
(this.og = this.h.I(o.q.va) || this.og),
|
|
34
|
+
(this.ng = this.h.I(o.q.Ga) || this.ng);
|
|
35
35
|
for (let t = 0; t < this.fg.length; t++) {
|
|
36
36
|
const i = this.fg[t];
|
|
37
|
-
null != this.ng[i.id] && i.
|
|
37
|
+
null != this.ng[i.id] && i.zu(this.ng[i.id]);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
lg() {
|
|
41
|
-
this.cg = this.h.I(o.q.
|
|
42
|
-
const t = this.h.I(o.q.
|
|
41
|
+
this.cg = this.h.I(o.q.Da) || 0;
|
|
42
|
+
const t = this.h.I(o.q.Ya) || [],
|
|
43
43
|
i = [];
|
|
44
44
|
for (let s = 0; s < t.length; s++) i.push(pt.Pn(t[s]));
|
|
45
45
|
(this.fg = i), this.gg();
|
|
@@ -61,12 +61,12 @@ export default class gr extends y {
|
|
|
61
61
|
h = [];
|
|
62
62
|
for (let e = 0; e < t.length; e++) {
|
|
63
63
|
const o = t[e],
|
|
64
|
-
n = r.
|
|
64
|
+
n = r.Iu(o.Ui);
|
|
65
65
|
if (n > 0) {
|
|
66
66
|
let t, e;
|
|
67
67
|
h.push(o),
|
|
68
68
|
null != o.dg && (t = o.dg),
|
|
69
|
-
null != o.mg && ue.
|
|
69
|
+
null != o.mg && ue.Fa(o.mg) && (e = ue.Pn(o.mg));
|
|
70
70
|
const l = [];
|
|
71
71
|
if (p(o.pg))
|
|
72
72
|
for (let t = 0; t < o.pg.length; t++) {
|
|
@@ -82,17 +82,17 @@ export default class gr extends y {
|
|
|
82
82
|
0 === this.og[r.id].length && delete this.og[r.id]);
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
-
e && this.h.B(o.q.
|
|
85
|
+
e && this.h.B(o.q.va, this.og);
|
|
86
86
|
}
|
|
87
87
|
bg() {
|
|
88
88
|
const t = [];
|
|
89
89
|
for (let i = 0; i < this.fg.length; i++) t.push(this.fg[i].ss());
|
|
90
90
|
(this.cg = new Date().valueOf()),
|
|
91
|
-
this.h.B(o.q.
|
|
92
|
-
this.h.B(o.q.
|
|
91
|
+
this.h.B(o.q.Ya, t),
|
|
92
|
+
this.h.B(o.q.Da, this.cg);
|
|
93
93
|
}
|
|
94
94
|
Tg() {
|
|
95
|
-
(this.h.I(o.q.
|
|
95
|
+
(this.h.I(o.q.Da) || 0) > this.cg ? this.lg() : this.gg();
|
|
96
96
|
}
|
|
97
97
|
Rs(t) {
|
|
98
98
|
let i = !1;
|
|
@@ -104,17 +104,17 @@ export default class gr extends y {
|
|
|
104
104
|
for (let r = 0; r < t.triggers.length; r++) {
|
|
105
105
|
const h = pt.fromJson(t.triggers[r]);
|
|
106
106
|
null != this.ng[h.id] &&
|
|
107
|
-
(h.
|
|
107
|
+
(h.zu(this.ng[h.id]), (s[h.id] = this.ng[h.id])),
|
|
108
108
|
null != this.og[h.id] && (e[h.id] = this.og[h.id]);
|
|
109
|
-
for (let t = 0; t < h.
|
|
110
|
-
if (h.
|
|
109
|
+
for (let t = 0; t < h.Du.length; t++)
|
|
110
|
+
if (h.Du[t].ec(V.ks, null)) {
|
|
111
111
|
i = !0;
|
|
112
112
|
break;
|
|
113
113
|
}
|
|
114
114
|
null != h && this.fg.push(h);
|
|
115
115
|
}
|
|
116
|
-
ii(this.ng, s) || ((this.ng = s), this.h.B(o.q.
|
|
117
|
-
ii(this.og, e) || ((this.og = e), this.h.B(o.q.
|
|
116
|
+
ii(this.ng, s) || ((this.ng = s), this.h.B(o.q.Ga, this.ng)),
|
|
117
|
+
ii(this.og, e) || ((this.og = e), this.h.B(o.q.va, this.og)),
|
|
118
118
|
this.bg(),
|
|
119
119
|
i &&
|
|
120
120
|
(r.D.info("Trigger with test condition found, firing test."),
|
|
@@ -129,13 +129,13 @@ export default class gr extends y {
|
|
|
129
129
|
const o = e => {
|
|
130
130
|
this.gg();
|
|
131
131
|
const h = new Date().valueOf();
|
|
132
|
-
if (!t
|
|
132
|
+
if (!t.$u(i))
|
|
133
133
|
return !1 === navigator.onLine && t.type === pt.Ki.Ji && e.imageUrl
|
|
134
134
|
? (r.D.info(
|
|
135
135
|
`Not showing ${t.type} trigger action ${t.id} due to offline state.`
|
|
136
136
|
),
|
|
137
137
|
void this.ig.Ye(t.id, InAppMessage.Me.Dh))
|
|
138
|
-
: void (t.
|
|
138
|
+
: void (t.vu(h) && this.yg(t, h, s)
|
|
139
139
|
? 0 === this.yt.bu()
|
|
140
140
|
? r.D.info(
|
|
141
141
|
`Not displaying trigger ${t.id} because neither automaticallyShowInAppMessages() nor subscribeToInAppMessage() were called.`
|
|
@@ -144,7 +144,7 @@ export default class gr extends y {
|
|
|
144
144
|
: r.D.info(
|
|
145
145
|
`Not displaying trigger ${t.id} because display time fell outside of the acceptable time window.`
|
|
146
146
|
));
|
|
147
|
-
t.type === pt.Ki
|
|
147
|
+
t.type === pt.Ki.Mu
|
|
148
148
|
? this.ig.Ye(t.id, InAppMessage.Me.Ri)
|
|
149
149
|
: this.ig.Ye(t.id, InAppMessage.Me.Mh);
|
|
150
150
|
},
|
|
@@ -152,7 +152,7 @@ export default class gr extends y {
|
|
|
152
152
|
this.gg();
|
|
153
153
|
const o = h.pop();
|
|
154
154
|
if (null != o)
|
|
155
|
-
if ((this.wg(o, i, s, e, h), o
|
|
155
|
+
if ((this.wg(o, i, s, e, h), o.$u(i))) {
|
|
156
156
|
let t = `Server aborted in-app message display, but the timeout on fallback trigger ${o.id} has already elapsed.`;
|
|
157
157
|
h.length > 0 && (t += " Continuing to fall back."),
|
|
158
158
|
r.D.info(t),
|
|
@@ -162,7 +162,7 @@ export default class gr extends y {
|
|
|
162
162
|
r.D.info(
|
|
163
163
|
`Server aborted in-app message display. Falling back to lower priority ${o.type} trigger action ${t.id}.`
|
|
164
164
|
);
|
|
165
|
-
const n = 1e3 * o.
|
|
165
|
+
const n = 1e3 * o.Pu - (new Date().valueOf() - i);
|
|
166
166
|
n > 0
|
|
167
167
|
? this.eg.push(
|
|
168
168
|
setTimeout(() => {
|
|
@@ -188,7 +188,7 @@ export default class gr extends y {
|
|
|
188
188
|
}
|
|
189
189
|
o(l);
|
|
190
190
|
break;
|
|
191
|
-
case pt.Ki
|
|
191
|
+
case pt.Ki.Mu:
|
|
192
192
|
if (((g = wt.fromJson(t.data, o, n, i, t.Vi)), null == g)) {
|
|
193
193
|
r.D.error(
|
|
194
194
|
`Could not parse trigger data for trigger ${t.id}, ignoring.`
|
|
@@ -207,7 +207,7 @@ export default class gr extends y {
|
|
|
207
207
|
}
|
|
208
208
|
je(t, i, s) {
|
|
209
209
|
if (!F(V, t, "Cannot fire trigger action.", "TriggerEvents")) return;
|
|
210
|
-
if (this.Ci.
|
|
210
|
+
if (this.Ci.Ll())
|
|
211
211
|
return (
|
|
212
212
|
r.D.info(
|
|
213
213
|
"Trigger sync is currently in progress, awaiting sync completion before firing trigger event."
|
|
@@ -222,15 +222,15 @@ export default class gr extends y {
|
|
|
222
222
|
const l = [];
|
|
223
223
|
for (let s = 0; s < this.fg.length; s++) {
|
|
224
224
|
const r = this.fg[s],
|
|
225
|
-
h = e + 1e3 * r.
|
|
225
|
+
h = e + 1e3 * r.Pu;
|
|
226
226
|
if (
|
|
227
|
-
r.
|
|
227
|
+
r.vu(h) &&
|
|
228
228
|
(null == r.startTime || r.startTime <= e) &&
|
|
229
229
|
(null == r.endTime || r.endTime >= e)
|
|
230
230
|
) {
|
|
231
231
|
let s = !1;
|
|
232
|
-
for (let e = 0; e < r.
|
|
233
|
-
if (r.
|
|
232
|
+
for (let e = 0; e < r.Du.length; e++)
|
|
233
|
+
if (r.Du[e].ec(t, i)) {
|
|
234
234
|
s = !0;
|
|
235
235
|
break;
|
|
236
236
|
}
|
|
@@ -253,19 +253,19 @@ export default class gr extends y {
|
|
|
253
253
|
`Firing ${a.type} trigger action ${a.id} from trigger event ${t}.`
|
|
254
254
|
),
|
|
255
255
|
this.wg(a, e, t, s, l),
|
|
256
|
-
0 === a.
|
|
256
|
+
0 === a.Pu
|
|
257
257
|
? this.ug(a, e, t, s, l)
|
|
258
258
|
: this.eg.push(
|
|
259
259
|
setTimeout(() => {
|
|
260
260
|
this.ug(a, e, t, s, l);
|
|
261
|
-
}, 1e3 * a.
|
|
261
|
+
}, 1e3 * a.Pu)
|
|
262
262
|
));
|
|
263
263
|
}
|
|
264
264
|
changeUser(t) {
|
|
265
|
-
if (((this.fg = []), this.h.Xs(o.q.
|
|
265
|
+
if (((this.fg = []), this.h.Xs(o.q.Ya), !t)) {
|
|
266
266
|
(this.sg = []), (this.hg = null), (this.ng = {}), (this.og = {});
|
|
267
267
|
for (let t = 0; t < this.eg.length; t++) clearTimeout(this.eg[t]);
|
|
268
|
-
(this.eg = []), this.h.Xs(o.q.
|
|
268
|
+
(this.eg = []), this.h.Xs(o.q.Na), this.h.Xs(o.q.Ga), this.h.Xs(o.q.va);
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
271
|
clearData() {
|
|
@@ -282,7 +282,7 @@ export default class gr extends y {
|
|
|
282
282
|
),
|
|
283
283
|
!0
|
|
284
284
|
);
|
|
285
|
-
let e = t.
|
|
285
|
+
let e = t.wu;
|
|
286
286
|
return null == e && (e = this.tg), i - this.hg >= 1e3 * e;
|
|
287
287
|
}
|
|
288
288
|
wg(t, i, s, e, r) {
|
|
@@ -292,14 +292,14 @@ export default class gr extends y {
|
|
|
292
292
|
(h.Ui = i), (h.dg = s), null != e && (n = e.ss()), (h.mg = n);
|
|
293
293
|
const l = [];
|
|
294
294
|
for (let t = 0; t < r.length; t++) l.push(r[t].id);
|
|
295
|
-
(h.pg = l), this.og[t.id].push(h), this.h.B(o.q.
|
|
295
|
+
(h.pg = l), this.og[t.id].push(h), this.h.B(o.q.va, this.og);
|
|
296
296
|
}
|
|
297
297
|
vg(t, i) {
|
|
298
298
|
this.gg(),
|
|
299
|
-
t.
|
|
299
|
+
t.zu(i),
|
|
300
300
|
(this.hg = i),
|
|
301
|
-
this.h.B(o.q.
|
|
301
|
+
this.h.B(o.q.Na, i),
|
|
302
302
|
(this.ng[t.id] = i),
|
|
303
|
-
this.h.B(o.q.
|
|
303
|
+
this.h.B(o.q.Ga, this.ng);
|
|
304
304
|
}
|
|
305
305
|
}
|
package/src/ui/js/attach-css.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e, { OPTIONS as T } from "../../managers/braze-instance.js";
|
|
2
2
|
export function attachCSS(n, t, o) {
|
|
3
3
|
const c = n || document.querySelector("head"),
|
|
4
|
-
s = `ab-${t}-css-definitions-${"4.7.
|
|
4
|
+
s = `ab-${t}-css-definitions-${"4.7.2".replace(/\./g, "-")}`,
|
|
5
5
|
a = c.ownerDocument || document;
|
|
6
6
|
if (null == a.getElementById(s)) {
|
|
7
7
|
const n = a.createElement("style");
|
|
@@ -8,7 +8,7 @@ class si {
|
|
|
8
8
|
(this.userAgent = navigator.userAgent),
|
|
9
9
|
(this.browser = this.Sg.tf()),
|
|
10
10
|
(this.version = this.Sg.ef()),
|
|
11
|
-
this.
|
|
11
|
+
this.Yo().then(t => (this.OS = t)),
|
|
12
12
|
(this.language = (
|
|
13
13
|
navigator.userLanguage ||
|
|
14
14
|
navigator.language ||
|
|
@@ -24,13 +24,13 @@ class si {
|
|
|
24
24
|
xa() {
|
|
25
25
|
return this.browser === ri.kg;
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
Qo() {
|
|
28
28
|
return this.OS || null;
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
Yo() {
|
|
31
31
|
return this.OS
|
|
32
32
|
? Promise.resolve(this.OS)
|
|
33
|
-
: this.Sg.
|
|
33
|
+
: this.Sg.Yo(si.xg).then(t => ((this.OS = t), t));
|
|
34
34
|
}
|
|
35
35
|
static Bg(t) {
|
|
36
36
|
t = t.toLowerCase();
|
package/src/util/net.js
CHANGED