@braze/web-sdk 6.7.0 → 6.8.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 +74 -27
- package/package.json +1 -1
- package/shared-lib/encoding-utils.js +2 -2
- package/shared-lib/event-types.js +13 -13
- package/shared-lib/indexed-db-adapter.js +3 -3
- package/shared-lib/logger.js +2 -2
- package/shared-lib/supported-options.js +8 -8
- package/src/Banner/log-banner-impressions.js +20 -11
- package/src/ContentCards/content-cards-provider-factory.js +13 -11
- package/src/ContentCards/content-cards-provider.js +4 -4
- package/src/ContentCards/get-cached-content-cards.js +2 -2
- package/src/ContentCards/request-content-cards-refresh.js +2 -2
- package/src/ContentCards/subscribe-to-content-cards-updates.js +10 -10
- package/src/ContentCards/ui/show-content-cards.js +3 -3
- package/src/Core/change-user.js +2 -2
- package/src/Core/index.js +1 -0
- package/src/Core/log-ecommerce-event.js +29 -0
- package/src/Core/log-purchase.js +17 -192
- package/src/Core/open-session.js +6 -6
- package/src/Core/set-sdk-authentication-signature.js +1 -1
- package/src/Core/subscribe-to-sdk-authentication-failures.js +1 -1
- package/src/DUST/dust-connection-core.js +1 -0
- package/src/DUST/dust-provider-factory.js +10 -10
- package/src/DUST/dust-provider.js +181 -158
- package/src/DUST/dust-shared-worker-code.js +1 -1
- package/src/DUST/dust-shared-worker-impl.js +93 -100
- package/src/DUST/dust-worker-bridge.js +27 -27
- package/src/DUST/subscribe-to-dust.js +7 -7
- package/src/InAppMessage/defer-in-app-message.js +1 -1
- package/src/InAppMessage/display/in-app-message-to-html.js +16 -16
- package/src/InAppMessage/display/modal-utils.js +2 -2
- package/src/InAppMessage/in-app-message-manager.js +64 -64
- package/src/InAppMessage/log-in-app-message-button-click.js +1 -1
- package/src/InAppMessage/log-in-app-message-click.js +1 -1
- 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 +7 -7
- package/src/InAppMessage/models/html-message.js +1 -1
- package/src/InAppMessage/models/in-app-message-button.js +4 -4
- package/src/InAppMessage/models/in-app-message.js +22 -22
- package/src/InAppMessage/models/modal-message.js +5 -5
- package/src/InAppMessage/models/slide-up-message.js +6 -6
- 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 +20 -20
- package/src/Push/push-manager-factory.js +2 -2
- package/src/Push/push-manager.js +8 -8
- package/src/Push/utils/push-utils.js +6 -6
- package/src/User/user-manager.js +5 -5
- package/src/User/user.js +8 -8
- package/src/common/constants.js +1 -0
- package/src/common/content-cards-display.js +2 -2
- package/src/l10n/l10n-manager-factory.js +1 -1
- package/src/l10n/l10n-manager.js +1 -1
- package/src/managers/braze-instance.js +21 -21
- package/src/managers/device-manager.js +6 -6
- package/src/managers/network-manager.js +93 -92
- package/src/managers/server-config-manager.js +68 -68
- package/src/managers/session-manager.js +2 -2
- package/src/managers/storage-manager-factory.js +4 -4
- package/src/managers/storage-manager.js +120 -120
- package/src/managers/subscription-manager.js +1 -1
- package/src/managers/utils.js +1 -1
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +3 -3
- package/src/models/device.js +1 -1
- package/src/models/identifier.js +3 -3
- package/src/models/push-token.js +5 -5
- package/src/models/server-config.js +27 -27
- package/src/request-controller.js +99 -99
- package/src/triggers/models/custom-event-data.js +4 -4
- package/src/triggers/models/custom-event-property-data.js +5 -5
- package/src/triggers/models/filter-set.js +2 -2
- package/src/triggers/models/filter.js +1 -1
- package/src/triggers/models/in-app-message-click-data.js +5 -5
- 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 +5 -5
- package/src/triggers/models/trigger-condition.js +42 -42
- package/src/triggers/models/trigger-events.js +2 -2
- package/src/triggers/models/trigger.js +10 -10
- package/src/triggers/triggers-provider-factory.js +1 -1
- package/src/triggers/triggers-provider.js +30 -30
- package/src/types.js +5 -1
- package/src/ui/js/attach-css.js +1 -1
- package/src/util/braze-actions.js +5 -5
- package/src/util/browser-detector.js +13 -13
- package/src/util/client-hints-parser.js +2 -2
- package/src/util/dom-utils.js +2 -2
- package/src/util/ecommerce-event-validation.js +326 -0
- package/src/util/iso-4217-currency-codes.js +176 -0
- package/src/util/net.js +3 -3
- package/src/util/request-header-utils.js +18 -18
- package/src/util/user-agent-parser.js +14 -14
- package/src/util/validation-utils.js +2 -2
- package/src/util/window-utils.js +2 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
-
GLOBAL_RATE_LIMIT_CAPACITY_DEFAULT as
|
|
3
|
-
GLOBAL_RATE_LIMIT_REFILL_RATE_DEFAULT as
|
|
2
|
+
GLOBAL_RATE_LIMIT_CAPACITY_DEFAULT as mi,
|
|
3
|
+
GLOBAL_RATE_LIMIT_REFILL_RATE_DEFAULT as fi,
|
|
4
4
|
} from "../common/constants.js";
|
|
5
|
-
export default class
|
|
5
|
+
export default class di {
|
|
6
6
|
constructor(
|
|
7
7
|
t = 0,
|
|
8
8
|
i = [],
|
|
@@ -12,49 +12,49 @@ export default class ci {
|
|
|
12
12
|
l = null,
|
|
13
13
|
r = { enabled: !1 },
|
|
14
14
|
n = { enabled: !1, refresh_rate_limit: void 0 },
|
|
15
|
-
a = { enabled: !0, capacity:
|
|
15
|
+
a = { enabled: !0, capacity: mi, refill_rate: fi, endpoint_overrides: {} },
|
|
16
16
|
o = null,
|
|
17
17
|
u = null,
|
|
18
18
|
c = null,
|
|
19
19
|
d = null,
|
|
20
20
|
) {
|
|
21
|
-
(this.
|
|
22
|
-
(this.
|
|
23
|
-
(this.
|
|
24
|
-
(this.
|
|
25
|
-
(this.
|
|
26
|
-
(this.
|
|
27
|
-
(this.
|
|
21
|
+
(this.nc = t),
|
|
22
|
+
(this.ac = i),
|
|
23
|
+
(this.hc = s),
|
|
24
|
+
(this.cc = h),
|
|
25
|
+
(this.mc = e),
|
|
26
|
+
(this.uc = l),
|
|
27
|
+
(this.oc = r),
|
|
28
28
|
(this.Xr = n),
|
|
29
|
-
(this.
|
|
29
|
+
(this.lc = a),
|
|
30
30
|
(this.banners = o),
|
|
31
31
|
(this.dust = u),
|
|
32
|
-
(this.
|
|
33
|
-
(this.
|
|
32
|
+
(this.fc = c),
|
|
33
|
+
(this.Rc = d);
|
|
34
34
|
}
|
|
35
35
|
qt() {
|
|
36
36
|
return {
|
|
37
|
-
s: "6.
|
|
38
|
-
l: this.
|
|
39
|
-
e: this.
|
|
40
|
-
a: this.
|
|
41
|
-
p: this.
|
|
42
|
-
m: this.
|
|
43
|
-
v: this.
|
|
44
|
-
c: this.
|
|
37
|
+
s: "6.8.0",
|
|
38
|
+
l: this.nc,
|
|
39
|
+
e: this.ac,
|
|
40
|
+
a: this.hc,
|
|
41
|
+
p: this.cc,
|
|
42
|
+
m: this.mc,
|
|
43
|
+
v: this.uc,
|
|
44
|
+
c: this.oc,
|
|
45
45
|
f: this.Xr,
|
|
46
|
-
grl: this.
|
|
46
|
+
grl: this.lc,
|
|
47
47
|
b: this.banners,
|
|
48
48
|
d: this.dust,
|
|
49
|
-
rb: this.
|
|
50
|
-
mst: this.
|
|
49
|
+
rb: this.fc,
|
|
50
|
+
mst: this.Rc,
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
53
|
static _u(t) {
|
|
54
54
|
let i = t.l;
|
|
55
55
|
return (
|
|
56
|
-
"6.
|
|
57
|
-
new
|
|
56
|
+
"6.8.0" !== t.s && (i = 0),
|
|
57
|
+
new di(i, t.e, t.a, t.p, t.m, t.v, t.c, t.f, t.grl, t.b, t.d, t.rb, t.mst)
|
|
58
58
|
);
|
|
59
59
|
}
|
|
60
60
|
}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
logger as E,
|
|
6
6
|
} from "../shared-lib/index.js";
|
|
7
7
|
import v from "./common/event-logger.js";
|
|
8
|
-
import { removeAllVisibleInAppMessages as
|
|
8
|
+
import { removeAllVisibleInAppMessages as gi } from "./InAppMessage/ui/remove-all-visible-in-app-messages.js";
|
|
9
9
|
import { STORAGE_KEYS as s } from "./managers/storage-manager.js";
|
|
10
10
|
import f from "./managers/subscription-manager.js";
|
|
11
11
|
import Ie from "./models/braze-event.js";
|
|
@@ -23,14 +23,14 @@ export default class Kt {
|
|
|
23
23
|
(this.Ss = h),
|
|
24
24
|
(this.h = n),
|
|
25
25
|
(this.C = o),
|
|
26
|
-
(this.
|
|
26
|
+
(this.kc = r),
|
|
27
27
|
(this.Gh = l),
|
|
28
28
|
(this.B = u),
|
|
29
29
|
(this.tu = t),
|
|
30
30
|
(this.baseUrl = i),
|
|
31
|
-
(this.
|
|
32
|
-
(this.
|
|
33
|
-
(this.
|
|
31
|
+
(this.yc = 0),
|
|
32
|
+
(this.IS = o.dS() || 0),
|
|
33
|
+
(this.jc = null),
|
|
34
34
|
(this.j = s),
|
|
35
35
|
(this.eu = e),
|
|
36
36
|
(this.Ss = h),
|
|
@@ -38,17 +38,17 @@ export default class Kt {
|
|
|
38
38
|
(this.C = o),
|
|
39
39
|
(this.Gh = l),
|
|
40
40
|
(this.B = u),
|
|
41
|
-
(this.
|
|
42
|
-
(this.
|
|
43
|
-
(this.
|
|
44
|
-
(this
|
|
45
|
-
(this
|
|
46
|
-
(this.
|
|
41
|
+
(this.kc = r),
|
|
42
|
+
(this.Ac = new f()),
|
|
43
|
+
(this.Dc = null),
|
|
44
|
+
(this.$c = 50),
|
|
45
|
+
(this.qc = !1),
|
|
46
|
+
(this.Cc = !1);
|
|
47
47
|
}
|
|
48
|
-
|
|
49
|
-
return !t && !i && this.Gh.Ih() >= this
|
|
48
|
+
Mc(t, i) {
|
|
49
|
+
return !t && !i && this.Gh.Ih() >= this.$c;
|
|
50
50
|
}
|
|
51
|
-
|
|
51
|
+
Tc(t) {
|
|
52
52
|
let i = this.j.am();
|
|
53
53
|
if (t.length > 0) {
|
|
54
54
|
const s = this.Ss.getUserId();
|
|
@@ -59,14 +59,14 @@ export default class Kt {
|
|
|
59
59
|
}
|
|
60
60
|
return i;
|
|
61
61
|
}
|
|
62
|
-
|
|
63
|
-
i && this.
|
|
64
|
-
const c = this.C.
|
|
65
|
-
d = this.C.
|
|
62
|
+
Lc(t = !1, i = !0, e, n, o, r = !1, u = !1) {
|
|
63
|
+
i && this.Fc();
|
|
64
|
+
const c = this.C.hS(),
|
|
65
|
+
d = this.C.RS();
|
|
66
66
|
let m = !1;
|
|
67
67
|
const f = (t, r, u = -1) => {
|
|
68
68
|
const c = new Date().valueOf();
|
|
69
|
-
h.nt(this.C, h.it.
|
|
69
|
+
h.nt(this.C, h.it.wn, c),
|
|
70
70
|
-1 !== u && r.push(["X-Braze-Req-Tokens-Remaining", u.toString()]);
|
|
71
71
|
let d = !1;
|
|
72
72
|
l.ot({
|
|
@@ -76,18 +76,18 @@ export default class Kt {
|
|
|
76
76
|
lt: (i) => {
|
|
77
77
|
null != t.respond_with &&
|
|
78
78
|
t.respond_with.triggers &&
|
|
79
|
-
(this.
|
|
79
|
+
(this.yc = Math.max(this.yc - 1, 0)),
|
|
80
80
|
this.B.ut(t, i, r)
|
|
81
81
|
? (this.Gh.ct(),
|
|
82
|
-
this.h.
|
|
82
|
+
this.h.rc(i),
|
|
83
83
|
(null != t.respond_with &&
|
|
84
84
|
t.respond_with.user_id != this.Ss.getUserId()) ||
|
|
85
|
-
(null != t.device && this.C.It(s.Tt.
|
|
85
|
+
(null != t.device && this.C.It(s.Tt.Ka, t.device),
|
|
86
86
|
null != t.sdk_metadata &&
|
|
87
|
-
(this.C.It(s.Tt.
|
|
88
|
-
this.C.It(s.Tt.
|
|
89
|
-
this.
|
|
90
|
-
h.
|
|
87
|
+
(this.C.It(s.Tt.Ua, t.sdk_metadata),
|
|
88
|
+
this.C.It(s.Tt.Wa, this.j.kt())),
|
|
89
|
+
this.kc(i),
|
|
90
|
+
h.yl(this.C, h.it.wn, 1),
|
|
91
91
|
"function" == typeof e && e()))
|
|
92
92
|
: i.auth_error && (d = !0);
|
|
93
93
|
},
|
|
@@ -95,13 +95,13 @@ export default class Kt {
|
|
|
95
95
|
(d = !0),
|
|
96
96
|
null != t.respond_with &&
|
|
97
97
|
t.respond_with.triggers &&
|
|
98
|
-
(this.
|
|
99
|
-
this.B.
|
|
98
|
+
(this.yc = Math.max(this.yc - 1, 0)),
|
|
99
|
+
this.B.Ya(t.events, t.attributes),
|
|
100
100
|
"function" == typeof n && n();
|
|
101
101
|
},
|
|
102
102
|
ft: (t, s) => {
|
|
103
103
|
"function" == typeof o && o(!d);
|
|
104
|
-
const e = this.B.
|
|
104
|
+
const e = this.B.jl(s);
|
|
105
105
|
let n = 0;
|
|
106
106
|
if (e)
|
|
107
107
|
switch (e.type) {
|
|
@@ -113,93 +113,93 @@ export default class Kt {
|
|
|
113
113
|
}
|
|
114
114
|
if (i && !m) {
|
|
115
115
|
if (d) {
|
|
116
|
-
h.
|
|
116
|
+
h.Ml(this.C, h.it.wn);
|
|
117
117
|
const t = this.h.vt(),
|
|
118
118
|
i = this.h.gt(),
|
|
119
119
|
s = this.h.bt();
|
|
120
|
-
let e = this.
|
|
120
|
+
let e = this.jc;
|
|
121
121
|
(null == e || e < t) && (e = t);
|
|
122
122
|
const o = Math.min(s, a(t, e * i)) + n;
|
|
123
|
-
this.
|
|
124
|
-
} else this.
|
|
123
|
+
this.Ic(o);
|
|
124
|
+
} else this.Ic(Math.max(1e3 * this.IS, n));
|
|
125
125
|
m = !0;
|
|
126
126
|
}
|
|
127
127
|
},
|
|
128
128
|
});
|
|
129
129
|
},
|
|
130
|
-
g = this.
|
|
130
|
+
g = this.Tc(c),
|
|
131
131
|
p = t || g;
|
|
132
|
-
if (this.
|
|
132
|
+
if (this.Mc(r, g))
|
|
133
133
|
return void E.info(
|
|
134
134
|
"Declining to flush data due to 50 consecutive authentication failures",
|
|
135
135
|
);
|
|
136
|
-
if (i && !this.B.
|
|
137
|
-
return this.
|
|
138
|
-
const v = this.B.
|
|
139
|
-
p && this.
|
|
136
|
+
if (i && !this.B.vl(c, d, p))
|
|
137
|
+
return this.Ic(), void ("function" == typeof o && o(!0));
|
|
138
|
+
const v = this.B.Rl(p, c, d, u);
|
|
139
|
+
p && this.yc++;
|
|
140
140
|
let b = !1;
|
|
141
141
|
if (v)
|
|
142
142
|
for (const t of v)
|
|
143
143
|
this.B.et(
|
|
144
144
|
t.requestData,
|
|
145
145
|
(i) => f(t.requestData, t.headers, i),
|
|
146
|
-
h.it.
|
|
146
|
+
h.it.wn,
|
|
147
147
|
n,
|
|
148
148
|
),
|
|
149
149
|
(b = !0);
|
|
150
150
|
this.Gh.Fh() && i && !b
|
|
151
|
-
? this.
|
|
151
|
+
? this.Ic()
|
|
152
152
|
: g &&
|
|
153
153
|
(E.info("Invoking new session subscriptions"),
|
|
154
|
-
this.
|
|
155
|
-
(this.
|
|
154
|
+
this.Ac.A(),
|
|
155
|
+
(this.Cc = !0));
|
|
156
156
|
}
|
|
157
|
-
|
|
158
|
-
return this.
|
|
157
|
+
Pc() {
|
|
158
|
+
return this.yc > 0;
|
|
159
159
|
}
|
|
160
|
-
|
|
161
|
-
this
|
|
162
|
-
(this.
|
|
163
|
-
(this.
|
|
160
|
+
Ic(t = 1e3 * this.IS) {
|
|
161
|
+
this.qc ||
|
|
162
|
+
(this.Fc(),
|
|
163
|
+
(this.Dc = window.setTimeout(() => {
|
|
164
164
|
if (document.hidden) {
|
|
165
165
|
const t = "visibilitychange",
|
|
166
166
|
i = () => {
|
|
167
167
|
document.hidden ||
|
|
168
|
-
(document.removeEventListener(t, i, !1), this.
|
|
168
|
+
(document.removeEventListener(t, i, !1), this.Lc());
|
|
169
169
|
};
|
|
170
170
|
document.addEventListener(t, i, !1);
|
|
171
|
-
} else this.
|
|
171
|
+
} else this.Lc();
|
|
172
172
|
}, t)),
|
|
173
|
-
(this.
|
|
173
|
+
(this.jc = t));
|
|
174
174
|
}
|
|
175
|
-
|
|
176
|
-
null != this.
|
|
175
|
+
Fc() {
|
|
176
|
+
null != this.Dc && (clearTimeout(this.Dc), (this.Dc = null));
|
|
177
177
|
}
|
|
178
178
|
initialize() {
|
|
179
|
-
(this
|
|
179
|
+
(this.qc = !1), this.Ic();
|
|
180
180
|
}
|
|
181
181
|
destroy() {
|
|
182
|
-
this.
|
|
182
|
+
this.Ac.removeAllSubscriptions(),
|
|
183
183
|
this.Gh.xh(),
|
|
184
|
-
this.
|
|
185
|
-
(this
|
|
186
|
-
this.
|
|
187
|
-
(this.
|
|
188
|
-
(this.
|
|
184
|
+
this.Fc(),
|
|
185
|
+
(this.qc = !0),
|
|
186
|
+
this.Lc(void 0, !1, void 0, void 0, void 0, void 0, !0),
|
|
187
|
+
(this.Dc = null),
|
|
188
|
+
(this.Cc = !1);
|
|
189
189
|
}
|
|
190
190
|
rn(t) {
|
|
191
|
-
return this.
|
|
191
|
+
return this.Cc ? (t(), null) : this.Ac.Kt(t);
|
|
192
192
|
}
|
|
193
193
|
openSession() {
|
|
194
194
|
const t = this.j.kt() !== this.j.el();
|
|
195
|
-
t && (this.C.
|
|
196
|
-
this.
|
|
195
|
+
t && (this.C.cS(s.Ou.Wh), this.C.cS(s.Ou.Cu)),
|
|
196
|
+
this.Lc(!1, void 0, () => {
|
|
197
197
|
t && (this.C.Qt(s.Tt.jo), this.C.Qt(s.Tt.Wt));
|
|
198
198
|
}),
|
|
199
|
-
this.
|
|
199
|
+
this.Sa(),
|
|
200
200
|
t &&
|
|
201
201
|
import("./Push/push-manager-factory.js").then((t) => {
|
|
202
|
-
if (this
|
|
202
|
+
if (this.qc) return;
|
|
203
203
|
const i = t.default.ra();
|
|
204
204
|
if (
|
|
205
205
|
null != i &&
|
|
@@ -224,30 +224,30 @@ export default class Kt {
|
|
|
224
224
|
}
|
|
225
225
|
});
|
|
226
226
|
}
|
|
227
|
-
|
|
228
|
-
this.C.Qt(s.Tt.Fo), this.C.Qt(s.Tt.Ci), this.C.Qt(s.Tt.
|
|
227
|
+
Nc() {
|
|
228
|
+
this.C.Qt(s.Tt.Fo), this.C.Qt(s.Tt.Ci), this.C.Qt(s.Tt.fa);
|
|
229
229
|
}
|
|
230
|
-
|
|
231
|
-
this.C.Qt(s.Tt.
|
|
232
|
-
this.C.Qt(s.Tt.
|
|
233
|
-
this.C.Qt(s.Tt
|
|
234
|
-
this.C.Qt(s.Tt.
|
|
230
|
+
Oc() {
|
|
231
|
+
this.C.Qt(s.Tt.Sl),
|
|
232
|
+
this.C.Qt(s.Tt.ES),
|
|
233
|
+
this.C.Qt(s.Tt.$l),
|
|
234
|
+
this.C.Qt(s.Tt.Fl);
|
|
235
235
|
}
|
|
236
236
|
changeUser(t, i, e) {
|
|
237
237
|
const h = this.Ss.getUserId();
|
|
238
238
|
if (h !== t) {
|
|
239
239
|
this.j.Sm(),
|
|
240
|
-
this.
|
|
241
|
-
|
|
242
|
-
null != h && this.
|
|
240
|
+
this.Nc(),
|
|
241
|
+
gi(),
|
|
242
|
+
null != h && this.Lc(void 0, !1, void 0, void 0, void 0),
|
|
243
243
|
this.Ss.Ju(t),
|
|
244
244
|
e ? this.Gh.setSdkAuthenticationSignature(e) : this.Gh.jh();
|
|
245
245
|
for (let t = 0; t < i.length; t++) i[t].changeUser(null == h);
|
|
246
246
|
this.B.fo(),
|
|
247
|
-
null != h && this.C.Qt(s.Tt.
|
|
248
|
-
this.C.Qt(s.Tt.
|
|
249
|
-
this.C.Qt(s.Tt.
|
|
250
|
-
this.
|
|
247
|
+
null != h && this.C.Qt(s.Tt.eS),
|
|
248
|
+
this.C.Qt(s.Tt.Ka),
|
|
249
|
+
this.C.Qt(s.Tt.lS),
|
|
250
|
+
this.Oc(),
|
|
251
251
|
this.openSession(),
|
|
252
252
|
E.info('Changed user to "' + t + '".');
|
|
253
253
|
} else {
|
|
@@ -260,8 +260,8 @@ export default class Kt {
|
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
requestImmediateDataFlush(t) {
|
|
263
|
-
this.
|
|
264
|
-
this.
|
|
263
|
+
this.Fc(), this.j.el();
|
|
264
|
+
this.Lc(
|
|
265
265
|
void 0,
|
|
266
266
|
void 0,
|
|
267
267
|
void 0,
|
|
@@ -272,17 +272,17 @@ export default class Kt {
|
|
|
272
272
|
!0,
|
|
273
273
|
);
|
|
274
274
|
}
|
|
275
|
-
|
|
275
|
+
Ar(t, i) {
|
|
276
276
|
this.j.el(),
|
|
277
277
|
E.info("Requesting explicit trigger refresh."),
|
|
278
|
-
this.
|
|
278
|
+
this.Lc(!0, void 0, t, i);
|
|
279
279
|
}
|
|
280
280
|
Gu(t, i) {
|
|
281
|
-
const e = p.
|
|
281
|
+
const e = p.Uc,
|
|
282
282
|
h = { a: t, l: i },
|
|
283
283
|
n = v.wt(e, h);
|
|
284
284
|
return (
|
|
285
|
-
n && (E.info(`Logged alias ${t} with label ${i}`), this.C.It(s.Tt.
|
|
285
|
+
n && (E.info(`Logged alias ${t} with label ${i}`), this.C.It(s.Tt.lS, h)),
|
|
286
286
|
n
|
|
287
287
|
);
|
|
288
288
|
}
|
|
@@ -304,35 +304,35 @@ export default class Kt {
|
|
|
304
304
|
null != e && (o.altitude = e),
|
|
305
305
|
null != h && (o.ll_accuracy = h),
|
|
306
306
|
null != n && (o.alt_accuracy = n);
|
|
307
|
-
const r = v.wt(p.
|
|
307
|
+
const r = v.wt(p.Bc, o, t || void 0);
|
|
308
308
|
return (
|
|
309
309
|
r &&
|
|
310
310
|
E.info(`Set user last known location as ${JSON.stringify(o, null, 2)}`),
|
|
311
311
|
r
|
|
312
312
|
);
|
|
313
313
|
}
|
|
314
|
-
|
|
314
|
+
Fr(t, i) {
|
|
315
315
|
const s = this.j.el();
|
|
316
|
-
return new Ie(this.Ss.getUserId(), p.
|
|
316
|
+
return new Ie(this.Ss.getUserId(), p.Jc, t, s, { cid: i });
|
|
317
317
|
}
|
|
318
|
-
|
|
318
|
+
Kc(t, i) {
|
|
319
319
|
return new et(t, i);
|
|
320
320
|
}
|
|
321
|
-
|
|
321
|
+
Sa() {
|
|
322
322
|
const t = et.Ps.$s;
|
|
323
|
-
this.
|
|
323
|
+
this.Kc(t, E).setItem(t.Os.wn, 1, {
|
|
324
324
|
baseUrl: this.baseUrl,
|
|
325
325
|
data: { api_key: this.tu, device_id: this.eu.ve().id },
|
|
326
326
|
userId: this.Ss.getUserId(),
|
|
327
327
|
sdkAuthEnabled: this.Gh.Fh(),
|
|
328
328
|
});
|
|
329
329
|
}
|
|
330
|
-
|
|
330
|
+
Dr(t) {
|
|
331
331
|
for (const i of t)
|
|
332
|
-
if (i.api_key === this.tu) this.B.
|
|
332
|
+
if (i.api_key === this.tu) this.B.Ya(i.events, i.attributes);
|
|
333
333
|
else {
|
|
334
334
|
const t = et.Ps.$s;
|
|
335
|
-
new et(t, E).setItem(t.Os.
|
|
335
|
+
new et(t, E).setItem(t.Os.Br, V.de(), i);
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
338
|
Na(t, i, s) {
|
|
@@ -343,13 +343,13 @@ export default class Kt {
|
|
|
343
343
|
let e, h;
|
|
344
344
|
return (
|
|
345
345
|
null === i && null === s
|
|
346
|
-
? ((e = p.
|
|
347
|
-
: ((e = p.
|
|
346
|
+
? ((e = p.Wc), (h = { key: t }))
|
|
347
|
+
: ((e = p.Gc), (h = { key: t, latitude: i, longitude: s })),
|
|
348
348
|
v.wt(e, h)
|
|
349
349
|
);
|
|
350
350
|
}
|
|
351
|
-
|
|
351
|
+
Ia(t, i) {
|
|
352
352
|
const s = { group_id: t, status: i };
|
|
353
|
-
return v.wt(p.
|
|
353
|
+
return v.wt(p.Xc, s);
|
|
354
354
|
}
|
|
355
355
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export default class es {
|
|
2
2
|
constructor(t) {
|
|
3
|
-
(this.
|
|
3
|
+
(this.Hc = t), (this.Hc = t);
|
|
4
4
|
}
|
|
5
|
-
|
|
6
|
-
return null == this.
|
|
5
|
+
Qc(t) {
|
|
6
|
+
return null == this.Hc || this.Hc === t[0];
|
|
7
7
|
}
|
|
8
8
|
static fromJson(t) {
|
|
9
9
|
return new es(t ? t.event_name : null);
|
|
10
10
|
}
|
|
11
11
|
qt() {
|
|
12
|
-
return this.
|
|
12
|
+
return this.Hc;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import ls from "./filter-set.js";
|
|
2
2
|
export default class ns {
|
|
3
3
|
constructor(t, s) {
|
|
4
|
-
(this.
|
|
4
|
+
(this.Hc = t), (this.tf = s), (this.Hc = t), (this.tf = s);
|
|
5
5
|
}
|
|
6
|
-
|
|
7
|
-
if (null == this.
|
|
6
|
+
Qc(t) {
|
|
7
|
+
if (null == this.Hc || null == this.tf) return !1;
|
|
8
8
|
const s = t[0],
|
|
9
9
|
i = t[1];
|
|
10
|
-
return s === this.
|
|
10
|
+
return s === this.Hc && this.tf.Qc(i);
|
|
11
11
|
}
|
|
12
12
|
static fromJson(t) {
|
|
13
13
|
return new ns(
|
|
@@ -16,6 +16,6 @@ export default class ns {
|
|
|
16
16
|
);
|
|
17
17
|
}
|
|
18
18
|
qt() {
|
|
19
|
-
return { e: this.
|
|
19
|
+
return { e: this.Hc, pf: this.tf ? this.tf.qt() : null };
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -4,13 +4,13 @@ export default class ls {
|
|
|
4
4
|
constructor(t) {
|
|
5
5
|
(this.filters = t), (this.filters = t);
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
Qc(t) {
|
|
8
8
|
let r = !0;
|
|
9
9
|
for (let e = 0; e < this.filters.length; e++) {
|
|
10
10
|
const o = this.filters[e];
|
|
11
11
|
let s = !1;
|
|
12
12
|
for (let r = 0; r < o.length; r++)
|
|
13
|
-
if (o[r].
|
|
13
|
+
if (o[r].Qc(t)) {
|
|
14
14
|
s = !0;
|
|
15
15
|
break;
|
|
16
16
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
export default class
|
|
1
|
+
import pi from "./trigger-condition.js";
|
|
2
|
+
export default class bi {
|
|
3
3
|
constructor(t, i) {
|
|
4
4
|
(this.if = t), (this.rf = i), (this.if = t), (this.rf = i);
|
|
5
5
|
}
|
|
6
|
-
|
|
6
|
+
Qc(t) {
|
|
7
7
|
if (null == this.if) return !1;
|
|
8
|
-
const i =
|
|
8
|
+
const i = pi.sf(t[0], this.if);
|
|
9
9
|
if (!i) return !1;
|
|
10
10
|
let r = null == this.rf || 0 === this.rf.length;
|
|
11
11
|
if (null != this.rf)
|
|
@@ -17,7 +17,7 @@ export default class pi {
|
|
|
17
17
|
return i && r;
|
|
18
18
|
}
|
|
19
19
|
static fromJson(t) {
|
|
20
|
-
return new
|
|
20
|
+
return new bi(t ? t.id : null, t ? t.buttons : null);
|
|
21
21
|
}
|
|
22
22
|
qt() {
|
|
23
23
|
return this.if;
|
|
@@ -3,11 +3,11 @@ export default class fs {
|
|
|
3
3
|
constructor(t, s) {
|
|
4
4
|
(this.productId = t), (this.tf = s), (this.productId = t), (this.tf = s);
|
|
5
5
|
}
|
|
6
|
-
|
|
6
|
+
Qc(t) {
|
|
7
7
|
if (null == this.productId || null == this.tf) return !1;
|
|
8
8
|
const s = t[0],
|
|
9
9
|
i = t[1];
|
|
10
|
-
return s === this.productId && this.tf.
|
|
10
|
+
return s === this.productId && this.tf.Qc(i);
|
|
11
11
|
}
|
|
12
12
|
static fromJson(t) {
|
|
13
13
|
return new fs(
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
export default class
|
|
1
|
+
import pi from "./trigger-condition.js";
|
|
2
|
+
export default class jr {
|
|
3
3
|
constructor(t) {
|
|
4
4
|
(this.if = t), (this.if = t);
|
|
5
5
|
}
|
|
6
|
-
|
|
7
|
-
return null == this.if ||
|
|
6
|
+
Qc(t) {
|
|
7
|
+
return null == this.if || pi.sf(t[0], this.if);
|
|
8
8
|
}
|
|
9
9
|
static fromJson(t) {
|
|
10
|
-
return new
|
|
10
|
+
return new jr(t ? t.campaign_id : null);
|
|
11
11
|
}
|
|
12
12
|
qt() {
|
|
13
13
|
return this.if;
|