@braze/web-sdk 5.9.1 → 6.1.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 (176) hide show
  1. package/index.d.ts +209 -283
  2. package/package.json +1 -1
  3. package/shared-lib/encoding-utils.js +1 -1
  4. package/shared-lib/event-types.js +27 -29
  5. package/shared-lib/guid.js +3 -3
  6. package/shared-lib/indexed-db-adapter.js +22 -22
  7. package/shared-lib/logger.js +18 -18
  8. package/shared-lib/supported-options.js +22 -23
  9. package/src/Banner/banner-factory.js +2 -1
  10. package/src/Banner/banner-provider-factory.js +7 -7
  11. package/src/Banner/banner-provider.js +92 -98
  12. package/src/Banner/banner.js +21 -18
  13. package/src/Banner/display/banner-to-html.js +18 -30
  14. package/src/Banner/display/detect-banner-impressions.js +11 -11
  15. package/src/Banner/get-all-banners.js +5 -5
  16. package/src/Banner/get-banner.js +7 -7
  17. package/src/Banner/index.js +0 -1
  18. package/src/Banner/log-banner-click.js +7 -7
  19. package/src/Banner/log-banner-impressions.js +9 -9
  20. package/src/Banner/request-banners-refresh.js +23 -27
  21. package/src/Banner/subscribe-to-banners-updates.js +9 -9
  22. package/src/Banner/ui/insert-banner.js +10 -10
  23. package/src/Card/card-manager-factory.js +7 -7
  24. package/src/Card/card-manager.js +45 -47
  25. package/src/Card/display/card-display.js +76 -74
  26. package/src/Card/index.js +0 -2
  27. package/src/Card/log-card-dismissal.js +4 -4
  28. package/src/Card/log-content-card-click.js +9 -2
  29. package/src/Card/log-content-card-impressions.js +11 -2
  30. package/src/Card/models/captioned-image.js +21 -21
  31. package/src/Card/models/card.js +116 -110
  32. package/src/Card/models/classic-card.js +21 -21
  33. package/src/Card/models/control-card.js +15 -15
  34. package/src/Card/models/image-only.js +20 -21
  35. package/src/Card/util/card-factory.js +58 -79
  36. package/src/ContentCards/content-cards-provider-factory.js +13 -13
  37. package/src/ContentCards/content-cards-provider.js +148 -148
  38. package/src/ContentCards/content-cards.js +21 -13
  39. package/src/ContentCards/get-cached-content-cards.js +2 -2
  40. package/src/ContentCards/request-content-cards-refresh.js +2 -2
  41. package/src/ContentCards/subscribe-to-content-cards-updates.js +8 -8
  42. package/src/ContentCards/ui/hide-content-cards.js +5 -5
  43. package/src/ContentCards/ui/show-content-cards.js +35 -35
  44. package/src/Core/add-sdk-metadata.js +5 -5
  45. package/src/Core/change-user.js +7 -7
  46. package/src/Core/destroy.js +2 -2
  47. package/src/Core/disable-sdk.js +10 -10
  48. package/src/Core/enable-sdk.js +7 -7
  49. package/src/Core/get-device-id.js +4 -4
  50. package/src/Core/get-user.js +1 -1
  51. package/src/Core/handle-braze-action.js +10 -10
  52. package/src/Core/is-disabled.js +2 -2
  53. package/src/Core/is-initialized.js +1 -1
  54. package/src/Core/log-custom-event.js +18 -18
  55. package/src/Core/log-purchase.js +19 -19
  56. package/src/Core/open-session.js +13 -13
  57. package/src/Core/request-immediate-data-flush.js +1 -1
  58. package/src/Core/set-logger.js +2 -2
  59. package/src/Core/toggle-logging.js +2 -2
  60. package/src/Core/wipe-data.js +9 -9
  61. package/src/FeatureFlags/feature-flag-factory.js +10 -10
  62. package/src/FeatureFlags/feature-flag.js +20 -71
  63. package/src/FeatureFlags/feature-flags-provider-factory.js +7 -7
  64. package/src/FeatureFlags/feature-flags-provider.js +86 -86
  65. package/src/FeatureFlags/get-all-feature-flags.js +3 -3
  66. package/src/FeatureFlags/get-feature-flag.js +3 -3
  67. package/src/FeatureFlags/log-feature-flag-impression.js +8 -8
  68. package/src/FeatureFlags/refresh-feature-flags.js +1 -1
  69. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +3 -3
  70. package/src/InAppMessage/defer-in-app-message.js +4 -4
  71. package/src/InAppMessage/display/html-message-to-html.js +41 -41
  72. package/src/InAppMessage/display/in-app-message-to-html.js +145 -139
  73. package/src/InAppMessage/display/modal-utils.js +40 -42
  74. package/src/InAppMessage/get-deferred-in-app-message.js +1 -1
  75. package/src/InAppMessage/in-app-message-factory.js +24 -16
  76. package/src/InAppMessage/in-app-message-manager-factory.js +5 -5
  77. package/src/InAppMessage/in-app-message-manager.js +124 -122
  78. package/src/InAppMessage/log-in-app-message-button-click.js +12 -12
  79. package/src/InAppMessage/log-in-app-message-click.js +9 -9
  80. package/src/InAppMessage/log-in-app-message-html-click.js +11 -11
  81. package/src/InAppMessage/log-in-app-message-impression.js +4 -4
  82. package/src/InAppMessage/models/control-message.js +5 -5
  83. package/src/InAppMessage/models/full-screen-message.js +41 -35
  84. package/src/InAppMessage/models/html-message.js +28 -26
  85. package/src/InAppMessage/models/in-app-message-button.js +5 -5
  86. package/src/InAppMessage/models/in-app-message.js +156 -152
  87. package/src/InAppMessage/models/modal-message.js +40 -34
  88. package/src/InAppMessage/models/slide-up-message.js +38 -32
  89. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  90. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  91. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
  92. package/src/InAppMessage/ui/show-in-app-message.js +68 -74
  93. package/src/Push/is-push-blocked.js +2 -2
  94. package/src/Push/is-push-permission-granted.js +2 -2
  95. package/src/Push/is-push-supported.js +2 -2
  96. package/src/Push/push-manager-factory.js +17 -17
  97. package/src/Push/push-manager.js +127 -127
  98. package/src/Push/request-push-permission.js +1 -1
  99. package/src/Push/utils/push-utils.js +25 -15
  100. package/src/User/user-manager.js +20 -20
  101. package/src/User/user.js +60 -61
  102. package/src/common/base-provider.js +1 -1
  103. package/src/common/content-cards-display.js +211 -0
  104. package/src/common/event-logger.js +12 -12
  105. package/src/common/properties-base.js +56 -0
  106. package/src/index.js +0 -1
  107. package/src/l10n/l10n-manager-factory.js +10 -10
  108. package/src/l10n/l10n-manager.js +7 -7
  109. package/src/managers/auth-manager.js +36 -36
  110. package/src/managers/braze-instance.js +184 -185
  111. package/src/managers/device-manager.js +26 -26
  112. package/src/managers/network-manager.js +194 -193
  113. package/src/managers/server-config-manager.js +75 -75
  114. package/src/managers/session-manager.js +29 -29
  115. package/src/managers/storage-manager-factory.js +13 -13
  116. package/src/managers/storage-manager.js +162 -164
  117. package/src/managers/subscription-manager.js +12 -12
  118. package/src/managers/utils.js +1 -1
  119. package/src/models/backend-errors.js +5 -5
  120. package/src/models/braze-event.js +16 -16
  121. package/src/models/device.js +3 -3
  122. package/src/models/identifier.js +8 -8
  123. package/src/models/push-token.js +10 -10
  124. package/src/models/request-result.js +4 -4
  125. package/src/models/server-config.js +33 -33
  126. package/src/request-controller.js +193 -192
  127. package/src/triggers/models/custom-event-data.js +7 -7
  128. package/src/triggers/models/custom-event-property-data.js +8 -8
  129. package/src/triggers/models/filter-set.js +8 -8
  130. package/src/triggers/models/filter.js +43 -43
  131. package/src/triggers/models/in-app-message-click-data.js +4 -4
  132. package/src/triggers/models/purchase-data.js +2 -2
  133. package/src/triggers/models/purchase-property-data.js +6 -6
  134. package/src/triggers/models/push-click-data.js +2 -2
  135. package/src/triggers/models/trigger-condition.js +52 -52
  136. package/src/triggers/models/trigger-events.js +4 -4
  137. package/src/triggers/models/trigger.js +19 -19
  138. package/src/triggers/triggers-provider-factory.js +14 -14
  139. package/src/triggers/triggers-provider.js +70 -70
  140. package/src/ui/js/attach-css.js +3 -3
  141. package/src/ui/js/banner-css.js +1 -1
  142. package/src/ui/js/iam-css.js +1 -1
  143. package/src/ui/js/load-font-awesome.js +2 -2
  144. package/src/util/base-device-parser.js +4 -4
  145. package/src/util/braze-actions.js +12 -18
  146. package/src/util/browser-detector.js +27 -20
  147. package/src/util/client-hints-parser.js +8 -8
  148. package/src/util/code-utils.js +2 -2
  149. package/src/util/component-utils.js +14 -14
  150. package/src/util/deprecation-utils.js +2 -2
  151. package/src/util/device-constants.js +5 -5
  152. package/src/util/dom-utils.js +9 -9
  153. package/src/util/html-display-utils.js +38 -38
  154. package/src/util/key-codes.js +1 -1
  155. package/src/util/net.js +12 -12
  156. package/src/util/request-header-utils.js +22 -22
  157. package/src/util/string-utils.js +2 -2
  158. package/src/util/user-agent-parser.js +17 -17
  159. package/src/util/validation-utils.js +28 -28
  160. package/src/util/window-utils.js +2 -2
  161. package/src/Card/log-card-click.js +0 -11
  162. package/src/Card/log-card-impressions.js +0 -13
  163. package/src/Feed/feed-provider-factory.js +0 -18
  164. package/src/Feed/feed-provider.js +0 -90
  165. package/src/Feed/feed.js +0 -20
  166. package/src/Feed/get-cached-feed.js +0 -5
  167. package/src/Feed/index.js +0 -8
  168. package/src/Feed/log-feed-displayed.js +0 -7
  169. package/src/Feed/request-feed-refresh.js +0 -5
  170. package/src/Feed/subscribe-to-feed-updates.js +0 -5
  171. package/src/Feed/types.js +0 -1
  172. package/src/Feed/ui/hide-feed.js +0 -7
  173. package/src/Feed/ui/show-feed.js +0 -96
  174. package/src/Feed/ui/toggle-feed.js +0 -8
  175. package/src/common/base-feed.js +0 -29
  176. package/src/common/feed-display.js +0 -211
@@ -1,10 +1,10 @@
1
- import { logger as N } from "../../shared-lib/index.js";
1
+ import { logger as E } from "../../shared-lib/index.js";
2
2
  import t from "../common/base-provider.js";
3
3
  import r from "../managers/braze-instance.js";
4
4
  import { STORAGE_KEYS as s } from "../managers/storage-manager.js";
5
5
  import u from "../managers/subscription-manager.js";
6
- import { randomInclusive as a } from "../util/math.js";
7
- import l from "../util/net.js";
6
+ import { randomInclusive as l } from "../util/math.js";
7
+ import a from "../util/net.js";
8
8
  import {
9
9
  newFeatureFlagFromJson as at,
10
10
  newFeatureFlagFromSerializedValue as ht,
@@ -13,41 +13,41 @@ import h from "../util/request-header-utils.js";
13
13
  export default class tr extends t {
14
14
  constructor(t, s, e, i) {
15
15
  super(),
16
- (this.B = t),
17
- (this.S = s),
18
- (this.C = e),
19
- (this.T = i),
20
- (this.De = []),
21
- (this.qe = 0),
22
- (this.B = t),
23
- (this.S = s),
24
- (this.C = e),
25
- (this.T = i),
26
- (this.ze = null),
27
- (this.Ue = new u()),
28
- (this.R = 10),
16
+ (this.h = t),
17
+ (this.B = s),
18
+ (this.j = e),
19
+ (this.C = i),
20
+ (this.he = []),
21
+ (this.je = 0),
22
+ (this.h = t),
23
+ (this.B = s),
24
+ (this.j = e),
25
+ (this.C = i),
26
+ (this.ye = null),
27
+ (this.Ce = new u()),
28
+ (this.S = 10),
29
+ (this.T = null),
29
30
  (this.I = null),
30
- (this.q = null),
31
- r.F(this.Ue);
31
+ r.q(this.Ce);
32
32
  }
33
- U(t) {
33
+ N(t) {
34
34
  var s;
35
35
  if (
36
- (null === (s = this.B) || void 0 === s ? void 0 : s.ke()) &&
36
+ (null === (s = this.h) || void 0 === s ? void 0 : s.Re()) &&
37
37
  null != t &&
38
38
  t.feature_flags
39
39
  ) {
40
- this.De = [];
40
+ this.he = [];
41
41
  for (const s of t.feature_flags) {
42
42
  const t = at(s);
43
- t && this.De.push(t);
43
+ t && this.he.push(t);
44
44
  }
45
- (this.qe = new Date().getTime()), this.Be(), this.Ue.X(this.De);
45
+ (this.je = new Date().getTime()), this.Te(), this.Ce.L(this.he);
46
46
  }
47
47
  }
48
- Me() {
48
+ De() {
49
49
  let t = {};
50
- this.C && (t = this.C.ft(s.gt.Xe));
50
+ this.j && (t = this.j.lt(s.ct.Ie));
51
51
  const e = {};
52
52
  for (const s in t) {
53
53
  const i = ht(t[s]);
@@ -55,134 +55,134 @@ export default class tr extends t {
55
55
  }
56
56
  return e;
57
57
  }
58
- _e() {
58
+ Se() {
59
59
  var t;
60
60
  return (
61
- (null === (t = this.C) || void 0 === t ? void 0 : t.ft(s.gt.Ge)) || {}
61
+ (null === (t = this.j) || void 0 === t ? void 0 : t.lt(s.ct.qe)) || {}
62
62
  );
63
63
  }
64
- He(t) {
65
- this.C && this.C.Bt(s.gt.Ge, t);
64
+ Ne(t) {
65
+ this.j && this.j.ft(s.ct.qe, t);
66
66
  }
67
- qt(t) {
68
- return this.Ue.Dt(t);
67
+ St(t) {
68
+ return this.Ce.wt(t);
69
69
  }
70
70
  refreshFeatureFlags(t, s, e = !1, i = !0) {
71
71
  const r = () => {
72
- "function" == typeof s && s(), this.Ue.X(this.De);
72
+ "function" == typeof s && s(), this.Ce.L(this.he);
73
73
  };
74
- if (!this.Je(e))
74
+ if (!this.ze(e))
75
75
  return (
76
- !this.ze &&
77
- this.B &&
78
- (this.ze = this.B.Ke(() => {
76
+ !this.ye &&
77
+ this.h &&
78
+ (this.ye = this.h.Ue(() => {
79
79
  this.refreshFeatureFlags(t, s);
80
80
  })),
81
81
  void r()
82
82
  );
83
- const o = this.S;
83
+ const o = this.B;
84
84
  if (!o) return void r();
85
- i && this.G();
86
- const n = o.H({}, !0),
87
- u = o.J(n, h.O.Le);
85
+ i && this.X();
86
+ const n = o.$({}, !0),
87
+ u = o.A(n, h.H.$e);
88
88
  let f = !1;
89
- o.V(
89
+ o.J(
90
90
  n,
91
91
  (i = -1) => {
92
- const o = this.S;
92
+ const o = this.B;
93
93
  if (!o) return void r();
94
94
  const c = new Date().valueOf();
95
- h.W(this.C, h.O.Le, c),
95
+ h.K(this.j, h.H.$e, c),
96
96
  -1 !== i && u.push(["X-Braze-Req-Tokens-Remaining", i.toString()]),
97
- l.Y({
98
- url: `${o.Z()}/feature_flags/sync`,
97
+ a.O({
98
+ url: `${o.V()}/feature_flags/sync`,
99
99
  headers: u,
100
100
  data: n,
101
- tt: (s) => {
102
- if (!o.st(n, s, u)) return (f = !0), void r();
103
- o.it(), this.U(s), (f = !1), "function" == typeof t && t();
101
+ W: (s) => {
102
+ if (!o.Y(n, s, u)) return (f = !0), void r();
103
+ o.Z(), this.N(s), (f = !1), "function" == typeof t && t();
104
104
  },
105
105
  error: (t) => {
106
- o.et(t, "retrieving feature flags"), (f = !0), r();
106
+ o._(t, "retrieving feature flags"), (f = !0), r();
107
107
  },
108
- nt: (i, r) => {
109
- let n;
108
+ tt: (i, r) => {
109
+ let a;
110
110
  if (f) {
111
- let t = this.I;
112
- (null == t || t < 1e3 * this.R) && (t = 1e3 * this.R),
113
- (n = Math.min(3e5, a(1e3 * this.R, 3 * t)));
111
+ let t = this.T;
112
+ (null == t || t < 1e3 * this.S) && (t = 1e3 * this.S),
113
+ (a = Math.min(3e5, l(1e3 * this.S, 3 * t)));
114
114
  }
115
- o.rt(
115
+ o.st(
116
116
  r,
117
117
  () => {
118
118
  this.refreshFeatureFlags(t, s, e, !0);
119
119
  },
120
- h.O.Le,
121
- (t) => this.ot(t),
122
- () => this.G(),
123
- n,
120
+ h.H.$e,
121
+ (t) => this.it(t),
122
+ () => this.X(),
123
+ a,
124
124
  );
125
125
  },
126
126
  });
127
127
  },
128
- h.O.Le,
128
+ h.H.$e,
129
129
  s,
130
130
  );
131
131
  }
132
- G() {
133
- null != this.q && (clearTimeout(this.q), (this.q = null));
132
+ X() {
133
+ null != this.I && (clearTimeout(this.I), (this.I = null));
134
134
  }
135
- ot(t) {
136
- this.G(), (this.q = t);
135
+ it(t) {
136
+ this.X(), (this.I = t);
137
137
  }
138
- Je(t) {
139
- if (!this.B) return !1;
138
+ ze(t) {
139
+ if (!this.h) return !1;
140
140
  if (!t) {
141
- const t = this.B.Oe();
141
+ const t = this.h.ke();
142
142
  if (null == t) return !1;
143
143
  let s = !1;
144
144
  if (!isNaN(t)) {
145
- if (-1 === t) return N.info("Feature flag refreshes not allowed"), !1;
146
- s = new Date().getTime() >= (this.qe || 0) + 1e3 * t;
145
+ if (-1 === t) return E.info("Feature flag refreshes not allowed"), !1;
146
+ s = new Date().getTime() >= (this.je || 0) + 1e3 * t;
147
147
  }
148
148
  if (!s)
149
149
  return (
150
- N.info(`Feature flag refreshes were rate limited to ${t} seconds`), !1
150
+ E.info(`Feature flag refreshes were rate limited to ${t} seconds`), !1
151
151
  );
152
152
  }
153
- return this.B.ke();
153
+ return this.h.Re();
154
154
  }
155
- Qe() {
155
+ Be() {
156
156
  var t;
157
157
  return (
158
- (null === (t = this.C) || void 0 === t ? void 0 : t.ft(s.gt.Ve)) || null
158
+ (null === (t = this.j) || void 0 === t ? void 0 : t.lt(s.ct.Me)) || null
159
159
  );
160
160
  }
161
- We() {
161
+ Xe() {
162
162
  var t, e;
163
- null === (t = this.C) ||
163
+ null === (t = this.j) ||
164
164
  void 0 === t ||
165
- t.Bt(s.gt.Ve, null === (e = this.T) || void 0 === e ? void 0 : e.St());
165
+ t.ft(s.ct.Me, null === (e = this.C) || void 0 === e ? void 0 : e.bt());
166
166
  }
167
- Ye() {
167
+ _e() {
168
168
  var t;
169
- const s = null === (t = this.T) || void 0 === t ? void 0 : t.St(),
170
- e = this.Qe();
169
+ const s = null === (t = this.C) || void 0 === t ? void 0 : t.bt(),
170
+ e = this.Be();
171
171
  return null == e || s === e;
172
172
  }
173
- Be() {
174
- if (!this.C) return;
173
+ Te() {
174
+ if (!this.j) return;
175
175
  const t = {};
176
- for (const s of this.De) {
177
- const e = s.bt();
176
+ for (const s of this.he) {
177
+ const e = s.dt();
178
178
  t[s.id] = e;
179
179
  }
180
- this.C.Bt(s.gt.Xe, t), this.C.Bt(s.gt.Ze, this.qe), this.We();
180
+ this.j.ft(s.ct.Ie, t), this.j.ft(s.ct.Ae, this.je), this.Xe();
181
181
  }
182
182
  changeUser() {
183
- this.G();
183
+ this.X();
184
184
  }
185
185
  clearData() {
186
- this.G();
186
+ this.X();
187
187
  }
188
188
  }
@@ -3,9 +3,9 @@ import nr from "./feature-flags-provider-factory.js";
3
3
  export function getAllFeatureFlags() {
4
4
  if (!r.rr()) return;
5
5
  const t = [],
6
- e = r.v();
7
- if (e && !e.ke()) return t;
8
- const n = nr.m().Me();
6
+ e = r.l();
7
+ if (e && !e.Re()) return t;
8
+ const n = nr.o().De();
9
9
  for (const r in n) t.push(n[r]);
10
10
  return t;
11
11
  }
@@ -2,8 +2,8 @@ import r from "../managers/braze-instance.js";
2
2
  import nr from "./feature-flags-provider-factory.js";
3
3
  export function getFeatureFlag(t) {
4
4
  if (!r.rr()) return;
5
- const e = r.v();
6
- if (e && !e.ke()) return null;
7
- const n = nr.m().Me();
5
+ const e = r.l();
6
+ if (e && !e.Re()) return null;
7
+ const n = nr.o().De();
8
8
  return n[t] ? n[t] : null;
9
9
  }
@@ -1,4 +1,4 @@
1
- import { logger as N, EventTypes as d } from "../../shared-lib/index.js";
1
+ import { logger as E, EventTypes as m } from "../../shared-lib/index.js";
2
2
  import c from "../common/event-logger.js";
3
3
  import r from "../managers/braze-instance.js";
4
4
  import nr from "./feature-flags-provider-factory.js";
@@ -7,19 +7,19 @@ export function logFeatureFlagImpression(e) {
7
7
  if (!e) return !1;
8
8
  const t =
9
9
  "Not logging a feature flag impression. The feature flag was not part of any matching experiment.",
10
- o = nr.m().Me();
11
- if (!o[e]) return N.info(t), !1;
10
+ o = nr.o().De();
11
+ if (!o[e]) return E.info(t), !1;
12
12
  const n = o[e].trackingString;
13
- if (!n) return N.info(t), !1;
14
- const i = nr.m()._e();
13
+ if (!n) return E.info(t), !1;
14
+ const i = nr.o().Se();
15
15
  if (i[n])
16
16
  return (
17
- N.info(
17
+ E.info(
18
18
  "Not logging another feature flag impression. This ID was already logged this session.",
19
19
  ),
20
20
  !1
21
21
  );
22
- (i[n] = !0), nr.m().He(i);
22
+ (i[n] = !0), nr.o().Ne(i);
23
23
  const s = { fid: e, fts: n };
24
- return c.ut(d.yr, s).tt;
24
+ return c.rt(m.Fr, s).W;
25
25
  }
@@ -1,7 +1,7 @@
1
1
  import r from "../managers/braze-instance.js";
2
2
  import nr from "./feature-flags-provider-factory.js";
3
3
  function ar(e, t, a = !1) {
4
- if (r.rr()) return nr.m().refreshFeatureFlags(e, t, a);
4
+ if (r.rr()) return nr.o().refreshFeatureFlags(e, t, a);
5
5
  }
6
6
  export function refreshFeatureFlags(r, e) {
7
7
  ar(r, e);
@@ -3,10 +3,10 @@ import nr from "./feature-flags-provider-factory.js";
3
3
  import { getAllFeatureFlags } from "./get-all-feature-flags.js";
4
4
  export function subscribeToFeatureFlagsUpdates(t) {
5
5
  if (!r.rr()) return;
6
- const e = nr.m();
7
- if (e.Ye()) {
6
+ const e = nr.o();
7
+ if (e._e()) {
8
8
  const r = getAllFeatureFlags();
9
9
  r && "function" == typeof t && t(r);
10
10
  }
11
- return e.qt(t);
11
+ return e.St(t);
12
12
  }
@@ -1,13 +1,13 @@
1
1
  import InAppMessage from "./models/in-app-message.js";
2
2
  import r from "../managers/braze-instance.js";
3
3
  import ControlMessage from "./models/control-message.js";
4
- import { logger as N } from "../../shared-lib/index.js";
4
+ import { logger as E } from "../../shared-lib/index.js";
5
5
  import se from "./in-app-message-manager-factory.js";
6
6
  export function deferInAppMessage(e) {
7
7
  if (r.rr())
8
8
  return e instanceof ControlMessage
9
- ? (N.info("Not deferring since this is a ControlMessage."), !1)
9
+ ? (E.info("Not deferring since this is a ControlMessage."), !1)
10
10
  : e instanceof InAppMessage
11
- ? se.ea().sn(e)
12
- : (N.info("Not an instance of InAppMessage, ignoring."), !1);
11
+ ? se.ea().Ee(e)
12
+ : (E.info("Not an instance of InAppMessage, ignoring."), !1);
13
13
  }
@@ -1,40 +1,40 @@
1
1
  import ro from "../../util/browser-detector.js";
2
2
  import { InAppMessage, logInAppMessageHtmlClick } from "../index.js";
3
3
  import { OperatingSystems as so } from "../../util/device-constants.js";
4
- import { buildHtmlClickHandler as ct } from "./html-message-display-utils.js";
5
- import { attachHtmlToIframeWithNonce as m } from "../../util/html-display-utils.js";
6
- import { buildBrazeBridge as b } from "../../util/html-display-utils.js";
7
- export default function mt(t, e, o, s, n, i) {
8
- const l = document.createElement("iframe");
9
- l.setAttribute("title", "Modal Message"),
10
- n && (l.style.zIndex = (n + 1).toString());
4
+ import { buildHtmlClickHandler as lt } from "./html-message-display-utils.js";
5
+ import { attachHtmlToIframeWithNonce as b } from "../../util/html-display-utils.js";
6
+ import { buildBrazeBridge as N } from "../../util/html-display-utils.js";
7
+ export default function ct(t, e, o, s, n) {
8
+ const i = document.createElement("iframe");
9
+ i.setAttribute("title", "Modal Message"),
10
+ s && (i.style.zIndex = (s + 1).toString());
11
11
  if (
12
- (m(l, t.message, i),
13
- (l.onload = () => {
14
- const n = l.contentWindow;
15
- n.focus();
16
- const a = n.document.getElementsByTagName("head")[0];
17
- if (null != a) {
18
- if (t.lo()) {
12
+ (b(i, t.message, n),
13
+ (i.onload = () => {
14
+ const s = i.contentWindow;
15
+ s.focus();
16
+ const l = s.document.getElementsByTagName("head")[0];
17
+ if (null != l) {
18
+ if (t.Oe()) {
19
19
  const e = document.createElement("style");
20
20
  (e.innerHTML = t.css || ""),
21
- (e.id = t.do() || ""),
22
- null != i && e.setAttribute("nonce", i),
23
- a.appendChild(e);
21
+ (e.id = t.Ge() || ""),
22
+ null != n && e.setAttribute("nonce", n),
23
+ l.appendChild(e);
24
24
  }
25
- const e = n.document.createElement("base");
26
- null != e && (e.setAttribute("target", "_parent"), a.appendChild(e));
25
+ const e = s.document.createElement("base");
26
+ null != e && (e.setAttribute("target", "_parent"), l.appendChild(e));
27
27
  }
28
- const r = n.document.getElementsByTagName("title");
29
- r && r.length > 0 && l.setAttribute("title", r[0].textContent || "");
30
- const c = Object.assign(
28
+ const a = s.document.getElementsByTagName("title");
29
+ a && a.length > 0 && i.setAttribute("title", a[0].textContent || "");
30
+ const r = Object.assign(
31
31
  Object.assign(
32
32
  {},
33
- b(l, e, (e, o) => t.ll(e, o)),
33
+ N(i, (e, o) => t.ll(e, o)),
34
34
  ),
35
35
  {
36
36
  closeMessage: function () {
37
- t.ll(l);
37
+ t.ll(i);
38
38
  },
39
39
  logClick: function () {
40
40
  logInAppMessageHtmlClick(t, ...arguments);
@@ -42,33 +42,33 @@ export default function mt(t, e, o, s, n, i) {
42
42
  },
43
43
  );
44
44
  if (
45
- ((n.appboyBridge = c), (n.brazeBridge = c), t.uo !== InAppMessage.bo.po)
45
+ ((s.appboyBridge = r), (s.brazeBridge = r), t.He !== InAppMessage.Ke.Je)
46
46
  ) {
47
- const e = n.document.getElementsByTagName("a");
48
- for (let o = 0; o < e.length; o++) e[o].onclick = ct(t, l, e[o], s);
49
- const o = n.document.getElementsByTagName("button");
50
- for (let e = 0; e < o.length; e++) o[e].onclick = ct(t, l, o[e], s);
47
+ const e = s.document.getElementsByTagName("a");
48
+ for (let s = 0; s < e.length; s++) e[s].onclick = lt(t, i, e[s], o);
49
+ const n = s.document.getElementsByTagName("button");
50
+ for (let e = 0; e < n.length; e++) n[e].onclick = lt(t, i, n[e], o);
51
51
  }
52
- const m = n.document.body;
53
- if (null != m) {
54
- t.ho() && (m.id = t.htmlId || "");
52
+ const c = s.document.body;
53
+ if (null != c) {
54
+ t.Le() && (c.id = t.htmlId || "");
55
55
  const e = document.createElement("hidden");
56
- (e.onclick = c.closeMessage),
56
+ (e.onclick = r.closeMessage),
57
57
  (e.className = "ab-programmatic-close-button"),
58
- m.appendChild(e);
58
+ c.appendChild(e);
59
59
  }
60
- n.dispatchEvent(new CustomEvent("ab.BridgeReady")),
61
- -1 !== l.className.indexOf("ab-start-hidden") &&
62
- ((l.className = l.className.replace("ab-start-hidden", "")), o(l));
60
+ s.dispatchEvent(new CustomEvent("ab.BridgeReady")),
61
+ -1 !== i.className.indexOf("ab-start-hidden") &&
62
+ ((i.className = i.className.replace("ab-start-hidden", "")), e(i));
63
63
  }),
64
- (l.className =
64
+ (i.className =
65
65
  "ab-in-app-message ab-start-hidden ab-html-message ab-modal-interactions"),
66
- ro.OS === so.ao)
66
+ ro.OS === so.co)
67
67
  ) {
68
68
  const e = document.createElement("div");
69
69
  return (
70
- (e.className = "ab-ios-scroll-wrapper"), e.appendChild(l), (t.jo = e), e
70
+ (e.className = "ab-ios-scroll-wrapper"), e.appendChild(i), (t.Pe = e), e
71
71
  );
72
72
  }
73
- return (t.jo = l), l;
73
+ return (t.Pe = i), i;
74
74
  }