@braze/web-sdk 4.8.3 → 4.9.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 (154) hide show
  1. package/index.d.ts +121 -6
  2. package/package.json +1 -1
  3. package/shared-lib/braze-shared-lib.js +7 -7
  4. package/shared-lib/encoding-utils.js +4 -4
  5. package/shared-lib/event-types.js +22 -21
  6. package/shared-lib/guid.js +7 -7
  7. package/shared-lib/indexed-db-adapter.js +172 -135
  8. package/shared-lib/logger.js +26 -26
  9. package/shared-lib/supported-options.js +15 -15
  10. package/shared-lib/types.js +1 -0
  11. package/src/Card/card-manager-factory.js +1 -1
  12. package/src/Card/card-manager.js +2 -2
  13. package/src/Card/display/card-display.js +5 -4
  14. package/src/Card/models/banner.js +10 -10
  15. package/src/Card/models/captioned-image.js +7 -7
  16. package/src/Card/models/card.js +37 -36
  17. package/src/Card/models/classic-card.js +7 -7
  18. package/src/Card/models/control-card.js +3 -3
  19. package/src/Card/models/image-only.js +32 -0
  20. package/src/Card/models/index.js +1 -0
  21. package/src/Card/util/card-factory.js +16 -16
  22. package/src/ContentCards/content-cards-provider-factory.js +1 -1
  23. package/src/ContentCards/content-cards-provider.js +102 -102
  24. package/src/ContentCards/get-cached-content-cards.js +1 -1
  25. package/src/ContentCards/request-content-cards-refresh.js +1 -1
  26. package/src/ContentCards/subscribe-to-content-cards-updates.js +4 -4
  27. package/src/ContentCards/ui/show-content-cards.js +15 -12
  28. package/src/Core/add-sdk-metadata.js +2 -2
  29. package/src/Core/braze-sdk-metadata.js +1 -1
  30. package/src/Core/change-user.js +1 -1
  31. package/src/Core/device-properties.js +1 -1
  32. package/src/Core/disable-sdk.js +10 -7
  33. package/src/Core/enable-sdk.js +5 -2
  34. package/src/Core/get-device-id.js +3 -3
  35. package/src/Core/get-user.js +1 -1
  36. package/src/Core/handle-braze-action.js +14 -14
  37. package/src/Core/is-disabled.js +1 -1
  38. package/src/Core/log-custom-event.js +4 -4
  39. package/src/Core/log-purchase.js +9 -9
  40. package/src/Core/open-session.js +10 -10
  41. package/src/FeatureFlags/feature-flag-factory.js +5 -3
  42. package/src/FeatureFlags/feature-flag.js +17 -14
  43. package/src/FeatureFlags/feature-flags-provider-factory.js +1 -1
  44. package/src/FeatureFlags/feature-flags-provider.js +56 -43
  45. package/src/FeatureFlags/get-all-feature-flags.js +2 -2
  46. package/src/FeatureFlags/get-feature-flag.js +2 -2
  47. package/src/FeatureFlags/index.js +1 -0
  48. package/src/FeatureFlags/log-feature-flag-impression.js +23 -0
  49. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +1 -1
  50. package/src/Feed/feed-provider-factory.js +1 -1
  51. package/src/Feed/feed-provider.js +20 -20
  52. package/src/Feed/get-cached-feed.js +1 -1
  53. package/src/Feed/log-feed-displayed.js +1 -1
  54. package/src/Feed/request-feed-refresh.js +1 -1
  55. package/src/Feed/subscribe-to-feed-updates.js +1 -1
  56. package/src/Feed/ui/show-feed.js +13 -10
  57. package/src/InAppMessage/defer-in-app-message.js +13 -0
  58. package/src/InAppMessage/display/get-animation-effect.js +1 -1
  59. package/src/InAppMessage/display/html-message-to-html.js +47 -47
  60. package/src/InAppMessage/display/in-app-message-to-html.js +92 -91
  61. package/src/InAppMessage/display/modal-utils.js +16 -16
  62. package/src/InAppMessage/get-deferred-in-app-message.js +5 -0
  63. package/src/InAppMessage/in-app-message-factory.js +77 -57
  64. package/src/InAppMessage/in-app-message-manager-factory.js +6 -6
  65. package/src/InAppMessage/in-app-message-manager.js +121 -82
  66. package/src/InAppMessage/index.js +2 -0
  67. package/src/InAppMessage/log-in-app-message-button-click.js +17 -9
  68. package/src/InAppMessage/log-in-app-message-click.js +4 -4
  69. package/src/InAppMessage/log-in-app-message-html-click.js +6 -6
  70. package/src/InAppMessage/log-in-app-message-impression.js +3 -3
  71. package/src/InAppMessage/models/full-screen-message.js +65 -29
  72. package/src/InAppMessage/models/html-message.js +32 -13
  73. package/src/InAppMessage/models/in-app-message-button.js +7 -7
  74. package/src/InAppMessage/models/in-app-message.js +203 -134
  75. package/src/InAppMessage/models/modal-message.js +64 -29
  76. package/src/InAppMessage/models/slide-up-message.js +52 -24
  77. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  78. package/src/InAppMessage/subscribe-to-in-app-message.js +2 -2
  79. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +6 -6
  80. package/src/InAppMessage/ui/show-in-app-message.js +49 -47
  81. package/src/InAppMessage/utils/in-app-message-utils.js +1 -1
  82. package/src/Push/is-push-blocked.js +2 -2
  83. package/src/Push/is-push-permission-granted.js +2 -2
  84. package/src/Push/is-push-supported.js +2 -2
  85. package/src/Push/push-manager-factory.js +19 -19
  86. package/src/Push/push-manager.js +131 -131
  87. package/src/Push/request-push-permission.js +2 -2
  88. package/src/Push/unregister-push.js +2 -2
  89. package/src/Push/utils/push-utils.js +12 -10
  90. package/src/User/user-manager.js +4 -4
  91. package/src/User/user.js +57 -57
  92. package/src/common/base-feed.js +1 -1
  93. package/src/common/constants.js +1 -0
  94. package/src/common/event-logger.js +6 -6
  95. package/src/common/feed-display.js +34 -34
  96. package/src/common/translations.js +33 -33
  97. package/src/l10n/l10n-manager-factory.js +8 -8
  98. package/src/l10n/l10n-manager.js +6 -2
  99. package/src/l10n/types.js +1 -0
  100. package/src/managers/auth-manager.js +29 -29
  101. package/src/managers/braze-instance.js +125 -125
  102. package/src/managers/device-manager.js +20 -20
  103. package/src/managers/network-manager.js +100 -98
  104. package/src/managers/server-config-manager.js +23 -23
  105. package/src/managers/session-manager.js +5 -5
  106. package/src/managers/storage-manager-factory.js +9 -9
  107. package/src/managers/storage-manager.js +132 -129
  108. package/src/managers/subscription-manager.js +8 -8
  109. package/src/models/backend-errors.js +6 -6
  110. package/src/models/braze-event.js +11 -11
  111. package/src/models/braze-sdk-metadata.js +1 -1
  112. package/src/models/device.js +2 -2
  113. package/src/models/identifier.js +1 -1
  114. package/src/models/push-token.js +5 -5
  115. package/src/models/server-config.js +7 -7
  116. package/src/request-controller.js +191 -178
  117. package/src/triggers/models/custom-event-data.js +4 -4
  118. package/src/triggers/models/custom-event-property-data.js +7 -7
  119. package/src/triggers/models/filter-set.js +5 -5
  120. package/src/triggers/models/filter.js +64 -60
  121. package/src/triggers/models/in-app-message-click-data.js +9 -9
  122. package/src/triggers/models/purchase-data.js +4 -4
  123. package/src/triggers/models/purchase-property-data.js +6 -6
  124. package/src/triggers/models/push-click-data.js +6 -6
  125. package/src/triggers/models/trigger-condition.js +55 -59
  126. package/src/triggers/models/trigger-events.js +3 -3
  127. package/src/triggers/models/trigger.js +47 -35
  128. package/src/triggers/triggers-provider-factory.js +10 -6
  129. package/src/triggers/triggers-provider.js +203 -185
  130. package/src/triggers/types.js +1 -0
  131. package/src/ui/js/attach-css.js +5 -4
  132. package/src/ui/js/feed-css.js +5 -5
  133. package/src/ui/js/iam-css.js +5 -5
  134. package/src/ui/js/load-font-awesome.js +1 -1
  135. package/src/util/base-device-parser.js +1 -1
  136. package/src/util/braze-actions.js +35 -30
  137. package/src/util/browser-detector.js +30 -31
  138. package/src/util/client-hints-parser.js +30 -24
  139. package/src/util/code-utils.js +22 -21
  140. package/src/util/color-utils.js +19 -13
  141. package/src/util/component-utils.js +4 -4
  142. package/src/util/date-utils.js +4 -3
  143. package/src/util/device-constants.js +10 -10
  144. package/src/util/dom-utils.js +32 -28
  145. package/src/util/error-utils.js +1 -1
  146. package/src/util/key-codes.js +1 -1
  147. package/src/util/net.js +53 -57
  148. package/src/util/request-header-utils.js +34 -11
  149. package/src/util/string-utils.js +14 -14
  150. package/src/util/types.js +1 -0
  151. package/src/util/url-utils.js +1 -4
  152. package/src/util/user-agent-parser.js +39 -39
  153. package/src/util/validation-utils.js +32 -32
  154. package/src/util/window-utils.js +11 -12
@@ -6,7 +6,7 @@ import { dateFromUnixTimestamp as l } from "../util/date-utils.js";
6
6
  import { isURIJavascriptOrData as N } from "../util/url-utils.js";
7
7
  import {
8
8
  newCardFromContentCardsJson as j,
9
- newCardFromSerializedValue as R
9
+ newCardFromSerializedValue as R,
10
10
  } from "../Card/util/card-factory.js";
11
11
  import r from "../../shared-lib/braze-shared-lib.js";
12
12
  import { STORAGE_KEYS as i } from "../managers/storage-manager.js";
@@ -35,7 +35,7 @@ export default class v extends y {
35
35
  (this.cards = []),
36
36
  this.Lt();
37
37
  const o = r.zt.Ft;
38
- new r.xt(o, r.j).Mt(o.Jt.qt, t => {
38
+ new r.xt(o, r.j).Mt(o.Jt.qt, (t) => {
39
39
  this.Pt(t);
40
40
  }),
41
41
  (this.$t = null),
@@ -43,33 +43,32 @@ export default class v extends y {
43
43
  (this.Bt = null),
44
44
  (this.Gt = null),
45
45
  (this.Ht = null),
46
- (this.Kt = null),
47
- (this.Ot = 10),
48
- (this.Qt = 0);
46
+ (this.Kt = 10),
47
+ (this.Ot = 0);
49
48
  }
50
- Vt() {
51
- return this._t;
49
+ Qt() {
50
+ return this.$t;
52
51
  }
53
- Wt(t) {
54
- this._t = t;
52
+ Vt(t) {
53
+ this.$t = t;
55
54
  }
56
- Xt() {
57
- return this.Bt;
55
+ Wt() {
56
+ return this._t;
58
57
  }
59
- Yt(t) {
60
- this.Bt = t;
58
+ Xt(t) {
59
+ this._t = t;
61
60
  }
62
61
  Lt() {
63
62
  if (!this.u) return;
64
- const t = this.u.v(i.k.Zt) || [],
63
+ const t = this.u.v(i.k.Yt) || [],
65
64
  s = [];
66
65
  for (let i = 0; i < t.length; i++) {
67
66
  const e = R(t[i]);
68
67
  null != e && s.push(e);
69
68
  }
70
- (this.cards = this.Cs(this.ws(s, !1))),
71
- (this.kt = this.u.v(i.k.vs) || this.kt),
72
- (this.Ut = this.u.v(i.k.ys) || this.Ut);
69
+ (this.cards = this.Zt(this.Cs(s, !1))),
70
+ (this.kt = this.u.v(i.k.ws) || this.kt),
71
+ (this.Ut = this.u.v(i.k.vs) || this.Ut);
73
72
  }
74
73
  Ns(t, s = !1, e = 0, h = 0) {
75
74
  let r;
@@ -100,31 +99,31 @@ export default class v extends y {
100
99
  }
101
100
  }
102
101
  }
103
- (this.cards = this.Cs(this.ws(r, s))),
102
+ (this.cards = this.Zt(this.Cs(r, s))),
104
103
  this.Rs(),
105
104
  (this.kt = e),
106
105
  (this.Ut = h),
107
- this.u && (this.u.D(i.k.vs, this.kt), this.u.D(i.k.ys, this.Ut));
106
+ this.u && (this.u.D(i.k.ws, this.kt), this.u.D(i.k.vs, this.Ut));
108
107
  }
109
108
  Ts(t) {
110
109
  if (this.Ds() && null != t && t.cards) {
111
- this.u && this.u.D(i.k.Ss, e.Us());
110
+ this.u && this.u.D(i.k.Ss, e.ks());
112
111
  const s = t.full_sync;
113
112
  s || this.Lt(),
114
113
  this.Ns(t.cards, s, t.last_full_sync_at, t.last_card_updated_at),
115
- this.yt.Et(this.As(!0));
114
+ this.yt.Et(this.Us(!0));
116
115
  }
117
116
  }
118
- Ls(t) {
119
- this.u && this.u.D(i.k.Fs, t);
117
+ As(t) {
118
+ this.u && this.u.D(i.k.Ls, t);
120
119
  }
121
- Ms(t, e, h) {
120
+ Fs(t, e, h) {
122
121
  const n = () => {
123
- this.Es(e, h, !0);
122
+ this.Ms(e, h, !0);
124
123
  },
125
- o = b(t);
124
+ o = t ? b(t) : null;
126
125
  let l;
127
- if ((this.qs(), !o["retry-after"])) return void this.Ls(0);
126
+ if ((this.Es(), !o || !o["retry-after"])) return void this.As(0);
128
127
  const a = o["retry-after"];
129
128
  if (isNaN(a) && !isNaN(Date.parse(a)))
130
129
  (l = Date.parse(a) - new Date().getTime()), l < 0 && n();
@@ -132,17 +131,17 @@ export default class v extends y {
132
131
  if (isNaN(parseFloat(a.toString()))) {
133
132
  const t =
134
133
  "Received unexpected value for retry-after header in /sync response";
135
- return s.N(r.q.Is, { e: t + ": " + a }), void this.Ls(0);
134
+ return s.N(r.q.qs, { e: t + ": " + a }), void this.As(0);
136
135
  }
137
136
  l = 1e3 * parseFloat(a.toString());
138
137
  }
139
- this.Gt = window.setTimeout(() => {
138
+ this.Bt = window.setTimeout(() => {
140
139
  n();
141
140
  }, l);
142
141
  let u = 0;
143
- this.u && (u = this.u.v(i.k.Fs)),
142
+ this.u && (u = this.u.v(i.k.Ls)),
144
143
  (null == u || isNaN(parseInt(u.toString()))) && (u = 0),
145
- this.Ls(parseInt(u.toString()) + 1);
144
+ this.As(parseInt(u.toString()) + 1);
146
145
  }
147
146
  Pt(t) {
148
147
  if (!this.Ds()) return;
@@ -171,9 +170,9 @@ export default class v extends y {
171
170
  }
172
171
  }
173
172
  }
174
- (this.cards = this.Cs(this.ws(s, !1))), this.Rs(), this.yt.Et(this.As(!0));
173
+ (this.cards = this.Zt(this.Cs(s, !1))), this.Rs(), this.yt.Et(this.Us(!0));
175
174
  }
176
- ws(t, s) {
175
+ Cs(t, s) {
177
176
  let e = {},
178
177
  h = {},
179
178
  r = {};
@@ -198,7 +197,7 @@ export default class v extends y {
198
197
  t
199
198
  );
200
199
  }
201
- Cs(t) {
200
+ Zt(t) {
202
201
  const s = [],
203
202
  e = new Date();
204
203
  let h = {};
@@ -208,7 +207,7 @@ export default class v extends y {
208
207
  const o = t[i].url;
209
208
  if (!this.vt && o && N(o)) {
210
209
  r.j.error(
211
- `Card with url ${o} will not be displayed because Javascript URLs are disabled. Use the "allowUserSuppliedJavascript" option for braze.initialize to enable this card.`
210
+ `Card with url ${o} will not be displayed because Javascript URLs are disabled. Use the "allowUserSuppliedJavascript" option for braze.initialize to enable this card.`,
212
211
  );
213
212
  continue;
214
213
  }
@@ -227,87 +226,88 @@ export default class v extends y {
227
226
  if (!this.u) return;
228
227
  const t = [];
229
228
  for (let s = 0; s < this.cards.length; s++) t.push(this.cards[s].ss());
230
- this.u.D(i.k.Zt, t);
229
+ this.u.D(i.k.Yt, t);
231
230
  }
232
- qs() {
233
- this.Gt && (clearTimeout(this.Gt), (this.Gt = null));
231
+ Es() {
232
+ this.Bt && (clearTimeout(this.Bt), (this.Bt = null));
234
233
  }
235
- Js() {
236
- null != this.Ht && (clearTimeout(this.Ht), (this.Ht = null));
234
+ Is() {
235
+ null != this.Gt && (clearTimeout(this.Gt), (this.Gt = null));
237
236
  }
238
- Ps(t = 1e3 * this.Ot, s, i) {
239
- this.Js(),
240
- (this.Ht = window.setTimeout(() => {
241
- this.Es(s, i, !0);
237
+ Js(t = 1e3 * this.Kt, s, i) {
238
+ this.Is(),
239
+ (this.Gt = window.setTimeout(() => {
240
+ this.Ms(s, i, !0);
242
241
  }, t)),
243
- (this.Kt = t);
242
+ (this.Ht = t);
244
243
  }
245
- Es(t, s, h = !1, n = !0) {
244
+ Ms(t, s, h = !1, n = !0) {
246
245
  var o;
247
246
  const l = this.gt,
248
247
  a = this.u;
249
248
  if (!l || !a) return void ("function" == typeof s && s());
250
249
  const u = !h;
251
- if ((u && (this.qs(), this.Ls(0)), !this.Ds()))
250
+ if ((u && (this.Es(), this.As(0)), !this.Ds()))
252
251
  return void (
253
- !this.$t &&
254
252
  this.wt &&
255
- (this.$t = this.wt.$s(() => {
256
- this.Es(t, s);
257
- }))
253
+ this.wt.Ps(() => {
254
+ this.Ms(t, s);
255
+ })
258
256
  );
259
257
  let c = !0;
260
258
  if (
261
259
  (u &&
262
- (null === (o = this.wt) || void 0 === o ? void 0 : o._s()) &&
263
- (c = this.Bs()),
260
+ (null === (o = this.wt) || void 0 === o ? void 0 : o.$s()) &&
261
+ (c = this._s()),
264
262
  !c)
265
263
  )
266
264
  return void r.j.info("Content card sync being throttled.");
267
- n && this.Js();
268
- const f = l.Gs({}, !0);
269
- a.v(i.k.Ss) !== e.Us() && this.Hs(),
265
+ n && this.Is();
266
+ const f = l.Bs({}, !0);
267
+ a.v(i.k.Ss) !== e.ks() && this.Gs(),
270
268
  (f.last_full_sync_at = this.kt),
271
269
  (f.last_card_updated_at = this.Ut);
272
- const d = l.Ks(f, T.Qs.Os, h);
270
+ const d = l.Hs(f, T.Os.Ks, h);
273
271
  let m = !1;
274
- l.Vs(f, () => {
272
+ l.Qs(f, () => {
275
273
  if (this.u) {
276
274
  const t = new Date().valueOf();
277
- u && this.u.D(i.k.Ws, t), T.Xs(this.u, T.Qs.Os, t);
275
+ u && this.u.D(i.k.Vs, t), T.Ws(this.u, T.Os.Ks, t);
278
276
  }
279
- C.Ys({
280
- url: l.Zs() + "/content_cards/sync",
277
+ C.Xs({
278
+ url: l.Ys() + "/content_cards/sync",
281
279
  data: f,
282
280
  headers: d,
283
281
  O: (i, e) => {
284
- if (!l.ti(f, i, d))
282
+ if (!l.Zs(f, i, d))
285
283
  return (m = !0), void ("function" == typeof s && s());
286
- l.si(),
287
- this.Ms(e, t, s),
284
+ l.ti(),
285
+ this.Fs(e, t, s),
288
286
  this.Ts(i),
289
287
  (m = !1),
288
+ T.si(this.u, T.Os.Ks, 1),
290
289
  "function" == typeof t && t();
291
290
  },
292
- error: t => {
291
+ error: (t) => {
293
292
  l.ii(t, "retrieving content cards"),
294
293
  (m = !0),
295
294
  "function" == typeof s && s();
296
295
  },
297
296
  ei: () => {
298
- if (m && n && !this.Ht && this.Qt + 1 < S) {
299
- let i = this.Kt;
300
- (null == i || i < 1e3 * this.Ot) && (i = 1e3 * this.Ot),
301
- this.Ps(Math.min(3e5, D(1e3 * this.Ot, 3 * i)), t, s),
302
- (this.Qt = this.Qt + 1);
297
+ if (m && n && !this.Gt && this.Ot + 1 < S) {
298
+ T.hi(this.u, T.Os.Ks);
299
+ let i = this.Ht;
300
+ (null == i || i < 1e3 * this.Kt) && (i = 1e3 * this.Kt),
301
+ this.Js(Math.min(3e5, D(1e3 * this.Kt, 3 * i)), t, s),
302
+ (this.Ot = this.Ot + 1);
303
303
  }
304
- }
304
+ },
305
305
  });
306
306
  });
307
307
  }
308
- As(t) {
308
+ Us(t) {
309
309
  t || this.Lt();
310
- const s = this.Cs(this.cards);
310
+ const s = this.Zt(this.cards);
311
311
  s.sort((t, s) =>
312
312
  t.pinned && !s.pinned
313
313
  ? -1
@@ -317,33 +317,33 @@ export default class v extends y {
317
317
  ? -1
318
318
  : t.updated && s.updated && s.updated > t.updated
319
319
  ? 1
320
- : 0
320
+ : 0,
321
321
  );
322
322
  let e = Math.max(this.Ut || 0, this.kt || 0);
323
323
  return (
324
324
  0 === e && (e = void 0),
325
- this.u && this.u.v(i.k.ys) === this.Ut && void 0 === e && (e = this.Ut),
325
+ this.u && this.u.v(i.k.vs) === this.Ut && void 0 === e && (e = this.Ut),
326
326
  new ContentCards(s, l(e))
327
327
  );
328
328
  }
329
- hi(t) {
329
+ ri(t) {
330
330
  return this.yt.lt(t);
331
331
  }
332
- Hs() {
332
+ Gs() {
333
333
  (this.kt = 0),
334
334
  (this.Ut = 0),
335
- this.u && (this.u.ri(i.k.vs), this.u.ri(i.k.ys));
335
+ this.u && (this.u.ni(i.k.ws), this.u.ni(i.k.vs));
336
336
  }
337
337
  changeUser(t) {
338
338
  t ||
339
339
  ((this.cards = []),
340
340
  this.yt.Et(new ContentCards(this.cards.slice(), null)),
341
341
  this.u &&
342
- (this.u.ri(i.k.Zt),
343
- this.u.ri(i.k.C),
344
- this.u.ri(i.k.K),
345
- this.u.ri(i.k.G))),
346
- this.Hs();
342
+ (this.u.ni(i.k.Yt),
343
+ this.u.ni(i.k.C),
344
+ this.u.ni(i.k.K),
345
+ this.u.ni(i.k.G))),
346
+ this.Gs();
347
347
  }
348
348
  clearData(t) {
349
349
  (this.kt = 0),
@@ -352,40 +352,40 @@ export default class v extends y {
352
352
  this.yt.Et(new ContentCards(this.cards.slice(), null)),
353
353
  t &&
354
354
  this.u &&
355
- (this.u.ri(i.k.Zt),
356
- this.u.ri(i.k.C),
357
- this.u.ri(i.k.K),
358
- this.u.ri(i.k.G),
359
- this.u.ri(i.k.vs),
360
- this.u.ri(i.k.ys));
355
+ (this.u.ni(i.k.Yt),
356
+ this.u.ni(i.k.C),
357
+ this.u.ni(i.k.K),
358
+ this.u.ni(i.k.G),
359
+ this.u.ni(i.k.ws),
360
+ this.u.ni(i.k.vs));
361
361
  }
362
362
  Ds() {
363
- return !(this.wt && !this.wt.ni()) || (0 !== this.wt.oi() && this.li(), !1);
363
+ return !(this.wt && !this.wt.oi()) || (0 !== this.wt.li() && this.ai(), !1);
364
364
  }
365
- ai(t) {
366
- this.u && this.u.D(i.k.ui, t);
365
+ ui(t) {
366
+ this.u && this.u.D(i.k.ci, t);
367
367
  }
368
- ci() {
369
- return this.u ? this.u.v(i.k.ui) : null;
368
+ fi() {
369
+ return this.u ? this.u.v(i.k.ci) : null;
370
370
  }
371
- Bs() {
371
+ _s() {
372
372
  const t = this.u,
373
373
  s = this.wt;
374
374
  if (!t || !s) return !0;
375
- const e = t.v(i.k.Ws);
375
+ const e = t.v(i.k.Vs);
376
376
  if (null == e || isNaN(e)) return !0;
377
- const h = s.fi(),
378
- r = s.di();
377
+ const h = s.di(),
378
+ r = s.mi();
379
379
  if (-1 === h || -1 === r) return !0;
380
- let n = this.ci();
380
+ let n = this.fi();
381
381
  (null == n || isNaN(n)) && (n = h);
382
382
  const o = (new Date().valueOf() - e) / 1e3;
383
383
  return (
384
384
  (n = Math.min(n + o / r, h)),
385
- !(n < 1) && ((n = Math.trunc(n) - 1), this.ai(n), !0)
385
+ !(n < 1) && ((n = Math.trunc(n) - 1), this.ui(n), !0)
386
386
  );
387
387
  }
388
- li() {
389
- this.yt.Et(new ContentCards([], new Date())), this.u && this.u.ri(i.k.Zt);
388
+ ai() {
389
+ this.yt.Et(new ContentCards([], new Date())), this.u && this.u.ni(i.k.Yt);
390
390
  }
391
391
  }
@@ -1,5 +1,5 @@
1
1
  import g from "./content-cards-provider-factory.js";
2
2
  import e from "../managers/braze-instance.js";
3
3
  export function getCachedContentCards() {
4
- if (e.rr()) return g.er().As(!1);
4
+ if (e.rr()) return g.er().Us(!1);
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import e from "../managers/braze-instance.js";
2
2
  import g from "./content-cards-provider-factory.js";
3
3
  export function requestContentCardsRefresh(r, t) {
4
- if (e.rr()) return g.er().Es(r, t);
4
+ if (e.rr()) return g.er().Ms(r, t);
5
5
  }
@@ -3,14 +3,14 @@ import g from "./content-cards-provider-factory.js";
3
3
  export function subscribeToContentCardsUpdates(r) {
4
4
  if (!e.rr()) return;
5
5
  const t = g.er(),
6
- n = t.hi(r);
7
- if (!t.Xt()) {
6
+ n = t.ri(r);
7
+ if (!t.Wt()) {
8
8
  const r = e.cr();
9
9
  if (r) {
10
10
  const n = r.pr(() => {
11
- t.Es();
11
+ t.Ms();
12
12
  });
13
- n && t.Yt(n);
13
+ n && t.Xt(n);
14
14
  }
15
15
  }
16
16
  return n;
@@ -8,7 +8,7 @@ import {
8
8
  LAST_REQUESTED_REFRESH_DATA_ATTRIBUTE as M,
9
9
  refreshFeed as $,
10
10
  registerFeedSubscriptionId as A,
11
- updateFeedCards as B
11
+ updateFeedCards as B,
12
12
  } from "../../common/feed-display.js";
13
13
  import { setCardHeight as F } from "../../Card/display/card-display.js";
14
14
  import { setupFeedUI as G } from "../../ui/js/index.js";
@@ -19,44 +19,47 @@ export function showContentCards(n, t) {
19
19
  let o = !1;
20
20
  null == n && ((n = document.body), (o = !0));
21
21
  const a = e.nn(L.tn) || e.nn(L.en) || !1,
22
- i = g.er().As(!1);
22
+ i = g.er().Us(!1);
23
23
  "function" == typeof t && B(i, t(i.cards.slice()), i.lastUpdated, null, a);
24
24
  const s = I(i, a, o),
25
25
  l = g.er(),
26
- f = l.Vt();
26
+ f = l.Qt();
27
27
  (null == i.lastUpdated ||
28
28
  new Date().valueOf() - i.lastUpdated.valueOf() > ContentCards.mr) &&
29
29
  (null == f || new Date().valueOf() - f > ContentCards.mr) &&
30
30
  (r.j.info(
31
- `Cached content cards were older than max TTL of ${ContentCards.mr} ms, requesting an update from the server.`
31
+ `Cached content cards were older than max TTL of ${ContentCards.mr} ms, requesting an update from the server.`,
32
32
  ),
33
33
  $(i, s),
34
- l.Wt(new Date().valueOf()));
34
+ l.Vt(new Date().valueOf()));
35
35
  const c = new Date().valueOf(),
36
- u = subscribeToContentCardsUpdates(function(n) {
36
+ u = subscribeToContentCardsUpdates(function (n) {
37
37
  const e = s.querySelectorAll(".ab-refresh-button")[0];
38
38
  if (null != e) {
39
39
  let n = 500,
40
40
  t = (n -= new Date().valueOf() - c);
41
41
  const o = s.getAttribute(M);
42
42
  o && ((t = parseInt(o)), isNaN(t) || (n -= new Date().valueOf() - t)),
43
- setTimeout(function() {
44
- e.className = e.className.replace(/fa-spin/g, "");
45
- }, Math.max(n, 0));
43
+ setTimeout(
44
+ function () {
45
+ e.className = e.className.replace(/fa-spin/g, "");
46
+ },
47
+ Math.max(n, 0),
48
+ );
46
49
  }
47
50
  let o = n.cards;
48
51
  "function" == typeof t && (o = t(o.slice())),
49
52
  B(i, o, n.lastUpdated, s, a);
50
53
  });
51
54
  A(u, s);
52
- const d = function(n) {
55
+ const d = function (n) {
53
56
  const t = n.querySelectorAll(".ab-feed");
54
57
  let e = null;
55
58
  for (let o = 0; o < t.length; o++) t[o].parentNode === n && (e = t[o]);
56
59
  null != e
57
60
  ? (k(e), null != e.parentNode && e.parentNode.replaceChild(s, e))
58
61
  : n.appendChild(s),
59
- setTimeout(function() {
62
+ setTimeout(function () {
60
63
  s.className = s.className.replace("ab-hide", "ab-show");
61
64
  }, 0),
62
65
  o && s.focus(),
@@ -68,7 +71,7 @@ export function showContentCards(n, t) {
68
71
  ? d(n)
69
72
  : (window.onload =
70
73
  ((m = window.onload),
71
- function() {
74
+ function () {
72
75
  "function" == typeof m && m(new Event("oldLoad")), d(document.body);
73
76
  }));
74
77
  }
@@ -2,7 +2,7 @@ import K from "../managers/braze-instance.js";
2
2
  import BrazeSdkMetadata from "./braze-sdk-metadata.js";
3
3
  import {
4
4
  isArray as p,
5
- validateValueIsFromEnum as H
5
+ validateValueIsFromEnum as H,
6
6
  } from "../util/code-utils.js";
7
7
  import r from "../../shared-lib/braze-shared-lib.js";
8
8
  export function addSdkMetadata(a) {
@@ -17,7 +17,7 @@ export function addSdkMetadata(a) {
17
17
  BrazeSdkMetadata,
18
18
  t,
19
19
  "sdkMetadata contained an invalid value.",
20
- "BrazeSdkMetadata"
20
+ "BrazeSdkMetadata",
21
21
  )
22
22
  )
23
23
  return !1;
@@ -6,5 +6,5 @@ export default {
6
6
  MANUAL: "manu",
7
7
  NPM: "npm",
8
8
  CDN: "wcd",
9
- SHOPIFY: "shp"
9
+ SHOPIFY: "shp",
10
10
  };
@@ -9,7 +9,7 @@ export function changeUser(i, t) {
9
9
  return void r.j.error("changeUser requires a non-empty userId.");
10
10
  if (U(i) > User.lr)
11
11
  return void r.j.error(
12
- `Rejected user id "${i}" because it is longer than ${User.lr} bytes.`
12
+ `Rejected user id "${i}" because it is longer than ${User.lr} bytes.`,
13
13
  );
14
14
  if (null != t && !J(t, "set signature for new user", "signature")) return;
15
15
  const s = e.cr();
@@ -5,5 +5,5 @@ export default {
5
5
  RESOLUTION: "resolution",
6
6
  LANGUAGE: "language",
7
7
  TIME_ZONE: "timeZone",
8
- USER_AGENT: "userAgent"
8
+ USER_AGENT: "userAgent",
9
9
  };
@@ -2,11 +2,14 @@ import e from "../managers/braze-instance.js";
2
2
  import r from "../../shared-lib/braze-shared-lib.js";
3
3
  import O, { STORAGE_KEYS as i } from "../managers/storage-manager.js";
4
4
  export function disableSDK() {
5
- const n = e.cr();
6
- n && n.requestImmediateDataFlush();
7
- const o = new O.ee(null, !0),
8
- s = "This-cookie-will-expire-in-" + o.re();
9
- o.store(i.ne, s);
10
- const a = r.zt.Ft;
11
- new r.xt(a, r.j).setItem(a.Jt.oe, a.se, !0), e.destroy(!1), e.ae(!0);
5
+ const a = e.cr();
6
+ a && a.requestImmediateDataFlush();
7
+ const s = new O.ee(null, !0),
8
+ n = "This-cookie-will-expire-in-" + s.ae();
9
+ s.store(i.re, n);
10
+ const o = r.zt.Ft;
11
+ new r.xt(o, r.j).setItem(o.Jt.se, o.ie, !0),
12
+ r.j.info("disableSDK was called"),
13
+ e.destroy(!1),
14
+ e.ne(!0);
12
15
  }
@@ -2,7 +2,10 @@ import e from "../managers/braze-instance.js";
2
2
  import r from "../../shared-lib/braze-shared-lib.js";
3
3
  import O, { STORAGE_KEYS as i } from "../managers/storage-manager.js";
4
4
  export function enableSDK() {
5
- new O.ee(null, !0).remove(i.ne);
5
+ new O.ee(null, !0).remove(i.re);
6
6
  const a = r.zt.Ft;
7
- new r.xt(a, r.j).br(a.Jt.oe, a.se), e.destroy(!1), e.ae(!1);
7
+ new r.xt(a, r.j).oe(a.Jt.se, a.ie),
8
+ r.j.info("enableSDK was called"),
9
+ e.destroy(!1),
10
+ e.ne(!1);
8
11
  }
@@ -4,8 +4,8 @@ export function getDeviceId(i) {
4
4
  if (!e.rr()) return;
5
5
  null == i &&
6
6
  r.j.error(
7
- "getDeviceId must be supplied with a callback. e.g., braze.getDeviceId(function(deviceId) {console.log('the device id is ' + deviceId)})"
7
+ "getDeviceId must be supplied with a callback. e.g., braze.getDeviceId(function(deviceId) {console.log('the device id is ' + deviceId)})",
8
8
  );
9
- const t = e.ie();
10
- "function" == typeof i && t && i(t.te().id);
9
+ const t = e.te();
10
+ "function" == typeof i && t && i(t.ce().id);
11
11
  }
@@ -1,4 +1,4 @@
1
1
  import e from "../managers/braze-instance.js";
2
2
  export function getUser() {
3
- if (e.rr()) return e.jr();
3
+ if (e.rr()) return e.br();
4
4
  }