@braze/web-sdk 5.7.0 → 5.8.1

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 (142) hide show
  1. package/index.d.ts +4 -4
  2. package/package.json +1 -1
  3. package/shared-lib/encoding-utils.js +1 -1
  4. package/shared-lib/event-types.js +23 -23
  5. package/shared-lib/guid.js +1 -1
  6. package/shared-lib/indexed-db-adapter.js +21 -21
  7. package/shared-lib/logger.js +2 -2
  8. package/shared-lib/supported-options.js +18 -18
  9. package/src/Banner/banner-provider.js +79 -79
  10. package/src/Banner/banner.js +9 -9
  11. package/src/Banner/display/banner-to-html.js +2 -2
  12. package/src/Banner/get-all-banners.js +3 -4
  13. package/src/Banner/get-banner.js +11 -11
  14. package/src/Banner/log-banner-click.js +2 -2
  15. package/src/Banner/log-banner-impressions.js +4 -4
  16. package/src/Banner/request-banners-refresh.js +21 -13
  17. package/src/Banner/subscribe-to-banners-updates.js +14 -13
  18. package/src/Banner/ui/insert-banner.js +11 -9
  19. package/src/Card/card-manager.js +35 -35
  20. package/src/Card/display/card-display.js +8 -8
  21. package/src/Card/log-card-click.js +1 -1
  22. package/src/Card/log-card-dismissal.js +1 -1
  23. package/src/Card/log-card-impressions.js +3 -3
  24. package/src/Card/models/captioned-image.js +21 -21
  25. package/src/Card/models/card.js +92 -92
  26. package/src/Card/models/classic-card.js +21 -21
  27. package/src/Card/models/control-card.js +11 -11
  28. package/src/Card/models/image-only.js +19 -19
  29. package/src/Card/util/card-factory.js +39 -39
  30. package/src/ContentCards/content-cards-provider-factory.js +1 -1
  31. package/src/ContentCards/content-cards-provider.js +142 -142
  32. package/src/ContentCards/content-cards.js +3 -3
  33. package/src/ContentCards/get-cached-content-cards.js +1 -1
  34. package/src/ContentCards/request-content-cards-refresh.js +1 -1
  35. package/src/ContentCards/subscribe-to-content-cards-updates.js +4 -4
  36. package/src/ContentCards/ui/show-content-cards.js +8 -8
  37. package/src/Core/add-sdk-metadata.js +2 -2
  38. package/src/Core/change-user.js +3 -3
  39. package/src/Core/disable-sdk.js +7 -7
  40. package/src/Core/enable-sdk.js +5 -5
  41. package/src/Core/get-device-id.js +2 -2
  42. package/src/Core/get-user.js +1 -1
  43. package/src/Core/handle-braze-action.js +2 -2
  44. package/src/Core/is-disabled.js +2 -2
  45. package/src/Core/is-initialized.js +1 -1
  46. package/src/Core/log-custom-event.js +5 -5
  47. package/src/Core/log-purchase.js +4 -4
  48. package/src/Core/open-session.js +7 -7
  49. package/src/Core/wipe-data.js +3 -3
  50. package/src/FeatureFlags/feature-flag-factory.js +10 -10
  51. package/src/FeatureFlags/feature-flag.js +19 -19
  52. package/src/FeatureFlags/feature-flags-provider.js +61 -61
  53. package/src/FeatureFlags/get-all-feature-flags.js +6 -7
  54. package/src/FeatureFlags/get-feature-flag.js +5 -6
  55. package/src/FeatureFlags/log-feature-flag-impression.js +4 -4
  56. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +2 -2
  57. package/src/Feed/feed-provider.js +41 -41
  58. package/src/Feed/feed.js +2 -2
  59. package/src/Feed/get-cached-feed.js +1 -1
  60. package/src/Feed/log-feed-displayed.js +1 -1
  61. package/src/Feed/request-feed-refresh.js +1 -1
  62. package/src/Feed/subscribe-to-feed-updates.js +1 -1
  63. package/src/Feed/ui/show-feed.js +5 -5
  64. package/src/InAppMessage/defer-in-app-message.js +1 -1
  65. package/src/InAppMessage/display/html-message-to-html.js +6 -6
  66. package/src/InAppMessage/display/in-app-message-to-html.js +20 -20
  67. package/src/InAppMessage/display/modal-utils.js +4 -4
  68. package/src/InAppMessage/in-app-message-factory.js +7 -7
  69. package/src/InAppMessage/in-app-message-manager-factory.js +1 -1
  70. package/src/InAppMessage/in-app-message-manager.js +89 -89
  71. package/src/InAppMessage/log-in-app-message-button-click.js +6 -6
  72. package/src/InAppMessage/log-in-app-message-click.js +5 -5
  73. package/src/InAppMessage/log-in-app-message-html-click.js +7 -7
  74. package/src/InAppMessage/log-in-app-message-impression.js +2 -2
  75. package/src/InAppMessage/models/control-message.js +5 -5
  76. package/src/InAppMessage/models/full-screen-message.js +34 -34
  77. package/src/InAppMessage/models/html-message.js +20 -20
  78. package/src/InAppMessage/models/in-app-message-button.js +8 -8
  79. package/src/InAppMessage/models/in-app-message.js +83 -83
  80. package/src/InAppMessage/models/modal-message.js +33 -33
  81. package/src/InAppMessage/models/slide-up-message.js +30 -30
  82. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  83. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  84. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
  85. package/src/InAppMessage/ui/show-in-app-message.js +19 -19
  86. package/src/Push/push-manager-factory.js +8 -8
  87. package/src/Push/push-manager.js +96 -96
  88. package/src/Push/utils/push-utils.js +4 -4
  89. package/src/User/user-manager.js +19 -19
  90. package/src/User/user.js +41 -41
  91. package/src/common/base-feed.js +3 -3
  92. package/src/common/base-provider.js +1 -1
  93. package/src/common/event-logger.js +6 -6
  94. package/src/common/feed-display.js +10 -10
  95. package/src/l10n/l10n-manager-factory.js +2 -2
  96. package/src/l10n/l10n-manager.js +1 -1
  97. package/src/managers/auth-manager.js +31 -31
  98. package/src/managers/braze-instance.js +139 -139
  99. package/src/managers/device-manager.js +24 -24
  100. package/src/managers/network-manager.js +151 -151
  101. package/src/managers/server-config-manager.js +86 -86
  102. package/src/managers/session-manager.js +38 -38
  103. package/src/managers/storage-manager-factory.js +12 -12
  104. package/src/managers/storage-manager.js +96 -96
  105. package/src/managers/subscription-manager.js +10 -10
  106. package/src/managers/utils.js +4 -4
  107. package/src/models/backend-errors.js +5 -5
  108. package/src/models/braze-event.js +4 -4
  109. package/src/models/device.js +2 -2
  110. package/src/models/identifier.js +12 -12
  111. package/src/models/push-token.js +8 -8
  112. package/src/models/request-result.js +3 -3
  113. package/src/models/server-config.js +31 -31
  114. package/src/request-controller.js +152 -152
  115. package/src/triggers/models/custom-event-data.js +1 -1
  116. package/src/triggers/models/custom-event-property-data.js +2 -2
  117. package/src/triggers/models/filter-set.js +6 -6
  118. package/src/triggers/models/filter.js +2 -2
  119. package/src/triggers/models/in-app-message-click-data.js +1 -1
  120. package/src/triggers/models/purchase-data.js +1 -1
  121. package/src/triggers/models/purchase-property-data.js +2 -2
  122. package/src/triggers/models/push-click-data.js +1 -1
  123. package/src/triggers/models/trigger-condition.js +33 -33
  124. package/src/triggers/models/trigger-events.js +3 -3
  125. package/src/triggers/models/trigger.js +11 -11
  126. package/src/triggers/triggers-provider-factory.js +3 -3
  127. package/src/triggers/triggers-provider.js +74 -74
  128. package/src/ui/js/attach-css.js +3 -3
  129. package/src/ui/js/load-font-awesome.js +2 -2
  130. package/src/util/base-device-parser.js +3 -3
  131. package/src/util/braze-actions.js +4 -4
  132. package/src/util/browser-detector.js +5 -5
  133. package/src/util/client-hints-parser.js +1 -1
  134. package/src/util/component-utils.js +1 -1
  135. package/src/util/dom-utils.js +7 -7
  136. package/src/util/html-display-utils.js +6 -6
  137. package/src/util/key-codes.js +1 -1
  138. package/src/util/net.js +6 -6
  139. package/src/util/request-header-utils.js +21 -21
  140. package/src/util/user-agent-parser.js +1 -1
  141. package/src/util/validation-utils.js +4 -4
  142. package/src/util/window-utils.js +1 -1
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Type definitions for @braze/web-sdk v5.7.0
2
+ * Type definitions for @braze/web-sdk v5.8.1
3
3
  * Project: https://github.com/braze-inc/braze-web-sdk
4
4
  * (c) Braze, Inc. 2025 - http://braze.com
5
5
  * License available at https://github.com/braze-inc/braze-web-sdk/blob/master/LICENSE
@@ -2162,7 +2162,7 @@ export function openSession(): void;
2162
2162
  * - Create a `service-worker.js` file with the content below and place it in the root directory of your website:
2163
2163
  *
2164
2164
  * ```
2165
- * self.importScripts('https://js.appboycdn.com/web-sdk-develop/5.7/service-worker.js');
2165
+ * self.importScripts('https://js.appboycdn.com/web-sdk-develop/5.8/service-worker.js');
2166
2166
  * ```
2167
2167
  *
2168
2168
  * For more details, see [Our Product Documentation](https://www.braze.com/docs/developer_guide/platform_integration_guides/web/push_notifications/integration).
@@ -2475,7 +2475,7 @@ export function getBanner(placementId: string): Banner | null | undefined;
2475
2475
  * @param banner - The `Banner` to insert onto the page.
2476
2476
  * @param parentNode - The HTML element to render the banner into.
2477
2477
  */
2478
- export function insertBanner(banner: Banner, parentNode: HTMLElement): void;
2478
+ export function insertBanner(banner: Banner | null | undefined, parentNode: HTMLElement): void;
2479
2479
 
2480
2480
  /**
2481
2481
  * Logs that the user clicked the given banner. This should generally be called through the Braze JavaScript bridge
@@ -2630,7 +2630,7 @@ export type InitializationOptions = {
2630
2630
  * lifecycle of, set this option to true and the Braze SDK will not register or unregister a service worker. If you set this
2631
2631
  * option to true, in order for push to function correctly you must register the service worker yourself BEFORE calling
2632
2632
  * `requestPushPermission`, and ensure that it contains Braze's service worker code, either with
2633
- * `self.importScripts('https://js.appboycdn.com/web-sdk-develop/5.7/service-worker.js');` or by including the content
2633
+ * `self.importScripts('https://js.appboycdn.com/web-sdk-develop/5.8/service-worker.js');` or by including the content
2634
2634
  * of that file directly. When this option is true, the `serviceWorkerLocation` option is irrelevant and is ignored.
2635
2635
  */
2636
2636
  manageServiceWorkerExternally?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@braze/web-sdk",
3
- "version": "5.7.0",
3
+ "version": "5.8.1",
4
4
  "description": "Braze SDK for web sites and other JS platforms.",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -1,5 +1,5 @@
1
1
  const ei = {
2
- On: function (t) {
2
+ Vn: function (t) {
3
3
  const r = (t + "=".repeat((4 - (t.length % 4)) % 4))
4
4
  .replace(/\-/g, "+")
5
5
  .replace(/_/g, "/"),
@@ -1,36 +1,36 @@
1
1
  const d = {
2
2
  CustomEvent: "ce",
3
3
  Pr: "p",
4
- gc: "pc",
4
+ fc: "pc",
5
5
  Ac: "ca",
6
- Mu: "i",
7
- Tu: "ie",
8
- xt: "cci",
9
- $t: "ccic",
10
- lt: "ccc",
11
- dt: "ccd",
12
- Kl: "ss",
13
- Gl: "se",
14
- Ir: "si",
15
- Mr: "sc",
16
- Tr: "sbc",
6
+ Cu: "i",
7
+ bu: "ie",
8
+ ss: "cci",
9
+ os: "ccic",
10
+ Mt: "ccc",
11
+ Wt: "ccd",
12
+ Bl: "ss",
13
+ Dl: "se",
14
+ Li: "si",
15
+ Qi: "sc",
16
+ Vi: "sbc",
17
17
  Mc: "sfe",
18
- zo: "iec",
19
- fc: "lr",
20
- mc: "uae",
21
- yt: "ci",
22
- ut: "cc",
18
+ Eo: "iec",
19
+ mc: "lr",
20
+ dc: "uae",
21
+ ns: "ci",
22
+ Ot: "cc",
23
23
  wc: "lcaa",
24
24
  bc: "lcar",
25
- Xn: "inc",
26
- Jn: "add",
27
- Qn: "rem",
28
- Hn: "set",
29
- Kn: "ncam",
25
+ Gn: "inc",
26
+ Rn: "add",
27
+ On: "rem",
28
+ $n: "set",
29
+ Bn: "ncam",
30
30
  kc: "sgu",
31
31
  yr: "ffi",
32
32
  ro: "bi",
33
- ds: "bc",
33
+ ct: "bc",
34
34
  },
35
35
  dr = { Fr: "feed_displayed", Sc: "content_cards_displayed" };
36
36
  export { d as EventTypes, dr as InternalEventTypes };
@@ -1,5 +1,5 @@
1
1
  const G = {
2
- Rt: function () {
2
+ ce: function () {
3
3
  const t = (t = !1) => {
4
4
  const n = (Math.random().toString(16) + "000000000").substr(2, 8);
5
5
  return t ? "-" + n.substr(0, 4) + "-" + n.substr(4, 4) : n;
@@ -64,11 +64,11 @@ export default class tt {
64
64
  "...",
65
65
  );
66
66
  const n = null === (e = t.target) || void 0 === e ? void 0 : e.result;
67
- for (const t in i.database.Ks) {
67
+ for (const t in i.database.Ms) {
68
68
  const e = t;
69
- i.database.Ks.hasOwnProperty(t) &&
70
- !n.objectStoreNames.contains(i.database.Ks[e]) &&
71
- n.createObjectStore(i.database.Ks[e]);
69
+ i.database.Ms.hasOwnProperty(t) &&
70
+ !n.objectStoreNames.contains(i.database.Ms[e]) &&
71
+ n.createObjectStore(i.database.Ms[e]);
72
72
  }
73
73
  }),
74
74
  (o.onsuccess = (n) => {
@@ -180,7 +180,7 @@ export default class tt {
180
180
  });
181
181
  });
182
182
  }
183
- jr(t, e, n) {
183
+ cr(t, e, n) {
184
184
  if (!this.isSupported()) return "function" == typeof n && n(), !1;
185
185
  const o = this;
186
186
  return this.Bd((i) => {
@@ -216,7 +216,7 @@ export default class tt {
216
216
  });
217
217
  }, n);
218
218
  }
219
- me(t, e) {
219
+ ge(t, e) {
220
220
  if (!this.isSupported()) return !1;
221
221
  const n = this;
222
222
  return this.Bd((o) => {
@@ -249,7 +249,7 @@ export default class tt {
249
249
  };
250
250
  });
251
251
  }
252
- Gs(t, e) {
252
+ Ns(t, e) {
253
253
  if (!this.isSupported()) return !1;
254
254
  const n = this;
255
255
  return this.Bd((o) => {
@@ -304,11 +304,11 @@ export default class tt {
304
304
  clearData() {
305
305
  if (!this.isSupported()) return !1;
306
306
  const t = [];
307
- for (const e in this.database.Ks) {
307
+ for (const e in this.database.Ms) {
308
308
  const n = e;
309
- this.database.Ks.hasOwnProperty(e) &&
310
- this.database.Ks[n] !== this.database.Ks.ie &&
311
- t.push(this.database.Ks[n]);
309
+ this.database.Ms.hasOwnProperty(e) &&
310
+ this.database.Ms[n] !== this.database.Ms.pe &&
311
+ t.push(this.database.Ms[n]);
312
312
  }
313
313
  const e = this;
314
314
  return this.Bd(function (n) {
@@ -333,20 +333,20 @@ export default class tt {
333
333
  });
334
334
  }
335
335
  }
336
- tt._s = {
337
- Xs: {
336
+ tt.Ls = {
337
+ Fs: {
338
338
  Sd: "AppboyServiceWorkerAsyncStorage",
339
339
  VERSION: 6,
340
- Ks: {
341
- zu: "data",
342
- hr: "pushClicks",
340
+ Ms: {
341
+ Nu: "data",
342
+ jr: "pushClicks",
343
343
  cu: "pushSubscribed",
344
344
  Cd: "fallbackDevice",
345
- Hs: "cardUpdates",
346
- ie: "optOut",
347
- $r: "pendingData",
348
- yh: "sdkAuthenticationSignature",
345
+ Js: "cardUpdates",
346
+ pe: "optOut",
347
+ kr: "pendingData",
348
+ qh: "sdkAuthenticationSignature",
349
349
  },
350
- oe: 1,
350
+ be: 1,
351
351
  },
352
352
  };
@@ -24,13 +24,13 @@ const N = {
24
24
  },
25
25
  warn: function (n) {
26
26
  if (N.zg) {
27
- const o = "Braze SDK Warning: " + n + " (v5.7.0)";
27
+ const o = "Braze SDK Warning: " + n + " (v5.8.1)";
28
28
  null != N.vd ? N.vd(o) : console.warn(o);
29
29
  }
30
30
  },
31
31
  error: function (n) {
32
32
  if (N.zg) {
33
- const o = "Braze SDK Error: " + n + " (v5.7.0)";
33
+ const o = "Braze SDK Error: " + n + " (v5.8.1)";
34
34
  null != N.vd ? N.vd(o) : console.error(o);
35
35
  }
36
36
  },
@@ -1,28 +1,28 @@
1
1
  export default {
2
- Oo: "allowCrawlerActivity",
3
- Wo: "baseUrl",
4
- Vo: "noCookies",
5
- Ko: "devicePropertyAllowlist",
2
+ Yo: "allowCrawlerActivity",
3
+ Zo: "baseUrl",
4
+ Wh: "noCookies",
5
+ Vh: "devicePropertyAllowlist",
6
6
  Da: "disablePushTokenMaintenance",
7
- Yo: "enableLogging",
8
- Ho: "enableSdkAuthentication",
7
+ Kh: "enableLogging",
8
+ $h: "enableSdkAuthentication",
9
9
  Ca: "manageServiceWorkerExternally",
10
- Xo: "minimumIntervalBetweenTriggerActionsInSeconds",
11
- Zo: "sessionTimeoutInSeconds",
12
- Qo: "appVersion",
13
- Wh: "appVersionNumber",
10
+ Yh: "minimumIntervalBetweenTriggerActionsInSeconds",
11
+ Xh: "sessionTimeoutInSeconds",
12
+ Zh: "appVersion",
13
+ Qh: "appVersionNumber",
14
14
  _a: "serviceWorkerLocation",
15
15
  Ba: "safariWebsitePushId",
16
- Ea: "localization",
17
- ir: "contentSecurityNonce",
18
- er: "allowUserSuppliedJavascript",
19
- Do: "inAppMessageZIndex",
20
- To: "openInAppMessagesInNewTab",
16
+ Xn: "localization",
17
+ er: "contentSecurityNonce",
18
+ re: "allowUserSuppliedJavascript",
19
+ No: "inAppMessageZIndex",
20
+ Ko: "openInAppMessagesInNewTab",
21
21
  en: "openNewsFeedCardsInNewTab",
22
22
  mh: "requireExplicitInAppMessageDismissal",
23
- Vh: "doNotLoadFontAwesome",
24
- $h: "deviceId",
23
+ Ea: "doNotLoadFontAwesome",
24
+ Ia: "deviceId",
25
25
  Aa: "serviceWorkerScope",
26
- Yh: "sdkFlavor",
26
+ Na: "sdkFlavor",
27
27
  tn: "openCardsInNewTab",
28
28
  };
@@ -1,5 +1,5 @@
1
- import s from "../common/base-provider.js";
2
- import { STORAGE_KEYS as t } from "../managers/storage-manager.js";
1
+ import t from "../common/base-provider.js";
2
+ import { STORAGE_KEYS as s } from "../managers/storage-manager.js";
3
3
  import {
4
4
  newBannerFromJson as n,
5
5
  newBannerFromSerializedValue as o,
@@ -11,16 +11,16 @@ import u from "../managers/subscription-manager.js";
11
11
  import r from "../managers/braze-instance.js";
12
12
  import c from "../common/event-logger.js";
13
13
  import { EventTypes as d } from "../../shared-lib/event-types.js";
14
- export default class e extends s {
15
- constructor(s, t, i, e) {
14
+ export default class e extends t {
15
+ constructor(t, s, i, e) {
16
16
  super(),
17
- (this.B = s),
18
- (this.S = t),
17
+ (this.B = t),
18
+ (this.S = s),
19
19
  (this.C = i),
20
20
  (this.T = e),
21
21
  (this.banners = {}),
22
- (this.B = s),
23
- (this.S = t),
22
+ (this.B = t),
23
+ (this.S = s),
24
24
  (this.C = i),
25
25
  (this.T = e),
26
26
  (this.R = 10),
@@ -31,20 +31,20 @@ export default class e extends s {
31
31
  (this.k = null),
32
32
  (this.D = null);
33
33
  }
34
- U(s) {
35
- if (this.L() && null != s && s.banners) {
34
+ U(t) {
35
+ if (this.L() && null != t && t.banners) {
36
36
  this.banners = {};
37
- const t = s.banners;
38
- for (const s in t) {
39
- const i = t[s];
37
+ const s = t.banners;
38
+ for (const t in s) {
39
+ const i = s[t];
40
40
  let e = null;
41
41
  null != i && null != i.banner && (e = n(i.banner)),
42
- e && (this.banners[s] = e);
42
+ e && (this.banners[t] = e);
43
43
  }
44
44
  this.M(), this.F.X(this.banners);
45
45
  }
46
46
  }
47
- $(s, t, i, e = !0) {
47
+ $(t, s, i, e = !0) {
48
48
  var n;
49
49
  const r = () => {
50
50
  "function" == typeof i && i();
@@ -54,7 +54,7 @@ export default class e extends s {
54
54
  null === (n = this.B) ||
55
55
  void 0 === n ||
56
56
  n.A(() => {
57
- this.$(s, t, i);
57
+ this.$(t, s, i);
58
58
  })
59
59
  );
60
60
  const o = this.S;
@@ -62,7 +62,7 @@ export default class e extends s {
62
62
  e && this.G();
63
63
  const u = o.H({}, !0),
64
64
  c = [];
65
- for (const t of s) c.push({ id: t });
65
+ for (const s of t) c.push({ id: s });
66
66
  u.placements = c;
67
67
  const d = o.J(u, h.O.K);
68
68
  let m = !1;
@@ -78,27 +78,27 @@ export default class e extends s {
78
78
  url: `${n.Z()}/banners/sync`,
79
79
  headers: d,
80
80
  data: u,
81
- ss: (s) => {
82
- if (!n.ts(u, s, d)) return (m = !0), void r();
83
- n.es(), this.U(s), (m = !1), "function" == typeof t && t();
81
+ tt: (t) => {
82
+ if (!n.st(u, t, d)) return (m = !0), void r();
83
+ n.it(), this.U(t), (m = !1), "function" == typeof s && s();
84
84
  },
85
- error: (s) => {
86
- n.ns(s, "retrieving banners"), (m = !0), r();
85
+ error: (t) => {
86
+ n.et(t, "retrieving banners"), (m = !0), r();
87
87
  },
88
- rs: (e, r) => {
88
+ nt: (e, r) => {
89
89
  let o;
90
- if (((this.D = s), m)) {
91
- let s = this.I;
92
- (null == s || s < 1e3 * this.R) && (s = 1e3 * this.R),
93
- (o = Math.min(3e5, a(1e3 * this.R, 3 * s)));
90
+ if (((this.D = t), m)) {
91
+ let t = this.I;
92
+ (null == t || t < 1e3 * this.R) && (t = 1e3 * this.R),
93
+ (o = Math.min(3e5, a(1e3 * this.R, 3 * t)));
94
94
  }
95
- n.os(
95
+ n.rt(
96
96
  r,
97
97
  () => {
98
- this.$(s, t, i, !1);
98
+ this.$(t, s, i, !1);
99
99
  },
100
100
  h.O.K,
101
- (s) => this.hs(s),
101
+ (t) => this.ot(t),
102
102
  () => this.G(),
103
103
  o,
104
104
  );
@@ -109,93 +109,93 @@ export default class e extends s {
109
109
  i,
110
110
  );
111
111
  }
112
- ls() {
112
+ ht() {
113
113
  return this.D;
114
114
  }
115
- us(s, t) {
116
- const i = { id: s.id };
117
- t && (i.bid = t);
118
- return c.cs(d.ds, i).ss;
115
+ lt(t, s) {
116
+ const i = { id: t.id };
117
+ s && (i.bid = s);
118
+ return c.ut(d.ct, i).tt;
119
119
  }
120
120
  G() {
121
121
  null != this.q && (clearTimeout(this.q), (this.q = null));
122
122
  }
123
- hs(s) {
124
- this.G(), (this.q = s);
123
+ ot(t) {
124
+ this.G(), (this.q = t);
125
125
  }
126
- fs() {
127
- let s = {};
128
- this.C && (s = this.C.vs(t.gs.ps));
126
+ dt() {
127
+ let t = {};
128
+ this.C && (t = this.C.ft(s.gt.vt));
129
129
  const i = {};
130
- for (const t in s) {
130
+ for (const s in t) {
131
131
  let e = null;
132
- null != s[t] && (e = o(s[t])), e && (i[e.placementId] = e);
132
+ null != t[s] && (e = o(t[s])), e && (i[e.placementId] = e);
133
133
  }
134
134
  return i;
135
135
  }
136
136
  M() {
137
- var s;
137
+ var t;
138
138
  if (!this.C) return;
139
139
  const i = {};
140
- for (const t in this.banners) {
140
+ for (const s in this.banners) {
141
141
  const e =
142
- (null === (s = this.banners[t]) || void 0 === s ? void 0 : s.bs()) ||
142
+ (null === (t = this.banners[s]) || void 0 === t ? void 0 : t.bt()) ||
143
143
  null;
144
- i[t] = e;
144
+ i[s] = e;
145
145
  }
146
- this.C.Bs(t.gs.ps, i), this.js();
146
+ this.C.Bt(s.gt.vt, i), this.jt();
147
147
  }
148
- js() {
149
- var s, i;
150
- null === (s = this.C) ||
151
- void 0 === s ||
152
- s.Bs(t.gs.ys, null === (i = this.T) || void 0 === i ? void 0 : i.Ss());
148
+ jt() {
149
+ var t, i;
150
+ null === (t = this.C) ||
151
+ void 0 === t ||
152
+ t.Bt(s.gt.yt, null === (i = this.T) || void 0 === i ? void 0 : i.St());
153
153
  }
154
- ws() {
155
- var s;
154
+ wt() {
155
+ var t;
156
156
  return (
157
- (null === (s = this.C) || void 0 === s ? void 0 : s.vs(t.gs.ys)) || null
157
+ (null === (t = this.C) || void 0 === t ? void 0 : t.ft(s.gt.yt)) || null
158
158
  );
159
159
  }
160
- Cs() {
160
+ Ct() {
161
161
  return this.k;
162
162
  }
163
- Ts(s) {
164
- this.k = s;
163
+ Tt(t) {
164
+ this.k = t;
165
165
  }
166
- Rs() {
167
- var s;
168
- const t = null === (s = this.T) || void 0 === s ? void 0 : s.Ss(),
169
- i = this.ws();
170
- return null != i && t === i;
166
+ Rt() {
167
+ var t;
168
+ const s = null === (t = this.T) || void 0 === t ? void 0 : t.St(),
169
+ i = this.wt();
170
+ return null != i && s === i;
171
171
  }
172
- Is() {
173
- var s;
174
- const t = null === (s = this.T) || void 0 === s ? void 0 : s.Ss(),
175
- i = this.ws();
176
- return null == i || t === i;
172
+ It() {
173
+ var t;
174
+ const s = null === (t = this.T) || void 0 === t ? void 0 : t.St(),
175
+ i = this.wt();
176
+ return null == i || s === i;
177
177
  }
178
- qs(s) {
179
- return this.F.Fs(s);
178
+ qt(t) {
179
+ return this.F.Ft(t);
180
180
  }
181
- Ns() {
182
- var s;
181
+ Nt() {
182
+ var t;
183
183
  return (
184
- (null === (s = this.C) || void 0 === s ? void 0 : s.vs(t.gs.ks)) || {}
184
+ (null === (t = this.C) || void 0 === t ? void 0 : t.ft(s.gt.kt)) || {}
185
185
  );
186
186
  }
187
- xs(s) {
188
- this.C && this.C.Bs(t.gs.ks, s);
187
+ xt(t) {
188
+ this.C && this.C.Bt(s.gt.kt, t);
189
189
  }
190
190
  changeUser() {
191
- this.zs();
191
+ this.zt();
192
192
  }
193
193
  L() {
194
- return !!this.B && (!!this.B.Ds() || (0 !== this.B.Us() && this.zs(), !1));
194
+ return !!this.B && (!!this.B.Dt() || (0 !== this.B.Et() && this.zt(), !1));
195
195
  }
196
- zs() {
196
+ zt() {
197
197
  (this.banners = {}),
198
- this.C && (this.C.Es(t.gs.ps), this.C.Es(t.gs.ks)),
198
+ this.C && (this.C.Ut(s.gt.vt), this.C.Ut(s.gt.kt)),
199
199
  this.F.X({});
200
200
  }
201
201
  }
@@ -3,28 +3,28 @@ export default class Banner {
3
3
  (this.id = t),
4
4
  (this.placementId = i),
5
5
  (this.html = s),
6
- (this.tt = h),
6
+ (this.At = h),
7
7
  (this.isControl = r),
8
- (this.it = e),
8
+ (this.Gt = e),
9
9
  (this.id = t),
10
10
  (this.placementId = i),
11
11
  (this.html = s),
12
- (this.tt = h),
12
+ (this.At = h),
13
13
  (this.isControl = r),
14
- (this.it = e),
15
- (this.st = !1);
14
+ (this.Gt = e),
15
+ (this.Ht = !1);
16
16
  }
17
- ht() {
17
+ Jt() {
18
18
  return this.isControl;
19
19
  }
20
- bs() {
20
+ bt() {
21
21
  return {
22
22
  id: this.id,
23
23
  o: this.placementId,
24
24
  html: this.html,
25
- t: this.tt,
25
+ t: this.At,
26
26
  i: this.isControl,
27
- u: this.it,
27
+ u: this.Gt,
28
28
  };
29
29
  }
30
30
  }
@@ -19,7 +19,7 @@ export function controlBannerToHtml(t) {
19
19
  );
20
20
  }
21
21
  export function bannerToHtml(t, n) {
22
- if (t.ht()) return controlBannerToHtml(t);
22
+ if (t.Jt()) return controlBannerToHtml(t);
23
23
  const o = document.createElement("iframe");
24
24
  return (
25
25
  (o.id = t.id),
@@ -37,7 +37,7 @@ export function bannerToHtml(t, n) {
37
37
  {},
38
38
  b(o, () => {
39
39
  import("../../Feed/ui/show-feed.js").then((t) => {
40
- r.nt() ? t.showFeed() : N.error(p);
40
+ r._t() ? t.showFeed() : N.error(p);
41
41
  });
42
42
  }),
43
43
  ),
@@ -1,13 +1,12 @@
1
- import { logger as N } from "../../shared-lib/index.js";
2
1
  import r from "../managers/braze-instance.js";
3
2
  import i from "./banner-provider-factory.js";
4
3
  import { getBannerIfNotExpired as v } from "./get-banner.js";
5
4
  export function getAllBanners() {
6
5
  if (!r.rr()) return;
7
6
  const n = {},
8
- e = r.v();
9
- if (e && !e.Ds()) return N.info("Banners are not enabled."), n;
10
- const o = i.m().fs();
7
+ t = r.v();
8
+ if (t && !t.Dt()) return n;
9
+ const o = i.m().dt();
11
10
  for (const r in o) n[r] = v(o, r);
12
11
  return n;
13
12
  }
@@ -1,19 +1,19 @@
1
1
  import { logger as N } from "../../shared-lib/index.js";
2
2
  import r from "../managers/braze-instance.js";
3
3
  import i from "./banner-provider-factory.js";
4
- export function getBannerIfNotExpired(n, e) {
5
- const r = n[e];
6
- if (!r) return null;
7
- const t = r.it,
8
- a = new Date().valueOf();
9
- return -1 !== t && 1e3 * t < a
10
- ? (N.info(`Banner with ID: ${r.id} and placement ID: ${e} has expired.`),
4
+ export function getBannerIfNotExpired(n, r) {
5
+ const e = n[r];
6
+ if (!e) return null;
7
+ const t = e.Gt,
8
+ o = new Date().valueOf();
9
+ return -1 !== t && 1e3 * t < o
10
+ ? (N.info(`Banner with ID: ${e.id} and placement ID: ${r} has expired.`),
11
11
  null)
12
- : r;
12
+ : e;
13
13
  }
14
14
  export function getBanner(n) {
15
15
  if (!r.rr()) return;
16
- const e = r.v();
17
- if (e && !e.Ds()) return N.info("Banners are not enabled."), null;
18
- return getBannerIfNotExpired(i.m().fs(), n);
16
+ const e = i.m();
17
+ if (!e.L()) return null;
18
+ return getBannerIfNotExpired(e.dt(), n);
19
19
  }
@@ -10,11 +10,11 @@ export function logBannerClick(n, o) {
10
10
  N.error("Banner argument to logBannerClick must be an Banner object."), !1
11
11
  );
12
12
  const e = i.m(),
13
- t = e.fs();
13
+ t = e.dt();
14
14
  return 0 === y(t).length
15
15
  ? (N.info("Not logging banner click. No banners exist."), !1)
16
16
  : t[n.placementId]
17
- ? e.logClick(n, o)
17
+ ? e.lt(n, o)
18
18
  : (N.info(
19
19
  `Not logging banner click for ID ${n.placementId}. The placement ID did not correspond to any banner.`,
20
20
  ),