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