@braze/web-sdk 5.8.0 → 5.8.1

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 (133) hide show
  1. package/index.d.ts +1 -1
  2. package/package.json +1 -1
  3. package/shared-lib/encoding-utils.js +1 -1
  4. package/shared-lib/event-types.js +22 -22
  5. package/shared-lib/guid.js +1 -1
  6. package/shared-lib/indexed-db-adapter.js +18 -18
  7. package/shared-lib/logger.js +2 -2
  8. package/shared-lib/supported-options.js +16 -16
  9. package/src/Banner/banner-provider.js +79 -79
  10. package/src/Banner/banner.js +9 -9
  11. package/src/Banner/display/banner-to-html.js +2 -2
  12. package/src/Banner/get-all-banners.js +2 -2
  13. package/src/Banner/get-banner.js +2 -2
  14. package/src/Banner/log-banner-click.js +2 -2
  15. package/src/Banner/log-banner-impressions.js +4 -4
  16. package/src/Banner/request-banners-refresh.js +1 -1
  17. package/src/Banner/subscribe-to-banners-updates.js +5 -5
  18. package/src/Card/card-manager.js +35 -35
  19. package/src/Card/display/card-display.js +8 -8
  20. package/src/Card/log-card-click.js +1 -1
  21. package/src/Card/log-card-dismissal.js +1 -1
  22. package/src/Card/log-card-impressions.js +1 -1
  23. package/src/Card/models/captioned-image.js +21 -21
  24. package/src/Card/models/card.js +92 -92
  25. package/src/Card/models/classic-card.js +21 -21
  26. package/src/Card/models/control-card.js +11 -11
  27. package/src/Card/models/image-only.js +19 -19
  28. package/src/Card/util/card-factory.js +39 -39
  29. package/src/ContentCards/content-cards-provider.js +142 -142
  30. package/src/ContentCards/get-cached-content-cards.js +1 -1
  31. package/src/ContentCards/request-content-cards-refresh.js +1 -1
  32. package/src/ContentCards/subscribe-to-content-cards-updates.js +4 -4
  33. package/src/ContentCards/ui/show-content-cards.js +3 -3
  34. package/src/Core/disable-sdk.js +6 -6
  35. package/src/Core/enable-sdk.js +5 -5
  36. package/src/Core/get-device-id.js +2 -2
  37. package/src/Core/handle-braze-action.js +2 -2
  38. package/src/Core/is-disabled.js +2 -2
  39. package/src/Core/is-initialized.js +1 -1
  40. package/src/Core/log-custom-event.js +5 -5
  41. package/src/Core/log-purchase.js +4 -4
  42. package/src/Core/open-session.js +5 -5
  43. package/src/Core/wipe-data.js +2 -2
  44. package/src/FeatureFlags/feature-flag-factory.js +10 -10
  45. package/src/FeatureFlags/feature-flag.js +15 -15
  46. package/src/FeatureFlags/feature-flags-provider.js +61 -61
  47. package/src/FeatureFlags/get-all-feature-flags.js +2 -2
  48. package/src/FeatureFlags/get-feature-flag.js +2 -2
  49. package/src/FeatureFlags/log-feature-flag-impression.js +4 -4
  50. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +2 -2
  51. package/src/Feed/feed-provider.js +41 -41
  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 +1 -1
  57. package/src/InAppMessage/defer-in-app-message.js +1 -1
  58. package/src/InAppMessage/display/html-message-to-html.js +6 -6
  59. package/src/InAppMessage/display/in-app-message-to-html.js +20 -20
  60. package/src/InAppMessage/display/modal-utils.js +4 -4
  61. package/src/InAppMessage/in-app-message-factory.js +7 -7
  62. package/src/InAppMessage/in-app-message-manager.js +89 -89
  63. package/src/InAppMessage/log-in-app-message-button-click.js +6 -6
  64. package/src/InAppMessage/log-in-app-message-click.js +5 -5
  65. package/src/InAppMessage/log-in-app-message-html-click.js +7 -7
  66. package/src/InAppMessage/log-in-app-message-impression.js +2 -2
  67. package/src/InAppMessage/models/control-message.js +5 -5
  68. package/src/InAppMessage/models/full-screen-message.js +34 -34
  69. package/src/InAppMessage/models/html-message.js +20 -20
  70. package/src/InAppMessage/models/in-app-message-button.js +8 -8
  71. package/src/InAppMessage/models/in-app-message.js +80 -80
  72. package/src/InAppMessage/models/modal-message.js +33 -33
  73. package/src/InAppMessage/models/slide-up-message.js +29 -29
  74. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  75. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  76. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
  77. package/src/InAppMessage/ui/show-in-app-message.js +12 -12
  78. package/src/Push/push-manager-factory.js +1 -1
  79. package/src/Push/push-manager.js +94 -94
  80. package/src/Push/utils/push-utils.js +4 -4
  81. package/src/User/user-manager.js +17 -17
  82. package/src/User/user.js +38 -38
  83. package/src/common/base-feed.js +1 -1
  84. package/src/common/base-provider.js +1 -1
  85. package/src/common/event-logger.js +5 -5
  86. package/src/common/feed-display.js +6 -6
  87. package/src/l10n/l10n-manager-factory.js +1 -1
  88. package/src/l10n/l10n-manager.js +1 -1
  89. package/src/managers/auth-manager.js +31 -31
  90. package/src/managers/braze-instance.js +125 -125
  91. package/src/managers/device-manager.js +24 -24
  92. package/src/managers/network-manager.js +149 -149
  93. package/src/managers/server-config-manager.js +84 -84
  94. package/src/managers/session-manager.js +27 -27
  95. package/src/managers/storage-manager-factory.js +12 -12
  96. package/src/managers/storage-manager.js +83 -83
  97. package/src/managers/subscription-manager.js +10 -10
  98. package/src/managers/utils.js +4 -4
  99. package/src/models/backend-errors.js +5 -5
  100. package/src/models/braze-event.js +4 -4
  101. package/src/models/device.js +2 -2
  102. package/src/models/identifier.js +3 -3
  103. package/src/models/push-token.js +8 -8
  104. package/src/models/request-result.js +3 -3
  105. package/src/models/server-config.js +31 -31
  106. package/src/request-controller.js +148 -148
  107. package/src/triggers/models/custom-event-data.js +1 -1
  108. package/src/triggers/models/custom-event-property-data.js +2 -2
  109. package/src/triggers/models/filter-set.js +4 -4
  110. package/src/triggers/models/filter.js +2 -2
  111. package/src/triggers/models/in-app-message-click-data.js +1 -1
  112. package/src/triggers/models/purchase-data.js +1 -1
  113. package/src/triggers/models/purchase-property-data.js +2 -2
  114. package/src/triggers/models/push-click-data.js +1 -1
  115. package/src/triggers/models/trigger-condition.js +32 -32
  116. package/src/triggers/models/trigger-events.js +2 -2
  117. package/src/triggers/models/trigger.js +11 -11
  118. package/src/triggers/triggers-provider-factory.js +2 -2
  119. package/src/triggers/triggers-provider.js +72 -72
  120. package/src/ui/js/attach-css.js +1 -1
  121. package/src/ui/js/load-font-awesome.js +1 -1
  122. package/src/util/base-device-parser.js +1 -1
  123. package/src/util/braze-actions.js +4 -4
  124. package/src/util/browser-detector.js +5 -5
  125. package/src/util/client-hints-parser.js +1 -1
  126. package/src/util/component-utils.js +1 -1
  127. package/src/util/dom-utils.js +4 -4
  128. package/src/util/html-display-utils.js +6 -6
  129. package/src/util/key-codes.js +1 -1
  130. package/src/util/net.js +6 -6
  131. package/src/util/request-header-utils.js +21 -21
  132. package/src/util/user-agent-parser.js +1 -1
  133. package/src/util/window-utils.js +1 -1
@@ -12,31 +12,31 @@ import {
12
12
  import { logger as N } from "../../../shared-lib/index.js";
13
13
  export function newCard(n, e, r, t, o, i, l, u, d, a, w, f, s, m, C, p, c, x) {
14
14
  let F;
15
- if (e === Card.Dt.ui || e === Card.Dt.Ei)
15
+ if (e === Card.ds.Ti || e === Card.ds.Ii)
16
16
  F = new ClassicCard(n, r, t, o, i, l, u, d, a, w, f, s, m, C, p, c);
17
- else if (e === Card.Dt.Bt)
17
+ else if (e === Card.ds.cs)
18
18
  F = new CaptionedImage(n, r, t, o, i, l, u, d, a, w, f, s, m, C, p, c);
19
- else if (e === Card.Dt.oi)
19
+ else if (e === Card.ds.ai)
20
20
  F = new ImageOnly(n, r, o, l, u, d, a, w, f, s, m, C, p, c);
21
21
  else {
22
- if (e !== Card.Dt.Ti)
22
+ if (e !== Card.ds.ci)
23
23
  return N.error("Ignoring card with unknown type " + e), null;
24
24
  F = new ControlCard(n, r, u, a, m, C);
25
25
  }
26
26
  return x && (F.test = x), F;
27
27
  }
28
28
  export function newCardFromContentCardsJson(n) {
29
- if (n[Card.li.ei]) return null;
30
- const e = n[Card.li.Et],
31
- r = n[Card.li.zt],
32
- t = n[Card.li.Ft],
33
- o = n[Card.li.Gt],
34
- i = n[Card.li.Jt],
35
- l = n[Card.li.Kt],
36
- u = O(n[Card.li.Lt]),
29
+ if (n[Card.ui.Ei]) return null;
30
+ const e = n[Card.ui.ps],
31
+ r = n[Card.ui.hs],
32
+ t = n[Card.ui.us],
33
+ o = n[Card.ui.ls],
34
+ i = n[Card.ui.fs],
35
+ l = n[Card.ui.xs],
36
+ u = O(n[Card.ui.bs]),
37
37
  d = u;
38
38
  let a;
39
- a = n[Card.li.Ot] === Card.ri ? null : O(n[Card.li.Ot]);
39
+ a = n[Card.ui.zs] === Card.oi ? null : O(n[Card.ui.zs]);
40
40
  return newCard(
41
41
  e,
42
42
  r,
@@ -48,14 +48,14 @@ export function newCardFromContentCardsJson(n) {
48
48
  u,
49
49
  null,
50
50
  a,
51
- n[Card.li.URL],
52
- n[Card.li.Pt],
53
- n[Card.li.Qt],
54
- n[Card.li.St],
55
- n[Card.li.Ut],
56
- n[Card.li.Vt],
57
- n[Card.li.Wt],
58
- n[Card.li.Xt] || !1,
51
+ n[Card.ui.URL],
52
+ n[Card.ui.ks],
53
+ n[Card.ui.qs],
54
+ n[Card.ui.vs],
55
+ n[Card.ui.ws],
56
+ n[Card.ui.ys],
57
+ n[Card.ui.As],
58
+ n[Card.ui.Bs] || !1,
59
59
  );
60
60
  }
61
61
  export function newCardFromFeedJson(n) {
@@ -81,24 +81,24 @@ export function newCardFromFeedJson(n) {
81
81
  export function newCardFromSerializedValue(n) {
82
82
  return (
83
83
  newCard(
84
- n[Card.qt.Et],
85
- n[Card.qt.zt],
86
- n[Card.qt.Ft],
87
- n[Card.qt.Gt],
88
- n[Card.qt.Jt],
89
- n[Card.qt.Kt],
90
- V(n[Card.qt.Mt]),
91
- V(n[Card.qt.Lt]),
92
- n[Card.qt.Nt],
93
- V(n[Card.qt.Ot]),
94
- n[Card.qt.URL],
95
- n[Card.qt.Pt],
96
- n[Card.qt.Qt],
97
- n[Card.qt.St],
98
- n[Card.qt.Ut],
99
- n[Card.qt.Vt],
100
- n[Card.qt.Wt],
101
- n[Card.qt.Xt] || !1,
84
+ n[Card.es.ps],
85
+ n[Card.es.hs],
86
+ n[Card.es.us],
87
+ n[Card.es.ls],
88
+ n[Card.es.fs],
89
+ n[Card.es.xs],
90
+ V(n[Card.es.gs]),
91
+ V(n[Card.es.bs]),
92
+ n[Card.es.js],
93
+ V(n[Card.es.zs]),
94
+ n[Card.es.URL],
95
+ n[Card.es.ks],
96
+ n[Card.es.qs],
97
+ n[Card.es.vs],
98
+ n[Card.es.ws],
99
+ n[Card.es.ys],
100
+ n[Card.es.As],
101
+ n[Card.es.Bs] || !1,
102
102
  ) || void 0
103
103
  );
104
104
  }
@@ -1,5 +1,5 @@
1
1
  import l from "../util/net.js";
2
- import s from "../common/base-provider.js";
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
5
  import { dateFromUnixTimestamp as O } from "../util/date-utils.js";
@@ -8,72 +8,72 @@ import {
8
8
  newCardFromContentCardsJson as Y,
9
9
  newCardFromSerializedValue as Z,
10
10
  } from "../Card/util/card-factory.js";
11
- import { STORAGE_KEYS as t } from "../managers/storage-manager.js";
11
+ import { STORAGE_KEYS as s } from "../managers/storage-manager.js";
12
12
  import u from "../managers/subscription-manager.js";
13
13
  import h from "../util/request-header-utils.js";
14
14
  import { randomInclusive as a } from "../util/math.js";
15
15
  import { logger as N, IndexedDBAdapter as tt } from "../../shared-lib/index.js";
16
- export default class Q extends s {
16
+ export default class Q extends t {
17
17
  constructor(t, s, i, e, h) {
18
18
  super(),
19
- (this.As = t),
19
+ (this.Cs = t),
20
20
  (this.C = s),
21
21
  (this.B = i),
22
- (this.Ls = e),
22
+ (this.Ss = e),
23
23
  (this.S = h),
24
- (this.As = t),
24
+ (this.Cs = t),
25
25
  (this.C = s),
26
26
  (this.B = i),
27
- (this.Ls = e),
27
+ (this.Ss = e),
28
28
  (this.S = h),
29
- (this.Js = new u()),
30
- r.N(this.Js),
31
- (this.Ms = 0),
32
- (this.$s = 0),
29
+ (this.Ts = new u()),
30
+ r.N(this.Ts),
31
+ (this.Rs = 0),
32
+ (this.Us = 0),
33
33
  (this.cards = []),
34
- this.Ps();
35
- const n = tt._s.Xs;
36
- new tt(n, N).Gs(n.Ks.Hs, (t) => {
37
- this.Os(t);
34
+ this.Ds();
35
+ const n = tt.Ls.Fs;
36
+ new tt(n, N).Ns(n.Ms.Js, (t) => {
37
+ this.$s(t);
38
38
  }),
39
- (this.Qs = null),
39
+ (this.Es = null),
40
40
  (this.k = null),
41
- (this.Vs = null),
42
- (this.Ws = null),
43
- (this.Ys = 10);
41
+ (this.Ps = null),
42
+ (this.Xs = null),
43
+ (this._s = 10);
44
44
  }
45
- Zs() {
46
- return this.Qs;
45
+ Gs() {
46
+ return this.Es;
47
47
  }
48
- fi(t) {
49
- this.Qs = t;
48
+ Hs(t) {
49
+ this.Es = t;
50
50
  }
51
- Cs() {
51
+ Ct() {
52
52
  return this.k;
53
53
  }
54
- Ts(t) {
54
+ Tt(t) {
55
55
  this.k = t;
56
56
  }
57
- Ps() {
57
+ Ds() {
58
58
  if (!this.C) return;
59
- const s = this.C.vs(t.gs.di) || [],
59
+ const t = this.C.ft(s.gt.Is) || [],
60
60
  i = [];
61
- for (let t = 0; t < s.length; t++) {
62
- const e = Z(s[t]);
61
+ for (let s = 0; s < t.length; s++) {
62
+ const e = Z(t[s]);
63
63
  null != e && i.push(e);
64
64
  }
65
- (this.cards = this.pi(this.Ci(i, !1))),
66
- (this.Ms = this.C.vs(t.gs.bi) || this.Ms),
67
- (this.$s = this.C.vs(t.gs.vi) || this.$s);
65
+ (this.cards = this.Ks(this.Os(i, !1))),
66
+ (this.Rs = this.C.ft(s.gt.Qs) || this.Rs),
67
+ (this.Us = this.C.ft(s.gt.Vs) || this.Us);
68
68
  }
69
- wi(s, i = !1, e = 0, h = 0) {
69
+ Ws(t, i = !1, e = 0, h = 0) {
70
70
  let r;
71
71
  if (i) {
72
72
  r = [];
73
73
  for (const t of this.cards) t.test && r.push(t);
74
74
  } else r = this.cards.slice();
75
- for (let t = 0; t < s.length; t++) {
76
- const e = s[t];
75
+ for (let s = 0; s < t.length; s++) {
76
+ const e = t[s];
77
77
  let h = null;
78
78
  for (let t = 0; t < this.cards.length; t++)
79
79
  if (e.id === this.cards[t].id) {
@@ -87,7 +87,7 @@ export default class Q extends s {
87
87
  const t = Y(e);
88
88
  null != t && r.push(t);
89
89
  } else {
90
- if (!h.ni(e))
90
+ if (!h.ri(e))
91
91
  for (let t = 0; t < r.length; t++)
92
92
  if (e.id === r[t].id) {
93
93
  r.splice(t, 1);
@@ -95,31 +95,31 @@ export default class Q extends s {
95
95
  }
96
96
  }
97
97
  }
98
- (this.cards = this.pi(this.Ci(r, i))),
99
- this.gi(),
100
- (this.Ms = e),
101
- (this.$s = h),
102
- this.C && (this.C.Bs(t.gs.bi, this.Ms), this.C.Bs(t.gs.vi, this.$s));
98
+ (this.cards = this.Ks(this.Os(r, i))),
99
+ this.Ys(),
100
+ (this.Rs = e),
101
+ (this.Us = h),
102
+ this.C && (this.C.Bt(s.gt.Qs, this.Rs), this.C.Bt(s.gt.Vs, this.Us));
103
103
  }
104
- U(s) {
105
- if (this.ji() && null != s && s.cards) {
106
- this.C && this.C.Bs(t.gs.yi, r.Si());
107
- const i = s.full_sync;
108
- i || this.Ps(),
109
- this.wi(s.cards, i, s.last_full_sync_at, s.last_card_updated_at),
110
- this.Js.X(this.Ri(!0));
104
+ U(t) {
105
+ if (this.Zs() && null != t && t.cards) {
106
+ this.C && this.C.Bt(s.gt.fi, r.di());
107
+ const i = t.full_sync;
108
+ i || this.Ds(),
109
+ this.Ws(t.cards, i, t.last_full_sync_at, t.last_card_updated_at),
110
+ this.Ts.X(this.pi(!0));
111
111
  }
112
112
  }
113
- Ui(t) {
114
- this.ki(), (this.Vs = t);
113
+ Ci(t) {
114
+ this.bi(), (this.Ps = t);
115
115
  }
116
- Os(t) {
116
+ $s(t) {
117
117
  var s;
118
- if (!this.ji()) return;
119
- this.Ps();
118
+ if (!this.Zs()) return;
119
+ this.Ds();
120
120
  const i = this.cards.slice();
121
121
  let e = null;
122
- e = null === (s = this.As) || void 0 === s ? void 0 : s.getUserId();
122
+ e = null === (s = this.Cs) || void 0 === s ? void 0 : s.getUserId();
123
123
  for (let s = 0; s < t.length; s++)
124
124
  if (e === t[s].userId || (null == e && null == t[s].userId)) {
125
125
  const e = t[s].card;
@@ -133,7 +133,7 @@ export default class Q extends s {
133
133
  const t = Y(e);
134
134
  null != t && i.push(t);
135
135
  } else {
136
- if (!h.ni(e))
136
+ if (!h.ri(e))
137
137
  for (let t = 0; t < i.length; t++)
138
138
  if (e.id === i[t].id) {
139
139
  i.splice(t, 1);
@@ -141,135 +141,135 @@ export default class Q extends s {
141
141
  }
142
142
  }
143
143
  }
144
- (this.cards = this.pi(this.Ci(i, !1))), this.gi(), this.Js.X(this.Ri(!0));
144
+ (this.cards = this.Ks(this.Os(i, !1))), this.Ys(), this.Ts.X(this.pi(!0));
145
145
  }
146
- Ci(s, i) {
146
+ Os(t, i) {
147
147
  let e = {},
148
148
  h = {},
149
149
  r = {};
150
150
  this.C &&
151
- ((e = this.C.vs(t.gs.ot) || {}),
152
- (h = this.C.vs(t.gs.vt) || {}),
153
- (r = this.C.vs(t.gs.gt) || {}));
151
+ ((e = this.C.ft(s.gt.Kt) || {}),
152
+ (h = this.C.ft(s.gt.Yt) || {}),
153
+ (r = this.C.ft(s.gt.Vt) || {}));
154
154
  const n = {},
155
155
  o = {},
156
156
  l = {};
157
- for (let t = 0; t < s.length; t++) {
158
- const i = s[t].id;
157
+ for (let s = 0; s < t.length; s++) {
158
+ const i = t[s].id;
159
159
  i &&
160
- (e[i] && ((s[t].clicked = !0), (n[i] = !0)),
161
- h[i] && ((s[t].viewed = !0), (o[i] = !0)),
162
- r[i] && ((s[t].dismissed = !0), (l[i] = !0)));
160
+ (e[i] && ((t[s].clicked = !0), (n[i] = !0)),
161
+ h[i] && ((t[s].viewed = !0), (o[i] = !0)),
162
+ r[i] && ((t[s].dismissed = !0), (l[i] = !0)));
163
163
  }
164
164
  return (
165
165
  i &&
166
166
  this.C &&
167
- (this.C.Bs(t.gs.ot, n), this.C.Bs(t.gs.vt, o), this.C.Bs(t.gs.gt, l)),
168
- s
167
+ (this.C.Bt(s.gt.Kt, n), this.C.Bt(s.gt.Yt, o), this.C.Bt(s.gt.Vt, l)),
168
+ t
169
169
  );
170
170
  }
171
- pi(s) {
171
+ Ks(t) {
172
172
  const i = [],
173
173
  e = new Date();
174
174
  let h = {};
175
- this.C && (h = this.C.vs(t.gs.gt) || {});
175
+ this.C && (h = this.C.ft(s.gt.Vt) || {});
176
176
  let r = !1;
177
- for (let t = 0; t < s.length; t++) {
178
- const n = s[t].url;
179
- if (!this.Ls && n && X(n)) {
177
+ for (let s = 0; s < t.length; s++) {
178
+ const n = t[s].url;
179
+ if (!this.Ss && n && X(n)) {
180
180
  N.error(
181
181
  `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
182
  );
183
183
  continue;
184
184
  }
185
- const o = s[t].expiresAt;
185
+ const o = t[s].expiresAt;
186
186
  let l = !0;
187
- if ((null != o && (l = o >= e), (l = l && !s[t].dismissed), l))
188
- i.push(s[t]);
187
+ if ((null != o && (l = o >= e), (l = l && !t[s].dismissed), l))
188
+ i.push(t[s]);
189
189
  else {
190
- const i = s[t].id;
190
+ const i = t[s].id;
191
191
  i && (h[i] = !0), (r = !0);
192
192
  }
193
193
  }
194
- return r && this.C && this.C.Bs(t.gs.gt, h), i;
194
+ return r && this.C && this.C.Bt(s.gt.Vt, h), i;
195
195
  }
196
- gi() {
197
- var s;
196
+ Ys() {
197
+ var t;
198
198
  const i = [];
199
- for (let t = 0; t < this.cards.length; t++) i.push(this.cards[t].bs());
200
- null === (s = this.C) || void 0 === s || s.Bs(t.gs.di, i);
199
+ for (let t = 0; t < this.cards.length; t++) i.push(this.cards[t].bt());
200
+ null === (t = this.C) || void 0 === t || t.Bt(s.gt.Is, i);
201
201
  }
202
- ki() {
203
- this.Vs && (clearTimeout(this.Vs), (this.Vs = null));
202
+ bi() {
203
+ this.Ps && (clearTimeout(this.Ps), (this.Ps = null));
204
204
  }
205
- Di(s, i, e = !1) {
205
+ vi(t, i, e = !1) {
206
206
  var n;
207
207
  const o = this.S,
208
208
  u = this.C;
209
209
  if (!o || !u) return void ("function" == typeof i && i());
210
- if ((e && (h.zi(u, h.O.Ai), this.ki()), !this.ji()))
210
+ if ((e && (h.wi(u, h.O.gi), this.bi()), !this.Zs()))
211
211
  return void (
212
212
  null === (n = this.B) ||
213
213
  void 0 === n ||
214
- n.qi(() => {
215
- this.Di(s, i, !0);
214
+ n.ji(() => {
215
+ this.vi(t, i, !0);
216
216
  })
217
217
  );
218
218
  const c = o.H({}, !0);
219
- u.vs(t.gs.yi) !== r.Si() && this.xi(),
220
- (c.last_full_sync_at = this.Ms),
221
- (c.last_card_updated_at = this.$s);
222
- const f = o.J(c, h.O.Ai, e);
219
+ u.ft(s.gt.fi) !== r.di() && this.yi(),
220
+ (c.last_full_sync_at = this.Rs),
221
+ (c.last_card_updated_at = this.Us);
222
+ const f = o.J(c, h.O.gi, e);
223
223
  let d = !1;
224
224
  o.V(
225
225
  c,
226
- (t = -1) => {
226
+ (s = -1) => {
227
227
  if (this.C) {
228
228
  const t = new Date().valueOf();
229
- h.W(this.C, h.O.Ai, t);
229
+ h.W(this.C, h.O.gi, t);
230
230
  }
231
- -1 !== t && f.push(["X-Braze-Req-Tokens-Remaining", t.toString()]),
231
+ -1 !== s && f.push(["X-Braze-Req-Tokens-Remaining", s.toString()]),
232
232
  l.Y({
233
233
  url: `${o.Z()}/content_cards/sync`,
234
234
  data: c,
235
235
  headers: f,
236
- ss: (t) => {
237
- if (!o.ts(c, t, f))
236
+ tt: (s) => {
237
+ if (!o.st(c, s, f))
238
238
  return (d = !0), void ("function" == typeof i && i());
239
- o.es(), this.U(t), (d = !1), "function" == typeof s && s();
239
+ o.it(), this.U(s), (d = !1), "function" == typeof t && t();
240
240
  },
241
241
  error: (t) => {
242
- o.ns(t, "retrieving content cards"),
242
+ o.et(t, "retrieving content cards"),
243
243
  (d = !0),
244
244
  "function" == typeof i && i();
245
245
  },
246
- rs: (t, e) => {
246
+ nt: (s, e) => {
247
247
  let r;
248
248
  if (d) {
249
- let t = this.Ws;
250
- (null == t || t < 1e3 * this.Ys) && (t = 1e3 * this.Ys),
251
- (r = Math.min(3e5, a(1e3 * this.Ys, 3 * t)));
249
+ let t = this.Xs;
250
+ (null == t || t < 1e3 * this._s) && (t = 1e3 * this._s),
251
+ (r = Math.min(3e5, a(1e3 * this._s, 3 * t)));
252
252
  }
253
- o.os(
253
+ o.rt(
254
254
  e,
255
255
  () => {
256
- this.Di(s, i, !1);
256
+ this.vi(t, i, !1);
257
257
  },
258
- h.O.Ai,
259
- (t) => this.Ui(t),
260
- () => this.ki(),
258
+ h.O.gi,
259
+ (t) => this.Ci(t),
260
+ () => this.bi(),
261
261
  r,
262
262
  );
263
263
  },
264
264
  });
265
265
  },
266
- h.O.Ai,
266
+ h.O.gi,
267
267
  i,
268
268
  );
269
269
  }
270
- Ri(s) {
271
- s || this.Ps();
272
- const i = this.pi(this.cards);
270
+ pi(t) {
271
+ t || this.Ds();
272
+ const i = this.Ks(this.cards);
273
273
  i.sort((t, s) =>
274
274
  t.pinned && !s.pinned
275
275
  ? -1
@@ -281,50 +281,50 @@ export default class Q extends s {
281
281
  ? 1
282
282
  : 0,
283
283
  );
284
- let e = Math.max(this.$s || 0, this.Ms || 0);
284
+ let e = Math.max(this.Us || 0, this.Rs || 0);
285
285
  return (
286
286
  0 === e && (e = void 0),
287
- this.C && this.C.vs(t.gs.vi) === this.$s && void 0 === e && (e = this.$s),
287
+ this.C && this.C.ft(s.gt.Vs) === this.Us && void 0 === e && (e = this.Us),
288
288
  new ContentCards(i, O(e))
289
289
  );
290
290
  }
291
- qs(t) {
292
- return this.Js.Fs(t);
291
+ qt(t) {
292
+ return this.Ts.Ft(t);
293
293
  }
294
- xi() {
295
- (this.Ms = 0),
296
- (this.$s = 0),
297
- this.C && (this.C.Es(t.gs.bi), this.C.Es(t.gs.vi));
294
+ yi() {
295
+ (this.Rs = 0),
296
+ (this.Us = 0),
297
+ this.C && (this.C.Ut(s.gt.Qs), this.C.Ut(s.gt.Vs));
298
298
  }
299
- changeUser(s) {
300
- s ||
299
+ changeUser(t) {
300
+ t ||
301
301
  ((this.cards = []),
302
- this.Js.X(new ContentCards(this.cards.slice(), null)),
302
+ this.Ts.X(new ContentCards(this.cards.slice(), null)),
303
303
  this.C &&
304
- (this.C.Es(t.gs.di),
305
- this.C.Es(t.gs.ot),
306
- this.C.Es(t.gs.vt),
307
- this.C.Es(t.gs.gt))),
308
- this.xi();
304
+ (this.C.Ut(s.gt.Is),
305
+ this.C.Ut(s.gt.Kt),
306
+ this.C.Ut(s.gt.Yt),
307
+ this.C.Ut(s.gt.Vt))),
308
+ this.yi();
309
309
  }
310
- clearData(s) {
311
- (this.Ms = 0),
312
- (this.$s = 0),
310
+ clearData(t) {
311
+ (this.Rs = 0),
312
+ (this.Us = 0),
313
313
  (this.cards = []),
314
- this.Js.X(new ContentCards(this.cards.slice(), null)),
315
- s &&
314
+ this.Ts.X(new ContentCards(this.cards.slice(), null)),
315
+ t &&
316
316
  this.C &&
317
- (this.C.Es(t.gs.di),
318
- this.C.Es(t.gs.ot),
319
- this.C.Es(t.gs.vt),
320
- this.C.Es(t.gs.gt),
321
- this.C.Es(t.gs.bi),
322
- this.C.Es(t.gs.vi));
317
+ (this.C.Ut(s.gt.Is),
318
+ this.C.Ut(s.gt.Kt),
319
+ this.C.Ut(s.gt.Yt),
320
+ this.C.Ut(s.gt.Vt),
321
+ this.C.Ut(s.gt.Qs),
322
+ this.C.Ut(s.gt.Vs));
323
323
  }
324
- ji() {
325
- return !!this.B && (!!this.B.Fi() || (0 !== this.B.Us() && this.Li(), !1));
324
+ Zs() {
325
+ return !!this.B && (!!this.B.Ri() || (0 !== this.B.Et() && this.Ui(), !1));
326
326
  }
327
- Li() {
328
- this.Js.X(new ContentCards([], new Date())), this.C && this.C.Es(t.gs.di);
327
+ Ui() {
328
+ this.Ts.X(new ContentCards([], new Date())), this.C && this.C.Ut(s.gt.Is);
329
329
  }
330
330
  }
@@ -1,5 +1,5 @@
1
1
  import W 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 W.m().Ri(!1);
4
+ if (r.rr()) return W.m().pi(!1);
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import r from "../managers/braze-instance.js";
2
2
  import W from "./content-cards-provider-factory.js";
3
3
  export function requestContentCardsRefresh(e, t) {
4
- if (r.rr()) return W.m().Di(e, t, !0);
4
+ if (r.rr()) return W.m().vi(e, t, !0);
5
5
  }
@@ -3,14 +3,14 @@ import W from "./content-cards-provider-factory.js";
3
3
  export function subscribeToContentCardsUpdates(o) {
4
4
  if (!r.rr()) return;
5
5
  const t = W.m(),
6
- n = t.qs(o);
7
- if (!t.Cs()) {
6
+ n = t.qt(o);
7
+ if (!t.Ct()) {
8
8
  const o = r.nn();
9
9
  if (o) {
10
10
  const r = o.rn(() => {
11
- t.Di(void 0, void 0, !0);
11
+ t.vi(void 0, void 0, !0);
12
12
  });
13
- r && t.Ts(r);
13
+ r && t.Tt(r);
14
14
  }
15
15
  }
16
16
  return n;
@@ -19,11 +19,11 @@ export function showContentCards(n, t) {
19
19
  let e = !1;
20
20
  null == n && ((n = document.body), (e = !0));
21
21
  const o = r.ee(w.tn) || r.ee(w.en) || !1,
22
- i = W.m().Ri(!1);
22
+ i = W.m().pi(!1);
23
23
  "function" == typeof t && an(i, t(i.cards.slice()), i.lastUpdated, null, o);
24
24
  const a = tn(i, o, e),
25
25
  s = W.m(),
26
- f = s.Zs();
26
+ f = s.Gs();
27
27
  (null == i.lastUpdated ||
28
28
  new Date().valueOf() - i.lastUpdated.valueOf() > ContentCards.dr) &&
29
29
  (null == f || new Date().valueOf() - f > ContentCards.dr) &&
@@ -31,7 +31,7 @@ export function showContentCards(n, t) {
31
31
  `Cached content cards were older than max TTL of ${ContentCards.dr} ms, requesting an update from the server.`,
32
32
  ),
33
33
  on(i, a),
34
- s.fi(new Date().valueOf()));
34
+ s.Hs(new Date().valueOf()));
35
35
  const l = new Date().valueOf(),
36
36
  c = subscribeToContentCardsUpdates(function (n) {
37
37
  const e = a.querySelectorAll(".ab-refresh-button")[0];
@@ -1,15 +1,15 @@
1
1
  import r from "../managers/braze-instance.js";
2
2
  import { logger as N, IndexedDBAdapter as tt } from "../../shared-lib/index.js";
3
- import ne, { STORAGE_KEYS as t } from "../managers/storage-manager.js";
3
+ import ne, { 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
7
  const n = new ne.se(null, !0),
8
- s = "This-cookie-will-expire-in-" + n.ae();
9
- n.store(t.ie, s);
10
- const a = tt._s.Xs;
11
- new tt(a, N).setItem(a.Ks.oe, a.te, !0),
8
+ a = "This-cookie-will-expire-in-" + n.le();
9
+ n.store(s.me, a);
10
+ const i = tt.Ls.Fs;
11
+ new tt(i, N).setItem(i.Ms.pe, i.be, !0),
12
12
  N.info("disableSDK was called"),
13
13
  r.destroy(!1),
14
- r.le(!0);
14
+ r.fe(!0);
15
15
  }