@braze/web-sdk 6.4.0 → 6.6.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 (155) hide show
  1. package/README.md +1 -1
  2. package/index.d.ts +11 -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 +3 -3
  7. package/shared-lib/indexed-db-adapter.js +58 -58
  8. package/shared-lib/logger.js +7 -7
  9. package/shared-lib/supported-options.js +17 -16
  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 +1 -1
  14. package/src/Banner/display/destroy-banner-html.js +3 -3
  15. package/src/Banner/display/detect-banner-impressions.js +14 -14
  16. package/src/Banner/get-all-banners.js +4 -4
  17. package/src/Banner/get-banner.js +5 -4
  18. package/src/Banner/log-banner-click.js +2 -2
  19. package/src/Banner/log-banner-impressions.js +6 -6
  20. package/src/Banner/request-banners-refresh.js +18 -20
  21. package/src/Banner/subscribe-to-banners-updates.js +5 -5
  22. package/src/Banner/ui/insert-banner.js +17 -14
  23. package/src/Card/card-manager-factory.js +3 -3
  24. package/src/Card/card-manager.js +32 -32
  25. package/src/Card/constants.js +1 -0
  26. package/src/Card/display/card-display.js +11 -11
  27. package/src/Card/log-card-dismissal.js +2 -2
  28. package/src/Card/log-content-card-click.js +2 -2
  29. package/src/Card/log-content-card-impressions.js +5 -5
  30. package/src/Card/models/captioned-image.js +3 -3
  31. package/src/Card/models/card.js +16 -16
  32. package/src/Card/models/classic-card.js +3 -3
  33. package/src/Card/models/control-card.js +3 -3
  34. package/src/Card/models/image-only.js +3 -3
  35. package/src/Card/util/card-factory.js +6 -6
  36. package/src/ContentCards/content-cards-provider-factory.js +11 -11
  37. package/src/ContentCards/content-cards-provider.js +110 -96
  38. package/src/ContentCards/get-cached-content-cards.js +2 -2
  39. package/src/ContentCards/request-content-cards-refresh.js +2 -2
  40. package/src/ContentCards/subscribe-to-content-cards-updates.js +5 -5
  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 +4 -4
  44. package/src/Core/disable-sdk.js +9 -8
  45. package/src/Core/enable-sdk.js +5 -5
  46. package/src/Core/get-device-id.js +2 -2
  47. package/src/Core/handle-braze-action.js +3 -3
  48. package/src/Core/is-disabled.js +1 -1
  49. package/src/Core/log-custom-event.js +13 -13
  50. package/src/Core/log-purchase.js +10 -10
  51. package/src/Core/open-session.js +7 -7
  52. package/src/Core/set-sdk-authentication-signature.js +2 -2
  53. package/src/Core/wipe-data.js +6 -6
  54. package/src/DUST/dust-connection-core.js +23 -0
  55. package/src/DUST/dust-provider-factory.js +10 -8
  56. package/src/DUST/dust-provider.js +408 -176
  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 +10 -0
  61. package/src/DUST/subscribe-to-dust.js +13 -13
  62. package/src/FeatureFlags/feature-flag-factory.js +8 -8
  63. package/src/FeatureFlags/feature-flag.js +6 -6
  64. package/src/FeatureFlags/feature-flags-provider-factory.js +9 -9
  65. package/src/FeatureFlags/feature-flags-provider.js +98 -84
  66. package/src/FeatureFlags/get-all-feature-flags.js +3 -3
  67. package/src/FeatureFlags/get-feature-flag.js +3 -3
  68. package/src/FeatureFlags/log-feature-flag-impression.js +7 -7
  69. package/src/FeatureFlags/refresh-feature-flags.js +2 -2
  70. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +4 -4
  71. package/src/InAppMessage/constants.js +4 -0
  72. package/src/InAppMessage/defer-in-app-message.js +2 -2
  73. package/src/InAppMessage/display/get-animation-effect.js +1 -1
  74. package/src/InAppMessage/display/html-message-to-html.js +6 -6
  75. package/src/InAppMessage/display/in-app-message-to-html.js +40 -40
  76. package/src/InAppMessage/display/modal-utils.js +16 -16
  77. package/src/InAppMessage/get-deferred-in-app-message.js +2 -2
  78. package/src/InAppMessage/in-app-message-factory.js +4 -4
  79. package/src/InAppMessage/in-app-message-manager-factory.js +7 -7
  80. package/src/InAppMessage/in-app-message-manager.js +97 -97
  81. package/src/InAppMessage/log-in-app-message-button-click.js +14 -14
  82. package/src/InAppMessage/log-in-app-message-click.js +13 -13
  83. package/src/InAppMessage/log-in-app-message-html-click.js +11 -11
  84. package/src/InAppMessage/log-in-app-message-impression.js +8 -8
  85. package/src/InAppMessage/models/control-message.js +5 -5
  86. package/src/InAppMessage/models/full-screen-message.js +18 -18
  87. package/src/InAppMessage/models/html-message.js +19 -19
  88. package/src/InAppMessage/models/in-app-message-button.js +7 -7
  89. package/src/InAppMessage/models/in-app-message.js +121 -119
  90. package/src/InAppMessage/models/modal-message.js +18 -18
  91. package/src/InAppMessage/models/slide-up-message.js +23 -23
  92. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  93. package/src/InAppMessage/subscribe-to-in-app-message.js +2 -2
  94. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +5 -5
  95. package/src/InAppMessage/ui/remove-all-visible-in-app-messages.js +8 -8
  96. package/src/InAppMessage/ui/show-in-app-message.js +34 -34
  97. package/src/Push/push-manager-factory.js +14 -14
  98. package/src/Push/push-manager.js +90 -90
  99. package/src/Push/request-push-permission.js +1 -1
  100. package/src/Push/unregister-push.js +1 -1
  101. package/src/Push/utils/push-utils.js +9 -9
  102. package/src/User/user-manager.js +32 -32
  103. package/src/User/user.js +71 -71
  104. package/src/common/constants.js +8 -11
  105. package/src/common/content-cards-display.js +32 -32
  106. package/src/common/event-logger.js +10 -10
  107. package/src/common/properties-base.js +16 -16
  108. package/src/l10n/l10n-manager-factory.js +11 -11
  109. package/src/l10n/l10n-manager.js +2 -2
  110. package/src/managers/auth-manager.js +14 -14
  111. package/src/managers/braze-instance.js +163 -159
  112. package/src/managers/device-manager.js +11 -11
  113. package/src/managers/network-manager.js +154 -154
  114. package/src/managers/server-config-manager.js +116 -88
  115. package/src/managers/session-manager.js +41 -41
  116. package/src/managers/storage-manager-factory.js +13 -13
  117. package/src/managers/storage-manager.js +130 -131
  118. package/src/managers/subscription-manager.js +12 -12
  119. package/src/managers/utils.js +1 -1
  120. package/src/models/backend-errors.js +5 -5
  121. package/src/models/braze-event.js +10 -10
  122. package/src/models/device.js +2 -2
  123. package/src/models/identifier.js +17 -17
  124. package/src/models/push-token.js +14 -14
  125. package/src/models/request-result.js +4 -4
  126. package/src/models/server-config.js +41 -37
  127. package/src/request-controller.js +163 -160
  128. package/src/triggers/models/custom-event-data.js +5 -5
  129. package/src/triggers/models/custom-event-property-data.js +6 -6
  130. package/src/triggers/models/filter-set.js +8 -8
  131. package/src/triggers/models/filter.js +7 -7
  132. package/src/triggers/models/in-app-message-click-data.js +13 -13
  133. package/src/triggers/models/purchase-data.js +2 -2
  134. package/src/triggers/models/purchase-property-data.js +6 -6
  135. package/src/triggers/models/push-click-data.js +6 -6
  136. package/src/triggers/models/trigger-condition.js +47 -47
  137. package/src/triggers/models/trigger-events.js +2 -2
  138. package/src/triggers/models/trigger.js +42 -42
  139. package/src/triggers/triggers-provider-factory.js +5 -5
  140. package/src/triggers/triggers-provider.js +66 -66
  141. package/src/ui/js/attach-css.js +3 -3
  142. package/src/ui/js/load-font-awesome.js +2 -2
  143. package/src/util/base-device-parser.js +8 -8
  144. package/src/util/braze-actions.js +5 -5
  145. package/src/util/browser-detector.js +33 -33
  146. package/src/util/client-hints-parser.js +10 -10
  147. package/src/util/component-utils.js +5 -5
  148. package/src/util/dom-utils.js +13 -13
  149. package/src/util/html-display-utils.js +7 -7
  150. package/src/util/key-codes.js +1 -1
  151. package/src/util/net.js +6 -6
  152. package/src/util/request-header-utils.js +26 -26
  153. package/src/util/user-agent-parser.js +20 -20
  154. package/src/util/validation-utils.js +16 -16
  155. package/src/util/window-utils.js +3 -3
@@ -1,39 +1,44 @@
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";
5
- import { dateFromUnixTimestamp as X } from "../util/date-utils.js";
6
- import { isURIJavascriptOrData as Z } from "../util/url-utils.js";
5
+ import { dateFromUnixTimestamp as V } from "../util/date-utils.js";
6
+ import { isURIJavascriptOrData as tt } from "../util/url-utils.js";
7
7
  import {
8
- newCardFromContentCardsJson as tt,
9
- newCardFromSerializedValue as st,
8
+ newCardFromContentCardsJson as st,
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";
15
- import { logger as E, IndexedDBAdapter as it } from "../../shared-lib/index.js";
16
- export default class W extends t {
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";
20
+ import { logger as E, IndexedDBAdapter as et } from "../../shared-lib/index.js";
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),
33
38
  (this.cards = []),
34
39
  this.Ts();
35
- const n = it.Us.Rs;
36
- new it(n, E).Ds(n.Fs.As, (t) => {
40
+ const n = et.Us.Rs;
41
+ new et(n, E).Ds(n.Fs.As, (t) => {
37
42
  this.Ls(t);
38
43
  }),
39
44
  (this.Ns = null),
@@ -48,23 +53,23 @@ export default class W 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
- const e = st(t[s]);
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;
@@ -81,10 +86,10 @@ export default class W extends t {
81
86
  break;
82
87
  }
83
88
  if (i) {
84
- const t = tt(e);
89
+ const t = st(e);
85
90
  null != h && h.viewed && t && (t.viewed = !0), null != t && r.push(t);
86
91
  } else if (null == h) {
87
- const t = tt(e);
92
+ const t = st(e);
88
93
  null != t && r.push(t);
89
94
  } else {
90
95
  if (!h.ri(e))
@@ -99,11 +104,11 @@ export default class W 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 W 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;
@@ -130,7 +135,7 @@ export default class W extends t {
130
135
  break;
131
136
  }
132
137
  if (null == h) {
133
- const t = tt(e);
138
+ const t = st(e);
134
139
  null != t && i.push(t);
135
140
  } else {
136
141
  if (!h.ri(e))
@@ -147,10 +152,10 @@ export default class W 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 W 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 W 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 && Z(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 W 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
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.fi(u, h.H.Ci), 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.bi(() => {
219
+ n.Ci(() => {
215
220
  this.ar(t, i, !0);
216
221
  })
217
222
  );
218
- const c = o.$({}, !0);
219
- u.lt(s.ct.Qs) !== r.Vs() && this.vi(),
220
- (c.last_full_sync_at = this.ys),
221
- (c.last_card_updated_at = this.Ss);
222
- const f = o.A(c, h.H.Ci, 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.Ci, 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
270
  this.ar(t, i, !1);
257
271
  },
258
- h.H.Ci,
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.Ci,
280
+ h.H.vi,
267
281
  i,
268
282
  );
269
283
  }
@@ -284,29 +298,29 @@ export default class W 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),
288
- new ContentCards(i, X(e))
301
+ this.B && this.B.dt(s.ft.Hs) === this.Ss && void 0 === e && (e = this.Ss),
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
- vi() {
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.vi();
323
+ this.bi();
310
324
  }
311
325
  clearData(t) {
312
326
  (this.ys = 0),
@@ -314,19 +328,19 @@ export default class W 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.wi() || (0 !== this.h.Ft() && this.gi(), !1));
341
+ return !!this.h && (!!this.h.wi() || (0 !== this.h.xt() && this.gi(), !1));
328
342
  }
329
343
  gi() {
330
- this.ws.L(new ContentCards([], new Date())), this.j && this.j.Nt(s.ct.Ps);
344
+ this.ws.L(new ContentCards([], new Date())), this.B && this.B.zt(s.ft.Ps);
331
345
  }
332
346
  }
@@ -1,5 +1,5 @@
1
- import Y from "./content-cards-provider-factory.js";
1
+ import rr from "./content-cards-provider-factory.js";
2
2
  import r from "../managers/braze-instance.js";
3
3
  export function getCachedContentCards() {
4
- if (r.rr()) return Y.o().Ws(!1);
4
+ if (r.rr()) return rr.o().Ws(!1);
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import r from "../managers/braze-instance.js";
2
- import Y from "./content-cards-provider-factory.js";
2
+ import rr from "./content-cards-provider-factory.js";
3
3
  export function requestContentCardsRefresh(e, t) {
4
- if (r.rr()) return Y.o().ar(e, t, !0);
4
+ if (r.rr()) return rr.o().ar(e, t, !0);
5
5
  }
@@ -1,16 +1,16 @@
1
1
  import r from "../managers/braze-instance.js";
2
- import Y from "./content-cards-provider-factory.js";
2
+ import rr from "./content-cards-provider-factory.js";
3
3
  export function subscribeToContentCardsUpdates(o) {
4
4
  if (!r.rr()) return;
5
- const t = Y.o(),
6
- n = t.St(o);
7
- if (!t.jt()) {
5
+ const t = rr.o(),
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
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,6 +1,6 @@
1
- import r, { OPTIONS as q } 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
- import Y from "../content-cards-provider-factory.js";
3
+ import rr from "../content-cards-provider-factory.js";
4
4
  import { setCardHeight as tn } from "../../Card/display/card-display.js";
5
5
  import { logger as E } from "../../../shared-lib/index.js";
6
6
  import {
@@ -18,11 +18,11 @@ 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(q.tn) || !1,
22
- s = Y.o().Ws(!1);
21
+ const o = r.re(D.tn) || !1,
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
- i = Y.o(),
25
+ i = rr.o(),
26
26
  c = i.Bs();
27
27
  (null == s.lastUpdated ||
28
28
  new Date().valueOf() - s.lastUpdated.valueOf() > ContentCards.Cr) &&
@@ -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 z,
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 (!z(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
  );
@@ -1,17 +1,17 @@
1
1
  import r from "../managers/braze-instance.js";
2
- import { getByteLength as rr } from "../util/string-utils.js";
2
+ import { getByteLength as er } from "../util/string-utils.js";
3
3
  import { logger as E } from "../../shared-lib/index.js";
4
4
  import { User } from "../User/index.js";
5
- import { validateStandardString as er } from "../util/validation-utils.js";
5
+ import { validateStandardString as ir } from "../util/validation-utils.js";
6
6
  export function changeUser(e, i) {
7
7
  if (!r.rr()) return;
8
8
  if (null == e || 0 === e.length || e != e)
9
9
  return void E.error("changeUser requires a non-empty userId.");
10
- if (rr(e) > User.mr)
10
+ if (er(e) > User.mr)
11
11
  return void E.error(
12
12
  `Rejected user id "${e}" because it is longer than ${User.mr} bytes.`,
13
13
  );
14
- if (null != i && !er(i, "set signature for new user", "signature")) return;
14
+ if (null != i && !ir(i, "set signature for new user", "signature")) return;
15
15
  const t = r.nn();
16
16
  t && t.changeUser(e.toString(), r.gr(), i);
17
17
  }
@@ -1,15 +1,16 @@
1
- import r from "../managers/braze-instance.js";
2
- import { logger as E, IndexedDBAdapter as it } from "../../shared-lib/index.js";
1
+ import r, { OPTIONS as D } from "../managers/braze-instance.js";
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 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);
10
- const i = it.Us.Rs;
11
- new it(i, E).setItem(i.Fs.le, i.me, !0),
7
+ const n = r.re(D.le),
8
+ a = new ee.me(null, !0, n),
9
+ i = "This-cookie-will-expire-in-" + a.pe();
10
+ a.store(s.be, i);
11
+ const o = et.Us.Rs;
12
+ new et(o, E).setItem(o.Fs.fe, o.ge, !0),
12
13
  E.info("disableSDK was called"),
13
14
  r.destroy(!1),
14
- r.ce(!0);
15
+ r.we(!0);
15
16
  }
@@ -1,11 +1,11 @@
1
1
  import r from "../managers/braze-instance.js";
2
- import { logger as E, IndexedDBAdapter as it } from "../../shared-lib/index.js";
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);
6
- const e = it.Us.Rs;
7
- new it(e, E).be(e.Fs.le, e.me),
5
+ new ee.me(null, !0).remove(s.be);
6
+ const e = et.Us.Rs;
7
+ new et(e, E).je(e.Fs.fe, e.ge),
8
8
  E.info("enableSDK was called"),
9
9
  r.destroy(!1),
10
- r.ce(!1);
10
+ r.we(!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,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).jr(s.ie);
3
+ return !!new ee.me(null, !0).jr(s.be);
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";
4
- import et from "../triggers/models/trigger-events.js";
5
- import { TriggersProviderFactory as ot } from "../triggers/triggers-provider-factory.js";
2
+ import v from "../common/event-logger.js";
3
+ import { logger as E, EventTypes as f } from "../../shared-lib/index.js";
4
+ import ot from "../triggers/models/trigger-events.js";
5
+ import { TriggersProviderFactory as rt } from "../triggers/triggers-provider-factory.js";
6
6
  import {
7
- validateCustomProperties as rt,
8
- validateCustomString as nt,
7
+ validateCustomProperties as nt,
8
+ validateCustomString as mt,
9
9
  } from "../util/validation-utils.js";
10
- import { LOG_CUSTOM_EVENT_STRING as mt } 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)
@@ -17,22 +17,22 @@ export function logCustomEvent(t, e) {
17
17
  ),
18
18
  !1
19
19
  );
20
- if (!nt(t, "log custom event", "the event name")) return !1;
21
- const [o, n] = rt(
20
+ if (!mt(t, "log custom event", "the event name")) return !1;
21
+ const [o, n] = nt(
22
22
  e,
23
- mt,
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) ot.o().ve(et.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
  }