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EAAWG,oBAAoBpD,QACxBiD,ECrDJ,SAASI,EAAgBhE,EAASiE,EAAS,IAC9C,OAAOrB,EAAa,CAChBC,KAAO7I,IACH,MAAMkK,EAAOlE,EAAQmE,QAAQF,EAASjK,GACtC,OAAOkK,EAAOpL,KAAKuE,MAAM6G,QAAQtK,GAErCyG,IAAK,CAACrG,EAAKU,KACPsF,EAAQoE,QAAQH,EAASjK,EAAKlB,KAAKC,UAAU2B,KAEjD8F,OAASxG,IACLgG,EAAQqE,WAAWJ,EAASjK,MCXpCsK,QAAQ5B,MAAM,uFACd4B,QAAQ5B,MAAM,8D","sources":["webpack://AxiosCacheInterceptor/webpack/universalModuleDefinition","webpack://AxiosCacheInterceptor/./node_modules/fast-defer/index.min.js","webpack://AxiosCacheInterceptor/./node_modules/object-code/index.min.js","webpack://AxiosCacheInterceptor/webpack/bootstrap","webpack://AxiosCacheInterceptor/webpack/runtime/define property getters","webpack://AxiosCacheInterceptor/webpack/runtime/hasOwnProperty shorthand","webpack://AxiosCacheInterceptor/webpack/runtime/make namespace object","webpack://AxiosCacheInterceptor/./node_modules/cache-parser/dist/index.mjs","webpack://AxiosCacheInterceptor/./src/header/headers.ts","webpack://AxiosCacheInterceptor/./src/header/interpreter.ts","webpack://AxiosCacheInterceptor/./src/interceptors/util.ts","webpack://AxiosCacheInterceptor/./src/interceptors/request.ts","webpack://AxiosCacheInterceptor/./src/util/cache-predicate.ts","webpack://AxiosCacheInterceptor/./src/util/update-cache.ts","webpack://AxiosCacheInterceptor/./src/interceptors/response.ts","webpack://AxiosCacheInterceptor/./src/storage/build.ts","webpack://AxiosCacheInterceptor/./src/storage/memory.ts","webpack://AxiosCacheInterceptor/./src/util/key-generator.ts","webpack://AxiosCacheInterceptor/./src/cache/create.ts","webpack://AxiosCacheInterceptor/./src/storage/web-api.ts","webpack://AxiosCacheInterceptor/./src/index.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"AxiosCacheInterceptor\"] = factory();\n\telse\n\t\troot[\"AxiosCacheInterceptor\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn ","!function(e){var r=Symbol(\"fast-defer\");e.deferred=function(){var e,n,t=new Promise((function(r,t){e=r,n=t}));return t.resolve=e,t.reject=n,t[r]=1,t},e.isDeferred=function(e){return!!e&&!!e[r]}}(\"undefined\"!=typeof exports?exports:window.FastDefer||(window.FastDefer={}));","!function(r){r.transform=function(t){var n=typeof t;if(\"object\"===n&&t){if(t instanceof Date)return\"#\"+t.getTime();if(t instanceof RegExp)return\"#\"+t.toString();var o=Array.isArray(t)?[]:{};for(var e in t)o[e]=r.transform(t[e]);return\"#\"+String(t.constructor)+JSON.stringify(o,Object.keys(o).sort())}return n+String(t)+(\"symbol\"===n?Math.random():\"\")},r.code=function(t){t=r.transform(t);for(var n=7,o=0;o<t.length;)n=31*n+t.charCodeAt(o++)&9007199254740991;return n}}(\"undefined\"!=typeof exports?exports:window.FastHash||(window.FastHash={}));","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var e=Symbol(\"cache-parser\");function a(a){return!(!a||!a[e])}function r(e){return(\"string\"==typeof e||\"number\"==typeof e)&&(e=Number(e))>=0&&e<Infinity}function t(e){return\"number\"==typeof e||!0===e||\"string\"==typeof e&&\"false\"!==e}function s(e){var a=e.toLowerCase().replace(/\\s+/g,\"\").split(\",\"),r={};for(var t in a){var s=a[t].split(\"=\",2);r[s[0]]=1===s.length||s[1]}return r}function n(a){var n=Object.defineProperty({},e,{enumerable:!1,value:1});if(!a||\"string\"!=typeof a)return n;var i=s(a);return t(i.immutable)&&(n.immutable=!0),r(i[\"max-age\"])&&(n.maxAge=Number(i[\"max-age\"])),r(i[\"max-stale\"])&&(n.maxStale=Number(i[\"max-stale\"])),r(i[\"min-fresh\"])&&(n.minFresh=Number(i[\"min-fresh\"])),t(i[\"must-revalidate\"])&&(n.mustRevalidate=!0),t(i[\"must-understand\"])&&(n.mustUnderstand=!0),t(i[\"no-cache\"])&&(n.noCache=!0),t(i[\"no-store\"])&&(n.noStore=!0),t(i[\"no-transform\"])&&(n.noTransform=!0),t(i[\"only-if-cached\"])&&(n.onlyIfCached=!0),t(i.private)&&(n.private=!0),t(i[\"proxy-revalidate\"])&&(n.proxyRevalidate=!0),t(i.public)&&(n.public=!0),r(i[\"s-maxage\"])&&(n.sMaxAge=Number(i[\"s-maxage\"])),r(i[\"stale-if-error\"])&&(n.staleIfError=Number(i[\"stale-if-error\"])),r(i[\"stale-while-revalidate\"])&&(n.staleWhileRevalidate=Number(i[\"stale-while-revalidate\"])),n}function i(e){if(!e||\"object\"!=typeof e)return[];var a=[];return t(e.immutable)&&a.push(\"immutable\"),r(e.maxAge)&&a.push(\"max-age=\"+e.maxAge),r(e.maxStale)&&a.push(\"max-stale=\"+e.maxStale),r(e.minFresh)&&a.push(\"min-fresh=\"+e.minFresh),t(e.mustRevalidate)&&a.push(\"must-revalidate\"),t(e.mustUnderstand)&&a.push(\"must-understand\"),t(e.noCache)&&a.push(\"no-cache\"),t(e.noStore)&&a.push(\"no-store\"),t(e.noTransform)&&a.push(\"no-transform\"),t(e.onlyIfCached)&&a.push(\"only-if-cached\"),t(e.private)&&a.push(\"private\"),t(e.proxyRevalidate)&&a.push(\"proxy-revalidate\"),t(e.public)&&a.push(\"public\"),r(e.sMaxAge)&&a.push(\"s-maxage=\"+e.sMaxAge),r(e.staleIfError)&&a.push(\"stale-if-error=\"+e.staleIfError),r(e.staleWhileRevalidate)&&a.push(\"stale-while-revalidate=\"+e.staleWhileRevalidate),a}export{a as isCacheControl,r as isDuration,t as isTruthy,n as parse,s as parseHeadersString,i as tokenize};\n//# sourceMappingURL=index.mjs.map\n","export const Header = Object.freeze({\n    /**\n     * ```txt\n     * If-Modified-Since: <day-name>, <day> <month> <year> <hour>:<minute>:<second> GMT\n     * ```\n     *\n     * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Modified-Since\n     */\n    IfModifiedSince: 'if-modified-since',\n    /**\n     * ```txt\n     * Last-Modified: <day-name>, <day> <month> <year> <hour>:<minute>:<second> GMT\n     * ```\n     *\n     * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Last-Modified\n     */\n    LastModified: 'last-modified',\n    /**\n     * ```txt\n     * If-None-Match: \"<etag_value>\"\n     * If-None-Match: \"<etag_value>\", \"<etag_value>\", …\n     * If-None-Match: *\n     * ```\n     *\n     * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-None-Match\n     */\n    IfNoneMatch: 'if-none-match',\n    /**\n     * ```txt\n     * Cache-Control: max-age=604800\n     * ```\n     *\n     * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control\n     */\n    CacheControl: 'cache-control',\n    /**\n     * ```txt\n     * ETag: W / '<etag_value>';\n     * ETag: '<etag_value>';\n     * ```\n     *\n     * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag\n     */\n    ETag: 'etag',\n    /**\n     * ```txt\n     * Expires: <http-date>\n     * ```\n     *\n     * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expires\n     */\n    Expires: 'expires',\n    /**\n     * ```txt\n     * Age: <delta-seconds>\n     * ```\n     *\n     * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Age\n     */\n    Age: 'age',\n    /**\n     * Used internally as metadata to mark the cache item as revalidatable and enabling\n     * stale cache state Contains a string of ASCII characters that can be used as ETag for\n     * `If-Match` header Provided by user using `cache.etag` value.\n     *\n     * ```txt\n     * X-Axios-Cache-Etag: \"<etag_value>\"\n     * ```\n     */\n    XAxiosCacheEtag: 'x-axios-cache-etag',\n    /**\n     * Used internally as metadata to mark the cache item as revalidatable and enabling\n     * stale cache state may contain `'use-cache-timestamp'` if `cache.modifiedSince` is\n     * `true`, otherwise will contain a date from `cache.modifiedSince`. If a date is\n     * provided, it can be used for `If-Modified-Since` header, otherwise the cache\n     * timestamp can be used for `If-Modified-Since` header.\n     *\n     * ```txt\n     * X-Axios-Cache-Last-Modified: <day-name>, <day> <month> <year> <hour>:<minute>:<second> GMT\n     * X-Axios-Cache-Last-Modified: use-cache-timestamp\n     * ```\n     */\n    XAxiosCacheLastModified: 'x-axios-cache-last-modified',\n    /**\n     * Used internally as metadata to mark the cache item able to be used if the server\n     * returns an error. The stale-if-error response directive indicates that the cache can\n     * reuse a stale response when any error occurs.\n     *\n     * ```txt\n     * XAxiosCacheStaleIfError: <seconds>\n     * ```\n     */\n    XAxiosCacheStaleIfError: 'x-axios-cache-stale-if-error'\n});\n","import { parse } from 'cache-parser';\nimport { Header } from './headers';\nexport const defaultHeaderInterpreter = (headers) => {\n    if (!headers)\n        return 'not enough headers';\n    const cacheControl = headers[Header.CacheControl];\n    if (cacheControl) {\n        const { noCache, noStore, mustRevalidate, maxAge, immutable } = parse(String(cacheControl));\n        // Header told that this response should not be cached.\n        if (noCache || noStore) {\n            return 'dont cache';\n        }\n        if (immutable) {\n            // 1 year is sufficient, as Infinity may cause more problems.\n            // It might not be the best way, but a year is better than none.\n            return 1000 * 60 * 60 * 24 * 365;\n        }\n        // Already out of date, for cache can be saved, but must be requested again\n        if (mustRevalidate) {\n            return 0;\n        }\n        if (maxAge) {\n            const age = headers[Header.Age];\n            if (!age) {\n                return maxAge * 1000;\n            }\n            return (maxAge - Number(age)) * 1000;\n        }\n    }\n    const expires = headers[Header.Expires];\n    if (expires) {\n        const milliseconds = Date.parse(String(expires)) - Date.now();\n        return milliseconds >= 0 ? milliseconds : 'dont cache';\n    }\n    return 'not enough headers';\n};\n","import { Header } from '../header/headers';\n/**\n * Creates a new validateStatus function that will use the one already used and also\n * accept status code 304.\n */\nexport function createValidateStatus(oldValidate) {\n    return oldValidate\n        ? (status) => oldValidate(status) || status === 304\n        : (status) => (status >= 200 && status < 300) || status === 304;\n}\n/** Checks if the given method is in the methods array */\nexport function isMethodIn(requestMethod = 'get', methodList = []) {\n    requestMethod = requestMethod.toLowerCase();\n    for (const method of methodList) {\n        if (method.toLowerCase() === requestMethod) {\n            return true;\n        }\n    }\n    return false;\n}\n/**\n * This function updates the cache when the request is stale. So, the next request to the\n * server will be made with proper header / settings.\n */\nexport function updateStaleRequest(cache, config) {\n    var _a;\n    config.headers || (config.headers = {});\n    const { etag, modifiedSince } = config.cache;\n    if (etag) {\n        const etagValue = etag === true ? (_a = cache.data) === null || _a === void 0 ? void 0 : _a.headers[Header.ETag] : etag;\n        if (etagValue) {\n            config.headers[Header.IfNoneMatch] = etagValue;\n        }\n    }\n    if (modifiedSince) {\n        config.headers[Header.IfModifiedSince] =\n            modifiedSince === true\n                ? // If last-modified is not present, use the createdAt timestamp\n                    cache.data.headers[Header.LastModified] ||\n                        new Date(cache.createdAt).toUTCString()\n                : modifiedSince.toUTCString();\n    }\n}\n/**\n * Creates the new date to the cache by the provided response. Also handles possible 304\n * Not Modified by updating response properties.\n */\nexport function createCacheResponse(response, cache) {\n    if (response.status === 304 && cache) {\n        // Set the cache information into the response object\n        response.cached = true;\n        response.data = cache.data;\n        response.status = cache.status;\n        response.statusText = cache.statusText;\n        // Update possible new headers\n        response.headers = Object.assign(Object.assign({}, cache.headers), response.headers);\n        // return the old cache\n        return cache;\n    }\n    // New Response\n    return {\n        data: response.data,\n        status: response.status,\n        statusText: response.statusText,\n        headers: response.headers\n    };\n}\n","import { deferred } from 'fast-defer';\nimport { createValidateStatus, isMethodIn, updateStaleRequest } from './util';\nexport function defaultRequestInterceptor(axios) {\n    const onFulfilled = async (config) => {\n        var _a, _b, _c, _d, _e, _f, _g, _h, _j;\n        if (config.cache === false) {\n            if (__ACI_DEV__) {\n                (_a = axios.debug) === null || _a === void 0 ? void 0 : _a.call(axios, {\n                    msg: 'Ignoring cache because config.cache is false',\n                    data: config\n                });\n            }\n            return config;\n        }\n        // merge defaults with per request configuration\n        config.cache = Object.assign(Object.assign({}, axios.defaults.cache), config.cache);\n        if (!isMethodIn(config.method, config.cache.methods)) {\n            if (__ACI_DEV__) {\n                (_b = axios.debug) === null || _b === void 0 ? void 0 : _b.call(axios, {\n                    msg: `Ignored because method (${config.method}) is not in cache.methods (${config.cache.methods})`\n                });\n            }\n            return config;\n        }\n        const key = (config.id = axios.generateKey(config));\n        // Assumes that the storage handled staled responses\n        let cache = await axios.storage.get(key);\n        // Not cached, continue the request, and mark it as fetching\n        emptyOrStale: if (cache.state === 'empty' || cache.state === 'stale') {\n            /**\n             * This checks for simultaneous access to a new key. The js event loop jumps on the\n             * first await statement, so the second (asynchronous call) request may have already\n             * started executing.\n             */\n            if (axios.waiting[key]) {\n                cache = (await axios.storage.get(key));\n                if (__ACI_DEV__) {\n                    (_c = axios.debug) === null || _c === void 0 ? void 0 : _c.call(axios, {\n                        id: key,\n                        msg: 'Waiting list had an deferred for this key, waiting for it to finish'\n                    });\n                }\n                break emptyOrStale;\n            }\n            // Create a deferred to resolve other requests for the same key when it's completed\n            axios.waiting[key] = deferred();\n            /**\n             * Add a default reject handler to catch when the request is aborted without others\n             * waiting for it.\n             */\n            (_d = axios.waiting[key]) === null || _d === void 0 ? void 0 : _d.catch(() => undefined);\n            await axios.storage.set(key, {\n                state: 'loading',\n                previous: cache.state,\n                // Eslint complains a lot :)\n                // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any\n                data: cache.data,\n                // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any\n                createdAt: cache.createdAt\n            });\n            if (cache.state === 'stale') {\n                updateStaleRequest(cache, config);\n                if (__ACI_DEV__) {\n                    (_e = axios.debug) === null || _e === void 0 ? void 0 : _e.call(axios, {\n                        id: key,\n                        msg: 'Updated stale request'\n                    });\n                }\n            }\n            config.validateStatus = createValidateStatus(config.validateStatus);\n            if (__ACI_DEV__) {\n                (_f = axios.debug) === null || _f === void 0 ? void 0 : _f.call(axios, {\n                    id: key,\n                    msg: 'Sending request, waiting for response'\n                });\n            }\n            return config;\n        }\n        let cachedResponse;\n        if (cache.state === 'loading') {\n            const deferred = axios.waiting[key];\n            // Just in case, the deferred doesn't exists.\n            /* istanbul ignore if 'really hard to test' */\n            if (!deferred) {\n                await axios.storage.remove(key);\n                return config;\n            }\n            if (__ACI_DEV__) {\n                (_g = axios.debug) === null || _g === void 0 ? void 0 : _g.call(axios, {\n                    id: key,\n                    msg: 'Detected concurrent request, waiting for it to finish'\n                });\n            }\n            try {\n                cachedResponse = await deferred;\n            }\n            catch (err) {\n                if (__ACI_DEV__) {\n                    (_h = axios.debug) === null || _h === void 0 ? void 0 : _h.call(axios, {\n                        id: key,\n                        msg: 'Deferred rejected, requesting again',\n                        data: err\n                    });\n                }\n                // The deferred is rejected when the request that we are waiting rejected cache.\n                return config;\n            }\n        }\n        else {\n            cachedResponse = cache.data;\n        }\n        // Even though the response interceptor receives this one from here,\n        // it has been configured to ignore cached responses = true\n        config.adapter = () => Promise.resolve({\n            config,\n            data: cachedResponse.data,\n            headers: cachedResponse.headers,\n            status: cachedResponse.status,\n            statusText: cachedResponse.statusText,\n            cached: true,\n            id: key\n        });\n        if (__ACI_DEV__) {\n            (_j = axios.debug) === null || _j === void 0 ? void 0 : _j.call(axios, {\n                id: key,\n                msg: 'Returning cached response'\n            });\n        }\n        return config;\n    };\n    return {\n        onFulfilled,\n        apply: () => axios.interceptors.request.use(onFulfilled)\n    };\n}\n","/** Tests an response against a {@link CachePredicateObject}. */\nexport async function testCachePredicate(response, predicate) {\n    var _a;\n    if (typeof predicate === 'function') {\n        return predicate(response);\n    }\n    const { statusCheck, responseMatch, containsHeaders } = predicate;\n    if ((statusCheck && !(await statusCheck(response.status))) ||\n        (responseMatch && !(await responseMatch(response)))) {\n        return false;\n    }\n    if (containsHeaders) {\n        for (const header in containsHeaders) {\n            const predicate = containsHeaders[header];\n            if (predicate &&\n                !(await predicate(\n                // Axios uses lowercase headers, but if for some reason it doesn't, we should\n                // still be able to match.\n                (_a = response.headers[header.toLowerCase()]) !== null && _a !== void 0 ? _a : response.headers[header]))) {\n                return false;\n            }\n        }\n    }\n    return true;\n}\n","/** Function to update all caches, from CacheProperties.update, with the new data. */\nexport async function updateCache(storage, data, entries) {\n    for (const cacheKey in entries) {\n        // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n        const value = entries[cacheKey];\n        if (value === 'delete') {\n            await storage.remove(cacheKey);\n            continue;\n        }\n        const oldValue = await storage.get(cacheKey);\n        if (oldValue.state === 'loading') {\n            continue;\n        }\n        const newValue = await value(oldValue, data);\n        if (newValue === 'delete') {\n            await storage.remove(cacheKey);\n            continue;\n        }\n        if (newValue === 'ignore') {\n            continue;\n        }\n        await storage.set(cacheKey, newValue);\n    }\n}\n","import { Header } from '../header/headers';\nimport { testCachePredicate } from '../util/cache-predicate';\nimport { updateCache } from '../util/update-cache';\nimport { createCacheResponse } from './util';\nexport function defaultResponseInterceptor(axios) {\n    /**\n     * Rejects cache for an response response.\n     *\n     * Also update the waiting list for this key by rejecting it.\n     */\n    const rejectResponse = async (responseId) => {\n        var _a;\n        // Update the cache to empty to prevent infinite loading state\n        await axios.storage.remove(responseId);\n        // Reject the deferred if present\n        (_a = axios.waiting[responseId]) === null || _a === void 0 ? void 0 : _a.reject(null);\n        delete axios.waiting[responseId];\n    };\n    const onFulfilled = async (response) => {\n        var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;\n        var _l;\n        response.id = (_a = (_l = response.config).id) !== null && _a !== void 0 ? _a : (_l.id = axios.generateKey(response.config));\n        (_b = response.cached) !== null && _b !== void 0 ? _b : (response.cached = false);\n        // Response is already cached\n        if (response.cached) {\n            if (__ACI_DEV__) {\n                (_c = axios.debug) === null || _c === void 0 ? void 0 : _c.call(axios, {\n                    id: response.id,\n                    msg: 'Returned cached response'\n                });\n            }\n            return response;\n        }\n        // Skip cache: either false or weird behavior\n        // config.cache should always exists, at least from global config merge.\n        if (!response.config.cache) {\n            if (__ACI_DEV__) {\n                (_d = axios.debug) === null || _d === void 0 ? void 0 : _d.call(axios, {\n                    id: response.id,\n                    msg: 'Response with config.cache === false',\n                    data: response\n                });\n            }\n            return Object.assign(Object.assign({}, response), { cached: false });\n        }\n        // Request interceptor merges defaults with per request configuration\n        const cacheConfig = response.config.cache;\n        const cache = await axios.storage.get(response.id);\n        if (\n        // If the request interceptor had a problem\n        cache.state === 'stale' ||\n            cache.state === 'empty' ||\n            // Should not hit here because of previous response.cached check\n            cache.state === 'cached') {\n            if (__ACI_DEV__) {\n                (_e = axios.debug) === null || _e === void 0 ? void 0 : _e.call(axios, {\n                    id: response.id,\n                    msg: 'Response not cached but storage is not loading',\n                    data: { cache, response }\n                });\n            }\n            return response;\n        }\n        // Config told that this response should be cached.\n        if (\n        // For 'loading' values (post stale), this check was already run in the past.\n        !cache.data &&\n            !(await testCachePredicate(response, cacheConfig.cachePredicate))) {\n            await rejectResponse(response.id);\n            if (__ACI_DEV__) {\n                (_f = axios.debug) === null || _f === void 0 ? void 0 : _f.call(axios, {\n                    id: response.id,\n                    msg: 'Cache predicate rejected this response'\n                });\n            }\n            return response;\n        }\n        // avoid remnant headers from remote server to break implementation\n        for (const header in Header) {\n            if (!header.startsWith('XAxiosCache')) {\n                continue;\n            }\n            delete response.headers[header];\n        }\n        if (cacheConfig.etag && cacheConfig.etag !== true) {\n            response.headers[Header.XAxiosCacheEtag] = cacheConfig.etag;\n        }\n        if (cacheConfig.modifiedSince) {\n            response.headers[Header.XAxiosCacheLastModified] =\n                cacheConfig.modifiedSince === true\n                    ? 'use-cache-timestamp'\n                    : cacheConfig.modifiedSince.toUTCString();\n        }\n        let ttl = cacheConfig.ttl || -1; // always set from global config\n        if (cacheConfig === null || cacheConfig === void 0 ? void 0 : cacheConfig.interpretHeader) {\n            const expirationTime = axios.headerInterpreter(response.headers);\n            // Cache should not be used\n            if (expirationTime === 'dont cache') {\n                await rejectResponse(response.id);\n                if (__ACI_DEV__) {\n                    (_g = axios.debug) === null || _g === void 0 ? void 0 : _g.call(axios, {\n                        id: response.id,\n                        msg: `Cache header interpreted as 'dont cache'`,\n                        data: {\n                            cache,\n                            response,\n                            expirationTime\n                        }\n                    });\n                }\n                return response;\n            }\n            ttl = expirationTime === 'not enough headers' ? ttl : expirationTime;\n        }\n        const data = createCacheResponse(response, cache.data);\n        if (typeof ttl === 'function') {\n            ttl = await ttl(response);\n        }\n        if (cacheConfig.staleIfError) {\n            response.headers[Header.XAxiosCacheStaleIfError] = String(ttl);\n        }\n        if (__ACI_DEV__) {\n            (_h = axios.debug) === null || _h === void 0 ? void 0 : _h.call(axios, {\n                id: response.id,\n                msg: 'Useful response configuration found',\n                data: { cacheConfig, ttl, cacheResponse: data }\n            });\n        }\n        // Update other entries before updating himself\n        if (cacheConfig === null || cacheConfig === void 0 ? void 0 : cacheConfig.update) {\n            await updateCache(axios.storage, response, cacheConfig.update);\n        }\n        const newCache = {\n            state: 'cached',\n            ttl,\n            createdAt: Date.now(),\n            data\n        };\n        // Resolve all other requests waiting for this response\n        const waiting = axios.waiting[response.id];\n        if (waiting) {\n            // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n            waiting.resolve(newCache.data);\n            delete axios.waiting[response.id];\n            if (__ACI_DEV__) {\n                (_j = axios.debug) === null || _j === void 0 ? void 0 : _j.call(axios, {\n                    id: response.id,\n                    msg: 'Found waiting deferred(s) and resolved them'\n                });\n            }\n        }\n        // Define this key as cache on the storage\n        await axios.storage.set(response.id, newCache);\n        if (__ACI_DEV__) {\n            (_k = axios.debug) === null || _k === void 0 ? void 0 : _k.call(axios, {\n                id: response.id,\n                msg: 'Response cached',\n                data: { cache: newCache, response }\n            });\n        }\n        // Return the response with cached as false, because it was not cached at all\n        return response;\n    };\n    const onRejected = async (error) => {\n        var _a, _b, _c, _d, _e, _f;\n        const config = error['config'];\n        if (!config || config.cache === false || !config.id) {\n            if (__ACI_DEV__) {\n                (_a = axios.debug) === null || _a === void 0 ? void 0 : _a.call(axios, {\n                    msg: 'Web request returned an error but cache handling is not enabled',\n                    data: { error, config }\n                });\n            }\n            throw error;\n        }\n        const cache = await axios.storage.get(config.id);\n        const cacheConfig = config.cache;\n        if (\n        // This will only not be loading if the interceptor broke\n        cache.state !== 'loading' ||\n            cache.previous !== 'stale') {\n            await rejectResponse(config.id);\n            if (__ACI_DEV__) {\n                (_b = axios.debug) === null || _b === void 0 ? void 0 : _b.call(axios, {\n                    msg: 'Caught an error in the request interceptor',\n                    data: { error, config }\n                });\n            }\n            throw error;\n        }\n        if (cacheConfig === null || cacheConfig === void 0 ? void 0 : cacheConfig.staleIfError) {\n            const staleIfError = typeof cacheConfig.staleIfError === 'function'\n                ? await cacheConfig.staleIfError(error.response, cache, error)\n                : cacheConfig.staleIfError;\n            if (__ACI_DEV__) {\n                (_c = axios.debug) === null || _c === void 0 ? void 0 : _c.call(axios, {\n                    msg: 'Found cache if stale config for rejected response',\n                    data: { error, config, staleIfError }\n                });\n            }\n            if (staleIfError === true ||\n                // staleIfError is the number of seconds that stale is allowed to be used\n                (typeof staleIfError === 'number' && cache.createdAt + staleIfError > Date.now())) {\n                // Resolve all other requests waiting for this response\n                (_d = axios.waiting[config.id]) === null || _d === void 0 ? void 0 : _d.resolve(cache.data);\n                delete axios.waiting[config.id];\n                // re-mark the cache as stale\n                await axios.storage.set(config.id, {\n                    state: 'stale',\n                    createdAt: Date.now(),\n                    data: cache.data\n                });\n                if (__ACI_DEV__) {\n                    (_e = axios.debug) === null || _e === void 0 ? void 0 : _e.call(axios, {\n                        msg: 'staleIfError resolved this response with cached data',\n                        data: { error, config, cache }\n                    });\n                }\n                return {\n                    cached: true,\n                    config,\n                    id: config.id,\n                    data: cache.data.data,\n                    headers: cache.data.headers,\n                    status: cache.data.status,\n                    statusText: cache.data.statusText\n                };\n            }\n        }\n        if (__ACI_DEV__) {\n            (_f = axios.debug) === null || _f === void 0 ? void 0 : _f.call(axios, {\n                msg: 'Received an unknown error that could not be handled',\n                data: { error, config }\n            });\n        }\n        throw error;\n    };\n    return {\n        onFulfilled,\n        onRejected,\n        apply: () => axios.interceptors.response.use(onFulfilled, onRejected)\n    };\n}\n","import { Header } from '../header/headers';\nconst storage = Symbol();\n/** Returns true if the provided object was created from {@link buildStorage} function. */\nexport const isStorage = (obj) => !!obj && !!obj[storage];\n/**\n * Builds a custom storage.\n *\n * **Note**: You can only create an custom storage with this function.\n *\n * @example\n *\n * ```js\n * const myStorage = buildStorage({\n *   find: () => {...},\n *   set: () => {...},\n *   remove: () => {...}\n * });\n *\n * const axios = setupCache(axios, { storage: myStorage });\n * ```\n */\nexport function buildStorage({ set, find, remove }) {\n    return {\n        //@ts-expect-error - we don't want to expose this\n        [storage]: 1,\n        set,\n        remove,\n        get: async (key) => {\n            const value = await find(key);\n            if (!value) {\n                return { state: 'empty' };\n            }\n            if (\n            // Not cached or fresh value\n            value.state !== 'cached' ||\n                value.createdAt + value.ttl > Date.now()) {\n                return value;\n            }\n            if (value.data.headers &&\n                // Any header below allows the response to stale\n                (Header.ETag in value.data.headers ||\n                    Header.LastModified in value.data.headers ||\n                    Header.XAxiosCacheEtag in value.data.headers ||\n                    Header.XAxiosCacheStaleIfError in value.data.headers ||\n                    Header.XAxiosCacheLastModified in value.data.headers)) {\n                const stale = {\n                    state: 'stale',\n                    createdAt: value.createdAt,\n                    data: value.data\n                };\n                await set(key, stale);\n                return stale;\n            }\n            await remove(key);\n            return { state: 'empty' };\n        }\n    };\n}\n","import { buildStorage } from './build';\n/**\n * Creates a simple in-memory storage. This means that if you need to persist data between\n * page or server reloads, this will not help.\n *\n * This is the storage used by default.\n *\n * If you need to modify it's data, you can do by the `data` property.\n *\n * @example\n *\n * ```js\n * const memoryStorage = buildMemoryStorage();\n *\n * setupCache(axios, { storage: memoryStorage });\n *\n * // Simple example to force delete the request cache\n *\n * const { id } = axios.get('url');\n *\n * delete memoryStorage.data[id];\n * ```\n */\nexport function buildMemoryStorage() {\n    const storage = buildStorage({\n        find: (key) => storage.data[key],\n        set: (key, value) => {\n            storage.data[key] = value;\n        },\n        remove: (key) => {\n            delete storage.data[key];\n        }\n    });\n    storage.data = Object.create(null);\n    return storage;\n}\n","import { code } from 'object-code';\n// Remove first and last '/' char, if present\nconst SLASHES_REGEX = /^\\/|\\/$/g;\nexport function buildKeyGenerator(hash, generator) {\n    return (request) => {\n        if (request.id) {\n            return request.id;\n        }\n        // Remove trailing slashes\n        request.baseURL && (request.baseURL = request.baseURL.replace(SLASHES_REGEX, ''));\n        request.url && (request.url = request.url.replace(SLASHES_REGEX, ''));\n        // lowercase method\n        request.method && (request.method = request.method.toLowerCase());\n        const result = generator(request);\n        return hash ? code(result).toString() : result;\n    };\n}\nexport const defaultKeyGenerator = buildKeyGenerator(true, ({ baseURL = '', url = '', method = 'get', params, data }) => {\n    return {\n        url: baseURL + (baseURL && url ? '/' : '') + url,\n        method,\n        params: params,\n        data\n    };\n});\n","import { defaultHeaderInterpreter } from '../header/interpreter';\nimport { defaultRequestInterceptor } from '../interceptors/request';\nimport { defaultResponseInterceptor } from '../interceptors/response';\nimport { isStorage } from '../storage/build';\nimport { buildMemoryStorage } from '../storage/memory';\nimport { defaultKeyGenerator } from '../util/key-generator';\n/**\n * Apply the caching interceptors for a already created axios instance.\n *\n * @example\n *\n * ```ts\n * import Axios from 'axios';\n * import { setupCache, AxiosCacheInstance } from 'axios-cache-interceptor';\n *\n * // instance will have our custom typings from the return of this function\n * const instance = setupCache(\n *   Axios.create({\n *     // Axios options\n *   }),\n *   {\n *     // Axios-cache-interceptor options\n *   }\n * );\n *\n * // OR\n *\n * const instance = axios.create({\n *   // Axios options\n * }) as AxiosCacheInstance;\n *\n * // As this functions returns the same axios instance but only with\n * // different typings, you can ignore the function return.\n * setupCache(instance, {\n *   // Axios-cache-interceptor options\n * });\n * ```\n *\n * @param axios The already created axios instance\n * @param config The config for the caching interceptors\n * @returns The same instance with extended typescript types.\n */\nexport function setupCache(axios, options = {}) {\n    var _a, _b, _c, _d, _e;\n    const axiosCache = axios;\n    axiosCache.storage = options.storage || buildMemoryStorage();\n    if (!isStorage(axiosCache.storage)) {\n        throw new Error('Use buildStorage() function');\n    }\n    axiosCache.generateKey = options.generateKey || defaultKeyGenerator;\n    axiosCache.waiting = options.waiting || {};\n    axiosCache.headerInterpreter = options.headerInterpreter || defaultHeaderInterpreter;\n    axiosCache.requestInterceptor =\n        options.requestInterceptor || defaultRequestInterceptor(axiosCache);\n    axiosCache.responseInterceptor =\n        options.responseInterceptor || defaultResponseInterceptor(axiosCache);\n    axiosCache.debug = options.debug;\n    // CacheRequestConfig values\n    axiosCache.defaults.cache = {\n        ttl: (_a = options.ttl) !== null && _a !== void 0 ? _a : 1000 * 60 * 5,\n        interpretHeader: (_b = options.interpretHeader) !== null && _b !== void 0 ? _b : false,\n        methods: options.methods || ['get'],\n        cachePredicate: options.cachePredicate || {\n            statusCheck: (status) => status >= 200 && status < 400\n        },\n        etag: (_c = options.etag) !== null && _c !== void 0 ? _c : false,\n        modifiedSince: (_d = options.modifiedSince) !== null && _d !== void 0 ? _d : false,\n        staleIfError: (_e = options.staleIfError) !== null && _e !== void 0 ? _e : false,\n        update: options.update || {}\n    };\n    // Apply interceptors\n    axiosCache.requestInterceptor.apply();\n    axiosCache.responseInterceptor.apply();\n    return axiosCache;\n}\n","import { buildStorage } from './build';\n/**\n * Creates a simple storage. You can persist his data by using `sessionStorage` or\n * `localStorage` with it.\n *\n * **ImplNote**: Without polyfill, this storage only works on browser environments.\n *\n * @example\n *\n * ```js\n * const fromLocalStorage = buildWebStorage(localStorage);\n * const fromSessionStorage = buildWebStorage(sessionStorage);\n *\n * const myStorage = new Storage();\n * const fromMyStorage = buildWebStorage(myStorage);\n * ```\n *\n * @param prefix The prefix to index the storage. Useful to prevent collision between\n *   multiple places using the same storage.\n */\nexport function buildWebStorage(storage, prefix = '') {\n    return buildStorage({\n        find: (key) => {\n            const json = storage.getItem(prefix + key);\n            return json ? JSON.parse(json) : undefined;\n        },\n        set: (key, value) => {\n            storage.setItem(prefix + key, JSON.stringify(value));\n        },\n        remove: (key) => {\n            storage.removeItem(prefix + key);\n        }\n    });\n}\n","export * from './cache/axios';\nexport * from './cache/cache';\nexport * from './cache/create';\nexport * from './header/headers';\nexport * from './header/interpreter';\nexport * from './header/types';\nexport * from './interceptors/build';\nexport * from './interceptors/request';\nexport * from './interceptors/response';\nexport * from './interceptors/util';\nexport * from './storage/build';\nexport * from './storage/memory';\nexport * from './storage/types';\nexport * from './storage/web-api';\nexport * from './util/cache-predicate';\nexport * from './util/key-generator';\nexport * from './util/types';\nexport * from './util/update-cache';\nif (__ACI_DEV__) {\n    console.error('You are using a development build. Make sure to use the correct build in production');\n    console.error('https://axios-cache-interceptor.js.org/#/pages/installing');\n}\n"],"names":["root","factory","exports","module","define","amd","self","this","e","r","Symbol","deferred","n","t","Promise","resolve","reject","isDeferred","transform","Date","getTime","RegExp","toString","o","Array","isArray","String","constructor","JSON","stringify","Object","keys","sort","Math","random","code","length","charCodeAt","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","d","definition","key","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","toStringTag","value","Number","Infinity","Header","freeze","IfModifiedSince","LastModified","IfNoneMatch","CacheControl","ETag","Expires","Age","XAxiosCacheEtag","XAxiosCacheLastModified","XAxiosCacheStaleIfError","defaultHeaderInterpreter","headers","cacheControl","noCache","noStore","mustRevalidate","maxAge","immutable","a","i","toLowerCase","replace","split","s","maxStale","minFresh","mustUnderstand","noTransform","onlyIfCached","private","proxyRevalidate","public","sMaxAge","staleIfError","staleWhileRevalidate","age","expires","milliseconds","parse","now","createValidateStatus","oldValidate","status","isMethodIn","requestMethod","methodList","method","updateStaleRequest","cache","config","_a","etag","modifiedSince","etagValue","data","createdAt","toUTCString","createCacheResponse","response","cached","statusText","assign","defaultRequestInterceptor","axios","onFulfilled","async","_b","_c","_d","_e","_f","_g","_h","_j","debug","msg","defaults","methods","id","generateKey","cachedResponse","storage","emptyOrStale","state","waiting","catch","set","previous","validateStatus","remove","err","adapter","apply","interceptors","request","use","testCachePredicate","predicate","statusCheck","responseMatch","containsHeaders","header","updateCache","entries","cacheKey","oldValue","newValue","defaultResponseInterceptor","rejectResponse","responseId","_k","_l","cacheConfig","cachePredicate","startsWith","ttl","interpretHeader","expirationTime","headerInterpreter","cacheResponse","update","newCache","onRejected","error","isStorage","buildStorage","find","stale","buildMemoryStorage","create","SLASHES_REGEX","buildKeyGenerator","hash","generator","baseURL","url","result","defaultKeyGenerator","params","setupCache","options","axiosCache","Error","requestInterceptor","responseInterceptor","buildWebStorage","prefix","json","getItem","setItem","removeItem","console"],"sourceRoot":""}