function Ve(e, t, n, r, u) {
    for (t = t.split ? t.split(".") : t, r = 0; r < t.length; r++) e = e ? e[t[r]] : u;
    return e === u ? n : e
}
var jt = "function",
    Ct = "string",
    ie = "undefined",
    Dt = "boolean",
    _e = "object",
    $t = "array",
    Mt = "number",
    Ut = "symbol",
    Lt = "null",
    oe = "__",
    zt = "form",
    Rt = "input",
    qt = "button",
    Vt = "select",
    Se = typeof process !== ie ? process : {};
Se.env && Se.env.NODE_ENV;
var H = typeof document !== ie;
Se.versions != null && Se.versions.node != null;
typeof Deno !== ie && Deno.core;
H && window.name === "nodejs" || typeof navigator !== ie && typeof navigator.userAgent !== ie && (navigator.userAgent.includes("Node.js") || navigator.userAgent.includes("jsdom"));

function lt(e, t) {
    return t.charAt(0)[e]() + t.slice(1)
}
var Gt = lt.bind(null, "toUpperCase"),
    Bt = lt.bind(null, "toLowerCase");

function Ft(e) {
    return dt(e) ? Gt(Lt) : typeof e === _e ? Xt(e) : Object.prototype.toString.call(e).slice(8, -1)
}

function ke(e, t) {
    t === void 0 && (t = !0);
    var n = Ft(e);
    return t ? Bt(n) : n
}

function ve(e, t) {
    return typeof t === e
}
var J = ve.bind(null, jt),
    ge = ve.bind(null, Ct);
ve.bind(null, ie);
var Kt = ve.bind(null, Dt);
ve.bind(null, Ut);

function dt(e) {
    return e === null
}

function Zt(e) {
    return ke(e) === Mt && !isNaN(e)
}

function Ht(e) {
    return ke(e) === $t
}

function Z(e) {
    if (!Jt(e)) return !1;
    for (var t = e; Object.getPrototypeOf(t) !== null;) t = Object.getPrototypeOf(t);
    return Object.getPrototypeOf(e) === t
}

function Jt(e) {
    return e && (typeof e === _e || e !== null)
}

function Xt(e) {
    return J(e.constructor) ? e.constructor.name : null
}

function Wt(e) {
    return e instanceof Error || ge(e.message) && e.constructor && Zt(e.constructor.stackTraceLimit)
}

function ft(e, t) {
    if (typeof t != "object" || dt(t)) return !1;
    if (t instanceof e) return !0;
    var n = ke(new e(""));
    if (Wt(t))
        for (; t;) {
            if (ke(t) === n) return !0;
            t = Object.getPrototypeOf(t)
        }
    return !1
}
ft.bind(null, TypeError);
ft.bind(null, SyntaxError);

function Oe(e, t) {
    var n = e instanceof Element || e instanceof HTMLDocument;
    return n && t ? Qt(e, t) : n
}

function Qt(e, t) {
    return t === void 0 && (t = ""), e && e.nodeName === t.toUpperCase()
}

function xe(e) {
    var t = [].slice.call(arguments, 1);
    return function() {
        return e.apply(void 0, [].slice.call(arguments).concat(t))
    }
}
xe(Oe, zt);
xe(Oe, qt);
xe(Oe, Rt);
xe(Oe, Vt);

function Ge(e) {
    try {
        return decodeURIComponent(e.replace(/\+/g, " "))
    } catch {
        return null
    }
}

function Yt() {
    if (H) {
        var e = navigator,
            t = e.languages;
        return e.userLanguage || (t && t.length ? t[0] : e.language)
    }
}

function en() {
    try {
        return Intl.DateTimeFormat().resolvedOptions().timeZone
    } catch {}
}

function tn(e) {
    return (function(t) {
        for (var n, r = Object.create(null), u = /([^&=]+)=?([^&]*)/g; n = u.exec(t);) {
            var c = Ge(n[1]),
                a = Ge(n[2]);
            if (c)
                if (c.substring(c.length - 2) === "[]") {
                    var s = r[c = c.substring(0, c.length - 2)] || (r[c] = []);
                    r[c] = Array.isArray(s) ? s : [], r[c].push(a)
                } else r[c] = a === "" || a
        }
        for (var d in r) {
            var p = d.split("[");
            p.length > 1 && (nn(r, p.map(function($) {
                return $.replace(/[?[\]\\ ]/g, "")
            }), r[d]), delete r[d])
        }
        return r
    })((function(t) {
        return H && window.location.search.substring(1)
    })())
}

function nn(e, t, n) {
    for (var r = t.length - 1, u = 0; u < r; ++u) {
        var c = t[u];
        if (c === "__proto__" || c === "constructor") break;
        c in e || (e[c] = {}), e = e[c]
    }
    e[t[r]] = n
}

function Te() {
    for (var e = "", t = 0, n = 4294967295 * Math.random() | 0; t++ < 36;) {
        var r = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx" [t - 1],
            u = 15 & n;
        e += r == "-" || r == "4" ? r : (r == "x" ? u : 3 & u | 8).toString(16), n = t % 8 == 0 ? 4294967295 * Math.random() | 0 : n >> 4
    }
    return e
}
var pt = "global",
    ce = oe + pt + oe,
    le = typeof self === _e && self.self === self && self || typeof global === _e && global[pt] === global && global || void 0;

function Be(e) {
    return le[ce][e]
}

function Me(e, t) {
    return le[ce][e] = t
}

function mt(e) {
    delete le[ce][e]
}
le[ce] || (le[ce] = {});

function b() {
    return b = Object.assign ? Object.assign.bind() : function(e) {
        for (var t = 1; t < arguments.length; t++) {
            var n = arguments[t];
            for (var r in n)({}).hasOwnProperty.call(n, r) && (e[r] = n[r])
        }
        return e
    }, b.apply(null, arguments)
}
var Y = "function",
    W = "undefined",
    ye = "reducer",
    gt = "@@redux/",
    Ue = gt + "INIT",
    rn = gt + Math.random().toString(36),
    Fe = (function() {
        return typeof Symbol === Y && Symbol.observable || "@@observable"
    })(),
    we = " != " + Y;

function yt(e, t, n) {
    var r;
    if (typeof t === Y && typeof n === W && (n = t, t = void 0), typeof n !== W) {
        if (typeof n !== Y) throw new Error("enhancer" + we);
        return n(yt)(e, t)
    }
    if (typeof e !== Y) throw new Error(ye + we);
    var u = e,
        c = t,
        a = [],
        s = a,
        d = !1;

    function p() {
        s === a && (s = a.slice())
    }

    function $() {
        return c
    }

    function m(h) {
        if (typeof h !== Y) throw new Error("Listener" + we);
        var _ = !0;
        return p(), s.push(h),
            function() {
                if (_) {
                    _ = !1, p();
                    var P = s.indexOf(h);
                    s.splice(P, 1)
                }
            }
    }

    function E(h) {
        if (!Z(h)) throw new Error("Act != obj");
        if (typeof h.type === W) throw new Error("ActType " + W);
        if (d) throw new Error("Dispatch in " + ye);
        try {
            d = !0, c = u(c, h)
        } finally {
            d = !1
        }
        for (var _ = a = s, P = 0; P < _.length; P++)(0, _[P])();
        return h
    }
    return E({
        type: Ue
    }), (r = {
        dispatch: E,
        subscribe: m,
        getState: $,
        replaceReducer: function(h) {
            if (typeof h !== Y) throw new Error("next " + ye + we);
            u = h, E({
                type: Ue
            })
        }
    })[Fe] = function() {
        var h, _ = m;
        return (h = {
            subscribe: function(P) {
                if (typeof P != "object") throw new TypeError("Observer != obj");

                function w() {
                    P.next && P.next($())
                }
                return w(), {
                    unsubscribe: _(w)
                }
            }
        })[Fe] = function() {
            return this
        }, h
    }, r
}

function on(e, t) {
    var n = t && t.type;
    return "action " + (n && n.toString() || "?") + ye + " " + e + " returns " + W
}

function de() {
    var e = [].slice.call(arguments);
    return e.length === 0 ? function(t) {
        return t
    } : e.length === 1 ? e[0] : e.reduce(function(t, n) {
        return function() {
            return t(n.apply(void 0, [].slice.call(arguments)))
        }
    })
}

function an() {
    var e = arguments;
    return function(t) {
        return function(n, r, u) {
            var c, a = t(n, r, u),
                s = a.dispatch,
                d = {
                    getState: a.getState,
                    dispatch: function(p) {
                        return s(p)
                    }
                };
            return c = [].slice.call(e).map(function(p) {
                return p(d)
            }), b({}, a, {
                dispatch: s = de.apply(void 0, c)(a.dispatch)
            })
        }
    }
}
var te = oe + "anon_id",
    re = oe + "user_id",
    ue = oe + "user_traits",
    Le = "analytics",
    Q = "userId",
    ae = "anonymousId",
    Ee = ["bootstrap", "params", "campaign", "initializeStart", "initialize", "initializeEnd", "ready", "resetStart", "reset", "resetEnd", "pageStart", "page", "pageEnd", "pageAborted", "trackStart", "track", "trackEnd", "trackAborted", "identifyStart", "identify", "identifyEnd", "identifyAborted", "userIdChanged", "registerPlugins", "enablePlugin", "disablePlugin", "online", "offline", "setItemStart", "setItem", "setItemEnd", "setItemAborted", "removeItemStart", "removeItem", "removeItemEnd", "removeItemAborted"],
    ze = ["name", "EVENTS", "config", "loaded"],
    v = Ee.reduce(function(e, t) {
        return e[t] = t, e
    }, {
        registerPluginType: function(e) {
            return "registerPlugin:" + e
        },
        pluginReadyType: function(e) {
            return "ready:" + e
        }
    }),
    Ke = /^utm_/,
    Ze = /^an_prop_/,
    He = /^an_trait_/;

function un(e) {
    var t = e.storage.setItem;
    return function(n) {
        return function(r) {
            return function(u) {
                if (u.type === v.bootstrap) {
                    var c = u.params,
                        a = u.user,
                        s = u.persistedUser,
                        d = u.initialUser,
                        p = s.userId === a.userId;
                    s.anonymousId !== a.anonymousId && t(te, a.anonymousId), p || t(re, a.userId), d.traits && t(ue, b({}, p && s.traits ? s.traits : {}, d.traits));
                    var $ = Object.keys(u.params);
                    if ($.length) {
                        var m = c.an_uid,
                            E = c.an_event,
                            h = $.reduce(function(_, P) {
                                if (P.match(Ke) || P.match(/^(d|g)clid/)) {
                                    var w = P.replace(Ke, "");
                                    _.campaign[w === "campaign" ? "name" : w] = c[P]
                                }
                                return P.match(Ze) && (_.props[P.replace(Ze, "")] = c[P]), P.match(He) && (_.traits[P.replace(He, "")] = c[P]), _
                            }, {
                                campaign: {},
                                props: {},
                                traits: {}
                            });
                        n.dispatch(b({
                            type: v.params,
                            raw: c
                        }, h, m ? {
                            userId: m
                        } : {})), m && setTimeout(function() {
                            return e.identify(m, h.traits)
                        }, 0), E && setTimeout(function() {
                            return e.track(E, h.props)
                        }, 0), Object.keys(h.campaign).length && n.dispatch({
                            type: v.campaign,
                            campaign: h.campaign
                        })
                    }
                }
                return r(u)
            }
        }
    }
}

function sn(e) {
    return function(t, n) {
        if (t === void 0 && (t = {}), n === void 0 && (n = {}), n.type === v.setItemEnd) {
            if (n.key === te) return b({}, t, {
                anonymousId: n.value
            });
            if (n.key === re) return b({}, t, {
                userId: n.value
            })
        }
        switch (n.type) {
            case v.identify:
                return Object.assign({}, t, {
                    userId: n.userId,
                    traits: b({}, t.traits, n.traits)
                });
            case v.reset:
                return [re, te, ue].forEach(function(r) {
                    e.removeItem(r)
                }), Object.assign({}, t, {
                    userId: null,
                    anonymousId: null,
                    traits: {}
                });
            default:
                return t
        }
    }
}

function Je(e) {
    return {
        userId: e.getItem(re),
        anonymousId: e.getItem(te),
        traits: e.getItem(ue)
    }
}
var Re = function(e) {
    return oe + "TEMP" + oe + e
};

function cn(e) {
    var t = e.storage,
        n = t.setItem,
        r = t.removeItem,
        u = t.getItem;
    return function(c) {
        return function(a) {
            return function(s) {
                var d = s.userId,
                    p = s.traits,
                    $ = s.options;
                if (s.type === v.reset && ([re, ue, te].forEach(function(h) {
                        r(h)
                    }), [Q, ae, "traits"].forEach(function(h) {
                        mt(Re(h))
                    })), s.type === v.identify) {
                    u(te) || n(te, Te());
                    var m = u(re),
                        E = u(ue) || {};
                    m && m !== d && c.dispatch({
                        type: v.userIdChanged,
                        old: {
                            userId: m,
                            traits: E
                        },
                        new: {
                            userId: d,
                            traits: p
                        },
                        options: $
                    }), d && n(re, d), p && n(ue, b({}, E, p))
                }
                return a(s)
            }
        }
    }
}
var me = {};

function Xe(e, t) {
    me[e] && J(me[e]) && (me[e](t), delete me[e])
}

function ht(e, t, n) {
    return new Promise(function(r, u) {
        return t() ? r(e) : n < 1 ? u(b({}, e, {
            queue: !0
        })) : new Promise(function(c) {
            return setTimeout(c, 10)
        }).then(function(c) {
            return ht(e, t, n - 10).then(r, u)
        })
    })
}

function ln(e) {
    return {
        abort: e
    }
}

function vt(e, t, n) {
    var r = {},
        u = t(),
        c = e.getState(),
        a = c.plugins,
        s = c.queue,
        d = c.user;
    if (!c.context.offline && s && s.actions && s.actions.length) {
        var p = s.actions.reduce(function(m, E, h) {
            return a[E.plugin].loaded ? (m.process.push(E), m.processIndex.push(h)) : (m.requeue.push(E), m.requeueIndex.push(h)), m
        }, {
            processIndex: [],
            process: [],
            requeue: [],
            requeueIndex: []
        });
        if (p.processIndex && p.processIndex.length) {
            p.processIndex.forEach(function(m) {
                var E = s.actions[m],
                    h = E.plugin,
                    _ = E.payload.type,
                    P = u[h][_];
                if (P && J(P)) {
                    var w, x = (function(g, l) {
                            return g === void 0 && (g = {}), l === void 0 && (l = {}), [Q, ae].reduce(function(M, S) {
                                return g.hasOwnProperty(S) && l[S] && l[S] !== g[S] && (M[S] = l[S]), M
                            }, g)
                        })(E.payload, d),
                        C = r[x.meta.rid];
                    if (!C && (w = P({
                            payload: x,
                            config: a[h].config,
                            instance: n,
                            abort: ln
                        })) && Z(w) && w.abort) return void(r[x.meta.rid] = !0);
                    if (!C) {
                        var k = _ + ":" + h;
                        e.dispatch(b({}, x, {
                            type: k,
                            _: {
                                called: k,
                                from: "queueDrain"
                            }
                        }))
                    }
                }
            });
            var $ = s.actions.filter(function(m, E) {
                return !~p.processIndex.indexOf(E)
            });
            s.actions = $
        }
    }
}
var je = function(e) {
        var t = e.data,
            n = e.action,
            r = e.instance,
            u = e.state,
            c = e.allPlugins,
            a = e.allMatches,
            s = e.store,
            d = e.EVENTS;
        try {
            var p = u.plugins,
                $ = u.context,
                m = n.type,
                E = m.match(se),
                h = t.exact.map(function(w) {
                    return w.pluginName
                });
            E && (h = a.during.map(function(w) {
                return w.pluginName
            }));
            var _ = (function(w, x) {
                    return function(C, k, g) {
                        var l = k.config,
                            M = k.name,
                            S = M + "." + C.type;
                        g && (S = g.event);
                        var T = C.type.match(se) ? (function(z, L, G, R, U) {
                            return function(N, y) {
                                var V = R ? R.name : z,
                                    K = y && he(y) ? y : G;
                                if (R && (!(K = y && he(y) ? y : [z]).includes(z) || K.length !== 1)) throw new Error("Method " + L + " can only abort " + z + " plugin. " + JSON.stringify(K) + " input valid");
                                return b({}, U, {
                                    abort: {
                                        reason: N,
                                        plugins: K,
                                        caller: L,
                                        _: V
                                    }
                                })
                            }
                        })(M, S, x, g, C) : (function(z, L) {
                            return function() {
                                throw new Error(z.type + " action not cancellable. Remove abort in " + L)
                            }
                        })(C, S);
                        return {
                            payload: dn(C),
                            instance: w,
                            config: l || {},
                            abort: T
                        }
                    }
                })(r, h),
                P = t.exact.reduce(function(w, x) {
                    var C = x.pluginName,
                        k = x.methodName,
                        g = !1;
                    return k.match(/^initialize/) || k.match(/^reset/) || (g = !p[C].loaded), $.offline && k.match(/^(page|track|identify)/) && (g = !0), w["" + C] = g, w
                }, {});
            return Promise.resolve(t.exact.reduce(function(w, x, C) {
                var k = x.pluginName;
                return Promise.resolve(w).then(function(g) {
                    function l() {
                        return Promise.resolve(g)
                    }
                    var M = (function() {
                        if (t.namespaced && t.namespaced[k]) return Promise.resolve(t.namespaced[k].reduce(function(S, T, z) {
                            return Promise.resolve(S).then(function(L) {
                                return T.method && J(T.method) ? ((function(N, y) {
                                    var V = rt(N);
                                    if (V && V.name === y) {
                                        var K = rt(V.method);
                                        throw new Error([y + " plugin is calling method " + N, "Plugins cant call self", "Use " + V.method + " " + (K ? "or " + K.method : "") + " in " + y + " plugin insteadof " + N].join(`
`))
                                    }
                                })(T.methodName, T.pluginName), Promise.resolve(T.method({
                                    payload: L,
                                    instance: r,
                                    abort: (G = L, R = k, U = T.pluginName, function(N, y) {
                                        return b({}, G, {
                                            abort: {
                                                reason: N,
                                                plugins: y || [R],
                                                caller: m,
                                                from: U || R
                                            }
                                        })
                                    }),
                                    config: Ye(T.pluginName, p, c),
                                    plugins: p
                                })).then(function(N) {
                                    var y = Z(N) ? N : {};
                                    return Promise.resolve(b({}, L, y))
                                })) : L;
                                var G, R, U
                            })
                        }, Promise.resolve(n))).then(function(S) {
                            g[k] = S
                        });
                        g[k] = n
                    })();
                    return M && M.then ? M.then(l) : l()
                })
            }, Promise.resolve({}))).then(function(w) {
                return Promise.resolve(t.exact.reduce(function(x, C, k) {
                    try {
                        var g = t.exact.length === k + 1,
                            l = C.pluginName,
                            M = c[l];
                        return Promise.resolve(x).then(function(S) {
                            var T = w[l] ? w[l] : {};
                            if (E && (T = S), De(T, l)) return Ce({
                                data: T,
                                method: m,
                                instance: r,
                                pluginName: l,
                                store: s
                            }), Promise.resolve(S);
                            if (De(S, l)) return g && Ce({
                                data: S,
                                method: m,
                                instance: r,
                                store: s
                            }), Promise.resolve(S);
                            if (P.hasOwnProperty(l) && P[l] === !0) return s.dispatch({
                                type: "queue",
                                plugin: l,
                                payload: T,
                                _: {
                                    called: "queue",
                                    from: "queueMechanism"
                                }
                            }), Promise.resolve(S);
                            var z = _(w[l], c[l]);
                            return Promise.resolve(M[m]({
                                abort: z.abort,
                                payload: T,
                                instance: r,
                                config: Ye(l, p, c),
                                plugins: p
                            })).then(function(L) {
                                var G = Z(L) ? L : {},
                                    R = b({}, S, G),
                                    U = w[l];
                                if (De(U, l)) Ce({
                                    data: U,
                                    method: m,
                                    instance: r,
                                    pluginName: l,
                                    store: s
                                });
                                else {
                                    var N = m + ":" + l;
                                    (N.match(/:/g) || []).length < 2 && !m.match(We) && !m.match(Qe) && r.dispatch(b({}, E ? R : T, {
                                        type: N,
                                        _: {
                                            called: N,
                                            from: "submethod"
                                        }
                                    }))
                                }
                                return Promise.resolve(R)
                            })
                        })
                    } catch (S) {
                        return Promise.reject(S)
                    }
                }, Promise.resolve(n))).then(function(x) {
                    if (!(m.match(se) || m.match(/^registerPlugin/) || m.match(Qe) || m.match(We) || m.match(/^params/) || m.match(/^userIdChanged/))) {
                        if (d.plugins.includes(m), x._ && x._.originalAction === m) return x;
                        var C = b({}, x, {
                            _: {
                                originalAction: x.type,
                                called: x.type,
                                from: "engineEnd"
                            }
                        });
                        bt(x, t.exact.length) && !m.match(/End$/) && (C = b({}, C, {
                            type: x.type + "Aborted"
                        })), s.dispatch(C)
                    }
                    return x
                })
            })
        } catch (w) {
            return Promise.reject(w)
        }
    },
    se = /Start$/,
    We = /^bootstrap/,
    Qe = /^ready/;

function Ce(e) {
    var t = e.pluginName,
        n = e.method + "Aborted" + (t ? ":" + t : "");
    e.store.dispatch(b({}, e.data, {
        type: n,
        _: {
            called: n,
            from: "abort"
        }
    }))
}

function Ye(e, t, n) {
    var r = t[e] || n[e];
    return r && r.config ? r.config : {}
}

function et(e, t) {
    return t.reduce(function(n, r) {
        return r[e] ? n.concat({
            methodName: e,
            pluginName: r.name,
            method: r[e]
        }) : n
    }, [])
}

function tt(e, t) {
    var n = e.replace(se, ""),
        r = t ? ":" + t : "";
    return ["" + e + r, "" + n + r, n + "End" + r]
}

function De(e, t) {
    var n = e.abort;
    return !!n && (n === !0 || nt(n, t) || n && nt(n.plugins, t))
}

function bt(e, t) {
    var n = e.abort;
    if (!n) return !1;
    if (n === !0 || ge(n)) return !0;
    var r = n.plugins;
    return he(n) && n.length === t || he(r) && r.length === t
}

function he(e) {
    return Array.isArray(e)
}

function nt(e, t) {
    return !(!e || !he(e)) && e.includes(t)
}

function rt(e) {
    var t = e.match(/(.*):(.*)/);
    return !!t && {
        method: t[1],
        name: t[2]
    }
}

function dn(e) {
    return Object.keys(e).reduce(function(t, n) {
        return n === "type" || (t[n] = Z(e[n]) ? Object.assign({}, e[n]) : e[n]), t
    }, {})
}

function fn(e, t, n) {
    var r = {};
    return function(u) {
        return function(c) {
            return function(a) {
                try {
                    var s, d = function(g) {
                            return s ? g : c(m)
                        },
                        p = a.type,
                        $ = a.plugins,
                        m = a;
                    if (a.abort) return Promise.resolve(c(a));
                    if (p === v.enablePlugin && u.dispatch({
                            type: v.initializeStart,
                            plugins: $,
                            disabled: [],
                            fromEnable: !0,
                            meta: a.meta
                        }), p === v.disablePlugin && setTimeout(function() {
                            return Xe(a.meta.rid, {
                                payload: a
                            })
                        }, 0), p === v.initializeEnd) {
                        var E = t(),
                            h = Object.keys(E),
                            _ = h.filter(function(g) {
                                return $.includes(g)
                            }).map(function(g) {
                                return E[g]
                            }),
                            P = [],
                            w = [],
                            x = a.disabled,
                            C = _.map(function(g) {
                                var l = g.loaded,
                                    M = g.name,
                                    S = g.config;
                                return ht(g, function() {
                                    return l({
                                        config: S
                                    })
                                }, 1e4).then(function(T) {
                                    return r[M] || (u.dispatch({
                                        type: v.pluginReadyType(M),
                                        name: M,
                                        events: Object.keys(g).filter(function(z) {
                                            return !ze.includes(z)
                                        })
                                    }), r[M] = !0), P = P.concat(M), g
                                }).catch(function(T) {
                                    if (T instanceof Error) throw new Error(T);
                                    return w = w.concat(T.name), T
                                })
                            });
                        Promise.all(C).then(function(g) {
                            var l = {
                                plugins: P,
                                failed: w,
                                disabled: x
                            };
                            setTimeout(function() {
                                h.length === C.length + x.length && u.dispatch(b({}, {
                                    type: v.ready
                                }, l))
                            }, 0)
                        })
                    }
                    var k = (function() {
                        if (p !== v.bootstrap) return /^ready:([^:]*)$/.test(p) && setTimeout(function() {
                            return vt(u, t, e)
                        }, 0), Promise.resolve((function(g, l, M, S, T) {
                            try {
                                var z = J(l) ? l() : l,
                                    L = g.type,
                                    G = L.replace(se, "");
                                if (g._ && g._.called) return Promise.resolve(g);
                                var R = M.getState(),
                                    U = (V = z, (K = R.plugins) === void 0 && (K = {}), (pe = g.options) === void 0 && (pe = {}), Object.keys(V).filter(function(i) {
                                        var o = pe.plugins || {};
                                        return Kt(o[i]) ? o[i] : o.all !== !1 && (!K[i] || K[i].enabled !== !1)
                                    }).map(function(i) {
                                        return V[i]
                                    }));
                                L === v.initializeStart && g.fromEnable && (U = Object.keys(R.plugins).filter(function(i) {
                                    var o = R.plugins[i];
                                    return g.plugins.includes(i) && !o.initialized
                                }).map(function(i) {
                                    return z[i]
                                }));
                                var N = U.map(function(i) {
                                        return i.name
                                    }),
                                    y = (function(i, o) {
                                        var f = tt(i).map(function(I) {
                                            return et(I, o)
                                        });
                                        return o.reduce(function(I, A) {
                                            var O = A.name,
                                                B = tt(i, O).map(function(X) {
                                                    return et(X, o)
                                                }),
                                                D = B[0],
                                                q = B[1],
                                                j = B[2];
                                            return D.length && (I.beforeNS[O] = D), q.length && (I.duringNS[O] = q), j.length && (I.afterNS[O] = j), I
                                        }, {
                                            before: f[0],
                                            beforeNS: {},
                                            during: f[1],
                                            duringNS: {},
                                            after: f[2],
                                            afterNS: {}
                                        })
                                    })(L, U);
                                return Promise.resolve(je({
                                    action: g,
                                    data: {
                                        exact: y.before,
                                        namespaced: y.beforeNS
                                    },
                                    state: R,
                                    allPlugins: z,
                                    allMatches: y,
                                    instance: M,
                                    store: S,
                                    EVENTS: T
                                })).then(function(i) {
                                    function o() {
                                        var A = (function() {
                                            if (L.match(se)) return Promise.resolve(je({
                                                action: b({}, f, {
                                                    type: G + "End"
                                                }),
                                                data: {
                                                    exact: y.after,
                                                    namespaced: y.afterNS
                                                },
                                                state: R,
                                                allPlugins: z,
                                                allMatches: y,
                                                instance: M,
                                                store: S,
                                                EVENTS: T
                                            })).then(function(O) {
                                                O.meta && O.meta.hasCallback && Xe(O.meta.rid, {
                                                    payload: O
                                                })
                                            })
                                        })();
                                        return A && A.then ? A.then(function() {
                                            return i
                                        }) : i
                                    }
                                    if (bt(i, N.length)) return i;
                                    var f, I = (function() {
                                        if (L !== G) return Promise.resolve(je({
                                            action: b({}, i, {
                                                type: G
                                            }),
                                            data: {
                                                exact: y.during,
                                                namespaced: y.duringNS
                                            },
                                            state: R,
                                            allPlugins: z,
                                            allMatches: y,
                                            instance: M,
                                            store: S,
                                            EVENTS: T
                                        })).then(function(A) {
                                            f = A
                                        });
                                        f = i
                                    })();
                                    return I && I.then ? I.then(o) : o()
                                })
                            } catch (i) {
                                return Promise.reject(i)
                            }
                            var V, K, pe
                        })(a, t, e, u, n)).then(function(g) {
                            var l = c(g);
                            return s = 1, l
                        })
                    })();
                    return Promise.resolve(k && k.then ? k.then(d) : d(k))
                } catch (g) {
                    return Promise.reject(g)
                }
            }
        }
    }
}

function pn(e) {
    return function(t) {
        return function(n) {
            return function(r) {
                var u = r.type,
                    c = r.key,
                    a = r.value,
                    s = r.options;
                if (u === v.setItem || u === v.removeItem) {
                    if (r.abort) return n(r);
                    u === v.setItem ? e.setItem(c, a, s) : e.removeItem(c, s)
                }
                return n(r)
            }
        }
    }
}
var mn = function() {
    var e = this;
    this.before = [], this.after = [], this.addMiddleware = function(t, n) {
        e[n] = e[n].concat(t)
    }, this.removeMiddleware = function(t, n) {
        var r = e[n].findIndex(function(u) {
            return u === t
        });
        r !== -1 && (e[n] = [].concat(e[n].slice(0, r), e[n].slice(r + 1)))
    }, this.dynamicMiddlewares = function(t) {
        return function(n) {
            return function(r) {
                return function(u) {
                    var c = {
                            getState: n.getState,
                            dispatch: function(s) {
                                return n.dispatch(s)
                            }
                        },
                        a = e[t].map(function(s) {
                            return s(c)
                        });
                    return de.apply(void 0, a)(r)(u)
                }
            }
        }
    }
};

function gn(e) {
    return function(t, n) {
        t === void 0 && (t = {});
        var r = {};
        if (n.type === "initialize:aborted") return t;
        if (/^registerPlugin:([^:]*)$/.test(n.type)) {
            var u = it(n.type, "registerPlugin"),
                c = e()[u];
            if (!c || !u) return t;
            var a = n.enabled,
                s = c.config;
            return r[u] = {
                enabled: a,
                initialized: !!a && !c.initialize,
                loaded: !!a && !!c.loaded({
                    config: s
                }),
                config: s
            }, b({}, t, r)
        }
        if (/^initialize:([^:]*)$/.test(n.type)) {
            var d = it(n.type, v.initialize),
                p = e()[d];
            return p && d ? (r[d] = b({}, t[d], {
                initialized: !0,
                loaded: !!p.loaded({
                    config: p.config
                })
            }), b({}, t, r)) : t
        }
        if (/^ready:([^:]*)$/.test(n.type)) return r[n.name] = b({}, t[n.name], {
            loaded: !0
        }), b({}, t, r);
        switch (n.type) {
            case v.disablePlugin:
                return b({}, t, ot(n.plugins, !1, t));
            case v.enablePlugin:
                return b({}, t, ot(n.plugins, !0, t));
            default:
                return t
        }
    }
}

function it(e, t) {
    return e.substring(t.length + 1, e.length)
}

function ot(e, t, n) {
    return e.reduce(function(r, u) {
        return r[u] = b({}, n[u], {
            enabled: t
        }), r
    }, n)
}

function wt(e) {
    try {
        return JSON.parse(JSON.stringify(e))
    } catch {}
    return e
}
var yn = {
    last: {},
    history: []
};

function hn(e, t) {
    e === void 0 && (e = yn);
    var n = t.options,
        r = t.meta;
    if (t.type === v.track) {
        var u = wt(b({
            event: t.event,
            properties: t.properties
        }, Object.keys(n).length && {
            options: n
        }, {
            meta: r
        }));
        return b({}, e, {
            last: u,
            history: e.history.concat(u)
        })
    }
    return e
}
var vn = {
    actions: []
};

function bn(e, t) {
    e === void 0 && (e = vn);
    var n = t.payload;
    switch (t.type) {
        case "queue":
            var r;
            return r = n && n.type && n.type === v.identify ? [t].concat(e.actions) : e.actions.concat(t), b({}, e, {
                actions: r
            });
        case "dequeue":
            return [];
        default:
            return e
    }
}
var It = /#.*$/;

function wn(e) {
    var t = /(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e);
    return "/" + (t && t[3] ? t[3].split("?")[0].replace(It, "") : "")
}
var Pt, Et, _t, St, In = function(e) {
        if (e === void 0 && (e = {}), !H) return e;
        var t = document,
            n = t.title,
            r = t.referrer,
            u = window,
            c = u.location,
            a = u.innerWidth,
            s = u.innerHeight,
            d = c.hash,
            p = c.search,
            $ = (function(E) {
                var h = (function() {
                    if (H) {
                        for (var _, P = document.getElementsByTagName("link"), w = 0; _ = P[w]; w++)
                            if (_.getAttribute("rel") === "canonical") return _.getAttribute("href")
                    }
                })();
                return h ? h.match(/\?/) ? h : h + E : window.location.href.replace(It, "")
            })(p),
            m = {
                title: n,
                url: $,
                path: wn($),
                hash: d,
                search: p,
                width: a,
                height: s
            };
        return r && r !== "" && (m.referrer = r), b({}, m, e)
    },
    Pn = {
        last: {},
        history: []
    };

function En(e, t) {
    e === void 0 && (e = Pn);
    var n = t.options;
    if (t.type === v.page) {
        var r = wt(b({
            properties: t.properties,
            meta: t.meta
        }, Object.keys(n).length && {
            options: n
        }));
        return b({}, e, {
            last: r,
            history: e.history.concat(r)
        })
    }
    return e
}
Pt = (function() {
    if (!H) return !1;
    var e = navigator.appVersion;
    return ~e.indexOf("Win") ? "Windows" : ~e.indexOf("Mac") ? "MacOS" : ~e.indexOf("X11") ? "UNIX" : ~e.indexOf("Linux") ? "Linux" : "Unknown OS"
})(), Et = H ? document.referrer : null, _t = Yt(), St = en();
var at = {
    initialized: !1,
    sessionId: Te(),
    app: null,
    version: null,
    debug: !1,
    offline: !!H && !navigator.onLine,
    os: {
        name: Pt
    },
    userAgent: H ? navigator.userAgent : "node",
    library: {
        name: Le,
        version: "0.13.1"
    },
    timezone: St,
    locale: _t,
    campaign: {},
    referrer: Et
};

function _n(e, t) {
    e === void 0 && (e = at);
    var n = e.initialized,
        r = t.campaign;
    switch (t.type) {
        case v.campaign:
            return b({}, e, {
                campaign: r
            });
        case v.offline:
            return b({}, e, {
                offline: !0
            });
        case v.online:
            return b({}, e, {
                offline: !1
            });
        default:
            return n ? e : b({}, at, e, {
                initialized: !0
            })
    }
}
var Sn = ["plugins", "reducers", "storage"];

function kn(e, t, n) {
    if (H) {
        var r = window[(n ? "add" : "remove") + "EventListener"];
        e.split(" ").forEach(function(u) {
            r(u, t)
        })
    }
}

function On(e) {
    var t = kn.bind(null, "online offline", function(n) {
        return Promise.resolve(!navigator.onLine).then(e)
    });
    return t(!0),
        function(n) {
            return t(!1)
        }
}

function kt() {
    return Me(Le, []),
        function(e) {
            return function(t, n, r) {
                var u = e(t, n, r),
                    c = u.dispatch;
                return Object.assign(u, {
                    dispatch: function(a) {
                        return le[ce][Le].push(a.action || a), c(a)
                    }
                })
            }
        }
}

function ut(e) {
    return function() {
        return de(de.apply(null, arguments), kt())
    }
}

function $e(e) {
    return e ? Ht(e) ? e : [e] : []
}

function st(e, t, n) {
    e === void 0 && (e = {});
    var r, u, c = Te();
    return t && (me[c] = (r = t, u = (function(a) {
        for (var s, d = a || Array.prototype.slice.call(arguments), p = 0; p < d.length; p++)
            if (J(d[p])) {
                s = d[p];
                break
            }
        return s
    })(n), function(a) {
        u && u(a), r(a)
    })), b({}, e, {
        rid: c,
        ts: new Date().getTime()
    }, t ? {
        hasCallback: !0
    } : {})
}

function xn(e) {
    e === void 0 && (e = {});
    var t = e.reducers || {},
        n = e.initialUser || {},
        r = (e.plugins || []).reduce(function(i, o) {
            if (J(o)) return i.middlewares = i.middlewares.concat(o), i;
            if (o.NAMESPACE && (o.name = o.NAMESPACE), !o.name) throw new Error("https://lytics.dev/errors/1");
            o.config || (o.config = {});
            var f = o.EVENTS ? Object.keys(o.EVENTS).map(function(O) {
                return o.EVENTS[O]
            }) : [];
            i.pluginEnabled[o.name] = !(o.enabled === !1 || o.config.enabled === !1), delete o.enabled, o.methods && (i.methods[o.name] = Object.keys(o.methods).reduce(function(O, B) {
                var D;
                return O[B] = (D = o.methods[B], function() {
                    for (var q = Array.prototype.slice.call(arguments), j = new Array(D.length), X = 0; X < q.length; X++) j[X] = q[X];
                    return j[j.length] = l, D.apply({
                        instance: l
                    }, j)
                }), O
            }, {}), delete o.methods);
            var I = Object.keys(o).concat(f),
                A = new Set(i.events.concat(I));
            if (i.events = Array.from(A), i.pluginsArray = i.pluginsArray.concat(o), i.plugins[o.name]) throw new Error(o.name + "AlreadyLoaded");
            return i.plugins[o.name] = o, i.plugins[o.name].loaded || (i.plugins[o.name].loaded = function() {
                return !0
            }), i
        }, {
            plugins: {},
            pluginEnabled: {},
            methods: {},
            pluginsArray: [],
            middlewares: [],
            events: []
        }),
        u = e.storage ? e.storage : {
            getItem: Be,
            setItem: Me,
            removeItem: mt
        },
        c = (function(i) {
            return function(o, f, I) {
                return f.getState("user")[o] || (I && Z(I) && I[o] ? I[o] : Je(i)[o] || Be(Re(o)) || null)
            }
        })(u),
        a = r.plugins,
        s = r.events.filter(function(i) {
            return !ze.includes(i)
        }).sort(),
        d = new Set(s.concat(Ee).filter(function(i) {
            return !ze.includes(i)
        })),
        p = Array.from(d).sort(),
        $ = function() {
            return a
        },
        m = new mn,
        E = m.addMiddleware,
        h = m.removeMiddleware,
        _ = m.dynamicMiddlewares,
        P = function() {
            throw new Error("Abort disabled inListener")
        },
        w = tn(),
        x = Je(u),
        C = b({}, x, n, w.an_uid ? {
            userId: w.an_uid
        } : {}, w.an_aid ? {
            anonymousId: w.an_aid
        } : {});
    C.anonymousId || (C.anonymousId = Te());
    var k = b({
            enable: function(i, o) {
                return new Promise(function(f) {
                    y.dispatch({
                        type: v.enablePlugin,
                        plugins: $e(i),
                        _: {
                            originalAction: v.enablePlugin
                        }
                    }, f, [o])
                })
            },
            disable: function(i, o) {
                return new Promise(function(f) {
                    y.dispatch({
                        type: v.disablePlugin,
                        plugins: $e(i),
                        _: {
                            originalAction: v.disablePlugin
                        }
                    }, f, [o])
                })
            }
        }, r.methods),
        g = !1,
        l = {
            identify: function(i, o, f, I) {
                try {
                    var A = ge(i) ? i : null,
                        O = Z(i) ? i : o,
                        B = f || {},
                        D = l.user();
                    Me(Re(Q), A);
                    var q = A || O.userId || c(Q, l, O);
                    return Promise.resolve(new Promise(function(j) {
                        y.dispatch(b({
                            type: v.identifyStart,
                            userId: q,
                            traits: O || {},
                            options: B,
                            anonymousId: D.anonymousId
                        }, D.id && D.id !== A && {
                            previousId: D.id
                        }), j, [o, f, I])
                    }))
                } catch (j) {
                    return Promise.reject(j)
                }
            },
            track: function(i, o, f, I) {
                try {
                    var A = Z(i) ? i.event : i;
                    if (!A || !ge(A)) throw new Error("EventMissing");
                    var O = Z(i) ? i : o || {},
                        B = Z(f) ? f : {};
                    return Promise.resolve(new Promise(function(D) {
                        y.dispatch({
                            type: v.trackStart,
                            event: A,
                            properties: O,
                            options: B,
                            userId: c(Q, l, o),
                            anonymousId: c(ae, l, o)
                        }, D, [o, f, I])
                    }))
                } catch (D) {
                    return Promise.reject(D)
                }
            },
            page: function(i, o, f) {
                try {
                    var I = Z(i) ? i : {},
                        A = Z(o) ? o : {};
                    return Promise.resolve(new Promise(function(O) {
                        y.dispatch({
                            type: v.pageStart,
                            properties: In(I),
                            options: A,
                            userId: c(Q, l, I),
                            anonymousId: c(ae, l, I)
                        }, O, [i, o, f])
                    }))
                } catch (O) {
                    return Promise.reject(O)
                }
            },
            user: function(i) {
                if (i === Q || i === "id") return c(Q, l);
                if (i === ae || i === "anonId") return c(ae, l);
                var o = l.getState("user");
                return i ? Ve(o, i) : o
            },
            reset: function(i) {
                return new Promise(function(o) {
                    y.dispatch({
                        type: v.resetStart
                    }, o, i)
                })
            },
            ready: function(i) {
                return g && i({
                    plugins: k,
                    instance: l
                }), l.on(v.ready, function(o) {
                    i && i(o), g = !0
                })
            },
            on: function(i, o) {
                if (!i || !J(o)) return !1;
                if (i === v.bootstrap) throw new Error(".on disabled for " + i);
                var f = /Start$|Start:/;
                if (i === "*") {
                    var I = function(D) {
                            return function(q) {
                                return function(j) {
                                    return j.type.match(f) && o({
                                        payload: j,
                                        instance: l,
                                        plugins: a
                                    }), q(j)
                                }
                            }
                        },
                        A = function(D) {
                            return function(q) {
                                return function(j) {
                                    return j.type.match(f) || o({
                                        payload: j,
                                        instance: l,
                                        plugins: a
                                    }), q(j)
                                }
                            }
                        };
                    return E(I, Ie), E(A, Pe),
                        function() {
                            h(I, Ie), h(A, Pe)
                        }
                }
                var O = i.match(f) ? Ie : Pe,
                    B = function(D) {
                        return function(q) {
                            return function(j) {
                                return j.type === i && o({
                                    payload: j,
                                    instance: l,
                                    plugins: a,
                                    abort: P
                                }), q(j)
                            }
                        }
                    };
                return E(B, O),
                    function() {
                        return h(B, O)
                    }
            },
            once: function(i, o) {
                if (!i || !J(o)) return !1;
                if (i === v.bootstrap) throw new Error(".once disabled for " + i);
                var f = l.on(i, function(I) {
                    o({
                        payload: I.payload,
                        instance: l,
                        plugins: a,
                        abort: P
                    }), f()
                });
                return f
            },
            getState: function(i) {
                var o = y.getState();
                return i ? Ve(o, i) : Object.assign({}, o)
            },
            dispatch: function(i) {
                var o = ge(i) ? {
                    type: i
                } : i;
                if (Ee.includes(o.type)) throw new Error("reserved action " + o.type);
                var f = b({}, o, {
                    _: b({
                        originalAction: o.type
                    }, i._ || {})
                });
                y.dispatch(f)
            },
            enablePlugin: k.enable,
            disablePlugin: k.disable,
            plugins: k,
            storage: {
                getItem: u.getItem,
                setItem: function(i, o, f) {
                    y.dispatch({
                        type: v.setItemStart,
                        key: i,
                        value: o,
                        options: f
                    })
                },
                removeItem: function(i, o) {
                    y.dispatch({
                        type: v.removeItemStart,
                        key: i,
                        options: o
                    })
                }
            },
            setAnonymousId: function(i, o) {
                l.storage.setItem(te, i, o)
            },
            events: {
                core: Ee,
                plugins: s
            }
        },
        M = r.middlewares.concat([function(i) {
            return function(o) {
                return function(f) {
                    return f.meta || (f.meta = st()), o(f)
                }
            }
        }, _(Ie), fn(l, $, {
            all: p,
            plugins: s
        }), pn(u), un(l), cn(l), _(Pe)]),
        S = {
            context: _n,
            user: sn(u),
            page: En,
            track: hn,
            plugins: gn($),
            queue: bn
        },
        T = de,
        z = de;
    if (H && e.debug) {
        var L = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;
        L && (T = L({
            trace: !0,
            traceLimit: 25
        })), z = function() {
            return arguments.length === 0 ? kt() : Z(typeof arguments[0]) ? ut() : ut().apply(null, arguments)
        }
    }
    var G, R = (function(i) {
            return Object.keys(i).reduce(function(o, f) {
                return Sn.includes(f) || (o[f] = i[f]), o
            }, {})
        })(e),
        U = r.pluginsArray.reduce(function(i, o) {
            var f = o.name,
                I = o.config,
                A = o.loaded,
                O = r.pluginEnabled[f];
            return i[f] = {
                enabled: O,
                initialized: !!O && !o.initialize,
                loaded: !!A({
                    config: I
                }),
                config: I
            }, i
        }, {}),
        N = {
            context: R,
            user: C,
            plugins: U
        },
        y = yt((function(i) {
            for (var o = Object.keys(i), f = {}, I = 0; I < o.length; I++) {
                var A = o[I];
                typeof i[A] === Y && (f[A] = i[A])
            }
            var O, B = Object.keys(f);
            try {
                (function(D) {
                    Object.keys(D).forEach(function(q) {
                        var j = D[q];
                        if (typeof j(void 0, {
                                type: Ue
                            }) === W || typeof j(void 0, {
                                type: rn
                            }) === W) throw new Error(ye + " " + q + " " + W)
                    })
                })(f)
            } catch (D) {
                O = D
            }
            return function(D, q) {
                if (D === void 0 && (D = {}), O) throw O;
                for (var j = !1, X = {}, Ae = 0; Ae < B.length; Ae++) {
                    var be = B[Ae],
                        qe = D[be],
                        Ne = (0, f[be])(qe, q);
                    if (typeof Ne === W) {
                        var Nt = on(be, q);
                        throw new Error(Nt)
                    }
                    X[be] = Ne, j = j || Ne !== qe
                }
                return j ? X : D
            }
        })(b({}, S, t)), N, z(T(an.apply(void 0, M))));
    y.dispatch = (G = y.dispatch, function(i, o, f) {
        var I = b({}, i, {
            meta: st(i.meta, o, $e(f))
        });
        return G.apply(null, [I])
    });
    var V = Object.keys(a);
    y.dispatch({
        type: v.bootstrap,
        plugins: V,
        config: R,
        params: w,
        user: C,
        initialUser: n,
        persistedUser: x
    });
    var K = V.filter(function(i) {
            return r.pluginEnabled[i]
        }),
        pe = V.filter(function(i) {
            return !r.pluginEnabled[i]
        });
    return y.dispatch({
        type: v.registerPlugins,
        plugins: V,
        enabled: r.pluginEnabled
    }), r.pluginsArray.map(function(i, o) {
        var f = i.bootstrap,
            I = i.config,
            A = i.name;
        f && J(f) && f({
            instance: l,
            config: I,
            payload: i
        }), y.dispatch({
            type: v.registerPluginType(A),
            name: A,
            enabled: r.pluginEnabled[A],
            plugin: i
        }), r.pluginsArray.length === o + 1 && y.dispatch({
            type: v.initializeStart,
            plugins: K,
            disabled: pe
        })
    }), On(function(i) {
        y.dispatch({
            type: i ? v.offline : v.online
        })
    }), (function(i, o, f) {
        setInterval(function() {
            return vt(i, o, f)
        }, 3e3)
    })(y, $, l), l
}
var Ie = "before",
    Pe = "after";

function Tn(e = {}) {
    let t = null,
        n = !1;
    const r = (a, s) => {
            if (s) {
                const d = a.createInstance();
                d.init(e.apiKey, null, e.options).promise.then(() => {
                    t = d, n = !0
                })
            } else t = a, n = !0
        },
        u = "sha384-x0ik2D45ZDEEEpYpEuDpmj05fY91P7EOZkgdKmq4dKL/ZAVcufJ+nULFtGn0HIZE",
        c = "https://cdn.amplitude.com/libs/analytics-browser-2.0.0-min.js.gz";
    return {
        name: "amplitude",
        config: e,
        initialize: ({
            config: a
        }) => {
            const {
                apiKey: s,
                initialSessionId: d,
                customScriptSrc: p,
                integritySha: $ = "",
                options: m = {}
            } = a;
            if (!s) throw new Error("Amplitude project API key is not defined");
            if (m && typeof m != "object") throw new Error("Amplitude SDK options must be an object");
            if (typeof window.amplitude < "u") {
                r(window.amplitude, !0);
                return
            }(function(E, h) {
                var _ = E.amplitude || {
                    _q: [],
                    _iq: {}
                };
                if (_.invoked) E.console && console.error && console.error("Amplitude snippet has been loaded.");
                else {
                    var P = function(U, N) {
                            U.prototype[N] = function() {
                                return this._q.push({
                                    name: N,
                                    args: Array.prototype.slice.call(arguments, 0)
                                }), this
                            }
                        },
                        w = function(U, N, y) {
                            return function(V) {
                                U._q.push({
                                    name: N,
                                    args: Array.prototype.slice.call(y, 0),
                                    resolve: V
                                })
                            }
                        },
                        x = function(U, N, y) {
                            U[N] = function() {
                                if (y) return {
                                    promise: new Promise(w(U, N, Array.prototype.slice.call(arguments)))
                                }
                            }
                        },
                        C = function(U) {
                            for (var N = 0; N < G.length; N++) x(U, G[N], !1);
                            for (var y = 0; y < R.length; y++) x(U, R[y], !0)
                        };
                    _.invoked = !0;
                    var k = h.createElement("script");
                    k.type = "text/javascript", k.integrity = u, k.crossOrigin = "anonymous", k.async = !0, k.src = c, k.onload = function() {
                        E.amplitude.runQueuedFunctions || console.log("[Amplitude] Error: could not load SDK")
                    };
                    var g = h.getElementsByTagName("script")[0];
                    g.parentNode.insertBefore(k, g);
                    for (var l = function() {
                            return this._q = [], this
                        }, M = ["add", "append", "clearAll", "prepend", "set", "setOnce", "unset", "preInsert", "postInsert", "remove", "getUserProperties"], S = 0; S < M.length; S++) P(l, M[S]);
                    _.Identify = l;
                    for (var T = function() {
                            return this._q = [], this
                        }, z = ["getEventProperties", "setProductId", "setQuantity", "setPrice", "setRevenue", "setRevenueType", "setEventProperties"], L = 0; L < z.length; L++) P(T, z[L]);
                    _.Revenue = T;
                    var G = ["getDeviceId", "setDeviceId", "getSessionId", "setSessionId", "getUserId", "setUserId", "setOptOut", "setTransport", "reset", "extendSession"],
                        R = ["init", "add", "remove", "track", "logEvent", "identify", "groupIdentify", "setGroup", "revenue", "flush"];
                    C(_), _.createInstance = function(U) {
                        return _._iq[U] = {
                            _q: []
                        }, C(_._iq[U]), _._iq[U]
                    }, E.amplitude = _
                }
            })(window, document), window.amplitude.init(a.apiKey, m).promise.then(() => r(window.amplitude, !1)), d && setTimeout(() => ct(d), 10)
        },
        page: ({
            payload: {
                properties: a,
                options: s
            }
        }) => {
            const d = e.options;
            if (!d.autocapture || d.autocapture.pageViews === !1) {
                let p = "Page View";
                s && s.eventType && (p = s.eventType), t.track(p, a)
            }
        },
        track: ({
            payload: {
                event: a,
                properties: s
            }
        }) => {
            t.track(a, s)
        },
        identify: ({
            payload: {
                userId: a,
                traits: s
            },
            instance: d
        }) => {
            const p = new window.amplitude.Identify;
            p.set("user_id", a), t.identify(p)
        },
        loaded: () => n,
        methods: {
            setSessionId: ct
        }
    }
}

function ct(e) {
    if (typeof window.amplitude > "u") return console.log("Amplitude not loaded yet"), !1;
    window.amplitude.setSessionId(e)
}
const An = /(iphone|ipod|blackberry|bb10|android.*mobile|windows phone|opera mini|mobile safari|palm|nokia|symbian|meego|fennec|maemo|tizen.*mobile|firefox mobile|htc|samsung|lg|motorola|huawei|xiaomi|redmi|oneplus|zte|alcatel|lenovo|vivo|oppo)/i,
    Nn = /(ipad|tablet|kindle|playbook|silk|nexus 7|nexus 9|nexus 10|galaxy tab|xoom|sch-i800|android(?!.*mobile))/i;

function jn() {
    const e = typeof navigator < "u" ? (navigator.userAgent || "").toLowerCase() : "";
    return An.test(e) ? "mobile" : Nn.test(e) ? "tablet" : "desktop"
}

function Cn() {
    return typeof navigator < "u" && (navigator.languages && navigator.languages[0] || navigator.language) || ""
}

function Ot() {
    let e = fe("VisitorId");
    if (!e) {
        e = typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : String(Date.now()) + Math.random().toString(36).slice(2);
        try {
            xt("VisitorId", e, 525600, "/")
        } catch {}
    }
    return e
}

function fe(e) {
    const n = `; ${document.cookie}`.split(`; ${e}=`);
    return n.length === 2 ? n.pop().split(";").shift() : null
}

function xt(e, t, n, r = "/") {
    let u = "";
    if (n) {
        const c = new Date;
        c.setTime(c.getTime() + n * 60 * 1e3), u = "; expires=" + c.toUTCString()
    }
    document.cookie = `${encodeURIComponent(e)}=${encodeURIComponent(t||"")}${u}; path=${r}`
}

function Dn() {
    const e = {
        referrer: void 0,
        referring_domain: void 0
    };
    try {
        e.referrer = document.referrer || void 0, e.referrer && (e.referring_domain = e.referrer.split("/")[2] || void 0)
    } catch {}
    return e
}

function $n() {
    const e = new URL(window.location.href).searchParams;
    return Object.fromEntries(e.entries())
}

function Mn() {
    const e = $n();
    return {
        utm_campaign: e.utm_campaign,
        utm_content: e.utm_content,
        utm_id: e.utm_id,
        utm_medium: e.utm_medium,
        utm_source: e.utm_source,
        utm_term: e.utm_term
    }
}

function Un(e) {
    const t = `AMP_${e.substring(0,10)}`,
        n = fe(t);
    if (!n) return {};
    const r = atob(n),
        u = decodeURIComponent(r);
    try {
        return JSON.parse(u)
    } catch {
        return {}
    }
}

function Ln(e) {
    document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", e) : e()
}
const F = {
    country_code: "",
    country: ""
};

function zn() {
    return new Promise(e => {
        if (F.country && F.country_code) return e(F);
        if (F.country_code = fe("device_country") || "", F.country = fe("device_country_name") || "", F.country && F.country_code) return e(F);
        try {
            fetch("https://www.payoneer.com/ipinf", {
                method: "GET"
            }).then(t => {
                if (!t || !t.ok) return e(F);
                const n = {};
                for (const [r, u] of t.headers.entries()) n[r.toLowerCase()] = u;
                F.country_code = n["rbz-geo-code"] || "", F.country = n["rbz-geo-name"] || "", e(F)
            }).catch(() => e(F))
        } catch {
            e(F)
        }
    })
}

function Rn() {
    const e = typeof navigator < "u" ? navigator : {},
        t = typeof screen < "u" ? screen : {},
        n = !!e.webdriver,
        r = e.hardwareConcurrency || "",
        u = e.platform || "",
        c = e.deviceMemory || "",
        a = t.colorDepth || "";
    let s = "No Preference";
    typeof window < "u" && window.matchMedia && (window.matchMedia("(prefers-color-scheme: dark)").matches ? s = "Dark" : window.matchMedia("(prefers-color-scheme: light)").matches && (s = "Light"));
    const d = !!(t.height && typeof window < "u" && t.height <= window.innerHeight),
        p = !!(t.width && typeof window < "u" && t.width <= window.innerWidth);
    return [`w:${n}`, `h:${r}`, `p:${u}`, `d:${c}`, `cd:${a}`, `cs:${s}`, `sh:${d}`, `sw:${p}`].join(";") + ";"
}

function qn() {
    const e = new Date;
    let t = "unknown";
    try {
        typeof Intl < "u" && Intl.DateTimeFormat && Intl.DateTimeFormat().resolvedOptions && (t = Intl.DateTimeFormat().resolvedOptions().timeZone || "unknown")
    } catch {
        t = "unknown"
    }
    const n = -e.getTimezoneOffset() / 60;
    return {
        utc: e.toISOString(),
        local: e.toString(),
        timeZone: t,
        utcOffsetHours: n
    }
}

function Vn(e = {}) {
    const t = {
        baseUrl: "",
        autoCapturePageViews: !0,
        deviceId: Ot(),
        sessionId: r(),
        ...e
    };

    function n(a = {}) {
        a || (a = {});
        const s = window.location;
        return {
            event_properties: { ...{
                    "[Payo] Page Domain": typeof s < "u" && s.hostname || "",
                    "[Payo] Page Location": typeof s < "u" && s.href || "",
                    "[Payo] Page Path": typeof s < "u" && s.pathname || "",
                    "[Payo] Page Title": typeof document < "u" && document.title || "",
                    "[Payo] Page URL": typeof s < "u" && s.href.split("?")[0] || ""
                },
                ...a,
                ...Mn()
            },
            amplitude_device_id: window.amplitude ? amplitude.getDeviceId("42f354eb82d2ee9894c2c3536383f664") : "",
            browser_time_origin: performance.timeOrigin,
            browser_profile: Rn(),
            device_isp: fe("device_isp") || "",
            device_id: t.deviceId,
            language: Cn(),
            platform: "Web",
            country_code: F.country_code,
            country: F.country,
            device_type: jn(),
            time: Date.now(),
            time_info: qn(),
            sessionId: typeof t.sessionId == "function" ? t.sessionId() : t.sessionId
        }
    }

    function r() {
        const a = fe("PAYO_SID");
        if (!a) {
            const s = Date.now();
            return xt("PAYO_SID", s, 30), s
        }
        return a
    }

    function u(a = {}) {
        fetch(t.baseUrl, {
            method: "POST",
            headers: {
                "Content-Type": "application/json"
            },
            body: JSON.stringify(a)
        }).then(s => {
            s.ok || console.error("Error sending data to Payo Analytics:", s.statusText)
        }).catch(s => {
            console.error("Network error sending data to Payo Analytics:", s)
        })
    }
    const c = {
        name: "payo-analytics",
        config: t,
        initialize: ({
            config: a
        }) => {
            t.autoCapturePageViews && c.page()
        },
        page: ({
            payload: {
                properties: a,
                options: s
            } = {}
        } = {}) => {
            const d = Dn(),
                $ = { ...{
                        referrer: d.referrer || "",
                        referring_domain: d.referring_domain || ""
                    },
                    ...a || {}
                };
            u({
                event_type: "[Payo] Page Viewed",
                ...n($)
            })
        },
        track: ({
            payload: {
                event: a,
                properties: s
            }
        }) => {
            u({
                event_type: a,
                ...n(s)
            })
        },
        identify: ({
            payload: {
                userId: a,
                traits: s
            },
            instance: d
        }) => {
            u({
                event_type: "identify",
                ...n({
                    userId: a,
                    user_properties: s
                })
            })
        },
        loaded: () => !0
    };
    return c
}

function Gn(e = {
    debug: !1
}) {
    const t = e.oneTrustConsentManager;
    let n = !0;

    function r() {
        const a = t.getConsent();
        return u("doNotTrackEnabled, consentStatus:", a), a ? n = !a.performance : n = !0, n
    }
    r(), t.onConsentChange(a => {
        n = !a.performance
    });

    function u(...a) {
        e.debug && console.log("[DoNotTrackPlugin]", ...a)
    }
    const c = {
        name: "payo-do-not-track",
        config: Object.assign({}, e),
        initializeStart: ({
            abort: a,
            config: s
        }) => {
            u("initializeStart", {
                doNotTrack: r()
            })
        },
        pageStart: ({
            abort: a,
            config: s,
            payload: d
        }) => {
            if (u("pageStart", d), r()) return c.config.eventsContainer.page.push(d), a("Cancel the page call because do-not-track enabled")
        },
        identifyStart: ({
            abort: a,
            config: s,
            payload: d
        }) => {
            if (u("identifyStart", d), r()) return c.config.eventsContainer.identify.push(d), a("Cancel the identify call because do-not-track enabled")
        },
        trackStart: ({
            abort: a,
            config: s,
            payload: d
        }) => {
            if (u("trackStart", d), r()) return c.config.eventsContainer.track.push(d), a("Cancel the track call because do-not-track enabled")
        }
    };
    return c
}
class Bn {
    constructor(t = {
        timeoutMs: 1e4,
        debug: !1
    }) {
        this.listeners = [], this.isReady = !1, this.isDebug = t.debug || !1;
        const n = t.timeoutMs || 1e4;
        this.ready = this._waitForOneTrust(n).then(r => {
            this.isReady = r, this.isReady || (this._log("OneTrust did not load within timeout"), window.OnetrustActiveGroups = "C0002,C0003,C0004", this.isReady = !0);
            const u = this._readConsent();
            this.notifyListeners(u), window.addEventListener("OneTrustGroupsUpdated", c => {
                this._log("OneTrustGroupsUpdated event:", c);
                const a = this._readConsent();
                this.notifyListeners(a)
            })
        }).catch(() => {
            this._log("OneTrust did not load within timeout")
        })
    }
    _log(...t) {
        this.isDebug && console.log("[OneTrustConsentManager]", t)
    }
    _waitForOneTrust(t) {
        return new Promise((n, r) => {
            const u = Date.now(),
                c = () => {
                    typeof OnetrustActiveGroups < "u" && typeof OneTrust < "u" ? n(!0) : Date.now() - u >= t ? n(!1) : setTimeout(c, 100)
                };
            c()
        })
    }
    _readConsent() {
        const t = OnetrustActiveGroups.split(",");
        return this._log("OneTrust active groups:", t), {
            strictlyNecessary: !0,
            performance: t.includes("C0002"),
            functional: t.includes("C0003"),
            targeting: t.includes("C0004")
        }
    }
    getConsent() {
        return this.isReady ? this._readConsent() : (this._log("OneTrust is not ready yet"), null)
    }
    onConsentChange(t) {
        typeof t == "function" && (this.listeners.push(t), this.isReady && t(this._readConsent()))
    }
    notifyListeners(t) {
        this.listeners.forEach(n => {
            try {
                n(t)
            } catch (r) {
                this._log("Error in consent listener:", r)
            }
        })
    }
}
zn();
const Tt = Ot(),
    At = new Bn({
        debug: !1,
        timeoutMs: 1e4
    }),
    ne = {
        page: [],
        track: [],
        identify: []
    },
    Fn = Tn({
        apiKey: "e3fc7673cdb5c30f0c30cfa3e1f12376",
        options: {
            instanceName: "payopoc",
            fetchRemoteConfig: !0,
            autocapture: {
                attribution: !1,
                pageViews: !0,
                sessions: !0,
                formInteractions: !0,
                fileDownloads: !1,
                elementInteractions: !1
            },
            serverZone: "EU",
            deviceId: Tt
        },
        enabled: !1
    }),
    ee = xn({
        app: "payoneer-poc",
        version: 1,
        plugins: [Gn({
            oneTrustConsentManager: At,
            eventsContainer: ne,
            debug: !1
        }), Fn, Vn({
            baseUrl: "https://im09a8tgx2.execute-api.eu-north-1.amazonaws.com/prod/track",
            deviceId: Tt,
            autoCapturePageViews: !0,
            enabled: !1,
            sessionId: () => Un("e3fc7673cdb5c30f0c30cfa3e1f12376").sessionId || Date.now()
        })]
    });
At.onConsentChange(e => {
    e.performance && ee.plugins.enable(["amplitude", "payo-analytics"]).then(t => {
        ne.page.forEach(n => {
            ee.page()
        }), ne.identify.forEach(n => {
            ee.identify(n)
        }), ne.track.forEach(n => {
            ee.track(n.event, n.properties)
        }), ne.page.length = 0, ne.identify.length = 0, ne.track.length = 0
    })
});
Ln(() => {
    document.body.addEventListener("click", function(e) {
        const t = e.target instanceof Element ? e.target : e.target.parentElement;
        if (!t) return;
        const n = t.closest("[data-cta-type]");
        if (!n) return;
        const r = n.getAttribute("data-cta-type");
        r && ee.track("click_cta_button", {
            action: r
        })
    })
});
window.payoAnalytics = {
    page: (...e) => ee.page(...e),
    track: (...e) => ee.track(...e),
    identify: (...e) => ee.identify(...e)
};