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AU,UAAM,OAAQ,GAAQ,kBACnC,KAAK,aAAa,YAC5B,GACJ,CAIA,mBAAO,CAAa,GAChB,OAAO,IAAI,SAAS,EACxB,CACA,SAAA,CAAU,GACN,OAAO,MAAM,UAAU,KAAM,eAAW,GAAQ,UAAW,EAAS,GAAc,GAC9E,MAAM,EAAM,WAAW,aAAa,GACpC,IAAK,EAAa,CACd,MAAM,QAAoB,KAAK,aAAa,IAAI,GAChD,GAAI,EACA,OAAO,OAAO,OAAO,OAAO,OAAO,CAAC,EAAG,GAAc,CAAE,UAAU,GAEzE,CACA,MAAM,QAAqB,KAAK,MAAM,IAAI,GAE1C,aADM,KAAK,aAAa,IAAI,EAAK,GAC1B,OAAO,OAAO,OAAO,OAAO,CAAC,EAAG,GAAc,CAAE,UAAU,GACrE,GACJ,EAQJ,MAAM,gBAAkB,4BAA4B,gBAM9C,mBAAqB,4BAA4B,mBAMjD,wBAA0B,4BAA4B,wBAE5D,QAAQ,iBAAmB,4BAC3B,QAAQ,UAAY,UACpB,QAAQ,WAAa,WACrB,QAAQ,cAAgB,cACxB,QAAQ,kBAAoB,kBAC5B,QAAQ,oBAAsB,oBAC9B,QAAQ,gBAAkB,gBAC1B,QAAQ,wBAA0B,wBAClC,QAAQ,mBAAqB","file":"/npm/@fingerprintjs/fingerprintjs-pro-spa@1.3.3/dist/fp-pro-spa.cjs.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@fingerprintjs/fingerprintjs-pro-spa@1.3.3/dist/fp-pro-spa.cjs.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/**\n * FingerprintJS Pro SPA v1.3.3 - Copyright (c) FingerprintJS, Inc, 2025 (https://fingerprint.com)\n * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.\n */\n\n'use strict';\n\nvar tslib = require('tslib');\nvar FingerprintJSPro = require('@fingerprintjs/fingerprintjs-pro');\n\nfunction _interopNamespaceDefault(e) {\n    var n = Object.create(null);\n    if (e) {\n        Object.keys(e).forEach(function (k) {\n            if (k !== 'default') {\n                var d = Object.getOwnPropertyDescriptor(e, k);\n                Object.defineProperty(n, k, d.get ? d : {\n                    enumerable: true,\n                    get: function () { return e[k]; }\n                });\n            }\n        });\n    }\n    n.default = e;\n    return Object.freeze(n);\n}\n\nvar FingerprintJSPro__namespace = /*#__PURE__*/_interopNamespaceDefault(FingerprintJSPro);\n\nconst CACHE_KEY_PREFIX = '@fpjs@client@';\nconst MAX_CACHE_LIFE = 60 * 60 * 24; // 24 hours\nconst DEFAULT_CACHE_LIFE = 60 * 60; // 1 hour\nconst DEFAULT_NOW_PROVIDER = () => Date.now();\nclass CacheKey {\n    constructor(options) {\n        var _a;\n        this.tag = options.tag || null;\n        this.linkedId = options.linkedId || null;\n        this.extendedResult = (_a = options.extendedResult) !== null && _a !== void 0 ? _a : false;\n    }\n    /**\n     * Converts this `CacheKey` instance into a string for use in a cache\n     * @returns A string representation of the key\n     */\n    toKey() {\n        return `${JSON.stringify(this.tag)}__${JSON.stringify(this.linkedId)}__${this.extendedResult}`;\n    }\n}\nfunction getKeyWithPrefix(key, prefix) {\n    return `${prefix}__${key}`;\n}\nfunction removePrefixFromKey(key, prefix) {\n    return key.replace(`${prefix}__`, '');\n}\n\n/**\n * Implementation of caching that uses local storage\n * */\nclass LocalStorageCache {\n    constructor(prefix = CACHE_KEY_PREFIX) {\n        this.prefix = prefix;\n    }\n    set(key, entry) {\n        window.localStorage.setItem(getKeyWithPrefix(key, this.prefix), JSON.stringify(entry));\n    }\n    get(key) {\n        const json = window.localStorage.getItem(getKeyWithPrefix(key, this.prefix));\n        if (!json) {\n            return;\n        }\n        try {\n            return JSON.parse(json);\n        }\n        catch (e) {\n            return;\n        }\n    }\n    remove(key) {\n        window.localStorage.removeItem(getKeyWithPrefix(key, this.prefix));\n    }\n    allKeys() {\n        return Object.keys(window.localStorage)\n            .filter((key) => key.startsWith(this.prefix))\n            .map((key) => removePrefixFromKey(key, this.prefix));\n    }\n}\n\n/**\n * Implementation of caching that uses session storage\n * */\nclass SessionStorageCache {\n    constructor(prefix = CACHE_KEY_PREFIX) {\n        this.prefix = prefix;\n    }\n    /**\n     * It takes a key and an entry, and sets the entry in the session storage with the key\n     * @param {string} key - The key to store the entry under.\n     * @param {Cacheable} entry - The value to be stored in the cache.\n     */\n    set(key, entry) {\n        window.sessionStorage.setItem(getKeyWithPrefix(key, this.prefix), JSON.stringify(entry));\n    }\n    /**\n     * It gets the value of the key from the session storage, parses it as JSON, and returns it\n     * @param {string} key - The key to store the data under.\n     * @returns The value of the key in the sessionStorage.\n     */\n    get(key) {\n        const json = window.sessionStorage.getItem(getKeyWithPrefix(key, this.prefix));\n        if (!json) {\n            return;\n        }\n        try {\n            return JSON.parse(json);\n        }\n        catch (e) {\n            return;\n        }\n    }\n    /**\n     * It removes the item from session storage with the given key\n     * @param {string} key - The key to store the value under.\n     */\n    remove(key) {\n        window.sessionStorage.removeItem(getKeyWithPrefix(key, this.prefix));\n    }\n    /**\n     * It returns an array of all the keys in the session storage that start with the prefix\n     * @returns An array of all the keys in the sessionStorage that start with the prefix.\n     */\n    allKeys() {\n        return Object.keys(window.sessionStorage)\n            .filter((key) => key.startsWith(this.prefix))\n            .map((key) => removePrefixFromKey(key, this.prefix));\n    }\n}\n\n/**\n * Wraps a cache implementation and adds expiration logic\n * */\nclass CacheManager {\n    constructor(cache, cacheTime = DEFAULT_CACHE_LIFE, nowProvider) {\n        this.cache = cache;\n        this.cacheTime = cacheTime;\n        this.nowProvider = nowProvider || DEFAULT_NOW_PROVIDER;\n    }\n    /**\n     * It gets a cache entry from the cache, and if it's expired, it removes it from the cache\n     * @param cacheKey - CacheKey<TExtended>\n     * @returns A promise that resolves to a cache entry or undefined.\n     */\n    get(cacheKey) {\n        return tslib.__awaiter(this, void 0, void 0, function* () {\n            const wrappedEntry = yield this.cache.get(cacheKey.toKey());\n            if (!wrappedEntry) {\n                return;\n            }\n            const now = yield this.nowProvider();\n            const nowSeconds = Math.floor(now / 1000);\n            if (wrappedEntry.expiresAt < nowSeconds) {\n                yield this.cache.remove(cacheKey.toKey());\n                return;\n            }\n            return wrappedEntry.body;\n        });\n    }\n    /**\n     * It takes a cache key and a cache entry, wraps the cache entry, and then sets the wrapped cache entry in the cache\n     * @param cacheKey - CacheKey<TExtended>\n     * @param {CacheEntry} entry - The cache entry to be stored.\n     */\n    set(cacheKey, entry) {\n        return tslib.__awaiter(this, void 0, void 0, function* () {\n            const wrappedEntry = yield this.wrapCacheEntry(entry);\n            yield this.cache.set(cacheKey.toKey(), wrappedEntry);\n        });\n    }\n    /**\n     * It gets all the keys in the cache, and then removes them all\n     */\n    clearCache() {\n        return tslib.__awaiter(this, void 0, void 0, function* () {\n            const keys = yield this.cache.allKeys();\n            yield Promise.all(keys.map((key) => this.cache.remove(key)));\n        });\n    }\n    wrapCacheEntry(entry) {\n        return tslib.__awaiter(this, void 0, void 0, function* () {\n            const now = yield this.nowProvider();\n            const expiresInTime = Math.floor(now / 1000) + this.cacheTime;\n            return {\n                body: entry,\n                expiresAt: expiresInTime,\n            };\n        });\n    }\n}\n\n/**\n * Implementation of caching that uses in-memory storage\n * */\nclass InMemoryCache {\n    constructor() {\n        this.enclosedCache = (function () {\n            const cache = {};\n            return {\n                set(key, entry) {\n                    cache[key] = entry;\n                },\n                get(key) {\n                    const cacheEntry = cache[key];\n                    if (!cacheEntry) {\n                        return;\n                    }\n                    return cacheEntry;\n                },\n                remove(key) {\n                    delete cache[key];\n                },\n                allKeys() {\n                    return Object.keys(cache);\n                },\n            };\n        })();\n    }\n}\n\n/**\n * Implementation of stub cache that is used when cache is disabled by user\n * */\nclass CacheStub {\n    set() { }\n    get() {\n        return undefined;\n    }\n    remove() { }\n    allKeys() {\n        return [];\n    }\n}\n\nexports.CacheLocation = void 0;\n(function (CacheLocation) {\n    CacheLocation[\"Memory\"] = \"memory\";\n    CacheLocation[\"LocalStorage\"] = \"localstorage\";\n    CacheLocation[\"SessionStorage\"] = \"sessionstorage\";\n    CacheLocation[\"NoCache\"] = \"nocache\";\n})(exports.CacheLocation || (exports.CacheLocation = {}));\n\nvar version = \"1.3.3\";\n\nconst cacheLocationBuilders = {\n    [exports.CacheLocation.Memory]: () => new InMemoryCache().enclosedCache,\n    [exports.CacheLocation.LocalStorage]: (prefix) => new LocalStorageCache(prefix),\n    [exports.CacheLocation.SessionStorage]: (prefix) => new SessionStorageCache(prefix),\n    [exports.CacheLocation.NoCache]: () => new CacheStub(),\n};\nconst doesBrowserSupportCacheLocation = (cacheLocation) => {\n    switch (cacheLocation) {\n        case exports.CacheLocation.SessionStorage:\n            try {\n                window.sessionStorage.getItem('item');\n            }\n            catch (e) {\n                return false;\n            }\n            return true;\n        case exports.CacheLocation.LocalStorage:\n            try {\n                window.localStorage.getItem('item');\n            }\n            catch (e) {\n                return false;\n            }\n            return true;\n        default:\n            return true;\n    }\n};\nconst cacheFactory = (location) => {\n    return cacheLocationBuilders[location];\n};\n/**\n * FingerprintJS SDK for Single Page Applications\n */\nclass FpjsClient {\n    constructor(options) {\n        var _a;\n        this.inFlightRequests = new Map();\n        this.agentPromise = null;\n        this.customAgent = options === null || options === void 0 ? void 0 : options.customAgent;\n        this.agent = {\n            collect: () => {\n                throw new Error(\"FPJSAgent hasn't loaded yet. Make sure to call the init() method first.\");\n            },\n            get: () => {\n                throw new Error(\"FPJSAgent hasn't loaded yet. Make sure to call the init() method first.\");\n            },\n        };\n        this.loadOptions = options === null || options === void 0 ? void 0 : options.loadOptions;\n        if ((options === null || options === void 0 ? void 0 : options.cache) && (options === null || options === void 0 ? void 0 : options.cacheLocation)) {\n            console.warn('Both `cache` and `cacheLocation` options have been specified in the FpjsClient configuration; ignoring `cacheLocation` and using `cache`.');\n        }\n        let cache;\n        if (options === null || options === void 0 ? void 0 : options.cache) {\n            cache = options.cache;\n        }\n        else {\n            this.cacheLocation = (options === null || options === void 0 ? void 0 : options.cacheLocation) || exports.CacheLocation.SessionStorage;\n            if (!cacheFactory(this.cacheLocation)) {\n                throw new Error(`Invalid cache location \"${this.cacheLocation}\"`);\n            }\n            if (!doesBrowserSupportCacheLocation(this.cacheLocation)) {\n                this.cacheLocation = exports.CacheLocation.Memory;\n            }\n            cache = cacheFactory(this.cacheLocation)(options === null || options === void 0 ? void 0 : options.cachePrefix);\n        }\n        if ((options === null || options === void 0 ? void 0 : options.cacheTimeInSeconds) && options.cacheTimeInSeconds > MAX_CACHE_LIFE) {\n            throw new Error(`Cache time cannot exceed 86400 seconds (24 hours)`);\n        }\n        const cacheTime = (_a = options === null || options === void 0 ? void 0 : options.cacheTimeInSeconds) !== null && _a !== void 0 ? _a : DEFAULT_CACHE_LIFE;\n        this.cacheManager = new CacheManager(cache, cacheTime);\n    }\n    /**\n     * Loads FPJS JS agent with certain settings and stores the instance in memory\n     * [https://dev.fingerprint.com/docs/js-agent#agent-initialization]\n     *\n     * @param passedLoadOptions Additional load options to be passed to the agent, they will be merged with load options provided in the constructor.\n     */\n    init(passedLoadOptions) {\n        return tslib.__awaiter(this, void 0, void 0, function* () {\n            var _a, _b, _c;\n            if (!this.loadOptions && !passedLoadOptions) {\n                throw new TypeError('No load options provided');\n            }\n            const integrationInfo = \n            // @ts-ignore\n            ((_a = this.loadOptions) === null || _a === void 0 ? void 0 : _a.silent) === true\n                ? []\n                : [\n                    ...(((_b = this.loadOptions) === null || _b === void 0 ? void 0 : _b.integrationInfo) || []),\n                    ...((passedLoadOptions === null || passedLoadOptions === void 0 ? void 0 : passedLoadOptions.integrationInfo) || []),\n                    `spa-sdk/${version}`,\n                ];\n            const loadOptions = Object.assign(Object.assign(Object.assign({}, this.loadOptions), passedLoadOptions), { integrationInfo });\n            if (!this.agentPromise) {\n                const agentLoader = (_c = this.customAgent) !== null && _c !== void 0 ? _c : FingerprintJSPro__namespace;\n                this.agentPromise = agentLoader\n                    .load(loadOptions)\n                    .then((agent) => {\n                    this.agent = agent;\n                    return agent;\n                })\n                    .catch((error) => {\n                    this.agentPromise = null;\n                    throw error;\n                });\n            }\n            return this.agentPromise;\n        });\n    }\n    /**\n     * Returns visitor identification data based on the request options\n     * [https://dev.fingerprint.com/docs/js-agent#visitor-identification]\n     *\n     * @param options\n     * @param ignoreCache if set to true a request to the API will be made even if the data is present in cache\n     */\n    getVisitorData() {\n        return tslib.__awaiter(this, arguments, void 0, function* (options = {}, ignoreCache = false) {\n            const cacheKey = FpjsClient.makeCacheKey(options);\n            const key = cacheKey.toKey();\n            if (!this.inFlightRequests.has(key)) {\n                const promise = this._identify(options, ignoreCache).finally(() => {\n                    this.inFlightRequests.delete(key);\n                });\n                this.inFlightRequests.set(key, promise);\n            }\n            return (yield this.inFlightRequests.get(key));\n        });\n    }\n    /**\n     * Returns cached visitor data based on the request options, or undefined if the data is not present in cache\n     * */\n    getVisitorDataFromCache() {\n        return tslib.__awaiter(this, arguments, void 0, function* (options = {}) {\n            const cacheKey = FpjsClient.makeCacheKey(options);\n            const cacheResult = yield this.cacheManager.get(cacheKey);\n            return cacheResult ? Object.assign(Object.assign({}, cacheResult), { cacheHit: true }) : undefined;\n        });\n    }\n    /**\n     * Checks if request matching given options is present in cache\n     * */\n    isInCache() {\n        return tslib.__awaiter(this, arguments, void 0, function* (options = {}) {\n            return Boolean(yield this.getVisitorDataFromCache(options));\n        });\n    }\n    /**\n     * Clears visitor data from cache regardless of the cache implementation\n     */\n    clearCache() {\n        return tslib.__awaiter(this, void 0, void 0, function* () {\n            yield this.cacheManager.clearCache();\n        });\n    }\n    /**\n     * Makes a CacheKey object from GetOptions\n     */\n    static makeCacheKey(options) {\n        return new CacheKey(options);\n    }\n    _identify(options_1) {\n        return tslib.__awaiter(this, arguments, void 0, function* (options, ignoreCache = false) {\n            const key = FpjsClient.makeCacheKey(options);\n            if (!ignoreCache) {\n                const cacheResult = yield this.cacheManager.get(key);\n                if (cacheResult) {\n                    return Object.assign(Object.assign({}, cacheResult), { cacheHit: true });\n                }\n            }\n            const agentResult = (yield this.agent.get(options));\n            yield this.cacheManager.set(key, agentResult);\n            return Object.assign(Object.assign({}, agentResult), { cacheHit: false });\n        });\n    }\n}\n\n/**\n * @deprecated\n *\n * Use `FingerprintJSPro.defaultEndpoint` instead, this export will be removed in the next major version\n * */\nconst defaultEndpoint = FingerprintJSPro__namespace.defaultEndpoint;\n/**\n * @deprecated\n *\n * Use `FingerprintJSPro.defaultTlsEndpoint` instead, this export will be removed in the next major version\n */\nconst defaultTlsEndpoint = FingerprintJSPro__namespace.defaultTlsEndpoint;\n/**\n * @deprecated\n *\n * Use `FingerprintJSPro.defaultScriptUrlPattern` instead, this export will be removed in the next major version\n */\nconst defaultScriptUrlPattern = FingerprintJSPro__namespace.defaultScriptUrlPattern;\n\nexports.FingerprintJSPro = FingerprintJSPro__namespace;\nexports.CacheStub = CacheStub;\nexports.FpjsClient = FpjsClient;\nexports.InMemoryCache = InMemoryCache;\nexports.LocalStorageCache = LocalStorageCache;\nexports.SessionStorageCache = SessionStorageCache;\nexports.defaultEndpoint = defaultEndpoint;\nexports.defaultScriptUrlPattern = defaultScriptUrlPattern;\nexports.defaultTlsEndpoint = defaultTlsEndpoint;\n"]}