@braze/web-sdk 6.0.0 → 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 (147) hide show
  1. package/index.d.ts +103 -33
  2. package/package.json +1 -1
  3. package/shared-lib/encoding-utils.js +1 -1
  4. package/shared-lib/event-types.js +22 -22
  5. package/shared-lib/guid.js +3 -3
  6. package/shared-lib/indexed-db-adapter.js +19 -19
  7. package/shared-lib/logger.js +18 -18
  8. package/shared-lib/supported-options.js +15 -15
  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 +9 -9
  14. package/src/Banner/display/destroy-banner-html.js +2 -2
  15. package/src/Banner/display/detect-banner-impressions.js +2 -2
  16. package/src/Banner/get-all-banners.js +5 -5
  17. package/src/Banner/get-banner.js +7 -7
  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 +16 -20
  21. package/src/Banner/subscribe-to-banners-updates.js +7 -7
  22. package/src/Banner/ui/insert-banner.js +6 -6
  23. package/src/Card/card-manager-factory.js +7 -7
  24. package/src/Card/card-manager.js +35 -35
  25. package/src/Card/display/card-display.js +11 -11
  26. package/src/Card/log-card-dismissal.js +4 -4
  27. package/src/Card/log-content-card-click.js +4 -4
  28. package/src/Card/log-content-card-impressions.js +6 -6
  29. package/src/Card/models/captioned-image.js +21 -21
  30. package/src/Card/models/card.js +68 -68
  31. package/src/Card/models/classic-card.js +21 -21
  32. package/src/Card/models/control-card.js +11 -11
  33. package/src/Card/models/image-only.js +18 -18
  34. package/src/Card/util/card-factory.js +35 -35
  35. package/src/ContentCards/content-cards-provider-factory.js +13 -13
  36. package/src/ContentCards/content-cards-provider.js +136 -136
  37. package/src/ContentCards/get-cached-content-cards.js +2 -2
  38. package/src/ContentCards/request-content-cards-refresh.js +2 -2
  39. package/src/ContentCards/subscribe-to-content-cards-updates.js +6 -6
  40. package/src/ContentCards/ui/show-content-cards.js +7 -7
  41. package/src/Core/add-sdk-metadata.js +3 -3
  42. package/src/Core/change-user.js +7 -7
  43. package/src/Core/destroy.js +2 -2
  44. package/src/Core/disable-sdk.js +8 -8
  45. package/src/Core/enable-sdk.js +6 -6
  46. package/src/Core/get-device-id.js +4 -4
  47. package/src/Core/handle-braze-action.js +5 -5
  48. package/src/Core/is-disabled.js +1 -1
  49. package/src/Core/log-custom-event.js +10 -10
  50. package/src/Core/log-purchase.js +13 -13
  51. package/src/Core/open-session.js +10 -10
  52. package/src/Core/set-logger.js +2 -2
  53. package/src/Core/set-sdk-authentication-signature.js +2 -2
  54. package/src/Core/toggle-logging.js +2 -2
  55. package/src/Core/wipe-data.js +7 -7
  56. package/src/FeatureFlags/feature-flag-factory.js +10 -10
  57. package/src/FeatureFlags/feature-flag.js +20 -71
  58. package/src/FeatureFlags/feature-flags-provider-factory.js +12 -12
  59. package/src/FeatureFlags/feature-flags-provider.js +87 -87
  60. package/src/FeatureFlags/get-all-feature-flags.js +4 -4
  61. package/src/FeatureFlags/get-feature-flag.js +4 -4
  62. package/src/FeatureFlags/log-feature-flag-impression.js +9 -9
  63. package/src/FeatureFlags/refresh-feature-flags.js +2 -2
  64. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +4 -4
  65. package/src/InAppMessage/defer-in-app-message.js +4 -4
  66. package/src/InAppMessage/display/html-message-to-html.js +10 -10
  67. package/src/InAppMessage/display/in-app-message-to-html.js +28 -28
  68. package/src/InAppMessage/display/modal-utils.js +7 -7
  69. package/src/InAppMessage/in-app-message-factory.js +15 -15
  70. package/src/InAppMessage/in-app-message-manager-factory.js +5 -5
  71. package/src/InAppMessage/in-app-message-manager.js +100 -100
  72. package/src/InAppMessage/log-in-app-message-button-click.js +9 -9
  73. package/src/InAppMessage/log-in-app-message-click.js +6 -6
  74. package/src/InAppMessage/log-in-app-message-html-click.js +9 -9
  75. package/src/InAppMessage/log-in-app-message-impression.js +4 -4
  76. package/src/InAppMessage/models/control-message.js +4 -4
  77. package/src/InAppMessage/models/full-screen-message.js +35 -35
  78. package/src/InAppMessage/models/html-message.js +21 -21
  79. package/src/InAppMessage/models/in-app-message-button.js +5 -5
  80. package/src/InAppMessage/models/in-app-message.js +75 -75
  81. package/src/InAppMessage/models/modal-message.js +34 -34
  82. package/src/InAppMessage/models/slide-up-message.js +31 -31
  83. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  84. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  85. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
  86. package/src/InAppMessage/ui/show-in-app-message.js +19 -19
  87. package/src/Push/push-manager-factory.js +9 -9
  88. package/src/Push/push-manager.js +118 -118
  89. package/src/Push/utils/push-utils.js +9 -9
  90. package/src/User/user-manager.js +20 -20
  91. package/src/User/user.js +44 -45
  92. package/src/common/base-provider.js +1 -1
  93. package/src/common/content-cards-display.js +18 -18
  94. package/src/common/event-logger.js +10 -10
  95. package/src/common/properties-base.js +56 -0
  96. package/src/l10n/l10n-manager-factory.js +7 -7
  97. package/src/l10n/l10n-manager.js +4 -4
  98. package/src/managers/auth-manager.js +32 -32
  99. package/src/managers/braze-instance.js +143 -143
  100. package/src/managers/device-manager.js +22 -22
  101. package/src/managers/network-manager.js +172 -168
  102. package/src/managers/server-config-manager.js +73 -73
  103. package/src/managers/session-manager.js +40 -40
  104. package/src/managers/storage-manager-factory.js +6 -6
  105. package/src/managers/storage-manager.js +97 -97
  106. package/src/managers/subscription-manager.js +12 -12
  107. package/src/managers/utils.js +1 -1
  108. package/src/models/backend-errors.js +5 -5
  109. package/src/models/braze-event.js +5 -5
  110. package/src/models/device.js +2 -2
  111. package/src/models/identifier.js +12 -12
  112. package/src/models/push-token.js +13 -13
  113. package/src/models/request-result.js +4 -4
  114. package/src/models/server-config.js +31 -31
  115. package/src/request-controller.js +159 -159
  116. package/src/triggers/models/custom-event-data.js +1 -1
  117. package/src/triggers/models/custom-event-property-data.js +2 -2
  118. package/src/triggers/models/filter-set.js +6 -6
  119. package/src/triggers/models/filter.js +26 -26
  120. package/src/triggers/models/in-app-message-click-data.js +1 -1
  121. package/src/triggers/models/purchase-data.js +1 -1
  122. package/src/triggers/models/purchase-property-data.js +2 -2
  123. package/src/triggers/models/push-click-data.js +1 -1
  124. package/src/triggers/models/trigger-condition.js +37 -37
  125. package/src/triggers/models/trigger-events.js +3 -3
  126. package/src/triggers/models/trigger.js +16 -16
  127. package/src/triggers/triggers-provider-factory.js +12 -12
  128. package/src/triggers/triggers-provider.js +61 -61
  129. package/src/ui/js/attach-css.js +1 -1
  130. package/src/ui/js/load-font-awesome.js +1 -1
  131. package/src/util/base-device-parser.js +1 -1
  132. package/src/util/braze-actions.js +6 -6
  133. package/src/util/browser-detector.js +20 -13
  134. package/src/util/client-hints-parser.js +6 -6
  135. package/src/util/code-utils.js +2 -2
  136. package/src/util/component-utils.js +1 -1
  137. package/src/util/deprecation-utils.js +2 -2
  138. package/src/util/device-constants.js +4 -4
  139. package/src/util/dom-utils.js +9 -9
  140. package/src/util/html-display-utils.js +7 -7
  141. package/src/util/key-codes.js +1 -1
  142. package/src/util/net.js +12 -12
  143. package/src/util/request-header-utils.js +22 -22
  144. package/src/util/string-utils.js +2 -2
  145. package/src/util/user-agent-parser.js +16 -16
  146. package/src/util/validation-utils.js +12 -12
  147. package/src/util/window-utils.js +2 -2
@@ -1,5 +1,5 @@
1
- import N from "../../../shared-lib/logger.js";
2
- import { SUBSCRIPTION_ID_DATA_ATTRIBUTE as p } from "../../common/constants.js";
1
+ import E from "../../../shared-lib/logger.js";
2
+ import { SUBSCRIPTION_ID_DATA_ATTRIBUTE as f } from "../../common/constants.js";
3
3
  import r, { OPTIONS as z } from "../../managers/braze-instance.js";
4
4
  import { setupBannerUI as U } from "../../ui/js/banner-css.js";
5
5
  import { addPassiveEventListener as J } from "../../util/dom-utils.js";
@@ -9,11 +9,11 @@ import { detectBannerImpressions as F } from "../display/detect-banner-impressio
9
9
  import { subscribeToBannersUpdates } from "../subscribe-to-banners-updates.js";
10
10
  export function insertBanner(o, e) {
11
11
  if (!r.rr()) return;
12
- if (!o) return void N.error("Not inserting banner: banner was not provided.");
12
+ if (!o) return void E.error("Not inserting banner: banner was not provided.");
13
13
  if (!e)
14
- return void N.error("Not inserting banner: parentNode was not provided.");
14
+ return void E.error("Not inserting banner: parentNode was not provided.");
15
15
  if (!r.ee(z.re))
16
- return void N.error(
16
+ return void E.error(
17
17
  "Banners are disabled. Use the 'allowUserSuppliedJavascript' option for braze.initialize to enable these messages.",
18
18
  );
19
19
  U();
@@ -22,5 +22,5 @@ export function insertBanner(o, e) {
22
22
  const i = s[o.placementId];
23
23
  i ? e.replaceChildren(S(i, r.ee(z.er))) : A(n);
24
24
  });
25
- s && n.setAttribute(p, s), e.replaceChildren(n), J(window, "scroll", F), F();
25
+ s && n.setAttribute(f, s), e.replaceChildren(n), J(window, "scroll", F), F();
26
26
  }
@@ -1,14 +1,14 @@
1
1
  import M from "./card-manager.js";
2
2
  import r from "../managers/braze-instance.js";
3
- const _ = {
4
- l: !1,
3
+ const G = {
4
+ i: !1,
5
5
  aa: null,
6
- ea: () => (_.p(), _.aa || (_.aa = new M(r.j())), _.aa),
7
- p: () => {
8
- _.l || (r.h(_), (_.l = !0));
6
+ ea: () => (G.t(), G.aa || (G.aa = new M(r.p())), G.aa),
7
+ t: () => {
8
+ G.i || (r.g(G), (G.i = !0));
9
9
  },
10
10
  destroy: () => {
11
- (_.aa = null), (_.l = !1);
11
+ (G.aa = null), (G.i = !1);
12
12
  },
13
13
  };
14
- export default _;
14
+ export default G;
@@ -1,73 +1,73 @@
1
1
  import { ControlCard } from "./models/index.js";
2
2
  import c from "../common/event-logger.js";
3
- import G from "../models/request-result.js";
4
- import { logger as N, EventTypes as d } from "../../shared-lib/index.js";
3
+ import H from "../models/request-result.js";
4
+ import { logger as E, EventTypes as m } 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
- const n = new G();
11
+ const n = new H();
12
12
  if ((t.$t(), null == t.url || "" === t.url))
13
13
  return (
14
- N.info(`Card ${t.id} has no url. Not logging click to Braze servers.`),
14
+ E.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.ft(s.gt.Kt) || {};
19
- (n[t.id] = !0), this.C.Bt(s.gt.Kt, n);
17
+ if (t.id && this.j) {
18
+ const n = this.j.lt(s.ct.Et) || {};
19
+ (n[t.id] = !0), this.j.ft(s.ct.Et, n);
20
20
  }
21
- const r = this.Lt([t]);
21
+ const r = this.Gt([t]);
22
22
  if (null == r) return n;
23
- const i = d.Mt;
24
- return c.ut(i, r);
23
+ const i = m.Ht;
24
+ return c.rt(i, r);
25
25
  }
26
- Ot(t) {
27
- const n = new G();
28
- if (!t.Pt())
26
+ Jt(t) {
27
+ const n = new H();
28
+ if (!t.Kt())
29
29
  return (
30
- N.info(
30
+ E.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.ft(s.gt.Qt) || {};
37
- (n[t.id] = !0), this.C.Bt(s.gt.Qt, n);
35
+ if (t.id && this.j) {
36
+ const n = this.j.lt(s.ct.Lt) || {};
37
+ (n[t.id] = !0), this.j.ft(s.ct.Lt, n);
38
38
  }
39
- const r = this.Lt([t]);
40
- return null == r ? n : c.ut(d.Vt, r);
39
+ const r = this.Gt([t]);
40
+ return null == r ? n : c.rt(m.Mt, r);
41
41
  }
42
- Wt(t) {
43
- const n = new G(!0),
42
+ Ot(t) {
43
+ const n = new H(!0),
44
44
  r = [],
45
45
  i = [];
46
46
  let o = {};
47
- this.C && (o = this.C.ft(s.gt.Xt) || {});
47
+ this.j && (o = this.j.lt(s.ct.Pt) || {});
48
48
  for (const s of t) {
49
- s.Yt()
49
+ s.Qt()
50
50
  ? (s instanceof ControlCard ? i.push(s) : r.push(s),
51
51
  s.id && (o[s.id] = !0))
52
- : N.info(
52
+ : E.info(
53
53
  `Card ${s.id} logged an impression too recently. Ignoring analytics event.`,
54
54
  );
55
55
  }
56
- const e = this.Lt(r),
57
- l = this.Lt(i);
58
- if (null == e && null == l) return (n.tt = !1), n;
59
- if ((this.C && this.C.Bt(s.gt.Xt, o), null != e)) {
60
- const t = d.Zt,
61
- s = c.ut(t, e);
62
- n._t(s);
56
+ const e = this.Gt(r),
57
+ l = this.Gt(i);
58
+ if (null == e && null == l) return (n.W = !1), n;
59
+ if ((this.j && this.j.ft(s.ct.Pt, o), null != e)) {
60
+ const t = m.Ut,
61
+ s = c.rt(t, e);
62
+ n.Vt(s);
63
63
  }
64
64
  if (null != l) {
65
- const t = c.ut(d.ts, l);
66
- n._t(t);
65
+ const t = c.rt(m.Wt, l);
66
+ n.Vt(t);
67
67
  }
68
68
  return n;
69
69
  }
70
- Lt(t) {
70
+ Gt(t) {
71
71
  let s,
72
72
  n = null;
73
73
  for (let r = 0; r < t.length; r++)
@@ -1,8 +1,8 @@
1
1
  import { createCloseButton as T } from "../../util/component-utils.js";
2
- import { detectSwipe as H, DIRECTIONS as K } from "../../util/dom-utils.js";
3
- import { _handleBrazeAction as L } from "../../Core/handle-braze-action.js";
2
+ import { detectSwipe as K, DIRECTIONS as L } from "../../util/dom-utils.js";
3
+ import { _handleBrazeAction as O } from "../../Core/handle-braze-action.js";
4
4
  import { logCardDismissal } from "../index.js";
5
- import { Guid as O } from "../../../shared-lib/index.js";
5
+ import { Guid as P } from "../../../shared-lib/index.js";
6
6
  export function markCardAsRead(t) {
7
7
  if (null != t) {
8
8
  const e = t.querySelectorAll(".ab-unread-indicator")[0];
@@ -21,7 +21,7 @@ export function setCardHeight(t, e) {
21
21
  i = 0;
22
22
  a.length > 0 && (i = a[0].offsetWidth);
23
23
  for (const e of t)
24
- if (((o = e.te), o && e.imageUrl && "number" == typeof e.aspectRatio)) {
24
+ if (((o = e._t), o && e.imageUrl && "number" == typeof e.aspectRatio)) {
25
25
  const t = i / e.aspectRatio;
26
26
  t && (o.style.height = `${t}px`);
27
27
  }
@@ -30,14 +30,14 @@ export function cardToHtml(t, e, a, o = "ltr") {
30
30
  const i = document.createElement("div");
31
31
  (i.dir = o),
32
32
  t.language && (i.lang = t.language),
33
- (i.className = "ab-card ab-effect-card " + t.ae),
33
+ (i.className = "ab-card ab-effect-card " + t.Xt),
34
34
  t.id &&
35
35
  (i.setAttribute("data-ab-card-id", t.id), i.setAttribute("id", t.id)),
36
36
  i.setAttribute("role", "article");
37
37
  let n = "",
38
38
  d = !1;
39
39
  t.url && "" !== t.url && ((n = t.url), (d = !0));
40
- const r = (o) => (markCardAsRead(i), d && (e(t), L(n, a, o)), !1);
40
+ const r = (o) => (markCardAsRead(i), d && (e(t), O(n, a, o)), !1);
41
41
  if (t.pinned) {
42
42
  const t = document.createElement("div");
43
43
  t.className = "ab-pinned-indicator";
@@ -56,7 +56,7 @@ export function cardToHtml(t, e, a, o = "ltr") {
56
56
  _setImageAltText(t, a),
57
57
  e.appendChild(a),
58
58
  (i.className += " with-image"),
59
- d && !t.oe)
59
+ d && !t.Yt)
60
60
  ) {
61
61
  const a = document.createElement("a");
62
62
  a.setAttribute("href", n),
@@ -74,10 +74,10 @@ export function cardToHtml(t, e, a, o = "ltr") {
74
74
  t.logCardDismissal = () => logCardDismissal(t);
75
75
  const e = T("Dismiss Card", void 0, t.dismissCard.bind(t), o);
76
76
  i.appendChild(e),
77
- H(c, K.ie, (t) => {
77
+ K(c, L.Zt, (t) => {
78
78
  (i.className += " ab-swiped-left"), e.onclick(t);
79
79
  }),
80
- H(c, K.de, (t) => {
80
+ K(c, L.ae, (t) => {
81
81
  (i.className += " ab-swiped-right"), e.onclick(t);
82
82
  });
83
83
  }
@@ -87,7 +87,7 @@ export function cardToHtml(t, e, a, o = "ltr") {
87
87
  const t = document.createElement("h1");
88
88
  if (
89
89
  ((t.className = "ab-title"),
90
- (t.id = O.ce()),
90
+ (t.id = P.oe()),
91
91
  i.setAttribute("aria-labelledby", t.id),
92
92
  d)
93
93
  ) {
@@ -121,7 +121,7 @@ export function cardToHtml(t, e, a, o = "ltr") {
121
121
  (l.className = "ab-unread-indicator"),
122
122
  t.viewed && (l.className += " read"),
123
123
  i.appendChild(l),
124
- (t.te = i),
124
+ (t._t = i),
125
125
  i
126
126
  );
127
127
  }
@@ -1,11 +1,11 @@
1
1
  import { Card } from "./models/index.js";
2
- import _ from "./card-manager-factory.js";
3
- import { MUST_BE_CARD_WARNING_SUFFIX as P } from "../common/constants.js";
2
+ import G from "./card-manager-factory.js";
3
+ import { MUST_BE_CARD_WARNING_SUFFIX as Q } from "../common/constants.js";
4
4
  import r from "../managers/braze-instance.js";
5
- import { logger as N } from "../../shared-lib/index.js";
5
+ import { logger as E } from "../../shared-lib/index.js";
6
6
  export function logCardDismissal(o) {
7
7
  return (
8
8
  !!r.rr() &&
9
- (o instanceof Card ? _.ea().Ot(o).tt : (N.error("card " + P), !1))
9
+ (o instanceof Card ? G.ea().Jt(o).W : (E.error("card " + Q), !1))
10
10
  );
11
11
  }
@@ -1,11 +1,11 @@
1
- import N from "../../shared-lib/logger.js";
2
- import { MUST_BE_CARD_WARNING_SUFFIX as P } from "../common/constants.js";
1
+ import E from "../../shared-lib/logger.js";
2
+ import { MUST_BE_CARD_WARNING_SUFFIX as Q } from "../common/constants.js";
3
3
  import r from "../managers/braze-instance.js";
4
- import _ from "./card-manager-factory.js";
4
+ import G from "./card-manager-factory.js";
5
5
  import { Card } from "./models/index.js";
6
6
  export function logContentCardClick(o) {
7
7
  return (
8
8
  !!r.rr() &&
9
- (o instanceof Card ? _.ea().logClick(o).tt : (N.error("card " + P), !1))
9
+ (o instanceof Card ? G.ea().logClick(o).W : (E.error("card " + Q), !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 D } from "../util/code-utils.js";
4
- import N from "../../shared-lib/logger.js";
5
- import { MUST_BE_CARD_WARNING_SUFFIX as P } from "../common/constants.js";
6
- import _ from "./card-manager-factory.js";
4
+ import E from "../../shared-lib/logger.js";
5
+ import { MUST_BE_CARD_WARNING_SUFFIX as Q } from "../common/constants.js";
6
+ import G from "./card-manager-factory.js";
7
7
  export function logContentCardImpressions(o) {
8
8
  if (!r.rr()) return !1;
9
- if (!D(o)) return N.error("cards must be an array"), !1;
9
+ if (!D(o)) return E.error("cards must be an array"), !1;
10
10
  for (const r of o)
11
- if (!(r instanceof Card)) return N.error(`Each card in cards ${P}`), !1;
12
- return _.ea().Wt(o).tt;
11
+ if (!(r instanceof Card)) return E.error(`Each card in cards ${Q}`), !1;
12
+ return G.ea().Ot(o).W;
13
13
  }
@@ -2,31 +2,31 @@ import Card from "./card.js";
2
2
  export default class CaptionedImage extends Card {
3
3
  constructor(t, s, i, h, e, r, a, o, c, n, d, p, u, l, m, f) {
4
4
  super(t, s, i, h, e, r, a, o, c, n, d, p, u, l, m, f),
5
- (this.ae = "ab-captioned-image"),
6
- (this.oe = !0),
5
+ (this.Xt = "ab-captioned-image"),
6
+ (this.Yt = !0),
7
7
  (this.test = !1);
8
8
  }
9
- bt() {
9
+ dt() {
10
10
  const t = {};
11
11
  return (
12
- (t[Card.hs.ss] = Card.rs.es),
13
- (t[Card.hs.os] = this.id),
14
- (t[Card.hs.cs] = this.viewed),
15
- (t[Card.hs.ns] = this.title),
16
- (t[Card.hs.ds] = this.imageUrl),
17
- (t[Card.hs.ps] = this.description),
18
- (t[Card.hs.us] = this.updated),
19
- (t[Card.hs.ls] = this.expiresAt),
20
- (t[Card.hs.URL] = this.url),
21
- (t[Card.hs.fs] = this.linkText),
22
- (t[Card.hs.xs] = this.aspectRatio),
23
- (t[Card.hs.bs] = this.extras),
24
- (t[Card.hs.gs] = this.pinned),
25
- (t[Card.hs.js] = this.dismissible),
26
- (t[Card.hs.zs] = this.clicked),
27
- (t[Card.hs.ks] = this.language),
28
- (t[Card.hs.qs] = this.altImageText),
29
- (t[Card.hs.vs] = this.test),
12
+ (t[Card.ss.ts] = Card.es.hs),
13
+ (t[Card.ss.rs] = this.id),
14
+ (t[Card.ss.os] = this.viewed),
15
+ (t[Card.ss.cs] = this.title),
16
+ (t[Card.ss.ns] = this.imageUrl),
17
+ (t[Card.ss.ds] = this.description),
18
+ (t[Card.ss.ps] = this.updated),
19
+ (t[Card.ss.us] = this.expiresAt),
20
+ (t[Card.ss.URL] = this.url),
21
+ (t[Card.ss.ls] = this.linkText),
22
+ (t[Card.ss.fs] = this.aspectRatio),
23
+ (t[Card.ss.xs] = this.extras),
24
+ (t[Card.ss.bs] = this.pinned),
25
+ (t[Card.ss.gs] = this.dismissible),
26
+ (t[Card.ss.js] = this.clicked),
27
+ (t[Card.ss.zs] = this.language),
28
+ (t[Card.ss.ks] = this.altImageText),
29
+ (t[Card.ss.qs] = 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 W } from "../../common/constants.js";
6
6
  import u from "../../managers/subscription-manager.js";
7
- import N from "../../../shared-lib/logger.js";
7
+ import E 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),
@@ -50,10 +50,10 @@ export default class Card {
50
50
  (this.si = null);
51
51
  }
52
52
  subscribeToClickedEvent(t) {
53
- return this.hi().Dt(t);
53
+ return this.hi().wt(t);
54
54
  }
55
55
  subscribeToDismissedEvent(t) {
56
- return this.li().Dt(t);
56
+ return this.li().wt(t);
57
57
  }
58
58
  removeSubscription(t) {
59
59
  this.hi().removeSubscription(t), this.li().removeSubscription(t);
@@ -64,7 +64,7 @@ export default class Card {
64
64
  dismissCard() {
65
65
  if (!this.dismissible || this.dismissed) return;
66
66
  "function" == typeof this.logCardDismissal && this.logCardDismissal();
67
- let t = this.te;
67
+ let t = this._t;
68
68
  !t && this.id && (t = document.getElementById(this.id)),
69
69
  t &&
70
70
  ((t.style.height = t.offsetHeight + "px"),
@@ -85,7 +85,7 @@ export default class Card {
85
85
  li() {
86
86
  return null == this.ii && (this.ii = new u()), this.ii;
87
87
  }
88
- Yt() {
88
+ Qt() {
89
89
  const t = new Date().valueOf();
90
90
  return (
91
91
  !(null != this.si && t - this.si < Card.ei) &&
@@ -93,111 +93,111 @@ export default class Card {
93
93
  );
94
94
  }
95
95
  $t() {
96
- (this.viewed = !0), (this.clicked = !0), this.hi().X();
96
+ (this.viewed = !0), (this.clicked = !0), this.hi().L();
97
97
  }
98
- Pt() {
98
+ Kt() {
99
99
  return (
100
100
  !(!this.dismissible || this.dismissed) &&
101
- ((this.dismissed = !0), this.li().X(), !0)
101
+ ((this.dismissed = !0), this.li().L(), !0)
102
102
  );
103
103
  }
104
104
  ri(t) {
105
- if (null == t || t[Card.ui.os] !== this.id) return !0;
105
+ if (null == t || t[Card.ui.rs] !== this.id) return !0;
106
106
  if (t[Card.ui.Ei]) return !1;
107
107
  if (
108
- null != t[Card.ui.us] &&
108
+ null != t[Card.ui.ps] &&
109
109
  null != this.updated &&
110
- parseInt(t[Card.ui.us]) < X(this.updated.valueOf())
110
+ parseInt(t[Card.ui.ps]) < X(this.updated.valueOf())
111
111
  )
112
112
  return !0;
113
113
  if (
114
- (t[Card.ui.cs] && !this.viewed && (this.viewed = !0),
115
- t[Card.ui.zs] && !this.clicked && (this.clicked = t[Card.ui.zs]),
116
- null != t[Card.ui.ns] && (this.title = t[Card.ui.ns]),
117
- null != t[Card.ui.ds] && (this.imageUrl = t[Card.ui.ds]),
118
- null != t[Card.ui.ps] && (this.description = t[Card.ui.ps]),
119
- null != t[Card.ui.us])
114
+ (t[Card.ui.os] && !this.viewed && (this.viewed = !0),
115
+ t[Card.ui.js] && !this.clicked && (this.clicked = t[Card.ui.js]),
116
+ null != t[Card.ui.cs] && (this.title = t[Card.ui.cs]),
117
+ null != t[Card.ui.ns] && (this.imageUrl = t[Card.ui.ns]),
118
+ null != t[Card.ui.ds] && (this.description = t[Card.ui.ds]),
119
+ null != t[Card.ui.ps])
120
120
  ) {
121
- const i = V(t[Card.ui.us]);
121
+ const i = V(t[Card.ui.ps]);
122
122
  null != i && (this.updated = i);
123
123
  }
124
- if (null != t[Card.ui.ls]) {
124
+ if (null != t[Card.ui.us]) {
125
125
  let i;
126
- (i = t[Card.ui.ls] === Card.Ti ? null : V(t[Card.ui.ls])),
126
+ (i = t[Card.ui.us] === Card.Ti ? null : V(t[Card.ui.us])),
127
127
  (this.expiresAt = i);
128
128
  }
129
129
  if (
130
130
  (null != t[Card.ui.URL] && (this.url = t[Card.ui.URL]),
131
- null != t[Card.ui.fs] && (this.linkText = t[Card.ui.fs]),
132
- null != t[Card.ui.xs])
131
+ null != t[Card.ui.ls] && (this.linkText = t[Card.ui.ls]),
132
+ null != t[Card.ui.fs])
133
133
  ) {
134
- const i = parseFloat(t[Card.ui.xs].toString());
134
+ const i = parseFloat(t[Card.ui.fs].toString());
135
135
  this.aspectRatio = isNaN(i) ? null : i;
136
136
  }
137
137
  return (
138
- null != t[Card.ui.bs] && (this.extras = t[Card.ui.bs]),
139
- null != t[Card.ui.gs] && (this.pinned = t[Card.ui.gs]),
140
- null != t[Card.ui.js] && (this.dismissible = t[Card.ui.js]),
141
- null != t[Card.ui.ks] && (this.language = t[Card.ui.ks]),
142
- null != t[Card.ui.qs] && (this.altImageText = t[Card.ui.qs]),
143
- null != t[Card.ui.vs] && (this.test = t[Card.ui.vs]),
138
+ null != t[Card.ui.xs] && (this.extras = t[Card.ui.xs]),
139
+ null != t[Card.ui.bs] && (this.pinned = t[Card.ui.bs]),
140
+ null != t[Card.ui.gs] && (this.dismissible = t[Card.ui.gs]),
141
+ null != t[Card.ui.zs] && (this.language = t[Card.ui.zs]),
142
+ null != t[Card.ui.ks] && (this.altImageText = t[Card.ui.ks]),
143
+ null != t[Card.ui.qs] && (this.test = t[Card.ui.qs]),
144
144
  !0
145
145
  );
146
146
  }
147
- bt() {
148
- N.error("Must be implemented in a subclass");
147
+ dt() {
148
+ E.error("Must be implemented in a subclass");
149
149
  }
150
150
  }
151
151
  (Card.Ti = -1),
152
152
  (Card.ui = {
153
- os: "id",
154
- cs: "v",
155
- js: "db",
153
+ rs: "id",
154
+ os: "v",
155
+ gs: "db",
156
156
  Ei: "r",
157
- us: "ca",
158
- gs: "p",
159
- ls: "ea",
160
- bs: "e",
161
- ss: "tp",
162
- ds: "i",
163
- ns: "tt",
164
- ps: "ds",
157
+ ps: "ca",
158
+ bs: "p",
159
+ us: "ea",
160
+ xs: "e",
161
+ ts: "tp",
162
+ ns: "i",
163
+ cs: "tt",
164
+ ds: "ds",
165
165
  URL: "u",
166
- fs: "dm",
167
- xs: "ar",
168
- zs: "cl",
169
- vs: "t",
170
- ks: "language",
171
- qs: "image_alt",
166
+ ls: "dm",
167
+ fs: "ar",
168
+ js: "cl",
169
+ qs: "t",
170
+ zs: "language",
171
+ ks: "image_alt",
172
172
  }),
173
- (Card.rs = {
174
- es: "captioned_image",
173
+ (Card.es = {
174
+ hs: "captioned_image",
175
175
  oi: "text_announcement",
176
176
  ai: "short_news",
177
177
  Ii: "banner_image",
178
178
  Ni: "control",
179
179
  }),
180
- (Card.hs = {
181
- os: "id",
182
- cs: "v",
183
- js: "db",
180
+ (Card.ss = {
181
+ rs: "id",
182
+ os: "v",
183
+ gs: "db",
184
184
  Ai: "cr",
185
- us: "ca",
186
- gs: "p",
185
+ ps: "ca",
186
+ bs: "p",
187
187
  ci: "t",
188
- ls: "ea",
189
- bs: "e",
190
- ss: "tp",
191
- ds: "i",
192
- ns: "tt",
193
- ps: "ds",
188
+ us: "ea",
189
+ xs: "e",
190
+ ts: "tp",
191
+ ns: "i",
192
+ cs: "tt",
193
+ ds: "ds",
194
194
  URL: "u",
195
- fs: "dm",
196
- xs: "ar",
197
- zs: "cl",
198
- vs: "s",
199
- ks: "l",
200
- qs: "ia",
195
+ ls: "dm",
196
+ fs: "ar",
197
+ js: "cl",
198
+ qs: "s",
199
+ zs: "l",
200
+ ks: "ia",
201
201
  }),
202
202
  (Card.mi = {
203
203
  Si: "ADVERTISING",
@@ -2,30 +2,30 @@ import Card from "./card.js";
2
2
  export default class ClassicCard extends Card {
3
3
  constructor(s, t, i, h, r, c, e, a, o, d, l, n, u, p, f, m) {
4
4
  super(s, t, i, h, r, c, e, a, o, d, l, n, u, p, f, m),
5
- (this.ae = "ab-classic-card"),
6
- (this.oe = !0);
5
+ (this.Xt = "ab-classic-card"),
6
+ (this.Yt = !0);
7
7
  }
8
- bt() {
8
+ dt() {
9
9
  const s = {};
10
10
  return (
11
- (s[Card.hs.ss] = Card.rs.ai),
12
- (s[Card.hs.os] = this.id),
13
- (s[Card.hs.cs] = this.viewed),
14
- (s[Card.hs.ns] = this.title),
15
- (s[Card.hs.ds] = this.imageUrl),
16
- (s[Card.hs.ps] = this.description),
17
- (s[Card.hs.us] = this.updated),
18
- (s[Card.hs.ls] = this.expiresAt),
19
- (s[Card.hs.URL] = this.url),
20
- (s[Card.hs.fs] = this.linkText),
21
- (s[Card.hs.xs] = this.aspectRatio),
22
- (s[Card.hs.bs] = this.extras),
23
- (s[Card.hs.gs] = this.pinned),
24
- (s[Card.hs.js] = this.dismissible),
25
- (s[Card.hs.zs] = this.clicked),
26
- (s[Card.hs.ks] = this.language),
27
- (s[Card.hs.qs] = this.altImageText),
28
- (s[Card.hs.vs] = this.test),
11
+ (s[Card.ss.ts] = Card.es.ai),
12
+ (s[Card.ss.rs] = this.id),
13
+ (s[Card.ss.os] = this.viewed),
14
+ (s[Card.ss.cs] = this.title),
15
+ (s[Card.ss.ns] = this.imageUrl),
16
+ (s[Card.ss.ds] = this.description),
17
+ (s[Card.ss.ps] = this.updated),
18
+ (s[Card.ss.us] = this.expiresAt),
19
+ (s[Card.ss.URL] = this.url),
20
+ (s[Card.ss.ls] = this.linkText),
21
+ (s[Card.ss.fs] = this.aspectRatio),
22
+ (s[Card.ss.xs] = this.extras),
23
+ (s[Card.ss.bs] = this.pinned),
24
+ (s[Card.ss.gs] = this.dismissible),
25
+ (s[Card.ss.js] = this.clicked),
26
+ (s[Card.ss.zs] = this.language),
27
+ (s[Card.ss.ks] = this.altImageText),
28
+ (s[Card.ss.qs] = this.test),
29
29
  s
30
30
  );
31
31
  }
@@ -3,20 +3,20 @@ export default class ControlCard extends Card {
3
3
  constructor(t, s, l, i, r, n) {
4
4
  super(t, s, null, null, null, l, i, null, null, null, r, n),
5
5
  (this.isControl = !0),
6
- (this.ae = "ab-control-card"),
7
- (this.oe = !1);
6
+ (this.Xt = "ab-control-card"),
7
+ (this.Yt = !1);
8
8
  }
9
- bt() {
9
+ dt() {
10
10
  const t = {};
11
11
  return (
12
- (t[Card.hs.ss] = Card.rs.Ni),
13
- (t[Card.hs.os] = this.id),
14
- (t[Card.hs.cs] = this.viewed),
15
- (t[Card.hs.us] = this.updated),
16
- (t[Card.hs.ls] = this.expiresAt),
17
- (t[Card.hs.bs] = this.extras),
18
- (t[Card.hs.gs] = this.pinned),
19
- (t[Card.hs.vs] = this.test),
12
+ (t[Card.ss.ts] = Card.es.Ni),
13
+ (t[Card.ss.rs] = this.id),
14
+ (t[Card.ss.os] = this.viewed),
15
+ (t[Card.ss.ps] = this.updated),
16
+ (t[Card.ss.us] = this.expiresAt),
17
+ (t[Card.ss.xs] = this.extras),
18
+ (t[Card.ss.bs] = this.pinned),
19
+ (t[Card.ss.qs] = this.test),
20
20
  t
21
21
  );
22
22
  }