@braze/web-sdk 5.8.0 → 5.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 (140) hide show
  1. package/index.d.ts +14 -9
  2. package/package.json +1 -1
  3. package/shared-lib/encoding-utils.js +1 -1
  4. package/shared-lib/event-types.js +25 -25
  5. package/shared-lib/guid.js +3 -3
  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 +90 -87
  10. package/src/Banner/banner.js +9 -9
  11. package/src/Banner/display/banner-to-html.js +32 -27
  12. package/src/Banner/get-all-banners.js +11 -5
  13. package/src/Banner/get-banner.js +7 -4
  14. package/src/Banner/log-banner-click.js +4 -4
  15. package/src/Banner/log-banner-impressions.js +6 -6
  16. package/src/Banner/request-banners-refresh.js +6 -3
  17. package/src/Banner/subscribe-to-banners-updates.js +7 -7
  18. package/src/Banner/ui/insert-banner.js +2 -2
  19. package/src/Card/card-manager.js +39 -39
  20. package/src/Card/display/card-display.js +11 -11
  21. package/src/Card/log-card-click.js +2 -2
  22. package/src/Card/log-card-dismissal.js +2 -2
  23. package/src/Card/log-card-impressions.js +3 -3
  24. package/src/Card/models/captioned-image.js +21 -21
  25. package/src/Card/models/card.js +96 -96
  26. package/src/Card/models/classic-card.js +21 -21
  27. package/src/Card/models/control-card.js +11 -11
  28. package/src/Card/models/image-only.js +19 -19
  29. package/src/Card/util/card-factory.js +43 -43
  30. package/src/ContentCards/content-cards-provider.js +156 -154
  31. package/src/ContentCards/get-cached-content-cards.js +1 -1
  32. package/src/ContentCards/request-content-cards-refresh.js +1 -1
  33. package/src/ContentCards/subscribe-to-content-cards-updates.js +6 -6
  34. package/src/ContentCards/ui/show-content-cards.js +3 -3
  35. package/src/Core/change-user.js +1 -1
  36. package/src/Core/disable-sdk.js +8 -8
  37. package/src/Core/enable-sdk.js +6 -6
  38. package/src/Core/get-device-id.js +2 -2
  39. package/src/Core/handle-braze-action.js +2 -2
  40. package/src/Core/is-disabled.js +2 -2
  41. package/src/Core/is-initialized.js +1 -1
  42. package/src/Core/log-custom-event.js +5 -5
  43. package/src/Core/log-purchase.js +4 -4
  44. package/src/Core/open-session.js +8 -8
  45. package/src/Core/request-immediate-data-flush.js +1 -1
  46. package/src/Core/wipe-data.js +7 -5
  47. package/src/FeatureFlags/feature-flag-factory.js +10 -10
  48. package/src/FeatureFlags/feature-flag.js +15 -15
  49. package/src/FeatureFlags/feature-flags-provider.js +69 -63
  50. package/src/FeatureFlags/get-all-feature-flags.js +2 -2
  51. package/src/FeatureFlags/get-feature-flag.js +2 -2
  52. package/src/FeatureFlags/log-feature-flag-impression.js +4 -4
  53. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +2 -2
  54. package/src/Feed/feed-provider-factory.js +1 -1
  55. package/src/Feed/feed-provider.js +44 -44
  56. package/src/Feed/get-cached-feed.js +1 -1
  57. package/src/Feed/log-feed-displayed.js +1 -1
  58. package/src/Feed/request-feed-refresh.js +1 -1
  59. package/src/Feed/subscribe-to-feed-updates.js +1 -1
  60. package/src/Feed/ui/show-feed.js +1 -1
  61. package/src/InAppMessage/defer-in-app-message.js +1 -1
  62. package/src/InAppMessage/display/html-message-to-html.js +10 -10
  63. package/src/InAppMessage/display/in-app-message-to-html.js +25 -25
  64. package/src/InAppMessage/display/modal-utils.js +8 -8
  65. package/src/InAppMessage/in-app-message-factory.js +7 -7
  66. package/src/InAppMessage/in-app-message-manager.js +92 -92
  67. package/src/InAppMessage/log-in-app-message-button-click.js +7 -7
  68. package/src/InAppMessage/log-in-app-message-click.js +5 -5
  69. package/src/InAppMessage/log-in-app-message-html-click.js +7 -7
  70. package/src/InAppMessage/log-in-app-message-impression.js +2 -2
  71. package/src/InAppMessage/models/control-message.js +5 -5
  72. package/src/InAppMessage/models/full-screen-message.js +34 -34
  73. package/src/InAppMessage/models/html-message.js +20 -20
  74. package/src/InAppMessage/models/in-app-message-button.js +8 -8
  75. package/src/InAppMessage/models/in-app-message.js +82 -82
  76. package/src/InAppMessage/models/modal-message.js +33 -33
  77. package/src/InAppMessage/models/slide-up-message.js +29 -29
  78. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  79. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  80. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
  81. package/src/InAppMessage/ui/show-in-app-message.js +18 -18
  82. package/src/Push/push-manager-factory.js +1 -1
  83. package/src/Push/push-manager.js +94 -94
  84. package/src/Push/request-push-permission.js +1 -1
  85. package/src/Push/utils/push-utils.js +4 -4
  86. package/src/User/user-manager.js +20 -20
  87. package/src/User/user.js +38 -38
  88. package/src/common/base-feed.js +1 -1
  89. package/src/common/base-provider.js +1 -1
  90. package/src/common/constants.js +2 -0
  91. package/src/common/event-logger.js +7 -7
  92. package/src/common/feed-display.js +8 -8
  93. package/src/l10n/l10n-manager-factory.js +1 -1
  94. package/src/l10n/l10n-manager.js +1 -1
  95. package/src/managers/auth-manager.js +14 -14
  96. package/src/managers/braze-instance.js +134 -133
  97. package/src/managers/device-manager.js +25 -25
  98. package/src/managers/network-manager.js +167 -161
  99. package/src/managers/server-config-manager.js +104 -92
  100. package/src/managers/session-manager.js +29 -29
  101. package/src/managers/storage-manager-factory.js +12 -12
  102. package/src/managers/storage-manager.js +86 -86
  103. package/src/managers/subscription-manager.js +11 -11
  104. package/src/managers/utils.js +4 -4
  105. package/src/models/backend-errors.js +5 -5
  106. package/src/models/braze-event.js +9 -9
  107. package/src/models/device.js +2 -2
  108. package/src/models/identifier.js +4 -4
  109. package/src/models/push-token.js +8 -8
  110. package/src/models/request-result.js +4 -4
  111. package/src/models/server-config.js +37 -37
  112. package/src/request-controller.js +159 -158
  113. package/src/triggers/models/custom-event-data.js +2 -2
  114. package/src/triggers/models/custom-event-property-data.js +4 -4
  115. package/src/triggers/models/filter-set.js +6 -6
  116. package/src/triggers/models/filter.js +7 -7
  117. package/src/triggers/models/in-app-message-click-data.js +2 -2
  118. package/src/triggers/models/purchase-data.js +2 -2
  119. package/src/triggers/models/purchase-property-data.js +4 -4
  120. package/src/triggers/models/push-click-data.js +2 -2
  121. package/src/triggers/models/trigger-condition.js +36 -36
  122. package/src/triggers/models/trigger-events.js +3 -3
  123. package/src/triggers/models/trigger.js +14 -14
  124. package/src/triggers/triggers-provider-factory.js +3 -3
  125. package/src/triggers/triggers-provider.js +72 -72
  126. package/src/ui/js/attach-css.js +1 -1
  127. package/src/ui/js/load-font-awesome.js +1 -1
  128. package/src/util/base-device-parser.js +1 -1
  129. package/src/util/braze-actions.js +4 -4
  130. package/src/util/browser-detector.js +5 -5
  131. package/src/util/client-hints-parser.js +1 -1
  132. package/src/util/component-utils.js +2 -2
  133. package/src/util/dom-utils.js +4 -4
  134. package/src/util/html-display-utils.js +14 -14
  135. package/src/util/key-codes.js +1 -1
  136. package/src/util/net.js +7 -7
  137. package/src/util/request-header-utils.js +21 -21
  138. package/src/util/user-agent-parser.js +1 -1
  139. package/src/util/validation-utils.js +2 -2
  140. package/src/util/window-utils.js +2 -2
@@ -1,79 +1,79 @@
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
- import { dateFromUnixTimestamp as O } from "../util/date-utils.js";
6
- import { isURIJavascriptOrData as X } from "../util/url-utils.js";
5
+ import { dateFromUnixTimestamp as P } from "../util/date-utils.js";
6
+ import { isURIJavascriptOrData as Y } from "../util/url-utils.js";
7
7
  import {
8
- newCardFromContentCardsJson as Y,
9
- newCardFromSerializedValue as Z,
8
+ newCardFromContentCardsJson as Z,
9
+ newCardFromSerializedValue as tt,
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
- import { logger as N, IndexedDBAdapter as tt } from "../../shared-lib/index.js";
16
- export default class Q extends s {
15
+ import { logger as N, IndexedDBAdapter as st } from "../../shared-lib/index.js";
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.F(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 = st.Ls.Fs;
36
+ new st(n, N).Ns(n.Ms.Js, (t) => {
37
+ this.$s(t);
38
38
  }),
39
- (this.Qs = null),
40
- (this.k = null),
41
- (this.Vs = null),
42
- (this.Ws = null),
43
- (this.Ys = 10);
39
+ (this.Bs = null),
40
+ (this.N = null),
41
+ (this.Es = null),
42
+ (this.Ps = null),
43
+ (this.Xs = 10);
44
44
  }
45
- Zs() {
46
- return this.Qs;
45
+ _s() {
46
+ return this.Bs;
47
47
  }
48
- fi(t) {
49
- this.Qs = t;
48
+ Gs(t) {
49
+ this.Bs = t;
50
50
  }
51
- Cs() {
52
- return this.k;
51
+ Ct() {
52
+ return this.N;
53
53
  }
54
- Ts(t) {
55
- this.k = t;
54
+ Tt(t) {
55
+ this.N = 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.Hs) || [],
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 = tt(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.Is(this.Ks(i, !1))),
66
+ (this.Rs = this.C.ft(s.gt.Os) || this.Rs),
67
+ (this.Us = this.C.ft(s.gt.Qs) || this.Us);
68
68
  }
69
- wi(s, i = !1, e = 0, h = 0) {
69
+ Vs(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) {
@@ -81,13 +81,13 @@ export default class Q extends s {
81
81
  break;
82
82
  }
83
83
  if (i) {
84
- const t = Y(e);
84
+ const t = Z(e);
85
85
  null != h && h.viewed && t && (t.viewed = !0), null != t && r.push(t);
86
86
  } else if (null == h) {
87
- const t = Y(e);
87
+ const t = Z(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.Is(this.Ks(r, i))),
99
+ this.Ws(),
100
+ (this.Rs = e),
101
+ (this.Us = h),
102
+ this.C && (this.C.Bt(s.gt.Os, this.Rs), this.C.Bt(s.gt.Qs, 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.Ys() && null != t && t.cards) {
106
+ this.C && this.C.Bt(s.gt.Zs, r.fi());
107
+ const i = t.full_sync;
108
+ i || this.Ds(),
109
+ this.Vs(t.cards, i, t.last_full_sync_at, t.last_card_updated_at),
110
+ this.Ts.X(this.di(!0));
111
111
  }
112
112
  }
113
- Ui(t) {
114
- this.ki(), (this.Vs = t);
113
+ pi(t) {
114
+ this.Ci(), (this.Es = t);
115
115
  }
116
- Os(t) {
116
+ $s(t) {
117
117
  var s;
118
- if (!this.ji()) return;
119
- this.Ps();
118
+ if (!this.Ys()) 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;
@@ -130,10 +130,10 @@ export default class Q extends s {
130
130
  break;
131
131
  }
132
132
  if (null == h) {
133
- const t = Y(e);
133
+ const t = Z(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.Is(this.Ks(i, !1))), this.Ws(), this.Ts.X(this.di(!0));
145
145
  }
146
- Ci(s, i) {
146
+ Ks(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
+ Is(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 && Y(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
+ Ws() {
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.Hs, i);
201
201
  }
202
- ki() {
203
- this.Vs && (clearTimeout(this.Vs), (this.Vs = null));
202
+ Ci() {
203
+ this.Es && (clearTimeout(this.Es), (this.Es = null));
204
204
  }
205
- Di(s, i, e = !1) {
205
+ bi(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.vi(u, h.O.wi), this.Ci()), !this.Ys()))
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.gi(() => {
215
+ this.bi(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.Zs) !== r.fi() && this.ji(),
220
+ (c.last_full_sync_at = this.Rs),
221
+ (c.last_card_updated_at = this.Us);
222
+ const f = o.J(c, h.O.wi, 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.wi, 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.Ps;
250
+ (null == t || t < 1e3 * this.Xs) && (t = 1e3 * this.Xs),
251
+ (r = Math.min(3e5, a(1e3 * this.Xs, 3 * t)));
252
252
  }
253
- o.os(
253
+ o.rt(
254
254
  e,
255
255
  () => {
256
- this.Di(s, i, !1);
256
+ this.bi(t, i, !1);
257
257
  },
258
- h.O.Ai,
259
- (t) => this.Ui(t),
260
- () => this.ki(),
258
+ h.O.wi,
259
+ (t) => this.pi(t),
260
+ () => this.Ci(),
261
261
  r,
262
262
  );
263
263
  },
264
264
  });
265
265
  },
266
- h.O.Ai,
266
+ h.O.wi,
267
267
  i,
268
268
  );
269
269
  }
270
- Ri(s) {
271
- s || this.Ps();
272
- const i = this.pi(this.cards);
270
+ di(t) {
271
+ t || this.Ds();
272
+ const i = this.Is(this.cards);
273
273
  i.sort((t, s) =>
274
274
  t.pinned && !s.pinned
275
275
  ? -1
@@ -281,50 +281,52 @@ 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),
288
- new ContentCards(i, O(e))
287
+ this.C && this.C.ft(s.gt.Qs) === this.Us && void 0 === e && (e = this.Us),
288
+ new ContentCards(i, P(e))
289
289
  );
290
290
  }
291
- qs(t) {
292
- return this.Js.Fs(t);
291
+ qt(t) {
292
+ return this.Ts.Dt(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
+ ji() {
295
+ (this.Rs = 0),
296
+ (this.Us = 0),
297
+ this.C && (this.C.Ut(s.gt.Os), this.C.Ut(s.gt.Qs));
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.Hs),
305
+ this.C.Ut(s.gt.Kt),
306
+ this.C.Ut(s.gt.Yt),
307
+ this.C.Ut(s.gt.Vt))),
308
+ this.Ci(),
309
+ this.ji();
309
310
  }
310
- clearData(s) {
311
- (this.Ms = 0),
312
- (this.$s = 0),
311
+ clearData(t) {
312
+ (this.Rs = 0),
313
+ (this.Us = 0),
313
314
  (this.cards = []),
314
- this.Js.X(new ContentCards(this.cards.slice(), null)),
315
- s &&
315
+ this.Ts.X(new ContentCards(this.cards.slice(), null)),
316
+ t &&
316
317
  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));
318
+ (this.C.Ut(s.gt.Hs),
319
+ this.C.Ut(s.gt.Kt),
320
+ this.C.Ut(s.gt.Yt),
321
+ this.C.Ut(s.gt.Vt),
322
+ this.C.Ut(s.gt.Os),
323
+ this.C.Ut(s.gt.Qs)),
324
+ this.Ci();
323
325
  }
324
- ji() {
325
- return !!this.B && (!!this.B.Fi() || (0 !== this.B.Us() && this.Li(), !1));
326
+ Ys() {
327
+ return !!this.B && (!!this.B.yi() || (0 !== this.B.Et() && this.Ri(), !1));
326
328
  }
327
- Li() {
328
- this.Js.X(new ContentCards([], new Date())), this.C && this.C.Es(t.gs.di);
329
+ Ri() {
330
+ this.Ts.X(new ContentCards([], new Date())), this.C && this.C.Ut(s.gt.Hs);
329
331
  }
330
332
  }
@@ -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().di(!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().bi(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()) {
8
- const o = r.nn();
6
+ n = t.qt(o);
7
+ if (!t.Ct()) {
8
+ const o = r.rn();
9
9
  if (o) {
10
- const r = o.rn(() => {
11
- t.Di(void 0, void 0, !0);
10
+ const r = o.on(() => {
11
+ t.bi(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().di(!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._s();
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.Gs(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];
@@ -12,6 +12,6 @@ export function changeUser(e, i) {
12
12
  `Rejected user id "${e}" because it is longer than ${User.ur} bytes.`,
13
13
  );
14
14
  if (null != i && !ir(i, "set signature for new user", "signature")) return;
15
- const t = r.nn();
15
+ const t = r.rn();
16
16
  t && t.changeUser(e.toString(), r.ar(), i);
17
17
  }
@@ -1,15 +1,15 @@
1
1
  import r from "../managers/braze-instance.js";
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";
2
+ import { logger as N, IndexedDBAdapter as st } from "../../shared-lib/index.js";
3
+ import ne, { STORAGE_KEYS as s } from "../managers/storage-manager.js";
4
4
  export function disableSDK() {
5
- const e = r.nn();
5
+ const e = r.rn();
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 = st.Ls.Fs;
11
+ new st(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
  }
@@ -1,11 +1,11 @@
1
1
  import r from "../managers/braze-instance.js";
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";
2
+ import { logger as N, IndexedDBAdapter as st } from "../../shared-lib/index.js";
3
+ import ne, { STORAGE_KEYS as s } from "../managers/storage-manager.js";
4
4
  export function enableSDK() {
5
- new ne.se(null, !0).remove(t.ie);
6
- const e = tt._s.Xs;
7
- new tt(e, N).me(e.Ks.oe, e.te),
5
+ new ne.se(null, !0).remove(s.me);
6
+ const e = st.Ls.Fs;
7
+ new st(e, N).ge(e.Ms.pe, e.be),
8
8
  N.info("enableSDK was called"),
9
9
  r.destroy(!1),
10
- r.le(!1);
10
+ r.fe(!1);
11
11
  }
@@ -2,9 +2,9 @@ import r from "../managers/braze-instance.js";
2
2
  import { logger as N } from "../../shared-lib/index.js";
3
3
  export function getDeviceId(e) {
4
4
  if (!r.rr()) return;
5
- const t = r.ce();
5
+ const t = r.ue();
6
6
  if (!t) return;
7
- const i = t.de().id;
7
+ const i = t.ve().id;
8
8
  if ("function" != typeof e) return i;
9
9
  N.warn(
10
10
  "The callback for getDeviceId is deprecated. You can access its return value directly instead (e.g. `const id = braze.getDeviceId()`)",
@@ -41,7 +41,7 @@ export function _handleBrazeAction(o, e, s) {
41
41
  case oo.types.logCustomEvent:
42
42
  import("./log-custom-event.js").then(
43
43
  ({ logCustomEvent: logCustomEvent }) => {
44
- r.nt()
44
+ r.nn()
45
45
  ? ((t = Array.prototype.slice.call(e)),
46
46
  logCustomEvent(...t))
47
47
  : N.error(p);
@@ -51,7 +51,7 @@ export function _handleBrazeAction(o, e, s) {
51
51
  case oo.types.requestPushPermission:
52
52
  import("../Push/request-push-permission.js").then(
53
53
  ({ requestPushPermission: requestPushPermission }) => {
54
- r.nt()
54
+ r.nn()
55
55
  ? "Safari" === ro.browser && ro.OS === so.ao
56
56
  ? window.navigator.standalone && requestPushPermission()
57
57
  : requestPushPermission()
@@ -1,4 +1,4 @@
1
- import ne, { STORAGE_KEYS as t } from "../managers/storage-manager.js";
1
+ import ne, { STORAGE_KEYS as s } from "../managers/storage-manager.js";
2
2
  export function isDisabled() {
3
- return !!new ne.se(null, !0).gr(t.ie);
3
+ return !!new ne.se(null, !0).gr(s.me);
4
4
  }
@@ -1,4 +1,4 @@
1
1
  import r from "../managers/braze-instance.js";
2
2
  export function isInitialized() {
3
- return r.nt();
3
+ return r.nn();
4
4
  }