@braze/web-sdk 6.3.1 → 6.5.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 (159) hide show
  1. package/README.md +1 -1
  2. package/index.d.ts +38 -5
  3. package/package.json +1 -1
  4. package/shared-lib/encoding-utils.js +3 -3
  5. package/shared-lib/event-types.js +30 -30
  6. package/shared-lib/guid.js +1 -1
  7. package/shared-lib/indexed-db-adapter.js +60 -60
  8. package/shared-lib/logger.js +7 -7
  9. package/shared-lib/supported-options.js +24 -23
  10. package/src/Banner/banner-provider.js +95 -81
  11. package/src/Banner/banner.js +9 -9
  12. package/src/Banner/constants.js +4 -0
  13. package/src/Banner/display/banner-to-html.js +3 -3
  14. package/src/Banner/display/destroy-banner-html.js +3 -3
  15. package/src/Banner/display/detect-banner-impressions.js +16 -16
  16. package/src/Banner/get-all-banners.js +4 -4
  17. package/src/Banner/get-banner.js +5 -4
  18. package/src/Banner/index.js +2 -0
  19. package/src/Banner/log-banner-click.js +2 -2
  20. package/src/Banner/log-banner-impressions.js +6 -6
  21. package/src/Banner/request-banners-refresh.js +18 -20
  22. package/src/Banner/subscribe-to-banners-updates.js +5 -5
  23. package/src/Banner/ui/insert-banner.js +17 -14
  24. package/src/Card/card-manager-factory.js +6 -6
  25. package/src/Card/card-manager.js +28 -28
  26. package/src/Card/constants.js +1 -0
  27. package/src/Card/display/card-display.js +7 -7
  28. package/src/Card/log-card-dismissal.js +3 -3
  29. package/src/Card/log-content-card-click.js +3 -3
  30. package/src/Card/log-content-card-impressions.js +6 -6
  31. package/src/Card/models/captioned-image.js +3 -3
  32. package/src/Card/models/card.js +9 -9
  33. package/src/Card/models/classic-card.js +3 -3
  34. package/src/Card/models/control-card.js +3 -3
  35. package/src/Card/models/image-only.js +3 -3
  36. package/src/ContentCards/content-cards-provider-factory.js +6 -2
  37. package/src/ContentCards/content-cards-provider.js +101 -87
  38. package/src/ContentCards/content-cards.js +4 -4
  39. package/src/ContentCards/request-content-cards-refresh.js +1 -1
  40. package/src/ContentCards/subscribe-to-content-cards-updates.js +4 -4
  41. package/src/ContentCards/ui/show-content-cards.js +5 -5
  42. package/src/Core/add-sdk-metadata.js +2 -2
  43. package/src/Core/change-user.js +1 -1
  44. package/src/Core/disable-sdk.js +5 -5
  45. package/src/Core/enable-sdk.js +3 -3
  46. package/src/Core/get-device-id.js +2 -2
  47. package/src/Core/get-user.js +1 -1
  48. package/src/Core/handle-braze-action.js +3 -3
  49. package/src/Core/is-disabled.js +1 -1
  50. package/src/Core/log-custom-event.js +7 -7
  51. package/src/Core/log-purchase.js +4 -4
  52. package/src/Core/open-session.js +6 -6
  53. package/src/Core/wipe-data.js +3 -3
  54. package/src/DUST/dust-connection-core.js +23 -0
  55. package/src/DUST/dust-provider-factory.js +22 -0
  56. package/src/DUST/dust-provider.js +520 -0
  57. package/src/DUST/dust-shared-worker-code.js +2 -0
  58. package/src/DUST/dust-shared-worker-impl.js +240 -0
  59. package/src/DUST/dust-worker-bridge.js +136 -0
  60. package/src/DUST/index.js +13 -0
  61. package/src/DUST/subscribe-to-dust.js +24 -0
  62. package/src/DUST/types.js +1 -0
  63. package/src/FeatureFlags/feature-flag-factory.js +8 -8
  64. package/src/FeatureFlags/feature-flag.js +6 -6
  65. package/src/FeatureFlags/feature-flags-provider-factory.js +9 -9
  66. package/src/FeatureFlags/feature-flags-provider.js +98 -84
  67. package/src/FeatureFlags/get-all-feature-flags.js +3 -3
  68. package/src/FeatureFlags/get-feature-flag.js +3 -3
  69. package/src/FeatureFlags/log-feature-flag-impression.js +7 -7
  70. package/src/FeatureFlags/refresh-feature-flags.js +5 -5
  71. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +4 -4
  72. package/src/InAppMessage/constants.js +4 -0
  73. package/src/InAppMessage/defer-in-app-message.js +2 -2
  74. package/src/InAppMessage/display/get-animation-effect.js +1 -1
  75. package/src/InAppMessage/display/html-message-to-html.js +6 -6
  76. package/src/InAppMessage/display/in-app-message-to-html.js +34 -34
  77. package/src/InAppMessage/display/modal-utils.js +14 -14
  78. package/src/InAppMessage/get-deferred-in-app-message.js +2 -2
  79. package/src/InAppMessage/in-app-message-factory.js +4 -4
  80. package/src/InAppMessage/in-app-message-manager-factory.js +7 -7
  81. package/src/InAppMessage/in-app-message-manager.js +98 -98
  82. package/src/InAppMessage/log-in-app-message-button-click.js +12 -12
  83. package/src/InAppMessage/log-in-app-message-click.js +11 -11
  84. package/src/InAppMessage/log-in-app-message-html-click.js +9 -9
  85. package/src/InAppMessage/log-in-app-message-impression.js +8 -8
  86. package/src/InAppMessage/models/control-message.js +5 -5
  87. package/src/InAppMessage/models/full-screen-message.js +21 -21
  88. package/src/InAppMessage/models/html-message.js +18 -18
  89. package/src/InAppMessage/models/in-app-message-button.js +7 -7
  90. package/src/InAppMessage/models/in-app-message.js +145 -145
  91. package/src/InAppMessage/models/modal-message.js +21 -21
  92. package/src/InAppMessage/models/slide-up-message.js +27 -27
  93. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  94. package/src/InAppMessage/subscribe-to-in-app-message.js +2 -2
  95. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +5 -5
  96. package/src/InAppMessage/ui/remove-all-visible-in-app-messages.js +18 -0
  97. package/src/InAppMessage/ui/show-in-app-message.js +36 -36
  98. package/src/Push/is-push-blocked.js +2 -2
  99. package/src/Push/is-push-permission-granted.js +2 -2
  100. package/src/Push/is-push-supported.js +2 -2
  101. package/src/Push/push-manager-factory.js +15 -15
  102. package/src/Push/push-manager.js +97 -97
  103. package/src/Push/request-push-permission.js +1 -1
  104. package/src/Push/unregister-push.js +1 -1
  105. package/src/Push/utils/push-utils.js +17 -17
  106. package/src/User/user-manager.js +24 -24
  107. package/src/User/user.js +55 -55
  108. package/src/common/constants.js +8 -10
  109. package/src/common/content-cards-display.js +40 -40
  110. package/src/common/event-logger.js +8 -8
  111. package/src/common/properties-base.js +16 -16
  112. package/src/l10n/l10n-manager-factory.js +11 -11
  113. package/src/l10n/l10n-manager.js +2 -2
  114. package/src/managers/auth-manager.js +30 -30
  115. package/src/managers/braze-instance.js +170 -162
  116. package/src/managers/device-manager.js +24 -24
  117. package/src/managers/network-manager.js +149 -149
  118. package/src/managers/server-config-manager.js +140 -95
  119. package/src/managers/session-manager.js +39 -39
  120. package/src/managers/storage-manager-factory.js +10 -10
  121. package/src/managers/storage-manager.js +145 -141
  122. package/src/managers/subscription-manager.js +11 -11
  123. package/src/managers/utils.js +1 -1
  124. package/src/models/backend-errors.js +5 -5
  125. package/src/models/braze-event.js +11 -11
  126. package/src/models/device.js +3 -3
  127. package/src/models/identifier.js +16 -16
  128. package/src/models/push-token.js +13 -13
  129. package/src/models/request-result.js +3 -3
  130. package/src/models/server-config.js +45 -37
  131. package/src/request-controller.js +163 -158
  132. package/src/triggers/models/custom-event-data.js +5 -5
  133. package/src/triggers/models/custom-event-property-data.js +6 -6
  134. package/src/triggers/models/filter-set.js +10 -10
  135. package/src/triggers/models/filter.js +27 -27
  136. package/src/triggers/models/in-app-message-click-data.js +13 -13
  137. package/src/triggers/models/purchase-data.js +2 -2
  138. package/src/triggers/models/purchase-property-data.js +6 -6
  139. package/src/triggers/models/push-click-data.js +6 -6
  140. package/src/triggers/models/trigger-condition.js +47 -47
  141. package/src/triggers/models/trigger-events.js +3 -3
  142. package/src/triggers/models/trigger.js +36 -36
  143. package/src/triggers/triggers-provider-factory.js +5 -5
  144. package/src/triggers/triggers-provider.js +63 -63
  145. package/src/ui/js/attach-css.js +3 -3
  146. package/src/ui/js/load-font-awesome.js +2 -2
  147. package/src/util/base-device-parser.js +9 -9
  148. package/src/util/braze-actions.js +5 -5
  149. package/src/util/browser-detector.js +37 -37
  150. package/src/util/client-hints-parser.js +11 -11
  151. package/src/util/component-utils.js +5 -5
  152. package/src/util/dom-utils.js +13 -13
  153. package/src/util/html-display-utils.js +7 -7
  154. package/src/util/key-codes.js +1 -1
  155. package/src/util/net.js +5 -5
  156. package/src/util/request-header-utils.js +27 -27
  157. package/src/util/user-agent-parser.js +21 -21
  158. package/src/util/validation-utils.js +17 -17
  159. package/src/util/window-utils.js +3 -3
@@ -1,4 +1,4 @@
1
- import a from "../util/net.js";
1
+ import l from "../util/net.js";
2
2
  import t from "../common/base-provider.js";
3
3
  import r from "../managers/braze-instance.js";
4
4
  import ContentCards from "./content-cards.js";
@@ -9,24 +9,29 @@ import {
9
9
  newCardFromSerializedValue as it,
10
10
  } from "../Card/util/card-factory.js";
11
11
  import { STORAGE_KEYS as s } from "../managers/storage-manager.js";
12
- import u from "../managers/subscription-manager.js";
12
+ import m from "../managers/subscription-manager.js";
13
13
  import h from "../util/request-header-utils.js";
14
- import { randomInclusive as l } from "../util/math.js";
14
+ import { randomInclusive as a } from "../util/math.js";
15
+ import {
16
+ REQUEST_BACKOFF_MAX_SLEEP_MS_DEFAULT as u,
17
+ REQUEST_BACKOFF_MIN_SLEEP_MS_DEFAULT as c,
18
+ REQUEST_BACKOFF_SCALE_FACTOR_DEFAULT as d,
19
+ } from "../common/constants.js";
15
20
  import { logger as E, IndexedDBAdapter as et } from "../../shared-lib/index.js";
16
21
  export default class Z extends t {
17
22
  constructor(t, s, i, e, h) {
18
23
  super(),
19
- (this.Cs = t),
20
- (this.j = s),
24
+ (this.vs = t),
25
+ (this.B = s),
21
26
  (this.h = i),
22
- (this.vs = e),
23
- (this.B = h),
24
- (this.Cs = t),
25
- (this.j = s),
27
+ (this.Cs = e),
28
+ (this.j = h),
29
+ (this.vs = t),
30
+ (this.B = s),
26
31
  (this.h = i),
27
- (this.vs = e),
28
- (this.B = h),
29
- (this.ws = new u()),
32
+ (this.Cs = e),
33
+ (this.j = h),
34
+ (this.ws = new m()),
30
35
  r.q(this.ws),
31
36
  (this.ys = 0),
32
37
  (this.Ss = 0),
@@ -48,23 +53,23 @@ export default class Z extends t {
48
53
  Es(t) {
49
54
  this.Ns = t;
50
55
  }
51
- jt() {
56
+ St() {
52
57
  return this.D;
53
58
  }
54
- yt(t) {
59
+ wt(t) {
55
60
  this.D = t;
56
61
  }
57
62
  Ts() {
58
- if (!this.j) return;
59
- const t = this.j.lt(s.ct.Ps) || [],
63
+ if (!this.B) return;
64
+ const t = this.B.dt(s.ft.Ps) || [],
60
65
  i = [];
61
66
  for (let s = 0; s < t.length; s++) {
62
67
  const e = it(t[s]);
63
68
  null != e && i.push(e);
64
69
  }
65
70
  (this.cards = this.Xs(this._s(i, !1))),
66
- (this.ys = this.j.lt(s.ct.Gs) || this.ys),
67
- (this.Ss = this.j.lt(s.ct.Hs) || this.Ss);
71
+ (this.ys = this.B.dt(s.ft.Gs) || this.ys),
72
+ (this.Ss = this.B.dt(s.ft.Hs) || this.Ss);
68
73
  }
69
74
  Is(t, i = !1, e = 0, h = 0) {
70
75
  let r;
@@ -99,11 +104,11 @@ export default class Z extends t {
99
104
  this.Ks(),
100
105
  (this.ys = e),
101
106
  (this.Ss = h),
102
- this.j && (this.j.ft(s.ct.Gs, this.ys), this.j.ft(s.ct.Hs, this.Ss));
107
+ this.B && (this.B.bt(s.ft.Gs, this.ys), this.B.bt(s.ft.Hs, this.Ss));
103
108
  }
104
109
  N(t) {
105
110
  if (this.Os() && null != t && t.cards) {
106
- this.j && this.j.ft(s.ct.Qs, r.Vs());
111
+ this.B && this.B.bt(s.ft.Qs, r.Vs());
107
112
  const i = t.full_sync;
108
113
  i || this.Ts(),
109
114
  this.Is(t.cards, i, t.last_full_sync_at, t.last_card_updated_at),
@@ -119,7 +124,7 @@ export default class Z extends t {
119
124
  this.Ts();
120
125
  const i = this.cards.slice();
121
126
  let e = null;
122
- e = null === (s = this.Cs) || void 0 === s ? void 0 : s.getUserId();
127
+ e = null === (s = this.vs) || void 0 === s ? void 0 : s.getUserId();
123
128
  for (let s = 0; s < t.length; s++)
124
129
  if (e === t[s].userId || (null == e && null == t[s].userId)) {
125
130
  const e = t[s].card;
@@ -147,10 +152,10 @@ export default class Z extends t {
147
152
  let e = {},
148
153
  h = {},
149
154
  r = {};
150
- this.j &&
151
- ((e = this.j.lt(s.ct.Et) || {}),
152
- (h = this.j.lt(s.ct.Pt) || {}),
153
- (r = this.j.lt(s.ct.Lt) || {}));
155
+ this.B &&
156
+ ((e = this.B.dt(s.ft.Jt) || {}),
157
+ (h = this.B.dt(s.ft.Vt) || {}),
158
+ (r = this.B.dt(s.ft.Pt) || {}));
154
159
  const n = {},
155
160
  o = {},
156
161
  l = {};
@@ -163,8 +168,8 @@ export default class Z extends t {
163
168
  }
164
169
  return (
165
170
  i &&
166
- this.j &&
167
- (this.j.ft(s.ct.Et, n), this.j.ft(s.ct.Pt, o), this.j.ft(s.ct.Lt, l)),
171
+ this.B &&
172
+ (this.B.bt(s.ft.Jt, n), this.B.bt(s.ft.Vt, o), this.B.bt(s.ft.Pt, l)),
168
173
  t
169
174
  );
170
175
  }
@@ -172,11 +177,11 @@ export default class Z extends t {
172
177
  const i = [],
173
178
  e = new Date();
174
179
  let h = {};
175
- this.j && (h = this.j.lt(s.ct.Lt) || {});
180
+ this.B && (h = this.B.dt(s.ft.Pt) || {});
176
181
  let r = !1;
177
182
  for (let s = 0; s < t.length; s++) {
178
183
  const n = t[s].url;
179
- if (!this.vs && n && tt(n)) {
184
+ if (!this.Cs && n && tt(n)) {
180
185
  E.error(
181
186
  `Card with url ${n} will not be displayed because Javascript URLs are disabled. Use the "allowUserSuppliedJavascript" option for braze.initialize to enable this card.`,
182
187
  );
@@ -191,79 +196,88 @@ export default class Z extends t {
191
196
  i && (h[i] = !0), (r = !0);
192
197
  }
193
198
  }
194
- return r && this.j && this.j.ft(s.ct.Lt, h), i;
199
+ return r && this.B && this.B.bt(s.ft.Pt, h), i;
195
200
  }
196
201
  Ks() {
197
202
  var t;
198
203
  const i = [];
199
- for (let t = 0; t < this.cards.length; t++) i.push(this.cards[t].dt());
200
- null === (t = this.j) || void 0 === t || t.ft(s.ct.Ps, i);
204
+ for (let t = 0; t < this.cards.length; t++) i.push(this.cards[t].gt());
205
+ null === (t = this.B) || void 0 === t || t.bt(s.ft.Ps, i);
201
206
  }
202
207
  Zs() {
203
208
  this.Js && (clearTimeout(this.Js), (this.Js = null));
204
209
  }
205
- fi(t, i, e = !1) {
210
+ ar(t, i, e = !1) {
206
211
  var n;
207
- const o = this.B,
208
- u = this.j;
209
- if (!o || !u) return void ("function" == typeof i && i());
210
- if ((e && (h.Ci(u, h.H.bi), this.Zs()), !this.Os()))
212
+ const o = this.j,
213
+ f = this.B;
214
+ if (!o || !f) return void ("function" == typeof i && i());
215
+ if ((e && (h.fi(f, h.H.vi), this.Zs()), !this.Os()))
211
216
  return void (
212
217
  null === (n = this.h) ||
213
218
  void 0 === n ||
214
- n.vi(() => {
215
- this.fi(t, i, !0);
219
+ n.Ci(() => {
220
+ this.ar(t, i, !0);
216
221
  })
217
222
  );
218
- const c = o.$({}, !0);
219
- u.lt(s.ct.Qs) !== r.Vs() && this.wi(),
220
- (c.last_full_sync_at = this.ys),
221
- (c.last_card_updated_at = this.Ss);
222
- const f = o.A(c, h.H.bi, e);
223
- let d = !1;
223
+ const m = o.$({}, !0);
224
+ f.dt(s.ft.Qs) !== r.Vs() && this.bi(),
225
+ (m.last_full_sync_at = this.ys),
226
+ (m.last_card_updated_at = this.Ss);
227
+ const p = o.A(m, h.H.vi, e);
228
+ let v = !1;
224
229
  o.J(
225
- c,
230
+ m,
226
231
  (s = -1) => {
227
- if (this.j) {
232
+ if (this.B) {
228
233
  const t = new Date().valueOf();
229
- h.K(this.j, h.H.bi, t);
234
+ h.K(this.B, h.H.vi, t);
230
235
  }
231
- -1 !== s && f.push(["X-Braze-Req-Tokens-Remaining", s.toString()]),
232
- a.O({
236
+ -1 !== s && p.push(["X-Braze-Req-Tokens-Remaining", s.toString()]),
237
+ l.O({
233
238
  url: `${o.V()}/content_cards/sync`,
234
- data: c,
235
- headers: f,
239
+ data: m,
240
+ headers: p,
236
241
  W: (s) => {
237
- if (!o.Y(c, s, f))
238
- return (d = !0), void ("function" == typeof i && i());
239
- o.Z(), this.N(s), (d = !1), "function" == typeof t && t();
242
+ if (!o.Y(m, s, p))
243
+ return (v = !0), void ("function" == typeof i && i());
244
+ o.Z(), this.N(s), (v = !1), "function" == typeof t && t();
240
245
  },
241
246
  error: (t) => {
242
247
  o._(t, "retrieving content cards"),
243
- (d = !0),
248
+ (v = !0),
244
249
  "function" == typeof i && i();
245
250
  },
246
251
  tt: (s, e) => {
247
- let r;
248
- if (d) {
249
- let t = this.Ms;
250
- (null == t || t < 1e3 * this.$s) && (t = 1e3 * this.$s),
251
- (r = Math.min(3e5, l(1e3 * this.$s, 3 * t)));
252
+ var r, n, l;
253
+ let f;
254
+ if (v) {
255
+ const t =
256
+ (null === (r = this.h) || void 0 === r ? void 0 : r.st()) ||
257
+ c,
258
+ s =
259
+ (null === (n = this.h) || void 0 === n ? void 0 : n.it()) ||
260
+ d,
261
+ i =
262
+ (null === (l = this.h) || void 0 === l ? void 0 : l.nt()) ||
263
+ u;
264
+ let e = this.Ms;
265
+ (null == e || e < t) && (e = t), (f = Math.min(i, a(t, e * s)));
252
266
  }
253
- o.st(
267
+ o.et(
254
268
  e,
255
269
  () => {
256
- this.fi(t, i, !1);
270
+ this.ar(t, i, !1);
257
271
  },
258
- h.H.bi,
272
+ h.H.vi,
259
273
  (t) => this.Ys(t),
260
274
  () => this.Zs(),
261
- r,
275
+ f,
262
276
  );
263
277
  },
264
278
  });
265
279
  },
266
- h.H.bi,
280
+ h.H.vi,
267
281
  i,
268
282
  );
269
283
  }
@@ -284,29 +298,29 @@ export default class Z extends t {
284
298
  let e = Math.max(this.Ss || 0, this.ys || 0);
285
299
  return (
286
300
  0 === e && (e = void 0),
287
- this.j && this.j.lt(s.ct.Hs) === this.Ss && void 0 === e && (e = this.Ss),
301
+ this.B && this.B.dt(s.ft.Hs) === this.Ss && void 0 === e && (e = this.Ss),
288
302
  new ContentCards(i, V(e))
289
303
  );
290
304
  }
291
- St(t) {
292
- return this.ws.wt(t);
305
+ It(t) {
306
+ return this.ws.Rt(t);
293
307
  }
294
- wi() {
308
+ bi() {
295
309
  (this.ys = 0),
296
310
  (this.Ss = 0),
297
- this.j && (this.j.Nt(s.ct.Gs), this.j.Nt(s.ct.Hs));
311
+ this.B && (this.B.zt(s.ft.Gs), this.B.zt(s.ft.Hs));
298
312
  }
299
313
  changeUser(t) {
300
314
  t ||
301
315
  ((this.cards = []),
302
316
  this.ws.L(new ContentCards(this.cards.slice(), null)),
303
- this.j &&
304
- (this.j.Nt(s.ct.Ps),
305
- this.j.Nt(s.ct.Et),
306
- this.j.Nt(s.ct.Pt),
307
- this.j.Nt(s.ct.Lt))),
317
+ this.B &&
318
+ (this.B.zt(s.ft.Ps),
319
+ this.B.zt(s.ft.Jt),
320
+ this.B.zt(s.ft.Vt),
321
+ this.B.zt(s.ft.Pt))),
308
322
  this.Zs(),
309
- this.wi();
323
+ this.bi();
310
324
  }
311
325
  clearData(t) {
312
326
  (this.ys = 0),
@@ -314,19 +328,19 @@ export default class Z extends t {
314
328
  (this.cards = []),
315
329
  this.ws.L(new ContentCards(this.cards.slice(), null)),
316
330
  t &&
317
- this.j &&
318
- (this.j.Nt(s.ct.Ps),
319
- this.j.Nt(s.ct.Et),
320
- this.j.Nt(s.ct.Pt),
321
- this.j.Nt(s.ct.Lt),
322
- this.j.Nt(s.ct.Gs),
323
- this.j.Nt(s.ct.Hs)),
331
+ this.B &&
332
+ (this.B.zt(s.ft.Ps),
333
+ this.B.zt(s.ft.Jt),
334
+ this.B.zt(s.ft.Vt),
335
+ this.B.zt(s.ft.Pt),
336
+ this.B.zt(s.ft.Gs),
337
+ this.B.zt(s.ft.Hs)),
324
338
  this.Zs();
325
339
  }
326
340
  Os() {
327
- return !!this.h && (!!this.h.gi() || (0 !== this.h.Ft() && this.ji(), !1));
341
+ return !!this.h && (!!this.h.wi() || (0 !== this.h.xt() && this.gi(), !1));
328
342
  }
329
- ji() {
330
- this.ws.L(new ContentCards([], new Date())), this.j && this.j.Nt(s.ct.Ps);
343
+ gi() {
344
+ this.ws.L(new ContentCards([], new Date())), this.B && this.B.zt(s.ft.Ps);
331
345
  }
332
346
  }
@@ -19,14 +19,14 @@ export default class ContentCards {
19
19
  sr(r) {
20
20
  logContentCardImpressions(r);
21
21
  }
22
- nr(r) {
22
+ dr(r) {
23
23
  return logContentCardClick(r);
24
24
  }
25
- dr() {
25
+ ur() {
26
26
  requestContentCardsRefresh();
27
27
  }
28
- ar() {
28
+ cr() {
29
29
  return !0;
30
30
  }
31
31
  }
32
- (ContentCards.ur = 6e4), (ContentCards.cr = 500), (ContentCards.Cr = 1e4);
32
+ (ContentCards.Cr = 6e4), (ContentCards.hr = 500), (ContentCards.lr = 1e4);
@@ -1,5 +1,5 @@
1
1
  import r from "../managers/braze-instance.js";
2
2
  import rr from "./content-cards-provider-factory.js";
3
3
  export function requestContentCardsRefresh(e, t) {
4
- if (r.rr()) return rr.o().fi(e, t, !0);
4
+ if (r.rr()) return rr.o().ar(e, t, !0);
5
5
  }
@@ -3,14 +3,14 @@ import rr from "./content-cards-provider-factory.js";
3
3
  export function subscribeToContentCardsUpdates(o) {
4
4
  if (!r.rr()) return;
5
5
  const t = rr.o(),
6
- n = t.St(o);
7
- if (!t.jt()) {
6
+ n = t.It(o);
7
+ if (!t.St()) {
8
8
  const o = r.nn();
9
9
  if (o) {
10
10
  const r = o.rn(() => {
11
- t.fi(void 0, void 0, !0);
11
+ t.ar(void 0, void 0, !0);
12
12
  });
13
- r && t.yt(r);
13
+ r && t.wt(r);
14
14
  }
15
15
  }
16
16
  return n;
@@ -1,4 +1,4 @@
1
- import r, { OPTIONS as z } from "../../managers/braze-instance.js";
1
+ import r, { OPTIONS as D } from "../../managers/braze-instance.js";
2
2
  import { ContentCards, subscribeToContentCardsUpdates } from "../index.js";
3
3
  import rr from "../content-cards-provider-factory.js";
4
4
  import { setCardHeight as tn } from "../../Card/display/card-display.js";
@@ -18,17 +18,17 @@ export function showContentCards(n, t) {
18
18
  fn();
19
19
  let e = !1;
20
20
  null == n && ((n = document.body), (e = !0));
21
- const o = r.ee(z.tn) || !1,
21
+ const o = r.re(D.tn) || !1,
22
22
  s = rr.o().Ws(!1);
23
23
  "function" == typeof t && cn(s, t(s.cards.slice()), s.lastUpdated, null, o);
24
24
  const a = on(s, o, e),
25
25
  i = rr.o(),
26
26
  c = i.Bs();
27
27
  (null == s.lastUpdated ||
28
- new Date().valueOf() - s.lastUpdated.valueOf() > ContentCards.ur) &&
29
- (null == c || new Date().valueOf() - c > ContentCards.ur) &&
28
+ new Date().valueOf() - s.lastUpdated.valueOf() > ContentCards.Cr) &&
29
+ (null == c || new Date().valueOf() - c > ContentCards.Cr) &&
30
30
  (E.info(
31
- `Cached content cards were older than max TTL of ${ContentCards.ur} ms, requesting an update from the server.`,
31
+ `Cached content cards were older than max TTL of ${ContentCards.Cr} ms, requesting an update from the server.`,
32
32
  ),
33
33
  sn(s, a),
34
34
  i.Es(new Date().valueOf()));
@@ -1,7 +1,7 @@
1
1
  import aa from "../managers/braze-instance.js";
2
2
  import BrazeSdkMetadata from "./braze-sdk-metadata.js";
3
3
  import {
4
- isArray as D,
4
+ isArray as R,
5
5
  validateValueIsFromEnum as ta,
6
6
  } from "../util/code-utils.js";
7
7
  import { logger as E } from "../../shared-lib/index.js";
@@ -9,7 +9,7 @@ export function addSdkMetadata(a) {
9
9
  if (!aa.rr()) return;
10
10
  const t = aa.m();
11
11
  if (t) {
12
- if (!D(a))
12
+ if (!R(a))
13
13
  return (
14
14
  E.error("Cannot set SDK metadata because metadata is not an array."), !1
15
15
  );
@@ -13,5 +13,5 @@ export function changeUser(e, i) {
13
13
  );
14
14
  if (null != i && !ir(i, "set signature for new user", "signature")) return;
15
15
  const t = r.nn();
16
- t && t.changeUser(e.toString(), r.lr(), i);
16
+ t && t.changeUser(e.toString(), r.gr(), i);
17
17
  }
@@ -4,12 +4,12 @@ import ee, { STORAGE_KEYS as s } from "../managers/storage-manager.js";
4
4
  export function disableSDK() {
5
5
  const e = r.nn();
6
6
  e && e.requestImmediateDataFlush();
7
- const n = new ee.ne(null, !0),
8
- a = "This-cookie-will-expire-in-" + n.se();
9
- n.store(s.ie, a);
7
+ const n = new ee.le(null, !0),
8
+ a = "This-cookie-will-expire-in-" + n.me();
9
+ n.store(s.pe, a);
10
10
  const i = et.Us.Rs;
11
- new et(i, E).setItem(i.Fs.le, i.me, !0),
11
+ new et(i, E).setItem(i.Fs.be, i.fe, !0),
12
12
  E.info("disableSDK was called"),
13
13
  r.destroy(!1),
14
- r.ce(!0);
14
+ r.ge(!0);
15
15
  }
@@ -2,10 +2,10 @@ import r from "../managers/braze-instance.js";
2
2
  import { logger as E, IndexedDBAdapter as et } from "../../shared-lib/index.js";
3
3
  import ee, { STORAGE_KEYS as s } from "../managers/storage-manager.js";
4
4
  export function enableSDK() {
5
- new ee.ne(null, !0).remove(s.ie);
5
+ new ee.le(null, !0).remove(s.pe);
6
6
  const e = et.Us.Rs;
7
- new et(e, E).be(e.Fs.le, e.me),
7
+ new et(e, E).je(e.Fs.be, e.fe),
8
8
  E.info("enableSDK was called"),
9
9
  r.destroy(!1),
10
- r.ce(!1);
10
+ r.ge(!1);
11
11
  }
@@ -2,9 +2,9 @@ import r from "../managers/braze-instance.js";
2
2
  import { logger as E } from "../../shared-lib/index.js";
3
3
  export function getDeviceId(e) {
4
4
  if (!r.rr()) return;
5
- const t = r.de();
5
+ const t = r.ue();
6
6
  if (!t) return;
7
- const i = t.fe().id;
7
+ const i = t.ve().id;
8
8
  if ("function" != typeof e) return i;
9
9
  E.warn(
10
10
  "The callback for getDeviceId is deprecated. You can access its return value directly instead (e.g. `const id = braze.getDeviceId()`)",
@@ -1,4 +1,4 @@
1
1
  import r from "../managers/braze-instance.js";
2
2
  export function getUser() {
3
- if (r.rr()) return r.gr();
3
+ if (r.rr()) return r.br();
4
4
  }
@@ -1,5 +1,5 @@
1
1
  import { logger as E } from "../../shared-lib/index.js";
2
- import { BRAZE_MUST_BE_INITIALIZED_ERROR as w } from "../common/constants.js";
2
+ import { CoreStrings as z } from "../common/constants.js";
3
3
  import r from "../managers/braze-instance.js";
4
4
  import {
5
5
  BRAZE_ACTIONS as oo,
@@ -44,7 +44,7 @@ export function _handleBrazeAction(o, e, s) {
44
44
  r.ao()
45
45
  ? ((t = Array.prototype.slice.call(e)),
46
46
  logCustomEvent(...t))
47
- : E.error(w);
47
+ : E.error(z.ee);
48
48
  },
49
49
  );
50
50
  break;
@@ -55,7 +55,7 @@ export function _handleBrazeAction(o, e, s) {
55
55
  ? "Safari" === ro.browser && ro.OS === so.co
56
56
  ? window.navigator.standalone && requestPushPermission()
57
57
  : requestPushPermission()
58
- : E.error(w);
58
+ : E.error(z.ee);
59
59
  },
60
60
  );
61
61
  break;
@@ -1,4 +1,4 @@
1
1
  import ee, { STORAGE_KEYS as s } from "../managers/storage-manager.js";
2
2
  export function isDisabled() {
3
- return !!new ee.ne(null, !0).br(s.ie);
3
+ return !!new ee.le(null, !0).jr(s.pe);
4
4
  }
@@ -1,13 +1,13 @@
1
1
  import r from "../managers/braze-instance.js";
2
- import c from "../common/event-logger.js";
3
- import { logger as E, EventTypes as m } from "../../shared-lib/index.js";
2
+ import v from "../common/event-logger.js";
3
+ import { logger as E, EventTypes as f } from "../../shared-lib/index.js";
4
4
  import ot from "../triggers/models/trigger-events.js";
5
5
  import { TriggersProviderFactory as rt } from "../triggers/triggers-provider-factory.js";
6
6
  import {
7
7
  validateCustomProperties as nt,
8
8
  validateCustomString as mt,
9
9
  } from "../util/validation-utils.js";
10
- import { LOG_CUSTOM_EVENT_STRING as gt } from "../common/constants.js";
10
+ import { CoreStrings as z } from "../common/constants.js";
11
11
  export function logCustomEvent(t, e) {
12
12
  if (!r.rr()) return !1;
13
13
  if (null == t || t.length <= 0)
@@ -20,19 +20,19 @@ export function logCustomEvent(t, e) {
20
20
  if (!mt(t, "log custom event", "the event name")) return !1;
21
21
  const [o, n] = nt(
22
22
  e,
23
- gt,
23
+ z.$e,
24
24
  "eventProperties",
25
25
  `log custom event "${t}"`,
26
26
  "event",
27
27
  );
28
28
  if (!o) return !1;
29
29
  const i = r.l();
30
- if (i && i.ge(t))
30
+ if (i && i.Ce(t))
31
31
  return E.info(`Custom Event "${t}" is blocklisted, ignoring.`), !1;
32
- const s = c.rt(m.CustomEvent, { n: t, p: n });
32
+ const s = v.lt(f.CustomEvent, { n: t, p: n });
33
33
  if (s.W) {
34
34
  E.info(`Logged custom event "${t}".`);
35
- for (const o of s.ue) rt.o().ve(ot.pe, [t, e], o);
35
+ for (const o of s.Ee) rt.o().he(ot.xe, [t, e], o);
36
36
  }
37
37
  return s.W;
38
38
  }
@@ -1,13 +1,13 @@
1
1
  import r from "../managers/braze-instance.js";
2
2
  import { MAX_PURCHASE_QUANTITY as or } from "../common/constants.js";
3
- import { logger as E, EventTypes as m } from "../../shared-lib/index.js";
3
+ import { logger as E, EventTypes as f } from "../../shared-lib/index.js";
4
4
  import ot from "../triggers/models/trigger-events.js";
5
5
  import { TriggersProviderFactory as rt } from "../triggers/triggers-provider-factory.js";
6
6
  import {
7
7
  validateCustomProperties as nt,
8
8
  validateCustomString as mt,
9
9
  } from "../util/validation-utils.js";
10
- import c from "../common/event-logger.js";
10
+ import v from "../common/event-logger.js";
11
11
  export function logPurchase(e, o, i, n, t) {
12
12
  if (!r.rr()) return !1;
13
13
  if (
@@ -230,10 +230,10 @@ export function logPurchase(e, o, i, n, t) {
230
230
  const g = r.l();
231
231
  if (g && g.Dr(e))
232
232
  return E.info(`Purchase "${e}" is blocklisted, ignoring.`), !1;
233
- const P = c.rt(m.Pr, { pid: e, c: i, p: s, q: D, pr: a });
233
+ const P = v.lt(f.Pr, { pid: e, c: i, p: s, q: D, pr: a });
234
234
  if (P.W) {
235
235
  E.info(`Logged ${D} purchase${D > 1 ? "s" : ""} of "${e}" for ${i} ${s}.`);
236
- for (const r of P.ue) rt.o().ve(ot.Rr, [e, t], r);
236
+ for (const r of P.Ee) rt.o().he(ot.Rr, [e, t], r);
237
237
  }
238
238
  return P.W;
239
239
  }
@@ -9,17 +9,17 @@ export function openSession() {
9
9
  i.openSession();
10
10
  const t = et.Us.Rs,
11
11
  o = new et(t, E);
12
- o.jr(t.Fs.hr, (r, n) => {
12
+ o.kr(t.Fs.vr, (r, n) => {
13
13
  const e = n.lastClick,
14
14
  s = n.trackingString;
15
15
  E.info(`Firing push click trigger from ${s} push click at ${e}`);
16
- const c = i.kr(e, s),
16
+ const c = i.$r(e, s),
17
17
  g = function () {
18
- rt.o().ve(ot.vr, [s], c);
18
+ rt.o().he(ot.wr, [s], c);
19
19
  };
20
- i.$r(g, g), o.be(t.Fs.hr, r);
20
+ i.yr(g, g), o.je(t.Fs.vr, r);
21
21
  }),
22
- o.Ds(t.Fs.wr, function (r) {
23
- i.yr(r);
22
+ o.Ds(t.Fs.zr, function (r) {
23
+ i.Fr(r);
24
24
  });
25
25
  }
@@ -1,10 +1,10 @@
1
1
  import r from "../managers/braze-instance.js";
2
2
  import { keys as C } from "../util/code-utils.js";
3
3
  import { logger as E, IndexedDBAdapter as et } from "../../shared-lib/index.js";
4
- import { BRAZE_MUST_BE_INITIALIZED_ERROR as w } from "../common/constants.js";
4
+ import { CoreStrings as z } from "../common/constants.js";
5
5
  export function wipeData() {
6
6
  const o = r.p();
7
- if (null == o) return void E.warn(w);
7
+ if (null == o) return void E.warn(z.ee);
8
8
  o.clearData();
9
9
  const t = C(et.Us);
10
10
  for (let o = 0; o < t.length; o++) {
@@ -12,7 +12,7 @@ export function wipeData() {
12
12
  r = et.Us[n];
13
13
  new et(r, E).clearData();
14
14
  }
15
- if (r.rr()) for (const o of r.lr()) o.clearData(!0);
15
+ if (r.rr()) for (const o of r.gr()) o.clearData(!0);
16
16
  const n = r.m();
17
17
  n && n.fo();
18
18
  }