@braze/web-sdk 5.3.2 → 5.5.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.
- package/index.d.ts +20 -4
- package/package.json +1 -1
- package/shared-lib/event-types.js +12 -12
- package/shared-lib/indexed-db-adapter.js +14 -14
- package/shared-lib/logger.js +2 -2
- package/shared-lib/supported-options.js +10 -9
- package/src/Card/card-manager.js +46 -42
- package/src/Card/display/card-display.js +59 -58
- package/src/Card/models/card.js +61 -55
- package/src/Card/models/classic-card.js +1 -1
- package/src/Card/models/control-card.js +1 -1
- package/src/Card/models/image-only.js +1 -1
- package/src/Card/util/card-factory.js +20 -20
- package/src/ContentCards/content-cards-provider.js +140 -140
- 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 +2 -2
- package/src/Core/enable-sdk.js +2 -2
- package/src/Core/index.js +1 -0
- package/src/Core/is-initialized.js +4 -0
- package/src/Core/log-custom-event.js +14 -14
- package/src/Core/log-purchase.js +8 -8
- package/src/Core/open-session.js +4 -4
- package/src/Core/wipe-data.js +2 -2
- package/src/FeatureFlags/feature-flag-factory.js +5 -5
- package/src/FeatureFlags/feature-flag.js +1 -1
- package/src/FeatureFlags/feature-flags-provider.js +74 -74
- 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 +12 -12
- package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +2 -2
- package/src/Feed/feed-provider.js +29 -29
- package/src/Feed/get-cached-feed.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/display/in-app-message-to-html.js +64 -62
- package/src/InAppMessage/in-app-message-manager.js +63 -63
- package/src/InAppMessage/log-in-app-message-button-click.js +2 -2
- package/src/InAppMessage/log-in-app-message-click.js +2 -2
- package/src/InAppMessage/log-in-app-message-html-click.js +2 -2
- package/src/InAppMessage/log-in-app-message-impression.js +1 -1
- package/src/InAppMessage/models/full-screen-message.js +10 -10
- package/src/InAppMessage/models/html-message.js +13 -13
- package/src/InAppMessage/models/in-app-message-button.js +4 -4
- package/src/InAppMessage/models/in-app-message.js +59 -59
- package/src/InAppMessage/models/modal-message.js +9 -9
- package/src/InAppMessage/models/slide-up-message.js +11 -11
- package/src/InAppMessage/models/templated-in-app-message.js +8 -8
- package/src/InAppMessage/ui/show-in-app-message.js +42 -40
- package/src/Push/push-manager-factory.js +5 -4
- package/src/Push/push-manager.js +77 -89
- package/src/Push/utils/push-utils.js +4 -4
- package/src/User/user-manager.js +8 -8
- package/src/User/user.js +29 -29
- package/src/common/base-provider.js +1 -1
- package/src/common/event-logger.js +11 -11
- package/src/common/feed-display.js +18 -17
- package/src/l10n/l10n-manager-factory.js +7 -7
- package/src/l10n/l10n-manager.js +15 -5
- package/src/managers/auth-manager.js +9 -9
- package/src/managers/braze-instance.js +89 -87
- package/src/managers/device-manager.js +17 -17
- package/src/managers/network-manager.js +130 -130
- package/src/managers/server-config-manager.js +24 -24
- package/src/managers/session-manager.js +12 -12
- package/src/managers/storage-manager-factory.js +1 -1
- package/src/managers/storage-manager.js +31 -31
- package/src/managers/subscription-manager.js +2 -2
- 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/request-result.js +1 -1
- package/src/models/server-config.js +5 -5
- package/src/request-controller.js +130 -130
- package/src/triggers/models/filter.js +9 -9
- package/src/triggers/models/in-app-message-click-data.js +8 -8
- package/src/triggers/models/push-click-data.js +3 -3
- package/src/triggers/models/trigger-condition.js +27 -27
- package/src/triggers/models/trigger-events.js +1 -1
- package/src/triggers/models/trigger.js +7 -7
- package/src/triggers/triggers-provider.js +29 -29
- package/src/ui/js/attach-css.js +1 -1
- package/src/ui/js/feed-css.js +1 -1
- package/src/ui/js/iam-css.js +1 -1
- package/src/util/base-device-parser.js +7 -7
- package/src/util/braze-actions.js +4 -4
- package/src/util/browser-detector.js +21 -21
- package/src/util/client-hints-parser.js +3 -3
- package/src/util/component-utils.js +13 -12
- package/src/util/net.js +4 -4
- package/src/util/request-header-utils.js +17 -17
- package/src/util/user-agent-parser.js +3 -3
- package/src/util/window-utils.js +1 -1
package/src/Core/open-session.js
CHANGED
|
@@ -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 = A.
|
|
10
|
+
const t = A.ts.Zt,
|
|
11
11
|
o = new A(t, r);
|
|
12
|
-
o.jr(t.
|
|
12
|
+
o.jr(t.hs.hr, (n, e) => {
|
|
13
13
|
const s = e.lastClick,
|
|
14
14
|
c = e.trackingString;
|
|
15
15
|
r.info(`Firing push click trigger from ${c} push click at ${s}`);
|
|
@@ -17,9 +17,9 @@ export function openSession() {
|
|
|
17
17
|
f = function () {
|
|
18
18
|
et.rr().fe(tt.vr, [c], g);
|
|
19
19
|
};
|
|
20
|
-
i.$r(f, f), o.re(t.
|
|
20
|
+
i.$r(f, f), o.re(t.hs.hr, n);
|
|
21
21
|
}),
|
|
22
|
-
o.
|
|
22
|
+
o.ss(t.hs.wr, function (r) {
|
|
23
23
|
i.yr(r);
|
|
24
24
|
});
|
|
25
25
|
}
|
package/src/Core/wipe-data.js
CHANGED
|
@@ -6,10 +6,10 @@ export function wipeData() {
|
|
|
6
6
|
const o = e.l();
|
|
7
7
|
if (null == o) return void r.warn(_);
|
|
8
8
|
o.clearData();
|
|
9
|
-
const t = to(A.
|
|
9
|
+
const t = to(A.ts);
|
|
10
10
|
for (let o = 0; o < t.length; o++) {
|
|
11
11
|
const n = t[o],
|
|
12
|
-
i = A.
|
|
12
|
+
i = A.ts[n];
|
|
13
13
|
new A(i, r).clearData();
|
|
14
14
|
}
|
|
15
15
|
if (e.X()) for (const o of e.gr()) o.clearData(!0);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { logger as r } from "../../shared-lib/index.js";
|
|
2
2
|
import FeatureFlag from "./feature-flag.js";
|
|
3
3
|
export function newFeatureFlagFromJson(e) {
|
|
4
|
-
if (e[FeatureFlag.
|
|
4
|
+
if (e[FeatureFlag._t.ht] && "boolean" == typeof e[FeatureFlag._t.le])
|
|
5
5
|
return new FeatureFlag(
|
|
6
|
-
e[FeatureFlag.
|
|
7
|
-
e[FeatureFlag.
|
|
8
|
-
e[FeatureFlag.
|
|
9
|
-
e[FeatureFlag.
|
|
6
|
+
e[FeatureFlag._t.ht],
|
|
7
|
+
e[FeatureFlag._t.le],
|
|
8
|
+
e[FeatureFlag._t.pe],
|
|
9
|
+
e[FeatureFlag._t.Fe],
|
|
10
10
|
);
|
|
11
11
|
r.info(`Unable to create feature flag from ${JSON.stringify(e, null, 2)}`);
|
|
12
12
|
}
|
|
@@ -72,4 +72,4 @@ export default class FeatureFlag {
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
(FeatureFlag.tt = { ht: "id", le: "e", pe: "pr", Fe: "fts" }),
|
|
75
|
-
(FeatureFlag.
|
|
75
|
+
(FeatureFlag._t = { ht: "id", le: "enabled", pe: "properties", Fe: "fts" });
|
|
@@ -13,41 +13,41 @@ import D from "../util/request-header-utils.js";
|
|
|
13
13
|
export default class er extends y {
|
|
14
14
|
constructor(t, s, i, r) {
|
|
15
15
|
super(),
|
|
16
|
-
(this.
|
|
17
|
-
(this
|
|
16
|
+
(this.qt = t),
|
|
17
|
+
(this.$t = s),
|
|
18
18
|
(this.u = i),
|
|
19
|
-
(this.
|
|
20
|
-
(this.
|
|
21
|
-
(this.
|
|
22
|
-
(this.
|
|
23
|
-
(this
|
|
19
|
+
(this.oi = r),
|
|
20
|
+
(this.ai = []),
|
|
21
|
+
(this.ni = 0),
|
|
22
|
+
(this.qt = t),
|
|
23
|
+
(this.$t = s),
|
|
24
24
|
(this.u = i),
|
|
25
|
-
(this.
|
|
26
|
-
(this.
|
|
27
|
-
(this.
|
|
28
|
-
(this.
|
|
29
|
-
(this.
|
|
30
|
-
(this.
|
|
31
|
-
e
|
|
25
|
+
(this.oi = r),
|
|
26
|
+
(this.li = null),
|
|
27
|
+
(this.ui = new T()),
|
|
28
|
+
(this.fi = 10),
|
|
29
|
+
(this.ci = null),
|
|
30
|
+
(this.di = null),
|
|
31
|
+
e.Ht(this.ui);
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
Ss(t) {
|
|
34
34
|
var s;
|
|
35
35
|
if (
|
|
36
|
-
(null === (s = this.
|
|
36
|
+
(null === (s = this.qt) || void 0 === s ? void 0 : s.mi()) &&
|
|
37
37
|
null != t &&
|
|
38
38
|
t.feature_flags
|
|
39
39
|
) {
|
|
40
|
-
this.
|
|
40
|
+
this.ai = [];
|
|
41
41
|
for (const s of t.feature_flags) {
|
|
42
42
|
const t = st(s);
|
|
43
|
-
t && this.
|
|
43
|
+
t && this.ai.push(t);
|
|
44
44
|
}
|
|
45
|
-
(this.
|
|
45
|
+
(this.ni = new Date().getTime()), this.gi(), this.ui.Rt(this.ai);
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
|
|
48
|
+
Fi() {
|
|
49
49
|
let t = {};
|
|
50
|
-
this.u && (t = this.u.j(o.C.
|
|
50
|
+
this.u && (t = this.u.j(o.C.vi));
|
|
51
51
|
const s = {};
|
|
52
52
|
for (const i in t) {
|
|
53
53
|
const e = it(t[i]);
|
|
@@ -55,123 +55,123 @@ export default class er extends y {
|
|
|
55
55
|
}
|
|
56
56
|
return s;
|
|
57
57
|
}
|
|
58
|
-
|
|
58
|
+
pi() {
|
|
59
59
|
var t;
|
|
60
|
-
return (null === (t = this.u) || void 0 === t ? void 0 : t.j(o.C.
|
|
60
|
+
return (null === (t = this.u) || void 0 === t ? void 0 : t.j(o.C.wi)) || {};
|
|
61
61
|
}
|
|
62
|
-
|
|
63
|
-
this.u && this.u.
|
|
62
|
+
ji(t) {
|
|
63
|
+
this.u && this.u.I(o.C.wi, t);
|
|
64
64
|
}
|
|
65
|
-
|
|
66
|
-
return this.
|
|
65
|
+
si(t) {
|
|
66
|
+
return this.ui.Nt(t);
|
|
67
67
|
}
|
|
68
68
|
refreshFeatureFlags(t, s, i = !1, e = !0) {
|
|
69
69
|
const r = () => {
|
|
70
|
-
"function" == typeof s && s(), this.
|
|
70
|
+
"function" == typeof s && s(), this.ui.Rt(this.ai);
|
|
71
71
|
};
|
|
72
|
-
if (!this.
|
|
72
|
+
if (!this.yi(i))
|
|
73
73
|
return (
|
|
74
|
-
!this.
|
|
75
|
-
this.
|
|
76
|
-
(this.
|
|
74
|
+
!this.li &&
|
|
75
|
+
this.qt &&
|
|
76
|
+
(this.li = this.qt.bi(() => {
|
|
77
77
|
this.refreshFeatureFlags(t, s);
|
|
78
78
|
})),
|
|
79
79
|
void r()
|
|
80
80
|
);
|
|
81
|
-
const h = this
|
|
81
|
+
const h = this.$t;
|
|
82
82
|
if (!h) return void r();
|
|
83
|
-
e && this.
|
|
84
|
-
const o = h
|
|
85
|
-
a = h
|
|
83
|
+
e && this.Ci();
|
|
84
|
+
const o = h.$s({}, !0),
|
|
85
|
+
a = h.Ps(o, D._s.Ri);
|
|
86
86
|
let n = !1;
|
|
87
|
-
h.
|
|
87
|
+
h.Gs(
|
|
88
88
|
o,
|
|
89
89
|
(h = -1) => {
|
|
90
|
-
if (!this
|
|
90
|
+
if (!this.$t) return void r();
|
|
91
91
|
const l = new Date().valueOf();
|
|
92
|
-
D.
|
|
92
|
+
D.Hs(this.u, D._s.Ri, l),
|
|
93
93
|
-1 !== h && a.push(["X-Braze-Req-Tokens-Remaining", h.toString()]),
|
|
94
|
-
C.
|
|
95
|
-
url: `${this.
|
|
94
|
+
C.Ks({
|
|
95
|
+
url: `${this.$t.Os()}/feature_flags/sync`,
|
|
96
96
|
headers: a,
|
|
97
97
|
data: o,
|
|
98
98
|
L: (s) => {
|
|
99
|
-
if (!this.
|
|
100
|
-
this.
|
|
101
|
-
this.
|
|
99
|
+
if (!this.$t.Qs(o, s, a)) return (n = !0), void r();
|
|
100
|
+
this.$t.Vs(),
|
|
101
|
+
this.Ss(s),
|
|
102
102
|
(n = !1),
|
|
103
|
-
D.
|
|
103
|
+
D.Ws(this.u, D._s.Ri, 1),
|
|
104
104
|
"function" == typeof t && t();
|
|
105
105
|
},
|
|
106
106
|
error: (t) => {
|
|
107
|
-
this.
|
|
107
|
+
this.$t.Ys(t, "retrieving feature flags"), (n = !0), r();
|
|
108
108
|
},
|
|
109
|
-
|
|
110
|
-
if (e && n && !this.
|
|
111
|
-
D.
|
|
112
|
-
let e = this.
|
|
113
|
-
(null == e || e < 1e3 * this.
|
|
114
|
-
this.
|
|
109
|
+
Zs: () => {
|
|
110
|
+
if (e && n && !this.di) {
|
|
111
|
+
D.ti(this.u, D._s.Ri);
|
|
112
|
+
let e = this.ci;
|
|
113
|
+
(null == e || e < 1e3 * this.fi) && (e = 1e3 * this.fi),
|
|
114
|
+
this.Ti(Math.min(3e5, U(1e3 * this.fi, 3 * e)), t, s, i);
|
|
115
115
|
}
|
|
116
116
|
},
|
|
117
117
|
});
|
|
118
118
|
},
|
|
119
|
-
D.
|
|
119
|
+
D._s.Ri,
|
|
120
120
|
s,
|
|
121
121
|
);
|
|
122
122
|
}
|
|
123
|
-
|
|
124
|
-
null != this.
|
|
123
|
+
Ci() {
|
|
124
|
+
null != this.di && (clearTimeout(this.di), (this.di = null));
|
|
125
125
|
}
|
|
126
|
-
|
|
127
|
-
this.
|
|
128
|
-
(this.
|
|
126
|
+
Ti(t = 1e3 * this.fi, s, i, e = !1) {
|
|
127
|
+
this.Ci(),
|
|
128
|
+
(this.di = window.setTimeout(() => {
|
|
129
129
|
this.refreshFeatureFlags(s, i, e);
|
|
130
130
|
}, t)),
|
|
131
|
-
(this.
|
|
131
|
+
(this.ci = t);
|
|
132
132
|
}
|
|
133
|
-
|
|
134
|
-
if (!this.
|
|
133
|
+
yi(t) {
|
|
134
|
+
if (!this.qt) return !1;
|
|
135
135
|
if (!t) {
|
|
136
|
-
const t = this.
|
|
136
|
+
const t = this.qt.Di();
|
|
137
137
|
if (null == t) return !1;
|
|
138
138
|
let s = !1;
|
|
139
139
|
if (!isNaN(t)) {
|
|
140
140
|
if (-1 === t) return r.info("Feature flag refreshes not allowed"), !1;
|
|
141
|
-
s = new Date().getTime() >= (this.
|
|
141
|
+
s = new Date().getTime() >= (this.ni || 0) + 1e3 * t;
|
|
142
142
|
}
|
|
143
143
|
if (!s)
|
|
144
144
|
return (
|
|
145
145
|
r.info(`Feature flag refreshes were rate limited to ${t} seconds`), !1
|
|
146
146
|
);
|
|
147
147
|
}
|
|
148
|
-
return this.
|
|
148
|
+
return this.qt.mi();
|
|
149
149
|
}
|
|
150
|
-
|
|
150
|
+
Ii() {
|
|
151
151
|
var t;
|
|
152
152
|
return (
|
|
153
|
-
(null === (t = this.u) || void 0 === t ? void 0 : t.j(o.C.
|
|
153
|
+
(null === (t = this.u) || void 0 === t ? void 0 : t.j(o.C.Si)) || null
|
|
154
154
|
);
|
|
155
155
|
}
|
|
156
|
-
|
|
156
|
+
qi() {
|
|
157
157
|
var t, s;
|
|
158
158
|
null === (t = this.u) ||
|
|
159
159
|
void 0 === t ||
|
|
160
|
-
t.
|
|
160
|
+
t.I(o.C.Si, null === (s = this.oi) || void 0 === s ? void 0 : s.xi());
|
|
161
161
|
}
|
|
162
|
-
|
|
162
|
+
Ni() {
|
|
163
163
|
var t;
|
|
164
|
-
const s = null === (t = this.
|
|
165
|
-
i = this.
|
|
164
|
+
const s = null === (t = this.oi) || void 0 === t ? void 0 : t.xi(),
|
|
165
|
+
i = this.Ii();
|
|
166
166
|
return null == i || s === i;
|
|
167
167
|
}
|
|
168
|
-
|
|
168
|
+
gi() {
|
|
169
169
|
if (!this.u) return;
|
|
170
170
|
const t = {};
|
|
171
|
-
for (const s of this.
|
|
171
|
+
for (const s of this.ai) {
|
|
172
172
|
const i = s.Y();
|
|
173
173
|
t[s.id] = i;
|
|
174
174
|
}
|
|
175
|
-
this.u.
|
|
175
|
+
this.u.I(o.C.vi, t), this.u.I(o.C.zi, this.ni), this.qi();
|
|
176
176
|
}
|
|
177
177
|
}
|
|
@@ -5,8 +5,8 @@ export function getAllFeatureFlags() {
|
|
|
5
5
|
if (!e.X()) return;
|
|
6
6
|
const t = [],
|
|
7
7
|
n = e.ir();
|
|
8
|
-
if (n && !n.
|
|
9
|
-
const o = ir.rr().
|
|
8
|
+
if (n && !n.mi()) return r.info("Feature flags are not enabled."), t;
|
|
9
|
+
const o = ir.rr().Fi();
|
|
10
10
|
for (const r in o) t.push(o[r]);
|
|
11
11
|
return t;
|
|
12
12
|
}
|
|
@@ -4,7 +4,7 @@ import ir from "./feature-flags-provider-factory.js";
|
|
|
4
4
|
export function getFeatureFlag(t) {
|
|
5
5
|
if (!e.X()) return;
|
|
6
6
|
const n = e.ir();
|
|
7
|
-
if (n && !n.
|
|
8
|
-
const a = ir.rr().
|
|
7
|
+
if (n && !n.mi()) return r.info("Feature flags are not enabled."), null;
|
|
8
|
+
const a = ir.rr().Fi();
|
|
9
9
|
return a[t] ? a[t] : null;
|
|
10
10
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { logger as r, EventTypes as i } from "../../shared-lib/index.js";
|
|
2
|
-
import
|
|
2
|
+
import t from "../common/event-logger.js";
|
|
3
3
|
import e from "../managers/braze-instance.js";
|
|
4
4
|
import ir from "./feature-flags-provider-factory.js";
|
|
5
|
-
export function logFeatureFlagImpression(
|
|
5
|
+
export function logFeatureFlagImpression(o) {
|
|
6
6
|
if (!e.X()) return;
|
|
7
|
-
if (!
|
|
8
|
-
const
|
|
7
|
+
if (!o) return !1;
|
|
8
|
+
const n =
|
|
9
9
|
"Not logging a feature flag impression. The feature flag was not part of any matching experiment.",
|
|
10
|
-
|
|
11
|
-
if (!
|
|
12
|
-
const a =
|
|
13
|
-
if (!a) return r.info(
|
|
14
|
-
const f = ir.rr().
|
|
10
|
+
s = ir.rr().Fi();
|
|
11
|
+
if (!s[o]) return r.info(n), !1;
|
|
12
|
+
const a = s[o].trackingString;
|
|
13
|
+
if (!a) return r.info(n), !1;
|
|
14
|
+
const f = ir.rr().pi();
|
|
15
15
|
if (f[a])
|
|
16
16
|
return (
|
|
17
17
|
r.info(
|
|
@@ -19,7 +19,7 @@ export function logFeatureFlagImpression(t) {
|
|
|
19
19
|
),
|
|
20
20
|
!1
|
|
21
21
|
);
|
|
22
|
-
(f[a] = !0), ir.rr().
|
|
23
|
-
const g = { fid:
|
|
24
|
-
return
|
|
22
|
+
(f[a] = !0), ir.rr().ji(f);
|
|
23
|
+
const g = { fid: o, fts: a };
|
|
24
|
+
return t.q(i.Fr, g).L;
|
|
25
25
|
}
|
|
@@ -4,9 +4,9 @@ import { getAllFeatureFlags } from "./get-all-feature-flags.js";
|
|
|
4
4
|
export function subscribeToFeatureFlagsUpdates(r) {
|
|
5
5
|
if (!e.X()) return;
|
|
6
6
|
const t = ir.rr();
|
|
7
|
-
if (t.
|
|
7
|
+
if (t.Ni()) {
|
|
8
8
|
const t = getAllFeatureFlags();
|
|
9
9
|
t && "function" == typeof r && r(t);
|
|
10
10
|
}
|
|
11
|
-
return t.
|
|
11
|
+
return t.si(r);
|
|
12
12
|
}
|
|
@@ -12,26 +12,26 @@ export default class ee extends y {
|
|
|
12
12
|
constructor(t, s) {
|
|
13
13
|
super(),
|
|
14
14
|
(this.u = t),
|
|
15
|
-
(this.
|
|
15
|
+
(this.Ui = s),
|
|
16
16
|
(this.cards = []),
|
|
17
|
-
(this.
|
|
17
|
+
(this.ki = null),
|
|
18
18
|
(this.u = t),
|
|
19
|
-
(this.
|
|
20
|
-
(this.
|
|
21
|
-
e
|
|
22
|
-
this.
|
|
19
|
+
(this.Ui = s),
|
|
20
|
+
(this.Bt = new T()),
|
|
21
|
+
e.Ht(this.Bt),
|
|
22
|
+
this.Yt();
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
Yt() {
|
|
25
25
|
let t = [];
|
|
26
|
-
this.u && (t = this.u.j(o.C.
|
|
26
|
+
this.u && (t = this.u.j(o.C.Ai) || []);
|
|
27
27
|
const s = [];
|
|
28
28
|
for (let i = 0; i < t.length; i++) {
|
|
29
29
|
const e = S(t[i]);
|
|
30
30
|
null != e && s.push(e);
|
|
31
31
|
}
|
|
32
|
-
(this.cards = s), this.u && (this.
|
|
32
|
+
(this.cards = s), this.u && (this.ki = w(this.u.j(o.C.Bi)));
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
Ei(t) {
|
|
35
35
|
const s = [];
|
|
36
36
|
let i = null,
|
|
37
37
|
e = {};
|
|
@@ -46,25 +46,25 @@ export default class ee extends y {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
(this.cards = s),
|
|
49
|
-
this.
|
|
50
|
-
(this.
|
|
51
|
-
this.u && (this.u.
|
|
49
|
+
this.Ts(),
|
|
50
|
+
(this.ki = new Date()),
|
|
51
|
+
this.u && (this.u.I(o.C.J, r), this.u.I(o.C.Bi, this.ki));
|
|
52
52
|
}
|
|
53
|
-
|
|
53
|
+
Ts() {
|
|
54
54
|
var t;
|
|
55
55
|
const s = [];
|
|
56
56
|
for (let t = 0; t < this.cards.length; t++) s.push(this.cards[t].Y());
|
|
57
|
-
null === (t = this.u) || void 0 === t || t.
|
|
57
|
+
null === (t = this.u) || void 0 === t || t.I(o.C.Ai, s);
|
|
58
58
|
}
|
|
59
|
-
|
|
59
|
+
Ss(t) {
|
|
60
60
|
null != t &&
|
|
61
61
|
t.feed &&
|
|
62
|
-
(this.
|
|
63
|
-
this.
|
|
64
|
-
this.
|
|
62
|
+
(this.Yt(),
|
|
63
|
+
this.Ei(t.feed),
|
|
64
|
+
this.Bt.Rt(new Feed(this.cards.slice(), this.ki)));
|
|
65
65
|
}
|
|
66
|
-
|
|
67
|
-
this.
|
|
66
|
+
Gi() {
|
|
67
|
+
this.Yt();
|
|
68
68
|
const t = [],
|
|
69
69
|
s = new Date();
|
|
70
70
|
for (let i = 0; i < this.cards.length; i++) {
|
|
@@ -72,19 +72,19 @@ export default class ee extends y {
|
|
|
72
72
|
let r = !0;
|
|
73
73
|
null != e && (r = e >= s), r && t.push(this.cards[i]);
|
|
74
74
|
}
|
|
75
|
-
return new Feed(t, this.
|
|
75
|
+
return new Feed(t, this.ki);
|
|
76
76
|
}
|
|
77
|
-
|
|
78
|
-
this.
|
|
77
|
+
qs() {
|
|
78
|
+
this.Ui && this.Ui.requestFeedRefresh();
|
|
79
79
|
}
|
|
80
|
-
|
|
81
|
-
return this.
|
|
80
|
+
si(t) {
|
|
81
|
+
return this.Bt.Nt(t);
|
|
82
82
|
}
|
|
83
83
|
clearData(t) {
|
|
84
84
|
null == t && (t = !1),
|
|
85
85
|
(this.cards = []),
|
|
86
|
-
(this.
|
|
87
|
-
t && this.u && (this.u.
|
|
88
|
-
this.
|
|
86
|
+
(this.ki = null),
|
|
87
|
+
t && this.u && (this.u.ii(o.C.Ai), this.u.ii(o.C.Bi)),
|
|
88
|
+
this.Bt.Rt(new Feed(this.cards.slice(), this.ki));
|
|
89
89
|
}
|
|
90
90
|
}
|
package/src/Feed/ui/show-feed.js
CHANGED