{"version":3,"file":"selectSsrKeyValueStorage.mjs","sources":["../../../src/context/selectSsrKeyValueStorage.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { CookieStorage, defaultStorage } from '../storage';\n/**\n * Selects the key-value storage backing the default auth providers based on\n * the `ssr` library option:\n *\n * - `ssr: true` → a **fresh** cookie-based storage (`sameSite: 'lax'`), so\n *   tokens survive server-side rendering round-trips. Callers that also need\n *   a cookie-backed identity-id store (e.g. the `aws-amplify` umbrella's\n *   default Cognito credentials provider) should reuse the returned instance\n *   for it.\n * - otherwise → the shared {@link defaultStorage} (`localStorage`-backed)\n *   singleton.\n *\n * Extracted from the `aws-amplify` umbrella's library-options resolution so\n * the SSR storage choice lives in a single place.\n *\n * @param ssr - The `LibraryOptions.ssr` flag.\n * @returns The key-value storage to back token/credentials providers with.\n *\n * @internal\n */\nexport function selectSsrKeyValueStorage(ssr) {\n    return ssr ? new CookieStorage({ sameSite: 'lax' }) : defaultStorage;\n}\n"],"names":[],"mappings":";;;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,wBAAwB,CAAC,GAAG,EAAE;AAC9C,IAAI,OAAO,GAAG,GAAG,IAAI,aAAa,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,GAAG,cAAc;AACxE;;;;"}