@braze/web-sdk 6.3.1 → 6.4.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 (132) hide show
  1. package/index.d.ts +35 -3
  2. package/package.json +1 -1
  3. package/shared-lib/encoding-utils.js +1 -1
  4. package/shared-lib/event-types.js +23 -23
  5. package/shared-lib/guid.js +2 -2
  6. package/shared-lib/indexed-db-adapter.js +7 -7
  7. package/shared-lib/logger.js +2 -2
  8. package/shared-lib/supported-options.js +22 -21
  9. package/src/Banner/display/banner-to-html.js +2 -2
  10. package/src/Banner/display/detect-banner-impressions.js +7 -7
  11. package/src/Banner/index.js +2 -0
  12. package/src/Banner/request-banners-refresh.js +6 -6
  13. package/src/Banner/ui/insert-banner.js +4 -4
  14. package/src/Card/card-manager-factory.js +5 -5
  15. package/src/Card/card-manager.js +4 -4
  16. package/src/Card/display/card-display.js +7 -7
  17. package/src/Card/log-card-dismissal.js +3 -3
  18. package/src/Card/log-content-card-click.js +3 -3
  19. package/src/Card/log-content-card-impressions.js +6 -6
  20. package/src/Card/models/card.js +7 -7
  21. package/src/Card/util/card-factory.js +6 -6
  22. package/src/ContentCards/content-cards-provider-factory.js +14 -10
  23. package/src/ContentCards/content-cards-provider.js +28 -28
  24. package/src/ContentCards/content-cards.js +4 -4
  25. package/src/ContentCards/get-cached-content-cards.js +2 -2
  26. package/src/ContentCards/request-content-cards-refresh.js +2 -2
  27. package/src/ContentCards/subscribe-to-content-cards-updates.js +3 -3
  28. package/src/ContentCards/ui/show-content-cards.js +8 -8
  29. package/src/Core/add-sdk-metadata.js +2 -2
  30. package/src/Core/change-user.js +5 -5
  31. package/src/Core/disable-sdk.js +3 -3
  32. package/src/Core/enable-sdk.js +3 -3
  33. package/src/Core/get-user.js +1 -1
  34. package/src/Core/is-disabled.js +1 -1
  35. package/src/Core/log-custom-event.js +9 -9
  36. package/src/Core/log-purchase.js +7 -7
  37. package/src/Core/open-session.js +11 -11
  38. package/src/Core/set-sdk-authentication-signature.js +2 -2
  39. package/src/Core/wipe-data.js +5 -5
  40. package/src/DUST/dust-provider-factory.js +20 -0
  41. package/src/DUST/dust-provider.js +288 -0
  42. package/src/DUST/index.js +3 -0
  43. package/src/DUST/subscribe-to-dust.js +24 -0
  44. package/src/DUST/types.js +1 -0
  45. package/src/FeatureFlags/feature-flags-provider-factory.js +9 -9
  46. package/src/FeatureFlags/feature-flags-provider.js +38 -38
  47. package/src/FeatureFlags/get-all-feature-flags.js +3 -3
  48. package/src/FeatureFlags/get-feature-flag.js +3 -3
  49. package/src/FeatureFlags/log-feature-flag-impression.js +5 -5
  50. package/src/FeatureFlags/refresh-feature-flags.js +5 -5
  51. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +3 -3
  52. package/src/InAppMessage/defer-in-app-message.js +1 -1
  53. package/src/InAppMessage/display/html-message-to-html.js +5 -5
  54. package/src/InAppMessage/display/in-app-message-to-html.js +22 -22
  55. package/src/InAppMessage/display/modal-utils.js +5 -5
  56. package/src/InAppMessage/get-deferred-in-app-message.js +1 -1
  57. package/src/InAppMessage/in-app-message-factory.js +4 -4
  58. package/src/InAppMessage/in-app-message-manager.js +80 -80
  59. package/src/InAppMessage/log-in-app-message-button-click.js +5 -5
  60. package/src/InAppMessage/log-in-app-message-click.js +5 -5
  61. package/src/InAppMessage/log-in-app-message-html-click.js +5 -5
  62. package/src/InAppMessage/log-in-app-message-impression.js +1 -1
  63. package/src/InAppMessage/models/control-message.js +1 -1
  64. package/src/InAppMessage/models/full-screen-message.js +12 -12
  65. package/src/InAppMessage/models/html-message.js +14 -14
  66. package/src/InAppMessage/models/in-app-message-button.js +4 -4
  67. package/src/InAppMessage/models/in-app-message.js +119 -121
  68. package/src/InAppMessage/models/modal-message.js +12 -12
  69. package/src/InAppMessage/models/slide-up-message.js +21 -21
  70. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  71. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  72. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
  73. package/src/InAppMessage/ui/remove-all-visible-in-app-messages.js +18 -0
  74. package/src/InAppMessage/ui/show-in-app-message.js +24 -24
  75. package/src/Push/is-push-blocked.js +2 -2
  76. package/src/Push/is-push-permission-granted.js +2 -2
  77. package/src/Push/is-push-supported.js +2 -2
  78. package/src/Push/push-manager-factory.js +8 -8
  79. package/src/Push/push-manager.js +90 -90
  80. package/src/Push/utils/push-utils.js +17 -17
  81. package/src/User/user-manager.js +12 -12
  82. package/src/User/user.js +48 -48
  83. package/src/common/constants.js +1 -0
  84. package/src/common/content-cards-display.js +20 -20
  85. package/src/common/event-logger.js +4 -4
  86. package/src/common/properties-base.js +16 -16
  87. package/src/l10n/l10n-manager-factory.js +2 -2
  88. package/src/l10n/l10n-manager.js +1 -1
  89. package/src/managers/auth-manager.js +29 -29
  90. package/src/managers/braze-instance.js +141 -133
  91. package/src/managers/device-manager.js +18 -18
  92. package/src/managers/network-manager.js +139 -139
  93. package/src/managers/server-config-manager.js +99 -82
  94. package/src/managers/session-manager.js +32 -32
  95. package/src/managers/storage-manager-factory.js +8 -8
  96. package/src/managers/storage-manager.js +76 -74
  97. package/src/managers/subscription-manager.js +10 -10
  98. package/src/models/backend-errors.js +5 -5
  99. package/src/models/braze-event.js +9 -9
  100. package/src/models/device.js +2 -2
  101. package/src/models/identifier.js +12 -12
  102. package/src/models/push-token.js +12 -12
  103. package/src/models/request-result.js +1 -1
  104. package/src/models/server-config.js +38 -34
  105. package/src/request-controller.js +136 -134
  106. package/src/triggers/models/custom-event-data.js +4 -4
  107. package/src/triggers/models/custom-event-property-data.js +5 -5
  108. package/src/triggers/models/filter-set.js +8 -8
  109. package/src/triggers/models/filter.js +30 -30
  110. package/src/triggers/models/in-app-message-click-data.js +1 -1
  111. package/src/triggers/models/purchase-data.js +1 -1
  112. package/src/triggers/models/purchase-property-data.js +2 -2
  113. package/src/triggers/models/push-click-data.js +1 -1
  114. package/src/triggers/models/trigger-condition.js +36 -36
  115. package/src/triggers/models/trigger-events.js +2 -2
  116. package/src/triggers/models/trigger.js +15 -15
  117. package/src/triggers/triggers-provider-factory.js +3 -3
  118. package/src/triggers/triggers-provider.js +25 -25
  119. package/src/ui/js/attach-css.js +3 -3
  120. package/src/ui/js/load-font-awesome.js +2 -2
  121. package/src/util/base-device-parser.js +3 -3
  122. package/src/util/braze-actions.js +3 -3
  123. package/src/util/browser-detector.js +13 -13
  124. package/src/util/client-hints-parser.js +6 -6
  125. package/src/util/component-utils.js +1 -1
  126. package/src/util/dom-utils.js +10 -10
  127. package/src/util/key-codes.js +1 -1
  128. package/src/util/net.js +1 -1
  129. package/src/util/request-header-utils.js +22 -22
  130. package/src/util/user-agent-parser.js +14 -14
  131. package/src/util/validation-utils.js +9 -9
  132. package/src/util/window-utils.js +1 -1
@@ -4,7 +4,7 @@ import ro from "../util/browser-detector.js";
4
4
  import Ot from "./device-manager.js";
5
5
  import DeviceProperties from "../Core/device-properties.js";
6
6
  import {
7
- isArray as D,
7
+ isArray as z,
8
8
  keys as C,
9
9
  validateValueIsFromEnum as ta,
10
10
  values as Pt,
@@ -16,77 +16,80 @@ import Kt from "./session-manager.js";
16
16
  import ee, { STORAGE_KEYS as s } from "./storage-manager.js";
17
17
  import Gt from "./storage-manager-factory.js";
18
18
  import u from "./subscription-manager.js";
19
- import { TriggersProviderFactory as rt } from "../triggers/triggers-provider-factory.js";
19
+ import { TriggersProviderFactory as ot } from "../triggers/triggers-provider-factory.js";
20
+ import ir from "../DUST/dust-provider-factory.js";
21
+ import { subscribeToDust as $t } from "../DUST/subscribe-to-dust.js";
20
22
  import bt from "../User/user-manager.js";
21
23
  import { User } from "../User/index.js";
22
24
  import { parseQueryStringKeyValues as ll } from "../util/url-utils.js";
23
25
  import { WindowUtils as no } from "../util/window-utils.js";
24
26
  import { BRAZE_MUST_BE_INITIALIZED_ERROR as w } from "../common/constants.js";
25
- import { SupportedOptions as $t, logger as E } from "../../shared-lib/index.js";
27
+ import { SupportedOptions as Jt, logger as E } from "../../shared-lib/index.js";
26
28
  import _t from "../models/identifier.js";
27
- const z = {
28
- _o: "allowCrawlerActivity",
29
- Ro: "baseUrl",
30
- Wo: "noCookies",
31
- Vo: "devicePropertyAllowlist",
32
- Aa: "disablePushTokenMaintenance",
33
- Yo: "enableLogging",
34
- Xo: "enableSdkAuthentication",
35
- qa: "manageServiceWorkerExternally",
36
- Zo: "minimumIntervalBetweenTriggerActionsInSeconds",
37
- Wh: "sessionTimeoutInSeconds",
38
- Vh: "appVersion",
39
- Kh: "appVersionNumber",
40
- Ma: "serviceWorkerLocation",
41
- ka: "safariWebsitePushId",
42
- Xn: "localization",
29
+ const q = {
30
+ Ph: "allowCrawlerActivity",
31
+ Wh: "baseUrl",
32
+ Vh: "noCookies",
33
+ Kh: "devicePropertyAllowlist",
34
+ Da: "disablePushTokenMaintenance",
35
+ $h: "enableLogging",
36
+ Yh: "enableSdkAuthentication",
37
+ Ca: "manageServiceWorkerExternally",
38
+ Xh: "minimumIntervalBetweenTriggerActionsInSeconds",
39
+ Zh: "sessionTimeoutInSeconds",
40
+ Qh: "appVersion",
41
+ Ia: "appVersionNumber",
42
+ _a: "serviceWorkerLocation",
43
+ Ba: "safariWebsitePushId",
44
+ Ea: "localization",
43
45
  er: "contentSecurityNonce",
44
46
  re: "allowUserSuppliedJavascript",
45
47
  Jo: "inAppMessageZIndex",
46
- Do: "openInAppMessagesInNewTab",
48
+ To: "openInAppMessagesInNewTab",
47
49
  tn: "openCardsInNewTab",
48
- Lh: "requireExplicitInAppMessageDismissal",
49
- $h: "doNotLoadFontAwesome",
50
- Jh: "deviceId",
51
- _a: "serviceWorkerScope",
52
- Yh: "sdkFlavor",
50
+ Oh: "requireExplicitInAppMessageDismissal",
51
+ Na: "doNotLoadFontAwesome",
52
+ Oa: "deviceId",
53
+ Aa: "serviceWorkerScope",
54
+ zi: "dustHost",
55
+ Ta: "sdkFlavor",
53
56
  };
54
- class Jt {
57
+ class Yt {
55
58
  constructor() {
56
- (this.sn = ""),
57
- (this.Xh = ""),
58
- (this.Zh = void 0),
59
- (this.Qh = null),
60
- (this.on = null),
59
+ (this.Pn = ""),
60
+ (this.Ra = ""),
61
+ (this.Pa = void 0),
62
+ (this.La = null),
63
+ (this.Dn = null),
61
64
  (this.B = null),
62
- (this.Cn = null),
65
+ (this.au = null),
63
66
  (this.h = null),
64
67
  (this.C = null),
65
68
  (this.j = null),
66
69
  (this.Cs = null),
67
- (this.Ea = ""),
70
+ (this.Ua = ""),
68
71
  (this.isInitialized = !1),
69
- (this.Ia = !1),
70
- (this.Sa = new u()),
71
- (this.Na = new u()),
72
+ (this.Wa = !1),
73
+ (this.Va = new u()),
74
+ (this.Fa = new u()),
72
75
  (this.options = {}),
73
- (this.Oa = []),
74
- (this.Ta = []),
75
- (this.yi = []),
76
- (this.Xh = "6.3.1");
76
+ (this.Ka = []),
77
+ (this.Ga = []),
78
+ (this.Mr = []),
79
+ (this.Ra = "6.4.0");
77
80
  }
78
- Ra(t) {
79
- this.Sa.wt(t);
81
+ $a(t) {
82
+ this.Va.wt(t);
80
83
  }
81
- mh(t) {
82
- this.Na.wt(t);
84
+ Lh(t) {
85
+ this.Fa.wt(t);
83
86
  }
84
87
  initialize(t, i) {
85
88
  if (this.ao())
86
89
  return E.info("Braze has already been initialized with an API key."), !0;
87
90
  this.options = i || {};
88
- let e = this.ee(z.Yo);
89
- const r = ll(no.Ca());
91
+ let e = this.ee(q.$h);
92
+ const r = ll(no.Ha());
90
93
  if (
91
94
  (r && "true" === r.brazeLogging && (e = !0),
92
95
  E.init(e),
@@ -96,46 +99,46 @@ class Jt {
96
99
  null == t || "" === t || "string" != typeof t)
97
100
  )
98
101
  return E.error("Braze requires a valid API key to be initialized."), !1;
99
- this.sn = t;
100
- let n = this.ee(z.Ro);
101
- if (null == n || "" === n || "string" != typeof n)
102
+ this.Pn = t;
103
+ let o = this.ee(q.Wh);
104
+ if (null == o || "" === o || "string" != typeof o)
102
105
  return E.error("Braze requires a valid baseUrl to be initialized."), !1;
103
- !1 === /^https?:/.test(n) && (n = `https://${n}`);
104
- const o = n;
106
+ !1 === /^https?:/.test(o) && (o = `https://${o}`);
107
+ const n = o;
105
108
  if (
106
- ((n = document.createElement("a")),
107
- (n.href = o),
108
- "/" === n.pathname && (n = `${n}api/v3`),
109
- (this.Ea = n.toString()),
110
- ro.Pa && !this.ee(z._o))
109
+ ((o = document.createElement("a")),
110
+ (o.href = n),
111
+ "/" === o.pathname && (o = `${o}api/v3`),
112
+ (this.Ua = o.toString()),
113
+ ro.Ja && !this.ee(q.Ph))
111
114
  )
112
115
  return (
113
116
  E.info("Ignoring activity from crawler bot " + navigator.userAgent),
114
- (this.Ia = !0),
117
+ (this.Wa = !0),
115
118
  !1
116
119
  );
117
- const h = this.ee(z.Wo) || !1;
120
+ const h = this.ee(q.Vh) || !1;
118
121
  if (
119
- ((this.j = Gt.La(t, h)), h && this.j.Da(t), new ee.ne(null, !0).br(s.ie))
122
+ ((this.j = Gt.Ya(t, h)), h && this.j.Xa(t), new ee.ne(null, !0).jr(s.ie))
120
123
  )
121
124
  return (
122
125
  E.info("Ignoring all activity due to previous opt out"),
123
- (this.Ia = !0),
126
+ (this.Wa = !0),
124
127
  !1
125
128
  );
126
129
  for (const t of C(this.options))
127
- -1 === Pt($t).indexOf(t) &&
130
+ -1 === Pt(Jt).indexOf(t) &&
128
131
  E.warn(`Ignoring unknown initialization option '${t}'.`);
129
132
  const a = ["mparticle", "wordpress", "tealium"];
130
- if (null != this.ee(z.Yh)) {
131
- const t = this.ee(z.Yh);
133
+ if (null != this.ee(q.Ta)) {
134
+ const t = this.ee(q.Ta);
132
135
  -1 !== a.indexOf(t)
133
- ? (this.Zh = t)
136
+ ? (this.Pa = t)
134
137
  : E.error("Invalid sdk flavor passed: " + t);
135
138
  }
136
- let l = this.ee($t.Vo);
139
+ let l = this.ee(Jt.Kh);
137
140
  if (null != l)
138
- if (D(l)) {
141
+ if (z(l)) {
139
142
  const t = [];
140
143
  for (let i = 0; i < l.length; i++)
141
144
  ta(
@@ -150,74 +153,75 @@ class Jt {
150
153
  "devicePropertyAllowlist must be an array. Defaulting to all properties.",
151
154
  ),
152
155
  (l = null);
153
- const c = this.ee(z.Jh);
156
+ const c = this.ee(q.Oa);
154
157
  if (c) {
155
158
  const t = new _t(c);
156
- this.j.uu(s.iu.Jh, t);
159
+ this.j.uu(s.iu.Oa, t);
157
160
  }
158
- (this.on = new Ot(this.j, l)),
161
+ (this.Dn = new Ot(this.j, l)),
159
162
  (this.h = new Vt(this.j)),
160
163
  (this.Cs = new bt(this.h, this.j)),
161
- (this.C = new Kt(this.j, this.Cs, this.h, this.ee(z.Wh)));
164
+ (this.C = new Kt(this.j, this.Cs, this.h, this.ee(q.Zh)));
162
165
  const f = new u();
163
166
  return (
164
- (this.Qh = new Bt(this.j, this.ee(z.Xo), f)),
167
+ (this.La = new Bt(this.j, this.ee(q.Yh), f)),
165
168
  this.q(f),
166
169
  (this.B = new Mt(
167
- this.on,
170
+ this.Dn,
168
171
  this.j,
169
- this.Qh,
172
+ this.La,
170
173
  this.Cs,
171
174
  this.C,
172
175
  this.h,
173
- this.sn,
174
- this.Ea,
175
- this.Xh,
176
- this.Zh || "",
177
- this.ee(z.Vh),
178
- this.ee(z.Kh),
176
+ this.Pn,
177
+ this.Ua,
178
+ this.Ra,
179
+ this.Pa || "",
180
+ this.ee(q.Qh),
181
+ this.ee(q.Ia),
179
182
  )),
180
- (this.Cn = new Wt(
181
- this.sn,
182
- this.Ea,
183
+ (this.au = new Wt(
184
+ this.Pn,
185
+ this.Ua,
183
186
  this.C,
184
- this.on,
187
+ this.Dn,
185
188
  this.Cs,
186
189
  this.h,
187
190
  this.j,
188
191
  (t) => {
189
- if (this.ao()) for (const i of this.lr()) i.N(t);
192
+ if (this.ao()) for (const i of this.gr()) i.N(t);
190
193
  },
191
- this.Qh,
194
+ this.La,
192
195
  this.B,
193
196
  )),
194
- this.Cn.initialize(),
195
- h || this.j.Ua(),
197
+ this.au.initialize(),
198
+ h || this.j.Za(),
196
199
  E.info(
197
200
  `Initialized for the Braze backend at "${this.ee(
198
- z.Ro,
199
- )}" with API key "${this.sn}".`,
201
+ q.Wh,
202
+ )}" with API key "${this.Pn}".`,
200
203
  ),
201
- rt.t(),
202
- this.h.Ue(() => {
204
+ ot.t(),
205
+ $t(),
206
+ this.h.$e(() => {
203
207
  var t;
204
208
  this.isInitialized &&
205
- (null === (t = this.h) || void 0 === t ? void 0 : t.Re()) &&
209
+ (null === (t = this.h) || void 0 === t ? void 0 : t.Te()) &&
206
210
  import("../FeatureFlags/refresh-feature-flags.js").then((t) => {
207
211
  if (!this.isInitialized) return;
208
212
  (0, t.default)();
209
213
  });
210
214
  }),
211
- this.Cn.rn(() => {
215
+ this.au.rn(() => {
212
216
  var t;
213
217
  this.isInitialized &&
214
- (null === (t = this.h) || void 0 === t ? void 0 : t.Re()) &&
218
+ (null === (t = this.h) || void 0 === t ? void 0 : t.Te()) &&
215
219
  import("../FeatureFlags/refresh-feature-flags.js").then((t) => {
216
220
  if (!this.isInitialized) return;
217
221
  (0, t.default)(void 0, void 0, !0);
218
222
  });
219
223
  }),
220
- this.Sa.L(this.options),
224
+ this.Va.L(this.options),
221
225
  (this.isInitialized = !0),
222
226
  window.dispatchEvent(new CustomEvent("braze.initialized")),
223
227
  !0
@@ -225,43 +229,43 @@ class Jt {
225
229
  }
226
230
  destroy(t) {
227
231
  if ((E.destroy(), this.ao())) {
228
- this.Na.L(), this.Na.removeAllSubscriptions();
229
- for (const t of this.Oa) t.destroy();
230
- this.Oa = [];
231
- for (const t of this.Ta) t.clearData(!1);
232
+ this.Fa.L(), this.Fa.removeAllSubscriptions();
233
+ for (const t of this.Ka) t.destroy();
234
+ this.Ka = [];
235
+ for (const t of this.Ga) t.clearData(!1);
232
236
  this.B && this.B.fo(),
233
- (this.Ta = []),
237
+ (this.Ga = []),
234
238
  this.removeAllSubscriptions(),
235
- (this.yi = []),
236
- null != this.Cn && this.Cn.destroy(),
237
- (this.Cn = null),
238
- (this.Qh = null),
239
- (this.on = null),
239
+ (this.Mr = []),
240
+ null != this.au && this.au.destroy(),
241
+ (this.au = null),
242
+ (this.La = null),
243
+ (this.Dn = null),
240
244
  (this.B = null),
241
245
  (this.h = null),
242
246
  (this.C = null),
243
247
  (this.Cs = null),
244
248
  (this.options = {}),
245
- (this.Zh = void 0),
249
+ (this.Pa = void 0),
246
250
  (this.isInitialized = !1),
247
- (this.Ia = !1),
251
+ (this.Wa = !1),
248
252
  t && (this.j = null);
249
253
  }
250
254
  }
251
255
  rr() {
252
- return !this.Wa() && (!!this.ao() || (console.warn(w), !1));
256
+ return !this.Qa() && (!!this.ao() || (console.warn(w), !1));
253
257
  }
254
- ba() {
255
- return this.sn;
258
+ Ma() {
259
+ return this.Pn;
256
260
  }
257
261
  Sr() {
258
- return this.Qh;
262
+ return this.La;
259
263
  }
260
264
  V() {
261
- return this.Ea;
265
+ return this.Ua;
262
266
  }
263
267
  de() {
264
- return this.on;
268
+ return this.Dn;
265
269
  }
266
270
  m() {
267
271
  return this.B;
@@ -269,11 +273,11 @@ class Jt {
269
273
  ee(t) {
270
274
  return this.options[t];
271
275
  }
272
- lr() {
273
- return this.Ta;
276
+ gr() {
277
+ return this.Ga;
274
278
  }
275
279
  nn() {
276
- return this.Cn;
280
+ return this.au;
277
281
  }
278
282
  l() {
279
283
  return this.h;
@@ -284,46 +288,50 @@ class Jt {
284
288
  p() {
285
289
  return this.j;
286
290
  }
287
- gr() {
288
- if (this.Cs && this.Cn) return new User(this.Cs, this.Cn);
291
+ br() {
292
+ if (this.Cs && this.au) return new User(this.Cs, this.au);
289
293
  }
290
294
  ir() {
291
295
  return this.Cs;
292
296
  }
293
- tr() {
294
- return !0 === this.ee(z.re);
297
+ nr() {
298
+ return !0 === this.ee(q.re);
295
299
  }
296
300
  g(t) {
297
301
  let i = !1;
298
- for (const s of this.Oa) s === t && (i = !0);
299
- i || this.Oa.push(t);
302
+ for (const s of this.Ka) s === t && (i = !0);
303
+ i || this.Ka.push(t);
300
304
  }
301
305
  v(i) {
302
306
  let s = !1;
303
- for (const t of this.Ta) t.constructor === i.constructor && (s = !0);
304
- i instanceof t && !s && this.Ta.push(i);
307
+ for (const t of this.Ga) t.constructor === i.constructor && (s = !0);
308
+ i instanceof t && !s && this.Ga.push(i);
305
309
  }
306
310
  q(t) {
307
- t instanceof u && this.yi.push(t);
311
+ t instanceof u && this.Mr.push(t);
308
312
  }
309
313
  removeAllSubscriptions() {
310
- if (this.rr()) for (const t of this.yi) t.removeAllSubscriptions();
314
+ if (this.rr()) for (const t of this.Mr) t.removeAllSubscriptions();
311
315
  }
312
316
  removeSubscription(t) {
313
- if (this.rr()) for (const i of this.yi) i.removeSubscription(t);
317
+ if (this.rr()) for (const i of this.Mr) i.removeSubscription(t);
314
318
  }
315
319
  ce(t) {
316
- this.Ia = t;
320
+ this.Wa = t;
317
321
  }
318
322
  ao() {
319
323
  return this.isInitialized;
320
324
  }
321
- Wa() {
322
- return this.Ia;
325
+ Qa() {
326
+ return this.Wa;
327
+ }
328
+ tr(t, i) {
329
+ if (!this.rr()) return null;
330
+ return ir.o().Ki(t, i);
323
331
  }
324
332
  Vs() {
325
- return this.Xh;
333
+ return this.Ra;
326
334
  }
327
335
  }
328
- const r = new Jt();
329
- export { r as default, Jt as BrazeSdkInstance, z as OPTIONS };
336
+ const r = new Yt();
337
+ export { r as default, Yt as BrazeSdkInstance, q as OPTIONS };
@@ -2,41 +2,41 @@ import ro from "../util/browser-detector.js";
2
2
  import Qt from "../models/device.js";
3
3
  import DeviceProperties from "../Core/device-properties.js";
4
4
  import _t from "../models/identifier.js";
5
- import { logger as E, Guid as P } from "../../shared-lib/index.js";
5
+ import { logger as E, Guid as L } from "../../shared-lib/index.js";
6
6
  import { STORAGE_KEYS as s } from "../managers/storage-manager.js";
7
7
  import { values as Pt } from "../util/code-utils.js";
8
8
  import { getErrorMessage as si } from "../util/error-utils.js";
9
9
  export default class Ot {
10
10
  constructor(t, e) {
11
11
  (this.j = t),
12
- (this.Fa = e),
12
+ (this.tc = e),
13
13
  (this.j = t),
14
14
  null == e && (e = Pt(DeviceProperties)),
15
- (this.Fa = e);
15
+ (this.tc = e);
16
16
  }
17
17
  fe(t = !0) {
18
- let e = this.j.tu(s.iu.Jh);
19
- null == e && ((e = new _t(P.oe())), t && this.j.uu(s.iu.Jh, e));
18
+ let e = this.j.tu(s.iu.Oa);
19
+ null == e && ((e = new _t(L.oe())), t && this.j.uu(s.iu.Oa, e));
20
20
  const r = new Qt(e.eu);
21
- for (let t = 0; t < this.Fa.length; t++) {
22
- switch (this.Fa[t]) {
21
+ for (let t = 0; t < this.tc.length; t++) {
22
+ switch (this.tc[t]) {
23
23
  case DeviceProperties.BROWSER:
24
24
  r.browser = ro.browser;
25
25
  break;
26
26
  case DeviceProperties.BROWSER_VERSION:
27
- r.Ga = ro.version;
27
+ r.ec = ro.version;
28
28
  break;
29
29
  case DeviceProperties.OS:
30
- r.os = this.Ja();
30
+ r.os = this.rc();
31
31
  break;
32
32
  case DeviceProperties.RESOLUTION:
33
- r.Ba = screen.width + "x" + screen.height;
33
+ r.sc = screen.width + "x" + screen.height;
34
34
  break;
35
35
  case DeviceProperties.LANGUAGE:
36
36
  r.language = ro.language;
37
37
  break;
38
38
  case DeviceProperties.TIME_ZONE:
39
- r.timeZone = this.Ha(new Date());
39
+ r.timeZone = this.oc(new Date());
40
40
  break;
41
41
  case DeviceProperties.USER_AGENT:
42
42
  r.userAgent = ro.userAgent;
@@ -44,12 +44,12 @@ export default class Ot {
44
44
  }
45
45
  return r;
46
46
  }
47
- Ja() {
48
- if (ro.Ka()) return ro.Ka();
49
- const t = this.j.lt(s.ct.Qa);
50
- return t && t.os_version ? t.os_version : ro.Ja();
47
+ rc() {
48
+ if (ro.nc()) return ro.nc();
49
+ const t = this.j.lt(s.ct.ac);
50
+ return t && t.os_version ? t.os_version : ro.rc();
51
51
  }
52
- Ha(t) {
52
+ oc(t) {
53
53
  let e = !1;
54
54
  if ("undefined" != typeof Intl && "function" == typeof Intl.DateTimeFormat)
55
55
  try {
@@ -66,9 +66,9 @@ export default class Ot {
66
66
  }
67
67
  if (e) return "";
68
68
  const r = t.getTimezoneOffset();
69
- return this.Va(r);
69
+ return this.cc(r);
70
70
  }
71
- Va(t) {
71
+ cc(t) {
72
72
  const e = Math.trunc(t / 60),
73
73
  r = Math.trunc(t % 60);
74
74
  let s = "GMT";