@braze/web-sdk 4.8.3 → 4.10.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 (153) hide show
  1. package/index.d.ts +2247 -2071
  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 +23 -22
  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 +14 -13
  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 +9 -7
  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 +63 -62
  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 +132 -130
  102. package/src/managers/device-manager.js +22 -22
  103. package/src/managers/network-manager.js +103 -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 +134 -131
  108. package/src/managers/subscription-manager.js +7 -7
  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 +197 -180
  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 +65 -61
  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 +52 -56
  126. package/src/triggers/models/trigger-events.js +3 -3
  127. package/src/triggers/models/trigger.js +50 -38
  128. package/src/triggers/triggers-provider-factory.js +10 -6
  129. package/src/triggers/triggers-provider.js +204 -186
  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/util/base-device-parser.js +1 -1
  135. package/src/util/braze-actions.js +35 -30
  136. package/src/util/browser-detector.js +30 -31
  137. package/src/util/client-hints-parser.js +28 -22
  138. package/src/util/code-utils.js +22 -21
  139. package/src/util/color-utils.js +19 -13
  140. package/src/util/component-utils.js +4 -4
  141. package/src/util/date-utils.js +6 -5
  142. package/src/util/device-constants.js +10 -10
  143. package/src/util/dom-utils.js +28 -24
  144. package/src/util/error-utils.js +1 -1
  145. package/src/util/key-codes.js +1 -1
  146. package/src/util/net.js +53 -57
  147. package/src/util/request-header-utils.js +34 -11
  148. package/src/util/string-utils.js +14 -14
  149. package/src/util/types.js +1 -0
  150. package/src/util/url-utils.js +1 -4
  151. package/src/util/user-agent-parser.js +39 -39
  152. package/src/util/validation-utils.js +34 -34
  153. package/src/util/window-utils.js +11 -12
@@ -1,4 +1,4 @@
1
- import jt from "./auth-manager.js";
1
+ import kt from "./auth-manager.js";
2
2
  import y from "../common/base-provider.js";
3
3
  import V from "../util/browser-detector.js";
4
4
  import Ot from "./device-manager.js";
@@ -7,11 +7,11 @@ import {
7
7
  isArray as p,
8
8
  keys as oo,
9
9
  validateValueIsFromEnum as H,
10
- values as Lt
10
+ values as Pt,
11
11
  } from "../util/code-utils.js";
12
12
  import { logDeprecationWarning as z } from "../util/deprecation-utils.js";
13
- import Pt from "./network-manager.js";
14
- import Rt from "../request-controller.js";
13
+ import Rt from "./network-manager.js";
14
+ import Lt from "../request-controller.js";
15
15
  import Mt from "./server-config-manager.js";
16
16
  import Dt from "./session-manager.js";
17
17
  import r from "../../shared-lib/braze-shared-lib.js";
@@ -29,75 +29,76 @@ const L = {
29
29
  Eo: "baseUrl",
30
30
  _o: "noCookies",
31
31
  Io: "devicePropertyAllowlist",
32
- ia: "disablePushTokenMaintenance",
32
+ Aa: "disablePushTokenMaintenance",
33
33
  Ao: "enableLogging",
34
34
  So: "enableSdkAuthentication",
35
- ta: "manageServiceWorkerExternally",
35
+ qa: "manageServiceWorkerExternally",
36
36
  No: "minimumIntervalBetweenTriggerActionsInSeconds",
37
37
  wo: "sessionTimeoutInSeconds",
38
- To: "appVersion",
39
- na: "serviceWorkerLocation",
40
- ra: "safariWebsitePushId",
41
- Mn: "localization",
42
- lo: "contentSecurityNonce",
43
- Oo: "enableHtmlInAppMessages",
38
+ Oo: "appVersion",
39
+ Po: "appVersionNumber",
40
+ _a: "serviceWorkerLocation",
41
+ ka: "safariWebsitePushId",
42
+ Ba: "localization",
43
+ po: "contentSecurityNonce",
44
+ Ro: "enableHtmlInAppMessages",
44
45
  Co: "allowUserSuppliedJavascript",
45
- mo: "inAppMessageZIndex",
46
- po: "openInAppMessagesInNewTab",
46
+ lo: "inAppMessageZIndex",
47
+ fo: "openInAppMessagesInNewTab",
47
48
  tn: "openCardsInNewTab",
48
49
  en: "openNewsFeedCardsInNewTab",
49
- Lh: "requireExplicitInAppMessageDismissal",
50
+ mh: "requireExplicitInAppMessageDismissal",
50
51
  Lo: "doNotLoadFontAwesome",
51
- Po: "sdkFlavor"
52
+ Mo: "sdkFlavor",
52
53
  };
53
54
  class Wt {
54
55
  constructor() {
55
- (this.Xr = ""),
56
- (this.Ro = ""),
57
- (this.Mo = void 0),
58
- (this.jo = null),
59
- (this.Zr = null),
56
+ (this.cn = ""),
57
+ (this.jo = ""),
58
+ (this.Do = void 0),
59
+ (this.Uo = null),
60
+ (this.fn = null),
60
61
  (this.gt = null),
61
- (this.Ci = null),
62
+ (this.ki = null),
62
63
  (this.wt = null),
63
64
  (this._e = null),
64
65
  (this.u = null),
65
66
  (this.ft = null),
66
- (this.Do = ""),
67
- (this.Uo = !1),
68
- (this.Bo = !1),
69
- (this.Wo = new E()),
70
- (this.zo = new E()),
67
+ (this.Bo = ""),
68
+ (this.Wo = !1),
69
+ (this.zo = !1),
70
+ (this.Vo = new E()),
71
+ (this.Go = new E()),
71
72
  (this.options = {}),
72
- (this.Vo = []),
73
- (this.Go = []),
74
- (this.Se = []),
75
- (this.Ro = "4.8.3");
73
+ (this.Ko = []),
74
+ (this.Ho = []),
75
+ (this.Ve = []),
76
+ (this.jo = "4.10.0");
76
77
  }
77
- Ko(t) {
78
- this.Wo.lt(t);
78
+ $o(t) {
79
+ this.Vo.lt(t);
79
80
  }
80
- Nh(t) {
81
- this.zo.lt(t);
81
+ Rh(t) {
82
+ this.Go.lt(t);
82
83
  }
83
84
  initialize(t, s) {
84
- if (this.ue())
85
+ if (this.fe())
85
86
  return (
86
87
  r.j.info("Braze has already been initialized with an API key."), !0
87
88
  );
88
89
  this.options = s || {};
89
90
  let e = this.nn(L.Ao);
90
- const n = ct(Z.jn());
91
+ const n = ct(Z.Cn());
91
92
  if (
92
93
  (n && "true" === n.brazeLogging && (e = !0),
93
94
  r.j.init(e),
94
95
  r.j.info(
95
- `Initialization Options: ${JSON.stringify(this.options, null, 2)}`
96
+ `Initialization Options: ${JSON.stringify(this.options, null, 2)}`,
96
97
  ),
97
98
  null == t || "" === t || "string" != typeof t)
98
99
  )
99
100
  return r.j.error("Braze requires a valid API key to be initialized."), !1;
100
- this.Xr = t;
101
+ this.cn = t;
101
102
  let o = this.nn(L.Eo);
102
103
  if (null == o || "" === o || "string" != typeof o)
103
104
  return r.j.error("Braze requires a valid baseUrl to be initialized."), !1;
@@ -107,34 +108,34 @@ class Wt {
107
108
  ((o = document.createElement("a")),
108
109
  (o.href = h),
109
110
  "/" === o.pathname && (o = `${o}api/v3`),
110
- (this.Do = o.toString()),
111
- V.Ho && !this.nn(L.ho))
111
+ (this.Bo = o.toString()),
112
+ V.qo && !this.nn(L.ho))
112
113
  )
113
114
  return (
114
115
  r.j.info("Ignoring activity from crawler bot " + navigator.userAgent),
115
- (this.Bo = !0),
116
+ (this.zo = !0),
116
117
  !1
117
118
  );
118
119
  const a = this.nn(L._o) || !1;
119
120
  if (
120
- ((this.u = Bt.$o(t, a)), a && this.u.qo(t), new O.ee(null, !0).wr(i.ne))
121
+ ((this.u = Bt.xo(t, a)), a && this.u.Jo(t), new O.ee(null, !0).jr(i.re))
121
122
  )
122
123
  return (
123
124
  r.j.info("Ignoring all activity due to previous opt out"),
124
- (this.Bo = !0),
125
+ (this.zo = !0),
125
126
  !1
126
127
  );
127
128
  for (const t of oo(this.options))
128
- -1 === Lt(r.xo).indexOf(t) &&
129
+ -1 === Pt(r.Yo).indexOf(t) &&
129
130
  r.j.warn(`Ignoring unknown initialization option '${t}'.`);
130
131
  const l = ["mparticle", "wordpress", "tealium"];
131
- if (null != this.nn(L.Po)) {
132
- const t = this.nn(L.Po);
132
+ if (null != this.nn(L.Mo)) {
133
+ const t = this.nn(L.Mo);
133
134
  -1 !== l.indexOf(t)
134
- ? (this.Mo = t)
135
+ ? (this.Do = t)
135
136
  : r.j.error("Invalid sdk flavor passed: " + t);
136
137
  }
137
- let u = this.nn(r.xo.Io);
138
+ let u = this.nn(r.Yo.Io);
138
139
  if (null != u)
139
140
  if (p(u)) {
140
141
  const t = [];
@@ -143,125 +144,126 @@ class Wt {
143
144
  DeviceProperties,
144
145
  u[i],
145
146
  "devicePropertyAllowlist contained an invalid value.",
146
- "DeviceProperties"
147
+ "DeviceProperties",
147
148
  ) && t.push(u[i]);
148
149
  u = t;
149
150
  } else
150
151
  r.j.error(
151
- "devicePropertyAllowlist must be an array. Defaulting to all properties."
152
+ "devicePropertyAllowlist must be an array. Defaulting to all properties.",
152
153
  ),
153
154
  (u = null);
154
- (this.Zr = new Ot(this.u, u)),
155
+ (this.fn = new Ot(this.u, u)),
155
156
  (this.wt = new Mt(this.u)),
156
157
  (this.ft = new bt(this.wt, this.u)),
157
158
  (this._e = new Dt(this.u, this.ft, this.wt, this.nn(L.wo)));
158
159
  const f = new E();
159
160
  return (
160
- (this.jo = new jt(this.u, this.nn(L.So), f)),
161
+ (this.Uo = new kt(this.u, this.nn(L.So), f)),
161
162
  this.jt(f),
162
- (this.gt = new Pt(
163
- this.Zr,
163
+ (this.gt = new Rt(
164
+ this.fn,
164
165
  this.u,
165
- this.jo,
166
+ this.Uo,
166
167
  this.ft,
167
168
  this._e,
168
169
  this.wt,
169
- this.Xr,
170
- this.Do,
171
- this.Ro,
172
- this.Mo || "",
173
- this.nn(L.To)
170
+ this.cn,
171
+ this.Bo,
172
+ this.jo,
173
+ this.Do || "",
174
+ this.nn(L.Oo),
175
+ this.nn(L.Po),
174
176
  )),
175
- (this.Ci = new Rt(
176
- this.Xr,
177
- this.Do,
177
+ (this.ki = new Lt(
178
+ this.cn,
179
+ this.Bo,
178
180
  this._e,
179
- this.Zr,
181
+ this.fn,
180
182
  this.ft,
181
183
  this.wt,
182
184
  this.u,
183
- t => {
184
- if (this.ue()) for (const i of this.gr()) i.Ts(t);
185
+ (t) => {
186
+ if (this.fe()) for (const i of this.gr()) i.Ts(t);
185
187
  },
186
- this.jo,
187
- this.gt
188
+ this.Uo,
189
+ this.gt,
188
190
  )),
189
- this.Ci.initialize(),
191
+ this.ki.initialize(),
190
192
  r.j.info(
191
193
  `Initialized for the Braze backend at "${this.nn(
192
- L.Eo
193
- )}" with API key "${this.Xr}".`
194
+ L.Eo,
195
+ )}" with API key "${this.cn}".`,
194
196
  ),
195
- null != this.nn(L.Oo) &&
197
+ null != this.nn(L.Ro) &&
196
198
  z(
197
199
  "enableHtmlInAppMessages",
198
200
  "initialization option",
199
- "allowUserSuppliedJavascript"
201
+ "allowUserSuppliedJavascript",
200
202
  ),
201
- et.init(),
202
- this.wt.Ni(() => {
203
- this.Uo &&
203
+ et.o(),
204
+ this.wt.Ci(() => {
205
+ this.Wo &&
204
206
  this.wt &&
205
- this.wt.bi() &&
206
- import("../FeatureFlags/refresh-feature-flags.js").then(t => {
207
- if (!this.Uo) return;
207
+ this.wt.vi() &&
208
+ import("../FeatureFlags/refresh-feature-flags.js").then((t) => {
209
+ if (!this.Wo) return;
208
210
  (0, t.default)();
209
211
  });
210
212
  }),
211
- this.Ci.pr(() => {
212
- this.Uo &&
213
+ this.ki.pr(() => {
214
+ this.Wo &&
213
215
  this.wt &&
214
- this.wt.bi() &&
215
- import("../FeatureFlags/refresh-feature-flags.js").then(t => {
216
- if (!this.Uo) return;
216
+ this.wt.vi() &&
217
+ import("../FeatureFlags/refresh-feature-flags.js").then((t) => {
218
+ if (!this.Wo) return;
217
219
  (0, t.default)(void 0, void 0, !0);
218
220
  });
219
221
  }),
220
- this.Wo.Et(this.options),
221
- (this.Uo = !0),
222
+ this.Vo.Et(this.options),
223
+ (this.Wo = !0),
222
224
  !0
223
225
  );
224
226
  }
225
227
  destroy(t) {
226
- if ((r.j.destroy(), this.ue())) {
227
- this.zo.Et(), this.zo.removeAllSubscriptions();
228
- for (const t of this.Vo) t.destroy();
229
- this.Vo = [];
230
- for (const t of this.Go) t.clearData(!1);
231
- (this.Go = []),
228
+ if ((r.j.destroy(), this.fe())) {
229
+ this.Go.Et(), this.Go.removeAllSubscriptions();
230
+ for (const t of this.Ko) t.destroy();
231
+ this.Ko = [];
232
+ for (const t of this.Ho) t.clearData(!1);
233
+ (this.Ho = []),
232
234
  this.removeAllSubscriptions(),
233
- (this.Se = []),
234
- null != this.Ci && this.Ci.destroy(),
235
- (this.Ci = null),
236
- (this.jo = null),
237
- (this.Zr = null),
235
+ (this.Ve = []),
236
+ null != this.ki && this.ki.destroy(),
237
+ (this.ki = null),
238
+ (this.Uo = null),
239
+ (this.fn = null),
238
240
  (this.gt = null),
239
241
  (this.wt = null),
240
242
  (this._e = null),
241
243
  (this.ft = null),
242
244
  (this.options = {}),
243
- (this.Mo = void 0),
244
- (this.Uo = !1),
245
- (this.Bo = !1),
245
+ (this.Do = void 0),
246
+ (this.Wo = !1),
247
+ (this.zo = !1),
246
248
  t && (this.u = null);
247
249
  }
248
250
  }
249
251
  rr() {
250
- if (this.Jo()) return !1;
251
- if (!this.ue()) throw new Error(P);
252
+ if (this.Xo()) return !1;
253
+ if (!this.fe()) throw new Error(P);
252
254
  return !0;
253
255
  }
254
- ea() {
255
- return this.Xr;
256
+ Ma() {
257
+ return this.cn;
256
258
  }
257
259
  Sr() {
258
- return this.jo;
260
+ return this.Uo;
259
261
  }
260
- Zs() {
261
- return this.Do;
262
+ Ys() {
263
+ return this.Bo;
262
264
  }
263
- ie() {
264
- return this.Zr;
265
+ te() {
266
+ return this.fn;
265
267
  }
266
268
  ar() {
267
269
  return this.gt;
@@ -270,10 +272,10 @@ class Wt {
270
272
  return this.options[t];
271
273
  }
272
274
  gr() {
273
- return this.Go;
275
+ return this.Ho;
274
276
  }
275
277
  cr() {
276
- return this.Ci;
278
+ return this.ki;
277
279
  }
278
280
  tr() {
279
281
  return this.wt;
@@ -284,45 +286,45 @@ class Wt {
284
286
  l() {
285
287
  return this.u;
286
288
  }
287
- jr() {
288
- if (this.ft && this.Ci) return new User(this.ft, this.Ci);
289
+ br() {
290
+ if (this.ft && this.ki) return new User(this.ft, this.ki);
289
291
  }
290
292
  ir() {
291
293
  return this.ft;
292
294
  }
293
295
  nr() {
294
- return !0 === this.nn(L.Co) || !0 === this.nn(L.Oo);
296
+ return !0 === this.nn(L.Co) || !0 === this.nn(L.Ro);
295
297
  }
296
298
  g(t) {
297
299
  let i = !1;
298
- for (const s of this.Vo) s === t && (i = !0);
299
- i || this.Vo.push(t);
300
+ for (const s of this.Ko) s === t && (i = !0);
301
+ i || this.Ko.push(t);
300
302
  }
301
303
  dr(t) {
302
304
  let i = !1;
303
- for (const s of this.Go) s.constructor === t.constructor && (i = !0);
304
- t instanceof y && !i && this.Go.push(t);
305
+ for (const s of this.Ho) s.constructor === t.constructor && (i = !0);
306
+ t instanceof y && !i && this.Ho.push(t);
305
307
  }
306
308
  jt(t) {
307
- t instanceof E && this.Se.push(t);
309
+ t instanceof E && this.Ve.push(t);
308
310
  }
309
311
  removeAllSubscriptions() {
310
- if (this.rr()) for (const t of this.Se) t.removeAllSubscriptions();
312
+ if (this.rr()) for (const t of this.Ve) t.removeAllSubscriptions();
311
313
  }
312
314
  removeSubscription(t) {
313
- if (this.rr()) for (const i of this.Se) i.removeSubscription(t);
315
+ if (this.rr()) for (const i of this.Ve) i.removeSubscription(t);
314
316
  }
315
- ae(t) {
316
- this.Bo = t;
317
+ ne(t) {
318
+ this.zo = t;
317
319
  }
318
- ue() {
319
- return this.Uo;
320
+ fe() {
321
+ return this.Wo;
320
322
  }
321
- Jo() {
322
- return this.Bo;
323
+ Xo() {
324
+ return this.zo;
323
325
  }
324
- Us() {
325
- return this.Ro;
326
+ ks() {
327
+ return this.jo;
326
328
  }
327
329
  }
328
330
  const e = new Wt();
@@ -4,52 +4,52 @@ import DeviceProperties from "../Core/device-properties.js";
4
4
  import _t from "../models/identifier.js";
5
5
  import r from "../../shared-lib/braze-shared-lib.js";
6
6
  import { STORAGE_KEYS as i } from "../managers/storage-manager.js";
7
- import { values as Lt } from "../util/code-utils.js";
7
+ import { values as Pt } from "../util/code-utils.js";
8
8
  import { getErrorMessage as ei } from "../util/error-utils.js";
9
9
  export default class Ot {
10
10
  constructor(t, e) {
11
11
  (this.u = t),
12
12
  (this.Qo = e),
13
13
  (this.u = t),
14
- null == e && (e = Lt(DeviceProperties)),
14
+ null == e && (e = Pt(DeviceProperties)),
15
15
  (this.Qo = e);
16
16
  }
17
- te() {
18
- let t = this.u.tu(i.eu.Xo);
19
- null == t && ((t = new _t(r.Z.Y())), this.u.uu(i.eu.Xo, t));
20
- const e = new xt(t.iu);
17
+ ce(t = !0) {
18
+ let e = this.u.tu(i.eu.Zo);
19
+ null == e && ((e = new _t(r.Z.Y())), t && this.u.uu(i.eu.Zo, e));
20
+ const s = new xt(e.iu);
21
21
  for (let t = 0; t < this.Qo.length; t++) {
22
22
  switch (this.Qo[t]) {
23
23
  case DeviceProperties.BROWSER:
24
- e.browser = V.browser;
24
+ s.browser = V.browser;
25
25
  break;
26
26
  case DeviceProperties.BROWSER_VERSION:
27
- e.Yo = V.version;
27
+ s.Ia = V.version;
28
28
  break;
29
29
  case DeviceProperties.OS:
30
- e.os = this.Zo();
30
+ s.os = this.Ta();
31
31
  break;
32
32
  case DeviceProperties.RESOLUTION:
33
- e.sa = screen.width + "x" + screen.height;
33
+ s.Da = screen.width + "x" + screen.height;
34
34
  break;
35
35
  case DeviceProperties.LANGUAGE:
36
- e.language = V.language;
36
+ s.language = V.language;
37
37
  break;
38
38
  case DeviceProperties.TIME_ZONE:
39
- e.timeZone = this.oa(new Date());
39
+ s.timeZone = this.Oa(new Date());
40
40
  break;
41
41
  case DeviceProperties.USER_AGENT:
42
- e.userAgent = V.userAgent;
42
+ s.userAgent = V.userAgent;
43
43
  }
44
44
  }
45
- return e;
45
+ return s;
46
46
  }
47
- Zo() {
48
- if (V.ca()) return V.ca();
49
- const t = this.u.v(i.k.la);
50
- return t && t.os_version ? t.os_version : V.Zo();
47
+ Ta() {
48
+ if (V.Ca()) return V.Ca();
49
+ const t = this.u.v(i.k.Fa);
50
+ return t && t.os_version ? t.os_version : V.Ta();
51
51
  }
52
- oa(t) {
52
+ Oa(t) {
53
53
  let e = !1;
54
54
  if ("undefined" != typeof Intl && "function" == typeof Intl.DateTimeFormat)
55
55
  try {
@@ -60,15 +60,15 @@ export default class Ot {
60
60
  } catch (t) {
61
61
  r.j.info(
62
62
  "Intl.DateTimeFormat threw an error, cannot detect user's time zone:" +
63
- ei(t)
63
+ ei(t),
64
64
  ),
65
65
  (e = !0);
66
66
  }
67
67
  if (e) return "";
68
68
  const s = t.getTimezoneOffset();
69
- return this.fa(s);
69
+ return this.Ga(s);
70
70
  }
71
- fa(t) {
71
+ Ga(t) {
72
72
  const e = Math.trunc(t / 60),
73
73
  r = Math.trunc(t % 60);
74
74
  let s = "GMT";