@braze/web-sdk 4.7.2 → 4.8.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.
Files changed (161) hide show
  1. package/index.d.ts +27 -24
  2. package/package.json +1 -1
  3. package/shared-lib/braze-shared-lib.js +5 -5
  4. package/shared-lib/encoding-utils.js +1 -1
  5. package/shared-lib/event-types.js +24 -24
  6. package/shared-lib/guid.js +3 -3
  7. package/shared-lib/indexed-db-adapter.js +17 -17
  8. package/shared-lib/logger.js +18 -18
  9. package/shared-lib/supported-options.js +18 -18
  10. package/src/Card/card-manager-factory.js +2 -2
  11. package/src/Card/card-manager.js +47 -41
  12. package/src/Card/display/card-display.js +70 -67
  13. package/src/Card/log-card-click.js +1 -1
  14. package/src/Card/log-card-dismissal.js +1 -1
  15. package/src/Card/log-card-impressions.js +3 -3
  16. package/src/Card/models/banner.js +3 -2
  17. package/src/Card/models/captioned-image.js +6 -5
  18. package/src/Card/models/card.js +107 -87
  19. package/src/Card/models/classic-card.js +5 -5
  20. package/src/Card/models/control-card.js +5 -21
  21. package/src/Card/types.js +1 -0
  22. package/src/Card/util/card-factory.js +32 -32
  23. package/src/ContentCards/content-cards-provider-factory.js +3 -3
  24. package/src/ContentCards/content-cards-provider.js +283 -175
  25. package/src/ContentCards/content-cards.js +2 -2
  26. package/src/ContentCards/get-cached-content-cards.js +1 -1
  27. package/src/ContentCards/log-content-cards-displayed.js +2 -2
  28. package/src/ContentCards/request-content-cards-refresh.js +1 -1
  29. package/src/ContentCards/subscribe-to-content-cards-updates.js +9 -6
  30. package/src/ContentCards/types.js +1 -0
  31. package/src/ContentCards/ui/hide-content-cards.js +2 -2
  32. package/src/ContentCards/ui/show-content-cards.js +35 -33
  33. package/src/Core/add-sdk-metadata.js +17 -18
  34. package/src/Core/change-user.js +12 -14
  35. package/src/Core/destroy.js +1 -1
  36. package/src/Core/disable-sdk.js +7 -6
  37. package/src/Core/enable-sdk.js +4 -4
  38. package/src/Core/get-device-id.js +7 -6
  39. package/src/Core/get-user.js +1 -1
  40. package/src/Core/handle-braze-action.js +57 -40
  41. package/src/Core/is-disabled.js +2 -2
  42. package/src/Core/log-custom-event.js +22 -15
  43. package/src/Core/log-purchase.js +33 -33
  44. package/src/Core/open-session.js +17 -15
  45. package/src/Core/request-immediate-data-flush.js +4 -2
  46. package/src/Core/set-logger.js +1 -1
  47. package/src/Core/set-sdk-authentication-signature.js +5 -6
  48. package/src/Core/subscribe-to-sdk-authentication-failures.js +3 -1
  49. package/src/Core/toggle-logging.js +1 -1
  50. package/src/Core/types.js +1 -0
  51. package/src/Core/wipe-data.js +11 -10
  52. package/src/FeatureFlags/feature-flag-factory.js +6 -6
  53. package/src/FeatureFlags/feature-flag.js +17 -17
  54. package/src/FeatureFlags/feature-flags-provider-factory.js +2 -2
  55. package/src/FeatureFlags/feature-flags-provider.js +67 -65
  56. package/src/FeatureFlags/get-all-feature-flags.js +3 -3
  57. package/src/FeatureFlags/get-feature-flag.js +4 -4
  58. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +4 -1
  59. package/src/Feed/feed-provider-factory.js +8 -8
  60. package/src/Feed/feed-provider.js +57 -46
  61. package/src/Feed/feed.js +1 -1
  62. package/src/Feed/get-cached-feed.js +2 -2
  63. package/src/Feed/log-feed-displayed.js +3 -1
  64. package/src/Feed/request-feed-refresh.js +2 -2
  65. package/src/Feed/subscribe-to-feed-updates.js +2 -2
  66. package/src/Feed/types.js +1 -0
  67. package/src/Feed/ui/hide-feed.js +2 -2
  68. package/src/Feed/ui/show-feed.js +40 -36
  69. package/src/InAppMessage/display/html-message-to-html.js +125 -119
  70. package/src/InAppMessage/display/in-app-message-to-html.js +72 -69
  71. package/src/InAppMessage/display/modal-utils.js +18 -13
  72. package/src/InAppMessage/in-app-message-factory.js +9 -8
  73. package/src/InAppMessage/in-app-message-manager-factory.js +7 -7
  74. package/src/InAppMessage/in-app-message-manager.js +122 -108
  75. package/src/InAppMessage/log-in-app-message-button-click.js +10 -10
  76. package/src/InAppMessage/log-in-app-message-click.js +9 -9
  77. package/src/InAppMessage/log-in-app-message-html-click.js +10 -10
  78. package/src/InAppMessage/log-in-app-message-impression.js +5 -5
  79. package/src/InAppMessage/models/control-message.js +4 -1
  80. package/src/InAppMessage/models/full-screen-message.js +35 -37
  81. package/src/InAppMessage/models/html-message.js +34 -33
  82. package/src/InAppMessage/models/in-app-message-button.js +23 -16
  83. package/src/InAppMessage/models/in-app-message.js +147 -105
  84. package/src/InAppMessage/models/modal-message.js +34 -36
  85. package/src/InAppMessage/models/slide-up-message.js +25 -27
  86. package/src/InAppMessage/models/templated-in-app-message.js +12 -7
  87. package/src/InAppMessage/subscribe-to-in-app-message.js +2 -2
  88. package/src/InAppMessage/types.js +1 -0
  89. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +4 -4
  90. package/src/InAppMessage/ui/show-in-app-message.js +95 -89
  91. package/src/InAppMessage/utils/in-app-message-utils.js +1 -0
  92. package/src/Push/is-push-blocked.js +2 -2
  93. package/src/Push/is-push-permission-granted.js +2 -2
  94. package/src/Push/is-push-supported.js +2 -2
  95. package/src/Push/push-manager-factory.js +20 -20
  96. package/src/Push/push-manager.js +192 -174
  97. package/src/Push/request-push-permission.js +4 -3
  98. package/src/Push/types.js +1 -0
  99. package/src/Push/unregister-push.js +2 -2
  100. package/src/Push/utils/push-utils.js +10 -10
  101. package/src/User/types.js +1 -0
  102. package/src/User/user-manager.js +24 -24
  103. package/src/User/user.js +117 -105
  104. package/src/common/base-feed.js +7 -7
  105. package/src/common/base-provider.js +2 -2
  106. package/src/common/constants.js +6 -0
  107. package/src/common/event-logger.js +6 -6
  108. package/src/common/feed-display.js +18 -18
  109. package/src/common/types.js +1 -0
  110. package/src/l10n/l10n-manager-factory.js +5 -5
  111. package/src/l10n/l10n-manager.js +1 -1
  112. package/src/managers/auth-manager.js +32 -32
  113. package/src/managers/braze-instance.js +202 -202
  114. package/src/managers/device-manager.js +23 -23
  115. package/src/managers/network-manager.js +96 -82
  116. package/src/managers/server-config-manager.js +60 -42
  117. package/src/managers/session-manager.js +41 -41
  118. package/src/managers/storage-manager-factory.js +15 -15
  119. package/src/managers/storage-manager.js +163 -160
  120. package/src/managers/subscription-manager.js +11 -11
  121. package/src/models/backend-errors.js +5 -5
  122. package/src/models/braze-event.js +7 -7
  123. package/src/models/device.js +2 -2
  124. package/src/models/identifier.js +7 -7
  125. package/src/models/push-token.js +7 -7
  126. package/src/models/request-result.js +3 -3
  127. package/src/models/server-config.js +20 -20
  128. package/src/request-controller.js +176 -174
  129. package/src/triggers/models/custom-event-data.js +6 -6
  130. package/src/triggers/models/custom-event-property-data.js +9 -9
  131. package/src/triggers/models/filter-set.js +9 -9
  132. package/src/triggers/models/filter.js +64 -64
  133. package/src/triggers/models/in-app-message-click-data.js +12 -12
  134. package/src/triggers/models/purchase-data.js +3 -3
  135. package/src/triggers/models/purchase-property-data.js +9 -9
  136. package/src/triggers/models/push-click-data.js +5 -5
  137. package/src/triggers/models/trigger-condition.js +52 -52
  138. package/src/triggers/models/trigger-events.js +2 -2
  139. package/src/triggers/models/trigger.js +36 -36
  140. package/src/triggers/triggers-provider-factory.js +8 -8
  141. package/src/triggers/triggers-provider.js +165 -162
  142. package/src/types.js +1 -0
  143. package/src/ui/js/attach-css.js +3 -3
  144. package/src/ui/js/load-font-awesome.js +2 -2
  145. package/src/util/base-device-parser.js +1 -1
  146. package/src/util/braze-actions.js +20 -20
  147. package/src/util/browser-detector.js +22 -22
  148. package/src/util/client-hints-parser.js +6 -6
  149. package/src/util/code-utils.js +1 -1
  150. package/src/util/color-utils.js +2 -2
  151. package/src/util/component-utils.js +2 -2
  152. package/src/util/deprecation-utils.js +1 -1
  153. package/src/util/device-constants.js +5 -5
  154. package/src/util/dom-utils.js +2 -2
  155. package/src/util/key-codes.js +1 -1
  156. package/src/util/net.js +11 -11
  157. package/src/util/request-header-utils.js +23 -0
  158. package/src/util/string-utils.js +1 -1
  159. package/src/util/user-agent-parser.js +20 -20
  160. package/src/util/validation-utils.js +44 -44
  161. package/src/util/window-utils.js +3 -3
@@ -1,29 +1,36 @@
1
1
  import InAppMessage from "./in-app-message.js";
2
- import u from "../../managers/subscription-manager.js";
2
+ import E from "../../managers/subscription-manager.js";
3
3
  export default class InAppMessageButton {
4
- constructor(s, t, i, r, e, h, n) {
5
- (this.text = s || ""),
6
- (this.backgroundColor = t || InAppMessage.Xi.Wi),
7
- (this.textColor = i || InAppMessage.Xi.Yi),
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.Ur.Qr),
14
+ (this.textColor = i || InAppMessage.Ur.Vr),
8
15
  (this.borderColor = r || this.backgroundColor),
9
- (this.clickAction = e || InAppMessage.ClickAction.NONE),
10
- (this.uri = h),
11
- null == n && (n = InAppMessageButton.$i),
16
+ (this.clickAction = h || InAppMessage.ClickAction.NONE),
17
+ (this.uri = e),
18
+ null == n && (n = InAppMessageButton.Pi),
12
19
  (this.id = n),
13
- (this.nl = !1),
14
- (this.lt = new u());
20
+ (this.vo = !1),
21
+ (this.ht = new E());
15
22
  }
16
23
  subscribeToClickedEvent(s) {
17
- return this.lt.ut(s);
24
+ return this.ht.lt(s);
18
25
  }
19
26
  removeSubscription(s) {
20
- this.lt.removeSubscription(s);
27
+ this.ht.removeSubscription(s);
21
28
  }
22
29
  removeAllSubscriptions() {
23
- this.lt.removeAllSubscriptions();
30
+ this.ht.removeAllSubscriptions();
24
31
  }
25
- k() {
26
- return !this.nl && ((this.nl = !0), this.lt.St(), !0);
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.$i = -1;
47
+ InAppMessageButton.Pi = -1;
@@ -1,92 +1,126 @@
1
- import e, { OPTIONS as T } from "../../managers/braze-instance.js";
2
- import ot from "../../util/browser-detector.js";
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 at } from "../../util/key-codes.js";
8
- import u from "../../managers/subscription-manager.js";
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
- E,
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
- C
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 = E || 5e3),
73
+ (this.duration = u || 5e3),
44
74
  (this.slideFrom = i || InAppMessage.SlideFrom.BOTTOM),
45
- (this.extras = e || {}),
46
- (this.triggerId = h),
75
+ (this.extras = h || {}),
76
+ (this.triggerId = e),
47
77
  (this.clickAction = n || InAppMessage.ClickAction.NONE),
48
- (this.uri = r),
49
- (this.openTarget = o || InAppMessage.OpenTarget.NONE),
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.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
- (this.animateIn = L),
84
+ (this.iconColor = c || InAppMessage.Ur.Vr),
85
+ (this.iconBackgroundColor = I || InAppMessage.Ur.Qr),
86
+ (this.backgroundColor = L || InAppMessage.Ur.Vr),
87
+ (this.textColor = A || InAppMessage.Ur.th),
88
+ (this.closeButtonColor = N || InAppMessage.Ur.sh),
89
+ (this.animateIn = d),
60
90
  null == this.animateIn && (this.animateIn = !0),
61
- (this.animateOut = d),
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.Xi.Zi),
66
- (this.frameColor = M || InAppMessage.Xi.sh),
95
+ (this.headerTextColor = D || InAppMessage.Ur.th),
96
+ (this.frameColor = M || InAppMessage.Ur.ih),
67
97
  (this.buttons = R || []),
68
98
  (this.cropType = b || InAppMessage.CropType.FIT_CENTER),
69
- (this.orientation = P),
70
- (this.htmlId = p),
71
- (this.css = C),
99
+ (this.orientation = p),
100
+ (this.htmlId = U),
101
+ (this.css = P),
72
102
  (this.isControl = !1),
73
- (this.ih = !1),
74
- (this.nl = !1),
103
+ (this.hh = !1),
75
104
  (this.eh = !1),
76
- (this.lt = new u()),
77
- (this.hh = new u());
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.ut(t);
114
+ return this.ht.lt(t);
81
115
  }
82
116
  subscribeToDismissedEvent(t) {
83
- return this.hh.ut(t);
117
+ return this.oh.lt(t);
84
118
  }
85
119
  removeSubscription(t) {
86
- this.lt.removeSubscription(t), this.hh.removeSubscription(t);
120
+ this.ht.removeSubscription(t), this.oh.removeSubscription(t);
87
121
  }
88
122
  removeAllSubscriptions() {
89
- this.lt.removeAllSubscriptions(), this.hh.removeAllSubscriptions();
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
- ll() {
131
+ io() {
98
132
  return this.xe();
99
133
  }
100
- Ee() {
134
+ $e() {
101
135
  return null != this.htmlId && this.htmlId.length > 4;
102
136
  }
103
137
  ye() {
104
- return this.Ee() && null != this.css && this.css.length > 0;
138
+ return this.$e() && null != this.css && this.css.length > 0;
105
139
  }
106
140
  Ae() {
107
- if (this.Ee() && this.ye()) return this.htmlId + "-css";
141
+ if (this.$e() && this.ye()) return this.htmlId + "-css";
108
142
  }
109
- R() {
110
- return !this.ih && ((this.ih = !0), !0);
143
+ M() {
144
+ return !this.eh && ((this.eh = !0), !0);
111
145
  }
112
- Cr() {
113
- return this.ih;
146
+ Lr() {
147
+ return this.eh;
114
148
  }
115
- k() {
116
- return !this.nl && ((this.nl = !0), this.lt.St(), !0);
149
+ p(t) {
150
+ return !this.vo && ((this.vo = !0), this.ht.Et(), !0);
117
151
  }
118
- J() {
119
- return !this.eh && ((this.eh = !0), this.hh.St(), !0);
152
+ F() {
153
+ return !this.nh && ((this.nh = !0), this.oh.Et(), !0);
120
154
  }
121
- nh(t) {
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.oh);
161
+ document.body.removeEventListener("touchmove", InAppMessage.lh);
128
162
  }
129
- s.className = s.className.replace(InAppMessage.lh, InAppMessage.Eh);
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 e = !1;
142
- i && (e = this.nh(i));
143
- const h = document.body;
144
- if (null != h) var n = h.scrollTop;
145
- const r = () => {
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
- if (null != this.Ae()) {
151
- const t = document.getElementById(this.Ae());
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 != h && "Safari" === ot.browser && (h.scrollTop = n),
155
- s ? s() : this.J();
190
+ null != e && "Safari" === V.browser && (e.scrollTop = n),
191
+ s ? s() : this.F();
156
192
  };
157
- e ? setTimeout(r, InAppMessage.uh) : r(), this.ke && this.ke.focus();
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 oh(t) {
168
- (t.targetTouches && t.targetTouches.length > 1) ||
169
- (t.target.classList &&
170
- t.target.classList.contains("ab-message-text") &&
171
- t.target.scrollHeight > t.target.clientHeight) ||
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
- Th(t) {
212
+ ah(t) {
213
+ const s = t.parentNode;
175
214
  this.xe() &&
176
- null != t.parentNode &&
215
+ null != s &&
177
216
  this.orientation !== InAppMessage.Orientation.LANDSCAPE &&
178
- (null != t.parentNode.classList &&
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.oh,
220
+ InAppMessage.lh,
183
221
  !!Tt() && { passive: !1 }
184
222
  )),
185
- (t.className += " " + InAppMessage.lh);
223
+ (t.className += " " + InAppMessage.uh);
186
224
  }
187
- static ah(t) {
225
+ static mh(t) {
188
226
  if (
189
- t.keyCode === at.mh &&
190
- !e.nn(T.Ih) &&
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 (let i = 0; i < t.length; i++) {
196
- const e = t[i].contentWindow.document.getElementsByClassName(
197
- "ab-programmatic-close-button"
198
- )[0];
199
- null != e && (Et(e), (s = !0));
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.Nh ||
211
- e.nn(T.Ih) ||
212
- (document.addEventListener("keydown", InAppMessage.ah, !1),
213
- e._h(() => {
214
- document.removeEventListener("keydown", InAppMessage.ah);
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.Nh = !0));
257
+ (this.hh = !0));
217
258
  }
218
259
  }
219
- (InAppMessage.Xi = {
220
- Zi: 4281545523,
221
- Yi: 4294967295,
222
- Wi: 4278219733,
223
- Lh: 4293914607,
224
- dh: 4283782485,
225
- sh: 3224580915,
226
- th: 4288387995
260
+ (InAppMessage.Ur = {
261
+ th: 4281545523,
262
+ Vr: 4294967295,
263
+ Qr: 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
- Li: "umt",
234
- Ri: "tf",
274
+ Gr: "umt",
275
+ Yi: "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.es = {
300
+ (InAppMessage.Ee = {
260
301
  Rh: "SLIDEUP",
261
302
  bh: "MODAL",
262
303
  Ne: "MODAL_STYLED",
263
- Tr: "FULL",
264
- ul: "WEB_HTML",
265
- Pe: "HTML"
304
+ so: "FULL",
305
+ do: "WEB_HTML",
306
+ Pe: "HTML",
307
+ ph: "HTML_FULL"
266
308
  }),
267
- (InAppMessage.uh = 500),
268
- (InAppMessage.Ph = 200),
269
- (InAppMessage.lh = "ab-show"),
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
- s,
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
- g,
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
- s,
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
- g,
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
- (q = q || InAppMessage.CropType.FIT_CENTER),
59
- void 0,
56
+ q,
60
57
  w,
61
- y
62
- );
63
- }
64
- get Le() {
65
- return InAppMessage.TextAlignment.CENTER;
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.es.bh;
66
+ ModalMessage.es = InAppMessage.Ee.bh;
@@ -1,30 +1,30 @@
1
1
  import InAppMessage from "./in-app-message.js";
2
- import { DOMUtils as vt } from "../../util/dom-utils.js";
2
+ import { DOMUtils as so } from "../../util/dom-utils.js";
3
3
  export default class SlideUpMessage extends InAppMessage {
4
- constructor(t, e, o, s, n, i, r, d, u, a, p, l, m, c, v, x, g, f, h, I, M) {
5
- (x = x || InAppMessage.Xi.dh),
6
- (v = v || InAppMessage.Xi.Lh),
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.Ur._h),
6
+ (l = l || InAppMessage.Ur.dh),
7
7
  super(
8
- t,
9
- (e = e || InAppMessage.TextAlignment.START),
10
8
  o,
11
- s,
12
- n,
9
+ (s = s || InAppMessage.TextAlignment.START),
10
+ t,
11
+ e,
13
12
  i,
14
- r,
15
13
  d,
16
- u,
14
+ n,
15
+ r,
17
16
  a,
18
17
  p,
19
- l,
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 t = document.createElement("span");
47
- return t.appendChild(document.createTextNode(this.message)), t;
44
+ const o = document.createElement("span");
45
+ return o.appendChild(document.createTextNode(this.message || "")), o;
48
46
  }
49
- Th(t) {
50
- const e = t.getElementsByClassName("ab-in-app-message")[0];
51
- vt.eo(e, !0, !0) ||
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
- ? (e.style.top = "0px")
54
- : (e.style.bottom = "0px")),
55
- super.Th(t);
51
+ ? (s.style.top = "0px")
52
+ : (s.style.bottom = "0px")),
53
+ super.ah(o);
56
54
  }
57
55
  }
58
- SlideUpMessage.es = InAppMessage.es.Rh;
56
+ SlideUpMessage.es = InAppMessage.Ee.Rh;
@@ -1,14 +1,19 @@
1
1
  export default class wt {
2
- constructor(t, s, l, n, i) {
2
+ constructor(t, s, i, h, l) {
3
3
  (this.triggerId = t),
4
- (this.Qi = s),
5
- (this.Hi = l),
6
- (this.Ui = n),
7
- (this.Vi = i);
4
+ (this.Or = s),
5
+ (this.Zi = i),
6
+ (this.Hr = h),
7
+ (this.Jr = l),
8
+ (this.triggerId = t),
9
+ (this.Or = s),
10
+ (this.Zi = i),
11
+ (this.Hr = h),
12
+ (this.Jr = l);
8
13
  }
9
- static fromJson(t, s, l, n, i) {
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, l, n, i);
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 pe from "./in-app-message-manager-factory.js";
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
- : pe.m().Ue(function(r) {
7
+ : ea.m().Ve(function(r) {
8
8
  return n(r[0]), r.slice(1);
9
9
  });
10
10
  }
@@ -0,0 +1 @@
1
+ export {};