;
! function() {
    try {
        var e = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof global ? global : "undefined" != typeof window ? window : "undefined" != typeof self ? self : {},
            n = (new e.Error).stack;
        n && ((e._debugIds || (e._debugIds = {}))[n] = "0a3fc385-03f6-0f27-ae31-97fcf5b3b895")
    } catch (e) {}
}();
(globalThis.TURBOPACK || (globalThis.TURBOPACK = [])).push(["object" == typeof document ? document.currentScript : void 0, 842183, e => {
    "use strict";
    var t, r, n, i;
    (n = t || (t = {})).SET = "$set", n.SET_ONCE = "$setOnce", n.ADD = "$add", n.APPEND = "$append", n.PREPEND = "$prepend", n.REMOVE = "$remove", n.PREINSERT = "$preInsert", n.POSTINSERT = "$postInsert", n.UNSET = "$unset", n.CLEAR_ALL = "$clearAll", (i = r || (r = {})).IDENTIFY = "$identify", i.GROUP_IDENTIFY = "$groupidentify", i.REVENUE = "revenue_amount", e.s(["IdentifyOperation", 0, t, "SpecialEventType", 0, r])
}, 974838, 735886, e => {
    "use strict";
    var t, r, n = e.i(274466);
    (t = r || (r = {}))[t.None = 0] = "None", t[t.Error = 1] = "Error", t[t.Warn = 2] = "Warn", t[t.Verbose = 3] = "Verbose", t[t.Debug = 4] = "Debug", e.s(["LogLevel", 0, r], 735886);
    var i = function(e) {
            return void 0 === e && (e = 0), (Error().stack || "").split("\n").slice(2 + e).map(function(e) {
                return e.trim()
            })
        },
        o = function(e, t) {
            var r, i;
            t = (t = t.replace(/\[(\w+)\]/g, ".$1")).replace(/^\./, "");
            try {
                for (var o = (0, n.__values)(t.split(".")), s = o.next(); !s.done; s = o.next()) {
                    var a = s.value;
                    if (!(a in e)) return;
                    e = e[a]
                }
            } catch (e) {
                r = {
                    error: e
                }
            } finally {
                try {
                    s && !s.done && (i = o.return) && i.call(o)
                } finally {
                    if (r) throw r.error
                }
            }
            return e
        };
    e.s(["debugWrapper", 0, function(e, t, n, o, s) {
        return void 0 === s && (s = null),
            function() {
                for (var a = [], l = 0; l < arguments.length; l++) a[l] = arguments[l];
                var c = n(),
                    u = c.logger,
                    d = c.logLevel;
                if (d && d < r.Debug || !d || !u) return e.apply(s, a);
                var g = {
                    type: "invoke public method",
                    name: t,
                    args: a,
                    stacktrace: i(1),
                    time: {
                        start: new Date().toISOString()
                    },
                    states: {}
                };
                o && g.states && (g.states.before = o());
                var f = e.apply(s, a);
                return f && f.promise ? f.promise.then(function() {
                    o && g.states && (g.states.after = o()), g.time && (g.time.end = new Date().toISOString()), u.debug(JSON.stringify(g, null, 2))
                }) : (o && g.states && (g.states.after = o()), g.time && (g.time.end = new Date().toISOString()), u.debug(JSON.stringify(g, null, 2))), f
            }
    }, "getClientLogConfig", 0, function(e) {
        return function() {
            var t = (0, n.__assign)({}, e.config);
            return {
                logger: t.loggerProvider,
                logLevel: t.logLevel
            }
        }
    }, "getClientStates", 0, function(e, t) {
        return function() {
            var r, i, s = {};
            try {
                for (var a = (0, n.__values)(t), l = a.next(); !l.done; l = a.next()) {
                    var c = l.value;
                    s[c] = o(e, c)
                }
            } catch (e) {
                r = {
                    error: e
                }
            } finally {
                try {
                    l && !l.done && (i = a.return) && i.call(a)
                } finally {
                    if (r) throw r.error
                }
            }
            return s
        }
    }, "getStacktrace", 0, i], 974838)
}, 60536, e => {
    "use strict";
    e.s(["AMPLITUDE_BATCH_SERVER_URL", 0, "https://api2.amplitude.com/batch", "AMPLITUDE_PREFIX", 0, "AMP", "AMPLITUDE_SERVER_URL", 0, "https://api2.amplitude.com/2/httpapi", "BASE_CAMPAIGN", 0, {
        utm_campaign: void 0,
        utm_content: void 0,
        utm_id: void 0,
        utm_medium: void 0,
        utm_source: void 0,
        utm_term: void 0,
        referrer: void 0,
        referring_domain: void 0,
        dclid: void 0,
        gbraid: void 0,
        gclid: void 0,
        fbclid: void 0,
        ko_click_id: void 0,
        li_fat_id: void 0,
        msclkid: void 0,
        rdt_cid: void 0,
        ttclid: void 0,
        twclid: void 0,
        wbraid: void 0
    }, "DCLID", 0, "dclid", "DEFAULT_INSTANCE_NAME", 0, "$default_instance", "EU_AMPLITUDE_BATCH_SERVER_URL", 0, "https://api.eu.amplitude.com/batch", "EU_AMPLITUDE_SERVER_URL", 0, "https://api.eu.amplitude.com/2/httpapi", "FBCLID", 0, "fbclid", "GBRAID", 0, "gbraid", "GCLID", 0, "gclid", "KO_CLICK_ID", 0, "ko_click_id", "LI_FAT_ID", 0, "li_fat_id", "MSCLKID", 0, "msclkid", "RDT_CID", 0, "rdt_cid", "SAFE_HEADERS", 0, ["access-control-allow-origin", "access-control-allow-credentials", "access-control-expose-headers", "access-control-max-age", "access-control-allow-methods", "access-control-allow-headers", "accept-patch", "accept-ranges", "age", "allow", "alt-svc", "cache-control", "connection", "content-disposition", "content-encoding", "content-language", "content-length", "content-location", "content-md5", "content-range", "content-type", "date", "delta-base", "etag", "expires", "im", "last-modified", "link", "location", "permanent", "p3p", "pragma", "proxy-authenticate", "public-key-pins", "retry-after", "server", "status", "strict-transport-security", "trailer", "transfer-encoding", "tk", "upgrade", "vary", "via", "warning", "www-authenticate", "x-b3-traceid", "x-frame-options"], "STORAGE_PREFIX", 0, "".concat("AMP", "_unsent"), "TTCLID", 0, "ttclid", "TWCLID", 0, "twclid", "UNSET_VALUE", 0, "-", "UTM_CAMPAIGN", 0, "utm_campaign", "UTM_CONTENT", 0, "utm_content", "UTM_ID", 0, "utm_id", "UTM_MEDIUM", 0, "utm_medium", "UTM_SOURCE", 0, "utm_source", "UTM_TERM", 0, "utm_term", "WBRAID", 0, "wbraid"])
}, 536323, 115059, e => {
    "use strict";
    var t = e.i(60536),
        r = e.i(735886),
        n = "Amplitude Logger ",
        i = function() {
            function e() {
                this.logLevel = r.LogLevel.None
            }
            return e.prototype.disable = function() {
                this.logLevel = r.LogLevel.None
            }, e.prototype.enable = function(e) {
                void 0 === e && (e = r.LogLevel.Warn), this.logLevel = e
            }, e.prototype.log = function() {
                for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];
                this.logLevel < r.LogLevel.Verbose || console.log("".concat(n, "[Log]: ").concat(e.join(" ")))
            }, e.prototype.warn = function() {
                for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];
                this.logLevel < r.LogLevel.Warn || console.warn("".concat(n, "[Warn]: ").concat(e.join(" ")))
            }, e.prototype.error = function() {
                for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];
                this.logLevel < r.LogLevel.Error || console.error("".concat(n, "[Error]: ").concat(e.join(" ")))
            }, e.prototype.debug = function() {
                for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];
                this.logLevel < r.LogLevel.Debug || console.log("".concat(n, "[Debug]: ").concat(e.join(" ")))
            }, e
        }();
    e.s(["Logger", 0, i], 115059);
    var o = function() {
            return {
                flushMaxRetries: 12,
                flushQueueSize: 200,
                flushIntervalMillis: 1e4,
                instanceName: t.DEFAULT_INSTANCE_NAME,
                logLevel: r.LogLevel.Warn,
                loggerProvider: new i,
                offline: !1,
                optOut: !1,
                serverUrl: t.AMPLITUDE_SERVER_URL,
                serverZone: "US",
                useBatch: !1
            }
        },
        s = function() {
            function e(e) {
                this._optOut = !1;
                var t, r, n, i, s = o();
                this.apiKey = e.apiKey, this.flushIntervalMillis = null != (t = e.flushIntervalMillis) ? t : s.flushIntervalMillis, this.flushMaxRetries = e.flushMaxRetries || s.flushMaxRetries, this.flushQueueSize = e.flushQueueSize || s.flushQueueSize, this.instanceName = e.instanceName || s.instanceName, this.loggerProvider = e.loggerProvider || s.loggerProvider, this.logLevel = null != (r = e.logLevel) ? r : s.logLevel, this.minIdLength = e.minIdLength, this.plan = e.plan, this.ingestionMetadata = e.ingestionMetadata, this.offline = void 0 !== e.offline ? e.offline : s.offline, this.optOut = null != (n = e.optOut) ? n : s.optOut, this.serverUrl = e.serverUrl, this.serverZone = e.serverZone || s.serverZone, this.storageProvider = e.storageProvider, this.transportProvider = e.transportProvider, this.useBatch = null != (i = e.useBatch) ? i : s.useBatch, this.loggerProvider.enable(this.logLevel);
                var l = a(e.serverUrl, e.serverZone, e.useBatch);
                this.serverZone = l.serverZone, this.serverUrl = l.serverUrl
            }
            return Object.defineProperty(e.prototype, "optOut", {
                get: function() {
                    return this._optOut
                },
                set: function(e) {
                    this._optOut = e
                },
                enumerable: !1,
                configurable: !0
            }), e
        }(),
        a = function(e, r, n) {
            if (void 0 === e && (e = ""), void 0 === r && (r = o().serverZone), void 0 === n && (n = o().useBatch), e) return {
                serverUrl: e,
                serverZone: void 0
            };
            var i, s = ["US", "EU"].includes(r) ? r : o().serverZone;
            return {
                serverZone: s,
                serverUrl: (i = n, "EU" === s ? i ? t.EU_AMPLITUDE_BATCH_SERVER_URL : t.EU_AMPLITUDE_SERVER_URL : i ? t.AMPLITUDE_BATCH_SERVER_URL : t.AMPLITUDE_SERVER_URL)
            }
        },
        l = function() {
            function e() {
                this.sdk = {
                    metrics: {
                        histogram: {}
                    }
                }
            }
            return e.prototype.recordHistogram = function(e, t) {
                this.sdk.metrics.histogram[e] = t
            }, e
        }();
    e.s(["Config", 0, s, "RequestMetadata", 0, l, "createServerConfig", 0, a], 536323)
}, 499875, e => {
    "use strict";
    var t, r;
    (r = t || (t = {})).Unknown = "unknown", r.Skipped = "skipped", r.Success = "success", r.RateLimit = "rate_limit", r.PayloadTooLarge = "payload_too_large", r.Invalid = "invalid", r.Failed = "failed", r.Timeout = "Timeout", r.SystemError = "SystemError", e.s(["Status", 0, t])
}, 321480, e => {
    "use strict";
    e.s(["isSuccessStatusCode", 0, function(e) {
        return e >= 200 && e < 300
    }])
}, 119253, e => {
    "use strict";
    var t = e.i(499875),
        r = e.i(321480),
        n = function() {
            function e() {}
            return e.prototype.send = function(e, t, r) {
                return Promise.resolve(null)
            }, e.prototype.buildResponse = function(e) {
                if ("object" != typeof e) return null;
                var r, n, i, o, s, a, l, c, u, d, g, f, h, p, v, m, y, _, b, S, E, I, C = e.code || 0,
                    w = this.buildStatus(C);
                switch (w) {
                    case t.Status.Success:
                        return {
                            status: w,
                            statusCode: C,
                            body: {
                                eventsIngested: null != (r = e.events_ingested) ? r : 0,
                                payloadSizeBytes: null != (n = e.payload_size_bytes) ? n : 0,
                                serverUploadTime: null != (i = e.server_upload_time) ? i : 0
                            }
                        };
                    case t.Status.Invalid:
                        return {
                            status: w,
                            statusCode: C,
                            body: {
                                error: null != (o = e.error) ? o : "",
                                missingField: null != (s = e.missing_field) ? s : "",
                                eventsWithInvalidFields: null != (a = e.events_with_invalid_fields) ? a : {},
                                eventsWithMissingFields: null != (l = e.events_with_missing_fields) ? l : {},
                                eventsWithInvalidIdLengths: null != (c = e.events_with_invalid_id_lengths) ? c : {},
                                epsThreshold: null != (u = e.eps_threshold) ? u : 0,
                                exceededDailyQuotaDevices: null != (d = e.exceeded_daily_quota_devices) ? d : {},
                                silencedDevices: null != (g = e.silenced_devices) ? g : [],
                                silencedEvents: null != (f = e.silenced_events) ? f : [],
                                throttledDevices: null != (h = e.throttled_devices) ? h : {},
                                throttledEvents: null != (p = e.throttled_events) ? p : []
                            }
                        };
                    case t.Status.PayloadTooLarge:
                        return {
                            status: w,
                            statusCode: C,
                            body: {
                                error: null != (v = e.error) ? v : ""
                            }
                        };
                    case t.Status.RateLimit:
                        return {
                            status: w,
                            statusCode: C,
                            body: {
                                error: null != (m = e.error) ? m : "",
                                epsThreshold: null != (y = e.eps_threshold) ? y : 0,
                                throttledDevices: null != (_ = e.throttled_devices) ? _ : {},
                                throttledUsers: null != (b = e.throttled_users) ? b : {},
                                exceededDailyQuotaDevices: null != (S = e.exceeded_daily_quota_devices) ? S : {},
                                exceededDailyQuotaUsers: null != (E = e.exceeded_daily_quota_users) ? E : {},
                                throttledEvents: null != (I = e.throttled_events) ? I : []
                            }
                        };
                    case t.Status.Timeout:
                    default:
                        return {
                            status: w,
                            statusCode: C
                        }
                }
            }, e.prototype.buildStatus = function(e) {
                return (0, r.isSuccessStatusCode)(e) ? t.Status.Success : 429 === e ? t.Status.RateLimit : 413 === e ? t.Status.PayloadTooLarge : 408 === e ? t.Status.Timeout : e >= 400 && e < 500 ? t.Status.Invalid : e >= 500 ? t.Status.Failed : t.Status.Unknown
            }, e
        }();
    e.s(["BaseTransport", 0, n])
}, 776839, e => {
    "use strict";
    var t, r;
    (r = t || (t = {})).US = "US", r.EU = "EU", r.STAGING = "STAGING", e.s(["ServerZone", 0, t])
}, 173625, 621108, e => {
    "use strict";
    var t = function() {
            function e() {}
            return e.prototype.getApplicationContext = function() {
                return {
                    versionName: this.versionName,
                    language: r(),
                    platform: "Web",
                    os: void 0,
                    deviceModel: void 0
                }
            }, e
        }(),
        r = function() {
            return "u" > typeof navigator && (navigator.languages && navigator.languages[0] || navigator.language) || ""
        },
        n = function() {
            function e() {
                this.queue = []
            }
            return e.prototype.logEvent = function(e) {
                this.receiver ? this.receiver(e) : this.queue.length < 512 && this.queue.push(e)
            }, e.prototype.setEventReceiver = function(e) {
                this.receiver = e, this.queue.length > 0 && (this.queue.forEach(function(t) {
                    e(t)
                }), this.queue = [])
            }, e
        }(),
        i = function() {
            return (i = Object.assign || function(e) {
                for (var t, r = 1, n = arguments.length; r < n; r++)
                    for (var i in t = arguments[r]) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
                return e
            }).apply(this, arguments)
        };

    function o(e) {
        var t = "function" == typeof Symbol && Symbol.iterator,
            r = t && e[t],
            n = 0;
        if (r) return r.call(e);
        if (e && "number" == typeof e.length) return {
            next: function() {
                return e && n >= e.length && (e = void 0), {
                    value: e && e[n++],
                    done: !e
                }
            }
        };
        throw TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined.")
    }

    function s(e, t) {
        var r = "function" == typeof Symbol && e[Symbol.iterator];
        if (!r) return e;
        var n, i, o = r.call(e),
            s = [];
        try {
            for (;
                (void 0 === t || t-- > 0) && !(n = o.next()).done;) s.push(n.value)
        } catch (e) {
            i = {
                error: e
            }
        } finally {
            try {
                n && !n.done && (r = o.return) && r.call(o)
            } finally {
                if (i) throw i.error
            }
        }
        return s
    }
    "function" == typeof SuppressedError && SuppressedError;
    var a = function(e, t) {
        var r, n, i = typeof e;
        if (i !== typeof t) return !1;
        try {
            for (var s = o(["string", "number", "boolean", "undefined"]), l = s.next(); !l.done; l = s.next())
                if (l.value === i) return e === t
        } catch (e) {
            r = {
                error: e
            }
        } finally {
            try {
                l && !l.done && (n = s.return) && n.call(s)
            } finally {
                if (r) throw r.error
            }
        }
        if (null == e && null == t) return !0;
        if (null == e || null == t || e.length !== t.length) return !1;
        var c = Array.isArray(e),
            u = Array.isArray(t);
        if (c !== u) return !1;
        if (c && u) {
            for (var d = 0; d < e.length; d++)
                if (!a(e[d], t[d])) return !1
        } else {
            if (!a(Object.keys(e).sort(), Object.keys(t).sort())) return !1;
            var g = !0;
            return Object.keys(e).forEach(function(r) {
                a(e[r], t[r]) || (g = !1)
            }), g
        }
        return !0
    };
    Object.entries || (Object.entries = function(e) {
        for (var t = Object.keys(e), r = t.length, n = Array(r); r--;) n[r] = [t[r], e[t[r]]];
        return n
    });
    var l = function() {
            function e() {
                this.identity = {
                    userProperties: {}
                }, this.listeners = new Set
            }
            return e.prototype.editIdentity = function() {
                var e = this,
                    t = i({}, this.identity.userProperties),
                    r = i(i({}, this.identity), {
                        userProperties: t
                    });
                return {
                    setUserId: function(e) {
                        return r.userId = e, this
                    },
                    setDeviceId: function(e) {
                        return r.deviceId = e, this
                    },
                    setUserProperties: function(e) {
                        return r.userProperties = e, this
                    },
                    setOptOut: function(e) {
                        return r.optOut = e, this
                    },
                    updateUserProperties: function(e) {
                        var t, n, i, a, l, c, u = r.userProperties || {};
                        try {
                            for (var d = o(Object.entries(e)), g = d.next(); !g.done; g = d.next()) {
                                var f = s(g.value, 2),
                                    h = f[0],
                                    p = f[1];
                                switch (h) {
                                    case "$set":
                                        try {
                                            for (var v = (i = void 0, o(Object.entries(p))), m = v.next(); !m.done; m = v.next()) {
                                                var y = s(m.value, 2),
                                                    _ = y[0],
                                                    b = y[1];
                                                u[_] = b
                                            }
                                        } catch (e) {
                                            i = {
                                                error: e
                                            }
                                        } finally {
                                            try {
                                                m && !m.done && (a = v.return) && a.call(v)
                                            } finally {
                                                if (i) throw i.error
                                            }
                                        }
                                        break;
                                    case "$unset":
                                        try {
                                            for (var S = (l = void 0, o(Object.keys(p))), E = S.next(); !E.done; E = S.next()) {
                                                var _ = E.value;
                                                delete u[_]
                                            }
                                        } catch (e) {
                                            l = {
                                                error: e
                                            }
                                        } finally {
                                            try {
                                                E && !E.done && (c = S.return) && c.call(S)
                                            } finally {
                                                if (l) throw l.error
                                            }
                                        }
                                        break;
                                    case "$clearAll":
                                        u = {}
                                }
                            }
                        } catch (e) {
                            t = {
                                error: e
                            }
                        } finally {
                            try {
                                g && !g.done && (n = d.return) && n.call(d)
                            } finally {
                                if (t) throw t.error
                            }
                        }
                        return r.userProperties = u, this
                    },
                    commit: function() {
                        return e.setIdentity(r), this
                    }
                }
            }, e.prototype.getIdentity = function() {
                return i({}, this.identity)
            }, e.prototype.setIdentity = function(e) {
                var t = i({}, this.identity);
                this.identity = i({}, e), a(t, this.identity) || this.listeners.forEach(function(t) {
                    t(e)
                })
            }, e.prototype.addIdentityListener = function(e) {
                this.listeners.add(e)
            }, e.prototype.removeIdentityListener = function(e) {
                this.listeners.delete(e)
            }, e
        }(),
        c = "u" > typeof globalThis ? globalThis : e.g,
        u = function() {
            function e() {
                this.identityStore = new l, this.eventBridge = new n, this.applicationContextProvider = new t
            }
            return e.getInstance = function(t) {
                return c.analyticsConnectorInstances || (c.analyticsConnectorInstances = {}), c.analyticsConnectorInstances[t] || (c.analyticsConnectorInstances[t] = new e), c.analyticsConnectorInstances[t]
            }, e
        }();
    e.s(["AnalyticsConnector", 0, u], 621108);
    var d = e.i(60536),
        g = function(e) {
            return void 0 === e && (e = d.DEFAULT_INSTANCE_NAME), u.getInstance(e)
        };
    e.s(["getAnalyticsConnector", 0, g, "setConnectorDeviceId", 0, function(e, t) {
        g(t).identityStore.editIdentity().setDeviceId(e).commit()
    }, "setConnectorUserId", 0, function(e, t) {
        g(t).identityStore.editIdentity().setUserId(e).commit()
    }], 173625)
}, 400475, e => {
    "use strict";
    e.s(["returnWrapper", 0, function(e) {
        return {
            promise: e || Promise.resolve()
        }
    }])
}, 891307, e => {
    "use strict";
    var t = function(e) {
        var t = 0;
        if (0 === e.length) return t;
        for (var r = 0; r < e.length; r++) t = (t << 5) - t + e.charCodeAt(r) | 0;
        return t
    };
    e.s(["generateHashCode", 0, t, "isTimestampInSampleTemp", 0, function(e, r) {
        return 31 * Math.abs(t(e.toString())) % 1e5 / 1e5 < r
    }])
}, 491279, 269774, 941073, e => {
    "use strict";
    var t, r = e.i(274466),
        n = e.i(423129),
        i = "https://app.amplitude.com",
        o = "https://cdn.amplitude.com/libs/background-capture-1.0.0-alpha.3.js.gz";
    e.s(["AMPLITUDE_BACKGROUND_CAPTURE_SCRIPT_URL", 0, o, "AMPLITUDE_ORIGIN", 0, i, "AMPLITUDE_ORIGINS_MAP", 0, {
        US: i,
        EU: "https://app.eu.amplitude.com",
        STAGING: "https://apps.stag2.amplitude.com"
    }], 269774);
    var s = "__AMPLITUDE_MESSENGER_INSTANCE__",
        a = "__AMPLITUDE_MESSENGER__",
        l = function() {
            function e(e) {
                var r = (void 0 === e ? {} : e).origin,
                    n = void 0 === r ? i : r;
                this[t] = !0, this.isSetup = !1, this.messageHandler = null, this.requestCallbacks = {}, this.actionHandlers = new Map, this.pendingMessages = new Map, this.scriptLoadPromises = new Map, this.endpoint = n
            }
            return e.prototype.notify = function(e) {
                var t, r, n, i;
                null == (r = null == (t = this.logger) ? void 0 : t.debug) || r.call(t, "Message sent: ", JSON.stringify(e)), null == (i = null == (n = window.opener) ? void 0 : n.postMessage) || i.call(n, e, this.endpoint)
            }, e.prototype.sendRequest = function(e, t, r) {
                var n = this;
                void 0 === r && (r = {
                    timeout: 15e3
                });
                var i = "".concat(Date.now(), "-").concat(Math.random().toString(36).substr(2, 9)),
                    o = {
                        id: i,
                        action: e,
                        args: t
                    };
                return new Promise(function(t, s) {
                    n.requestCallbacks[i] = {
                        resolve: t,
                        reject: s
                    }, n.notify(o), r.timeout > 0 && setTimeout(function() {
                        s(Error("".concat(e, " timed out (id: ").concat(i, ")"))), delete n.requestCallbacks[i]
                    }, r.timeout)
                })
            }, e.prototype.handleResponse = function(e) {
                var t;
                if (!this.requestCallbacks[e.id]) {
                    null == (t = this.logger) || t.warn("No callback found for request id: ".concat(e.id));
                    return
                }
                this.requestCallbacks[e.id].resolve(e.responseData), delete this.requestCallbacks[e.id]
            }, e.prototype.registerActionHandler = function(e, t) {
                this.actionHandlers.has(e) && (null == (s = null == (o = this.logger) ? void 0 : o.warn) || s.call(o, "Overwriting existing action handler for: ".concat(e))), this.actionHandlers.set(e, t);
                var n, i, o, s, a = this.pendingMessages.get(e);
                if (a) {
                    this.pendingMessages.delete(e);
                    try {
                        for (var l = (0, r.__values)(a), c = l.next(); !c.done; c = l.next()) {
                            var u = c.value;
                            t(u)
                        }
                    } catch (e) {
                        n = {
                            error: e
                        }
                    } finally {
                        try {
                            c && !c.done && (i = l.return) && i.call(l)
                        } finally {
                            if (n) throw n.error
                        }
                    }
                }
            }, e.prototype.loadScriptOnce = function(e) {
                return (0, r.__awaiter)(this, void 0, void 0, function() {
                    var t, n, i;
                    return (0, r.__generator)(this, function(r) {
                        switch (r.label) {
                            case 0:
                                if (t = this.scriptLoadPromises.get(e)) return [2, t];
                                n = (document.querySelector('script[src="'.concat(CSS.escape(e), '"]')) ? Promise.resolve({
                                    status: !0
                                }) : new Promise(function(t, r) {
                                    var n;
                                    try {
                                        var i = document.createElement("script");
                                        i.type = "text/javascript", i.async = !0, i.src = e, i.addEventListener("load", function() {
                                            t({
                                                status: !0
                                            })
                                        }, {
                                            once: !0
                                        }), i.addEventListener("error", function() {
                                            r({
                                                status: !1,
                                                message: "Failed to load the script ".concat(e)
                                            })
                                        }), null == (n = document.head) || n.appendChild(i)
                                    } catch (e) {
                                        r(e)
                                    }
                                })).then(function() {}), this.scriptLoadPromises.set(e, n), r.label = 1;
                            case 1:
                                return r.trys.push([1, 3, , 4]), [4, n];
                            case 2:
                                return r.sent(), [3, 4];
                            case 3:
                                throw i = r.sent(), this.scriptLoadPromises.delete(e), i;
                            case 4:
                                return [2]
                        }
                    })
                })
            }, e.prototype.setup = function(e) {
                var t, r, n = this,
                    o = void 0 === e ? {} : e,
                    s = o.logger,
                    a = o.endpoint;
                s && (this.logger = s), a && this.endpoint === i && (this.endpoint = a), this.isSetup || (this.isSetup = !0, null == (r = null == (t = this.logger) ? void 0 : t.debug) || r.call(t, "Setting up messenger"), this.messageHandler = function(e) {
                    if (null == (r = null == (t = n.logger) ? void 0 : t.debug) || r.call(t, "Message received: ", JSON.stringify(e)), n.endpoint === e.origin) {
                        var t, r, i, o, s, a = e.data,
                            l = null == a ? void 0 : a.action;
                        if (l)
                            if ("id" in a && a.id) null == (o = null == (i = n.logger) ? void 0 : i.debug) || o.call(i, "Received Response to previous request: ", JSON.stringify(e)), n.handleResponse(a);
                            else {
                                if ("ping" === l) return void n.notify({
                                    action: "pong"
                                });
                                var c = n.actionHandlers.get(l);
                                if (c) c(a.data);
                                else {
                                    var u = null != (s = n.pendingMessages.get(l)) ? s : [];
                                    u.push(a.data), n.pendingMessages.set(l, u)
                                }
                            }
                    }
                }, window.addEventListener("message", this.messageHandler), this.notify({
                    action: "page-loaded"
                }))
            }, e.prototype.destroy = function() {
                this.messageHandler && (window.removeEventListener("message", this.messageHandler), this.messageHandler = null), this.isSetup = !1, this.actionHandlers.clear(), this.pendingMessages.clear(), this.requestCallbacks = {}, this.scriptLoadPromises.clear();
                var e = (0, n.getGlobalScope)();
                (null == e ? void 0 : e[a]) === this && delete e[a]
            }, e
        }();
    t = s, e.s(["getOrCreateWindowMessenger", 0, function(e) {
        var t = (0, n.getGlobalScope)(),
            r = null == t ? void 0 : t[a];
        if ("object" == typeof r && null !== r && s in r && !0 === r[s]) return r;
        var i = new l(e);
        return t && (t[a] = i), i
    }], 491279);
    var c = "__AMPLITUDE_BACKGROUND_CAPTURE__";
    e.s(["enableBackgroundCapture", 0, function(e, t) {
        var r;
        if (!0 !== e[c]) {
            e[c] = !0;
            var n = null != (r = null == t ? void 0 : t.scriptUrl) ? r : o,
                i = null,
                s = function(t, r) {
                    var n, i;
                    "background-capture-complete" === t && (null == (i = null == (n = e.logger) ? void 0 : n.debug) || i.call(n, "Background capture complete"), e.notify({
                        action: "background-capture-complete",
                        data: r
                    }))
                };
            e.registerActionHandler("initialize-background-capture", function() {
                null == (r = null == (t = e.logger) ? void 0 : t.debug) || r.call(t, "Initializing background capture (external script)");
                var t, r, o = new URL(n, e.endpoint).toString();
                e.loadScriptOnce(o).then(function() {
                    var t, r, n;
                    null == (r = null == (t = e.logger) ? void 0 : t.debug) || r.call(t, "Background capture script loaded (external)"), i = null == (n = null == window ? void 0 : window.amplitudeBackgroundCapture) ? void 0 : n.call(window, {
                        messenger: e,
                        onBackgroundCapture: s
                    }), e.notify({
                        action: "background-capture-loaded"
                    })
                }).catch(function() {
                    var t;
                    null == (t = e.logger) || t.warn("Failed to initialize background capture")
                })
            }), e.registerActionHandler("close-background-capture", function() {
                var e;
                null == (e = null == i ? void 0 : i.close) || e.call(i), i = null
            })
        }
    }], 941073)
}, 449643, e => {
    "use strict";
    var t = function() {
        function e(e, t) {
            this.key = "AMP_remote_config_".concat(e.substring(0, 10)), this.logger = t
        }
        return e.prototype.fetchConfig = function() {
            var e = null,
                t = {
                    remoteConfig: null,
                    lastFetch: new Date
                };
            try {
                e = localStorage.getItem(this.key)
            } catch (e) {
                return this.logger.debug("Remote config localstorage failed to access: ", e), Promise.resolve(t)
            }
            if (null === e) return this.logger.debug("Remote config localstorage gets null because the key does not exist"), Promise.resolve(t);
            try {
                var r = JSON.parse(e);
                return this.logger.debug("Remote config localstorage parsed successfully: ".concat(JSON.stringify(r))), Promise.resolve({
                    remoteConfig: r.remoteConfig,
                    lastFetch: new Date(r.lastFetch)
                })
            } catch (e) {
                return this.logger.debug("Remote config localstorage failed to parse: ", e), localStorage.removeItem(this.key), Promise.resolve(t)
            }
        }, e.prototype.setConfig = function(e) {
            try {
                return localStorage.setItem(this.key, JSON.stringify(e)), this.logger.debug("Remote config localstorage set successfully."), Promise.resolve(!0)
            } catch (e) {
                this.logger.debug("Remote config localstorage failed to set: ", e)
            }
            return Promise.resolve(!1)
        }, e
    }();
    e.s(["RemoteConfigLocalStorage", 0, t])
}, 662778, e => {
    "use strict";
    var t = e.i(274466),
        r = e.i(423129),
        n = (0, t.__spreadArray)([], (0, t.__read)(Array(256).keys()), !1).map(function(e) {
            return e.toString(16).padStart(2, "0")
        }),
        i = function(e) {
            var o, s = (0, r.getGlobalScope)();
            if (!(null == (o = null == s ? void 0 : s.crypto) ? void 0 : o.getRandomValues)) return e ? (e ^ 16 * Math.random() >> e / 4).toString(16) : (String(1e7) + String(-1e3) + String(-4e3) + String(-8e3) + String(-1e11)).replace(/[018]/g, i);
            var a = s.crypto.getRandomValues(new Uint8Array(16));
            return a[6] = 15 & a[6] | 64, a[8] = 63 & a[8] | 128, (0, t.__spreadArray)([], (0, t.__read)(a.entries()), !1).map(function(e) {
                var r = (0, t.__read)(e, 2),
                    i = r[0],
                    o = r[1];
                return [4, 6, 8, 10].includes(i) ? "-".concat(n[o]) : n[o]
            }).join("")
        };
    e.s(["UUID", 0, i])
}, 820222, e => {
    "use strict";
    var t = e.i(274466),
        r = e.i(449643),
        n = e.i(662778),
        i = function() {
            function e(e, t, n, i) {
                void 0 === n && (n = "US"), this.callbackInfos = [], this.lastSuccessfulFetch = null, this.fetchPromise = null, this.isLastFetchInvalidApiKey = !1, this.apiKey = e, this.serverUrl = i || ("US" === n ? "https://sr-client-cfg.amplitude.com/config" : "https://sr-client-cfg.eu.amplitude.com/config"), this.logger = t, this.storage = new r.RemoteConfigLocalStorage(e, t)
            }
            return e.prototype.subscribe = function(e, t, r) {
                var i = (0, n.UUID)(),
                    o = {
                        id: i,
                        key: e,
                        deliveryMode: t,
                        callback: r
                    };
                return this.callbackInfos.push(o), "all" === t ? this.subscribeAll(o) : this.subscribeWaitForRemote(o, t.timeout), i
            }, e.prototype.unsubscribe = function(e) {
                var t = this.callbackInfos.findIndex(function(t) {
                    return t.id === e
                });
                return -1 === t ? (this.logger.debug("Remote config client unsubscribe failed because callback with id ".concat(e, " doesn't exist.")), !1) : (this.callbackInfos.splice(t, 1), this.logger.debug("Remote config client unsubscribe succeeded removing callback with id ".concat(e, ".")), !0)
            }, e.prototype.updateConfigs = function() {
                return (0, t.__awaiter)(this, void 0, void 0, function() {
                    var e, r = this;
                    return (0, t.__generator)(this, function(t) {
                        switch (t.label) {
                            case 0:
                                if (this.lastSuccessfulFetch && Date.now() - this.lastSuccessfulFetch < 3e5) return this.logger.debug("Remote config client skipping updateConfigs: Too recent"), [2];
                                return [4, this.getOrCreateFetchPromise()];
                            case 1:
                                return e = t.sent(), this.storage.setConfig(e), this.callbackInfos.forEach(function(t) {
                                    r.sendCallback(t, e, "remote")
                                }), [2]
                        }
                    })
                })
            }, e.prototype.getOrCreateFetchPromise = function() {
                var e = this;
                return this.fetchPromise || (this.isLastFetchInvalidApiKey ? (this.logger.debug("Remote config client skipping fetch: Invalid API key"), this.fetchPromise = Promise.resolve({
                    remoteConfig: null,
                    lastFetch: new Date
                }).finally(function() {
                    e.fetchPromise = null
                })) : this.fetchPromise = this.fetch().then(function(t) {
                    return null !== t.remoteConfig && (e.lastSuccessfulFetch = Date.now()), t
                }).finally(function() {
                    e.fetchPromise = null
                })), this.fetchPromise
            }, e.prototype.subscribeAll = function(e) {
                return (0, t.__awaiter)(this, void 0, void 0, function() {
                    var r, n, i, o = this;
                    return (0, t.__generator)(this, function(t) {
                        switch (t.label) {
                            case 0:
                                return r = this.getOrCreateFetchPromise().then(function(t) {
                                    o.logger.debug("Remote config client subscription all mode fetched from remote: ".concat(JSON.stringify(t))), o.sendCallback(e, t, "remote"), o.storage.setConfig(t)
                                }), n = this.storage.fetchConfig().then(function(e) {
                                    return e
                                }), [4, Promise.race([r, n])];
                            case 1:
                                return void 0 !== (i = t.sent()) && (this.logger.debug("Remote config client subscription all mode fetched from cache: ".concat(JSON.stringify(i))), null !== i.remoteConfig ? this.sendCallback(e, i, "cache") : this.logger.debug("Remote config client skips sending callback because cache is empty (first time user).")), [4, r];
                            case 2:
                                return t.sent(), [2]
                        }
                    })
                })
            }, e.prototype.subscribeWaitForRemote = function(e, r) {
                return (0, t.__awaiter)(this, void 0, void 0, function() {
                    var n, i;
                    return (0, t.__generator)(this, function(t) {
                        switch (t.label) {
                            case 0:
                                n = new Promise(function(e, t) {
                                    setTimeout(function() {
                                        t("Timeout exceeded")
                                    }, r)
                                }), t.label = 1;
                            case 1:
                                return t.trys.push([1, 3, , 5]), [4, Promise.race([this.getOrCreateFetchPromise(), n])];
                            case 2:
                                return i = t.sent(), this.logger.debug("Remote config client subscription wait for remote mode returns from remote."), this.sendCallback(e, i, "remote"), this.storage.setConfig(i), [3, 5];
                            case 3:
                                return t.sent(), this.logger.debug("Remote config client subscription wait for remote mode exceeded timeout. Try to fetch from cache."), [4, this.storage.fetchConfig()];
                            case 4:
                                return null !== (i = t.sent()).remoteConfig ? (this.logger.debug("Remote config client subscription wait for remote mode returns a cached copy."), this.sendCallback(e, i, "cache")) : (this.logger.debug("Remote config client subscription wait for remote mode failed to fetch cache."), this.sendCallback(e, i, "remote")), [3, 5];
                            case 5:
                                return [2]
                        }
                    })
                })
            }, e.prototype.sendCallback = function(e, t, r) {
                var n;
                e.lastCallback = new Date, n = e.key ? e.key.split(".").reduce(function(e, t) {
                    return null === e ? e : t in e ? e[t] : null
                }, t.remoteConfig) : t.remoteConfig, e.callback(n, r, t.lastFetch)
            }, e.prototype.fetch = function(e, r) {
                return void 0 === e && (e = 3), void 0 === r && (r = 1e3), (0, t.__awaiter)(this, void 0, void 0, function() {
                    var n, i, o, s, a, l, c = this;
                    return (0, t.__generator)(this, function(u) {
                        switch (u.label) {
                            case 0:
                                n = r / e, i = {
                                    remoteConfig: null,
                                    lastFetch: new Date
                                }, o = function(i) {
                                    var o, a, l, u, d, g;
                                    return (0, t.__generator)(this, function(t) {
                                        switch (t.label) {
                                            case 0:
                                                o = !0, a = new AbortController, l = setTimeout(function() {
                                                    return a.abort()
                                                }, r), t.label = 1;
                                            case 1:
                                                return t.trys.push([1, 7, 8, 9]), [4, fetch(s.getUrlParams(), {
                                                    method: "GET",
                                                    headers: {
                                                        Accept: "*/*"
                                                    },
                                                    signal: a.signal
                                                })];
                                            case 2:
                                                if ((u = t.sent()).ok) return [3, 4];
                                                return [4, u.text()];
                                            case 3:
                                                return d = t.sent(), s.logger.debug("Remote config client fetch with retry time ".concat(e, " failed with ").concat(u.status, ": ").concat(d)), 401 === u.status || 403 === u.status ? (s.logger.error("Remote config client fetch failed with ".concat(u.status, ". Invalid API key; future fetches will be skipped.")), s.isLastFetchInvalidApiKey = !0, o = !1) : u.status >= 400 && u.status < 500 && 429 !== u.status && (o = !1), [3, 6];
                                            case 4:
                                                return [4, u.json()];
                                            case 5:
                                                return [2, {
                                                    value: {
                                                        remoteConfig: t.sent(),
                                                        lastFetch: new Date
                                                    }
                                                }];
                                            case 6:
                                                return [3, 9];
                                            case 7:
                                                return (g = t.sent()) instanceof Error && "AbortError" === g.name ? s.logger.debug("Remote config client fetch with retry time ".concat(e, " timed out after ").concat(r, "ms")) : s.logger.debug("Remote config client fetch with retry time ".concat(e, " is rejected because: "), g), [3, 9];
                                            case 8:
                                                return clearTimeout(l), [7];
                                            case 9:
                                                if (!o) return [2, "break"];
                                                if (!(i < e - 1)) return [3, 11];
                                                return [4, new Promise(function(e) {
                                                    return setTimeout(e, c.getJitterDelay(n))
                                                })];
                                            case 10:
                                                t.sent(), t.label = 11;
                                            case 11:
                                                return [2]
                                        }
                                    })
                                }, s = this, a = 0, u.label = 1;
                            case 1:
                                if (!(a < e)) return [3, 4];
                                return [5, o(a)];
                            case 2:
                                if ("object" == typeof(l = u.sent())) return [2, l.value];
                                if ("break" === l) return [3, 4];
                                u.label = 3;
                            case 3:
                                return a++, [3, 1];
                            case 4:
                                return [2, i]
                        }
                    })
                })
            }, e.prototype.getJitterDelay = function(e) {
                return Math.floor(Math.random() * e)
            }, e.prototype.getUrlParams = function() {
                var t = encodeURIComponent(this.apiKey),
                    r = new URLSearchParams;
                return r.append("config_group", e.CONFIG_GROUP), "".concat(this.serverUrl, "/").concat(t, "?").concat(r.toString())
            }, e.CONFIG_GROUP = "browser", e
        }();
    e.s(["RemoteConfigClient", 0, i])
}]);

//# debugId=0a3fc385-03f6-0f27-ae31-97fcf5b3b895