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