@braze/web-sdk 4.7.2 → 4.8.1
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 +32 -26
- package/package.json +1 -1
- package/shared-lib/braze-shared-lib.js +5 -5
- package/shared-lib/encoding-utils.js +1 -1
- package/shared-lib/event-types.js +25 -25
- package/shared-lib/guid.js +3 -3
- package/shared-lib/indexed-db-adapter.js +74 -74
- package/shared-lib/logger.js +18 -18
- package/shared-lib/supported-options.js +18 -18
- package/src/Card/card-manager-factory.js +2 -2
- package/src/Card/card-manager.js +48 -42
- package/src/Card/display/card-display.js +70 -67
- package/src/Card/log-card-click.js +1 -1
- package/src/Card/log-card-dismissal.js +1 -1
- package/src/Card/log-card-impressions.js +3 -3
- package/src/Card/models/banner.js +3 -2
- package/src/Card/models/captioned-image.js +6 -5
- package/src/Card/models/card.js +107 -87
- package/src/Card/models/classic-card.js +5 -5
- package/src/Card/models/control-card.js +5 -21
- package/src/Card/types.js +1 -0
- package/src/Card/util/card-factory.js +32 -32
- package/src/ContentCards/content-cards-provider-factory.js +3 -3
- package/src/ContentCards/content-cards-provider.js +283 -175
- package/src/ContentCards/content-cards.js +2 -2
- package/src/ContentCards/get-cached-content-cards.js +1 -1
- package/src/ContentCards/log-content-cards-displayed.js +2 -2
- package/src/ContentCards/request-content-cards-refresh.js +1 -1
- package/src/ContentCards/subscribe-to-content-cards-updates.js +9 -6
- package/src/ContentCards/types.js +1 -0
- package/src/ContentCards/ui/hide-content-cards.js +2 -2
- package/src/ContentCards/ui/show-content-cards.js +36 -34
- package/src/Core/add-sdk-metadata.js +17 -18
- package/src/Core/change-user.js +12 -14
- package/src/Core/destroy.js +1 -1
- package/src/Core/disable-sdk.js +8 -6
- package/src/Core/enable-sdk.js +4 -4
- package/src/Core/get-device-id.js +7 -6
- package/src/Core/get-user.js +1 -1
- package/src/Core/handle-braze-action.js +57 -40
- package/src/Core/is-disabled.js +2 -2
- package/src/Core/log-custom-event.js +22 -15
- package/src/Core/log-purchase.js +33 -33
- package/src/Core/open-session.js +17 -15
- package/src/Core/request-immediate-data-flush.js +4 -2
- package/src/Core/set-logger.js +1 -1
- package/src/Core/set-sdk-authentication-signature.js +5 -6
- package/src/Core/subscribe-to-sdk-authentication-failures.js +3 -1
- package/src/Core/toggle-logging.js +1 -1
- package/src/Core/types.js +1 -0
- package/src/Core/wipe-data.js +11 -10
- package/src/FeatureFlags/feature-flag-factory.js +6 -6
- package/src/FeatureFlags/feature-flag.js +17 -17
- package/src/FeatureFlags/feature-flags-provider-factory.js +2 -2
- package/src/FeatureFlags/feature-flags-provider.js +67 -65
- package/src/FeatureFlags/get-all-feature-flags.js +3 -3
- package/src/FeatureFlags/get-feature-flag.js +4 -4
- package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +4 -1
- package/src/Feed/feed-provider-factory.js +8 -8
- package/src/Feed/feed-provider.js +57 -46
- package/src/Feed/feed.js +1 -1
- package/src/Feed/get-cached-feed.js +2 -2
- package/src/Feed/log-feed-displayed.js +3 -1
- package/src/Feed/request-feed-refresh.js +2 -2
- package/src/Feed/subscribe-to-feed-updates.js +2 -2
- package/src/Feed/types.js +1 -0
- package/src/Feed/ui/hide-feed.js +2 -2
- package/src/Feed/ui/show-feed.js +41 -37
- package/src/InAppMessage/display/html-message-to-html.js +125 -119
- package/src/InAppMessage/display/in-app-message-to-html.js +72 -69
- package/src/InAppMessage/display/modal-utils.js +18 -13
- package/src/InAppMessage/in-app-message-factory.js +9 -8
- package/src/InAppMessage/in-app-message-manager-factory.js +7 -7
- package/src/InAppMessage/in-app-message-manager.js +130 -110
- package/src/InAppMessage/log-in-app-message-button-click.js +10 -10
- package/src/InAppMessage/log-in-app-message-click.js +9 -9
- package/src/InAppMessage/log-in-app-message-html-click.js +10 -10
- package/src/InAppMessage/log-in-app-message-impression.js +5 -5
- package/src/InAppMessage/models/control-message.js +4 -1
- package/src/InAppMessage/models/full-screen-message.js +35 -37
- package/src/InAppMessage/models/html-message.js +34 -33
- package/src/InAppMessage/models/in-app-message-button.js +23 -16
- package/src/InAppMessage/models/in-app-message.js +147 -105
- package/src/InAppMessage/models/modal-message.js +34 -36
- package/src/InAppMessage/models/slide-up-message.js +25 -27
- package/src/InAppMessage/models/templated-in-app-message.js +12 -7
- package/src/InAppMessage/subscribe-to-in-app-message.js +2 -2
- package/src/InAppMessage/types.js +1 -0
- package/src/InAppMessage/ui/automatically-show-in-app-messages.js +4 -4
- package/src/InAppMessage/ui/show-in-app-message.js +95 -89
- package/src/InAppMessage/utils/in-app-message-utils.js +1 -0
- 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 +20 -20
- package/src/Push/push-manager.js +193 -174
- package/src/Push/request-push-permission.js +4 -3
- package/src/Push/types.js +1 -0
- package/src/Push/unregister-push.js +2 -2
- package/src/Push/utils/push-utils.js +10 -10
- package/src/User/types.js +1 -0
- package/src/User/user-manager.js +24 -24
- package/src/User/user.js +117 -105
- package/src/common/base-feed.js +7 -7
- package/src/common/base-provider.js +2 -2
- package/src/common/constants.js +6 -0
- package/src/common/event-logger.js +6 -6
- package/src/common/feed-display.js +95 -85
- package/src/common/types.js +1 -0
- package/src/l10n/l10n-manager-factory.js +10 -10
- package/src/l10n/l10n-manager.js +1 -1
- package/src/managers/auth-manager.js +37 -34
- package/src/managers/braze-instance.js +209 -193
- package/src/managers/device-manager.js +43 -38
- package/src/managers/network-manager.js +119 -96
- package/src/managers/server-config-manager.js +68 -48
- package/src/managers/session-manager.js +52 -45
- package/src/managers/storage-manager-factory.js +29 -22
- package/src/managers/storage-manager.js +288 -273
- package/src/managers/subscription-manager.js +9 -6
- package/src/managers/types.js +1 -0
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +14 -8
- package/src/models/device.js +10 -18
- package/src/models/identifier.js +10 -11
- package/src/models/push-token.js +17 -12
- package/src/models/request-result.js +4 -4
- package/src/models/server-config.js +36 -20
- package/src/models/types.js +1 -0
- package/src/request-controller.js +176 -174
- package/src/triggers/models/custom-event-data.js +6 -6
- 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 +64 -64
- package/src/triggers/models/in-app-message-click-data.js +12 -12
- 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 +7 -7
- package/src/triggers/models/trigger-condition.js +57 -57
- package/src/triggers/models/trigger-events.js +2 -2
- package/src/triggers/models/trigger.js +42 -42
- package/src/triggers/triggers-provider-factory.js +8 -8
- package/src/triggers/triggers-provider.js +173 -170
- package/src/types.js +1 -0
- package/src/ui/js/attach-css.js +3 -3
- package/src/ui/js/load-font-awesome.js +2 -2
- package/src/util/base-device-parser.js +2 -2
- package/src/util/braze-actions.js +20 -20
- package/src/util/browser-detector.js +22 -22
- package/src/util/client-hints-parser.js +7 -7
- package/src/util/code-utils.js +1 -1
- package/src/util/color-utils.js +2 -2
- package/src/util/component-utils.js +2 -2
- package/src/util/deprecation-utils.js +1 -1
- package/src/util/device-constants.js +3 -3
- package/src/util/dom-utils.js +7 -7
- package/src/util/error-utils.js +2 -0
- package/src/util/key-codes.js +1 -1
- package/src/util/net.js +11 -11
- package/src/util/request-header-utils.js +23 -0
- package/src/util/string-utils.js +1 -1
- package/src/util/user-agent-parser.js +21 -21
- package/src/util/validation-utils.js +44 -44
- package/src/util/window-utils.js +3 -3
|
@@ -1,29 +1,36 @@
|
|
|
1
1
|
import InAppMessage from "./in-app-message.js";
|
|
2
|
-
import
|
|
2
|
+
import E from "../../managers/subscription-manager.js";
|
|
3
3
|
export default class InAppMessageButton {
|
|
4
|
-
constructor(s, t, i, r,
|
|
5
|
-
(this.text = s
|
|
6
|
-
(this.backgroundColor = t
|
|
7
|
-
(this.textColor = i
|
|
4
|
+
constructor(s, t, i, r, h, e, n) {
|
|
5
|
+
(this.text = s),
|
|
6
|
+
(this.backgroundColor = t),
|
|
7
|
+
(this.textColor = i),
|
|
8
|
+
(this.borderColor = r),
|
|
9
|
+
(this.clickAction = h),
|
|
10
|
+
(this.uri = e),
|
|
11
|
+
(this.id = n),
|
|
12
|
+
(this.text = s || ""),
|
|
13
|
+
(this.backgroundColor = t || InAppMessage.Vr.Ur),
|
|
14
|
+
(this.textColor = i || InAppMessage.Vr.Wr),
|
|
8
15
|
(this.borderColor = r || this.backgroundColor),
|
|
9
|
-
(this.clickAction =
|
|
10
|
-
(this.uri =
|
|
11
|
-
null == n && (n = InAppMessageButton
|
|
16
|
+
(this.clickAction = h || InAppMessage.ClickAction.NONE),
|
|
17
|
+
(this.uri = e),
|
|
18
|
+
null == n && (n = InAppMessageButton.Oi),
|
|
12
19
|
(this.id = n),
|
|
13
|
-
(this.
|
|
14
|
-
(this.
|
|
20
|
+
(this.vo = !1),
|
|
21
|
+
(this.ht = new E());
|
|
15
22
|
}
|
|
16
23
|
subscribeToClickedEvent(s) {
|
|
17
|
-
return this.lt
|
|
24
|
+
return this.ht.lt(s);
|
|
18
25
|
}
|
|
19
26
|
removeSubscription(s) {
|
|
20
|
-
this.
|
|
27
|
+
this.ht.removeSubscription(s);
|
|
21
28
|
}
|
|
22
29
|
removeAllSubscriptions() {
|
|
23
|
-
this.
|
|
30
|
+
this.ht.removeAllSubscriptions();
|
|
24
31
|
}
|
|
25
|
-
|
|
26
|
-
return !this.
|
|
32
|
+
p() {
|
|
33
|
+
return !this.vo && ((this.vo = !0), this.ht.Et(), !0);
|
|
27
34
|
}
|
|
28
35
|
static fromJson(s) {
|
|
29
36
|
return new InAppMessageButton(
|
|
@@ -37,4 +44,4 @@ export default class InAppMessageButton {
|
|
|
37
44
|
);
|
|
38
45
|
}
|
|
39
46
|
}
|
|
40
|
-
InAppMessageButton
|
|
47
|
+
InAppMessageButton.Oi = -1;
|
|
@@ -1,92 +1,126 @@
|
|
|
1
|
-
import e, { OPTIONS as
|
|
2
|
-
import
|
|
1
|
+
import e, { OPTIONS as L } from "../../managers/braze-instance.js";
|
|
2
|
+
import V from "../../util/browser-detector.js";
|
|
3
3
|
import {
|
|
4
4
|
clickElement as Et,
|
|
5
5
|
supportsPassive as Tt
|
|
6
6
|
} from "../../util/dom-utils.js";
|
|
7
|
-
import { KeyCodes as
|
|
8
|
-
import
|
|
7
|
+
import { KeyCodes as lt } from "../../util/key-codes.js";
|
|
8
|
+
import E from "../../managers/subscription-manager.js";
|
|
9
|
+
import { isIFrame as It } from "../utils/in-app-message-utils.js";
|
|
9
10
|
export default class InAppMessage {
|
|
10
11
|
constructor(
|
|
11
12
|
t,
|
|
12
13
|
s,
|
|
13
14
|
i,
|
|
14
|
-
e,
|
|
15
15
|
h,
|
|
16
|
+
e,
|
|
16
17
|
n,
|
|
17
|
-
r,
|
|
18
18
|
o,
|
|
19
|
+
r,
|
|
19
20
|
l,
|
|
20
|
-
|
|
21
|
+
u,
|
|
21
22
|
T,
|
|
22
23
|
a,
|
|
23
24
|
m,
|
|
24
25
|
c,
|
|
25
26
|
I,
|
|
27
|
+
L,
|
|
26
28
|
A,
|
|
27
29
|
N,
|
|
28
|
-
_,
|
|
29
|
-
L,
|
|
30
30
|
d,
|
|
31
|
+
_,
|
|
31
32
|
O,
|
|
32
33
|
S,
|
|
33
34
|
D,
|
|
34
35
|
M,
|
|
35
36
|
R,
|
|
36
37
|
b,
|
|
37
|
-
P,
|
|
38
38
|
p,
|
|
39
|
-
|
|
39
|
+
U,
|
|
40
|
+
P
|
|
40
41
|
) {
|
|
41
42
|
(this.message = t),
|
|
43
|
+
(this.messageAlignment = s),
|
|
44
|
+
(this.slideFrom = i),
|
|
45
|
+
(this.extras = h),
|
|
46
|
+
(this.triggerId = e),
|
|
47
|
+
(this.clickAction = n),
|
|
48
|
+
(this.uri = o),
|
|
49
|
+
(this.openTarget = r),
|
|
50
|
+
(this.dismissType = l),
|
|
51
|
+
(this.duration = u),
|
|
52
|
+
(this.icon = T),
|
|
53
|
+
(this.imageUrl = a),
|
|
54
|
+
(this.imageStyle = m),
|
|
55
|
+
(this.iconColor = c),
|
|
56
|
+
(this.iconBackgroundColor = I),
|
|
57
|
+
(this.backgroundColor = L),
|
|
58
|
+
(this.textColor = A),
|
|
59
|
+
(this.closeButtonColor = N),
|
|
60
|
+
(this.animateIn = d),
|
|
61
|
+
(this.animateOut = _),
|
|
62
|
+
(this.header = O),
|
|
63
|
+
(this.headerAlignment = S),
|
|
64
|
+
(this.headerTextColor = D),
|
|
65
|
+
(this.frameColor = M),
|
|
66
|
+
(this.buttons = R),
|
|
67
|
+
(this.cropType = b),
|
|
68
|
+
(this.orientation = p),
|
|
69
|
+
(this.htmlId = U),
|
|
70
|
+
(this.css = P),
|
|
71
|
+
(this.message = t),
|
|
42
72
|
(this.messageAlignment = s || InAppMessage.TextAlignment.CENTER),
|
|
43
|
-
(this.duration =
|
|
73
|
+
(this.duration = u || 5e3),
|
|
44
74
|
(this.slideFrom = i || InAppMessage.SlideFrom.BOTTOM),
|
|
45
|
-
(this.extras =
|
|
46
|
-
(this.triggerId =
|
|
75
|
+
(this.extras = h || {}),
|
|
76
|
+
(this.triggerId = e),
|
|
47
77
|
(this.clickAction = n || InAppMessage.ClickAction.NONE),
|
|
48
|
-
(this.uri =
|
|
49
|
-
(this.openTarget =
|
|
78
|
+
(this.uri = o),
|
|
79
|
+
(this.openTarget = r || InAppMessage.OpenTarget.NONE),
|
|
50
80
|
(this.dismissType = l || InAppMessage.DismissType.AUTO_DISMISS),
|
|
51
81
|
(this.icon = T),
|
|
52
82
|
(this.imageUrl = a),
|
|
53
83
|
(this.imageStyle = m || InAppMessage.ImageStyle.TOP),
|
|
54
|
-
(this.iconColor = c || InAppMessage.
|
|
55
|
-
(this.iconBackgroundColor = I || InAppMessage.
|
|
56
|
-
(this.backgroundColor =
|
|
57
|
-
(this.textColor =
|
|
58
|
-
(this.closeButtonColor =
|
|
59
|
-
(this.animateIn =
|
|
84
|
+
(this.iconColor = c || InAppMessage.Vr.Wr),
|
|
85
|
+
(this.iconBackgroundColor = I || InAppMessage.Vr.Ur),
|
|
86
|
+
(this.backgroundColor = L || InAppMessage.Vr.Wr),
|
|
87
|
+
(this.textColor = A || InAppMessage.Vr.th),
|
|
88
|
+
(this.closeButtonColor = N || InAppMessage.Vr.sh),
|
|
89
|
+
(this.animateIn = d),
|
|
60
90
|
null == this.animateIn && (this.animateIn = !0),
|
|
61
|
-
(this.animateOut =
|
|
91
|
+
(this.animateOut = _),
|
|
62
92
|
null == this.animateOut && (this.animateOut = !0),
|
|
63
93
|
(this.header = O),
|
|
64
94
|
(this.headerAlignment = S || InAppMessage.TextAlignment.CENTER),
|
|
65
|
-
(this.headerTextColor = D || InAppMessage.
|
|
66
|
-
(this.frameColor = M || InAppMessage.
|
|
95
|
+
(this.headerTextColor = D || InAppMessage.Vr.th),
|
|
96
|
+
(this.frameColor = M || InAppMessage.Vr.ih),
|
|
67
97
|
(this.buttons = R || []),
|
|
68
98
|
(this.cropType = b || InAppMessage.CropType.FIT_CENTER),
|
|
69
|
-
(this.orientation =
|
|
70
|
-
(this.htmlId =
|
|
71
|
-
(this.css =
|
|
99
|
+
(this.orientation = p),
|
|
100
|
+
(this.htmlId = U),
|
|
101
|
+
(this.css = P),
|
|
72
102
|
(this.isControl = !1),
|
|
73
|
-
(this.
|
|
74
|
-
(this.nl = !1),
|
|
103
|
+
(this.hh = !1),
|
|
75
104
|
(this.eh = !1),
|
|
76
|
-
(this.
|
|
77
|
-
(this.
|
|
105
|
+
(this.vo = !1),
|
|
106
|
+
(this.nh = !1),
|
|
107
|
+
(this.qe = null),
|
|
108
|
+
(this.ke = null),
|
|
109
|
+
(this.ht = new E()),
|
|
110
|
+
(this.oh = new E()),
|
|
111
|
+
(this.Le = InAppMessage.TextAlignment.CENTER);
|
|
78
112
|
}
|
|
79
113
|
subscribeToClickedEvent(t) {
|
|
80
|
-
return this.lt
|
|
114
|
+
return this.ht.lt(t);
|
|
81
115
|
}
|
|
82
116
|
subscribeToDismissedEvent(t) {
|
|
83
|
-
return this.
|
|
117
|
+
return this.oh.lt(t);
|
|
84
118
|
}
|
|
85
119
|
removeSubscription(t) {
|
|
86
|
-
this.
|
|
120
|
+
this.ht.removeSubscription(t), this.oh.removeSubscription(t);
|
|
87
121
|
}
|
|
88
122
|
removeAllSubscriptions() {
|
|
89
|
-
this.
|
|
123
|
+
this.ht.removeAllSubscriptions(), this.oh.removeAllSubscriptions();
|
|
90
124
|
}
|
|
91
125
|
closeMessage() {
|
|
92
126
|
this.he(this.qe);
|
|
@@ -94,41 +128,41 @@ export default class InAppMessage {
|
|
|
94
128
|
xe() {
|
|
95
129
|
return !0;
|
|
96
130
|
}
|
|
97
|
-
|
|
131
|
+
io() {
|
|
98
132
|
return this.xe();
|
|
99
133
|
}
|
|
100
|
-
|
|
134
|
+
$e() {
|
|
101
135
|
return null != this.htmlId && this.htmlId.length > 4;
|
|
102
136
|
}
|
|
103
137
|
ye() {
|
|
104
|
-
return this
|
|
138
|
+
return this.$e() && null != this.css && this.css.length > 0;
|
|
105
139
|
}
|
|
106
140
|
Ae() {
|
|
107
|
-
if (this
|
|
141
|
+
if (this.$e() && this.ye()) return this.htmlId + "-css";
|
|
108
142
|
}
|
|
109
|
-
|
|
110
|
-
return !this.
|
|
143
|
+
M() {
|
|
144
|
+
return !this.eh && ((this.eh = !0), !0);
|
|
111
145
|
}
|
|
112
|
-
|
|
113
|
-
return this.
|
|
146
|
+
Qr() {
|
|
147
|
+
return this.eh;
|
|
114
148
|
}
|
|
115
|
-
|
|
116
|
-
return !this.
|
|
149
|
+
p(t) {
|
|
150
|
+
return !this.vo && ((this.vo = !0), this.ht.Et(), !0);
|
|
117
151
|
}
|
|
118
|
-
|
|
119
|
-
return !this.
|
|
152
|
+
F() {
|
|
153
|
+
return !this.nh && ((this.nh = !0), this.oh.Et(), !0);
|
|
120
154
|
}
|
|
121
|
-
|
|
155
|
+
hide(t) {
|
|
122
156
|
if (t && t.parentNode) {
|
|
123
157
|
let s = t.closest(".ab-iam-root");
|
|
124
158
|
if ((null == s && (s = t), this.xe() && null != s.parentNode)) {
|
|
125
159
|
const t = s.parentNode.classList;
|
|
126
160
|
t && t.contains(InAppMessage.rh) && t.remove(InAppMessage.rh),
|
|
127
|
-
document.body.removeEventListener("touchmove", InAppMessage.
|
|
161
|
+
document.body.removeEventListener("touchmove", InAppMessage.lh);
|
|
128
162
|
}
|
|
129
|
-
s.className = s.className.replace(InAppMessage.
|
|
163
|
+
s.className = s.className.replace(InAppMessage.uh, InAppMessage.Eh);
|
|
130
164
|
}
|
|
131
|
-
return this.animateOut;
|
|
165
|
+
return this.animateOut || !1;
|
|
132
166
|
}
|
|
133
167
|
he(t, s) {
|
|
134
168
|
if (null == t) return;
|
|
@@ -138,65 +172,72 @@ export default class InAppMessage {
|
|
|
138
172
|
-1 === t.className.indexOf("ab-in-app-message")
|
|
139
173
|
? t.getElementsByClassName("ab-in-app-message")[0]
|
|
140
174
|
: t);
|
|
141
|
-
let
|
|
142
|
-
i && (
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
|
|
175
|
+
let h = !1;
|
|
176
|
+
i && (h = this.hide(i));
|
|
177
|
+
const e = document.body;
|
|
178
|
+
let n;
|
|
179
|
+
null != e && (n = e.scrollTop);
|
|
180
|
+
const o = () => {
|
|
146
181
|
if (t && t.parentNode) {
|
|
147
182
|
let s = t.closest(".ab-iam-root");
|
|
148
183
|
null == s && (s = t), s.parentNode && s.parentNode.removeChild(s);
|
|
149
184
|
}
|
|
150
|
-
|
|
151
|
-
|
|
185
|
+
const i = this.Ae();
|
|
186
|
+
if (null != i) {
|
|
187
|
+
const t = document.getElementById(i);
|
|
152
188
|
t && t.parentNode && t.parentNode.removeChild(t);
|
|
153
189
|
}
|
|
154
|
-
null !=
|
|
155
|
-
s ? s() : this.
|
|
190
|
+
null != e && "Safari" === V.browser && (e.scrollTop = n),
|
|
191
|
+
s ? s() : this.F();
|
|
156
192
|
};
|
|
157
|
-
|
|
193
|
+
h ? setTimeout(o, InAppMessage.Th) : o(), this.ke && this.ke.focus();
|
|
158
194
|
}
|
|
159
195
|
Be() {
|
|
160
|
-
return document.createTextNode(this.message);
|
|
196
|
+
return document.createTextNode(this.message || "");
|
|
161
197
|
}
|
|
162
198
|
Ie(t) {
|
|
163
199
|
let s = "";
|
|
164
200
|
this.message || this.header || !this.xe() || (s = "Modal Image"),
|
|
165
201
|
t.setAttribute("alt", s);
|
|
166
202
|
}
|
|
167
|
-
static
|
|
168
|
-
(t.targetTouches && t.targetTouches.length > 1)
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
203
|
+
static lh(t) {
|
|
204
|
+
if (t.targetTouches && t.targetTouches.length > 1) return;
|
|
205
|
+
const s = t.target;
|
|
206
|
+
(s &&
|
|
207
|
+
s.classList &&
|
|
208
|
+
s.classList.contains("ab-message-text") &&
|
|
209
|
+
s.scrollHeight > s.clientHeight) ||
|
|
172
210
|
(document.querySelector(`.${InAppMessage.rh}`) && t.preventDefault());
|
|
173
211
|
}
|
|
174
|
-
|
|
212
|
+
ah(t) {
|
|
213
|
+
const s = t.parentNode;
|
|
175
214
|
this.xe() &&
|
|
176
|
-
null !=
|
|
215
|
+
null != s &&
|
|
177
216
|
this.orientation !== InAppMessage.Orientation.LANDSCAPE &&
|
|
178
|
-
(null !=
|
|
179
|
-
t.parentNode.classList.add(InAppMessage.rh),
|
|
217
|
+
(null != s.classList && s.classList.add(InAppMessage.rh),
|
|
180
218
|
document.body.addEventListener(
|
|
181
219
|
"touchmove",
|
|
182
|
-
InAppMessage.
|
|
220
|
+
InAppMessage.lh,
|
|
183
221
|
!!Tt() && { passive: !1 }
|
|
184
222
|
)),
|
|
185
|
-
(t.className += " " + InAppMessage.
|
|
223
|
+
(t.className += " " + InAppMessage.uh);
|
|
186
224
|
}
|
|
187
|
-
static
|
|
225
|
+
static mh(t) {
|
|
188
226
|
if (
|
|
189
|
-
t.keyCode ===
|
|
190
|
-
!e.nn(
|
|
227
|
+
t.keyCode === lt.Ih &&
|
|
228
|
+
!e.nn(L.Lh) &&
|
|
191
229
|
document.querySelectorAll(".ab-modal-interactions").length > 0
|
|
192
230
|
) {
|
|
193
231
|
const t = document.getElementsByClassName("ab-html-message");
|
|
194
232
|
let s = !1;
|
|
195
|
-
for (
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
233
|
+
for (const i of t) {
|
|
234
|
+
let t = null;
|
|
235
|
+
It(i) &&
|
|
236
|
+
i.contentWindow &&
|
|
237
|
+
(t = i.contentWindow.document.getElementsByClassName(
|
|
238
|
+
"ab-programmatic-close-button"
|
|
239
|
+
)[0]),
|
|
240
|
+
null != t && (Et(t), (s = !0));
|
|
200
241
|
}
|
|
201
242
|
if (!s) {
|
|
202
243
|
const t = document.querySelectorAll(
|
|
@@ -207,31 +248,31 @@ export default class InAppMessage {
|
|
|
207
248
|
}
|
|
208
249
|
}
|
|
209
250
|
Ah() {
|
|
210
|
-
this.
|
|
211
|
-
e.nn(
|
|
212
|
-
(document.addEventListener("keydown", InAppMessage.
|
|
213
|
-
e.
|
|
214
|
-
document.removeEventListener("keydown", InAppMessage.
|
|
251
|
+
this.hh ||
|
|
252
|
+
e.nn(L.Lh) ||
|
|
253
|
+
(document.addEventListener("keydown", InAppMessage.mh, !1),
|
|
254
|
+
e.Nh(() => {
|
|
255
|
+
document.removeEventListener("keydown", InAppMessage.mh);
|
|
215
256
|
}),
|
|
216
|
-
(this.
|
|
257
|
+
(this.hh = !0));
|
|
217
258
|
}
|
|
218
259
|
}
|
|
219
|
-
(InAppMessage.
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
260
|
+
(InAppMessage.Vr = {
|
|
261
|
+
th: 4281545523,
|
|
262
|
+
Wr: 4294967295,
|
|
263
|
+
Ur: 4278219733,
|
|
264
|
+
dh: 4293914607,
|
|
265
|
+
_h: 4283782485,
|
|
266
|
+
ih: 3224580915,
|
|
267
|
+
sh: 4288387995
|
|
227
268
|
}),
|
|
228
269
|
(InAppMessage.Me = {
|
|
229
270
|
Oh: "hd",
|
|
230
271
|
ze: "ias",
|
|
231
272
|
Sh: "of",
|
|
232
273
|
Dh: "do",
|
|
233
|
-
|
|
234
|
-
|
|
274
|
+
Or: "umt",
|
|
275
|
+
Zi: "tf",
|
|
235
276
|
Mh: "te"
|
|
236
277
|
}),
|
|
237
278
|
(InAppMessage.SlideFrom = { TOP: "TOP", BOTTOM: "BOTTOM" }),
|
|
@@ -256,16 +297,17 @@ export default class InAppMessage {
|
|
|
256
297
|
CENTER_CROP: "CENTER_CROP",
|
|
257
298
|
FIT_CENTER: "FIT_CENTER"
|
|
258
299
|
}),
|
|
259
|
-
(InAppMessage.
|
|
300
|
+
(InAppMessage.Ee = {
|
|
260
301
|
Rh: "SLIDEUP",
|
|
261
302
|
bh: "MODAL",
|
|
262
303
|
Ne: "MODAL_STYLED",
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
Pe: "HTML"
|
|
304
|
+
so: "FULL",
|
|
305
|
+
do: "WEB_HTML",
|
|
306
|
+
Pe: "HTML",
|
|
307
|
+
ph: "HTML_FULL"
|
|
266
308
|
}),
|
|
267
|
-
(InAppMessage.
|
|
268
|
-
(InAppMessage.
|
|
269
|
-
(InAppMessage.
|
|
309
|
+
(InAppMessage.Th = 500),
|
|
310
|
+
(InAppMessage.Uh = 200),
|
|
311
|
+
(InAppMessage.uh = "ab-show"),
|
|
270
312
|
(InAppMessage.Eh = "ab-hide"),
|
|
271
313
|
(InAppMessage.rh = "ab-pause-scrolling");
|
|
@@ -1,68 +1,66 @@
|
|
|
1
1
|
import InAppMessage from "./in-app-message.js";
|
|
2
2
|
export default class ModalMessage extends InAppMessage {
|
|
3
3
|
constructor(
|
|
4
|
+
s,
|
|
4
5
|
e,
|
|
6
|
+
o,
|
|
5
7
|
t,
|
|
6
8
|
r,
|
|
7
|
-
|
|
8
|
-
n,
|
|
9
|
-
l,
|
|
10
|
-
o,
|
|
11
|
-
u,
|
|
12
|
-
a,
|
|
9
|
+
i,
|
|
13
10
|
p,
|
|
11
|
+
a,
|
|
14
12
|
d,
|
|
15
|
-
i,
|
|
16
|
-
m,
|
|
17
13
|
c,
|
|
14
|
+
m,
|
|
15
|
+
n,
|
|
16
|
+
u,
|
|
18
17
|
f,
|
|
19
|
-
|
|
18
|
+
l,
|
|
19
|
+
v,
|
|
20
20
|
x,
|
|
21
|
+
g,
|
|
22
|
+
h,
|
|
21
23
|
j,
|
|
22
|
-
v,
|
|
23
|
-
A,
|
|
24
|
-
T,
|
|
25
24
|
b,
|
|
26
|
-
h,
|
|
27
25
|
k,
|
|
28
26
|
q,
|
|
29
27
|
w,
|
|
30
|
-
y
|
|
28
|
+
y,
|
|
29
|
+
z,
|
|
30
|
+
A
|
|
31
31
|
) {
|
|
32
32
|
super(
|
|
33
|
+
s,
|
|
33
34
|
e,
|
|
35
|
+
void 0,
|
|
36
|
+
o,
|
|
34
37
|
t,
|
|
35
|
-
null,
|
|
36
38
|
r,
|
|
37
|
-
|
|
38
|
-
n,
|
|
39
|
-
l,
|
|
40
|
-
o,
|
|
41
|
-
(u = u || InAppMessage.DismissType.MANUAL),
|
|
42
|
-
a,
|
|
39
|
+
i,
|
|
43
40
|
p,
|
|
41
|
+
(a = a || InAppMessage.DismissType.MANUAL),
|
|
44
42
|
d,
|
|
45
|
-
i,
|
|
46
|
-
m,
|
|
47
43
|
c,
|
|
44
|
+
m,
|
|
45
|
+
n,
|
|
46
|
+
u,
|
|
48
47
|
f,
|
|
49
|
-
|
|
48
|
+
l,
|
|
49
|
+
v,
|
|
50
50
|
x,
|
|
51
|
+
g,
|
|
52
|
+
h,
|
|
51
53
|
j,
|
|
52
|
-
v,
|
|
53
|
-
A,
|
|
54
|
-
T,
|
|
55
54
|
b,
|
|
56
|
-
h,
|
|
57
55
|
k,
|
|
58
|
-
|
|
59
|
-
void 0,
|
|
56
|
+
q,
|
|
60
57
|
w,
|
|
61
|
-
y
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
58
|
+
(y = y || InAppMessage.CropType.FIT_CENTER),
|
|
59
|
+
void 0,
|
|
60
|
+
z,
|
|
61
|
+
A
|
|
62
|
+
),
|
|
63
|
+
(this.Le = InAppMessage.TextAlignment.CENTER);
|
|
66
64
|
}
|
|
67
65
|
}
|
|
68
|
-
ModalMessage.es = InAppMessage.
|
|
66
|
+
ModalMessage.es = InAppMessage.Ee.bh;
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import InAppMessage from "./in-app-message.js";
|
|
2
|
-
import { DOMUtils as
|
|
2
|
+
import { DOMUtils as so } from "../../util/dom-utils.js";
|
|
3
3
|
export default class SlideUpMessage extends InAppMessage {
|
|
4
|
-
constructor(
|
|
5
|
-
(x = x || InAppMessage.
|
|
6
|
-
(
|
|
4
|
+
constructor(o, s, t, e, i, d, n, r, a, p, u, m, c, v, l, x, h, f, g, I, M) {
|
|
5
|
+
(x = x || InAppMessage.Vr._h),
|
|
6
|
+
(l = l || InAppMessage.Vr.dh),
|
|
7
7
|
super(
|
|
8
|
-
t,
|
|
9
|
-
(e = e || InAppMessage.TextAlignment.START),
|
|
10
8
|
o,
|
|
11
|
-
s,
|
|
12
|
-
|
|
9
|
+
(s = s || InAppMessage.TextAlignment.START),
|
|
10
|
+
t,
|
|
11
|
+
e,
|
|
13
12
|
i,
|
|
14
|
-
r,
|
|
15
13
|
d,
|
|
16
|
-
|
|
14
|
+
n,
|
|
15
|
+
r,
|
|
17
16
|
a,
|
|
18
17
|
p,
|
|
19
|
-
|
|
20
|
-
null,
|
|
18
|
+
u,
|
|
21
19
|
m,
|
|
20
|
+
void 0,
|
|
22
21
|
c,
|
|
23
22
|
v,
|
|
23
|
+
l,
|
|
24
24
|
x,
|
|
25
|
-
g,
|
|
26
|
-
f,
|
|
27
25
|
h,
|
|
26
|
+
f,
|
|
27
|
+
g,
|
|
28
28
|
void 0,
|
|
29
29
|
void 0,
|
|
30
30
|
void 0,
|
|
@@ -34,25 +34,23 @@ export default class SlideUpMessage extends InAppMessage {
|
|
|
34
34
|
void 0,
|
|
35
35
|
I,
|
|
36
36
|
M
|
|
37
|
-
)
|
|
37
|
+
),
|
|
38
|
+
(this.Le = InAppMessage.TextAlignment.START);
|
|
38
39
|
}
|
|
39
40
|
xe() {
|
|
40
41
|
return !1;
|
|
41
42
|
}
|
|
42
|
-
get Le() {
|
|
43
|
-
return InAppMessage.TextAlignment.START;
|
|
44
|
-
}
|
|
45
43
|
Be() {
|
|
46
|
-
const
|
|
47
|
-
return
|
|
44
|
+
const o = document.createElement("span");
|
|
45
|
+
return o.appendChild(document.createTextNode(this.message || "")), o;
|
|
48
46
|
}
|
|
49
|
-
|
|
50
|
-
const
|
|
51
|
-
|
|
47
|
+
ah(o) {
|
|
48
|
+
const s = o.getElementsByClassName("ab-in-app-message")[0];
|
|
49
|
+
so.eo(s, !0, !0) ||
|
|
52
50
|
(this.slideFrom === InAppMessage.SlideFrom.TOP
|
|
53
|
-
? (
|
|
54
|
-
: (
|
|
55
|
-
super.
|
|
51
|
+
? (s.style.top = "0px")
|
|
52
|
+
: (s.style.bottom = "0px")),
|
|
53
|
+
super.ah(o);
|
|
56
54
|
}
|
|
57
55
|
}
|
|
58
|
-
SlideUpMessage.es = InAppMessage.
|
|
56
|
+
SlideUpMessage.es = InAppMessage.Ee.Rh;
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
export default class wt {
|
|
2
|
-
constructor(t, s,
|
|
2
|
+
constructor(t, s, i, h, l) {
|
|
3
3
|
(this.triggerId = t),
|
|
4
|
-
(this.
|
|
5
|
-
(this.
|
|
6
|
-
(this.
|
|
7
|
-
(this.
|
|
4
|
+
(this.Hr = s),
|
|
5
|
+
(this.Mr = i),
|
|
6
|
+
(this.Jr = h),
|
|
7
|
+
(this.Kr = l),
|
|
8
|
+
(this.triggerId = t),
|
|
9
|
+
(this.Hr = s),
|
|
10
|
+
(this.Mr = i),
|
|
11
|
+
(this.Jr = h),
|
|
12
|
+
(this.Kr = l);
|
|
8
13
|
}
|
|
9
|
-
static fromJson(t, s,
|
|
14
|
+
static fromJson(t, s, i, h, l) {
|
|
10
15
|
return null == t || null == t.trigger_id
|
|
11
16
|
? null
|
|
12
|
-
: new wt(t.trigger_id, s,
|
|
17
|
+
: new wt(t.trigger_id, s, i, h, l);
|
|
13
18
|
}
|
|
14
19
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import e from "../managers/braze-instance.js";
|
|
2
|
-
import
|
|
2
|
+
import ea from "./in-app-message-manager-factory.js";
|
|
3
3
|
export function subscribeToInAppMessage(n) {
|
|
4
4
|
if (e.rr())
|
|
5
5
|
return "function" != typeof n
|
|
6
6
|
? null
|
|
7
|
-
:
|
|
7
|
+
: ea.m().Ve(function(r) {
|
|
8
8
|
return n(r[0]), r.slice(1);
|
|
9
9
|
});
|
|
10
10
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|