@braze/web-sdk 5.1.1 → 5.2.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 -8
- package/package.json +1 -1
- package/shared-lib/encoding-utils.js +1 -1
- package/shared-lib/event-types.js +18 -18
- package/shared-lib/indexed-db-adapter.js +32 -32
- package/shared-lib/logger.js +2 -2
- package/shared-lib/supported-options.js +22 -21
- package/src/InAppMessage/display/html-message-to-html.js +38 -35
- package/src/InAppMessage/display/in-app-message-to-html.js +2 -2
- package/src/InAppMessage/display/modal-utils.js +2 -2
- package/src/InAppMessage/in-app-message-factory.js +21 -19
- package/src/InAppMessage/in-app-message-manager.js +58 -78
- 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 +4 -2
- package/src/InAppMessage/models/full-screen-message.js +5 -2
- package/src/InAppMessage/models/html-message.js +6 -4
- package/src/InAppMessage/models/in-app-message-button.js +2 -2
- package/src/InAppMessage/models/in-app-message.js +51 -46
- package/src/InAppMessage/models/modal-message.js +5 -2
- package/src/InAppMessage/models/slide-up-message.js +33 -8
- package/src/InAppMessage/models/templated-in-app-message.js +8 -8
- package/src/InAppMessage/ui/show-in-app-message.js +28 -34
- package/src/InAppMessage/utils/in-app-message-utils.js +18 -1
- package/src/Push/push-manager-factory.js +3 -3
- package/src/Push/push-manager.js +118 -110
- package/src/Push/utils/push-utils.js +4 -4
- package/src/User/user-manager.js +4 -4
- package/src/User/user.js +17 -17
- package/src/common/base-feed.js +1 -1
- package/src/common/feed-display.js +12 -12
- package/src/l10n/l10n-manager-factory.js +1 -1
- package/src/l10n/l10n-manager.js +4 -4
- package/src/managers/auth-manager.js +26 -26
- package/src/managers/braze-instance.js +59 -52
- package/src/managers/device-manager.js +15 -15
- package/src/managers/network-manager.js +98 -93
- package/src/managers/server-config-manager.js +9 -9
- package/src/managers/storage-manager.js +99 -96
- package/src/managers/utils.js +6 -0
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +20 -12
- package/src/models/device.js +3 -3
- package/src/models/identifier.js +33 -19
- package/src/models/push-token.js +4 -4
- package/src/models/server-config.js +6 -6
- package/src/request-controller.js +76 -73
- package/src/triggers/models/custom-event-data.js +2 -2
- package/src/triggers/models/custom-event-property-data.js +4 -4
- package/src/triggers/models/filter-set.js +5 -5
- 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 +2 -2
- package/src/triggers/models/purchase-property-data.js +4 -4
- package/src/triggers/models/push-click-data.js +1 -1
- package/src/triggers/models/trigger-condition.js +41 -41
- package/src/triggers/models/trigger-events.js +1 -1
- package/src/triggers/models/trigger.js +36 -36
- package/src/triggers/triggers-provider-factory.js +1 -1
- package/src/triggers/triggers-provider.js +71 -82
- package/src/ui/js/attach-css.js +2 -2
- 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 +9 -8
- package/src/util/client-hints-parser.js +1 -1
- package/src/util/component-utils.js +2 -2
- package/src/util/device-constants.js +2 -2
- package/src/util/key-codes.js +1 -1
- package/src/util/net.js +1 -1
- package/src/util/request-header-utils.js +6 -6
- package/src/util/user-agent-parser.js +5 -5
- package/src/util/validation-utils.js +2 -0
- package/src/util/window-utils.js +3 -3
|
@@ -13,8 +13,8 @@ export function newInAppMessageFromJson(e) {
|
|
|
13
13
|
null != o && (o = o.toUpperCase());
|
|
14
14
|
const s = e.message,
|
|
15
15
|
n = e.text_align_message,
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
t = e.slide_from,
|
|
17
|
+
m = e.extras,
|
|
18
18
|
l = e.trigger_id,
|
|
19
19
|
i = e.click_action,
|
|
20
20
|
f = e.uri,
|
|
@@ -41,18 +41,17 @@ export function newInAppMessageFromJson(e) {
|
|
|
41
41
|
z = e.orientation,
|
|
42
42
|
J = e.animate_in,
|
|
43
43
|
S = e.animate_out;
|
|
44
|
-
let q,
|
|
45
|
-
B = e.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
q = new ModalMessage(
|
|
44
|
+
let q = e.html_id,
|
|
45
|
+
B = e.css;
|
|
46
|
+
(null != q && "" !== q && null != B && "" !== B) ||
|
|
47
|
+
((q = void 0), (B = void 0));
|
|
48
|
+
const C = e.message_extras;
|
|
49
|
+
let D;
|
|
50
|
+
if (o === ModalMessage.it || o === InAppMessage.Ce.Je)
|
|
51
|
+
D = new ModalMessage(
|
|
53
52
|
s,
|
|
54
53
|
n,
|
|
55
|
-
|
|
54
|
+
m,
|
|
56
55
|
l,
|
|
57
56
|
i,
|
|
58
57
|
f,
|
|
@@ -75,14 +74,15 @@ export function newInAppMessageFromJson(e) {
|
|
|
75
74
|
F,
|
|
76
75
|
M,
|
|
77
76
|
y,
|
|
77
|
+
q,
|
|
78
78
|
B,
|
|
79
79
|
C,
|
|
80
80
|
);
|
|
81
81
|
else if (o === FullScreenMessage.it)
|
|
82
|
-
|
|
82
|
+
D = new FullScreenMessage(
|
|
83
83
|
s,
|
|
84
84
|
n,
|
|
85
|
-
|
|
85
|
+
m,
|
|
86
86
|
l,
|
|
87
87
|
i,
|
|
88
88
|
f,
|
|
@@ -106,15 +106,16 @@ export function newInAppMessageFromJson(e) {
|
|
|
106
106
|
M,
|
|
107
107
|
y,
|
|
108
108
|
z,
|
|
109
|
+
q,
|
|
109
110
|
B,
|
|
110
111
|
C,
|
|
111
112
|
);
|
|
112
113
|
else if (o === SlideUpMessage.it)
|
|
113
|
-
|
|
114
|
+
D = new SlideUpMessage(
|
|
114
115
|
s,
|
|
115
116
|
n,
|
|
116
|
-
m,
|
|
117
117
|
t,
|
|
118
|
+
m,
|
|
118
119
|
l,
|
|
119
120
|
i,
|
|
120
121
|
f,
|
|
@@ -130,6 +131,7 @@ export function newInAppMessageFromJson(e) {
|
|
|
130
131
|
v,
|
|
131
132
|
J,
|
|
132
133
|
S,
|
|
134
|
+
q,
|
|
133
135
|
B,
|
|
134
136
|
C,
|
|
135
137
|
);
|
|
@@ -142,11 +144,11 @@ export function newInAppMessageFromJson(e) {
|
|
|
142
144
|
return void r.error("Ignoring message with unknown type " + o);
|
|
143
145
|
{
|
|
144
146
|
const o = e.message_fields;
|
|
145
|
-
(
|
|
146
|
-
(
|
|
147
|
+
(D = new HtmlMessage(s, m, l, u, a, J, S, F, q, B, o, C)),
|
|
148
|
+
(D.trusted = e.trusted || !1);
|
|
147
149
|
}
|
|
148
150
|
}
|
|
149
|
-
return (
|
|
151
|
+
return (D.Ae = o), D;
|
|
150
152
|
}
|
|
151
153
|
export function buttonsFromSerializedInAppMessage(e) {
|
|
152
154
|
const o = [];
|
|
@@ -5,20 +5,19 @@ import HtmlMessage from "./models/html-message.js";
|
|
|
5
5
|
import InAppMessage from "./models/in-app-message.js";
|
|
6
6
|
import InAppMessageButton from "./models/in-app-message-button.js";
|
|
7
7
|
import s from "../common/event-logger.js";
|
|
8
|
-
import { newInAppMessageFromJson as
|
|
8
|
+
import { newInAppMessageFromJson as pt } from "./in-app-message-factory.js";
|
|
9
9
|
import { randomInclusive as k } from "../util/math.js";
|
|
10
10
|
import t from "../models/request-result.js";
|
|
11
11
|
import { logger as r, EventTypes as i } from "../../shared-lib/index.js";
|
|
12
12
|
import T from "../managers/subscription-manager.js";
|
|
13
|
-
import
|
|
14
|
-
import { validateValueIsFromEnum as J } from "../util/code-utils.js";
|
|
13
|
+
import mt from "../triggers/models/trigger.js";
|
|
15
14
|
import { BRAZE_ACTION_URI_REGEX as Z } from "../util/validation-utils.js";
|
|
16
15
|
import {
|
|
17
|
-
containsPushPrimerBrazeAction as
|
|
18
|
-
containsUnknownBrazeAction as
|
|
16
|
+
containsPushPrimerBrazeAction as gt,
|
|
17
|
+
containsUnknownBrazeAction as ft,
|
|
19
18
|
getDecodedBrazeAction as W,
|
|
20
|
-
ineligibleBrazeActionURLErrorMessage as
|
|
21
|
-
INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES as
|
|
19
|
+
ineligibleBrazeActionURLErrorMessage as dt,
|
|
20
|
+
INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES as jt,
|
|
22
21
|
} from "../util/braze-actions.js";
|
|
23
22
|
import vt from "../Push/utils/push-utils.js";
|
|
24
23
|
import S from "../util/request-header-utils.js";
|
|
@@ -52,26 +51,12 @@ export default class aa {
|
|
|
52
51
|
Ue(t) {
|
|
53
52
|
this.Re = t;
|
|
54
53
|
}
|
|
55
|
-
Ve(e, r) {
|
|
56
|
-
if (!e) return new t();
|
|
57
|
-
if (
|
|
58
|
-
!J(
|
|
59
|
-
InAppMessage.Me,
|
|
60
|
-
r,
|
|
61
|
-
`${r} is not a valid in-app message display failure`,
|
|
62
|
-
"InAppMessage.DisplayFailures",
|
|
63
|
-
)
|
|
64
|
-
)
|
|
65
|
-
return new t();
|
|
66
|
-
const n = { trigger_ids: [e], error_code: r };
|
|
67
|
-
return s.q(i.We, n);
|
|
68
|
-
}
|
|
69
54
|
q(e, n, o, a) {
|
|
70
55
|
const l = new t();
|
|
71
56
|
let u;
|
|
72
57
|
if (e instanceof ControlMessage) u = { trigger_ids: [e.triggerId] };
|
|
73
58
|
else {
|
|
74
|
-
if (n === i.
|
|
59
|
+
if (n === i.Ve || (e instanceof HtmlMessage && n === i.We)) {
|
|
75
60
|
if (!e.p(a))
|
|
76
61
|
return (
|
|
77
62
|
r.info(
|
|
@@ -79,7 +64,7 @@ export default class aa {
|
|
|
79
64
|
),
|
|
80
65
|
l
|
|
81
66
|
);
|
|
82
|
-
} else if (n === i.
|
|
67
|
+
} else if (n === i.Xe) {
|
|
83
68
|
if (!e.K())
|
|
84
69
|
return (
|
|
85
70
|
r.info(
|
|
@@ -88,11 +73,15 @@ export default class aa {
|
|
|
88
73
|
l
|
|
89
74
|
);
|
|
90
75
|
}
|
|
91
|
-
u = this.
|
|
76
|
+
u = this.Ye(e);
|
|
92
77
|
}
|
|
93
|
-
return null == u
|
|
78
|
+
return null == u
|
|
79
|
+
? l
|
|
80
|
+
: (e.messageExtras && (u.message_extras = e.messageExtras),
|
|
81
|
+
null != o && (u.bid = o),
|
|
82
|
+
s.q(n, u));
|
|
94
83
|
}
|
|
95
|
-
|
|
84
|
+
Ze(e, n) {
|
|
96
85
|
const o = new t();
|
|
97
86
|
if (!e.p())
|
|
98
87
|
return (
|
|
@@ -101,32 +90,32 @@ export default class aa {
|
|
|
101
90
|
),
|
|
102
91
|
o
|
|
103
92
|
);
|
|
104
|
-
const a = this.
|
|
93
|
+
const a = this.Ye(n);
|
|
105
94
|
return null == a
|
|
106
95
|
? o
|
|
107
|
-
: e.id === InAppMessageButton.
|
|
96
|
+
: e.id === InAppMessageButton.Pi
|
|
108
97
|
? (r.info(
|
|
109
98
|
"This in-app message button does not have a tracking id. Not logging event to Braze servers.",
|
|
110
99
|
),
|
|
111
100
|
o)
|
|
112
|
-
: (null != e.id && (a.bid = e.id), s.q(i.
|
|
101
|
+
: (null != e.id && (a.bid = e.id), s.q(i.We, a));
|
|
113
102
|
}
|
|
114
|
-
|
|
103
|
+
Oi(t) {
|
|
115
104
|
const e = t.messageFields;
|
|
116
105
|
return (null != e && e.is_push_primer) || !1;
|
|
117
106
|
}
|
|
118
|
-
|
|
107
|
+
Qi(t) {
|
|
119
108
|
if (!(t instanceof InAppMessage)) return;
|
|
120
109
|
const e = (t) => {
|
|
121
110
|
if (!t) return;
|
|
122
111
|
const e = W(t);
|
|
123
|
-
return
|
|
124
|
-
?
|
|
125
|
-
:
|
|
126
|
-
?
|
|
112
|
+
return ft(e)
|
|
113
|
+
? dt(jt.Vi, "In-App Message")
|
|
114
|
+
: gt(e) && !vt.Wi()
|
|
115
|
+
? dt(jt.Xi, "In-App Message")
|
|
127
116
|
: void 0;
|
|
128
117
|
};
|
|
129
|
-
if (this.
|
|
118
|
+
if (this.Oi(t) && !vt.Wi())
|
|
130
119
|
return "In-App Message contains a push prompt, but is not eligible for a push prompt. Ignoring.";
|
|
131
120
|
const s = t.buttons || [];
|
|
132
121
|
let i;
|
|
@@ -144,66 +133,57 @@ export default class aa {
|
|
|
144
133
|
? e(t.uri)
|
|
145
134
|
: void 0;
|
|
146
135
|
}
|
|
147
|
-
|
|
136
|
+
Yi(t, e, s, i) {
|
|
148
137
|
if (!this.qt) return;
|
|
149
|
-
const n = this.qt.
|
|
138
|
+
const n = this.qt.Zi(!1, !1),
|
|
150
139
|
o = this.qt.Ps(n);
|
|
151
140
|
(o.template = { trigger_id: t.triggerId, trigger_event_type: e }),
|
|
152
|
-
null != s && (o.template.data = s.
|
|
153
|
-
const a = this.qt._s(o, S.Gs.
|
|
141
|
+
null != s && (o.template.data = s.Mr());
|
|
142
|
+
const a = this.qt._s(o, S.Gs._r);
|
|
154
143
|
this.qt.Hs(
|
|
155
144
|
o,
|
|
156
145
|
() => {
|
|
157
146
|
this.qt &&
|
|
158
|
-
(S.Os(this.u, S.Gs.
|
|
147
|
+
(S.Os(this.u, S.Gs._r, new Date().valueOf()),
|
|
159
148
|
C.Qs({
|
|
160
149
|
url: `${this.qt.Vs()}/template/`,
|
|
161
150
|
data: o,
|
|
162
151
|
headers: a,
|
|
163
152
|
L: (e) => {
|
|
164
|
-
if ((S.Ys(this.u, S.Gs.
|
|
165
|
-
return (
|
|
166
|
-
this.Ve(t.triggerId, InAppMessage.Me.Or),
|
|
167
|
-
void ("function" == typeof t.Hr && t.Hr())
|
|
168
|
-
);
|
|
153
|
+
if ((S.Ys(this.u, S.Gs._r, 1), !this.qt.Ws(o, e, a)))
|
|
154
|
+
return void ("function" == typeof t.Gr && t.Gr());
|
|
169
155
|
if ((this.qt.Xs(), null == e || null == e.templated_message))
|
|
170
|
-
return
|
|
156
|
+
return;
|
|
171
157
|
const s = e.templated_message;
|
|
172
|
-
if (s.type !==
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
return void this.Ve(t.triggerId, InAppMessage.Me.Lr);
|
|
177
|
-
const n = this.Wi(i);
|
|
158
|
+
if (s.type !== mt.Or.Cr) return;
|
|
159
|
+
const i = pt(s.data);
|
|
160
|
+
if (null == i) return;
|
|
161
|
+
const n = this.Qi(i);
|
|
178
162
|
if (n)
|
|
179
|
-
return r.error(n), void ("function" == typeof t.
|
|
180
|
-
"function" == typeof t.
|
|
181
|
-
? t.Qr(i)
|
|
182
|
-
: this.Ve(t.triggerId, InAppMessage.Me.Or);
|
|
163
|
+
return r.error(n), void ("function" == typeof t.Gr && t.Gr());
|
|
164
|
+
"function" == typeof t.Hr && t.Hr(i);
|
|
183
165
|
},
|
|
184
166
|
error: (r) => {
|
|
185
167
|
let n = `getting user personalization for message ${t.triggerId}`;
|
|
186
|
-
if (new Date().valueOf() - t.
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
S.si(this.u, S.Gs.Cr);
|
|
190
|
-
const r = Math.min(t.Vr, this.Oe),
|
|
168
|
+
if (new Date().valueOf() - t.Jr < t.Kr) {
|
|
169
|
+
S.si(this.u, S.Gs._r);
|
|
170
|
+
const r = Math.min(t.Kr, this.Oe),
|
|
191
171
|
o = this.Ne;
|
|
192
172
|
null == i && (i = o);
|
|
193
173
|
const a = Math.min(r, k(o, 3 * i));
|
|
194
174
|
(n += `. Retrying in ${a} ms`),
|
|
195
175
|
setTimeout(() => {
|
|
196
|
-
this.
|
|
176
|
+
this.Yi(t, e, s, a);
|
|
197
177
|
}, a);
|
|
198
178
|
}
|
|
199
179
|
this.qt.Zs(r, n);
|
|
200
180
|
},
|
|
201
181
|
}));
|
|
202
182
|
},
|
|
203
|
-
S.ii.
|
|
183
|
+
S.ii._r,
|
|
204
184
|
);
|
|
205
185
|
}
|
|
206
|
-
|
|
186
|
+
Ye(t) {
|
|
207
187
|
if (null == t.triggerId)
|
|
208
188
|
return (
|
|
209
189
|
r.info(
|
|
@@ -221,33 +201,33 @@ export default class aa {
|
|
|
221
201
|
!(t && t instanceof InAppMessage && t.constructor !== InAppMessage) ||
|
|
222
202
|
t instanceof ControlMessage
|
|
223
203
|
) &&
|
|
224
|
-
this.u.k(o.C.
|
|
204
|
+
this.u.k(o.C.Lr, t.Y())
|
|
225
205
|
);
|
|
226
206
|
}
|
|
227
207
|
Ge() {
|
|
228
208
|
if (!this.u) return null;
|
|
229
|
-
const t = this.u.j(o.C.
|
|
209
|
+
const t = this.u.j(o.C.Lr);
|
|
230
210
|
if (!t) return null;
|
|
231
211
|
let e;
|
|
232
212
|
switch (t.type) {
|
|
233
|
-
case InAppMessage.Ce.
|
|
234
|
-
e = FullScreenMessage.
|
|
213
|
+
case InAppMessage.Ce.Qr:
|
|
214
|
+
e = FullScreenMessage.Ur(t);
|
|
235
215
|
break;
|
|
236
|
-
case InAppMessage.Ce.
|
|
216
|
+
case InAppMessage.Ce.Vr:
|
|
237
217
|
case InAppMessage.Ce.je:
|
|
238
218
|
case InAppMessage.Ce.Se:
|
|
239
|
-
e = HtmlMessage.
|
|
219
|
+
e = HtmlMessage.Ur(t);
|
|
240
220
|
break;
|
|
241
|
-
case InAppMessage.Ce.
|
|
221
|
+
case InAppMessage.Ce.Wr:
|
|
242
222
|
case InAppMessage.Ce.Je:
|
|
243
|
-
e = ModalMessage.
|
|
223
|
+
e = ModalMessage.Ur(t);
|
|
244
224
|
break;
|
|
245
|
-
case InAppMessage.Ce.
|
|
246
|
-
e = SlideUpMessage.
|
|
225
|
+
case InAppMessage.Ce.Xr:
|
|
226
|
+
e = SlideUpMessage.Ur(t);
|
|
247
227
|
}
|
|
248
|
-
return e && this.
|
|
228
|
+
return e && this.Yr(), e;
|
|
249
229
|
}
|
|
250
|
-
|
|
251
|
-
this.u && this.u.hi(o.C.
|
|
230
|
+
Yr() {
|
|
231
|
+
this.u && this.u.hi(o.C.Lr);
|
|
252
232
|
}
|
|
253
233
|
}
|
|
@@ -12,11 +12,11 @@ export function logInAppMessageButtonClick(o, t) {
|
|
|
12
12
|
if (!(o instanceof InAppMessageButton))
|
|
13
13
|
return r.error("button must be an InAppMessageButton object"), !1;
|
|
14
14
|
if (!(t instanceof InAppMessage)) return r.error(sr), !1;
|
|
15
|
-
const n = se.m().
|
|
15
|
+
const n = se.m().Ze(o, t);
|
|
16
16
|
if (n.L)
|
|
17
17
|
for (let r = 0; r < n.ge.length; r++)
|
|
18
18
|
et.rr().fe(
|
|
19
|
-
tt.
|
|
19
|
+
tt.Zr,
|
|
20
20
|
[
|
|
21
21
|
t.triggerId,
|
|
22
22
|
null === (s = o.id) || void 0 === s ? void 0 : s.toString(),
|
|
@@ -9,11 +9,11 @@ import { TriggersProviderFactory as et } from "../triggers/triggers-provider-fac
|
|
|
9
9
|
export function logInAppMessageClick(o) {
|
|
10
10
|
if (!e.X()) return !1;
|
|
11
11
|
if (!(o instanceof InAppMessage)) return r.error(sr), !1;
|
|
12
|
-
const s = se.m().q(o, i.
|
|
12
|
+
const s = se.m().q(o, i.Ve);
|
|
13
13
|
if (s) {
|
|
14
|
-
o.
|
|
14
|
+
o.mo() || logInAppMessageImpression(o);
|
|
15
15
|
for (let r = 0; r < s.ge.length; r++)
|
|
16
|
-
et.rr().fe(tt.
|
|
16
|
+
et.rr().fe(tt.Zr, [o.triggerId], s.ge[r]);
|
|
17
17
|
}
|
|
18
18
|
return s.L;
|
|
19
19
|
}
|
|
@@ -13,11 +13,11 @@ export function logInAppMessageHtmlClick(t, s, o) {
|
|
|
13
13
|
),
|
|
14
14
|
!1
|
|
15
15
|
);
|
|
16
|
-
let m = i.
|
|
17
|
-
null != s && (m = i.
|
|
16
|
+
let m = i.Ve;
|
|
17
|
+
null != s && (m = i.We);
|
|
18
18
|
const n = se.m().q(t, m, s, o);
|
|
19
19
|
if (n.L)
|
|
20
20
|
for (let e = 0; e < n.ge.length; e++)
|
|
21
|
-
et.rr().fe(tt.
|
|
21
|
+
et.rr().fe(tt.Zr, [t.triggerId, s], n.ge[e]);
|
|
22
22
|
return n.L;
|
|
23
23
|
}
|
|
@@ -8,6 +8,6 @@ export function logInAppMessageImpression(o) {
|
|
|
8
8
|
if (!e.X()) return !1;
|
|
9
9
|
if (!(o instanceof InAppMessage || o instanceof ControlMessage))
|
|
10
10
|
return r.error(sr), !1;
|
|
11
|
-
const s = o instanceof ControlMessage ? i.
|
|
11
|
+
const s = o instanceof ControlMessage ? i.po : i.Xe;
|
|
12
12
|
return se.m().q(o, s).L;
|
|
13
13
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
export default class ControlMessage {
|
|
2
|
-
constructor(t) {
|
|
2
|
+
constructor(t, s) {
|
|
3
3
|
(this.triggerId = t),
|
|
4
|
+
(this.messageExtras = s),
|
|
4
5
|
(this.triggerId = t),
|
|
6
|
+
(this.messageExtras = s),
|
|
5
7
|
(this.extras = {}),
|
|
6
8
|
(this.isControl = !0);
|
|
7
9
|
}
|
|
8
10
|
static fromJson(t) {
|
|
9
|
-
return new ControlMessage(t.trigger_id);
|
|
11
|
+
return new ControlMessage(t.trigger_id, t.message_extras);
|
|
10
12
|
}
|
|
11
13
|
}
|
|
@@ -30,6 +30,7 @@ export default class FullScreenMessage extends InAppMessage {
|
|
|
30
30
|
k,
|
|
31
31
|
q,
|
|
32
32
|
A,
|
|
33
|
+
B,
|
|
33
34
|
) {
|
|
34
35
|
(p = p || InAppMessage.DismissType.MANUAL),
|
|
35
36
|
(k = k || InAppMessage.Orientation.PORTRAIT),
|
|
@@ -63,13 +64,14 @@ export default class FullScreenMessage extends InAppMessage {
|
|
|
63
64
|
k,
|
|
64
65
|
q,
|
|
65
66
|
A,
|
|
67
|
+
B,
|
|
66
68
|
),
|
|
67
69
|
(this.$e = InAppMessage.TextAlignment.CENTER);
|
|
68
70
|
}
|
|
69
71
|
Y() {
|
|
70
72
|
return super.Y(FullScreenMessage.it);
|
|
71
73
|
}
|
|
72
|
-
static
|
|
74
|
+
static Ur(e) {
|
|
73
75
|
return new FullScreenMessage(
|
|
74
76
|
e[InAppMessage.tt.ea],
|
|
75
77
|
e[InAppMessage.tt.ra],
|
|
@@ -99,7 +101,8 @@ export default class FullScreenMessage extends InAppMessage {
|
|
|
99
101
|
e[InAppMessage.tt.ya],
|
|
100
102
|
e[InAppMessage.tt.Sa],
|
|
101
103
|
e[InAppMessage.tt.CSS],
|
|
104
|
+
e[InAppMessage.tt.ba],
|
|
102
105
|
);
|
|
103
106
|
}
|
|
104
107
|
}
|
|
105
|
-
FullScreenMessage.it = InAppMessage.Ce.
|
|
108
|
+
FullScreenMessage.it = InAppMessage.Ce.Qr;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import InAppMessage from "./in-app-message.js";
|
|
2
2
|
export default class HtmlMessage extends InAppMessage {
|
|
3
|
-
constructor(i, o, e, r, d, t, s, v, n, u, a) {
|
|
3
|
+
constructor(i, o, e, r, d, t, s, v, n, u, a, c) {
|
|
4
4
|
super(
|
|
5
5
|
i,
|
|
6
6
|
void 0,
|
|
@@ -31,6 +31,7 @@ export default class HtmlMessage extends InAppMessage {
|
|
|
31
31
|
void 0,
|
|
32
32
|
n,
|
|
33
33
|
u,
|
|
34
|
+
c,
|
|
34
35
|
),
|
|
35
36
|
(this.messageFields = a),
|
|
36
37
|
(this.messageFields = a);
|
|
@@ -39,7 +40,7 @@ export default class HtmlMessage extends InAppMessage {
|
|
|
39
40
|
return !1;
|
|
40
41
|
}
|
|
41
42
|
p(i) {
|
|
42
|
-
if (this.Ae === InAppMessage.Ce.
|
|
43
|
+
if (this.Ae === InAppMessage.Ce.Vr) {
|
|
43
44
|
if (this.vo) return !1;
|
|
44
45
|
this.vo = !0;
|
|
45
46
|
}
|
|
@@ -49,7 +50,7 @@ export default class HtmlMessage extends InAppMessage {
|
|
|
49
50
|
const i = super.Y(HtmlMessage.it);
|
|
50
51
|
return (i[InAppMessage.tt.uo] = this.messageFields), i;
|
|
51
52
|
}
|
|
52
|
-
static
|
|
53
|
+
static Ur(i) {
|
|
53
54
|
return new HtmlMessage(
|
|
54
55
|
i[InAppMessage.tt.ea],
|
|
55
56
|
i[InAppMessage.tt.bt],
|
|
@@ -62,7 +63,8 @@ export default class HtmlMessage extends InAppMessage {
|
|
|
62
63
|
i[InAppMessage.tt.Sa],
|
|
63
64
|
i[InAppMessage.tt.CSS],
|
|
64
65
|
i[InAppMessage.tt.uo],
|
|
66
|
+
i[InAppMessage.tt.ba],
|
|
65
67
|
);
|
|
66
68
|
}
|
|
67
69
|
}
|
|
68
|
-
HtmlMessage.it = InAppMessage.Ce.
|
|
70
|
+
HtmlMessage.it = InAppMessage.Ce.Vr;
|
|
@@ -15,7 +15,7 @@ export default class InAppMessageButton {
|
|
|
15
15
|
(this.borderColor = r || this.backgroundColor),
|
|
16
16
|
(this.clickAction = h || InAppMessage.ClickAction.NONE),
|
|
17
17
|
(this.uri = e),
|
|
18
|
-
null == n && (n = InAppMessageButton.
|
|
18
|
+
null == n && (n = InAppMessageButton.Pi),
|
|
19
19
|
(this.id = n),
|
|
20
20
|
(this.vo = !1),
|
|
21
21
|
(this.Et = new T());
|
|
@@ -44,4 +44,4 @@ export default class InAppMessageButton {
|
|
|
44
44
|
);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
InAppMessageButton.
|
|
47
|
+
InAppMessageButton.Pi = -1;
|