moonshot-rails 0.0.8 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
@@ -171,131 +171,137 @@ function h(e, t) {
|
|
171
171
|
|
172
172
|
var f = {
|
173
173
|
DEBUG: !1,
|
174
|
-
LIB_VERSION: "1.
|
174
|
+
LIB_VERSION: "1.122.0"
|
175
175
|
}, p = Array.isArray, g = Object.prototype, v = g.hasOwnProperty, _ = g.toString, m = p || function(e) {
|
176
176
|
return "[object Array]" === _.call(e);
|
177
177
|
}, y = function(e) {
|
178
178
|
return "function" == typeof e;
|
179
179
|
}, b = function(e) {
|
180
180
|
return e === Object(e) && !m(e);
|
181
|
+
}, k = function(e) {
|
182
|
+
if (b(e)) {
|
183
|
+
for (var t in e) if (v.call(e, t)) return !1;
|
184
|
+
return !0;
|
185
|
+
}
|
186
|
+
return !1;
|
181
187
|
}, w = function(e) {
|
182
188
|
return void 0 === e;
|
183
|
-
}, k = function(e) {
|
184
|
-
return "[object String]" == _.call(e);
|
185
189
|
}, S = function(e) {
|
186
|
-
return
|
190
|
+
return "[object String]" == _.call(e);
|
187
191
|
}, F = function(e) {
|
188
|
-
return
|
192
|
+
return null === e;
|
189
193
|
}, R = function(e) {
|
194
|
+
return w(e) || F(e);
|
195
|
+
}, P = function(e) {
|
190
196
|
return "[object Number]" == _.call(e);
|
191
197
|
}, x = function(e) {
|
192
198
|
return "[object Boolean]" === _.call(e);
|
193
199
|
}, E = function(e) {
|
194
200
|
return e instanceof FormData;
|
195
|
-
},
|
201
|
+
}, I = "undefined" != typeof window ? window : void 0, C = "undefined" != typeof globalThis ? globalThis : I, $ = Array.prototype, T = $.forEach, q = $.indexOf, M = null == C ? void 0 : C.navigator, O = null == C ? void 0 : C.document, A = null == C ? void 0 : C.location, D = null == C ? void 0 : C.fetch, L = null != C && C.XMLHttpRequest && "withCredentials" in new C.XMLHttpRequest ? C.XMLHttpRequest : void 0, N = null == C ? void 0 : C.AbortController, B = null == M ? void 0 : M.userAgent, H = null != I ? I : {}, j = "[PostHog.js]", U = {
|
196
202
|
_log: function(e) {
|
197
|
-
if (
|
198
|
-
for (var t = ("__rrweb_original__" in
|
199
|
-
t.apply(void 0, [
|
203
|
+
if (I && (f.DEBUG || H.POSTHOG_DEBUG) && !w(I.console) && I.console) {
|
204
|
+
for (var t = ("__rrweb_original__" in I.console[e] ? I.console[e].__rrweb_original__ : I.console[e]), n = arguments.length, i = new Array(n > 1 ? n - 1 : 0), r = 1; r < n; r++) i[r - 1] = arguments[r];
|
205
|
+
t.apply(void 0, [ j ].concat(i));
|
200
206
|
}
|
201
207
|
},
|
202
208
|
info: function() {
|
203
209
|
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n];
|
204
|
-
|
210
|
+
U._log.apply(U, [ "log" ].concat(t));
|
205
211
|
},
|
206
212
|
warn: function() {
|
207
213
|
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n];
|
208
|
-
|
214
|
+
U._log.apply(U, [ "warn" ].concat(t));
|
209
215
|
},
|
210
216
|
error: function() {
|
211
217
|
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n];
|
212
|
-
|
218
|
+
U._log.apply(U, [ "error" ].concat(t));
|
213
219
|
},
|
214
220
|
critical: function() {
|
215
221
|
for (var e, t = arguments.length, n = new Array(t), i = 0; i < t; i++) n[i] = arguments[i];
|
216
|
-
(e = console).error.apply(e, [
|
222
|
+
(e = console).error.apply(e, [ j ].concat(n));
|
217
223
|
},
|
218
224
|
uninitializedWarning: function(e) {
|
219
|
-
|
225
|
+
U.error("You must initialize PostHog before calling ".concat(e));
|
220
226
|
}
|
221
|
-
},
|
227
|
+
}, W = {}, V = function(e) {
|
222
228
|
return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
223
229
|
};
|
224
230
|
|
225
|
-
function
|
226
|
-
if (m(e)) if (T && e.forEach === T) e.forEach(t, n); else if ("length" in e && e.length === +e.length) for (var i = 0, r = e.length; i < r; i++) if (i in e && t.call(n, e[i], i) ===
|
231
|
+
function z(e, t, n) {
|
232
|
+
if (m(e)) if (T && e.forEach === T) e.forEach(t, n); else if ("length" in e && e.length === +e.length) for (var i = 0, r = e.length; i < r; i++) if (i in e && t.call(n, e[i], i) === W) return;
|
227
233
|
}
|
228
234
|
|
229
|
-
function
|
230
|
-
if (!
|
231
|
-
if (m(e)) return
|
235
|
+
function G(e, t, n) {
|
236
|
+
if (!R(e)) {
|
237
|
+
if (m(e)) return z(e, t, n);
|
232
238
|
if (E(e)) {
|
233
239
|
var i, r = h(e.entries());
|
234
240
|
try {
|
235
241
|
for (r.s(); !(i = r.n()).done; ) {
|
236
242
|
var s = i.value;
|
237
|
-
if (t.call(n, s[1], s[0]) ===
|
243
|
+
if (t.call(n, s[1], s[0]) === W) return;
|
238
244
|
}
|
239
245
|
} catch (e) {
|
240
246
|
r.e(e);
|
241
247
|
} finally {
|
242
248
|
r.f();
|
243
249
|
}
|
244
|
-
} else for (var o in e) if (v.call(e, o) && t.call(n, e[o], o) ===
|
250
|
+
} else for (var o in e) if (v.call(e, o) && t.call(n, e[o], o) === W) return;
|
245
251
|
}
|
246
252
|
}
|
247
253
|
|
248
|
-
var
|
254
|
+
var Q = function(e) {
|
249
255
|
for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), i = 1; i < t; i++) n[i - 1] = arguments[i];
|
250
|
-
return
|
256
|
+
return z(n, (function(t) {
|
251
257
|
for (var n in t) void 0 !== t[n] && (e[n] = t[n]);
|
252
258
|
})), e;
|
253
259
|
};
|
254
260
|
|
255
|
-
function
|
261
|
+
function Y(e, t) {
|
256
262
|
return -1 !== e.indexOf(t);
|
257
263
|
}
|
258
264
|
|
259
|
-
function
|
265
|
+
function J(e) {
|
260
266
|
for (var t = Object.keys(e), n = t.length, i = new Array(n); n--; ) i[n] = [ t[n], e[t[n]] ];
|
261
267
|
return i;
|
262
268
|
}
|
263
269
|
|
264
|
-
var
|
270
|
+
var K = function() {
|
265
271
|
return Date.now = Date.now || function() {
|
266
272
|
return +new Date;
|
267
273
|
}, Date.now();
|
268
|
-
},
|
274
|
+
}, X = function(e) {
|
269
275
|
try {
|
270
276
|
return e();
|
271
277
|
} catch (e) {
|
272
278
|
return;
|
273
279
|
}
|
274
|
-
},
|
280
|
+
}, Z = function(e) {
|
275
281
|
return function() {
|
276
282
|
try {
|
277
283
|
for (var t = arguments.length, n = new Array(t), i = 0; i < t; i++) n[i] = arguments[i];
|
278
284
|
return e.apply(this, n);
|
279
285
|
} catch (e) {
|
280
|
-
|
281
|
-
|
286
|
+
U.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),
|
287
|
+
U.critical(e);
|
282
288
|
}
|
283
289
|
};
|
284
|
-
},
|
290
|
+
}, ee = function(e) {
|
285
291
|
var t = {};
|
286
|
-
return
|
287
|
-
|
292
|
+
return G(e, (function(e, n) {
|
293
|
+
S(e) && e.length > 0 && (t[n] = e);
|
288
294
|
})), t;
|
289
295
|
};
|
290
296
|
|
291
|
-
function
|
297
|
+
function te(e, t) {
|
292
298
|
return n = e, i = function(e) {
|
293
|
-
return
|
299
|
+
return S(e) && !F(t) ? e.slice(0, t) : e;
|
294
300
|
}, r = new Set, function e(t, n) {
|
295
301
|
return t !== Object(t) ? i ? i(t, n) : t : r.has(t) ? void 0 : (r.add(t), m(t) ? (s = [],
|
296
|
-
|
302
|
+
z(t, (function(t) {
|
297
303
|
s.push(e(t));
|
298
|
-
}))) : (s = {},
|
304
|
+
}))) : (s = {}, G(t, (function(t, n) {
|
299
305
|
r.has(t) || (s[n] = e(t, n));
|
300
306
|
}))), s);
|
301
307
|
var s;
|
@@ -303,16 +309,16 @@ function ee(e, t) {
|
|
303
309
|
var n, i, r;
|
304
310
|
}
|
305
311
|
|
306
|
-
var
|
312
|
+
var ne, ie = function(e) {
|
307
313
|
var t, n, i, r, s = "";
|
308
314
|
for (t = n = 0, i = (e = (e + "").replace(/\r\n/g, "\n").replace(/\r/g, "\n")).length,
|
309
315
|
r = 0; r < i; r++) {
|
310
316
|
var o = e.charCodeAt(r), a = null;
|
311
317
|
o < 128 ? n++ : a = o > 127 && o < 2048 ? String.fromCharCode(o >> 6 | 192, 63 & o | 128) : String.fromCharCode(o >> 12 | 224, o >> 6 & 63 | 128, 63 & o | 128),
|
312
|
-
|
318
|
+
F(a) || (n > t && (s += e.substring(t, n)), s += a, t = n = r + 1);
|
313
319
|
}
|
314
320
|
return n > t && (s += e.substring(t, e.length)), s;
|
315
|
-
},
|
321
|
+
}, re = function() {
|
316
322
|
function e(t) {
|
317
323
|
return t && (t.preventDefault = e.preventDefault, t.stopPropagation = e.stopPropagation),
|
318
324
|
t;
|
@@ -326,7 +332,7 @@ var te = function(e) {
|
|
326
332
|
var o = "on" + n, a = t[o];
|
327
333
|
t[o] = function(t, n, i) {
|
328
334
|
return function(r) {
|
329
|
-
if (r = r || e(null ==
|
335
|
+
if (r = r || e(null == I ? void 0 : I.event)) {
|
330
336
|
var s, o = !0;
|
331
337
|
y(i) && (s = i(r));
|
332
338
|
var a = n.call(t, r);
|
@@ -334,11 +340,11 @@ var te = function(e) {
|
|
334
340
|
}
|
335
341
|
};
|
336
342
|
}(t, i, a);
|
337
|
-
} else
|
343
|
+
} else U.error("No valid element provided to register_event");
|
338
344
|
};
|
339
345
|
}();
|
340
346
|
|
341
|
-
function
|
347
|
+
function se(e, t) {
|
342
348
|
var n = function() {
|
343
349
|
if (!O) return t("document not found");
|
344
350
|
var n = O.createElement("script");
|
@@ -353,468 +359,12 @@ function ie(e, t) {
|
|
353
359
|
null != O && O.body ? n() : null == O || O.addEventListener("DOMContentLoaded", n);
|
354
360
|
}
|
355
361
|
|
356
|
-
function re(e) {
|
357
|
-
return e ? V(e).split(/\s+/) : [];
|
358
|
-
}
|
359
|
-
|
360
|
-
function se(e) {
|
361
|
-
var t = "";
|
362
|
-
switch (n(e.className)) {
|
363
|
-
case "string":
|
364
|
-
t = e.className;
|
365
|
-
break;
|
366
|
-
|
367
|
-
case "object":
|
368
|
-
t = ("baseVal" in e.className ? e.className.baseVal : null) || e.getAttribute("class") || "";
|
369
|
-
break;
|
370
|
-
|
371
|
-
default:
|
372
|
-
t = "";
|
373
|
-
}
|
374
|
-
return re(t);
|
375
|
-
}
|
376
|
-
|
377
|
-
function oe(e) {
|
378
|
-
return F(e) ? null : V(e).split(/(\s+)/).filter((function(e) {
|
379
|
-
return Se(e);
|
380
|
-
})).join("").replace(/[\r\n]/g, " ").replace(/[ ]+/g, " ").substring(0, 255);
|
381
|
-
}
|
382
|
-
|
383
|
-
function ae(e) {
|
384
|
-
var t = "";
|
385
|
-
return ge(e) && !ve(e) && e.childNodes && e.childNodes.length && z(e.childNodes, (function(e) {
|
386
|
-
var n;
|
387
|
-
ce(e) && e.textContent && (t += null !== (n = oe(e.textContent)) && void 0 !== n ? n : "");
|
388
|
-
})), V(t);
|
389
|
-
}
|
390
|
-
|
391
|
-
function ue(e) {
|
392
|
-
return !!e && 1 === e.nodeType;
|
393
|
-
}
|
394
|
-
|
395
|
-
function le(e, t) {
|
396
|
-
return !!e && !!e.tagName && e.tagName.toLowerCase() === t.toLowerCase();
|
397
|
-
}
|
398
|
-
|
399
|
-
function ce(e) {
|
400
|
-
return !!e && 3 === e.nodeType;
|
401
|
-
}
|
402
|
-
|
403
|
-
function de(e) {
|
404
|
-
return !!e && 11 === e.nodeType;
|
405
|
-
}
|
406
|
-
|
407
|
-
var he = [ "a", "button", "form", "input", "select", "textarea", "label" ];
|
408
|
-
|
409
|
-
function fe(e) {
|
410
|
-
var t = e.parentNode;
|
411
|
-
return !(!t || !ue(t)) && t;
|
412
|
-
}
|
413
|
-
|
414
|
-
function pe(e, t) {
|
415
|
-
var i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : void 0, r = arguments.length > 3 ? arguments[3] : void 0, s = arguments.length > 4 ? arguments[4] : void 0;
|
416
|
-
if (!P || !e || le(e, "html") || !ue(e)) return !1;
|
417
|
-
if (null != i && i.url_allowlist) {
|
418
|
-
var o = P.location.href, a = i.url_allowlist;
|
419
|
-
if (a && !a.some((function(e) {
|
420
|
-
return o.match(e);
|
421
|
-
}))) return !1;
|
422
|
-
}
|
423
|
-
if (null != i && i.dom_event_allowlist) {
|
424
|
-
var u = i.dom_event_allowlist;
|
425
|
-
if (u && !u.some((function(e) {
|
426
|
-
return t.type === e;
|
427
|
-
}))) return !1;
|
428
|
-
}
|
429
|
-
for (var l = !1, c = [ e ], d = !0, f = e; f.parentNode && !le(f, "body"); ) if (de(f.parentNode)) c.push(f.parentNode.host),
|
430
|
-
f = f.parentNode.host; else {
|
431
|
-
if (!(d = fe(f))) break;
|
432
|
-
if (r || he.indexOf(d.tagName.toLowerCase()) > -1) l = !0; else {
|
433
|
-
var p = P.getComputedStyle(d);
|
434
|
-
p && "pointer" === p.getPropertyValue("cursor") && (l = !0);
|
435
|
-
}
|
436
|
-
c.push(d), f = d;
|
437
|
-
}
|
438
|
-
if (!function(e, t) {
|
439
|
-
var i = null == t ? void 0 : t.element_allowlist;
|
440
|
-
if (w(i)) return !0;
|
441
|
-
var r, s = h(e);
|
442
|
-
try {
|
443
|
-
var o = function() {
|
444
|
-
var e = r.value;
|
445
|
-
if (i.some((function(t) {
|
446
|
-
return e.tagName.toLowerCase() === t;
|
447
|
-
}))) return {
|
448
|
-
v: !0
|
449
|
-
};
|
450
|
-
};
|
451
|
-
for (s.s(); !(r = s.n()).done; ) {
|
452
|
-
var a = o();
|
453
|
-
if ("object" === n(a)) return a.v;
|
454
|
-
}
|
455
|
-
} catch (e) {
|
456
|
-
s.e(e);
|
457
|
-
} finally {
|
458
|
-
s.f();
|
459
|
-
}
|
460
|
-
return !1;
|
461
|
-
}(c, i)) return !1;
|
462
|
-
if (!function(e, t) {
|
463
|
-
var i = null == t ? void 0 : t.css_selector_allowlist;
|
464
|
-
if (w(i)) return !0;
|
465
|
-
var r, s = h(e);
|
466
|
-
try {
|
467
|
-
var o = function() {
|
468
|
-
var e = r.value;
|
469
|
-
if (i.some((function(t) {
|
470
|
-
return e.matches(t);
|
471
|
-
}))) return {
|
472
|
-
v: !0
|
473
|
-
};
|
474
|
-
};
|
475
|
-
for (s.s(); !(r = s.n()).done; ) {
|
476
|
-
var a = o();
|
477
|
-
if ("object" === n(a)) return a.v;
|
478
|
-
}
|
479
|
-
} catch (e) {
|
480
|
-
s.e(e);
|
481
|
-
} finally {
|
482
|
-
s.f();
|
483
|
-
}
|
484
|
-
return !1;
|
485
|
-
}(c, i)) return !1;
|
486
|
-
var g = P.getComputedStyle(e);
|
487
|
-
if (g && "pointer" === g.getPropertyValue("cursor") && "click" === t.type) return !0;
|
488
|
-
var v = e.tagName.toLowerCase();
|
489
|
-
switch (v) {
|
490
|
-
case "html":
|
491
|
-
return !1;
|
492
|
-
|
493
|
-
case "form":
|
494
|
-
return (s || [ "submit" ]).indexOf(t.type) >= 0;
|
495
|
-
|
496
|
-
case "input":
|
497
|
-
case "select":
|
498
|
-
case "textarea":
|
499
|
-
return (s || [ "change", "click" ]).indexOf(t.type) >= 0;
|
500
|
-
|
501
|
-
default:
|
502
|
-
return l ? (s || [ "click" ]).indexOf(t.type) >= 0 : (s || [ "click" ]).indexOf(t.type) >= 0 && (he.indexOf(v) > -1 || "true" === e.getAttribute("contenteditable"));
|
503
|
-
}
|
504
|
-
}
|
505
|
-
|
506
|
-
function ge(e) {
|
507
|
-
for (var t = e; t.parentNode && !le(t, "body"); t = t.parentNode) {
|
508
|
-
var n = se(t);
|
509
|
-
if (Q(n, "ph-sensitive") || Q(n, "ph-no-capture")) return !1;
|
510
|
-
}
|
511
|
-
if (Q(se(e), "ph-include")) return !0;
|
512
|
-
var i = e.type || "";
|
513
|
-
if (k(i)) switch (i.toLowerCase()) {
|
514
|
-
case "hidden":
|
515
|
-
case "password":
|
516
|
-
return !1;
|
517
|
-
}
|
518
|
-
var r = e.name || e.id || "";
|
519
|
-
if (k(r)) {
|
520
|
-
if (/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g, ""))) return !1;
|
521
|
-
}
|
522
|
-
return !0;
|
523
|
-
}
|
524
|
-
|
525
|
-
function ve(e) {
|
526
|
-
return !!(le(e, "input") && ![ "button", "checkbox", "submit", "reset" ].includes(e.type) || le(e, "select") || le(e, "textarea") || "true" === e.getAttribute("contenteditable"));
|
527
|
-
}
|
528
|
-
|
529
|
-
var _e = "(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})", me = new RegExp("^(?:".concat(_e, ")$")), ye = new RegExp(_e), be = "\\d{3}-?\\d{2}-?\\d{4}", we = new RegExp("^(".concat(be, ")$")), ke = new RegExp("(".concat(be, ")"));
|
530
|
-
|
531
|
-
function Se(e) {
|
532
|
-
var t = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1];
|
533
|
-
if (F(e)) return !1;
|
534
|
-
if (k(e)) {
|
535
|
-
if (e = V(e), (t ? me : ye).test((e || "").replace(/[- ]/g, ""))) return !1;
|
536
|
-
if ((t ? we : ke).test(e)) return !1;
|
537
|
-
}
|
538
|
-
return !0;
|
539
|
-
}
|
540
|
-
|
541
|
-
function Fe(e) {
|
542
|
-
var t = ae(e);
|
543
|
-
return Se(t = "".concat(t, " ").concat(Re(e)).trim()) ? t : "";
|
544
|
-
}
|
545
|
-
|
546
|
-
function Re(e) {
|
547
|
-
var t = "";
|
548
|
-
return e && e.childNodes && e.childNodes.length && z(e.childNodes, (function(e) {
|
549
|
-
var n;
|
550
|
-
if (e && "span" === (null === (n = e.tagName) || void 0 === n ? void 0 : n.toLowerCase())) try {
|
551
|
-
var i = ae(e);
|
552
|
-
t = "".concat(t, " ").concat(i).trim(), e.childNodes && e.childNodes.length && (t = "".concat(t, " ").concat(Re(e)).trim());
|
553
|
-
} catch (e) {
|
554
|
-
j.error(e);
|
555
|
-
}
|
556
|
-
})), t;
|
557
|
-
}
|
558
|
-
|
559
|
-
function xe(e) {
|
560
|
-
return function(e) {
|
561
|
-
var n = e.map((function(e) {
|
562
|
-
var n, i, r = "";
|
563
|
-
if (e.tag_name && (r += e.tag_name), e.attr_class) {
|
564
|
-
e.attr_class.sort();
|
565
|
-
var s, o = h(e.attr_class);
|
566
|
-
try {
|
567
|
-
for (o.s(); !(s = o.n()).done; ) {
|
568
|
-
var a = s.value;
|
569
|
-
r += ".".concat(a.replace(/"/g, ""));
|
570
|
-
}
|
571
|
-
} catch (e) {
|
572
|
-
o.e(e);
|
573
|
-
} finally {
|
574
|
-
o.f();
|
575
|
-
}
|
576
|
-
}
|
577
|
-
var l = t(t(t(t({}, e.text ? {
|
578
|
-
text: e.text
|
579
|
-
} : {}), {}, {
|
580
|
-
"nth-child": null !== (n = e.nth_child) && void 0 !== n ? n : 0,
|
581
|
-
"nth-of-type": null !== (i = e.nth_of_type) && void 0 !== i ? i : 0
|
582
|
-
}, e.href ? {
|
583
|
-
href: e.href
|
584
|
-
} : {}), e.attr_id ? {
|
585
|
-
attr_id: e.attr_id
|
586
|
-
} : {}), e.attributes), c = {};
|
587
|
-
return Y(l).sort((function(e, t) {
|
588
|
-
var n = u(e, 1)[0], i = u(t, 1)[0];
|
589
|
-
return n.localeCompare(i);
|
590
|
-
})).forEach((function(e) {
|
591
|
-
var t = u(e, 2), n = t[0], i = t[1];
|
592
|
-
return c[Ee(n.toString())] = Ee(i.toString());
|
593
|
-
})), r += ":", r += Y(l).map((function(e) {
|
594
|
-
var t = u(e, 2), n = t[0], i = t[1];
|
595
|
-
return "".concat(n, '="').concat(i, '"');
|
596
|
-
})).join("");
|
597
|
-
}));
|
598
|
-
return n.join(";");
|
599
|
-
}(function(e) {
|
600
|
-
return e.map((function(e) {
|
601
|
-
var t, n, i = {
|
602
|
-
text: null === (t = e.$el_text) || void 0 === t ? void 0 : t.slice(0, 400),
|
603
|
-
tag_name: e.tag_name,
|
604
|
-
href: null === (n = e.attr__href) || void 0 === n ? void 0 : n.slice(0, 2048),
|
605
|
-
attr_class: Pe(e),
|
606
|
-
attr_id: e.attr__id,
|
607
|
-
nth_child: e.nth_child,
|
608
|
-
nth_of_type: e.nth_of_type,
|
609
|
-
attributes: {}
|
610
|
-
};
|
611
|
-
return Y(e).filter((function(e) {
|
612
|
-
return 0 === u(e, 1)[0].indexOf("attr__");
|
613
|
-
})).forEach((function(e) {
|
614
|
-
var t = u(e, 2), n = t[0], r = t[1];
|
615
|
-
return i.attributes[n] = r;
|
616
|
-
})), i;
|
617
|
-
}));
|
618
|
-
}(e));
|
619
|
-
}
|
620
|
-
|
621
|
-
function Ee(e) {
|
622
|
-
return e.replace(/"|\\"/g, '\\"');
|
623
|
-
}
|
624
|
-
|
625
|
-
function Pe(e) {
|
626
|
-
var t = e.attr__class;
|
627
|
-
return t ? m(t) ? t : re(t) : void 0;
|
628
|
-
}
|
629
|
-
|
630
|
-
var Ie = function() {
|
631
|
-
function e(t) {
|
632
|
-
i(this, e), this.clicks = [], this.enabled = t;
|
633
|
-
}
|
634
|
-
return s(e, [ {
|
635
|
-
key: "isRageClick",
|
636
|
-
value: function(e, t, n) {
|
637
|
-
if (!this.enabled) return !1;
|
638
|
-
var i = this.clicks[this.clicks.length - 1];
|
639
|
-
if (i && Math.abs(e - i.x) + Math.abs(t - i.y) < 30 && n - i.timestamp < 1e3) {
|
640
|
-
if (this.clicks.push({
|
641
|
-
x: e,
|
642
|
-
y: t,
|
643
|
-
timestamp: n
|
644
|
-
}), 3 === this.clicks.length) return !0;
|
645
|
-
} else this.clicks = [ {
|
646
|
-
x: e,
|
647
|
-
y: t,
|
648
|
-
timestamp: n
|
649
|
-
} ];
|
650
|
-
return !1;
|
651
|
-
}
|
652
|
-
} ]), e;
|
653
|
-
}(), Ce = "$people_distinct_id", Te = "__alias", $e = "__timers", Ae = "$autocapture_disabled_server_side", Oe = "$session_recording_enabled_server_side", Me = "$console_log_recording_enabled_server_side", qe = "$session_recording_network_payload_capture", De = "$session_recording_canvas_recording", Le = "$sesid", Ne = "$session_is_sampled", Be = "$enabled_feature_flags", He = "$early_access_features", je = "$stored_person_properties", Ue = "$stored_group_properties", Ve = "$surveys", We = "$flag_call_reported", ze = "$user_state", Ge = "$posthog_quota_limited", Qe = "$client_session_props", Ye = [ Ce, Te, "__cmpns", $e, Oe, Le, Be, ze, Ge, He, Ue, je, Ve, We, Qe ], Je = "$copy_autocapture";
|
654
|
-
|
655
|
-
function Ke(e, t) {
|
656
|
-
return t.length > e ? t.slice(0, e) + "..." : t;
|
657
|
-
}
|
658
|
-
|
659
|
-
var Xe, Ze = {
|
660
|
-
_initializedTokens: [],
|
661
|
-
_isDisabledServerSide: null,
|
662
|
-
_isAutocaptureEnabled: !1,
|
663
|
-
_setIsAutocaptureEnabled: function(e) {
|
664
|
-
var t, n = S(this._isDisabledServerSide) ? !(null === (t = e.persistence) || void 0 === t || !t.props[Ae]) : this._isDisabledServerSide, i = !!e.config.autocapture;
|
665
|
-
this._isAutocaptureEnabled = i && !n;
|
666
|
-
},
|
667
|
-
_previousElementSibling: function(e) {
|
668
|
-
if (e.previousElementSibling) return e.previousElementSibling;
|
669
|
-
var t = e;
|
670
|
-
do {
|
671
|
-
t = t.previousSibling;
|
672
|
-
} while (t && !ue(t));
|
673
|
-
return t;
|
674
|
-
},
|
675
|
-
_getAugmentPropertiesFromElement: function(e) {
|
676
|
-
if (!ge(e)) return {};
|
677
|
-
var t = {};
|
678
|
-
return z(e.attributes, (function(e) {
|
679
|
-
if (0 === e.name.indexOf("data-ph-capture-attribute")) {
|
680
|
-
var n = e.name.replace("data-ph-capture-attribute-", ""), i = e.value;
|
681
|
-
n && i && Se(i) && (t[n] = i);
|
682
|
-
}
|
683
|
-
})), t;
|
684
|
-
},
|
685
|
-
_getPropertiesFromElement: function(e, t, n) {
|
686
|
-
var i, r = e.tagName.toLowerCase(), s = {
|
687
|
-
tag_name: r
|
688
|
-
};
|
689
|
-
he.indexOf(r) > -1 && !n && ("a" === r.toLowerCase() || "button" === r.toLowerCase() ? s.$el_text = Ke(1024, Fe(e)) : s.$el_text = Ke(1024, ae(e)));
|
690
|
-
var o = se(e);
|
691
|
-
o.length > 0 && (s.classes = o.filter((function(e) {
|
692
|
-
return "" !== e;
|
693
|
-
})));
|
694
|
-
var a = null === (i = this.config) || void 0 === i ? void 0 : i.element_attribute_ignorelist;
|
695
|
-
z(e.attributes, (function(n) {
|
696
|
-
var i;
|
697
|
-
if ((!ve(e) || -1 !== [ "name", "id", "class" ].indexOf(n.name)) && ((null == a || !a.includes(n.name)) && !t && Se(n.value) && (i = n.name,
|
698
|
-
!k(i) || "_ngcontent" !== i.substring(0, 10) && "_nghost" !== i.substring(0, 7)))) {
|
699
|
-
var r = n.value;
|
700
|
-
"class" === n.name && (r = re(r).join(" ")), s["attr__" + n.name] = Ke(1024, r);
|
701
|
-
}
|
702
|
-
}));
|
703
|
-
for (var u = 1, l = 1, c = e; c = this._previousElementSibling(c); ) u++, c.tagName === e.tagName && l++;
|
704
|
-
return s.nth_child = u, s.nth_of_type = l, s;
|
705
|
-
},
|
706
|
-
_getDefaultProperties: function(e) {
|
707
|
-
return {
|
708
|
-
$event_type: e,
|
709
|
-
$ce_version: 1
|
710
|
-
};
|
711
|
-
},
|
712
|
-
_extractCustomPropertyValue: function(e) {
|
713
|
-
var t = [];
|
714
|
-
return z(null == O ? void 0 : O.querySelectorAll(e.css_selector), (function(e) {
|
715
|
-
var n;
|
716
|
-
[ "input", "select" ].indexOf(e.tagName.toLowerCase()) > -1 ? n = e.value : e.textContent && (n = e.textContent),
|
717
|
-
Se(n) && t.push(n);
|
718
|
-
})), t.join(", ");
|
719
|
-
},
|
720
|
-
_getCustomProperties: function(e) {
|
721
|
-
var t = this, n = {};
|
722
|
-
return z(this._customProperties, (function(i) {
|
723
|
-
z(i.event_selectors, (function(r) {
|
724
|
-
z(null == O ? void 0 : O.querySelectorAll(r), (function(r) {
|
725
|
-
Q(e, r) && ge(r) && (n[i.name] = t._extractCustomPropertyValue(i));
|
726
|
-
}));
|
727
|
-
}));
|
728
|
-
})), n;
|
729
|
-
},
|
730
|
-
_getEventTarget: function(e) {
|
731
|
-
return w(e.target) ? e.srcElement || null : null !== (t = e.target) && void 0 !== t && t.shadowRoot ? e.composedPath()[0] || null : e.target || null;
|
732
|
-
var t;
|
733
|
-
},
|
734
|
-
_captureEvent: function(e, t) {
|
735
|
-
var n, i = this, r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "$autocapture", s = arguments.length > 3 ? arguments[3] : void 0, o = this._getEventTarget(e);
|
736
|
-
(ce(o) && (o = o.parentNode || null), "$autocapture" === r && "click" === e.type && e instanceof MouseEvent) && (null !== (n = this.rageclicks) && void 0 !== n && n.isRageClick(e.clientX, e.clientY, (new Date).getTime()) && this._captureEvent(e, t, "$rageclick"));
|
737
|
-
var a = r === Je;
|
738
|
-
if (o && pe(o, e, this.config, a, a ? [ "copy", "cut" ] : void 0)) {
|
739
|
-
for (var u, l, c = [ o ], d = o; d.parentNode && !le(d, "body"); ) de(d.parentNode) ? (c.push(d.parentNode.host),
|
740
|
-
d = d.parentNode.host) : (c.push(d.parentNode), d = d.parentNode);
|
741
|
-
var h, f = [], p = {}, g = !1;
|
742
|
-
if (z(c, (function(e) {
|
743
|
-
var n = ge(e);
|
744
|
-
"a" === e.tagName.toLowerCase() && (h = e.getAttribute("href"), h = n && Se(h) && h),
|
745
|
-
Q(se(e), "ph-no-capture") && (g = !0), f.push(i._getPropertiesFromElement(e, t.config.mask_all_element_attributes, t.config.mask_all_text));
|
746
|
-
var r = i._getAugmentPropertiesFromElement(e);
|
747
|
-
G(p, r);
|
748
|
-
})), t.config.mask_all_text || ("a" === o.tagName.toLowerCase() || "button" === o.tagName.toLowerCase() ? f[0].$el_text = Fe(o) : f[0].$el_text = ae(o)),
|
749
|
-
h && (f[0].attr__href = h), g) return !1;
|
750
|
-
var v = G(this._getDefaultProperties(e.type), t.elementsChainAsString ? {
|
751
|
-
$elements_chain: xe(f)
|
752
|
-
} : {
|
753
|
-
$elements: f
|
754
|
-
}, null !== (u = f[0]) && void 0 !== u && u.$el_text ? {
|
755
|
-
$el_text: null === (l = f[0]) || void 0 === l ? void 0 : l.$el_text
|
756
|
-
} : {}, this._getCustomProperties(c), p, s || {});
|
757
|
-
if (r === Je) {
|
758
|
-
var _, m = oe(null == P || null === (_ = P.getSelection()) || void 0 === _ ? void 0 : _.toString()), y = e.type || "clipboard";
|
759
|
-
if (!m) return !1;
|
760
|
-
v.$selected_content = m, v.$copy_type = y;
|
761
|
-
}
|
762
|
-
return t.capture(r, v), !0;
|
763
|
-
}
|
764
|
-
},
|
765
|
-
_navigate: function(e) {
|
766
|
-
P && (P.location.href = e);
|
767
|
-
},
|
768
|
-
_addDomEventHandlers: function(e) {
|
769
|
-
var t = this;
|
770
|
-
if (P && O) {
|
771
|
-
var n = function(n) {
|
772
|
-
n = n || (null == P ? void 0 : P.event), t._captureEvent(n, e);
|
773
|
-
}, i = function(n) {
|
774
|
-
n = n || (null == P ? void 0 : P.event), t._captureEvent(n, e, Je);
|
775
|
-
};
|
776
|
-
ne(O, "submit", n, !1, !0), ne(O, "change", n, !1, !0), ne(O, "click", n, !1, !0),
|
777
|
-
b(e.config.autocapture) && e.config.autocapture.capture_copied_text && (ne(O, "copy", i, !1, !0),
|
778
|
-
ne(O, "cut", i, !1, !0));
|
779
|
-
}
|
780
|
-
},
|
781
|
-
_customProperties: [],
|
782
|
-
rageclicks: null,
|
783
|
-
config: void 0,
|
784
|
-
init: function(e) {
|
785
|
-
var t;
|
786
|
-
x(e.__autocapture) || (this.config = e.__autocapture), null !== (t = this.config) && void 0 !== t && t.url_allowlist && (this.config.url_allowlist = this.config.url_allowlist.map((function(e) {
|
787
|
-
return new RegExp(e);
|
788
|
-
}))), this.rageclicks = new Ie(e.config.rageclick);
|
789
|
-
},
|
790
|
-
afterDecideResponse: function(e, t) {
|
791
|
-
var n = t.config.token;
|
792
|
-
this._initializedTokens.indexOf(n) > -1 ? j.info('autocapture already initialized for token "' + n + '"') : (t.persistence && t.persistence.register(o({}, Ae, !!e.autocapture_opt_out)),
|
793
|
-
this._isDisabledServerSide = !!e.autocapture_opt_out, this._setIsAutocaptureEnabled(t),
|
794
|
-
this._initializedTokens.push(n), e && e.config && e.config.enable_collect_everything && this._isAutocaptureEnabled ? (e.custom_properties && (this._customProperties = e.custom_properties),
|
795
|
-
this._addDomEventHandlers(t)) : t.__autocapture = !1);
|
796
|
-
},
|
797
|
-
enabledForProject: function(e, t, n) {
|
798
|
-
if (!e) return !0;
|
799
|
-
t = w(t) ? 10 : t, n = w(n) ? 10 : n;
|
800
|
-
for (var i = 0, r = 0; r < e.length; r++) i += e.charCodeAt(r);
|
801
|
-
return i % t < n;
|
802
|
-
},
|
803
|
-
isBrowserSupported: function() {
|
804
|
-
return y(null == O ? void 0 : O.querySelectorAll);
|
805
|
-
}
|
806
|
-
};
|
807
|
-
|
808
362
|
!function(e) {
|
809
|
-
for (var t in e) y(e[t]) && (e[t] = e[t].bind(e));
|
810
|
-
}(Ze), function(e) {
|
811
|
-
for (var t in e) y(e[t]) && (e[t] = X(e[t]));
|
812
|
-
}(Ze), function(e) {
|
813
363
|
e.GZipJS = "gzip-js", e.Base64 = "base64";
|
814
|
-
}(
|
364
|
+
}(ne || (ne = {}));
|
815
365
|
|
816
|
-
var
|
817
|
-
var t, n = {}, i = h(
|
366
|
+
var oe = "$people_distinct_id", ae = "__alias", ue = "__timers", le = "$autocapture_disabled_server_side", ce = "$session_recording_enabled_server_side", de = "$console_log_recording_enabled_server_side", he = "$session_recording_network_payload_capture", fe = "$session_recording_canvas_recording", pe = "$replay_sample_rate", ge = "$replay_minimum_duration", ve = "$sesid", _e = "$session_is_sampled", me = "$enabled_feature_flags", ye = "$early_access_features", be = "$stored_person_properties", ke = "$stored_group_properties", we = "$surveys", Se = "$flag_call_reported", Fe = "$user_state", Re = "$posthog_quota_limited", Pe = "$client_session_props", xe = "$initial_campaign_params", Ee = "$initial_referrer_info", Ie = "$epp", Ce = [ oe, ae, "__cmpns", ue, ce, ve, me, Fe, Re, ye, ke, be, we, Se, Pe, xe, Ee, Ie ], $e = "$active_feature_flags", Te = "$override_feature_flags", qe = "$feature_flag_payloads", Me = function(e) {
|
367
|
+
var t, n = {}, i = h(J(e || {}));
|
818
368
|
try {
|
819
369
|
for (i.s(); !(t = i.n()).done; ) {
|
820
370
|
var r = u(t.value, 2), s = r[0], o = r[1];
|
@@ -826,7 +376,7 @@ var et = "$active_feature_flags", tt = "$override_feature_flags", nt = "$feature
|
|
826
376
|
i.f();
|
827
377
|
}
|
828
378
|
return n;
|
829
|
-
},
|
379
|
+
}, Oe = function() {
|
830
380
|
function e(t) {
|
831
381
|
i(this, e), this.instance = t, this._override_warning = !1, this.featureFlagEventHandlers = [],
|
832
382
|
this.reloadFeatureFlagsQueued = !1, this.reloadFeatureFlagsInAction = !1;
|
@@ -839,10 +389,10 @@ var et = "$active_feature_flags", tt = "$override_feature_flags", nt = "$feature
|
|
839
389
|
}, {
|
840
390
|
key: "getFlagVariants",
|
841
391
|
value: function() {
|
842
|
-
var e = this.instance.get_property(
|
392
|
+
var e = this.instance.get_property(me), t = this.instance.get_property(Te);
|
843
393
|
if (!t) return e || {};
|
844
|
-
for (var n =
|
845
|
-
return this._override_warning || (
|
394
|
+
for (var n = Q({}, e), i = Object.keys(t), r = 0; r < i.length; r++) n[i[r]] = t[i[r]];
|
395
|
+
return this._override_warning || (U.warn(" Overriding feature flags!", {
|
846
396
|
enabledFlags: e,
|
847
397
|
overriddenFlags: t,
|
848
398
|
finalFlags: n
|
@@ -851,7 +401,7 @@ var et = "$active_feature_flags", tt = "$override_feature_flags", nt = "$feature
|
|
851
401
|
}, {
|
852
402
|
key: "getFlagPayloads",
|
853
403
|
value: function() {
|
854
|
-
return this.instance.get_property(
|
404
|
+
return this.instance.get_property(qe) || {};
|
855
405
|
}
|
856
406
|
}, {
|
857
407
|
key: "reloadFeatureFlags",
|
@@ -888,7 +438,7 @@ var et = "$active_feature_flags", tt = "$override_feature_flags", nt = "$feature
|
|
888
438
|
var e = this;
|
889
439
|
if (!this.instance.config.advanced_disable_feature_flags) {
|
890
440
|
this.setReloadingPaused(!0);
|
891
|
-
var t = this.instance.config.token, n = this.instance.get_property(
|
441
|
+
var t = this.instance.config.token, n = this.instance.get_property(be), i = this.instance.get_property(ke), r = {
|
892
442
|
token: t,
|
893
443
|
distinct_id: this.instance.get_distinct_id(),
|
894
444
|
groups: this.instance.getGroups(),
|
@@ -901,7 +451,7 @@ var et = "$active_feature_flags", tt = "$override_feature_flags", nt = "$feature
|
|
901
451
|
method: "POST",
|
902
452
|
url: this.instance.requestRouter.endpointFor("api", "/decide/?v=3"),
|
903
453
|
data: r,
|
904
|
-
compression:
|
454
|
+
compression: this.instance.config.disable_compression ? void 0 : ne.Base64,
|
905
455
|
timeout: this.instance.config.feature_flag_request_timeout_ms,
|
906
456
|
callback: function(t) {
|
907
457
|
var n;
|
@@ -918,16 +468,16 @@ var et = "$active_feature_flags", tt = "$override_feature_flags", nt = "$feature
|
|
918
468
|
value: function(e) {
|
919
469
|
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
|
920
470
|
if (this.instance.decideEndpointWasHit || this.getFlags() && this.getFlags().length > 0) {
|
921
|
-
var n, i = this.getFlagVariants()[e], r = "".concat(i), s = this.instance.get_property(
|
471
|
+
var n, i = this.getFlagVariants()[e], r = "".concat(i), s = this.instance.get_property(Se) || {};
|
922
472
|
if (t.send_event || !("send_event" in t)) if (!(e in s) || !s[e].includes(r)) m(s[e]) ? s[e].push(r) : s[e] = [ r ],
|
923
|
-
null === (n = this.instance.persistence) || void 0 === n || n.register(o({},
|
473
|
+
null === (n = this.instance.persistence) || void 0 === n || n.register(o({}, Se, s)),
|
924
474
|
this.instance.capture("$feature_flag_called", {
|
925
475
|
$feature_flag: e,
|
926
476
|
$feature_flag_response: i
|
927
477
|
});
|
928
478
|
return i;
|
929
479
|
}
|
930
|
-
|
480
|
+
U.warn('getFeatureFlag for key "' + e + "\" failed. Feature flags didn't load in time.");
|
931
481
|
}
|
932
482
|
}, {
|
933
483
|
key: "getFeatureFlagPayload",
|
@@ -939,7 +489,7 @@ var et = "$active_feature_flags", tt = "$override_feature_flags", nt = "$feature
|
|
939
489
|
value: function(e) {
|
940
490
|
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
|
941
491
|
if (this.instance.decideEndpointWasHit || this.getFlags() && this.getFlags().length > 0) return !!this.getFeatureFlag(e, t);
|
942
|
-
|
492
|
+
U.warn('isFeatureEnabled for key "' + e + "\" failed. Feature flags didn't load in time.");
|
943
493
|
}
|
944
494
|
}, {
|
945
495
|
key: "addFeatureFlagsHandler",
|
@@ -964,11 +514,11 @@ var et = "$active_feature_flags", tt = "$override_feature_flags", nt = "$feature
|
|
964
514
|
if (a) if (m(a)) {
|
965
515
|
var l, c = {};
|
966
516
|
if (a) for (var d = 0; d < a.length; d++) c[a[d]] = !0;
|
967
|
-
n && n.register((o(l = {},
|
517
|
+
n && n.register((o(l = {}, $e, a), o(l, me, c), l));
|
968
518
|
} else {
|
969
519
|
var h = a, f = u;
|
970
|
-
e.errorsWhileComputingFlags && (h = t(t({}, r), h), f = t(t({}, s), f)), n && n.register((o(i = {},
|
971
|
-
o(i,
|
520
|
+
e.errorsWhileComputingFlags && (h = t(t({}, r), h), f = t(t({}, s), f)), n && n.register((o(i = {}, $e, Object.keys(Me(h))),
|
521
|
+
o(i, me, h || {}), o(i, qe, f || {}), i));
|
972
522
|
}
|
973
523
|
}(e, this.instance.persistence, i, r), this._fireFeatureFlagsCallbacks(n);
|
974
524
|
}
|
@@ -976,11 +526,11 @@ var et = "$active_feature_flags", tt = "$override_feature_flags", nt = "$feature
|
|
976
526
|
}, {
|
977
527
|
key: "override",
|
978
528
|
value: function(e) {
|
979
|
-
if (!this.instance.__loaded || !this.instance.persistence) return
|
980
|
-
if (this._override_warning = !1, !1 === e) this.instance.persistence.unregister(
|
529
|
+
if (!this.instance.__loaded || !this.instance.persistence) return U.uninitializedWarning("posthog.feature_flags.override");
|
530
|
+
if (this._override_warning = !1, !1 === e) this.instance.persistence.unregister(Te); else if (m(e)) {
|
981
531
|
for (var t = {}, n = 0; n < e.length; n++) t[e[n]] = !0;
|
982
|
-
this.instance.persistence.register(o({},
|
983
|
-
} else this.instance.persistence.register(o({},
|
532
|
+
this.instance.persistence.register(o({}, Te, t));
|
533
|
+
} else this.instance.persistence.register(o({}, Te, e));
|
984
534
|
}
|
985
535
|
}, {
|
986
536
|
key: "onFeatureFlags",
|
@@ -1004,13 +554,13 @@ var et = "$active_feature_flags", tt = "$override_feature_flags", nt = "$feature
|
|
1004
554
|
$set: s
|
1005
555
|
}), this.setPersonPropertiesForFlags(s, !1);
|
1006
556
|
var a = t(t({}, this.getFlagVariants()), {}, o({}, e, n));
|
1007
|
-
null === (i = this.instance.persistence) || void 0 === i || i.register((o(r = {},
|
1008
|
-
o(r,
|
557
|
+
null === (i = this.instance.persistence) || void 0 === i || i.register((o(r = {}, $e, Object.keys(Me(a))),
|
558
|
+
o(r, me, a), r)), this._fireFeatureFlagsCallbacks();
|
1009
559
|
}
|
1010
560
|
}, {
|
1011
561
|
key: "getEarlyAccessFeatures",
|
1012
562
|
value: function(e) {
|
1013
|
-
var t = this, n = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], i = this.instance.get_property(
|
563
|
+
var t = this, n = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], i = this.instance.get_property(ye);
|
1014
564
|
if (i && !n) return e(i);
|
1015
565
|
this.instance._send_request({
|
1016
566
|
transport: "XHR",
|
@@ -1020,7 +570,7 @@ var et = "$active_feature_flags", tt = "$override_feature_flags", nt = "$feature
|
|
1020
570
|
var i;
|
1021
571
|
if (n.json) {
|
1022
572
|
var r = n.json.earlyAccessFeatures;
|
1023
|
-
return null === (i = t.instance.persistence) || void 0 === i || i.register(o({},
|
573
|
+
return null === (i = t.instance.persistence) || void 0 === i || i.register(o({}, ye, r)),
|
1024
574
|
e(r);
|
1025
575
|
}
|
1026
576
|
}
|
@@ -1054,29 +604,29 @@ var et = "$active_feature_flags", tt = "$override_feature_flags", nt = "$feature
|
|
1054
604
|
}, {
|
1055
605
|
key: "setPersonPropertiesForFlags",
|
1056
606
|
value: function(e) {
|
1057
|
-
var n = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1], i = this.instance.get_property(
|
1058
|
-
this.instance.register(o({},
|
607
|
+
var n = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1], i = this.instance.get_property(be) || {};
|
608
|
+
this.instance.register(o({}, be, t(t({}, i), e))), n && this.instance.reloadFeatureFlags();
|
1059
609
|
}
|
1060
610
|
}, {
|
1061
611
|
key: "resetPersonPropertiesForFlags",
|
1062
612
|
value: function() {
|
1063
|
-
this.instance.unregister(
|
613
|
+
this.instance.unregister(be);
|
1064
614
|
}
|
1065
615
|
}, {
|
1066
616
|
key: "setGroupPropertiesForFlags",
|
1067
617
|
value: function(e) {
|
1068
|
-
var n = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1], i = this.instance.get_property(
|
618
|
+
var n = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1], i = this.instance.get_property(ke) || {};
|
1069
619
|
0 !== Object.keys(i).length && Object.keys(i).forEach((function(n) {
|
1070
620
|
i[n] = t(t({}, i[n]), e[n]), delete e[n];
|
1071
|
-
})), this.instance.register(o({},
|
621
|
+
})), this.instance.register(o({}, ke, t(t({}, i), e))), n && this.instance.reloadFeatureFlags();
|
1072
622
|
}
|
1073
623
|
}, {
|
1074
624
|
key: "resetGroupPropertiesForFlags",
|
1075
625
|
value: function(e) {
|
1076
626
|
if (e) {
|
1077
|
-
var n = this.instance.get_property(
|
1078
|
-
this.instance.register(o({},
|
1079
|
-
} else this.instance.unregister(
|
627
|
+
var n = this.instance.get_property(ke) || {};
|
628
|
+
this.instance.register(o({}, ke, t(t({}, n), {}, o({}, e, {}))));
|
629
|
+
} else this.instance.unregister(ke);
|
1080
630
|
}
|
1081
631
|
} ]), e;
|
1082
632
|
}();
|
@@ -1084,17 +634,17 @@ var et = "$active_feature_flags", tt = "$override_feature_flags", nt = "$feature
|
|
1084
634
|
Math.trunc || (Math.trunc = function(e) {
|
1085
635
|
return e < 0 ? Math.ceil(e) : Math.floor(e);
|
1086
636
|
}), Number.isInteger || (Number.isInteger = function(e) {
|
1087
|
-
return
|
637
|
+
return P(e) && isFinite(e) && Math.floor(e) === e;
|
1088
638
|
});
|
1089
639
|
|
1090
|
-
var
|
640
|
+
var Ae = "0123456789abcdef", De = function() {
|
1091
641
|
function e(t) {
|
1092
642
|
if (i(this, e), this.bytes = t, 16 !== t.length) throw new TypeError("not 128-bit length");
|
1093
643
|
}
|
1094
644
|
return s(e, [ {
|
1095
645
|
key: "toString",
|
1096
646
|
value: function() {
|
1097
|
-
for (var e = "", t = 0; t < this.bytes.length; t++) e = e +
|
647
|
+
for (var e = "", t = 0; t < this.bytes.length; t++) e = e + Ae.charAt(this.bytes[t] >>> 4) + Ae.charAt(15 & this.bytes[t]),
|
1098
648
|
3 !== t && 5 !== t && 7 !== t && 9 !== t || (e += "-");
|
1099
649
|
if (36 !== e.length) throw new Error("Invalid UUIDv7 was generated");
|
1100
650
|
return e;
|
@@ -1129,9 +679,9 @@ var st = "0123456789abcdef", ot = function() {
|
|
1129
679
|
s[13] = r >>> 16, s[14] = r >>> 8, s[15] = r, new e(s);
|
1130
680
|
}
|
1131
681
|
} ]), e;
|
1132
|
-
}(),
|
682
|
+
}(), Le = function() {
|
1133
683
|
function e() {
|
1134
|
-
i(this, e), o(this, "timestamp", 0), o(this, "counter", 0), o(this, "random", new
|
684
|
+
i(this, e), o(this, "timestamp", 0), o(this, "counter", 0), o(this, "random", new He);
|
1135
685
|
}
|
1136
686
|
return s(e, [ {
|
1137
687
|
key: "generate",
|
@@ -1153,7 +703,7 @@ var st = "0123456789abcdef", ot = function() {
|
|
1153
703
|
if (!(e + 1e4 > this.timestamp)) return;
|
1154
704
|
this.counter++, this.counter > 4398046511103 && (this.timestamp++, this.resetCounter());
|
1155
705
|
}
|
1156
|
-
return
|
706
|
+
return De.fromFieldsV7(this.timestamp, Math.trunc(this.counter / Math.pow(2, 30)), this.counter & Math.pow(2, 30) - 1, this.random.nextUint32());
|
1157
707
|
}
|
1158
708
|
}, {
|
1159
709
|
key: "resetCounter",
|
@@ -1161,66 +711,66 @@ var st = "0123456789abcdef", ot = function() {
|
|
1161
711
|
this.counter = 1024 * this.random.nextUint32() + (1023 & this.random.nextUint32());
|
1162
712
|
}
|
1163
713
|
} ]), e;
|
1164
|
-
}(),
|
714
|
+
}(), Ne = function(e) {
|
1165
715
|
if ("undefined" != typeof UUIDV7_DENY_WEAK_RNG && UUIDV7_DENY_WEAK_RNG) throw new Error("no cryptographically strong RNG available");
|
1166
716
|
for (var t = 0; t < e.length; t++) e[t] = 65536 * Math.trunc(65536 * Math.random()) + Math.trunc(65536 * Math.random());
|
1167
717
|
return e;
|
1168
718
|
};
|
1169
719
|
|
1170
|
-
|
720
|
+
I && !w(I.crypto) && crypto.getRandomValues && (Ne = function(e) {
|
1171
721
|
return crypto.getRandomValues(e);
|
1172
722
|
});
|
1173
723
|
|
1174
|
-
var
|
724
|
+
var Be, He = function() {
|
1175
725
|
function e() {
|
1176
726
|
i(this, e), o(this, "buffer", new Uint32Array(8)), o(this, "cursor", 1 / 0);
|
1177
727
|
}
|
1178
728
|
return s(e, [ {
|
1179
729
|
key: "nextUint32",
|
1180
730
|
value: function() {
|
1181
|
-
return this.cursor >= this.buffer.length && (
|
731
|
+
return this.cursor >= this.buffer.length && (Ne(this.buffer), this.cursor = 0),
|
1182
732
|
this.buffer[this.cursor++];
|
1183
733
|
}
|
1184
734
|
} ]), e;
|
1185
|
-
}(),
|
1186
|
-
return
|
1187
|
-
},
|
1188
|
-
return (
|
1189
|
-
},
|
735
|
+
}(), je = function() {
|
736
|
+
return Ue().toString();
|
737
|
+
}, Ue = function() {
|
738
|
+
return (Be || (Be = new Le)).generate();
|
739
|
+
}, We = "Thu, 01 Jan 1970 00:00:00 GMT", Ve = "";
|
1190
740
|
|
1191
|
-
var
|
741
|
+
var ze = /[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;
|
1192
742
|
|
1193
|
-
function
|
743
|
+
function Ge(e, t) {
|
1194
744
|
if (t) {
|
1195
745
|
var n = function(e) {
|
1196
746
|
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : O;
|
1197
|
-
if (
|
747
|
+
if (Ve) return Ve;
|
1198
748
|
if (!t) return "";
|
1199
749
|
if ([ "localhost", "127.0.0.1" ].includes(e)) return "";
|
1200
|
-
for (var n = e.split("."), i = Math.min(n.length, 8), r = "dmn_chk_" +
|
750
|
+
for (var n = e.split("."), i = Math.min(n.length, 8), r = "dmn_chk_" + je(), s = new RegExp("(^|;)\\s*" + r + "=1"); !Ve && i--; ) {
|
1201
751
|
var o = n.slice(i).join("."), a = r + "=1;domain=." + o;
|
1202
|
-
t.cookie = a, s.test(t.cookie) && (t.cookie = a + ";expires=" +
|
752
|
+
t.cookie = a, s.test(t.cookie) && (t.cookie = a + ";expires=" + We, Ve = o);
|
1203
753
|
}
|
1204
|
-
return
|
754
|
+
return Ve;
|
1205
755
|
}(e);
|
1206
756
|
if (!n) {
|
1207
757
|
var i = function(e) {
|
1208
|
-
var t = e.match(
|
758
|
+
var t = e.match(ze);
|
1209
759
|
return t ? t[0] : "";
|
1210
760
|
}(e);
|
1211
|
-
i !== n &&
|
761
|
+
i !== n && U.info("Warning: cookie subdomain discovery mismatch", i, n), n = i;
|
1212
762
|
}
|
1213
763
|
return n ? "; domain=." + n : "";
|
1214
764
|
}
|
1215
765
|
return "";
|
1216
766
|
}
|
1217
767
|
|
1218
|
-
var
|
768
|
+
var Qe, Ye = {
|
1219
769
|
is_supported: function() {
|
1220
770
|
return !!O;
|
1221
771
|
},
|
1222
772
|
error: function(e) {
|
1223
|
-
|
773
|
+
U.error("cookieStore error: " + e);
|
1224
774
|
},
|
1225
775
|
get: function(e) {
|
1226
776
|
if (O) {
|
@@ -1238,20 +788,20 @@ var _t, mt = {
|
|
1238
788
|
parse: function(e) {
|
1239
789
|
var t;
|
1240
790
|
try {
|
1241
|
-
t = JSON.parse(
|
791
|
+
t = JSON.parse(Ye.get(e)) || {};
|
1242
792
|
} catch (e) {}
|
1243
793
|
return t;
|
1244
794
|
},
|
1245
795
|
set: function(e, t, n, i, r) {
|
1246
796
|
if (O) try {
|
1247
|
-
var s = "", o = "", a =
|
797
|
+
var s = "", o = "", a = Ge(O.location.hostname, i);
|
1248
798
|
if (n) {
|
1249
799
|
var u = new Date;
|
1250
800
|
u.setTime(u.getTime() + 24 * n * 60 * 60 * 1e3), s = "; expires=" + u.toUTCString();
|
1251
801
|
}
|
1252
802
|
r && (o = "; secure");
|
1253
803
|
var l = e + "=" + encodeURIComponent(JSON.stringify(t)) + s + "; SameSite=Lax; path=/" + a + o;
|
1254
|
-
return l.length > 3686.4 &&
|
804
|
+
return l.length > 3686.4 && U.warn("cookieStore warning: large cookie, len=" + l.length),
|
1255
805
|
O.cookie = l, l;
|
1256
806
|
} catch (e) {
|
1257
807
|
return;
|
@@ -1259,150 +809,150 @@ var _t, mt = {
|
|
1259
809
|
},
|
1260
810
|
remove: function(e, t) {
|
1261
811
|
try {
|
1262
|
-
|
812
|
+
Ye.set(e, "", -1, t);
|
1263
813
|
} catch (e) {
|
1264
814
|
return;
|
1265
815
|
}
|
1266
816
|
}
|
1267
|
-
},
|
817
|
+
}, Je = null, Ke = {
|
1268
818
|
is_supported: function() {
|
1269
|
-
if (!
|
819
|
+
if (!F(Je)) return Je;
|
1270
820
|
var e = !0;
|
1271
|
-
if (w(
|
821
|
+
if (w(I)) e = !1; else try {
|
1272
822
|
var t = "__mplssupport__";
|
1273
|
-
|
823
|
+
Ke.set(t, "xyz"), '"xyz"' !== Ke.get(t) && (e = !1), Ke.remove(t);
|
1274
824
|
} catch (t) {
|
1275
825
|
e = !1;
|
1276
826
|
}
|
1277
|
-
return e ||
|
827
|
+
return e || U.error("localStorage unsupported; falling back to cookie store"), Je = e,
|
1278
828
|
e;
|
1279
829
|
},
|
1280
830
|
error: function(e) {
|
1281
|
-
|
831
|
+
U.error("localStorage error: " + e);
|
1282
832
|
},
|
1283
833
|
get: function(e) {
|
1284
834
|
try {
|
1285
|
-
return null ==
|
835
|
+
return null == I ? void 0 : I.localStorage.getItem(e);
|
1286
836
|
} catch (e) {
|
1287
|
-
|
837
|
+
Ke.error(e);
|
1288
838
|
}
|
1289
839
|
return null;
|
1290
840
|
},
|
1291
841
|
parse: function(e) {
|
1292
842
|
try {
|
1293
|
-
return JSON.parse(
|
843
|
+
return JSON.parse(Ke.get(e)) || {};
|
1294
844
|
} catch (e) {}
|
1295
845
|
return null;
|
1296
846
|
},
|
1297
847
|
set: function(e, t) {
|
1298
848
|
try {
|
1299
|
-
null ==
|
849
|
+
null == I || I.localStorage.setItem(e, JSON.stringify(t));
|
1300
850
|
} catch (e) {
|
1301
|
-
|
851
|
+
Ke.error(e);
|
1302
852
|
}
|
1303
853
|
},
|
1304
854
|
remove: function(e) {
|
1305
855
|
try {
|
1306
|
-
null ==
|
856
|
+
null == I || I.localStorage.removeItem(e);
|
1307
857
|
} catch (e) {
|
1308
|
-
|
858
|
+
Ke.error(e);
|
1309
859
|
}
|
1310
860
|
}
|
1311
|
-
},
|
861
|
+
}, Xe = [ "distinct_id", ve, _e, Ie ], Ze = t(t({}, Ke), {}, {
|
1312
862
|
parse: function(e) {
|
1313
863
|
try {
|
1314
864
|
var t = {};
|
1315
865
|
try {
|
1316
|
-
t =
|
866
|
+
t = Ye.parse(e) || {};
|
1317
867
|
} catch (e) {}
|
1318
|
-
var n =
|
1319
|
-
return
|
868
|
+
var n = Q(t, JSON.parse(Ke.get(e) || "{}"));
|
869
|
+
return Ke.set(e, n), n;
|
1320
870
|
} catch (e) {}
|
1321
871
|
return null;
|
1322
872
|
},
|
1323
873
|
set: function(e, t, n, i, r) {
|
1324
874
|
try {
|
1325
|
-
|
875
|
+
Ke.set(e, t);
|
1326
876
|
var s = {};
|
1327
|
-
|
877
|
+
Xe.forEach((function(e) {
|
1328
878
|
t[e] && (s[e] = t[e]);
|
1329
|
-
})), Object.keys(s).length &&
|
879
|
+
})), Object.keys(s).length && Ye.set(e, s, n, i, r);
|
1330
880
|
} catch (e) {
|
1331
|
-
|
881
|
+
Ke.error(e);
|
1332
882
|
}
|
1333
883
|
},
|
1334
884
|
remove: function(e, t) {
|
1335
885
|
try {
|
1336
|
-
null ==
|
886
|
+
null == I || I.localStorage.removeItem(e), Ye.remove(e, t);
|
1337
887
|
} catch (e) {
|
1338
|
-
|
888
|
+
Ke.error(e);
|
1339
889
|
}
|
1340
890
|
}
|
1341
|
-
}),
|
891
|
+
}), et = {}, tt = {
|
1342
892
|
is_supported: function() {
|
1343
893
|
return !0;
|
1344
894
|
},
|
1345
895
|
error: function(e) {
|
1346
|
-
|
896
|
+
U.error("memoryStorage error: " + e);
|
1347
897
|
},
|
1348
898
|
get: function(e) {
|
1349
|
-
return
|
899
|
+
return et[e] || null;
|
1350
900
|
},
|
1351
901
|
parse: function(e) {
|
1352
|
-
return
|
902
|
+
return et[e] || null;
|
1353
903
|
},
|
1354
904
|
set: function(e, t) {
|
1355
|
-
|
905
|
+
et[e] = t;
|
1356
906
|
},
|
1357
907
|
remove: function(e) {
|
1358
|
-
delete
|
908
|
+
delete et[e];
|
1359
909
|
}
|
1360
|
-
},
|
910
|
+
}, nt = null, it = {
|
1361
911
|
is_supported: function() {
|
1362
|
-
if (!
|
1363
|
-
if (
|
912
|
+
if (!F(nt)) return nt;
|
913
|
+
if (nt = !0, w(I)) nt = !1; else try {
|
1364
914
|
var e = "__support__";
|
1365
|
-
|
915
|
+
it.set(e, "xyz"), '"xyz"' !== it.get(e) && (nt = !1), it.remove(e);
|
1366
916
|
} catch (e) {
|
1367
|
-
|
917
|
+
nt = !1;
|
1368
918
|
}
|
1369
|
-
return
|
919
|
+
return nt;
|
1370
920
|
},
|
1371
921
|
error: function(e) {
|
1372
|
-
|
922
|
+
U.error("sessionStorage error: ", e);
|
1373
923
|
},
|
1374
924
|
get: function(e) {
|
1375
925
|
try {
|
1376
|
-
return null ==
|
926
|
+
return null == I ? void 0 : I.sessionStorage.getItem(e);
|
1377
927
|
} catch (e) {
|
1378
|
-
|
928
|
+
it.error(e);
|
1379
929
|
}
|
1380
930
|
return null;
|
1381
931
|
},
|
1382
932
|
parse: function(e) {
|
1383
933
|
try {
|
1384
|
-
return JSON.parse(
|
934
|
+
return JSON.parse(it.get(e)) || null;
|
1385
935
|
} catch (e) {}
|
1386
936
|
return null;
|
1387
937
|
},
|
1388
938
|
set: function(e, t) {
|
1389
939
|
try {
|
1390
|
-
null ==
|
940
|
+
null == I || I.sessionStorage.setItem(e, JSON.stringify(t));
|
1391
941
|
} catch (e) {
|
1392
|
-
|
942
|
+
it.error(e);
|
1393
943
|
}
|
1394
944
|
},
|
1395
945
|
remove: function(e) {
|
1396
946
|
try {
|
1397
|
-
null ==
|
947
|
+
null == I || I.sessionStorage.removeItem(e);
|
1398
948
|
} catch (e) {
|
1399
|
-
|
949
|
+
it.error(e);
|
1400
950
|
}
|
1401
951
|
}
|
1402
|
-
},
|
952
|
+
}, rt = [ "localhost", "127.0.0.1" ], st = function(e) {
|
1403
953
|
var t = null == O ? void 0 : O.createElement("a");
|
1404
954
|
return w(t) ? null : (t.href = e, t);
|
1405
|
-
},
|
955
|
+
}, ot = function(e, t) {
|
1406
956
|
return !!function(e) {
|
1407
957
|
try {
|
1408
958
|
new RegExp(e);
|
@@ -1411,14 +961,14 @@ var _t, mt = {
|
|
1411
961
|
}
|
1412
962
|
return !0;
|
1413
963
|
}(t) && new RegExp(t).test(e);
|
1414
|
-
},
|
964
|
+
}, at = function(e) {
|
1415
965
|
var t, n, i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "&", r = [];
|
1416
|
-
return
|
966
|
+
return G(e, (function(e, i) {
|
1417
967
|
w(e) || w(i) || "undefined" === i || (t = encodeURIComponent(function(e) {
|
1418
968
|
return e instanceof File;
|
1419
969
|
}(e) ? e.name : e.toString()), n = encodeURIComponent(i), r[r.length] = n + "=" + t);
|
1420
970
|
})), r.join(i);
|
1421
|
-
},
|
971
|
+
}, ut = function(e, t) {
|
1422
972
|
for (var n, i = ((e.split("#")[0] || "").split("?")[1] || "").split("&"), r = 0; r < i.length; r++) {
|
1423
973
|
var s = i[r].split("=");
|
1424
974
|
if (s[0] === t) {
|
@@ -1431,13 +981,13 @@ var _t, mt = {
|
|
1431
981
|
try {
|
1432
982
|
o = decodeURIComponent(o);
|
1433
983
|
} catch (e) {
|
1434
|
-
|
984
|
+
U.error("Skipping decoding for malformed query param: " + o);
|
1435
985
|
}
|
1436
986
|
return o.replace(/\+/g, " ");
|
1437
|
-
},
|
987
|
+
}, lt = function(e, t) {
|
1438
988
|
var n = e.match(new RegExp(t + "=([^&]*)"));
|
1439
989
|
return n ? n[1] : null;
|
1440
|
-
},
|
990
|
+
}, ct = "Mobile", dt = "iOS", ht = "Android", ft = "Tablet", pt = ht + " " + ft, gt = "iPad", vt = "Apple", _t = vt + " Watch", mt = "Safari", yt = "BlackBerry", bt = "Samsung", kt = bt + "Browser", wt = bt + " Internet", St = "Chrome", Ft = St + " OS", Rt = St + " " + dt, Pt = "Internet Explorer", xt = Pt + " " + ct, Et = "Opera", It = Et + " Mini", Ct = "Edge", $t = "Microsoft " + Ct, Tt = "Firefox", qt = Tt + " " + dt, Mt = "Nintendo", Ot = "PlayStation", At = "Xbox", Dt = ht + " " + ct, Lt = ct + " " + mt, Nt = "Windows", Bt = Nt + " Phone", Ht = "Nokia", jt = "Ouya", Ut = "Generic", Wt = Ut + " " + ct.toLowerCase(), Vt = Ut + " " + ft.toLowerCase(), zt = "Konqueror", Gt = "(\\d+(\\.\\d+)?)", Qt = new RegExp("Version/" + Gt), Yt = new RegExp(At, "i"), Jt = new RegExp(Ot + " \\w+", "i"), Kt = new RegExp(Mt + " \\w+", "i"), Xt = new RegExp(yt + "|PlayBook|BB10", "i"), Zt = {
|
1441
991
|
"NT3.51": "NT 3.11",
|
1442
992
|
"NT4.0": "NT 4.0",
|
1443
993
|
"5.0": "2000",
|
@@ -1451,45 +1001,45 @@ var _t, mt = {
|
|
1451
1001
|
"10.0": "10"
|
1452
1002
|
};
|
1453
1003
|
|
1454
|
-
var
|
1455
|
-
return t &&
|
1456
|
-
return
|
1004
|
+
var en = function(e, t) {
|
1005
|
+
return t && Y(t, vt) || function(e) {
|
1006
|
+
return Y(e, mt) && !Y(e, St) && !Y(e, ht);
|
1457
1007
|
}(e);
|
1458
|
-
},
|
1459
|
-
return t = t || "",
|
1460
|
-
},
|
1461
|
-
o(
|
1462
|
-
o(
|
1463
|
-
o(
|
1464
|
-
o(
|
1465
|
-
o(
|
1466
|
-
o(
|
1467
|
-
o(
|
1468
|
-
return [
|
1469
|
-
} ], [ new RegExp(
|
1470
|
-
if (/Phone/.test(t) || /WPDesktop/.test(t)) return [
|
1471
|
-
if (new RegExp(
|
1008
|
+
}, tn = function(e, t) {
|
1009
|
+
return t = t || "", Y(e, " OPR/") && Y(e, "Mini") ? It : Y(e, " OPR/") ? Et : Xt.test(e) ? yt : Y(e, "IE" + ct) || Y(e, "WPDesktop") ? xt : Y(e, kt) ? wt : Y(e, Ct) || Y(e, "Edg/") ? $t : Y(e, "FBIOS") ? "Facebook " + ct : Y(e, St) ? St : Y(e, "CriOS") ? Rt : Y(e, "UCWEB") || Y(e, "UCBrowser") ? "UC Browser" : Y(e, "FxiOS") ? qt : Y(e, ht) ? Dt : Y(e.toLowerCase(), zt.toLowerCase()) ? zt : en(e, t) ? Y(e, ct) ? Lt : mt : Y(e, Tt) ? Tt : Y(e, "MSIE") || Y(e, "Trident/") ? Pt : Y(e, "Gecko") ? Tt : "";
|
1010
|
+
}, nn = (o(Qe = {}, xt, [ new RegExp("rv:" + Gt) ]), o(Qe, $t, [ new RegExp(Ct + "?\\/" + Gt) ]),
|
1011
|
+
o(Qe, St, [ new RegExp(St + "/" + Gt) ]), o(Qe, Rt, [ new RegExp("CriOS\\/" + Gt) ]),
|
1012
|
+
o(Qe, "UC Browser", [ new RegExp("(UCBrowser|UCWEB)\\/" + Gt) ]), o(Qe, mt, [ Qt ]),
|
1013
|
+
o(Qe, Lt, [ Qt ]), o(Qe, Et, [ new RegExp("(Opera|OPR)\\/" + Gt) ]), o(Qe, Tt, [ new RegExp(Tt + "\\/" + Gt) ]),
|
1014
|
+
o(Qe, qt, [ new RegExp("FxiOS\\/" + Gt) ]), o(Qe, zt, [ new RegExp("Konqueror[:/]?" + Gt, "i") ]),
|
1015
|
+
o(Qe, yt, [ new RegExp(yt + " " + Gt), Qt ]), o(Qe, Dt, [ new RegExp("android\\s" + Gt) ]),
|
1016
|
+
o(Qe, wt, [ new RegExp(kt + "\\/" + Gt) ]), o(Qe, Pt, [ new RegExp("(rv:|MSIE )" + Gt) ]),
|
1017
|
+
o(Qe, "Mozilla", [ new RegExp("rv:" + Gt) ]), Qe), rn = [ [ new RegExp(At + "; " + At + " (.*?)[);]", "i"), function(e) {
|
1018
|
+
return [ At, e && e[1] || "" ];
|
1019
|
+
} ], [ new RegExp(Mt, "i"), [ Mt, "" ] ], [ new RegExp(Ot, "i"), [ Ot, "" ] ], [ Xt, [ yt, "" ] ], [ new RegExp(Nt, "i"), function(e, t) {
|
1020
|
+
if (/Phone/.test(t) || /WPDesktop/.test(t)) return [ Bt, "" ];
|
1021
|
+
if (new RegExp(ct).test(t) && !/IEMobile\b/.test(t)) return [ Nt + " " + ct, "" ];
|
1472
1022
|
var n = /Windows NT ([0-9.]+)/i.exec(t);
|
1473
1023
|
if (n && n[1]) {
|
1474
|
-
var i = n[1], r =
|
1475
|
-
return /arm/i.test(t) && (r = "RT"), [
|
1024
|
+
var i = n[1], r = Zt[i] || "";
|
1025
|
+
return /arm/i.test(t) && (r = "RT"), [ Nt, r ];
|
1476
1026
|
}
|
1477
|
-
return [
|
1027
|
+
return [ Nt, "" ];
|
1478
1028
|
} ], [ /((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/, function(e) {
|
1479
1029
|
if (e && e[3]) {
|
1480
1030
|
var t = [ e[3], e[4], e[5] || "0" ];
|
1481
|
-
return [
|
1031
|
+
return [ dt, t.join(".") ];
|
1482
1032
|
}
|
1483
|
-
return [
|
1033
|
+
return [ dt, "" ];
|
1484
1034
|
} ], [ /(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i, function(e) {
|
1485
1035
|
var t = "";
|
1486
1036
|
return e && e.length >= 3 && (t = w(e[2]) ? e[3] : e[2]), [ "watchOS", t ];
|
1487
|
-
} ], [ new RegExp("(" +
|
1037
|
+
} ], [ new RegExp("(" + ht + " (\\d+)\\.(\\d+)\\.?(\\d+)?|" + ht + ")", "i"), function(e) {
|
1488
1038
|
if (e && e[2]) {
|
1489
1039
|
var t = [ e[2], e[3], e[4] || "0" ];
|
1490
|
-
return [
|
1040
|
+
return [ ht, t.join(".") ];
|
1491
1041
|
}
|
1492
|
-
return [
|
1042
|
+
return [ ht, "" ];
|
1493
1043
|
} ], [ /Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i, function(e) {
|
1494
1044
|
var t = [ "Mac OS X", "" ];
|
1495
1045
|
if (e && e[1]) {
|
@@ -1497,32 +1047,32 @@ o(_t, "Mozilla", [ new RegExp("rv:" + _n) ]), _t), En = [ [ new RegExp(on + "; "
|
|
1497
1047
|
t[1] = n.join(".");
|
1498
1048
|
}
|
1499
1049
|
return t;
|
1500
|
-
} ], [ /Mac/i, [ "Mac OS X", "" ] ], [ /CrOS/, [
|
1501
|
-
return
|
1502
|
-
},
|
1050
|
+
} ], [ /Mac/i, [ "Mac OS X", "" ] ], [ /CrOS/, [ Ft, "" ] ], [ /Linux|debian/i, [ "Linux", "" ] ] ], sn = function(e) {
|
1051
|
+
return Kt.test(e) ? Mt : Jt.test(e) ? Ot : Yt.test(e) ? At : new RegExp(jt, "i").test(e) ? jt : new RegExp("(" + Bt + "|WPDesktop)", "i").test(e) ? Bt : /iPad/.test(e) ? gt : /iPod/.test(e) ? "iPod Touch" : /iPhone/.test(e) ? "iPhone" : /(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e) ? _t : Xt.test(e) ? yt : /(kobo)\s(ereader|touch)/i.test(e) ? "Kobo" : new RegExp(Ht, "i").test(e) ? Ht : /(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e) || /(kf[a-z]+)( bui|\)).+silk\//i.test(e) ? "Kindle Fire" : /(Android|ZTE)/i.test(e) ? !new RegExp(ct).test(e) || /(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e) ? /pixel[\daxl ]{1,6}/i.test(e) && !/pixel c/i.test(e) || /(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e) || /lmy47v/i.test(e) && !/QTAQZ3/i.test(e) ? ht : pt : ht : new RegExp("(pda|" + ct + ")", "i").test(e) ? Wt : new RegExp(ft, "i").test(e) && !new RegExp(ft + " pc", "i").test(e) ? Vt : "";
|
1052
|
+
}, on = "https?://(.*)", an = [ "utm_source", "utm_medium", "utm_campaign", "utm_content", "utm_term", "gclid", "gad_source", "gclsrc", "dclid", "gbraid", "wbraid", "fbclid", "msclkid", "twclid", "li_fat_id", "mc_cid", "igshid", "ttclid" ], un = {
|
1503
1053
|
campaignParams: function(e) {
|
1504
|
-
var t =
|
1505
|
-
return
|
1506
|
-
var t = O ?
|
1054
|
+
var t = an.concat(e || []), n = {};
|
1055
|
+
return G(t, (function(e) {
|
1056
|
+
var t = O ? ut(O.URL, e) : "";
|
1507
1057
|
t.length && (n[e] = t);
|
1508
1058
|
})), n;
|
1509
1059
|
},
|
1510
1060
|
searchEngine: function() {
|
1511
1061
|
var e = null == O ? void 0 : O.referrer;
|
1512
|
-
return e ? 0 === e.search(
|
1062
|
+
return e ? 0 === e.search(on + "google.([^/?]*)") ? "google" : 0 === e.search(on + "bing.com") ? "bing" : 0 === e.search(on + "yahoo.com") ? "yahoo" : 0 === e.search(on + "duckduckgo.com") ? "duckduckgo" : null : null;
|
1513
1063
|
},
|
1514
1064
|
searchInfo: function() {
|
1515
|
-
var e =
|
1516
|
-
if (!
|
1065
|
+
var e = un.searchEngine(), t = "yahoo" != e ? "q" : "p", n = {};
|
1066
|
+
if (!F(e)) {
|
1517
1067
|
n.$search_engine = e;
|
1518
|
-
var i = O ?
|
1068
|
+
var i = O ? ut(O.referrer, t) : "";
|
1519
1069
|
i.length && (n.ph_keyword = i);
|
1520
1070
|
}
|
1521
1071
|
return n;
|
1522
1072
|
},
|
1523
|
-
browser:
|
1073
|
+
browser: tn,
|
1524
1074
|
browserVersion: function(e, t) {
|
1525
|
-
var n =
|
1075
|
+
var n = tn(e, t), i = nn[n];
|
1526
1076
|
if (w(i)) return null;
|
1527
1077
|
for (var r = 0; r < i.length; r++) {
|
1528
1078
|
var s = i[r], o = e.match(s);
|
@@ -1534,62 +1084,68 @@ o(_t, "Mozilla", [ new RegExp("rv:" + _n) ]), _t), En = [ [ new RegExp(on + "; "
|
|
1534
1084
|
return navigator.language || navigator.userLanguage;
|
1535
1085
|
},
|
1536
1086
|
os: function(e) {
|
1537
|
-
for (var t = 0; t <
|
1538
|
-
var n = u(
|
1087
|
+
for (var t = 0; t < rn.length; t++) {
|
1088
|
+
var n = u(rn[t], 2), i = n[0], r = n[1], s = i.exec(e), o = s && (y(r) ? r(s, e) : r);
|
1539
1089
|
if (o) return o;
|
1540
1090
|
}
|
1541
1091
|
return [ "", "" ];
|
1542
1092
|
},
|
1543
|
-
device:
|
1093
|
+
device: sn,
|
1544
1094
|
deviceType: function(e) {
|
1545
|
-
var t =
|
1546
|
-
return t ===
|
1095
|
+
var t = sn(e);
|
1096
|
+
return t === gt || t === pt || "Kobo" === t || "Kindle Fire" === t || t === Vt ? ft : t === Mt || t === At || t === Ot || t === jt ? "Console" : t === _t ? "Wearable" : t ? ct : "Desktop";
|
1547
1097
|
},
|
1548
1098
|
referrer: function() {
|
1549
1099
|
return (null == O ? void 0 : O.referrer) || "$direct";
|
1550
1100
|
},
|
1551
1101
|
referringDomain: function() {
|
1552
1102
|
var e;
|
1553
|
-
return null != O && O.referrer && (null === (e =
|
1103
|
+
return null != O && O.referrer && (null === (e = st(O.referrer)) || void 0 === e ? void 0 : e.host) || "$direct";
|
1104
|
+
},
|
1105
|
+
referrerInfo: function() {
|
1106
|
+
return {
|
1107
|
+
$referrer: this.referrer(),
|
1108
|
+
$referring_domain: this.referringDomain()
|
1109
|
+
};
|
1554
1110
|
},
|
1555
1111
|
properties: function() {
|
1556
|
-
if (!
|
1557
|
-
var e = u(
|
1558
|
-
return
|
1112
|
+
if (!B) return {};
|
1113
|
+
var e = u(un.os(B), 2), t = e[0], n = e[1];
|
1114
|
+
return Q(ee({
|
1559
1115
|
$os: t,
|
1560
1116
|
$os_version: n,
|
1561
|
-
$browser:
|
1562
|
-
$device:
|
1563
|
-
$device_type:
|
1117
|
+
$browser: un.browser(B, navigator.vendor),
|
1118
|
+
$device: un.device(B),
|
1119
|
+
$device_type: un.deviceType(B)
|
1564
1120
|
}), {
|
1565
|
-
$current_url: null ==
|
1566
|
-
$host: null ==
|
1567
|
-
$pathname: null ==
|
1568
|
-
$raw_user_agent:
|
1569
|
-
$browser_version:
|
1570
|
-
$browser_language:
|
1571
|
-
$screen_height: null ==
|
1572
|
-
$screen_width: null ==
|
1573
|
-
$viewport_height: null ==
|
1574
|
-
$viewport_width: null ==
|
1121
|
+
$current_url: null == A ? void 0 : A.href,
|
1122
|
+
$host: null == A ? void 0 : A.host,
|
1123
|
+
$pathname: null == A ? void 0 : A.pathname,
|
1124
|
+
$raw_user_agent: B.length > 1e3 ? B.substring(0, 997) + "..." : B,
|
1125
|
+
$browser_version: un.browserVersion(B, navigator.vendor),
|
1126
|
+
$browser_language: un.browserLanguage(),
|
1127
|
+
$screen_height: null == I ? void 0 : I.screen.height,
|
1128
|
+
$screen_width: null == I ? void 0 : I.screen.width,
|
1129
|
+
$viewport_height: null == I ? void 0 : I.innerHeight,
|
1130
|
+
$viewport_width: null == I ? void 0 : I.innerWidth,
|
1575
1131
|
$lib: "web",
|
1576
1132
|
$lib_version: f.LIB_VERSION,
|
1577
1133
|
$insert_id: Math.random().toString(36).substring(2, 10) + Math.random().toString(36).substring(2, 10),
|
1578
|
-
$time:
|
1134
|
+
$time: K() / 1e3
|
1579
1135
|
});
|
1580
1136
|
},
|
1581
1137
|
people_properties: function() {
|
1582
|
-
if (!
|
1583
|
-
var e = u(
|
1584
|
-
return
|
1138
|
+
if (!B) return {};
|
1139
|
+
var e = u(un.os(B), 2), t = e[0], n = e[1];
|
1140
|
+
return Q(ee({
|
1585
1141
|
$os: t,
|
1586
1142
|
$os_version: n,
|
1587
|
-
$browser:
|
1143
|
+
$browser: un.browser(B, navigator.vendor)
|
1588
1144
|
}), {
|
1589
|
-
$browser_version:
|
1145
|
+
$browser_version: un.browserVersion(B, navigator.vendor)
|
1590
1146
|
});
|
1591
1147
|
}
|
1592
|
-
},
|
1148
|
+
}, ln = [ "cookie", "localstorage", "localstorage+cookie", "sessionstorage", "memory" ], cn = function() {
|
1593
1149
|
function e(t) {
|
1594
1150
|
i(this, e), this.config = t, this.props = {}, this.campaign_params_saved = !1, this.name = function(e) {
|
1595
1151
|
var t = "";
|
@@ -1601,19 +1157,19 @@ o(_t, "Mozilla", [ new RegExp("rv:" + _n) ]), _t), En = [ [ new RegExp(on + "; "
|
|
1601
1157
|
return s(e, [ {
|
1602
1158
|
key: "buildStorage",
|
1603
1159
|
value: function(e) {
|
1604
|
-
-1 ===
|
1160
|
+
-1 === ln.indexOf(e.persistence.toLowerCase()) && (U.critical("Unknown persistence type " + e.persistence + "; falling back to localStorage+cookie"),
|
1605
1161
|
e.persistence = "localStorage+cookie");
|
1606
1162
|
var t = e.persistence.toLowerCase();
|
1607
|
-
return "localstorage" === t &&
|
1163
|
+
return "localstorage" === t && Ke.is_supported() ? Ke : "localstorage+cookie" === t && Ze.is_supported() ? Ze : "sessionstorage" === t && it.is_supported() ? it : "memory" === t ? tt : "cookie" === t ? Ye : Ze.is_supported() ? Ze : Ye;
|
1608
1164
|
}
|
1609
1165
|
}, {
|
1610
1166
|
key: "properties",
|
1611
1167
|
value: function() {
|
1612
1168
|
var e = {};
|
1613
|
-
return
|
1614
|
-
if (n ===
|
1615
|
-
a = !1, (
|
1616
|
-
if (a || (a = e === o)) return
|
1169
|
+
return G(this.props, (function(t, n) {
|
1170
|
+
if (n === me && b(t)) for (var i = Object.keys(t), r = 0; r < i.length; r++) e["$feature/".concat(i[r])] = t[i[r]]; else o = n,
|
1171
|
+
a = !1, (F(s = Ce) ? a : q && s.indexOf === q ? -1 != s.indexOf(o) : (G(s, (function(e) {
|
1172
|
+
if (a || (a = e === o)) return W;
|
1617
1173
|
})), a)) || (e[n] = t);
|
1618
1174
|
var s, o, a;
|
1619
1175
|
})), e;
|
@@ -1623,7 +1179,7 @@ o(_t, "Mozilla", [ new RegExp("rv:" + _n) ]), _t), En = [ [ new RegExp(on + "; "
|
|
1623
1179
|
value: function() {
|
1624
1180
|
if (!this.disabled) {
|
1625
1181
|
var e = this.storage.parse(this.name);
|
1626
|
-
e && (this.props =
|
1182
|
+
e && (this.props = Q({}, e));
|
1627
1183
|
}
|
1628
1184
|
}
|
1629
1185
|
}, {
|
@@ -1648,7 +1204,7 @@ o(_t, "Mozilla", [ new RegExp("rv:" + _n) ]), _t), En = [ [ new RegExp(on + "; "
|
|
1648
1204
|
if (b(e)) {
|
1649
1205
|
w(t) && (t = "None"), this.expire_days = w(n) ? this.default_expiry : n;
|
1650
1206
|
var r = !1;
|
1651
|
-
if (
|
1207
|
+
if (G(e, (function(e, n) {
|
1652
1208
|
i.props.hasOwnProperty(n) && i.props[n] !== t || (i.props[n] = e, r = !0);
|
1653
1209
|
})), r) return this.save(), !0;
|
1654
1210
|
}
|
@@ -1661,7 +1217,7 @@ o(_t, "Mozilla", [ new RegExp("rv:" + _n) ]), _t), En = [ [ new RegExp(on + "; "
|
|
1661
1217
|
if (b(e)) {
|
1662
1218
|
this.expire_days = w(t) ? this.default_expiry : t;
|
1663
1219
|
var i = !1;
|
1664
|
-
if (
|
1220
|
+
if (G(e, (function(t, r) {
|
1665
1221
|
e.hasOwnProperty(r) && n.props[r] !== t && (n.props[r] = t, i = !0);
|
1666
1222
|
})), i) return this.save(), !0;
|
1667
1223
|
}
|
@@ -1675,34 +1231,53 @@ o(_t, "Mozilla", [ new RegExp("rv:" + _n) ]), _t), En = [ [ new RegExp(on + "; "
|
|
1675
1231
|
}, {
|
1676
1232
|
key: "update_campaign_params",
|
1677
1233
|
value: function() {
|
1678
|
-
this.campaign_params_saved || (this.register(
|
1234
|
+
this.campaign_params_saved || (this.register(un.campaignParams(this.config.custom_campaign_params)),
|
1679
1235
|
this.campaign_params_saved = !0);
|
1680
1236
|
}
|
1237
|
+
}, {
|
1238
|
+
key: "set_initial_campaign_params",
|
1239
|
+
value: function() {
|
1240
|
+
this.register_once(o({}, xe, un.campaignParams(this.config.custom_campaign_params)), void 0);
|
1241
|
+
}
|
1681
1242
|
}, {
|
1682
1243
|
key: "update_search_keyword",
|
1683
1244
|
value: function() {
|
1684
|
-
this.register(
|
1245
|
+
this.register(un.searchInfo());
|
1685
1246
|
}
|
1686
1247
|
}, {
|
1687
1248
|
key: "update_referrer_info",
|
1688
1249
|
value: function() {
|
1689
|
-
this.register(
|
1690
|
-
|
1691
|
-
|
1692
|
-
|
1250
|
+
this.register(un.referrerInfo());
|
1251
|
+
}
|
1252
|
+
}, {
|
1253
|
+
key: "set_initial_referrer_info",
|
1254
|
+
value: function() {
|
1255
|
+
this.register_once(o({}, Ee, un.referrerInfo()), void 0);
|
1693
1256
|
}
|
1694
1257
|
}, {
|
1695
1258
|
key: "get_referrer_info",
|
1696
1259
|
value: function() {
|
1697
|
-
return
|
1260
|
+
return ee({
|
1698
1261
|
$referrer: this.props.$referrer,
|
1699
1262
|
$referring_domain: this.props.$referring_domain
|
1700
1263
|
});
|
1701
1264
|
}
|
1265
|
+
}, {
|
1266
|
+
key: "get_initial_props",
|
1267
|
+
value: function() {
|
1268
|
+
var e = this, t = {};
|
1269
|
+
return G([ Ee, xe ], (function(n) {
|
1270
|
+
var i = e.props[n];
|
1271
|
+
i && G(i, (function(e, n) {
|
1272
|
+
var i;
|
1273
|
+
t["$initial_" + (i = n, i.replace(/^\$/, ""))] = e;
|
1274
|
+
}));
|
1275
|
+
})), t;
|
1276
|
+
}
|
1702
1277
|
}, {
|
1703
1278
|
key: "safe_merge",
|
1704
1279
|
value: function(e) {
|
1705
|
-
return
|
1280
|
+
return G(this.props, (function(t, n) {
|
1706
1281
|
n in e || (e[n] = t);
|
1707
1282
|
})), e;
|
1708
1283
|
}
|
@@ -1739,39 +1314,39 @@ o(_t, "Mozilla", [ new RegExp("rv:" + _n) ]), _t), En = [ [ new RegExp(on + "; "
|
|
1739
1314
|
}, {
|
1740
1315
|
key: "set_event_timer",
|
1741
1316
|
value: function(e, t) {
|
1742
|
-
var n = this.props[
|
1743
|
-
n[e] = t, this.props[
|
1317
|
+
var n = this.props[ue] || {};
|
1318
|
+
n[e] = t, this.props[ue] = n, this.save();
|
1744
1319
|
}
|
1745
1320
|
}, {
|
1746
1321
|
key: "remove_event_timer",
|
1747
1322
|
value: function(e) {
|
1748
|
-
var t = (this.props[
|
1749
|
-
return w(t) || (delete this.props[
|
1323
|
+
var t = (this.props[ue] || {})[e];
|
1324
|
+
return w(t) || (delete this.props[ue][e], this.save()), t;
|
1750
1325
|
}
|
1751
1326
|
}, {
|
1752
1327
|
key: "get_user_state",
|
1753
1328
|
value: function() {
|
1754
|
-
return this.props[
|
1329
|
+
return this.props[Fe] || "anonymous";
|
1755
1330
|
}
|
1756
1331
|
}, {
|
1757
1332
|
key: "set_user_state",
|
1758
1333
|
value: function(e) {
|
1759
|
-
this.props[
|
1334
|
+
this.props[Fe] = e, this.save();
|
1760
1335
|
}
|
1761
1336
|
}, {
|
1762
1337
|
key: "get_quota_limits",
|
1763
1338
|
value: function() {
|
1764
|
-
return this.props[
|
1339
|
+
return this.props[Re] || {};
|
1765
1340
|
}
|
1766
1341
|
}, {
|
1767
1342
|
key: "set_quota_limits",
|
1768
1343
|
value: function(e) {
|
1769
|
-
this.props[
|
1344
|
+
this.props[Re] = e, this.save();
|
1770
1345
|
}
|
1771
1346
|
} ]), e;
|
1772
|
-
}(),
|
1347
|
+
}(), dn = 2, hn = 4;
|
1773
1348
|
|
1774
|
-
var
|
1349
|
+
var fn = s((function e(t) {
|
1775
1350
|
var n, r, s = this, a = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
|
1776
1351
|
i(this, e), o(this, "bucketSize", 100), o(this, "refillRate", 10), o(this, "mutationBuckets", {}),
|
1777
1352
|
o(this, "loggedTracker", {}), o(this, "refillBuckets", (function() {
|
@@ -1806,11 +1381,287 @@ var Mn = s((function e(t) {
|
|
1806
1381
|
setInterval((function() {
|
1807
1382
|
s.refillBuckets();
|
1808
1383
|
}), 1e3);
|
1809
|
-
})),
|
1384
|
+
})), pn = function(e) {
|
1810
1385
|
return e[e.DomContentLoaded = 0] = "DomContentLoaded", e[e.Load = 1] = "Load", e[e.FullSnapshot = 2] = "FullSnapshot",
|
1811
1386
|
e[e.IncrementalSnapshot = 3] = "IncrementalSnapshot", e[e.Meta = 4] = "Meta", e[e.Custom = 5] = "Custom",
|
1812
1387
|
e[e.Plugin = 6] = "Plugin", e;
|
1813
|
-
}(
|
1388
|
+
}(pn || {});
|
1389
|
+
|
1390
|
+
function gn(e) {
|
1391
|
+
return e ? V(e).split(/\s+/) : [];
|
1392
|
+
}
|
1393
|
+
|
1394
|
+
function vn(e) {
|
1395
|
+
var t = "";
|
1396
|
+
switch (n(e.className)) {
|
1397
|
+
case "string":
|
1398
|
+
t = e.className;
|
1399
|
+
break;
|
1400
|
+
|
1401
|
+
case "object":
|
1402
|
+
t = ("baseVal" in e.className ? e.className.baseVal : null) || e.getAttribute("class") || "";
|
1403
|
+
break;
|
1404
|
+
|
1405
|
+
default:
|
1406
|
+
t = "";
|
1407
|
+
}
|
1408
|
+
return gn(t);
|
1409
|
+
}
|
1410
|
+
|
1411
|
+
function _n(e) {
|
1412
|
+
return R(e) ? null : V(e).split(/(\s+)/).filter((function(e) {
|
1413
|
+
return Mn(e);
|
1414
|
+
})).join("").replace(/[\r\n]/g, " ").replace(/[ ]+/g, " ").substring(0, 255);
|
1415
|
+
}
|
1416
|
+
|
1417
|
+
function mn(e) {
|
1418
|
+
var t = "";
|
1419
|
+
return Pn(e) && !xn(e) && e.childNodes && e.childNodes.length && G(e.childNodes, (function(e) {
|
1420
|
+
var n;
|
1421
|
+
kn(e) && e.textContent && (t += null !== (n = _n(e.textContent)) && void 0 !== n ? n : "");
|
1422
|
+
})), V(t);
|
1423
|
+
}
|
1424
|
+
|
1425
|
+
function yn(e) {
|
1426
|
+
return !!e && 1 === e.nodeType;
|
1427
|
+
}
|
1428
|
+
|
1429
|
+
function bn(e, t) {
|
1430
|
+
return !!e && !!e.tagName && e.tagName.toLowerCase() === t.toLowerCase();
|
1431
|
+
}
|
1432
|
+
|
1433
|
+
function kn(e) {
|
1434
|
+
return !!e && 3 === e.nodeType;
|
1435
|
+
}
|
1436
|
+
|
1437
|
+
function wn(e) {
|
1438
|
+
return !!e && 11 === e.nodeType;
|
1439
|
+
}
|
1440
|
+
|
1441
|
+
var Sn = [ "a", "button", "form", "input", "select", "textarea", "label" ];
|
1442
|
+
|
1443
|
+
function Fn(e) {
|
1444
|
+
var t = e.parentNode;
|
1445
|
+
return !(!t || !yn(t)) && t;
|
1446
|
+
}
|
1447
|
+
|
1448
|
+
function Rn(e, t) {
|
1449
|
+
var i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : void 0, r = arguments.length > 3 ? arguments[3] : void 0, s = arguments.length > 4 ? arguments[4] : void 0;
|
1450
|
+
if (!I || !e || bn(e, "html") || !yn(e)) return !1;
|
1451
|
+
if (null != i && i.url_allowlist) {
|
1452
|
+
var o = I.location.href, a = i.url_allowlist;
|
1453
|
+
if (a && !a.some((function(e) {
|
1454
|
+
return o.match(e);
|
1455
|
+
}))) return !1;
|
1456
|
+
}
|
1457
|
+
if (null != i && i.dom_event_allowlist) {
|
1458
|
+
var u = i.dom_event_allowlist;
|
1459
|
+
if (u && !u.some((function(e) {
|
1460
|
+
return t.type === e;
|
1461
|
+
}))) return !1;
|
1462
|
+
}
|
1463
|
+
for (var l = !1, c = [ e ], d = !0, f = e; f.parentNode && !bn(f, "body"); ) if (wn(f.parentNode)) c.push(f.parentNode.host),
|
1464
|
+
f = f.parentNode.host; else {
|
1465
|
+
if (!(d = Fn(f))) break;
|
1466
|
+
if (r || Sn.indexOf(d.tagName.toLowerCase()) > -1) l = !0; else {
|
1467
|
+
var p = I.getComputedStyle(d);
|
1468
|
+
p && "pointer" === p.getPropertyValue("cursor") && (l = !0);
|
1469
|
+
}
|
1470
|
+
c.push(d), f = d;
|
1471
|
+
}
|
1472
|
+
if (!function(e, t) {
|
1473
|
+
var i = null == t ? void 0 : t.element_allowlist;
|
1474
|
+
if (w(i)) return !0;
|
1475
|
+
var r, s = h(e);
|
1476
|
+
try {
|
1477
|
+
var o = function() {
|
1478
|
+
var e = r.value;
|
1479
|
+
if (i.some((function(t) {
|
1480
|
+
return e.tagName.toLowerCase() === t;
|
1481
|
+
}))) return {
|
1482
|
+
v: !0
|
1483
|
+
};
|
1484
|
+
};
|
1485
|
+
for (s.s(); !(r = s.n()).done; ) {
|
1486
|
+
var a = o();
|
1487
|
+
if ("object" === n(a)) return a.v;
|
1488
|
+
}
|
1489
|
+
} catch (e) {
|
1490
|
+
s.e(e);
|
1491
|
+
} finally {
|
1492
|
+
s.f();
|
1493
|
+
}
|
1494
|
+
return !1;
|
1495
|
+
}(c, i)) return !1;
|
1496
|
+
if (!function(e, t) {
|
1497
|
+
var i = null == t ? void 0 : t.css_selector_allowlist;
|
1498
|
+
if (w(i)) return !0;
|
1499
|
+
var r, s = h(e);
|
1500
|
+
try {
|
1501
|
+
var o = function() {
|
1502
|
+
var e = r.value;
|
1503
|
+
if (i.some((function(t) {
|
1504
|
+
return e.matches(t);
|
1505
|
+
}))) return {
|
1506
|
+
v: !0
|
1507
|
+
};
|
1508
|
+
};
|
1509
|
+
for (s.s(); !(r = s.n()).done; ) {
|
1510
|
+
var a = o();
|
1511
|
+
if ("object" === n(a)) return a.v;
|
1512
|
+
}
|
1513
|
+
} catch (e) {
|
1514
|
+
s.e(e);
|
1515
|
+
} finally {
|
1516
|
+
s.f();
|
1517
|
+
}
|
1518
|
+
return !1;
|
1519
|
+
}(c, i)) return !1;
|
1520
|
+
var g = I.getComputedStyle(e);
|
1521
|
+
if (g && "pointer" === g.getPropertyValue("cursor") && "click" === t.type) return !0;
|
1522
|
+
var v = e.tagName.toLowerCase();
|
1523
|
+
switch (v) {
|
1524
|
+
case "html":
|
1525
|
+
return !1;
|
1526
|
+
|
1527
|
+
case "form":
|
1528
|
+
return (s || [ "submit" ]).indexOf(t.type) >= 0;
|
1529
|
+
|
1530
|
+
case "input":
|
1531
|
+
case "select":
|
1532
|
+
case "textarea":
|
1533
|
+
return (s || [ "change", "click" ]).indexOf(t.type) >= 0;
|
1534
|
+
|
1535
|
+
default:
|
1536
|
+
return l ? (s || [ "click" ]).indexOf(t.type) >= 0 : (s || [ "click" ]).indexOf(t.type) >= 0 && (Sn.indexOf(v) > -1 || "true" === e.getAttribute("contenteditable"));
|
1537
|
+
}
|
1538
|
+
}
|
1539
|
+
|
1540
|
+
function Pn(e) {
|
1541
|
+
for (var t = e; t.parentNode && !bn(t, "body"); t = t.parentNode) {
|
1542
|
+
var n = vn(t);
|
1543
|
+
if (Y(n, "ph-sensitive") || Y(n, "ph-no-capture")) return !1;
|
1544
|
+
}
|
1545
|
+
if (Y(vn(e), "ph-include")) return !0;
|
1546
|
+
var i = e.type || "";
|
1547
|
+
if (S(i)) switch (i.toLowerCase()) {
|
1548
|
+
case "hidden":
|
1549
|
+
case "password":
|
1550
|
+
return !1;
|
1551
|
+
}
|
1552
|
+
var r = e.name || e.id || "";
|
1553
|
+
if (S(r)) {
|
1554
|
+
if (/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g, ""))) return !1;
|
1555
|
+
}
|
1556
|
+
return !0;
|
1557
|
+
}
|
1558
|
+
|
1559
|
+
function xn(e) {
|
1560
|
+
return !!(bn(e, "input") && ![ "button", "checkbox", "submit", "reset" ].includes(e.type) || bn(e, "select") || bn(e, "textarea") || "true" === e.getAttribute("contenteditable"));
|
1561
|
+
}
|
1562
|
+
|
1563
|
+
var En = "(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})", In = new RegExp("^(?:".concat(En, ")$")), Cn = new RegExp(En), $n = "\\d{3}-?\\d{2}-?\\d{4}", Tn = new RegExp("^(".concat($n, ")$")), qn = new RegExp("(".concat($n, ")"));
|
1564
|
+
|
1565
|
+
function Mn(e) {
|
1566
|
+
var t = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1];
|
1567
|
+
if (R(e)) return !1;
|
1568
|
+
if (S(e)) {
|
1569
|
+
if (e = V(e), (t ? In : Cn).test((e || "").replace(/[- ]/g, ""))) return !1;
|
1570
|
+
if ((t ? Tn : qn).test(e)) return !1;
|
1571
|
+
}
|
1572
|
+
return !0;
|
1573
|
+
}
|
1574
|
+
|
1575
|
+
function On(e) {
|
1576
|
+
var t = mn(e);
|
1577
|
+
return Mn(t = "".concat(t, " ").concat(An(e)).trim()) ? t : "";
|
1578
|
+
}
|
1579
|
+
|
1580
|
+
function An(e) {
|
1581
|
+
var t = "";
|
1582
|
+
return e && e.childNodes && e.childNodes.length && G(e.childNodes, (function(e) {
|
1583
|
+
var n;
|
1584
|
+
if (e && "span" === (null === (n = e.tagName) || void 0 === n ? void 0 : n.toLowerCase())) try {
|
1585
|
+
var i = mn(e);
|
1586
|
+
t = "".concat(t, " ").concat(i).trim(), e.childNodes && e.childNodes.length && (t = "".concat(t, " ").concat(An(e)).trim());
|
1587
|
+
} catch (e) {
|
1588
|
+
U.error(e);
|
1589
|
+
}
|
1590
|
+
})), t;
|
1591
|
+
}
|
1592
|
+
|
1593
|
+
function Dn(e) {
|
1594
|
+
return function(e) {
|
1595
|
+
var n = e.map((function(e) {
|
1596
|
+
var n, i, r = "";
|
1597
|
+
if (e.tag_name && (r += e.tag_name), e.attr_class) {
|
1598
|
+
e.attr_class.sort();
|
1599
|
+
var s, o = h(e.attr_class);
|
1600
|
+
try {
|
1601
|
+
for (o.s(); !(s = o.n()).done; ) {
|
1602
|
+
var a = s.value;
|
1603
|
+
r += ".".concat(a.replace(/"/g, ""));
|
1604
|
+
}
|
1605
|
+
} catch (e) {
|
1606
|
+
o.e(e);
|
1607
|
+
} finally {
|
1608
|
+
o.f();
|
1609
|
+
}
|
1610
|
+
}
|
1611
|
+
var l = t(t(t(t({}, e.text ? {
|
1612
|
+
text: e.text
|
1613
|
+
} : {}), {}, {
|
1614
|
+
"nth-child": null !== (n = e.nth_child) && void 0 !== n ? n : 0,
|
1615
|
+
"nth-of-type": null !== (i = e.nth_of_type) && void 0 !== i ? i : 0
|
1616
|
+
}, e.href ? {
|
1617
|
+
href: e.href
|
1618
|
+
} : {}), e.attr_id ? {
|
1619
|
+
attr_id: e.attr_id
|
1620
|
+
} : {}), e.attributes), c = {};
|
1621
|
+
return J(l).sort((function(e, t) {
|
1622
|
+
var n = u(e, 1)[0], i = u(t, 1)[0];
|
1623
|
+
return n.localeCompare(i);
|
1624
|
+
})).forEach((function(e) {
|
1625
|
+
var t = u(e, 2), n = t[0], i = t[1];
|
1626
|
+
return c[Ln(n.toString())] = Ln(i.toString());
|
1627
|
+
})), r += ":", r += J(l).map((function(e) {
|
1628
|
+
var t = u(e, 2), n = t[0], i = t[1];
|
1629
|
+
return "".concat(n, '="').concat(i, '"');
|
1630
|
+
})).join("");
|
1631
|
+
}));
|
1632
|
+
return n.join(";");
|
1633
|
+
}(function(e) {
|
1634
|
+
return e.map((function(e) {
|
1635
|
+
var t, n, i = {
|
1636
|
+
text: null === (t = e.$el_text) || void 0 === t ? void 0 : t.slice(0, 400),
|
1637
|
+
tag_name: e.tag_name,
|
1638
|
+
href: null === (n = e.attr__href) || void 0 === n ? void 0 : n.slice(0, 2048),
|
1639
|
+
attr_class: Nn(e),
|
1640
|
+
attr_id: e.attr__id,
|
1641
|
+
nth_child: e.nth_child,
|
1642
|
+
nth_of_type: e.nth_of_type,
|
1643
|
+
attributes: {}
|
1644
|
+
};
|
1645
|
+
return J(e).filter((function(e) {
|
1646
|
+
return 0 === u(e, 1)[0].indexOf("attr__");
|
1647
|
+
})).forEach((function(e) {
|
1648
|
+
var t = u(e, 2), n = t[0], r = t[1];
|
1649
|
+
return i.attributes[n] = r;
|
1650
|
+
})), i;
|
1651
|
+
}));
|
1652
|
+
}(e));
|
1653
|
+
}
|
1654
|
+
|
1655
|
+
function Ln(e) {
|
1656
|
+
return e.replace(/"|\\"/g, '\\"');
|
1657
|
+
}
|
1658
|
+
|
1659
|
+
function Nn(e) {
|
1660
|
+
var t = e.attr__class;
|
1661
|
+
return t ? m(t) ? t : gn(t) : void 0;
|
1662
|
+
}
|
1663
|
+
|
1664
|
+
var Bn = "[SessionRecording]", Hn = {
|
1814
1665
|
initiatorTypes: [ "audio", "beacon", "body", "css", "early-hint", "embed", "fetch", "frame", "iframe", "icon", "image", "img", "input", "link", "navigation", "object", "ping", "script", "track", "video", "xmlhttprequest" ],
|
1815
1666
|
maskRequestFn: function(e) {
|
1816
1667
|
return e;
|
@@ -1821,48 +1672,48 @@ var Mn = s((function e(t) {
|
|
1821
1672
|
recordPerformance: !1,
|
1822
1673
|
performanceEntryTypeToObserve: [ "first-input", "navigation", "paint", "resource" ],
|
1823
1674
|
payloadSizeLimitBytes: 1e6
|
1824
|
-
},
|
1675
|
+
}, jn = [ "authorization", "x-forwarded-for", "authorization", "cookie", "set-cookie", "x-api-key", "x-real-ip", "remote-addr", "forwarded", "proxy-authorization", "x-csrf-token", "x-csrftoken", "x-xsrf-token" ], Un = [ "password", "secret", "passwd", "api_key", "apikey", "auth", "credentials", "mysql_pwd", "privatekey", "private_key", "token" ], Wn = [ "/s/", "/e/", "/i/" ];
|
1825
1676
|
|
1826
|
-
function
|
1827
|
-
if (
|
1677
|
+
function Vn(e, t, n, i) {
|
1678
|
+
if (R(e)) return e;
|
1828
1679
|
var r = (null == t ? void 0 : t["content-length"]) || function(e) {
|
1829
1680
|
return new Blob([ e ]).size;
|
1830
1681
|
}(e);
|
1831
|
-
return
|
1682
|
+
return S(r) && (r = parseInt(r)), r > n ? Bn + " ".concat(i, " body too large to record (").concat(r, " bytes)") : e;
|
1832
1683
|
}
|
1833
1684
|
|
1834
|
-
function
|
1835
|
-
if (
|
1685
|
+
function zn(e, t) {
|
1686
|
+
if (R(e)) return e;
|
1836
1687
|
var n = e;
|
1837
|
-
return
|
1688
|
+
return Mn(n, !1) || (n = Bn + " " + t + " body redacted"), G(Un, (function(e) {
|
1838
1689
|
var i, r;
|
1839
|
-
null !== (i = n) && void 0 !== i && i.length && -1 !== (null === (r = n) || void 0 === r ? void 0 : r.indexOf(e)) && (n =
|
1690
|
+
null !== (i = n) && void 0 !== i && i.length && -1 !== (null === (r = n) || void 0 === r ? void 0 : r.indexOf(e)) && (n = Bn + " " + t + " body redacted as might contain: " + e);
|
1840
1691
|
})), n;
|
1841
1692
|
}
|
1842
1693
|
|
1843
|
-
var
|
1694
|
+
var Gn = function(e, n) {
|
1844
1695
|
var i, r, s, o = {
|
1845
|
-
payloadSizeLimitBytes:
|
1846
|
-
performanceEntryTypeToObserve: l(
|
1696
|
+
payloadSizeLimitBytes: Hn.payloadSizeLimitBytes,
|
1697
|
+
performanceEntryTypeToObserve: l(Hn.performanceEntryTypeToObserve)
|
1847
1698
|
}, a = !1 !== e.session_recording.recordHeaders && n.recordHeaders, u = !1 !== e.session_recording.recordBody && n.recordBody, c = !1 !== e.capture_performance && n.recordPerformance, d = (i = o,
|
1848
1699
|
s = Math.min(1e6, null !== (r = i.payloadSizeLimitBytes) && void 0 !== r ? r : 1e6),
|
1849
1700
|
function(e) {
|
1850
|
-
return null != e && e.requestBody && (e.requestBody =
|
1851
|
-
null != e && e.responseBody && (e.responseBody =
|
1701
|
+
return null != e && e.requestBody && (e.requestBody = Vn(e.requestBody, e.requestHeaders, s, "Request")),
|
1702
|
+
null != e && e.responseBody && (e.responseBody = Vn(e.responseBody, e.responseHeaders, s, "Response")),
|
1852
1703
|
e;
|
1853
1704
|
}), h = function(e) {
|
1854
1705
|
return d(function(e) {
|
1855
|
-
var t =
|
1856
|
-
if (!(t && t.pathname &&
|
1706
|
+
var t = st(e.name);
|
1707
|
+
if (!(t && t.pathname && Wn.some((function(e) {
|
1857
1708
|
return 0 === t.pathname.indexOf(e);
|
1858
1709
|
})))) return e;
|
1859
|
-
}((t = e,
|
1710
|
+
}((t = e, G(Object.keys(null !== (n = t.requestHeaders) && void 0 !== n ? n : {}), (function(e) {
|
1860
1711
|
var n;
|
1861
|
-
|
1712
|
+
jn.includes(e.toLowerCase()) && (null === (n = t.requestHeaders) || void 0 === n || delete n[e]);
|
1862
1713
|
})), t)));
|
1863
1714
|
var t, n;
|
1864
1715
|
}, f = y(e.session_recording.maskNetworkRequestFn);
|
1865
|
-
return f && y(e.session_recording.maskCapturedNetworkRequestFn) &&
|
1716
|
+
return f && y(e.session_recording.maskCapturedNetworkRequestFn) && U.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),
|
1866
1717
|
f && (e.session_recording.maskCapturedNetworkRequestFn = function(n) {
|
1867
1718
|
var i = e.session_recording.maskNetworkRequestFn({
|
1868
1719
|
url: n.name
|
@@ -1875,81 +1726,81 @@ var Vn = function(e, n) {
|
|
1875
1726
|
return s && null !== (n = null === (i = (r = e.session_recording).maskCapturedNetworkRequestFn) || void 0 === i ? void 0 : i.call(r, s)) && void 0 !== n ? n : void 0;
|
1876
1727
|
} : function(e) {
|
1877
1728
|
return function(e) {
|
1878
|
-
if (!w(e)) return e.requestBody =
|
1729
|
+
if (!w(e)) return e.requestBody = zn(e.requestBody, "Request"), e.responseBody = zn(e.responseBody, "Response"),
|
1879
1730
|
e;
|
1880
1731
|
}(h(e));
|
1881
|
-
}, t(t(t({},
|
1732
|
+
}, t(t(t({}, Hn), o), {}, {
|
1882
1733
|
recordHeaders: a,
|
1883
1734
|
recordBody: u,
|
1884
1735
|
recordPerformance: c,
|
1885
1736
|
recordInitialRequests: c
|
1886
1737
|
});
|
1887
|
-
},
|
1738
|
+
}, Qn = "__ph_opt_in_out_";
|
1888
1739
|
|
1889
|
-
function
|
1890
|
-
|
1740
|
+
function Yn(e, t) {
|
1741
|
+
ii(!0, e, t);
|
1891
1742
|
}
|
1892
1743
|
|
1893
|
-
function
|
1894
|
-
|
1744
|
+
function Jn(e, t) {
|
1745
|
+
ii(!1, e, t);
|
1895
1746
|
}
|
1896
1747
|
|
1897
|
-
function
|
1898
|
-
return "1" ===
|
1748
|
+
function Kn(e, t) {
|
1749
|
+
return "1" === ni(e, t);
|
1899
1750
|
}
|
1900
1751
|
|
1901
|
-
function
|
1752
|
+
function Xn(e, t) {
|
1902
1753
|
return !!function(e) {
|
1903
1754
|
if (e && e.respectDnt) {
|
1904
|
-
var t = e && e.window ||
|
1905
|
-
return
|
1906
|
-
|
1755
|
+
var t = e && e.window || I, n = null == t ? void 0 : t.navigator, i = !1;
|
1756
|
+
return G([ null == n ? void 0 : n.doNotTrack, n.msDoNotTrack, t.doNotTrack ], (function(e) {
|
1757
|
+
Y([ !0, 1, "1", "yes" ], e) && (i = !0);
|
1907
1758
|
})), i;
|
1908
1759
|
}
|
1909
1760
|
return !1;
|
1910
|
-
}(t) || "0" ===
|
1761
|
+
}(t) || "0" === ni(e, t);
|
1911
1762
|
}
|
1912
1763
|
|
1913
|
-
function
|
1914
|
-
|
1764
|
+
function Zn(e, t) {
|
1765
|
+
ei(t = t || {}).remove(ti(e, t), !!t.crossSubdomainCookie);
|
1915
1766
|
}
|
1916
1767
|
|
1917
|
-
function
|
1918
|
-
return "localStorage" === (e = e || {}).persistenceType ?
|
1768
|
+
function ei(e) {
|
1769
|
+
return "localStorage" === (e = e || {}).persistenceType ? Ke : "localStorage+cookie" === e.persistenceType ? Ze : Ye;
|
1919
1770
|
}
|
1920
1771
|
|
1921
|
-
function
|
1922
|
-
return ((t = t || {}).persistencePrefix ||
|
1772
|
+
function ti(e, t) {
|
1773
|
+
return ((t = t || {}).persistencePrefix || Qn) + e;
|
1923
1774
|
}
|
1924
1775
|
|
1925
|
-
function
|
1926
|
-
return
|
1776
|
+
function ni(e, t) {
|
1777
|
+
return ei(t).get(ti(e, t));
|
1927
1778
|
}
|
1928
1779
|
|
1929
|
-
function
|
1930
|
-
|
1780
|
+
function ii(e, t, n) {
|
1781
|
+
S(t) && t.length ? (ei(n = n || {}).set(ti(t, n), e ? 1 : 0, P(n.cookieExpiration) ? n.cookieExpiration : null, n.crossSubdomainCookie, n.secureCookie),
|
1931
1782
|
n.capture && e && n.capture(n.captureEventName || "$opt_in", n.captureProperties || {}, {
|
1932
1783
|
send_instantly: !0
|
1933
|
-
})) :
|
1784
|
+
})) : U.error("gdpr." + (e ? "optIn" : "optOut") + " called with an invalid token");
|
1934
1785
|
}
|
1935
1786
|
|
1936
|
-
function
|
1787
|
+
function ri(e) {
|
1937
1788
|
var t = !1;
|
1938
1789
|
try {
|
1939
1790
|
var n = e.config.token, i = e.config.respect_dnt, r = e.config.opt_out_capturing_persistence_type, s = e.config.opt_out_capturing_cookie_prefix || void 0, o = e.config.window;
|
1940
|
-
n && (t =
|
1791
|
+
n && (t = Xn(n, {
|
1941
1792
|
respectDnt: i,
|
1942
1793
|
persistenceType: r,
|
1943
1794
|
persistencePrefix: s,
|
1944
1795
|
window: o
|
1945
1796
|
}));
|
1946
1797
|
} catch (e) {
|
1947
|
-
|
1798
|
+
U.error("Unexpected error when checking capturing opt-out status: " + e);
|
1948
1799
|
}
|
1949
1800
|
return t;
|
1950
1801
|
}
|
1951
1802
|
|
1952
|
-
var
|
1803
|
+
var si, oi = 3e5, ai = oi;
|
1953
1804
|
|
1954
1805
|
!function(e) {
|
1955
1806
|
e[e.Mutation = 0] = "Mutation", e[e.MouseMove = 1] = "MouseMove", e[e.MouseInteraction = 2] = "MouseInteraction",
|
@@ -1958,41 +1809,41 @@ var ni, ii = 3e5, ri = ii;
|
|
1958
1809
|
e[e.StyleSheetRule = 8] = "StyleSheetRule", e[e.CanvasMutation = 9] = "CanvasMutation",
|
1959
1810
|
e[e.Font = 10] = "Font", e[e.Log = 11] = "Log", e[e.Drag = 12] = "Drag", e[e.StyleDeclaration = 13] = "StyleDeclaration",
|
1960
1811
|
e[e.Selection = 14] = "Selection", e[e.AdoptedStyleSheet = 15] = "AdoptedStyleSheet";
|
1961
|
-
}(
|
1812
|
+
}(si || (si = {}));
|
1962
1813
|
|
1963
|
-
var
|
1814
|
+
var ui = [ si.MouseMove, si.MouseInteraction, si.Scroll, si.ViewportResize, si.Input, si.TouchMove, si.MediaInteraction, si.Drag ], li = function(e) {
|
1964
1815
|
return {
|
1965
1816
|
rrwebMethod: e,
|
1966
1817
|
enqueuedAt: Date.now(),
|
1967
1818
|
attempt: 1
|
1968
1819
|
};
|
1969
|
-
},
|
1820
|
+
}, ci = "[SessionRecording]", di = function() {
|
1970
1821
|
function e(t) {
|
1971
1822
|
var n = this;
|
1972
1823
|
if (i(this, e), o(this, "queuedRRWebEvents", []), o(this, "isIdle", !1), o(this, "_linkedFlagSeen", !1),
|
1973
1824
|
o(this, "_lastActivityTimestamp", Date.now()), o(this, "windowId", null), o(this, "sessionId", null),
|
1974
|
-
o(this, "_linkedFlag", null), o(this, "
|
1975
|
-
o(this, "
|
1976
|
-
this._endpoint = "/s/", this.stopRrweb = void 0, this.receivedDecide = !1, null ==
|
1825
|
+
o(this, "_linkedFlag", null), o(this, "_forceAllowLocalhostNetworkCapture", !1),
|
1826
|
+
o(this, "_samplingSessionListener", null), this.instance = t, this._captureStarted = !1,
|
1827
|
+
this._endpoint = "/s/", this.stopRrweb = void 0, this.receivedDecide = !1, null == I || I.addEventListener("beforeunload", (function() {
|
1977
1828
|
n._flushBuffer();
|
1978
|
-
})), null ==
|
1829
|
+
})), null == I || I.addEventListener("offline", (function() {
|
1979
1830
|
n._tryAddCustomEvent("browser offline", {});
|
1980
|
-
})), null ==
|
1831
|
+
})), null == I || I.addEventListener("online", (function() {
|
1981
1832
|
n._tryAddCustomEvent("browser online", {});
|
1982
|
-
})), null ==
|
1833
|
+
})), null == I || I.addEventListener("visibilitychange", (function() {
|
1983
1834
|
if (null != O && O.visibilityState) {
|
1984
1835
|
var e = "window " + O.visibilityState;
|
1985
1836
|
n._tryAddCustomEvent(e, {});
|
1986
1837
|
}
|
1987
|
-
})), !this.instance.sessionManager) throw
|
1988
|
-
new Error(
|
1989
|
-
this.buffer = this.clearBuffer();
|
1838
|
+
})), !this.instance.sessionManager) throw U.error(ci + " started without valid sessionManager"),
|
1839
|
+
new Error(ci + " started without valid sessionManager. This is a bug.");
|
1840
|
+
this.buffer = this.clearBuffer(), this._setupSampling();
|
1990
1841
|
}
|
1991
1842
|
return s(e, [ {
|
1992
1843
|
key: "rrwebRecord",
|
1993
1844
|
get: function() {
|
1994
1845
|
var e;
|
1995
|
-
return null ==
|
1846
|
+
return null == H || null === (e = H.rrweb) || void 0 === e ? void 0 : e.record;
|
1996
1847
|
}
|
1997
1848
|
}, {
|
1998
1849
|
key: "started",
|
@@ -2002,14 +1853,15 @@ var si = [ ni.MouseMove, ni.MouseInteraction, ni.Scroll, ni.ViewportResize, ni.I
|
|
2002
1853
|
}, {
|
2003
1854
|
key: "sessionManager",
|
2004
1855
|
get: function() {
|
2005
|
-
if (!this.instance.sessionManager) throw
|
2006
|
-
new Error(
|
1856
|
+
if (!this.instance.sessionManager) throw U.error(ci + " started without valid sessionManager"),
|
1857
|
+
new Error(ci + " started without valid sessionManager. This is a bug.");
|
2007
1858
|
return this.instance.sessionManager;
|
2008
1859
|
}
|
2009
1860
|
}, {
|
2010
1861
|
key: "isSampled",
|
2011
1862
|
get: function() {
|
2012
|
-
|
1863
|
+
var e = this.instance.get_property(_e);
|
1864
|
+
return x(e) ? e : null;
|
2013
1865
|
}
|
2014
1866
|
}, {
|
2015
1867
|
key: "sessionDuration",
|
@@ -2020,19 +1872,19 @@ var si = [ ni.MouseMove, ni.MouseInteraction, ni.Scroll, ni.ViewportResize, ni.I
|
|
2020
1872
|
}, {
|
2021
1873
|
key: "isRecordingEnabled",
|
2022
1874
|
get: function() {
|
2023
|
-
var e = !!this.instance.get_property(
|
2024
|
-
return
|
1875
|
+
var e = !!this.instance.get_property(ce), t = !this.instance.config.disable_session_recording;
|
1876
|
+
return I && e && t;
|
2025
1877
|
}
|
2026
1878
|
}, {
|
2027
1879
|
key: "isConsoleLogCaptureEnabled",
|
2028
1880
|
get: function() {
|
2029
|
-
var e = !!this.instance.get_property(
|
1881
|
+
var e = !!this.instance.get_property(de), t = this.instance.config.enable_recording_console_log;
|
2030
1882
|
return null != t ? t : e;
|
2031
1883
|
}
|
2032
1884
|
}, {
|
2033
1885
|
key: "canvasRecording",
|
2034
1886
|
get: function() {
|
2035
|
-
var e = this.instance.get_property(
|
1887
|
+
var e = this.instance.get_property(fe);
|
2036
1888
|
return e && e.fps && e.quality ? {
|
2037
1889
|
enabled: e.enabled,
|
2038
1890
|
fps: e.fps,
|
@@ -2042,7 +1894,7 @@ var si = [ ni.MouseMove, ni.MouseInteraction, ni.Scroll, ni.ViewportResize, ni.I
|
|
2042
1894
|
}, {
|
2043
1895
|
key: "networkPayloadCapture",
|
2044
1896
|
get: function() {
|
2045
|
-
var e, t, n = this.instance.get_property(
|
1897
|
+
var e, t, n = this.instance.get_property(he), i = {
|
2046
1898
|
recordHeaders: null === (e = this.instance.config.session_recording) || void 0 === e ? void 0 : e.recordHeaders,
|
2047
1899
|
recordBody: null === (t = this.instance.config.session_recording) || void 0 === t ? void 0 : t.recordBody
|
2048
1900
|
}, r = (null == i ? void 0 : i.recordHeaders) || (null == n ? void 0 : n.recordHeaders), s = (null == i ? void 0 : i.recordBody) || (null == n ? void 0 : n.recordBody), o = this.instance.config.capture_performance || (null == n ? void 0 : n.capturePerformance);
|
@@ -2052,76 +1904,100 @@ var si = [ ni.MouseMove, ni.MouseInteraction, ni.Scroll, ni.ViewportResize, ni.I
|
|
2052
1904
|
recordPerformance: o
|
2053
1905
|
} : void 0;
|
2054
1906
|
}
|
1907
|
+
}, {
|
1908
|
+
key: "sampleRate",
|
1909
|
+
get: function() {
|
1910
|
+
var e = this.instance.get_property(pe);
|
1911
|
+
return P(e) ? e : null;
|
1912
|
+
}
|
1913
|
+
}, {
|
1914
|
+
key: "minimumDuration",
|
1915
|
+
get: function() {
|
1916
|
+
var e = this.instance.get_property(ge);
|
1917
|
+
return P(e) ? e : null;
|
1918
|
+
}
|
2055
1919
|
}, {
|
2056
1920
|
key: "status",
|
2057
1921
|
get: function() {
|
2058
|
-
return this.receivedDecide ? this.isRecordingEnabled ?
|
1922
|
+
return this.receivedDecide ? this.isRecordingEnabled ? R(this._linkedFlag) || this._linkedFlagSeen ? x(this.isSampled) ? this.isSampled ? "sampled" : "disabled" : "active" : "buffering" : "disabled" : "buffering";
|
2059
1923
|
}
|
2060
1924
|
}, {
|
2061
1925
|
key: "startRecordingIfEnabled",
|
2062
1926
|
value: function() {
|
2063
|
-
this.isRecordingEnabled ? (this._startCapture(),
|
1927
|
+
this.isRecordingEnabled ? (this._startCapture(), U.info(ci + " started")) : (this.stopRecording(),
|
2064
1928
|
this.clearBuffer());
|
2065
1929
|
}
|
2066
1930
|
}, {
|
2067
1931
|
key: "stopRecording",
|
2068
1932
|
value: function() {
|
2069
1933
|
this._captureStarted && this.stopRrweb && (this.stopRrweb(), this.stopRrweb = void 0,
|
2070
|
-
this._captureStarted = !1,
|
1934
|
+
this._captureStarted = !1, U.info(ci + " stopped"));
|
2071
1935
|
}
|
2072
1936
|
}, {
|
2073
1937
|
key: "makeSamplingDecision",
|
2074
1938
|
value: function(e) {
|
2075
|
-
var t, n = this.sessionId !== e, i = this.
|
2076
|
-
if (
|
1939
|
+
var t, n = this.sessionId !== e, i = this.sampleRate;
|
1940
|
+
if (P(i)) {
|
2077
1941
|
var r, s = this.isSampled, a = n || !x(s);
|
2078
1942
|
if (a) r = Math.random() < i; else r = s;
|
2079
|
-
!r && a &&
|
1943
|
+
!r && a && U.warn(ci + " Sample rate (".concat(i, ") has determined that this sessionId (").concat(e, ") will not be sent to the server.")),
|
2080
1944
|
this._tryAddCustomEvent("samplingDecisionMade", {
|
2081
1945
|
sampleRate: i
|
2082
|
-
}), null === (t = this.instance.persistence) || void 0 === t || t.register(o({},
|
1946
|
+
}), null === (t = this.instance.persistence) || void 0 === t || t.register(o({}, _e, r));
|
2083
1947
|
} else {
|
2084
1948
|
var u;
|
2085
|
-
null === (u = this.instance.persistence) || void 0 === u || u.register(o({},
|
1949
|
+
null === (u = this.instance.persistence) || void 0 === u || u.register(o({}, _e, null));
|
2086
1950
|
}
|
2087
1951
|
}
|
2088
1952
|
}, {
|
2089
1953
|
key: "afterDecideResponse",
|
2090
1954
|
value: function(e) {
|
2091
|
-
var n, i, r
|
2092
|
-
this.
|
2093
|
-
|
2094
|
-
|
2095
|
-
|
2096
|
-
}, null === (u = e.sessionRecording) || void 0 === u ? void 0 : u.networkPayloadCapture)),
|
2097
|
-
o(h, De, {
|
2098
|
-
enabled: null === (l = e.sessionRecording) || void 0 === l ? void 0 : l.recordCanvas,
|
2099
|
-
fps: null === (c = e.sessionRecording) || void 0 === c ? void 0 : c.canvasFps,
|
2100
|
-
quality: null === (d = e.sessionRecording) || void 0 === d ? void 0 : d.canvasQuality
|
2101
|
-
}), h));
|
2102
|
-
var p = null === (n = e.sessionRecording) || void 0 === n ? void 0 : n.sampleRate;
|
2103
|
-
this._sampleRate = F(p) ? null : parseFloat(p);
|
2104
|
-
var g, v = null === (i = e.sessionRecording) || void 0 === i ? void 0 : i.minimumDurationMilliseconds;
|
2105
|
-
(this._minimumDuration = w(v) ? null : v, this._linkedFlag = (null === (r = e.sessionRecording) || void 0 === r ? void 0 : r.linkedFlag) || null,
|
2106
|
-
null !== (s = e.sessionRecording) && void 0 !== s && s.endpoint) && (this._endpoint = null === (g = e.sessionRecording) || void 0 === g ? void 0 : g.endpoint);
|
2107
|
-
if (R(this._sampleRate) && this.sessionManager.onSessionId((function(e) {
|
2108
|
-
f.makeSamplingDecision(e);
|
2109
|
-
})), !F(this._linkedFlag)) {
|
2110
|
-
var _ = k(this._linkedFlag) ? this._linkedFlag : this._linkedFlag.flag, m = k(this._linkedFlag) ? null : this._linkedFlag.variant;
|
1955
|
+
var t, n, i, r = this;
|
1956
|
+
(this._persistDecideResponse(e), this._linkedFlag = (null === (t = e.sessionRecording) || void 0 === t ? void 0 : t.linkedFlag) || null,
|
1957
|
+
null !== (n = e.sessionRecording) && void 0 !== n && n.endpoint) && (this._endpoint = null === (i = e.sessionRecording) || void 0 === i ? void 0 : i.endpoint);
|
1958
|
+
if (this._setupSampling(), !R(this._linkedFlag)) {
|
1959
|
+
var s = S(this._linkedFlag) ? this._linkedFlag : this._linkedFlag.flag, o = S(this._linkedFlag) ? null : this._linkedFlag.variant;
|
2111
1960
|
this.instance.onFeatureFlags((function(e, t) {
|
2112
|
-
var n = b(t) &&
|
1961
|
+
var n = b(t) && s in t, i = o ? t[s] === o : n;
|
2113
1962
|
if (i) {
|
2114
|
-
var
|
2115
|
-
linkedFlag:
|
2116
|
-
linkedVariant:
|
2117
|
-
},
|
2118
|
-
|
1963
|
+
var a = {
|
1964
|
+
linkedFlag: s,
|
1965
|
+
linkedVariant: o
|
1966
|
+
}, u = "linked flag matched";
|
1967
|
+
U.info(ci + " " + u, a), r._tryAddCustomEvent(u, a);
|
2119
1968
|
}
|
2120
|
-
|
1969
|
+
r._linkedFlagSeen = i;
|
2121
1970
|
}));
|
2122
1971
|
}
|
2123
1972
|
this.receivedDecide = !0, this.startRecordingIfEnabled();
|
2124
1973
|
}
|
1974
|
+
}, {
|
1975
|
+
key: "_setupSampling",
|
1976
|
+
value: function() {
|
1977
|
+
var e = this;
|
1978
|
+
P(this.sampleRate) && F(this._samplingSessionListener) && (this._samplingSessionListener = this.sessionManager.onSessionId((function(t) {
|
1979
|
+
e.makeSamplingDecision(t);
|
1980
|
+
})));
|
1981
|
+
}
|
1982
|
+
}, {
|
1983
|
+
key: "_persistDecideResponse",
|
1984
|
+
value: function(e) {
|
1985
|
+
if (this.instance.persistence) {
|
1986
|
+
var n = this.instance.persistence, i = function() {
|
1987
|
+
var i, r, s, a, u, l, c, d, h = null === (i = e.sessionRecording) || void 0 === i ? void 0 : i.sampleRate, f = R(h) ? null : parseFloat(h), p = null === (r = e.sessionRecording) || void 0 === r ? void 0 : r.minimumDurationMilliseconds;
|
1988
|
+
n.register((o(d = {}, ce, !!e.sessionRecording), o(d, de, null === (s = e.sessionRecording) || void 0 === s ? void 0 : s.consoleLogRecordingEnabled),
|
1989
|
+
o(d, he, t({
|
1990
|
+
capturePerformance: e.capturePerformance
|
1991
|
+
}, null === (a = e.sessionRecording) || void 0 === a ? void 0 : a.networkPayloadCapture)),
|
1992
|
+
o(d, fe, {
|
1993
|
+
enabled: null === (u = e.sessionRecording) || void 0 === u ? void 0 : u.recordCanvas,
|
1994
|
+
fps: null === (l = e.sessionRecording) || void 0 === l ? void 0 : l.canvasFps,
|
1995
|
+
quality: null === (c = e.sessionRecording) || void 0 === c ? void 0 : c.canvasQuality
|
1996
|
+
}), o(d, pe, f), o(d, ge, w(p) ? null : p), d));
|
1997
|
+
};
|
1998
|
+
i(), this.sessionManager.onSessionId(i);
|
1999
|
+
}
|
2000
|
+
}
|
2125
2001
|
}, {
|
2126
2002
|
key: "log",
|
2127
2003
|
value: function(e) {
|
@@ -2136,16 +2012,16 @@ var si = [ ni.MouseMove, ni.MouseInteraction, ni.Scroll, ni.ViewportResize, ni.I
|
|
2136
2012
|
payload: [ JSON.stringify(e) ]
|
2137
2013
|
}
|
2138
2014
|
},
|
2139
|
-
timestamp:
|
2015
|
+
timestamp: K()
|
2140
2016
|
});
|
2141
2017
|
}
|
2142
2018
|
}, {
|
2143
2019
|
key: "_startCapture",
|
2144
2020
|
value: function() {
|
2145
2021
|
var e = this;
|
2146
|
-
w(Object.assign) || this._captureStarted || this.instance.config.disable_session_recording ||
|
2147
|
-
this.sessionManager.checkAndGetSessionAndWindowId(), this.rrwebRecord ? this._onScriptLoaded() :
|
2148
|
-
if (t) return
|
2022
|
+
w(Object.assign) || this._captureStarted || this.instance.config.disable_session_recording || ri(this.instance) || (this._captureStarted = !0,
|
2023
|
+
this.sessionManager.checkAndGetSessionAndWindowId(), this.rrwebRecord ? this._onScriptLoaded() : se(this.instance.requestRouter.endpointFor("assets", "/static/recorder.js?v=".concat(f.LIB_VERSION)), (function(t) {
|
2024
|
+
if (t) return U.error(ci + " could not load recorder.js", t);
|
2149
2025
|
e._onScriptLoaded();
|
2150
2026
|
})));
|
2151
2027
|
}
|
@@ -2153,17 +2029,17 @@ var si = [ ni.MouseMove, ni.MouseInteraction, ni.Scroll, ni.ViewportResize, ni.I
|
|
2153
2029
|
key: "_isInteractiveEvent",
|
2154
2030
|
value: function(e) {
|
2155
2031
|
var t;
|
2156
|
-
return 3 === e.type && -1 !==
|
2032
|
+
return 3 === e.type && -1 !== ui.indexOf(null === (t = e.data) || void 0 === t ? void 0 : t.source);
|
2157
2033
|
}
|
2158
2034
|
}, {
|
2159
2035
|
key: "_updateWindowAndSessionIds",
|
2160
2036
|
value: function(e) {
|
2161
2037
|
var t = this._isInteractiveEvent(e);
|
2162
|
-
t || this.isIdle || e.timestamp - this._lastActivityTimestamp >
|
2038
|
+
t || this.isIdle || e.timestamp - this._lastActivityTimestamp > ai && (this.isIdle = !0,
|
2163
2039
|
this._tryAddCustomEvent("sessionIdle", {
|
2164
2040
|
reason: "user inactivity",
|
2165
2041
|
timeSinceLastActive: e.timestamp - this._lastActivityTimestamp,
|
2166
|
-
threshold:
|
2042
|
+
threshold: ai
|
2167
2043
|
}));
|
2168
2044
|
var n = !1;
|
2169
2045
|
if (t && (this._lastActivityTimestamp = e.timestamp, this.isIdle && (this.isIdle = !1,
|
@@ -2172,7 +2048,7 @@ var si = [ ni.MouseMove, ni.MouseInteraction, ni.Scroll, ni.ViewportResize, ni.I
|
|
2172
2048
|
type: e.type
|
2173
2049
|
}), n = !0)), !this.isIdle) {
|
2174
2050
|
var i = this.sessionManager.checkAndGetSessionAndWindowId(!t, e.timestamp), r = i.windowId, s = i.sessionId, o = this.sessionId !== s, a = this.windowId !== r;
|
2175
|
-
this.windowId = r, this.sessionId = s, (n || -1 === [
|
2051
|
+
this.windowId = r, this.sessionId = s, (n || -1 === [ dn, hn ].indexOf(e.type) && (a || o)) && this._tryTakeFullSnapshot();
|
2176
2052
|
}
|
2177
2053
|
}
|
2178
2054
|
}, {
|
@@ -2185,14 +2061,14 @@ var si = [ ni.MouseMove, ni.MouseInteraction, ni.Scroll, ni.ViewportResize, ni.I
|
|
2185
2061
|
enqueuedAt: e.enqueuedAt || Date.now(),
|
2186
2062
|
attempt: e.attempt++,
|
2187
2063
|
rrwebMethod: e.rrwebMethod
|
2188
|
-
}) :
|
2064
|
+
}) : U.warn(ci + " could not emit queued rrweb event.", t, e), !1;
|
2189
2065
|
}
|
2190
2066
|
}
|
2191
2067
|
}, {
|
2192
2068
|
key: "_tryAddCustomEvent",
|
2193
2069
|
value: function(e, t) {
|
2194
2070
|
var n = this;
|
2195
|
-
return this._tryRRWebMethod(
|
2071
|
+
return this._tryRRWebMethod(li((function() {
|
2196
2072
|
return n.rrwebRecord.addCustomEvent(e, t);
|
2197
2073
|
})));
|
2198
2074
|
}
|
@@ -2200,7 +2076,7 @@ var si = [ ni.MouseMove, ni.MouseInteraction, ni.Scroll, ni.ViewportResize, ni.I
|
|
2200
2076
|
key: "_tryTakeFullSnapshot",
|
2201
2077
|
value: function() {
|
2202
2078
|
var e = this;
|
2203
|
-
return this._tryRRWebMethod(
|
2079
|
+
return this._tryRRWebMethod(li((function() {
|
2204
2080
|
return e.rrwebRecord.takeFullSnapshot();
|
2205
2081
|
})));
|
2206
2082
|
}
|
@@ -2232,12 +2108,12 @@ var si = [ ni.MouseMove, ni.MouseInteraction, ni.Scroll, ni.ViewportResize, ni.I
|
|
2232
2108
|
type: "image/webp",
|
2233
2109
|
quality: this.canvasRecording.quality
|
2234
2110
|
}), this.rrwebRecord) {
|
2235
|
-
this.mutationRateLimiter = null !== (e = this.mutationRateLimiter) && void 0 !== e ? e : new
|
2111
|
+
this.mutationRateLimiter = null !== (e = this.mutationRateLimiter) && void 0 !== e ? e : new fn(this.rrwebRecord, {
|
2236
2112
|
onBlockedNode: function(e, t) {
|
2237
2113
|
var i = "Too many mutations on node '".concat(e, "'. Rate limiting. This could be due to SVG animations or something similar");
|
2238
|
-
|
2114
|
+
U.info(i, {
|
2239
2115
|
node: t
|
2240
|
-
}), n.log(
|
2116
|
+
}), n.log(ci + " " + i, "warn");
|
2241
2117
|
}
|
2242
2118
|
}), this._scheduleFullSnapshot();
|
2243
2119
|
var d = this._gatherRRWebPlugins();
|
@@ -2249,14 +2125,14 @@ var si = [ ni.MouseMove, ni.MouseInteraction, ni.Scroll, ni.ViewportResize, ni.I
|
|
2249
2125
|
}, i)), this.instance._addCaptureHook((function(e) {
|
2250
2126
|
try {
|
2251
2127
|
if ("$pageview" === e) {
|
2252
|
-
var t =
|
2128
|
+
var t = I ? n._maskUrl(I.location.href) : "";
|
2253
2129
|
if (!t) return;
|
2254
2130
|
n._tryAddCustomEvent("$pageview", {
|
2255
2131
|
href: t
|
2256
2132
|
}), n._tryTakeFullSnapshot();
|
2257
2133
|
}
|
2258
2134
|
} catch (e) {
|
2259
|
-
|
2135
|
+
U.error("Could not add $pageview to rrweb session", e);
|
2260
2136
|
}
|
2261
2137
|
})), this._lastActivityTimestamp = Date.now(), this.isIdle = !1, this._tryAddCustomEvent("$session_options", {
|
2262
2138
|
sessionRecordingOptions: i,
|
@@ -2266,7 +2142,7 @@ var si = [ ni.MouseMove, ni.MouseInteraction, ni.Scroll, ni.ViewportResize, ni.I
|
|
2266
2142
|
}), this._tryAddCustomEvent("$posthog_config", {
|
2267
2143
|
config: this.instance.config
|
2268
2144
|
});
|
2269
|
-
} else
|
2145
|
+
} else U.error(ci + "onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.");
|
2270
2146
|
}
|
2271
2147
|
}, {
|
2272
2148
|
key: "_scheduleFullSnapshot",
|
@@ -2274,26 +2150,26 @@ var si = [ ni.MouseMove, ni.MouseInteraction, ni.Scroll, ni.ViewportResize, ni.I
|
|
2274
2150
|
var e = this;
|
2275
2151
|
this._fullSnapshotTimer && clearInterval(this._fullSnapshotTimer), this._fullSnapshotTimer = setInterval((function() {
|
2276
2152
|
e._tryTakeFullSnapshot();
|
2277
|
-
}),
|
2153
|
+
}), oi);
|
2278
2154
|
}
|
2279
2155
|
}, {
|
2280
2156
|
key: "_gatherRRWebPlugins",
|
2281
2157
|
value: function() {
|
2282
2158
|
var e = [];
|
2283
|
-
(
|
2284
|
-
this.networkPayloadCapture && y(
|
2159
|
+
(H.rrwebConsoleRecord && this.isConsoleLogCaptureEnabled && e.push(H.rrwebConsoleRecord.getRecordConsolePlugin()),
|
2160
|
+
this.networkPayloadCapture && y(H.getRecordNetworkPlugin)) && (!rt.includes(location.hostname) || this._forceAllowLocalhostNetworkCapture ? e.push(H.getRecordNetworkPlugin(Gn(this.instance.config, this.networkPayloadCapture))) : U.info(ci + " NetworkCapture not started because we are on localhost."));
|
2285
2161
|
return e;
|
2286
2162
|
}
|
2287
2163
|
}, {
|
2288
2164
|
key: "onRRwebEmit",
|
2289
2165
|
value: function(e) {
|
2290
2166
|
if (this._processQueuedEvents(), e && b(e)) {
|
2291
|
-
if (e.type ===
|
2167
|
+
if (e.type === pn.Meta) {
|
2292
2168
|
var t = this._maskUrl(e.data.href);
|
2293
2169
|
if (this._lastHref = t, !t) return;
|
2294
2170
|
e.data.href = t;
|
2295
2171
|
} else this._pageViewFallBack();
|
2296
|
-
e.type ===
|
2172
|
+
e.type === pn.FullSnapshot && this._scheduleFullSnapshot();
|
2297
2173
|
var n = this.mutationRateLimiter ? this.mutationRateLimiter.throttleMutations(e) : e;
|
2298
2174
|
if (n) {
|
2299
2175
|
var i = function(e) {
|
@@ -2306,7 +2182,7 @@ var si = [ ni.MouseMove, ni.MouseInteraction, ni.Scroll, ni.ViewportResize, ni.I
|
|
2306
2182
|
}
|
2307
2183
|
return e;
|
2308
2184
|
}(n), r = JSON.stringify(i).length;
|
2309
|
-
if (this._updateWindowAndSessionIds(i), !this.isIdle || i.type ===
|
2185
|
+
if (this._updateWindowAndSessionIds(i), !this.isIdle || i.type === pn.Custom) {
|
2310
2186
|
var s = {
|
2311
2187
|
$snapshot_bytes: r,
|
2312
2188
|
$snapshot_data: i,
|
@@ -2321,8 +2197,8 @@ var si = [ ni.MouseMove, ni.MouseInteraction, ni.Scroll, ni.ViewportResize, ni.I
|
|
2321
2197
|
}, {
|
2322
2198
|
key: "_pageViewFallBack",
|
2323
2199
|
value: function() {
|
2324
|
-
if (!this.instance.config.capture_pageview &&
|
2325
|
-
var e = this._maskUrl(
|
2200
|
+
if (!this.instance.config.capture_pageview && I) {
|
2201
|
+
var e = this._maskUrl(I.location.href);
|
2326
2202
|
this._lastHref !== e && (this._tryAddCustomEvent("$url_changed", {
|
2327
2203
|
href: e
|
2328
2204
|
}), this._lastHref = e);
|
@@ -2374,7 +2250,7 @@ var si = [ ni.MouseMove, ni.MouseInteraction, ni.Scroll, ni.ViewportResize, ni.I
|
|
2374
2250
|
value: function() {
|
2375
2251
|
var e = this;
|
2376
2252
|
this.flushBufferTimer && (clearTimeout(this.flushBufferTimer), this.flushBufferTimer = void 0);
|
2377
|
-
var t = this.
|
2253
|
+
var t = this.minimumDuration, n = this.sessionDuration, i = P(n) && n >= 0, r = P(t) && i && n < t;
|
2378
2254
|
return "buffering" === this.status || r ? (this.flushBufferTimer = setTimeout((function() {
|
2379
2255
|
e._flushBuffer();
|
2380
2256
|
}), 2e3), this.buffer || this.clearBuffer()) : this.buffer && 0 !== this.buffer.data.length ? (this._captureSnapshot({
|
@@ -2389,7 +2265,7 @@ var si = [ ni.MouseMove, ni.MouseInteraction, ni.Scroll, ni.ViewportResize, ni.I
|
|
2389
2265
|
value: function(e) {
|
2390
2266
|
var t, n = this, i = 2 + ((null === (t = this.buffer) || void 0 === t ? void 0 : t.data.length) || 0);
|
2391
2267
|
(!this.buffer || this.buffer.size + e.$snapshot_bytes + i > 943718.4 || this.buffer.sessionId && this.buffer.sessionId !== this.sessionId) && (this.buffer = this._flushBuffer()),
|
2392
|
-
|
2268
|
+
F(this.buffer.sessionId) && !F(this.sessionId) && (this.buffer.sessionId = this.sessionId,
|
2393
2269
|
this.buffer.windowId = this.windowId), this.buffer.size += e.$snapshot_bytes, this.buffer.data.push(e.$snapshot_data),
|
2394
2270
|
this.flushBufferTimer || (this.flushBufferTimer = setTimeout((function() {
|
2395
2271
|
n._flushBuffer();
|
@@ -2405,7 +2281,7 @@ var si = [ ni.MouseMove, ni.MouseInteraction, ni.Scroll, ni.ViewportResize, ni.I
|
|
2405
2281
|
});
|
2406
2282
|
}
|
2407
2283
|
} ]), e;
|
2408
|
-
}(),
|
2284
|
+
}(), hi = function() {
|
2409
2285
|
function e(t) {
|
2410
2286
|
i(this, e), this.instance = t, this.instance.decideEndpointWasHit = this.instance._hasBootstrappedFeatureFlags();
|
2411
2287
|
}
|
@@ -2416,15 +2292,15 @@ var si = [ ni.MouseMove, ni.MouseInteraction, ni.Scroll, ni.ViewportResize, ni.I
|
|
2416
2292
|
token: this.instance.config.token,
|
2417
2293
|
distinct_id: this.instance.get_distinct_id(),
|
2418
2294
|
groups: this.instance.getGroups(),
|
2419
|
-
person_properties: this.instance.get_property(
|
2420
|
-
group_properties: this.instance.get_property(
|
2295
|
+
person_properties: this.instance.get_property(be),
|
2296
|
+
group_properties: this.instance.get_property(ke),
|
2421
2297
|
disable_flags: this.instance.config.advanced_disable_feature_flags || this.instance.config.advanced_disable_feature_flags_on_first_load || void 0
|
2422
2298
|
};
|
2423
2299
|
this.instance._send_request({
|
2424
2300
|
method: "POST",
|
2425
2301
|
url: this.instance.requestRouter.endpointFor("api", "/decide/?v=3"),
|
2426
2302
|
data: t,
|
2427
|
-
compression:
|
2303
|
+
compression: this.instance.config.disable_compression ? void 0 : ne.Base64,
|
2428
2304
|
timeout: this.instance.config.feature_flag_request_timeout_ms,
|
2429
2305
|
callback: function(t) {
|
2430
2306
|
return e.parseDecideResponse(t.json);
|
@@ -2434,46 +2310,47 @@ var si = [ ni.MouseMove, ni.MouseInteraction, ni.Scroll, ni.ViewportResize, ni.I
|
|
2434
2310
|
}, {
|
2435
2311
|
key: "parseDecideResponse",
|
2436
2312
|
value: function(e) {
|
2437
|
-
var t, n = this;
|
2313
|
+
var t, n, i = this;
|
2438
2314
|
this.instance.featureFlags.setReloadingPaused(!1), this.instance.featureFlags._startReloadTimer();
|
2439
|
-
var
|
2440
|
-
if (this.instance.config.advanced_disable_feature_flags_on_first_load || this.instance.config.advanced_disable_feature_flags || this.instance.featureFlags.receivedFeatureFlags(null != e ? e : {},
|
2441
|
-
|
2442
|
-
if (!O || !O.body) return
|
2315
|
+
var r = !e;
|
2316
|
+
if (this.instance.config.advanced_disable_feature_flags_on_first_load || this.instance.config.advanced_disable_feature_flags || this.instance.featureFlags.receivedFeatureFlags(null != e ? e : {}, r),
|
2317
|
+
r) U.error("Failed to fetch feature flags from PostHog."); else {
|
2318
|
+
if (!O || !O.body) return U.info("document not ready yet, trying again in 500 milliseconds..."),
|
2443
2319
|
void setTimeout((function() {
|
2444
|
-
|
2320
|
+
i.parseDecideResponse(e);
|
2445
2321
|
}), 500);
|
2446
2322
|
this.instance.toolbar.afterDecideResponse(e), null === (t = this.instance.sessionRecording) || void 0 === t || t.afterDecideResponse(e),
|
2447
|
-
|
2448
|
-
|
2449
|
-
|
2450
|
-
|
2451
|
-
|
2323
|
+
null === (n = this.instance.autocapture) || void 0 === n || n.afterDecideResponse(e),
|
2324
|
+
this.instance._afterDecideResponse(e);
|
2325
|
+
var s = null == I ? void 0 : I.extendPostHogWithSurveys;
|
2326
|
+
this.instance.config.disable_surveys || !e.surveys || s || se(this.instance.requestRouter.endpointFor("assets", "/static/surveys.js"), (function(e) {
|
2327
|
+
if (e) return U.error("Could not load surveys script", e);
|
2328
|
+
I.extendPostHogWithSurveys(i.instance);
|
2452
2329
|
}));
|
2453
|
-
var
|
2454
|
-
if (e.autocaptureExceptions && e.autocaptureExceptions && w(
|
2455
|
-
if (t) return
|
2456
|
-
|
2330
|
+
var o = null == I ? void 0 : I.extendPostHogWithExceptionAutoCapture;
|
2331
|
+
if (e.autocaptureExceptions && e.autocaptureExceptions && w(o) && se(this.instance.requestRouter.endpointFor("assets", "/static/exception-autocapture.js"), (function(t) {
|
2332
|
+
if (t) return U.error("Could not load exception autocapture script", t);
|
2333
|
+
I.extendPostHogWithExceptionAutocapture(i.instance, e);
|
2457
2334
|
})), e.siteApps) if (this.instance.config.opt_in_site_apps) {
|
2458
|
-
var
|
2335
|
+
var a, u = h(e.siteApps);
|
2459
2336
|
try {
|
2460
|
-
var
|
2461
|
-
var e =
|
2462
|
-
|
2463
|
-
e &&
|
2337
|
+
var l = function() {
|
2338
|
+
var e = a.value, t = e.id, n = e.url, r = i.instance.requestRouter.endpointFor("api", n);
|
2339
|
+
H["__$$ph_site_app_".concat(t)] = i.instance, se(r, (function(e) {
|
2340
|
+
e && U.error("Error while initializing PostHog app with config id ".concat(t), e);
|
2464
2341
|
}));
|
2465
2342
|
};
|
2466
|
-
for (
|
2343
|
+
for (u.s(); !(a = u.n()).done; ) l();
|
2467
2344
|
} catch (e) {
|
2468
|
-
|
2345
|
+
u.e(e);
|
2469
2346
|
} finally {
|
2470
|
-
|
2347
|
+
u.f();
|
2471
2348
|
}
|
2472
|
-
} else e.siteApps.length > 0 &&
|
2349
|
+
} else e.siteApps.length > 0 && U.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');
|
2473
2350
|
}
|
2474
2351
|
}
|
2475
2352
|
} ]), e;
|
2476
|
-
}(),
|
2353
|
+
}(), fi = null != I && I.location ? lt(I.location.hash, "__posthog") || lt(location.hash, "state") : null, pi = "_postHogToolbarParams", gi = function() {
|
2477
2354
|
function e(t) {
|
2478
2355
|
i(this, e), o(this, "_toolbarScriptLoaded", !1), this.instance = t;
|
2479
2356
|
}
|
@@ -2489,23 +2366,23 @@ var si = [ ni.MouseMove, ni.MouseInteraction, ni.Scroll, ni.ViewportResize, ni.I
|
|
2489
2366
|
key: "maybeLoadToolbar",
|
2490
2367
|
value: function() {
|
2491
2368
|
var e, t, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : void 0, i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : void 0, r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : void 0;
|
2492
|
-
if (!
|
2493
|
-
n = null !== (e = n) && void 0 !== e ? e :
|
2369
|
+
if (!I || !O) return !1;
|
2370
|
+
n = null !== (e = n) && void 0 !== e ? e : I.location, r = null !== (t = r) && void 0 !== t ? t : I.history;
|
2494
2371
|
try {
|
2495
2372
|
if (!i) {
|
2496
2373
|
try {
|
2497
|
-
|
2374
|
+
I.localStorage.setItem("test", "test"), I.localStorage.removeItem("test");
|
2498
2375
|
} catch (e) {
|
2499
2376
|
return !1;
|
2500
2377
|
}
|
2501
|
-
i = null ==
|
2378
|
+
i = null == I ? void 0 : I.localStorage;
|
2502
2379
|
}
|
2503
|
-
var s, o =
|
2380
|
+
var s, o = fi || lt(n.hash, "__posthog") || lt(n.hash, "state"), a = o ? X((function() {
|
2504
2381
|
return JSON.parse(atob(decodeURIComponent(o)));
|
2505
|
-
})) ||
|
2382
|
+
})) || X((function() {
|
2506
2383
|
return JSON.parse(decodeURIComponent(o));
|
2507
2384
|
})) : null;
|
2508
|
-
return a && "ph_authorize" === a.action ? ((s = a).source = "url", s && Object.keys(s).length > 0 && (a.desiredHash ? n.hash = a.desiredHash : r ? r.replaceState("", O.title, n.pathname + n.search) : n.hash = "")) : ((s = JSON.parse(i.getItem(
|
2385
|
+
return a && "ph_authorize" === a.action ? ((s = a).source = "url", s && Object.keys(s).length > 0 && (a.desiredHash ? n.hash = a.desiredHash : r ? r.replaceState("", O.title, n.pathname + n.search) : n.hash = "")) : ((s = JSON.parse(i.getItem(pi) || "{}")).source = "localstorage",
|
2509
2386
|
delete s.userIntent), !(!s.token || this.instance.config.token !== s.token) && (this.loadToolbar(s),
|
2510
2387
|
!0);
|
2511
2388
|
} catch (e) {
|
@@ -2515,13 +2392,13 @@ var si = [ ni.MouseMove, ni.MouseInteraction, ni.Scroll, ni.ViewportResize, ni.I
|
|
2515
2392
|
}, {
|
2516
2393
|
key: "_callLoadToolbar",
|
2517
2394
|
value: function(e) {
|
2518
|
-
(
|
2395
|
+
(H.ph_load_toolbar || H.ph_load_editor)(e, this.instance);
|
2519
2396
|
}
|
2520
2397
|
}, {
|
2521
2398
|
key: "loadToolbar",
|
2522
2399
|
value: function(e) {
|
2523
2400
|
var n = this;
|
2524
|
-
if (!
|
2401
|
+
if (!I || I.localStorage.getItem(pi) && this._toolbarScriptLoaded) return !1;
|
2525
2402
|
var i = "custom" === this.instance.requestRouter.region && this.instance.config.advanced_disable_toolbar_metrics, r = t(t({
|
2526
2403
|
token: this.instance.config.token
|
2527
2404
|
}, e), {}, {
|
@@ -2529,15 +2406,15 @@ var si = [ ni.MouseMove, ni.MouseInteraction, ni.Scroll, ni.ViewportResize, ni.I
|
|
2529
2406
|
}, i ? {
|
2530
2407
|
instrument: !1
|
2531
2408
|
} : {});
|
2532
|
-
if (
|
2409
|
+
if (I.localStorage.setItem(pi, JSON.stringify(t(t({}, r), {}, {
|
2533
2410
|
source: void 0
|
2534
2411
|
}))), this._toolbarScriptLoaded) this._callLoadToolbar(r); else {
|
2535
2412
|
this._toolbarScriptLoaded = !0;
|
2536
2413
|
var s = 3e5, o = Math.floor(Date.now() / s) * s;
|
2537
|
-
|
2538
|
-
if (e) return
|
2414
|
+
se(this.instance.requestRouter.endpointFor("assets", "/static/toolbar.js?t=".concat(o)), (function(e) {
|
2415
|
+
if (e) return U.error("Failed to load toolbar", e), void (n._toolbarScriptLoaded = !1);
|
2539
2416
|
n._callLoadToolbar(r);
|
2540
|
-
})),
|
2417
|
+
})), re(I, "turbolinks:load", (function() {
|
2541
2418
|
n._toolbarScriptLoaded = !1, n.loadToolbar(r);
|
2542
2419
|
}));
|
2543
2420
|
}
|
@@ -2555,7 +2432,7 @@ var si = [ ni.MouseMove, ni.MouseInteraction, ni.Scroll, ni.ViewportResize, ni.I
|
|
2555
2432
|
return this.maybeLoadToolbar(e, t, n);
|
2556
2433
|
}
|
2557
2434
|
} ]), e;
|
2558
|
-
}(),
|
2435
|
+
}(), vi = function() {
|
2559
2436
|
function e(t) {
|
2560
2437
|
i(this, e), o(this, "isPaused", !0), o(this, "queue", []), o(this, "flushTimeoutMs", 3e3),
|
2561
2438
|
this.sendRequest = t;
|
@@ -2594,7 +2471,7 @@ var si = [ ni.MouseMove, ni.MouseInteraction, ni.Scroll, ni.ViewportResize, ni.I
|
|
2594
2471
|
if (e.clearFlushTimeout(), e.queue.length > 0) {
|
2595
2472
|
var t = e.formatQueue(), n = function(n) {
|
2596
2473
|
var i = t[n], r = (new Date).getTime();
|
2597
|
-
i.data && m(i.data) &&
|
2474
|
+
i.data && m(i.data) && G(i.data, (function(e) {
|
2598
2475
|
e.offset = Math.abs(e.timestamp - r), delete e.timestamp;
|
2599
2476
|
})), e.sendRequest(i);
|
2600
2477
|
};
|
@@ -2611,7 +2488,7 @@ var si = [ ni.MouseMove, ni.MouseInteraction, ni.Scroll, ni.ViewportResize, ni.I
|
|
2611
2488
|
key: "formatQueue",
|
2612
2489
|
value: function() {
|
2613
2490
|
var e = {};
|
2614
|
-
return
|
2491
|
+
return G(this.queue, (function(n) {
|
2615
2492
|
var i, r = n, s = (r ? r.batchKey : null) || r.url;
|
2616
2493
|
w(e[s]) && (e[s] = t(t({}, r), {}, {
|
2617
2494
|
data: []
|
@@ -2619,68 +2496,68 @@ var si = [ ni.MouseMove, ni.MouseInteraction, ni.Scroll, ni.ViewportResize, ni.I
|
|
2619
2496
|
})), this.queue = [], e;
|
2620
2497
|
}
|
2621
2498
|
} ]), e;
|
2622
|
-
}(),
|
2623
|
-
for (var n = new
|
2624
|
-
var r = new
|
2499
|
+
}(), _i = Uint8Array, mi = Uint16Array, yi = Uint32Array, bi = new _i([ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0 ]), ki = new _i([ 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0 ]), wi = new _i([ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ]), Si = function(e, t) {
|
2500
|
+
for (var n = new mi(31), i = 0; i < 31; ++i) n[i] = t += 1 << e[i - 1];
|
2501
|
+
var r = new yi(n[30]);
|
2625
2502
|
for (i = 1; i < 30; ++i) for (var s = n[i]; s < n[i + 1]; ++s) r[s] = s - n[i] << 5 | i;
|
2626
2503
|
return [ n, r ];
|
2627
|
-
},
|
2504
|
+
}, Fi = Si(bi, 2), Ri = Fi[0], Pi = Fi[1];
|
2628
2505
|
|
2629
|
-
|
2506
|
+
Ri[28] = 258, Pi[258] = 28;
|
2630
2507
|
|
2631
|
-
for (var
|
2632
|
-
var
|
2633
|
-
|
2634
|
-
|
2508
|
+
for (var xi = Si(ki, 0)[1], Ei = new mi(32768), Ii = 0; Ii < 32768; ++Ii) {
|
2509
|
+
var Ci = (43690 & Ii) >>> 1 | (21845 & Ii) << 1;
|
2510
|
+
Ci = (61680 & (Ci = (52428 & Ci) >>> 2 | (13107 & Ci) << 2)) >>> 4 | (3855 & Ci) << 4,
|
2511
|
+
Ei[Ii] = ((65280 & Ci) >>> 8 | (255 & Ci) << 8) >>> 1;
|
2635
2512
|
}
|
2636
2513
|
|
2637
|
-
var
|
2638
|
-
for (var i = e.length, r = 0, s = new
|
2639
|
-
var o, a = new
|
2514
|
+
var $i = function(e, t, n) {
|
2515
|
+
for (var i = e.length, r = 0, s = new mi(t); r < i; ++r) ++s[e[r] - 1];
|
2516
|
+
var o, a = new mi(t);
|
2640
2517
|
for (r = 0; r < t; ++r) a[r] = a[r - 1] + s[r - 1] << 1;
|
2641
2518
|
if (n) {
|
2642
|
-
o = new
|
2519
|
+
o = new mi(1 << t);
|
2643
2520
|
var u = 15 - t;
|
2644
|
-
for (r = 0; r < i; ++r) if (e[r]) for (var l = r << 4 | e[r], c = t - e[r], d = a[e[r] - 1]++ << c, h = d | (1 << c) - 1; d <= h; ++d) o[
|
2645
|
-
} else for (o = new
|
2521
|
+
for (r = 0; r < i; ++r) if (e[r]) for (var l = r << 4 | e[r], c = t - e[r], d = a[e[r] - 1]++ << c, h = d | (1 << c) - 1; d <= h; ++d) o[Ei[d] >>> u] = l;
|
2522
|
+
} else for (o = new mi(i), r = 0; r < i; ++r) o[r] = Ei[a[e[r] - 1]++] >>> 15 - e[r];
|
2646
2523
|
return o;
|
2647
|
-
},
|
2524
|
+
}, Ti = new _i(288);
|
2648
2525
|
|
2649
|
-
for (
|
2526
|
+
for (Ii = 0; Ii < 144; ++Ii) Ti[Ii] = 8;
|
2650
2527
|
|
2651
|
-
for (
|
2528
|
+
for (Ii = 144; Ii < 256; ++Ii) Ti[Ii] = 9;
|
2652
2529
|
|
2653
|
-
for (
|
2530
|
+
for (Ii = 256; Ii < 280; ++Ii) Ti[Ii] = 7;
|
2654
2531
|
|
2655
|
-
for (
|
2532
|
+
for (Ii = 280; Ii < 288; ++Ii) Ti[Ii] = 8;
|
2656
2533
|
|
2657
|
-
var
|
2534
|
+
var qi = new _i(32);
|
2658
2535
|
|
2659
|
-
for (
|
2536
|
+
for (Ii = 0; Ii < 32; ++Ii) qi[Ii] = 5;
|
2660
2537
|
|
2661
|
-
var
|
2538
|
+
var Mi = $i(Ti, 9, 0), Oi = $i(qi, 5, 0), Ai = function(e) {
|
2662
2539
|
return (e / 8 >> 0) + (7 & e && 1);
|
2663
|
-
},
|
2540
|
+
}, Di = function(e, t, n) {
|
2664
2541
|
(null == t || t < 0) && (t = 0), (null == n || n > e.length) && (n = e.length);
|
2665
|
-
var i = new (e instanceof
|
2542
|
+
var i = new (e instanceof mi ? mi : e instanceof yi ? yi : _i)(n - t);
|
2666
2543
|
return i.set(e.subarray(t, n)), i;
|
2667
|
-
},
|
2544
|
+
}, Li = function(e, t, n) {
|
2668
2545
|
n <<= 7 & t;
|
2669
2546
|
var i = t / 8 >> 0;
|
2670
2547
|
e[i] |= n, e[i + 1] |= n >>> 8;
|
2671
|
-
},
|
2548
|
+
}, Ni = function(e, t, n) {
|
2672
2549
|
n <<= 7 & t;
|
2673
2550
|
var i = t / 8 >> 0;
|
2674
2551
|
e[i] |= n, e[i + 1] |= n >>> 8, e[i + 2] |= n >>> 16;
|
2675
|
-
},
|
2552
|
+
}, Bi = function(e, t) {
|
2676
2553
|
for (var n = [], i = 0; i < e.length; ++i) e[i] && n.push({
|
2677
2554
|
s: i,
|
2678
2555
|
f: e[i]
|
2679
2556
|
});
|
2680
2557
|
var r = n.length, s = n.slice();
|
2681
|
-
if (!r) return [ new
|
2558
|
+
if (!r) return [ new _i(0), 0 ];
|
2682
2559
|
if (1 == r) {
|
2683
|
-
var o = new
|
2560
|
+
var o = new _i(n[0].s + 1);
|
2684
2561
|
return o[n[0].s] = 1, [ o, 1 ];
|
2685
2562
|
}
|
2686
2563
|
n.sort((function(e, t) {
|
@@ -2704,7 +2581,7 @@ var Ti = Pi(Ii, 9, 0), $i = Pi(Ci, 5, 0), Ai = function(e) {
|
|
2704
2581
|
};
|
2705
2582
|
var h = s[0].s;
|
2706
2583
|
for (i = 1; i < r; ++i) s[i].s > h && (h = s[i].s);
|
2707
|
-
var f = new
|
2584
|
+
var f = new mi(h + 1), p = Hi(n[c - 1], f, 0);
|
2708
2585
|
if (p > t) {
|
2709
2586
|
i = 0;
|
2710
2587
|
var g = 0, v = p - t, _ = 1 << v;
|
@@ -2725,12 +2602,12 @@ var Ti = Pi(Ii, 9, 0), $i = Pi(Ci, 5, 0), Ai = function(e) {
|
|
2725
2602
|
}
|
2726
2603
|
p = t;
|
2727
2604
|
}
|
2728
|
-
return [ new
|
2729
|
-
},
|
2605
|
+
return [ new _i(f), p ];
|
2606
|
+
}, Hi = function e(t, n, i) {
|
2730
2607
|
return -1 == t.s ? Math.max(e(t.l, n, i + 1), e(t.r, n, i + 1)) : n[t.s] = i;
|
2731
|
-
},
|
2608
|
+
}, ji = function(e) {
|
2732
2609
|
for (var t = e.length; t && !e[--t]; ) ;
|
2733
|
-
for (var n = new
|
2610
|
+
for (var n = new mi(++t), i = 0, r = e[0], s = 1, o = function(e) {
|
2734
2611
|
n[i++] = e;
|
2735
2612
|
}, a = 1; a <= t; ++a) if (e[a] == r && a != t) ++s; else {
|
2736
2613
|
if (!r && s > 2) {
|
@@ -2744,104 +2621,104 @@ var Ti = Pi(Ii, 9, 0), $i = Pi(Ci, 5, 0), Ai = function(e) {
|
|
2744
2621
|
s = 1, r = e[a];
|
2745
2622
|
}
|
2746
2623
|
return [ n.subarray(0, i), t ];
|
2747
|
-
},
|
2624
|
+
}, Ui = function(e, t) {
|
2748
2625
|
for (var n = 0, i = 0; i < t.length; ++i) n += e[i] * t[i];
|
2749
2626
|
return n;
|
2750
|
-
},
|
2627
|
+
}, Wi = function(e, t, n) {
|
2751
2628
|
var i = n.length, r = Ai(t + 2);
|
2752
2629
|
e[r] = 255 & i, e[r + 1] = i >>> 8, e[r + 2] = 255 ^ e[r], e[r + 3] = 255 ^ e[r + 1];
|
2753
2630
|
for (var s = 0; s < i; ++s) e[r + s + 4] = n[s];
|
2754
2631
|
return 8 * (r + 4 + i);
|
2755
|
-
},
|
2756
|
-
|
2757
|
-
for (var d =
|
2758
|
-
for (F = 0; F <
|
2759
|
-
for (var R =
|
2760
|
-
var I, C, T,
|
2761
|
-
if (
|
2762
|
-
if (
|
2763
|
-
I =
|
2764
|
-
var
|
2765
|
-
|
2766
|
-
for (F = 0; F <
|
2767
|
-
c += 3 *
|
2768
|
-
for (var D = [ m,
|
2632
|
+
}, Vi = function(e, t, n, i, r, s, o, a, u, l, c) {
|
2633
|
+
Li(t, c++, n), ++r[256];
|
2634
|
+
for (var d = Bi(r, 15), h = d[0], f = d[1], p = Bi(s, 15), g = p[0], v = p[1], _ = ji(h), m = _[0], y = _[1], b = ji(g), k = b[0], w = b[1], S = new mi(19), F = 0; F < m.length; ++F) S[31 & m[F]]++;
|
2635
|
+
for (F = 0; F < k.length; ++F) S[31 & k[F]]++;
|
2636
|
+
for (var R = Bi(S, 7), P = R[0], x = R[1], E = 19; E > 4 && !P[wi[E - 1]]; --E) ;
|
2637
|
+
var I, C, $, T, q = l + 5 << 3, M = Ui(r, Ti) + Ui(s, qi) + o, O = Ui(r, h) + Ui(s, g) + o + 14 + 3 * E + Ui(S, P) + (2 * S[16] + 3 * S[17] + 7 * S[18]);
|
2638
|
+
if (q <= M && q <= O) return Wi(t, c, e.subarray(u, u + l));
|
2639
|
+
if (Li(t, c, 1 + (O < M)), c += 2, O < M) {
|
2640
|
+
I = $i(h, f, 0), C = h, $ = $i(g, v, 0), T = g;
|
2641
|
+
var A = $i(P, x, 0);
|
2642
|
+
Li(t, c, y - 257), Li(t, c + 5, w - 1), Li(t, c + 10, E - 4), c += 14;
|
2643
|
+
for (F = 0; F < E; ++F) Li(t, c + 3 * F, P[wi[F]]);
|
2644
|
+
c += 3 * E;
|
2645
|
+
for (var D = [ m, k ], L = 0; L < 2; ++L) {
|
2769
2646
|
var N = D[L];
|
2770
2647
|
for (F = 0; F < N.length; ++F) {
|
2771
2648
|
var B = 31 & N[F];
|
2772
|
-
|
2649
|
+
Li(t, c, A[B]), c += P[B], B > 15 && (Li(t, c, N[F] >>> 5 & 127), c += N[F] >>> 12);
|
2773
2650
|
}
|
2774
2651
|
}
|
2775
|
-
} else I =
|
2652
|
+
} else I = Mi, C = Ti, $ = Oi, T = qi;
|
2776
2653
|
for (F = 0; F < a; ++F) if (i[F] > 255) {
|
2777
2654
|
B = i[F] >>> 18 & 31;
|
2778
|
-
|
2655
|
+
Ni(t, c, I[B + 257]), c += C[B + 257], B > 7 && (Li(t, c, i[F] >>> 23 & 31), c += bi[B]);
|
2779
2656
|
var H = 31 & i[F];
|
2780
|
-
|
2781
|
-
} else
|
2782
|
-
return
|
2783
|
-
},
|
2784
|
-
for (var e = new
|
2657
|
+
Ni(t, c, $[H]), c += T[H], H > 3 && (Ni(t, c, i[F] >>> 5 & 8191), c += ki[H]);
|
2658
|
+
} else Ni(t, c, I[i[F]]), c += C[i[F]];
|
2659
|
+
return Ni(t, c, I[256]), c + C[256];
|
2660
|
+
}, zi = new yi([ 65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632 ]), Gi = new _i(0), Qi = function() {
|
2661
|
+
for (var e = new yi(256), t = 0; t < 256; ++t) {
|
2785
2662
|
for (var n = t, i = 9; --i; ) n = (1 & n && 3988292384) ^ n >>> 1;
|
2786
2663
|
e[t] = n;
|
2787
2664
|
}
|
2788
2665
|
return e;
|
2789
|
-
}(),
|
2666
|
+
}(), Yi = function(e, t, n, i, r) {
|
2790
2667
|
return function(e, t, n, i, r, s) {
|
2791
|
-
var o = e.length, a = new
|
2668
|
+
var o = e.length, a = new _i(i + o + 5 * (1 + Math.floor(o / 7e3)) + r), u = a.subarray(i, a.length - r), l = 0;
|
2792
2669
|
if (!t || o < 8) for (var c = 0; c <= o; c += 65535) {
|
2793
2670
|
var d = c + 65535;
|
2794
|
-
d < o ? l =
|
2671
|
+
d < o ? l = Wi(u, l, e.subarray(c, d)) : (u[c] = s, l = Wi(u, l, e.subarray(c, o)));
|
2795
2672
|
} else {
|
2796
|
-
for (var h =
|
2673
|
+
for (var h = zi[t - 1], f = h >>> 13, p = 8191 & h, g = (1 << n) - 1, v = new mi(32768), _ = new mi(g + 1), m = Math.ceil(n / 3), y = 2 * m, b = function(t) {
|
2797
2674
|
return (e[t] ^ e[t + 1] << m ^ e[t + 2] << y) & g;
|
2798
|
-
},
|
2799
|
-
0),
|
2800
|
-
var I = b(c), C = 32767 & c,
|
2801
|
-
if (v[C] =
|
2802
|
-
var
|
2803
|
-
if ((F > 7e3 ||
|
2804
|
-
l =
|
2805
|
-
for (var
|
2806
|
-
for (
|
2675
|
+
}, k = new yi(25e3), w = new mi(288), S = new mi(32), F = 0, R = 0, P = (c = 0,
|
2676
|
+
0), x = 0, E = 0; c < o; ++c) {
|
2677
|
+
var I = b(c), C = 32767 & c, $ = _[I];
|
2678
|
+
if (v[C] = $, _[I] = C, x <= c) {
|
2679
|
+
var T = o - c;
|
2680
|
+
if ((F > 7e3 || P > 24576) && T > 423) {
|
2681
|
+
l = Vi(e, u, 0, k, w, S, R, P, E, c - E, l), P = F = R = 0, E = c;
|
2682
|
+
for (var q = 0; q < 286; ++q) w[q] = 0;
|
2683
|
+
for (q = 0; q < 30; ++q) S[q] = 0;
|
2807
2684
|
}
|
2808
|
-
var
|
2809
|
-
if (
|
2810
|
-
if (e[c +
|
2685
|
+
var M = 2, O = 0, A = p, D = C - $ & 32767;
|
2686
|
+
if (T > 2 && I == b(c - D)) for (var L = Math.min(f, T) - 1, N = Math.min(32767, c), B = Math.min(258, T); D <= N && --A && C != $; ) {
|
2687
|
+
if (e[c + M] == e[c + M - D]) {
|
2811
2688
|
for (var H = 0; H < B && e[c + H] == e[c + H - D]; ++H) ;
|
2812
|
-
if (H >
|
2813
|
-
if (
|
2689
|
+
if (H > M) {
|
2690
|
+
if (M = H, O = D, H > L) break;
|
2814
2691
|
var j = Math.min(D, H - 2), U = 0;
|
2815
|
-
for (
|
2816
|
-
var
|
2817
|
-
|
2692
|
+
for (q = 0; q < j; ++q) {
|
2693
|
+
var W = c - D + q + 32768 & 32767, V = W - v[W] + 32768 & 32767;
|
2694
|
+
V > U && (U = V, $ = W);
|
2818
2695
|
}
|
2819
2696
|
}
|
2820
2697
|
}
|
2821
|
-
D += (C =
|
2698
|
+
D += (C = $) - ($ = v[C]) + 32768 & 32767;
|
2822
2699
|
}
|
2823
|
-
if (
|
2824
|
-
|
2825
|
-
var z = 31 &
|
2826
|
-
R +=
|
2827
|
-
} else
|
2700
|
+
if (O) {
|
2701
|
+
k[P++] = 268435456 | Pi[M] << 18 | xi[O];
|
2702
|
+
var z = 31 & Pi[M], G = 31 & xi[O];
|
2703
|
+
R += bi[z] + ki[G], ++w[257 + z], ++S[G], x = c + M, ++F;
|
2704
|
+
} else k[P++] = e[c], ++w[e[c]];
|
2828
2705
|
}
|
2829
2706
|
}
|
2830
|
-
l =
|
2707
|
+
l = Vi(e, u, s, k, w, S, R, P, E, c - E, l), s || (l = Wi(u, l, Gi));
|
2831
2708
|
}
|
2832
|
-
return
|
2709
|
+
return Di(a, 0, i + Ai(l) + r);
|
2833
2710
|
}(e, null == t.level ? 6 : t.level, null == t.mem ? Math.ceil(1.5 * Math.max(8, Math.min(13, Math.log(e.length)))) : 12 + t.mem, n, i, !r);
|
2834
|
-
},
|
2711
|
+
}, Ji = function(e, t, n) {
|
2835
2712
|
for (;n; ++t) e[t] = n, n >>>= 8;
|
2836
2713
|
};
|
2837
2714
|
|
2838
|
-
function
|
2715
|
+
function Ki(e, t) {
|
2839
2716
|
void 0 === t && (t = {});
|
2840
2717
|
var n = function() {
|
2841
2718
|
var e = 4294967295;
|
2842
2719
|
return {
|
2843
2720
|
p: function(t) {
|
2844
|
-
for (var n = e, i = 0; i < t.length; ++i) n =
|
2721
|
+
for (var n = e, i = 0; i < t.length; ++i) n = Qi[255 & n ^ t[i]] ^ n >>> 8;
|
2845
2722
|
e = n;
|
2846
2723
|
},
|
2847
2724
|
d: function() {
|
@@ -2850,40 +2727,40 @@ function Qi(e, t) {
|
|
2850
2727
|
};
|
2851
2728
|
}(), i = e.length;
|
2852
2729
|
n.p(e);
|
2853
|
-
var r, s =
|
2730
|
+
var r, s = Yi(e, t, 10 + ((r = t).filename && r.filename.length + 1 || 0), 8), o = s.length;
|
2854
2731
|
return function(e, t) {
|
2855
2732
|
var n = t.filename;
|
2856
2733
|
if (e[0] = 31, e[1] = 139, e[2] = 8, e[8] = t.level < 2 ? 4 : 9 == t.level ? 2 : 0,
|
2857
|
-
e[9] = 3, 0 != t.mtime &&
|
2734
|
+
e[9] = 3, 0 != t.mtime && Ji(e, 4, Math.floor(new Date(t.mtime || Date.now()) / 1e3)),
|
2858
2735
|
n) {
|
2859
2736
|
e[3] = 8;
|
2860
2737
|
for (var i = 0; i <= n.length; ++i) e[i + 10] = n.charCodeAt(i);
|
2861
2738
|
}
|
2862
|
-
}(s, t),
|
2739
|
+
}(s, t), Ji(s, o - 8, n.d()), Ji(s, o - 4, i), s;
|
2863
2740
|
}
|
2864
2741
|
|
2865
|
-
var
|
2742
|
+
var Xi = !!L || !!D, Zi = "text/plain", er = function(e, n) {
|
2866
2743
|
var i = u(e.split("?"), 2), r = i[0], s = i[1], o = t({}, n);
|
2867
2744
|
null == s || s.split("&").forEach((function(e) {
|
2868
2745
|
var t = u(e.split("="), 1)[0];
|
2869
2746
|
delete o[t];
|
2870
2747
|
}));
|
2871
|
-
var a =
|
2748
|
+
var a = at(o);
|
2872
2749
|
return a = a ? (s ? s + "&" : "") + a : s, "".concat(r, "?").concat(a);
|
2873
|
-
},
|
2750
|
+
}, tr = function(e) {
|
2874
2751
|
return "data=" + encodeURIComponent("string" == typeof e ? e : JSON.stringify(e));
|
2875
|
-
},
|
2752
|
+
}, nr = function(e) {
|
2876
2753
|
var t = e.data, n = e.compression;
|
2877
2754
|
if (t) {
|
2878
|
-
if (n ===
|
2879
|
-
var i =
|
2755
|
+
if (n === ne.GZipJS) {
|
2756
|
+
var i = Ki(function(e, t) {
|
2880
2757
|
var n = e.length;
|
2881
2758
|
if (!t && "undefined" != typeof TextEncoder) return (new TextEncoder).encode(e);
|
2882
|
-
for (var i = new
|
2759
|
+
for (var i = new _i(e.length + (e.length >>> 1)), r = 0, s = function(e) {
|
2883
2760
|
i[r++] = e;
|
2884
2761
|
}, o = 0; o < n; ++o) {
|
2885
2762
|
if (r + 5 > i.length) {
|
2886
|
-
var a = new
|
2763
|
+
var a = new _i(r + 8 + (n - o << 1));
|
2887
2764
|
a.set(i), i = a;
|
2888
2765
|
}
|
2889
2766
|
var u = e.charCodeAt(o);
|
@@ -2891,22 +2768,22 @@ var Yi = !!D || !!q, Ji = "text/plain", Ki = function(e, n) {
|
|
2891
2768
|
s(128 | u >>> 12 & 63), s(128 | u >>> 6 & 63), s(128 | 63 & u)) : (s(224 | u >>> 12),
|
2892
2769
|
s(128 | u >>> 6 & 63), s(128 | 63 & u));
|
2893
2770
|
}
|
2894
|
-
return
|
2771
|
+
return Di(i, 0, r);
|
2895
2772
|
}(JSON.stringify(t)), {
|
2896
2773
|
mtime: 0
|
2897
2774
|
});
|
2898
2775
|
return {
|
2899
|
-
contentType:
|
2776
|
+
contentType: Zi,
|
2900
2777
|
body: new Blob([ i ], {
|
2901
|
-
type:
|
2778
|
+
type: Zi
|
2902
2779
|
})
|
2903
2780
|
};
|
2904
2781
|
}
|
2905
|
-
if (n ===
|
2782
|
+
if (n === ne.Base64) {
|
2906
2783
|
var r = function(e) {
|
2907
2784
|
var t, n, i, r, s, o = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", a = 0, u = 0, l = "", c = [];
|
2908
2785
|
if (!e) return e;
|
2909
|
-
e =
|
2786
|
+
e = ie(e);
|
2910
2787
|
do {
|
2911
2788
|
t = (s = e.charCodeAt(a++) << 16 | e.charCodeAt(a++) << 8 | e.charCodeAt(a++)) >> 18 & 63,
|
2912
2789
|
n = s >> 12 & 63, i = s >> 6 & 63, r = 63 & s, c[u++] = o.charAt(t) + o.charAt(n) + o.charAt(i) + o.charAt(r);
|
@@ -2923,7 +2800,7 @@ var Yi = !!D || !!q, Ji = "text/plain", Ki = function(e, n) {
|
|
2923
2800
|
}(JSON.stringify(t));
|
2924
2801
|
return {
|
2925
2802
|
contentType: "application/x-www-form-urlencoded",
|
2926
|
-
body:
|
2803
|
+
body: tr(r)
|
2927
2804
|
};
|
2928
2805
|
}
|
2929
2806
|
return {
|
@@ -2931,11 +2808,11 @@ var Yi = !!D || !!q, Ji = "text/plain", Ki = function(e, n) {
|
|
2931
2808
|
body: JSON.stringify(t)
|
2932
2809
|
};
|
2933
2810
|
}
|
2934
|
-
},
|
2935
|
-
var t, n = new
|
2811
|
+
}, ir = function(e) {
|
2812
|
+
var t, n = new L;
|
2936
2813
|
n.open(e.method || "GET", e.url, !0);
|
2937
|
-
var i = null !== (t =
|
2938
|
-
|
2814
|
+
var i = null !== (t = nr(e)) && void 0 !== t ? t : {}, r = i.contentType, s = i.body;
|
2815
|
+
G(e.headers, (function(e, t) {
|
2939
2816
|
n.setRequestHeader(t, e);
|
2940
2817
|
})), r && n.setRequestHeader("Content-Type", r), e.timeout && (n.timeout = e.timeout),
|
2941
2818
|
n.withCredentials = !0, n.onreadystatechange = function() {
|
@@ -2950,14 +2827,14 @@ var Yi = !!D || !!q, Ji = "text/plain", Ki = function(e, n) {
|
|
2950
2827
|
null === (t = e.callback) || void 0 === t || t.call(e, i);
|
2951
2828
|
}
|
2952
2829
|
}, n.send(s);
|
2953
|
-
},
|
2954
|
-
var t, n, i = null !== (t =
|
2955
|
-
|
2830
|
+
}, rr = function(e) {
|
2831
|
+
var t, n, i = null !== (t = nr(e)) && void 0 !== t ? t : {}, r = i.contentType, s = i.body, o = new Headers;
|
2832
|
+
G(o, (function(e, t) {
|
2956
2833
|
o.append(t, e);
|
2957
2834
|
})), r && o.append("Content-Type", r);
|
2958
2835
|
var a = e.url, u = null;
|
2959
|
-
if (
|
2960
|
-
var l = new
|
2836
|
+
if (N) {
|
2837
|
+
var l = new N;
|
2961
2838
|
u = {
|
2962
2839
|
signal: l.signal,
|
2963
2840
|
timeout: setTimeout((function() {
|
@@ -2965,7 +2842,7 @@ var Yi = !!D || !!q, Ji = "text/plain", Ki = function(e, n) {
|
|
2965
2842
|
}), e.timeout)
|
2966
2843
|
};
|
2967
2844
|
}
|
2968
|
-
|
2845
|
+
D(a, {
|
2969
2846
|
method: (null == e ? void 0 : e.method) || "GET",
|
2970
2847
|
headers: o,
|
2971
2848
|
keepalive: "POST" === e.method,
|
@@ -2980,30 +2857,30 @@ var Yi = !!D || !!q, Ji = "text/plain", Ki = function(e, n) {
|
|
2980
2857
|
if (200 === t.status) try {
|
2981
2858
|
r.json = JSON.parse(n);
|
2982
2859
|
} catch (e) {
|
2983
|
-
|
2860
|
+
U.error(e);
|
2984
2861
|
}
|
2985
2862
|
null === (i = e.callback) || void 0 === i || i.call(e, r);
|
2986
2863
|
}));
|
2987
2864
|
})).catch((function(t) {
|
2988
2865
|
var n;
|
2989
|
-
|
2866
|
+
U.error(t), null === (n = e.callback) || void 0 === n || n.call(e, {
|
2990
2867
|
statusCode: 0,
|
2991
2868
|
text: t
|
2992
2869
|
});
|
2993
2870
|
})).finally((function() {
|
2994
2871
|
return u ? clearTimeout(u.timeout) : null;
|
2995
2872
|
}));
|
2996
|
-
},
|
2997
|
-
var t =
|
2873
|
+
}, sr = function(e) {
|
2874
|
+
var t = er(e.url, {
|
2998
2875
|
beacon: "1"
|
2999
2876
|
});
|
3000
2877
|
try {
|
3001
|
-
var n, i = null !== (n =
|
2878
|
+
var n, i = null !== (n = nr(e)) && void 0 !== n ? n : {}, r = i.contentType, s = i.body, o = "string" == typeof s ? new Blob([ s ], {
|
3002
2879
|
type: r
|
3003
2880
|
}) : s;
|
3004
|
-
|
2881
|
+
M.sendBeacon(t, o);
|
3005
2882
|
} catch (e) {}
|
3006
|
-
},
|
2883
|
+
}, or = function(e) {
|
3007
2884
|
var t;
|
3008
2885
|
if (O) {
|
3009
2886
|
var n = O.createElement("script");
|
@@ -3011,24 +2888,24 @@ var Yi = !!D || !!q, Ji = "text/plain", Ki = function(e, n) {
|
|
3011
2888
|
var i = O.getElementsByTagName("script")[0];
|
3012
2889
|
null === (t = i.parentNode) || void 0 === t || t.insertBefore(n, i);
|
3013
2890
|
}
|
3014
|
-
},
|
2891
|
+
}, ar = [ "retriesPerformedSoFar" ];
|
3015
2892
|
|
3016
|
-
var
|
2893
|
+
var ur, lr = function() {
|
3017
2894
|
function e(t) {
|
3018
2895
|
var n = this;
|
3019
2896
|
i(this, e), o(this, "isPolling", !1), o(this, "pollIntervalMs", 3e3), o(this, "queue", []),
|
3020
|
-
this.instance = t, this.queue = [], this.areWeOnline = !0, !w(
|
3021
|
-
|
2897
|
+
this.instance = t, this.queue = [], this.areWeOnline = !0, !w(I) && "onLine" in I.navigator && (this.areWeOnline = I.navigator.onLine,
|
2898
|
+
I.addEventListener("online", (function() {
|
3022
2899
|
n.areWeOnline = !0, n.flush();
|
3023
|
-
})),
|
2900
|
+
})), I.addEventListener("offline", (function() {
|
3024
2901
|
n.areWeOnline = !1;
|
3025
2902
|
})));
|
3026
2903
|
}
|
3027
2904
|
return s(e, [ {
|
3028
2905
|
key: "retriableRequest",
|
3029
2906
|
value: function(e) {
|
3030
|
-
var n = this, i = e.retriesPerformedSoFar, r = a(e,
|
3031
|
-
|
2907
|
+
var n = this, i = e.retriesPerformedSoFar, r = a(e, ar);
|
2908
|
+
P(i) && i > 0 && (r.url = er(r.url, {
|
3032
2909
|
retry_count: i
|
3033
2910
|
})), this.instance._send_request(t(t({}, r), {}, {
|
3034
2911
|
callback: function(e) {
|
@@ -3051,7 +2928,7 @@ var sr, or = function() {
|
|
3051
2928
|
requestOptions: e
|
3052
2929
|
});
|
3053
2930
|
var r = "Enqueued failed request for retry in ".concat(n);
|
3054
|
-
navigator.onLine || (r += " (Browser is offline)"),
|
2931
|
+
navigator.onLine || (r += " (Browser is offline)"), U.warn(r), this.isPolling || (this.isPolling = !0,
|
3055
2932
|
this.poll());
|
3056
2933
|
}
|
3057
2934
|
}, {
|
@@ -3095,7 +2972,7 @@ var sr, or = function() {
|
|
3095
2972
|
transport: "sendBeacon"
|
3096
2973
|
}));
|
3097
2974
|
} catch (e) {
|
3098
|
-
|
2975
|
+
U.error(e);
|
3099
2976
|
}
|
3100
2977
|
}
|
3101
2978
|
} catch (e) {
|
@@ -3106,18 +2983,18 @@ var sr, or = function() {
|
|
3106
2983
|
this.queue = [];
|
3107
2984
|
}
|
3108
2985
|
} ]), e;
|
3109
|
-
}(),
|
2986
|
+
}(), cr = 1800, dr = function() {
|
3110
2987
|
function e(t, n, r, s) {
|
3111
2988
|
i(this, e), o(this, "_sessionIdChangedHandlers", []), this.config = t, this.persistence = n,
|
3112
2989
|
this._windowId = void 0, this._sessionId = void 0, this._sessionStartTimestamp = null,
|
3113
|
-
this._sessionActivityTimestamp = null, this._sessionIdGenerator = r ||
|
3114
|
-
var a = t.persistence_name || t.token, u = t.session_idle_timeout_seconds ||
|
3115
|
-
if (
|
3116
|
-
u =
|
2990
|
+
this._sessionActivityTimestamp = null, this._sessionIdGenerator = r || je, this._windowIdGenerator = s || je;
|
2991
|
+
var a = t.persistence_name || t.token, u = t.session_idle_timeout_seconds || cr;
|
2992
|
+
if (P(u) ? u > cr ? U.warn("session_idle_timeout_seconds cannot be greater than 30 minutes. Using 30 minutes instead.") : u < 60 && U.warn("session_idle_timeout_seconds cannot be less than 60 seconds. Using 60 seconds instead.") : (U.warn("session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),
|
2993
|
+
u = cr), this._sessionTimeoutMs = 1e3 * Math.min(Math.max(u, 60), cr), this._window_id_storage_key = "ph_" + a + "_window_id",
|
3117
2994
|
this._primary_window_exists_storage_key = "ph_" + a + "_primary_window_exists",
|
3118
2995
|
this._canUseSessionStorage()) {
|
3119
|
-
var l =
|
3120
|
-
l && !c ? this._windowId = l :
|
2996
|
+
var l = it.parse(this._window_id_storage_key), c = it.parse(this._primary_window_exists_storage_key);
|
2997
|
+
l && !c ? this._windowId = l : it.remove(this._window_id_storage_key), it.set(this._primary_window_exists_storage_key, !0);
|
3121
2998
|
}
|
3122
2999
|
this._listenToReloadWindow();
|
3123
3000
|
}
|
@@ -3136,29 +3013,29 @@ var sr, or = function() {
|
|
3136
3013
|
}, {
|
3137
3014
|
key: "_canUseSessionStorage",
|
3138
3015
|
value: function() {
|
3139
|
-
return "memory" !== this.config.persistence && !this.persistence.disabled &&
|
3016
|
+
return "memory" !== this.config.persistence && !this.persistence.disabled && it.is_supported();
|
3140
3017
|
}
|
3141
3018
|
}, {
|
3142
3019
|
key: "_setWindowId",
|
3143
3020
|
value: function(e) {
|
3144
|
-
e !== this._windowId && (this._windowId = e, this._canUseSessionStorage() &&
|
3021
|
+
e !== this._windowId && (this._windowId = e, this._canUseSessionStorage() && it.set(this._window_id_storage_key, e));
|
3145
3022
|
}
|
3146
3023
|
}, {
|
3147
3024
|
key: "_getWindowId",
|
3148
3025
|
value: function() {
|
3149
|
-
return this._windowId ? this._windowId : this._canUseSessionStorage() ?
|
3026
|
+
return this._windowId ? this._windowId : this._canUseSessionStorage() ? it.parse(this._window_id_storage_key) : null;
|
3150
3027
|
}
|
3151
3028
|
}, {
|
3152
3029
|
key: "_setSessionId",
|
3153
3030
|
value: function(e, t, n) {
|
3154
3031
|
e === this._sessionId && t === this._sessionActivityTimestamp && n === this._sessionStartTimestamp || (this._sessionStartTimestamp = n,
|
3155
|
-
this._sessionActivityTimestamp = t, this._sessionId = e, this.persistence.register(o({},
|
3032
|
+
this._sessionActivityTimestamp = t, this._sessionId = e, this.persistence.register(o({}, ve, [ t, e, n ])));
|
3156
3033
|
}
|
3157
3034
|
}, {
|
3158
3035
|
key: "_getSessionId",
|
3159
3036
|
value: function() {
|
3160
3037
|
if (this._sessionId && this._sessionActivityTimestamp && this._sessionStartTimestamp) return [ this._sessionActivityTimestamp, this._sessionId, this._sessionStartTimestamp ];
|
3161
|
-
var e = this.persistence.props[
|
3038
|
+
var e = this.persistence.props[ve];
|
3162
3039
|
return m(e) && 2 === e.length && e.push(e[0]), e || [ 0, null, 0 ];
|
3163
3040
|
}
|
3164
3041
|
}, {
|
@@ -3170,15 +3047,15 @@ var sr, or = function() {
|
|
3170
3047
|
key: "_listenToReloadWindow",
|
3171
3048
|
value: function() {
|
3172
3049
|
var e = this;
|
3173
|
-
null ==
|
3174
|
-
e._canUseSessionStorage() &&
|
3050
|
+
null == I || I.addEventListener("beforeunload", (function() {
|
3051
|
+
e._canUseSessionStorage() && it.remove(e._primary_window_exists_storage_key);
|
3175
3052
|
}));
|
3176
3053
|
}
|
3177
3054
|
}, {
|
3178
3055
|
key: "checkAndGetSessionAndWindowId",
|
3179
3056
|
value: function() {
|
3180
3057
|
var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0], t = (arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null) || (new Date).getTime(), n = u(this._getSessionId(), 3), i = n[0], r = n[1], s = n[2], o = this._getWindowId(), a = s && s > 0 && Math.abs(t - s) > 864e5, l = !1, c = !r, d = !e && Math.abs(t - i) > this._sessionTimeoutMs;
|
3181
|
-
c || d || a ? (r = this._sessionIdGenerator(), o = this._windowIdGenerator(),
|
3058
|
+
c || d || a ? (r = this._sessionIdGenerator(), o = this._windowIdGenerator(), U.info("[SessionId] new session ID generated", {
|
3182
3059
|
sessionId: r,
|
3183
3060
|
windowId: o,
|
3184
3061
|
changeReason: {
|
@@ -3201,9 +3078,9 @@ var sr, or = function() {
|
|
3201
3078
|
|
3202
3079
|
!function(e) {
|
3203
3080
|
e.US = "us", e.EU = "eu", e.CUSTOM = "custom";
|
3204
|
-
}(
|
3081
|
+
}(ur || (ur = {}));
|
3205
3082
|
|
3206
|
-
var
|
3083
|
+
var hr = "i.posthog.com", fr = function() {
|
3207
3084
|
function e(t) {
|
3208
3085
|
i(this, e), o(this, "_regionCache", {}), this.instance = t;
|
3209
3086
|
}
|
@@ -3221,16 +3098,16 @@ var lr = function() {
|
|
3221
3098
|
}, {
|
3222
3099
|
key: "region",
|
3223
3100
|
get: function() {
|
3224
|
-
return this._regionCache[this.apiHost] || (/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost) ? this._regionCache[this.apiHost] =
|
3101
|
+
return this._regionCache[this.apiHost] || (/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost) ? this._regionCache[this.apiHost] = ur.US : /https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost) ? this._regionCache[this.apiHost] = ur.EU : this._regionCache[this.apiHost] = ur.CUSTOM),
|
3225
3102
|
this._regionCache[this.apiHost];
|
3226
3103
|
}
|
3227
3104
|
}, {
|
3228
3105
|
key: "endpointFor",
|
3229
3106
|
value: function(e) {
|
3230
3107
|
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "";
|
3231
|
-
if (t && (t = "/" === t[0] ? t : "/".concat(t)), "ui" === e) return (this.uiHost || this.apiHost) + t;
|
3232
|
-
if (this.region ===
|
3233
|
-
var n =
|
3108
|
+
if (t && (t = "/" === t[0] ? t : "/".concat(t)), "ui" === e) return (this.uiHost || this.apiHost.replace(".".concat(hr), ".posthog.com")) + t;
|
3109
|
+
if (this.region === ur.CUSTOM) return this.apiHost + t;
|
3110
|
+
var n = hr + t;
|
3234
3111
|
switch (e) {
|
3235
3112
|
case "assets":
|
3236
3113
|
return "https://".concat(this.region, "-assets.").concat(n);
|
@@ -3240,31 +3117,33 @@ var lr = function() {
|
|
3240
3117
|
}
|
3241
3118
|
}
|
3242
3119
|
} ]), e;
|
3243
|
-
}(),
|
3120
|
+
}(), pr = s((function e(t, n, r, s) {
|
3121
|
+
var o = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : [ "error" ];
|
3244
3122
|
i(this, e), this.name = "posthog-js", this.setupOnce = function(e) {
|
3245
3123
|
e((function(e) {
|
3246
|
-
var i,
|
3247
|
-
if ("
|
3124
|
+
var i, a, u, l, c;
|
3125
|
+
if (!("*" === o || o.includes(e.level)) || !t.__loaded) return e;
|
3248
3126
|
e.tags || (e.tags = {});
|
3249
|
-
var
|
3250
|
-
e.tags["PostHog Person URL"] =
|
3127
|
+
var d = t.requestRouter.endpointFor("ui", "/project/".concat(t.config.token, "/person/").concat(t.get_distinct_id()));
|
3128
|
+
e.tags["PostHog Person URL"] = d, t.sessionRecordingStarted() && (e.tags["PostHog Recording URL"] = t.get_session_replay_url({
|
3251
3129
|
withTimestamp: !0
|
3252
3130
|
}));
|
3253
|
-
var
|
3254
|
-
$exception_message: null === (
|
3255
|
-
$exception_type: null === (
|
3256
|
-
$exception_personURL:
|
3131
|
+
var h = (null === (i = e.exception) || void 0 === i ? void 0 : i.values) || [], f = {
|
3132
|
+
$exception_message: (null === (a = h[0]) || void 0 === a ? void 0 : a.value) || e.message,
|
3133
|
+
$exception_type: null === (u = h[0]) || void 0 === u ? void 0 : u.type,
|
3134
|
+
$exception_personURL: d,
|
3257
3135
|
$sentry_event_id: e.event_id,
|
3258
3136
|
$sentry_exception: e.exception,
|
3259
|
-
$sentry_exception_message: null === (
|
3260
|
-
$sentry_exception_type: null === (
|
3261
|
-
$sentry_tags: e.tags
|
3137
|
+
$sentry_exception_message: (null === (l = h[0]) || void 0 === l ? void 0 : l.value) || e.message,
|
3138
|
+
$sentry_exception_type: null === (c = h[0]) || void 0 === c ? void 0 : c.type,
|
3139
|
+
$sentry_tags: e.tags,
|
3140
|
+
$level: e.level
|
3262
3141
|
};
|
3263
|
-
return n && r && (
|
3264
|
-
t.capture("$exception",
|
3142
|
+
return n && r && (f.$sentry_url = (s || "https://sentry.io/organizations/") + n + "/issues/?project=" + r + "&query=" + e.event_id),
|
3143
|
+
t.capture("$exception", f), e;
|
3265
3144
|
}));
|
3266
3145
|
};
|
3267
|
-
})),
|
3146
|
+
})), gr = function() {
|
3268
3147
|
function e(t) {
|
3269
3148
|
var n = this;
|
3270
3149
|
i(this, e), o(this, "_hasSeenPageView", !1), o(this, "_updateScrollData", (function() {
|
@@ -3282,7 +3161,7 @@ var lr = function() {
|
|
3282
3161
|
value: function() {
|
3283
3162
|
var e;
|
3284
3163
|
return {
|
3285
|
-
pathname: null !== (e = null ==
|
3164
|
+
pathname: null !== (e = null == I ? void 0 : I.location.pathname) && void 0 !== e ? e : ""
|
3286
3165
|
};
|
3287
3166
|
}
|
3288
3167
|
}, {
|
@@ -3311,35 +3190,35 @@ var lr = function() {
|
|
3311
3190
|
return t = Math.ceil(t), n = Math.ceil(n), i = Math.ceil(i), r = Math.ceil(r), s = Math.ceil(s),
|
3312
3191
|
o = Math.ceil(o), {
|
3313
3192
|
$prev_pageview_last_scroll: n,
|
3314
|
-
$prev_pageview_last_scroll_percentage: t <= 1 ? 1 :
|
3193
|
+
$prev_pageview_last_scroll_percentage: t <= 1 ? 1 : vr(n / t, 0, 1),
|
3315
3194
|
$prev_pageview_max_scroll: i,
|
3316
|
-
$prev_pageview_max_scroll_percentage: t <= 1 ? 1 :
|
3195
|
+
$prev_pageview_max_scroll_percentage: t <= 1 ? 1 : vr(i / t, 0, 1),
|
3317
3196
|
$prev_pageview_last_content: s,
|
3318
|
-
$prev_pageview_last_content_percentage: r <= 1 ? 1 :
|
3197
|
+
$prev_pageview_last_content_percentage: r <= 1 ? 1 : vr(s / r, 0, 1),
|
3319
3198
|
$prev_pageview_max_content: o,
|
3320
|
-
$prev_pageview_max_content_percentage: r <= 1 ? 1 :
|
3199
|
+
$prev_pageview_max_content_percentage: r <= 1 ? 1 : vr(o / r, 0, 1)
|
3321
3200
|
};
|
3322
3201
|
}
|
3323
3202
|
}, {
|
3324
3203
|
key: "startMeasuringScrollPosition",
|
3325
3204
|
value: function() {
|
3326
|
-
null ==
|
3327
|
-
null ==
|
3205
|
+
null == I || I.addEventListener("scroll", this._updateScrollData, !0), null == I || I.addEventListener("scrollend", this._updateScrollData, !0),
|
3206
|
+
null == I || I.addEventListener("resize", this._updateScrollData);
|
3328
3207
|
}
|
3329
3208
|
}, {
|
3330
3209
|
key: "stopMeasuringScrollPosition",
|
3331
3210
|
value: function() {
|
3332
|
-
null ==
|
3333
|
-
null ==
|
3211
|
+
null == I || I.removeEventListener("scroll", this._updateScrollData), null == I || I.removeEventListener("scrollend", this._updateScrollData),
|
3212
|
+
null == I || I.removeEventListener("resize", this._updateScrollData);
|
3334
3213
|
}
|
3335
3214
|
}, {
|
3336
3215
|
key: "_scrollElement",
|
3337
3216
|
value: function() {
|
3338
|
-
if (!this._instance.config.scroll_root_selector) return null ==
|
3217
|
+
if (!this._instance.config.scroll_root_selector) return null == I ? void 0 : I.document.documentElement;
|
3339
3218
|
var e, t = h(m(this._instance.config.scroll_root_selector) ? this._instance.config.scroll_root_selector : [ this._instance.config.scroll_root_selector ]);
|
3340
3219
|
try {
|
3341
3220
|
for (t.s(); !(e = t.n()).done; ) {
|
3342
|
-
var n = e.value, i = null ==
|
3221
|
+
var n = e.value, i = null == I ? void 0 : I.document.querySelector(n);
|
3343
3222
|
if (i) return i;
|
3344
3223
|
}
|
3345
3224
|
} catch (e) {
|
@@ -3361,7 +3240,7 @@ var lr = function() {
|
|
3361
3240
|
var e = this._scrollElement();
|
3362
3241
|
return e && e.scrollTop || 0;
|
3363
3242
|
}
|
3364
|
-
return
|
3243
|
+
return I && (I.scrollY || I.pageYOffset || I.document.documentElement.scrollTop) || 0;
|
3365
3244
|
}
|
3366
3245
|
}, {
|
3367
3246
|
key: "_contentHeight",
|
@@ -3378,28 +3257,30 @@ var lr = function() {
|
|
3378
3257
|
} ]), e;
|
3379
3258
|
}();
|
3380
3259
|
|
3381
|
-
function
|
3260
|
+
function vr(e, t, n) {
|
3382
3261
|
return Math.max(t, Math.min(e, n));
|
3383
3262
|
}
|
3384
3263
|
|
3385
|
-
var
|
3264
|
+
var _r = {
|
3386
3265
|
icontains: function(e) {
|
3387
|
-
return !!
|
3266
|
+
return !!I && I.location.href.toLowerCase().indexOf(e.toLowerCase()) > -1;
|
3388
3267
|
},
|
3389
3268
|
regex: function(e) {
|
3390
|
-
return !!
|
3269
|
+
return !!I && ot(I.location.href, e);
|
3391
3270
|
},
|
3392
3271
|
exact: function(e) {
|
3393
|
-
return (null ==
|
3272
|
+
return (null == I ? void 0 : I.location.href) === e;
|
3394
3273
|
}
|
3395
|
-
},
|
3274
|
+
}, mr = function() {
|
3396
3275
|
function e(t) {
|
3397
3276
|
i(this, e), this.instance = t;
|
3398
3277
|
}
|
3399
3278
|
return s(e, [ {
|
3400
3279
|
key: "getSurveys",
|
3401
3280
|
value: function(e) {
|
3402
|
-
var t = this, n = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]
|
3281
|
+
var t = this, n = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
|
3282
|
+
if (this.instance.config.disable_surveys) return e([]);
|
3283
|
+
var i = this.instance.get_property(we);
|
3403
3284
|
if (i && !n) return e(i);
|
3404
3285
|
this.instance._send_request({
|
3405
3286
|
url: this.instance.requestRouter.endpointFor("api", "/api/surveys/?token=".concat(this.instance.config.token)),
|
@@ -3409,7 +3290,7 @@ var fr = {
|
|
3409
3290
|
var i;
|
3410
3291
|
if (200 !== n.statusCode || !n.json) return e([]);
|
3411
3292
|
var r = n.json.surveys || [];
|
3412
|
-
return null === (i = t.instance.persistence) || void 0 === i || i.register(o({},
|
3293
|
+
return null === (i = t.instance.persistence) || void 0 === i || i.register(o({}, we, r)),
|
3413
3294
|
e(r);
|
3414
3295
|
}
|
3415
3296
|
});
|
@@ -3424,7 +3305,7 @@ var fr = {
|
|
3424
3305
|
})).filter((function(e) {
|
3425
3306
|
var t, n, i, r;
|
3426
3307
|
if (!e.conditions) return !0;
|
3427
|
-
var s = null === (t = e.conditions) || void 0 === t || !t.url ||
|
3308
|
+
var s = null === (t = e.conditions) || void 0 === t || !t.url || _r[null !== (n = null === (i = e.conditions) || void 0 === i ? void 0 : i.urlMatchType) && void 0 !== n ? n : "icontains"](e.conditions.url), o = null === (r = e.conditions) || void 0 === r || !r.selector || (null == O ? void 0 : O.querySelector(e.conditions.selector));
|
3428
3309
|
return s && o;
|
3429
3310
|
})).filter((function(e) {
|
3430
3311
|
if (!e.linked_flag_key && !e.targeting_flag_key) return !0;
|
@@ -3435,17 +3316,17 @@ var fr = {
|
|
3435
3316
|
}), n);
|
3436
3317
|
}
|
3437
3318
|
} ]), e;
|
3438
|
-
}(),
|
3319
|
+
}(), yr = function() {
|
3439
3320
|
function e() {
|
3440
3321
|
var t = this;
|
3441
3322
|
i(this, e), o(this, "limits", {}), o(this, "checkForLimiting", (function(e) {
|
3442
3323
|
var n = e.text;
|
3443
3324
|
if (n && n.length) try {
|
3444
3325
|
(JSON.parse(n).quota_limited || []).forEach((function(e) {
|
3445
|
-
|
3326
|
+
U.info("[RateLimiter] ".concat(e || "events", " is quota limited.")), t.limits[e] = (new Date).getTime() + 6e4;
|
3446
3327
|
}));
|
3447
3328
|
} catch (e) {
|
3448
|
-
return void
|
3329
|
+
return void U.warn('[RateLimiter] could not rate limit - continuing. Error: "'.concat(null == e ? void 0 : e.message, '"'), {
|
3449
3330
|
text: n
|
3450
3331
|
});
|
3451
3332
|
}
|
@@ -3458,12 +3339,12 @@ var fr = {
|
|
3458
3339
|
return !1 !== t && (new Date).getTime() < t;
|
3459
3340
|
}
|
3460
3341
|
} ]), e;
|
3461
|
-
}(),
|
3342
|
+
}(), br = function() {
|
3462
3343
|
return t({
|
3463
|
-
initialPathName: (null ==
|
3464
|
-
referringDomain:
|
3465
|
-
},
|
3466
|
-
},
|
3344
|
+
initialPathName: (null == A ? void 0 : A.pathname) || "",
|
3345
|
+
referringDomain: un.referringDomain()
|
3346
|
+
}, un.campaignParams());
|
3347
|
+
}, kr = function() {
|
3467
3348
|
function e(t, n, r) {
|
3468
3349
|
var s = this;
|
3469
3350
|
i(this, e), o(this, "_onSessionIdCallback", (function(e) {
|
@@ -3473,15 +3354,15 @@ var fr = {
|
|
3473
3354
|
sessionId: e,
|
3474
3355
|
props: s._sessionSourceParamGenerator()
|
3475
3356
|
};
|
3476
|
-
s._persistence.register(o({},
|
3357
|
+
s._persistence.register(o({}, Pe, n));
|
3477
3358
|
}
|
3478
|
-
})), this._sessionIdManager = t, this._persistence = n, this._sessionSourceParamGenerator = r ||
|
3359
|
+
})), this._sessionIdManager = t, this._persistence = n, this._sessionSourceParamGenerator = r || br,
|
3479
3360
|
this._sessionIdManager.onSessionId(this._onSessionIdCallback);
|
3480
3361
|
}
|
3481
3362
|
return s(e, [ {
|
3482
3363
|
key: "_getStoredProps",
|
3483
3364
|
value: function() {
|
3484
|
-
return this._persistence.props[
|
3365
|
+
return this._persistence.props[Pe];
|
3485
3366
|
}
|
3486
3367
|
}, {
|
3487
3368
|
key: "getSessionProps",
|
@@ -3498,43 +3379,256 @@ var fr = {
|
|
3498
3379
|
} : {};
|
3499
3380
|
}
|
3500
3381
|
} ]), e;
|
3501
|
-
}(),
|
3382
|
+
}(), wr = [ "ahrefsbot", "ahrefssiteaudit", "applebot", "baiduspider", "bingbot", "bingpreview", "bot.htm", "bot.php", "crawler", "duckduckbot", "facebookexternal", "facebookcatalog", "gptbot", "http://yandex.com/bots", "hubspot", "ia_archiver", "linkedinbot", "mj12bot", "msnbot", "nessus", "petalbot", "pinterest", "prerender", "rogerbot", "screaming frog", "semrushbot", "sitebulb", "slurp", "turnitin", "twitterbot", "vercelbot", "yahoo! slurp", "yandexbot", "adsbot-google", "apis-google", "duplexweb-google", "feedfetcher-google", "google favicon", "google web preview", "google-read-aloud", "googlebot", "googleweblight", "mediapartners-google", "storebot-google", "Bytespider;" ], Sr = function(e, t) {
|
3502
3383
|
if (!e) return !1;
|
3503
3384
|
var n = e.toLowerCase();
|
3504
|
-
return
|
3385
|
+
return wr.concat(t || []).some((function(e) {
|
3505
3386
|
var t = e.toLowerCase();
|
3506
|
-
return
|
3387
|
+
return -1 !== n.indexOf(t);
|
3507
3388
|
}));
|
3508
|
-
},
|
3389
|
+
}, Fr = function() {
|
3390
|
+
function e() {
|
3391
|
+
i(this, e), o(this, "events", {}), this.events = {};
|
3392
|
+
}
|
3393
|
+
return s(e, [ {
|
3394
|
+
key: "on",
|
3395
|
+
value: function(e, t) {
|
3396
|
+
var n = this;
|
3397
|
+
return this.events[e] || (this.events[e] = []), this.events[e].push(t), function() {
|
3398
|
+
n.events[e] = n.events[e].filter((function(e) {
|
3399
|
+
return e !== t;
|
3400
|
+
}));
|
3401
|
+
};
|
3402
|
+
}
|
3403
|
+
}, {
|
3404
|
+
key: "emit",
|
3405
|
+
value: function(e, t) {
|
3406
|
+
var n, i = h(this.events[e] || []);
|
3407
|
+
try {
|
3408
|
+
for (i.s(); !(n = i.n()).done; ) {
|
3409
|
+
(0, n.value)(t);
|
3410
|
+
}
|
3411
|
+
} catch (e) {
|
3412
|
+
i.e(e);
|
3413
|
+
} finally {
|
3414
|
+
i.f();
|
3415
|
+
}
|
3416
|
+
var r, s = h(this.events["*"] || []);
|
3417
|
+
try {
|
3418
|
+
for (s.s(); !(r = s.n()).done; ) {
|
3419
|
+
(0, r.value)(e, t);
|
3420
|
+
}
|
3421
|
+
} catch (e) {
|
3422
|
+
s.e(e);
|
3423
|
+
} finally {
|
3424
|
+
s.f();
|
3425
|
+
}
|
3426
|
+
}
|
3427
|
+
} ]), e;
|
3428
|
+
}(), Rr = function() {
|
3429
|
+
function e() {
|
3430
|
+
i(this, e), this.clicks = [];
|
3431
|
+
}
|
3432
|
+
return s(e, [ {
|
3433
|
+
key: "isRageClick",
|
3434
|
+
value: function(e, t, n) {
|
3435
|
+
var i = this.clicks[this.clicks.length - 1];
|
3436
|
+
if (i && Math.abs(e - i.x) + Math.abs(t - i.y) < 30 && n - i.timestamp < 1e3) {
|
3437
|
+
if (this.clicks.push({
|
3438
|
+
x: e,
|
3439
|
+
y: t,
|
3440
|
+
timestamp: n
|
3441
|
+
}), 3 === this.clicks.length) return !0;
|
3442
|
+
} else this.clicks = [ {
|
3443
|
+
x: e,
|
3444
|
+
y: t,
|
3445
|
+
timestamp: n
|
3446
|
+
} ];
|
3447
|
+
return !1;
|
3448
|
+
}
|
3449
|
+
} ]), e;
|
3450
|
+
}(), Pr = "$copy_autocapture";
|
3451
|
+
|
3452
|
+
function xr(e, t) {
|
3453
|
+
return t.length > e ? t.slice(0, e) + "..." : t;
|
3454
|
+
}
|
3455
|
+
|
3456
|
+
var Er = function() {
|
3457
|
+
function e(t) {
|
3458
|
+
i(this, e), o(this, "_initialized", !1), o(this, "_isDisabledServerSide", null),
|
3459
|
+
o(this, "rageclicks", new Rr), o(this, "_elementsChainAsString", !1), this.instance = t;
|
3460
|
+
}
|
3461
|
+
return s(e, [ {
|
3462
|
+
key: "config",
|
3463
|
+
get: function() {
|
3464
|
+
var e, t = b(this.instance.config.autocapture) ? this.instance.config.autocapture : {};
|
3465
|
+
return t.url_allowlist = null === (e = t.url_allowlist) || void 0 === e ? void 0 : e.map((function(e) {
|
3466
|
+
return new RegExp(e);
|
3467
|
+
})), t;
|
3468
|
+
}
|
3469
|
+
}, {
|
3470
|
+
key: "_addDomEventHandlers",
|
3471
|
+
value: function() {
|
3472
|
+
var e = this;
|
3473
|
+
if (this.isBrowserSupported()) {
|
3474
|
+
if (I && O) {
|
3475
|
+
var t = function(t) {
|
3476
|
+
t = t || (null == I ? void 0 : I.event);
|
3477
|
+
try {
|
3478
|
+
e._captureEvent(t);
|
3479
|
+
} catch (e) {
|
3480
|
+
U.error("Failed to capture event", e);
|
3481
|
+
}
|
3482
|
+
}, n = function(t) {
|
3483
|
+
t = t || (null == I ? void 0 : I.event), e._captureEvent(t, Pr);
|
3484
|
+
};
|
3485
|
+
re(O, "submit", t, !1, !0), re(O, "change", t, !1, !0), re(O, "click", t, !1, !0),
|
3486
|
+
this.config.capture_copied_text && (re(O, "copy", n, !1, !0), re(O, "cut", n, !1, !0));
|
3487
|
+
}
|
3488
|
+
} else U.info("Disabling Automatic Event Collection because this browser is not supported");
|
3489
|
+
}
|
3490
|
+
}, {
|
3491
|
+
key: "afterDecideResponse",
|
3492
|
+
value: function(e) {
|
3493
|
+
this._initialized ? U.info("autocapture already initialized") : (this.instance.persistence && this.instance.persistence.register(o({}, le, !!e.autocapture_opt_out)),
|
3494
|
+
this._isDisabledServerSide = !!e.autocapture_opt_out, e.elementsChainAsString && (this._elementsChainAsString = e.elementsChainAsString),
|
3495
|
+
this.isEnabled && (this._addDomEventHandlers(), this._initialized = !0));
|
3496
|
+
}
|
3497
|
+
}, {
|
3498
|
+
key: "isEnabled",
|
3499
|
+
get: function() {
|
3500
|
+
var e, t = F(this._isDisabledServerSide) ? !(null === (e = this.instance.persistence) || void 0 === e || !e.props[le]) : this._isDisabledServerSide;
|
3501
|
+
return !!this.instance.config.autocapture && !t;
|
3502
|
+
}
|
3503
|
+
}, {
|
3504
|
+
key: "_previousElementSibling",
|
3505
|
+
value: function(e) {
|
3506
|
+
if (e.previousElementSibling) return e.previousElementSibling;
|
3507
|
+
var t = e;
|
3508
|
+
do {
|
3509
|
+
t = t.previousSibling;
|
3510
|
+
} while (t && !yn(t));
|
3511
|
+
return t;
|
3512
|
+
}
|
3513
|
+
}, {
|
3514
|
+
key: "_getAugmentPropertiesFromElement",
|
3515
|
+
value: function(e) {
|
3516
|
+
if (!Pn(e)) return {};
|
3517
|
+
var t = {};
|
3518
|
+
return G(e.attributes, (function(e) {
|
3519
|
+
if (e.name && 0 === e.name.indexOf("data-ph-capture-attribute")) {
|
3520
|
+
var n = e.name.replace("data-ph-capture-attribute-", ""), i = e.value;
|
3521
|
+
n && i && Mn(i) && (t[n] = i);
|
3522
|
+
}
|
3523
|
+
})), t;
|
3524
|
+
}
|
3525
|
+
}, {
|
3526
|
+
key: "_getPropertiesFromElement",
|
3527
|
+
value: function(e, t, n) {
|
3528
|
+
var i, r = e.tagName.toLowerCase(), s = {
|
3529
|
+
tag_name: r
|
3530
|
+
};
|
3531
|
+
Sn.indexOf(r) > -1 && !n && ("a" === r.toLowerCase() || "button" === r.toLowerCase() ? s.$el_text = xr(1024, On(e)) : s.$el_text = xr(1024, mn(e)));
|
3532
|
+
var o = vn(e);
|
3533
|
+
o.length > 0 && (s.classes = o.filter((function(e) {
|
3534
|
+
return "" !== e;
|
3535
|
+
})));
|
3536
|
+
var a = null === (i = this.config) || void 0 === i ? void 0 : i.element_attribute_ignorelist;
|
3537
|
+
G(e.attributes, (function(n) {
|
3538
|
+
var i;
|
3539
|
+
if ((!xn(e) || -1 !== [ "name", "id", "class", "aria-label" ].indexOf(n.name)) && ((null == a || !a.includes(n.name)) && !t && Mn(n.value) && (i = n.name,
|
3540
|
+
!S(i) || "_ngcontent" !== i.substring(0, 10) && "_nghost" !== i.substring(0, 7)))) {
|
3541
|
+
var r = n.value;
|
3542
|
+
"class" === n.name && (r = gn(r).join(" ")), s["attr__" + n.name] = xr(1024, r);
|
3543
|
+
}
|
3544
|
+
}));
|
3545
|
+
for (var u = 1, l = 1, c = e; c = this._previousElementSibling(c); ) u++, c.tagName === e.tagName && l++;
|
3546
|
+
return s.nth_child = u, s.nth_of_type = l, s;
|
3547
|
+
}
|
3548
|
+
}, {
|
3549
|
+
key: "_getDefaultProperties",
|
3550
|
+
value: function(e) {
|
3551
|
+
return {
|
3552
|
+
$event_type: e,
|
3553
|
+
$ce_version: 1
|
3554
|
+
};
|
3555
|
+
}
|
3556
|
+
}, {
|
3557
|
+
key: "_getEventTarget",
|
3558
|
+
value: function(e) {
|
3559
|
+
return w(e.target) ? e.srcElement || null : null !== (t = e.target) && void 0 !== t && t.shadowRoot ? e.composedPath()[0] || null : e.target || null;
|
3560
|
+
var t;
|
3561
|
+
}
|
3562
|
+
}, {
|
3563
|
+
key: "_captureEvent",
|
3564
|
+
value: function(e) {
|
3565
|
+
var t, n = this, i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "$autocapture", r = this._getEventTarget(e);
|
3566
|
+
(kn(r) && (r = r.parentNode || null), "$autocapture" === i && "click" === e.type && e instanceof MouseEvent) && (this.instance.config.rageclick && null !== (t = this.rageclicks) && void 0 !== t && t.isRageClick(e.clientX, e.clientY, (new Date).getTime()) && this._captureEvent(e, "$rageclick"));
|
3567
|
+
var s = i === Pr;
|
3568
|
+
if (r && Rn(r, e, this.config, s, s ? [ "copy", "cut" ] : void 0)) {
|
3569
|
+
for (var o, a, u = [ r ], l = r; l.parentNode && !bn(l, "body"); ) wn(l.parentNode) ? (u.push(l.parentNode.host),
|
3570
|
+
l = l.parentNode.host) : (u.push(l.parentNode), l = l.parentNode);
|
3571
|
+
var c, d = [], h = {}, f = !1;
|
3572
|
+
if (G(u, (function(e) {
|
3573
|
+
var t = Pn(e);
|
3574
|
+
"a" === e.tagName.toLowerCase() && (c = e.getAttribute("href"), c = t && Mn(c) && c),
|
3575
|
+
Y(vn(e), "ph-no-capture") && (f = !0), d.push(n._getPropertiesFromElement(e, n.instance.config.mask_all_element_attributes, n.instance.config.mask_all_text));
|
3576
|
+
var i = n._getAugmentPropertiesFromElement(e);
|
3577
|
+
Q(h, i);
|
3578
|
+
})), this.instance.config.mask_all_text || ("a" === r.tagName.toLowerCase() || "button" === r.tagName.toLowerCase() ? d[0].$el_text = On(r) : d[0].$el_text = mn(r)),
|
3579
|
+
c && (d[0].attr__href = c), f) return !1;
|
3580
|
+
var p = Q(this._getDefaultProperties(e.type), this._elementsChainAsString ? {
|
3581
|
+
$elements_chain: Dn(d)
|
3582
|
+
} : {
|
3583
|
+
$elements: d
|
3584
|
+
}, null !== (o = d[0]) && void 0 !== o && o.$el_text ? {
|
3585
|
+
$el_text: null === (a = d[0]) || void 0 === a ? void 0 : a.$el_text
|
3586
|
+
} : {}, h);
|
3587
|
+
if (i === Pr) {
|
3588
|
+
var g, v = _n(null == I || null === (g = I.getSelection()) || void 0 === g ? void 0 : g.toString()), _ = e.type || "clipboard";
|
3589
|
+
if (!v) return !1;
|
3590
|
+
p.$selected_content = v, p.$copy_type = _;
|
3591
|
+
}
|
3592
|
+
return this.instance.capture(i, p), !0;
|
3593
|
+
}
|
3594
|
+
}
|
3595
|
+
}, {
|
3596
|
+
key: "isBrowserSupported",
|
3597
|
+
value: function() {
|
3598
|
+
return y(null == O ? void 0 : O.querySelectorAll);
|
3599
|
+
}
|
3600
|
+
} ]), e;
|
3601
|
+
}(), Ir = {}, Cr = function() {}, $r = "posthog", Tr = !Xi && -1 === (null == B ? void 0 : B.indexOf("MSIE")) && -1 === (null == B ? void 0 : B.indexOf("Mozilla")), qr = function() {
|
3509
3602
|
var e, t, n;
|
3510
3603
|
return {
|
3511
|
-
api_host: "https://
|
3604
|
+
api_host: "https://us.i.posthog.com",
|
3512
3605
|
api_transport: "XHR",
|
3513
3606
|
ui_host: null,
|
3514
3607
|
token: "",
|
3515
3608
|
autocapture: !0,
|
3516
3609
|
rageclick: !0,
|
3517
3610
|
cross_subdomain_cookie: (t = null == O ? void 0 : O.location, n = null == t ? void 0 : t.hostname,
|
3518
|
-
!!
|
3611
|
+
!!S(n) && "herokuapp.com" !== n.split(".").slice(-2).join(".")),
|
3519
3612
|
persistence: "localStorage+cookie",
|
3520
3613
|
persistence_name: "",
|
3521
3614
|
cookie_name: "",
|
3522
|
-
loaded:
|
3615
|
+
loaded: Cr,
|
3523
3616
|
store_google: !0,
|
3524
3617
|
custom_campaign_params: [],
|
3525
3618
|
custom_blocked_useragents: [],
|
3526
3619
|
save_referrer: !0,
|
3527
3620
|
capture_pageview: !0,
|
3528
3621
|
capture_pageleave: !0,
|
3529
|
-
debug: !1,
|
3622
|
+
debug: A && S(null == A ? void 0 : A.search) && -1 !== A.search.indexOf("__posthog_debug=true") || !1,
|
3530
3623
|
verbose: !1,
|
3531
3624
|
cookie_expiration: 365,
|
3532
3625
|
upgrade: !1,
|
3533
3626
|
disable_session_recording: !1,
|
3534
3627
|
disable_persistence: !1,
|
3535
3628
|
disable_cookie: !1,
|
3629
|
+
disable_surveys: !1,
|
3536
3630
|
enable_recording_console_log: void 0,
|
3537
|
-
secure_cookie: "https:" === (null ==
|
3631
|
+
secure_cookie: "https:" === (null == I || null === (e = I.location) || void 0 === e ? void 0 : e.protocol),
|
3538
3632
|
ip: !0,
|
3539
3633
|
opt_out_capturing_by_default: !1,
|
3540
3634
|
opt_out_persistence_by_default: !1,
|
@@ -3561,19 +3655,20 @@ var fr = {
|
|
3561
3655
|
feature_flag_request_timeout_ms: 3e3,
|
3562
3656
|
on_request_error: function(e) {
|
3563
3657
|
var t = "Bad HTTP status: " + e.statusCode + " " + e.text;
|
3564
|
-
|
3658
|
+
U.error(t);
|
3565
3659
|
},
|
3566
3660
|
get_device_id: function(e) {
|
3567
3661
|
return e;
|
3568
3662
|
},
|
3569
|
-
_onCapture:
|
3663
|
+
_onCapture: Cr,
|
3570
3664
|
capture_performance: void 0,
|
3571
3665
|
name: "posthog",
|
3572
3666
|
bootstrap: {},
|
3573
3667
|
disable_compression: !1,
|
3574
|
-
session_idle_timeout_seconds: 1800
|
3668
|
+
session_idle_timeout_seconds: 1800,
|
3669
|
+
process_person: "always"
|
3575
3670
|
};
|
3576
|
-
},
|
3671
|
+
}, Mr = function() {
|
3577
3672
|
function e() {
|
3578
3673
|
i(this, e), o(this, "__forceAllowLocalhost", !1);
|
3579
3674
|
}
|
@@ -3583,17 +3678,18 @@ var fr = {
|
|
3583
3678
|
return this.__forceAllowLocalhost;
|
3584
3679
|
},
|
3585
3680
|
set: function(e) {
|
3586
|
-
|
3681
|
+
U.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),
|
3587
3682
|
this.__forceAllowLocalhost = e;
|
3588
3683
|
}
|
3589
3684
|
} ]), e;
|
3590
|
-
}(),
|
3685
|
+
}(), Or = function() {
|
3591
3686
|
function e() {
|
3592
3687
|
var t = this;
|
3593
|
-
i(this, e), o(this, "webPerformance", new
|
3594
|
-
this.
|
3688
|
+
i(this, e), o(this, "webPerformance", new Mr), o(this, "_debugEventEmitter", new Fr),
|
3689
|
+
this.config = qr(), this.decideEndpointWasHit = !1, this.SentryIntegration = pr,
|
3690
|
+
this.segmentIntegration = function() {
|
3595
3691
|
return function(e) {
|
3596
|
-
Promise && Promise.resolve ||
|
3692
|
+
Promise && Promise.resolve || U.warn("This browser does not have Promise support, and can not use the segment integration");
|
3597
3693
|
var t = function(t, n) {
|
3598
3694
|
t.event.userId || t.event.anonymousId === e.get_distinct_id() || e.reset(), t.event.userId && t.event.userId !== e.get_distinct_id() && (e.register({
|
3599
3695
|
distinct_id: t.event.userId
|
@@ -3625,26 +3721,28 @@ var fr = {
|
|
3625
3721
|
}
|
3626
3722
|
};
|
3627
3723
|
}(t);
|
3628
|
-
}, this.
|
3629
|
-
this.
|
3630
|
-
this.
|
3631
|
-
this.
|
3724
|
+
}, this.__request_queue = [], this.__loaded = !1, this.analyticsDefaultEndpoint = "/e/",
|
3725
|
+
this.featureFlags = new Oe(this), this.toolbar = new gi(this), this.pageViewManager = new gr(this),
|
3726
|
+
this.surveys = new mr(this), this.rateLimiter = new yr, this.requestRouter = new fr(this),
|
3727
|
+
this.people = {
|
3632
3728
|
set: function(e, n, i) {
|
3633
|
-
var r =
|
3729
|
+
var r = S(e) ? o({}, e, n) : e;
|
3634
3730
|
t.setPersonProperties(r), null == i || i({});
|
3635
3731
|
},
|
3636
3732
|
set_once: function(e, n, i) {
|
3637
|
-
var r =
|
3733
|
+
var r = S(e) ? o({}, e, n) : e;
|
3638
3734
|
t.setPersonProperties(void 0, r), null == i || i({});
|
3639
3735
|
}
|
3640
|
-
}
|
3736
|
+
}, this.on("eventCaptured", (function(e) {
|
3737
|
+
return U.info("send", e);
|
3738
|
+
}));
|
3641
3739
|
}
|
3642
3740
|
return s(e, [ {
|
3643
3741
|
key: "init",
|
3644
3742
|
value: function(t, n, i) {
|
3645
|
-
if (i && i !==
|
3646
|
-
var r, s = null !== (r =
|
3647
|
-
return s._init(t, n, i),
|
3743
|
+
if (i && i !== $r) {
|
3744
|
+
var r, s = null !== (r = Ir[i]) && void 0 !== r ? r : new e;
|
3745
|
+
return s._init(t, n, i), Ir[i] = s, Ir[$r][i] = s, s;
|
3648
3746
|
}
|
3649
3747
|
return this._init(t, n, i);
|
3650
3748
|
}
|
@@ -3653,37 +3751,30 @@ var fr = {
|
|
3653
3751
|
value: function(e) {
|
3654
3752
|
var n, i, r = this, s = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, o = arguments.length > 2 ? arguments[2] : void 0;
|
3655
3753
|
if (w(e) || function(e) {
|
3656
|
-
return
|
3657
|
-
}(e)) return
|
3754
|
+
return S(e) && 0 === e.trim().length;
|
3755
|
+
}(e)) return U.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),
|
3658
3756
|
this;
|
3659
|
-
if (this.__loaded) return
|
3757
|
+
if (this.__loaded) return U.warn("You have already initialized PostHog! Re-initializing is a no-op"),
|
3660
3758
|
this;
|
3661
3759
|
if (this.__loaded = !0, this.config = {}, this._triggered_notifs = [], s.request_headers = s.request_headers || s.xhr_headers,
|
3662
|
-
this.set_config(
|
3760
|
+
this.set_config(Q({}, qr(), s, {
|
3663
3761
|
name: o,
|
3664
3762
|
token: e
|
3665
|
-
})), this.compression = s.disable_compression ? void 0 :
|
3666
|
-
this.sessionPersistence = "sessionStorage" === this.config.persistence ? this.persistence : new
|
3763
|
+
})), this.compression = s.disable_compression ? void 0 : ne.Base64, this.persistence = new cn(this.config),
|
3764
|
+
this.sessionPersistence = "sessionStorage" === this.config.persistence ? this.persistence : new cn(t(t({}, this.config), {}, {
|
3667
3765
|
persistence: "sessionStorage"
|
3668
|
-
})), this._requestQueue = new
|
3766
|
+
})), this._requestQueue = new vi((function(e) {
|
3669
3767
|
return r._send_request(e);
|
3670
|
-
})), this._retryQueue = new
|
3671
|
-
this.
|
3672
|
-
this.sessionRecording
|
3673
|
-
this.
|
3674
|
-
|
3675
|
-
Ze._isAutocaptureEnabled) {
|
3676
|
-
this.__autocapture = this.config.autocapture;
|
3677
|
-
Ze.enabledForProject(this.config.token, 100, 100) ? Ze.isBrowserSupported() ? Ze.init(this) : (this.__autocapture = !1,
|
3678
|
-
j.info("Disabling Automatic Event Collection because this browser is not supported")) : (this.__autocapture = !1,
|
3679
|
-
j.info("Not in active bucket: disabling Automatic Event Collection."));
|
3680
|
-
}
|
3681
|
-
if (f.DEBUG = f.DEBUG || this.config.debug, this._gdpr_init(), s.segment && (this.config.get_device_id = function() {
|
3768
|
+
})), this._retryQueue = new lr(this), this.__request_queue = [], this.sessionManager = new dr(this.config, this.persistence),
|
3769
|
+
this.sessionPropsManager = new kr(this.sessionManager, this.persistence), this.sessionRecording = new di(this),
|
3770
|
+
this.sessionRecording.startRecordingIfEnabled(), this.config.disable_scroll_properties || this.pageViewManager.startMeasuringScrollPosition(),
|
3771
|
+
this.autocapture = new Er(this), f.DEBUG = f.DEBUG || this.config.debug, this._gdpr_init(),
|
3772
|
+
s.segment && (this.config.get_device_id = function() {
|
3682
3773
|
return s.segment.user().anonymousId();
|
3683
3774
|
}, s.segment.user().id() && (this.register({
|
3684
3775
|
distinct_id: s.segment.user().id()
|
3685
3776
|
}), this.persistence.set_user_state("identified"))), void 0 !== (null === (n = s.bootstrap) || void 0 === n ? void 0 : n.distinctID)) {
|
3686
|
-
var a, u, l = this.config.get_device_id(
|
3777
|
+
var a, u, l = this.config.get_device_id(je()), c = null !== (a = s.bootstrap) && void 0 !== a && a.isIdentifiedID ? l : s.bootstrap.distinctID;
|
3687
3778
|
this.persistence.set_user_state(null !== (u = s.bootstrap) && void 0 !== u && u.isIdentifiedID ? "identified" : "anonymous"),
|
3688
3779
|
this.register({
|
3689
3780
|
distinct_id: s.bootstrap.distinctID,
|
@@ -3711,24 +3802,25 @@ var fr = {
|
|
3711
3802
|
});
|
3712
3803
|
}
|
3713
3804
|
if (!this.get_distinct_id()) {
|
3714
|
-
var v = this.config.get_device_id(
|
3805
|
+
var v = this.config.get_device_id(je());
|
3715
3806
|
this.register_once({
|
3716
3807
|
distinct_id: v,
|
3717
3808
|
$device_id: v
|
3718
3809
|
}, ""), this.persistence.set_user_state("anonymous");
|
3719
3810
|
}
|
3720
|
-
return null ==
|
3811
|
+
return null == I || null === (i = I.addEventListener) || void 0 === i || i.call(I, "onpagehide" in self ? "pagehide" : "unload", this._handle_unload.bind(this)),
|
3721
3812
|
this.toolbar.maybeLoadToolbar(), s.segment ? s.segment.register(this.segmentIntegration()).then((function() {
|
3722
3813
|
r._loaded();
|
3723
|
-
})) : this._loaded(), this
|
3814
|
+
})) : this._loaded(), y(this.config._onCapture) && this.on("eventCaptured", (function(e) {
|
3815
|
+
return r.config._onCapture(e.event, e);
|
3816
|
+
})), this;
|
3724
3817
|
}
|
3725
3818
|
}, {
|
3726
3819
|
key: "_afterDecideResponse",
|
3727
3820
|
value: function(e) {
|
3728
3821
|
var t;
|
3729
|
-
this.compression = void 0, e.supportedCompression && !this.config.disable_compression && (this.compression =
|
3730
|
-
null !== (t = e.analytics) && void 0 !== t && t.endpoint && (this.analyticsDefaultEndpoint = e.analytics.endpoint)
|
3731
|
-
e.elementsChainAsString && (this.elementsChainAsString = e.elementsChainAsString);
|
3822
|
+
this.compression = void 0, e.supportedCompression && !this.config.disable_compression && (this.compression = Y(e.supportedCompression, ne.GZipJS) ? ne.GZipJS : Y(e.supportedCompression, ne.Base64) ? ne.Base64 : void 0),
|
3823
|
+
null !== (t = e.analytics) && void 0 !== t && t.endpoint && (this.analyticsDefaultEndpoint = e.analytics.endpoint);
|
3732
3824
|
}
|
3733
3825
|
}, {
|
3734
3826
|
key: "_loaded",
|
@@ -3738,7 +3830,7 @@ var fr = {
|
|
3738
3830
|
try {
|
3739
3831
|
this.config.loaded(this);
|
3740
3832
|
} catch (e) {
|
3741
|
-
|
3833
|
+
U.critical("`loaded` function failed", e);
|
3742
3834
|
}
|
3743
3835
|
this._start_queue_if_opted_in(), this.config.capture_pageview && setTimeout((function() {
|
3744
3836
|
O && e.capture("$pageview", {
|
@@ -3746,7 +3838,7 @@ var fr = {
|
|
3746
3838
|
}, {
|
3747
3839
|
send_instantly: !0
|
3748
3840
|
});
|
3749
|
-
}), 1), t || (new
|
3841
|
+
}), 1), t || (new hi(this).call(), this.featureFlags.resetRequestQueue());
|
3750
3842
|
}
|
3751
3843
|
}, {
|
3752
3844
|
key: "_start_queue_if_opted_in",
|
@@ -3758,7 +3850,7 @@ var fr = {
|
|
3758
3850
|
key: "_dom_loaded",
|
3759
3851
|
value: function() {
|
3760
3852
|
var e = this;
|
3761
|
-
this.has_opted_out_capturing() ||
|
3853
|
+
this.has_opted_out_capturing() || z(this.__request_queue, (function(t) {
|
3762
3854
|
return e._send_retriable_request(t);
|
3763
3855
|
})), this.__request_queue = [], this._start_queue_if_opted_in();
|
3764
3856
|
}
|
@@ -3775,17 +3867,17 @@ var fr = {
|
|
3775
3867
|
key: "_send_request",
|
3776
3868
|
value: function(e) {
|
3777
3869
|
var n = this;
|
3778
|
-
this.__loaded && (
|
3779
|
-
e.url =
|
3870
|
+
this.__loaded && (Tr ? this.__request_queue.push(e) : this.rateLimiter.isRateLimited(e.batchKey) || (e.transport = e.transport || this.config.api_transport,
|
3871
|
+
e.url = er(e.url, {
|
3780
3872
|
ip: this.config.ip ? 1 : 0
|
3781
3873
|
}), e.headers = this.config.request_headers, e.compression = "best-available" === e.compression ? this.compression : e.compression,
|
3782
3874
|
function(e) {
|
3783
3875
|
var n = t({}, e);
|
3784
|
-
n.timeout = n.timeout || 6e4, n.url =
|
3876
|
+
n.timeout = n.timeout || 6e4, n.url = er(n.url, {
|
3785
3877
|
_: (new Date).getTime().toString(),
|
3786
3878
|
ver: f.LIB_VERSION,
|
3787
3879
|
compression: n.compression
|
3788
|
-
}), "sendBeacon" === n.transport && null !=
|
3880
|
+
}), "sendBeacon" === n.transport && null != M && M.sendBeacon ? sr(n) : "fetch" === n.transport && D ? rr(n) : L || !O ? ir(n) : or(n);
|
3789
3881
|
}(t(t({}, e), {}, {
|
3790
3882
|
callback: function(t) {
|
3791
3883
|
var i, r, s;
|
@@ -3803,14 +3895,14 @@ var fr = {
|
|
3803
3895
|
key: "_execute_array",
|
3804
3896
|
value: function(e) {
|
3805
3897
|
var t, n = this, i = [], r = [], s = [];
|
3806
|
-
|
3898
|
+
z(e, (function(e) {
|
3807
3899
|
e && (t = e[0], m(t) ? s.push(e) : y(e) ? e.call(n) : m(e) && "alias" === t ? i.push(e) : m(e) && -1 !== t.indexOf("capture") && y(n[t]) ? s.push(e) : r.push(e));
|
3808
3900
|
}));
|
3809
3901
|
var o = function(e, t) {
|
3810
|
-
|
3902
|
+
z(e, (function(e) {
|
3811
3903
|
if (m(e[0])) {
|
3812
3904
|
var n = t;
|
3813
|
-
|
3905
|
+
G(e, (function(e) {
|
3814
3906
|
n = n[e[0]].apply(n, e.slice(1));
|
3815
3907
|
}));
|
3816
3908
|
} else this[e[0]].apply(this, e.slice(1));
|
@@ -3833,50 +3925,41 @@ var fr = {
|
|
3833
3925
|
key: "capture",
|
3834
3926
|
value: function(e, n, i) {
|
3835
3927
|
var r;
|
3836
|
-
if (!this.__loaded
|
3837
|
-
if (!
|
3838
|
-
if (!
|
3839
|
-
this.sessionPersistence.update_search_keyword(), this.config.store_google && this.sessionPersistence.update_campaign_params(),
|
3840
|
-
this.config.save_referrer && this.sessionPersistence.update_referrer_info()
|
3928
|
+
if (!(this.__loaded && this.persistence && this.sessionPersistence && this._requestQueue)) return U.uninitializedWarning("posthog.capture");
|
3929
|
+
if (!ri(this)) if (!w(e) && S(e)) {
|
3930
|
+
if (!B || this.config.opt_out_useragent_filter || !Sr(B, this.config.custom_blocked_useragents)) {
|
3931
|
+
this.sessionPersistence.update_search_keyword(), this.config.store_google && (this.sessionPersistence.update_campaign_params(),
|
3932
|
+
this.persistence.set_initial_campaign_params()), this.config.save_referrer && (this.sessionPersistence.update_referrer_info(),
|
3933
|
+
this.persistence.set_initial_referrer_info());
|
3841
3934
|
var s = {
|
3842
|
-
uuid:
|
3935
|
+
uuid: je(),
|
3843
3936
|
event: e,
|
3844
3937
|
properties: this._calculate_event_properties(e, n || {})
|
3845
3938
|
};
|
3846
|
-
|
3847
|
-
|
3939
|
+
(null == i ? void 0 : i.$set) && (s.$set = null == i ? void 0 : i.$set);
|
3940
|
+
var o = this._calculate_set_once_properties(null == i ? void 0 : i.$set_once);
|
3941
|
+
o && (s.$set_once = o), (s = te(s, null != i && i._noTruncate ? null : this.config.properties_string_max_length)).timestamp = (null == i ? void 0 : i.timestamp) || new Date,
|
3848
3942
|
w(null == i ? void 0 : i.timestamp) || (s.properties.$event_time_override_provided = !0,
|
3849
3943
|
s.properties.$event_time_override_system_time = new Date);
|
3850
|
-
var
|
3851
|
-
(
|
3852
|
-
|
3853
|
-
for (var t in e) if (v.call(e, t)) return !1;
|
3854
|
-
return !0;
|
3855
|
-
}
|
3856
|
-
return !1;
|
3857
|
-
})(o) || this.setPersonPropertiesForFlags(o), j.info("send", s);
|
3858
|
-
var a = {
|
3944
|
+
var a = t(t({}, s.properties.$set), s.$set);
|
3945
|
+
k(a) || this.setPersonPropertiesForFlags(a), this._debugEventEmitter.emit("eventCaptured", s);
|
3946
|
+
var u = {
|
3859
3947
|
method: "POST",
|
3860
3948
|
url: null !== (r = null == i ? void 0 : i._url) && void 0 !== r ? r : this.requestRouter.endpointFor("api", this.analyticsDefaultEndpoint),
|
3861
3949
|
data: s,
|
3862
3950
|
compression: "best-available",
|
3863
3951
|
batchKey: null == i ? void 0 : i._batchKey
|
3864
3952
|
};
|
3865
|
-
return !this.config.request_batching || i && (null == i || !i._batchKey) || null != i && i.send_instantly ? this._send_retriable_request(
|
3866
|
-
|
3953
|
+
return !this.config.request_batching || i && (null == i || !i._batchKey) || null != i && i.send_instantly ? this._send_retriable_request(u) : this._requestQueue.enqueue(u),
|
3954
|
+
s;
|
3867
3955
|
}
|
3868
|
-
} else
|
3956
|
+
} else U.error("No event name provided to posthog.capture");
|
3869
3957
|
}
|
3870
3958
|
}, {
|
3871
3959
|
key: "_addCaptureHook",
|
3872
3960
|
value: function(e) {
|
3873
|
-
this.
|
3874
|
-
|
3875
|
-
}, {
|
3876
|
-
key: "_invokeCaptureHooks",
|
3877
|
-
value: function(e, t) {
|
3878
|
-
this.config._onCapture(e, t), z(this.__captureHooks, (function(t) {
|
3879
|
-
return t(e);
|
3961
|
+
this.on("eventCaptured", (function(t) {
|
3962
|
+
return e(t.event);
|
3880
3963
|
}));
|
3881
3964
|
}
|
3882
3965
|
}, {
|
@@ -3888,20 +3971,20 @@ var fr = {
|
|
3888
3971
|
var s = t(t({}, this.persistence.properties()), this.sessionPersistence.properties());
|
3889
3972
|
return r.distinct_id = s.distinct_id, r;
|
3890
3973
|
}
|
3891
|
-
var o =
|
3974
|
+
var o = un.properties();
|
3892
3975
|
if (this.sessionManager) {
|
3893
3976
|
var a = this.sessionManager.checkAndGetSessionAndWindowId(), u = a.sessionId, c = a.windowId;
|
3894
3977
|
r.$session_id = u, r.$window_id = c;
|
3895
3978
|
}
|
3896
|
-
if (this.requestRouter.region ===
|
3979
|
+
if (this.requestRouter.region === ur.CUSTOM && (r.$lib_custom_api_host = this.config.api_host),
|
3897
3980
|
this.sessionPropsManager && this.config.__preview_send_client_session_params && ("$pageview" === e || "$pageleave" === e || "$autocapture" === e)) {
|
3898
3981
|
var d = this.sessionPropsManager.getSessionProps();
|
3899
|
-
r =
|
3982
|
+
r = Q(r, d);
|
3900
3983
|
}
|
3901
3984
|
if (!this.config.disable_scroll_properties) {
|
3902
3985
|
var h = {};
|
3903
3986
|
"$pageview" === e ? h = this.pageViewManager.doPageView() : "$pageleave" === e && (h = this.pageViewManager.doPageLeave()),
|
3904
|
-
r =
|
3987
|
+
r = Q(r, h);
|
3905
3988
|
}
|
3906
3989
|
if ("$pageview" === e && O && (r.title = O.title), "$performance_event" === e) {
|
3907
3990
|
var f = this.persistence.properties();
|
@@ -3911,13 +3994,20 @@ var fr = {
|
|
3911
3994
|
var p = (new Date).getTime() - i;
|
3912
3995
|
r.$duration = parseFloat((p / 1e3).toFixed(3));
|
3913
3996
|
}
|
3914
|
-
(
|
3915
|
-
r =
|
3916
|
-
m(this.config.property_denylist) && m(this.config.property_blacklist)) ?
|
3997
|
+
(B && this.config.opt_out_useragent_filter && (r.$browser_type = Sr(B, this.config.custom_blocked_useragents) ? "bot" : "browser"),
|
3998
|
+
(r = Q({}, un.properties(), this.persistence.properties(), this.sessionPersistence.properties(), r)).$is_identified = this._isIdentified(),
|
3999
|
+
m(this.config.property_denylist) && m(this.config.property_blacklist)) ? G([].concat(l(this.config.property_blacklist), l(this.config.property_denylist)), (function(e) {
|
3917
4000
|
delete r[e];
|
3918
|
-
})) :
|
4001
|
+
})) : U.error("Invalid value for property_denylist config: " + this.config.property_denylist + " or property_blacklist config: " + this.config.property_blacklist);
|
3919
4002
|
var g = this.config.sanitize_properties;
|
3920
|
-
return g && (r = g(r, e)), r;
|
4003
|
+
return g && (r = g(r, e)), r.$process_person = this._hasPersonProcessing(), r;
|
4004
|
+
}
|
4005
|
+
}, {
|
4006
|
+
key: "_calculate_set_once_properties",
|
4007
|
+
value: function(e) {
|
4008
|
+
if (!this.persistence || !this._hasPersonProcessing()) return e;
|
4009
|
+
var t = Q({}, this.persistence.get_initial_props(), e || {});
|
4010
|
+
return k(t) ? void 0 : t;
|
3921
4011
|
}
|
3922
4012
|
}, {
|
3923
4013
|
key: "register",
|
@@ -3990,6 +4080,11 @@ var fr = {
|
|
3990
4080
|
var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
|
3991
4081
|
return this.featureFlags.getEarlyAccessFeatures(e, t);
|
3992
4082
|
}
|
4083
|
+
}, {
|
4084
|
+
key: "on",
|
4085
|
+
value: function(e, t) {
|
4086
|
+
return this._debugEventEmitter.on(e, t);
|
4087
|
+
}
|
3993
4088
|
}, {
|
3994
4089
|
key: "onFeatureFlags",
|
3995
4090
|
value: function(e) {
|
@@ -4016,38 +4111,41 @@ var fr = {
|
|
4016
4111
|
}, {
|
4017
4112
|
key: "identify",
|
4018
4113
|
value: function(e, t, n) {
|
4019
|
-
if (!this.__loaded || !this.persistence) return
|
4020
|
-
if (
|
4021
|
-
e)
|
4022
|
-
|
4023
|
-
|
4024
|
-
|
4025
|
-
|
4026
|
-
|
4027
|
-
|
4028
|
-
|
4029
|
-
|
4030
|
-
|
4114
|
+
if (!this.__loaded || !this.persistence) return U.uninitializedWarning("posthog.identify");
|
4115
|
+
if (P(e) && (e = e.toString(), U.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),
|
4116
|
+
e) {
|
4117
|
+
if ([ "distinct_id", "distinctid" ].includes(e.toLowerCase())) U.critical('The string "'.concat(e, '" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.')); else if (this._requirePersonProcessing("posthog.identify")) {
|
4118
|
+
var i = this.get_distinct_id();
|
4119
|
+
if (this.register({
|
4120
|
+
$user_id: e
|
4121
|
+
}), !this.get_property("$device_id")) {
|
4122
|
+
var r = i;
|
4123
|
+
this.register_once({
|
4124
|
+
$had_persisted_distinct_id: !0,
|
4125
|
+
$device_id: r
|
4126
|
+
}, "");
|
4127
|
+
}
|
4128
|
+
e !== i && e !== this.get_property(ae) && (this.unregister(ae), this.register({
|
4129
|
+
distinct_id: e
|
4130
|
+
}));
|
4131
|
+
var s = "anonymous" === this.persistence.get_user_state();
|
4132
|
+
e !== i && s ? (this.persistence.set_user_state("identified"), this.setPersonPropertiesForFlags(t || {}, !1),
|
4133
|
+
this.capture("$identify", {
|
4134
|
+
distinct_id: e,
|
4135
|
+
$anon_distinct_id: i
|
4136
|
+
}, {
|
4137
|
+
$set: t || {},
|
4138
|
+
$set_once: n || {}
|
4139
|
+
}), this.featureFlags.setAnonymousDistinctId(i)) : (t || n) && this.setPersonProperties(t, n),
|
4140
|
+
e !== i && (this.reloadFeatureFlags(), this.unregister(Se));
|
4031
4141
|
}
|
4032
|
-
|
4033
|
-
distinct_id: e
|
4034
|
-
}));
|
4035
|
-
var s = "anonymous" === this.persistence.get_user_state();
|
4036
|
-
e !== i && s ? (this.persistence.set_user_state("identified"), this.setPersonPropertiesForFlags(t || {}, !1),
|
4037
|
-
this.capture("$identify", {
|
4038
|
-
distinct_id: e,
|
4039
|
-
$anon_distinct_id: i
|
4040
|
-
}, {
|
4041
|
-
$set: t || {},
|
4042
|
-
$set_once: n || {}
|
4043
|
-
}), this.featureFlags.setAnonymousDistinctId(i)) : (t || n) && this.setPersonProperties(t, n),
|
4044
|
-
e !== i && (this.reloadFeatureFlags(), this.unregister(We));
|
4045
|
-
} else j.error("Unique user id has not been set in posthog.identify");
|
4142
|
+
} else U.error("Unique user id has not been set in posthog.identify");
|
4046
4143
|
}
|
4047
4144
|
}, {
|
4048
4145
|
key: "setPersonProperties",
|
4049
4146
|
value: function(e, t) {
|
4050
|
-
(e || t) && (this.setPersonPropertiesForFlags(e || {}),
|
4147
|
+
(e || t) && this._requirePersonProcessing("posthog.setPersonProperties") && (this.setPersonPropertiesForFlags(e || {}),
|
4148
|
+
this.capture("$set", {
|
4051
4149
|
$set: e || {},
|
4052
4150
|
$set_once: t || {}
|
4053
4151
|
}));
|
@@ -4056,15 +4154,17 @@ var fr = {
|
|
4056
4154
|
key: "group",
|
4057
4155
|
value: function(e, n, i) {
|
4058
4156
|
if (e && n) {
|
4059
|
-
|
4060
|
-
|
4061
|
-
|
4062
|
-
|
4063
|
-
$
|
4064
|
-
|
4065
|
-
|
4066
|
-
|
4067
|
-
|
4157
|
+
if (this._requirePersonProcessing("posthog.group")) {
|
4158
|
+
var r = this.getGroups();
|
4159
|
+
r[e] !== n && this.resetGroupPropertiesForFlags(e), this.register({
|
4160
|
+
$groups: t(t({}, r), {}, o({}, e, n))
|
4161
|
+
}), i && (this.capture("$groupidentify", {
|
4162
|
+
$group_type: e,
|
4163
|
+
$group_key: n,
|
4164
|
+
$group_set: i
|
4165
|
+
}), this.setGroupPropertiesForFlags(o({}, e, i))), r[e] === n || i || this.reloadFeatureFlags();
|
4166
|
+
}
|
4167
|
+
} else U.error("posthog.group requires a group type and group key");
|
4068
4168
|
}
|
4069
4169
|
}, {
|
4070
4170
|
key: "resetGroups",
|
@@ -4077,7 +4177,7 @@ var fr = {
|
|
4077
4177
|
key: "setPersonPropertiesForFlags",
|
4078
4178
|
value: function(e) {
|
4079
4179
|
var t = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1];
|
4080
|
-
this.featureFlags.setPersonPropertiesForFlags(e, t);
|
4180
|
+
this._requirePersonProcessing("posthog.setPersonPropertiesForFlags") && this.featureFlags.setPersonPropertiesForFlags(e, t);
|
4081
4181
|
}
|
4082
4182
|
}, {
|
4083
4183
|
key: "resetPersonPropertiesForFlags",
|
@@ -4088,7 +4188,7 @@ var fr = {
|
|
4088
4188
|
key: "setGroupPropertiesForFlags",
|
4089
4189
|
value: function(e) {
|
4090
4190
|
var t = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1];
|
4091
|
-
this.featureFlags.setGroupPropertiesForFlags(e, t);
|
4191
|
+
this._requirePersonProcessing("posthog.setGroupPropertiesForFlags") && this.featureFlags.setGroupPropertiesForFlags(e, t);
|
4092
4192
|
}
|
4093
4193
|
}, {
|
4094
4194
|
key: "resetGroupPropertiesForFlags",
|
@@ -4099,12 +4199,12 @@ var fr = {
|
|
4099
4199
|
key: "reset",
|
4100
4200
|
value: function(e) {
|
4101
4201
|
var t, n, i, r;
|
4102
|
-
if (!this.__loaded) return
|
4202
|
+
if (!this.__loaded) return U.uninitializedWarning("posthog.reset");
|
4103
4203
|
var s = this.get_property("$device_id");
|
4104
4204
|
null === (t = this.persistence) || void 0 === t || t.clear(), null === (n = this.sessionPersistence) || void 0 === n || n.clear(),
|
4105
4205
|
null === (i = this.persistence) || void 0 === i || i.set_user_state("anonymous"),
|
4106
4206
|
null === (r = this.sessionManager) || void 0 === r || r.resetSessionId();
|
4107
|
-
var o = this.config.get_device_id(
|
4207
|
+
var o = this.config.get_device_id(je());
|
4108
4208
|
this.register_once({
|
4109
4209
|
distinct_id: o,
|
4110
4210
|
$device_id: e ? o : s
|
@@ -4130,7 +4230,7 @@ var fr = {
|
|
4130
4230
|
key: "get_session_replay_url",
|
4131
4231
|
value: function(e) {
|
4132
4232
|
if (!this.sessionManager) return "";
|
4133
|
-
var t = this.sessionManager.checkAndGetSessionAndWindowId(!0), n = t.sessionId, i = t.sessionStartTimestamp, r = this.requestRouter.endpointFor("ui", "/replay/"
|
4233
|
+
var t = this.sessionManager.checkAndGetSessionAndWindowId(!0), n = t.sessionId, i = t.sessionStartTimestamp, r = this.requestRouter.endpointFor("ui", "/project/".concat(this.config.token, "/replay/").concat(n));
|
4134
4234
|
if (null != e && e.withTimestamp && i) {
|
4135
4235
|
var s, o = null !== (s = e.timestampLookBack) && void 0 !== s ? s : 10;
|
4136
4236
|
if (!i) return r;
|
@@ -4142,32 +4242,36 @@ var fr = {
|
|
4142
4242
|
}, {
|
4143
4243
|
key: "alias",
|
4144
4244
|
value: function(e, t) {
|
4145
|
-
return e === this.get_property(
|
4146
|
-
-2) : (w(t) && (t = this.get_distinct_id()),
|
4147
|
-
this.capture("$create_alias", {
|
4245
|
+
return e === this.get_property(oe) ? (U.critical("Attempting to create alias for existing People user - aborting."),
|
4246
|
+
-2) : this._requirePersonProcessing("posthog.alias") ? (w(t) && (t = this.get_distinct_id()),
|
4247
|
+
e !== t ? (this._register_single(ae, e), this.capture("$create_alias", {
|
4148
4248
|
alias: e,
|
4149
4249
|
distinct_id: t
|
4150
|
-
})) : (
|
4151
|
-
-1));
|
4250
|
+
})) : (U.warn("alias matches current distinct_id - skipping api call."), this.identify(e),
|
4251
|
+
-1)) : void 0;
|
4152
4252
|
}
|
4153
4253
|
}, {
|
4154
4254
|
key: "set_config",
|
4155
4255
|
value: function(e) {
|
4156
4256
|
var n, i = t({}, this.config);
|
4157
|
-
if (b(e) && (
|
4257
|
+
if (b(e) && (Q(this.config, e), this.config.persistence_name || (this.config.persistence_name = this.config.cookie_name),
|
4158
4258
|
this.config.disable_persistence || (this.config.disable_persistence = this.config.disable_cookie),
|
4159
4259
|
null === (n = this.persistence) || void 0 === n || n.update_config(this.config, i),
|
4160
|
-
this.sessionPersistence = "sessionStorage" === this.config.persistence ? this.persistence : new
|
4260
|
+
this.sessionPersistence = "sessionStorage" === this.config.persistence ? this.persistence : new cn(t(t({}, this.config), {}, {
|
4161
4261
|
persistence: "sessionStorage"
|
4162
|
-
})),
|
4262
|
+
})), Ke.is_supported() && "true" === Ke.get("ph_debug") && (this.config.debug = !0),
|
4163
4263
|
this.config.debug && (f.DEBUG = !0), this.sessionRecording && !w(e.disable_session_recording))) {
|
4164
|
-
var r = i.disable_session_recording !== e.disable_session_recording, s = !
|
4264
|
+
var r = i.disable_session_recording !== e.disable_session_recording, s = !ri(this) && !e.disable_session_recording && !this.sessionRecording.started;
|
4165
4265
|
(r || s) && (e.disable_session_recording ? this.sessionRecording.stopRecording() : this.sessionRecording.startRecordingIfEnabled());
|
4166
4266
|
}
|
4167
4267
|
}
|
4168
4268
|
}, {
|
4169
4269
|
key: "startSessionRecording",
|
4170
|
-
value: function() {
|
4270
|
+
value: function(e) {
|
4271
|
+
if (null != e && e.sampling) {
|
4272
|
+
var t, n, i = null === (t = this.sessionManager) || void 0 === t ? void 0 : t.checkAndGetSessionAndWindowId();
|
4273
|
+
null === (n = this.persistence) || void 0 === n || n.register(o({}, _e, !0)), U.info("Session recording started with sampling override for session: ", null == i ? void 0 : i.sessionId);
|
4274
|
+
}
|
4171
4275
|
this.set_config({
|
4172
4276
|
disable_session_recording: !1
|
4173
4277
|
});
|
@@ -4205,13 +4309,31 @@ var fr = {
|
|
4205
4309
|
}, {
|
4206
4310
|
key: "toString",
|
4207
4311
|
value: function() {
|
4208
|
-
var e, t = null !== (e = this.config.name) && void 0 !== e ? e :
|
4209
|
-
return t !==
|
4312
|
+
var e, t = null !== (e = this.config.name) && void 0 !== e ? e : $r;
|
4313
|
+
return t !== $r && (t = $r + "." + t), t;
|
4314
|
+
}
|
4315
|
+
}, {
|
4316
|
+
key: "_isIdentified",
|
4317
|
+
value: function() {
|
4318
|
+
var e, t;
|
4319
|
+
return "identified" === (null === (e = this.persistence) || void 0 === e ? void 0 : e.get_user_state()) || "identified" === (null === (t = this.sessionPersistence) || void 0 === t ? void 0 : t.get_user_state());
|
4320
|
+
}
|
4321
|
+
}, {
|
4322
|
+
key: "_hasPersonProcessing",
|
4323
|
+
value: function() {
|
4324
|
+
var e, t, n, i;
|
4325
|
+
return !("never" === this.config.process_person || "identified_only" === this.config.process_person && !this._isIdentified() && k(this.getGroups()) && (null === (e = this.persistence) || void 0 === e || null === (t = e.props) || void 0 === t || !t[ae]) && (null === (n = this.persistence) || void 0 === n || null === (i = n.props) || void 0 === i || !i[Ie]));
|
4326
|
+
}
|
4327
|
+
}, {
|
4328
|
+
key: "_requirePersonProcessing",
|
4329
|
+
value: function(e) {
|
4330
|
+
return "never" === this.config.process_person ? (U.error(e + ' was called, but process_person is set to "never". This call will be ignored.'),
|
4331
|
+
!1) : (this._register_single(Ie, !0), !0);
|
4210
4332
|
}
|
4211
4333
|
}, {
|
4212
4334
|
key: "_gdpr_init",
|
4213
4335
|
value: function() {
|
4214
|
-
"localStorage" === this.config.opt_out_capturing_persistence_type &&
|
4336
|
+
"localStorage" === this.config.opt_out_capturing_persistence_type && Ke.is_supported() && (!this.has_opted_in_capturing() && this.has_opted_in_capturing({
|
4215
4337
|
persistence_type: "cookie"
|
4216
4338
|
}) && this.opt_in_capturing({
|
4217
4339
|
enable_persistence: !1
|
@@ -4224,7 +4346,7 @@ var fr = {
|
|
4224
4346
|
enable_persistence: !1
|
4225
4347
|
})), this.has_opted_out_capturing() ? this._gdpr_update_persistence({
|
4226
4348
|
clear_persistence: !0
|
4227
|
-
}) : this.has_opted_in_capturing() || !this.config.opt_out_capturing_by_default && !
|
4349
|
+
}) : this.has_opted_in_capturing() || !this.config.opt_out_capturing_by_default && !Ye.get("ph_optout") || (Ye.remove("ph_optout"),
|
4228
4350
|
this.opt_out_capturing({
|
4229
4351
|
clear_persistence: this.config.opt_out_persistence_by_default
|
4230
4352
|
}));
|
@@ -4243,14 +4365,14 @@ var fr = {
|
|
4243
4365
|
}, {
|
4244
4366
|
key: "_gdpr_call_func",
|
4245
4367
|
value: function(e, t) {
|
4246
|
-
return t =
|
4368
|
+
return t = Q({
|
4247
4369
|
capture: this.capture.bind(this),
|
4248
4370
|
persistence_type: this.config.opt_out_capturing_persistence_type,
|
4249
4371
|
cookie_prefix: this.config.opt_out_capturing_cookie_prefix,
|
4250
4372
|
cookie_expiration: this.config.cookie_expiration,
|
4251
4373
|
cross_subdomain_cookie: this.config.cross_subdomain_cookie,
|
4252
4374
|
secure_cookie: this.config.secure_cookie
|
4253
|
-
}, t || {}),
|
4375
|
+
}, t || {}), Ke.is_supported() || "localStorage" !== t.persistence_type || (t.persistence_type = "cookie"),
|
4254
4376
|
e(this.config.token, {
|
4255
4377
|
capture: t.capture,
|
4256
4378
|
captureEventName: t.capture_event_name,
|
@@ -4265,43 +4387,43 @@ var fr = {
|
|
4265
4387
|
}, {
|
4266
4388
|
key: "opt_in_capturing",
|
4267
4389
|
value: function(e) {
|
4268
|
-
e =
|
4390
|
+
e = Q({
|
4269
4391
|
enable_persistence: !0
|
4270
|
-
}, e || {}), this._gdpr_call_func(
|
4392
|
+
}, e || {}), this._gdpr_call_func(Yn, e), this._gdpr_update_persistence(e);
|
4271
4393
|
}
|
4272
4394
|
}, {
|
4273
4395
|
key: "opt_out_capturing",
|
4274
4396
|
value: function(e) {
|
4275
|
-
var t =
|
4397
|
+
var t = Q({
|
4276
4398
|
clear_persistence: !0
|
4277
4399
|
}, e || {});
|
4278
|
-
this._gdpr_call_func(
|
4400
|
+
this._gdpr_call_func(Jn, t), this._gdpr_update_persistence(t);
|
4279
4401
|
}
|
4280
4402
|
}, {
|
4281
4403
|
key: "has_opted_in_capturing",
|
4282
4404
|
value: function(e) {
|
4283
|
-
return this._gdpr_call_func(
|
4405
|
+
return this._gdpr_call_func(Kn, e);
|
4284
4406
|
}
|
4285
4407
|
}, {
|
4286
4408
|
key: "has_opted_out_capturing",
|
4287
4409
|
value: function(e) {
|
4288
|
-
return this._gdpr_call_func(
|
4410
|
+
return this._gdpr_call_func(Xn, e);
|
4289
4411
|
}
|
4290
4412
|
}, {
|
4291
4413
|
key: "clear_opt_in_out_capturing",
|
4292
4414
|
value: function(e) {
|
4293
|
-
var t =
|
4415
|
+
var t = Q({
|
4294
4416
|
enable_persistence: !0
|
4295
4417
|
}, null != e ? e : {});
|
4296
|
-
this._gdpr_call_func(
|
4418
|
+
this._gdpr_call_func(Zn, t), this._gdpr_update_persistence(t);
|
4297
4419
|
}
|
4298
4420
|
}, {
|
4299
4421
|
key: "debug",
|
4300
4422
|
value: function(e) {
|
4301
|
-
!1 === e ? (null ==
|
4423
|
+
!1 === e ? (null == I || I.console.log("You've disabled debug mode."), localStorage && localStorage.removeItem("ph_debug"),
|
4302
4424
|
this.set_config({
|
4303
4425
|
debug: !1
|
4304
|
-
})) : (null ==
|
4426
|
+
})) : (null == I || I.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),
|
4305
4427
|
localStorage && localStorage.setItem("ph_debug", "true"), this.set_config({
|
4306
4428
|
debug: !0
|
4307
4429
|
}));
|
@@ -4310,27 +4432,27 @@ var fr = {
|
|
4310
4432
|
}();
|
4311
4433
|
|
4312
4434
|
!function(e, t) {
|
4313
|
-
for (var n = 0; n < t.length; n++) e.prototype[t[n]] =
|
4314
|
-
}(
|
4435
|
+
for (var n = 0; n < t.length; n++) e.prototype[t[n]] = Z(e.prototype[t[n]]);
|
4436
|
+
}(Or, [ "identify" ]);
|
4315
4437
|
|
4316
|
-
var
|
4438
|
+
var Ar, Dr;
|
4317
4439
|
|
4318
4440
|
!function(e) {
|
4319
4441
|
e.Popover = "popover", e.API = "api", e.Widget = "widget";
|
4320
|
-
}(
|
4442
|
+
}(Ar || (Ar = {})), function(e) {
|
4321
4443
|
e.Open = "open", e.MultipleChoice = "multiple_choice", e.SingleChoice = "single_choice",
|
4322
4444
|
e.Rating = "rating", e.Link = "link";
|
4323
|
-
}(
|
4445
|
+
}(Dr || (Dr = {}));
|
4324
4446
|
|
4325
|
-
var
|
4447
|
+
var Lr, Nr = (Lr = Ir[$r] = new Or, function() {
|
4326
4448
|
function e() {
|
4327
|
-
e.done || (e.done = !0,
|
4449
|
+
e.done || (e.done = !0, Tr = !1, G(Ir, (function(e) {
|
4328
4450
|
e._dom_loaded();
|
4329
4451
|
})));
|
4330
4452
|
}
|
4331
4453
|
null != O && O.addEventListener && ("complete" === O.readyState ? e() : O.addEventListener("DOMContentLoaded", e, !1)),
|
4332
|
-
|
4333
|
-
}(),
|
4454
|
+
I && re(I, "load", e, !0);
|
4455
|
+
}(), Lr);
|
4334
4456
|
|
4335
4457
|
class PostHogController extends Controller {
|
4336
4458
|
static values={
|
@@ -4338,7 +4460,7 @@ class PostHogController extends Controller {
|
|
4338
4460
|
identification: Object
|
4339
4461
|
};
|
4340
4462
|
connect() {
|
4341
|
-
|
4463
|
+
Nr.init(this.apiKeyValue, {
|
4342
4464
|
api_host: "https://eu.posthog.com",
|
4343
4465
|
custom_campaign_params: [ "ref" ],
|
4344
4466
|
session_recording: {
|
@@ -4350,7 +4472,7 @@ class PostHogController extends Controller {
|
|
4350
4472
|
});
|
4351
4473
|
if (Object.keys(this.identificationValue).length) {
|
4352
4474
|
const {id: id, email: email, name: name} = this.identificationValue;
|
4353
|
-
|
4475
|
+
Nr.identify(id.toString(), {
|
4354
4476
|
email: email,
|
4355
4477
|
name: name
|
4356
4478
|
});
|
@@ -8202,6 +8324,10 @@ var CrispMessage = function() {
|
|
8202
8324
|
function CrispMessage(crisp) {
|
8203
8325
|
this.parent = crisp;
|
8204
8326
|
}
|
8327
|
+
CrispMessage.prototype.setMessageText = function(content) {
|
8328
|
+
this.parent.createSingletonIfNecessary();
|
8329
|
+
window.$crisp.push([ "set", "message:text", [ content ] ]);
|
8330
|
+
};
|
8205
8331
|
CrispMessage.prototype.send = function(type, content) {
|
8206
8332
|
this.parent.createSingletonIfNecessary();
|
8207
8333
|
window.$crisp.push([ "do", "message:send", [ type, content ] ]);
|
@@ -8257,24 +8383,40 @@ var CrispMessage = function() {
|
|
8257
8383
|
};
|
8258
8384
|
CrispMessage.prototype.onMessageSent = function(callback) {
|
8259
8385
|
this.parent.createSingletonIfNecessary();
|
8260
|
-
|
8386
|
+
this.offMessageSent();
|
8261
8387
|
window.$crisp.push([ "on", "message:sent", callback ]);
|
8262
8388
|
};
|
8389
|
+
CrispMessage.prototype.offMessageSent = function() {
|
8390
|
+
this.parent.createSingletonIfNecessary();
|
8391
|
+
window.$crisp.push([ "off", "message:sent" ]);
|
8392
|
+
};
|
8263
8393
|
CrispMessage.prototype.onMessageReceived = function(callback) {
|
8264
8394
|
this.parent.createSingletonIfNecessary();
|
8265
|
-
|
8395
|
+
this.offMessageReceived();
|
8266
8396
|
window.$crisp.push([ "on", "message:received", callback ]);
|
8267
8397
|
};
|
8398
|
+
CrispMessage.prototype.offMessageReceived = function() {
|
8399
|
+
this.parent.createSingletonIfNecessary();
|
8400
|
+
window.$crisp.push([ "off", "message:received" ]);
|
8401
|
+
};
|
8268
8402
|
CrispMessage.prototype.onMessageComposeSent = function(callback) {
|
8269
8403
|
this.parent.createSingletonIfNecessary();
|
8270
|
-
|
8404
|
+
this.offMessageComposeSent();
|
8271
8405
|
window.$crisp.push([ "on", "message:compose:sent", callback ]);
|
8272
8406
|
};
|
8407
|
+
CrispMessage.prototype.offMessageComposeSent = function() {
|
8408
|
+
this.parent.createSingletonIfNecessary();
|
8409
|
+
window.$crisp.push([ "off", "message:compose:sent" ]);
|
8410
|
+
};
|
8273
8411
|
CrispMessage.prototype.onMessageComposeReceived = function(callback) {
|
8274
8412
|
this.parent.createSingletonIfNecessary();
|
8275
|
-
|
8413
|
+
this.offMessageComposeReceived();
|
8276
8414
|
window.$crisp.push([ "on", "message:compose:received", callback ]);
|
8277
8415
|
};
|
8416
|
+
CrispMessage.prototype.offMessageComposeReceived = function() {
|
8417
|
+
this.parent.createSingletonIfNecessary();
|
8418
|
+
window.$crisp.push([ "off", "message:compose:received" ]);
|
8419
|
+
};
|
8278
8420
|
return CrispMessage;
|
8279
8421
|
}();
|
8280
8422
|
|
@@ -8300,16 +8442,18 @@ var CrispUser = function() {
|
|
8300
8442
|
};
|
8301
8443
|
CrispUser.prototype.setCompany = function(name, data) {
|
8302
8444
|
var _payload = {};
|
8303
|
-
if (data
|
8304
|
-
|
8305
|
-
|
8306
|
-
|
8307
|
-
|
8308
|
-
|
8309
|
-
|
8310
|
-
|
8311
|
-
|
8312
|
-
|
8445
|
+
if (data) {
|
8446
|
+
if (data.url) {
|
8447
|
+
_payload.url = data.url;
|
8448
|
+
}
|
8449
|
+
if (data.description) {
|
8450
|
+
_payload.description = data.description;
|
8451
|
+
}
|
8452
|
+
if (data.employment) {
|
8453
|
+
_payload.employment = [ data.employment.title ];
|
8454
|
+
if (data.employment.role) {
|
8455
|
+
_payload.employment.push(data.employment.role);
|
8456
|
+
}
|
8313
8457
|
}
|
8314
8458
|
}
|
8315
8459
|
this.parent.createSingletonIfNecessary();
|
@@ -8347,28 +8491,48 @@ var CrispUser = function() {
|
|
8347
8491
|
};
|
8348
8492
|
CrispUser.prototype.onEmailChanged = function(callback) {
|
8349
8493
|
if (this.parent.isCrispInjected()) {
|
8350
|
-
|
8494
|
+
this.offEmailChanged();
|
8351
8495
|
window.$crisp.push([ "on", "user:email:changed", callback ]);
|
8352
8496
|
}
|
8353
8497
|
};
|
8498
|
+
CrispUser.prototype.offEmailChanged = function() {
|
8499
|
+
if (this.parent.isCrispInjected()) {
|
8500
|
+
window.$crisp.push([ "off", "user:email:changed" ]);
|
8501
|
+
}
|
8502
|
+
};
|
8354
8503
|
CrispUser.prototype.onPhoneChanged = function(callback) {
|
8355
8504
|
if (this.parent.isCrispInjected()) {
|
8356
|
-
|
8505
|
+
this.offPhoneChanged();
|
8357
8506
|
window.$crisp.push([ "on", "user:phone:changed", callback ]);
|
8358
8507
|
}
|
8359
8508
|
};
|
8509
|
+
CrispUser.prototype.offPhoneChanged = function() {
|
8510
|
+
if (this.parent.isCrispInjected()) {
|
8511
|
+
window.$crisp.push([ "off", "user:phone:changed" ]);
|
8512
|
+
}
|
8513
|
+
};
|
8360
8514
|
CrispUser.prototype.onNicknameChanged = function(callback) {
|
8361
8515
|
if (this.parent.isCrispInjected()) {
|
8362
|
-
|
8516
|
+
this.offNicknameChanged();
|
8363
8517
|
window.$crisp.push([ "on", "user:nickname:changed", callback ]);
|
8364
8518
|
}
|
8365
8519
|
};
|
8520
|
+
CrispUser.prototype.offNicknameChanged = function() {
|
8521
|
+
if (this.parent.isCrispInjected()) {
|
8522
|
+
window.$crisp.push([ "off", "user:nickname:changed" ]);
|
8523
|
+
}
|
8524
|
+
};
|
8366
8525
|
CrispUser.prototype.onAvatarChanged = function(callback) {
|
8367
8526
|
if (this.parent.isCrispInjected()) {
|
8368
|
-
|
8527
|
+
this.offAvatarChanged();
|
8369
8528
|
window.$crisp.push([ "on", "user:avatar:changed", callback ]);
|
8370
8529
|
}
|
8371
8530
|
};
|
8531
|
+
CrispUser.prototype.offAvatarChanged = function() {
|
8532
|
+
if (this.parent.isCrispInjected()) {
|
8533
|
+
window.$crisp.push([ "off", "user:avatar:changed" ]);
|
8534
|
+
}
|
8535
|
+
};
|
8372
8536
|
return CrispUser;
|
8373
8537
|
}();
|
8374
8538
|
|
@@ -8407,7 +8571,7 @@ var CrispSession = function() {
|
|
8407
8571
|
reload = false;
|
8408
8572
|
}
|
8409
8573
|
if (this.parent.isCrispInjected()) {
|
8410
|
-
window.$crisp.
|
8574
|
+
window.$crisp.push([ "do", "session:reset", [ reload ] ]);
|
8411
8575
|
}
|
8412
8576
|
};
|
8413
8577
|
CrispSession.prototype.setSegments = function(segments, overwrite) {
|
@@ -8450,9 +8614,13 @@ var CrispSession = function() {
|
|
8450
8614
|
};
|
8451
8615
|
CrispSession.prototype.onLoaded = function(callback) {
|
8452
8616
|
this.parent.createSingletonIfNecessary();
|
8453
|
-
|
8617
|
+
this.offLoaded();
|
8454
8618
|
window.$crisp.push([ "on", "session:loaded", callback ]);
|
8455
8619
|
};
|
8620
|
+
CrispSession.prototype.offLoaded = function() {
|
8621
|
+
this.parent.createSingletonIfNecessary();
|
8622
|
+
window.$crisp.push([ "off", "session:loaded" ]);
|
8623
|
+
};
|
8456
8624
|
CrispSession.prototype.isValidDataValue = function(value) {
|
8457
8625
|
return typeof value === "string" || typeof value === "number" || typeof value === "boolean";
|
8458
8626
|
};
|
@@ -8512,24 +8680,40 @@ var CrispChat = function() {
|
|
8512
8680
|
};
|
8513
8681
|
CrispChat.prototype.onChatInitiated = function(callback) {
|
8514
8682
|
this.parent.createSingletonIfNecessary();
|
8515
|
-
|
8683
|
+
this.offChatInitiated();
|
8516
8684
|
window.$crisp.push([ "on", "chat:initiated", callback ]);
|
8517
8685
|
};
|
8686
|
+
CrispChat.prototype.offChatInitiated = function() {
|
8687
|
+
this.parent.createSingletonIfNecessary();
|
8688
|
+
window.$crisp.push([ "off", "chat:initiated" ]);
|
8689
|
+
};
|
8518
8690
|
CrispChat.prototype.onChatOpened = function(callback) {
|
8519
8691
|
this.parent.createSingletonIfNecessary();
|
8520
|
-
|
8692
|
+
this.offChatOpened();
|
8521
8693
|
window.$crisp.push([ "on", "chat:opened", callback ]);
|
8522
8694
|
};
|
8695
|
+
CrispChat.prototype.offChatOpened = function() {
|
8696
|
+
this.parent.createSingletonIfNecessary();
|
8697
|
+
window.$crisp.push([ "off", "chat:opened" ]);
|
8698
|
+
};
|
8523
8699
|
CrispChat.prototype.onChatClosed = function(callback) {
|
8524
8700
|
this.parent.createSingletonIfNecessary();
|
8525
|
-
|
8701
|
+
this.offChatClosed();
|
8526
8702
|
window.$crisp.push([ "on", "chat:closed", callback ]);
|
8527
8703
|
};
|
8704
|
+
CrispChat.prototype.offChatClosed = function() {
|
8705
|
+
this.parent.createSingletonIfNecessary();
|
8706
|
+
window.$crisp.push([ "off", "chat:closed" ]);
|
8707
|
+
};
|
8528
8708
|
CrispChat.prototype.onHelpdeskQueried = function(callback) {
|
8529
8709
|
this.parent.createSingletonIfNecessary();
|
8530
|
-
|
8710
|
+
this.offHelpdeskQueried();
|
8531
8711
|
window.$crisp.push([ "on", "helpdesk:queried", callback ]);
|
8532
8712
|
};
|
8713
|
+
CrispChat.prototype.offHelpdeskQueried = function() {
|
8714
|
+
this.parent.createSingletonIfNecessary();
|
8715
|
+
window.$crisp.push([ "off", "helpdesk:queried" ]);
|
8716
|
+
};
|
8533
8717
|
return CrispChat;
|
8534
8718
|
}();
|
8535
8719
|
|
@@ -8698,9 +8882,13 @@ var Crisp = function() {
|
|
8698
8882
|
};
|
8699
8883
|
Crisp.prototype.onWebsiteAvailabilityChanged = function(callback) {
|
8700
8884
|
this.createSingletonIfNecessary();
|
8701
|
-
|
8885
|
+
this.offWebsiteAvailabilityChanged();
|
8702
8886
|
window.$crisp.push([ "on", "website:availability:changed", callback ]);
|
8703
8887
|
};
|
8888
|
+
Crisp.prototype.offWebsiteAvailabilityChanged = function() {
|
8889
|
+
this.createSingletonIfNecessary();
|
8890
|
+
window.$crisp.push([ "off", "website:availability:changed" ]);
|
8891
|
+
};
|
8704
8892
|
Crisp.prototype.createSingletonIfNecessary = function() {
|
8705
8893
|
if (window.$crisp === undefined) {
|
8706
8894
|
window.$crisp = [];
|