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AiBwB,EAAQxB,kBAAmB,EAC5CtC,QAAS8D,EAAQ9D,SAAW,CAAC,OAC7BmC,eAAgB2B,EAAQ3B,gBAAkB,CACtCd,YAAc9C,GAAWA,GAAU,KAAOA,EAAS,KAEvDQ,KAAM+E,EAAQ/E,OAAQ,EACtBC,cAAe8E,EAAQ9E,gBAAiB,EACxClB,aAAcgG,EAAQhG,eAAgB,EACtC4E,OAAQoB,EAAQpB,QAAU,IAG9BqB,EAAWE,mBAAmBlD,QAC9BgD,EAAWG,oBAAoBnD,QACxBgD,ECpDJ,SAASI,EAAgB/D,EAASgE,EAAS,IAC9C,OAAOrB,EAAa,CAChBC,KAAOlI,IACH,MAAMuJ,EAAOjE,EAAQkE,QAAQF,EAAStJ,GACtC,OAAOuJ,EAAOzK,KAAKuE,MAAMkG,QAAQ3J,GAErC+F,IAAK,CAAC3F,EAAKU,KACP4E,EAAQmE,QAAQH,EAAStJ,EAAKlB,KAAKC,UAAU2B,KAEjDoF,OAAS9F,IACLsF,EAAQoE,WAAWJ,EAAStJ,MCXpC2J,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    config.headers || (config.headers = {});\n    const { etag, modifiedSince } = config.cache;\n    if (etag) {\n        const etagValue = etag === true ? cache.data?.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 = {\n            ...cache.headers,\n            ...response.headers\n        };\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        if (config.cache === false) {\n            if (__ACI_DEV__) {\n                axios.debug?.({\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 = { ...axios.defaults.cache, ...config.cache };\n        if (!isMethodIn(config.method, config.cache.methods)) {\n            if (__ACI_DEV__) {\n                axios.debug?.({\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                    axios.debug?.({\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            axios.waiting[key]?.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                    axios.debug?.({\n                        id: key,\n                        msg: 'Updated stale request'\n                    });\n                }\n            }\n            config.validateStatus = createValidateStatus(config.validateStatus);\n            if (__ACI_DEV__) {\n                axios.debug?.({\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                axios.debug?.({\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                    axios.debug?.({\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            axios.debug?.({\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    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                response.headers[header.toLowerCase()] ?? 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        // Update the cache to empty to prevent infinite loading state\n        await axios.storage.remove(responseId);\n        // Reject the deferred if present\n        axios.waiting[responseId]?.reject(null);\n        delete axios.waiting[responseId];\n    };\n    const onFulfilled = async (response) => {\n        var _a;\n        response.id = (_a = response.config).id ?? (_a.id = axios.generateKey(response.config));\n        response.cached ?? (response.cached = false);\n        // Response is already cached\n        if (response.cached) {\n            if (__ACI_DEV__) {\n                axios.debug?.({\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                axios.debug?.({\n                    id: response.id,\n                    msg: 'Response with config.cache === false',\n                    data: response\n                });\n            }\n            return { ...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                axios.debug?.({\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                axios.debug?.({\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?.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                    axios.debug?.({\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            axios.debug?.({\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?.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                axios.debug?.({\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            axios.debug?.({\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        const config = error['config'];\n        if (!config || config.cache === false || !config.id) {\n            if (__ACI_DEV__) {\n                axios.debug?.({\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                axios.debug?.({\n                    msg: 'Caught an error in the request interceptor',\n                    data: { error, config }\n                });\n            }\n            throw error;\n        }\n        if (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                axios.debug?.({\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                axios.waiting[config.id]?.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                    axios.debug?.({\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            axios.debug?.({\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    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: options.ttl ?? 1000 * 60 * 5,\n        interpretHeader: options.interpretHeader ?? false,\n        methods: options.methods || ['get'],\n        cachePredicate: options.cachePredicate || {\n            statusCheck: (status) => status >= 200 && status < 400\n        },\n        etag: options.etag ?? false,\n        modifiedSince: options.modifiedSince ?? false,\n        staleIfError: options.staleIfError ?? 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","etag","modifiedSince","etagValue","data","createdAt","toUTCString","createCacheResponse","response","cached","statusText","defaultRequestInterceptor","axios","onFulfilled","async","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","_a","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":""}