@braze/web-sdk 6.8.0 → 6.10.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 (141) hide show
  1. package/index.d.ts +113 -21
  2. package/package.json +1 -1
  3. package/shared-lib/event-types.js +20 -20
  4. package/shared-lib/indexed-db-adapter.js +64 -64
  5. package/shared-lib/logger.js +18 -18
  6. package/shared-lib/supported-options.js +8 -8
  7. package/src/Banner/banner-provider.js +67 -59
  8. package/src/Banner/banner.js +40 -19
  9. package/src/Banner/dismiss-banner.js +4 -0
  10. package/src/Banner/display/banner-to-html.js +10 -10
  11. package/src/Banner/display/destroy-banner-html.js +2 -2
  12. package/src/Banner/get-all-banners.js +6 -6
  13. package/src/Banner/get-banner.js +6 -6
  14. package/src/Banner/index.js +1 -0
  15. package/src/Banner/log-banner-click.js +7 -7
  16. package/src/Banner/log-banner-dismissal.js +7 -7
  17. package/src/Banner/log-banner-impressions.js +10 -10
  18. package/src/Banner/request-banners-refresh.js +8 -8
  19. package/src/Banner/subscribe-to-banners-updates.js +5 -5
  20. package/src/Banner/ui/insert-banner.js +8 -8
  21. package/src/Card/card-manager.js +31 -31
  22. package/src/Card/log-card-dismissal.js +2 -2
  23. package/src/Card/log-content-card-click.js +2 -2
  24. package/src/Card/log-content-card-impressions.js +4 -4
  25. package/src/Card/models/captioned-image.js +15 -15
  26. package/src/Card/models/card.js +89 -89
  27. package/src/Card/models/classic-card.js +16 -16
  28. package/src/Card/models/control-card.js +7 -7
  29. package/src/Card/models/image-only.js +13 -13
  30. package/src/Card/util/card-factory.js +32 -32
  31. package/src/ContentCards/content-cards-provider.js +102 -102
  32. package/src/ContentCards/get-cached-content-cards.js +1 -1
  33. package/src/ContentCards/subscribe-to-content-cards-updates.js +3 -3
  34. package/src/ContentCards/ui/show-content-cards.js +5 -5
  35. package/src/Core/add-sdk-metadata.js +2 -2
  36. package/src/Core/change-user.js +3 -3
  37. package/src/Core/destroy.js +2 -2
  38. package/src/Core/disable-sdk.js +4 -4
  39. package/src/Core/enable-sdk.js +4 -4
  40. package/src/Core/get-device-id.js +2 -2
  41. package/src/Core/handle-braze-action.js +5 -5
  42. package/src/Core/index.js +1 -0
  43. package/src/Core/log-custom-event.js +5 -5
  44. package/src/Core/log-ecommerce-event.js +5 -5
  45. package/src/Core/log-purchase.js +9 -9
  46. package/src/Core/logout.js +22 -0
  47. package/src/Core/open-session.js +7 -7
  48. package/src/Core/set-logger.js +2 -2
  49. package/src/Core/toggle-logging.js +2 -2
  50. package/src/Core/wipe-data.js +6 -6
  51. package/src/DUST/dust-provider.js +249 -240
  52. package/src/DUST/dust-shared-worker-code.js +1 -1
  53. package/src/DUST/dust-shared-worker-impl.js +15 -14
  54. package/src/DUST/dust-worker-bridge.js +50 -35
  55. package/src/DUST/subscribe-to-dust.js +7 -7
  56. package/src/FeatureFlags/feature-flag-factory.js +8 -8
  57. package/src/FeatureFlags/feature-flag.js +3 -3
  58. package/src/FeatureFlags/feature-flags-provider.js +21 -21
  59. package/src/FeatureFlags/log-feature-flag-impression.js +5 -5
  60. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +1 -1
  61. package/src/InAppMessage/constants.js +3 -3
  62. package/src/InAppMessage/defer-in-app-message.js +4 -4
  63. package/src/InAppMessage/display/html-message-to-html.js +4 -4
  64. package/src/InAppMessage/display/in-app-message-to-html.js +16 -16
  65. package/src/InAppMessage/in-app-message-factory.js +36 -36
  66. package/src/InAppMessage/in-app-message-manager.js +78 -78
  67. package/src/InAppMessage/log-in-app-message-button-click.js +4 -4
  68. package/src/InAppMessage/log-in-app-message-click.js +3 -3
  69. package/src/InAppMessage/log-in-app-message-html-click.js +5 -5
  70. package/src/InAppMessage/log-in-app-message-impression.js +4 -4
  71. package/src/InAppMessage/models/control-message.js +4 -4
  72. package/src/InAppMessage/models/full-screen-message.js +4 -4
  73. package/src/InAppMessage/models/html-message.js +3 -3
  74. package/src/InAppMessage/models/in-app-message-button.js +4 -4
  75. package/src/InAppMessage/models/in-app-message.js +12 -12
  76. package/src/InAppMessage/models/modal-message.js +4 -4
  77. package/src/InAppMessage/models/slide-up-message.js +4 -4
  78. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  79. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  80. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
  81. package/src/InAppMessage/ui/show-in-app-message.js +14 -14
  82. package/src/Push/push-manager-factory.js +2 -2
  83. package/src/Push/push-manager.js +38 -38
  84. package/src/Push/unregister-push-token-on-server.js +35 -0
  85. package/src/Push/unregister-push.js +2 -1
  86. package/src/Push/utils/push-utils.js +6 -6
  87. package/src/User/user-manager.js +14 -14
  88. package/src/User/user.js +25 -25
  89. package/src/common/base-provider.js +1 -1
  90. package/src/common/content-cards-display.js +7 -7
  91. package/src/common/event-logger.js +3 -3
  92. package/src/common/properties-base.js +3 -3
  93. package/src/l10n/l10n-manager-factory.js +2 -2
  94. package/src/l10n/l10n-manager.js +4 -4
  95. package/src/managers/auth-manager.js +11 -11
  96. package/src/managers/braze-instance.js +56 -56
  97. package/src/managers/device-manager.js +10 -10
  98. package/src/managers/network-manager.js +103 -102
  99. package/src/managers/server-config-manager.js +112 -95
  100. package/src/managers/session-manager.js +20 -20
  101. package/src/managers/storage-manager-factory.js +9 -9
  102. package/src/managers/storage-manager.js +73 -73
  103. package/src/managers/subscription-manager.js +2 -2
  104. package/src/managers/utils.js +1 -1
  105. package/src/models/backend-errors.js +5 -5
  106. package/src/models/braze-event.js +1 -1
  107. package/src/models/device.js +1 -1
  108. package/src/models/identifier.js +2 -2
  109. package/src/models/push-token.js +6 -6
  110. package/src/models/request-result.js +1 -1
  111. package/src/models/server-config.js +42 -24
  112. package/src/request-controller.js +126 -126
  113. package/src/triggers/models/custom-event-data.js +4 -4
  114. package/src/triggers/models/custom-event-property-data.js +5 -5
  115. package/src/triggers/models/filter-set.js +2 -2
  116. package/src/triggers/models/filter.js +1 -1
  117. package/src/triggers/models/in-app-message-click-data.js +1 -1
  118. package/src/triggers/models/purchase-data.js +1 -1
  119. package/src/triggers/models/purchase-property-data.js +2 -2
  120. package/src/triggers/models/push-click-data.js +3 -3
  121. package/src/triggers/models/trigger-condition.js +36 -36
  122. package/src/triggers/models/trigger-events.js +1 -1
  123. package/src/triggers/models/trigger.js +33 -33
  124. package/src/triggers/triggers-provider-factory.js +1 -1
  125. package/src/triggers/triggers-provider.js +68 -68
  126. package/src/types.js +2 -2
  127. package/src/ui/js/attach-css.js +1 -1
  128. package/src/util/braze-actions.js +7 -7
  129. package/src/util/browser-detector.js +2 -2
  130. package/src/util/client-hints-parser.js +4 -4
  131. package/src/util/code-utils.js +2 -2
  132. package/src/util/deprecation-utils.js +2 -2
  133. package/src/util/dom-utils.js +7 -7
  134. package/src/util/ecommerce-event-validation.js +52 -35
  135. package/src/util/html-display-utils.js +11 -11
  136. package/src/util/net.js +4 -4
  137. package/src/util/request-header-utils.js +36 -35
  138. package/src/util/string-utils.js +2 -2
  139. package/src/util/user-agent-parser.js +2 -2
  140. package/src/util/validation-utils.js +12 -12
  141. package/src/util/window-utils.js +2 -2
@@ -1,16 +1,16 @@
1
- import { logger as E, EventTypes as p } from "../../shared-lib/index.js";
1
+ import { logger as b, EventTypes as p } from "../../shared-lib/index.js";
2
2
  import v from "../common/event-logger.js";
3
3
  import r from "../managers/braze-instance.js";
4
- import { keys as D } from "../util/code-utils.js";
4
+ import { keys as C } from "../util/code-utils.js";
5
5
  import i from "./banner-provider-factory.js";
6
6
  export function logBannerImpressions(o) {
7
7
  if (!r.rr()) return;
8
8
  if (!o || o.length <= 0) return !1;
9
9
  const n = i.o(),
10
10
  s = n.k();
11
- if (0 === D(s).length)
12
- return E.info("Not logging banners impression. No banners exist."), !1;
13
- let e = n.Ut(),
11
+ if (0 === C(s).length)
12
+ return b.info("Not logging banners impression. No banners exist."), !1;
13
+ let e = n.Wt(),
14
14
  t = !1;
15
15
  if (Object.keys(e).some((o) => void 0 !== s[o])) {
16
16
  const o = {};
@@ -25,16 +25,16 @@ export function logBannerImpressions(o) {
25
25
  const o = s[n];
26
26
  o
27
27
  ? e[o.id]
28
- ? E.info(
28
+ ? b.info(
29
29
  `Not logging banners impression for ID ${n}. This ID was already logged this session.`,
30
30
  )
31
31
  : ((e[o.id] = !0), a.push(o.id))
32
- : E.info(
32
+ : b.info(
33
33
  `Not logging banners impression for ID ${n}. The placement ID did not correspond to any banner.`,
34
34
  );
35
35
  }
36
- if (0 === a.length) return t && n.At(e), !1;
37
- n.At(e);
36
+ if (0 === a.length) return t && n.Mt(e), !1;
37
+ n.Mt(e);
38
38
  const f = { ids: a };
39
- return v.wt(p.ro, f).lt;
39
+ return v.Dt(p.ro, f).lt;
40
40
  }
@@ -1,24 +1,24 @@
1
- import { logger as E } from "../../shared-lib/index.js";
1
+ import { logger as b } from "../../shared-lib/index.js";
2
2
  import { CoreStrings as R } from "../common/constants.js";
3
- import { BannerStrings as j } from "./constants.js";
3
+ import { BannerStrings as x } from "./constants.js";
4
4
  import r from "../managers/braze-instance.js";
5
5
  import { isArray as g } from "../util/code-utils.js";
6
6
  import { isValidBannerPlacementId as J } from "../util/validation-utils.js";
7
7
  import i from "./banner-provider-factory.js";
8
8
  export function requestBannersRefresh(e, t, o) {
9
- if (!r.rr()) return void E.warn(R.ee);
9
+ if (!r.rr()) return void b.warn(R.ee);
10
10
  const n = r.l();
11
11
  if (!n) return;
12
12
  if (!g(e) || 0 === e.length)
13
- return void E.warn("placementIds should be a non-empty array.");
13
+ return void b.warn("placementIds should be a non-empty array.");
14
14
  const s = i.o();
15
- if ((!1 === n.Jt() && E.error(j.aa), !s.P()))
15
+ if ((!1 === n.Ot() && b.error(x.aa), !s.P()))
16
16
  return void n.V(() => {
17
17
  requestBannersRefresh(e, t, o);
18
18
  });
19
19
  const a = n.re();
20
20
  e.length > a &&
21
- (E.warn(
21
+ (b.warn(
22
22
  `Number of placement IDs requested exceeds the max allowed. Trimming placementIds array from length ${e.length} to ${a} (max allowed).`,
23
23
  ),
24
24
  (e = e.slice(0, a))),
@@ -26,11 +26,11 @@ export function requestBannersRefresh(e, t, o) {
26
26
  (e = e.filter(
27
27
  (e) =>
28
28
  !!J(e) ||
29
- (E.warn(
29
+ (b.warn(
30
30
  `Placement ID should be a valid utf8 string with no whitespaces, filtering out: ${e}`,
31
31
  ),
32
32
  !1),
33
33
  )).length &&
34
- (E.info(`Requesting banners for placement IDs: ${JSON.stringify(e)}`),
34
+ (b.info(`Requesting banners for placement IDs: ${JSON.stringify(e)}`),
35
35
  s.O(e, t, o));
36
36
  }
@@ -5,20 +5,20 @@ export function subscribeToBannersUpdates(n) {
5
5
  var o;
6
6
  if (!r.rr()) return;
7
7
  const t = i.o();
8
- if (t.xt()) {
8
+ if (t.zt()) {
9
9
  const r = getAllBanners();
10
10
  r && "function" == typeof n && n(r);
11
11
  }
12
- const s = t.zt(n);
13
- if (!t.Lt()) {
12
+ const s = t.Kt(n);
13
+ if (!t.Et()) {
14
14
  const n =
15
15
  null === (o = r.nn()) || void 0 === o
16
16
  ? void 0
17
17
  : o.rn(() => {
18
- const n = t.Ct();
18
+ const n = t.jt();
19
19
  n && n.length > 0 && t.O(n);
20
20
  });
21
- n && t.$t(n);
21
+ n && t.Lt(n);
22
22
  }
23
23
  return s;
24
24
  }
@@ -1,28 +1,28 @@
1
- import E from "../../../shared-lib/logger.js";
2
- import { BannerStrings as j } from "../constants.js";
1
+ import b from "../../../shared-lib/logger.js";
2
+ import { BannerStrings as x } from "../constants.js";
3
3
  import r, { OPTIONS as U } from "../../managers/braze-instance.js";
4
4
  import { setupBannerUI as S } from "../../ui/js/banner-css.js";
5
5
  import { addPassiveEventListener as F } from "../../util/dom-utils.js";
6
6
  import { bannerToHtml as G } from "../display/banner-to-html.js";
7
- import { destroyBannerHtml as A } from "../display/destroy-banner-html.js";
7
+ import { destroyBannerHtml as _ } from "../display/destroy-banner-html.js";
8
8
  import { detectBannerImpressions as H } from "../display/detect-banner-impressions.js";
9
9
  import { subscribeToBannersUpdates } from "../subscribe-to-banners-updates.js";
10
10
  export function insertBanner(e, n) {
11
11
  if (!r.rr()) return;
12
- if (!e) return void E.error("Not inserting banner: banner was not provided.");
12
+ if (!e) return void b.error("Not inserting banner: banner was not provided.");
13
13
  if (!n)
14
- return void E.error("Not inserting banner: parentNode was not provided.");
14
+ return void b.error("Not inserting banner: parentNode was not provided.");
15
15
  if (!r.er(U.nr))
16
- return void E.error(
16
+ return void b.error(
17
17
  "Banners are disabled. Use the 'allowUserSuppliedJavascript' option for braze.initialize to enable these messages.",
18
18
  );
19
19
  S();
20
20
  const o = G(e, r.er(U.sr)),
21
21
  s = subscribeToBannersUpdates((s) => {
22
22
  const i = s[e.placementId];
23
- i ? n.replaceChildren(G(i, r.er(U.sr))) : A(o);
23
+ i ? n.replaceChildren(G(i, r.er(U.sr))) : _(o);
24
24
  });
25
- s && o.setAttribute(j.ea, s),
25
+ s && o.setAttribute(x.ea, s),
26
26
  n.replaceChildren(o),
27
27
  F(window, "scroll", H),
28
28
  H();
@@ -1,73 +1,73 @@
1
1
  import { ControlCard } from "./models/index.js";
2
2
  import v from "../common/event-logger.js";
3
3
  import L from "../models/request-result.js";
4
- import { logger as E, EventTypes as p } from "../../shared-lib/index.js";
4
+ import { logger as b, EventTypes as p } from "../../shared-lib/index.js";
5
5
  import { STORAGE_KEYS as s } from "../managers/storage-manager.js";
6
6
  export default class M {
7
7
  constructor(t) {
8
- (this.C = t), (this.C = t);
8
+ (this.j = t), (this.j = t);
9
9
  }
10
10
  logClick(t) {
11
11
  const n = new L();
12
- if ((t.ss(), null == t.url || "" === t.url))
12
+ if ((t.Yt(), null == t.url || "" === t.url))
13
13
  return (
14
- E.info(`Card ${t.id} has no url. Not logging click to Braze servers.`),
14
+ b.info(`Card ${t.id} has no url. Not logging click to Braze servers.`),
15
15
  n
16
16
  );
17
- if (t.id && this.C) {
18
- const n = this.C.Rt(s.Tt.ns) || {};
19
- (n[t.id] = !0), this.C.It(s.Tt.ns, n);
17
+ if (t.id && this.j) {
18
+ const n = this.j.St(s.It.Zt) || {};
19
+ (n[t.id] = !0), this.j.Pt(s.It.Zt, n);
20
20
  }
21
- const r = this.rs([t]);
21
+ const r = this.ls([t]);
22
22
  if (null == r) return n;
23
- const i = p.os;
24
- return v.wt(i, r);
23
+ const i = p.us;
24
+ return v.Dt(i, r);
25
25
  }
26
- es(t) {
26
+ cs(t) {
27
27
  const n = new L();
28
- if (!t.ls())
28
+ if (!t.Ft())
29
29
  return (
30
- E.info(
30
+ b.info(
31
31
  `Card ${t.id} refused this dismissal. Ignoring analytics event.`,
32
32
  ),
33
33
  n
34
34
  );
35
- if (t.id && this.C) {
36
- const n = this.C.Rt(s.Tt.us) || {};
37
- (n[t.id] = !0), this.C.It(s.Tt.us, n);
35
+ if (t.id && this.j) {
36
+ const n = this.j.St(s.It.fs) || {};
37
+ (n[t.id] = !0), this.j.Pt(s.It.fs, n);
38
38
  }
39
- const r = this.rs([t]);
40
- return null == r ? n : v.wt(p.cs, r);
39
+ const r = this.ls([t]);
40
+ return null == r ? n : v.Dt(p.gs, r);
41
41
  }
42
- fs(t) {
42
+ ds(t) {
43
43
  const n = new L(!0),
44
44
  r = [],
45
45
  i = [];
46
46
  let o = {};
47
- this.C && (o = this.C.Rt(s.Tt.hs) || {});
47
+ this.j && (o = this.j.St(s.It.ps) || {});
48
48
  for (const s of t) {
49
- s.gs()
49
+ s.js()
50
50
  ? (s instanceof ControlCard ? i.push(s) : r.push(s),
51
51
  s.id && (o[s.id] = !0))
52
- : E.info(
52
+ : b.info(
53
53
  `Card ${s.id} logged an impression too recently. Ignoring analytics event.`,
54
54
  );
55
55
  }
56
- const e = this.rs(r),
57
- l = this.rs(i);
56
+ const e = this.ls(r),
57
+ l = this.ls(i);
58
58
  if (null == e && null == l) return (n.lt = !1), n;
59
- if ((this.C && this.C.It(s.Tt.hs, o), null != e)) {
60
- const t = p.ds,
61
- s = v.wt(t, e);
62
- n.ps(s);
59
+ if ((this.j && this.j.Pt(s.It.ps, o), null != e)) {
60
+ const t = p.vs,
61
+ s = v.Dt(t, e);
62
+ n.Cs(s);
63
63
  }
64
64
  if (null != l) {
65
- const t = v.wt(p.js, l);
66
- n.ps(t);
65
+ const t = v.Dt(p.ws, l);
66
+ n.Cs(t);
67
67
  }
68
68
  return n;
69
69
  }
70
- rs(t) {
70
+ ls(t) {
71
71
  let s,
72
72
  n = null;
73
73
  for (let r = 0; r < t.length; r++)
@@ -2,10 +2,10 @@ import { Card } from "./models/index.js";
2
2
  import K from "./card-manager-factory.js";
3
3
  import { CardStrings as W } from "./constants.js";
4
4
  import r from "../managers/braze-instance.js";
5
- import { logger as E } from "../../shared-lib/index.js";
5
+ import { logger as b } from "../../shared-lib/index.js";
6
6
  export function logCardDismissal(o) {
7
7
  return (
8
8
  !!r.rr() &&
9
- (o instanceof Card ? K.ra().es(o).lt : (E.error("card " + W.tr), !1))
9
+ (o instanceof Card ? K.ra().cs(o).lt : (b.error("card " + W.tr), !1))
10
10
  );
11
11
  }
@@ -1,4 +1,4 @@
1
- import E from "../../shared-lib/logger.js";
1
+ import b from "../../shared-lib/logger.js";
2
2
  import { CardStrings as W } from "./constants.js";
3
3
  import r from "../managers/braze-instance.js";
4
4
  import K from "./card-manager-factory.js";
@@ -6,6 +6,6 @@ import { Card } from "./models/index.js";
6
6
  export function logContentCardClick(o) {
7
7
  return (
8
8
  !!r.rr() &&
9
- (o instanceof Card ? K.ra().logClick(o).lt : (E.error("card " + W.tr), !1))
9
+ (o instanceof Card ? K.ra().logClick(o).lt : (b.error("card " + W.tr), !1))
10
10
  );
11
11
  }
@@ -1,13 +1,13 @@
1
1
  import { Card } from "./models/index.js";
2
2
  import r from "../managers/braze-instance.js";
3
3
  import { isArray as g } from "../util/code-utils.js";
4
- import E from "../../shared-lib/logger.js";
4
+ import b from "../../shared-lib/logger.js";
5
5
  import { CardStrings as W } from "./constants.js";
6
6
  import K from "./card-manager-factory.js";
7
7
  export function logContentCardImpressions(o) {
8
8
  if (!r.rr()) return !1;
9
- if (!g(o)) return E.error("cards must be an array"), !1;
9
+ if (!g(o)) return b.error("cards must be an array"), !1;
10
10
  for (const r of o)
11
- if (!(r instanceof Card)) return E.error(`Each card in cards ${W.tr}`), !1;
12
- return K.ra().fs(o).lt;
11
+ if (!(r instanceof Card)) return b.error(`Each card in cards ${W.tr}`), !1;
12
+ return K.ra().ds(o).lt;
13
13
  }
@@ -11,22 +11,22 @@ export default class CaptionedImage extends Card {
11
11
  return (
12
12
  (t[Card.bs.xs] = Card.ks.zs),
13
13
  (t[Card.bs.qs] = this.id),
14
- (t[Card.bs.vs] = this.viewed),
15
- (t[Card.bs.ws] = this.title),
16
- (t[Card.bs.ys] = this.imageUrl),
17
- (t[Card.bs.As] = this.description),
18
- (t[Card.bs.Bs] = this.updated),
19
- (t[Card.bs.Cs] = this.expiresAt),
14
+ (t[Card.bs.ys] = this.viewed),
15
+ (t[Card.bs.As] = this.title),
16
+ (t[Card.bs.Bs] = this.imageUrl),
17
+ (t[Card.bs.Ds] = this.description),
18
+ (t[Card.bs.Es] = this.updated),
19
+ (t[Card.bs.Fs] = this.expiresAt),
20
20
  (t[Card.bs.URL] = this.url),
21
- (t[Card.bs.Ds] = this.linkText),
22
- (t[Card.bs.Es] = this.aspectRatio),
23
- (t[Card.bs.Fs] = this.extras),
24
- (t[Card.bs.Gs] = this.pinned),
25
- (t[Card.bs.Hs] = this.dismissible),
26
- (t[Card.bs.Is] = this.clicked),
27
- (t[Card.bs.Js] = this.language),
28
- (t[Card.bs.Ks] = this.altImageText),
29
- (t[Card.bs.Ls] = this.test),
21
+ (t[Card.bs.Gs] = this.linkText),
22
+ (t[Card.bs.Hs] = this.aspectRatio),
23
+ (t[Card.bs.Is] = this.extras),
24
+ (t[Card.bs.Js] = this.pinned),
25
+ (t[Card.bs.Ks] = this.dismissible),
26
+ (t[Card.bs.Ls] = this.clicked),
27
+ (t[Card.bs.Ms] = this.language),
28
+ (t[Card.bs.Ns] = this.altImageText),
29
+ (t[Card.bs.Os] = this.test),
30
30
  t
31
31
  );
32
32
  }
@@ -4,7 +4,7 @@ import {
4
4
  } from "../../util/date-utils.js";
5
5
  import { FEED_ANIMATION_DURATION as Z } from "../../common/constants.js";
6
6
  import f from "../../managers/subscription-manager.js";
7
- import E from "../../../shared-lib/logger.js";
7
+ import b from "../../../shared-lib/logger.js";
8
8
  export default class Card {
9
9
  constructor(t, i, s, h, l, n, e, r, u, E, T, o, a, I, N, A) {
10
10
  (this.id = t),
@@ -46,20 +46,20 @@ export default class Card {
46
46
  (this.altImageText = A || null),
47
47
  (this.test = !1),
48
48
  (this.ti = null),
49
- (this.ii = null),
50
- (this.si = null);
49
+ (this.es = null),
50
+ (this.ii = null);
51
51
  }
52
52
  subscribeToClickedEvent(t) {
53
- return this.hi().Kt(t);
53
+ return this.si().Ut(t);
54
54
  }
55
55
  subscribeToDismissedEvent(t) {
56
- return this.li().Kt(t);
56
+ return this.ns().Ut(t);
57
57
  }
58
58
  removeSubscription(t) {
59
- this.hi().removeSubscription(t), this.li().removeSubscription(t);
59
+ this.si().removeSubscription(t), this.ns().removeSubscription(t);
60
60
  }
61
61
  removeAllSubscriptions() {
62
- this.hi().removeAllSubscriptions(), this.li().removeAllSubscriptions();
62
+ this.si().removeAllSubscriptions(), this.ns().removeAllSubscriptions();
63
63
  }
64
64
  dismissCard() {
65
65
  if (!this.dismissible || this.dismissed) return;
@@ -76,134 +76,134 @@ export default class Card {
76
76
  (t.style.margin = "0"),
77
77
  setTimeout(function () {
78
78
  t && t.parentNode && t.parentNode.removeChild(t);
79
- }, Card.ni));
79
+ }, Card.hi));
80
80
  }, Z));
81
81
  }
82
- hi() {
82
+ si() {
83
83
  return null == this.ti && (this.ti = new f()), this.ti;
84
84
  }
85
- li() {
86
- return null == this.ii && (this.ii = new f()), this.ii;
85
+ ns() {
86
+ return null == this.es && (this.es = new f()), this.es;
87
87
  }
88
- gs() {
88
+ js() {
89
89
  const t = new Date().valueOf();
90
90
  return (
91
- !(null != this.si && t - this.si < Card.ei) &&
92
- ((this.si = t), (this.viewed = !0), !0)
91
+ !(null != this.ii && t - this.ii < Card.li) &&
92
+ ((this.ii = t), (this.viewed = !0), !0)
93
93
  );
94
94
  }
95
- ss() {
96
- (this.viewed = !0), (this.clicked = !0), this.hi().A();
95
+ Yt() {
96
+ (this.viewed = !0), (this.clicked = !0), this.si().A();
97
97
  }
98
- ls() {
98
+ Ft() {
99
99
  return (
100
100
  !(!this.dismissible || this.dismissed) &&
101
- ((this.dismissed = !0), this.li().A(), !0)
101
+ ((this.dismissed = !0), this.ns().A(), !0)
102
102
  );
103
103
  }
104
- ri(t) {
105
- if (null == t || t[Card.ui.qs] !== this.id) return !0;
106
- if (t[Card.ui.Ei]) return !1;
104
+ ni(t) {
105
+ if (null == t || t[Card.ei.qs] !== this.id) return !0;
106
+ if (t[Card.ei.ri]) return !1;
107
107
  if (
108
- null != t[Card.ui.Bs] &&
108
+ null != t[Card.ei.Es] &&
109
109
  null != this.updated &&
110
- parseInt(t[Card.ui.Bs]) < X(this.updated.valueOf())
110
+ parseInt(t[Card.ei.Es]) < X(this.updated.valueOf())
111
111
  )
112
112
  return !0;
113
113
  if (
114
- (t[Card.ui.vs] && !this.viewed && (this.viewed = !0),
115
- t[Card.ui.Is] && !this.clicked && (this.clicked = t[Card.ui.Is]),
116
- null != t[Card.ui.ws] && (this.title = t[Card.ui.ws]),
117
- null != t[Card.ui.ys] && (this.imageUrl = t[Card.ui.ys]),
118
- null != t[Card.ui.As] && (this.description = t[Card.ui.As]),
119
- null != t[Card.ui.Bs])
114
+ (t[Card.ei.ys] && !this.viewed && (this.viewed = !0),
115
+ t[Card.ei.Ls] && !this.clicked && (this.clicked = t[Card.ei.Ls]),
116
+ null != t[Card.ei.As] && (this.title = t[Card.ei.As]),
117
+ null != t[Card.ei.Bs] && (this.imageUrl = t[Card.ei.Bs]),
118
+ null != t[Card.ei.Ds] && (this.description = t[Card.ei.Ds]),
119
+ null != t[Card.ei.Es])
120
120
  ) {
121
- const i = Y(t[Card.ui.Bs]);
121
+ const i = Y(t[Card.ei.Es]);
122
122
  null != i && (this.updated = i);
123
123
  }
124
- if (null != t[Card.ui.Cs]) {
124
+ if (null != t[Card.ei.Fs]) {
125
125
  let i;
126
- (i = t[Card.ui.Cs] === Card.Ti ? null : Y(t[Card.ui.Cs])),
126
+ (i = t[Card.ei.Fs] === Card.ui ? null : Y(t[Card.ei.Fs])),
127
127
  (this.expiresAt = i);
128
128
  }
129
129
  if (
130
- (null != t[Card.ui.URL] && (this.url = t[Card.ui.URL]),
131
- null != t[Card.ui.Ds] && (this.linkText = t[Card.ui.Ds]),
132
- null != t[Card.ui.Es])
130
+ (null != t[Card.ei.URL] && (this.url = t[Card.ei.URL]),
131
+ null != t[Card.ei.Gs] && (this.linkText = t[Card.ei.Gs]),
132
+ null != t[Card.ei.Hs])
133
133
  ) {
134
- const i = parseFloat(t[Card.ui.Es].toString());
134
+ const i = parseFloat(t[Card.ei.Hs].toString());
135
135
  this.aspectRatio = isNaN(i) ? null : i;
136
136
  }
137
137
  return (
138
- null != t[Card.ui.Fs] && (this.extras = t[Card.ui.Fs]),
139
- null != t[Card.ui.Gs] && (this.pinned = t[Card.ui.Gs]),
140
- null != t[Card.ui.Hs] && (this.dismissible = t[Card.ui.Hs]),
141
- null != t[Card.ui.Js] && (this.language = t[Card.ui.Js]),
142
- null != t[Card.ui.Ks] && (this.altImageText = t[Card.ui.Ks]),
143
- null != t[Card.ui.Ls] && (this.test = t[Card.ui.Ls]),
138
+ null != t[Card.ei.Is] && (this.extras = t[Card.ei.Is]),
139
+ null != t[Card.ei.Js] && (this.pinned = t[Card.ei.Js]),
140
+ null != t[Card.ei.Ks] && (this.dismissible = t[Card.ei.Ks]),
141
+ null != t[Card.ei.Ms] && (this.language = t[Card.ei.Ms]),
142
+ null != t[Card.ei.Ns] && (this.altImageText = t[Card.ei.Ns]),
143
+ null != t[Card.ei.Os] && (this.test = t[Card.ei.Os]),
144
144
  !0
145
145
  );
146
146
  }
147
147
  qt() {
148
- E.error("Must be implemented in a subclass");
148
+ b.error("Must be implemented in a subclass");
149
149
  }
150
150
  }
151
- (Card.Ti = -1),
152
- (Card.ui = {
151
+ (Card.ui = -1),
152
+ (Card.ei = {
153
153
  qs: "id",
154
- vs: "v",
155
- Hs: "db",
156
- Ei: "r",
157
- Bs: "ca",
158
- Gs: "p",
159
- Cs: "ea",
160
- Fs: "e",
154
+ ys: "v",
155
+ Ks: "db",
156
+ ri: "r",
157
+ Es: "ca",
158
+ Js: "p",
159
+ Fs: "ea",
160
+ Is: "e",
161
161
  xs: "tp",
162
- ys: "i",
163
- ws: "tt",
164
- As: "ds",
162
+ Bs: "i",
163
+ As: "tt",
164
+ Ds: "ds",
165
165
  URL: "u",
166
- Ds: "dm",
167
- Es: "ar",
168
- Is: "cl",
169
- Ls: "t",
170
- Js: "language",
171
- Ks: "image_alt",
166
+ Gs: "dm",
167
+ Hs: "ar",
168
+ Ls: "cl",
169
+ Os: "t",
170
+ Ms: "language",
171
+ Ns: "image_alt",
172
172
  }),
173
173
  (Card.ks = {
174
174
  zs: "captioned_image",
175
- oi: "text_announcement",
176
- ai: "short_news",
177
- Ii: "banner_image",
178
- Ni: "control",
175
+ Ei: "text_announcement",
176
+ Ti: "short_news",
177
+ oi: "banner_image",
178
+ ai: "control",
179
179
  }),
180
180
  (Card.bs = {
181
181
  qs: "id",
182
- vs: "v",
183
- Hs: "db",
184
- Ai: "cr",
185
- Bs: "ca",
186
- Gs: "p",
187
- ci: "t",
188
- Cs: "ea",
189
- Fs: "e",
182
+ ys: "v",
183
+ Ks: "db",
184
+ Ii: "cr",
185
+ Es: "ca",
186
+ Js: "p",
187
+ Ni: "t",
188
+ Fs: "ea",
189
+ Is: "e",
190
190
  xs: "tp",
191
- ys: "i",
192
- ws: "tt",
193
- As: "ds",
191
+ Bs: "i",
192
+ As: "tt",
193
+ Ds: "ds",
194
194
  URL: "u",
195
- Ds: "dm",
196
- Es: "ar",
197
- Is: "cl",
198
- Ls: "s",
199
- Js: "l",
200
- Ks: "ia",
195
+ Gs: "dm",
196
+ Hs: "ar",
197
+ Ls: "cl",
198
+ Os: "s",
199
+ Ms: "l",
200
+ Ns: "ia",
201
201
  }),
202
- (Card.mi = {
203
- Si: "ADVERTISING",
204
- Di: "ANNOUNCEMENTS",
205
- pi: "NEWS",
206
- di: "SOCIAL",
202
+ (Card.Ai = {
203
+ ci: "ADVERTISING",
204
+ mi: "ANNOUNCEMENTS",
205
+ Si: "NEWS",
206
+ Di: "SOCIAL",
207
207
  }),
208
- (Card.ni = 400),
209
- (Card.ei = 1e4);
208
+ (Card.hi = 400),
209
+ (Card.li = 1e4);
@@ -8,24 +8,24 @@ export default class ClassicCard extends Card {
8
8
  qt() {
9
9
  const s = {};
10
10
  return (
11
- (s[Card.bs.xs] = Card.ks.ai),
11
+ (s[Card.bs.xs] = Card.ks.Ti),
12
12
  (s[Card.bs.qs] = this.id),
13
- (s[Card.bs.vs] = this.viewed),
14
- (s[Card.bs.ws] = this.title),
15
- (s[Card.bs.ys] = this.imageUrl),
16
- (s[Card.bs.As] = this.description),
17
- (s[Card.bs.Bs] = this.updated),
18
- (s[Card.bs.Cs] = this.expiresAt),
13
+ (s[Card.bs.ys] = this.viewed),
14
+ (s[Card.bs.As] = this.title),
15
+ (s[Card.bs.Bs] = this.imageUrl),
16
+ (s[Card.bs.Ds] = this.description),
17
+ (s[Card.bs.Es] = this.updated),
18
+ (s[Card.bs.Fs] = this.expiresAt),
19
19
  (s[Card.bs.URL] = this.url),
20
- (s[Card.bs.Ds] = this.linkText),
21
- (s[Card.bs.Es] = this.aspectRatio),
22
- (s[Card.bs.Fs] = this.extras),
23
- (s[Card.bs.Gs] = this.pinned),
24
- (s[Card.bs.Hs] = this.dismissible),
25
- (s[Card.bs.Is] = this.clicked),
26
- (s[Card.bs.Js] = this.language),
27
- (s[Card.bs.Ks] = this.altImageText),
28
- (s[Card.bs.Ls] = this.test),
20
+ (s[Card.bs.Gs] = this.linkText),
21
+ (s[Card.bs.Hs] = this.aspectRatio),
22
+ (s[Card.bs.Is] = this.extras),
23
+ (s[Card.bs.Js] = this.pinned),
24
+ (s[Card.bs.Ks] = this.dismissible),
25
+ (s[Card.bs.Ls] = this.clicked),
26
+ (s[Card.bs.Ms] = this.language),
27
+ (s[Card.bs.Ns] = this.altImageText),
28
+ (s[Card.bs.Os] = this.test),
29
29
  s
30
30
  );
31
31
  }