@braze/web-sdk 6.11.0 → 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 +36 -5
- package/package.json +1 -1
- package/shared-lib/event-types.js +4 -4
- package/shared-lib/indexed-db-adapter.js +51 -51
- package/shared-lib/logger.js +7 -7
- package/shared-lib/supported-options.js +9 -9
- 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/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 +42 -42
- 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 +73 -73
- 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 +2 -2
- package/src/InAppMessage/log-in-app-message-impression.js +2 -2
- package/src/InAppMessage/models/full-screen-message.js +9 -9
- package/src/InAppMessage/models/html-message.js +4 -4
- package/src/InAppMessage/models/in-app-message-button.js +2 -2
- package/src/InAppMessage/models/in-app-message.js +52 -52
- package/src/InAppMessage/models/modal-message.js +7 -7
- package/src/InAppMessage/models/slide-up-message.js +11 -11
- 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 +5 -5
- package/src/InAppMessage/ui/show-in-app-message.js +36 -36
- 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 +14 -14
- package/src/Push/unregister-push-token-on-server.js +3 -3
- package/src/Push/utils/push-utils.js +10 -10
- package/src/User/user.js +19 -19
- 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 +41 -41
- package/src/managers/device-manager.js +22 -22
- package/src/managers/network-manager.js +108 -108
- package/src/managers/server-config-manager.js +83 -83
- package/src/managers/session-manager.js +6 -6
- package/src/managers/storage-manager-factory.js +4 -4
- package/src/managers/storage-manager.js +127 -125
- 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 +3 -3
- package/src/models/identifier.js +3 -3
- package/src/models/push-token.js +3 -3
- package/src/models/server-config.js +31 -31
- package/src/request-controller.js +39 -39
- 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 +50 -50
- package/src/types.js +2 -2
- 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 +2 -2
- package/src/util/braze-actions.js +2 -2
- package/src/util/browser-detector.js +15 -15
- package/src/util/client-hints-parser.js +5 -5
- 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 +18 -18
- package/src/util/validation-utils.js +4 -4
- 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
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { logger as b } from "../../shared-lib/index.js";
|
|
2
|
+
import { isAlphanumericChar as ri } from "../util/string-utils.js";
|
|
3
|
+
export const TAB_INDIVIDUAL_LENGTH = 10;
|
|
4
|
+
const ai = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
5
|
+
export function isValidIndividual(i) {
|
|
6
|
+
if (!i) return !1;
|
|
7
|
+
for (let e = 0; e < i.length; e++) if (!ri(i.charAt(e))) return !1;
|
|
8
|
+
return !0;
|
|
9
|
+
}
|
|
10
|
+
export function generateIndividual() {
|
|
11
|
+
let i = "";
|
|
12
|
+
for (let e = 0; e < 10; e++)
|
|
13
|
+
i += ai.charAt(Math.floor(Math.random() * ai.length));
|
|
14
|
+
return i;
|
|
15
|
+
}
|
|
16
|
+
export function buildTabMite(i, e) {
|
|
17
|
+
if (!i) return i;
|
|
18
|
+
const t = i.split(":");
|
|
19
|
+
return t.length < 3
|
|
20
|
+
? (b.warn(
|
|
21
|
+
"Real-time messaging identifier is not a full identifier, using it as-is",
|
|
22
|
+
),
|
|
23
|
+
i)
|
|
24
|
+
: isValidIndividual(e)
|
|
25
|
+
? t[0] + ":" + t[1] + ":" + e
|
|
26
|
+
: (b.warn(
|
|
27
|
+
"Generated per-tab real-time messaging identifier is invalid, using the shared identifier",
|
|
28
|
+
),
|
|
29
|
+
i);
|
|
30
|
+
}
|
package/src/DUST/index.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
export { default as DustProviderFactory } from "./dust-provider-factory.js";
|
|
2
2
|
export { default as DustProvider } from "./dust-provider.js";
|
|
3
3
|
export { subscribeToDust } from "./subscribe-to-dust.js";
|
|
4
|
+
export { buildSseUrl } from "./dust-connection-core.js";
|
|
5
|
+
export { buildTabMite, generateIndividual } from "./dust-tab-identity.js";
|
|
4
6
|
export {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
buildSseUrl,
|
|
11
|
-
MIN_BACKOFF_MS,
|
|
12
|
-
MAX_BACKOFF_MS,
|
|
13
|
-
} from "./dust-connection-core.js";
|
|
7
|
+
default as DustConfigStore,
|
|
8
|
+
isConfigExpired,
|
|
9
|
+
isConfigUsable,
|
|
10
|
+
} from "./dust-config-store.js";
|
|
11
|
+
export { default as DustMessageDedup } from "./dust-message-dedup.js";
|
|
@@ -7,18 +7,18 @@ export function subscribeToDust() {
|
|
|
7
7
|
const o = dr.o(),
|
|
8
8
|
s = () => {
|
|
9
9
|
if (!o.Et()) {
|
|
10
|
-
o.
|
|
10
|
+
o.wn();
|
|
11
11
|
const r = n.rn(() => {
|
|
12
|
-
t
|
|
12
|
+
t.$n() && o.Rn();
|
|
13
13
|
});
|
|
14
|
-
return r && o.Lt(r), o.
|
|
14
|
+
return r && o.Lt(r), o.bn() && o.pn(), r;
|
|
15
15
|
}
|
|
16
16
|
return o.Et();
|
|
17
17
|
};
|
|
18
18
|
return (
|
|
19
19
|
t.Tr(() => {
|
|
20
|
-
r.ao() && (t
|
|
20
|
+
r.ao() && (t.$n() ? (o.Rn(), s()) : (o.fn(), o.bn() && o.gn()));
|
|
21
21
|
}),
|
|
22
|
-
t
|
|
22
|
+
t.$n() ? s() : null
|
|
23
23
|
);
|
|
24
24
|
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { logger as b } from "../../shared-lib/index.js";
|
|
2
2
|
import FeatureFlag from "./feature-flag.js";
|
|
3
3
|
export function newFeatureFlagFromJson(e) {
|
|
4
|
-
if (e[FeatureFlag.ei.qs] && "boolean" == typeof e[FeatureFlag.ei.
|
|
4
|
+
if (e[FeatureFlag.ei.qs] && "boolean" == typeof e[FeatureFlag.ei.Jr])
|
|
5
5
|
return new FeatureFlag(
|
|
6
6
|
e[FeatureFlag.ei.qs],
|
|
7
|
+
e[FeatureFlag.ei.Jr],
|
|
7
8
|
e[FeatureFlag.ei.Nr],
|
|
8
9
|
e[FeatureFlag.ei.Or],
|
|
9
|
-
e[FeatureFlag.ei.Qr],
|
|
10
10
|
);
|
|
11
11
|
b.info(`Unable to create feature flag from ${JSON.stringify(e, null, 2)}`);
|
|
12
12
|
}
|
|
13
13
|
export function newFeatureFlagFromSerializedValue(e) {
|
|
14
|
-
if (e[FeatureFlag.bs.qs] && "boolean" == typeof e[FeatureFlag.bs.
|
|
14
|
+
if (e[FeatureFlag.bs.qs] && "boolean" == typeof e[FeatureFlag.bs.Jr])
|
|
15
15
|
return new FeatureFlag(
|
|
16
16
|
e[FeatureFlag.bs.qs],
|
|
17
|
+
e[FeatureFlag.bs.Jr],
|
|
17
18
|
e[FeatureFlag.bs.Nr],
|
|
18
19
|
e[FeatureFlag.bs.Or],
|
|
19
|
-
e[FeatureFlag.bs.Qr],
|
|
20
20
|
);
|
|
21
21
|
b.info(
|
|
22
22
|
`Unable to deserialize feature flag from ${JSON.stringify(e, null, 2)}`,
|
|
@@ -13,12 +13,12 @@ export default class FeatureFlag extends D {
|
|
|
13
13
|
const s = {};
|
|
14
14
|
return (
|
|
15
15
|
(s[FeatureFlag.bs.qs] = this.id),
|
|
16
|
-
(s[FeatureFlag.bs.
|
|
17
|
-
(s[FeatureFlag.bs.
|
|
18
|
-
(s[FeatureFlag.bs.
|
|
16
|
+
(s[FeatureFlag.bs.Jr] = this.enabled),
|
|
17
|
+
(s[FeatureFlag.bs.Nr] = this.properties),
|
|
18
|
+
(s[FeatureFlag.bs.Or] = this.trackingString),
|
|
19
19
|
s
|
|
20
20
|
);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
(FeatureFlag.bs = { qs: "id",
|
|
24
|
-
(FeatureFlag.ei = { qs: "id",
|
|
23
|
+
(FeatureFlag.bs = { qs: "id", Jr: "e", Nr: "pr", Or: "fts" }),
|
|
24
|
+
(FeatureFlag.ei = { qs: "id", Jr: "enabled", Nr: "properties", Or: "fts" });
|
|
@@ -6,7 +6,14 @@ const lr = {
|
|
|
6
6
|
o: () => (
|
|
7
7
|
lr.t(),
|
|
8
8
|
lr.provider ||
|
|
9
|
-
((lr.provider = new ar(r.l(), r.m(), r.p(), r.u())),
|
|
9
|
+
((lr.provider = new ar(r.l(), r.m(), r.p(), r.u())),
|
|
10
|
+
r.v(lr.provider),
|
|
11
|
+
r.ar("ffr", () => {
|
|
12
|
+
var r;
|
|
13
|
+
null === (r = lr.provider) ||
|
|
14
|
+
void 0 === r ||
|
|
15
|
+
r.refreshFeatureFlags(void 0, void 0, !1, !0, "dust");
|
|
16
|
+
})),
|
|
10
17
|
lr.provider
|
|
11
18
|
),
|
|
12
19
|
t: () => {
|
|
@@ -11,8 +11,8 @@ import {
|
|
|
11
11
|
} from "../common/constants.js";
|
|
12
12
|
import l from "../util/net.js";
|
|
13
13
|
import {
|
|
14
|
-
newFeatureFlagFromJson as
|
|
15
|
-
newFeatureFlagFromSerializedValue as
|
|
14
|
+
newFeatureFlagFromJson as ut,
|
|
15
|
+
newFeatureFlagFromSerializedValue as ft,
|
|
16
16
|
} from "./feature-flag-factory.js";
|
|
17
17
|
import h from "../util/request-header-utils.js";
|
|
18
18
|
export default class ar extends t {
|
|
@@ -22,124 +22,124 @@ export default class ar extends t {
|
|
|
22
22
|
(this.B = s),
|
|
23
23
|
(this.j = i),
|
|
24
24
|
(this.C = e),
|
|
25
|
-
(this.
|
|
26
|
-
(this.
|
|
25
|
+
(this.Rr = []),
|
|
26
|
+
(this.Ur = 0),
|
|
27
27
|
(this.h = t),
|
|
28
28
|
(this.B = s),
|
|
29
29
|
(this.j = i),
|
|
30
30
|
(this.C = e),
|
|
31
|
-
(this.
|
|
32
|
-
(this.
|
|
31
|
+
(this.Xr = null),
|
|
32
|
+
(this.Gr = new f()),
|
|
33
33
|
(this.D = 10),
|
|
34
34
|
(this.N = null),
|
|
35
35
|
(this.F = null),
|
|
36
|
-
r.S(this.
|
|
36
|
+
r.S(this.Gr);
|
|
37
37
|
}
|
|
38
38
|
q(t) {
|
|
39
39
|
var s;
|
|
40
40
|
if (
|
|
41
|
-
(null === (s = this.h) || void 0 === s ? void 0 : s.
|
|
41
|
+
(null === (s = this.h) || void 0 === s ? void 0 : s.Kr()) &&
|
|
42
42
|
null != t &&
|
|
43
43
|
t.feature_flags
|
|
44
44
|
) {
|
|
45
|
-
this.
|
|
45
|
+
this.Rr = [];
|
|
46
46
|
for (const s of t.feature_flags) {
|
|
47
|
-
const t =
|
|
48
|
-
t && this.
|
|
47
|
+
const t = ut(s);
|
|
48
|
+
t && this.Rr.push(t);
|
|
49
49
|
}
|
|
50
|
-
(this.
|
|
50
|
+
(this.Ur = new Date().getTime()), this.Lr(), this.Gr.A(this.Rr);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
|
|
53
|
+
Qr() {
|
|
54
54
|
let t = {};
|
|
55
|
-
this.j && (t = this.j.St(s.It.
|
|
55
|
+
this.j && (t = this.j.St(s.It.Vr));
|
|
56
56
|
const i = {};
|
|
57
57
|
for (const s in t) {
|
|
58
|
-
const e =
|
|
58
|
+
const e = ft(t[s]);
|
|
59
59
|
e && (i[e.id] = e);
|
|
60
60
|
}
|
|
61
61
|
return i;
|
|
62
62
|
}
|
|
63
|
-
|
|
63
|
+
Yr() {
|
|
64
64
|
var t;
|
|
65
65
|
return (
|
|
66
|
-
(null === (t = this.j) || void 0 === t ? void 0 : t.St(s.It.
|
|
66
|
+
(null === (t = this.j) || void 0 === t ? void 0 : t.St(s.It.Zr)) || {}
|
|
67
67
|
);
|
|
68
68
|
}
|
|
69
|
-
|
|
70
|
-
this.j && this.j.Pt(s.It.
|
|
69
|
+
ho(t) {
|
|
70
|
+
this.j && this.j.Pt(s.It.Zr, t);
|
|
71
71
|
}
|
|
72
72
|
Kt(t) {
|
|
73
|
-
return this.
|
|
73
|
+
return this.Gr.Ut(t);
|
|
74
74
|
}
|
|
75
|
-
refreshFeatureFlags(t, s, i = !1, e = !0) {
|
|
76
|
-
const
|
|
77
|
-
"function" == typeof s && s(), this.
|
|
75
|
+
refreshFeatureFlags(t, s, i = !1, e = !0, r = "sdk") {
|
|
76
|
+
const o = () => {
|
|
77
|
+
"function" == typeof s && s(), this.Gr.A(this.Rr);
|
|
78
78
|
};
|
|
79
|
-
if (!this.
|
|
79
|
+
if (!this.lo(i, r))
|
|
80
80
|
return (
|
|
81
|
-
!this.
|
|
81
|
+
!this.Xr &&
|
|
82
82
|
this.h &&
|
|
83
|
-
(this.
|
|
84
|
-
this.refreshFeatureFlags(t, s);
|
|
83
|
+
(this.Xr = this.h.do(() => {
|
|
84
|
+
this.refreshFeatureFlags(t, s, !1, !0, r);
|
|
85
85
|
})),
|
|
86
|
-
void
|
|
86
|
+
void o()
|
|
87
87
|
);
|
|
88
|
-
const
|
|
89
|
-
if (!
|
|
88
|
+
const n = this.B;
|
|
89
|
+
if (!n) return void o();
|
|
90
90
|
e && this.Y();
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
let
|
|
94
|
-
|
|
95
|
-
|
|
91
|
+
const u = n.Z({}, !0),
|
|
92
|
+
f = n.tt(u, h.it.vo, r);
|
|
93
|
+
let v = !1;
|
|
94
|
+
n.et(
|
|
95
|
+
u,
|
|
96
96
|
(e = -1) => {
|
|
97
|
-
const
|
|
98
|
-
if (!
|
|
99
|
-
const
|
|
100
|
-
h.nt(this.j, h.it.
|
|
101
|
-
-1 !== e &&
|
|
97
|
+
const n = this.B;
|
|
98
|
+
if (!n) return void o();
|
|
99
|
+
const g = new Date().valueOf();
|
|
100
|
+
h.nt(this.j, h.it.vo, g),
|
|
101
|
+
-1 !== e && f.push(["X-Braze-Req-Tokens-Remaining", e.toString()]),
|
|
102
102
|
l.ot({
|
|
103
|
-
url: `${
|
|
104
|
-
headers:
|
|
105
|
-
data:
|
|
103
|
+
url: `${n.ht()}/feature_flags/sync`,
|
|
104
|
+
headers: f,
|
|
105
|
+
data: u,
|
|
106
106
|
lt: (s) => {
|
|
107
|
-
if (!
|
|
108
|
-
|
|
107
|
+
if (!n.ut(u, s, f)) return (v = !0), void o();
|
|
108
|
+
n.ct(), this.q(s), (v = !1), "function" == typeof t && t();
|
|
109
109
|
},
|
|
110
110
|
error: (t) => {
|
|
111
|
-
|
|
111
|
+
n.dt(t, "retrieving feature flags"), (v = !0), o();
|
|
112
112
|
},
|
|
113
|
-
ft: (e,
|
|
114
|
-
var
|
|
115
|
-
let
|
|
116
|
-
if (
|
|
113
|
+
ft: (e, o) => {
|
|
114
|
+
var l, u, f;
|
|
115
|
+
let g;
|
|
116
|
+
if (v) {
|
|
117
117
|
const t =
|
|
118
|
-
(null === (
|
|
118
|
+
(null === (l = this.h) || void 0 === l ? void 0 : l.vt()) ||
|
|
119
119
|
d,
|
|
120
120
|
s =
|
|
121
|
-
(null === (
|
|
121
|
+
(null === (u = this.h) || void 0 === u ? void 0 : u.gt()) ||
|
|
122
122
|
m,
|
|
123
123
|
i =
|
|
124
|
-
(null === (
|
|
124
|
+
(null === (f = this.h) || void 0 === f ? void 0 : f.bt()) ||
|
|
125
125
|
c;
|
|
126
126
|
let e = this.N;
|
|
127
|
-
(null == e || e < t) && (e = t), (
|
|
127
|
+
(null == e || e < t) && (e = t), (g = Math.min(i, a(t, e * s)));
|
|
128
128
|
}
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
n.yt(
|
|
130
|
+
o,
|
|
131
131
|
() => {
|
|
132
|
-
this.refreshFeatureFlags(t, s, i, !0);
|
|
132
|
+
this.refreshFeatureFlags(t, s, i, !0, r);
|
|
133
133
|
},
|
|
134
|
-
h.it.
|
|
134
|
+
h.it.vo,
|
|
135
135
|
(t) => this.Bt(t),
|
|
136
136
|
() => this.Y(),
|
|
137
|
-
|
|
137
|
+
g,
|
|
138
138
|
);
|
|
139
139
|
},
|
|
140
140
|
});
|
|
141
141
|
},
|
|
142
|
-
h.it.
|
|
142
|
+
h.it.vo,
|
|
143
143
|
s,
|
|
144
144
|
);
|
|
145
145
|
}
|
|
@@ -149,49 +149,49 @@ export default class ar extends t {
|
|
|
149
149
|
Bt(t) {
|
|
150
150
|
this.Y(), (this.F = t);
|
|
151
151
|
}
|
|
152
|
-
|
|
152
|
+
lo(t, s = "sdk") {
|
|
153
153
|
if (!this.h) return !1;
|
|
154
|
-
if (!t) {
|
|
155
|
-
const t = this.h.
|
|
154
|
+
if (!t && "dust" !== s) {
|
|
155
|
+
const t = this.h.Fo();
|
|
156
156
|
if (null == t) return !1;
|
|
157
157
|
let s = !1;
|
|
158
158
|
if (!isNaN(t)) {
|
|
159
159
|
if (-1 === t) return b.info("Feature flag refreshes not allowed"), !1;
|
|
160
|
-
s = new Date().getTime() >= (this.
|
|
160
|
+
s = new Date().getTime() >= (this.Ur || 0) + 1e3 * t;
|
|
161
161
|
}
|
|
162
162
|
if (!s)
|
|
163
163
|
return (
|
|
164
164
|
b.info(`Feature flag refreshes were rate limited to ${t} seconds`), !1
|
|
165
165
|
);
|
|
166
166
|
}
|
|
167
|
-
return this.h.
|
|
167
|
+
return this.h.Kr();
|
|
168
168
|
}
|
|
169
|
-
|
|
169
|
+
po() {
|
|
170
170
|
var t;
|
|
171
171
|
return (
|
|
172
|
-
(null === (t = this.j) || void 0 === t ? void 0 : t.St(s.It.
|
|
172
|
+
(null === (t = this.j) || void 0 === t ? void 0 : t.St(s.It.jo)) || null
|
|
173
173
|
);
|
|
174
174
|
}
|
|
175
|
-
|
|
175
|
+
wo() {
|
|
176
176
|
var t, i;
|
|
177
177
|
null === (t = this.j) ||
|
|
178
178
|
void 0 === t ||
|
|
179
|
-
t.Pt(s.It.
|
|
179
|
+
t.Pt(s.It.jo, null === (i = this.C) || void 0 === i ? void 0 : i.$t());
|
|
180
180
|
}
|
|
181
|
-
|
|
181
|
+
yo() {
|
|
182
182
|
var t;
|
|
183
183
|
const s = null === (t = this.C) || void 0 === t ? void 0 : t.$t(),
|
|
184
|
-
i = this.
|
|
184
|
+
i = this.po();
|
|
185
185
|
return null == i || s === i;
|
|
186
186
|
}
|
|
187
|
-
|
|
187
|
+
Lr() {
|
|
188
188
|
if (!this.j) return;
|
|
189
189
|
const t = {};
|
|
190
|
-
for (const s of this.
|
|
190
|
+
for (const s of this.Rr) {
|
|
191
191
|
const i = s.qt();
|
|
192
192
|
t[s.id] = i;
|
|
193
193
|
}
|
|
194
|
-
this.j.Pt(s.It.
|
|
194
|
+
this.j.Pt(s.It.Vr, t), this.j.Pt(s.It.bo, this.Ur), this.wo();
|
|
195
195
|
}
|
|
196
196
|
changeUser() {
|
|
197
197
|
this.Y();
|
|
@@ -3,7 +3,7 @@ import lr from "./feature-flags-provider-factory.js";
|
|
|
3
3
|
export function getFeatureFlag(t) {
|
|
4
4
|
if (!r.rr()) return;
|
|
5
5
|
const e = r.l();
|
|
6
|
-
if (e && !e.
|
|
7
|
-
const n = lr.o().
|
|
6
|
+
if (e && !e.Kr()) return null;
|
|
7
|
+
const n = lr.o().Qr();
|
|
8
8
|
return n[t] ? n[t] : null;
|
|
9
9
|
}
|
|
@@ -7,11 +7,11 @@ export function logFeatureFlagImpression(e) {
|
|
|
7
7
|
if (!e) return !1;
|
|
8
8
|
const t =
|
|
9
9
|
"Not logging a feature flag impression. The feature flag was not part of any matching experiment.",
|
|
10
|
-
o = lr.o().
|
|
10
|
+
o = lr.o().Qr();
|
|
11
11
|
if (!o[e]) return b.info(t), !1;
|
|
12
12
|
const n = o[e].trackingString;
|
|
13
13
|
if (!n) return b.info(t), !1;
|
|
14
|
-
const i = lr.o().
|
|
14
|
+
const i = lr.o().Yr();
|
|
15
15
|
if (i[n])
|
|
16
16
|
return (
|
|
17
17
|
b.info(
|
|
@@ -19,7 +19,7 @@ export function logFeatureFlagImpression(e) {
|
|
|
19
19
|
),
|
|
20
20
|
!1
|
|
21
21
|
);
|
|
22
|
-
(i[n] = !0), lr.o().
|
|
22
|
+
(i[n] = !0), lr.o().ho(i);
|
|
23
23
|
const s = { fid: e, fts: n };
|
|
24
24
|
return v.Dt(p.xo, s).lt;
|
|
25
25
|
}
|
|
@@ -4,7 +4,7 @@ import { getAllFeatureFlags } from "./get-all-feature-flags.js";
|
|
|
4
4
|
export function subscribeToFeatureFlagsUpdates(t) {
|
|
5
5
|
if (!r.rr()) return;
|
|
6
6
|
const e = lr.o();
|
|
7
|
-
if (e.
|
|
7
|
+
if (e.yo()) {
|
|
8
8
|
const r = getAllFeatureFlags();
|
|
9
9
|
r && "function" == typeof t && t(r);
|
|
10
10
|
}
|
|
@@ -2,12 +2,12 @@ import InAppMessage from "./models/in-app-message.js";
|
|
|
2
2
|
import r from "../managers/braze-instance.js";
|
|
3
3
|
import ControlMessage from "./models/control-message.js";
|
|
4
4
|
import { logger as b } from "../../shared-lib/index.js";
|
|
5
|
-
import
|
|
5
|
+
import se from "./in-app-message-manager-factory.js";
|
|
6
6
|
export function deferInAppMessage(e) {
|
|
7
7
|
if (r.rr())
|
|
8
8
|
return e instanceof ControlMessage
|
|
9
9
|
? (b.info("Not deferring since this is a ControlMessage."), !1)
|
|
10
10
|
: e instanceof InAppMessage
|
|
11
|
-
?
|
|
11
|
+
? se.ra().An(e)
|
|
12
12
|
: (b.info("Not an instance of InAppMessage, ignoring."), !1);
|
|
13
13
|
}
|
|
@@ -2,7 +2,7 @@ import FullScreenMessage from "../models/full-screen-message.js";
|
|
|
2
2
|
import HtmlMessage from "../models/html-message.js";
|
|
3
3
|
import ModalMessage from "../models/modal-message.js";
|
|
4
4
|
import SlideUpMessage from "../models/slide-up-message.js";
|
|
5
|
-
export default function
|
|
5
|
+
export default function me(e) {
|
|
6
6
|
let s = "";
|
|
7
7
|
return (
|
|
8
8
|
e.animateIn && (s += " ab-animate-in"),
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { parseQueryStringKeyValues as
|
|
1
|
+
import { parseQueryStringKeyValues as pt } from "../../util/url-utils.js";
|
|
2
2
|
import { WindowUtils as no } from "../../util/window-utils.js";
|
|
3
|
-
import { IamOpenTarget as
|
|
3
|
+
import { IamOpenTarget as dt } from "../constants.js";
|
|
4
4
|
import { logInAppMessageHtmlClick } from "../log-in-app-message-html-click.js";
|
|
5
5
|
export const buildHtmlClickHandler = (t, l, i, o) => {
|
|
6
6
|
const r = i.getAttribute("href"),
|
|
7
7
|
n = i.onclick;
|
|
8
8
|
return (s) => {
|
|
9
9
|
if (null != n && "function" == typeof n && !1 === n.bind(i)(s)) return;
|
|
10
|
-
let e =
|
|
10
|
+
let e = pt(r).abButtonId;
|
|
11
11
|
if (
|
|
12
12
|
((null != e && "" !== e) || (e = i.getAttribute("id") || void 0),
|
|
13
13
|
null != r && "" !== r && 0 !== r.indexOf("#"))
|
|
@@ -15,7 +15,7 @@ export const buildHtmlClickHandler = (t, l, i, o) => {
|
|
|
15
15
|
const n =
|
|
16
16
|
"blank" ===
|
|
17
17
|
(i.getAttribute("target") || "").toLowerCase().replace("_", ""),
|
|
18
|
-
u = o || t.openTarget ===
|
|
18
|
+
u = o || t.openTarget === dt.BLANK || n,
|
|
19
19
|
m = () => {
|
|
20
20
|
logInAppMessageHtmlClick(t, e, r), no.openUri(r, u, s);
|
|
21
21
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import ro from "../../util/browser-detector.js";
|
|
2
2
|
import { logInAppMessageHtmlClick } from "../index.js";
|
|
3
3
|
import { OperatingSystems as so } from "../../util/device-constants.js";
|
|
4
|
-
import { buildHtmlClickHandler as
|
|
4
|
+
import { buildHtmlClickHandler as bt } from "./html-message-display-utils.js";
|
|
5
5
|
import { attachHtmlToIframeWithNonce as N } from "../../util/html-display-utils.js";
|
|
6
6
|
import { buildBrazeBridge as E } from "../../util/html-display-utils.js";
|
|
7
|
-
import { IamServerTypes as
|
|
8
|
-
export default function
|
|
7
|
+
import { IamServerTypes as gt } from "../constants.js";
|
|
8
|
+
export default function jt(t, o, s, e, n) {
|
|
9
9
|
const i = document.createElement("iframe");
|
|
10
10
|
i.setAttribute("title", "Modal Message"),
|
|
11
11
|
e && (i.style.zIndex = (e + 1).toString());
|
|
@@ -19,7 +19,7 @@ export default function ft(t, o, s, e, n) {
|
|
|
19
19
|
if (t.Mo()) {
|
|
20
20
|
const o = document.createElement("style");
|
|
21
21
|
(o.innerHTML = t.css || ""),
|
|
22
|
-
(o.id = t.
|
|
22
|
+
(o.id = t.Co() || ""),
|
|
23
23
|
null != n && o.setAttribute("nonce", n),
|
|
24
24
|
a.appendChild(o);
|
|
25
25
|
}
|
|
@@ -42,15 +42,15 @@ export default function ft(t, o, s, e, n) {
|
|
|
42
42
|
},
|
|
43
43
|
},
|
|
44
44
|
);
|
|
45
|
-
if (((e.appboyBridge = r), (e.brazeBridge = r), t.
|
|
45
|
+
if (((e.appboyBridge = r), (e.brazeBridge = r), t.Oo !== gt.CE)) {
|
|
46
46
|
const o = e.document.getElementsByTagName("a");
|
|
47
|
-
for (let e = 0; e < o.length; e++) o[e].onclick =
|
|
47
|
+
for (let e = 0; e < o.length; e++) o[e].onclick = bt(t, i, o[e], s);
|
|
48
48
|
const n = e.document.getElementsByTagName("button");
|
|
49
|
-
for (let o = 0; o < n.length; o++) n[o].onclick =
|
|
49
|
+
for (let o = 0; o < n.length; o++) n[o].onclick = bt(t, i, n[o], s);
|
|
50
50
|
}
|
|
51
51
|
const c = e.document.body;
|
|
52
52
|
if (null != c) {
|
|
53
|
-
t.
|
|
53
|
+
t.ko() && (c.id = t.htmlId || "");
|
|
54
54
|
const o = document.createElement("hidden");
|
|
55
55
|
(o.onclick = r.closeMessage),
|
|
56
56
|
(o.className = "ab-programmatic-close-button"),
|
|
@@ -66,8 +66,8 @@ export default function ft(t, o, s, e, n) {
|
|
|
66
66
|
) {
|
|
67
67
|
const o = document.createElement("div");
|
|
68
68
|
return (
|
|
69
|
-
(o.className = "ab-ios-scroll-wrapper"), o.appendChild(i), (t.
|
|
69
|
+
(o.className = "ab-ios-scroll-wrapper"), o.appendChild(i), (t.Bo = o), o
|
|
70
70
|
);
|
|
71
71
|
}
|
|
72
|
-
return (t.
|
|
72
|
+
return (t.Bo = i), i;
|
|
73
73
|
}
|