__d(function(g, r, i, a, m, e, d) {
"use strict";
function n(n) {
return n[2] >= Date.now() - a(d[1]).EXPIRY
}
function t(n, t) {
n.__meta.status = B, n[3] = (n[3] || 0) + 1, !n.__meta.retry && t >= 400 && t < 600 && R.push(n)
}
function o(n, t, o, u) {
var s = [n, t, o, 0];
return s.__meta = {
retry: !0 === u,
pageID: i(d[2]),
userID: a(d[3]).getID(),
status: B
}, s
}
function u(n) {
var t = Date.now() + n;
return (!D || t < D) && (D = t, clearTimeout(b), b = setTimeout(U, n), !0)
}
function s(n, o) {
if (D = null, u(a(d[1]).BASIC_WAIT), i(d[5]).readyToSend()) {
i(d[5]).inform(a(d[6]).SEND);
var s = [],
c = [];
if (R = f(s, c, !0, R), s.length <= 0) return i(d[5]).inform(a(d[6]).OK), void(n && n());
s[0].trigger = N, N = null, s[0].send_method = 'ajax', i(d[5]).send(s, function() {
c.forEach(function(n) {
n.__meta.status = z, n.__meta.callback && n.__meta.callback()
}), n && n()
}, function(n) {
c.forEach(function(o) {
t(o, n)
}), o && o()
})
} else o && o()
}
function c() {
if (E.canUseNavigatorBeacon()) {
var n = [],
t = [];
if (R = f(n, t, !1, R), !(n.length <= 0)) {
if (!i(d[5]).sendWithBeacon(n)) {
var u;
t.forEach(function(n) {
R.push(n)
}), R.push(o(T, (u = {}, u[y] = [1], u), Date.now()))
}
}
}
}
function f(t, o, u, s) {
var c = {};
return s.filter(function(s) {
var f = s.__meta;
if (f.status >= z || !n(s)) return !1;
if (f.status >= w) return !0;
var l = f.pageID + f.userID,
_ = c[l];
return _ || (_ = {
user: f.userID,
page_id: f.pageID,
posts: []
}, c[l] = _, t.push(_)), f.status = w, _.posts.push(s), o.push(s), u && f.retry
})
}
function l() {
return A || (A = !0, k = i(d[7]).getLocalStorage()), k
}
function _() {
I || (I = O ? {
store: function() {},
restore: function() {}
} : {
store: function() {
var n = l();
if (n && !(R.length <= 0)) {
var t = R.map(function(n) {
return [n[0], n[1], n[2], n[3] || 0, n.__meta]
});
R = [], n.setItem(S + i(d[2]) + '.' + Date.now(), JSON.stringify(t))
}
},
restore: function() {
var t = l();
t && new(i(d[8]))('banzai').lock(function(o) {
for (var u = [], s = 0; s < t.length; s++) {
var c = t.key(s);
0 === c.indexOf(S) && 0 !== c.indexOf('bz:__') && u.push(c)
}
u.forEach(function(o) {
var u = t.getItem(o);
if (t.removeItem(o), u) {
JSON.parse(u, m.id).forEach(function(t) {
if (t) {
var o = t.__meta = t.pop();
if (n(t)) {
var u = a(d[3]).getID();
o.userID !== u && '0' !== u || (o.status = B, R.push(t))
}
}
})
}
}), o.unlock()
})
}
})
}
function v(n) {
i(d[5]).inform(a(d[6]).STORE), _(), I.store()
}
function p(n) {
_(), I.restore(), i(d[5]).inform(a(d[6]).RESTORE), u(a(d[1]).RESTORE_WAIT)
}
function h() {
i(d[11]).unload(E.post), i(d[5]).cleanup(), i(d[5]).inform(a(d[6]).SHUTDOWN), R.length > 0 && c(), i(d[5]).inform(a(d[6]).STORE), _(), I.store()
}
Object.defineProperty(e, '__esModule', {
value: !0
});
var b, D, I, k, E = {},
O = i(d[0])(),
S = 'bz:',
T = 'ods:banzai',
y = 'send_via_beacon_failure',
B = 0,
w = 1,
z = 2,
R = [],
N = null,
U = i(d[4]).guard(function() {
s(null, null)
}, 'Banzai.send', {
isContinuation: !1
}),
A = !1;
E.isEnabled = function(n) {
return a(d[1]).gks && a(d[1]).gks[n]
}, E.post = function(n, s, c) {
n || i(d[9])('Banzai.post called without specifying a route');
var f = (c = c || {}).retry;
if (!a(d[1]).disabled && r(d[10]).canUseDOM && !a(d[1]).blacklist.has(n)) {
var l = o(n, s, Date.now(), f);
c.callback && (l.__meta.callback = c.callback);
var _ = c.delay;
if (null == _ && (_ = a(d[1]).BASIC_WAIT), c.signal) {
l.__meta.status = w;
var v = [{
user: a(d[3]).getID(),
page_id: i(d[2]),
posts: [l],
trigger: n
}];
if (i(d[5]).send(v, function() {
l.__meta.status = z, l.__meta.callback && l.__meta.callback()
}, function(n) {
t(l, n)
}, !0), !f) return
}
R.push(l), !u(_) && N || (N = n)
}
}, E.flush = function(n, t) {
clearTimeout(b), b = 0, s(n, t)
}, E.subscribe = i(d[5]).subscribe, E.canUseNavigatorBeacon = function() {
return navigator && navigator.sendBeacon
}, E._schedule = u, (E._initialize = function() {
r(d[10]).canUseDOM && (i(d[5]).setHooks(function(n) {
c(), v()
}, p), i(d[5]).setUnloadHook(h))
})(), E._clearBuffer = function() {
R = []
}, E._clearStorage = function() {
I = void 0, k = void 0, A = !1
};
var W = E;
e.default = W
}, 5898372, [917563, 917509, 3932239, 917564, 131174, 917565, 5898373, 5898267, 917566, 5898348, 131177, 917567]);