@braze/web-sdk 4.6.3 → 4.7.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 +13 -8
- package/package.json +1 -1
- package/shared-lib/braze-shared-lib.js +2 -2
- package/shared-lib/encoding-utils.js +1 -1
- package/shared-lib/event-types.js +18 -17
- package/shared-lib/indexed-db-adapter.js +2 -2
- package/shared-lib/logger.js +2 -2
- package/shared-lib/supported-options.js +15 -15
- package/src/Core/handle-braze-action.js +40 -34
- package/src/Core/log-custom-event.js +2 -7
- package/src/Core/log-purchase.js +3 -3
- package/src/Core/wipe-data.js +2 -2
- package/src/FeatureFlags/feature-flag.js +33 -16
- package/src/FeatureFlags/feature-flags-provider.js +86 -75
- package/src/FeatureFlags/get-all-feature-flags.js +5 -5
- package/src/FeatureFlags/get-feature-flag.js +6 -6
- package/src/FeatureFlags/refresh-feature-flags.js +1 -1
- package/src/FeatureFlags/types.js +1 -0
- package/src/Feed/feed-provider.js +17 -17
- package/src/Feed/get-cached-feed.js +1 -1
- package/src/Feed/ui/show-feed.js +1 -1
- package/src/InAppMessage/display/html-message-to-html.js +135 -120
- package/src/InAppMessage/display/in-app-message-to-html.js +21 -21
- package/src/InAppMessage/display/modal-utils.js +6 -6
- package/src/InAppMessage/in-app-message-factory.js +3 -3
- package/src/InAppMessage/in-app-message-manager-factory.js +3 -3
- package/src/InAppMessage/in-app-message-manager.js +65 -65
- package/src/InAppMessage/log-in-app-message-button-click.js +4 -4
- package/src/InAppMessage/log-in-app-message-click.js +4 -4
- package/src/InAppMessage/log-in-app-message-html-click.js +3 -3
- package/src/InAppMessage/log-in-app-message-impression.js +3 -3
- package/src/InAppMessage/models/full-screen-message.js +1 -1
- package/src/InAppMessage/models/html-message.js +1 -1
- package/src/InAppMessage/models/in-app-message-button.js +4 -4
- package/src/InAppMessage/models/in-app-message.js +80 -80
- package/src/InAppMessage/models/modal-message.js +2 -2
- package/src/InAppMessage/models/slide-up-message.js +8 -8
- package/src/InAppMessage/models/templated-in-app-message.js +4 -4
- 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 +20 -20
- package/src/Push/push-manager.js +216 -209
- package/src/Push/utils/push-utils.js +4 -4
- package/src/User/user-manager.js +11 -8
- package/src/User/user.js +52 -41
- package/src/common/base-feed.js +1 -1
- package/src/common/base-provider.js +1 -1
- package/src/common/constants.js +2 -0
- package/src/common/feed-display.js +6 -6
- package/src/l10n/l10n-manager-factory.js +1 -1
- package/src/managers/auth-manager.js +24 -24
- package/src/managers/braze-instance.js +120 -120
- package/src/managers/device-manager.js +11 -11
- package/src/managers/network-manager.js +63 -54
- package/src/managers/server-config-manager.js +20 -20
- package/src/managers/session-manager.js +29 -29
- package/src/managers/storage-manager-factory.js +4 -4
- package/src/managers/storage-manager.js +104 -104
- package/src/managers/subscription-manager.js +6 -6
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +7 -7
- package/src/models/device.js +1 -1
- package/src/models/identifier.js +6 -6
- package/src/models/push-token.js +3 -3
- package/src/models/server-config.js +15 -15
- package/src/request-controller.js +92 -88
- package/src/triggers/models/custom-event-data.js +4 -4
- package/src/triggers/models/custom-event-property-data.js +9 -9
- package/src/triggers/models/filter-set.js +9 -9
- package/src/triggers/models/filter.js +63 -63
- package/src/triggers/models/in-app-message-click-data.js +5 -5
- package/src/triggers/models/purchase-data.js +3 -3
- package/src/triggers/models/purchase-property-data.js +9 -9
- package/src/triggers/models/push-click-data.js +5 -5
- package/src/triggers/models/trigger-condition.js +48 -48
- package/src/triggers/models/trigger-events.js +1 -1
- package/src/triggers/models/trigger.js +29 -29
- package/src/triggers/triggers-provider-factory.js +2 -2
- package/src/triggers/triggers-provider.js +87 -89
- package/src/ui/js/attach-css.js +1 -1
- package/src/ui/js/feed-css.js +4 -4
- package/src/ui/js/iam-css.js +4 -4
- package/src/ui/js/load-font-awesome.js +1 -1
- package/src/util/base-device-parser.js +2 -2
- package/src/util/braze-actions.js +8 -8
- package/src/util/browser-detector.js +8 -8
- package/src/util/client-hints-parser.js +3 -3
- package/src/util/code-utils.js +10 -3
- package/src/util/component-utils.js +1 -1
- package/src/util/date-utils.js +2 -2
- package/src/util/device-constants.js +1 -1
- package/src/util/dom-utils.js +9 -9
- package/src/util/key-codes.js +1 -1
- package/src/util/net.js +3 -3
- package/src/util/user-agent-parser.js +4 -4
- package/src/util/validation-utils.js +155 -74
- package/src/util/window-utils.js +1 -1
|
@@ -12,11 +12,11 @@ import r from "../../shared-lib/braze-shared-lib.js";
|
|
|
12
12
|
import u from "../managers/subscription-manager.js";
|
|
13
13
|
import pt from "../triggers/models/trigger.js";
|
|
14
14
|
import { validateValueIsFromEnum as F } from "../util/code-utils.js";
|
|
15
|
-
import { BRAZE_ACTION_URI_REGEX as
|
|
15
|
+
import { BRAZE_ACTION_URI_REGEX as J } from "../util/validation-utils.js";
|
|
16
16
|
import {
|
|
17
17
|
containsPushPrimerBrazeAction as mt,
|
|
18
18
|
containsUnknownBrazeAction as gt,
|
|
19
|
-
getDecodedBrazeAction as
|
|
19
|
+
getDecodedBrazeAction as _,
|
|
20
20
|
ineligibleBrazeActionURLErrorMessage as ht,
|
|
21
21
|
INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES as ft
|
|
22
22
|
} from "../util/braze-actions.js";
|
|
@@ -27,27 +27,27 @@ export default class ge {
|
|
|
27
27
|
(this.j = s),
|
|
28
28
|
(this.h = i),
|
|
29
29
|
(this.v = r),
|
|
30
|
-
(this.
|
|
31
|
-
e.jt(this.
|
|
32
|
-
(this.
|
|
33
|
-
(this.
|
|
30
|
+
(this.Se = new u()),
|
|
31
|
+
e.jt(this.Se),
|
|
32
|
+
(this.Oe = 1e3),
|
|
33
|
+
(this.Re = 6e4);
|
|
34
34
|
}
|
|
35
|
-
|
|
36
|
-
return this.
|
|
35
|
+
Qe() {
|
|
36
|
+
return this.Se;
|
|
37
37
|
}
|
|
38
|
-
|
|
39
|
-
return this.
|
|
38
|
+
Ue(t) {
|
|
39
|
+
return this.Se.ut(t);
|
|
40
40
|
}
|
|
41
|
-
|
|
42
|
-
return this.
|
|
41
|
+
Ve() {
|
|
42
|
+
return this.We;
|
|
43
43
|
}
|
|
44
|
-
|
|
45
|
-
this.
|
|
44
|
+
Xe(t) {
|
|
45
|
+
this.We = t;
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
Ye(e, i) {
|
|
48
48
|
if (
|
|
49
49
|
!F(
|
|
50
|
-
InAppMessage.
|
|
50
|
+
InAppMessage.Me,
|
|
51
51
|
i,
|
|
52
52
|
`${i} is not a valid in-app message display failure`,
|
|
53
53
|
"InAppMessage.DisplayFailures"
|
|
@@ -55,14 +55,14 @@ export default class ge {
|
|
|
55
55
|
)
|
|
56
56
|
return new t();
|
|
57
57
|
const n = { trigger_ids: [e], error_code: i };
|
|
58
|
-
return s.G(r.A.
|
|
58
|
+
return s.G(r.A.Ze, n);
|
|
59
59
|
}
|
|
60
60
|
G(e, i, n, o) {
|
|
61
61
|
const a = new t();
|
|
62
62
|
let l;
|
|
63
63
|
if (e instanceof ControlMessage) l = { trigger_ids: [e.triggerId] };
|
|
64
64
|
else {
|
|
65
|
-
if (i === r.A.
|
|
65
|
+
if (i === r.A.Ii || (e instanceof HtmlMessage && i === r.A.Ai)) {
|
|
66
66
|
if (!e.k(o))
|
|
67
67
|
return (
|
|
68
68
|
r.D.info(
|
|
@@ -70,7 +70,7 @@ export default class ge {
|
|
|
70
70
|
),
|
|
71
71
|
a
|
|
72
72
|
);
|
|
73
|
-
} else if (i === r.A.
|
|
73
|
+
} else if (i === r.A.Mi) {
|
|
74
74
|
if (!e.R())
|
|
75
75
|
return (
|
|
76
76
|
r.D.info(
|
|
@@ -79,11 +79,11 @@ export default class ge {
|
|
|
79
79
|
a
|
|
80
80
|
);
|
|
81
81
|
}
|
|
82
|
-
l = this.
|
|
82
|
+
l = this.zi(e);
|
|
83
83
|
}
|
|
84
84
|
return null == l ? a : (null != n && (l.bid = n), s.G(i, l));
|
|
85
85
|
}
|
|
86
|
-
|
|
86
|
+
ki(e, i) {
|
|
87
87
|
const n = new t();
|
|
88
88
|
if (!e.k())
|
|
89
89
|
return (
|
|
@@ -92,82 +92,82 @@ export default class ge {
|
|
|
92
92
|
),
|
|
93
93
|
n
|
|
94
94
|
);
|
|
95
|
-
const o = this.
|
|
95
|
+
const o = this.zi(i);
|
|
96
96
|
return null == o
|
|
97
97
|
? n
|
|
98
|
-
: e.id === InAppMessageButton
|
|
98
|
+
: e.id === InAppMessageButton.$i
|
|
99
99
|
? (r.D.info(
|
|
100
100
|
"This in-app message button does not have a tracking id. Not logging event to Braze servers."
|
|
101
101
|
),
|
|
102
102
|
n)
|
|
103
|
-
: (null != e.id && (o.bid = e.id), s.G(r.A.
|
|
103
|
+
: (null != e.id && (o.bid = e.id), s.G(r.A.Ai, o));
|
|
104
104
|
}
|
|
105
|
-
|
|
105
|
+
Bi(t) {
|
|
106
106
|
if (!(t instanceof InAppMessage)) return;
|
|
107
|
-
const
|
|
108
|
-
const
|
|
109
|
-
return gt(
|
|
110
|
-
? ht(ft.
|
|
111
|
-
: mt(
|
|
112
|
-
? ht(ft.
|
|
107
|
+
const e = t => {
|
|
108
|
+
const e = _(t);
|
|
109
|
+
return gt(e)
|
|
110
|
+
? ht(ft.Ei, "In-App Message")
|
|
111
|
+
: mt(e) && !dt.Gi()
|
|
112
|
+
? ht(ft.Ni, "In-App Message")
|
|
113
113
|
: void 0;
|
|
114
114
|
},
|
|
115
|
-
|
|
115
|
+
s = t.buttons;
|
|
116
116
|
let i;
|
|
117
|
-
for (const t of
|
|
117
|
+
for (const t of s)
|
|
118
118
|
if (
|
|
119
119
|
t.clickAction === InAppMessage.ClickAction.URI &&
|
|
120
|
-
|
|
121
|
-
((i =
|
|
120
|
+
J.test(t.uri) &&
|
|
121
|
+
((i = e(t.uri)), i)
|
|
122
122
|
)
|
|
123
123
|
return i;
|
|
124
|
-
return t.clickAction === InAppMessage.ClickAction.URI &&
|
|
125
|
-
?
|
|
124
|
+
return t.clickAction === InAppMessage.ClickAction.URI && J.test(t.uri)
|
|
125
|
+
? e(t.uri)
|
|
126
126
|
: void 0;
|
|
127
127
|
}
|
|
128
|
-
|
|
129
|
-
let n = this.vt.
|
|
128
|
+
qi(t, e, s, i) {
|
|
129
|
+
let n = this.vt.Oi(!1, !1);
|
|
130
130
|
(n = this.vt.Ps(n)),
|
|
131
|
-
(n.template = { trigger_id: t.triggerId, trigger_event_type:
|
|
132
|
-
null !=
|
|
131
|
+
(n.template = { trigger_id: t.triggerId, trigger_event_type: e }),
|
|
132
|
+
null != s && (n.template.data = s.Pi());
|
|
133
133
|
const o = this.vt.Bs(n);
|
|
134
134
|
this.vt.Gs(n, () => {
|
|
135
135
|
b.Hs({
|
|
136
136
|
url: `${this.vt.Ks()}/template/`,
|
|
137
137
|
data: n,
|
|
138
138
|
headers: o,
|
|
139
|
-
S:
|
|
140
|
-
if (!this.vt.Os(n,
|
|
139
|
+
S: e => {
|
|
140
|
+
if (!this.vt.Os(n, e, o))
|
|
141
141
|
return (
|
|
142
|
-
this.
|
|
143
|
-
void ("function" == typeof t.
|
|
142
|
+
this.Ye(t.triggerId, InAppMessage.Me.Ri),
|
|
143
|
+
void ("function" == typeof t.Hi && t.Hi())
|
|
144
144
|
);
|
|
145
|
-
if ((this.vt.Qs(), null ==
|
|
146
|
-
return void this.
|
|
147
|
-
const
|
|
148
|
-
if (
|
|
149
|
-
return void this.
|
|
150
|
-
const i = lt(
|
|
151
|
-
if (null == i) return void this.
|
|
152
|
-
let a = this.
|
|
145
|
+
if ((this.vt.Qs(), null == e || null == e.templated_message))
|
|
146
|
+
return void this.Ye(t.triggerId, InAppMessage.Me.Ri);
|
|
147
|
+
const s = e.templated_message;
|
|
148
|
+
if (s.type !== pt.Ki.Ji)
|
|
149
|
+
return void this.Ye(t.triggerId, InAppMessage.Me.Li);
|
|
150
|
+
const i = lt(s.data);
|
|
151
|
+
if (null == i) return void this.Ye(t.triggerId, InAppMessage.Me.Li);
|
|
152
|
+
let a = this.Bi(i);
|
|
153
153
|
if (a)
|
|
154
|
-
return r.D.error(a), void ("function" == typeof t.
|
|
155
|
-
"function" == typeof t.
|
|
156
|
-
? t.
|
|
157
|
-
: this.
|
|
154
|
+
return r.D.error(a), void ("function" == typeof t.Hi && t.Hi());
|
|
155
|
+
"function" == typeof t.Qi
|
|
156
|
+
? t.Qi(i)
|
|
157
|
+
: this.Ye(t.triggerId, InAppMessage.Me.Ri);
|
|
158
158
|
},
|
|
159
159
|
error: r => {
|
|
160
160
|
let n = `getting user personalization for message ${t.triggerId}`;
|
|
161
|
-
if (new Date().valueOf() - t.
|
|
162
|
-
this.
|
|
161
|
+
if (new Date().valueOf() - t.Ui > t.Vi)
|
|
162
|
+
this.Ye(t.triggerId, InAppMessage.Me.Ri);
|
|
163
163
|
else {
|
|
164
|
-
const r = Math.min(t.
|
|
165
|
-
o = this.
|
|
164
|
+
const r = Math.min(t.Vi, this.Re),
|
|
165
|
+
o = this.Oe;
|
|
166
166
|
null == i && (i = o);
|
|
167
167
|
const a = Math.min(r, tt(o, 3 * i));
|
|
168
168
|
(n += `. Retrying in ${a} ms`),
|
|
169
169
|
setTimeout(() => {
|
|
170
|
-
this.
|
|
170
|
+
this.qi(t, e, s, a);
|
|
171
171
|
}, a);
|
|
172
172
|
}
|
|
173
173
|
this.vt.Vs(r, n);
|
|
@@ -175,7 +175,7 @@ export default class ge {
|
|
|
175
175
|
});
|
|
176
176
|
});
|
|
177
177
|
}
|
|
178
|
-
|
|
178
|
+
zi(t) {
|
|
179
179
|
if (null == t.triggerId)
|
|
180
180
|
return (
|
|
181
181
|
r.D.info(
|
|
@@ -183,7 +183,7 @@ export default class ge {
|
|
|
183
183
|
),
|
|
184
184
|
null
|
|
185
185
|
);
|
|
186
|
-
const
|
|
187
|
-
return null != t.triggerId && (
|
|
186
|
+
const e = {};
|
|
187
|
+
return null != t.triggerId && (e.trigger_ids = [t.triggerId]), e;
|
|
188
188
|
}
|
|
189
189
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import e from "../managers/braze-instance.js";
|
|
2
|
-
import { MUST_BE_IN_APP_MESSAGE_WARNING as
|
|
2
|
+
import { MUST_BE_IN_APP_MESSAGE_WARNING as sr } from "../common/constants.js";
|
|
3
3
|
import InAppMessage from "./models/in-app-message.js";
|
|
4
4
|
import InAppMessageButton from "./models/in-app-message-button.js";
|
|
5
5
|
import pe from "./in-app-message-manager-factory.js";
|
|
@@ -10,10 +10,10 @@ export function logInAppMessageButtonClick(t, o) {
|
|
|
10
10
|
if (!e.rr()) return !1;
|
|
11
11
|
if (!(t instanceof InAppMessageButton))
|
|
12
12
|
return r.D.error("button must be an InAppMessageButton object"), !1;
|
|
13
|
-
if (!(o instanceof InAppMessage)) return r.D.error(
|
|
14
|
-
const s = pe.m().
|
|
13
|
+
if (!(o instanceof InAppMessage)) return r.D.error(sr), !1;
|
|
14
|
+
const s = pe.m().ki(t, o);
|
|
15
15
|
if (s.S)
|
|
16
16
|
for (let r = 0; r < s.ve.length; r++)
|
|
17
|
-
W.er().je(V.
|
|
17
|
+
W.er().je(V.Mr, [o.triggerId, t.id], s.ve[r]);
|
|
18
18
|
return s.S;
|
|
19
19
|
}
|
|
@@ -2,18 +2,18 @@ import e from "../managers/braze-instance.js";
|
|
|
2
2
|
import InAppMessage from "./models/in-app-message.js";
|
|
3
3
|
import pe from "./in-app-message-manager-factory.js";
|
|
4
4
|
import { logInAppMessageImpression } from "./log-in-app-message-impression.js";
|
|
5
|
-
import { MUST_BE_IN_APP_MESSAGE_WARNING as
|
|
5
|
+
import { MUST_BE_IN_APP_MESSAGE_WARNING as sr } from "../common/constants.js";
|
|
6
6
|
import r from "../../shared-lib/braze-shared-lib.js";
|
|
7
7
|
import V from "../triggers/models/trigger-events.js";
|
|
8
8
|
import { TriggersProviderFactory as W } from "../triggers/triggers-provider-factory.js";
|
|
9
9
|
export function logInAppMessageClick(o) {
|
|
10
10
|
if (!e.rr()) return !1;
|
|
11
|
-
if (!(o instanceof InAppMessage)) return r.D.error(
|
|
12
|
-
const s = pe.m().G(o, r.A.
|
|
11
|
+
if (!(o instanceof InAppMessage)) return r.D.error(sr), !1;
|
|
12
|
+
const s = pe.m().G(o, r.A.Ii);
|
|
13
13
|
if (s) {
|
|
14
14
|
o.Cr() || logInAppMessageImpression(o);
|
|
15
15
|
for (let r = 0; r < s.ve.length; r++)
|
|
16
|
-
W.er().je(V.
|
|
16
|
+
W.er().je(V.Mr, [o.triggerId], s.ve[r]);
|
|
17
17
|
}
|
|
18
18
|
return s.S;
|
|
19
19
|
}
|
|
@@ -13,11 +13,11 @@ export function logInAppMessageHtmlClick(s, t, o) {
|
|
|
13
13
|
),
|
|
14
14
|
!1
|
|
15
15
|
);
|
|
16
|
-
let m = r.A.
|
|
17
|
-
null != t && (m = r.A.
|
|
16
|
+
let m = r.A.Ii;
|
|
17
|
+
null != t && (m = r.A.Ai);
|
|
18
18
|
const i = pe.m().G(s, m, t, o);
|
|
19
19
|
if (i.S)
|
|
20
20
|
for (let r = 0; r < i.ve.length; r++)
|
|
21
|
-
W.er().je(V.
|
|
21
|
+
W.er().je(V.Mr, [s.triggerId, t], i.ve[r]);
|
|
22
22
|
return i.S;
|
|
23
23
|
}
|
|
@@ -2,12 +2,12 @@ import e from "../managers/braze-instance.js";
|
|
|
2
2
|
import ControlMessage from "./models/control-message.js";
|
|
3
3
|
import InAppMessage from "./models/in-app-message.js";
|
|
4
4
|
import pe from "./in-app-message-manager-factory.js";
|
|
5
|
-
import { MUST_BE_IN_APP_MESSAGE_WARNING as
|
|
5
|
+
import { MUST_BE_IN_APP_MESSAGE_WARNING as sr } from "../common/constants.js";
|
|
6
6
|
import r from "../../shared-lib/braze-shared-lib.js";
|
|
7
7
|
export function logInAppMessageImpression(o) {
|
|
8
8
|
if (!e.rr()) return !1;
|
|
9
9
|
if (!(o instanceof InAppMessage || o instanceof ControlMessage))
|
|
10
|
-
return r.D.error(
|
|
11
|
-
const s = o instanceof ControlMessage ? r.A.ro : r.A.
|
|
10
|
+
return r.D.error(sr), !1;
|
|
11
|
+
const s = o instanceof ControlMessage ? r.A.ro : r.A.Mi;
|
|
12
12
|
return pe.m().G(o, s).S;
|
|
13
13
|
}
|
|
@@ -3,12 +3,12 @@ import u from "../../managers/subscription-manager.js";
|
|
|
3
3
|
export default class InAppMessageButton {
|
|
4
4
|
constructor(s, t, i, r, e, h, n) {
|
|
5
5
|
(this.text = s || ""),
|
|
6
|
-
(this.backgroundColor = t || InAppMessage.
|
|
7
|
-
(this.textColor = i || InAppMessage.
|
|
6
|
+
(this.backgroundColor = t || InAppMessage.Xi.Wi),
|
|
7
|
+
(this.textColor = i || InAppMessage.Xi.Yi),
|
|
8
8
|
(this.borderColor = r || this.backgroundColor),
|
|
9
9
|
(this.clickAction = e || InAppMessage.ClickAction.NONE),
|
|
10
10
|
(this.uri = h),
|
|
11
|
-
null == n && (n = InAppMessageButton
|
|
11
|
+
null == n && (n = InAppMessageButton.$i),
|
|
12
12
|
(this.id = n),
|
|
13
13
|
(this.nl = !1),
|
|
14
14
|
(this.lt = new u());
|
|
@@ -37,4 +37,4 @@ export default class InAppMessageButton {
|
|
|
37
37
|
);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
InAppMessageButton
|
|
40
|
+
InAppMessageButton.$i = -1;
|
|
@@ -51,95 +51,95 @@ export default class InAppMessage {
|
|
|
51
51
|
(this.icon = T),
|
|
52
52
|
(this.imageUrl = a),
|
|
53
53
|
(this.imageStyle = m || InAppMessage.ImageStyle.TOP),
|
|
54
|
-
(this.iconColor = c || InAppMessage.
|
|
55
|
-
(this.iconBackgroundColor = I || InAppMessage.
|
|
56
|
-
(this.backgroundColor = A || InAppMessage.
|
|
57
|
-
(this.textColor = N || InAppMessage.
|
|
58
|
-
(this.closeButtonColor = _ || InAppMessage.
|
|
54
|
+
(this.iconColor = c || InAppMessage.Xi.Yi),
|
|
55
|
+
(this.iconBackgroundColor = I || InAppMessage.Xi.Wi),
|
|
56
|
+
(this.backgroundColor = A || InAppMessage.Xi.Yi),
|
|
57
|
+
(this.textColor = N || InAppMessage.Xi.Zi),
|
|
58
|
+
(this.closeButtonColor = _ || InAppMessage.Xi.th),
|
|
59
59
|
(this.animateIn = L),
|
|
60
60
|
null == this.animateIn && (this.animateIn = !0),
|
|
61
61
|
(this.animateOut = d),
|
|
62
62
|
null == this.animateOut && (this.animateOut = !0),
|
|
63
63
|
(this.header = O),
|
|
64
64
|
(this.headerAlignment = S || InAppMessage.TextAlignment.CENTER),
|
|
65
|
-
(this.headerTextColor = D || InAppMessage.
|
|
66
|
-
(this.frameColor = M || InAppMessage.
|
|
65
|
+
(this.headerTextColor = D || InAppMessage.Xi.Zi),
|
|
66
|
+
(this.frameColor = M || InAppMessage.Xi.sh),
|
|
67
67
|
(this.buttons = R || []),
|
|
68
68
|
(this.cropType = b || InAppMessage.CropType.FIT_CENTER),
|
|
69
69
|
(this.orientation = P),
|
|
70
70
|
(this.htmlId = p),
|
|
71
71
|
(this.css = C),
|
|
72
72
|
(this.isControl = !1),
|
|
73
|
-
(this.
|
|
73
|
+
(this.ih = !1),
|
|
74
74
|
(this.nl = !1),
|
|
75
|
-
(this.
|
|
75
|
+
(this.eh = !1),
|
|
76
76
|
(this.lt = new u()),
|
|
77
|
-
(this.
|
|
77
|
+
(this.hh = new u());
|
|
78
78
|
}
|
|
79
79
|
subscribeToClickedEvent(t) {
|
|
80
80
|
return this.lt.ut(t);
|
|
81
81
|
}
|
|
82
82
|
subscribeToDismissedEvent(t) {
|
|
83
|
-
return this.
|
|
83
|
+
return this.hh.ut(t);
|
|
84
84
|
}
|
|
85
85
|
removeSubscription(t) {
|
|
86
|
-
this.lt.removeSubscription(t), this.
|
|
86
|
+
this.lt.removeSubscription(t), this.hh.removeSubscription(t);
|
|
87
87
|
}
|
|
88
88
|
removeAllSubscriptions() {
|
|
89
|
-
this.lt.removeAllSubscriptions(), this.
|
|
89
|
+
this.lt.removeAllSubscriptions(), this.hh.removeAllSubscriptions();
|
|
90
90
|
}
|
|
91
91
|
closeMessage() {
|
|
92
|
-
this.
|
|
92
|
+
this.he(this.qe);
|
|
93
93
|
}
|
|
94
|
-
|
|
94
|
+
xe() {
|
|
95
95
|
return !0;
|
|
96
96
|
}
|
|
97
97
|
ll() {
|
|
98
|
-
return this.
|
|
98
|
+
return this.xe();
|
|
99
99
|
}
|
|
100
|
-
|
|
100
|
+
Ee() {
|
|
101
101
|
return null != this.htmlId && this.htmlId.length > 4;
|
|
102
102
|
}
|
|
103
|
-
|
|
104
|
-
return this.
|
|
103
|
+
ye() {
|
|
104
|
+
return this.Ee() && null != this.css && this.css.length > 0;
|
|
105
105
|
}
|
|
106
|
-
|
|
107
|
-
if (this.
|
|
106
|
+
Ae() {
|
|
107
|
+
if (this.Ee() && this.ye()) return this.htmlId + "-css";
|
|
108
108
|
}
|
|
109
109
|
R() {
|
|
110
|
-
return !this.
|
|
110
|
+
return !this.ih && ((this.ih = !0), !0);
|
|
111
111
|
}
|
|
112
112
|
Cr() {
|
|
113
|
-
return this.
|
|
113
|
+
return this.ih;
|
|
114
114
|
}
|
|
115
115
|
k() {
|
|
116
116
|
return !this.nl && ((this.nl = !0), this.lt.St(), !0);
|
|
117
117
|
}
|
|
118
118
|
J() {
|
|
119
|
-
return !this.
|
|
119
|
+
return !this.eh && ((this.eh = !0), this.hh.St(), !0);
|
|
120
120
|
}
|
|
121
|
-
|
|
121
|
+
nh(t) {
|
|
122
122
|
if (t && t.parentNode) {
|
|
123
123
|
let s = t.closest(".ab-iam-root");
|
|
124
|
-
if ((null == s && (s = t), this.
|
|
124
|
+
if ((null == s && (s = t), this.xe() && null != s.parentNode)) {
|
|
125
125
|
const t = s.parentNode.classList;
|
|
126
|
-
t && t.contains(InAppMessage.
|
|
127
|
-
document.body.removeEventListener("touchmove", InAppMessage.
|
|
126
|
+
t && t.contains(InAppMessage.rh) && t.remove(InAppMessage.rh),
|
|
127
|
+
document.body.removeEventListener("touchmove", InAppMessage.oh);
|
|
128
128
|
}
|
|
129
|
-
s.className = s.className.replace(InAppMessage.
|
|
129
|
+
s.className = s.className.replace(InAppMessage.lh, InAppMessage.Eh);
|
|
130
130
|
}
|
|
131
131
|
return this.animateOut;
|
|
132
132
|
}
|
|
133
|
-
|
|
133
|
+
he(t, s) {
|
|
134
134
|
if (null == t) return;
|
|
135
135
|
let i;
|
|
136
|
-
(this.
|
|
136
|
+
(this.qe = null),
|
|
137
137
|
(i =
|
|
138
138
|
-1 === t.className.indexOf("ab-in-app-message")
|
|
139
139
|
? t.getElementsByClassName("ab-in-app-message")[0]
|
|
140
140
|
: t);
|
|
141
141
|
let e = !1;
|
|
142
|
-
i && (e = this.
|
|
142
|
+
i && (e = this.nh(i));
|
|
143
143
|
const h = document.body;
|
|
144
144
|
if (null != h) var n = h.scrollTop;
|
|
145
145
|
const r = () => {
|
|
@@ -147,47 +147,47 @@ export default class InAppMessage {
|
|
|
147
147
|
let s = t.closest(".ab-iam-root");
|
|
148
148
|
null == s && (s = t), s.parentNode && s.parentNode.removeChild(s);
|
|
149
149
|
}
|
|
150
|
-
if (null != this.
|
|
151
|
-
const t = document.getElementById(this.
|
|
150
|
+
if (null != this.Ae()) {
|
|
151
|
+
const t = document.getElementById(this.Ae());
|
|
152
152
|
t && t.parentNode && t.parentNode.removeChild(t);
|
|
153
153
|
}
|
|
154
154
|
null != h && "Safari" === ot.browser && (h.scrollTop = n),
|
|
155
155
|
s ? s() : this.J();
|
|
156
156
|
};
|
|
157
|
-
e ? setTimeout(r, InAppMessage.
|
|
157
|
+
e ? setTimeout(r, InAppMessage.uh) : r(), this.ke && this.ke.focus();
|
|
158
158
|
}
|
|
159
|
-
|
|
159
|
+
Be() {
|
|
160
160
|
return document.createTextNode(this.message);
|
|
161
161
|
}
|
|
162
|
-
|
|
162
|
+
Ie(t) {
|
|
163
163
|
let s = "";
|
|
164
|
-
this.message || this.header || !this.
|
|
164
|
+
this.message || this.header || !this.xe() || (s = "Modal Image"),
|
|
165
165
|
t.setAttribute("alt", s);
|
|
166
166
|
}
|
|
167
|
-
static
|
|
167
|
+
static oh(t) {
|
|
168
168
|
(t.targetTouches && t.targetTouches.length > 1) ||
|
|
169
169
|
(t.target.classList &&
|
|
170
170
|
t.target.classList.contains("ab-message-text") &&
|
|
171
171
|
t.target.scrollHeight > t.target.clientHeight) ||
|
|
172
|
-
(document.querySelector(`.${InAppMessage.
|
|
172
|
+
(document.querySelector(`.${InAppMessage.rh}`) && t.preventDefault());
|
|
173
173
|
}
|
|
174
|
-
|
|
175
|
-
this.
|
|
174
|
+
Th(t) {
|
|
175
|
+
this.xe() &&
|
|
176
176
|
null != t.parentNode &&
|
|
177
177
|
this.orientation !== InAppMessage.Orientation.LANDSCAPE &&
|
|
178
178
|
(null != t.parentNode.classList &&
|
|
179
|
-
t.parentNode.classList.add(InAppMessage.
|
|
179
|
+
t.parentNode.classList.add(InAppMessage.rh),
|
|
180
180
|
document.body.addEventListener(
|
|
181
181
|
"touchmove",
|
|
182
|
-
InAppMessage.
|
|
182
|
+
InAppMessage.oh,
|
|
183
183
|
!!Tt() && { passive: !1 }
|
|
184
184
|
)),
|
|
185
|
-
(t.className += " " + InAppMessage.
|
|
185
|
+
(t.className += " " + InAppMessage.lh);
|
|
186
186
|
}
|
|
187
|
-
static
|
|
187
|
+
static ah(t) {
|
|
188
188
|
if (
|
|
189
|
-
t.keyCode === at.
|
|
190
|
-
!e.nn(T.
|
|
189
|
+
t.keyCode === at.mh &&
|
|
190
|
+
!e.nn(T.Ih) &&
|
|
191
191
|
document.querySelectorAll(".ab-modal-interactions").length > 0
|
|
192
192
|
) {
|
|
193
193
|
const t = document.getElementsByClassName("ab-html-message");
|
|
@@ -206,33 +206,33 @@ export default class InAppMessage {
|
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
|
-
|
|
210
|
-
this.
|
|
211
|
-
e.nn(T.
|
|
212
|
-
(document.addEventListener("keydown", InAppMessage.
|
|
213
|
-
e.
|
|
214
|
-
document.removeEventListener("keydown", InAppMessage.
|
|
209
|
+
Ah() {
|
|
210
|
+
this.Nh ||
|
|
211
|
+
e.nn(T.Ih) ||
|
|
212
|
+
(document.addEventListener("keydown", InAppMessage.ah, !1),
|
|
213
|
+
e._h(() => {
|
|
214
|
+
document.removeEventListener("keydown", InAppMessage.ah);
|
|
215
215
|
}),
|
|
216
|
-
(this.
|
|
216
|
+
(this.Nh = !0));
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
|
-
(InAppMessage.
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
219
|
+
(InAppMessage.Xi = {
|
|
220
|
+
Zi: 4281545523,
|
|
221
|
+
Yi: 4294967295,
|
|
222
|
+
Wi: 4278219733,
|
|
223
|
+
Lh: 4293914607,
|
|
224
|
+
dh: 4283782485,
|
|
225
|
+
sh: 3224580915,
|
|
226
|
+
th: 4288387995
|
|
227
227
|
}),
|
|
228
|
-
(InAppMessage.
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
228
|
+
(InAppMessage.Me = {
|
|
229
|
+
Oh: "hd",
|
|
230
|
+
ze: "ias",
|
|
231
|
+
Sh: "of",
|
|
232
|
+
Dh: "do",
|
|
233
|
+
Li: "umt",
|
|
234
|
+
Ri: "tf",
|
|
235
|
+
Mh: "te"
|
|
236
236
|
}),
|
|
237
237
|
(InAppMessage.SlideFrom = { TOP: "TOP", BOTTOM: "BOTTOM" }),
|
|
238
238
|
(InAppMessage.ClickAction = {
|
|
@@ -257,15 +257,15 @@ export default class InAppMessage {
|
|
|
257
257
|
FIT_CENTER: "FIT_CENTER"
|
|
258
258
|
}),
|
|
259
259
|
(InAppMessage.es = {
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
260
|
+
Rh: "SLIDEUP",
|
|
261
|
+
bh: "MODAL",
|
|
262
|
+
Ne: "MODAL_STYLED",
|
|
263
263
|
Tr: "FULL",
|
|
264
264
|
ul: "WEB_HTML",
|
|
265
|
-
|
|
265
|
+
Pe: "HTML"
|
|
266
266
|
}),
|
|
267
|
-
(InAppMessage.
|
|
268
|
-
(InAppMessage.
|
|
269
|
-
(InAppMessage.
|
|
270
|
-
(InAppMessage.
|
|
271
|
-
(InAppMessage.
|
|
267
|
+
(InAppMessage.uh = 500),
|
|
268
|
+
(InAppMessage.Ph = 200),
|
|
269
|
+
(InAppMessage.lh = "ab-show"),
|
|
270
|
+
(InAppMessage.Eh = "ab-hide"),
|
|
271
|
+
(InAppMessage.rh = "ab-pause-scrolling");
|