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AK,WAAc,OAAO,qBAAqB,eAAiB,IAEpE,OAAO,eAAe,QAAS,sBAAuB,CAClD,YAAY,EACZ,IAAK,WAAc,OAAO,qBAAqB,mBAAqB,IAExE,QAAQ,QAAU,QAClB,QAAQ,OAAS,OACjB,QAAQ,MAAQ,QAChB,QAAQ,kBAAoB,kBAC5B,QAAQ,uBAAyB,uBACjC,QAAQ,MAAQ,MAChB,QAAQ,OAAS","file":"/npm/@inrupt/solid-client-authn-browser@3.1.1/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@inrupt/solid-client-authn-browser@3.1.1/dist/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict';\n\nvar solidClientAuthnCore = require('@inrupt/solid-client-authn-core');\nvar uuid = require('uuid');\nvar EventEmitter = require('events');\nvar oidcClientExt = require('@inrupt/oidc-client-ext');\n\n//\n// Copyright Inrupt Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal in\n// the Software without restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the\n// Software, and to permit persons to whom the Software is furnished to do so,\n// subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n/**\n * This class in a no-value-added extension of StorageUtility from the core module.\n * The reason it has to be declared is for TSyringe to find the decorators in the\n * same modules as where the dependency container is declared (in this case,\n * the browser module, with the dependancy container in dependencies.ts).\n * @hidden\n */\nclass StorageUtilityBrowser extends solidClientAuthnCore.StorageUtility {\n    constructor(secureStorage, insecureStorage) {\n        super(secureStorage, insecureStorage);\n    }\n}\n\n//\n// Copyright Inrupt Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal in\n// the Software without restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the\n// Software, and to permit persons to whom the Software is furnished to do so,\n// subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n/**\n * @hidden\n */\nclass ClientAuthentication extends solidClientAuthnCore.ClientAuthentication {\n    // Define these functions as properties so that they don't get accidentally re-bound.\n    // Isn't Javascript fun?\n    login = async (options, eventEmitter) => {\n        // In order to get a clean start, make sure that the session is logged out\n        // on login, except when doing a silent login so that Dynamic Client information\n        // is preserved.\n        if (options.prompt !== \"none\") {\n            await this.sessionInfoManager.clear(options.sessionId);\n        }\n        // In the case of the user hitting the 'back' button in their browser, they\n        // could return to a previous redirect URL that contains OIDC params that\n        // are now longer valid. To be safe, strip relevant params now.\n        // If the user is providing a redirect IRI, it should not be modified, so\n        // normalization only applies if we default to the current location (which is\n        // a bad practice and should be discouraged).\n        const redirectUrl = options.redirectUrl ?? oidcClientExt.normalizeCallbackUrl(window.location.href);\n        if (!solidClientAuthnCore.isValidRedirectUrl(redirectUrl)) {\n            throw new Error(`${redirectUrl} is not a valid redirect URL, it is either a malformed IRI, includes a hash fragment, or reserved query parameters ('code' or 'state').`);\n        }\n        await this.loginHandler.handle({\n            ...options,\n            redirectUrl,\n            // If no clientName is provided, the clientId may be used instead.\n            clientName: options.clientName ?? options.clientId,\n            eventEmitter,\n        });\n    };\n    // Collects session information from storage, and returns them. Returns null\n    // if the expected information cannot be found.\n    // Note that the ID token is not stored, which means the session information\n    // cannot be validated at this point.\n    validateCurrentSession = async (currentSessionId) => {\n        const sessionInfo = await this.sessionInfoManager.get(currentSessionId);\n        if (sessionInfo === undefined ||\n            sessionInfo.clientAppId === undefined ||\n            sessionInfo.issuer === undefined) {\n            return null;\n        }\n        return sessionInfo;\n    };\n    handleIncomingRedirect = async (url, eventEmitter) => {\n        try {\n            const redirectInfo = await this.redirectHandler.handle(url, eventEmitter, undefined);\n            // The `FallbackRedirectHandler` directly returns the global `fetch` for\n            // his value, so we should ensure it's bound to `window` rather than to\n            // ClientAuthentication, to avoid the following error:\n            // > 'fetch' called on an object that does not implement interface Window.\n            this.fetch = redirectInfo.fetch.bind(window);\n            this.boundLogout = redirectInfo.getLogoutUrl;\n            // Strip the oauth params:\n            await this.cleanUrlAfterRedirect(url);\n            return {\n                isLoggedIn: redirectInfo.isLoggedIn,\n                webId: redirectInfo.webId,\n                sessionId: redirectInfo.sessionId,\n                expirationDate: redirectInfo.expirationDate,\n                clientAppId: redirectInfo.clientAppId,\n            };\n        }\n        catch (err) {\n            // Strip the oauth params:\n            await this.cleanUrlAfterRedirect(url);\n            // FIXME: EVENTS.ERROR should be errorCode, errorDescription\n            //\n            // I'm not sure if \"redirect\" is a good error code, and in theory `err`\n            // maybe an Error object and not a string; Maybe we want to just hardcode\n            // a description instead?\n            eventEmitter.emit(solidClientAuthnCore.EVENTS.ERROR, \"redirect\", err);\n            return undefined;\n        }\n    };\n    async cleanUrlAfterRedirect(url) {\n        const cleanedUpUrl = solidClientAuthnCore.removeOpenIdParams(url).href;\n        // Remove OAuth-specific query params (since the login flow finishes with\n        // the browser being redirected back with OAuth2 query params (e.g. for\n        // 'code' and 'state'), and so if the user simply refreshes this page our\n        // authentication library will be called again with what are now invalid\n        // query parameters!).\n        window.history.replaceState(null, \"\", cleanedUpUrl);\n        while (window.location.href !== cleanedUpUrl) {\n            // Poll the current URL every ms. Active polling is required because\n            // window.history.replaceState is asynchronous, but the associated\n            // 'popstate' event which should be listened to is only sent on active\n            // navigation, which we will not have here.\n            // See https://developer.mozilla.org/en-US/docs/Web/API/Window/popstate_event#when_popstate_is_sent\n            // eslint-disable-next-line no-await-in-loop\n            await new Promise((resolve) => {\n                setTimeout(() => resolve(), 1);\n            });\n        }\n    }\n}\n\n//\n// Copyright Inrupt Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal in\n// the Software without restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the\n// Software, and to permit persons to whom the Software is furnished to do so,\n// subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\nfunction hasIssuer(options) {\n    return typeof options.oidcIssuer === \"string\";\n}\nfunction hasRedirectUrl(options) {\n    return typeof options.redirectUrl === \"string\";\n}\n/**\n * @hidden\n */\nclass OidcLoginHandler {\n    storageUtility;\n    oidcHandler;\n    issuerConfigFetcher;\n    clientRegistrar;\n    constructor(storageUtility, oidcHandler, issuerConfigFetcher, clientRegistrar) {\n        this.storageUtility = storageUtility;\n        this.oidcHandler = oidcHandler;\n        this.issuerConfigFetcher = issuerConfigFetcher;\n        this.clientRegistrar = clientRegistrar;\n        this.storageUtility = storageUtility;\n        this.oidcHandler = oidcHandler;\n        this.issuerConfigFetcher = issuerConfigFetcher;\n        this.clientRegistrar = clientRegistrar;\n    }\n    async canHandle(options) {\n        return hasIssuer(options) && hasRedirectUrl(options);\n    }\n    async handle(options) {\n        if (!hasIssuer(options)) {\n            throw new solidClientAuthnCore.ConfigurationError(`OidcLoginHandler requires an OIDC issuer: missing property 'oidcIssuer' in ${JSON.stringify(options)}`);\n        }\n        if (!hasRedirectUrl(options)) {\n            throw new solidClientAuthnCore.ConfigurationError(`OidcLoginHandler requires a redirect URL: missing property 'redirectUrl' in ${JSON.stringify(options)}`);\n        }\n        // Fetch issuer config.\n        const issuerConfig = await this.issuerConfigFetcher.fetchConfig(options.oidcIssuer);\n        const clientRegistration = await solidClientAuthnCore.handleRegistration(options, issuerConfig, this.storageUtility, this.clientRegistrar);\n        // Construct OIDC Options\n        const OidcOptions = {\n            // Note that here, the issuer is not the one from the received options, but\n            // from the issuer's config. This enforces the canonical URL is used and stored,\n            // which is also the one present in the ID token, so storing a technically\n            // valid, but different issuer URL (e.g. using a trailing slash or not) now\n            // could prevent from validating the ID token later.\n            issuer: issuerConfig.issuer,\n            // TODO: differentiate if DPoP should be true\n            dpop: options.tokenType.toLowerCase() === \"dpop\",\n            ...options,\n            issuerConfiguration: issuerConfig,\n            client: clientRegistration,\n            scopes: solidClientAuthnCore.normalizeScopes(options.customScopes),\n        };\n        // Call proper OIDC Handler\n        return this.oidcHandler.handle(OidcOptions);\n    }\n}\n\n//\n// Copyright Inrupt Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal in\n// the Software without restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the\n// Software, and to permit persons to whom the Software is furnished to do so,\n// subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n/**\n * @hidden\n * Authorization code flow spec: https://openid.net/specs/openid-connect-core-1_0.html#CodeFlowAuth\n * PKCE: https://tools.ietf.org/html/rfc7636\n */\nclass AuthorizationCodeWithPkceOidcHandler extends solidClientAuthnCore.AuthorizationCodeWithPkceOidcHandlerBase {\n    async handle(oidcLoginOptions) {\n        /* eslint-disable camelcase */\n        const oidcOptions = {\n            authority: oidcLoginOptions.issuer.toString(),\n            client_id: oidcLoginOptions.client.clientId,\n            client_secret: oidcLoginOptions.client.clientSecret,\n            redirect_uri: oidcLoginOptions.redirectUrl,\n            response_type: \"code\",\n            scope: oidcLoginOptions.scopes.join(\" \"),\n            filterProtocolClaims: true,\n            // The userinfo endpoint on NSS fails, so disable this for now\n            // Note that in Solid, information should be retrieved from the\n            // profile referenced by the WebId.\n            loadUserInfo: false,\n            code_verifier: true,\n            prompt: oidcLoginOptions.prompt ?? \"consent\",\n        };\n        /* eslint-enable camelcase */\n        const oidcClientLibrary = new oidcClientExt.OidcClient(oidcOptions);\n        try {\n            const signingRequest = await oidcClientLibrary.createSigninRequest();\n            // Make sure to await the promise before returning so that the error is caught.\n            return await this.setupRedirectHandler({\n                oidcLoginOptions,\n                // eslint-disable-next-line no-underscore-dangle\n                state: signingRequest.state._id,\n                // eslint-disable-next-line no-underscore-dangle\n                codeVerifier: signingRequest.state._code_verifier,\n                targetUrl: signingRequest.url.toString(),\n            });\n        }\n        catch (err) {\n            // eslint-disable-next-line no-console\n            console.error(err);\n        }\n        // The login is only completed AFTER redirect, so nothing to return here.\n        return undefined;\n    }\n}\n\n//\n// Copyright Inrupt Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal in\n// the Software without restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the\n// Software, and to permit persons to whom the Software is furnished to do so,\n// subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\nconst WELL_KNOWN_OPENID_CONFIG = \".well-known/openid-configuration\";\n/* eslint-disable camelcase */\nconst issuerConfigKeyMap = {\n    issuer: {\n        toKey: \"issuer\",\n        convertToUrl: true,\n    },\n    authorization_endpoint: {\n        toKey: \"authorizationEndpoint\",\n        convertToUrl: true,\n    },\n    token_endpoint: {\n        toKey: \"tokenEndpoint\",\n        convertToUrl: true,\n    },\n    userinfo_endpoint: {\n        toKey: \"userinfoEndpoint\",\n        convertToUrl: true,\n    },\n    jwks_uri: {\n        toKey: \"jwksUri\",\n        convertToUrl: true,\n    },\n    registration_endpoint: {\n        toKey: \"registrationEndpoint\",\n        convertToUrl: true,\n    },\n    end_session_endpoint: {\n        toKey: \"endSessionEndpoint\",\n        convertToUrl: true,\n    },\n    scopes_supported: { toKey: \"scopesSupported\" },\n    response_types_supported: { toKey: \"responseTypesSupported\" },\n    response_modes_supported: { toKey: \"responseModesSupported\" },\n    grant_types_supported: { toKey: \"grantTypesSupported\" },\n    acr_values_supported: { toKey: \"acrValuesSupported\" },\n    subject_types_supported: { toKey: \"subjectTypesSupported\" },\n    id_token_signing_alg_values_supported: {\n        toKey: \"idTokenSigningAlgValuesSupported\",\n    },\n    id_token_encryption_alg_values_supported: {\n        toKey: \"idTokenEncryptionAlgValuesSupported\",\n    },\n    id_token_encryption_enc_values_supported: {\n        toKey: \"idTokenEncryptionEncValuesSupported\",\n    },\n    userinfo_signing_alg_values_supported: {\n        toKey: \"userinfoSigningAlgValuesSupported\",\n    },\n    userinfo_encryption_alg_values_supported: {\n        toKey: \"userinfoEncryptionAlgValuesSupported\",\n    },\n    userinfo_encryption_enc_values_supported: {\n        toKey: \"userinfoEncryptionEncValuesSupported\",\n    },\n    request_object_signing_alg_values_supported: {\n        toKey: \"requestObjectSigningAlgValuesSupported\",\n    },\n    request_object_encryption_alg_values_supported: {\n        toKey: \"requestObjectEncryptionAlgValuesSupported\",\n    },\n    request_object_encryption_enc_values_supported: {\n        toKey: \"requestObjectEncryptionEncValuesSupported\",\n    },\n    token_endpoint_auth_methods_supported: {\n        toKey: \"tokenEndpointAuthMethodsSupported\",\n    },\n    token_endpoint_auth_signing_alg_values_supported: {\n        toKey: \"tokenEndpointAuthSigningAlgValuesSupported\",\n    },\n    display_values_supported: { toKey: \"displayValuesSupported\" },\n    claim_types_supported: { toKey: \"claimTypesSupported\" },\n    claims_supported: { toKey: \"claimsSupported\" },\n    service_documentation: { toKey: \"serviceDocumentation\" },\n    claims_locales_supported: { toKey: \"claimsLocalesSupported\" },\n    ui_locales_supported: { toKey: \"uiLocalesSupported\" },\n    claims_parameter_supported: { toKey: \"claimsParameterSupported\" },\n    request_parameter_supported: { toKey: \"requestParameterSupported\" },\n    request_uri_parameter_supported: { toKey: \"requestUriParameterSupported\" },\n    require_request_uri_registration: { toKey: \"requireRequestUriRegistration\" },\n    op_policy_uri: {\n        toKey: \"opPolicyUri\",\n        convertToUrl: true,\n    },\n    op_tos_uri: {\n        toKey: \"opTosUri\",\n        convertToUrl: true,\n    },\n};\n/* eslint-enable camelcase */\nfunction processConfig(config) {\n    const parsedConfig = {};\n    Object.keys(config).forEach((key) => {\n        if (issuerConfigKeyMap[key]) {\n            // TODO: PMcB55: Validate URL if \"issuerConfigKeyMap[key].convertToUrl\"\n            //  if (issuerConfigKeyMap[key].convertToUrl) {\n            //   validateUrl(config[key]);\n            //  }\n            parsedConfig[issuerConfigKeyMap[key].toKey] = config[key];\n        }\n    });\n    if (!Array.isArray(parsedConfig.scopesSupported)) {\n        parsedConfig.scopesSupported = [\"openid\"];\n    }\n    return parsedConfig;\n}\n/**\n * @hidden\n */\nclass IssuerConfigFetcher {\n    storageUtility;\n    constructor(storageUtility) {\n        this.storageUtility = storageUtility;\n        this.storageUtility = storageUtility;\n    }\n    // This method needs no state (so can be static), and can be exposed to allow\n    // callers to know where this implementation puts state it needs.\n    static getLocalStorageKey(issuer) {\n        return `issuerConfig:${issuer}`;\n    }\n    async fetchConfig(issuer) {\n        let issuerConfig;\n        const openIdConfigUrl = new URL(WELL_KNOWN_OPENID_CONFIG, \n        // Make sure to append a slash at issuer URL, so that the .well-known URL\n        // includes the full issuer path. See https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfig.\n        issuer.endsWith(\"/\") ? issuer : `${issuer}/`).href;\n        const issuerConfigRequestBody = await fetch(openIdConfigUrl);\n        // Check the validity of the fetched config\n        try {\n            issuerConfig = processConfig(await issuerConfigRequestBody.json());\n        }\n        catch (err) {\n            throw new solidClientAuthnCore.ConfigurationError(`[${issuer.toString()}] has an invalid configuration: ${err.message}`);\n        }\n        // Update store with fetched config\n        await this.storageUtility.set(IssuerConfigFetcher.getLocalStorageKey(issuer), JSON.stringify(issuerConfig));\n        return issuerConfig;\n    }\n}\n\n//\n// Copyright Inrupt Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal in\n// the Software without restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the\n// Software, and to permit persons to whom the Software is furnished to do so,\n// subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n/**\n * @param sessionId\n * @param storage\n * @hidden\n */\nasync function clear(sessionId, storage) {\n    await solidClientAuthnCore.clear(sessionId, storage);\n    await oidcClientExt.clearOidcPersistentStorage();\n}\n/**\n * @hidden\n */\nclass SessionInfoManager extends solidClientAuthnCore.SessionInfoManagerBase {\n    async get(sessionId) {\n        const [isLoggedIn, webId, clientId, clientSecret, redirectUrl, refreshToken, issuer, tokenType,] = await Promise.all([\n            this.storageUtility.getForUser(sessionId, \"isLoggedIn\", {\n                secure: true,\n            }),\n            this.storageUtility.getForUser(sessionId, \"webId\", {\n                secure: true,\n            }),\n            this.storageUtility.getForUser(sessionId, \"clientId\", {\n                secure: false,\n            }),\n            this.storageUtility.getForUser(sessionId, \"clientSecret\", {\n                secure: false,\n            }),\n            this.storageUtility.getForUser(sessionId, \"redirectUrl\", {\n                secure: false,\n            }),\n            this.storageUtility.getForUser(sessionId, \"refreshToken\", {\n                secure: true,\n            }),\n            this.storageUtility.getForUser(sessionId, \"issuer\", {\n                secure: false,\n            }),\n            this.storageUtility.getForUser(sessionId, \"tokenType\", {\n                secure: false,\n            }),\n        ]);\n        if (typeof redirectUrl === \"string\" && !solidClientAuthnCore.isValidRedirectUrl(redirectUrl)) {\n            // This resolves the issue for people experiencing https://github.com/inrupt/solid-client-authn-js/issues/2891.\n            // An invalid redirect URL is present in the storage, and the session should\n            // be cleared to get a fresh start. This will require the user to log back in.\n            await Promise.all([\n                this.storageUtility.deleteAllUserData(sessionId, { secure: false }),\n                this.storageUtility.deleteAllUserData(sessionId, { secure: true }),\n            ]);\n            return undefined;\n        }\n        if (tokenType !== undefined && !solidClientAuthnCore.isSupportedTokenType(tokenType)) {\n            throw new Error(`Tokens of type [${tokenType}] are not supported.`);\n        }\n        if (clientId === undefined &&\n            isLoggedIn === undefined &&\n            webId === undefined &&\n            refreshToken === undefined) {\n            return undefined;\n        }\n        return {\n            sessionId,\n            webId,\n            isLoggedIn: isLoggedIn === \"true\",\n            redirectUrl,\n            refreshToken,\n            issuer,\n            clientAppId: clientId,\n            clientAppSecret: clientSecret,\n            // Default the token type to DPoP if unspecified.\n            tokenType: tokenType ?? \"DPoP\",\n        };\n    }\n    /**\n     * This function removes all session-related information from storage.\n     * @param sessionId the session identifier\n     * @param storage the storage where session info is stored\n     * @hidden\n     */\n    async clear(sessionId) {\n        return clear(sessionId, this.storageUtility);\n    }\n}\n\n//\n// Copyright Inrupt Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal in\n// the Software without restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the\n// Software, and to permit persons to whom the Software is furnished to do so,\n// subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n/**\n * This class handles redirect IRIs without any query params, and returns an unauthenticated\n * session. It serves as a fallback so that consuming libraries don't have to test\n * for the query params themselves, and can always try to use them as a redirect IRI.\n * @hidden\n */\nclass FallbackRedirectHandler {\n    async canHandle(redirectUrl) {\n        try {\n            // The next URL object is built for validating it.\n            // eslint-disable-next-line no-new\n            new URL(redirectUrl);\n            return true;\n        }\n        catch (e) {\n            throw new Error(`[${redirectUrl}] is not a valid URL, and cannot be used as a redirect URL: ${e}`);\n        }\n    }\n    async handle(\n    // The argument is ignored, but must be present to implement the interface\n    _redirectUrl) {\n        return solidClientAuthnCore.getUnauthenticatedSession();\n    }\n}\n\n//\n// Copyright Inrupt Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal in\n// the Software without restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the\n// Software, and to permit persons to whom the Software is furnished to do so,\n// subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n/**\n * @hidden\n */\nclass AuthCodeRedirectHandler {\n    storageUtility;\n    sessionInfoManager;\n    issuerConfigFetcher;\n    clientRegistrar;\n    tokerRefresher;\n    constructor(storageUtility, sessionInfoManager, issuerConfigFetcher, clientRegistrar, tokerRefresher) {\n        this.storageUtility = storageUtility;\n        this.sessionInfoManager = sessionInfoManager;\n        this.issuerConfigFetcher = issuerConfigFetcher;\n        this.clientRegistrar = clientRegistrar;\n        this.tokerRefresher = tokerRefresher;\n        this.storageUtility = storageUtility;\n        this.sessionInfoManager = sessionInfoManager;\n        this.issuerConfigFetcher = issuerConfigFetcher;\n        this.clientRegistrar = clientRegistrar;\n        this.tokerRefresher = tokerRefresher;\n    }\n    async canHandle(redirectUrl) {\n        try {\n            const myUrl = new URL(redirectUrl);\n            return (myUrl.searchParams.get(\"code\") !== null &&\n                myUrl.searchParams.get(\"state\") !== null);\n        }\n        catch (e) {\n            throw new Error(`[${redirectUrl}] is not a valid URL, and cannot be used as a redirect URL: ${e}`);\n        }\n    }\n    async handle(redirectUrl, eventEmitter) {\n        if (!(await this.canHandle(redirectUrl))) {\n            throw new Error(`AuthCodeRedirectHandler cannot handle [${redirectUrl}]: it is missing one of [code, state].`);\n        }\n        const url = new URL(redirectUrl);\n        const oauthState = url.searchParams.get(\"state\");\n        const storedSessionId = (await this.storageUtility.getForUser(oauthState, \"sessionId\", {\n            errorIfNull: true,\n        }));\n        const { issuerConfig, codeVerifier, redirectUrl: storedRedirectIri, dpop: isDpop, } = await solidClientAuthnCore.loadOidcContextFromStorage(storedSessionId, this.storageUtility, this.issuerConfigFetcher);\n        const iss = url.searchParams.get(\"iss\");\n        if (typeof iss === \"string\" && iss !== issuerConfig.issuer) {\n            throw new Error(`The value of the iss parameter (${iss}) does not match the issuer identifier of the authorization server (${issuerConfig.issuer}). See [rfc9207](https://www.rfc-editor.org/rfc/rfc9207.html#section-2.3-3.1.1)`);\n        }\n        if (codeVerifier === undefined) {\n            throw new Error(`The code verifier for session ${storedSessionId} is missing from storage.`);\n        }\n        if (storedRedirectIri === undefined) {\n            throw new Error(`The redirect URL for session ${storedSessionId} is missing from storage.`);\n        }\n        const client = await this.clientRegistrar.getClient({ sessionId: storedSessionId }, issuerConfig);\n        const tokenCreatedAt = Date.now();\n        const tokens = await oidcClientExt.getTokens(issuerConfig, client, {\n            grantType: \"authorization_code\",\n            // We rely on our 'canHandle' function checking that the OAuth 'code'\n            // parameter is present in our query string.\n            code: url.searchParams.get(\"code\"),\n            codeVerifier,\n            redirectUrl: storedRedirectIri,\n        }, isDpop);\n        // Delete oidc-client-specific session information from storage. oidc-client\n        // is no longer used for the token exchange, so it doesn't perform this automatically.\n        window.localStorage.removeItem(`oidc.${oauthState}`);\n        let refreshOptions;\n        if (tokens.refreshToken !== undefined) {\n            refreshOptions = {\n                sessionId: storedSessionId,\n                refreshToken: tokens.refreshToken,\n                tokenRefresher: this.tokerRefresher,\n            };\n        }\n        const authFetch = solidClientAuthnCore.buildAuthenticatedFetch(tokens.accessToken, {\n            dpopKey: tokens.dpopKey,\n            refreshOptions,\n            eventEmitter,\n            expiresIn: tokens.expiresIn,\n        });\n        await solidClientAuthnCore.saveSessionInfoToStorage(this.storageUtility, storedSessionId, tokens.webId, tokens.clientId, \"true\", undefined, true);\n        const sessionInfo = await this.sessionInfoManager.get(storedSessionId);\n        if (!sessionInfo) {\n            throw new Error(`Could not retrieve session: [${storedSessionId}].`);\n        }\n        return Object.assign(sessionInfo, {\n            fetch: authFetch,\n            getLogoutUrl: solidClientAuthnCore.maybeBuildRpInitiatedLogout({\n                idTokenHint: tokens.idToken,\n                endSessionEndpoint: issuerConfig.endSessionEndpoint,\n            }),\n            expirationDate: typeof tokens.expiresIn === \"number\"\n                ? tokenCreatedAt + tokens.expiresIn * 1000\n                : undefined,\n        });\n    }\n}\n\n//\n// Copyright Inrupt Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal in\n// the Software without restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the\n// Software, and to permit persons to whom the Software is furnished to do so,\n// subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n/**\n * @hidden\n */\nclass AggregateRedirectHandler extends solidClientAuthnCore.AggregateHandler {\n    constructor(redirectHandlers) {\n        super(redirectHandlers);\n    }\n}\n\n//\n// Copyright Inrupt Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal in\n// the Software without restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the\n// Software, and to permit persons to whom the Software is furnished to do so,\n// subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n/**\n * @hidden\n */\nclass BrowserStorage {\n    get storage() {\n        return window.localStorage;\n    }\n    async get(key) {\n        return this.storage.getItem(key) || undefined;\n    }\n    async set(key, value) {\n        this.storage.setItem(key, value);\n    }\n    async delete(key) {\n        this.storage.removeItem(key);\n    }\n}\n\n//\n// Copyright Inrupt Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal in\n// the Software without restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the\n// Software, and to permit persons to whom the Software is furnished to do so,\n// subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n/**\n * @hidden\n */\nclass Redirector {\n    redirect(redirectUrl, options) {\n        if (options && options.handleRedirect) {\n            options.handleRedirect(redirectUrl);\n        }\n        else if (options && options.redirectByReplacingState) {\n            window.history.replaceState({}, \"\", redirectUrl);\n        }\n        else {\n            window.location.href = redirectUrl;\n        }\n    }\n}\n\n//\n// Copyright Inrupt Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal in\n// the Software without restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the\n// Software, and to permit persons to whom the Software is furnished to do so,\n// subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n/**\n * @hidden\n */\nclass ClientRegistrar {\n    storageUtility;\n    constructor(storageUtility) {\n        this.storageUtility = storageUtility;\n        this.storageUtility = storageUtility;\n    }\n    async getClient(options, issuerConfig) {\n        // If client secret and/or client id are stored in storage, use those.\n        const [storedClientId, storedClientSecret, expiresAt, storedClientName, storedClientType,] = await Promise.all([\n            this.storageUtility.getForUser(options.sessionId, \"clientId\", {\n                secure: false,\n            }),\n            this.storageUtility.getForUser(options.sessionId, \"clientSecret\", {\n                secure: false,\n            }),\n            this.storageUtility.getForUser(options.sessionId, \"expiresAt\", {\n                secure: false,\n            }),\n            this.storageUtility.getForUser(options.sessionId, \"clientName\", {\n                secure: false,\n            }),\n            this.storageUtility.getForUser(options.sessionId, \"clientType\", {\n                secure: false,\n            }),\n        ]);\n        // -1 is used as a default to identify legacy cases when a value should\n        // have been stored, but wasn't. It will be treated as an expired client.\n        const expirationDate = expiresAt !== undefined ? Number.parseInt(expiresAt, 10) : -1;\n        // Expiration is only applicable to confidential clients.\n        // If the client registration never expires, then the expirationDate is 0.\n        // Note that Date.now() is in milliseconds, and expirationDate in seconds.\n        const expired = storedClientSecret !== undefined &&\n            expirationDate !== 0 &&\n            Math.floor(Date.now() / 1000) > expirationDate;\n        if (storedClientId && solidClientAuthnCore.isKnownClientType(storedClientType) && !expired) {\n            return storedClientSecret !== undefined\n                ? {\n                    clientId: storedClientId,\n                    clientSecret: storedClientSecret,\n                    clientName: storedClientName,\n                    // Note: static clients are not applicable in a browser context.\n                    clientType: \"dynamic\",\n                    expiresAt: expirationDate,\n                }\n                : {\n                    clientId: storedClientId,\n                    clientName: storedClientName,\n                    // Note: static clients are not applicable in a browser context.\n                    clientType: storedClientType,\n                    // The type assertion is required even though the type should match the declaration.\n                };\n        }\n        try {\n            const registeredClient = await oidcClientExt.registerClient(options, issuerConfig);\n            // Save info\n            const infoToSave = {\n                clientId: registeredClient.clientId,\n                clientType: \"dynamic\",\n            };\n            if (registeredClient.clientSecret !== undefined) {\n                infoToSave.clientSecret = registeredClient.clientSecret;\n                infoToSave.expiresAt = String(registeredClient.expiresAt);\n            }\n            if (registeredClient.idTokenSignedResponseAlg) {\n                infoToSave.idTokenSignedResponseAlg =\n                    registeredClient.idTokenSignedResponseAlg;\n            }\n            await this.storageUtility.setForUser(options.sessionId, infoToSave, {\n                // FIXME: figure out how to persist secure storage at reload\n                // Otherwise, the client info cannot be retrieved from storage, and\n                // the lib tries to re-register the client on each fetch\n                secure: false,\n            });\n            return registeredClient;\n        }\n        catch (error) {\n            throw new Error(`Client registration failed.`, { cause: error });\n        }\n    }\n}\n\n//\n// Copyright Inrupt Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal in\n// the Software without restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the\n// Software, and to permit persons to whom the Software is furnished to do so,\n// subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n/**\n * This class handles redirect IRIs without any query params, and returns an unauthenticated\n * session. It serves as a fallback so that consuming libraries don't have to test\n * for the query params themselves, and can always try to use them as a redirect IRI.\n * @hidden\n */\nclass ErrorOidcHandler {\n    async canHandle(redirectUrl) {\n        try {\n            // eslint-disable-next-line no-new\n            return new URL(redirectUrl).searchParams.has(\"error\");\n        }\n        catch (e) {\n            throw new Error(`[${redirectUrl}] is not a valid URL, and cannot be used as a redirect URL: ${e}`);\n        }\n    }\n    async handle(redirectUrl, eventEmitter) {\n        if (eventEmitter !== undefined) {\n            const url = new URL(redirectUrl);\n            const errorUrl = url.searchParams.get(\"error\");\n            const errorDescriptionUrl = url.searchParams.get(\"error_description\");\n            eventEmitter.emit(solidClientAuthnCore.EVENTS.ERROR, errorUrl, errorDescriptionUrl);\n        }\n        return solidClientAuthnCore.getUnauthenticatedSession();\n    }\n}\n\n//\n// Copyright Inrupt Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal in\n// the Software without restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the\n// Software, and to permit persons to whom the Software is furnished to do so,\n// subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n// Some identifiers are not in camelcase on purpose, as they are named using the\n// official names from the OIDC/OAuth2 specifications.\n/* eslint-disable camelcase */\n/**\n * @hidden\n */\nclass TokenRefresher {\n    storageUtility;\n    issuerConfigFetcher;\n    clientRegistrar;\n    constructor(storageUtility, issuerConfigFetcher, clientRegistrar) {\n        this.storageUtility = storageUtility;\n        this.issuerConfigFetcher = issuerConfigFetcher;\n        this.clientRegistrar = clientRegistrar;\n        this.storageUtility = storageUtility;\n        this.issuerConfigFetcher = issuerConfigFetcher;\n        this.clientRegistrar = clientRegistrar;\n    }\n    async refresh(sessionId, refreshToken, dpopKey, eventEmitter) {\n        const oidcContext = await solidClientAuthnCore.loadOidcContextFromStorage(sessionId, this.storageUtility, this.issuerConfigFetcher);\n        // This should also retrieve the client from storage\n        const clientInfo = await this.clientRegistrar.getClient({ sessionId }, oidcContext.issuerConfig);\n        if (refreshToken === undefined) {\n            // TODO: in a next PR, look up storage for a refresh token\n            throw new Error(`Session [${sessionId}] has no refresh token to allow it to refresh its access token.`);\n        }\n        if (oidcContext.dpop && dpopKey === undefined) {\n            throw new Error(`For session [${sessionId}], the key bound to the DPoP access token must be provided to refresh said access token.`);\n        }\n        const tokenSet = await oidcClientExt.refresh(refreshToken, oidcContext.issuerConfig, clientInfo, dpopKey);\n        if (tokenSet.refreshToken !== undefined) {\n            eventEmitter?.emit(solidClientAuthnCore.EVENTS.NEW_REFRESH_TOKEN, tokenSet.refreshToken);\n        }\n        return tokenSet;\n    }\n}\n\n//\n// Copyright Inrupt Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal in\n// the Software without restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the\n// Software, and to permit persons to whom the Software is furnished to do so,\n// subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n/**\n * @param dependencies\n * @hidden\n */\nfunction getClientAuthenticationWithDependencies(dependencies) {\n    const inMemoryStorage = new solidClientAuthnCore.InMemoryStorage();\n    const secureStorage = dependencies.secureStorage || inMemoryStorage;\n    const insecureStorage = dependencies.insecureStorage || new BrowserStorage();\n    const storageUtility = new StorageUtilityBrowser(secureStorage, insecureStorage);\n    const issuerConfigFetcher = new IssuerConfigFetcher(storageUtility);\n    const clientRegistrar = new ClientRegistrar(storageUtility);\n    const sessionInfoManager = new SessionInfoManager(storageUtility);\n    const tokenRefresher = new TokenRefresher(storageUtility, issuerConfigFetcher, clientRegistrar);\n    const redirector = new Redirector();\n    // make new handler for redirect and login\n    const loginHandler = new OidcLoginHandler(storageUtility, new AuthorizationCodeWithPkceOidcHandler(storageUtility, redirector), issuerConfigFetcher, clientRegistrar);\n    const redirectHandler = new AggregateRedirectHandler([\n        new ErrorOidcHandler(),\n        new AuthCodeRedirectHandler(storageUtility, sessionInfoManager, issuerConfigFetcher, clientRegistrar, tokenRefresher),\n        // This catch-all class will always be able to handle the\n        // redirect IRI, so it must be registered last.\n        new FallbackRedirectHandler(),\n    ]);\n    return new ClientAuthentication(loginHandler, redirectHandler, new solidClientAuthnCore.IWaterfallLogoutHandler(sessionInfoManager, redirector), sessionInfoManager, issuerConfigFetcher);\n}\n\n//\n// Copyright Inrupt Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal in\n// the Software without restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the\n// Software, and to permit persons to whom the Software is furnished to do so,\n// subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\nconst KEY_CURRENT_SESSION = `${solidClientAuthnCore.SOLID_CLIENT_AUTHN_KEY_PREFIX}currentSession`;\nconst KEY_CURRENT_URL = `${solidClientAuthnCore.SOLID_CLIENT_AUTHN_KEY_PREFIX}currentUrl`;\n\n//\n// Copyright Inrupt Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal in\n// the Software without restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the\n// Software, and to permit persons to whom the Software is furnished to do so,\n// subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\nasync function silentlyAuthenticate(sessionId, clientAuthn, session) {\n    const storedSessionInfo = await clientAuthn.validateCurrentSession(sessionId);\n    if (storedSessionInfo !== null) {\n        // It can be really useful to save the user's current browser location,\n        // so that we can restore it after completing the silent authentication\n        // on incoming redirect. This way, the user is eventually redirected back\n        // to the page they were on and not to the app's redirect page.\n        window.localStorage.setItem(KEY_CURRENT_URL, window.location.href);\n        await clientAuthn.login({\n            sessionId,\n            prompt: \"none\",\n            oidcIssuer: storedSessionInfo.issuer,\n            redirectUrl: storedSessionInfo.redirectUrl,\n            clientId: storedSessionInfo.clientAppId,\n            clientSecret: storedSessionInfo.clientAppSecret,\n            tokenType: storedSessionInfo.tokenType ?? \"DPoP\",\n        }, session.events);\n        return true;\n    }\n    return false;\n}\nfunction isLoggedIn(sessionInfo) {\n    return !!sessionInfo?.isLoggedIn;\n}\n/**\n * A {@link Session} object represents a user's session on an application. The session holds state, as it stores information enabling access to private resources after login for instance.\n */\nclass Session {\n    /**\n     * Information regarding the current session.\n     */\n    info;\n    /**\n     * Session attribute exposing the EventEmitter interface, to listen on session\n     * events such as login, logout, etc.\n     * @since 1.15.0\n     */\n    events;\n    clientAuthentication;\n    tokenRequestInProgress = false;\n    /**\n     * Session object constructor. Typically called as follows:\n     *\n     * ```typescript\n     * const session = new Session();\n     * ```\n     *\n     * See also [getDefaultSession](https://docs.inrupt.com/developer-tools/api/javascript/solid-client-authn-browser/functions.html#getdefaultsession).\n     *\n     * @param sessionOptions The options enabling the correct instantiation of\n     * the session. Either both storages or clientAuthentication are required. For\n     * more information, see {@link ISessionOptions}.\n     * @param sessionId A string uniquely identifying the session.\n     *\n     */\n    constructor(sessionOptions = {}, sessionId = undefined) {\n        this.events = new EventEmitter();\n        if (sessionOptions.clientAuthentication) {\n            this.clientAuthentication = sessionOptions.clientAuthentication;\n        }\n        else if (sessionOptions.secureStorage && sessionOptions.insecureStorage) {\n            this.clientAuthentication = getClientAuthenticationWithDependencies({\n                secureStorage: sessionOptions.secureStorage,\n                insecureStorage: sessionOptions.insecureStorage,\n            });\n        }\n        else {\n            this.clientAuthentication = getClientAuthenticationWithDependencies({});\n        }\n        if (sessionOptions.sessionInfo) {\n            this.info = {\n                sessionId: sessionOptions.sessionInfo.sessionId,\n                isLoggedIn: false,\n                webId: sessionOptions.sessionInfo.webId,\n                clientAppId: sessionOptions.sessionInfo.clientAppId,\n            };\n        }\n        else {\n            this.info = {\n                sessionId: sessionId ?? uuid.v4(),\n                isLoggedIn: false,\n            };\n        }\n        // When a session is logged in, we want to track its ID in local storage to\n        // enable silent refresh. The current session ID specifically stored in 'localStorage'\n        // (as opposed to using our storage abstraction layer) because it is only\n        // used in a browser-specific mechanism.\n        this.events.on(solidClientAuthnCore.EVENTS.LOGIN, () => window.localStorage.setItem(KEY_CURRENT_SESSION, this.info.sessionId));\n        this.events.on(solidClientAuthnCore.EVENTS.SESSION_EXPIRED, () => this.internalLogout(false));\n        this.events.on(solidClientAuthnCore.EVENTS.ERROR, () => this.internalLogout(false));\n    }\n    /**\n     * Triggers the login process. Note that this method will redirect the user away from your app.\n     *\n     * @param options Parameter to customize the login behaviour. In particular, two options are mandatory: `options.oidcIssuer`, the user's identity provider, and `options.redirectUrl`, the URL to which the user will be redirected after logging in their identity provider.\n     * @returns This method should redirect the user away from the app: it does not return anything. The login process is completed by {@linkcode handleIncomingRedirect}.\n     */\n    // Define these functions as properties so that they don't get accidentally re-bound.\n    // Isn't Javascript fun?\n    login = async (options) => {\n        await this.clientAuthentication.login({\n            sessionId: this.info.sessionId,\n            ...options,\n            // Defaults the token type to DPoP\n            tokenType: options.tokenType ?? \"DPoP\",\n        }, this.events);\n        // `login` redirects the user away from the app,\n        // so unless it throws an error, there is no code that should run afterwards\n        // (since there is no \"after\" in the lifetime of the script).\n        // Hence, this Promise never resolves:\n        return new Promise(() => { });\n    };\n    /**\n     * Fetches data using available login information. If the user is not logged in, this will behave as a regular `fetch`. The signature of this method is identical to the [canonical `fetch`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).\n     *\n     * @param url The URL from which data should be fetched.\n     * @param init Optional parameters customizing the request, by specifying an HTTP method, headers, a body, etc. Follows the [WHATWG Fetch Standard](https://fetch.spec.whatwg.org/).\n     */\n    fetch = (url, init) => this.clientAuthentication.fetch(url, init);\n    /**\n     * An internal logout function, to control whether or not the logout signal\n     * should be sent, i.e. if the logout was user-initiated or is the result of\n     * an external event.\n     *\n     * @hidden\n     */\n    internalLogout = async (emitSignal, options) => {\n        // Clearing this value means that silent refresh will no longer be attempted.\n        // In particular, in the case of a silent authentication error it prevents\n        // from getting stuck in an authentication retries loop.\n        window.localStorage.removeItem(KEY_CURRENT_SESSION);\n        await this.clientAuthentication.logout(this.info.sessionId, options);\n        this.info.isLoggedIn = false;\n        if (emitSignal) {\n            this.events.emit(solidClientAuthnCore.EVENTS.LOGOUT);\n        }\n    };\n    /**\n     * Logs the user out of the application.\n     *\n     * There are 2 types of logout supported by this library,\n     * `app` logout and `idp` logout.\n     *\n     * App logout will log the user out within the application\n     * by clearing any session data from the browser. It does\n     * not log the user out of their Solid identity provider,\n     * and should not redirect the user away.\n     * App logout can be performed as follows:\n     * ```typescript\n     * await session.logout({ logoutType: 'app' });\n     * ```\n     *\n     * IDP logout will log the user out of their Solid identity provider,\n     * and will redirect the user away from the application to do so. In order\n     * for users to be redirected back to `postLogoutUrl` you MUST include the\n     * `postLogoutUrl` value in the `post_logout_redirect_uris` field in the\n     * [Client ID Document](https://docs.inrupt.com/ess/latest/security/authentication/#client-identifier-client-id).\n     * IDP logout can be performed as follows:\n     * ```typescript\n     * await session.logout({\n     *  logoutType: 'idp',\n     *  // An optional URL to redirect to after logout has completed;\n     *  // this MUST match a logout URL listed in the Client ID Document\n     *  // of the application that is logged in.\n     *  // If the application is logged in with a Client ID that is not\n     *  // a URI dereferencing to a Client ID Document then users will\n     *  // not be redirected back to the `postLogoutUrl` after logout.\n     *  postLogoutUrl: 'https://example.com/logout',\n     *  // An optional value to be included in the query parameters\n     *  // when the IDP provider redirects the user to the postLogoutRedirectUrl.\n     *  state: \"my-state\"\n     * });\n     * ```\n     */\n    logout = async (options) => this.internalLogout(true, options);\n    /**\n     * Completes the login process by processing the information provided by the\n     * Solid identity provider through redirect.\n     *\n     * @param options See {@link IHandleIncomingRedirectOptions}.\n     */\n    handleIncomingRedirect = async (inputOptions = {}) => {\n        if (this.info.isLoggedIn) {\n            return this.info;\n        }\n        if (this.tokenRequestInProgress) {\n            return undefined;\n        }\n        const options = typeof inputOptions === \"string\" ? { url: inputOptions } : inputOptions;\n        const url = options.url ?? window.location.href;\n        this.tokenRequestInProgress = true;\n        const sessionInfo = await this.clientAuthentication.handleIncomingRedirect(url, this.events);\n        if (isLoggedIn(sessionInfo)) {\n            this.setSessionInfo(sessionInfo);\n            const currentUrl = window.localStorage.getItem(KEY_CURRENT_URL);\n            if (currentUrl === null) {\n                // The login event can only be triggered **after** the user has been\n                // redirected from the IdP with access and ID tokens.\n                this.events.emit(solidClientAuthnCore.EVENTS.LOGIN);\n            }\n            else {\n                // If an URL is stored in local storage, we are being logged in after a\n                // silent authentication, so remove our currently stored URL location\n                // to clean up our state now that we are completing the re-login process.\n                window.localStorage.removeItem(KEY_CURRENT_URL);\n                this.events.emit(solidClientAuthnCore.EVENTS.SESSION_RESTORED, currentUrl);\n            }\n        }\n        else if (options.restorePreviousSession === true) {\n            // Silent authentication happens after a refresh, which means there are no\n            // OAuth params in the current location IRI. It can only succeed if a session\n            // was previously logged in, in which case its ID will be present with a known\n            // identifier in local storage.\n            // Check if we have a locally stored session ID...\n            const storedSessionId = window.localStorage.getItem(KEY_CURRENT_SESSION);\n            // ...if not, then there is no ID token, and so silent authentication cannot happen, but\n            // if we do have a stored session ID, attempt to re-authenticate now silently.\n            if (storedSessionId !== null) {\n                const attemptedSilentAuthentication = await silentlyAuthenticate(storedSessionId, this.clientAuthentication, this);\n                // At this point, we know that the main window will imminently be redirected.\n                // However, this redirect is asynchronous and there is no way to halt execution\n                // until it happens precisely. That's why the current Promise simply does not\n                // resolve.\n                if (attemptedSilentAuthentication) {\n                    return new Promise(() => { });\n                }\n            }\n        }\n        this.tokenRequestInProgress = false;\n        return sessionInfo;\n    };\n    setSessionInfo(sessionInfo) {\n        this.info.isLoggedIn = sessionInfo.isLoggedIn;\n        this.info.webId = sessionInfo.webId;\n        this.info.sessionId = sessionInfo.sessionId;\n        this.info.clientAppId = sessionInfo.clientAppId;\n        this.info.expirationDate = sessionInfo.expirationDate;\n        this.events.on(solidClientAuthnCore.EVENTS.SESSION_EXTENDED, (expiresIn) => {\n            this.info.expirationDate = Date.now() + expiresIn * 1000;\n        });\n    }\n}\n\n//\n// Copyright Inrupt Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal in\n// the Software without restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the\n// Software, and to permit persons to whom the Software is furnished to do so,\n// subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\nlet defaultSession;\n/**\n * Obtain the {@link Session} used when not explicitly instantiating one yourself.\n *\n * When using the top-level exports {@link fetch}, {@link login}, {@link logout},\n * {@link handleIncomingRedirect}, {@link onLogin} and {@link onLogout}, these apply to an\n * implicitly-instantiated {@link Session}.\n * This function returns a reference to that Session in order to obtain e.g. the current user's\n * WebID.\n * @since 1.3.0\n */\nfunction getDefaultSession() {\n    if (typeof defaultSession === \"undefined\") {\n        defaultSession = new Session();\n    }\n    return defaultSession;\n}\n/**\n * This function's signature is equal to `window.fetch`, but if the current user is authenticated\n * (see [[login]] and [[handleIncomingRedirect]]), requests made using it will include that user's\n * credentials. If not, this will behave just like the regular `window.fetch`.\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch}\n * @since 1.3.0\n */\n/* eslint-disable-next-line no-shadow */\nfunction fetch$1(...args) {\n    const session = getDefaultSession();\n    return session.fetch(...args);\n}\n/**\n * Triggers the login process. Note that this method will redirect the user away from your app.\n *\n * @param options Parameter to customize the login behaviour. In particular, two options are mandatory: `options.oidcIssuer`, the user's identity provider, and `options.redirectUrl`, the URL to which the user will be redirected after logging in their identity provider.\n * @returns This method should redirect the user away from the app: it does not return anything. The login process is completed by [[handleIncomingRedirect]].\n * @since 1.3.0\n */\nfunction login(...args) {\n    const session = getDefaultSession();\n    return session.login(...args);\n}\n/**\n * Logs the user out of the application.\n *\n * By default this does not log the user out of their Solid identity provider.\n * In order to do so, you must set the logoutType to `idp`. For usage details\n * see {@link Session.logout}.\n *\n * @since 1.3.0\n */\nfunction logout(...args) {\n    const session = getDefaultSession();\n    return session.logout(...args);\n}\n/**\n * Completes the login process by processing the information provided by the Solid identity provider through redirect.\n *\n * @param url The URL of the page handling the redirect, including the query parameters — these contain the information to process the login.\n * @since 1.3.0\n */\nfunction handleIncomingRedirect(...args) {\n    const session = getDefaultSession();\n    return session.handleIncomingRedirect(...args);\n}\n/**\n * {@link SessionEventEmitter} instance to subscribe to events by the default session.\n *\n * @since 1.14.0\n */\nfunction events() {\n    return getDefaultSession().events;\n}\n\nObject.defineProperty(exports, \"ConfigurationError\", {\n    enumerable: true,\n    get: function () { return solidClientAuthnCore.ConfigurationError; }\n});\nObject.defineProperty(exports, \"EVENTS\", {\n    enumerable: true,\n    get: function () { return solidClientAuthnCore.EVENTS; }\n});\nObject.defineProperty(exports, \"InMemoryStorage\", {\n    enumerable: true,\n    get: function () { return solidClientAuthnCore.InMemoryStorage; }\n});\nObject.defineProperty(exports, \"NotImplementedError\", {\n    enumerable: true,\n    get: function () { return solidClientAuthnCore.NotImplementedError; }\n});\nexports.Session = Session;\nexports.events = events;\nexports.fetch = fetch$1;\nexports.getDefaultSession = getDefaultSession;\nexports.handleIncomingRedirect = handleIncomingRedirect;\nexports.login = login;\nexports.logout = logout;\n\n"]}