@braze/web-sdk 5.4.0 → 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 +3 -3
- 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 +5 -5
- package/src/Card/card-manager.js +46 -42
- 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/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/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/Push/push-manager-factory.js +4 -4
- package/src/Push/push-manager.js +6 -6
- package/src/Push/utils/push-utils.js +1 -1
- package/src/User/user-manager.js +6 -6
- package/src/User/user.js +27 -27
- package/src/common/base-provider.js +1 -1
- package/src/common/event-logger.js +7 -7
- package/src/common/feed-display.js +1 -1
- package/src/managers/auth-manager.js +9 -9
- package/src/managers/braze-instance.js +44 -44
- package/src/managers/network-manager.js +100 -100
- package/src/managers/server-config-manager.js +24 -24
- package/src/managers/session-manager.js +10 -10
- package/src/managers/storage-manager.js +20 -20
- package/src/managers/subscription-manager.js +2 -2
- package/src/models/backend-errors.js +4 -4
- package/src/models/braze-event.js +1 -1
- package/src/models/device.js +1 -1
- package/src/models/request-result.js +1 -1
- package/src/models/server-config.js +5 -5
- package/src/request-controller.js +121 -121
- package/src/triggers/models/filter.js +9 -9
- package/src/triggers/models/trigger-condition.js +26 -26
- package/src/triggers/models/trigger-events.js +1 -1
- package/src/triggers/models/trigger.js +7 -7
- package/src/triggers/triggers-provider.js +27 -27
- package/src/ui/js/attach-css.js +1 -1
- package/src/util/braze-actions.js +4 -4
- package/src/util/net.js +4 -4
- package/src/util/request-header-utils.js +17 -17
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import C from "./util/net.js";
|
|
2
2
|
import ve from "./models/braze-event.js";
|
|
3
|
-
import
|
|
3
|
+
import t from "./common/event-logger.js";
|
|
4
4
|
import { randomInclusive as U } from "./util/math.js";
|
|
5
|
-
import
|
|
5
|
+
import s from "./models/request-result.js";
|
|
6
6
|
import {
|
|
7
7
|
logger as r,
|
|
8
8
|
IndexedDBAdapter as A,
|
|
@@ -17,39 +17,39 @@ export default class Lt {
|
|
|
17
17
|
constructor(t, i, s, e, h, o, n, r, u, l) {
|
|
18
18
|
(this.rn = t),
|
|
19
19
|
(this.baseUrl = i),
|
|
20
|
-
(this.
|
|
20
|
+
(this.oi = s),
|
|
21
21
|
(this.on = e),
|
|
22
|
-
(this.
|
|
23
|
-
(this.
|
|
22
|
+
(this.yt = h),
|
|
23
|
+
(this.qt = o),
|
|
24
24
|
(this.u = n),
|
|
25
|
-
(this.
|
|
25
|
+
(this.yu = r),
|
|
26
26
|
(this.Ko = u),
|
|
27
|
-
(this
|
|
27
|
+
(this.$t = l),
|
|
28
28
|
(this.rn = t),
|
|
29
29
|
(this.baseUrl = i),
|
|
30
|
-
(this.
|
|
30
|
+
(this.ju = 0),
|
|
31
31
|
(this.fE = n.dE() || 0),
|
|
32
|
-
(this
|
|
33
|
-
(this.
|
|
32
|
+
(this.$u = null),
|
|
33
|
+
(this.oi = s),
|
|
34
34
|
(this.on = e),
|
|
35
|
-
(this.
|
|
36
|
-
(this.
|
|
35
|
+
(this.yt = h),
|
|
36
|
+
(this.qt = o),
|
|
37
37
|
(this.u = n),
|
|
38
38
|
(this.Ko = u),
|
|
39
|
-
(this
|
|
40
|
-
(this.
|
|
41
|
-
(this
|
|
42
|
-
(this.
|
|
43
|
-
(this.
|
|
44
|
-
(this.
|
|
39
|
+
(this.$t = l),
|
|
40
|
+
(this.yu = r),
|
|
41
|
+
(this.Fu = new T()),
|
|
42
|
+
(this.Lu = null),
|
|
43
|
+
(this.Mu = 50),
|
|
44
|
+
(this.Pu = !1);
|
|
45
45
|
}
|
|
46
|
-
|
|
47
|
-
return !t && !i && this.Ko.Gh() >= this.
|
|
46
|
+
xu(t, i) {
|
|
47
|
+
return !t && !i && this.Ko.Gh() >= this.Mu;
|
|
48
48
|
}
|
|
49
|
-
|
|
50
|
-
let s = this.
|
|
49
|
+
Iu(t) {
|
|
50
|
+
let s = this.oi.Gl();
|
|
51
51
|
if (t.length > 0) {
|
|
52
|
-
const e = this.
|
|
52
|
+
const e = this.yt.getUserId();
|
|
53
53
|
for (const h of t) {
|
|
54
54
|
const t = (!h.userId && !e) || h.userId === e;
|
|
55
55
|
h.type === i.ql && t && (s = !0);
|
|
@@ -57,128 +57,128 @@ export default class Lt {
|
|
|
57
57
|
}
|
|
58
58
|
return s;
|
|
59
59
|
}
|
|
60
|
-
|
|
61
|
-
s && this.
|
|
60
|
+
Nu(t = !1, i = !1, s = !0, e, h, n, u = !1, l = !1) {
|
|
61
|
+
s && this.Ou();
|
|
62
62
|
const a = this.u.AE(),
|
|
63
63
|
c = this.u.OE();
|
|
64
64
|
let d = !1;
|
|
65
65
|
const m = (t, i, r = -1) => {
|
|
66
66
|
let u = !1;
|
|
67
67
|
const l = new Date().valueOf();
|
|
68
|
-
D.
|
|
68
|
+
D.Hs(this.u, D._s.Ka, l),
|
|
69
69
|
-1 !== r && i.push(["X-Braze-Req-Tokens-Remaining", r.toString()]),
|
|
70
|
-
C.
|
|
70
|
+
C.Ks({
|
|
71
71
|
url: this.baseUrl + "/data/",
|
|
72
72
|
data: t,
|
|
73
73
|
headers: i,
|
|
74
74
|
L: (s) => {
|
|
75
75
|
null != t.respond_with &&
|
|
76
76
|
t.respond_with.triggers &&
|
|
77
|
-
(this.
|
|
78
|
-
this.
|
|
79
|
-
? (this.Ko.
|
|
80
|
-
this.
|
|
77
|
+
(this.ju = Math.max(this.ju - 1, 0)),
|
|
78
|
+
this.$t.Qs(t, s, i)
|
|
79
|
+
? (this.Ko.Vs(),
|
|
80
|
+
this.qt.al(s),
|
|
81
81
|
(null != t.respond_with &&
|
|
82
|
-
t.respond_with.user_id != this.
|
|
83
|
-
(null != t.device && this.u.
|
|
82
|
+
t.respond_with.user_id != this.yt.getUserId()) ||
|
|
83
|
+
(null != t.device && this.u.I(o.C.Fa, t.device),
|
|
84
84
|
null != t.sdk_metadata &&
|
|
85
|
-
(this.u.
|
|
86
|
-
this.u.
|
|
87
|
-
this.
|
|
88
|
-
D.
|
|
85
|
+
(this.u.I(o.C.Jh, t.sdk_metadata),
|
|
86
|
+
this.u.I(o.C.Qh, this.oi.xi())),
|
|
87
|
+
this.yu(s),
|
|
88
|
+
D.Ws(this.u, D._s.Ka, 1),
|
|
89
89
|
"function" == typeof e && e()))
|
|
90
90
|
: s.auth_error && (u = !0);
|
|
91
91
|
},
|
|
92
92
|
error: () => {
|
|
93
93
|
null != t.respond_with &&
|
|
94
94
|
t.respond_with.triggers &&
|
|
95
|
-
(this.
|
|
96
|
-
this.
|
|
95
|
+
(this.ju = Math.max(this.ju - 1, 0)),
|
|
96
|
+
this.$t.Zh(t.events, t.attributes),
|
|
97
97
|
"function" == typeof h && h();
|
|
98
98
|
},
|
|
99
|
-
|
|
99
|
+
Zs: (t) => {
|
|
100
100
|
if (("function" == typeof n && n(t), s && !d)) {
|
|
101
|
-
if (t && !u) this.
|
|
101
|
+
if (t && !u) this.zu();
|
|
102
102
|
else {
|
|
103
|
-
D.
|
|
104
|
-
let t = this
|
|
103
|
+
D.ti(this.u, D._s.Ka);
|
|
104
|
+
let t = this.$u;
|
|
105
105
|
(null == t || t < 1e3 * this.fE) && (t = 1e3 * this.fE),
|
|
106
|
-
this.
|
|
106
|
+
this.zu(Math.min(3e5, U(1e3 * this.fE, 3 * t)));
|
|
107
107
|
}
|
|
108
108
|
d = !0;
|
|
109
109
|
}
|
|
110
110
|
},
|
|
111
111
|
});
|
|
112
112
|
},
|
|
113
|
-
f = this.
|
|
113
|
+
f = this.Iu(a),
|
|
114
114
|
g = i || f;
|
|
115
|
-
if (this.
|
|
115
|
+
if (this.xu(u, f))
|
|
116
116
|
return void r.info(
|
|
117
117
|
"Declining to flush data due to 50 consecutive authentication failures",
|
|
118
118
|
);
|
|
119
|
-
if (s && !this.
|
|
120
|
-
return this.
|
|
121
|
-
const v = this.
|
|
122
|
-
g && this.
|
|
119
|
+
if (s && !this.$t.La(a, c, t, g))
|
|
120
|
+
return this.zu(), void ("function" == typeof n && n(!0));
|
|
121
|
+
const v = this.$t.Ea(t, g, a, c, l);
|
|
122
|
+
g && this.ju++;
|
|
123
123
|
let p = !1;
|
|
124
124
|
if (v)
|
|
125
125
|
for (const t of v)
|
|
126
|
-
this.
|
|
126
|
+
this.$t.Gs(
|
|
127
127
|
t.requestData,
|
|
128
128
|
(i) => m(t.requestData, t.headers, i),
|
|
129
|
-
D.
|
|
129
|
+
D._s.Ka,
|
|
130
130
|
h,
|
|
131
131
|
),
|
|
132
132
|
(p = !0);
|
|
133
133
|
this.Ko.Fh() && s && !p
|
|
134
|
-
? this.
|
|
135
|
-
: f && (r.info("Invoking new session subscriptions"), this
|
|
134
|
+
? this.zu()
|
|
135
|
+
: f && (r.info("Invoking new session subscriptions"), this.Fu.Rt());
|
|
136
136
|
}
|
|
137
|
-
|
|
138
|
-
return this.
|
|
137
|
+
Uu() {
|
|
138
|
+
return this.ju > 0;
|
|
139
139
|
}
|
|
140
|
-
|
|
141
|
-
this.
|
|
142
|
-
(this.
|
|
143
|
-
(this.
|
|
140
|
+
zu(t = 1e3 * this.fE) {
|
|
141
|
+
this.Pu ||
|
|
142
|
+
(this.Ou(),
|
|
143
|
+
(this.Lu = window.setTimeout(() => {
|
|
144
144
|
if (document.hidden) {
|
|
145
145
|
const t = "visibilitychange",
|
|
146
146
|
i = () => {
|
|
147
147
|
document.hidden ||
|
|
148
|
-
(document.removeEventListener(t, i, !1), this.
|
|
148
|
+
(document.removeEventListener(t, i, !1), this.Nu());
|
|
149
149
|
};
|
|
150
150
|
document.addEventListener(t, i, !1);
|
|
151
|
-
} else this.
|
|
151
|
+
} else this.Nu();
|
|
152
152
|
}, t)),
|
|
153
|
-
(this
|
|
153
|
+
(this.$u = t));
|
|
154
154
|
}
|
|
155
|
-
|
|
156
|
-
null != this.
|
|
155
|
+
Ou() {
|
|
156
|
+
null != this.Lu && (clearTimeout(this.Lu), (this.Lu = null));
|
|
157
157
|
}
|
|
158
158
|
initialize() {
|
|
159
|
-
(this.
|
|
159
|
+
(this.Pu = !1), this.zu();
|
|
160
160
|
}
|
|
161
161
|
destroy() {
|
|
162
|
-
this
|
|
162
|
+
this.Fu.removeAllSubscriptions(),
|
|
163
163
|
this.Ko.yh(),
|
|
164
|
-
this.
|
|
165
|
-
(this.
|
|
166
|
-
this.
|
|
167
|
-
(this.
|
|
164
|
+
this.Ou(),
|
|
165
|
+
(this.Pu = !0),
|
|
166
|
+
this.Nu(void 0, void 0, !1, void 0, void 0, void 0, void 0, !0),
|
|
167
|
+
(this.Lu = null);
|
|
168
168
|
}
|
|
169
169
|
mr(t) {
|
|
170
|
-
return this
|
|
170
|
+
return this.Fu.Nt(t);
|
|
171
171
|
}
|
|
172
172
|
openSession() {
|
|
173
|
-
const t = this.
|
|
173
|
+
const t = this.oi.xi() !== this.oi.xo();
|
|
174
174
|
t && (this.u.cE(o.iu.Uo), this.u.cE(o.iu.su)),
|
|
175
|
-
this.
|
|
176
|
-
this.u.
|
|
175
|
+
this.Nu(void 0, !1, void 0, () => {
|
|
176
|
+
this.u.ii(o.C.wi);
|
|
177
177
|
}),
|
|
178
178
|
this.Mn(),
|
|
179
179
|
t &&
|
|
180
180
|
import("./Push/push-manager-factory.js").then((t) => {
|
|
181
|
-
if (this.
|
|
181
|
+
if (this.Pu) return;
|
|
182
182
|
const i = t.default.m();
|
|
183
183
|
if (
|
|
184
184
|
null != i &&
|
|
@@ -198,27 +198,27 @@ export default class Lt {
|
|
|
198
198
|
const i = this.u.j(o.C.In);
|
|
199
199
|
(null == i || i) && t();
|
|
200
200
|
},
|
|
201
|
-
h = A.
|
|
202
|
-
new A(h, r).jr(h.
|
|
201
|
+
h = A.ts.Zt;
|
|
202
|
+
new A(h, r).jr(h.hs.cu, s, e);
|
|
203
203
|
}
|
|
204
204
|
});
|
|
205
205
|
}
|
|
206
|
-
|
|
207
|
-
this.u.
|
|
206
|
+
_u() {
|
|
207
|
+
this.u.ii(o.C.vi), this.u.ii(o.C.bs), this.u.ii(o.C.Xr);
|
|
208
208
|
}
|
|
209
209
|
changeUser(t, i, s) {
|
|
210
|
-
const e = this.
|
|
210
|
+
const e = this.yt.getUserId();
|
|
211
211
|
if (e !== t) {
|
|
212
|
-
this.
|
|
213
|
-
this.
|
|
214
|
-
null != e && this.
|
|
215
|
-
this.
|
|
212
|
+
this.oi.yl(),
|
|
213
|
+
this._u(),
|
|
214
|
+
null != e && this.Nu(void 0, !1, void 0, void 0, void 0),
|
|
215
|
+
this.yt.ou(t),
|
|
216
216
|
s ? this.Ko.setSdkAuthenticationSignature(s) : this.Ko.xh();
|
|
217
217
|
for (let t = 0; t < i.length; t++) i[t].changeUser(null == e);
|
|
218
|
-
null != e && this.u.
|
|
219
|
-
this.u.
|
|
220
|
-
this.u.
|
|
221
|
-
this.u.
|
|
218
|
+
null != e && this.u.ii(o.C.J),
|
|
219
|
+
this.u.ii(o.C.Fa),
|
|
220
|
+
this.u.ii(o.C.nE),
|
|
221
|
+
this.u.ii(o.C._E),
|
|
222
222
|
this.openSession(),
|
|
223
223
|
r.info('Changed user to "' + t + '".');
|
|
224
224
|
} else {
|
|
@@ -231,8 +231,8 @@ export default class Lt {
|
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
233
|
requestImmediateDataFlush(t) {
|
|
234
|
-
this.
|
|
235
|
-
this.
|
|
234
|
+
this.Ou(), this.oi.xo();
|
|
235
|
+
this.Nu(
|
|
236
236
|
void 0,
|
|
237
237
|
void 0,
|
|
238
238
|
void 0,
|
|
@@ -245,40 +245,40 @@ export default class Lt {
|
|
|
245
245
|
);
|
|
246
246
|
}
|
|
247
247
|
requestFeedRefresh() {
|
|
248
|
-
this.
|
|
248
|
+
this.oi.xo(), this.Nu(!0);
|
|
249
249
|
}
|
|
250
250
|
$r(t, i) {
|
|
251
|
-
this.
|
|
251
|
+
this.oi.xo(),
|
|
252
252
|
r.info("Requesting explicit trigger refresh."),
|
|
253
|
-
this.
|
|
253
|
+
this.Nu(void 0, !0, void 0, t, i);
|
|
254
254
|
}
|
|
255
|
-
Cn(
|
|
256
|
-
const h = i.
|
|
257
|
-
n = { a:
|
|
258
|
-
u =
|
|
255
|
+
Cn(s, e) {
|
|
256
|
+
const h = i.Eu,
|
|
257
|
+
n = { a: s, l: e },
|
|
258
|
+
u = t.q(h, n);
|
|
259
259
|
return (
|
|
260
|
-
u && (r.info(`Logged alias ${
|
|
260
|
+
u && (r.info(`Logged alias ${s} with label ${e}`), this.u.I(o.C._E, n)), u
|
|
261
261
|
);
|
|
262
262
|
}
|
|
263
263
|
Fn(i, e, h) {
|
|
264
|
-
if (this.
|
|
264
|
+
if (this.qt.hu(e))
|
|
265
265
|
return (
|
|
266
|
-
r.info(`Custom Attribute "${e}" is blocklisted, ignoring.`), new
|
|
266
|
+
r.info(`Custom Attribute "${e}" is blocklisted, ignoring.`), new s()
|
|
267
267
|
);
|
|
268
268
|
const o = { key: e, value: h },
|
|
269
|
-
n =
|
|
269
|
+
n = t.q(i, o);
|
|
270
270
|
if (n) {
|
|
271
271
|
const t = "object" == typeof h ? JSON.stringify(h, null, 2) : h;
|
|
272
272
|
r.info(`Logged custom attribute: ${e} with value: ${t}`);
|
|
273
273
|
}
|
|
274
274
|
return n;
|
|
275
275
|
}
|
|
276
|
-
setLastKnownLocation(
|
|
276
|
+
setLastKnownLocation(s, e, h, o, n, u) {
|
|
277
277
|
const l = { latitude: e, longitude: h };
|
|
278
278
|
null != o && (l.altitude = o),
|
|
279
279
|
null != n && (l.ll_accuracy = n),
|
|
280
280
|
null != u && (l.alt_accuracy = u);
|
|
281
|
-
const a =
|
|
281
|
+
const a = t.q(i.Ju, l, s || void 0);
|
|
282
282
|
return (
|
|
283
283
|
a &&
|
|
284
284
|
r.info(`Set user last known location as ${JSON.stringify(l, null, 2)}`),
|
|
@@ -286,44 +286,44 @@ export default class Lt {
|
|
|
286
286
|
);
|
|
287
287
|
}
|
|
288
288
|
kr(t, s) {
|
|
289
|
-
const e = this.
|
|
290
|
-
return new ve(this.
|
|
289
|
+
const e = this.oi.xo();
|
|
290
|
+
return new ve(this.yt.getUserId(), i.Ku, t, e, { cid: s });
|
|
291
291
|
}
|
|
292
|
-
|
|
292
|
+
Wu(t, i) {
|
|
293
293
|
return new A(t, i);
|
|
294
294
|
}
|
|
295
295
|
Mn() {
|
|
296
|
-
const t = A.
|
|
297
|
-
this.
|
|
296
|
+
const t = A.ts.Zt;
|
|
297
|
+
this.Wu(t, r).setItem(t.hs.Ka, 1, {
|
|
298
298
|
baseUrl: this.baseUrl,
|
|
299
299
|
data: { api_key: this.rn, device_id: this.on.ce().id },
|
|
300
|
-
userId: this.
|
|
300
|
+
userId: this.yt.getUserId(),
|
|
301
301
|
sdkAuthEnabled: this.Ko.Fh(),
|
|
302
302
|
});
|
|
303
303
|
}
|
|
304
304
|
yr(t) {
|
|
305
305
|
for (const i of t)
|
|
306
|
-
if (i.api_key === this.rn) this.
|
|
306
|
+
if (i.api_key === this.rn) this.$t.Zh(i.events, i.attributes);
|
|
307
307
|
else {
|
|
308
|
-
const t = A.
|
|
309
|
-
new A(t, r).setItem(t.
|
|
308
|
+
const t = A.ts.Zt;
|
|
309
|
+
new A(t, r).setItem(t.hs.wr, p.W(), i);
|
|
310
310
|
}
|
|
311
311
|
}
|
|
312
312
|
Gn(e, h, o) {
|
|
313
|
-
if (this.
|
|
313
|
+
if (this.qt.hu(e))
|
|
314
314
|
return (
|
|
315
|
-
r.info(`Custom Attribute "${e}" is blocklisted, ignoring.`), new
|
|
315
|
+
r.info(`Custom Attribute "${e}" is blocklisted, ignoring.`), new s()
|
|
316
316
|
);
|
|
317
317
|
let n, u;
|
|
318
318
|
return (
|
|
319
319
|
null === h && null === o
|
|
320
|
-
? ((n = i.
|
|
321
|
-
: ((n = i.
|
|
322
|
-
|
|
320
|
+
? ((n = i.Gu), (u = { key: e }))
|
|
321
|
+
: ((n = i.Xu), (u = { key: e, latitude: h, longitude: o })),
|
|
322
|
+
t.q(n, u)
|
|
323
323
|
);
|
|
324
324
|
}
|
|
325
|
-
Hn(
|
|
326
|
-
const h = { group_id:
|
|
327
|
-
return
|
|
325
|
+
Hn(s, e) {
|
|
326
|
+
const h = { group_id: s, status: e };
|
|
327
|
+
return t.q(i.Hu, h);
|
|
328
328
|
}
|
|
329
329
|
}
|
|
@@ -41,22 +41,22 @@ export default class lr {
|
|
|
41
41
|
return this._l === lr.Ol.Il
|
|
42
42
|
? null != s && Nt(s) && es(s) >= this.Ll.valueOf()
|
|
43
43
|
: null != s && typeof s == typeof this.Ll && s <= this.Ll;
|
|
44
|
-
case lr.Ql.
|
|
44
|
+
case lr.Ql.Qu:
|
|
45
45
|
return (
|
|
46
46
|
null != s &&
|
|
47
47
|
"string" == typeof s &&
|
|
48
48
|
typeof s == typeof this.Ll &&
|
|
49
49
|
null != s.match(this.Ll)
|
|
50
50
|
);
|
|
51
|
-
case lr.Ql.
|
|
51
|
+
case lr.Ql.Vu:
|
|
52
52
|
return null != s;
|
|
53
|
-
case lr.Ql.
|
|
53
|
+
case lr.Ql.Yu:
|
|
54
54
|
return null == s;
|
|
55
55
|
case lr.Ql.Fl:
|
|
56
56
|
return null != s && Nt(s) && ls(s) < this.Ll;
|
|
57
57
|
case lr.Ql.Kl:
|
|
58
58
|
return null != s && Nt(s) && ls(s) > this.Ll;
|
|
59
|
-
case lr.Ql.
|
|
59
|
+
case lr.Ql.Zu:
|
|
60
60
|
return (
|
|
61
61
|
null == s ||
|
|
62
62
|
typeof s != typeof this.Ll ||
|
|
@@ -85,7 +85,7 @@ export default class lr {
|
|
|
85
85
|
return new lr(t.k, t.t, t.c, t.v);
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
(lr.Ol = {
|
|
88
|
+
(lr.Ol = { yE: "boolean", HE: "number", LE: "string", Il: "date" }),
|
|
89
89
|
(lr.Ql = {
|
|
90
90
|
Pl: 1,
|
|
91
91
|
Yl: 2,
|
|
@@ -93,10 +93,10 @@ export default class lr {
|
|
|
93
93
|
Ul: 4,
|
|
94
94
|
$l: 5,
|
|
95
95
|
Xl: 6,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
Qu: 10,
|
|
97
|
+
Vu: 11,
|
|
98
|
+
Yu: 12,
|
|
99
99
|
Fl: 15,
|
|
100
100
|
Kl: 16,
|
|
101
|
-
|
|
101
|
+
Zu: 17,
|
|
102
102
|
});
|
|
@@ -28,25 +28,25 @@ export default class ri {
|
|
|
28
28
|
const t = e.type;
|
|
29
29
|
let r = null;
|
|
30
30
|
switch (t) {
|
|
31
|
-
case ri.
|
|
32
|
-
case ri.
|
|
31
|
+
case ri.Er.OPEN:
|
|
32
|
+
case ri.Er.kt:
|
|
33
33
|
break;
|
|
34
|
-
case ri.
|
|
34
|
+
case ri.Er.Rr:
|
|
35
35
|
r = ns.fromJson(e.data);
|
|
36
36
|
break;
|
|
37
|
-
case ri.
|
|
37
|
+
case ri.Er.nc:
|
|
38
38
|
r = hs.fromJson(e.data);
|
|
39
39
|
break;
|
|
40
|
-
case ri.
|
|
40
|
+
case ri.Er.vr:
|
|
41
41
|
r = ur.fromJson(e.data);
|
|
42
42
|
break;
|
|
43
|
-
case ri.
|
|
43
|
+
case ri.Er.ue:
|
|
44
44
|
r = ts.fromJson(e.data);
|
|
45
45
|
break;
|
|
46
|
-
case ri.
|
|
46
|
+
case ri.Er.lc:
|
|
47
47
|
r = rs.fromJson(e.data);
|
|
48
48
|
break;
|
|
49
|
-
case ri.
|
|
49
|
+
case ri.Er.Vr:
|
|
50
50
|
r = ni.fromJson(e.data);
|
|
51
51
|
}
|
|
52
52
|
return new ri(t, r);
|
|
@@ -58,46 +58,46 @@ export default class ri {
|
|
|
58
58
|
let t,
|
|
59
59
|
r = null;
|
|
60
60
|
switch (e.t) {
|
|
61
|
-
case ri.
|
|
62
|
-
case ri.
|
|
61
|
+
case ri.Er.OPEN:
|
|
62
|
+
case ri.Er.kt:
|
|
63
63
|
break;
|
|
64
|
-
case ri.
|
|
64
|
+
case ri.Er.Rr:
|
|
65
65
|
r = new ns(e.d);
|
|
66
66
|
break;
|
|
67
|
-
case ri.
|
|
67
|
+
case ri.Er.nc:
|
|
68
68
|
(t = e.d || {}), (r = new hs(t.id, is.qn(t.pf || [])));
|
|
69
69
|
break;
|
|
70
|
-
case ri.
|
|
70
|
+
case ri.Er.vr:
|
|
71
71
|
r = new ur(e.d);
|
|
72
72
|
break;
|
|
73
|
-
case ri.
|
|
73
|
+
case ri.Er.ue:
|
|
74
74
|
r = new ts(e.d);
|
|
75
75
|
break;
|
|
76
|
-
case ri.
|
|
76
|
+
case ri.Er.lc:
|
|
77
77
|
(t = e.d || {}), (r = new rs(t.e, is.qn(t.pf || [])));
|
|
78
78
|
break;
|
|
79
|
-
case ri.
|
|
79
|
+
case ri.Er.Vr:
|
|
80
80
|
r = new ni(e.d);
|
|
81
81
|
}
|
|
82
82
|
return new ri(e.t, r);
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
-
(ri.
|
|
85
|
+
(ri.Er = {
|
|
86
86
|
OPEN: "open",
|
|
87
87
|
Rr: "purchase",
|
|
88
88
|
nc: "purchase_property",
|
|
89
89
|
vr: "push_click",
|
|
90
90
|
ue: "custom_event",
|
|
91
91
|
lc: "custom_event_property",
|
|
92
|
-
|
|
92
|
+
Vr: "iam_click",
|
|
93
93
|
kt: "test",
|
|
94
94
|
}),
|
|
95
95
|
(ri.cc = {}),
|
|
96
|
-
(ri.cc[ri.
|
|
97
|
-
(ri.cc[ri.
|
|
98
|
-
(ri.cc[ri.
|
|
99
|
-
(ri.cc[ri.
|
|
100
|
-
(ri.cc[ri.
|
|
101
|
-
(ri.cc[ri.
|
|
102
|
-
(ri.cc[ri.
|
|
103
|
-
(ri.cc[ri.
|
|
96
|
+
(ri.cc[ri.Er.OPEN] = tt.OPEN),
|
|
97
|
+
(ri.cc[ri.Er.Rr] = tt.Rr),
|
|
98
|
+
(ri.cc[ri.Er.nc] = tt.Rr),
|
|
99
|
+
(ri.cc[ri.Er.vr] = tt.vr),
|
|
100
|
+
(ri.cc[ri.Er.ue] = tt.ue),
|
|
101
|
+
(ri.cc[ri.Er.lc] = tt.ue),
|
|
102
|
+
(ri.cc[ri.Er.Vr] = tt.Vr),
|
|
103
|
+
(ri.cc[ri.Er.kt] = tt.kt);
|
|
@@ -16,7 +16,7 @@ export default class gt {
|
|
|
16
16
|
(this.data = l),
|
|
17
17
|
(this.ed = o),
|
|
18
18
|
(this.rd = n),
|
|
19
|
-
(this.
|
|
19
|
+
(this.Or = a),
|
|
20
20
|
(this.hd = u),
|
|
21
21
|
(this.od = d),
|
|
22
22
|
(this.id = t),
|
|
@@ -29,7 +29,7 @@ export default class gt {
|
|
|
29
29
|
(this.type = h),
|
|
30
30
|
(this.ed = o || 0),
|
|
31
31
|
null == a && (a = 1e3 * (this.ed + 30)),
|
|
32
|
-
(this.
|
|
32
|
+
(this.Or = a),
|
|
33
33
|
(this.data = l),
|
|
34
34
|
null != n && (this.rd = n),
|
|
35
35
|
(this.hd = u),
|
|
@@ -49,11 +49,11 @@ export default class gt {
|
|
|
49
49
|
}
|
|
50
50
|
dd(t) {
|
|
51
51
|
const i = new Date().valueOf() - t,
|
|
52
|
-
s = null == t || isNaN(i) || null == this.
|
|
52
|
+
s = null == t || isNaN(i) || null == this.Or || i < this.Or;
|
|
53
53
|
return (
|
|
54
54
|
s ||
|
|
55
55
|
r.info(
|
|
56
|
-
`Trigger action ${this.type} is no longer eligible for display - fired ${i}ms ago and has a timeout of ${this.
|
|
56
|
+
`Trigger action ${this.type} is no longer eligible for display - fired ${i}ms ago and has a timeout of ${this.Or}ms.`,
|
|
57
57
|
),
|
|
58
58
|
!s
|
|
59
59
|
);
|
|
@@ -73,7 +73,7 @@ export default class gt {
|
|
|
73
73
|
d = t.data,
|
|
74
74
|
m = t.min_seconds_since_last_trigger;
|
|
75
75
|
return J(
|
|
76
|
-
gt.
|
|
76
|
+
gt.Er,
|
|
77
77
|
o,
|
|
78
78
|
"Could not construct Trigger from server data",
|
|
79
79
|
"Trigger.Types",
|
|
@@ -94,7 +94,7 @@ export default class gt {
|
|
|
94
94
|
da: this.data,
|
|
95
95
|
d: this.ed,
|
|
96
96
|
r: this.rd,
|
|
97
|
-
tm: this.
|
|
97
|
+
tm: this.Or,
|
|
98
98
|
ss: this.hd,
|
|
99
99
|
ld: this.od,
|
|
100
100
|
};
|
|
@@ -119,4 +119,4 @@ export default class gt {
|
|
|
119
119
|
);
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
|
-
(gt.
|
|
122
|
+
(gt.Er = { _r: "inapp", md: "templated_iam" }), (gt.td = -1);
|