@braze/web-sdk 4.9.0 → 5.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 (111) hide show
  1. package/index.d.ts +2204 -2230
  2. package/package.json +1 -1
  3. package/shared-lib/braze-shared-lib.js +1 -1
  4. package/shared-lib/event-types.js +9 -9
  5. package/shared-lib/indexed-db-adapter.js +13 -13
  6. package/shared-lib/logger.js +2 -2
  7. package/shared-lib/supported-options.js +8 -8
  8. package/src/Card/models/captioned-image.js +19 -19
  9. package/src/Card/models/card.js +95 -94
  10. package/src/Card/models/classic-card.js +19 -19
  11. package/src/Card/models/control-card.js +9 -9
  12. package/src/Card/models/image-only.js +21 -22
  13. package/src/Card/models/index.js +0 -1
  14. package/src/Card/util/card-factory.js +39 -39
  15. package/src/ContentCards/content-cards-provider.js +114 -114
  16. package/src/ContentCards/get-cached-content-cards.js +1 -1
  17. package/src/ContentCards/index.js +0 -1
  18. package/src/ContentCards/request-content-cards-refresh.js +1 -1
  19. package/src/ContentCards/subscribe-to-content-cards-updates.js +3 -3
  20. package/src/ContentCards/ui/hide-content-cards.js +2 -2
  21. package/src/ContentCards/ui/show-content-cards.js +14 -14
  22. package/src/Core/add-sdk-metadata.js +2 -2
  23. package/src/Core/change-user.js +2 -2
  24. package/src/Core/disable-sdk.js +4 -4
  25. package/src/Core/enable-sdk.js +4 -4
  26. package/src/Core/get-device-id.js +9 -7
  27. package/src/Core/handle-braze-action.js +14 -14
  28. package/src/Core/is-disabled.js +2 -2
  29. package/src/Core/open-session.js +5 -5
  30. package/src/Core/set-sdk-authentication-signature.js +2 -2
  31. package/src/Core/wipe-data.js +4 -4
  32. package/src/FeatureFlags/feature-flag-factory.js +10 -10
  33. package/src/FeatureFlags/feature-flag.js +7 -7
  34. package/src/FeatureFlags/feature-flags-provider.js +50 -50
  35. package/src/FeatureFlags/get-all-feature-flags.js +1 -1
  36. package/src/FeatureFlags/get-feature-flag.js +3 -5
  37. package/src/Feed/feed-provider-factory.js +8 -8
  38. package/src/Feed/feed-provider.js +15 -15
  39. package/src/Feed/get-cached-feed.js +2 -2
  40. package/src/Feed/request-feed-refresh.js +2 -2
  41. package/src/Feed/subscribe-to-feed-updates.js +2 -2
  42. package/src/Feed/ui/hide-feed.js +2 -2
  43. package/src/Feed/ui/show-feed.js +13 -13
  44. package/src/InAppMessage/display/html-message-to-html.js +11 -12
  45. package/src/InAppMessage/display/in-app-message-to-html.js +15 -15
  46. package/src/InAppMessage/display/modal-utils.js +8 -8
  47. package/src/InAppMessage/in-app-message-factory.js +4 -4
  48. package/src/InAppMessage/in-app-message-manager.js +38 -38
  49. package/src/InAppMessage/models/full-screen-message.js +31 -31
  50. package/src/InAppMessage/models/html-message.js +16 -16
  51. package/src/InAppMessage/models/in-app-message-button.js +5 -5
  52. package/src/InAppMessage/models/in-app-message.js +46 -46
  53. package/src/InAppMessage/models/modal-message.js +30 -30
  54. package/src/InAppMessage/models/slide-up-message.js +26 -26
  55. package/src/InAppMessage/ui/show-in-app-message.js +9 -9
  56. package/src/Push/is-push-blocked.js +2 -2
  57. package/src/Push/is-push-permission-granted.js +2 -2
  58. package/src/Push/is-push-supported.js +2 -2
  59. package/src/Push/push-manager.js +31 -31
  60. package/src/Push/utils/push-utils.js +9 -9
  61. package/src/User/user-manager.js +8 -8
  62. package/src/User/user.js +38 -37
  63. package/src/common/base-feed.js +15 -14
  64. package/src/common/base-provider.js +1 -1
  65. package/src/common/event-logger.js +2 -2
  66. package/src/common/feed-display.js +32 -32
  67. package/src/l10n/l10n-manager-factory.js +9 -9
  68. package/src/managers/auth-manager.js +6 -6
  69. package/src/managers/braze-instance.js +84 -92
  70. package/src/managers/device-manager.js +9 -9
  71. package/src/managers/network-manager.js +72 -69
  72. package/src/managers/server-config-manager.js +13 -13
  73. package/src/managers/session-manager.js +9 -9
  74. package/src/managers/storage-manager-factory.js +11 -11
  75. package/src/managers/storage-manager.js +110 -110
  76. package/src/managers/subscription-manager.js +3 -3
  77. package/src/models/backend-errors.js +5 -5
  78. package/src/models/braze-event.js +7 -7
  79. package/src/models/identifier.js +1 -1
  80. package/src/models/push-token.js +1 -1
  81. package/src/models/server-config.js +6 -6
  82. package/src/request-controller.js +129 -125
  83. package/src/triggers/models/custom-event-data.js +1 -1
  84. package/src/triggers/models/custom-event-property-data.js +6 -6
  85. package/src/triggers/models/filter-set.js +8 -8
  86. package/src/triggers/models/filter.js +31 -31
  87. package/src/triggers/models/in-app-message-click-data.js +1 -1
  88. package/src/triggers/models/purchase-data.js +1 -1
  89. package/src/triggers/models/purchase-property-data.js +4 -4
  90. package/src/triggers/models/push-click-data.js +3 -3
  91. package/src/triggers/models/trigger-condition.js +30 -30
  92. package/src/triggers/models/trigger-events.js +1 -1
  93. package/src/triggers/models/trigger.js +32 -32
  94. package/src/triggers/triggers-provider.js +55 -55
  95. package/src/ui/js/attach-css.js +1 -1
  96. package/src/ui/js/feed-css.js +5 -5
  97. package/src/ui/js/iam-css.js +4 -4
  98. package/src/ui/js/load-font-awesome.js +1 -1
  99. package/src/util/braze-actions.js +4 -4
  100. package/src/util/browser-detector.js +11 -11
  101. package/src/util/client-hints-parser.js +5 -5
  102. package/src/util/component-utils.js +2 -2
  103. package/src/util/date-utils.js +2 -2
  104. package/src/util/device-constants.js +4 -5
  105. package/src/util/dom-utils.js +5 -5
  106. package/src/util/net.js +1 -1
  107. package/src/util/request-header-utils.js +17 -17
  108. package/src/util/user-agent-parser.js +11 -16
  109. package/src/util/validation-utils.js +9 -9
  110. package/src/Card/models/banner.js +0 -31
  111. package/src/ContentCards/log-content-cards-displayed.js +0 -5
@@ -2,7 +2,7 @@ import e from "../managers/braze-instance.js";
2
2
  import { getByteLength as U } from "../util/string-utils.js";
3
3
  import r from "../../shared-lib/braze-shared-lib.js";
4
4
  import { User } from "../User/index.js";
5
- import { validateStandardString as J } from "../util/validation-utils.js";
5
+ import { validateStandardString as H } from "../util/validation-utils.js";
6
6
  export function changeUser(i, t) {
7
7
  if (!e.rr()) return;
8
8
  if (null == i || 0 === i.length || i != i)
@@ -11,7 +11,7 @@ export function changeUser(i, t) {
11
11
  return void r.j.error(
12
12
  `Rejected user id "${i}" because it is longer than ${User.lr} bytes.`,
13
13
  );
14
- if (null != t && !J(t, "set signature for new user", "signature")) return;
14
+ if (null != t && !H(t, "set signature for new user", "signature")) return;
15
15
  const s = e.cr();
16
16
  s && s.changeUser(i.toString(), e.gr(), t);
17
17
  }
@@ -1,14 +1,14 @@
1
1
  import e from "../managers/braze-instance.js";
2
2
  import r from "../../shared-lib/braze-shared-lib.js";
3
- import O, { STORAGE_KEYS as i } from "../managers/storage-manager.js";
3
+ import J, { STORAGE_KEYS as i } from "../managers/storage-manager.js";
4
4
  export function disableSDK() {
5
5
  const a = e.cr();
6
6
  a && a.requestImmediateDataFlush();
7
- const s = new O.ee(null, !0),
7
+ const s = new J.ee(null, !0),
8
8
  n = "This-cookie-will-expire-in-" + s.ae();
9
9
  s.store(i.re, n);
10
- const o = r.zt.Ft;
11
- new r.xt(o, r.j).setItem(o.Jt.se, o.ie, !0),
10
+ const o = r.ts.Zt;
11
+ new r.es(o, r.j).setItem(o.rs.se, o.ie, !0),
12
12
  r.j.info("disableSDK was called"),
13
13
  e.destroy(!1),
14
14
  e.ne(!0);
@@ -1,10 +1,10 @@
1
1
  import e from "../managers/braze-instance.js";
2
2
  import r from "../../shared-lib/braze-shared-lib.js";
3
- import O, { STORAGE_KEYS as i } from "../managers/storage-manager.js";
3
+ import J, { STORAGE_KEYS as i } from "../managers/storage-manager.js";
4
4
  export function enableSDK() {
5
- new O.ee(null, !0).remove(i.re);
6
- const a = r.zt.Ft;
7
- new r.xt(a, r.j).oe(a.Jt.se, a.ie),
5
+ new J.ee(null, !0).remove(i.re);
6
+ const a = r.ts.Zt;
7
+ new r.es(a, r.j).oe(a.rs.se, a.ie),
8
8
  r.j.info("enableSDK was called"),
9
9
  e.destroy(!1),
10
10
  e.ne(!1);
@@ -1,11 +1,13 @@
1
1
  import e from "../managers/braze-instance.js";
2
2
  import r from "../../shared-lib/braze-shared-lib.js";
3
- export function getDeviceId(i) {
3
+ export function getDeviceId(t) {
4
4
  if (!e.rr()) return;
5
- null == i &&
6
- r.j.error(
7
- "getDeviceId must be supplied with a callback. e.g., braze.getDeviceId(function(deviceId) {console.log('the device id is ' + deviceId)})",
8
- );
9
- const t = e.te();
10
- "function" == typeof i && t && i(t.ce().id);
5
+ const i = e.te();
6
+ if (!i) return;
7
+ const c = i.ce().id;
8
+ if ("function" != typeof t) return c;
9
+ r.j.warn(
10
+ "The callback for getDeviceId is deprecated. You can access its return value directly instead (e.g. `const id = braze.getDeviceId()`)",
11
+ ),
12
+ t(c);
11
13
  }
@@ -3,23 +3,23 @@ import { BRAZE_MUST_BE_INITIALIZED_ERROR as P } from "../common/constants.js";
3
3
  import e from "../managers/braze-instance.js";
4
4
  import {
5
5
  BRAZE_ACTIONS as _,
6
- getDecodedBrazeAction as Q,
6
+ getDecodedBrazeAction as O,
7
7
  } from "../util/braze-actions.js";
8
- import V from "../util/browser-detector.js";
9
- import { OperatingSystems as W } from "../util/device-constants.js";
8
+ import Q from "../util/browser-detector.js";
9
+ import { OperatingSystems as V } from "../util/device-constants.js";
10
10
  import {
11
- BRAZE_ACTION_URI_REGEX as X,
12
- isValidBrazeActionJson as Y,
11
+ BRAZE_ACTION_URI_REGEX as W,
12
+ isValidBrazeActionJson as X,
13
13
  } from "../util/validation-utils.js";
14
- import { WindowUtils as Z } from "../util/window-utils.js";
15
- import { getUser as ee } from "./get-user.js";
14
+ import { WindowUtils as Y } from "../util/window-utils.js";
15
+ import { getUser as Z } from "./get-user.js";
16
16
  export function _handleBrazeAction(o, s, t) {
17
17
  if (e.rr())
18
- if (X.test(o)) {
19
- const s = Q(o);
18
+ if (W.test(o)) {
19
+ const s = O(o);
20
20
  if (!s) return;
21
21
  const t = (o) => {
22
- if (!Y(o))
22
+ if (!X(o))
23
23
  return void r.j.error(
24
24
  `Decoded Braze Action json is invalid: ${JSON.stringify(
25
25
  o,
@@ -52,7 +52,7 @@ export function _handleBrazeAction(o, s, t) {
52
52
  import("../Push/request-push-permission.js").then(
53
53
  ({ requestPushPermission: requestPushPermission }) => {
54
54
  e.fe()
55
- ? "Safari" === V.browser && V.OS === W.de
55
+ ? "Safari" === Q.browser && Q.OS === V.de
56
56
  ? window.navigator.standalone && requestPushPermission()
57
57
  : requestPushPermission()
58
58
  : r.j.error(P);
@@ -66,13 +66,13 @@ export function _handleBrazeAction(o, s, t) {
66
66
  case _.types.removeFromSubscriptionGroup:
67
67
  case _.types.addToCustomAttributeArray:
68
68
  case _.types.removeFromCustomAttributeArray:
69
- if (((t = ee()), t)) {
69
+ if (((t = Z()), t)) {
70
70
  t[a](...Array.prototype.slice.call(s));
71
71
  }
72
72
  break;
73
73
  case _.types.pe:
74
74
  case _.types.je:
75
- (i = Array.prototype.slice.call(s)), Z.openUri(...i);
75
+ (i = Array.prototype.slice.call(s)), Y.openUri(...i);
76
76
  break;
77
77
  default:
78
78
  r.j.info(`Ignoring unknown Braze Action: ${a}`);
@@ -80,7 +80,7 @@ export function _handleBrazeAction(o, s, t) {
80
80
  }
81
81
  };
82
82
  t(s);
83
- } else Z.openUri(o, s, t);
83
+ } else Y.openUri(o, s, t);
84
84
  }
85
85
  export function handleBrazeAction(e, o) {
86
86
  _handleBrazeAction(e, o);
@@ -1,4 +1,4 @@
1
- import O, { STORAGE_KEYS as i } from "../managers/storage-manager.js";
1
+ import J, { STORAGE_KEYS as i } from "../managers/storage-manager.js";
2
2
  export function isDisabled() {
3
- return !!new O.ee(null, !0).jr(i.re);
3
+ return !!new J.ee(null, !0).jr(i.re);
4
4
  }
@@ -7,9 +7,9 @@ export function openSession() {
7
7
  const i = e.cr();
8
8
  if (!i) return;
9
9
  i.openSession();
10
- const t = r.zt.Ft,
11
- o = new r.xt(t, r.j);
12
- o.hr(t.Jt.kr, (e, s) => {
10
+ const t = r.ts.Zt,
11
+ o = new r.es(t, r.j);
12
+ o.hr(t.rs.kr, (e, s) => {
13
13
  const n = s.lastClick,
14
14
  c = s.trackingString;
15
15
  r.j.info(`Firing push click trigger from ${c} push click at ${n}`);
@@ -17,9 +17,9 @@ export function openSession() {
17
17
  f = function () {
18
18
  et.er().be(tt.zr, [c], g);
19
19
  };
20
- i.$r(f, f), o.oe(t.Jt.kr, e);
20
+ i.$r(f, f), o.oe(t.rs.kr, e);
21
21
  }),
22
- o.Mt(t.Jt.wr, function (r) {
22
+ o.ss(t.rs.wr, function (r) {
23
23
  i.yr(r);
24
24
  });
25
25
  }
@@ -1,8 +1,8 @@
1
1
  import e from "../managers/braze-instance.js";
2
- import { validateStandardString as J } from "../util/validation-utils.js";
2
+ import { validateStandardString as H } from "../util/validation-utils.js";
3
3
  export function setSdkAuthenticationSignature(t) {
4
4
  if (!e.rr()) return !1;
5
- if ("" === t || !J(t, "set signature", "signature", !1)) return !1;
5
+ if ("" === t || !H(t, "set signature", "signature", !1)) return !1;
6
6
  const r = e.Sr();
7
7
  return !!r && (r.setSdkAuthenticationSignature(t), !0);
8
8
  }
@@ -3,14 +3,14 @@ import { keys as oo } from "../util/code-utils.js";
3
3
  import r from "../../shared-lib/braze-shared-lib.js";
4
4
  import { BRAZE_MUST_BE_INITIALIZED_ERROR as P } from "../common/constants.js";
5
5
  export function wipeData() {
6
- if (null == e.l()) throw new Error(P);
6
+ if (null == e.l()) return void r.j.warn(P);
7
7
  const o = e.l();
8
8
  o && o.clearData();
9
- const t = oo(r.zt);
9
+ const t = oo(r.ts);
10
10
  for (let o = 0; o < t.length; o++) {
11
11
  const n = t[o],
12
- s = r.zt[n];
13
- new r.xt(s, r.j).clearData();
12
+ s = r.ts[n];
13
+ new r.es(s, r.j).clearData();
14
14
  }
15
15
  if (e.rr()) for (const o of e.gr()) o.clearData(!0);
16
16
  }
@@ -1,22 +1,22 @@
1
1
  import r from "../../shared-lib/braze-shared-lib.js";
2
2
  import FeatureFlag from "./feature-flag.js";
3
3
  export function newFeatureFlagFromJson(e) {
4
- if (e[FeatureFlag.Tt.ns] && "boolean" == typeof e[FeatureFlag.Tt.Fe])
4
+ if (e[FeatureFlag.Rt.rt] && "boolean" == typeof e[FeatureFlag.Rt.Fe])
5
5
  return new FeatureFlag(
6
- e[FeatureFlag.Tt.ns],
7
- e[FeatureFlag.Tt.Fe],
8
- e[FeatureFlag.Tt.we],
9
- e[FeatureFlag.Tt.ze],
6
+ e[FeatureFlag.Rt.rt],
7
+ e[FeatureFlag.Rt.Fe],
8
+ e[FeatureFlag.Rt.we],
9
+ e[FeatureFlag.Rt.ze],
10
10
  );
11
11
  r.j.info(`Unable to create feature flag from ${JSON.stringify(e, null, 2)}`);
12
12
  }
13
13
  export function newFeatureFlagFromSerializedValue(e) {
14
- if (e[FeatureFlag.hs.ns] && "boolean" == typeof e[FeatureFlag.hs.Fe])
14
+ if (e[FeatureFlag.it.rt] && "boolean" == typeof e[FeatureFlag.it.Fe])
15
15
  return new FeatureFlag(
16
- e[FeatureFlag.hs.ns],
17
- e[FeatureFlag.hs.Fe],
18
- e[FeatureFlag.hs.we],
19
- e[FeatureFlag.hs.ze],
16
+ e[FeatureFlag.it.rt],
17
+ e[FeatureFlag.it.Fe],
18
+ e[FeatureFlag.it.we],
19
+ e[FeatureFlag.it.ze],
20
20
  );
21
21
  r.j.info(
22
22
  `Unable to deserialize feature flag from ${JSON.stringify(e, null, 2)}`,
@@ -34,13 +34,13 @@ export default class FeatureFlag {
34
34
  ? r.value
35
35
  : (this.Nr("boolean"), null);
36
36
  }
37
- ss() {
37
+ tt() {
38
38
  const t = {};
39
39
  return (
40
- (t[FeatureFlag.hs.ns] = this.id),
41
- (t[FeatureFlag.hs.Fe] = this.enabled),
42
- (t[FeatureFlag.hs.we] = this.properties),
43
- (t[FeatureFlag.hs.ze] = this.trackingString),
40
+ (t[FeatureFlag.it.rt] = this.id),
41
+ (t[FeatureFlag.it.Fe] = this.enabled),
42
+ (t[FeatureFlag.it.we] = this.properties),
43
+ (t[FeatureFlag.it.ze] = this.trackingString),
44
44
  t
45
45
  );
46
46
  }
@@ -60,5 +60,5 @@ export default class FeatureFlag {
60
60
  return "boolean" === t.type && "boolean" == typeof t.value;
61
61
  }
62
62
  }
63
- (FeatureFlag.hs = { ns: "id", Fe: "e", we: "pr", ze: "fts" }),
64
- (FeatureFlag.Tt = { ns: "id", Fe: "enabled", we: "properties", ze: "fts" });
63
+ (FeatureFlag.it = { rt: "id", Fe: "e", we: "pr", ze: "fts" }),
64
+ (FeatureFlag.Rt = { rt: "id", Fe: "enabled", we: "properties", ze: "fts" });
@@ -13,29 +13,29 @@ import T from "../util/request-header-utils.js";
13
13
  export default class er extends y {
14
14
  constructor(t, s, i) {
15
15
  super(),
16
- (this.wt = t),
17
- (this.gt = s),
16
+ (this.yt = t),
17
+ (this.$t = s),
18
18
  (this.u = i),
19
- (this.pi = []),
20
- (this.gi = 0),
21
- (this.wt = t),
22
- (this.gt = s),
19
+ (this.gi = []),
20
+ (this.pi = 0),
21
+ (this.yt = t),
22
+ (this.$t = s),
23
23
  (this.u = i),
24
24
  (this.Fi = null),
25
25
  (this.wi = new E()),
26
- (this.yi = 10),
27
- (this.ji = null),
26
+ (this.ji = 10),
28
27
  (this.bi = null),
29
- e.jt(this.wi);
28
+ (this.vi = null),
29
+ e.Ht(this.wi);
30
30
  }
31
- Ts(t) {
32
- if ((!this.wt || this.wt.vi()) && null != t && t.feature_flags) {
33
- this.pi = [];
31
+ Ss(t) {
32
+ if ((!this.yt || this.yt.yi()) && null != t && t.feature_flags) {
33
+ this.gi = [];
34
34
  for (const s of t.feature_flags) {
35
35
  const t = st(s);
36
- t && this.pi.push(t);
36
+ t && this.gi.push(t);
37
37
  }
38
- (this.gi = new Date().getTime()), this.Ti(), this.wi.Et(this.pi);
38
+ (this.pi = new Date().getTime()), this.Ti(), this.wi.Dt(this.gi);
39
39
  }
40
40
  }
41
41
  Di() {
@@ -56,74 +56,74 @@ export default class er extends y {
56
56
  this.u && this.u.D(i.k.qi, t);
57
57
  }
58
58
  ri(t) {
59
- return this.wi.lt(t);
59
+ return this.wi.It(t);
60
60
  }
61
61
  refreshFeatureFlags(t, s, i = !1, e = !0) {
62
+ const r = () => {
63
+ "function" == typeof s && s(), this.wi.Dt(this.gi);
64
+ };
62
65
  if (!this.zi(i))
63
66
  return (
64
67
  !this.Fi &&
65
- this.wt &&
66
- (this.Fi = this.wt.Ci(() => {
68
+ this.yt &&
69
+ (this.Fi = this.yt.Ci(() => {
67
70
  this.refreshFeatureFlags(t, s);
68
71
  })),
69
- void ("function" == typeof s && s())
72
+ void r()
70
73
  );
71
- if ((e && this.Ii(), !this.gt)) return void ("function" == typeof s && s());
72
- const r = this.gt.Bs({}, !0),
73
- h = this.gt.Hs(r, T.Os.Si);
74
+ if ((e && this.Ii(), !this.$t)) return void r();
75
+ const h = this.$t.Bs({}, !0),
76
+ a = this.$t.Hs(h, T.Os.Si);
74
77
  let o = !1;
75
- this.gt.Qs(r, () => {
76
- this.gt
78
+ this.$t.Qs(h, () => {
79
+ this.$t
77
80
  ? (T.Ws(this.u, T.Os.Si, new Date().valueOf()),
78
81
  C.Xs({
79
- url: `${this.gt.Ys()}/feature_flags/sync`,
80
- headers: h,
81
- data: r,
82
- O: (i) => {
83
- if (!this.gt.Zs(r, i, h))
84
- return (o = !0), void ("function" == typeof s && s());
85
- this.gt.ti(),
86
- this.Ts(i),
82
+ url: `${this.$t.Ys()}/feature_flags/sync`,
83
+ headers: a,
84
+ data: h,
85
+ O: (s) => {
86
+ if (!this.$t.Zs(h, s, a)) return (o = !0), void r();
87
+ this.$t.ti(),
88
+ this.Ss(s),
87
89
  (o = !1),
88
90
  T.si(this.u, T.Os.Si, 1),
89
91
  "function" == typeof t && t();
90
92
  },
91
93
  error: (t) => {
92
- this.gt.ii(t, "retrieving feature flags"),
93
- (o = !0),
94
- "function" == typeof s && s();
94
+ this.$t.ii(t, "retrieving feature flags"), (o = !0), r();
95
95
  },
96
96
  ei: () => {
97
- if (e && o && !this.bi) {
97
+ if (e && o && !this.vi) {
98
98
  T.hi(this.u, T.Os.Si);
99
- let e = this.ji;
100
- (null == e || e < 1e3 * this.yi) && (e = 1e3 * this.yi),
101
- this.$i(Math.min(3e5, D(1e3 * this.yi, 3 * e)), t, s, i);
99
+ let e = this.bi;
100
+ (null == e || e < 1e3 * this.ji) && (e = 1e3 * this.ji),
101
+ this.$i(Math.min(3e5, D(1e3 * this.ji, 3 * e)), t, s, i);
102
102
  }
103
103
  },
104
104
  }))
105
- : "function" == typeof s && s();
105
+ : r();
106
106
  });
107
107
  }
108
108
  Ii() {
109
- null != this.bi && (clearTimeout(this.bi), (this.bi = null));
109
+ null != this.vi && (clearTimeout(this.vi), (this.vi = null));
110
110
  }
111
- $i(t = 1e3 * this.yi, s, i, e = !1) {
111
+ $i(t = 1e3 * this.ji, s, i, e = !1) {
112
112
  this.Ii(),
113
- (this.bi = window.setTimeout(() => {
113
+ (this.vi = window.setTimeout(() => {
114
114
  this.refreshFeatureFlags(s, i, e);
115
115
  }, t)),
116
- (this.ji = t);
116
+ (this.bi = t);
117
117
  }
118
118
  zi(t) {
119
- if (!this.wt) return !1;
119
+ if (!this.yt) return !1;
120
120
  if (!t) {
121
- const t = this.wt.Mi();
121
+ const t = this.yt.Mi();
122
122
  if (null == t) return !1;
123
123
  let s = !1;
124
124
  if (!isNaN(t)) {
125
125
  if (-1 === t) return r.j.info("Feature flag refreshes not allowed"), !1;
126
- s = new Date().getTime() >= (this.gi || 0) + 1e3 * t;
126
+ s = new Date().getTime() >= (this.pi || 0) + 1e3 * t;
127
127
  }
128
128
  if (!s)
129
129
  return (
@@ -131,15 +131,15 @@ export default class er extends y {
131
131
  !1
132
132
  );
133
133
  }
134
- return this.wt.vi();
134
+ return this.yt.yi();
135
135
  }
136
136
  Ti() {
137
137
  if (!this.u) return;
138
138
  const t = {};
139
- for (const s of this.pi) {
140
- const i = s.ss();
139
+ for (const s of this.gi) {
140
+ const i = s.tt();
141
141
  t[s.id] = i;
142
142
  }
143
- this.u.D(i.k.Ri, t), this.u.D(i.k.Ui, this.gi);
143
+ this.u.D(i.k.Ri, t), this.u.D(i.k.Ui, this.pi);
144
144
  }
145
145
  }
@@ -5,7 +5,7 @@ export function getAllFeatureFlags() {
5
5
  if (!e.rr()) return;
6
6
  const t = [],
7
7
  a = e.tr();
8
- if (a && !a.vi()) return r.j.info("Feature flags are not enabled."), t;
8
+ if (a && !a.yi()) return r.j.info("Feature flags are not enabled."), t;
9
9
  const o = ir.er().Di();
10
10
  for (const r in o) t.push(o[r]);
11
11
  return t;
@@ -1,12 +1,10 @@
1
1
  import r from "../../shared-lib/braze-shared-lib.js";
2
2
  import e from "../managers/braze-instance.js";
3
- import FeatureFlag from "./feature-flag.js";
4
3
  import ir from "./feature-flags-provider-factory.js";
5
4
  export function getFeatureFlag(t) {
6
5
  if (!e.rr()) return;
7
6
  const a = e.tr();
8
- if (a && !a.vi())
9
- return r.j.info("Feature flags are not enabled."), new FeatureFlag(t);
10
- const o = ir.er().Di();
11
- return o[t] ? o[t] : new FeatureFlag(t);
7
+ if (a && !a.yi()) return r.j.info("Feature flags are not enabled."), null;
8
+ const n = ir.er().Di();
9
+ return n[t] ? n[t] : null;
12
10
  }
@@ -1,18 +1,18 @@
1
1
  import e from "../managers/braze-instance.js";
2
- import re from "./feed-provider.js";
3
- const ie = {
2
+ import ee from "./feed-provider.js";
3
+ const re = {
4
4
  t: !1,
5
5
  provider: null,
6
6
  er: () => (
7
- ie.o(),
8
- ie.provider || ((ie.provider = new re(e.l(), e.cr())), e.dr(ie.provider)),
9
- ie.provider
7
+ re.o(),
8
+ re.provider || ((re.provider = new ee(e.l(), e.cr())), e.dr(re.provider)),
9
+ re.provider
10
10
  ),
11
11
  o: () => {
12
- ie.t || (e.g(ie), (ie.t = !0));
12
+ re.t || (e.g(re), (re.t = !0));
13
13
  },
14
14
  destroy: () => {
15
- (ie.provider = null), (ie.t = !1);
15
+ (re.provider = null), (re.t = !1);
16
16
  },
17
17
  };
18
- export default ie;
18
+ export default re;
@@ -8,7 +8,7 @@ import {
8
8
  import { rehydrateDateAfterJsonization as w } from "../util/date-utils.js";
9
9
  import { STORAGE_KEYS as i } from "../managers/storage-manager.js";
10
10
  import E from "../managers/subscription-manager.js";
11
- export default class re extends y {
11
+ export default class ee extends y {
12
12
  constructor(t, s) {
13
13
  super(),
14
14
  (this.u = t),
@@ -17,11 +17,11 @@ export default class re extends y {
17
17
  (this.Ai = null),
18
18
  (this.u = t),
19
19
  (this.ki = s),
20
- (this.yt = new E()),
21
- e.jt(this.yt),
22
- this.Lt();
20
+ (this.Bt = new E()),
21
+ e.Ht(this.Bt),
22
+ this.Yt();
23
23
  }
24
- Lt() {
24
+ Yt() {
25
25
  let t = [];
26
26
  this.u && (t = this.u.v(i.k.Bi) || []);
27
27
  const s = [];
@@ -46,25 +46,25 @@ export default class re extends y {
46
46
  }
47
47
  }
48
48
  (this.cards = s),
49
- this.Rs(),
49
+ this.Ds(),
50
50
  (this.Ai = new Date()),
51
51
  this.u && (this.u.D(i.k.L, h), this.u.D(i.k.Ei, this.Ai));
52
52
  }
53
- Rs() {
53
+ Ds() {
54
54
  if (!this.u) return;
55
55
  const t = [];
56
- for (let s = 0; s < this.cards.length; s++) t.push(this.cards[s].ss());
56
+ for (let s = 0; s < this.cards.length; s++) t.push(this.cards[s].tt());
57
57
  this.u.D(i.k.Bi, t);
58
58
  }
59
- Ts(t) {
59
+ Ss(t) {
60
60
  null != t &&
61
61
  t.feed &&
62
- (this.Lt(),
62
+ (this.Yt(),
63
63
  this.Gi(t.feed),
64
- this.yt.Et(new Feed(this.cards.slice(), this.Ai)));
64
+ this.Bt.Dt(new Feed(this.cards.slice(), this.Ai)));
65
65
  }
66
66
  Hi() {
67
- this.Lt();
67
+ this.Yt();
68
68
  const t = [],
69
69
  s = new Date();
70
70
  for (let i = 0; i < this.cards.length; i++) {
@@ -74,17 +74,17 @@ export default class re extends y {
74
74
  }
75
75
  return new Feed(t, this.Ai);
76
76
  }
77
- Ms() {
77
+ xs() {
78
78
  this.ki && this.ki.requestFeedRefresh();
79
79
  }
80
80
  ri(t) {
81
- return this.yt.lt(t);
81
+ return this.Bt.It(t);
82
82
  }
83
83
  clearData(t) {
84
84
  null == t && (t = !1),
85
85
  (this.cards = []),
86
86
  (this.Ai = null),
87
87
  t && this.u && (this.u.ni(i.k.Bi), this.u.ni(i.k.Ei)),
88
- this.yt.Et(new Feed(this.cards.slice(), this.Ai));
88
+ this.Bt.Dt(new Feed(this.cards.slice(), this.Ai));
89
89
  }
90
90
  }
@@ -1,5 +1,5 @@
1
1
  import e from "../managers/braze-instance.js";
2
- import ie from "./feed-provider-factory.js";
2
+ import re from "./feed-provider-factory.js";
3
3
  export function getCachedFeed() {
4
- if (e.rr()) return ie.er().Hi();
4
+ if (e.rr()) return re.er().Hi();
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import e from "../managers/braze-instance.js";
2
- import ie from "./feed-provider-factory.js";
2
+ import re from "./feed-provider-factory.js";
3
3
  export function requestFeedRefresh() {
4
- if (e.rr()) return ie.er().Ms();
4
+ if (e.rr()) return re.er().xs();
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import e from "../managers/braze-instance.js";
2
- import ie from "./feed-provider-factory.js";
2
+ import re from "./feed-provider-factory.js";
3
3
  export function subscribeToFeedUpdates(r) {
4
- if (e.rr()) return ie.er().ri(r);
4
+ if (e.rr()) return re.er().ri(r);
5
5
  }
@@ -1,7 +1,7 @@
1
1
  import e from "../../managers/braze-instance.js";
2
- import { destroyFeedHtml as k } from "../../common/feed-display.js";
2
+ import { destroyFeedHtml as z } from "../../common/feed-display.js";
3
3
  export function destroyFeed() {
4
4
  if (!e.rr()) return;
5
5
  const o = document.querySelectorAll(".ab-feed");
6
- for (let e = 0; e < o.length; e++) k(o[e]);
6
+ for (let e = 0; e < o.length; e++) z(o[e]);
7
7
  }