@braze/web-sdk 6.10.2 → 6.11.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 +28 -4
- package/package.json +1 -1
- package/shared-lib/encoding-utils.js +3 -3
- package/shared-lib/event-types.js +10 -10
- 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/Core/logout.js +2 -2
- package/src/InAppMessage/constants.js +39 -47
- package/src/InAppMessage/display/html-message-to-html.js +1 -1
- package/src/InAppMessage/display/in-app-message-to-html.js +38 -36
- package/src/InAppMessage/in-app-message-factory.js +4 -4
- package/src/InAppMessage/in-app-message-manager.js +89 -68
- package/src/InAppMessage/log-in-app-message-button-click.js +1 -1
- package/src/InAppMessage/log-in-app-message-click.js +1 -1
- package/src/InAppMessage/log-in-app-message-html-click.js +2 -2
- package/src/InAppMessage/log-in-app-message-impression.js +1 -1
- package/src/InAppMessage/models/full-screen-message.js +22 -22
- package/src/InAppMessage/models/html-message.js +13 -13
- package/src/InAppMessage/models/in-app-message-button.js +2 -2
- package/src/InAppMessage/models/in-app-message.js +68 -66
- package/src/InAppMessage/models/modal-message.js +20 -20
- package/src/InAppMessage/models/slide-up-message.js +25 -25
- package/src/InAppMessage/models/templated-in-app-message.js +6 -6
- 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 +27 -25
- package/src/Push/index.js +1 -0
- package/src/Push/push-manager-factory.js +4 -4
- package/src/Push/push-manager.js +222 -179
- package/src/Push/register-push.js +9 -0
- package/src/Push/unregister-push-token-on-server.js +4 -4
- package/src/Push/utils/push-utils.js +8 -8
- package/src/User/user-manager.js +19 -19
- package/src/User/user.js +35 -35
- package/src/common/constants.js +1 -1
- package/src/common/content-cards-display.js +5 -5
- package/src/l10n/l10n-manager-factory.js +1 -1
- package/src/l10n/l10n-manager.js +1 -1
- package/src/managers/braze-instance.js +42 -38
- package/src/managers/device-manager.js +20 -20
- package/src/managers/network-manager.js +122 -122
- package/src/managers/server-config-manager.js +76 -76
- package/src/managers/session-manager.js +8 -8
- package/src/managers/storage-manager.js +127 -127
- package/src/managers/utils.js +1 -1
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +2 -2
- package/src/models/device.js +3 -3
- package/src/models/identifier.js +6 -6
- package/src/models/push-token.js +6 -6
- package/src/models/server-config.js +24 -24
- package/src/request-controller.js +85 -85
- package/src/triggers/models/trigger-condition.js +27 -27
- package/src/triggers/models/trigger.js +2 -2
- package/src/triggers/triggers-provider-factory.js +1 -1
- package/src/triggers/triggers-provider.js +37 -29
- package/src/types.js +2 -2
- package/src/ui/js/attach-css.js +1 -1
- package/src/util/base-device-parser.js +1 -1
- package/src/util/braze-actions.js +4 -4
- package/src/util/browser-detector.js +5 -5
- package/src/util/client-hints-parser.js +1 -1
- package/src/util/dom-utils.js +2 -2
- package/src/util/ecommerce-event-validation.js +1 -1
- package/src/util/key-codes.js +1 -1
- package/src/util/net.js +3 -3
- package/src/util/request-header-utils.js +15 -15
- package/src/util/user-agent-parser.js +4 -4
- package/src/util/validation-utils.js +5 -5
- package/src/util/window-utils.js +2 -2
|
@@ -13,16 +13,15 @@ import {
|
|
|
13
13
|
IamClickAction as Le,
|
|
14
14
|
IAM_SHOW_CLASS as Tt,
|
|
15
15
|
IAM_HIDE_CLASS as xt,
|
|
16
|
-
|
|
17
|
-
IamSlideFrom as Ee,
|
|
16
|
+
IamSlideFrom as De,
|
|
18
17
|
IamDismissType as pr,
|
|
19
18
|
IamOpenTarget as ut,
|
|
20
|
-
IamImageStyle as
|
|
21
|
-
IamOrientation as
|
|
22
|
-
IamTextAlignment as
|
|
19
|
+
IamImageStyle as qe,
|
|
20
|
+
IamOrientation as Ae,
|
|
21
|
+
IamTextAlignment as Ee,
|
|
23
22
|
IamCropType as Me,
|
|
24
23
|
IamServerTypes as dt,
|
|
25
|
-
IamTiming as
|
|
24
|
+
IamTiming as At,
|
|
26
25
|
IamSerializationKeys as cr,
|
|
27
26
|
} from "../constants.js";
|
|
28
27
|
export default class InAppMessage {
|
|
@@ -93,9 +92,9 @@ export default class InAppMessage {
|
|
|
93
92
|
(this.language = D),
|
|
94
93
|
(this.altImageText = z),
|
|
95
94
|
(this.message = t),
|
|
96
|
-
(this.messageAlignment = s ||
|
|
95
|
+
(this.messageAlignment = s || Ee.CENTER),
|
|
97
96
|
(this.duration = u || 5e3),
|
|
98
|
-
(this.slideFrom = i ||
|
|
97
|
+
(this.slideFrom = i || De.BOTTOM),
|
|
99
98
|
(this.extras = h || {}),
|
|
100
99
|
(this.triggerId = e),
|
|
101
100
|
(this.clickAction = n || Le.NONE),
|
|
@@ -104,7 +103,7 @@ export default class InAppMessage {
|
|
|
104
103
|
(this.dismissType = l || pr.AUTO_DISMISS),
|
|
105
104
|
(this.icon = a),
|
|
106
105
|
(this.imageUrl = m),
|
|
107
|
-
(this.imageStyle = c ||
|
|
106
|
+
(this.imageStyle = c || qe.TOP),
|
|
108
107
|
(this.iconColor = d || ss.AE),
|
|
109
108
|
(this.iconBackgroundColor = p || ss._E),
|
|
110
109
|
(this.backgroundColor = b || ss.AE),
|
|
@@ -115,9 +114,9 @@ export default class InAppMessage {
|
|
|
115
114
|
(this.animateOut = j),
|
|
116
115
|
null == this.animateOut && (this.animateOut = !0),
|
|
117
116
|
(this.header = k),
|
|
118
|
-
(this.headerAlignment = w ||
|
|
117
|
+
(this.headerAlignment = w || Ee.CENTER),
|
|
119
118
|
(this.headerTextColor = y || ss.IE),
|
|
120
|
-
(this.frameColor = S || ss.
|
|
119
|
+
(this.frameColor = S || ss.LE),
|
|
121
120
|
(this.buttons = T || []),
|
|
122
121
|
(this.cropType = x || Me.FIT_CENTER),
|
|
123
122
|
(this.orientation = E),
|
|
@@ -131,23 +130,24 @@ export default class InAppMessage {
|
|
|
131
130
|
(this.hs = !1),
|
|
132
131
|
(this.rd = !1),
|
|
133
132
|
(this.sh = !1),
|
|
133
|
+
(this.ih = !1),
|
|
134
134
|
(this.Eo = null),
|
|
135
135
|
(this.$o = null),
|
|
136
136
|
(this.ti = new f()),
|
|
137
|
-
(this.
|
|
138
|
-
(this.Go =
|
|
137
|
+
(this.hh = new f()),
|
|
138
|
+
(this.Go = Ee.CENTER);
|
|
139
139
|
}
|
|
140
140
|
subscribeToClickedEvent(t) {
|
|
141
141
|
return this.ti.Ut(t);
|
|
142
142
|
}
|
|
143
143
|
subscribeToDismissedEvent(t) {
|
|
144
|
-
return this.
|
|
144
|
+
return this.hh.Ut(t);
|
|
145
145
|
}
|
|
146
146
|
removeSubscription(t) {
|
|
147
|
-
this.ti.removeSubscription(t), this.
|
|
147
|
+
this.ti.removeSubscription(t), this.hh.removeSubscription(t);
|
|
148
148
|
}
|
|
149
149
|
removeAllSubscriptions() {
|
|
150
|
-
this.ti.removeAllSubscriptions(), this.
|
|
150
|
+
this.ti.removeAllSubscriptions(), this.hh.removeAllSubscriptions();
|
|
151
151
|
}
|
|
152
152
|
closeMessage() {
|
|
153
153
|
this.tl(this.Eo);
|
|
@@ -177,7 +177,7 @@ export default class InAppMessage {
|
|
|
177
177
|
return !this.rd && ((this.rd = !0), this.ti.A(), !0);
|
|
178
178
|
}
|
|
179
179
|
Ft() {
|
|
180
|
-
return !this.sh && ((this.sh = !0), this.
|
|
180
|
+
return !this.sh && ((this.sh = !0), this.hh.A(), !0);
|
|
181
181
|
}
|
|
182
182
|
hide(t) {
|
|
183
183
|
if (t && t.parentNode) {
|
|
@@ -185,7 +185,7 @@ export default class InAppMessage {
|
|
|
185
185
|
if ((null == s && (s = t), this.zo() && null != s.parentNode)) {
|
|
186
186
|
const t = s.parentNode.classList;
|
|
187
187
|
t && t.contains(mr.TE) && t.remove(mr.TE),
|
|
188
|
-
document.body.removeEventListener("touchmove", InAppMessage.
|
|
188
|
+
document.body.removeEventListener("touchmove", InAppMessage.eh);
|
|
189
189
|
}
|
|
190
190
|
s.className = s.className.replace(Tt, xt);
|
|
191
191
|
}
|
|
@@ -193,8 +193,10 @@ export default class InAppMessage {
|
|
|
193
193
|
}
|
|
194
194
|
tl(t, s) {
|
|
195
195
|
if (null == t) return;
|
|
196
|
+
if (this.ih) return;
|
|
196
197
|
let i;
|
|
197
|
-
(this.
|
|
198
|
+
(this.ih = !0),
|
|
199
|
+
(this.Eo = null),
|
|
198
200
|
(i =
|
|
199
201
|
-1 === t.className.indexOf("ab-in-app-message")
|
|
200
202
|
? t.getElementsByClassName("ab-in-app-message")[0]
|
|
@@ -217,7 +219,7 @@ export default class InAppMessage {
|
|
|
217
219
|
null != e && "Safari" === ro.browser && (e.scrollTop = n),
|
|
218
220
|
s ? s() : this.Ft();
|
|
219
221
|
};
|
|
220
|
-
h ? setTimeout(r,
|
|
222
|
+
h ? setTimeout(r, At.gr) : r(), this.$o && this.$o.focus();
|
|
221
223
|
}
|
|
222
224
|
Ko() {
|
|
223
225
|
return document.createTextNode(this.message || "");
|
|
@@ -225,7 +227,7 @@ export default class InAppMessage {
|
|
|
225
227
|
Ho(t) {
|
|
226
228
|
t.setAttribute("alt", this.altImageText || "");
|
|
227
229
|
}
|
|
228
|
-
static
|
|
230
|
+
static eh(t) {
|
|
229
231
|
if (t.targetTouches && t.targetTouches.length > 1) return;
|
|
230
232
|
const s = t.target;
|
|
231
233
|
(s &&
|
|
@@ -236,23 +238,24 @@ export default class InAppMessage {
|
|
|
236
238
|
t.cancelable &&
|
|
237
239
|
t.preventDefault());
|
|
238
240
|
}
|
|
239
|
-
|
|
241
|
+
nh(t) {
|
|
242
|
+
this.ih = !1;
|
|
240
243
|
const s = t.parentNode;
|
|
241
244
|
this.zo() &&
|
|
242
245
|
null != s &&
|
|
243
|
-
this.orientation !==
|
|
246
|
+
this.orientation !== Ae.LANDSCAPE &&
|
|
244
247
|
(null != s.classList && s.classList.add(mr.TE),
|
|
245
248
|
document.body.addEventListener(
|
|
246
249
|
"touchmove",
|
|
247
|
-
InAppMessage.
|
|
250
|
+
InAppMessage.eh,
|
|
248
251
|
!!wt() && { passive: !1 },
|
|
249
252
|
)),
|
|
250
253
|
(t.className += " " + Tt);
|
|
251
254
|
}
|
|
252
|
-
static
|
|
255
|
+
static rh(t) {
|
|
253
256
|
if (
|
|
254
|
-
t.keyCode === Ce.
|
|
255
|
-
!r.er(U.
|
|
257
|
+
t.keyCode === Ce.oh &&
|
|
258
|
+
!r.er(U.lh) &&
|
|
256
259
|
document.querySelectorAll(".ab-modal-interactions").length > 0
|
|
257
260
|
) {
|
|
258
261
|
const t = document.getElementsByClassName("ab-html-message");
|
|
@@ -274,66 +277,65 @@ export default class InAppMessage {
|
|
|
274
277
|
}
|
|
275
278
|
}
|
|
276
279
|
}
|
|
277
|
-
|
|
280
|
+
uh() {
|
|
278
281
|
this.th ||
|
|
279
|
-
r.er(U.
|
|
280
|
-
(document.addEventListener("keydown", InAppMessage.
|
|
281
|
-
r.
|
|
282
|
-
document.removeEventListener("keydown", InAppMessage.
|
|
282
|
+
r.er(U.lh) ||
|
|
283
|
+
(document.addEventListener("keydown", InAppMessage.rh, !1),
|
|
284
|
+
r.ah(() => {
|
|
285
|
+
document.removeEventListener("keydown", InAppMessage.rh);
|
|
283
286
|
}),
|
|
284
287
|
(this.th = !0));
|
|
285
288
|
}
|
|
286
289
|
qt(t) {
|
|
287
290
|
const s = {};
|
|
288
291
|
return t
|
|
289
|
-
? ((s[cr.
|
|
290
|
-
(s[cr.
|
|
291
|
-
(s[cr.
|
|
292
|
+
? ((s[cr.UE] = this.message),
|
|
293
|
+
(s[cr.cE] = this.messageAlignment),
|
|
294
|
+
(s[cr.nE] = this.slideFrom),
|
|
292
295
|
(s[cr.Is] = this.extras),
|
|
293
|
-
(s[cr.
|
|
294
|
-
(s[cr.
|
|
296
|
+
(s[cr.PE] = this.triggerId),
|
|
297
|
+
(s[cr.iE] = this.clickAction),
|
|
295
298
|
(s[cr.URI] = this.uri),
|
|
296
|
-
(s[cr.
|
|
297
|
-
(s[cr.
|
|
298
|
-
(s[cr.
|
|
299
|
-
(s[cr.
|
|
299
|
+
(s[cr.pE] = this.openTarget),
|
|
300
|
+
(s[cr.rE] = this.dismissType),
|
|
301
|
+
(s[cr.mE] = this.duration),
|
|
302
|
+
(s[cr.GE] = this.icon),
|
|
300
303
|
(s[cr.Bs] = this.imageUrl),
|
|
301
|
-
(s[cr.
|
|
302
|
-
(s[cr.
|
|
303
|
-
(s[cr.
|
|
304
|
-
(s[cr.
|
|
305
|
-
(s[cr.
|
|
306
|
-
(s[cr.
|
|
307
|
-
(s[cr.
|
|
308
|
-
(s[cr.
|
|
309
|
-
(s[cr.
|
|
310
|
-
(s[cr.
|
|
311
|
-
(s[cr.
|
|
312
|
-
(s[cr.
|
|
313
|
-
(s[cr.
|
|
314
|
-
(s[cr.
|
|
315
|
-
(s[cr.
|
|
316
|
-
(s[cr.
|
|
304
|
+
(s[cr.xE] = this.imageStyle),
|
|
305
|
+
(s[cr.HE] = this.iconColor),
|
|
306
|
+
(s[cr.FE] = this.iconBackgroundColor),
|
|
307
|
+
(s[cr.BE] = this.backgroundColor),
|
|
308
|
+
(s[cr.bE] = this.textColor),
|
|
309
|
+
(s[cr.gE] = this.closeButtonColor),
|
|
310
|
+
(s[cr.lE] = this.animateIn),
|
|
311
|
+
(s[cr.YE] = this.animateOut),
|
|
312
|
+
(s[cr.hE] = this.header),
|
|
313
|
+
(s[cr.KE] = this.headerAlignment),
|
|
314
|
+
(s[cr.WE] = this.headerTextColor),
|
|
315
|
+
(s[cr.XE] = this.frameColor),
|
|
316
|
+
(s[cr.yE] = this.buttons),
|
|
317
|
+
(s[cr.dE] = this.cropType),
|
|
318
|
+
(s[cr.uE] = this.orientation),
|
|
319
|
+
(s[cr.fE] = this.htmlId),
|
|
317
320
|
(s[cr.CSS] = this.css),
|
|
318
321
|
(s[cr.xs] = t),
|
|
319
|
-
(s[cr.
|
|
322
|
+
(s[cr.jE] = this.messageExtras),
|
|
320
323
|
(s[cr.LANGUAGE] = this.language),
|
|
321
324
|
(s[cr.Ns] = this.altImageText),
|
|
322
325
|
s)
|
|
323
326
|
: s;
|
|
324
327
|
}
|
|
325
328
|
}
|
|
326
|
-
(InAppMessage.
|
|
327
|
-
(InAppMessage.
|
|
328
|
-
(InAppMessage.SlideFrom = Ee),
|
|
329
|
+
(InAppMessage.mh = ss),
|
|
330
|
+
(InAppMessage.SlideFrom = De),
|
|
329
331
|
(InAppMessage.ClickAction = Le),
|
|
330
332
|
(InAppMessage.DismissType = pr),
|
|
331
333
|
(InAppMessage.OpenTarget = ut),
|
|
332
|
-
(InAppMessage.ImageStyle =
|
|
333
|
-
(InAppMessage.Orientation =
|
|
334
|
-
(InAppMessage.TextAlignment =
|
|
334
|
+
(InAppMessage.ImageStyle = qe),
|
|
335
|
+
(InAppMessage.Orientation = Ae),
|
|
336
|
+
(InAppMessage.TextAlignment = Ee),
|
|
335
337
|
(InAppMessage.CropType = Me),
|
|
336
338
|
(InAppMessage.dh = dt),
|
|
337
|
-
(InAppMessage.gr =
|
|
338
|
-
(InAppMessage.
|
|
339
|
+
(InAppMessage.gr = At.gr),
|
|
340
|
+
(InAppMessage.sE = At.sE),
|
|
339
341
|
(InAppMessage.bs = cr);
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
IamDismissType as pr,
|
|
4
4
|
IamSerializationKeys as cr,
|
|
5
5
|
IamServerTypes as dt,
|
|
6
|
-
IamTextAlignment as
|
|
6
|
+
IamTextAlignment as Ee,
|
|
7
7
|
} from "../constants.js";
|
|
8
8
|
import { buttonsFromSerializedInAppMessage as ur } from "../in-app-message-factory.js";
|
|
9
9
|
import InAppMessage from "./in-app-message.js";
|
|
@@ -74,41 +74,41 @@ export default class ModalMessage extends InAppMessage {
|
|
|
74
74
|
B,
|
|
75
75
|
C,
|
|
76
76
|
),
|
|
77
|
-
(this.Go =
|
|
77
|
+
(this.Go = Ee.CENTER);
|
|
78
78
|
}
|
|
79
79
|
qt() {
|
|
80
|
-
return super.qt(dt.
|
|
80
|
+
return super.qt(dt.tE);
|
|
81
81
|
}
|
|
82
|
-
static
|
|
82
|
+
static da(r) {
|
|
83
83
|
return new ModalMessage(
|
|
84
|
-
r[cr.
|
|
85
|
-
r[cr.
|
|
84
|
+
r[cr.UE],
|
|
85
|
+
r[cr.cE],
|
|
86
86
|
r[cr.Is],
|
|
87
|
-
r[cr.
|
|
88
|
-
r[cr.
|
|
87
|
+
r[cr.PE],
|
|
88
|
+
r[cr.iE],
|
|
89
89
|
r[cr.URI],
|
|
90
|
+
r[cr.pE],
|
|
91
|
+
r[cr.rE],
|
|
92
|
+
r[cr.mE],
|
|
93
|
+
r[cr.GE],
|
|
94
|
+
r[cr.Bs],
|
|
90
95
|
r[cr.xE],
|
|
96
|
+
r[cr.HE],
|
|
97
|
+
r[cr.FE],
|
|
91
98
|
r[cr.BE],
|
|
92
|
-
r[cr.lE],
|
|
93
99
|
r[cr.bE],
|
|
94
|
-
r[cr.Bs],
|
|
95
100
|
r[cr.gE],
|
|
101
|
+
r[cr.lE],
|
|
96
102
|
r[cr.YE],
|
|
103
|
+
r[cr.hE],
|
|
97
104
|
r[cr.KE],
|
|
105
|
+
r[cr.WE],
|
|
98
106
|
r[cr.XE],
|
|
107
|
+
ur(r[cr.yE]),
|
|
99
108
|
r[cr.dE],
|
|
100
|
-
r[cr.hE],
|
|
101
|
-
r[cr.yE],
|
|
102
|
-
r[cr.uE],
|
|
103
|
-
r[cr.WE],
|
|
104
109
|
r[cr.fE],
|
|
105
|
-
r[cr.jE],
|
|
106
|
-
r[cr.kE],
|
|
107
|
-
ur(r[cr.vE]),
|
|
108
|
-
r[cr.wE],
|
|
109
|
-
r[cr.VE],
|
|
110
110
|
r[cr.CSS],
|
|
111
|
-
r[cr.
|
|
111
|
+
r[cr.jE],
|
|
112
112
|
r[cr.LANGUAGE],
|
|
113
113
|
r[cr.Ns],
|
|
114
114
|
);
|
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
IamColors as ss,
|
|
5
5
|
IamSerializationKeys as cr,
|
|
6
6
|
IamServerTypes as dt,
|
|
7
|
-
IamSlideFrom as
|
|
8
|
-
IamTextAlignment as
|
|
7
|
+
IamSlideFrom as De,
|
|
8
|
+
IamTextAlignment as Ee,
|
|
9
9
|
} from "../constants.js";
|
|
10
10
|
export default class SlideUpMessage extends InAppMessage {
|
|
11
11
|
constructor(
|
|
@@ -34,11 +34,11 @@ export default class SlideUpMessage extends InAppMessage {
|
|
|
34
34
|
b,
|
|
35
35
|
z,
|
|
36
36
|
) {
|
|
37
|
-
(f = f || ss.
|
|
38
|
-
(v = v || ss.
|
|
37
|
+
(f = f || ss.OE),
|
|
38
|
+
(v = v || ss.SE),
|
|
39
39
|
super(
|
|
40
40
|
t,
|
|
41
|
-
(s = s ||
|
|
41
|
+
(s = s || Ee.START),
|
|
42
42
|
e,
|
|
43
43
|
o,
|
|
44
44
|
i,
|
|
@@ -70,7 +70,7 @@ export default class SlideUpMessage extends InAppMessage {
|
|
|
70
70
|
b,
|
|
71
71
|
z,
|
|
72
72
|
),
|
|
73
|
-
(this.Go =
|
|
73
|
+
(this.Go = Ee.START);
|
|
74
74
|
}
|
|
75
75
|
zo() {
|
|
76
76
|
return !1;
|
|
@@ -79,41 +79,41 @@ export default class SlideUpMessage extends InAppMessage {
|
|
|
79
79
|
const t = document.createElement("span");
|
|
80
80
|
return t.appendChild(document.createTextNode(this.message || "")), t;
|
|
81
81
|
}
|
|
82
|
-
|
|
82
|
+
nh(t) {
|
|
83
83
|
const s = t.getElementsByClassName("ab-in-app-message")[0];
|
|
84
84
|
Mt.td(s, !0, !0) ||
|
|
85
|
-
(this.slideFrom ===
|
|
85
|
+
(this.slideFrom === De.TOP
|
|
86
86
|
? (s.style.top = "0px")
|
|
87
87
|
: (s.style.bottom = "0px")),
|
|
88
|
-
super.
|
|
88
|
+
super.nh(t);
|
|
89
89
|
}
|
|
90
90
|
qt() {
|
|
91
|
-
return super.qt(dt.
|
|
91
|
+
return super.qt(dt.RE);
|
|
92
92
|
}
|
|
93
|
-
static
|
|
93
|
+
static da(t) {
|
|
94
94
|
return new SlideUpMessage(
|
|
95
|
+
t[cr.UE],
|
|
96
|
+
t[cr.cE],
|
|
97
|
+
t[cr.nE],
|
|
98
|
+
t[cr.Is],
|
|
99
|
+
t[cr.PE],
|
|
100
|
+
t[cr.iE],
|
|
101
|
+
t[cr.URI],
|
|
102
|
+
t[cr.pE],
|
|
95
103
|
t[cr.rE],
|
|
96
104
|
t[cr.mE],
|
|
97
105
|
t[cr.GE],
|
|
98
|
-
t[cr.
|
|
99
|
-
t[cr.FE],
|
|
106
|
+
t[cr.Bs],
|
|
100
107
|
t[cr.HE],
|
|
101
|
-
t[cr.
|
|
102
|
-
t[cr.xE],
|
|
108
|
+
t[cr.FE],
|
|
103
109
|
t[cr.BE],
|
|
104
|
-
t[cr.lE],
|
|
105
110
|
t[cr.bE],
|
|
106
|
-
t[cr.
|
|
111
|
+
t[cr.gE],
|
|
112
|
+
t[cr.lE],
|
|
107
113
|
t[cr.YE],
|
|
108
|
-
t[cr.
|
|
109
|
-
t[cr.XE],
|
|
110
|
-
t[cr.dE],
|
|
111
|
-
t[cr.hE],
|
|
112
|
-
t[cr.yE],
|
|
113
|
-
t[cr.uE],
|
|
114
|
-
t[cr.VE],
|
|
114
|
+
t[cr.fE],
|
|
115
115
|
t[cr.CSS],
|
|
116
|
-
t[cr.
|
|
116
|
+
t[cr.jE],
|
|
117
117
|
t[cr.LANGUAGE],
|
|
118
118
|
t[cr.Ns],
|
|
119
119
|
);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export default class Jt {
|
|
2
2
|
constructor(t, s, i, h, l) {
|
|
3
3
|
(this.triggerId = t),
|
|
4
|
-
(this.
|
|
5
|
-
(this.
|
|
6
|
-
(this.
|
|
4
|
+
(this.pa = s),
|
|
5
|
+
(this.la = i),
|
|
6
|
+
(this.ha = h),
|
|
7
7
|
(this.ca = l),
|
|
8
8
|
(this.triggerId = t),
|
|
9
|
-
(this.
|
|
10
|
-
(this.
|
|
11
|
-
(this.
|
|
9
|
+
(this.pa = s),
|
|
10
|
+
(this.la = i),
|
|
11
|
+
(this.ha = h),
|
|
12
12
|
(this.ca = l);
|
|
13
13
|
}
|
|
14
14
|
static fromJson(t, s, i, h, l) {
|
|
@@ -7,9 +7,9 @@ export function automaticallyShowInAppMessages() {
|
|
|
7
7
|
if (!r.rr()) return;
|
|
8
8
|
rs();
|
|
9
9
|
const s = je.ra();
|
|
10
|
-
if (null == s.
|
|
10
|
+
if (null == s.Nn()) {
|
|
11
11
|
const r = subscribeToInAppMessage((s) => showInAppMessage(s));
|
|
12
|
-
s.
|
|
12
|
+
s.Fn(r);
|
|
13
13
|
}
|
|
14
|
-
return s.
|
|
14
|
+
return s.Nn();
|
|
15
15
|
}
|
|
@@ -4,7 +4,7 @@ import HtmlMessage from "../models/html-message.js";
|
|
|
4
4
|
import InAppMessage from "../models/in-app-message.js";
|
|
5
5
|
import SlideUpMessage from "../models/slide-up-message.js";
|
|
6
6
|
import be from "../display/get-animation-effect.js";
|
|
7
|
-
import
|
|
7
|
+
import Fe from "../display/in-app-message-to-html.js";
|
|
8
8
|
import { logInAppMessageImpression } from "../log-in-app-message-impression.js";
|
|
9
9
|
import {
|
|
10
10
|
ORIENTATION as Ue,
|
|
@@ -18,11 +18,12 @@ import { toRgba as ke } from "../../util/color-utils.js";
|
|
|
18
18
|
import { isIFrame as St } from "../utils/in-app-message-utils.js";
|
|
19
19
|
import Je from "../../l10n/l10n-manager-factory.js";
|
|
20
20
|
import {
|
|
21
|
-
IamTiming as
|
|
21
|
+
IamTiming as At,
|
|
22
22
|
IamClickAction as Le,
|
|
23
23
|
IamDismissType as pr,
|
|
24
|
-
IamOrientation as
|
|
25
|
-
IamSlideFrom as
|
|
24
|
+
IamOrientation as Ae,
|
|
25
|
+
IamSlideFrom as De,
|
|
26
|
+
IAM_SHOWING_CLASS as Se,
|
|
26
27
|
} from "../constants.js";
|
|
27
28
|
export function showInAppMessage(e, t, s) {
|
|
28
29
|
if (!r.rr()) return;
|
|
@@ -37,7 +38,7 @@ export function showInAppMessage(e, t, s) {
|
|
|
37
38
|
);
|
|
38
39
|
if (!(e instanceof InAppMessage)) return !1;
|
|
39
40
|
if (e.constructor === InAppMessage) return !1;
|
|
40
|
-
e.
|
|
41
|
+
e.uh();
|
|
41
42
|
const o = e instanceof HtmlMessage;
|
|
42
43
|
if (o && !e.trusted && !r.dr())
|
|
43
44
|
return (
|
|
@@ -47,7 +48,7 @@ export function showInAppMessage(e, t, s) {
|
|
|
47
48
|
!1
|
|
48
49
|
);
|
|
49
50
|
if ((null == t && (t = document.body), e.zo())) {
|
|
50
|
-
if (t.querySelectorAll(
|
|
51
|
+
if (t.querySelectorAll(`.ab-modal-interactions, .${Se}`).length > 0)
|
|
51
52
|
return (
|
|
52
53
|
b.info(
|
|
53
54
|
`Cannot show in-app message ${e.message} because another message is being shown.`,
|
|
@@ -55,14 +56,14 @@ export function showInAppMessage(e, t, s) {
|
|
|
55
56
|
!1
|
|
56
57
|
);
|
|
57
58
|
}
|
|
58
|
-
if (no.
|
|
59
|
-
const t = no.
|
|
59
|
+
if (no.ba()) {
|
|
60
|
+
const t = no.wa();
|
|
60
61
|
if (
|
|
61
|
-
(t === Ue.PORTRAIT && e.orientation ===
|
|
62
|
-
(t === Ue.LANDSCAPE && e.orientation ===
|
|
62
|
+
(t === Ue.PORTRAIT && e.orientation === Ae.LANDSCAPE) ||
|
|
63
|
+
(t === Ue.LANDSCAPE && e.orientation === Ae.PORTRAIT)
|
|
63
64
|
) {
|
|
64
65
|
const s = t === Ue.PORTRAIT ? "portrait" : "landscape",
|
|
65
|
-
o = e.orientation ===
|
|
66
|
+
o = e.orientation === Ae.PORTRAIT ? "portrait" : "landscape";
|
|
66
67
|
return (
|
|
67
68
|
b.info(
|
|
68
69
|
`Not showing ${o} in-app message ${e.message} because the screen is currently ${s}`,
|
|
@@ -92,10 +93,11 @@ export function showInAppMessage(e, t, s) {
|
|
|
92
93
|
const i = document.createElement("div");
|
|
93
94
|
if (
|
|
94
95
|
((i.className = "ab-iam-root v3"),
|
|
96
|
+
e.zo() && (i.className += ` ${Se}`),
|
|
95
97
|
(i.className += be(e)),
|
|
96
98
|
e.language && !o && (i.lang = e.language),
|
|
97
99
|
e.Bo() && (i.id = e.htmlId),
|
|
98
|
-
r.er(U.
|
|
100
|
+
r.er(U.va) && (i.style.zIndex = (r.er(U.va) + 1).toString()),
|
|
99
101
|
t.appendChild(i),
|
|
100
102
|
e.Mo())
|
|
101
103
|
) {
|
|
@@ -106,7 +108,7 @@ export function showInAppMessage(e, t, s) {
|
|
|
106
108
|
document.getElementsByTagName("head")[0].appendChild(t);
|
|
107
109
|
}
|
|
108
110
|
const n = e instanceof SlideUpMessage,
|
|
109
|
-
a =
|
|
111
|
+
a = Fe(
|
|
110
112
|
e,
|
|
111
113
|
(t) => {
|
|
112
114
|
if (e.zo() && e.od()) {
|
|
@@ -114,17 +116,17 @@ export function showInAppMessage(e, t, s) {
|
|
|
114
116
|
if (
|
|
115
117
|
((s.className = "ab-page-blocker"),
|
|
116
118
|
e.Mo() || (s.style.backgroundColor = ke(e.frameColor)),
|
|
117
|
-
r.er(U.
|
|
119
|
+
r.er(U.va) && (s.style.zIndex = r.er(U.va).toString()),
|
|
118
120
|
i.appendChild(s),
|
|
119
|
-
!r.er(U.
|
|
121
|
+
!r.er(U.lh))
|
|
120
122
|
) {
|
|
121
123
|
const o = new Date().valueOf();
|
|
122
124
|
s.onclick = (s) => {
|
|
123
|
-
new Date().valueOf() - o >
|
|
125
|
+
new Date().valueOf() - o > At.sE &&
|
|
124
126
|
(e.tl(t), s.stopPropagation());
|
|
125
127
|
};
|
|
126
128
|
}
|
|
127
|
-
i.appendChild(t), t.focus(), e.
|
|
129
|
+
i.appendChild(t), t.focus(), e.nh(i);
|
|
128
130
|
} else if (n) {
|
|
129
131
|
const s = document.querySelectorAll(".ab-slideup");
|
|
130
132
|
let o = null;
|
|
@@ -133,7 +135,7 @@ export function showInAppMessage(e, t, s) {
|
|
|
133
135
|
o = s[e];
|
|
134
136
|
break;
|
|
135
137
|
}
|
|
136
|
-
if (e.slideFrom ===
|
|
138
|
+
if (e.slideFrom === De.TOP) {
|
|
137
139
|
let e = 0;
|
|
138
140
|
null != o && (e = o.offsetTop + o.offsetHeight),
|
|
139
141
|
(t.style.top = Math.max(e, 0) + "px");
|
|
@@ -145,12 +147,12 @@ export function showInAppMessage(e, t, s) {
|
|
|
145
147
|
o.offsetTop),
|
|
146
148
|
(t.style.bottom = Math.max(e, 0) + "px");
|
|
147
149
|
}
|
|
148
|
-
} else if (o && !r.er(U.
|
|
150
|
+
} else if (o && !r.er(U.lh)) {
|
|
149
151
|
const s = e;
|
|
150
152
|
St(t) &&
|
|
151
153
|
t.contentWindow &&
|
|
152
154
|
t.contentWindow.addEventListener("keydown", function (e) {
|
|
153
|
-
e.keyCode === Ce.
|
|
155
|
+
e.keyCode === Ce.oh && s.closeMessage();
|
|
154
156
|
});
|
|
155
157
|
}
|
|
156
158
|
logInAppMessageImpression(e),
|
|
@@ -161,13 +163,13 @@ export function showInAppMessage(e, t, s) {
|
|
|
161
163
|
"function" == typeof s && s();
|
|
162
164
|
},
|
|
163
165
|
(e) => {
|
|
164
|
-
b.info(e);
|
|
166
|
+
b.info(e), i.parentNode && i.parentNode.removeChild(i);
|
|
165
167
|
},
|
|
166
|
-
r.er(U.
|
|
167
|
-
r.er(U.
|
|
168
|
+
r.er(U.ya),
|
|
169
|
+
r.er(U.va),
|
|
168
170
|
r.er(U.sr),
|
|
169
171
|
t,
|
|
170
|
-
Je.ra().
|
|
172
|
+
Je.ra().za(),
|
|
171
173
|
);
|
|
172
|
-
return (o || n) && (i.appendChild(a), e.
|
|
174
|
+
return (o || n) && (i.appendChild(a), e.nh(i)), !0;
|
|
173
175
|
}
|
package/src/Push/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { isPushBlocked } from "./is-push-blocked.js";
|
|
2
2
|
export { isPushPermissionGranted } from "./is-push-permission-granted.js";
|
|
3
3
|
export { isPushSupported } from "./is-push-supported.js";
|
|
4
|
+
export { registerPush } from "./register-push.js";
|
|
4
5
|
export { requestPushPermission } from "./request-push-permission.js";
|
|
5
6
|
export { unregisterPush } from "./unregister-push.js";
|
|
@@ -8,15 +8,15 @@ const ra = {
|
|
|
8
8
|
ra.na ||
|
|
9
9
|
(ra.na = new na(
|
|
10
10
|
r.zr(),
|
|
11
|
-
r.
|
|
11
|
+
r.xa(),
|
|
12
12
|
r.ue(),
|
|
13
13
|
r.ht(),
|
|
14
|
-
r.er(U.xa),
|
|
15
|
-
r.er(U.ya),
|
|
16
14
|
r.er(U.Ma),
|
|
17
|
-
r.l(),
|
|
18
15
|
r.er(U._a),
|
|
19
16
|
r.er(U.ka),
|
|
17
|
+
r.l(),
|
|
18
|
+
r.er(U.qa),
|
|
19
|
+
r.er(U.Aa),
|
|
20
20
|
r.p(),
|
|
21
21
|
)),
|
|
22
22
|
ra.na
|