@braze/web-sdk 5.9.1 → 6.1.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 (176) hide show
  1. package/index.d.ts +209 -283
  2. package/package.json +1 -1
  3. package/shared-lib/encoding-utils.js +1 -1
  4. package/shared-lib/event-types.js +27 -29
  5. package/shared-lib/guid.js +3 -3
  6. package/shared-lib/indexed-db-adapter.js +22 -22
  7. package/shared-lib/logger.js +18 -18
  8. package/shared-lib/supported-options.js +22 -23
  9. package/src/Banner/banner-factory.js +2 -1
  10. package/src/Banner/banner-provider-factory.js +7 -7
  11. package/src/Banner/banner-provider.js +92 -98
  12. package/src/Banner/banner.js +21 -18
  13. package/src/Banner/display/banner-to-html.js +18 -30
  14. package/src/Banner/display/detect-banner-impressions.js +11 -11
  15. package/src/Banner/get-all-banners.js +5 -5
  16. package/src/Banner/get-banner.js +7 -7
  17. package/src/Banner/index.js +0 -1
  18. package/src/Banner/log-banner-click.js +7 -7
  19. package/src/Banner/log-banner-impressions.js +9 -9
  20. package/src/Banner/request-banners-refresh.js +23 -27
  21. package/src/Banner/subscribe-to-banners-updates.js +9 -9
  22. package/src/Banner/ui/insert-banner.js +10 -10
  23. package/src/Card/card-manager-factory.js +7 -7
  24. package/src/Card/card-manager.js +45 -47
  25. package/src/Card/display/card-display.js +76 -74
  26. package/src/Card/index.js +0 -2
  27. package/src/Card/log-card-dismissal.js +4 -4
  28. package/src/Card/log-content-card-click.js +9 -2
  29. package/src/Card/log-content-card-impressions.js +11 -2
  30. package/src/Card/models/captioned-image.js +21 -21
  31. package/src/Card/models/card.js +116 -110
  32. package/src/Card/models/classic-card.js +21 -21
  33. package/src/Card/models/control-card.js +15 -15
  34. package/src/Card/models/image-only.js +20 -21
  35. package/src/Card/util/card-factory.js +58 -79
  36. package/src/ContentCards/content-cards-provider-factory.js +13 -13
  37. package/src/ContentCards/content-cards-provider.js +148 -148
  38. package/src/ContentCards/content-cards.js +21 -13
  39. package/src/ContentCards/get-cached-content-cards.js +2 -2
  40. package/src/ContentCards/request-content-cards-refresh.js +2 -2
  41. package/src/ContentCards/subscribe-to-content-cards-updates.js +8 -8
  42. package/src/ContentCards/ui/hide-content-cards.js +5 -5
  43. package/src/ContentCards/ui/show-content-cards.js +35 -35
  44. package/src/Core/add-sdk-metadata.js +5 -5
  45. package/src/Core/change-user.js +7 -7
  46. package/src/Core/destroy.js +2 -2
  47. package/src/Core/disable-sdk.js +10 -10
  48. package/src/Core/enable-sdk.js +7 -7
  49. package/src/Core/get-device-id.js +4 -4
  50. package/src/Core/get-user.js +1 -1
  51. package/src/Core/handle-braze-action.js +10 -10
  52. package/src/Core/is-disabled.js +2 -2
  53. package/src/Core/is-initialized.js +1 -1
  54. package/src/Core/log-custom-event.js +18 -18
  55. package/src/Core/log-purchase.js +19 -19
  56. package/src/Core/open-session.js +13 -13
  57. package/src/Core/request-immediate-data-flush.js +1 -1
  58. package/src/Core/set-logger.js +2 -2
  59. package/src/Core/toggle-logging.js +2 -2
  60. package/src/Core/wipe-data.js +9 -9
  61. package/src/FeatureFlags/feature-flag-factory.js +10 -10
  62. package/src/FeatureFlags/feature-flag.js +20 -71
  63. package/src/FeatureFlags/feature-flags-provider-factory.js +7 -7
  64. package/src/FeatureFlags/feature-flags-provider.js +86 -86
  65. package/src/FeatureFlags/get-all-feature-flags.js +3 -3
  66. package/src/FeatureFlags/get-feature-flag.js +3 -3
  67. package/src/FeatureFlags/log-feature-flag-impression.js +8 -8
  68. package/src/FeatureFlags/refresh-feature-flags.js +1 -1
  69. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +3 -3
  70. package/src/InAppMessage/defer-in-app-message.js +4 -4
  71. package/src/InAppMessage/display/html-message-to-html.js +41 -41
  72. package/src/InAppMessage/display/in-app-message-to-html.js +145 -139
  73. package/src/InAppMessage/display/modal-utils.js +40 -42
  74. package/src/InAppMessage/get-deferred-in-app-message.js +1 -1
  75. package/src/InAppMessage/in-app-message-factory.js +24 -16
  76. package/src/InAppMessage/in-app-message-manager-factory.js +5 -5
  77. package/src/InAppMessage/in-app-message-manager.js +124 -122
  78. package/src/InAppMessage/log-in-app-message-button-click.js +12 -12
  79. package/src/InAppMessage/log-in-app-message-click.js +9 -9
  80. package/src/InAppMessage/log-in-app-message-html-click.js +11 -11
  81. package/src/InAppMessage/log-in-app-message-impression.js +4 -4
  82. package/src/InAppMessage/models/control-message.js +5 -5
  83. package/src/InAppMessage/models/full-screen-message.js +41 -35
  84. package/src/InAppMessage/models/html-message.js +28 -26
  85. package/src/InAppMessage/models/in-app-message-button.js +5 -5
  86. package/src/InAppMessage/models/in-app-message.js +156 -152
  87. package/src/InAppMessage/models/modal-message.js +40 -34
  88. package/src/InAppMessage/models/slide-up-message.js +38 -32
  89. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  90. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  91. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
  92. package/src/InAppMessage/ui/show-in-app-message.js +68 -74
  93. package/src/Push/is-push-blocked.js +2 -2
  94. package/src/Push/is-push-permission-granted.js +2 -2
  95. package/src/Push/is-push-supported.js +2 -2
  96. package/src/Push/push-manager-factory.js +17 -17
  97. package/src/Push/push-manager.js +127 -127
  98. package/src/Push/request-push-permission.js +1 -1
  99. package/src/Push/utils/push-utils.js +25 -15
  100. package/src/User/user-manager.js +20 -20
  101. package/src/User/user.js +60 -61
  102. package/src/common/base-provider.js +1 -1
  103. package/src/common/content-cards-display.js +211 -0
  104. package/src/common/event-logger.js +12 -12
  105. package/src/common/properties-base.js +56 -0
  106. package/src/index.js +0 -1
  107. package/src/l10n/l10n-manager-factory.js +10 -10
  108. package/src/l10n/l10n-manager.js +7 -7
  109. package/src/managers/auth-manager.js +36 -36
  110. package/src/managers/braze-instance.js +184 -185
  111. package/src/managers/device-manager.js +26 -26
  112. package/src/managers/network-manager.js +194 -193
  113. package/src/managers/server-config-manager.js +75 -75
  114. package/src/managers/session-manager.js +29 -29
  115. package/src/managers/storage-manager-factory.js +13 -13
  116. package/src/managers/storage-manager.js +162 -164
  117. package/src/managers/subscription-manager.js +12 -12
  118. package/src/managers/utils.js +1 -1
  119. package/src/models/backend-errors.js +5 -5
  120. package/src/models/braze-event.js +16 -16
  121. package/src/models/device.js +3 -3
  122. package/src/models/identifier.js +8 -8
  123. package/src/models/push-token.js +10 -10
  124. package/src/models/request-result.js +4 -4
  125. package/src/models/server-config.js +33 -33
  126. package/src/request-controller.js +193 -192
  127. package/src/triggers/models/custom-event-data.js +7 -7
  128. package/src/triggers/models/custom-event-property-data.js +8 -8
  129. package/src/triggers/models/filter-set.js +8 -8
  130. package/src/triggers/models/filter.js +43 -43
  131. package/src/triggers/models/in-app-message-click-data.js +4 -4
  132. package/src/triggers/models/purchase-data.js +2 -2
  133. package/src/triggers/models/purchase-property-data.js +6 -6
  134. package/src/triggers/models/push-click-data.js +2 -2
  135. package/src/triggers/models/trigger-condition.js +52 -52
  136. package/src/triggers/models/trigger-events.js +4 -4
  137. package/src/triggers/models/trigger.js +19 -19
  138. package/src/triggers/triggers-provider-factory.js +14 -14
  139. package/src/triggers/triggers-provider.js +70 -70
  140. package/src/ui/js/attach-css.js +3 -3
  141. package/src/ui/js/banner-css.js +1 -1
  142. package/src/ui/js/iam-css.js +1 -1
  143. package/src/ui/js/load-font-awesome.js +2 -2
  144. package/src/util/base-device-parser.js +4 -4
  145. package/src/util/braze-actions.js +12 -18
  146. package/src/util/browser-detector.js +27 -20
  147. package/src/util/client-hints-parser.js +8 -8
  148. package/src/util/code-utils.js +2 -2
  149. package/src/util/component-utils.js +14 -14
  150. package/src/util/deprecation-utils.js +2 -2
  151. package/src/util/device-constants.js +5 -5
  152. package/src/util/dom-utils.js +9 -9
  153. package/src/util/html-display-utils.js +38 -38
  154. package/src/util/key-codes.js +1 -1
  155. package/src/util/net.js +12 -12
  156. package/src/util/request-header-utils.js +22 -22
  157. package/src/util/string-utils.js +2 -2
  158. package/src/util/user-agent-parser.js +17 -17
  159. package/src/util/validation-utils.js +28 -28
  160. package/src/util/window-utils.js +2 -2
  161. package/src/Card/log-card-click.js +0 -11
  162. package/src/Card/log-card-impressions.js +0 -13
  163. package/src/Feed/feed-provider-factory.js +0 -18
  164. package/src/Feed/feed-provider.js +0 -90
  165. package/src/Feed/feed.js +0 -20
  166. package/src/Feed/get-cached-feed.js +0 -5
  167. package/src/Feed/index.js +0 -8
  168. package/src/Feed/log-feed-displayed.js +0 -7
  169. package/src/Feed/request-feed-refresh.js +0 -5
  170. package/src/Feed/subscribe-to-feed-updates.js +0 -5
  171. package/src/Feed/types.js +0 -1
  172. package/src/Feed/ui/hide-feed.js +0 -7
  173. package/src/Feed/ui/show-feed.js +0 -96
  174. package/src/Feed/ui/toggle-feed.js +0 -8
  175. package/src/common/base-feed.js +0 -29
  176. package/src/common/feed-display.js +0 -211
@@ -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 E, IndexedDBAdapter as et } from "../../shared-lib/index.js";
4
+ export default class Bt {
5
5
  constructor(t, i, s) {
6
- (this.C = t),
7
- (this.gh = i),
8
- (this.Fh = s),
9
- (this.C = t),
10
- (this.gh = i || !1),
11
- (this.Fh = s),
12
- (this.kh = new u()),
13
- (this.fh = 0),
14
- (this.wh = 1);
15
- }
16
- jh() {
17
- return this.gh;
18
- }
19
- xh() {
20
- return this.C.ft(s.gt.qh);
6
+ (this.j = t),
7
+ (this.Zn = i),
8
+ (this.gh = s),
9
+ (this.j = t),
10
+ (this.Zn = i || !1),
11
+ (this.gh = s),
12
+ (this.ph = new u()),
13
+ (this.Fh = 0),
14
+ (this.kh = 1);
15
+ }
16
+ fh() {
17
+ return this.Zn;
18
+ }
19
+ wh() {
20
+ return this.j.lt(s.ct.jh);
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.wh();
24
+ this.j.ft(s.ct.jh, t);
25
+ const e = et.Us.Rs;
26
+ new et(e, E).setItem(e.Fs.xh, this.kh, t), i !== t && this.Z();
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
+ qh() {
29
+ this.j.Nt(s.ct.jh);
30
+ const t = et.Us.Rs;
31
+ new et(t, E).be(t.Fs.xh, this.kh);
32
32
  }
33
33
  subscribeToSdkAuthenticationFailures(t) {
34
- return this.Fh.Dt(t);
34
+ return this.gh.wt(t);
35
35
  }
36
- Gh(t) {
37
- this.Fh.X(t);
36
+ yh(t) {
37
+ this.gh.L(t);
38
38
  }
39
- Hh() {
40
- this.kh.removeAllSubscriptions();
39
+ Bh() {
40
+ this.ph.removeAllSubscriptions();
41
41
  }
42
- Jh() {
43
- this.fh += 1;
42
+ Gh() {
43
+ this.Fh += 1;
44
44
  }
45
- Kh() {
46
- return this.fh;
45
+ Hh() {
46
+ return this.Fh;
47
47
  }
48
- it() {
49
- this.fh = 0;
48
+ Z() {
49
+ this.Fh = 0;
50
50
  }
51
51
  }
@@ -1,142 +1,141 @@
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 E } 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",
42
- Zn: "localization",
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",
43
43
  er: "contentSecurityNonce",
44
44
  re: "allowUserSuppliedJavascript",
45
- Go: "inAppMessageZIndex",
46
- Ko: "openInAppMessagesInNewTab",
45
+ Jo: "inAppMessageZIndex",
46
+ Do: "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
+ $h: "doNotLoadFontAwesome",
50
+ Jh: "deviceId",
51
+ _a: "serviceWorkerScope",
52
+ Yh: "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),
62
- (this.S = null),
63
- (this.Fi = null),
56
+ (this.sn = ""),
57
+ (this.Xh = ""),
58
+ (this.Zh = void 0),
59
+ (this.Qh = null),
60
+ (this.on = null),
64
61
  (this.B = null),
65
- (this.T = null),
62
+ (this.Cn = null),
63
+ (this.h = null),
66
64
  (this.C = null),
65
+ (this.j = null),
67
66
  (this.Cs = null),
68
- (this.La = ""),
67
+ (this.Ea = ""),
69
68
  (this.isInitialized = !1),
70
- (this.Ua = !1),
71
- (this.Wa = new u()),
72
- (this.Va = new u()),
69
+ (this.Ia = !1),
70
+ (this.Sa = new u()),
71
+ (this.Na = new u()),
73
72
  (this.options = {}),
74
- (this.Fa = []),
75
- (this.Ka = []),
76
- (this.Mi = []),
77
- (this.Ta = "5.9.1");
73
+ (this.Oa = []),
74
+ (this.Ta = []),
75
+ (this.yi = []),
76
+ (this.Xh = "6.1.0");
78
77
  }
79
- Ga(t) {
80
- this.Wa.Dt(t);
78
+ Ra(t) {
79
+ this.Sa.wt(t);
81
80
  }
82
- Nh(t) {
83
- this.Va.Dt(t);
81
+ mh(t) {
82
+ this.Na.wt(t);
84
83
  }
85
84
  initialize(t, i) {
86
- if (this.nn())
87
- return N.info("Braze has already been initialized with an API key."), !0;
85
+ if (this.ao())
86
+ return E.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.Yo);
89
+ const r = ll(no.Ca());
91
90
  if (
92
91
  (r && "true" === r.brazeLogging && (e = !0),
93
- N.init(e),
94
- N.info(
92
+ E.init(e),
93
+ E.info(
95
94
  `Initialization Options: ${JSON.stringify(this.options, null, 2)}`,
96
95
  ),
97
96
  null == t || "" === t || "string" != typeof t)
98
97
  )
99
- return N.error("Braze requires a valid API key to be initialized."), !1;
100
- this.an = t;
101
- let n = this.ee(w.Zo);
98
+ return E.error("Braze requires a valid API key to be initialized."), !1;
99
+ this.sn = t;
100
+ let n = this.ee(z.Ro);
102
101
  if (null == n || "" === n || "string" != typeof n)
103
- return N.error("Braze requires a valid baseUrl to be initialized."), !1;
102
+ return E.error("Braze requires a valid baseUrl to be initialized."), !1;
104
103
  !1 === /^https?:/.test(n) && (n = `https://${n}`);
105
104
  const o = n;
106
105
  if (
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.Ea = n.toString()),
110
+ ro.Pa && !this.ee(z._o))
112
111
  )
113
112
  return (
114
- N.info("Ignoring activity from crawler bot " + navigator.userAgent),
115
- (this.Ua = !0),
113
+ E.info("Ignoring activity from crawler bot " + navigator.userAgent),
114
+ (this.Ia = !0),
116
115
  !1
117
116
  );
118
- const h = this.ee(w.Wh) || !1;
117
+ const h = this.ee(z.Wo) || !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.j = Gt.La(t, h)), h && this.j.Da(t), new ee.ne(null, !0).br(s.ie))
121
120
  )
122
121
  return (
123
- N.info("Ignoring all activity due to previous opt out"),
124
- (this.Ua = !0),
122
+ E.info("Ignoring all activity due to previous opt out"),
123
+ (this.Ia = !0),
125
124
  !1
126
125
  );
127
126
  for (const t of C(this.options))
128
- -1 === Rt(zt).indexOf(t) &&
129
- N.warn(`Ignoring unknown initialization option '${t}'.`);
127
+ -1 === Pt($t).indexOf(t) &&
128
+ E.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.Yh)) {
131
+ const t = this.ee(z.Yh);
133
132
  -1 !== a.indexOf(t)
134
- ? (this.Ra = t)
135
- : N.error("Invalid sdk flavor passed: " + t);
133
+ ? (this.Zh = t)
134
+ : E.error("Invalid sdk flavor passed: " + t);
136
135
  }
137
- let l = this.ee(zt.Vh);
136
+ let l = this.ee($t.Vo);
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(
@@ -147,184 +146,184 @@ class Vt {
147
146
  ) && t.push(l[i]);
148
147
  l = t;
149
148
  } else
150
- N.error(
149
+ E.error(
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.Jh);
155
154
  if (c) {
156
155
  const t = new _t(c);
157
- this.C.uu(s.iu.Na, t);
156
+ this.j.uu(s.iu.Jh, 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.on = new Ot(this.j, l)),
159
+ (this.h = new Vt(this.j)),
160
+ (this.Cs = new bt(this.h, this.j)),
161
+ (this.C = new Kt(this.j, this.Cs, this.h, this.ee(z.Wh)));
163
162
  const f = new u();
164
163
  return (
165
- (this.Pa = new qt(this.C, this.ee(w.Yh), f)),
166
- this.F(f),
167
- (this.S = new Pt(
168
- this.hn,
169
- this.C,
170
- this.Pa,
164
+ (this.Qh = new Bt(this.j, this.ee(z.Xo), f)),
165
+ this.q(f),
166
+ (this.B = new Mt(
167
+ this.on,
168
+ this.j,
169
+ this.Qh,
171
170
  this.Cs,
172
- this.T,
173
- this.B,
174
- this.an,
175
- this.La,
176
- this.Ta,
177
- this.Ra || "",
178
- this.ee(w.Qh),
179
- this.ee(w.Ea),
171
+ this.C,
172
+ this.h,
173
+ this.sn,
174
+ this.Ea,
175
+ this.Xh,
176
+ this.Zh || "",
177
+ this.ee(z.Vh),
178
+ this.ee(z.Kh),
180
179
  )),
181
- (this.Fi = new Lt(
182
- this.an,
183
- this.La,
184
- this.T,
185
- this.hn,
186
- this.Cs,
187
- this.B,
180
+ (this.Cn = new Wt(
181
+ this.sn,
182
+ this.Ea,
188
183
  this.C,
184
+ this.on,
185
+ this.Cs,
186
+ this.h,
187
+ this.j,
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.N(t);
191
190
  },
192
- this.Pa,
193
- this.S,
191
+ this.Qh,
192
+ this.B,
194
193
  )),
195
- this.Fi.initialize(),
196
- h || this.C.Xa(),
197
- N.info(
194
+ this.Cn.initialize(),
195
+ h || this.j.Ua(),
196
+ E.info(
198
197
  `Initialized for the Braze backend at "${this.ee(
199
- w.Zo,
200
- )}" with API key "${this.an}".`,
198
+ z.Ro,
199
+ )}" with API key "${this.sn}".`,
201
200
  ),
202
- ot.p(),
203
- this.B.Ke(() => {
201
+ rt.t(),
202
+ this.h.Ue(() => {
204
203
  var t;
205
204
  this.isInitialized &&
206
- (null === (t = this.B) || void 0 === t ? void 0 : t.ke()) &&
205
+ (null === (t = this.h) || void 0 === t ? void 0 : t.Re()) &&
207
206
  import("../FeatureFlags/refresh-feature-flags.js").then((t) => {
208
207
  if (!this.isInitialized) return;
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
- (null === (t = this.B) || void 0 === t ? void 0 : t.ke()) &&
214
+ (null === (t = this.h) || void 0 === t ? void 0 : t.Re()) &&
216
215
  import("../FeatureFlags/refresh-feature-flags.js").then((t) => {
217
216
  if (!this.isInitialized) return;
218
217
  (0, t.default)(void 0, void 0, !0);
219
218
  });
220
219
  }),
221
- this.Wa.X(this.options),
220
+ this.Sa.L(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);
233
- this.S && this.S.fo(),
234
- (this.Ka = []),
227
+ 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.B && this.B.fo(),
233
+ (this.Ta = []),
235
234
  this.removeAllSubscriptions(),
236
- (this.Mi = []),
237
- null != this.Fi && this.Fi.destroy(),
238
- (this.Fi = null),
239
- (this.Pa = null),
240
- (this.hn = null),
241
- (this.S = null),
235
+ (this.yi = []),
236
+ null != this.Cn && this.Cn.destroy(),
237
+ (this.Cn = null),
238
+ (this.Qh = null),
239
+ (this.on = null),
242
240
  (this.B = null),
243
- (this.T = null),
241
+ (this.h = null),
242
+ (this.C = null),
244
243
  (this.Cs = null),
245
244
  (this.options = {}),
246
- (this.Ra = void 0),
245
+ (this.Zh = void 0),
247
246
  (this.isInitialized = !1),
248
- (this.Ua = !1),
249
- t && (this.C = null);
247
+ (this.Ia = !1),
248
+ t && (this.j = null);
250
249
  }
251
250
  }
252
251
  rr() {
253
- return !this.Za() && (!!this.nn() || (console.warn(p), !1));
252
+ return !this.Wa() && (!!this.ao() || (console.warn(w), !1));
254
253
  }
255
- Ma() {
256
- return this.an;
254
+ ba() {
255
+ return this.sn;
257
256
  }
258
257
  Sr() {
259
- return this.Pa;
258
+ return this.Qh;
260
259
  }
261
- Z() {
262
- return this.La;
260
+ V() {
261
+ return this.Ea;
263
262
  }
264
- ue() {
265
- return this.hn;
263
+ de() {
264
+ return this.on;
266
265
  }
267
- g() {
268
- return this.S;
266
+ m() {
267
+ return this.B;
269
268
  }
270
269
  ee(t) {
271
270
  return this.options[t];
272
271
  }
273
- ar() {
274
- return this.Ka;
275
- }
276
- rn() {
277
- return this.Fi;
272
+ lr() {
273
+ return this.Ta;
278
274
  }
279
- v() {
280
- return this.B;
275
+ nn() {
276
+ return this.Cn;
281
277
  }
282
- P() {
283
- return this.T;
278
+ l() {
279
+ return this.h;
284
280
  }
285
- j() {
281
+ u() {
286
282
  return this.C;
287
283
  }
288
- mr() {
289
- if (this.Cs && this.Fi) return new User(this.Cs, this.Fi);
284
+ p() {
285
+ return this.j;
286
+ }
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
- h(t) {
296
+ g(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.Oa) s === t && (i = !0);
299
+ i || this.Oa.push(t);
301
300
  }
302
- _(i) {
301
+ v(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.Ta) t.constructor === i.constructor && (s = !0);
304
+ i instanceof t && !s && this.Ta.push(i);
306
305
  }
307
- F(t) {
308
- t instanceof u && this.Mi.push(t);
306
+ q(t) {
307
+ t instanceof u && this.yi.push(t);
309
308
  }
310
309
  removeAllSubscriptions() {
311
- if (this.rr()) for (const t of this.Mi) t.removeAllSubscriptions();
310
+ if (this.rr()) for (const t of this.yi) t.removeAllSubscriptions();
312
311
  }
313
312
  removeSubscription(t) {
314
- if (this.rr()) for (const i of this.Mi) i.removeSubscription(t);
313
+ if (this.rr()) for (const i of this.yi) i.removeSubscription(t);
315
314
  }
316
- fe(t) {
317
- this.Ua = t;
315
+ ce(t) {
316
+ this.Ia = t;
318
317
  }
319
- nn() {
318
+ ao() {
320
319
  return this.isInitialized;
321
320
  }
322
- Za() {
323
- return this.Ua;
321
+ Wa() {
322
+ return this.Ia;
324
323
  }
325
- fi() {
326
- return this.Ta;
324
+ Vs() {
325
+ return this.Xh;
327
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 };