@braze/web-sdk 5.3.2 → 5.4.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 +7 -7
- package/shared-lib/indexed-db-adapter.js +1 -1
- package/shared-lib/logger.js +2 -2
- package/shared-lib/supported-options.js +9 -8
- package/src/Card/display/card-display.js +59 -58
- package/src/Core/index.js +1 -0
- package/src/Core/is-initialized.js +4 -0
- package/src/InAppMessage/display/in-app-message-to-html.js +64 -62
- package/src/InAppMessage/ui/show-in-app-message.js +42 -40
- package/src/Push/push-manager-factory.js +2 -1
- package/src/Push/push-manager.js +73 -85
- package/src/Push/utils/push-utils.js +3 -3
- package/src/User/user-manager.js +2 -2
- package/src/User/user.js +4 -4
- package/src/common/event-logger.js +4 -4
- package/src/common/feed-display.js +17 -16
- package/src/l10n/l10n-manager-factory.js +7 -7
- package/src/l10n/l10n-manager.js +15 -5
- package/src/managers/braze-instance.js +53 -51
- package/src/managers/device-manager.js +17 -17
- package/src/managers/network-manager.js +89 -89
- package/src/managers/server-config-manager.js +4 -4
- package/src/managers/session-manager.js +4 -4
- package/src/managers/storage-manager-factory.js +1 -1
- package/src/managers/storage-manager.js +17 -17
- 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/server-config.js +2 -2
- package/src/request-controller.js +74 -74
- package/src/triggers/models/filter.js +3 -3
- 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 +1 -1
- package/src/triggers/triggers-provider.js +3 -3
- 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/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 +1 -1
- package/src/util/request-header-utils.js +7 -7
- package/src/util/user-agent-parser.js +3 -3
- package/src/util/window-utils.js +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import C from "./util/net.js";
|
|
2
|
-
import
|
|
2
|
+
import ve from "./models/braze-event.js";
|
|
3
3
|
import s from "./common/event-logger.js";
|
|
4
4
|
import { randomInclusive as U } from "./util/math.js";
|
|
5
5
|
import t from "./models/request-result.js";
|
|
@@ -23,7 +23,7 @@ export default class Lt {
|
|
|
23
23
|
(this.yt = o),
|
|
24
24
|
(this.u = n),
|
|
25
25
|
(this.wu = r),
|
|
26
|
-
(this.
|
|
26
|
+
(this.Ko = u),
|
|
27
27
|
(this.qt = l),
|
|
28
28
|
(this.rn = t),
|
|
29
29
|
(this.baseUrl = i),
|
|
@@ -35,18 +35,18 @@ export default class Lt {
|
|
|
35
35
|
(this.wt = h),
|
|
36
36
|
(this.yt = o),
|
|
37
37
|
(this.u = n),
|
|
38
|
-
(this.
|
|
38
|
+
(this.Ko = u),
|
|
39
39
|
(this.qt = l),
|
|
40
40
|
(this.wu = r),
|
|
41
|
-
(this
|
|
42
|
-
(this
|
|
43
|
-
(this.
|
|
44
|
-
(this.
|
|
41
|
+
(this.$u = new T()),
|
|
42
|
+
(this.Fu = null),
|
|
43
|
+
(this.Lu = 50),
|
|
44
|
+
(this.Mu = !1);
|
|
45
45
|
}
|
|
46
|
-
|
|
47
|
-
return !t && !i && this.
|
|
46
|
+
Pu(t, i) {
|
|
47
|
+
return !t && !i && this.Ko.Gh() >= this.Lu;
|
|
48
48
|
}
|
|
49
|
-
|
|
49
|
+
xu(t) {
|
|
50
50
|
let s = this.ri.Gl();
|
|
51
51
|
if (t.length > 0) {
|
|
52
52
|
const e = this.wt.getUserId();
|
|
@@ -57,15 +57,15 @@ export default class Lt {
|
|
|
57
57
|
}
|
|
58
58
|
return s;
|
|
59
59
|
}
|
|
60
|
-
|
|
61
|
-
s && this.
|
|
60
|
+
Iu(t = !1, i = !1, s = !0, e, h, n, u = !1, l = !1) {
|
|
61
|
+
s && this.Nu();
|
|
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._s(this.u, D.Ps
|
|
68
|
+
D._s(this.u, D.Ps.La, l),
|
|
69
69
|
-1 !== r && i.push(["X-Braze-Req-Tokens-Remaining", r.toString()]),
|
|
70
70
|
C.Gs({
|
|
71
71
|
url: this.baseUrl + "/data/",
|
|
@@ -76,16 +76,16 @@ export default class Lt {
|
|
|
76
76
|
t.respond_with.triggers &&
|
|
77
77
|
(this.yu = Math.max(this.yu - 1, 0)),
|
|
78
78
|
this.qt.Ks(t, s, i)
|
|
79
|
-
? (this.
|
|
79
|
+
? (this.Ko.Os(),
|
|
80
80
|
this.yt.al(s),
|
|
81
81
|
(null != t.respond_with &&
|
|
82
82
|
t.respond_with.user_id != this.wt.getUserId()) ||
|
|
83
|
-
(null != t.device && this.u.k(o.C.
|
|
83
|
+
(null != t.device && this.u.k(o.C.Fa, t.device),
|
|
84
84
|
null != t.sdk_metadata &&
|
|
85
|
-
(this.u.k(o.C.
|
|
86
|
-
this.u.k(o.C.
|
|
85
|
+
(this.u.k(o.C.Jh, t.sdk_metadata),
|
|
86
|
+
this.u.k(o.C.Qh, this.ri.Si())),
|
|
87
87
|
this.wu(s),
|
|
88
|
-
D.Qs(this.u, D.Ps
|
|
88
|
+
D.Qs(this.u, D.Ps.La, 1),
|
|
89
89
|
"function" == typeof e && e()))
|
|
90
90
|
: s.auth_error && (u = !0);
|
|
91
91
|
},
|
|
@@ -93,32 +93,32 @@ export default class Lt {
|
|
|
93
93
|
null != t.respond_with &&
|
|
94
94
|
t.respond_with.triggers &&
|
|
95
95
|
(this.yu = Math.max(this.yu - 1, 0)),
|
|
96
|
-
this.qt.
|
|
96
|
+
this.qt.Zh(t.events, t.attributes),
|
|
97
97
|
"function" == typeof h && h();
|
|
98
98
|
},
|
|
99
99
|
Ws: (t) => {
|
|
100
100
|
if (("function" == typeof n && n(t), s && !d)) {
|
|
101
|
-
if (t && !u) this.
|
|
101
|
+
if (t && !u) this.Ou();
|
|
102
102
|
else {
|
|
103
|
-
D.Ys(this.u, D.Ps
|
|
103
|
+
D.Ys(this.u, D.Ps.La);
|
|
104
104
|
let t = this.ju;
|
|
105
105
|
(null == t || t < 1e3 * this.fE) && (t = 1e3 * this.fE),
|
|
106
|
-
this.
|
|
106
|
+
this.Ou(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.xu(a),
|
|
114
114
|
g = i || f;
|
|
115
|
-
if (this.
|
|
115
|
+
if (this.Pu(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.qt.
|
|
120
|
-
return this.
|
|
121
|
-
const v = this.qt
|
|
119
|
+
if (s && !this.qt.Xa(a, c, t, g))
|
|
120
|
+
return this.Ou(), void ("function" == typeof n && n(!0));
|
|
121
|
+
const v = this.qt.$a(t, g, a, c, l);
|
|
122
122
|
g && this.yu++;
|
|
123
123
|
let p = !1;
|
|
124
124
|
if (v)
|
|
@@ -126,59 +126,59 @@ export default class Lt {
|
|
|
126
126
|
this.qt.Xs(
|
|
127
127
|
t.requestData,
|
|
128
128
|
(i) => m(t.requestData, t.headers, i),
|
|
129
|
-
D.Ps
|
|
129
|
+
D.Ps.La,
|
|
130
130
|
h,
|
|
131
131
|
),
|
|
132
132
|
(p = !0);
|
|
133
|
-
this.
|
|
134
|
-
? this.
|
|
135
|
-
: f && (r.info("Invoking new session subscriptions"), this.
|
|
133
|
+
this.Ko.Fh() && s && !p
|
|
134
|
+
? this.Ou()
|
|
135
|
+
: f && (r.info("Invoking new session subscriptions"), this.$u.Dt());
|
|
136
136
|
}
|
|
137
|
-
|
|
137
|
+
zu() {
|
|
138
138
|
return this.yu > 0;
|
|
139
139
|
}
|
|
140
|
-
|
|
141
|
-
this.
|
|
142
|
-
(this.
|
|
143
|
-
(this
|
|
140
|
+
Ou(t = 1e3 * this.fE) {
|
|
141
|
+
this.Mu ||
|
|
142
|
+
(this.Nu(),
|
|
143
|
+
(this.Fu = 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.Iu());
|
|
149
149
|
};
|
|
150
150
|
document.addEventListener(t, i, !1);
|
|
151
|
-
} else this.
|
|
151
|
+
} else this.Iu();
|
|
152
152
|
}, t)),
|
|
153
153
|
(this.ju = t));
|
|
154
154
|
}
|
|
155
|
-
|
|
156
|
-
null != this
|
|
155
|
+
Nu() {
|
|
156
|
+
null != this.Fu && (clearTimeout(this.Fu), (this.Fu = null));
|
|
157
157
|
}
|
|
158
158
|
initialize() {
|
|
159
|
-
(this.
|
|
159
|
+
(this.Mu = !1), this.Ou();
|
|
160
160
|
}
|
|
161
161
|
destroy() {
|
|
162
|
-
this.
|
|
163
|
-
this.
|
|
164
|
-
this.
|
|
165
|
-
(this.
|
|
166
|
-
this.
|
|
167
|
-
(this
|
|
162
|
+
this.$u.removeAllSubscriptions(),
|
|
163
|
+
this.Ko.yh(),
|
|
164
|
+
this.Nu(),
|
|
165
|
+
(this.Mu = !0),
|
|
166
|
+
this.Iu(void 0, void 0, !1, void 0, void 0, void 0, void 0, !0),
|
|
167
|
+
(this.Fu = null);
|
|
168
168
|
}
|
|
169
169
|
mr(t) {
|
|
170
|
-
return this.
|
|
170
|
+
return this.$u.It(t);
|
|
171
171
|
}
|
|
172
172
|
openSession() {
|
|
173
|
-
const t = this.ri.Si() !== this.ri.
|
|
173
|
+
const t = this.ri.Si() !== this.ri.xo();
|
|
174
174
|
t && (this.u.cE(o.iu.Uo), this.u.cE(o.iu.su)),
|
|
175
|
-
this.
|
|
175
|
+
this.Iu(void 0, !1, void 0, () => {
|
|
176
176
|
this.u.ti(o.C.vi);
|
|
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.Mu) return;
|
|
182
182
|
const i = t.default.m();
|
|
183
183
|
if (
|
|
184
184
|
null != i &&
|
|
@@ -203,20 +203,20 @@ export default class Lt {
|
|
|
203
203
|
}
|
|
204
204
|
});
|
|
205
205
|
}
|
|
206
|
-
|
|
206
|
+
Uu() {
|
|
207
207
|
this.u.ti(o.C.gi), this.u.ti(o.C.ws), this.u.ti(o.C.Nr);
|
|
208
208
|
}
|
|
209
209
|
changeUser(t, i, s) {
|
|
210
210
|
const e = this.wt.getUserId();
|
|
211
211
|
if (e !== t) {
|
|
212
212
|
this.ri.yl(),
|
|
213
|
-
this.
|
|
214
|
-
null != e && this.
|
|
213
|
+
this.Uu(),
|
|
214
|
+
null != e && this.Iu(void 0, !1, void 0, void 0, void 0),
|
|
215
215
|
this.wt.ou(t),
|
|
216
|
-
s ? this.
|
|
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
218
|
null != e && this.u.ti(o.C.J),
|
|
219
|
-
this.u.ti(o.C.
|
|
219
|
+
this.u.ti(o.C.Fa),
|
|
220
220
|
this.u.ti(o.C.nE),
|
|
221
221
|
this.u.ti(o.C._E),
|
|
222
222
|
this.openSession(),
|
|
@@ -224,15 +224,15 @@ export default class Lt {
|
|
|
224
224
|
} else {
|
|
225
225
|
let i = "Doing nothing.";
|
|
226
226
|
s &&
|
|
227
|
-
this.
|
|
228
|
-
(this.
|
|
227
|
+
this.Ko.kh() !== s &&
|
|
228
|
+
(this.Ko.setSdkAuthenticationSignature(s),
|
|
229
229
|
(i = "Updated SDK authentication signature")),
|
|
230
230
|
r.info(`Current user is already ${t}. ${i}`);
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
233
|
requestImmediateDataFlush(t) {
|
|
234
|
-
this.
|
|
235
|
-
this.
|
|
234
|
+
this.Nu(), this.ri.xo();
|
|
235
|
+
this.Iu(
|
|
236
236
|
void 0,
|
|
237
237
|
void 0,
|
|
238
238
|
void 0,
|
|
@@ -245,15 +245,15 @@ export default class Lt {
|
|
|
245
245
|
);
|
|
246
246
|
}
|
|
247
247
|
requestFeedRefresh() {
|
|
248
|
-
this.ri.
|
|
248
|
+
this.ri.xo(), this.Iu(!0);
|
|
249
249
|
}
|
|
250
250
|
$r(t, i) {
|
|
251
|
-
this.ri.
|
|
251
|
+
this.ri.xo(),
|
|
252
252
|
r.info("Requesting explicit trigger refresh."),
|
|
253
|
-
this.
|
|
253
|
+
this.Iu(void 0, !0, void 0, t, i);
|
|
254
254
|
}
|
|
255
255
|
Cn(t, e) {
|
|
256
|
-
const h = i.
|
|
256
|
+
const h = i._u,
|
|
257
257
|
n = { a: t, l: e },
|
|
258
258
|
u = s.q(h, n);
|
|
259
259
|
return (
|
|
@@ -278,7 +278,7 @@ export default class Lt {
|
|
|
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 = s.q(i.
|
|
281
|
+
const a = s.q(i.Bu, l, t || void 0);
|
|
282
282
|
return (
|
|
283
283
|
a &&
|
|
284
284
|
r.info(`Set user last known location as ${JSON.stringify(l, null, 2)}`),
|
|
@@ -286,24 +286,24 @@ export default class Lt {
|
|
|
286
286
|
);
|
|
287
287
|
}
|
|
288
288
|
kr(t, s) {
|
|
289
|
-
const e = this.ri.
|
|
290
|
-
return new
|
|
289
|
+
const e = this.ri.xo();
|
|
290
|
+
return new ve(this.wt.getUserId(), i.Eu, t, e, { cid: s });
|
|
291
291
|
}
|
|
292
|
-
|
|
292
|
+
Ju(t, i) {
|
|
293
293
|
return new A(t, i);
|
|
294
294
|
}
|
|
295
295
|
Mn() {
|
|
296
296
|
const t = A.Yt.Qt;
|
|
297
|
-
this.
|
|
297
|
+
this.Ju(t, r).setItem(t.ss.La, 1, {
|
|
298
298
|
baseUrl: this.baseUrl,
|
|
299
299
|
data: { api_key: this.rn, device_id: this.on.ce().id },
|
|
300
300
|
userId: this.wt.getUserId(),
|
|
301
|
-
sdkAuthEnabled: this.
|
|
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.qt.
|
|
306
|
+
if (i.api_key === this.rn) this.qt.Zh(i.events, i.attributes);
|
|
307
307
|
else {
|
|
308
308
|
const t = A.Yt.Qt;
|
|
309
309
|
new A(t, r).setItem(t.ss.wr, p.W(), i);
|
|
@@ -317,13 +317,13 @@ export default class Lt {
|
|
|
317
317
|
let n, u;
|
|
318
318
|
return (
|
|
319
319
|
null === h && null === o
|
|
320
|
-
? ((n = i.
|
|
321
|
-
: ((n = i.
|
|
320
|
+
? ((n = i.Ku), (u = { key: e }))
|
|
321
|
+
: ((n = i.Wu), (u = { key: e, latitude: h, longitude: o })),
|
|
322
322
|
s.q(n, u)
|
|
323
323
|
);
|
|
324
324
|
}
|
|
325
325
|
Hn(t, e) {
|
|
326
326
|
const h = { group_id: t, status: e };
|
|
327
|
-
return s.q(i.
|
|
327
|
+
return s.q(i.Gu, h);
|
|
328
328
|
}
|
|
329
329
|
}
|
|
@@ -56,7 +56,7 @@ export default class lr {
|
|
|
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.Vu:
|
|
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 = { Yu: "boolean", Zu: "number", yE: "string", Il: "date" }),
|
|
89
89
|
(lr.Ql = {
|
|
90
90
|
Pl: 1,
|
|
91
91
|
Yl: 2,
|
|
@@ -98,5 +98,5 @@ export default class lr {
|
|
|
98
98
|
Xu: 12,
|
|
99
99
|
Fl: 15,
|
|
100
100
|
Kl: 16,
|
|
101
|
-
|
|
101
|
+
Vu: 17,
|
|
102
102
|
});
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import ri from "./trigger-condition.js";
|
|
2
2
|
export default class ni {
|
|
3
3
|
constructor(t, i) {
|
|
4
|
-
(this.
|
|
4
|
+
(this.tf = t), (this.if = i), (this.tf = t), (this.if = i);
|
|
5
5
|
}
|
|
6
6
|
Jl(t) {
|
|
7
|
-
if (null == this.
|
|
8
|
-
const i = ri.
|
|
7
|
+
if (null == this.tf) return !1;
|
|
8
|
+
const i = ri.rf(t[0], this.tf);
|
|
9
9
|
if (!i) return !1;
|
|
10
|
-
let r = null == this.
|
|
11
|
-
if (null != this.
|
|
12
|
-
for (let i = 0; i < this.
|
|
13
|
-
if (this.
|
|
10
|
+
let r = null == this.if || 0 === this.if.length;
|
|
11
|
+
if (null != this.if)
|
|
12
|
+
for (let i = 0; i < this.if.length; i++)
|
|
13
|
+
if (this.if[i] === t[1]) {
|
|
14
14
|
r = !0;
|
|
15
15
|
break;
|
|
16
16
|
}
|
|
@@ -20,6 +20,6 @@ export default class ni {
|
|
|
20
20
|
return new ni(t ? t.id : null, t ? t.buttons : null);
|
|
21
21
|
}
|
|
22
22
|
Y() {
|
|
23
|
-
return this.
|
|
23
|
+
return this.tf;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import ri from "./trigger-condition.js";
|
|
2
2
|
export default class ur {
|
|
3
3
|
constructor(t) {
|
|
4
|
-
(this.
|
|
4
|
+
(this.tf = t), (this.tf = t);
|
|
5
5
|
}
|
|
6
6
|
Jl(t) {
|
|
7
|
-
return null == this.
|
|
7
|
+
return null == this.tf || ri.rf(t[0], this.tf);
|
|
8
8
|
}
|
|
9
9
|
static fromJson(t) {
|
|
10
10
|
return new ur(t ? t.campaign_id : null);
|
|
11
11
|
}
|
|
12
12
|
Y() {
|
|
13
|
-
return this.
|
|
13
|
+
return this.tf;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import y from "../common/base-provider.js";
|
|
2
2
|
import { newInAppMessageFromJson as pt } from "../InAppMessage/in-app-message-factory.js";
|
|
3
|
-
import
|
|
3
|
+
import ve from "../models/braze-event.js";
|
|
4
4
|
import {
|
|
5
5
|
isArray as j,
|
|
6
6
|
isEqual as ii,
|
|
@@ -75,7 +75,7 @@ export default class gr extends y {
|
|
|
75
75
|
let t, e;
|
|
76
76
|
h.push(n),
|
|
77
77
|
null != n.ug && (t = n.ug),
|
|
78
|
-
null != n.dg &&
|
|
78
|
+
null != n.dg && ve.RE(n.dg) && (e = ve.qn(n.dg));
|
|
79
79
|
const l = [];
|
|
80
80
|
if (n.pg && j(n.pg))
|
|
81
81
|
for (let t = 0; t < n.pg.length; t++) {
|
|
@@ -211,7 +211,7 @@ export default class gr extends y {
|
|
|
211
211
|
}
|
|
212
212
|
fe(t, i = null, s) {
|
|
213
213
|
if (!J(tt, t, "Cannot fire trigger action.", "TriggerEvents")) return;
|
|
214
|
-
if (this.zi && this.zi.
|
|
214
|
+
if (this.zi && this.zi.zu())
|
|
215
215
|
return (
|
|
216
216
|
r.info(
|
|
217
217
|
"Trigger sync is currently in progress, awaiting sync completion before firing trigger event.",
|
package/src/ui/js/attach-css.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e, { OPTIONS as L } from "../../managers/braze-instance.js";
|
|
2
2
|
export function attachCSS(n, t, o) {
|
|
3
3
|
const c = n || document.querySelector("head"),
|
|
4
|
-
s = `ab-${t}-css-definitions-${"5.
|
|
4
|
+
s = `ab-${t}-css-definitions-${"5.4.0".replace(/\./g, "-")}`;
|
|
5
5
|
if (!c) return;
|
|
6
6
|
const a = c.ownerDocument || document;
|
|
7
7
|
if (null == a.getElementById(s)) {
|
package/src/ui/js/feed-css.js
CHANGED
|
@@ -4,7 +4,7 @@ export function attachFeedCSS(t) {
|
|
|
4
4
|
Ce(
|
|
5
5
|
t,
|
|
6
6
|
"feed",
|
|
7
|
-
"body>.ab-feed{position:fixed;top:0;right:0;bottom:0;width:421px;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}body>.ab-feed .ab-feed-body{position:absolute;top:0;left:0;right:0;border:none;border-left:1px solid #d0d0d0;padding-top:70px;min-height:100%}body>.ab-feed .ab-initial-spinner{float:none}body>.ab-feed .ab-no-cards-message{position:absolute;width:100%;margin-left:-20px;top:40%}.ab-feed{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-box-shadow:0 1px 7px 1px rgba(66,82,113,.15);-moz-box-shadow:0 1px 7px 1px rgba(66,82,113,.15);box-shadow:0 1px 7px 1px rgba(66,82,113,.15);width:402px;background-color:#eee;font-family:'Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px;line-height:130%;letter-spacing:normal;overflow-y:auto;overflow-x:visible;z-index:9011;-webkit-overflow-scrolling:touch}.ab-feed :focus,.ab-feed:focus{outline:0}.ab-feed .ab-feed-body{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border:1px solid #d0d0d0;border-top:none;padding:20px 20px 0 20px}.ab-feed.ab-effect-slide{-webkit-transform:translateX(450px);-moz-transform:translateX(450px);-ms-transform:translateX(450px);transform:translateX(450px);-webkit-transition:transform .5s ease-in-out;-moz-transition:transform .5s ease-in-out;-o-transition:transform .5s ease-in-out;transition:transform .5s ease-in-out}.ab-feed.ab-effect-slide.ab-show{-webkit-transform:translateX(0);-moz-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}.ab-feed.ab-effect-slide.ab-hide{-webkit-transform:translateX(450px);-moz-transform:translateX(450px);-ms-transform:translateX(450px);transform:translateX(450px)}.ab-feed .ab-card{position:relative;-webkit-box-shadow:0 2px 3px 0 rgba(178,178,178,.5);-moz-box-shadow:0 2px 3px 0 rgba(178,178,178,.5);box-shadow:0 2px 3px 0 rgba(178,178,178,.5);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;width:100%;border:1px solid #d0d0d0;margin-bottom:20px;overflow:hidden;background-color:#fff;-webkit-transition:height .4s ease-in-out,margin .4s ease-in-out;-moz-transition:height .4s ease-in-out,margin .4s ease-in-out;-o-transition:height .4s ease-in-out,margin .4s ease-in-out;transition:height .4s ease-in-out,margin .4s ease-in-out}.ab-feed .ab-card .ab-pinned-indicator{position:absolute;right:0;top:0;margin-right:-1px;width:0;height:0;border-style:solid;border-width:0 24px 24px 0;border-color:transparent #1676d0 transparent transparent}.ab-feed .ab-card .ab-pinned-indicator .fa-star{position:absolute;right:-21px;top:2px;font-size:9px;color:#fff}.ab-feed .ab-card.ab-effect-card.ab-hide{-webkit-transition:all .5s ease-in-out;-moz-transition:all .5s ease-in-out;-o-transition:all .5s ease-in-out;transition:all .5s ease-in-out}.ab-feed .ab-card.ab-effect-card.ab-hide.ab-swiped-left{-webkit-transform:translateX(-450px);-moz-transform:translateX(-450px);-ms-transform:translateX(-450px);transform:translateX(-450px)}.ab-feed .ab-card.ab-effect-card.ab-hide.ab-swiped-right{-webkit-transform:translateX(450px);-moz-transform:translateX(450px);-ms-transform:translateX(450px);transform:translateX(450px)}.ab-feed .ab-card.ab-effect-card.ab-hide:not(.ab-swiped-left):not(.ab-swiped-right){opacity:0}.ab-feed .ab-card .ab-close-button{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;background-color:transparent;background-size:15px;border:none;width:15px;min-width:15px;height:15px;cursor:pointer;display:block;font-size:15px;line-height:0;padding-top:15px;padding-right:15px;padding-left:15px;padding-bottom:15px;position:absolute;
|
|
7
|
+
"body>.ab-feed{position:fixed;top:0;right:0;bottom:0;width:421px;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}body>.ab-feed .ab-feed-body{position:absolute;top:0;left:0;right:0;border:none;border-left:1px solid #d0d0d0;padding-top:70px;min-height:100%}body>.ab-feed .ab-initial-spinner{float:none}body>.ab-feed .ab-no-cards-message{position:absolute;width:100%;margin-left:-20px;top:40%}.ab-feed{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-box-shadow:0 1px 7px 1px rgba(66,82,113,.15);-moz-box-shadow:0 1px 7px 1px rgba(66,82,113,.15);box-shadow:0 1px 7px 1px rgba(66,82,113,.15);width:402px;background-color:#eee;font-family:'Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px;line-height:130%;letter-spacing:normal;overflow-y:auto;overflow-x:visible;z-index:9011;-webkit-overflow-scrolling:touch}.ab-feed :focus,.ab-feed:focus{outline:0}.ab-feed .ab-feed-body{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border:1px solid #d0d0d0;border-top:none;padding:20px 20px 0 20px}.ab-feed.ab-effect-slide{-webkit-transform:translateX(450px);-moz-transform:translateX(450px);-ms-transform:translateX(450px);transform:translateX(450px);-webkit-transition:transform .5s ease-in-out;-moz-transition:transform .5s ease-in-out;-o-transition:transform .5s ease-in-out;transition:transform .5s ease-in-out}.ab-feed.ab-effect-slide.ab-show{-webkit-transform:translateX(0);-moz-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}.ab-feed.ab-effect-slide.ab-hide{-webkit-transform:translateX(450px);-moz-transform:translateX(450px);-ms-transform:translateX(450px);transform:translateX(450px)}.ab-feed .ab-card{position:relative;-webkit-box-shadow:0 2px 3px 0 rgba(178,178,178,.5);-moz-box-shadow:0 2px 3px 0 rgba(178,178,178,.5);box-shadow:0 2px 3px 0 rgba(178,178,178,.5);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;width:100%;border:1px solid #d0d0d0;margin-bottom:20px;overflow:hidden;background-color:#fff;-webkit-transition:height .4s ease-in-out,margin .4s ease-in-out;-moz-transition:height .4s ease-in-out,margin .4s ease-in-out;-o-transition:height .4s ease-in-out,margin .4s ease-in-out;transition:height .4s ease-in-out,margin .4s ease-in-out}.ab-feed .ab-card .ab-pinned-indicator{position:absolute;right:0;top:0;margin-right:-1px;width:0;height:0;border-style:solid;border-width:0 24px 24px 0;border-color:transparent #1676d0 transparent transparent}.ab-feed .ab-card .ab-pinned-indicator .fa-star{position:absolute;right:-21px;top:2px;font-size:9px;color:#fff}.ab-feed .ab-card.ab-effect-card.ab-hide{-webkit-transition:all .5s ease-in-out;-moz-transition:all .5s ease-in-out;-o-transition:all .5s ease-in-out;transition:all .5s ease-in-out}.ab-feed .ab-card.ab-effect-card.ab-hide.ab-swiped-left{-webkit-transform:translateX(-450px);-moz-transform:translateX(-450px);-ms-transform:translateX(-450px);transform:translateX(-450px)}.ab-feed .ab-card.ab-effect-card.ab-hide.ab-swiped-right{-webkit-transform:translateX(450px);-moz-transform:translateX(450px);-ms-transform:translateX(450px);transform:translateX(450px)}.ab-feed .ab-card.ab-effect-card.ab-hide:not(.ab-swiped-left):not(.ab-swiped-right){opacity:0}.ab-feed .ab-card .ab-close-button{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;background-color:transparent;background-size:15px;border:none;width:15px;min-width:15px;height:15px;cursor:pointer;display:block;font-size:15px;line-height:0;padding-top:15px;padding-right:15px;padding-left:15px;padding-bottom:15px;position:absolute;top:0;z-index:9021;opacity:0;-webkit-transition:.5s;-moz-transition:.5s;-o-transition:.5s;transition:.5s}.ab-feed .ab-card .ab-close-button[dir=rtl]{left:0}.ab-feed .ab-card .ab-close-button[dir=ltr]{right:0}.ab-feed .ab-card .ab-close-button svg{-webkit-transition:.2s ease;-moz-transition:.2s ease;-o-transition:.2s ease;transition:.2s ease;fill:#9b9b9b;height:auto;width:100%}.ab-feed .ab-card .ab-close-button svg.ab-chevron{display:none}.ab-feed .ab-card .ab-close-button:active{background-color:transparent}.ab-feed .ab-card .ab-close-button:focus{background-color:transparent}.ab-feed .ab-card .ab-close-button:hover{background-color:transparent}.ab-feed .ab-card .ab-close-button:hover svg{fill-opacity:.8}.ab-feed .ab-card .ab-close-button:hover{opacity:1}.ab-feed .ab-card .ab-close-button:focus{opacity:1}.ab-feed .ab-card a{float:none;color:inherit;text-decoration:none}.ab-feed .ab-card a:hover{text-decoration:underline}.ab-feed .ab-card .ab-image-area{float:none;display:inline-block;vertical-align:top;line-height:0;overflow:hidden;width:100%;-webkit-box-sizing:initial;-moz-box-sizing:initial;box-sizing:initial}.ab-feed .ab-card .ab-image-area img{float:none;height:auto;width:100%}.ab-feed .ab-card.ab-image-only .ab-card-body{display:none}.ab-feed .ab-card .ab-card-body{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:inline-block;width:100%;position:relative}.ab-feed .ab-card .ab-unread-indicator{position:absolute;bottom:0;margin-right:-1px;width:100%;height:5px;background-color:#1676d0}.ab-feed .ab-card .ab-unread-indicator.read{background-color:transparent}.ab-feed .ab-card .ab-title{float:none;letter-spacing:0;margin:0;font-weight:700;font-family:'Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;display:block;overflow:hidden;word-wrap:break-word;text-overflow:ellipsis;font-size:18px;line-height:130%;padding:20px 25px 0 25px}.ab-feed .ab-card .ab-description{float:none;color:#545454;padding:15px 25px 20px 25px;word-wrap:break-word;white-space:pre-wrap}.ab-feed .ab-card .ab-description.ab-no-title{padding-top:20px}.ab-feed .ab-card .ab-url-area{float:none;color:#1676d0;margin-top:12px;font-family:'Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif}.ab-feed .ab-card.ab-classic-card .ab-card-body{min-height:40px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.ab-feed .ab-card.ab-classic-card.with-image .ab-card-body{min-height:100px}.ab-feed .ab-card.ab-classic-card.with-image .ab-card-body[dir=ltr]{padding-left:72px}.ab-feed .ab-card.ab-classic-card.with-image .ab-card-body[dir=rtl]{padding-right:72px}.ab-feed .ab-card.ab-classic-card.with-image .ab-image-area{width:60px;height:60px;padding:20px 0 25px 25px;position:absolute}.ab-feed .ab-card.ab-classic-card.with-image .ab-image-area[dir=rtl]{padding:20px 25px 25px 0}.ab-feed .ab-card.ab-classic-card.with-image .ab-image-area img{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;max-width:100%;max-height:100%;width:auto;height:auto}.ab-feed .ab-card.ab-classic-card.with-image .ab-title{background-color:transparent;font-size:16px}.ab-feed .ab-card.ab-classic-card.with-image .ab-description{padding-top:10px}.ab-feed .ab-card.ab-control-card{height:0;width:0;margin:0;border:0}.ab-feed .ab-feed-buttons-wrapper{float:none;position:relative;background-color:#282828;height:50px;-webkit-box-shadow:0 2px 3px 0 rgba(178,178,178,.5);-moz-box-shadow:0 2px 3px 0 rgba(178,178,178,.5);box-shadow:0 2px 3px 0 rgba(178,178,178,.5);z-index:1}.ab-feed .ab-feed-buttons-wrapper .ab-close-button,.ab-feed .ab-feed-buttons-wrapper .ab-refresh-button{float:none;cursor:pointer;color:#fff;font-size:18px;padding:16px;-webkit-transition:.2s;-moz-transition:.2s;-o-transition:.2s;transition:.2s}.ab-feed .ab-feed-buttons-wrapper .ab-close-button:hover,.ab-feed .ab-feed-buttons-wrapper .ab-refresh-button:hover{font-size:22px}.ab-feed .ab-feed-buttons-wrapper .ab-close-button{float:right}.ab-feed .ab-feed-buttons-wrapper .ab-close-button:hover{padding-top:12px;padding-right:14px}.ab-feed .ab-feed-buttons-wrapper .ab-refresh-button{padding-left:17px}.ab-feed .ab-feed-buttons-wrapper .ab-refresh-button:hover{padding-top:13px;padding-left:14px}.ab-feed .ab-no-cards-message{text-align:center;margin-bottom:20px}@media (max-width:600px){body>.ab-feed{width:100%}}",
|
|
8
8
|
);
|
|
9
9
|
}
|
|
10
10
|
export function setupFeedUI() {
|