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